Bluetooth connection problem for Bluetooth Bluetooth

I worked with a device that is not compatible with Google BLE and instead uses the Samsung BLE SDK for this connection. I tried to use the Google SDK, and it can connect successfully, but is immediately disconnected with a status of 19 after the connection, in which there is no documentation about what this status is.

03-02 00:07:55.572 1181-1181/alex.jstylemod I/art﹕ Late-enabling -Xcheck:jni 03-02 00:07:55.861 1181-1181/alex.jstylemod D/BluetoothAdapter﹕ startLeScan(): null 03-02 00:07:55.931 1181-1201/alex.jstylemod D/BluetoothLeScanner﹕ onClientRegistered() - status=0 clientIf=5 03-02 00:07:55.949 1181-1208/alex.jstylemod D/OpenGLRenderer﹕ Render dirty regions requested: true 03-02 00:07:55.965 1181-1181/alex.jstylemod D/Atlas﹕ Validating map... 03-02 00:07:55.985 1181-1208/alex.jstylemod I/Adreno-EGL﹕ <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BF.1.1.04.04.02.162.107_msm8226_LA.BF.1.1__release_AU () OpenGL ES Shader Compiler Version: E031.25.01.03 Build Date: 10/28/14 Tue Local Branch: Remote Branch: quic/l_LNX.LA.3.6 Local Patches: NONE Reconstruct Branch: AU_LINUX_ANDROID_LA.BF.1.1.04.04.02.162.107 + cb93e16 + f50fe49 + d7c18e6 + 5b9a565 + 0f3a25d + 607156e + 75511aa + e4d16c0 + 686f3eb + 211a271 + dd281ee + NOTHING 03-02 00:07:55.988 1181-1208/alex.jstylemod I/OpenGLRenderer﹕ Initialized EGL, version 1.4 03-02 00:07:56.010 1181-1208/alex.jstylemod D/OpenGLRenderer﹕ Enabling debug mode 0 03-02 00:07:57.769 1181-1201/alex.jstylemod D/BluetoothLeScanner﹕ onScanResult() - ScanResult{mDevice=B4:99:4C:67:72:70, mScanRecord=ScanRecord [mAdvertiseFlags=6, mServiceUuids=[0000fff0-0000-1000-8000-00805f9b34fb], mManufacturerSpecificData={}, mServiceData={}, mTxPowerLevel=0, mDeviceName=JStyle 677270], mRssi=-80, mTimestampNanos=128983439815617} 03-02 00:08:05.868 1181-1181/alex.jstylemod D/BluetoothAdapter﹕ stopLeScan() 03-02 00:08:27.348 1181-1181/alex.jstylemod D/BluetoothAdapter﹕ stopLeScan() 03-02 00:08:27.354 1181-1181/alex.jstylemod D/BluetoothAdapter﹕ scan not started yet 03-02 00:08:27.357 1181-1181/alex.jstylemod D/BluetoothGatt﹕ connect() - device: B4:99:4C:67:72:70, auto: false 03-02 00:08:27.357 1181-1181/alex.jstylemod D/BluetoothGatt﹕ registerApp() 03-02 00:08:27.357 1181-1181/alex.jstylemod D/BluetoothGatt﹕ registerApp() - UUID=76c2195c-0afe-4660-8164-f5f81f6fdc0a 03-02 00:08:27.366 1181-1201/alex.jstylemod D/BluetoothGatt﹕ onClientRegistered() - status=0 clientIf=5 03-02 00:08:27.379 1181-1181/alex.jstylemod D/BLEService﹕ Trying to create connection with autoconnect enabled 03-02 00:08:28.038 1181-1202/alex.jstylemod D/BluetoothGatt﹕ onClientConnectionState() - status=0 clientIf=5 device=B4:99:4C:67:72:70 03-02 00:08:28.046 1181-1202/alex.jstylemod I/BLEService﹕ Connected to GATT server 03-02 00:08:28.769 1181-1201/alex.jstylemod D/BluetoothGatt﹕ onClientConnectionState() - status=19 clientIf=5 device=B4:99:4C:67:72:70 03-02 00:08:28.769 1181-1201/alex.jstylemod I/BLEService﹕ Disconnected from GATT Server 

I tried using the Samsung BLE SDK for this device (presumably supported in the official app) and hit a wall where I cannot successfully fasten the GATT adapter. I also cannot debug to find out what is wrong, since the jar destroyed the debugging of the line number. I have added the source code for my applications.

 03-06 16:05:39.981 2965-2965/alex.jstylemod I/art﹕ Late-enabling -Xcheck:jni 03-06 16:05:40.010 2965-2975/alex.jstylemod I/art﹕ Ignoring second debugger -- accepting and dropping 03-06 16:05:40.021 2965-2975/alex.jstylemod I/art﹕ Debugger is no longer active 03-06 16:05:40.175 2965-2965/alex.jstylemod D/BluetoothAdapter﹕ startLeScan(): null 03-06 16:05:40.239 2965-2982/alex.jstylemod D/BluetoothLeScanner﹕ onClientRegistered() - status=0 clientIf=5 03-06 16:05:40.287 2965-2988/alex.jstylemod D/OpenGLRenderer﹕ Render dirty regions requested: true 03-06 16:05:40.301 2965-2965/alex.jstylemod D/Atlas﹕ Validating map... 03-06 16:05:40.353 2965-2988/alex.jstylemod I/Adreno-EGL﹕ <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BF.1.1.04.04.02.162.107_msm8226_LA.BF.1.1__release_AU () OpenGL ES Shader Compiler Version: E031.25.01.03 Build Date: 10/28/14 Tue Local Branch: Remote Branch: quic/l_LNX.LA.3.6 Local Patches: NONE Reconstruct Branch: AU_LINUX_ANDROID_LA.BF.1.1.04.04.02.162.107 + cb93e16 + f50fe49 + d7c18e6 + 5b9a565 + 0f3a25d + 607156e + 75511aa + e4d16c0 + 686f3eb + 211a271 + dd281ee + NOTHING 03-06 16:05:40.359 2965-2988/alex.jstylemod I/OpenGLRenderer﹕ Initialized EGL, version 1.4 03-06 16:05:40.409 2965-2988/alex.jstylemod D/OpenGLRenderer﹕ Enabling debug mode 0 03-06 16:05:41.210 2965-2982/alex.jstylemod D/BluetoothLeScanner﹕ onScanResult() - ScanResult{mDevice=B4:99:4C:67:72:70, mScanRecord=ScanRecord [mAdvertiseFlags=6, mServiceUuids=[0000fff0-0000-1000-8000-00805f9b34fb], mManufacturerSpecificData={}, mServiceData={}, mTxPowerLevel=0, mDeviceName=JStyle 677270], mRssi=-82, mTimestampNanos=532107906138682} 03-06 16:05:43.502 2965-2965/alex.jstylemod D/BluetoothAdapter﹕ startLeScan(): null 03-06 16:05:43.503 2965-2965/alex.jstylemod E/BluetoothAdapter﹕ LE Scan has already started 03-06 16:05:50.182 2965-2965/alex.jstylemod D/BluetoothAdapter﹕ stopLeScan() 03-06 16:05:53.506 2965-2965/alex.jstylemod D/BluetoothAdapter﹕ stopLeScan() 03-06 16:05:53.512 2965-2965/alex.jstylemod D/BluetoothAdapter﹕ scan not started yet 03-06 16:06:15.795 4053-4053/alex.jstylemod D/BluetoothAdapter﹕ startLeScan(): null 03-06 16:06:15.843 4053-4071/alex.jstylemod D/BluetoothLeScanner﹕ onClientRegistered() - status=0 clientIf=5 03-06 16:06:16.022 4053-4074/alex.jstylemod D/OpenGLRenderer﹕ Render dirty regions requested: true 03-06 16:06:16.038 4053-4053/alex.jstylemod D/Atlas﹕ Validating map... 03-06 16:06:16.065 4053-4074/alex.jstylemod I/Adreno-EGL﹕ <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BF.1.1.04.04.02.162.107_msm8226_LA.BF.1.1__release_AU () OpenGL ES Shader Compiler Version: E031.25.01.03 Build Date: 10/28/14 Tue Local Branch: Remote Branch: quic/l_LNX.LA.3.6 Local Patches: NONE Reconstruct Branch: AU_LINUX_ANDROID_LA.BF.1.1.04.04.02.162.107 + cb93e16 + f50fe49 + d7c18e6 + 5b9a565 + 0f3a25d + 607156e + 75511aa + e4d16c0 + 686f3eb + 211a271 + dd281ee + NOTHING 03-06 16:06:16.067 4053-4074/alex.jstylemod I/OpenGLRenderer﹕ Initialized EGL, version 1.4 03-06 16:06:16.093 4053-4074/alex.jstylemod D/OpenGLRenderer﹕ Enabling debug mode 0 03-06 16:06:17.320 4053-4072/alex.jstylemod D/BluetoothLeScanner﹕ onScanResult() - ScanResult{mDevice=B4:99:4C:67:72:70, mScanRecord=ScanRecord [mAdvertiseFlags=6, mServiceUuids=[0000fff0-0000-1000-8000-00805f9b34fb], mManufacturerSpecificData={}, mServiceData={}, mTxPowerLevel=0, mDeviceName=JStyle 677270], mRssi=-80, mTimestampNanos=532144013210126} 03-06 16:06:25.797 4053-4053/alex.jstylemod D/BluetoothAdapter﹕ stopLeScan() 03-06 16:08:44.455 4053-4065/alex.jstylemod I/art﹕ Debugger is active 03-06 16:08:55.660 4053-4053/alex.jstylemod I/Choreographer﹕ Skipped 264 frames! The application may be doing too much work on its main thread. 03-06 16:08:57.227 4053-4053/alex.jstylemod D/SamsungBLEService﹕ Calling Samsung BLE Service 03-06 16:08:57.488 4053-4053/alex.jstylemod W/ContextImpl﹕ Implicit intents with startService are not safe: Intent { act=com.samsung.android.sdk.bt.gatt.IBluetoothGatt } android.content.ContextWrapper.bindService:538 com.samsung.android.sdk.bt.gatt.BluetoothGatt.<init>:-1 com.samsung.android.sdk.bt.gatt.BluetoothGattAdapter.getProfileProxy:-1 03-06 16:08:57.498 4053-4053/alex.jstylemod E/BtGatt.BluetoothGatt﹕ Could not bind to Bluetooth Gatt Service 03-06 16:09:00.252 4053-4053/alex.jstylemod D/BluetoothAdapter﹕ stopLeScan() 03-06 16:09:00.259 4053-4053/alex.jstylemod D/BluetoothAdapter﹕ scan not started yet 

Source on the calling code

 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); handler = new Handler(); BluetoothSetting.checkBluetoothSetting(this); bluetoothAdapter = BluetoothSetting.getBluetoothAdapter(this,null); Intent gattServiceIntent = new Intent(this, SamsungBLEService.class); Set<BluetoothDevice> deviceSet = bluetoothAdapter.getBondedDevices(); //Intent gattServiceIntent = new Intent(this, BLEService.class); startService(gattServiceIntent); boolean bindResult = bindService(gattServiceIntent, serviceConnection,BIND_AUTO_CREATE); //setContentView(R.layout.activity_device_list); } 

Service

 @Override public void onCreate() { Log.d(TAG, "Calling Samsung BLE Service"); bluetoothAdapter = BluetoothSetting.getBluetoothAdapter(null,this); if(bluetoothGatt == null) BluetoothGattAdapter.getProfileProxy(this, serviceListener, BluetoothGattAdapter.GATT); } 

Could you shed some light on this? I know that I am new to Android Development.

thanks

+8
java android android-wear bluetooth
source share

No one has answered this question yet.

See related questions:

3606
Close / hide Android soft keyboard
3295
Why is the Android emulator so slow? How can we speed up Android emulator development?
3288
Correct use cases for Android UserManager.isUserAGoat ()?
2609
Is there a unique identifier for an Android device?
2510
How to keep Android activity state by saving instance state?
2097
Is there a way to run Python on Android?
1858
"Debug certificate expired" error in Android Eclipse plugins
1844
What is "Context" on Android?
1296
Restart activity during Android rotation
1116
Installing Android SDK does not find JDK

All Articles