Writing some value into a characteristic of specific UUID of a peripheral device by using a central device

Hey Nordic,

My project is based on "ble_app_uart" and "ble_app_uart_c" examples. I modified them to some extent. You can download them from here.

Normally, I can write some values into any characteristic of my custom service as shown above in nRF Connect. But I want to do the same thing automatically with my central device to the peripheral one. I want the central to discover this custom service, and write some predefined value into a characteristic specified by a UUID.

I tried to log the discovered characteristics in db_disc_handler() function but it seems that it can only discover or log the characteristics of the NUS service to J-Link RTT Viewer as shown below:

00> <info> app_timer: RTC: initialized.
00> 
00> <info> app: BLE UART central example started.
00> 
00> <info> app: Connecting to target 7F0F251956F2
00> 
00> <info> app: ATT MTU exchange completed.
00> 
00> <info> app: Ble NUS max data length set to 0xF4(244)
00> 
00> <info> app: Discovery complete.
00> 
00> <info> app: Connected to device with Nordic UART Service.
00> 
00> <info> app: srv_uuid.uuid: 0x1
00> 
00> <info> app: srv_uuid.type: 2
00> 
00> <info> app: char_count: 2
00> 
00> <info> app: chars[0].char.uuid.uuid: 0x2
00> 
00> <info> app: chars[1].char.uuid.uuid: 0x3

So, how can I discover my custom service and write some value into a specific-UUID characteristic of the peripheral device using my central device?

Thanks,

Omer

Related