Port Functions¶
-
group
group_lwip_whd_port_functions
Typedefs
-
typedef void (*
cy_network_activity_event_callback_t
)(bool callback_arg)¶ Network activity callback function prototype Callback function which can be registered/unregistered for any network activity needs to be of this prototype.
-
typedef void (*
cy_lwip_ip_change_callback_t
)(void *data)¶ IP change callback function prototype Callback function which can be registered to receive IP changes needs to be of this prototype.
Functions
-
cy_rslt_t
cy_lwip_add_interface
(cy_lwip_nw_interface_t *iface, ip_static_addr_t *ipaddr)¶ Adds a network interface to LwIP and brings it up, a network interface contains a WHD Wi-Fi Interface and role such as STA, AP.
This is the entry point in this file. This function takes network interface adds to LwIP, configures the optional static IP address and registers to IP change callback.
note
static IP address is mandatory for AP interface.
- Parameters
iface – [in] Network interface to be added.
ipaddr – [in] IPv4/IPv6 address information associated with the interface.
- Returns
CY_RESULT_SUCCESS for successful addition to LwIP or error otherwise.
-
cy_rslt_t
cy_lwip_remove_interface
(cy_lwip_nw_interface_t *iface)¶ Removes a network interface from LwIP.
- Parameters
iface – [in] Network interface to be removed.
- Returns
CY_RSLT_SUCCESS if successful, failure code otherwise.
-
struct netif *
cy_lwip_get_interface
(cy_lwip_nw_interface_role_t role)¶ Return the LwIP network interface for the given network interface role.
- Parameters
role – [in] Interface role.
- Returns
netif structure of the WHD interface, null if the interface type passed is invalid.
-
cy_rslt_t
cy_lwip_network_up
(cy_lwip_nw_interface_t *iface)¶ This function brings up the network link layer and and starts DHCP if required.
- Parameters
iface – [in] Network interface to be brought up.
- Returns
CY_RSLT_SUCCESS on successful network bring up, failure code otherwise.
-
cy_rslt_t
cy_lwip_network_down
(cy_lwip_nw_interface_t *iface)¶ This function brings down the network interface, brings down the network link layer and stops DHCP.
- Parameters
iface – [in] LwIP Interface.
- Returns
CY_RSLT_SUCCESS on successful tear down of the network, failure code otherwise.
-
void
cy_network_process_ethernet_data
(whd_interface_t iface, whd_buffer_t buf) This function takes packets from the radio driver and passes them into the lwIP stack.
If the stack is not initialized, or if the LwIP stack does not accept the packet, the packet is freed (dropped). This function will be registered as part of the whd_netif_funcs defined in whd.h of the Wi-Fi Host Driver.
- Parameters
iface – [in] WiFi interface.
buf – [in] Packet received from the radio driver.
-
void
cy_network_activity_register_cb
(cy_network_activity_event_callback_t cb)¶ This function helps to register/unregister callback fn for any TX/RX packets.
Passing “NULL” as cb will deregister the activity callback
- Parameters
cb – [in] Network activity callback function
-
cy_rslt_t
cy_network_activity_notify
(cy_network_activity_type_t activity_type)¶ This function notifies network activity to Low Power Assistant(LPA) module.
- Parameters
activity_type – [in] Network activity type cy_network_activity_type_t to be notified to Low Power Assistant(LPA) module.
- Returns
CY_RSLT_SUCCESS if successful, failure code otherwise.
-
void
cy_lwip_register_ip_change_cb
(cy_lwip_ip_change_callback_t cb)¶ This function helps to register/unregister for any IP changes from LwIP.
Passing “NULL” as callback will deregister the IP changes callback
- Parameters
cb – [in] IP change callback function
-
typedef void (*