-
Notifications
You must be signed in to change notification settings - Fork 11
Packet Format
Each message is transmitted in a packet which has a fixed 3-byte header and a fixed 1-byte trailer.
The packet is preceded by a training pre-amble and a 2-byte sync-word. It is followed by more training bytes.
So the overall format of a packet is <pre-amble><sync-word><header><Evohome Message><trailer><training>
Training bytes are bytes with alternating mark (one) and space (zero) bits. START and STOP bits around the training byte continue this pattern so that a sequence of training bytes are a continuous stream of zeros. Since START is a space and STOP is a mark this fixes the value of a traininng byte as 0x55.
This appears in the bitstream as 0 10101010 1
or <S>10101010<p>
The pre-amble is a sequence of training bytes that provide bit level timing for the bitstream.
It will appear as <S>10101010<p><S>10101010<p><S>10101010<p><S>10101010<p>
The Sync-Word is a two byte pattern that provides byte level alignment for the rest of the packet.
The byte values are 0xFF and 0x00. These will appear in the bitstream as <S>11111111<p><S>00000000<p>
This is the only place in a properly formatted message that 9 consecutive space bits will be found i.e. <S>00000000
The header is a fixed 3 byte sequence which acts a signature to identify the message as an evohome message.
The byte values are 0x33,0x55,0x53
The trailer is a single byte with the value 0x35
. This is a value that cannot appear as a byte in the Evohome Message itself and marks the end of the actual message.
The body of the message itself is transmitted using Manchester Coding.
Manchester Coding uses two bits to represent each actual data bit. Each of the pair of code bits are opposite in value so that there is always a transition between them. A 1 data bit is transmitted as 10 and a 0 data bit is transmitted as 01 (remember they will be transmitted LSB first).
The coding means that each actual message bytes requires two bytes to be transmitted in the bitstream (20 bits in total including the Start/stop bits).
In summary, the overall structure of a transmitted packet is
< pre-amble >< sync-word >< header >< Message Body ><trailer ><train >
< 55 >< 55 >< 55 >< 55 >< FF >< 00 >< 33 >< 55 >< 53 >< Message Body >< 35 >< 55 >
S10101010pS10101010pS10101010pS10101010pS11111111pS00000000pS11001100pS10101010pS11001010p< Message Body >S10101100pS10101010p