tinyproto
Public Attributes | List of all members
tiny_fd_init_t_ Struct Reference

This structure is used for initialization of Tiny Full Duplex protocol. More...

#include <tiny_fd.h>

Collaboration diagram for tiny_fd_init_t_:
Collaboration graph
[legend]

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...
 

Detailed Description

This structure is used for initialization of Tiny Full Duplex protocol.

Member Data Documentation

◆ addr

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.

◆ buffer

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()

◆ crc_type

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.

◆ log_frame_cb

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.

◆ mode

uint8_t tiny_fd_init_t_::mode

Communication link mode.

Refer to TINY_FD_MODE_ABM, TINY_FD_MODE_NRM, TINY_FD_MODE_ARM.

◆ mtu

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

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.

◆ peers_count

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.

Warning
Use 1 or 0 for now

◆ retry_timeout

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

◆ send_timeout

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().

◆ window_frames

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.


The documentation for this struct was generated from the following file: