Protocol Definitions
This page documents the Protocol Buffer (protobuf) message definitions used in the HapticsConnect Haptics API. While BLE uses compact binary characteristic formats, understanding the underlying protobuf structures helps with WiFi API integration and provides insight into the data model.Common Types
PlaybackProtocol Enum
Device Information
DebugInformation
free_heap_size— Available heap memory in bytesexternal_flash_size— External flash storage in bytes
Server Connection
ServerStatus
device_ip— Device IP encoded as Little‑Endian uint32server_sync_time— Timestamp of last time synchronization reference on the device
Stroker (Linear Actuator)
StrokerStatus
current_pos_angle— Current position (radians)current_pos_range— Current position (0–10000 points)target_pos_angle— Target position (radians)target_pos_range— Target position (0–10000 points)current_vel_angle— Current velocity (rad/s)current_vel_range— Current velocity (points/s)
StrokerCalibrationInfo
calib_low_position— Lowest physical bound, physically blocked position (mm)calib_high_position— Highest physical bound, physically blocked position (mm)calibration_length— Full mechanical stroke length (mm)hall_low_position— Hall sensor reading at low limit (mm)hall_high_position— Hall sensor reading at high limit (mm)calib_shift— Firmware positional offset applied after calibration, encoder-only (mm)
StrokerSettings
low_position_shift— User defined low position shift (mm)high_position_shift— User defined high position shift (mm)max_velocity— Max velocity limit set by userplayback_rate— Playback speed multiplier (1.0 = normal speed)
Motion Control Commands
HDCCommand (Direct Position Move, interruptible)
position— Target position (transport scale dependent)- WiFi normalized scale:
0–10000 points(0.01% resolution) - BLE scale uses packed
uint16(see below)
- WiFi normalized scale:
time— Travel duration (milliseconds)
BLE binary equivalent mapping
Important: BLE never queues HDC commands. Every new write interrupts active movement.
HPS (Point Streaming)
- Velocity is always device‑derived unless using duration‑based HDC moves
- Requires minimum 2 valid points to calculate velocity
- Max 64 points uploaded per message
- Max 128 points stored in stream buffer
- Negative time delta between consecutive points → prior timestamp is treated as
0
BLE Binary Layout (per point write into Char 0x2002 > 0x0001)
Data Type Mapping Table
| Protobuf Type | BLE Binary Format | Size | Valid Range |
|---|---|---|---|
uint32 | LE uint32 | 4 bytes | 0 → 4,294,967,295 |
uint16 | LE uint16 | 2 bytes | 0 → 65,535 |
uint64 | LE uint64 | 8 bytes | 0 → 2⁶⁴−1 |
int32 | LE int32 | 4 bytes | −2,147,483,648 → 2,147,483,647 |
float | IEEE 754 single | 4 bytes | ±3.4E±38 |
bool | 1 byte | 1 byte | 0 or 1 |
string | UTF‑8 + � | Variable | Max depends on characteristic |
Developer Mental Model
- WiFi API → Protocol Buffers decoded to JSON
- BLE → Compact packed Little‑Endian binary
- Both share the same protocol contract logic
- Velocity is never transmitted in BLE point packets
- Protocol must be set first, then commands are accepted