PLEX86  x86- Virtual Machine (VM) Program
 Plex86  |  CVS  |  Mailing List  |  Download  |  Linux  |  Newsgroups

Two applications listening one serial port


Your Ad Here

Your Ad Here

In a message on Wed, 01 Feb 2006 20:59:17 +0100, wrote :

So, the weather station is sending a stream of data in some format 'blindly' eg: wind speed, temperature, etc. as little message packets over and over again?

tee is not really designed for what you are doing.

wget problem
I asked that question which produced a thread of replies. The above has to do with mechanics-characteristics buttociated with web server that serve...

I suspect not, since things are not working well!

You probably need to create a special program that creates two named pipes (man 3 mkfifo) and reads from the serial port and writes to these two pipes. Tee wants to write to files, not pipes. Your little program will look alot like tee, but use a different sort of file open (create and open named pipes). A more complex version would take the two program pathnames as arguments and create unnamed pipes using popen() (man popen) with the two weather programs.

Pseudo code would be something like:

* Fifo (pipe) tee *

tee(string tty, string pipe1, string pipe2) { mkfifo(pipe1); mkfifo(pipe2); p1 = open(pipe1,"w"); p2 = open(pipe2,"w"); tt = open(tty,"r"); forever { read(tt,buffer); write(p1,buffer); write(p2,buffer); } }

ls color
Don't forget LSOPTIONS. It will if $LSOPTIONS has "--color=auto" or "--color=always" set. In my case, it's aliased to "-bin-ls $LSOPTIONS", and LSOPTIONS is set to "--color=auto -F -b -T 0...

* tee using popen() *

popentee(string tty,string prog1,string prog2) { tt = open(tty,"r"); p1 = popen(prog1,"w"); p2 = popen(prog2,"w"); forever { read(tt,buffer); write(p1,buffer); write(p2,buffer); } }

The 'forever' loops should have some break out method, eg a signal or something (man signal).

You explained things well enough.

backspace munging via Konsole, sshtelnet
Sometimes it's the smallest things that drive you crazy. In Red Hat 4.0 Enterprise (or whatever), in Gnome, using Konsole, when I ssh or telnet...



Your Ad Here

List | Previous | Next

backspace munging via Konsole, sshtelnet

Linux groups from Newsgroups

The #1 Usenet Provider on the Internet

export DISPLAY from LnxBox1 to LnxBox2 not working