comparison docs/extension-pingpong.txt @ 10:36c4cda4b6c4

Add extension support with the PINGPONG extension Add extension support. There are two ways to add extensions: 1. as a shared object which will be loaded with ext=<filename> as a parameter to lwwire. See the lwwire_pingpong.c file for details. 2. By doing basically the same thing as a shared object but linking it into the main binary and calling lwwire_register_extension() appropriately.
author William Astle <lost@l-w.ca>
date Sat, 30 Jul 2016 13:16:39 -0600
parents
children
comparison
equal deleted inserted replaced
9:a11b330771e0 10:36c4cda4b6c4
1 This document describes an extension to the LWWire protocol which provides
2 a "PINGPONG" facility. It does not provide a generally useful service.
3 However, it does serve to show how a basic extension can be defined. It also
4 gives clients an option to enable an extension and use that to determine if
5 the server has reset or otherwise got into a mixed up state. For instance,
6 the client could negotiate the PINGPONG extension and then periodically send
7 a PINGPONG_PING operation. If it doesn't get the appropriate response, it
8 can then assume that the server has reset and it should re-initialize its
9 drivers.
10
11 LWWire Protocol Extension
12 =========================
13
14 This extension is called PINGPONG and is assigned extension number DF. It
15 defines the following operations in its extension space.
16
17 00 PINGPONG_PING
18
19 This does just what it's name implies. It does nothing except reply to the
20 client.
21
22 Request:
23
24 Octet Meaning
25 ----- -------
26 0-2 F3 DF 00
27
28 Response:
29
30 Octet Meaning
31 ----- -------
32 0 42
33
34 The response will always be 42.
35
36 01 PINGPONG_PONG
37
38 This is exactly like PINGPONG_PING. It's provided for humour value.
39
40 Request:
41
42 Octet Meaning
43 ----- -------
44 0-2 F3 DF 01
45
46 Response:
47
48 Octet Meaning
49 ----- -------
50 0 42
51
52 The response will always be 42.
53