I have written a set of programs with the intent of using a radio transmitter-receiver (NRF24L01) to connect two devices as if they were connected via a serial interface.
Currently, i am able to send bash commands in one direction, lets say from device A to B. My A device is currently an AVR microcontroller.
My B device is a Rapberry Pi. I use the following command to pipe the received text to bash. This allows commands to be sent but not for their output to be sent back to the A device.
./program | bash
I am not sure how to pipe the output from bash back into my program in a way that will not block and prevent the program from reacting to received data. If it is possible to setup a pipe in both directions, I still do not think I can use functions like
fgets as they are blocking.
Both devices share the same library for transmit and receive functionality, these transmit and receive functions can be called with an option to make them non-blocking.