2017-01-23 101 views
0

我正在嘗試使用齒輪設備上的tizen的藍牙web應用程序。[Tizen] [藍牙]齒輪設備無法打開藍牙

當我嘗試檢查代碼 tizen.systeminfo.getCapability(BLUETOOTH_FEATURE_KEY); 它返回false。但是,該設備具有藍牙功能。 它也連接到其他設備。

+0

檢查答案 –

回答

0

使用適當的功能鍵並添加必需的權限。

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"/>