[Tinyos-devel] Message_t thoughts: prototypes
Eric Decker
cire831 at gmail.com
Sun May 24 06:50:38 PDT 2009
On Fri, May 22, 2009 at 2:42 PM, Miklos Maroti <mmaroti at math.u-szeged.hu>wrote:
> Dear Eric,
>
> You brought up very good points, and I am very happy that others are
> also engaged in the discussion. At this point I am convinced that both
> Jan's and my proposals could be made to work. But to really compare
> the two approaches we need use cases, very well defined used cases.
I agree. To really flesh out the ramifications and to really understand how
the flow comes together there is nothing like an implementation to help.
I've got a simple yet fairly complicated application that switches
dynamically between radio and serial (depending on docking state) that is
fed by numerous sensors producing several streams of data that is also
intermixed with a couple of other streams of data. This has multiple layers
of queuing.
I'm currently morphing this implementation around to clean some things up
because I've run into the how do we encapsulate (issues with the way AM is
implemented) when we don't know how we are going out of the box yet.
Anyway, I've got an implementation platform that I'm currently using to
prototype some of the ideas we are working with.
eric
> Just to start the discussion, let me start with IEEE 802.15.4 link
> layer. Here are some options:
>
> ------- Option #1 -------
>
> interface Ieee154Send
> {
> command error_t send64(uint64_t dest, bool ackReq, message_t* msg);
> command error_t send16(uint16_t dest, bool ackReq, message_t* msg);
> event void sendDone(message_t* msg, error_t error, bool acked);
> command void* getPayload(message_t* msg, uint8_t len);
> }
>
> interface Ieee154Packet
> {
> command uint16_t getSource16(message_t* msg);
> command uint64_t getSource64(message_t* msg);
> command uint16_t getDestination16(message_t* msg);
> command uint64_t getDestination64(message_t* msg);
> // no set commands as this interface should be used only for
> received messages
>
> command void* getPayload(message_t* msg);
> command uint8_t getLength(message_t* msg);
> }
>
> ------- Option #2 -------
>
> enum ieee154_flags
> {
> IEEE154_ACK_REQ = 1 << 0,
> IEEE154_FRAME_PENDING = 1 << 1,
> IEEE154_COMPRESS_TO_16BIT = 1 << 2,
> };
>
> interface Ieee154Send
> {
> command error_t send(uint64_t dest, uint8_t flags, message_t* msg,
> void* payload, uint8_t length);
> event void sendDone(message_t* msg, error_t error, uint8_t flags);
> command void* getPayload(message_t* msg, uint8_t len);
> command uint8_t getMaxPayload();
> }
>
> interface Ieee154Receive
> {
> event message_t* receive(uint64_t source, message_t* msg, void*
> payload, uint8_t length);
> }
>
> ------- Option #3 -------
>
> #ifdef USE_64BIT_ADDR
> typedef uint64_t address_t;
> #else
> typedef uint16_t address_t;
> #endif
>
> interface Ieee154Packet
> {
> command void format(message_t* msg, uint8_t flags);
>
> command address_t getSource(message_t* msg);
> command address_t getDestination(message_t* msg);
> command void setSource(message_t* msg, address_t addr);
> command void setDestination(message_t* msg, address_t addr);
>
> command void requestAck(message_t* msg, bool ack);
> command bool wasAcknowledged(message_t* msg);
>
> command void* payload(message_t* msg);
> command uint8_t payloadLength(message_t* msg);
> command void setPayloadLength(message_t* msg, uint8_t len);
> command uint8_t maxPayloadLength(message_t* msg);
> }
>
> interface Send
> {
> command error_t send(message_t* msg);
> event void sendDone(message_t* msg, error_t error);
> }
>
> interface Receive
> {
> event message_t* receive(message_t* msg);
> }
>
> Miklos
>
--
Eric B. Decker
Senior (over 50 :-) Researcher
Autonomous Systems Lab
Jack Baskin School of Engineering
UCSC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-devel/attachments/20090524/b7285820/attachment.htm
More information about the Tinyos-devel
mailing list