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

Commit 762d4f4b authored by Stanley Tng's avatar Stanley Tng
Browse files

Fix PTS: TC_GATT_SR_UNS_BI_01_C sends unsupported opcode

In this PTS test, add code to send back an unsupported error response
when an unsupported OpCode is received.

Bug: 79347869
Test: Rerun and pass PTS test
Change-Id: Ibf95dbc18dabbe201850da675c7a1b2739624de9
(cherry picked from commit 8d18b56e)
parent 4cd9ce72
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -967,8 +967,11 @@ void gatt_data_process(tGATT_TCB& tcb, BT_HDR* p_buf) {
  pseudo_op_code = op_code & (~GATT_WRITE_CMD_MASK);

  if (pseudo_op_code >= GATT_OP_CODE_MAX) {
    LOG(ERROR) << "ATT - Rcvd L2CAP data, unknown cmd: 0x" << std::hex
               << op_code;
    /* Note: PTS: GATT/SR/UNS/BI-01-C mandates error on unsupported ATT request.
     */
    LOG(ERROR) << __func__
               << ": ATT - Rcvd L2CAP data, unknown cmd: " << loghex(op_code);
    gatt_send_error_rsp(tcb, GATT_REQ_NOT_SUPPORTED, op_code, 0, false);
    return;
  }