Android 蓝牙开发常用UUID表

本文档详细列举了蓝牙设备中的各项服务及其特征,包括心率监测、设备信息、通用访问等服务,以及设备名称、外观、制造商名称等特性。涵盖了蓝牙设备的主要功能和数据交换类型。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Sample Services
0000180d-0000-1000-8000-00805f9b34fb    Heart Rate Service    
0000180a-0000-1000-8000-00805f9b34fb    Device Information Service    
Sample Characteristics. 
00002a37-0000-1000-8000-00805f9b34fb    Heart Rate Measurement    
00002a29-0000-1000-8000-00805f9b34fb    Manufacturer Name String    
    
GATT Services 
00001800-0000-1000-8000-00805f9b34fb    GenericAccess    
00001801-0000-1000-8000-00805f9b34fb    GenericAttribute    
 
GATT Declarations 
00002800-0000-1000-8000-00805f9b34fb    Primary Service    
00002801-0000-1000-8000-00805f9b34fb    Secondary Service    
00002802-0000-1000-8000-00805f9b34fb    Include    
00002803-0000-1000-8000-00805f9b34fb    Characteristic    
         
GATT Descriptors 
00002900-0000-1000-8000-00805f9b34fb    Characteristic Extended Properties    
00002901-0000-1000-8000-00805f9b34fb    Characteristic User Description    
00002902-0000-1000-8000-00805f9b34fb    Client Characteristic Configuration    
00002903-0000-1000-8000-00805f9b34fb    Server Characteristic Configuration    
00002904-0000-1000-8000-00805f9b34fb    Characteristic Presentation Format    
00002905-0000-1000-8000-00805f9b34fb    Characteristic Aggregate Format    
00002906-0000-1000-8000-00805f9b34fb    Valid Range    
00002907-0000-1000-8000-00805f9b34fb    External Report Reference Descriptor    
00002908-0000-1000-8000-00805f9b34fb    Report Reference Descriptor    
 
GATT Characteristics 
00002a00-0000-1000-8000-00805f9b34fb    Device Name    
00002a01-0000-1000-8000-00805f9b34fb    Appearance    
00002a02-0000-1000-8000-00805f9b34fb    Peripheral Privacy Flag    
00002a03-0000-1000-8000-00805f9b34fb    Reconnection Address    
00002a04-0000-1000-8000-00805f9b34fb    PPCP    
00002a05-0000-1000-8000-00805f9b34fb    Service Changed    
         
GATT Service UUIDs 
00001802-0000-1000-8000-00805f9b34fb    Immediate Alert    
00001803-0000-1000-8000-00805f9b34fb    Link Loss    
00001804-0000-1000-8000-00805f9b34fb    Tx Power    
00001805-0000-1000-8000-00805f9b34fb    Current Time Service    
00001806-0000-1000-8000-00805f9b34fb    Reference Time Update Service    
00001807-0000-1000-8000-00805f9b34fb    Next DST Change Service    
00001808-0000-1000-8000-00805f9b34fb    Glucose    
00001809-0000-1000-8000-00805f9b34fb    Health Thermometer    
0000180a-0000-1000-8000-00805f9b34fb    Device Information    
0000180b-0000-1000-8000-00805f9b34fb    Network Availability    
0000180d-0000-1000-8000-00805f9b34fb    Heart Rate    
0000180e-0000-1000-8000-00805f9b34fb    Phone Alert Status Service    
0000180f-0000-1000-8000-00805f9b34fb    Battery Service    
00001810-0000-1000-8000-00805f9b34fb    Blood Pressure    
00001811-0000-1000-8000-00805f9b34fb    Alert Notification Service    
00001812-0000-1000-8000-00805f9b34fb    Human Interface Device    
00001813-0000-1000-8000-00805f9b34fb    Scan Parameters    
00001814-0000-1000-8000-00805f9b34fb    Running Speed and Cadence    
00001816-0000-1000-8000-00805f9b34fb    Cycling Speed and Cadence    
00001818-0000-1000-8000-00805f9b34fb    Cycling Power    
00001819-0000-1000-8000-00805f9b34fb    Location and Navigation    
     
GATT Characteristic UUIDs 
00002a06-0000-1000-8000-00805f9b34fb    Alert Level    
00002a07-0000-1000-8000-00805f9b34fb    Tx Power Level    
00002a08-0000-1000-8000-00805f9b34fb    Date Time    
00002a09-0000-1000-8000-00805f9b34fb    Day of Week    
00002a0a-0000-1000-8000-00805f9b34fb    Day Date Time    
00002a0c-0000-1000-8000-00805f9b34fb    Exact Time 256    
00002a0d-0000-1000-8000-00805f9b34fb    DST Offset    
00002a0e-0000-1000-8000-00805f9b34fb    Time Zone    
00002a0f-0000-1000-8000-00805f9b34fb    Local Time Information    
00002a11-0000-1000-8000-00805f9b34fb    Time with DST    
00002a12-0000-1000-8000-00805f9b34fb    Time Accuracy    
00002a13-0000-1000-8000-00805f9b34fb    Time Source    
00002a14-0000-1000-8000-00805f9b34fb    Reference Time Information    
00002a16-0000-1000-8000-00805f9b34fb    Time Update Control Point    
00002a17-0000-1000-8000-00805f9b34fb    Time Update State    
00002a18-0000-1000-8000-00805f9b34fb    Glucose Measurement    
00002a19-0000-1000-8000-00805f9b34fb    Battery Level    
00002a1c-0000-1000-8000-00805f9b34fb    Temperature Measurement    
00002a1d-0000-1000-8000-00805f9b34fb    Temperature Type    
00002a1e-0000-1000-8000-00805f9b34fb    Intermediate Temperature    
00002a21-0000-1000-8000-00805f9b34fb    Measurement Interval    
00002a22-0000-1000-8000-00805f9b34fb    Boot Keyboard Input Report    
00002a23-0000-1000-8000-00805f9b34fb    System ID    
00002a24-0000-1000-8000-00805f9b34fb    Model Number String    
00002a25-0000-1000-8000-00805f9b34fb    Serial Number String    
00002a26-0000-1000-8000-00805f9b34fb    Firmware Revision String    
00002a27-0000-1000-8000-00805f9b34fb    Hardware Revision String    
00002a28-0000-1000-8000-00805f9b34fb    Software Revision String    
00002a29-0000-1000-8000-00805f9b34fb    Manufacturer Name String    
00002a2a-0000-1000-8000-00805f9b34fb    IEEE 11073-20601 Regulatory Certification Data List    
00002a2b-0000-1000-8000-00805f9b34fb    Current Time    
00002a31-0000-1000-8000-00805f9b34fb    Scan Refresh    
00002a32-0000-1000-8000-00805f9b34fb    Boot Keyboard Output Report    
00002a33-0000-1000-8000-00805f9b34fb    Boot Mouse Input Report    
00002a34-0000-1000-8000-00805f9b34fb    Glucose Measurement Context    
00002a35-0000-1000-8000-00805f9b34fb    Blood Pressure Measurement    
00002a36-0000-1000-8000-00805f9b34fb    Intermediate Cuff Pressure    
00002a37-0000-1000-8000-00805f9b34fb    Heart Rate Measurement    
00002a38-0000-1000-8000-00805f9b34fb    Body Sensor Location    
00002a39-0000-1000-8000-00805f9b34fb    Heart Rate Control Point    
00002a3e-0000-1000-8000-00805f9b34fb    Network Availability    
00002a3f-0000-1000-8000-00805f9b34fb    Alert Status    
00002a40-0000-1000-8000-00805f9b34fb    Ringer Control Point    
00002a41-0000-1000-8000-00805f9b34fb    Ringer Setting    
00002a42-0000-1000-8000-00805f9b34fb    Alert Category ID Bit Mask    
00002a43-0000-1000-8000-00805f9b34fb    Alert Category ID    
00002a44-0000-1000-8000-00805f9b34fb    Alert Notification Control Point    
00002a45-0000-1000-8000-00805f9b34fb    Unread Alert Status    
00002a46-0000-1000-8000-00805f9b34fb    New Alert    
00002a47-0000-1000-8000-00805f9b34fb    Supported New Alert Category    
00002a48-0000-1000-8000-00805f9b34fb    Supported Unread Alert Category    
00002a49-0000-1000-8000-00805f9b34fb    Blood Pressure Feature    
00002a4a-0000-1000-8000-00805f9b34fb    HID Information    
00002a4b-0000-1000-8000-00805f9b34fb    Report Map    
00002a4c-0000-1000-8000-00805f9b34fb    HID Control Point    
00002a4d-0000-1000-8000-00805f9b34fb    Report    
00002a4e-0000-1000-8000-00805f9b34fb    Protocol Mode    
00002a4f-0000-1000-8000-00805f9b34fb    Scan Interval Window    
00002a50-0000-1000-8000-00805f9b34fb    PnP ID    
00002a51-0000-1000-8000-00805f9b34fb    Glucose Feature    
00002a52-0000-1000-8000-00805f9b34fb    Record Access Control Point    
00002a53-0000-1000-8000-00805f9b34fb    RSC Measurement    
00002a54-0000-1000-8000-00805f9b34fb    RSC Feature    
00002a55-0000-1000-8000-00805f9b34fb    SC Control Point    
00002a5b-0000-1000-8000-00805f9b34fb    CSC Measurement    
00002a5c-0000-1000-8000-00805f9b34fb    CSC Feature    
00002a5d-0000-1000-8000-00805f9b34fb    Sensor Location    
00002a63-0000-1000-8000-00805f9b34fb    Cycling Power Measurement    
00002a64-0000-1000-8000-00805f9b34fb    Cycling Power Vector    
00002a65-0000-1000-8000-00805f9b34fb    Cycling Power Feature    
00002a66-0000-1000-8000-00805f9b34fb    Cycling Power Control Point    
00002a67-0000-1000-8000-00805f9b34fb    Location and Speed    
00002a68-0000-1000-8000-00805f9b34fb    Navigation    
00002a69-0000-1000-8000-00805f9b34fb    Position Quality    
00002a6a-0000-1000-8000-00805f9b34fb    LN Feature    
00002a6b-0000-1000-8000-00805f9b34fb    LN Control Point");

### Android 平台下的蓝牙通信 UUID 使用方法 在 Android 平台上,UUID (Universally Unique Identifier) 是用于唯一标识蓝牙服务和特性的重要参数[^2]。当两个设备试图通过蓝牙进行通信时,它们需要共享相同的 UUID 才能成功建立连接并交换数据。 #### 基本概念 UUID 是一种 128 位的全局唯一标识符,在 Bluetooth Low Energy (BLE) 中用来区分不同的服务和服务中的具体特征。每个 BLE 设备可以提供多个基于不同 UUID 的服务,而这些服务又可能包含若干个具有各自特定用途的特征值。为了确保兼容性和互操作性,某些常用的服务和特征被分配了固定的、广为人知的标准 UUIDs[^1]。 #### 标准 UUID 对于大多数经典蓝牙(非低功耗)应用场景来说,通常会采用预定义的一组通用 UUID示常见的串口端口配置文件(SPP),其十六进制形式如下: ```plaintext 00001101-0000-1000-8000-00805F9B34FB ``` 这个特殊的 UUID 主要应用于 RFCOMM 协议栈之上,支持 SPP 类型的数据传输模式,适用于诸如无线耳机配对等场景。然而值得注意的是,并不是所有的安卓手机都会开放此接口给第三方应用调用;因此即使使用上述标准 UUID 尝试与其他未知的应用程序交互也可能失败[^4]。 #### 自定义 UUID 创建方式 除了利用已有的标准化 UUID 外,开发者还可以创建自定义的 UUID 应用于私有协议或专有硬件之间。这类个性化 ID 可以借助在线工具生成随机数来获得独一无二的结果,也可以按照一定的规则自行设定前缀部分以便于识别所属公司或项目名称。不过需要注意的是,为了避免冲突,建议遵循官方推荐的方式来进行编码。 #### 实际编程实践 下面给出一段 Python 伪代码片段展示如何获取远程蓝牙设备的支持服务列及其对应的 UUID: ```python import bluetooth def discover_services(address): services = bluetooth.find_service(address=address) for svc in services: name = svc["name"] uuid = svc["protocol"] + ": " + str(svc["profiles"]) print(f"Service Name: {name}") print(f"Service UUID: {uuid}\n") # 替换为实际的目标地址 target_address = "XX:XX:XX:XX:XX:XX" discover_services(target_address) ``` 这段脚本可以帮助理解目标设备提供了哪些可用的服务选项,从而指导后续开发过程中正确设置本地客户端所期望匹配的具体 UUID 参数。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值