tamper detection
This commit is contained in:
parent
23911f60a4
commit
64564023ca
|
@ -15,7 +15,7 @@ board = wt32-eth01
|
||||||
framework = arduino
|
framework = arduino
|
||||||
lib_deps = siwats/ESPMegaPROR3@^2.9.4
|
lib_deps = siwats/ESPMegaPROR3@^2.9.4
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
build_flags = -DCORE_DEBUG_LEVEL=0 -DSW_VERSION='"cud-3.0.4-duct"' -DBOARD_MODEL='"ESPMegaPRO R3.3c"' -DAC_TYPE=AC_TYPE_DUCTED
|
build_flags = -DCORE_DEBUG_LEVEL=0 -DSW_VERSION='"cud-3.0.5-duct"' -DBOARD_MODEL='"ESPMegaPRO R3.3c"' -DAC_TYPE=AC_TYPE_DUCTED
|
||||||
|
|
||||||
; Ceiling A/C Variant (and newer ducted models)
|
; Ceiling A/C Variant (and newer ducted models)
|
||||||
[env:satitm-ceiling]
|
[env:satitm-ceiling]
|
||||||
|
@ -24,4 +24,4 @@ board = wt32-eth01
|
||||||
framework = arduino
|
framework = arduino
|
||||||
lib_deps = siwats/ESPMegaPROR3@^2.9.4
|
lib_deps = siwats/ESPMegaPROR3@^2.9.4
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
build_flags = -DCORE_DEBUG_LEVEL=0 -DSW_VERSION='"cud-3.0.4-ceiling"' -DBOARD_MODEL='"ESPMegaPRO R3.3c"' -DAC_TYPE=AC_TYPE_CEILING
|
build_flags = -DCORE_DEBUG_LEVEL=0 -DSW_VERSION='"cud-3.0.5-ceiling"' -DBOARD_MODEL='"ESPMegaPRO R3.3c"' -DAC_TYPE=AC_TYPE_CEILING
|
|
@ -60,6 +60,7 @@
|
||||||
* Display Configuration *
|
* Display Configuration *
|
||||||
***********************************************/
|
***********************************************/
|
||||||
// UART Configuration
|
// UART Configuration
|
||||||
|
#define TAMPER_DETECTION
|
||||||
#define INTERNAL_DISPLAY_UART Serial
|
#define INTERNAL_DISPLAY_UART Serial
|
||||||
#define INTERNAL_DISPLAY_BAUDRATE 115200
|
#define INTERNAL_DISPLAY_BAUDRATE 115200
|
||||||
#define DISPLAY_UART Serial1
|
#define DISPLAY_UART Serial1
|
||||||
|
|
21
src/main.cpp
21
src/main.cpp
|
@ -122,6 +122,10 @@ void setup()
|
||||||
espmega.iot->registerMqttCallback(handle_mqtt_message);
|
espmega.iot->registerMqttCallback(handle_mqtt_message);
|
||||||
cudDisplayOTA.begin("/cuddisp", &cudDisplay, espmega.webServer);
|
cudDisplayOTA.begin("/cuddisp", &cudDisplay, espmega.webServer);
|
||||||
internalDisplayOTA.begin("/intdisp", espmega.display, espmega.webServer);
|
internalDisplayOTA.begin("/intdisp", espmega.display, espmega.webServer);
|
||||||
|
#ifdef TAMPER_DETECTION
|
||||||
|
espmega.display->registerPageChangeCallback(pageChangeCallback);
|
||||||
|
espmega.display->registerTouchCallback(touchCallback);
|
||||||
|
#endif
|
||||||
ESP_LOGI("CUD IoT OS", "Initialization Complete");
|
ESP_LOGI("CUD IoT OS", "Initialization Complete");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,4 +154,19 @@ void handle_input_change(uint8_t pin, bool state)
|
||||||
void handle_mqtt_message(char *topic, char *payload)
|
void handle_mqtt_message(char *topic, char *payload)
|
||||||
{
|
{
|
||||||
ESP_LOGD("CUD IoT OS", "MQTT Message Received: %s, %s", topic, payload);
|
ESP_LOGD("CUD IoT OS", "MQTT Message Received: %s, %s", topic, payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TAMPER_DETECTION
|
||||||
|
void pageChangeCallback(uint8_t page)
|
||||||
|
{
|
||||||
|
char buffer[10];
|
||||||
|
sprintf(buffer, "%d", page);
|
||||||
|
espmega.iot->publishRelative("/tamper/page", buffer);
|
||||||
|
}
|
||||||
|
void touchCallback(uint8_t page, uint8_t component, uint8_t touchType)
|
||||||
|
{
|
||||||
|
char buffer[20];
|
||||||
|
sprintf(buffer, "%d,%d,%d", page, component, touchType);
|
||||||
|
espmega.iot->publishRelative("/tamper/touch", buffer);
|
||||||
|
}
|
||||||
|
#endif
|
|
@ -26,4 +26,9 @@ void setup();
|
||||||
void loop();
|
void loop();
|
||||||
void send_stop_bytes(HardwareSerial &uart);
|
void send_stop_bytes(HardwareSerial &uart);
|
||||||
void handle_input_change(uint8_t pin, bool state);
|
void handle_input_change(uint8_t pin, bool state);
|
||||||
void handle_mqtt_message(char *topic, char *payload);
|
void handle_mqtt_message(char *topic, char *payload);
|
||||||
|
|
||||||
|
#ifdef TAMPER_DETECTION
|
||||||
|
void pageChangeCallback(uint8_t page);
|
||||||
|
void touchCallback(uint8_t page, uint8_t component, uint8_t touchType);
|
||||||
|
#endif
|
Loading…
Reference in New Issue