define protocol
This commit is contained in:
parent
705aeb87bc
commit
ae943a451b
1 changed files with 55 additions and 1 deletions
56
README.md
56
README.md
|
@ -43,4 +43,58 @@ This should work in such a way that the user logs into a web interface where the
|
||||||
|--- |--------------- |
|
|--- |--------------- |
|
||||||
| ~3 | IR-Trasmitter |
|
| ~3 | IR-Trasmitter |
|
||||||
| 4 | LED |
|
| 4 | LED |
|
||||||
|~11 | RC-Trasmitter |
|
|~11 | RC-Trasmitter |
|
||||||
|
|
||||||
|
# Protocol
|
||||||
|
|
||||||
|
0,5 Byte Overhead
|
||||||
|
0,5 Byte Command
|
||||||
|
1 Byte Pin
|
||||||
|
6 Byte Value
|
||||||
|
----
|
||||||
|
8 Byte
|
||||||
|
|
||||||
|
## Description
|
||||||
|
All messages start with the header, which consits of a nibble:
|
||||||
|
```
|
||||||
|
0101
|
||||||
|
```
|
||||||
|
Those four Bits are followed by one of ten commands which are also encoded in a nibble i.e.:
|
||||||
|
```
|
||||||
|
0000 - toggle Debug mode
|
||||||
|
or combined
|
||||||
|
0101 0000 - Ascii: P / Dec: 80
|
||||||
|
```
|
||||||
|
The server side of the protocol deals with the messages as Ascii encoded strings. This is followed by the second byte which encodes the pin that shall be used:
|
||||||
|
```
|
||||||
|
Pin ranges digital: 110 0001 / Ascii: a / DEC: 97 - 110 1110 / Ascii: n / DEC: 110
|
||||||
|
Pin ranges analog: 110 1111 / Ascii: o / DEC: 111 - 111 0100 / Ascii: t / DEC: 116
|
||||||
|
```
|
||||||
|
Followed by six byte long value
|
||||||
|
|
||||||
|
## Possible Commands
|
||||||
|
|
||||||
|
80 - P - toggle Debug
|
||||||
|
81 - Q - set pin mode
|
||||||
|
82 - R - digital write
|
||||||
|
83 - S - digital read
|
||||||
|
84 - T - analog write
|
||||||
|
85 - U - analog read
|
||||||
|
86 - V - handle RC Decimal
|
||||||
|
87 - W - handle RC TriState
|
||||||
|
88 - X - handle IR send
|
||||||
|
89 - Y - handle Ping
|
||||||
|
|
||||||
|
## Special Command
|
||||||
|
90 - Z - Beginn Communication
|
||||||
|
|
||||||
|
## Possible fututre commands
|
||||||
|
91 - [ -
|
||||||
|
92 - \ -
|
||||||
|
93 - ] -
|
||||||
|
94 - ^ -
|
||||||
|
95 - _ -
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in a new issue