Skip to content

Commit

Permalink
Part 2: feature/relative humidity measurement cluster (project-chip#7028
Browse files Browse the repository at this point in the history
)

* format endpointClusterWithInit for easier pull requests

* add support for emberAfRelativeHumidityMeasurementClusterServerInitCallback

* add server side relative humidity measurement cluster impl.

* add relative humidity measurement cluster to controller-clusters.zap

* Add new clusters to zap_cluster_list.py

* Restyled by clang-format

* apply fixes

- replace emberAfReadAttribute with emberAfReadServerAttribute
- replace emberAfWriteAttribute with emberAfWriteServerAttribute
- add emberAfRelativeHumidityMeasurementClusterPrintln
- let the caller do the logging

* remove emberAfRelativeHumidityMeasurementClusterServerInitCallback impl.

The default values are populated by the attribute storage.

* fix year in copyright

* remove unrelated clusters in zap_cluster_list.py

* add relative humidity measurement to all-cluster-app.zap

* fix relative humidity measurement includes

* temptive fix for esp32/all-cluster-app

* another try to fix all-cluster-app/esp32

* regen all

* Remove unnecessary init callback from Relative Humidity Measurement cluster

* Add Relative Humidity Measurement cluster on endpoint 1 also in all-clusters-app

* Regenerate generated files

Co-authored-by: Vivien Nicolas <vnicolas@apple.com>
Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
  • Loading branch information
4 people authored and Nikita committed Sep 23, 2021
1 parent 9ca8fa1 commit 8b3ada5
Show file tree
Hide file tree
Showing 28 changed files with 1,577 additions and 65 deletions.
224 changes: 224 additions & 0 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -4994,6 +4994,118 @@
}
]
},
{
"name": "Relative Humidity Measurement",
"code": 1029,
"mfgCode": null,
"define": "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [],
"attributes": [
{
"name": "cluster revision",
"code": 65533,
"mfgCode": null,
"side": "client",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "2",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
}
]
},
{
"name": "Relative Humidity Measurement",
"code": 1029,
"mfgCode": null,
"define": "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER",
"side": "server",
"enabled": 1,
"commands": [],
"attributes": [
{
"name": "measured value",
"code": 0,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "min measured value",
"code": 1,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "max measured value",
"code": 2,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "tolerance",
"code": 3,
"mfgCode": null,
"side": "server",
"included": 0,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "cluster revision",
"code": 65533,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "2",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
}
]
},
{
"name": "IAS Zone",
"code": 1280,
Expand Down Expand Up @@ -10118,6 +10230,118 @@
}
]
},
{
"name": "Relative Humidity Measurement",
"code": 1029,
"mfgCode": null,
"define": "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [],
"attributes": [
{
"name": "cluster revision",
"code": 65533,
"mfgCode": null,
"side": "client",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "2",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
}
]
},
{
"name": "Relative Humidity Measurement",
"code": 1029,
"mfgCode": null,
"define": "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER",
"side": "server",
"enabled": 1,
"commands": [],
"attributes": [
{
"name": "measured value",
"code": 0,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "min measured value",
"code": 1,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "max measured value",
"code": 2,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "tolerance",
"code": 3,
"mfgCode": null,
"side": "server",
"included": 0,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "cluster revision",
"code": 65533,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "2",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
}
]
},
{
"name": "IAS Zone",
"code": 1280,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ EmberAfStatus emberAfOccupancySensingClusterServerCommandParse(EmberAfClusterCom
EmberAfStatus emberAfOnOffClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfOperationalCredentialsClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfPumpConfigurationAndControlClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfRelativeHumidityMeasurementClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfScenesClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfSoftwareDiagnosticsClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfSwitchClusterServerCommandParse(EmberAfClusterCommand * cmd);
Expand Down Expand Up @@ -226,6 +227,10 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd)
// No commands are enabled for cluster Pump Configuration and Control
result = status(false, true, cmd->mfgSpecific);
break;
case ZCL_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER_ID:
// No commands are enabled for cluster Relative Humidity Measurement
result = status(false, true, cmd->mfgSpecific);
break;
case ZCL_SCENES_CLUSTER_ID:
result = emberAfScenesClusterServerCommandParse(cmd);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId)
case ZCL_PUMP_CONFIG_CONTROL_CLUSTER_ID:
emberAfPumpConfigurationAndControlClusterInitCallback(endpoint);
break;
case ZCL_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER_ID:
emberAfRelativeHumidityMeasurementClusterInitCallback(endpoint);
break;
case ZCL_SCENES_CLUSTER_ID:
emberAfScenesClusterInitCallback(endpoint);
break;
Expand Down Expand Up @@ -330,6 +333,11 @@ void __attribute__((weak)) emberAfPumpConfigurationAndControlClusterInitCallback
// To prevent warning
(void) endpoint;
}
void __attribute__((weak)) emberAfRelativeHumidityMeasurementClusterInitCallback(EndpointId endpoint)
{
// To prevent warning
(void) endpoint;
}
void __attribute__((weak)) emberAfScenesClusterInitCallback(EndpointId endpoint)
{
// To prevent warning
Expand Down
81 changes: 81 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 @@ -296,6 +296,14 @@ void emberAfOperationalCredentialsClusterInitCallback(chip::EndpointId endpoint)
*/
void emberAfPumpConfigurationAndControlClusterInitCallback(chip::EndpointId endpoint);

/** @brief Relative Humidity Measurement Cluster Init
*
* Cluster Init
*
* @param endpoint Endpoint that is being initialized
*/
void emberAfRelativeHumidityMeasurementClusterInitCallback(chip::EndpointId endpoint);

/** @brief Scenes Cluster Init
*
* Cluster Init
Expand Down Expand Up @@ -2659,6 +2667,79 @@ EmberAfStatus emberAfPumpConfigurationAndControlClusterServerPreAttributeChanged
*/
void emberAfPumpConfigurationAndControlClusterServerTickCallback(chip::EndpointId endpoint);

//
// Relative Humidity Measurement Cluster server
//

/** @brief Relative Humidity Measurement Cluster Server Init
*
* Server Init
*
* @param endpoint Endpoint that is being initialized
*/
void emberAfRelativeHumidityMeasurementClusterServerInitCallback(chip::EndpointId endpoint);

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

/** @brief Relative Humidity Measurement 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 emberAfRelativeHumidityMeasurementClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint,
chip::AttributeId attributeId,
uint16_t manufacturerCode);

/** @brief Relative Humidity Measurement Cluster Server Message Sent
*
* Server Message Sent
*
* @param type The type of message sent
* @param destination The destination 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 emberAfRelativeHumidityMeasurementClusterServerMessageSentCallback(EmberOutgoingMessageType type,
chip::MessageSendDestination destination,
EmberApsFrame * apsFrame, uint16_t msgLen,
uint8_t * message, EmberStatus status);

/** @brief Relative Humidity Measurement 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 emberAfRelativeHumidityMeasurementClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint,
chip::AttributeId attributeId,
EmberAfAttributeType attributeType,
uint16_t size, uint8_t * value);

/** @brief Relative Humidity Measurement Cluster Server Tick
*
* server Tick
*
* @param endpoint Endpoint that is being served
*/
void emberAfRelativeHumidityMeasurementClusterServerTickCallback(chip::EndpointId endpoint);

//
// Scenes Cluster server
//
Expand Down
Loading

0 comments on commit 8b3ada5

Please sign in to comment.