/* * SlipSerial.h & SlipSerial.cpp - (C) 2007 by Torben H. Nielsen * * Class for implementing the slip data-link protocol on top of a serial port. */ #pragma once #include "Serial.h" #include #include #include class timeout_error : std::runtime_error { public: timeout_error(const std::string& arg) : runtime_error(arg) {} }; class CSlipSerial : public CSerial { public: CSlipSerial(char* port, Baudrate bitrate); CSlipSerial(); virtual ~CSlipSerial(void); std::vector readFrame(); void writeFrame(std::vector data); void writeFrame(unsigned char buf[], int len); protected: void writeSlipByte(unsigned char out); };