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

Return success/failure on BLE characteristic write (nRf52832)

Hi, I want to create one system. When master writes data of Nordic, I receive callback with BLE_GATTS_EVT_WRITE case. Here I want to write return to master with success/ failure based on write data, How we can control of write success/failure from Nordic?

Thanks

Parents Reply
  • Yes, I am doing kinda similar. Calling on_disp_write, but if condition is failing. Handlers values are different.

    static void on_disp_write(ble_cus_t *p_cus, ble_evt_t const *p_ble_evt) {
    
      ble_gatts_evt_write_t const *p_evt_write = &p_ble_evt->evt.gatts_evt.params.write;
      ble_gatts_rw_authorize_reply_params_t auth_reply = {0};
      auth_reply.type = BLE_GATTS_AUTHORIZE_TYPE_WRITE;
    
      // Custom Value Characteristic Written to.
      if (p_evt_write->handle == p_cus->custom_value_handles.value_handle) {
      }
    }

Children
Related