Uniot Core
0.9.0
Loading...
Searching...
No Matches
Common.h File Reference
#include <memory>
#include <utility>
Include dependency graph for Common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  FourCC< a, b, c, d >
 Creates a four-character code (FourCC) value from template parameters. More...
 

Namespaces

namespace  uniot
 Contains all classes and functions related to the Uniot Core.
 

Macros

#define UNIOT_SEMVER_TO_INT(major, minor, patch)
 Packs a semantic version into one integer.
 
#define UNIOT_CORE_VERSION   UNIOT_SEMVER_TO_INT(0, 9, 0)
 Version of Uniot Core, reported in the device's status packet.
 
#define UNIOT_MQTT_HOST   "mqtt.uniot.io"
 Hostname of the MQTT broker the device connects to.
 
#define UNIOT_MQTT_PORT   1883
 TCP port of the MQTT broker.
 
#define UNIOT_WIFI_AP_PREFIX   "UNIOT"
 Prefix for the generated configuration AP SSID.
 
#define UNIOT_WIFI_AP_PASSWORD   ""
 WPA2 password for the configuration AP.
 
#define UNIOT_WIFI_REBOOT_RESET_COUNT   5
 Consecutive reboots that reset the stored network configuration.
 
#define UNIOT_WIFI_REBOOT_WINDOW_MS   10000
 How long after boot a reboot still counts towards the reset, in ms.
 
#define UNIOT_LISP_HEAP   24576
 Bytes of heap the Lisp interpreter is given at startup.
 
#define UNIOT_LISP_MAX_EVAL_STACK   1280
 Bytes of C stack an evaluation may spend before a script is abandoned.
 
#define UNIOT_WIFI_NO_SLEEP   0
 Keep the WiFi radio awake between beacon intervals (ESP32 only).
 
#define COUNT_OF(arr)
 Calculates the number of elements in a statically allocated array.
 
#define ARRAY_ELEMENT_SAFE(arr, index)
 Provides safe array access with bounds checking.
 
#define FOURCC(name)
 Creates a FourCC constant from a string literal.
 
#define ALIAS_IMPLICIT_FUNCTION(high, low)
 Creates an alias for a function that forwards all arguments implicitly.
 
#define ALIAS_EXPLICIT_FUNCTION(high, low)
 Creates an alias for a template function that forwards all arguments explicitly.
 

Functions

template<typename... Args>
void UNUSED (Args &&...args)
 Utility function to mark function parameters as intentionally unused.
 
uint32_t CRC32 (const void *data, size_t length, uint32_t crc=0)
 Calculates CRC32-C (Castagnoli) checksum for data integrity verification.
 
template<typename T>
using uniot::UniquePointer = std::unique_ptr<T>
 Type alias for std::unique_ptr with cleaner syntax.
 
template<typename T>
using uniot::SharedPointer = std::shared_ptr<T>
 Type alias for std::shared_ptr with cleaner syntax.
 
template<typename T_First, typename T_Second>
using uniot::Pair = std::pair<T_First, T_Second>
 Type alias for std::pair with cleaner syntax.
 
template<typename T, typename... Args>
auto uniot::MakeShared (Args &&...args) -> decltype(std::make_shared< T >(std::forward< Args >(args)...))
 Creates a shared pointer instance, alias for std::make_shared.
 
template<typename T, typename... Args>
auto uniot::MakeUnique (Args &&...args) -> decltype(std::make_unique< T >(std::forward< Args >(args)...))
 Creates a unique pointer instance, alias for std::make_unique.
 
template<typename... Args>
auto uniot::MakePair (Args &&...args) -> decltype(std::make_pair(std::forward< Args >(args)...))
 Creates a pair instance, alias for std::make_pair.