From 3ee207cdf6d245e025bbe7f4388b612c0654b22f Mon Sep 17 00:00:00 2001 From: Ivan Belokobylskiy Date: Tue, 10 Oct 2023 00:19:42 +0400 Subject: [PATCH] add basic callbacks to clusters --- src/device.h | 4 ++++ src/sensorEpCfg.c | 4 ++-- src/zcl_sensorCb.c | 9 +++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/device.h b/src/device.h index 23367c5..805a929 100644 --- a/src/device.h +++ b/src/device.h @@ -190,8 +190,12 @@ status_t sensorDevice_basicCb(zclIncomingAddrInfo_t *pAddrInfo, u8 cmdId, void * status_t sensorDevice_identifyCb(zclIncomingAddrInfo_t *pAddrInfo, u8 cmdId, void *cmdPayload); status_t sensorDevice_iasZoneCb(zclIncomingAddrInfo_t *pAddrInfo, u8 cmdId, void *cmdPayload); status_t sensorDevice_powerCfgCb(zclIncomingAddrInfo_t *pAddrInfo, u8 cmdId, void *cmdPayload); +status_t sensorDevice_temperatureCb(zclIncomingAddrInfo_t *pAddrInfo, u8 cmdId, void *cmdPayload); +status_t sensorDevice_humidityCb(zclIncomingAddrInfo_t *pAddrInfo, u8 cmdId, void *cmdPayload); +#ifdef ZCL_POLL_CTRL status_t sensorDevice_pollCtrlCb(zclIncomingAddrInfo_t *pAddrInfo, u8 cmdId, void *cmdPayload); void sensorDevice_zclCheckInStart(void); +#endif void sensorDevice_leaveCnfHandler(nlme_leave_cnf_t *pLeaveCnf); void sensorDevice_leaveIndHandler(nlme_leave_ind_t *pLeaveInd); diff --git a/src/sensorEpCfg.c b/src/sensorEpCfg.c index 25b30de..101aa3a 100644 --- a/src/sensorEpCfg.c +++ b/src/sensorEpCfg.c @@ -314,10 +314,10 @@ const zcl_specClusterInfo_t g_sensorDeviceClusterList[] = {ZCL_CLUSTER_SS_IAS_ZONE, MANUFACTURER_CODE_NONE, ZCL_IASZONE_ATTR_NUM, iasZone_attrTbl, zcl_iasZone_register, sensorDevice_iasZoneCb}, #endif #ifdef ZCL_TEMPERATURE_MEASUREMENT - {ZCL_CLUSTER_MS_TEMPERATURE_MEASUREMENT, MANUFACTURER_CODE_TELINK, ZCL_TEMPERATURE_MEASUREMENT_ATTR_NUM, temperature_measurement_attrTbl, zcl_temperature_measurement_register, NULL}, + {ZCL_CLUSTER_MS_TEMPERATURE_MEASUREMENT, MANUFACTURER_CODE_TELINK, ZCL_TEMPERATURE_MEASUREMENT_ATTR_NUM, temperature_measurement_attrTbl, zcl_temperature_measurement_register, sensorDevice_temperatureCb}, #endif #ifdef ZCL_RELATIVE_HUMIDITY - {ZCL_CLUSTER_MS_RELATIVE_HUMIDITY, MANUFACTURER_CODE_TELINK, ZCL_RELATIVE_HUMIDITY_ATTR_NUM, relative_humdity_attrTbl, zcl_relative_humidity_register, NULL}, + {ZCL_CLUSTER_MS_RELATIVE_HUMIDITY, MANUFACTURER_CODE_TELINK, ZCL_RELATIVE_HUMIDITY_ATTR_NUM, relative_humdity_attrTbl, zcl_relative_humidity_register, sensorDevice_humidityCb}, #endif #ifdef ZCL_THERMOSTAT_UI_CFG // typo in SDK diff --git a/src/zcl_sensorCb.c b/src/zcl_sensorCb.c index 011cbc5..2aa3af5 100644 --- a/src/zcl_sensorCb.c +++ b/src/zcl_sensorCb.c @@ -469,6 +469,15 @@ status_t sensorDevice_powerCfgCb(zclIncomingAddrInfo_t *pAddrInfo, u8 cmdId, voi return ZCL_STA_SUCCESS; } +status_t sensorDevice_temperatureCb(zclIncomingAddrInfo_t *pAddrInfo, u8 cmdId, void *cmdPayload) +{ + return ZCL_STA_SUCCESS; +} + +status_t sensorDevice_humidityCb(zclIncomingAddrInfo_t *pAddrInfo, u8 cmdId, void *cmdPayload) +{ + return ZCL_STA_SUCCESS; +} #ifdef ZCL_IAS_ZONE /*********************************************************************