|
EnigmaIOT
0.9.3
Secure sensor and gateway platform based on ESP8266 and ESP32
|
Auxiliary function definition. More...
#include "helperFunctions.h"Go to the source code of this file.
Macros | |
| #define | MAX_STR_LEN 1000 |
| Key length used by selected crypto algorythm. More... | |
| #define | MACSTR "%02X:%02X:%02X:%02X:%02X:%02X" |
Functions | |
| char * | printHexBuffer (const uint8_t *buffer, uint16_t len) |
| Debug helper function that generates a string that represent a buffer hexadecimal values. More... | |
| void | initWiFi (uint8_t channel, const char *networkName, const char *networkKey, uint8_t role) |
| Initalizes WiFi interfaces on ESP8266 or ESP32. More... | |
| uint32_t | calculateCRC32 (const uint8_t *data, size_t length) |
| Calculates CRC32 of a buffer. More... | |
| char * | mac2str (const uint8_t *mac, char *buffer) |
| Debug helper function that generates a string that represent a MAC address. More... | |
| uint8_t * | str2mac (const char *macAddrString, uint8_t *macBytes) |
| Debug helper function that creates MAC address byte array from text representation. More... | |
| #define MACSTR "%02X:%02X:%02X:%02X:%02X:%02X" |
Definition at line 83 of file helperFunctions.cpp.
| #define MAX_STR_LEN 1000 |
Key length used by selected crypto algorythm.
Definition at line 16 of file helperFunctions.cpp.
| uint32_t calculateCRC32 | ( | const uint8_t * | data, |
| size_t | length | ||
| ) |
Calculates CRC32 of a buffer.
| data | Input buffer |
| length | Input length |
Definition at line 63 of file helperFunctions.cpp.
| void initWiFi | ( | uint8_t | channel, |
| const char * | networkName, | ||
| const char * | networkKey = NULL, |
||
| uint8_t | role = 0 |
||
| ) |
Initalizes WiFi interfaces on ESP8266 or ESP32.
| channel | WiFi channel for interface initialization |
| role | 0 for node, 1 for gateway |
| networkName | Name that gateway AP will take |
Definition at line 31 of file helperFunctions.cpp.
| char* mac2str | ( | const uint8_t * | mac, |
| char * | buffer | ||
| ) |
Debug helper function that generates a string that represent a MAC address.
| mac | Pointer to the MAC address |
| buffer | Buffer that will store resulting address. It must be 18 bytes long at least |
Definition at line 84 of file helperFunctions.cpp.
| char* printHexBuffer | ( | const uint8_t * | buffer, |
| uint16_t | len | ||
| ) |
Debug helper function that generates a string that represent a buffer hexadecimal values.
| buffer | Pointer to the buffer |
| len | Buffer length in number of bytes |
String has to be used inmediatelly. At least before calling printHexBuffer() again as it uses a static buffer to hold string. It will be overwritten on next call.
Definition at line 17 of file helperFunctions.cpp.
| uint8_t* str2mac | ( | const char * | mac, |
| uint8_t * | values | ||
| ) |
Debug helper function that creates MAC address byte array from text representation.
| mac | Pointer to the MAC address string |
| values | Buffer that will store byte array. It must be 6 bytes long at least |
values input buffer after writting MAC address Definition at line 94 of file helperFunctions.cpp.
1.8.18