This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ble app blinky BLE_ERROR_GATTS_SYS_ATTR_MISSING

Hey,

I`m experimenting with the blinky ble example in SDK 12. Everything works fine with the Android nRF Blinky app. But I noticed a weird behavior when using nRF Connect. When using nRF Connect and connecting to the nRF52 DK I open the LED BUTTON SERVICE and enable the Notifications for the Button Characteristic (by clicking the little Picture with the 3 Arrows). Now then I press the Button on the DK everything works as expected.

But now comes my Problem. When I connect to the DK and not enable the button Characteristic on my Smartphone, but press the Button on the DK, the Porgramm quits with error code "BLE_ERROR_GATTS_SYS_ATTR_MISSING" which is the result of the function sd_ble_gatts_hvx being called when the button is pressed..

If I enable the Button Characteristic first and disable it again, the program on the DK does not brick when I Press the button.

I know that the ble blinky example is experimental, but I use it to figure out how to code an android app, since it is nice and tiny and does support the stuff I want to use.

I fixed this behavior by calling sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);in the on_ble_evt function when I connect to my DK. But can anyone explain me what is going on under the hood and why I don't have to call this when I enable Notifications first through my phone?

Greetings

Related