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.

60 lines
1.4 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. #define INLINE inline __attribute__((always_inline))
  7. extern "C" uint32_t _SPIFFS_start;
  8. extern "C" uint32_t _SPIFFS_end;
  9. String getIdentifier();
  10. void setDefaultHostname();
  11. void setBoardName();
  12. String getBoardName();
  13. String getAdminPass();
  14. const String& getCoreVersion();
  15. const String& getCoreRevision();
  16. unsigned char getHeartbeatMode();
  17. unsigned char getHeartbeatInterval();
  18. void heartbeat();
  19. String getEspurnaModules();
  20. String getEspurnaOTAModules();
  21. String getEspurnaSensors();
  22. String getEspurnaWebUI();
  23. String buildTime();
  24. unsigned long getUptime();
  25. bool haveRelaysOrSensors();
  26. void infoMemory(const char * name, unsigned int total_memory, unsigned int free_memory);
  27. void infoUptime();
  28. void info(bool first = false);
  29. bool sslCheckFingerPrint(const char * fingerprint);
  30. bool sslFingerPrintArray(const char * fingerprint, unsigned char * bytearray);
  31. bool sslFingerPrintChar(const char * fingerprint, char * destination);
  32. bool eraseSDKConfig();
  33. char * ltrim(char * s);
  34. char * strnstr(const char * buffer, const char * token, size_t n);
  35. bool isNumber(const char * s);
  36. void nice_delay(unsigned long ms);
  37. double roundTo(double num, unsigned char positions);
  38. uint32_t u32fromString(const String& string, int base);
  39. uint32_t u32fromString(const String& string);
  40. String u32toString(uint32_t bitset, int base);