31 #ifndef DOXYGEN_SHOULD_SKIP_THIS 33 #define TINY_FD_U_QUEUE_MAX_SIZE 4 41 #include "proto/hdlc/low_level/hdlc.h" 42 #include "proto/hdlc/low_level/hdlc_int.h" 44 #include "tiny_fd_i_queue_control_int.h" 45 #include "tiny_fd_frames_queue_int.h" 47 #define FD_PEER_BUF_SIZE() ( sizeof(tiny_fd_peer_info_t) ) 49 #define FD_MIN_BUF_SIZE(mtu, window) \ 50 (sizeof(tiny_fd_data_t) + TINY_ALIGN_STRUCT_VALUE - 1 + \ 51 HDLC_MIN_BUF_SIZE(mtu + sizeof(tiny_frame_header_t), HDLC_CRC_16) + \ 52 ( 1 * FD_PEER_BUF_SIZE() ) + \ 53 (sizeof(tiny_fd_frame_info_t *) + sizeof(tiny_fd_frame_info_t) + mtu \ 54 - sizeof(((tiny_fd_frame_info_t *)0)->payload) ) * window + \ 55 ( sizeof(tiny_fd_frame_info_t) + sizeof(tiny_fd_frame_info_t *) ) * TINY_FD_U_QUEUE_MAX_SIZE ) 57 #define FD_BUF_SIZE_EX(mtu, tx_window, crc, rx_window) \ 58 (sizeof(tiny_fd_data_t) + TINY_ALIGN_STRUCT_VALUE - 1 + \ 59 HDLC_BUF_SIZE_EX(mtu + sizeof(tiny_frame_header_t), crc, rx_window) + \ 60 ( 1 * FD_PEER_BUF_SIZE() ) + \ 61 (sizeof(tiny_fd_frame_info_t *) + sizeof(tiny_i_frame_info_t) + mtu \ 62 - sizeof(((tiny_fd_frame_info_t *)0)->payload)) * tx_window + \ 63 ( sizeof(tiny_fd_frame_info_t) + sizeof(tiny_fd_frame_info_t *) ) * TINY_FD_U_QUEUE_MAX_SIZE) 67 TINY_FD_STATE_IDLE = 0,
68 TINY_FD_STATE_DISCONNECTED,
69 TINY_FD_STATE_CONNECTING,
70 TINY_FD_STATE_CONNECTED,
71 TINY_FD_STATE_DISCONNECTING,
93 uint32_t last_sent_i_ts;
94 uint32_t last_sent_frame_ts;
95 uint32_t last_received_frame_ts;
143 extern void __tiny_fd_log_frame(
Definition: tiny_fd_int.h:74
Definition: tiny_fd_int.h:103
void(* tiny_fd_log_frame_cb_t)(void *udata, tiny_fd_handle_t handle, tiny_fd_frame_direction_t direction, tiny_fd_frame_type_t frame_type, tiny_fd_frame_subtype_t frame_subtype, uint8_t ns, uint8_t nr, const uint8_t *data, int len)
tiny_fd_log_frame_cb_t is a callback function, which is called every time frame is sent or received...
Definition: tiny_fd.h:149
hdlc_ll_handle_t _hdlc
hdlc information
Definition: tiny_fd_int.h:114
tiny_frames_queue_t frames
Information for frames being processed.
Definition: tiny_fd_int.h:124
on_frame_send_cb_t on_send_cb
Callback to process received frames.
Definition: tiny_fd_int.h:108
Definition: tiny_fd_i_queue_control_int.h:43
on_frame_read_cb_t on_read_cb
Callback to process received frames.
Definition: tiny_fd_int.h:106
void * user_data
user specific data
Definition: tiny_fd_int.h:140
void(* on_connect_event_cb_t)(void *udata, uint8_t address, bool connected)
on_connect_event_cb_t is a callback function, which is called every time connection is established or...
Definition: tiny_types.h:232
void(* on_frame_send_cb_t)(void *udata, uint8_t address, const uint8_t *pdata, int size)
on_frame_send_cb_t is a callback function, which is called every time new frame is sent...
Definition: tiny_types.h:223
uint8_t mode
HDLC mode;.
Definition: tiny_fd_int.h:136
uint16_t send_timeout
Timeout for operations with acknowledge.
Definition: tiny_fd_int.h:116
uint8_t next_peer
Next peer to process.
Definition: tiny_fd_int.h:132
tiny_fd_state_t state
state of hdlc protocol according to ISO & RFC
Definition: tiny_fd_int.h:84
Structure describes configuration of lowest HDLC level Initialize this structure by 0 before passing ...
Definition: hdlc_int.h:65
uint16_t retry_timeout
Timeout before retrying resend I-frames.
Definition: tiny_fd_int.h:118
on_connect_event_cb_t on_connect_event_cb
Callback to get connect/disconnect notification.
Definition: tiny_fd_int.h:110
tiny_fd_log_frame_cb_t log_frame_cb
Callback to log frames.
Definition: tiny_fd_int.h:112
This is Tiny HAL implementation for microcontrollers.
Definition: tiny_fd_frames_queue_int.h:51
uint8_t retries
Number of retries to perform before timeout takes place.
Definition: tiny_fd_int.h:122
tiny_fd_peer_info_t * peers
Information on all peers stations.
Definition: tiny_fd_int.h:128
void(* on_frame_read_cb_t)(void *udata, uint8_t address, uint8_t *pdata, int size)
on_frame_read_cb_t is a callback function, which is called every time new frame is received...
Definition: tiny_types.h:213
uint16_t ka_timeout
Timeout before sending keep alive HDLC frame (RR)
Definition: tiny_fd_int.h:120
Definition: tiny_fd_int.h:81
uint8_t peers_count
Peers count supported by the primary device.
Definition: tiny_fd_int.h:126
Events group type used by Tiny Protocol implementation.
Definition: cpp_hal.h:60
uint8_t addr
Local address: 0x00 or for primary devices.
Definition: tiny_fd_int.h:130
tiny_events_t events
Global events for HDLC protocol.
Definition: tiny_fd_int.h:138
tiny_fd_frame_direction_t
Enumeration of frame directions used in Tiny Full Duplex protocol.
Definition: tiny_fd.h:123
uint32_t last_marker_ts
Last marker timestamp.
Definition: tiny_fd_int.h:134