Information is here:
https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/bluetooth/esp_gap_ble.html#functions
include with
#include "esp32_bt_gap.h"
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include "esp_bt.h"
#include "esp_bt_defs.h"
#include "esp_bt_device.h"
#include "esp_gap_ble_api.h"
(taken from bt-common/blob/master/src/esp32/esp32_bt_gap.c)
in particular, I’m interested in these guys:
esp_err_t esp_ble_remove_bond_device(esp_bd_addr_t bd_addr)
Removes a device from the security database list of peer device. It manages unpairing event while connected.
Return
- ESP_OK : success
other : failed
Parameters
bd_addr: : BD address of the peer device
int esp_ble_get_bond_device_num(void)
Get the device number from the security database list of peer device. It will return the device bonded number immediately.
Return
- >= 0 : bonded devices number.
ESP_FAIL : failed
esp_err_t esp_ble_get_bond_device_list(int *dev_num, esp_ble_bond_dev_t *dev_list)
Get the device from the security database list of peer device. It will return the device bonded information immediately.
Return
- ESP_OK : success
other : failed
Parameters
dev_num: Indicate the dev_list array(buffer) size as input. If dev_num is large enough, it means the actual number as output. Suggest that dev_num value equal to esp_ble_get_bond_device_num().
dev_list: an array(buffer) of esp_ble_bond_dev_t type. Use for storing the bonded devices address. The dev_list should be allocated by who call this API.
and will probably post something when and if it works… so far I got a proper device count from esp_ble_get_bond_device_num()