Hi all,
I have a perspective app that relies on barcode scanning events to pass data throughout itself. I am currently using barcode session events to handle the incoming data as follows.
if context['event'] == 'scan':
# clicked to scan any barcode
if context['barcode_type'] == 'any':
LOGGER.info("sending scannedBarcode message with payload: %s"%data['text'])
res = system.perspective.sendMessage('scannedBarcode', payload={'data': data['text']}, scope='session')
All buttons that trigger a scan event listen to the corresponding message, and call a script in the project library to the handle the data accordingly.
It has been requested that I find a way to implement a bluetooth scanner in order to avoid having to use the built in cameras on tablets running perspective. Through some quick tests, the bluetooth scanners seem to operate by sending keystrokes (text) back to the paired device.
My current solution would be to add a toggle button to handle the scan events either with the tablet and eventHandlers as is currently working, or let the operator select to use a hand scanner. The hand scanner would likely have to override the scan events and just write text back to where it belongs in memory. This seems doable but a bit messy.
Long story short, does anyone have a cleaner way to have external cameras/scanners report back to the scan event from the built-in camera?