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

ble_app_template example program - where to find BLE service, characteristics value initialization and definition in code?

Hi I am using the nRF51 DK and I successfully ran the ble_app_template program from examples\ble_peripheral in SDK v10. Using the nRF connect app I am able to do both read and write values.

I want to try creating other services and setting different values for characteristics in the ble_app_template program. For example I want to change the value from '[0] Unknown' to 'Hello' for the Appearance (0x2A01) characteristic. But I cannot find where the default BLE services, characteristics, attributes are initialized and defined in the ble_app_template program. I am using Keil 5 and I tried searching the ble_advdata.c, ble_advertising.c, ble_srv_common.c files, etc from nRF_BLE folder. None of the files I searched had code that mention the Generic Access Service (0x1800) or Generic Attribute (0x1801) services. 

Where should I look to find the code that initializes/defines these services, characteristics, and default values?

2. When I have the NRF 51 DK connected to my PC is there also a way to have Keil terminal/console print the BLE read/write values? 

Thank you!

Parents Reply
    1. No, you can use any other method of your choice for generating a 128 bit base UUID.
    2. Yes. The BLE specification doesn't use names (characters) for identifying services and characteristics but rather UUIDs. In nRF Connect we can identify certain services and characteristic if they use a predefind16 bit UUID (such as the heart rate service) , and certain 128 bit custom UUID (such as NUS). nRF Connect mobile app have the option of displaying a name for a custom service after you've connected to the peripheral. The 16 bit UUID you would add to your custom base UUID can be generated as you chose. 

    Best regards

    Jared 

Children
No Data
Related