tinyproto
|
This structure is used for initialization of Tiny Full Duplex protocol. More...
#include <tiny_fd.h>
Public Attributes | |
void * | pdata |
user data for block read/write functions | |
on_frame_read_cb_t | on_read_cb |
callback function to process incoming frames. Callback is called from tiny_fd_run_rx() context. | |
on_frame_send_cb_t | on_send_cb |
Callback to get notification of sent frames. Callback is called from tiny_fd_run_tx() context. | |
void * | buffer |
buffer to store data during full-duplex protocol operating. More... | |
uint16_t | buffer_size |
maximum input buffer size, see tiny_fd_buffer_size_by_mtu() | |
uint16_t | send_timeout |
timeout. More... | |
uint16_t | retry_timeout |
timeout for retry operation. More... | |
uint8_t | retries |
number retries to perform before timeout takes place | |
hdlc_crc_t | crc_type |
crc field type to use on hdlc level. More... | |
uint8_t | window_frames |
Number of frames in window, which confirmation may be deferred for. More... | |
int | mtu |
Maximum transmission unit in bytes. More... | |
on_connect_event_cb_t | on_connect_event_cb |
Callback to get the notification when connect or disconnect event takes place. More... | |
tiny_fd_log_frame_cb_t | log_frame_cb |
Callback to log frames. More... | |
uint8_t | addr |
Local station address. More... | |
uint8_t | peers_count |
Maximum number of peers supported by the local station. More... | |
uint8_t | mode |
Communication link mode. More... | |
This structure is used for initialization of Tiny Full Duplex protocol.
uint8_t tiny_fd_init_t_::addr |
Local station address.
The field has meaning only for secondary stations. For primary stations please, leave this field as 0. For secondary stations the allowable range is 1 - 62. All 0-address is used only for testing purposes and is not allowed. All 1-address is used as broadcast address and tinyproto will filter out it.
void* tiny_fd_init_t_::buffer |
buffer to store data during full-duplex protocol operating.
The size should be at least size returned by tiny_fd_buffer_size_by_mtu()
hdlc_crc_t tiny_fd_init_t_::crc_type |
crc field type to use on hdlc level.
If HDLC_CRC_DEFAULT is passed, crc type will be selected automatically (depending on library configuration), but HDLC_CRC_16 has higher priority.
tiny_fd_log_frame_cb_t tiny_fd_init_t_::log_frame_cb |
Callback to log frames.
Can be NULL. If this callback is set, it will be called for every frame sent or received. This is useful for debugging purposes.
uint8_t tiny_fd_init_t_::mode |
Communication link mode.
Refer to TINY_FD_MODE_ABM, TINY_FD_MODE_NRM, TINY_FD_MODE_ARM.
int tiny_fd_init_t_::mtu |
Maximum transmission unit in bytes.
If this parameter is zero, the protocol will automatically calculate mtu based on buffer_size, window_frames.
on_connect_event_cb_t tiny_fd_init_t_::on_connect_event_cb |
Callback to get the notification when connect or disconnect event takes place.
Can be NULL.
uint8_t tiny_fd_init_t_::peers_count |
Maximum number of peers supported by the local station.
If the value is equal to 0, that means that only one remote station is supported. For secondary stations this value must be set to 1 or 0. For primary stations this value can be in range 0 - 63.
uint16_t tiny_fd_init_t_::retry_timeout |
timeout for retry operation.
It is valid and applicable to I-frames only. retry_timeout sets timeout in milliseconds. If zero value is specified, it is calculated as
uint16_t tiny_fd_init_t_::send_timeout |
timeout.
Can be set to 0 during initialization. In this case timeout will be set to default. Timeout parameter sets timeout in milliseconds for blocking API functions: tiny_fd_send().
uint8_t tiny_fd_init_t_::window_frames |
Number of frames in window, which confirmation may be deferred for.
Must be at least 1. Maximum allowable value is 7. Extended HDLC format (with 127 window size) is not yet supported. Smaller values reduce channel throughput, while higher values require more RAM. It is not mandatory to have the same window_frames value on both endpoints.