piotrnarajowski commented on code in PR #1731:
URL: https://github.com/apache/mynewt-nimble/pull/1731#discussion_r1561037150


##########
apps/blestress/src/rx_stress.c:
##########
@@ -1439,43 +1453,36 @@ stress_uuid_init()
     }
 }
 
-static void
-rx_stress_read_command_cb(void)
-{
-    console_printf("Start testing\n");
-    os_sem_release(&rx_stress_main_sem);
-}
-
-static void
+void
 rx_stress_main_task_fn(void *arg)
 {
     int i;
 
     stress_uuid_init();
 
-    console_printf("\033[1;36mRX device\033[0m\n");
-    console_printf("Press ENTER to start: \n");
-    console_init(&rx_stress_read_command_cb);
-
-    /* Waite for pressing ENTER in console */
-    os_sem_pend(&rx_stress_main_sem, OS_TIMEOUT_NEVER);
-
-    /* Standard tests perform */
-    for (i = 1; i < STRESS_UUIDS_NUM; ++i) {
-        /* Start test. */
-        rx_stress_start(i);
-    }
-
-    /* Print tests results */
-    com_stress_print_report(rx_stress_ctx);
-
-    /* Task should never return */
     while (1) {
+        /* Waite for pressing ENTER in console */
+        os_sem_pend(&rx_stress_test_sem, OS_TIMEOUT_NEVER);
+
+        if (test_case_num == 0) {
+            for (i = 1; i < STRESS_UUIDS_NUM; ++i) {
+                /* Run all tests. */
+                rx_stress_start(i);
+            }
+            all_test_run = 1;
+            console_printf("\033[0;32mAll tests completed\033[0m\n");
+            for (i = 1; i < STRESS_UUIDS_NUM; ++i) {
+                /* Print test results of all tests */
+                com_stress_print_report(rx_stress_ctx, i);
+            }
+        } else {
+            rx_stress_start(test_case_num);

Review Comment:
   The point was not to run rx_stress_start(0) after exiting the if statement  



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to