Estimote / Android-Fleet-Management-SDK

Estimote Fleet Management SDK for Android
https://developer.estimote.com
MIT License
836 stars 451 forks source link

Telemetry.GPIO is not working correctly #189

Closed spapas closed 7 years ago

spapas commented 7 years ago

Hello,

I am using your SDK for telemetry in an Android app. I want to read the GPIO values and I am using the UNDOCUMENTED (https://estimote.github.io/Android-SDK/JavaDocs/com/estimote/sdk/cloud/model/Telemetry.html -- please fix your docs they have many problems I'll add another issue for that) Telemetry.GPIO boolean array. Unfortunately, this array has (for some reason - can you clarify?) four boolean values (instead of two) and the first two values are always the same. I.e when I set GPIO 1 to 1 it will return [true, true, true, true] and when I setr GPIO 1 to 0 it will return [false, false, true, true].

I did some checking on your decompiled (since I can't find the source anywhere) classes for version 0.16 (compile 'com.estimote:sdk:0.16.0@aar') and found this gem in com.estimote.sdk.telemetry.internal.TelemetryParse:

 telemetry.GPIO = new boolean[]{(tmp & 16) > 0, (tmp & 16) > 0, (tmp & 64) > 0, (tmp & 128) > 0};

probably the second 16 has to be changed to 32....

Please fix it ASAP and release a new version because we can't use GPO at all.

pawelDylag commented 7 years ago

Hello @spapas

Thanks for feedback about our documentation - you are perfectly right! We are preparing larger update with many fixes to core functionality as wall as documentation. As for telemetry GPIO - thanks for finding this bug, it will be fixed asap. I will push current version for you with this fixup, but for more changes you need to wait some more time.

spapas commented 7 years ago

Hello @pawelDylag we'll wait for the new release, thank you very much!

Best regards, Serafeim

pawelDylag commented 7 years ago

Hey @spapas

Repository is live, you can add it to your project:

dependencies {
  compile 'com.estimote:sdk:0.16.1@aar'
}

It might be available after some time - central repo need some time to refresh. I fixed Vector data and GPIO as you requested. More fixes will be introduced in later release.

spapas commented 7 years ago

Hello @pawelDylag just tested 0.16.1 with my app - both fixes work great, thank you very much!

Best regards, Serafeim

pawelDylag commented 7 years ago

Glad it worked, @spapas ! More improvements in close future, stay tuned :) We are open for further feedback. Good luck with development!