Estimote telemetry for java

Hi,

I was trying to implement the Telemetry from SDK Estimote for my java application on android-studio.
I tried to apply this resource to my best even so the code example is only in Kotlin

estimote telemetry ressource

Here is what I got now :

BluetoothScanner scanner = new EstimoteBluetoothScannerFactory(getApplicationContext()).getSimpleScanner();

    ScanHandler scanHandler = scanner.estimoteTelemetryFrameBScan()
                    .withBalancedPowerMode().withOnPacketFoundAction(new Function1<EstimoteTelemetryFrameB, Unit>() {
                        @Override
                        public Unit invoke(EstimoteTelemetryFrameB estimoteTelemetryFrameB) {
                            return null;
                        }
                    }).start();

I then try to write data in my file with. scanHandler.toString();
And here is the result com.estimote.scanning_plugin.api.use_cases.RxScanHandler@d7023cb

also tried this scanHandler.getClass(); gives me com.estimote.scanning_plugin.api.use_cases.RxScanHandler@e3628f9

I don’t see how to get the temperature and the magnetometer. Does anyone know if I’m doing something with no-sense. Does anyone has the solution or hint ?

Thank you in advance.

scanHandler is used only to control scanning process. You won’t find any telemetry data there.
You should place your code inside invoke function and when frame will be receives is will be called with telemetry data in parameter. Android Studio should auto-complete estimoteTelemetryFrameB. showing you what is possible to get from that kind of frame.

scanHandler = scanner.estimoteTelemetryFrameBScan()
                 .withBalancedPowerMode().withOnPacketFoundAction(new Function1<EstimoteTelemetryFrameB, Unit>() {
                     @Override
                     public Unit invoke(EstimoteTelemetryFrameB estimoteTelemetryFrameB) {
                         changer1.add(estimoteTelemetryFrameB);
                         changer = estimoteTelemetryFrameB;
                         return null;
                     }
                 }).start();

changer is EstimoteTelemetryFrameB type
changer1 is a list with EstimoteTelemetryFrameB type

I run a task 20 times a second that seek for near beacon.
I have EstimoteTelemtry data even when there is no beacon around and i have multiple.
I thought they were related to beacon. Do you know the frequency of the data seeking ?

Glad you helped me already, i keep seeking on my side