Tiny protocol  0.7.0
Tiny communication protocol for microcontrollers
Public Attributes | List of all members
_hdlc_handle_t Struct Reference

#include <tiny_hdlc.h>

Public Attributes

int(* send_tx )(void *user_data, const void *data, int len)
 
int(* on_frame_read )(void *user_data, void *data, int len)
 
int(* on_frame_sent )(void *user_data, const void *data, int len)
 
void * rx_buf
 
int rx_buf_size
 
hdlc_crc_t crc_type
 
void * user_data
 

Detailed Description

Structure describes configuration of lowest HDLC level Initialize this structure by 0 before passing to hdlc_init() function.

Member Data Documentation

◆ crc_type

hdlc_crc_t _hdlc_handle_t::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.

◆ 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.

Parameters
user_datauser-defined data data pointer to received data
lensize of received 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

size of rx buffer

◆ send_tx

int(* _hdlc_handle_t::send_tx) (void *user_data, const void *data, int len)

Send bytes callback user-defined function. This callback must implement physical sending of bytes hw channel.

Parameters
user_datauser-defined data
databuffer with data to send over hw channel
lensize 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: