emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/bluetooth b6c501ae6e 04/32: add bluetooth--adapters fun


From: Stefan Kangas
Subject: [elpa] externals/bluetooth b6c501ae6e 04/32: add bluetooth--adapters function
Date: Mon, 3 Jan 2022 15:11:06 -0500 (EST)

branch: externals/bluetooth
commit b6c501ae6ef91ab5311fd1548a94422208a27060
Author: Raffael Stocker <r.stocker@mnet-mail.de>
Commit: Raffael Stocker <r.stocker@mnet-mail.de>

    add bluetooth--adapters function
    
    * bluetooth.el (bluetooth-mode-map): new function, return a list of 
bluetooth
    adapters in the system
---
 bluetooth.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bluetooth.el b/bluetooth.el
index e5dc066b1e..07a32f5b55 100644
--- a/bluetooth.el
+++ b/bluetooth.el
@@ -347,6 +347,10 @@ profiles."
 
 (defun bluetooth--device-property (device prop-name)
   (cdr (assoc prop-name (bluetooth-device-properties device))))
+(defun bluetooth--adapters ()
+  "Return a list of bluetooth adapters."
+  (dbus-introspect-get-node-names
+   bluetooth-bluez-bus bluetooth--service bluetooth--root))
 
 (defun bluetooth--get-devices ()
   "Return a list of bluetooth adapters and devices connected to them."
@@ -448,7 +452,7 @@ as they are used to gather the information from Bluez.")
                                        ((eq :adapter api)
                                         (concat bluetooth--root
                                                         "/"
-                                                        (caar 
(bluetooth--get-devices))))
+                                                        (cl-first 
(bluetooth--adapters))))
                                        (t nil)))
                (interface (alist-get api bluetooth--interfaces)))
        (when path



reply via email to

[Prev in Thread] Current Thread [Next in Thread]