我正在使用IBM Presence Insights和我的Android App + Estimote SDK.SDK会在进入时选择Beacon UUID,主要和次要.接下来,它成功将事件发送到PI.但是,如何将退出事件发送到PI,因为没有"退出"API或参数?
我配置了android 信标库来检测 Eddystone 数据包
beaconManager = BeaconManager.getInstanceForApplication(context);
// Detect the main identifier (UID) frame:
beaconManager.getBeaconParsers().add(new BeaconParser().
setBeaconLayout("s:0-1=feaa,m:2-2=00,p:3-3:-41,i:4-13,i:14-19"));
// Detect the telemetry (TLM) frame:
beaconManager.getBeaconParsers().add(new BeaconParser().
setBeaconLayout("x,s:0-1=feaa,m:2-2=20,d:3-3,d:4-5,d:6-7,d:8-11,d:12-15"));
// Detect the URL frame:
beaconManager.getBeaconParsers().add(new BeaconParser().
setBeaconLayout("s:0-1=feaa,m:2-2=10,p:3-3:-41,i:4-21v"));
beaconManager.bind(this);
Run Code Online (Sandbox Code Playgroud)
在 Android 信标库中从未检测到信标。
@Override
public void onBeaconServiceConnect() {
beaconManager.addMonitorNotifier(this);
beaconManager.addRangeNotifier(new RangeNotifier() {
@Override
public void didRangeBeaconsInRegion(Collection<Beacon> beacons,
Region region) {
if (beacons.size() > 0) {
Extra.log("Beacons detected", "info");
//Process beacons data...
}
}
});
try {
beaconManager.startRangingBeaconsInRegion(new Region(
"myRangingUniqueId", null, null, null));
} …Run Code Online (Sandbox Code Playgroud) 是否可以使用不使用本机移动技术(Android,ios,...)的Web技术,使用渐进式Web应用程序搜索信标数据(uuid,url,...)?
提前致谢.
bluetooth eddystone beacon progressive-web-apps web-bluetooth
我正在尝试将我的信标连接到 Gattservice。在回调 onConnectionStateChange 中,它总是失败,我得到了
状态代码 133 和 257。
Somehwere 写道,133 代表许多联系。在我的代码中,有一些带有 gatt.disconnect() 的行。我不知道如何解决它,因为所有其他 gatt 示例都是相同的。如果发现错误很重要,我正在使用 Android 6.0.1 版本和 API 23。这是我的代码:
public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
if(status == BluetoothGatt.GATT_SUCCESS) {
switch (newState) {
case BluetoothProfile.STATE_CONNECTED:
mBleDevices.add(gatt.getDevice());
Log.i("Beacons", "STATE_CONNECTED");
runOnUiThread(new Runnable() {
@Override
public void run() {
mBluetoothGatt.discoverServices();
}
});
break;
case BluetoothProfile.STATE_DISCONNECTED:
Log.e("Beacons", "STATE_DISCONNECTED");
mBleDevices.remove(gatt.getDevice());
mBluetoothGatt.disconnect();
mBluetoothGatt = null;
break;
default:
Log.e("Beacons", "STATE_OTHER");
}
} else {
Log.e("Beacons", "ERROR WITH CONNECTING " + status);
mBleDevices.remove(gatt.getDevice());
}
} …Run Code Online (Sandbox Code Playgroud) 我想使用 Apple 和 Google 的新 API 来支持此API 文档中所描述的Covid 联系人跟踪。但是当我尝试在 XCode 中使用这些 API 时,找不到这些类:
let request = CTSelfTracingInfoRequest()
Run Code Online (Sandbox Code Playgroud)
如何启用这些 API?
我正在使用Android Beacon Library检测信标.
根据其他Stackoverflow问题,下面的答案是解决方案
beaconManager.setBackgroundScanPeriod(60000l);
beaconManager.setBackgroundBetweenScanPeriod(60000l);
beaconManager.updateScanPeriods();
Run Code Online (Sandbox Code Playgroud)
但就我而言,它不起作用.我无法对扫描周期进行变化.
这是代码:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
beaconManager = BeaconManager.getInstanceForApplication(this);
beaconManager.getBeaconParsers().add(new BeaconParser()
.setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25"));
beaconManager.bind(this);
}
@Override
public void onBeaconServiceConnect() {
try {
beaconManager.setBackgroundScanPeriod(60000l);
beaconManager.setBackgroundBetweenScanPeriod(60000l);
beaconManager.updateScanPeriods();
beaconManager.startRangingBeaconsInRegion(new Region("myRangingUniqueId",
Identifier.parse(Config.PROXIMITY_UUID), null, null));
beaconManager.setRangeNotifier(new RangeNotifier() {
@Override
public void didRangeBeaconsInRegion(Collection<Beacon> beacons, Region region) {
if (beacons.size() > 0) {
Log.i(TAG, "minor:"+ beacons.iterator().next().getId3());
}
}
});
} catch (RemoteException e) {
e.printStackTrace();
}
}
Run Code Online (Sandbox Code Playgroud) 当该应用程序在后台运行时,Google添加了不向该应用程序广播蓝牙开关状态的限制。这有效地在后台阻止了优化的蓝牙信标扫描。除了定期的工作安排之外,如何解决这个问题?
任何帮助表示赞赏。
我看到一份声明称 Google 将终止他们的信标服务
12 月 6 日,我们将停止发送 Eddystone 和物理网络信标通知。您仍然可以继续访问信标仪表板,并可以使用我们的邻近信标 API 通过您自己的应用程序提供类似于附近通知的基于邻近的体验。
但同时他们又说
Proximity Beacon API 是蓝牙低功耗 (BLE) 信标平台的一部分,该平台还包括 Eddystone(Google 的开放信标格式)。当 Google 停止提供 Eddystone 和物理网络信标通知时,最终用户应该会在 12 月初停止遇到附近通知。第三方开发人员仍然可以使用 Proximity Beacons API 在其应用程序内发送附近警报,但它将不再是普遍的系统级功能。
有人能解释一下这对于我们编写信标 Android 应用程序意味着什么吗?
这是否意味着在某个时刻,信标应用程序将停止工作,因为设备将无法从信标设备接收信号?
使用 android 信标库 2.16.3 我收到一个错误,我的应用程序在启动时崩溃。
似乎使用这个库并且正在崩溃的部分在这里。这两个部分都可以在 MainMenu 类中找到。
第 1 节
beaconManager = BeaconManager.getInstanceForApplication(this);
beaconManager.getBeaconParsers().add(new BeaconParser().
setBeaconLayout("s:0-1=feaa,m:2-2=00,p:3-3:-41,i:4-13,i:14-19"));
beaconManager.bind(this);
Run Code Online (Sandbox Code Playgroud)
并且
第 2 节
@Override
public void onBeaconServiceConnect() {
final Region region = new Region("DanielBeaconNew",null, null, null);
beaconManager.addMonitorNotifier(new MonitorNotifier() {
@Override
public void didEnterRegion(Region region) {
try {
beaconManager.startRangingBeaconsInRegion(region);
} catch (RemoteException e) {
e.printStackTrace();
}
}
@Override
public void didExitRegion(Region region) {
try {
beaconManager.stopRangingBeaconsInRegion(region);
} catch (RemoteException e) {
e.printStackTrace();
}
}
@Override
public void didDetermineStateForRegion(int state, Region region) { …Run Code Online (Sandbox Code Playgroud) 在应用程序中,我期待 Beacon 中的蓝牙是非常好的选择,因为我想从不同来源收集 PH 到应用程序,所以我无法一次将我的 Android 设备与所有 BLE 设备配对,因为它大约是 20- 30.
但我可以看到,如果有 Beacon,那么 Android 可以扫描所有设备,并且还可以获取所有设备的 RSSI,而无需与它们配对。
那么我们是否可以添加一些其他参数,例如 PH、温度、湿度和 3-4 个其他参数,以便 Beacon 将与 RSSI 一起广播所有这些参数,并且在 Android 应用程序中我可以收集所有信息?
我需要从头开始构建一个方案。在直路上行驶的两辆车。有一个RSU。rsu每10秒广播一次速度值。车辆应减速以达到该值。
我的问题是我可以将味精视为信标吗?如果是,如何在rsu应用程序中设置信标msg?如果没有,如何实现这种情况
我正在开发一个 Android 应用程序,我们在其中使用 ble 设备,我发现可以通过 rssi 来计算距离。我现在已经一起研究信标了几个月,但仍然很难理解它的行为。
我有一个 BLE 设备以10hz(10 个数据包/秒)进行广播。用于BluetoothLeScanner.startScan(scanCallback)获取 rssi。扫描是连续的,因此据了解,我们应该每秒获取所有 10 个 adv 数据包。由于扫描是连续的,因此不会丢失数据包。但每部手机的行为都不同。我在多部手机上进行了测试,在几部手机上观察到的行为如下,
Moto C Plus, AV: 7.0: 6-8 Callbacks/s
Redmi Note 4, Av: 7.0: 4-6 Callbacks/s
Moto G 2ng generation, AV: 6.0: android finds 1-3 callbacks for few seconds and no callbacks for seconds like 5,10 even for around 20+sec.
One Plus one, AV: 6.0.1 : frequent is 1-3 callbacks and rest of behaviour is same as Moto G, no callbacks for …Run Code Online (Sandbox Code Playgroud)