view docs/extension-pingpong.txt @ 14:e4d98cbf95eb

packet: add get value semantics
author Brett Gordon
date Tue, 13 Dec 2016 11:26:37 -0500
parents 36c4cda4b6c4
children
line wrap: on
line source

This document describes an extension to the LWWire protocol which provides
a "PINGPONG" facility. It does not provide a generally useful service.
However, it does serve to show how a basic extension can be defined. It also
gives clients an option to enable an extension and use that to determine if
the server has reset or otherwise got into a mixed up state. For instance,
the client could negotiate the PINGPONG extension and then periodically send
a PINGPONG_PING operation. If it doesn't get the appropriate response, it
can then assume that the server has reset and it should re-initialize its
drivers.

LWWire Protocol Extension
=========================

This extension is called PINGPONG and is assigned extension number DF. It
defines the following operations in its extension space.

00 PINGPONG_PING

This does just what it's name implies. It does nothing except reply to the
client.

Request:

Octet	Meaning
-----	-------
0-2	F3 DF 00

Response:

Octet	Meaning
-----	-------
0	42

The response will always be 42.

01 PINGPONG_PONG

This is exactly like PINGPONG_PING. It's provided for humour value.

Request:

Octet	Meaning
-----	-------
0-2	F3 DF 01

Response:

Octet	Meaning
-----	-------
0	42

The response will always be 42.