|
| SerialHdlcLink (char *dev) |
|
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. More...
|
|
void | end () override |
| Stops link layer protocol.
|
|
| ISerialLinkLayer (char *dev, void *buffer, int size) |
|
bool | begin (on_frame_read_cb_t onReadCb, on_frame_send_cb_t onSendCb, void *udata) override |
|
void | end () override |
|
void | runRx () override |
|
void | runTx () override |
|
void | setSpeed (uint32_t speed) |
|
| IHdlcLinkLayer (void *buffer, int size) |
|
bool | put (void *buf, int size, uint32_t timeout) override |
| Puts new data for sending over the link layer. More...
|
|
void | flushTx () override |
| Flush tx operation if possible.
|
|
hdlc_crc_t | getCrc () |
|
void | setCrc (hdlc_crc_t crc) |
|
void | setBuffer (void *buffer, int size) |
|
void | setTimeout (uint32_t timeout) |
| Sets timeout of Rx/Tx operations in milliseconds for the link layer protocol. More...
|
|
uint32_t | getTimeout () |
| Returns current timeout of Rx/Tx operations.
|
|
int | getMtu () |
| Returns current mtu for the link layer protocol in bytes.
|
|
void | setMtu (int mtu) |
| Set protocol mtu (maximum transmission unit) payload. More...
|
|
virtual | ~ILinkLayer ()=default |
| Default virtual destructor.
|
|
|
int | parseData (const uint8_t *data, int size) |
|
int | getData (uint8_t *data, int size) |
|
◆ begin()
The method initializes the link layer protocol, and connects custom callbacks to link layer.
Once the new frame is received, onReadCb will be called, once frame is sent onSendCb will be called.
- Parameters
-
onReadCb | callback to call when a frame is received. Remember that processing must be as quick as possible |
onSendCb | callback to call when a frame is sent. |
udata | user defined data, will be passed to callbacks |
- Returns
- true if successful, false is initialization error happened.
Reimplemented from tinyproto::IHdlcLinkLayer.
The documentation for this class was generated from the following files: