// // Created by robin on 5/5/16. // #ifndef DIGICODE_HOSTCOMMUNICATION_H #define DIGICODE_HOSTCOMMUNICATION_H #include #include "config.h" struct HostCommunicationResult { char* data; int length; bool isSuccess; }; class HostCommunication { public: HostCommunication(); void init(); void debug(String str); void selfTest(); void login(String uid, String password); HostCommunicationResult read(int timeout); protected: void send(SERIAL_PACKET_TYPE type); void send(SERIAL_PACKET_TYPE type, String str); bool waitData(int timeout, int length); }; #endif //DIGICODE_HOSTCOMMUNICATION_H