Changes between Version 1 and Version 2 of Old/TinyOS/Serial


Ignore:
Timestamp:
Dec 23, 2008, 10:47:04 PM (15 years ago)
Author:
tripti
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Old/TinyOS/Serial

    v1 v2  
    1212tells Listen tool to use the serial port /dev/ttyUSB0 at the correct speed for a telosb mote.
    1313
     14Listen creates a packet source and just prints out every packet it sees. Output should look something like this:
     15{{{
     16 
     17node1-2:/opt/tinyos-2.1.0/apps/BaseStation# java net.tinyos.tools.Listen -comm serial@/dev/ttyUSB0:telosb
     18serial@/dev/ttyUSB0:115200: resynchronising
     1900 FF FF 00 01 04 00 06 00 01 00 4E
     2000 FF FF 00 01 04 00 06 00 01 00 4F
     2100 FF FF 00 01 04 00 06 00 01 00 50
     2200 FF FF 00 01 04 00 06 00 01 00 51
     2300 FF FF 00 01 04 00 06 00 01 00 52
     2400 FF FF 00 01 04 00 06 00 01 00 53
     2500 FF FF 00 01 04 00 06 00 01 00 54
     2600 FF FF 00 01 04 00 06 00 01 00 55
     2700 FF FF 00 01 04 00 06 00 01 00 56
     2800 FF FF 00 01 04 00 06 00 01 00 57
     2900 FF FF 00 01 04 00 06 00 01 00 58
     3000 FF FF 00 01 04 00 06 00 01 00 59
     3100 FF FF 00 01 04 00 06 00 01 00 5A
     3200 FF FF 00 01 04 00 06 00 01 00 5B
    1433
     34}}}
     35
     36
     37We use MsgReader to print out the messages.
     38
     39{{{
     40
     41node1-2:~# java net.tinyos.tools.MsgReader -comm serial@/dev/ttyUSB0:telosb BlinkToRadioMsg
     42
     43}}}
     44
     45MsgReader reads the packet send to the serial port, looks at its AM type, and if it matches the AM type of one of the Java message classes passed at the command line, it prints out the packet. We see the output like this:
     46
     47{{{
     48
     491152232617609: Message
     50  [nodeid=0x2]
     51  [counter=0x1049]
     52
     531152232617609: Message
     54  [nodeid=0x2]
     55  [counter=0x104a]
     56
     571152232617609: Message
     58  [nodeid=0x2]
     59  [counter=0x104b]
     60
     611152232617621: Message
     62  [nodeid=0x2]
     63  [counter=0x104c]
     64
     65}}}