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

connecting ble_central_and_peripheral to custom android app

hello,

I am working on the example ble_central_and_peripheral in nRF51_SDK_8.1.0_b6ed55f and we have connected the device to MCP and on clicking the enable service we gets the updated notification.

We have developed an android app and we could connect the device to the app,but can't get the notification which is clearly due to the fact that we haven't assigned the write characteristics to the uuid 9001.Only if 0x01 is written to the uuid we get the updated value.

Instead of that what we would like to have is just after the central is connected(ie don't have to give the write command or enable service as in MCP ) we have to receive the updated value.How can we change the ble_central_and_peripheral program to accept this modification??

regards

  • Hi Deepu,

    You can force the peripheral to notify without the write request to the CCCD characteristic using sd_ble_gatts_sys_attr_set() . However, the phone won't expect this notification and will discard the packets (tested on Android and iOS). In the phone app you won't receive anything. It worked on the MasterControlPanel on PC though.

    One question, why don't you want to send the write command to enable CCCD ? It can be transparent to the end user.

Related