This is a collection of network helper functions which would be used by various Cypress Middleware libraries.
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. | |
| 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.
| [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 |
This function does not return a value.
| 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.
| [in] | iface | : Pointer to network interface object |
| [out] | addr | : Pointer to the IP information sturcture in which the results to be stored |
| int cy_nw_str_to_ipv4 | ( | const char * | ip_str, |
| cy_nw_ip_address_t * | address | ||
| ) |
Convert IPv4 string to an IP address structure.
| [in] | ip_str | : IPv4 address string. |
| [out] | address | : Pointer to the IP info structure in which the IPv4 address to be stored |
| 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.
| [in] | iface | : Pointer to network interface object |
| [in] | info | : Pointer to the status change information structure |
This function does not return a value.
| 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.
| [in] | iface | : Pointer to network interface object |
| [in] | info | : Pointer to the status change information structure |
This function does not return a value.
| 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.
| [in] | iface | : Pointer to network interface object |
| 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.
| [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' |
| 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.
| [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 |
| 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.
NOTE: dotted-decimal notation example (192.168.0.1)
| [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. |
| 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.
| [in] | char_ptr | : Pointer to the string containing the IPv6 address. |
| [out] | addr | : Pointer to the structure containing IPv6 address in decimal format. |
| bool cy_nw_ntoa | ( | cy_nw_ip_address_t * | addr, |
| char * | ip_str | ||
| ) |
GET IPv4 address in string format.
| [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. |
| bool cy_nw_ntoa_ipv6 | ( | cy_nw_ip_address_t * | addr, |
| char * | ip_str | ||
| ) |
GET IPv6 address in string format.
| [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. |