Other Parts Discussed in Thread: TIMAC
Tool/software:
I use the TIMAC v1.5.2 SDK.. The original code is below.
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; }
my modified coding is "MAC_SHORT_ADDR_BROADCAST" instead of "msa_DeviceRecord[index].devShortAddr" at 15th row.
Question)this is a broadcast communication, there is no need to specify an index.
So how can I modify the below part?
7th row : msa_Data1[1] = HI_UINT16(msa_DeviceRecord[index].devShortAddr);
8th row : msa_Data1[2] = LO_UINT16(msa_DeviceRecord[index].devShortAddr);
14th row : msa_DeviceRecord[index].isDirectMsg,
What do you think about this?
7th row : msa_Data1[1] = HI_UINT16(MSA_PAN_ID);
8th row : msa_Data1[2] = LO_UINT16(MSA_PAN_ID);
14th row : TRUE,
the coordinator and the device same as above coding.