[Tinyos-help] Message Formats for Basestation

Philip Levis pal at cs.stanford.edu
Mon Jan 1 11:14:48 PST 2007


On Jan 1, 2007, at 10:53 AM, Mr. Jonathan A. Gomez wrote:

>
> Okay, I've been re-reading some of the TEP documents.  I am a bit  
> abashed to find them more
> informative than I remembered.  But then, it took me a while to  
> realize exactly what to look
> for, I guess.
>
> I happened on the following in section 3 of TEP 116: "A platform  
> MUST provide ActiveMessageC as
> a basic HIL to packet-level communication.".  Section 5 requires  
> AM* interfaces also.  As I
> understand it, then, there is a guarantee that the Active Message  
> message type is always
> available.
>
> If I understand correctly, individual platforms may provide their  
> own message types.  In the
> serial protocol, the particular message type being employed is  
> indicated by the dispatch id, and
> the following enumeration, if I understand, is a mapping of id to  
> type:
>
> enum {
>   TOS_SERIAL_ACTIVE_MESSAGE_ID = 0,
>   TOS_SERIAL_CC1000_ID = 1,
>   TOS_SERIAL_802_15_4_ID = 2,
>   TOS_SERIAL_UNKNOWN_ID = 255,
> };
>
>
> Well, then, I still have a problem.  Are message types still broken  
> up the way they were in
> TinyOS-1.x, as briefly alluded to by the Octave Technology Brief?   
> I took the guess from
> Tutorial Lesson 4 that they were specific to app loaded into the mote.
>
> I glanced over the standard for active messages, which I shall have  
> to presumably look at in
> more depth, and it seems that there is a certain amount of leeway  
> to define what handlers are
> for what.
>
> Can anyone clarify this a bit more.  I will continue to research it  
> on my own, but I would
> appreciate some verification ... and correction.

There are two separate forms of dispatch at play here, which is  
probably the source of the confusion. AM ids specify the format of  
the AM packet payload, while serial ids specify the format of the AM  
packet.

Applications define AM handlers. That is, they define which AM packet  
types they receive and send by wiring to particular AM ids. The AM id  
therefore specifies what the format of the AM payload is. In TinyOS 1.x:

components App, GenericComm;
App.Receive -> GenericComm.Receive[AM_SOMETHING];

In  TinyOS 2.x:

components App, new AMReceiverC(AM_SOMETHING);
App.Receive -> AMReceiverC;

The values in the serial stack are not AM ids. They specify the  
format of the AM packet, such as its headers. For example, CC2420  
active messages have a different packet format than CC1000 or the  
default, platform-independent serial active messages. In order to be  
parse the packets, the serial stack needs to know what the packet  
format is.

This additional layer of dispatch exists to remove the TinyOS 1.x  
problem of having platform-specific serial packet formats. The  
default packet format, which is platform independent, is a basic AM  
packet. But if you want to send/receive platform-specific packets  
(e.g., see all the fields of a CC2420-specific AM packet), you can  
still do so.

Phil






More information about the Tinyos-help mailing list