mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-09-11 17:14:27 +00:00
Merge branch 'mega' of https://github.com/letscontrolit/ESPEasy into feature/P141-add-pcd8544-nokia-5110-display
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
"build": {
|
||||
"arduino":{
|
||||
"ldscript": "esp32_out.ld",
|
||||
"memory_type": "dout_qspi"
|
||||
"memory_type": "dio_qspi"
|
||||
},
|
||||
"core": "esp32",
|
||||
"extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -DHAS_PSRAM_FIX -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_4M",
|
||||
"f_cpu": "240000000L",
|
||||
"f_flash": "80000000L",
|
||||
"flash_mode": "dout",
|
||||
"flash_mode": "dio",
|
||||
"mcu": "esp32",
|
||||
"variant": "esp32",
|
||||
"partitions": "esp32_partition_app1810k_spiffs316k.csv"
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
"build": {
|
||||
"arduino":{
|
||||
"ldscript": "esp32_out.ld",
|
||||
"memory_type": "dout_qspi"
|
||||
"memory_type": "dio_qspi"
|
||||
},
|
||||
"core": "esp32",
|
||||
"extra_flags": "-DARDUINO_M5STACK_Core2 -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_16M",
|
||||
"f_cpu": "240000000L",
|
||||
"f_flash": "80000000L",
|
||||
"flash_mode": "dout",
|
||||
"flash_mode": "dio",
|
||||
"mcu": "esp32",
|
||||
"variant": "m5stack_core2",
|
||||
"partitions": "esp32_partition_app4096k_spiffs8124k.csv"
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
"build": {
|
||||
"arduino":{
|
||||
"ldscript": "esp32_out.ld",
|
||||
"memory_type": "dout_qspi"
|
||||
"memory_type": "dio_qspi"
|
||||
},
|
||||
"core": "esp32",
|
||||
"extra_flags": "-DARDUINO_ODROID_ESP32 -DBOARD_HAS_PSRAM -DHAS_PSRAM_FIX -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_16M",
|
||||
"f_cpu": "240000000L",
|
||||
"f_flash": "80000000L",
|
||||
"flash_mode": "dout",
|
||||
"flash_mode": "dio",
|
||||
"mcu": "esp32",
|
||||
"variant": "odroid_esp32",
|
||||
"partitions": "esp32_partition_app4096k_spiffs8124k.csv"
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
"build": {
|
||||
"arduino":{
|
||||
"ldscript": "esp32_out.ld",
|
||||
"memory_type": "dout_qspi"
|
||||
"memory_type": "dio_qspi"
|
||||
},
|
||||
"core": "esp32",
|
||||
"extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_16M",
|
||||
"f_cpu": "240000000L",
|
||||
"f_flash": "40000000L",
|
||||
"flash_mode": "dout",
|
||||
"flash_mode": "dio",
|
||||
"mcu": "esp32",
|
||||
"variant": "esp32",
|
||||
"partitions": "esp32_partition_app4096k_spiffs1024k.csv"
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
"build": {
|
||||
"arduino":{
|
||||
"ldscript": "esp32_out.ld",
|
||||
"memory_type": "dout_qspi"
|
||||
"memory_type": "dio_qspi"
|
||||
},
|
||||
"core": "esp32",
|
||||
"extra_flags": "-DARDUINO_ESP32_DEV -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_16M",
|
||||
"f_cpu": "240000000L",
|
||||
"f_flash": "40000000L",
|
||||
"flash_mode": "dout",
|
||||
"flash_mode": "dio",
|
||||
"mcu": "esp32",
|
||||
"variant": "esp32",
|
||||
"partitions": "esp32_partition_app4096k_spiffs8124k.csv"
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
"build": {
|
||||
"arduino":{
|
||||
"ldscript": "esp32_out.ld",
|
||||
"memory_type": "dout_qspi"
|
||||
"memory_type": "dio_qspi"
|
||||
},
|
||||
"core": "esp32",
|
||||
"extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_4M",
|
||||
"f_cpu": "240000000L",
|
||||
"f_flash": "40000000L",
|
||||
"flash_mode": "dout",
|
||||
"flash_mode": "dio",
|
||||
"mcu": "esp32",
|
||||
"variant": "esp32",
|
||||
"partitions": "esp32_partition_app1810k_spiffs316k.csv"
|
||||
@@ -32,6 +32,9 @@
|
||||
"maximum_ram_size": 327680,
|
||||
"maximum_size": 1900544,
|
||||
"require_upload_port": true,
|
||||
"resetmethod": "nodemcu",
|
||||
"before_reset": "default_reset",
|
||||
"after_reset": "hard_reset",
|
||||
"speed": 460800
|
||||
},
|
||||
"url": "https://en.wikipedia.org/wiki/ESP32",
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
"build": {
|
||||
"arduino":{
|
||||
"ldscript": "esp32_out.ld",
|
||||
"memory_type": "dout_qspi"
|
||||
"memory_type": "dio_qspi"
|
||||
},
|
||||
"core": "esp32",
|
||||
"extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_8M",
|
||||
"f_cpu": "240000000L",
|
||||
"f_flash": "40000000L",
|
||||
"flash_mode": "dout",
|
||||
"flash_mode": "dio",
|
||||
"mcu": "esp32",
|
||||
"variant": "esp32",
|
||||
"partitions": "esp32_partition_app2944k_spiffs2M.csv"
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
"build": {
|
||||
"arduino":{
|
||||
"ldscript": "esp32_out.ld",
|
||||
"memory_type": "dout_qspi"
|
||||
"memory_type": "dio_qspi"
|
||||
},
|
||||
"core": "esp32",
|
||||
"extra_flags": "-DARDUINO_ESP32_DEV -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_4M -DCORE32SOLO1",
|
||||
"f_cpu": "80000000L",
|
||||
"f_flash": "40000000L",
|
||||
"flash_mode": "dout",
|
||||
"flash_mode": "dio",
|
||||
"mcu": "esp32",
|
||||
"variant": "esp32",
|
||||
"partitions": "esp32_partition_app1810k_spiffs316k.csv"
|
||||
|
||||
+4
-3
@@ -2,19 +2,20 @@
|
||||
"build": {
|
||||
"arduino":{
|
||||
"ldscript": "esp32c3_out.ld",
|
||||
"memory_type": "dout_qspi"
|
||||
"memory_type": "dio_qspi"
|
||||
},
|
||||
"core": "esp32",
|
||||
"extra_flags": "-DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_4M -DESP32C3",
|
||||
"f_cpu": "160000000L",
|
||||
"f_flash": "80000000L",
|
||||
"flash_mode": "dout",
|
||||
"flash_mode": "dio",
|
||||
"mcu": "esp32c3",
|
||||
"variant": "esp32c3",
|
||||
"partitions": "esp32_partition_app1810k_spiffs316k.csv"
|
||||
},
|
||||
"connectivity": [
|
||||
"wifi"
|
||||
"wifi",
|
||||
"bluetooth"
|
||||
],
|
||||
"debug": {
|
||||
"openocd_target": "esp32c3.cfg"
|
||||
|
||||
+3
-3
@@ -2,13 +2,13 @@
|
||||
"build": {
|
||||
"arduino":{
|
||||
"ldscript": "esp32s2_out.ld",
|
||||
"memory_type": "dout_qspi"
|
||||
"memory_type": "dio_qspi"
|
||||
},
|
||||
"core": "esp32",
|
||||
"extra_flags": "-DBOARD_HAS_PSRAM -DESP32_4M -DESP32S2",
|
||||
"f_cpu": "240000000L",
|
||||
"f_flash": "80000000L",
|
||||
"flash_mode": "dout",
|
||||
"flash_mode": "dio",
|
||||
"mcu": "esp32s2",
|
||||
"variant": "esp32s2",
|
||||
"partitions": "esp32_partition_app1810k_spiffs316k.csv"
|
||||
@@ -27,7 +27,7 @@
|
||||
"upload": {
|
||||
"flash_size": "4MB",
|
||||
"maximum_ram_size": 327680,
|
||||
"maximum_size": 1900544,
|
||||
"maximum_size": 4194304,
|
||||
"require_upload_port": true,
|
||||
"speed": 460800
|
||||
},
|
||||
|
||||
@@ -15,16 +15,14 @@
|
||||
"wifi"
|
||||
],
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"esp8266-rtos-sdk",
|
||||
"esp8266-nonos-sdk"
|
||||
"arduino"
|
||||
],
|
||||
"name": "Espressif Generic ESP8266 ESPEasy 16M Flash 14M FS",
|
||||
"upload": {
|
||||
"maximum_ram_size": 81920,
|
||||
"maximum_size": 1040316,
|
||||
"require_upload_port": true,
|
||||
"resetmethod": "ck",
|
||||
"resetmethod": "nodemcu",
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
|
||||
|
||||
@@ -15,16 +15,14 @@
|
||||
"wifi"
|
||||
],
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"esp8266-rtos-sdk",
|
||||
"esp8266-nonos-sdk"
|
||||
"arduino"
|
||||
],
|
||||
"name": "Espressif Generic ESP8266 ESPEasy 1M Flash 128k FS",
|
||||
"upload": {
|
||||
"maximum_ram_size": 81920,
|
||||
"maximum_size": 892912,
|
||||
"require_upload_port": true,
|
||||
"resetmethod": "ck",
|
||||
"resetmethod": "nodemcu",
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
|
||||
|
||||
@@ -15,16 +15,14 @@
|
||||
"wifi"
|
||||
],
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"esp8266-rtos-sdk",
|
||||
"esp8266-nonos-sdk"
|
||||
"arduino"
|
||||
],
|
||||
"name": "Espressif Generic ESP8266 ESPEasy 1M Flash 128k FS",
|
||||
"upload": {
|
||||
"maximum_ram_size": 81920,
|
||||
"maximum_size": 616448,
|
||||
"require_upload_port": true,
|
||||
"resetmethod": "ck",
|
||||
"resetmethod": "nodemcu",
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
|
||||
|
||||
@@ -15,16 +15,14 @@
|
||||
"wifi"
|
||||
],
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"esp8266-rtos-sdk",
|
||||
"esp8266-nonos-sdk"
|
||||
"arduino"
|
||||
],
|
||||
"name": "Espressif Generic ESP8266 ESPEasy 1M sketch 1M FS",
|
||||
"upload": {
|
||||
"maximum_ram_size": 81920,
|
||||
"maximum_size": 1040316,
|
||||
"require_upload_port": true,
|
||||
"resetmethod": "ck",
|
||||
"resetmethod": "nodemcu",
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
|
||||
|
||||
@@ -15,16 +15,14 @@
|
||||
"wifi"
|
||||
],
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"esp8266-rtos-sdk",
|
||||
"esp8266-nonos-sdk"
|
||||
"arduino"
|
||||
],
|
||||
"name": "Espressif Generic ESP8266 ESPEasy 2M Flash 256k FS",
|
||||
"upload": {
|
||||
"maximum_ram_size": 81920,
|
||||
"maximum_size": 1040316,
|
||||
"require_upload_port": true,
|
||||
"resetmethod": "ck",
|
||||
"resetmethod": "nodemcu",
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
|
||||
|
||||
@@ -15,16 +15,14 @@
|
||||
"wifi"
|
||||
],
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"esp8266-rtos-sdk",
|
||||
"esp8266-nonos-sdk"
|
||||
"arduino"
|
||||
],
|
||||
"name": "Espressif Generic ESP8266 ESPEasy 4M Flash 1M FS",
|
||||
"upload": {
|
||||
"maximum_ram_size": 81920,
|
||||
"maximum_size": 1040316,
|
||||
"require_upload_port": true,
|
||||
"resetmethod": "ck",
|
||||
"resetmethod": "nodemcu",
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
|
||||
|
||||
@@ -15,16 +15,14 @@
|
||||
"wifi"
|
||||
],
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"esp8266-rtos-sdk",
|
||||
"esp8266-nonos-sdk"
|
||||
"arduino"
|
||||
],
|
||||
"name": "Espressif Generic ESP8266 ESPEasy 4M Flash 2M FS",
|
||||
"upload": {
|
||||
"maximum_ram_size": 81920,
|
||||
"maximum_size": 1040316,
|
||||
"require_upload_port": true,
|
||||
"resetmethod": "ck",
|
||||
"resetmethod": "nodemcu",
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
|
||||
|
||||
@@ -15,16 +15,14 @@
|
||||
"wifi"
|
||||
],
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"esp8266-rtos-sdk",
|
||||
"esp8266-nonos-sdk"
|
||||
"arduino"
|
||||
],
|
||||
"name": "Espressif Generic ESP8266 ESPEasy 4M Flash 3M FS",
|
||||
"upload": {
|
||||
"maximum_ram_size": 81920,
|
||||
"maximum_size": 1040316,
|
||||
"require_upload_port": true,
|
||||
"resetmethod": "ck",
|
||||
"resetmethod": "nodemcu",
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
|
||||
|
||||
@@ -15,16 +15,14 @@
|
||||
"wifi"
|
||||
],
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"esp8266-rtos-sdk",
|
||||
"esp8266-nonos-sdk"
|
||||
"arduino"
|
||||
],
|
||||
"name": "Sonoff ZbBridge ESPEasy 2M Flash 256k FS",
|
||||
"upload": {
|
||||
"maximum_ram_size": 81920,
|
||||
"maximum_size": 1040316,
|
||||
"require_upload_port": true,
|
||||
"resetmethod": "ck",
|
||||
"resetmethod": "nodemcu",
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "https://templates.blakadder.com/sonoff_ZBBridge.html",
|
||||
|
||||
@@ -15,16 +15,14 @@
|
||||
"wifi"
|
||||
],
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"esp8266-rtos-sdk",
|
||||
"esp8266-nonos-sdk"
|
||||
"arduino"
|
||||
],
|
||||
"name": "Espressif Generic ESP8285 ESPEasy 1M Flash 128k FS",
|
||||
"upload": {
|
||||
"maximum_ram_size": 81920,
|
||||
"maximum_size": 892912,
|
||||
"require_upload_port": true,
|
||||
"resetmethod": "ck",
|
||||
"resetmethod": "nodemcu",
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
|
||||
|
||||
@@ -15,16 +15,14 @@
|
||||
"wifi"
|
||||
],
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"esp8266-rtos-sdk",
|
||||
"esp8266-nonos-sdk"
|
||||
"arduino"
|
||||
],
|
||||
"name": "Espressif Generic ESP8285 ESPEasy 1M Flash 128k FS",
|
||||
"upload": {
|
||||
"maximum_ram_size": 81920,
|
||||
"maximum_size": 616448,
|
||||
"require_upload_port": true,
|
||||
"resetmethod": "ck",
|
||||
"resetmethod": "nodemcu",
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
Some display types may limit or extend the maximum accepted size.
|
||||
"
|
||||
"
|
||||
``<trigger>,txtfull,<x>,<y>,<size=1>,<foreColor=current>,<backColor=foreColor>,<textPrintMode=current>,<maxTextWidthPixels=0>,<text>``
|
||||
``<trigger>,txtfull,<x>,<y>,<size=1>,<foreColor=current>,<backColor=foreColor>, <textPrintMode=current>,<maxTextWidthPixels=0>,<text>``
|
||||
","
|
||||
Write text at position X/Y with all options. Depending on the setting **Text Coordinates in col/row**, these coordinates are pixels (default) or column/rows.
|
||||
|
||||
@@ -252,7 +252,7 @@
|
||||
The file can be read from SD-card, when available, and the bmp file is not found on the internal file storage.
|
||||
"
|
||||
"
|
||||
``<trigger>,btn,<state>,<mode>,<x>,<y>,<w>,<h>,<id>,<type>,<ONcolor=blue>,<OFFcolor=red>,<CaptionColor=white>,<fontsize>,<ONcaption>,<OFFcaption>,<BorderColor=white>,<DisabledColor=0x9410>,<DisabledCaptionColor=0x5A69>,<TaskIndex>,<Group>,<SelectGroup>,<objectname>``
|
||||
``<trigger>,btn,<state>,<mode>,<x>,<y>,<w>,<h>,<id>,<type>,<ONcolor=blue>,<OFFcolor=red>, <CaptionColor=white>,<fontsize>,<ONcaption>,<OFFcaption>,<BorderColor=white>, <DisabledColor=0x9410>,<DisabledCaptionColor=0x5A69>,<TaskIndex>,<Group>, <SelectGroup>,<objectname>``
|
||||
","
|
||||
As a companion to the ESPEasy_TouchHelper, the AdafruitGFX_helper takes care of drawing button objects via this subcommand.
|
||||
|
||||
|
||||
@@ -653,6 +653,8 @@ P095 :ref:`P095_page`
|
||||
|
||||
.. include:: ../Plugin/P095_commands.repl
|
||||
|
||||
See also the :ref:`AdafruitGFX Helper commands <AdafruitGFX Helper commands>`, below.
|
||||
|
||||
P099 :ref:`P099_page`
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -670,13 +672,18 @@ P104 :ref:`P104_page`
|
||||
|
||||
.. include:: ../Plugin/P104_commands.repl
|
||||
|
||||
|
||||
|
||||
P115 :ref:`P115_page`
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. include:: ../Plugin/P115_commands.repl
|
||||
|
||||
P116 :ref:`P116_page`
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. include:: ../Plugin/P116_commands.repl
|
||||
|
||||
See also the :ref:`AdafruitGFX Helper commands <AdafruitGFX Helper commands>`, below.
|
||||
|
||||
P117 :ref:`P117_page`
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -707,7 +714,27 @@ P129 :ref:`P129_page`
|
||||
|
||||
.. include:: ../Plugin/P129_commands.repl
|
||||
|
||||
P131 :ref:`P131_page`
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. include:: ../Plugin/P131_commands.repl
|
||||
|
||||
See also the :ref:`AdafruitGFX Helper commands <AdafruitGFX Helper commands>`, below.
|
||||
|
||||
P141 :ref:`P141_page`
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. include:: ../Plugin/P141_commands.repl
|
||||
|
||||
|
||||
.. .. *** Insert regular plugin commands above this remark! ***
|
||||
|
||||
.. _AdafruitGFX Helper commands:
|
||||
|
||||
AdafruitGFX Helper commands
|
||||
---------------------------
|
||||
|
||||
For all displays that use the AdafruitGFX Helper, these commands are available in addition to the display-specific commands:
|
||||
|
||||
.. include:: ../Plugin/AdaGFX_commands.repl
|
||||
|
||||
|
||||
@@ -82,9 +82,9 @@
|
||||
/** C standard macros **/
|
||||
#ifndef NULL
|
||||
#ifdef __cplusplus
|
||||
#define NULL 0
|
||||
#define NULL nullptr
|
||||
#else
|
||||
#define NULL ((void *) 0)
|
||||
#define NULL nullptr
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
+136
-134
@@ -280,7 +280,9 @@ IRTEXT_CONST_STRING(kDg11j13aStr, D_STR_DG11J13A); ///< "DG11J13A"
|
||||
IRTEXT_CONST_STRING(kDg11j104Str, D_STR_DG11J104); ///< "DG11J104"
|
||||
IRTEXT_CONST_STRING(kDg11j191Str, D_STR_DG11J191); ///< "DG11J191"
|
||||
|
||||
#define D_STR_UNSUPPORTED "?" // Unsupported protocols will be showing as a question mark, check for length > 1 to show only currently included protocols
|
||||
#define D_STR_UNSUPPORTED "?" // Unsupported protocols will be showing as
|
||||
// a question mark, check for length > 1
|
||||
// to show only currently included protocols
|
||||
// Protocol Names
|
||||
// Needs to be in decode_type_t order.
|
||||
IRTEXT_CONST_BLOB_DECL(kAllProtocolNamesStr) {
|
||||
@@ -289,612 +291,612 @@ IRTEXT_CONST_BLOB_DECL(kAllProtocolNamesStr) {
|
||||
D_STR_RC5 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_RC5 || SEND_RC5
|
||||
#if DECODE_RC6 || SEND_RC6
|
||||
D_STR_RC6 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_RC6 || SEND_RC6
|
||||
#if DECODE_NEC || SEND_NEC
|
||||
D_STR_NEC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_NEC || SEND_NEC
|
||||
#if DECODE_SONY || SEND_SONY
|
||||
D_STR_SONY "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_SONY || SEND_SONY
|
||||
#if DECODE_PANASONIC || SEND_PANASONIC
|
||||
D_STR_PANASONIC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_PANASONIC || SEND_PANASONIC
|
||||
#if DECODE_JVC || SEND_JVC
|
||||
D_STR_JVC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_JVC || SEND_JVC
|
||||
#if DECODE_SAMSUNG || SEND_SAMSUNG
|
||||
D_STR_SAMSUNG "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_SAMSUNG || SEND_SAMSUNG
|
||||
#if DECODE_WHYNTER || SEND_WHYNTER
|
||||
D_STR_WHYNTER "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_WHYNTER || SEND_WHYNTER
|
||||
#if DECODE_AIWA_RC_T501 || SEND_AIWA_RC_T501
|
||||
D_STR_AIWA_RC_T501 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_AIWA_RC_T501 || SEND_AIWA_RC_T501
|
||||
#if DECODE_LG || SEND_LG
|
||||
D_STR_LG "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_LG || SEND_LG
|
||||
#if DECODE_SANYO || SEND_SANYO
|
||||
D_STR_SANYO "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_SANYO || SEND_SANYO
|
||||
#if DECODE_MITSUBISHI || SEND_MITSUBISHI
|
||||
D_STR_MITSUBISHI "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_MITSUBISHI || SEND_MITSUBISHI
|
||||
#if DECODE_DISH || SEND_DISH
|
||||
D_STR_DISH "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_DISH || SEND_DISH
|
||||
#if DECODE_SHARP || SEND_SHARP
|
||||
D_STR_SHARP "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_SHARP || SEND_SHARP
|
||||
#if DECODE_COOLIX || SEND_COOLIX
|
||||
D_STR_COOLIX "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_COOLIX || SEND_COOLIX
|
||||
#if DECODE_DAIKIN || SEND_DAIKIN
|
||||
D_STR_DAIKIN "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_DAIKIN || SEND_DAIKIN
|
||||
#if DECODE_DENON || SEND_DENON
|
||||
D_STR_DENON "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_DENON || SEND_DENON
|
||||
#if DECODE_KELVINATOR || SEND_KELVINATOR
|
||||
D_STR_KELVINATOR "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#if SEND_SHERWOOD // SEND-ONLY
|
||||
#endif // if DECODE_KELVINATOR || SEND_KELVINATOR
|
||||
#if SEND_SHERWOOD // SEND-ONLY
|
||||
D_STR_SHERWOOD "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if SEND_SHERWOOD
|
||||
#if DECODE_MITSUBISHI_AC || SEND_MITSUBISHI_AC
|
||||
D_STR_MITSUBISHI_AC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_MITSUBISHI_AC || SEND_MITSUBISHI_AC
|
||||
#if DECODE_RCMM || SEND_RCMM
|
||||
D_STR_RCMM "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#if DECODE_SANYO_LC7461 || SEND_SANYO_LC7461
|
||||
#endif // if DECODE_RCMM || SEND_RCMM
|
||||
#if DECODE_SANYO || SEND_SANYO
|
||||
D_STR_SANYO_LC7461 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#if DECODE_RC5X || SEND_RC5X
|
||||
#endif // if DECODE_SANYO || SEND_SANYO
|
||||
#if DECODE_RC5 || SEND_RC5
|
||||
D_STR_RC5X "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_RC5 || SEND_RC5
|
||||
#if DECODE_GREE || SEND_GREE
|
||||
D_STR_GREE "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#if SEND_PRONTO // SEND-ONLY
|
||||
#endif // if DECODE_GREE || SEND_GREE
|
||||
#if SEND_PRONTO // SEND-ONLY
|
||||
D_STR_PRONTO "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#if DECODE_NEC_LIKE || SEND_NEC_LIKE
|
||||
#endif // if SEND_PRONTO
|
||||
#if DECODE_NEC || SEND_NEC
|
||||
D_STR_NEC_LIKE "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_NEC || SEND_NEC
|
||||
#if DECODE_ARGO || SEND_ARGO
|
||||
D_STR_ARGO "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_ARGO || SEND_ARGO
|
||||
#if DECODE_TROTEC || SEND_TROTEC
|
||||
D_STR_TROTEC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_TROTEC || SEND_TROTEC
|
||||
#if DECODE_NIKAI || SEND_NIKAI
|
||||
D_STR_NIKAI "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#if SEND_RAW // SEND-ONLY
|
||||
#endif // if DECODE_NIKAI || SEND_NIKAI
|
||||
#if SEND_RAW // SEND-ONLY
|
||||
D_STR_RAW "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#if SEND_GLOBALCACHE // SEND-ONLY
|
||||
#endif // if SEND_RAW
|
||||
#if SEND_GLOBALCACHE // SEND-ONLY
|
||||
D_STR_GLOBALCACHE "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if SEND_GLOBALCACHE
|
||||
#if DECODE_TOSHIBA_AC || SEND_TOSHIBA_AC
|
||||
D_STR_TOSHIBA_AC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_TOSHIBA_AC || SEND_TOSHIBA_AC
|
||||
#if DECODE_FUJITSU_AC || SEND_FUJITSU_AC
|
||||
D_STR_FUJITSU_AC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_FUJITSU_AC || SEND_FUJITSU_AC
|
||||
#if DECODE_MIDEA || SEND_MIDEA
|
||||
D_STR_MIDEA "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_MIDEA || SEND_MIDEA
|
||||
#if DECODE_MAGIQUEST || SEND_MAGIQUEST
|
||||
D_STR_MAGIQUEST "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_MAGIQUEST || SEND_MAGIQUEST
|
||||
#if DECODE_LASERTAG || SEND_LASERTAG
|
||||
D_STR_LASERTAG "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_LASERTAG || SEND_LASERTAG
|
||||
#if DECODE_CARRIER_AC || SEND_CARRIER_AC
|
||||
D_STR_CARRIER_AC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_CARRIER_AC || SEND_CARRIER_AC
|
||||
#if DECODE_HAIER_AC || SEND_HAIER_AC
|
||||
D_STR_HAIER_AC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_HAIER_AC || SEND_HAIER_AC
|
||||
#if DECODE_MITSUBISHI2 || SEND_MITSUBISHI2
|
||||
D_STR_MITSUBISHI2 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_MITSUBISHI2 || SEND_MITSUBISHI2
|
||||
#if DECODE_HITACHI_AC || SEND_HITACHI_AC
|
||||
D_STR_HITACHI_AC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_HITACHI_AC || SEND_HITACHI_AC
|
||||
#if DECODE_HITACHI_AC1 || SEND_HITACHI_AC1
|
||||
D_STR_HITACHI_AC1 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_HITACHI_AC1 || SEND_HITACHI_AC1
|
||||
#if DECODE_HITACHI_AC2 || SEND_HITACHI_AC2
|
||||
D_STR_HITACHI_AC2 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_HITACHI_AC2 || SEND_HITACHI_AC2
|
||||
#if DECODE_GICABLE || SEND_GICABLE
|
||||
D_STR_GICABLE "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_GICABLE || SEND_GICABLE
|
||||
#if DECODE_HAIER_AC_YRW02 || SEND_HAIER_AC_YRW02
|
||||
D_STR_HAIER_AC_YRW02 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_HAIER_AC_YRW02 || SEND_HAIER_AC_YRW02
|
||||
#if DECODE_WHIRLPOOL_AC || SEND_WHIRLPOOL_AC
|
||||
D_STR_WHIRLPOOL_AC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_WHIRLPOOL_AC || SEND_WHIRLPOOL_AC
|
||||
#if DECODE_SAMSUNG_AC || SEND_SAMSUNG_AC
|
||||
D_STR_SAMSUNG_AC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_SAMSUNG_AC || SEND_SAMSUNG_AC
|
||||
#if DECODE_LUTRON || SEND_LUTRON
|
||||
D_STR_LUTRON "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_LUTRON || SEND_LUTRON
|
||||
#if DECODE_ELECTRA_AC || SEND_ELECTRA_AC
|
||||
D_STR_ELECTRA_AC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_ELECTRA_AC || SEND_ELECTRA_AC
|
||||
#if DECODE_PANASONIC_AC || SEND_PANASONIC_AC
|
||||
D_STR_PANASONIC_AC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_PANASONIC_AC || SEND_PANASONIC_AC
|
||||
#if DECODE_PIONEER || SEND_PIONEER
|
||||
D_STR_PIONEER "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#if DECODE_LG2 || SEND_LG2
|
||||
#endif // if DECODE_PIONEER || SEND_PIONEER
|
||||
#if DECODE_LG || SEND_LG
|
||||
D_STR_LG2 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_LG || SEND_LG
|
||||
#if DECODE_MWM || SEND_MWM
|
||||
D_STR_MWM "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_MWM || SEND_MWM
|
||||
#if DECODE_DAIKIN2 || SEND_DAIKIN2
|
||||
D_STR_DAIKIN2 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_DAIKIN2 || SEND_DAIKIN2
|
||||
#if DECODE_VESTEL_AC || SEND_VESTEL_AC
|
||||
D_STR_VESTEL_AC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_VESTEL_AC || SEND_VESTEL_AC
|
||||
#if DECODE_TECO || SEND_TECO
|
||||
D_STR_TECO "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_TECO || SEND_TECO
|
||||
#if DECODE_SAMSUNG36 || SEND_SAMSUNG36
|
||||
D_STR_SAMSUNG36 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_SAMSUNG36 || SEND_SAMSUNG36
|
||||
#if DECODE_TCL112AC || SEND_TCL112AC
|
||||
D_STR_TCL112AC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_TCL112AC || SEND_TCL112AC
|
||||
#if DECODE_LEGOPF || SEND_LEGO
|
||||
D_STR_LEGOPF "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#if DECODE_MITSUBISHI_HEAVY || SEND_MITSUBISHI_HEAVY // Exception
|
||||
#endif // if DECODE_LEGOPF || SEND_LEGO
|
||||
#if DECODE_MITSUBISHIHEAVY || SEND_MITSUBISHIHEAVY // Exception
|
||||
D_STR_MITSUBISHI_HEAVY_88 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#if DECODE_MITSUBISHI_HEAVY || SEND_MITSUBISHI_HEAVY // Exception
|
||||
#endif // if DECODE_MITSUBISHIHEAVY || SEND_MITSUBISHIHEAVY
|
||||
#if DECODE_MITSUBISHIHEAVY || SEND_MITSUBISHIHEAVY // Exception
|
||||
D_STR_MITSUBISHI_HEAVY_152 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_MITSUBISHIHEAVY || SEND_MITSUBISHIHEAVY
|
||||
#if DECODE_DAIKIN216 || SEND_DAIKIN216
|
||||
D_STR_DAIKIN216 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_DAIKIN216 || SEND_DAIKIN216
|
||||
#if DECODE_SHARP_AC || SEND_SHARP_AC
|
||||
D_STR_SHARP_AC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_SHARP_AC || SEND_SHARP_AC
|
||||
#if DECODE_GOODWEATHER || SEND_GOODWEATHER
|
||||
D_STR_GOODWEATHER "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_GOODWEATHER || SEND_GOODWEATHER
|
||||
#if DECODE_INAX || SEND_INAX
|
||||
D_STR_INAX "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_INAX || SEND_INAX
|
||||
#if DECODE_DAIKIN160 || SEND_DAIKIN160
|
||||
D_STR_DAIKIN160 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_DAIKIN160 || SEND_DAIKIN160
|
||||
#if DECODE_NEOCLIMA || SEND_NEOCLIMA
|
||||
D_STR_NEOCLIMA "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_NEOCLIMA || SEND_NEOCLIMA
|
||||
#if DECODE_DAIKIN176 || SEND_DAIKIN176
|
||||
D_STR_DAIKIN176 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_DAIKIN176 || SEND_DAIKIN176
|
||||
#if DECODE_DAIKIN128 || SEND_DAIKIN128
|
||||
D_STR_DAIKIN128 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_DAIKIN128 || SEND_DAIKIN128
|
||||
#if DECODE_AMCOR || SEND_AMCOR
|
||||
D_STR_AMCOR "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_AMCOR || SEND_AMCOR
|
||||
#if DECODE_DAIKIN152 || SEND_DAIKIN152
|
||||
D_STR_DAIKIN152 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_DAIKIN152 || SEND_DAIKIN152
|
||||
#if DECODE_MITSUBISHI136 || SEND_MITSUBISHI136
|
||||
D_STR_MITSUBISHI136 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_MITSUBISHI136 || SEND_MITSUBISHI136
|
||||
#if DECODE_MITSUBISHI112 || SEND_MITSUBISHI112
|
||||
D_STR_MITSUBISHI112 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_MITSUBISHI112 || SEND_MITSUBISHI112
|
||||
#if DECODE_HITACHI_AC424 || SEND_HITACHI_AC424
|
||||
D_STR_HITACHI_AC424 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#if SEND_SONY // Exception
|
||||
#endif // if DECODE_HITACHI_AC424 || SEND_HITACHI_AC424
|
||||
#if SEND_SONY // Exception
|
||||
D_STR_SONY_38K "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if SEND_SONY
|
||||
#if DECODE_EPSON || SEND_EPSON
|
||||
D_STR_EPSON "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_EPSON || SEND_EPSON
|
||||
#if DECODE_SYMPHONY || SEND_SYMPHONY
|
||||
D_STR_SYMPHONY "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_SYMPHONY || SEND_SYMPHONY
|
||||
#if DECODE_HITACHI_AC3 || SEND_HITACHI_AC3
|
||||
D_STR_HITACHI_AC3 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_HITACHI_AC3 || SEND_HITACHI_AC3
|
||||
#if DECODE_DAIKIN64 || SEND_DAIKIN64
|
||||
D_STR_DAIKIN64 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_DAIKIN64 || SEND_DAIKIN64
|
||||
#if DECODE_AIRWELL || SEND_AIRWELL
|
||||
D_STR_AIRWELL "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_AIRWELL || SEND_AIRWELL
|
||||
#if DECODE_DELONGHI_AC || SEND_DELONGHI_AC
|
||||
D_STR_DELONGHI_AC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_DELONGHI_AC || SEND_DELONGHI_AC
|
||||
#if DECODE_DOSHISHA || SEND_DOSHISHA
|
||||
D_STR_DOSHISHA "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_DOSHISHA || SEND_DOSHISHA
|
||||
#if DECODE_MULTIBRACKETS || SEND_MULTIBRACKETS
|
||||
D_STR_MULTIBRACKETS "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_MULTIBRACKETS || SEND_MULTIBRACKETS
|
||||
#if DECODE_CARRIER_AC40 || SEND_CARRIER_AC40
|
||||
D_STR_CARRIER_AC40 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_CARRIER_AC40 || SEND_CARRIER_AC40
|
||||
#if DECODE_CARRIER_AC64 || SEND_CARRIER_AC64
|
||||
D_STR_CARRIER_AC64 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_CARRIER_AC64 || SEND_CARRIER_AC64
|
||||
#if DECODE_HITACHI_AC344 || SEND_HITACHI_AC344
|
||||
D_STR_HITACHI_AC344 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_HITACHI_AC344 || SEND_HITACHI_AC344
|
||||
#if DECODE_CORONA_AC || SEND_CORONA_AC
|
||||
D_STR_CORONA_AC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_CORONA_AC || SEND_CORONA_AC
|
||||
#if DECODE_MIDEA24 || SEND_MIDEA24
|
||||
D_STR_MIDEA24 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_MIDEA24 || SEND_MIDEA24
|
||||
#if DECODE_ZEPEAL || SEND_ZEPEAL
|
||||
D_STR_ZEPEAL "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_ZEPEAL || SEND_ZEPEAL
|
||||
#if DECODE_SANYO_AC || SEND_SANYO_AC
|
||||
D_STR_SANYO_AC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_SANYO_AC || SEND_SANYO_AC
|
||||
#if DECODE_VOLTAS || SEND_VOLTAS
|
||||
D_STR_VOLTAS "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_VOLTAS || SEND_VOLTAS
|
||||
#if DECODE_METZ || SEND_METZ
|
||||
D_STR_METZ "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_METZ || SEND_METZ
|
||||
#if DECODE_TRANSCOLD || SEND_TRANSCOLD
|
||||
D_STR_TRANSCOLD "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_TRANSCOLD || SEND_TRANSCOLD
|
||||
#if DECODE_TECHNIBEL_AC || SEND_TECHNIBEL_AC
|
||||
D_STR_TECHNIBEL_AC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_TECHNIBEL_AC || SEND_TECHNIBEL_AC
|
||||
#if DECODE_MIRAGE || SEND_MIRAGE
|
||||
D_STR_MIRAGE "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_MIRAGE || SEND_MIRAGE
|
||||
#if DECODE_ELITESCREENS || SEND_ELITESCREENS
|
||||
D_STR_ELITESCREENS "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_ELITESCREENS || SEND_ELITESCREENS
|
||||
#if DECODE_PANASONIC_AC32 || SEND_PANASONIC_AC32
|
||||
D_STR_PANASONIC_AC32 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_PANASONIC_AC32 || SEND_PANASONIC_AC32
|
||||
#if DECODE_MILESTAG2 || SEND_MILESTAG2
|
||||
D_STR_MILESTAG2 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_MILESTAG2 || SEND_MILESTAG2
|
||||
#if DECODE_ECOCLIM || SEND_ECOCLIM
|
||||
D_STR_ECOCLIM "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_ECOCLIM || SEND_ECOCLIM
|
||||
#if DECODE_XMP || SEND_XMP
|
||||
D_STR_XMP "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_XMP || SEND_XMP
|
||||
#if DECODE_TRUMA || SEND_TRUMA
|
||||
D_STR_TRUMA "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_TRUMA || SEND_TRUMA
|
||||
#if DECODE_HAIER_AC176 || SEND_HAIER_AC176
|
||||
D_STR_HAIER_AC176 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_HAIER_AC176 || SEND_HAIER_AC176
|
||||
#if DECODE_TEKNOPOINT || SEND_TEKNOPOINT
|
||||
D_STR_TEKNOPOINT "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_TEKNOPOINT || SEND_TEKNOPOINT
|
||||
#if DECODE_KELON || SEND_KELON
|
||||
D_STR_KELON "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_KELON || SEND_KELON
|
||||
#if DECODE_TROTEC_3550 || SEND_TROTEC_3550
|
||||
D_STR_TROTEC_3550 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_TROTEC_3550 || SEND_TROTEC_3550
|
||||
#if DECODE_SANYO_AC88 || SEND_SANYO_AC88
|
||||
D_STR_SANYO_AC88 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_SANYO_AC88 || SEND_SANYO_AC88
|
||||
#if DECODE_BOSE || SEND_BOSE
|
||||
D_STR_BOSE "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_BOSE || SEND_BOSE
|
||||
#if DECODE_ARRIS || SEND_ARRIS
|
||||
D_STR_ARRIS "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_ARRIS || SEND_ARRIS
|
||||
#if DECODE_RHOSS || SEND_RHOSS
|
||||
D_STR_RHOSS "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_RHOSS || SEND_RHOSS
|
||||
#if DECODE_AIRTON || SEND_AIRTON
|
||||
D_STR_AIRTON "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_AIRTON || SEND_AIRTON
|
||||
#if DECODE_COOLIX48 || SEND_COOLIX48
|
||||
D_STR_COOLIX48 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_COOLIX48 || SEND_COOLIX48
|
||||
#if DECODE_HITACHI_AC264 || SEND_HITACHI_AC264
|
||||
D_STR_HITACHI_AC264 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_HITACHI_AC264 || SEND_HITACHI_AC264
|
||||
#if DECODE_KELON168 || SEND_KELON168
|
||||
D_STR_KELON168 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_KELON168 || SEND_KELON168
|
||||
#if DECODE_HITACHI_AC296 || SEND_HITACHI_AC296
|
||||
D_STR_HITACHI_AC296 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_HITACHI_AC296 || SEND_HITACHI_AC296
|
||||
#if DECODE_DAIKIN200 || SEND_DAIKIN200
|
||||
D_STR_DAIKIN200 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_DAIKIN200 || SEND_DAIKIN200
|
||||
#if DECODE_HAIER_AC160 || SEND_HAIER_AC160
|
||||
D_STR_HAIER_AC160 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_HAIER_AC160 || SEND_HAIER_AC160
|
||||
#if DECODE_CARRIER_AC128 || SEND_CARRIER_AC128
|
||||
D_STR_CARRIER_AC128 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_CARRIER_AC128 || SEND_CARRIER_AC128
|
||||
#if DECODE_TOTO || SEND_TOTO
|
||||
D_STR_TOTO "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_TOTO || SEND_TOTO
|
||||
#if DECODE_CLIMABUTLER || SEND_CLIMABUTLER
|
||||
D_STR_CLIMABUTLER "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_CLIMABUTLER || SEND_CLIMABUTLER
|
||||
#if DECODE_TCL96AC || SEND_TCL96AC
|
||||
D_STR_TCL96AC "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_TCL96AC || SEND_TCL96AC
|
||||
#if DECODE_BOSCH144 || SEND_BOSCH144
|
||||
D_STR_BOSCH144 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_BOSCH144 || SEND_BOSCH144
|
||||
#if DECODE_SANYO_AC152 || SEND_SANYO_AC152
|
||||
D_STR_SANYO_AC152 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_SANYO_AC152 || SEND_SANYO_AC152
|
||||
#if DECODE_DAIKIN312 || SEND_DAIKIN312
|
||||
D_STR_DAIKIN312 "\x0"
|
||||
#else
|
||||
D_STR_UNSUPPORTED "\x0"
|
||||
#endif
|
||||
#endif // if DECODE_DAIKIN312 || SEND_DAIKIN312
|
||||
///< New protocol strings should be added just above this line.
|
||||
"\x0" ///< This string requires double null termination.
|
||||
};
|
||||
|
||||
@@ -34,7 +34,7 @@ bool rn2xx3::getAsyncMode() const {
|
||||
bool rn2xx3::autobaud()
|
||||
{
|
||||
// FIXME TD-er: Must fix this, as it is not working well.
|
||||
String response = "";
|
||||
String response;
|
||||
|
||||
// Try a maximum of 10 times with a 1 second delay
|
||||
for (uint8_t i = 0; i < 10 && response.length() == 0; i++)
|
||||
@@ -243,9 +243,9 @@ RN2xx3_datatypes::Model rn2xx3::moduleType()
|
||||
return _rn2xx3_handler.moduleType();
|
||||
}
|
||||
|
||||
bool rn2xx3::setFrequencyPlan(RN2xx3_datatypes::Freq_plan fp)
|
||||
bool rn2xx3::setFrequencyPlan(RN2xx3_datatypes::Freq_plan fp, uint32_t rx2_freq)
|
||||
{
|
||||
return _rn2xx3_handler.setFrequencyPlan(fp);
|
||||
return _rn2xx3_handler.setFrequencyPlan(fp, rx2_freq);
|
||||
}
|
||||
|
||||
bool rn2xx3::setTTNstack(RN2xx3_datatypes::TTN_stack_version version)
|
||||
|
||||
@@ -282,10 +282,12 @@ public:
|
||||
|
||||
/*
|
||||
* Set the active channels to use.
|
||||
* Optional rx2_freq to set/override the default frequency for RX2
|
||||
*
|
||||
* Returns true if setting the channels is possible.
|
||||
* Returns false if you are trying to use the wrong channels on the wrong module type.
|
||||
*/
|
||||
bool setFrequencyPlan(RN2xx3_datatypes::Freq_plan);
|
||||
bool setFrequencyPlan(RN2xx3_datatypes::Freq_plan, uint32_t rx2_freq = 0);
|
||||
|
||||
/*
|
||||
* Set version of TTN stack to use.
|
||||
|
||||
@@ -9,13 +9,18 @@ rn2xx3_handler::rn2xx3_handler(Stream& serial) : _serial(serial)
|
||||
clearSerialBuffer();
|
||||
}
|
||||
|
||||
String rn2xx3_handler::sendRawCommand(const __FlashStringHelper* command)
|
||||
{
|
||||
return sendRawCommand(String(command));
|
||||
}
|
||||
|
||||
String rn2xx3_handler::sendRawCommand(const String& command)
|
||||
{
|
||||
unsigned long timer = millis();
|
||||
|
||||
if (!prepare_raw_command(command)) {
|
||||
setLastError(F("sendRawCommand: Prepare fail"));
|
||||
return "";
|
||||
return emptyString;
|
||||
}
|
||||
|
||||
if (wait_command_finished() == RN_state::timeout) {
|
||||
@@ -272,14 +277,14 @@ bool rn2xx3_handler::init()
|
||||
// Switch off automatic replies, because this library can not
|
||||
// handle more than one mac_rx per tx. See RN2483 datasheet,
|
||||
// 2.4.8.14, page 27 and the scenario on page 19.
|
||||
setAutomaticReply(false);
|
||||
setAutomaticReply(true);
|
||||
|
||||
// Semtech and TTN both use a non default RX2 window freq and SF.
|
||||
// Maybe we should not specify this for other networks.
|
||||
// if (_moduleType == RN2xx3_datatypes::Model::RN2483)
|
||||
// {
|
||||
// set2ndRecvWindow(3, 869525000);
|
||||
// }
|
||||
if (_moduleType == RN2xx3_datatypes::Model::RN2483)
|
||||
{
|
||||
setFrequencyPlan(_fp, _rx2_frequency);
|
||||
}
|
||||
// Disabled for now because an OTAA join seems to work fine without.
|
||||
|
||||
if (_asyncMode) {
|
||||
@@ -366,6 +371,16 @@ bool rn2xx3_handler::initABP(const String& devAddr, const String& AppSKey, const
|
||||
return init();
|
||||
}
|
||||
|
||||
RN2xx3_datatypes::TX_return_type rn2xx3_handler::txCommand(
|
||||
const __FlashStringHelper* command,
|
||||
const String& data,
|
||||
bool shouldEncode,
|
||||
uint8_t port)
|
||||
{
|
||||
return txCommand(String(command), data, shouldEncode, port);
|
||||
}
|
||||
|
||||
|
||||
RN2xx3_datatypes::TX_return_type rn2xx3_handler::txCommand(const String& command, const String& data, bool shouldEncode, uint8_t port)
|
||||
{
|
||||
if (get_state() == RN_state::must_perform_init) {
|
||||
@@ -506,7 +521,7 @@ void rn2xx3_handler::setLastUsedJoinMode(bool isOTAA) {
|
||||
}
|
||||
}
|
||||
|
||||
bool rn2xx3_handler::setFrequencyPlan(RN2xx3_datatypes::Freq_plan fp)
|
||||
bool rn2xx3_handler::setFrequencyPlan(RN2xx3_datatypes::Freq_plan fp, uint32_t rx2_freq)
|
||||
{
|
||||
bool returnValue = false;
|
||||
|
||||
@@ -516,9 +531,11 @@ bool rn2xx3_handler::setFrequencyPlan(RN2xx3_datatypes::Freq_plan fp)
|
||||
{
|
||||
if (_moduleType == RN2xx3_datatypes::Model::RN2483)
|
||||
{
|
||||
if (rx2_freq == 0)
|
||||
rx2_freq = 869525000;
|
||||
// mac set rx2 <dataRate> <frequency>
|
||||
// set2ndRecvWindow(5, 868100000); //use this for "strict" one channel gateways
|
||||
set2ndRecvWindow(3, 869525000); // use for "non-strict" one channel gateways
|
||||
set2ndRecvWindow(3, rx2_freq); // use for "non-strict" one channel gateways
|
||||
setChannelDutyCycle(0, 99); // 1% duty cycle for this channel
|
||||
setChannelDutyCycle(1, 65535); // almost never use this channel
|
||||
setChannelDutyCycle(2, 65535); // almost never use this channel
|
||||
@@ -571,7 +588,10 @@ bool rn2xx3_handler::setFrequencyPlan(RN2xx3_datatypes::Freq_plan fp)
|
||||
}
|
||||
|
||||
// RX window 2
|
||||
set2ndRecvWindow(3, 869525000);
|
||||
if (rx2_freq == 0)
|
||||
rx2_freq = 869525000;
|
||||
|
||||
set2ndRecvWindow(3, rx2_freq);
|
||||
|
||||
returnValue = true;
|
||||
}
|
||||
@@ -624,6 +644,7 @@ bool rn2xx3_handler::setFrequencyPlan(RN2xx3_datatypes::Freq_plan fp)
|
||||
}
|
||||
}
|
||||
_fp = fp;
|
||||
_rx2_frequency = rx2_freq;
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
@@ -710,6 +731,11 @@ String rn2xx3_handler::getLastError()
|
||||
return res;
|
||||
}
|
||||
|
||||
void rn2xx3_handler::setLastError(const __FlashStringHelper* error)
|
||||
{
|
||||
setLastError(String(error));
|
||||
}
|
||||
|
||||
void rn2xx3_handler::setLastError(const String& error)
|
||||
{
|
||||
if (_extensive_debug) {
|
||||
@@ -1207,6 +1233,11 @@ void rn2xx3_handler::handle_reply_received() {
|
||||
}
|
||||
}
|
||||
|
||||
int rn2xx3_handler::readIntValue(const __FlashStringHelper* command)
|
||||
{
|
||||
return readIntValue(String(command));
|
||||
}
|
||||
|
||||
int rn2xx3_handler::readIntValue(const String& command)
|
||||
{
|
||||
String value = sendRawCommand(command);
|
||||
@@ -1215,6 +1246,11 @@ int rn2xx3_handler::readIntValue(const String& command)
|
||||
return value.toInt();
|
||||
}
|
||||
|
||||
bool rn2xx3_handler::readUIntMacGet(const __FlashStringHelper* param, uint32_t& value)
|
||||
{
|
||||
return readUIntMacGet(String(param), value);
|
||||
}
|
||||
|
||||
bool rn2xx3_handler::readUIntMacGet(const String& param, uint32_t& value)
|
||||
{
|
||||
String command;
|
||||
@@ -1232,6 +1268,11 @@ bool rn2xx3_handler::readUIntMacGet(const String& param, uint32_t& value)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rn2xx3_handler::sendMacSet(const __FlashStringHelper* param, const String& value)
|
||||
{
|
||||
return sendMacSet(String(param), value);
|
||||
}
|
||||
|
||||
bool rn2xx3_handler::sendMacSet(const String& param, const String& value)
|
||||
{
|
||||
String command;
|
||||
@@ -1249,7 +1290,7 @@ bool rn2xx3_handler::sendMacSet(const String& param, const String& value)
|
||||
return RN2xx3_received_types::determineReceivedDataType(sendRawCommand(command)) == RN2xx3_received_types::ok;
|
||||
}
|
||||
|
||||
bool rn2xx3_handler::sendMacSetEnabled(const String& param, bool enabled)
|
||||
bool rn2xx3_handler::sendMacSetEnabled(const __FlashStringHelper* param, bool enabled)
|
||||
{
|
||||
return sendMacSet(param, enabled ? F("on") : F("off"));
|
||||
}
|
||||
@@ -1272,6 +1313,14 @@ bool rn2xx3_handler::sendMacSetCh(const String& param, unsigned int channel, uin
|
||||
return sendMacSetCh(param, channel, String(value));
|
||||
}
|
||||
|
||||
bool rn2xx3_handler::sendMacSetCh(const __FlashStringHelper* param,
|
||||
unsigned int channel,
|
||||
uint32_t value)
|
||||
{
|
||||
return sendMacSetCh(String(param), channel, String(value));
|
||||
}
|
||||
|
||||
|
||||
bool rn2xx3_handler::setChannelDutyCycle(unsigned int channel, unsigned int dutyCycle)
|
||||
{
|
||||
return sendMacSetCh(F("dcycle"), channel, dutyCycle);
|
||||
@@ -1394,7 +1443,7 @@ bool rn2xx3_handler::check_set_keys()
|
||||
{
|
||||
// The default address to use on TTN if no address is defined.
|
||||
// This one falls in the "testing" address space.
|
||||
_devaddr = F("03FFBEEF");
|
||||
_devaddr = F("00000000");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -31,6 +31,7 @@ public:
|
||||
|
||||
rn2xx3_handler(Stream& serial);
|
||||
|
||||
String sendRawCommand(const __FlashStringHelper* command);
|
||||
String sendRawCommand(const String& command);
|
||||
|
||||
bool prepare_raw_command(const String& command);
|
||||
@@ -113,6 +114,12 @@ public:
|
||||
uint8_t *DevEui);
|
||||
|
||||
|
||||
RN2xx3_datatypes::TX_return_type txCommand(const __FlashStringHelper* command,
|
||||
const String& data,
|
||||
bool shouldEncode,
|
||||
uint8_t port);
|
||||
|
||||
|
||||
RN2xx3_datatypes::TX_return_type txCommand(const String&,
|
||||
const String&,
|
||||
bool,
|
||||
@@ -154,7 +161,7 @@ public:
|
||||
return _moduleType;
|
||||
}
|
||||
|
||||
bool setFrequencyPlan(RN2xx3_datatypes::Freq_plan fp);
|
||||
bool setFrequencyPlan(RN2xx3_datatypes::Freq_plan fp, uint32_t rx2_freq = 0);
|
||||
|
||||
bool setTTNstack(RN2xx3_datatypes::TTN_stack_version version);
|
||||
|
||||
@@ -180,6 +187,7 @@ public:
|
||||
String getLastError();
|
||||
|
||||
// Set specific error string.
|
||||
void setLastError(const __FlashStringHelper* error);
|
||||
void setLastError(const String& error);
|
||||
|
||||
RN_state get_state() const;
|
||||
@@ -268,6 +276,7 @@ private:
|
||||
RN2xx3_datatypes::Firmware _firmware = RN2xx3_datatypes::Firmware::unknown;
|
||||
RN2xx3_datatypes::Model _moduleType = RN2xx3_datatypes::Model::RN_NA;
|
||||
RN2xx3_datatypes::Freq_plan _fp = RN2xx3_datatypes::Freq_plan::TTN_EU;
|
||||
uint32_t _rx2_frequency = 0;
|
||||
uint8_t _sf = 7;
|
||||
uint8_t _dr = 5;
|
||||
|
||||
@@ -282,15 +291,21 @@ public:
|
||||
|
||||
// Convenience functions
|
||||
|
||||
int readIntValue(const __FlashStringHelper* command);
|
||||
int readIntValue(const String& command);
|
||||
|
||||
|
||||
bool readUIntMacGet(const __FlashStringHelper* param,
|
||||
uint32_t & value);
|
||||
bool readUIntMacGet(const String& param,
|
||||
uint32_t & value);
|
||||
|
||||
// All "mac set ..." commands return either "ok" or "invalid_param"
|
||||
bool sendMacSet(const __FlashStringHelper* param,
|
||||
const String& value);
|
||||
bool sendMacSet(const String& param,
|
||||
const String& value);
|
||||
bool sendMacSetEnabled(const String& param,
|
||||
bool sendMacSetEnabled(const __FlashStringHelper* param,
|
||||
bool enabled);
|
||||
bool sendMacSetCh(const String& param,
|
||||
unsigned int channel,
|
||||
@@ -298,6 +313,9 @@ public:
|
||||
bool sendMacSetCh(const String& param,
|
||||
unsigned int channel,
|
||||
uint32_t value);
|
||||
bool sendMacSetCh(const __FlashStringHelper* param,
|
||||
unsigned int channel,
|
||||
uint32_t value);
|
||||
bool setChannelDutyCycle(unsigned int channel,
|
||||
unsigned int dutyCycle);
|
||||
bool setChannelFrequency(unsigned int channel,
|
||||
|
||||
@@ -41,7 +41,7 @@ bool rn2xx3_helper::isHexStr_of_length(const String& str, size_t length)
|
||||
|
||||
String rn2xx3_helper::base16decode(const String& input_c)
|
||||
{
|
||||
if (!isHexStr(input_c)) { return ""; }
|
||||
if (!isHexStr(input_c)) { return emptyString; }
|
||||
String input(input_c); // Make a deep copy to be able to do trim()
|
||||
input.trim();
|
||||
const size_t inputLength = input.length();
|
||||
|
||||
@@ -479,7 +479,7 @@ uint8_t AS7265X::virtualReadRegister(uint8_t virtualAddr)
|
||||
status = readRegister(AS7265X_STATUS_REG);
|
||||
if ((status & AS7265X_RX_VALID) != 0) //There is data to be read
|
||||
{
|
||||
uint8_t incoming = readRegister(AS7265X_READ_REG); //Read the byte but do nothing with it
|
||||
readRegister(AS7265X_READ_REG); //Read the byte but do nothing with it
|
||||
}
|
||||
|
||||
//Wait for WRITE flag to clear
|
||||
|
||||
@@ -205,13 +205,12 @@ platform_packages =
|
||||
[core_stage]
|
||||
extends = esp82xx_3_0_x
|
||||
platform = https://github.com/platformio/platform-espressif8266.git
|
||||
build_flags = ${esp82xx_3_0_x.build_flags}
|
||||
-DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3
|
||||
-DPHASE_LOCKED_WAVEFORM
|
||||
platform_packages =
|
||||
platformio/framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git
|
||||
mcspr/toolchain-xtensa @ ~5.100300.211127
|
||||
|
||||
build_flags = ${esp82xx_3_0_x.build_flags}
|
||||
-DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3
|
||||
-DPHASE_LOCKED_WAVEFORM
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@ lib_ignore = ESP8266Ping
|
||||
|
||||
[esp32_base]
|
||||
extends = common, core_esp32_IDF4_4__2_0_4
|
||||
upload_speed = 460800
|
||||
upload_before_reset = default_reset
|
||||
upload_after_reset = hard_reset
|
||||
lib_deps =
|
||||
Adafruit ILI9341 ESPEasy
|
||||
Adafruit_ST77xx
|
||||
|
||||
@@ -17,10 +17,10 @@ lib_ignore = ${core_2_7_4_alt_wifi.lib_ignore}
|
||||
|
||||
|
||||
[core302_platform]
|
||||
build_flags = ${core_4_0_1.build_flags}
|
||||
platform = ${core_4_0_1.platform}
|
||||
platform_packages = ${core_4_0_1.platform_packages}
|
||||
lib_ignore = ${core_4_0_1.lib_ignore}
|
||||
build_flags = ${core_stage.build_flags}
|
||||
platform = ${core_stage.platform}
|
||||
platform_packages = ${core_stage.platform_packages}
|
||||
lib_ignore = ${core_stage.lib_ignore}
|
||||
|
||||
|
||||
[beta_platform_2ndheap]
|
||||
|
||||
+8
-8
@@ -705,7 +705,7 @@ bool CPlugin_014(CPlugin::Function function, struct EventStruct *event, String&
|
||||
int lastindex = event->String1.lastIndexOf('/');
|
||||
errorCounter = 0;
|
||||
|
||||
if (event->String1.substring(lastindex + 1) == F("set"))
|
||||
if (event->String1.substring(lastindex + 1).equals(F("set")))
|
||||
{
|
||||
pubname = event->String1.substring(0, lastindex);
|
||||
lastindex = pubname.lastIndexOf('/');
|
||||
@@ -723,7 +723,7 @@ bool CPlugin_014(CPlugin::Function function, struct EventStruct *event, String&
|
||||
log += valueName;
|
||||
}
|
||||
|
||||
if (nodeName == F(CPLUGIN_014_SYSTEM_DEVICE)) // msg to a system device
|
||||
if (nodeName.equals(F(CPLUGIN_014_SYSTEM_DEVICE))) // msg to a system device
|
||||
{
|
||||
if (valueName.startsWith(F(CPLUGIN_014_GPIO_VALUE))) // msg to to set gpio values
|
||||
{
|
||||
@@ -732,10 +732,10 @@ bool CPlugin_014(CPlugin::Function function, struct EventStruct *event, String&
|
||||
cmd = F("GPIO,");
|
||||
cmd += valueName.substring(gpio_value_tag_length).toInt(); // get the GPIO
|
||||
|
||||
if ((event->String2 == F("true")) || (event->String2 == F("1"))) { cmd += F(",1"); }
|
||||
if ((event->String2.equals(F("true"))) || (event->String2.equals(F("1")))) { cmd += F(",1"); }
|
||||
else { cmd += F(",0"); }
|
||||
validTopic = true;
|
||||
} else if (valueName == F(CPLUGIN_014_CMD_VALUE)) // msg to send a command
|
||||
} else if (valueName.equals(F(CPLUGIN_014_CMD_VALUE))) // msg to send a command
|
||||
{
|
||||
cmd = event->String2;
|
||||
validTopic = true;
|
||||
@@ -825,7 +825,7 @@ bool CPlugin_014(CPlugin::Function function, struct EventStruct *event, String&
|
||||
// in case of event, store to buffer and return...
|
||||
String command = parseString(cmd, 1);
|
||||
|
||||
if ((command == F("event")) || (command == F("asyncevent")))
|
||||
if ((command.equals(F("event"))) || (command.equals(F("asyncevent"))))
|
||||
{
|
||||
if (Settings.UseRules) {
|
||||
String newEvent = parseStringToEnd(cmd, 2);
|
||||
@@ -965,7 +965,7 @@ bool CPlugin_014(CPlugin::Function function, struct EventStruct *event, String&
|
||||
if (!string.isEmpty()) {
|
||||
String commandName = parseString(string, 1); // could not find a way to get the command out of the event structure.
|
||||
|
||||
if (commandName == F("gpio")) // !ToDo : As gpio is like any other plugin commands should be integrated below!
|
||||
if (commandName.equals(F("gpio"))) // !ToDo : As gpio is like any other plugin commands should be integrated below!
|
||||
{
|
||||
int port = event->Par1; // parseString(string, 2).toInt();
|
||||
int valueInt = event->Par2; // parseString(string, 3).toInt();
|
||||
@@ -1020,7 +1020,7 @@ bool CPlugin_014(CPlugin::Function function, struct EventStruct *event, String&
|
||||
String valueStr;
|
||||
int valueInt = 0;
|
||||
|
||||
if ((commandName == F("taskvalueset")) || (commandName == F("dummyvalueset"))) // should work for both
|
||||
if ((commandName.equals(F("taskvalueset"))) || (commandName.equals(F("dummyvalueset")))) // should work for both
|
||||
{
|
||||
valueStr = formatUserVarNoCheck(event, taskVarIndex); // parseString(string, 4);
|
||||
success = MQTTpublish(CPLUGIN_ID_014, INVALID_TASK_INDEX, topic.c_str(), valueStr.c_str(), false);
|
||||
@@ -1050,7 +1050,7 @@ bool CPlugin_014(CPlugin::Function function, struct EventStruct *event, String&
|
||||
log += F(" ERROR!");
|
||||
addLogMove(LOG_LEVEL_ERROR, log);
|
||||
}
|
||||
} else if (parseString(commandName, 1) == F("homievalueset")) { // acknolages value form P086 Homie Receiver
|
||||
} else if (parseString(commandName, 1).equals(F("homievalueset"))) { // acknolages value form P086 Homie Receiver
|
||||
switch (Settings.TaskDevicePluginConfig[deviceIndex - 1][taskVarIndex]) {
|
||||
case 0: // PLUGIN_085_VALUE_INTEGER
|
||||
valueInt = static_cast<int>(UserVar[userVarIndex]);
|
||||
|
||||
+119
-55
@@ -32,6 +32,12 @@
|
||||
# endif // ifndef C018_FORCE_SW_SERIAL
|
||||
|
||||
struct C018_data_struct {
|
||||
private:
|
||||
void C018_logError(const __FlashStringHelper* command) const;
|
||||
void updateCacheOnInit();
|
||||
|
||||
public:
|
||||
|
||||
C018_data_struct() : C018_easySerial(nullptr), myLora(nullptr) {}
|
||||
|
||||
~C018_data_struct() {
|
||||
@@ -60,6 +66,11 @@ struct C018_data_struct {
|
||||
// Both pins are needed, or else no serial possible
|
||||
return false;
|
||||
}
|
||||
|
||||
// FIXME TD-er: Prevent unneeded OTAA joins.
|
||||
// See: https://www.thethingsnetwork.org/forum/t/how-often-should-a-node-do-an-otaa-join-and-is-otaa-better-than-abp/11192/47?u=td-er
|
||||
|
||||
|
||||
sampleSetInitiator = sampleSet_Initiator;
|
||||
|
||||
if (isInitialized()) {
|
||||
@@ -100,14 +111,7 @@ struct C018_data_struct {
|
||||
return isInitialized();
|
||||
}
|
||||
|
||||
bool isInitialized() const {
|
||||
if ((C018_easySerial != nullptr) && (myLora != nullptr)) {
|
||||
if (autobaud_success) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool isInitialized() const;
|
||||
|
||||
bool hasJoined() const {
|
||||
if (!isInitialized()) { return false; }
|
||||
@@ -155,9 +159,9 @@ struct C018_data_struct {
|
||||
return res;
|
||||
}
|
||||
|
||||
bool setFrequencyPlan(RN2xx3_datatypes::Freq_plan plan) {
|
||||
bool setFrequencyPlan(RN2xx3_datatypes::Freq_plan plan, uint32_t rx2_freq) {
|
||||
if (!isInitialized()) { return false; }
|
||||
bool res = myLora->setFrequencyPlan(plan);
|
||||
bool res = myLora->setFrequencyPlan(plan, rx2_freq);
|
||||
|
||||
C018_logError(F("setFrequencyPlan()"));
|
||||
return res;
|
||||
@@ -183,6 +187,7 @@ struct C018_data_struct {
|
||||
bool initOTAA(const String& AppEUI, const String& AppKey, const String& DevEUI) {
|
||||
if (myLora == nullptr) { return false; }
|
||||
bool success = myLora->initOTAA(AppEUI, AppKey, DevEUI);
|
||||
cacheDevAddr = String();
|
||||
|
||||
C018_logError(F("initOTAA()"));
|
||||
updateCacheOnInit();
|
||||
@@ -192,6 +197,7 @@ struct C018_data_struct {
|
||||
bool initABP(const String& addr, const String& AppSKey, const String& NwkSKey) {
|
||||
if (myLora == nullptr) { return false; }
|
||||
bool success = myLora->initABP(addr, AppSKey, NwkSKey);
|
||||
cacheDevAddr = addr;
|
||||
|
||||
C018_logError(F("initABP()"));
|
||||
updateCacheOnInit();
|
||||
@@ -199,7 +205,7 @@ struct C018_data_struct {
|
||||
}
|
||||
|
||||
String sendRawCommand(const String& command) {
|
||||
if (!isInitialized()) { return ""; }
|
||||
if (!isInitialized()) { return EMPTY_STRING; }
|
||||
|
||||
if (loglevelActiveFor(LOG_LEVEL_INFO)) {
|
||||
String log = F("sendRawCommand: ");
|
||||
@@ -218,17 +224,17 @@ struct C018_data_struct {
|
||||
}
|
||||
|
||||
String peekLastError() {
|
||||
if (!isInitialized()) { return ""; }
|
||||
if (!isInitialized()) { return EMPTY_STRING; }
|
||||
return myLora->peekLastError();
|
||||
}
|
||||
|
||||
String getLastError() {
|
||||
if (!isInitialized()) { return ""; }
|
||||
if (!isInitialized()) { return EMPTY_STRING; }
|
||||
return myLora->getLastError();
|
||||
}
|
||||
|
||||
String getDataRate() {
|
||||
if (!isInitialized()) { return ""; }
|
||||
if (!isInitialized()) { return EMPTY_STRING; }
|
||||
String res = myLora->getDataRate();
|
||||
|
||||
C018_logError(F("getDataRate()"));
|
||||
@@ -336,37 +342,6 @@ struct C018_data_struct {
|
||||
|
||||
private:
|
||||
|
||||
void C018_logError(const String& command) const {
|
||||
if (loglevelActiveFor(LOG_LEVEL_INFO)) {
|
||||
String error = myLora->peekLastError();
|
||||
|
||||
// String error = myLora->getLastError();
|
||||
|
||||
if (error.length() > 0) {
|
||||
String log = F("RN2483: ");
|
||||
log += command;
|
||||
log += F(": ");
|
||||
log += error;
|
||||
addLogMove(LOG_LEVEL_INFO, log);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void updateCacheOnInit() {
|
||||
cacheDevAddr = String();
|
||||
|
||||
if (isInitialized()) {
|
||||
if (myLora->getStatus().Joined)
|
||||
{
|
||||
cacheDevAddr = myLora->sendRawCommand(F("mac get devaddr"));
|
||||
|
||||
if (cacheDevAddr == F("00000000")) {
|
||||
cacheDevAddr = String();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void triggerAutobaud() {
|
||||
if ((C018_easySerial == nullptr) || (myLora == nullptr)) {
|
||||
return;
|
||||
@@ -429,6 +404,46 @@ private:
|
||||
bool autobaud_success = false;
|
||||
};
|
||||
|
||||
|
||||
bool C018_data_struct::isInitialized() const {
|
||||
if ((C018_easySerial != nullptr) && (myLora != nullptr)) {
|
||||
if (autobaud_success) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void C018_data_struct::C018_logError(const __FlashStringHelper* command) const {
|
||||
if (loglevelActiveFor(LOG_LEVEL_INFO)) {
|
||||
String error = myLora->peekLastError();
|
||||
|
||||
// String error = myLora->getLastError();
|
||||
|
||||
if (error.length() > 0) {
|
||||
String log = F("RN2483: ");
|
||||
log += command;
|
||||
log += F(": ");
|
||||
log += error;
|
||||
addLogMove(LOG_LEVEL_INFO, log);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void C018_data_struct::updateCacheOnInit() {
|
||||
if (isInitialized()) {
|
||||
if (cacheDevAddr.isEmpty() && myLora->getStatus().Joined)
|
||||
{
|
||||
cacheDevAddr = myLora->sendRawCommand(F("mac get devaddr"));
|
||||
|
||||
if (cacheDevAddr == F("00000000")) {
|
||||
cacheDevAddr = String();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
C018_data_struct *C018_data = nullptr;
|
||||
|
||||
# define C018_DEVICE_EUI_LEN 17
|
||||
@@ -453,7 +468,22 @@ struct C018_ConfigStruct
|
||||
reset();
|
||||
}
|
||||
if (stackVersion >= RN2xx3_datatypes::TTN_stack_version::TTN_NOT_SET) {
|
||||
stackVersion = RN2xx3_datatypes::TTN_stack_version::TTN_v2;
|
||||
stackVersion = RN2xx3_datatypes::TTN_stack_version::TTN_v3;
|
||||
}
|
||||
switch (frequencyplan) {
|
||||
case RN2xx3_datatypes::Freq_plan::SINGLE_CHANNEL_EU:
|
||||
case RN2xx3_datatypes::Freq_plan::TTN_EU:
|
||||
case RN2xx3_datatypes::Freq_plan::DEFAULT_EU:
|
||||
if (rx2_freq < 867000000 || rx2_freq > 870000000) {
|
||||
rx2_freq = 0;
|
||||
}
|
||||
break;
|
||||
case RN2xx3_datatypes::Freq_plan::TTN_US:
|
||||
// FIXME TD-er: Need to find the ranges for US (and other regions)
|
||||
break;
|
||||
default:
|
||||
rx2_freq = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -462,13 +492,14 @@ struct C018_ConfigStruct
|
||||
ZERO_FILL(DeviceAddr);
|
||||
ZERO_FILL(NetworkSessionKey);
|
||||
ZERO_FILL(AppSessionKey);
|
||||
baudrate = 9600;
|
||||
rxpin = 12;
|
||||
txpin = 14;
|
||||
baudrate = 57600;
|
||||
rxpin = -1;
|
||||
txpin = -1;
|
||||
resetpin = -1;
|
||||
sf = 7;
|
||||
frequencyplan = RN2xx3_datatypes::Freq_plan::TTN_EU;
|
||||
stackVersion = RN2xx3_datatypes::TTN_stack_version::TTN_v2;
|
||||
rx2_freq = 0;
|
||||
stackVersion = RN2xx3_datatypes::TTN_stack_version::TTN_v3;
|
||||
joinmethod = C018_USE_OTAA;
|
||||
}
|
||||
|
||||
@@ -486,6 +517,7 @@ struct C018_ConfigStruct
|
||||
uint8_t serialPort = 0;
|
||||
uint8_t stackVersion = RN2xx3_datatypes::TTN_stack_version::TTN_v2;
|
||||
uint8_t adr = 0;
|
||||
uint32_t rx2_freq = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -575,6 +607,7 @@ bool CPlugin_018(CPlugin::Function function, struct EventStruct *event, String&
|
||||
}
|
||||
|
||||
unsigned long baudrate;
|
||||
uint32_t rx2_frequency;
|
||||
int8_t rxpin;
|
||||
int8_t txpin;
|
||||
int8_t resetpin;
|
||||
@@ -609,6 +642,7 @@ bool CPlugin_018(CPlugin::Function function, struct EventStruct *event, String&
|
||||
resetpin = customConfig->resetpin;
|
||||
sf = customConfig->sf;
|
||||
frequencyplan = customConfig->frequencyplan;
|
||||
rx2_frequency = customConfig->rx2_freq;
|
||||
joinmethod = customConfig->joinmethod;
|
||||
stackVersion = customConfig->stackVersion;
|
||||
adr = customConfig->adr;
|
||||
@@ -650,6 +684,9 @@ bool CPlugin_018(CPlugin::Function function, struct EventStruct *event, String&
|
||||
};
|
||||
|
||||
addFormSelector(F("Frequency Plan"), F("frequencyplan"), 4, options, values, nullptr, frequencyplan, false);
|
||||
addFormNumericBox(F("RX2 Frequency"), F("rx2freq"), rx2_frequency, 0);
|
||||
addUnit(F("Hz"));
|
||||
addFormNote(F("0 = default, or else override default"));
|
||||
}
|
||||
{
|
||||
const __FlashStringHelper * options[2] = { F("TTN v2"), F("TTN v3") };
|
||||
@@ -694,7 +731,7 @@ bool CPlugin_018(CPlugin::Function function, struct EventStruct *event, String&
|
||||
addRowLabel(F("Voltage"));
|
||||
addHtmlFloat(static_cast<float>(C018_data->getVbat()) / 1000.0f, 3);
|
||||
|
||||
addRowLabel(F("Dev Addr"));
|
||||
addRowLabel(F("Device Addr"));
|
||||
addHtml(C018_data->getDevaddr());
|
||||
|
||||
uint32_t dnctr, upctr;
|
||||
@@ -762,6 +799,7 @@ bool CPlugin_018(CPlugin::Function function, struct EventStruct *event, String&
|
||||
customConfig->resetpin = getFormItemInt(F("taskdevicepin3"), customConfig->resetpin);
|
||||
customConfig->sf = getFormItemInt(F("sf"), customConfig->sf);
|
||||
customConfig->frequencyplan = getFormItemInt(F("frequencyplan"), customConfig->frequencyplan);
|
||||
customConfig->rx2_freq = getFormItemInt(F("rx2freq"), customConfig->rx2_freq);
|
||||
customConfig->joinmethod = getFormItemInt(F("joinmethod"), customConfig->joinmethod);
|
||||
customConfig->stackVersion = getFormItemInt(F("ttnstack"), customConfig->stackVersion);
|
||||
customConfig->adr = isFormItemChecked(F("adr"));
|
||||
@@ -825,6 +863,31 @@ bool CPlugin_018(CPlugin::Function function, struct EventStruct *event, String&
|
||||
break;
|
||||
}
|
||||
|
||||
case CPlugin::Function::CPLUGIN_WRITE:
|
||||
{
|
||||
if (C018_data != nullptr) {
|
||||
if (C018_data->isInitialized())
|
||||
{
|
||||
const String command = parseString(string, 1);
|
||||
if (command.equals(F("lorawan"))) {
|
||||
const String subcommand = parseString(string, 2);
|
||||
if (subcommand.equals(F("write"))) {
|
||||
const String loraWriteCommand = parseStringToEnd(string, 3);
|
||||
const String res = C018_data->sendRawCommand(loraWriteCommand);
|
||||
String logstr = F("LoRaWAN cmd: ");
|
||||
logstr += loraWriteCommand;
|
||||
logstr += F(" -> ");
|
||||
logstr += res;
|
||||
addLog(LOG_LEVEL_INFO, logstr);
|
||||
SendStatus(event, logstr);
|
||||
success = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case CPlugin::Function::CPLUGIN_FIFTY_PER_SECOND:
|
||||
{
|
||||
if (C018_data != nullptr) {
|
||||
@@ -907,7 +970,7 @@ bool C018_init(struct EventStruct *event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
C018_data->setFrequencyPlan(static_cast<RN2xx3_datatypes::Freq_plan>(customConfig->frequencyplan));
|
||||
C018_data->setFrequencyPlan(static_cast<RN2xx3_datatypes::Freq_plan>(customConfig->frequencyplan), customConfig->rx2_freq);
|
||||
if (!C018_data->setSF(customConfig->sf)) {
|
||||
return false;
|
||||
}
|
||||
@@ -915,6 +978,10 @@ bool C018_init(struct EventStruct *event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!C018_data->setTTNstack(static_cast<RN2xx3_datatypes::TTN_stack_version>(customConfig->stackVersion))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (customConfig->joinmethod == C018_USE_OTAA) {
|
||||
if (loglevelActiveFor(LOG_LEVEL_INFO)) {
|
||||
String log = F("OTAA: AppEUI: ");
|
||||
@@ -937,9 +1004,6 @@ bool C018_init(struct EventStruct *event) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!C018_data->setTTNstack(static_cast<RN2xx3_datatypes::TTN_stack_version>(customConfig->stackVersion))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!C018_data->txUncnf(F("ESPeasy (TTN)"), Port)) {
|
||||
return false;
|
||||
|
||||
@@ -684,7 +684,7 @@ boolean Plugin_001(uint8_t function, struct EventStruct *event, String& string)
|
||||
// WARNING: don't read "globalMapPortStatus[key]" here, as it will create a new entry if key does not exist
|
||||
|
||||
|
||||
if (command == F("inputswitchstate")) {
|
||||
if (command.equals(F("inputswitchstate"))) {
|
||||
success = true;
|
||||
|
||||
// @giig1967g deprecated since 2019-11-26
|
||||
|
||||
+5
-5
@@ -248,8 +248,8 @@ boolean Plugin_003(uint8_t function, struct EventStruct *event, String& string)
|
||||
const String command = parseString(string, 1);
|
||||
bool mustCallPluginRead = false;
|
||||
|
||||
const bool cmd_resetpulsecounter = command == F("resetpulsecounter");
|
||||
const bool cmd_setpulsecountertotal = command == F("setpulsecountertotal");
|
||||
const bool cmd_resetpulsecounter = command.equals(F("resetpulsecounter"));
|
||||
const bool cmd_setpulsecountertotal = command.equals(F("setpulsecountertotal"));
|
||||
|
||||
if (cmd_resetpulsecounter || cmd_setpulsecountertotal)
|
||||
{
|
||||
@@ -290,7 +290,7 @@ boolean Plugin_003(uint8_t function, struct EventStruct *event, String& string)
|
||||
|
||||
success = true;
|
||||
}
|
||||
else if (command == F("logpulsestatistic"))
|
||||
else if (command.equals(F("logpulsestatistic")))
|
||||
{
|
||||
# ifdef PULSE_STATISTIC
|
||||
|
||||
@@ -303,8 +303,8 @@ boolean Plugin_003(uint8_t function, struct EventStruct *event, String& string)
|
||||
// i = increase the log level for regular statstic logs to "info"
|
||||
|
||||
const String subcommand = parseString(string, 2);
|
||||
const bool sub_i = subcommand == F("i");
|
||||
const bool sub_r = subcommand == F("r");
|
||||
const bool sub_i = subcommand.equals(F("i"));
|
||||
const bool sub_r = subcommand.equals(F("r"));
|
||||
|
||||
if ((sub_i) || (sub_r) || (subcommand.isEmpty())) {
|
||||
P003_data->pulseHelper.doStatisticLogging(P003_PULSE_STATS_ADHOC_LOG_LEVEL);
|
||||
|
||||
+6
-6
@@ -93,7 +93,7 @@ boolean Plugin_011(uint8_t function, struct EventStruct *event, String& string)
|
||||
String log;
|
||||
String command = parseString(string, 1);
|
||||
|
||||
if (command == F("extgpio"))
|
||||
if (command.equals(F("extgpio")))
|
||||
{
|
||||
success = true;
|
||||
portStatusStruct tempStatus;
|
||||
@@ -121,7 +121,7 @@ boolean Plugin_011(uint8_t function, struct EventStruct *event, String& string)
|
||||
SendStatusOnlyIfNeeded(event, SEARCH_PIN_STATE, key, log, 0);
|
||||
}
|
||||
|
||||
if (command == F("extpwm"))
|
||||
if (command.equals(F("extpwm")))
|
||||
{
|
||||
success = true;
|
||||
uint8_t address = PLUGIN_011_I2C_ADDRESS;
|
||||
@@ -154,7 +154,7 @@ boolean Plugin_011(uint8_t function, struct EventStruct *event, String& string)
|
||||
SendStatusOnlyIfNeeded(event, SEARCH_PIN_STATE, key, log, 0);
|
||||
}
|
||||
|
||||
if (command == F("extpulse"))
|
||||
if (command.equals(F("extpulse")))
|
||||
{
|
||||
success = true;
|
||||
|
||||
@@ -188,7 +188,7 @@ boolean Plugin_011(uint8_t function, struct EventStruct *event, String& string)
|
||||
}
|
||||
}
|
||||
|
||||
if (command == F("extlongpulse"))
|
||||
if (command.equals(F("extlongpulse")))
|
||||
{
|
||||
success = true;
|
||||
|
||||
@@ -221,8 +221,8 @@ boolean Plugin_011(uint8_t function, struct EventStruct *event, String& string)
|
||||
}
|
||||
}
|
||||
|
||||
if (command == F("status")) {
|
||||
if (parseString(string, 2) == F("ext"))
|
||||
if (command.equals(F("status"))) {
|
||||
if (parseString(string, 2).equals(F("ext")))
|
||||
{
|
||||
success = true;
|
||||
const uint32_t key = createKey(PLUGIN_ID_011, event->Par2); // WARNING: 'status' uses Par2 instead of Par1
|
||||
|
||||
@@ -315,13 +315,13 @@ boolean Plugin_020(uint8_t function, struct EventStruct *event, String& string)
|
||||
break;
|
||||
}
|
||||
|
||||
if (command == F("serialsend")) {
|
||||
if (command.equals(F("serialsend"))) {
|
||||
task->ser2netSerial->write(string.substring(11).c_str());
|
||||
task->ser2netSerial->flush();
|
||||
success = true;
|
||||
}
|
||||
|
||||
if ((command == F("ser2netclientsend")) && (task->hasClientConnected())) {
|
||||
if ((command.equals(F("ser2netclientsend"))) && (task->hasClientConnected())) {
|
||||
task->ser2netClient.print(string.substring(18));
|
||||
task->ser2netClient.flush();
|
||||
success = true;
|
||||
|
||||
+2
-2
@@ -106,7 +106,7 @@ boolean Plugin_021(uint8_t function, struct EventStruct *event, String& string)
|
||||
{
|
||||
String command = parseString(string, 1);
|
||||
|
||||
if (command == F("setlevel")) {
|
||||
if (command.equals(F("setlevel"))) {
|
||||
String value = parseString(string, 2);
|
||||
double result = 0.0;
|
||||
|
||||
@@ -128,7 +128,7 @@ boolean Plugin_021(uint8_t function, struct EventStruct *event, String& string)
|
||||
{
|
||||
String command = parseString(string, 1);
|
||||
|
||||
if (command == F("getlevel")) {
|
||||
if (command.equals(F("getlevel"))) {
|
||||
string = PCONFIG_FLOAT(0);
|
||||
success = true;
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ boolean Plugin_022(uint8_t function, struct EventStruct *event, String& string)
|
||||
}
|
||||
}
|
||||
|
||||
if ((command == F("pcapwm")) || (instanceCommand && (command == F("pwm"))))
|
||||
if ((command.equals(F("pcapwm"))) || (instanceCommand && (command.equals(F("pwm")))))
|
||||
{
|
||||
success = true;
|
||||
|
||||
@@ -297,7 +297,7 @@ boolean Plugin_022(uint8_t function, struct EventStruct *event, String& string)
|
||||
}
|
||||
}
|
||||
|
||||
if ((command == F("pcafrq")) || (instanceCommand && (command == F("frq"))))
|
||||
if ((command.equals(F("pcafrq"))) || (instanceCommand && (command.equals(F("frq")))))
|
||||
{
|
||||
success = true;
|
||||
|
||||
@@ -336,7 +336,7 @@ boolean Plugin_022(uint8_t function, struct EventStruct *event, String& string)
|
||||
}
|
||||
}
|
||||
|
||||
if (instanceCommand && (command == F("mode2")))
|
||||
if (instanceCommand && (command.equals(F("mode2"))))
|
||||
{
|
||||
success = true;
|
||||
|
||||
@@ -360,9 +360,9 @@ boolean Plugin_022(uint8_t function, struct EventStruct *event, String& string)
|
||||
}
|
||||
}
|
||||
|
||||
if (command == F("status"))
|
||||
if (command.equals(F("status")))
|
||||
{
|
||||
if (parseString(string, 2) == F("pca"))
|
||||
if (parseString(string, 2).equals(F("pca")))
|
||||
{
|
||||
if (!P022_data->p022_is_init(address))
|
||||
{
|
||||
@@ -378,12 +378,12 @@ boolean Plugin_022(uint8_t function, struct EventStruct *event, String& string)
|
||||
}
|
||||
}
|
||||
|
||||
if (instanceCommand && (command == F("gpio")))
|
||||
if (instanceCommand && (command.equals(F("gpio"))))
|
||||
{
|
||||
success = true;
|
||||
log = formatToHex(address, F("PCA 0x"), 2);
|
||||
log += F(": GPIO ");
|
||||
const bool allPins = parseString(string, 2) == F("all");
|
||||
const bool allPins = parseString(string, 2).equals(F("all"));
|
||||
|
||||
if (((event->Par1 >= 0) && (event->Par1 <= PCA9685_MAX_PINS)) ||
|
||||
allPins)
|
||||
@@ -437,7 +437,7 @@ boolean Plugin_022(uint8_t function, struct EventStruct *event, String& string)
|
||||
}
|
||||
}
|
||||
|
||||
if (instanceCommand && (command == F("pulse")))
|
||||
if (instanceCommand && (command.equals(F("pulse"))))
|
||||
{
|
||||
success = true;
|
||||
log = formatToHex(address, F("PCA 0x"), 2);
|
||||
@@ -470,7 +470,7 @@ boolean Plugin_022(uint8_t function, struct EventStruct *event, String& string)
|
||||
|
||||
if (event->Par3 > 0)
|
||||
{
|
||||
if (parseString(string, 5) == F("auto"))
|
||||
if (parseString(string, 5).equals(F("auto")))
|
||||
{
|
||||
autoreset = -1;
|
||||
log += F(" with autoreset infinity");
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ boolean Plugin_033(uint8_t function, struct EventStruct *event, String& string)
|
||||
{
|
||||
String command = parseString(string, 1);
|
||||
|
||||
if (command == F("dummyvalueset"))
|
||||
if (command.equals(F("dummyvalueset")))
|
||||
{
|
||||
if (event->Par1 == event->TaskIndex + 1) // make sure that this instance is the target
|
||||
{
|
||||
|
||||
+25
-40
@@ -846,12 +846,12 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
|
||||
bool sendEvents = bitRead(P036_FLAGS_0, P036_FLAG_SEND_EVENTS); // Bit 28 Send Events
|
||||
# endif // ifdef P036_SEND_EVENTS
|
||||
|
||||
if ((command == F("oledframedcmd")) && P036_data->isInitialized()) {
|
||||
if (subcommand == F("display")) {
|
||||
if ((command.equals(F("oledframedcmd"))) && P036_data->isInitialized()) {
|
||||
if (subcommand.equals(F("display"))) {
|
||||
// display functions
|
||||
String para1 = parseString(string, 3);
|
||||
|
||||
if (para1 == F("on")) {
|
||||
if (para1.equals(F("on"))) {
|
||||
success = true;
|
||||
P036_data->displayTimer = P036_TIMER;
|
||||
P036_data->display->displayOn();
|
||||
@@ -864,7 +864,7 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
|
||||
# endif // ifdef P036_SEND_EVENTS
|
||||
}
|
||||
|
||||
if (para1 == F("off")) {
|
||||
if (para1.equals(F("off"))) {
|
||||
success = true;
|
||||
P036_data->displayTimer = 0;
|
||||
P036_data->display->displayOff();
|
||||
@@ -877,7 +877,7 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
|
||||
# endif // ifdef P036_SEND_EVENTS
|
||||
}
|
||||
|
||||
if (para1 == F("low")) {
|
||||
if (para1.equals(F("low"))) {
|
||||
success = true;
|
||||
P036_data->setContrast(P36_CONTRAST_LOW);
|
||||
# ifdef P036_SEND_EVENTS
|
||||
@@ -893,7 +893,7 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
|
||||
UserVar[event->BaseVarIndex] = 1; // Save the fact that the display is now ON
|
||||
}
|
||||
|
||||
if (para1 == F("med")) {
|
||||
if (para1.equals(F("med"))) {
|
||||
success = true;
|
||||
P036_data->setContrast(P36_CONTRAST_MED);
|
||||
# ifdef P036_SEND_EVENTS
|
||||
@@ -909,7 +909,7 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
|
||||
UserVar[event->BaseVarIndex] = 1; // Save the fact that the display is now ON
|
||||
}
|
||||
|
||||
if (para1 == F("high")) {
|
||||
if (para1.equals(F("high"))) {
|
||||
success = true;
|
||||
P036_data->setContrast(P36_CONTRAST_HIGH);
|
||||
# ifdef P036_SEND_EVENTS
|
||||
@@ -924,7 +924,7 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
|
||||
# endif // ifdef P036_SEND_EVENTS
|
||||
UserVar[event->BaseVarIndex] = 1; // Save the fact that the display is now ON
|
||||
}
|
||||
} else if ((subcommand == F("frame")) &&
|
||||
} else if ((subcommand.equals(F("frame"))) &&
|
||||
(event->Par2 >= 0) &&
|
||||
(event->Par2 <= P036_data->MaxFramesToDisplay + 1)) {
|
||||
success = true;
|
||||
@@ -951,7 +951,7 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
|
||||
# endif // ifdef P036_SEND_EVENTS
|
||||
}
|
||||
# ifdef P036_ENABLE_LINECOUNT
|
||||
else if ((subcommand == F("linecount")) &&
|
||||
else if ((subcommand.equals(F("linecount"))) &&
|
||||
(event->Par2 >= 1) &&
|
||||
(event->Par2 <= 4)) {
|
||||
success = true;
|
||||
@@ -969,7 +969,7 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
|
||||
}
|
||||
# endif // P036_ENABLE_LINECOUNT
|
||||
# ifdef P036_ENABLE_LEFT_ALIGN
|
||||
else if ((subcommand == F("leftalign")) &&
|
||||
else if ((subcommand.equals(F("leftalign"))) &&
|
||||
((event->Par2 == 0) ||
|
||||
(event->Par2 == 1))) {
|
||||
success = true;
|
||||
@@ -1090,42 +1090,27 @@ boolean Plugin_036(uint8_t function, struct EventStruct *event, String& string)
|
||||
}
|
||||
|
||||
# ifdef P036_SEND_EVENTS
|
||||
const __FlashStringHelper* P36_eventId_toString(uint8_t eventId)
|
||||
{
|
||||
switch (eventId) {
|
||||
case P036_EVENT_DISPLAY: return F("display");
|
||||
case P036_EVENT_CONTRAST: return F("contrast");
|
||||
case P036_EVENT_FRAME: return F("frame");
|
||||
case P036_EVENT_LINE: return F("line");
|
||||
# ifdef P036_ENABLE_LINECOUNT
|
||||
case P036_EVENT_LINECNT: return F("linecount");
|
||||
# endif // P036_ENABLE_LINECOUNT
|
||||
}
|
||||
return F("");
|
||||
}
|
||||
|
||||
void P036_SendEvent(struct EventStruct *event, uint8_t eventId, int16_t eventValue) {
|
||||
if (Settings.UseRules) {
|
||||
String RuleEvent;
|
||||
RuleEvent.reserve(32); // Guesstimate
|
||||
RuleEvent += getTaskDeviceName(event->TaskIndex);
|
||||
RuleEvent += '#';
|
||||
|
||||
switch (eventId) {
|
||||
case P036_EVENT_DISPLAY:
|
||||
{
|
||||
RuleEvent += F("display");
|
||||
break;
|
||||
}
|
||||
case P036_EVENT_CONTRAST:
|
||||
{
|
||||
RuleEvent += F("contrast");
|
||||
break;
|
||||
}
|
||||
case P036_EVENT_FRAME:
|
||||
{
|
||||
RuleEvent += F("frame");
|
||||
break;
|
||||
}
|
||||
case P036_EVENT_LINE:
|
||||
{
|
||||
RuleEvent += F("line");
|
||||
break;
|
||||
}
|
||||
# ifdef P036_ENABLE_LINECOUNT
|
||||
case P036_EVENT_LINECNT:
|
||||
{
|
||||
RuleEvent += F("linecount");
|
||||
break;
|
||||
}
|
||||
# endif // P036_ENABLE_LINECOUNT
|
||||
}
|
||||
RuleEvent += P36_eventId_toString(eventId);
|
||||
RuleEvent += '=';
|
||||
RuleEvent += eventValue;
|
||||
eventQueue.addMove(std::move(RuleEvent));
|
||||
|
||||
+20
-19
@@ -11,6 +11,7 @@
|
||||
// This task reads data from the MQTT Import input stream and saves the value
|
||||
|
||||
/**
|
||||
* 2022-08-12, tonhuisman: Introduce plugin-specific P037_LIMIT_BUILD_SIZE feature-flag
|
||||
* 2022-04-09, tonhuisman: Add features Deduplicate Events, and Max event-queue size
|
||||
* 2022-04-09, tonhuisman: Bugfix sending (extra) events only when enabled
|
||||
* 2021-10-23, tonhuisman: Fix stability issues when parsing JSON payloads
|
||||
@@ -145,39 +146,39 @@ boolean Plugin_037(uint8_t function, struct EventStruct *event, String& string)
|
||||
addFormSelector_YesNo(F("Apply mappings"), F("p037_apply_mappings"), P037_APPLY_MAPPINGS, true);
|
||||
# endif // if P037_MAPPING_SUPPORT
|
||||
# if P037_MAPPING_SUPPORT || P037_JSON_SUPPORT || P037_FILTER_SUPPORT
|
||||
# if !defined(LIMIT_BUILD_SIZE)
|
||||
# if !defined(P037_LIMIT_BUILD_SIZE)
|
||||
addFormNote(F("Changing a Yes/No option will reload the page. Changing to No will clear corresponding settings!"));
|
||||
# endif // if !defined(LIMIT_BUILD_SIZE)
|
||||
# endif // if !defined(P037_LIMIT_BUILD_SIZE)
|
||||
# endif // if P037_MAPPING_SUPPORT || P037_JSON_SUPPORT || P037_FILTER_SUPPORT
|
||||
addFormCheckBox(F("Generate events for accepted topics"),
|
||||
F("p037_send_events"), P037_SEND_EVENTS);
|
||||
# if !defined(LIMIT_BUILD_SIZE)
|
||||
# if !defined(P037_LIMIT_BUILD_SIZE)
|
||||
addFormNote(F("Event: <TaskName>#<topic>=<payload>"));
|
||||
# if P037_JSON_SUPPORT
|
||||
addFormNote(F("Events when JSON enabled and JSON payload: <Topic>#<json-attribute>=<value>"));
|
||||
# endif // if P037_JSON_SUPPORT
|
||||
# endif // if !defined(LIMIT_BUILD_SIZE)
|
||||
# endif // if !defined(P037_LIMIT_BUILD_SIZE)
|
||||
|
||||
{
|
||||
addFormCheckBox(F("Deduplicate events"), F("p037_deduplicate"), P037_DEDUPLICATE_EVENTS == 1);
|
||||
# if !defined(LIMIT_BUILD_SIZE)
|
||||
# if !defined(P037_LIMIT_BUILD_SIZE)
|
||||
addFormNote(F("When enabled will not (re-)generate events that are already in the queue."));
|
||||
# endif // if !defined(LIMIT_BUILD_SIZE)
|
||||
# endif // if !defined(P037_LIMIT_BUILD_SIZE)
|
||||
}
|
||||
|
||||
{
|
||||
# if !defined(LIMIT_BUILD_SIZE) && FEATURE_TOOLTIPS
|
||||
# if !defined(P037_LIMIT_BUILD_SIZE) && FEATURE_TOOLTIPS
|
||||
String toolTip = F("0..");
|
||||
toolTip += P037_MAX_QUEUEDEPTH;
|
||||
toolTip += F(" entries");
|
||||
addFormNumericBox(F("Max. # entries in event queue"), F("p037_queuedepth"), P037_QUEUEDEPTH_EVENTS, 0, P037_MAX_QUEUEDEPTH, toolTip);
|
||||
# else // if !defined(LIMIT_BUILD_SIZE) && FEATURE_TOOLTIPS
|
||||
# else // if !defined(P037_LIMIT_BUILD_SIZE) && FEATURE_TOOLTIPS
|
||||
addFormNumericBox(F("Max. # entries in event queue"), F("p037_queuedepth"), P037_QUEUEDEPTH_EVENTS, 0, P037_MAX_QUEUEDEPTH);
|
||||
# endif // if !defined(LIMIT_BUILD_SIZE) && FEATURE_TOOLTIPS
|
||||
# endif // if !defined(P037_LIMIT_BUILD_SIZE) && FEATURE_TOOLTIPS
|
||||
addUnit(F("0 = no check"));
|
||||
# if !defined(LIMIT_BUILD_SIZE)
|
||||
# if !defined(P037_LIMIT_BUILD_SIZE)
|
||||
addFormNote(F("New events will be discarded if the event queue has more entries queued."));
|
||||
# endif // if !defined(LIMIT_BUILD_SIZE)
|
||||
# endif // if !defined(P037_LIMIT_BUILD_SIZE)
|
||||
}
|
||||
# if P037_REPLACE_BY_COMMA_SUPPORT
|
||||
{
|
||||
@@ -512,7 +513,7 @@ boolean Plugin_037(uint8_t function, struct EventStruct *event, String& string)
|
||||
Payload = parseString(Payload, jIndex, ';');
|
||||
}
|
||||
|
||||
# if !defined(LIMIT_BUILD_SIZE) || defined(P037_OVERRIDE)
|
||||
# if !defined(P037_LIMIT_BUILD_SIZE) || defined(P037_OVERRIDE)
|
||||
|
||||
if (loglevelActiveFor(LOG_LEVEL_INFO)) {
|
||||
String log = F("IMPT : MQTT fetched json attribute: ");
|
||||
@@ -527,7 +528,7 @@ boolean Plugin_037(uint8_t function, struct EventStruct *event, String& string)
|
||||
}
|
||||
addLogMove(LOG_LEVEL_INFO, log);
|
||||
}
|
||||
# endif // if !defined(LIMIT_BUILD_SIZE) || defined(P037_OVERRIDE)
|
||||
# endif // if !defined(P037_LIMIT_BUILD_SIZE) || defined(P037_OVERRIDE)
|
||||
continueProcessing = false; // no need to loop over all attributes, the configured one is found
|
||||
} else {
|
||||
key = P037_data->iter->key().c_str();
|
||||
@@ -569,7 +570,7 @@ boolean Plugin_037(uint8_t function, struct EventStruct *event, String& string)
|
||||
log.reserve(64);
|
||||
log += event->String1;
|
||||
addLog(LOG_LEVEL_ERROR, log);
|
||||
# if !defined(LIMIT_BUILD_SIZE) || defined(P037_OVERRIDE)
|
||||
# if !defined(P037_LIMIT_BUILD_SIZE) || defined(P037_OVERRIDE)
|
||||
|
||||
if (loglevelActiveFor(LOG_LEVEL_INFO)) {
|
||||
log.clear();
|
||||
@@ -579,7 +580,7 @@ boolean Plugin_037(uint8_t function, struct EventStruct *event, String& string)
|
||||
log += getTaskDeviceName(event->TaskIndex);
|
||||
addLogMove(LOG_LEVEL_INFO, log);
|
||||
}
|
||||
# endif // if !defined(LIMIT_BUILD_SIZE) || defined(P037_OVERRIDE)
|
||||
# endif // if !defined(P037_LIMIT_BUILD_SIZE) || defined(P037_OVERRIDE)
|
||||
success = false;
|
||||
break;
|
||||
}
|
||||
@@ -600,7 +601,7 @@ boolean Plugin_037(uint8_t function, struct EventStruct *event, String& string)
|
||||
}
|
||||
|
||||
// Log the event
|
||||
# if !defined(LIMIT_BUILD_SIZE) || defined(P037_OVERRIDE)
|
||||
# if !defined(P037_LIMIT_BUILD_SIZE) || defined(P037_OVERRIDE)
|
||||
|
||||
if (loglevelActiveFor(LOG_LEVEL_INFO)) {
|
||||
String log = F("IMPT : [");
|
||||
@@ -616,7 +617,7 @@ boolean Plugin_037(uint8_t function, struct EventStruct *event, String& string)
|
||||
log += doublePayload;
|
||||
addLogMove(LOG_LEVEL_INFO, log);
|
||||
}
|
||||
# endif // if !defined(LIMIT_BUILD_SIZE) || defined(P037_OVERRIDE)
|
||||
# endif // if !defined(P037_LIMIT_BUILD_SIZE) || defined(P037_OVERRIDE)
|
||||
|
||||
// Generate event for rules processing - proposed by TridentTD
|
||||
|
||||
@@ -816,7 +817,7 @@ bool MQTTCheckSubscription_037(const String& Topic, const String& Subscription)
|
||||
// Test for multi-level wildcard (#) see: http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718107 (for MQTT 3 and
|
||||
// MQTT 5)
|
||||
|
||||
if (tmpSub == F("#")) { return true; // If the subscription is for '#' then all topics are accepted
|
||||
if (tmpSub.equals(F("#"))) { return true; // If the subscription is for '#' then all topics are accepted
|
||||
}
|
||||
|
||||
if (tmpSub.endsWith(F("/#"))) { // A valid MQTT multi-level wildcard is a # at the end of the topic that's preceded by a /
|
||||
@@ -877,7 +878,7 @@ bool MQTTCheckSubscription_037(const String& Topic, const String& Subscription)
|
||||
// If the subtopics match then OK - otherwise fail
|
||||
if (pSub == "#") { return true; }
|
||||
|
||||
if ((pTopic != pSub) && (pSub != F("+"))) { return false; }
|
||||
if ((pTopic != pSub) && (!pSub.equals(F("+")))) { return false; }
|
||||
|
||||
count = count + 1;
|
||||
}
|
||||
|
||||
@@ -374,12 +374,12 @@ boolean Plugin_053(uint8_t function, struct EventStruct *event, String& string)
|
||||
String command = parseString(string, 1);
|
||||
String subcommand = parseString(string, 2);
|
||||
|
||||
if (command == F("pmsx003")) {
|
||||
if (subcommand == F("wake")) {
|
||||
if (command.equals(F("pmsx003"))) {
|
||||
if (subcommand.equals(F("wake"))) {
|
||||
success = P053_data->wakeSensor();
|
||||
} else if (subcommand == F("sleep")) {
|
||||
} else if (subcommand.equals(F("sleep"))) {
|
||||
success = P053_data->sleepSensor();
|
||||
} else if (subcommand == F("reset")) {
|
||||
} else if (subcommand.equals(F("reset"))) {
|
||||
success = P053_data->resetSensor();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ boolean Plugin_054(uint8_t function, struct EventStruct *event, String& string)
|
||||
lowerString.toLowerCase();
|
||||
String command = parseString(lowerString, 1);
|
||||
|
||||
if (command == F("dmx"))
|
||||
if (command.equals(F("dmx")))
|
||||
{
|
||||
String param;
|
||||
String paramKey;
|
||||
@@ -172,7 +172,7 @@ boolean Plugin_054(uint8_t function, struct EventStruct *event, String& string)
|
||||
addLog(LOG_LEVEL_DEBUG_MORE, param);
|
||||
#endif
|
||||
|
||||
if (param == F("log"))
|
||||
if (param.equals(F("log")))
|
||||
{
|
||||
if (loglevelActiveFor(LOG_LEVEL_INFO)) {
|
||||
String log = F("DMX : ");
|
||||
@@ -186,7 +186,7 @@ boolean Plugin_054(uint8_t function, struct EventStruct *event, String& string)
|
||||
success = true;
|
||||
}
|
||||
|
||||
else if (param == F("test"))
|
||||
else if (param.equals(F("test")))
|
||||
{
|
||||
for (int16_t i = 0; i < Plugin_054_DMXSize; i++)
|
||||
//Plugin_054_DMXBuffer[i] = i+1;
|
||||
@@ -194,13 +194,13 @@ boolean Plugin_054(uint8_t function, struct EventStruct *event, String& string)
|
||||
success = true;
|
||||
}
|
||||
|
||||
else if (param == F("on"))
|
||||
else if (param.equals(F("on")))
|
||||
{
|
||||
memset(Plugin_054_DMXBuffer, 255, Plugin_054_DMXSize);
|
||||
success = true;
|
||||
}
|
||||
|
||||
else if (param == F("off"))
|
||||
else if (param.equals(F("off")))
|
||||
{
|
||||
memset(Plugin_054_DMXBuffer, 0, Plugin_054_DMXSize);
|
||||
success = true;
|
||||
|
||||
@@ -219,7 +219,7 @@ boolean Plugin_055(uint8_t function, struct EventStruct *event, String& string)
|
||||
|
||||
String command = parseString(string, 1);
|
||||
|
||||
if (command == F("chime"))
|
||||
if (command.equals(F("chime")))
|
||||
{
|
||||
String param = parseStringToEndKeepCase(string, 2);
|
||||
if (param.length() > 0) {
|
||||
@@ -227,7 +227,7 @@ boolean Plugin_055(uint8_t function, struct EventStruct *event, String& string)
|
||||
}
|
||||
success = true;
|
||||
}
|
||||
if (command == F("chimeplay"))
|
||||
if (command.equals(F("chimeplay")))
|
||||
{
|
||||
String name = parseString(string, 2);
|
||||
if (name.length() > 0) {
|
||||
@@ -237,7 +237,7 @@ boolean Plugin_055(uint8_t function, struct EventStruct *event, String& string)
|
||||
}
|
||||
success = true;
|
||||
}
|
||||
if (command == F("chimesave"))
|
||||
if (command.equals(F("chimesave")))
|
||||
{
|
||||
String name = parseString(string, 2);
|
||||
String param = parseStringToEndKeepCase(string, 3);
|
||||
|
||||
@@ -178,7 +178,7 @@ boolean Plugin_057(uint8_t function, struct EventStruct *event, String& string)
|
||||
|
||||
String command = parseString(string, 1);
|
||||
|
||||
if (command == F("mprint"))
|
||||
if (command.equals(F("mprint")))
|
||||
{
|
||||
String text = parseStringToEnd(string, 2);
|
||||
|
||||
@@ -202,7 +202,7 @@ boolean Plugin_057(uint8_t function, struct EventStruct *event, String& string)
|
||||
success = true;
|
||||
}
|
||||
}
|
||||
else if (command == F("mbr")) {
|
||||
else if (command.equals(F("mbr"))) {
|
||||
String param = parseString(string, 2);
|
||||
int brightness;
|
||||
|
||||
@@ -213,7 +213,7 @@ boolean Plugin_057(uint8_t function, struct EventStruct *event, String& string)
|
||||
}
|
||||
success = true;
|
||||
}
|
||||
else if ((command == F("m")) || (command == F("mx")) || (command == F("mnum")))
|
||||
else if ((command.equals(F("m"))) || (command.equals(F("mx"))) || (command.equals(F("mnum"))))
|
||||
{
|
||||
String param;
|
||||
String paramKey;
|
||||
@@ -238,7 +238,7 @@ boolean Plugin_057(uint8_t function, struct EventStruct *event, String& string)
|
||||
addLog(LOG_LEVEL_DEBUG_MORE, param);
|
||||
#endif
|
||||
|
||||
if (param == F("log"))
|
||||
if (param.equals(F("log")))
|
||||
{
|
||||
if (loglevelActiveFor(LOG_LEVEL_INFO)) {
|
||||
String log = F("MX : ");
|
||||
@@ -253,7 +253,7 @@ boolean Plugin_057(uint8_t function, struct EventStruct *event, String& string)
|
||||
success = true;
|
||||
}
|
||||
|
||||
else if (param == F("test"))
|
||||
else if (param.equals(F("test")))
|
||||
{
|
||||
for (uint8_t i = 0; i < 8; i++) {
|
||||
P057_data->ledMatrix.SetRow(i, 1 << i);
|
||||
@@ -261,7 +261,7 @@ boolean Plugin_057(uint8_t function, struct EventStruct *event, String& string)
|
||||
success = true;
|
||||
}
|
||||
|
||||
else if (param == F("clear"))
|
||||
else if (param.equals(F("clear")))
|
||||
{
|
||||
P057_data->ledMatrix.ClearRowBuffer();
|
||||
success = true;
|
||||
@@ -282,7 +282,7 @@ boolean Plugin_057(uint8_t function, struct EventStruct *event, String& string)
|
||||
paramVal = param;
|
||||
}
|
||||
|
||||
if (command == F("mnum"))
|
||||
if (command.equals(F("mnum")))
|
||||
{
|
||||
value = paramVal.toInt();
|
||||
|
||||
@@ -293,7 +293,7 @@ boolean Plugin_057(uint8_t function, struct EventStruct *event, String& string)
|
||||
P057_data->ledMatrix.SetRow(seg, value);
|
||||
}
|
||||
}
|
||||
else if (command == F("mx"))
|
||||
else if (command.equals(F("mx")))
|
||||
{
|
||||
char *ep;
|
||||
value = strtol(paramVal.c_str(), &ep, 16);
|
||||
|
||||
@@ -184,7 +184,7 @@ boolean Plugin_059(uint8_t function, struct EventStruct *event, String& string)
|
||||
if (P_059_sensordefs.count(event->TaskIndex) != 0)
|
||||
{
|
||||
String command = parseString(string, 1);
|
||||
if (command == F("encwrite"))
|
||||
if (command.equals(F("encwrite")))
|
||||
{
|
||||
if (event->Par1 >= 0)
|
||||
{
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
// Note: The chip has a wide view-of-angle. If housing is in this angle the chip blocks!
|
||||
|
||||
// 2022-08-12 tonhuisman: Remove [DEVELOPMENT] tag
|
||||
// 2020-04-25 tonhuisman: Added Plugin Mode setting to switch between Proximity/Ambient Light Sensor or R/G/B Colors.
|
||||
// Added settings for Gain (Gesture, Proximity, Ambient Light Sensor), Led Power (Gesture and Proximity/ALS) and Led Boost (Gesture)
|
||||
// to allow better tuning for use of the sensor. Also adapted the SparkFun_APDS9960 driver for enabling this.
|
||||
@@ -25,7 +26,7 @@
|
||||
|
||||
#define PLUGIN_064
|
||||
#define PLUGIN_ID_064 64
|
||||
#define PLUGIN_NAME_064 "Gesture - APDS9960 [DEVELOPMENT]"
|
||||
#define PLUGIN_NAME_064 "Gesture - APDS9960"
|
||||
#define PLUGIN_GPL_VALUENAME1_064 "Gesture"
|
||||
#define PLUGIN_GPL_VALUENAME2_064 "Proximity"
|
||||
#define PLUGIN_GPL_VALUENAME3_064 "Light"
|
||||
|
||||
@@ -141,19 +141,19 @@ boolean Plugin_065(uint8_t function, struct EventStruct *event, String& string)
|
||||
int value;
|
||||
bool valueValid = validIntFromString(param, value);
|
||||
|
||||
if (valueValid && (command == F("play")))
|
||||
if (valueValid && (command.equals(F("play"))))
|
||||
{
|
||||
Plugin_065_Play(value);
|
||||
success = true;
|
||||
}
|
||||
|
||||
if (command == F("stop"))
|
||||
if (command.equals(F("stop")))
|
||||
{
|
||||
Plugin_065_SendCmd(0x0E, 0);
|
||||
success = true;
|
||||
}
|
||||
|
||||
if (valueValid && (command == F("vol")))
|
||||
if (valueValid && (command.equals(F("vol"))))
|
||||
{
|
||||
if (value == 0) { value = 30; }
|
||||
PCONFIG(0) = value;
|
||||
@@ -161,19 +161,19 @@ boolean Plugin_065(uint8_t function, struct EventStruct *event, String& string)
|
||||
success = true;
|
||||
}
|
||||
|
||||
if (valueValid && (command == F("eq")))
|
||||
if (valueValid && (command.equals(F("eq"))))
|
||||
{
|
||||
Plugin_065_SetEQ(value);
|
||||
success = true;
|
||||
}
|
||||
|
||||
if (valueValid && (command == F("mode")))
|
||||
if (valueValid && (command.equals(F("mode"))))
|
||||
{
|
||||
Plugin_065_SetMode(value);
|
||||
success = true;
|
||||
}
|
||||
|
||||
if (valueValid && (command == F("repeat")))
|
||||
if (valueValid && (command.equals(F("repeat"))))
|
||||
{
|
||||
Plugin_065_SetRepeat(value);
|
||||
success = true;
|
||||
@@ -185,7 +185,7 @@ boolean Plugin_065(uint8_t function, struct EventStruct *event, String& string)
|
||||
log = F("MP3 : ");
|
||||
log += command;
|
||||
|
||||
if (command != F("stop")) {
|
||||
if (!command.equals(F("stop"))) {
|
||||
log += '=';
|
||||
log += value;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ boolean Plugin_070(uint8_t function, struct EventStruct *event, String& string)
|
||||
|
||||
P070_data_struct *P070_data = static_cast<P070_data_struct *>(getPluginTaskData(event->TaskIndex));
|
||||
|
||||
if ((nullptr != P070_data) && (command == F("clock"))) {
|
||||
if ((nullptr != P070_data) && (command.equals(F("clock")))) {
|
||||
int val_Mode;
|
||||
|
||||
if (validIntFromString(param1, val_Mode)) {
|
||||
|
||||
+15
-15
@@ -361,41 +361,41 @@ bool p073_plugin_write(struct EventStruct *event,
|
||||
|
||||
const String text = parseStringToEndKeepCase(string, 2);
|
||||
|
||||
if (cmd.equals("7dn")) {
|
||||
if (cmd.equals(F("7dn"))) {
|
||||
return p073_plugin_write_7dn(event, text);
|
||||
} else if (cmd.equals("7dt")) {
|
||||
} else if (cmd.equals(F("7dt"))) {
|
||||
return p073_plugin_write_7dt(event, text);
|
||||
# ifdef P073_7DDT_COMMAND
|
||||
} else if (cmd.equals("7ddt")) {
|
||||
} else if (cmd.equals(F("7ddt"))) {
|
||||
return p073_plugin_write_7ddt(event, text);
|
||||
# endif // ifdef P073_7DDT_COMMAND
|
||||
} else if (cmd.equals("7dst")) {
|
||||
} else if (cmd.equals(F("7dst"))) {
|
||||
return p073_plugin_write_7dst(event);
|
||||
} else if (cmd.equals("7dsd")) {
|
||||
} else if (cmd.equals(F("7dsd"))) {
|
||||
return p073_plugin_write_7dsd(event);
|
||||
} else if (cmd.equals("7dtext")) {
|
||||
} else if (cmd.equals(F("7dtext"))) {
|
||||
return p073_plugin_write_7dtext(event, text);
|
||||
# ifdef P073_EXTRA_FONTS
|
||||
} else if (cmd.equals("7dfont")) {
|
||||
} else if (cmd.equals(F("7dfont"))) {
|
||||
return p073_plugin_write_7dfont(event, text);
|
||||
# endif // P073_EXTRA_FONTS
|
||||
# ifdef P073_7DBIN_COMMAND
|
||||
} else if (cmd.equals("7dbin")) {
|
||||
} else if (cmd.equals(F("7dbin"))) {
|
||||
return p073_plugin_write_7dbin(event, text);
|
||||
# endif // P073_7DBIN_COMMAND
|
||||
} else {
|
||||
bool p073_validcmd = false;
|
||||
bool p073_displayon = false;
|
||||
|
||||
if (cmd.equals("7don")) {
|
||||
if (cmd.equals(F("7don"))) {
|
||||
addLog(LOG_LEVEL_INFO, F("7DGT : Display ON"));
|
||||
p073_displayon = true;
|
||||
p073_validcmd = true;
|
||||
} else if (cmd.equals("7doff")) {
|
||||
} else if (cmd.equals(F("7doff"))) {
|
||||
addLog(LOG_LEVEL_INFO, F("7DGT : Display OFF"));
|
||||
p073_displayon = false;
|
||||
p073_validcmd = true;
|
||||
} else if (cmd.equals("7db")) {
|
||||
} else if (cmd.equals(F("7db"))) {
|
||||
if ((event->Par1 >= 0) && (event->Par1 < 16)) {
|
||||
if (loglevelActiveFor(LOG_LEVEL_INFO)) {
|
||||
String log = F("7DGT : Brightness=");
|
||||
@@ -820,13 +820,13 @@ bool p073_plugin_write_7dfont(struct EventStruct *event,
|
||||
String fontArg = parseString(text, 1);
|
||||
int fontNr = -1;
|
||||
|
||||
if ((fontArg == F("default")) || (fontArg == F("7dgt"))) {
|
||||
if ((fontArg.equals(F("default"))) || (fontArg.equals(F("7dgt")))) {
|
||||
fontNr = 0;
|
||||
} else if (fontArg == F("siekoo")) {
|
||||
} else if (fontArg.equals(F("siekoo"))) {
|
||||
fontNr = 1;
|
||||
} else if (fontArg == F("siekoo_upper")) {
|
||||
} else if (fontArg.equals(F("siekoo_upper"))) {
|
||||
fontNr = 2;
|
||||
} else if (fontArg == F("dseg7")) {
|
||||
} else if (fontArg.equals(F("dseg7"))) {
|
||||
fontNr = 3;
|
||||
} else if (!validIntFromString(text, fontNr)) {
|
||||
fontNr = -1; // reset if invalid
|
||||
|
||||
@@ -473,9 +473,9 @@ boolean Plugin_075(uint8_t function, struct EventStruct *event, String& string)
|
||||
|
||||
if (argIndex) { Nvalue = tmpString.substring(argIndex + 2, argEnd); }
|
||||
|
||||
if (Nvalue == F("On")) { Svalue = '1'; }
|
||||
if (Nvalue.equals(F("On"))) { Svalue = '1'; }
|
||||
|
||||
if (Nvalue == F("Off")) { Svalue = '0'; }
|
||||
if (Nvalue.equals(F("Off"))) { Svalue = '0'; }
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -273,7 +273,7 @@ boolean Plugin_079(uint8_t function, struct EventStruct *event, String& string)
|
||||
return true; // Exit now. Info Log shows Lolin Info.
|
||||
}
|
||||
else {
|
||||
if ((paramMotor == F("0")) || (paramMotor == F("1"))) {
|
||||
if ((paramMotor.equals(F("0"))) || (paramMotor.equals(F("1")))) {
|
||||
motor_number = paramMotor.toInt();
|
||||
}
|
||||
else {
|
||||
|
||||
+1
-1
@@ -676,7 +676,7 @@ void P082_html_show_stats(struct EventStruct *event) {
|
||||
return;
|
||||
}
|
||||
addRowLabel(F("Fix"));
|
||||
addHtmlInt(P082_data->hasFix(P082_TIMEOUT));
|
||||
addEnabled(P082_data->hasFix(P082_TIMEOUT));
|
||||
|
||||
addRowLabel(F("Fix Quality"));
|
||||
|
||||
|
||||
+1
-1
@@ -180,7 +180,7 @@ boolean Plugin_086(uint8_t function, struct EventStruct *event, String& string)
|
||||
case PLUGIN_WRITE:
|
||||
{
|
||||
String command = parseString(string, 1);
|
||||
if (command == F("homievalueset"))
|
||||
if (command.equals(F("homievalueset")))
|
||||
{
|
||||
const taskVarIndex_t taskVarIndex = event->Par2 - 1;
|
||||
const userVarIndex_t userVarIndex = event->BaseVarIndex + taskVarIndex;
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ boolean Plugin_089(uint8_t function, struct EventStruct *event, String& string)
|
||||
{
|
||||
String command = parseString(string, 1);
|
||||
|
||||
if (command == F("pingset"))
|
||||
if (command.equals(F("pingset")))
|
||||
{
|
||||
String taskName = parseString(string, 2);
|
||||
taskIndex_t taskIndex = findTaskIndexByName(taskName);
|
||||
|
||||
@@ -583,7 +583,7 @@ boolean Plugin_091(uint8_t function, struct EventStruct *event, String& string)
|
||||
|
||||
if (Plugin_091_init)
|
||||
{
|
||||
if ( command == F("relay") ) // deal with relay change command
|
||||
if ( command.equals(F("relay"))) // deal with relay change command
|
||||
{
|
||||
success = true;
|
||||
|
||||
@@ -633,7 +633,7 @@ boolean Plugin_091(uint8_t function, struct EventStruct *event, String& string)
|
||||
}
|
||||
}
|
||||
|
||||
if ( command == F("relaypulse") )
|
||||
if ( command.equals(F("relaypulse")))
|
||||
{
|
||||
success = true;
|
||||
|
||||
@@ -685,7 +685,7 @@ boolean Plugin_091(uint8_t function, struct EventStruct *event, String& string)
|
||||
}
|
||||
}
|
||||
|
||||
if ( command == F("relaylongpulse") )
|
||||
if ( command.equals(F("relaylongpulse")))
|
||||
{
|
||||
success = true;
|
||||
|
||||
@@ -737,7 +737,7 @@ boolean Plugin_091(uint8_t function, struct EventStruct *event, String& string)
|
||||
addLogMove(LOG_LEVEL_INFO, log);
|
||||
}
|
||||
}
|
||||
if ( command == F("ydim") ) // deal with dimmer command
|
||||
if ( command.equals(F("ydim")) ) // deal with dimmer command
|
||||
{
|
||||
if (( (Plugin_091_globalpar0 == SER_SWITCH_YEWE) && (Plugin_091_numrelay > 1)) || (Plugin_091_globalpar0 == SER_SWITCH_WIFIDIMMER)) { // only on tuya dimmer
|
||||
success = true;
|
||||
|
||||
@@ -388,28 +388,28 @@ boolean Plugin_098(uint8_t function, struct EventStruct *event, String& string)
|
||||
const String command = parseString(string, 1);
|
||||
|
||||
if (command.startsWith(F("pwmmotor"))) {
|
||||
if (command == F("pwmmotorhome")) {
|
||||
if (command.equals(F("pwmmotorhome"))) {
|
||||
// Run the motor in reverse till limit A switch is reached
|
||||
P098_data->findHome();
|
||||
success = true;
|
||||
} else if (command == F("pwmmotorend")) {
|
||||
} else if (command.equals(F("pwmmotorend"))) {
|
||||
// Run the motor forward till limit B switch is reached
|
||||
P098_data->moveForward(-1);
|
||||
success = true;
|
||||
} else if (command == F("pwmmotorforward")) {
|
||||
} else if (command.equals(F("pwmmotorforward"))) {
|
||||
// Run the motor N steps forward
|
||||
// N <= 0: Move till limit B switch is reached
|
||||
P098_data->moveForward(event->Par1);
|
||||
success = true;
|
||||
} else if (command == F("pwmmotorreverse")) {
|
||||
} else if (command.equals(F("pwmmotorreverse"))) {
|
||||
// Run the motor N steps in reverse
|
||||
P098_data->moveReverse(event->Par1);
|
||||
success = true;
|
||||
} else if (command == F("pwmmotorstop")) {
|
||||
} else if (command.equals(F("pwmmotorstop"))) {
|
||||
// Run the motor N steps in reverse
|
||||
P098_data->stop();
|
||||
success = true;
|
||||
} else if (command == F("pwmmotormovetopos")) {
|
||||
} else if (command.equals(F("pwmmotormovetopos"))) {
|
||||
// Run the motor in the required direction to position N
|
||||
// What to do when position is unknown?
|
||||
if (!P098_data->moveToPos(event->Par1)) {
|
||||
|
||||
@@ -427,10 +427,10 @@ uint8_t safeName(taskIndex_t index) {
|
||||
safeCode = NAME_MISSING;
|
||||
}
|
||||
|
||||
if (devName == F("reboot")) {
|
||||
if (devName.equals(F("reboot"))) {
|
||||
safeCode = NAME_UNSAFE;
|
||||
}
|
||||
else if (devName == F("reset")) {
|
||||
else if (devName.equals(F("reset"))) {
|
||||
safeCode = NAME_UNSAFE;
|
||||
}
|
||||
|
||||
|
||||
@@ -347,7 +347,7 @@ boolean Plugin_102(uint8_t function, struct EventStruct *event, String& string)
|
||||
{
|
||||
String command = parseString(string, 1);
|
||||
|
||||
if ((command == F("resetenergy")) && (P102_PZEM_FIRST == event->TaskIndex))
|
||||
if ((command.equals(F("resetenergy"))) && (P102_PZEM_FIRST == event->TaskIndex))
|
||||
{
|
||||
if ((event->Par1 >= 0) && (event->Par1 <= 247))
|
||||
{
|
||||
|
||||
@@ -99,19 +99,19 @@ boolean Plugin_103(uint8_t function, struct EventStruct *event, String &string)
|
||||
String version = boardInfo.substring(boardInfo.lastIndexOf(',') + 1);
|
||||
addHtml(board);
|
||||
|
||||
if (board == F("pH"))
|
||||
if (board.equals(F("pH")))
|
||||
{
|
||||
board_type = PH;
|
||||
}
|
||||
else if (board == F("ORP"))
|
||||
else if (board.equals(F("ORP")))
|
||||
{
|
||||
board_type = ORP;
|
||||
}
|
||||
else if (board == F("EC"))
|
||||
else if (board.equals(F("EC")))
|
||||
{
|
||||
board_type = EC;
|
||||
}
|
||||
else if (board == F("D.O."))
|
||||
else if (board.equals(F("D.O.")))
|
||||
{
|
||||
board_type = DO;
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
// The bar width is determined by the number of graph-strings
|
||||
//
|
||||
// History:
|
||||
// 2022-08-12 tonhuisman: Remove [DEVELOPMENT] tag
|
||||
// 2021-10-03 tonhuisman: Add Inverted option per zone
|
||||
// 2021-09 tonhuisman: Minor improvements, attempts to fix stack failures
|
||||
// 2021-08-08 tonhuisman: Reworked loading & saving the settings from A huge fixed size pre-allocated block to dynamic allocation
|
||||
@@ -106,7 +107,7 @@
|
||||
|
||||
# define PLUGIN_104
|
||||
# define PLUGIN_ID_104 104
|
||||
# define PLUGIN_NAME_104 "Display - MAX7219 dot matrix [DEVELOPMENT]"
|
||||
# define PLUGIN_NAME_104 "Display - MAX7219 dot matrix"
|
||||
|
||||
# define PLUGIN_104_DEBUG true // activate extra log info in the debug
|
||||
|
||||
|
||||
+15
-15
@@ -570,41 +570,41 @@ boolean Plugin_109(byte function, struct EventStruct *event, String& string)
|
||||
String logstr;
|
||||
|
||||
if (Plugin_109_init) {
|
||||
if (command == F("oledframedcmd"))
|
||||
if (command.equals(F("oledframedcmd")))
|
||||
{
|
||||
success = true;
|
||||
|
||||
if (subcommand == F("off")) {
|
||||
if (subcommand.equals(F("off"))) {
|
||||
P109_setContrast(P109_CONTRAST_OFF);
|
||||
}
|
||||
else if (subcommand == F("on")) {
|
||||
else if (subcommand.equals(F("on"))) {
|
||||
P109_display->displayOn();
|
||||
}
|
||||
else if (subcommand == F("low")) {
|
||||
else if (subcommand.equals(F("low"))) {
|
||||
P109_setContrast(P109_CONTRAST_LOW);
|
||||
}
|
||||
else if (subcommand == F("med")) {
|
||||
else if (subcommand.equals(F("med"))) {
|
||||
P109_setContrast(P109_CONTRAST_MED);
|
||||
}
|
||||
else if (subcommand == F("high")) {
|
||||
else if (subcommand.equals(F("high"))) {
|
||||
P109_setContrast(P109_CONTRAST_HIGH);
|
||||
}
|
||||
logstr = F("\nOk");
|
||||
SendStatus(event, logstr);
|
||||
}
|
||||
|
||||
if (command == F("thermo"))
|
||||
if (command.equals(F("thermo")))
|
||||
{
|
||||
success = true;
|
||||
String par1 = parseString(string, 3);
|
||||
|
||||
if (subcommand == F("setpoint")) {
|
||||
if (subcommand.equals(F("setpoint"))) {
|
||||
P109_setSetpoint(par1);
|
||||
}
|
||||
else if (subcommand == F("heating")) {
|
||||
else if (subcommand.equals(F("heating"))) {
|
||||
P109_setHeater(par1); Plugin_109_changed = 1;
|
||||
}
|
||||
else if (subcommand == F("mode")) {
|
||||
else if (subcommand.equals(F("mode"))) {
|
||||
P109_setMode(par1, parseString(string, 4));
|
||||
}
|
||||
logstr = F("\nOk");
|
||||
@@ -910,10 +910,10 @@ void P109_setHeatRelay(byte state) {
|
||||
}
|
||||
|
||||
void P109_setHeater(String heater) {
|
||||
if ((heater == F("1")) || (heater == F("on"))) {
|
||||
if ((heater.equals(F("1"))) || (heater.equals(F("on")))) {
|
||||
UserVar[Plugin_109_varindex + 1] = 1;
|
||||
P109_setHeatRelay(HIGH);
|
||||
} else if ((heater == F("0")) || (heater == F("off"))) {
|
||||
} else if ((heater.equals(F("0"))) || (heater.equals(F("off")))) {
|
||||
UserVar[Plugin_109_varindex + 1] = 0;
|
||||
P109_setHeatRelay(LOW);
|
||||
} else if (UserVar[Plugin_109_varindex + 1] == 0) {
|
||||
@@ -927,16 +927,16 @@ void P109_setHeater(String heater) {
|
||||
}
|
||||
|
||||
void P109_setMode(String amode, String atimeout) {
|
||||
if ((amode == F("0")) || (amode == F("x"))) {
|
||||
if ((amode.equals(F("0"))) || (amode.equals(F("x")))) {
|
||||
UserVar[Plugin_109_varindex + 2] = 0;
|
||||
P109_setHeater(F("0"));
|
||||
P109_display->setColor(BLACK);
|
||||
P109_display->fillRect(86, 35, 41, 21);
|
||||
Plugin_109_prev_setpoint = 0;
|
||||
} else if ((amode == F("1")) || (amode == F("a"))) {
|
||||
} else if ((amode.equals(F("1"))) || (amode.equals(F("a")))) {
|
||||
UserVar[Plugin_109_varindex + 2] = 1;
|
||||
P109_display_setpoint_temp(1);
|
||||
} else if ((amode == F("2")) || (amode == F("m"))) {
|
||||
} else if ((amode.equals(F("2"))) || (amode.equals(F("m")))) {
|
||||
UserVar[Plugin_109_varindex + 2] = 2;
|
||||
UserVar[Plugin_109_varindex + 3] = (atimeout.toFloat() * 60);
|
||||
Plugin_109_prev_timeout = 32768;
|
||||
|
||||
@@ -171,7 +171,7 @@ boolean Plugin_115(uint8_t function, struct EventStruct *event, String& string)
|
||||
if ((nullptr != P115_data) && P115_data->initialized) {
|
||||
const String command = parseString(string, 1);
|
||||
|
||||
if ((command == F("max1704xclearalert")))
|
||||
if ((command.equals(F("max1704xclearalert"))))
|
||||
{
|
||||
P115_data->clearAlert();
|
||||
success = true;
|
||||
|
||||
@@ -113,7 +113,7 @@ bool Blynk_get(const String& command, controllerIndex_t controllerIndex, float *
|
||||
bool success = !MustCheckReply;
|
||||
|
||||
if (MustCheckReply || data) {
|
||||
unsigned long timer = millis() + 200;
|
||||
unsigned long timer = millis() + ClientTimeout;
|
||||
|
||||
while (!client_available(client) && !timeOutReached(timer)) {
|
||||
delay(1);
|
||||
@@ -133,7 +133,7 @@ bool Blynk_get(const String& command, controllerIndex_t controllerIndex, float *
|
||||
#endif
|
||||
|
||||
// success ?
|
||||
if (line.substring(0, 15) == F("HTTP/1.1 200 OK")) {
|
||||
if (line.substring(0, 15).equals(F("HTTP/1.1 200 OK"))) {
|
||||
#ifndef BUILD_NO_DEBUG
|
||||
strcpy_P(log, PSTR("HTTP : Success"));
|
||||
#endif
|
||||
@@ -141,10 +141,10 @@ bool Blynk_get(const String& command, controllerIndex_t controllerIndex, float *
|
||||
if (!data) { success = true; }
|
||||
}
|
||||
#ifndef BUILD_NO_DEBUG
|
||||
else if (line.substring(0, 24) == F("HTTP/1.1 400 Bad Request")) {
|
||||
else if (line.substring(0, 24).equals(F("HTTP/1.1 400 Bad Request"))) {
|
||||
strcpy_P(log, PSTR("HTTP : Unauthorized"));
|
||||
}
|
||||
else if (line.substring(0, 25) == F("HTTP/1.1 401 Unauthorized")) {
|
||||
else if (line.substring(0, 25).equals(F("HTTP/1.1 401 Unauthorized"))) {
|
||||
strcpy_P(log, PSTR("HTTP : Unauthorized"));
|
||||
}
|
||||
addLog(LOG_LEVEL_DEBUG, log);
|
||||
@@ -171,13 +171,15 @@ bool Blynk_get(const String& command, controllerIndex_t controllerIndex, float *
|
||||
delay(0);
|
||||
}
|
||||
}
|
||||
#ifndef BUILD_NO_DEBUG
|
||||
addLog(LOG_LEVEL_DEBUG, F("HTTP : closing connection (012)"));
|
||||
#endif
|
||||
|
||||
client.flush();
|
||||
client.stop();
|
||||
|
||||
// important - backgroundtasks - free mem
|
||||
unsigned long timer = millis() + ClientTimeout;
|
||||
unsigned long timer = millis() + 10;
|
||||
|
||||
while (!timeOutReached(timer)) {
|
||||
backgroundtasks();
|
||||
|
||||
@@ -663,6 +663,12 @@ bool ExecuteCommand(taskIndex_t taskIndex,
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!handled) {
|
||||
// Try a controller
|
||||
handled = CPluginCall(CPlugin::Function::CPLUGIN_WRITE, &TempEvent, tmpAction);
|
||||
|
||||
}
|
||||
|
||||
if (handled) {
|
||||
SendStatus(&TempEvent, return_command_success());
|
||||
return true;
|
||||
|
||||
@@ -1313,6 +1313,15 @@ To create/register a plugin, you have to :
|
||||
#ifdef PLUGIN_ENERGY_COLLECTION
|
||||
#ifndef PLUGIN_DESCR
|
||||
#define PLUGIN_DESCR "Energy"
|
||||
#endif
|
||||
#if !defined(LIMIT_BUILD_SIZE) && (defined(ESP8266) || !(ESP_IDF_VERSION_MAJOR > 3))
|
||||
// #define LIMIT_BUILD_SIZE // Reduce buildsize (on ESP8266 / pre-IDF4.x) to fit in all Energy plugins
|
||||
#ifndef P036_LIMIT_BUILD_SIZE
|
||||
#define P036_LIMIT_BUILD_SIZE // Reduce build size for P036 (FramedOLED) only
|
||||
#endif
|
||||
#ifndef P037_LIMIT_BUILD_SIZE
|
||||
#define P037_LIMIT_BUILD_SIZE // Reduce build size for P037 (MQTT Import) only
|
||||
#endif
|
||||
#endif
|
||||
#ifndef USES_P025
|
||||
#define USES_P025 // ADS1115
|
||||
@@ -1356,7 +1365,9 @@ To create/register a plugin, you have to :
|
||||
#define PLUGIN_DESCR "Display"
|
||||
#endif
|
||||
#if !defined(LIMIT_BUILD_SIZE) && (defined(ESP8266) || !(ESP_IDF_VERSION_MAJOR > 3))
|
||||
#define LIMIT_BUILD_SIZE // Reduce buildsize (on ESP8266 / pre-IDF4.x) to fit in all Display plugins
|
||||
#ifndef PLUGIN_BUILD_MAX_ESP32
|
||||
#define LIMIT_BUILD_SIZE // Reduce buildsize (on ESP8266 / pre-IDF4.x) to fit in all Display plugins
|
||||
#endif
|
||||
#endif
|
||||
#if !defined(FEATURE_SD)
|
||||
#define FEATURE_SD 1
|
||||
@@ -1861,6 +1872,12 @@ To create/register a plugin, you have to :
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef PLUGIN_BUILD_MAX_ESP32
|
||||
#ifdef LIMIT_BUILD_SIZE
|
||||
#undef LIMIT_BUILD_SIZE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Disable some diagnostic parts to make builds fit.
|
||||
#ifdef LIMIT_BUILD_SIZE
|
||||
#ifdef WEBSERVER_TIMINGSTATS
|
||||
|
||||
@@ -76,14 +76,14 @@ bool PluginStats::plugin_get_config_value_base(struct EventStruct *event, String
|
||||
|
||||
float value;
|
||||
|
||||
if (command == F("min")) { // [taskname#valuename.min] Lowest value seen since value reset
|
||||
if (command.equals(F("min"))) { // [taskname#valuename.min] Lowest value seen since value reset
|
||||
value = getPeakLow();
|
||||
success = true;
|
||||
} else if (command == F("max")) { // [taskname#valuename.max] Highest value seen since value reset
|
||||
} else if (command.equals(F("max"))) { // [taskname#valuename.max] Highest value seen since value reset
|
||||
value = getPeakHigh();
|
||||
success = true;
|
||||
} else if (command.startsWith(F("avg"))) {
|
||||
if (command == F("avg")) { // [taskname#valuename.avg] Average value of the last N kept samples
|
||||
if (command.equals(F("avg"))) { // [taskname#valuename.avg] Average value of the last N kept samples
|
||||
value = getSampleAvg();
|
||||
success = true;
|
||||
} else {
|
||||
|
||||
@@ -150,6 +150,7 @@ const __FlashStringHelper * getCPluginCFunctionName(CPlugin::Function function)
|
||||
case CPlugin::Function::CPLUGIN_FIFTY_PER_SECOND: return F("CPLUGIN_FIFTY_PER_SECOND");
|
||||
case CPlugin::Function::CPLUGIN_INIT_ALL: return F("CPLUGIN_INIT_ALL");
|
||||
case CPlugin::Function::CPLUGIN_EXIT: return F("CPLUGIN_EXIT");
|
||||
case CPlugin::Function::CPLUGIN_WRITE: return F("CPLUGIN_WRITE");
|
||||
|
||||
case CPlugin::Function::CPLUGIN_GOT_CONNECTED:
|
||||
case CPlugin::Function::CPLUGIN_GOT_INVALID:
|
||||
@@ -181,6 +182,7 @@ bool mustLogCFunction(CPlugin::Function function) {
|
||||
case CPlugin::Function::CPLUGIN_FIFTY_PER_SECOND: return true;
|
||||
case CPlugin::Function::CPLUGIN_INIT_ALL: return false;
|
||||
case CPlugin::Function::CPLUGIN_EXIT: return false;
|
||||
case CPlugin::Function::CPLUGIN_WRITE: return true;
|
||||
|
||||
case CPlugin::Function::CPLUGIN_GOT_CONNECTED:
|
||||
case CPlugin::Function::CPLUGIN_GOT_INVALID:
|
||||
|
||||
@@ -85,6 +85,7 @@ public:
|
||||
CPLUGIN_FIFTY_PER_SECOND, // Called 50x per second (typical for checking new data instead of waiting)
|
||||
CPLUGIN_INIT_ALL,
|
||||
CPLUGIN_EXIT,
|
||||
CPLUGIN_WRITE, // Send commands to a controller.
|
||||
|
||||
|
||||
// new messages for autodiscover controller plugins (experimental) i.e. C014
|
||||
|
||||
@@ -840,7 +840,7 @@ void processMatchedRule(String& action, const String& event,
|
||||
}
|
||||
}
|
||||
|
||||
if ((lcAction == F("else")) && !fakeIfBlock) // in case of an "else" block of
|
||||
if ((lcAction.equals(F("else"))) && !fakeIfBlock) // in case of an "else" block of
|
||||
// actions, set ifBranche to
|
||||
// false
|
||||
{
|
||||
@@ -858,7 +858,7 @@ void processMatchedRule(String& action, const String& event,
|
||||
#endif // ifndef BUILD_NO_DEBUG
|
||||
}
|
||||
|
||||
if (lcAction == F("endif")) // conditional block ends here
|
||||
if (lcAction.equals(F("endif"))) // conditional block ends here
|
||||
{
|
||||
if (fakeIfBlock) {
|
||||
fakeIfBlock--;
|
||||
|
||||
@@ -193,6 +193,10 @@ void ESPEasy_setup()
|
||||
|
||||
if (loglevelActiveFor(LOG_LEVEL_INFO)) {
|
||||
String log = F("\n\n\rINIT : Booting version: ");
|
||||
log += getValue(LabelType::BINARY_FILENAME);
|
||||
log += F(", (");
|
||||
log += get_build_origin();
|
||||
log += F(") ");
|
||||
log += getValue(LabelType::GIT_BUILD);
|
||||
log += F(" (");
|
||||
log += getSystemLibraryString();
|
||||
|
||||
@@ -96,6 +96,7 @@ bool CPluginCall(CPlugin::Function Function, struct EventStruct *event, String&
|
||||
case CPlugin::Function::CPLUGIN_FLUSH:
|
||||
case CPlugin::Function::CPLUGIN_TEN_PER_SECOND:
|
||||
case CPlugin::Function::CPLUGIN_FIFTY_PER_SECOND:
|
||||
case CPlugin::Function::CPLUGIN_WRITE:
|
||||
|
||||
if (Function == CPlugin::Function::CPLUGIN_INIT_ALL) {
|
||||
Function = CPlugin::Function::CPLUGIN_INIT;
|
||||
@@ -106,7 +107,10 @@ bool CPluginCall(CPlugin::Function Function, struct EventStruct *event, String&
|
||||
protocolIndex_t ProtocolIndex = getProtocolIndex_from_ControllerIndex(x);
|
||||
event->ControllerIndex = x;
|
||||
String dummy;
|
||||
CPluginCall(ProtocolIndex, Function, event, dummy);
|
||||
const bool success = CPluginCall(ProtocolIndex, Function, event, dummy);
|
||||
if (success && Function == CPlugin::Function::CPLUGIN_WRITE) {
|
||||
return success;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -1792,12 +1792,12 @@ bool AdafruitGFX_helper::pluginGetConfigValue(String& string) {
|
||||
bool success = false;
|
||||
String command = parseString(string, 1);
|
||||
|
||||
if (command == F("win")) { // win: get current window id
|
||||
if (command.equals(F("win"))) { // win: get current window id
|
||||
# if ADAGFX_ENABLE_FRAMED_WINDOW // if feature enabled
|
||||
string = getWindow();
|
||||
success = true;
|
||||
# endif // if ADAGFX_ENABLE_FRAMED_WINDOW
|
||||
} else if (command == F("iswin")) { // iswin: check if windows exists
|
||||
} else if (command.equals(F("iswin"))) { // iswin: check if windows exists
|
||||
# if ADAGFX_ENABLE_FRAMED_WINDOW // if feature enabled
|
||||
command = parseString(string, 2);
|
||||
int win = 0;
|
||||
@@ -1809,39 +1809,39 @@ bool AdafruitGFX_helper::pluginGetConfigValue(String& string) {
|
||||
}
|
||||
success = true; // Always correct, just return 'false' if wrong
|
||||
# endif // if ADAGFX_ENABLE_FRAMED_WINDOW
|
||||
} else if ((command == F("width")) || // width/height: get window width or height
|
||||
(command == F("height"))) {
|
||||
} else if ((command.equals(F("width"))) || // width/height: get window width or height
|
||||
(command.equals(F("height")))) {
|
||||
# if ADAGFX_ENABLE_FRAMED_WINDOW // if feature enabled
|
||||
uint16_t w = 0, h = 0;
|
||||
getWindowLimits(w, h);
|
||||
|
||||
if (command == F("width")) {
|
||||
if (command.equals(F("width"))) {
|
||||
string = w;
|
||||
} else {
|
||||
string = h;
|
||||
}
|
||||
success = true;
|
||||
# endif // if ADAGFX_ENABLE_FRAMED_WINDOW
|
||||
} else if ((command == F("length")) || // length/textheight: get text length or height
|
||||
(command == F("textheight"))) {
|
||||
} else if ((command.equals(F("length"))) || // length/textheight: get text length or height
|
||||
(command.equals(F("textheight")))) {
|
||||
int16_t x1, y1;
|
||||
uint16_t w1, h1;
|
||||
String newString = AdaGFXparseTemplate(parseStringToEndKeepCase(string, 2), 0);
|
||||
_display->getTextBounds(newString, 0, 0, &x1, &y1, &w1, &h1); // Count length and height
|
||||
|
||||
if (command == F("length")) {
|
||||
if (command.equals(F("length"))) {
|
||||
string = w1;
|
||||
} else {
|
||||
string = h1;
|
||||
}
|
||||
success = true;
|
||||
} else if (command == F("rot")) { // rot: get current rotation setting
|
||||
} else if (command.equals(F("rot"))) { // rot: get current rotation setting
|
||||
string = _rotation;
|
||||
success = true;
|
||||
} else if (command == F("txs")) { // txs: get current text scaling setting
|
||||
} else if (command.equals(F("txs"))) { // txs: get current text scaling setting
|
||||
string = _fontscaling;
|
||||
success = true;
|
||||
} else if (command == F("tpm")) { // tpm: get current text print mode setting
|
||||
} else if (command.equals(F("tpm"))) { // tpm: get current text print mode setting
|
||||
string = static_cast<int>(_textPrintMode);
|
||||
success = true;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ fs::File tryOpenFile(const String& fname, const String& mode) {
|
||||
bool exists = fileExists(fname);
|
||||
|
||||
if (!exists) {
|
||||
if (mode == F("r")) {
|
||||
if (mode.equals(F("r"))) {
|
||||
return f;
|
||||
}
|
||||
Cache.fileExistsMap.clear();
|
||||
|
||||
@@ -652,10 +652,11 @@ const __FlashStringHelper* getFlashChipMode() {
|
||||
#ifdef ESP8266
|
||||
|
||||
switch (ESP.getFlashChipMode()) {
|
||||
case FM_QIO: return F("QIO");
|
||||
case FM_QOUT: return F("QOUT");
|
||||
case FM_DIO: return F("DIO");
|
||||
case FM_DOUT: return F("DOUT");
|
||||
case FM_QIO: return F("QIO");
|
||||
case FM_QOUT: return F("QOUT");
|
||||
case FM_DIO: return F("DIO");
|
||||
case FM_DOUT: return F("DOUT");
|
||||
case FM_UNKNOWN: break;
|
||||
}
|
||||
return F("Unknown");
|
||||
#else // ifdef ESP8266
|
||||
|
||||
@@ -28,10 +28,10 @@ bool remoteConfig(struct EventStruct *event, const String& string)
|
||||
bool success = false;
|
||||
String command = parseString(string, 1);
|
||||
|
||||
if (command == F("config"))
|
||||
if (command.equals(F("config")))
|
||||
{
|
||||
// Command: "config,task,<taskname>,<actual Set Config command>"
|
||||
if (parseString(string, 2) == F("task"))
|
||||
if (parseString(string, 2).equals(F("task")))
|
||||
{
|
||||
String configTaskName = parseStringKeepCase(string, 3);
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ String getNumerical(const String& tBuf, NumericalType requestedType, NumericalTy
|
||||
decPt = true;
|
||||
detectedType = NumericalType::FloatingPoint;
|
||||
} else {
|
||||
if (result == F("-")) {
|
||||
if (result.equals(F("-"))) {
|
||||
detectedType = NumericalType::Not_a_number;
|
||||
return emptyString;
|
||||
}
|
||||
@@ -306,7 +306,7 @@ String getNumerical(const String& tBuf, NumericalType requestedType, NumericalTy
|
||||
}
|
||||
}
|
||||
|
||||
if (result == F("-")) {
|
||||
if (result.equals(F("-"))) {
|
||||
detectedType = NumericalType::Not_a_number;
|
||||
return emptyString;
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ void transformValue(
|
||||
maskChar = tempValueFormat[1];
|
||||
}
|
||||
|
||||
if (value == F("0")) {
|
||||
if (value.equals(F("0"))) {
|
||||
value = String();
|
||||
} else {
|
||||
const int valueLength = value.length();
|
||||
|
||||
@@ -29,7 +29,7 @@ HandledWebCommand_result handle_command_from_web(EventValueSource::Enum source,
|
||||
// in case of event, store to buffer and return...
|
||||
String command = parseString(webrequest, 1);
|
||||
|
||||
if ((command == F("event")) || (command == F("asyncevent")))
|
||||
if ((command.equals(F("event"))) || (command.equals(F("asyncevent"))))
|
||||
{
|
||||
eventQueue.addMove(parseStringToEndKeepCase(webrequest, 2));
|
||||
handledCmd = true;
|
||||
|
||||
@@ -31,9 +31,15 @@
|
||||
# endif // if defined(PLUGIN_BUILD_CUSTOM) || defined(PLUGIN_BUILD_MAX_ESP32)
|
||||
|
||||
// # define P037_OVERRIDE // When defined, do not limit features because of LIMIT_BUILD_SIZE
|
||||
// # define P037_LIMIT_BUILD_SIZE // Only limit build size for this plugin (to be defined in Custom.h etc.)
|
||||
|
||||
# ifndef PLUGIN_BUILD_MAX_ESP32
|
||||
# if defined(LIMIT_BUILD_SIZE) && !defined(P037_OVERRIDE) // Leave out the fancy stuff if available flash is tight
|
||||
|
||||
// Leave out the fancy stuff if available flash is tight
|
||||
# if (defined(LIMIT_BUILD_SIZE) && !defined(P037_OVERRIDE)) || defined(P037_LIMIT_BUILD_SIZE)
|
||||
# ifndef P037_LIMIT_BUILD_SIZE
|
||||
# define P037_LIMIT_BUILD_SIZE // Use this flag exclusively in P037 sources
|
||||
# endif // ifndef P037_LIMIT_BUILD_SIZE
|
||||
# ifdef PLUGIN_037_DEBUG
|
||||
# undef PLUGIN_037_DEBUG
|
||||
# endif // ifdef PLUGIN_037_DEBUG
|
||||
@@ -50,7 +56,7 @@
|
||||
// #undef P037_JSON_SUPPORT
|
||||
// #define P037_JSON_SUPPORT 0
|
||||
// #endif
|
||||
# endif // if defined(LIMIT_BUILD_SIZE) && !defined(P037_OVERRIDE)
|
||||
# endif // if (defined(LIMIT_BUILD_SIZE) && !defined(P037_OVERRIDE)) || defined(P037_LIMIT_BUILD_SIZE)
|
||||
|
||||
# ifdef PLUGIN_DISPLAY_COLLECTION
|
||||
# if P037_FILTER_SUPPORT
|
||||
@@ -166,15 +172,16 @@ struct P037_data_struct : public PluginTaskData_base
|
||||
|
||||
String getFullMQTTTopic(uint8_t taskValueIndex) const;
|
||||
|
||||
bool shouldSubscribeToMQTTtopic(const String& topic) const;
|
||||
bool shouldSubscribeToMQTTtopic(const String& topic) const;
|
||||
|
||||
bool loadSettings();
|
||||
bool loadSettings();
|
||||
|
||||
private:
|
||||
|
||||
String saveSettings();
|
||||
|
||||
# if P037_MAPPING_SUPPORT || P037_FILTER_SUPPORT
|
||||
void parseMappings();
|
||||
void parseMappings();
|
||||
# endif // if P037_MAPPING_SUPPORT || P037_FILTER_SUPPORT
|
||||
taskIndex_t _taskIndex = TASKS_MAX;
|
||||
# if P037_MAPPING_SUPPORT
|
||||
|
||||
@@ -101,25 +101,25 @@ bool P049_data_struct::plugin_write(struct EventStruct *event, const String& str
|
||||
{
|
||||
String command = parseString(string, 1);
|
||||
|
||||
if (command == F("mhzcalibratezero"))
|
||||
if (command.equals(F("mhzcalibratezero")))
|
||||
{
|
||||
send_mhzCmd(mhzCmdCalibrateZero);
|
||||
addLog(LOG_LEVEL_INFO, F("MHZ19: Calibrated zero point!"));
|
||||
return true;
|
||||
}
|
||||
else if (command == F("mhzreset"))
|
||||
else if (command.equals(F("mhzreset")))
|
||||
{
|
||||
send_mhzCmd(mhzCmdReset);
|
||||
addLog(LOG_LEVEL_INFO, F("MHZ19: Sent sensor reset!"));
|
||||
return true;
|
||||
}
|
||||
else if (command == F("mhzabcenable"))
|
||||
else if (command.equals(F("mhzabcenable")))
|
||||
{
|
||||
send_mhzCmd(mhzCmdABCEnable);
|
||||
addLog(LOG_LEVEL_INFO, F("MHZ19: Sent sensor ABC Enable!"));
|
||||
return true;
|
||||
}
|
||||
else if (command == F("mhzabcdisable"))
|
||||
else if (command.equals(F("mhzabcdisable")))
|
||||
{
|
||||
send_mhzCmd(mhzCmdABCDisable);
|
||||
addLog(LOG_LEVEL_INFO, F("MHZ19: Sent sensor ABC Disable!"));
|
||||
@@ -128,25 +128,25 @@ bool P049_data_struct::plugin_write(struct EventStruct *event, const String& str
|
||||
|
||||
# ifdef ENABLE_DETECTION_RANGE_COMMANDS
|
||||
else if (command.startsWith(F("mhzmeasurementrange"))) {
|
||||
if (command == F("mhzmeasurementrange1000"))
|
||||
if (command.equals(F("mhzmeasurementrange1000")))
|
||||
{
|
||||
send_mhzCmd(mhzCmdMeasurementRange1000);
|
||||
addLog(LOG_LEVEL_INFO, F("MHZ19: Sent measurement range 0-1000PPM!"));
|
||||
return true;
|
||||
}
|
||||
else if (command == F("mhzmeasurementrange2000"))
|
||||
else if (command.equals(F("mhzmeasurementrange2000")))
|
||||
{
|
||||
send_mhzCmd(mhzCmdMeasurementRange2000);
|
||||
addLog(LOG_LEVEL_INFO, F("MHZ19: Sent measurement range 0-2000PPM!"));
|
||||
return true;
|
||||
}
|
||||
else if (command == F("mhzmeasurementrange3000"))
|
||||
else if (command.equals(F("mhzmeasurementrange3000")))
|
||||
{
|
||||
send_mhzCmd(mhzCmdMeasurementRange3000);
|
||||
addLog(LOG_LEVEL_INFO, F("MHZ19: Sent measurement range 0-3000PPM!"));
|
||||
return true;
|
||||
}
|
||||
else if (command == F("mhzmeasurementrange5000"))
|
||||
else if (command.equals(F("mhzmeasurementrange5000")))
|
||||
{
|
||||
send_mhzCmd(mhzCmdMeasurementRange5000);
|
||||
addLog(LOG_LEVEL_INFO, F("MHZ19: Sent measurement range 0-5000PPM!"));
|
||||
|
||||
@@ -89,22 +89,22 @@ bool P093_data_struct::read(String& result) const {
|
||||
void P093_data_struct::write(const String& command, const String& value) {
|
||||
# define lookup(x, list, placeholder) findByMapping(x, list, sizeof(list) / sizeof(Tuple), placeholder)
|
||||
|
||||
if (command == F("temperature")) {
|
||||
if (command.equals(F("temperature"))) {
|
||||
float temperature = 0;
|
||||
|
||||
if (string2float(value, temperature) && (temperature >= 16) && (temperature <= 31)) {
|
||||
_wantedSettings.temperature = temperature;
|
||||
_writeStatus.set(Temperature);
|
||||
}
|
||||
} else if ((command == F("power")) && lookup(value, _mappings.power, _wantedSettings.power)) {
|
||||
} else if ((command.equals(F("power"))) && lookup(value, _mappings.power, _wantedSettings.power)) {
|
||||
_writeStatus.set(Power);
|
||||
} else if ((command == F("mode")) && lookup(value, _mappings.mode, _wantedSettings.mode)) {
|
||||
} else if ((command.equals(F("mode"))) && lookup(value, _mappings.mode, _wantedSettings.mode)) {
|
||||
_writeStatus.set(Mode);
|
||||
} else if ((command == F("fan")) && lookup(value, _mappings.fan, _wantedSettings.fan)) {
|
||||
} else if ((command.equals(F("fan"))) && lookup(value, _mappings.fan, _wantedSettings.fan)) {
|
||||
_writeStatus.set(Fan);
|
||||
} else if ((command == F("vane")) && lookup(value, _mappings.vane, _wantedSettings.vane)) {
|
||||
} else if ((command.equals(F("vane"))) && lookup(value, _mappings.vane, _wantedSettings.vane)) {
|
||||
_writeStatus.set(Vane);
|
||||
} else if ((command == F("widevane")) && lookup(value, _mappings.wideVane, _wantedSettings.wideVane)) {
|
||||
} else if ((command.equals(F("widevane"))) && lookup(value, _mappings.wideVane, _wantedSettings.wideVane)) {
|
||||
_writeStatus.set(WideVane);
|
||||
}
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ bool P099_data_struct::isValidAndTouchedTouchObject(uint16_t x, uint16_t y, Stri
|
||||
for (uint8_t objectNr = 0; objectNr < checkObjectCount; objectNr++) {
|
||||
String objectName = String(StoredSettings.TouchObjects[objectNr].objectname);
|
||||
if ( objectName.length() > 0
|
||||
&& objectName.substring(0,1 ) != F("_") // Ignore if name starts with an underscore
|
||||
&& !objectName.substring(0,1 ).equals(F("_")) // Ignore if name starts with an underscore
|
||||
&& StoredSettings.TouchObjects[objectNr].bottom_right.x > 0
|
||||
&& StoredSettings.TouchObjects[objectNr].bottom_right.y > 0) { // Not initial could be valid
|
||||
|
||||
@@ -228,7 +228,7 @@ bool P099_data_struct::isValidAndTouchedTouchObject(uint16_t x, uint16_t y, Stri
|
||||
* Checks if the name doesn't exceed the max. length.
|
||||
*/
|
||||
bool P099_data_struct::setTouchObjectState(const String& touchObject, bool state, uint8_t checkObjectCount) {
|
||||
if (touchObject.isEmpty() || touchObject.substring(0, 1) == F("_")) return false;
|
||||
if (touchObject.isEmpty() || touchObject.substring(0, 1).equals(F("_"))) return false;
|
||||
String findObject = (state ? F("_") : F("")); // When enabling, try to find a disabled object
|
||||
findObject += touchObject;
|
||||
String thisObject;
|
||||
|
||||
@@ -333,7 +333,7 @@ void P104_data_struct::loadSettings() {
|
||||
while (zoneIndex < expectedZones) {
|
||||
zones.push_back(P104_zone_struct(zoneIndex + 1));
|
||||
|
||||
if (zones[zoneIndex].text == F("\"\"")) { // Special case
|
||||
if (zones[zoneIndex].text.equals(F("\"\""))) { // Special case
|
||||
zones[zoneIndex].text.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
|
||||
const String command = parseString(string, 1);
|
||||
|
||||
if ((command == F("neopixelfx")) || (command == F("nfx"))) {
|
||||
if ((command.equals(F("neopixelfx"))) || (command.equals(F("nfx")))) {
|
||||
const String subCommand = parseString(string, 2);
|
||||
|
||||
const String str3 = parseString(string, 3);
|
||||
@@ -80,33 +80,33 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
const String str7 = parseString(string, 7);
|
||||
const int32_t str7i = str7.toInt();
|
||||
|
||||
if (subCommand == F("fadetime")) {
|
||||
if (subCommand.equals(F("fadetime"))) {
|
||||
success = true;
|
||||
fadetime = str3i;
|
||||
}
|
||||
|
||||
else if (subCommand == F("fadedelay")) {
|
||||
else if (subCommand.equals(F("fadedelay"))) {
|
||||
success = true;
|
||||
fadedelay = str3i;
|
||||
}
|
||||
|
||||
else if (subCommand == F("speed")) {
|
||||
else if (subCommand.equals(F("speed"))) {
|
||||
success = true;
|
||||
defaultspeed = str3i;
|
||||
speed = defaultspeed;
|
||||
}
|
||||
|
||||
else if (subCommand == F("bgcolor")) {
|
||||
else if (subCommand.equals(F("bgcolor"))) {
|
||||
success = true;
|
||||
hex2rrggbb(str3);
|
||||
}
|
||||
|
||||
else if (subCommand == F("count")) {
|
||||
else if (subCommand.equals(F("count"))) {
|
||||
success = true;
|
||||
count = str3i;
|
||||
}
|
||||
|
||||
else if ((subCommand == F("on")) || (subCommand == F("off"))) {
|
||||
else if ((subCommand.equals(F("on"))) || (subCommand.equals(F("off")))) {
|
||||
success = true;
|
||||
fadetime = 1000;
|
||||
fadedelay = 0;
|
||||
@@ -125,18 +125,18 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
|
||||
starttime[r_pixel] = counter20ms + (pixel * abs(fadedelay) / 20);
|
||||
|
||||
if ((subCommand == F("on")) && (mode == P128_modetype::Off)) { // switch on
|
||||
if ((subCommand.equals(F("on"))) && (mode == P128_modetype::Off)) { // switch on
|
||||
rgb_target[pixel] = rgb_old[pixel];
|
||||
rgb_old[pixel] = Plugin_128_pixels->GetPixelColor(pixel);
|
||||
} else if (subCommand == F("off")) { // switch off
|
||||
} else if (subCommand.equals(F("off"))) { // switch off
|
||||
rgb_old[pixel] = Plugin_128_pixels->GetPixelColor(pixel);
|
||||
rgb_target[pixel] = RgbColor(0);
|
||||
}
|
||||
}
|
||||
|
||||
if ((subCommand == F("on")) && (mode == P128_modetype::Off)) { // switch on
|
||||
if ((subCommand.equals(F("on"))) && (mode == P128_modetype::Off)) { // switch on
|
||||
mode = (savemode == P128_modetype::On) ? P128_modetype::Fade : savemode;
|
||||
} else if (subCommand == F("off")) { // switch off
|
||||
} else if (subCommand.equals(F("off"))) { // switch off
|
||||
savemode = mode;
|
||||
mode = P128_modetype::Fade;
|
||||
}
|
||||
@@ -144,14 +144,14 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
maxtime = starttime[r_pixel] + (fadetime / 20);
|
||||
}
|
||||
|
||||
else if (subCommand == F("dim")) {
|
||||
else if (subCommand.equals(F("dim"))) {
|
||||
if ((str3i >= 0) && (str3i <= maxBright)) { // Safety check
|
||||
success = true;
|
||||
Plugin_128_pixels->SetBrightness(str3i);
|
||||
}
|
||||
}
|
||||
|
||||
else if (subCommand == F("line")) {
|
||||
else if (subCommand.equals(F("line"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::On;
|
||||
|
||||
@@ -162,7 +162,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
}
|
||||
}
|
||||
|
||||
else if (subCommand == F("tick")) {
|
||||
else if (subCommand.equals(F("tick"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::On;
|
||||
|
||||
@@ -174,7 +174,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
}
|
||||
}
|
||||
|
||||
else if (subCommand == F("one")) {
|
||||
else if (subCommand.equals(F("one"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::On;
|
||||
|
||||
@@ -184,11 +184,11 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
Plugin_128_pixels->SetPixelColor(pixnum, rgb);
|
||||
}
|
||||
|
||||
else if ((subCommand == F("fade")) || (subCommand == F("all")) || (subCommand == F("rgb"))) {
|
||||
else if ((subCommand.equals(F("fade"))) || (subCommand.equals(F("all"))) || (subCommand.equals(F("rgb")))) {
|
||||
success = true;
|
||||
mode = P128_modetype::Fade;
|
||||
|
||||
if ((subCommand == F("all")) || (subCommand == F("rgb"))) {
|
||||
if ((subCommand.equals(F("all"))) || (subCommand.equals(F("rgb")))) {
|
||||
fadedelay = 0;
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
maxtime = starttime[r_pixel] + (fadetime / 20);
|
||||
}
|
||||
|
||||
else if (subCommand == F("hsv")) {
|
||||
else if (subCommand.equals(F("hsv"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::Fade;
|
||||
fadedelay = 0;
|
||||
@@ -245,7 +245,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
maxtime = starttime[r_pixel] + (fadetime / 20);
|
||||
}
|
||||
|
||||
else if (subCommand == F("hsvone")) {
|
||||
else if (subCommand.equals(F("hsvone"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::On;
|
||||
rgb =
|
||||
@@ -259,7 +259,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
Plugin_128_pixels->SetPixelColor(pixnum, rgb);
|
||||
}
|
||||
|
||||
else if (subCommand == F("hsvline")) {
|
||||
else if (subCommand.equals(F("hsvline"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::On;
|
||||
|
||||
@@ -276,7 +276,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
}
|
||||
}
|
||||
|
||||
else if (subCommand == F("rainbow")) {
|
||||
else if (subCommand.equals(F("rainbow"))) {
|
||||
success = true;
|
||||
fadeIn = (mode == P128_modetype::Off) ? true : false;
|
||||
mode = P128_modetype::Rainbow;
|
||||
@@ -291,7 +291,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
: str4i;
|
||||
}
|
||||
|
||||
else if (subCommand == F("colorfade")) {
|
||||
else if (subCommand.equals(F("colorfade"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::ColorFade;
|
||||
|
||||
@@ -307,7 +307,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
: str6i - 1;
|
||||
}
|
||||
|
||||
else if (subCommand == F("kitt")) {
|
||||
else if (subCommand.equals(F("kitt"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::Kitt;
|
||||
|
||||
@@ -320,7 +320,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
: str4i;
|
||||
}
|
||||
|
||||
else if (subCommand == F("comet")) {
|
||||
else if (subCommand.equals(F("comet"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::Comet;
|
||||
|
||||
@@ -333,7 +333,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
: str4i;
|
||||
}
|
||||
|
||||
else if (subCommand == F("theatre")) {
|
||||
else if (subCommand.equals(F("theatre"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::Theatre;
|
||||
|
||||
@@ -358,7 +358,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
}
|
||||
}
|
||||
|
||||
else if (subCommand == F("scan")) {
|
||||
else if (subCommand.equals(F("scan"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::Scan;
|
||||
|
||||
@@ -373,7 +373,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
: str5i;
|
||||
}
|
||||
|
||||
else if (subCommand == F("dualscan")) {
|
||||
else if (subCommand.equals(F("dualscan"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::Dualscan;
|
||||
|
||||
@@ -388,7 +388,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
: str5i;
|
||||
}
|
||||
|
||||
else if (subCommand == F("twinkle")) {
|
||||
else if (subCommand.equals(F("twinkle"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::Twinkle;
|
||||
|
||||
@@ -403,7 +403,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
: str5i;
|
||||
}
|
||||
|
||||
else if (subCommand == F("twinklefade")) {
|
||||
else if (subCommand.equals(F("twinklefade"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::TwinkleFade;
|
||||
|
||||
@@ -418,7 +418,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
: str5i;
|
||||
}
|
||||
|
||||
else if (subCommand == F("sparkle")) {
|
||||
else if (subCommand.equals(F("sparkle"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::Sparkle;
|
||||
|
||||
@@ -432,7 +432,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
: str5i;
|
||||
}
|
||||
|
||||
else if (subCommand == F("wipe")) {
|
||||
else if (subCommand.equals(F("wipe"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::Wipe;
|
||||
|
||||
@@ -451,7 +451,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
: str5i;
|
||||
}
|
||||
|
||||
else if (subCommand == F("dualwipe")) {
|
||||
else if (subCommand.equals(F("dualwipe"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::Dualwipe;
|
||||
|
||||
@@ -471,7 +471,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
}
|
||||
|
||||
# if P128_ENABLE_FAKETV
|
||||
else if (subCommand == F("faketv")) {
|
||||
else if (subCommand.equals(F("faketv"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::FakeTV;
|
||||
_counter_mode_step = 0;
|
||||
@@ -488,7 +488,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
}
|
||||
# endif // if P128_ENABLE_FAKETV
|
||||
|
||||
else if (subCommand == F("fire")) {
|
||||
else if (subCommand.equals(F("fire"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::Fire;
|
||||
|
||||
@@ -509,7 +509,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
: str6.toFloat();
|
||||
}
|
||||
|
||||
else if (subCommand == F("fireflicker")) {
|
||||
else if (subCommand.equals(F("fireflicker"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::FireFlicker;
|
||||
|
||||
@@ -522,7 +522,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
: str4i;
|
||||
}
|
||||
|
||||
else if (subCommand == F("simpleclock")) {
|
||||
else if (subCommand.equals(F("simpleclock"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::SimpleClock;
|
||||
|
||||
@@ -585,7 +585,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
}
|
||||
|
||||
if (!str7.isEmpty()) {
|
||||
if (str7 == F("off")) {
|
||||
if (str7.equals(F("off"))) {
|
||||
rgb_s_off = true;
|
||||
} else if (str7.length() <= 6) {
|
||||
const uint32_t hcolorui = rgbStr2Num(str7);
|
||||
@@ -625,7 +625,7 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
}
|
||||
|
||||
if (!str7.isEmpty()) {
|
||||
if (str7 == F("off")) {
|
||||
if (str7.equals(F("off"))) {
|
||||
rgb_s_off = true;
|
||||
} else {
|
||||
const uint32_t hcolorui = rgbStr2Num(str7);
|
||||
@@ -642,12 +642,12 @@ bool P128_data_struct::plugin_write(struct EventStruct *event,
|
||||
}
|
||||
}
|
||||
|
||||
else if (subCommand == F("stop")) {
|
||||
else if (subCommand.equals(F("stop"))) {
|
||||
success = true;
|
||||
mode = P128_modetype::On;
|
||||
}
|
||||
|
||||
else if (subCommand == F("statusrequest")) {
|
||||
else if (subCommand.equals(F("statusrequest"))) {
|
||||
success = true;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -139,6 +139,9 @@ void handle_controllers_clearLoadDefaults(uint8_t controllerindex, ControllerSet
|
||||
// Load some templates from the controller.
|
||||
struct EventStruct TempEvent;
|
||||
|
||||
// Hand over the controller settings in the Data pointer, so the controller can set some defaults.
|
||||
TempEvent.Data = (uint8_t*)(&ControllerSettings);
|
||||
|
||||
if (Protocol[ProtocolIndex].usesTemplate) {
|
||||
String dummy;
|
||||
CPluginCall(ProtocolIndex, CPlugin::Function::CPLUGIN_PROTOCOL_TEMPLATE, &TempEvent, dummy);
|
||||
|
||||
@@ -379,8 +379,8 @@ void handle_devices_CopySubmittedSettings(taskIndex_t taskIndex, pluginID_t task
|
||||
{
|
||||
String dummy;
|
||||
|
||||
SaveTaskSettings(taskIndex);
|
||||
if (Device[DeviceIndex].ExitTaskBeforeSave) {
|
||||
SaveTaskSettings(taskIndex);
|
||||
PluginCall(PLUGIN_EXIT, &TempEvent, dummy);
|
||||
}
|
||||
|
||||
@@ -1326,7 +1326,7 @@ void devicePage_show_task_values(taskIndex_t taskIndex, deviceIndex_t DeviceInde
|
||||
|
||||
if (!Device[DeviceIndex].Custom && (valueCount > 0))
|
||||
{
|
||||
int colCount = 1;
|
||||
int colCount = 2;
|
||||
addFormSubHeader(F("Values"));
|
||||
html_end_table();
|
||||
html_table_class_normal();
|
||||
|
||||
@@ -373,7 +373,7 @@ void getWebPageTemplateDefault(const String& tmplName, WebTemplateParser& parser
|
||||
const bool addJS = true;
|
||||
const bool addMeta = true;
|
||||
|
||||
if (tmplName == F("TmplAP"))
|
||||
if (tmplName.equals(F("TmplAP")))
|
||||
{
|
||||
|
||||
getWebPageTemplateDefaultHead(parser, !addMeta, !addJS);
|
||||
@@ -391,7 +391,7 @@ void getWebPageTemplateDefault(const String& tmplName, WebTemplateParser& parser
|
||||
getWebPageTemplateDefaultContentSection(parser);
|
||||
getWebPageTemplateDefaultFooter(parser);
|
||||
}
|
||||
else if (tmplName == F("TmplMsg"))
|
||||
else if (tmplName.equals(F("TmplMsg")))
|
||||
{
|
||||
getWebPageTemplateDefaultHead(parser, !addMeta, !addJS);
|
||||
if (!parser.isTail()) {
|
||||
@@ -401,7 +401,7 @@ void getWebPageTemplateDefault(const String& tmplName, WebTemplateParser& parser
|
||||
getWebPageTemplateDefaultContentSection(parser);
|
||||
getWebPageTemplateDefaultFooter(parser);
|
||||
}
|
||||
else if (tmplName == F("TmplDsh"))
|
||||
else if (tmplName.equals(F("TmplDsh")))
|
||||
{
|
||||
getWebPageTemplateDefaultHead(parser, !addMeta, addJS);
|
||||
parser.process(F(
|
||||
|
||||
@@ -330,17 +330,19 @@ void handle_SDfilelist() {
|
||||
String parent_dir;
|
||||
|
||||
for (uint8_t i = 0; i < web_server.args(); i++) {
|
||||
if (web_server.argName(i) == F("delete"))
|
||||
// FIXME TD-er: This only checks for arguments in the URL, not in POST args
|
||||
// It also takes only the last matching argument.
|
||||
if (web_server.argName(i).equals(F("delete")))
|
||||
{
|
||||
fdelete = webArg(i);
|
||||
}
|
||||
|
||||
if (web_server.argName(i) == F("deletedir"))
|
||||
if (web_server.argName(i).equals(F("deletedir")))
|
||||
{
|
||||
ddelete = webArg(i);
|
||||
}
|
||||
|
||||
if (web_server.argName(i) == F("chgto"))
|
||||
if (web_server.argName(i).equals(F("chgto")))
|
||||
{
|
||||
change_to_dir = webArg(i);
|
||||
}
|
||||
@@ -384,8 +386,7 @@ void handle_SDfilelist() {
|
||||
}
|
||||
|
||||
|
||||
String subheader = "SD Card: " + current_dir;
|
||||
addFormSubHeader(subheader);
|
||||
addFormSubHeader(String(F("SD Card: ")) + current_dir);
|
||||
html_BR();
|
||||
html_table_class_multirow();
|
||||
html_table_header(F(""), 50);
|
||||
|
||||
@@ -121,7 +121,7 @@ void handle_json()
|
||||
{
|
||||
const String view = webArg(F("view"));
|
||||
|
||||
if (view == F("sensorupdate")) {
|
||||
if (view.equals(F("sensorupdate"))) {
|
||||
showSystem = false;
|
||||
showWifi = false;
|
||||
#if FEATURE_ETHERNET
|
||||
@@ -197,6 +197,10 @@ void handle_json()
|
||||
LabelType::PSRAM_MAX_FREE_BLOCK,
|
||||
#endif // BOARD_HAS_PSRAM
|
||||
#endif // ifdef ESP32
|
||||
LabelType::ESP_CHIP_MODEL,
|
||||
#ifdef ESP32
|
||||
LabelType::ESP_CHIP_REVISION,
|
||||
#endif // ifdef ESP32
|
||||
|
||||
LabelType::SUNRISE,
|
||||
LabelType::SUNSET,
|
||||
|
||||
@@ -52,7 +52,7 @@ void handle_log_JSON() {
|
||||
String webrequest = webArg(F("view"));
|
||||
addHtml(F("{\"Log\": {"));
|
||||
|
||||
if (webrequest == F("legend")) {
|
||||
if (webrequest.equals(F("legend"))) {
|
||||
addHtml(F("\"Legend\": ["));
|
||||
|
||||
for (uint8_t i = 0; i < LOG_LEVEL_NRELEMENTS; ++i) {
|
||||
|
||||
@@ -559,7 +559,7 @@ void addFormHeader(const __FlashStringHelper *header,
|
||||
const __FlashStringHelper *rtdHelpButton)
|
||||
{
|
||||
html_TR();
|
||||
html_table_header(header, helpButton, rtdHelpButton, 225);
|
||||
html_table_header(header, helpButton, rtdHelpButton, 300);
|
||||
html_table_header(F(""));
|
||||
}
|
||||
|
||||
@@ -856,7 +856,7 @@ void addHelpButton(const String& url, bool isRTD)
|
||||
addHtmlLink(
|
||||
F("button help"),
|
||||
makeDocLink(url, isRTD),
|
||||
isRTD ? F("ℹ") : F("❔"));
|
||||
isRTD ? F("i") : F("?"));
|
||||
#endif // ifndef WEBPAGE_TEMPLATE_HIDE_HELP_BUTTON
|
||||
}
|
||||
|
||||
|
||||
@@ -766,7 +766,7 @@ bool isFormItemChecked(const __FlashStringHelper * id)
|
||||
|
||||
bool isFormItemChecked(const String& id)
|
||||
{
|
||||
return webArg(id) == F("on");
|
||||
return webArg(id).equals(F("on"));
|
||||
}
|
||||
|
||||
bool isFormItemChecked(const LabelType::Enum& id)
|
||||
|
||||
@@ -441,7 +441,7 @@ bool handle_rules_edit(String originalUri, bool isAddNew) {
|
||||
if (web_server.args() > 0)
|
||||
{
|
||||
const String& rules = webArg(F("rules"));
|
||||
isNew = webArg(F("IsNew")) == F("yes");
|
||||
isNew = webArg(F("IsNew")).equals(F("yes"));
|
||||
|
||||
// Overwrite verification
|
||||
if (isEdit && isNew) {
|
||||
|
||||
@@ -212,10 +212,10 @@ void WebTemplateParser::processVarName()
|
||||
if (!varName.length()) { return; }
|
||||
varName.toLowerCase();
|
||||
|
||||
if (varName == F("error")) {
|
||||
if (varName.equals(F("error"))) {
|
||||
getErrorNotifications();
|
||||
}
|
||||
else if (varName == F("meta")) {
|
||||
else if (varName.equals(F("meta"))) {
|
||||
if (Rebooting) {
|
||||
addHtml(F("<meta http-equiv='refresh' content='10 url=/'>"));
|
||||
}
|
||||
@@ -253,17 +253,17 @@ void WebTemplateParser::getWebPageTemplateVar(const String& varName)
|
||||
// (varValue.length()) ;serialPrint("after: ");
|
||||
// varValue = "";
|
||||
|
||||
if (varName == F("name"))
|
||||
if (varName.equals(F("name")))
|
||||
{
|
||||
addHtml(Settings.Name);
|
||||
}
|
||||
|
||||
else if (varName == F("unit"))
|
||||
else if (varName.equals(F("unit")))
|
||||
{
|
||||
addHtmlInt(Settings.Unit);
|
||||
}
|
||||
|
||||
else if (varName == F("build"))
|
||||
else if (varName.equals(F("build")))
|
||||
{
|
||||
#if BUILD_IN_WEBFOOTER
|
||||
// In the footer, show full build binary name, will be 'firmware.bin' when compiled using Arduino IDE.
|
||||
@@ -271,7 +271,7 @@ void WebTemplateParser::getWebPageTemplateVar(const String& varName)
|
||||
#endif
|
||||
}
|
||||
|
||||
else if (varName == F("date"))
|
||||
else if (varName.equals(F("date")))
|
||||
{
|
||||
#if BUILD_IN_WEBFOOTER
|
||||
// Add the compile-date
|
||||
@@ -279,7 +279,7 @@ void WebTemplateParser::getWebPageTemplateVar(const String& varName)
|
||||
#endif
|
||||
}
|
||||
|
||||
else if (varName == F("menu"))
|
||||
else if (varName.equals(F("menu")))
|
||||
{
|
||||
addHtml(F("<div class='menubar'>"));
|
||||
|
||||
@@ -314,7 +314,7 @@ void WebTemplateParser::getWebPageTemplateVar(const String& varName)
|
||||
addHtml(F("</div>"));
|
||||
}
|
||||
|
||||
else if (varName == F("logo"))
|
||||
else if (varName.equals(F("logo")))
|
||||
{
|
||||
if (fileExists(F("esp.png")))
|
||||
{
|
||||
@@ -322,14 +322,14 @@ void WebTemplateParser::getWebPageTemplateVar(const String& varName)
|
||||
}
|
||||
}
|
||||
|
||||
else if (varName == F("css"))
|
||||
else if (varName.equals(F("css")))
|
||||
{
|
||||
serve_favicon();
|
||||
serve_CSS();
|
||||
}
|
||||
|
||||
|
||||
else if (varName == F("js"))
|
||||
else if (varName.equals(F("js")))
|
||||
{
|
||||
html_add_JQuery_script();
|
||||
#if FEATURE_CHART_JS
|
||||
@@ -339,12 +339,12 @@ void WebTemplateParser::getWebPageTemplateVar(const String& varName)
|
||||
serve_JS(JSfiles_e::Toasting);
|
||||
}
|
||||
|
||||
else if (varName == F("error"))
|
||||
else if (varName.equals(F("error")))
|
||||
{
|
||||
// print last error - not implemented yet
|
||||
}
|
||||
|
||||
else if (varName == F("debug"))
|
||||
else if (varName.equals(F("debug")))
|
||||
{
|
||||
// print debug messages - not implemented yet
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user