Skip to main content
All communication between devices, applications, and the Haptics server occurs over the WebSocket protocol. Because a WebSocket stream is a continuous flow of bytes, we wrap every discrete message in a small binary frame — the HapticFrame.
Public Protobuf schema: schema.protoReference implementation: haptic_frame.go — Read · Write

Frame Layout

  • Header — one byte, the FrameType.
  • Lengthuint16, little-endian, counts the full frame (header + length + data).
  • Data — up to 1024 bytes; typically a marshaled Protobuf message.

Read


Write

The complete example and tests live in haptic_protocol.go.

Once you can read and write HapticFrames, you can exchange arbitrary binary messages with the server or other clients. We use Protobuf as the message format — see the schema. Continue with the Subscription Flow and Publication Flow.