GnomeBluetooth.Client

g GObject.Object GObject.Object GnomeBluetooth.Client GnomeBluetooth.Client GObject.Object->GnomeBluetooth.Client

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

connect_service (path, connect, cancellable, callback, *user_data)

connect_service_finish (res)

get_devices ()

has_connected_input_devices ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

default-adapter

str

r

The D-Bus path of the default adapter

default-adapter-address

str

r

The address of the default adapter

default-adapter-name

str

r

The human readable name of the default adapter

default-adapter-powered

bool

r/w

Whether the default adapter is powered

default-adapter-setup-mode

bool

r/w

Whether the default adapter is visible to others and scanning

default-adapter-state

GnomeBluetooth.AdapterState

r

State of the default adapter

num-adapters

int

r

The number of detected Bluetooth adapters

Signals

Inherited:

GObject.Object (1)

Name

Short Description

device-added

The GnomeBluetooth.Client ::device-added signal is launched when a device gets added to the model.

device-removed

The GnomeBluetooth.Client ::device-removed signal is launched when a device gets removed from the model.

Fields

Inherited:

GObject.Object (1)

Class Details

class GnomeBluetooth.Client(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

GnomeBluetooth.ClientClass

classmethod new()
Returns:

a GnomeBluetooth.Client object.

Return type:

GnomeBluetooth.Client

Returns a reference to the GnomeBluetooth.Client singleton. Use GObject.Object.unref() when done with the object.

connect_service(path, connect, cancellable, callback, *user_data)
Parameters:

This will start the process of connecting to one of the known-connectable services on the device. This means that it could connect to all the audio services on a headset, but just to the input service on a keyboard.

Broadly speaking, this will only have an effect on devices with audio and HID services, and do nothing if the device doesn’t have the “connectable” property set.

When the connection operation is finished, callback will be called. You can then call GnomeBluetooth.Client.connect_service_finish() to get the result of the operation.

connect_service_finish(res)
Parameters:

res (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

True if the connection operation succeeded, False otherwise.

Return type:

bool

Finishes the connection operation. See GnomeBluetooth.Client.connect_service().

get_devices()
Returns:

a Gio.ListStore

Return type:

Gio.ListStore

Returns an unfiltered Gio.ListStore representing the devices attached to the default Bluetooth adapter.

has_connected_input_devices()
Returns:

True if there are connected input devices.

Return type:

bool

Returns whether there are connected devices with the input capability. This can be used by an OS user interface to warn the user before disabling Bluetooth so that the user isn’t stranded without any input devices.

Signal Details

GnomeBluetooth.Client.signals.device_added(client, device)
Signal Name:

device-added

Flags:

RUN_LAST

Parameters:

The GnomeBluetooth.Client ::device-added signal is launched when a device gets added to the model.

GnomeBluetooth.Client.signals.device_removed(client, device)
Signal Name:

device-removed

Flags:

RUN_LAST

Parameters:
  • client (GnomeBluetooth.Client) – The object which received the signal

  • device (str) – the D-Bus object path for the now-removed device

The GnomeBluetooth.Client ::device-removed signal is launched when a device gets removed from the model.

Note that GnomeBluetooth.Client ::device-removed will not be called for each individual device as the model is cleared when the GnomeBluetooth.Client :default-adapter property changes.

Property Details

GnomeBluetooth.Client.props.default_adapter
Name:

default-adapter

Type:

str

Default Value:

None

Flags:

READABLE

The D-Bus path of the default Bluetooth adapter or None.

GnomeBluetooth.Client.props.default_adapter_address
Name:

default-adapter-address

Type:

str

Default Value:

None

Flags:

READABLE

The address of the default Bluetooth adapter or None.

GnomeBluetooth.Client.props.default_adapter_name
Name:

default-adapter-name

Type:

str

Default Value:

None

Flags:

READABLE

The name of the default Bluetooth adapter or None.

GnomeBluetooth.Client.props.default_adapter_powered
Name:

default-adapter-powered

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

True if the default Bluetooth adapter is powered.

GnomeBluetooth.Client.props.default_adapter_setup_mode
Name:

default-adapter-setup-mode

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

True if the default Bluetooth adapter is in setup mode (discoverable, and discovering).

GnomeBluetooth.Client.props.default_adapter_state
Name:

default-adapter-state

Type:

GnomeBluetooth.AdapterState

Default Value:

GnomeBluetooth.AdapterState.ABSENT

Flags:

READABLE

The GnomeBluetooth.AdapterState of the default Bluetooth adapter. More precise than GnomeBluetooth.Client :default-adapter-powered.

GnomeBluetooth.Client.props.num_adapters
Name:

num-adapters

Type:

int

Default Value:

0

Flags:

READABLE

The number of detected Bluetooth adapters.