X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Fio%2FslipBio.h;h=918b9f7b3e9ff741891f9159a377f1e943a68d2a;hb=5163a9658ba7ef4a875ee1103e82c0be81698689;hp=26de30aefa75f6dad29b3fa1d91d80ba98e05dda;hpb=f69f31caeda734d6d9c8ab00e693671ac7512bea;p=cassiopeia.git diff --git a/src/io/slipBio.h b/src/io/slipBio.h index 26de30a..918b9f7 100644 --- a/src/io/slipBio.h +++ b/src/io/slipBio.h @@ -3,7 +3,7 @@ #include #include -#include "bios.h" +#include "io/bios.h" class SlipBIO : public OpensslBIO { private: @@ -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 );