#include <stdbool.h>
#include <wio.h>
#include "defs.h"
Go to the source code of this file.
|
wtp_status_t | wtp_tx_init (wtp_tx_ctrl_t *self, uint16_t window_size, uint16_t timeout, uint16_t read_size, uint16_t pkt_buf_size, uint16_t msg_buf_size, uint8_t n_fragments, uint8_t n_msgs) |
| Initialize WTP transmit control type. More...
|
|
wtp_status_t | wtp_tx_fini (wtp_tx_ctrl_t *self) |
| Finalize WTP transmit control type. More...
|
|
wtp_status_t | wtp_tx_begin_packet (wtp_tx_ctrl_t *self, wtp_pkt_t pkt_type) |
| Begin construction of WTP packet. More...
|
|
wtp_status_t | wtp_tx_end_packet (wtp_tx_ctrl_t *self) |
| End construction of WTP packet. More...
|
|
wtp_status_t | wtp_tx_add_msg (wtp_tx_ctrl_t *self, uint8_t *data, uint16_t size, wtp_tx_read_info_t **_read_info) |
| Add a new message to transmit control. More...
|
|
wtp_status_t | wtp_tx_make_fragment (wtp_tx_ctrl_t *self, uint8_t avail_size, wtp_tx_fragment_t **_fragment) |
| Make a new sending data fragment. More...
|
|
wtp_status_t | wtp_tx_handle_ack (wtp_tx_ctrl_t *self, uint16_t seq_num, uint8_t *_n_msgs) |
| Handle WTP acknowledgement. More...
|
|
wtp_status_t | wtp_rx_init (wtp_rx_ctrl_t *self, uint16_t window_size, uint16_t msg_data_size, uint16_t fragments_size, uint8_t n_msg_info) |
| Initialize WTP receive control type. More...
|
|
wtp_status_t | wtp_rx_fini (wtp_rx_ctrl_t *self) |
| Finalize WTP receive control type. More...
|
|
wtp_status_t | wtp_rx_handle_packet (wtp_rx_ctrl_t *self, uint16_t seq_num, uint8_t *data, uint16_t size, uint16_t new_msg_size, uint8_t *_n_msgs) |
| Handle incoming data packet. More...
|
|
◆ wtp_rx_fini()
Finalize WTP receive control type.
- Parameters
-
self | WTP receive control instance. |
- Returns
- WIO_OK.
◆ wtp_rx_handle_packet()
wtp_status_t wtp_rx_handle_packet |
( |
wtp_rx_ctrl_t * |
self, |
|
|
uint16_t |
seq_num, |
|
|
uint8_t * |
data, |
|
|
uint16_t |
size, |
|
|
uint16_t |
new_msg_size, |
|
|
uint8_t * |
_n_msgs |
|
) |
| |
Handle incoming data packet.
- Parameters
-
self | WTP receive control instance. |
seq_num | Packet sequence number. |
data | Payload data. |
size | Payload size. |
new_msg_size | New message size for WTP_PKT_BEGIN_MSG, 0 for WTP_PKT_CONT_MSG. |
_n_msgs | Used for returning number of messages received. |
- Returns
- Error code if failed, otherwise WIO_OK.
◆ wtp_rx_init()
wtp_status_t wtp_rx_init |
( |
wtp_rx_ctrl_t * |
self, |
|
|
uint16_t |
window_size, |
|
|
uint16_t |
msg_data_size, |
|
|
uint16_t |
fragments_size, |
|
|
uint8_t |
n_msg_info |
|
) |
| |
Initialize WTP receive control type.
- Parameters
-
self | WTP receive control instance. |
window_size | Sliding window size. |
msg_data_size | Message data buffer size. |
fragments_size | Data fragments buffer size. |
n_msg_info | Maximum number of receiving messages information. |
- Returns
- WIO_ERR_NO_MEMORY if memory allocation failed, otherwise WIO_OK.
◆ wtp_tx_add_msg()
Add a new message to transmit control.
- Parameters
-
self | WTP transmit control instance. |
data | Message data. |
size | Message size. |
_read_info | Used for returning Read OpSpec information object. |
- Returns
- Error code if failed, otherwise WIO_OK.
◆ wtp_tx_begin_packet()
Begin construction of WTP packet.
- Parameters
-
self | WTP transmit control instance. |
pkt_type | Packet type. |
- Returns
- WIO_ERR_OUT_OF_RANGE if exceeds packet buffer memory range, otherwise WIO_OK.
◆ wtp_tx_end_packet()
End construction of WTP packet.
- Parameters
-
self | WTP transmit control instance. |
- Returns
- WIO_OK.
◆ wtp_tx_fini()
Finalize WTP transmit control type.
- Parameters
-
self | WTP transmit control instance. |
- Returns
- WIO_OK.
◆ wtp_tx_handle_ack()
Handle WTP acknowledgement.
- Parameters
-
self | WTP transmit control instance. |
seq_num | Sequence number. |
_n_msgs | Used for returning number of messages sent. |
- Returns
- Error code if failed, otherwise WIO_OK.
◆ wtp_tx_init()
wtp_status_t wtp_tx_init |
( |
wtp_tx_ctrl_t * |
self, |
|
|
uint16_t |
window_size, |
|
|
uint16_t |
timeout, |
|
|
uint16_t |
read_size, |
|
|
uint16_t |
pkt_buf_size, |
|
|
uint16_t |
msg_buf_size, |
|
|
uint8_t |
n_fragments, |
|
|
uint8_t |
n_msgs |
|
) |
| |
Initialize WTP transmit control type.
- Parameters
-
self | WTP transmit control instance. |
window_size | Sliding window size. |
timeout | Packet sending and requesting uplink timeout. |
read_size | Initialize READ OpSpec size. |
pkt_buf_size | Packet buffer size. |
msg_buf_size | Message buffer size. |
n_fragments | Send data fragments capacity. |
n_msgs | Maximum amount of messages waiting to send. |
- Returns
- WIO_ERR_NO_MEMORY if memory allocation failed, otherwise WIO_OK.
◆ wtp_tx_make_fragment()
Make a new sending data fragment.
- Parameters
-
self | WTP transmit control instance. |
avail_size | Available size for message data in a READ OpSpec. |
_fragment | Used for returning newly made data fragment. |
- Returns
- Error code if failed, otherwise WIO_OK.