Gude HTTP over serial: Unterschied zwischen den Versionen

Aus Gude Systems GmbH
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „HTTP over Serial * offers the EPC HTTP Interface over serial interface Paket-Format: * [STX][message-string][ETX][CRX] ** [STX] start of text, (0x02) ** m…“)
 
 
(6 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 2: Zeile 2:
 
* offers the [[EPC HTTP Interface]] over serial interface
 
* offers the [[EPC HTTP Interface]] over serial interface
  
Paket-Format:
+
 
 +
Serial interface Paramaters
 +
* 115200 8N1
 +
** 115200 Baud
 +
** 8bits
 +
** no parity
 +
** one stop bit
 +
 
 +
 
 +
Packet format:
 
* [STX][message-string][ETX][CRX]
 
* [STX][message-string][ETX][CRX]
 
** [STX] start of text, (0x02)
 
** [STX] start of text, (0x02)
** message string (CGI in, JSON out)
+
** [message string] (CGI in, JSON out)
 
** [ETX] end of text (0x03)
 
** [ETX] end of text (0x03)
** CRC: 2 bytes little endian xmodem CRC
+
** CRC: 2 bytes xmodem CRC
 +
 
 +
 
 +
Demo Application
 +
* hosd (Http Over Serial Demo)
 +
** [[media:Http Over Serial.zip|Win32 Download]]
 +
** [[media:Hosd-0.1.0.tar.gz|Qt/Cpp Sources]]
 +
 
 +
 
 +
Example 1:
 +
  hosd.exe --port com1 --cgi "statusjsn.js?components=16384&svt=1&svi=1&svf=1&brief=1"
 +
 
 +
  request -> [STX] statusjsn.js?components=16384&svt=1&svi=1&svf=1&brief=1 [ETX] [CRC:0x5d49]
 +
  answer  <- [STX] { <nowiki>"sensor_values":[[[1,1,null,1],[[236.900]]]]</nowiki>,"eof":1 } [ETX] [CRC:0xa06a]
 +
  Total messages: 1
 +
 
 +
 
 +
Example 2:
 +
  ./hosd --port /dev/ttyS0 --cgi "statusjsn.js?components=16384&svt=1&svi=1&svf=1&brief=1" --batch | python -m json.tool
 +
 
 +
  {
 +
      "eof": 1,
 +
      "sensor_values": [
 +
          [
 +
              [
 +
                  1,
 +
                  1,
 +
                  null,
 +
                  1
 +
              ],
 +
              [
 +
                  [
 +
                      236.75
 +
                  ]
 +
              ]
 +
          ]
 +
      ]
 +
  }

Aktuelle Version vom 30. Mai 2014, 15:17 Uhr

HTTP over Serial


Serial interface Paramaters

  • 115200 8N1
    • 115200 Baud
    • 8bits
    • no parity
    • one stop bit


Packet format:

  • [STX][message-string][ETX][CRX]
    • [STX] start of text, (0x02)
    • [message string] (CGI in, JSON out)
    • [ETX] end of text (0x03)
    • CRC: 2 bytes xmodem CRC


Demo Application


Example 1:

 hosd.exe --port com1 --cgi "statusjsn.js?components=16384&svt=1&svi=1&svf=1&brief=1"
 request -> [STX] statusjsn.js?components=16384&svt=1&svi=1&svf=1&brief=1 [ETX] [CRC:0x5d49]
 answer  <- [STX] { "sensor_values":[[[1,1,null,1],[[236.900]]]],"eof":1 } [ETX] [CRC:0xa06a]
 Total messages: 1


Example 2:

 ./hosd --port /dev/ttyS0 --cgi "statusjsn.js?components=16384&svt=1&svi=1&svf=1&brief=1" --batch | python -m json.tool
 {
     "eof": 1,
     "sensor_values": [
         [
             [
                 1,
                 1,
                 null,
                 1
             ],
             [
                 [
                     236.75
                 ]
             ]
         ]
     ]
 }