0

How to use ble_app_uart_c for custom UUID service?

faweiz gravatar image

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

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

Hello!

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
1
hungbui gravatar image

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

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

@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

Comments

I made chages in ble_nus_c.h file. But my central is not getting connecting to peripheral. Are there any other changes need to ne done?

SaiTeja ( 2017-11-13 14:45:09 +0100 )editconvert to answer

@saiteja: You would need to update the advertising packet on the advertise to advertise the new UUID

And on the central side, when scanning it should look for that new UUID when receiving advertising packet. BLE_GAP_EVT_ADV_REPORT event inside ble_evt_handler

Hung Bui ( 2017-11-14 11:26:32 +0100 )editconvert to answer

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]

Question Tools

1 follower

Stats

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

Seen: 207 times

Last updated: mars 21