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.

59 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 info();
  28. bool sslCheckFingerPrint(const char * fingerprint);
  29. bool sslFingerPrintArray(const char * fingerprint, unsigned char * bytearray);
  30. bool sslFingerPrintChar(const char * fingerprint, char * destination);
  31. bool eraseSDKConfig();
  32. char * ltrim(char * s);
  33. char * strnstr(const char * buffer, const char * token, size_t n);
  34. bool isNumber(const char * s);
  35. void nice_delay(unsigned long ms);
  36. double roundTo(double num, unsigned char positions);
  37. uint32_t u32fromString(const String& string, int base);
  38. uint32_t u32fromString(const String& string);
  39. String u32toString(uint32_t bitset, int base);