API referenceVetraGlove ProPython

Runtime and status data

Data models

Current version · 2.0.0

UpdateResult

UpdateResult is returned by sdk.update() or glove.update() and is used to view how many tasks this manual scheduling executed and whether there are still subsequent tasks, and to wait for the next task to become due.

Fields

FieldTypeNullableDescription
tickintNoCurrent update sequence number
ran_task_countintNoThe number of tasks executed this time
has_next_taskboolNoWhether a periodic task deadline exists; observation only, not a gate for sleep()
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.

from qnbot_sdk import SleepResult
import time

update = glove.update()
print(update.tick, update.ran_task_count)
if update.sleep() is SleepResult.NO_TASKS:
    time.sleep(0.01)

Complete example: manual_runtime.py.

GloveStatus

GloveStatus is the device status published by device.status(), used to observe the current connection, whether the data is stale, the most recent error and the number of successful recoveries.

Fields

FieldTypeNullableDescription
device_typestrNoDevice type
connectedboolNoWhether it is currently connected
staleboolNoWhether the current data is already stale or has not started flowing yet
timestampfloatNoStatus timestamp
last_errorstr | NoneYesThe most recent device error; None when there is no error
reconnect_countintNoThe cumulative number of successful connection recoveries
fieldsdict[str, object]NoAdditional status related to the device type; can be an empty mapping

DeviceHealth

DeviceHealth is the device health summary corresponding to each source in Health.devices, used to view the connection, data freshness and most recent error of multiple gloves at the same time.

Fields

FieldTypeNullableDescription
connectedboolNoWhether the device is connected
staleboolNoWhether the device data is stale or has not started flowing yet
last_errorstr | NoneYesThe most recent device error

Health

Health is returned by sdk.health() or glove.health() and is used to summarize the warnings, errors, device status and scheduling status of the SDK or all gloves.

Fields

FieldTypeNullableDescription
okboolNoWhether the current summary status is healthy
warning_countintNoThe number of warnings in the current summary
error_countintNoThe number of errors in the current summary
devicesdict[str, DeviceHealth]NoMapping from source ID to device health status
last_errorstr | NoneYesThe most recent SDK error
runtime_overrunboolNoWhether SDK scheduling has ever overrun
topic_callback_errorboolNoWhether an unhandled exception has ever occurred in a callback

CalibrationReadiness

CalibrationReadiness is returned by device.calibration_status() and is used to determine whether the specified target requires no calibration, can be used directly or needs recalibration for the current wearer.

Fields

FieldTypeNullableDescription
stateCalibrationReadinessStateNoNOT_REQUIRED, READY or NEEDS_CALIBRATION
operator_idstrNoThe wearer identifier used for this determination