Lines Matching refs:op_code

50 uint32_t gatt_sr_enqueue_cmd(tGATT_TCB& tcb, uint8_t op_code, uint16_t handle) {  in gatt_sr_enqueue_cmd()  argument
54 if ((p_cmd->op_code == 0) || in gatt_sr_enqueue_cmd()
55 (op_code == GATT_HANDLE_VALUE_CONF)) /* no pending request */ in gatt_sr_enqueue_cmd()
57 if (op_code == GATT_CMD_WRITE || op_code == GATT_SIGN_CMD_WRITE || in gatt_sr_enqueue_cmd()
58 op_code == GATT_REQ_MTU || op_code == GATT_HANDLE_VALUE_CONF) { in gatt_sr_enqueue_cmd()
62 p_cmd->op_code = op_code; in gatt_sr_enqueue_cmd()
82 bool gatt_sr_cmd_empty(tGATT_TCB& tcb) { return (tcb.sr_cmd.op_code == 0); } in gatt_sr_cmd_empty()
231 uint8_t op_code, tGATT_STATUS status, in gatt_sr_process_app_rsp() argument
239 if (op_code == GATT_REQ_READ_MULTI) { in gatt_sr_process_app_rsp()
244 if (op_code == GATT_REQ_PREPARE_WRITE && status == GATT_SUCCESS) in gatt_sr_process_app_rsp()
247 if (op_code == GATT_REQ_EXEC_WRITE && status != GATT_SUCCESS) in gatt_sr_process_app_rsp()
254 tcb.sr_cmd.p_rsp_msg = attp_build_sr_msg(tcb, (uint8_t)(op_code + 1), in gatt_sr_process_app_rsp()
267 gatt_send_error_rsp(tcb, status, op_code, tcb.sr_cmd.handle, false); in gatt_sr_process_app_rsp()
288 void gatt_process_exec_write_req(tGATT_TCB& tcb, uint8_t op_code, uint16_t len, in gatt_process_exec_write_req() argument
296 if (gatt_cb.enable_err_rsp && gatt_cb.req_op_code == op_code) { in gatt_process_exec_write_req()
322 trans_id = gatt_sr_enqueue_cmd(tcb, op_code, 0); in gatt_process_exec_write_req()
353 void gatt_process_read_multi_req(tGATT_TCB& tcb, uint8_t op_code, uint16_t len, in gatt_process_read_multi_req() argument
367 if (gatt_cb.enable_err_rsp && gatt_cb.req_op_code == op_code) { in gatt_process_read_multi_req()
411 gatt_sr_enqueue_cmd(tcb, op_code, tcb.sr_cmd.multi_req.handles[0]); in gatt_process_read_multi_req()
422 tcb, it->p_db, op_code, handle, 0, p_msg->attr_value.value, in gatt_process_read_multi_req()
427 gatt_sr_process_app_rsp(tcb, it->gatt_if, trans_id, op_code, in gatt_process_read_multi_req()
440 gatt_send_error_rsp(tcb, err, op_code, handle, false); in gatt_process_read_multi_req()
454 BT_HDR* p_msg, tGATT_TCB& tcb, uint8_t op_code, uint16_t s_hdl, in gatt_build_primary_service_rsp() argument
470 if (op_code == GATT_REQ_READ_BY_GRP_TYPE) in gatt_build_primary_service_rsp()
475 *p++ = op_code + 1; in gatt_build_primary_service_rsp()
479 if (op_code == GATT_REQ_READ_BY_GRP_TYPE) { in gatt_build_primary_service_rsp()
490 if (op_code == GATT_REQ_FIND_TYPE_VALUE && value != *p_uuid) continue; in gatt_build_primary_service_rsp()
503 if (op_code == GATT_REQ_READ_BY_GRP_TYPE) in gatt_build_primary_service_rsp()
585 static tGATT_STATUS gatts_validate_packet_format(uint8_t op_code, uint16_t& len, in gatts_validate_packet_format() argument
596 uint16_t uuid_len = (op_code == GATT_REQ_FIND_TYPE_VALUE) ? 2 : len; in gatts_validate_packet_format()
617 void gatts_process_primary_service_req(tGATT_TCB& tcb, uint8_t op_code, in gatts_process_primary_service_req() argument
623 gatts_validate_packet_format(op_code, len, p_data, &uuid, s_hdl, e_hdl); in gatts_process_primary_service_req()
625 gatt_send_error_rsp(tcb, reason, op_code, s_hdl, false); in gatts_process_primary_service_req()
630 if (op_code == GATT_REQ_READ_BY_GRP_TYPE) { in gatts_process_primary_service_req()
631 gatt_send_error_rsp(tcb, GATT_UNSUPPORT_GRP_TYPE, op_code, s_hdl, false); in gatts_process_primary_service_req()
638 gatt_send_error_rsp(tcb, GATT_NOT_FOUND, op_code, s_hdl, false); in gatts_process_primary_service_req()
646 if (op_code == GATT_REQ_FIND_TYPE_VALUE) { in gatts_process_primary_service_req()
648 gatt_send_error_rsp(tcb, GATT_INVALID_PDU, op_code, s_hdl, false); in gatts_process_primary_service_req()
655 reason = gatt_build_primary_service_rsp(p_msg, tcb, op_code, s_hdl, e_hdl, in gatts_process_primary_service_req()
659 gatt_send_error_rsp(tcb, reason, op_code, s_hdl, false); in gatts_process_primary_service_req()
676 static void gatts_process_find_info(tGATT_TCB& tcb, uint8_t op_code, in gatts_process_find_info() argument
681 gatt_send_error_rsp(tcb, reason, op_code, s_hdl, false); in gatts_process_find_info()
692 *p++ = op_code + 1; in gatts_process_find_info()
713 gatt_send_error_rsp(tcb, reason, op_code, s_hdl, false); in gatts_process_find_info()
791 void gatts_process_read_by_type_req(tGATT_TCB& tcb, uint8_t op_code, in gatts_process_read_by_type_req() argument
796 gatts_validate_packet_format(op_code, len, p_data, &uuid, s_hdl, e_hdl); in gatts_process_read_by_type_req()
799 if (gatt_cb.enable_err_rsp && gatt_cb.req_op_code == op_code) { in gatts_process_read_by_type_req()
811 gatt_send_error_rsp(tcb, reason, op_code, s_hdl, false); in gatts_process_read_by_type_req()
819 *p++ = op_code + 1; in gatts_process_read_by_type_req()
831 tcb, el.p_db, op_code, p_msg, s_hdl, e_hdl, uuid, &buf_len, sec_flag, in gatts_process_read_by_type_req()
853 gatt_send_error_rsp(tcb, reason, op_code, s_hdl, false); in gatts_process_read_by_type_req()
865 uint16_t handle, uint8_t op_code, uint16_t len, in gatts_process_write_req() argument
876 switch (op_code) { in gatts_process_write_req()
882 gatt_send_error_rsp(tcb, GATT_INVALID_PDU, op_code, handle, false); in gatts_process_write_req()
890 if (op_code == GATT_SIGN_CMD_WRITE) { in gatts_process_write_req()
897 if (op_code == GATT_REQ_WRITE || op_code == GATT_REQ_PREPARE_WRITE) in gatts_process_write_req()
909 status = gatts_write_attr_perm_check(el.p_db, op_code, handle, in gatts_process_write_req()
914 trans_id = gatt_sr_enqueue_cmd(tcb, op_code, handle); in gatts_process_write_req()
943 (op_code == GATT_REQ_PREPARE_WRITE || op_code == GATT_REQ_WRITE)) { in gatts_process_write_req()
944 gatt_send_error_rsp(tcb, status, op_code, handle, false); in gatts_process_write_req()
953 uint8_t op_code, uint16_t handle, in gatts_process_read_req() argument
958 if (op_code == GATT_REQ_READ_BLOB && len < sizeof(uint16_t)) { in gatts_process_read_req()
963 gatt_send_error_rsp(tcb, GATT_INVALID_PDU, op_code, 0, false); in gatts_process_read_req()
969 if (op_code == GATT_REQ_READ_BLOB) STREAM_TO_UINT16(offset, p_data); in gatts_process_read_req()
972 *p++ = op_code + 1; in gatts_process_read_req()
981 tcb, el.p_db, op_code, handle, offset, p, &value_len, (uint16_t)buf_len, in gatts_process_read_req()
991 gatt_send_error_rsp(tcb, reason, op_code, handle, false); in gatts_process_read_req()
1009 void gatts_process_attribute_req(tGATT_TCB& tcb, uint8_t op_code, uint16_t len, in gatts_process_attribute_req() argument
1025 if (gatt_cb.enable_err_rsp && gatt_cb.req_op_code == op_code) { in gatts_process_attribute_req()
1041 switch (op_code) { in gatts_process_attribute_req()
1044 gatts_process_read_req(tcb, el, op_code, handle, len, p); in gatts_process_attribute_req()
1051 gatts_process_write_req(tcb, el, handle, op_code, len, p, in gatts_process_attribute_req()
1066 if (status != GATT_SUCCESS && op_code != GATT_CMD_WRITE && in gatts_process_attribute_req()
1067 op_code != GATT_SIGN_CMD_WRITE) in gatts_process_attribute_req()
1068 gatt_send_error_rsp(tcb, status, op_code, handle, false); in gatts_process_attribute_req()
1155 void gatts_process_value_conf(tGATT_TCB& tcb, uint8_t op_code) { in gatts_process_value_conf() argument
1172 uint32_t trans_id = gatt_sr_enqueue_cmd(tcb, op_code, handle); in gatts_process_value_conf()
1182 void gatt_server_handle_client_req(tGATT_TCB& tcb, uint8_t op_code, in gatt_server_handle_client_req() argument
1185 if (!gatt_sr_cmd_empty(tcb) && op_code != GATT_HANDLE_VALUE_CONF) return; in gatt_server_handle_client_req()
1194 if (op_code != GATT_CMD_WRITE && op_code != GATT_SIGN_CMD_WRITE && in gatt_server_handle_client_req()
1195 op_code != GATT_HANDLE_VALUE_CONF) { in gatt_server_handle_client_req()
1196 gatt_send_error_rsp(tcb, GATT_INVALID_PDU, op_code, 0, false); in gatt_server_handle_client_req()
1200 switch (op_code) { in gatt_server_handle_client_req()
1203 gatts_process_primary_service_req(tcb, op_code, len, p_data); in gatt_server_handle_client_req()
1207 gatts_process_find_info(tcb, op_code, len, p_data); in gatt_server_handle_client_req()
1213 gatts_process_read_by_type_req(tcb, op_code, len, p_data); in gatt_server_handle_client_req()
1222 gatts_process_attribute_req(tcb, op_code, len, p_data); in gatt_server_handle_client_req()
1226 gatts_process_value_conf(tcb, op_code); in gatt_server_handle_client_req()
1234 gatt_process_exec_write_req(tcb, op_code, len, p_data); in gatt_server_handle_client_req()
1238 gatt_process_read_multi_req(tcb, op_code, len, p_data); in gatt_server_handle_client_req()