Session Status (Read)
404, so use
the status code — not a boolean field — to tell whether the device is online.
Server Time
{"epoch_ms": …} — the server clock your timeline should follow, so that scripts and HPS
streams carrying large millisecond timestamps agree with the device.
One call is enough to be roughly right; to be precise, correct for the network:
- Call the endpoint about ten times, noting when you sent each request (
sent_at) and when the answer arrived (received_at). - For each call, the round trip is
received_at - sent_at, so the server clock at the moment the answer arrived is aboutepoch_ms + round_trip / 2. - The offset you want is that estimate minus your own clock at the same moment.
- Smooth the offsets instead of averaging them:
ewma = 0.3 * offset + 0.7 * ewma. - From then on,
server_time = your_clock + ewma.
TIME_SYNC frames, which the
device echoes back so the server can measure round-trip latency. See
Haptic Frames for the framing and
Subscription Flow for how a client handles those frames.
Integration Notes
- Confirm the device is online (
GET /device/sessionreturns200, not404) before sending timeline-based or streamed commands. - Read server time during onboarding and before scripted video or VR playback.
GET /device/sessioncarries the same clock asserver_time, alongside the connection details.