SDKC++ SDK

Haptics

Check haptics capability, set left and right strengths, and clear them before exit.

Current version · 1.4.0

Haptics

Set and clear

if (device.get_device_info().capabilities.haptics) {
    exo.start();
    auto haptics = device.haptics();
    qnbot::ExoHaptics value;
    value.left = 60;
    value.right = 40;
    haptics.set(value);
    // ...
    haptics.clear();
}

Each side is an std::optional<std::uint8_t> in 0…100, and set() requires at least one side. An empty side is not changed by that update. latest() returns the latest confirmed state. The state expires on stop, disconnect, or close, after which latest() returns an empty std::optional. The SDK publishes no synthetic zero-valued sample and does not replay the pre-disconnect command after recovery. While the device remains connected, call clear() before normal shutdown to drive the physical outputs to zero.