|
Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
#include <logging/log.h>#include <zephyr.h>#include <kernel.h>#include <debug/stack.h>#include <device.h>#include <string.h>#include <errno.h>#include <net/net_pkt.h>#include <net/net_if.h>#include <net/net_l2.h>#include <net/net_context.h>#include <net/net_offload.h>#include <net/wifi_mgmt.h>#include <sys/printk.h>#include <driver/include/m2m_wifi.h>#include <socket/include/m2m_socket_host_if.h>Data Structures | |
| struct | tstrSocketBindMsg |
| struct | tstrSocketListenMsg |
| struct | tstrSocketAcceptMsg |
| struct | tstrSocketConnectMsg |
| struct | tstrSocketRecvMsg |
| struct | socket_data |
| struct | winc1500_data |
Macros | |
| #define | LOG_MODULE_NAME wifi_winc1500 |
| #define | LOG_LEVEL CONFIG_WIFI_LOG_LEVEL |
| #define | HOSTNAME_MAX_SIZE (64) |
| #define | WINC1500_BIND_TIMEOUT K_MSEC(500) |
| #define | WINC1500_LISTEN_TIMEOUT K_MSEC(500) |
| #define | WINC1500_BUF_TIMEOUT K_MSEC(100) |
Typedefs | |
| typedef void(* | tpfAppSocketCb) (SOCKET sock, uint8 u8Msg, void *pvMsg) |
| typedef void(* | tpfAppResolveCb) (uint8 *pu8DomainName, uint32 u32ServerIP) |
Enumerations | |
| enum | socket_errors { SOCK_ERR_NO_ERROR = 0 , SOCK_ERR_INVALID_ADDRESS = -1 , SOCK_ERR_ADDR_ALREADY_IN_USE = -2 , SOCK_ERR_MAX_TCP_SOCK = -3 , SOCK_ERR_MAX_UDP_SOCK = -4 , SOCK_ERR_INVALID_ARG = -6 , SOCK_ERR_MAX_LISTEN_SOCK = -7 , SOCK_ERR_INVALID = -9 , SOCK_ERR_ADDR_IS_REQUIRED = -11 , SOCK_ERR_CONN_ABORTED = -12 , SOCK_ERR_TIMEOUT = -13 , SOCK_ERR_BUFFER_FULL = -14 } |
| enum | socket_messages { SOCKET_MSG_BIND = 1 , SOCKET_MSG_LISTEN , SOCKET_MSG_DNS_RESOLVE , SOCKET_MSG_ACCEPT , SOCKET_MSG_CONNECT , SOCKET_MSG_RECV , SOCKET_MSG_SEND , SOCKET_MSG_SENDTO , SOCKET_MSG_RECVFROM } |
Functions | |
| LOG_MODULE_REGISTER (wifi_winc1500) | |
| NMI_API void | socketInit (void) |
| NMI_API void | registerSocketCallback (tpfAppSocketCb socket_cb, tpfAppResolveCb resolve_cb) |
| NMI_API SOCKET | socket (uint16 u16Domain, uint8 u8Type, uint8 u8Flags) |
| NMI_API sint8 | bind (SOCKET sock, struct sockaddr *pstrAddr, uint8 u8AddrLen) |
| NMI_API sint8 | listen (SOCKET sock, uint8 backlog) |
| NMI_API sint8 | accept (SOCKET sock, struct sockaddr *addr, uint8 *addrlen) |
| NMI_API sint8 | connect (SOCKET sock, struct sockaddr *pstrAddr, uint8 u8AddrLen) |
| NMI_API sint16 | recv (SOCKET sock, void *pvRecvBuf, uint16 u16BufLen, uint32 u32Timeoutmsec) |
| NMI_API sint16 | send (SOCKET sock, void *pvSendBuffer, uint16 u16SendLength, uint16 u16Flags) |
| NMI_API sint16 | sendto (SOCKET sock, void *pvSendBuffer, uint16 u16SendLength, uint16 flags, struct sockaddr *pstrDestAddr, uint8 u8AddrLen) |
| NMI_API sint8 | close (SOCKET sock) |
| NET_BUF_POOL_DEFINE (winc1500_tx_pool, CONFIG_WIFI_WINC1500_BUF_CTR, CONFIG_WIFI_WINC1500_MAX_PACKET_SIZE, 0, NULL) | |
| NET_BUF_POOL_DEFINE (winc1500_rx_pool, CONFIG_WIFI_WINC1500_BUF_CTR, CONFIG_WIFI_WINC1500_MAX_PACKET_SIZE, 0, NULL) | |
| K_KERNEL_STACK_MEMBER (winc1500_stack, CONFIG_WIFI_WINC1500_THREAD_STACK_SIZE) | |
| static int | winc1500_get (sa_family_t family, enum net_sock_type type, enum net_ip_protocol ip_proto, struct net_context **context) |
| static int | winc1500_bind (struct net_context *context, const struct sockaddr *addr, socklen_t addrlen) |
| static int | winc1500_listen (struct net_context *context, int backlog) |
| static int | winc1500_connect (struct net_context *context, const struct sockaddr *addr, socklen_t addrlen, net_context_connect_cb_t cb, int32_t timeout, void *user_data) |
| static int | winc1500_accept (struct net_context *context, net_tcp_accept_cb_t cb, int32_t timeout, void *user_data) |
| static int | winc1500_send (struct net_pkt *pkt, net_context_send_cb_t cb, int32_t timeout, void *user_data) |
| static int | winc1500_sendto (struct net_pkt *pkt, const struct sockaddr *dst_addr, socklen_t addrlen, net_context_send_cb_t cb, int32_t timeout, void *user_data) |
| static int | prepare_pkt (struct socket_data *sock_data) |
| static int | winc1500_recv (struct net_context *context, net_context_recv_cb_t cb, int32_t timeout, void *user_data) |
| static int | winc1500_put (struct net_context *context) |
| static void | handle_wifi_con_state_changed (void *pvMsg) |
| static void | handle_wifi_dhcp_conf (void *pvMsg) |
| static void | reset_scan_data (void) |
| static void | handle_scan_result (void *pvMsg) |
| static void | handle_scan_done (void *pvMsg) |
| static void | winc1500_wifi_cb (uint8_t message_type, void *pvMsg) |
| static void | handle_socket_msg_connect (struct socket_data *sd, void *pvMsg) |
| static bool | handle_socket_msg_recv (SOCKET sock, struct socket_data *sd, void *pvMsg) |
| static void | handle_socket_msg_bind (struct socket_data *sd, void *pvMsg) |
| static void | handle_socket_msg_listen (struct socket_data *sd, void *pvMsg) |
| static void | handle_socket_msg_accept (struct socket_data *sd, void *pvMsg) |
| static void | winc1500_socket_cb (SOCKET sock, uint8 message, void *pvMsg) |
| static void | winc1500_thread (void) |
| static int | winc1500_mgmt_scan (const struct device *dev, scan_result_cb_t cb) |
| static int | winc1500_mgmt_connect (const struct device *dev, struct wifi_connect_req_params *params) |
| static int | winc1500_mgmt_disconnect (const struct device *dev) |
| static int | winc1500_mgmt_ap_enable (const struct device *dev, struct wifi_connect_req_params *params) |
| static int | winc1500_mgmt_ap_disable (const struct device *dev) |
| static void | winc1500_iface_init (struct net_if *iface) |
| static int | winc1500_init (const struct device *dev) |
| NET_DEVICE_OFFLOAD_INIT (winc1500, CONFIG_WIFI_WINC1500_NAME, winc1500_init, NULL, &w1500_data, NULL, CONFIG_WIFI_INIT_PRIORITY, &winc1500_api, CONFIG_WIFI_WINC1500_MAX_PACKET_SIZE) | |
Variables | |
| struct k_thread | winc1500_thread_data |
| static struct winc1500_data | w1500_data |
| static struct net_offload | winc1500_offload |
| static const struct net_wifi_mgmt_offload | winc1500_api |
| #define HOSTNAME_MAX_SIZE (64) |
| #define LOG_LEVEL CONFIG_WIFI_LOG_LEVEL |
| #define LOG_MODULE_NAME wifi_winc1500 |
Copyright (c) 2017 IpTronix
SPDX-License-Identifier: Apache-2.0
| #define WINC1500_BIND_TIMEOUT K_MSEC(500) |
| #define WINC1500_BUF_TIMEOUT K_MSEC(100) |
| #define WINC1500_LISTEN_TIMEOUT K_MSEC(500) |
| typedef void(* tpfAppResolveCb) (uint8 *pu8DomainName, uint32 u32ServerIP) |
| enum socket_errors |
| enum socket_messages |
| NMI_API sint8 accept | ( | SOCKET | sock, |
| struct sockaddr * | addr, | ||
| uint8 * | addrlen | ||
| ) |
| NMI_API sint8 bind | ( | SOCKET | sock, |
| struct sockaddr * | pstrAddr, | ||
| uint8 | u8AddrLen | ||
| ) |
| NMI_API sint8 close | ( | SOCKET | sock | ) |
| NMI_API sint8 connect | ( | SOCKET | sock, |
| struct sockaddr * | pstrAddr, | ||
| uint8 | u8AddrLen | ||
| ) |
|
static |
The iface is reset when getting a new context.
Setup remote
|
static |
|
static |
|
static |
|
static |
| K_KERNEL_STACK_MEMBER | ( | winc1500_stack | , |
| CONFIG_WIFI_WINC1500_THREAD_STACK_SIZE | |||
| ) |
| NMI_API sint8 listen | ( | SOCKET | sock, |
| uint8 | backlog | ||
| ) |
| LOG_MODULE_REGISTER | ( | wifi_winc1500 | ) |
| NET_BUF_POOL_DEFINE | ( | winc1500_rx_pool | , |
| CONFIG_WIFI_WINC1500_BUF_CTR | , | ||
| CONFIG_WIFI_WINC1500_MAX_PACKET_SIZE | , | ||
| 0 | , | ||
| NULL | |||
| ) |
| NET_BUF_POOL_DEFINE | ( | winc1500_tx_pool | , |
| CONFIG_WIFI_WINC1500_BUF_CTR | , | ||
| CONFIG_WIFI_WINC1500_MAX_PACKET_SIZE | , | ||
| 0 | , | ||
| NULL | |||
| ) |
| NET_DEVICE_OFFLOAD_INIT | ( | winc1500 | , |
| CONFIG_WIFI_WINC1500_NAME | , | ||
| winc1500_init | , | ||
| NULL | , | ||
| & | w1500_data, | ||
| NULL | , | ||
| CONFIG_WIFI_INIT_PRIORITY | , | ||
| & | winc1500_api, | ||
| CONFIG_WIFI_WINC1500_MAX_PACKET_SIZE | |||
| ) |
|
static |
| NMI_API sint16 recv | ( | SOCKET | sock, |
| void * | pvRecvBuf, | ||
| uint16 | u16BufLen, | ||
| uint32 | u32Timeoutmsec | ||
| ) |
| NMI_API void registerSocketCallback | ( | tpfAppSocketCb | socket_cb, |
| tpfAppResolveCb | resolve_cb | ||
| ) |
| NMI_API sint16 send | ( | SOCKET | sock, |
| void * | pvSendBuffer, | ||
| uint16 | u16SendLength, | ||
| uint16 | u16Flags | ||
| ) |
| NMI_API sint16 sendto | ( | SOCKET | sock, |
| void * | pvSendBuffer, | ||
| uint16 | u16SendLength, | ||
| uint16 | flags, | ||
| struct sockaddr * | pstrDestAddr, | ||
| uint8 | u8AddrLen | ||
| ) |
| NMI_API SOCKET socket | ( | uint16 | u16Domain, |
| uint8 | u8Type, | ||
| uint8 | u8Flags | ||
| ) |
|
static |
This function is called when user wants to accept a connection being established.
|
static |
This function is called when user wants to bind to local IP address.
|
static |
This function is called when user wants to create a connection to a peer host.
|
static |
This function is called when the socket is to be opened.
|
static |
|
static |
This function is called when user wants to mark the socket to be a listening one.
|
static |
|
static |
security is hardcoded as open for now
DHCP: 192.168.1.1
|
static |
|
static |
|
static |
|
static |
This function is called when user wants to close the socket.
|
static |
This function is called when user wants to receive data from peer host.
|
static |
This function is called when user wants to send data to peer host.
|
static |
This function is called when user wants to send data to peer host.
|
static |
|
static |
|
static |
| struct k_thread winc1500_thread_data |