android - 从信标扫描和读取数据(EM Microelectronic:EMBC02)
问题描述
我正在尝试创建一个使用 BLE 扫描信标并从中检索数据的 Android 应用程序,所以我将使用这个库: Android Beacon Library
知道如何使用它,尤其是如何仅扫描EM Microelectronic EMBC02信标吗?
我尝试在这里使用 2 示例,但无法始终找到我的信标。有人提到我应该使用这种方法setBeaconLayout()
,但我不知道如何。
// To detect proprietary beacons, you must add a line like below corresponding to your beacon
// type. Do a web search for "setBeaconLayout" to get the proper expression.
// beaconManager.getBeaconParsers().add(new BeaconParser().
// setBeaconLayout("m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25"));
解决方案
该信标模型使用 iBeacon 布局。您必须将布局字符串配置到库中。您可以在此处找到布局字符串:https ://beaconlayout.wordpress.com
推荐阅读
- python - 函数未将值传递给其他函数
- javascript - Sliderjs 和 React 所需的行为问题
- asp.net-core - 如何添加声明或角色
- reactjs - Formik 字段中的空数据值在控制台日志中引发警告
- python - 在某些列上标注编码器和 Inverse_Transform
- wordpress - Talend TRESTClient 错误(将数据从 Wordpess 发送到 MYOB 会计软件)
- neovim - Vim 拆分终端未按预期打开
- javascript - React:如何修复“超出最大更新深度错误”
- javascript - 我如何了解我的 Web 应用程序是否具有良好的性能?
- python - 如何在matplotlib python中添加文本和值的图例混合?