Now i found how to make two RaspberryPi communicate together using RFCOMM Bluetooth protocol, I have to see how to implement the terminal part.

On server side i will have to execute a login shell and send all its output to the remote device, and read all its input from the client side.

So i have to fin d a way to fork the execution of bash --login and redirect STDIN and STDOUT ... and some all the small issue that make the terminal usable like :

  • reading each keyboard key without waiting a "return"
  • removing ECHO on STDIN
  • removing ICANON on STDIN
  • handling signal to proper ends terminal SIGCHLD
  • handling signal to adjust tty side : SIGWINCH
  • using pselect to manage FD event
  • using forkpid to create the pty

The sample code is available on my github repository