简体   繁体   English

Tizen Samsung佩戴蓝牙功能

[英]Tizen samsung wear bluetooth access

I am attempting to access the Bluetooth API in the Samsung wear IDE for the Gear 2. I have successfully added the WIDLPROCXML definitions from the normal IDE to the Wear IDE and can have access on content assist to all the tizen.bluetooth.xx functions. 我正在尝试在Gear 2的Samsung Wear IDE中访问Bluetooth API。我已将普通ID中的WIDLPROCXML定义成功添加到Wear IDE中,并且可以访问所有tizen.bluetooth.xx函数的内容。

In the Wear IDE on the app.js file below, the console results undefined when calling the bluetooth.address function. 在以下app.js文件上的Wear IDE中,调用bluetooth.address函数时,控制台结果未定义。 I am aware that Tizen intentionally is trying to disallow access to Bluetooth to keep their watch only on the Samsung devices, but being an open platform I would like to make my own application communicate with other Bluetooth devices (ie iPhone, other radios) etc. 我知道Tizen故意试图禁止访问蓝牙以仅在Samsung设备上保留其手表,但是作为一个开放平台,我想让自己的应用程序与其他Bluetooth设备(例如iPhone,其他收音机)等进行通信。

Any advice on how I can get access to the full Bluetooth API would be helpful. 关于如何访问完整的蓝牙API的任何建议都将有所帮助。 I wonder if it has something to do with the Application Control Engine on the Web Run Time vs a config file that can be altered on the device. 我想知道它是否与Web运行时上的应用程序控制引擎和可以在设备上更改的配置文件有关。 I know access to Bluetooth is possible as Samsung has their own API for connecting to their galaxy devices. 我知道可以访问蓝牙,因为三星拥有自己的用于连接其银河设备的API。

Below is the sample app and the console output: 以下是示例应用程序和控制台输出:

var adapter = tizen.bluetooth.getDefaultAdapter();
var deviceCapabilities;

deviceCapabilities = tizen.systeminfo.getCapabilities();

if (deviceCapabilities.bluetooth)
{
    console.log("Bluetooth is supported");
}

console.log(adapter.address);

adapter.setPowered(true);

console.log(deviceCapabilities.platformName);


adapter.setPowered(false, successCallback, errorCallback)

Console Output: 控制台输出:

js/app.js (9) :Bluetooth is supported
js/app.js (12) :undefined
js/app.js (16) :Tizen
js/app.js (19) :NotSupportedError: Bluetooth turn off is not supported

Any ideas? 有任何想法吗?

In short: you can't. 简而言之:你不能。

Bluetooth capabilities are not exposed to JavaScript on wearable profile, so you cannot access them. 蓝牙功能不会在可穿戴配置文件中显示给JavaScript,因此您无法访问它们。 This is not only matter of ACE or WRT "blocking: your access, at the moment WRT just lacks this capability on wearables. 这不仅是ACE或“ WRT”阻止问题:您的访问权限,目前WRT只是在可穿戴设备上缺少此功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM