i need to read out the signal strength of a modem to my qt program like this:
echo at+csq > /dev/ttyUSB2 | head -n 4 /dev/ttyUSB2
echo at+csq > /dev/ttyUSB2 | head -n 4 /dev/ttyUSB2
To copy to clipboard, switch view to plain text mode
which is the best to use:
Qprocess::setStandardOutputProcess with two Qprocesses, one for "echo at+csq > /dev/ttyUSB2" and one for "head -n 4 /dev/ttyUSB2 " or a single Qprocess that runs a shell script with pipe
Like this
#!/bin/bash
echo at+csq > /dev/ttyUSB2 | head -n 4 /dev/ttyUSB2
#!/bin/bash
echo at+csq > /dev/ttyUSB2 | head -n 4 /dev/ttyUSB2
To copy to clipboard, switch view to plain text mode
Bookmarks