terminal settings page and backend

This commit is contained in:
2017-07-23 14:59:59 +02:00
parent 3c202a1f50
commit 5f3cb6685d
17 changed files with 694 additions and 442 deletions
+22
View File
@@ -0,0 +1,22 @@
//
// Created by MightyPork on 2017/07/23.
//
#ifndef ESP_VT100_FIRMWARE_HELPERS_H
#define ESP_VT100_FIRMWARE_HELPERS_H
// strcpy that adds 0 at the end of the buffer. Returns void.
#define strncpy_safe(dst, src, n) do { strncpy((char *)(dst), (char *)(src), (n)); (dst)[(n)-1]=0; } while (0)
/**
* Convert IP hex to arguments for printf.
* Library IP2STR(ip) does not work correctly due to unaligned memory access.
*/
#define GOOD_IP2STR(ip) ((ip)>>0)&0xff, ((ip)>>8)&0xff, ((ip)>>16)&0xff, ((ip)>>24)&0xff
/**
* Helper that retrieves an arg from `connData->getArgs` and stores it in `buff`. Returns 1 on success
*/
#define GET_ARG(key) (httpdFindArg(connData->getArgs, key, buff, sizeof(buff)) > 0)
#endif //ESP_VT100_FIRMWARE_HELPERS_H