[Tinyos-help] help, strange automatic fired timer!!
Pablo Gil Montaño
pgilmon at yahoo.es
Wed Sep 13 08:19:41 PDT 2006
I think that it's exactly the other way around. You have to use the same string in very instance so that the compiler knows that they must have different numeric values. At least, that's what I understand from the documentation [1].
[1]: http://www.tinyos.net/tinyos-1.x/doc/tutorial/lesson2.html
Conor Todd <conor.k.todd at gmail.com> escribió: Perhaps you need to pass different strings to unique() in order to get different values out of it? What I am implying is that all three of the timers you wire below may resolve to the same timer because you give them all the same name.
...not that I have any idea how unique() works, of course.
- Conor
On 9/13/06, campbell gao < campbellgao at gmail.com> wrote:hi all,
i encounter a strange problem: the time auto to fire without any "call timer.fire();".
In my configuration Sensing.nc,3 timers are configured like following:
//timer
MSPSensingM.LedsTimer -> TimerC.Timer[unique("MSPSensing")];
MSPSensingM.SyncTimer -> TimerC.Timer[unique("MSPSensing")];
MSPSensingM.SendTimer -> TimerC.Timer[unique("MSPSensing")];
in my Stdcontrol part of SensingM.nc, i don't fire any timer:
command result_t StdControl.init() {
call Leds.init();
call PIRControl.init();
....
return SUCCESS;
}
command result_t StdControl.start() {
call PIRControl.start();
return SUCCESS;
}
command result_t StdControl.stop() {
call PIRControl.stop();
return SUCCESS;
}
and if i want to start the sampling, i will send a message to nodes .The receive code is like following:
.....
event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr message) {
if(message->type==0x0c){//reset mote msg
if(message->data[0] == ALL_MOTES||message->data[0] == TOS_LOCAL_ADDRESS){
if(message->data[1] == MSG_START) {
call SyncTimer.start(TIMER_REPEAT,timeSlot);
.....
But how strange it is!! The sampling start up when i turn on the node's switch!! And sampling data is sent back!!
Who could tell me that is why??
--
best wishes
campbell
------------------------------------------------------------
SNARC
~~:nihao~~:hi~~:ciao~~
_______________________________________________
Tinyos-help mailing list
Tinyos-help at Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
--
"Thought is only a flash in the middle of a long night, but the flash that means everything."
- Poincaré
-=-=-=-=-=-=-=-=-
I'm going to run the Houston Marathon, but finishing's not my only goal: help me raise money for cancer research!
http://www.active.com/donate/tnttxgc/tnttxgcCTodd
Thanks! _______________________________________________
Tinyos-help mailing list
Tinyos-help at Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
---------------------------------
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20060913/56493402/attachment.html
More information about the Tinyos-help
mailing list