[OpenTRV-dev] New protocol first two hand-worked example
Damon Hart-Davis
dhd at exnet.com
Thu Dec 17 11:09:14 GMT 2015
Hi,
http://www.earth.org.uk/OpenTRV/stds/network/20151203-DRAFT-SecureBasicFrame.txt
Now has the first two (non-secure) hand-worked examples of the proposed simplified ‘open’ and secureable protocol.
Comments, checking (I discovered an error just now in the first one for example, in the CRC computation), all welcome ASAP.
I will have to start implementing this now in C in the mainline codebase for a piece of work to be delivered on Monday (!) so the sooner any idiotic oversights or errors on my part are pointed out to me, the better %-P
Also, for reference, here is where the Java unit tests and reference implementation are, which provides test vectors for implementation (such as V0p2) and examples for the spec:
https://github.com/DamonHD/OpenTRV/blob/master/javasrc/uk/org/opentrv/test/leafauthenc/SecureFrameTest.java
Rgds
Damon
Example insecure frame, valve unit 0% open, no call for heat/flags/stats.
In this case the frame sequence number is zero, and ID is 0x80 0x81.
08 4f 02 80 81 02 | 00 01 | 23
08 length of header (8) after length byte 5 + body 2 + trailer 1
4f 'O' insecure OpenTRV basic frame
02 0 sequence number, ID length 2
80 ID byte 1
81 ID byte 2
02 body length 2
00 valve 0%, no call for heat
01 no flags or stats, unreported occupancy
23 CRC value
Example insecure frame, no valve, representative minimum stats {"b":1}
In this case the frame sequence number is zero, and ID is 0x80 0x81.
0e 4f 02 80 81 08 | 7f 11 7b 22 62 22 3a 31 | 61
0e length of header (14) after length byte 5 + body 8 + trailer 1
4f 'O' insecure OpenTRV basic frame
02 0 sequence number, ID length 2
80 ID byte 1
81 ID byte 2
08 body length 8
7f no valve, no call for heat
11 no flags, unreported occupancy, stats present
7b 22 62 22 3a 31 {"b":1 Stats: note that implicit trailing '}' is not sent.
61 CRC value
More information about the OpenTRV-dev
mailing list