X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Fio%2FslipBio.h;h=918b9f7b3e9ff741891f9159a377f1e943a68d2a;hb=1867e1ad94f4549869b23a68851caf34cfbf8e8b;hp=27bfadb7950d2e452146a33614ddc59860759667;hpb=d19fbcd86a265cb99dd8597430e8159e9403c743;p=cassiopeia.git diff --git a/src/io/slipBio.h b/src/io/slipBio.h index 27bfadb..918b9f7 100644 --- a/src/io/slipBio.h +++ b/src/io/slipBio.h @@ -11,22 +11,28 @@ private: std::vector buffer; + std::vector header = {0, 0, 0, 0, 0, 0, 0, 0}; + int resetCounter = -1; // -1 means waiting for start byte + unsigned int decodeTarget; unsigned int decodePos; unsigned int rawPos; - bool failed; + bool waitForConnection = true; + bool waitForReset = false; bool packageLeft = false; + bool server = false; + private: - bool unmask(); + int unmask(); public: SlipBIO( std::shared_ptr target ); SlipBIO(); ~SlipBIO(); - void setTarget( std::shared_ptr target ); + void setTarget( std::shared_ptr target, bool server ); virtual int write( const char* buf, int num ); virtual int read( char* buf, int size );