Changes between Version 2 and Version 3 of Old/TinyOS/Serial
- Timestamp:
- Dec 24, 2008, 1:17:24 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Old/TinyOS/Serial
v2 v3 1 1 == Mote-PC Serial Communication == 2 2 3 The basic abstraction for mote-PC communication is a '' packet source ''. A packet source is a communication medium over which an application can receive packets from and send packets to a mote. 4 Examples of packet sources include serial ports, TCP sockets, and the SerialForwarder tool. Most TinyOS communication tools take an optional -comm parameter, which allows you to specify the packet source as a string. For example: 5 3 The receivers receive packets from senders and pass them on to the serial port. Tinyos provides two java tools (Listen and MsgReader) to print the messages on the PC console. 6 4 {{{ 7 5 … … 10 8 }}} 11 9 12 tells Listen tool to use the serial port /dev/ttyUSB0 at the correct speed for a telosb mote. 13 14 Listen creates a packet source and just prints out every packet it sees. Output should look something like this: 10 The Listen tool receives the packets and prints the raw packets to the PC console. Output should look something like this: 15 11 {{{ 16 12 … … 35 31 36 32 37 We use MsgReader to print out the messages.33 MsgReader is a better alternative to Listen. The MsgReader class takes a java message class (provided by the user) as an argument. It prints receives the packets from the serial port and prints the packet structure defined by the java message class. 38 34 39 35 {{{