Qrtr.Node

g GObject.Object GObject.Object Qrtr.Node Qrtr.Node GObject.Object->Qrtr.Node

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

add_service_info (service, port, version, instance)

get_bus ()

get_id ()

get_service_info_list ()

lookup_port (service)

lookup_service (port)

peek_bus ()

peek_service_info_list ()

remove_service_info (service, port, version, instance)

wait_for_services (services, timeout_ms, cancellable, callback, *user_data)

wait_for_services_finish (result)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

bus

Qrtr.Bus

r/w/co

QRTR bus

node-id

int

r/w/co

ID of the QRTR node

Signals

Inherited:

GObject.Object (1)

Name

Short Description

node-removed

The ::node-removed signal is emitted when the node fully disappears from the QRTR bus.

service-added

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

service-removed

The ::service-removed signal is emitted when a service deregisters from the QRTR node.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Qrtr.Node(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Qrtr.NodeClass

The Qrtr.Node structure contains private data and should only be accessed using the provided API.

New in version 1.0.

add_service_info(service, port, version, instance)
Parameters:
  • service (int) –

  • port (int) –

  • version (int) –

  • instance (int) –

get_bus()
Returns:

a Qrtr.Bus that must be freed with GObject.Object.unref().

Return type:

Qrtr.Bus

Get the Qrtr.Bus where this node is available.

New in version 1.0.

get_id()
Returns:

the node id.

Return type:

int

Gets the node ID in the QRTR bus.

New in version 1.0.

get_service_info_list()
Returns:

a GLib.List of Qrtr.NodeServiceInfo elements, that must be freed with g_list_free_full() using Qrtr.NodeServiceInfo.free() as GLib.DestroyNotify.

Return type:

[Qrtr.NodeServiceInfo]

Get the list of services currently supported by the Qrtr.Node.

New in version 1.0.

lookup_port(service)
Parameters:

service (int) – a service number.

Returns:

the port number of the service in the node, or -1 if not found.

Return type:

int

If a server has announced itself for the given node and service number, return the port number of that service.

If multiple instances are registered, this method returns the port number for the service with the highest version number.

New in version 1.0.

lookup_service(port)
Parameters:

port (int) – a port number.

Returns:

the service number, or -1 if not found.

Return type:

int

If a server has announced itself for the given node and port number, return the service it serves.

New in version 1.0.

peek_bus()
Returns:

a Qrtr.Bus. Do not free the returned object, it is owned by self.

Return type:

Qrtr.Bus

Get the Qrtr.Bus where this node is available, without increasing the reference count on the returned object.

New in version 1.0.

peek_service_info_list()
Returns:

a GLib.List of Qrtr.NodeServiceInfo elements. Do not free the returned object, it is owned by self.

Return type:

[Qrtr.NodeServiceInfo]

Get the list of services currently supported by the Qrtr.Node.

New in version 1.0.

remove_service_info(service, port, version, instance)
Parameters:
  • service (int) –

  • port (int) –

  • version (int) –

  • instance (int) –

wait_for_services(services, timeout_ms, cancellable, callback, *user_data)
Parameters:

Asynchronously waits until all the services listed in services are present on the node.

The operation may fail if any of the requested services isn’t notified, or if the node is removed from the bus while waiting.

When the operation is finished callback will be called. You can then call Qrtr.Node.wait_for_services_finish() to get the result of the operation.

New in version 1.0.

wait_for_services_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True if all requested services are present on this node, or False if error is set.

Return type:

bool

Finishes an operation started with Qrtr.Node.wait_for_services().

New in version 1.0.

Signal Details

Qrtr.Node.signals.node_removed(node)
Signal Name:

node-removed

Flags:

RUN_LAST

Parameters:

node (Qrtr.Node) – The object which received the signal

The ::node-removed signal is emitted when the node fully disappears from the QRTR bus.

New in version 1.0.

Qrtr.Node.signals.service_added(node, service)
Signal Name:

service-added

Flags:

RUN_LAST

Parameters:
  • node (Qrtr.Node) – The object which received the signal

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

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

New in version 1.0.

Qrtr.Node.signals.service_removed(node, service)
Signal Name:

service-removed

Flags:

RUN_LAST

Parameters:
  • node (Qrtr.Node) – The object which received the signal

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

The ::service-removed signal is emitted when a service deregisters from the QRTR node.

New in version 1.0.

Property Details

Qrtr.Node.props.bus
Name:

bus

Type:

Qrtr.Bus

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

QRTR bus

New in version 1.0.

Qrtr.Node.props.node_id
Name:

node-id

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

ID of the QRTR node

New in version 1.0.