31 #include "TinyLinkLayer.h" 51 bool put(
void *buf,
int size, uint32_t timeout)
override;
65 void setCrc( hdlc_crc_t crc ) { m_crc = crc; }
67 void setWindow(
int window)
72 void setBuffer(
void *buffer,
int size)
74 m_buffer =
reinterpret_cast<uint8_t *
>(buffer);
80 int parseData(
const uint8_t *data,
int size);
82 int getData(uint8_t *data,
int size);
86 uint8_t *m_buffer =
nullptr;
88 uint8_t m_txWindow = 2;
89 hdlc_crc_t m_crc = HDLC_CRC_8;
Definition: tiny_fd_int.h:114
void end() override
Stops link layer protocol.
Definition: TinyFdLinkLayer.cpp:64
void flushTx() override
Flush tx operation if possible.
Definition: TinyFdLinkLayer.cpp:75
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
This is basic class for C++ Link Layer objects.
Definition: TinyLinkLayer.h:43
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
bool put(void *buf, int size, uint32_t timeout) override
Puts new data for sending over the link layer.
Definition: TinyFdLinkLayer.cpp:70
Definition: TinySerial.cpp:22
This is Tiny Full-Duplex protocol implementation for microcontrollers.
Definition: TinyFdLinkLayer.h:40
bool begin(on_frame_read_cb_t onReadCb, on_frame_send_cb_t onSendCb, void *udata) override
The method initializes the link layer protocol, and connects custom callbacks to link layer...
Definition: TinyFdLinkLayer.cpp:44