-
Notifications
You must be signed in to change notification settings - Fork 2
Networking
This page describes the technical implementation details of the communication between the controllers, the service and the SteamVR driver.
The controllers must discover the server to push their metadata to. This is solved using a UDP broadcast. The controller broadcasts the (randomly chosen) 4-byte discovery sequence 0x79 0x65 0x65 0x74
to all devices on the subnet on port 12743
. The server listens for theses sequences and if one is received, returns its local IP address as a NUL-terminated ASCII string to the controller. The controller then starts streaming motion and button data via UDP to the server on port 12742
.
The protocol that is used between the TwometerVR Service (TVR.Service
) and the individual hand controllers. This synchronizes button presses, controller states and most importantly pose data with the PC. Rotation data is transmitted as quaternions.
[byte controllerId][byte buttonPressCount][byte[] buttonPresses][float qx][float qy][float qz][float qw]
Used to notify the server about the state of the controller
The 0xFF
is used to indicate that this is a status message.
[0xFF][byte status]
-
0x00
: Connected -
0x01
: Begin calibration mode -
0x02
: Begin calibrating magnetometer -
0x03
: Exit calibration mode -
0x04
: Begin calculating offsets -
0x05
: Controller ready
The protocol that is used for the communication between the service and the driver. The service regularly pushes updates to the driver, including controller pose data (position & rotation) and button states
[int16 length][byte controllerStateCount][ControllerState[] controllerStates]
[byte ctrlId][float posX][float posY][float posZ][float rotX][float rotY][float rotZ][float rotW][byte buttonCount][ButtonState[] states]
[byte btnId][bool pressed]
by Twometer, released under GPL license
For makers
For developers
For everyone