-
Notifications
You must be signed in to change notification settings - Fork 8
GameController
The game controller listens on port 6524 (TCP). The port can be changed via the ESP firmware.
The WiFi SSID and password, the ESP should connect to, can be configured via USB:
- Connect the NodeMCU to a computer
- Press reset and the button next to the LEDs simultaneously
- The NodeMCU now has a baud rate of 115200 and waits for data on its serial interface
- The SSID and password can be transferred with the following format:
xSSIDxPASSx
wherex
is a separator.x
should be 0x00. - Press reset again and the NodeMCU will start normally, using the new configuration.
The circuit diagram has been created with draw.io and is available as an image or an XML file.
the XML file is Located at "SmartChair/gameController/doku/schaltplan.xml"
All integers are in network byte order (Big-Endian)
The most significant bit is always set. The current version is 0x8001
A 16Bit magic Number. The value is always 0xBABA
The most significant bit is always 0, A valid session ID cannot be 0
Therefore valid session IDs are in range 1(inclusive) to 32768(exclusive)
Identifies a packet. The first packet ID should be 0 and every following should increment this value by 1.
An ID describing the device. A list of device IDs can be found further down this page.
¿Unused/Not implemented?
>>> [ version ] [ Magic Number ]
<<< [ version ] [ Session ID ]
>>> [ Session ID ] [ Packet ID ] [ Data Size (8Bit) ]
size*( [ Device ] [ Value (16Bit) ] )
Error:
<<< [ Session ID ] [ Packet ID ] [ Error code ] [Data Size (16Bit)]
size*([Value (16Bit)])
>>> [ Session ID ] [ Packet ID ] [ 0 (8Bit) ]
<<< [ Version ] [ 0 (16Bit)]
All IDs below 0x0100 are reserved for joystick interactions.
A signed 16Bit value which indicates the position on the X-Axis. 0 is the point of origin.
A signed 16Bit value which indicates the position on the Y-Axis. 0 is the point of origin.
A list of 16 bits. Every bit indicates the state of a single button (1: Pressed, 0: Released). The most significant bit is button 0 while the least significant bit is button 15.
A list of 16 bits. Every bit indicates the state of a single button (1: Pressed, 0: Released). The most significant bit is button 16 while the least significant bit is button 31.
Every ID between 0x0100(inclusive) and 0x0200(exclusive) are reserved for keyboard inputs
##Device 0x01XX Where XX is a value from this enum. This list is definitely absolutely 100% correct. Its not
Data: [ 16bit duration ]
The key, corresponding to the keycode, will be pressed for x
milliseconds where x
is the number given in the duration
field. If a key is already pressed, the remaining duration will be overwritten with the new value.
#Hardware interaction 0x0200(inclusive) - 0x0300(exclusive)
0=off
!0=on
0=off
!0=on
0=off
!0=on