04-12-2019 12:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-12-2019 12:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Im trying to send sensor readings to a companion app, due to the high frequency of readings im trying to reduce their size so they can be sent over the messaging API by storing them as different types, however if i send a typed array using the messaging API it gets turned into a UInt8Array when i check it in the companion, which loses too much precision.
Does anyone know why this is? Or if there is another way to reduce the size of the readings?

04-15-2019 15:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


04-15-2019 15:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
You could try encoding the data on the device using CBOR, the decoding it in the companion.
import { decode, encode } from "cbor";
let encodedData = encode({some: "object"});
let decodedData = decode(encodedData);

