Home | History | Annotate | Download | only in gatt

Lines Matching refs:op_code

46 UINT32 gatt_sr_enqueue_cmd (tGATT_TCB *p_tcb, UINT8 op_code, UINT16 handle)
51 if ( (p_cmd->op_code == 0) ||
52 (op_code == GATT_HANDLE_VALUE_CONF)) /* no pending request */
54 if (op_code == GATT_CMD_WRITE ||
55 op_code == GATT_SIGN_CMD_WRITE ||
56 op_code == GATT_REQ_MTU ||
57 op_code == GATT_HANDLE_VALUE_CONF)
64 p_cmd->op_code = op_code;
86 return(p_tcb->sr_cmd.op_code == 0);
262 UINT32 trans_id, UINT8 op_code,
272 if (op_code == GATT_REQ_READ_MULTI)
280 if (op_code == GATT_REQ_PREPARE_WRITE && status == GATT_SUCCESS)
283 if (op_code == GATT_REQ_EXEC_WRITE && status != GATT_SUCCESS)
293 p_tcb->sr_cmd.p_rsp_msg = attp_build_sr_msg (p_tcb, (UINT8)(op_code + 1), (tGATT_SR_MSG *)p_msg);
310 ret_code = gatt_send_error_rsp (p_tcb, status, op_code, p_tcb->sr_cmd.handle, FALSE);
331 void gatt_process_exec_write_req (tGATT_TCB *p_tcb, UINT8 op_code, UINT16 len, UINT8 *p_data)
342 if (gatt_cb.enable_err_rsp && gatt_cb.req_op_code == op_code)
362 trans_id = gatt_sr_enqueue_cmd(p_tcb, op_code, 0);
396 void gatt_process_read_multi_req (tGATT_TCB *p_tcb, UINT8 op_code, UINT16 len, UINT8 *p_data)
414 if (gatt_cb.enable_err_rsp && gatt_cb.req_op_code == op_code)
465 if ((trans_id = gatt_sr_enqueue_cmd (p_tcb, op_code, p_tcb->sr_cmd.multi_req.handles[0])) != 0)
481 op_code,
493 gatt_sr_process_app_rsp(p_tcb, gatt_cb.sr_reg[i_rcb].gatt_if ,trans_id, op_code, GATT_SUCCESS, p_msg);
512 gatt_send_error_rsp(p_tcb, err, op_code, handle, FALSE);
526 UINT8 op_code, UINT16 s_hdl,
553 if (op_code == GATT_REQ_READ_BY_GRP_TYPE)
559 *p ++ = op_code + 1;
563 if (op_code == GATT_REQ_READ_BY_GRP_TYPE)
573 if (op_code != GATT_REQ_FIND_TYPE_VALUE ||
589 if (op_code == GATT_REQ_READ_BY_GRP_TYPE)
699 static tGATT_STATUS gatts_validate_packet_format(UINT8 op_code, UINT16 *p_len,
720 else if (op_code == GATT_REQ_READ_BY_GRP_TYPE ||
721 op_code == GATT_REQ_FIND_TYPE_VALUE ||
722 op_code == GATT_REQ_READ_BY_TYPE)
726 uuid_len = (op_code == GATT_REQ_FIND_TYPE_VALUE) ? 2 : len;
763 void gatts_process_primary_service_req(tGATT_TCB *p_tcb, UINT8 op_code, UINT16 len, UINT8 *p_data)
772 reason = gatts_validate_packet_format(op_code, &len, &p_data, &uuid, &s_hdl, &e_hdl);
778 if (op_code == GATT_REQ_FIND_TYPE_VALUE)
794 reason = gatt_build_primary_service_rsp (p_msg, p_tcb, op_code, s_hdl, e_hdl, p_data, value);
800 if (op_code == GATT_REQ_READ_BY_GRP_TYPE)
817 gatt_send_error_rsp (p_tcb, reason, op_code, s_hdl, FALSE);
834 static void gatts_process_find_info(tGATT_TCB *p_tcb, UINT8 op_code, UINT16 len, UINT8 *p_data)
843 reason = gatts_validate_packet_format(op_code, &len, &p_data, NULL, &s_hdl, &e_hdl);
859 *p ++ = op_code + 1;
892 gatt_send_error_rsp (p_tcb, reason, op_code, s_hdl, FALSE);
975 void gatts_process_read_by_type_req(tGATT_TCB *p_tcb, UINT8 op_code, UINT16 len, UINT8 *p_data)
989 reason = gatts_validate_packet_format(op_code, &len, &p_data, &uuid, &s_hdl, &e_hdl);
992 if (gatt_cb.enable_err_rsp && gatt_cb.req_op_code == op_code)
1015 *p ++ = op_code + 1;
1039 op_code,
1074 gatt_send_error_rsp (p_tcb, reason, op_code, s_hdl, FALSE);
1092 UINT8 op_code, UINT16 len, UINT8 *p_data)
1103 switch (op_code)
1111 if (op_code == GATT_SIGN_CMD_WRITE)
1119 if (op_code == GATT_REQ_WRITE || op_code == GATT_REQ_PREPARE_WRITE)
1133 op_code,
1143 if ((trans_id = gatt_sr_enqueue_cmd(p_tcb, op_code, handle)) != 0)
1163 (op_code == GATT_REQ_PREPARE_WRITE || op_code == GATT_REQ_WRITE))
1165 gatt_send_error_rsp (p_tcb, status, op_code, handle, FALSE);
1180 static void gatts_process_read_req(tGATT_TCB *p_tcb, tGATT_SR_REG *p_rcb, UINT8 op_code,
1198 if (op_code == GATT_REQ_READ_BLOB)
1203 *p ++ = op_code + 1;
1214 op_code,
1233 gatt_send_error_rsp (p_tcb, reason, op_code, handle, FALSE);
1250 void gatts_process_attribute_req (tGATT_TCB *p_tcb, UINT8 op_code,
1272 if (gatt_cb.enable_err_rsp && gatt_cb.req_op_code == op_code)
1294 switch (op_code)
1298 gatts_process_read_req(p_tcb, p_rcb, op_code, handle, len, p);
1305 gatts_process_write_req(p_tcb, i, handle, op_code, len, p);
1320 if (status != GATT_SUCCESS && op_code != GATT_CMD_WRITE && op_code != GATT_SIGN_CMD_WRITE)
1321 gatt_send_error_rsp (p_tcb, status, op_code, handle, FALSE);
1411 void gatts_process_value_conf(tGATT_TCB *p_tcb, UINT8 op_code)
1432 trans_id = gatt_sr_enqueue_cmd(p_tcb, op_code, handle);
1457 void gatt_server_handle_client_req (tGATT_TCB *p_tcb, UINT8 op_code,
1461 if (!gatt_sr_cmd_empty(p_tcb) && op_code != GATT_HANDLE_VALUE_CONF)
1470 if (op_code != GATT_CMD_WRITE &&
1471 op_code != GATT_SIGN_CMD_WRITE &&
1472 op_code != GATT_HANDLE_VALUE_CONF)
1474 gatt_send_error_rsp (p_tcb, GATT_INVALID_PDU, op_code, 0, FALSE);
1480 switch (op_code)
1484 gatts_process_primary_service_req (p_tcb, op_code, len, p_data);
1488 gatts_process_find_info(p_tcb, op_code, len, p_data);
1493 gatts_process_read_by_type_req(p_tcb, op_code, len, p_data);
1503 gatts_process_attribute_req (p_tcb, op_code, len, p_data);
1507 gatts_process_value_conf (p_tcb, op_code);
1515 gatt_process_exec_write_req (p_tcb, op_code, len, p_data);
1519 gatt_process_read_multi_req (p_tcb, op_code, len, p_data);