G GeoffT660 Active Member Licensed User Longtime User Dec 25, 2017 #1 I am trying to scan a 2D barcode using a Bluetooth scanner and save the output to a variable as in the Async Tutorial using B4X: mScan = sf.Trim(BytesToString(Buffer, 0, Buffer.Length, "UTF8")) Log("Received: " & mScan) but ASteam_NewData requires 3 passes to collect all the data. How can I tell when all the data is collected and then pass that value with all the data or wait until the data is collected before processing?
I am trying to scan a 2D barcode using a Bluetooth scanner and save the output to a variable as in the Async Tutorial using B4X: mScan = sf.Trim(BytesToString(Buffer, 0, Buffer.Length, "UTF8")) Log("Received: " & mScan) but ASteam_NewData requires 3 passes to collect all the data. How can I tell when all the data is collected and then pass that value with all the data or wait until the data is collected before processing?
Erel B4X founder Staff member Licensed User Longtime User Dec 26, 2017 #2 Why are you using StringFunctions? B4X: mScan = BytesToString(Buffer, 0, Buffer.Length, "UTF8").Trim Does the barcode send an end of line character at the end of each full message? If so then you can use AsyncStreamsText. Upvote 0
Why are you using StringFunctions? B4X: mScan = BytesToString(Buffer, 0, Buffer.Length, "UTF8").Trim Does the barcode send an end of line character at the end of each full message? If so then you can use AsyncStreamsText.