Hi Lulu,

I assume you are familiar with MIG. If it is not the case you should
have a look at:

http://www.tinyos.net/tinyos-1.x/doc/nesc/mig.html
http://docs.tinyos.net/index.php/Mote-PC_serial_communication_and_SerialForwarder
http://www.tinyos.net/tinyos-1.x/doc/tutorial/lesson6.html

I usually use Java, so I can not help you that much with the automatic
functions generated by C. But I imagine that the mechanics may be
familiar.

In Java, a new class is automatically generated that includes both the
corresponding methods for setting or getting each of the parameters of
the struct that you are using as message.

For instance, in your AMSender and AMReceiver you could use the
channel AM_FROMANDTOPCMSG, which must be a valid constant likely
defined inside an enum in your header. In the same header you may have
the corresponding message type for this channel (e.g. something like
typedef struct FromAndToPcMSG {
        int8_t values [10];
        uint16_t command
} FromAndToPcMSG;

Now, using MIG you create the Java class with the methods
(set_values_element, get_values_element, set_command and get_command)
that will be called inside your JAVA program. After MIG just compile
your JAVA program and run it in the corresponding serial port.

Cheers!!!
Sergio

2011/2/10 lulu cheng <lulu66_...@hotmail.com>:
> hi i'm new to tinyos and i was looking @ lesson four so that i can learn to
> pass parameter on demand by writing a C file that will be able to pass the
> inputs from the user to the App for the tinyos to process.
> I would greatly appreciate a simple example on how the parameters are passed
> in the c file and how the connection is established.
>
> thanks in advance for looking at my problem ><
>
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to