This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how can I get write event?

Hi. I'm using nRF52832, SDK13, S132v4.0.2.

I'm making peripheral device using nRF52832. And I can see it gets BLE_GATTS_EVT_WRITE event as below when central sends WRITE event.

static void on_ble_evt(ble_evt_t * p_ble_evt) { ...... switch (p_ble_evt->header.evt_id) { ...... case BLE_GATTS_EVT_WRITE: { } } }

How can I get event When central sends "write no need response"? As I tested I can't get the event using "BLE_GATTS_EVT_WRITE".

I hope your reply.

  • Hi Roger,

    You should have BLE_GATTS_EVT_WRITE when the central do a write command (write without response). As you can find in the paremeter for the event inside ble_gatts_evt_write_t we have an .op , meaning the type of operation. And in BLE_GATTS_OPS list you can find write request and write command there.

    We need to look at how you define your characteristic, if you allow write command or not ? When you do write command do you see the actual value was updated ?

  • Thanks a lot. After I added code as below, it works well. char_md.char_props.write_wo_resp= 1;

    Thanks again.

Related