case BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST:
{
ble_gatts_evt_rw_authorize_request_t *p_authorize_request;
p_authorize_request = &p_ble_evt->evt.gatts_evt.params.authorize_request;
if(p_authorize_request->type == BLE_GATTS_AUTHORIZE_TYPE_READ)
{
ble_gatts_rw_authorize_reply_params_t authorize_reply_para;
authorize_reply_para.type = BLE_GATTS_AUTHORIZE_TYPE_READ;
switch(p_authorize_request->request.read.context.char_uuid.uuid)
{
case 0xfff3:
{
uint8_t reply[5];
uint32_t ret;
if (triggerHistoryDataCursor == triggerHistoryDataSize) {
memset(reply,0,sizeof(reply));
}
else {
uint32_t time = triggerEventData[triggerHistoryDataCursor].timestamp;
reply[0] = triggerEventData[triggerHistoryDataCursor].trig;
reply[1] = BREAK_UINT32(time, 3);
reply[2] = BREAK_UINT32(time, 2);
reply[3] = BREAK_UINT32(time, 1);
reply[4] = BREAK_UINT32(time, 0);
incrtriggerHistoryDataCursor();
}
authorize_reply_para.params.read.gatt_status = BLE_GATT_STATUS_SUCCESS;
authorize_reply_para.params.read.update = 1;
authorize_reply_para.params.read.p_data = reply;
authorize_reply_para.params.read.len = TRIGGER_EVENT_DATA_LEN;
ret = sd_ble_gatts_rw_authorize_reply(p_jawbone->conn_handle, &authorize_reply_para);
printf("ret = %d\n", ret);
break;
}
the ret vaule always 7,,what this the err in my code?