I'm using a Raspberry Pi for a project that that needs to be able to write and read to a serial port, but from different programs. Program A needs to be able to read from the serial port, where peripheral A is sending data. Program B needs to write data to the serial port, where peripheral B is listening (For reference, in this case, program A is GPSD and program B is written by me). Program A never needs to write, and B never needs to read.
Is it possible to have both programs access the port at once? If not, is it possible to write a program that creates two device nodes (split /dev/ttyAMA
into something like /dev/ttyAMA_1
and /dev/ttyAMA_2
, perhaps?) that multiplex into the serial port?
Thanks in advance for any help!
-Matthew