toio.cube.api.configuration module¶
- class toio.cube.api.configuration.RequestProtocolVersion[source]¶
Bases:
CubeCommand
Protocol version request command
References
https://toio.github.io/toio-spec/en/docs/ble_configuration#requesting-the-ble-protocol-version
- class toio.cube.api.configuration.SetHorizontalDetectionThreshold(threshold: int)[source]¶
Bases:
CubeCommand
Horizontal detection threshold setting command
References
https://toio.github.io/toio-spec/en/docs/ble_configuration#horizontal-detection-threshold-settings
- class toio.cube.api.configuration.SetCollisionDetectionThreshold(threshold: int)[source]¶
Bases:
CubeCommand
Collision detection threshold setting command
References
https://toio.github.io/toio-spec/en/docs/ble_configuration#collision-detection-threshold-settings
- class toio.cube.api.configuration.SetDoubleTapDetectionTimeInterval(threshold: int)[source]¶
Bases:
CubeCommand
Double-tap detection time interval setting command
References
- class toio.cube.api.configuration.NotificationCondition(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
IntEnum
Notification conditions of ID notification
References
https://toio.github.io/toio-spec/en/docs/ble_configuration#notification-conditions
- Always = 0¶
- ChangeDetection = 1¶
- Periodic = 255¶
- class toio.cube.api.configuration.SetIdNotification(interval_ms: int, condition: NotificationCondition)[source]¶
Bases:
CubeCommand
ID notification setting command
References
- __init__(interval_ms: int, condition: NotificationCondition) None [source]¶
- class toio.cube.api.configuration.SetIdMissedNotification(sensitivity_ms: int)[source]¶
Bases:
CubeCommand
ID missed notification setting command
References
- class toio.cube.api.configuration.MagneticSensorFunction(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
IntEnum
- Disable = 0¶
- MagnetState = 1¶
- MagneticForce = 2¶
- class toio.cube.api.configuration.MagneticSensorCondition(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
IntEnum
- Always = 0¶
- ChangeDetection = 1¶
- class toio.cube.api.configuration.SetMagneticSensor(function_type: MagneticSensorFunction, interval_ms: int, condition: MagneticSensorCondition)[source]¶
Bases:
CubeCommand
Magnet sensor setting command
References
https://toio.github.io/toio-spec/en/docs/ble_configuration#magnetic-sensor-settings-
- __init__(function_type: MagneticSensorFunction, interval_ms: int, condition: MagneticSensorCondition) None [source]¶
- class toio.cube.api.configuration.MotorSpeedInformationAcquisitionState(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
IntEnum
- Disable = 0¶
- Enable = 1¶
- class toio.cube.api.configuration.SetMotorSpeedInformationAcquisition(state: MotorSpeedInformationAcquisitionState)[source]¶
Bases:
CubeCommand
Motor speed information acquisition setting command
References
- __init__(state: MotorSpeedInformationAcquisitionState) None [source]¶
- class toio.cube.api.configuration.PostureAngleDetectionType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
IntEnum
- Euler = 1¶
- Quaternions = 2¶
- class toio.cube.api.configuration.PostureAngleDetectionCondition(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
IntEnum
Notification condition of posture angle detection
References
https://toio.github.io/toio-spec/en/docs/ble_configuration#notification-conditions-1
- Always = 0¶
- ChangeDetection = 1¶
- class toio.cube.api.configuration.SetPostureAngleDetection(detection_type: PostureAngleDetectionType, interval_ms: int, condition: PostureAngleDetectionCondition)[source]¶
Bases:
CubeCommand
Posture angle detection setting command
References
https://toio.github.io/toio-spec/en/docs/ble_configuration#posture-angle-detection-settings-
- __init__(detection_type: PostureAngleDetectionType, interval_ms: int, condition: PostureAngleDetectionCondition)[source]¶
- class toio.cube.api.configuration.ProtocolVersion(payload: bytearray)[source]¶
Bases:
CubeResponse
Protocol version response
- version¶
version (UTF-8)
- Type:
str
References
https://toio.github.io/toio-spec/en/docs/ble_configuration#obtaining-the-ble-protocol-version
- class toio.cube.api.configuration.ResponseIdNotificationSettings(payload: bytearray)[source]¶
Bases:
CubeResponse
ID notification setting response
- result¶
Result of the command
- Type:
bool
References
- class toio.cube.api.configuration.ResponseIdMissedNotificationSettings(payload: bytearray)[source]¶
Bases:
CubeResponse
ID missed notification setting response
- result¶
Result of the command
- Type:
bool
References
- class toio.cube.api.configuration.ResponseMagneticSensorSettings(payload: bytearray)[source]¶
Bases:
CubeResponse
Magnetic sensor setting response
- result¶
Result of the command
- Type:
bool
References
https://toio.github.io/toio-spec/en/docs/ble_configuration#responses-to-magnetic-sensor-settings
- class toio.cube.api.configuration.ResponseMotorSpeedInformationAcquisitionSettings(payload: bytearray)[source]¶
Bases:
CubeResponse
Motor speed information setting response
- result¶
Result of the command
- Type:
bool
References
- class toio.cube.api.configuration.ResponsePostureAngleDetectionSettings(payload: bytearray)[source]¶
Bases:
CubeResponse
Posture angle detection setting response
- result¶
Result of the command
- Type:
bool
References
- toio.cube.api.configuration.ConfigurationResponseType¶
Response types of configuration characteristic
alias of
Union
[ProtocolVersion
,ResponseIdNotificationSettings
,ResponseIdMissedNotificationSettings
,ResponseMagneticSensorSettings
,ResponseMotorSpeedInformationAcquisitionSettings
,ResponsePostureAngleDetectionSettings
]
- class toio.cube.api.configuration.Configuration(interface: CubeInterface)[source]¶
Bases:
CubeCharacteristic
Configuration characteristic
References
https://toio.github.io/toio-spec/en/docs/ble_configuration
- static is_my_data(payload: bytearray) ProtocolVersion | ResponseIdNotificationSettings | ResponseIdMissedNotificationSettings | ResponseMagneticSensorSettings | ResponseMotorSpeedInformationAcquisitionSettings | ResponsePostureAngleDetectionSettings | None [source]¶
If payload is my characteristic response, this function returns CubeResponse object. Otherwise, it returns None.
- Parameters:
payload (GattReadData) – received data from the cube.
- __init__(interface: CubeInterface) None [source]¶
- async request_protocol_version() None [source]¶
Send protocol version request command
This function DO NOT return response payload. Receive the result by notification.
References
https://toio.github.io/toio-spec/en/docs/ble_configuration#requesting-the-ble-protocol-version
- async set_horizontal_detection_threshold(threshold: int) None [source]¶
Send horizontal detection threshold setting command
This function DO NOT return response payload. Receive the result by notification.
- Parameters:
threshold (int) – Threshold
References
https://toio.github.io/toio-spec/en/docs/ble_configuration#horizontal-detection-threshold-settings
- async set_collision_detection_threshold(threshold: int) None [source]¶
Send collision detection threshold setting request command
This function DO NOT return response payload. Receive the result by notification.
- Parameters:
threshold (int) – Threshold
References
https://toio.github.io/toio-spec/en/docs/ble_configuration#collision-detection-threshold-settings
- async set_double_tap_detection_threshold(threshold: int) None [source]¶
Send double-tap detection threshold setting request command
This function DO NOT return response payload. Receive the result by notification.
- Parameters:
threshold (int) – Threshold
References
- async set_id_notification(interval_ms: int, condition: NotificationCondition) None [source]¶
Send id information notification setting request command
This function DO NOT return response payload. Receive the result by notification.
- Parameters:
interval_ms (int) – Notification interval [ms]
condition (NotificationCondition) – Condition
References
- async set_id_missed_notification(sensitivity_ms: int) None [source]¶
Send ID missed notification setting request command
This function DO NOT return response payload. Receive the result by notification.
- Parameters:
sensitivity_ms (int) – Sensitivity [ms]
References
- async set_magnetic_sensor(function_type: MagneticSensorFunction, interval_ms: int, condition: MagneticSensorCondition) None [source]¶
Send magnetic sensor setting request command
This function DO NOT return response payload. Receive the result by notification.
- Parameters:
function_type (MagneticSensorFunction) – Function type
interval_ms (int) – Notification interval [ms]
condition (MagneticSensorCondition) – Condition
References
https://toio.github.io/toio-spec/en/docs/ble_configuration#magnetic-sensor-settings-
- async set_motor_speed_information_acquisition(state: MotorSpeedInformationAcquisitionState) None [source]¶
Send motor speed information acquisition setting request command
This function DO NOT return response payload. Receive the result by notification.
- Parameters:
state (MotorSpeedInformationAcquisitionState) – state
References
- async set_posture_angle_detection(detection_type: PostureAngleDetectionType, interval_ms: int, condition: PostureAngleDetectionCondition) None [source]¶
Send posture angle setting request command
This function DO NOT return response payload. Receive the result by notification.
- Parameters:
detection_type (PostureAngleDetectionType) – Detection type
interval_ms (int) – Notification interval [ms]
condition (PostureAngleDetectionCondition) – Condition
References
https://toio.github.io/toio-spec/en/docs/ble_configuration#posture-angle-detection-settings-