蓝牙设备中的Device UUID 与 Service UUID

Device UUID也可以被称作为DeviceID。

Android 设备上扫描获取到的 deviceId 为外围设备的 MAC 地址,相对固定。
iOS 设备上扫描获取到的 deviceId 是系统根据外围设备 MAC 地址及发现设备的时间生成的 UUID,是设备上的Core Bluetooth为该设备分配的标识符。对于已连接过的设备,UUID 会在一段时间内保持不变(正常是15-20分钟变化一次)。
此外,UUID 也会在某些条件下可能会发生变化(如系统蓝牙模块重启、配对设备被忽略等),在不同的设备上获取到的 UUID 也是不同的。不同手机连接同一设备的uuid不是同一个。

问题:

这样无法确认对应的的设备是哪一台,要是断连后就不知道上一台设备是哪一台,由此提出一个方案就是可以在蓝牙的扫描响应包中去添加上本设备的MAC地址,这样不管是IOS还是安卓设备这样都可以识别到唯一设备。

SerivceId就是Service UUID。

蓝牙设备的ID,通过此ID可以进行连接蓝牙设备,连接成功之后可以获取serviceId,serviceId可以有多个,每个serviceId可以看作是服务,每个serviceId中可以定义多个uuid(特征值)。

Service UUID已经有了很多特定的,也可以自己定义。
特定的:{0000xxxx-0000-1000-8000-00805F9B34FB}

xxxx = 0x0000 ~ 0xFFFE
GATT Service 0x1800 Generic Access
GATT Service 0x1801 Generic Attribute
GATT Service 0x1802 Immediate Alert
GATT Service 0x1803 Link Loss
GATT Service 0x1804 Tx Power
GATT Service 0x1805 Current Time
GATT Service 0x1806 Reference Time Update 
GATT Service 0x1807 Next DST Change 
GATT Service 0x1808 Glucose
GATT Service 0x1809 Health Thermometer
GATT Service 0x180A Device Information
GATT Service 0x180D Heart Rate
GATT Service 0x180E Phone Alert Status 
GATT Service 0x180F Battery
GATT Service 0x1810 Blood Pressure
GATT Service 0x1811 Alert Notification
GATT Service 0x1812 Human Interface Device
GATT Service 0x1813 Scan Parameters
GATT Service 0x1814 Running Speed and Cadence
GATT Service 0x1815 Automation IO
GATT Service 0x1816 Cycling Speed and Cadence
GATT Service 0x1818 Cycling Power
GATT Service 0x1819 Location and Navigation
GATT Service 0x181A Environmental Sensing
GATT Service 0x181B Body Composition
GATT Service 0x181C User Data
GATT Service 0x181D Weight Scale
GATT Service 0x181E Bond Management 
GATT Service 0x181F Continuous Glucose Monitoring 
GATT Service 0x1820 Internet Protocol Support
GATT Service 0x1821 Indoor Positioning 
GATT Service 0x1822 Pulse Oximeter
GATT Service 0x1823 HTTP Proxy
GATT Service 0x1824 Transport Discovery 
GATT Service 0x1825 Object Transfer 
GATT Service 0x1826 Fitness Machine
GATT Service 0x1827 Mesh Provisioning 
GATT Service 0x1828 Mesh Proxy
GATT Service 0x1829 Reconnection Configuration 
GATT Service 0x183A Insulin Delivery 
GATT Service 0x183B Binary Sensor
GATT Service 0x183C Emergency Configuration
GATT Service 0x183E Physical Activity Monitor 
GATT Service 0x1843 Audio Input Control 
GATT Service 0x1844 Volume Control

  • 6
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

浮若于心

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值