Thread 中讨论的其他器件:Z-stack
您好!
在前面的帖子之后、我现在通过了以下步骤:
1) 1)协调器成功启动网络
2) 2)终端设备成功加入网络
现在、我希望终端设备向协调器发送包含"Hello World"等字符串的消息。
我应该怎么做?
我正在使用 Z-stack 3、IAR 编译器、温度传感器和恒温器示例应用。
谢谢
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.
您好!
请参阅此相关文章 :https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/p/780670/2886600#2886600
此致、
Toby
谢谢、
假设温度为已知值、等于25。 现在、我希望终端设备将此值发送给协调器。 此函数是否适用于此情况? 我不确定我的寻址和 zcl_SendReportCmd 参数。
静态空 zclSampleTemperatureSensor_SendTemp(空)
{
zclReportCmd_t *pReportCmd;
pReportCmd = osal_mem_alloc (sizeof (zclReportCmd_t)+ sizeof (zclReport_t));
if (pReportCmd!= NULL)
{
uint8 zclSampleTemperatureSensorSeqNum;
uint8 * my_temp;
* my_temp = 25;
afAddrType_t * destination_address;
destination_address->addr.shortAddr = 0x0000;
destination_address->addrMode = Addr16Bit;
destination_address->endpoint = 0;
pReportCmd->numAttr = 1;
pReportCmd->attrList[0].attrID = 0x0020;//ATTRID_MS_TEMP_TEMPERATE_meased_value;
pReportCmd->atList[0].datatype = ZCL_datatype_uint8;
pReportCmd->attrList[0].attrData = my_temp;
zcl_SendReportCmd (SAMPLETEMPERATURESENSOR_终结 点、destination_address、
ZCL_CLUSTER_ID_GEN_ANALOG_INPUT_BASIC、
pReportCmd、ZCL_FRAME_SERVER_CLIENT_DIR、TRUE、zclSampleTemperatureSensorSeqNum);
zclSampleTemperatureSensorSeqNum++;
}
OSAL_mem_free( pReportCmd );
}