[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/bluetooth 3c25a8c 23/57: adds basic service class UUID
From: |
Stefan Monnier |
Subject: |
[elpa] externals/bluetooth 3c25a8c 23/57: adds basic service class UUID parsing |
Date: |
Thu, 7 Nov 2019 23:28:52 -0500 (EST) |
branch: externals/bluetooth
commit 3c25a8cb7677e09da3148d4a829996518491882e
Author: Raffael Stocker <address@hidden>
Commit: Raffael Stocker <address@hidden>
adds basic service class UUID parsing
---
bluetooth.el | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 94 insertions(+)
diff --git a/bluetooth.el b/bluetooth.el
index ab2f281..dfadbd7 100644
--- a/bluetooth.el
+++ b/bluetooth.el
@@ -44,6 +44,7 @@
(require 'cl-lib)
(require 'let-alist)
(require 'dash)
+(require 'rx)
(defconst bluetooth-buffer-name "*Bluetooth*"
"Name of the buffer in which to list bluetooth devices.")
@@ -516,6 +517,99 @@ This function only uses the first adapter reported by
Bluez."
:object-path bluetooth--own-path)
(mapc #'dbus-unregister-object bluetooth--method-objects)))
+;;; Application layer
+
+(defconst bluetooth--service-class-uuid-alist
+ '((#x1000 . ("ServiceDiscoveryServerServiceClassID" "Bluetooth Core
Specification"))
+ (#x1001 . ("BrowseGroupDescriptorServiceClassID" "Bluetooth Core
Specification"))
+ (#x1101 . ("SerialPort" "Serial Port Profile (SPP)"))
+ (#x1102 . ("LANAccessUsingPPP" "LAN Access Profile"))
+ (#x1103 . ("DialupNetworking" "Dial-up Networking Profile (DUN)"))
+ (#x1104 . ("IrMCSync" "Synchronization Profile (SYNC)"))
+ (#x1105 . ("OBEXObjectPush" "Object Push Profile (OPP)"))
+ (#x1106 . ("OBEXFileTransfer" "File Transfer Profile (FTP)"))
+ (#x1107 . ("IrMCSyncCommand" "Synchronization Profile (SYNC)"))
+ (#x1108 . ("Headset" "Headset Profile (HSP)"))
+ (#x1109 . ("CordlessTelephony" "Cordless Telephony Profile (CTP)"))
+ (#x110A . ("AudioSource" "Advanced Audio Distribution Profile (A2DP)"))
+ (#x110B . ("AudioSink" "Advanced Audio Distribution Profile (A2DP)"))
+ (#x110C . ("A/V_RemoteControlTarget" "Audio/Video Remote Control Profile
(AVRCP)"))
+ (#x110D . ("AdvancedAudioDistribution" "Advanced Audio Distribution
Profile (A2DP)"))
+ (#x110E . ("A/V_RemoteControl" "Audio/Video Remote Control Profile
(AVRCP)"))
+ (#x110F . ("A/V_RemoteControlController" "Audio/Video Remote Control
Profile (AVRCP)"))
+ (#x1110 . ("Intercom" "Intercom Profile (ICP)"))
+ (#x1111 . ("Fax" "Fax Profile (FAX)"))
+ (#x1112 . ("Headset - Audio Gateway (AG)" "Headset Profile (HSP)"))
+ (#x1113 . ("WAP" "Interoperability Requirements for Bluetooth technology
as a WAP, Bluetooth SIG "))
+ (#x1114 . ("WAP_CLIENT" "Interoperability Requirements for Bluetooth
technology as a WAP, Bluetooth SIG "))
+ (#x1115 . ("PANU" "Personal Area Networking Profile (PAN)"))
+ (#x1116 . ("NAP" "Personal Area Networking Profile (PAN)"))
+ (#x1117 . ("GN" "Personal Area Networking Profile (PAN)"))
+ (#x1118 . ("DirectPrinting" "Basic Printing Profile (BPP)"))
+ (#x1119 . ("ReferencePrinting" "See Basic Printing Profile (BPP)"))
+ (#x111A . ("Basic Imaging Profile" "Basic Imaging Profile (BIP)"))
+ (#x111B . ("ImagingResponder" "Basic Imaging Profile (BIP)"))
+ (#x111C . ("ImagingAutomaticArchive" "Basic Imaging Profile (BIP)"))
+ (#x111D . ("ImagingReferencedObjects" "Basic Imaging Profile (BIP)"))
+ (#x111E . ("Handsfree" "Hands-Free Profile (HFP)"))
+ (#x111F . ("HandsfreeAudioGateway" "Hands-free Profile (HFP)"))
+ (#x1120 . ("DirectPrintingReferenceObjectsService" "Basic Printing Profile
(BPP)"))
+ (#x1121 . ("ReflectedUI" "Basic Printing Profile (BPP)"))
+ (#x1122 . ("BasicPrinting" "Basic Printing Profile (BPP)"))
+ (#x1123 . ("PrintingStatus" "Basic Printing Profile (BPP)"))
+ (#x1124 . ("HumanInterfaceDeviceService" "Human Interface Device (HID)"))
+ (#x1125 . ("HardcopyCableReplacement" "Hardcopy Cable Replacement Profile
(HCRP)"))
+ (#x1126 . ("HCR_Print" "Hardcopy Cable Replacement Profile (HCRP)"))
+ (#x1127 . ("HCR_Scan" "Hardcopy Cable Replacement Profile (HCRP)"))
+ (#x1128 . ("Common_ISDN_Access" "Common ISDN Access Profile (CIP)"))
+ (#x112D . ("SIM_Access" "SIM Access Profile (SAP)"))
+ (#x112E . ("Phonebook Access - PCE" "Phonebook Access Profile (PBAP)"))
+ (#x112F . ("Phonebook Access - PSE" "Phonebook Access Profile (PBAP)"))
+ (#x1130 . ("Phonebook Access" "Phonebook Access Profile (PBAP)"))
+ (#x1131 . ("Headset - HS" "Headset Profile (HSP)"))
+ (#x1132 . ("Message Access Server" "Message Access Profile (MAP)"))
+ (#x1133 . ("Message Notification Server" "Message Access Profile (MAP)"))
+ (#x1134 . ("Message Access Profile" "Message Access Profile (MAP)"))
+ (#x1135 . ("GNSS" "Global Navigation Satellite System Profile (GNSS)"))
+ (#x1136 . ("GNSS_Server" "Global Navigation Satellite System Profile
(GNSS)"))
+ (#x1137 . ("3D Display" "3D Synchronization Profile (3DSP)"))
+ (#x1138 . ("3D Glasses" "3D Synchronization Profile (3DSP)"))
+ (#x1139 . ("3D Synchronization" "3D Synchronization Profile (3DSP)"))
+ (#x113A . ("MPS Profile UUID" "Multi-Profile Specification (MPS)"))
+ (#x113B . ("MPS SC UUID" "Multi-Profile Specification (MPS)"))
+ (#x113C . ("CTN Access Service" "Calendar, Task, and Notes (CTN)
Profile"))
+ (#x113D . ("CTN Notification Service" "Calendar Tasks and Notes (CTN)
Profile"))
+ (#x113E . ("CTN Profile" "Calendar Tasks and Notes (CTN) Profile"))
+ (#x1200 . ("PnPInformation" "Device Identification (DID)"))
+ (#x1201 . ("GenericNetworking" "N/A"))
+ (#x1202 . ("GenericFileTransfer" "N/A"))
+ (#x1203 . ("GenericAudio" "N/A"))
+ (#x1204 . ("GenericTelephony" "N/A"))
+ (#x1205 . ("UPNP_Service" "Enhanced Service Discovery Profile (ESDP)"))
+ (#x1206 . ("UPNP_IP_Service" "Enhanced Service Discovery Profile (ESDP)"))
+ (#x1300 . ("ESDP_UPNP_IP_PAN" "Enhanced Service Discovery Profile (ESDP)"))
+ (#x1301 . ("ESDP_UPNP_IP_LAP" "Enhanced Service Discovery Profile (ESDP)"))
+ (#x1302 . ("ESDP_UPNP_L2CAP" "Enhanced Service Discovery Profile (ESDP)"))
+ (#x1303 . ("VideoSource" "Video Distribution Profile (VDP)"))
+ (#x1304 . ("VideoSink" "Video Distribution Profile (VDP)"))
+ (#x1305 . ("VideoDistribution" "Video Distribution Profile (VDP)"))
+ (#x1400 . ("HDP" "Health Device Profile"))
+ (#x1401 . ("HDP Source" "Health Device Profile (HDP)"))
+ (#x1402 . ("HDP Sink" "Health Device Profile (HDP)")))
+ "Bluetooth service class UUIDs.")
+
+(defconst bluetooth--base-uuid "0000-1000-8000-00805f9b34fb"
+ "Bluetooth base UUID.")
+
+(defun bluetooth--parse-service-class-uuid (uuid)
+ "Parse UUID and return short and long service class names."
+ (let ((uuid-re (rx (seq bos (submatch (= 8 xdigit))
+ "-" (eval bluetooth--base-uuid) eos))))
+ (save-match-data
+ (when (string-match uuid-re uuid)
+ (alist-get (string-to-number (match-string 1 uuid) 16)
+ bluetooth--service-class-uuid-alist)))))
+
(provide 'bluetooth)
;;; bluetooth.el ends here
- [elpa] externals/bluetooth f33cb12 02/57: Add LICENSE, (continued)
- [elpa] externals/bluetooth f33cb12 02/57: Add LICENSE, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth ee4e582 30/57: fixes compiler warnings about unused parameters, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 3365413 33/57: corrects the major mode check in `list-bluetooth-devices', Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth b47bddc 36/57: switches device-info buffer to special mode, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 42a9487 35/57: moves `hl-line-mode' to end of init so hl is shown at startup, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 325febd 16/57: adds Imenu integration to Readme feature list, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth f0e5047 18/57: removes unnecessary quotes before lambdas and corrects indentation, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 738347b 19/57: adds TAGS to .gitignore, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 28e9eb2 21/57: wraps @body in progn in bluetooth--maybe-cancel-reject, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 4133a10 13/57: makes mode idempotent, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 3c25a8c 23/57: adds basic service class UUID parsing,
Stefan Monnier <=
- [elpa] externals/bluetooth 5219f05 31/57: fixes a compile error and adds customization, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 0108cbd 32/57: uses `read-from-minibuffer' instead of `read-passwd', Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 1ec2997 22/57: uses the correct bus (:system) for the callback methods, Stefan Monnier, 2019/11/07
- [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