Tiny protocol
0.11.0
Tiny communication protocol for microcontrollers
|
#include <tiny_fd.h>
Public Attributes | |
write_block_cb_t | write_func |
callback function to write bytes to the physical channel | |
read_block_cb_t | read_func |
callback function to read bytes from the physical channel | |
void * | pdata |
user data for block read/write functions | |
on_frame_cb_t | on_frame_cb |
callback function to process incoming frames. Callback is called from tiny_fd_run_rx() context. | |
on_frame_cb_t | on_sent_cb |
Callback to get notification of sent frames. Callback is called from tiny_fd_run_tx() context. | |
void * | buffer |
uint16_t | buffer_size |
maximum input buffer size, see tiny_fd_buffer_size_by_mtu() | |
uint16_t | send_timeout |
uint16_t | retry_timeout |
uint8_t | retries |
hdlc_crc_t | crc_type |
uint8_t | window_frames |
This structure is used for initialization of Tiny Full Duplex protocol.
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.
uint8_t tiny_fd_init_t_::retries |
number retries to perform before timeout takes place
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.