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

Error when trying to turn on notification to receive data

Hello,

I have a problem with turning on notification on a characteristic so I can start receiving data.

I am using a nRf51 dongle as a client device, using softdevice s130 and SDK 12.3. I connect the dongle to an other device that is a peripheral device which will send data to the dongle. 

It is two services between this two devices that will be used. On of the services has a read and write characteristic which I manage to communicate with and write the right data to. The problem is for the other service which has one characteristic with a read and notify options. When I want to turn on notification to receive new data and read it on the dongle side I get an error which end in not being able to receive new data. I added code below which besicly is similar to other example codes. When I read the log for the line "Written?? %x \n" i get the hex value 11. I believe that this was the error for not being able to write to the characteristic, if I remember correctly? 

I checked the abilities to interact with the device on my phone with the "nRF connect" app. Here I manage to turn on notifications and read the new data. 

Hope you can help me to get in the right direction.

Kind regards

Parents
  • Hello,

    sd_ble_gattc_write() will return 0x11 = NRF_ERROR_BUSY if there is an ongoing client procedure (ie another read/write request that the server has not been responded to yet). It looks like the problem is that tx_process is not called again after the failed attempt. Are you calling tx_process() when you receive the BLE_GATTC_EVT_WRITE_RSP/BLE_GATTC_EVT_READ_RSP event in you app?  

Reply
  • Hello,

    sd_ble_gattc_write() will return 0x11 = NRF_ERROR_BUSY if there is an ongoing client procedure (ie another read/write request that the server has not been responded to yet). It looks like the problem is that tx_process is not called again after the failed attempt. Are you calling tx_process() when you receive the BLE_GATTC_EVT_WRITE_RSP/BLE_GATTC_EVT_READ_RSP event in you app?  

Children
Related