18 #ifndef PACKET_FINDER_HPP_ 19 #define PACKET_FINDER_HPP_ 26 #include <ecl/containers.hpp> 27 #include <ecl/sigslots.hpp> 28 #include "../macros.hpp" 102 ecl::Signal<const std::string&>
sig_warn, sig_error;
109 void configure(
const std::string &sigslots_namespace,
110 const BufferType & putStx,
const BufferType & putEtx,
unsigned int sizeLengthField,
111 unsigned int sizeMaxPayload,
unsigned int sizeChecksumField,
bool variableSizePayload);
113 void enableVerbose();
114 virtual bool update(
const unsigned char * incoming,
unsigned int numberOfIncoming);
115 virtual bool checkSum();
116 unsigned int numberOfDataToRead();
117 void getBuffer(BufferType & bufferRef);
118 void getPayload(BufferType & bufferRef);
121 bool WaitForStx(
const unsigned char datum);
122 bool waitForPayloadSize(
const unsigned char * incoming,
unsigned int numberOfIncoming);
123 bool waitForEtx(
const unsigned char incoming,
bool & foundPacket);
124 bool waitForPayloadAndEtx(
const unsigned char * incoming,
unsigned int numberOfIncoming,
bool & foundPacket);
ecl::PushAndPop< unsigned char > BufferType
Provides simple packet finder which may be consist of stx, etx, payload, ...
virtual ~PacketFinderBase()
unsigned int size_max_payload
ecl::Signal< const std::string & > sig_warn
unsigned int size_checksum_field
unsigned int size_length_field
bool variable_size_payload
unsigned int size_payload