Receive asynchronous data in javascript
up vote 2 down vote favorite I'm using an Linux embedded device that can only run QML/Javascript items. There are no compilers available, no Python, no curl, no Node.js, no package managers ... But I can write bash scripts. I need to send asynchronous data from a bash script to the QML/JS objects. Until now I did the opposite: the JS reads a file created from the bash script: Bash script: #!/bin/bash stty -F /dev/ttyS1 115200 -echo echo "Receiver is listening..." file="/dev/ttyS1" while read -r line; do echo "$line" target=$line:0:1 echo "$target" if [ "$target" = "C" ]; then echo "$line#?" > /tmp/file1 elif [ "$target" = "D" ]; then echo "$line#?" > /tmp/file2 fi done < "$file" QML/JS: function request(url, callback) var xhr = new XMLHttpRequest(); var timer = Qt.createQmlObject("import QtQuick 1.1; Timer interval: 500; repeat: false; ru...