【问题标题】:chrome.bluetoothLowEnergy is undefined even though I added the low_energy flagchrome.bluetoothLowEnergy 未定义,即使我添加了 low_energy 标志
【发布时间】:2019-07-03 15:01:40
【问题描述】:

我正在尝试编写一个连接到蓝牙低功耗设备的 chrome 应用程序。我在清单中添加了"bluetooth": { "low_energy": true }:

{
  "name": "DE1",
  "version": "1",
  "manifest_version": 2,
  "icons": {
    "128": "de1icon.png"
  },
  "permissions": [],
  "bluetooth": {
    "uuids": ["A000"],
    "low_energy": true
  },
  "app": {
    "background": {
      "scripts": ["chrome.js"]
    }
  }
}

但是当我打电话时

chrome.bluetoothLowEnergy.connect

我得到了错误

Error handling response: TypeError: Cannot read property 'connect' of undefined

文档说这是我应该做的

https://developer.chrome.com/apps/manifest/bluetooth#reference

【问题讨论】:

    标签: bluetooth bluetooth-lowenergy google-chrome-app web-bluetooth


    【解决方案1】:

    我将此作为 chromium 项目的错误提交

    https://bugs.chromium.org/p/chromium/issues/detail?id=980766

    他们已经回答了。显然,此功能仅在 ChromeOS 上受支持,并且我正在运行 macOS。

    【讨论】:

      猜你喜欢
      • 2013-09-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-25
      • 2017-10-19
      • 1970-01-01
      • 2020-08-07
      相关资源
      最近更新 更多