Skip to content

Commit

Permalink
Thermostat cluster added. Support for raise-lower-setpoint command (#…
Browse files Browse the repository at this point in the history
…6012)

* Thermostat cluster added.  Support for raise-lower-setpoint command

* Restyled by whitespace

* Restyled by clang-format

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
chrisbeach59 and restyled-commits authored Apr 15, 2021
1 parent 3120ae8 commit 24f26f6
Show file tree
Hide file tree
Showing 18 changed files with 3,557 additions and 1,043 deletions.
1,015 changes: 615 additions & 400 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ EmberAfStatus emberAfNetworkCommissioningClusterServerCommandParse(EmberAfCluste
EmberAfStatus emberAfOnOffClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfScenesClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfTemperatureMeasurementClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfThermostatClusterServerCommandParse(EmberAfClusterCommand * cmd);

static EmberAfStatus status(bool wasHandled, bool clusterExists, bool mfgSpecific)
{
Expand Down Expand Up @@ -144,6 +145,10 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd)
// No commands are enabled for cluster Temperature Measurement
result = status(false, true, cmd->mfgSpecific);
break;
case ZCL_THERMOSTAT_CLUSTER_ID:
// No commands are enabled for cluster Thermostat
result = status(false, true, cmd->mfgSpecific);
break;
default:
// Unrecognized cluster ID, error status will apply.
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId)
case ZCL_TEMP_MEASUREMENT_CLUSTER_ID:
emberAfTemperatureMeasurementClusterInitCallback(endpoint);
break;
case ZCL_THERMOSTAT_CLUSTER_ID:
emberAfThermostatClusterInitCallback(endpoint);
break;
default:
// Unrecognized cluster ID
break;
Expand Down Expand Up @@ -179,6 +182,11 @@ void __attribute__((weak)) emberAfTemperatureMeasurementClusterInitCallback(Endp
// To prevent warning
(void) endpoint;
}
void __attribute__((weak)) emberAfThermostatClusterInitCallback(EndpointId endpoint)
{
// To prevent warning
(void) endpoint;
}

//
// Non-Cluster Related Callbacks
Expand Down
78 changes: 78 additions & 0 deletions examples/all-clusters-app/all-clusters-common/gen/callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,14 @@ void emberAfScenesClusterInitCallback(chip::EndpointId endpoint);
*/
void emberAfTemperatureMeasurementClusterInitCallback(chip::EndpointId endpoint);

/** @brief Thermostat Cluster Init
*
* Cluster Init
*
* @param endpoint Endpoint that is being initialized
*/
void emberAfThermostatClusterInitCallback(chip::EndpointId endpoint);

// Cluster Server/Client Init Functions

//
Expand Down Expand Up @@ -1447,6 +1455,76 @@ EmberAfStatus emberAfTemperatureMeasurementClusterServerPreAttributeChangedCallb
*/
void emberAfTemperatureMeasurementClusterServerTickCallback(chip::EndpointId endpoint);

//
// Thermostat Cluster server
//

/** @brief Thermostat Cluster Server Init
*
* Server Init
*
* @param endpoint Endpoint that is being initialized
*/
void emberAfThermostatClusterServerInitCallback(chip::EndpointId endpoint);

/** @brief Thermostat Cluster Server Attribute Changed
*
* Server Attribute Changed
*
* @param endpoint Endpoint that is being initialized
* @param attributeId Attribute that changed
*/
void emberAfThermostatClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId);

/** @brief Thermostat Cluster Server Manufacturer Specific Attribute Changed
*
* Server Manufacturer Specific Attribute Changed
*
* @param endpoint Endpoint that is being initialized
* @param attributeId Attribute that changed
* @param manufacturerCode Manufacturer Code of the attribute that changed
*/
void emberAfThermostatClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint,
chip::AttributeId attributeId,
uint16_t manufacturerCode);

/** @brief Thermostat Cluster Server Message Sent
*
* Server Message Sent
*
* @param type The type of message sent
* @param indexOrDestination The destination or address to which the message was sent
* @param apsFrame The APS frame for the message
* @param msgLen The length of the message
* @param message The message that was sent
* @param status The status of the sent message
*/
void emberAfThermostatClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination,
EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message,
EmberStatus status);

/** @brief Thermostat Cluster Server Pre Attribute Changed
*
* server Pre Attribute Changed
*
* @param endpoint Endpoint that is being initialized
* @param attributeId Attribute to be changed
* @param attributeType Attribute type
* @param size Attribute size
* @param value Attribute value
*/
EmberAfStatus emberAfThermostatClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId,
EmberAfAttributeType attributeType, uint8_t size,
uint8_t * value);

/** @brief Thermostat Cluster Server Tick
*
* server Tick
*
* @param endpoint Endpoint that is being served
*/
void emberAfThermostatClusterServerTickCallback(chip::EndpointId endpoint);

// Cluster Commands Callback

/**
Expand Down
Loading

0 comments on commit 24f26f6

Please sign in to comment.