[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/bluetooth 5387639 52/57: adds path loss to device info
From: |
Stefan Monnier |
Subject: |
[elpa] externals/bluetooth 5387639 52/57: adds path loss to device info |
Date: |
Thu, 7 Nov 2019 23:29:00 -0500 (EST) |
branch: externals/bluetooth
commit 53876393b231aae5a1770526ad71ed8a76ddedae
Author: Raffael Stocker <address@hidden>
Commit: Raffael Stocker <address@hidden>
adds path loss to device info
---
bluetooth.el | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/bluetooth.el b/bluetooth.el
index 01d90e4..f995236 100644
--- a/bluetooth.el
+++ b/bluetooth.el
@@ -1430,14 +1430,11 @@ For documentation, see URL
`https://gitlab.com/rstocker/emacs-bluetooth'."
(cl-flet ((ins-heading (text)
(insert (propertize text 'face
'bluetooth-info-heading)))
- (ins-attr (attr value &optional unit)
+ (ins-attr (attr value)
(insert (propertize (format "%15s" attr)
'face
'bluetooth-info-attribute))
- (insert ": " value)
- (when unit
- (insert " " unit))
- (insert "\n")))
+ (insert ": " value "\n")))
(let ((dev-id (tabulated-list-get-id)))
(when dev-id
(bluetooth--with-alias dev-id
@@ -1452,12 +1449,15 @@ For documentation, see URL
`https://gitlab.com/rstocker/emacs-bluetooth'."
(ins-attr "Address" address))
(when-let (addr-type (cdr (assoc "AddressType" props)))
(ins-attr "Address type" addr-type))
- (when-let (rssi (cdr (assoc "RSSI" props)))
- (ins-attr "RSSI" (number-to-string rssi) "dBm"))
- (when-let (tx-power (cdr (assoc "TxPower" props)))
- (ins-attr "Tx Power" (number-to-string tx-power) "dBm"))
+ (let ((rssi (cdr (assoc "RSSI" props)))
+ (tx-power (cdr (assoc "TxPower" props))))
+ (when rssi
+ (ins-attr "RSSI" (format "%4d dBm" rssi)))
+ (when tx-power
+ (ins-attr "Tx Power" (format "%4d dBm" tx-power)))
+ (when (and rssi tx-power)
+ (ins-attr "Path loss" (format "%4d dB" (- tx-power rssi)))))
(when-let (mf-info (cadr (assoc "ManufacturerData" props)))
- (message "%S" mf-info)
(ins-attr "Manufacturer" (bluetooth--manufacturer
(car mf-info))))
(when-let (class (cdr (assoc "Class" props)))
- [elpa] externals/bluetooth 83344c8 20/57: cleans up display code, (continued)
- [elpa] externals/bluetooth 83344c8 20/57: cleans up display code, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth fe926e9 28/57: puts functions before the long uuid defconsts for readability, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth c473128 40/57: adds repository URL to mode (entry) command docstring, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth eb1d4ea 25/57: adds UUID and service/device class parsing and display, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth f9bfd26 39/57: fixes a grammatical mistake in Readme.org, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 565cfec 38/57: adds more elaborate usage information, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 7714f6b 45/57: updates Readme, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 1f3b244 47/57: makes checkdoc and package-lint happy, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 9d79f61 46/57: puts the key bindings in their own defvar (as is usual), Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth fd39a17 50/57: cleans up movement to beginning/end of list, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 5387639 52/57: adds path loss to device info,
Stefan Monnier <=
- [elpa] externals/bluetooth ea7ccf7 53/57: fixes mode line update, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 21e6a14 34/57: adds hl-line-mode activation, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth cb5a39c 29/57: adds SDO UUIDs and simplifies the UUID handling functions, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 44e81ed 42/57: rearranges UUID data and functions, concentrates interface names, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 72f061d 48/57: updates commentary and cleans up whitespace, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 2ce2322 49/57: improves device info printing, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth e002888 27/57: updates Readme.org, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 15d1f53 37/57: adds a pointer to the source of assigned numbers data, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth d749581 41/57: removes unused `bluetooth--own-intf', Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 291e863 43/57: separates adapter api calls from device ids, Stefan Monnier, 2019/11/07