UUID(Universally Unique Identifier / 通用唯一標識符)是一個全球唯一的 128位 / 128-bit(16字節 / 16 bytes)藍牙編號,它是根據『RFC 4122』規範產生的隨機碼。GATT(Generic Attribute Profile)層中定義的所有屬性都有一個 UUID 值,用於標識通用屬性 GATT 配置文件中的配置文件、服務和數據類型。UUID 用於藍牙以外的許多協議和應用程序中,UUID 的格式、用法在 IETF(Internet Engineering Task Force)公佈的標準 RFC 4122 中定義(技術上等同於 ITU-T Rec. X.667 | ISO / IEC 9834-8:2005 規範)。
| 藍牙(Bluetooth)GATT-Profile |
- Time-based UUID (Version 1)
- DCE Security UUID (Version 2)
- Name-based UUID (Version 3 and 5)
- Randomly Generated UUID (Version 4)
UUID 版本 4 使用隨機數作為來源,它使用不可預測的值作為種子來生成隨機數以減少碰撞的機會 UUID 可用於以下情況。
- 作為數據庫表的主鍵
- 為 Web 應用程序創建會話 ID
- 表示為事務 ID
- 創建隨機文件名
| 藍牙(Bluetooth)UUID 的格式 |
藍牙(Bluetooth)UUID 的格式:0000xxxx-0000-1000-8000-00805F9B34FB,而 xxxx 部份就是所謂的 UUID16 定義。UUID 由十六進制數字和 4 個連字符(“-”)組成。 UUID 的長度為 36 個字符。在開發中我們需要獲取設備的 UUID 欄位,可以通過藍牙測試工具查看 service UUID 和 characteristic UUID,然後每個 Service 又包含了多個 Characteristic,主機和從機之間的通信,均是通過 Characteristic 來實現。
藍牙(Bluetooth)UUID:
|
Class ID |
UUID |
|
BASE UUID |
00000000-0000-1000-8000-00805F9B34FB |
|
SDP_PROTOCOL |
00000001-0000-1000-8000-00805F9B34FB |
|
UDP_PROTOCOL |
00000002-0000-1000-8000-00805F9B34FB |
|
RFCOMM_PROTOCOL |
00000003-0000-1000-8000-00805F9B34FB |
|
TCP_PROTOCOL |
00000004-0000-1000-8000-00805F9B34FB |
|
TCSBIN_PROTOCOL |
00000005-0000-1000-8000-00805F9B34FB |
|
TCSAT_PROTOCOL |
00000006-0000-1000-8000-00805F9B34FB |
|
OBEX_PROTOCOL |
00000008-0000-1000-8000-00805F9B34FB |
|
IP_PROTOCOL |
00000009-0000-1000-8000-00805F9B34FB |
|
FTP_PROTOCOL |
0000000A-0000-1000-8000-00805F9B34FB |
|
HTTP_PROTOCOL |
0000000C-0000-1000-8000-00805F9B34FB |
|
WSP_PROTOCOL |
0000000E-0000-1000-8000-00805F9B34FB |
|
BNEP_PROTOCOL |
0000000F-0000-1000-8000-00805F9B34FB |
|
UPNP_PROTOCOL |
00000010-0000-1000-8000-00805F9B34FB |
|
HID_PROTOCOL |
00000011-0000-1000-8000-00805F9B34FB |
|
HCCC_PROTOCOL |
00000012-0000-1000-8000-00805F9B34FB |
|
HCDC_PROTOCOL |
00000014-0000-1000-8000-00805F9B34FB |
|
HN_PROTOCOL |
00000016-0000-1000-8000-00805F9B34FB |
|
AVCTP_PROTOCOL |
00000017-0000-1000-8000-00805F9B34FB |
|
AVDTP_PROTOCOL |
00000019-0000-1000-8000-00805F9B34FB |
|
CMPT_PROTOCOL |
0000001B-0000-1000-8000-00805F9B34FB |
|
UDI_C_PLANE_PROTOCOL |
0000001D-0000-1000-8000-00805F9B34FB |
|
L2CAP_PROTOCOL |
00000100-0000-1000-8000-00805F9B34FB |
|
ServiceDiscoveryServerServiceClassID |
00001000-0000-1000-8000-00805F9B34FB |
|
BrowseGroupDescriptorServiceClassID |
00001001-0000-1000-8000-00805F9B34FB |
|
PublicBrowseGroupServiceClass |
00001002-0000-1000-8000-00805F9B34FB |
|
SerialPortServiceClass |
00001101-0000-1000-8000-00805F9B34FB |
|
LANAccessUsingPPPServiceClass |
00001102-0000-1000-8000-00805F9B34FB |
|
DialupNetworkingServiceClass |
00001103-0000-1000-8000-00805F9B34FB |
|
IrMCSyncServiceClass |
00001104-0000-1000-8000-00805F9B34FB |
|
SDP_OBEXObjectPushServiceClass |
00001105-0000-1000-8000-00805F9B34FB |
|
OBEXFileTransferServiceClass |
00001106-0000-1000-8000-00805F9B34FB |
|
IrMCSyncCommandServiceClass |
00001107-0000-1000-8000-00805F9B34FB |
|
SDP_HeadsetServiceClass |
00001108-0000-1000-8000-00805F9B34FB |
|
CordlessTelephonyServiceClass |
00001109-0000-1000-8000-00805F9B34FB |
|
SDP_AudioSourceServiceClass |
0000110A-0000-1000-8000-00805F9B34FB |
|
SDP_AudioSinkServiceClass |
0000110B-0000-1000-8000-00805F9B34FB |
|
SDP_AVRemoteControlTargetServiceClass |
0000110C-0000-1000-8000-00805F9B34FB |
|
SDP_AdvancedAudioDistributionServiceClass |
0000110D-0000-1000-8000-00805F9B34FB |
|
SDP_AVRemoteControlServiceClass |
0000110E-0000-1000-8000-00805F9B34FB |
|
VideoConferencingServiceClass |
0000110F-0000-1000-8000-00805F9B34FB |
|
IntercomServiceClass |
00001110-0000-1000-8000-00805F9B34FB |
|
FaxServiceClass |
00001111-0000-1000-8000-00805F9B34FB |
|
HeadsetAudioGatewayServiceClass |
00001112-0000-1000-8000-00805F9B34FB |
|
WAPServiceClass |
00001113-0000-1000-8000-00805F9B34FB |
|
WAPClientServiceClass |
00001114-0000-1000-8000-00805F9B34FB |
|
PANUServiceClass |
00001115-0000-1000-8000-00805F9B34FB |
|
NAPServiceClass |
00001116-0000-1000-8000-00805F9B34FB |
|
GNServiceClass |
00001117-0000-1000-8000-00805F9B34FB |
|
DirectPrintingServiceClass |
00001118-0000-1000-8000-00805F9B34FB |
|
ReferencePrintingServiceClass |
00001119-0000-1000-8000-00805F9B34FB |
|
ImagingServiceClass |
0000111A-0000-1000-8000-00805F9B34FB |
|
ImagingResponderServiceClass |
0000111B-0000-1000-8000-00805F9B34FB |
|
ImagingAutomaticArchiveServiceClass |
0000111C-0000-1000-8000-00805F9B34FB |
|
ImagingReferenceObjectsServiceClass |
0000111D-0000-1000-8000-00805F9B34FB |
|
SDP_HandsfreeServiceClass |
0000111E-0000-1000-8000-00805F9B34FB |
|
HandsfreeAudioGatewayServiceClass |
0000111F-0000-1000-8000-00805F9B34FB |
|
DirectPrintingReferenceObjectsServiceClass |
00001120-0000-1000-8000-00805F9B34FB |
|
ReflectedUIServiceClass |
00001121-0000-1000-8000-00805F9B34FB |
|
BasicPringingServiceClass |
00001122-0000-1000-8000-00805F9B34FB |
|
PrintingStatusServiceClass |
00001123-0000-1000-8000-00805F9B34FB |
|
HumanInterfaceDeviceServiceClass |
00001124-0000-1000-8000-00805F9B34FB |
|
HardcopyCableReplacementServiceClass |
00001125-0000-1000-8000-00805F9B34FB |
|
HCRPrintServiceClass |
00001126-0000-1000-8000-00805F9B34FB |
|
HCRScanServiceClass |
00001127-0000-1000-8000-00805F9B34FB |
|
CommonISDNAccessServiceClass |
00001128-0000-1000-8000-00805F9B34FB |
|
VideoConferencingGWServiceClass |
00001129-0000-1000-8000-00805F9B34FB |
|
UDIMTServiceClass |
0000112A-0000-1000-8000-00805F9B34FB |
|
UDITAServiceClass |
0000112B-0000-1000-8000-00805F9B34FB |
|
AudioVideoServiceClass |
0000112C-0000-1000-8000-00805F9B34FB |
|
SIMAccessServiceClass |
0000112D-0000-1000-8000-00805F9B34FB |
|
Phonebook Access Server |
0000112F-0000-1000-8000-00805F9B34FB |
|
PnPInformationServiceClass |
00001200-0000-1000-8000-00805F9B34FB |
|
GenericNetworkingServiceClass |
00001201-0000-1000-8000-00805F9B34FB |
|
GenericFileTransferServiceClass |
00001202-0000-1000-8000-00805F9B34FB |
|
GenericAudioServiceClass |
00001203-0000-1000-8000-00805F9B34FB |
|
GenericTelephonyServiceClass |
00001204-0000-1000-8000-00805F9B34FB |
|
UPnPServiceClass |
00001205-0000-1000-8000-00805F9B34FB |
|
UPnPIpServiceClass |
00001206-0000-1000-8000-00805F9B34FB |
|
ESdpUPnPIpPanServiceClass |
00001300-0000-1000-8000-00805F9B34FB |
|
ESdpUPnPIpLapServiceClass |
00001301-0000-1000-8000-00805F9B34FB |
|
EdpUPnpIpL2CAPServiceClass |
00001302-0000-1000-8000-00805F9B34FB |
|
Video Distribution Profile - Source |
00001303-0000-1000-8000-00805F9B34FB |
|
Video Distribution Profile - Sink |
00001304-0000-1000-8000-00805F9B34FB |
|
Video Distribution Profile |
00001305-0000-1000-8000-00805F9B34FB |
|
Health Device Profile (HDP) |
00001400-0000-1000-8000-00805F9B34FB |
|
Health Device Profile (HDP) - Source |
00001401-0000-1000-8000-00805F9B34FB |
|
Health Device Profile (HDP) - Sink |
00001402-0000-1000-8000-00805F9B34FB |
|
GenericAccess |
00001800-0000-1000-8000-00805F9B34FB |
|
GenericAttribute |
00001801-0000-1000-8000-00805F9B34FB |
|
Immediate Alert |
00001802-0000-1000-8000-00805F9B34FB |
|
Link Loss |
00001803-0000-1000-8000-00805F9B34FB |
|
Tx Power |
00001804-0000-1000-8000-00805F9B34FB |
|
Current Time Service |
00001805-0000-1000-8000-00805F9B34FB |
|
Reference Time Update Service |
00001806-0000-1000-8000-00805F9B34FB |
|
Next DST Change Service |
00001807-0000-1000-8000-00805F9B34FB |
|
Glucose |
00001808-0000-1000-8000-00805F9B34FB |
|
Health Thermometer |
00001809-0000-1000-8000-00805F9B34FB |
|
Device Information |
0000180A-0000-1000-8000-00805F9B34FB |
|
Network Availability |
0000180B-0000-1000-8000-00805F9B34FB |
|
Watchdog |
0000180C-0000-1000-8000-00805F9B34FB |
|
Heart Rate |
0000180D-0000-1000-8000-00805F9B34FB |
|
Phone Alert Status Service |
0000180E-0000-1000-8000-00805F9B34FB |
|
Battery Service |
0000180F-0000-1000-8000-00805F9B34FB |
|
Blood Pressure |
00001810-0000-1000-8000-00805F9B34FB |
|
Alert Notification Service |
00001811-0000-1000-8000-00805F9B34FB |
|
Human Interface Device |
00001812-0000-1000-8000-00805F9B34FB |
|
Scan Parameters |
00001813-0000-1000-8000-00805F9B34FB |
|
Running Speed and Cadence |
00001814-0000-1000-8000-00805F9B34FB |
|
Automation IO |
00001815-0000-1000-8000-00805F9B34FB |
|
Cycling Speed and Cadence |
00001816-0000-1000-8000-00805F9B34FB |
|
Cycling Power |
00001818-0000-1000-8000-00805F9B34FB |
|
Location and Navigation |
00001819-0000-1000-8000-00805F9B34FB |
|
Continous Glucose Measurement Service |
0000181A-0000-1000-8000-00805F9B34FB |
|
Root service |
0000FE95-0000-1000-8000-00805F9B34FB |
參考網址:
※ O'Reilly Chapter 4. GATT (Services and Characteristics)
※ Bluetooth SIG 16-bit UUIDs
※ BLE 藍牙的 UUID 列表
※ 元宵節快樂!
沒有留言:
張貼留言