Difference between revisions of "How to use serial forwarder on testbed"

From Cyber-Physical Systems Laboratory
Jump to navigationJump to search
Line 9: Line 9:
 
byte 0: Delimiter (0x7E)
 
byte 0: Delimiter (0x7E)
  
        1: Protocol: ACK (0x43), PACKET_ACK (0x44) or PACKET_NOACK (0x45)
+
byte 1: Protocol: ACK (0x43), PACKET_ACK (0x44) or PACKET_NOACK (0x45)
  
        2: Sequence number (omitted if protocol is PACKET_NOACK)
+
byte 2: Sequence number (omitted if protocol is PACKET_NOACK)
  
        3: Packet type (0x00, omitted if protocol is ACK)
+
byte 3: Packet type (0x00, omitted if protocol is ACK)
  
        4: Destination high byte (omitted if protocol is ACK)
+
byte 4: Destination high byte (omitted if protocol is ACK)
  
        5: Destination low byte (omitted if protocol is ACK)
+
byte 5: Destination low byte (omitted if protocol is ACK)
  
        6: Source high byte (omitted if protocol is ACK)
+
byte 6: Source high byte (omitted if protocol is ACK)
  
        7: Source low byte (omitted if protocol is ACK)
+
byte 7: Source low byte (omitted if protocol is ACK)
  
        8: Payload length (omitted if protocol is ACK)
+
byte 8: Payload length (omitted if protocol is ACK)
  
        9: Destination PAN group (omitted if protocol is ACK)
+
byte 9: Destination PAN group (omitted if protocol is ACK)
  
        10: Packet AM type (omitted if protocol is ACK)
+
byte 10: Packet AM type (omitted if protocol is ACK)
  
        11 .. n-4: Payload (omitted if protocol is ACK)
+
byte 11 .. n-4: Payload (omitted if protocol is ACK)
  
        n-3: CRC-16 low byte
+
byte n-3: CRC-16 low byte
  
        n-2: CRC-16 high byte
+
byte n-2: CRC-16 high byte
  
        n-1: Delimiter (0x7E)
+
byte n-1: Delimiter (0x7E)

Revision as of 05:56, 31 August 2017

How to use the serial forwarder on testbed?

1. To open the serial forwarder on testbed, run the command

forwarder.py -2 -a telosb

2. We can get the packet format used by the serial forwarder in tospacket.py:

byte 0: Delimiter (0x7E)

byte 1: Protocol: ACK (0x43), PACKET_ACK (0x44) or PACKET_NOACK (0x45)

byte 2: Sequence number (omitted if protocol is PACKET_NOACK)

byte 3: Packet type (0x00, omitted if protocol is ACK)

byte 4: Destination high byte (omitted if protocol is ACK)

byte 5: Destination low byte (omitted if protocol is ACK)

byte 6: Source high byte (omitted if protocol is ACK)

byte 7: Source low byte (omitted if protocol is ACK)

byte 8: Payload length (omitted if protocol is ACK)

byte 9: Destination PAN group (omitted if protocol is ACK)

byte 10: Packet AM type (omitted if protocol is ACK)

byte 11 .. n-4: Payload (omitted if protocol is ACK)

byte n-3: CRC-16 low byte

byte n-2: CRC-16 high byte

byte n-1: Delimiter (0x7E)