what is the exact error message you get after adding the blue part?
On Thu, Aug 19, 2010 at 8:57 PM, Xiaohui Liu <[email protected]> wrote:
> Hi,
>
> The following appears in my header file.
> enum {
> SWS = 15,
> NUM_OF_QUANTILES = 4,
> LINK_MARKER_COUNTS = 11,
> };
> typedef struct neighbor_table_entry {
> am_addr_t ll_addr;
> uint8_t lastseq;
> uint8_t rcvcnt;
> uint8_t failcnt;
> uint8_t flags;
> uint8_t inage;
> uint8_t inquality;
> uint16_t eetx;
> uint8_t data_success;
> uint8_t data_total;
> } neighbor_table_entry_t;
>
> Till now, everything works as expected. However, after the blue part is
> appended to the structure definition to the following, which is the only
> change to my program, it's not working anymore. Then I append the red part
> and it goes back to normal. Can anyone help me understand what is going on?
> I guess this may be related to alignment and order issue. I've encountered
> several problems so far and every time I have to randomly change the order
> of some fields or add some padding bytes till it's working. Is there a rule
> regarding how a structure must be defined in TinyOS? Thanks.
>
> typedef struct neighbor_table_entry {
> am_addr_t ll_addr;
> uint8_t lastseq;
> uint8_t rcvcnt;
> uint8_t failcnt;
> uint8_t flags;
> uint8_t inage;
> uint8_t inquality;
> uint16_t eetx;
> uint8_t data_success;
> uint8_t data_total;
>
> uint32_t link_height[LINK_MARKER_COUNTS];
> uint32_t link_pos[LINK_MARKER_COUNTS];
> uint32_t link_dd_pos[LINK_MARKER_COUNTS];
>
> uint8_t entry_idx;
> uint8_t cache[SWS];
>
> uint16_t node_metric;
> uint16_t node_delay_qtls[NUM_OF_QUANTILES];
> uint16_t link_delay_qtls[NUM_OF_QUANTILES];
>
> uint8_t link_dd_pos_unit[LINK_MARKER_COUNTS]; //unit increment of desired
> position
> uint8_t pad[7];
> } neighbor_table_entry_t;
>
>
> -Xiaohui
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
--
Eric B. Decker
Senior (over 50 :-) Researcher
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help