how to activate monitor on specific interface

Ian Caddy ianc at goanna.iinet.net.au
Mon Nov 28 01:47:26 UTC 2005


Hi Wolfram,

As far as I know the sdtin and stdout are effectively task variables, 
and so what we do is change them in our task.  This works fine for us. 
Here is an example:

rtems_task shell_shell(rtems_task_argument task_argument)
{
    shell_env_t * shell_env =(shell_env_t*) task_argument;
    shell_cmd_t * shell_cmd;
    struct termios term;	
    char * devname;


    devname = shell_env->devname;
    stdin =fopen(devname,"r+");
    setvbuf(stdin,NULL,_IONBF,0); /* Not buffered*/
    stdout=fopen(devname,"r+");
    setvbuf(stdout,NULL,_IONBF,0); /* Not buffered*/
    stderr=fopen(devname,"r+");

The error checking code has been removed for clarity, but you can check 
the returns from the fopens for NULL.

We setup this for each of our interfaces that we use for communications, 
such as some telnet sessions and multiple serial port sessions.

I hope this helps.

regards,

Ian Caddy



Wolfram Wadepohl wrote:
> Hello,
> 
> does anybody know how to activate the monitortask from libmisc on a 
> specific tty device interface, i. e. not on stdin or stdout?
> 

-- 
Ian Caddy
Goanna Technologies Pty Ltd
+61 8 9221 1860




More information about the users mailing list