[Tinyos-help] C mig generated files

Dimas Abreu Dutra d1ma5 at yahoo.com
Fri Dec 1 11:35:24 PST 2006


Hello everybody,
 
 I use TinyOS 2.0 and have used mig to generate c files for the active messages I receive over the serial port. However, the prefix_fname_get(tmsg_t *msg) functions generated by mig do not get the proper values of the payload fields, instead they interpret the header as the beggining of the payload.
 ______________________________________________________
 My code is as follows:
 {
 uint8_t *packet = read_sf_packet(fd, &len);
 ...
 tmsg_t *msg = new_tmsg(packet + 1, len - 1);
 ...
 ReportMsg_field_get(msg);
 }
 _______________________________________________________
 where ReportMsg.c is my mig generated source.
 
 Does anyone know how to get the proper field? I tried using the 
 void *payload = tmsg_data(msg) + spacket_data_offset(0);
 like in support/sdk/c/prettylisten.c, but it requires me to parse each AM type in a different function.
 
 thanks in advance.
 
 
 ~Dimas~
 
 
 
 		
---------------------------------
 Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu celular. Registre seu aparelho agora!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20061201/98dc7e65/attachment-0001.htm


More information about the Tinyos-help mailing list