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.
@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).
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: 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