Hi,
I would like to know how to detect the service change of the ANCS gatt server.
Thank you! Joseph
Hi,
I would like to know how to detect the service change of the ANCS gatt server.
Thank you! Joseph
Hello Hung, thank you for your suggestions. If we want to subscribe to the service changed indication, the first step is to use the function sd_ble_gattc_primary_services_discover() to search for the Generic Attribute (0x1801), is that correct? Thanks!
@Joseph: You are correct, service discovery process starts by calling sd_ble_gattc_primary_services_discover(), you will have BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP event call back. You can use the ble_db_discovery.c library which handle the service discovery for you. You can have a look at the ble_app_hrs_c example for S120 (ble_central) where we do service discovery then enable CCCD for battery and hrs services.
Hello Hung, unfortunately, my work is based on SDK 5.1.0 and s310 v1.0.0, can I use the ble_db_discovery.c library by direct copying from newer SDK? And which SDK I should use? Thanks!
@Joseph: There could be some diference in the API but the principle should be the same. I think you should be able to use the library with some minor modification.
You can also have a look at ble_app_alert_notification example in SDK v5.1.0, the ble_ans_c.c library handles the service discovery and enables CCCD.
Noted with thanks!