Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

custom service and characteristic not receiving write events

I started with the ble_app_template and a preexisting project written with sdk 12.

I have a custom service and 2 characteristics.

The point I am at now is that my DK advertises the proper name and such. When I connect I can see my service and characteristics.

When I write to the writable characteristic, I get an even into my ble_eas_on_ble_evt function, but the p_ble_evet->header.evt_id is always 2. It is never BLE_GATTS_EVT_WRITE.

I am sure I just missed something simple. Please advise.

Parents
  • Hi,

    Do you mind posting your code? It's hard to say what you have missed without it. We can make the case private if you prefer confidentiality.

  • That is actually the tutorial I used to finally get it working.

    What I am suggesting is that you have a example project that is the final result of something like that tutorial, but is complete and working AND includes more than just a single characteristic. It would be nice if it included acharacteristic with read/write/notify and then 1 each characteristic with only read or write or notify.

    With an example like that the user could just remove the characteristics they don't want or duplicate them or whatever and be ready to go. Then we could spend our time working on the business logic of our app instead of trying to navigate the complexity of trying to get the characteristics to work.

    This is just a suggestion.

    As an alternative maybe it would be even better to come up with a tool like what Cypress has that lets you define services and characteristics in a GUI that has you fill out all the details and then it writes the code for you.

    I know many devs want to slug through all this stuff on their own, but many of us would rather spend our time working on the meat of our apps and have the services and characteristic setup be more automated.

Reply
  • That is actually the tutorial I used to finally get it working.

    What I am suggesting is that you have a example project that is the final result of something like that tutorial, but is complete and working AND includes more than just a single characteristic. It would be nice if it included acharacteristic with read/write/notify and then 1 each characteristic with only read or write or notify.

    With an example like that the user could just remove the characteristics they don't want or duplicate them or whatever and be ready to go. Then we could spend our time working on the business logic of our app instead of trying to navigate the complexity of trying to get the characteristics to work.

    This is just a suggestion.

    As an alternative maybe it would be even better to come up with a tool like what Cypress has that lets you define services and characteristics in a GUI that has you fill out all the details and then it writes the code for you.

    I know many devs want to slug through all this stuff on their own, but many of us would rather spend our time working on the meat of our apps and have the services and characteristic setup be more automated.

Children
Related