about the central example code (ble_app_hrs_c) Send data

mento gravatar image

asked 2017-02-17 09:48:54 +0200

s130, nRF5_SDK_12.1.0_0d23e2a, SoftDevice 8_9_0.

How to send data to Peripheral? Thanks.

edit retag flag offensive close delete report spam


What kind of data do you want to send? You can add the Nordic UART service (NUS) to your peripheral and central if you want to send text strings. You can also create your own custom service that suits your needs. This is described in the BLE tutorials here on DevZone.

Jørgen Holmefjord ( 2017-02-17 10:44:46 +0200 )editconvert to answer

I am modifying the ble_app_hrs_c project to do the Glucose central(0x1808). I want to send {0x01,0x01} to peripheral by Record Access Control Point(0x2A52), How to modify the ble_app_hrs_c program to do the 0x2A52 INDICATE? Thanks

mento ( 2017-02-21 03:40:44 +0200 )editconvert to answer

You can write to the characteristics using the function sd_ble_gattc_write(). You can find the correct characteristics handle using the method used in ble_hrs_on_db_disc_evt(), and populate the write parameters similar to what is done in cccd_configure().

Jørgen Holmefjord ( 2017-02-21 15:47:44 +0200 )editconvert to answer