[Tizen] [蓝牙]齿轮设备无法打开蓝牙
问题描述:
我正在尝试使用齿轮设备上的tizen的蓝牙web应用程序。[Tizen] [蓝牙]齿轮设备无法打开蓝牙
当我尝试检查代码 tizen.systeminfo.getCapability(BLUETOOTH_FEATURE_KEY); 它返回false。但是,该设备具有蓝牙功能。 它也连接到其他设备。
答
使用适当的功能键并添加必需的权限。
try
{
/* Checks if a device supports bluetooth API */
var bluetooth = tizen.systeminfo.getCapability("http://tizen.org/feature/network.bluetooth");
console.log(" Bluetooth = " + bluetooth);
document.getElementById("isOnBL").innerHTML = "Bluetooth : "+bluetooth;
}
catch (error)
{
console.log("Error name: " + error.name + ", message: " + error.message);
}
添加特权
<tizen:privilege name="http://tizen.org/privilege/system"/>
检查答案 –