yangsong8-a1 commented on issue #16004:
URL: https://github.com/apache/nuttx/issues/16004#issuecomment-2742555237

   @jlaitine I uploaded a patch to solve the ioctl problem 
https://github.com/apache/nuttx/pull/16029/commits/f6b28e91af9fff70ce99fd387dd49f8c2fb93f58.
   
   And a modification was made in reader_writer function in the hello app:
   ```
             /* NOTE: FIONREAD is broken. remove the following line to
              * experience this
              */
   
           //bytes_to_read = 1;
   
             if (bytes_available > 0)
               {
                 memset(buffer, 0, sizeof(buffer));
                 nread = 0;
               }
   
             if (retval == 0 && bytes_available >= bytes_to_read)
               {
                 int n = 0;
                 do
                   {
                     n = read(ttyacm_fd, buffer + n, bytes_to_read - nread);
                     nread += n;
                   } while (nread < bytes_to_read);
   
                 printf("read %d characters : %s\n", nread, buffer);
               }
   
             write(ttyacm_fd, hello_world, sizeof(hello_world));
             usleep(100000);
   ```
   


-- 
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