tinyproto
Public Attributes | List of all members
_hdlc_handle_t Struct Reference

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

#include <hdlc.h>

Collaboration diagram for _hdlc_handle_t:
Collaboration graph
[legend]

Public Attributes

write_block_cb_t send_tx
 Send bytes callback user-defined function. More...
 
int(* on_frame_read )(void *user_data, void *data, int len)
 User-defined callback, which is called when new packet arrives from hw channel. More...
 
int(* on_frame_send )(void *user_data, const void *data, int len)
 User-defined callback, which is called when the packet is sent to TX channel. More...
 
void * rx_buf
 Buffer to be used by hdlc level to receive data to.
 
int rx_buf_size
 size of rx buffer
 
hdlc_crc_t crc_type
 crc field type to use on hdlc level. More...
 
bool multithread_mode
 Set this to true, if you want to implements TX data transmission in separate thread from the threads, which call hdlc_send().
 
void * user_data
 User data, which will be passed to user-defined callback as first argument.
 
tiny_events_t events
 Parameters in DOXYGEN_SHOULD_SKIP_THIS section should not be modified by a user.
 
hdlc_ll_handle_t handle
 
int rx_len
 

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.

The context of this callback is context, where hdlc_run_rx() is called from.

Parameters
user_datauser-defined data
datapointer 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.

◆ on_frame_send

int(* _hdlc_handle_t::on_frame_send) (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_datauser-defined data
datapointer to sent data
lensize of sent data in bytes
Returns
user callback must return negative value in case of error or 0 value if packet is successfully processed.

◆ send_tx

write_block_cb_t _hdlc_handle_t::send_tx

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.

The documentation for this struct was generated from the following file: