webOS control channels and power

The remote is built around measured TV behavior: SSAP requests, a one-way pointer socket, and Wake-on-LAN each solve a different part of control.

Source baseline: app 1.0.0 (1) · 14 August 2026

Measured baseline

The protocol baseline was measured against an LG OLED C8 from 2018 running webOS 4.x. The product direction changed after testing showed that general remote control worked reliably while arbitrary text input did not work in every TV app.

Primary APILG webOS SSAP over secure WebSocket
Pointer inputSeparate one-way secure WebSocket with line-delimited frames
Power offSSAP system/turnOff
Power onWake-on-LAN magic packet using a previously saved interface MAC

Discovery, trust, and pairing

Discovery locates awake TVs on the local network. The app connects to the secure SSAP endpoint, presents the permission manifest, and waits for approval on the TV. The returned client key is stored through an Android Keystore-backed implementation and reused with the same permission manifest.

Control channels and read-back

SSAP requests cover volume, mute, channel information, app launch, power, and subscriptions. Pointer movement, click, scroll, and remote-button frames use the pointer socket, which returns no command acknowledgement.

Send success is not state success. Where webOS exposes a query or subscription, the app reads back volume, channel, power, or foreground-app state. Pointer-only commands cannot offer the same proof.

Movement is accumulated and coalesced before pointer frames are emitted. Gesture handling is a deterministic state machine for move, tap, two-finger scroll, and flick, allowing tests to use a virtual clock rather than physical timing.

Power round trip

An awake TV can be turned off through SSAP. A deeply sleeping TV closes SSAP and may stop answering discovery, so it cannot provide its MAC at wake time. The app saves the active wired or Wi-Fi MAC while the TV is awake and sends a WoL magic packet to wake it later.

Verification and known limits

The code separates pure core state machines from Android transport adapters and includes a fake-TV harness, virtual scheduler, SSAP codec tests, pairing and transport tests, pointer and gesture tests, WoL packet tests, UI tests, and measured-device probes.