java - Difference between close() and disconnect() in Android Bluetooth API? -
android bluetooth low energy api implements 1 method connect device connectgatt() 2 methods close connection disconnect() , close().
documentation says:
disconnect(): disconnects established connection, or cancels connection attempt in progress.close(): application should call method possible after done gatt client.
the source code of bluetoothgatt.java shows close() unregisters application , disconnect() disconnect client. not means. mean, if there 1 way connect client, why there 2 ways close/disconnect connection?
with disconnect() can later call connect() , continue cycle.
once call close() done. if want connect again have call connectgatt() on bluetoothdevice again; close() release resources held bluetoothgatt.
Comments
Post a Comment