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

BLE NUS - TX CCCD discovery

Hello,

I'm trying to retrieve data from a nrf51822-based board that supports the BLE NUS sevice (using the ble_nus Library provided for the uart communication example, and the s110 softdevice). I have a few issues using it:

When I try to discover services from the Master Control Panel, it stops at the TX CCCD (Client Characteristics Configuration); and after a few seconds, the connection drops. If I try reading that CCCD, the same thing happens. However if I enable services, then everything works fine, and I can read the CCCD without any issue. Is this a normal behaviour?

NB: I want to interact the board with a software running on a computer using the Master Emulator API. I'm getting exactly the same issue when I try discovering the services from there; I can get the communication to the board to work, but the notification process does not seem to be activated and thus I cannot get any information to be sent from the board.

Thank you.

  • @Robin: Have you tried to use our example ble_app_uart in the SDK ?

    We also have an example on PC that use Master Emulator API to interface with the UART service. Please look for nRFUart in C:\Program Files (x86)\Nordic Semiconductor\Master Emulator\2.1.12.6\Example code\

    The reason that service discovery is hung when reading CCCD could be that you haven't handled BLE_GATTS_EVT_SYS_ATTR_MISSING event in your code. When CCCD is not set, you will receive that event, the softdevice wait for the application to either set it to a previously set value, or set it to NULL.

  • Indeed, I needed to handle BLE_GATTS_EVT_SYS_ATTR_MISSING (or set the attribute using sd_ble_gatts_sys_attr_set() when a connection occurs). You saved my day, thank you :D

Related