Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.3 KiB

  1. /*
  2. UTILS MODULE
  3. Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
  4. */
  5. #pragma once
  6. PROGMEM const char pstr_unknown[] = "UNKNOWN";
  7. #define INLINE inline __attribute__((always_inline))
  8. extern "C" uint32_t _SPIFFS_start;
  9. extern "C" uint32_t _SPIFFS_end;
  10. void setDefaultHostname();
  11. void setBoardName();
  12. const String& getDevice();
  13. const String& getManufacturer();
  14. const String& getCoreVersion();
  15. const String& getCoreRevision();
  16. int getHeartbeatMode();
  17. unsigned long getHeartbeatInterval();
  18. void heartbeat();
  19. String buildTime();
  20. unsigned long getUptime();
  21. bool haveRelaysOrSensors();
  22. void infoMemory(const char * name, unsigned int total_memory, unsigned int free_memory);
  23. void infoUptime();
  24. void info(bool first = false);
  25. bool sslCheckFingerPrint(const char * fingerprint);
  26. bool sslFingerPrintArray(const char * fingerprint, unsigned char * bytearray);
  27. bool sslFingerPrintChar(const char * fingerprint, char * destination);
  28. bool eraseSDKConfig();
  29. char * ltrim(char * s);
  30. char * strnstr(const char * buffer, const char * token, size_t n);
  31. bool isNumber(const char * s);
  32. void nice_delay(unsigned long ms);
  33. double roundTo(double num, unsigned char positions);
  34. uint32_t u32fromString(const String& string, int base);
  35. uint32_t u32fromString(const String& string);
  36. String u32toString(uint32_t bitset, int base);