Hi,

because of the difference in architecture between PC and motes, even between
motes, you cant cast the message payload to your struct because in the mote
the struct will have a size and padding different than it will or could have
in PC platform. So here is why MIG is usefull, you make your message based
on tmsg_t and fill the fields of your struct using the functiones provided
in the .c file. The same way you read the fields of your struct inside the
tmsg_t with the functions provided to read or get.

hope this help.

-Bill

On Fri, Jan 1, 2010 at 12:47 PM, Echedey Lorenzo <eche...@gmail.com> wrote:

> Hi friends,
>
> I want to use the same *nx_struct* that I use in my telosb sensorial
> application in my C based listener where I record all the received data:
>
> *mig c -c-prefix=TELOSBAPP_H -target=telosb Telosbapp.h mystruct_t -o
> OUTmystruct_t.h
> *
>
> So I get two files, one .c and one .h with an enum and some functions to
> get and set data in the structure. But I can't find any C structure to use
> in those files nor I don't know how to do it. I can see for instance in the
> *prettylisten *C example of the SDK (
> /opt/tinyos-2.x/support/sdk/c/sf/prettylisten.c )  that it uses the *
> tmsg_t* by default. I think I am not matching received values with my C
> mig structure because I have not linked it in any way. What am I doing
> wrong? How can I use my mig generated struct (and where is it) with
> prettylisten?
>
> Thanks a lot and Happy New Year.
>
> --
> --------------------------------------------
> | Echedey Lorenzo Arencibia  |
> --------------------------------------------
>
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>



-- 
Ing. Guillermo De Cesco
Invenio Ingenieria srl.
tel: (54)2944 442119
cel:(54)2944 15534750
web: www.invenioing.com
Av. Pioneros 4163 Dpto 6. CP(R8402AMH)
San Carlos de Bariloche.
Rio Negro, Argentina.
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to