G GeoffT660 Active Member Licensed User Longtime User Mar 15, 2021 #1 I have been using AsyncStreamsText to read pdf417 data from a bluetooth barcode scanner using a suffix character without issue but am wondering if its possible to detect the end of the barcode read without a suffix character or if there is a better method to read drivers license data with a bluetooth barcode scanner as mentioned.
I have been using AsyncStreamsText to read pdf417 data from a bluetooth barcode scanner using a suffix character without issue but am wondering if its possible to detect the end of the barcode read without a suffix character or if there is a better method to read drivers license data with a bluetooth barcode scanner as mentioned.
Erel B4X founder Staff member Licensed User Longtime User Mar 15, 2021 #2 Here is a general way to find out when an operation has ended: Code: Sub Update OperationIndex = OperationIndex + 1 'global Int variable Dim MyIndex As Int = OperationIndex Sleep(300) '<-- change as needed If MyIndex = OperationIndex Then Log("Operation ended") End If End Sub It is based on the index pattern: [B4X] Resumable subs and the index pattern In your case you need to call Update from the new text event. Upvote 0
Here is a general way to find out when an operation has ended: Code: Sub Update OperationIndex = OperationIndex + 1 'global Int variable Dim MyIndex As Int = OperationIndex Sleep(300) '<-- change as needed If MyIndex = OperationIndex Then Log("Operation ended") End If End Sub It is based on the index pattern: [B4X] Resumable subs and the index pattern In your case you need to call Update from the new text event.
G GeoffT660 Active Member Licensed User Longtime User Mar 15, 2021 #3 Thanks Erel. This works fine but can see the sleep value is very critical and also slows down the operation. On a 1D barcode I can set sleep(0) or not use the update function at all but on the pdf417 I need to set sleep(400) minimum. Will this value need to be adjusted based on the speed of the scanner, Android device or BT connection? Are there any other options for reading a PDF417 with SPP? Upvote 0
Thanks Erel. This works fine but can see the sleep value is very critical and also slows down the operation. On a 1D barcode I can set sleep(0) or not use the update function at all but on the pdf417 I need to set sleep(400) minimum. Will this value need to be adjusted based on the speed of the scanner, Android device or BT connection? Are there any other options for reading a PDF417 with SPP?
Erel B4X founder Staff member Licensed User Longtime User Mar 16, 2021 #4 The sleep duration depends on the intervals between the readings. You can measure it by adding Log(DateTime.Now) in Update sub. Upvote 0
The sleep duration depends on the intervals between the readings. You can measure it by adding Log(DateTime.Now) in Update sub.