EnigmaIOT  0.9.8
Secure sensor and gateway platform based on ESP8266 and ESP32
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
helperFunctions.h
Go to the documentation of this file.
1 
9 #ifndef _HELPERFUNCTIONS_h
10 #define _HELPERFUNCTIONS_h
11 
12 
13 #if defined(ARDUINO) && ARDUINO >= 100
14 #include "Arduino.h"
15 #else
16 #include "WProgram.h"
17 #endif
18 #if defined(ESP8266)
19 #include <ESP8266WiFi.h>
20 #elif defined(ESP32)
21 #include <WiFi.h>
22 #endif
23 #include "EnigmaIoTconfig.h"
24 #include "EnigmaIOTdebug.h"
25 
35 char* printHexBuffer (const uint8_t* buffer, uint16_t len);
36 
43 char* mac2str (const uint8_t* mac, char* extBuffer = NULL);
44 
51 uint8_t* str2mac (const char* mac, uint8_t* values);
52 
60 void initWiFi (uint8_t channel, const char* networkName, const char* networkKey = NULL, uint8_t role = 0);
61 
68 uint32_t calculateCRC32 (const uint8_t* data, size_t length);
69 
75 bool isNumber (const char* input);
76 
83 bool isNumber (const char* input, size_t len);
84 
90 bool isNumber (String input);
91 
92 #endif
93 
EnigmaIoTconfig.h
Parameter configuration.
mac2str
char * mac2str(const uint8_t *mac, char *extBuffer=NULL)
Debug helper function that generates a string that represent a MAC address.
Definition: helperFunctions.cpp:85
initWiFi
void initWiFi(uint8_t channel, const char *networkName, const char *networkKey=NULL, uint8_t role=0)
Initalizes WiFi interfaces on ESP8266 or ESP32.
Definition: helperFunctions.cpp:32
calculateCRC32
uint32_t calculateCRC32(const uint8_t *data, size_t length)
Calculates CRC32 of a buffer.
Definition: helperFunctions.cpp:64
printHexBuffer
char * printHexBuffer(const uint8_t *buffer, uint16_t len)
Debug helper function that generates a string that represent a buffer hexadecimal values.
Definition: helperFunctions.cpp:16
str2mac
uint8_t * str2mac(const char *mac, uint8_t *values)
Debug helper function that creates MAC address byte array from text representation.
Definition: helperFunctions.cpp:104
data
@ data
Definition: GwOutput_generic.h:23
isNumber
bool isNumber(const char *input)
Checks if input string is numeric.
Definition: helperFunctions.cpp:169
EnigmaIOTdebug.h
Auxiliary functions for debugging over Serial.