Skip to content

Commit

Permalink
Merge branch 'master' into add-oven-opstate-yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
beckerzito authored Feb 13, 2024
2 parents bac8f4e + f216481 commit 26ffd94
Show file tree
Hide file tree
Showing 115 changed files with 938 additions and 593 deletions.
2 changes: 1 addition & 1 deletion docs/QUICK_START.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ combination listed below.

| <div style="width:200px">Border Router</div> | <div style="width:200px">Node</div> | Description |
| -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [**ot-br**](https://openthread.io/guides/border-router/build)<br>Thread Border Router <li>RasPi <li>BeagleBone | **lighting-app** <li>[Nordic nRF5x](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/nrfconnect/README.md) <li> [NXP K32W](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/nxp/k32w/k32w0/README.md) <li> [Qorvo QPG6100](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/qpg) <li> [Silicon Labs EFR32](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/efr32/README.md) | The Lighting example is supported by many of the available Thread platforms. See the chip-tool controller instructions for how to actuate the light on/off cluster. |
| [**ot-br**](https://openthread.io/guides/border-router/build)<br>Thread Border Router <li>RasPi <li>BeagleBone | **lighting-app** <li>[Nordic nRF5x](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/nrfconnect/README.md) <li> [NXP K32W](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/nxp/k32w/k32w0/README.md) <li> [Qorvo QPG6100](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/qpg) <li> [Silicon Labs EFR32](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/silabs/README.md) | The Lighting example is supported by many of the available Thread platforms. See the chip-tool controller instructions for how to actuate the light on/off cluster. |
| [**ot-br**](https://openthread.io/guides/border-router/build)<br>Thread Border Router <li>RasPi <li>BeagleBone | **lock-app** <li>[Nordic nRF5x](https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/nrfconnect/README.md) <li> [NXP K32W](https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/nxp/k32w/k32w0/README.md) <li> [Qorvo QPG6100](https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/qpg) <li> [Silicon Labs EFR32](https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/efr32/README.md) <li> [TI CC13x2x7](https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/cc13x2x7_26x2x7/README.md) | The Lock example is supported by many of the available Thread and Wi-Fi platforms. |

## Controllers
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/silabs_efr32_software_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ all of the EFR32 example applications.
## Running the OTA Download scenario

- For Matter with OpenThread: Bring up the OpenThread Border Router as
discussed in examples/lighting-app/efr32/README.md and get its operational
discussed in examples/lighting-app/silabs/README.md and get its operational
dataset.

- On a Linux or Darwin platform build the chip-tool and the ota-provider-app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#pragma once

#include <app-common/zap-generated/attributes/Accessors.h>
#include <protocols/interaction_model/StatusCode.h>

namespace chip {
namespace app {
Expand All @@ -31,19 +32,20 @@ class RelativeHumiditySensorManager

void Init()
{
EmberAfStatus status = RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Set(mEndpointId, 0);
VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
Protocols::InteractionModel::Status status = RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Set(mEndpointId, 0);
VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
ChipLogError(NotSpecified, "Failed to set RelativeHumidityMeasurement MinMeasuredValue attribute"));

status = RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Set(mEndpointId, 10000);
VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
ChipLogError(NotSpecified, "Failed to set RelativeHumidityMeasurement MaxMeasuredValue attribute"));
};

void OnHumidityChangeHandler(uint16_t newValue)
{
EmberAfStatus status = RelativeHumidityMeasurement::Attributes::MeasuredValue::Set(mEndpointId, newValue);
VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
Protocols::InteractionModel::Status status =
RelativeHumidityMeasurement::Attributes::MeasuredValue::Set(mEndpointId, newValue);
VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
ChipLogError(NotSpecified, "Failed to set RelativeHumidityMeasurement MeasuredValue attribute"));
ChipLogDetail(NotSpecified, "The new RelativeHumidityMeasurement value: %d", newValue);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#pragma once

#include <app-common/zap-generated/attributes/Accessors.h>
#include <protocols/interaction_model/StatusCode.h>

namespace chip {
namespace app {
Expand All @@ -31,19 +32,19 @@ class TemperatureSensorManager

void Init()
{
EmberAfStatus status = TemperatureMeasurement::Attributes::MinMeasuredValue::Set(mEndpointId, -500);
VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
Protocols::InteractionModel::Status status = TemperatureMeasurement::Attributes::MinMeasuredValue::Set(mEndpointId, -500);
VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
ChipLogError(NotSpecified, "Failed to set TemperatureMeasurement MinMeasuredValue attribute"));

status = TemperatureMeasurement::Attributes::MaxMeasuredValue::Set(mEndpointId, 6000);
VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
ChipLogError(NotSpecified, "Failed to set TemperatureMeasurement MaxMeasuredValue attribute"));
}

void OnTemperatureChangeHandler(int16_t newValue)
{
EmberAfStatus status = TemperatureMeasurement::Attributes::MeasuredValue::Set(mEndpointId, newValue);
VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
Protocols::InteractionModel::Status status = TemperatureMeasurement::Attributes::MeasuredValue::Set(mEndpointId, newValue);
VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
ChipLogError(NotSpecified, "Failed to set TemperatureMeasurement MeasuredValue attribute"));
ChipLogDetail(NotSpecified, "The new TemperatureMeasurement value: %d", newValue);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,13 @@ void AirPurifierManager::PercentSettingWriteCallback(uint8_t aNewPercentSetting)
if (aNewPercentSetting != percentCurrent)
{
ChipLogDetail(NotSpecified, "AirPurifierManager::PercentSettingWriteCallback: %d", aNewPercentSetting);
percentCurrent = aNewPercentSetting;
EmberAfStatus status = FanControl::Attributes::PercentCurrent::Set(mEndpointId, percentCurrent);
if (status != EMBER_ZCL_STATUS_SUCCESS)
percentCurrent = aNewPercentSetting;
Status status = FanControl::Attributes::PercentCurrent::Set(mEndpointId, percentCurrent);
if (status != Status::Success)
{
ChipLogError(NotSpecified,
"AirPurifierManager::PercentSettingWriteCallback: failed to set PercentCurrent attribute: %d", status);
"AirPurifierManager::PercentSettingWriteCallback: failed to set PercentCurrent attribute: %d",
to_underlying(status));
}
}
}
Expand All @@ -211,12 +212,12 @@ void AirPurifierManager::SpeedSettingWriteCallback(uint8_t aNewSpeedSetting)
if (aNewSpeedSetting != speedCurrent)
{
ChipLogDetail(NotSpecified, "AirPurifierManager::SpeedSettingWriteCallback: %d", aNewSpeedSetting);
speedCurrent = aNewSpeedSetting;
EmberAfStatus status = FanControl::Attributes::SpeedCurrent::Set(mEndpointId, speedCurrent);
if (status != EMBER_ZCL_STATUS_SUCCESS)
speedCurrent = aNewSpeedSetting;
Status status = FanControl::Attributes::SpeedCurrent::Set(mEndpointId, speedCurrent);
if (status != Status::Success)
{
ChipLogError(NotSpecified, "AirPurifierManager::SpeedSettingWriteCallback: failed to set SpeedCurrent attribute: %d",
status);
to_underlying(status));
}

// Determine if the speed change should also change the fan mode
Expand Down Expand Up @@ -299,22 +300,24 @@ void AirPurifierManager::SetSpeedSetting(DataModel::Nullable<uint8_t> aNewSpeedS

if (aNewSpeedSetting.Value() != speedCurrent)
{
EmberAfStatus status = FanControl::Attributes::SpeedSetting::Set(mEndpointId, aNewSpeedSetting);
if (status != EMBER_ZCL_STATUS_SUCCESS)
Status status = FanControl::Attributes::SpeedSetting::Set(mEndpointId, aNewSpeedSetting);
if (status != Status::Success)
{
ChipLogError(NotSpecified, "AirPurifierManager::SetSpeedSetting: failed to set SpeedSetting attribute: %d", status);
ChipLogError(NotSpecified, "AirPurifierManager::SetSpeedSetting: failed to set SpeedSetting attribute: %d",
to_underlying(status));
}
}
}

DataModel::Nullable<uint8_t> AirPurifierManager::GetSpeedSetting()
{
DataModel::Nullable<uint8_t> speedSetting;
EmberAfStatus status = FanControl::Attributes::SpeedSetting::Get(mEndpointId, speedSetting);
Status status = FanControl::Attributes::SpeedSetting::Get(mEndpointId, speedSetting);

if (status != EMBER_ZCL_STATUS_SUCCESS)
if (status != Status::Success)
{
ChipLogError(NotSpecified, "AirPurifierManager::GetSpeedSetting: failed to get SpeedSetting attribute: %d", status);
ChipLogError(NotSpecified, "AirPurifierManager::GetSpeedSetting: failed to get SpeedSetting attribute: %d",
to_underlying(status));
}

return speedSetting;
Expand All @@ -323,11 +326,12 @@ DataModel::Nullable<uint8_t> AirPurifierManager::GetSpeedSetting()
DataModel::Nullable<Percent> AirPurifierManager::GetPercentSetting()
{
DataModel::Nullable<Percent> percentSetting;
EmberAfStatus status = FanControl::Attributes::PercentSetting::Get(mEndpointId, percentSetting);
Status status = FanControl::Attributes::PercentSetting::Get(mEndpointId, percentSetting);

if (status != EMBER_ZCL_STATUS_SUCCESS)
if (status != Status::Success)
{
ChipLogError(NotSpecified, "AirPurifierManager::GetPercentSetting: failed to get PercentSetting attribute: %d", status);
ChipLogError(NotSpecified, "AirPurifierManager::GetPercentSetting: failed to get PercentSetting attribute: %d",
to_underlying(status));
}

return percentSetting;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*/

#include "thermostat-manager.h"
#include <protocols/interaction_model/StatusCode.h>

using chip::Protocols::InteractionModel::Status;

using namespace chip;
using namespace chip::app;
Expand All @@ -26,28 +29,28 @@ void ThermostatManager::Init()
{
BitMask<Thermostat::Feature> FeatureMap;
FeatureMap.Set(Thermostat::Feature::kHeating);
EmberAfStatus status = Thermostat::Attributes::FeatureMap::Set(mEndpointId, FeatureMap.Raw());
Status status = Thermostat::Attributes::FeatureMap::Set(mEndpointId, FeatureMap.Raw());

status = Thermostat::Attributes::ControlSequenceOfOperation::Set(mEndpointId,
Thermostat::ControlSequenceOfOperationEnum::kHeatingOnly);
VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
VerifyOrReturn(Status::Success == status,
ChipLogError(NotSpecified, "Failed to set Thermostat ControlSequenceOfOperation attribute"));

status = Thermostat::Attributes::AbsMinHeatSetpointLimit::Set(mEndpointId, 500);
VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
VerifyOrReturn(Status::Success == status,
ChipLogError(NotSpecified, "Failed to set Thermostat MinHeatSetpointLimit attribute"));

status = Thermostat::Attributes::AbsMaxHeatSetpointLimit::Set(mEndpointId, 3000);
VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
VerifyOrReturn(Status::Success == status,
ChipLogError(NotSpecified, "Failed to set Thermostat MaxHeatSetpointLimit attribute"));
}

void ThermostatManager::HeatingSetpointWriteCallback(int16_t newValue)
{
ChipLogDetail(NotSpecified, "ThermostatManager::HeatingSetpointWriteCallback: %d", newValue);
Thermostat::SystemModeEnum systemMode;
EmberAfStatus status = Thermostat::Attributes::SystemMode::Get(mEndpointId, &systemMode);
VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(NotSpecified, "Failed to get Thermostat SystemMode attribute"));
Status status = Thermostat::Attributes::SystemMode::Get(mEndpointId, &systemMode);
VerifyOrReturn(Status::Success == status, ChipLogError(NotSpecified, "Failed to get Thermostat SystemMode attribute"));

// A new setpoint has been set, so we shall infer that the we want to be in Heating mode
if (systemMode == Thermostat::SystemModeEnum::kOff)
Expand All @@ -58,7 +61,7 @@ void ThermostatManager::HeatingSetpointWriteCallback(int16_t newValue)
// Check the current temperature and turn on the heater if needed
DataModel::Nullable<int16_t> localTemperature;
status = Thermostat::Attributes::LocalTemperature::Get(mEndpointId, localTemperature);
VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
VerifyOrReturn(Status::Success == status,
ChipLogError(NotSpecified, "Failed to get TemperatureMeasurement MeasuredValue attribute"));

if (localTemperature.Value() < newValue)
Expand All @@ -81,14 +84,13 @@ void ThermostatManager::SystemModeWriteCallback(uint8_t newValue)
else if ((Thermostat::SystemModeEnum) newValue == Thermostat::SystemModeEnum::kHeat)
{
DataModel::Nullable<int16_t> localTemperature;
EmberAfStatus status = Thermostat::Attributes::LocalTemperature::Get(mEndpointId, localTemperature);
VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
Status status = Thermostat::Attributes::LocalTemperature::Get(mEndpointId, localTemperature);
VerifyOrReturn(Status::Success == status,
ChipLogError(NotSpecified, "Failed to get TemperatureMeasurement MeasuredValue attribute"));

int16_t heatingSetpoint;
status = Thermostat::Attributes::OccupiedHeatingSetpoint::Get(mEndpointId, &heatingSetpoint);
VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
ChipLogError(NotSpecified, "Failed to get Thermostat HeatingSetpoint attribute"));
VerifyOrReturn(Status::Success == status, ChipLogError(NotSpecified, "Failed to get Thermostat HeatingSetpoint attribute"));

if (localTemperature.Value() < heatingSetpoint)
{
Expand All @@ -99,8 +101,8 @@ void ThermostatManager::SystemModeWriteCallback(uint8_t newValue)

void ThermostatManager::OnLocalTemperatureChangeCallback(int16_t temperature)
{
EmberAfStatus status = Thermostat::Attributes::LocalTemperature::Set(mEndpointId, temperature);
VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
Status status = Thermostat::Attributes::LocalTemperature::Set(mEndpointId, temperature);
VerifyOrReturn(Status::Success == status,
ChipLogError(NotSpecified, "Failed to set TemperatureMeasurement MeasuredValue attribute"));
}

Expand All @@ -122,14 +124,13 @@ void ThermostatManager::SetHeating(bool isHeating)
runningState.Clear(Thermostat::RelayStateBitmap::kHeat);
}

EmberAfStatus status = Thermostat::Attributes::ThermostatRunningState::Set(mEndpointId, runningState);
VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
ChipLogError(NotSpecified, "Failed to set Thermostat RunningState attribute"));
Status status = Thermostat::Attributes::ThermostatRunningState::Set(mEndpointId, runningState);
VerifyOrReturn(Status::Success == status, ChipLogError(NotSpecified, "Failed to set Thermostat RunningState attribute"));
}

void ThermostatManager::SetHeatMode(bool heat)
{
EmberAfStatus status = Thermostat::Attributes::SystemMode::Set(
Status status = Thermostat::Attributes::SystemMode::Set(
mEndpointId, heat ? Thermostat::SystemModeEnum::kHeat : Thermostat::SystemModeEnum::kOff);
VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(NotSpecified, "Failed to set Thermostat SystemMode attribute"));
VerifyOrReturn(Status::Success == status, ChipLogError(NotSpecified, "Failed to set Thermostat SystemMode attribute"));
}
Loading

0 comments on commit 26ffd94

Please sign in to comment.