Functions | |
struct netconn * | netconn_new_with_proto_and_callback (enum netconn_type t, u8_t proto, netconn_callback callback) |
err_t | netconn_delete (struct netconn *conn) |
enum netconn_type | netconn_type (struct netconn *conn) |
err_t | netconn_getaddr (struct netconn *conn, struct ip_addr *addr, u16_t *port, u8_t local) |
err_t | netconn_bind (struct netconn *conn, struct ip_addr *addr, u16_t port) |
err_t | netconn_connect (struct netconn *conn, struct ip_addr *addr, u16_t port) |
err_t | netconn_disconnect (struct netconn *conn) |
err_t | netconn_listen_with_backlog (struct netconn *conn, u8_t backlog) |
struct netconn * | netconn_accept (struct netconn *conn) |
struct netbuf * | netconn_recv (struct netconn *conn) |
err_t | netconn_sendto (struct netconn *conn, struct netbuf *buf, struct ip_addr *addr, u16_t port) |
err_t | netconn_send (struct netconn *conn, struct netbuf *buf) |
err_t | netconn_write (struct netconn *conn, const void *dataptr, int size, u8_t apiflags) |
err_t | netconn_close (struct netconn *conn) |
err_t | netconn_join_leave_group (struct netconn *conn, struct ip_addr *multiaddr, struct ip_addr *interface, enum netconn_igmp join_or_leave) |
err_t | netconn_gethostbyname (const char *name, struct ip_addr *addr) |
err_t netconn_bind | ( | struct netconn * | conn, | |
struct ip_addr * | addr, | |||
u16_t | port | |||
) |
Bind a netconn to a specific local IP address and port. Binding one netconn twice might not always be checked correctly!
conn | the netconn to bind | |
addr | the local IP address to bind the netconn to (use IP_ADDR_ANY to bind to all addresses) | |
port | the local port to bind the netconn to (not used for RAW) |
err_t netconn_close | ( | struct netconn * | conn | ) |
err_t netconn_connect | ( | struct netconn * | conn, | |
struct ip_addr * | addr, | |||
u16_t | port | |||
) |
err_t netconn_delete | ( | struct netconn * | conn | ) |
err_t netconn_disconnect | ( | struct netconn * | conn | ) |
err_t netconn_getaddr | ( | struct netconn * | conn, | |
struct ip_addr * | addr, | |||
u16_t * | port, | |||
u8_t | local | |||
) |
Get the local or remote IP address and port of a netconn. For RAW netconns, this returns the protocol instead of a port!
conn | the netconn to query | |
addr | a pointer to which to save the IP address | |
port | a pointer to which to save the port (or protocol for RAW) | |
local | 1 to get the local IP address, 0 to get the remote one |
err_t netconn_gethostbyname | ( | const char * | name, | |
struct ip_addr * | addr | |||
) |
Execute a DNS query, only one IP address is returned
name | a string representation of the DNS host name to query | |
addr | a preallocated struct ip_addr where to store the resolved IP address |
err_t netconn_join_leave_group | ( | struct netconn * | conn, | |
struct ip_addr * | multiaddr, | |||
struct ip_addr * | interface, | |||
enum netconn_igmp | join_or_leave | |||
) |
Join multicast groups for UDP netconns.
conn | the UDP netconn for which to change multicast addresses | |
multiaddr | IP address of the multicast group to join or leave | |
interface | the IP address of the network interface on which to send the igmp message | |
join_or_leave | flag whether to send a join- or leave-message |
err_t netconn_listen_with_backlog | ( | struct netconn * | conn, | |
u8_t | backlog | |||
) |
struct netconn* netconn_new_with_proto_and_callback | ( | enum netconn_type | t, | |
u8_t | proto, | |||
netconn_callback | callback | |||
) | [read] |
Create a new netconn (of a specific type) that has a callback function. The corresponding pcb is also created.
t | the type of 'connection' to create ( |
proto | the IP protocol for RAW IP pcbs | |
callback | a function to call on status changes (RX available, TX'ed) |
struct netbuf* netconn_recv | ( | struct netconn * | conn | ) | [read] |
err_t netconn_send | ( | struct netconn * | conn, | |
struct netbuf * | buf | |||
) |
err_t netconn_sendto | ( | struct netconn * | conn, | |
struct netbuf * | buf, | |||
struct ip_addr * | addr, | |||
u16_t | port | |||
) |
Send data (in form of a netbuf) to a specific remote IP address and port. Only to be used for UDP and RAW netconns (not TCP).
conn | the netconn over which to send data | |
buf | a netbuf containing the data to send | |
addr | the remote IP address to which to send the data | |
port | the remote port to which to send the data |
enum netconn_type netconn_type | ( | struct netconn * | conn | ) |
err_t netconn_write | ( | struct netconn * | conn, | |
const void * | dataptr, | |||
int | size, | |||
u8_t | apiflags | |||
) |
Send data over a TCP netconn.
conn | the TCP netconn over which to send data | |
dataptr | pointer to the application buffer that contains the data to send | |
size | size of the application data to send | |
apiflags | combination of following flags :
|