Other Parts Discussed in Thread: TIMAC, SIMPLELINK-CC13XX-CC26XX-SDK
uint8 msa_BeaconPayload[] = {0x22, 0x33, 0x44};
uint8 msa_BeaconPayloadLen = 3;
可以在网络运行的时候去修改信标帧的载荷吗,如果可以,应该怎么去修改,修改完毕后,需要重启设备吗
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.
uint8 msa_BeaconPayloadLen = 6;
uint8 msa_BeaconPayload = {0x22,0x33,0x44,0xaa,0xbb,0xcc};
/* Setup MAC_BEACON_PAYLOAD_LENGTH */
MAC_MlmeSetReq(MAC_BEACON_PAYLOAD_LENGTH, &msa_BeaconPayloadLen);
/* Setup MAC_BEACON_PAYLOAD */
MAC_MlmeSetReq(MAC_BEACON_PAYLOAD, &msa_BeaconPayload);
是的,使用的就是 MAC_MlmeSetReq (MAC_BEACON_PAYLOAD, &msa_BeaconPayload) ,但是修改完成后发现信标载荷是随机变化的,并不是修改后的信标载荷。
您好,
如果保留 NV 内存,协调器和节点不必重新建立网络连接。如果保留长度或者在有效载荷本身之后改变长度,信标有效载荷是否会改变?您使用什么版本的 TIMAC?是否能够从 mac_pib.c 调试 MAC_MlmeSetReq 以进一步确定 pMacPib->pBeaconPayload 是否设置为 pValue?此外,他们是否尝试过增加第一个信标有效负载值,或与此相关的整个数据包内容?
原文:The coordinator and nodes should not have to re-establish network connections if NV memory is retained. Does the Beacon Payload change if the length is retained or if the length is changed after the payload itself? What version of TIMAC are they using? Are they able to debug MAC_MlmeSetReq from mac_pib.c to further determine whether pMacPib->pBeaconPayload is set to pValue? Also, have they tried incrementing the first beacon payload value, or the entire packet contents for that matter?
case 0xA2: if(Beacon_Receive[4] != MSA_DEVICE_NUMBER) { HalUARTWrite(HAL_UART_PORT_0 , "The Enddevice Sleep" , sizeof("The Enddevice Sleep")); osal_set_event(MSA_TaskId, DEVICE_SLEEP_EVENT); } else { HalUARTWrite(HAL_UART_PORT_0 , "The Enddevice Data_Send Command" , sizeof("The Enddevice Data_Send Command")); } /* 休眠事件 */ if(events & DEVICE_SLEEP_EVENT) { setSleepPeriod(10); setPowerMode(2); } /*************************************************************************************************** 设置睡眠时间 ***************************************************************************************************/ static void setSleepPeriod(uint8 nS) { uint32 sleepTimer = 0; sleepTimer = (uint32)ST0; sleepTimer |= (uint32)ST1 << 8; sleepTimer |= (uint32)ST2 << 16; sleepTimer += (uint32)nS * 32768; ST2 = (uint8)(sleepTimer >> 16); ST1 = (uint8)(sleepTimer >> 8); ST0 = (uint8)(sleepTimer); } /*************************************************************************************************** 设置睡眠模式 ***************************************************************************************************/ static void setPowerMode(uint8 mode) { if(mode > 0 && mode < 4) { SLEEPCMD |= mode; //设置系统睡眠模式 PCON = 0x01; //进入睡眠模式 ,通过中断唤醒 } else { PCON = 0x00; //主动/空闲模 通过中断唤醒系统 } }
您好,
工程师回复道:
我们从 SIMPLELINK-CC13XX-CC26XX-SDK 中的 TI 15.4-Stack 获取了一个程序。请客户修改mac_pib.c如下:
#define MAC_PIB_MAX_BEACON_PAYLOAD_LEN 16
uint8 MAC_MlmeSetReq(uint8 pibAttribute, void *pValue)
{
uint8 i;
halIntState_t intState;
uint8 macBeaconPayload[MAC_PIB_MAX_BEACON_PAYLOAD_LEN] = {0};
if (pibAttribute == MAC_BEACON_PAYLOAD)
{
osal_memcpy((void *)macBeaconPayload, pValue, MAC_PIB_MAX_BEACON_PAYLOAD_LEN);
pMacPib->pBeaconPayload = (uint8 *)macBeaconPayload;;
return MAC_SUCCESS;
}
//...
然后请告诉我们这改变会导致什么发生。在debugger内部,您还可以进一步评估内存(Memory)或观察表达式视图(Watch Expressions View)中的 macPib 更改。