[Tinyos-host-mote-wg] Re: [Tinyos-2.0wg] OSKI TEP draft
Philip Levis
pal at eecs.berkeley.edu
Mon Jun 20 17:14:39 PDT 2005
On Jun 20, 2005, at 4:50 PM, Joe Polastre wrote:
>> 2) A chip defines its header, footer, and metadata structures as
>> chip-
>> specific names (e.g., CC1000Header).
>> 3) A platform maps one of its chips to the message_t. E.g., typedef
>> CC1000Header RadioHeader in a file called RadioTOSMsg.h (this lives
>> in a platform, not a chip).
>>
>
> Why does the platform do the mapping? The chip knows which header it
> needs; why let the platform developer screw it up? Seems like
> including the chip should take care of it. The only reason to do it
> in the platform is the mutliple radio chips as you defined (which
> seems very wasteful)
>
Yes. Multiple chips is the reason you need to do this. What is
wasteful about having multiple radio chips? Several existing
platforms do...
> typedef struct TosPacket {
> union {
> CC1000Header cc1k_header;
> CC2420Header cc24_header;
> uint8_t data[TOS_MSG_LENGTH];
> CC1000Footer cc1k_footer;
> CC2420Footer cc24_footer;
> }
> }
>
Er, I don't think that will work. Do you mean:
typedef struct TosPacket {
union {
CC1000Header cc1k;
CC2420Header cc24;
} header;
uint8_t data[TOS_MSG_LENGTH];
union {
CC1000Footer cc1k;
CC1000Footer cc24;
} footer;
}
Which *really* doesn't work, as now there can be offsets between a
packet's header and its data. Based on your comment below, I assume
the above is what you meant?
> The problem with my proposed scheme is you can't directly read the
> buffer from the radio since it is now split across the structure.
Which you can do with the scheme I proposed....
The presence of RadioHeader and RadioFooter was merely so a chip
could define what comes before and after the data region (before the
metadata area) and have a global type name. But mapping those to a
global type name is problematic due to multi-chip issues.
>
> The most memory efficient way to do this (which is the least processor
> efficient) is to do a copy or mapping to a standard struct from a
> radio struct. sigh.
>
I don't understand. How does mapping between platform-specific and
network structs relate to the problem of struct naming?
Phil
-------
"We shall not cease from exploration
And the end of all our exploring
Will be to arrive where we started
And know the place for the first time."
- T. S. Eliot, 'Little Gidding'
_______________________________________________
Tinyos-2.0wg mailing list
Tinyos-2.0wg at Mail.Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-2.0wg
More information about the Tinyos-host-mote-wg
mailing list