How to use ble_app_uart_c for custom UUID service?

faweiz gravatar image

asked 2017-03-20 19:53:16 +0200

updated 2017-03-20 21:47:22 +0200


We're using the SDK 12.1 ble_app_uart_c as an example for a nRF52 DK as Central application. Instead of using ble_app_uart example for peripheral device, we created a new custom service based on ble_app_template example for our peripheral device.

Our question is which portion of ble_app_uart_cexample code, should we need to change to make it available to connect the Central device to peripheral device using the custom service and display the data that sent from peripheral to PC's serial monitor?

Thanks for help.

edit retag flag offensive close delete report spam

1 answer

Sort by » oldest newest most voted
hungbui gravatar image

answered 2017-03-21 14:15:36 +0200

updated 2017-03-21 14:16:23 +0200

@Wecare: You need to update the NUS_BASE_UUID defined in ble_nus_c.h.

I would suggest you to have a look at the code inside ble_nus_c_init.c and ble_nus.c to fully understand how things work. For example function is_uuid_present() in main.c to check if the UUID is match or not.

Basically we have a base UUID that we need to add to the Stack's UUID database. After that we have an uuid_type match to that base in the UUID database. We use that uuid_type to represent that base. On top of the base, we have the service UUID (0x0001) and the characteristic UUID (0x0002, 0x0003).

edit flag offensive delete publish link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

User menu

    or sign up

Recent questions

Question Tools

1 follower


Asked: 2017-03-20 19:53:16 +0200

Seen: 148 times

Last updated: Mar 21