Skip to content

Commit

Permalink
add basic callbacks to clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
devbis committed Feb 5, 2024
1 parent f186ec2 commit 785c466
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/sensorEpCfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions src/zcl_sensorCb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
/*********************************************************************
Expand Down

0 comments on commit 785c466

Please sign in to comment.