Skip to content

Commit

Permalink
Merge branch 'sve-2' into cherry-pick-9d1aabd06fa19d8802faeb3f4b24e74…
Browse files Browse the repository at this point in the history
…5a1184bd4
  • Loading branch information
andy31415 authored Sep 9, 2022
2 parents ece44fd + b5563e7 commit eb31c65
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 16 deletions.
45 changes: 39 additions & 6 deletions .github/workflows/full-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ concurrency:
cancel-in-progress: true

jobs:
android:
full_android:
name: Run
timeout-minutes: 75

Expand All @@ -40,14 +40,25 @@ jobs:

steps:
- uses: Wandalen/[email protected]
if: ${{ !env.ACT }}
name: Checkout
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
# To use act like:
# act -j full_android
#
# Note you likely still need to have non submodules setup for the
# local machine, like:
# git submodule deinit --all
- uses: actions/checkout@v3
if: ${{ env.ACT }}
name: Checkout (ACT for local build)
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform android
- name: Bootstrap
timeout-minutes: 10
run: scripts/build/gn_bootstrap.sh
Expand All @@ -59,16 +70,38 @@ jobs:
path: |
.environment/gn_out/.ninja_log
.environment/pigweed-venv/*.log
- name: Build Android CHIPTool and CHIPTest (ARM)
- name: Build Android arm-chip-tool
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --no-log-timestamps --target-glob 'android-arm-*' build"
"./scripts/build/build_examples.py --no-log-timestamps --target android-arm-chip-tool build"
- name: Clean out build output
run: rm -rf ./out
- name: Build Android CHIPTool and CHIPTest (ARM64)
- name: Build Android arm-tv-casting-app
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --no-log-timestamps --target-glob 'android-arm64-*' build"
"./scripts/build/build_examples.py --no-log-timestamps --target android-arm-tv-casting-app build"
- name: Clean out build output
run: rm -rf ./out
- name: Build Android arm-tv-server
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --no-log-timestamps --target android-arm-tv-server build"
- name: Clean out build output
run: rm -rf ./out
- name: Build Android arm64-tv-casting-app
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --no-log-timestamps --target android-arm64-tv-casting-app build"
- name: Clean out build output
run: rm -rf ./out
- name: Build Android arm64-tv-server
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --no-log-timestamps --target android-arm64-tv-server build"
- name: Build Android arm64-chip-tool
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --no-log-timestamps --target android-arm64-chip-tool build"
- name: Run Android build rule tests
run: |
./scripts/run_in_build_env.sh \
Expand Down
3 changes: 1 addition & 2 deletions examples/chip-tool/commands/common/Command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,8 +898,7 @@ void Command::ResetArguments()
break;
}
case ArgumentType::VectorBool: {
auto vectorArgument = static_cast<std::vector<bool> *>(arg.value);
vectorArgument->clear();
ResetOptionalArg<std::vector<bool>>(arg);
break;
}
case ArgumentType::Vector16: {
Expand Down
1 change: 1 addition & 0 deletions src/messaging/ReliableMessageMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*
*/

#include <errno.h>
#include <inttypes.h>

#include <messaging/ReliableMessageMgr.h>
Expand Down
2 changes: 1 addition & 1 deletion src/platform/nrfconnect/OTAImageProcessorImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
};
Expand Down
2 changes: 1 addition & 1 deletion src/platform/nrfconnect/OTAImageProcessorImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion src/transport/SessionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/transport/raw/MessageHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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()); }
Expand Down
4 changes: 1 addition & 3 deletions src/transport/raw/tests/TestMessageHeader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand All @@ -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<uint64_t>::Value(42ull));
NL_TEST_ASSERT(inSuite, !header.GetDestinationGroupId().HasValue());
NL_TEST_ASSERT(inSuite, header.HasPrivacyFlag());
NL_TEST_ASSERT(inSuite, header.IsValidMCSPMsg());
}

Expand Down

0 comments on commit eb31c65

Please sign in to comment.