You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reference:
This modification is base on the DS SDK spec:
When EdgeX is given (or returns) a float32 or float64 value as a string, the format of the string is by default a base64 encoded little-endian of the float32 or float64 value
We just discussed this in the devices WG, it turns out the spec was changed in Edinburgh from big endian to little endian. The C SDK was changed, but the Go SDK wasn't, so all floats are converted to big endian before encoding, hence the spec mismatch.
We can't change this in a 1.x version of device-sdk-go as it would break existing applications.
The current consensus is that we should probably just drop base64 encoding for v2. As such, we should make sure this gets brought up as part of our Ireland planning.
Modify the float base64 string encoding function.
Convert binary from big-endian to little-endian and then encode the float value to base64 string.
Proposal:
Change the ValueToString function
device-sdk-go/pkg/models/commandvalue.go
Line 340 in 6b5c10e
device-sdk-go/pkg/models/commandvalue.go
Line 350 in 6b5c10e
Reference:
This modification is base on the DS SDK spec:
https://docs.google.com/document/d/1aMIQ0kb46VE5eeCpDlaTg8PP29-DBSBTlgeWrv6LuYk/edit
https://play.golang.org/p/gbQ8NpRPaHO
The text was updated successfully, but these errors were encountered: