This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

zcl_SendReportCmd使用咨询

    在sensortagapp例程里,发送16位温度给协调器的初始化如下,

   有几个疑问请教一下:

 1.pReportCmd->numAttr = 1;1是什么意思?代表数据的长度还是?

2.pReportCmd->attrList[0].attrID 是代表数据类型是温度数据?这个也可以随便设置的吧?

3.pReportCmd->attrList[0].dataType和pReportCmd->attrList[0].attrData是对应的吧?

4.这里是发送16位(2个字节)的数据,如果我要发送3个字节的数据,参数配置有什么不同?

// Fill in the single attribute information for the temperature reading
    pReportCmd->numAttr = 1;
    pReportCmd->attrList[0].attrID = ATTRID_MS_TEMPERATURE_MEASURED_VALUE;
    pReportCmd->attrList[0].dataType = ZCL_DATATYPE_INT16;
    pReportCmd->attrList[0].attrData = (void *) (&staTempMeasuredValue);

// Call ZCL function to send the report
    zcl_SendReportCmd(SENSORTAGAPP_TS_EP, &dstAddr,
                      ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT, pReportCmd,
                      ZCL_FRAME_SERVER_CLIENT_DIR, true, staTransID++);