31 #include "TinyLinkLayer.h" 32 #include "proto/hdlc/low_level/hdlc.h" 52 bool put(
void *buf,
int size, uint32_t timeout)
override;
61 void setCrc( hdlc_crc_t crc )
66 void setBuffer(
void *buffer,
int size)
68 m_buffer =
reinterpret_cast<uint8_t *
>(buffer);
74 int parseData(
const uint8_t *data,
int size);
76 int getData(uint8_t *data,
int size);
80 void *m_udata =
nullptr;
83 tiny_mutex_t m_sendMutex{};
85 void *m_tempBuffer =
nullptr;
87 uint8_t *m_buffer =
nullptr;
89 hdlc_crc_t m_crc = HDLC_CRC_8;
90 bool m_flushFlag =
false;
92 static void onSend(
void *udata,
const uint8_t *data,
int len);
93 static void onRead(
void *udata, uint8_t *data,
int len);
Definition: TinyHdlcLinkLayer.h:41
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
Structure describes configuration of lowest HDLC level Initialize this structure by 0 before passing ...
Definition: hdlc_int.h:65
This is basic class for C++ Link Layer objects.
Definition: TinyLinkLayer.h:43
This is Tiny HAL implementation for microcontrollers.
void flushTx() override
Flush tx operation if possible.
Definition: TinyHdlcLinkLayer.cpp:111
bool put(void *buf, int size, uint32_t timeout) override
Puts new data for sending over the link layer.
Definition: TinyHdlcLinkLayer.cpp:82
void end() override
Stops link layer protocol.
Definition: TinyHdlcLinkLayer.cpp:75
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: TinyHdlcLinkLayer.cpp:55
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
Definition: TinySerial.cpp:22
Events group type used by Tiny Protocol implementation.
Definition: cpp_hal.h:60