Hi,
Dear IDF authors, this problem exists like since forever.
I wan't to write simple app on C++ but GAP/GATTS API doesn't support it.
I'm talking about event handlers.
Why esp_event_handler_register has custom arg parameter while neither esp_ble_gap_register_callback nor esp_ble_gatts_register_callback don't?
It's not so hard to add parameter and later call callback handler with it.
Please, add it in future releases
BT API support for C++
-
- Posts: 9575
- Joined: Thu Nov 26, 2015 4:08 am
Re: BT API support for C++
I agree that it's good practice to have some user pointer in callbacks in general terms, but is it really an issue here? Those callbacks you mention are system-wide (as in: you don't set the callbacks on an object or connection or whatever) so if the callback were to take a user pointer, that pointer would be exactly the same every time the callback would be called. In that case, the user pointer doesn't really add anything: you might as well use a global variable, and that saves the BT code from shuttling around the user pointer.
Who is online
Users browsing this forum: Bing [Bot] and 179 guests