How to temporarily hijack console serial port

View: New views
1 Messages — Rating Filter:   Alert me  

How to temporarily hijack console serial port

by Tim Hatton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I am currently in the process of building an application with eCos (2.0.43)
running on our own hardware which uses an ATMEL AT91RM9200 CPU.

I have a strange requirement which I'm not sure how to fulfil at the moment.
Our application uses many serial ports talking to other devices (via termios drivers) and  one device has been configured eCos to use one of the serial ports as the C console (stdin/stdout) which is used as a user interface for configuration etc.
So far, so good. We now have a requirement to also be able to plug a device into the user interface port sometimes. So now I would like to allow the application to temporarily "hijack" the console serial port and open it as a termios port for a while to talk to the device and then "return" it to it's user interface use.

So, is there anyway to tell eCos (or I guess the C library) to stop using a particular port as the console at run time and then re-instate it? (There's no problem within the context of the application to know when to change from one "mode" to the other, I just don't know how to do it).

If anyone has any ideas I'd be very grateful,
Best regards,
Tim Hatton