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

No Write Events Generated

I am currently following the tutorial for creating custom services (https://github.com/NordicPlayground/nRF5x-custom-ble-service-tutorial). The only differences to this example is that I am using SDK v17 and SoftDevice s140.

Everything has been going fine until I reach Step 6 - Handling the Write Event from the SoftDevice. For some reason, the write event is not generated when I send it through nRF connect. What does generate this event, however, is subscribing to the characteristic. Adding logs to the on_ble_evt handler shows that no event is generated on write, so it's not a case of incorrectly handling the event id.

Parents
  • Hello,

     

    Adding logs to the on_ble_evt handler shows that no event is generated on write, so it's not a case of incorrectly handling the event id.

     Do you see any logs from your custom characteristics file? (ble_cus.c?) Try to add some logs in your init function, and see if they appear.

    If you see other logs, then it may be that your event handler is not called. What does your #define BLE_CUS_DEF(_name) implementation look like? Can you compare it to the ble_cus.h implementation from the github repository that you linked to?

    That is, this one.

    This definition is what tells the softdevice where to forward the ble events. In the file that I linked, it will be forwarded to the ble_cus_on_ble_evt().

    Best regards,

    Edvin

Reply
  • Hello,

     

    Adding logs to the on_ble_evt handler shows that no event is generated on write, so it's not a case of incorrectly handling the event id.

     Do you see any logs from your custom characteristics file? (ble_cus.c?) Try to add some logs in your init function, and see if they appear.

    If you see other logs, then it may be that your event handler is not called. What does your #define BLE_CUS_DEF(_name) implementation look like? Can you compare it to the ble_cus.h implementation from the github repository that you linked to?

    That is, this one.

    This definition is what tells the softdevice where to forward the ble events. In the file that I linked, it will be forwarded to the ble_cus_on_ble_evt().

    Best regards,

    Edvin

Children
Related