[Tinyos-devel] serial communication in TinyOS2

David Gay dgay42 at gmail.com
Tue Jun 6 07:52:45 PDT 2006


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

David Gay


More information about the Tinyos-devel mailing list