TOS_Msg is just an structure. You can see it at tinyos-1.x/tos/types/AM.h. If you want to access its fields you just do the next:
TOS_Msg your_msg;
TOS_Msg* your_msgPtr;
your_msg.addr = destination_address;
your_msgPtr->data = "" (accessing with pointer)
If you want to build packets in the PC and sent them to motes you can use the tool mig [1]. But you must declare you message structures in an .h file with a specific format. However, I guess that this is not what you want to do right now.
[1]: http://www.tinyos.net/tinyos-1.x/doc/nesc/mig.html
P.D.: please, post in tinyos-help@millennium.berkeley.edu so that we all can read questions and answers, this information might be extended/corrected by others and might also be useful for others who have the same questions.
mudunuru krishnaveni <[EMAIL PROTECTED]> escribió:
hai,i have gone through the link u specified ..........but my thing is not yet cleared..........could u pls elaborate the answer for my doubt..............after reading the lesson i understood that TOS_Msg data wraps all the address, payload,data everything..........but my doubt is i want to hardcode the values by giving a packet of data say " helloworld" to be transmitted(to the program) over the radio and see this data transmitted from one radio in the hyperminal by means of uart............so ,could u say, where in the program i have to give the address,data.........i.e suppose if i want to send a packet say " hello world" to one radio and receive the same packet over the other radio and view this packet in the hyperterminal by means of uart ,.............how can i do that.............another doubt is that, i want one radio to transmit the next packet to the other radio only after it receives an interrupt from the other radio..........
On 9/18/06, Pablo Gil Montaño <[EMAIL PROTECTED]> wrote:Take a look at [1], and if you still have doubts, ask me (send to the list so that everyone can read).
[1]: http://www.tinyos.net/tinyos-1.x/doc/tutorial/lesson4.html
mudunuru krishnaveni <[EMAIL PROTECTED] > escribió:hai,can u help me out with this problem.....................i am not able to understand the nesC language in the case of sending and receiving packets......... here i am attaching a sample prog which i have written for sending a packet to the uart.........pls correct the prog if anything wrong.the problem of mine is ..............1.) no where i am giving the data which has to be sent to the uart........i am just declaring a buf variable., but not loading data into it..........how to do that...........2.) cannt i write TOS_Msg buf[ ] (i.e in the case of C language we would be using arrays or stack and stack pointers to store the packets and then send them).........this part of the nesC is a bit confusing to understand ....so i am notable to move forward.........but i have to make up with it soon.........so can u help me out with this................with regards,krishnaveni
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com
_______________________________________________ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help