The NetX Duo DHCP provider the ra8_wifi facade calls for an address.
- Tag
- [Ring 6 / APP] {World: S}
Implements wifi_hal_ip_bind, the ra8_wifi_ip_bind_fn. Once ra8_wifi reports the station associated, the facade calls this to turn the L2 link into an IP address: it binds nx_ether_driver_c6 to the open C6 link, creates the NetX Duo packet pool and IP instance, enables ARP / UDP / ICMP, and runs the vendored DHCP client to a bound lease. The whole IP stack runs on the RA8; the C6 is a pure L2 bridge.
This is the one piece the facade cannot own without dragging NetX Duo into every consumer, so it lives with the application by design. The heavy NetX objects are file-scope statics because this image has no heap (NASA Rule 3).
- Copyright
- Copyright (c) 2026 Brighton Sikarskie SPDX-License-Identifier: MIT
- Since
- 0.1.0
Definition in file wifi_hal_ip.c.
The application's IP provider: a NetX Duo DHCP client to a lease.
The ra8_wifi_ip_bind_fn ra8_wifi_wait_ip calls. It binds the wireless NetX link driver to the open C6 link, creates the packet pool and IP instance, runs the vendored DHCP client to a bound lease, and copies the lease out. From here NetX Duo owns the wire.
- Parameters
-
| [in] | ip_ctx | The open ra8_c6link_t* this application passed as ra8_wifi_cfg::ip_ctx; must be non-null. |
| [in] | mac | The station MAC the IP stack must adopt; must be non-null. |
| [out] | out | Lease to fill; must be non-null. |
- Returns
- ra8_err_t Error code.
- Return values
-
- Precondition
- The station is associated (ra8_wifi_connect has succeeded).
-
ip_ctx is the same open link the facade drives.
- Postcondition
- On success
out->bound is implied by a non-zero out->ip.
-
On failure
out is cleared.
- Note
- Runs once, on the worker thread, inside ra8_wifi_wait_ip.
- Warning
- Blocks up to k_wifi_hal_dhcp_wait_ms waiting for the lease.
- Example:
static ra8_c6link_t s_link
ra8_err_t wifi_hal_ip_bind(void *ip_ctx, const ra8_wifi_mac_t *mac, ra8_wifi_lease_t *out)
The application's IP provider: a NetX Duo DHCP client to a lease.
- See also
- ra8_wifi_wait_ip
- Since
- 0.1.0
Definition at line 147 of file wifi_hal_ip.c.
References ra8_wifi_lease::bound, ra8_wifi_lease::ip, k_ra8_err_not_initialized, k_ra8_err_null_ptr, k_ra8_err_timeout, k_ra8_ok, nx_ether_driver_c6_bind(), nx_ether_driver_c6_set_mac(), ra8_wifi_mac::octet, priv_net_create_ip(), and priv_net_dhcp().
Referenced by wifi_hal_make_cfg().