Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/441.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 需要访问自行车蓝牙速度传感器服务名称。蓝牙分配服务页面已关闭。我还能在哪里找到这些信息?_Javascript_Bluetooth_Bluetooth Lowenergy - Fatal编程技术网

Javascript 需要访问自行车蓝牙速度传感器服务名称。蓝牙分配服务页面已关闭。我还能在哪里找到这些信息?

Javascript 需要访问自行车蓝牙速度传感器服务名称。蓝牙分配服务页面已关闭。我还能在哪里找到这些信息?,javascript,bluetooth,bluetooth-lowenergy,Javascript,Bluetooth,Bluetooth Lowenergy,我想查找我需要的服务,以将此示例从电池服务更改为自行车速度传感器服务。只需执行navigator.bluetooth.requestDevice(acceptilldevices=true)即可与自行车速度传感器设备配对,但由于我没有为其提供正确的服务名称,因此出现了错误 navigator.bluetooth.requestDevice({ filters: [{ services: ['battery_service'] }] }) .then(device => { /* … */

我想查找我需要的服务,以将此示例从电池服务更改为自行车速度传感器服务。只需执行
navigator.bluetooth.requestDevice(acceptilldevices=true)
即可与自行车速度传感器设备配对,但由于我没有为其提供正确的服务名称,因此出现了错误

navigator.bluetooth.requestDevice({ filters: [{ services: ['battery_service'] }] })
.then(device => { /* … */ })
.catch(error => { console.error(error); });
我猜得出心率是
{filters:[{services:['heart_rate']}]}
。还没有弄清楚自行车的速度和节奏传感器的名称。由于文档已关闭,是否有办法通过内省
requestDevice
获取此信息

提供链接

该页面不再存在,403禁止错误


规范已被移动,现在可以在以下文件中找到:

由Chrome处理的所有标准化蓝牙GATT UUID字符串都在以下文件中:。我相信下面这条线就是你要找的

  {"cycling_speed_and_cadence", 0x1816},
这意味着您可以使用字符串名称或其UUID:

//这很有效。
requestDevice({filters:[{services:['cycling\u speed\u and\u cadence']}]);
//这也行得通;)
bluetooth.requestDevice({filters:[{services:[0x1816]}]});

这也是一个很好的开始。

谢谢你的文档。这不是我要找的(我不这么认为?),因为它对
心率
没有影响。大概我要找的文档中既有
电池服务
心率
,也有cadence和speed sensor的名称。