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

brahmajit
Posts: 24
Joined: Wed Sep 08, 2021 10:31 am

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

Postby brahmajit » Tue Jan 10, 2023 10:21 am

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.

brahmajit
Posts: 24
Joined: Wed Sep 08, 2021 10:31 am

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

Postby brahmajit » Tue Jan 10, 2023 4:28 pm

anyone got any clues?

Who is online

Users browsing this forum: Bing [Bot], Corand and 99 guests