diff --git a/examples/chip-tool/commands/common/Command.cpp b/examples/chip-tool/commands/common/Command.cpp index 0f738bc4da8ae8..6717bcbbc03216 100644 --- a/examples/chip-tool/commands/common/Command.cpp +++ b/examples/chip-tool/commands/common/Command.cpp @@ -898,8 +898,7 @@ void Command::ResetArguments() break; } case ArgumentType::VectorBool: { - auto vectorArgument = static_cast *>(arg.value); - vectorArgument->clear(); + ResetOptionalArg>(arg); break; } case ArgumentType::Vector16: { diff --git a/src/platform/nrfconnect/OTAImageProcessorImpl.cpp b/src/platform/nrfconnect/OTAImageProcessorImpl.cpp index bb8f846d8d900c..842ec4d7392fa5 100644 --- a/src/platform/nrfconnect/OTAImageProcessorImpl.cpp +++ b/src/platform/nrfconnect/OTAImageProcessorImpl.cpp @@ -71,7 +71,7 @@ CHIP_ERROR OTAImageProcessorImpl::PrepareDownloadImpl() writer.image_id = image_id; writer.open = [](int id, size_t size) { return dfu_target_init(DFU_TARGET_IMAGE_TYPE_MCUBOOT, id, size, nullptr); }; writer.write = [](const uint8_t * chunk, size_t chunk_size) { return dfu_target_write(chunk, chunk_size); }; - writer.close = [](bool success) { return dfu_target_done(success); }; + writer.close = [](bool success) { return success ? dfu_target_done(success) : dfu_target_reset(); }; ReturnErrorOnFailure(System::MapErrorZephyr(dfu_multi_image_register_writer(&writer))); }; diff --git a/src/platform/nrfconnect/OTAImageProcessorImpl.h b/src/platform/nrfconnect/OTAImageProcessorImpl.h index 99b9c13e9d7693..09c94bb1969456 100644 --- a/src/platform/nrfconnect/OTAImageProcessorImpl.h +++ b/src/platform/nrfconnect/OTAImageProcessorImpl.h @@ -56,7 +56,7 @@ class OTAImageProcessorImpl : public OTAImageProcessorInterface bool IsFirstImageRun() override; CHIP_ERROR ConfirmCurrentImage() override; -private: +protected: CHIP_ERROR PrepareDownloadImpl(); CHIP_ERROR ProcessHeader(ByteSpan & aBlock); diff --git a/src/transport/SessionManager.cpp b/src/transport/SessionManager.cpp index a0ad834b033027..252d8ad02959d6 100644 --- a/src/transport/SessionManager.cpp +++ b/src/transport/SessionManager.cpp @@ -166,7 +166,6 @@ CHIP_ERROR SessionManager::PrepareMessage(const SessionHandle & sessionHandle, P packetHeader.SetDestinationGroupId(groupSession->GetGroupId()); packetHeader.SetMessageCounter(mGroupClientCounter.GetCounter(isControlMsg)); mGroupClientCounter.IncrementCounter(isControlMsg); - packetHeader.SetFlags(Header::SecFlagValues::kPrivacyFlag); packetHeader.SetSessionType(Header::SessionType::kGroupSession); NodeId sourceNodeId = fabric->GetNodeId(); packetHeader.SetSourceNodeId(sourceNodeId); diff --git a/src/transport/raw/MessageHeader.h b/src/transport/raw/MessageHeader.h index c1ccf540b2f55a..5589647bd9ebc9 100644 --- a/src/transport/raw/MessageHeader.h +++ b/src/transport/raw/MessageHeader.h @@ -203,14 +203,14 @@ class PacketHeader { // Check is based on spec 4.11.2 return (IsGroupSession() && GetSourceNodeId().HasValue() && GetDestinationGroupId().HasValue() && - !IsSecureSessionControlMsg() && HasPrivacyFlag()); + !IsSecureSessionControlMsg()); } bool IsValidMCSPMsg() const { // Check is based on spec 4.9.2.4 return (IsGroupSession() && GetSourceNodeId().HasValue() && GetDestinationNodeId().HasValue() && - IsSecureSessionControlMsg() && HasPrivacyFlag()); + IsSecureSessionControlMsg()); } bool IsEncrypted() const { return !((mSessionId == kMsgUnicastSessionIdUnsecured) && IsUnicastSession()); } diff --git a/src/transport/raw/tests/TestMessageHeader.cpp b/src/transport/raw/tests/TestMessageHeader.cpp index ff50e104f7579f..1ad9b7b1e03d64 100644 --- a/src/transport/raw/tests/TestMessageHeader.cpp +++ b/src/transport/raw/tests/TestMessageHeader.cpp @@ -151,7 +151,6 @@ void TestPacketHeaderEncodeDecode(nlTestSuite * inSuite, void * inContext) header.ClearDestinationNodeId(); header.SetSessionType(Header::SessionType::kGroupSession); - header.SetFlags(Header::SecFlagValues::kPrivacyFlag); header.SetSecureSessionControlMsg(false); NL_TEST_ASSERT(inSuite, header.Encode(buffer, &encodeLen) == CHIP_NO_ERROR); @@ -165,7 +164,7 @@ void TestPacketHeaderEncodeDecode(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, header.IsValidGroupMsg()); // Verify MCSP state - header.ClearDestinationGroupId().SetDestinationNodeId(42).SetFlags(Header::SecFlagValues::kPrivacyFlag); + header.ClearDestinationGroupId().SetDestinationNodeId(42); header.SetSecureSessionControlMsg(true); NL_TEST_ASSERT(inSuite, header.Encode(buffer, &encodeLen) == CHIP_NO_ERROR); @@ -174,7 +173,6 @@ void TestPacketHeaderEncodeDecode(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, header.Decode(buffer, &decodeLen) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, header.GetDestinationNodeId() == Optional::Value(42ull)); NL_TEST_ASSERT(inSuite, !header.GetDestinationGroupId().HasValue()); - NL_TEST_ASSERT(inSuite, header.HasPrivacyFlag()); NL_TEST_ASSERT(inSuite, header.IsValidMCSPMsg()); }