WISP ERT (Client)  1.0.0
The WISP Extended Runtime (WISP side)
defs.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <wio.h>
4 
5 //=== WTP types ===
6 //WTP endpoint type forward declaration
7 struct wtp;
8 
12 typedef uint8_t wtp_pkt_t;
14 typedef uint8_t wtp_link_state_t;
16 typedef uint8_t wtp_event_t;
18 typedef uint8_t wtp_param_t;
21  struct wtp*,
22  wio_buf_t*
23 );
24 
25 //=== WTP error codes ===
27 static const wtp_status_t WTP_ERR_UNSUPPORT_OP = 0x10;
28 
29 //=== WTP packet types ===
31 static const wtp_pkt_t WTP_PKT_END = 0x00;
33 static const wtp_pkt_t WTP_PKT_OPEN = 0x01;
35 static const wtp_pkt_t WTP_PKT_CLOSE = 0x02;
37 static const wtp_pkt_t WTP_PKT_ACK = 0x03;
39 static const wtp_pkt_t WTP_PKT_BEGIN_MSG = 0x04;
41 static const wtp_pkt_t WTP_PKT_CONT_MSG = 0x05;
43 static const wtp_pkt_t WTP_PKT_REQ_UPLINK = 0x06;
45 static const wtp_pkt_t WTP_PKT_SET_PARAM = 0x07;
46 
48 #define _WTP_PKT_MAX 0x08
49 static const wtp_pkt_t WTP_PKT_MAX = _WTP_PKT_MAX;
51 
52 //=== WTP connection states ===
54 static const wtp_link_state_t WTP_STATE_CLOSED = 0x00;
56 static const wtp_link_state_t WTP_STATE_OPENING = 0x01;
58 static const wtp_link_state_t WTP_STATE_OPENED = 0x02;
60 static const wtp_link_state_t WTP_STATE_CLOSING = 0x03;
61 
62 //=== WTP events ===
64 static const wtp_event_t WTP_EVENT_OPEN = 0x00;
66 static const wtp_event_t WTP_EVENT_HALF_CLOSE = 0x01;
68 static const wtp_event_t WTP_EVENT_CLOSE = 0x02;
69 
71 #define _WTP_EVENT_MAX 0x03
74 
75 //=== WTP parameter code ===
77 static const wtp_param_t WTP_PARAM_WINDOW_SIZE = 0x00;
79 static const wtp_param_t WTP_PARAM_READ_SIZE = 0x01;
uint8_t wio_status_t
WIO status type.
Definition: defs.h:40
static const wtp_event_t WTP_EVENT_MAX
WTP event max.
Definition: defs.h:73
static const wtp_pkt_t WTP_PKT_END
No more packets.
Definition: defs.h:31
wio_status_t wtp_status_t
WTP status type.
Definition: defs.h:7
static const wtp_link_state_t WTP_STATE_OPENING
Connection opening.
Definition: defs.h:56
static const wtp_event_t WTP_EVENT_OPEN
Connection opened event.
Definition: defs.h:64
static const wtp_param_t WTP_PARAM_WINDOW_SIZE
Sliding window size.
Definition: defs.h:77
WIO buffer type.
Definition: buf.h:6
static const wtp_pkt_t WTP_PKT_CLOSE
Close WTP connection.
Definition: defs.h:35
static const wtp_pkt_t WTP_PKT_CONT_MSG
Continue message.
Definition: defs.h:41
uint8_t wtp_pkt_t
WTP packet type.
Definition: defs.h:12
#define _WTP_PKT_MAX
WTP Packet max (Marco)
Definition: defs.h:48
static const wtp_pkt_t WTP_PKT_REQ_UPLINK
Request uplink transmission.
Definition: defs.h:43
static const wtp_pkt_t WTP_PKT_MAX
WTP Packet max.
Definition: defs.h:50
static const wtp_pkt_t WTP_PKT_SET_PARAM
Set WTP parameter.
Definition: defs.h:45
static const wtp_link_state_t WTP_STATE_OPENED
Connection opened.
Definition: defs.h:58
static const wtp_status_t WTP_ERR_UNSUPPORT_OP
Unsupported operation.
Definition: defs.h:27
static const wtp_link_state_t WTP_STATE_CLOSING
Connection closing.
Definition: defs.h:60
uint8_t wtp_param_t
WTP parameter code type.
Definition: defs.h:18
static const wtp_link_state_t WTP_STATE_CLOSED
Connection closed.
Definition: defs.h:54
uint8_t wtp_event_t
WTP event type.
Definition: defs.h:16
#define _WTP_EVENT_MAX
WTP event max (Marco)
Definition: defs.h:71
static const wtp_pkt_t WTP_PKT_ACK
Acknowledgement.
Definition: defs.h:37
static const wtp_event_t WTP_EVENT_HALF_CLOSE
Downlink closed event.
Definition: defs.h:66
uint8_t wtp_link_state_t
WTP link state type.
Definition: defs.h:14
static const wtp_param_t WTP_PARAM_READ_SIZE
Read OpSpec size.
Definition: defs.h:79
static const wtp_pkt_t WTP_PKT_BEGIN_MSG
Begin message.
Definition: defs.h:39
wtp_status_t(* wtp_pkt_handler_t)(struct wtp *, wio_buf_t *)
WTP packet handler type.
Definition: defs.h:20
static const wtp_pkt_t WTP_PKT_OPEN
Open WTP connection.
Definition: defs.h:33
static const wtp_event_t WTP_EVENT_CLOSE
Connection closed event.
Definition: defs.h:68