0

我訪問了Chrome BLE API page(5/7/2016)。似乎有衝突的信息消息(見下圖)。這是僅適用於Chrome OS還是OS X和Windows?Chrome藍牙低功耗API - 跨平臺支持

編輯/ UPDATE:

我試圖在Windows 10的演示應用程序(demo BLE API)這是能夠看到配對設備,但不未成設備。我收到了一條錯誤消息:Battery device not supported on this platform。我不確定這是由於我使用的測試向量(LightBlue)還是其他問題。

系統:

  • 的Windows 10的64位
  • 面臨3

Chrome API Page

回答

4

chrome.bluetoothLowEnergy API僅適用於配對設備上的Windows,因爲它仍然使用(當時)的Windows 8的API僅檢索配對設備:https://chromium.googlesource.com/chromium/src/+/08c9d69b0c0d625d2ce38e3d8402f36e1226f0fc/device/bluetooth/bluetooth_low_energy_win.h#117

對信息,網絡藍牙團隊計劃支持Windows 10儘可能:https://github.com/WebBluetoothCG/web-bluetooth/blob/gh-pages/implementation-status.md#chrome

+0

非常有趣。我很高興看到Windows支持,但基於我正在閱讀的內容,只有配對設備的發現和對GATT的讀/寫沒有。這將解釋失敗的讀取請求。 爲了確保我明白了,'chrome.bluetoothLowEnergy' API和Web藍牙API使用了**相同的**代碼? –

+0

現在他們正在使用相同的代碼。這意味着Web藍牙團隊爲改進跨平臺支持所做的所有工作將最終惠及'chrome.bluetoothLowEnergy' API。 –

0

通過您給文檔閱讀,其中你提到的使用navigator.bluetoothInteract with BLE devices on the Web也指出:

在編寫本文時,Web部分的藍牙API爲,部分在Chrome操作系統中實現,Android版Chrome Dev在實驗性標誌之後。

因此,您得到undefined作爲返回值。

功能由Bluetooth Low Energy(BLE)通過Generic Attribute Profile (GATT)提供的鍵/值對提供。

+0

看起來,Web藍牙API與Chrome API藍牙規範不同。因此'navigator.bluetooth'是檢查的不正確方法。我專注於Chrome API。 –