Serial Sensor Protocol (en)

Description

This is a 1-byte based protocol to set/get sensor values. The synchronisation is done by sending a 4-byte (SYNC) sync message before each command. Communication is always triggered by the server. Values are always sent big-endian.

Server-to-Client

There are two kinds of command:

  1. 0x2? get value command
  2. 0x3? set value command

GET Command

The GET command has always a length of 5 bytes (incl. sync).

Format: 0x53 0x59 0x4E 0x43 CMD (SYNC + CMD)

CMDDescriptionExpected response
0x20get restart count4-bytes value
0x21get sensor value 14-bytes value
0x22get sensor value 24-bytes value
0x23get sensor value 34-bytes value
0x2fget sensor value 154-bytes value

SET Command

The GET command has always a length of 9 bytes (incl. sync).

Format: 0x53 0x59 0x4E 0x43 CMD VALUE (SYNC + CMD + VALUE)

CMDDescriptionExpected response
0x31 b1 b2 b3 b4set sensor value 10x00 (ACK)
0x32 b1 b2 b3 b4set sensor value 20x00 (ACK)
0x33 b1 b2 b3 b4set sensor value 30x00 (ACK)
0x3f b1 b2 b3 b4set sensor value 150x00 (ACK)

Examples

Requesting sensor value 1:

Server: 0x53 0x59 0x4E 0x43 0x21
Client: 0x00 0x12 0x34 0x56

Requesting restart count:

Server: 0x53 0x59 0x4E 0x43 0x20
Client: 0x00 0x00 0x00 0x12

Set sensor value 2:

Server: 0x53 0x59 0x4E 0x43 0x32 0x12 0x23 0x34 0x45
Client: 0x00
 
 
technical/sensor_proto.txt · Last modified: 2011/01/20 10:33 by adminuser
Recent changes RSS feed Creative Commons License Valid XHTML 1.0 Valid CSS Driven by DokuWiki
Drupal Garland Theme for Dokuwiki