语言

Menu
Sites
Language
[wearable] BLE Scanning

Hello,

im trying to develope a tizen application with BLE scanner and in device.manufacturerData.data is returning "䱄~ " and JSON.stringify(device.manufacturerData.data) is returning "䱄~\u0003"

please how can i convert this data into something readable hexadecimal.

 

this is my code:

 

  adapter.startScan(onDeviceFound);

 

function onDeviceFound(device) {
       console.log(device);
    if (device.manufacturerData.data != "") {
    
        console.log(device.address);
        console.log(device.manufacturerData.data);
        console.log(JSON.stringify(device.manufacturerData.data));


    }

}

 

 

编辑者为: John Ixion 28 11月, 2017

响应

4 回复
Armaan-Ul- Islam

Your Code seems working on my Samsung Z4 (Tizen 3.0). device.manufacturerData.data is logged on console as expected.

 

 

 

I would suggest to use 'alert()' instead of 'console.log()' to clarify it's not an Charecther encoding Issue on Web Inspector.

hussein baalbaki

i should have suggested that iam working on samsung gear 2s 2.3.2.2, i dont know if the same functionality apply

hussein baalbaki

and iam trying to replicate this app https://www.tizenexperts.com/2017/08/track-ble-devices-ble-beacon-scanner-app-gear-s2-s3/

Armaan-Ul- Islam

Agree with you hussein baalbaki.

When I deployed the app on my gear S2 running on Tizen  2.3.2 the data is Unknown charecter:

 

 

 

But the same code is working fine on my Gear S3 running on Tizen 3.0 !!

I guess such BLE function are not working fine on Tizen 2.3.2. You may report a bug on Tizen bug Tracker. Here's a guideline on how to report bugs. Please share the 'Reported bug' link here on this post to help the developers keep track.