I wonder why I never get an acknowledgement from BMAC. Am I doing something wrong here?
Below is how I use it with the application OscilloscopeRF (telosB, tinyos 1.1.15).
in Oscilloscope.nc
components Main, OscilloscopeM
, TimerC
, LedsC
, CC2420RadioC
, GenericComm as Comm;
Main.StdControl -> OscilloscopeM;
Main.StdControl -> TimerC;
OscilloscopeM.MacControl -> CC2420RadioC;
OscilloscopeM.Timer -> TimerC.Timer[unique("Timer")];
OscilloscopeM.LocalTime -> TimerC;
OscilloscopeM.Leds -> LedsC;
OscilloscopeM.CommControl -> Comm;
OscilloscopeM.DataMsg -> Comm.SendMsg[AM_OSCOPEMSG];
in OscilloscopeM.nc
module OscilloscopeM
{
provides interface StdControl;
uses {
interface Timer;
interface Leds;
interface StdControl as CommControl;
interface SendMsg as DataMsg;
interface LocalTime;
interface MacControl;
}
}
task void resendMsg()
{
call DataMsg.send(TOS_BCAST_ADDR, sizeof(data_buf), &msg[currentMsg]);
}
event result_t DataMsg.sendDone(TOS_MsgPtr sent, result_t success) {
if ((!sent->ack) && retryCnt-- > 0)
{
call Leds.redToggle();
retryCnt--;
memcpy(&buf, sent, sizeof(TOS_Msg));
if (sent == &msg[currentMsg])
post resendMsg();
}
else
{
if (retryCnt <= 0)
{
call Leds.yellowToggle();
retryCnt = RETRY_CNT;
}
}
return SUCCESS;
}
I run one node with OscilloscopeRF while another is running TOSBase (ack enabled). I always get red LED blinking all the time meaning that sent->ack is always 0. What would be the reason? Could somebody shed the light here, Joe? Thank you very much.
regards,
Nuenoi
_______________________________________________ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help