[英]Using Bluetooth with a Google Chrome extension
I've seen the experimental API for using Bluetooth has been recently released and I wanted to perform a few tests. 我已经看到最近发布了使用蓝牙的实验性API,并且我想执行一些测试。 I've looked at the official documentation at http://code.google.com/chrome/extensions/trunk/experimental.bluetooth.html but even the most simple example won't work.
我在http://code.google.com/chrome/extensions/trunk/experimental.bluetooth.html上查看了官方文档,但即使最简单的示例也无法使用。 Of course, I previously set the permissions correctly in order to use the experimental APIs.
当然,我以前正确设置了权限,以便使用实验性API。
My background.js looks like this: 我的background.js看起来像这样:
function booleanCallback(result) {
alert(result.toString());
}
chrome.experimental.bluetooth.isPowered(booleanCallback);
No matter what, result
is always undefined
. 无论如何,
result
始终是undefined
。 Any thoughts on this? 有什么想法吗?
Cheers. 干杯。
The Bluetooth API is currently only implemented on Chrome OS. 蓝牙API目前仅在Chrome操作系统上实现。 There are open issues for the implementation on Windows , Mac and Linux .
Windows , Mac和Linux上的实施存在未解决的问题。 You may want to star one or more of those to be updated when the API is available on more platforms.
当API在更多平台上可用时,您可能希望给要更新的一个或多个添加星号。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.