23 #ifndef XBEE_SOCKET_FRAMES_H 24 #define XBEE_SOCKET_FRAMES_H 31 #define XBEE_SOCK_STATUS_SUCCESS 0x00 32 #define XBEE_SOCK_STATUS_INVALID_PARAM 0x01 33 #define XBEE_SOCK_STATUS_FAILED_TO_READ 0x02 34 #define XBEE_SOCK_STATUS_IN_PROGRESS 0x03 35 #define XBEE_SOCK_STATUS_CONNECTED 0x04 36 #define XBEE_SOCK_STATUS_UNKNOWN 0x05 37 #define XBEE_SOCK_STATUS_BAD_SOCKET 0x20 38 #define XBEE_SOCK_STATUS_OFFLINE 0x22 39 #define XBEE_SOCK_STATUS_INTERNAL_ERR 0x31 40 #define XBEE_SOCK_STATUS_RESOURCE_ERR 0x32 41 #define XBEE_SOCK_STATUS_BAD_PROTOCOL 0x7B 42 // ^^^ Be sure to update xbee_sock_status_str() when adding to this macro list. 46 #define XBEE_SOCK_SOCKET_ID_INVALID 0xFF 49 #define XBEE_FRAME_SOCK_CREATE 0x40 56 #define XBEE_SOCK_PROTOCOL_UDP 0 57 #define XBEE_SOCK_PROTOCOL_TCP 1 58 #define XBEE_SOCK_PROTOCOL_SSL 4 59 }) xbee_frame_sock_create_t; 63 #define XBEE_FRAME_SOCK_OPTION_REQ 0x41 72 #define XBEE_SOCK_OPT_ID_TLS_PROFILE 0x00 76 #define XBEE_FRAME_SOCK_OPTION_RESP 0xC1 90 #define XBEE_FRAME_SOCK_CONNECT 0x42 101 #define XBEE_SOCK_ADDR_TYPE_IPV4 0 102 #define XBEE_SOCK_ADDR_TYPE_HOSTNAME 1 103 }) xbee_header_sock_connect_t; 107 #define XBEE_FRAME_SOCK_CLOSE 0x43 118 #define XBEE_FRAME_SOCK_SEND 0x44 131 #define XBEE_FRAME_SOCK_SENDTO 0x45 146 #define XBEE_FRAME_SOCK_BIND_LISTEN 0x46 161 #define XBEE_FRAME_SOCK_CREATE_RESP 0xC0 164 #define XBEE_FRAME_SOCK_CONNECT_RESP 0xC2 167 #define XBEE_FRAME_SOCK_CLOSE_RESP 0xC3 170 #define XBEE_FRAME_SOCK_LISTEN_RESP 0xC6 188 #define XBEE_FRAME_SOCK_IPV4_CLIENT 0xCC 201 #define XBEE_FRAME_SOCK_RECEIVE 0xCD 214 #define XBEE_FRAME_SOCK_RECEIVE_FROM 0xCE 229 #define XBEE_FRAME_SOCK_STATE 0xCF 238 #define XBEE_SOCK_STATE_CONNECTED 0x00 239 #define XBEE_SOCK_STATE_DNS_FAILED 0x01 240 #define XBEE_SOCK_STATE_CONNECTION_REFUSED 0x02 241 #define XBEE_SOCK_STATE_TRANSPORT_CLOSED 0x03 242 #define XBEE_SOCK_STATE_TIMED_OUT 0x04 243 #define XBEE_SOCK_STATE_INTERNAL_ERR 0x05 244 #define XBEE_SOCK_STATE_HOST_UNREACHABLE 0x06 245 #define XBEE_SOCK_STATE_CONNECTION_LOST 0x07 246 #define XBEE_SOCK_STATE_UNKNOWN_ERR 0x08 247 #define XBEE_SOCK_STATE_UNKNOWN_SERVER 0x09 248 #define XBEE_SOCK_STATE_RESOURCE_ERR 0x0A 249 #define XBEE_SOCK_STATE_LISTENER_CLOSED 0x0B 255 #define XBEE_SOCK_STR_BUF_SIZE 40 269 #endif // XBEE_SOCKET_FRAMES_H unsigned long uint32_t
32-bit unsigned integer
Definition: platform_config.h:43
#define XBEE_SOCK_STR_BUF_SIZE
Buffer size used for xbee_sock_status_str() and xbee_sock_state_str().
Definition: socket_frames.h:255
const char * xbee_sock_state_str(uint8_t state, char buffer[XBEE_SOCK_STR_BUF_SIZE])
Get a description of an XBEE_SOCK_STATE_xxx value (returned in an XBEE_FRAME_SOCK_STATE) for error me...
Definition: xbee_socket_frames.c:51
Format of XBee API frame type 0x40 (XBEE_FRAME_SOCK_CREATE).
Definition: socket_frames.h:59
Format of XBee API frame type 0xCE (XBEE_FRAME_SOCK_RECEIVE_FROM); sent from XBee to host when a data...
Definition: socket_frames.h:225
#define XBEE_BEGIN_DECLS
Macro defined to.
Definition: platform.h:41
Format of XBee API frame type 0xCD (XBEE_FRAME_SOCK_RECEIVE); sent from XBee to host when data arrive...
Definition: socket_frames.h:210
Format of XBee API frame type 0xCF (XBEE_FRAME_SOCK_STATE); sent from XBee to host when a socket's st...
Definition: socket_frames.h:252
Format of XBee API frame type 0x46 (XBEE_FRAME_SOCK_BIND_LISTEN).
Definition: socket_frames.h:157
Format of XBee API frame type 0xCC (XBEE_FRAME_SOCK_IPV4_CLIENT); sent from XBee to host for new conn...
Definition: socket_frames.h:197
const char * xbee_sock_status_str(uint8_t status, char buffer[XBEE_SOCK_STR_BUF_SIZE])
Get a description of an XBEE_SOCK_STATUS_xxx value (returned in multiple socket response frame types)...
Definition: xbee_socket_frames.c:27
unsigned short uint16_t
16-bit unsigned integer
Definition: platform_config.h:41
unsigned char uint8_t
8-bit unsigned integer
Definition: platform_config.h:39
Format of multiple XBee API frame types sent from XBee to host: 0xC0 (XBEE_FRAME_SOCK_CREATE_RESP) 0x...
Definition: socket_frames.h:184
Format of XBee API frame type 0x43 (XBEE_FRAME_SOCK_CLOSE).
Definition: socket_frames.h:114
#define XBEE_END_DECLS
Macro defined to.
Definition: platform.h:42
Format of XBee API frame type 0xC1 (XBEE_FRAME_SOCK_OPTION_RESP); sent from XBee to host...
Definition: socket_frames.h:86