Error in function call!

Hi all,

Problem 1: ‘esp_ble_gattc_register_for_notify’
I have 4 BLE peripherals connected to a ESP32, each with 3 characteristics that have notification.
Calling ‘esp_ble_gattc_register_for_notify’ the response for each 12 calls is ‘ESP_OK’, but from the 8th call on, I always get the debug message “BT_APPL: Max Notification Reached, registration failed” and the notification does not work afterwards.
Why does this function returns OK when it is NOT OK??

Problem 2: Registration count
In the depth of the internet - in the file ‘bta_gattc_int.h’ - I found the constant definition:
#define BTA_GATTC_NOTIF_REG_MAX 7//15”.
This would correspond with my experience: Not more than 7 registrations allowed!
How do I change this constant??

Problem 3: Unclean cleanup
After a disconnect of the BLE peripheral, this registrations seem not to be cleaned up. When connecting another peripheral, the registration fails suddenly.
Has anybody seen this problem, too?

Thanks a lot for your help!
Kind regards
Rolf

problem 1: everything starting with esp_ belongs to the ESP IDF. I would suggest asking in Espressif forums if you don’t find an answer on the IDF docs. Bear in mind Mongoose-OS is not using the latest IDF (I read on other comments that it is ESP-IDF 3.3).
problem 2: you would need to recompile that IDF library, for that purpose I guess you’ll need to have a local copy of the IDF (and probably of Mongoose-OS too) and do a local build.
problem 3: I would suggest ESP forums too.