|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
The example's join+DHCP journey, hardware-free so it is host-testable. More...
Go to the source code of this file.
Functions | |
| static bool | wifi_hal_settle (ra8_wifi_t *wifi, uint32_t budget) |
| Poll the Wi-Fi facade until association or budget exhaustion. | |
| bool | wifi_hal_join_run (const wifi_hal_run_cfg_t *cfg, wifi_hal_result_t *out) |
| The example's whole network journey, hardware-free: init, join, DHCP. | |
Variables | |
| const char | k_wifi_hal_pass_line [] |
| The exact PASS line the run prints; the HIL gate keys on it. | |
| const char | k_wifi_hal_fail_line [] |
| The summary FAIL line the run prints when it did not reach an IP. | |
The example's join+DHCP journey, hardware-free so it is host-testable.
Implements wifi_hal_join_run – the exact orchestration main.c runs on the board, with every hardware, RTOS and console dependency lifted out to the caller. It drives only the ra8_wifi facade and records what happened in an wifi_hal_result_t, so the same logic runs on silicon (bound to the C6 backend and a NetX DHCP provider) and in tests/mocks/src/test_app_wifi_hal_join.c (bound to a mock backend and a canned provider). No printf, no ThreadX, no board.
Definition in file wifi_hal_core.c.
|
nodiscard |
The example's whole network journey, hardware-free: init, join, DHCP.
The wiring this example demonstrates, extracted so it is testable on the host exactly as it runs on the board. It initialises the facade, checks that runtime credentials are non-empty, connects, settles the association, reads the MAC and AP record, and obtains an IP – recording each fact in out and stopping at the first step that fails. It performs no I/O of its own; the caller prints from out.
| [in] | cfg | Injected dependencies; must be non-null with a facade config and handle. |
| [out] | out | Result to populate; must be non-null. |
out->passed). | true | The station associated and DHCP leased an address. |
| false | A step failed; out says how far it got. |
cfg->ssid is NUL-terminated. out is fully populated, including on every failure path. out->ip_bound and out->passed are true.Definition at line 71 of file wifi_hal_core.c.
References wifi_hal_result::ap, wifi_hal_result::associated, wifi_hal_result::connect_err, wifi_hal_result::init_err, wifi_hal_result::init_ok, wifi_hal_result::ip_bound, wifi_hal_result::ip_err, k_ra8_err_not_initialized, k_ra8_ok, wifi_hal_result::lease, wifi_hal_result::mac, wifi_hal_result::passed, wifi_hal_run_cfg::poll_budget, wifi_hal_run_cfg::psk, ra8_wifi_connect(), ra8_wifi_get_ap(), ra8_wifi_get_mac(), ra8_wifi_init(), ra8_wifi_wait_ip(), wifi_hal_run_cfg::ssid, wifi_hal_run_cfg::wifi, wifi_hal_run_cfg::wifi_cfg, and wifi_hal_settle().
Referenced by wifi_hal_run().
|
static |
Poll the Wi-Fi facade until association or budget exhaustion.
A slow association can outlast ra8_wifi_connect's internal wait, so this helper performs the caller-bounded continuation polls and a final status sample after the last poll.
| [in,out] | wifi | Initialized Wi-Fi facade to poll. |
| [in] | budget | Maximum continuation polls. |
| true | A status sample reported association. |
| false | No sample reported association within the budget. |
Definition at line 52 of file wifi_hal_core.c.
References ra8_wifi_status::associated, k_ra8_ok, k_ra8_wifi_link_down, ra8_wifi_poll(), and ra8_wifi_status().
Referenced by wifi_hal_join_run().
| const char k_wifi_hal_fail_line[] |
The summary FAIL line the run prints when it did not reach an IP.
The counterpart to k_wifi_hal_pass_line; specific failures also print a diagnostic sub-line that HIL_EXPECT_NEGATIVE matches.
Definition at line 32 of file wifi_hal_core.c.
Referenced by wifi_hal_worker_entry().
| const char k_wifi_hal_pass_line[] |
The exact PASS line the run prints; the HIL gate keys on it.
Shared by the core (which selects it) and main.c (which prints it), so the string the host test asserts is the string that reaches the console on silicon. hil.conf's HIL_EXPECT is a substring of it.
Definition at line 30 of file wifi_hal_core.c.
Referenced by wifi_hal_worker_entry().