简体   繁体   English

Android下没用的蓝牙广告?

[英]Useless Bluetooth advertisement under Android?

I was actually using Cordova with cordova-plugin-bluetoothle , but I tend to think that this problem is related to Android more than Cordova. 我实际上是将Cordova与cordova-plugin-bluetoothle一起使用 ,但我倾向于认为这个问题与Cordova的关系更多与Android有关。

I started a scan and in response got several devices, all with data similar to: 我开始扫描,并得到了一些设备,所有设备的数据类似于:

{
    "address":"38:CC:7A:F6:F5:AC",
    "name":null,
    "rssi":-74,
    "advertisement":"Hv8GAAEJIAAFQjB0jtGzjUXqNjOrWsBW+NPHv+y9swAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
    "status":"scanResult"
},
{
    "address":"4A:85:03:9A:F7:0C",
    "name":"\u0010",
    "rssi":-60,
"advertisement":"AgEGB/9MABACCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
    "status":"scanResult"
}

Q1: Why am I getting an empty name or a cryptic \? Q1:为什么我会得到一个空名称或一个隐秘的\\ u0010? Shouldn't every BT device identify itself in a way that allows the user to select it? 并非每个BT设备都以允许用户选择的方式标识自己吗?

Q2: The advertisement data seem to be useless! Q2:广告数据似乎没有用! It is quite clear that it is in base64, but decoding the base64 was still giving useless data. 显然,它在base64中,但是解码base64仍然会产生无用的数据。 I was trying to parse it using this library , but the result of the parsing seems meaningless. 我试图使用此库来解析它,但是解析的结果似乎毫无意义。 I was investigating hours trying to solve it and find references in the internet, without success! 我花了很多时间试图解决它,并在互联网上找到参考,但没有成功!

I will highly appreciate any help with this! 我将非常感谢对此的任何帮助!

I have found the explanation! 我找到了解释! It is the iBeacon advertisement format. 这是iBeacon广告格式。 See more in Wikipedia . Wikipedia中查看更多内容

I also found this nice advlib library that did the parsing very well. 我还发现这个很好的advlib库可以很好地进行解析。

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

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