Java SDK version: 1.3.0 (https://github.com/aws/aws-iot-device-sdk-java)
The @AWSIotDeviceProperty does not work properly.
I have the following example:
public class MyDevice extends AWSIotDevice {
public MyDevice(String thingName) {
super(thingName);
}
@AWSIotDeviceProperty
private float data;
public float getData(){
return data;
}
public void setData(float data){
this.data = data;
}
}
Lets assume that data value > 0 in the Shadow (simply from previous updates).
Once the created device attached to the client, data value changed to be 0.0 (or null for non primitive types)
After debugging, here some conclusions:
1 - Fields never synchronized by Shadow values, so they still have 0.0/null values, although
allowUpdate has true value by default. (Setter function never called to sync attributes values).
2 - Shadow calls Getter function (getData) every 3 seconds to keep the shadow updates, but as described in the previous clause, fields still have 0.0/null values, so Shadow will be synced with 0.0/null values.
3 - Getter function called every 3 seconds and Setter functions never called.
Is there a way to let @AWSIotDeviceProperty works in a bidirectional way so MyDevice attributes synced with Shadow values immediately after the attach and before Getter function called with 0.0/null ?
Thanks