Skip to content

Commit

Permalink
Merge branch 'master' into pr/devicetype/binding
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca authored Aug 30, 2022
2 parents e977a7e + d47c8f7 commit f3d17b7
Show file tree
Hide file tree
Showing 28 changed files with 464 additions and 184 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/examples-qpg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ jobs:
run: |
config/qpg/chip-gn/build.sh
- name: Prepare some bloat report from the previous builds
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
qpg qpg6105+debug lighting-app \
out/qpg-light/chip-qpg6105-lighting-example.out \
/tmp/bloat_reports/
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
qpg qpg6105+debug lock-app \
out/qpg-lock/chip-qpg6105-lock-example.out \
/tmp/bloat_reports/
- name: Uploading Size Reports
uses: actions/upload-artifact@v2
if: ${{ !env.ACT }}
Expand Down
167 changes: 0 additions & 167 deletions config/esp32/components/chip/component.mk

This file was deleted.

1 change: 0 additions & 1 deletion config/esp32/components/esp32_mbedtls/component.mk

This file was deleted.

2 changes: 2 additions & 0 deletions examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ ti_simplelink_executable("all-clusters-app") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
"${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp",
"${project_dir}/main/AppTask.cpp",
"${project_dir}/main/ClusterManager.cpp",
"${project_dir}/main/Globals.cpp",
Expand All @@ -102,6 +103,7 @@ ti_simplelink_executable("all-clusters-app") {
"${project_dir}",
"${project_dir}/main",
"${chip_root}/examples/all-clusters-app/all-clusters-common/include",
"${chip_root}/examples/providers/",
]

cflags = [
Expand Down
7 changes: 7 additions & 0 deletions examples/all-clusters-app/cc13x2x7_26x2x7/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>

#include <DeviceInfoProviderImpl.h>
#include <platform/CHIPDeviceLayer.h>

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
Expand Down Expand Up @@ -64,6 +65,7 @@ static QueueHandle_t sAppEventQueue;

static Button_Handle sAppLeftHandle;
static Button_Handle sAppRightHandle;
static DeviceInfoProviderImpl sExampleDeviceInfoProvider;

AppTask AppTask::sAppTask;

Expand Down Expand Up @@ -243,6 +245,11 @@ int AppTask::Init()
PLAT_LOG("Initialize Server");
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();

// Initialize info provider
sExampleDeviceInfoProvider.SetStorageDelegate(initParams.persistentStorageDelegate);
SetDeviceInfoProvider(&sExampleDeviceInfoProvider);

chip::Server::GetInstance().Init(initParams);

ConfigurationMgr().LogDeviceConfig();
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-minimal-app/cc13x2x7_26x2x7/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ ti_simplelink_executable("all-clusters-minimal-app") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
"${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp",
"${project_dir}/main/AppTask.cpp",
"${project_dir}/main/ClusterManager.cpp",
"${project_dir}/main/Globals.cpp",
Expand All @@ -102,6 +103,7 @@ ti_simplelink_executable("all-clusters-minimal-app") {
"${project_dir}",
"${project_dir}/main",
"${chip_root}/examples/all-clusters-app/all-clusters-common/include",
"${chip_root}/examples/providers/",
]

cflags = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>

#include <DeviceInfoProviderImpl.h>
#include <platform/CHIPDeviceLayer.h>

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
Expand Down Expand Up @@ -64,6 +65,7 @@ static QueueHandle_t sAppEventQueue;

static Button_Handle sAppLeftHandle;
static Button_Handle sAppRightHandle;
static DeviceInfoProviderImpl sExampleDeviceInfoProvider;

AppTask AppTask::sAppTask;

Expand Down Expand Up @@ -243,6 +245,11 @@ int AppTask::Init()
PLAT_LOG("Initialize Server");
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();

// Initialize info provider
sExampleDeviceInfoProvider.SetStorageDelegate(initParams.persistentStorageDelegate);
SetDeviceInfoProvider(&sExampleDeviceInfoProvider);

chip::Server::GetInstance().Init(initParams);

ConfigurationMgr().LogDeviceConfig();
Expand Down
2 changes: 2 additions & 0 deletions examples/lock-app/cc13x2x7_26x2x7/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ ti_simplelink_executable("lock_app") {
output_name = "chip-${ti_simplelink_board}-lock-example.out"

sources = [
"${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp",
"${project_dir}/main/AppTask.cpp",
"${project_dir}/main/BoltLockManager.cpp",
"${project_dir}/main/ZclCallbacks.cpp",
Expand All @@ -96,6 +97,7 @@ ti_simplelink_executable("lock_app") {
include_dirs = [
"${project_dir}",
"${project_dir}/main",
"${chip_root}/examples/providers/",
]

cflags = [
Expand Down
7 changes: 7 additions & 0 deletions examples/lock-app/cc13x2x7_26x2x7/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>

#include <DeviceInfoProviderImpl.h>
#include <platform/CHIPDeviceLayer.h>

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
Expand Down Expand Up @@ -63,6 +64,7 @@ static LED_Handle sAppRedHandle;
static LED_Handle sAppGreenHandle;
static Button_Handle sAppLeftHandle;
static Button_Handle sAppRightHandle;
static DeviceInfoProviderImpl sExampleDeviceInfoProvider;

AppTask AppTask::sAppTask;

Expand Down Expand Up @@ -166,6 +168,11 @@ int AppTask::Init()
PLAT_LOG("Initialize Server");
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();

// Initialize info provider
sExampleDeviceInfoProvider.SetStorageDelegate(initParams.persistentStorageDelegate);
SetDeviceInfoProvider(&sExampleDeviceInfoProvider);

chip::Server::GetInstance().Init(initParams);

// Initialize device attestation config
Expand Down
18 changes: 18 additions & 0 deletions src/controller/AutoCommissioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ CHIP_ERROR AutoCommissioner::SetCommissioningParameters(const CommissioningParam
}
mParams.SetCSRNonce(ByteSpan(mCSRNonce, sizeof(mCSRNonce)));

if (params.GetSkipCommissioningComplete().HasValue())
{
ChipLogProgress(Controller, "Setting PASE-only commissioning from parameters");
mParams.SetSkipCommissioningComplete(params.GetSkipCommissioningComplete().Value());
}

return CHIP_NO_ERROR;
}

Expand Down Expand Up @@ -252,6 +258,10 @@ CommissioningStage AutoCommissioner::GetNextCommissioningStageInternal(Commissio
}
else
{
if (mParams.GetSkipCommissioningComplete().ValueOr(false))
{
return CommissioningStage::kCleanup;
}
return CommissioningStage::kFindOperational;
}
case CommissioningStage::kWiFiNetworkSetup:
Expand Down Expand Up @@ -280,11 +290,19 @@ CommissioningStage AutoCommissioner::GetNextCommissioningStageInternal(Commissio
{
return CommissioningStage::kThreadNetworkEnable;
}
else if (mParams.GetSkipCommissioningComplete().ValueOr(false))
{
return CommissioningStage::kCleanup;
}
else
{
return CommissioningStage::kFindOperational;
}
case CommissioningStage::kThreadNetworkEnable:
if (mParams.GetSkipCommissioningComplete().ValueOr(false))
{
return CommissioningStage::kCleanup;
}
return CommissioningStage::kFindOperational;
case CommissioningStage::kFindOperational:
return CommissioningStage::kSendComplete;
Expand Down
8 changes: 7 additions & 1 deletion src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,6 @@ void DeviceCommissioner::CommissioningStageComplete(CHIP_ERROR err, Commissionin
{
// Once this stage is complete, reset mDeviceBeingCommissioned - this will be reset when the delegate calls the next step.
MATTER_TRACE_EVENT_SCOPE("CommissioningStageComplete", "DeviceCommissioner");

if (mDeviceBeingCommissioned == nullptr)
{
// We are getting a stray callback (e.g. due to un-cancellable
Expand Down Expand Up @@ -1654,6 +1653,13 @@ void DeviceCommissioner::OnDeviceConnectionFailureFn(void * context, const Scope
error = CHIP_ERROR_INTERNAL;
}

if (commissioner->mDeviceBeingCommissioned == nullptr ||
commissioner->mDeviceBeingCommissioned->GetDeviceId() != peerId.GetNodeId())
{
// Not the device we are trying to commission.
return;
}

if (commissioner->mCommissioningStage == CommissioningStage::kFindOperational &&
commissioner->mCommissioningDelegate != nullptr)
{
Expand Down
4 changes: 4 additions & 0 deletions src/controller/CommissioningDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ const char * StageToString(CommissioningStage stage)
return "Cleanup";
break;

case kNeedsNetworkCreds:
return "NeedsNetworkCreds";
break;

default:
return "???";
break;
Expand Down
Loading

0 comments on commit f3d17b7

Please sign in to comment.