Hi,

I'm pretty sure you can't have pointers in an nx_struct. You could
either have an array of a fixed size, or an empty array (size = 0) at
the end that you use as a placeholder. When you get the pointer to the
message struct that you want to send, you append your data after the
struct. Just make sure you're not writing more data than is available in
a message.

Cheers,
Urs


DAE HEE KIM schrieb:
> Hi,
> 
> Based on my tossim test, I tried to add list data into packet for testbed
> (into motes).
> However, I got error like followings. Can I use list-type into packet ?
> 
> ------ Packet format -------
> ...
> // path entry
> nx_struct pathEntry {
>    nx_uint8_t nodeid_;
>    nx_struct pathEntry* next_;
> };
> 
> typedef nx_struct DataMsg {
>    nx_uint16_t msg_src_nodeid_;   // source node id
>    nx_uint16_t msg_dest_nodeid_;  // destination node id
>    nx_uint16_t msg_last_nodeid_;  // last node id, ie lasthop
>    ...
>    nx_uint8_t  msg_hops_;         // hops
> 
>    // for checking routing path of dat packet
>    nx_struct pathEntry* entry_;
> 
> } DataMsg_t;
> 
> --------- error ---------------------------------------------
> 
> packet.h:88: field `next_' must be a network type
> packet.h:106: field `entry_' must be a network type
> .....
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to