Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Passing a Float32Array through peerSocket.send()

I am trying to pass an entire array of sensor readings to the companion through messaging.peerSocket.send(). However, the data gets encoded in a Uint8Array and I have trouble decoding it. Any help would be greatly appreciated.

 

Also, I am aware of the forum post: https://community.fitbit.com/t5/SDK-Development/Sending-Float32Array-to-companion-results-in-UInt8Ar.... The solution did not work for me though.

 

Thank you

Best Answer
0 Votes
1 REPLY 1

Do you need the data in near-real-time? If not, try using file transfer. It's more reliable, and I've had some success transferring Int16Arrays.

I converted all readings to Int16 for transmission because transfer rates can be as slow as ~1 kB/sec, and the accelerometer can provide data faster than that (depending on representation).

Peter McLennan
Gondwana Software
Best Answer
0 Votes