I am programming a php page for controlling a serial port using some in-screen-buttons. When I press a button, this sends some data through the serial port and it shows its response. All this is working OK.
Now, I need to listen continuously the serial port in order to receive data that I haven't ask for. I'm trying to do it with a timer in javascript, but every time I execute the PHP code through AJAX, serial port is restarted and its buffer is flushed. I need to pass the object that controls the serial port to the javascript code before finish the execution of the PHP code. And when pressing a button, I need to pass this object to the new PHP code.
How can I do this?
Thanks a lot