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_frames_queue_int.h" 46 #define FD_PEER_BUF_SIZE() ( sizeof(tiny_fd_peer_info_t) ) 48 #define FD_MIN_BUF_SIZE(mtu, window) \ 49 (sizeof(tiny_fd_data_t) + TINY_ALIGN_STRUCT_VALUE - 1 + \ 50 HDLC_MIN_BUF_SIZE(mtu + sizeof(tiny_frame_header_t), HDLC_CRC_16) + \ 51 ( 1 * FD_PEER_BUF_SIZE() ) + \ 52 (sizeof(tiny_fd_frame_info_t *) + sizeof(tiny_fd_frame_info_t) + mtu \ 53 - sizeof(((tiny_fd_frame_info_t *)0)->payload) ) * window + \ 54 ( sizeof(tiny_fd_frame_info_t) + sizeof(tiny_fd_frame_info_t *) ) * TINY_FD_U_QUEUE_MAX_SIZE ) 56 #define FD_BUF_SIZE_EX(mtu, tx_window, crc, rx_window) \ 57 (sizeof(tiny_fd_data_t) + TINY_ALIGN_STRUCT_VALUE - 1 + \ 58 HDLC_BUF_SIZE_EX(mtu + sizeof(tiny_frame_header_t), crc, rx_window) + \ 59 ( 1 * FD_PEER_BUF_SIZE() ) + \ 60 (sizeof(tiny_fd_frame_info_t *) + sizeof(tiny_i_frame_info_t) + mtu \ 61 - sizeof(((tiny_fd_frame_info_t *)0)->payload)) * tx_window + \ 62 ( sizeof(tiny_fd_frame_info_t) + sizeof(tiny_fd_frame_info_t *) ) * TINY_FD_U_QUEUE_MAX_SIZE) 66 TINY_FD_STATE_IDLE = 0,
67 TINY_FD_STATE_DISCONNECTED,
68 TINY_FD_STATE_CONNECTING,
69 TINY_FD_STATE_CONNECTED,
70 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;
154 extern void __tiny_fd_log_frame(
Definition: tiny_fd_int.h:73
tiny_fd_queue_t i_queue
Storage for all I- frames.
Definition: tiny_fd_int.h:106
Definition: tiny_fd_int.h:114
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:125
tiny_frames_queue_t frames
Information for frames being processed.
Definition: tiny_fd_int.h:135
on_frame_send_cb_t on_send_cb
Callback to process received frames.
Definition: tiny_fd_int.h:119
on_frame_read_cb_t on_read_cb
Callback to process received frames.
Definition: tiny_fd_int.h:117
void * user_data
user specific data
Definition: tiny_fd_int.h:151
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:147
uint16_t send_timeout
Timeout for operations with acknowledge.
Definition: tiny_fd_int.h:127
uint8_t next_peer
Next peer to process.
Definition: tiny_fd_int.h:143
tiny_fd_state_t state
state of hdlc protocol according to ISO & RFC
Definition: tiny_fd_int.h:83
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:129
on_connect_event_cb_t on_connect_event_cb
Callback to get connect/disconnect notification.
Definition: tiny_fd_int.h:121
tiny_fd_log_frame_cb_t log_frame_cb
Callback to log frames.
Definition: tiny_fd_int.h:123
This is Tiny HAL implementation for microcontrollers.
Definition: tiny_fd_int.h:103
uint8_t retries
Number of retries to perform before timeout takes place.
Definition: tiny_fd_int.h:133
tiny_fd_peer_info_t * peers
Information on all peers stations.
Definition: tiny_fd_int.h:139
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:131
Definition: tiny_fd_int.h:80
Definition: tiny_fd_frames_queue_int.h:43
tiny_fd_queue_t s_queue
Storage for all S- and U- service frames.
Definition: tiny_fd_int.h:108
uint8_t peers_count
Peers count supported by the primary device.
Definition: tiny_fd_int.h:137
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:141
tiny_mutex_t mutex
Global mutex.
Definition: tiny_fd_int.h:110
tiny_events_t events
Global events for HDLC protocol.
Definition: tiny_fd_int.h:149
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:145