[pulseaudio-discuss] [RFCv3 11/20] bluetooth: Create API to get BlueZ version

jprvita at gmail.com jprvita at gmail.com
Sun Apr 21 20:07:41 PDT 2013


From: João Paulo Rechi Vita <jprvita at openbossa.org>

---
 src/modules/bluetooth/bluetooth-util.c | 10 ++++------
 src/modules/bluetooth/bluetooth-util.h |  7 +++++++
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index 8433a3a..ef11b9e 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -104,12 +104,6 @@
     "  </interface>"                                                    \
     "</node>"
 
-typedef enum pa_bluez_version {
-    BLUEZ_VERSION_UNKNOWN,
-    BLUEZ_VERSION_4,
-    BLUEZ_VERSION_5,
-} pa_bluez_version_t;
-
 struct pa_bluetooth_discovery {
     PA_REFCNT_DECLARE;
 
@@ -148,6 +142,10 @@ static pa_dbus_pending* send_and_add_to_pending(pa_bluetooth_discovery *y, DBusM
 static void found_adapter(pa_bluetooth_discovery *y, const char *path);
 static pa_bluetooth_device *found_device(pa_bluetooth_discovery *y, const char* path);
 
+pa_bluez_version_t pa_bluetooth_discovery_get_bluez_version(pa_bluetooth_discovery *y) {
+    return y->version;
+}
+
 static pa_bt_audio_state_t audio_state_from_string(const char* value) {
     pa_assert(value);
 
diff --git a/src/modules/bluetooth/bluetooth-util.h b/src/modules/bluetooth/bluetooth-util.h
index 949521f..d9968cf 100644
--- a/src/modules/bluetooth/bluetooth-util.h
+++ b/src/modules/bluetooth/bluetooth-util.h
@@ -115,6 +115,12 @@ typedef enum pa_bt_audio_state {
     PA_BT_AUDIO_STATE_PLAYING
 } pa_bt_audio_state_t;
 
+typedef enum pa_bluez_version {
+    BLUEZ_VERSION_UNKNOWN,
+    BLUEZ_VERSION_4,
+    BLUEZ_VERSION_5,
+} pa_bluez_version_t;
+
 struct pa_bluetooth_device {
     pa_bluetooth_discovery *discovery;
     bool dead;
@@ -143,6 +149,7 @@ pa_bluetooth_discovery* pa_bluetooth_discovery_get(pa_core *core);
 pa_bluetooth_discovery* pa_bluetooth_discovery_ref(pa_bluetooth_discovery *y);
 void pa_bluetooth_discovery_unref(pa_bluetooth_discovery *d);
 
+pa_bluez_version_t pa_bluetooth_discovery_get_bluez_version(pa_bluetooth_discovery *y);
 pa_bluetooth_device* pa_bluetooth_discovery_get_by_path(pa_bluetooth_discovery *d, const char* path);
 pa_bluetooth_device* pa_bluetooth_discovery_get_by_address(pa_bluetooth_discovery *d, const char* address);
 
-- 
1.7.11.7



More information about the pulseaudio-discuss mailing list