Hi Paul,
thanks for your reply.yes i'm trying to follow the first way like you said.i 
tried to change some code in TestSerialC.nc but it still does not work.Now,i'm 
confused.i want to know if i'm using the right file.nc (TestSerialC.nc) to 
decode and display this data ?can you help me please!!
Date: Wed, 20 Jan 2010 18:42:27 -0600
From: [email protected]
To: [email protected]
Subject: Re: [Tinyos-help] Can not display data in mote-PC serial       
communication






  
  


Jennifer,



There are two main ways you can decode the packet.



1) At the mote by pulling out the data and pushing it to the serial
port using printf, and the net.tinyos.tools.PrintfClient tool.



2) At the computer, decode the raw packet after receiving it using the
SerialForwarder/net.tinyos.tools.Listen tool.



Each one has it's own advantages/disadvantages.  It sounds like you are
trying to do #1.  If you using the BaseStation code as a base for you
program, make sure you remove any code that forwards messages received
over the air to the serial port.



In your receive event on the mote, all you have to do is add something
like this:



printf("Counter Value: %u\n", cval);

printfflush();



Where cval is your desired uint16 value.  It is important to flush the
printf buffer frequently because it will not automatically start
flushing the buffer until it is 1/2 - 2/3 full(which can make debugging
difficult) .  I normally manually flush the printf buffer every time I
make a call to printf so I see the output immediately on the console.



-Paul





On 1/20/2010 3:56 PM, Jennifer Pink wrote:

  Hi,
  Hi,
  

  
  In fact, i'm talking about the standard message buffer
"message_t" .
  you know that the values of the counter represent the data filed
so,
  my question is how to recover  this data and display it with
printf ?
  

  
  
  this is the structure of the message layout
  

  
  typedef nx_struct test_serial_msg {
  nx_uint16_t counter;
  } test_serial_msg_t;
  

  
  

  
  
  thanks in advance
  

  
  Jennifer
  

  
  

  
  From: [email protected]

Date: Wed, 20 Jan 2010 21:00:41 +0200

Subject: Re: [Tinyos-help] Can not display data in mote-PC serial
communication

To: [email protected]

CC: [email protected]

  

  Your explanation is a bit foggy.

Where exactly the problem is? After which step? What does work?.

  

Arik

  

  

  On Wed, Jan 20, 2010 at 17:41, Jennifer
Pink <[email protected]> wrote:

  
    Hi all,
    

    
    I'm using tinyos-2.x on windows Xp.
    I tryed to follow the tutorial "mote-PC serial communication
and serial forwarder"
    and every thing was ok.
    Now i want to display data from mote on my PC.
    when executed the TinyOS printf library in 
http://docs.tinyos.net/index.php/The_TinyOS_printf_Library
    it works very well but i can not integrate it in the "mote Pc
serial communication" to display JUST the 
    data that i sent.
    

    
    does any one know how to do that ?
    i need your help please.
    

    
    

    
    Regards,
    Jennifer 
    

    
    

    
    

    Avec Internet Explorer, surfez en toute discrétion sur internet
    Cliquez ici !
    

_______________________________________________

Tinyos-help mailing list

    [email protected]

    https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

  
  
  

  
  

-- 

Best Regards,

Arik Sapojnik

  [email protected]

  
  
  

  Discute avec tes amis partout, grâce à Messenger sur ton mobile. Cliquez ici !
  
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
                                          
_________________________________________________________________
Discutez en direct avec vos amis sur Messenger !
http://www.windowslive.fr/messenger
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to