Skip navigation.
Home
The QNX Community Portal

View topic - using telnet with QNX 4.25

using telnet with QNX 4.25

For the old QNX2 and QNX4 RTOS

using telnet with QNX 4.25

Postby teleqnx » Fri May 15, 2009 6:03 pm

I'm working on a project with a preexisting QNX 4.25 program interacts with certain hardware. I'm tasked with creating a Windows interface that allows a user with no knowledge of QNX to be able use this hardware. I've created a GUI that can connect to log the user into another computer through telnet. Now I've begun manually testing running QNX through telnet, and while I can successfully run the QNX program through telnet, it seems that after the program has begun running, I can no longer pass commands.

Would anyone happen to know if this is a limitation in the telnet protocol, or if there is some qnx or telnet setting I could change, and if not, would I be able to do what I need with SSH?
teleqnx
New Member
 
Posts: 7
Joined: Thu Jan 22, 2009 3:55 pm

RE: using telnet with QNX 4.25

Postby mario » Fri May 15, 2009 6:47 pm

Telnet should behave not differently then a console, aside terminal issue. For example telnet on Windows only supports 7 bit, hence control character may not work, thing like F1 will send a different sequence then if entered directly on the console. Your QNX program might not handle that properly. Just a guess.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

RE: using telnet with QNX 4.25

Postby teleqnx » Fri May 15, 2009 7:14 pm

Thanks for the reply! I'm gonna keep at it.
teleqnx
New Member
 
Posts: 7
Joined: Thu Jan 22, 2009 3:55 pm

RE: using telnet with QNX 4.25

Postby maschoen » Sat May 16, 2009 5:15 pm

Am I reading you correctly? You are using the telnet protocol from Windows to log into QNX? Once logged in you start a program. Then you can no longer run any other programs. Has the program that was started first finished?
maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm

RE: using telnet with QNX 4.25

Postby teleqnx » Sat May 16, 2009 8:01 pm

Oh, no, my problem is passing user input to the program. For example, when the user presses 1, the program is supposed to do a certain thing, and when the user presses 9, the program is supposed to end.

The program accepts these key inputs when the program is run directly from QNX, but not when run through telnet. There is no response to keystrokes after the program is started.

If this is any help, here are the parts of the program that deal with those keystrokes:
Code: Select all
   while (loop) {
      if ((keystroke = wgetch(win)) != ERR) {
         flushinp();
         processKeystroke(keystroke);

         if (keystroke == '9') {            
            processKeystroke(keystroke);            
            loop = FALSE;
         }
      }
   }
killthreads();


and here is the processkeystroke function:
Code: Select all
void processKeystroke(char keystroke)
{
   switch(keystroke) {      


      case '0': // startup
                ........................
                case '9':
               /* code to tell hardware to stop running */
break;
}
}
teleqnx
New Member
 
Posts: 7
Joined: Thu Jan 22, 2009 3:55 pm

Re: RE: using telnet with QNX 4.25

Postby maschoen » Sat May 16, 2009 8:58 pm

This tells me what the program does, which looks fine. What are you doing in the telnet simulator? I recall that part could be a bit tricky. Do you login the way a telnet user would normally do this? Does the login start a shell or run the program directly?


teleqnx wrote:Oh, no, my problem is passing user input to the program. For example, when the user presses 1, the program is supposed to do a certain thing, and when the user presses 9, the program is supposed to end.

The program accepts these key inputs when the program is run directly from QNX, but not when run through telnet. There is no response to keystrokes after the program is started.

If this is any help, here are the parts of the program that deal with those keystrokes:
Code: Select all
   while (loop) {
      if ((keystroke = wgetch(win)) != ERR) {
         flushinp();
         processKeystroke(keystroke);

         if (keystroke == '9') {            
            processKeystroke(keystroke);            
            loop = FALSE;
         }
      }
   }
killthreads();


and here is the processkeystroke function:
Code: Select all
void processKeystroke(char keystroke)
{
   switch(keystroke) {      


      case '0': // startup
                ........................
                case '9':
               /* code to tell hardware to stop running */
break;
}
}
maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm

RE: Re: RE: using telnet with QNX 4.25

Postby teleqnx » Sat May 16, 2009 9:03 pm

The login starts the shell, and everything up until starting the program works just the same as it does when working in the QNX shell directly
teleqnx
New Member
 
Posts: 7
Joined: Thu Jan 22, 2009 3:55 pm


Return to QNX2 and QNX4

Who is online

Users browsing this forum: No registered users and 1 guest

cron