auto reconnect

This commit is contained in:
Tristan Krause 2019-03-27 09:18:21 +01:00
parent 8cbd8a1a12
commit a3e9e1ce27
4 changed files with 113 additions and 29 deletions

View file

@ -21,6 +21,7 @@ private:
public:
// Grundfunktionen
void init(void);
void reconnect(void);
void discard(void);
bool testConnection(void);
bool testIntConv(void);
@ -57,6 +58,8 @@ private:
const std::string SERIAL_DEVICE = "/dev/ttyUSB0";
constexpr static uint8_t MSG_OK = 0xFF;
constexpr static uint8_t MSG_FAIL = 0xFE;
constexpr static uint16_t RECONNECT_TIMEOUT = 32; // ms
constexpr static uint8_t RECONNECT_TRIES = 3;
// REQUESTS
constexpr static uint8_t RQ_DISC = 0;