Qrtr.Bus¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/co |
Timeout in ms to wait for the initial lookup to finish, or 0 to disable it |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
The |
|
The |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent |
r |
Class Details¶
- class Qrtr.Bus(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
Qrtr.Busstructure contains private data and should only be accessed using the provided API.New in version 1.0.
- classmethod new(lookup_timeout_ms, cancellable, callback, *user_data)¶
- Parameters:
lookup_timeout_ms (
int) – the timeout, in milliseconds, to wait for the initial bus lookup to complete. A zero timeout disables the lookup.cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject,Noneto ignore.callback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the initialization is finished.user_data (
objectorNone) – the data to pass to callback function.
Asynchronously creates a
Qrtr.Busobject.This method will fail if the access to the QRTR bus is not possible, or if the initial lookup doesn’t finish on time.
When lookup_timeout_ms is 0, this method does not guarantee that the initial bus lookup has already finished, the user should wait for the required
Qrtr.Bus::node-addedandQrtr.Node::service-addedsignals before assuming the nodes are accessible.When the operation is finished, callback will be invoked. You can then call
Qrtr.Bus.new_finish() to get the result of the operation.New in version 1.0.
- classmethod new_finish(res)¶
- Parameters:
res (
Gio.AsyncResult) – aGio.AsyncResult.- Raises:
- Returns:
- Return type:
Finishes an operation started with
Qrtr.Bus.new().New in version 1.0.
- get_node(node_id)¶
- Parameters:
node_id (
int) – the QRTR bus node ID to get- Returns:
a
Qrtr.Nodethat must be freed withGObject.Object.unref(), orNoneif none available- Return type:
Get the
Qrtr.Nodewith node ID node_id.This method will fail if there is no node with the given node_id in the QRTR bus.
New in version 1.0.
- get_nodes()¶
- Returns:
a list of
Qrtr.Nodeelements. The caller should free the result by using g_list_free_full() withGObject.Object.unref() asGLib.DestroyNotify.- Return type:
Gets a list of all the
Qrtr.Nodeobjects in the bus.New in version 1.0.
- peek_node(node_id)¶
- Parameters:
node_id (
int) – the QRTR bus node ID to get- Returns:
a
Qrtr.Node, orNoneif none available. Do not free the returned object, it is owned by self.- Return type:
Get the
Qrtr.Nodewith node ID node_id, without increasing the reference count on the returned object.This method will fail if there is no node with the given node_id in the QRTR bus.
New in version 1.0.
- peek_nodes()¶
- Returns:
a list of
Qrtr.Nodeelements. The caller should not free the result, it is owned by self.- Return type:
Gets a list of all the
Qrtr.Nodeobjects in the bus, without increasing the reference count on the returned object or the list.New in version 1.0.
- wait_for_node(node_id, timeout_ms, cancellable, callback, *user_data)¶
- Parameters:
node_id (
int) – the QRTR bus node ID to lookup.timeout_ms (
int) – the timeout, in milliseconds, to wait for the node to appear in the bus.cancellable (
Gio.CancellableorNone) – aGio.Cancellable, orNone.callback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied.
Asynchronously waits for the node with ID node_id.
When the operation is finished callback will be called. You can then call
Qrtr.Bus.wait_for_node_finish() to get the result of the operation.New in version 1.0.
- wait_for_node_finish(res)¶
- Parameters:
res (
Gio.AsyncResult) – aGio.AsyncResult.- Raises:
- Returns:
- Return type:
Finishes an operation started with
Qrtr.Bus.wait_for_node().New in version 1.0.
Signal Details¶
- Qrtr.Bus.signals.node_added(bus, node)¶
- Signal Name:
node-added- Flags:
- Parameters:
The
::node-addedsignal is emitted when a new node registers a service on the QRTR bus.New in version 1.0.
- Qrtr.Bus.signals.node_removed(bus, node)¶
- Signal Name:
node-removed- Flags:
- Parameters:
The
::node-removedsignal is emitted when a node deregisters all services from the QRTR bus.New in version 1.0.
Property Details¶
- Qrtr.Bus.props.lookup_timeout¶
- Name:
lookup-timeout- Type:
- Default Value:
0- Flags:
Timeout in ms to wait for the initial lookup to finish, or 0 to disable it
New in version 1.0.