JianyuWang0623 commented on code in PR #3098: URL: https://github.com/apache/nuttx-apps/pull/3098#discussion_r2152545713
########## system/fastboot/fastboot.c: ########## @@ -122,10 +139,20 @@ struct fastboot_file_s off_t offset; }; +struct fastboot_transport_s +{ + int (*init)(FAR struct fastboot_ctx_s *); + void (*deinit)(FAR struct fastboot_ctx_s *); + ssize_t (*read)(FAR struct fastboot_ctx_s *, FAR void *, size_t); + int (*write)(FAR struct fastboot_ctx_s *, FAR void *, size_t); +}; + struct fastboot_ctx_s { int usbdev_in; int usbdev_out; + int server_fd; /* fd for the TCP socket */ + int conn_fd; /* fd for the accepted socket */ Review Comment: got, 1. Transport file descriptors | idx | USB | TCP | poll | |-----|----------|---------------|------| | 0 |usbdev in |TCP socket | Y | | 1 |usbdev out|accepted socket| N | ```diff - int usbdev_in; - int usbdev_out; + int t_fd[2]; ``` 2. merge "wait_ms" and "read_left": store tims_ms argument before `poll()` of `fastboot_command_loop()`, and TCP transport remaining data size later. ```diff - int wait_ms; + uint64_t left; ``` -- 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