To forward raw serial data to a network client i use gpspipe.
for read only clients this works fine, even with the initial headers gpspipe/gpsd adds to the beginning of the real data
Now how to send real raw serial data back ? in direct mode (without gpsd) something simple like:
nc -l -k 2102 </dev/ttyAMA0 >/dev/ttyAMA0
does what i need.
Tried using a very long socat > tee | .... etc command that first makes a virtual pts device and then connects gpsd to that while also running a tcp server
Something more elegant be be preferred:
#START CLIENT LISTEN ONLY TCP SERVER
echo Starting client listen only TCP server at port: $TCP_CLIENT_PORT
./gpsd/gpspipe -R /dev/ttyAMA0 | nc -l -k $TCP_CLIENT_PORT >/dev/null &
#START RAW SERIAL R/W CONTROL SERVER
echo Starting R/W client control TCP server at port: $TCP_CONTROL_PORT
./gpsd/gpspipe -R /dev/ttyAMA0 | nc -l -k $TCP_CONTROL_PORT
Here we get the raw serial data/commands that need to be send as is (without gpsd headers) back to the device.
Now how can this be send back to gpsd and forwarded to the device?