From 51d862cf45706195ed5082e912d47c2f6fbe19f7 Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Mon, 6 Jan 2014 20:03:14 +0300 Subject: [PATCH] Fix protocol description doc/protocol.txt: Replaced type names with architecture independent aliases, fixed 'type' size which is a byte, and recorded that it uses "big endian", or "network byte order" convention. --- doc/protocol.txt | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/doc/protocol.txt b/doc/protocol.txt index cdb7647..9c039cd 100644 --- a/doc/protocol.txt +++ b/doc/protocol.txt @@ -1,4 +1,3 @@ - Network protocol used by GfxTablet @@ -8,21 +7,21 @@ Version 1 GfxTablet app sends UDP packets to port 40118 of the destination host. -Packet structure: +Packet structure, uses network byte order (big endian): - 9 octets "GfxTablet" - 1 ushort version number - 1 ushort type: - 0 motion event (hovering) - 1 button event (finger, pen etc. touches surface) + 9 bytes "GfxTablet" + 1 word version number + 1 byte type: + 0 motion event (hovering) + 1 button event (finger, pen etc. touches surface) - 1 ushort x (using full range: 0..65535) - 1 ushort y (using full range: 0..65535) - 1 ushort pressure (using full range 0..65535, 32768 == pressure 1.0f on Android device) + 1 word x (using full range: 0..65535) + 1 word y (using full range: 0..65535) + 1 word pressure (using full range 0..65535, 32768 == pressure 1.0f on Android device) -when type == button event: + when type == button event: 1 byte number of button, starting with 0 1 byte button status: - 0 button is down - 1 button is up + 0 button is down + 1 button is up