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")];
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);
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 [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
