mirror of
https://github.com/rfc2822/GfxTablet
synced 2025-10-03 01:29:17 +02:00

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.
27 lines
727 B
Text
27 lines
727 B
Text
Network protocol used by GfxTablet
|
|
|
|
|
|
|
|
Version 1
|
|
---------
|
|
|
|
GfxTablet app sends UDP packets to port 40118 of the destination host.
|
|
|
|
Packet structure, uses network byte order (big endian):
|
|
|
|
9 bytes "GfxTablet"
|
|
1 word version number
|
|
1 byte type:
|
|
0 motion event (hovering)
|
|
1 button event (finger, pen etc. touches surface)
|
|
|
|
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:
|
|
1 byte number of button, starting with 0
|
|
1 byte button status:
|
|
0 button is down
|
|
1 button is up
|
|
|