Digi XBee(R) ANSI C Host Library
Data Structures | Macros | Functions

See xbee/socket.h for summary of API. More...

#include <assert.h>
#include "xbee/byteorder.h"
#include "xbee/device.h"
#include "xbee/ipv4.h"
#include "xbee/socket.h"

Data Structures

struct  socket_t
 

Macros

#define debug_printf(...)
 
#define XBEE_SOCK_SOCKET_TYPE_AVAILABLE   0x00
 slot in table available
 
#define XBEE_SOCK_SOCKET_TYPE_PENDING   0x01
 waiting for Create Response
 
#define XBEE_SOCK_SOCKET_TYPE_CREATED   0x02
 allocated but not established
 
#define XBEE_SOCK_SOCKET_TYPE_ATTACH   0x03
 waiting for Connect/Bind/Listen Resp
 
#define XBEE_SOCK_SOCKET_TYPE_CONNECT   0x04
 point-to-point connection
 
#define XBEE_SOCK_SOCKET_TYPE_BIND   0x05
 UDP socket accepting datagrams.
 
#define XBEE_SOCK_SOCKET_TYPE_LISTEN   0x06
 TCP/SSL socket accepting connections.
 

Functions

xbee_sock_t xbee_sock_create (xbee_dev_t *xbee, uint8_t protocol, xbee_sock_notify_fn notify_handler)
 Allocate a socket from the local socket table, and send a Socket Create frame to the XBee module to allocate space in its socket table. More...
 
int xbee_sock_connect (xbee_sock_t socket, uint16_t remote_port, uint32_t remote_addr, const char *remote_host, xbee_sock_receive_fn receive_handler)
 Connect a socket created with xbee_sock_create() to a remote host. More...
 
int xbee_sock_bind (xbee_sock_t socket, uint16_t local_port, xbee_sock_receive_from_fn receive_from_handler)
 Bind a UDP socket to a local port to accept datagrams from multiple hosts. More...
 
int xbee_sock_listen (xbee_sock_t socket, uint16_t local_port, xbee_sock_ipv4_client_fn ipv4_client_handler)
 Listen on a local port for inbound TCP/SSL connections from multiple hosts. More...
 
int xbee_sock_send (xbee_sock_t socket, uint8_t tx_options, const void *payload, size_t payload_len)
 Send data on a Connected socket, or an IPv4 Client socket spawned from a Listening socket. More...
 
int xbee_sock_sendto (xbee_sock_t socket, uint8_t tx_options, uint32_t remote_addr, uint16_t remote_port, const void *payload, size_t payload_len)
 Send a datagram on a Bound UDP socket. More...
 
int xbee_sock_option (xbee_sock_t socket, uint8_t option_id, const void *data, size_t data_len, xbee_sock_option_resp_fn callback)
 Get or set a socket option. More...
 
int xbee_sock_reset (xbee_dev_t *xbee)
 Send command to close all open sockets on device xbee, even if they aren't tracked in the local sockets table. More...
 
int xbee_sock_close (xbee_sock_t socket)
 Close and release a socket. More...
 
int xbee_sock_close_all (xbee_dev_t *xbee)
 Close all created sockets for a given XBee device. More...
 
int xbee_sock_frame_handler (xbee_dev_t *xbee, const void FAR *rawframe, uint16_t length, void FAR *context)
 Frame handler for all response frames. More...
 

Detailed Description

See xbee/socket.h for summary of API.