tinyproto
List of all members
tinyproto::Fd< S > Class Template Reference

This is class, which allocates buffers statically. More...

#include <TinyProtocolFd.h>

Inheritance diagram for tinyproto::Fd< S >:
Inheritance graph
[legend]
Collaboration diagram for tinyproto::Fd< S >:
Collaboration graph
[legend]

Additional Inherited Members

- Public Member Functions inherited from tinyproto::IFd
 IFd (void *buffer, int bufferSize)
 Initializes IFd object. More...
 
void begin ()
 Initializes protocol internal variables. More...
 
void end ()
 Resets protocol state.
 
int write (const char *buf, int size)
 Sends data block over communication channel. More...
 
int write (const IPacket &pkt)
 Sends packet over communication channel. More...
 
int run_rx (const void *data, int len)
 Processes incoming rx data, specified by a user. More...
 
int run_rx (read_block_cb_t read_func)
 Read data from communication channel using read_func and parses bytes to find hdlc messages. More...
 
int run_tx (write_block_cb_t write_func)
 Attempts to send out data via write_func function. More...
 
int run_tx (void *data, int max_size)
 Force protocol to generate tx data for you. More...
 
void disableCrc ()
 Disable CRC field in the protocol. More...
 
void enableCrc (hdlc_crc_t crc)
 Enables CRC by specified bit-size. More...
 
bool enableCheckSum ()
 Enables CRC 8-bit field in the protocol. More...
 
bool enableCrc16 ()
 Enables CRC 16-bit field in the protocol. More...
 
bool enableCrc32 ()
 Enables CRC 32-bit field in the protocol. More...
 
void setReceiveCallback (void(*on_receive)(void *userData, uint8_t addr, IPacket &pkt)=nullptr)
 Sets receive callback for incoming messages. More...
 
void setSendCallback (void(*on_send)(void *userData, uint8_t addr, IPacket &pkt)=nullptr)
 Sets send callback for outgoing messages. More...
 
void setConnectEventCallback (void(*on_connect)(void *userData, uint8_t addr, bool connected)=nullptr)
 Sets connect/disconnect callback. More...
 
void setWindowSize (uint8_t window)
 Sets desired window size. More...
 
void setSendTimeout (uint16_t timeout)
 Sets send timeout in milliseconds. More...
 
void setUserData (void *userData)
 Sets user data to pass to callbacks. More...
 
tiny_fd_handle_t getHandle ()
 Returns low-level handle for full duplex protocol.
 
int getStatus ()
 Returns status of the protocol.
 
- Protected Member Functions inherited from tinyproto::IFd
virtual void onReceive (uint8_t addr, uint8_t *pdata, int size)
 Method called by hdlc protocol upon receiving new frame. More...
 
virtual void onSend (uint8_t addr, const uint8_t *pdata, int size)
 Method called by hdlc protocol upon sending next frame. More...
 
virtual void onConnectEvent (uint8_t addr, bool connected)
 Method called by fd protocol when connect/disconnect event takes place. More...
 

Detailed Description

template<int S>
class tinyproto::Fd< S >

This is class, which allocates buffers statically.

Use it for systems with low resources.


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