This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how to read and write in ble central and peripheral code

Hi all,

I am trying to read and write in ble central and peripheral code with softdevice s130. Here i can able to connect to particular ble device with unique ble device id, here is their any possible to connect to other device without using ble device id, if so please help me how to do it.

secondly, i need to read and write data with connected devices, in this code i not finding any interrupt function as so that i can see the ble writen data as in peripheral code.

can any one please help me on this.

Regards Manjunath N N

  • I'm not sure what you mean by "ble device id". Device address? But you don't have to use it. Usually a central connects by first starting a scan with sd_ble_gap_scan_start(), it will receive BLE_GAP_EVT_ADV_REPORT events, and the advertising data will be available. This is also illustrated in this MSC. It can examine the advertising data to determine if it wants to connect to the device or not. It can look for a device name, an UUID, and so on. If it is found, it can connect with sd_ble_gap_connect(). It is illustraded by this MSC.

    If the central performs a write operation, the peripheral will receive a BLE_GATTS_EVT_WRITE event. Please see this MSC for write request, and this MSC for write command.

Related