VrRemoteBinaryCodec class

Experimental binary wire codec for compact VRlizate pose streaming.

A pose is exactly 28 bytes, but is not a full gamepad state: it has no mode, second stick, range, or recenter command. JSON remains the full-state route in vrlizate_joystick. Encoding/decoding allocates; this is not a Zero-GC API. Sequences and sender timestamps contain only their lower 16 and 32 bits. Receivers must compare sequences modulo 65536 (a forward gap < 32768).

Null touch coordinates use signed -32768; 0..32767 encode the full 0..1 range. The previous experimental +32767 sentinel was ambiguous with 1.0 and is not supported: update experimental senders and receivers together.

Constructors

VrRemoteBinaryCodec()
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

decodeInputEvent(Uint8List bytes) VrInputEventSnapshot
Decodes a 16-byte Uint8List into a discrete input event.
decodePose(Uint8List bytes) VrRemotePoseFrame
Decodes a 28-byte Uint8List into a VrRemotePoseFrame.
encodeHeartbeat({required int id, required int timestampUs, bool isPong = false}) Uint8List
Encodes a 12-byte heartbeat (Ping/Pong) packet.
encodeInputEvent(VrInputEventSnapshot snapshot) Uint8List
Encodes a discrete input action event into a 16-byte Uint8List.
encodePose(VrRemotePoseFrame frame) Uint8List
Encodes a VrRemotePoseFrame into a compact 28-byte Uint8List.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

inspectPacketType(List<int> bytes) int?
Returns the packet type of a binary payload, or null if invalid.
isBinaryPacket(List<int> bytes) bool
Checks whether bytes starts with the VRlizate binary protocol magic byte.

Constants

heartbeatPacketLength → const int
inputPacketLength → const int
magicByte → const int
packetTypeHeartbeat → const int
packetTypeInput → const int
packetTypePose → const int
posePacketLength → const int