API referenceVetraGlove ProC++

Runtime and status data

Data models

Current version · 2.0.0

UpdateResult

TypeField or methodType and description
UpdateResulttick()std::uint64_t, the current scheduling sequence number
UpdateResultran_task_count()std::uint64_t, the number of tasks executed this time
UpdateResulthas_next_task()bool, whether a periodic deadline exists; observation only, not a gate for sleep()
UpdateResultsleep()SleepResult, waits for the next task to become due; each result can be called only once

Example

Glove is started in manual scheduling mode. Call sleep() once per result; do not use has_next_task to decide whether to call it.

const auto update = glove.update();
std::cout << update.tick() << " " << update.ran_task_count() << '\n';
if (update.sleep() == qnbot::SleepResult::no_tasks) {
    std::this_thread::sleep_for(std::chrono::milliseconds(10));
}

Complete example: manual_runtime.cpp.

GloveStatus

Fields

FieldTypeDescription
device_typestd::stringDevice type
connected / staleboolWhether connected and whether the data is stale
timestampdoubleStatus timestamp
last_errorstd::optional<std::string>Most recent device error
reconnect_countstd::uint64_tNumber of successful recoveries
fieldsstd::map<std::string, Value>Additional status related to the device type

Health

Fields

FieldTypeDescription
okboolWhether the current aggregate status is healthy
warning_count / error_countstd::uint64_tCumulative warning and error counts
devicesstd::map<std::string, DeviceHealth>Mapping from source ID to device health summary
last_errorstd::optional<std::string>Most recent SDK error
runtime_overrunboolWhether SDK scheduling has ever overrun
topic_callback_errorboolWhether an unhandled exception has ever occurred in an SDK data processing callback

DeviceHealth contains connected: bool, stale: bool, and last_error: std::optional<std::string>.

CalibrationReadiness

TypeField or methodType and description
CalibrationReadinessstateCalibrationReadinessState: not_required, ready, or needs_calibration
CalibrationReadinessoperator_idstd::string, the wearer identifier used for this determination