EnigmaIOT  0.9.3
Secure sensor and gateway platform based on ESP8266 and ESP32
Classes | Macros | Typedefs | Enumerations | Variables
EnigmaIOTNode.h File Reference

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

#include "WProgram.h"
#include "EnigmaIoTconfig.h"
#include "cryptModule.h"
#include "helperFunctions.h"
#include "Comms_hal.h"
#include "NodeList.h"
#include <cstddef>
#include <cstdint>
#include <ESPAsyncWebServer.h>
#include <ESPAsyncWiFiManager.h>

Go to the source code of this file.

Classes

struct  rtcmem_data_t
 Context data to be stored con persistent storage to be used after wake from sleep mode. More...
 
class  EnigmaIOTNodeClass
 Main node class. Manages communication with gateway and allows sending and receiving user data. More...
 

Macros

#define LED_ON   HIGH
 
#define LED_OFF   !LED_ON
 

Typedefs

typedef nodeMessageType nodeMessageType_t
 
typedef void(* onNodeDataRx_t) (const uint8_t *mac, const uint8_t *buf, uint8_t len, nodeMessageType_t command, nodePayloadEncoding_t payloadEncoding)
 
typedef void(* onConnected_t) ()
 
typedef void(* onDisconnected_t) (nodeInvalidateReason_t reason)
 
typedef void(* onWiFiManagerExit_t) (boolean status)
 
typedef void(* onWiFiManagerStarted_t) (void)
 

Enumerations

enum  nodeMessageType {
  SENSOR_DATA = 0x01, UNENCRYPTED_NODE_DATA = 0x11, DOWNSTREAM_DATA_SET = 0x02, DOWNSTREAM_DATA_GET = 0x12,
  CONTROL_DATA = 0x03, DOWNSTREAM_CTRL_DATA = 0x04, CLOCK_REQUEST = 0x05, CLOCK_RESPONSE = 0x06,
  NODE_NAME_SET = 0x07, NODE_NAME_RESULT = 0x17, CLIENT_HELLO = 0xFF, SERVER_HELLO = 0xFE,
  INVALIDATE_KEY = 0xFB
}
 Message code definition. More...
 
enum  nodePayloadEncoding_t {
  RAW = 0x00, CAYENNELPP = 0x81, PROT_BUF = 0x82, MSG_PACK = 0x83,
  BSON = 0x84, CBOR = 0x85, SMILE = 0x86
}
 
enum  nodeInvalidateReason_t {
  UNKNOWN_ERROR = 0x00, WRONG_CLIENT_HELLO = 0x01, WRONG_DATA = 0x03, UNREGISTERED_NODE = 0x04,
  KEY_EXPIRED = 0x05
}
 Key invalidation reason definition. More...
 

Variables

EnigmaIOTNodeClass EnigmaIOTNode
 

Detailed Description

Library to build a node for EnigmaIoT system.

Version
0.9.3
Date
14/07/2020
Author
German Martin

Definition in file EnigmaIOTNode.h.

Macro Definition Documentation

◆ LED_OFF

#define LED_OFF   !LED_ON

Definition at line 31 of file EnigmaIOTNode.h.

◆ LED_ON

#define LED_ON   HIGH

Definition at line 30 of file EnigmaIOTNode.h.

Typedef Documentation

◆ nodeMessageType_t

Definition at line 95 of file EnigmaIOTNode.h.

◆ onConnected_t

typedef void(* onConnected_t) ()

Definition at line 106 of file EnigmaIOTNode.h.

◆ onDisconnected_t

typedef void(* onDisconnected_t) (nodeInvalidateReason_t reason)

Definition at line 107 of file EnigmaIOTNode.h.

◆ onNodeDataRx_t

typedef void(* onNodeDataRx_t) (const uint8_t *mac, const uint8_t *buf, uint8_t len, nodeMessageType_t command, nodePayloadEncoding_t payloadEncoding)

Definition at line 105 of file EnigmaIOTNode.h.

◆ onWiFiManagerExit_t

typedef void(* onWiFiManagerExit_t) (boolean status)

Definition at line 108 of file EnigmaIOTNode.h.

◆ onWiFiManagerStarted_t

typedef void(* onWiFiManagerStarted_t) (void)

Definition at line 109 of file EnigmaIOTNode.h.

Enumeration Type Documentation

◆ nodeInvalidateReason_t

Key invalidation reason definition.

Enumerator
UNKNOWN_ERROR 

Unknown error. Not used by the moment

WRONG_CLIENT_HELLO 

ClientHello message received was invalid

WRONG_DATA 

Data message received could not be decrypted successfuly

UNREGISTERED_NODE 

Data received from an unregistered node

KEY_EXPIRED 

Node key has reached maximum validity time

Definition at line 65 of file EnigmaIOTNode.h.

◆ nodeMessageType

Message code definition.

Enumerator
SENSOR_DATA 

Data message from sensor node

UNENCRYPTED_NODE_DATA 

Data message from sensor node. Unencrypted

DOWNSTREAM_DATA_SET 

Data message from gateway. Downstream data for commands

DOWNSTREAM_DATA_GET 

Data message from gateway. Downstream data for commands

CONTROL_DATA 

Internal control message from node to gateway. Used for OTA, settings configuration, etc

DOWNSTREAM_CTRL_DATA 

Internal control message from gateway to node. Used for OTA, settings configuration, etc

CLOCK_REQUEST 

Clock request message from node

CLOCK_RESPONSE 

Clock response message from gateway

NODE_NAME_SET 

Message from node to signal its own custom node name

NODE_NAME_RESULT 

Message from gateway to get result after set node name

CLIENT_HELLO 

ClientHello message from node

SERVER_HELLO 

ServerHello message from gateway

INVALIDATE_KEY 

InvalidateKey message from gateway

Definition at line 35 of file EnigmaIOTNode.h.

◆ nodePayloadEncoding_t

Enumerator
RAW 

Raw data without specific format

CAYENNELPP 

CayenneLPP packed data

PROT_BUF 

Data packed using Protocol Buffers. NOT IMPLEMENTED

MSG_PACK 

Data packed using MessagePack

BSON 

Data packed using BSON. NOT IMPLEMENTED

CBOR 

Data packed using CBOR. NOT IMPLEMENTED

SMILE 

Data packed using SMILE. NOT IMPLEMENTED

Definition at line 51 of file EnigmaIOTNode.h.

Variable Documentation

◆ EnigmaIOTNode

EnigmaIOTNodeClass EnigmaIOTNode

Definition at line 2229 of file EnigmaIOTNode.cpp.