Page 1 of 1

How to assign a callback to a BLE service's characteristic in ESP-iDF

Posted: Tue Jan 10, 2023 10:21 am
by brahmajit
I'm not using nimBLE but in nimBLE I can use ble_gatt_chr_def struct which has ble_gatt_access_fn *access_cb that gets executed when the characteristic is read or written to. In Arduino I can do

Code: Select all

foo_char->addDescriptor(new BLE2902());
foo_char->setCallbacks(new foo_charCallbacks());
What's the equivalent for IDF? I'm using the gatt_server_service_table example from idf tags 4.4.3.

Re: How to assign a callback to a BLE service's characteristic in ESP-iDF

Posted: Tue Jan 10, 2023 4:28 pm
by brahmajit
anyone got any clues?