Functions
1. bluetooth.ble_settings(..., adv_man_name, adv_dev_name, ...)
adv_man_name: manufacturer name
adv_dev_name: device name
2. bluetooth.ble_adv_enable(bool)
Function Explanation: Start broadcast and stop broadcast.
bool:
True — start broadcast
False — stop broadcast
3. bluetooth.init()
Function Explanation: Initiate the Bluetooth subsystem. If you only call Deinit(), then you just need to call init().
4. bluetooth.deinit()
Function Explanation: Shut down Bluetooth, which does not return the BT stack to a lower state due to the current limitations of IDF.
5. bluetooth.connect(bda)
Function Explanation: GATTC - connect to remote GATTS server.
BDA: remote address
6 bytes, return to a GATTCConn object.
6. bluetooth.Service(uuid,is_primary = True)
Function Explanation: GATTS - create a new GATTSService object.
uuid: an integer or a byte (16). In GATTS, the UUID is globally unique. If you try to create a service with an existing (unclosed) UUID, you will receive the same service object but it will not create a new service.
7. bluetooth.services()
Function Explanation: GATTS - return to the current GATTS service.
8. bluetooth.conns()
Function Explanation: GATTC - return to the current all clients connection.
9. bluetooth.callback(callback,callback_data)
Function Explanation: Set callback functions of Bluetooth objects level.
callback: callback function
could be set to None
callback_data: parameters to callback
10. bluetooth.scan_start()
Function Explanation: Check GATTS device. You need to set Bluetooth object callback to get the scanning result.
11. bluetooth.scan_stop()
Function Explanation: GATTC - stop scannning in advance.If call it before scanning, you will not receive an event bluetooth.SCAN_CMPL.
12. bluetooth.is_scanning()
Function Explanation: GATTC - return to True if the scanning is active.