I use a 2D barcode scanner to scan the barcode (CODE128) off a smartphone screen. I have a program (python script) to listen for the scanned data while the code is being scanned, however, the issue is that sometimes the data received in the python script is not complete (e.g. less number of digits than expected), but the scanner beeps so it's inside the python script where the data is partially lost/not captured sometimes.
So I was wondering, is there a way to give a command to the USB scanner to beep from the Python program only after the script validates the received digits? So if the received digits are not correct, then don't let the scanner beep, otherwise, let the scanner beep.
If this helps, I'm using this python script for listening to scanned data.
(the barcode scanner is Eyoyo EY-H1)