Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into add_test_scripts_…
Browse files Browse the repository at this point in the history
…and_plans_for_preset_checks
  • Loading branch information
nivi-apple committed Aug 27, 2024
2 parents c3982eb + 32c961f commit 08996ab
Show file tree
Hide file tree
Showing 90 changed files with 875 additions and 1,032 deletions.
2 changes: 1 addition & 1 deletion config/esp32/components/chip/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies:
- if: "target != esp32h2"

espressif/esp_rcp_update:
version: "1.0.3"
version: "1.2.0"
rules:
- if: "idf_version >=5.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6301,7 +6301,7 @@ cluster RelativeHumidityMeasurement = 1029 {
readonly attribute int16u clusterRevision = 65533;
}

/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
/** The server cluster provides an interface to occupancy sensing functionality based on one or more sensing modalities, including configuration and provision of notifications of occupancy status. */
cluster OccupancySensing = 1030 {
revision 5;

Expand Down Expand Up @@ -6339,6 +6339,10 @@ cluster OccupancySensing = 1030 {
int16u holdTimeDefault = 2;
}

info event OccupancyChanged = 0 {
OccupancyBitmap occupancy = 0;
}

readonly attribute OccupancyBitmap occupancy = 0;
readonly attribute OccupancySensorTypeEnum occupancySensorType = 1;
readonly attribute OccupancySensorTypeBitmap occupancySensorTypeBitmap = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4735,7 +4735,7 @@ cluster RelativeHumidityMeasurement = 1029 {
readonly attribute int16u clusterRevision = 65533;
}

/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
/** The server cluster provides an interface to occupancy sensing functionality based on one or more sensing modalities, including configuration and provision of notifications of occupancy status. */
cluster OccupancySensing = 1030 {
revision 5;

Expand Down Expand Up @@ -4773,6 +4773,10 @@ cluster OccupancySensing = 1030 {
int16u holdTimeDefault = 2;
}

info event OccupancyChanged = 0 {
OccupancyBitmap occupancy = 0;
}

readonly attribute OccupancyBitmap occupancy = 0;
readonly attribute OccupancySensorTypeEnum occupancySensorType = 1;
readonly attribute OccupancySensorTypeBitmap occupancySensorTypeBitmap = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12488,4 +12488,4 @@
"parentEndpointIdentifier": null
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1917,7 +1917,7 @@ cluster FixedLabel = 64 {
readonly attribute int16u clusterRevision = 65533;
}

/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
/** The server cluster provides an interface to occupancy sensing functionality based on one or more sensing modalities, including configuration and provision of notifications of occupancy status. */
cluster OccupancySensing = 1030 {
revision 5;

Expand Down Expand Up @@ -1955,6 +1955,10 @@ cluster OccupancySensing = 1030 {
int16u holdTimeDefault = 2;
}

info event OccupancyChanged = 0 {
OccupancyBitmap occupancy = 0;
}

readonly attribute OccupancyBitmap occupancy = 0;
readonly attribute OccupancySensorTypeEnum occupancySensorType = 1;
readonly attribute OccupancySensorTypeBitmap occupancySensorTypeBitmap = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1812,7 +1812,7 @@ cluster FixedLabel = 64 {
readonly attribute int16u clusterRevision = 65533;
}

/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
/** The server cluster provides an interface to occupancy sensing functionality based on one or more sensing modalities, including configuration and provision of notifications of occupancy status. */
cluster OccupancySensing = 1030 {
revision 5;

Expand Down Expand Up @@ -1850,6 +1850,10 @@ cluster OccupancySensing = 1030 {
int16u holdTimeDefault = 2;
}

info event OccupancyChanged = 0 {
OccupancyBitmap occupancy = 0;
}

readonly attribute OccupancyBitmap occupancy = 0;
readonly attribute OccupancySensorTypeEnum occupancySensorType = 1;
readonly attribute OccupancySensorTypeBitmap occupancySensorTypeBitmap = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,7 @@ provisional cluster ScenesManagement = 98 {
fabric command CopyScene(CopySceneRequest): CopySceneResponse = 64;
}

/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
/** The server cluster provides an interface to occupancy sensing functionality based on one or more sensing modalities, including configuration and provision of notifications of occupancy status. */
cluster OccupancySensing = 1030 {
revision 5;

Expand Down Expand Up @@ -2006,6 +2006,10 @@ cluster OccupancySensing = 1030 {
int16u holdTimeDefault = 2;
}

info event OccupancyChanged = 0 {
OccupancyBitmap occupancy = 0;
}

readonly attribute OccupancyBitmap occupancy = 0;
readonly attribute OccupancySensorTypeEnum occupancySensorType = 1;
readonly attribute OccupancySensorTypeBitmap occupancySensorTypeBitmap = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2801,4 +2801,4 @@
"parentEndpointIdentifier": null
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2780,4 +2780,4 @@
"parentEndpointIdentifier": null
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,7 @@ cluster FixedLabel = 64 {
readonly attribute int16u clusterRevision = 65533;
}

/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
/** The server cluster provides an interface to occupancy sensing functionality based on one or more sensing modalities, including configuration and provision of notifications of occupancy status. */
cluster OccupancySensing = 1030 {
revision 5;

Expand Down Expand Up @@ -1653,6 +1653,10 @@ cluster OccupancySensing = 1030 {
int16u holdTimeDefault = 2;
}

info event OccupancyChanged = 0 {
OccupancyBitmap occupancy = 0;
}

readonly attribute OccupancyBitmap occupancy = 0;
readonly attribute OccupancySensorTypeEnum occupancySensorType = 1;
readonly attribute OccupancySensorTypeBitmap occupancySensorTypeBitmap = 2;
Expand Down Expand Up @@ -1896,7 +1900,7 @@ endpoint 0 {
}
}
endpoint 1 {
device type ma_occupancysensor = 263, version 1;
device type ma_occupancysensor = 263, version 4;

binding cluster Groups;
binding cluster Binding;
Expand Down
4 changes: 2 additions & 2 deletions examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap
Original file line number Diff line number Diff line change
Expand Up @@ -2484,7 +2484,7 @@
}
],
"deviceVersions": [
1
4
],
"deviceIdentifiers": [
263
Expand Down Expand Up @@ -3022,4 +3022,4 @@
"parentEndpointIdentifier": null
}
]
}
}
6 changes: 5 additions & 1 deletion examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2118,7 +2118,7 @@ cluster RelativeHumidityMeasurement = 1029 {
readonly attribute int16u clusterRevision = 65533;
}

/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
/** The server cluster provides an interface to occupancy sensing functionality based on one or more sensing modalities, including configuration and provision of notifications of occupancy status. */
cluster OccupancySensing = 1030 {
revision 5;

Expand Down Expand Up @@ -2156,6 +2156,10 @@ cluster OccupancySensing = 1030 {
int16u holdTimeDefault = 2;
}

info event OccupancyChanged = 0 {
OccupancyBitmap occupancy = 0;
}

readonly attribute OccupancyBitmap occupancy = 0;
readonly attribute OccupancySensorTypeEnum occupancySensorType = 1;
readonly attribute OccupancySensorTypeBitmap occupancySensorTypeBitmap = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5683,4 +5683,4 @@
"parentEndpointIdentifier": null
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1914,7 +1914,7 @@ cluster BooleanState = 69 {
readonly attribute int16u clusterRevision = 65533;
}

/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
/** The server cluster provides an interface to occupancy sensing functionality based on one or more sensing modalities, including configuration and provision of notifications of occupancy status. */
cluster OccupancySensing = 1030 {
revision 5;

Expand Down Expand Up @@ -1952,6 +1952,10 @@ cluster OccupancySensing = 1030 {
int16u holdTimeDefault = 2;
}

info event OccupancyChanged = 0 {
OccupancyBitmap occupancy = 0;
}

readonly attribute OccupancyBitmap occupancy = 0;
readonly attribute OccupancySensorTypeEnum occupancySensorType = 1;
readonly attribute OccupancySensorTypeBitmap occupancySensorTypeBitmap = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4750,4 +4750,4 @@
"parentEndpointIdentifier": null
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@

CHIP_ERROR ModelCommand::RunCommand()
{
MTRDeviceController * commissioner = CurrentCommissioner();
ChipLogProgress(chipTool, "Sending command to node 0x" ChipLogFormatX64, ChipLogValueX64(mNodeId));
auto * device = [MTRBaseDevice deviceWithNodeID:@(mNodeId) controller:commissioner];
auto * device = BaseDeviceWithNodeId(mNodeId);
VerifyOrReturnError(device != nil, CHIP_ERROR_INCORRECT_STATE);

CHIP_ERROR err = SendCommand(device, mEndPointId);

if (err != CHIP_NO_ERROR) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

#pragma once

#import <Matter/Matter.h>
#include <commands/common/Command.h>
#include <commands/common/CredentialIssuerCommands.h>
Expand All @@ -26,8 +27,6 @@

#include "../provider/OTAProviderDelegate.h"

#pragma once

inline constexpr char kIdentityAlpha[] = "alpha";
inline constexpr char kIdentityBeta[] = "beta";
inline constexpr char kIdentityGamma[] = "gamma";
Expand Down Expand Up @@ -91,6 +90,10 @@ class CHIPCommandBridge : public Command {

MTRDeviceController * GetCommissioner(const char * identity);

// Returns the MTRBaseDevice for the specified node ID.
// Will utilize an existing PASE connection if the device is being commissioned.
MTRBaseDevice * BaseDeviceWithNodeId(chip::NodeId nodeId);

// Will log the given string and given error (as progress if success, error
// if failure).
void LogNSError(const char * logString, NSError * error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@

MTRDeviceController * CHIPCommandBridge::GetCommissioner(const char * identity) { return mControllers[identity]; }

MTRBaseDevice * CHIPCommandBridge::BaseDeviceWithNodeId(chip::NodeId nodeId)
{
MTRDeviceController * controller = CurrentCommissioner();
VerifyOrReturnValue(controller != nil, nil);
return [controller deviceBeingCommissionedWithNodeID:@(nodeId) error:nullptr]
?: [MTRBaseDevice deviceWithNodeID:@(nodeId) controller:controller];
}

void CHIPCommandBridge::StopCommissioners()
{
for (auto & pair : mControllers) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@

CHIP_ERROR WaitForCommissioneeCommand::RunCommand()
{
MTRDeviceController * commissioner = CurrentCommissioner();
VerifyOrReturnError(nil != commissioner, CHIP_ERROR_INCORRECT_STATE);

auto * base_device = [MTRBaseDevice deviceWithNodeID:@(mNodeId) controller:commissioner];
auto * base_device = BaseDeviceWithNodeId(mNodeId);
VerifyOrReturnError(base_device != nil, CHIP_ERROR_INCORRECT_STATE);

if (mExpireExistingSession.ValueOr(true)) {
Expand Down
34 changes: 25 additions & 9 deletions examples/darwin-framework-tool/commands/pairing/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,61 +28,75 @@
class PairCode : public PairingCommandBridge
{
public:
PairCode() : PairingCommandBridge("code", PairingMode::Code, PairingNetworkType::None) {}
PairCode() : PairingCommandBridge("code", PairingMode::Code, CommissioningType::NoNetwork) {}
};

class PairCodePASEOnly : public PairingCommandBridge
{
public:
PairCodePASEOnly() : PairingCommandBridge("code-paseonly", PairingMode::Code, CommissioningType::None) {}
};

class PairCodeWifi : public PairingCommandBridge
{
public:
PairCodeWifi() : PairingCommandBridge("code-wifi", PairingMode::Code, PairingNetworkType::WiFi) {}
PairCodeWifi() : PairingCommandBridge("code-wifi", PairingMode::Code, CommissioningType::WiFi) {}
};

class PairCodeThread : public PairingCommandBridge
{
public:
PairCodeThread() : PairingCommandBridge("code-thread", PairingMode::Code, PairingNetworkType::Thread) {}
PairCodeThread() : PairingCommandBridge("code-thread", PairingMode::Code, CommissioningType::Thread) {}
};

class PairBleWiFi : public PairingCommandBridge
{
public:
PairBleWiFi() : PairingCommandBridge("ble-wifi", PairingMode::Ble, PairingNetworkType::WiFi) {}
PairBleWiFi() : PairingCommandBridge("ble-wifi", PairingMode::Ble, CommissioningType::WiFi) {}
};

class PairBleThread : public PairingCommandBridge
{
public:
PairBleThread() : PairingCommandBridge("ble-thread", PairingMode::Ble, PairingNetworkType::Thread) {}
PairBleThread() : PairingCommandBridge("ble-thread", PairingMode::Ble, CommissioningType::Thread) {}
};

class PairAlreadyDiscoveredByIndex : public PairingCommandBridge
{
public:
PairAlreadyDiscoveredByIndex() :
PairingCommandBridge("by-index", PairingMode::AlreadyDiscoveredByIndex, PairingNetworkType::None)
PairingCommandBridge("by-index", PairingMode::AlreadyDiscoveredByIndex, CommissioningType::NoNetwork)
{}
};

class PairAlreadyDiscoveredByIndexPASEOnly : public PairingCommandBridge
{
public:
PairAlreadyDiscoveredByIndexPASEOnly() :
PairingCommandBridge("by-index-paseonly", PairingMode::AlreadyDiscoveredByIndex, CommissioningType::None)
{}
};

class PairAlreadyDiscoveredByIndexWithWiFi : public PairingCommandBridge
{
public:
PairAlreadyDiscoveredByIndexWithWiFi() :
PairingCommandBridge("by-index-with-wifi", PairingMode::AlreadyDiscoveredByIndex, PairingNetworkType::WiFi)
PairingCommandBridge("by-index-with-wifi", PairingMode::AlreadyDiscoveredByIndex, CommissioningType::WiFi)
{}
};

class PairAlreadyDiscoveredByIndexWithThread : public PairingCommandBridge
{
public:
PairAlreadyDiscoveredByIndexWithThread() :
PairingCommandBridge("by-index-with-thread", PairingMode::AlreadyDiscoveredByIndex, PairingNetworkType::Thread)
PairingCommandBridge("by-index-with-thread", PairingMode::AlreadyDiscoveredByIndex, CommissioningType::Thread)
{}
};

class Unpair : public PairingCommandBridge
{
public:
Unpair() : PairingCommandBridge("unpair", PairingMode::None, PairingNetworkType::None) {}
Unpair() : PairingCommandBridge("unpair", PairingMode::Unpair, CommissioningType::None) {}
};

void registerCommandsPairing(Commands & commands)
Expand All @@ -91,11 +105,13 @@ void registerCommandsPairing(Commands & commands)

commands_list clusterCommands = {
make_unique<PairCode>(),
make_unique<PairCodePASEOnly>(),
make_unique<PairCodeWifi>(),
make_unique<PairCodeThread>(),
make_unique<PairBleWiFi>(),
make_unique<PairBleThread>(),
make_unique<PairAlreadyDiscoveredByIndex>(),
make_unique<PairAlreadyDiscoveredByIndexPASEOnly>(),
make_unique<Unpair>(),
make_unique<OpenCommissioningWindowCommand>(),
make_unique<PreWarmCommissioningCommand>(),
Expand Down
Loading

0 comments on commit 08996ab

Please sign in to comment.