daisy
daisy

Reputation: 307

Detect bluetooth scanner and read barcode when available in Win RT

I am able to scan a bar code using Bluetooth scanner on a button click in VS 2015, but I want to write a code, which would detect my bluetooth device any time, when I try to scan any barcode and not only on a button click.

Upvotes: 0

Views: 125

Answers (1)

danvy
danvy

Reputation: 2105

Using nearly the same code you have in your button, you might : - Connect once to your device - Read continuously the Bluetooth stream to get the barcodes in a task

await Task.Run(() =>
{
    while(true
    {
         //Read your BT stream
    }
});

Upvotes: 1

Related Questions