63 virtual void end() = 0;
69 virtual void runRx() = 0;
75 virtual void runTx() = 0;
85 virtual bool put(
void *buf,
int size, uint32_t timeout) = 0;
138 uint32_t m_timeout = 0;
This is Tiny protocol implementation for microcontrollers.
virtual void flushTx()=0
Flush tx operation if possible.
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
virtual bool put(void *buf, int size, uint32_t timeout)=0
Puts new data for sending over the link layer.
virtual void end()=0
Stops link layer protocol.
virtual void runRx()=0
Runs rx part of the protocol.
This is basic class for C++ Link Layer objects.
Definition: TinyLinkLayer.h:43
int getMtu()
Returns current mtu for the link layer protocol in bytes.
Definition: TinyLinkLayer.h:114
virtual void runTx()=0
Runs tx part of the protocol.
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
virtual bool begin(on_frame_read_cb_t onReadCb, on_frame_send_cb_t onSendCb, void *udata)=0
The method initializes the link layer protocol, and connects custom callbacks to link layer...
virtual ~ILinkLayer()=default
Default virtual destructor.
Definition: TinySerial.cpp:22
This is Tiny Full-Duplex protocol implementation for microcontrollers.
void setTimeout(uint32_t timeout)
Sets timeout of Rx/Tx operations in milliseconds for the link layer protocol.
Definition: TinyLinkLayer.h:98
void setMtu(int mtu)
Set protocol mtu (maximum transmission unit) payload.
Definition: TinyLinkLayer.h:126
uint32_t getTimeout()
Returns current timeout of Rx/Tx operations.
Definition: TinyLinkLayer.h:106