[RFCv2 11/17] bluetooth: Create API to get BlueZ version

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jo?o Paulo Rechi Vita <jprvita@xxxxxxxxxxxxx>

---
 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 da1e827..95c051f 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;
 
@@ -150,6 +144,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 3361b0f..e627e1d 100644
--- a/src/modules/bluetooth/bluetooth-util.h
+++ b/src/modules/bluetooth/bluetooth-util.h
@@ -113,6 +113,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;
@@ -141,6 +147,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



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux