主题:TIMAC 中讨论的其他器件
工具/软件:
我使用的是 TIMAC v1.5.2 SDK。 原始代码如下。
if (msa_IsCoordinator)
{ //HAL_TURN_ON_LED2();//red
if (MSA_PACKET_LENGTH >= MSA_HEADER_LENGTH)
{
/* Coordinator sending to devices. Use the associated list of device to send out msg */
msa_Data1[0] = MSA_PACKET_LENGTH;
msa_Data1[1] = HI_UINT16(msa_DeviceRecord[index].devShortAddr);
msa_Data1[2] = LO_UINT16(msa_DeviceRecord[index].devShortAddr);
msa_Data1[3] = sequence;
}
MSA_McpsDataReq((uint8*)msa_Data1,
MSA_PACKET_LENGTH,
msa_DeviceRecord[index].isDirectMsg,
msa_DeviceRecord[index].devShortAddr );
/* Reset the index if it reaches the current number of associated devices */
if (++index == msa_NumOfDevices)
{
index = 0;
}
我修改后的编码是"MAC_SHORT_ADDR_BROADCAST"、而不是第15行的"MSA_DeviceRecord[index].devShortAddr"。
问题)这是广播通信、无需指定索引。
如何修改以下器件呢?
第7行:MSA_DATA1[1]= HI_UINT16(MSA_DeviceRecord[index].devShortAddr);
第8行: MSA_DATA1[2]= LO_UINT16(MSA_DeviceRecord[index].devShortAddr);
第14行: MSA_DeviceRecord[index].isDirectMsg、
您对此有何看法?
第7行:MSA_DATA1[1]= HI_UINT16(MSA_PAN_ID);
第8行: MSA_DATA1[2]= LO_UINT16(MSA_PAN_ID);
第14行:真、
协调器和器件的操作与上述编码相同。