|
Packit |
34410b |
BlueZ D-Bus Device API description
|
|
Packit |
34410b |
**********************************
|
|
Packit |
34410b |
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Device hierarchy
|
|
Packit |
34410b |
================
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Service org.bluez
|
|
Packit |
34410b |
Interface org.bluez.Device1
|
|
Packit |
34410b |
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Methods void Connect()
|
|
Packit |
34410b |
|
|
Packit |
34410b |
This is a generic method to connect any profiles
|
|
Packit |
34410b |
the remote device supports that can be connected
|
|
Packit |
34410b |
to and have been flagged as auto-connectable on
|
|
Packit |
34410b |
our side. If only subset of profiles is already
|
|
Packit |
34410b |
connected it will try to connect currently disconnected
|
|
Packit |
34410b |
ones.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
If at least one profile was connected successfully this
|
|
Packit |
34410b |
method will indicate success.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
For dual-mode devices only one bearer is connected at
|
|
Packit |
34410b |
time, the conditions are in the following order:
|
|
Packit |
34410b |
|
|
Packit |
34410b |
1. Connect the disconnected bearer if already
|
|
Packit |
34410b |
connected.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
2. Connect first the bonded bearer. If no
|
|
Packit |
34410b |
bearers are bonded or both are skip and check
|
|
Packit |
34410b |
latest seen bearer.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
3. Connect last seen bearer, in case the
|
|
Packit |
34410b |
timestamps are the same BR/EDR takes
|
|
Packit |
34410b |
precedence.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Possible errors: org.bluez.Error.NotReady
|
|
Packit |
34410b |
org.bluez.Error.Failed
|
|
Packit |
34410b |
org.bluez.Error.InProgress
|
|
Packit |
34410b |
org.bluez.Error.AlreadyConnected
|
|
Packit |
34410b |
|
|
Packit |
34410b |
void Disconnect()
|
|
Packit |
34410b |
|
|
Packit |
34410b |
This method gracefully disconnects all connected
|
|
Packit |
34410b |
profiles and then terminates low-level ACL connection.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
ACL connection will be terminated even if some profiles
|
|
Packit |
34410b |
were not disconnected properly e.g. due to misbehaving
|
|
Packit |
34410b |
device.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
This method can be also used to cancel a preceding
|
|
Packit |
34410b |
Connect call before a reply to it has been received.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
For non-trusted devices connected over LE bearer calling
|
|
Packit |
34410b |
this method will disable incoming connections until
|
|
Packit |
34410b |
Connect method is called again.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Possible errors: org.bluez.Error.NotConnected
|
|
Packit |
34410b |
|
|
Packit |
34410b |
void ConnectProfile(string uuid)
|
|
Packit |
34410b |
|
|
Packit |
34410b |
This method connects a specific profile of this
|
|
Packit |
34410b |
device. The UUID provided is the remote service
|
|
Packit |
34410b |
UUID for the profile.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Possible errors: org.bluez.Error.Failed
|
|
Packit |
34410b |
org.bluez.Error.InProgress
|
|
Packit |
34410b |
org.bluez.Error.InvalidArguments
|
|
Packit |
34410b |
org.bluez.Error.NotAvailable
|
|
Packit |
34410b |
org.bluez.Error.NotReady
|
|
Packit |
34410b |
|
|
Packit |
34410b |
void DisconnectProfile(string uuid)
|
|
Packit |
34410b |
|
|
Packit |
34410b |
This method disconnects a specific profile of
|
|
Packit |
34410b |
this device. The profile needs to be registered
|
|
Packit |
34410b |
client profile.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
There is no connection tracking for a profile, so
|
|
Packit |
34410b |
as long as the profile is registered this will always
|
|
Packit |
34410b |
succeed.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Possible errors: org.bluez.Error.Failed
|
|
Packit |
34410b |
org.bluez.Error.InProgress
|
|
Packit |
34410b |
org.bluez.Error.InvalidArguments
|
|
Packit |
34410b |
org.bluez.Error.NotSupported
|
|
Packit |
34410b |
|
|
Packit |
34410b |
void Pair()
|
|
Packit |
34410b |
|
|
Packit |
34410b |
This method will connect to the remote device,
|
|
Packit |
34410b |
initiate pairing and then retrieve all SDP records
|
|
Packit |
34410b |
(or GATT primary services).
|
|
Packit |
34410b |
|
|
Packit |
34410b |
If the application has registered its own agent,
|
|
Packit |
34410b |
then that specific agent will be used. Otherwise
|
|
Packit |
34410b |
it will use the default agent.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Only for applications like a pairing wizard it
|
|
Packit |
34410b |
would make sense to have its own agent. In almost
|
|
Packit |
34410b |
all other cases the default agent will handle
|
|
Packit |
34410b |
this just fine.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
In case there is no application agent and also
|
|
Packit |
34410b |
no default agent present, this method will fail.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Possible errors: org.bluez.Error.InvalidArguments
|
|
Packit |
34410b |
org.bluez.Error.Failed
|
|
Packit |
34410b |
org.bluez.Error.AlreadyExists
|
|
Packit |
34410b |
org.bluez.Error.AuthenticationCanceled
|
|
Packit |
34410b |
org.bluez.Error.AuthenticationFailed
|
|
Packit |
34410b |
org.bluez.Error.AuthenticationRejected
|
|
Packit |
34410b |
org.bluez.Error.AuthenticationTimeout
|
|
Packit |
34410b |
org.bluez.Error.ConnectionAttemptFailed
|
|
Packit |
34410b |
|
|
Packit |
34410b |
void CancelPairing()
|
|
Packit |
34410b |
|
|
Packit |
34410b |
This method can be used to cancel a pairing
|
|
Packit |
34410b |
operation initiated by the Pair method.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Possible errors: org.bluez.Error.DoesNotExist
|
|
Packit |
34410b |
org.bluez.Error.Failed
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Properties string Address [readonly]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
The Bluetooth device address of the remote device.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
string AddressType [readonly]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
The Bluetooth device Address Type. For dual-mode and
|
|
Packit |
34410b |
BR/EDR only devices this defaults to "public". Single
|
|
Packit |
34410b |
mode LE devices may have either value. If remote device
|
|
Packit |
34410b |
uses privacy than before pairing this represents address
|
|
Packit |
34410b |
type used for connection and Identity Address after
|
|
Packit |
34410b |
pairing.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Possible values:
|
|
Packit |
34410b |
"public" - Public address
|
|
Packit |
34410b |
"random" - Random address
|
|
Packit |
34410b |
|
|
Packit |
34410b |
string Name [readonly, optional]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
The Bluetooth remote name. This value can not be
|
|
Packit |
34410b |
changed. Use the Alias property instead.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
This value is only present for completeness. It is
|
|
Packit |
34410b |
better to always use the Alias property when
|
|
Packit |
34410b |
displaying the devices name.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
If the Alias property is unset, it will reflect
|
|
Packit |
34410b |
this value which makes it more convenient.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
string Icon [readonly, optional]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Proposed icon name according to the freedesktop.org
|
|
Packit |
34410b |
icon naming specification.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
uint32 Class [readonly, optional]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
The Bluetooth class of device of the remote device.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
uint16 Appearance [readonly, optional]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
External appearance of device, as found on GAP service.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
array{string} UUIDs [readonly, optional]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
List of 128-bit UUIDs that represents the available
|
|
Packit |
34410b |
remote services.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
boolean Paired [readonly]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Indicates if the remote device is paired.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
boolean Connected [readonly]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Indicates if the remote device is currently connected.
|
|
Packit |
34410b |
A PropertiesChanged signal indicate changes to this
|
|
Packit |
34410b |
status.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
boolean Trusted [readwrite]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Indicates if the remote is seen as trusted. This
|
|
Packit |
34410b |
setting can be changed by the application.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
boolean Blocked [readwrite]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
If set to true any incoming connections from the
|
|
Packit |
34410b |
device will be immediately rejected. Any device
|
|
Packit |
34410b |
drivers will also be removed and no new ones will
|
|
Packit |
34410b |
be probed as long as the device is blocked.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
string Alias [readwrite]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
The name alias for the remote device. The alias can
|
|
Packit |
34410b |
be used to have a different friendly name for the
|
|
Packit |
34410b |
remote device.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
In case no alias is set, it will return the remote
|
|
Packit |
34410b |
device name. Setting an empty string as alias will
|
|
Packit |
34410b |
convert it back to the remote device name.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
When resetting the alias with an empty string, the
|
|
Packit |
34410b |
property will default back to the remote name.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
object Adapter [readonly]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
The object path of the adapter the device belongs to.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
boolean LegacyPairing [readonly]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Set to true if the device only supports the pre-2.1
|
|
Packit |
34410b |
pairing mechanism. This property is useful during
|
|
Packit |
34410b |
device discovery to anticipate whether legacy or
|
|
Packit |
34410b |
simple pairing will occur if pairing is initiated.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Note that this property can exhibit false-positives
|
|
Packit |
34410b |
in the case of Bluetooth 2.1 (or newer) devices that
|
|
Packit |
34410b |
have disabled Extended Inquiry Response support.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
string Modalias [readonly, optional]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Remote Device ID information in modalias format
|
|
Packit |
34410b |
used by the kernel and udev.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
int16 RSSI [readonly, optional]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Received Signal Strength Indicator of the remote
|
|
Packit |
34410b |
device (inquiry or advertising).
|
|
Packit |
34410b |
|
|
Packit |
34410b |
int16 TxPower [readonly, optional]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Advertised transmitted power level (inquiry or
|
|
Packit |
34410b |
advertising).
|
|
Packit |
34410b |
|
|
Packit |
34410b |
dict ManufacturerData [readonly, optional]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Manufacturer specific advertisement data. Keys are
|
|
Packit |
34410b |
16 bits Manufacturer ID followed by its byte array
|
|
Packit |
34410b |
value.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
dict ServiceData [readonly, optional]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Service advertisement data. Keys are the UUIDs in
|
|
Packit |
34410b |
string format followed by its byte array value.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
bool ServicesResolved [readonly]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Indicate whether or not service discovery has been
|
|
Packit |
34410b |
resolved.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
array{byte} AdvertisingFlags [readonly, experimental]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
The Advertising Data Flags of the remote device.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
dict AdvertisingData [readonly, experimental]
|
|
Packit |
34410b |
|
|
Packit |
34410b |
The Advertising Data of the remote device. Keys are
|
|
Packit |
34410b |
are 8 bits AD Type followed by data as byte array.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Note: Only types considered safe to be handled by
|
|
Packit |
34410b |
application are exposed.
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Possible values:
|
|
Packit |
34410b |
<type> <byte array>
|
|
Packit |
34410b |
...
|
|
Packit |
34410b |
|
|
Packit |
34410b |
Example:
|
|
Packit |
34410b |
<Transport Discovery> <Organization Flags...>
|
|
Packit |
34410b |
0x26 0x01 0x01...
|