pkarashchenko commented on code in PR #8950:
URL: https://github.com/apache/nuttx/pull/8950#discussion_r1173614920


##########
drivers/net/telnet.c:
##########
@@ -1089,6 +1075,48 @@ static int telnet_ioctl(FAR struct file *filep, int cmd, 
unsigned long arg)
       break;
 #endif
 
+    /* Handle TERMIOS command */
+
+    case TCGETS:
+      {
+        termiosp = (FAR struct termios *)((uintptr_t)arg);
+        DEBUGASSERT(termiosp != NULL);
+
+        cfmakeraw(termiosp);
+
+        termiosp->c_lflag = priv->td_lflag;
+      }
+      break;
+
+    case TCSETS:
+      {
+        termiosp = (FAR struct termios *)((uintptr_t)arg);
+        DEBUGASSERT(termiosp != NULL);
+
+        /* Save the termios settings */
+
+        priv->td_lflag = termiosp->c_lflag;
+
+        if (priv->td_lflag & ECHO)

Review Comment:
   Optional
   ```suggestion
           if ((priv->td_lflag & ECHO) != 0)
   ```



##########
drivers/net/telnet.c:
##########
@@ -420,25 +415,16 @@ static ssize_t telnet_receive(FAR struct telnet_dev_s 
*priv,
             break;
 
           case STATE_DO:
-#ifdef CONFIG_TELNET_CHARACTER_MODE
-            if (ch == TELNET_SGA || ch == TELNET_ECHO)
+
+            if ((priv->td_lflag & ECHO) && ch == TELNET_ECHO)

Review Comment:
   Optional
   ```suggestion
               if ((priv->td_lflag & ECHO) != 0 && ch == TELNET_ECHO)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to