Open Source Telephony
 help / color / mirror / Atom feed
* [PATCH 1/5] hfp_hf_bluez5: Add a card driver for HFP 1.6
@ 2013-03-28  0:12 Vinicius Costa Gomes
  2013-03-28  0:12 ` [PATCH 2/5] include: Add ofono_handsfree_card_connect_sco() Vinicius Costa Gomes
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Vinicius Costa Gomes @ 2013-03-28  0:12 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2067 bytes --]

This is just the skeleton of a Handsfree Audio Card for the HF side of
HFP 1.6.
---
 plugins/hfp_hf_bluez5.c | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c
index ff8afba..e2fa70c 100644
--- a/plugins/hfp_hf_bluez5.c
+++ b/plugins/hfp_hf_bluez5.c
@@ -60,6 +60,8 @@
 
 #define HFP_EXT_PROFILE_PATH   "/bluetooth/profile/hfp_hf"
 
+#define HFP16_HF_DRIVER		"hfp16-hf-driver"
+
 struct hfp {
 	struct hfp_slc_info info;
 	DBusMessage *msg;
@@ -310,6 +312,31 @@ static struct ofono_modem_driver hfp_driver = {
 	.post_sim	= hfp_post_sim,
 };
 
+static int hfp16_card_probe(struct ofono_handsfree_card *card,
+					unsigned int vendor, void *data)
+{
+	return 0;
+}
+
+static void hfp16_card_remove(struct ofono_handsfree_card *card)
+{
+
+}
+
+static void hfp16_card_connect(struct ofono_handsfree_card *card,
+					ofono_handsfree_card_connect_cb_t cb,
+					void *data)
+{
+
+}
+
+static struct ofono_handsfree_card_driver hfp16_hf_driver = {
+	.name		= HFP16_HF_DRIVER,
+	.probe		= hfp16_card_probe,
+	.remove		= hfp16_card_remove,
+	.connect	= hfp16_card_connect,
+};
+
 static ofono_bool_t device_path_compare(struct ofono_modem *modem,
 					void *userdata)
 {
@@ -616,6 +643,13 @@ static int hfp_init(void)
 		return -EIO;
 	}
 
+	err = ofono_handsfree_card_driver_register(&hfp16_hf_driver);
+	if (err < 0) {
+		g_dbus_unregister_interface(conn, HFP_EXT_PROFILE_PATH,
+						BLUEZ_PROFILE_INTERFACE);
+		return err;
+	}
+
 	err = ofono_modem_driver_register(&hfp_driver);
 	if (err < 0) {
 		g_dbus_unregister_interface(conn, HFP_EXT_PROFILE_PATH,
@@ -647,6 +681,9 @@ static void hfp_exit(void)
 	bt_unregister_profile(conn, HFP_EXT_PROFILE_PATH);
 	g_dbus_unregister_interface(conn, HFP_EXT_PROFILE_PATH,
 						BLUEZ_PROFILE_INTERFACE);
+
+	ofono_handsfree_card_driver_unregister(&hfp16_hf_driver);
+
 	ofono_modem_driver_unregister(&hfp_driver);
 	g_dbus_client_unref(bluez);
 
-- 
1.8.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-04-02 21:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-28  0:12 [PATCH 1/5] hfp_hf_bluez5: Add a card driver for HFP 1.6 Vinicius Costa Gomes
2013-03-28  0:12 ` [PATCH 2/5] include: Add ofono_handsfree_card_connect_sco() Vinicius Costa Gomes
2013-03-28 14:37   ` Denis Kenzior
2013-03-28  0:13 ` [PATCH 3/5] handsfree-audio: Add ofono_handsfree_card_connect_sco Vinicius Costa Gomes
2013-03-28 14:37   ` Denis Kenzior
2013-03-28  0:13 ` [PATCH 4/5] handsfree-audio: Add .Connect using the card driver Vinicius Costa Gomes
2013-03-28 14:38   ` Denis Kenzior
2013-03-28  0:13 ` [PATCH 5/5] handsfree-audio: Handle when .Connect() was already replied to Vinicius Costa Gomes
2013-03-28 14:41   ` Denis Kenzior
2013-04-02 21:11     ` Vinicius Costa Gomes
2013-03-28 14:37 ` [PATCH 1/5] hfp_hf_bluez5: Add a card driver for HFP 1.6 Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox