Runtime and status data
Data models
Current version · 2.0.0
UpdateResult
| Type | Field or method | Type and description |
|---|---|---|
UpdateResult | tick() | std::uint64_t, the current scheduling sequence number |
UpdateResult | ran_task_count() | std::uint64_t, the number of tasks executed this time |
UpdateResult | has_next_task() | bool, whether a periodic deadline exists; observation only, not a gate for sleep() |
UpdateResult | sleep() | 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
| Field | Type | Description |
|---|---|---|
device_type | std::string | Device type |
connected / stale | bool | Whether connected and whether the data is stale |
timestamp | double | Status timestamp |
last_error | std::optional<std::string> | Most recent device error |
reconnect_count | std::uint64_t | Number of successful recoveries |
fields | std::map<std::string, Value> | Additional status related to the device type |
Health
Fields
| Field | Type | Description |
|---|---|---|
ok | bool | Whether the current aggregate status is healthy |
warning_count / error_count | std::uint64_t | Cumulative warning and error counts |
devices | std::map<std::string, DeviceHealth> | Mapping from source ID to device health summary |
last_error | std::optional<std::string> | Most recent SDK error |
runtime_overrun | bool | Whether SDK scheduling has ever overrun |
topic_callback_error | bool | Whether 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
| Type | Field or method | Type and description |
|---|---|---|
CalibrationReadiness | state | CalibrationReadinessState: not_required, ready, or needs_calibration |
CalibrationReadiness | operator_id | std::string, the wearer identifier used for this determination |