Skip to content

Commit 4e5dccd

Browse files
committed
PDU rejected due to wrong opcode set in 'Request Opcode In Error'
3.4.1.1 of ATT protocol spec suggests that in the ATT_ERROR_RSP, the Request Opcode In Error should be set to the request that generated the error. In this case it looks like it should actually be ATT_FIND_BY_TYPE_VALUE_REQ (ATT_OP_READ_BY_GROUP_REQ)
1 parent 1768462 commit 4e5dccd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/utility/ATT.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ void ATTClass::findByTypeReq(uint16_t connectionHandle, uint16_t mtu, uint8_t dl
756756
} *findByTypeReq = (FindByTypeReq*)data;
757757

758758
if (dlen < sizeof(FindByTypeReq)) {
759-
sendError(connectionHandle, ATT_OP_FIND_BY_TYPE_RESP, findByTypeReq->startHandle, ATT_ECODE_INVALID_PDU);
759+
sendError(connectionHandle, ATT_OP_FIND_BY_TYPE_REQ, findByTypeReq->startHandle, ATT_ECODE_INVALID_PDU);
760760
return;
761761
}
762762

@@ -794,7 +794,7 @@ void ATTClass::findByTypeReq(uint16_t connectionHandle, uint16_t mtu, uint8_t dl
794794
}
795795

796796
if (responseLength == 1) {
797-
sendError(connectionHandle, ATT_OP_FIND_BY_TYPE_RESP, findByTypeReq->startHandle, ATT_ECODE_ATTR_NOT_FOUND);
797+
sendError(connectionHandle, ATT_OP_FIND_BY_TYPE_REQ, findByTypeReq->startHandle, ATT_ECODE_ATTR_NOT_FOUND);
798798
} else {
799799
HCI.sendAclPkt(connectionHandle, ATT_CID, responseLength, response);
800800
}

0 commit comments

Comments
 (0)