Qrtr.Bus

g GObject.GInterface GObject.GInterface Gio.AsyncInitable Gio.AsyncInitable GObject.GInterface->Gio.AsyncInitable GObject.Object GObject.Object Qrtr.Bus Qrtr.Bus GObject.Object->Qrtr.Bus Gio.AsyncInitable->Qrtr.Bus

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gio.AsyncInitable (4)

Structs:

GObject.ObjectClass (5)

class

new (lookup_timeout_ms, cancellable, callback, *user_data)

class

new_finish (res)

get_node (node_id)

get_nodes ()

peek_node (node_id)

peek_nodes ()

wait_for_node (node_id, timeout_ms, cancellable, callback, *user_data)

wait_for_node_finish (res)

Virtual Methods

Inherited:

GObject.Object (7), Gio.AsyncInitable (2)

Properties

Name

Type

Flags

Short Description

lookup-timeout

int

r/w/co

Timeout in ms to wait for the initial lookup to finish, or 0 to disable it

Signals

Inherited:

GObject.Object (1)

Name

Short Description

node-added

The ::node-added signal is emitted when a new node registers a service on the QRTR bus.

node-removed

The ::node-removed signal is emitted when a node deregisters all services from the QRTR bus.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Qrtr.Bus(**kwargs)
Bases:

GObject.Object, Gio.AsyncInitable

Abstract:

No

Structure:

Qrtr.BusClass

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:

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 and Qrtr.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) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

A newly created Qrtr.Bus, or None if error is set.

Return type:

Qrtr.Bus

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 with GObject.Object.unref(), or None if none available

Return type:

Qrtr.Node

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() with GObject.Object.unref() as GLib.DestroyNotify.

Return type:

[Qrtr.Node] or None

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, or None if none available. Do not free the returned object, it is owned by self.

Return type:

Qrtr.Node

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:

[Qrtr.Node] or None

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:

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) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

A Qrtr.Node, or None if error is set.

Return type:

Qrtr.Node

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:

RUN_LAST

Parameters:
  • bus (Qrtr.Bus) – The object which received the signal

  • node (int) – the node ID of the node that has been added

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:

RUN_LAST

Parameters:
  • bus (Qrtr.Bus) – The object which received the signal

  • node (int) – the node ID of the node that was removed

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:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Timeout in ms to wait for the initial lookup to finish, or 0 to disable it

New in version 1.0.