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

Error reply on Read Auth request

When I try to read attribute with authorization and reply on request with status BLE_GATT_STATUS_ATTERR_INVALID_HANDLE, my device (nRF51822) goto app_error_handler method. If status is'not equal BLE_GATT_STATUS_ATTERR_INVALID_HANDLE, data exchange continue with no error.


case BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST:
{
    ble_gatts_rw_authorize_reply_params_t reply;            
    memset(&reply, 0, sizeof(ble_gatts_rw_authorize_reply_params_t));

    reply.type = evt->evt.gatts_evt.params.authorize_request.type;

    switch (reply.type)
    {
    case BLE_GATTS_AUTHORIZE_TYPE_WRITE:
        {
        }
        break;

    case BLE_GATTS_AUTHORIZE_TYPE_READ:
        {
            ble_gatts_evt_read_t* evt_read = &evt->evt.gatts_evt.params.authorize_request.request.read;
            ble_gatts_read_authorize_params_t* reply_read = &reply.params.read;
            
            // ...

            reply_read->gatt_status = BLE_GATT_STATUS_ATTERR_INVALID_HANDLE;
        }
        break;
    };

    err_code = sd_ble_gatts_rw_authorize_reply(evt->evt.gap_evt.conn_handle, &reply);
    APP_ERROR_CHECK(err_code);
}

Is this S110 SoftDevice error or my program error? What reason of this problem?

Parents Reply Children
No Data
Related