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

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -