[Tinyos-devel] serial communication in TinyOS2

Razvan Musaloiu-E. razvanm at cs.jhu.edu
Tue Jun 6 11:28:44 PDT 2006


Hi!

On Tue, 6 Jun 2006, David Gay wrote:

> On 6/6/06, David Gay <dgay42 at gmail.com> wrote:
> > On 6/5/06, Razvan Musaloiu-E. <razvanm at cs.jhu.edu> wrote:
> > > I'm trying to use the serial communication from TinyOS2 and I encounter
> > > some difficulties.
> > >
> > > First: even the description of sfsend in README says:
> > >
> > >         - sfsend: send a packet (specified on the command line) to a serial forwarder
> > >
> > > the code doesn't really do this. It tries to send some packets but they
> > > are composed manually. The way it is done is like this:
> > >
> > >     26        unsigned char packet[100];
> > >     27
> > >     28        packet[i++] = 0xff; // addr low byte
> > >     29        packet[i++] = 0xff; // addr high byte
> > >     30        packet[i++] = 0x04; // AM id
> > >     31        packet[i++] = 0xbc; // group id
> > >     32        lenp = i++;         // length
> > >     33        packet[i++] = j;    // payload
> > >     34        packet[i++] = 0xbe; // payload
> > >     35        packet[i++] = 0xef; // payload
> > >     36
> > >     37        packet[lenp] = i-5; // length, don't include header
> >
> > Oops. This was some test code that I didn't look at carefully enough
> > when I copied it over to 2.x. I'll make it do something useful...
>
> Ok, it does something useful now (send a raw packet whose bytes are
> specified as arguments, i.e., basically the same thing as
> net.tinyos.tools.Send)

Thank you! :-)

--
Razvan ME



More information about the Tinyos-devel mailing list