hi,
I have a private service with characteristics of lock, unlock, and mode, all of which have write attributes, and only use unlock without read attributes. I can already use the sd_ble_gatts_rw_authorize_reply() function to limit whether I have write permission, through its "BLE_GATT_STATUS_SUCCESS" or "BLE_GATT_STATUS_ATTERR_WRITE_NOT_PERMITTED" parameter, now there is a problem, that is, when I have write permission, the data I write does not Not updating to my characteristic value.
case BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST:
{
if(pBleEvent->evt.gatts_evt.params.authorize_request.type == BLE_GATTS_AUTHORIZE_TYPE_WRITE)
{
ble_gatts_rw_authorize_reply_params_t rw_authorize_reply_params;
memset(&rw_authorize_reply_params, 0, sizeof(rw_authorize_reply_params));
rw_authorize_reply_params.type = BLE_GATTS_AUTHORIZE_TYPE_WRITE;
if(GetUnlockFlag()) /**< Get locked or unlocked status */
{
rw_authorize_reply_params.params.write.p_data = pBleEvent->evt.gatts_evt.params.write.data;
rw_authorize_reply_params.params.write.len = pBleEvent->evt.gatts_evt.params.write.len;
rw_authorize_reply_params.params.write.gatt_status = BLE_GATT_STATUS_SUCCESS; /**< write permission */
rw_authorize_reply_params.params.write.update = 1;
err_code = sd_ble_gatts_rw_authorize_reply(pBleEvent->evt.gatts_evt.conn_handle, &rw_authorize_reply_params);
}
else
{
rw_authorize_reply_params.params.write.gatt_status = BLE_GATT_STATUS_ATTERR_WRITE_NOT_PERMITTED; /**< no write permission */
rw_authorize_reply_params.params.write.update = 0;
err_code = sd_ble_gatts_rw_authorize_reply(pBleEvent->evt.gatts_evt.conn_handle, &rw_authorize_reply_params);
}
} /* if */
}
break;
SDK17.1,softdevice 7.3.
can you help me?