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.

  • I ended up starting all over and just went step by step making sure the app was working right. Still not sure what the difference is that makes it work versus not, but it is working now.

    I would like to recommend that you make an example with a custom service and multiple characteristics instead of just having the basic template with commented out code that doesn't completely work when you uncomment it.

    Please make different characteristics, some read, some write, some both, some notify, some not and have it all working and not just commented out example code.

    You can call it the custom service template example or something like that.

Reply
  • I ended up starting all over and just went step by step making sure the app was working right. Still not sure what the difference is that makes it work versus not, but it is working now.

    I would like to recommend that you make an example with a custom service and multiple characteristics instead of just having the basic template with commented out code that doesn't completely work when you uncomment it.

    Please make different characteristics, some read, some write, some both, some notify, some not and have it all working and not just commented out example code.

    You can call it the custom service template example or something like that.

Children
Related