1. 就别切了,直接把那个sniff的startTrigger改为TRIG_NOW, 基本也就是直接接收了.
startTrigger.triggerType = TRIG_NOW;
把如下的语句屏蔽掉
/* Set next wakeup time in the future */
RF_cmdPropRxSniff.startTime += WOR_WAKE_UP_INTERVAL_RAT_TICKS(WOR_WAKEUPS_PER_SECOND)*3;
void wor_wakeup(void)
[
/* Request access to the radio */
rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
/* Set frequency */
RF_runCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, &callback, 0);
/* Save the current radio time */
RF_cmdPropRxSniff.startTrigger.triggerType = TRIG_NOW;
RF_cmdPropRxSniff.startTime = RF_getCurrentTime();
while(1)
[
packetLength = 0x0;
/* Set next wakeup time in the future */
//RF_cmdPropRxSniff.startTime += WOR_WAKE_UP_INTERVAL_RAT_TICKS(WOR_WAKEUPS_PER_SECOND)*3;
//RF_cmdPropRxSniff.endTime = RF_cmdPropRxSniff.startTime + 160000;
/* Schedule RX */
RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropRxSniff, RF_PriorityNormal, &callback, RF_EventRxEntryDone);
/* Log RX_SNIFF status */
switch(RF_cmdPropRxSniff.status) [
case PROP_DONE_IDLE://0x3407
/* Idle based on RSSI */
worStatistics.doneIdle++;
// PIN_setOutputValue(ledPinHandle, Board_PIN_LED2,!PIN_getOutputValue(Board_PIN_LED2));
break;
case PROP_DONE_IDLETIMEOUT://0x3409
/* Idle based on PQT */
worStatistics.doneIdleTimeout++;
//.endTrigger.triggerType = TRIG_ABSTIME,//TRIG_REL_START,//TRIG_NOW TRIG_NEVER TRIG_REL_START
// PIN_setOutputValue(ledPinHandle, Board_PIN_LED2,!PIN_getOutputValue(Board_PIN_LED2));
break;
case PROP_DONE_RXTIMEOUT://0x3401
/* Got valid preamble on the air, but did not find sync word */
worStatistics.doneRxTimeout++;
// PIN_setOutputValue(ledPinHandle, Board_PIN_LED2,!PIN_getOutputValue(Board_PIN_LED2));
break;
case PROP_DONE_OK:// 0x3400
/* Received packet */
worStatistics.doneOk++;
process_wakeupData();
if(packetLength)
[
PIN_setOutputValue(ledPinHandle, Board_PIN_LED0,!PIN_getOutputValue(Board_PIN_LED0));
RF_close(rfHandle);
return;
]
else
[
PIN_setOutputValue(ledPinHandle, Board_PIN_LED0,!PIN_getOutputValue(Board_PIN_LED0));
]
break;
default:
/* Unhandled status */
break;
];
]
]
1. 就别切了,直接把那个sniff的startTrigger改为TRIG_NOW, 基本也就是直接接收了.
startTrigger.triggerType = TRIG_NOW;
把如下的语句屏蔽掉
/* Set next wakeup time in the future */
RF_cmdPropRxSniff.startTime += WOR_WAKE_UP_INTERVAL_RAT_TICKS(WOR_WAKEUPS_PER_SECOND)*3;
void wor_wakeup(void)
[
/* Request access to the radio */
rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
/* Set frequency */
RF_runCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, &callback, 0);
/* Save the current radio time */
RF_cmdPropRxSniff.startTrigger.triggerType = TRIG_NOW;
RF_cmdPropRxSniff.startTime = RF_getCurrentTime();
while(1)
[
packetLength = 0x0;
/* Set next wakeup time in the future */
//RF_cmdPropRxSniff.startTime += WOR_WAKE_UP_INTERVAL_RAT_TICKS(WOR_WAKEUPS_PER_SECOND)*3;
//RF_cmdPropRxSniff.endTime = RF_cmdPropRxSniff.startTime + 160000;
/* Schedule RX */
RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropRxSniff, RF_PriorityNormal, &callback, RF_EventRxEntryDone);
/* Log RX_SNIFF status */
switch(RF_cmdPropRxSniff.status) [
case PROP_DONE_IDLE://0x3407
/* Idle based on RSSI */
worStatistics.doneIdle++;
// PIN_setOutputValue(ledPinHandle, Board_PIN_LED2,!PIN_getOutputValue(Board_PIN_LED2));
break;
case PROP_DONE_IDLETIMEOUT://0x3409
/* Idle based on PQT */
worStatistics.doneIdleTimeout++;
//.endTrigger.triggerType = TRIG_ABSTIME,//TRIG_REL_START,//TRIG_NOW TRIG_NEVER TRIG_REL_START
// PIN_setOutputValue(ledPinHandle, Board_PIN_LED2,!PIN_getOutputValue(Board_PIN_LED2));
break;
case PROP_DONE_RXTIMEOUT://0x3401
/* Got valid preamble on the air, but did not find sync word */
worStatistics.doneRxTimeout++;
// PIN_setOutputValue(ledPinHandle, Board_PIN_LED2,!PIN_getOutputValue(Board_PIN_LED2));
break;
case PROP_DONE_OK:// 0x3400
/* Received packet */
worStatistics.doneOk++;
process_wakeupData();
if(packetLength)
[
PIN_setOutputValue(ledPinHandle, Board_PIN_LED0,!PIN_getOutputValue(Board_PIN_LED0));
RF_close(rfHandle);
return;
]
else
[
PIN_setOutputValue(ledPinHandle, Board_PIN_LED0,!PIN_getOutputValue(Board_PIN_LED0));
]
break;
default:
/* Unhandled status */
break;
];
]
]
举报