Reputation: 307
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
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