65 #ifndef XBEE_SOCK_SOCKET_COUNT 66 #define XBEE_SOCK_SOCKET_COUNT 10 138 const void *datagram,
139 size_t datagram_len);
232 uint32_t remote_addr,
const char *remote_host,
311 const void *payload,
size_t payload_len);
344 const void *payload,
size_t payload_len);
435 #define XBEE_SOCK_FRAME_HANDLERS { 0, 0, xbee_sock_frame_handler, NULL } 439 #endif // XBEE_SOCKET_H unsigned long uint32_t
32-bit unsigned integer
Definition: platform_config.h:43
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.
Definition: xbee_socket.c:328
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.
Definition: xbee_socket.c:448
void(* xbee_sock_notify_fn)(xbee_sock_t socket, uint8_t frame_type, uint8_t message)
Callback handler for notification of various socket events.
Definition: socket.h:95
#define FAR
On platforms with "far" pointers, define to the proper keyword; empty definition if not required...
Definition: platform.h:396
#define XBEE_BEGIN_DECLS
Macro defined to.
Definition: platform.h:41
int xbee_sock_t
Unique identifier for sockets created in this API layer.
Definition: socket.h:63
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.
Definition: xbee_socket.c:406
Frame definitions and support functions for Extended Socket frames (0x40-0x4F and 0xC0-0xCF)...
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 a...
Definition: xbee_socket.c:163
unsigned short uint16_t
16-bit unsigned integer
Definition: platform_config.h:41
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...
Definition: xbee_socket.c:366
void(* xbee_sock_receive_fn)(xbee_sock_t socket, uint8_t status, const void *payload, size_t payload_len)
Callback for data received on sockets created with xbee_sock_connect().
Definition: socket.h:113
unsigned char uint8_t
8-bit unsigned integer
Definition: platform_config.h:39
void(* xbee_sock_option_resp_fn)(xbee_sock_t socket, uint8_t option_id, uint8_t status, const void *data, size_t data_len)
Callback for responses to Get/Set Option requests sent with xbee_sock_option().
Definition: socket.h:176
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.
Definition: xbee_socket.c:1027
int xbee_sock_close_all(xbee_dev_t *xbee)
Close all created sockets for a given XBee device.
Definition: xbee_socket.c:569
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.
Definition: xbee_socket.c:210
int xbee_sock_close(xbee_sock_t socket)
Close and release a socket.
Definition: xbee_socket.c:562
#define XBEE_END_DECLS
Macro defined to.
Definition: platform.h:42
xbee_sock_receive_fn(* xbee_sock_ipv4_client_fn)(xbee_sock_t listening_socket, xbee_sock_t client_socket, uint32_t remote_addr, uint16_t remote_port)
Callback for TCP/SSL sockets created with xbee_sock_listen().
Definition: socket.h:157
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 socke...
Definition: xbee_socket.c:546
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.
Definition: xbee_socket.c:347
void(* xbee_sock_receive_from_fn)(xbee_sock_t socket, uint8_t status, uint32_t remote_addr, uint16_t remote_port, const void *datagram, size_t datagram_len)
Callback for datagrams received on UDP sockets created with xbee_sock_bind().
Definition: socket.h:134