summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/bluez-api-4.96-fixed/adapter-api.txt285
-rw-r--r--contrib/bluez-api-4.96-fixed/agent-api.txt99
-rw-r--r--contrib/bluez-api-4.96-fixed/audio-api.txt458
-rw-r--r--contrib/bluez-api-4.96-fixed/device-api.txt199
-rw-r--r--contrib/bluez-api-4.96-fixed/input-api.txt44
-rw-r--r--contrib/bluez-api-4.96-fixed/manager-api.txt74
-rw-r--r--contrib/bluez-api-4.96-fixed/serial-api.txt41
-rw-r--r--contrib/bluez-api-5.20-fixed/adapter-api.txt155
-rw-r--r--contrib/bluez-api-5.20-fixed/agent-api.txt182
-rw-r--r--contrib/bluez-api-5.20-fixed/agent.xml37
-rw-r--r--contrib/bluez-api-5.20-fixed/alert-api.txt108
-rw-r--r--contrib/bluez-api-5.20-fixed/assigned-numbers.txt24
-rw-r--r--contrib/bluez-api-5.20-fixed/cyclingspeed-api.txt99
-rw-r--r--contrib/bluez-api-5.20-fixed/device-api.txt195
-rw-r--r--contrib/bluez-api-5.20-fixed/health-api.txt152
-rw-r--r--contrib/bluez-api-5.20-fixed/heartrate-api.txt77
-rw-r--r--contrib/bluez-api-5.20-fixed/media-api.txt646
-rw-r--r--contrib/bluez-api-5.20-fixed/mgmt-api.txt2324
-rw-r--r--contrib/bluez-api-5.20-fixed/network-api.txt (renamed from contrib/bluez-api-4.96-fixed/network-api.txt)16
-rw-r--r--contrib/bluez-api-5.20-fixed/obex-agent-api.txt61
-rw-r--r--contrib/bluez-api-5.20-fixed/obex-api.txt834
-rw-r--r--contrib/bluez-api-5.20-fixed/obex_agent.xml13
-rw-r--r--contrib/bluez-api-5.20-fixed/profile-api.txt147
-rw-r--r--contrib/bluez-api-5.20-fixed/proximity-api.txt56
-rw-r--r--contrib/bluez-api-5.20-fixed/sap-api.txt20
-rw-r--r--contrib/bluez-api-5.20-fixed/settings-storage.txt228
-rw-r--r--contrib/bluez-api-5.20-fixed/supported-features.txt52
-rw-r--r--contrib/bluez-api-5.20-fixed/test-coverage.txt69
-rw-r--r--contrib/bluez-api-5.20-fixed/thermometer-api.txt134
-rwxr-xr-xcontrib/build-mans.sh8
-rwxr-xr-xcontrib/gen-dbus-gobject.pl1144
-rwxr-xr-xcontrib/generate-bluez-gobjects.sh256
-rwxr-xr-xcontrib/generate-obexd-gobjects.sh28
-rw-r--r--contrib/man/bt-adapter.pod4
-rw-r--r--contrib/man/bt-agent.pod28
-rw-r--r--contrib/man/bt-device.pod2
-rw-r--r--contrib/man/bt-network.pod2
-rw-r--r--contrib/man/bt-obex.pod2
-rw-r--r--contrib/obexd-api-0.42-fixed/agent-api.txt30
-rw-r--r--contrib/obexd-api-0.42-fixed/agent.xml35
-rw-r--r--contrib/obexd-api-0.42-fixed/client-api.txt329
-rw-r--r--contrib/obexd-api-0.42-fixed/obexd-api.txt90
42 files changed, 6445 insertions, 2342 deletions
diff --git a/contrib/bluez-api-4.96-fixed/adapter-api.txt b/contrib/bluez-api-4.96-fixed/adapter-api.txt
deleted file mode 100644
index 55d0918..0000000
--- a/contrib/bluez-api-4.96-fixed/adapter-api.txt
+++ /dev/null
@@ -1,285 +0,0 @@
-BlueZ D-Bus Adapter API description
-***********************************
-
-Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
-Copyright (C) 2005-2006 Johan Hedberg <johan.hedberg@nokia.com>
-Copyright (C) 2005-2006 Claudio Takahasi <claudio.takahasi@indt.org.br>
-Copyright (C) 2006-2007 Luiz von Dentz <luiz.dentz@indt.org.br>
-
-
-Adapter hierarchy
-=================
-
-Service org.bluez
-Interface org.bluez.Adapter
-Object path [variable prefix]/{hci0,hci1,...}
-
-Methods dict GetProperties()
-
- Returns all properties for the adapter. See the
- properties section for available properties.
-
- Possible Errors: org.bluez.Error.NotReady
-
- void SetProperty(string name, variant value)
-
- Changes the value of the specified property. Only
- properties that are listed a read-write are changeable.
- On success this will emit a PropertyChanged signal.
-
- Possible Errors: org.bluez.Error.InvalidArguments
-
- void RequestSession() {unneeded_in_bluez_tools}
-
- This method requests a client session that provides
- operational Bluetooth. A possible mode change must be
- confirmed by the user via the agent.
-
- Clients may request multiple sessions. All sessions
- are released when adapter's mode is changed to off
- state.
-
- Possible Errors: org.bluez.Error.Rejected
-
- void ReleaseSession() {unneeded_in_bluez_tools}
-
- Release a previously requested session. It sets
- adapter to the mode in use on the moment of session
- request.
-
- SetProperty method call changes adapter's mode
- persistently, such that session release will not
- modify it.
-
- Possible Errors: org.bluez.Error.DoesNotExist
-
- void StartDiscovery()
-
- This method starts the device discovery session. This
- includes an inquiry procedure and remote device name
- resolving. Use StopDiscovery to release the sessions
- acquired.
-
- This process will start emitting DeviceFound and
- PropertyChanged "Discovering" signals.
-
- Possible errors: org.bluez.Error.NotReady
- org.bluez.Error.Failed
-
- void StopDiscovery()
-
- This method will cancel any previous StartDiscovery
- transaction.
-
- Note that a discovery procedure is shared between all
- discovery sessions thus calling StopDiscovery will only
- release a single session.
-
- Possible errors: org.bluez.Error.NotReady
- org.bluez.Error.Failed
- org.bluez.Error.NotAuthorized
-
- object FindDevice(string address)
-
- Returns the object path of device for given address.
- The device object needs to be first created via
- CreateDevice or CreatePairedDevice.
-
- Possible Errors: org.bluez.Error.DoesNotExist
- org.bluez.Error.InvalidArguments
-
- array{object} ListDevices() {deprecated}
-
- Returns list of device object paths.
- This method is deprecated, instead use the Devices
- Property to get the list of devices object paths.
-
- Possible errors: org.bluez.Error.InvalidArguments
- org.bluez.Error.Failed
- org.bluez.Error.OutOfMemory
-
- object CreateDevice(string address)
-
- Creates a new object path for a remote device. This
- method will connect to the remote device and retrieve
- all SDP records.
-
- If the object for the remote device already exists
- this method will fail.
-
- Possible errors: org.bluez.Error.InvalidArguments
- org.bluez.Error.Failed
-
- object CreatePairedDevice(string address, object agent, string capability) [async]
-
- Creates a new object path for a remote device. This
- method will connect to the remote device and retrieve
- all SDP records and then initiate the pairing.
-
- If previously CreateDevice was used successfully,
- this method will only initiate the pairing.
-
- Compared to CreateDevice this method will fail if
- the pairing already exists, but not if the object
- path already has been created. This allows applications
- to use CreateDevice first and the if needed use
- CreatePairedDevice to initiate pairing.
-
- The agent object path is assumed to reside within the
- process (D-Bus connection instance) that calls this
- method. No separate registration procedure is needed
- for it and it gets automatically released once the
- pairing operation is complete.
-
- The capability parameter is the same as for the
- RegisterAgent method.
-
- Possible errors: org.bluez.Error.InvalidArguments
- org.bluez.Error.Failed
-
- void CancelDeviceCreation(string address)
-
- Aborts either a CreateDevice call or a
- CreatePairedDevice call.
-
- Possible errors: org.bluez.Error.InvalidArguments
- org.bluez.Error.NotInProgress
-
- void RemoveDevice(object device)
-
- This removes the remote device object at the given
- path. It will remove also the pairing information.
-
- Possible errors: org.bluez.Error.InvalidArguments
- org.bluez.Error.Failed
-
- void RegisterAgent(object agent, string capability)
-
- This registers the adapter wide agent.
-
- The object path defines the path of the agent
- that will be called when user input is needed.
-
- If an application disconnects from the bus all
- of its registered agents will be removed.
-
- The capability parameter can have the values
- "DisplayOnly", "DisplayYesNo", "KeyboardOnly" and
- "NoInputNoOutput" which reflects the input and output
- capabilities of the agent. If an empty string is
- used it will fallback to "DisplayYesNo".
-
- Possible errors: org.bluez.Error.InvalidArguments
- org.bluez.Error.AlreadyExists
-
- void UnregisterAgent(object agent)
-
- This unregisters the agent that has been previously
- registered. The object path parameter must match the
- same value that has been used on registration.
-
- Possible errors: org.bluez.Error.DoesNotExist
-
-Signals PropertyChanged(string name, variant value)
-
- This signal indicates a changed value of the given
- property.
-
- DeviceFound(string address, dict values)
-
- This signal will be sent every time an inquiry result
- has been found by the service daemon. In general they
- only appear during a device discovery.
-
- The dictionary can contain basically the same values
- that are returned by the GetProperties method
- from the org.bluez.Device interface. In addition there
- can be values for the RSSI, the TX power level and
- Broadcaster role.
-
- DeviceDisappeared(string address)
-
- This signal will be sent when an inquiry session for
- a periodic discovery finishes and previously found
- devices are no longer in range or visible.
-
- DeviceCreated(object device)
-
- Parameter is object path of created device.
-
- DeviceRemoved(object device)
-
- Parameter is object path of removed device.
-
-Properties string Address [readonly]
-
- The Bluetooth device address.
-
- string Name [readwrite]
-
- The Bluetooth friendly name. This value can be
- changed and a PropertyChanged signal will be emitted.
-
- uint32 Class [readonly]
-
- The Bluetooth class of device.
-
- boolean Powered [readwrite]
-
- Switch an adapter on or off. This will also set the
- appropriate connectable state.
-
- boolean Discoverable [readwrite]
-
- Switch an adapter to discoverable or non-discoverable
- to either make it visible or hide it. This is a global
- setting and should only be used by the settings
- application.
-
- If the DiscoverableTimeout is set to a non-zero
- value then the system will set this value back to
- false after the timer expired.
-
- In case the adapter is switched off, setting this
- value will fail.
-
- When changing the Powered property the new state of
- this property will be updated via a PropertyChanged
- signal.
-
- boolean Pairable [readwrite]
-
- Switch an adapter to pairable or non-pairable. This is
- a global setting and should only be used by the
- settings application.
-
- Note that this property only affects incoming pairing
- requests.
-
- uint32 PairableTimeout [readwrite]
-
- The pairable timeout in seconds. A value of zero
- means that the timeout is disabled and it will stay in
- pareable mode forever.
-
- uint32 DiscoverableTimeout [readwrite]
-
- The discoverable timeout in seconds. A value of zero
- means that the timeout is disabled and it will stay in
- discoverable/limited mode forever.
-
- The default value for the discoverable timeout should
- be 180 seconds (3 minutes).
-
- boolean Discovering [readonly]
-
- Indicates that a device discovery procedure is active.
-
- array{object} Devices [readonly]
-
- List of device object paths.
-
- array{string} UUIDs [readonly]
-
- List of 128-bit UUIDs that represents the available
- local services.
diff --git a/contrib/bluez-api-4.96-fixed/agent-api.txt b/contrib/bluez-api-4.96-fixed/agent-api.txt
deleted file mode 100644
index 9ab2063..0000000
--- a/contrib/bluez-api-4.96-fixed/agent-api.txt
+++ /dev/null
@@ -1,99 +0,0 @@
-BlueZ D-Bus Agent API description
-**********************************
-
-Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
-Copyright (C) 2005-2006 Johan Hedberg <johan.hedberg@nokia.com>
-
-
-Agent hierarchy
-===============
-
-Service unique name
-Interface org.bluez.Agent
-Object path freely definable
-
-Methods void Release()
-
- This method gets called when the service daemon
- unregisters the agent. An agent can use it to do
- cleanup tasks. There is no need to unregister the
- agent, because when this method gets called it has
- already been unregistered.
-
- string RequestPinCode(object device)
-
- This method gets called when the service daemon
- needs to get the passkey for an authentication.
-
- The return value should be a string of 1-16 characters
- length. The string can be alphanumeric.
-
- Possible errors: org.bluez.Error.Rejected
- org.bluez.Error.Canceled
-
- uint32 RequestPasskey(object device)
-
- This method gets called when the service daemon
- needs to get the passkey for an authentication.
-
- The return value should be a numeric value
- between 0-999999.
-
- Possible errors: org.bluez.Error.Rejected
- org.bluez.Error.Canceled
-
- void DisplayPasskey(object device, uint32 passkey, uint8 entered)
-
- This method gets called when the service daemon
- needs to display a passkey for an authentication.
-
- The entered parameter indicates the number of already
- typed keys on the remote side.
-
- An empty reply should be returned. When the passkey
- needs no longer to be displayed, the Cancel method
- of the agent will be called.
-
- During the pairing process this method might be
- called multiple times to update the entered value.
-
- Note that the passkey will always be a 6-digit number,
- so the display should be zero-padded at the start if
- the value contains less than 6 digits.
-
- void RequestConfirmation(object device, uint32 passkey)
-
- This method gets called when the service daemon
- needs to confirm a passkey for an authentication.
-
- To confirm the value it should return an empty reply
- or an error in case the passkey is invalid.
-
- Note that the passkey will always be a 6-digit number,
- so the display should be zero-padded at the start if
- the value contains less than 6 digits.
-
- Possible errors: org.bluez.Error.Rejected
- org.bluez.Error.Canceled
-
- void Authorize(object device, string uuid)
-
- This method gets called when the service daemon
- needs to authorize a connection/service request.
-
- Possible errors: org.bluez.Error.Rejected
- org.bluez.Error.Canceled
-
- void ConfirmModeChange(string mode)
-
- This method gets called if a mode change is requested
- that needs to be confirmed by the user. An example
- would be leaving flight mode.
-
- Possible errors: org.bluez.Error.Rejected
- org.bluez.Error.Canceled
-
- void Cancel()
-
- This method gets called to indicate that the agent
- request failed before a reply was returned.
diff --git a/contrib/bluez-api-4.96-fixed/audio-api.txt b/contrib/bluez-api-4.96-fixed/audio-api.txt
deleted file mode 100644
index f36beb2..0000000
--- a/contrib/bluez-api-4.96-fixed/audio-api.txt
+++ /dev/null
@@ -1,458 +0,0 @@
-BlueZ D-Bus Audio API description
-*********************************
-
-Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
-Copyright (C) 2005-2007 Johan Hedberg <johan.hedberg@nokia.com>
-Copyright (C) 2005-2006 Brad Midgley <bmidgley@xmission.com>
-
-Audio hierarchy
-===============
-
-Service org.bluez
-Interface org.bluez.Audio
-Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
-
-This is a generic audio interface that abstracts the different audio profiles.
-
-Methods void Connect()
-
- Connect all supported audio profiles on the device.
-
- void Disconnect()
-
- Disconnect all audio profiles on the device
-
- dict GetProperties()
-
- Returns all properties for the interface. See the
- properties section for available properties.
-
-Signals PropertyChanged(string name, variant value)
-
- This signal indicates a changed value of the given
- property.
-
-Properties string State [readonly]
-
- Possible values: "disconnected", "connecting",
- "connected"
-
- "disconnected" -> "connecting"
- Either an incoming or outgoing connection
- attempt ongoing.
-
- "connecting" -> "disconnected"
- Connection attempt failed
-
- "connecting" -> "connected"
- Successfully connected
-
- "connected" -> "disconnected"
- Disconnected from the remote device
-
-Headset hierarchy
-=================
-
-Service org.bluez
-Interface org.bluez.Headset
-Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
-
-Methods void Connect()
-
- Connect to the HSP/HFP service on the remote device.
-
- void Disconnect()
-
- Disconnect from the HSP/HFP service on the remote
- device.
-
- boolean IsConnected() {deprecated}
-
- Returns TRUE if there is a active connection to the
- HSP/HFP connection on the remote device.
-
- void IndicateCall()
-
- Indicate an incoming call on the headset
- connected to the stream. Will continue to
- ring the headset about every 3 seconds.
-
- void CancelCall()
-
- Cancel the incoming call indication.
-
- void Play() {deprecated}
-
- Open the audio connection to the headset.
-
- void Stop()
-
- Close the audio connection.
-
- boolean IsPlaying() {deprecated}
-
- Returns true if an audio connection to the headset
- is active.
-
- uint16 GetSpeakerGain() {deprecated}
-
- Returns the current speaker gain if available,
- otherwise returns the error NotAvailable.
-
- uint16 GetMicrophoneGain() {deprecated}
-
- Returns the current microphone gain if available,
- otherwise returns the error NotAvailable.
-
- void SetSpeakerGain(uint16 gain) {deprecated}
-
- Changes the current speaker gain if possible.
-
- void SetMicrophoneGain(uint16 gain) {deprecated}
-
- Changes the current speaker gain if possible.
-
- dict GetProperties()
-
- Returns all properties for the interface. See the
- properties section for available properties.
-
- Possible Errors: org.bluez.Error.InvalidArguments
-
- void SetProperty(string name, variant value)
-
- Changes the value of the specified property. Only
- properties that are listed a read-write are changeable.
- On success this will emit a PropertyChanged signal.
-
- Possible Errors: org.bluez.Error.DoesNotExist
- org.bluez.Error.InvalidArguments
-
-Signals AnswerRequested()
-
- Sent when the answer button is pressed on the headset
-
- Connected() {deprecated}
-
- Sent when the device has been connected to.
-
- Disconnected() {deprecated}
-
- Sent when the device has been disconnected from.
-
- Stopped() {deprecated}
-
- Sent when the audio connection is closed
-
- Playing() {deprecated}
-
- Sent when the audio connection is opened
-
- SpeakerGainChanged(uint16 gain) {deprecated}
-
- The speaker gain changed.
-
- MicrophoneGainChanged(uint16 gain) {deprecated}
-
- The microphone gain changed.
-
- PropertyChanged(string name, variant value)
-
- This signal indicates a changed value of the given
- property.
-
-Properties string State [readonly]
-
- Possible values: "disconnected", "connecting",
- "connected", "playing"
-
- "disconnected" -> "connecting"
- Either an incoming or outgoing connection
- attempt ongoing.
-
- "connecting" -> "disconnected"
- Connection attempt failed
-
- "connecting" -> "connected"
- Successfully connected
-
- "connected" -> "playing"
- SCO audio connection successfully opened
-
- "playing" -> "connected"
- SCO audio connection closed
-
- "connected" -> "disconnected"
- "playing" -> "disconnected"
- Disconnected from the remote device
-
- boolean Connected [readonly]
-
- Indicates if there is a active connection to the
- HSP/HFP connection on the remote device.
-
- boolean Playing [readonly]
-
- Indicates if an audio connection to the headset
- is active.
-
- uint16 SpeakerGain [readwrite]
-
- The speaker gain when available.
-
- uint16 MicrophoneGain [readwrite]
-
- The speaker gain when available.
-
-
-AudioSink hierarchy
-===================
-
-Service org.bluez
-Interface org.bluez.AudioSink
-Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
-
-Methods void Connect()
-
- Connect and setup a stream to a A2DP sink on the
- remote device.
-
- void Disconnect()
-
- Disconnect from the remote device.
-
- boolean IsConnected() {deprecated}
-
- Returns TRUE if a stream is setup to a A2DP sink on
- the remote device.
-
- dict GetProperties()
-
- Returns all properties for the interface. See the
- properties section for available properties.
-
- Possible Errors: org.bluez.Error.InvalidArguments
-
-Signals Connected() {deprecated}
-
- Sent when a successful connection has been made to the
- remote A2DP Sink
-
- Disconnected() {deprecated}
-
- Sent when the device has been disconnected from.
-
- Playing() {deprecated}
-
- Sent when a stream with remote device is started.
-
- Stopped() {deprecated}
-
- Sent when a stream with remote device is suspended.
-
- PropertyChanged(string name, variant value)
-
- This signal indicates a changed value of the given
- property.
-
-Properties string State [readonly]
-
- Possible values: "disconnected", "connecting",
- "connected", "playing"
-
- "disconnected" -> "connecting"
- Either an incoming or outgoing connection
- attempt ongoing.
-
- "connecting" -> "disconnected"
- Connection attempt failed
-
- "connecting" -> "connected"
- Successfully connected
-
- "connected" -> "playing"
- Audio stream active
-
- "playing" -> "connected"
- Audio stream suspended
-
- "connected" -> "disconnected"
- "playing" -> "disconnected"
- Disconnected from the remote device
-
- boolean Connected [readonly]
-
- Indicates if a stream is setup to a A2DP sink on
- the remote device.
-
- boolean Playing [readonly]
-
- Indicates if a stream is active to a A2DP sink on
- the remote device.
-
-AudioSource hierarchy
-=====================
-
-Service org.bluez
-Interface org.bluez.AudioSource
-Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
-
-Methods void Connect()
-
- Connect and setup a stream to a A2DP source on the
- remote device.
-
- void Disconnect()
-
- Disconnect from the remote device.
-
- dict GetProperties()
-
- Returns all properties for the interface. See the
- properties section for available properties.
-
- Possible Errors: org.bluez.Error.InvalidArguments
-
-Signals PropertyChanged(string name, variant value)
-
- This signal indicates a changed value of the given
- property.
-
-Properties string State [readonly]
-
- Possible values: "disconnected", "connecting",
- "connected", "playing"
-
- "disconnected" -> "connecting"
- Either an incoming or outgoing connection
- attempt ongoing.
-
- "connecting" -> "disconnected"
- Connection attempt failed
-
- "connecting" -> "connected"
- Successfully connected
-
- "connected" -> "playing"
- Audio stream active
-
- "playing" -> "connected"
- Audio stream suspended
-
- "connected" -> "disconnected"
- "playing" -> "disconnected"
- Disconnected from the remote device
-
-
-HeadsetGateway hierarchy
-========================
-
-Service org.bluez
-Interface org.bluez.HeadsetGateway
-Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
-
-This interface is available for remote devices which can function in the Audio
-Gateway role of the HFP profiles.
-
-Methods void Connect()
-
- Connect to the AG service on the remote device.
-
- void Disconnect()
-
- Disconnect from the AG service on the remote device
-
- void AnswerCall()
-
- It has to called only after Ring signal received.
-
- void TerminateCall()
-
- Terminate call which is running or reject an incoming
- call. This has nothing with any 3-way situation incl.
- RaH. Just plain old PDH.
-
- void Call(string number)
-
- Dial a number 'number'. No number processing is done
- thus if AG would reject to dial it don't blame me :)
-
- string GetOperatorName()
-
- Find out the name of the currently selected network
- operator by AG.
-
- void SendDTMF(string digits)
-
- Will send each digit in the 'digits' sequentially. Would
- send nothing if there is non-dtmf digit.
-
- string GetSubscriberNumber()
-
- Get the voicecall subscriber number of AG
-
- dict GetProperties()
-
- Returns all properties for the interface. See the
- properties section for available properties.
-
-Signals Ring(string number)
-
- Someone's calling from 'number'.
- Caller number is provided as received from AG.
-
- CallTerminated()
-
- Call failed to set up. It means that we tried to call
- someone or someone tried to call us but call was not
- accepted.
-
- CallStarted()
-
- Call set up successfully.
-
- CallEnded()
-
- Call was started and now ended. In contrast with
- CallTerminated where call didn't started
-
- PropertyChanged(string name, variant value)
-
- This signal indicates a changed value of the given
- property.
-
-Properties boolean Connected [readonly]
-
- Indicates if there is an active connection to the
- AG service on the remote device.
-
- uint16 RegistrationStatus [readonly]
-
- Service availability indicatior of AG, where:
- 0 implies no service. No Home/Roam network available.
- 1 implies presence of service. Home/Roam network
- available.
-
- uint16 SignalStrength [readonly]
-
- Signal strength indicator of AG, the value ranges from
- 0 to 5.
-
- uint16 RoamingStatus [readonly]
-
- Roaming status indicator of AG, where:
- 0 means roaming is not active
- 1 means a roaming is active
-
- uint16 BatteryCharge [readonly]
-
- Battery Charge indicator of AG, the value ranges from
- 0 to 5.
-
- uint16 SpeakerGain [readonly]
-
- The speaker gain when available.
-
- uint16 MicrophoneGain [readonly]
-
- The speaker gain when available.
diff --git a/contrib/bluez-api-4.96-fixed/device-api.txt b/contrib/bluez-api-4.96-fixed/device-api.txt
deleted file mode 100644
index 484e83f..0000000
--- a/contrib/bluez-api-4.96-fixed/device-api.txt
+++ /dev/null
@@ -1,199 +0,0 @@
-BlueZ D-Bus Device API description
-**********************************
-
-Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
-Copyright (C) 2005-2006 Johan Hedberg <johan.hedberg@nokia.com>
-Copyright (C) 2005-2006 Claudio Takahasi <claudio.takahasi@indt.org.br>
-Copyright (C) 2006-2007 Luiz von Dentz <luiz.dentz@indt.org.br>
-
-
-Device hierarchy
-================
-
-Service org.bluez
-Interface org.bluez.Device
-Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
-
-Methods dict GetProperties()
-
- Returns all properties for the device. See the
- properties section for available properties.
-
- Possible Errors: org.bluez.Error.DoesNotExist
- org.bluez.Error.InvalidArguments
-
- void SetProperty(string name, variant value)
-
- Changes the value of the specified property. Only
- properties that are listed a read-write are changeable.
- On success this will emit a PropertyChanged signal.
-
- Possible Errors: org.bluez.Error.DoesNotExist
- org.bluez.Error.InvalidArguments
-
- dict{u,s} DiscoverServices(string pattern)
-
- This method starts the service discovery to retrieve
- remote service records. The pattern parameter can
- be used to specify specific UUIDs. And empty string
- will look for the public browse group.
-
- The return value is a dictionary with the record
- handles as keys and the service record in XML format
- as values. The key is uint32 and the value a string
- for this dictionary.
-
- Possible errors: org.bluez.Error.NotReady
- org.bluez.Error.Failed
- org.bluez.Error.InProgress
-
- void CancelDiscovery()
-
- This method will cancel any previous DiscoverServices
- transaction.
-
- Possible errors: org.bluez.Error.NotReady
- org.bluez.Error.Failed
- org.bluez.Error.NotAuthorized
-
- void Disconnect()
-
- This method disconnects a specific remote device by
- terminating the low-level ACL connection. The use of
- this method should be restricted to administrator
- use.
-
- A DisconnectRequested signal will be sent and the
- actual disconnection will only happen 2 seconds later.
- This enables upper-level applications to terminate
- their connections gracefully before the ACL connection
- is terminated.
-
- Possible errors: org.bluez.Error.NotConnected
-
- array{object} ListNodes() {unimplemented}
-
- Returns list of device node object paths.
-
- Possible errors: org.bluez.Error.InvalidArguments
- org.bluez.Error.Failed
- org.bluez.Error.OutOfMemory
-
- object CreateNode(string uuid) {unimplemented}
-
- Creates a persistent device node binding with a
- remote device. The actual support for the specified
- UUID depends if the device driver has support for
- persistent binding. At the moment only RFCOMM TTY
- nodes are supported.
-
- Possible errors: org.bluez.Error.InvalidArguments
- org.bluez.Error.NotSupported
-
- void RemoveNode(object node) {unimplemented}
-
- Removes a persistent device node binding.
-
- Possible errors: org.bluez.Error.InvalidArguments
- org.bluez.Error.DoesNotExist
-
-Signals PropertyChanged(string name, variant value)
-
- This signal indicates a changed value of the given
- property.
-
- DisconnectRequested()
-
- This signal will be sent when a low level
- disconnection to a remote device has been requested.
- The actual disconnection will happen 2 seconds later.
-
- NodeCreated(object node) {unimplemented}
-
- Parameter is object path of created device node.
-
- NodeRemoved(object node) {unimplemented}
-
- Parameter is object path of removed device node.
-
-Properties string Address [readonly]
-
- The Bluetooth device address of the remote device.
-
- string Name [readonly]
-
- The Bluetooth remote name. This value can not be
- changed. Use the Alias property instead.
-
- string Icon [readonly]
-
- Proposed icon name according to the freedesktop.org
- icon naming specification.
-
- uint32 Class [readonly]
-
- The Bluetooth class of device of the remote device.
-
- array{string} UUIDs [readonly]
-
- List of 128-bit UUIDs that represents the available
- remote services.
-
- array{object} Services [readonly]
-
- List of characteristics based services.
-
- boolean Paired [readonly]
-
- Indicates if the remote device is paired.
-
- boolean Connected [readonly]
-
- Indicates if the remote device is currently connected.
- A PropertyChanged signal indicate changes to this
- status.
-
- boolean Trusted [readwrite]
-
- Indicates if the remote is seen as trusted. This
- setting can be changed by the application.
-
- boolean Blocked [readwrite]
-
- If set to true any incoming connections from the
- device will be immediately rejected. Any device
- drivers will also be removed and no new ones will
- be probed as long as the device is blocked.
-
- string Alias [readwrite]
-
- The name alias for the remote device. The alias can
- be used to have a different friendly name for the
- remote device.
-
- In case no alias is set, it will return the remote
- device name. Setting an empty string as alias will
- convert it back to the remote device name.
-
- When reseting the alias with an empty string, the
- emitted PropertyChanged signal will show the remote
- name again.
-
- array{object} Nodes [readonly] {unimplemented}
-
- List of device node object paths.
-
- object Adapter [readonly]
-
- The object path of the adapter the device belongs to.
-
- boolean LegacyPairing [readonly]
-
- Set to true if the device only supports the pre-2.1
- pairing mechanism. This property is useful in the
- Adapter.DeviceFound signal to anticipate whether
- legacy or simple pairing will occur.
-
- Note that this property can exhibit false-positives
- in the case of Bluetooth 2.1 (or newer) devices that
- have disabled Extended Inquiry Response support.
diff --git a/contrib/bluez-api-4.96-fixed/input-api.txt b/contrib/bluez-api-4.96-fixed/input-api.txt
deleted file mode 100644
index 7c3a4b2..0000000
--- a/contrib/bluez-api-4.96-fixed/input-api.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-BlueZ D-Bus Input API description
-*********************************
-
-Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
-
-
-Input hierarchy
-===============
-
-Service org.bluez
-Interface org.bluez.Input
-Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
-
-Methods void Connect()
-
- Connect to the input device.
-
- Possible errors: org.bluez.Error.AlreadyConnected
- org.bluez.Error.ConnectionAttemptFailed
-
- void Disconnect()
-
- Disconnect from the input device.
-
- To abort a connection attempt in case of errors or
- timeouts in the client it is fine to call this method.
-
- Possible errors: org.bluez.Error.Failed
-
- dict GetProperties()
-
- Returns all properties for the interface. See the
- properties section for available properties.
-
- Possible Errors: org.bluez.Error.InvalidArguments
-
-Signals PropertyChanged(string name, variant value)
-
- This signal indicates a changed value of the given
- property.
-
-Properties boolean Connected [readonly]
-
- Indicates if the device is connected.
diff --git a/contrib/bluez-api-4.96-fixed/manager-api.txt b/contrib/bluez-api-4.96-fixed/manager-api.txt
deleted file mode 100644
index d2c1caf..0000000
--- a/contrib/bluez-api-4.96-fixed/manager-api.txt
+++ /dev/null
@@ -1,74 +0,0 @@
-BlueZ D-Bus Manager API description
-***********************************
-
-Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
-Copyright (C) 2005-2006 Johan Hedberg <johan.hedberg@nokia.com>
-Copyright (C) 2005-2006 Claudio Takahasi <claudio.takahasi@indt.org.br>
-Copyright (C) 2006-2007 Luiz von Dentz <luiz.dentz@indt.org.br>
-
-
-Manager hierarchy
-=================
-
-Service org.bluez
-Interface org.bluez.Manager
-Object path /
-
-Methods dict GetProperties()
-
- Returns all global properties. See the
- properties section for available properties.
-
- Possible Errors: org.bluez.Error.DoesNotExist
- org.bluez.Error.InvalidArguments
-
- object DefaultAdapter()
-
- Returns object path for the default adapter.
-
- Possible errors: org.bluez.Error.InvalidArguments
- org.bluez.Error.NoSuchAdapter
-
- object FindAdapter(string pattern)
-
- Returns object path for the specified adapter. Valid
- patterns are "hci0" or "00:11:22:33:44:55".
-
- Possible errors: org.bluez.Error.InvalidArguments
- org.bluez.Error.NoSuchAdapter
-
- array{object} ListAdapters() {deprecated}
-
- Returns list of adapter object paths under /org/bluez.
- This method is deprecated, instead use the Adapters
- Property to get the list of adapter object paths.
-
- Possible errors: org.bluez.Error.InvalidArguments
- org.bluez.Error.Failed
- org.bluez.Error.OutOfMemory
-
-Signals PropertyChanged(string name, variant value)
-
- This signal indicates a changed value of the given
- property.
-
- AdapterAdded(object adapter)
-
- Parameter is object path of added adapter.
-
- AdapterRemoved(object adapter)
-
- Parameter is object path of removed adapter.
-
- DefaultAdapterChanged(object adapter)
-
- Parameter is object path of the new default adapter.
-
- In case all adapters are removed this signal will not
- be emitted. The AdapterRemoved signal has to be used
- to detect that no default adapter is selected or
- available anymore.
-
-Properties array{object} Adapters [readonly]
-
- List of adapter object paths.
diff --git a/contrib/bluez-api-4.96-fixed/serial-api.txt b/contrib/bluez-api-4.96-fixed/serial-api.txt
deleted file mode 100644
index 5f9bd5f..0000000
--- a/contrib/bluez-api-4.96-fixed/serial-api.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-BlueZ D-Bus Serial API description
-**********************************
-
-Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
-
-
-Serial hierarchy
-================
-
-Service org.bluez
-Interface org.bluez.Serial
-Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
-
-Methods string Connect(string pattern)
-
- Connects to a specific RFCOMM based service on a
- remote device and then creates a RFCOMM TTY
- device for it. The RFCOMM TTY device is returned.
-
- Possible patterns: UUID 128 bit as string
- Profile short names, e.g: spp, dun
- RFCOMM channel as string, 1-30
-
- Possible errors: org.bluez.Error.InvalidArguments
- org.bluez.Error.InProgress
- org.bluez.Error.ConnectionAttemptFailed
- org.bluez.Error.NotSupported
-
- void Disconnect(string device)
-
- Disconnect a RFCOMM TTY device that has been
- created by Connect method.
-
- To abort a connection attempt in case of errors or
- timeouts in the client it is fine to call this method.
-
- In that case one of patterns of the Connect method should
- be suplied instead of the TTY device.
-
- Possible errors: org.bluez.Error.InvalidArguments
- org.bluez.Error.DoesNotExist
diff --git a/contrib/bluez-api-5.20-fixed/adapter-api.txt b/contrib/bluez-api-5.20-fixed/adapter-api.txt
new file mode 100644
index 0000000..74d235a
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/adapter-api.txt
@@ -0,0 +1,155 @@
+BlueZ D-Bus Adapter API description
+***********************************
+
+
+Adapter hierarchy
+=================
+
+Service org.bluez
+Interface org.bluez.Adapter1
+Object path [variable prefix]/{hci0,hci1,...}
+
+Methods void StartDiscovery()
+
+ This method starts the device discovery session. This
+ includes an inquiry procedure and remote device name
+ resolving. Use StopDiscovery to release the sessions
+ acquired.
+
+ This process will start creating Device objects as
+ new devices are discovered.
+
+ Possible errors: org.bluez.Error.NotReady
+ org.bluez.Error.Failed
+
+ void StopDiscovery()
+
+ This method will cancel any previous StartDiscovery
+ transaction.
+
+ Note that a discovery procedure is shared between all
+ discovery sessions thus calling StopDiscovery will only
+ release a single session.
+
+ Possible errors: org.bluez.Error.NotReady
+ org.bluez.Error.Failed
+ org.bluez.Error.NotAuthorized
+
+ void RemoveDevice(object device)
+
+ This removes the remote device object at the given
+ path. It will remove also the pairing information.
+
+ Possible errors: org.bluez.Error.InvalidArguments
+ org.bluez.Error.Failed
+
+Properties string Address [readonly]
+
+ The Bluetooth device address.
+
+ string Name [readonly]
+
+ The Bluetooth system name (pretty hostname).
+
+ This property is either a static system default
+ or controlled by an external daemon providing
+ access to the pretty hostname configuration.
+
+ string Alias [readwrite]
+
+ The Bluetooth friendly name. This value can be
+ changed.
+
+ In case no alias is set, it will return the system
+ provided name. Setting an empty string as alias will
+ convert it back to the system provided name.
+
+ When resetting the alias with an empty string, the
+ property will default back to system name.
+
+ On a well configured system, this property never
+ needs to be changed since it defaults to the system
+ name and provides the pretty hostname. Only if the
+ local name needs to be different from the pretty
+ hostname, this property should be used as last
+ resort.
+
+ uint32 Class [readonly]
+
+ The Bluetooth class of device.
+
+ This property represents the value that is either
+ automatically configured by DMI/ACPI information
+ or provided as static configuration.
+
+ boolean Powered [readwrite]
+
+ Switch an adapter on or off. This will also set the
+ appropriate connectable state of the controller.
+
+ The value of this property is not persistent. After
+ restart or unplugging of the adapter it will reset
+ back to false.
+
+ boolean Discoverable [readwrite]
+
+ Switch an adapter to discoverable or non-discoverable
+ to either make it visible or hide it. This is a global
+ setting and should only be used by the settings
+ application.
+
+ If the DiscoverableTimeout is set to a non-zero
+ value then the system will set this value back to
+ false after the timer expired.
+
+ In case the adapter is switched off, setting this
+ value will fail.
+
+ When changing the Powered property the new state of
+ this property will be updated via a PropertyChanged
+ signal.
+
+ For any new adapter this settings defaults to false.
+
+ boolean Pairable [readwrite]
+
+ Switch an adapter to pairable or non-pairable. This is
+ a global setting and should only be used by the
+ settings application.
+
+ Note that this property only affects incoming pairing
+ requests.
+
+ For any new adapter this settings defaults to true.
+
+ uint32 PairableTimeout [readwrite]
+
+ The pairable timeout in seconds. A value of zero
+ means that the timeout is disabled and it will stay in
+ pairable mode forever.
+
+ The default value for pairable timeout should be
+ disabled (value 0).
+
+ uint32 DiscoverableTimeout [readwrite]
+
+ The discoverable timeout in seconds. A value of zero
+ means that the timeout is disabled and it will stay in
+ discoverable/limited mode forever.
+
+ The default value for the discoverable timeout should
+ be 180 seconds (3 minutes).
+
+ boolean Discovering [readonly]
+
+ Indicates that a device discovery procedure is active.
+
+ array{string} UUIDs [readonly]
+
+ List of 128-bit UUIDs that represents the available
+ local services.
+
+ string Modalias [readonly, optional]
+
+ Local Device ID information in modalias format
+ used by the kernel and udev.
diff --git a/contrib/bluez-api-5.20-fixed/agent-api.txt b/contrib/bluez-api-5.20-fixed/agent-api.txt
new file mode 100644
index 0000000..c6a024c
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/agent-api.txt
@@ -0,0 +1,182 @@
+BlueZ D-Bus Agent API description
+**********************************
+
+
+Agent Manager hierarchy
+=======================
+
+Service org.bluez
+Interface org.bluez.AgentManager1
+Object path /org/bluez
+
+Methods void RegisterAgent(object agent, string capability)
+
+ This registers an agent handler.
+
+ The object path defines the path of the agent
+ that will be called when user input is needed.
+
+ Every application can register its own agent and
+ for all actions triggered by that application its
+ agent is used.
+
+ It is not required by an application to register
+ an agent. If an application does chooses to not
+ register an agent, the default agent is used. This
+ is on most cases a good idea. Only application
+ like a pairing wizard should register their own
+ agent.
+
+ An application can only register one agent. Multiple
+ agents per application is not supported.
+
+ The capability parameter can have the values
+ "DisplayOnly", "DisplayYesNo", "KeyboardOnly",
+ "NoInputNoOutput" and "KeyboardDisplay" which
+ reflects the input and output capabilities of the
+ agent.
+
+ If an empty string is used it will fallback to
+ "DisplayYesNo".
+
+ Possible errors: org.bluez.Error.InvalidArguments
+ org.bluez.Error.AlreadyExists
+
+ void UnregisterAgent(object agent)
+
+ This unregisters the agent that has been previously
+ registered. The object path parameter must match the
+ same value that has been used on registration.
+
+ Possible errors: org.bluez.Error.DoesNotExist
+
+ void RequestDefaultAgent(object agent)
+
+ This requests is to make the application agent
+ the default agent. The application is required
+ to register an agent.
+
+ Special permission might be required to become
+ the default agent.
+
+ Possible errors: org.bluez.Error.DoesNotExist
+
+
+Agent hierarchy
+===============
+
+Service unique name
+Interface org.bluez.Agent1
+Object path freely definable
+
+Methods void Release()
+
+ This method gets called when the service daemon
+ unregisters the agent. An agent can use it to do
+ cleanup tasks. There is no need to unregister the
+ agent, because when this method gets called it has
+ already been unregistered.
+
+ string RequestPinCode(object device)
+
+ This method gets called when the service daemon
+ needs to get the passkey for an authentication.
+
+ The return value should be a string of 1-16 characters
+ length. The string can be alphanumeric.
+
+ Possible errors: org.bluez.Error.Rejected
+ org.bluez.Error.Canceled
+
+ void DisplayPinCode(object device, string pincode)
+
+ This method gets called when the service daemon
+ needs to display a pincode for an authentication.
+
+ An empty reply should be returned. When the pincode
+ needs no longer to be displayed, the Cancel method
+ of the agent will be called.
+
+ This is used during the pairing process of keyboards
+ that don't support Bluetooth 2.1 Secure Simple Pairing,
+ in contrast to DisplayPasskey which is used for those
+ that do.
+
+ This method will only ever be called once since
+ older keyboards do not support typing notification.
+
+ Note that the PIN will always be a 6-digit number,
+ zero-padded to 6 digits. This is for harmony with
+ the later specification.
+
+ Possible errors: org.bluez.Error.Rejected
+ org.bluez.Error.Canceled
+
+ uint32 RequestPasskey(object device)
+
+ This method gets called when the service daemon
+ needs to get the passkey for an authentication.
+
+ The return value should be a numeric value
+ between 0-999999.
+
+ Possible errors: org.bluez.Error.Rejected
+ org.bluez.Error.Canceled
+
+ void DisplayPasskey(object device, uint32 passkey,
+ uint16 entered)
+
+ This method gets called when the service daemon
+ needs to display a passkey for an authentication.
+
+ The entered parameter indicates the number of already
+ typed keys on the remote side.
+
+ An empty reply should be returned. When the passkey
+ needs no longer to be displayed, the Cancel method
+ of the agent will be called.
+
+ During the pairing process this method might be
+ called multiple times to update the entered value.
+
+ Note that the passkey will always be a 6-digit number,
+ so the display should be zero-padded at the start if
+ the value contains less than 6 digits.
+
+ void RequestConfirmation(object device, uint32 passkey)
+
+ This method gets called when the service daemon
+ needs to confirm a passkey for an authentication.
+
+ To confirm the value it should return an empty reply
+ or an error in case the passkey is invalid.
+
+ Note that the passkey will always be a 6-digit number,
+ so the display should be zero-padded at the start if
+ the value contains less than 6 digits.
+
+ Possible errors: org.bluez.Error.Rejected
+ org.bluez.Error.Canceled
+
+ void RequestAuthorization(object device)
+
+ This method gets called to request the user to
+ authorize an incoming pairing attempt which
+ would in other circumstances trigger the just-works
+ model.
+
+ Possible errors: org.bluez.Error.Rejected
+ org.bluez.Error.Canceled
+
+ void AuthorizeService(object device, string uuid)
+
+ This method gets called when the service daemon
+ needs to authorize a connection/service request.
+
+ Possible errors: org.bluez.Error.Rejected
+ org.bluez.Error.Canceled
+
+ void Cancel()
+
+ This method gets called to indicate that the agent
+ request failed before a reply was returned.
diff --git a/contrib/bluez-api-5.20-fixed/agent.xml b/contrib/bluez-api-5.20-fixed/agent.xml
new file mode 100644
index 0000000..c5f92e1
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/agent.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<node name="/org/blueztools">
+ <interface name="org.bluez.Agent1">
+ <method name="Release">
+ </method>
+ <method name="RequestPinCode">
+ <arg name="device" direction="in" type="o"/>
+ <arg name="pincode" direction="out" type="s"/>
+ </method>
+ <method name="DisplayPinCode">
+ <arg name="device" direction="in" type="o"/>
+ <arg name="pincode" direction="in" type="s"/>
+ </method>
+ <method name="RequestPasskey">
+ <arg name="device" direction="in" type="o"/>
+ <arg name="passkey" direction="out" type="u"/>
+ </method>
+ <method name="DisplayPasskey">
+ <arg name="device" direction="in" type="o"/>
+ <arg name="passkey" direction="in" type="u"/>
+ <arg name="entered" direction="in" type="q"/>
+ </method>
+ <method name="RequestConfirmation">
+ <arg name="device" direction="in" type="o"/>
+ <arg name="passkey" direction="in" type="u"/>
+ </method>
+ <method name="RequestAuthorization">
+ <arg name="device" direction="in" type="o"/>
+ </method>
+ <method name="AuthorizeService">
+ <arg name="device" direction="in" type="o"/>
+ <arg name="uuid" direction="in" type="s"/>
+ </method>
+ <method name="Cancel">
+ </method>
+ </interface>
+</node>
diff --git a/contrib/bluez-api-5.20-fixed/alert-api.txt b/contrib/bluez-api-5.20-fixed/alert-api.txt
new file mode 100644
index 0000000..fc427c8
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/alert-api.txt
@@ -0,0 +1,108 @@
+BlueZ D-Bus Alert API description
+*********************************
+
+
+Introduction
+------------
+
+Currently, there are two different GATT server profiles that depend on
+receiving alerts or notifications from the platform: Phone Alert Status (PASP)
+and Alert Notification (ANP). PASP is very specific to mobile phones, and also
+allows limited control to alerts (i.e. mute once or switch to a silent mode).
+
+This document presents a unified API that allows to register and notify alerts,
+and to control some alerts (using the provided agent object).
+
+
+Alert hierarchy
+===============
+
+Service org.bluez
+Interface org.bluez.Alert1
+Object path /org/bluez
+
+Methods void RegisterAlert(string category, object agent)
+
+ Register a new alert category and an agent for it. This
+ means the application will be responsible for notifying
+ BlueZ of any alerts of that category, using the
+ NewAlert() method.
+
+ Supported ANP categories: simple, email, news, call,
+ missed-call, sms-mms, voice-mail, schedule,
+ high-priority, instant-message
+ Supported PASP categories: ringer, vibrate, display
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+
+ void NewAlert(string category, uint16 count, string description)
+
+ Notify BlueZ of new alert(s) for the given category. The
+ description is relative to the last received alert and
+ can be sender name, caller ID, title, or other
+ information specific to the category.
+
+ For ringer, vibrate and display categories, valid
+ descriptions are "active" and "not active". Alerts from
+ ringer category also accept "enabled" and "disabled",
+ depending on whether ringer is in silent mode or not.
+
+ Description must not exceed 18 bytes when encoded in
+ UTF-8 format, otherwise an error is returned. If there
+ is no description, an empty string should be used.
+
+ The count argument contains the number of alerts not
+ yet acknowledged by the user on the UI. To save D-Bus
+ traffic, events that may generate multiple alerts at
+ the same time (like email, sms, news) should trigger a
+ single NewAlert().
+
+ If there are more than 254 new alerts, count must be
+ set to 255. PASP alerts should always set count to 1.
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+
+ void UnreadAlert(string category, uint16 count)
+
+ Some services (like SMS and e-mail) keep track of
+ number of unread items. This method allows to update
+ this counter, so peer devices can be notified using
+ Alert Notification Profile.
+
+ If there are more than 254 unread alerts, count must be
+ set to 255.
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+
+Alert Agent hierarchy
+=====================
+
+Service org.bluez
+Interface org.bluez.AlertAgent1
+Object path freely definable
+
+Methods void MuteOnce()
+
+ This method is only called if "ringer" alert category
+ is specified when registering the agent.
+
+ Mute the ringer once (e.g. during a incoming call). If
+ ringer is not active, does nothing.
+
+ void SetRinger(string mode)
+
+ This method is only called if "ringer" alert category
+ is specified when registering the agent.
+
+ Set ringer to the specified mode. If mode is "enabled",
+ ringer is set to the default mode, as defined by the
+ current active profile. If mode is "disabled", ringer
+ will not activate on incoming calls, until it is set
+ back to "enabled" mode.
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+
+ void Release()
+
+ Release this agent. At this point, it will not be used
+ by BlueZ anymore and can be destroyed by the owner.
diff --git a/contrib/bluez-api-5.20-fixed/assigned-numbers.txt b/contrib/bluez-api-5.20-fixed/assigned-numbers.txt
new file mode 100644
index 0000000..ca171c4
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/assigned-numbers.txt
@@ -0,0 +1,24 @@
+RFCOMM Channels
+===============
+
+Since there are a limited amount of possible RFCOMM channels (1-31)
+they've been pre-allocated for currently known profiles in order to
+avoid conflicts.
+
+Profile Channel
+-----------------------
+DUN 1
+HFP HF 7
+OPP 9
+FTP 10
+BIP 11
+HSP AG 12
+HFP AG 13
+SYNCH (IrMC) 14
+PBAP 15
+MAP MAS 16
+MAP MNS 17
+SyncEvolution 19
+PC/Ovi Suite 24
+SyncML Client 25
+SyncML Server 26
diff --git a/contrib/bluez-api-5.20-fixed/cyclingspeed-api.txt b/contrib/bluez-api-5.20-fixed/cyclingspeed-api.txt
new file mode 100644
index 0000000..a1f1a93
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/cyclingspeed-api.txt
@@ -0,0 +1,99 @@
+Cycling Speed and Cadence API description
+*****************************************
+
+
+Cycling Speed and Cadence Manager hierarchy
+===========================================
+
+Service org.bluez
+Interface org.bluez.CyclingSpeedManager1
+Object path [variable prefix]/{hci0,hci1,...}
+
+Methods RegisterWatcher(object agent)
+
+ Registers a watcher to monitor cycling speed and
+ cadence measurements.
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+
+ UnregisterWatcher(object agent)
+
+ Unregisters a watcher.
+
+Cycling Speed and Cadence Profile hierarchy
+===========================================
+
+Service org.bluez
+Interface org.bluez.CyclingSpeed1
+Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
+
+Methods SetCumulativeWheelRevolutions(uint32 value)
+
+ Sets cumulative wheel revolutions value if
+ Cumulative Wheel Revolutions feature is supported.
+
+ Possible Errors: org.bluez.Error.NotSupported
+
+Properties string Location (optional) [readwrite]
+
+ Current sensor location, if supported.
+ If Multiple Sensor Locations feature is supported,
+ this property can be set to one of values read from
+ SupportedLocations property.
+
+ Possible values: "other", "top-of-shoe", "in-shoe",
+ "hip", "front-wheel", "left-crank",
+ "right-crank", "left-pedal",
+ "right-pedal", "front-hub",
+ "rear-dropout", "chainstay",
+ "rear-wheel", "rear-hub"
+
+ array{string} SupportedLocations (optional) [readonly]
+
+ List of locations supported by sensor, only present
+ if Multiple Sensor Locations feature is supported.
+
+ boolean WheelRevolutionDataSupported [readonly]
+
+ true if sensor can read and set Cumulative Wheel
+ Revolutions value, false otherwise.
+
+ boolean MultipleLocationsSupported [readonly]
+
+ true if sensor supports Multiple Sensor Locations
+ feature and can set Location, false otherwise.
+
+Cycling Speed and Cadence Watcher hierarchy
+===========================================
+
+Service unique name
+Interface org.bluez.CyclingSpeedWatcher1
+Object path freely definable
+
+Methods void MeasurementReceived(object device, dict measurement)
+
+ This callback is called whenever wheel and/or crank
+ revolutions measurement is received from sensor.
+
+ Measurement:
+
+ uint32 WheelRevolutions (optional):
+
+ Cumulative number of wheel revolutions.
+
+ uint16 LastWheelEventTime (optional):
+
+ Time of last event from wheel sensor.
+ Value is expressed in 1/1024 second
+ units and can roll over during a ride.
+
+ uint16 CrankRevolutions (optional):
+
+ Cumulative number of crank revolutions.
+ This value can occasionally roll over.
+
+ uint16 LastCrankEventTime (optional):
+
+ Time of last event from crank sensor.
+ Value is expressed in 1/1024 second
+ units and can roll over during a ride.
diff --git a/contrib/bluez-api-5.20-fixed/device-api.txt b/contrib/bluez-api-5.20-fixed/device-api.txt
new file mode 100644
index 0000000..577ee60
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/device-api.txt
@@ -0,0 +1,195 @@
+BlueZ D-Bus Device API description
+**********************************
+
+
+Device hierarchy
+================
+
+Service org.bluez
+Interface org.bluez.Device1
+Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
+
+Methods void Connect()
+
+ This is a generic method to connect any profiles
+ the remote device supports that can be connected
+ to and have been flagged as auto-connectable on
+ our side. If only subset of profiles is already
+ connected it will try to connect currently disconnected
+ ones.
+
+ If at least one profile was connected successfully this
+ method will indicate success.
+
+ Possible errors: org.bluez.Error.NotReady
+ org.bluez.Error.Failed
+ org.bluez.Error.InProgress
+ org.bluez.Error.AlreadyConnected
+
+ void Disconnect()
+
+ This method gracefully disconnects all connected
+ profiles and then terminates low-level ACL connection.
+
+ ACL connection will be terminated even if some profiles
+ were not disconnected properly e.g. due to misbehaving
+ device.
+
+ This method can be also used to cancel a preceding
+ Connect call before a reply to it has been received.
+
+ Possible errors: org.bluez.Error.NotConnected
+
+ void ConnectProfile(string uuid)
+
+ This method connects a specific profile of this
+ device. The UUID provided is the remote service
+ UUID for the profile.
+
+ Possible errors: org.bluez.Error.DoesNotExist
+ org.bluez.Error.AlreadyConnected
+ org.bluez.Error.ConnectFailed
+
+ void DisconnectProfile(string uuid)
+
+ This method disconnects a specific profile of
+ this device. The profile needs to be registered
+ client profile.
+
+ There is no connection tracking for a profile, so
+ as long as the profile is registered this will always
+ succeed.
+
+ Possible errors: org.bluez.Error.DoesNotExist
+ org.bluez.Error.Failed
+ org.bluez.Error.NotConnected
+ org.bluez.Error.NotSupported
+
+ void Pair()
+
+ This method will connect to the remote device,
+ initiate pairing and then retrieve all SDP records
+ (or GATT primary services).
+
+ If the application has registered its own agent,
+ then that specific agent will be used. Otherwise
+ it will use the default agent.
+
+ Only for applications like a pairing wizard it
+ would make sense to have its own agent. In almost
+ all other cases the default agent will handle
+ this just fine.
+
+ In case there is no application agent and also
+ no default agent present, this method will fail.
+
+ Possible errors: org.bluez.Error.InvalidArguments
+ org.bluez.Error.Failed
+ org.bluez.Error.AlreadyExists
+ org.bluez.Error.AuthenticationCanceled
+ org.bluez.Error.AuthenticationFailed
+ org.bluez.Error.AuthenticationRejected
+ org.bluez.Error.AuthenticationTimeout
+ org.bluez.Error.ConnectionAttemptFailed
+
+ void CancelPairing()
+
+ This method can be used to cancel a pairing
+ operation initiated by the Pair method.
+
+ Possible errors: org.bluez.Error.DoesNotExist
+ org.bluez.Error.Failed
+
+Properties string Address [readonly]
+
+ The Bluetooth device address of the remote device.
+
+ string Name [readonly, optional]
+
+ The Bluetooth remote name. This value can not be
+ changed. Use the Alias property instead.
+
+ This value is only present for completeness. It is
+ better to always use the Alias property when
+ displaying the devices name.
+
+ If the Alias property is unset, it will reflect
+ this value which makes it more convenient.
+
+ string Icon [readonly, optional]
+
+ Proposed icon name according to the freedesktop.org
+ icon naming specification.
+
+ uint32 Class [readonly, optional]
+
+ The Bluetooth class of device of the remote device.
+
+ uint16 Appearance [readonly, optional]
+
+ External appearance of device, as found on GAP service.
+
+ array{string} UUIDs [readonly, optional]
+
+ List of 128-bit UUIDs that represents the available
+ remote services.
+
+ boolean Paired [readonly]
+
+ Indicates if the remote device is paired.
+
+ boolean Connected [readonly]
+
+ Indicates if the remote device is currently connected.
+ A PropertiesChanged signal indicate changes to this
+ status.
+
+ boolean Trusted [readwrite]
+
+ Indicates if the remote is seen as trusted. This
+ setting can be changed by the application.
+
+ boolean Blocked [readwrite]
+
+ If set to true any incoming connections from the
+ device will be immediately rejected. Any device
+ drivers will also be removed and no new ones will
+ be probed as long as the device is blocked.
+
+ string Alias [readwrite]
+
+ The name alias for the remote device. The alias can
+ be used to have a different friendly name for the
+ remote device.
+
+ In case no alias is set, it will return the remote
+ device name. Setting an empty string as alias will
+ convert it back to the remote device name.
+
+ When resetting the alias with an empty string, the
+ property will default back to the remote name.
+
+ object Adapter [readonly]
+
+ The object path of the adapter the device belongs to.
+
+ boolean LegacyPairing [readonly]
+
+ Set to true if the device only supports the pre-2.1
+ pairing mechanism. This property is useful in the
+ Adapter.DeviceFound signal to anticipate whether
+ legacy or simple pairing will occur.
+
+ Note that this property can exhibit false-positives
+ in the case of Bluetooth 2.1 (or newer) devices that
+ have disabled Extended Inquiry Response support.
+
+ string Modalias [readonly, optional]
+
+ Remote Device ID information in modalias format
+ used by the kernel and udev.
+
+ int16 RSSI [readonly, optional]
+
+ Received Signal Strength Indicator of the remote
+ device (inquiry or advertising).
diff --git a/contrib/bluez-api-5.20-fixed/health-api.txt b/contrib/bluez-api-5.20-fixed/health-api.txt
new file mode 100644
index 0000000..2c48ff2
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/health-api.txt
@@ -0,0 +1,152 @@
+BlueZ D-Bus Health API description
+**********************************
+
+
+HealthManager hierarchy
+=======================
+
+Service org.bluez
+Interface org.bluez.HealthManager1
+Object path /org/bluez/
+
+Methods object CreateApplication(dict config)
+
+ Returns the path of the new registered application.
+ Application will be closed by the call or implicitly
+ when the programs leaves the bus.
+
+ config:
+ uint16 DataType:
+
+ Mandatory
+
+ string Role:
+
+ Mandatory. Possible values: "source",
+ "sink"
+
+ string Description:
+
+ Optional
+
+ ChannelType:
+
+ Optional, just for sources. Possible
+ values: "reliable", "streaming"
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+
+ void DestroyApplication(object application)
+
+ Closes the HDP application identified by the object
+ path. Also application will be closed if the process
+ that started it leaves the bus. Only the creator of the
+ application will be able to destroy it.
+
+ Possible errors: org.bluez.Error.InvalidArguments
+ org.bluez.Error.NotFound
+ org.bluez.Error.NotAllowed
+
+
+HealthDevice hierarchy
+======================
+
+Service org.bluez
+Interface org.bluez.HealthDevice1
+Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
+
+Methods boolean Echo()
+
+ Sends an echo petition to the remote service. Returns
+ True if response matches with the buffer sent. If some
+ error is detected False value is returned.
+
+ Possible errors: org.bluez.Error.InvalidArguments
+ org.bluez.Error.OutOfRange
+
+ object CreateChannel(object application, string configuration)
+
+ Creates a new data channel. The configuration should
+ indicate the channel quality of service using one of
+ this values "reliable", "streaming", "any".
+
+ Returns the object path that identifies the data
+ channel that is already connected.
+
+ Possible errors: org.bluez.Error.InvalidArguments
+ org.bluez.Error.HealthError
+
+ void DestroyChannel(object channel)
+
+ Destroys the data channel object. Only the creator of
+ the channel or the creator of the HealthApplication
+ that received the data channel will be able to destroy
+ it.
+
+ Possible errors: org.bluez.Error.InvalidArguments
+ org.bluez.Error.NotFound
+ org.bluez.Error.NotAllowed
+
+Signals void ChannelConnected(object channel)
+
+ This signal is launched when a new data channel is
+ created or when a known data channel is reconnected.
+
+ void ChannelDeleted(object channel)
+
+ This signal is launched when a data channel is deleted.
+
+ After this signal the data channel path will not be
+ valid and its path can be reused for future data
+ channels.
+
+Properties object MainChannel [readonly]
+
+ The first reliable channel opened. It is needed by
+ upper applications in order to send specific protocol
+ data units. The first reliable can change after a
+ reconnection.
+
+
+HealthChannel hierarchy
+=======================
+
+Service org.bluez
+Interface org.bluez.HealthChannel1
+Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/chanZZZ
+
+Only the process that created the data channel or the creator of the
+HealthApplication that received it will be able to call these methods.
+
+Methods fd Acquire()
+
+ Returns the file descriptor for this data channel. If
+ the data channel is not connected it will also
+ reconnect.
+
+ Possible Errors: org.bluez.Error.NotConnected
+ org.bluez.Error.NotAllowed
+
+ void Release()
+
+ Releases the fd. Application should also need to
+ close() it.
+
+ Possible Errors: org.bluez.Error.NotAcquired
+ org.bluez.Error.NotAllowed
+
+Properties string Type [readonly]
+
+ The quality of service of the data channel. ("reliable"
+ or "streaming")
+
+ object Device [readonly]
+
+ Identifies the Remote Device that is connected with.
+ Maps with a HealthDevice object.
+
+ object Application [readonly]
+
+ Identifies the HealthApplication to which this channel
+ is related to (which indirectly defines its role and
+ data type).
diff --git a/contrib/bluez-api-5.20-fixed/heartrate-api.txt b/contrib/bluez-api-5.20-fixed/heartrate-api.txt
new file mode 100644
index 0000000..665db12
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/heartrate-api.txt
@@ -0,0 +1,77 @@
+Heart Rate API description
+**************************
+
+
+Heart Rate Manager hierarchy
+============================
+
+Service org.bluez
+Interface org.bluez.HeartRateManager1
+Object path [variable prefix]/{hci0,hci1,...}
+
+Methods RegisterWatcher(object agent)
+
+ Registers a watcher to monitor heart rate measurements.
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+
+ UnregisterWatcher(object agent)
+
+ Unregisters a watcher.
+
+Heart Rate Profile hierarchy
+============================
+
+Service org.bluez
+Interface org.bluez.HeartRate1
+Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
+
+Methods Reset()
+
+ Restart the accumulation of energy expended from zero.
+
+ Possible Errors: org.bluez.Error.NotSupported
+
+Properties string Location (optional) [readonly]
+
+ Possible values: "other", "chest", "wrist","winger",
+ "hand", "earlobe", "foot"
+
+ boolean ResetSupported [readonly]
+
+ True if energy expended is supported.
+
+Heart Rate Watcher hierarchy
+============================
+
+Service unique name
+Interface org.bluez.HeartRateWatcher1
+Object path freely definable
+
+Methods void MeasurementReceived(object device, dict measurement)
+
+ This callback is called whenever a heart rate
+ measurement is received from the heart rate device.
+
+ Measurement:
+
+ uint16 Value:
+
+ Measurement value expressed in beats per
+ minute (bpm)
+
+ uint16 Energy (optional):
+
+ Accumulated energy expended in kilo Joules
+
+ boolean Contact (optional):
+
+ true if skin contact is detected by sensor,
+ false otherwise
+
+ array{uint16} Interval (optional):
+
+ RR-Interval values which represent the time
+ between two consecutive R waves in an ECG.
+ Values are ordered starting from oldest to
+ most recent.
diff --git a/contrib/bluez-api-5.20-fixed/media-api.txt b/contrib/bluez-api-5.20-fixed/media-api.txt
new file mode 100644
index 0000000..60e0ef0
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/media-api.txt
@@ -0,0 +1,646 @@
+BlueZ D-Bus Media API description
+*********************************
+
+
+Media hierarchy
+===============
+
+Service org.bluez
+Interface org.bluez.Media1
+Object path [variable prefix]/{hci0,hci1,...}
+
+Methods void RegisterEndpoint(object endpoint, dict properties)
+
+ Register a local end point to sender, the sender can
+ register as many end points as it likes.
+
+ Note: If the sender disconnects the end points are
+ automatically unregistered.
+
+ possible properties:
+
+ string UUID:
+
+ UUID of the profile which the endpoint
+ is for.
+
+ byte Codec:
+
+ Assigned number of codec that the
+ endpoint implements. The values should
+ match the profile specification which
+ is indicated by the UUID.
+
+ array{byte} Capabilities:
+
+ Capabilities blob, it is used as it is
+ so the size and byte order must match.
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+ org.bluez.Error.NotSupported - emitted
+ when interface for the end-point is
+ disabled.
+
+ void UnregisterEndpoint(object endpoint)
+
+ Unregister sender end point.
+
+ void RegisterPlayer(object player, dict properties)
+
+ Register a media player object to sender, the sender
+ can register as many objects as it likes.
+
+ Object must implement at least
+ org.mpris.MediaPlayer2.Player as defined in MPRIS 2.2
+ spec:
+
+ http://specifications.freedesktop.org/mpris-spec/latest/
+
+ Note: If the sender disconnects its objects are
+ automatically unregistered.
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+ org.bluez.Error.NotSupported
+
+ void UnregisterPlayer(object player)
+
+ Unregister sender media player.
+
+
+Media Control hierarchy
+=======================
+
+Service org.bluez
+Interface org.bluez.MediaControl1 [Deprecated]
+Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
+
+Methods void Play()
+
+ Resume playback.
+
+ void Pause()
+
+ Pause playback.
+
+ void Stop()
+
+ Stop playback.
+
+ void Next()
+
+ Next item.
+
+ void Previous()
+
+ Previous item.
+
+ void VolumeUp()
+
+ Adjust remote volume one step up
+
+ void VolumeDown()
+
+ Adjust remote volume one step down
+
+ void FastForward()
+
+ Fast forward playback, this action is only stopped
+ when another method in this interface is called.
+
+ void Rewind()
+
+ Rewind playback, this action is only stopped
+ when another method in this interface is called.
+
+Properties
+
+ boolean Connected [readonly]
+
+
+MediaPlayer1 hierarchy
+======================
+
+Service org.bluez (Controller role)
+Interface org.bluez.MediaPlayer1 [Experimental]
+Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/playerX
+
+Methods void Play()
+
+ Resume playback.
+
+ Possible Errors: org.bluez.Error.NotSupported
+ org.bluez.Error.Failed
+
+ void Pause()
+
+ Pause playback.
+
+ Possible Errors: org.bluez.Error.NotSupported
+ org.bluez.Error.Failed
+
+ void Stop()
+
+ Stop playback.
+
+ Possible Errors: org.bluez.Error.NotSupported
+ org.bluez.Error.Failed
+
+ void Next()
+
+ Next item.
+
+ Possible Errors: org.bluez.Error.NotSupported
+ org.bluez.Error.Failed
+
+ void Previous()
+
+ Previous item.
+
+ Possible Errors: org.bluez.Error.NotSupported
+ org.bluez.Error.Failed
+
+ void FastForward()
+
+ Fast forward playback, this action is only stopped
+ when another method in this interface is called.
+
+ Possible Errors: org.bluez.Error.NotSupported
+ org.bluez.Error.Failed
+
+ void Rewind()
+
+ Rewind playback, this action is only stopped
+ when another method in this interface is called.
+
+ Possible Errors: org.bluez.Error.NotSupported
+ org.bluez.Error.Failed
+
+Properties string Equalizer [readwrite]
+
+ Possible values: "off" or "on"
+
+ string Repeat [readwrite]
+
+ Possible values: "off", "singletrack", "alltracks" or
+ "group"
+
+ string Shuffle [readwrite]
+
+ Possible values: "off", "alltracks" or "group"
+
+ string Scan [readwrite]
+
+ Possible values: "off", "alltracks" or "group"
+
+ string Status [readonly]
+
+ Possible status: "playing", "stopped", "paused",
+ "forward-seek", "reverse-seek"
+ or "error"
+
+ uint32 Position [readonly]
+
+ Playback position in milliseconds. Changing the
+ position may generate additional events that will be
+ sent to the remote device. When position is 0 it means
+ the track is starting and when it's greater than or
+ equal to track's duration the track has ended. Note
+ that even if duration is not available in metadata it's
+ possible to signal its end by setting position to the
+ maximum uint32 value.
+
+ dict Track [readonly]
+
+ Track metadata.
+
+ Possible values:
+
+ string Title:
+
+ Track title name
+
+ string Artist:
+
+ Track artist name
+
+ string Album:
+
+ Track album name
+
+ string Genre:
+
+ Track genre name
+
+ uint32 NumberOfTracks:
+
+ Number of tracks in total
+
+ uint32 TrackNumber:
+
+ Track number
+
+ uint32 Duration:
+
+ Track duration in milliseconds
+
+ object Device [readonly]
+
+ Device object path.
+
+ string Name [readonly]
+
+ Player name
+
+ string Type [readonly]
+
+ Player type
+
+ Possible values:
+
+ "Audio"
+ "Video"
+ "Audio Broadcasting"
+ "Video Broadcasting"
+
+ string Subtype [readonly]
+
+ Player subtype
+
+ Possible values:
+
+ "Audio Book"
+ "Podcast"
+
+ boolean Browsable [readonly]
+
+ If present indicates the player can be browsed using
+ MediaFolder interface.
+
+ Possible values:
+
+ True: Supported and active
+ False: Supported but inactive
+
+ Note: If supported but inactive clients can enable it
+ by using MediaFolder interface but it might interfere
+ in the playback of other players.
+
+
+ boolean Searchable [readonly]
+
+ If present indicates the player can be searched using
+ MediaFolder interface.
+
+ Possible values:
+
+ True: Supported and active
+ False: Supported but inactive
+
+ Note: If supported but inactive clients can enable it
+ by using MediaFolder interface but it might interfere
+ in the playback of other players.
+
+ object Playlist
+
+ Playlist object path.
+
+MediaFolder1 hierarchy
+======================
+
+Service unique name (Target role)
+ org.bluez (Controller role)
+Interface org.bluez.MediaFolder1 [Experimental]
+Object path freely definable (Target role)
+ [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/playerX
+ (Controller role)
+
+Methods object Search(string value, dict filter)
+
+ Return a folder object containing the search result.
+
+ To list the items found use the folder object returned
+ and pass to ChangeFolder.
+
+ Possible Errors: org.bluez.Error.NotSupported
+ org.bluez.Error.Failed
+
+ array{objects, properties} ListItems(dict filter)
+
+ Return a list of items found
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+ org.bluez.Error.NotSupported
+ org.bluez.Error.Failed
+
+ void ChangeFolder(object folder)
+
+ Change current folder.
+
+ Note: By changing folder the items of previous folder
+ might be destroyed and have to be listed again, the
+ exception is NowPlaying folder which should be always
+ present while the player is active.
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+ org.bluez.Error.NotSupported
+ org.bluez.Error.Failed
+
+Properties uint32 NumberOfItems [readonly]
+
+ Number of items in the folder
+
+ string Name [readonly]
+
+ Folder name:
+
+ Possible values:
+ "/Filesystem/...": Filesystem scope
+ "/NowPlaying/...": NowPlaying scope
+
+ Note: /NowPlaying folder might not be listed if player
+ is stopped, folders created by Search are virtual so
+ once another Search is perform or the folder is
+ changed using ChangeFolder it will no longer be listed.
+
+Filters uint32 Start:
+
+ Offset of the first item.
+
+ Default value: 0
+
+ uint32 End:
+
+ Offset of the last item.
+
+ Default value: NumbeOfItems
+
+ array{string} Attributes
+
+ Item properties that should be included in the list.
+
+ Possible Values:
+
+ "title", "artist", "album", "genre",
+ "number-of-tracks", "number", "duration"
+
+ Default Value: All
+
+MediaItem1 hierarchy
+====================
+
+Service unique name (Target role)
+ org.bluez (Controller role)
+Interface org.bluez.MediaItem1 [Experimental]
+Object path freely definable (Target role)
+ [variable
+ prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/playerX/itemX
+ (Controller role)
+
+Methods void Play()
+
+ Play item
+
+ Possible Errors: org.bluez.Error.NotSupported
+ org.bluez.Error.Failed
+
+ void AddtoNowPlaying()
+
+ Add item to now playing list
+
+ Possible Errors: org.bluez.Error.NotSupported
+ org.bluez.Error.Failed
+
+Properties object Player [readonly]
+
+ Player object path the item belongs to
+
+ string Name [readonly]
+
+ Item displayable name
+
+ string Type [readonly]
+
+ Item type
+
+ Possible values: "video", "audio", "folder"
+
+ string FolderType [readonly, optional]
+
+ Folder type.
+
+ Possible values: "mixed", "titles", "albums", "artists"
+
+ Available if property Type is "Folder"
+
+ boolean Playable [readonly, optional]
+
+ Indicates if the item can be played
+
+ Available if property Type is "folder"
+
+ dict Metadata [readonly]
+
+ Item metadata.
+
+ Possible values:
+
+ string Title
+
+ Item title name
+
+ Available if property Type is "audio"
+ or "video"
+
+ string Artist
+
+ Item artist name
+
+ Available if property Type is "audio"
+ or "video"
+
+ string Album
+
+ Item album name
+
+ Available if property Type is "audio"
+ or "video"
+
+ string Genre
+
+ Item genre name
+
+ Available if property Type is "audio"
+ or "video"
+
+ uint32 NumberOfTracks
+
+ Item album number of tracks in total
+
+ Available if property Type is "audio"
+ or "video"
+
+ uint32 Number
+
+ Item album number
+
+ Available if property Type is "audio"
+ or "video"
+
+ uint32 Duration
+
+ Item duration in milliseconds
+
+ Available if property Type is "audio"
+ or "video"
+
+MediaEndpoint1 hierarchy
+========================
+
+Service unique name
+Interface org.bluez.MediaEndpoint1
+Object path freely definable
+
+Methods void SetConfiguration(object transport, dict properties)
+
+ Set configuration for the transport.
+
+ array{byte} SelectConfiguration(array{byte} capabilities)
+
+ Select preferable configuration from the supported
+ capabilities.
+
+ Returns a configuration which can be used to setup
+ a transport.
+
+ Note: There is no need to cache the selected
+ configuration since on success the configuration is
+ send back as parameter of SetConfiguration.
+
+ void ClearConfiguration(object transport)
+
+ Clear transport configuration.
+
+ void Release()
+
+ This method gets called when the service daemon
+ unregisters the endpoint. An endpoint can use it to do
+ cleanup tasks. There is no need to unregister the
+ endpoint, because when this method gets called it has
+ already been unregistered.
+
+
+MediaTransport1 hierarchy
+=========================
+
+Service org.bluez
+Interface org.bluez.MediaTransport1
+Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/fdX
+
+Methods fd Acquire()
+
+ Acquire transport file descriptor and the MTU for read
+ and write respectively.
+
+ Possible Errors: org.bluez.Error.NotAuthorized
+ org.bluez.Error.Failed
+
+ fd TryAcquire()
+
+ Acquire transport file descriptor only if the transport
+ is in "pending" state at the time the message is
+ received by BlueZ. Otherwise no request will be sent
+ to the remote device and the function will just fail
+ with org.bluez.Error.NotAvailable.
+
+ Possible Errors: org.bluez.Error.NotAuthorized
+ org.bluez.Error.Failed
+ org.bluez.Error.NotAvailable
+
+ void Release()
+
+ Releases file descriptor.
+
+Properties object Device [readonly]
+
+ Device object which the transport is connected to.
+
+ string UUID [readonly]
+
+ UUID of the profile which the transport is for.
+
+ byte Codec [readonly]
+
+ Assigned number of codec that the transport support.
+ The values should match the profile specification which
+ is indicated by the UUID.
+
+ array{byte} Configuration [readonly]
+
+ Configuration blob, it is used as it is so the size and
+ byte order must match.
+
+ string State [readonly]
+
+ Indicates the state of the transport. Possible
+ values are:
+ "idle": not streaming
+ "pending": streaming but not acquired
+ "active": streaming and acquired
+
+ uint16 Delay [readwrite]
+
+ Optional. Transport delay in 1/10 of millisecond, this
+ property is only writeable when the transport was
+ acquired by the sender.
+
+ boolean NREC [readwrite]
+
+ Optional and HFP specific (external to BlueZ).
+ Indicates if echo cancelling and noise reduction
+ functions are active in the transport, this
+ property is only writeable when the transport
+ was acquired by the sender.
+
+ boolean InbandRingtone [readwrite]
+
+ Optional and HFP specific (external to BlueZ).
+ Indicates if the transport support sending
+ ringtones, this property is only writeable when
+ the transport was acquired by the sender.
+
+ string Routing [readonly]
+
+ Optional and HFP specific (external to BlueZ).
+ Indicates where is the transport being routed.
+
+ Possible Values: "HCI" or "PCM"
+
+ uint16 Volume [readwrite]
+
+ Optional. Indicates volume level of the transport,
+ this property is only writeable when the transport was
+ acquired by the sender.
+
+ Note: the property will not be present for HSP/HFP
+ transports and MicrophoneGain/SpeakerGain should be
+ used instead.
+
+ Possible Values: 0-127
+
+ byte MicrophoneGain [readwrite]
+
+ Optional. Indicates volume level of the transport's
+ incoming audio stream for HSP/HFP transports. This
+ property is only writeable when the transport was
+ acquired by the sender.
+
+ Possible Values: 0-15
+
+ byte SpeakerGain [readwrite]
+
+ Optional. Indicates volume level of the transport's
+ outgoing audio stream for HSP/HFP transports. This
+ property is only writeable when the transport was
+ acquired by the sender.
+
+ Possible Values: 0-15
diff --git a/contrib/bluez-api-5.20-fixed/mgmt-api.txt b/contrib/bluez-api-5.20-fixed/mgmt-api.txt
new file mode 100644
index 0000000..e15a78f
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/mgmt-api.txt
@@ -0,0 +1,2324 @@
+Bluetooth Management API
+*************************
+
+Copyright (C) 2008-2009 Marcel Holtmann <marcel@holtmann.org>
+
+
+Overview
+========
+
+This document describes the format of data used for communicating with
+the kernel using a so-called Bluetooth Management sockets. These sockets
+are available starting with Linux kernel version 3.4
+
+The following kernel versions introduced new commands, new events or
+important fixes to the Bluetooth Management API:
+
+Linux kernel v3.4 Version 1.0
+Linux kernel v3.5 Version 1.1
+Linux kernel v3.7 Version 1.2
+Linux kernel v3.9 Version 1.3
+Linux kernel v3.13 Version 1.4
+Linux kernel v3.15 Version 1.5
+Linux kernel v3.16 Version 1.6 (not yet released)
+
+Version 1.1 introduces Set Device ID command.
+
+Version 1.2 introduces Passkey Notify event.
+
+Version 1.3 does not introduce any new command or event.
+
+Version 1.4 introduces Set Advertising, Set BR/EDR, Set Static Address
+and Set Scan Parameters commands.
+
+Version 1.5 introduces Set Secure Connections, Set Debug Keys, Set Privacy
+and Load Identity Resolving Keys commands. It also introduces New Identity
+Resolving Key and New Signature Resolving Key events.
+
+Version 1.6 introduces Get Connection Information command. It also updates
+the Device Found event to combine advertising data and scan response data
+into a single event.
+
+
+Example
+=======
+
+The Bluetooth management sockets can be created by setting the hci_channel
+member of struct sockaddr_hci to HCI_CHANNEL_CONTROL (3) when creating a
+raw HCI socket. In C the needed code would look something like the following:
+
+int mgmt_create(void)
+{
+ struct sockaddr_hci addr;
+ int fd;
+
+ fd = socket(PF_BLUETOOTH, SOCK_RAW | SOCK_CLOEXEC | SOCK_NONBLOCK,
+ BTPROTO_HCI);
+ if (fd < 0)
+ return -errno;
+
+ memset(&addr, 0, sizeof(addr));
+ addr.hci_family = AF_BLUETOOTH;
+ addr.hci_dev = HCI_DEV_NONE;
+ addr.hci_channel = HCI_CHANNEL_CONTROL;
+
+ if (bind(fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
+ int err = -errno;
+ close(fd);
+ return err;
+ }
+
+ return fd;
+}
+
+The process creating the mgmt socket is required to have the
+CAP_NET_ADMIN capability (e.g. root would have this).
+
+
+Packet Structures
+=================
+
+ Commands:
+
+ 0 4 8 12 16 22 24 28 31 35 39 43 47
+ +-------------------+-------------------+-------------------+
+ | Command Code | Controller Index | Parameter Length |
+ +-------------------+-------------------+-------------------+
+ | |
+
+ Events:
+
+ 0 4 8 12 16 22 24 28 31 35 39 43 47
+ +-------------------+-------------------+-------------------+
+ | Event Code | Controller Index | Parameter Length |
+ +-------------------+-------------------+-------------------+
+ | |
+
+All fields are in little-endian byte order (least significant byte first).
+
+Controller Index can have a special value <non-controller> to indicate that
+command or event is not related to any controller. Possible values:
+
+ <controller id> 0x0000 to 0xFFFE
+ <non-controller> 0xFFFF
+
+
+Error Codes
+===========
+
+The following values have been defined for use with the Command Status
+and Command Complete events:
+
+0x00 Success
+0x01 Unknown Command
+0x02 Not Connected
+0x03 Failed
+0x04 Connect Failed
+0x05 Authentication Failed
+0x06 Not Paired
+0x07 No Resources
+0x08 Timeout
+0x09 Already Connected
+0x0A Busy
+0x0B Rejected
+0x0C Not Supported
+0x0D Invalid Parameters
+0x0E Disconnected
+0x0F Not Powered
+0x10 Cancelled
+0x11 Invalid Index
+
+
+Read Management Version Information Command
+===========================================
+
+ Command Code: 0x0001
+ Controller Index: <non-controller>
+ Command Parameters:
+ Return Parameters: Version (1 Octets)
+ Revision (2 Octets)
+
+ This command returns the Management version and revision.
+ Besides, being informational the information can be used to
+ determine whether certain behavior has changed or bugs fixed
+ when interacting with the kernel.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+
+Read Management Supported Commands Command
+==========================================
+
+ Command Code: 0x0002
+ Controller Index: <non-controller>
+ Command Parameters:
+ Return Parameters: Num_Of_Commands (2 Octets)
+ Num_Of_Events (2 Octets)
+ Command1 (2 Octets)
+ Command2 (2 Octets)
+ ...
+ Event1 (2 Octets)
+ Event2 (2 Octets)
+ ...
+
+ This command returns the list of supported Management commands
+ and events.
+
+ The commands Read Management Version Information and Read
+ management Supported Commands are not included in this list.
+ Both commands are always supported and mandatory.
+
+ The events Command Status and Command Complete are not included
+ in this list. Both are implicit and mandatory.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+
+Read Controller Index List Command
+==================================
+
+ Command Code: 0x0003
+ Controller Index: <non-controller>
+ Command Parameters:
+ Return Parameters: Num_Controllers (2 Octets)
+ Controller_Index[i] (2 Octets)
+
+ This command returns the list of currently known controllers.
+ Controllers added or removed after calling this command can be
+ monitored using the Index Added and Index Removed events.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+
+Read Controller Information Command
+===================================
+
+ Command Code: 0x0004
+ Controller Index: <controller id>
+ Command Parameters:
+ Return Parameters: Address (6 Octets)
+ Bluetooth_Version (1 Octet)
+ Manufacturer (2 Octets)
+ Supported_Settings (4 Octets)
+ Current_Settings (4 Octets)
+ Class_Of_Device (3 Octets)
+ Name (249 Octets)
+ Short_Name (11 Octets)
+
+ This command is used to retreive the current state and basic
+ information of a controller. It is typically used right after
+ getting the response to the Read Controller Index List command
+ or an Index Added event.
+
+ If not short name is set the Short_Name parameter will be empty
+ (begin with a nul byte).
+
+ Current_Settings & Supported_Settings is a bitmask with
+ currently the following available bits:
+
+ 0 Powered
+ 1 Connectable
+ 2 Fast Connectable
+ 3 Discoverable
+ 4 Pairable
+ 5 Link Level Security (Sec. mode 3)
+ 6 Secure Simple Pairing
+ 7 Basic Rate/Enhanced Data Rate
+ 8 High Speed
+ 9 Low Energy
+ 10 Advertising
+ 11 Secure Connections
+ 12 Debug Keys
+ 13 Privacy
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Invalid Parameters
+ Invalid Index
+
+
+Set Powered Command
+===================
+
+ Command Code: 0x0005
+ Controller Index: <controller id>
+ Command Parameters: Powered (1 Octet)
+ Return Parameters: Current_Settings (4 Octets)
+
+ This command is used to power on or off a controller. The
+ allowed Powered command parameter values are 0x00 and 0x01. All
+ other values will return Invalid Parameters.
+
+ If discoverable setting is activated with a timeout, then
+ switching the controller off will expire this timeout and
+ disable discoverable.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Busy
+ Invalid Parameters
+ Invalid Index
+
+
+Set Discoverable Command
+========================
+
+ Command Code: 0x0006
+ Controller Index: <controller id>
+ Command Parameters: Discoverable (1 Octet)
+ Timeout (2 Octets)
+ Return Parameters: Current_Settings (4 Octets)
+
+ This command is used to set the discoverable property of a
+ controller. The allowed Discoverable command parameter values
+ are 0x00, 0x01 and 0x02. All other values will return Invalid
+ Parameters.
+
+ Timeout is the time in seconds and is only meaningful when
+ Discoverable is set to 0x01 or 0x02. Providing a timeout
+ with 0x00 return Invalid Parameters. For 0x02, the timeout
+ value is required.
+
+ The value 0x00 disables discoverable, the value 0x01 enables
+ general discoverable and the value 0x02 enables limited
+ discoverable.
+
+ This command is only available for BR/EDR capable controllers
+ (e.g. not for single-mode LE ones). It will return Not Supported
+ otherwise.
+
+ This command can be used when the controller is not powered and
+ all settings will be programmed once powered.
+
+ However using a timeout when the controller is not powered will
+ return Not Powered error.
+
+ When switching discoverable on and the connectable setting is
+ off it will return Rejected error.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Busy
+ Rejected
+ Not Supported
+ Invalid Parameters
+ Not Powered
+ Invalid Index
+
+
+Set Connectable Command
+=======================
+
+ Command Code: 0x0007
+ Controller Index: <controller id>
+ Command Parameters: Connectable (1 Octet)
+ Return Parameters: Current_Settings (4 Octets)
+
+ This command is used to set the connectable property of a
+ controller. The allowed Connectable command parameter values are
+ 0x00 and 0x01. All other values will return Invalid Parameters.
+
+ This command is available for BR/EDR, LE-only and also dual
+ mode controllers. For BR/EDR is changes the page scan setting
+ and for LE controllers it changes the advertising type. For
+ dual mode controllers it affects both settings.
+
+ For LE capable controllers the connectable setting only takes
+ affect when advertising is enabled.
+
+ This command can be used when the controller is not powered and
+ all settings will be programmed once powered.
+
+ When switching connectable off, it will also switch off the
+ discoverable setting. Switching connectable back on will not
+ restore a previous discoverable. It will stay off and needs
+ to be manually switched back on.
+
+ When switching connectable off, it will expire a discoverable
+ setting with a timeout.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Busy
+ Not Supported
+ Invalid Parameters
+ Invalid Index
+
+
+Set Fast Connectable Command
+============================
+
+ Command Code: 0x0008
+ Controller Index: <controller id>
+ Command Parameters: Enable (1 Octet)
+ Return Parameters: Current_Settings (4 Octets)
+
+ This command is used to set the controller into a connectable
+ state where the page scan parameters have been set in a way to
+ favor faster connect times with the expense of higher power
+ consumption.
+
+ The allowed values of the Enable command parameter are 0x00 and
+ 0x01. All other values will return Invalid Parameters.
+
+ This command is only available for BR/EDR capable controllers
+ (e.g. not for single-mode LE ones). It will return Not Supported
+ otherwise.
+
+ This command can only be used when the controller is powered on
+ and will return Not Powerd otherwise.
+
+ If connectable is not set, then this command will fail with
+ Rejected error.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Failed
+ Busy
+ Rejected
+ Not Supported
+ Invalid Parameters
+ Not Powered
+ Invalid Index
+
+
+Set Pairable Command
+====================
+
+ Command Code: 0x0009
+ Controller Index: <controller id>
+ Command Parameters: Pairable (1 Octet)
+ Return Parameters: Current_Settings (4 Octets)
+
+ This command is used to set the pairable property of an
+ controller. The allowed values for the Pairable command
+ parameter are 0x00 and 0x01. All other values will return
+ Invalid Parameters.
+
+ This command can be used when the controller is not powered and
+ all settings will be programmed once powered.
+
+ Turning pairable on will not automatically switch the controller
+ into connectable mode. That needs to be done separately.
+
+ The setting will be remembered during power down/up toggles.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Invalid Parameters
+ Invalid Index
+
+
+Set Link Security Command
+=========================
+
+ Command Code: 0x000A
+ Controller Index: <controller id>
+ Command Parameters: Link_Security (1 Octet)
+ Return Parameters: Current_Settings (4 Octets)
+
+ This command is used to either enable or disable link level
+ security for an controller (also known as Security Mode 3). The
+ allowed values for the Link_Security command parameter are 0x00
+ and 0x01. All other values will return Invalid Parameters.
+
+ This command is only available for BR/EDR capable controllers
+ (e.g. not for single-mode LE ones). It will return Not Supported
+ otherwise.
+
+ This command can be used when the controller is not powered and
+ all settings will be programmed once powered.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Busy
+ Not Supported
+ Invalid Parameters
+ Invalid Index
+
+
+Set Secure Simple Pairing Command
+=================================
+
+ Command Code: 0x000B
+ Controller Index: <controller id>
+ Command Parameters: Secure_Simple_Pairing (1 Octet)
+ Return Parameters: Current_Settings (4 Octets)
+
+ This command is used to enable/disable Secure Simple Pairing
+ support for a controller. The allowed values for the
+ Secure_Simple_Pairing command parameter are 0x00 and 0x01. All
+ other values will return Invalid Parameters.
+
+ This command is only available for BR/EDR capable controllers
+ supporting the core specification version 2.1 or greater
+ (e.g. not for single-mode LE controllers or pre-2.1 ones).
+
+ This command can be used when the controller is not powered and
+ all settings will be programmed once powered.
+
+ In case the controller does not support Secure Simple Pairing,
+ the command will fail regardless with Not Supported error.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Busy
+ Not Supported
+ Invalid Parameters
+ Invalid Index
+
+Set High Speed Command
+======================
+
+ Command Code: 0x000C
+ Controller Index: <controller id>
+ Command Parameters: High_Speed (1 Octet)
+ Return Parameters: Current_Settings (4 Octets)
+
+ This command is used to enable/disable Bluetooth High Speed
+ support for a controller. The allowed values for the High_Speed
+ command parameter are 0x00 and 0x01. All other values will
+ return Invalid Parameters.
+
+ This command is only available for BR/EDR capable controllers
+ (e.g. not for single-mode LE ones).
+
+ This command can be used when the controller is not powered and
+ all settings will be programmed once powered.
+
+ To enable High Speed support, it is required that Secure Simple
+ Pairing support is enabled first. High Speed support is not
+ possible for connections without Secure Simple Pairing.
+
+ When switching Secure Simple Pairing off, the support for High
+ Speed will be switched off as well. Switching Secure Simple
+ Pairing back on, will not re-enable High Speed support. That
+ needs to be done manually.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Not Supported
+ Invalid Parameters
+ Invalid Index
+
+
+Set Low Energy Command
+======================
+
+ Command Code: 0x000D
+ Controller Index: <controller id>
+ Command Parameters: Low_Energy (1 Octet)
+ Return Parameters: Current_Settings (4 Octets)
+
+ This command is used to enable/disable Low Energy support for a
+ controller. The allowed values of the Low_Energy command
+ parameter are 0x00 and 0x01. All other values will return
+ Invalid Parameters.
+
+ This command is only available for LE capable controllers and
+ will yield in a Not Supported error otherwise.
+
+ This command can be used when the controller is not powered and
+ all settings will be programmed once powered.
+
+ In case the kernel subsystem does not support Low Energy or the
+ controller does not either, the command will fail regardless.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Busy
+ Not Supported
+ Invalid Parameters
+ Invalid Index
+
+
+Set Device Class
+================
+
+ Command Code: 0x000E
+ Controller Index: <controller id>
+ Command Parameters: Major_Class (1 Octet)
+ Minor_Class (1 Octet)
+ Return Parameters: Class_Of_Device (3 Octets)
+
+ This command is used to set the major and minor device class for
+ BR/EDR capable controllers.
+
+ This command will also implicitly disable caching of pending CoD
+ and EIR updates.
+
+ This command is only available for BR/EDR capable controllers
+ (e.g. not for single-mode LE ones).
+
+ This command can be used when the controller is not powered and
+ all settings will be programmed once powered.
+
+ In case the controller is powered off, 0x000000 will be returned
+ for the class of device parameter. And after power on the new
+ value will be announced via class of device changed event.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Busy
+ Not Supported
+ Invalid Parameters
+ Invalid Index
+
+
+Set Local Name Command
+======================
+
+ Command Code: 0x000F
+ Controller Index: <controller id>
+ Command Parameters: Name (249 Octets)
+ Short_Name (11 Octets)
+ Return Parameters: Name (249 Octets)
+ Short_Name (11 Octets)
+
+ This command is used to set the local name of a controller. The
+ command parameters also include a short name which will be used
+ in case the full name doesn't fit within EIR/AD data.
+
+ The name parameters need to always end with a null byte (failure
+ to do so will cause the command to fail).
+
+ This command can be used when the controller is not powered and
+ all settings will be programmed once powered.
+
+ The values of name and short name will be remembered when
+ switching the controller off and back on again. So the name
+ and short name only have to be set once when a new controller
+ is found and will stay until removed.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Invalid Parameters
+ Invalid Index
+
+
+Add UUID Command
+================
+
+ Command Code: 0x0010
+ Controller Index: <controller id>
+ Command Parameters: UUID (16 Octets)
+ SVC_Hint (1 Octet)
+ Return Parameters: Class_Of_Device (3 Octets)
+
+ This command is used to add a UUID to be published in EIR
+ and/or AD data. The accompanied SVC_Hint parameter is used to
+ tell the kernel whether the service class bits of the Class of
+ Device value need modifying due to this UUID.
+
+ This command can be used when the controller is not powered and
+ all settings will be programmed once powered.
+
+ In case the controller is powered off, 0x000000 will be returned
+ for the class of device parameter. And after power on the new
+ value will be announced via class of device changed event.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Busy
+ Invalid Parameters
+ Invalid Index
+
+
+Remove UUID Command
+===================
+
+ Command Code: 0x0011
+ Controller Index: <controller id>
+ Command Parameters: UUID (16 Octets)
+ Return Parameters: Class_Of_Device (3 Octets)
+
+ This command is used to remove a UUID previously added using the
+ Add UUID command.
+
+ When the UUID parameter is an empty UUID (16 x 0x00), then all
+ previously loaded UUIDs will be removed.
+
+ This command can be used when the controller is not powered and
+ all settings will be programmed once powered.
+
+ In case the controller is powered off, 0x000000 will be returned
+ for the class of device parameter. And after power on the new
+ value will be announced via class of device changed event.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Busy
+ Invalid Parameters
+ Invalid Index
+
+
+Load Link Keys Command
+======================
+
+ Command Code: 0x0012
+ Controller Index: <controller id>
+ Command Parameters: Debug_Keys (1 Octet)
+ Key_Count (2 Octets)
+ Key1 {
+ Address (6 Octets)
+ Address_Type (1 Octet)
+ Key_Type (1 Octet)
+ Value (16 Octets)
+ PIN_Length (1 Octet)
+ }
+ Key2 { }
+ ...
+ Return Parameters:
+
+ This command is used to feed the kernel with currently known
+ link keys. The command does not need to be called again upon the
+ receiption of New Link Key events since the kernel updates its
+ list automatically.
+
+ The Debug_Keys parameter is used to tell the kernel whether to
+ accept the usage of debug keys or not. The allowed values for
+ this parameter are 0x00 and 0x01. All other values will return
+ an Invalid Parameters response.
+
+ Usage of the Debug_Keys parameter is deprecated and has been
+ replaced with the Set Debug Keys command. When setting the
+ Debug_Keys option via Load Link Keys command it has the same
+ affect as setting it via Set Debug Keys and applies to all
+ keys in the system.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 Reserved (not in use)
+ 2 Reserved (not in use)
+
+ Public and random LE addresses are not valid and will be rejected.
+
+ Currently defined Key_Type values are:
+
+ 0x00 Combination key
+ 0x01 Local Unit key
+ 0x02 Remote Unit key
+ 0x03 Debug Combination key
+ 0x04 Unauthenticated Combination key from P-192
+ 0x05 Authenticated Combination key from P-192
+ 0x06 Changed Combination key
+ 0x07 Unauthenticated Combination key from P-256
+ 0x08 Authenticated Combination key from P-256
+
+ This command can be used when the controller is not powered.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Invalid Parameters
+ Invalid Index
+
+
+Load Long Term Keys Command
+===========================
+
+ Command Code: 0x0013
+ Controller Index: <controller id>
+ Command Parameters: Key_Count (2 Octets)
+ Key1 {
+ Address (6 Octets)
+ Address_Type (1 Octet)
+ Key_Type (1 Octet)
+ Master (1 Octet)
+ Encryption_Size (1 Octet)
+ Encryption_Diversifier (2 Octets)
+ Random_Number (8 Octets)
+ Value (16 Octets)
+ }
+ Key2 { }
+ ...
+ Return Parameters:
+
+ This command is used to feed the kernel with currently known
+ (SMP) Long Term Keys. The command does not need to be called
+ again upon the receiption of New Long Term Key events since the
+ kernel updates its list automatically.
+
+ Possible values for the Address_Type parameter:
+ 0 Reserved (not in use)
+ 1 LE Public
+ 2 LE Random
+
+ The provided Address and Address_Type are the identity of
+ a device. So either its public address or static random address.
+
+ Unresolvable random addresses and resolvable random addresses are
+ not valid and will be rejected.
+
+ Currently defined Key_Type values are:
+
+ 0x00 Unauthenticated key
+ 0x01 Authenticated key
+
+ This command can be used when the controller is not powered.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Invalid Parameters
+ Invalid Index
+
+
+Disconnect Command
+==================
+
+ Command Code: 0x0014
+ Controller Index: <controller id>
+ Command Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Return Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ This command is used to force the disconnection of a currently
+ connected device.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ This command can only be used when the controller is powered.
+
+ This command generates a Command Complete event on success
+ or failure.
+
+ Possible errors: Not Connected
+ Busy
+ Invalid Parameters
+ Not Powered
+ Invalid Index
+
+
+Get Connections Command
+=======================
+
+ Command Code: 0x0015
+ Controller Index: <controller id>
+ Command Parameters:
+ Return Parameters: Connection_Count (2 Octets)
+ Address1 {
+ Address (6 Octets)
+ Address_Type (1 Octet)
+ }
+ Address2 { }
+ ...
+
+ This command is used to retreive a list of currently connected
+ devices.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ For devices using resolvable random addresses with a known
+ identity resolving key, the Address and Address_Type will
+ contain the identity information.
+
+ This command can only be used when the controller is powered.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Invalid Parameters
+ Not Powered
+ Invalid Index
+
+
+PIN Code Reply Command
+=======================
+
+ Command Code: 0x0016
+ Controller Index: <controller id>
+ Command Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ PIN_Length (1 Octet)
+ PIN_Code (16 Octets)
+ Return Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ This command is used to respond to a PIN Code request event.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ This command can only be used when the controller is powered.
+
+ This command generates a Command Complete event on success
+ or failure.
+
+ Possible errors: Not Connected
+ Invalid Parameters
+ Not Powered
+ Invalid Index
+
+
+PIN Code Negative Reply Command
+===============================
+
+ Command Code: 0x0017
+ Controller Index: <controller id>
+ Command Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Return Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ This command is used to return a negative response to a PIN Code
+ Request event.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ This command can only be used when the controller is powered.
+
+ This command generates a Command Complete event on success
+ or failure.
+
+ Possible errors: Not Connected
+ Invalid Parameters
+ Not Powered
+ Invalid Index
+
+
+Set IO Capability Command
+=========================
+
+ Command Code: 0x0018
+ Controller Index: <controller id>
+ Command Parameters: IO_Capability (1 Octet)
+ Return Parameters:
+
+ This command is used to set the IO Capability used for pairing.
+ The command accepts both SSP and SMP values.
+
+ Possible values for the IO_Capability parameter:
+ 0 DisplayOnly
+ 1 DisplayYesNo
+ 2 KeyboardOnly
+ 3 NoInputNoOutput
+ 4 KeyboardDisplay
+
+ Passing a value 4 (KeyboardDisplay) will cause the kernel to
+ convert it to 1 (DisplayYesNo) in the case of a BR/EDR
+ connection (as KeyboardDisplay is specific to SMP).
+
+ This command can be used when the controller is not powered.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Invalid Parameters
+ Invalid Index
+
+
+Pair Device Command
+===================
+
+ Command Code: 0x0019
+ Controller Index: <controller id>
+ Command Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ IO_Capability (1 Octet)
+ Return Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ This command is used to trigger pairing with a remote device.
+ The IO_Capability command parameter is used to temporarily (for
+ this pairing event only) override the global IO Capaility (set
+ using the Set IO Capability command).
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ Possible values for the IO_Capability parameter:
+ 0 DisplayOnly
+ 1 DisplayYesNo
+ 2 KeyboardOnly
+ 3 NoInputNoOutput
+ 4 KeyboardDisplay
+
+ Passing a value 4 (KeyboardDisplay) will cause the kernel to
+ convert it to 1 (DisplayYesNo) in the case of a BR/EDR
+ connection (as KeyboardDisplay is specific to SMP).
+
+ The Address and Address_Type of the return parameters will
+ return the identity address if know. In case of resolvable
+ random address given as command parameters and the remote
+ provides an identity resolving key, the return parameters
+ will provide the resolved address.
+
+ To allow tracking of which resolvable random address changed
+ into which identity address, the New Identity Resolving Key
+ event will be send before receiving Command Complete event
+ for this command.
+
+ This command can only be used when the controller is powered.
+
+ This command generates a Command Complete event on success
+ or failure.
+
+ Possible errors: Connect Failed
+ Busy
+ Invalid Parameters
+ Not Powered
+ Invalid Index
+
+
+Cancel Pair Device
+==================
+
+ Command Code: 0x001A
+ Controller Index: <controller id>
+ Command Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Return Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ The Address and Address_Type parameters should match what was
+ given to a preceding Pair Device command.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ This command can only be used when the controller is powered.
+
+ This command generates a Command Complete event on success
+ or failure.
+
+ Possible errors: Invalid Parameters
+ Not Powered
+ Invalid Index
+
+
+Unpair Device Command
+=====================
+
+ Command Code: 0x001B
+ Controller Index: <controller id>
+ Command Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Disconnect (1 Octet)
+ Return Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ Removes all keys associated with the remote device.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ The Disconnect parameter tells the kernel whether to forcefully
+ disconnect any existing connections to the device. It should in
+ practice always be 1 except for some special GAP qualification
+ test-cases where a key removal without disconnecting is needed.
+
+ When unpairing a device its link key, long term key and if
+ provided identity resolving key will be purged.
+
+ For devices using resolvable random addresses where the identity
+ resolving key was available, after this command they will now no
+ longer be resolved. The device will essentially become private
+ again.
+
+ This command can only be used when the controller is powered.
+
+ This command generates a Command Complete event on success
+ or failure.
+
+ Possible errors: Not Paired
+ Invalid Parameters
+ Not Powered
+ Invalid Index
+
+
+User Confirmation Reply Command
+===============================
+
+ Command Code: 0x001C
+ Controller Index: <controller id>
+ Command Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Return Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ This command is used to respond to a User Confirmation Request
+ event.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ This command can only be used when the controller is powered.
+
+ This command generates a Command Complete event on success
+ or failure.
+
+ Possible errors: Not Connected
+ Invalid Parameters
+ Not Powered
+ Invalid Index
+
+
+User Confirmation Negative Reply Command
+========================================
+
+ Command Code: 0x001D
+ Controller Index: <controller id>
+ Command Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Return Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ This command is used to return a negative response to a User
+ Confirmation Request event.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ This command can only be used when the controller is powered.
+
+ This command generates a Command Complete event on success
+ or failure.
+
+ Possible errors: Not Connected
+ Invalid Parameters
+ Not Powered
+ Invalid Index
+
+
+User Passkey Reply Command
+==========================
+
+ Command Code: 0x001E
+ Controller Index: <controller id>
+ Command Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Passkey (4 Octets)
+ Return Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ This command is used to respond to a User Confirmation Passkey
+ Request event.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ This command can only be used when the controller is powered.
+
+ This command generates a Command Complete event on success
+ or failure.
+
+ Possible errors: Not Connected
+ Invalid Parameters
+ Not Powered
+ Invalid Index
+
+
+User Passkey Negative Reply Command
+===================================
+
+ Command Code: 0x001F
+ Controller Index: <controller id>
+ Command Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Return Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ This command is used to return a negative response to a User
+ Passkey Request event.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ This command can only be used when the controller is powered.
+
+ This command generates a Command Complete event on success
+ or failure.
+
+ Possible errors: Not Connected
+ Invalid Parameters
+ Not Powered
+ Invalid Index
+
+
+Read Local Out Of Band Data Command
+===================================
+
+ Command Code: 0x0020
+ Controller Index: <controller id>
+ Command Parameters:
+ Return Parameters: Hash_192 (16 Octets)
+ Randomizer_192 (16 Octets)
+ Hash_256 (16 Octets, Optional)
+ Randomizer_256 (16 Octets, Optional)
+
+ This command is used to read the local Out of Band data.
+
+ This command can only be used when the controller is powered.
+
+ If Secure Connections support is enabled, then this command
+ will return P-192 versions of hash and randomizer as well as
+ P-256 versions of both.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Not Supported
+ Busy
+ Invalid Parameters
+ Not Powered
+ Invalid Index
+
+
+Add Remote Out Of Band Data Command
+===================================
+
+ Command Code: 0x0021
+ Controller Index: <controller id>
+ Command Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Hash_192 (16 Octets)
+ Randomizer_192 (16 Octets)
+ Hash_256 (16 Octets, Optional)
+ Randomizer_256 (16 Octets, Optional)
+ Return Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ This command is used to provide Out of Band data for a remote
+ device.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ Provided Out Of Band data is persistent over power down/up toggles.
+
+ This command also accept optional P-256 versions of hash and
+ randomizer. If they are not provided, then they are set to
+ zero value.
+
+ The P-256 versions of both can also be provided when the
+ support for Secure Connections is not enabled. However in
+ that case they will never be used.
+
+ To only provide the P-256 versions of hash and randomizer,
+ it is valid to leave both P-192 fields as zero values. If
+ Secure Connections is disabled, then of course this is the
+ same as not providing any data at all.
+
+ This command generates a Command Complete event on success
+ or failure.
+
+ Possible errors: Failed
+ Invalid Parameters
+ Not Powered
+ Invalid Index
+
+
+Remove Remote Out Of Band Data Command
+======================================
+
+ Command Code: 0x0022
+ Controller Index: <controller id>
+ Command Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Return Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ This command is used to remove data added using the Add Remote
+ Out Of Band Data command.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ This command generates a Command Complete event on success
+ or failure.
+
+ Possible errors: Invalid Parameters
+ Not Powered
+ Invalid Index
+
+
+Start Discovery Command
+=======================
+
+ Command Code: 0x0023
+ Controller Index: <controller id>
+ Command Parameters: Address_Type (1 Octet)
+ Return Parameters: Address_Type (1 Octet)
+
+ This command is used to start the process of discovering remote
+ devices. A Device Found event will be sent for each discovered
+ device.
+
+ Possible values for the Address_Type parameter are a bit-wise or
+ of the following bits:
+
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ By combining these e.g. the following values are possible:
+
+ 1 BR/EDR
+ 6 LE (public & random)
+ 7 BR/EDR/LE (interleaved discovery)
+
+ This command can only be used when the controller is powered.
+
+ This command generates a Command Complete event on success
+ or failure.
+
+ Possible errors: Busy
+ Not Supported
+ Invalid Parameters
+ Not Powered
+ Invalid Index
+
+
+Stop Discovery Command
+======================
+
+ Command Code: 0x0024
+ Controller Index: <controller id>
+ Command Parameters: Address_Type (1 Octet)
+ Return Parameters: Address_Type (1 Octet)
+
+ This command is used to stop the discovery process started using
+ the Start Discovery command.
+
+ This command can only be used when the controller is powered.
+
+ This command generates a Command Complete event on success
+ or failure.
+
+ Possible errors: Rejected
+ Invalid Parameters
+ Invalid Index
+
+
+Confirm Name Command
+====================
+
+ Command Code: 0x0025
+ Controller Index: <controller id>
+ Command Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Name_Known (1 Octet)
+ Return Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ This command is only valid during device discovery and is
+ expected for each Device Found event with the Confirm Name
+ flag set.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ The Name_Known parameter should be set to 0x01 if user space
+ knows the name for the device and 0x00 if it doesn't. If set to
+ 0x00 the kernel will perform a name resolving procedure for the
+ device in question.
+
+ This command can only be used when the controller is powered.
+
+ This command generates a Command Complete event on success
+ or failure.
+
+ Possible errors: Failed
+ Invalid Parameters
+ Invalid Index
+
+
+Block Device Command
+====================
+
+ Command Code: 0x0026
+ Controller Index: <controller id>
+ Command Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Return Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ This command is used to add a device to the list of devices
+ which should be blocked from being connect to the local
+ controller.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ This command can be used when the controller is not powered.
+
+ This command generates a Command Complete event on success
+ or failure.
+
+ Possible errors: Failed
+ Invalid Parameters
+ Invalid Index
+
+
+Unblock Device Command
+======================
+
+ Command Code: 0x0027
+ Controller Index: <controller id>
+ Command Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Return Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ This command is used to remove a device from the list of blocked
+ devices (where it was added to using the Block Device command).
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ This command can be used when the controller is not powered.
+
+ This command generates a Command Complete event on success
+ or failure.
+
+ Possible errors: Invalid Parameters
+ Invalid Index
+
+
+Set Device ID Command
+=====================
+
+ Command Code: 0x0028
+ Controller Index: <controller id>
+ Command Parameters: Source (2 Octets)
+ Vendor (2 Octets)
+ Product (2 Octets)
+ Version (2 Octets)
+ Return Parameters:
+
+ This command can be used when the controller is not powered and
+ all settings will be programmed once powered.
+
+ The Source parameter selects the organization that assigned the
+ Vendor parameter:
+
+ 0x0000 Disable Device ID
+ 0x0001 Bluetooth SIG
+ 0x0002 USB Implementer’s Forum
+
+ The information are put into the EIR data. If the controller does
+ not support EIR or if SSP is disabled, this command will still
+ succeed. The information are stored for later use and will survive
+ toggling SSP on and off.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Invalid Parameters
+ Invalid Index
+
+
+Set Advertising Command
+=======================
+
+ Command Code: 0x0029
+ Controller Index: <controller id>
+ Command Parameters: Advertising (1 Octet)
+ Return Parameters: Current_Settings (4 Octets)
+
+ This command is used to enable LE advertising on a controller
+ that supports it. The allowed values for the Advertising
+ command parameter are 0x00 and 0x01. All other values will
+ return Invalid Parameters.
+
+ A pre-requisite is that LE is already enabled, otherwise
+ this command will return a "rejected" response.
+
+ This command generates a Command Complete event on success or a
+ Command Status event on failure.
+
+ Possible errors: Busy
+ Rejected
+ Not Supported
+ Invalid Parameters
+ Invalid Index
+
+
+Set BR/EDR Command
+==================
+
+ Command Code: 0x002A
+ Controller Index: <controller id>
+ Command Parameters: BR/EDR (1 Octet)
+ Return Parameters: Current_Settings (4 Octets)
+
+ This command is used to enable or disable BR/EDR support
+ on a dual-mode controller. The allowed values for the Advertising
+ command parameter are 0x00 and 0x01. All other values will
+ return Invalid Parameters.
+
+ A pre-requisite is that LE is already enabled, otherwise
+ this command will return a "rejected" response. Enabling BR/EDR
+ can be done both when powered on and powered off, however
+ disabling it can only be done when powered off (otherwise the
+ command will again return "rejected"). Disabling BR/EDR will
+ automatically disable all other BR/EDR related settings.
+
+ This command generates a Command Complete event on success or a
+ Command Status event on failure.
+
+ Possible errors: Busy
+ Rejected
+ Not Supported
+ Invalid Parameters
+ Invalid Index
+
+
+Set Static Address Command
+==========================
+
+ Command Code: 0x002B
+ Controller Index: <controller id>
+ Command Parameters: Address (6 Octets)
+ Return Parameters:
+
+ This command allows for setting the static random address. It is
+ only supported on controllers with LE support. The static random
+ address is suppose to be valid for the lifetime of the
+ controller or at least until the next power cycle. To ensure
+ such behavior, setting of the address is limited to when the
+ controller is powered off.
+
+ The special BDADDR_ANY address (00:00:00:00:00:00) can be used
+ to disable the static address.
+
+ When a controller has a public address (which is required for
+ all dual-mode controllers), this address is not used. Only when
+ the controller information reports BDADDR_ANY (00:00:00:00:00:00),
+ it is required to configure a static address first.
+
+ If privacy mode is enabled and the controller is single mode
+ LE only without a public address, the static random address is
+ used as identity address.
+
+ This command generates a Command Complete event on success or a
+ Command Status event on failure.
+
+ Possible errors: Rejected
+ Not Supported
+ Invalid Parameters
+ Invalid Index
+
+
+Set Scan Parameters Command
+===========================
+
+ Command Code: 0x002C
+ Controller Index: <controller id>
+ Command Parameters: Interval (2 Octets)
+ Window (2 Octets)
+ Return Parameters:
+
+ This command allows for setting the Low Energy scan parameters
+ used for connection establishment and passive scanning. It is
+ only supported on controllers with LE support.
+
+ This command generates a Command Complete event on success or a
+ Command Status event on failure.
+
+ Possible errors: Rejected
+ Not Supported
+ Invalid Parameters
+ Invalid Index
+
+
+Set Secure Connections Command
+==============================
+
+ Command Code: 0x002D
+ Controller Index: <controller id>
+ Command Parameters: Secure_Connections (1 Octet)
+ Return Parameters: Current_Settings (4 Octets)
+
+ This command is used to enable/disable Secure Connections
+ support for a controller. The allowed values for the
+ Secure_Connections command parameter are 0x00, 0x01 and 0x02.
+ All other values will return Invalid Parameters.
+
+ The value 0x00 disables Secure Connections, the value 0x01
+ enables Secure Connections and the value 0x02 enables Secure
+ Connections Only mode.
+
+ This command is only available for BR/EDR capable controllers
+ supporting the core specification version 4.1 or greater
+ (e.g. not for single-mode LE controllers or pre-4.1 ones).
+
+ This command can be used when the controller is not powered and
+ all settings will be programmed once powered.
+
+ In case the controller does not support Secure Connections
+ the command will fail regardless with Not Supported error.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Busy
+ Not Supported
+ Invalid Parameters
+ Invalid Index
+
+
+Set Debug Keys Command
+======================
+
+ Command Code: 0x002E
+ Controller Index: <controller id>
+ Command Parameters: Debug_Keys (1 Octet)
+ Return Parameters: Current_Settings (4 Octets)
+
+ This command is used to tell the kernel whether to accept the
+ usage of debug keys or not. The allowed values for this parameter
+ are 0x00 and 0x01. All other values will return an Invalid Parameters
+ response.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Busy
+ Not Supported
+ Invalid Parameters
+ Invalid Index
+
+
+Set Privacy Command
+===================
+
+ Command Code: 0x002F
+ Controller Index: <controller id>
+ Command Parameters: Privacy (1 Octet)
+ Identity_Resolving_Key (16 Octets)
+ Return Parameters: Current_Settings (4 Octets)
+
+ This command is used to enable Low Energy Privacy feature using
+ resolvable private addresses.
+
+ The value 0x00 disables privacy mode, the value 0x01 enables
+ privacy mode.
+
+ When the controller has a public address (mandatory for dual-mode
+ controllers) it is used as identity address. In case the controller
+ is single mode LE only without a public address, it is required
+ to configure a static random andress first. The privacy mode can
+ only be enabled when an identity address is available.
+
+ The Identity_Resolving_Key is the local key assigned for the local
+ resolvable private address.
+
+ Possible errors: Busy
+ Not Supported
+ Invalid Parameters
+ Invalid Index
+
+
+Load Identity Resolving Keys Command
+====================================
+
+ Command Code: 0x0030
+ Controller Index: <controller id>
+ Command Parameters: Key_Count (2 Octets)
+ Key1 {
+ Address (6 Octets)
+ Address_Type (1 Octet)
+ Value (16 Octets)
+ }
+ Key2 { }
+ ...
+ Return Parameters:
+
+ This command is used to feed the kernel with currently known
+ identity resolving keys. The command does not need to be called
+ again upon the receiption of New Identity Resolving Key events
+ since the kernel updates its list automatically.
+
+ Possible values for the Address_Type parameter:
+ 0 Reserved (not in use)
+ 1 LE Public
+ 2 LE Random
+
+ The provided Address and Address_Type are the identity of
+ a device. So either its public address or static random address.
+
+ Unresolvable random addresses and resolvable random addresses are
+ not valid and will be rejected.
+
+ This command can be used when the controller is not powered.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Invalid Parameters
+ Invalid Index
+
+
+Get Connection Information Command
+==================================
+
+ Command Code: 0x0031
+ Controller Index: <controller id>
+ Command Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Return Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ RSSI (1 Octet)
+ TX_Power (1 Octet)
+ Max_TX_Power (1 Octet)
+
+ This command is used to get connection information.
+
+ TX_Power and Max_TX_Power can be set to 127 if values are invalid or
+ unknown.
+
+ This command generates a Command Complete event on success and
+ on failure. In case of failure only Address and Address_Type fields
+ are valid and values of remaining parameters are considered invalid
+ and shall be ignored.
+
+ Possible errors: Not Connected
+ Not Powered
+ Invalid Parameters
+ Invalid Index
+
+
+Command Complete Event
+======================
+
+ Event Code: 0x0001
+ Controller Index: <controller id> or <non-controller>
+ Event Parameters: Command_Opcode (2 Octets)
+ Status (1 Octet)
+ Return_Parameters
+
+ This event is an indication that a command has completed. The
+ fixed set of parameters includes the opcode to identify the
+ command that completed as well as a status value to indicate
+ success or failure. The rest of the parameters are command
+ specific and documented in the section for each command
+ separately.
+
+
+Command Status Event
+====================
+
+ Event Code: 0x0002
+ Controller Index: <controller id> or <non-controller>
+ Event Parameters: Command_Opcode (2 Octets)
+ Status (1 Octet)
+
+ The command status event is used to indicate an early status for
+ a pending command. In the case that the status indicates failure
+ (anything else except success status) this also means that the
+ command has finished executing.
+
+
+Controller Error Event
+======================
+
+ Event Code: 0x0003
+ Controller Index: <controller id>
+ Event Parameters: Error_Code (1 Octet)
+
+ This event maps straight to the HCI Hardware Error event and is
+ used to indicate something wrong with the controller hardware.
+
+
+Index Added Event
+=================
+
+ Event Code: 0x0004
+ Controller Index: <controller id>
+ Event Parameters:
+
+ This event indicates that a new controller has been added to the
+ system. It is usually followed by a Read Controller Information
+ command.
+
+
+Index Removed Event
+===================
+
+ Event Code: 0x0005
+ Controller Index: <controller id>
+ Event Parameters:
+
+ This event indicates that a controller has been removed from the
+ system.
+
+
+New Settings Event
+==================
+
+ Event Code: 0x0006
+ Controller Index: <controller id>
+ Event Parameters: Current_Settings (4 Octets)
+
+ This event indicates that one or more of the settings for a
+ controller has changed.
+
+
+Class Of Device Changed Event
+=============================
+
+ Event Code: 0x0007
+ Controller Index: <controller id>
+ Event Parameters: Class_Of_Device (3 Octets)
+
+ This event indicates that the Class of Device value for the
+ controller has changed. When the controller is powered off the
+ Class of Device value will always be reported as zero.
+
+
+Local Name Changed Event
+========================
+
+ Event Code: 0x0008
+ Controller Index: <controller id>
+ Event Parameters: Name (249 Octets)
+ Short_Name (11 Octets)
+
+ This event indicates that the local name of the controller has
+ changed.
+
+
+New Link Key Event
+==================
+
+ Event Code: 0x0009
+ Controller Index: <controller id>
+ Event Parameters: Store_Hint (1 Octet)
+ Key {
+ Address (6 Octets)
+ Address_Type (1 Octet)
+ Key_Type (1 Octet)
+ Value (16 Octets)
+ PIN_Length (1 Octet)
+ }
+
+ This event indicates that a new link key has bee generated for a
+ remote device.
+
+ The Store_Hint parameter indicates whether the host is expected
+ to store the key persistently or not (e.g. this would not be set
+ if the authentication requirement was "No Bonding").
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 Reserved (not in use)
+ 2 Reserved (not in use)
+
+ Public and random LE addresses are not valid and will be rejected.
+
+ Currently defined Key_Type values are:
+
+ 0x00 Combination key
+ 0x01 Local Unit key
+ 0x02 Remote Unit key
+ 0x03 Debug Combination key
+ 0x04 Unauthenticated Combination key from P-192
+ 0x05 Authenticated Combination key from P-192
+ 0x06 Changed Combination key
+ 0x07 Unauthenticated Combination key from P-256
+ 0x08 Authenticated Combination key from P-256
+
+ Receiving this event indicates that a pairing procecure has
+ been completed.
+
+
+New Long Term Key Event
+=======================
+
+ Event Code: 0x000A
+ Controller Index: <controller id>
+ Event Parameters: Store_Hint (1 Octet)
+ Key {
+ Address (6 Octets)
+ Address_Type (1 Octet)
+ Key_Type (1 Octet)
+ Master (1 Octet)
+ Encryption Size (1 Octet)
+ Enc. Diversifier (2 Octets)
+ Random Number (8 Octets)
+ Value (16 Octets)
+ }
+
+ This event indicates that a new long term key has been generated
+ for a remote device.
+
+ The Store_Hint parameter indicates whether the host is expected
+ to store the key persistently or not (e.g. this would not be set
+ if the authentication requirement was "No Bonding").
+
+ Possible values for the Address_Type parameter:
+ 0 Reserved (not in use)
+ 1 LE Public
+ 2 LE Random
+
+ The provided Address and Address_Type are the identity of
+ a device. So either its public address or static random address.
+
+ For unresolvable random addresses and resolvable random addresses
+ without identity information and identity resolving key, the
+ Store_Hint will be set to not store the long term key.
+
+ Currently defined Key_Type values are:
+
+ 0x00 Unauthenticated key
+ 0x01 Authenticated key
+
+ Receiving this event indicates that a pairing procecure has
+ been completed.
+
+
+Device Connected Event
+======================
+
+ Event Code: 0x000B
+ Controller Index: <controller id>
+ Event Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Flags (4 Octets)
+ EIR_Data_Length (2 Octets)
+ EIR_Data (0-65535 Octets)
+
+ This event indicates that a successful baseband connection has
+ been created to the remote device.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ For devices using resolvable random addresses with a known
+ identity resolving key, the Address and Address_Type will
+ contain the identity information.
+
+ It is possible that devices get connected via its resolvable
+ random address and after New Identity Resolving Key event
+ start using its identity.
+
+ The following bits are defined for the Flags parameter:
+ 0 Reserved (not in use)
+ 1 Legacy Pairing
+
+
+Device Disconnected Event
+=========================
+
+ Event Code: 0x000C
+ Controller Index: <controller id>
+ Event Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Reason (1 Octet)
+
+ This event indicates that the baseband connection was lost to a
+ remote device.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ For devices using resolvable random addresses with a known
+ identity resolving key, the Address and Address_Type will
+ contain the identity information.
+
+ Possible values for the Reason parameter:
+ 0 Unspecified
+ 1 Connection timeout
+ 2 Connection terminated by local host
+ 3 Connection terminated by remote host
+
+ Note that the local/remote distinction just determines which side
+ terminated the low-level connection, regardless of the
+ disconnection of the higher-level profiles.
+
+ This can sometimes be misleading and thus must be used with care.
+ For example, some hardware combinations would report a locally
+ initiated disconnection even if the user turned Bluetooth off in
+ the remote side.
+
+
+Connect Failed Event
+====================
+
+ Event Code: 0x000D
+ Controller Index: <controller id>
+ Event Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Status (1 Octet)
+
+ This event indicates that a connection attempt failed to a
+ remote device.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ For devices using resolvable random addresses with a known
+ identity resolving key, the Address and Address_Type will
+ contain the identity information.
+
+
+PIN Code Request Event
+======================
+
+ Event Code: 0x000E
+ Controller Index: <controller id>
+ Event Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Secure (1 Octet)
+
+ This event is used to request a PIN Code reply from user space.
+ The reply should either be returned using the PIN Code Reply or
+ the PIN Code Negative Reply command.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ Secure: 0x01 secure PIN code required
+ 0x00 secure PIN code not required
+
+
+User Confirmation Request Event
+===============================
+
+ Event Code: 0x000F
+ Controller Index: <controller id>
+ Event Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Confirm_Hint (1 Octet)
+ Value (4 Octets)
+
+ This event is used to request a user confirmation request from
+ user space.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ If the Confirm_Hint parameter value is 0x01 this means that
+ a simple "Yes/No" confirmation should be presented to the user
+ instead of a full numerical confirmation (in which case the
+ parameter value will be 0x00).
+
+ User space should respond to this command either using the User
+ Confirmation Reply or the User Confirmation Negative Reply
+ command.
+
+
+User Passkey Request Event
+==========================
+
+ Event Code: 0x0010
+ Controller Index: <controller id>
+ Event Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ This event is used to request a passkey from user space. The
+ response to this event should either be the User Passkey Reply
+ command or the User Passkey Negative Reply command.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+
+Authentication Failed Event
+===========================
+
+ Event Code: 0x0011
+ Controller Index: <controller id>
+ Event Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Status (1 Octet)
+
+ This event indicates that there was an authentication failure
+ with a remote device.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+
+Device Found Event
+==================
+
+ Event Code: 0x0012
+ Controller Index: <controller id>
+ Event Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ RSSI (1 Octet)
+ Flags (4 Octets)
+ EIR_Data_Length (2 Octets)
+ EIR_Data (0-65535 Octets)
+
+ This event indicates that a device was found during device
+ discovery.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ The following bits are defined for the Flags parameter:
+ 0 Confirm name
+ 1 Legacy Pairing
+
+ The Confirm name flag indicates that the kernel wants to know
+ whether user space knows the name for this device or not. If
+ this flag is set user space should respond to it using the
+ Confirm Name command.
+
+ The Legacy Pairing flag indicates that Legacy Pairing is likely
+ to occur when pairing with this device. An application could use
+ this information to optimize the pairing process by locally
+ pre-generating a PIN code and thereby eliminate the risk of
+ local input timeout when pairing. Note that there is a risk of
+ false-positives for this flag so user space should be able to
+ handle getting something else as a PIN Request when pairing.
+
+
+Discovering Event
+=================
+
+ Event Code: 0x0013
+ Controller Index: <controller id>
+ Event Parameters: Address_Type (1 Octet)
+ Discovering (1 Octet)
+
+ This event indicates that the controller has started discovering
+ devices. This discovering state can come and go multiple times
+ between a StartDiscover and a StopDiscovery command.
+
+ The valid values for the Discovering parameter are 0x01
+ (enabled) and 0x00 (disabled).
+
+
+Device Blocked Event
+====================
+
+ Event Code: 0x0014
+ Controller Index: <controller id>
+ Event Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ This event indicates that a device has been blocked using the
+ Block Device command.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ The event will only be sent to Management sockets other than the
+ one through which the command was sent.
+
+
+Device Unblocked Event
+======================
+
+ Event Code: 0x0015
+ Controller Index: <controller id>
+ Event Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ This event indicates that a device has been unblocked using the
+ Unblock Device command.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ The event will only be sent to Management sockets other than the
+ one through which the command was sent.
+
+
+Device Unpaired Event
+=====================
+
+ Event Code: 0x0016
+ Controller Index: <controller id>
+ Event Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ This event indicates that a device has been unpaired (i.e. all
+ its keys have been removed from the kernel) using the Unpair
+ Device command.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ For devices using resolvable random addresses with a known
+ identity resolving key, the event paramters will contain
+ the identity. After receiving this event, the device will
+ become essentially private again.
+
+ The event will only be sent to Management sockets other than the
+ one through which the Unpair Device command was sent.
+
+
+Passkey Notify Event
+====================
+
+ Event Code: 0x0017
+ Controller Index: <controller id>
+ Event Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Passkey (4 Octets)
+ Entered (1 Octet)
+
+ This event is used to request passkey notification to the user.
+ Unlike the other authentication events it does not need
+ responding to using any Management command.
+
+ Possible values for the Address_Type parameter:
+ 0 BR/EDR
+ 1 LE Public
+ 2 LE Random
+
+ The Passkey parameter indicates the passkey to be shown to the
+ user whereas the Entered parameter indicates how many characters
+ the user has entered on the remote side.
+
+
+New Identity Resolving Key Event
+================================
+
+ Event Code: 0x0018
+ Controller Index: <controller id>
+ Event Parameters: Store_Hint (1 Octet)
+ Random_Address (6 Octets)
+ Key {
+ Address (6 Octets)
+ Address_Type (1 Octet)
+ Value (16 Octets)
+ }
+
+ This event indicates that a new identity resolving key has been
+ generated for a remote device.
+
+ The Store_Hint parameter indicates whether the host is expected
+ to store the key persistently or not.
+
+ The Random_Address provides the resolvable random address that
+ was resolved into an identity. A value of 00:00:00:00:00:00
+ indicates that the identity resolving key was provided for
+ a public address or static random address.
+
+ Once this event has been send for a resolvable random address,
+ all further events mapping this device will send out using the
+ identity address information.
+
+ This event also indicates that now the identity address should
+ be used for commands instead of the resolvable random address.
+
+ Possible values for the Address_Type parameter:
+ 0 Reserved (not in use)
+ 1 LE Public
+ 2 LE Random
+
+ The provided Address and Address_Type are the identity of
+ a device. So either its public address or static random address.
+
+
+New Signature Resolving Key Event
+=================================
+
+ Event Code: 0x0019
+ Controller Index: <controller id>
+ Event Parameters: Store_Hint (1 Octet)
+ Key {
+ Address (6 Octets)
+ Address_Type (1 Octet)
+ Master (1 Octet)
+ Value (16 Octets)
+ }
+
+ This event indicates that a new signature resolving key has been
+ generated for either the master or slave device.
+
+ The Store_Hint parameter indicates whether the host is expected
+ to store the key persistently or not.
+
+ When the Master parameter is set to 0x01, then the signature
+ resolving key from the remote peer device is provided. It is
+ the key that is used for signature verification.
+
+ When the Master parameter is set to 0x00, then it is the local
+ signature resolving key that is used to sign data. The remote
+ peer device will be using it for signature verification.
+
+ The local signature resolving key will be generated with each
+ pairing request. Only after receiving this event with Master
+ parameter set to 0x00 it is possible to use ATT Signed Write
+ procedures.
+
+ Possible values for the Address_Type parameter:
+ 0 Reserved (not in use)
+ 1 LE Public
+ 2 LE Random
+
+ The provided Address and Address_Type are the identity of
+ a device. So either its public address or static random address.
diff --git a/contrib/bluez-api-4.96-fixed/network-api.txt b/contrib/bluez-api-5.20-fixed/network-api.txt
index 4dd3e58..109da28 100644
--- a/contrib/bluez-api-4.96-fixed/network-api.txt
+++ b/contrib/bluez-api-5.20-fixed/network-api.txt
@@ -1,14 +1,12 @@
BlueZ D-Bus Network API description
***********************************
-Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
-
Network hierarchy
=================
Service org.bluez
-Interface org.bluez.Network
+Interface org.bluez.Network1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
Methods string Connect(string uuid)
@@ -37,16 +35,6 @@ Methods string Connect(string uuid)
Possible errors: org.bluez.Error.Failed
- dict GetProperties()
-
- Returns all properties for the interface. See the
- properties section for available properties.
-
-Signals PropertyChanged(string name, variant value)
-
- This signal indicates a changed value of the given
- property.
-
Properties boolean Connected [readonly]
Indicates if the device is connected.
@@ -64,7 +52,7 @@ Network server hierarchy
========================
Service org.bluez
-Interface org.bluez.NetworkServer
+Interface org.bluez.NetworkServer1
Object path /org/bluez/{hci0,hci1,...}
Methods void Register(string uuid, string bridge)
diff --git a/contrib/bluez-api-5.20-fixed/obex-agent-api.txt b/contrib/bluez-api-5.20-fixed/obex-agent-api.txt
new file mode 100644
index 0000000..3923da6
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/obex-agent-api.txt
@@ -0,0 +1,61 @@
+OBEX D-Bus Agent API description
+********************************
+
+
+Agent Manager hierarchy
+=======================
+
+Service org.bluez.obex
+Interface org.bluez.obex.AgentManager1
+Object path /org/bluez/obex
+
+Methods void RegisterAgent(object agent)
+
+ Register an agent to request authorization of
+ the user to accept/reject objects. Object push
+ service needs to authorize each received object.
+
+ Possible errors: org.bluez.obex.Error.AlreadyExists
+
+ void UnregisterAgent(object agent)
+
+ This unregisters the agent that has been previously
+ registered. The object path parameter must match the
+ same value that has been used on registration.
+
+ Possible errors: org.bluez.obex.Error.DoesNotExist
+
+
+Agent hierarchy
+===============
+
+Service unique name
+Interface org.bluez.obex.Agent1
+Object path freely definable
+
+Methods void Release()
+
+ This method gets called when the service daemon
+ unregisters the agent. An agent can use it to do
+ cleanup tasks. There is no need to unregister the
+ agent, because when this method gets called it has
+ already been unregistered.
+
+ string AuthorizePush(object transfer)
+
+ This method gets called when the service daemon
+ needs to accept/reject a Bluetooth object push request.
+
+ Returns the full path (including the filename) where
+ the object shall be stored. The tranfer object will
+ contain a Filename property that contains the default
+ location and name that can be returned.
+
+ Possible errors: org.bluez.obex.Error.Rejected
+ org.bluez.obex.Error.Canceled
+
+ void Cancel()
+
+ This method gets called to indicate that the agent
+ request failed before a reply was returned. It cancels
+ the previous request.
diff --git a/contrib/bluez-api-5.20-fixed/obex-api.txt b/contrib/bluez-api-5.20-fixed/obex-api.txt
new file mode 100644
index 0000000..9542a30
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/obex-api.txt
@@ -0,0 +1,834 @@
+OBEX D-Bus API description
+**************************
+
+
+Client hierarchy
+================
+
+Service org.bluez.obex
+Interface org.bluez.obex.Client1
+Object path /org/bluez/obex
+
+Methods object CreateSession(string destination, dict args)
+
+ Create a new OBEX session for the given remote address.
+
+ The last parameter is a dictionary to hold optional or
+ type-specific parameters. Typical parameters that can
+ be set in this dictionary include the following:
+
+ string "Target" : type of session to be created
+ string "Source" : local address to be used
+ byte "Channel"
+
+ The currently supported targets are the following:
+
+ "ftp"
+ "map"
+ "opp"
+ "pbap"
+ "sync"
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Failed
+
+ void RemoveSession(object session)
+
+ Unregister session and abort pending transfers.
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.NotAuthorized
+
+Session hierarchy
+=================
+
+Service org.bluez.obex
+Interface org.bluez.obex.Session1
+Object path /org/bluez/obex/server/session{0, 1, 2, ...} or
+ /org/bluez/obex/client/session{0, 1, 2, ...}
+
+Methods string GetCapabilities()
+
+ Get remote device capabilities.
+
+ Possible errors: org.bluez.obex.Error.NotSupported
+ org.bluez.obex.Error.Failed
+
+Properties string Source [readonly]
+
+ Bluetooth adapter address
+
+ string Destination [readonly]
+
+ Bluetooth device address
+
+ byte Channel [readonly]
+
+ Bluetooth channel
+
+ string Target [readonly]
+
+ Target UUID
+
+ string Root [readonly]
+
+ Root path
+
+
+Transfer hierarchy
+==================
+
+Service org.bluez.obex
+Interface org.bluez.obex.Transfer1
+Object path [Session object path]/transfer{0, 1, 2, ...}
+
+Methods void Cancel()
+
+ Stops the current transference.
+
+ Possible errors: org.bluez.obex.Error.NotAuthorized
+ org.bluez.obex.Error.InProgress
+ org.bluez.obex.Error.Failed
+
+ void Suspend()
+
+ Suspend transference.
+
+ Possible errors: org.bluez.obex.Error.NotAuthorized
+ org.bluez.obex.Error.NotInProgress
+
+ Note that it is not possible to suspend transfers
+ which are queued which is why NotInProgress is listed
+ as possible error.
+
+ void Resume()
+
+ Resume transference.
+
+ Possible errors: org.bluez.obex.Error.NotAuthorized
+ org.bluez.obex.Error.NotInProgress
+
+ Note that it is not possible to resume transfers
+ which are queued which is why NotInProgress is listed
+ as possible error.
+
+Properties string Status [readonly]
+
+ Inform the current status of the transfer.
+
+ Possible values: "queued", "active", "suspended",
+ "complete" or "error"
+
+ object Session [readonly]
+
+ The object path of the session the transfer belongs
+ to.
+
+ string Name [readonly]
+
+ Name of the transferred object. Either Name or Type
+ or both will be present.
+
+ string Type [readonly]
+
+ Type of the transferred object. Either Name or Type
+ or both will be present.
+
+ uint64 Time [readonly, optional]
+
+ Time of the transferred object if this is
+ provided by the remote party.
+
+ uint64 Size [readonly, optional]
+
+ Size of the transferred object. If the size is
+ unknown, then this property will not be present.
+
+ uint64 Transferred [readonly, optional]
+
+ Number of bytes transferred. For queued transfers, this
+ value will not be present.
+
+ string Filename [readonly, optional]
+
+ Complete name of the file being received or sent.
+
+ For incoming object push transaction, this will be
+ the proposed default location and name. It can be
+ overwritten by the AuthorizePush agent callback
+ and will be then updated accordingly.
+
+
+Object Push hierarchy
+=====================
+
+Service org.bluez.obex
+Interface org.bluez.obex.ObjectPush1
+Object path [Session object path]
+
+Methods object, dict SendFile(string sourcefile)
+
+ Send one local file to the remote device.
+
+ The returned path represents the newly created transfer,
+ which should be used to find out if the content has been
+ successfully transferred or if the operation fails.
+
+ The properties of this transfer are also returned along
+ with the object path, to avoid a call to GetProperties.
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Failed
+
+ object, dict PullBusinessCard(string targetfile)
+
+ Request the business card from a remote device and
+ store it in the local file.
+
+ If an empty target file is given, a name will be
+ automatically calculated for the temporary file.
+
+ The returned path represents the newly created transfer,
+ which should be used to find out if the content has been
+ successfully transferred or if the operation fails.
+
+ The properties of this transfer are also returned along
+ with the object path, to avoid a call to GetProperties.
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Failed
+
+ object, dict ExchangeBusinessCards(string clientfile,
+ string targetfile)
+
+ Push the client's business card to the remote device
+ and then retrieve the remote business card and store
+ it in a local file.
+
+ If an empty target file is given, a name will be
+ automatically calculated for the temporary file.
+
+ The returned path represents the newly created transfer,
+ which should be used to find out if the content has been
+ successfully transferred or if the operation fails.
+
+ The properties of this transfer are also returned along
+ with the object path, to avoid a call to GetProperties.
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Failed
+
+
+File Transfer hierarchy
+=======================
+
+Service org.bluez.obex
+Interface org.bluez.obex.FileTransfer
+Object path [Session object path]
+
+Methods void ChangeFolder(string folder)
+
+ Change the current folder of the remote device.
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Failed
+
+ void CreateFolder(string folder)
+
+ Create a new folder in the remote device.
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Failed
+
+ array{dict} ListFolder()
+
+ Returns a dictionary containing information about
+ the current folder content.
+
+ The following keys are defined:
+
+ string Name : Object name in UTF-8 format
+ string Type : Either "folder" or "file"
+ uint64 Size : Object size or number of items in
+ folder
+ string Permission : Group, owner and other
+ permission
+ uint64 Modified : Last change
+ uint64 Accessed : Last access
+ uint64 Created : Creation date
+
+ Possible errors: org.bluez.obex.Error.Failed
+
+ object, dict GetFile(string targetfile, string sourcefile)
+
+ Copy the source file (from remote device) to the
+ target file (on local filesystem).
+
+ If an empty target file is given, a name will be
+ automatically calculated for the temporary file.
+
+ The returned path represents the newly created transfer,
+ which should be used to find out if the content has been
+ successfully transferred or if the operation fails.
+
+ The properties of this transfer are also returned along
+ with the object path, to avoid a call to GetProperties.
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Failed
+
+ object, dict PutFile(string sourcefile, string targetfile)
+
+ Copy the source file (from local filesystem) to the
+ target file (on remote device).
+
+ The returned path represents the newly created transfer,
+ which should be used to find out if the content has been
+ successfully transferred or if the operation fails.
+
+ The properties of this transfer are also returned along
+ with the object path, to avoid a call to GetProperties.
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Failed
+
+ void CopyFile(string sourcefile, string targetfile)
+
+ Copy a file within the remote device from source file
+ to target file.
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Failed
+
+ void MoveFile(string sourcefile, string targetfile)
+
+ Move a file within the remote device from source file
+ to the target file.
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Failed
+
+ void Delete(string file)
+
+ Deletes the specified file/folder.
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Failed
+
+
+Phonebook Access hierarchy
+==========================
+
+Service org.bluez.obex
+Interface org.bluez.obex.PhonebookAccess1
+Object path [Session object path]
+
+Methods void Select(string location, string phonebook)
+
+ Select the phonebook object for other operations. Should
+ be call before all the other operations.
+
+ location : Where the phonebook is stored, possible
+ inputs :
+ "int" ( "internal" which is default )
+ "sim" ( "sim1" )
+ "sim2"
+ ...
+
+ phonebook : Possible inputs :
+ "pb" : phonebook for the saved contacts
+ "ich": incoming call history
+ "och": outgoing call history
+ "mch": missing call history
+ "cch": combination of ich och mch
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Failed
+
+ object, dict PullAll(string targetfile, dict filters)
+
+ Return the entire phonebook object from the PSE server
+ in plain string with vcard format, and store it in
+ a local file.
+
+ If an empty target file is given, a name will be
+ automatically calculated for the temporary file.
+
+ The returned path represents the newly created transfer,
+ which should be used to find out if the content has been
+ successfully transferred or if the operation fails.
+
+ The properties of this transfer are also returned along
+ with the object path, to avoid a call to GetProperties.
+
+ Possible filters: Format, Order, Offset, MaxCount and
+ Fields
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Forbidden
+
+ array{string vcard, string name} List(dict filters)
+
+ Return an array of vcard-listing data where every entry
+ consists of a pair of strings containing the vcard
+ handle and the contact name. For example:
+ "1.vcf" : "John"
+
+ Possible filters: Order, Offset and MaxCount
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Forbidden
+
+ object, dict
+ Pull(string vcard, string targetfile, dict filters)
+
+ Given a vcard handle, retrieve the vcard in the current
+ phonebook object and store it in a local file.
+
+ If an empty target file is given, a name will be
+ automatically calculated for the temporary file.
+
+ The returned path represents the newly created transfer,
+ which should be used to find out if the content has been
+ successfully transferred or if the operation fails.
+
+ The properties of this transfer are also returned along
+ with the object path, to avoid a call to GetProperties.
+
+ Possbile filters: Format and Fields
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Forbidden
+ org.bluez.obex.Error.Failed
+
+ array{string vcard, string name}
+ Search(string field, string value, dict filters)
+
+ Search for entries matching the given condition and
+ return an array of vcard-listing data where every entry
+ consists of a pair of strings containing the vcard
+ handle and the contact name.
+
+ vcard : name paired string match the search condition.
+
+ field : the field in the vcard to search with
+ { "name" (default) | "number" | "sound" }
+ value : the string value to search for
+
+
+ Possible filters: Order, Offset and MaxCount
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Forbidden
+ org.bluez.obex.Error.Failed
+
+ uint16 GetSize()
+
+ Return the number of entries in the selected phonebook
+ object that are actually used (i.e. indexes that
+ correspond to non-NULL entries).
+
+ Possible errors: org.bluez.obex.Error.Forbidden
+ org.bluez.obex.Error.Failed
+
+ array{string} ListFilterFields()
+
+ Return All Available fields that can be used in Fields
+ filter.
+
+ Possible errors: None
+
+Filter: string Format:
+
+ Items vcard format
+
+ Possible values: "vcard21" (default) or "vcard30"
+
+ string Order:
+
+ Items order
+
+ Possible values: "indexed" (default), "alphanumeric" or
+ "phonetic"
+
+ uint16 Offset:
+
+ Offset of the first item, default is 0
+
+ uint16 MaxCount:
+
+ Maximum number of items, default is unlimited (65535)
+
+ array{string} Fields:
+
+ Item vcard fields, default is all values.
+
+ Possible values can be query with ListFilterFields.
+
+
+Synchronization hierarchy
+=========================
+
+Service org.bluez.obex
+Interface org.bluez.obex.Synchronization1
+Object path [Session object path]
+
+Methods void SetLocation(string location)
+
+ Set the phonebook object store location for other
+ operations. Should be called before all the other
+ operations.
+
+ location: Where the phonebook is stored, possible
+ values:
+ "int" ( "internal" which is default )
+ "sim1"
+ "sim2"
+ ......
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+
+ object, dict GetPhonebook(string targetfile)
+
+ Retrieve an entire Phonebook Object store from remote
+ device, and stores it in a local file.
+
+ If an empty target file is given, a name will be
+ automatically calculated for the temporary file.
+
+ The returned path represents the newly created transfer,
+ which should be used to find out if the content has been
+ successfully transferred or if the operation fails.
+
+ The properties of this transfer are also returned along
+ with the object path, to avoid a call to GetProperties.
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Failed
+
+ object, dict PutPhonebook(string sourcefile)
+
+ Send an entire Phonebook Object store to remote device.
+
+ The returned path represents the newly created transfer,
+ which should be used to find out if the content has been
+ successfully transferred or if the operation fails.
+
+ The properties of this transfer are also returned along
+ with the object path, to avoid a call to GetProperties.
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Failed
+
+
+Message Access hierarchy
+=========================
+
+Service org.bluez.obex
+Interface org.bluez.obex.MessageAccess1
+Object path [Session object path]
+
+Methods void SetFolder(string name)
+
+ Set working directory for current session, *name* may
+ be the directory name or '..[/dir]'.
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Failed
+
+ array{dict} ListFolders(dict filter)
+
+ Returns a dictionary containing information about
+ the current folder content.
+
+ The following keys are defined:
+
+ string Name : Folder name
+
+ Possible filters: Offset and MaxCount
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Failed
+
+ array{string} ListFilterFields()
+
+ Return all available fields that can be used in Fields
+ filter.
+
+ Possible errors: None
+
+ array{object, dict} ListMessages(string folder, dict filter)
+
+ Returns an array containing the messages found in the
+ given subfolder of the current folder, or in the
+ current folder if folder is empty.
+
+ Possible Filters: Offset, MaxCount, SubjectLength, Fields,
+ Type, PeriodStart, PeriodEnd, Status, Recipient, Sender,
+ Priority
+
+ Each message is represented by an object path followed
+ by a dictionary of the properties.
+
+ Properties:
+
+ string Subject:
+
+ Message subject
+
+ string Timestamp:
+
+ Message timestamp
+
+ string Sender:
+
+ Message sender name
+
+ string SenderAddress:
+
+ Message sender address
+
+ string ReplyTo:
+
+ Message Reply-To address
+
+ string Recipient:
+
+ Message recipient name
+
+ string RecipientAddress:
+
+ Message recipient address
+
+ string Type:
+
+ Message type
+
+ Possible values: "email", "sms-gsm",
+ "sms-cdma" and "mms"
+
+ uint64 Size:
+
+ Message size in bytes
+
+ boolean Text:
+
+ Message text flag
+
+ Specifies whether message has textual
+ content or is binary only
+
+ string Status:
+
+ Message status
+
+ Possible values for received messages:
+ "complete", "fractioned", "notification"
+
+ Possible values for sent messages:
+ "delivery-success", "sending-success",
+ "delivery-failure", "sending-failure"
+
+ uint64 AttachmentSize:
+
+ Message overall attachment size in bytes
+
+ boolean Priority:
+
+ Message priority flag
+
+ boolean Read:
+
+ Message read flag
+
+ boolean Sent:
+
+ Message sent flag
+
+ boolean Protected:
+
+ Message protected flag
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Failed
+
+ void UpdateInbox(void)
+
+ Request remote to update its inbox.
+
+ Possible errors: org.bluez.obex.Error.Failed
+
+ object, dict
+ PushMessage(string sourcefile, string folder, dict args)
+
+ Transfer a message (in bMessage format) to the
+ remote device.
+
+ The message is transferred either to the given
+ subfolder of the current folder, or to the current
+ folder if folder is empty.
+
+ Possible args: Transparent, Retry, Charset
+
+ The returned path represents the newly created transfer,
+ which should be used to find out if the content has been
+ successfully transferred or if the operation fails.
+
+ The properties of this transfer are also returned along
+ with the object path, to avoid a call to GetAll.
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Failed
+
+
+Filter: uint16 Offset:
+
+ Offset of the first item, default is 0
+
+ uint16 MaxCount:
+
+ Maximum number of items, default is 1024
+
+ byte SubjectLength:
+
+ Maximum length of the Subject property in the
+ message, default is 256
+
+ array{string} Fields:
+
+ Message fields, default is all values.
+
+ Possible values can be query with ListFilterFields.
+
+ array{string} Types:
+
+ Filter messages by type.
+
+ Possible values: "sms", "email", "mms".
+
+ string PeriodBegin:
+
+ Filter messages by starting period.
+
+ Possible values: Date in "YYYYMMDDTHHMMSS" format.
+
+ string PeriodEnd:
+
+ Filter messages by ending period.
+
+ Possible values: Date in "YYYYMMDDTHHMMSS" format.
+
+ boolean Read:
+
+ Filter messages by read flag.
+
+ Possible values: True for read or False for unread
+
+ string Recipient:
+
+ Filter messages by recipient address.
+
+ string Sender:
+
+ Filter messages by sender address.
+
+ boolean Priority:
+
+ Filter messages by priority flag.
+
+ Possible values: True for high priority or False for
+ non-high priority
+
+Message hierarchy
+=================
+
+Service org.bluez.obex
+Interface org.bluez.obex.Message1
+Object path [Session object path]/{message0,...}
+
+Methods object, dict Get(string targetfile, boolean attachment)
+
+ Download message and store it in the target file.
+
+ If an empty target file is given, a temporary file
+ will be automatically generated.
+
+ The returned path represents the newly created transfer,
+ which should be used to find out if the content has been
+ successfully transferred or if the operation fails.
+
+ The properties of this transfer are also returned along
+ with the object path, to avoid a call to GetProperties.
+
+ Possible errors: org.bluez.obex.Error.InvalidArguments
+ org.bluez.obex.Error.Failed
+
+Properties string Folder [readonly]
+
+ Folder which the message belongs to
+
+ string Subject [readonly]
+
+ Message subject
+
+ string Timestamp [readonly]
+
+ Message timestamp
+
+ string Sender [readonly]
+
+ Message sender name
+
+ string SenderAddress [readonly]
+
+ Message sender address
+
+ string ReplyTo [readonly]
+
+ Message Reply-To address
+
+ string Recipient [readonly]
+
+ Message recipient name
+
+ string RecipientAddress [readonly]
+
+ Message recipient address
+
+ string Type [readonly]
+
+ Message type
+
+ Possible values: "email", "sms-gsm",
+ "sms-cdma" and "mms"
+
+ uint64 Size [readonly]
+
+ Message size in bytes
+
+ string Status [readonly]
+
+ Message reception status
+
+ Possible values: "complete",
+ "fractioned" and "notification"
+
+ boolean Priority [readonly]
+
+ Message priority flag
+
+ boolean Read [read/write]
+
+ Message read flag
+
+ boolean Deleted [writeonly]
+
+ Message deleted flag
+
+ boolean Sent [readonly]
+
+ Message sent flag
+
+ boolean Protected [readonly]
+
+ Message protected flag
diff --git a/contrib/bluez-api-5.20-fixed/obex_agent.xml b/contrib/bluez-api-5.20-fixed/obex_agent.xml
new file mode 100644
index 0000000..1d55843
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/obex_agent.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<node name="/org/blueztools/obex">
+ <interface name="org.bluez.obex.Agent1">
+ <method name="Release">
+ </method>
+ <method name="AuthorizePush">
+ <arg name="transfer" direction="in" type="o"/>
+ <arg name="filepath" direction="out" type="s"/>
+ </method>
+ <method name="Cancel">
+ </method>
+ </interface>
+</node>
diff --git a/contrib/bluez-api-5.20-fixed/profile-api.txt b/contrib/bluez-api-5.20-fixed/profile-api.txt
new file mode 100644
index 0000000..4917e2e
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/profile-api.txt
@@ -0,0 +1,147 @@
+BlueZ D-Bus Profile API description
+***********************************
+
+
+Profile Manager hierarchy
+=========================
+
+Service org.bluez
+Interface org.bluez.ProfileManager1
+Object path /org/bluez
+
+Methods void RegisterProfile(object profile, string uuid, dict options)
+
+ This registers a profile implementation.
+
+ If an application disconnects from the bus all
+ its registered profiles will be removed.
+
+ HFP HS UUID: 0000111e-0000-1000-8000-00805f9b34fb
+
+ Default RFCOMM channel is 6. And this requires
+ authentication.
+
+ Available options:
+
+ string Name
+
+ Human readable name for the profile
+
+ string Service
+
+ The primary service class UUID
+ (if different from the actual
+ profile UUID)
+
+ string Role
+
+ For asymmetric profiles that do not
+ have UUIDs available to uniquely
+ identify each side this
+ parameter allows specifying the
+ precise local role.
+
+ Possible values: "client", "server"
+
+ uint16 Channel
+
+ RFCOMM channel number that is used
+ for client and server UUIDs.
+
+ If applicable it will be used in the
+ SDP record as well.
+
+ uint16 PSM
+
+ PSM number that is used for client
+ and server UUIDs.
+
+ If applicable it will be used in the
+ SDP record as well.
+
+ boolean RequireAuthentication
+
+ Pairing is required before connections
+ will be established. No devices will
+ be connected if not paired.
+
+ boolean RequireAuthorization
+
+ Request authorization before any
+ connection will be established.
+
+ boolean AutoConnect
+
+ In case of a client UUID this will
+ force connection of the RFCOMM or
+ L2CAP channels when a remote device
+ is connected.
+
+ string ServiceRecord
+
+ Provide a manual SDP record.
+
+ uint16 Version
+
+ Profile version (for SDP record)
+
+ uint16 Features
+
+ Profile features (for SDP record)
+
+ Possible errors: org.bluez.Error.InvalidArguments
+ org.bluez.Error.AlreadyExists
+
+ void UnregisterProfile(object profile)
+
+ This unregisters the profile that has been previously
+ registered. The object path parameter must match the
+ same value that has been used on registration.
+
+ Possible errors: org.bluez.Error.DoesNotExist
+
+
+Profile hierarchy
+=================
+
+Service unique name
+Interface org.bluez.Profile1
+Object path freely definable
+
+Methods void Release() [noreply]
+
+ This method gets called when the service daemon
+ unregisters the profile. A profile can use it to do
+ cleanup tasks. There is no need to unregister the
+ profile, because when this method gets called it has
+ already been unregistered.
+
+ void NewConnection(object device, fd fd, dict fd_properties)
+
+ This method gets called when a new service level
+ connection has been made and authorized.
+
+ Common fd_properties:
+
+ uint16 Version Profile version (optional)
+ uint16 Features Profile features (optional)
+
+ Possible errors: org.bluez.Error.Rejected
+ org.bluez.Error.Canceled
+
+ void RequestDisconnection(object device)
+
+ This method gets called when a profile gets
+ disconnected.
+
+ The file descriptor is no longer owned by the service
+ daemon and the profile implementation needs to take
+ care of cleaning up all connections.
+
+ If multiple file descriptors are indicated via
+ NewConnection, it is expected that all of them
+ are disconnected before returning from this
+ method call.
+
+ Possible errors: org.bluez.Error.Rejected
+ org.bluez.Error.Canceled
diff --git a/contrib/bluez-api-5.20-fixed/proximity-api.txt b/contrib/bluez-api-5.20-fixed/proximity-api.txt
new file mode 100644
index 0000000..5322544
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/proximity-api.txt
@@ -0,0 +1,56 @@
+BlueZ D-Bus Proximity API description
+***********************************
+
+
+Proximity Monitor hierarchy
+===========================
+
+Service org.bluez
+Interface org.bluez.ProximityMonitor1
+Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
+
+Properties string SignalLevel [readonly]
+
+ Alert indicating that a threshold has been reached.
+ Possible values: "unknown", "good", "regular", "weak"
+
+ string LinkLossAlertLevel [readwrite]
+
+ Persistent property. Sets the alert level in the
+ proximity reporter for link loss scenario. Values:
+ "none", "mild", "high".
+
+ string ImmediateAlertLevel [readwrite]
+
+ Alert level to be written in the Immediate Alert Level.
+ Property shared between Path Loss and Find Me.
+ Values: "none", "mild", "high". Default value is
+ "none". Applications can disable the alert setting
+ the value to "none". If the "Target" is not found,
+ "none" will be emitted after the configured timeout.
+ When changing the level, signal is the confirmation
+ that the value was written in the remote.
+
+Proximity Reporter hierarchy
+===========================
+
+Shared service used by Proximity Path Loss and Find Me. Allows per device
+alert level handling.
+
+Service org.bluez
+Interface org.bluez.ProximityReporter1
+Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
+
+Properties string ImmediateAlertLevel [readonly]
+
+ This property indicates that Immediate Alert Level
+ characteristic in the local Immediate Alert Service
+ was changed by the remote device. Property shared
+ between Path Loss and Find Me. Values: "none", "mild",
+ "high".
+
+ string LinkLossAlertLevel [readonly]
+
+ This property indicates that Alert Level characteristic
+ in the local Link Loss Service was changed by the
+ remote device. Values: "none", "mild", "high".
diff --git a/contrib/bluez-api-5.20-fixed/sap-api.txt b/contrib/bluez-api-5.20-fixed/sap-api.txt
new file mode 100644
index 0000000..b28c4e3
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/sap-api.txt
@@ -0,0 +1,20 @@
+BlueZ D-Bus Sim Access API description
+**************************************
+
+
+Sim Access Profile hierarchy
+============================
+
+Service org.bluez
+Interface org.bluez.SimAccess1
+Object path [variable prefix]/{hci0,hci1,...}
+
+Methods void Disconnect()
+
+ Disconnects SAP client from the server.
+
+ Possible errors: org.bluez.Error.Failed
+
+Properties boolean Connected [readonly]
+
+ Indicates if SAP client is connected to the server.
diff --git a/contrib/bluez-api-5.20-fixed/settings-storage.txt b/contrib/bluez-api-5.20-fixed/settings-storage.txt
new file mode 100644
index 0000000..7cdecd5
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/settings-storage.txt
@@ -0,0 +1,228 @@
+BlueZ settings storage
+**********************
+
+Purpose
+=======
+
+The purpose of this document is to describe the directory structure of
+BlueZ settings storage. In effect, this document will serve as the primary,
+up to date source of BlueZ storage information.
+
+It is intended as reference for developers. Direct access to the storage
+outside from bluetoothd is highly discouraged.
+
+Adapter and remote device info are read form the storage during object
+initialization. Write to storage is performed immediately on every value
+change.
+
+Default storage directory is /var/lib/bluetooth. This can be adjusted
+by the --localstatedir configure switch. Default is --localstatedir=/var.
+
+All files are in ini-file format.
+
+
+Storage directory structure
+===========================
+
+There is one directory per adapter, named by its Bluetooth address, which
+contains:
+ - a settings file for the local adapter
+ - an attributes file containing attributes of supported LE services
+ - a cache directory containing:
+ - one file per device, named by remote device address, which contains
+ device name
+ - one directory per remote device, named by remote device address, which
+ contains:
+ - an info file
+ - an attributes file containing attributes of remote LE services
+ - a ccc file containing persistent Client Characteristic Configuration
+ (CCC) descriptor information for GATT characteristics
+
+So the directory structure is:
+ /var/lib/bluetooth/<adapter address>/
+ ./settings
+ ./attributes
+ ./cache/
+ ./<remote device address>
+ ./<remote device address>
+ ...
+ ./<remote device address>/
+ ./info
+ ./attributes
+ ./ccc
+ ./<remote device address>/
+ ./info
+ ./attributes
+ ...
+
+
+Settings file format
+====================
+
+Settings file contains one [General] group with adapter info like:
+
+ Alias String Friendly user provided name advertised
+ for this adapter
+
+ This value overwrites the system
+ name (pretty hostname)
+
+ Discoverable Boolean Discoverability of the adapter
+
+ PairableTimeout Integer How long to stay in pairable mode
+ before going back to non-pairable.
+ The value is in seconds.
+ 0 = disable timer, i.e. stay
+ pairable forever
+
+ DiscoverableTimeout Integer How long to stay in discoverable mode
+ before going back to non-discoverable.
+ The value is in seconds.
+ 0 = disable timer, i.e. stay
+ discoverable forever
+
+Sample:
+ [General]
+ Name=My PC
+ Discoverable=false
+ Pairable=true
+ DiscoverableTimeout=0
+
+
+Attributes file format
+======================
+
+The attributes file lists all attributes supported by the local adapter or
+remote device.
+
+Attributes are stored using their handle as group name (decimal format).
+
+Each group contains:
+
+ UUID String 128-bit UUID of the attribute
+
+ Value String Value of the attribute as hexadecimal encoded
+ string
+
+ EndGroupHandle Integer End group handle in decimal format
+
+Sample:
+ [1]
+ UUID=00002800-0000-1000-8000-00805f9b34fb
+ Value=0018
+
+ [4]
+ UUID=00002803-0000-1000-8000-00805f9b34fb
+ Value=020600002A
+
+ [6]
+ UUID=00002a00-0000-1000-8000-00805f9b34fb
+ Value=4578616D706C6520446576696365
+
+
+CCC file format
+======================
+
+The ccc file stores the current CCC descriptor values for GATT characteristics
+which have notification/indication enabled by the remote device.
+
+Information is stored using CCC attribute handle as group name (in decimal
+format).
+
+Each group contains:
+
+ Value String CCC descriptor value encoded in
+ hexadecimal
+
+
+Cache directory file format
+============================
+
+Each file, named by remote device address, may includes multiple groups
+(General and ServiceRecords).
+
+In ServiceRecords, SDP records are stored using their handle as key
+(hexadecimal format).
+
+[General] group contains:
+
+ Name String Remote device friendly name
+
+ ShortName String Remote device shortened name
+
+[ServiceRecords] group contains
+
+ <0x...> String SDP record as hexadecimal encoded
+ string
+
+
+Info file format
+================
+
+Info file may includes multiple groups (General, Device ID, Link key and
+Long term key) related to a remote device.
+
+[General] group contains:
+
+ Name String Remote device friendly name
+
+ Alias String Alias name
+
+ Class String Device class in hexadecimal,
+ i.e. 0x000000
+
+ Appearance String Device appearance in hexadecimal,
+ i.e. 0x0000
+
+ SupportedTechnologies List of List of technologies supported by
+ strings device, separated by ";"
+ Technologies can be BR/EDR or LE
+
+ AddressType String An address can be "static" or "public"
+
+ Trusted Boolean True if the remote device is trusted
+
+ Blocked Boolean True if the remote device is blocked
+
+ Services List of List of service UUIDs advertised by
+ strings remote in 128-bits UUID format,
+ separated by ";"
+
+
+[DeviceID] group contains:
+
+ Source Integer Assigner of Device ID
+
+ Vendor Integer Device vendor
+
+ Product Integer Device product
+
+ Version Integer Device version
+
+
+[LinkKey] group contains:
+
+ Key String Key in hexadecimal format
+
+ Type Integer Type of link key
+
+ PINLength Integer Length of PIN
+
+
+[LongTermKey] group contains:
+
+ Key String Long term key in hexadecimal format
+
+ Authenticated Boolean True if remote device has been
+ authenticated
+
+ EncSize Integer Encrypted size
+
+ EDiv Integer Encrypted diversifier
+
+ Rand Integer Randomizer
+
+
+[SlaveLongTermKey] group contains:
+
+ Same as the [LongTermKey] group, except for slave keys.
diff --git a/contrib/bluez-api-5.20-fixed/supported-features.txt b/contrib/bluez-api-5.20-fixed/supported-features.txt
new file mode 100644
index 0000000..b337f78
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/supported-features.txt
@@ -0,0 +1,52 @@
+Supported features in BlueZ
+===========================
+
+Note that some profiles/roles will depend on external components such as
+oFono or ConnMan.
+
+Profile/protocol Version Role(s)
+---------------------------------------------------------------------------
+
+GAP 4.0 (LE) Central, Observer, Broadcaster
+L2CAP 4.0 Server, Client
+SDP 4.0 Server, Client
+GATT 4.0 Server, Client
+SDAP 1.1 Server, Client
+RFCOMM 1.1 Server, Client
+SPP 1.1 Server, Client
+
+PXP 1.0 Reporter, Monitor
+HOGP 1.0 Host
+HTP 1.0
+TIP 1.0
+CSCP 1.0 Collector
+
+SAP 1.1 Server
+DUN 1.1 Server, Client
+
+DID 1.3 Server, Client
+
+HFP 1.5 AG, HF
+HSP 1.2 AG, HS
+GAVDTP 1.2 Source, Sink
+AVDTP 1.3 Source, Sink
+A2DP 1.3 Source, Sink
+AVCTP 1.3 CT, TG
+AVRCP 1.5 CT, TG
+
+GOEP 2.0 Client, Server
+FTP 1.2 Client, Server
+OPP 1.2 Client, Server
+SYNCH 1.1 Client
+PBAP 1.1 Client, Server
+MAP 1.0 Client, Server
+
+HID 1.1 Host
+
+BNEP 1.0
+PAN 1.0 PANU, NAP, GN
+
+HCRP 1.2
+
+MCAP 1.0
+HDP 1.0
diff --git a/contrib/bluez-api-5.20-fixed/test-coverage.txt b/contrib/bluez-api-5.20-fixed/test-coverage.txt
new file mode 100644
index 0000000..f70a8d5
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/test-coverage.txt
@@ -0,0 +1,69 @@
+BlueZ test coverage
+*******************
+
+
+Automated unit testing
+======================
+
+Application Count Description
+-------------------------------------------
+test-crc 9 Link Layer CRC-24 checksum
+test-eir 14 EIR and AD parsing
+test-lib 14 SDP library functions
+test-sdp 133 SDP qualification test cases
+test-uuid 30 UUID conversion handling
+test-mgmt 2 Management interface handling
+test-crypto 4 Cryptographic toolbox helpers
+test-textfile 4 Old textfile storage format
+test-ringbuf 3 Ring buffer functionality
+test-queue 1 Queue handling functionality
+test-uhid 6 Userspace HID functionality
+test-hfp 14 HFP Audio Gateway functionality
+test-avdtp 60 AVDTP qualification test cases
+test-avctp 9 AVCTP qualification test cases
+test-avrcp 92 AVRCP qualification test cases
+test-gobex 31 Generic OBEX functionality
+test-gobex-packet 9 OBEX packet handling
+test-gobex-header 28 OBEX header handling
+test-gobex-apparam 18 OBEX apparam handling
+test-gobex-transfer 36 OBEX transfer handling
+test-gdbus-client 12 D-Bus client handling
+ -----
+ 519
+
+
+Automated end-to-end testing
+============================
+
+Application Count Description
+-------------------------------------------
+mgmt-tester 189 Kernel management interface testing
+l2cap-tester 26 Kernel L2CAP implementation testing
+rfcomm-tester 9 Kernel RFCOMM implementation testing
+smp-tester 5 Kernel SMP implementation testing
+sco-tester 8 Kernel SCO implementation testing
+gap-tester 1 Daemon D-Bus API testing
+hci-tester 14 Controller hardware testing
+ -----
+ 252
+
+
+Android end-to-end testing
+==========================
+
+Application Count Description
+-------------------------------------------
+android-tester 86 Android HAL interface testing
+ipc-tester 94 Android IPC resistance testing
+ -----
+ 180
+
+
+Android automated unit testing
+==============================
+
+Application Count Description
+-------------------------------------------
+test-ipc 14 Android IPC library functions
+ -----
+ 14
diff --git a/contrib/bluez-api-5.20-fixed/thermometer-api.txt b/contrib/bluez-api-5.20-fixed/thermometer-api.txt
new file mode 100644
index 0000000..c7c8a5d
--- /dev/null
+++ b/contrib/bluez-api-5.20-fixed/thermometer-api.txt
@@ -0,0 +1,134 @@
+BlueZ D-Bus Thermometer API description
+***************************************
+
+ Santiago Carot-Nemesio <sancane@gmail.com>
+
+Health Thermometer Manager hierarchy
+====================================
+
+Service org.bluez
+Interface org.bluez.ThermometerManager1
+Object path [variable prefix]/{hci0,hci1,...}
+
+Methods RegisterWatcher(object agent)
+
+ Registers a watcher to monitor scanned measurements.
+ This agent will be notified about final temperature
+ measurements.
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+
+ UnregisterWatcher(object agent)
+
+ Unregisters a watcher.
+
+ EnableIntermediateMeasurement(object agent)
+
+ Enables intermediate measurement notifications
+ for this agent. Intermediate measurements will
+ be enabled only for thermometers which support it.
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+
+ DisableIntermediateMeasurement(object agent)
+
+ Disables intermediate measurement notifications
+ for this agent. It will disable notifications in
+ thermometers when the last agent removes the
+ watcher for intermediate measurements.
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+ org.bluez.Error.NotFound
+
+Health Thermometer Profile hierarchy
+====================================
+
+Service org.bluez
+Interface org.bluez.Thermometer1
+Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
+
+
+Properties boolean Intermediate [readonly]
+
+ True if the thermometer supports intermediate
+ measurement notifications.
+
+ uint16 Interval (optional) [readwrite]
+
+ The Measurement Interval defines the time (in
+ seconds) between measurements. This interval is
+ not related to the intermediate measurements and
+ must be defined into a valid range. Setting it
+ to zero means that no periodic measurements will
+ be taken.
+
+ uint16 Maximum (optional) [readonly]
+
+ Defines the maximum value allowed for the interval
+ between periodic measurements.
+
+ uint16 Minimum (optional) [readonly]
+
+ Defines the minimum value allowed for the interval
+ between periodic measurements.
+
+
+Health Thermometer Watcher hierarchy
+====================================
+
+Service unique name
+Interface org.bluez.ThermometerWatcher1
+Object path freely definable
+
+Methods void MeasurementReceived(dict measurement)
+
+ This callback gets called when a measurement has been
+ scanned in the thermometer.
+
+ Measurement:
+
+ int16 Exponent:
+ int32 Mantissa:
+
+ Exponent and Mantissa values as
+ extracted from float value defined by
+ IEEE-11073-20601.
+
+ Measurement value is calculated as
+ (Mantissa) * (10^Exponent)
+
+ For special cases Exponent is
+ set to 0 and Mantissa is set to
+ one of following values:
+
+ +(2^23 - 1) NaN (invalid or
+ missing data)
+ -(2^23) NRes
+ +(2^23 - 2) +Infinity
+ -(2^23 - 2) -Infinity
+
+ string Unit:
+
+ Possible values: "celsius" or
+ "fahrenheit"
+
+ uint64 Time (optional):
+
+ Time of measurement, if
+ supported by device.
+ Expressed in seconds since epoch.
+
+ string Type (optional):
+
+ Only present if measurement type
+ is known.
+
+ Possible values: "armpit", "body",
+ "ear", "finger", "intestines",
+ "mouth", "rectum", "toe",
+ "tympanum"
+
+ string Measurement:
+
+ Possible values: "final" or
+ "intermediate"
diff --git a/contrib/build-mans.sh b/contrib/build-mans.sh
index 2c96802..5c85283 100755
--- a/contrib/build-mans.sh
+++ b/contrib/build-mans.sh
@@ -4,11 +4,11 @@ pod2man -n bt-adapter -c "bluez-tools" -r "" man/bt-adapter.pod > ../src/bt-adap
pod2man -n bt-agent -c "bluez-tools" -r "" man/bt-agent.pod > ../src/bt-agent.1
pod2man -n bt-device -c "bluez-tools" -r "" man/bt-device.pod > ../src/bt-device.1
-pod2man -n bt-monitor -c "bluez-tools" -r "" man/bt-monitor.pod > ../src/bt-monitor.1
+# pod2man -n bt-monitor -c "bluez-tools" -r "" man/bt-monitor.pod > ../src/bt-monitor.1
-pod2man -n bt-audio -c "bluez-tools" -r "" man/bt-audio.pod > ../src/bt-audio.1
-pod2man -n bt-input -c "bluez-tools" -r "" man/bt-input.pod > ../src/bt-input.1
+# pod2man -n bt-audio -c "bluez-tools" -r "" man/bt-audio.pod > ../src/bt-audio.1
+# pod2man -n bt-input -c "bluez-tools" -r "" man/bt-input.pod > ../src/bt-input.1
pod2man -n bt-network -c "bluez-tools" -r "" man/bt-network.pod > ../src/bt-network.1
-pod2man -n bt-serial -c "bluez-tools" -r "" man/bt-serial.pod > ../src/bt-serial.1
+# pod2man -n bt-serial -c "bluez-tools" -r "" man/bt-serial.pod > ../src/bt-serial.1
pod2man -n bt-obex -c "bluez-tools" -r "" man/bt-obex.pod > ../src/bt-obex.1
diff --git a/contrib/gen-dbus-gobject.pl b/contrib/gen-dbus-gobject.pl
index dc8a3c1..f418b52 100755
--- a/contrib/gen-dbus-gobject.pl
+++ b/contrib/gen-dbus-gobject.pl
@@ -41,11 +41,17 @@ sub parse_doc_api {
s/\s+$//;
if ($n == 1) {
- if (/^BlueZ D-Bus \S+ API description$/) {
+ if (/^BlueZ D-Bus (\S+\s{1})+API description$/) {
+ $data{'api'} = 'BlueZ';
$data{'dbus_conn'} = 'system_conn';
} elsif (/^obex.*?API description$/i) {
+ $data{'api'} = 'Obex';
$data{'dbus_conn'} = 'session_conn';
- } elsif (/^ODS API description$/) {
+ } elsif (/^Cycling Speed and Cadence API description$/) {
+ $data{'api'} = 'Cycling Speed';
+ $data{'dbus_conn'} = 'system_conn';
+ } elsif (/^Heart Rate API description$/) {
+ $data{'api'} = 'Heart Rate';
$data{'dbus_conn'} = 'system_conn';
} else {
die "invalid file format (1)\n";
@@ -67,13 +73,28 @@ sub parse_doc_api {
$data{'dbus_conn'} = $dbus_conn;
} elsif (/^Service\s*(.+)$/) {
my $service = $1;
+
+ # Remove strings surrounded by brackets and parentheses
+ $service =~ s/\s*((\(|\[|\{).*(\)|\]|\}))\s*//;
+
die "invalid file format (2)\n" unless $section eq 'hierarchy';
- die "invalid service: $service\n" unless $service eq 'org.bluez' || $service eq 'org.openobex' || $service eq 'org.openobex.client';
- $data{'serviceName'} = $service;
+
+ if($service eq 'org.bluez' || $service eq 'org.bluez.obex') {
+ $data{'serviceName'} = $service;
+ } elsif ($service eq 'unique name') {
+ # $data{'serviceName'} = undef;
+ die "invalid service: User defined DBus object. Please create manually.\n";
+ } else {
+ die "invalid service: $service\n";
+ }
} elsif (/^Interface\s*(.+)$/) {
my $intf = $1;
+
+ # Remove everything after the whitespace
+ $intf =~ s/\s+.*//;
+
die "invalid file format (3)\n" unless $section eq 'hierarchy';
- die "invalid interface: $intf\n" unless $intf =~ /^org\.(bluez|openobex)/;
+ die "invalid interface: $intf\n" unless $intf =~ /^org\.bluez\./;
$data{'intf'} = $intf;
$data{$intf} = undef;
@@ -82,8 +103,14 @@ sub parse_doc_api {
$data{$intf}{'properties'} = undef;
} elsif (/^Object path\s*(.+)/) {
my $obj_path = $1;
+
die "invalid file format (4)\n" unless $section eq 'hierarchy';
- $data{'objectPath'} = $obj_path if $obj_path =~ /^[A-Za-z0-9\/]+$/;
+
+ if($obj_path =~ /^freely definable/ || $obj_path =~ /^\[.*\]/ || $obj_path =~ /\{.*\}/ || $obj_path =~ /dev_XX_XX_XX_XX_XX_XX/) {
+ $data{'objectPath'} = undef;
+ } else {
+ $data{'objectPath'} = $obj_path if $obj_path =~ /^[A-Za-z0-9\/]+$/;
+ }
} elsif (/^Object name\s*(.+)/) {
my $obj_name = $1;
die "invalid file format (4)\n" unless $section eq 'hierarchy';
@@ -93,13 +120,18 @@ sub parse_doc_api {
$section = 'methods';
s/Methods/ /;
} elsif (/^Signals/) {
- die "invalid file format (6)\n" unless $section eq 'methods';
+ # Disabled for now. Some APIs do not have methods.
+ # die "invalid file format (6)\n" unless $section eq 'methods';
$section = 'signals';
s/Signals/ /;
} elsif(/^Properties/) {
- die "invalid file format (7)\n" unless $section eq 'signals' || $section eq 'methods';
+ # Disabled for now. Some APIs do not have methods or signals.
+ # die "invalid file format (7)\n" unless $section eq 'signals' || $section eq 'methods';
$section = 'properties';
s/Properties/ /;
+ } elsif(/^Filter/) {
+ $section = 'filter';
+ s/Filter/ /;
}
if (defined $section && $section eq 'methods' && /^\s+((\S+) (\w+)\((.*)\)( \[(\w+)\])?)$/) {
@@ -108,6 +140,11 @@ sub parse_doc_api {
my $name = $3;
my $args = $4;
my $flag = $6;
+
+ # Check for void parameters
+ if(lc($args) eq 'void') {
+ $args = '';
+ }
$data{$data{'intf'}}{'methods'}{$name}{'decl'} = $decl;
$data{$data{'intf'}}{'methods'}{$name}{'ret'} = $ret;
@@ -120,18 +157,27 @@ sub parse_doc_api {
$data{$data{'intf'}}{'signals'}{$name}{'decl'} = $decl;
@{$data{$data{'intf'}}{'signals'}{$name}{'args'}} = map {type => (split / /, $_)[0], name => (split / /, $_)[1]}, (split /, /, $args);
- } elsif (defined $section && $section eq 'properties' && /^\s+((\S+) (\w+) \[(readonly|readwrite)\])$/) {
+ } elsif (defined $section && $section eq 'properties' && /^\s+((\S+) (\w+) \[(readonly|writeonly|readwrite|read\/write).*\])$/) {
my $decl = $1;
my $type = $2;
my $name = $3;
my $mode = $4;
-
+ my $optional = 0;
+ if ($decl =~ /\(optional\)/i or $decl =~ /\[.*optional\]/i) {
+ $optional = 1;
+ }
+
$data{$data{'intf'}}{'properties'}{$name}{'decl'} = $decl;
$data{$data{'intf'}}{'properties'}{$name}{'type'} = $type;
$data{$data{'intf'}}{'properties'}{$name}{'mode'} = $mode;
+ $data{$data{'intf'}}{'properties'}{$name}{'optional'} = $optional;
+ } elsif (defined $section && $section eq 'filter' && /^\s+((\S+) (\w+)):$/) {
+ my $decl = $1;
+ my $type = $2;
+ my $name = $3;
- die "can't find method 'GetProperties'\n" unless defined $data{$data{'intf'}}{'methods'}{'GetProperties'};
- die "can't find method 'SetProperty'" if $mode eq 'readwrite' && !defined $data{$data{'intf'}}{'methods'}{'SetProperty'};
+ $data{$data{'intf'}}{'filter'}{$name}{'decl'} = $decl;
+ $data{$data{'intf'}}{'filter'}{$name}{'type'} = $type;
}
}
@@ -169,50 +215,32 @@ sub get_g_type {
$g_type = 'void ' if $obj_type eq 'void';
$g_type = 'gchar *' if $obj_type eq 'object' || $obj_type eq 'string';
- $g_type = 'GHashTable *' if $obj_type =~ /^dict/;
- $g_type = 'GValue *' if $obj_type eq 'variant';
- $g_type = 'guint8 ' if $obj_type eq 'uint8';
+ # $g_type = 'GHashTable *' if $obj_type =~ /^dict/; # May be used later...
+ $g_type = 'GVariant *' if $obj_type =~ /^dict/; # GVariant dictionary
+ $g_type = 'GVariant *' if $obj_type eq 'variant';
+ $g_type = 'guint8 ' if $obj_type eq 'uint8' || $obj_type eq 'byte';
$g_type = 'gboolean ' if $obj_type eq 'boolean';
+ $g_type = 'gint16 ' if $obj_type eq 'int16';
+ $g_type = 'guint16 ' if $obj_type eq 'uint16';
$g_type = 'gint32 ' if $obj_type eq 'int32';
- $g_type = 'guint32 ' if $obj_type eq 'uint32';
+ $g_type = 'guint32 ' if $obj_type eq 'uint32' || $obj_type eq 'fd';
$g_type = 'guint64 ' if $obj_type eq 'uint64';
- $g_type = 'GPtrArray *' if $obj_type eq 'array{object}' || $obj_type eq 'array{dict}';
+ # $g_type = 'GPtrArray *' if $obj_type eq 'array{object}' || $obj_type eq 'array{dict}';
+ $g_type = 'gchar **' if $obj_type eq 'array{object}';
+ $g_type = 'GVariant *' if $obj_type eq 'array{dict}';
$g_type = 'gchar **' if $obj_type eq 'array{string}';
- $g_type = 'guchar ' if $obj_type eq 'byte';
+ $g_type = 'guint8 *' if $obj_type eq 'array{byte}';
die "unknown object type (1): $obj_type\n" unless defined $g_type;
return $g_type;
}
-sub get_g_type_name {
- my $obj_type = shift;
- my $g_type_name;
-
- $g_type_name = 'DBUS_TYPE_G_OBJECT_PATH' if $obj_type eq 'object';
- $g_type_name = 'G_TYPE_STRING' if $obj_type eq 'string';
- $g_type_name = 'G_TYPE_VALUE' if $obj_type eq 'variant';
- $g_type_name = 'G_TYPE_BOOLEAN' if $obj_type eq 'boolean';
- $g_type_name = 'G_TYPE_INT' if $obj_type eq 'int32';
- $g_type_name = 'G_TYPE_UINT' if $obj_type eq 'uint32';
- $g_type_name = 'G_TYPE_UINT64' if $obj_type eq 'uint64';
- $g_type_name = 'DBUS_TYPE_G_STRING_VARIANT_HASHTABLE' if $obj_type eq 'dict';
- $g_type_name = 'DBUS_TYPE_G_UINT_STRING_HASHTABLE' if $obj_type eq 'dict{u,s}';
- $g_type_name = 'DBUS_TYPE_G_STRING_STRING_HASHTABLE' if $obj_type eq 'dict{s,s}';
- $g_type_name = 'DBUS_TYPE_G_OBJECT_ARRAY' if $obj_type eq 'array{object}';
- $g_type_name = 'G_TYPE_STRV' if $obj_type eq 'array{string}';
- $g_type_name = 'G_TYPE_UCHAR' if $obj_type eq 'byte';
- $g_type_name = 'DBUS_TYPE_G_HASH_TABLE_ARRAY' if $obj_type eq 'array{dict}';
-
- die "unknown object type (2): $obj_type\n" unless defined $g_type_name;
-
- return $g_type_name;
-}
-
sub get_default_value {
my $c_type = shift;
my $default_value;
+ $default_value = '0x0';
$default_value = 'NULL' if $c_type =~ /\*$/;
$default_value = 'FALSE' if $c_type =~ /boolean/;
$default_value = '0' if $c_type =~ /int/;
@@ -222,6 +250,66 @@ sub get_default_value {
return $default_value;
}
+sub is_const_type {
+ my $obj_type = shift;
+
+ if($obj_type eq 'object' || $obj_type eq 'string' || $obj_type eq 'array{object}' || $obj_type eq 'array{string}') {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+sub get_g_variant_format_char {
+ my $obj_type = shift;
+ my $g_variant_type;
+
+ $g_variant_type = 'o' if $obj_type eq 'object';
+ $g_variant_type = 's' if $obj_type eq 'string';
+ $g_variant_type = '@a{sv}' if $obj_type =~ /^dict/;
+ $g_variant_type = 'v' if $obj_type eq 'variant';
+ $g_variant_type = 'y' if $obj_type eq 'uint8' || $obj_type eq 'byte';
+ $g_variant_type = 'b' if $obj_type eq 'boolean';
+ $g_variant_type = 'n' if $obj_type eq 'int16';
+ $g_variant_type = 'q' if $obj_type eq 'uint16';
+ $g_variant_type = 'h' if $obj_type eq 'int32' || $obj_type eq 'fd';
+ $g_variant_type = 'u' if $obj_type eq 'uint32';
+ $g_variant_type = 't' if $obj_type eq 'uint64';
+ $g_variant_type = '@ao' if $obj_type eq 'array{object}';
+ # $g_variant_type = 'a&v' if $obj_type eq 'array{dict}';
+ $g_variant_type = '@as' if $obj_type eq 'array{string}';
+ $g_variant_type = '@ay' if $obj_type eq 'array{byte}';
+
+ die "unknown object type (1): $obj_type\n" unless defined $g_variant_type;
+
+ return $g_variant_type;
+}
+
+sub generate_g_variant_params {
+ my @params = @{$_[0]};
+ my $variant;
+
+ # Size greater than 0?
+ die "Too few arguments\n" unless @params > 0;
+
+ $variant = 'g_variant_new (';
+ $variant .= '"(';
+ foreach(@params) {
+ $variant .= get_g_variant_format_char($_->{'type'});
+ }
+ $variant .= ')", ';
+
+ for (my $i=0; $i < @params; $i++) {
+ $variant .= '(guint64) ' if $params[$i]{'type'} eq 'uint64';
+ $variant .= '(gint64) ' if $params[$i]{'type'} eq 'int64';
+ $variant .= $params[$i]{'name'};
+ $variant .= ', ' unless $i == (@params - 1);
+ }
+ $variant .= ')';
+
+ return $variant;
+}
+
sub generate_header {
my $node = shift;
@@ -229,10 +317,13 @@ sub generate_header {
#ifndef __{\$OBJECT}_H
#define __{\$OBJECT}_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <glib-object.h>
{DBUS_OBJECT_DEFS}
-
/*
* Type macros
*/
@@ -262,55 +353,116 @@ struct _{\$Object}Class {
GType {\$object}_get_type(void) G_GNUC_CONST;
/*
+ * Constructor
+ */
+{CONSTRUCTOR_DEFS}
+{IF_METHODS}
+/*
* Method definitions
*/
+{FI_METHODS}
{METHOD_DEFS}
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __{\$OBJECT}_H */
EOT
my $intf = $node->{'intf'};
my $obj = exists $node->{'objectName'} ? $node->{'objectName'} : (split /\./, $intf)[-1];
+
+ # Because the BlueZ 5 API uses version numbers at the end of the interfaces, trim off the version number
+ $obj =~ s/\d+$//;
+ # TODO: In the future, when BlueZ 5 includes mutiple versions of the same interface, we should distinguish them.
+
+ # Prefix the Obex API calls to avoid conflicts with the BlueZ API
+ $obj = "Obex".$obj if $intf =~ /obex/i;
+
+ # TODO: In the future, when BlueZ 5 includes mutiple versions of the same interface, we should distinguish them.
my $obj_lc = lc join('_', $obj =~ /([A-Z]+[a-z]*)/g);
my $obj_uc = uc join('_', $obj =~ /([A-Z]+[a-z]*)/g);
+
+ # Prefix the Obex API calls to avoid conflicts with the BlueZ API
+
my $dbus_object_defs = "";
+ $dbus_object_defs .= "#define {\$OBJECT}_DBUS_SERVICE \"$node->{'serviceName'}\"\n" if defined $node->{'serviceName'};
+ $dbus_object_defs .= "#define {\$OBJECT}_DBUS_INTERFACE \"$node->{'intf'}\"\n";
$dbus_object_defs .= "#define {\$OBJECT}_DBUS_PATH \"$node->{'objectPath'}\"\n" if defined $node->{'objectPath'};
- $dbus_object_defs .= "#define {\$OBJECT}_DBUS_INTERFACE \"$node->{'intf'}\"";
+
+ my $constructor_defs = "{\$Object} *{\$object}_new(";
+ my $constructor_args = "";
+
+ if(not exists $node->{'objectPath'} or not defined $node->{'objectPath'}) {
+ $constructor_args .= ", " if length($constructor_args) > 0;
+ $constructor_args .= "const gchar *dbus_object_path"
+ }
+
+ $constructor_defs .= $constructor_args;
+ $constructor_defs .= ");\n";
my $method_defs = "";
+ $method_defs .= "const gchar *{\$object}_get_dbus_object_path({\$Object} *self);\n" unless defined $node->{'objectPath'};
+ $method_defs .= "\n" if length($method_defs) > 0;
+
for my $method (sort keys %{$node->{$intf}{'methods'}}) {
my @a = $method =~ /([A-Z]+[a-z]*)/g;
my %m = %{$node->{$intf}{'methods'}{$method}};
my $in_args = join ', ', (map "const ".get_g_type($_->{'type'}).$_->{'name'}, @{$m{'args'}});
- if (defined $m{'flag'} && $m{'flag'} eq 'async') {
- $method_defs .=
- "void {\$object}_".(join '_', (map lc $_, @a))."_begin({\$Object} *self, void (*AsyncNotifyFunc)(gpointer data), gpointer data".
- ($in_args eq '' ? "" : ", $in_args").");\n".
- get_g_type($m{'ret'})."{\$object}_".(join '_', (map lc $_, @a))."_end({\$Object} *self, GError **error);\n";
- } else {
- $method_defs .=
- get_g_type($m{'ret'})."{\$object}_".(join '_', (map lc $_, @a))."({\$Object} *self, ".
- ($in_args eq '' ? "" : "$in_args, ")."GError **error);\n";
- }
+
+ $method_defs .=
+ (is_const_type($m{'ret'}) eq 1 ? "const " : "").get_g_type($m{'ret'})."{\$object}_".(join '_', (map lc $_, @a))."({\$Object} *self, ".
+ ($in_args eq '' ? "" : "$in_args, ")."GError **error);\n";
}
- $method_defs .= "\n";
-
- $method_defs .= "const gchar *{\$object}_get_dbus_object_path({\$Object} *self);\n" unless defined $node->{'objectPath'};
+
+ $method_defs .= "\n" if %{$node->{$intf}{'methods'}};
+
+ # Add Properties interface definitions
+ if(keys(%{$node->{$intf}{'properties'}}) > 0) {
+ $method_defs .= "GVariant *{\$object}_get_properties({\$Object} *self, GError **error);\n";
+ $method_defs .= "void {\$object}_set_property({\$Object} *self, const gchar *name, const GVariant *value, GError **error);\n";
+ $method_defs .= "\n";
+ }
+
for my $property (sort keys %{$node->{$intf}{'properties'}}) {
my @a = $property =~ /([A-Z]+[a-z]*)/g;
my %p = %{$node->{$intf}{'properties'}{$property}};
- $method_defs .= "const ".get_g_type($p{'type'})."{\$object}_get_".(join '_', (map lc $_, @a))."({\$Object} *self);\n";
- $method_defs .= "void {\$object}_set_".(join '_', (map lc $_, @a))."({\$Object} *self, const ".get_g_type($p{'type'})."value);\n" if $p{'mode'} eq 'readwrite';
+ # If the property is named 'Type', rename it to something else as it will conflict with GLib's 'Type' property
+ if($property =~ /^type$/i) {
+ my @i_name = $obj =~ /([A-Z]+[a-z]*)/g;
+ my @new_name = ($i_name[-1], @a);
+ $method_defs .= "// This has been renamed because '{\$object}_get_type' is already used by GLib\n";
+ if ($p{'mode'} eq 'readwrite' or $p{'mode'} eq 'readonly' or $p{'mode'} eq 'read/write') {
+ $method_defs .= (is_const_type($p{'type'}) eq 1 ? "const " : "").get_g_type($p{'type'})."{\$object}_get_".(join '_', (map lc $_, @new_name))."({\$Object} *self, GError **error);\n";
+ }
+ if ($p{'mode'} eq 'readwrite' or $p{'mode'} eq 'writeonly' or $p{'mode'} eq 'read/write') {
+ $method_defs .= "void {\$object}_set_".(join '_', (map lc $_, @new_name))."({\$Object} *self, const ".get_g_type($p{'type'})."value, GError **error);\n";
+ }
+ } else {
+ if ($p{'mode'} eq 'readwrite' or $p{'mode'} eq 'readonly' or $p{'mode'} eq 'read/write') {
+ $method_defs .= (is_const_type($p{'type'}) eq 1 ? "const " : "").get_g_type($p{'type'})."{\$object}_get_".(join '_', (map lc $_, @a))."({\$Object} *self, GError **error);\n";
+ }
+ if ($p{'mode'} eq 'readwrite' or $p{'mode'} eq 'writeonly' or $p{'mode'} eq 'read/write') {
+ $method_defs .= "void {\$object}_set_".(join '_', (map lc $_, @a))."({\$Object} *self, const ".get_g_type($p{'type'})."value, GError **error);\n";
+ }
+ }
}
$method_defs =~ s/\s+$//s;
my $output = "$HEADER\n$HEADER_TEMPLATE\n";
$output =~ s/{DBUS_OBJECT_DEFS}/$dbus_object_defs/;
+ $output =~ s/{CONSTRUCTOR_DEFS}/$constructor_defs/;
+ if (scalar keys %{$node->{$intf}{'methods'}} > 0 or scalar keys %{$node->{$intf}{'properties'}} > 0) {
+ $output =~ s/\{IF_METHODS\}\s+(.+?)\s+\{FI_METHODS\}/$1/gs;
+ } else {
+ $output =~ s/\s+\{IF_METHODS\}.+?\{FI_METHODS\}//gs;
+ }
$output =~ s/{METHOD_DEFS}/$method_defs/;
$output =~ s/{\$OBJECT}/$obj_uc/g;
$output =~ s/{\$Object}/$obj/g;
@@ -326,204 +478,104 @@ sub generate_source {
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-
-#include <string.h>
-
+#include <gio/gio.h>
#include <glib.h>
-#include <dbus/dbus-glib.h>
+#include <string.h>
#include "../dbus-common.h"
-#include "../marshallers.h"
+#include "../properties.h"
#include "{\$object}.h"
#define {\$OBJECT}_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), {\$OBJECT}_TYPE, {\$Object}Private))
struct _{\$Object}Private {
- DBusGProxy *dbus_g_proxy;
-
- /* Introspection data */
- DBusGProxy *introspection_g_proxy;
- gchar *introspection_xml;
-
- {IF_PROPERTIES_EXT}
- /* Properties */
- {PRIV_PROPERTIES}
- {FI_PROPERTIES_EXT}
-
- {IF_ASYNC_CALLS}
- /* Async calls */
- {PRIV_ASYNC_CALLS}
- {FI_ASYNC_CALLS}
+ GDBusProxy *proxy;
+ {IF_PROPERTIES}
+ Properties *properties;
+ {FI_PROPERTIES}
+ {IF_NO_OBJECT_PATH}
+ gchar *object_path;
+ {FI_NO_OBJECT_PATH}
};
-G_DEFINE_TYPE({\$Object}, {\$object}, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE({\$Object}, {\$object}, G_TYPE_OBJECT);
-{IF_PROPERTIES}
enum {
PROP_0,
-
- {ENUM_PROPERTIES}
+{CONSTRUCTOR_PROPERTIES}
};
static void _{\$object}_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
static void _{\$object}_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
-{FI_PROPERTIES}
-
-{IF_SIGNALS}
-enum {
- {ENUM_SIGNALS},
-
- LAST_SIGNAL
-};
-
-static guint signals[LAST_SIGNAL] = {0};
-{SIGNALS_HANDLERS_DEF}
-{FI_SIGNALS}
+static void _{\$object}_create_gdbus_proxy({\$Object} *self, const gchar *dbus_service_name, const gchar *dbus_object_path, GError **error);
static void {\$object}_dispose(GObject *gobject)
{
{\$Object} *self = {\$OBJECT}(gobject);
- {IF_SIGNALS}
- /* DBus signals disconnection */
- {SIGNALS_DISCONNECTION}
- {FI_SIGNALS}
-
+ /* Proxy free */
+ g_clear_object (&self->priv->proxy);
{IF_PROPERTIES_EXT}
/* Properties free */
- {PROPERTIES_FREE}
+ g_clear_object(&self->priv->properties);
{FI_PROPERTIES_EXT}
-
- /* Proxy free */
- g_object_unref(self->priv->dbus_g_proxy);
-
- /* Introspection data free */
- g_free(self->priv->introspection_xml);
- g_object_unref(self->priv->introspection_g_proxy);
-
+ {IF_NO_OBJECT_PATH}
+ /* Object path free */
+ g_free(self->priv->object_path);
+ {FI_NO_OBJECT_PATH}
/* Chain up to the parent class */
G_OBJECT_CLASS({\$object}_parent_class)->dispose(gobject);
}
+static void {\$object}_finalize (GObject *gobject)
+{
+ {\$Object} *self = {\$OBJECT}(gobject);
+ G_OBJECT_CLASS({\$object}_parent_class)->finalize(gobject);
+}
+
static void {\$object}_class_init({\$Object}Class *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
gobject_class->dispose = {\$object}_dispose;
- g_type_class_add_private(klass, sizeof({\$Object}Private));
-
- {IF_PROPERTIES}
/* Properties registration */
- GParamSpec *pspec;
+ GParamSpec *pspec = NULL;
gobject_class->get_property = _{\$object}_get_property;
gobject_class->set_property = _{\$object}_set_property;
-
- {PROPERTIES_REGISTRATION}
- {FI_PROPERTIES}
-
- {IF_SIGNALS}
- /* Signals registation */
- {SIGNALS_REGISTRATION}
- {FI_SIGNALS}
+
+ {IF_NO_OBJECT_PATH}
+ /* object DBusObjectPath [readwrite, construct only] */
+ pspec = g_param_spec_string("DBusObjectPath", "dbus_object_path", "{\$Object} D-Bus object path", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
+ g_object_class_install_property(gobject_class, PROP_DBUS_OBJECT_PATH, pspec);
+ {FI_NO_OBJECT_PATH}
+ if (pspec)
+ g_param_spec_unref(pspec);
}
static void {\$object}_init({\$Object} *self)
{
- self->priv = {\$OBJECT}_GET_PRIVATE(self);
-
- /* DBusGProxy init */
- self->priv->dbus_g_proxy = NULL;
-
- {IF_ASYNC_CALLS}
- /* Async calls init */
- {PRIV_ASYNC_CALLS_INIT}
- {FI_ASYNC_CALLS}
-
+ self->priv = {\$object}_get_instance_private (self);
+ self->priv->proxy = NULL;
+ {IF_PROPERTIES}
+ self->priv->properties = NULL;
+ {FI_PROPERTIES}
+ {IF_NO_OBJECT_PATH}
+ self->priv->object_path = NULL;
+ {FI_NO_OBJECT_PATH}
g_assert({\$conn} != NULL);
-
- {IF_INIT}
- GError *error = NULL;
-
- /* Getting introspection XML */
- self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name({\$conn}, {DBUS_SERVICE_NAME}, {\$OBJECT}_DBUS_PATH, "org.freedesktop.DBus.Introspectable");
- self->priv->introspection_xml = NULL;
- if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) {
- g_critical("%s", error->message);
- }
- g_assert(error == NULL);
-
- gchar *check_intf_regex_str = g_strconcat("<interface name=\\"", {\$OBJECT}_DBUS_INTERFACE, "\\">", NULL);
- if (!g_regex_match_simple(check_intf_regex_str, self->priv->introspection_xml, 0, 0)) {
- g_critical("Interface \\"%s\\" does not exist in \\"%s\\"", {\$OBJECT}_DBUS_INTERFACE, {\$OBJECT}_DBUS_PATH);
- g_assert(FALSE);
- }
- g_free(check_intf_regex_str);
-
- self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name({\$conn}, {DBUS_SERVICE_NAME}, {\$OBJECT}_DBUS_PATH, {\$OBJECT}_DBUS_INTERFACE);
-
- {IF_SIGNALS}
- /* DBus signals connection */
-
- {SIGNALS_CONNECTION}
- {FI_SIGNALS}
-
- {IF_PROPERTIES_EXT}
- /* Properties init */
- {PROPERTIES_INIT}
- {FI_PROPERTIES_EXT}
- {FI_INIT}
-}
-
-{IF_POST_INIT}
-static void {\$object}_post_init({\$Object} *self, const gchar *dbus_object_path)
-{
- g_assert(dbus_object_path != NULL);
- g_assert(strlen(dbus_object_path) > 0);
- g_assert(self->priv->dbus_g_proxy == NULL);
-
- GError *error = NULL;
-
- /* Getting introspection XML */
- self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name({\$conn}, {DBUS_SERVICE_NAME}, dbus_object_path, "org.freedesktop.DBus.Introspectable");
- self->priv->introspection_xml = NULL;
- if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) {
- g_critical("%s", error->message);
- }
- g_assert(error == NULL);
-
- gchar *check_intf_regex_str = g_strconcat("<interface name=\\"", {\$OBJECT}_DBUS_INTERFACE, "\\">", NULL);
- if (!g_regex_match_simple(check_intf_regex_str, self->priv->introspection_xml, 0, 0)) {
- g_critical("Interface \\"%s\\" does not exist in \\"%s\\"", {\$OBJECT}_DBUS_INTERFACE, dbus_object_path);
- g_assert(FALSE);
- }
- g_free(check_intf_regex_str);
- self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name({\$conn}, {DBUS_SERVICE_NAME}, dbus_object_path, {\$OBJECT}_DBUS_INTERFACE);
-
- {IF_SIGNALS}
- /* DBus signals connection */
-
- {SIGNALS_CONNECTION}
- {FI_SIGNALS}
-
- {IF_PROPERTIES_EXT}
- /* Properties init */
- {PROPERTIES_INIT}
- {FI_PROPERTIES_EXT}
+{CONSTRUCTOR_CALL}
}
-{FI_POST_INIT}
-{IF_PROPERTIES}
static void _{\$object}_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
{
{\$Object} *self = {\$OBJECT}(object);
switch (property_id) {
- {GET_PROPERTIES}
-
+{CONSTRUCTOR_GETTERS}
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
break;
@@ -536,31 +588,48 @@ static void _{\$object}_set_property(GObject *object, guint property_id, const G
GError *error = NULL;
switch (property_id) {
- {SET_PROPERTIES}
-
+{CONSTRUCTOR_SETTERS}
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
break;
}
- if (error != NULL) {
+ if (error != NULL)
g_critical("%s", error->message);
- }
+
g_assert(error == NULL);
}
-{FI_PROPERTIES}
-{IF_ASYNC_CALLS}
-static void {\$object}_async_notify_callback(DBusGProxy *proxy, DBusGProxyCall *call, gpointer data)
+/* Constructor */
+{CONSTRUCTOR}
+/* Private DBus proxy creation */
+static void _{\$object}_create_gdbus_proxy({\$Object} *self, const gchar *dbus_service_name, const gchar *dbus_object_path, GError **error)
{
- gpointer *p = data;
- void (*AsyncNotifyFunc)(gpointer data) = p[0];
- (*AsyncNotifyFunc)(p[1]);
- g_free(p);
+ g_assert({\$OBJECT}_IS(self));
+ self->priv->proxy = g_dbus_proxy_new_sync({\$conn}, G_DBUS_PROXY_FLAGS_NONE, NULL, dbus_service_name, dbus_object_path, {\$OBJECT}_DBUS_INTERFACE, NULL, error);
+
+ if(self->priv->proxy == NULL)
+ return;
+
+ {IF_PROPERTIES}
+ self->priv->properties = g_object_new(PROPERTIES_TYPE, "DBusType", {\$dbus_type}, "DBusServiceName", dbus_service_name, "DBusObjectPath", dbus_object_path, NULL);
+ g_assert(self->priv->properties != NULL);
+ {FI_PROPERTIES}
}
-{FI_ASYNC_CALLS}
+{IF_METHODS}
/* Methods */
+{FI_METHODS}
+
+{IF_NO_OBJECT_PATH}
+/* Get DBus object path */
+const gchar *{\$object}_get_dbus_object_path({\$Object} *self)
+{
+ g_assert({\$OBJECT}_IS(self));
+ g_assert(self->priv->proxy != NULL);
+ return g_dbus_proxy_get_object_path(self->priv->proxy);
+}
+{FI_NO_OBJECT_PATH}
{METHODS}
@@ -568,399 +637,323 @@ static void {\$object}_async_notify_callback(DBusGProxy *proxy, DBusGProxyCall *
/* Properties access methods */
{PROPERTIES_ACCESS_METHODS}
{FI_PROPERTIES}
-
-{IF_SIGNALS}
-/* Signals handlers */
-{SIGNALS_HANDLERS}
-{FI_SIGNALS}
EOT
my $intf = $node->{'intf'};
my $obj = exists $node->{'objectName'} ? $node->{'objectName'} : (split /\./, $intf)[-1];
+
+ # Prefix the Obex API calls to avoid conflicts with the BlueZ API
+ $obj = "Obex".$obj if $intf =~ /obex/i;
+
+ # Because the BlueZ 5 API uses version numbers at the end of the interfaces, trim off the version number
+ $obj =~ s/\d+$//;
+ # TODO: In the future, when BlueZ 5 includes mutiple versions of the same interface, we should distinguish them.
+
my $obj_lc = lc join('_', $obj =~ /([A-Z]+[a-z]*)/g);
my $obj_uc = uc join('_', $obj =~ /([A-Z]+[a-z]*)/g);
+
+ my $constructor_properties = "";
+ if(not exists $node->{'objectPath'} or not defined $node->{'objectPath'}) {
+ $constructor_properties .= "\tPROP_DBUS_OBJECT_PATH";
+ $constructor_properties .= " /* readwrite, construct only */\n";
+ }
+
+ my $constructor_call = "";
+ if(exists $node->{'serviceName'} and defined $node->{'serviceName'} and exists $node->{'objectPath'} and defined $node->{'objectPath'}) {
+ $constructor_call .=
+ "\tGError *error = NULL;\n".
+ "\t_{\$object}_create_gdbus_proxy(self, {\$OBJECT}_DBUS_SERVICE, {\$OBJECT}_DBUS_PATH, &error);\n".
+ "\tg_assert(error == NULL);\n";
+ }
+
+ my $constructor_getters = "";
+ if(not exists $node->{'objectPath'} or not defined $node->{'objectPath'}) {
+ $constructor_getters .= "\tcase PROP_DBUS_OBJECT_PATH:\n";
+ $constructor_getters .= "\t\tg_value_set_string(value, {\$object}_get_dbus_object_path(self));\n";
+ $constructor_getters .= "\t\tbreak;\n";
+ }
+
+ my $constructor_setters = "";
+ if(not exists $node->{'objectPath'} or not defined $node->{'objectPath'}) {
+ $constructor_setters .=
+ "\tcase PROP_DBUS_OBJECT_PATH:\n".
+ "\t\tself->priv->object_path = g_value_dup_string(value);\n";
+ $constructor_setters .=
+ "\t\t_{\$object}_create_gdbus_proxy(self, {\$OBJECT}_DBUS_SERVICE, self->priv->object_path, &error);\n";
+ $constructor_setters .= "\t\tbreak;\n";
+ }
+
+ my $constructor_def = "{\$Object} *{\$object}_new(";
+ my $constructor_args = "";
+
+ if(not exists $node->{'objectPath'} or not defined $node->{'objectPath'}) {
+ $constructor_args .= ", " if length($constructor_args) > 0;
+ $constructor_args .= "const gchar *dbus_object_path"
+ }
+
+ $constructor_def .= $constructor_args;
+ $constructor_def .=
+ ")\n".
+ "{\n".
+ "\treturn g_object_new({\$OBJECT}_TYPE, ";
+ if(not exists $node->{'objectPath'} or not defined $node->{'objectPath'}) {
+ $constructor_def .= "\"DBusObjectPath\", dbus_object_path, ";
+ }
+ $constructor_def .=
+ "NULL);\n".
+ "}\n";
+
+ my $dbus_type = "NULL";
+
+ if(exists $node->{'dbus_conn'} and defined $node->{'dbus_conn'}) {
+ $dbus_type = "\"system\"" if $node->{'dbus_conn'} eq 'system_conn';
+ $dbus_type = "\"session\"" if $node->{'dbus_conn'} eq 'session_conn';
+ } else {
+ die '$node->{\'dbus_conn\'} is undefined!';
+ }
my $methods = "";
- my $async_flag = 0;
- my $priv_async_calls = '';
- my $priv_async_calls_init = '';
+
for my $method (sort keys %{$node->{$intf}{'methods'}}) {
my @a = $method =~ /([A-Z]+[a-z]*)/g;
my %m = %{$node->{$intf}{'methods'}{$method}};
my $in_args = join ', ', (map "const ".get_g_type($_->{'type'}).$_->{'name'}, @{$m{'args'}});
- my $in_args2 = join ', ', (map get_g_type_name($_->{'type'}).", $_->{'name'}", @{$m{'args'}});
-
- if (defined $m{'flag'} && $m{'flag'} eq 'async') {
- $async_flag = 1;
- $priv_async_calls .= "\tDBusGProxyCall *".(join '_', (map lc $_, @a))."_call;\n";
- $priv_async_calls_init .= "\tself->priv->".(join '_', (map lc $_, @a))."_call = NULL;\n";
- $methods .=
- "/* $m{'decl'} */\n".
- "void {\$object}_".(join '_', (map lc $_, @a))."_begin({\$Object} *self, void (*AsyncNotifyFunc)(gpointer data), gpointer data".
- ($in_args eq '' ? "" : ", $in_args").")\n".
- "{\n".
- "\tg_assert({\$OBJECT}_IS(self));\n".
- "\tg_assert(self->priv->".(join '_', (map lc $_, @a))."_call == NULL);\n\n".
- "\tgpointer *p = g_new0(gpointer, 2);\n".
- "\tp[0] = AsyncNotifyFunc;\n".
- "\tp[1] = data;\n\n".
- "\tself->priv->".(join '_', (map lc $_, @a))."_call = dbus_g_proxy_begin_call(self->priv->dbus_g_proxy, \"$method\", (DBusGProxyCallNotify) {\$object}_async_notify_callback, p, NULL, ".($in_args2 eq '' ? "" : "$in_args2, ")."G_TYPE_INVALID);\n".
- "}\n\n".
- get_g_type($m{'ret'})."{\$object}_".(join '_', (map lc $_, @a))."_end({\$Object} *self, GError **error)\n".
- "{\n".
- "\tg_assert({\$OBJECT}_IS(self));\n".
- "\tg_assert(self->priv->".(join '_', (map lc $_, @a))."_call != NULL);\n\n".
- ($m{'ret'} eq 'void' ?
- "\tdbus_g_proxy_end_call(self->priv->dbus_g_proxy, self->priv->".(join '_', (map lc $_, @a))."_call, error, G_TYPE_INVALID);\n".
- "\tself->priv->".(join '_', (map lc $_, @a))."_call = NULL;\n"
- :
- "\t".get_g_type($m{'ret'})."ret = ".get_default_value(get_g_type($m{'ret'})).";\n".
- "\tdbus_g_proxy_end_call(self->priv->dbus_g_proxy, self->priv->".(join '_', (map lc $_, @a))."_call, error, ".($m{'ret'} eq 'void' ? "" : get_g_type_name($m{'ret'}).", &ret, ")."G_TYPE_INVALID);\n".
- "\tself->priv->".(join '_', (map lc $_, @a))."_call = NULL;\n\n".
- "\treturn ret;\n"
- ).
- "}\n\n";
- } else {
- my $method_def =
- get_g_type($m{'ret'})."{\$object}_".(join '_', (map lc $_, @a))."({\$Object} *self, ".
- ($in_args eq '' ? "" : "$in_args, ")."GError **error)";
- $methods .=
- "/* $m{'decl'} */\n".
+ my $method_def =
+ (is_const_type($m{'ret'}) eq 1 ? "const " : "").get_g_type($m{'ret'})."{\$object}_".(join '_', (map lc $_, @a))."({\$Object} *self, ".
+ ($in_args eq '' ? "" : "$in_args, ")."GError **error)";
+
+ $methods .=
+ "/* $m{'decl'} */\n".
"$method_def\n".
"{\n".
- "\tg_assert({\$OBJECT}_IS(self));\n\n".
- ($m{'ret'} eq 'void' ?
- "\tdbus_g_proxy_call(self->priv->dbus_g_proxy, \"$method\", error, ".($in_args2 eq '' ? "" : "$in_args2, ")."G_TYPE_INVALID, G_TYPE_INVALID);\n"
- :
- "\t".get_g_type($m{'ret'})."ret = ".get_default_value(get_g_type($m{'ret'})).";\n".
- "\tdbus_g_proxy_call(self->priv->dbus_g_proxy, \"$method\", error, ".($in_args2 eq '' ? "" : "$in_args2, ")."G_TYPE_INVALID, ".($m{'ret'} eq 'void' ? "" : get_g_type_name($m{'ret'}).", &ret, ")."G_TYPE_INVALID);\n\n".
- "\treturn ret;\n"
- ).
- "}\n\n";
- }
+ "\tg_assert({\$OBJECT}_IS(self));\n";
+
+ if($m{'ret'} eq 'void') {
+ $methods .= "\tg_dbus_proxy_call_sync(self->priv->proxy, \"$method\", ".($in_args eq '' ? "NULL" : generate_g_variant_params($m{'args'})).", G_DBUS_CALL_FLAGS_NONE, -1, NULL, error);\n";
+ } else {
+ $methods .= "\t".(is_const_type($m{'ret'}) eq 1 ? "const " : "").get_g_type($m{'ret'})."ret = ".get_default_value(get_g_type($m{'ret'})).";\n".
+ "\tGVariant *proxy_ret = g_dbus_proxy_call_sync(self->priv->proxy, \"$method\", ".($in_args eq '' ? "NULL" : generate_g_variant_params($m{'args'})).", G_DBUS_CALL_FLAGS_NONE, -1, NULL, error);\n".
+ "\tif (proxy_ret != NULL)\n".
+ "\t\treturn ".get_default_value(get_g_type($m{'ret'})).";\n".
+ "\tproxy_ret = g_variant_get_child_value(proxy_ret, 0);\n";
+
+ if($m{'ret'} eq 'boolean') {
+ $methods .= "\tret = g_variant_get_boolean(proxy_ret);\n";
+ } elsif($m{'ret'} eq 'byte') {
+ $methods .= "\tret = g_variant_get_byte(proxy_ret);\n";
+ } elsif($m{'ret'} eq 'int8') {
+ $methods .= "\tret = (gint8) g_variant_get_byte(proxy_ret);\n";
+ } elsif($m{'ret'} eq 'uint8') {
+ $methods .= "\tret = (guint8) g_variant_get_byte(proxy_ret);\n";
+ } elsif($m{'ret'} eq 'int16') {
+ $methods .= "\tret = g_variant_get_int16(proxy_ret);\n";
+ } elsif($m{'ret'} eq 'uint16') {
+ $methods .= "\tret = g_variant_get_uint16(proxy_ret);\n";
+ } elsif($m{'ret'} eq 'int32') {
+ $methods .= "\tret = g_variant_get_int32(proxy_ret);\n";
+ } elsif($m{'ret'} eq 'uint32') {
+ $methods .= "\tret = g_variant_get_uint32(proxy_ret);\n";
+ } elsif($m{'ret'} eq 'fd') {
+ $methods .= "\tret = g_variant_get_uint32(proxy_ret);\n";
+ } elsif($m{'ret'} eq 'int64') {
+ $methods .= "\tret = g_variant_get_int64(proxy_ret);\n";
+ } elsif($m{'ret'} eq 'uint64') {
+ $methods .= "\tret = g_variant_get_uint64(proxy_ret);\n";
+ } elsif($m{'ret'} eq 'float' || $m{'ret'} eq 'double') {
+ $methods .= "\tret = g_variant_get_double(proxy_ret);\n";
+ } elsif($m{'ret'} eq 'object' || $m{'ret'} eq 'string') {
+ $methods .= "\tret = g_variant_get_string(proxy_ret, NULL);\n";
+ } elsif($m{'ret'} eq 'variant') {
+ $methods .= "\tret = g_variant_get_variant(proxy_ret);\n";
+ } elsif($m{'ret'} eq 'array{string}') {
+ $methods .= "\tret = g_variant_get_strv(proxy_ret, NULL);\n";
+ } elsif($m{'ret'} eq 'array{object}') {
+ $methods .= "\tret = g_variant_get_objv(proxy_ret, NULL);\n";
+ } elsif($m{'ret'} eq 'array{byte}') {
+ $methods .= "\tret = (guint8 *) g_variant_get_fixed_array(proxy_ret, NULL, sizeof(guint8));\n";
+ } else {
+ # die "Unknown method return type: $m{'ret'}\n";
+
+ # Assume this is an array of variants or dictionaries or something else
+ $methods .= "\tret = g_variant_ref_sink(proxy_ret);\n";
+ }
+
+ $methods .= "\tg_variant_unref(proxy_ret);\n".
+ "\treturn ret;\n";
+ }
+
+ $methods .= "}\n\n";
}
- $priv_async_calls =~ s/^\t(.+?)\s+$/$1/s;
- $priv_async_calls_init =~ s/^\t(.+?)\s+$/$1/s;
- $methods =~ s/\s+$//s;
- my $enum_signals = "";
- my $signals_handlers_def = "";
- my $signals_registration = "";
- my $signals_connection = "";
- my $signals_disconnection = "";
- my $signals_handlers = "";
- for my $signal (sort keys %{$node->{$intf}{'signals'}}) {
- my @a = $signal =~ /([A-Z]+[a-z]*)/g;
- my %s = %{$node->{$intf}{'signals'}{$signal}};
-
- my $enum = join '_', (map uc $_, @a);
- my $handler_name = (join '_', (map lc $_, @a))."_handler";
- my $in_args = join ', ', map(($_->{'type'} ne 'dict' ? "const " : "").get_g_type($_->{'type'}).$_->{'name'}, @{$s{'args'}});
- my $handler = "static void $handler_name(DBusGProxy *dbus_g_proxy, ".($in_args eq '' ? "" : "$in_args, ")."gpointer data)";
-
- $signals_registration .=
- "\tsignals[$enum] = g_signal_new(\"$signal\",\n".
- "\t\t\tG_TYPE_FROM_CLASS(gobject_class),\n".
- "\t\t\tG_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,\n".
- "\t\t\t0, NULL, NULL,\n";
- # TODO: fix this
- my $arg_t = join '_', map($_->{'type'}, @{$s{'args'}});
- if ($arg_t eq '') {
- $signals_registration .=
- "\t\t\tg_cclosure_marshal_VOID__VOID,\n".
- "\t\t\tG_TYPE_NONE, 0);\n\n";
- } elsif ($arg_t eq 'object' || $arg_t eq 'string') {
- $signals_registration .=
- "\t\t\tg_cclosure_marshal_VOID__STRING,\n".
- "\t\t\tG_TYPE_NONE, 1, G_TYPE_STRING);\n\n";
- } elsif ($arg_t eq 'object_string_string') {
- $signals_registration .=
- "\t\t\tg_cclosure_bt_marshal_VOID__STRING_STRING_STRING,\n".
- "\t\t\tG_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);\n\n";
- } elsif ($arg_t eq 'string_variant') {
- $signals_registration .=
- "\t\t\tg_cclosure_bt_marshal_VOID__STRING_BOXED,\n".
- "\t\t\tG_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_VALUE);\n\n";
- } elsif ($arg_t eq 'string_dict') {
- $signals_registration .=
- "\t\t\tg_cclosure_bt_marshal_VOID__STRING_BOXED,\n".
- "\t\t\tG_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_HASH_TABLE);\n\n";
- } elsif ($arg_t eq 'object_boolean') {
- $signals_registration .=
- "\t\t\tg_cclosure_bt_marshal_VOID__STRING_BOOLEAN,\n".
- "\t\t\tG_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_BOOLEAN);\n\n";
- } elsif ($arg_t eq 'uint64') {
- $signals_registration .=
- "\t\t\tg_cclosure_bt_marshal_VOID__UINT64,\n".
- "\t\t\tG_TYPE_NONE, 1, G_TYPE_UINT64);\n\n";
- } elsif ($arg_t eq 'int32_int32') {
- $signals_registration .=
- "\t\t\tg_cclosure_bt_marshal_VOID__INT_INT,\n".
- "\t\t\tG_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);\n\n";
- } elsif ($arg_t eq 'string_string') {
- $signals_registration .=
- "\t\t\tg_cclosure_bt_marshal_VOID__STRING_STRING,\n".
- "\t\t\tG_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING);\n\n";
- } elsif ($arg_t eq 'string_string_uint64') {
- $signals_registration .=
- "\t\t\tg_cclosure_bt_marshal_VOID__STRING_STRING_UINT64,\n".
- "\t\t\tG_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT64);\n\n";
- } else {
- die "unknown signal arguments: $arg_t\n";
- }
+ $methods =~ s/\s+$//s;
- my $in_args2 = join ', ', (map get_g_type_name($_->{'type'}), @{$s{'args'}});
- $signals_connection .=
- "\t/* $s{'decl'} */\n".
- "\tdbus_g_proxy_add_signal(self->priv->dbus_g_proxy, \"$signal\", ".($in_args2 eq '' ? "" : "$in_args2, ")."G_TYPE_INVALID);\n".
- "\tdbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, \"$signal\", G_CALLBACK($handler_name), self, NULL);\n\n";
-
- $signals_disconnection .=
- "\tdbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, \"$signal\", G_CALLBACK($handler_name), self);\n";
-
- my $args = join ', ', map($_->{'name'}, @{$s{'args'}});
- $signals_handlers .= "$handler\n".
- "{\n".
- "\t{\$Object} *self = {\$OBJECT}(data);\n\n".
- ($handler_name eq 'property_changed_handler' ? "\t{PROPERTIES_CHANGED_HANDLER}\n\n" : "").
- "\tg_signal_emit(self, signals[$enum], 0".($args eq '' ? "" : ", $args").");\n".
- "}\n\n";
-
- $enum_signals .= "\t$enum,\n";
- $signals_handlers_def .= "$handler;\n";
- }
- $enum_signals =~ s/^\t(.+?),\s+$/$1/s;
- $signals_handlers_def =~ s/\s+$//s;
- $signals_registration =~ s/^\t(.+?)\s+$/$1/s;
- $signals_connection =~ s/^\t(.+?)\s+$/$1/s;
- $signals_disconnection =~ s/^\t(.+?)\s+$/$1/s;
- $signals_handlers =~ s/\s+$//s;
-
- my $priv_properties = "";
- my $enum_properties = "";
- my $properties_registration = "";
- my $get_properties = "";
- my $set_properties = "";
my $properties_access_methods = "";
- my $properties_init =
- "\tGHashTable *properties = {\$object}_get_properties(self, &error);\n".
- "\tif (error != NULL) {\n".
- "\t\tg_critical(\"%s\", error->message);\n".
- "\t}\n".
- "\tg_assert(error == NULL);\n".
- "\tg_assert(properties != NULL);\n\n";
- my $properties_free = "";
- my $properties_changed_handler = "\tif (g_strcmp0(name, ";
- unless (defined $node->{'objectPath'}) {
- $enum_properties .= "\tPROP_DBUS_OBJECT_PATH, /* readwrite, construct only */\n";
- $properties_registration .=
- "\t/* object DBusObjectPath [readwrite, construct only] */\n".
- "\tpspec = g_param_spec_string(\"DBusObjectPath\", \"dbus_object_path\", \"Adapter D-Bus object path\", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);\n".
- "\tg_object_class_install_property(gobject_class, PROP_DBUS_OBJECT_PATH, pspec);\n\n";
-
- $get_properties .=
- "\tcase PROP_DBUS_OBJECT_PATH:\n".
- "\t\tg_value_set_string(value, {\$object}_get_dbus_object_path(self));\n".
- "\t\tbreak;\n\n";
-
- $set_properties .=
- "\tcase PROP_DBUS_OBJECT_PATH:\n".
- "\t\t{\$object}_post_init(self, g_value_get_string(value));\n".
- "\t\tbreak;\n\n";
-
- $properties_access_methods .=
- "const gchar *{\$object}_get_dbus_object_path({\$Object} *self)\n".
- "{\n".
- "\tg_assert({\$OBJECT}_IS(self));\n\n".
- "\treturn dbus_g_proxy_get_path(self->priv->dbus_g_proxy);\n".
- "}\n\n";
+
+ if(keys(%{$node->{$intf}{'properties'}}) > 0) {
+ $properties_access_methods .=
+ "GVariant *{\$object}_get_properties({\$Object} *self, GError **error)\n".
+ "{\n".
+ "\tg_assert({\$OBJECT}_IS(self));\n".
+ "\tg_assert(self->priv->properties != NULL);\n".
+ "\treturn properties_get_all(self->priv->properties, {\$OBJECT}_DBUS_INTERFACE, error);\n".
+ "}\n".
+ "\n".
+ "void {\$object}_set_property({\$Object} *self, const gchar *name, const GVariant *value, GError **error)\n".
+ "{\n".
+ "\tg_assert({\$OBJECT}_IS(self));\n".
+ "\tg_assert(self->priv->properties != NULL);\n".
+ "\tproperties_set(self->priv->properties, {\$OBJECT}_DBUS_INTERFACE, name, value, error);\n".
+ "}\n".
+ "\n";
}
+
for my $property (sort keys %{$node->{$intf}{'properties'}}) {
my @a = $property =~ /([A-Z]+[a-z]*)/g;
my %p = %{$node->{$intf}{'properties'}{$property}};
- my $property_var = join '_', (map lc $_, @a);
+ # my $property_var = join '_', (map lc $_, @a);
+ my $property_var = '';
+
+ # If the property is named 'Type', rename it to something else as it will conflict with GLib's 'Type' property
+ if($property =~ /^type$/i) {
+ my @i_name = $obj =~ /([A-Z]+[a-z]*)/g;
+ my @new_name = ($i_name[-1], @a);
+ $property_var = join '_', (map lc $_, @new_name);
+ } else {
+ $property_var = join '_', (map lc $_, @a);
+ }
+
my $enum = "PROP_".(join '_', (map uc $_, @a));
my $property_get_method = "{\$object}_get_$property_var";
my $property_set_method = "{\$object}_set_$property_var";
- $priv_properties .= "\t".get_g_type($p{'type'})."$property_var;\n";
- $enum_properties .= "\t$enum, /* $p{'mode'} */\n";
- $properties_registration .= "\t/* $p{'decl'} */\n";
- $properties_init .= "\t/* $p{'decl'} */\n";
- $properties_access_methods .=
- "const ".get_g_type($p{'type'})."$property_get_method({\$Object} *self)\n".
- "{\n".
- "\tg_assert({\$OBJECT}_IS(self));\n\n".
- "\treturn self->priv->$property_var;\n".
- "}\n\n";
-
- $properties_changed_handler .= "\"$property\") == 0) {\n";
- $get_properties .= "\tcase $enum:\n";
- if ($p{'type'} eq 'string') {
- $properties_registration .= "\tpspec = g_param_spec_string(\"$property\", NULL, NULL, NULL, ".($p{'mode'} eq 'readonly' ? 'G_PARAM_READABLE' : 'G_PARAM_READWRITE').");\n";
- $properties_init .=
- "\tif (g_hash_table_lookup(properties, \"$property\")) {\n".
- "\t\tself->priv->$property_var = g_value_dup_string(g_hash_table_lookup(properties, \"$property\"));\n".
- "\t} else {\n".
- "\t\tself->priv->$property_var = g_strdup(\"undefined\");\n".
- "\t}\n";
- $get_properties .= "\t\tg_value_set_string(value, $property_get_method(self));\n";
- $properties_free .= "\tg_free(self->priv->$property_var);\n";
- $properties_changed_handler .=
- "\t\tg_free(self->priv->$property_var);\n".
- "\t\tself->priv->$property_var = g_value_dup_string(value);\n";
- } elsif ($p{'type'} eq 'object') {
- $properties_registration .= "\tpspec = g_param_spec_string(\"$property\", NULL, NULL, NULL, ".($p{'mode'} eq 'readonly' ? 'G_PARAM_READABLE' : 'G_PARAM_READWRITE').");\n";
- $properties_init .=
- "\tif (g_hash_table_lookup(properties, \"$property\")) {\n".
- "\t\tself->priv->$property_var = (gchar *) g_value_dup_boxed(g_hash_table_lookup(properties, \"$property\"));\n".
- "\t} else {\n".
- "\t\tself->priv->$property_var = g_strdup(\"undefined\");\n".
- "\t}\n";
- $get_properties .= "\t\tg_value_set_string(value, $property_get_method(self));\n";
- $properties_free .= "\tg_free(self->priv->$property_var);\n";
- $properties_changed_handler .=
- "\t\tg_free(self->priv->$property_var);\n".
- "\t\tself->priv->$property_var = (gchar *) g_value_dup_boxed(value);\n";
- } elsif ($p{'type'} eq 'array{object}') {
- $properties_registration .= "\tpspec = g_param_spec_boxed(\"$property\", NULL, NULL, G_TYPE_PTR_ARRAY, ".($p{'mode'} eq 'readonly' ? 'G_PARAM_READABLE' : 'G_PARAM_READWRITE').");\n";
- $properties_init .=
- "\tif (g_hash_table_lookup(properties, \"$property\")) {\n".
- "\t\tself->priv->$property_var = g_value_dup_boxed(g_hash_table_lookup(properties, \"$property\"));\n".
- "\t} else {\n".
- "\t\tself->priv->$property_var = g_ptr_array_new();\n".
- "\t}\n";
- $get_properties .= "\t\tg_value_set_boxed(value, $property_get_method(self));\n";
- $properties_free .= "\tg_ptr_array_unref(self->priv->$property_var);\n";
- $properties_changed_handler .=
- "\t\tg_ptr_array_unref(self->priv->$property_var);\n".
- "\t\tself->priv->$property_var = g_value_dup_boxed(value);\n";
- } elsif ($p{'type'} eq 'array{string}') {
- $properties_registration .= "\tpspec = g_param_spec_boxed(\"$property\", NULL, NULL, G_TYPE_STRV, ".($p{'mode'} eq 'readonly' ? 'G_PARAM_READABLE' : 'G_PARAM_READWRITE').");\n";
- $properties_init .=
- "\tif (g_hash_table_lookup(properties, \"$property\")) {\n".
- "\t\tself->priv->$property_var = (gchar **) g_value_dup_boxed(g_hash_table_lookup(properties, \"$property\"));\n".
- "\t} else {\n".
- "\t\tself->priv->$property_var = g_new0(char *, 1);\n".
- "\t\tself->priv->${property_var}[0] = NULL;\n".
- "\t}\n";
- $get_properties .= "\t\tg_value_set_boxed(value, $property_get_method(self));\n";
- $properties_free .= "\tg_strfreev(self->priv->$property_var);\n";
- $properties_changed_handler .=
- "\t\tg_strfreev(self->priv->$property_var);\n".
- "\t\tself->priv->$property_var = (gchar **) g_value_dup_boxed(value);\n";
- } elsif ($p{'type'} eq 'uint32') {
- $properties_registration .= "\tpspec = g_param_spec_uint(\"$property\", NULL, NULL, 0, 0xFFFFFFFF, 0, ".($p{'mode'} eq 'readonly' ? 'G_PARAM_READABLE' : 'G_PARAM_READWRITE').");\n";
- $properties_init .=
- "\tif (g_hash_table_lookup(properties, \"$property\")) {\n".
- "\t\tself->priv->$property_var = g_value_get_uint(g_hash_table_lookup(properties, \"$property\"));\n".
- "\t} else {\n".
- "\t\tself->priv->$property_var = 0;\n".
- "\t}\n";
- $get_properties .= "\t\tg_value_set_uint(value, $property_get_method(self));\n";
- $properties_changed_handler .= "\t\tself->priv->$property_var = g_value_get_uint(value);\n";
- } elsif ($p{'type'} eq 'uint64') {
- $properties_registration .= "\tpspec = g_param_spec_uint64(\"$property\", NULL, NULL, 0, 0xFFFFFFFFFFFFFFFF, 0, ".($p{'mode'} eq 'readonly' ? 'G_PARAM_READABLE' : 'G_PARAM_READWRITE').");\n";
- $properties_init .=
- "\tif (g_hash_table_lookup(properties, \"$property\")) {\n".
- "\t\tself->priv->$property_var = g_value_get_uint64(g_hash_table_lookup(properties, \"$property\"));\n".
- "\t} else {\n".
- "\t\tself->priv->$property_var = 0;\n".
- "\t}\n";
- $get_properties .= "\t\tg_value_set_uint64(value, $property_get_method(self));\n";
- $properties_changed_handler .= "\t\tself->priv->$property_var = g_value_get_uint64(value);\n";
- } elsif ($p{'type'} eq 'boolean') {
- $properties_registration .= "\tpspec = g_param_spec_boolean(\"$property\", NULL, NULL, FALSE, ".($p{'mode'} eq 'readonly' ? 'G_PARAM_READABLE' : 'G_PARAM_READWRITE').");\n";
- $properties_init .=
- "\tif (g_hash_table_lookup(properties, \"$property\")) {\n".
- "\t\tself->priv->$property_var = g_value_get_boolean(g_hash_table_lookup(properties, \"$property\"));\n".
- "\t} else {\n".
- "\t\tself->priv->$property_var = FALSE;\n".
- "\t}\n";
- $get_properties .= "\t\tg_value_set_boolean(value, $property_get_method(self));\n";
- $properties_changed_handler .= "\t\tself->priv->$property_var = g_value_get_boolean(value);\n";
- } elsif ($p{'type'} eq 'byte') {
- $properties_registration .= "\tpspec = g_param_spec_uchar(\"$property\", NULL, NULL, 0, 0xFF, 0, ".($p{'mode'} eq 'readonly' ? 'G_PARAM_READABLE' : 'G_PARAM_READWRITE').");\n";
- $properties_init .=
- "\tif (g_hash_table_lookup(properties, \"$property\")) {\n".
- "\t\tself->priv->$property_var = g_value_get_uchar(g_hash_table_lookup(properties, \"$property\"));\n".
- "\t} else {\n".
- "\t\tself->priv->$property_var = 0;\n".
- "\t}\n";
- $get_properties .= "\t\tg_value_set_uchar(value, $property_get_method(self));\n";
- $properties_changed_handler .= "\t\tself->priv->$property_var = g_value_get_uchar(value);\n";
- } else {
- die "unknown property type: $p{'type'}\n";
- }
- $properties_registration .= "\tg_object_class_install_property(gobject_class, $enum, pspec);\n\n";
- $properties_init .= "\n";
- $get_properties .= "\t\tbreak;\n\n";
- $properties_changed_handler .= "\t} else if (g_strcmp0(name, ";
-
- if ($p{'mode'} eq 'readwrite') {
- $set_properties .=
- "\tcase $enum:\n".
- "\t\t{\$object}_set_property(self, \"$property\", value, &error);\n".
- "\t\tbreak;\n\n";
-
+ if ($p{'mode'} eq 'readwrite' or $p{'mode'} eq 'readonly' or $p{'mode'} eq 'read/write') {
+ $properties_access_methods .=
+ (is_const_type($p{'type'}) eq 1 ? "const " : "").get_g_type($p{'type'})."$property_get_method({\$Object} *self, GError **error)\n".
+ "{\n".
+ "\tg_assert({\$OBJECT}_IS(self));\n".
+ "\tg_assert(self->priv->properties != NULL);\n".
+ "\tGVariant *prop = properties_get(self->priv->properties, {\$OBJECT}_DBUS_INTERFACE, \"$property\", error);\n".
+ "\tif(prop == NULL)\n".
+ "\t\treturn ".get_default_value(get_g_type($p{'type'})).";\n";
+
+ if($p{'type'} eq 'boolean') {
+ $properties_access_methods .= "\tgboolean ret = g_variant_get_boolean(prop);\n";
+ } elsif($p{'type'} eq 'byte') {
+ $properties_access_methods .= "\tguchar ret = g_variant_get_byte(prop);\n";
+ } elsif($p{'type'} eq 'int8') {
+ $properties_access_methods .= "\tgint8 ret = g_variant_get_byte(prop);\n";
+ } elsif($p{'type'} eq 'uint8') {
+ $properties_access_methods .= "\tguint8 ret = g_variant_get_byte(prop);\n";
+ } elsif($p{'type'} eq 'int16') {
+ $properties_access_methods .= "\tgint16 ret = g_variant_get_int16(prop);\n";
+ } elsif($p{'type'} eq 'uint16') {
+ $properties_access_methods .= "\tguint16 ret = g_variant_get_uint16(prop);\n";
+ } elsif($p{'type'} eq 'int32') {
+ $properties_access_methods .= "\tgint32 ret = g_variant_get_int32(prop);\n";
+ } elsif($p{'type'} eq 'uint32') {
+ $properties_access_methods .= "\tguint32 ret = g_variant_get_uint32(prop);\n";
+ } elsif($p{'type'} eq 'fd') {
+ $properties_access_methods .= "\tguint32 ret = g_variant_get_uint32(prop);\n";
+ } elsif($p{'type'} eq 'int64') {
+ $properties_access_methods .= "\tgint64 ret = g_variant_get_int64(prop);\n";
+ } elsif($p{'type'} eq 'uint64') {
+ $properties_access_methods .= "\tguint64 ret = g_variant_get_uint64(prop);\n";
+ } elsif($p{'type'} eq 'float' || $p{'type'} eq 'double') {
+ $properties_access_methods .= "\tgdouble ret = g_variant_get_double(prop);\n";
+ } elsif($p{'type'} eq 'object' || $p{'type'} eq 'string') {
+ $properties_access_methods .= "\tconst gchar *ret = g_variant_get_string(prop, NULL);\n";
+ } elsif($p{'type'} eq 'variant') {
+ $properties_access_methods .= "\tGVariant *ret = g_variant_get_variant(prop);\n";
+ } elsif($p{'type'} eq 'array{string}') {
+ $properties_access_methods .= "\tconst gchar **ret = g_variant_get_strv(prop, NULL);\n";
+ } elsif($p{'type'} eq 'array{object}') {
+ $properties_access_methods .= "\tconst gchar **ret = g_variant_get_objv(prop, NULL);\n";
+ } elsif($p{'type'} eq 'array{byte}') {
+ $properties_access_methods .= "\tguint8 *ret = (guint8 *) g_variant_get_fixed_array(prop, NULL, sizeof(guint8));\n";
+ } else {
+ # die "Unknown property return type: $p{'type'}\n";
+
+ # Assume this is an array of variants or dictionaries or something else
+ $properties_access_methods .= "\tGVariant *ret = g_variant_ref_sink(prop);\n";
+ }
+
+ $properties_access_methods .=
+ "\tg_variant_unref(prop);\n".
+ "\treturn ret;\n".
+ "}\n\n";
+ }
+
+ if ($p{'mode'} eq 'readwrite' or $p{'mode'} eq 'writeonly' or $p{'mode'} eq 'read/write') {
$properties_access_methods .=
- "void $property_set_method({\$Object} *self, const ".get_g_type($p{'type'})."value)\n".
+ "void $property_set_method({\$Object} *self, const ".get_g_type($p{'type'})."value, GError **error)\n".
"{\n".
- "\tg_assert({\$OBJECT}_IS(self));\n\n".
- "\tGError *error = NULL;\n\n".
- "\tGValue t = {0};\n".
- "\tg_value_init(&t, ".get_g_type_name($p{'type'}).");\n".
- "\tg_value_set_".
- ($p{'type'} eq 'string' ?
- "string" : (
- $p{'type'} eq 'uint32' ?
- "uint" : (
- $p{'type'} eq 'boolean' ?
- "boolean" :
- die "unknown setter type: $p{'type'}\n"
- )
- ))."(&t, value);\n".
- "\t{\$object}_set_property(self, \"$property\", &t, &error);\n".
- "\tg_value_unset(&t);\n\n".
- "\tif (error != NULL) {\n".
- "\t\tg_critical(\"%s\", error->message);\n".
- "\t}\n".
- "\tg_assert(error == NULL);\n".
+ "\tg_assert({\$OBJECT}_IS(self));\n".
+ "\tg_assert(self->priv->properties != NULL);\n".
+ "\tproperties_set(self->priv->properties, {\$OBJECT}_DBUS_INTERFACE, \"$property\", ";
+
+ if($p{'type'} eq 'boolean') {
+ $properties_access_methods .= "g_variant_new_boolean(value)";
+ } elsif($p{'type'} eq 'byte') {
+ $properties_access_methods .= "g_variant_new_byte(value)";
+ } elsif($p{'type'} eq 'uint8') {
+ $properties_access_methods .= "g_variant_new_byte(value)";
+ } elsif($p{'type'} eq 'int16') {
+ $properties_access_methods .= "g_variant_new_int16(value)";
+ } elsif($p{'type'} eq 'uint16') {
+ $properties_access_methods .= "g_variant_new_uint16(value)";
+ } elsif($p{'type'} eq 'int32') {
+ $properties_access_methods .= "g_variant_new_int32(value)";
+ } elsif($p{'type'} eq 'uint32') {
+ $properties_access_methods .= "g_variant_new_uint32(value)";
+ } elsif($p{'type'} eq 'int64') {
+ $properties_access_methods .= "g_variant_new_int64(value)";
+ } elsif($p{'type'} eq 'uint64') {
+ $properties_access_methods .= "g_variant_new_uint64(value)";
+ } elsif($p{'type'} eq 'double') {
+ $properties_access_methods .= "g_variant_new_double(value)";
+ } elsif($p{'type'} eq 'object') {
+ $properties_access_methods .= "g_variant_new_object_path(value)";
+ } elsif($p{'type'} eq 'string') {
+ $properties_access_methods .= "g_variant_new_string(value)";
+ } elsif($p{'type'} eq 'variant') {
+ $properties_access_methods .= "g_variant_new_variant(value)";
+ } elsif($p{'type'} eq 'array{string}') {
+ $properties_access_methods .= "g_variant_new_strv(value, -1)";
+ } elsif($p{'type'} eq 'array{object}') {
+ $properties_access_methods .= "g_variant_new_objv(value, -1)";
+ } elsif($p{'type'} =~ /^dict/) {
+ $properties_access_methods .= "value";
+ } else {
+ die "Unknown object type for access property: $p{'type'}\n";
+ }
+
+ $properties_access_methods .=
+ ", error);\n".
"}\n\n";
}
}
- $properties_init .=
- "\tg_hash_table_unref(properties);\n\n";
-
- $priv_properties =~ s/^\t(.+?)\s+$/$1/s;
- $enum_properties =~ s/^\t(.+), (\/\* .+? \*\/)\s+$/$1 $2/s;
- $properties_registration =~ s/^\t(.+?)\s+$/$1/s;
- $properties_init =~ s/^\t(.+?)\s+$/$1/s;
- $get_properties =~ s/^\t(.+?)\s+$/$1/s;
- $set_properties =~ s/^\t(.+?)\s+$/$1/s;
- $properties_access_methods =~ s/\s+$//s;
- $properties_free =~ s/^\t(.+?)\s+$/$1/s;
- $properties_changed_handler =~ s/^\t(.+?) else if \(g_strcmp0\(name, $/$1/s;
- $properties_free ="/* none */" if $properties_free eq '';
+ $properties_access_methods =~ s/\s+$//s;
my $output = "$HEADER\n$SOURCE_TEMPLATE";
if (defined $node->{'objectPath'}) {
$output =~ s/\{IF_INIT\}\s+(.+?)\s+\{FI_INIT\}/$1/gs;
$output =~ s/\s+\{IF_POST_INIT\}.+?\{FI_POST_INIT\}\s+/\n\n/gs;
+ $output =~ s/\s+\{IF_NO_OBJECT_PATH\}.+?\{FI_NO_OBJECT_PATH\}//gs;
} else {
$output =~ s/\{IF_POST_INIT\}\s+(.+?)\s+\{FI_POST_INIT\}/$1/gs;
$output =~ s/\s+\{IF_INIT\}.+?\{FI_INIT\}\s+/\n/gs;
+ $output =~ s/\{IF_NO_OBJECT_PATH\}\s+(.+?)\s+\{FI_NO_OBJECT_PATH\}/$1/gs;
}
if (scalar keys %{$node->{$intf}{'signals'}} > 0) {
$output =~ s/\{IF_SIGNALS\}\s+(.+?)\s+\{FI_SIGNALS\}/$1/gs;
} else {
$output =~ s/\s+\{IF_SIGNALS\}.+?\{FI_SIGNALS\}//gs;
}
- if (scalar keys %{$node->{$intf}{'properties'}} > 0 || !defined $node->{'objectPath'}) {
+ if (scalar keys %{$node->{$intf}{'properties'}} > 0) {
$output =~ s/\{IF_PROPERTIES\}\s+(.+?)\s+\{FI_PROPERTIES\}/$1/gs;
} else {
$output =~ s/\s+\{IF_PROPERTIES\}.+?\{FI_PROPERTIES\}//gs;
@@ -970,30 +963,19 @@ EOT
} else {
$output =~ s/\s+\{IF_PROPERTIES_EXT\}.+?\{FI_PROPERTIES_EXT\}//gs;
}
- if ($async_flag == 1) {
- $output =~ s/\{IF_ASYNC_CALLS\}\s+(.+?)\s+\{FI_ASYNC_CALLS\}/$1/gs;
+ if (scalar keys %{$node->{$intf}{'methods'}} > 0 or not defined $node->{'serviceName'} or not defined $node->{'objectPath'}) {
+ $output =~ s/\{IF_METHODS\}\s+(.+?)\s+\{FI_METHODS\}/$1/gs;
} else {
- $output =~ s/\s+\{IF_ASYNC_CALLS\}.+?\{FI_ASYNC_CALLS\}//gs;
+ $output =~ s/\s+\{IF_METHODS\}.+?\{FI_METHODS\}\n//gs;
}
- $output =~ s/{DBUS_SERVICE_NAME}/"$node->{'serviceName'}"/g;
$output =~ s/{\$conn}/$node->{'dbus_conn'}/g;
- $output =~ s/{ENUM_SIGNALS}/$enum_signals/;
- $output =~ s/{SIGNALS_HANDLERS_DEF}/$signals_handlers_def/;
- $output =~ s/{SIGNALS_REGISTRATION}/$signals_registration/;
- $output =~ s/{SIGNALS_CONNECTION}/$signals_connection/;
- $output =~ s/{SIGNALS_DISCONNECTION}/$signals_disconnection/;
- $output =~ s/{SIGNALS_HANDLERS}/$signals_handlers/;
- $output =~ s/{PRIV_PROPERTIES}/$priv_properties/;
- $output =~ s/{ENUM_PROPERTIES}/$enum_properties/;
- $output =~ s/{PROPERTIES_REGISTRATION}/$properties_registration/;
- $output =~ s/{PROPERTIES_INIT}/$properties_init/;
- $output =~ s/{PROPERTIES_FREE}/$properties_free/;
- $output =~ s/{GET_PROPERTIES}/$get_properties/;
- $output =~ s/{SET_PROPERTIES}/$set_properties/;
+ $output =~ s/{CONSTRUCTOR_PROPERTIES}/$constructor_properties/;
+ $output =~ s/{CONSTRUCTOR_CALL}/$constructor_call/;
+ $output =~ s/{CONSTRUCTOR_GETTERS}/$constructor_getters/;
+ $output =~ s/{CONSTRUCTOR_SETTERS}/$constructor_setters/;
+ $output =~ s/{CONSTRUCTOR}/$constructor_def/;
+ $output =~ s/{\$dbus_type}/$dbus_type/;
$output =~ s/{PROPERTIES_ACCESS_METHODS}/$properties_access_methods/;
- $output =~ s/{PROPERTIES_CHANGED_HANDLER}/$properties_changed_handler/;
- $output =~ s/{PRIV_ASYNC_CALLS}/$priv_async_calls/;
- $output =~ s/{PRIV_ASYNC_CALLS_INIT}/$priv_async_calls_init/;
$output =~ s/{METHODS}/$methods/;
$output =~ s/{\$OBJECT}/$obj_uc/g;
$output =~ s/{\$Object}/$obj/g;
@@ -1010,4 +992,4 @@ EOT
my $data = parse_doc_api($ARGV[1], $ARGV[2]);
print generate_header($data) if $ARGV[0] eq '-header';
-print generate_source($data) if $ARGV[0] eq '-source';
+print generate_source($data) if $ARGV[0] eq '-source'; \ No newline at end of file
diff --git a/contrib/generate-bluez-gobjects.sh b/contrib/generate-bluez-gobjects.sh
index 540f6e1..2a6aa4c 100755
--- a/contrib/generate-bluez-gobjects.sh
+++ b/contrib/generate-bluez-gobjects.sh
@@ -2,35 +2,249 @@
# BlueZ API
-API_VERSION=4.96
+API_VERSION=5.20-fixed
# adapter-api.txt
-./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}-fixed/adapter-api.txt > ../src/lib/bluez/adapter.h
-./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}-fixed/adapter-api.txt > ../src/lib/bluez/adapter.c
+echo "adapter-api.txt"
+echo "Generating adapter header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/adapter-api.txt > out/adapter.h
+echo "Generating adapter source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/adapter-api.txt > out/adapter.c
-# audio-api.txt
-./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}-fixed/audio-api.txt > ../src/lib/bluez/audio.h
-./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}-fixed/audio-api.txt > ../src/lib/bluez/audio.c
+# agent-api.txt
+echo "agent-api.txt"
+echo "Generating agent manager header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/agent-api.txt 1 > out/agent_manager.h
+echo "Generating agent manager source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/agent-api.txt 1 > out/agent_manager.c
+
+# echo "Generating agent header"
+# ./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/agent-api.txt 2 > out/agent.h
+# echo "Generating agent source"
+# ./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/agent-api.txt 2 > out/agent.c
+
+# alert-api.txt
+echo "alert-api.txt"
+echo "Generating alert header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/alert-api.txt 1 > out/alert.h
+echo "Generating alert source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/alert-api.txt 1 > out/alert.c
+
+echo "Generating alert agent header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/alert-api.txt 2 > out/alert_agent.h
+echo "Generating alert agent source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/alert-api.txt 2 > out/alert_agent.c
+
+# cyclingspeed-api.txt
+echo "cyclingspeed-api.txt"
+echo "Generating cycling speed manager header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/cyclingspeed-api.txt 1 > out/cycling_speed_manager.h
+echo "Generating cycling speed manager source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/cyclingspeed-api.txt 1 > out/cycling_speed_manager.c
+
+echo "Generating cycling speed header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/cyclingspeed-api.txt 2 > out/cycling_speed.h
+echo "Generating cycling speed source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/cyclingspeed-api.txt 2 > out/cycling_speed.c
+
+# echo "Generating cycling watcher header"
+# ./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/cyclingspeed-api.txt 3 > out/cycling_speed_watcher.h
+# echo "Generating cycling watcher source"
+# ./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/cyclingspeed-api.txt 3 > out/cycling_speed_watcher.c
# device-api.txt
-./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}-fixed/device-api.txt > ../src/lib/bluez/device.h
-./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}-fixed/device-api.txt > ../src/lib/bluez/device.c
+echo "device-api.txt"
+echo "Generating device header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/device-api.txt > out/device.h
+echo "Generating device source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/device-api.txt > out/device.c
+
+# health-api.txt
+echo "health-api.txt"
+echo "Generating health manager header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/health-api.txt 1 > out/health_manager.h
+echo "Generating health manager source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/health-api.txt 1 > out/health_manager.c
+
+echo "Generating health device header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/health-api.txt 2 > out/health_device.h
+echo "Generating health device source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/health-api.txt 2 > out/health_device.c
+
+echo "Generating health channel header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/health-api.txt 3 > out/health_channel.h
+echo "Generating health channel source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/health-api.txt 3 > out/health_channel.c
-# input-api.txt
-./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}-fixed/input-api.txt > ../src/lib/bluez/input.h
-./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}-fixed/input-api.txt > ../src/lib/bluez/input.c
+# heartrate-api.txt
+echo "heartrate-api.txt"
+echo "Generating heart rate manager header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/heartrate-api.txt 1 > out/heart_rate_manager.h
+echo "Generating heart rate manager source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/heartrate-api.txt 1 > out/heart_rate_manager.c
-# manager-api.txt
-./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}-fixed/manager-api.txt > ../src/lib/bluez/manager.h
-./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}-fixed/manager-api.txt > ../src/lib/bluez/manager.c
+echo "Generating heart rate header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/heartrate-api.txt 2 > out/heart_rate.h
+echo "Generating heart rate source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/heartrate-api.txt 2 > out/heart_rate.c
+
+# echo "Generating heart rate watcher header"
+# ./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/heartrate-api.txt 3 > out/heart_rate_watcher.h
+# echo "Generating heart rate watcher source"
+# ./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/heartrate-api.txt 3 > out/heart_rate_watcher.c
+
+# media-api.txt
+echo "media-api.txt"
+echo "Generating media header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/media-api.txt 1 > out/media.h
+echo "Generating media source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/media-api.txt 1 > out/media.c
+
+echo "Generating media control header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/media-api.txt 2 > out/media_control.h
+echo "Generating media control source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/media-api.txt 2 > out/media_control.c
+
+echo "Generating media player header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/media-api.txt 3 > out/media_player.h
+echo "Generating media player source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/media-api.txt 3 > out/media_player.c
+
+# echo "Generating media folder header"
+# ./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/media-api.txt 4 > out/media_folder.h
+# echo "Generating media folder source"
+# ./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/media-api.txt 4 > out/media_folder.c
+
+# echo "Generating media item header"
+# ./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/media-api.txt 5 > out/media_item.h
+# echo "Generating media item source"
+# ./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/media-api.txt 5 > out/media_item.c
+
+# echo "Generating media endpoint header"
+# ./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/media-api.txt 6 > out/media_endpoint.h
+# echo "Generating media endpoint source"
+# ./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/media-api.txt 6 > out/media_endpoint.c
+
+# echo "Generating media transport header"
+# ./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/media-api.txt 7 > out/media_transport.h
+# echo "Generating media transport source"
+# ./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/media-api.txt 7 > out/media_transport.c
# network-api.txt
-./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}-fixed/network-api.txt > ../src/lib/bluez/network.h
-./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}-fixed/network-api.txt > ../src/lib/bluez/network.c
+echo "network-api.txt"
+echo "Generating network header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/network-api.txt 1 > out/network.h
+echo "Generating network source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/network-api.txt 1 > out/network.c
+
+echo "Generating network server header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/network-api.txt 2 > out/network_server.h
+echo "Generating network server source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/network-api.txt 2 > out/network_server.c
+
+# obex-agent-api.txt
+echo "obex-agent-api.txt"
+echo "Generating obex agent manager header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/obex-agent-api.txt 1 > out/obex/obex_agent_manager.h
+echo "Generating obex agent manager source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/obex-agent-api.txt 1 > out/obex/obex_agent_manager.c
+
+# echo "Generating obex agent header"
+# ./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/obex-agent-api.txt 2 > out/obex/obex_agent.h
+# echo "Generating obex agent source"
+# ./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/obex-agent-api.txt 2 > out/obex/obex_agent.c
+
+# obex-api.txt
+echo "obex-api.txt"
+echo "Generating obex client header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/obex-api.txt 1 > out/obex/obex_client.h
+echo "Generating obex client source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/obex-api.txt 1 > out/obex/obex_client.c
+
+echo "Generating obex session header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/obex-api.txt 2 > out/obex/obex_session.h
+echo "Generating obex session source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/obex-api.txt 2 > out/obex/obex_session.c
+
+echo "Generating obex transfer header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/obex-api.txt 3 > out/obex/obex_transfer.h
+echo "Generating obex transfer source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/obex-api.txt 3 > out/obex/obex_transfer.c
+
+echo "Generating obex object push header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/obex-api.txt 4 > out/obex/obex_object_push.h
+echo "Generating obex object push source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/obex-api.txt 4 > out/obex/obex_object_push.c
+
+echo "Generating obex file transfer header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/obex-api.txt 5 > out/obex/obex_file_transfer.h
+echo "Generating obex file transfer source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/obex-api.txt 5 > out/obex/obex_file_transfer.c
+
+echo "Generating obex phonebook access header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/obex-api.txt 6 > out/obex/obex_phonebook_access.h
+echo "Generating obex phonebook access source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/obex-api.txt 6 > out/obex/obex_phonebook_access.c
+
+echo "Generating obex synchronization header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/obex-api.txt 7 > out/obex/obex_synchronization.h
+echo "Generating obex synchronization source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/obex-api.txt 7 > out/obex/obex_synchronization.c
+
+echo "Generating obex message access header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/obex-api.txt 8 > out/obex/obex_message_access.h
+echo "Generating obex message access source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/obex-api.txt 8 > out/obex/obex_message_access.c
+
+echo "Generating obex message header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/obex-api.txt 9 > out/obex/obex_message.h
+echo "Generating obex message source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/obex-api.txt 9 > out/obex/obex_message.c
+
+# profile-api.txt
+echo "profile-api.txt"
+echo "Generating profile manager header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/profile-api.txt 1 > out/profile_manager.h
+echo "Generating profile manager source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/profile-api.txt 1 > out/profile_manager.c
+
+# echo "Generating profile header"
+# ./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/profile-api.txt 2 > out/profile.h
+# echo "Generating profile source"
+# ./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/profile-api.txt 2 > out/profile.c
+
+# proximity-api.txt
+echo "proximity-api.txt"
+echo "Generating proximity monitor header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/proximity-api.txt 1 > out/proximity_monitor.h
+echo "Generating proximity monitor source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/proximity-api.txt 1 > out/proximity_monitor.c
+
+echo "Generating proximity reporter header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/proximity-api.txt 2 > out/proximity_reporter.h
+echo "Generating proximity reporter source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/proximity-api.txt 2 > out/proximity_reporter.c
+
+# sap-api.txt
+echo "sap-api.txt"
+echo "Generating sim access header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/sap-api.txt > out/sim_access.h
+echo "Generating sim access source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/sap-api.txt > out/sim_access.c
+
+# thermometer-api.txt
+echo "thermometer-api.txt"
+echo "Generating thermometer manager header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/thermometer-api.txt 1 > out/thermometer_manager.h
+echo "Generating thermometer manager source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/thermometer-api.txt 1 > out/thermometer_manager.c
-./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}-fixed/network-api.txt 2 > ../src/lib/bluez/network_server.h
-./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}-fixed/network-api.txt 2 > ../src/lib/bluez/network_server.c
+echo "Generating thermometer header"
+./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/thermometer-api.txt 2 > out/thermometer.h
+echo "Generating thermometer source"
+./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/thermometer-api.txt 2 > out/thermometer.c
-# serial-api.txt
-./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}-fixed/serial-api.txt > ../src/lib/bluez/serial.h
-./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}-fixed/serial-api.txt > ../src/lib/bluez/serial.c
+# echo "Generating thermometer watcher header"
+# ./gen-dbus-gobject.pl -header bluez-api-${API_VERSION}/thermometer-api.txt 3 > out/thermometer_watcher.h
+# echo "Generating thermometer watcher source"
+# ./gen-dbus-gobject.pl -source bluez-api-${API_VERSION}/thermometer-api.txt 3 > out/thermometer_watcher.c
diff --git a/contrib/generate-obexd-gobjects.sh b/contrib/generate-obexd-gobjects.sh
deleted file mode 100755
index f7aef46..0000000
--- a/contrib/generate-obexd-gobjects.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-# OBEXD API
-
-API_VERSION=0.42
-
-# client-api.txt
-./gen-dbus-gobject.pl -header obexd-api-${API_VERSION}-fixed/client-api.txt > ../src/lib/obexd/obexclient.h
-./gen-dbus-gobject.pl -source obexd-api-${API_VERSION}-fixed/client-api.txt > ../src/lib/obexd/obexclient.c
-
-./gen-dbus-gobject.pl -header obexd-api-${API_VERSION}-fixed/client-api.txt 2 > ../src/lib/obexd/obexclient_session.h
-./gen-dbus-gobject.pl -source obexd-api-${API_VERSION}-fixed/client-api.txt 2 > ../src/lib/obexd/obexclient_session.c
-
-./gen-dbus-gobject.pl -header obexd-api-${API_VERSION}-fixed/client-api.txt 3 > ../src/lib/obexd/obexclient_file_transfer.h
-./gen-dbus-gobject.pl -source obexd-api-${API_VERSION}-fixed/client-api.txt 3 > ../src/lib/obexd/obexclient_file_transfer.c
-
-./gen-dbus-gobject.pl -header obexd-api-${API_VERSION}-fixed/client-api.txt 6 > ../src/lib/obexd/obexclient_transfer.h
-./gen-dbus-gobject.pl -source obexd-api-${API_VERSION}-fixed/client-api.txt 6 > ../src/lib/obexd/obexclient_transfer.c
-
-# obexd-api.txt
-./gen-dbus-gobject.pl -header obexd-api-${API_VERSION}-fixed/obexd-api.txt > ../src/lib/obexd/obexmanager.h
-./gen-dbus-gobject.pl -source obexd-api-${API_VERSION}-fixed/obexd-api.txt > ../src/lib/obexd/obexmanager.c
-
-./gen-dbus-gobject.pl -header obexd-api-${API_VERSION}-fixed/obexd-api.txt 2 > ../src/lib/obexd/obextransfer.h
-./gen-dbus-gobject.pl -source obexd-api-${API_VERSION}-fixed/obexd-api.txt 2 > ../src/lib/obexd/obextransfer.c
-
-./gen-dbus-gobject.pl -header obexd-api-${API_VERSION}-fixed/obexd-api.txt 3 > ../src/lib/obexd/obexsession.h
-./gen-dbus-gobject.pl -source obexd-api-${API_VERSION}-fixed/obexd-api.txt 3 > ../src/lib/obexd/obexsession.c
diff --git a/contrib/man/bt-adapter.pod b/contrib/man/bt-adapter.pod
index 44febef..0930cf8 100644
--- a/contrib/man/bt-adapter.pod
+++ b/contrib/man/bt-adapter.pod
@@ -48,7 +48,7 @@ B<--set E<lt>propertyE<gt> E<lt>valueE<gt>>
string Address [ro]
The Bluetooth adapter address (MAC).
-string Name [rw]
+string Alias [rw]
The Bluetooth adapter friendly name.
uint32 Class [ro]
@@ -101,4 +101,4 @@ Alexander Orlenko <zxteam@gmail.com>.
=head1 SEE ALSO
-bt-agent(1) bt-audio(1) bt-device(1) bt-input(1) bt-monitor(1) bt-network(1) bt-serial(1)
+bt-agent(1) bt-device(1) bt-network(1)
diff --git a/contrib/man/bt-agent.pod b/contrib/man/bt-agent.pod
index 927d224..270704a 100644
--- a/contrib/man/bt-agent.pod
+++ b/contrib/man/bt-agent.pod
@@ -10,7 +10,9 @@ Help Options:
-h, --help
Application Options:
- -a, --adapter=<name|mac>
+ -c, --capability=<capability>
+ -p, --pin
+ -d, --daemon
=head1 DESCRIPTION
@@ -22,9 +24,25 @@ This interactive utility is used to manage incoming Bluetooth requests
B<-h, --help>
Show help
-B<-a, --adapter E<lt>name|macE<gt>>
- Specify adapter to use by his Name or MAC address
- (if this option does not defined - default adapter used)
+B<-c, --capability E<lt>capabilityE<gt>>
+ Specify the input and output capabilities of the agent.
+ `capability` can be one of:
+ DisplayOnly
+ DisplayYesNo (default)
+ KeyboardOnly
+ NoInputNoOutput
+ (if this option does not defined - `DisplayYesNo' will be used)
+
+B<-p, --pin E<lt>file path<gt>>
+ Use a file that holds a list of authorization codes for each device by name or mac address.
+ The contents of the file should be in this format:
+ AA:BB:CC:DD:EE:FF 123456
+ RemoteDeviceName * (accept any pin code)
+ If a pin file is included, it will check the passkey of the pairing device against the key included in the file. It will automatically authorize the device if the key matches, otherwise it will request the user for manual authorization.
+
+B<-d, --daemon>
+ Run the agent as a background process (as a daemon).
+ The agent will rely on a pin file and request no manual user authorization. Any devices that attempt to pair without a valid passkey defined in the pin file will be automatically rejected.
=head1 AUTHOR
@@ -32,4 +50,4 @@ Alexander Orlenko <zxteam@gmail.com>.
=head1 SEE ALSO
-bt-adapter(1) bt-audio(1) bt-device(1) bt-input(1) bt-monitor(1) bt-network(1) bt-serial(1)
+bt-adapter(1) bt-device(1) bt-network(1)
diff --git a/contrib/man/bt-device.pod b/contrib/man/bt-device.pod
index 2399e20..23692e6 100644
--- a/contrib/man/bt-device.pod
+++ b/contrib/man/bt-device.pod
@@ -115,4 +115,4 @@ Alexander Orlenko <zxteam@gmail.com>.
=head1 SEE ALSO
-bt-adapter(1) bt-agent(1) bt-audio(1) bt-input(1) bt-monitor(1) bt-network(1) bt-serial(1)
+bt-adapter(1) bt-agent(1) bt-network(1)
diff --git a/contrib/man/bt-network.pod b/contrib/man/bt-network.pod
index e963336..0bde301 100644
--- a/contrib/man/bt-network.pod
+++ b/contrib/man/bt-network.pod
@@ -42,4 +42,4 @@ Alexander Orlenko <zxteam@gmail.com>.
=head1 SEE ALSO
-bt-adapter(1) bt-agent(1) bt-audio(1) bt-device(1) bt-input(1) bt-monitor(1) bt-serial(1)
+bt-adapter(1) bt-agent(1) bt-device(1)
diff --git a/contrib/man/bt-obex.pod b/contrib/man/bt-obex.pod
index 5ca19a8..350a83f 100644
--- a/contrib/man/bt-obex.pod
+++ b/contrib/man/bt-obex.pod
@@ -61,4 +61,4 @@ Alexander Orlenko <zxteam@gmail.com>.
=head1 SEE ALSO
-bt-adapter(1) bt-agent(1) bt-audio(1) bt-device(1) bt-input(1) bt-monitor(1) bt-network(1) bt-serial(1)
+bt-adapter(1) bt-agent(1) bt-device(1) bt-network(1)
diff --git a/contrib/obexd-api-0.42-fixed/agent-api.txt b/contrib/obexd-api-0.42-fixed/agent-api.txt
deleted file mode 100644
index e3dbc78..0000000
--- a/contrib/obexd-api-0.42-fixed/agent-api.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-obexd Agent API description
-**********************************
-
-Copyright (C) 2007-2010 Nokia Corporation
-Copyright (C) 2007-2010 Marcel Holtmann <marcel@holtmann.org>
-
-
-Agent hierarchy
-===============
-
-Service unique name
-Interface org.openobex.Agent
-Object path freely definable
-
-Methods
- string Authorize(object transfer, string bt_address, string name, string type, int32 length, int32 time)
-
- This method gets called when the service daemon
- needs to accept/reject a Bluetooth object push request.
- Returns the full path (including the filename) where
- the object shall be stored.
-
- Possible errors: org.openobex.Error.Rejected
- org.openobex.Error.Canceled
-
- void Cancel()
-
- This method gets called to indicate that the agent
- request failed before a reply was returned. It cancels
- the previous request.
diff --git a/contrib/obexd-api-0.42-fixed/agent.xml b/contrib/obexd-api-0.42-fixed/agent.xml
deleted file mode 100644
index bb089dd..0000000
--- a/contrib/obexd-api-0.42-fixed/agent.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<node name="/ObexAgent">
- <interface name="org.openobex.Agent">
- <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="obexagent"/>
-
- <method name="Authorize">
- <arg type="o" name="transfer" direction="in"/>
- <arg type="s" name="bt_address" direction="in"/>
- <arg type="s" name="name" direction="in"/>
- <arg type="s" name="type" direction="in"/>
- <arg type="i" name="length" direction="in"/>
- <arg type="i" name="time" direction="in"/>
- <arg type="s" direction="out"/>
- </method>
- <method name="Cancel"/>
-
- <method name="Release"/>
- <method name="Request">
- <arg type="o" name="transfer" direction="in"/>
- <arg type="s" direction="out"/>
- </method>
- <method name="Progress">
- <arg type="o" name="transfer" direction="in"/>
- <arg type="t" name="transferred" direction="in"/>
- </method>
- <method name="Complete">
- <arg type="o" name="transfer" direction="in"/>
- </method>
- <method name="Error">
- <arg type="o" name="transfer" direction="in"/>
- <arg type="s" name="message" direction="in"/>
- </method>
-
- </interface>
-</node>
diff --git a/contrib/obexd-api-0.42-fixed/client-api.txt b/contrib/obexd-api-0.42-fixed/client-api.txt
deleted file mode 100644
index fa8a36d..0000000
--- a/contrib/obexd-api-0.42-fixed/client-api.txt
+++ /dev/null
@@ -1,329 +0,0 @@
-OBEX client API description
-***************************
-
-Copyright (C) 2007-2010 Marcel Holtmann <marcel@holtmann.org>
-
-
-Client hierarchy
-================
-
-Service org.openobex.client
-Interface org.openobex.Client
-Object path /
-Object name OBEXClient
-
-Methods void SendFiles(dict device, array{string} files, object agent)
-
- Send one or multiple local files to the specified
- device. The device is configured via properties. At
- least the Destination property should be specified.
-
- void PullBusinessCard(dict device, string file)
-
- Request the business card from a remote device and
- store it in the local file.
-
- void ExchangeBusinessCards(dict device, string clientfile, string file)
-
- Push the client's business card to the remote device
- and then retrieve the remote business card and store
- it in a local file.
-
- object CreateSession(dict device)
-
- Create a new OBEX session. The device is configured
- via properties like in SendFiles.
-
- void RemoveSession(object session)
-
- Unregister session and abort pending transfers.
-
- string GetCapabilities(dict device)
-
- Get remote device capabilities.
-
-Properties string Target
-
- string Source
-
- string Destination
-
- byte Channel
-
-
-Session hierarchy
-=================
-
-Service org.openobex.client
-Interface org.openobex.Session
-Object path [variable prefix]/{session0,session1,...}
-Object name OBEXClientSession
-
-Methods dict GetProperties()
-
- Returns all properties for the session.
-
- void AssignAgent(object agent)
-
- Assign an OBEX agent to this session. This allows
- detailed progress reports about the transactions.
-
- void ReleaseAgent(object agent)
-
- Release a previously assigned OBEX agent.
-
-Properties string Source [readonly]
-
- string Destination [readonly]
-
- byte Channel [readonly]
-
-
-File Transfer hierarchy
-=======================
-
-Service org.openobex.client
-Interface org.openobex.FileTransfer
-Object path [variable prefix]/{session0,session1,...}
-Object name OBEXClientFileTransfer
-
-Methods void ChangeFolder(string folder)
-
- Change the current folder of the remote device.
-
- void CreateFolder(string folder)
-
- Create a new folder in the remote device.
-
- array{dict} ListFolder()
-
- Returns a dictionary containing information about
- the current folder content.
-
- The following keys are defined:
-
- string Name : Object name in UTF-8 format
- string Type : Either "folder" or "file"
- uint64 Size : Object size or number of items in folder
- string Permission : Group, owner and other permission
- guint64 Modified : Last change
- guint64 Accessed : Last access
- guint64 Created : Creation date
-
- void GetFile(string targetfile, string sourcefile)
-
- Copy the source file (from remote device) to the
- target file (on local filesystem).
-
- A new Transfer object is created to represent this
- transaction.
-
- void PutFile(string sourcefile, string targetfile)
-
- Copy the source file (from local filesystem) to the
- target file (on remote device).
-
- A new Transfer object is created to represent this
- transaction.
-
- void CopyFile(string sourcefile, string targetfile)
-
- Copy a file within the remote device from source file
- to target file.
-
- void MoveFile(string sourcefile, string targetfile)
-
- Movea file within the remote device from source file
- to the target file.
-
- void Delete(string file)
-
- Deletes the specified file/folder.
-
-
-Phonebook Access hierarchy
-=======================
-
-Service org.openobex.client
-Interface org.openobex.PhonebookAccess
-Object path [variable prefix]/{session0,session1,...}
-
-Methods void Select(string location, string phonebook)
-
- Select the phonebook object for other operations. Should
- be call before all the other operations.
-
- location : Where the phonebook is stored, possible inputs :
- "INT" ( "INTERNAL" which is default )
- "SIM" ( "SIM1" )
- "SIM2"
- ...
-
- phonebook : Possible inputs :
- "pb" : phonebook for the saved contacts
- "ich": incoming call history
- "och": outgoing call history
- "mch": missing call history
- "cch": combination of ich och mch
-
- string PullAll()
-
- Return the entire phonebook object from the PSE server
- in plain string with vcard format.
-
- array{string vcard, string name} List()
-
- Return an array of vcard-listing data which contains the
- vcard : name paired string, for example "1.vcf" : "John".
-
- string Pull(string vcard)
-
- Retrieve the vcard in the current phonebook object
- for example : Pull("0.vcf")
-
- array{string vcard, string name}
- Search(string field, string value)
-
- Return an array of vcard-listing data which contains the
- vcard : name paired string match the search condition.
-
- field : the field in the vcard to search with
- { "name" (default) | "number" | "sound" }
- value : the string value to search for
-
- uint16 GetSize()
-
- Return the number of the non-null entries in the selected
- phonebook object.
-
- void SetFormat(string format)
-
- Indicate the format of the vcard that should be return by
- related methods.
-
- format : { "vcard21" (default) | "vcard30" }
-
- void SetOrder(string order)
-
- Indicate the sorting method of the vcard-listing data returned
- by List and Search methods.
-
- order : { "indexed" (default) | "alphanumeric" | "phonetic" }
-
- void SetFilter(array{string}) {FIX?!}
-
- Indicate fields that should be contained in vcards return by
- related methods.
-
- Give an empty array will clear the filter and return all fields
- available in vcards. And this is the default behavior.
-
- Possible filter fields : "VERSION", "FN", ..., "ALL", "bit[0-63]"
-
- array{string} ListFilterFields() {FIX?!}
-
- Return All Available fields that can be used in SefFilter method.
-
- array{string} GetFilter()
-
- Return the current filter setting
-
-Synchronization hierarchy
-=======================
-
-Service org.openobex.client
-Interface org.openobex.Synchronization
-Object path [variable prefix]/{session0,session1,...}
-
-Methods void SetLocation(string location)
-
- Set the phonebook object store location for other operations. Should
- be called before all the other operations.
-
- location: Where the phonebook is stored, possible values:
- "INT" ( "INTERNAL" which is default )
- "SIM1"
- "SIM2"
- ......
-
- string GetPhonebook()
-
- retrieve an entire Phonebook Object store from remote device
-
- void PutPhonebook(string obj)
-
- send an entire Phonebook Object store to remote device
-
-Transfer hierarchy
-==================
-
-Service org.openobex.client
-Interface org.openobex.Transfer
-Object path [variable prefix]/{transfer0,transfer1,...}
-Object name OBEXClientTransfer
-
-Methods dict GetProperties()
-
- Returns all properties for the transfer. See the
- properties section for available properties.
-
- void Cancel()
-
- Cancels this transfer.
-
-Properties string Name [readonly]
-
- Name of the transferred object.
-
- uint64 Size [readonly]
-
- Size of the transferred object. If the size is
- unknown, then this property will not be present.
-
- string Filename [readonly]
-
- Complete name of the file being received or sent.
-
-
-Agent hierarchy
-===============
-
-Service unique name
-Interface org.openobex.Agent
-Object path freely definable
-
-Methods void Release()
-
- This method gets called when the service daemon
- unregisters the agent. An agent can use it to do
- cleanup tasks. There is no need to unregister the
- agent, because when this method gets called it has
- already been unregistered.
-
- string Request(object transfer)
-
- Accept or reject a new transfer (client and server)
- and provide the filename for it.
-
- In case of incoming transfers it is the filename
- where to store the file and for outgoing transfers
- it is the filename to show the remote device. If left
- empty it will be calculated automatically.
-
- Possible errors: org.openobex.Error.Rejected
- org.openobex.Error.Canceled
-
- void Progress(object transfer, uint64 transferred)
-
- Progress within the transfer has been made. The
- number of transferred bytes is given as second
- argument for convenience.
-
- void Complete(object transfer)
-
- Informs that the transfer has completed sucessfully.
-
- void Error(object transfer, string message)
-
- Informs that the transfer has been terminated because
- of some error.
diff --git a/contrib/obexd-api-0.42-fixed/obexd-api.txt b/contrib/obexd-api-0.42-fixed/obexd-api.txt
deleted file mode 100644
index 6cfaac7..0000000
--- a/contrib/obexd-api-0.42-fixed/obexd-api.txt
+++ /dev/null
@@ -1,90 +0,0 @@
-obexd API description
-**********************************
-
-Copyright (C) 2007-2010 Nokia Corporation
-Copyright (C) 2007-2010 Marcel Holtmann <marcel@holtmann.org>
-
-
-Manager hierarchy
-===============
-
-Service org.openobex
-Interface org.openobex.Manager
-Object path /
-Object name OBEXManager
-
-Methods
- void RegisterAgent(object agent)
-
- Register an agent to request authorization of
- the user to accept/reject objects. Object push
- service needs to authorize each received object.
-
- Possible errors: org.openobex.Error.AlreadyExists
-
- void UnregisterAgent(object agent)
-
- This unregisters the agent that has been previously
- registered. The object path parameter must match the
- same value that has been used on registration.
-
- Possible errors: org.openobex.Error.DoesNotExist
-
-Signals SessionCreated(object session)
-
- Signal sent when OBEX connection has been accepted.
- (FTP only)
-
- SessionRemoved(object session)
-
- Sent when the transport is disconnected
- (FTP only)
-
- TransferStarted(object transfer)
-
- Signal sent when an object push operation starts.
- (OPP only)
-
- TransferCompleted(object transfer, boolean success)
-
- Signal sent when the object has been received
- or an error happens.
- (OPP only)
-
-
-Transfer hierarchy
-===============
-
-Service org.openobex
-Interface org.openobex.Transfer
-Object path /transfer{0, 1, 2, ...}
-Object name OBEXTransfer
-
-Methods
- void Cancel()
-
- Stops the current transference.
-
-Signals
- Progress(int32 total, int32 transfered)
-
-
-Session hierarchy
-===============
-
-Service org.openobex
-Interface org.openobex.Session
-Object path /session{0, 1, 2, ...}
-Object name OBEXSession
-
-Methods
- dict GetProperties()
-
-
-Signals TBD
-
-
-Properties
- string Address [readonly]
-
- Bluetooth device address or USB