serial_number_string 在网络蓝牙 (BLE) 上被阻止 - 避免阻止列表

问题描述 投票:0回答:1

我需要获取 BLE 设备的序列号。为此,我当前访问 device_information 服务,然后获取特征序列号_字符串/0x2A25。但是我收到控制台错误,该 UUID 被阻止。

在 WebBluetoothCG 上,我找到了阻止列出的特征,其中还列出了序列号。 有没有办法绕过黑名单?

我的代码如下所示:

const deviceInfoService = 等待 device.value?.gatt?.getPrimaryService('device_information')

const deviceInfoCharacteristics =等待deviceInfoService?.getCharacteristic(0x2a25) //serial_number_string

在同一项服务中,我可以读取固件、制造商、硬件和型号名称的特征。

vuejs3 bluetooth-lowenergy serial-number web-bluetooth
1个回答
0
投票

出于隐私原因,序列号字符串特征被屏蔽。序列号标识符可用于主动指纹识别,通常用户无法修改。

# org.bluetooth.characteristic.serial_number_string
# Block access to standardized unique identifiers, for privacy reasons.
00002a25-0000-1000-8000-00805f9b34fb

https://github.com/WebBluetoothCG/registries/blob/228b62c31c177c9b770b79896aec9ef660f62216/gatt_blocklist.txt#L53

https://crbug.com/532930#c17有一些额外的上下文:

将序列号字符串列入黑名单可能是正确的选择:这是获取唯一标识符的标准化方法,并且我们阻止地址以避免琐碎地识别设备。设备仍然可以在任何自定义 GATT 字段中存储 ID,但我们不希望他们意外这样做。

尽管存在隐私风险,但设备识别仍然很重要。当两个相同类型的设备连接时,应用程序需要能够区分设备。应用程序还应该能够识别何时重新连接到之前连接的设备。阻止访问设备标识符(例如设备地址或序列号)会使这变得困难。

BluetoothDevice
公开了一个
id
属性,旨在解决这些问题,同时保护用户隐私。
id
属性对于特定蓝牙设备、用户配置文件和主机来说是唯一的。清除权限还会清除存储的
id
属性,从而导致下次连接设备时创建新的标识符。

© www.soinside.com 2019 - 2024. All rights reserved.