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

Generic access profile write event handler

In ble_app_blinky_pca10040e_s112 example, Generic access service has read and write permission.

When writing the name, I want to handle this event and change the advertisement name. 

How do I do this? 

When I write the name, It triggers ble_evt_handler with p_ble_evt->header.evt_id  = 0x50. Where does this get handled and how does it stores the name? 

  • Hi,

    This has been discussed before numerous times in the forum, see for example this post.

    regards

    Jared

  • Hi Jared,

    I went through that post. I understood how to change the device name, that is not the question. I want to handle the generic access profile write event. I could not find any way to do this in S112.

  • Hi,

    As you've said, a write to the Generic Access characteristic Device Name generates a BLE_GATTS_EVT_WRITE event (0x050) in the ble handler. The ble_app blinky project doesn't have a case in the ble handler that handles this event, you would therefore have to make a case in the switch statement that handles this event and then changes the name as in the post i linked in the previous reply. I hope that answered you question.

    regards

    Jared 

  • I understood that. I want to know if there any exists? As when I change the device name from App, it gets updated.

  • no, this would be something that you have to implement yourself.

1 2