STM32F7 Ethernet interface for nucleo STM32F767
Netsocket
CellularInterface class. More...
Data Structures | |
class | EthInterface |
EthInterface class. More... | |
class | MeshInterface |
MeshInterface class. More... | |
struct | nsapi_addr |
IP address structure for passing IP addresses by value. More... | |
struct | nsapi_wifi_ap |
nsapi_wifi_ap structure More... | |
struct | nsapi_stack |
nsapi_stack structure More... | |
struct | nsapi_ip_mreq |
nsapi_ip_mreq structure More... | |
struct | nsapi_stack_api |
nsapi_stack_api structure More... | |
class | Socket |
Abstract socket class. More... | |
class | TCPSocket |
TCP socket connection. More... | |
class | UDPSocket |
UDP socket. More... | |
Typedefs | |
typedef signed int | nsapi_error_t |
Type used to represent error codes. | |
typedef unsigned int | nsapi_size_t |
Type used to represent the size of data passed through sockets. | |
typedef signed int | nsapi_size_or_error_t |
Type used to represent either a size or error pased through sockets. | |
typedef enum nsapi_security | nsapi_security_t |
Enum of encryption types. | |
typedef struct nsapi_addr | nsapi_addr_t |
IP address structure for passing IP addresses by value. | |
typedef void * | nsapi_socket_t |
Opaque handle for network sockets. | |
typedef struct nsapi_wifi_ap | nsapi_wifi_ap_t |
nsapi_wifi_ap structure | |
typedef struct nsapi_stack | nsapi_stack_t |
nsapi_stack structure | |
typedef struct nsapi_ip_mreq | nsapi_ip_mreq_t |
nsapi_ip_mreq structure | |
typedef struct nsapi_stack_api | nsapi_stack_api_t |
nsapi_stack_api structure | |
Enumerations | |
enum | nsapi_error { NSAPI_ERROR_OK = 0, NSAPI_ERROR_WOULD_BLOCK = -3001, NSAPI_ERROR_UNSUPPORTED = -3002, NSAPI_ERROR_PARAMETER = -3003, NSAPI_ERROR_NO_CONNECTION = -3004, NSAPI_ERROR_NO_SOCKET = -3005, NSAPI_ERROR_NO_ADDRESS = -3006, NSAPI_ERROR_NO_MEMORY = -3007, NSAPI_ERROR_NO_SSID = -3008, NSAPI_ERROR_DNS_FAILURE = -3009, NSAPI_ERROR_DHCP_FAILURE = -3010, NSAPI_ERROR_AUTH_FAILURE = -3011, NSAPI_ERROR_DEVICE_ERROR = -3012, NSAPI_ERROR_IN_PROGRESS = -3013, NSAPI_ERROR_ALREADY = -3014, NSAPI_ERROR_IS_CONNECTED = -3015, NSAPI_ERROR_CONNECTION_LOST = -3016, NSAPI_ERROR_CONNECTION_TIMEOUT = -3017, NSAPI_ERROR_ADDRESS_IN_USE = -3018 } |
Enum of standardized error codes. More... | |
enum | nsapi_security { NSAPI_SECURITY_NONE = 0x0, NSAPI_SECURITY_WEP = 0x1, NSAPI_SECURITY_WPA = 0x2, NSAPI_SECURITY_WPA2 = 0x3, NSAPI_SECURITY_WPA_WPA2 = 0x4, NSAPI_SECURITY_PAP = 0x5, NSAPI_SECURITY_CHAP = 0x6, NSAPI_SECURITY_UNKNOWN = 0xFF } |
Enum of encryption types. More... | |
enum | nsapi_version { NSAPI_UNSPEC, NSAPI_IPv4, NSAPI_IPv6 } |
Enum of IP address versions. More... | |
enum | nsapi_protocol { NSAPI_TCP, NSAPI_UDP } |
Enum of socket protocols. More... | |
enum | nsapi_stack_level { NSAPI_STACK = 5000 } |
Enum of standardized stack option levels for use with NetworkStack::setstackopt and getstackopt. More... | |
enum | nsapi_stack_option { NSAPI_IPV4_MRU, NSAPI_IPV6_MRU } |
Enum of standardized stack option names for level NSAPI_STACK of NetworkStack::setstackopt and getstackopt. More... | |
enum | nsapi_socket_level { NSAPI_SOCKET = 7000 } |
Enum of standardized socket option levels for use with Socket::setsockopt and getsockopt. More... | |
enum | nsapi_socket_option { NSAPI_REUSEADDR, NSAPI_KEEPALIVE, NSAPI_KEEPIDLE, NSAPI_KEEPINTVL, NSAPI_LINGER, NSAPI_SNDBUF, NSAPI_RCVBUF, NSAPI_ADD_MEMBERSHIP, NSAPI_DROP_MEMBERSHIP } |
Enum of standardized socket option names for level NSAPI_SOCKET of Socket::setsockopt and getsockopt. More... | |
enum | nsapi_ip_stack |
Supported IP protocol versions of IP stack. More... | |
Functions | |
nsapi_error_t | nsapi_dns_query (nsapi_stack_t *stack, const char *host, nsapi_addr_t *addr, nsapi_version_t version) |
Query a domain name server for an IP address of a given hostname. | |
nsapi_size_or_error_t | nsapi_dns_query_multiple (nsapi_stack_t *stack, const char *host, nsapi_addr_t *addr, nsapi_size_t addr_count, nsapi_version_t version) |
Query a domain name server for multiple IP address of a given hostname. | |
nsapi_error_t | nsapi_dns_add_server (nsapi_addr_t addr) |
Add a domain name server to list of servers to query. | |
nsapi_error_t | nsapi_dns_query (NetworkStack *stack, const char *host, SocketAddress *addr, nsapi_version_t version=NSAPI_IPv4) |
Query a domain name server for an IP address of a given hostname. | |
template<typename S > | |
nsapi_error_t | nsapi_dns_query (S *stack, const char *host, SocketAddress *addr, nsapi_version_t version=NSAPI_IPv4) |
Query a domain name server for an IP address of a given hostname. | |
nsapi_size_or_error_t | nsapi_dns_query_multiple (NetworkStack *stack, const char *host, SocketAddress *addr, nsapi_size_t addr_count, nsapi_version_t version=NSAPI_IPv4) |
Query a domain name server for multiple IP address of a given hostname. | |
template<typename S > | |
nsapi_size_or_error_t | nsapi_dns_query_multiple (S *stack, const char *host, SocketAddress *addr, nsapi_size_t addr_count, nsapi_version_t version=NSAPI_IPv4) |
Query a domain name server for multiple IP address of a given hostname. | |
static nsapi_error_t | nsapi_dns_add_server (const SocketAddress &address) |
Add a domain name server to list of servers to query. | |
static nsapi_error_t | nsapi_dns_add_server (const char *address) |
Add a domain name server to list of servers to query. |
Detailed Description
CellularInterface class.
WiFiInterface class.
TCP socket server.
SocketAddress class.
NetworkStack class.
NetworkInterface class.
Common interface that is shared between ethernet hardware
Common interface that is shared between network devices
Common interface that is shared between hardware that can connect to a network over IP. By implementing the NetworkStack, a network stack can be used as a target for instantiating network sockets.
Representation of an IP address and port pair.
Common interface that is shared between WiFi devices
Typedef Documentation
typedef struct nsapi_addr nsapi_addr_t |
IP address structure for passing IP addresses by value.
typedef signed int nsapi_error_t |
Type used to represent error codes.
This is a separate type from enum nsapi_error to avoid breaking compatibility in type-sensitive overloads
Definition at line 64 of file nsapi_types.h.
typedef struct nsapi_ip_mreq nsapi_ip_mreq_t |
nsapi_ip_mreq structure
typedef enum nsapi_security nsapi_security_t |
Enum of encryption types.
The security type specifies a particular security to use when connected to a WiFi network
typedef signed int nsapi_size_or_error_t |
Type used to represent either a size or error pased through sockets.
A valid nsapi_size_or_error_t is either a non-negative size or a negative error code from the nsapi_error_t
Definition at line 75 of file nsapi_types.h.
typedef unsigned int nsapi_size_t |
Type used to represent the size of data passed through sockets.
Definition at line 68 of file nsapi_types.h.
typedef void* nsapi_socket_t |
Opaque handle for network sockets.
Definition at line 156 of file nsapi_types.h.
typedef struct nsapi_stack_api nsapi_stack_api_t |
nsapi_stack_api structure
Common api structure for network stack operations. A network stack can provide a nsapi_stack_api structure filled out with the appropriate implementation.
Unsupported operations can be left as null pointers.
typedef struct nsapi_stack nsapi_stack_t |
nsapi_stack structure
Stack structure representing a specific instance of a stack.
typedef struct nsapi_wifi_ap nsapi_wifi_ap_t |
nsapi_wifi_ap structure
Structure representing a WiFi Access Point
Enumeration Type Documentation
enum nsapi_error |
Enum of standardized error codes.
Valid error codes have negative values and may be returned by any network operation.
- Enumerator:
Definition at line 37 of file nsapi_types.h.
enum nsapi_ip_stack |
Supported IP protocol versions of IP stack.
Definition at line 226 of file nsapi_types.h.
enum nsapi_protocol |
Enum of socket protocols.
The socket protocol specifies a particular protocol to be used with a newly created socket.
Definition at line 166 of file nsapi_types.h.
enum nsapi_security |
Enum of encryption types.
The security type specifies a particular security to use when connected to a WiFi network
- Enumerator:
Definition at line 82 of file nsapi_types.h.
enum nsapi_socket_level |
Enum of standardized socket option levels for use with Socket::setsockopt and getsockopt.
- Enumerator:
NSAPI_SOCKET Socket option level - see nsapi_socket_option_t for options
Definition at line 198 of file nsapi_types.h.
enum nsapi_socket_option |
Enum of standardized socket option names for level NSAPI_SOCKET of Socket::setsockopt and getsockopt.
These options may not be supported on all stacks, in which case NSAPI_ERROR_UNSUPPORTED may be returned.
- Enumerator:
Definition at line 210 of file nsapi_types.h.
enum nsapi_stack_level |
Enum of standardized stack option levels for use with NetworkStack::setstackopt and getstackopt.
Definition at line 176 of file nsapi_types.h.
enum nsapi_stack_option |
Enum of standardized stack option names for level NSAPI_STACK of NetworkStack::setstackopt and getstackopt.
These options may not be supported on all stacks, in which case NSAPI_ERROR_UNSUPPORTED may be returned.
- Enumerator:
NSAPI_IPV4_MRU Sets/gets size of largest IPv4 fragmented datagram to reassemble
NSAPI_IPV6_MRU Sets/gets size of largest IPv6 fragmented datagram to reassemble
Definition at line 188 of file nsapi_types.h.
enum nsapi_version |
Enum of IP address versions.
The IP version specifies the type of an IP address.
- Enumerator:
NSAPI_UNSPEC Address is unspecified
NSAPI_IPv4 Address is IPv4
NSAPI_IPv6 Address is IPv6
Definition at line 131 of file nsapi_types.h.
Function Documentation
nsapi_error_t nsapi_dns_add_server | ( | nsapi_addr_t | addr ) |
Add a domain name server to list of servers to query.
- Parameters:
-
addr Destination for the host address
- Returns:
- 0 on success, negative error code on failure
Definition at line 44 of file nsapi_dns.cpp.
static nsapi_error_t nsapi_dns_add_server | ( | const SocketAddress & | address ) | [static] |
Add a domain name server to list of servers to query.
- Parameters:
-
addr Destination for the host address
- Returns:
- 0 on success, negative error code on failure
Definition at line 163 of file nsapi_dns.h.
static nsapi_error_t nsapi_dns_add_server | ( | const char * | address ) | [static] |
Add a domain name server to list of servers to query.
- Parameters:
-
addr Destination for the host address
- Returns:
- 0 on success, negative error code on failure
Definition at line 173 of file nsapi_dns.h.
nsapi_error_t nsapi_dns_query | ( | NetworkStack * | stack, |
const char * | host, | ||
SocketAddress * | addr, | ||
nsapi_version_t | version = NSAPI_IPv4 |
||
) |
Query a domain name server for an IP address of a given hostname.
- Parameters:
-
stack Network stack as target for DNS query host Hostname to resolve addr Destination for the host address version IP version to resolve (defaults to NSAPI_IPv4)
- Returns:
- 0 on success, negative error code on failure NSAPI_ERROR_DNS_FAILURE indicates the host could not be found
Definition at line 299 of file nsapi_dns.cpp.
nsapi_error_t nsapi_dns_query | ( | S * | stack, |
const char * | host, | ||
SocketAddress * | addr, | ||
nsapi_version_t | version = NSAPI_IPv4 |
||
) |
Query a domain name server for an IP address of a given hostname.
- Parameters:
-
stack Network stack as target for DNS query host Hostname to resolve addr Destination for the host address version IP version to resolve (defaults to NSAPI_IPv4)
- Returns:
- 0 on success, negative error code on failure NSAPI_ERROR_DNS_FAILURE indicates the host could not be found
Definition at line 101 of file nsapi_dns.h.
nsapi_error_t nsapi_dns_query | ( | nsapi_stack_t * | stack, |
const char * | host, | ||
nsapi_addr_t * | addr, | ||
nsapi_version_t | version | ||
) |
Query a domain name server for an IP address of a given hostname.
- Parameters:
-
stack Network stack as target for DNS query host Hostname to resolve addr Destination for the host address version IP version to resolve
- Returns:
- 0 on success, negative error code on failure NSAPI_ERROR_DNS_FAILURE indicates the host could not be found
- Parameters:
-
stack Network stack as target for DNS query host Hostname to resolve addr Destination for the host address version IP version to resolve (defaults to NSAPI_IPv4)
- Returns:
- 0 on success, negative error code on failure NSAPI_ERROR_DNS_FAILURE indicates the host could not be found
Definition at line 291 of file nsapi_dns.cpp.
nsapi_size_or_error_t nsapi_dns_query_multiple | ( | nsapi_stack_t * | stack, |
const char * | host, | ||
nsapi_addr_t * | addr, | ||
nsapi_size_t | addr_count, | ||
nsapi_version_t | version | ||
) |
Query a domain name server for multiple IP address of a given hostname.
- Parameters:
-
stack Network stack as target for DNS query host Hostname to resolve addr Array for the host addresses addr_count Number of addresses allocated in the array version IP version to resolve
- Returns:
- Number of addresses found on success, negative error code on failure NSAPI_ERROR_DNS_FAILURE indicates the host could not be found
- Parameters:
-
stack Network stack as target for DNS query host Hostname to resolve addr Array for the host addresses addr_count Number of addresses allocated in the array version IP version to resolve (defaults to NSAPI_IPv4)
- Returns:
- Number of addresses found on success, negative error code on failure NSAPI_ERROR_DNS_FAILURE indicates the host could not be found
Definition at line 268 of file nsapi_dns.cpp.
nsapi_size_or_error_t nsapi_dns_query_multiple | ( | S * | stack, |
const char * | host, | ||
SocketAddress * | addr, | ||
nsapi_size_t | addr_count, | ||
nsapi_version_t | version = NSAPI_IPv4 |
||
) |
Query a domain name server for multiple IP address of a given hostname.
- Parameters:
-
stack Network stack as target for DNS query host Hostname to resolve addr Array for the host addresses addr_count Number of addresses allocated in the array version IP version to resolve (defaults to NSAPI_IPv4)
- Returns:
- Number of addresses found on success, negative error code on failure NSAPI_ERROR_DNS_FAILURE indicates the host could not be found
Definition at line 144 of file nsapi_dns.h.
nsapi_size_or_error_t nsapi_dns_query_multiple | ( | NetworkStack * | stack, |
const char * | host, | ||
SocketAddress * | addr, | ||
nsapi_size_t | addr_count, | ||
nsapi_version_t | version = NSAPI_IPv4 |
||
) |
Query a domain name server for multiple IP address of a given hostname.
- Parameters:
-
stack Network stack as target for DNS query host Hostname to resolve addr Array for the host addresses addr_count Number of addresses allocated in the array version IP version to resolve (defaults to NSAPI_IPv4)
- Returns:
- Number of addresses found on success, negative error code on failure NSAPI_ERROR_DNS_FAILURE indicates the host could not be found
Definition at line 275 of file nsapi_dns.cpp.
Generated on Tue Jul 12 2022 14:49:41 by 1.7.2