Class MobileIO

Class Documentation

class MobileIO

Public Types

enum class ButtonMode

Values:

enumerator Momentary
enumerator Toggle
enum class ButtonState

Values:

enumerator ToOff
enumerator Unchanged
enumerator ToOn

Public Functions

bool update(int32_t timeout_ms = Group::DEFAULT_TIMEOUT_MS)
bool resetUI(bool acknowledge_send = true)
bool setAxisSnap(int axis_number, float snap_to, bool acknowledge_send = true)
inline bool disableAxisSnap(int axis_number, bool acknowledge_send = true)
bool setAxisValue(int axis_number, float value, bool acknowledge_send = true)
bool setAxisLabel(int axis_number, const std::string &message, bool acknowledge_send = true)
bool setButtonMode(int button_number, ButtonMode mode, bool acknowledge_send = true)
bool setButtonLed(int button_number, bool on, bool acknowledge_send = true)
bool setButtonLabel(int button_number, const std::string &message, bool acknowledge_send = true)
bool setLedColor(uint8_t r, uint8_t g, uint8_t b, bool acknowledge_send = true)
bool appendText(const std::string &message, bool acknowledge_send = true)
bool clearText(bool acknowledge_send = true)
inline const hebi::Feedback &getLastFeedback() const
inline const Vector3f getArPosition() const
inline const Quaternionf getArOrientation() const
float getAxis(int axis) const
bool getButton(int button) const
ButtonState getButtonDiff(int button) const
bool sendLayout(const std::string &layout_file, int32_t timeout_ms = Group::DEFAULT_TIMEOUT_MS) const

Sends a layout file to the MobileIO device, requesting delivery acknowledgment.

The layout file should be provided as a file path with contents of a JSON string buffer (this may be extended in the future to support other formats with optional arguments).

Note: A false return does not indicate a specific failure and may result from an error while sending or simply a timeout/dropped response packet after a successful transmission.

Parameters:

layout_file – The path to the layout file to send to the MobileIO object.

Returns:

true if the layout was successfully sent and an acknowledgment was received; false otherwise.

bool sendLayoutBuffer(const std::string &layout_buffer, int32_t timeout_ms = Group::DEFAULT_TIMEOUT_MS) const

Sends a layout to the MobileIO device from a string buffer, requesting delivery acknowledgment.

The layout should be provided as a JSON string buffer (this may be extended in the future to support other formats with optional arguments).

Note: A false return does not indicate a specific failure and may result from an error while sending or simply a timeout/dropped response packet after a successful transmission.

Parameters:

layout_buffer – A string containing the JSON layout to send to the MobileIO object.

Returns:

true if the layout was successfully sent and an acknowledgment was received; false otherwise.

Public Static Functions

static std::unique_ptr<MobileIO> create(const std::string &family, const std::string &name)
static std::unique_ptr<MobileIO> create(const std::string &family, const std::string &name, const Lookup &lookup)

Public Static Attributes

static constexpr size_t NumButtons = 8