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

Commit 5041e106 authored by Kyunglyul Hyun's avatar Kyunglyul Hyun Committed by Gerrit Code Review
Browse files

Merge "Send ATT_EXECUTE_WRITE_RSP when no pending writes" into main

parents 1e23dbca adde3329
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -430,9 +430,20 @@ static void gatt_process_exec_write_req(tGATT_TCB& tcb, uint16_t cid, uint8_t op
      }
    }
  } else { /* nothing needs to be executed , send response now */
    log::error("gatt_process_exec_write_req: no prepare write pending");
    log::warn("gatt_process_exec_write_req: no prepare write pending");
    if (com::android::bluetooth::flags::fix_execute_write_no_pending()) {
      uint16_t payload_size = gatt_tcb_get_payload_size(tcb, cid);
      BT_HDR* p_buf =
              attp_build_sr_msg(tcb, GATT_RSP_EXEC_WRITE, (tGATT_SR_MSG*)NULL, payload_size);
      if (p_buf != NULL) {
        attp_send_sr_msg(tcb, cid, p_buf);
      } else {
        gatt_send_error_rsp(tcb, cid, GATT_ERROR, GATT_REQ_EXEC_WRITE, 0, false);
      }
    } else {
      gatt_send_error_rsp(tcb, cid, GATT_ERROR, GATT_REQ_EXEC_WRITE, 0, false);
    }
  }
}

/*******************************************************************************