Dear all,
I already wrote a previous e-mail, asking for your help with regard to
the consumption of the CC2420 Radio of our "telosb mote". In that
occasion you advised me to modify the starting programme.
So, after following your advice I solved the problem of excessive
consumption that I had met, but I was not able to understand why the
previous version of the programme took so much time and energy to
switch on the Radio.
Could you give me an explanation about the factors affecting the
inefficient performance of the previous programme? Why is the last
version of the programme working correctly?
Besides, Id like to know about potential solutions to adopt so that
the Radio can change its present state getting in a "Sleep" state.
Does the radio require less energy to work in this new state? And does
the "sleep" state allow the radio to receive any packets anyway?
You can find the snippet codes below, both in the previous and the
modified version (the one working).
****PREVIOUS VERSION****
module MyComponent
{ uses
{ interface Boot;
interface SplitControl as RadioControl;
interface AMSend;
interface Timer;
}
}
implementation
{ typedef nx_struct oscilloscope
{ nx_uint16_t version;
nx_uint16_t interval;
nx_uint16_t id;
nx_uint16_t count;
nx_uint16_t readings[10];
} oscilloscope_t;
message_t sendbuf;
oscilloscope_t local;
event void Boot.booted ( )
{ call Timer.startPeriodic (10000);
}
event void RadioControl.startDone (error_t error) {
}
event void RadioControl.stopDone (error_t error) { }
event void Timer.fired ( )
{ call RadioControl.start ( );
call AMSend.send (AM_BROADCAST_ADDR, &sendbuf,
sizeof local);
}
event void AMSend.sendDone (message_t* msg, error_t
error)
{ call RadioControl.stop ( );
}
}
******** MODIFIED VERSION ***************
module MyComponent
{ uses
{ interface Boot;
interface SplitControl as RadioControl;
interface AMSend;
interface Timer;
}
}
implementation
{ typedef nx_struct oscilloscope
{ nx_uint16_t version;
nx_uint16_t interval;
nx_uint16_t id;
nx_uint16_t count;
nx_uint16_t readings[10];
} oscilloscope_t;
message_t sendbuf;
oscilloscope_t local;
event void Boot.booted ( )
{ call Timer.startPeriodic (10000);
}
event void RadioControl.startDone (error_t error) {
call AMSend.send (AM_BROADCAST_ADDR, &sendbuf,sizeof local);
}
event void RadioControl.stopDone (error_t error) { }
event void Timer.fired ( ){
call RadioControl.start ( );
}
event void AMSend.sendDone (message_t* msg, error_t error){
call RadioControl.stop ( );
}
}
**************************************************************************
Thanks in advance.
I look forward to hear from you.
Margherita
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help