Elmo Recio 2002-09-19 01:59
|
Baud |
4800 |
|
Bits |
8 |
|
Parity |
None |
|
Stop-Bits |
1 |
In order to read data:
Block until two 8-bit bytes are received from the serial port.
This may be stored by allocating memory for two pointers, the size of chars (POSIX-C).
The first four bits of each byte refers to the house code.
The last four bits of the first byte refer to the event code.
The last four bits of the second byte refer to the device code.
|
Event No. |
Byte |
Byte |
|
99 |
0x22 |
0x21 |
A complete sample read would be: 0x2221
Byte 1
|
0x |
2 |
2 |
|
Hex Id |
House |
Event |
Byte 2
|
0x |
2 |
1 |
|
Hex Id |
House |
Device |
[all values are in hexadecimal for easy visual interpretation]
This was actually easier than I thought, so I was quite stumped!