RFCOM Streamin in real time to Native-PRO-UI Chart


#1

After several challenges, among them learning a new framework ({N}), a new Language (TypeScript) among other features since I am not a Mobile developer and I saw myself in this new scenario due to the demand of my client, I am quse at the end of this step , and the next step is to integrate reading the data obtained into a serial device that sends via bluetooth to the cell phone, and generates a graph.

Usually in Java I would do this with a thread that would be responsible for reading the data through a streame obtained from the bluetooth connection on a separate thread, and it would update a scaled BufferRing (Circular Buffer) to keep the display always updated on the chart.

The main thread feeds the chart and other updated screen interactions.

But NativeScript along with JavaScript does not have the thread’s effect as Java has, the Worker feature does not meet my need even because it would be a big overhead to use the same json messaging system to transpose data from a thread to another.

Would anyone have an example of how to keep a byte streaming from the bluetooth rfcom serial port updating the NativeScript-UI in real time?