max80_func.h 763 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef __MAX80_FUNC_H__
  2. #define __MAX80_FUNC_H__
  3. #include <Arduino.h>
  4. struct utf8decodedata
  5. {
  6. uint8_t state;
  7. uint8_t left;
  8. uint8_t acc;
  9. uint8_t data;
  10. uint8_t error;
  11. };
  12. namespace max80 {
  13. class std_max80
  14. {
  15. public:
  16. void reverse8(uint8_t *buf, int size, uint8_t *rev);
  17. String hex_to_string(uint8_t *buf, int size, String separator = "");
  18. void serial_empty(HardwareSerial *port);
  19. int hex_to_int(char c);
  20. int hex_to_ascii(char c, char d);
  21. void hex2bin(uint8_t *out, const char *in, size_t *size);
  22. void getmac_b(String mac, uint8_t *mac_b);
  23. String hexaddr(uint8_t *buf);
  24. uint8_t processutf8String(const uint8_t* s,uint8_t len,uint8_t* d);
  25. private:
  26. void processutf8(uint8_t b,utf8decodedata *data);
  27. };
  28. }
  29. #endif // __MAX80__STD_H__