diff options
Diffstat (limited to 'audio')
-rw-r--r-- | audio/Makefile.am | 3 | ||||
-rw-r--r-- | audio/audio-api.txt | 311 | ||||
-rw-r--r-- | audio/control.h | 2 | ||||
-rw-r--r-- | audio/device.h | 8 | ||||
-rw-r--r-- | audio/gateway.h | 2 | ||||
-rw-r--r-- | audio/headset.h | 2 | ||||
-rw-r--r-- | audio/main.c | 14 | ||||
-rw-r--r-- | audio/manager.h | 4 | ||||
-rw-r--r-- | audio/sink.h | 2 | ||||
-rw-r--r-- | audio/telephony-dummy.c | 14 | ||||
-rwxr-xr-x | audio/test-audio | 27 |
11 files changed, 23 insertions, 366 deletions
diff --git a/audio/Makefile.am b/audio/Makefile.am index 290633fb..543fa955 100644 --- a/audio/Makefile.am +++ b/audio/Makefile.am @@ -61,8 +61,7 @@ CLEANFILES = $(BUILT_SOURCES) INCLUDES = -I$(top_srcdir)/common -I$(top_srcdir)/src -EXTRA_DIST = audio.conf audio-api.txt test-audio asound.conf \ - telephony-dummy.c +EXTRA_DIST = audio.conf asound.conf telephony-dummy.c MAINTAINERCLEANFILES = Makefile.in diff --git a/audio/audio-api.txt b/audio/audio-api.txt deleted file mode 100644 index cba20699..00000000 --- a/audio/audio-api.txt +++ /dev/null @@ -1,311 +0,0 @@ -Bluetooth audio service API description -*************************************** - -Copyright (C) 2004-2007 Marcel Holtmann <marcel@holtmann.org> -Copyright (C) 2005-2007 Johan Hedberg <johan.hedberg@nokia.com> -Copyright (C) 2005-2006 Brad Midgley <bmidgley@xmission.com> - - -org.bluez.audio.Manager interface -================================= - -This interface is for managing remote audio devices. It provides methods for -creating and removing D-Bus objects representing remote audio devices. These -objects implement one or more of the other interfaces listed in this document. - -Object path /org/bluez/audio - -Methods - string CreateDevice(string address) [experimental] - - Creates a new audio device object. If not yet done, - this method will perform a SDP query on the remote - device and return first when the query is complete, - so be sure to call this method asynchronously. - - The return parameter is the object path of the newly - created object. - - void RemoveDevice(string path) [experimental] - - Removes a device from the device tree. If there are - any connections open to the device they will be closed. - - array{string} ListDevices() [experimental] - - Retuns an array of strings indicating the object paths - of available devices. - - string DefaultDevice() - - Returns the object path for the default device. - - void ChangeDefaultDevice(string path) - - Changes the default device. - - array{string} ListHeadsets() - - Returns list of headset objects that are configured. - - string FindDeviceByAddress(string address) [experimental] - - Searches the list of available devices and returns the - object path of the first device which matchess address. - If no device is found returns a DoesNotExist error. - - string DefaultHeadset() - - Returns the object path for the default headset device. - - void ChangeDefaultHeadset(string path) - - Changes the default headset. - - string CreateHeadset(string address) - - Create a new headset device and returns its object path - on return. - - void RemoveHeadset(string path) - - Removes a headset object and all information - related to it. - -Signals - void DeviceCreated(string path) [experimental] - - Sent when a new device object has been created. - - void DeviceRemoved(string path) [experimental] - - Sent when a device object has been removed. - - void HeadsetCreated(string path) - - Sent when a new headset object has been created. - - void HeadsetRemoved(string path) - - Sent when a headset object has been removed. - - void DefaultHeadsetChanged(string path) - - Sent when the default headset has changed. - - -org.bluez.audio.Device interface -================================ - -This interface is implemented by all remote device objects. - -Object path(s) /org/bluez/audio/device* - -Methods string GetAddress() [experimental] - - Returns the Bluetooth address of the remote device. - - string GetAdapter() [experimental] - - Returns the address of the local adapter that the - device is associated with. - - string GetName() [experimental] - - Returns a friendly name for the device. - - array{string} GetConnectedInterfaces() [experimental] - - Returns a string list of interfaces that are in a - connected state. - - -org.bluez.audio.Headset interface -================================= - -This interface provides access to headsets that implement the HSP and/or HFP -profiles. - -Object path(s) /org/bluez/audio/device* - -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() - - 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() - - Open the audio connection to the headset. - - void Stop() - - Close the audio connection. - - boolean IsPlaying() - - Returns true if an audio connection to the headset - is active. - - uint16 GetSpeakerGain() - - Returns the current speaker gain if available, - otherwise returns the error NotAvailable. - - uint16 GetMicrophoneGain() - - Returns the current microphone gain if available, - otherwise returns the error NotAvailable. - - void SetSpeakerGain(uint16 gain) - - Changes the current speaker gain if possible. - - void SetMicrophoneGain(uint16 gain) - - Changes the current speaker gain if possible. - - void SetupCall(string value) [experimental] - - Sets up an call with the connected HFP. The value can - be "incoming", "outgoing" or "remote" to indicate - incoming call, outgoing call and remote party alerted - respectively. - - void IdentifyCall(string phone_number, int32 type) [experimental] - - Enables a called subscriber to get the calling - line identity (CLI) of the calling party when - receiving a call. The value of type shud be - the same as provided by the GSM stack. - -Signals void AnswerRequested() - - Sent when the answer button is pressed on the headset - - void Connected() - - Sent when the device has been connected to. - - void Disconnected() - - Sent when the device has been disconnected from. - - void Stopped() - - Sent when the audio connection is closed - - void Playing() - - Sent when the audio connection is opened - - void SpeakerGainChanged(uint16 gain) - - The speaker gain changed. - - void MicrophoneGainChanged(uint16 gain) - - The microphone gain changed. - - void CallTerminated() - - Sent when an ongoing call is terminated. - - -org.bluez.audio.Gateway interface -================================= - -[not yet implemented] - -This interface is available for remote devices which can function in the Audio -Gateway role of the HSP and/or HFP profiles. - -Object path(s) /org/bluez/audio/device* - - -org.bluez.audio.Sink interface -============================== - -This interface is available for remote devices which contain a A2DP Sink. - -Object path(s) /org/bluez/audio/device* - -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() - - Returns TRUE if a stream is setup to a A2DP sink on - the remote device. - -Signals void Connected() - - Sent when a successful connection has been made to the - remote A2DP Sink - - void Disconnected() - - Sent when the device has been disconnected from. - - void Playing() - - Sent when a stream with remote device is started. - - void Stopped() - - Sent when a stream with remote device is suspended. - - -org.bluez.audio.Source interface -================================ - -[not yet implemented] - -This interface is available for remote devices which implement a A2DP source. - -Object path(s) /org/bluez/audio/device* - - -org.bluez.audio.Control interface -================================= - -This interface is available for remote devices which implement support for a -AVRCP controller. - -Object path(s) /org/bluez/audio/device* - -Methods boolean IsConnected() - - Returns TRUE if AVRCP is connected. - -Signals void Connected() - - Sent when a successful AVRCP connection has been made. - - void Disconnected() - - Sent when the AVRCP connection has been disconnected. diff --git a/audio/control.h b/audio/control.h index 4ebcb9a3..6475df51 100644 --- a/audio/control.h +++ b/audio/control.h @@ -22,7 +22,7 @@ * */ -#define AUDIO_CONTROL_INTERFACE "org.bluez.audio.Control" +#define AUDIO_CONTROL_INTERFACE "org.bluez.Control" int avrcp_init(DBusConnection *conn, GKeyFile *config); void avrcp_exit(void); diff --git a/audio/device.h b/audio/device.h index 96bb0705..20bc4d99 100644 --- a/audio/device.h +++ b/audio/device.h @@ -22,8 +22,6 @@ * */ -#define AUDIO_DEVICE_INTERFACE "org.bluez.audio.Device" - #define GENERIC_AUDIO_UUID "00001203-0000-1000-8000-00805F9B34FB" #define HSP_HS_UUID "00001108-0000-1000-8000-00805F9B34FB" @@ -41,9 +39,9 @@ #define AVRCP_TARGET_UUID "0000110C-0000-1000-8000-00805F9B34FB" /* Move these to respective .h files once they exist */ -#define AUDIO_SOURCE_INTERFACE "org.bluez.audio.Source" -#define AUDIO_CONTROL_INTERFACE "org.bluez.audio.Control" -#define AUDIO_TARGET_INTERFACE "org.bluez.audio.Target" +#define AUDIO_SOURCE_INTERFACE "org.bluez.Source" +#define AUDIO_CONTROL_INTERFACE "org.bluez.Control" +#define AUDIO_TARGET_INTERFACE "org.bluez.Target" struct source; struct control; diff --git a/audio/gateway.h b/audio/gateway.h index 12e413fd..3e44937c 100644 --- a/audio/gateway.h +++ b/audio/gateway.h @@ -22,7 +22,7 @@ * */ -#define AUDIO_GATEWAY_INTERFACE "org.bluez.audio.Gateway" +#define AUDIO_GATEWAY_INTERFACE "org.bluez.Gateway" #define DEFAULT_HSP_HS_CHANNEL 6 #define DEFAULT_HFP_HS_CHANNEL 7 diff --git a/audio/headset.h b/audio/headset.h index 4c928e54..65c3f411 100644 --- a/audio/headset.h +++ b/audio/headset.h @@ -22,7 +22,7 @@ * */ -#define AUDIO_HEADSET_INTERFACE "org.bluez.audio.Headset" +#define AUDIO_HEADSET_INTERFACE "org.bluez.Headset" #define DEFAULT_HS_AG_CHANNEL 12 #define DEFAULT_HF_AG_CHANNEL 13 diff --git a/audio/main.c b/audio/main.c index 9afc61e6..4583ca81 100644 --- a/audio/main.c +++ b/audio/main.c @@ -29,7 +29,6 @@ #include <errno.h> #include <sys/socket.h> #include <bluetooth/bluetooth.h> -#include <bluetooth/sdp.h> #include <glib.h> #include <dbus/dbus.h> @@ -57,13 +56,14 @@ static GKeyFile *load_config_file(const char *file) return keyfile; } +static DBusConnection *connection; + static int audio_init(void) { - DBusConnection *conn; GKeyFile *config; - conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL); - if (conn == NULL) + connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL); + if (connection == NULL) return -EIO; config = load_config_file(CONFIGDIR "/audio.conf"); @@ -73,8 +73,8 @@ static int audio_init(void) return -EIO; } - if (audio_manager_init(conn, config) < 0) { - dbus_connection_unref(conn); + if (audio_manager_init(connection, config) < 0) { + dbus_connection_unref(connection); return -EIO; } @@ -86,6 +86,8 @@ static void audio_exit(void) audio_manager_exit(); unix_exit(); + + dbus_connection_unref(connection); } BLUETOOTH_PLUGIN_DEFINE("audio", audio_init, audio_exit) diff --git a/audio/manager.h b/audio/manager.h index 209488b0..708b52be 100644 --- a/audio/manager.h +++ b/audio/manager.h @@ -22,10 +22,6 @@ * */ -#define MAX_PATH_LENGTH 64 /* D-Bus path */ -#define AUDIO_MANAGER_PATH "/org/bluez/audio" -#define AUDIO_MANAGER_INTERFACE "org.bluez.audio.Manager" - struct enabled_interfaces { gboolean headset; gboolean gateway; diff --git a/audio/sink.h b/audio/sink.h index b067e19c..f5d56fef 100644 --- a/audio/sink.h +++ b/audio/sink.h @@ -22,7 +22,7 @@ * */ -#define AUDIO_SINK_INTERFACE "org.bluez.audio.Sink" +#define AUDIO_SINK_INTERFACE "org.bluez.Sink" struct sink *sink_init(struct audio_device *dev); void sink_unregister(struct audio_device *dev); diff --git a/audio/telephony-dummy.c b/audio/telephony-dummy.c index a161bc1e..701de220 100644 --- a/audio/telephony-dummy.c +++ b/audio/telephony-dummy.c @@ -130,7 +130,7 @@ static DBusMessage *outgoing_call(DBusConnection *conn, DBusMessage *msg, telephony_update_indicator(dummy_indicators, "callsetup", EV_CALLSETUP_ALERTING); - return dbus_message_new_method_return(msg);; + return dbus_message_new_method_return(msg); } static DBusMessage *incoming_call(DBusConnection *conn, DBusMessage *msg, @@ -149,7 +149,7 @@ static DBusMessage *incoming_call(DBusConnection *conn, DBusMessage *msg, telephony_calling_started_ind(number); - return dbus_message_new_method_return(msg);; + return dbus_message_new_method_return(msg); } static DBusMessage *cancel_call(DBusConnection *conn, DBusMessage *msg, @@ -167,7 +167,7 @@ static DBusMessage *cancel_call(DBusConnection *conn, DBusMessage *msg, telephony_update_indicator(dummy_indicators, "call", EV_CALL_INACTIVE); - return dbus_message_new_method_return(msg);; + return dbus_message_new_method_return(msg); } @@ -187,7 +187,7 @@ static DBusMessage *signal_strength(DBusConnection *conn, DBusMessage *msg, debug("telephony-dummy: signal strength set to %u", strength); - return dbus_message_new_method_return(msg);; + return dbus_message_new_method_return(msg); } static DBusMessage *battery_level(DBusConnection *conn, DBusMessage *msg, @@ -206,7 +206,7 @@ static DBusMessage *battery_level(DBusConnection *conn, DBusMessage *msg, debug("telephony-dummy: battery level set to %u", level); - return dbus_message_new_method_return(msg);; + return dbus_message_new_method_return(msg); } static DBusMessage *roaming_status(DBusConnection *conn, DBusMessage *msg, @@ -225,7 +225,7 @@ static DBusMessage *roaming_status(DBusConnection *conn, DBusMessage *msg, debug("telephony-dummy: roaming status set to %d", val); - return dbus_message_new_method_return(msg);; + return dbus_message_new_method_return(msg); } static DBusMessage *registration_status(DBusConnection *conn, DBusMessage *msg, @@ -244,7 +244,7 @@ static DBusMessage *registration_status(DBusConnection *conn, DBusMessage *msg, debug("telephony-dummy: registration status set to %d", val); - return dbus_message_new_method_return(msg);; + return dbus_message_new_method_return(msg); } static GDBusMethodTable dummy_methods[] = { diff --git a/audio/test-audio b/audio/test-audio deleted file mode 100755 index 19ea6252..00000000 --- a/audio/test-audio +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/python - -import dbus - -bus = dbus.SystemBus() - -manager = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), - 'org.bluez.Manager') - -conn = manager.ActivateService('audio') - -audio = dbus.Interface(bus.get_object(conn, '/org/bluez/audio'), - 'org.bluez.audio.Manager') - -try: - headset = dbus.Interface(bus.get_object(conn, audio.DefaultHeadset()), - 'org.bluez.audio.Headset') -except: - pass - -try: - device = dbus.Interface(bus.get_object(conn, audio.DefaultDevice()), - 'org.bluez.audio.Device') - sink = dbus.Interface(bus.get_object(conn, audio.DefaultDevice()), - 'org.bluez.audio.Sink') -except: - pass |