Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Group_nwhelper_func
This is a collection of network helper functions which would be used by various Cypress Middleware libraries. More...
Functions | |
void | cy_nw_ip_initialize_status_change_callback (cy_nw_ip_status_change_callback_t *info, cy_nw_ip_status_change_callback_func_t *cbf, void *arg) |
Initialize status change callback. | |
bool | cy_nw_ip_get_ipv4_address (cy_nw_ip_interface_t iface, cy_nw_ip_address_t *addr) |
Retrieves the IPv4 address for an interface. | |
int | cy_nw_str_to_ipv4 (const char *ip_str, cy_nw_ip_address_t *address) |
Convert IPv4 string to an IP address structure. | |
void | cy_nw_ip_register_status_change_callback (cy_nw_ip_interface_t iface, cy_nw_ip_status_change_callback_t *info) |
Registers for callback function to be invoked during IP status change. | |
void | cy_nw_ip_unregister_status_change_callback (cy_nw_ip_interface_t iface, cy_nw_ip_status_change_callback_t *info) |
Un-registers IP status change callback. | |
int | cy_nw_host_arp_cache_clear (cy_nw_ip_interface_t iface) |
Clears the ARP cache for the interface NOTE: in LwIP, we need the netif (NetworkInterface) to do things, we can find using wifi interface. | |
int | cy_nw_host_arp_cache_get_list (cy_nw_ip_interface_t iface, cy_nw_arp_cache_entry_t *list, uint32_t count, uint32_t *filled) |
Gets the ARP cache list for the interface. | |
int | cy_nw_host_send_arp_request (cy_nw_ip_interface_t iface, const char *ip_string) |
Send ARP request NOTE: in LwIP, we need the netif (NetworkInterface) to do things, we can find using wifi interface. | |
uint32_t | cy_nw_get_time (void) |
GET time in milliseconds. | |
bool | cy_nw_aton (const char *char_ptr, cy_nw_ip_address_t *addr) |
GET IPv4 address in decimal notation. | |
bool | cy_nw_aton_ipv6 (const char *char_ptr, cy_nw_ip_address_t *addr) |
GET IPv6 address in decimal notation. | |
bool | cy_nw_ntoa (cy_nw_ip_address_t *addr, char *ip_str) |
GET IPv4 address in string format. | |
bool | cy_nw_ntoa_ipv6 (cy_nw_ip_address_t *addr, char *ip_str) |
GET IPv6 address in string format. |
Detailed Description
This is a collection of network helper functions which would be used by various Cypress Middleware libraries.
Function Documentation
bool cy_nw_aton | ( | const char * | char_ptr, |
cy_nw_ip_address_t * | addr | ||
) |
GET IPv4 address in decimal notation.
NOTE: dotted-decimal notation example (192.168.0.1)
- Parameters:
-
[in] char_ptr : Pointer to the string containing the IPv4 address in dotted-decimal format. [out] addr : Pointer to the structure containing IPv4 address in decimal format.
- Returns:
- 0 : success 1 : failed
Definition at line 56 of file cy_nw_helper_common.c.
bool cy_nw_aton_ipv6 | ( | const char * | char_ptr, |
cy_nw_ip_address_t * | addr | ||
) |
GET IPv6 address in decimal notation.
NOTE: This API does not support shorthand representation of IPv6 address. Input string should be of the format X:X:X:X:X:X:X:X.
- Parameters:
-
[in] char_ptr : Pointer to the string containing the IPv6 address. [out] addr : Pointer to the structure containing IPv6 address in decimal format.
- Returns:
- 0 : success 1 : failed
Definition at line 138 of file cy_nw_helper_common.c.
uint32_t cy_nw_get_time | ( | void | ) |
GET time in milliseconds.
- Returns:
- time in milliseconds
Definition at line 183 of file COMPONENT_AFR/cy_nw_helper.c.
int cy_nw_host_arp_cache_clear | ( | cy_nw_ip_interface_t | iface ) |
Clears the ARP cache for the interface NOTE: in LwIP, we need the netif (NetworkInterface) to do things, we can find using wifi interface.
- Parameters:
-
[in] iface : Pointer to network interface object
- Returns:
- 0 : success 1 : fail
Definition at line 116 of file COMPONENT_AFR/cy_nw_helper.c.
int cy_nw_host_arp_cache_get_list | ( | cy_nw_ip_interface_t | iface, |
cy_nw_arp_cache_entry_t * | list, | ||
uint32_t | count, | ||
uint32_t * | filled | ||
) |
Gets the ARP cache list for the interface.
- Parameters:
-
[in] iface : Pointer to network interface object [in,out] list : Pointer to cy_nw_arp_cache_entry_t array [in] count : Number of entries in the array passed in `list` [in,out] filled : Pointer to get the number of entries filled in the array pointed by 'list'
- Returns:
- 0 : success 1 : fail
Definition at line 128 of file COMPONENT_AFR/cy_nw_helper.c.
int cy_nw_host_send_arp_request | ( | cy_nw_ip_interface_t | iface, |
const char * | ip_string | ||
) |
Send ARP request NOTE: in LwIP, we need the netif (NetworkInterface) to do things, we can find using wifi interface.
- Parameters:
-
[in] iface : Pointer to network interface object [in] ip_string : Pointer to the IPv4 address string (Ex: "192.168.1.1") to which the ARP request to be sent
- Returns:
- 0 : success 1 : failed to send ARP request
Definition at line 167 of file COMPONENT_AFR/cy_nw_helper.c.
bool cy_nw_ip_get_ipv4_address | ( | cy_nw_ip_interface_t | iface, |
cy_nw_ip_address_t * | addr | ||
) |
Retrieves the IPv4 address for an interface.
Retrieves the IPv4 address for an interface (AP or STA) if it exists.
- Parameters:
-
[in] iface : Pointer to network interface object [out] addr : Pointer to the IP information sturcture in which the results to be stored
- Returns:
- true : if IP address is present
- false : otherwise
Definition at line 64 of file COMPONENT_AFR/cy_nw_helper.c.
void cy_nw_ip_initialize_status_change_callback | ( | cy_nw_ip_status_change_callback_t * | info, |
cy_nw_ip_status_change_callback_func_t * | cbf, | ||
void * | arg | ||
) |
Initialize status change callback.
Initialize cy_nw_ip_status_change_callback_t instead of directly manipulating the callback struct.
- Parameters:
-
[in,out] info : Pointer to network IP status change callback information structure which would be filled upon return [in] cbf : Pointer to callback function to be invoked during network status change [in] arg : User data object to be sent sent in the callback function
- Returns:
- none
Definition at line 57 of file COMPONENT_AFR/cy_nw_helper.c.
void cy_nw_ip_register_status_change_callback | ( | cy_nw_ip_interface_t | iface, |
cy_nw_ip_status_change_callback_t * | info | ||
) |
Registers for callback function to be invoked during IP status change.
- Parameters:
-
[in] iface : Pointer to network interface object [in] info : Pointer to the status change information structure
- Returns:
- none
Definition at line 102 of file COMPONENT_AFR/cy_nw_helper.c.
void cy_nw_ip_unregister_status_change_callback | ( | cy_nw_ip_interface_t | iface, |
cy_nw_ip_status_change_callback_t * | info | ||
) |
Un-registers IP status change callback.
- Parameters:
-
[in] iface : Pointer to network interface object [in] info : Pointer to the status change information structure
- Returns:
- none
Definition at line 109 of file COMPONENT_AFR/cy_nw_helper.c.
bool cy_nw_ntoa | ( | cy_nw_ip_address_t * | addr, |
char * | ip_str | ||
) |
GET IPv4 address in string format.
- Parameters:
-
[in] addr : Pointer to IPv4 address structure containing the IPv4 address. [out] ip_str : Pointer to the string containing IPv4 address in dotted-decimal notation. ip_str must be 16 bytes long.
- Returns:
- 0 : success 1 : failed
Definition at line 203 of file cy_nw_helper_common.c.
bool cy_nw_ntoa_ipv6 | ( | cy_nw_ip_address_t * | addr, |
char * | ip_str | ||
) |
GET IPv6 address in string format.
- Parameters:
-
[in] addr : Pointer to IPv6 address structure containing the IPv6 address. [out] ip_str : Pointer to the string containing IPv6 address. ip_str must 39 bytes long.
- Returns:
- 0 : success 1 : failed
Definition at line 223 of file cy_nw_helper_common.c.
int cy_nw_str_to_ipv4 | ( | const char * | ip_str, |
cy_nw_ip_address_t * | address | ||
) |
Convert IPv4 string to an IP address structure.
- Parameters:
-
[in] ip_str : IPv4 address string. [out] address : Pointer to the IP info structure in which the IPv4 address to be stored
- Returns:
- 0 : if successful
- -1 : if failed
Definition at line 85 of file COMPONENT_AFR/cy_nw_helper.c.
Generated on Thu Jul 14 2022 12:58:44 by
