Hello all,
I got a question when using the new Proximity SDK for Android to scan telemetry frames.
I put my code at the end, and my questions are:
- when I stop the scanHandler, it says cannot resolve symbol “scanHandler”, but I defined it before and noticed that it has never been used. And it can scan telemetryFrameB properly.
- when I define scanHandler, I found the “BluetoothScanner. ScanHandler” (as stated in the document) does not work, so I used ScanHandler instead. Is there any problem with it?
Thanks,
Jiannan
BluetoothScanner scanner = new EstimoteBluetoothScannerFactory(getApplicationContext()).getSimpleScanner();
ScanHandler scanHandler = scanner.estimoteTelemetryFrameBScan()
.withLowLatencyPowerMode()
.withOnPacketFoundAction(new Function1<EstimoteTelemetryFrameB, Unit>() {
@Override
public Unit invoke(EstimoteTelemetryFrameB tlmB) {
Long time= System.currentTimeMillis();
Date currentTime= Calendar.getInstance().getTime();
Log.d("TELEMETRY", "beaconID, " + tlmB.getShortId() + ", rssi: " + tlmB.getRssi() + ", time " + time + ", date: " + currentTime);
return null;
}
}).start();
@Override protected void onStop() {
scanHandler.stop();
super.onStop();
}