I'm developing an IoT/Mobile application. Currently i have a code that receives and decodes a package async from my IoT device. This device connects tools such as scales and other equipments. I need to send this IoT data into input Fields.
The code that manages IoT runs in background, it starts with the application, and runs using callbacks. It manages the connections, reconnections and sets up a callback on package data received. Just for example a package data can contain a single value like: 10.34 This code starts with the application.
On the main app, i have many input fields, numeric and text. When i receive a package from IoT I want to write into the currently focused field.
- The user starts an operation in the App, there is a field called
Weigth. - The user focus on the field.
- The user presses a button on the external IoT device connected to a scale.
- The app receives the data (ex. 10.34 kg) into the phone and fires a callback.
- The callback sends the 10.34 into the input field for
Weight.
Just for example. Imagine that the IoT device is a keyboard, and it can write just the same as the screen keyboard. But the firmware is closed and it uses a low level crazy protocol that can't be converted into a keyboard.
Extra
Injecting KeyboardEvent doesn't work, for safety reasons we cannot inject if we don't know where. Injecting into document (root level) won't work.
My application is currently using Redux (if it helps on solution)