26#include <condition_variable>
46 DataLink(
const char *fname,
int baud,
Link *_link,
unsigned short verbose,
const int cancellationFd);
70 inline void addToCrc(
unsigned char a,
unsigned short *crc) {
71 *crc = (*crc << 8) ^
crc_table[((*crc >> 8) ^
a) & 0xff];
A generic container for an array of bytes.
Thread-safe class responsible for managing the underlying serial device and data link framing.
const int requestedBaudRate_
Requested baud rate; -1 indicates automatic.
void addToCrc(unsigned char a, unsigned short *crc)
void sendReceivedData(std::vector< BufferStore > &receivedData)
void internalReset(bool resetBaudRateIndex)
const std::string devname
unsigned short receivedCRC
unsigned int crc_table[256]
friend void * data_pump_thread(void *)
void send(BufferStore &b, bool isEPOC)
Send a buffer out to serial line.
bool processInputData(std::vector< BufferStore > &receivedData)
Reads the incoming data and processes data frames.
unsigned char * outBuffer
std::condition_variable outputCondition_
void shutdown()
Store a flag that we're shutting down and signal any waiting send calls.
unsigned short inCRCstate
const int cancellationFd_
Used to signal cancellation.
pthread_t dataPumpThreadId_
static void * data_pump_thread(void *)