Exception/crash when scanning while pairing

S Sean Proctor 3 years 1 month ago
35 0 0

When pairing a scanner, there is a moment where it is possible to cause a crash from the SDK. This works in any app using the <code>dcssdkGetPairingBarcode</code> method, including the Scanner Control app in the play store.

Steps to reproduce:
* Scan pairing barcode in app
* Hit "pair" in the dialog
* Wait until just after the light on the scanner stops flashing green, but before the SDK sends the DCSSDK_EVENT_SESSION_ESTABLISHMENT notification
* Scan a barcode

Exception:
<code>
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.github.sproctor.scannercompose, PID: 22537
java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.UUID android.bluetooth.BluetoothGattCharacteristic.getUuid()' on a null object reference
at com.zebra.scannercontrol.BluetoothLEScanner.writeData(BluetoothLEScanner.java:633)
at com.zebra.scannercontrol.BluetoothLEScanner.cmdAck(BluetoothLEScanner.java:993)
at com.zebra.scannercontrol.BluetoothLEScanner.access$200(BluetoothLEScanner.java:71)
at com.zebra.scannercontrol.BluetoothLEScanner$LEScannerHandler.handleMessage(BluetoothLEScanner.java:164)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8587)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
</code>

CONTACT
Can’t find what you’re looking for?