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.

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