Changes

Jump to navigation Jump to search
2,172 bytes removed ,  01:27, 29 June 2017
Line 150: Line 150:  
|00000010
 
|00000010
 
|}
 
|}
  −
=== Data Frame ===
  −
The data frame carries the entirety of the request or response. This frame is variable in length, and can be as little as four bytes (at a minimum) or as much as 500 bytes (although this isn't a strict limit, but messages should seldom exceed 496 characters).
  −
  −
The data frame, in order to accommodate the large variety of possible data types that might arise in the HONEY architecture, is encoded strictly in ASCII characters as a char buffer. This allows boards to send messages as character strings -- STINGR is designed to understand and decode standardized messages, but this framework allows boards to send absolutely any data.
  −
  −
The payload portion of the data frame can be empty -- in this case, the data frame consists of four bytes. These are the start and end designators, which designate the start and end of the data payload. The start designator is '/1' while the end designator is '/0'
  −
  −
{| class="wikitable"
  −
|Start Flag (2 bytes - '/1')
  −
|Payload (0-496 bytes)
  −
|End Flag (2 bytes - '/0')
  −
|}
  −
  −
=== Checksum Frame ===
  −
The Checksum Frame performs a checksum operation on the payload of the data frame, producing an 8-byte output. Receiving boards should perform an identical checksum operation on the data frame, and compare it to the received checksum value to verify data integrity. Identical checksums indicate proper transmission, while mismatched checksums indicate transmission error.
  −
  −
The current checksum calculation is as follows:
  −
  −
Each byte in the data payload (meaning, data excluding the start and end designators), takes its decimal ASCII value, which is multiplied by its position in the data frame. The sum of these products is the checksum value, which is 8 bytes.
  −
  −
Take the following data frame:
  −
  −
{| class="wikitable"
  −
|/
  −
|1
  −
|H
  −
|E
  −
|L
  −
|L
  −
|O
  −
|/
  −
|0
  −
|}
  −
  −
The checksum is performed on the data payload, meaning only '''HELLO'''. The calculation for each byte in the frame is as follows, following the guideline of taking the position of the character and multiplying that by its ASCII value:
  −
{| class="wikitable"
  −
|72 * 1 (H)
  −
|69 * 2 (E)
  −
|76 * 3 (L)
  −
|76 * 4 (L)
  −
|79 * 5 (O)
  −
|}
  −
  −
The sum of these products is 1,137, the checksum value.
      
== Operation ==
 
== Operation ==

Navigation menu