Difference between close() and disconnect()?

前端 未结 2 2023
说谎
说谎 2020-12-23 12:54

Android Bluetooth Low Energy API implements 1 method to connect to the device connectGatt() but 2 methods to close the connection disconnect() and

2条回答
  •  盖世英雄少女心
    2020-12-23 13:14

    With disconnect() you can later call connect() and continue with that cycle.

    Once you call close() you are done. If you want to connect again you will have to call connectGatt() on the BluetoothDevice again; close() will release any resources held by BluetoothGatt.

提交回复
热议问题