|
EnigmaIOT
0.9.8
Secure sensor and gateway platform based on ESP8266 and ESP32
|
Auxiliary function definition. More...
Go to the source code of this file.
Functions | |
| char * | printHexBuffer (const uint8_t *buffer, uint16_t len) |
| Debug helper function that generates a string that represent a buffer hexadecimal values. More... | |
| char * | mac2str (const uint8_t *mac, char *extBuffer=NULL) |
| Debug helper function that generates a string that represent a MAC address. More... | |
| uint8_t * | str2mac (const char *mac, uint8_t *values) |
| Debug helper function that creates MAC address byte array from text representation. More... | |
| void | initWiFi (uint8_t channel, const char *networkName, const char *networkKey=NULL, uint8_t role=0) |
| Initalizes WiFi interfaces on ESP8266 or ESP32. More... | |
| uint32_t | calculateCRC32 (const uint8_t *data, size_t length) |
| Calculates CRC32 of a buffer. More... | |
| bool | isNumber (const char *input) |
| Checks if input string is numeric. More... | |
| bool | isNumber (const char *input, size_t len) |
| Checks if input string is numeric. More... | |
| bool | isNumber (String input) |
| Checks if input string is numeric. More... | |
| uint32_t calculateCRC32 | ( | const uint8_t * | data, |
| size_t | length | ||
| ) |
Calculates CRC32 of a buffer.
| data | Input buffer |
| length | Input length |
Definition at line 64 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 |
| networkKey | Network key. This is not required normally as this is provided using configuration web portal |
Definition at line 32 of file helperFunctions.cpp.
| bool isNumber | ( | const char * | input | ) |
Checks if input string is numeric.
| input | String to check |
true if string is a number Definition at line 169 of file helperFunctions.cpp.
| bool isNumber | ( | const char * | input, |
| size_t | len | ||
| ) |
Checks if input string is numeric.
| input | String to check |
| len | String length |
true if string is a number Definition at line 186 of file helperFunctions.cpp.
| bool isNumber | ( | String | input | ) |
Checks if input string is numeric.
| input | String to check |
true if string is a number Definition at line 202 of file helperFunctions.cpp.
| char* mac2str | ( | const uint8_t * | mac, |
| char * | extBuffer = NULL |
||
| ) |
Debug helper function that generates a string that represent a MAC address.
| mac | Pointer to the MAC address |
| extBuffer | Buffer that will store resulting address. It must be 18 bytes long at least. If it is NULL a static buffer will be used |
Definition at line 85 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 16 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 104 of file helperFunctions.cpp.