-
Are you using an iPhone out of interest? iPhones 'cache' the services on a device as they're not expecting them to change - so the services may well have changes, just your phone isn't reporting them.
There is actually 'Service Changed' characteristics that should be used for that and indicate changes. Some details e.g. in this issue https://github.com/espressif/esp-idf/issues/1777
Don't have any Espruino around now but I guess this is not used now?
Described also here https://devzone.nordicsemi.com/f/nordic-q-a/19073/nordic_hrm-generic-attribute-service-change-0x2a05-0x2902-add
Don't see that lineble_enable_params.gatts_enable_params.service_changed = 1;
somewhere before https://github.com/espruino/Espruino/blob/master/targets/nrf5x/bluetooth.c#L2246Also discussed here https://punchthrough.com/attribute-caching-in-ble-advantages-and-pitfalls/
What you're doing there looks spot on.
Are you using an iPhone out of interest? iPhones 'cache' the services on a device as they're not expecting them to change - so the services may well have changes, just your phone isn't reporting them.
Could you try turning Bluetooth off and then on again on your phone, then try again?