Skip to content

Networking

Twometer edited this page May 3, 2020 · 13 revisions

This page describes the technical implementation details of the communication between the controllers, the service and the SteamVR driver.

Server Discovery

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.

Protocol Controller <-> Service

The protocol that is used between the TwometerVR Service (TVR.Service) and the individual hand controllers. This synchronizes button presses and gyroscope data with the PC.

ControllerInfoPacket

[byte controllerId][byte buttonPressCount][byte[] buttonPresses][float yaw][float pitch][float roll]

CalibrationCompletePacket

Once calibration is completed, the controller sends a message containing 0xFF 0xFF to notify the server that it finished calibration.

Protocol Service <-> Driver

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

DriverPacket

[int16 length][byte controllerStateCount][ControllerState[] controllerStates]

ControllerState

[byte ctrlId][float posX][float posY][float posZ][float rotX][float rotY][float rotZ][byte buttonCount][ButtonState[] states]

ButtonState

[byte btnId][bool pressed]

For makers

For developers

For everyone

Clone this wiki locally