Skip to main content

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

Purpose: Select active stroker playback mode before sending control commands.

Device Information

DebugInformation

Fields:
  • free_heap_size — Available heap memory in bytes
  • external_flash_size — External flash storage in bytes

Server Connection

ServerStatus

Fields:
  • device_ip — Device IP encoded as Little‑Endian uint32
  • server_sync_time — Timestamp of last time synchronization reference on the device

Stroker (Linear Actuator)

StrokerStatus

Fields:
  • 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

Fields:
  • 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

Fields:
  • 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 user
  • playback_rate — Playback speed multiplier (1.0 = normal speed)

Motion Control Commands

HDCCommand (Direct Position Move, interruptible)

Fields:
  • position — Target position (transport scale dependent)
    • WiFi normalized scale: 0–10000 points (0.01% resolution)
    • BLE scale uses packed uint16 (see below)
  • time — Travel duration (milliseconds)

BLE binary equivalent mapping

Important: BLE never queues HDC commands. Every new write interrupts active movement.

HPS (Point Streaming)

Stream Contract Rules:
  • 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


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
For full endpoint behavior and schema detail, explore separate protocol reference tabs in the documentation.