mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
Merge branch 'update_chip_submodule_to_TE6' into 'main'
Submodule: update connectedhomeip submodule to test_event_6_esp branch See merge request app-frameworks/esp-matter!43
This commit is contained in:
Submodule connectedhomeip/connectedhomeip updated: f207bc6563...fa80fecc1e
@@ -1,3 +1,8 @@
|
||||
set(priv_requires_list chip bt esp32_mbedtls qrcode)
|
||||
|
||||
if ("${IDF_TARGET}" STREQUAL "esp32h2")
|
||||
list(APPEND priv_requires_list openthread)
|
||||
endif()
|
||||
idf_component_register(SRCS app_qrcode.cpp
|
||||
INCLUDE_DIRS .
|
||||
PRIV_REQUIRES chip bt esp32_mbedtls qrcode)
|
||||
PRIV_REQUIRES ${priv_requires_list})
|
||||
|
||||
@@ -27,7 +27,7 @@ include($ENV{ESP_MATTER_DEVICE_PATH}/esp_matter_device.cmake)
|
||||
|
||||
set(EXTRA_COMPONENT_DIRS
|
||||
"../common"
|
||||
"${IDF_PATH}/examples/common_components"
|
||||
"${IDF_PATH}/examples/common_components/qrcode"
|
||||
"${MATTER_SDK_PATH}/config/esp32/components"
|
||||
"${ESP_MATTER_PATH}/components"
|
||||
"${ESP_MATTER_PATH}/device_hal/device"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
set(SRC_DIRS_LIST "${CMAKE_CURRENT_LIST_DIR}"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/zap-generated"
|
||||
"${MATTER_SDK_PATH}/src/app/common/gen/attributes"
|
||||
"${MATTER_SDK_PATH}/zzz_generated/app-common/app-common/zap-generated/attributes"
|
||||
"${MATTER_SDK_PATH}/src/app/server"
|
||||
"${MATTER_SDK_PATH}/src/app/util"
|
||||
"${MATTER_SDK_PATH}/src/app/reporting"
|
||||
@@ -8,6 +8,9 @@ set(SRC_DIRS_LIST "${CMAKE_CURRENT_LIST_DIR}"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/administrator-commissioning-server"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/general-commissioning-server"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/network-commissioning"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/diagnostic-logs-server"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/software_diagnostics_server"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/thread_network_diagnostics_server"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/wifi_network_diagnostics_server"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/on-off-server"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/operational-credentials-server"
|
||||
@@ -16,12 +19,13 @@ set(SRC_DIRS_LIST "${CMAKE_CURRENT_LIST_DIR}"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/color-control-server")
|
||||
|
||||
set(PRIV_INCLUDE_DIRS_LIST "${CMAKE_CURRENT_LIST_DIR}"
|
||||
"${MATTER_SDK_PATH}/src")
|
||||
"${MATTER_SDK_PATH}/src"
|
||||
"${MATTER_SDK_PATH}/zzz_generated/app-common")
|
||||
|
||||
set(PRIV_REQUIRES_LIST chip bt esp32_mbedtls esp_matter esp_matter_console app_driver app_qrcode)
|
||||
|
||||
if ("${IDF_TARGET}" STREQUAL "esp32h2")
|
||||
list(APPEND PRIV_REQUIRES_LIST openthread mynewt_nimble)
|
||||
list(APPEND PRIV_REQUIRES_LIST openthread)
|
||||
endif()
|
||||
|
||||
idf_component_register(SRC_DIRS ${SRC_DIRS_LIST}
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
#include "esp_heap_caps.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
#include "app/common/gen/att-storage.h"
|
||||
#include "app/common/gen/attribute-id.h"
|
||||
#include "app/common/gen/attribute-type.h"
|
||||
#include "app/common/gen/cluster-id.h"
|
||||
#include "app-common/zap-generated/att-storage.h"
|
||||
#include "app-common/zap-generated/attribute-id.h"
|
||||
#include "app-common/zap-generated/attribute-type.h"
|
||||
#include "app-common/zap-generated/cluster-id.h"
|
||||
#include "app/server/Mdns.h"
|
||||
#include "app/server/Server.h"
|
||||
#include "app/util/af.h"
|
||||
@@ -231,7 +231,7 @@ esp_err_t app_matter_attribute_set(const char *endpoint, const char *attribute,
|
||||
static void on_device_event(const ChipDeviceEvent *event, intptr_t arg)
|
||||
{
|
||||
if (event->Type == PublicEventTypes::kInterfaceIpAddressChanged) {
|
||||
chip::app::Mdns::StartServer();
|
||||
chip::app::MdnsServer::Instance().StartServer();
|
||||
}
|
||||
ESP_LOGI(TAG, "Current free heap: %zu", heap_caps_get_free_size(MALLOC_CAP_8BIT));
|
||||
}
|
||||
@@ -255,18 +255,18 @@ esp_err_t app_matter_init()
|
||||
PlatformMgr().AddEventHandler(on_device_event, static_cast<intptr_t>(NULL));
|
||||
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
|
||||
if (ThreadStackMgr().InitThreadStack() != CHIP_NO_ERROR) {
|
||||
ESP_LOGE(APP_LOG_TAG, "Failed to initialize Thread stack");
|
||||
ESP_LOGE(TAG, "Failed to initialize Thread stack");
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
if (ThreadStackMgr().StartThreadTask() != CHIP_NO_ERROR) {
|
||||
ESP_LOGE(APP_LOG_TAG, "Failed to launch Thread task");
|
||||
ESP_LOGE(TAG, "Failed to launch Thread task");
|
||||
return ESP_FAIL;
|
||||
}
|
||||
#endif
|
||||
InitServer();
|
||||
chip::Server::GetInstance().Init();
|
||||
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
|
||||
chip::app::Mdns::StartServer();
|
||||
chip::app::MdnsServer::Instance().StartServer();
|
||||
#endif
|
||||
|
||||
esp_matter_attribute_callback_add(APP_MATTER_NAME, app_matter_attribute_update, NULL);
|
||||
|
||||
+1637
-3
File diff suppressed because it is too large
Load Diff
@@ -16,4 +16,3 @@
|
||||
*/
|
||||
|
||||
// THIS FILE IS GENERATED BY ZAP
|
||||
|
||||
|
||||
@@ -17,5 +17,4 @@
|
||||
|
||||
// THIS FILE IS GENERATED BY ZAP
|
||||
|
||||
|
||||
// List specific responses
|
||||
|
||||
@@ -16,4 +16,3 @@
|
||||
*/
|
||||
|
||||
// THIS FILE IS GENERATED BY ZAP
|
||||
|
||||
|
||||
@@ -16,4 +16,3 @@
|
||||
*/
|
||||
|
||||
// THIS FILE IS GENERATED BY ZAP
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -42,12 +42,6 @@
|
||||
// Code used to configure the cluster event mechanism
|
||||
#define EMBER_AF_GENERATED_EVENT_CODE \
|
||||
EmberEventControl emberAfLevelControlClusterServerTickCallbackControl1; \
|
||||
extern EmberEventControl emberAfPluginColorControlServerHueSatTransitionEventControl; \
|
||||
extern EmberEventControl emberAfPluginColorControlServerTempTransitionEventControl; \
|
||||
extern EmberEventControl emberAfPluginColorControlServerXyTransitionEventControl; \
|
||||
extern void emberAfPluginColorControlServerHueSatTransitionEventHandler(void); \
|
||||
extern void emberAfPluginColorControlServerTempTransitionEventHandler(void); \
|
||||
extern void emberAfPluginColorControlServerXyTransitionEventHandler(void); \
|
||||
static void clusterTickWrapper(EmberEventControl * control, EmberAfTickFunction callback, uint8_t endpoint) \
|
||||
{ \
|
||||
/* emberAfPushEndpointNetworkIndex(endpoint); */ \
|
||||
@@ -55,7 +49,6 @@
|
||||
(*callback)(endpoint); \
|
||||
/* emberAfPopNetworkIndex(); */ \
|
||||
} \
|
||||
\
|
||||
void emberAfLevelControlClusterServerTickCallbackWrapperFunction1(void) \
|
||||
{ \
|
||||
clusterTickWrapper(&emberAfLevelControlClusterServerTickCallbackControl1, emberAfLevelControlClusterServerTickCallback, \
|
||||
@@ -64,15 +57,9 @@
|
||||
|
||||
// EmberEventData structs used to populate the EmberEventData table
|
||||
#define EMBER_AF_GENERATED_EVENTS \
|
||||
{ &emberAfLevelControlClusterServerTickCallbackControl1, emberAfLevelControlClusterServerTickCallbackWrapperFunction1 }, \
|
||||
{ &emberAfPluginColorControlServerHueSatTransitionEventControl, \
|
||||
emberAfPluginColorControlServerHueSatTransitionEventHandler }, \
|
||||
{ &emberAfPluginColorControlServerTempTransitionEventControl, emberAfPluginColorControlServerTempTransitionEventHandler }, \
|
||||
{ &emberAfPluginColorControlServerXyTransitionEventControl, emberAfPluginColorControlServerXyTransitionEventHandler },
|
||||
{ &emberAfLevelControlClusterServerTickCallbackControl1, emberAfLevelControlClusterServerTickCallbackWrapperFunction1 },
|
||||
|
||||
#define EMBER_AF_GENERATED_EVENT_STRINGS \
|
||||
"Level Control Cluster Server EP 1", "Color Control Cluster Server Plugin HueSatTransition", \
|
||||
"Color Control Cluster Server Plugin TempTransition", "Color Control Cluster Server Plugin XyTransition",
|
||||
#define EMBER_AF_GENERATED_EVENT_STRINGS "Level Control Cluster Server EP 1",
|
||||
|
||||
// The length of the event context table used to track and retrieve cluster events
|
||||
#define EMBER_AF_EVENT_CONTEXT_LENGTH 1
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
|
||||
// THIS FILE IS GENERATED BY ZAP
|
||||
|
||||
#include <app/common/gen/af-structs.h>
|
||||
#include <app-common/zap-generated/af-structs.h>
|
||||
#include <app/util/af.h>
|
||||
#include <app/util/attribute-list-byte-span.h>
|
||||
#include <app/util/basic-types.h>
|
||||
#include <support/SafeInt.h>
|
||||
#include <support/logging/CHIPLogging.h>
|
||||
#include <lib/support/SafeInt.h>
|
||||
#include <lib/support/logging/CHIPLogging.h>
|
||||
|
||||
using namespace chip;
|
||||
using namespace chip::app::List;
|
||||
@@ -45,7 +45,8 @@ void copyListMember(uint8_t * dest, uint8_t * src, bool write, uint16_t * offset
|
||||
*offset = static_cast<uint16_t>(*offset + length);
|
||||
}
|
||||
|
||||
uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, bool write, uint8_t * dest, uint8_t * src, int32_t index)
|
||||
uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, bool write, uint8_t * dest, uint8_t * src,
|
||||
int32_t index)
|
||||
{
|
||||
if (index == -1)
|
||||
{
|
||||
@@ -58,12 +59,12 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
|
||||
if (write)
|
||||
{
|
||||
// src is a pointer to native-endian uint16_t, dest is pointer to buffer that should hold little-endian value
|
||||
emberAfCopyInt16u(dest, 0, *reinterpret_cast<uint16_t*>(src));
|
||||
emberAfCopyInt16u(dest, 0, *reinterpret_cast<uint16_t *>(src));
|
||||
}
|
||||
else
|
||||
{
|
||||
// src is pointer to buffer holding little-endian value, dest is a pointer to native-endian uint16_t
|
||||
*reinterpret_cast<uint16_t*>(dest) = emberAfGetInt16u(src, 0, kSizeLengthInBytes);
|
||||
*reinterpret_cast<uint16_t *>(dest) = emberAfGetInt16u(src, 0, kSizeLengthInBytes);
|
||||
}
|
||||
return kSizeLengthInBytes;
|
||||
}
|
||||
@@ -82,112 +83,361 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
|
||||
uint16_t entryOffset = kSizeLengthInBytes;
|
||||
switch (am->attributeId)
|
||||
{
|
||||
case 0x0000: // device list
|
||||
case 0x0000: // device list
|
||||
{
|
||||
entryLength = 6;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
entryLength = 6;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _DeviceType
|
||||
_DeviceType * entry = reinterpret_cast<_DeviceType *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *)&entry->type, write ? (uint8_t *)&entry->type : src, write, &entryOffset, sizeof(entry->type)); // DEVTYPE_ID
|
||||
copyListMember(write ? dest : (uint8_t *)&entry->revision, write ? (uint8_t *)&entry->revision : src, write, &entryOffset, sizeof(entry->revision)); // INT16U
|
||||
break;
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
case 0x0001: // server list
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _DeviceType
|
||||
_DeviceType * entry = reinterpret_cast<_DeviceType *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->type, write ? (uint8_t *) &entry->type : src, write, &entryOffset,
|
||||
sizeof(entry->type)); // DEVTYPE_ID
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->revision, write ? (uint8_t *) &entry->revision : src, write,
|
||||
&entryOffset, sizeof(entry->revision)); // INT16U
|
||||
break;
|
||||
}
|
||||
case 0x0001: // server list
|
||||
{
|
||||
entryLength = 4;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
entryLength = 4;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
copyListMember(dest, src, write, &entryOffset, entryLength); // CLUSTER_ID
|
||||
break;
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
case 0x0002: // client list
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
copyListMember(dest, src, write, &entryOffset, entryLength); // CLUSTER_ID
|
||||
break;
|
||||
}
|
||||
case 0x0002: // client list
|
||||
{
|
||||
entryLength = 4;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
entryLength = 4;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
copyListMember(dest, src, write, &entryOffset, entryLength); // CLUSTER_ID
|
||||
break;
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
case 0x0003: // parts list
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
copyListMember(dest, src, write, &entryOffset, entryLength); // CLUSTER_ID
|
||||
break;
|
||||
}
|
||||
case 0x0003: // parts list
|
||||
{
|
||||
entryLength = 2;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
entryLength = 2;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
copyListMember(dest, src, write, &entryOffset, entryLength); // ENDPOINT_NO
|
||||
break;
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
copyListMember(dest, src, write, &entryOffset, entryLength); // ENDPOINT_NO
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0x0030: // General Commissioning Cluster
|
||||
{
|
||||
uint16_t entryOffset = kSizeLengthInBytes;
|
||||
switch (am->attributeId)
|
||||
{
|
||||
case 0x0001: // BasicCommissioningInfoList
|
||||
case 0x0001: // BasicCommissioningInfoList
|
||||
{
|
||||
entryLength = 4;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
entryLength = 4;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _BasicCommissioningInfoType
|
||||
_BasicCommissioningInfoType * entry = reinterpret_cast<_BasicCommissioningInfoType *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *)&entry->FailSafeExpiryLengthMs, write ? (uint8_t *)&entry->FailSafeExpiryLengthMs : src, write, &entryOffset, sizeof(entry->FailSafeExpiryLengthMs)); // INT32U
|
||||
break;
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _BasicCommissioningInfoType
|
||||
_BasicCommissioningInfoType * entry = reinterpret_cast<_BasicCommissioningInfoType *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->FailSafeExpiryLengthMs,
|
||||
write ? (uint8_t *) &entry->FailSafeExpiryLengthMs : src, write, &entryOffset,
|
||||
sizeof(entry->FailSafeExpiryLengthMs)); // INT32U
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0x0033: // General Diagnostics Cluster
|
||||
{
|
||||
uint16_t entryOffset = kSizeLengthInBytes;
|
||||
switch (am->attributeId)
|
||||
{
|
||||
case 0x0000: // NetworkInterfaces
|
||||
{
|
||||
entryLength = 48;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _NetworkInterfaceType
|
||||
_NetworkInterfaceType * entry = reinterpret_cast<_NetworkInterfaceType *>(write ? src : dest);
|
||||
ByteSpan * NameSpan = &entry->Name; // OCTET_STRING
|
||||
if (CHIP_NO_ERROR !=
|
||||
(write ? WriteByteSpan(dest + entryOffset, 34, NameSpan) : ReadByteSpan(src + entryOffset, 34, NameSpan)))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(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
|
||||
ByteSpan * HardwareAddressSpan = &entry->HardwareAddress; // OCTET_STRING
|
||||
if (CHIP_NO_ERROR !=
|
||||
(write ? WriteByteSpan(dest + entryOffset, 10, HardwareAddressSpan)
|
||||
: ReadByteSpan(src + entryOffset, 10, HardwareAddressSpan)))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + 10);
|
||||
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;
|
||||
switch (am->attributeId)
|
||||
{
|
||||
case 0x0001: // fabrics list
|
||||
case 0x0001: // fabrics list
|
||||
{
|
||||
entryLength = 120;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
entryLength = 52;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _FabricDescriptor
|
||||
_FabricDescriptor * entry = reinterpret_cast<_FabricDescriptor *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *)&entry->FabricId, write ? (uint8_t *)&entry->FabricId : src, write, &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID
|
||||
copyListMember(write ? dest : (uint8_t *)&entry->VendorId, write ? (uint8_t *)&entry->VendorId : src, write, &entryOffset, sizeof(entry->VendorId)); // INT16U
|
||||
copyListMember(write ? dest : (uint8_t *)&entry->NodeId, write ? (uint8_t *)&entry->NodeId : src, write, &entryOffset, sizeof(entry->NodeId)); // NODE_ID
|
||||
ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING
|
||||
if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan)))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + 34);
|
||||
break;
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _FabricDescriptor
|
||||
_FabricDescriptor * entry = reinterpret_cast<_FabricDescriptor *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->FabricIndex, write ? (uint8_t *) &entry->FabricIndex : src, write,
|
||||
&entryOffset, sizeof(entry->FabricIndex)); // INT8U
|
||||
ByteSpan * RootPublicKeySpan = &entry->RootPublicKey; // OCTET_STRING
|
||||
if (CHIP_NO_ERROR !=
|
||||
(write ? WriteByteSpan(dest + entryOffset, 67, RootPublicKeySpan)
|
||||
: ReadByteSpan(src + entryOffset, 67, RootPublicKeySpan)))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + 67);
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write,
|
||||
&entryOffset, sizeof(entry->VendorId)); // INT16U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->FabricId, write ? (uint8_t *) &entry->FabricId : src, write,
|
||||
&entryOffset, sizeof(entry->FabricId)); // FABRIC_ID
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset,
|
||||
sizeof(entry->NodeId)); // NODE_ID
|
||||
ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING
|
||||
if (CHIP_NO_ERROR !=
|
||||
(write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan)))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + 34);
|
||||
break;
|
||||
}
|
||||
case 0x0004: // TrustedRootCertificates
|
||||
{
|
||||
entryOffset = GetByteSpanOffsetFromIndex(write ? dest : src, am->size, static_cast<uint16_t>(index - 1));
|
||||
if (entryOffset == 0)
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ByteSpan * trustedRootCertificatesSpan = reinterpret_cast<ByteSpan *>(write ? src : dest); // OCTET_STRING
|
||||
uint16_t trustedRootCertificatesRemainingSpace = static_cast<uint16_t>(am->size - entryOffset);
|
||||
if (CHIP_NO_ERROR !=
|
||||
(write ? WriteByteSpan(dest + entryOffset, trustedRootCertificatesRemainingSpace, trustedRootCertificatesSpan)
|
||||
: ReadByteSpan(src + entryOffset, trustedRootCertificatesRemainingSpace, trustedRootCertificatesSpan)))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!CanCastTo<uint16_t>(trustedRootCertificatesSpan->size()))
|
||||
{
|
||||
ChipLogError(Zcl, "Span size %zu is too large", trustedRootCertificatesSpan->size());
|
||||
return 0;
|
||||
}
|
||||
entryLength = static_cast<uint16_t>(trustedRootCertificatesSpan->size());
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0x0035: // Thread Network Diagnostics Cluster
|
||||
{
|
||||
uint16_t entryOffset = kSizeLengthInBytes;
|
||||
switch (am->attributeId)
|
||||
{
|
||||
case 0x0007: // NeighborTableList
|
||||
{
|
||||
entryLength = 31;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _NeighborTable
|
||||
_NeighborTable * entry = reinterpret_cast<_NeighborTable *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->ExtAddress, write ? (uint8_t *) &entry->ExtAddress : src, write,
|
||||
&entryOffset, sizeof(entry->ExtAddress)); // INT64U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->Age, write ? (uint8_t *) &entry->Age : src, write, &entryOffset,
|
||||
sizeof(entry->Age)); // INT32U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->Rloc16, write ? (uint8_t *) &entry->Rloc16 : src, write, &entryOffset,
|
||||
sizeof(entry->Rloc16)); // INT16U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->LinkFrameCounter, write ? (uint8_t *) &entry->LinkFrameCounter : src,
|
||||
write, &entryOffset, sizeof(entry->LinkFrameCounter)); // INT32U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->MleFrameCounter, write ? (uint8_t *) &entry->MleFrameCounter : src,
|
||||
write, &entryOffset, sizeof(entry->MleFrameCounter)); // INT32U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->LQI, write ? (uint8_t *) &entry->LQI : src, write, &entryOffset,
|
||||
sizeof(entry->LQI)); // INT8U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->AverageRssi, write ? (uint8_t *) &entry->AverageRssi : src, write,
|
||||
&entryOffset, sizeof(entry->AverageRssi)); // INT8S
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->LastRssi, write ? (uint8_t *) &entry->LastRssi : src, write,
|
||||
&entryOffset, sizeof(entry->LastRssi)); // INT8S
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->FrameErrorRate, write ? (uint8_t *) &entry->FrameErrorRate : src,
|
||||
write, &entryOffset, sizeof(entry->FrameErrorRate)); // INT8U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->MessageErrorRate, write ? (uint8_t *) &entry->MessageErrorRate : src,
|
||||
write, &entryOffset, sizeof(entry->MessageErrorRate)); // INT8U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->RxOnWhenIdle, write ? (uint8_t *) &entry->RxOnWhenIdle : src, write,
|
||||
&entryOffset, sizeof(entry->RxOnWhenIdle)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->FullThreadDevice, write ? (uint8_t *) &entry->FullThreadDevice : src,
|
||||
write, &entryOffset, sizeof(entry->FullThreadDevice)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->FullNetworkData, write ? (uint8_t *) &entry->FullNetworkData : src,
|
||||
write, &entryOffset, sizeof(entry->FullNetworkData)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->IsChild, write ? (uint8_t *) &entry->IsChild : src, write,
|
||||
&entryOffset, sizeof(entry->IsChild)); // BOOLEAN
|
||||
break;
|
||||
}
|
||||
case 0x0008: // RouteTableList
|
||||
{
|
||||
entryLength = 18;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _RouteTable
|
||||
_RouteTable * entry = reinterpret_cast<_RouteTable *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->ExtAddress, write ? (uint8_t *) &entry->ExtAddress : src, write,
|
||||
&entryOffset, sizeof(entry->ExtAddress)); // INT64U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->Rloc16, write ? (uint8_t *) &entry->Rloc16 : src, write, &entryOffset,
|
||||
sizeof(entry->Rloc16)); // INT16U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->RouterId, write ? (uint8_t *) &entry->RouterId : src, write,
|
||||
&entryOffset, sizeof(entry->RouterId)); // INT8U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->NextHop, write ? (uint8_t *) &entry->NextHop : src, write,
|
||||
&entryOffset, sizeof(entry->NextHop)); // INT8U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->PathCost, write ? (uint8_t *) &entry->PathCost : src, write,
|
||||
&entryOffset, sizeof(entry->PathCost)); // INT8U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->LQIIn, write ? (uint8_t *) &entry->LQIIn : src, write, &entryOffset,
|
||||
sizeof(entry->LQIIn)); // INT8U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->LQIOut, write ? (uint8_t *) &entry->LQIOut : src, write, &entryOffset,
|
||||
sizeof(entry->LQIOut)); // INT8U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->Age, write ? (uint8_t *) &entry->Age : src, write, &entryOffset,
|
||||
sizeof(entry->Age)); // INT8U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->Allocated, write ? (uint8_t *) &entry->Allocated : src, write,
|
||||
&entryOffset, sizeof(entry->Allocated)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->LinkEstablished, write ? (uint8_t *) &entry->LinkEstablished : src,
|
||||
write, &entryOffset, sizeof(entry->LinkEstablished)); // BOOLEAN
|
||||
break;
|
||||
}
|
||||
case 0x003B: // SecurityPolicy
|
||||
{
|
||||
entryLength = 4;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _SecurityPolicy
|
||||
_SecurityPolicy * entry = reinterpret_cast<_SecurityPolicy *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->RotationTime, write ? (uint8_t *) &entry->RotationTime : src, write,
|
||||
&entryOffset, sizeof(entry->RotationTime)); // INT16U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->Flags, write ? (uint8_t *) &entry->Flags : src, write, &entryOffset,
|
||||
sizeof(entry->Flags)); // BITMAP16
|
||||
break;
|
||||
}
|
||||
case 0x003D: // OperationalDatasetComponents
|
||||
{
|
||||
entryLength = 12;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _OperationalDatasetComponents
|
||||
_OperationalDatasetComponents * entry = reinterpret_cast<_OperationalDatasetComponents *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->ActiveTimestampPresent,
|
||||
write ? (uint8_t *) &entry->ActiveTimestampPresent : src, write, &entryOffset,
|
||||
sizeof(entry->ActiveTimestampPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->PendingTimestampPresent,
|
||||
write ? (uint8_t *) &entry->PendingTimestampPresent : src, write, &entryOffset,
|
||||
sizeof(entry->PendingTimestampPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->MasterKeyPresent, write ? (uint8_t *) &entry->MasterKeyPresent : src,
|
||||
write, &entryOffset, sizeof(entry->MasterKeyPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->NetworkNamePresent,
|
||||
write ? (uint8_t *) &entry->NetworkNamePresent : src, write, &entryOffset,
|
||||
sizeof(entry->NetworkNamePresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->ExtendedPanIdPresent,
|
||||
write ? (uint8_t *) &entry->ExtendedPanIdPresent : src, write, &entryOffset,
|
||||
sizeof(entry->ExtendedPanIdPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->MeshLocalPrefixPresent,
|
||||
write ? (uint8_t *) &entry->MeshLocalPrefixPresent : src, write, &entryOffset,
|
||||
sizeof(entry->MeshLocalPrefixPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->DelayPresent, write ? (uint8_t *) &entry->DelayPresent : src, write,
|
||||
&entryOffset, sizeof(entry->DelayPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->PanIdPresent, write ? (uint8_t *) &entry->PanIdPresent : src, write,
|
||||
&entryOffset, sizeof(entry->PanIdPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->ChannelPresent, write ? (uint8_t *) &entry->ChannelPresent : src,
|
||||
write, &entryOffset, sizeof(entry->ChannelPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->PskcPresent, write ? (uint8_t *) &entry->PskcPresent : src, write,
|
||||
&entryOffset, sizeof(entry->PskcPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->SecurityPolicyPresent,
|
||||
write ? (uint8_t *) &entry->SecurityPolicyPresent : src, write, &entryOffset,
|
||||
sizeof(entry->SecurityPolicyPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->ChannelMaskPresent,
|
||||
write ? (uint8_t *) &entry->ChannelMaskPresent : src, write, &entryOffset,
|
||||
sizeof(entry->ChannelMaskPresent)); // BOOLEAN
|
||||
break;
|
||||
}
|
||||
case 0x003E: // ActiveNetworkFaultsList
|
||||
{
|
||||
entryLength = 1;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
copyListMember(dest, src, write, &entryOffset, entryLength); // NetworkFault
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,48 +461,87 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut
|
||||
case 0x001D: // Descriptor Cluster
|
||||
switch (attributeId)
|
||||
{
|
||||
case 0x0000: // device list
|
||||
case 0x0000: // device list
|
||||
// Struct _DeviceType
|
||||
entryLength = 6;
|
||||
break;
|
||||
case 0x0001: // server list
|
||||
case 0x0001: // server list
|
||||
// chip::ClusterId
|
||||
entryLength = 4;
|
||||
break;
|
||||
case 0x0002: // client list
|
||||
case 0x0002: // client list
|
||||
// chip::ClusterId
|
||||
entryLength = 4;
|
||||
break;
|
||||
case 0x0003: // parts list
|
||||
case 0x0003: // parts list
|
||||
// chip::EndpointId
|
||||
entryLength = 2;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 0x0030: // General Commissioning Cluster
|
||||
switch (attributeId)
|
||||
{
|
||||
case 0x0001: // BasicCommissioningInfoList
|
||||
case 0x0001: // BasicCommissioningInfoList
|
||||
// Struct _BasicCommissioningInfoType
|
||||
entryLength = 4;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 0x0033: // General Diagnostics Cluster
|
||||
switch (attributeId)
|
||||
{
|
||||
case 0x0000: // NetworkInterfaces
|
||||
// Struct _NetworkInterfaceType
|
||||
entryLength = 48;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 0x003E: // Operational Credentials Cluster
|
||||
switch (attributeId)
|
||||
{
|
||||
case 0x0001: // fabrics list
|
||||
case 0x0001: // fabrics list
|
||||
// Struct _FabricDescriptor
|
||||
entryLength = 52;
|
||||
entryLength = 120;
|
||||
break;
|
||||
case 0x0004: // TrustedRootCertificates
|
||||
// chip::ByteSpan
|
||||
return GetByteSpanOffsetFromIndex(buffer, 402, entryCount);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 0x0035: // Thread Network Diagnostics Cluster
|
||||
switch (attributeId)
|
||||
{
|
||||
case 0x0007: // NeighborTableList
|
||||
// Struct _NeighborTable
|
||||
entryLength = 31;
|
||||
break;
|
||||
case 0x0008: // RouteTableList
|
||||
// Struct _RouteTable
|
||||
entryLength = 18;
|
||||
break;
|
||||
case 0x003B: // SecurityPolicy
|
||||
// Struct _SecurityPolicy
|
||||
entryLength = 4;
|
||||
break;
|
||||
case 0x003D: // OperationalDatasetComponents
|
||||
// Struct _OperationalDatasetComponents
|
||||
entryLength = 12;
|
||||
break;
|
||||
case 0x003E: // ActiveNetworkFaultsList
|
||||
// uint8_t
|
||||
entryLength = 1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
uint32_t totalSize = kSizeLengthInBytes + (entryCount * entryLength);
|
||||
if (!CanCastTo<uint16_t>(totalSize))
|
||||
{
|
||||
ChipLogError(Zcl, "Cluster " ChipLogFormatMEI ": Size of attribute " ChipLogFormatMEI " is too large.", ChipLogValueMEI(clusterId), ChipLogValueMEI(attributeId));
|
||||
ChipLogError(Zcl, "Cluster " ChipLogFormatMEI ": Size of attribute " ChipLogFormatMEI " is too large.",
|
||||
ChipLogValueMEI(clusterId), ChipLogValueMEI(attributeId));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
// THIS FILE IS GENERATED BY ZAP
|
||||
|
||||
#include <app/common/gen/callback.h>
|
||||
#include <app/common/gen/cluster-id.h>
|
||||
#include <app-common/zap-generated/callback.h>
|
||||
#include <app-common/zap-generated/cluster-id.h>
|
||||
#include <lib/support/Span.h>
|
||||
|
||||
using namespace chip;
|
||||
@@ -28,34 +28,46 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId)
|
||||
{
|
||||
switch (clusterId)
|
||||
{
|
||||
case ZCL_ADMINISTRATOR_COMMISSIONING_CLUSTER_ID :
|
||||
case ZCL_ADMINISTRATOR_COMMISSIONING_CLUSTER_ID:
|
||||
emberAfAdministratorCommissioningClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_BASIC_CLUSTER_ID :
|
||||
case ZCL_BASIC_CLUSTER_ID:
|
||||
emberAfBasicClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_COLOR_CONTROL_CLUSTER_ID :
|
||||
case ZCL_COLOR_CONTROL_CLUSTER_ID:
|
||||
emberAfColorControlClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_DESCRIPTOR_CLUSTER_ID :
|
||||
case ZCL_DESCRIPTOR_CLUSTER_ID:
|
||||
emberAfDescriptorClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID :
|
||||
case ZCL_DIAGNOSTIC_LOGS_CLUSTER_ID:
|
||||
emberAfDiagnosticLogsClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID:
|
||||
emberAfGeneralCommissioningClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_LEVEL_CONTROL_CLUSTER_ID :
|
||||
case ZCL_GENERAL_DIAGNOSTICS_CLUSTER_ID:
|
||||
emberAfGeneralDiagnosticsClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_LEVEL_CONTROL_CLUSTER_ID:
|
||||
emberAfLevelControlClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID :
|
||||
case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID:
|
||||
emberAfNetworkCommissioningClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_ON_OFF_CLUSTER_ID :
|
||||
case ZCL_ON_OFF_CLUSTER_ID:
|
||||
emberAfOnOffClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID :
|
||||
case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID:
|
||||
emberAfOperationalCredentialsClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_ID :
|
||||
case ZCL_SOFTWARE_DIAGNOSTICS_CLUSTER_ID:
|
||||
emberAfSoftwareDiagnosticsClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_ID:
|
||||
emberAfThreadNetworkDiagnosticsClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_ID:
|
||||
emberAfWiFiNetworkDiagnosticsClusterInitCallback(endpoint);
|
||||
break;
|
||||
default:
|
||||
@@ -84,11 +96,21 @@ void __attribute__((weak)) emberAfDescriptorClusterInitCallback(EndpointId endpo
|
||||
// To prevent warning
|
||||
(void) endpoint;
|
||||
}
|
||||
void __attribute__((weak)) emberAfDiagnosticLogsClusterInitCallback(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
|
||||
@@ -109,6 +131,16 @@ void __attribute__((weak)) emberAfOperationalCredentialsClusterInitCallback(Endp
|
||||
// To prevent warning
|
||||
(void) endpoint;
|
||||
}
|
||||
void __attribute__((weak)) emberAfSoftwareDiagnosticsClusterInitCallback(EndpointId endpoint)
|
||||
{
|
||||
// To prevent warning
|
||||
(void) endpoint;
|
||||
}
|
||||
void __attribute__((weak)) emberAfThreadNetworkDiagnosticsClusterInitCallback(EndpointId endpoint)
|
||||
{
|
||||
// To prevent warning
|
||||
(void) endpoint;
|
||||
}
|
||||
void __attribute__((weak)) emberAfWiFiNetworkDiagnosticsClusterInitCallback(EndpointId endpoint)
|
||||
{
|
||||
// To prevent warning
|
||||
@@ -179,10 +211,9 @@ void __attribute__((weak)) emberAfRemoveFromCurrentAppTasksCallback(EmberAfAppli
|
||||
* @param value Ver.: always
|
||||
* @param type Ver.: always
|
||||
*/
|
||||
EmberAfAttributeWritePermission __attribute__((weak)) emberAfAllowNetworkWriteAttributeCallback(
|
||||
EndpointId endpoint, ClusterId clusterId,
|
||||
AttributeId attributeId, uint8_t mask,
|
||||
uint16_t manufacturerCode, uint8_t * value, uint8_t type)
|
||||
EmberAfAttributeWritePermission __attribute__((weak))
|
||||
emberAfAllowNetworkWriteAttributeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
|
||||
uint16_t manufacturerCode, uint8_t * value, uint8_t type)
|
||||
{
|
||||
return EMBER_ZCL_ATTRIBUTE_WRITE_PERMISSION_ALLOW_WRITE_NORMAL; // Default
|
||||
}
|
||||
@@ -197,9 +228,8 @@ EmberAfAttributeWritePermission __attribute__((weak)) emberAfAllowNetworkWriteAt
|
||||
* @param manufacturerCode Ver.: always
|
||||
* @param attributeId Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfAttributeReadAccessCallback(
|
||||
EndpointId endpoint, ClusterId clusterId, uint16_t manufacturerCode,
|
||||
AttributeId attributeId)
|
||||
bool __attribute__((weak))
|
||||
emberAfAttributeReadAccessCallback(EndpointId endpoint, ClusterId clusterId, uint16_t manufacturerCode, AttributeId attributeId)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -214,9 +244,8 @@ bool __attribute__((weak)) emberAfAttributeReadAccessCallback(
|
||||
* @param manufacturerCode Ver.: always
|
||||
* @param attributeId Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfAttributeWriteAccessCallback(
|
||||
EndpointId endpoint, ClusterId clusterId, uint16_t manufacturerCode,
|
||||
AttributeId attributeId)
|
||||
bool __attribute__((weak))
|
||||
emberAfAttributeWriteAccessCallback(EndpointId endpoint, ClusterId clusterId, uint16_t manufacturerCode, AttributeId attributeId)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -233,8 +262,7 @@ bool __attribute__((weak)) emberAfAttributeWriteAccessCallback(
|
||||
* @param status Specifies either SUCCESS or the nature of the error that was
|
||||
* detected in the received command. Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfDefaultResponseCallback(
|
||||
ClusterId clusterId, CommandId commandId, EmberAfStatus status)
|
||||
bool __attribute__((weak)) emberAfDefaultResponseCallback(ClusterId clusterId, CommandId commandId, EmberAfStatus status)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -251,8 +279,7 @@ bool __attribute__((weak)) emberAfDefaultResponseCallback(
|
||||
* always
|
||||
* @param bufLen The length in bytes of the list. Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfConfigureReportingResponseCallback(
|
||||
ClusterId clusterId, uint8_t * buffer, uint16_t bufLen)
|
||||
bool __attribute__((weak)) emberAfConfigureReportingResponseCallback(ClusterId clusterId, uint8_t * buffer, uint16_t bufLen)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -269,8 +296,7 @@ bool __attribute__((weak)) emberAfConfigureReportingResponseCallback(
|
||||
* records. Ver.: always
|
||||
* @param bufLen The length in bytes of the list. Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfReadReportingConfigurationResponseCallback(
|
||||
ClusterId clusterId, uint8_t * buffer, uint16_t bufLen)
|
||||
bool __attribute__((weak)) emberAfReadReportingConfigurationResponseCallback(ClusterId clusterId, uint8_t * buffer, uint16_t bufLen)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -295,9 +321,8 @@ bool __attribute__((weak)) emberAfReadReportingConfigurationResponseCallback(
|
||||
* @param extended Indicates whether the response is in the extended format or
|
||||
* not. Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(
|
||||
ClusterId clusterId, bool discoveryComplete, uint8_t * buffer,
|
||||
uint16_t bufLen, bool extended)
|
||||
bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * buffer,
|
||||
uint16_t bufLen, bool extended)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -316,9 +341,9 @@ bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(
|
||||
* @param commandIdCount The length of bytes of the list, whish is the same as
|
||||
* the number of identifiers. Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfDiscoverCommandsGeneratedResponseCallback(
|
||||
ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete,
|
||||
CommandId * commandIds, uint16_t commandIdCount)
|
||||
bool __attribute__((weak))
|
||||
emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete,
|
||||
CommandId * commandIds, uint16_t commandIdCount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -337,9 +362,9 @@ bool __attribute__((weak)) emberAfDiscoverCommandsGeneratedResponseCallback(
|
||||
* @param commandIdCount The length of bytes of the list, whish is the same as
|
||||
* the number of identifiers. Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfDiscoverCommandsReceivedResponseCallback(
|
||||
ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete,
|
||||
CommandId * commandIds, uint16_t commandIdCount)
|
||||
bool __attribute__((weak))
|
||||
emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete,
|
||||
CommandId * commandIds, uint16_t commandIdCount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -357,8 +382,7 @@ bool __attribute__((weak)) emberAfDiscoverCommandsReceivedResponseCallback(
|
||||
*
|
||||
* @param cmd Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfPreCommandReceivedCallback(
|
||||
EmberAfClusterCommand * cmd)
|
||||
bool __attribute__((weak)) emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -382,8 +406,7 @@ bool __attribute__((weak)) emberAfPreCommandReceivedCallback(
|
||||
* @param status A pointer to the status code value that will be returned to the
|
||||
* caller. Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfPreMessageSendCallback(
|
||||
EmberAfMessageStruct * messageStruct, EmberStatus * status)
|
||||
bool __attribute__((weak)) emberAfPreMessageSendCallback(EmberAfMessageStruct * messageStruct, EmberStatus * status)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -406,10 +429,8 @@ bool __attribute__((weak)) emberAfPreMessageSendCallback(
|
||||
* @param message Ver.: always
|
||||
* @param status Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfMessageSentCallback(
|
||||
const MessageSendDestination & destination,
|
||||
EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message,
|
||||
EmberStatus status)
|
||||
bool __attribute__((weak)) emberAfMessageSentCallback(const MessageSendDestination & destination, EmberApsFrame * apsFrame,
|
||||
uint16_t msgLen, uint8_t * message, EmberStatus status)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -431,10 +452,9 @@ bool __attribute__((weak)) emberAfMessageSentCallback(
|
||||
* @param size Ver.: always
|
||||
* @param value Ver.: always
|
||||
*/
|
||||
EmberAfStatus __attribute__((weak)) emberAfPreAttributeChangeCallback(
|
||||
EndpointId endpoint, ClusterId clusterId, AttributeId attributeId,
|
||||
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size,
|
||||
uint8_t * value)
|
||||
EmberAfStatus __attribute__((weak))
|
||||
emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
|
||||
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
|
||||
{
|
||||
return EMBER_ZCL_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -454,12 +474,10 @@ EmberAfStatus __attribute__((weak)) emberAfPreAttributeChangeCallback(
|
||||
* @param size Ver.: always
|
||||
* @param value Ver.: always
|
||||
*/
|
||||
void __attribute__((weak)) emberAfPostAttributeChangeCallback(
|
||||
EndpointId endpoint, ClusterId clusterId, AttributeId attributeId,
|
||||
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size,
|
||||
uint8_t * value)
|
||||
{
|
||||
}
|
||||
void __attribute__((weak))
|
||||
emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
|
||||
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
|
||||
{}
|
||||
|
||||
/** @brief External Attribute Read
|
||||
*
|
||||
@@ -498,10 +516,9 @@ void __attribute__((weak)) emberAfPostAttributeChangeCallback(
|
||||
* @param maxReadLength Ver.: always
|
||||
* @param index Ver.: always
|
||||
*/
|
||||
EmberAfStatus __attribute__((weak)) emberAfExternalAttributeReadCallback(
|
||||
EndpointId endpoint, ClusterId clusterId,
|
||||
EmberAfAttributeMetadata * attributeMetadata, uint16_t manufacturerCode,
|
||||
uint8_t * buffer, uint16_t maxReadLength, int32_t index)
|
||||
EmberAfStatus __attribute__((weak))
|
||||
emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId, EmberAfAttributeMetadata * attributeMetadata,
|
||||
uint16_t manufacturerCode, uint8_t * buffer, uint16_t maxReadLength, int32_t index)
|
||||
{
|
||||
return EMBER_ZCL_STATUS_FAILURE;
|
||||
}
|
||||
@@ -553,10 +570,9 @@ EmberAfStatus __attribute__((weak)) emberAfExternalAttributeReadCallback(
|
||||
* @param buffer Ver.: always
|
||||
* @param index Ver.: always
|
||||
*/
|
||||
EmberAfStatus __attribute__((weak)) emberAfExternalAttributeWriteCallback(
|
||||
EndpointId endpoint, ClusterId clusterId,
|
||||
EmberAfAttributeMetadata * attributeMetadata, uint16_t manufacturerCode,
|
||||
uint8_t * buffer, int32_t index)
|
||||
EmberAfStatus __attribute__((weak))
|
||||
emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId, EmberAfAttributeMetadata * attributeMetadata,
|
||||
uint16_t manufacturerCode, uint8_t * buffer, int32_t index)
|
||||
{
|
||||
return EMBER_ZCL_STATUS_FAILURE;
|
||||
}
|
||||
@@ -572,8 +588,7 @@ EmberAfStatus __attribute__((weak)) emberAfExternalAttributeWriteCallback(
|
||||
* always
|
||||
* @param bufLen The length in bytes of the list. Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfReportAttributesCallback(
|
||||
ClusterId clusterId, uint8_t * buffer, uint16_t bufLen)
|
||||
bool __attribute__((weak)) emberAfReportAttributesCallback(ClusterId clusterId, uint8_t * buffer, uint16_t bufLen)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -609,9 +624,8 @@ uint32_t __attribute__((weak)) emberAfGetCurrentTimeCallback()
|
||||
* @param returnEndpointInfo A pointer to a data struct that will be written
|
||||
* with information about the endpoint. Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfGetEndpointInfoCallback(
|
||||
EndpointId endpoint, uint8_t * returnNetworkIndex,
|
||||
EmberAfEndpointInfoStruct * returnEndpointInfo)
|
||||
bool __attribute__((weak))
|
||||
emberAfGetEndpointInfoCallback(EndpointId endpoint, uint8_t * returnNetworkIndex, EmberAfEndpointInfoStruct * returnEndpointInfo)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -634,8 +648,8 @@ void __attribute__((weak)) emberAfRegistrationAbortCallback() {}
|
||||
* always
|
||||
* @param message The message data received or to send. Ver.: always
|
||||
*/
|
||||
EmberStatus __attribute__((weak)) emberAfInterpanSendMessageCallback(
|
||||
EmberAfInterpanHeader * header, uint16_t messageLength, uint8_t * message)
|
||||
EmberStatus __attribute__((weak))
|
||||
emberAfInterpanSendMessageCallback(EmberAfInterpanHeader * header, uint16_t messageLength, uint8_t * message)
|
||||
{
|
||||
return EMBER_LIBRARY_NOT_PRESENT;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,7 +26,6 @@
|
||||
/**** Network Section ****/
|
||||
#define EMBER_SUPPORTED_NETWORKS (1)
|
||||
|
||||
|
||||
#define EMBER_APS_UNICAST_MESSAGE_COUNT 10
|
||||
|
||||
/**** Cluster endpoint counts ****/
|
||||
@@ -34,11 +33,15 @@
|
||||
#define EMBER_AF_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (1)
|
||||
#define EMBER_AF_COLOR_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1)
|
||||
#define EMBER_AF_DESCRIPTOR_CLUSTER_SERVER_ENDPOINT_COUNT (2)
|
||||
#define EMBER_AF_DIAGNOSTIC_LOGS_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_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1)
|
||||
#define EMBER_AF_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1)
|
||||
#define EMBER_AF_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1)
|
||||
|
||||
/**** Cluster Plugins ****/
|
||||
@@ -67,11 +70,21 @@
|
||||
#define EMBER_AF_PLUGIN_DESCRIPTOR_SERVER
|
||||
#define EMBER_AF_PLUGIN_DESCRIPTOR
|
||||
|
||||
// Use this macro to check if the server side of the Diagnostic Logs cluster is included
|
||||
#define ZCL_USING_DIAGNOSTIC_LOGS_CLUSTER_SERVER
|
||||
#define EMBER_AF_PLUGIN_DIAGNOSTIC_LOGS_SERVER
|
||||
#define EMBER_AF_PLUGIN_DIAGNOSTIC_LOGS
|
||||
|
||||
// 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 server side of the Level Control cluster is included
|
||||
#define ZCL_USING_LEVEL_CONTROL_CLUSTER_SERVER
|
||||
#define EMBER_AF_PLUGIN_LEVEL_CONTROL_SERVER
|
||||
@@ -96,6 +109,16 @@
|
||||
#define EMBER_AF_PLUGIN_OPERATIONAL_CREDENTIALS_SERVER
|
||||
#define EMBER_AF_PLUGIN_OPERATIONAL_CREDENTIALS
|
||||
|
||||
// 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 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
|
||||
#define EMBER_AF_PLUGIN_THREAD_NETWORK_DIAGNOSTICS
|
||||
|
||||
// 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
|
||||
|
||||
@@ -15,8 +15,8 @@ CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y
|
||||
|
||||
# Enable NIMBLE which is mynewt_nimble component out of bt component
|
||||
# It will be merge to bt component soon
|
||||
CONFIG_BT_ENABLED=n
|
||||
CONFIG_NIMBLE_ENABLED=y
|
||||
CONFIG_BT_ENABLED=y
|
||||
CONFIG_BT_NIMBLE_ENABLED=y
|
||||
CONFIG_NEWTOS_ENABLE=n
|
||||
CONFIG_BLE_50_FEATURE_SUPPORT=y
|
||||
CONFIG_BLE_HCI_UART_BAUD=921600
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
set(SRC_DIRS_LIST "${CMAKE_CURRENT_LIST_DIR}"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/zap-generated"
|
||||
"${MATTER_SDK_PATH}/src/app/common/gen/attributes"
|
||||
"${MATTER_SDK_PATH}/zzz_generated/app-common/app-common/zap-generated/attributes"
|
||||
"${MATTER_SDK_PATH}/src/app/server"
|
||||
"${MATTER_SDK_PATH}/src/app/util"
|
||||
"${MATTER_SDK_PATH}/src/app/reporting"
|
||||
@@ -8,6 +8,9 @@ set(SRC_DIRS_LIST "${CMAKE_CURRENT_LIST_DIR}"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/administrator-commissioning-server"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/general-commissioning-server"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/network-commissioning"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/diagnostic-logs-server"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/software_diagnostics_server"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/thread_network_diagnostics_server"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/wifi_network_diagnostics_server"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/on-off-server"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/operational-credentials-server"
|
||||
@@ -16,7 +19,8 @@ set(SRC_DIRS_LIST "${CMAKE_CURRENT_LIST_DIR}"
|
||||
"${MATTER_SDK_PATH}/src/app/clusters/color-control-server")
|
||||
|
||||
set(PRIV_INCLUDE_DIRS_LIST "${CMAKE_CURRENT_LIST_DIR}"
|
||||
"${MATTER_SDK_PATH}/src")
|
||||
"${MATTER_SDK_PATH}/src"
|
||||
"${MATTER_SDK_PATH}/zzz_generated/app-common")
|
||||
|
||||
set(PRIV_REQUIRES_LIST chip bt esp32_mbedtls esp_matter esp_matter_console app_driver app_qrcode esp_rainmaker)
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
#include "esp_heap_caps.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
#include "app/common/gen/att-storage.h"
|
||||
#include "app/common/gen/attribute-id.h"
|
||||
#include "app/common/gen/attribute-type.h"
|
||||
#include "app/common/gen/cluster-id.h"
|
||||
#include "app-common/zap-generated/att-storage.h"
|
||||
#include "app-common/zap-generated/attribute-id.h"
|
||||
#include "app-common/zap-generated/attribute-type.h"
|
||||
#include "app-common/zap-generated/cluster-id.h"
|
||||
#include "app/server/Mdns.h"
|
||||
#include "app/server/Server.h"
|
||||
#include "app/util/af.h"
|
||||
@@ -228,7 +228,7 @@ esp_err_t app_matter_attribute_set(const char *endpoint, const char *attribute,
|
||||
static void on_device_event(const ChipDeviceEvent *event, intptr_t arg)
|
||||
{
|
||||
if (event->Type == PublicEventTypes::kInterfaceIpAddressChanged) {
|
||||
chip::app::Mdns::StartServer();
|
||||
chip::app::MdnsServer::Instance().StartServer();
|
||||
}
|
||||
ESP_LOGI(TAG, "Current free heap: %zu", heap_caps_get_free_size(MALLOC_CAP_8BIT));
|
||||
}
|
||||
@@ -251,7 +251,7 @@ esp_err_t app_matter_init()
|
||||
}
|
||||
PlatformMgr().AddEventHandler(on_device_event, static_cast<intptr_t>(NULL));
|
||||
|
||||
InitServer();
|
||||
chip::Server::GetInstance().Init();
|
||||
|
||||
esp_matter_attribute_callback_add(APP_MATTER_NAME, app_matter_attribute_update, NULL);
|
||||
return ESP_OK;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -16,4 +16,3 @@
|
||||
*/
|
||||
|
||||
// THIS FILE IS GENERATED BY ZAP
|
||||
|
||||
|
||||
@@ -17,5 +17,4 @@
|
||||
|
||||
// THIS FILE IS GENERATED BY ZAP
|
||||
|
||||
|
||||
// List specific responses
|
||||
|
||||
@@ -16,4 +16,3 @@
|
||||
*/
|
||||
|
||||
// THIS FILE IS GENERATED BY ZAP
|
||||
|
||||
|
||||
@@ -16,4 +16,3 @@
|
||||
*/
|
||||
|
||||
// THIS FILE IS GENERATED BY ZAP
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -42,12 +42,6 @@
|
||||
// Code used to configure the cluster event mechanism
|
||||
#define EMBER_AF_GENERATED_EVENT_CODE \
|
||||
EmberEventControl emberAfLevelControlClusterServerTickCallbackControl1; \
|
||||
extern EmberEventControl emberAfPluginColorControlServerHueSatTransitionEventControl; \
|
||||
extern EmberEventControl emberAfPluginColorControlServerTempTransitionEventControl; \
|
||||
extern EmberEventControl emberAfPluginColorControlServerXyTransitionEventControl; \
|
||||
extern void emberAfPluginColorControlServerHueSatTransitionEventHandler(void); \
|
||||
extern void emberAfPluginColorControlServerTempTransitionEventHandler(void); \
|
||||
extern void emberAfPluginColorControlServerXyTransitionEventHandler(void); \
|
||||
static void clusterTickWrapper(EmberEventControl * control, EmberAfTickFunction callback, uint8_t endpoint) \
|
||||
{ \
|
||||
/* emberAfPushEndpointNetworkIndex(endpoint); */ \
|
||||
@@ -55,7 +49,6 @@
|
||||
(*callback)(endpoint); \
|
||||
/* emberAfPopNetworkIndex(); */ \
|
||||
} \
|
||||
\
|
||||
void emberAfLevelControlClusterServerTickCallbackWrapperFunction1(void) \
|
||||
{ \
|
||||
clusterTickWrapper(&emberAfLevelControlClusterServerTickCallbackControl1, emberAfLevelControlClusterServerTickCallback, \
|
||||
@@ -64,15 +57,9 @@
|
||||
|
||||
// EmberEventData structs used to populate the EmberEventData table
|
||||
#define EMBER_AF_GENERATED_EVENTS \
|
||||
{ &emberAfLevelControlClusterServerTickCallbackControl1, emberAfLevelControlClusterServerTickCallbackWrapperFunction1 }, \
|
||||
{ &emberAfPluginColorControlServerHueSatTransitionEventControl, \
|
||||
emberAfPluginColorControlServerHueSatTransitionEventHandler }, \
|
||||
{ &emberAfPluginColorControlServerTempTransitionEventControl, emberAfPluginColorControlServerTempTransitionEventHandler }, \
|
||||
{ &emberAfPluginColorControlServerXyTransitionEventControl, emberAfPluginColorControlServerXyTransitionEventHandler },
|
||||
{ &emberAfLevelControlClusterServerTickCallbackControl1, emberAfLevelControlClusterServerTickCallbackWrapperFunction1 },
|
||||
|
||||
#define EMBER_AF_GENERATED_EVENT_STRINGS \
|
||||
"Level Control Cluster Server EP 1", "Color Control Cluster Server Plugin HueSatTransition", \
|
||||
"Color Control Cluster Server Plugin TempTransition", "Color Control Cluster Server Plugin XyTransition",
|
||||
#define EMBER_AF_GENERATED_EVENT_STRINGS "Level Control Cluster Server EP 1",
|
||||
|
||||
// The length of the event context table used to track and retrieve cluster events
|
||||
#define EMBER_AF_EVENT_CONTEXT_LENGTH 1
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
|
||||
// THIS FILE IS GENERATED BY ZAP
|
||||
|
||||
#include <app/common/gen/af-structs.h>
|
||||
#include <app-common/zap-generated/af-structs.h>
|
||||
#include <app/util/af.h>
|
||||
#include <app/util/attribute-list-byte-span.h>
|
||||
#include <app/util/basic-types.h>
|
||||
#include <support/SafeInt.h>
|
||||
#include <support/logging/CHIPLogging.h>
|
||||
#include <lib/support/SafeInt.h>
|
||||
#include <lib/support/logging/CHIPLogging.h>
|
||||
|
||||
using namespace chip;
|
||||
using namespace chip::app::List;
|
||||
@@ -45,7 +45,8 @@ void copyListMember(uint8_t * dest, uint8_t * src, bool write, uint16_t * offset
|
||||
*offset = static_cast<uint16_t>(*offset + length);
|
||||
}
|
||||
|
||||
uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, bool write, uint8_t * dest, uint8_t * src, int32_t index)
|
||||
uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, bool write, uint8_t * dest, uint8_t * src,
|
||||
int32_t index)
|
||||
{
|
||||
if (index == -1)
|
||||
{
|
||||
@@ -58,12 +59,12 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
|
||||
if (write)
|
||||
{
|
||||
// src is a pointer to native-endian uint16_t, dest is pointer to buffer that should hold little-endian value
|
||||
emberAfCopyInt16u(dest, 0, *reinterpret_cast<uint16_t*>(src));
|
||||
emberAfCopyInt16u(dest, 0, *reinterpret_cast<uint16_t *>(src));
|
||||
}
|
||||
else
|
||||
{
|
||||
// src is pointer to buffer holding little-endian value, dest is a pointer to native-endian uint16_t
|
||||
*reinterpret_cast<uint16_t*>(dest) = emberAfGetInt16u(src, 0, kSizeLengthInBytes);
|
||||
*reinterpret_cast<uint16_t *>(dest) = emberAfGetInt16u(src, 0, kSizeLengthInBytes);
|
||||
}
|
||||
return kSizeLengthInBytes;
|
||||
}
|
||||
@@ -82,112 +83,361 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
|
||||
uint16_t entryOffset = kSizeLengthInBytes;
|
||||
switch (am->attributeId)
|
||||
{
|
||||
case 0x0000: // device list
|
||||
case 0x0000: // device list
|
||||
{
|
||||
entryLength = 6;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
entryLength = 6;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _DeviceType
|
||||
_DeviceType * entry = reinterpret_cast<_DeviceType *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *)&entry->type, write ? (uint8_t *)&entry->type : src, write, &entryOffset, sizeof(entry->type)); // DEVTYPE_ID
|
||||
copyListMember(write ? dest : (uint8_t *)&entry->revision, write ? (uint8_t *)&entry->revision : src, write, &entryOffset, sizeof(entry->revision)); // INT16U
|
||||
break;
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
case 0x0001: // server list
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _DeviceType
|
||||
_DeviceType * entry = reinterpret_cast<_DeviceType *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->type, write ? (uint8_t *) &entry->type : src, write, &entryOffset,
|
||||
sizeof(entry->type)); // DEVTYPE_ID
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->revision, write ? (uint8_t *) &entry->revision : src, write,
|
||||
&entryOffset, sizeof(entry->revision)); // INT16U
|
||||
break;
|
||||
}
|
||||
case 0x0001: // server list
|
||||
{
|
||||
entryLength = 4;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
entryLength = 4;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
copyListMember(dest, src, write, &entryOffset, entryLength); // CLUSTER_ID
|
||||
break;
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
case 0x0002: // client list
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
copyListMember(dest, src, write, &entryOffset, entryLength); // CLUSTER_ID
|
||||
break;
|
||||
}
|
||||
case 0x0002: // client list
|
||||
{
|
||||
entryLength = 4;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
entryLength = 4;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
copyListMember(dest, src, write, &entryOffset, entryLength); // CLUSTER_ID
|
||||
break;
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
case 0x0003: // parts list
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
copyListMember(dest, src, write, &entryOffset, entryLength); // CLUSTER_ID
|
||||
break;
|
||||
}
|
||||
case 0x0003: // parts list
|
||||
{
|
||||
entryLength = 2;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
entryLength = 2;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
copyListMember(dest, src, write, &entryOffset, entryLength); // ENDPOINT_NO
|
||||
break;
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
copyListMember(dest, src, write, &entryOffset, entryLength); // ENDPOINT_NO
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0x0030: // General Commissioning Cluster
|
||||
{
|
||||
uint16_t entryOffset = kSizeLengthInBytes;
|
||||
switch (am->attributeId)
|
||||
{
|
||||
case 0x0001: // BasicCommissioningInfoList
|
||||
case 0x0001: // BasicCommissioningInfoList
|
||||
{
|
||||
entryLength = 4;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
entryLength = 4;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _BasicCommissioningInfoType
|
||||
_BasicCommissioningInfoType * entry = reinterpret_cast<_BasicCommissioningInfoType *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *)&entry->FailSafeExpiryLengthMs, write ? (uint8_t *)&entry->FailSafeExpiryLengthMs : src, write, &entryOffset, sizeof(entry->FailSafeExpiryLengthMs)); // INT32U
|
||||
break;
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _BasicCommissioningInfoType
|
||||
_BasicCommissioningInfoType * entry = reinterpret_cast<_BasicCommissioningInfoType *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->FailSafeExpiryLengthMs,
|
||||
write ? (uint8_t *) &entry->FailSafeExpiryLengthMs : src, write, &entryOffset,
|
||||
sizeof(entry->FailSafeExpiryLengthMs)); // INT32U
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0x0033: // General Diagnostics Cluster
|
||||
{
|
||||
uint16_t entryOffset = kSizeLengthInBytes;
|
||||
switch (am->attributeId)
|
||||
{
|
||||
case 0x0000: // NetworkInterfaces
|
||||
{
|
||||
entryLength = 48;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _NetworkInterfaceType
|
||||
_NetworkInterfaceType * entry = reinterpret_cast<_NetworkInterfaceType *>(write ? src : dest);
|
||||
ByteSpan * NameSpan = &entry->Name; // OCTET_STRING
|
||||
if (CHIP_NO_ERROR !=
|
||||
(write ? WriteByteSpan(dest + entryOffset, 34, NameSpan) : ReadByteSpan(src + entryOffset, 34, NameSpan)))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(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
|
||||
ByteSpan * HardwareAddressSpan = &entry->HardwareAddress; // OCTET_STRING
|
||||
if (CHIP_NO_ERROR !=
|
||||
(write ? WriteByteSpan(dest + entryOffset, 10, HardwareAddressSpan)
|
||||
: ReadByteSpan(src + entryOffset, 10, HardwareAddressSpan)))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + 10);
|
||||
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;
|
||||
switch (am->attributeId)
|
||||
{
|
||||
case 0x0001: // fabrics list
|
||||
case 0x0001: // fabrics list
|
||||
{
|
||||
entryLength = 120;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
entryLength = 52;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _FabricDescriptor
|
||||
_FabricDescriptor * entry = reinterpret_cast<_FabricDescriptor *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *)&entry->FabricId, write ? (uint8_t *)&entry->FabricId : src, write, &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID
|
||||
copyListMember(write ? dest : (uint8_t *)&entry->VendorId, write ? (uint8_t *)&entry->VendorId : src, write, &entryOffset, sizeof(entry->VendorId)); // INT16U
|
||||
copyListMember(write ? dest : (uint8_t *)&entry->NodeId, write ? (uint8_t *)&entry->NodeId : src, write, &entryOffset, sizeof(entry->NodeId)); // NODE_ID
|
||||
ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING
|
||||
if (CHIP_NO_ERROR != (write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan)))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + 34);
|
||||
break;
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _FabricDescriptor
|
||||
_FabricDescriptor * entry = reinterpret_cast<_FabricDescriptor *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->FabricIndex, write ? (uint8_t *) &entry->FabricIndex : src, write,
|
||||
&entryOffset, sizeof(entry->FabricIndex)); // INT8U
|
||||
ByteSpan * RootPublicKeySpan = &entry->RootPublicKey; // OCTET_STRING
|
||||
if (CHIP_NO_ERROR !=
|
||||
(write ? WriteByteSpan(dest + entryOffset, 67, RootPublicKeySpan)
|
||||
: ReadByteSpan(src + entryOffset, 67, RootPublicKeySpan)))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + 67);
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write,
|
||||
&entryOffset, sizeof(entry->VendorId)); // INT16U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->FabricId, write ? (uint8_t *) &entry->FabricId : src, write,
|
||||
&entryOffset, sizeof(entry->FabricId)); // FABRIC_ID
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset,
|
||||
sizeof(entry->NodeId)); // NODE_ID
|
||||
ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING
|
||||
if (CHIP_NO_ERROR !=
|
||||
(write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan)))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + 34);
|
||||
break;
|
||||
}
|
||||
case 0x0004: // TrustedRootCertificates
|
||||
{
|
||||
entryOffset = GetByteSpanOffsetFromIndex(write ? dest : src, am->size, static_cast<uint16_t>(index - 1));
|
||||
if (entryOffset == 0)
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ByteSpan * trustedRootCertificatesSpan = reinterpret_cast<ByteSpan *>(write ? src : dest); // OCTET_STRING
|
||||
uint16_t trustedRootCertificatesRemainingSpace = static_cast<uint16_t>(am->size - entryOffset);
|
||||
if (CHIP_NO_ERROR !=
|
||||
(write ? WriteByteSpan(dest + entryOffset, trustedRootCertificatesRemainingSpace, trustedRootCertificatesSpan)
|
||||
: ReadByteSpan(src + entryOffset, trustedRootCertificatesRemainingSpace, trustedRootCertificatesSpan)))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!CanCastTo<uint16_t>(trustedRootCertificatesSpan->size()))
|
||||
{
|
||||
ChipLogError(Zcl, "Span size %zu is too large", trustedRootCertificatesSpan->size());
|
||||
return 0;
|
||||
}
|
||||
entryLength = static_cast<uint16_t>(trustedRootCertificatesSpan->size());
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0x0035: // Thread Network Diagnostics Cluster
|
||||
{
|
||||
uint16_t entryOffset = kSizeLengthInBytes;
|
||||
switch (am->attributeId)
|
||||
{
|
||||
case 0x0007: // NeighborTableList
|
||||
{
|
||||
entryLength = 31;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _NeighborTable
|
||||
_NeighborTable * entry = reinterpret_cast<_NeighborTable *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->ExtAddress, write ? (uint8_t *) &entry->ExtAddress : src, write,
|
||||
&entryOffset, sizeof(entry->ExtAddress)); // INT64U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->Age, write ? (uint8_t *) &entry->Age : src, write, &entryOffset,
|
||||
sizeof(entry->Age)); // INT32U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->Rloc16, write ? (uint8_t *) &entry->Rloc16 : src, write, &entryOffset,
|
||||
sizeof(entry->Rloc16)); // INT16U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->LinkFrameCounter, write ? (uint8_t *) &entry->LinkFrameCounter : src,
|
||||
write, &entryOffset, sizeof(entry->LinkFrameCounter)); // INT32U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->MleFrameCounter, write ? (uint8_t *) &entry->MleFrameCounter : src,
|
||||
write, &entryOffset, sizeof(entry->MleFrameCounter)); // INT32U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->LQI, write ? (uint8_t *) &entry->LQI : src, write, &entryOffset,
|
||||
sizeof(entry->LQI)); // INT8U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->AverageRssi, write ? (uint8_t *) &entry->AverageRssi : src, write,
|
||||
&entryOffset, sizeof(entry->AverageRssi)); // INT8S
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->LastRssi, write ? (uint8_t *) &entry->LastRssi : src, write,
|
||||
&entryOffset, sizeof(entry->LastRssi)); // INT8S
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->FrameErrorRate, write ? (uint8_t *) &entry->FrameErrorRate : src,
|
||||
write, &entryOffset, sizeof(entry->FrameErrorRate)); // INT8U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->MessageErrorRate, write ? (uint8_t *) &entry->MessageErrorRate : src,
|
||||
write, &entryOffset, sizeof(entry->MessageErrorRate)); // INT8U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->RxOnWhenIdle, write ? (uint8_t *) &entry->RxOnWhenIdle : src, write,
|
||||
&entryOffset, sizeof(entry->RxOnWhenIdle)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->FullThreadDevice, write ? (uint8_t *) &entry->FullThreadDevice : src,
|
||||
write, &entryOffset, sizeof(entry->FullThreadDevice)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->FullNetworkData, write ? (uint8_t *) &entry->FullNetworkData : src,
|
||||
write, &entryOffset, sizeof(entry->FullNetworkData)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->IsChild, write ? (uint8_t *) &entry->IsChild : src, write,
|
||||
&entryOffset, sizeof(entry->IsChild)); // BOOLEAN
|
||||
break;
|
||||
}
|
||||
case 0x0008: // RouteTableList
|
||||
{
|
||||
entryLength = 18;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _RouteTable
|
||||
_RouteTable * entry = reinterpret_cast<_RouteTable *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->ExtAddress, write ? (uint8_t *) &entry->ExtAddress : src, write,
|
||||
&entryOffset, sizeof(entry->ExtAddress)); // INT64U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->Rloc16, write ? (uint8_t *) &entry->Rloc16 : src, write, &entryOffset,
|
||||
sizeof(entry->Rloc16)); // INT16U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->RouterId, write ? (uint8_t *) &entry->RouterId : src, write,
|
||||
&entryOffset, sizeof(entry->RouterId)); // INT8U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->NextHop, write ? (uint8_t *) &entry->NextHop : src, write,
|
||||
&entryOffset, sizeof(entry->NextHop)); // INT8U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->PathCost, write ? (uint8_t *) &entry->PathCost : src, write,
|
||||
&entryOffset, sizeof(entry->PathCost)); // INT8U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->LQIIn, write ? (uint8_t *) &entry->LQIIn : src, write, &entryOffset,
|
||||
sizeof(entry->LQIIn)); // INT8U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->LQIOut, write ? (uint8_t *) &entry->LQIOut : src, write, &entryOffset,
|
||||
sizeof(entry->LQIOut)); // INT8U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->Age, write ? (uint8_t *) &entry->Age : src, write, &entryOffset,
|
||||
sizeof(entry->Age)); // INT8U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->Allocated, write ? (uint8_t *) &entry->Allocated : src, write,
|
||||
&entryOffset, sizeof(entry->Allocated)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->LinkEstablished, write ? (uint8_t *) &entry->LinkEstablished : src,
|
||||
write, &entryOffset, sizeof(entry->LinkEstablished)); // BOOLEAN
|
||||
break;
|
||||
}
|
||||
case 0x003B: // SecurityPolicy
|
||||
{
|
||||
entryLength = 4;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _SecurityPolicy
|
||||
_SecurityPolicy * entry = reinterpret_cast<_SecurityPolicy *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->RotationTime, write ? (uint8_t *) &entry->RotationTime : src, write,
|
||||
&entryOffset, sizeof(entry->RotationTime)); // INT16U
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->Flags, write ? (uint8_t *) &entry->Flags : src, write, &entryOffset,
|
||||
sizeof(entry->Flags)); // BITMAP16
|
||||
break;
|
||||
}
|
||||
case 0x003D: // OperationalDatasetComponents
|
||||
{
|
||||
entryLength = 12;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
// Struct _OperationalDatasetComponents
|
||||
_OperationalDatasetComponents * entry = reinterpret_cast<_OperationalDatasetComponents *>(write ? src : dest);
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->ActiveTimestampPresent,
|
||||
write ? (uint8_t *) &entry->ActiveTimestampPresent : src, write, &entryOffset,
|
||||
sizeof(entry->ActiveTimestampPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->PendingTimestampPresent,
|
||||
write ? (uint8_t *) &entry->PendingTimestampPresent : src, write, &entryOffset,
|
||||
sizeof(entry->PendingTimestampPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->MasterKeyPresent, write ? (uint8_t *) &entry->MasterKeyPresent : src,
|
||||
write, &entryOffset, sizeof(entry->MasterKeyPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->NetworkNamePresent,
|
||||
write ? (uint8_t *) &entry->NetworkNamePresent : src, write, &entryOffset,
|
||||
sizeof(entry->NetworkNamePresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->ExtendedPanIdPresent,
|
||||
write ? (uint8_t *) &entry->ExtendedPanIdPresent : src, write, &entryOffset,
|
||||
sizeof(entry->ExtendedPanIdPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->MeshLocalPrefixPresent,
|
||||
write ? (uint8_t *) &entry->MeshLocalPrefixPresent : src, write, &entryOffset,
|
||||
sizeof(entry->MeshLocalPrefixPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->DelayPresent, write ? (uint8_t *) &entry->DelayPresent : src, write,
|
||||
&entryOffset, sizeof(entry->DelayPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->PanIdPresent, write ? (uint8_t *) &entry->PanIdPresent : src, write,
|
||||
&entryOffset, sizeof(entry->PanIdPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->ChannelPresent, write ? (uint8_t *) &entry->ChannelPresent : src,
|
||||
write, &entryOffset, sizeof(entry->ChannelPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->PskcPresent, write ? (uint8_t *) &entry->PskcPresent : src, write,
|
||||
&entryOffset, sizeof(entry->PskcPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->SecurityPolicyPresent,
|
||||
write ? (uint8_t *) &entry->SecurityPolicyPresent : src, write, &entryOffset,
|
||||
sizeof(entry->SecurityPolicyPresent)); // BOOLEAN
|
||||
copyListMember(write ? dest : (uint8_t *) &entry->ChannelMaskPresent,
|
||||
write ? (uint8_t *) &entry->ChannelMaskPresent : src, write, &entryOffset,
|
||||
sizeof(entry->ChannelMaskPresent)); // BOOLEAN
|
||||
break;
|
||||
}
|
||||
case 0x003E: // ActiveNetworkFaultsList
|
||||
{
|
||||
entryLength = 1;
|
||||
if (((index - 1) * entryLength) > (am->size - entryLength))
|
||||
{
|
||||
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
|
||||
return 0;
|
||||
}
|
||||
entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
|
||||
copyListMember(dest, src, write, &entryOffset, entryLength); // NetworkFault
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,48 +461,87 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut
|
||||
case 0x001D: // Descriptor Cluster
|
||||
switch (attributeId)
|
||||
{
|
||||
case 0x0000: // device list
|
||||
case 0x0000: // device list
|
||||
// Struct _DeviceType
|
||||
entryLength = 6;
|
||||
break;
|
||||
case 0x0001: // server list
|
||||
case 0x0001: // server list
|
||||
// chip::ClusterId
|
||||
entryLength = 4;
|
||||
break;
|
||||
case 0x0002: // client list
|
||||
case 0x0002: // client list
|
||||
// chip::ClusterId
|
||||
entryLength = 4;
|
||||
break;
|
||||
case 0x0003: // parts list
|
||||
case 0x0003: // parts list
|
||||
// chip::EndpointId
|
||||
entryLength = 2;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 0x0030: // General Commissioning Cluster
|
||||
switch (attributeId)
|
||||
{
|
||||
case 0x0001: // BasicCommissioningInfoList
|
||||
case 0x0001: // BasicCommissioningInfoList
|
||||
// Struct _BasicCommissioningInfoType
|
||||
entryLength = 4;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 0x0033: // General Diagnostics Cluster
|
||||
switch (attributeId)
|
||||
{
|
||||
case 0x0000: // NetworkInterfaces
|
||||
// Struct _NetworkInterfaceType
|
||||
entryLength = 48;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 0x003E: // Operational Credentials Cluster
|
||||
switch (attributeId)
|
||||
{
|
||||
case 0x0001: // fabrics list
|
||||
case 0x0001: // fabrics list
|
||||
// Struct _FabricDescriptor
|
||||
entryLength = 52;
|
||||
entryLength = 120;
|
||||
break;
|
||||
case 0x0004: // TrustedRootCertificates
|
||||
// chip::ByteSpan
|
||||
return GetByteSpanOffsetFromIndex(buffer, 402, entryCount);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 0x0035: // Thread Network Diagnostics Cluster
|
||||
switch (attributeId)
|
||||
{
|
||||
case 0x0007: // NeighborTableList
|
||||
// Struct _NeighborTable
|
||||
entryLength = 31;
|
||||
break;
|
||||
case 0x0008: // RouteTableList
|
||||
// Struct _RouteTable
|
||||
entryLength = 18;
|
||||
break;
|
||||
case 0x003B: // SecurityPolicy
|
||||
// Struct _SecurityPolicy
|
||||
entryLength = 4;
|
||||
break;
|
||||
case 0x003D: // OperationalDatasetComponents
|
||||
// Struct _OperationalDatasetComponents
|
||||
entryLength = 12;
|
||||
break;
|
||||
case 0x003E: // ActiveNetworkFaultsList
|
||||
// uint8_t
|
||||
entryLength = 1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
uint32_t totalSize = kSizeLengthInBytes + (entryCount * entryLength);
|
||||
if (!CanCastTo<uint16_t>(totalSize))
|
||||
{
|
||||
ChipLogError(Zcl, "Cluster " ChipLogFormatMEI ": Size of attribute " ChipLogFormatMEI " is too large.", ChipLogValueMEI(clusterId), ChipLogValueMEI(attributeId));
|
||||
ChipLogError(Zcl, "Cluster " ChipLogFormatMEI ": Size of attribute " ChipLogFormatMEI " is too large.",
|
||||
ChipLogValueMEI(clusterId), ChipLogValueMEI(attributeId));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
// THIS FILE IS GENERATED BY ZAP
|
||||
|
||||
#include <app/common/gen/callback.h>
|
||||
#include <app/common/gen/cluster-id.h>
|
||||
#include <app-common/zap-generated/callback.h>
|
||||
#include <app-common/zap-generated/cluster-id.h>
|
||||
#include <lib/support/Span.h>
|
||||
|
||||
using namespace chip;
|
||||
@@ -28,34 +28,46 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId)
|
||||
{
|
||||
switch (clusterId)
|
||||
{
|
||||
case ZCL_ADMINISTRATOR_COMMISSIONING_CLUSTER_ID :
|
||||
case ZCL_ADMINISTRATOR_COMMISSIONING_CLUSTER_ID:
|
||||
emberAfAdministratorCommissioningClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_BASIC_CLUSTER_ID :
|
||||
case ZCL_BASIC_CLUSTER_ID:
|
||||
emberAfBasicClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_COLOR_CONTROL_CLUSTER_ID :
|
||||
case ZCL_COLOR_CONTROL_CLUSTER_ID:
|
||||
emberAfColorControlClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_DESCRIPTOR_CLUSTER_ID :
|
||||
case ZCL_DESCRIPTOR_CLUSTER_ID:
|
||||
emberAfDescriptorClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID :
|
||||
case ZCL_DIAGNOSTIC_LOGS_CLUSTER_ID:
|
||||
emberAfDiagnosticLogsClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID:
|
||||
emberAfGeneralCommissioningClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_LEVEL_CONTROL_CLUSTER_ID :
|
||||
case ZCL_GENERAL_DIAGNOSTICS_CLUSTER_ID:
|
||||
emberAfGeneralDiagnosticsClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_LEVEL_CONTROL_CLUSTER_ID:
|
||||
emberAfLevelControlClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID :
|
||||
case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID:
|
||||
emberAfNetworkCommissioningClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_ON_OFF_CLUSTER_ID :
|
||||
case ZCL_ON_OFF_CLUSTER_ID:
|
||||
emberAfOnOffClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID :
|
||||
case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID:
|
||||
emberAfOperationalCredentialsClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_ID :
|
||||
case ZCL_SOFTWARE_DIAGNOSTICS_CLUSTER_ID:
|
||||
emberAfSoftwareDiagnosticsClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_ID:
|
||||
emberAfThreadNetworkDiagnosticsClusterInitCallback(endpoint);
|
||||
break;
|
||||
case ZCL_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_ID:
|
||||
emberAfWiFiNetworkDiagnosticsClusterInitCallback(endpoint);
|
||||
break;
|
||||
default:
|
||||
@@ -84,11 +96,21 @@ void __attribute__((weak)) emberAfDescriptorClusterInitCallback(EndpointId endpo
|
||||
// To prevent warning
|
||||
(void) endpoint;
|
||||
}
|
||||
void __attribute__((weak)) emberAfDiagnosticLogsClusterInitCallback(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
|
||||
@@ -109,6 +131,16 @@ void __attribute__((weak)) emberAfOperationalCredentialsClusterInitCallback(Endp
|
||||
// To prevent warning
|
||||
(void) endpoint;
|
||||
}
|
||||
void __attribute__((weak)) emberAfSoftwareDiagnosticsClusterInitCallback(EndpointId endpoint)
|
||||
{
|
||||
// To prevent warning
|
||||
(void) endpoint;
|
||||
}
|
||||
void __attribute__((weak)) emberAfThreadNetworkDiagnosticsClusterInitCallback(EndpointId endpoint)
|
||||
{
|
||||
// To prevent warning
|
||||
(void) endpoint;
|
||||
}
|
||||
void __attribute__((weak)) emberAfWiFiNetworkDiagnosticsClusterInitCallback(EndpointId endpoint)
|
||||
{
|
||||
// To prevent warning
|
||||
@@ -179,10 +211,9 @@ void __attribute__((weak)) emberAfRemoveFromCurrentAppTasksCallback(EmberAfAppli
|
||||
* @param value Ver.: always
|
||||
* @param type Ver.: always
|
||||
*/
|
||||
EmberAfAttributeWritePermission __attribute__((weak)) emberAfAllowNetworkWriteAttributeCallback(
|
||||
EndpointId endpoint, ClusterId clusterId,
|
||||
AttributeId attributeId, uint8_t mask,
|
||||
uint16_t manufacturerCode, uint8_t * value, uint8_t type)
|
||||
EmberAfAttributeWritePermission __attribute__((weak))
|
||||
emberAfAllowNetworkWriteAttributeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
|
||||
uint16_t manufacturerCode, uint8_t * value, uint8_t type)
|
||||
{
|
||||
return EMBER_ZCL_ATTRIBUTE_WRITE_PERMISSION_ALLOW_WRITE_NORMAL; // Default
|
||||
}
|
||||
@@ -197,9 +228,8 @@ EmberAfAttributeWritePermission __attribute__((weak)) emberAfAllowNetworkWriteAt
|
||||
* @param manufacturerCode Ver.: always
|
||||
* @param attributeId Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfAttributeReadAccessCallback(
|
||||
EndpointId endpoint, ClusterId clusterId, uint16_t manufacturerCode,
|
||||
AttributeId attributeId)
|
||||
bool __attribute__((weak))
|
||||
emberAfAttributeReadAccessCallback(EndpointId endpoint, ClusterId clusterId, uint16_t manufacturerCode, AttributeId attributeId)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -214,9 +244,8 @@ bool __attribute__((weak)) emberAfAttributeReadAccessCallback(
|
||||
* @param manufacturerCode Ver.: always
|
||||
* @param attributeId Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfAttributeWriteAccessCallback(
|
||||
EndpointId endpoint, ClusterId clusterId, uint16_t manufacturerCode,
|
||||
AttributeId attributeId)
|
||||
bool __attribute__((weak))
|
||||
emberAfAttributeWriteAccessCallback(EndpointId endpoint, ClusterId clusterId, uint16_t manufacturerCode, AttributeId attributeId)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -233,8 +262,7 @@ bool __attribute__((weak)) emberAfAttributeWriteAccessCallback(
|
||||
* @param status Specifies either SUCCESS or the nature of the error that was
|
||||
* detected in the received command. Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfDefaultResponseCallback(
|
||||
ClusterId clusterId, CommandId commandId, EmberAfStatus status)
|
||||
bool __attribute__((weak)) emberAfDefaultResponseCallback(ClusterId clusterId, CommandId commandId, EmberAfStatus status)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -251,8 +279,7 @@ bool __attribute__((weak)) emberAfDefaultResponseCallback(
|
||||
* always
|
||||
* @param bufLen The length in bytes of the list. Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfConfigureReportingResponseCallback(
|
||||
ClusterId clusterId, uint8_t * buffer, uint16_t bufLen)
|
||||
bool __attribute__((weak)) emberAfConfigureReportingResponseCallback(ClusterId clusterId, uint8_t * buffer, uint16_t bufLen)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -269,8 +296,7 @@ bool __attribute__((weak)) emberAfConfigureReportingResponseCallback(
|
||||
* records. Ver.: always
|
||||
* @param bufLen The length in bytes of the list. Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfReadReportingConfigurationResponseCallback(
|
||||
ClusterId clusterId, uint8_t * buffer, uint16_t bufLen)
|
||||
bool __attribute__((weak)) emberAfReadReportingConfigurationResponseCallback(ClusterId clusterId, uint8_t * buffer, uint16_t bufLen)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -295,9 +321,8 @@ bool __attribute__((weak)) emberAfReadReportingConfigurationResponseCallback(
|
||||
* @param extended Indicates whether the response is in the extended format or
|
||||
* not. Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(
|
||||
ClusterId clusterId, bool discoveryComplete, uint8_t * buffer,
|
||||
uint16_t bufLen, bool extended)
|
||||
bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discoveryComplete, uint8_t * buffer,
|
||||
uint16_t bufLen, bool extended)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -316,9 +341,9 @@ bool __attribute__((weak)) emberAfDiscoverAttributesResponseCallback(
|
||||
* @param commandIdCount The length of bytes of the list, whish is the same as
|
||||
* the number of identifiers. Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfDiscoverCommandsGeneratedResponseCallback(
|
||||
ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete,
|
||||
CommandId * commandIds, uint16_t commandIdCount)
|
||||
bool __attribute__((weak))
|
||||
emberAfDiscoverCommandsGeneratedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete,
|
||||
CommandId * commandIds, uint16_t commandIdCount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -337,9 +362,9 @@ bool __attribute__((weak)) emberAfDiscoverCommandsGeneratedResponseCallback(
|
||||
* @param commandIdCount The length of bytes of the list, whish is the same as
|
||||
* the number of identifiers. Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfDiscoverCommandsReceivedResponseCallback(
|
||||
ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete,
|
||||
CommandId * commandIds, uint16_t commandIdCount)
|
||||
bool __attribute__((weak))
|
||||
emberAfDiscoverCommandsReceivedResponseCallback(ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete,
|
||||
CommandId * commandIds, uint16_t commandIdCount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -357,8 +382,7 @@ bool __attribute__((weak)) emberAfDiscoverCommandsReceivedResponseCallback(
|
||||
*
|
||||
* @param cmd Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfPreCommandReceivedCallback(
|
||||
EmberAfClusterCommand * cmd)
|
||||
bool __attribute__((weak)) emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -382,8 +406,7 @@ bool __attribute__((weak)) emberAfPreCommandReceivedCallback(
|
||||
* @param status A pointer to the status code value that will be returned to the
|
||||
* caller. Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfPreMessageSendCallback(
|
||||
EmberAfMessageStruct * messageStruct, EmberStatus * status)
|
||||
bool __attribute__((weak)) emberAfPreMessageSendCallback(EmberAfMessageStruct * messageStruct, EmberStatus * status)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -406,10 +429,8 @@ bool __attribute__((weak)) emberAfPreMessageSendCallback(
|
||||
* @param message Ver.: always
|
||||
* @param status Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfMessageSentCallback(
|
||||
const MessageSendDestination & destination,
|
||||
EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message,
|
||||
EmberStatus status)
|
||||
bool __attribute__((weak)) emberAfMessageSentCallback(const MessageSendDestination & destination, EmberApsFrame * apsFrame,
|
||||
uint16_t msgLen, uint8_t * message, EmberStatus status)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -431,10 +452,9 @@ bool __attribute__((weak)) emberAfMessageSentCallback(
|
||||
* @param size Ver.: always
|
||||
* @param value Ver.: always
|
||||
*/
|
||||
EmberAfStatus __attribute__((weak)) emberAfPreAttributeChangeCallback(
|
||||
EndpointId endpoint, ClusterId clusterId, AttributeId attributeId,
|
||||
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size,
|
||||
uint8_t * value)
|
||||
EmberAfStatus __attribute__((weak))
|
||||
emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
|
||||
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
|
||||
{
|
||||
return EMBER_ZCL_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -454,12 +474,10 @@ EmberAfStatus __attribute__((weak)) emberAfPreAttributeChangeCallback(
|
||||
* @param size Ver.: always
|
||||
* @param value Ver.: always
|
||||
*/
|
||||
void __attribute__((weak)) emberAfPostAttributeChangeCallback(
|
||||
EndpointId endpoint, ClusterId clusterId, AttributeId attributeId,
|
||||
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size,
|
||||
uint8_t * value)
|
||||
{
|
||||
}
|
||||
void __attribute__((weak))
|
||||
emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
|
||||
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
|
||||
{}
|
||||
|
||||
/** @brief External Attribute Read
|
||||
*
|
||||
@@ -498,10 +516,9 @@ void __attribute__((weak)) emberAfPostAttributeChangeCallback(
|
||||
* @param maxReadLength Ver.: always
|
||||
* @param index Ver.: always
|
||||
*/
|
||||
EmberAfStatus __attribute__((weak)) emberAfExternalAttributeReadCallback(
|
||||
EndpointId endpoint, ClusterId clusterId,
|
||||
EmberAfAttributeMetadata * attributeMetadata, uint16_t manufacturerCode,
|
||||
uint8_t * buffer, uint16_t maxReadLength, int32_t index)
|
||||
EmberAfStatus __attribute__((weak))
|
||||
emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId, EmberAfAttributeMetadata * attributeMetadata,
|
||||
uint16_t manufacturerCode, uint8_t * buffer, uint16_t maxReadLength, int32_t index)
|
||||
{
|
||||
return EMBER_ZCL_STATUS_FAILURE;
|
||||
}
|
||||
@@ -553,10 +570,9 @@ EmberAfStatus __attribute__((weak)) emberAfExternalAttributeReadCallback(
|
||||
* @param buffer Ver.: always
|
||||
* @param index Ver.: always
|
||||
*/
|
||||
EmberAfStatus __attribute__((weak)) emberAfExternalAttributeWriteCallback(
|
||||
EndpointId endpoint, ClusterId clusterId,
|
||||
EmberAfAttributeMetadata * attributeMetadata, uint16_t manufacturerCode,
|
||||
uint8_t * buffer, int32_t index)
|
||||
EmberAfStatus __attribute__((weak))
|
||||
emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId, EmberAfAttributeMetadata * attributeMetadata,
|
||||
uint16_t manufacturerCode, uint8_t * buffer, int32_t index)
|
||||
{
|
||||
return EMBER_ZCL_STATUS_FAILURE;
|
||||
}
|
||||
@@ -572,8 +588,7 @@ EmberAfStatus __attribute__((weak)) emberAfExternalAttributeWriteCallback(
|
||||
* always
|
||||
* @param bufLen The length in bytes of the list. Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfReportAttributesCallback(
|
||||
ClusterId clusterId, uint8_t * buffer, uint16_t bufLen)
|
||||
bool __attribute__((weak)) emberAfReportAttributesCallback(ClusterId clusterId, uint8_t * buffer, uint16_t bufLen)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -609,9 +624,8 @@ uint32_t __attribute__((weak)) emberAfGetCurrentTimeCallback()
|
||||
* @param returnEndpointInfo A pointer to a data struct that will be written
|
||||
* with information about the endpoint. Ver.: always
|
||||
*/
|
||||
bool __attribute__((weak)) emberAfGetEndpointInfoCallback(
|
||||
EndpointId endpoint, uint8_t * returnNetworkIndex,
|
||||
EmberAfEndpointInfoStruct * returnEndpointInfo)
|
||||
bool __attribute__((weak))
|
||||
emberAfGetEndpointInfoCallback(EndpointId endpoint, uint8_t * returnNetworkIndex, EmberAfEndpointInfoStruct * returnEndpointInfo)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -634,8 +648,8 @@ void __attribute__((weak)) emberAfRegistrationAbortCallback() {}
|
||||
* always
|
||||
* @param message The message data received or to send. Ver.: always
|
||||
*/
|
||||
EmberStatus __attribute__((weak)) emberAfInterpanSendMessageCallback(
|
||||
EmberAfInterpanHeader * header, uint16_t messageLength, uint8_t * message)
|
||||
EmberStatus __attribute__((weak))
|
||||
emberAfInterpanSendMessageCallback(EmberAfInterpanHeader * header, uint16_t messageLength, uint8_t * message)
|
||||
{
|
||||
return EMBER_LIBRARY_NOT_PRESENT;
|
||||
}
|
||||
|
||||
@@ -16,3 +16,4 @@
|
||||
*/
|
||||
|
||||
// THIS FILE IS GENERATED BY ZAP
|
||||
|
||||
|
||||
@@ -16,3 +16,4 @@
|
||||
*/
|
||||
|
||||
// THIS FILE IS GENERATED BY ZAP
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,7 +26,6 @@
|
||||
/**** Network Section ****/
|
||||
#define EMBER_SUPPORTED_NETWORKS (1)
|
||||
|
||||
|
||||
#define EMBER_APS_UNICAST_MESSAGE_COUNT 10
|
||||
|
||||
/**** Cluster endpoint counts ****/
|
||||
@@ -34,11 +33,15 @@
|
||||
#define EMBER_AF_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (1)
|
||||
#define EMBER_AF_COLOR_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1)
|
||||
#define EMBER_AF_DESCRIPTOR_CLUSTER_SERVER_ENDPOINT_COUNT (2)
|
||||
#define EMBER_AF_DIAGNOSTIC_LOGS_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_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1)
|
||||
#define EMBER_AF_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1)
|
||||
#define EMBER_AF_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1)
|
||||
|
||||
/**** Cluster Plugins ****/
|
||||
@@ -67,11 +70,21 @@
|
||||
#define EMBER_AF_PLUGIN_DESCRIPTOR_SERVER
|
||||
#define EMBER_AF_PLUGIN_DESCRIPTOR
|
||||
|
||||
// Use this macro to check if the server side of the Diagnostic Logs cluster is included
|
||||
#define ZCL_USING_DIAGNOSTIC_LOGS_CLUSTER_SERVER
|
||||
#define EMBER_AF_PLUGIN_DIAGNOSTIC_LOGS_SERVER
|
||||
#define EMBER_AF_PLUGIN_DIAGNOSTIC_LOGS
|
||||
|
||||
// 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 server side of the Level Control cluster is included
|
||||
#define ZCL_USING_LEVEL_CONTROL_CLUSTER_SERVER
|
||||
#define EMBER_AF_PLUGIN_LEVEL_CONTROL_SERVER
|
||||
@@ -96,6 +109,16 @@
|
||||
#define EMBER_AF_PLUGIN_OPERATIONAL_CREDENTIALS_SERVER
|
||||
#define EMBER_AF_PLUGIN_OPERATIONAL_CREDENTIALS
|
||||
|
||||
// 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 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
|
||||
#define EMBER_AF_PLUGIN_THREAD_NETWORK_DIAGNOSTICS
|
||||
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user