Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0320bc34 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "gatt/eatt: Fix qualification test cases" into tm-d1-dev

parents b6d88774 ebdd9f9d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -353,8 +353,8 @@ tGATT_STATUS attp_send_msg_to_l2cap(tGATT_TCB& tcb, uint16_t lcid,
}

/** Build ATT Server PDUs */
BT_HDR* attp_build_sr_msg(tGATT_TCB& tcb, uint8_t op_code,
                          tGATT_SR_MSG* p_msg) {
BT_HDR* attp_build_sr_msg(tGATT_TCB& tcb, uint8_t op_code, tGATT_SR_MSG* p_msg,
                          uint16_t payload_size) {
  uint16_t offset = 0;

  switch (op_code) {
@@ -370,7 +370,7 @@ BT_HDR* attp_build_sr_msg(tGATT_TCB& tcb, uint8_t op_code,
    case GATT_HANDLE_VALUE_NOTIF:
    case GATT_HANDLE_VALUE_IND:
      return attp_build_value_cmd(
          tcb.payload_size, op_code, p_msg->attr_value.handle, offset,
          payload_size, op_code, p_msg->attr_value.handle, offset,
          p_msg->attr_value.len, p_msg->attr_value.value);

    case GATT_RSP_WRITE:
+7 −5
Original line number Diff line number Diff line
@@ -468,8 +468,10 @@ tGATT_STATUS GATTS_HandleValueIndication(uint16_t conn_id, uint16_t attr_handle,

  tGATT_SR_MSG gatt_sr_msg;
  gatt_sr_msg.attr_value = indication;
  BT_HDR* p_msg =
      attp_build_sr_msg(*p_tcb, GATT_HANDLE_VALUE_IND, &gatt_sr_msg);

  uint16_t payload_size = gatt_tcb_get_payload_size_tx(*p_tcb, cid);
  BT_HDR* p_msg = attp_build_sr_msg(*p_tcb, GATT_HANDLE_VALUE_IND, &gatt_sr_msg,
                                    payload_size);
  if (!p_msg) return GATT_NO_RESOURCES;

  tGATT_STATUS cmd_status = attp_send_sr_msg(*p_tcb, cid, p_msg);
@@ -526,9 +528,9 @@ tGATT_STATUS GATTS_HandleValueNotification(uint16_t conn_id,
  gatt_sr_msg.attr_value = notif;

  uint16_t cid = gatt_tcb_get_att_cid(*p_tcb, p_reg->eatt_support);

  BT_HDR* p_buf =
      attp_build_sr_msg(*p_tcb, GATT_HANDLE_VALUE_NOTIF, &gatt_sr_msg);
  uint16_t payload_size = gatt_tcb_get_payload_size_tx(*p_tcb, cid);
  BT_HDR* p_buf = attp_build_sr_msg(*p_tcb, GATT_HANDLE_VALUE_NOTIF,
                                    &gatt_sr_msg, payload_size);
  if (p_buf != NULL) {
    cmd_sent = attp_send_sr_msg(*p_tcb, cid, p_buf);
  } else
+1 −1
Original line number Diff line number Diff line
@@ -495,7 +495,7 @@ extern tGATT_STATUS attp_send_cl_confirmation_msg(tGATT_TCB& tcb, uint16_t cid);
extern tGATT_STATUS attp_send_cl_msg(tGATT_TCB& tcb, tGATT_CLCB* p_clcb,
                                     uint8_t op_code, tGATT_CL_MSG* p_msg);
extern BT_HDR* attp_build_sr_msg(tGATT_TCB& tcb, uint8_t op_code,
                                 tGATT_SR_MSG* p_msg);
                                 tGATT_SR_MSG* p_msg, uint16_t payload_size);
extern tGATT_STATUS attp_send_sr_msg(tGATT_TCB& tcb, uint16_t cid,
                                     BT_HDR* p_msg);
extern tGATT_STATUS attp_send_msg_to_l2cap(tGATT_TCB& tcb, uint16_t cid,
+5 −4
Original line number Diff line number Diff line
@@ -286,7 +286,7 @@ tGATT_STATUS gatt_sr_process_app_rsp(tGATT_TCB& tcb, tGATT_IF gatt_if,
                                     tGATTS_RSP* p_msg,
                                     tGATT_SR_CMD* sr_res_p) {
  tGATT_STATUS ret_code = GATT_SUCCESS;
  uint16_t payload_size = gatt_tcb_get_payload_size_rx(tcb, sr_res_p->cid);
  uint16_t payload_size = gatt_tcb_get_payload_size_tx(tcb, sr_res_p->cid);

  VLOG(1) << __func__ << " gatt_if=" << +gatt_if;

@@ -308,8 +308,8 @@ tGATT_STATUS gatt_sr_process_app_rsp(tGATT_TCB& tcb, tGATT_IF gatt_if,

    if (gatt_sr_is_cback_cnt_zero(tcb) && status == GATT_SUCCESS) {
      if (sr_res_p->p_rsp_msg == NULL) {
        sr_res_p->p_rsp_msg = attp_build_sr_msg(tcb, (uint8_t)(op_code + 1),
                                                (tGATT_SR_MSG*)p_msg);
        sr_res_p->p_rsp_msg = attp_build_sr_msg(
            tcb, (uint8_t)(op_code + 1), (tGATT_SR_MSG*)p_msg, payload_size);
      } else {
        LOG(ERROR) << "Exception!!! already has respond message";
      }
@@ -828,7 +828,8 @@ static void gatts_process_mtu_req(tGATT_TCB& tcb, uint16_t cid, uint16_t len,

  tGATT_SR_MSG gatt_sr_msg;
  gatt_sr_msg.mtu = tcb.payload_size;
  BT_HDR* p_buf = attp_build_sr_msg(tcb, GATT_RSP_MTU, &gatt_sr_msg);
  BT_HDR* p_buf =
      attp_build_sr_msg(tcb, GATT_RSP_MTU, &gatt_sr_msg, tcb.payload_size);
  attp_send_sr_msg(tcb, cid, p_buf);

  tGATTS_DATA gatts_data;
+2 −1
Original line number Diff line number Diff line
@@ -813,7 +813,8 @@ tGATT_STATUS gatt_send_error_rsp(tGATT_TCB& tcb, uint16_t cid, uint8_t err_code,
  msg.error.reason = err_code;
  msg.error.handle = handle;

  p_buf = attp_build_sr_msg(tcb, GATT_RSP_ERROR, &msg);
  uint16_t payload_size = gatt_tcb_get_payload_size_tx(tcb, cid);
  p_buf = attp_build_sr_msg(tcb, GATT_RSP_ERROR, &msg, payload_size);
  if (p_buf != NULL) {
    status = attp_send_sr_msg(tcb, cid, p_buf);
  } else
Loading