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.Bus
structure 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.Cancellable
orNone
) – optionalGio.Cancellable
object,None
to ignore.callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the initialization is finished.user_data (
object
orNone
) – the data to pass to callback function.
Asynchronously creates a
Qrtr.Bus
object.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-added
andQrtr.Node
::service-added
signals 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.Node
that must be freed withGObject.Object.unref
(), orNone
if none available- Return type:
Get the
Qrtr.Node
with 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.Node
elements. 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.Node
objects 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
, orNone
if none available. Do not free the returned object, it is owned by self.- Return type:
Get the
Qrtr.Node
with 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.Node
elements. The caller should not free the result, it is owned by self.- Return type:
Gets a list of all the
Qrtr.Node
objects 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.Cancellable
orNone
) – aGio.Cancellable
, orNone
.callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to 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-added
signal 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-removed
signal 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.