Hi Sarfraz

Thanks. Things worked out fine and now im able to send messages via tython (at 
least tython prompt says send msg :)  Now the problem arises that node 20 is 
not receiving the message following is my code

abc.nc

configuration abc {
}
implementation {
....
components GenericComm;
....
abcM.ReceiveMsg -> GenericComm.ReceiveMsg[AM_FK_MSG]; 
}


abcM.nc

module abcM {
  provides {
    interface StdControl;
  }
  uses {
    .....
    interface ReceiveMsg;
  }
}
implementation {
......

 event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr m) {   
      dbg(DBG_TEMP, "Msg Recd from:%d\n", packet->senderId);
......  
    return m;
  }
 }

The receive() message is never called I put some DBG statements in init () etc 
and they are called. Can you please help in this regard. 
If u want I can send you all code.

Looking Forward



Regards 
Faisal Karim 




----- Original Message ----
From: Sarfraz Nawaz <[EMAIL PROTECTED]>
To: Faisal Karim <[EMAIL PROTECTED]>
Cc: tinyos help
 <[email protected]>
Sent: Wednesday, June 6, 2007 8:23:18 AM
Subject: Re: [Tinyos-help] sending packets via Tython

Lets say the packet structure is defined as



typedef struct myPacket {

   uint16_t senderId;

   uint16_t someData;

}



then use mig to generate the corresponding java class file. At tython prompt 
issue these commands



from simcore import *;

import myPacket;



myMsg = myPacket();

myMsg.set_senderId(0);

myMsg.set_someData(11);



comm.sendRadioMessage(20, sim.getTossimTime()+10, myMsg);



These commans import necessary stuff, create the packet, set corresponding 
fields and send the packet to node 20.

On 6/5/07, Faisal Karim <
[EMAIL PROTECTED]> wrote:


Hi Sarfaraz

 

Thanks again. But how to set the sender ID for
comm.sendRadioMessage() coz three arguments accepted by this
method dont specify who is sender.

 

Looking forward for your early reply

 



Regards 
Faisal Karim 


       






----- Original Message ----
From: Sarfraz Nawaz <
[EMAIL PROTECTED]>
To: Faisal Karim <[EMAIL PROTECTED]>
Cc: tinyos help <
[email protected]>
Sent: Tuesday, June 5, 2007 2:51:49 AM
Subject: Re: [Tinyos-help] sending packets via Tython

Its
the simulation environment that is sending the packets not the base
station node. Though you can set the sender ID to be 0 and have the
receiving node believe that the packet came from node 0.


On 6/4/07, Faisal Karim <[EMAIL PROTECTED]
> wrote: 


Hi Sarfaraz 

Thanks
for reply. Thats true but "who" is using these methods
(comm.sendRadioMessage() and comm.sendUARTMessage() ) to send messages
to any node. I assume its base station ie node 0.

Im looking forward to send messages from specific node. Lets say node 2 send 
message to node 10. How we can do by using Tython.

Thanks in advance. 
Looking Forward 


 



Regards 
Faisal Karim 









----- Original Message ----
From: Sarfraz Nawaz <
 [EMAIL PROTECTED]>
To: Faisal Karim <[EMAIL PROTECTED]>
Cc: tinyos help <
[email protected]>
Sent: Sunday, June 3, 2007 6:12:12 AM

Subject: Re: [Tinyos-help] sending packets via Tython 

comm.sendRadioMessage()
and comm.sendUARTMessage() are used to send a packet to "any" node in
the network on the uart and radio respectively.


On 6/1/07, Faisal Karim < [EMAIL PROTECTED] 
> wrote:


Hi All

Im
looking forward to send packets from specific node in simulation via
Tython. In Tython manual it is described to send using moteIF(), but
what i understand this is to send some msg from base station ie some
serial port. To send to base station there is a method
comm.sendUARTMessage(), also there is comm.sendRadioMessage() which im
assuming to send msg from base station to specific node via radio as
this method do not describe which node is sending the message.

any comments and help will be highly appreciated

 



Regards 
Faisal Karim 








Get the Yahoo! toolbar and be alerted to new email 
wherever you're surfing. 

_______________________________________________
Tinyos-help mailing list

[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help 











Get the free Yahoo! toolbar 
and rest assured with the added security of spyware protection. 









      Ready for the edge of your seat? 
Check out tonight's top picks on Yahoo! TV. 












       
____________________________________________________________________________________
Yahoo! oneSearch: Finally, mobile search 
that gives answers, not web links. 
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to