Hi all,
I am writing an app where the receive message event handler basically
rebroadcasts the received packet. If i write the command "call
Leds.redToggle(); " immediately, compiler throws a bunch of errors. On the
other hand, when I call " call Leds.redToggle(); " after copying the
recieved packet, the app compiles fine. Can anyone offer an explanation?
****************Code snippet behaving
strangely*********************************
event TOS_MsgPtr RcvData.receive(TOS_MsgPtr m) {
*******writing "call Leds.redtoggle();" at this point generates compiler
errors********************************
struct OscopeMsg* _eStrPtr;
_eStrPtr = (struct OscopeMsg*)m->data;
//Copying recieved packet for re-transmission
eStrPtr->lastSampleNumber = _eStrPtr->lastSampleNumber;
eStrPtr->sourceMoteID = _eStrPtr->sourceMoteID;
eStrPtr->channel = _eStrPtr->channel;
eStrPtr->data[0] = _eStrPtr->data[0];
eStrPtr->data[1] = _eStrPtr->data[1];
eStrPtr->data[2] = _eStrPtr->data[2];
eStrPtr->data[3] = _eStrPtr->data[3];
eStrPtr->data[4] = _eStrPtr->data[4];
eStrPtr->data[5] = _eStrPtr->data[5];
eStrPtr->data[6] = _eStrPtr->data[6];
eStrPtr->data[7] = _eStrPtr->data[7];
eStrPtr->data[8] = 0xffff;
eStrPtr->data[9] = m->strength;
threshold = (uint16_t)m->strength;
*********If I write " call Leds.greenToggle(); " at this point, the app
compiles fine*****************************************
if (threshold > 0x0055){
if (call SendTgtDetected.send(2, sizeof(struct OscopeMsg), &eMsg)) {
call Leds.greenToggle();
}
}
return m;
}
**************************end of code
snippet********************************************************
************************Compile time
errors***********************************************************
parse error before 'struct'
_eStrPtr undeclared (first use in this function)
subscripted value is neither array nor pointer
subscripted value is neither array nor pointer
-
-
-
-
-
-
**************************************************************************************************
Thank you.
Regards,
Shankar.
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help