Inateck-Technology-Inc / python_sdk

2 stars 1 forks source link

SDK use #1

Closed BGiorda closed 3 days ago

BGiorda commented 6 days ago

Hello,

I bought the new Inateck Pro 8 QRCode scanner. I connected the scanner to my laptop in Bluetooth. When I scan a QRCode, the QRCode content appears in the focused notepad of my laptop. This is OK. However my laptop keyboard is German (but don't speak German), then some characters are wrong because the scanner is confgured for US keyboard. Where can I change this configuration? I would like to use the Python SDK to transfer scanned data to my laptop. It's possible if the scanner is connected to the laptop in Bluetooth? Do you have a simple Python code as an example (different from demo.py)? Where can I find the mac unique scanner number? It is the MAC Address ('AA:2B:00:03:5F:85' in my case)?

Something like: mac = 'AA:2B:00:03:5F:85' inateck = InateckScannerBle() inateck.connect(mac) inateck.auth(mac) inateck.uploadData(mac)??? inateck.disconnect(mac)

Thank you in advance. best regards,

Boris

soSeven commented 5 days ago

Hello,The barcode scanner can be connected to a laptop via Bluetooth. You can switch the scanner's keyboard mode using the user manual and the Inateck App.You can run demo.py, which is a working example. To obtain the unique MAC address of the scanner, you need to call startScan to search for nearby barcode scanner devices via Bluetooth. Once a scanner is detected, a callback will provide you with the MAC address of the discovered device. With this MAC address, you can then use the connect function to establish a connection and proceed with your desired operations.

BGiorda commented 3 days ago

Hello, Now I can access to the scanner via the sdk, after correct connection via Bluetooth. My code:

def scan_callback(mac): print(mac.decode('utf-8')

def code_callback(code): print(code.decode('utf-8')

inateck = IntateckScannerBle() inateck.registerEvent(scan_callback) inateck.startScan() mac = 'AB:2B:00:03:5F:85' # value obtained from startScan() inateck.connect(mac, code_callback) inateck.auth(mac)

Here I can get the settings

inateck.getSettingInfo(mac)

If I scan a QRCode, it appears in code_callback. It's perfect. However, if the QRCode content is relatively big (around 600 characters), nothing apprears. Without the sdk, the same QRCode content is correctly trasnfered to the notepad. Do you have an idea of why I get this problem? and how to solve it?

Best regards,

Boris Giordanengo