diff --git a/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp b/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp index 759d13c5028d26..a067aaeff5edca 100644 --- a/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp +++ b/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp @@ -16,3 +16,999 @@ */ // THIS FILE IS GENERATED BY ZAP + +#include "gen/CHIPClientCallbacks.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::chip; +using namespace ::chip::app::List; + +constexpr uint16_t kByteSpanSizeLengthInBytes = 2; + +#define CHECK_STATUS(error) \ + if (CHIP_NO_ERROR != error) \ + { \ + ChipLogError(Zcl, "CHECK_STATUS %s", ErrorStr(error)); \ + if (onFailureCallback != nullptr) \ + { \ + Callback::Callback * cb = \ + Callback::Callback::FromCancelable(onFailureCallback); \ + cb->mCall(cb->mContext, static_cast(EMBER_ZCL_STATUS_INVALID_VALUE)); \ + } \ + return true; \ + } + +#define CHECK_MESSAGE_LENGTH(value) \ + if (!chip::CanCastTo(value)) \ + { \ + ChipLogError(Zcl, "CHECK_MESSAGE_LENGTH expects a uint16_t value, got: %d", value); \ + if (onFailureCallback != nullptr) \ + { \ + Callback::Callback * cb = \ + Callback::Callback::FromCancelable(onFailureCallback); \ + cb->mCall(cb->mContext, static_cast(EMBER_ZCL_STATUS_INVALID_VALUE)); \ + } \ + return true; \ + } \ + \ + if (messageLen < value) \ + { \ + ChipLogError(Zcl, "Unexpected response length: %d", messageLen); \ + if (onFailureCallback != nullptr) \ + { \ + Callback::Callback * cb = \ + Callback::Callback::FromCancelable(onFailureCallback); \ + cb->mCall(cb->mContext, static_cast(EMBER_ZCL_STATUS_INVALID_VALUE)); \ + } \ + return true; \ + } \ + \ + messageLen = static_cast(messageLen - static_cast(value)); + +#define GET_RESPONSE_CALLBACKS(name) \ + Callback::Cancelable * onSuccessCallback = nullptr; \ + Callback::Cancelable * onFailureCallback = nullptr; \ + NodeId sourceId = emberAfCurrentCommand()->SourceNodeId(); \ + uint8_t sequenceNumber = emberAfCurrentCommand()->seqNum; \ + CHIP_ERROR err = gCallbacks.GetResponseCallback(sourceId, sequenceNumber, &onSuccessCallback, &onFailureCallback); \ + \ + if (CHIP_NO_ERROR != err) \ + { \ + if (onSuccessCallback == nullptr) \ + { \ + ChipLogDetail(Zcl, "%s: Missing success callback", name); \ + } \ + \ + if (onFailureCallback == nullptr) \ + { \ + ChipLogDetail(Zcl, "%s: Missing failure callback", name); \ + } \ + \ + return true; \ + } + +#define GET_CLUSTER_RESPONSE_CALLBACKS(name) \ + Callback::Cancelable * onSuccessCallback = nullptr; \ + Callback::Cancelable * onFailureCallback = nullptr; \ + NodeId sourceIdentifier = reinterpret_cast(commandObj); \ + /* #6559: Currently, we only have one commands for the IMInvokeCommands and to a device, so the seqNum is always set to 0. */ \ + CHIP_ERROR err = gCallbacks.GetResponseCallback(sourceIdentifier, 0, &onSuccessCallback, &onFailureCallback); \ + \ + if (CHIP_NO_ERROR != err) \ + { \ + if (onSuccessCallback == nullptr) \ + { \ + ChipLogDetail(Zcl, "%s: Missing success callback", name); \ + } \ + \ + if (onFailureCallback == nullptr) \ + { \ + ChipLogDetail(Zcl, "%s: Missing failure callback", name); \ + } \ + \ + return true; \ + } + +#define GET_REPORT_CALLBACK(name) \ + Callback::Cancelable * onReportCallback = nullptr; \ + CHIP_ERROR err = gCallbacks.GetReportCallback(sourceId, endpointId, clusterId, attributeId, &onReportCallback); \ + \ + if (CHIP_NO_ERROR != err) \ + { \ + if (onReportCallback == nullptr) \ + { \ + ChipLogDetail(Zcl, "%s: Missing report callback", name); \ + } \ + \ + return true; \ + } + +void LogStatus(uint8_t status) +{ + switch (status) + { + case EMBER_ZCL_STATUS_SUCCESS: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_SUCCESS (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_FAILURE: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_FAILURE (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_NOT_AUTHORIZED: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_NOT_AUTHORIZED (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_MALFORMED_COMMAND: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_MALFORMED_COMMAND (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_UNSUP_COMMAND: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_UNSUP_CLUSTER_COMMAND (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_UNSUP_GENERAL_COMMAND: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_UNSUP_GENERAL_COMMAND (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_UNSUP_MANUF_CLUSTER_COMMAND: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_UNSUP_MANUF_CLUSTER_COMMAND (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_UNSUP_MANUF_GENERAL_COMMAND: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_UNSUP_MANUF_GENERAL_COMMAND (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_INVALID_FIELD: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_INVALID_FIELD (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_INVALID_VALUE: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_INVALID_VALUE (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_READ_ONLY: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_READ_ONLY (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_INSUFFICIENT_SPACE: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_INSUFFICIENT_SPACE (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_DUPLICATE_EXISTS: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_DUPLICATE_EXISTS (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_NOT_FOUND: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_NOT_FOUND (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_UNREPORTABLE_ATTRIBUTE: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_UNREPORTABLE_ATTRIBUTE (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_INVALID_DATA_TYPE: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_INVALID_DATA_TYPE (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_INVALID_SELECTOR: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_INVALID_SELECTOR (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_WRITE_ONLY: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_WRITE_ONLY (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_INCONSISTENT_STARTUP_STATE: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_INCONSISTENT_STARTUP_STATE (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_DEFINED_OUT_OF_BAND: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_DEFINED_OUT_Of_BAND (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_ACTION_DENIED: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_ACTION_DENIED (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_TIMEOUT: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_TIMEOUT (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_ABORT: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_ABORT (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_INVALID_IMAGE: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_INVALID_IMAGE (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_WAIT_FOR_DATA: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_WAIT_FOR_DATA (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_NO_IMAGE_AVAILABLE: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_NO_IMAGE_AVAILABLE (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_REQUIRE_MORE_IMAGE: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_REQUIRE_MORE_IMAGE (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_HARDWARE_FAILURE: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_HARDWARE_FAILURE (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_SOFTWARE_FAILURE: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_SOFTWARE_FAILURE (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER (0x%02x)", status); + break; + case EMBER_ZCL_STATUS_LIMIT_REACHED: + ChipLogProgress(Zcl, " status: EMBER_ZCL_STATUS_LIMIT_REACHED (0x%02x)", status); + break; + default: + ChipLogError(Zcl, "Unknow status: 0x%02x", status); + break; + } +} + +void LogStringAttribute(const uint8_t * string, const uint16_t length, const bool isAscii) +{ + if (isAscii) + { + ChipLogProgress(Zcl, " value: %.*s", length, string); + return; + } + + constexpr size_t kByteInHexLength = 3; // 2 hex digits + space + char buffer[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE] = " value: "; + char * bufferPos = buffer + strlen(buffer); + char * const bufferEnd = buffer + CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE; + + for (uint16_t i = 0; i < length && bufferPos + kByteInHexLength < bufferEnd; i++, bufferPos += kByteInHexLength) + { + snprintf(bufferPos, static_cast(bufferEnd - bufferPos), "%02X ", string[i]); + } + + ChipLogProgress(Zcl, "%s", buffer); +} + +// Singleton instance of the callbacks manager +app::CHIPDeviceCallbacksMgr & gCallbacks = app::CHIPDeviceCallbacksMgr::GetInstance(); + +bool emberAfDefaultResponseCallback(ClusterId clusterId, CommandId commandId, EmberAfStatus status) +{ + ChipLogProgress(Zcl, "DefaultResponse:"); + ChipLogProgress(Zcl, " ClusterId: 0x%04x", clusterId); + ChipLogProgress(Zcl, " CommandId: 0x%02x", commandId); + LogStatus(status); + + GET_RESPONSE_CALLBACKS("emberAfDefaultResponseCallback"); + if (status == EMBER_ZCL_STATUS_SUCCESS) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext); + } + else + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, static_cast(status)); + } + + return true; +} + +bool IMDefaultResponseCallback(const chip::app::Command * commandObj, EmberAfStatus status) +{ + ChipLogProgress(Zcl, "DefaultResponse:"); + ChipLogProgress(Zcl, " Transaction: %p", commandObj); + LogStatus(status); + + GET_CLUSTER_RESPONSE_CALLBACKS("emberAfDefaultResponseCallback"); + if (status == EMBER_ZCL_STATUS_SUCCESS) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext); + } + else + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, static_cast(status)); + } + + return true; +} + +bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * message, uint16_t messageLen) +{ + ChipLogProgress(Zcl, "ReadAttributesResponse:"); + ChipLogProgress(Zcl, " ClusterId: 0x%04x", clusterId); + + GET_RESPONSE_CALLBACKS("emberAfReadAttributesResponseCallback"); + + // struct readAttributeResponseRecord[] + while (messageLen) + { + CHECK_MESSAGE_LENGTH(2); + uint16_t attributeId = chip::Encoding::LittleEndian::Read16(message); // attribId + ChipLogProgress(Zcl, " attributeId: 0x%04x", attributeId); + + CHECK_MESSAGE_LENGTH(1); + uint8_t status = chip::Encoding::Read8(message); // zclStatus + LogStatus(status); + + if (status == EMBER_ZCL_STATUS_SUCCESS) + { + CHECK_MESSAGE_LENGTH(1); + uint8_t attributeType = chip::Encoding::Read8(message); + ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + + switch (attributeType) + { + case 0x00: // nodata / No data + case 0x0A: // data24 / 24-bit data + case 0x0C: // data40 / 40-bit data + case 0x0D: // data48 / 48-bit data + case 0x0E: // data56 / 56-bit data + case 0x1A: // map24 / 24-bit bitmap + case 0x1C: // map40 / 40-bit bitmap + case 0x1D: // map48 / 48-bit bitmap + case 0x1E: // map56 / 56-bit bitmap + case 0x22: // uint24 / Unsigned 24-bit integer + case 0x24: // uint40 / Unsigned 40-bit integer + case 0x25: // uint48 / Unsigned 48-bit integer + case 0x26: // uint56 / Unsigned 56-bit integer + case 0x2A: // int24 / Signed 24-bit integer + case 0x2C: // int40 / Signed 40-bit integer + case 0x2D: // int48 / Signed 48-bit integer + case 0x2E: // int56 / Signed 56-bit integer + case 0x38: // semi / Semi-precision + case 0x39: // single / Single precision + case 0x3A: // double / Double precision + case 0x49: // struct / Structure + case 0x50: // set / Set + case 0x51: // bag / Bag + case 0xE0: // ToD / Time of day + { + ChipLogError(Zcl, "attributeType 0x%02x is not supported", attributeType); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + return true; + } + + case 0x41: // octstr / Octet string + case 0x42: // string / Character string + { + // Short Strings must contains at least one byte for the length + CHECK_MESSAGE_LENGTH(1); + uint8_t length = chip::Encoding::Read8(message); + + // When the length is set to 0xFF, it represents a non-value. In this case the data field is zero length. + if (length == 0xFF) + { + length = 0; + } + + CHECK_MESSAGE_LENGTH(length); + LogStringAttribute(message, length, attributeType == 0x42); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, chip::ByteSpan(message, length)); + break; + } + + case 0x43: // octstr16 / Long octet string + case 0x44: // string16 / Long character string + { + // Long Strings must contains at least two bytes for the length + CHECK_MESSAGE_LENGTH(2); + uint16_t length = chip::Encoding::LittleEndian::Read16(message); + + // When the length is set to 0xFFFF, it represents a non-value. In this case the data field is zero length. + if (length == 0xFFFF) + { + length = 0; + } + + CHECK_MESSAGE_LENGTH(length); + LogStringAttribute(message, length, attributeType == 0x44); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, chip::ByteSpan(message, length)); + break; + } + case 0x48: // array / Array + { + CHECK_MESSAGE_LENGTH(2); + uint16_t count = chip::Encoding::LittleEndian::Read16(message); + ChipLogProgress(Zcl, " count: %lu", count); + + switch (clusterId) + { + } + break; + } + + case 0x08: // data8 / 8-bit data + case 0x18: // map8 / 8-bit bitmap + case 0x20: // uint8 / Unsigned 8-bit integer + case 0x30: // enum8 / 8-bit enumeration + { + CHECK_MESSAGE_LENGTH(1); + uint8_t value = chip::Encoding::Read8(message); + ChipLogProgress(Zcl, " value: 0x%02x", value); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, value); + break; + } + + case 0x09: // data16 / 16-bit data + case 0x19: // map16 / 16-bit bitmap + case 0x21: // uint16 / Unsigned 16-bit integer + case 0x31: // enum16 / 16-bit enumeration + case 0xE8: // clusterId / Cluster ID + case 0xE9: // attribId / Attribute ID + case 0xEA: // bacOID / BACnet OID + case 0xF1: // key128 / 128-bit security key + case 0xFF: // unk / Unknown + { + CHECK_MESSAGE_LENGTH(2); + uint16_t value = chip::Encoding::LittleEndian::Read16(message); + ChipLogProgress(Zcl, " value: 0x%04x", value); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, value); + break; + } + + case 0x0B: // data32 / 32-bit data + case 0x1B: // map32 / 32-bit bitmap + case 0x23: // uint32 / Unsigned 32-bit integer + case 0xE1: // date / Date + case 0xE2: // UTC / UTCTime + { + CHECK_MESSAGE_LENGTH(4); + uint32_t value = chip::Encoding::LittleEndian::Read32(message); + ChipLogProgress(Zcl, " value: 0x%08x", value); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, value); + break; + } + + case 0x0F: // data64 / 64-bit data + case 0x1F: // map64 / 64-bit bitmap + case 0x27: // uint64 / Unsigned 64-bit integer + case 0xF0: // EUI64 / IEEE address + { + CHECK_MESSAGE_LENGTH(8); + uint64_t value = chip::Encoding::LittleEndian::Read64(message); + ChipLogProgress(Zcl, " value: 0x%16x", value); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, value); + break; + } + + case 0x10: // bool / Boolean + { + CHECK_MESSAGE_LENGTH(1); + uint8_t value = chip::Encoding::Read8(message); + ChipLogProgress(Zcl, " value: %d", value); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, value); + break; + } + + case 0x28: // int8 / Signed 8-bit integer + { + CHECK_MESSAGE_LENGTH(1); + int8_t value = chip::CastToSigned(chip::Encoding::Read8(message)); + ChipLogProgress(Zcl, " value: %" PRId8, value); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, value); + break; + } + + case 0x29: // int16 / Signed 16-bit integer + { + CHECK_MESSAGE_LENGTH(2); + int16_t value = chip::CastToSigned(chip::Encoding::LittleEndian::Read16(message)); + ChipLogProgress(Zcl, " value: %" PRId16, value); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, value); + break; + } + + case 0x2B: // int32 / Signed 32-bit integer + { + CHECK_MESSAGE_LENGTH(4); + int32_t value = chip::CastToSigned(chip::Encoding::LittleEndian::Read32(message)); + ChipLogProgress(Zcl, " value: %" PRId32, value); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, value); + break; + } + + case 0x2F: // int64 / Signed 64-bit integer + { + CHECK_MESSAGE_LENGTH(8); + int64_t value = chip::CastToSigned(chip::Encoding::LittleEndian::Read64(message)); + ChipLogProgress(Zcl, " value: %" PRId64, value); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, value); + break; + } + } + } + else + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, status); + } + + // The current code is written matching the current API where there is a single attribute read + // per read command. So if multiple attributes are read at the same time, something is wrong + // somewhere. + if (messageLen) + { + ChipLogError(Zcl, "Multiple attributes read at the same time. Something went wrong."); + break; + } + } + + return true; +} + +bool emberAfWriteAttributesResponseCallback(ClusterId clusterId, uint8_t * message, uint16_t messageLen) +{ + ChipLogProgress(Zcl, "WriteAttributesResponse:"); + ChipLogProgress(Zcl, " ClusterId: 0x%04x", clusterId); + + GET_RESPONSE_CALLBACKS("emberAfWriteAttributesResponseCallback"); + + // struct writeAttributeResponseRecord[] + while (messageLen) + { + CHECK_MESSAGE_LENGTH(1); + uint8_t status = chip::Encoding::Read8(message); // zclStatus + LogStatus(status); + + if (status == EMBER_ZCL_STATUS_SUCCESS) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext); + } + else + { + CHECK_MESSAGE_LENGTH(2); + uint16_t attributeId = chip::Encoding::LittleEndian::Read16(message); // attribId + ChipLogProgress(Zcl, " attributeId: 0x%04x", attributeId); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, status); + } + + // The current code is written matching the current API where there is a single attribute written + // per write command. So if multiple attributes are written at the same time, something is wrong + // somewhere. + if (messageLen) + { + ChipLogError(Zcl, "Multiple attributes written at the same time. Something went wrong."); + break; + } + } + + return true; +} + +bool emberAfConfigureReportingResponseCallback(ClusterId clusterId, uint8_t * message, uint16_t messageLen) +{ + ChipLogProgress(Zcl, "ConfigureReportingResponseCallback:"); + ChipLogProgress(Zcl, " ClusterId: 0x%04x", clusterId); + + GET_RESPONSE_CALLBACKS("emberAfConfigureReportingResponseCallback"); + + // struct configureReportingResponseRecord[] + while (messageLen) + { + CHECK_MESSAGE_LENGTH(1); + uint8_t status = chip::Encoding::Read8(message); // zclStatus + LogStatus(status); + + if (status == EMBER_ZCL_STATUS_SUCCESS) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext); + } + else + { + CHECK_MESSAGE_LENGTH(1); + uint8_t direction = chip::Encoding::Read8(message); // reportingRole + ChipLogProgress(Zcl, " direction: 0x%02x", direction); + + CHECK_MESSAGE_LENGTH(2); + uint16_t attributeId = chip::Encoding::LittleEndian::Read16(message); // attribId + ChipLogProgress(Zcl, " attributeId: 0x%04x", attributeId); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, status); + } + + // The current code is written matching the current API where there is a single attribute report + // per configure command. So if multiple attributes are configured at the same time, something is wrong + // somewhere. + if (messageLen) + { + ChipLogError(Zcl, "Multiple attributes reports configured at the same time. Something went wrong."); + break; + } + } + + return true; +} + +bool emberAfReadReportingConfigurationResponseCallback(chip::ClusterId clusterId, uint8_t * message, uint16_t messageLen) +{ + ChipLogProgress(Zcl, "ReadReportingConfigurationResponse:"); + ChipLogProgress(Zcl, " ClusterId: 0x%04x", clusterId); + + GET_RESPONSE_CALLBACKS("emberAfReadReportingConfigurationResponseCallback"); + + // struct readReportingConfigurationResponseRecord[] + while (messageLen) + { + CHECK_MESSAGE_LENGTH(1); + uint8_t direction = chip::Encoding::Read8(message); // reportingRole + ChipLogProgress(Zcl, " direction: 0x%02x", direction); + + CHECK_MESSAGE_LENGTH(2); + uint16_t attributeId = chip::Encoding::LittleEndian::Read16(message); // attribId + ChipLogProgress(Zcl, " attributeId: 0x%04x", attributeId); + + if (direction == EMBER_ZCL_REPORTING_DIRECTION_REPORTED) + { + CHECK_MESSAGE_LENGTH(1); + uint8_t attributeType = chip::Encoding::Read8(message); // zclType + ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + + CHECK_MESSAGE_LENGTH(2); + uint16_t minimumReportingInterval = chip::Encoding::LittleEndian::Read16(message); // uint16 + ChipLogProgress(Zcl, " minimumReportingInterval: %" PRIu16, minimumReportingInterval); + + CHECK_MESSAGE_LENGTH(2); + uint16_t maximumReportingInterval = chip::Encoding::LittleEndian::Read16(message); // uint16 + ChipLogProgress(Zcl, " maximumReportingInterval: %" PRIu16, maximumReportingInterval); + + // FIXME: unk is not supported yet. + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, minimumReportingInterval, maximumReportingInterval); + } + else + { + CHECK_MESSAGE_LENGTH(2); + uint16_t timeout = chip::Encoding::LittleEndian::Read16(message); // uint16 + ChipLogProgress(Zcl, " timeout: %" PRIu16, timeout); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, timeout); + } + } + + return true; +} + +bool emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * message, uint16_t messageLen, + bool extended) +{ + ChipLogProgress(Zcl, "DiscoverAttributesResponse:"); + ChipLogProgress(Zcl, " ClusterId: 0x%04x", clusterId); + ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); + ChipLogProgress(Zcl, " extended: %d", extended); + + GET_RESPONSE_CALLBACKS("emberAfDiscoverAttributesCallback"); + + // struct discoverAttributesResponseRecord[] + while (messageLen) + { + CHECK_MESSAGE_LENGTH(2); + uint16_t attributeId = chip::Encoding::LittleEndian::Read16(message); // attribId + ChipLogProgress(Zcl, " attributeId: 0x%04x", attributeId); + + CHECK_MESSAGE_LENGTH(1); + uint8_t attributeType = chip::Encoding::Read8(message); // zclType + ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + } + + Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext); + return true; +} + +bool emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, + CommandId * commandIds, uint16_t commandIdCount) +{ + ChipLogProgress(Zcl, "DiscoverCommandsGeneratedResponse:"); + ChipLogProgress(Zcl, " ClusterId: 0x%04x", clusterId); + ChipLogProgress(Zcl, " manufacturerCode: 0x%04x", manufacturerCode); + ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); + ChipLogProgress(Zcl, " commandIdCount: %" PRIu16, commandIdCount); + + for (uint16_t i = 0; i < commandIdCount; i++) + { + ChipLogProgress(Zcl, " commandId: 0x%02x", commandIds++); + } + + GET_RESPONSE_CALLBACKS("emberAfDiscoverCommandsGeneratedResponseCallback"); + Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext); + return true; +} + +bool emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete, + CommandId * commandIds, uint16_t commandIdCount) +{ + ChipLogProgress(Zcl, "DiscoverCommandsReceivedResponse:"); + ChipLogProgress(Zcl, " ClusterId: 0x%04x", clusterId); + ChipLogProgress(Zcl, " manufacturerCode: 0x%04x", manufacturerCode); + ChipLogProgress(Zcl, " discoveryComplete: %d", discoveryComplete); + ChipLogProgress(Zcl, " commandIdCount: %" PRIu16, commandIdCount); + + for (uint16_t i = 0; i < commandIdCount; i++) + { + ChipLogProgress(Zcl, " commandId: 0x%02x", commandIds++); + } + + GET_RESPONSE_CALLBACKS("emberAfDiscoverCommandsGeneratedResponseCallback"); + Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext); + return true; +} + +bool emberAfReportAttributesCallback(ClusterId clusterId, uint8_t * message, uint16_t messageLen) +{ + ChipLogProgress(Zcl, "emberAfReportAttributeCallback:"); + ChipLogProgress(Zcl, " ClusterId: 0x%04x", clusterId); + + NodeId sourceId = emberAfCurrentCommand()->SourceNodeId(); + ChipLogProgress(Zcl, " Source NodeId: %" PRIu64, sourceId); + + EndpointId endpointId = emberAfCurrentCommand()->apsFrame->sourceEndpoint; + ChipLogProgress(Zcl, " Source EndpointId: 0x%04x", endpointId); + + // TODO onFailureCallback is just here because of the CHECK_MESSAGE_LENGTH macro. It needs to be removed. + Callback::Cancelable * onFailureCallback = nullptr; + + while (messageLen) + { + CHECK_MESSAGE_LENGTH(2); + uint16_t attributeId = chip::Encoding::LittleEndian::Read16(message); // attribId + ChipLogProgress(Zcl, " attributeId: 0x%04x", attributeId); + + GET_REPORT_CALLBACK("emberAfReportAttributesCallback"); + + CHECK_MESSAGE_LENGTH(1); + uint8_t attributeType = chip::Encoding::Read8(message); + ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + + switch (attributeType) + { + case 0x00: // nodata / No data + case 0x0A: // data24 / 24-bit data + case 0x0C: // data40 / 40-bit data + case 0x0D: // data48 / 48-bit data + case 0x0E: // data56 / 56-bit data + case 0x1A: // map24 / 24-bit bitmap + case 0x1C: // map40 / 40-bit bitmap + case 0x1D: // map48 / 48-bit bitmap + case 0x1E: // map56 / 56-bit bitmap + case 0x22: // uint24 / Unsigned 24-bit integer + case 0x24: // uint40 / Unsigned 40-bit integer + case 0x25: // uint48 / Unsigned 48-bit integer + case 0x26: // uint56 / Unsigned 56-bit integer + case 0x2A: // int24 / Signed 24-bit integer + case 0x2C: // int40 / Signed 40-bit integer + case 0x2D: // int48 / Signed 48-bit integer + case 0x2E: // int56 / Signed 56-bit integer + case 0x38: // semi / Semi-precision + case 0x39: // single / Single precision + case 0x3A: // double / Double precision + case 0x48: // array / Array + case 0x49: // struct / Structure + case 0x50: // set / Set + case 0x51: // bag / Bag + case 0xE0: // ToD / Time of day + { + ChipLogError(Zcl, "attributeType 0x%02x is not supported", attributeType); + return true; + } + + case 0x41: // octstr / Octet string + case 0x42: // string / Character string + { + // Short Strings must contains at least one byte for the length + CHECK_MESSAGE_LENGTH(1); + uint8_t length = chip::Encoding::Read8(message); + ChipLogProgress(Zcl, " length: 0x%02x", length); + + // When the length is set to 0xFF, it represents a non-value. In this case the data field is zero length. + if (length == 0xFF) + { + length = 0; + } + + CHECK_MESSAGE_LENGTH(length); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onReportCallback); + cb->mCall(cb->mContext, chip::ByteSpan(message, length)); + break; + } + + case 0x43: // octstr16 / Long octet string + case 0x44: // string16 / Long character string + { + // Long Strings must contains at least two bytes for the length + CHECK_MESSAGE_LENGTH(2); + uint16_t length = chip::Encoding::LittleEndian::Read16(message); + ChipLogProgress(Zcl, " length: 0x%02x", length); + + // When the length is set to 0xFFFF, it represents a non-value. In this case the data field is zero length. + if (length == 0xFFFF) + { + length = 0; + } + + CHECK_MESSAGE_LENGTH(length); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onReportCallback); + cb->mCall(cb->mContext, chip::ByteSpan(message, length)); + break; + } + + case 0x08: // data8 / 8-bit data + case 0x18: // map8 / 8-bit bitmap + case 0x20: // uint8 / Unsigned 8-bit integer + case 0x30: // enum8 / 8-bit enumeration + { + CHECK_MESSAGE_LENGTH(1); + uint8_t value = chip::Encoding::Read8(message); + ChipLogProgress(Zcl, " value: 0x%02x", value); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onReportCallback); + cb->mCall(cb->mContext, value); + break; + } + + case 0x09: // data16 / 16-bit data + case 0x19: // map16 / 16-bit bitmap + case 0x21: // uint16 / Unsigned 16-bit integer + case 0x31: // enum16 / 16-bit enumeration + case 0xE8: // clusterId / Cluster ID + case 0xE9: // attribId / Attribute ID + case 0xEA: // bacOID / BACnet OID + case 0xF1: // key128 / 128-bit security key + case 0xFF: // unk / Unknown + { + CHECK_MESSAGE_LENGTH(2); + uint16_t value = chip::Encoding::LittleEndian::Read16(message); + ChipLogProgress(Zcl, " value: 0x%04x", value); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onReportCallback); + cb->mCall(cb->mContext, value); + break; + } + + case 0x0B: // data32 / 32-bit data + case 0x1B: // map32 / 32-bit bitmap + case 0x23: // uint32 / Unsigned 32-bit integer + case 0xE1: // date / Date + case 0xE2: // UTC / UTCTime + { + CHECK_MESSAGE_LENGTH(4); + uint32_t value = chip::Encoding::LittleEndian::Read32(message); + ChipLogProgress(Zcl, " value: 0x%08x", value); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onReportCallback); + cb->mCall(cb->mContext, value); + break; + } + + case 0x0F: // data64 / 64-bit data + case 0x1F: // map64 / 64-bit bitmap + case 0x27: // uint64 / Unsigned 64-bit integer + case 0xF0: // EUI64 / IEEE address + { + CHECK_MESSAGE_LENGTH(8); + uint64_t value = chip::Encoding::LittleEndian::Read64(message); + ChipLogProgress(Zcl, " value: 0x%16x", value); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onReportCallback); + cb->mCall(cb->mContext, value); + break; + } + + case 0x10: // bool / Boolean + { + CHECK_MESSAGE_LENGTH(1); + uint8_t value = chip::Encoding::Read8(message); + ChipLogProgress(Zcl, " value: %d", value); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onReportCallback); + cb->mCall(cb->mContext, value); + break; + } + + case 0x28: // int8 / Signed 8-bit integer + { + CHECK_MESSAGE_LENGTH(1); + int8_t value = chip::CastToSigned(chip::Encoding::Read8(message)); + ChipLogProgress(Zcl, " value: %" PRId8, value); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onReportCallback); + cb->mCall(cb->mContext, value); + break; + } + + case 0x29: // int16 / Signed 16-bit integer + { + CHECK_MESSAGE_LENGTH(2); + int16_t value = chip::CastToSigned(chip::Encoding::LittleEndian::Read16(message)); + ChipLogProgress(Zcl, " value: %" PRId16, value); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onReportCallback); + cb->mCall(cb->mContext, value); + break; + } + + case 0x2B: // int32 / Signed 32-bit integer + { + CHECK_MESSAGE_LENGTH(4); + int32_t value = chip::CastToSigned(chip::Encoding::LittleEndian::Read32(message)); + ChipLogProgress(Zcl, " value: %" PRId32, value); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onReportCallback); + cb->mCall(cb->mContext, value); + break; + } + + case 0x2F: // int64 / Signed 64-bit integer + { + CHECK_MESSAGE_LENGTH(8); + int64_t value = chip::CastToSigned(chip::Encoding::LittleEndian::Read64(message)); + ChipLogProgress(Zcl, " value: %" PRId64, value); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onReportCallback); + cb->mCall(cb->mContext, value); + break; + } + } + } + + return true; +} diff --git a/examples/pump-app/pump-common/gen/CHIPClientCallbacks.h b/examples/pump-app/pump-common/gen/CHIPClientCallbacks.h index 302d36ce5d8076..dfbf602efc90f0 100644 --- a/examples/pump-app/pump-common/gen/CHIPClientCallbacks.h +++ b/examples/pump-app/pump-common/gen/CHIPClientCallbacks.h @@ -17,4 +17,35 @@ // THIS FILE IS GENERATED BY ZAP +#pragma once + +#include +#include +#include +#include +#include + +// Note: The IMDefaultResponseCallback is a bridge to the old CallbackMgr before IM is landed, so it still accepts EmberAfStatus +// instead of IM status code. +// #6308 should handle IM error code on the application side, either modify this function or remove this. +bool IMDefaultResponseCallback(const chip::app::Command * commandObj, EmberAfStatus status); + +// Global Response Callbacks +typedef void (*DefaultSuccessCallback)(void * context); +typedef void (*DefaultFailureCallback)(void * context, uint8_t status); +typedef void (*BooleanAttributeCallback)(void * context, bool value); +typedef void (*Int8uAttributeCallback)(void * context, uint8_t value); +typedef void (*Int8sAttributeCallback)(void * context, int8_t value); +typedef void (*Int16uAttributeCallback)(void * context, uint16_t value); +typedef void (*Int16sAttributeCallback)(void * context, int16_t value); +typedef void (*Int32uAttributeCallback)(void * context, uint32_t value); +typedef void (*Int32sAttributeCallback)(void * context, int32_t value); +typedef void (*Int64uAttributeCallback)(void * context, uint64_t value); +typedef void (*Int64sAttributeCallback)(void * context, int64_t value); +typedef void (*StringAttributeCallback)(void * context, const chip::ByteSpan value); +typedef void (*ReadReportingConfigurationReportedCallback)(void * context, uint16_t minInterval, uint16_t maxInterval); +typedef void (*ReadReportingConfigurationReceivedCallback)(void * context, uint16_t timeout); + +// Cluster Specific Response Callbacks + // List specific responses diff --git a/examples/pump-app/pump-common/gen/CHIPClusters.cpp b/examples/pump-app/pump-common/gen/CHIPClusters.cpp index 58bc84801b4b97..f68bfe4d2d3f01 100644 --- a/examples/pump-app/pump-common/gen/CHIPClusters.cpp +++ b/examples/pump-app/pump-common/gen/CHIPClusters.cpp @@ -30,5 +30,62 @@ namespace Controller { // TODO(#4503): length should be passed to commands when byte string is in argument list. // TODO(#4503): Commands should take group id as an argument. +// TemperatureMeasurement Cluster Commands +// TemperatureMeasurement Cluster Attributes +CHIP_ERROR TemperatureMeasurementCluster::DiscoverAttributes(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTemperatureMeasurementClusterDiscoverAttributes(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} +CHIP_ERROR TemperatureMeasurementCluster::ReadAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTemperatureMeasurementClusterReadMeasuredValueAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TemperatureMeasurementCluster::ConfigureAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + uint16_t minInterval, uint16_t maxInterval, + int16_t change) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = + encodeTemperatureMeasurementClusterConfigureMeasuredValueAttribute(seqNum, mEndpoint, minInterval, maxInterval, change); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TemperatureMeasurementCluster::ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback) +{ + return RequestAttributeReporting(0x0000, onReportCallback); +} + +CHIP_ERROR TemperatureMeasurementCluster::ReadAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTemperatureMeasurementClusterReadMinMeasuredValueAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TemperatureMeasurementCluster::ReadAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTemperatureMeasurementClusterReadMaxMeasuredValueAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TemperatureMeasurementCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTemperatureMeasurementClusterReadClusterRevisionAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + } // namespace Controller } // namespace chip diff --git a/examples/pump-app/pump-common/gen/CHIPClusters.h b/examples/pump-app/pump-common/gen/CHIPClusters.h index 759d13c5028d26..cfef8ab2156ec2 100644 --- a/examples/pump-app/pump-common/gen/CHIPClusters.h +++ b/examples/pump-app/pump-common/gen/CHIPClusters.h @@ -16,3 +16,35 @@ */ // THIS FILE IS GENERATED BY ZAP + +// Prevent multiple inclusion +#pragma once + +#include +#include +#include + +namespace chip { +namespace Controller { + +constexpr ClusterId kTemperatureMeasurementClusterId = 0x0402; + +class DLL_EXPORT TemperatureMeasurementCluster : public ClusterBase +{ +public: + TemperatureMeasurementCluster() : ClusterBase(kTemperatureMeasurementClusterId) {} + ~TemperatureMeasurementCluster() {} + + // Cluster Attributes + CHIP_ERROR DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ConfigureAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t minInterval, uint16_t maxInterval, int16_t change); + CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); +}; + +} // namespace Controller +} // namespace chip diff --git a/examples/pump-app/pump-common/gen/IMClusterCommandHandler.cpp b/examples/pump-app/pump-common/gen/IMClusterCommandHandler.cpp index c80e004e8d1fc9..9cee0f28699f5c 100644 --- a/examples/pump-app/pump-common/gen/IMClusterCommandHandler.cpp +++ b/examples/pump-app/pump-common/gen/IMClusterCommandHandler.cpp @@ -39,29 +39,477 @@ namespace app { namespace clusters { +namespace Basic { + +void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +{ + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + // The following variables are used for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; + uint32_t validArgumentCount = 0; + uint32_t expectArgumentCount = 0; + uint32_t currentDecodeTagId = 0; + bool wasHandled = false; + { + switch (aCommandId) + { + default: { + // Unrecognized command ID, error status will apply. + chip::app::CommandPathParams returnStatusParam = { aEndpointId, + 0, // GroupId + ZCL_BASIC_CLUSTER_ID, aCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + apCommandObj->AddStatusCode(&returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_BASIC_CLUSTER_ID); + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) + { + chip::app::CommandPathParams returnStatusParam = { aEndpointId, + 0, // GroupId + ZCL_BASIC_CLUSTER_ID, aCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + apCommandObj->AddStatusCode(&returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogProgress(Zcl, + "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32 + " (last decoded tag = %" PRIu32, + validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + } +} + +} // namespace Basic + namespace GeneralCommissioning { -void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandId) - { - case ZCL_ARM_FAIL_SAFE_COMMAND_ID: { - expectArgumentCount = 3; - uint16_t expiryLengthSeconds; - uint64_t breadcrumb; - uint32_t timeoutMs; - bool argExists[3]; +void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +{ + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + // The following variables are used for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; + uint32_t validArgumentCount = 0; + uint32_t expectArgumentCount = 0; + uint32_t currentDecodeTagId = 0; + bool wasHandled = false; + { + switch (aCommandId) + { + case ZCL_ARM_FAIL_SAFE_COMMAND_ID: { + expectArgumentCount = 3; + uint16_t expiryLengthSeconds; + uint64_t breadcrumb; + uint32_t timeoutMs; + bool argExists[3]; + + memset(argExists, 0, sizeof argExists); + + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) + { + // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. + // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. + if (!TLV::IsContextTag(aDataTlv.GetTag())) + { + continue; + } + currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); + if (currentDecodeTagId < 3) + { + if (argExists[currentDecodeTagId]) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + else + { + argExists[currentDecodeTagId] = true; + validArgumentCount++; + } + } + switch (currentDecodeTagId) + { + case 0: + TLVUnpackError = aDataTlv.Get(expiryLengthSeconds); + break; + case 1: + TLVUnpackError = aDataTlv.Get(breadcrumb); + break; + case 2: + TLVUnpackError = aDataTlv.Get(timeoutMs); + break; + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (CHIP_NO_ERROR != TLVUnpackError) + { + break; + } + } + + if (CHIP_END_OF_TLV == TLVError) + { + // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. + TLVError = CHIP_NO_ERROR; + } + + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) + { + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + wasHandled = + emberAfGeneralCommissioningClusterArmFailSafeCallback(apCommandObj, expiryLengthSeconds, breadcrumb, timeoutMs); + } + break; + } + case ZCL_COMMISSIONING_COMPLETE_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(apCommandObj); + break; + } + case ZCL_SET_REGULATORY_CONFIG_COMMAND_ID: { + expectArgumentCount = 4; + uint8_t location; + const uint8_t * countryCode; + uint64_t breadcrumb; + uint32_t timeoutMs; + bool argExists[4]; + + memset(argExists, 0, sizeof argExists); + + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) + { + // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. + // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. + if (!TLV::IsContextTag(aDataTlv.GetTag())) + { + continue; + } + currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); + if (currentDecodeTagId < 4) + { + if (argExists[currentDecodeTagId]) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + else + { + argExists[currentDecodeTagId] = true; + validArgumentCount++; + } + } + switch (currentDecodeTagId) + { + case 0: + TLVUnpackError = aDataTlv.Get(location); + break; + case 1: + // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. + TLVUnpackError = aDataTlv.GetDataPtr(countryCode); + break; + case 2: + TLVUnpackError = aDataTlv.Get(breadcrumb); + break; + case 3: + TLVUnpackError = aDataTlv.Get(timeoutMs); + break; + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (CHIP_NO_ERROR != TLVUnpackError) + { + break; + } + } + + if (CHIP_END_OF_TLV == TLVError) + { + // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. + TLVError = CHIP_NO_ERROR; + } + + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) + { + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + wasHandled = emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback( + apCommandObj, location, const_cast(countryCode), breadcrumb, timeoutMs); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + chip::app::CommandPathParams returnStatusParam = { aEndpointId, + 0, // GroupId + ZCL_GENERAL_COMMISSIONING_CLUSTER_ID, aCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + apCommandObj->AddStatusCode(&returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_GENERAL_COMMISSIONING_CLUSTER_ID); + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) + { + chip::app::CommandPathParams returnStatusParam = { aEndpointId, + 0, // GroupId + ZCL_GENERAL_COMMISSIONING_CLUSTER_ID, aCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + apCommandObj->AddStatusCode(&returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogProgress(Zcl, + "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32 + " (last decoded tag = %" PRIu32, + validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + } +} + +} // namespace GeneralCommissioning + +namespace LevelControl { + +void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +{ + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + // The following variables are used for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; + uint32_t validArgumentCount = 0; + uint32_t expectArgumentCount = 0; + uint32_t currentDecodeTagId = 0; + bool wasHandled = false; + { + switch (aCommandId) + { + case ZCL_MOVE_COMMAND_ID: { + expectArgumentCount = 4; + uint8_t moveMode; + uint8_t rate; + uint8_t optionMask; + uint8_t optionOverride; + bool argExists[4]; + + memset(argExists, 0, sizeof argExists); + + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) + { + // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. + // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. + if (!TLV::IsContextTag(aDataTlv.GetTag())) + { + continue; + } + currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); + if (currentDecodeTagId < 4) + { + if (argExists[currentDecodeTagId]) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + else + { + argExists[currentDecodeTagId] = true; + validArgumentCount++; + } + } + switch (currentDecodeTagId) + { + case 0: + TLVUnpackError = aDataTlv.Get(moveMode); + break; + case 1: + TLVUnpackError = aDataTlv.Get(rate); + break; + case 2: + TLVUnpackError = aDataTlv.Get(optionMask); + break; + case 3: + TLVUnpackError = aDataTlv.Get(optionOverride); + break; + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (CHIP_NO_ERROR != TLVUnpackError) + { + break; + } + } + + if (CHIP_END_OF_TLV == TLVError) + { + // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. + TLVError = CHIP_NO_ERROR; + } + + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) + { + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + wasHandled = emberAfLevelControlClusterMoveCallback(apCommandObj, moveMode, rate, optionMask, optionOverride); + } + break; + } + case ZCL_MOVE_TO_LEVEL_COMMAND_ID: { + expectArgumentCount = 4; + uint8_t level; + uint16_t transitionTime; + uint8_t optionMask; + uint8_t optionOverride; + bool argExists[4]; + + memset(argExists, 0, sizeof argExists); + + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) + { + // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. + // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. + if (!TLV::IsContextTag(aDataTlv.GetTag())) + { + continue; + } + currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); + if (currentDecodeTagId < 4) + { + if (argExists[currentDecodeTagId]) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + else + { + argExists[currentDecodeTagId] = true; + validArgumentCount++; + } + } + switch (currentDecodeTagId) + { + case 0: + TLVUnpackError = aDataTlv.Get(level); + break; + case 1: + TLVUnpackError = aDataTlv.Get(transitionTime); + break; + case 2: + TLVUnpackError = aDataTlv.Get(optionMask); + break; + case 3: + TLVUnpackError = aDataTlv.Get(optionOverride); + break; + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (CHIP_NO_ERROR != TLVUnpackError) + { + break; + } + } + + if (CHIP_END_OF_TLV == TLVError) + { + // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. + TLVError = CHIP_NO_ERROR; + } + + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) + { + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + wasHandled = + emberAfLevelControlClusterMoveToLevelCallback(apCommandObj, level, transitionTime, optionMask, optionOverride); + } + break; + } + case ZCL_MOVE_TO_LEVEL_WITH_ON_OFF_COMMAND_ID: { + expectArgumentCount = 2; + uint8_t level; + uint16_t transitionTime; + bool argExists[2]; + + memset(argExists, 0, sizeof argExists); + + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) + { + // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. + // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. + if (!TLV::IsContextTag(aDataTlv.GetTag())) + { + continue; + } + currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); + if (currentDecodeTagId < 2) + { + if (argExists[currentDecodeTagId]) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + else + { + argExists[currentDecodeTagId] = true; + validArgumentCount++; + } + } + switch (currentDecodeTagId) + { + case 0: + TLVUnpackError = aDataTlv.Get(level); + break; + case 1: + TLVUnpackError = aDataTlv.Get(transitionTime); + break; + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (CHIP_NO_ERROR != TLVUnpackError) + { + break; + } + } + + if (CHIP_END_OF_TLV == TLVError) + { + // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. + TLVError = CHIP_NO_ERROR; + } + + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) + { + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + wasHandled = emberAfLevelControlClusterMoveToLevelWithOnOffCallback(apCommandObj, level, transitionTime); + } + break; + } + case ZCL_MOVE_WITH_ON_OFF_COMMAND_ID: { + expectArgumentCount = 2; + uint8_t moveMode; + uint8_t rate; + bool argExists[2]; memset(argExists, 0, sizeof argExists); @@ -74,7 +522,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En continue; } currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 3) + if (currentDecodeTagId < 2) { if (argExists[currentDecodeTagId]) { @@ -91,13 +539,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (currentDecodeTagId) { case 0: - TLVUnpackError = aDataTlv.Get(expiryLengthSeconds); + TLVUnpackError = aDataTlv.Get(moveMode); break; case 1: - TLVUnpackError = aDataTlv.Get(breadcrumb); - break; - case 2: - TLVUnpackError = aDataTlv.Get(timeoutMs); + TLVUnpackError = aDataTlv.Get(rate); break; default: // Unsupported tag, ignore it. @@ -116,27 +561,95 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En TLVError = CHIP_NO_ERROR; } - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = - emberAfGeneralCommissioningClusterArmFailSafeCallback(apCommandObj, expiryLengthSeconds, breadcrumb, timeoutMs); + wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(apCommandObj, moveMode, rate); } break; } - case ZCL_COMMISSIONING_COMPLETE_COMMAND_ID: { + case ZCL_STEP_COMMAND_ID: { + expectArgumentCount = 5; + uint8_t stepMode; + uint8_t stepSize; + uint16_t transitionTime; + uint8_t optionMask; + uint8_t optionOverride; + bool argExists[5]; - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(apCommandObj); + memset(argExists, 0, sizeof argExists); + + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) + { + // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. + // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. + if (!TLV::IsContextTag(aDataTlv.GetTag())) + { + continue; + } + currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); + if (currentDecodeTagId < 5) + { + if (argExists[currentDecodeTagId]) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + else + { + argExists[currentDecodeTagId] = true; + validArgumentCount++; + } + } + switch (currentDecodeTagId) + { + case 0: + TLVUnpackError = aDataTlv.Get(stepMode); + break; + case 1: + TLVUnpackError = aDataTlv.Get(stepSize); + break; + case 2: + TLVUnpackError = aDataTlv.Get(transitionTime); + break; + case 3: + TLVUnpackError = aDataTlv.Get(optionMask); + break; + case 4: + TLVUnpackError = aDataTlv.Get(optionOverride); + break; + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (CHIP_NO_ERROR != TLVUnpackError) + { + break; + } + } + + if (CHIP_END_OF_TLV == TLVError) + { + // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. + TLVError = CHIP_NO_ERROR; + } + + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) + { + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + wasHandled = emberAfLevelControlClusterStepCallback(apCommandObj, stepMode, stepSize, transitionTime, optionMask, + optionOverride); + } break; } - case ZCL_SET_REGULATORY_CONFIG_COMMAND_ID: { - expectArgumentCount = 4; - uint8_t location; - const uint8_t * countryCode; - uint64_t breadcrumb; - uint32_t timeoutMs; - bool argExists[4]; + case ZCL_STEP_WITH_ON_OFF_COMMAND_ID: { + expectArgumentCount = 3; + uint8_t stepMode; + uint8_t stepSize; + uint16_t transitionTime; + bool argExists[3]; memset(argExists, 0, sizeof argExists); @@ -149,7 +662,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En continue; } currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 4) + if (currentDecodeTagId < 3) { if (argExists[currentDecodeTagId]) { @@ -166,17 +679,76 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (currentDecodeTagId) { case 0: - TLVUnpackError = aDataTlv.Get(location); + TLVUnpackError = aDataTlv.Get(stepMode); break; case 1: - // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. - TLVUnpackError = aDataTlv.GetDataPtr(countryCode); + TLVUnpackError = aDataTlv.Get(stepSize); break; case 2: - TLVUnpackError = aDataTlv.Get(breadcrumb); + TLVUnpackError = aDataTlv.Get(transitionTime); break; - case 3: - TLVUnpackError = aDataTlv.Get(timeoutMs); + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (CHIP_NO_ERROR != TLVUnpackError) + { + break; + } + } + + if (CHIP_END_OF_TLV == TLVError) + { + // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. + TLVError = CHIP_NO_ERROR; + } + + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) + { + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + wasHandled = emberAfLevelControlClusterStepWithOnOffCallback(apCommandObj, stepMode, stepSize, transitionTime); + } + break; + } + case ZCL_STOP_COMMAND_ID: { + expectArgumentCount = 2; + uint8_t optionMask; + uint8_t optionOverride; + bool argExists[2]; + + memset(argExists, 0, sizeof argExists); + + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) + { + // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. + // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. + if (!TLV::IsContextTag(aDataTlv.GetTag())) + { + continue; + } + currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); + if (currentDecodeTagId < 2) + { + if (argExists[currentDecodeTagId]) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + else + { + argExists[currentDecodeTagId] = true; + validArgumentCount++; + } + } + switch (currentDecodeTagId) + { + case 0: + TLVUnpackError = aDataTlv.Get(optionMask); + break; + case 1: + TLVUnpackError = aDataTlv.Get(optionOverride); break; default: // Unsupported tag, ignore it. @@ -195,23 +767,28 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En TLVError = CHIP_NO_ERROR; } - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback( - apCommandObj, location, const_cast(countryCode), breadcrumb, timeoutMs); + wasHandled = emberAfLevelControlClusterStopCallback(apCommandObj, optionMask, optionOverride); } break; } + case ZCL_STOP_WITH_ON_OFF_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + wasHandled = emberAfLevelControlClusterStopWithOnOffCallback(apCommandObj); + break; + } default: { // Unrecognized command ID, error status will apply. chip::app::CommandPathParams returnStatusParam = { aEndpointId, 0, // GroupId - ZCL_GENERAL_COMMISSIONING_CLUSTER_ID, aCommandId, + ZCL_LEVEL_CONTROL_CLUSTER_ID, aCommandId, (chip::app::CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(&returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_GENERAL_COMMISSIONING_CLUSTER_ID); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_LEVEL_CONTROL_CLUSTER_ID); return; } } @@ -221,7 +798,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En { chip::app::CommandPathParams returnStatusParam = { aEndpointId, 0, // GroupId - ZCL_GENERAL_COMMISSIONING_CLUSTER_ID, aCommandId, + ZCL_LEVEL_CONTROL_CLUSTER_ID, aCommandId, (chip::app::CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(&returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); @@ -232,7 +809,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } } -} // namespace GeneralCommissioning +} // namespace LevelControl namespace NetworkCommissioning { @@ -542,65 +1119,6 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } break; } - case ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID: { - expectArgumentCount = 1; - uint32_t timeoutMs; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(timeoutMs); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(apCommandObj, timeoutMs); - } - break; - } case ZCL_REMOVE_NETWORK_COMMAND_ID: { expectArgumentCount = 3; chip::ByteSpan NetworkID; @@ -1563,9 +2081,15 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) { + case ZCL_BASIC_CLUSTER_ID: + clusters::Basic::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + break; case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID: clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; + case ZCL_LEVEL_CONTROL_CLUSTER_ID: + clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + break; case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; diff --git a/examples/pump-app/pump-common/gen/call-command-handler.cpp b/examples/pump-app/pump-common/gen/call-command-handler.cpp index b6b77cdcdf9a8b..95aa429c85ef53 100644 --- a/examples/pump-app/pump-common/gen/call-command-handler.cpp +++ b/examples/pump-app/pump-common/gen/call-command-handler.cpp @@ -32,13 +32,17 @@ EmberAfStatus emberAfBasicClusterServerCommandParse(EmberAfClusterCommand * cmd) EmberAfStatus emberAfEthernetNetworkDiagnosticsClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfGeneralCommissioningClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfGeneralDiagnosticsClusterServerCommandParse(EmberAfClusterCommand * cmd); +EmberAfStatus emberAfLevelControlClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfNetworkCommissioningClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfOnOffClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfOperationalCredentialsClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfPumpConfigurationAndControlClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfSoftwareDiagnosticsClusterServerCommandParse(EmberAfClusterCommand * cmd); +EmberAfStatus emberAfTemperatureMeasurementClusterClientCommandParse(EmberAfClusterCommand * cmd); +EmberAfStatus emberAfTemperatureMeasurementClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfThreadNetworkDiagnosticsClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfTrustedRootCertificatesClusterServerCommandParse(EmberAfClusterCommand * cmd); +EmberAfStatus emberAfWiFiNetworkDiagnosticsClusterServerCommandParse(EmberAfClusterCommand * cmd); static EmberAfStatus status(bool wasHandled, bool clusterExists, bool mfgSpecific) { @@ -69,6 +73,10 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) { switch (cmd->apsFrame->clusterId) { + case ZCL_TEMP_MEASUREMENT_CLUSTER_ID: + // No commands are enabled for cluster Temperature Measurement + result = status(false, true, cmd->mfgSpecific); + break; default: // Unrecognized cluster ID, error status will apply. break; @@ -80,8 +88,7 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) switch (cmd->apsFrame->clusterId) { case ZCL_BASIC_CLUSTER_ID: - // No commands are enabled for cluster Basic - result = status(false, true, cmd->mfgSpecific); + result = emberAfBasicClusterServerCommandParse(cmd); break; case ZCL_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_ID: // No commands are enabled for cluster Ethernet Network Diagnostics @@ -94,6 +101,9 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) // No commands are enabled for cluster General Diagnostics result = status(false, true, cmd->mfgSpecific); break; + case ZCL_LEVEL_CONTROL_CLUSTER_ID: + result = emberAfLevelControlClusterServerCommandParse(cmd); + break; case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: result = emberAfNetworkCommissioningClusterServerCommandParse(cmd); break; @@ -111,6 +121,10 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) // No commands are enabled for cluster Software Diagnostics result = status(false, true, cmd->mfgSpecific); break; + case ZCL_TEMP_MEASUREMENT_CLUSTER_ID: + // No commands are enabled for cluster Temperature Measurement + result = status(false, true, cmd->mfgSpecific); + break; case ZCL_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_ID: // No commands are enabled for cluster Thread Network Diagnostics result = status(false, true, cmd->mfgSpecific); @@ -118,6 +132,10 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) case ZCL_TRUSTED_ROOT_CERTIFICATES_CLUSTER_ID: result = emberAfTrustedRootCertificatesClusterServerCommandParse(cmd); break; + case ZCL_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_ID: + // No commands are enabled for cluster WiFi Network Diagnostics + result = status(false, true, cmd->mfgSpecific); + break; default: // Unrecognized cluster ID, error status will apply. break; @@ -128,6 +146,29 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) // Cluster specific command parsing +EmberAfStatus emberAfBasicClusterServerCommandParse(EmberAfClusterCommand * cmd) +{ + bool wasHandled = false; + + if (cmd->mfgSpecific) + { + if (cmd->mfgCode == 4098 && cmd->commandId == ZCL_MFG_SPECIFIC_PING_COMMAND_ID) + { + wasHandled = emberAfBasicClusterMfgSpecificPingCallback(nullptr); + } + } + else + { + switch (cmd->commandId) + { + default: { + // Unrecognized command ID, error status will apply. + break; + } + } + } + return status(wasHandled, true, cmd->mfgSpecific); +} EmberAfStatus emberAfGeneralCommissioningClusterServerCommandParse(EmberAfClusterCommand * cmd) { bool wasHandled = false; @@ -210,6 +251,223 @@ EmberAfStatus emberAfGeneralCommissioningClusterServerCommandParse(EmberAfCluste } return status(wasHandled, true, cmd->mfgSpecific); } +EmberAfStatus emberAfLevelControlClusterServerCommandParse(EmberAfClusterCommand * cmd) +{ + bool wasHandled = false; + + if (!cmd->mfgSpecific) + { + switch (cmd->commandId) + { + case ZCL_MOVE_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint8_t moveMode; + uint8_t rate; + uint8_t optionMask; + uint8_t optionOverride; + + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + moveMode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + rate = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + optionMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + optionOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + + wasHandled = emberAfLevelControlClusterMoveCallback(nullptr, moveMode, rate, optionMask, optionOverride); + break; + } + case ZCL_MOVE_TO_LEVEL_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint8_t level; + uint16_t transitionTime; + uint8_t optionMask; + uint8_t optionOverride; + + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + level = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 2) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + transitionTime = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 2); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + optionMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + optionOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + + wasHandled = emberAfLevelControlClusterMoveToLevelCallback(nullptr, level, transitionTime, optionMask, optionOverride); + break; + } + case ZCL_MOVE_TO_LEVEL_WITH_ON_OFF_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint8_t level; + uint16_t transitionTime; + + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + level = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 2) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + transitionTime = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); + + wasHandled = emberAfLevelControlClusterMoveToLevelWithOnOffCallback(nullptr, level, transitionTime); + break; + } + case ZCL_MOVE_WITH_ON_OFF_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint8_t moveMode; + uint8_t rate; + + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + moveMode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + rate = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + + wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(nullptr, moveMode, rate); + break; + } + case ZCL_STEP_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint8_t stepMode; + uint8_t stepSize; + uint16_t transitionTime; + uint8_t optionMask; + uint8_t optionOverride; + + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + stepMode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + stepSize = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 2) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + transitionTime = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 2); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + optionMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + optionOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + + wasHandled = + emberAfLevelControlClusterStepCallback(nullptr, stepMode, stepSize, transitionTime, optionMask, optionOverride); + break; + } + case ZCL_STEP_WITH_ON_OFF_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint8_t stepMode; + uint8_t stepSize; + uint16_t transitionTime; + + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + stepMode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + stepSize = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 2) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + transitionTime = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); + + wasHandled = emberAfLevelControlClusterStepWithOnOffCallback(nullptr, stepMode, stepSize, transitionTime); + break; + } + case ZCL_STOP_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint8_t optionMask; + uint8_t optionOverride; + + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + optionMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + optionOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + + wasHandled = emberAfLevelControlClusterStopCallback(nullptr, optionMask, optionOverride); + break; + } + case ZCL_STOP_WITH_ON_OFF_COMMAND_ID: { + wasHandled = emberAfLevelControlClusterStopWithOnOffCallback(nullptr); + break; + } + default: { + // Unrecognized command ID, error status will apply. + break; + } + } + } + return status(wasHandled, true, cmd->mfgSpecific); +} EmberAfStatus emberAfNetworkCommissioningClusterServerCommandParse(EmberAfClusterCommand * cmd) { bool wasHandled = false; @@ -350,19 +608,6 @@ EmberAfStatus emberAfNetworkCommissioningClusterServerCommandParse(EmberAfCluste wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback(nullptr, networkID, breadcrumb, timeoutMs); break; } - case ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint32_t timeoutMs; - - if (cmd->bufLen < payloadOffset + 4) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(nullptr, timeoutMs); - break; - } case ZCL_REMOVE_NETWORK_COMMAND_ID: { uint16_t payloadOffset = cmd->payloadStartIndex; chip::ByteSpan NetworkID; diff --git a/examples/pump-app/pump-common/gen/callback-stub.cpp b/examples/pump-app/pump-common/gen/callback-stub.cpp index 0b758d172855d0..4dfd10d925d23c 100644 --- a/examples/pump-app/pump-common/gen/callback-stub.cpp +++ b/examples/pump-app/pump-common/gen/callback-stub.cpp @@ -41,6 +41,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_GENERAL_DIAGNOSTICS_CLUSTER_ID: emberAfGeneralDiagnosticsClusterInitCallback(endpoint); break; + case ZCL_LEVEL_CONTROL_CLUSTER_ID: + emberAfLevelControlClusterInitCallback(endpoint); + break; case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: emberAfNetworkCommissioningClusterInitCallback(endpoint); break; @@ -56,12 +59,18 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_SOFTWARE_DIAGNOSTICS_CLUSTER_ID: emberAfSoftwareDiagnosticsClusterInitCallback(endpoint); break; + case ZCL_TEMP_MEASUREMENT_CLUSTER_ID: + emberAfTemperatureMeasurementClusterInitCallback(endpoint); + break; case ZCL_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_ID: emberAfThreadNetworkDiagnosticsClusterInitCallback(endpoint); break; case ZCL_TRUSTED_ROOT_CERTIFICATES_CLUSTER_ID: emberAfTrustedRootCertificatesClusterInitCallback(endpoint); break; + case ZCL_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_ID: + emberAfWiFiNetworkDiagnosticsClusterInitCallback(endpoint); + break; default: // Unrecognized cluster ID break; @@ -88,6 +97,11 @@ void __attribute__((weak)) emberAfGeneralDiagnosticsClusterInitCallback(Endpoint // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfLevelControlClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfNetworkCommissioningClusterInitCallback(EndpointId endpoint) { // To prevent warning @@ -113,6 +127,11 @@ void __attribute__((weak)) emberAfSoftwareDiagnosticsClusterInitCallback(Endpoin // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfTemperatureMeasurementClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfThreadNetworkDiagnosticsClusterInitCallback(EndpointId endpoint) { // To prevent warning @@ -123,6 +142,11 @@ void __attribute__((weak)) emberAfTrustedRootCertificatesClusterInitCallback(End // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfWiFiNetworkDiagnosticsClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} // // Non-Cluster Related Callbacks diff --git a/examples/pump-app/pump-common/gen/callback.h b/examples/pump-app/pump-common/gen/callback.h index 76e997021add1f..770c61b017d09c 100644 --- a/examples/pump-app/pump-common/gen/callback.h +++ b/examples/pump-app/pump-common/gen/callback.h @@ -72,6 +72,14 @@ void emberAfGeneralCommissioningClusterInitCallback(chip::EndpointId endpoint); */ void emberAfGeneralDiagnosticsClusterInitCallback(chip::EndpointId endpoint); +/** @brief Level Control Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfLevelControlClusterInitCallback(chip::EndpointId endpoint); + /** @brief Network Commissioning Cluster Init * * Cluster Init @@ -112,6 +120,14 @@ void emberAfPumpConfigurationAndControlClusterInitCallback(chip::EndpointId endp */ void emberAfSoftwareDiagnosticsClusterInitCallback(chip::EndpointId endpoint); +/** @brief Temperature Measurement Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfTemperatureMeasurementClusterInitCallback(chip::EndpointId endpoint); + /** @brief Thread Network Diagnostics Cluster Init * * Cluster Init @@ -128,6 +144,14 @@ void emberAfThreadNetworkDiagnosticsClusterInitCallback(chip::EndpointId endpoin */ void emberAfTrustedRootCertificatesClusterInitCallback(chip::EndpointId endpoint); +/** @brief WiFi Network Diagnostics Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfWiFiNetworkDiagnosticsClusterInitCallback(chip::EndpointId endpoint); + // Cluster Server/Client Init Functions // @@ -413,6 +437,76 @@ EmberAfStatus emberAfGeneralDiagnosticsClusterServerPreAttributeChangedCallback( */ void emberAfGeneralDiagnosticsClusterServerTickCallback(chip::EndpointId endpoint); +// +// Level Control Cluster server +// + +/** @brief Level Control Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfLevelControlClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Level Control Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + */ +void emberAfLevelControlClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); + +/** @brief Level Control 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 emberAfLevelControlClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); + +/** @brief Level Control 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 emberAfLevelControlClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); + +/** @brief Level Control 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 emberAfLevelControlClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint16_t size, + uint8_t * value); + +/** @brief Level Control Cluster Server Tick + * + * server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfLevelControlClusterServerTickCallback(chip::EndpointId endpoint); + // // Network Commissioning Cluster server // @@ -768,6 +862,150 @@ EmberAfStatus emberAfSoftwareDiagnosticsClusterServerPreAttributeChangedCallback */ void emberAfSoftwareDiagnosticsClusterServerTickCallback(chip::EndpointId endpoint); +// +// Temperature Measurement Cluster client +// + +/** @brief Temperature Measurement Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfTemperatureMeasurementClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief Temperature Measurement Cluster Client Attribute Changed + * + * Client Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + */ +void emberAfTemperatureMeasurementClusterClientAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); + +/** @brief Temperature Measurement Cluster Client Manufacturer Specific Attribute Changed + * + * Client 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 emberAfTemperatureMeasurementClusterClientManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); + +/** @brief Temperature Measurement Cluster Client Message Sent + * + * Client 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 emberAfTemperatureMeasurementClusterClientMessageSentCallback(EmberOutgoingMessageType type, + chip::MessageSendDestination destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); + +/** @brief Temperature Measurement Cluster Client Pre Attribute Changed + * + * client 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 emberAfTemperatureMeasurementClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + EmberAfAttributeType attributeType, + uint16_t size, uint8_t * value); + +/** @brief Temperature Measurement Cluster Client Tick + * + * client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfTemperatureMeasurementClusterClientTickCallback(chip::EndpointId endpoint); + +// +// Temperature Measurement Cluster server +// + +/** @brief Temperature Measurement Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfTemperatureMeasurementClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Temperature Measurement Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + */ +void emberAfTemperatureMeasurementClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); + +/** @brief Temperature 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 emberAfTemperatureMeasurementClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); + +/** @brief Temperature 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 emberAfTemperatureMeasurementClusterServerMessageSentCallback(EmberOutgoingMessageType type, + chip::MessageSendDestination destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); + +/** @brief Temperature 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 emberAfTemperatureMeasurementClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + EmberAfAttributeType attributeType, + uint16_t size, uint8_t * value); + +/** @brief Temperature Measurement Cluster Server Tick + * + * server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfTemperatureMeasurementClusterServerTickCallback(chip::EndpointId endpoint); + // // Thread Network Diagnostics Cluster server // @@ -912,8 +1150,86 @@ EmberAfStatus emberAfTrustedRootCertificatesClusterServerPreAttributeChangedCall */ void emberAfTrustedRootCertificatesClusterServerTickCallback(chip::EndpointId endpoint); +// +// WiFi Network Diagnostics Cluster server +// + +/** @brief WiFi Network Diagnostics Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfWiFiNetworkDiagnosticsClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief WiFi Network Diagnostics Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + */ +void emberAfWiFiNetworkDiagnosticsClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); + +/** @brief WiFi Network Diagnostics 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 emberAfWiFiNetworkDiagnosticsClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); + +/** @brief WiFi Network Diagnostics 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 emberAfWiFiNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, + chip::MessageSendDestination destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); + +/** @brief WiFi Network Diagnostics 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 emberAfWiFiNetworkDiagnosticsClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + EmberAfAttributeType attributeType, + uint16_t size, uint8_t * value); + +/** @brief WiFi Network Diagnostics Cluster Server Tick + * + * server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfWiFiNetworkDiagnosticsClusterServerTickCallback(chip::EndpointId endpoint); + // Cluster Commands Callback +/** + * @brief Basic Cluster MfgSpecificPing Command callback + */ + +bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::Command * commandObj); + /** * @brief General Commissioning Cluster ArmFailSafe Command callback */ @@ -934,6 +1250,59 @@ bool emberAfGeneralCommissioningClusterCommissioningCompleteCallback(chip::app:: bool emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback(chip::app::Command * commandObj, uint8_t location, uint8_t * countryCode, uint64_t breadcrumb, uint32_t timeoutMs); +/** + * @brief Level Control Cluster Move Command callback + */ + +bool emberAfLevelControlClusterMoveCallback(chip::app::Command * commandObj, uint8_t moveMode, uint8_t rate, uint8_t optionMask, + uint8_t optionOverride); + +/** + * @brief Level Control Cluster MoveToLevel Command callback + */ + +bool emberAfLevelControlClusterMoveToLevelCallback(chip::app::Command * commandObj, uint8_t level, uint16_t transitionTime, + uint8_t optionMask, uint8_t optionOverride); + +/** + * @brief Level Control Cluster MoveToLevelWithOnOff Command callback + */ + +bool emberAfLevelControlClusterMoveToLevelWithOnOffCallback(chip::app::Command * commandObj, uint8_t level, + uint16_t transitionTime); + +/** + * @brief Level Control Cluster MoveWithOnOff Command callback + */ + +bool emberAfLevelControlClusterMoveWithOnOffCallback(chip::app::Command * commandObj, uint8_t moveMode, uint8_t rate); + +/** + * @brief Level Control Cluster Step Command callback + */ + +bool emberAfLevelControlClusterStepCallback(chip::app::Command * commandObj, uint8_t stepMode, uint8_t stepSize, + uint16_t transitionTime, uint8_t optionMask, uint8_t optionOverride); + +/** + * @brief Level Control Cluster StepWithOnOff Command callback + */ + +bool emberAfLevelControlClusterStepWithOnOffCallback(chip::app::Command * commandObj, uint8_t stepMode, uint8_t stepSize, + uint16_t transitionTime); + +/** + * @brief Level Control Cluster Stop Command callback + */ + +bool emberAfLevelControlClusterStopCallback(chip::app::Command * commandObj, uint8_t optionMask, uint8_t optionOverride); + +/** + * @brief Level Control Cluster StopWithOnOff Command callback + */ + +bool emberAfLevelControlClusterStopWithOnOffCallback(chip::app::Command * commandObj); + /** * @brief Network Commissioning Cluster AddThreadNetwork Command callback */ @@ -962,13 +1331,6 @@ bool emberAfNetworkCommissioningClusterDisableNetworkCallback(chip::app::Command bool emberAfNetworkCommissioningClusterEnableNetworkCallback(chip::app::Command * commandObj, chip::ByteSpan networkID, uint64_t breadcrumb, uint32_t timeoutMs); -/** - * @brief Network Commissioning Cluster GetLastNetworkCommissioningResult Command callback - */ - -bool emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(chip::app::Command * commandObj, - uint32_t timeoutMs); - /** * @brief Network Commissioning Cluster RemoveNetwork Command callback */ diff --git a/examples/pump-app/pump-common/gen/chip-zcl-zpro-codec-api.h b/examples/pump-app/pump-common/gen/chip-zcl-zpro-codec-api.h index 759d13c5028d26..e782a488aeeaf7 100644 --- a/examples/pump-app/pump-common/gen/chip-zcl-zpro-codec-api.h +++ b/examples/pump-app/pump-common/gen/chip-zcl-zpro-codec-api.h @@ -16,3 +16,87 @@ */ // THIS FILE IS GENERATED BY ZAP + +// Prevent multiple inclusion +#pragma once + +#include +#include +#include +#include + +/*----------------------------------------------------------------------------*\ +| Cluster Name | ID | +|---------------------------------------------------------------------+--------| +| Basic | 0x0028 | +| EthernetNetworkDiagnostics | 0x0037 | +| GeneralCommissioning | 0x0030 | +| GeneralDiagnostics | 0x0033 | +| LevelControl | 0x0008 | +| NetworkCommissioning | 0x0031 | +| OnOff | 0x0006 | +| OperationalCredentials | 0x003E | +| PumpConfigurationAndControl | 0x0200 | +| SoftwareDiagnostics | 0x0034 | +| TemperatureMeasurement | 0x0402 | +| TemperatureMeasurement | 0x0402 | +| ThreadNetworkDiagnostics | 0x0035 | +| TrustedRootCertificates | 0x003F | +| WiFiNetworkDiagnostics | 0x0036 | +\*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*\ +| Cluster TemperatureMeasurement | 0x0402 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MeasuredValue | 0x0000 | +| * MinMeasuredValue | 0x0001 | +| * MaxMeasuredValue | 0x0002 | +| * ClusterRevision | 0xFFFD | +\*----------------------------------------------------------------------------*/ + +/** + * @brief + * Encode a Temperature Measurement server discover command into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTemperatureMeasurementClusterDiscoverAttributes(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Temperature Measurement server read command for the measured value attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle +encodeTemperatureMeasurementClusterReadMeasuredValueAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Temperature Measurement server configure report command for the measured value attribute into buffer including the + * APS frame + */ +chip::System::PacketBufferHandle +encodeTemperatureMeasurementClusterConfigureMeasuredValueAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, + uint16_t minInterval, uint16_t maxInterval, int16_t change); + +/** + * @brief + * Encode a Temperature Measurement server read command for the min measured value attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle +encodeTemperatureMeasurementClusterReadMinMeasuredValueAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Temperature Measurement server read command for the max measured value attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle +encodeTemperatureMeasurementClusterReadMaxMeasuredValueAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Temperature Measurement server read command for the cluster revision attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle +encodeTemperatureMeasurementClusterReadClusterRevisionAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); diff --git a/examples/pump-app/pump-common/gen/encoder.cpp b/examples/pump-app/pump-common/gen/encoder.cpp index 759d13c5028d26..3c166b25cb7a25 100644 --- a/examples/pump-app/pump-common/gen/encoder.cpp +++ b/examples/pump-app/pump-common/gen/encoder.cpp @@ -16,3 +16,174 @@ */ // THIS FILE IS GENERATED BY ZAP + +#include + +#include +#include +#include + +#include +#include + +using namespace chip; +using namespace chip::System; +using namespace chip::Encoding::LittleEndian; + +#define COMMAND_HEADER(name, clusterId) \ + const char * kName = name; \ + \ + PacketBufferWriter buf(System::PacketBufferHandle::New(kMaxBufferSize)); \ + if (buf.IsNull()) \ + { \ + ChipLogError(Zcl, "Could not allocate packet buffer while trying to encode %s command", kName); \ + return PacketBufferHandle(); \ + } \ + \ + if (doEncodeApsFrame(buf, clusterId, kSourceEndpoint, destinationEndpoint, 0, 0, 0, 0, false)) \ + { + +#define COMMAND_FOOTER() \ + } \ + if (!buf.Fit()) \ + { \ + ChipLogError(Zcl, "Command %s can't fit in the allocated buffer", kName); \ + } \ + return buf.Finalize(); + +/*----------------------------------------------------------------------------*\ +| Cluster Name | ID | +|---------------------------------------------------------------------+--------| +| Basic | 0x0028 | +| EthernetNetworkDiagnostics | 0x0037 | +| GeneralCommissioning | 0x0030 | +| GeneralDiagnostics | 0x0033 | +| LevelControl | 0x0008 | +| NetworkCommissioning | 0x0031 | +| OnOff | 0x0006 | +| OperationalCredentials | 0x003E | +| PumpConfigurationAndControl | 0x0200 | +| SoftwareDiagnostics | 0x0034 | +| TemperatureMeasurement | 0x0402 | +| TemperatureMeasurement | 0x0402 | +| ThreadNetworkDiagnostics | 0x0035 | +| TrustedRootCertificates | 0x003F | +| WiFiNetworkDiagnostics | 0x0036 | +\*----------------------------------------------------------------------------*/ + +#define EMBER_ZCL_REPORTING_DIRECTION_REPORTED 0x00 + +#define ZCL_READ_ATTRIBUTES_COMMAND_ID (0x00) +#define ZCL_READ_ATTRIBUTES_RESPONSE_COMMAND_ID (0x01) +#define ZCL_WRITE_ATTRIBUTES_COMMAND_ID (0x02) +#define ZCL_WRITE_ATTRIBUTES_UNDIVIDED_COMMAND_ID (0x03) +#define ZCL_WRITE_ATTRIBUTES_RESPONSE_COMMAND_ID (0x04) +#define ZCL_WRITE_ATTRIBUTES_NO_RESPONSE_COMMAND_ID (0x05) +#define ZCL_CONFIGURE_REPORTING_COMMAND_ID (0x06) +#define ZCL_CONFIGURE_REPORTING_RESPONSE_COMMAND_ID (0x07) +#define ZCL_READ_REPORTING_CONFIGURATION_COMMAND_ID (0x08) +#define ZCL_READ_REPORTING_CONFIGURATION_RESPONSE_COMMAND_ID (0x09) +#define ZCL_REPORT_ATTRIBUTES_COMMAND_ID (0x0A) +#define ZCL_DEFAULT_RESPONSE_COMMAND_ID (0x0B) +#define ZCL_DISCOVER_ATTRIBUTES_COMMAND_ID (0x0C) +#define ZCL_DISCOVER_ATTRIBUTES_RESPONSE_COMMAND_ID (0x0D) +#define ZCL_READ_ATTRIBUTES_STRUCTURED_COMMAND_ID (0x0E) +#define ZCL_WRITE_ATTRIBUTES_STRUCTURED_COMMAND_ID (0x0F) +#define ZCL_WRITE_ATTRIBUTES_STRUCTURED_RESPONSE_COMMAND_ID (0x10) +#define ZCL_DISCOVER_COMMANDS_RECEIVED_COMMAND_ID (0x11) +#define ZCL_DISCOVER_COMMANDS_RECEIVED_RESPONSE_COMMAND_ID (0x12) +#define ZCL_DISCOVER_COMMANDS_GENERATED_COMMAND_ID (0x13) +#define ZCL_DISCOVER_COMMANDS_GENERATED_RESPONSE_COMMAND_ID (0x14) +#define ZCL_DISCOVER_ATTRIBUTES_EXTENDED_COMMAND_ID (0x15) +#define ZCL_DISCOVER_ATTRIBUTES_EXTENDED_RESPONSE_COMMAND_ID (0x16) + +#define TEMP_MEASUREMENT_CLUSTER_ID 0x0402 + +// TODO: Find a way to calculate maximum message length for clusters +// https://github.com/project-chip/connectedhomeip/issues/965 +constexpr uint16_t kMaxBufferSize = 1024; + +// This is a global command, so the low bits are 0b00. The command is +// standard, so does not need a manufacturer code, and we're sending client +// to server, so all the remaining bits are 0. +constexpr uint8_t kFrameControlGlobalCommand = 0x00; + +// Pick source endpoint as 1 for now +constexpr EndpointId kSourceEndpoint = 1; + +/*----------------------------------------------------------------------------*\ +| Cluster TemperatureMeasurement | 0x0402 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MeasuredValue | 0x0000 | +| * MinMeasuredValue | 0x0001 | +| * MaxMeasuredValue | 0x0002 | +| * ClusterRevision | 0xFFFD | +\*----------------------------------------------------------------------------*/ + +PacketBufferHandle encodeTemperatureMeasurementClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("DiscoverTemperatureMeasurementAttributes", TEMP_MEASUREMENT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_DISCOVER_ATTRIBUTES_COMMAND_ID).Put16(0x0000).Put8(0xFF); + COMMAND_FOOTER(); +} + +/* + * Attribute MeasuredValue + */ +PacketBufferHandle encodeTemperatureMeasurementClusterReadMeasuredValueAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTemperatureMeasurementMeasuredValue", TEMP_MEASUREMENT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0000); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeTemperatureMeasurementClusterConfigureMeasuredValueAttribute(uint8_t seqNum, + EndpointId destinationEndpoint, + uint16_t minInterval, uint16_t maxInterval, + int16_t change) +{ + COMMAND_HEADER("ReportTemperatureMeasurementMeasuredValue", TEMP_MEASUREMENT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_CONFIGURE_REPORTING_COMMAND_ID) + .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED) + .Put16(0x0000) + .Put8(41) + .Put16(minInterval) + .Put16(maxInterval); + buf.Put16(static_cast(change)); + COMMAND_FOOTER(); +} + +/* + * Attribute MinMeasuredValue + */ +PacketBufferHandle encodeTemperatureMeasurementClusterReadMinMeasuredValueAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTemperatureMeasurementMinMeasuredValue", TEMP_MEASUREMENT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0001); + COMMAND_FOOTER(); +} + +/* + * Attribute MaxMeasuredValue + */ +PacketBufferHandle encodeTemperatureMeasurementClusterReadMaxMeasuredValueAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTemperatureMeasurementMaxMeasuredValue", TEMP_MEASUREMENT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0002); + COMMAND_FOOTER(); +} + +/* + * Attribute ClusterRevision + */ +PacketBufferHandle encodeTemperatureMeasurementClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTemperatureMeasurementClusterRevision", TEMP_MEASUREMENT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0xFFFD); + COMMAND_FOOTER(); +} diff --git a/examples/pump-app/pump-common/gen/endpoint_config.h b/examples/pump-app/pump-common/gen/endpoint_config.h index ac9cf407112a11..021f18a3fb5e99 100644 --- a/examples/pump-app/pump-common/gen/endpoint_config.h +++ b/examples/pump-app/pump-common/gen/endpoint_config.h @@ -244,26 +244,31 @@ /* 1219 - ActiveNetworkFaultsList, */ \ 0x00, 0x00, 0x00, 0x00, \ \ + /* Endpoint: 1, Cluster: WiFi Network Diagnostics (server), big-endian */ \ + \ + /* 1223 - bssid, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 1, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ \ - /* 1223 - PacketRxCount, */ \ + /* 1229 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1231 - PacketTxCount, */ \ + /* 1237 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1239 - TxErrCount, */ \ + /* 1245 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1247 - CollisionCount, */ \ + /* 1253 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1255 - OverrunCount, */ \ + /* 1261 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Operational Credentials (server), big-endian */ \ \ - /* 1263 - fabrics list, */ \ + /* 1269 - fabrics list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -501,26 +506,31 @@ /* 1219 - ActiveNetworkFaultsList, */ \ 0x00, 0x00, 0x00, 0x00, \ \ + /* Endpoint: 1, Cluster: WiFi Network Diagnostics (server), little-endian */ \ + \ + /* 1223 - bssid, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 1, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ \ - /* 1223 - PacketRxCount, */ \ + /* 1229 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1231 - PacketTxCount, */ \ + /* 1237 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1239 - TxErrCount, */ \ + /* 1245 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1247 - CollisionCount, */ \ + /* 1253 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1255 - OverrunCount, */ \ + /* 1261 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Operational Credentials (server), little-endian */ \ \ - /* 1263 - fabrics list, */ \ + /* 1269 - fabrics list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -539,7 +549,7 @@ #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (59) +#define GENERATED_DEFAULTS_COUNT (60) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -567,7 +577,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 101 +#define GENERATED_ATTRIBUTE_COUNT 114 #define GENERATED_ATTRIBUTES \ { \ \ @@ -575,6 +585,10 @@ { 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* on/off */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* cluster revision */ \ \ + /* Endpoint: 1, Cluster: Level Control (server) */ \ + { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current level */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* cluster revision */ \ + \ /* Endpoint: 1, Cluster: Basic (server) */ \ { 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* InteractionModelVersion */ \ { 0x0001, ZAP_TYPE(CHAR_STRING), 32, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(0) }, /* VendorName */ \ @@ -671,18 +685,26 @@ { 0x003C, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelMask */ \ { 0x003D, ZAP_TYPE(ARRAY), 1, 0, ZAP_EMPTY_DEFAULT() }, /* OperationalDatasetComponents */ \ { 0x003E, ZAP_TYPE(ARRAY), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1219) }, /* ActiveNetworkFaultsList */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ + \ + /* Endpoint: 1, Cluster: WiFi Network Diagnostics (server) */ \ + { 0x0000, ZAP_TYPE(OCTET_STRING), 6, 0, ZAP_LONG_DEFAULTS_INDEX(1223) }, /* bssid */ \ + { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SecurityType */ \ + { 0x0002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ + { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ + { 0x0004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: Ethernet Network Diagnostics (server) */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1223) }, /* PacketRxCount */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1231) }, /* PacketTxCount */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1239) }, /* TxErrCount */ \ - { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1247) }, /* CollisionCount */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1255) }, /* OverrunCount */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1229) }, /* PacketRxCount */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1237) }, /* PacketTxCount */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1245) }, /* TxErrCount */ \ + { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1253) }, /* CollisionCount */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1261) }, /* OverrunCount */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: Operational Credentials (server) */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1263) }, /* fabrics list */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1269) }, /* fabrics list */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: Trusted Root Certificates (server) */ \ @@ -697,6 +719,15 @@ { 0x0013, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* capacity */ \ { 0x0020, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* operation mode */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ + \ + /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ + { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* measured value */ \ + { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* min measured value */ \ + { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* max measured value */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* cluster revision */ \ + \ + /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(3) }, /* cluster revision */ \ } // This is an array of EmberAfCluster structures. @@ -707,12 +738,15 @@ const EmberAfGenericClusterFunction chipFuncArrayOnOffServer[] = { \ (EmberAfGenericClusterFunction) emberAfOnOffClusterServerInitCallback, \ }; \ + const EmberAfGenericClusterFunction chipFuncArrayLevelControlServer[] = { \ + (EmberAfGenericClusterFunction) emberAfLevelControlClusterServerInitCallback, \ + }; \ const EmberAfGenericClusterFunction chipFuncArrayBasicServer[] = { \ (EmberAfGenericClusterFunction) emberAfBasicClusterServerInitCallback, \ }; #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 11 +#define GENERATED_CLUSTER_COUNT 15 #define GENERATED_CLUSTERS \ { \ { \ @@ -723,39 +757,54 @@ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer \ }, /* Endpoint: 1, Cluster: On/off (server) */ \ - { 0x0028, \ + { 0x0008, \ ZAP_ATTRIBUTE_INDEX(2), \ + 2, \ + 3, \ + ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ + { 0x0028, \ + ZAP_ATTRIBUTE_INDEX(4), \ 12, \ 254, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayBasicServer }, /* Endpoint: 1, Cluster: Basic (server) */ \ { \ - 0x0030, ZAP_ATTRIBUTE_INDEX(14), 3, 18, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0030, ZAP_ATTRIBUTE_INDEX(16), 3, 18, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: General Commissioning (server) */ \ { \ - 0x0031, ZAP_ATTRIBUTE_INDEX(17), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0031, ZAP_ATTRIBUTE_INDEX(19), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Network Commissioning (server) */ \ { \ - 0x0033, ZAP_ATTRIBUTE_INDEX(18), 3, 258, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0033, ZAP_ATTRIBUTE_INDEX(20), 3, 258, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: General Diagnostics (server) */ \ { \ - 0x0034, ZAP_ATTRIBUTE_INDEX(21), 2, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0034, ZAP_ATTRIBUTE_INDEX(23), 2, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(23), 61, 730, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(25), 61, 730, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Thread Network Diagnostics (server) */ \ { \ - 0x0037, ZAP_ATTRIBUTE_INDEX(84), 6, 42, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0036, ZAP_ATTRIBUTE_INDEX(86), 6, 13, ZAP_CLUSTER_MASK(SERVER), NULL \ + }, /* Endpoint: 1, Cluster: WiFi Network Diagnostics (server) */ \ + { \ + 0x0037, ZAP_ATTRIBUTE_INDEX(92), 6, 42, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Ethernet Network Diagnostics (server) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(90), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(98), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Operational Credentials (server) */ \ { \ - 0x003F, ZAP_ATTRIBUTE_INDEX(92), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003F, ZAP_ATTRIBUTE_INDEX(100), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Trusted Root Certificates (server) */ \ { \ - 0x0200, ZAP_ATTRIBUTE_INDEX(93), 8, 13, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0200, ZAP_ATTRIBUTE_INDEX(101), 8, 13, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ + { \ + 0x0402, ZAP_ATTRIBUTE_INDEX(109), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ + { \ + 0x0402, ZAP_ATTRIBUTE_INDEX(113), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \ } #define ZAP_CLUSTER_INDEX(index) ((EmberAfCluster *) (&generatedClusters[index])) @@ -763,7 +812,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 11, 1588 }, \ + { ZAP_CLUSTER_INDEX(0), 15, 1614 }, \ } // Largest attribute size is needed for various buffers @@ -773,7 +822,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (254) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (1588) +#define ATTRIBUTE_MAX_SIZE (1614) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (1) @@ -788,7 +837,7 @@ // Array of profile ids #define FIXED_PROFILE_IDS \ { \ - 0x0104 \ + 0x0999 \ } // Array of device ids @@ -817,7 +866,7 @@ // Array of EmberAfCommandMetadata structs. #define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (42) +#define EMBER_AF_GENERATED_COMMAND_COUNT (52) #define GENERATED_COMMANDS \ { \ \ @@ -826,10 +875,21 @@ { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On */ \ { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Toggle */ \ \ + /* Endpoint: 1, Cluster: Level Control (server) */ \ + { 0x0008, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevel */ \ + { 0x0008, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Move */ \ + { 0x0008, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Step */ \ + { 0x0008, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Stop */ \ + { 0x0008, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevelWithOnOff */ \ + { 0x0008, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveWithOnOff */ \ + { 0x0008, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepWithOnOff */ \ + { 0x0008, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StopWithOnOff */ \ + \ /* Endpoint: 1, Cluster: Basic (server) */ \ { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* StartUp */ \ { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ShutDown */ \ { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Leave */ \ + { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MfgSpecificPing */ \ \ /* Endpoint: 1, Cluster: General Commissioning (server) */ \ { 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ArmFailSafe */ \ @@ -861,6 +921,9 @@ /* Endpoint: 1, Cluster: Software Diagnostics (server) */ \ { 0x0034, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetWatermarks */ \ \ + /* Endpoint: 1, Cluster: Thread Network Diagnostics (server) */ \ + { 0x0035, 0x00, 0 }, /* ResetCounts */ \ + \ /* Endpoint: 1, Cluster: Ethernet Network Diagnostics (server) */ \ { 0x0037, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetCounts */ \ \ @@ -881,12 +944,10 @@ } // Array of EmberAfManufacturerCodeEntry structures for commands. -#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (0) +#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (1) #define GENERATED_COMMAND_MANUFACTURER_CODES \ { \ - { \ - 0x00, 0x00 \ - } \ + { 14, 4098 }, \ } // This is an array of EmberAfManufacturerCodeEntry structures for clusters. @@ -912,20 +973,25 @@ #define ZAP_REPORT_DIRECTION(x) ZRD(x) // User options for plugin Reporting -#define EMBER_AF_PLUGIN_REPORTING_TABLE_SIZE (2) +#define EMBER_AF_PLUGIN_REPORTING_TABLE_SIZE (3) #define EMBER_AF_PLUGIN_REPORTING_ENABLE_GROUP_BOUND_REPORTS -#define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE (2) +#define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE (3) #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS \ { \ \ - /* Endpoint: 1, Cluster: On/off (server) */ \ + /* Endpoint: 1, Cluster: Level Control (server) */ \ { \ - ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0006, 0x0000, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ - }, /* on/off */ \ + ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0008, 0x0000, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ + }, /* current level */ \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ { \ ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0200, 0x0013, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ }, /* capacity */ \ + \ + /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ + { \ + ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0402, 0x0000, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ + }, /* measured value */ \ } diff --git a/examples/pump-app/pump-common/gen/gen_config.h b/examples/pump-app/pump-common/gen/gen_config.h index 1323335dab7b64..1c811361b076b4 100644 --- a/examples/pump-app/pump-common/gen/gen_config.h +++ b/examples/pump-app/pump-common/gen/gen_config.h @@ -33,13 +33,17 @@ #define EMBER_AF_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_GENERAL_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_GENERAL_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_LEVEL_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_PUMP_CONFIG_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_TRUSTED_ROOT_CERTIFICATES_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) /**** Cluster Plugins ****/ @@ -63,6 +67,15 @@ #define EMBER_AF_PLUGIN_GENERAL_DIAGNOSTICS_SERVER #define EMBER_AF_PLUGIN_GENERAL_DIAGNOSTICS +// Use this macro to check if the server side of the Level Control cluster is included +#define ZCL_USING_LEVEL_CONTROL_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_LEVEL_CONTROL_SERVER +#define EMBER_AF_PLUGIN_LEVEL_CONTROL +// User options for server plugin Level Control +#define EMBER_AF_PLUGIN_LEVEL_CONTROL_MAXIMUM_LEVEL 255 +#define EMBER_AF_PLUGIN_LEVEL_CONTROL_MINIMUM_LEVEL 0 +#define EMBER_AF_PLUGIN_LEVEL_CONTROL_RATE 0 + // Use this macro to check if the server side of the Network Commissioning cluster is included #define ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_SERVER #define EMBER_AF_PLUGIN_NETWORK_COMMISSIONING_SERVER @@ -88,6 +101,15 @@ #define EMBER_AF_PLUGIN_SOFTWARE_DIAGNOSTICS_SERVER #define EMBER_AF_PLUGIN_SOFTWARE_DIAGNOSTICS +// Use this macro to check if the client side of the Temperature Measurement cluster is included +#define ZCL_USING_TEMP_MEASUREMENT_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_TEMPERATURE_MEASUREMENT_CLIENT + +// Use this macro to check if the server side of the Temperature Measurement cluster is included +#define ZCL_USING_TEMP_MEASUREMENT_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_TEMPERATURE_MEASUREMENT_SERVER +#define EMBER_AF_PLUGIN_TEMPERATURE_MEASUREMENT + // Use this macro to check if the server side of the Thread Network Diagnostics cluster is included #define ZCL_USING_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_SERVER #define EMBER_AF_PLUGIN_THREAD_NETWORK_DIAGNOSTICS_SERVER @@ -97,3 +119,8 @@ #define ZCL_USING_TRUSTED_ROOT_CERTIFICATES_CLUSTER_SERVER #define EMBER_AF_PLUGIN_TRUSTED_ROOT_CERTIFICATES_SERVER #define EMBER_AF_PLUGIN_TRUSTED_ROOT_CERTIFICATES + +// Use this macro to check if the server side of the WiFi Network Diagnostics cluster is included +#define ZCL_USING_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_WI_FI_NETWORK_DIAGNOSTICS_SERVER +#define EMBER_AF_PLUGIN_WI_FI_NETWORK_DIAGNOSTICS diff --git a/examples/pump-app/pump-common/pump-app.zap b/examples/pump-app/pump-common/pump-app.zap index a03c7d64307e89..19d192950ed6f3 100644 --- a/examples/pump-app/pump-common/pump-app.zap +++ b/examples/pump-app/pump-common/pump-app.zap @@ -32,159 +32,10 @@ "endpointTypes": [ { "name": "Anonymous Endpoint Type", - "deviceTypeName": "HA-pump", + "deviceTypeName": "Pump", "deviceTypeCode": 771, - "deviceTypeProfileId": 260, + "deviceTypeProfileId": 2457, "clusters": [ - { - "name": "Power Configuration", - "code": 1, - "mfgCode": null, - "define": "POWER_CONFIG_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": "Power Configuration", - "code": 1, - "mfgCode": null, - "define": "POWER_CONFIG_CLUSTER", - "side": "server", - "enabled": 0, - "commands": [], - "attributes": [ - { - "name": "battery percentage remaining", - "code": 33, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "battery alarm state", - "code": 62, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00000000", - "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": "Device Temperature Configuration", - "code": 2, - "mfgCode": null, - "define": "DEVICE_TEMP_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": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Device Temperature Configuration", - "code": 2, - "mfgCode": null, - "define": "DEVICE_TEMP_CLUSTER", - "side": "server", - "enabled": 0, - "commands": [], - "attributes": [ - { - "name": "current temperature", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Identify", "code": 3, @@ -199,7 +50,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "IdentifyQuery", @@ -207,7 +58,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 } ], "attributes": [ @@ -241,7 +92,7 @@ "code": 0, "mfgCode": null, "source": "server", - "incoming": 0, + "incoming": 1, "outgoing": 1 } ], @@ -730,7 +581,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x00", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -753,15 +604,15 @@ ] }, { - "name": "Alarms", - "code": 9, + "name": "Level Control", + "code": 8, "mfgCode": null, - "define": "ALARM_CLUSTER", + "define": "LEVEL_CONTROL_CLUSTER", "side": "client", "enabled": 0, "commands": [ { - "name": "ResetAlarm", + "name": "MoveToLevel", "code": 0, "mfgCode": null, "source": "client", @@ -769,12 +620,60 @@ "outgoing": 0 }, { - "name": "ResetAllAlarms", + "name": "Move", "code": 1, "mfgCode": null, "source": "client", "incoming": 1, "outgoing": 0 + }, + { + "name": "Step", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Stop", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToLevelWithOnOff", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveWithOnOff", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepWithOnOff", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StopWithOnOff", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 } ], "attributes": [ @@ -787,7 +686,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -796,23 +695,29 @@ ] }, { - "name": "Alarms", - "code": 9, + "name": "Level Control", + "code": 8, "mfgCode": null, - "define": "ALARM_CLUSTER", + "define": "LEVEL_CONTROL_CLUSTER", "side": "server", - "enabled": 0, - "commands": [ + "enabled": 1, + "commands": [], + "attributes": [ { - "name": "Alarm", + "name": "current level", "code": 0, "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - } - ], - "attributes": [ + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, { "name": "cluster revision", "code": 65533, @@ -822,7 +727,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -831,25 +736,17 @@ ] }, { - "name": "Commissioning", - "code": 21, + "name": "Basic", + "code": 40, "mfgCode": null, - "define": "COMMISSIONING_CLUSTER", + "define": "BASIC_CLUSTER", "side": "client", "enabled": 0, "commands": [ { - "name": "RestartDevice", + "name": "MfgSpecificPing", "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "ResetStartupParameters", - "code": 3, - "mfgCode": null, + "mfgCode": 4098, "source": "client", "incoming": 1, "outgoing": 0 @@ -863,9 +760,9 @@ "side": "client", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -874,15 +771,15 @@ ] }, { - "name": "Commissioning", - "code": 21, + "name": "Basic", + "code": 40, "mfgCode": null, - "define": "COMMISSIONING_CLUSTER", + "define": "BASIC_CLUSTER", "side": "server", - "enabled": 0, + "enabled": 1, "commands": [ { - "name": "RestartDeviceResponse", + "name": "StartUp", "code": 0, "mfgCode": null, "source": "server", @@ -890,7 +787,7 @@ "outgoing": 1 }, { - "name": "SaveStartupParametersResponse", + "name": "ShutDown", "code": 1, "mfgCode": null, "source": "server", @@ -898,196 +795,158 @@ "outgoing": 1 }, { - "name": "RestoreStartupParametersResponse", + "name": "Leave", "code": 2, "mfgCode": null, "source": "server", "incoming": 0, "outgoing": 1 - }, - { - "name": "ResetStartupParametersResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 } ], "attributes": [ { - "name": "short address", + "name": "InteractionModelVersion", "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0xFFFF", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "extended pan id", + "name": "VendorName", "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0xFFFFFFFFFFFFFFFF", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "pan id", + "name": "VendorID", "code": 2, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0xFFFF", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "channel mask", + "name": "ProductName", "code": 3, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0x07FFF800", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "protocol version", + "name": "ProductID", "code": 4, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0x02", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "stack profile", + "name": "UserLabel", "code": 5, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0x02", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "startup control", + "name": "Location", "code": 6, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x03", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "trust center address", - "code": 16, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "network key", - "code": 18, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0x00000000000000000000000000000000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "use insecure join", - "code": 19, + "name": "HardwareVersion", + "code": 7, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "0x00", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "preconfigured link key", - "code": 20, + "name": "HardwareVersionString", + "code": 8, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0x00000000000000000000000000000000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "network key sequence number", - "code": 21, + "name": "SoftwareVersion", + "code": 9, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, "defaultValue": "0x00", "reportable": 0, @@ -1096,165 +955,147 @@ "reportableChange": 0 }, { - "name": "network key type", - "code": 22, + "name": "SoftwareVersionString", + "code": 10, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0x05", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "network manager address", - "code": 23, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ { - "name": "scan attempts", - "code": 32, + "name": "ArmFailSafe", + "code": 0, "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x05", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 + "source": "client", + "incoming": 1, + "outgoing": 1 }, { - "name": "time between scans", - "code": 33, + "name": "SetRegulatoryConfig", + "code": 2, "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0064", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 + "source": "client", + "incoming": 1, + "outgoing": 0 }, { - "name": "rejoin interval", - "code": 34, + "name": "CommissioningComplete", + "code": 4, "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x003C", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ { - "name": "max rejoin interval", - "code": 35, + "name": "cluster revision", + "code": 65533, "mfgCode": null, - "side": "server", + "side": "client", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0E10", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ { - "name": "indirect poll rate", - "code": 48, + "name": "ArmFailSafeResponse", + "code": 1, "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 + "source": "server", + "incoming": 1, + "outgoing": 1 }, { - "name": "parent retry threshold", - "code": 49, + "name": "SetRegulatoryConfigResponse", + "code": 3, "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 + "source": "server", + "incoming": 0, + "outgoing": 1 }, { - "name": "concentrator flag", - "code": 64, + "name": "CommissioningCompleteResponse", + "code": 5, "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ { - "name": "concentrator radius", - "code": 65, + "name": "FabricId", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0F", + "defaultValue": "o", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "concentrator discovery time", - "code": 66, + "name": "Breadcrumb", + "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -1269,7 +1110,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -1278,225 +1119,255 @@ ] }, { - "name": "Basic", - "code": 40, + "name": "Network Commissioning", + "code": 49, "mfgCode": null, - "define": "BASIC_CLUSTER", + "define": "NETWORK_COMMISSIONING_CLUSTER", "side": "client", "enabled": 0, - "commands": [], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Basic", - "code": 40, - "mfgCode": null, - "define": "BASIC_CLUSTER", - "side": "server", - "enabled": 1, "commands": [ { - "name": "StartUp", + "name": "ScanNetworks", "code": 0, "mfgCode": null, - "source": "server", + "source": "client", "incoming": 1, "outgoing": 1 }, { - "name": "ShutDown", - "code": 1, + "name": "AddWiFiNetwork", + "code": 2, "mfgCode": null, - "source": "server", + "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { - "name": "Leave", - "code": 2, + "name": "UpdateWiFiNetwork", + "code": 4, "mfgCode": null, - "source": "server", + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddThreadNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "UpdateThreadNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveNetwork", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "EnableNetwork", + "code": 12, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "DisableNetwork", + "code": 14, + "mfgCode": null, + "source": "client", "incoming": 1, "outgoing": 1 + }, + { + "name": "GetLastNetworkCommissioningResult", + "code": 16, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 } ], "attributes": [ { - "name": "InteractionModelVersion", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, - "side": "server", + "side": "client", "included": 1, "storageOption": "RAM", - "singleton": 1, + "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ { - "name": "VendorName", + "name": "ScanNetworksResponse", "code": 1, "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 + "source": "server", + "incoming": 1, + "outgoing": 1 }, { - "name": "VendorID", - "code": 2, + "name": "AddWiFiNetworkResponse", + "code": 3, "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 + "source": "server", + "incoming": 0, + "outgoing": 1 }, { - "name": "ProductName", - "code": 3, + "name": "UpdateWiFiNetworkResponse", + "code": 5, "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 + "source": "server", + "incoming": 0, + "outgoing": 1 }, { - "name": "ProductID", - "code": 4, + "name": "AddThreadNetworkResponse", + "code": 7, "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 + "source": "server", + "incoming": 0, + "outgoing": 1 }, { - "name": "UserLabel", - "code": 5, + "name": "UpdateThreadNetworkResponse", + "code": 9, "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 + "source": "server", + "incoming": 0, + "outgoing": 1 }, { - "name": "Location", - "code": 6, + "name": "RemoveNetworkResponse", + "code": 11, "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 + "source": "server", + "incoming": 1, + "outgoing": 1 }, { - "name": "HardwareVersion", - "code": 7, + "name": "EnableNetworkResponse", + "code": 13, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "DisableNetworkResponse", + "code": 15, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 1, + "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [ { - "name": "HardwareVersionString", - "code": 8, + "name": "cluster revision", + "code": 65533, "mfgCode": null, - "side": "server", + "side": "client", "included": 1, "storageOption": "RAM", - "singleton": 1, + "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ { - "name": "SoftwareVersion", - "code": 9, + "name": "NetworkInterfaces", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 1, + "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "SoftwareVersionString", - "code": 10, + "name": "RebootCount", + "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 1, + "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -1509,9 +1380,9 @@ "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 1, + "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -1520,35 +1391,19 @@ ] }, { - "name": "General Commissioning", - "code": 48, - "mfgCode": null, - "define": "GENERAL_COMMISSIONING_CLUSTER", + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", "side": "client", "enabled": 0, "commands": [ { - "name": "ArmFailSafe", + "name": "ResetWatermarks", "code": 0, "mfgCode": null, "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetRegulatoryConfig", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "CommissioningComplete", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, + "incoming": 0, "outgoing": 1 } ], @@ -1571,64 +1426,24 @@ ] }, { - "name": "General Commissioning", - "code": 48, + "name": "Software Diagnostics", + "code": 52, "mfgCode": null, - "define": "GENERAL_COMMISSIONING_CLUSTER", + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", "side": "server", "enabled": 1, - "commands": [ - { - "name": "ArmFailSafeResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetRegulatoryConfigResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "CommissioningCompleteResponse", - "code": 5, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { - "name": "FabricId", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "o", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Breadcrumb", - "code": 1, + "name": "CurrentHeapHighWatermark", + "code": 3, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000000000000000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -1652,84 +1467,20 @@ ] }, { - "name": "Network Commissioning", - "code": 49, + "name": "Thread Network Diagnostics", + "code": 53, "mfgCode": null, - "define": "NETWORK_COMMISSIONING_CLUSTER", + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", "side": "client", "enabled": 0, "commands": [ { - "name": "ScanNetworks", + "name": "ResetCounts", "code": 0, "mfgCode": null, "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "AddWiFiNetwork", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "UpdateWiFiNetwork", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "AddThreadNetwork", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "UpdateThreadNetwork", - "code": 8, - "mfgCode": null, - "source": "client", - "incoming": 1, + "incoming": 0, "outgoing": 0 - }, - { - "name": "RemoveNetwork", - "code": 10, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "EnableNetwork", - "code": 12, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "DisableNetwork", - "code": 14, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetLastNetworkCommissioningResult", - "code": 16, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 } ], "attributes": [ @@ -1751,134 +1502,212 @@ ] }, { - "name": "Network Commissioning", - "code": 49, + "name": "Thread Network Diagnostics", + "code": 53, "mfgCode": null, - "define": "NETWORK_COMMISSIONING_CLUSTER", + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", "side": "server", "enabled": 1, - "commands": [ + "commands": [], + "attributes": [ { - "name": "ScanNetworksResponse", + "name": "channel", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RoutingRole", "code": 1, "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "AddWiFiNetworkResponse", + "name": "NetworkName", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PanId", "code": 3, "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "UpdateWiFiNetworkResponse", - "code": 5, + "name": "ExtendedPanId", + "code": 4, "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "AddThreadNetworkResponse", - "code": 7, + "name": "MeshLocalPrefix", + "code": 5, "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "UpdateThreadNetworkResponse", - "code": 9, + "name": "OverrunCount", + "code": 6, "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "RemoveNetworkResponse", - "code": 11, + "name": "NeighborTableList", + "code": 7, "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "EnableNetworkResponse", - "code": 13, + "name": "RouteTableList", + "code": 8, "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "DisableNetworkResponse", - "code": 15, + "name": "PartitionId", + "code": 9, "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, { - "name": "cluster revision", - "code": 65533, + "name": "weighting", + "code": 10, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "General Diagnostics", - "code": 51, - "mfgCode": null, - "define": "GENERAL_DIAGNOSTICS_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [], - "attributes": [ + }, + { + "name": "DataVersion", + "code": 11, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, { - "name": "cluster revision", - "code": 65533, + "name": "StableDataVersion", + "code": 12, "mfgCode": null, - "side": "client", + "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "General Diagnostics", - "code": 51, - "mfgCode": null, - "define": "GENERAL_DIAGNOSTICS_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ + }, { - "name": "NetworkInterfaces", - "code": 0, + "name": "LeaderRouterId", + "code": 13, "mfgCode": null, "side": "server", "included": 1, @@ -1892,8 +1721,8 @@ "reportableChange": 0 }, { - "name": "RebootCount", - "code": 1, + "name": "DetachedRoleCount", + "code": 14, "mfgCode": null, "side": "server", "included": 1, @@ -1907,181 +1736,128 @@ "reportableChange": 0 }, { - "name": "cluster revision", - "code": 65533, + "name": "ChildRoleCount", + "code": 15, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "Software Diagnostics", - "code": 52, - "mfgCode": null, - "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "ResetWatermarks", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 - } - ], - "attributes": [ + }, { - "name": "cluster revision", - "code": 65533, + "name": "RouterRoleCount", + "code": 16, "mfgCode": null, - "side": "client", + "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "Software Diagnostics", - "code": 52, - "mfgCode": null, - "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ + }, { - "name": "CurrentHeapHighWatermark", - "code": 3, + "name": "LeaderRoleCount", + "code": 17, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000000000000000", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "cluster revision", - "code": 65533, + "name": "AttachAttemptCount", + "code": 18, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "Thread Network Diagnostics", - "code": 53, - "mfgCode": null, - "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [], - "attributes": [ + }, { - "name": "cluster revision", - "code": 65533, + "name": "PartitionIdChangeCount", + "code": 19, "mfgCode": null, - "side": "client", + "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "Thread Network Diagnostics", - "code": 53, - "mfgCode": null, - "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ + }, { - "name": "channel", - "code": 0, + "name": "BetterPartitionAttachAttemptCount", + "code": 20, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RoutingRole", - "code": 1, + "name": "ParentChangeCount", + "code": 21, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "NetworkName", - "code": 2, + "name": "TxTotalCount", + "code": 22, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "PanId", - "code": 3, + "name": "TxUnicastCount", + "code": 23, "mfgCode": null, "side": "server", "included": 1, @@ -2095,158 +1871,158 @@ "reportableChange": 0 }, { - "name": "ExtendedPanId", - "code": 4, + "name": "TxBroadcastCount", + "code": 24, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000000000000000", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "MeshLocalPrefix", - "code": 5, + "name": "TxAckRequestedCount", + "code": 25, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "OverrunCount", - "code": 6, + "name": "TxAckedCount", + "code": 26, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000000000000000", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "NeighborTableList", - "code": 7, + "name": "TxNoAckRequestedCount", + "code": 27, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RouteTableList", - "code": 8, + "name": "TxDataCount", + "code": 28, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "PartitionId", - "code": 9, + "name": "TxDataPollCount", + "code": 29, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "weighting", - "code": 10, + "name": "TxBeaconCount", + "code": 30, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "DataVersion", - "code": 11, + "name": "TxBeaconRequestCount", + "code": 31, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "StableDataVersion", - "code": 12, + "name": "TxOtherCount", + "code": 32, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "LeaderRouterId", - "code": 13, + "name": "TxRetryCount", + "code": 33, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "DetachedRoleCount", - "code": 14, + "name": "TxDirectMaxRetryExpiryCount", + "code": 34, "mfgCode": null, "side": "server", "included": 1, @@ -2260,8 +2036,8 @@ "reportableChange": 0 }, { - "name": "ChildRoleCount", - "code": 15, + "name": "TxIndirectMaxRetryExpiryCount", + "code": 35, "mfgCode": null, "side": "server", "included": 1, @@ -2275,8 +2051,8 @@ "reportableChange": 0 }, { - "name": "RouterRoleCount", - "code": 16, + "name": "TxErrCcaCount", + "code": 36, "mfgCode": null, "side": "server", "included": 1, @@ -2290,8 +2066,8 @@ "reportableChange": 0 }, { - "name": "LeaderRoleCount", - "code": 17, + "name": "TxErrAbortCount", + "code": 37, "mfgCode": null, "side": "server", "included": 1, @@ -2305,8 +2081,8 @@ "reportableChange": 0 }, { - "name": "AttachAttemptCount", - "code": 18, + "name": "TxErrBusyChannelCount", + "code": 38, "mfgCode": null, "side": "server", "included": 1, @@ -2320,8 +2096,8 @@ "reportableChange": 0 }, { - "name": "PartitionIdChangeCount", - "code": 19, + "name": "RxTotalCount", + "code": 39, "mfgCode": null, "side": "server", "included": 1, @@ -2335,8 +2111,8 @@ "reportableChange": 0 }, { - "name": "BetterPartitionAttachAttemptCount", - "code": 20, + "name": "RxUnicastCount", + "code": 40, "mfgCode": null, "side": "server", "included": 1, @@ -2350,8 +2126,8 @@ "reportableChange": 0 }, { - "name": "ParentChangeCount", - "code": 21, + "name": "RxBroadcastCount", + "code": 41, "mfgCode": null, "side": "server", "included": 1, @@ -2365,8 +2141,8 @@ "reportableChange": 0 }, { - "name": "TxTotalCount", - "code": 22, + "name": "RxDataCount", + "code": 42, "mfgCode": null, "side": "server", "included": 1, @@ -2380,8 +2156,8 @@ "reportableChange": 0 }, { - "name": "TxUnicastCount", - "code": 23, + "name": "RxDataPollCount", + "code": 43, "mfgCode": null, "side": "server", "included": 1, @@ -2395,8 +2171,8 @@ "reportableChange": 0 }, { - "name": "TxBroadcastCount", - "code": 24, + "name": "RxBeaconCount", + "code": 44, "mfgCode": null, "side": "server", "included": 1, @@ -2410,8 +2186,8 @@ "reportableChange": 0 }, { - "name": "TxAckRequestedCount", - "code": 25, + "name": "RxBeaconRequestCount", + "code": 45, "mfgCode": null, "side": "server", "included": 1, @@ -2425,8 +2201,8 @@ "reportableChange": 0 }, { - "name": "TxAckedCount", - "code": 26, + "name": "RxOtherCount", + "code": 46, "mfgCode": null, "side": "server", "included": 1, @@ -2440,8 +2216,8 @@ "reportableChange": 0 }, { - "name": "TxNoAckRequestedCount", - "code": 27, + "name": "RxAddressFilteredCount", + "code": 47, "mfgCode": null, "side": "server", "included": 1, @@ -2455,8 +2231,8 @@ "reportableChange": 0 }, { - "name": "TxDataCount", - "code": 28, + "name": "RxDestAddrFilteredCount", + "code": 48, "mfgCode": null, "side": "server", "included": 1, @@ -2470,8 +2246,8 @@ "reportableChange": 0 }, { - "name": "TxDataPollCount", - "code": 29, + "name": "RxDuplicatedCount", + "code": 49, "mfgCode": null, "side": "server", "included": 1, @@ -2485,8 +2261,8 @@ "reportableChange": 0 }, { - "name": "TxBeaconCount", - "code": 30, + "name": "RxErrNoFrameCount", + "code": 50, "mfgCode": null, "side": "server", "included": 1, @@ -2500,8 +2276,8 @@ "reportableChange": 0 }, { - "name": "TxBeaconRequestCount", - "code": 31, + "name": "RxErrUnknownNeighborCount", + "code": 51, "mfgCode": null, "side": "server", "included": 1, @@ -2515,8 +2291,8 @@ "reportableChange": 0 }, { - "name": "TxOtherCount", - "code": 32, + "name": "RxErrInvalidSrcAddrCount", + "code": 52, "mfgCode": null, "side": "server", "included": 1, @@ -2530,8 +2306,8 @@ "reportableChange": 0 }, { - "name": "TxRetryCount", - "code": 33, + "name": "RxErrSecCount", + "code": 53, "mfgCode": null, "side": "server", "included": 1, @@ -2545,8 +2321,8 @@ "reportableChange": 0 }, { - "name": "TxDirectMaxRetryExpiryCount", - "code": 34, + "name": "RxErrFcsCount", + "code": 54, "mfgCode": null, "side": "server", "included": 1, @@ -2560,8 +2336,8 @@ "reportableChange": 0 }, { - "name": "TxIndirectMaxRetryExpiryCount", - "code": 35, + "name": "RxErrOtherCount", + "code": 55, "mfgCode": null, "side": "server", "included": 1, @@ -2575,23 +2351,23 @@ "reportableChange": 0 }, { - "name": "TxErrCcaCount", - "code": 36, + "name": "SecurityPolicy", + "code": 59, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "TxErrAbortCount", - "code": 37, + "name": "ChannelMask", + "code": 60, "mfgCode": null, "side": "server", "included": 1, @@ -2605,113 +2381,135 @@ "reportableChange": 0 }, { - "name": "TxErrBusyChannelCount", - "code": 38, + "name": "OperationalDatasetComponents", + "code": 61, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RxTotalCount", - "code": 39, + "name": "ActiveNetworkFaultsList", + "code": 62, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RxUnicastCount", - "code": 40, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [ { - "name": "RxBroadcastCount", - "code": 41, + "name": "cluster revision", + "code": 65533, "mfgCode": null, - "side": "server", + "side": "client", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ { - "name": "RxDataCount", - "code": 42, + "name": "bssid", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RxDataPollCount", - "code": 43, + "name": "SecurityType", + "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RxBeaconCount", - "code": 44, + "name": "WiFiVersion", + "code": 2, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RxBeaconRequestCount", - "code": 45, + "name": "ChannelNumber", + "code": 3, "mfgCode": null, "side": "server", "included": 1, @@ -2725,203 +2523,285 @@ "reportableChange": 0 }, { - "name": "RxOtherCount", - "code": 46, + "name": "Rssi", + "code": 4, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x00", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RxAddressFilteredCount", - "code": 47, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ { - "name": "RxDestAddrFilteredCount", - "code": 48, + "name": "ResetCounts", + "code": 0, "mfgCode": null, - "side": "server", + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "client", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ { - "name": "RxDuplicatedCount", - "code": 49, + "name": "PacketRxCount", + "code": 2, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0000000000000000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RxErrNoFrameCount", - "code": 50, + "name": "PacketTxCount", + "code": 3, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0000000000000000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RxErrUnknownNeighborCount", - "code": 51, + "name": "TxErrCount", + "code": 4, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0000000000000000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RxErrInvalidSrcAddrCount", - "code": 52, + "name": "CollisionCount", + "code": 5, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0000000000000000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RxErrSecCount", - "code": 53, + "name": "OverrunCount", + "code": 6, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0000000000000000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RxErrFcsCount", - "code": 54, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "SetFabric", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "OpCSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddOpCert", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 }, { - "name": "RxErrOtherCount", - "code": 55, + "name": "RemoveAllFabrics", + "code": 11, "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ { - "name": "SecurityPolicy", - "code": 59, + "name": "cluster revision", + "code": 65533, "mfgCode": null, - "side": "server", + "side": "client", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ { - "name": "ChannelMask", - "code": 60, + "name": "SetFabricResponse", + "code": 1, "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 + "source": "server", + "incoming": 1, + "outgoing": 1 }, { - "name": "OperationalDatasetComponents", - "code": 61, + "name": "OpCSRResponse", + "code": 5, "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 + "source": "server", + "incoming": 1, + "outgoing": 1 }, { - "name": "ActiveNetworkFaultsList", - "code": 62, + "name": "OpCertResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "fabrics list", + "code": 1, "mfgCode": null, "side": "server", "included": 1, @@ -2952,19 +2832,27 @@ ] }, { - "name": "Ethernet Network Diagnostics", - "code": 55, + "name": "Trusted Root Certificates", + "code": 63, "mfgCode": null, - "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "define": "TRUSTED_ROOT_CERTIFICATES_CLUSTER", "side": "client", "enabled": 0, "commands": [ { - "name": "ResetCounts", + "name": "AddTrustedRootCertificate", "code": 0, "mfgCode": null, "source": "client", - "incoming": 0, + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveTrustedRootCertificate", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, "outgoing": 1 } ], @@ -2987,225 +2875,181 @@ ] }, { - "name": "Ethernet Network Diagnostics", - "code": 55, + "name": "Trusted Root Certificates", + "code": 63, "mfgCode": null, - "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "define": "TRUSTED_ROOT_CERTIFICATES_CLUSTER", "side": "server", "enabled": 1, "commands": [], "attributes": [ { - "name": "PacketRxCount", - "code": 2, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000000000000000", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "Pump Configuration and Control", + "code": 512, + "mfgCode": null, + "define": "PUMP_CONFIG_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [ { - "name": "PacketTxCount", - "code": 3, + "name": "cluster revision", + "code": 65533, "mfgCode": null, - "side": "server", + "side": "client", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000000000000000", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "Pump Configuration and Control", + "code": 512, + "mfgCode": null, + "define": "PUMP_CONFIG_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ { - "name": "TxErrCount", - "code": 4, + "name": "max pressure", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000000000000000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "CollisionCount", - "code": 5, + "name": "max speed", + "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000000000000000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "OverrunCount", - "code": 6, + "name": "max flow", + "code": 2, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000000000000000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "cluster revision", - "code": 65533, + "name": "pump status", + "code": 16, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, + "defaultValue": "", + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "Operational Credentials", - "code": 62, - "mfgCode": null, - "define": "OPERATIONAL_CREDENTIALS_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "SetFabric", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "OpCSRRequest", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "AddOpCert", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "UpdateFabricLabel", - "code": 9, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 }, { - "name": "RemoveFabric", - "code": 10, + "name": "effective operation mode", + "code": 17, "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "RemoveAllFabrics", - "code": 11, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, + "name": "effective control mode", + "code": 18, "mfgCode": null, - "side": "client", + "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "Operational Credentials", - "code": 62, - "mfgCode": null, - "define": "OPERATIONAL_CREDENTIALS_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "SetFabricResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 }, { - "name": "OpCSRResponse", - "code": 5, + "name": "capacity", + "code": 19, "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "OpCertResponse", - "code": 8, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "fabrics list", - "code": 1, + "name": "operation mode", + "code": 32, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x00", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -3229,30 +3073,13 @@ ] }, { - "name": "Trusted Root Certificates", - "code": 63, + "name": "Temperature Measurement", + "code": 1026, "mfgCode": null, - "define": "TRUSTED_ROOT_CERTIFICATES_CLUSTER", + "define": "TEMP_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 0, - "commands": [ - { - "name": "AddTrustedRootCertificate", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "RemoveTrustedRootCertificate", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], + "enabled": 1, + "commands": [], "attributes": [ { "name": "cluster revision", @@ -3263,7 +3090,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -3272,14 +3099,74 @@ ] }, { - "name": "Trusted Root Certificates", - "code": 63, + "name": "Temperature Measurement", + "code": 1026, "mfgCode": null, - "define": "TRUSTED_ROOT_CERTIFICATES_CLUSTER", + "define": "TEMP_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": "0x8000", + "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": "0x8000", + "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": "0x8000", + "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, @@ -3289,7 +3176,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -3298,10 +3185,10 @@ ] }, { - "name": "Pump Configuration and Control", - "code": 512, + "name": "Pressure Measurement", + "code": 1027, "mfgCode": null, - "define": "PUMP_CONFIG_CONTROL_CLUSTER", + "define": "PRESSURE_MEASUREMENT_CLUSTER", "side": "client", "enabled": 0, "commands": [], @@ -3315,7 +3202,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "2", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -3324,16 +3211,16 @@ ] }, { - "name": "Pump Configuration and Control", - "code": 512, + "name": "Pressure Measurement", + "code": 1027, "mfgCode": null, - "define": "PUMP_CONFIG_CONTROL_CLUSTER", + "define": "PRESSURE_MEASUREMENT_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "commands": [], "attributes": [ { - "name": "max pressure", + "name": "measured value", "code": 0, "mfgCode": null, "side": "server", @@ -3341,14 +3228,14 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", - "reportable": 0, + "defaultValue": "0x0000", + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "max speed", + "name": "min measured value", "code": 1, "mfgCode": null, "side": "server", @@ -3363,7 +3250,7 @@ "reportableChange": 0 }, { - "name": "max flow", + "name": "max measured value", "code": 2, "mfgCode": null, "side": "server", @@ -3378,7 +3265,22 @@ "reportableChange": 0 }, { - "name": "pump status", + "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": "scaled value", "code": 16, "mfgCode": null, "side": "server", @@ -3386,6 +3288,21 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "scaled tolerance", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, "defaultValue": "", "reportable": 1, "minInterval": 0, @@ -3393,23 +3310,75 @@ "reportableChange": 0 }, { - "name": "effective operation mode", - "code": 17, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "2", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + } + ] + }, + { + "name": "Flow Measurement", + "code": 1028, + "mfgCode": null, + "define": "FLOW_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": "Flow Measurement", + "code": 1028, + "mfgCode": null, + "define": "FLOW_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "measured value", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "effective control mode", - "code": 18, + "name": "min measured value", + "code": 1, "mfgCode": null, "side": "server", "included": 1, @@ -3423,8 +3392,8 @@ "reportableChange": 0 }, { - "name": "capacity", - "code": 19, + "name": "max measured value", + "code": 2, "mfgCode": null, "side": "server", "included": 1, @@ -3432,22 +3401,22 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "operation mode", - "code": 32, + "name": "tolerance", + "code": 3, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", - "reportable": 0, + "defaultValue": "", + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -3461,7 +3430,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "2", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -3476,10 +3445,10 @@ { "endpointTypeName": "Anonymous Endpoint Type", "endpointTypeIndex": 0, - "profileId": 260, + "profileId": 2457, "endpointId": 1, "networkId": 0, - "endpointVersion": null, + "endpointVersion": 1, "deviceIdentifier": null } ], diff --git a/examples/pump-controller-app/pump-controller-common/gen/CHIPClusters.cpp b/examples/pump-controller-app/pump-controller-common/gen/CHIPClusters.cpp index ffb4fe1ca2b1dc..f3deefcf1f9978 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/CHIPClusters.cpp +++ b/examples/pump-controller-app/pump-controller-common/gen/CHIPClusters.cpp @@ -30,6 +30,403 @@ namespace Controller { // TODO(#4503): length should be passed to commands when byte string is in argument list. // TODO(#4503): Commands should take group id as an argument. +// LevelControl Cluster Commands +CHIP_ERROR LevelControlCluster::Move(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t moveMode, uint8_t rate, uint8_t optionMask, uint8_t optionOverride) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + app::CommandSender * sender = nullptr; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kMoveCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + + SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); + + SuccessOrExit(err = sender->PrepareCommand(&cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataElementTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // moveMode: moveMode + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), moveMode)); + // rate: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), rate)); + // optionMask: bitmap8 + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionMask)); + // optionOverride: bitmap8 + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionOverride)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender, onSuccessCallback, onFailureCallback); + + err = mDevice->SendCommands(sender); + +exit: + // On error, we are responsible to close the sender. + if (err != CHIP_NO_ERROR && sender != nullptr) + { + sender->Shutdown(); + } + return err; +} + +CHIP_ERROR LevelControlCluster::MoveToLevel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t level, uint16_t transitionTime, uint8_t optionMask, uint8_t optionOverride) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + app::CommandSender * sender = nullptr; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kMoveToLevelCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + + SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); + + SuccessOrExit(err = sender->PrepareCommand(&cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataElementTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // level: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), level)); + // transitionTime: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transitionTime)); + // optionMask: bitmap8 + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionMask)); + // optionOverride: bitmap8 + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionOverride)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender, onSuccessCallback, onFailureCallback); + + err = mDevice->SendCommands(sender); + +exit: + // On error, we are responsible to close the sender. + if (err != CHIP_NO_ERROR && sender != nullptr) + { + sender->Shutdown(); + } + return err; +} + +CHIP_ERROR LevelControlCluster::MoveToLevelWithOnOff(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t level, + uint16_t transitionTime) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + app::CommandSender * sender = nullptr; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kMoveToLevelWithOnOffCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + + SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); + + SuccessOrExit(err = sender->PrepareCommand(&cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataElementTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // level: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), level)); + // transitionTime: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transitionTime)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender, onSuccessCallback, onFailureCallback); + + err = mDevice->SendCommands(sender); + +exit: + // On error, we are responsible to close the sender. + if (err != CHIP_NO_ERROR && sender != nullptr) + { + sender->Shutdown(); + } + return err; +} + +CHIP_ERROR LevelControlCluster::MoveWithOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t moveMode, uint8_t rate) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + app::CommandSender * sender = nullptr; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kMoveWithOnOffCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + + SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); + + SuccessOrExit(err = sender->PrepareCommand(&cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataElementTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // moveMode: moveMode + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), moveMode)); + // rate: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), rate)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender, onSuccessCallback, onFailureCallback); + + err = mDevice->SendCommands(sender); + +exit: + // On error, we are responsible to close the sender. + if (err != CHIP_NO_ERROR && sender != nullptr) + { + sender->Shutdown(); + } + return err; +} + +CHIP_ERROR LevelControlCluster::Step(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t stepMode, uint8_t stepSize, uint16_t transitionTime, uint8_t optionMask, + uint8_t optionOverride) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + app::CommandSender * sender = nullptr; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kStepCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + + SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); + + SuccessOrExit(err = sender->PrepareCommand(&cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataElementTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // stepMode: stepMode + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), stepMode)); + // stepSize: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), stepSize)); + // transitionTime: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transitionTime)); + // optionMask: bitmap8 + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionMask)); + // optionOverride: bitmap8 + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionOverride)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender, onSuccessCallback, onFailureCallback); + + err = mDevice->SendCommands(sender); + +exit: + // On error, we are responsible to close the sender. + if (err != CHIP_NO_ERROR && sender != nullptr) + { + sender->Shutdown(); + } + return err; +} + +CHIP_ERROR LevelControlCluster::StepWithOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t stepMode, uint8_t stepSize, uint16_t transitionTime) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + app::CommandSender * sender = nullptr; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kStepWithOnOffCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + + SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); + + SuccessOrExit(err = sender->PrepareCommand(&cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataElementTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // stepMode: stepMode + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), stepMode)); + // stepSize: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), stepSize)); + // transitionTime: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transitionTime)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender, onSuccessCallback, onFailureCallback); + + err = mDevice->SendCommands(sender); + +exit: + // On error, we are responsible to close the sender. + if (err != CHIP_NO_ERROR && sender != nullptr) + { + sender->Shutdown(); + } + return err; +} + +CHIP_ERROR LevelControlCluster::Stop(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t optionMask, uint8_t optionOverride) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + app::CommandSender * sender = nullptr; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kStopCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + + SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); + + SuccessOrExit(err = sender->PrepareCommand(&cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataElementTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // optionMask: bitmap8 + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionMask)); + // optionOverride: bitmap8 + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionOverride)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender, onSuccessCallback, onFailureCallback); + + err = mDevice->SendCommands(sender); + +exit: + // On error, we are responsible to close the sender. + if (err != CHIP_NO_ERROR && sender != nullptr) + { + sender->Shutdown(); + } + return err; +} + +CHIP_ERROR LevelControlCluster::StopWithOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + app::CommandSender * sender = nullptr; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kStopWithOnOffCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + + SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); + + SuccessOrExit(err = sender->PrepareCommand(&cmdParams)); + + // Command takes no arguments. + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender, onSuccessCallback, onFailureCallback); + + err = mDevice->SendCommands(sender); + +exit: + // On error, we are responsible to close the sender. + if (err != CHIP_NO_ERROR && sender != nullptr) + { + sender->Shutdown(); + } + return err; +} + +// LevelControl Cluster Attributes +CHIP_ERROR LevelControlCluster::DiscoverAttributes(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeLevelControlClusterDiscoverAttributes(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} +CHIP_ERROR LevelControlCluster::ReadAttributeCurrentLevel(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeLevelControlClusterReadCurrentLevelAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR LevelControlCluster::ConfigureAttributeCurrentLevel(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t minInterval, + uint16_t maxInterval, uint8_t change) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = + encodeLevelControlClusterConfigureCurrentLevelAttribute(seqNum, mEndpoint, minInterval, maxInterval, change); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR LevelControlCluster::ReportAttributeCurrentLevel(Callback::Cancelable * onReportCallback) +{ + return RequestAttributeReporting(0x0000, onReportCallback); +} + +CHIP_ERROR LevelControlCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeLevelControlClusterReadClusterRevisionAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + // OnOff Cluster Commands CHIP_ERROR OnOffCluster::Off(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { @@ -159,20 +556,6 @@ CHIP_ERROR OnOffCluster::ReadAttributeOnOff(Callback::Cancelable * onSuccessCall return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); } -CHIP_ERROR OnOffCluster::ConfigureAttributeOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - uint8_t seqNum = mDevice->GetNextSequenceNumber(); - System::PacketBufferHandle encodedCommand = - encodeOnOffClusterConfigureOnOffAttribute(seqNum, mEndpoint, minInterval, maxInterval); - return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OnOffCluster::ReportAttributeOnOff(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(0x0000, onReportCallback); -} - CHIP_ERROR OnOffCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { @@ -283,5 +666,62 @@ CHIP_ERROR PumpConfigurationAndControlCluster::ReadAttributeClusterRevision(Call return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); } +// TemperatureMeasurement Cluster Commands +// TemperatureMeasurement Cluster Attributes +CHIP_ERROR TemperatureMeasurementCluster::DiscoverAttributes(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTemperatureMeasurementClusterDiscoverAttributes(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} +CHIP_ERROR TemperatureMeasurementCluster::ReadAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTemperatureMeasurementClusterReadMeasuredValueAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TemperatureMeasurementCluster::ConfigureAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + uint16_t minInterval, uint16_t maxInterval, + int16_t change) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = + encodeTemperatureMeasurementClusterConfigureMeasuredValueAttribute(seqNum, mEndpoint, minInterval, maxInterval, change); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TemperatureMeasurementCluster::ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback) +{ + return RequestAttributeReporting(0x0000, onReportCallback); +} + +CHIP_ERROR TemperatureMeasurementCluster::ReadAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTemperatureMeasurementClusterReadMinMeasuredValueAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TemperatureMeasurementCluster::ReadAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTemperatureMeasurementClusterReadMaxMeasuredValueAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TemperatureMeasurementCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTemperatureMeasurementClusterReadClusterRevisionAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + } // namespace Controller } // namespace chip diff --git a/examples/pump-controller-app/pump-controller-common/gen/CHIPClusters.h b/examples/pump-controller-app/pump-controller-common/gen/CHIPClusters.h index bd00a51f6f5124..49a18552a26ed5 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/CHIPClusters.h +++ b/examples/pump-controller-app/pump-controller-common/gen/CHIPClusters.h @@ -27,8 +27,52 @@ namespace chip { namespace Controller { +constexpr ClusterId kLevelControlClusterId = 0x0008; constexpr ClusterId kOnOffClusterId = 0x0006; constexpr ClusterId kPumpConfigurationAndControlClusterId = 0x0200; +constexpr ClusterId kTemperatureMeasurementClusterId = 0x0402; + +class DLL_EXPORT LevelControlCluster : public ClusterBase +{ +public: + LevelControlCluster() : ClusterBase(kLevelControlClusterId) {} + ~LevelControlCluster() {} + + // Cluster Commands + CHIP_ERROR Move(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t moveMode, + uint8_t rate, uint8_t optionMask, uint8_t optionOverride); + CHIP_ERROR MoveToLevel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t level, + uint16_t transitionTime, uint8_t optionMask, uint8_t optionOverride); + CHIP_ERROR MoveToLevelWithOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t level, uint16_t transitionTime); + CHIP_ERROR MoveWithOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t moveMode, + uint8_t rate); + CHIP_ERROR Step(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t stepMode, + uint8_t stepSize, uint16_t transitionTime, uint8_t optionMask, uint8_t optionOverride); + CHIP_ERROR StepWithOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t stepMode, + uint8_t stepSize, uint16_t transitionTime); + CHIP_ERROR Stop(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t optionMask, + uint8_t optionOverride); + CHIP_ERROR StopWithOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + + // Cluster Attributes + CHIP_ERROR DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeCurrentLevel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ConfigureAttributeCurrentLevel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t minInterval, uint16_t maxInterval, uint8_t change); + CHIP_ERROR ReportAttributeCurrentLevel(Callback::Cancelable * onReportCallback); + +private: + static constexpr CommandId kMoveCommandId = 0x01; + static constexpr CommandId kMoveToLevelCommandId = 0x00; + static constexpr CommandId kMoveToLevelWithOnOffCommandId = 0x04; + static constexpr CommandId kMoveWithOnOffCommandId = 0x05; + static constexpr CommandId kStepCommandId = 0x02; + static constexpr CommandId kStepWithOnOffCommandId = 0x06; + static constexpr CommandId kStopCommandId = 0x03; + static constexpr CommandId kStopWithOnOffCommandId = 0x07; +}; class DLL_EXPORT OnOffCluster : public ClusterBase { @@ -45,9 +89,6 @@ class DLL_EXPORT OnOffCluster : public ClusterBase CHIP_ERROR DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR ConfigureAttributeOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOnOff(Callback::Cancelable * onReportCallback); private: static constexpr CommandId kOffCommandId = 0x00; @@ -80,5 +121,22 @@ class DLL_EXPORT PumpConfigurationAndControlCluster : public ClusterBase CHIP_ERROR ReportAttributeCapacity(Callback::Cancelable * onReportCallback); }; +class DLL_EXPORT TemperatureMeasurementCluster : public ClusterBase +{ +public: + TemperatureMeasurementCluster() : ClusterBase(kTemperatureMeasurementClusterId) {} + ~TemperatureMeasurementCluster() {} + + // Cluster Attributes + CHIP_ERROR DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ConfigureAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t minInterval, uint16_t maxInterval, int16_t change); + CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); +}; + } // namespace Controller } // namespace chip diff --git a/examples/pump-controller-app/pump-controller-common/gen/IMClusterCommandHandler.cpp b/examples/pump-controller-app/pump-controller-common/gen/IMClusterCommandHandler.cpp index afe51e4394d172..32821c292581d1 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/IMClusterCommandHandler.cpp +++ b/examples/pump-controller-app/pump-controller-common/gen/IMClusterCommandHandler.cpp @@ -39,6 +39,54 @@ namespace app { namespace clusters { +namespace Basic { + +void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +{ + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + // The following variables are used for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; + uint32_t validArgumentCount = 0; + uint32_t expectArgumentCount = 0; + uint32_t currentDecodeTagId = 0; + bool wasHandled = false; + { + switch (aCommandId) + { + default: { + // Unrecognized command ID, error status will apply. + chip::app::CommandPathParams returnStatusParam = { aEndpointId, + 0, // GroupId + ZCL_BASIC_CLUSTER_ID, aCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + apCommandObj->AddStatusCode(&returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_BASIC_CLUSTER_ID); + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) + { + chip::app::CommandPathParams returnStatusParam = { aEndpointId, + 0, // GroupId + ZCL_BASIC_CLUSTER_ID, aCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + apCommandObj->AddStatusCode(&returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogProgress(Zcl, + "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32 + " (last decoded tag = %" PRIu32, + validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + } +} + +} // namespace Basic + namespace GeneralCommissioning { void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) @@ -1497,6 +1545,9 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) { + case ZCL_BASIC_CLUSTER_ID: + clusters::Basic::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + break; case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID: clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; diff --git a/examples/pump-controller-app/pump-controller-common/gen/attribute-size.cpp b/examples/pump-controller-app/pump-controller-common/gen/attribute-size.cpp index fbd56aebff47c7..3f0b9b4e45338f 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/attribute-size.cpp +++ b/examples/pump-controller-app/pump-controller-common/gen/attribute-size.cpp @@ -78,6 +78,47 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo uint16_t entryLength = 0; switch (clusterId) { + case 0x0033: // General Diagnostics Cluster + { + uint16_t entryOffset = kSizeLengthInBytes; + switch (am->attributeId) + { + case 0x0000: // NetworkInterfaces + { + entryLength = 46; + if (((index - 1) * entryLength) > (am->size - entryLength)) + { + ChipLogError(Zcl, "Index %l is invalid.", index); + return 0; + } + entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); + // Struct _NetworkInterfaceType + _NetworkInterfaceType * entry = reinterpret_cast<_NetworkInterfaceType *>(write ? src : dest); + chip::ByteSpan * NameSpan = &entry->Name; // OCTET_STRING + if (CHIP_NO_ERROR != + (write ? WriteByteSpan(dest + entryOffset, 34, NameSpan) : ReadByteSpan(src + entryOffset, 34, NameSpan))) + { + ChipLogError(Zcl, "Index %l is invalid. Not enough remaining space", index); + return 0; + } + entryOffset = static_cast(entryOffset + 34); + copyListMember(write ? dest : (uint8_t *) &entry->FabricConnected, write ? (uint8_t *) &entry->FabricConnected : src, + write, &entryOffset, sizeof(entry->FabricConnected)); // BOOLEAN + copyListMember(write ? dest : (uint8_t *) &entry->OffPremiseServicesReachableIPv4, + write ? (uint8_t *) &entry->OffPremiseServicesReachableIPv4 : src, write, &entryOffset, + sizeof(entry->OffPremiseServicesReachableIPv4)); // BOOLEAN + copyListMember(write ? dest : (uint8_t *) &entry->OffPremiseServicesReachableIPv6, + write ? (uint8_t *) &entry->OffPremiseServicesReachableIPv6 : src, write, &entryOffset, + sizeof(entry->OffPremiseServicesReachableIPv6)); // BOOLEAN + copyListMember(write ? dest : (uint8_t *) &entry->HardwareAddress, write ? (uint8_t *) &entry->HardwareAddress : src, + write, &entryOffset, sizeof(entry->HardwareAddress)); // IEEE_ADDRESS + copyListMember(write ? dest : (uint8_t *) &entry->Type, write ? (uint8_t *) &entry->Type : src, write, &entryOffset, + sizeof(entry->Type)); // ENUM8 + break; + } + } + break; + } case 0x003E: // Operational Credentials Cluster { uint16_t entryOffset = kSizeLengthInBytes; @@ -279,6 +320,15 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut uint16_t entryLength = 0; switch (clusterId) { + case 0x0033: // General Diagnostics Cluster + switch (attributeId) + { + case 0x0000: // NetworkInterfaces + // Struct _NetworkInterfaceType + entryLength = 46; + break; + } + break; case 0x003E: // Operational Credentials Cluster switch (attributeId) { diff --git a/examples/pump-controller-app/pump-controller-common/gen/call-command-handler.cpp b/examples/pump-controller-app/pump-controller-common/gen/call-command-handler.cpp index b10822c2974b33..a4e23ac8b6e24a 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/call-command-handler.cpp +++ b/examples/pump-controller-app/pump-controller-common/gen/call-command-handler.cpp @@ -29,13 +29,20 @@ using namespace chip; EmberAfStatus emberAfBasicClusterServerCommandParse(EmberAfClusterCommand * cmd); +EmberAfStatus emberAfEthernetNetworkDiagnosticsClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfGeneralCommissioningClusterServerCommandParse(EmberAfClusterCommand * cmd); +EmberAfStatus emberAfGeneralDiagnosticsClusterServerCommandParse(EmberAfClusterCommand * cmd); +EmberAfStatus emberAfLevelControlClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfNetworkCommissioningClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfOnOffClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfOperationalCredentialsClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfPumpConfigurationAndControlClusterClientCommandParse(EmberAfClusterCommand * cmd); +EmberAfStatus emberAfSoftwareDiagnosticsClusterServerCommandParse(EmberAfClusterCommand * cmd); +EmberAfStatus emberAfTemperatureMeasurementClusterClientCommandParse(EmberAfClusterCommand * cmd); +EmberAfStatus emberAfTemperatureMeasurementClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfThreadNetworkDiagnosticsClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfTrustedRootCertificatesClusterServerCommandParse(EmberAfClusterCommand * cmd); +EmberAfStatus emberAfWiFiNetworkDiagnosticsClusterServerCommandParse(EmberAfClusterCommand * cmd); static EmberAfStatus status(bool wasHandled, bool clusterExists, bool mfgSpecific) { @@ -66,6 +73,10 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) { switch (cmd->apsFrame->clusterId) { + case ZCL_LEVEL_CONTROL_CLUSTER_ID: + // No commands are enabled for cluster Level Control + result = status(false, true, cmd->mfgSpecific); + break; case ZCL_ON_OFF_CLUSTER_ID: // No commands are enabled for cluster On/off result = status(false, true, cmd->mfgSpecific); @@ -74,6 +85,10 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) // No commands are enabled for cluster Pump Configuration and Control result = status(false, true, cmd->mfgSpecific); break; + case ZCL_TEMP_MEASUREMENT_CLUSTER_ID: + // No commands are enabled for cluster Temperature Measurement + result = status(false, true, cmd->mfgSpecific); + break; default: // Unrecognized cluster ID, error status will apply. break; @@ -85,18 +100,33 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) switch (cmd->apsFrame->clusterId) { case ZCL_BASIC_CLUSTER_ID: - // No commands are enabled for cluster Basic + result = emberAfBasicClusterServerCommandParse(cmd); + break; + case ZCL_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_ID: + // No commands are enabled for cluster Ethernet Network Diagnostics result = status(false, true, cmd->mfgSpecific); break; case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID: result = emberAfGeneralCommissioningClusterServerCommandParse(cmd); break; + case ZCL_GENERAL_DIAGNOSTICS_CLUSTER_ID: + // No commands are enabled for cluster General Diagnostics + result = status(false, true, cmd->mfgSpecific); + break; case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: result = emberAfNetworkCommissioningClusterServerCommandParse(cmd); break; case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID: result = emberAfOperationalCredentialsClusterServerCommandParse(cmd); break; + case ZCL_SOFTWARE_DIAGNOSTICS_CLUSTER_ID: + // No commands are enabled for cluster Software Diagnostics + result = status(false, true, cmd->mfgSpecific); + break; + case ZCL_TEMP_MEASUREMENT_CLUSTER_ID: + // No commands are enabled for cluster Temperature Measurement + result = status(false, true, cmd->mfgSpecific); + break; case ZCL_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_ID: // No commands are enabled for cluster Thread Network Diagnostics result = status(false, true, cmd->mfgSpecific); @@ -104,6 +134,10 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) case ZCL_TRUSTED_ROOT_CERTIFICATES_CLUSTER_ID: result = emberAfTrustedRootCertificatesClusterServerCommandParse(cmd); break; + case ZCL_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_ID: + // No commands are enabled for cluster WiFi Network Diagnostics + result = status(false, true, cmd->mfgSpecific); + break; default: // Unrecognized cluster ID, error status will apply. break; @@ -114,6 +148,29 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) // Cluster specific command parsing +EmberAfStatus emberAfBasicClusterServerCommandParse(EmberAfClusterCommand * cmd) +{ + bool wasHandled = false; + + if (cmd->mfgSpecific) + { + if (cmd->mfgCode == 4098 && cmd->commandId == ZCL_MFG_SPECIFIC_PING_COMMAND_ID) + { + wasHandled = emberAfBasicClusterMfgSpecificPingCallback(nullptr); + } + } + else + { + switch (cmd->commandId) + { + default: { + // Unrecognized command ID, error status will apply. + break; + } + } + } + return status(wasHandled, true, cmd->mfgSpecific); +} EmberAfStatus emberAfGeneralCommissioningClusterServerCommandParse(EmberAfClusterCommand * cmd) { bool wasHandled = false; diff --git a/examples/pump-controller-app/pump-controller-common/gen/callback-stub.cpp b/examples/pump-controller-app/pump-controller-common/gen/callback-stub.cpp index 0896214984b929..4dfd10d925d23c 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/callback-stub.cpp +++ b/examples/pump-controller-app/pump-controller-common/gen/callback-stub.cpp @@ -32,9 +32,18 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_BASIC_CLUSTER_ID: emberAfBasicClusterInitCallback(endpoint); break; + case ZCL_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_ID: + emberAfEthernetNetworkDiagnosticsClusterInitCallback(endpoint); + break; case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID: emberAfGeneralCommissioningClusterInitCallback(endpoint); break; + case ZCL_GENERAL_DIAGNOSTICS_CLUSTER_ID: + emberAfGeneralDiagnosticsClusterInitCallback(endpoint); + break; + case ZCL_LEVEL_CONTROL_CLUSTER_ID: + emberAfLevelControlClusterInitCallback(endpoint); + break; case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: emberAfNetworkCommissioningClusterInitCallback(endpoint); break; @@ -47,12 +56,21 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_PUMP_CONFIG_CONTROL_CLUSTER_ID: emberAfPumpConfigurationAndControlClusterInitCallback(endpoint); break; + case ZCL_SOFTWARE_DIAGNOSTICS_CLUSTER_ID: + emberAfSoftwareDiagnosticsClusterInitCallback(endpoint); + break; + case ZCL_TEMP_MEASUREMENT_CLUSTER_ID: + emberAfTemperatureMeasurementClusterInitCallback(endpoint); + break; case ZCL_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_ID: emberAfThreadNetworkDiagnosticsClusterInitCallback(endpoint); break; case ZCL_TRUSTED_ROOT_CERTIFICATES_CLUSTER_ID: emberAfTrustedRootCertificatesClusterInitCallback(endpoint); break; + case ZCL_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_ID: + emberAfWiFiNetworkDiagnosticsClusterInitCallback(endpoint); + break; default: // Unrecognized cluster ID break; @@ -64,11 +82,26 @@ void __attribute__((weak)) emberAfBasicClusterInitCallback(EndpointId endpoint) // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfEthernetNetworkDiagnosticsClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfGeneralCommissioningClusterInitCallback(EndpointId endpoint) { // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfGeneralDiagnosticsClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} +void __attribute__((weak)) emberAfLevelControlClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfNetworkCommissioningClusterInitCallback(EndpointId endpoint) { // To prevent warning @@ -89,6 +122,16 @@ void __attribute__((weak)) emberAfPumpConfigurationAndControlClusterInitCallback // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfSoftwareDiagnosticsClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} +void __attribute__((weak)) emberAfTemperatureMeasurementClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfThreadNetworkDiagnosticsClusterInitCallback(EndpointId endpoint) { // To prevent warning @@ -99,6 +142,11 @@ void __attribute__((weak)) emberAfTrustedRootCertificatesClusterInitCallback(End // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfWiFiNetworkDiagnosticsClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} // // Non-Cluster Related Callbacks diff --git a/examples/pump-controller-app/pump-controller-common/gen/callback.h b/examples/pump-controller-app/pump-controller-common/gen/callback.h index d433e92ab4a785..3cb37bcb0c2352 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/callback.h +++ b/examples/pump-controller-app/pump-controller-common/gen/callback.h @@ -48,6 +48,14 @@ void emberAfClusterInitCallback(chip::EndpointId endpoint, chip::ClusterId clust */ void emberAfBasicClusterInitCallback(chip::EndpointId endpoint); +/** @brief Ethernet Network Diagnostics Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfEthernetNetworkDiagnosticsClusterInitCallback(chip::EndpointId endpoint); + /** @brief General Commissioning Cluster Init * * Cluster Init @@ -56,6 +64,22 @@ void emberAfBasicClusterInitCallback(chip::EndpointId endpoint); */ void emberAfGeneralCommissioningClusterInitCallback(chip::EndpointId endpoint); +/** @brief General Diagnostics Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfGeneralDiagnosticsClusterInitCallback(chip::EndpointId endpoint); + +/** @brief Level Control Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfLevelControlClusterInitCallback(chip::EndpointId endpoint); + /** @brief Network Commissioning Cluster Init * * Cluster Init @@ -88,6 +112,22 @@ void emberAfOperationalCredentialsClusterInitCallback(chip::EndpointId endpoint) */ void emberAfPumpConfigurationAndControlClusterInitCallback(chip::EndpointId endpoint); +/** @brief Software Diagnostics Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfSoftwareDiagnosticsClusterInitCallback(chip::EndpointId endpoint); + +/** @brief Temperature Measurement Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfTemperatureMeasurementClusterInitCallback(chip::EndpointId endpoint); + /** @brief Thread Network Diagnostics Cluster Init * * Cluster Init @@ -104,6 +144,14 @@ void emberAfThreadNetworkDiagnosticsClusterInitCallback(chip::EndpointId endpoin */ void emberAfTrustedRootCertificatesClusterInitCallback(chip::EndpointId endpoint); +/** @brief WiFi Network Diagnostics Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfWiFiNetworkDiagnosticsClusterInitCallback(chip::EndpointId endpoint); + // Cluster Server/Client Init Functions // @@ -174,6 +222,79 @@ EmberAfStatus emberAfBasicClusterServerPreAttributeChangedCallback(chip::Endpoin */ void emberAfBasicClusterServerTickCallback(chip::EndpointId endpoint); +// +// Ethernet Network Diagnostics Cluster server +// + +/** @brief Ethernet Network Diagnostics Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfEthernetNetworkDiagnosticsClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Ethernet Network Diagnostics Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + */ +void emberAfEthernetNetworkDiagnosticsClusterServerAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId); + +/** @brief Ethernet Network Diagnostics 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 emberAfEthernetNetworkDiagnosticsClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); + +/** @brief Ethernet Network Diagnostics 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 emberAfEthernetNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, + chip::MessageSendDestination destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); + +/** @brief Ethernet Network Diagnostics 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 emberAfEthernetNetworkDiagnosticsClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + EmberAfAttributeType attributeType, + uint16_t size, uint8_t * value); + +/** @brief Ethernet Network Diagnostics Cluster Server Tick + * + * server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfEthernetNetworkDiagnosticsClusterServerTickCallback(chip::EndpointId endpoint); + // // General Commissioning Cluster server // @@ -245,6 +366,147 @@ EmberAfStatus emberAfGeneralCommissioningClusterServerPreAttributeChangedCallbac */ void emberAfGeneralCommissioningClusterServerTickCallback(chip::EndpointId endpoint); +// +// General Diagnostics Cluster server +// + +/** @brief General Diagnostics Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfGeneralDiagnosticsClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief General Diagnostics Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + */ +void emberAfGeneralDiagnosticsClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); + +/** @brief General Diagnostics 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 emberAfGeneralDiagnosticsClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); + +/** @brief General Diagnostics 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 emberAfGeneralDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, + chip::MessageSendDestination destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); + +/** @brief General Diagnostics 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 emberAfGeneralDiagnosticsClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint16_t size, + uint8_t * value); + +/** @brief General Diagnostics Cluster Server Tick + * + * server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfGeneralDiagnosticsClusterServerTickCallback(chip::EndpointId endpoint); + +// +// Level Control Cluster client +// + +/** @brief Level Control Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfLevelControlClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief Level Control Cluster Client Attribute Changed + * + * Client Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + */ +void emberAfLevelControlClusterClientAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); + +/** @brief Level Control Cluster Client Manufacturer Specific Attribute Changed + * + * Client 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 emberAfLevelControlClusterClientManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); + +/** @brief Level Control Cluster Client Message Sent + * + * Client 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 emberAfLevelControlClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); + +/** @brief Level Control Cluster Client Pre Attribute Changed + * + * client 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 emberAfLevelControlClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint16_t size, + uint8_t * value); + +/** @brief Level Control Cluster Client Tick + * + * client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfLevelControlClusterClientTickCallback(chip::EndpointId endpoint); + // // Network Commissioning Cluster server // @@ -529,6 +791,221 @@ EmberAfStatus emberAfPumpConfigurationAndControlClusterClientPreAttributeChanged */ void emberAfPumpConfigurationAndControlClusterClientTickCallback(chip::EndpointId endpoint); +// +// Software Diagnostics Cluster server +// + +/** @brief Software Diagnostics Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfSoftwareDiagnosticsClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Software Diagnostics Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + */ +void emberAfSoftwareDiagnosticsClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); + +/** @brief Software Diagnostics 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 emberAfSoftwareDiagnosticsClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); + +/** @brief Software Diagnostics 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 emberAfSoftwareDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, + chip::MessageSendDestination destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); + +/** @brief Software Diagnostics 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 emberAfSoftwareDiagnosticsClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint16_t size, + uint8_t * value); + +/** @brief Software Diagnostics Cluster Server Tick + * + * server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfSoftwareDiagnosticsClusterServerTickCallback(chip::EndpointId endpoint); + +// +// Temperature Measurement Cluster client +// + +/** @brief Temperature Measurement Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfTemperatureMeasurementClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief Temperature Measurement Cluster Client Attribute Changed + * + * Client Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + */ +void emberAfTemperatureMeasurementClusterClientAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); + +/** @brief Temperature Measurement Cluster Client Manufacturer Specific Attribute Changed + * + * Client 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 emberAfTemperatureMeasurementClusterClientManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); + +/** @brief Temperature Measurement Cluster Client Message Sent + * + * Client 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 emberAfTemperatureMeasurementClusterClientMessageSentCallback(EmberOutgoingMessageType type, + chip::MessageSendDestination destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); + +/** @brief Temperature Measurement Cluster Client Pre Attribute Changed + * + * client 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 emberAfTemperatureMeasurementClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + EmberAfAttributeType attributeType, + uint16_t size, uint8_t * value); + +/** @brief Temperature Measurement Cluster Client Tick + * + * client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfTemperatureMeasurementClusterClientTickCallback(chip::EndpointId endpoint); + +// +// Temperature Measurement Cluster server +// + +/** @brief Temperature Measurement Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfTemperatureMeasurementClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Temperature Measurement Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + */ +void emberAfTemperatureMeasurementClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); + +/** @brief Temperature 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 emberAfTemperatureMeasurementClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); + +/** @brief Temperature 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 emberAfTemperatureMeasurementClusterServerMessageSentCallback(EmberOutgoingMessageType type, + chip::MessageSendDestination destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); + +/** @brief Temperature 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 emberAfTemperatureMeasurementClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + EmberAfAttributeType attributeType, + uint16_t size, uint8_t * value); + +/** @brief Temperature Measurement Cluster Server Tick + * + * server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfTemperatureMeasurementClusterServerTickCallback(chip::EndpointId endpoint); + // // Thread Network Diagnostics Cluster server // @@ -673,8 +1150,86 @@ EmberAfStatus emberAfTrustedRootCertificatesClusterServerPreAttributeChangedCall */ void emberAfTrustedRootCertificatesClusterServerTickCallback(chip::EndpointId endpoint); +// +// WiFi Network Diagnostics Cluster server +// + +/** @brief WiFi Network Diagnostics Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfWiFiNetworkDiagnosticsClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief WiFi Network Diagnostics Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + */ +void emberAfWiFiNetworkDiagnosticsClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); + +/** @brief WiFi Network Diagnostics 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 emberAfWiFiNetworkDiagnosticsClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); + +/** @brief WiFi Network Diagnostics 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 emberAfWiFiNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, + chip::MessageSendDestination destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); + +/** @brief WiFi Network Diagnostics 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 emberAfWiFiNetworkDiagnosticsClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + EmberAfAttributeType attributeType, + uint16_t size, uint8_t * value); + +/** @brief WiFi Network Diagnostics Cluster Server Tick + * + * server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfWiFiNetworkDiagnosticsClusterServerTickCallback(chip::EndpointId endpoint); + // Cluster Commands Callback +/** + * @brief Basic Cluster MfgSpecificPing Command callback + */ + +bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::Command * commandObj); + /** * @brief General Commissioning Cluster ArmFailSafe Command callback */ diff --git a/examples/pump-controller-app/pump-controller-common/gen/chip-zcl-zpro-codec-api.h b/examples/pump-controller-app/pump-controller-common/gen/chip-zcl-zpro-codec-api.h index bc96766948dae2..cf9fc973ab1429 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/chip-zcl-zpro-codec-api.h +++ b/examples/pump-controller-app/pump-controller-common/gen/chip-zcl-zpro-codec-api.h @@ -29,15 +29,69 @@ | Cluster Name | ID | |---------------------------------------------------------------------+--------| | Basic | 0x0028 | +| EthernetNetworkDiagnostics | 0x0037 | | GeneralCommissioning | 0x0030 | +| GeneralDiagnostics | 0x0033 | +| LevelControl | 0x0008 | | NetworkCommissioning | 0x0031 | | OnOff | 0x0006 | | OperationalCredentials | 0x003E | | PumpConfigurationAndControl | 0x0200 | +| SoftwareDiagnostics | 0x0034 | +| TemperatureMeasurement | 0x0402 | +| TemperatureMeasurement | 0x0402 | | ThreadNetworkDiagnostics | 0x0035 | | TrustedRootCertificates | 0x003F | +| WiFiNetworkDiagnostics | 0x0036 | \*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*\ +| Cluster LevelControl | 0x0008 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Move | 0x01 | +| * MoveToLevel | 0x00 | +| * MoveToLevelWithOnOff | 0x04 | +| * MoveWithOnOff | 0x05 | +| * Step | 0x02 | +| * StepWithOnOff | 0x06 | +| * Stop | 0x03 | +| * StopWithOnOff | 0x07 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * CurrentLevel | 0x0000 | +| * ClusterRevision | 0xFFFD | +\*----------------------------------------------------------------------------*/ + +/** + * @brief + * Encode a Level Control server discover command into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeLevelControlClusterDiscoverAttributes(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Level Control server read command for the current level attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeLevelControlClusterReadCurrentLevelAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Level Control server configure report command for the current level attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeLevelControlClusterConfigureCurrentLevelAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint, + uint16_t minInterval, uint16_t maxInterval, + uint8_t change); + +/** + * @brief + * Encode a Level Control server read command for the cluster revision attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeLevelControlClusterReadClusterRevisionAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + /*----------------------------------------------------------------------------*\ | Cluster OnOff | 0x0006 | |------------------------------------------------------------------------------| @@ -63,13 +117,6 @@ chip::System::PacketBufferHandle encodeOnOffClusterDiscoverAttributes(uint8_t se */ chip::System::PacketBufferHandle encodeOnOffClusterReadOnOffAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); -/** - * @brief - * Encode a On/off server configure report command for the on/off attribute into buffer including the APS frame - */ -chip::System::PacketBufferHandle encodeOnOffClusterConfigureOnOffAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, - uint16_t minInterval, uint16_t maxInterval); - /** * @brief * Encode a On/off server read command for the cluster revision attribute into buffer including the APS frame @@ -177,3 +224,59 @@ encodePumpConfigurationAndControlClusterWriteOperationModeAttribute(uint8_t seqN */ chip::System::PacketBufferHandle encodePumpConfigurationAndControlClusterReadClusterRevisionAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/*----------------------------------------------------------------------------*\ +| Cluster TemperatureMeasurement | 0x0402 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MeasuredValue | 0x0000 | +| * MinMeasuredValue | 0x0001 | +| * MaxMeasuredValue | 0x0002 | +| * ClusterRevision | 0xFFFD | +\*----------------------------------------------------------------------------*/ + +/** + * @brief + * Encode a Temperature Measurement server discover command into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTemperatureMeasurementClusterDiscoverAttributes(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Temperature Measurement server read command for the measured value attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle +encodeTemperatureMeasurementClusterReadMeasuredValueAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Temperature Measurement server configure report command for the measured value attribute into buffer including the + * APS frame + */ +chip::System::PacketBufferHandle +encodeTemperatureMeasurementClusterConfigureMeasuredValueAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, + uint16_t minInterval, uint16_t maxInterval, int16_t change); + +/** + * @brief + * Encode a Temperature Measurement server read command for the min measured value attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle +encodeTemperatureMeasurementClusterReadMinMeasuredValueAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Temperature Measurement server read command for the max measured value attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle +encodeTemperatureMeasurementClusterReadMaxMeasuredValueAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Temperature Measurement server read command for the cluster revision attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle +encodeTemperatureMeasurementClusterReadClusterRevisionAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); diff --git a/examples/pump-controller-app/pump-controller-common/gen/encoder.cpp b/examples/pump-controller-app/pump-controller-common/gen/encoder.cpp index 175986f4deae82..2c51a4d4c9bbe8 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/encoder.cpp +++ b/examples/pump-controller-app/pump-controller-common/gen/encoder.cpp @@ -55,13 +55,20 @@ using namespace chip::Encoding::LittleEndian; | Cluster Name | ID | |---------------------------------------------------------------------+--------| | Basic | 0x0028 | +| EthernetNetworkDiagnostics | 0x0037 | | GeneralCommissioning | 0x0030 | +| GeneralDiagnostics | 0x0033 | +| LevelControl | 0x0008 | | NetworkCommissioning | 0x0031 | | OnOff | 0x0006 | | OperationalCredentials | 0x003E | | PumpConfigurationAndControl | 0x0200 | +| SoftwareDiagnostics | 0x0034 | +| TemperatureMeasurement | 0x0402 | +| TemperatureMeasurement | 0x0402 | | ThreadNetworkDiagnostics | 0x0035 | | TrustedRootCertificates | 0x003F | +| WiFiNetworkDiagnostics | 0x0036 | \*----------------------------------------------------------------------------*/ #define EMBER_ZCL_REPORTING_DIRECTION_REPORTED 0x00 @@ -90,6 +97,16 @@ using namespace chip::Encoding::LittleEndian; #define ZCL_DISCOVER_ATTRIBUTES_EXTENDED_COMMAND_ID (0x15) #define ZCL_DISCOVER_ATTRIBUTES_EXTENDED_RESPONSE_COMMAND_ID (0x16) +#define LEVEL_CONTROL_CLUSTER_ID 0x0008 +#define ZCL_MOVE_COMMAND_ID (0x01) +#define ZCL_MOVE_TO_LEVEL_COMMAND_ID (0x00) +#define ZCL_MOVE_TO_LEVEL_WITH_ON_OFF_COMMAND_ID (0x04) +#define ZCL_MOVE_WITH_ON_OFF_COMMAND_ID (0x05) +#define ZCL_STEP_COMMAND_ID (0x02) +#define ZCL_STEP_WITH_ON_OFF_COMMAND_ID (0x06) +#define ZCL_STOP_COMMAND_ID (0x03) +#define ZCL_STOP_WITH_ON_OFF_COMMAND_ID (0x07) + #define ON_OFF_CLUSTER_ID 0x0006 #define ZCL_OFF_COMMAND_ID (0x00) #define ZCL_ON_COMMAND_ID (0x01) @@ -97,6 +114,8 @@ using namespace chip::Encoding::LittleEndian; #define PUMP_CONFIG_CONTROL_CLUSTER_ID 0x0200 +#define TEMP_MEASUREMENT_CLUSTER_ID 0x0402 + // TODO: Find a way to calculate maximum message length for clusters // https://github.com/project-chip/connectedhomeip/issues/965 constexpr uint16_t kMaxBufferSize = 1024; @@ -110,47 +129,94 @@ constexpr uint8_t kFrameControlGlobalCommand = 0x00; constexpr EndpointId kSourceEndpoint = 1; /*----------------------------------------------------------------------------*\ -| Cluster OnOff | 0x0006 | +| Cluster LevelControl | 0x0008 | |------------------------------------------------------------------------------| | Commands: | | -| * Off | 0x00 | -| * On | 0x01 | -| * Toggle | 0x02 | +| * Move | 0x01 | +| * MoveToLevel | 0x00 | +| * MoveToLevelWithOnOff | 0x04 | +| * MoveWithOnOff | 0x05 | +| * Step | 0x02 | +| * StepWithOnOff | 0x06 | +| * Stop | 0x03 | +| * StopWithOnOff | 0x07 | |------------------------------------------------------------------------------| | Attributes: | | -| * OnOff | 0x0000 | +| * CurrentLevel | 0x0000 | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ -PacketBufferHandle encodeOnOffClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint) +PacketBufferHandle encodeLevelControlClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint) { - COMMAND_HEADER("DiscoverOnOffAttributes", ON_OFF_CLUSTER_ID); + COMMAND_HEADER("DiscoverLevelControlAttributes", LEVEL_CONTROL_CLUSTER_ID); buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_DISCOVER_ATTRIBUTES_COMMAND_ID).Put16(0x0000).Put8(0xFF); COMMAND_FOOTER(); } /* - * Attribute OnOff + * Attribute CurrentLevel */ -PacketBufferHandle encodeOnOffClusterReadOnOffAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +PacketBufferHandle encodeLevelControlClusterReadCurrentLevelAttribute(uint8_t seqNum, EndpointId destinationEndpoint) { - COMMAND_HEADER("ReadOnOffOnOff", ON_OFF_CLUSTER_ID); + COMMAND_HEADER("ReadLevelControlCurrentLevel", LEVEL_CONTROL_CLUSTER_ID); buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0000); COMMAND_FOOTER(); } -PacketBufferHandle encodeOnOffClusterConfigureOnOffAttribute(uint8_t seqNum, EndpointId destinationEndpoint, uint16_t minInterval, - uint16_t maxInterval) +PacketBufferHandle encodeLevelControlClusterConfigureCurrentLevelAttribute(uint8_t seqNum, EndpointId destinationEndpoint, + uint16_t minInterval, uint16_t maxInterval, + uint8_t change) { - COMMAND_HEADER("ReportOnOffOnOff", ON_OFF_CLUSTER_ID); + COMMAND_HEADER("ReportLevelControlCurrentLevel", LEVEL_CONTROL_CLUSTER_ID); buf.Put8(kFrameControlGlobalCommand) .Put8(seqNum) .Put8(ZCL_CONFIGURE_REPORTING_COMMAND_ID) .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED) .Put16(0x0000) - .Put8(16) + .Put8(32) .Put16(minInterval) .Put16(maxInterval); + buf.Put8(static_cast(change)); + COMMAND_FOOTER(); +} + +/* + * Attribute ClusterRevision + */ +PacketBufferHandle encodeLevelControlClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadLevelControlClusterRevision", LEVEL_CONTROL_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0xFFFD); + COMMAND_FOOTER(); +} + +/*----------------------------------------------------------------------------*\ +| Cluster OnOff | 0x0006 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Off | 0x00 | +| * On | 0x01 | +| * Toggle | 0x02 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * OnOff | 0x0000 | +| * ClusterRevision | 0xFFFD | +\*----------------------------------------------------------------------------*/ + +PacketBufferHandle encodeOnOffClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("DiscoverOnOffAttributes", ON_OFF_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_DISCOVER_ATTRIBUTES_COMMAND_ID).Put16(0x0000).Put8(0xFF); + COMMAND_FOOTER(); +} + +/* + * Attribute OnOff + */ +PacketBufferHandle encodeOnOffClusterReadOnOffAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadOnOffOnOff", ON_OFF_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0000); COMMAND_FOOTER(); } @@ -302,3 +368,80 @@ PacketBufferHandle encodePumpConfigurationAndControlClusterReadClusterRevisionAt buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0xFFFD); COMMAND_FOOTER(); } + +/*----------------------------------------------------------------------------*\ +| Cluster TemperatureMeasurement | 0x0402 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MeasuredValue | 0x0000 | +| * MinMeasuredValue | 0x0001 | +| * MaxMeasuredValue | 0x0002 | +| * ClusterRevision | 0xFFFD | +\*----------------------------------------------------------------------------*/ + +PacketBufferHandle encodeTemperatureMeasurementClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("DiscoverTemperatureMeasurementAttributes", TEMP_MEASUREMENT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_DISCOVER_ATTRIBUTES_COMMAND_ID).Put16(0x0000).Put8(0xFF); + COMMAND_FOOTER(); +} + +/* + * Attribute MeasuredValue + */ +PacketBufferHandle encodeTemperatureMeasurementClusterReadMeasuredValueAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTemperatureMeasurementMeasuredValue", TEMP_MEASUREMENT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0000); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeTemperatureMeasurementClusterConfigureMeasuredValueAttribute(uint8_t seqNum, + EndpointId destinationEndpoint, + uint16_t minInterval, uint16_t maxInterval, + int16_t change) +{ + COMMAND_HEADER("ReportTemperatureMeasurementMeasuredValue", TEMP_MEASUREMENT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_CONFIGURE_REPORTING_COMMAND_ID) + .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED) + .Put16(0x0000) + .Put8(41) + .Put16(minInterval) + .Put16(maxInterval); + buf.Put16(static_cast(change)); + COMMAND_FOOTER(); +} + +/* + * Attribute MinMeasuredValue + */ +PacketBufferHandle encodeTemperatureMeasurementClusterReadMinMeasuredValueAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTemperatureMeasurementMinMeasuredValue", TEMP_MEASUREMENT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0001); + COMMAND_FOOTER(); +} + +/* + * Attribute MaxMeasuredValue + */ +PacketBufferHandle encodeTemperatureMeasurementClusterReadMaxMeasuredValueAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTemperatureMeasurementMaxMeasuredValue", TEMP_MEASUREMENT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0002); + COMMAND_FOOTER(); +} + +/* + * Attribute ClusterRevision + */ +PacketBufferHandle encodeTemperatureMeasurementClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTemperatureMeasurementClusterRevision", TEMP_MEASUREMENT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0xFFFD); + COMMAND_FOOTER(); +} diff --git a/examples/pump-controller-app/pump-controller-common/gen/endpoint_config.h b/examples/pump-controller-app/pump-controller-common/gen/endpoint_config.h index 1a5192cfddf29b..f92839472c68d5 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/endpoint_config.h +++ b/examples/pump-controller-app/pump-controller-common/gen/endpoint_config.h @@ -65,23 +65,46 @@ 1, 'o', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* 252 - Breadcrumb, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 1, Cluster: General Diagnostics (server), big-endian */ \ + \ + /* 260 - NetworkInterfaces, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 1, Cluster: Software Diagnostics (server), big-endian */ \ + \ + /* 514 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thread Network Diagnostics (server), big-endian */ \ \ - /* 260 - NetworkName, */ \ + /* 522 - NetworkName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 276 - ExtendedPanId, */ \ + /* 538 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 284 - MeshLocalPrefix, */ \ + /* 546 - MeshLocalPrefix, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 301 - OverrunCount, */ \ + /* 563 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 309 - NeighborTableList, */ \ + /* 571 - NeighborTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -97,7 +120,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 563 - RouteTableList, */ \ + /* 825 - RouteTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -113,117 +136,139 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 817 - PartitionId, */ \ + /* 1079 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 821 - TxTotalCount, */ \ + /* 1083 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 825 - TxUnicastCount, */ \ + /* 1087 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 829 - TxBroadcastCount, */ \ + /* 1091 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 833 - TxAckRequestedCount, */ \ + /* 1095 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 837 - TxAckedCount, */ \ + /* 1099 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 841 - TxNoAckRequestedCount, */ \ + /* 1103 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 845 - TxDataCount, */ \ + /* 1107 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 849 - TxDataPollCount, */ \ + /* 1111 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 853 - TxBeaconCount, */ \ + /* 1115 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 857 - TxBeaconRequestCount, */ \ + /* 1119 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 861 - TxOtherCount, */ \ + /* 1123 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 865 - TxRetryCount, */ \ + /* 1127 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 869 - TxDirectMaxRetryExpiryCount, */ \ + /* 1131 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 873 - TxIndirectMaxRetryExpiryCount, */ \ + /* 1135 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 877 - TxErrCcaCount, */ \ + /* 1139 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 881 - TxErrAbortCount, */ \ + /* 1143 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 885 - TxErrBusyChannelCount, */ \ + /* 1147 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 889 - RxTotalCount, */ \ + /* 1151 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 893 - RxUnicastCount, */ \ + /* 1155 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 897 - RxBroadcastCount, */ \ + /* 1159 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 901 - RxDataCount, */ \ + /* 1163 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 905 - RxDataPollCount, */ \ + /* 1167 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 909 - RxBeaconCount, */ \ + /* 1171 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 913 - RxBeaconRequestCount, */ \ + /* 1175 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 917 - RxOtherCount, */ \ + /* 1179 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 921 - RxAddressFilteredCount, */ \ + /* 1183 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 925 - RxDestAddrFilteredCount, */ \ + /* 1187 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 929 - RxDuplicatedCount, */ \ + /* 1191 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 933 - RxErrNoFrameCount, */ \ + /* 1195 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 937 - RxErrUnknownNeighborCount, */ \ + /* 1199 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 941 - RxErrInvalidSrcAddrCount, */ \ + /* 1203 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 945 - RxErrSecCount, */ \ + /* 1207 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 949 - RxErrFcsCount, */ \ + /* 1211 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 953 - RxErrOtherCount, */ \ + /* 1215 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 957 - ActiveNetworkFaultsList, */ \ + /* 1219 - ActiveNetworkFaultsList, */ \ 0x00, 0x00, 0x00, 0x00, \ \ + /* Endpoint: 1, Cluster: WiFi Network Diagnostics (server), big-endian */ \ + \ + /* 1223 - bssid, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 1, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ + \ + /* 1229 - PacketRxCount, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 1237 - PacketTxCount, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 1245 - TxErrCount, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 1253 - CollisionCount, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 1261 - OverrunCount, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 1, Cluster: Operational Credentials (server), big-endian */ \ \ - /* 961 - fabrics list, */ \ + /* 1269 - fabrics list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -282,23 +327,46 @@ 1, 'o', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* 252 - Breadcrumb, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 1, Cluster: General Diagnostics (server), little-endian */ \ + \ + /* 260 - NetworkInterfaces, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 1, Cluster: Software Diagnostics (server), little-endian */ \ + \ + /* 514 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thread Network Diagnostics (server), little-endian */ \ \ - /* 260 - NetworkName, */ \ + /* 522 - NetworkName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 276 - ExtendedPanId, */ \ + /* 538 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 284 - MeshLocalPrefix, */ \ + /* 546 - MeshLocalPrefix, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 301 - OverrunCount, */ \ + /* 563 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 309 - NeighborTableList, */ \ + /* 571 - NeighborTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -314,7 +382,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 563 - RouteTableList, */ \ + /* 825 - RouteTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -330,117 +398,139 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 817 - PartitionId, */ \ + /* 1079 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 821 - TxTotalCount, */ \ + /* 1083 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 825 - TxUnicastCount, */ \ + /* 1087 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 829 - TxBroadcastCount, */ \ + /* 1091 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 833 - TxAckRequestedCount, */ \ + /* 1095 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 837 - TxAckedCount, */ \ + /* 1099 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 841 - TxNoAckRequestedCount, */ \ + /* 1103 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 845 - TxDataCount, */ \ + /* 1107 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 849 - TxDataPollCount, */ \ + /* 1111 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 853 - TxBeaconCount, */ \ + /* 1115 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 857 - TxBeaconRequestCount, */ \ + /* 1119 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 861 - TxOtherCount, */ \ + /* 1123 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 865 - TxRetryCount, */ \ + /* 1127 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 869 - TxDirectMaxRetryExpiryCount, */ \ + /* 1131 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 873 - TxIndirectMaxRetryExpiryCount, */ \ + /* 1135 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 877 - TxErrCcaCount, */ \ + /* 1139 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 881 - TxErrAbortCount, */ \ + /* 1143 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 885 - TxErrBusyChannelCount, */ \ + /* 1147 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 889 - RxTotalCount, */ \ + /* 1151 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 893 - RxUnicastCount, */ \ + /* 1155 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 897 - RxBroadcastCount, */ \ + /* 1159 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 901 - RxDataCount, */ \ + /* 1163 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 905 - RxDataPollCount, */ \ + /* 1167 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 909 - RxBeaconCount, */ \ + /* 1171 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 913 - RxBeaconRequestCount, */ \ + /* 1175 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 917 - RxOtherCount, */ \ + /* 1179 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 921 - RxAddressFilteredCount, */ \ + /* 1183 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 925 - RxDestAddrFilteredCount, */ \ + /* 1187 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 929 - RxDuplicatedCount, */ \ + /* 1191 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 933 - RxErrNoFrameCount, */ \ + /* 1195 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 937 - RxErrUnknownNeighborCount, */ \ + /* 1199 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 941 - RxErrInvalidSrcAddrCount, */ \ + /* 1203 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 945 - RxErrSecCount, */ \ + /* 1207 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 949 - RxErrFcsCount, */ \ + /* 1211 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 953 - RxErrOtherCount, */ \ + /* 1215 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 957 - ActiveNetworkFaultsList, */ \ + /* 1219 - ActiveNetworkFaultsList, */ \ 0x00, 0x00, 0x00, 0x00, \ \ + /* Endpoint: 1, Cluster: WiFi Network Diagnostics (server), little-endian */ \ + \ + /* 1223 - bssid, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 1, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ + \ + /* 1229 - PacketRxCount, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 1237 - PacketTxCount, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 1245 - TxErrCount, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 1253 - CollisionCount, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 1261 - OverrunCount, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 1, Cluster: Operational Credentials (server), little-endian */ \ \ - /* 961 - fabrics list, */ \ + /* 1269 - fabrics list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -459,7 +549,7 @@ #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (52) +#define GENERATED_DEFAULTS_COUNT (60) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -487,13 +577,16 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 82 +#define GENERATED_ATTRIBUTE_COUNT 105 #define GENERATED_ATTRIBUTES \ { \ \ /* Endpoint: 1, Cluster: On/off (client) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(2) }, /* cluster revision */ \ \ + /* Endpoint: 1, Cluster: Level Control (client) */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(3) }, /* cluster revision */ \ + \ /* Endpoint: 1, Cluster: Basic (server) */ \ { 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* InteractionModelVersion */ \ { 0x0001, ZAP_TYPE(CHAR_STRING), 32, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(0) }, /* VendorName */ \ @@ -520,17 +613,26 @@ /* Endpoint: 1, Cluster: Network Commissioning (server) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ + /* Endpoint: 1, Cluster: General Diagnostics (server) */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(260) }, /* NetworkInterfaces */ \ + { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ + \ + /* Endpoint: 1, Cluster: Software Diagnostics (server) */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(514) }, /* CurrentHeapHighWatermark */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ + \ /* Endpoint: 1, Cluster: Thread Network Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x0002, ZAP_TYPE(OCTET_STRING), 16, 0, ZAP_LONG_DEFAULTS_INDEX(260) }, /* NetworkName */ \ + { 0x0002, ZAP_TYPE(OCTET_STRING), 16, 0, ZAP_LONG_DEFAULTS_INDEX(522) }, /* NetworkName */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(276) }, /* ExtendedPanId */ \ - { 0x0005, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(284) }, /* MeshLocalPrefix */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(301) }, /* OverrunCount */ \ - { 0x0007, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(309) }, /* NeighborTableList */ \ - { 0x0008, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(563) }, /* RouteTableList */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(817) }, /* PartitionId */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(538) }, /* ExtendedPanId */ \ + { 0x0005, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(546) }, /* MeshLocalPrefix */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(563) }, /* OverrunCount */ \ + { 0x0007, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(571) }, /* NeighborTableList */ \ + { 0x0008, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(825) }, /* RouteTableList */ \ + { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1079) }, /* PartitionId */ \ { 0x000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ { 0x000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ { 0x000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ @@ -543,55 +645,80 @@ { 0x0013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ { 0x0014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ { 0x0015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x0016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(821) }, /* TxTotalCount */ \ - { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(825) }, /* TxUnicastCount */ \ - { 0x0018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(829) }, /* TxBroadcastCount */ \ - { 0x0019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(833) }, /* TxAckRequestedCount */ \ - { 0x001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(837) }, /* TxAckedCount */ \ - { 0x001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(841) }, /* TxNoAckRequestedCount */ \ - { 0x001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(845) }, /* TxDataCount */ \ - { 0x001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(849) }, /* TxDataPollCount */ \ - { 0x001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(853) }, /* TxBeaconCount */ \ - { 0x001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(857) }, /* TxBeaconRequestCount */ \ - { 0x0020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(861) }, /* TxOtherCount */ \ - { 0x0021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(865) }, /* TxRetryCount */ \ - { 0x0022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(869) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x0023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(873) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x0024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(877) }, /* TxErrCcaCount */ \ - { 0x0025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(881) }, /* TxErrAbortCount */ \ - { 0x0026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(885) }, /* TxErrBusyChannelCount */ \ - { 0x0027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(889) }, /* RxTotalCount */ \ - { 0x0028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(893) }, /* RxUnicastCount */ \ - { 0x0029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(897) }, /* RxBroadcastCount */ \ - { 0x002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(901) }, /* RxDataCount */ \ - { 0x002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(905) }, /* RxDataPollCount */ \ - { 0x002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(909) }, /* RxBeaconCount */ \ - { 0x002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(913) }, /* RxBeaconRequestCount */ \ - { 0x002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(917) }, /* RxOtherCount */ \ - { 0x002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(921) }, /* RxAddressFilteredCount */ \ - { 0x0030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(925) }, /* RxDestAddrFilteredCount */ \ - { 0x0031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(929) }, /* RxDuplicatedCount */ \ - { 0x0032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(933) }, /* RxErrNoFrameCount */ \ - { 0x0033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(937) }, /* RxErrUnknownNeighborCount */ \ - { 0x0034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(941) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x0035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(945) }, /* RxErrSecCount */ \ - { 0x0036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(949) }, /* RxErrFcsCount */ \ - { 0x0037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(953) }, /* RxErrOtherCount */ \ + { 0x0016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1083) }, /* TxTotalCount */ \ + { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1087) }, /* TxUnicastCount */ \ + { 0x0018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1091) }, /* TxBroadcastCount */ \ + { 0x0019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1095) }, /* TxAckRequestedCount */ \ + { 0x001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1099) }, /* TxAckedCount */ \ + { 0x001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1103) }, /* TxNoAckRequestedCount */ \ + { 0x001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1107) }, /* TxDataCount */ \ + { 0x001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1111) }, /* TxDataPollCount */ \ + { 0x001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1115) }, /* TxBeaconCount */ \ + { 0x001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1119) }, /* TxBeaconRequestCount */ \ + { 0x0020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1123) }, /* TxOtherCount */ \ + { 0x0021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1127) }, /* TxRetryCount */ \ + { 0x0022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1131) }, /* TxDirectMaxRetryExpiryCount */ \ + { 0x0023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1135) }, /* TxIndirectMaxRetryExpiryCount */ \ + { 0x0024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1139) }, /* TxErrCcaCount */ \ + { 0x0025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1143) }, /* TxErrAbortCount */ \ + { 0x0026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1147) }, /* TxErrBusyChannelCount */ \ + { 0x0027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1151) }, /* RxTotalCount */ \ + { 0x0028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1155) }, /* RxUnicastCount */ \ + { 0x0029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1159) }, /* RxBroadcastCount */ \ + { 0x002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1163) }, /* RxDataCount */ \ + { 0x002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1167) }, /* RxDataPollCount */ \ + { 0x002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1171) }, /* RxBeaconCount */ \ + { 0x002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1175) }, /* RxBeaconRequestCount */ \ + { 0x002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1179) }, /* RxOtherCount */ \ + { 0x002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1183) }, /* RxAddressFilteredCount */ \ + { 0x0030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1187) }, /* RxDestAddrFilteredCount */ \ + { 0x0031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1191) }, /* RxDuplicatedCount */ \ + { 0x0032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1195) }, /* RxErrNoFrameCount */ \ + { 0x0033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1199) }, /* RxErrUnknownNeighborCount */ \ + { 0x0034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1203) }, /* RxErrInvalidSrcAddrCount */ \ + { 0x0035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1207) }, /* RxErrSecCount */ \ + { 0x0036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1211) }, /* RxErrFcsCount */ \ + { 0x0037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1215) }, /* RxErrOtherCount */ \ { 0x003B, ZAP_TYPE(ARRAY), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SecurityPolicy */ \ { 0x003C, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelMask */ \ { 0x003D, ZAP_TYPE(ARRAY), 1, 0, ZAP_EMPTY_DEFAULT() }, /* OperationalDatasetComponents */ \ - { 0x003E, ZAP_TYPE(ARRAY), 4, 0, ZAP_LONG_DEFAULTS_INDEX(957) }, /* ActiveNetworkFaultsList */ \ + { 0x003E, ZAP_TYPE(ARRAY), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1219) }, /* ActiveNetworkFaultsList */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ - /* Endpoint: 1, Cluster: Operational Credentials (server) */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(961) }, /* fabrics list */ \ + /* Endpoint: 1, Cluster: WiFi Network Diagnostics (server) */ \ + { 0x0000, ZAP_TYPE(OCTET_STRING), 6, 0, ZAP_LONG_DEFAULTS_INDEX(1223) }, /* bssid */ \ + { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SecurityType */ \ + { 0x0002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ + { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ + { 0x0004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ + \ + /* Endpoint: 1, Cluster: Ethernet Network Diagnostics (server) */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1229) }, /* PacketRxCount */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1237) }, /* PacketTxCount */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1245) }, /* TxErrCount */ \ + { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1253) }, /* CollisionCount */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1261) }, /* OverrunCount */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ + /* Endpoint: 1, Cluster: Operational Credentials (server) */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1269) }, /* fabrics list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ + \ /* Endpoint: 1, Cluster: Trusted Root Certificates (server) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (client) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ + \ + /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ + { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* measured value */ \ + { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* min measured value */ \ + { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* max measured value */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* cluster revision */ \ + \ + /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(3) }, /* cluster revision */ \ } // This is an array of EmberAfCluster structures. @@ -604,34 +731,55 @@ }; #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 8 +#define GENERATED_CLUSTER_COUNT 15 #define GENERATED_CLUSTERS \ { \ { 0x0006, ZAP_ATTRIBUTE_INDEX(0), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: On/off (client) */ \ + { \ + 0x0008, ZAP_ATTRIBUTE_INDEX(1), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 1, Cluster: Level Control (client) */ \ { 0x0028, \ - ZAP_ATTRIBUTE_INDEX(1), \ + ZAP_ATTRIBUTE_INDEX(2), \ 12, \ 254, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayBasicServer }, /* Endpoint: 1, Cluster: Basic (server) */ \ { \ - 0x0030, ZAP_ATTRIBUTE_INDEX(13), 3, 18, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0030, ZAP_ATTRIBUTE_INDEX(14), 3, 18, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: General Commissioning (server) */ \ { \ - 0x0031, ZAP_ATTRIBUTE_INDEX(16), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0031, ZAP_ATTRIBUTE_INDEX(17), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Network Commissioning (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(17), 61, 730, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0033, ZAP_ATTRIBUTE_INDEX(18), 3, 258, ZAP_CLUSTER_MASK(SERVER), NULL \ + }, /* Endpoint: 1, Cluster: General Diagnostics (server) */ \ + { \ + 0x0034, ZAP_ATTRIBUTE_INDEX(21), 2, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + }, /* Endpoint: 1, Cluster: Software Diagnostics (server) */ \ + { \ + 0x0035, ZAP_ATTRIBUTE_INDEX(23), 61, 730, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Thread Network Diagnostics (server) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(78), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0036, ZAP_ATTRIBUTE_INDEX(84), 6, 13, ZAP_CLUSTER_MASK(SERVER), NULL \ + }, /* Endpoint: 1, Cluster: WiFi Network Diagnostics (server) */ \ + { \ + 0x0037, ZAP_ATTRIBUTE_INDEX(90), 6, 42, ZAP_CLUSTER_MASK(SERVER), NULL \ + }, /* Endpoint: 1, Cluster: Ethernet Network Diagnostics (server) */ \ + { \ + 0x003E, ZAP_ATTRIBUTE_INDEX(96), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Operational Credentials (server) */ \ { \ - 0x003F, ZAP_ATTRIBUTE_INDEX(80), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003F, ZAP_ATTRIBUTE_INDEX(98), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Trusted Root Certificates (server) */ \ { \ - 0x0200, ZAP_ATTRIBUTE_INDEX(81), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0200, ZAP_ATTRIBUTE_INDEX(99), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (client) */ \ + { \ + 0x0402, ZAP_ATTRIBUTE_INDEX(100), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ + { \ + 0x0402, ZAP_ATTRIBUTE_INDEX(104), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \ } #define ZAP_CLUSTER_INDEX(index) ((EmberAfCluster *) (&generatedClusters[index])) @@ -639,7 +787,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 8, 1266 }, \ + { ZAP_CLUSTER_INDEX(0), 15, 1601 }, \ } // Largest attribute size is needed for various buffers @@ -649,7 +797,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (254) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (1266) +#define ATTRIBUTE_MAX_SIZE (1601) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (1) @@ -664,7 +812,7 @@ // Array of profile ids #define FIXED_PROFILE_IDS \ { \ - 0x0104 \ + 0x0999 \ } // Array of device ids @@ -693,7 +841,7 @@ // Array of EmberAfCommandMetadata structs. #define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (40) +#define EMBER_AF_GENERATED_COMMAND_COUNT (52) #define GENERATED_COMMANDS \ { \ \ @@ -702,10 +850,21 @@ { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On */ \ { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Toggle */ \ \ + /* Endpoint: 1, Cluster: Level Control (client) */ \ + { 0x0008, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevel */ \ + { 0x0008, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Move */ \ + { 0x0008, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Step */ \ + { 0x0008, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Stop */ \ + { 0x0008, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevelWithOnOff */ \ + { 0x0008, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveWithOnOff */ \ + { 0x0008, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepWithOnOff */ \ + { 0x0008, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StopWithOnOff */ \ + \ /* Endpoint: 1, Cluster: Basic (server) */ \ { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* StartUp */ \ { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ShutDown */ \ { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Leave */ \ + { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MfgSpecificPing */ \ \ /* Endpoint: 1, Cluster: General Commissioning (server) */ \ { 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ArmFailSafe */ \ @@ -734,6 +893,15 @@ { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* DisableNetworkResponse */ \ { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ \ + /* Endpoint: 1, Cluster: Software Diagnostics (server) */ \ + { 0x0034, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetWatermarks */ \ + \ + /* Endpoint: 1, Cluster: Thread Network Diagnostics (server) */ \ + { 0x0035, 0x00, 0 }, /* ResetCounts */ \ + \ + /* Endpoint: 1, Cluster: Ethernet Network Diagnostics (server) */ \ + { 0x0037, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ResetCounts */ \ + \ /* Endpoint: 1, Cluster: Operational Credentials (server) */ \ { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetFabric */ \ { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* SetFabricResponse */ \ @@ -751,12 +919,10 @@ } // Array of EmberAfManufacturerCodeEntry structures for commands. -#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (0) +#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (1) #define GENERATED_COMMAND_MANUFACTURER_CODES \ { \ - { \ - 0x00, 0x00 \ - } \ + { 14, 4098 }, \ } // This is an array of EmberAfManufacturerCodeEntry structures for clusters. @@ -782,10 +948,15 @@ #define ZAP_REPORT_DIRECTION(x) ZRD(x) // User options for plugin Reporting -#define EMBER_AF_PLUGIN_REPORTING_TABLE_SIZE (0) +#define EMBER_AF_PLUGIN_REPORTING_TABLE_SIZE (1) #define EMBER_AF_PLUGIN_REPORTING_ENABLE_GROUP_BOUND_REPORTS -#define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE (0) +#define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE (1) #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS \ { \ + \ + /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ + { \ + ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0402, 0x0000, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ + }, /* measured value */ \ } diff --git a/examples/pump-controller-app/pump-controller-common/gen/gen_config.h b/examples/pump-controller-app/pump-controller-common/gen/gen_config.h index d0367c8cad7527..df7fe6b2472aee 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/gen_config.h +++ b/examples/pump-controller-app/pump-controller-common/gen/gen_config.h @@ -30,13 +30,20 @@ /**** Cluster endpoint counts ****/ #define EMBER_AF_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_GENERAL_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_GENERAL_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_LEVEL_CONTROL_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_ON_OFF_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_PUMP_CONFIG_CONTROL_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_TRUSTED_ROOT_CERTIFICATES_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) /**** Cluster Plugins ****/ @@ -45,11 +52,25 @@ #define EMBER_AF_PLUGIN_BASIC_SERVER #define EMBER_AF_PLUGIN_BASIC +// Use this macro to check if the server side of the Ethernet Network Diagnostics cluster is included +#define ZCL_USING_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_ETHERNET_NETWORK_DIAGNOSTICS_SERVER +#define EMBER_AF_PLUGIN_ETHERNET_NETWORK_DIAGNOSTICS + // Use this macro to check if the server side of the General Commissioning cluster is included #define ZCL_USING_GENERAL_COMMISSIONING_CLUSTER_SERVER #define EMBER_AF_PLUGIN_GENERAL_COMMISSIONING_SERVER #define EMBER_AF_PLUGIN_GENERAL_COMMISSIONING +// Use this macro to check if the server side of the General Diagnostics cluster is included +#define ZCL_USING_GENERAL_DIAGNOSTICS_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_GENERAL_DIAGNOSTICS_SERVER +#define EMBER_AF_PLUGIN_GENERAL_DIAGNOSTICS + +// Use this macro to check if the client side of the Level Control cluster is included +#define ZCL_USING_LEVEL_CONTROL_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_LEVEL_CONTROL_CLIENT + // Use this macro to check if the server side of the Network Commissioning cluster is included #define ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_SERVER #define EMBER_AF_PLUGIN_NETWORK_COMMISSIONING_SERVER @@ -68,6 +89,20 @@ #define ZCL_USING_PUMP_CONFIG_CONTROL_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_PUMP_CONFIGURATION_AND_CONTROL_CLIENT +// Use this macro to check if the server side of the Software Diagnostics cluster is included +#define ZCL_USING_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_SOFTWARE_DIAGNOSTICS_SERVER +#define EMBER_AF_PLUGIN_SOFTWARE_DIAGNOSTICS + +// Use this macro to check if the client side of the Temperature Measurement cluster is included +#define ZCL_USING_TEMP_MEASUREMENT_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_TEMPERATURE_MEASUREMENT_CLIENT + +// Use this macro to check if the server side of the Temperature Measurement cluster is included +#define ZCL_USING_TEMP_MEASUREMENT_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_TEMPERATURE_MEASUREMENT_SERVER +#define EMBER_AF_PLUGIN_TEMPERATURE_MEASUREMENT + // Use this macro to check if the server side of the Thread Network Diagnostics cluster is included #define ZCL_USING_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_SERVER #define EMBER_AF_PLUGIN_THREAD_NETWORK_DIAGNOSTICS_SERVER @@ -77,3 +112,8 @@ #define ZCL_USING_TRUSTED_ROOT_CERTIFICATES_CLUSTER_SERVER #define EMBER_AF_PLUGIN_TRUSTED_ROOT_CERTIFICATES_SERVER #define EMBER_AF_PLUGIN_TRUSTED_ROOT_CERTIFICATES + +// Use this macro to check if the server side of the WiFi Network Diagnostics cluster is included +#define ZCL_USING_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_WI_FI_NETWORK_DIAGNOSTICS_SERVER +#define EMBER_AF_PLUGIN_WI_FI_NETWORK_DIAGNOSTICS diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap index 9dcd722ab2cd08..616662103d88a3 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap @@ -32,159 +32,10 @@ "endpointTypes": [ { "name": "Anonymous Endpoint Type", - "deviceTypeName": "HA-pumpcontroller", + "deviceTypeName": "Pump Controller", "deviceTypeCode": 772, - "deviceTypeProfileId": 260, + "deviceTypeProfileId": 2457, "clusters": [ - { - "name": "Power Configuration", - "code": 1, - "mfgCode": null, - "define": "POWER_CONFIG_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": "Power Configuration", - "code": 1, - "mfgCode": null, - "define": "POWER_CONFIG_CLUSTER", - "side": "server", - "enabled": 0, - "commands": [], - "attributes": [ - { - "name": "battery percentage remaining", - "code": 33, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "battery alarm state", - "code": 62, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00000000", - "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": "Device Temperature Configuration", - "code": 2, - "mfgCode": null, - "define": "DEVICE_TEMP_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": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Device Temperature Configuration", - "code": 2, - "mfgCode": null, - "define": "DEVICE_TEMP_CLUSTER", - "side": "server", - "enabled": 0, - "commands": [], - "attributes": [ - { - "name": "current temperature", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Identify", "code": 3, @@ -199,7 +50,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "IdentifyQuery", @@ -207,7 +58,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 } ], "attributes": [ @@ -241,7 +92,7 @@ "code": 0, "mfgCode": null, "source": "server", - "incoming": 0, + "incoming": 1, "outgoing": 1 } ], @@ -291,48 +142,48 @@ "code": 0, "mfgCode": null, "source": "client", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 }, { "name": "ViewGroup", "code": 1, "mfgCode": null, "source": "client", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 }, { "name": "GetGroupMembership", "code": 2, "mfgCode": null, "source": "client", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 }, { "name": "RemoveGroup", "code": 3, "mfgCode": null, "source": "client", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 }, { "name": "RemoveAllGroups", "code": 4, "mfgCode": null, "source": "client", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 }, { "name": "AddGroupIfIdentifying", "code": 5, "mfgCode": null, "source": "client", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 } ], "attributes": [ @@ -366,32 +217,32 @@ "code": 0, "mfgCode": null, "source": "server", - "incoming": 0, - "outgoing": 1 + "incoming": 1, + "outgoing": 0 }, { "name": "ViewGroupResponse", "code": 1, "mfgCode": null, "source": "server", - "incoming": 0, - "outgoing": 1 + "incoming": 1, + "outgoing": 0 }, { "name": "GetGroupMembershipResponse", "code": 2, "mfgCode": null, "source": "server", - "incoming": 0, - "outgoing": 1 + "incoming": 1, + "outgoing": 0 }, { "name": "RemoveGroupResponse", "code": 3, "mfgCode": null, "source": "server", - "incoming": 0, - "outgoing": 1 + "incoming": 1, + "outgoing": 0 } ], "attributes": [ @@ -440,56 +291,56 @@ "code": 0, "mfgCode": null, "source": "client", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 }, { "name": "ViewScene", "code": 1, "mfgCode": null, "source": "client", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 }, { "name": "RemoveScene", "code": 2, "mfgCode": null, "source": "client", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 }, { "name": "RemoveAllScenes", "code": 3, "mfgCode": null, "source": "client", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 }, { "name": "StoreScene", "code": 4, "mfgCode": null, "source": "client", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 }, { "name": "RecallScene", "code": 5, "mfgCode": null, "source": "client", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 }, { "name": "GetSceneMembership", "code": 6, "mfgCode": null, "source": "client", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 } ], "attributes": [ @@ -523,48 +374,48 @@ "code": 0, "mfgCode": null, "source": "server", - "incoming": 0, - "outgoing": 1 + "incoming": 1, + "outgoing": 0 }, { "name": "ViewSceneResponse", "code": 1, "mfgCode": null, "source": "server", - "incoming": 0, - "outgoing": 1 + "incoming": 1, + "outgoing": 0 }, { "name": "RemoveSceneResponse", "code": 2, "mfgCode": null, "source": "server", - "incoming": 0, - "outgoing": 1 + "incoming": 1, + "outgoing": 0 }, { "name": "RemoveAllScenesResponse", "code": 3, "mfgCode": null, "source": "server", - "incoming": 0, - "outgoing": 1 + "incoming": 1, + "outgoing": 0 }, { "name": "StoreSceneResponse", "code": 4, "mfgCode": null, "source": "server", - "incoming": 0, - "outgoing": 1 + "incoming": 1, + "outgoing": 0 }, { "name": "GetSceneMembershipResponse", "code": 6, "mfgCode": null, "source": "server", - "incoming": 0, - "outgoing": 1 + "incoming": 1, + "outgoing": 0 } ], "attributes": [ @@ -730,7 +581,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x00", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -753,41 +604,89 @@ ] }, { - "name": "Alarms", - "code": 9, + "name": "Level Control", + "code": 8, "mfgCode": null, - "define": "ALARM_CLUSTER", + "define": "LEVEL_CONTROL_CLUSTER", "side": "client", - "enabled": 0, + "enabled": 1, "commands": [ { - "name": "ResetAlarm", + "name": "MoveToLevel", "code": 0, "mfgCode": null, "source": "client", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 }, { - "name": "ResetAllAlarms", + "name": "Move", "code": 1, "mfgCode": null, "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ + "incoming": 0, + "outgoing": 1 + }, { - "name": "cluster revision", - "code": 65533, + "name": "Step", + "code": 2, "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "Stop", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "MoveToLevelWithOnOff", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "MoveWithOnOff", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "StepWithOnOff", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "StopWithOnOff", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -796,23 +695,29 @@ ] }, { - "name": "Alarms", - "code": 9, + "name": "Level Control", + "code": 8, "mfgCode": null, - "define": "ALARM_CLUSTER", + "define": "LEVEL_CONTROL_CLUSTER", "side": "server", "enabled": 0, - "commands": [ + "commands": [], + "attributes": [ { - "name": "Alarm", + "name": "current level", "code": 0, "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - } - ], - "attributes": [ + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, { "name": "cluster revision", "code": 65533, @@ -822,7 +727,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -831,25 +736,17 @@ ] }, { - "name": "Commissioning", - "code": 21, + "name": "Basic", + "code": 40, "mfgCode": null, - "define": "COMMISSIONING_CLUSTER", + "define": "BASIC_CLUSTER", "side": "client", "enabled": 0, "commands": [ { - "name": "RestartDevice", + "name": "MfgSpecificPing", "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "ResetStartupParameters", - "code": 3, - "mfgCode": null, + "mfgCode": 4098, "source": "client", "incoming": 1, "outgoing": 0 @@ -863,9 +760,9 @@ "side": "client", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -874,15 +771,15 @@ ] }, { - "name": "Commissioning", - "code": 21, + "name": "Basic", + "code": 40, "mfgCode": null, - "define": "COMMISSIONING_CLUSTER", + "define": "BASIC_CLUSTER", "side": "server", - "enabled": 0, + "enabled": 1, "commands": [ { - "name": "RestartDeviceResponse", + "name": "StartUp", "code": 0, "mfgCode": null, "source": "server", @@ -890,7 +787,7 @@ "outgoing": 1 }, { - "name": "SaveStartupParametersResponse", + "name": "ShutDown", "code": 1, "mfgCode": null, "source": "server", @@ -898,311 +795,557 @@ "outgoing": 1 }, { - "name": "RestoreStartupParametersResponse", + "name": "Leave", "code": 2, "mfgCode": null, "source": "server", "incoming": 0, "outgoing": 1 - }, - { - "name": "ResetStartupParametersResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 } ], "attributes": [ { - "name": "short address", + "name": "InteractionModelVersion", "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0xFFFF", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "extended pan id", + "name": "VendorName", "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0xFFFFFFFFFFFFFFFF", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "pan id", + "name": "VendorID", "code": 2, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0xFFFF", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "channel mask", + "name": "ProductName", "code": 3, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0x07FFF800", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "protocol version", + "name": "ProductID", "code": 4, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0x02", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "stack profile", + "name": "UserLabel", "code": 5, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0x02", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "startup control", + "name": "Location", "code": 6, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0x03", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "trust center address", - "code": 16, + "name": "HardwareVersion", + "code": 7, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0x0000000000000000", + "defaultValue": "0x00", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "network key", - "code": 18, + "name": "HardwareVersionString", + "code": 8, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0x00000000000000000000000000000000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "use insecure join", - "code": 19, + "name": "SoftwareVersion", + "code": 9, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "0x00", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "preconfigured link key", - "code": 20, + "name": "SoftwareVersionString", + "code": 10, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0x00000000000000000000000000000000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "network key sequence number", - "code": 21, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 0, + "singleton": 1, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 }, { - "name": "network key type", - "code": 22, + "name": "SetRegulatoryConfig", + "code": 2, "mfgCode": null, - "side": "server", + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "client", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x05", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 }, { - "name": "network manager address", - "code": 23, + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FabricId", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "o", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "scan attempts", - "code": 32, + "name": "Breadcrumb", + "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x05", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "time between scans", - "code": 33, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0064", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, - { - "name": "rejoin interval", - "code": 34, + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, "mfgCode": null, - "side": "server", + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddWiFiNetwork", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "UpdateWiFiNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddThreadNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "UpdateThreadNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveNetwork", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "EnableNetwork", + "code": 12, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "DisableNetwork", + "code": 14, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetLastNetworkCommissioningResult", + "code": 16, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "client", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x003C", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 }, { - "name": "max rejoin interval", - "code": 35, + "name": "AddWiFiNetworkResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "UpdateWiFiNetworkResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "AddThreadNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "UpdateThreadNetworkResponse", + "code": 9, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveNetworkResponse", + "code": 11, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "EnableNetworkResponse", + "code": 13, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "DisableNetworkResponse", + "code": 15, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0E10", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [ { - "name": "indirect poll rate", - "code": 48, + "name": "cluster revision", + "code": 65533, "mfgCode": null, - "side": "server", + "side": "client", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ { - "name": "parent retry threshold", - "code": 49, + "name": "NetworkInterfaces", + "code": 0, "mfgCode": null, "side": "server", "included": 1, @@ -1216,45 +1359,91 @@ "reportableChange": 0 }, { - "name": "concentrator flag", - "code": 64, + "name": "RebootCount", + "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "concentrator radius", - "code": 65, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0F", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ { - "name": "concentrator discovery time", - "code": 66, + "name": "ResetWatermarks", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ + { + "name": "CurrentHeapHighWatermark", + "code": 3, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0x0000000000000000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -1269,7 +1458,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -1278,13 +1467,22 @@ ] }, { - "name": "Basic", - "code": 40, + "name": "Thread Network Diagnostics", + "code": 53, "mfgCode": null, - "define": "BASIC_CLUSTER", + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", "side": "client", "enabled": 0, - "commands": [], + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 0 + } + ], "attributes": [ { "name": "cluster revision", @@ -1293,9 +1491,9 @@ "side": "client", "included": 1, "storageOption": "RAM", - "singleton": 1, + "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -1304,92 +1502,127 @@ ] }, { - "name": "Basic", - "code": 40, + "name": "Thread Network Diagnostics", + "code": 53, "mfgCode": null, - "define": "BASIC_CLUSTER", + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", "side": "server", "enabled": 1, - "commands": [ + "commands": [], + "attributes": [ { - "name": "StartUp", + "name": "channel", "code": 0, "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "ShutDown", + "name": "RoutingRole", "code": 1, "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "Leave", + "name": "NetworkName", "code": 2, "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, { - "name": "InteractionModelVersion", - "code": 0, + "name": "PanId", + "code": 3, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 1, + "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "VendorName", - "code": 1, + "name": "ExtendedPanId", + "code": 4, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 1, + "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000000000000000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "VendorID", - "code": 2, + "name": "MeshLocalPrefix", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 1, + "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000000000000000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "ProductName", - "code": 3, + "name": "NeighborTableList", + "code": 7, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 1, + "singleton": 0, "bounded": 0, "defaultValue": "", "reportable": 0, @@ -1398,13 +1631,13 @@ "reportableChange": 0 }, { - "name": "ProductID", - "code": 4, + "name": "RouteTableList", + "code": 8, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 1, + "singleton": 0, "bounded": 0, "defaultValue": "", "reportable": 0, @@ -1413,13 +1646,13 @@ "reportableChange": 0 }, { - "name": "UserLabel", - "code": 5, + "name": "PartitionId", + "code": 9, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 1, + "singleton": 0, "bounded": 0, "defaultValue": "", "reportable": 0, @@ -1428,13 +1661,13 @@ "reportableChange": 0 }, { - "name": "Location", - "code": 6, + "name": "weighting", + "code": 10, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 1, + "singleton": 0, "bounded": 0, "defaultValue": "", "reportable": 0, @@ -1443,28 +1676,28 @@ "reportableChange": 0 }, { - "name": "HardwareVersion", - "code": 7, + "name": "DataVersion", + "code": 11, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 1, + "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "HardwareVersionString", - "code": 8, + "name": "StableDataVersion", + "code": 12, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 1, + "singleton": 0, "bounded": 0, "defaultValue": "", "reportable": 0, @@ -1473,457 +1706,263 @@ "reportableChange": 0 }, { - "name": "SoftwareVersion", - "code": 9, + "name": "LeaderRouterId", + "code": 13, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 1, + "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "SoftwareVersionString", - "code": 10, + "name": "DetachedRoleCount", + "code": 14, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 1, + "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "cluster revision", - "code": 65533, + "name": "ChildRoleCount", + "code": 15, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", - "singleton": 1, + "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "General Commissioning", - "code": 48, - "mfgCode": null, - "define": "GENERAL_COMMISSIONING_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "ArmFailSafe", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetRegulatoryConfig", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 }, { - "name": "CommissioningComplete", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, + "name": "RouterRoleCount", + "code": 16, "mfgCode": null, - "side": "client", + "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "General Commissioning", - "code": 48, - "mfgCode": null, - "define": "GENERAL_COMMISSIONING_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "ArmFailSafeResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetRegulatoryConfigResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 }, { - "name": "CommissioningCompleteResponse", - "code": 5, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "FabricId", - "code": 0, + "name": "LeaderRoleCount", + "code": 17, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "o", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "Breadcrumb", - "code": 1, + "name": "AttachAttemptCount", + "code": 18, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "cluster revision", - "code": 65533, + "name": "PartitionIdChangeCount", + "code": 19, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "Network Commissioning", - "code": 49, - "mfgCode": null, - "define": "NETWORK_COMMISSIONING_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "ScanNetworks", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "AddWiFiNetwork", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "UpdateWiFiNetwork", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "AddThreadNetwork", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "UpdateThreadNetwork", - "code": 8, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "RemoveNetwork", - "code": 10, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "EnableNetwork", - "code": 12, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "DisableNetwork", - "code": 14, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 }, { - "name": "GetLastNetworkCommissioningResult", - "code": 16, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, + "name": "BetterPartitionAttachAttemptCount", + "code": 20, "mfgCode": null, - "side": "client", + "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "Network Commissioning", - "code": 49, - "mfgCode": null, - "define": "NETWORK_COMMISSIONING_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "ScanNetworksResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "AddWiFiNetworkResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "UpdateWiFiNetworkResponse", - "code": 5, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 }, { - "name": "AddThreadNetworkResponse", - "code": 7, + "name": "ParentChangeCount", + "code": 21, "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "UpdateThreadNetworkResponse", - "code": 9, + "name": "TxTotalCount", + "code": 22, "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "RemoveNetworkResponse", - "code": 11, + "name": "TxUnicastCount", + "code": 23, "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "EnableNetworkResponse", - "code": 13, + "name": "TxBroadcastCount", + "code": 24, "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "DisableNetworkResponse", - "code": 15, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, + "name": "TxAckRequestedCount", + "code": 25, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "Thread Network Diagnostics", - "code": 53, - "mfgCode": null, - "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [], - "attributes": [ + }, { - "name": "cluster revision", - "code": 65533, + "name": "TxAckedCount", + "code": 26, "mfgCode": null, - "side": "client", + "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "Thread Network Diagnostics", - "code": 53, - "mfgCode": null, - "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ + }, { - "name": "channel", - "code": 0, + "name": "TxNoAckRequestedCount", + "code": 27, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RoutingRole", - "code": 1, + "name": "TxDataCount", + "code": 28, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "NetworkName", - "code": 2, + "name": "TxDataPollCount", + "code": 29, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "PanId", - "code": 3, + "name": "TxBeaconCount", + "code": 30, "mfgCode": null, "side": "server", "included": 1, @@ -1937,158 +1976,158 @@ "reportableChange": 0 }, { - "name": "ExtendedPanId", - "code": 4, + "name": "TxBeaconRequestCount", + "code": 31, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000000000000000", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "MeshLocalPrefix", - "code": 5, + "name": "TxOtherCount", + "code": 32, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "OverrunCount", - "code": 6, + "name": "TxRetryCount", + "code": 33, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000000000000000", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "NeighborTableList", - "code": 7, + "name": "TxDirectMaxRetryExpiryCount", + "code": 34, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RouteTableList", - "code": 8, + "name": "TxIndirectMaxRetryExpiryCount", + "code": 35, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "PartitionId", - "code": 9, + "name": "TxErrCcaCount", + "code": 36, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "weighting", - "code": 10, + "name": "TxErrAbortCount", + "code": 37, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "DataVersion", - "code": 11, + "name": "TxErrBusyChannelCount", + "code": 38, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "StableDataVersion", - "code": 12, + "name": "RxTotalCount", + "code": 39, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "LeaderRouterId", - "code": 13, + "name": "RxUnicastCount", + "code": 40, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "DetachedRoleCount", - "code": 14, + "name": "RxBroadcastCount", + "code": 41, "mfgCode": null, "side": "server", "included": 1, @@ -2102,8 +2141,8 @@ "reportableChange": 0 }, { - "name": "ChildRoleCount", - "code": 15, + "name": "RxDataCount", + "code": 42, "mfgCode": null, "side": "server", "included": 1, @@ -2117,8 +2156,8 @@ "reportableChange": 0 }, { - "name": "RouterRoleCount", - "code": 16, + "name": "RxDataPollCount", + "code": 43, "mfgCode": null, "side": "server", "included": 1, @@ -2132,8 +2171,8 @@ "reportableChange": 0 }, { - "name": "LeaderRoleCount", - "code": 17, + "name": "RxBeaconCount", + "code": 44, "mfgCode": null, "side": "server", "included": 1, @@ -2146,9 +2185,9 @@ "maxInterval": 65344, "reportableChange": 0 }, - { - "name": "AttachAttemptCount", - "code": 18, + { + "name": "RxBeaconRequestCount", + "code": 45, "mfgCode": null, "side": "server", "included": 1, @@ -2162,8 +2201,8 @@ "reportableChange": 0 }, { - "name": "PartitionIdChangeCount", - "code": 19, + "name": "RxOtherCount", + "code": 46, "mfgCode": null, "side": "server", "included": 1, @@ -2177,8 +2216,8 @@ "reportableChange": 0 }, { - "name": "BetterPartitionAttachAttemptCount", - "code": 20, + "name": "RxAddressFilteredCount", + "code": 47, "mfgCode": null, "side": "server", "included": 1, @@ -2192,8 +2231,8 @@ "reportableChange": 0 }, { - "name": "ParentChangeCount", - "code": 21, + "name": "RxDestAddrFilteredCount", + "code": 48, "mfgCode": null, "side": "server", "included": 1, @@ -2207,8 +2246,8 @@ "reportableChange": 0 }, { - "name": "TxTotalCount", - "code": 22, + "name": "RxDuplicatedCount", + "code": 49, "mfgCode": null, "side": "server", "included": 1, @@ -2222,8 +2261,8 @@ "reportableChange": 0 }, { - "name": "TxUnicastCount", - "code": 23, + "name": "RxErrNoFrameCount", + "code": 50, "mfgCode": null, "side": "server", "included": 1, @@ -2237,8 +2276,8 @@ "reportableChange": 0 }, { - "name": "TxBroadcastCount", - "code": 24, + "name": "RxErrUnknownNeighborCount", + "code": 51, "mfgCode": null, "side": "server", "included": 1, @@ -2252,8 +2291,8 @@ "reportableChange": 0 }, { - "name": "TxAckRequestedCount", - "code": 25, + "name": "RxErrInvalidSrcAddrCount", + "code": 52, "mfgCode": null, "side": "server", "included": 1, @@ -2267,8 +2306,8 @@ "reportableChange": 0 }, { - "name": "TxAckedCount", - "code": 26, + "name": "RxErrSecCount", + "code": 53, "mfgCode": null, "side": "server", "included": 1, @@ -2282,8 +2321,8 @@ "reportableChange": 0 }, { - "name": "TxNoAckRequestedCount", - "code": 27, + "name": "RxErrFcsCount", + "code": 54, "mfgCode": null, "side": "server", "included": 1, @@ -2297,8 +2336,8 @@ "reportableChange": 0 }, { - "name": "TxDataCount", - "code": 28, + "name": "RxErrOtherCount", + "code": 55, "mfgCode": null, "side": "server", "included": 1, @@ -2312,23 +2351,23 @@ "reportableChange": 0 }, { - "name": "TxDataPollCount", - "code": 29, + "name": "SecurityPolicy", + "code": 59, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "TxBeaconCount", - "code": 30, + "name": "ChannelMask", + "code": 60, "mfgCode": null, "side": "server", "included": 1, @@ -2342,113 +2381,135 @@ "reportableChange": 0 }, { - "name": "TxBeaconRequestCount", - "code": 31, + "name": "OperationalDatasetComponents", + "code": 61, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "TxOtherCount", - "code": 32, + "name": "ActiveNetworkFaultsList", + "code": 62, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "TxRetryCount", - "code": 33, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [ { - "name": "TxDirectMaxRetryExpiryCount", - "code": 34, + "name": "cluster revision", + "code": 65533, "mfgCode": null, - "side": "server", + "side": "client", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ { - "name": "TxIndirectMaxRetryExpiryCount", - "code": 35, + "name": "bssid", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "TxErrCcaCount", - "code": 36, + "name": "SecurityType", + "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "TxErrAbortCount", - "code": 37, + "name": "WiFiVersion", + "code": 2, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "TxErrBusyChannelCount", - "code": 38, + "name": "ChannelNumber", + "code": 3, "mfgCode": null, "side": "server", "included": 1, @@ -2462,263 +2523,421 @@ "reportableChange": 0 }, { - "name": "RxTotalCount", - "code": 39, + "name": "Rssi", + "code": 4, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x00", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RxUnicastCount", - "code": 40, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ { - "name": "RxBroadcastCount", - "code": 41, + "name": "ResetCounts", + "code": 0, "mfgCode": null, - "side": "server", + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "client", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ { - "name": "RxDataCount", - "code": 42, + "name": "PacketRxCount", + "code": 2, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0000000000000000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RxDataPollCount", - "code": 43, + "name": "PacketTxCount", + "code": 3, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0000000000000000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RxBeaconCount", - "code": 44, + "name": "TxErrCount", + "code": 4, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0000000000000000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RxBeaconRequestCount", - "code": 45, + "name": "CollisionCount", + "code": 5, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0000000000000000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RxOtherCount", - "code": 46, + "name": "OverrunCount", + "code": 6, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0000000000000000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RxAddressFilteredCount", - "code": 47, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "SetFabric", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "OpCSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddOpCert", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 }, { - "name": "RxDestAddrFilteredCount", - "code": 48, + "name": "RemoveAllFabrics", + "code": 11, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "cluster revision", + "code": 65533, "mfgCode": null, - "side": "server", + "side": "client", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ { - "name": "RxDuplicatedCount", - "code": 49, + "name": "SetFabricResponse", + "code": 1, "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 + "source": "server", + "incoming": 1, + "outgoing": 1 }, { - "name": "RxErrNoFrameCount", - "code": 50, + "name": "OpCSRResponse", + "code": 5, "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 + "source": "server", + "incoming": 1, + "outgoing": 1 }, { - "name": "RxErrUnknownNeighborCount", - "code": 51, + "name": "OpCertResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "fabrics list", + "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RxErrInvalidSrcAddrCount", - "code": 52, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + } + ] + }, + { + "name": "Trusted Root Certificates", + "code": 63, + "mfgCode": null, + "define": "TRUSTED_ROOT_CERTIFICATES_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddTrustedRootCertificate", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 }, { - "name": "RxErrSecCount", - "code": 53, + "name": "RemoveTrustedRootCertificate", + "code": 1, "mfgCode": null, - "side": "server", + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "client", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "Trusted Root Certificates", + "code": 63, + "mfgCode": null, + "define": "TRUSTED_ROOT_CERTIFICATES_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ { - "name": "RxErrFcsCount", - "code": 54, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "Pump Configuration and Control", + "code": 512, + "mfgCode": null, + "define": "PUMP_CONFIG_CONTROL_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [], + "attributes": [ { - "name": "RxErrOtherCount", - "code": 55, + "name": "cluster revision", + "code": 65533, "mfgCode": null, - "side": "server", + "side": "client", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "Pump Configuration and Control", + "code": 512, + "mfgCode": null, + "define": "PUMP_CONFIG_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [], + "attributes": [ { - "name": "SecurityPolicy", - "code": 59, + "name": "max pressure", + "code": 0, "mfgCode": null, "side": "server", "included": 1, @@ -2732,23 +2951,23 @@ "reportableChange": 0 }, { - "name": "ChannelMask", - "code": 60, + "name": "max speed", + "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "OperationalDatasetComponents", - "code": 61, + "name": "max flow", + "code": 2, "mfgCode": null, "side": "server", "included": 1, @@ -2762,156 +2981,75 @@ "reportableChange": 0 }, { - "name": "ActiveNetworkFaultsList", - "code": 62, + "name": "pump status", + "code": 16, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "cluster revision", - "code": 65533, + "name": "effective operation mode", + "code": 17, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "Operational Credentials", - "code": 62, - "mfgCode": null, - "define": "OPERATIONAL_CREDENTIALS_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "SetFabric", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "OpCSRRequest", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "AddOpCert", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "UpdateFabricLabel", - "code": 9, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "RemoveFabric", - "code": 10, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 }, { - "name": "RemoveAllFabrics", - "code": 11, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, + "name": "effective control mode", + "code": 18, "mfgCode": null, - "side": "client", + "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "Operational Credentials", - "code": 62, - "mfgCode": null, - "define": "OPERATIONAL_CREDENTIALS_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "SetFabricResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 }, { - "name": "OpCSRResponse", - "code": 5, + "name": "capacity", + "code": 19, "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "OpCertResponse", - "code": 8, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "fabrics list", - "code": 1, + "name": "operation mode", + "code": 32, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x00", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -2935,30 +3073,13 @@ ] }, { - "name": "Trusted Root Certificates", - "code": 63, + "name": "Temperature Measurement", + "code": 1026, "mfgCode": null, - "define": "TRUSTED_ROOT_CERTIFICATES_CLUSTER", + "define": "TEMP_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 0, - "commands": [ - { - "name": "AddTrustedRootCertificate", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "RemoveTrustedRootCertificate", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], + "enabled": 1, + "commands": [], "attributes": [ { "name": "cluster revision", @@ -2969,7 +3090,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -2978,14 +3099,74 @@ ] }, { - "name": "Trusted Root Certificates", - "code": 63, + "name": "Temperature Measurement", + "code": 1026, "mfgCode": null, - "define": "TRUSTED_ROOT_CERTIFICATES_CLUSTER", + "define": "TEMP_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": "0x8000", + "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": "0x8000", + "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": "0x8000", + "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, @@ -2995,7 +3176,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -3004,12 +3185,12 @@ ] }, { - "name": "Pump Configuration and Control", - "code": 512, + "name": "Pressure Measurement", + "code": 1027, "mfgCode": null, - "define": "PUMP_CONFIG_CONTROL_CLUSTER", + "define": "PRESSURE_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, + "enabled": 0, "commands": [], "attributes": [ { @@ -3021,7 +3202,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "2", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -3030,16 +3211,16 @@ ] }, { - "name": "Pump Configuration and Control", - "code": 512, + "name": "Pressure Measurement", + "code": 1027, "mfgCode": null, - "define": "PUMP_CONFIG_CONTROL_CLUSTER", + "define": "PRESSURE_MEASUREMENT_CLUSTER", "side": "server", "enabled": 0, "commands": [], "attributes": [ { - "name": "max pressure", + "name": "measured value", "code": 0, "mfgCode": null, "side": "server", @@ -3047,14 +3228,14 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", - "reportable": 0, + "defaultValue": "0x0000", + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "max speed", + "name": "min measured value", "code": 1, "mfgCode": null, "side": "server", @@ -3069,7 +3250,7 @@ "reportableChange": 0 }, { - "name": "max flow", + "name": "max measured value", "code": 2, "mfgCode": null, "side": "server", @@ -3084,7 +3265,22 @@ "reportableChange": 0 }, { - "name": "pump status", + "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": "scaled value", "code": 16, "mfgCode": null, "side": "server", @@ -3092,6 +3288,21 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "scaled tolerance", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, "defaultValue": "", "reportable": 1, "minInterval": 0, @@ -3099,23 +3310,75 @@ "reportableChange": 0 }, { - "name": "effective operation mode", - "code": 17, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "2", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + } + ] + }, + { + "name": "Flow Measurement", + "code": 1028, + "mfgCode": null, + "define": "FLOW_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": "Flow Measurement", + "code": 1028, + "mfgCode": null, + "define": "FLOW_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "measured value", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "effective control mode", - "code": 18, + "name": "min measured value", + "code": 1, "mfgCode": null, "side": "server", "included": 1, @@ -3129,8 +3392,8 @@ "reportableChange": 0 }, { - "name": "capacity", - "code": 19, + "name": "max measured value", + "code": 2, "mfgCode": null, "side": "server", "included": 1, @@ -3138,22 +3401,22 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "operation mode", - "code": 32, + "name": "tolerance", + "code": 3, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", - "reportable": 0, + "defaultValue": "", + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -3167,7 +3430,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "2", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -3182,10 +3445,10 @@ { "endpointTypeName": "Anonymous Endpoint Type", "endpointTypeIndex": 0, - "profileId": 260, + "profileId": 2457, "endpointId": 1, "networkId": 0, - "endpointVersion": null, + "endpointVersion": 1, "deviceIdentifier": null } ], diff --git a/src/app/clusters/pump-configuration-and-control-client/pump-configuration-and-control-client.cpp b/src/app/clusters/pump-configuration-and-control-client/pump-configuration-and-control-client.cpp new file mode 100644 index 00000000000000..4f5d34251edb17 --- /dev/null +++ b/src/app/clusters/pump-configuration-and-control-client/pump-configuration-and-control-client.cpp @@ -0,0 +1,33 @@ +/** + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include +#include + +#include +#include +#include + +using namespace chip; + +void emberAfPumpConfigurationAndControlClusterInitCallback(EndpointId endpoint) +{ + // TODO +} diff --git a/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp b/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp new file mode 100644 index 00000000000000..e8f31ae1756c46 --- /dev/null +++ b/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp @@ -0,0 +1,38 @@ +/** + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include + +#include +#include +#include +#include + +using namespace chip; + +void emberAfPumpConfigurationAndControlClusterServerInitCallback(EndpointId endpoint) +{ + // TODO +} + +void emberAfPumpConfigurationAndControlClusterServerAttributeChangedCallback(EndpointId endpoint, AttributeId attributeId) +{ + // TODO +} diff --git a/src/app/zap_cluster_list.py b/src/app/zap_cluster_list.py index 50a081305661e4..612cffa022b266 100755 --- a/src/app/zap_cluster_list.py +++ b/src/app/zap_cluster_list.py @@ -45,7 +45,7 @@ 'OTA_SERVER_CLUSTER': ['ota-server'], 'OTA_CLIENT_CLUSTER': [], 'POWER_CONFIG_CLUSTER': [], - 'PUMP_CONFIG_CONTROL_CLUSTER': [], + 'PUMP_CONFIG_CONTROL_CLUSTER': ['pump-configuration-and-control-server'], 'SCENES_CLUSTER': ['scenes'], 'SOFTWARE_DIAGNOSTICS_CLUSTER': [], 'SWITCH_CLUSTER': [], @@ -100,7 +100,7 @@ 'OTA_SERVER_CLUSTER': ['ota-server'], 'OTA_CLIENT_CLUSTER': [], 'POWER_CONFIG_CLUSTER': [], - 'PUMP_CONFIG_CONTROL_CLUSTER': [], + 'PUMP_CONFIG_CONTROL_CLUSTER': ['pump-configuration-and-control-client'], 'SCENES_CLUSTER': [], 'SOFTWARE_DIAGNOSTICS_CLUSTER': [], 'SWITCH_CLUSTER': [],