Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service Change Indication #1456

Open
Koxx3 opened this issue Feb 4, 2023 · 1 comment
Open

Service Change Indication #1456

Koxx3 opened this issue Feb 4, 2023 · 1 comment

Comments

@Koxx3
Copy link

Koxx3 commented Feb 4, 2023

Hello,

I have troubles with Android phones and bonded ESP32 when adding/removing characteristics between 2 firmware releases (incorrect data reads, no answer on some characteristics ...)
It seems a common issue, and I found a lot of users with the same troubles.
I tried everything on the "client side" (Android cache refresh hack ... since it's not a public API), but it still doesn't work.

I found that BLE seems to already include "a flag" to indicate the client it needs to refresh his cache... the "Service Change Indication".

It doesn't seems NimBLEServer::serviceChanged() does the same thing (and it's not in the public API).
https://github.com/h2zero/NimBLE-Arduino/blob/release/1.4/src/NimBLEServer.cpp#L168

Espressif seems to offer the API on bluedroid :
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/bluetooth/esp_gatts.html#_CPPv444esp_ble_gatts_send_service_change_indication13esp_gatt_if_t13esp_bd_addr_t

it seems related to the 0x2A05 characteristic

Could it be possible to offer an API for this in NimBLE please ?

More info here :
https://stackoverflow.com/questions/62155016/bluez-and-service-characteristics-cache-issue-with-android

@sjanc
Copy link
Contributor

sjanc commented Feb 5, 2023

Hi,

service/gatt package provides this functionality via ble_svc_gatt_changed()
have a look at https://github.com/apache/mynewt-nimble/tree/master/nimble/host/services/gatt

If you implement GATT service on your own you may use ble_gatts_chr_updated() directly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants