Core objects & lifecycle
Understand the responsibilities and close hierarchy of Sdk, Exo, ExoDevice, and channels.
Core objects & lifecycle
Object hierarchy
Sdk
└── Exo sdk.exo()
└── ExoDevice exo.device(name)
├── telemetry()
├── status()
└── haptics()Sdkowns the native runtime and device configuration; normally create one per process.Exocontrols startup, scheduling, stopping, health, and close for the Exo domain.ExoDeviceselects a logical device and exposes information, channels, and haptics.ReadChannelsupportslatest(),subscribe(), and asynchronousnext().
Status and health
device.status() is a continuously published ReadChannel[ExoStatus] for observing connection changes, stale data, the latest error, and reconnect count. device.health() and exo.health() return an aggregate Health snapshot at call time, which is more suitable for control flow and diagnostic logs. They are complementary: subscribe to status() to observe changes, and read health() for an immediate summary.
Lifecycle
For one device, prefer exo.start() → run → exo.stop() → exo.close(). Use device.start() and device.stop() only when multiple devices must be controlled independently.
Closing a device invalidates that device's channels and subscriptions. Closing Exo invalidates every ExoDevice and channel in the domain. Later calls raise ClosedHandleError; root sdk.close() cleans up remaining resources, but normal shutdown should still stop and close explicitly in hierarchy order.