[Tinyos-host-mote-wg] Re: [Tinyos-2.0wg] OSKI TEP draft

Joe Polastre joe.polastre at gmail.com
Mon Jun 20 16:50:00 PDT 2005


> 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)

Basically it seems like we're screwed by the constraints of C and the
fact that we can't add things to a structure that has already been
defined (ideally each radio chip adds to the structure's contents as
with TosPacket below).

> typedef struct message_t {
>    TosPacket packet;
>    TosMetadata metadata;
> } message_t;
> typedef struct TosPacket {
>    union {
>      CC1000Packet cc1K;
>      CC2420Packet cc24;
>    }
> } TosPacket;

why not:

typedef struct TosPacket {
  union {
    CC1000Header cc1k_header;
    CC2420Header cc24_header;
    uint8_t data[TOS_MSG_LENGTH];
    CC1000Footer cc1k_footer;
    CC2420Footer cc24_footer;
  }
}

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.

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.

-Joe

_______________________________________________
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