oWL Pico API More...
#include <stdint.h>
#include "wlp_proto.h"
Go to the source code of this file.
Data Structures | |
struct | wlp_network_t |
Defines | |
#define | WLP_FAILURE -1 |
#define | WLP_ERR_PARAM -2 |
#define | WLP_ERR_MEM -3 |
#define | WLP_ERR_CONN -4 |
#define | WLP_ERR_STATE -5 |
#define | WLP_ERR_PARSE -6 |
#define | WLP_ERR_PATH -7 |
#define | WLP_ERR_TYPE -8 |
#define | WLP_ERR_PERM -9 |
#define | WLP_ERR_NOTSUPP -10 |
#define | WLP_ERR_RANGE -11 |
#define | WLP_ERR_SIZE -12 |
#define | WLP_ERR_AGAIN -13 |
#define | WLP_ERR_BUSY -14 |
#define | WLP_ERR_DISABLED -15 |
#define | WLP_ERR_PROTO -16 |
#define | WLP_ERR_TIMEOUT -17 |
#define | WLP_ERR_IGNORED -18 |
#define | WLP_ERR_CANCEL -19 |
#define | WLP_ERR_SYNC -20 |
#define | WLP_ERR_ABORT -21 |
#define | WLP_ERR_INUSE -22 |
#define | WLP_INVALID_SOCKET_ID 0 |
#define | WLP_VERSION_CODE WLP_VERSION(1,2,2) |
Functions | |
int | wlp_init (int(*readf)(void *ctx, void *data, int len), int(*writef)(void *ctx, const void *data, int len), void *ctx) |
Initialize the wifi device. | |
int | wlp_set_baudrate (uint32_t baudrate, uint8_t rtscts) |
Change the baudrate of the device. | |
int | wlp_reset (void) |
int | wlp_get_fw_version (uint32_t *code, char *build, int len) |
Get the firmware version. | |
void | wlp_set_link_cb (void(*link_cb)(void *ctx, int link), void *ctx) |
Set a wifi link status callback function. | |
int | wlp_linkup (struct wl_ssid_t *ssid, const char *key, int wep) |
Connect the wifi link. | |
int | wlp_linkdown (void) |
Disconnect the wifi link. | |
int | wlp_get_hwaddr (struct wl_mac_addr_t *hwaddr) |
Get the interface MAC address. | |
int | wlp_get_network (struct wlp_network_t *net) |
Get the 802.11 network. | |
void | wlp_set_ipaddr_cb (void(*addr_cb)(void *ctx, const struct ip_addr *addr), void *ctx) |
Register a callback that will be invoked when an IP address is set. | |
int | wlp_set_ipaddr (const struct ip_addr *ip, const struct ip_addr *netmask, const struct ip_addr *gw, const struct ip_addr *dns) |
Set a static IP address. | |
int | wlp_get_ipaddr (struct ip_addr *ip, struct ip_addr *netmask, struct ip_addr *gw, struct ip_addr *dns) |
Get the current IP address parameters. | |
int | wlp_set_dhcp (int enable) |
Request or release IP address through DHCP. | |
int | wlp_get_dhcp (int *enabled) |
Get the current DHCP configuration. | |
int | wlp_set_dhcpd (int enable) |
Start or stop the device DHCP server. | |
int | wlp_socket (int type, int proto) |
Creates an endpoint for communication and returns a socket id. | |
int | wlp_set_conn_cb (int sockid, void(*conn_cb)(void *ctx, int sockid, int connected), void *ctx) |
Register a connection status callback. | |
int | wlp_set_recv_cb (int sockid, void(*recv_cb)(void *ctx, int sockid, int len), void *ctx) |
Register a data pending callback. | |
int | wlp_bind (int sockid, const struct ip_addr *addr, uint16_t port) |
Assign an address for a socket. | |
int | wlp_listen (int sockid, int backlog, void(*listen_cb)(void *ctx, int sockid), void *ctx) |
Configure the socket to listen for incoming connections. | |
int | wlp_connect (int sockid, const struct ip_addr *ip, uint16_t port) |
Initiate a connection on a socket. | |
int | wlp_accept (int sockid) |
Accept a connection on a socket. | |
int | wlp_close (int sockid) |
Close a socket. | |
int | wlp_recv (int sockid, char *buf, int16_t len) |
Read data from a socket. | |
int | wlp_send (int sockid, const char *buf, int16_t len) |
Send data to a socket. | |
int | wlp_sendto (int sockid, const char *buf, int16_t len, const struct ip_addr *ip, uint16_t port) |
Send data to a specified address from a socket. | |
int | wlp_get_peeraddr (int sockid, struct ip_addr *peer) |
Get name of connected peer socket. | |
int | wlp_get_hostbyname (const char *host, void(*lookup_cb)(void *ctx, const struct ip_addr *ip), void *ctx) |
Get network address given a dns name. | |
void | wlp_poll (void) |
Event progress function. | |
int | wlp_set_mode (uint8_t mode) |
Set the Wi-Fi mode to AP or STA. | |
int | wlp_get_mode (uint8_t *mode) |
Check if the device is currently in AP or STA mode. | |
int | wlp_set_channel (uint8_t channel) |
Set the channel. Only supported when mode is WLP_MODE_AP. |
oWL Pico API
This is the documentation for the oWL Pico API.
#define WLP_ERR_ABORT -21 |
Aborted
#define WLP_ERR_AGAIN -13 |
Retry later
#define WLP_ERR_BUSY -14 |
Busy
#define WLP_ERR_CANCEL -19 |
Canceled by remote
#define WLP_ERR_CONN -4 |
No connection
#define WLP_ERR_DISABLED -15 |
Function is disabled
#define WLP_ERR_IGNORED -18 |
Ignored, no effect
#define WLP_ERR_INUSE -22 |
Already in use
#define WLP_ERR_MEM -3 |
Out of memory
#define WLP_ERR_NOTSUPP -10 |
Operation not supported
#define WLP_ERR_PARAM -2 |
Parameter error
#define WLP_ERR_PARSE -6 |
Input parsing error
#define WLP_ERR_PATH -7 |
Path not found
#define WLP_ERR_PERM -9 |
No permission
#define WLP_ERR_PROTO -16 |
Protocol error
#define WLP_ERR_RANGE -11 |
Out of range
#define WLP_ERR_SIZE -12 |
Bad size
#define WLP_ERR_STATE -5 |
Invalid state
#define WLP_ERR_SYNC -20 |
Sync error
#define WLP_ERR_TIMEOUT -17 |
Timeout
#define WLP_ERR_TYPE -8 |
Incompatible type
#define WLP_FAILURE -1 |
General failure