|
Hy Lee Ee Foong,
I never tried to read the ack element in my message before sending,
but I successfully checked the
fcfhi element (after sending) from a received messages.
fcfhi is the high byte of the FrameControlField (IEEE 802.15.4), if this is
equal to 0x21 your message
requests ACK.
You could make a check (on a receiving mote) like:
event TOS_MsgPtr
ReceiveMsg.receive(TOS_MsgPtr _msg) {
if (_msg->fcfhi &
(1 << CC2420_DEF_FCF_BIT_ACK)) // with ACK
call
Leds.redToggle();
else
// without ACK
call
Leds.greenToggle();
}
The condition of the if statement (_msg->fcfhi & (1 <<
CC2420_DEF_FCF_BIT_ACK))
checks bit number 5 of fcfhi, because this indicates a requested ACK
(2^5=32=0x20).
The following defines can be found in CC2420Const.h:
CC2420_DEF_FCF_BIT_ACK 0x05 // bitposition in fcfhi CC2420_DEF_FCF_HI
0x01 // without ACK
CC2420_DEF_FCF_HI_ACK 0x21
// with ACK
Regards,
OLE
|
_______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
