Skip to contentSkip to conversation

Add org.bluez.Telephony interface

RFC Superseded Frédéric Danis 1 participant 2 messages Nov 22, 2011

Subsystems (2)

v1 of 18 Superseded Latest is v18 →

lore
Share & tools
lore
#0 lore raw

cover Add org.bluez.Telephony interface

Hello,

I am working on this set of patches.

Replace telephony drivers for HeadSet/HandsFree Profiles by a new DBus interface (org.bluez.Telephony).
External applications, which should implement AT parsing and telephony part of HeadSet or HandsFree Profiles, will have to register a telephony agent using this new interface.

First patch add the new org.bluez.Telephony interface and remove functions related to AT parsing from audio/headset.c.

Second patch remove the telephony drivers (dummy, maemo5, maemo6 and ofono), functions used by telephony drivers and no more needed methods of org.bluez.Headset interface.

What I would like to do to continue is:
- move rfcomm servers from audio/manager.c to audio/telephony.c, so servers are started only when a telephony agent is registered. This should also replace audio/gateway.c.

- pass MediaTransport object in NewConnection method so telephony agent will be able to set NREC and ringtone, which can in turn notify Pulse Audio of property changed.

Any comments appreciated

Regards

Fred

Frédéric Danis (2):
audio: Move tel drivers to DBus interface
audio: Remove tel drivers

 Makefile.am              |   17 +-
 audio/headset.c          | 1517 +-------------------------------
 audio/headset.h          |    7 +-
 audio/manager.c          |    4 +-
 audio/telephony-dummy.c  |  433 ---------
 audio/telephony-maemo5.c | 2104 --------------------------------------------
 audio/telephony-maemo6.c | 2201 ----------------------------------------------
 audio/telephony-ofono.c  | 1638 ----------------------------------
 audio/telephony.c        |  494 +++++++++++
 audio/telephony.h        |  196 +----
 audio/transport.c        |   10 +
 audio/unix.c             |    2 +
 doc/audio-api.txt        |   91 ++
 13 files changed, 623 insertions(+), 8091 deletions(-)
 delete mode 100644 audio/telephony-dummy.c
 delete mode 100644 audio/telephony-maemo5.c
 delete mode 100644 audio/telephony-maemo6.c
 delete mode 100644 audio/telephony-ofono.c
 create mode 100644 audio/telephony.c
#1 lore raw

RFC 1/2 audio: Move tel drivers to DBus interface

---
 Makefile.am       |   13 +-
 audio/headset.c   |  614 ++---------------------------------------------------
 audio/headset.h   |    2 +
 audio/manager.c   |    4 +-
 audio/telephony.c |  494 ++++++++++++++++++++++++++++++++++++++++++
 audio/telephony.h |   25 +--
 doc/audio-api.txt |   91 ++++++++
 7 files changed, 612 insertions(+), 631 deletions(-)
 create mode 100644 audio/telephony.c
Makefile.am +2 -11
index 07b8626..31c1083 100644
@@ -154,14 +154,8 @@ builtin_sources += audio/main.c \
 			audio/unix.h audio/unix.c \
 			audio/media.h audio/media.c \
 			audio/transport.h audio/transport.c \
-			audio/telephony.h audio/a2dp-codecs.h
-builtin_nodist += audio/telephony.c
-
-noinst_LIBRARIES += audio/libtelephony.a
-
-audio_libtelephony_a_SOURCES = audio/telephony.h audio/telephony-dummy.c \
-				audio/telephony-maemo5.c audio/telephony-ofono.c \
-				audio/telephony-maemo6.c
+			audio/telephony.h audio/telephony.c \
+			audio/a2dp-codecs.h
 endif
 
 if SAPPLUGIN
@@ -476,9 +470,6 @@ MAINTAINERCLEANFILES = Makefile.in \
 src/builtin.h: src/genbuiltin $(builtin_sources)
 	$(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
 
-audio/telephony.c: audio/@TELEPHONY_DRIVER@
-	$(AM_V_GEN)$(LN_S) $(abs_top_srcdir)/$< $@
-
 sap/sap.c: sap/@SAP_DRIVER@
 	$(AM_V_GEN)$(LN_S) $(abs_top_srcdir)/$< $@
 
audio/headset.c +15 -599

771 lines not on this page · raw message

audio/headset.h +2 -0
index 99eeca8..d43952f 100644
@@ -111,3 +111,5 @@ gboolean headset_unlock(struct audio_device *dev, headset_lock_t lock);
 gboolean headset_suspend(struct audio_device *dev, void *data);
 gboolean headset_play(struct audio_device *dev, void *data);
 void headset_shutdown(struct audio_device *dev);
+
+void headset_slc_complete(struct audio_device *dev);
audio/manager.c +2 -2
index 8de5515..4624552 100644
@@ -880,7 +880,7 @@ static void state_changed(struct btd_adapter *adapter, gboolean powered)
 		/* telephony driver already initialized*/
 		if (telephony == TRUE)
 			return;
-		telephony_init();
+		telephony_init(adapter);
 		telephony = TRUE;
 		return;
 	}
@@ -896,7 +896,7 @@ static void state_changed(struct btd_adapter *adapter, gboolean powered)
 			return;
 	}
 
-	telephony_exit();
+	telephony_exit(adapter);
 	telephony = FALSE;
 }
 
audio/telephony.c new file +494 -0

494 lines not on this page · raw message

audio/telephony.h +6 -19
index 73b390c..7d1d337 100644
@@ -144,26 +144,13 @@ struct indicator {
 /* Notify telephony-*.c of connected/disconnected devices. Implemented by
  * telephony-*.c
  */
+void *telephony_device_connecting(GIOChannel *io, void *telephony_device);
 void telephony_device_connected(void *telephony_device);
+void telephony_device_disconnect(void *slc);
 void telephony_device_disconnected(void *telephony_device);
 
-/* HF requests (sent by the handsfree device). These are implemented by
- * telephony-*.c
- */
-void telephony_event_reporting_req(void *telephony_device, int ind);
-void telephony_response_and_hold_req(void *telephony_device, int rh);
-void telephony_last_dialed_number_req(void *telephony_device);
-void telephony_terminate_call_req(void *telephony_device);
-void telephony_answer_call_req(void *telephony_device);
-void telephony_dial_number_req(void *telephony_device, const char *number);
-void telephony_transmit_dtmf_req(void *telephony_device, char tone);
-void telephony_subscriber_number_req(void *telephony_device);
-void telephony_list_current_calls_req(void *telephony_device);
-void telephony_operator_selection_req(void *telephony_device);
-void telephony_call_hold_req(void *telephony_device, const char *cmd);
-void telephony_nr_and_ec_req(void *telephony_device, gboolean enable);
-void telephony_voice_dial_req(void *telephony_device, gboolean enable);
-void telephony_key_press_req(void *telephony_device, const char *keys);
+gboolean telephony_get_ready_state(void);
+uint32_t telephony_get_ag_features(void);
 
 /* AG responses to HF requests. These are implemented by headset.c */
 int telephony_event_reporting_rsp(void *telephony_device, cme_error_t err);
@@ -240,5 +227,5 @@ static inline int telephony_get_indicator(const struct indicator *indicators,
 	return -ENOENT;
 }
 
-int telephony_init(void);
-void telephony_exit(void);
+int telephony_init(void *adapter);
+void telephony_exit(void *adapter);
doc/audio-api.txt +91 -0

94 lines not on this page · raw message

Signature · 1 line
1.7.1