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.

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