Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

HostCommunication.h 658B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // Created by robin on 5/5/16.
  3. //
  4. #ifndef DIGICODE_HOSTCOMMUNICATION_H
  5. #define DIGICODE_HOSTCOMMUNICATION_H
  6. #include <WString.h>
  7. #include "config.h"
  8. struct HostCommunicationResult
  9. {
  10. char* data;
  11. int length;
  12. bool isSuccess;
  13. };
  14. class HostCommunication
  15. {
  16. public:
  17. HostCommunication();
  18. void init();
  19. void debug(String str);
  20. void selfTest();
  21. void login(String uid, String password);
  22. HostCommunicationResult read(int timeout);
  23. protected:
  24. void send(SERIAL_PACKET_TYPE type);
  25. void send(SERIAL_PACKET_TYPE type, String str);
  26. bool waitData(int timeout, int length);
  27. };
  28. #endif //DIGICODE_HOSTCOMMUNICATION_H