EnigmaIOT  0.9.8
Secure sensor and gateway platform based on ESP8266 and ESP32
Macros | Functions | Variables
EnigmaIOTGateway.cpp File Reference

Library to build a gateway for EnigmaIoT system. More...

#include "EnigmaIOTGateway.h"
#include <FS.h>
#include "libb64/cdecode.h"
#include <ArduinoJson.h>
#include "cryptModule.h"
#include "helperFunctions.h"
#include <cstddef>
#include <cstdint>
#include <regex>
#include "haEntity.h"
#include "haBinarySensor.h"
#include "haCover.h"
#include "haSensor.h"
#include "haSwitch.h"
#include "haTrigger.h"

Go to the source code of this file.

Macros

#define IKMSG_LEN   sizeof(invalidateKey_msg)
 
#define CHMSG_LEN   sizeof(clientHello_msg)
 
#define SHMSG_LEN   sizeof(serverHello_msg)
 

Functions

const void * memstr (const void *str, size_t str_size, const char *target, size_t target_size)
 
bool buildGetVersion (uint8_t *data, size_t &dataLen, const uint8_t *inputData, size_t inputLen)
 
bool buildGetSleep (uint8_t *data, size_t &dataLen, const uint8_t *inputData, size_t inputLen)
 
bool buildSetIdentify (uint8_t *data, size_t &dataLen, const uint8_t *inputData, size_t inputLen)
 
bool buildGetRSSI (uint8_t *data, size_t &dataLen, const uint8_t *inputData, size_t inputLen)
 
bool buildGetName (uint8_t *data, size_t &dataLen, const uint8_t *inputData, size_t inputLen)
 
bool buildSetName (uint8_t *data, size_t &dataLen, const uint8_t *inputData, size_t inputLen)
 
bool buildSetResetConfig (uint8_t *data, size_t &dataLen, const uint8_t *inputData, size_t inputLen)
 
bool buildRestartNode (uint8_t *data, size_t &dataLen, const uint8_t *inputData, size_t inputLen)
 
bool buildSendBrcastKey (uint8_t *data, size_t &dataLen, const uint8_t *key, size_t keyLen)
 
int getNextNumber (char *&data, size_t &len)
 
bool isHexChar (char c)
 
bool buildOtaMsg (uint8_t *data, size_t &dataLen, const uint8_t *inputData, size_t inputLen)
 
bool buildSetSleep (uint8_t *data, size_t &dataLen, const uint8_t *inputData, size_t inputLen)
 

Variables

const char CONFIG_FILE [] = "/config.json"
 
bool shouldSave = false
 
bool OTAongoing = false
 
time_t lastOTAmsg = 0
 
EnigmaIOTGatewayClass EnigmaIOTGateway
 

Detailed Description

Library to build a gateway for EnigmaIoT system.

Version
0.9.8
Date
15/07/2021
Author
German Martin

Definition in file EnigmaIOTGateway.cpp.

Macro Definition Documentation

◆ CHMSG_LEN

#define CHMSG_LEN   sizeof(clientHello_msg)

◆ IKMSG_LEN

#define IKMSG_LEN   sizeof(invalidateKey_msg)

◆ SHMSG_LEN

#define SHMSG_LEN   sizeof(serverHello_msg)

Function Documentation

◆ buildGetName()

bool buildGetName ( uint8_t *  data,
size_t &  dataLen,
const uint8_t *  inputData,
size_t  inputLen 
)

Definition at line 125 of file EnigmaIOTGateway.cpp.

◆ buildGetRSSI()

bool buildGetRSSI ( uint8_t *  data,
size_t &  dataLen,
const uint8_t *  inputData,
size_t  inputLen 
)

Definition at line 115 of file EnigmaIOTGateway.cpp.

◆ buildGetSleep()

bool buildGetSleep ( uint8_t *  data,
size_t &  dataLen,
const uint8_t *  inputData,
size_t  inputLen 
)

Definition at line 95 of file EnigmaIOTGateway.cpp.

◆ buildGetVersion()

bool buildGetVersion ( uint8_t *  data,
size_t &  dataLen,
const uint8_t *  inputData,
size_t  inputLen 
)

Definition at line 85 of file EnigmaIOTGateway.cpp.

◆ buildOtaMsg()

bool buildOtaMsg ( uint8_t *  data,
size_t &  dataLen,
const uint8_t *  inputData,
size_t  inputLen 
)

Definition at line 239 of file EnigmaIOTGateway.cpp.

◆ buildRestartNode()

bool buildRestartNode ( uint8_t *  data,
size_t &  dataLen,
const uint8_t *  inputData,
size_t  inputLen 
)

Definition at line 161 of file EnigmaIOTGateway.cpp.

◆ buildSendBrcastKey()

bool buildSendBrcastKey ( uint8_t *  data,
size_t &  dataLen,
const uint8_t *  key,
size_t  keyLen 
)

Definition at line 171 of file EnigmaIOTGateway.cpp.

◆ buildSetIdentify()

bool buildSetIdentify ( uint8_t *  data,
size_t &  dataLen,
const uint8_t *  inputData,
size_t  inputLen 
)

Definition at line 105 of file EnigmaIOTGateway.cpp.

◆ buildSetName()

bool buildSetName ( uint8_t *  data,
size_t &  dataLen,
const uint8_t *  inputData,
size_t  inputLen 
)

Definition at line 135 of file EnigmaIOTGateway.cpp.

◆ buildSetResetConfig()

bool buildSetResetConfig ( uint8_t *  data,
size_t &  dataLen,
const uint8_t *  inputData,
size_t  inputLen 
)

Definition at line 151 of file EnigmaIOTGateway.cpp.

◆ buildSetSleep()

bool buildSetSleep ( uint8_t *  data,
size_t &  dataLen,
const uint8_t *  inputData,
size_t  inputLen 
)

Definition at line 333 of file EnigmaIOTGateway.cpp.

◆ getNextNumber()

int getNextNumber ( char *&  data,
size_t &  len 
)

Definition at line 184 of file EnigmaIOTGateway.cpp.

◆ isHexChar()

bool isHexChar ( char  c)

Definition at line 230 of file EnigmaIOTGateway.cpp.

◆ memstr()

const void* memstr ( const void *  str,
size_t  str_size,
const char *  target,
size_t  target_size 
)

Definition at line 73 of file EnigmaIOTGateway.cpp.

Variable Documentation

◆ CONFIG_FILE

const char CONFIG_FILE[] = "/config.json"

Definition at line 35 of file EnigmaIOTGateway.cpp.

◆ EnigmaIOTGateway

EnigmaIOTGatewayClass EnigmaIOTGateway

Definition at line 2050 of file EnigmaIOTGateway.cpp.

◆ lastOTAmsg

time_t lastOTAmsg = 0

Definition at line 39 of file EnigmaIOTGateway.cpp.

◆ OTAongoing

bool OTAongoing = false

Definition at line 38 of file EnigmaIOTGateway.cpp.

◆ shouldSave

bool shouldSave = false

Definition at line 37 of file EnigmaIOTGateway.cpp.