Android Bluetooth LE: Not discovering services after connection -


i'm trying use android's bluetooth low energy communicate ble device. first time connect, works fine (connecting gatt server works, services , characteristics discovered, etc.) but, if disconnect , try re-connect, connect gatt server, not able discover services. have kill app , restart it, , doesn't work.

this code i'm using disconnect device:

public void close(view view) {     if (mbluetoothgatt == null) {         return;     }     mbluetoothgatt.close();     mbluetoothgatt = null; } 

is there else need when disconnecting? there seems resource still connected prevents discovery of services when try , reconnect.

i seem have found solution: need call both bluetoothgatt.disconnect() , bluetoothgatt.close().


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -