JianyuWang0623 commented on PR #3003:
URL: https://github.com/apache/nuttx-apps/pull/3003#issuecomment-2673541891

   @xiaoxiang781216 @Donny9 @yangsong8-ai Here are 2 problems:
   ### 1. Output format: Fastboot tool version & response code "TEXT", "INFO"
   - The print format of "INFO" is: "(bootloader) " + InfoMessagePayload + 
ā€˜\n’, which break the original format
       ```
       $ fastboot oem sh ls /dev/
                                                          (bootloader) /dev:
       
       (bootloader)  console
       
       (bootloader)  fastboot/
       
       (bootloader)  null
       
       (bootloader)  ram0
       
       (bootloader)  ttyS0
       
       (bootloader)  zero
       ```
   
   - fastboot version 28.0.2-debian doesn`t support "TEXT", the latest 
version(fastboot version 35.0.2-12147458) supports
       - 28.0.2-debian 
       ```
       $ fastboot --version
       fastboot version 28.0.2-debian
       Installed as /usr/lib/android-sdk/platform-tools/fastboot
       
       $ fastboot oem sh ls /dev/
                                                          FAILED (Device sent 
unknown status code: TEXT console
       )
       fastboot: error: Command failed
       ```
       - 35.0.2-12147458
       ```
       $ ./platform-tools/fastboot oem sh ls /dev/
       /dev:
        console
        fastboot/
        null
        ram0
        ttyS0
        zero
       ```
       - source
       ```
       ^be8f723e6 (Arve Hj?nnev?g 2024-08-01 00:19:49 +0000 503)         } else 
if (android::base::StartsWith(input, "TEXT")) {
       ^be8f723e6 (Arve Hj?nnev?g 2024-08-01 00:19:49 +0000 504)             
text_(input.substr(strlen("TEXT")));
       ^be8f723e6 (Arve Hj?nnev?g 2024-08-01 00:19:49 +0000 505)             // 
Reset timeout as many more TEXT may come
       ^be8f723e6 (Arve Hj?nnev?g 2024-08-01 00:19:49 +0000 506)             
start = std::chrono::steady_clock::now();
       ^be8f723e6 (Arve Hj?nnev?g 2024-08-01 00:19:49 +0000 507)         } else 
if (android::base::StartsWith(input, "DATA")) {
       ... ...
       ^be8f723e6 (Arve Hj?nnev?g 2024-08-01 00:19:49 +0000 517)         } else 
{
       ^be8f723e6 (Arve Hj?nnev?g 2024-08-01 00:19:49 +0000 518)             
error_ = android::base::StringPrintf("Device sent unknown status code: %s", 
status);
       ^be8f723e6 (Arve Hj?nnev?g 2024-08-01 00:19:49 +0000 519)             
return BAD_DEV_RESP;
       ^be8f723e6 (Arve Hj?nnev?g 2024-08-01 00:19:49 +0000 520)         }
       ```
   
   **Maybe we can suggest using the latest version fastboot tool and use "TEXT" 
for pretty format.**
   
   
   ### 2. The exit status of the command was incorrect, maybe pclose() has some 
bugs?
       ```
       $ ./platform-tools/fastboot oem sh ps
         PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK          
  STACK COMMAND
           0     0   0 FIFO     Kthread   - Ready              0000000000000000 
0003056 Idle_Task
           1     0 224 RR       Kthread   - Waiting  Semaphore 0000000000000000 
0001976 hpwork 0x3fc8bb90 0x3fc8bbc0
           2     2 100 RR       Task      - Waiting  Semaphore 0000000000000000 
0004048 nsh_main
           3     3 100 RR       Task      - Ready              0000000000000000 
0001992 fastbootd
           4     4 100 RR       Task      - Running            0000000000000000 
0001992 popen -c ps
       FAILED (remote: 'error detected -1 10')
       fastboot: error: Command failed
       ```


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