Tizen Samsung佩戴蓝牙功能 [英] Tizen samsung wear bluetooth access

查看:151
本文介绍了Tizen Samsung佩戴蓝牙功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Gear 2的Samsung Wear IDE中访问Bluetooth API.我已将普通ID中的WIDLPROCXML定义成功添加到Wear IDE,并且可以访问所有tizen.bluetooth.xx功能的内容帮助.

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.

在下面的app.js文件上的Wear IDE中,调用bluetooth.address函数时控制台结果未定义.我知道Tizen故意试图禁止访问蓝牙以仅在Samsung设备上保留其手表,但是作为一个开放平台,我想让自己的应用程序与其他Bluetooth设备(例如iPhone,其他收音机)等进行通信.

In the Wear IDE on the app.js file below, the console results undefined when calling the bluetooth.address function. 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 (i.e. iPhone, other radios) etc.

有关如何获得完整的蓝牙API的访问权的任何建议都将有所帮助.我想知道它是否与Web运行时上的Application Control Engine以及可以在设备上更改的配置文件有关.我知道可以访问蓝牙,因为三星拥有自己的用于连接其银河设备的API.

Any advice on how I can get access to the full Bluetooth API would be helpful. 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. I know access to Bluetooth is possible as Samsung has their own API for connecting to their galaxy devices.

下面是示例应用程序和控制台输出:

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)

控制台输出:


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

有什么想法吗?

推荐答案

总之:不能.

蓝牙功能未在可穿戴配置文件中公开给JavaScript,因此您无法访问它们. 这不仅仅是ACE或"WRT"阻止问题:您的访问权限,目前WRT只是在可穿戴设备上缺少此功能.

Bluetooth capabilities are not exposed to JavaScript on wearable profile, so you cannot access them. This is not only matter of ACE or WRT "blocking: your access, at the moment WRT just lacks this capability on wearables.

这篇关于Tizen Samsung佩戴蓝牙功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆