#include <tiny_hdlc.h>
Structure describes configuration of lowest HDLC level Initialize this structure by 0 before passing to hdlc_init() function.
◆ crc_type
crc field type to use on hdlc level. If HDLC_CRC_DEFAULT is passed, crc type will be selected automatically (depending on library configuration), but HDLC_CRC_16 has higher priority.
◆ multithread_mode
bool _hdlc_handle_t::multithread_mode |
Set this to true, if you want to implements TX data transmission in separate thread from the threads, which call hdlc_send().
◆ on_frame_read
int(* _hdlc_handle_t::on_frame_read) (void *user_data, void *data, int len) |
User-defined callback, which is called when new packet arrives from hw channel. The context of this callback is context, where hdlc_run_rx() is called from.
- Parameters
-
user_data | user-defined data |
data | pointer to received data |
len | size of received data in bytes |
- Returns
- user callback must return negative value in case of error or 0 value if packet is successfully processed.
◆ on_frame_sent
int(* _hdlc_handle_t::on_frame_sent) (void *user_data, const void *data, int len) |
User-defined callback, which is called when the packet is sent to TX channel. The context of this callback is context, where hdlc_run_tx() is called from.
- Parameters
-
user_data | user-defined data |
data | pointer to sent data |
len | size of sent data in bytes |
- Returns
- user callback must return negative value in case of error or 0 value if packet is successfully processed.
◆ rx_buf
void* _hdlc_handle_t::rx_buf |
Buffer to be used by hdlc level to receive data to
◆ rx_buf_size
int _hdlc_handle_t::rx_buf_size |
◆ send_tx
Send bytes callback user-defined function. This callback must implement physical sending of bytes hw channel.
- Parameters
-
user_data | user-defined data |
data | buffer with data to send over hw channel |
len | size of data in bytes to send. |
- Returns
- user callback must return negative value in case of error or 0 if hw device is busy, or positive number - number of bytes sent.
◆ user_data
void* _hdlc_handle_t::user_data |
User data, which will be passed to user-defined callback as first argument
The documentation for this struct was generated from the following file: