By authorization I mean generating APP_ID and APP_TOKEN in Cloud console and setting it by:
EstimoteSDK.initialize(applicationContext, “YOUR APP ID”, “YOUR APP TOKEN”);
It is required to access beacon settings, but it is not required to access storage.
com.estimote.mgmtsdk.feature.settings.ReadableDeviceSetting@b6afe53
is an accessor object that is used to read temperature. You need to call get
method first.
Here is an example from tutorial how to read firmware version:
connection.settings.deviceInfo.firmware().get(new SettingCallback<Version>() {
@Override
public void onSuccess(final Version value) {
// Handle read data here.
// For example: display them in UI. This callback will be called in the same thread as connection was created (not opened).
// You can use your activity method runOnUIThread(Runnable runnable) to handle that.
Log.d("DeviceRead","Read firmware version: " + value.toString());
}
@Override public void onFailure(DeviceConnectionException exception) {
// Handle exceptions here.
Log.d("DeviceRead","Reading firmware version failed.");
}
});
I noticed that there no call to connect
method which should look like this (also from tutorial):
// Pass your ConfigurableDevice to connection provider method
DeviceConnection connection = connectionProvider.getConnection(device);
connection.connect(new DeviceConnectionCallback() {
@Override
public void onConnected() {
// Do something with your connection.
// You can for example read device settings, or make an firmware update.
Log.d("DeviceConnection", "onConnected");
}
@Override
public void onDisconnected() {
// Every time your device gets disconnected, you can handle that here.
// For example: in this state you can try reconnecting to your device.
Log.d("DeviceConnection", "onDisconnected");
}
@Override
public void onConnectionFailed(DeviceConnectionException exception) {
// Handle every connection error here.
Log.d("DeviceConnection", "onConnectionFailed");
}
});
There should be a log message telling that you are trying to make a read on not connected connection object.
Can you send logs to confirm that?