SafetyIO¶
- class SafetyIOClient¶
- Canonical
kortex_api.autogen.client_stubs.SafetyIO.SafetyIOClientRpc
- __init__(router, namespace=None)¶
Constructs a SafetyIOClient with an initialized
RouterClient
and an optional namespace.- Parameters
router (RouterClient) –
RouterClient
used for the communicationnamespace (string) – Optional namespace on which to initialize the SafetyIOClient (defaults to
None
)
- IsAlive(timeoutMs: int = 1000)¶
Returns
True
if the Service Server is detected online beforetimeoutMs
is expired,False
otherwise.- Parameters
timeoutMs (unsigned int) – The maximum time to wait for an answer from the server
- Return type
bool
- SetSafetyIOConfiguration(safetyioconfiguration, deviceId=0, options=RouterClientSendOptions())¶
- The
SAFETIES
permission is necessary to call this RPC.Sets a safety io- Parameters
safetyioconfiguration (SafetyIOConfiguration) –
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message
- SetAllSafetyIOConfiguration(safetyioconfigurationlist, deviceId=0, options=RouterClientSendOptions())¶
- The
SAFETIES
permission is necessary to call this RPC.Sets all safeties io- Parameters
safetyioconfigurationlist (SafetyIOConfigurationList) –
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message
- GetSafetyIOConfiguration(safetyioinfo, deviceId=0, options=RouterClientSendOptions())¶
- The
READ_ONLY
permission is necessary to call this RPC.Retrieves a safety io- Parameters
safetyioinfo (SafetyIOInfo) –
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message
- Return type
- GetAllSafetyIOConfiguration(deviceId = 0, options = RouterClientSendOptions())¶
- The
READ_ONLY
permission is necessary to call this RPC.Retrieves all safeties io- Parameters
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message
- Return type
- GetSafetyIOStatus(deviceId = 0, options = RouterClientSendOptions())¶
- The
READ_ONLY
permission is necessary to call this RPC.Retrieves bitmask of safety functions status- Parameters
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message
- Return type
- OnNotificationSafetyIOChangeTopic(callback, notificationoptions)¶
- The
READ_ONLY
permission is necessary to call this RPC.Subscribes to safety io change topic for notifications- Parameters
callback (function) – Function callback taking a
SafetyIOChangeNotification
as only argument, and returningNone
.notificationoptions (NotificationOptions) – Notification options
- Return type
- Unsubscribe(notificationhandle, deviceId=0, options=RouterClientSendOptions())¶
- The
READ_ONLY
permission is necessary to call this RPC.Unsubscribes client from receiving notifications for the specified topic- Parameters
notificationhandle (NotificationHandle) –
deviceId (int) – Device’s Id called by rpc (optional)
options (RouterClientSendOptions) – Router options for sending the message