Quantcast
Channel: Wireless Connectivity
Viewing all articles
Browse latest Browse all 116964

Forum Post: RE: How to modify SampleLight to send other HomeAutomation command

$
0
0

Dears,

You can refer to the following code to report temperature, which is derive from zcl_SendReportCmd and home automation profile spec.

  uint8 *pReportCmdBuf=NULL;
  uint8 *pReportCmdData=NULL;
  zclReportCmd_t *reportCmd=NULL;
  pReportCmdBuf = (uint8 *)osal_mem_alloc( sizeof(uint8)*1 + sizeof(zclReport_t) );
  pReportCmdData = (uint8 *)osal_mem_alloc( sizeof(uint16) );
  reportCmd = (zclReportCmd_t *)pReportCmdBuf;
  reportCmd->numAttr=1;
  reportCmd->attrList->attrID = ATTRID_MS_TEMPERATURE_MEASURED_VALUE;
  reportCmd->attrList->dataType = ZCL_DATATYPE_INT16;
  reportCmd->attrList->attrData = (uint8*)pReportCmdData; // fill temperature data here.

  zcl_SendReportCmd( TS_ENDPOINT, &TS_DstAddr,
                  ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT, reportCmd,
                  ZCL_FRAME_CLIENT_SERVER_DIR, TRUE, transNum++ );


  uint8 *pReportCmdBuf=NULL;
  uint8 *pReportCmdData=NULL;
  zclReportCmd_t *reportCmd=NULL;
  pReportCmdBuf = (uint8 *)osal_mem_alloc( sizeof(uint8)*1 + sizeof(zclReport_t) );
  pReportCmdData = (uint8 *)osal_mem_alloc( sizeof(uint16) );
  reportCmd = (zclReportCmd_t *)pReportCmdBuf;
  reportCmd->numAttr=1;
  reportCmd->attrList->attrID = ATTRID_MS_TEMPERATURE_MEASURED_VALUE;
  reportCmd->attrList->dataType = ZCL_DATATYPE_INT16;


Viewing all articles
Browse latest Browse all 116964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>