0

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.

daisy
  • 277
  • 1
  • 5
  • 16

1 Answers1

1

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
    }
});
danvy
  • 2,085
  • 12
  • 17