Skip to content

Commit

Permalink
Regenerate files after controller.zap file changes
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbeach59 committed Jul 23, 2021
1 parent 6e2e45f commit 5e4f00f
Show file tree
Hide file tree
Showing 12 changed files with 730 additions and 0 deletions.
144 changes: 144 additions & 0 deletions examples/chip-tool/commands/clusters/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -18687,6 +18687,10 @@ class ReadTestClusterClusterRevision : public ModelCommand
| * OccupiedHeatingSetpoint | 0x0012 |
| * ControlSequenceOfOperation | 0x001B |
| * SystemMode | 0x001C |
| * StartOfWeek | 0x0020 |
| * NumberOfWeeklyTransitions | 0x0021 |
| * NumberOfDailyTransitions | 0x0022 |
| * FeatureMap | 0xFFFC |
| * ClusterRevision | 0xFFFD |
\*----------------------------------------------------------------------------*/

Expand Down Expand Up @@ -19241,6 +19245,142 @@ class WriteThermostatSystemMode : public ModelCommand
uint8_t mValue;
};

/*
* Attribute StartOfWeek
*/
class ReadThermostatStartOfWeek : public ModelCommand
{
public:
ReadThermostatStartOfWeek() : ModelCommand("read")
{
AddArgument("attr-name", "start-of-week");
ModelCommand::AddArguments();
}

~ReadThermostatStartOfWeek()
{
delete onSuccessCallback;
delete onFailureCallback;
}

CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
{
ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu8, endpointId);

chip::Controller::ThermostatCluster cluster;
cluster.Associate(device, endpointId);
return cluster.ReadAttributeStartOfWeek(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
}

private:
chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
* Attribute NumberOfWeeklyTransitions
*/
class ReadThermostatNumberOfWeeklyTransitions : public ModelCommand
{
public:
ReadThermostatNumberOfWeeklyTransitions() : ModelCommand("read")
{
AddArgument("attr-name", "number-of-weekly-transitions");
ModelCommand::AddArguments();
}

~ReadThermostatNumberOfWeeklyTransitions()
{
delete onSuccessCallback;
delete onFailureCallback;
}

CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
{
ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu8, endpointId);

chip::Controller::ThermostatCluster cluster;
cluster.Associate(device, endpointId);
return cluster.ReadAttributeNumberOfWeeklyTransitions(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
}

private:
chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
* Attribute NumberOfDailyTransitions
*/
class ReadThermostatNumberOfDailyTransitions : public ModelCommand
{
public:
ReadThermostatNumberOfDailyTransitions() : ModelCommand("read")
{
AddArgument("attr-name", "number-of-daily-transitions");
ModelCommand::AddArguments();
}

~ReadThermostatNumberOfDailyTransitions()
{
delete onSuccessCallback;
delete onFailureCallback;
}

CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
{
ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu8, endpointId);

chip::Controller::ThermostatCluster cluster;
cluster.Associate(device, endpointId);
return cluster.ReadAttributeNumberOfDailyTransitions(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
}

private:
chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
* Attribute FeatureMap
*/
class ReadThermostatFeatureMap : public ModelCommand
{
public:
ReadThermostatFeatureMap() : ModelCommand("read")
{
AddArgument("attr-name", "feature-map");
ModelCommand::AddArguments();
}

~ReadThermostatFeatureMap()
{
delete onSuccessCallback;
delete onFailureCallback;
}

CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
{
ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu8, endpointId);

chip::Controller::ThermostatCluster cluster;
cluster.Associate(device, endpointId);
return cluster.ReadAttributeFeatureMap(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
}

private:
chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
* Attribute ClusterRevision
*/
Expand Down Expand Up @@ -24031,6 +24171,10 @@ void registerClusterThermostat(Commands & commands)
make_unique<WriteThermostatControlSequenceOfOperation>(),
make_unique<ReadThermostatSystemMode>(),
make_unique<WriteThermostatSystemMode>(),
make_unique<ReadThermostatStartOfWeek>(),
make_unique<ReadThermostatNumberOfWeeklyTransitions>(),
make_unique<ReadThermostatNumberOfDailyTransitions>(),
make_unique<ReadThermostatFeatureMap>(),
make_unique<ReadThermostatClusterRevision>(),
};

Expand Down
48 changes: 48 additions & 0 deletions src/controller/data_model/gen/CHIPClusters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10126,6 +10126,54 @@ CHIP_ERROR ThermostatCluster::WriteAttributeSystemMode(Callback::Cancelable * on
return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback);
}

CHIP_ERROR ThermostatCluster::ReadAttributeStartOfWeek(Callback::Cancelable * onSuccessCallback,
Callback::Cancelable * onFailureCallback)
{
chip::app::AttributePathParams attributePath;
attributePath.mEndpointId = mEndpoint;
attributePath.mClusterId = mClusterId;
attributePath.mFieldId = 0x0020;
attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid);
return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback,
BasicAttributeFilter<Int8uAttributeCallback>);
}

CHIP_ERROR ThermostatCluster::ReadAttributeNumberOfWeeklyTransitions(Callback::Cancelable * onSuccessCallback,
Callback::Cancelable * onFailureCallback)
{
chip::app::AttributePathParams attributePath;
attributePath.mEndpointId = mEndpoint;
attributePath.mClusterId = mClusterId;
attributePath.mFieldId = 0x0021;
attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid);
return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback,
BasicAttributeFilter<Int8uAttributeCallback>);
}

CHIP_ERROR ThermostatCluster::ReadAttributeNumberOfDailyTransitions(Callback::Cancelable * onSuccessCallback,
Callback::Cancelable * onFailureCallback)
{
chip::app::AttributePathParams attributePath;
attributePath.mEndpointId = mEndpoint;
attributePath.mClusterId = mClusterId;
attributePath.mFieldId = 0x0022;
attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid);
return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback,
BasicAttributeFilter<Int8uAttributeCallback>);
}

CHIP_ERROR ThermostatCluster::ReadAttributeFeatureMap(Callback::Cancelable * onSuccessCallback,
Callback::Cancelable * onFailureCallback)
{
chip::app::AttributePathParams attributePath;
attributePath.mEndpointId = mEndpoint;
attributePath.mClusterId = mClusterId;
attributePath.mFieldId = 0xFFFC;
attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid);
return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback,
BasicAttributeFilter<Int32uAttributeCallback>);
}

CHIP_ERROR ThermostatCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback,
Callback::Cancelable * onFailureCallback)
{
Expand Down
6 changes: 6 additions & 0 deletions src/controller/data_model/gen/CHIPClusters.h
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,12 @@ class DLL_EXPORT ThermostatCluster : public ClusterBase
CHIP_ERROR ReadAttributeControlSequenceOfOperation(Callback::Cancelable * onSuccessCallback,
Callback::Cancelable * onFailureCallback);
CHIP_ERROR ReadAttributeSystemMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback);
CHIP_ERROR ReadAttributeStartOfWeek(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback);
CHIP_ERROR ReadAttributeNumberOfWeeklyTransitions(Callback::Cancelable * onSuccessCallback,
Callback::Cancelable * onFailureCallback);
CHIP_ERROR ReadAttributeNumberOfDailyTransitions(Callback::Cancelable * onSuccessCallback,
Callback::Cancelable * onFailureCallback);
CHIP_ERROR ReadAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback);
CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback);
CHIP_ERROR WriteAttributeOccupiedCoolingSetpoint(Callback::Cancelable * onSuccessCallback,
Callback::Cancelable * onFailureCallback, int16_t value);
Expand Down
32 changes: 32 additions & 0 deletions src/controller/data_model/gen/chip-zcl-zpro-codec-api.h
Original file line number Diff line number Diff line change
Expand Up @@ -3256,6 +3256,10 @@ chip::System::PacketBufferHandle encodeTestClusterClusterReadClusterRevisionAttr
| * OccupiedHeatingSetpoint | 0x0012 |
| * ControlSequenceOfOperation | 0x001B |
| * SystemMode | 0x001C |
| * StartOfWeek | 0x0020 |
| * NumberOfWeeklyTransitions | 0x0021 |
| * NumberOfDailyTransitions | 0x0022 |
| * FeatureMap | 0xFFFC |
| * ClusterRevision | 0xFFFD |
\*----------------------------------------------------------------------------*/

Expand Down Expand Up @@ -3340,6 +3344,34 @@ chip::System::PacketBufferHandle encodeThermostatClusterReadSystemModeAttribute(
chip::System::PacketBufferHandle
encodeThermostatClusterWriteSystemModeAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, uint8_t systemMode);

/**
* @brief
* Encode a Thermostat server read command for the start of week attribute into buffer including the APS frame
*/
chip::System::PacketBufferHandle encodeThermostatClusterReadStartOfWeekAttribute(uint8_t seqNum,
chip::EndpointId destinationEndpoint);

/**
* @brief
* Encode a Thermostat server read command for the number of weekly transitions attribute into buffer including the APS frame
*/
chip::System::PacketBufferHandle
encodeThermostatClusterReadNumberOfWeeklyTransitionsAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint);

/**
* @brief
* Encode a Thermostat server read command for the number of daily transitions attribute into buffer including the APS frame
*/
chip::System::PacketBufferHandle encodeThermostatClusterReadNumberOfDailyTransitionsAttribute(uint8_t seqNum,
chip::EndpointId destinationEndpoint);

/**
* @brief
* Encode a Thermostat server read command for the feature map attribute into buffer including the APS frame
*/
chip::System::PacketBufferHandle encodeThermostatClusterReadFeatureMapAttribute(uint8_t seqNum,
chip::EndpointId destinationEndpoint);

/**
* @brief
* Encode a Thermostat server read command for the cluster revision attribute into buffer including the APS frame
Expand Down
56 changes: 56 additions & 0 deletions src/controller/data_model/gen/encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5237,6 +5237,10 @@ PacketBufferHandle encodeTestClusterClusterReadClusterRevisionAttribute(uint8_t
| * OccupiedHeatingSetpoint | 0x0012 |
| * ControlSequenceOfOperation | 0x001B |
| * SystemMode | 0x001C |
| * StartOfWeek | 0x0020 |
| * NumberOfWeeklyTransitions | 0x0021 |
| * NumberOfDailyTransitions | 0x0022 |
| * FeatureMap | 0xFFFC |
| * ClusterRevision | 0xFFFD |
\*----------------------------------------------------------------------------*/

Expand Down Expand Up @@ -5381,6 +5385,58 @@ PacketBufferHandle encodeThermostatClusterWriteSystemModeAttribute(uint8_t seqNu
COMMAND_FOOTER();
}

/*
* Attribute StartOfWeek
*/
PacketBufferHandle encodeThermostatClusterReadStartOfWeekAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
COMMAND_HEADER("ReadThermostatStartOfWeek", Thermostat::Id);
buf.Put8(kFrameControlGlobalCommand)
.Put8(seqNum)
.Put32(Globals::Commands::Ids::ReadAttributes)
.Put32(Thermostat::Attributes::Ids::StartOfWeek);
COMMAND_FOOTER();
}

/*
* Attribute NumberOfWeeklyTransitions
*/
PacketBufferHandle encodeThermostatClusterReadNumberOfWeeklyTransitionsAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
COMMAND_HEADER("ReadThermostatNumberOfWeeklyTransitions", Thermostat::Id);
buf.Put8(kFrameControlGlobalCommand)
.Put8(seqNum)
.Put32(Globals::Commands::Ids::ReadAttributes)
.Put32(Thermostat::Attributes::Ids::NumberOfWeeklyTransitions);
COMMAND_FOOTER();
}

/*
* Attribute NumberOfDailyTransitions
*/
PacketBufferHandle encodeThermostatClusterReadNumberOfDailyTransitionsAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
COMMAND_HEADER("ReadThermostatNumberOfDailyTransitions", Thermostat::Id);
buf.Put8(kFrameControlGlobalCommand)
.Put8(seqNum)
.Put32(Globals::Commands::Ids::ReadAttributes)
.Put32(Thermostat::Attributes::Ids::NumberOfDailyTransitions);
COMMAND_FOOTER();
}

/*
* Attribute FeatureMap
*/
PacketBufferHandle encodeThermostatClusterReadFeatureMapAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
COMMAND_HEADER("ReadThermostatFeatureMap", Thermostat::Id);
buf.Put8(kFrameControlGlobalCommand)
.Put8(seqNum)
.Put32(Globals::Commands::Ids::ReadAttributes)
.Put32(Globals::Attributes::Ids::FeatureMap);
COMMAND_FOOTER();
}

/*
* Attribute ClusterRevision
*/
Expand Down
Loading

0 comments on commit 5e4f00f

Please sign in to comment.