diff --git a/src/protocols/bdx/BdxTransferSession.cpp b/src/protocols/bdx/BdxTransferSession.cpp index fb5d581074cec1..3427dbd79faa8a 100644 --- a/src/protocols/bdx/BdxTransferSession.cpp +++ b/src/protocols/bdx/BdxTransferSession.cpp @@ -15,9 +15,8 @@ #include namespace { -constexpr uint8_t kBdxVersion = 0; ///< The version of this implementation of the BDX spec -constexpr size_t kStatusReportMinSize = 2 + 4 + 2; ///< 16 bits for GeneralCode, 32 bits for ProtocolId, 16 bits for ProtocolCode -constexpr uint16_t kStatusReportVendorId = 0; +constexpr uint8_t kBdxVersion = 0; ///< The version of this implementation of the BDX spec +constexpr size_t kStatusReportMinSize = 2 + 4 + 2; ///< 16 bits for GeneralCode, 32 bits for ProtocolId, 16 bits for ProtocolCode /** * @brief @@ -509,11 +508,10 @@ CHIP_ERROR TransferSession::HandleStatusReportMessage(PayloadHeader & header, Sy mAwaitingResponse = false; uint16_t generalCode = 0; - uint16_t vendorId = 0; - uint16_t protocolId = 0; + uint32_t protocolId = 0; uint16_t protocolCode = 0; Encoding::LittleEndian::Reader reader(msg->Start(), msg->DataLength()); - ReturnErrorOnFailure(reader.Read16(&generalCode).Read16(&vendorId).Read16(&protocolId).Read16(&protocolCode).StatusCode()); + ReturnErrorOnFailure(reader.Read16(&generalCode).Read32(&protocolId).Read16(&protocolCode).StatusCode()); VerifyOrReturnError((protocolId == Protocols::kProtocol_BDX), CHIP_ERROR_INVALID_MESSAGE_TYPE); mStatusReportData.StatusCode = protocolCode; @@ -857,8 +855,7 @@ void TransferSession::PrepareStatusReport(StatusCode code) VerifyOrReturn(!bbuf.IsNull()); bbuf.Put16(static_cast(Protocols::Common::StatusCode::Failure)); - bbuf.Put16(kStatusReportVendorId); - bbuf.Put16(Protocols::kProtocol_BDX); + bbuf.Put32(Protocols::kProtocol_BDX); bbuf.Put16(mStatusReportData.StatusCode); mPendingMsgHandle = bbuf.Finalize(); diff --git a/src/protocols/bdx/tests/TestBdxTransferSession.cpp b/src/protocols/bdx/tests/TestBdxTransferSession.cpp index 11aa3a200eaf52..7d8b8c02556698 100644 --- a/src/protocols/bdx/tests/TestBdxTransferSession.cpp +++ b/src/protocols/bdx/tests/TestBdxTransferSession.cpp @@ -116,8 +116,7 @@ void VerifyStatusReport(nlTestSuite * inSuite, void * inContext, const System::P uint16_t headerSize = 0; PayloadHeader payloadHeader; uint16_t generalCode = 0; - uint16_t vendorId = 0; - uint16_t protocolId = 0; + uint32_t protocolId = 0; uint16_t protocolCode = 0; if (msg.IsNull()) @@ -132,7 +131,7 @@ void VerifyStatusReport(nlTestSuite * inSuite, void * inContext, const System::P NL_TEST_ASSERT(inSuite, payloadHeader.GetMessageType() == static_cast(Protocols::Common::MsgType::StatusReport)); Encoding::LittleEndian::Reader reader(msg->Start() + headerSize, msg->DataLength()); - err = reader.Read16(&generalCode).Read16(&vendorId).Read16(&protocolId).Read16(&protocolCode).StatusCode(); + err = reader.Read16(&generalCode).Read32(&protocolId).Read16(&protocolCode).StatusCode(); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, generalCode == static_cast(Protocols::Common::StatusCode::Failure)); NL_TEST_ASSERT(inSuite, protocolId == Protocols::kProtocol_BDX);