zebra-technologies / Scanner-SDK-for-Android

The Zebra Scanner SDK for Android enables cordless scanners to be connected and controlled by a tablet / smart phone without using a cradle, after pairing over Bluetooth.
https://www.zebra.com/us/en/support-downloads/software/developer-tools/scanner-sdk-for-android.html
MIT License
39 stars 17 forks source link

Unable to pair DS2278 manually via latest Android SDK #5

Closed Pranit-Harekar closed 1 year ago

Pranit-Harekar commented 1 year ago

Environment: Android Scanner SDK version: v2.6.10.0 Android version: 10 Scanner Model: DS2278 Firmware version: CAADFS00-003-R00 Operation Mode: DCSSDK_OPMODE_BT_NORMAL

Source Code: https://gist.github.com/Pranit-Harekar/548998a4f8b66fcae000ad15b81bd8f7

Description: As per the manual for Scanner Android SDK, there are two ways to pair scanner -

  1. Manual - scan HID Bluetooth Classic barcode provided in the getting started manual and connect scanner directly from Android device
  2. Through generated pairing barcode However, when scanner is paired using the manual approach, the SDK fails to establish connection using dcssdkEstablishCommunicationSession method. Please refer to the following logs -
I/BluetoothManager: Trying to connect to socket. Attempt = 3
W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
E/BluetoothManager: Unable to connect() socket
java.io.IOException: read failed, socket might closed or timeout, read ret: -1
at android.bluetooth.BluetoothSocket.readAll(BluetoothSocket.java:772)
at android.bluetooth.BluetoothSocket.readInt(BluetoothSocket.java:786)
at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:404)
at com.zebra.scannercontrol.BluetoothManager$ConnectThread.run(BluetoothManager.java:549)
E/BluetoothManager: ConnectThread notify
E/BluetoothManager: ConnectThread notify completed
I/BluetoothManager: connect:wait completed
I/BluetoothManager: connect:Connection not successful
I/SDKHandler: connectToAvailableScanner() connMgr.connect returns false
I/BluetoothManager: setState() 2 -> 1
I/BluetoothManager: ConnectThread close()
D/BluetoothSocket: close() this: android.bluetooth.BluetoothSocket@629ea2a, channel: -1, mSocketIS: android.net.LocalSocketImpl$SocketInputStream@badb01b, mSocketOS: android.net.LocalSocketImpl$SocketOutputStream@47e65b8mSocket: android.net.LocalSocket@11f8f91 impl:android.net.LocalSocketImpl@3547ef6 fd:java.io.FileDescriptor@1ed32f7, mSocketState: INIT
I/BluetoothManager: start
D/BluetoothSocket: close() this: android.bluetooth.BluetoothSocket@629ea2a, channel: -1, mSocketIS: android.net.LocalSocketImpl$SocketInputStream@badb01b, mSocketOS: android.net.LocalSocketImpl$SocketOutputStream@47e65b8mSocket: null, mSocketState: CLOSED
I/BluetoothManager: setState() 1 -> 1
E/BluetoothManager: ConnectThread return
W/System: A resource failed to call close.
I/SDKHandler: connectToAvailableScanner Error occurred
D/BluetoothSocket: close() this: android.bluetooth.BluetoothSocket@629ea2a, channel: -1, mSocketIS: android.net.LocalSocketImpl$SocketInputStream@badb01b, mSocketOS: android.net.LocalSocketImpl$SocketOutputStream@47e65b8mSocket: null, mSocketState: CLOSED

The same issue is reproducible with the Scanner Control app v2.6.10.0. i.e. when tried to connect to a manually paired scanner, app displays “Unable to communicate with scanner” error message as shown in the attached screenshots. However when the scanner is connected through generated pairing barcode, it works as expected.

Similar issues have been reported in the past on this forum however there is no resolution provided. Kindly advice/escalate this issue. Thanks!

Refs: https://developer.zebra.com/forum/25447 https://developer.zebra.com/forum/24946

Screenshots: Untitled Untitled 1

Pranit-Harekar commented 1 year ago

@erangazebra @zebradcs Tagging you for the visibility, thanks!

Pranit-Harekar commented 1 year ago

This issue has been resolved. To pair manually, scan SSI Bluetooth Classic (Discoverable) barcode

image

as described in this manual