Skip to content

Commit

Permalink
Merge branch 'master' into telink_zephyr_update_v3.1.0_docker
Browse files Browse the repository at this point in the history
  • Loading branch information
s07641069 authored Sep 29, 2022
2 parents af3a672 + baff1a7 commit fd60532
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 30 deletions.
14 changes: 10 additions & 4 deletions examples/platform/efr32/BaseApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ void BaseApplication::ButtonHandler(AppEvent * aEvent)
}
else
{
// If the button was released before factory reset got initiated, start BLE advertissement in fast mode
// If the button was released before factory reset got initiated, open the commissioning window and start BLE advertissement
// in fast mode
if (mFunctionTimerActive && mFunction == kFunction_StartBleAdv)
{
CancelFunctionTimer();
Expand All @@ -431,9 +432,14 @@ void BaseApplication::ButtonHandler(AppEvent * aEvent)
if (!ConnectivityMgr().IsThreadProvisioned())
#endif /* !SL_WIFI */
{
// Enable BLE advertisements
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
ConnectivityMgr().SetBLEAdvertisingMode(ConnectivityMgr().kFastAdvertising);
// Open Basic CommissioningWindow. Will start BLE advertisements
chip::DeviceLayer::PlatformMgr().LockChipStack();
CHIP_ERROR err = chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow();
chip::DeviceLayer::PlatformMgr().UnlockChipStack();
if (err != CHIP_NO_ERROR)
{
EFR32_LOG("Failed to open the Basic Commissioning Window");
}
}
else { EFR32_LOG("Network is already provisioned, Ble advertissement not enabled"); }
}
Expand Down
2 changes: 1 addition & 1 deletion src/controller/AutoCommissioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ CommissioningStage AutoCommissioner::GetNextCommissioningStageInternal(Commissio
case CommissioningStage::kSendTrustedRootCert:
return CommissioningStage::kSendNOC;
case CommissioningStage::kSendNOC:
// TODO(cecille): device attestation casues operational cert provisioinging to happen, This should be a separate stage.
// TODO(cecille): device attestation casues operational cert provisioning to happen, This should be a separate stage.
// For thread and wifi, this should go to network setup then enable. For on-network we can skip right to finding the
// operational network because the provisioning of certificates will trigger the device to start operational advertising.
if (mNeedsNetworkSetup)
Expand Down
45 changes: 23 additions & 22 deletions src/controller/CommissioningDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,29 @@ class DeviceCommissioner;
enum CommissioningStage : uint8_t
{
kError,
kSecurePairing,
kReadCommissioningInfo,
kArmFailsafe,
kConfigRegulatory,
kSendPAICertificateRequest,
kSendDACCertificateRequest,
kSendAttestationRequest,
kAttestationVerification,
kSendOpCertSigningRequest,
kValidateCSR,
kGenerateNOCChain,
kSendTrustedRootCert,
kSendNOC,
kWiFiNetworkSetup,
kThreadNetworkSetup,
kWiFiNetworkEnable,
kThreadNetworkEnable,
kFindOperational,
kSendComplete,
kCleanup,
// ScanNetworks can happen anytime after kArmFailsafe.
// However, the circ tests fail if it is earlier in the list
kSecurePairing, ///< Establish a PASE session with the device
kReadCommissioningInfo, ///< Query General Commissioning Attributes and Network Features
kArmFailsafe, ///< Send ArmFailSafe (0x30:0) command to the device
kConfigRegulatory, ///< Send SetRegulatoryConfig (0x30:2) command to the device
kSendPAICertificateRequest, ///< Send PAI CertificateChainRequest (0x3E:2) command to the device
kSendDACCertificateRequest, ///< Send DAC CertificateChainRequest (0x3E:2) command to the device
kSendAttestationRequest, ///< Send AttestationRequest (0x3E:0) command to the device
kAttestationVerification, ///< Verify AttestationResponse (0x3E:1) validity
kSendOpCertSigningRequest, ///< Send CSRRequest (0x3E:4) command to the device
kValidateCSR, ///< Verify CSRResponse (0x3E:5) validity
kGenerateNOCChain, ///< TLV encode Node Operational Credentials (NOC) chain certs
kSendTrustedRootCert, ///< Send AddTrustedRootCertificate (0x3E:11) command to the device
kSendNOC, ///< Send AddNOC (0x3E:6) command to the device
kWiFiNetworkSetup, ///< Send AddOrUpdateWiFiNetwork (0x31:2) command to the device
kThreadNetworkSetup, ///< Send AddOrUpdateThreadNetwork (0x31:3) command to the device
kWiFiNetworkEnable, ///< Send ConnectNetwork (0x31:6) command to the device for the WiFi network
kThreadNetworkEnable, ///< Send ConnectNetwork (0x31:6) command to the device for the Thread network
kFindOperational, ///< Perform operational discovery and establish a CASE session with the device
kSendComplete, ///< Send CommissioningComplete (0x30:4) command to the device
kCleanup, ///< Call delegates with status, free memory, clear timers and state
/// Send ScanNetworks (0x31:0) command to the device.
/// ScanNetworks can happen anytime after kArmFailsafe.
/// However, the cirque tests fail if it is earlier in the list
kScanNetworks,
kNeedsNetworkCreds,
};
Expand Down
5 changes: 2 additions & 3 deletions src/transport/SessionDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ class DLL_EXPORT SessionDelegate

/**
* @brief
* Called when a session is unresponsive for a while (detected by MRP)
*
* Note: the implementation must not do anything that will destroy the session or change the SessionHolder.
* Called when a session is unresponsive for a while (detected by MRP). Callees SHALL NOT make synchronous calls into
* SessionManager to allocate a new session. If they desire to do so, it MUST be done asynchronously.
*/
virtual void OnSessionHang() {}
};
Expand Down

0 comments on commit fd60532

Please sign in to comment.