iodrivers_base
Public Member Functions | Protected Attributes | List of all members
iodrivers_base::Parser Class Referenceabstract

#include <Bus.hpp>

Inheritance diagram for iodrivers_base::Parser:
iodrivers_base::BusHandler

Public Member Functions

 Parser (Bus *bus)
 
virtual ~Parser ()
 
virtual int readPacket (uint8_t *buffer, int buffer_size, int packet_timeout, int first_byte_timeout=-1)
 
virtual int extractPacket (uint8_t const *buffer, size_t buffer_size) const =0
 
bool writePacket (uint8_t const *buffer, int bufsize, int timeout)
 

Protected Attributes

Busbus
 

Detailed Description

This Class implements an Parser, classes they inherit this, are able to "dock" on an IOBus. Its used for e.g. for RS-485 Communication busses, there may different devices on one bus. Its not pratcicable to wrote an huge extract_packed for this, each device can with this clas implement it's own extractor.

Constructor & Destructor Documentation

◆ Parser()

Parser::Parser ( Bus bus)

◆ ~Parser()

virtual iodrivers_base::Parser::~Parser ( )
inlinevirtual

Member Function Documentation

◆ extractPacket()

virtual int iodrivers_base::Parser::extractPacket ( uint8_t const *  buffer,
size_t  buffer_size 
) const
pure virtual

Decription see IODriver

◆ readPacket()

int Parser::readPacket ( uint8_t *  buffer,
int  buffer_size,
int  packet_timeout,
int  first_byte_timeout = -1 
)
virtual

read packed calls the readPacked from IOBus, if this readPacked is used only the extract packed from this Device is called, other device-extractors are not involved, to no call to packedReady (see IOBusHandler) is done. If youre devices not request->answer like you need to use the IOBusHandler, and call the readPacked from IOBus.

Reimplemented in iodrivers_base::BusHandler.

◆ writePacket()

bool Parser::writePacket ( uint8_t const *  buffer,
int  bufsize,
int  timeout 
)

See IODriver

Member Data Documentation

◆ bus

Bus* iodrivers_base::Parser::bus
protected

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