public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] RE: redirect console output to telnet
@ 2007-03-06 19:32 Tracy Jones
  0 siblings, 0 replies; only message in thread
From: Tracy Jones @ 2007-03-06 19:32 UTC (permalink / raw)
  To: ecos-discuss


Hi - 

I would like to be able to telnet to a port on my ecos box and see the
console output.  I tried a few things

1. Re-direct stdout and stderr - that worked but I got the output from
printf, but not diag_printf

2, Have an accept on port 9000 and do this when I get something on that
port

CYGACC_CALL_IF_SET_CONSOLE_COMM(TCP_CHANNEL);

while (1)

{

            // need to tell if the client has disconnected in some
way...

            sleep(10 * 1000);

}

 
2 actually worked, but I have no way of knowing that the client
disconnected so once I have disconnected I cannot reconnect.


So I tried this
int cur =
CYGACC_CALL_IF_SET_CONSOLE_COMM(CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT
);
 
CYGACC_CALL_IF_SET_CONSOLE_COMM(CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS)
;

comm = CYGACC_CALL_IF_CONSOLE_PROCS();

       char * buf = new char[512];

       while (1)

       {

		 CYGACC_COMM_IF_READ(*comm, buf, 512);

            ssize_t bytesWritten = send(newfd, buf, 512, 0);

            if (bytesWritten == -1)

            {

                CYGACC_CALL_IF_SET_CONSOLE_COMM(cur);

                break ;

            }

        }

 

This did not work at all.


It seems like what I really want is to port net_io.c from redboot into
my application space but that doesn't work easily.  Does any one have
any other ideas??

Thanks

 
Tracy 




--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-03-06 19:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-06 19:32 [ECOS] RE: redirect console output to telnet Tracy Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).