From c5aabde8c3a3a488585b08f572a968abd8c64725 Mon Sep 17 00:00:00 2001 From: Ramya Subramanyam Date: Wed, 13 Aug 2025 11:34:41 +0530 Subject: [PATCH 1/4] config: extras/arduino-core-tests: Add WIFI tests and update submodule. Signed-off-by: Ramya Subramanyam --- config/project.yml | 33 +++++++++++++++++++++++++++++++++ config/user.yml | 4 ++++ extras/arduino-core-tests | 2 +- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/config/project.yml b/config/project.yml index 57657842..c646fdf1 100644 --- a/config/project.yml +++ b/config/project.yml @@ -150,3 +150,36 @@ unit-test: command: make test_uart_tx query: uart_multiple_boards_tx == '1:1' working_dir: extras/arduino-core-tests + + unit-test-wifi-tcp: + - description: Compiling, flashing and monitoring WIFI TCP server unit test. + command: make test_wifi_server + query: wifi_multiple_boards_server == '1:1' + working_dir: extras/arduino-core-tests + + - description: Compiling, flashing and monitoring WIFI TCP client unit test. + command: make test_wifi_client + query: wifi_multiple_boards_client == '1:1' + working_dir: extras/arduino-core-tests + + unit-test-wifi-udp: + - description: Compiling, flashing and monitoring WIFI UDP server unit test. + command: make test_wifi_udp_server + query: wifi_multiple_boards_server == '1:1' + working_dir: extras/arduino-core-tests + + - description: Compiling, flashing and monitoring WIFI UDP client unit test. + command: make test_wifi_udp_client + query: wifi_multiple_boards_client == '1:1' + working_dir: extras/arduino-core-tests + + unit-test-wifi-sta-ap: + - description: Compiling, flashing and monitoring WIFI Access point unit test. + command: make test_wifi_ap + query: wifi_multiple_boards_ap == '1:1' + working_dir: extras/arduino-core-tests + + - description: Compiling, flashing and monitoring WIFI station unit test. + command: make test_wifi_sta + query: wifi_multiple_boards_sta == '1:1' + working_dir: extras/arduino-core-tests diff --git a/config/user.yml b/config/user.yml index 88808e38..7b03d037 100644 --- a/config/user.yml +++ b/config/user.yml @@ -12,3 +12,7 @@ unit-test: - unit-test-analog-io-pwm - unit-test-pulse - unit-test-uart + - unit-test-wifi-tcp + - unit-test-wifi-udp + - unit-test-wifi-sta-ap + \ No newline at end of file diff --git a/extras/arduino-core-tests b/extras/arduino-core-tests index 33e60836..a9b1e6a6 160000 --- a/extras/arduino-core-tests +++ b/extras/arduino-core-tests @@ -1 +1 @@ -Subproject commit 33e60836aaf16eb5f71e45f081514e9aec8e1c27 +Subproject commit a9b1e6a63a089a12acc774c80f44f33c46a255b9 From 41068c4f07fb43c6dbd7638425c424dbfdb25bd1 Mon Sep 17 00:00:00 2001 From: Ramya Subramanyam Date: Tue, 19 Aug 2025 21:20:15 +0530 Subject: [PATCH 2/4] libraries/WiFi/src: Fix timeout bug. Signed-off-by: Ramya Subramanyam --- config/user.yml | 11 +++++------ extras/arduino-core-tests | 2 +- libraries/WiFi/src/WiFi.cpp | 2 +- libraries/WiFi/src/WiFi.h | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/config/user.yml b/config/user.yml index 7b03d037..17697ed8 100644 --- a/config/user.yml +++ b/config/user.yml @@ -2,17 +2,16 @@ unit-test: - unit-test-iic-pingpong - unit-test-spi-pingpong - unit-test-digital-io - - unit-test-interrupts - unit-test-time - - unit-test-random + - unit-test-uart + - unit-test-interrupts - unit-test-tone - unit-test-spi-loopback - unit-test-iic-single-board + - unit-test-wifi-sta-ap - unit-test-analog-io-adc + - unit-test-random - unit-test-analog-io-pwm - unit-test-pulse - - unit-test-uart - unit-test-wifi-tcp - - unit-test-wifi-udp - - unit-test-wifi-sta-ap - \ No newline at end of file + - unit-test-wifi-udp \ No newline at end of file diff --git a/extras/arduino-core-tests b/extras/arduino-core-tests index a9b1e6a6..ac43c508 160000 --- a/extras/arduino-core-tests +++ b/extras/arduino-core-tests @@ -1 +1 @@ -Subproject commit a9b1e6a63a089a12acc774c80f44f33c46a255b9 +Subproject commit ac43c508104be5072d170adac4796f1aa749c52d diff --git a/libraries/WiFi/src/WiFi.cpp b/libraries/WiFi/src/WiFi.cpp index 612ecf8a..953d79a3 100644 --- a/libraries/WiFi/src/WiFi.cpp +++ b/libraries/WiFi/src/WiFi.cpp @@ -312,7 +312,7 @@ int8_t WiFiClass::scanNetworks() { constexpr uint16_t timeout = 1000; /* 1000 times by 10 ms delay = 10 seconds */ uint16_t timer = 0; - while (scan_results.status == CY_WCM_SCAN_INCOMPLETE || timer < timeout) { + while (scan_results.status == CY_WCM_SCAN_INCOMPLETE && timer < timeout) { delay(10); timer++; } diff --git a/libraries/WiFi/src/WiFi.h b/libraries/WiFi/src/WiFi.h index e7c2f30f..01de7c8a 100644 --- a/libraries/WiFi/src/WiFi.h +++ b/libraries/WiFi/src/WiFi.h @@ -30,7 +30,7 @@ typedef enum { } wl_status_t; typedef enum { - WIFI_STATUS_UNINITED = 0, + WIFI_STATUS_UNINITED = 255, WIFI_STATUS_INITED = WL_IDLE_STATUS, WIFI_STATUS_STA_CONNECTED = WL_CONNECTED, WIFI_STATUS_AP_CONNECTED = WL_AP_LISTENING, From eccd8d85a1d72c6eba1f2ddae9200231ff77d91e Mon Sep 17 00:00:00 2001 From: Ramya Subramanyam Date: Thu, 21 Aug 2025 08:12:06 +0530 Subject: [PATCH 3/4] extras/arduino-core-tests: Update submodule. Signed-off-by: Ramya Subramanyam --- extras/arduino-core-tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/arduino-core-tests b/extras/arduino-core-tests index ac43c508..da2d364e 160000 --- a/extras/arduino-core-tests +++ b/extras/arduino-core-tests @@ -1 +1 @@ -Subproject commit ac43c508104be5072d170adac4796f1aa749c52d +Subproject commit da2d364e949c2b75ba63d6f4b3a459e65813b3f3 From c76cfaa922196bcf460566dcdec8254742a60c65 Mon Sep 17 00:00:00 2001 From: Ramya Subramanyam Date: Thu, 21 Aug 2025 08:54:44 +0530 Subject: [PATCH 4/4] config/project.yml: Add board details for wifi tests. Signed-off-by: Ramya Subramanyam --- config/project.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/project.yml b/config/project.yml index c646fdf1..c063c852 100644 --- a/config/project.yml +++ b/config/project.yml @@ -154,23 +154,23 @@ unit-test: unit-test-wifi-tcp: - description: Compiling, flashing and monitoring WIFI TCP server unit test. command: make test_wifi_server - query: wifi_multiple_boards_server == '1:1' + query: wifi_multiple_boards_server_tcp == '1:1' working_dir: extras/arduino-core-tests - description: Compiling, flashing and monitoring WIFI TCP client unit test. command: make test_wifi_client - query: wifi_multiple_boards_client == '1:1' + query: wifi_multiple_boards_client_tcp == '1:1' working_dir: extras/arduino-core-tests unit-test-wifi-udp: - description: Compiling, flashing and monitoring WIFI UDP server unit test. command: make test_wifi_udp_server - query: wifi_multiple_boards_server == '1:1' + query: wifi_multiple_boards_server_udp == '1:1' working_dir: extras/arduino-core-tests - description: Compiling, flashing and monitoring WIFI UDP client unit test. command: make test_wifi_udp_client - query: wifi_multiple_boards_client == '1:1' + query: wifi_multiple_boards_client_udp == '1:1' working_dir: extras/arduino-core-tests unit-test-wifi-sta-ap: