diff --git a/ChangeLog b/ChangeLog index 82f3fdc097a..aa8e91895c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -425,5 +425,8 @@ * Fix errors and warnings introduced into Linux sim build because of recent Cygwin-based sim changes * NSH: Add mem command to display heap usage + * Added telnet NSH configuration for Neuros OSD. + * Basic integration of concurrent telnet/serial NSH functional on Neuros + OSD (some bugs on background commands). diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html index ade91695746..05e587ae32d 100644 --- a/Documentation/NuttX.html +++ b/Documentation/NuttX.html @@ -1059,6 +1059,9 @@ nuttx-0.3.13 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> * Fix errors and warnings introduced into Linux sim build because of recent Cygwin-based sim changes * NSH: Add mem command to display heap usage + * Added telnet NSH configuration for Neuros OSD. + * Basic integration of concurrent telnet/serial NSH functional on Neuros + OSD (some bugs on background commands). pascal-0.1.3 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> diff --git a/examples/nsh/nsh.h b/examples/nsh/nsh.h index 0484f4f2183..69ed0f030db 100644 --- a/examples/nsh/nsh.h +++ b/examples/nsh/nsh.h @@ -192,6 +192,7 @@ typedef int (*cmd_t)(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); * Public Data ****************************************************************************/ +extern const char g_nshgreeting[]; extern const char g_nshprompt[]; extern const char g_fmtargrequired[]; extern const char g_fmtarginvalid[]; diff --git a/examples/nsh/nsh_main.c b/examples/nsh/nsh_main.c index ebe24391390..35f88b72a12 100644 --- a/examples/nsh/nsh_main.c +++ b/examples/nsh/nsh_main.c @@ -161,6 +161,7 @@ static const struct cmdmap_s g_cmdmap[] = * Public Data ****************************************************************************/ +const char g_nshgreeting[] = "NuttShell (NSH)\n"; const char g_nshprompt[] = "nsh> "; const char g_fmtargrequired[] = "nsh: %s: missing required argument(s)\n"; const char g_fmtarginvalid[] = "nsh: %s: argument invalid\n"; diff --git a/examples/nsh/nsh_serial.c b/examples/nsh/nsh_serial.c index e138cf6c1e9..b3e60b75fdc 100644 --- a/examples/nsh/nsh_serial.c +++ b/examples/nsh/nsh_serial.c @@ -343,7 +343,7 @@ int nsh_consolemain(int argc, char *argv[]) { FAR struct serial_s *pstate = nsh_allocstruct(); - printf("NuttShell (NSH)\n"); + printf(g_nshgreeting); fflush(pstate->ss_stream); for (;;) diff --git a/examples/nsh/nsh_telnetd.c b/examples/nsh/nsh_telnetd.c index a2729347279..5cfe7ba50ee 100644 --- a/examples/nsh/nsh_telnetd.c +++ b/examples/nsh/nsh_telnetd.c @@ -296,11 +296,7 @@ static void nsh_putchar(struct telnetd_s *pstate, uint8 ch) if (ch == ISO_nl || tio->tio_bufndx == (CONFIG_EXAMPLES_NSH_LINELEN - 1)) { - if (tio->tio_bufndx > 0) - { - pstate->tn_cmd[tio->tio_bufndx] = '\0'; - } - + pstate->tn_cmd[tio->tio_bufndx] = '\0'; nsh_dumpbuffer("TELNET CMD", pstate->tn_cmd, strlen(pstate->tn_cmd)); nsh_parse(&pstate->tn_vtbl, pstate->tn_cmd); tio->tio_bufndx = 0; @@ -481,13 +477,14 @@ static void *nsh_connection(void *arg) { /* Initialize the thread state structure */ + memset(tio, 0, sizeof(struct telnetio_s)); tio->tio_sockfd = sockfd; tio->tio_state = STATE_NORMAL; pstate->u.tn = tio; /* Output a greeting */ - nsh_output(&pstate->tn_vtbl, "NuttShell (NSH)\n"); + nsh_output(&pstate->tn_vtbl, g_nshgreeting); /* Loop processing each TELNET command */