From 512d659d67ab5f8d6ff533e37239f00871a55991 Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Tue, 12 Dec 2023 16:20:06 +0100
Subject: [PATCH 001/303] Bump version to v13.3.0.1
---
CHANGELOG.md | 22 ++++++++---
FIRMWARE.md | 2 +-
README.md | 2 +-
RELEASENOTES.md | 66 ++-----------------------------
tasmota/include/tasmota_version.h | 2 +-
5 files changed, 24 insertions(+), 70 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c80594ac9..640f721a0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,7 +3,23 @@ All notable changes to this project will be documented in this file.
## [Unreleased] - Development
-## [13.2.0.3]
+## [13.3.0.1]
+### Added
+
+### Breaking Changed
+
+### Changed
+
+### Fixed
+
+### Removed
+
+## [Released]
+
+## [13.3.0] 20231213
+- Release Quinlan
+
+## [13.2.0.3] 20231213
### Added
- DeepSleep support through TIMERS (#20117)
- Command ``WebCanvas linear-gradient(#F02 7%,#F93,#FF4,#082,#00F,#708 93%)`` to set GUI canvas
@@ -21,8 +37,6 @@ All notable changes to this project will be documented in this file.
- ESP32 Neopixel flicker for Core3/IDF5 (#20196)
- HASPmota `bar` fixed `val` attribute (#20208)
-### Removed
-
## [13.2.0.2] 20231130
### Added
- Scripter TCP client (#19914)
@@ -88,8 +102,6 @@ All notable changes to this project will be documented in this file.
- ESP32 I2C allow bus2 support when bus1 is not enabled
- ESP32 IR receive with Arduino Core 3 (#19904)
-## [Released]
-
## [13.2.0] 20231019
- Release Quincy
diff --git a/FIRMWARE.md b/FIRMWARE.md
index 43f76f8d2..816882c26 100644
--- a/FIRMWARE.md
+++ b/FIRMWARE.md
@@ -18,7 +18,7 @@ See [CHANGELOG.md](https://github.com/arendst/Tasmota/blob/development/tasmota/C
## Development
-[](https://github.com/arendst/Tasmota)
+[](https://github.com/arendst/Tasmota)
[](http://ota.tasmota.com/tasmota/)
[](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+CI%22)
[](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+ESP32+CI%22)
diff --git a/README.md b/README.md
index 1ca83d791..7d7c15901 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@ Firmware binaries can be downloaded from http://ota.tasmota.com/tasmota/release/
## Development
-[](https://github.com/arendst/Tasmota)
+[](https://github.com/arendst/Tasmota)
[](http://ota.tasmota.com/tasmota/)
[](https://github.com/arendst/Tasmota/actions/workflows/build_all_the_things.yml)
[](https://github.com/arendst/Tasmota/actions/workflows/Tasmota_build_devel.yml)
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 4d337ae3d..0c736dace 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -75,7 +75,7 @@ Latest released binaries can be downloaded from
- http://ota.tasmota.com/tasmota/release
Historical binaries can be downloaded from
-- http://ota.tasmota.com/tasmota/release-13.2.0
+- http://ota.tasmota.com/tasmota/release-13.3.0
The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmota.com/tasmota/release/tasmota.bin.gz``
@@ -106,7 +106,7 @@ Latest released binaries can be downloaded from
- https://ota.tasmota.com/tasmota32/release
Historical binaries can be downloaded from
-- https://ota.tasmota.com/tasmota32/release-13.2.0
+- https://ota.tasmota.com/tasmota32/release-13.3.0
The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasmota.com/tasmota32/release/tasmota32.bin``
@@ -116,71 +116,13 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
[Complete list](BUILDS.md) of available feature and sensors.
-## Changelog v13.2.0.3
+## Changelog v13.3.0.1
### Added
-- Support for ESP32-C2 and ESP32-C6 using Arduino Core3
-- Command ``GpioRead`` to show input state [#19810](https://github.com/arendst/Tasmota/issues/19810)
-- Command ``WebCanvas linear-gradient(#F02 7%,#F93,#FF4,#082,#00F,#708 93%)`` to set GUI canvas
-- I2C bus2 support to iAQ core sensor [#19799](https://github.com/arendst/Tasmota/issues/19799)
-- I2C bus2 support to HTU temperature and humidity sensor
-- I2C bus2 support to BH1750 ambient light sensor
-- I2C bus2 support to ADS1115 A/D Converter
-- I2C bus2 support to SHTxX temperature and humidity sensor
-- I2C bus2 support to HYTxxx temperature and humidity sensor
-- I2C bus2 support to SI1145/6/7 Ultra violet index and light sensor
-- I2C bus2 support to LM75AD temperature sensor
-- Support for Winsen XH03x dust particle sensors using USE_PMS5003 and PMS_MODEL_ZH03X [#19850](https://github.com/arendst/Tasmota/issues/19850)
-- ST7735S display.ini for 1.44 inch 128x128 red SPI display [#19862](https://github.com/arendst/Tasmota/issues/19862)
-- Scripter TCP client [#19914](https://github.com/arendst/Tasmota/issues/19914)
-- NeoPool hydrolysis setpoint and max
-- NeoPool command ``NPFiltrationSpeed`` to set non-standard filtration type speed [#19857](https://github.com/arendst/Tasmota/issues/19857)
-- NeoPool command ``SetOption157`` to enable output of sensitive data [#19857](https://github.com/arendst/Tasmota/issues/19857)
-- NeoPool command ``NPBoost`` [#19973](https://github.com/arendst/Tasmota/issues/19973)
-- NeoPool sensor delta trigger (command ``NPTelePeriod``) [#19973](https://github.com/arendst/Tasmota/issues/19973)
-- NeoPool enhancements for HomeAssistant [#19857](https://github.com/arendst/Tasmota/issues/19857)
-- NeoPool store settings on unified file system [#19973](https://github.com/arendst/Tasmota/issues/19973)
-- DeepSleep support through TIMERS [#20117](https://github.com/arendst/Tasmota/issues/20117)
-- ESP32 auto TasConsole USB or Serial connection for Core3 by @staars
-- ESP32 Partition Wizard can be loaded dynamically [#19980](https://github.com/arendst/Tasmota/issues/19980)
-- ESP32 support for Avago Tech Bluetooth Buttons [#20088](https://github.com/arendst/Tasmota/issues/20088)
-- Berry ``debug.gcdebug()`` to enable GC debugging [#19936](https://github.com/arendst/Tasmota/issues/19936)
-- Berry AES_CBC to crypto module [#19964](https://github.com/arendst/Tasmota/issues/19964)
-- Berry `scale_int`, equivalent of `scale_uint` for signed integers [#20090](https://github.com/arendst/Tasmota/issues/20090)
-- HASPmota add styling properties [#19912](https://github.com/arendst/Tasmota/issues/19912)
-- Matter flow sensor support [#19852](https://github.com/arendst/Tasmota/issues/19852)
### Breaking Changed
-- NeoPool SENSOR topic ``Power`` renamed to ``Powerunit`` [#19857](https://github.com/arendst/Tasmota/issues/19857)
-- Remove Berry `every_200ms` event which didn't work anyways [#20205](https://github.com/arendst/Tasmota/issues/20205)
### Changed
-- ESP32 Framework (Arduino Core3) from v3.0.0-alpha1 to v3.0.0-alpha3
-- ESP32 LVGL library from v8.3.10 to v8.3.11 (no functional change)
-- Increase MAX_HUE_DEVICES to 32 [#19820](https://github.com/arendst/Tasmota/issues/19820)
-- NeoPool ``NPHydrolysis`` percent and unit [#19924](https://github.com/arendst/Tasmota/issues/19924)
-- Thermostat JSON index from 0 to 1 [#20011](https://github.com/arendst/Tasmota/issues/20011)
-- MI32 updates [#19893](https://github.com/arendst/Tasmota/issues/19893)
-- ESP32 keep FileSystem intact when over flashing with VSC [#19816](https://github.com/arendst/Tasmota/issues/19816)
-- Berry leds animation refactoring stage 1 [#20197](https://github.com/arendst/Tasmota/issues/20197)
-- Berry ULP API changes for Core3/IDF5 [#20198](https://github.com/arendst/Tasmota/issues/20198)
-- Matter Light0 now accept a Relay number [#19809](https://github.com/arendst/Tasmota/issues/19809)
-- Matter update hierarchy of plugins [#19915](https://github.com/arendst/Tasmota/issues/19915)
### Fixed
-- Compile USE_PID [#19890](https://github.com/arendst/Tasmota/issues/19890)
-- Scripter timer issue [#19914](https://github.com/arendst/Tasmota/issues/19914)
-- NeoPool filtration mode display [#19801](https://github.com/arendst/Tasmota/issues/19801)
-- ``changeUIntScale`` for linearity when expanding range [#20089](https://github.com/arendst/Tasmota/issues/20089)
-- TUYA state machine (in TUYA v1) [#20110](https://github.com/arendst/Tasmota/issues/20110)
-- ``WebQuery`` response buffer corruption and format character ``%`` [#20111](https://github.com/arendst/Tasmota/issues/20111)
-- ESP32 I2C allow bus2 support when bus1 is not enabled
-- ESP32 remove restart energy logging if no energy monitoring is selected
-- ESP32 IR receive with Arduino Core3 [#19904](https://github.com/arendst/Tasmota/issues/19904)
-- ESP32 Zero-Cross Dimmer for Core3 [#19929](https://github.com/arendst/Tasmota/issues/19929)
-- ESP32-C3 ledlink functionality regression from v13.1.0.2
-- ESP32 Neopixel flicker for Core3/IDF5 [#20196](https://github.com/arendst/Tasmota/issues/20196)
-- Berry parser error in specific cases [#20059](https://github.com/arendst/Tasmota/issues/20059)
-- Berry ``gpio.dac_voltage()`` regression from v13.1.0.1 [#19997](https://github.com/arendst/Tasmota/issues/19997)
-- HASPmota `bar` fixed `val` attribute [#20208](https://github.com/arendst/Tasmota/issues/20208)
-### Removed
+### Removed
\ No newline at end of file
diff --git a/tasmota/include/tasmota_version.h b/tasmota/include/tasmota_version.h
index b302c0370..94bd18c62 100644
--- a/tasmota/include/tasmota_version.h
+++ b/tasmota/include/tasmota_version.h
@@ -20,6 +20,6 @@
#ifndef _TASMOTA_VERSION_H_
#define _TASMOTA_VERSION_H_
-const uint32_t TASMOTA_VERSION = 0x0D020003; // 13.2.0.3
+const uint32_t TASMOTA_VERSION = 0x0D030001; // 13.3.0.1
#endif // _TASMOTA_VERSION_H_
From 5102dbf1d2168eee61b4a176b8b1d87359718455 Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Wed, 13 Dec 2023 20:07:12 +0100
Subject: [PATCH 002/303] Matter Contact sensor was not triggering any update
(#20232)
---
CHANGELOG.md | 1 +
.../Matter_Plugin_2_Sensor_Contact.be | 20 ++---
...olidified_Matter_Plugin_2_Sensor_Contact.h | 89 ++++++++++---------
3 files changed, 56 insertions(+), 54 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 640f721a0..13aa4bcfc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -36,6 +36,7 @@ All notable changes to this project will be documented in this file.
- TUYA state machine (in TUYA v1) (#20110)
- ESP32 Neopixel flicker for Core3/IDF5 (#20196)
- HASPmota `bar` fixed `val` attribute (#20208)
+- Matter Contact sensor was not triggering any update
## [13.2.0.2] 20231130
### Added
diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Sensor_Contact.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Sensor_Contact.be
index 5932b0060..f560d9540 100644
--- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Sensor_Contact.be
+++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Sensor_Contact.be
@@ -61,19 +61,17 @@ class Matter_Plugin_Sensor_Contact : Matter_Plugin_Device
def update_shadow()
super(self).update_shadow()
if !self.VIRTUAL
- import json
- var ret = tasmota.cmd("Status 8", true)
- if ret != nil
- var j = json.load(ret)
- if j != nil
- var state = false
- state = (j.find("Switch" + str(self.tasmota_switch_index)) == "ON")
+ var switch_str = "Switch" + str(self.tasmota_switch_index)
- if self.shadow_contact != state
- self.attribute_updated(0x0045, 0x0000)
- self.shadow_contact = state
- end
+ var j = tasmota.cmd("Status 8", true)
+ if j != nil j = j.find("StatusSNS") end
+ if j != nil && j.contains(switch_str)
+ var state = (j.find(switch_str) == "ON")
+
+ if (self.shadow_contact != state)
+ self.attribute_updated(0x0045, 0x0000)
end
+ self.shadow_contact = state
end
end
end
diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Sensor_Contact.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Sensor_Contact.h
index d097a5ba3..4d5b133d2 100644
--- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Sensor_Contact.h
+++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Sensor_Contact.h
@@ -85,7 +85,7 @@ be_local_closure(Matter_Plugin_Sensor_Contact_parse_configuration, /* name */
********************************************************************/
be_local_closure(Matter_Plugin_Sensor_Contact_update_shadow, /* name */
be_nested_proto(
- 9, /* nstack */
+ 8, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
@@ -96,14 +96,14 @@ be_local_closure(Matter_Plugin_Sensor_Contact_update_shadow, /* name */
( &(const bvalue[14]) { /* constants */
/* K0 */ be_nested_str_weak(update_shadow),
/* K1 */ be_nested_str_weak(VIRTUAL),
- /* K2 */ be_nested_str_weak(json),
- /* K3 */ be_nested_str_weak(tasmota),
- /* K4 */ be_nested_str_weak(cmd),
- /* K5 */ be_nested_str_weak(Status_X208),
- /* K6 */ be_nested_str_weak(load),
+ /* K2 */ be_nested_str_weak(Switch),
+ /* K3 */ be_nested_str_weak(tasmota_switch_index),
+ /* K4 */ be_nested_str_weak(tasmota),
+ /* K5 */ be_nested_str_weak(cmd),
+ /* K6 */ be_nested_str_weak(Status_X208),
/* K7 */ be_nested_str_weak(find),
- /* K8 */ be_nested_str_weak(Switch),
- /* K9 */ be_nested_str_weak(tasmota_switch_index),
+ /* K8 */ be_nested_str_weak(StatusSNS),
+ /* K9 */ be_nested_str_weak(contains),
/* K10 */ be_nested_str_weak(ON),
/* K11 */ be_nested_str_weak(shadow_contact),
/* K12 */ be_nested_str_weak(attribute_updated),
@@ -111,47 +111,50 @@ be_local_closure(Matter_Plugin_Sensor_Contact_update_shadow, /* name */
}),
be_str_weak(update_shadow),
&be_const_str_solidified,
- ( &(const binstruction[40]) { /* code */
+ ( &(const binstruction[43]) { /* code */
0x60040003, // 0000 GETGBL R1 G3
0x5C080000, // 0001 MOVE R2 R0
0x7C040200, // 0002 CALL R1 1
0x8C040300, // 0003 GETMET R1 R1 K0
0x7C040200, // 0004 CALL R1 1
0x88040101, // 0005 GETMBR R1 R0 K1
- 0x7406001F, // 0006 JMPT R1 #0027
- 0xA4060400, // 0007 IMPORT R1 K2
- 0xB80A0600, // 0008 GETNGBL R2 K3
- 0x8C080504, // 0009 GETMET R2 R2 K4
- 0x58100005, // 000A LDCONST R4 K5
- 0x50140200, // 000B LDBOOL R5 1 0
- 0x7C080600, // 000C CALL R2 3
- 0x4C0C0000, // 000D LDNIL R3
- 0x200C0403, // 000E NE R3 R2 R3
- 0x780E0016, // 000F JMPF R3 #0027
- 0x8C0C0306, // 0010 GETMET R3 R1 K6
- 0x5C140400, // 0011 MOVE R5 R2
- 0x7C0C0400, // 0012 CALL R3 2
- 0x4C100000, // 0013 LDNIL R4
- 0x20100604, // 0014 NE R4 R3 R4
- 0x78120010, // 0015 JMPF R4 #0027
- 0x50100000, // 0016 LDBOOL R4 0 0
- 0x8C140707, // 0017 GETMET R5 R3 K7
- 0x601C0008, // 0018 GETGBL R7 G8
- 0x88200109, // 0019 GETMBR R8 R0 K9
- 0x7C1C0200, // 001A CALL R7 1
- 0x001E1007, // 001B ADD R7 K8 R7
- 0x7C140400, // 001C CALL R5 2
- 0x1C140B0A, // 001D EQ R5 R5 K10
- 0x5C100A00, // 001E MOVE R4 R5
- 0x8814010B, // 001F GETMBR R5 R0 K11
- 0x20140A04, // 0020 NE R5 R5 R4
- 0x78160004, // 0021 JMPF R5 #0027
- 0x8C14010C, // 0022 GETMET R5 R0 K12
- 0x541E0044, // 0023 LDINT R7 69
- 0x5820000D, // 0024 LDCONST R8 K13
- 0x7C140600, // 0025 CALL R5 3
- 0x90021604, // 0026 SETMBR R0 K11 R4
- 0x80000000, // 0027 RET 0
+ 0x74060022, // 0006 JMPT R1 #002A
+ 0x60040008, // 0007 GETGBL R1 G8
+ 0x88080103, // 0008 GETMBR R2 R0 K3
+ 0x7C040200, // 0009 CALL R1 1
+ 0x00060401, // 000A ADD R1 K2 R1
+ 0xB80A0800, // 000B GETNGBL R2 K4
+ 0x8C080505, // 000C GETMET R2 R2 K5
+ 0x58100006, // 000D LDCONST R4 K6
+ 0x50140200, // 000E LDBOOL R5 1 0
+ 0x7C080600, // 000F CALL R2 3
+ 0x4C0C0000, // 0010 LDNIL R3
+ 0x200C0403, // 0011 NE R3 R2 R3
+ 0x780E0003, // 0012 JMPF R3 #0017
+ 0x8C0C0507, // 0013 GETMET R3 R2 K7
+ 0x58140008, // 0014 LDCONST R5 K8
+ 0x7C0C0400, // 0015 CALL R3 2
+ 0x5C080600, // 0016 MOVE R2 R3
+ 0x4C0C0000, // 0017 LDNIL R3
+ 0x200C0403, // 0018 NE R3 R2 R3
+ 0x780E000F, // 0019 JMPF R3 #002A
+ 0x8C0C0509, // 001A GETMET R3 R2 K9
+ 0x5C140200, // 001B MOVE R5 R1
+ 0x7C0C0400, // 001C CALL R3 2
+ 0x780E000B, // 001D JMPF R3 #002A
+ 0x8C0C0507, // 001E GETMET R3 R2 K7
+ 0x5C140200, // 001F MOVE R5 R1
+ 0x7C0C0400, // 0020 CALL R3 2
+ 0x1C0C070A, // 0021 EQ R3 R3 K10
+ 0x8810010B, // 0022 GETMBR R4 R0 K11
+ 0x20100803, // 0023 NE R4 R4 R3
+ 0x78120003, // 0024 JMPF R4 #0029
+ 0x8C10010C, // 0025 GETMET R4 R0 K12
+ 0x541A0044, // 0026 LDINT R6 69
+ 0x581C000D, // 0027 LDCONST R7 K13
+ 0x7C100600, // 0028 CALL R4 3
+ 0x90021603, // 0029 SETMBR R0 K11 R3
+ 0x80000000, // 002A RET 0
})
)
);
From 827f614933358681f3d260e7842110e9366e0f3c Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Thu, 14 Dec 2023 15:12:36 +0100
Subject: [PATCH 003/303] Update SECURITY.md
---
SECURITY.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SECURITY.md b/SECURITY.md
index f0a8de1ed..1adcb6008 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -2,4 +2,4 @@
## Reporting a Vulnerability
-Please report security issues to https://sidweb.nl/cms3/en/contact
+Please report security issues to https://ota.tasmota.com/tasmota/contact/contact.php
From b421e2d88b7e34d1fc31c379f527e236e1cf4513 Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Thu, 14 Dec 2023 15:17:44 +0100
Subject: [PATCH 004/303] Update changelogs
---
CHANGELOG.md | 2 +-
RELEASENOTES.md | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 13aa4bcfc..1978a41f4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
### Changed
### Fixed
+- Matter Contact sensor was not triggering any update (#20232)
### Removed
@@ -36,7 +37,6 @@ All notable changes to this project will be documented in this file.
- TUYA state machine (in TUYA v1) (#20110)
- ESP32 Neopixel flicker for Core3/IDF5 (#20196)
- HASPmota `bar` fixed `val` attribute (#20208)
-- Matter Contact sensor was not triggering any update
## [13.2.0.2] 20231130
### Added
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 0c736dace..6eb72fe2e 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -124,5 +124,6 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
### Changed
### Fixed
+- Matter Contact sensor was not triggering any update [#20232](https://github.com/arendst/Tasmota/issues/20232)
### Removed
\ No newline at end of file
From 7b12450876c39722ce8dfa51d9760af491e4ef0b Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Thu, 14 Dec 2023 15:29:19 +0100
Subject: [PATCH 005/303] Update SECURITY.md
---
SECURITY.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SECURITY.md b/SECURITY.md
index 1adcb6008..ef3246b10 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -2,4 +2,4 @@
## Reporting a Vulnerability
-Please report security issues to https://ota.tasmota.com/tasmota/contact/contact.php
+Please report security issues to [Tasmota](https://ota.tasmota.com/tasmota/contact/contact.php)
From c1f8ee5dbb0371c769fced9b4f8e386b84c6521a Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Thu, 14 Dec 2023 20:13:17 +0100
Subject: [PATCH 006/303] Refactoring of Berry `animate` module for WS2812 Leds
(#20236)
---
CHANGELOG.md | 1 +
lib/libesp32/berry/default/be_modtab.c | 9 +-
.../berry_tasmota/src/be_animate_lib.c | 7 -
.../berry_tasmota/src/be_animate_module.c | 197 ++
.../src/be_leds_animator_class.c | 9 -
.../berry_tasmota/src/be_leds_pulse_class.c | 9 -
.../berry_tasmota/src/be_tasmota_lib.c | 2 +
.../{leds_0_animator.be => animate_0_core.be} | 17 +-
...ffects.be => animate_1_animate_effects.be} | 48 +-
.../src/embedded/animate_9_module.be | 508 +++++
.../src/embedded/animate_module.be | 573 ------
...animator.h => solidified_animate_0_core.h} | 159 +-
...=> solidified_animate_1_animate_effects.h} | 114 +-
...module.h => solidified_animate_9_module.h} | 1800 ++++++++---------
.../animate_demo_palette_background.be | 11 +
.../berry/animate_demo/animate_demo_pulse.be | 23 +
tasmota/berry/animate_demo/leds_animation.be | 173 ++
tasmota/berry/animate_demo/leds_blend_demo.be | 37 +
tasmota/berry/emulator/Leds_frame.be | 42 +
.../leds_animate_demo_palette_background.be | 51 -
tasmota/berry/leds/rainbow.be | 185 --
.../xdrv_52_3_berry_tasmota.ino | 55 +
22 files changed, 2073 insertions(+), 1957 deletions(-)
delete mode 100644 lib/libesp32/berry_tasmota/src/be_animate_lib.c
create mode 100644 lib/libesp32/berry_tasmota/src/be_animate_module.c
delete mode 100644 lib/libesp32/berry_tasmota/src/be_leds_animator_class.c
delete mode 100644 lib/libesp32/berry_tasmota/src/be_leds_pulse_class.c
rename lib/libesp32/berry_tasmota/src/embedded/{leds_0_animator.be => animate_0_core.be} (94%)
rename lib/libesp32/berry_tasmota/src/embedded/{leds_1_animate_effects.be => animate_1_animate_effects.be} (82%)
create mode 100644 lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be
delete mode 100644 lib/libesp32/berry_tasmota/src/embedded/animate_module.be
rename lib/libesp32/berry_tasmota/src/solidify/{solidified_leds_0_animator.h => solidified_animate_0_core.h} (85%)
rename lib/libesp32/berry_tasmota/src/solidify/{solidified_leds_1_animate_effects.h => solidified_animate_1_animate_effects.h} (89%)
rename lib/libesp32/berry_tasmota/src/solidify/{solidified_animate_module.h => solidified_animate_9_module.h} (60%)
create mode 100644 tasmota/berry/animate_demo/animate_demo_palette_background.be
create mode 100644 tasmota/berry/animate_demo/animate_demo_pulse.be
create mode 100644 tasmota/berry/animate_demo/leds_animation.be
create mode 100644 tasmota/berry/animate_demo/leds_blend_demo.be
create mode 100644 tasmota/berry/emulator/Leds_frame.be
delete mode 100644 tasmota/berry/leds/leds_animate_demo_palette_background.be
delete mode 100644 tasmota/berry/leds/rainbow.be
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1978a41f4..2a77974ef 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
### Added
### Breaking Changed
+- Refactoring of Berry `animate` module for WS2812 Leds
### Changed
diff --git a/lib/libesp32/berry/default/be_modtab.c b/lib/libesp32/berry/default/be_modtab.c
index 0333db5ea..a4e7c7a33 100644
--- a/lib/libesp32/berry/default/be_modtab.c
+++ b/lib/libesp32/berry/default/be_modtab.c
@@ -146,7 +146,10 @@ BERRY_LOCAL const bntvmodule_t* const be_module_table[] = {
#ifdef USE_UNISHOX_COMPRESSION
&be_native_module(unishox),
#endif // USE_UNISHOX_COMPRESSION
+
+#ifdef USE_WS2812
&be_native_module(animate),
+#endif // USE_WS2812
#ifdef USE_LVGL
&be_native_module(lv),
@@ -206,10 +209,7 @@ be_extern_native_class(AXP192);
be_extern_native_class(AXP202);
be_extern_native_class(OneWire);
be_extern_native_class(Leds_ntv);
-be_extern_native_class(Leds_frame);
be_extern_native_class(Leds);
-be_extern_native_class(Leds_animator);
-be_extern_native_class(Leds_pulse);
be_extern_native_class(AudioGenerator);
be_extern_native_class(AudioFileSource);
be_extern_native_class(AudioOutputI2S);
@@ -278,9 +278,6 @@ BERRY_LOCAL bclass_array be_class_table = {
#ifdef USE_WS2812
&be_native_class(Leds_ntv),
&be_native_class(Leds),
- &be_native_class(Leds_frame),
- &be_native_class(Leds_animator),
- &be_native_class(Leds_pulse),
#endif // USE_WS2812
#ifdef USE_ENERGY_SENSOR
&be_native_class(energy_struct),
diff --git a/lib/libesp32/berry_tasmota/src/be_animate_lib.c b/lib/libesp32/berry_tasmota/src/be_animate_lib.c
deleted file mode 100644
index 77a88bbc8..000000000
--- a/lib/libesp32/berry_tasmota/src/be_animate_lib.c
+++ /dev/null
@@ -1,7 +0,0 @@
-/********************************************************************
- * Berry module `animate`
- *
- * To use: `import animate`
- *
- *******************************************************************/
-#include "solidify/solidified_animate_module.h"
diff --git a/lib/libesp32/berry_tasmota/src/be_animate_module.c b/lib/libesp32/berry_tasmota/src/be_animate_module.c
new file mode 100644
index 000000000..b21102e8f
--- /dev/null
+++ b/lib/libesp32/berry_tasmota/src/be_animate_module.c
@@ -0,0 +1,197 @@
+/*
+ be_animate_module.c - implements the animate module for Leds
+
+ Copyright (C) 2023 Stephan Hadinger & Theo Arends
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+/*******************************************************************\
+ * `animate` global module
+\*******************************************************************/
+
+#include "be_constobj.h"
+#include "be_mapping.h"
+
+#include "solidify/solidified_animate_0_core.h"
+#include "solidify/solidified_animate_1_animate_effects.h"
+#include "solidify/solidified_animate_9_module.h"
+
+
+/*******************************************************************\
+ * standard palettes
+\*******************************************************************/
+static const uint8_t PALETTE_RAINBOW_WHITE[] = {
+ 0x50, 0xFF, 0x00, 0x00, // red
+ 0x30, 0xFF, 0x00, 0x00, // red
+ 0x50, 0xFF, 0xA5, 0x00, // orange
+ 0x30, 0xFF, 0xA5, 0x00, // orange
+ 0x50, 0xFF, 0xFF, 0x00, // yellow
+ 0x30, 0xFF, 0xFF, 0x00, // yellow
+ 0x50, 0x00, 0xFF, 0x00, // green
+ 0x30, 0x00, 0xFF, 0x00, // green
+ 0x50, 0x00, 0x00, 0xFF, // blue
+ 0x30, 0x00, 0x00, 0xFF, // blue
+ 0x50, 0xFF, 0x00, 0xFF, // indigo
+ 0x30, 0xFF, 0x00, 0xFF, // indigo
+ 0x50, 0xFF, 0xFF, 0xFF, // white
+ 0x30, 0xFF, 0xFF, 0xFF, // white
+ 0x00, 0xFF, 0x00, 0x00, // red
+};
+
+static const uint8_t PALETTE_STANDARD_TAG[] = {
+ 0x40, 0xFF, 0x00, 0x00, // red
+ 0x40, 0xFF, 0xA5, 0x00, // orange
+ 0x40, 0xFF, 0xFF, 0x00, // yellow
+ 0x40, 0x00, 0xFF, 0x00, // green
+ 0x40, 0x00, 0x00, 0xFF, // blue
+ 0x40, 0xFF, 0x00, 0xFF, // indigo
+ 0x40, 0xFF, 0xFF, 0xFF, // violet
+ 0x00, 0xFF, 0x00, 0x00, // red
+};
+
+// Gradient palette "ib_jul01_gp", originally from
+// http://soliton.vm.bytemark.co.uk/pub/cpt-city/ing/xmas/tn/ib_jul01.png.index.html
+static const uint8_t PALETTE_ib_jul01_gp[] = {
+ 0x00, 0xE6, 0x06, 0x11, // rgb(230, 6, 17) 0.000%,
+ 0x5E, 0x25, 0x60, 0x5A, // rgb( 37, 96, 90) 37.010%,
+ 0x85, 0x90, 0xBD, 0x6A, // rgb(144,189,106) 52.000%,
+ 0xFF, 0xBB, 0x03, 0x0D, // rgb(187, 3, 13) 100.000%
+};
+
+static const uint8_t PALETTE_STANDARD_VAL[] = {
+ 0x00, 0xFF, 0x00, 0x00, // red
+ 0x24, 0xFF, 0xA5, 0x00, // orange
+ 0x49, 0xFF, 0xFF, 0x00, // yellow
+ 0x6E, 0x00, 0xFF, 0x00, // green
+ 0x92, 0x00, 0x00, 0xFF, // blue
+ 0xB7, 0xFF, 0x00, 0xFF, // indigo
+ 0xDB, 0xFF, 0xFF, 0xFF, // violet
+ 0xFF, 0xFF, 0x00, 0x00, // red
+};
+
+static const uint8_t PALETTE_SATURATED_TAG[] = {
+ 0x40, 0xFF, 0x00, 0x00, // red
+ 0x40, 0xFF, 0xA5, 0x00, // orange
+ 0x40, 0xFF, 0xFF, 0x00, // yellow
+ 0x40, 0x00, 0xFF, 0x00, // green
+ 0x40, 0x00, 0x00, 0xFF, // blue
+ 0x40, 0xFF, 0x00, 0xFF, // indigo
+ 0x40, 0xFF, 0xFF, 0xFF, // violet
+ 0x00, 0xFF, 0x00, 0x00, // red
+};
+
+extern const bclass be_class_Leds_frame;
+
+#include "be_fixed_animate.h"
+
+/* @const_object_info_begin
+
+module animate (scope: global, strings: weak) {
+ SAWTOOTH, int(1)
+ TRIANGLE, int(2)
+ SQUARE, int(3)
+ COSINE, int(4)
+ SINE, int(5)
+ LASTFORM, int(5)
+
+ PALETTE_STANDARD_TAG, comptr(PALETTE_STANDARD_TAG)
+ PALETTE_RAINBOW_WHITE, comptr(PALETTE_RAINBOW_WHITE)
+ PALETTE_STANDARD_VAL, comptr(PALETTE_STANDARD_VAL)
+ PALETTE_SATURATED_TAG, comptr(PALETTE_SATURATED_TAG)
+
+ (), class(be_class_Animate_core)
+ core, class(be_class_Animate_core) // alias
+ animator, class(be_class_Animate_animator)
+ frame, class(be_class_Leds_frame)
+ pulse, class(be_class_Animate_pulse)
+ palette, class(be_class_Animate_palette)
+ oscillator, class(be_class_Animate_oscillator)
+}
+
+@const_object_info_end */
+
+/* Unit test for palettes
+
+import animate
+var p, gradient
+p = animate.palette.ptr_to_palette(animate.PALETTE_STANDARD_TAG)
+assert(p == bytes('40FF000040FFA50040FFFF004000FF00400000FF40FF00FF40FFFFFF00FF0000'))
+gradient = animate.palette.to_css_gradient(p)
+assert(gradient == 'background:linear-gradient(to right,#FF0000 0.0%,#FFA500 14.3%,#FFFF00 28.6%,#00FF00 42.9%,#0000FF 57.1%,#FF00FF 71.4%,#FFFFFF 85.7%,#FF0000 100.0%);')
+
+p = animate.palette.ptr_to_palette(animate.PALETTE_STANDARD_VAL)
+assert(p == bytes('00FF000024FFA50049FFFF006E00FF00920000FFB7FF00FFDBFFFFFFFFFF0000'))
+gradient = animate.palette.to_css_gradient(animate.PALETTE_STANDARD_VAL)
+assert(gradient == 'background:linear-gradient(to right,#FF0000 0.0%,#FFA500 14.1%,#FFFF00 28.6%,#00FF00 43.1%,#0000FF 57.3%,#FF00FF 71.8%,#FFFFFF 85.9%,#FF0000 100.0%);')
+
+
+# unit tests
+import animate
+var o = animate.oscillator(-1000, 1000, 3000)
+o.start(1000)
+assert(o.value == -1000)
+assert(o.animate(1500) == -667)
+assert(o.animate(2500) == 0)
+assert(o.animate(3999) == 1000)
+assert(o.animate(4000) == -1000)
+assert(o.animate(4100) == -933)
+
+o = animate.oscillator(-1000, 1000, 6000, animate.TRIANGLE)
+o.start(1000)
+assert(o.value == -1000)
+assert(o.animate(1500) == -667)
+assert(o.animate(2500) == 0)
+assert(o.animate(3999) == 1000)
+assert(o.animate(4000) == 1000)
+assert(o.animate(4100) == 933)
+assert(o.animate(6000) == -334)
+assert(o.animate(7000) == -1000)
+assert(o.animate(7100) == -933)
+
+o = animate.oscillator(-1000, 1000, 6000, animate.SQUARE)
+o.start(1000)
+assert(o.value == -1000)
+assert(o.animate(1500) == -1000)
+assert(o.animate(2500) == -1000)
+assert(o.animate(3999) == -1000)
+assert(o.animate(4000) == 1000)
+assert(o.animate(4100) == 1000)
+assert(o.animate(6000) == 1000)
+assert(o.animate(7000) == -1000)
+assert(o.animate(7100) == -1000)
+
+o = animate.oscillator(-1000, 1000, 6000, animate.SINE)
+o.start(1000)
+assert(o.animate(1000) == 0)
+assert(o.animate(1500) == 500)
+assert(o.animate(2000) == 867)
+assert(o.animate(2500) == 1000)
+assert(o.animate(4000) == 0)
+assert(o.animate(5500) == -1000)
+assert(o.animate(7000) == 0)
+
+o = animate.oscillator(-1000, 1000, 6000, animate.COSINE)
+o.start(1000)
+assert(o.animate(1000) == -1000)
+assert(o.animate(1500) == -867)
+assert(o.animate(2000) == -500)
+assert(o.animate(2500) == 0)
+assert(o.animate(4000) == 1000)
+assert(o.animate(5500) == 0)
+assert(o.animate(7000) == -1000)
+
+
+
+*/
\ No newline at end of file
diff --git a/lib/libesp32/berry_tasmota/src/be_leds_animator_class.c b/lib/libesp32/berry_tasmota/src/be_leds_animator_class.c
deleted file mode 100644
index 3bf10367a..000000000
--- a/lib/libesp32/berry_tasmota/src/be_leds_animator_class.c
+++ /dev/null
@@ -1,9 +0,0 @@
-/********************************************************************
- * Berry class `Leds_animator`
- *
- *******************************************************************/
-#ifdef USE_WS2812
-
-#include "solidify/solidified_leds_0_animator.h"
-
-#endif // USE_WS2812
diff --git a/lib/libesp32/berry_tasmota/src/be_leds_pulse_class.c b/lib/libesp32/berry_tasmota/src/be_leds_pulse_class.c
deleted file mode 100644
index 3a2753b56..000000000
--- a/lib/libesp32/berry_tasmota/src/be_leds_pulse_class.c
+++ /dev/null
@@ -1,9 +0,0 @@
-/********************************************************************
- * Berry class `Leds_pulse`
- *
- *******************************************************************/
-#ifdef USE_WS2812
-
-#include "solidify/solidified_leds_1_animate_effects.h"
-
-#endif // USE_WS2812
diff --git a/lib/libesp32/berry_tasmota/src/be_tasmota_lib.c b/lib/libesp32/berry_tasmota/src/be_tasmota_lib.c
index 9bd9120b7..f023a832f 100644
--- a/lib/libesp32/berry_tasmota/src/be_tasmota_lib.c
+++ b/lib/libesp32/berry_tasmota/src/be_tasmota_lib.c
@@ -35,6 +35,7 @@ extern int l_delay(bvm *vm);
extern int l_delay_microseconds(bvm *vm);
extern int l_scaleuint(bvm *vm);
extern int l_scaleint(bvm *vm);
+extern int l_sineint(bvm *vm);
extern int l_logInfo(bvm *vm);
extern int l_loglevel(bvm *vm);
extern int l_save(bvm *vm);
@@ -120,6 +121,7 @@ class be_class_tasmota (scope: global, name: Tasmota) {
delay_microseconds, func(l_delay_microseconds)
scale_uint, static_func(l_scaleuint)
scale_int, static_func(l_scaleint)
+ sine_int, static_func(l_sineint)
log, func(l_logInfo)
loglevel, func(l_loglevel)
save, func(l_save)
diff --git a/lib/libesp32/berry_tasmota/src/embedded/leds_0_animator.be b/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be
similarity index 94%
rename from lib/libesp32/berry_tasmota/src/embedded/leds_0_animator.be
rename to lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be
index e6de57d09..f7bdf2e52 100644
--- a/lib/libesp32/berry_tasmota/src/embedded/leds_0_animator.be
+++ b/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be
@@ -1,13 +1,8 @@
-# class Leds_animator
-
-#@ solidify:Leds_animator,weak
-
-# for solidification
-class Leds_frame end
+# class Animate_core
##########################################################################################
#
-# class Leds_animator
+# class Animate_core
#
# Simple framework to orchestrate all the animations for a led strip or led matrix
#
@@ -15,7 +10,8 @@ class Leds_frame end
# This version uses `fast_loop` for up to 5ms animation time (200 Hz)
#
##########################################################################################
-class Leds_animator
+#@ solidify:Animate_core,weak
+class Animate_core
var strip # neopixelbus object
var pixel_count # number of pixels in the strip
var bri # brightness of the animation, 0..100, default 50
@@ -35,6 +31,7 @@ class Leds_animator
var back_color # background color RRGGBB
def init(strip, bri)
+ import animate
self.strip = strip
if (bri == nil) bri = 50 end
self.bri = bri # percentage of brightness 0..100
@@ -44,8 +41,8 @@ class Leds_animator
self.painters = []
#
self.clear() # clear all leds first
- self.frame = Leds_frame(self.pixel_count)
- self.layer = Leds_frame(self.pixel_count)
+ self.frame = animate.frame(self.pixel_count)
+ self.layer = animate.frame(self.pixel_count)
#
self.fast_loop_cb = def() self.fast_loop() end
self.back_color = 0x000000
diff --git a/lib/libesp32/berry_tasmota/src/embedded/leds_1_animate_effects.be b/lib/libesp32/berry_tasmota/src/embedded/animate_1_animate_effects.be
similarity index 82%
rename from lib/libesp32/berry_tasmota/src/embedded/leds_1_animate_effects.be
rename to lib/libesp32/berry_tasmota/src/embedded/animate_1_animate_effects.be
index fd8d112ed..e2a5a9736 100644
--- a/lib/libesp32/berry_tasmota/src/embedded/leds_1_animate_effects.be
+++ b/lib/libesp32/berry_tasmota/src/embedded/animate_1_animate_effects.be
@@ -1,14 +1,12 @@
-# class Leds_pulse
-
-#@ solidify:Leds_pulse,weak
+# class Animate_pulse
##########################################################################################
#
-# class Leds_pulse
+# class Animate_pulse
#
# Display a color pulse
#
-# index (1)
+# pos (1)
# |
# v
# _______
@@ -17,16 +15,17 @@
# | | | |
# |2| 3 |2|
#
-# 1: `index`, start of the pulse (in pixel)
+# 1: `pos`, start of the pulse (in pixel)
# 2: `slew_size`, number of pixels to fade from back to fore color, can be `0`
# 3: `pulse_size`, number of pixels of the pulse
#
##########################################################################################
-class Leds_pulse
+#@ solidify:Animate_pulse,weak
+class Animate_pulse
var color
var back_color
- var index
+ var pos
var slew_size
var pulse_size
@@ -54,8 +53,8 @@ class Leds_pulse
self.back_color = c
end
- def set_index(index)
- self.index = index
+ def set_pos(pos)
+ self.pos = pos
end
def set_slew_size(slew_size)
@@ -72,18 +71,18 @@ class Leds_pulse
if (back_color != 0xFF000000)
frame.fill_pixels(back_color) # fill with transparent color
end
- var index = self.index
+ var pos = self.pos
var slew_size = self.slew_size
var pulse_size = self.pulse_size
var color = self.color
var pixel_size = frame.pixel_size
- # var min_index = index - slew_size
- # var max_index = index + pulse_size + slew_size - 1
+ # var min_index = pos - slew_size
+ # var max_index = pos + pulse_size + slew_size - 1
var pulse_min, pulse_max
- pulse_min = index
- pulse_max = index + pulse_size
+ pulse_min = pos
+ pulse_max = pos + pulse_size
if (pulse_min < 0) pulse_min = 0 end
if (pulse_max >= pixel_size) pulse_max = pixel_size end
@@ -94,28 +93,28 @@ class Leds_pulse
end
if (slew_size > 0)
- # check first slew, from `min_index` to `index - 1`
+ # check first slew, from `min_index` to `pos - 1`
# Slew 1
- pulse_min = index - slew_size
- pulse_max = index
+ pulse_min = pos - slew_size
+ pulse_max = pos
if (pulse_min < 0) pulse_min = 0 end
if (pulse_max >= pixel_size) pulse_max = pixel_size end
i = pulse_min
while (i < pulse_max)
# blend from 255 (back) to 0 (fore)
- frame[i] = frame.blend(back_color, color, tasmota.scale_int(i, index - slew_size - 1, index, 255, 0))
+ frame[i] = frame.blend(back_color, color, tasmota.scale_int(i, pos - slew_size - 1, pos, 255, 0))
# blend
i += 1
end
# Slew 2
- pulse_min = index + pulse_size
- pulse_max = index + pulse_size + slew_size
+ pulse_min = pos + pulse_size
+ pulse_max = pos + pulse_size + slew_size
if (pulse_min < 0) pulse_min = 0 end
if (pulse_max >= pixel_size) pulse_max = pixel_size end
i = pulse_min
while (i < pulse_max)
# blend
- frame[i] = frame.blend(back_color, color, tasmota.scale_int(i, index + pulse_size - 1, index + pulse_size + slew_size, 0, 255))
+ frame[i] = frame.blend(back_color, color, tasmota.scale_int(i, pos + pulse_size - 1, pos + pulse_size + slew_size, 0, 255))
i += 1
end
end
@@ -130,10 +129,11 @@ end
#
if false
-var frame = Leds_frame(10)
+import animate
+var frame = animate.frame(10)
assert(frame.tohex() == '00000000000000000000000000000000000000000000000000000000000000000000000000000000')
-var pulse = Leds_pulse(0x00FF00, 3, 2)
+var pulse = Animate_pulse(0x00FF00, 3, 2)
pulse.set_index(5)
pulse.paint(frame)
assert(frame.tohex() == '0000000000000000000000000055000000AA000000FF000000FF000000FF000000AA000000550000')
diff --git a/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be b/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be
new file mode 100644
index 000000000..45f22b81b
--- /dev/null
+++ b/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be
@@ -0,0 +1,508 @@
+#
+# class Animate
+#
+# Animation framework
+#
+
+animate = module("animate")
+
+# for solidification
+class Leds_frame end
+
+animate.("()") = Animate_core # make it available as `animate()`
+animate.frame = Leds_frame
+animate.pulse = Animate_pulse
+
+#################################################################################
+# class Animate_palette
+#
+# Animated color palette
+#################################################################################
+
+#################################################################################
+# Palette format compatible
+#
+# Takes a binary array with a set of 4 bytes elements: VRGB
+# V: Value in a range 0..255. The first value must be 0,
+# the last needs to be 255.
+# Numbers must be in strictly increasin numbers.
+# The algorithm maps a 0..255 rotating value to its color
+# in the palette.
+# R: Red component
+# G: Green component
+# B: Blue component
+# Note: RGB is in big Endian to make it more readable, although
+# it's little-endian when in memory. Be aware!
+# RGB values are stored at max brightness and without gamma correction
+#################################################################################
+
+# # Gradient palette "ib_jul01_gp", originally from
+# # http://soliton.vm.bytemark.co.uk/pub/cpt-city/ing/xmas/tn/ib_jul01.png.index.html
+# var PALETTE_ib_jul01_gp = bytes(
+# "00" "E60611"
+# "5E" "25605A"
+# "85" "90BD6A"
+# "FF" "BB030D"
+# )
+# # animate.PALETTE_ib_jul01_gp = PALETTE_ib_jul01_gp
+# # rgb(230, 6, 17) 0.000%,
+# # rgb( 37, 96, 90) 37.010%,
+# # rgb(144,189,106) 52.000%,
+# # rgb(187, 3, 13) 100.000%
+
+# var PALETTE_STANDARD_VAL = bytes(
+# "00" "FF0000" # red
+# "24" "FFA500" # orange
+# "49" "FFFF00" # yellow
+# "6E" "008800" # green
+# "92" "0000FF" # blue
+# "B7" "4B0082" # indigo
+# "DB" "EE82EE" # violet
+# "FF" "FF0000" # red
+# )
+# # animate.PALETTE_STANDARD = PALETTE_STANDARD
+
+# var PALETTE_SATURATED_TAG = bytes(
+# "40" "FF0000" # red
+# "40" "FFA500" # orange
+# "40" "FFFF00" # yellow
+# "40" "00FF00" # green
+# "40" "0000FF" # blue
+# "40" "FF00FF" # indigo
+# "40" "EE44A5" # violet
+# "00" "FF0000" # red
+# )
+
+# var PALETTE_STANDARD_TAG = bytes(
+# "40" "FF0000" # red
+# "40" "FFA500" # orange
+# "40" "FFFF00" # yellow
+# "40" "008800" # green
+# "40" "0000FF" # blue
+# "40" "4B0082" # indigo
+# "40" "EE82EE" # violet
+# "00" "FF0000" # red
+# )
+# # animate.PALETTE_STANDARD = PALETTE_STANDARD
+
+
+#@ solidify:Animate_animator,weak
+class Animate_animator
+ # timing information
+ var running # true if running
+ var duration_ms # duration_ms of the entire cycle in ms, cannot be `0`
+ var origin # origin in ms of the current cycle, as per tasmota.millis() reference
+ # callback information
+ var obj # object to call
+ var mth # object method to call
+
+ def init(duration_ms)
+ self.duration_ms = duration_ms
+ end
+
+ def set_duration_ms(duration_ms)
+ self.duration_ms = duration_ms
+ end
+
+ def set_cb(obj, mth)
+ self.obj = obj
+ self.mth = mth
+ end
+
+ def start(millis)
+ if (self.duration_ms == nil) return end
+ if millis == nil millis = tasmota.millis() end
+ self.origin = millis
+ self.running = true
+ end
+
+ def stop()
+ self.origin = nil
+ self.running = false
+ end
+
+ def is_running()
+ return bool(self.running)
+ end
+
+ # called at the end of each cycle
+ def beat()
+ end
+
+end
+
+#@ solidify:Animate_palette,weak
+class Animate_palette : Animate_animator
+ ## inherited
+ ## timing information
+ # var running
+ # var duration_ms # duration_ms of the entire cycle in ms, cannot be `0`
+ # var origin # origin in ms of the current cycle, as per tasmota.millis() reference
+ ## callback information
+ # var obj # object to call
+ # var mth # object method to call
+
+ # parsing of palette
+ var palette # raw bytes object
+ var slots_arr # constructed array of timestamp slots
+ var slots # number of slots
+ # range information (when used as range color)
+ var range_min # minimum value expected as input
+ var range_max # maximum value expected as input, needs (range_min < range_max, can be negative)
+ # brightness
+ var bri # brightness to be applied to palette 0..100
+ # color object to do RGB color calculation
+ var color # instance of light_state, used for color calculation (reuse of object)
+
+ def init(palette, duration_ms)
+ super(self).init(duration_ms)
+ self.running = false
+ if (type(palette) == 'ptr') palette = self.ptr_to_palette(palette) end # convert comptr to palette buffer
+ self.palette = palette
+ self.bri = 100
+ self.slots = size(palette) / 4
+ if duration_ms != nil
+ self.set_duration(duration_ms)
+ end
+ self.color = light_state(light_state.RGB)
+ end
+
+ # setter to be used as cb
+ def set_bri(bri)
+ self.bri = int(bri)
+ end
+
+ # convert a comptr to a bytes() for palette
+ # parse the raw bytes to find the actual length
+ #
+ # input: comptr
+ # return: bytes() object of palette
+ static def ptr_to_palette(p)
+ if type(p) == 'ptr'
+ var b_raw = bytes(p, 2000) # arbitrary large size
+ var idx = 1
+ if b_raw[0] != 0
+ # palette in tick counts
+ while true
+ if b_raw[idx * 4] == 0
+ break
+ end
+ idx += 1
+ end
+ else
+ # palette is in value range from 0..255
+ while true
+ if b_raw[idx * 4] == 0xFF
+ break
+ end
+ idx += 1
+ end
+ end
+ var sz = (idx + 1) * 4
+ return bytes(p, sz)
+ end
+ end
+
+ def parse_palette(min, max)
+ var arr = []
+ var slots = self.slots
+ arr.resize(slots)
+
+ # check if we have slots or values
+ # if first value index is non-zero, it's ticks count
+ if self.palette.get(0, 1) != 0
+ # palette in tick counts
+ # compute the total number of ticks
+ var total_ticks = 0
+ var idx = 0
+ while idx < slots - 1
+ total_ticks += self.palette.get(idx * 4, 1)
+ idx += 1
+ end
+ var cur_ticks = 0
+ idx = 0
+ while idx < slots
+ arr[idx] = tasmota.scale_int(cur_ticks, 0, total_ticks, min, max)
+ cur_ticks += self.palette.get(idx * 4, 1)
+ idx += 1
+ end
+ else
+ # palette is in value range from 0..255
+ var idx = 0
+ while idx < slots
+ var val = self.palette.get(idx * 4, 1)
+ arr[idx] = tasmota.scale_int(val, 0, 255, min, max)
+ idx += 1
+ end
+ end
+ # print(f"ANM: {arr=}")
+ return arr
+ end
+
+ def set_duration(duration_ms)
+ if (duration_ms == nil) return end
+ if duration_ms <= 0 raise "value_error", "duration_ms must be positive" end
+ self.duration_ms = duration_ms
+
+ self.slots_arr = self.parse_palette(0, duration_ms - 1)
+ end
+
+ def set_range(min, max)
+ if (min >= max) raise "value_error", "min must be lower than mex" end
+ self.range_min = min
+ self.range_max = max
+
+ self.slots_arr = self.parse_palette(min, max)
+ end
+
+ # compute the css linear-gradient description
+ #
+ # Example: background: linear-gradient(to right, #000000, #e66465 11.0%, #9198e5);
+ static def to_css_gradient(palette)
+ var p = _class(palette)
+ var arr = p.parse_palette(0, 1000)
+ var ret = "background:linear-gradient(to right"
+ var idx = 0
+ while idx < size(arr)
+ var prm = arr[idx] # per mile
+
+ var bgrt = p.palette.get(idx * 4, 4)
+ var r = (bgrt >> 8) & 0xFF
+ var g = (bgrt >> 16) & 0xFF
+ var b = (bgrt >> 24) & 0xFF
+ ret += f",#{r:02X}{g:02X}{b:02X} {prm/10.0:.1f}%"
+ idx += 1
+ end
+ ret += ");"
+ return ret
+ end
+
+ def set_value(value)
+ if (self.range_min == nil || self.range_max == nil) return nil end
+ var scale_int = tasmota.scale_int
+
+ # find slot
+ var slots = self.slots
+ var idx = slots - 2
+ while idx > 0
+ if value >= self.slots_arr[idx] break end
+ idx -= 1
+ end
+ var bgrt0 = self.palette.get(idx * 4, 4)
+ var bgrt1 = self.palette.get((idx + 1) * 4, 4)
+ var t0 = self.slots_arr[idx]
+ var t1 = self.slots_arr[idx + 1]
+ var r = scale_int(value, t0, t1, (bgrt0 >> 8) & 0xFF, (bgrt1 >> 8) & 0xFF)
+ var g = scale_int(value, t0, t1, (bgrt0 >> 16) & 0xFF, (bgrt1 >> 16) & 0xFF)
+ var b = scale_int(value, t0, t1, (bgrt0 >> 24) & 0xFF, (bgrt1 >> 24) & 0xFF)
+ var rgb = (r << 16) | (g << 8) | b
+ #
+ var obj = self.obj
+ var mth = self.mth
+ if (obj && mth)
+ mth(obj, rgb)
+ end
+ # if self.cb != nil
+ # self.cb(rgb)
+ # end
+ #
+ # print(f"ANM: {rgb=:%06X}")
+ return rgb
+ end
+
+ def animate(millis)
+ if (self.duration_ms == nil) return end
+ if millis == nil millis = tasmota.millis() end
+ var past = millis - self.origin
+ if past < 0
+ past = 0
+ millis = self.origin
+ end
+ var duration_ms = self.duration_ms
+ var scale_uint = tasmota.scale_uint
+ if past >= duration_ms
+ self.origin += (past / duration_ms) * duration_ms
+ past = past % duration_ms
+ end
+ # find slot
+ var slots = self.slots
+ var idx = slots - 2
+ while idx > 0
+ if past >= self.slots_arr[idx] break end
+ idx -= 1
+ end
+ var bgrt0 = self.palette.get(idx * 4, 4)
+ var bgrt1 = self.palette.get((idx + 1) * 4, 4)
+ var t0 = self.slots_arr[idx]
+ var t1 = self.slots_arr[idx + 1]
+ var r = scale_uint(past, t0, t1, (bgrt0 >> 8) & 0xFF, (bgrt1 >> 8) & 0xFF)
+ var g = scale_uint(past, t0, t1, (bgrt0 >> 16) & 0xFF, (bgrt1 >> 16) & 0xFF)
+ var b = scale_uint(past, t0, t1, (bgrt0 >> 24) & 0xFF, (bgrt1 >> 24) & 0xFF)
+
+ var color = self.color
+ color.set_rgb((bgrt0 >> 8) & 0xFF, (bgrt0 >> 16) & 0xFF, (bgrt0 >> 24) & 0xFF)
+ var bri0 = color.bri
+ color.set_rgb((bgrt1 >> 8) & 0xFF, (bgrt1 >> 16) & 0xFF, (bgrt1 >> 24) & 0xFF)
+ var bri1 = color.bri
+ var bri2 = scale_uint(past, t0, t1, bri0, bri1)
+ color.set_rgb(r, g, b)
+ color.set_bri(bri2)
+
+ r = color.r
+ g = color.g
+ b = color.b
+
+ # apply self.bri if not `100`
+ var bri = self.bri
+ if bri != 100
+ r = tasmota.scale_uint(r, 0, 100, 0, bri)
+ g = tasmota.scale_uint(g, 0, 100, 0, bri)
+ b = tasmota.scale_uint(b, 0, 100, 0, bri)
+ end
+
+ # var rgb = (r << 16) | (g << 8) | b
+ var rgb = (r << 16) | (g << 8) | b
+
+ var obj = self.obj
+ var mth = self.mth
+ if (obj && mth)
+ mth(obj, rgb)
+ end
+
+ return rgb
+ end
+end
+animate.palette = Animate_palette
+
+#-
+
+pal = Animate_palette(PALETTE_STANDARD_TAG, 7000)
+pal = Animate_palette(PALETTE_STANDARD_VAL, 7000)
+
+
+import animate
+var pal = animate.palette(PALETTE_STANDARD_TAG, 7000)
+pal.start(0)
+for t: range(0,8000,200)
+ pal.tick(t)
+end
+
+-#
+
+animate.SAWTOOTH = 1
+animate.TRIANGLE = 2
+animate.SQUARE = 3
+animate.COSINE = 4
+animate.SINE = 5
+animate.LASTFOMR = 5 # identify last form
+
+#@ solidify:Animate_oscillator,weak
+class Animate_oscillator : Animate_animator
+ ## inherited
+ ## timing information
+ # var running
+ # var duration_ms # duration_ms of the entire cycle in ms, cannot be `0`
+ # var origin # origin in ms of the current cycle, as per tasmota.millis() reference
+ var phase # 0..100% - phase shift, default 0
+ var duty_cycle # 0..100% - duty cycle, default 50%
+ ## callback information
+ # var obj # object to call
+ # var mth # object method to call
+ var a # starting value
+ var b # end value
+ var form # waveform
+ # current value
+ var value
+
+ def init(a, b, duration_ms, form)
+ self.phase = 0
+ self.duty_cycle = 50
+ self.a = a
+ self.b = b
+ self.duration_ms = duration_ms
+ self.value = a
+ if (form == nil) form = 1 end
+ self.form = form
+ end
+
+ def set_phase(phase)
+ if (phase < 0) phase = 0 end
+ if (phase > 100) phase = 100 end
+ self.phase = phase
+ end
+
+ def set_duty_cycle(duty_cycle)
+ if (duty_cycle < 0) duty_cycle = 0 end
+ if (duty_cycle > 100) duty_cycle = 100 end
+ self.duty_cycle = duty_cycle
+ end
+
+ def set_a(a)
+ self.a = a
+ end
+ def set_b(b)
+ self.b = b
+ end
+
+ def animate(millis)
+ if (self.duration_ms == nil) return end
+ if millis == nil millis = tasmota.millis() end
+ var past = millis - self.origin
+ if past < 0
+ past = 0
+ millis = self.originally
+ end
+ var duration_ms = self.duration_ms
+ var duration_ms_mid # mid point considering duty cycle
+ duration_ms_mid = tasmota.scale_uint(self.duty_cycle, 0, 100, 0, duration_ms)
+ if past >= duration_ms
+ self.origin += (past / duration_ms) * duration_ms
+ past = past % duration_ms
+ # handle end of cycle
+ self.beat()
+ end
+
+ var a = self.a
+ var b = self.b
+ var value = self.value
+ var past_with_phase = past # adjust past with phase
+ if self.phase > 0
+ past_with_phase += tasmota.scale_uint(self.phase, 0, 100, 0, duration_ms)
+ if (past_with_phase > duration_ms) past_with_phase -= duration_ms end # if overflow, take modulus
+ end
+
+ if self.form == 1 #-SAWTOOTH-#
+ value = tasmota.scale_int(past_with_phase, 0, duration_ms - 1, a, b)
+ elif self.form == 2 #-TRIANGLE-#
+ if past_with_phase < duration_ms_mid
+ value = tasmota.scale_int(past_with_phase, 0, duration_ms_mid - 1, a, b)
+ else
+ value = tasmota.scale_int(past_with_phase, duration_ms_mid, duration_ms - 1, b, a)
+ end
+ elif self.form == 3 #-SQUARE-#
+ if past_with_phase < duration_ms_mid
+ value = a
+ else
+ value = b
+ end
+ elif (self.form == 4) #-COSINE-# || (self.form == 5) #-SINE-#
+ # map timing to 0..32767
+ var angle = tasmota.scale_int(past_with_phase, 0, duration_ms - 1, 0, 32767)
+ if (self.form == 4) #-COSINE-#
+ angle -= 8192
+ end
+ var x = tasmota.sine_int(angle) # -4096 .. 4096
+ value = tasmota.scale_int(x, -4096, 4096, a, b)
+ end
+ self.value = value
+
+ var obj = self.obj
+ var mth = self.mth
+ if (obj && mth)
+ mth(obj, value)
+ end
+
+ return value
+ end
+end
+animate.oscillator = Animate_oscillator
diff --git a/lib/libesp32/berry_tasmota/src/embedded/animate_module.be b/lib/libesp32/berry_tasmota/src/embedded/animate_module.be
deleted file mode 100644
index f1857c90c..000000000
--- a/lib/libesp32/berry_tasmota/src/embedded/animate_module.be
+++ /dev/null
@@ -1,573 +0,0 @@
-#
-# class Animate
-#
-# Animation framework
-#
-
-#@ solidify:animate,weak
-animate = module("animate")
-
-# state-machine: from val a to b
-class Animate_ins_ramp
- var a # starting value
- var b # end value
- var duration # duration in milliseconds
-
- def init(a,b,duration)
- self.a = a
- self.b = b
- self.duration = duration
- end
-end
-animate.ins_ramp = Animate_ins_ramp
-
-
-#################################################################################
-# class Animate_palette
-#
-# Animated color palette
-#################################################################################
-
-#################################################################################
-# Palette format compatible
-#
-# Takes a binary array with a set of 4 bytes elements: VRGB
-# V: Value in a range 0..255. The first value must be 0,
-# the last needs to be 255.
-# Numbers must be in strictly increasin numbers.
-# The algorithm maps a 0..255 rotating value to its color
-# in the palette.
-# R: Red component
-# G: Green component
-# B: Blue component
-# Note: RGB is in big Endian to make it more readable, although
-# it's little-endian when in memory. Be aware!
-# RGB values are stored at max brightness and without gamma correction
-#################################################################################
-
-# Gradient palette "ib_jul01_gp", originally from
-# http://soliton.vm.bytemark.co.uk/pub/cpt-city/ing/xmas/tn/ib_jul01.png.index.html
-var PALETTE_ib_jul01_gp = bytes(
- "00" "E60611"
- "5E" "25605A"
- "85" "90BD6A"
- "FF" "BB030D"
-)
-# animate.PALETTE_ib_jul01_gp = PALETTE_ib_jul01_gp
-# rgb(230, 6, 17) 0.000%,
-# rgb( 37, 96, 90) 37.010%,
-# rgb(144,189,106) 52.000%,
-# rgb(187, 3, 13) 100.000%
-
-var PALETTE_STANDARD_VAL = bytes(
- "00" "FF0000" # red
- "24" "FFA500" # orange
- "49" "FFFF00" # yellow
- "6E" "008800" # green
- "92" "0000FF" # blue
- "B7" "4B0082" # indigo
- "DB" "EE82EE" # violet
- "FF" "FF0000" # red
-)
-# animate.PALETTE_STANDARD = PALETTE_STANDARD
-
-var PALETTE_SATURATED_TAG = bytes(
- "40" "FF0000" # red
- "40" "FFA500" # orange
- "40" "FFFF00" # yellow
- "40" "00FF00" # green
- "40" "0000FF" # blue
- "40" "FF00FF" # indigo
- "40" "EE44A5" # violet
- "00" "FF0000" # red
-)
-
-var PALETTE_STANDARD_TAG = bytes(
- "40" "FF0000" # red
- "40" "FFA500" # orange
- "40" "FFFF00" # yellow
- "40" "008800" # green
- "40" "0000FF" # blue
- "40" "4B0082" # indigo
- "40" "EE82EE" # violet
- "00" "FF0000" # red
-)
-# animate.PALETTE_STANDARD = PALETTE_STANDARD
-
-
-class Animate_palette
- # parsing of palette
- var palette # raw bytes object
- var slots_arr # constructed array of timestamp slots
- var slots # number of slots
- # timing information
- var running
- var duration_ms # duration_ms of the entire cycle in ms, cannot be `0`
- var origin # origin in ms of the current cycle, as per tasmota.millis() reference
- # range information (when used as range color)
- var range_min # minimum value expected as input
- var range_max # maximum value expected as input, needs (range_min < range_max, can be negative)
- # callback information
- var animate_obj # object to call
- var animate_mth # object method to call
- # brightness
- var bri # brightness to be applied to palette 0..100
- # color object to do RGB color calculation
- var color # instance of light_state, used for color calculation (reuse of object)
-
- def init(palette, duration_s)
- self.running = false
- self.palette = palette
- self.bri = 100
- self.slots = size(palette) / 4
- if duration_s != nil
- self.set_duration(int(duration_s * 1000))
- end
- self.color = light_state(light_state.RGB)
- end
-
- def set_cb(obj, mth)
- self.animate_obj = obj
- self.animate_mth = mth
- end
-
- # setter to be used as cb
- def set_bri(bri)
- self.bri = int(bri)
- end
-
- def start(millis)
- if (self.duration_ms == nil) return end
- if millis == nil millis = tasmota.millis() end
- self.origin = millis
- self.running = true
- end
-
- def stop()
- self.origin = nil
- self.running = false
- end
-
- def is_running()
- return bool(self.running)
- end
-
- def parse_palette(min, max)
- var arr = []
- var slots = self.slots
- arr.resize(slots)
-
- # check if we have slots or values
- # if first value index is non-zero, it's ticks count
- if self.palette.get(0, 1) != 0
- # palette in tick counts
- # compute the total number of ticks
- var total_ticks = 0
- var idx = 0
- while idx < slots - 1
- total_ticks += self.palette.get(idx * 4, 1)
- idx += 1
- end
- var cur_ticks = 0
- idx = 0
- while idx < slots
- arr[idx] = tasmota.scale_int(cur_ticks, 0, total_ticks, min, max)
- cur_ticks += self.palette.get(idx * 4, 1)
- idx += 1
- end
- else
- # palette is in value range from 0..255
- var idx = 0
- while idx < slots
- var val = self.palette.get(idx * 4, 1)
- arr[idx] = tasmota.scale_int(val, 0, 255, min, max)
- idx += 1
- end
- end
- # print(f"ANM: {arr=}")
- return arr
- end
-
- def set_duration(duration_ms)
- if (duration_ms == nil) return end
- if duration_ms <= 0 raise "value_error", "duration_ms must be positive" end
- self.duration_ms = duration_ms
-
- self.slots_arr = self.parse_palette(0, duration_ms - 1)
- end
-
- def set_range(min, max)
- if (min >= max) raise "value_error", "min must be lower than mex" end
- self.range_min = min
- self.range_max = max
-
- self.slots_arr = self.parse_palette(min, max)
- end
-
- # compute the css linear-gradient description
- #
- # Example: background: linear-gradient(to right, #000000, #e66465 11.0%, #9198e5);
- def to_css_gradient()
- var arr = self.parse_palette(0, 1000)
- var ret = "background:linear-gradient(to right"
- var idx = 0
- while idx < size(arr)
- var prm = arr[idx] # per mile
-
- var bgrt = self.palette.get(idx * 4, 4)
- var r = (bgrt >> 8) & 0xFF
- var g = (bgrt >> 16) & 0xFF
- var b = (bgrt >> 24) & 0xFF
- ret += f",#{r:02X}{g:02X}{b:02X} {prm/10.0:.1f}%"
- idx += 1
- end
- ret += ");"
- return ret
- end
-
- def set_value(value)
- if (self.range_min == nil || self.range_max == nil) return nil end
- var scale_int = tasmota.scale_int
-
- # find slot
- var slots = self.slots
- var idx = slots - 2
- while idx > 0
- if value >= self.slots_arr[idx] break end
- idx -= 1
- end
- var bgrt0 = self.palette.get(idx * 4, 4)
- var bgrt1 = self.palette.get((idx + 1) * 4, 4)
- var t0 = self.slots_arr[idx]
- var t1 = self.slots_arr[idx + 1]
- var r = scale_int(value, t0, t1, (bgrt0 >> 8) & 0xFF, (bgrt1 >> 8) & 0xFF)
- var g = scale_int(value, t0, t1, (bgrt0 >> 16) & 0xFF, (bgrt1 >> 16) & 0xFF)
- var b = scale_int(value, t0, t1, (bgrt0 >> 24) & 0xFF, (bgrt1 >> 24) & 0xFF)
- var rgb = (r << 16) | (g << 8) | b
- #
- var obj = self.animate_obj
- var mth = self.animate_mth
- if (obj && mth)
- mth(obj, rgb)
- end
- # if self.cb != nil
- # self.cb(rgb)
- # end
- #
- # print(f"ANM: {rgb=:%06X}")
- return rgb
- end
-
- def animate(millis)
- if (self.duration_ms == nil) return end
- if millis == nil millis = tasmota.millis() end
- var past = millis - self.origin
- if past < 0
- past = 0
- millis = self.origin
- end
- var duration_ms = self.duration_ms
- var scale_uint = tasmota.scale_uint
- if past >= duration_ms
- self.origin += (past / duration_ms) * duration_ms
- past = past % duration_ms
- end
- # find slot
- var slots = self.slots
- var idx = slots - 2
- while idx > 0
- if past >= self.slots_arr[idx] break end
- idx -= 1
- end
- var bgrt0 = self.palette.get(idx * 4, 4)
- var bgrt1 = self.palette.get((idx + 1) * 4, 4)
- var t0 = self.slots_arr[idx]
- var t1 = self.slots_arr[idx + 1]
- var r = scale_uint(past, t0, t1, (bgrt0 >> 8) & 0xFF, (bgrt1 >> 8) & 0xFF)
- var g = scale_uint(past, t0, t1, (bgrt0 >> 16) & 0xFF, (bgrt1 >> 16) & 0xFF)
- var b = scale_uint(past, t0, t1, (bgrt0 >> 24) & 0xFF, (bgrt1 >> 24) & 0xFF)
-
- var color = self.color
- color.set_rgb((bgrt0 >> 8) & 0xFF, (bgrt0 >> 16) & 0xFF, (bgrt0 >> 24) & 0xFF)
- var bri0 = color.bri
- color.set_rgb((bgrt1 >> 8) & 0xFF, (bgrt1 >> 16) & 0xFF, (bgrt1 >> 24) & 0xFF)
- var bri1 = color.bri
- var bri2 = scale_uint(past, t0, t1, bri0, bri1)
- color.set_rgb(r, g, b)
- color.set_bri(bri2)
-
- r = color.r
- g = color.g
- b = color.b
-
- # apply self.bri if not `100`
- var bri = self.bri
- if bri != 100
- r = tasmota.scale_uint(r, 0, 100, 0, bri)
- g = tasmota.scale_uint(g, 0, 100, 0, bri)
- b = tasmota.scale_uint(b, 0, 100, 0, bri)
- end
-
- # var rgb = (r << 16) | (g << 8) | b
- var rgb = (r << 16) | (g << 8) | b
-
- var obj = self.animate_obj
- var mth = self.animate_mth
- if (obj && mth)
- mth(obj, rgb)
- end
-
- return rgb
- end
-end
-animate.palette = Animate_palette
-
-#-
-
-pal = Animate_palette(PALETTE_STANDARD_TAG, 7000)
-pal = Animate_palette(PALETTE_STANDARD_VAL, 7000)
-
-
-import animate
-var pal = animate.palette(PALETTE_STANDARD_TAG, 7000)
-pal.start(0)
-for t: range(0,8000,200)
- pal.tick(t)
-end
-
--#
-
-#################################################################################
-# class Animate_segment
-#
-# Animate a small segment ______/+++\______
-# length in 1/256 pixels
-# slew in 1/256 pixels
-# fore foregroung color
-# back background color (or transparent)
-# origin in 1/256 pixels
-#
-# strip
-#################################################################################
-# class Animate_segment
-# var strip
-# var length
-# var slew
-# var fore
-# var back
-# var origin
-
-# def init(strip)
-# self.strip = strip
-# self.length = 256 # 1 pixel
-# self.slew = 0 # 0 pixel (immediate)
-# self.fore = 0x00FF0000 # red opaque
-# self.back = 0xFF000000 # transparent
-# self.origin = 0 # start of strip
-# end
-
-# def paint(bri)
-# # move all important values in registers
-# var strip = self.strip
-# var pix_offset = strip.pixel_offset()
-# var pix_count = strip.pixel_count()
-# var pix_buffer = strip.pixels_buffer()
-# var pix_size = strip.pixel_size()
-
-# var length = self.length
-# var slew = self.slew
-# var fore = self.fore
-# var back = self.back
-# var origin = self.origin
-
-# var pix = 0 # iterate on each pixel
-# var limit_low = (origin - slew) / 256
-# var limit_high = (origin + length + slew) / 256
-# while pix < pix_count
-# # are we off limits
-# if (pix >= limit_low) && (pix <= limit_high) # outside of those boundaries, we just apply backgroung
-# strip.set_pixel_color(pix, fore, bri)
-# else
-# strip.set_pixel_color(pix, back, bri)
-# end
-# pix += 1
-# end
-# end
-# end
-# animate.segment = Animate_segment
-
-# state-machine: pause and goto
-class Animate_ins_goto
- var pc_rel # relative PC, -1 previous instruction, 1 next instruction, 0 means see pc_abs
- var pc_abs # absolute PC, only if pc_rel == 0, address if next instruction
- var duration # pause in milliseconds before goto, -1 means infinite (state-machine can be changed externally)
-
- def init(pc_rel, pc_abs, duration)
- self.pc_rel = pc_rel
- self.pc_abs = pc_abs
- self.duration = duration
- end
-end
-animate.ins_goto = Animate_ins_goto
-
-class Animate_engine
- var code # array of state-machine instructions
- var closure # closure to call with the new value
- var animate_obj # object to call (alternative to closure)
- var animate_mth # method to call on object
- var pc # program-counter
- var ins_time # absolute time when the current instruction started
- var running # is the animation running? allows fast return
- var value # current value
-
- def init()
- self.code = []
- self.pc = 0 # start at instruction 0
- self.ins_time = 0
- self.running = false # not running by default
- #
- end
-
- def set_cb(obj, mth)
- self.animate_obj = obj
- self.animate_mth = mth
- end
-
- # start but needs external calls to `animate()`
- # cur_time:int (opt) current timestamp in ms, defaults to `tasmota.millis()`
- # val:int (opt) starting value, default to `nil`
- def start(cur_time, val)
- if cur_time == nil cur_time = tasmota.millis() end
- if (val != nil) self.value = val end
- self.ins_time = cur_time
-
- self.running = true
- end
-
- # # runs autonomously in the Tasmota event loop
- # def autorun(cur_time, val)
- # self.run(cur_time, val)
- # end
-
- def stop()
- self.running = false
- end
-
- def is_running()
- return self.running
- end
-
- def animate(cur_time) # time in milliseconds, optional, defaults to `tasmota.millis()`
- if !self.running return end
- if cur_time == nil cur_time = tasmota.millis() end
- # run through instructions
- while true
- var sub_index = cur_time - self.ins_time # time since the beginning of current instruction
- #
- # make sure PC is valid
- if self.pc >= size(self.code)
- self.running = false
- break
- end
- #
- if self.pc < 0 raise "internal_error", "Animate pc is out of range" end
- var ins = self.code[self.pc]
-
- # Instruction Ramp
- if isinstance(ins, animate.ins_ramp)
- var closure = self.closure # assign to a local variable to not call a method
- var obj = self.animate_obj
- var mth = self.animate_mth
- if sub_index < ins.duration
- # we're still in the ramp
- self.value = tasmota.scale_uint(sub_index, 0, ins.duration, ins.a, ins.b)
- # call method
- if (obj && mth) mth(obj, self.value) end
- # call closure
- if (closure) closure(self.value) end # call closure, need try? TODO
- break
- else
- self.value = ins.b
- # call method
- if (obj && mth) mth(obj, self.value) end
- # call closure
- if (closure) closure(self.value) end # set to last value
- self.pc += 1 # next instruction
- self.ins_time = cur_time - (sub_index - ins.duration)
- end
-
- # Instruction Goto
- elif isinstance(ins, animate.ins_goto)
- if sub_index < ins.duration
- break
- else
- if ins.pc_rel != 0
- self.pc += ins.pc_rel
- else
- self.pc = ins.pc_abs
- end
- self.ins_time = cur_time - (sub_index - ins.duration)
- end
-
- # Invalid
- else
- raise "internal_error", "unknown instruction"
- end
- end
- return self.value
-
- end
-end
-animate.engine = Animate_engine
-
-class Animate_from_to : Animate_engine
-
- def init(obj, mth, from, to, duration)
- super(self).init()
- self.set_cb(obj, mth)
- self.code.push(animate.ins_ramp(from, to, duration))
- end
-
-end
-animate.from_to = Animate_from_to
-
-###
-#
-# a=Animate_from_to(nil, 0, 100, 5000)
-#
-###
-
-class Animate_rotate : Animate_engine
-
- def init(obj, mth, from, to, duration)
- super(self).init()
- self.set_cb(obj, mth)
- self.code.push(animate.ins_ramp(from, to, duration))
- self.code.push(animate.ins_goto(0, 0, 0)) # goto abs pc = 0 without any pause
- end
-
-end
-animate.rotate = Animate_rotate
-
-#-
-a=Animate_rotate(nil, 0, 100, 5000)
-a.autorun()
--#
-
-class Animate_back_forth : Animate_engine
-
- def init(obj, mth, from, to, duration)
- super(self).init()
- self.set_cb(obj, mth)
- self.code.push(animate.ins_ramp(from, to, duration))
- self.code.push(animate.ins_ramp(to, from, duration))
- self.code.push(animate.ins_goto(0, 0, 0)) # goto abs pc = 0 without any pause
- end
-
-end
-animate.back_forth = Animate_back_forth
-
-#-
-a=Animate_back_forth(nil, 0, 100, 5000)
-a.autorun()
--#
diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_leds_0_animator.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h
similarity index 85%
rename from lib/libesp32/berry_tasmota/src/solidify/solidified_leds_0_animator.h
rename to lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h
index ea031d397..f507d4144 100644
--- a/lib/libesp32/berry_tasmota/src/solidify/solidified_leds_0_animator.h
+++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h
@@ -1,15 +1,15 @@
-/* Solidification of leds_0_animator.h */
+/* Solidification of animate_0_core.h */
/********************************************************************\
* Generated code, don't edit *
\********************************************************************/
#include "be_constobj.h"
-extern const bclass be_class_Leds_animator;
+extern const bclass be_class_Animate_core;
/********************************************************************
** Solidified function: remove
********************************************************************/
-be_local_closure(Leds_animator_remove, /* name */
+be_local_closure(Animate_core_remove, /* name */
be_nested_proto(
4, /* nstack */
1, /* argc */
@@ -44,7 +44,7 @@ be_local_closure(Leds_animator_remove, /* name */
/********************************************************************
** Solidified function: add_background_animator
********************************************************************/
-be_local_closure(Leds_animator_add_background_animator, /* name */
+be_local_closure(Animate_core_add_background_animator, /* name */
be_nested_proto(
6, /* nstack */
2, /* argc */
@@ -79,7 +79,7 @@ be_local_closure(Leds_animator_add_background_animator, /* name */
/********************************************************************
** Solidified function: clear
********************************************************************/
-be_local_closure(Leds_animator_clear, /* name */
+be_local_closure(Animate_core_clear, /* name */
be_nested_proto(
3, /* nstack */
1, /* argc */
@@ -112,7 +112,7 @@ be_local_closure(Leds_animator_clear, /* name */
/********************************************************************
** Solidified function: add_animator
********************************************************************/
-be_local_closure(Leds_animator_add_animator, /* name */
+be_local_closure(Animate_core_add_animator, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
@@ -143,7 +143,7 @@ be_local_closure(Leds_animator_add_animator, /* name */
/********************************************************************
** Solidified function: animate
********************************************************************/
-be_local_closure(Leds_animator_animate, /* name */
+be_local_closure(Animate_core_animate, /* name */
be_nested_proto(
1, /* nstack */
1, /* argc */
@@ -167,7 +167,7 @@ be_local_closure(Leds_animator_animate, /* name */
/********************************************************************
** Solidified function: get_bri
********************************************************************/
-be_local_closure(Leds_animator_get_bri, /* name */
+be_local_closure(Animate_core_get_bri, /* name */
be_nested_proto(
3, /* nstack */
2, /* argc */
@@ -194,7 +194,7 @@ be_local_closure(Leds_animator_get_bri, /* name */
/********************************************************************
** Solidified function: set_bri
********************************************************************/
-be_local_closure(Leds_animator_set_bri, /* name */
+be_local_closure(Animate_core_set_bri, /* name */
be_nested_proto(
2, /* nstack */
2, /* argc */
@@ -221,7 +221,7 @@ be_local_closure(Leds_animator_set_bri, /* name */
/********************************************************************
** Solidified function: set_back_color
********************************************************************/
-be_local_closure(Leds_animator_set_back_color, /* name */
+be_local_closure(Animate_core_set_back_color, /* name */
be_nested_proto(
2, /* nstack */
2, /* argc */
@@ -248,7 +248,7 @@ be_local_closure(Leds_animator_set_back_color, /* name */
/********************************************************************
** Solidified function: stop
********************************************************************/
-be_local_closure(Leds_animator_stop, /* name */
+be_local_closure(Animate_core_stop, /* name */
be_nested_proto(
6, /* nstack */
1, /* argc */
@@ -299,7 +299,7 @@ be_local_closure(Leds_animator_stop, /* name */
/********************************************************************
** Solidified function: set_cb
********************************************************************/
-be_local_closure(Leds_animator_set_cb, /* name */
+be_local_closure(Animate_core_set_cb, /* name */
be_nested_proto(
3, /* nstack */
3, /* argc */
@@ -328,9 +328,9 @@ be_local_closure(Leds_animator_set_cb, /* name */
/********************************************************************
** Solidified function: init
********************************************************************/
-be_local_closure(Leds_animator_init, /* name */
+be_local_closure(Animate_core_init, /* name */
be_nested_proto(
- 5, /* nstack */
+ 7, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
@@ -363,15 +363,15 @@ be_local_closure(Leds_animator_init, /* name */
}),
1, /* has constants */
( &(const bvalue[13]) { /* constants */
- /* K0 */ be_nested_str_weak(strip),
- /* K1 */ be_nested_str_weak(bri),
- /* K2 */ be_nested_str_weak(running),
- /* K3 */ be_nested_str_weak(pixel_count),
- /* K4 */ be_nested_str_weak(animators),
- /* K5 */ be_nested_str_weak(painters),
- /* K6 */ be_nested_str_weak(clear),
- /* K7 */ be_nested_str_weak(frame),
- /* K8 */ be_nested_str_weak(Leds_frame),
+ /* K0 */ be_nested_str_weak(animate),
+ /* K1 */ be_nested_str_weak(strip),
+ /* K2 */ be_nested_str_weak(bri),
+ /* K3 */ be_nested_str_weak(running),
+ /* K4 */ be_nested_str_weak(pixel_count),
+ /* K5 */ be_nested_str_weak(animators),
+ /* K6 */ be_nested_str_weak(painters),
+ /* K7 */ be_nested_str_weak(clear),
+ /* K8 */ be_nested_str_weak(frame),
/* K9 */ be_nested_str_weak(layer),
/* K10 */ be_nested_str_weak(fast_loop_cb),
/* K11 */ be_nested_str_weak(back_color),
@@ -379,39 +379,40 @@ be_local_closure(Leds_animator_init, /* name */
}),
be_str_weak(init),
&be_const_str_solidified,
- ( &(const binstruction[32]) { /* code */
- 0x90020001, // 0000 SETMBR R0 K0 R1
- 0x4C0C0000, // 0001 LDNIL R3
- 0x1C0C0403, // 0002 EQ R3 R2 R3
- 0x780E0000, // 0003 JMPF R3 #0005
- 0x540A0031, // 0004 LDINT R2 50
- 0x90020202, // 0005 SETMBR R0 K1 R2
- 0x500C0000, // 0006 LDBOOL R3 0 0
- 0x90020403, // 0007 SETMBR R0 K2 R3
- 0x8C0C0303, // 0008 GETMET R3 R1 K3
- 0x7C0C0200, // 0009 CALL R3 1
- 0x90020603, // 000A SETMBR R0 K3 R3
- 0x600C0012, // 000B GETGBL R3 G18
- 0x7C0C0000, // 000C CALL R3 0
- 0x90020803, // 000D SETMBR R0 K4 R3
- 0x600C0012, // 000E GETGBL R3 G18
- 0x7C0C0000, // 000F CALL R3 0
- 0x90020A03, // 0010 SETMBR R0 K5 R3
- 0x8C0C0106, // 0011 GETMET R3 R0 K6
- 0x7C0C0200, // 0012 CALL R3 1
- 0xB80E1000, // 0013 GETNGBL R3 K8
- 0x88100103, // 0014 GETMBR R4 R0 K3
- 0x7C0C0200, // 0015 CALL R3 1
- 0x90020E03, // 0016 SETMBR R0 K7 R3
- 0xB80E1000, // 0017 GETNGBL R3 K8
- 0x88100103, // 0018 GETMBR R4 R0 K3
- 0x7C0C0200, // 0019 CALL R3 1
- 0x90021203, // 001A SETMBR R0 K9 R3
- 0x840C0000, // 001B CLOSURE R3 P0
- 0x90021403, // 001C SETMBR R0 K10 R3
- 0x9002170C, // 001D SETMBR R0 K11 K12
- 0xA0000000, // 001E CLOSE R0
- 0x80000000, // 001F RET 0
+ ( &(const binstruction[33]) { /* code */
+ 0xA40E0000, // 0000 IMPORT R3 K0
+ 0x90020201, // 0001 SETMBR R0 K1 R1
+ 0x4C100000, // 0002 LDNIL R4
+ 0x1C100404, // 0003 EQ R4 R2 R4
+ 0x78120000, // 0004 JMPF R4 #0006
+ 0x540A0031, // 0005 LDINT R2 50
+ 0x90020402, // 0006 SETMBR R0 K2 R2
+ 0x50100000, // 0007 LDBOOL R4 0 0
+ 0x90020604, // 0008 SETMBR R0 K3 R4
+ 0x8C100304, // 0009 GETMET R4 R1 K4
+ 0x7C100200, // 000A CALL R4 1
+ 0x90020804, // 000B SETMBR R0 K4 R4
+ 0x60100012, // 000C GETGBL R4 G18
+ 0x7C100000, // 000D CALL R4 0
+ 0x90020A04, // 000E SETMBR R0 K5 R4
+ 0x60100012, // 000F GETGBL R4 G18
+ 0x7C100000, // 0010 CALL R4 0
+ 0x90020C04, // 0011 SETMBR R0 K6 R4
+ 0x8C100107, // 0012 GETMET R4 R0 K7
+ 0x7C100200, // 0013 CALL R4 1
+ 0x8C100708, // 0014 GETMET R4 R3 K8
+ 0x88180104, // 0015 GETMBR R6 R0 K4
+ 0x7C100400, // 0016 CALL R4 2
+ 0x90021004, // 0017 SETMBR R0 K8 R4
+ 0x8C100708, // 0018 GETMET R4 R3 K8
+ 0x88180104, // 0019 GETMBR R6 R0 K4
+ 0x7C100400, // 001A CALL R4 2
+ 0x90021204, // 001B SETMBR R0 K9 R4
+ 0x84100000, // 001C CLOSURE R4 P0
+ 0x90021404, // 001D SETMBR R0 K10 R4
+ 0x9002170C, // 001E SETMBR R0 K11 K12
+ 0xA0000000, // 001F CLOSE R0
+ 0x80000000, // 0020 RET 0
})
)
);
@@ -421,7 +422,7 @@ be_local_closure(Leds_animator_init, /* name */
/********************************************************************
** Solidified function: add_painter
********************************************************************/
-be_local_closure(Leds_animator_add_painter, /* name */
+be_local_closure(Animate_core_add_painter, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
@@ -452,7 +453,7 @@ be_local_closure(Leds_animator_add_painter, /* name */
/********************************************************************
** Solidified function: fast_loop
********************************************************************/
-be_local_closure(Leds_animator_fast_loop, /* name */
+be_local_closure(Animate_core_fast_loop, /* name */
be_nested_proto(
12, /* nstack */
1, /* argc */
@@ -585,7 +586,7 @@ be_local_closure(Leds_animator_fast_loop, /* name */
/********************************************************************
** Solidified function: start
********************************************************************/
-be_local_closure(Leds_animator_start, /* name */
+be_local_closure(Animate_core_start, /* name */
be_nested_proto(
6, /* nstack */
1, /* argc */
@@ -636,49 +637,49 @@ be_local_closure(Leds_animator_start, /* name */
/********************************************************************
-** Solidified class: Leds_animator
+** Solidified class: Animate_core
********************************************************************/
-be_local_class(Leds_animator,
+be_local_class(Animate_core,
13,
NULL,
be_nested_map(28,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(bri, 23), be_const_var(2) },
- { be_const_key_weak(remove, -1), be_const_closure(Leds_animator_remove_closure) },
- { be_const_key_weak(start, 21), be_const_closure(Leds_animator_start_closure) },
- { be_const_key_weak(fast_loop, -1), be_const_closure(Leds_animator_fast_loop_closure) },
- { be_const_key_weak(add_animator, -1), be_const_closure(Leds_animator_add_animator_closure) },
+ { be_const_key_weak(remove, -1), be_const_closure(Animate_core_remove_closure) },
+ { be_const_key_weak(start, 21), be_const_closure(Animate_core_start_closure) },
+ { be_const_key_weak(fast_loop, -1), be_const_closure(Animate_core_fast_loop_closure) },
+ { be_const_key_weak(add_animator, -1), be_const_closure(Animate_core_add_animator_closure) },
{ be_const_key_weak(FAST_LOOP_MIN, 8), be_const_int(20) },
- { be_const_key_weak(animate, -1), be_const_closure(Leds_animator_animate_closure) },
+ { be_const_key_weak(animate, -1), be_const_closure(Animate_core_animate_closure) },
{ be_const_key_weak(pixel_count, -1), be_const_var(1) },
{ be_const_key_weak(animators, -1), be_const_var(4) },
{ be_const_key_weak(back_color, 11), be_const_var(12) },
{ be_const_key_weak(fast_loop_cb, 12), be_const_var(6) },
{ be_const_key_weak(frame, -1), be_const_var(10) },
{ be_const_key_weak(animate_object, -1), be_const_var(8) },
- { be_const_key_weak(stop, -1), be_const_closure(Leds_animator_stop_closure) },
- { be_const_key_weak(init, -1), be_const_closure(Leds_animator_init_closure) },
- { be_const_key_weak(set_cb, 13), be_const_closure(Leds_animator_set_cb_closure) },
+ { be_const_key_weak(stop, -1), be_const_closure(Animate_core_stop_closure) },
+ { be_const_key_weak(init, -1), be_const_closure(Animate_core_init_closure) },
+ { be_const_key_weak(set_cb, 13), be_const_closure(Animate_core_set_cb_closure) },
{ be_const_key_weak(running, -1), be_const_var(3) },
{ be_const_key_weak(strip, 15), be_const_var(0) },
{ be_const_key_weak(fast_loop_next, -1), be_const_var(7) },
- { be_const_key_weak(set_back_color, 14), be_const_closure(Leds_animator_set_back_color_closure) },
- { be_const_key_weak(add_painter, -1), be_const_closure(Leds_animator_add_painter_closure) },
- { be_const_key_weak(set_bri, 24), be_const_closure(Leds_animator_set_bri_closure) },
+ { be_const_key_weak(set_back_color, 14), be_const_closure(Animate_core_set_back_color_closure) },
+ { be_const_key_weak(add_painter, -1), be_const_closure(Animate_core_add_painter_closure) },
+ { be_const_key_weak(set_bri, 24), be_const_closure(Animate_core_set_bri_closure) },
{ be_const_key_weak(layer, 9), be_const_var(11) },
{ be_const_key_weak(animate_method, 6), be_const_var(9) },
- { be_const_key_weak(get_bri, -1), be_const_closure(Leds_animator_get_bri_closure) },
+ { be_const_key_weak(get_bri, -1), be_const_closure(Animate_core_get_bri_closure) },
{ be_const_key_weak(painters, -1), be_const_var(5) },
- { be_const_key_weak(clear, 3), be_const_closure(Leds_animator_clear_closure) },
- { be_const_key_weak(add_background_animator, 2), be_const_closure(Leds_animator_add_background_animator_closure) },
+ { be_const_key_weak(clear, 3), be_const_closure(Animate_core_clear_closure) },
+ { be_const_key_weak(add_background_animator, 2), be_const_closure(Animate_core_add_background_animator_closure) },
})),
- be_str_weak(Leds_animator)
+ be_str_weak(Animate_core)
);
/*******************************************************************/
-void be_load_Leds_animator_class(bvm *vm) {
- be_pushntvclass(vm, &be_class_Leds_animator);
- be_setglobal(vm, "Leds_animator");
+void be_load_Animate_core_class(bvm *vm) {
+ be_pushntvclass(vm, &be_class_Animate_core);
+ be_setglobal(vm, "Animate_core");
be_pop(vm, 1);
}
/********************************************************************/
diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_leds_1_animate_effects.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_1_animate_effects.h
similarity index 89%
rename from lib/libesp32/berry_tasmota/src/solidify/solidified_leds_1_animate_effects.h
rename to lib/libesp32/berry_tasmota/src/solidify/solidified_animate_1_animate_effects.h
index 1c2891e5b..bb8b9dee3 100644
--- a/lib/libesp32/berry_tasmota/src/solidify/solidified_leds_1_animate_effects.h
+++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_1_animate_effects.h
@@ -1,15 +1,42 @@
-/* Solidification of leds_1_animate_effects.h */
+/* Solidification of animate_1_animate_effects.h */
/********************************************************************\
* Generated code, don't edit *
\********************************************************************/
#include "be_constobj.h"
-extern const bclass be_class_Leds_pulse;
+extern const bclass be_class_Animate_pulse;
+
+/********************************************************************
+** Solidified function: set_pulse_size
+********************************************************************/
+be_local_closure(Animate_pulse_set_pulse_size, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(pulse_size),
+ }),
+ be_str_weak(set_pulse_size),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
/********************************************************************
** Solidified function: set_slew_size
********************************************************************/
-be_local_closure(Leds_pulse_set_slew_size, /* name */
+be_local_closure(Animate_pulse_set_slew_size, /* name */
be_nested_proto(
2, /* nstack */
2, /* argc */
@@ -36,7 +63,7 @@ be_local_closure(Leds_pulse_set_slew_size, /* name */
/********************************************************************
** Solidified function: set_back_color
********************************************************************/
-be_local_closure(Leds_pulse_set_back_color, /* name */
+be_local_closure(Animate_pulse_set_back_color, /* name */
be_nested_proto(
2, /* nstack */
2, /* argc */
@@ -61,9 +88,9 @@ be_local_closure(Leds_pulse_set_back_color, /* name */
/********************************************************************
-** Solidified function: set_index
+** Solidified function: set_pos
********************************************************************/
-be_local_closure(Leds_pulse_set_index, /* name */
+be_local_closure(Animate_pulse_set_pos, /* name */
be_nested_proto(
2, /* nstack */
2, /* argc */
@@ -74,9 +101,9 @@ be_local_closure(Leds_pulse_set_index, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(index),
+ /* K0 */ be_nested_str_weak(pos),
}),
- be_str_weak(set_index),
+ be_str_weak(set_pos),
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x90020001, // 0000 SETMBR R0 K0 R1
@@ -88,9 +115,9 @@ be_local_closure(Leds_pulse_set_index, /* name */
/********************************************************************
-** Solidified function: set_pulse_size
+** Solidified function: set_color
********************************************************************/
-be_local_closure(Leds_pulse_set_pulse_size, /* name */
+be_local_closure(Animate_pulse_set_color, /* name */
be_nested_proto(
2, /* nstack */
2, /* argc */
@@ -101,9 +128,9 @@ be_local_closure(Leds_pulse_set_pulse_size, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(pulse_size),
+ /* K0 */ be_nested_str_weak(color),
}),
- be_str_weak(set_pulse_size),
+ be_str_weak(set_color),
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x90020001, // 0000 SETMBR R0 K0 R1
@@ -117,7 +144,7 @@ be_local_closure(Leds_pulse_set_pulse_size, /* name */
/********************************************************************
** Solidified function: init
********************************************************************/
-be_local_closure(Leds_pulse_init, /* name */
+be_local_closure(Animate_pulse_init, /* name */
be_nested_proto(
5, /* nstack */
4, /* argc */
@@ -169,37 +196,10 @@ be_local_closure(Leds_pulse_init, /* name */
/*******************************************************************/
-/********************************************************************
-** Solidified function: set_color
-********************************************************************/
-be_local_closure(Leds_pulse_set_color, /* name */
- be_nested_proto(
- 2, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(color),
- }),
- be_str_weak(set_color),
- &be_const_str_solidified,
- ( &(const binstruction[ 2]) { /* code */
- 0x90020001, // 0000 SETMBR R0 K0 R1
- 0x80000000, // 0001 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
/********************************************************************
** Solidified function: paint
********************************************************************/
-be_local_closure(Leds_pulse_paint, /* name */
+be_local_closure(Animate_pulse_paint, /* name */
be_nested_proto(
22, /* nstack */
2, /* argc */
@@ -213,7 +213,7 @@ be_local_closure(Leds_pulse_paint, /* name */
/* K0 */ be_nested_str_weak(back_color),
/* K1 */ be_const_int(-16777216),
/* K2 */ be_nested_str_weak(fill_pixels),
- /* K3 */ be_nested_str_weak(index),
+ /* K3 */ be_nested_str_weak(pos),
/* K4 */ be_nested_str_weak(slew_size),
/* K5 */ be_nested_str_weak(pulse_size),
/* K6 */ be_nested_str_weak(color),
@@ -325,33 +325,33 @@ be_local_closure(Leds_pulse_paint, /* name */
/********************************************************************
-** Solidified class: Leds_pulse
+** Solidified class: Animate_pulse
********************************************************************/
-be_local_class(Leds_pulse,
+be_local_class(Animate_pulse,
5,
NULL,
be_nested_map(12,
( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(paint, 9), be_const_closure(Leds_pulse_paint_closure) },
- { be_const_key_weak(set_slew_size, -1), be_const_closure(Leds_pulse_set_slew_size_closure) },
+ { be_const_key_weak(paint, -1), be_const_closure(Animate_pulse_paint_closure) },
+ { be_const_key_weak(set_slew_size, -1), be_const_closure(Animate_pulse_set_slew_size_closure) },
{ be_const_key_weak(pulse_size, -1), be_const_var(4) },
- { be_const_key_weak(set_back_color, 6), be_const_closure(Leds_pulse_set_back_color_closure) },
- { be_const_key_weak(set_index, 7), be_const_closure(Leds_pulse_set_index_closure) },
- { be_const_key_weak(back_color, -1), be_const_var(1) },
- { be_const_key_weak(set_color, 8), be_const_closure(Leds_pulse_set_color_closure) },
+ { be_const_key_weak(set_back_color, 8), be_const_closure(Animate_pulse_set_back_color_closure) },
{ be_const_key_weak(color, -1), be_const_var(0) },
- { be_const_key_weak(init, -1), be_const_closure(Leds_pulse_init_closure) },
- { be_const_key_weak(set_pulse_size, -1), be_const_closure(Leds_pulse_set_pulse_size_closure) },
+ { be_const_key_weak(back_color, -1), be_const_var(1) },
+ { be_const_key_weak(set_pos, -1), be_const_closure(Animate_pulse_set_pos_closure) },
+ { be_const_key_weak(set_color, -1), be_const_closure(Animate_pulse_set_color_closure) },
+ { be_const_key_weak(init, 7), be_const_closure(Animate_pulse_init_closure) },
+ { be_const_key_weak(pos, -1), be_const_var(2) },
{ be_const_key_weak(slew_size, 5), be_const_var(3) },
- { be_const_key_weak(index, 0), be_const_var(2) },
+ { be_const_key_weak(set_pulse_size, 0), be_const_closure(Animate_pulse_set_pulse_size_closure) },
})),
- be_str_weak(Leds_pulse)
+ be_str_weak(Animate_pulse)
);
/*******************************************************************/
-void be_load_Leds_pulse_class(bvm *vm) {
- be_pushntvclass(vm, &be_class_Leds_pulse);
- be_setglobal(vm, "Leds_pulse");
+void be_load_Animate_pulse_class(bvm *vm) {
+ be_pushntvclass(vm, &be_class_Animate_pulse);
+ be_setglobal(vm, "Animate_pulse");
be_pop(vm, 1);
}
/********************************************************************/
diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_module.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_9_module.h
similarity index 60%
rename from lib/libesp32/berry_tasmota/src/solidify/solidified_animate_module.h
rename to lib/libesp32/berry_tasmota/src/solidify/solidified_animate_9_module.h
index 5d0f45c10..a337b5f82 100644
--- a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_module.h
+++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_9_module.h
@@ -1,17 +1,17 @@
-/* Solidification of animate_module.h */
+/* Solidification of animate_9_module.h */
/********************************************************************\
* Generated code, don't edit *
\********************************************************************/
#include "be_constobj.h"
-extern const bclass be_class_Animate_palette;
+extern const bclass be_class_Animate_animator;
/********************************************************************
-** Solidified function: to_css_gradient
+** Solidified function: is_running
********************************************************************/
-be_local_closure(Animate_palette_to_css_gradient, /* name */
+be_local_closure(Animate_animator_is_running, /* name */
be_nested_proto(
- 15, /* nstack */
+ 3, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
@@ -19,62 +19,16 @@ be_local_closure(Animate_palette_to_css_gradient, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 9]) { /* constants */
- /* K0 */ be_nested_str_weak(parse_palette),
- /* K1 */ be_const_int(0),
- /* K2 */ be_nested_str_weak(background_X3Alinear_X2Dgradient_X28to_X20right),
- /* K3 */ be_nested_str_weak(palette),
- /* K4 */ be_nested_str_weak(get),
- /* K5 */ be_nested_str_weak(_X2C_X23_X2502X_X2502X_X2502X_X20_X25_X2E1f_X25_X25),
- /* K6 */ be_const_real_hex(0x41200000),
- /* K7 */ be_const_int(1),
- /* K8 */ be_nested_str_weak(_X29_X3B),
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(running),
}),
- be_str_weak(to_css_gradient),
+ be_str_weak(is_running),
&be_const_str_solidified,
- ( &(const binstruction[42]) { /* code */
- 0x8C040100, // 0000 GETMET R1 R0 K0
- 0x580C0001, // 0001 LDCONST R3 K1
- 0x541203E7, // 0002 LDINT R4 1000
- 0x7C040600, // 0003 CALL R1 3
- 0x58080002, // 0004 LDCONST R2 K2
- 0x580C0001, // 0005 LDCONST R3 K1
- 0x6010000C, // 0006 GETGBL R4 G12
- 0x5C140200, // 0007 MOVE R5 R1
- 0x7C100200, // 0008 CALL R4 1
- 0x14100604, // 0009 LT R4 R3 R4
- 0x7812001C, // 000A JMPF R4 #0028
- 0x94100203, // 000B GETIDX R4 R1 R3
- 0x88140103, // 000C GETMBR R5 R0 K3
- 0x8C140B04, // 000D GETMET R5 R5 K4
- 0x541E0003, // 000E LDINT R7 4
- 0x081C0607, // 000F MUL R7 R3 R7
- 0x54220003, // 0010 LDINT R8 4
- 0x7C140600, // 0011 CALL R5 3
- 0x541A0007, // 0012 LDINT R6 8
- 0x3C180A06, // 0013 SHR R6 R5 R6
- 0x541E00FE, // 0014 LDINT R7 255
- 0x2C180C07, // 0015 AND R6 R6 R7
- 0x541E000F, // 0016 LDINT R7 16
- 0x3C1C0A07, // 0017 SHR R7 R5 R7
- 0x542200FE, // 0018 LDINT R8 255
- 0x2C1C0E08, // 0019 AND R7 R7 R8
- 0x54220017, // 001A LDINT R8 24
- 0x3C200A08, // 001B SHR R8 R5 R8
- 0x542600FE, // 001C LDINT R9 255
- 0x2C201009, // 001D AND R8 R8 R9
- 0x60240018, // 001E GETGBL R9 G24
- 0x58280005, // 001F LDCONST R10 K5
- 0x5C2C0C00, // 0020 MOVE R11 R6
- 0x5C300E00, // 0021 MOVE R12 R7
- 0x5C341000, // 0022 MOVE R13 R8
- 0x0C380906, // 0023 DIV R14 R4 K6
- 0x7C240A00, // 0024 CALL R9 5
- 0x00080409, // 0025 ADD R2 R2 R9
- 0x000C0707, // 0026 ADD R3 R3 K7
- 0x7001FFDD, // 0027 JMP #0006
- 0x00080508, // 0028 ADD R2 R2 K8
- 0x80040400, // 0029 RET 1 R2
+ ( &(const binstruction[ 4]) { /* code */
+ 0x60040017, // 0000 GETGBL R1 G23
+ 0x88080100, // 0001 GETMBR R2 R0 K0
+ 0x7C040200, // 0002 CALL R1 1
+ 0x80040200, // 0003 RET 1 R1
})
)
);
@@ -82,102 +36,23 @@ be_local_closure(Animate_palette_to_css_gradient, /* name */
/********************************************************************
-** Solidified function: parse_palette
+** Solidified function: beat
********************************************************************/
-be_local_closure(Animate_palette_parse_palette, /* name */
+be_local_closure(Animate_animator_beat, /* name */
be_nested_proto(
- 15, /* nstack */
- 3, /* argc */
+ 1, /* nstack */
+ 1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 8]) { /* constants */
- /* K0 */ be_nested_str_weak(slots),
- /* K1 */ be_nested_str_weak(resize),
- /* K2 */ be_nested_str_weak(palette),
- /* K3 */ be_nested_str_weak(get),
- /* K4 */ be_const_int(0),
- /* K5 */ be_const_int(1),
- /* K6 */ be_nested_str_weak(tasmota),
- /* K7 */ be_nested_str_weak(scale_int),
- }),
- be_str_weak(parse_palette),
+ 0, /* has constants */
+ NULL, /* no const */
+ be_str_weak(beat),
&be_const_str_solidified,
- ( &(const binstruction[71]) { /* code */
- 0x600C0012, // 0000 GETGBL R3 G18
- 0x7C0C0000, // 0001 CALL R3 0
- 0x88100100, // 0002 GETMBR R4 R0 K0
- 0x8C140701, // 0003 GETMET R5 R3 K1
- 0x5C1C0800, // 0004 MOVE R7 R4
- 0x7C140400, // 0005 CALL R5 2
- 0x88140102, // 0006 GETMBR R5 R0 K2
- 0x8C140B03, // 0007 GETMET R5 R5 K3
- 0x581C0004, // 0008 LDCONST R7 K4
- 0x58200005, // 0009 LDCONST R8 K5
- 0x7C140600, // 000A CALL R5 3
- 0x20140B04, // 000B NE R5 R5 K4
- 0x78160024, // 000C JMPF R5 #0032
- 0x58140004, // 000D LDCONST R5 K4
- 0x58180004, // 000E LDCONST R6 K4
- 0x041C0905, // 000F SUB R7 R4 K5
- 0x141C0C07, // 0010 LT R7 R6 R7
- 0x781E0008, // 0011 JMPF R7 #001B
- 0x881C0102, // 0012 GETMBR R7 R0 K2
- 0x8C1C0F03, // 0013 GETMET R7 R7 K3
- 0x54260003, // 0014 LDINT R9 4
- 0x08240C09, // 0015 MUL R9 R6 R9
- 0x58280005, // 0016 LDCONST R10 K5
- 0x7C1C0600, // 0017 CALL R7 3
- 0x00140A07, // 0018 ADD R5 R5 R7
- 0x00180D05, // 0019 ADD R6 R6 K5
- 0x7001FFF3, // 001A JMP #000F
- 0x581C0004, // 001B LDCONST R7 K4
- 0x58180004, // 001C LDCONST R6 K4
- 0x14200C04, // 001D LT R8 R6 R4
- 0x78220011, // 001E JMPF R8 #0031
- 0xB8220C00, // 001F GETNGBL R8 K6
- 0x8C201107, // 0020 GETMET R8 R8 K7
- 0x5C280E00, // 0021 MOVE R10 R7
- 0x582C0004, // 0022 LDCONST R11 K4
- 0x5C300A00, // 0023 MOVE R12 R5
- 0x5C340200, // 0024 MOVE R13 R1
- 0x5C380400, // 0025 MOVE R14 R2
- 0x7C200C00, // 0026 CALL R8 6
- 0x980C0C08, // 0027 SETIDX R3 R6 R8
- 0x88200102, // 0028 GETMBR R8 R0 K2
- 0x8C201103, // 0029 GETMET R8 R8 K3
- 0x542A0003, // 002A LDINT R10 4
- 0x08280C0A, // 002B MUL R10 R6 R10
- 0x582C0005, // 002C LDCONST R11 K5
- 0x7C200600, // 002D CALL R8 3
- 0x001C0E08, // 002E ADD R7 R7 R8
- 0x00180D05, // 002F ADD R6 R6 K5
- 0x7001FFEB, // 0030 JMP #001D
- 0x70020013, // 0031 JMP #0046
- 0x58140004, // 0032 LDCONST R5 K4
- 0x14180A04, // 0033 LT R6 R5 R4
- 0x781A0010, // 0034 JMPF R6 #0046
- 0x88180102, // 0035 GETMBR R6 R0 K2
- 0x8C180D03, // 0036 GETMET R6 R6 K3
- 0x54220003, // 0037 LDINT R8 4
- 0x08200A08, // 0038 MUL R8 R5 R8
- 0x58240005, // 0039 LDCONST R9 K5
- 0x7C180600, // 003A CALL R6 3
- 0xB81E0C00, // 003B GETNGBL R7 K6
- 0x8C1C0F07, // 003C GETMET R7 R7 K7
- 0x5C240C00, // 003D MOVE R9 R6
- 0x58280004, // 003E LDCONST R10 K4
- 0x542E00FE, // 003F LDINT R11 255
- 0x5C300200, // 0040 MOVE R12 R1
- 0x5C340400, // 0041 MOVE R13 R2
- 0x7C1C0C00, // 0042 CALL R7 6
- 0x980C0A07, // 0043 SETIDX R3 R5 R7
- 0x00140B05, // 0044 ADD R5 R5 K5
- 0x7001FFEC, // 0045 JMP #0033
- 0x80040600, // 0046 RET 1 R3
+ ( &(const binstruction[ 1]) { /* code */
+ 0x80000000, // 0000 RET 0
})
)
);
@@ -187,84 +62,24 @@ be_local_closure(Animate_palette_parse_palette, /* name */
/********************************************************************
** Solidified function: init
********************************************************************/
-be_local_closure(Animate_palette_init, /* name */
+be_local_closure(Animate_animator_init, /* name */
be_nested_proto(
- 7, /* nstack */
- 3, /* argc */
+ 2, /* nstack */
+ 2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 8]) { /* constants */
- /* K0 */ be_nested_str_weak(running),
- /* K1 */ be_nested_str_weak(palette),
- /* K2 */ be_nested_str_weak(bri),
- /* K3 */ be_nested_str_weak(slots),
- /* K4 */ be_nested_str_weak(set_duration),
- /* K5 */ be_nested_str_weak(color),
- /* K6 */ be_nested_str_weak(light_state),
- /* K7 */ be_nested_str_weak(RGB),
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(duration_ms),
}),
be_str_weak(init),
&be_const_str_solidified,
- ( &(const binstruction[26]) { /* code */
- 0x500C0000, // 0000 LDBOOL R3 0 0
- 0x90020003, // 0001 SETMBR R0 K0 R3
- 0x90020201, // 0002 SETMBR R0 K1 R1
- 0x540E0063, // 0003 LDINT R3 100
- 0x90020403, // 0004 SETMBR R0 K2 R3
- 0x600C000C, // 0005 GETGBL R3 G12
- 0x5C100200, // 0006 MOVE R4 R1
- 0x7C0C0200, // 0007 CALL R3 1
- 0x54120003, // 0008 LDINT R4 4
- 0x0C0C0604, // 0009 DIV R3 R3 R4
- 0x90020603, // 000A SETMBR R0 K3 R3
- 0x4C0C0000, // 000B LDNIL R3
- 0x200C0403, // 000C NE R3 R2 R3
- 0x780E0005, // 000D JMPF R3 #0014
- 0x8C0C0104, // 000E GETMET R3 R0 K4
- 0x60140009, // 000F GETGBL R5 G9
- 0x541A03E7, // 0010 LDINT R6 1000
- 0x08180406, // 0011 MUL R6 R2 R6
- 0x7C140200, // 0012 CALL R5 1
- 0x7C0C0400, // 0013 CALL R3 2
- 0xB80E0C00, // 0014 GETNGBL R3 K6
- 0xB8120C00, // 0015 GETNGBL R4 K6
- 0x88100907, // 0016 GETMBR R4 R4 K7
- 0x7C0C0200, // 0017 CALL R3 1
- 0x90020A03, // 0018 SETMBR R0 K5 R3
- 0x80000000, // 0019 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: set_cb
-********************************************************************/
-be_local_closure(Animate_palette_set_cb, /* name */
- be_nested_proto(
- 3, /* nstack */
- 3, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(animate_obj),
- /* K1 */ be_nested_str_weak(animate_mth),
- }),
- be_str_weak(set_cb),
- &be_const_str_solidified,
- ( &(const binstruction[ 3]) { /* code */
+ ( &(const binstruction[ 2]) { /* code */
0x90020001, // 0000 SETMBR R0 K0 R1
- 0x90020202, // 0001 SETMBR R0 K1 R2
- 0x80000000, // 0002 RET 0
+ 0x80000000, // 0001 RET 0
})
)
);
@@ -274,7 +89,7 @@ be_local_closure(Animate_palette_set_cb, /* name */
/********************************************************************
** Solidified function: stop
********************************************************************/
-be_local_closure(Animate_palette_stop, /* name */
+be_local_closure(Animate_animator_stop, /* name */
be_nested_proto(
2, /* nstack */
1, /* argc */
@@ -302,6 +117,213 @@ be_local_closure(Animate_palette_stop, /* name */
/*******************************************************************/
+/********************************************************************
+** Solidified function: set_duration_ms
+********************************************************************/
+be_local_closure(Animate_animator_set_duration_ms, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(duration_ms),
+ }),
+ be_str_weak(set_duration_ms),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_cb
+********************************************************************/
+be_local_closure(Animate_animator_set_cb, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(obj),
+ /* K1 */ be_nested_str_weak(mth),
+ }),
+ be_str_weak(set_cb),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 3]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x90020202, // 0001 SETMBR R0 K1 R2
+ 0x80000000, // 0002 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: start
+********************************************************************/
+be_local_closure(Animate_animator_start, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 5]) { /* constants */
+ /* K0 */ be_nested_str_weak(duration_ms),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(millis),
+ /* K3 */ be_nested_str_weak(origin),
+ /* K4 */ be_nested_str_weak(running),
+ }),
+ be_str_weak(start),
+ &be_const_str_solidified,
+ ( &(const binstruction[16]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x4C0C0000, // 0001 LDNIL R3
+ 0x1C080403, // 0002 EQ R2 R2 R3
+ 0x780A0000, // 0003 JMPF R2 #0005
+ 0x80000400, // 0004 RET 0
+ 0x4C080000, // 0005 LDNIL R2
+ 0x1C080202, // 0006 EQ R2 R1 R2
+ 0x780A0003, // 0007 JMPF R2 #000C
+ 0xB80A0200, // 0008 GETNGBL R2 K1
+ 0x8C080502, // 0009 GETMET R2 R2 K2
+ 0x7C080200, // 000A CALL R2 1
+ 0x5C040400, // 000B MOVE R1 R2
+ 0x90020601, // 000C SETMBR R0 K3 R1
+ 0x50080200, // 000D LDBOOL R2 1 0
+ 0x90020802, // 000E SETMBR R0 K4 R2
+ 0x80000000, // 000F RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified class: Animate_animator
+********************************************************************/
+be_local_class(Animate_animator,
+ 5,
+ NULL,
+ be_nested_map(12,
+ ( (struct bmapnode*) &(const bmapnode[]) {
+ { be_const_key_weak(running, 4), be_const_var(0) },
+ { be_const_key_weak(is_running, 2), be_const_closure(Animate_animator_is_running_closure) },
+ { be_const_key_weak(beat, -1), be_const_closure(Animate_animator_beat_closure) },
+ { be_const_key_weak(init, -1), be_const_closure(Animate_animator_init_closure) },
+ { be_const_key_weak(mth, -1), be_const_var(4) },
+ { be_const_key_weak(stop, -1), be_const_closure(Animate_animator_stop_closure) },
+ { be_const_key_weak(duration_ms, -1), be_const_var(1) },
+ { be_const_key_weak(origin, -1), be_const_var(2) },
+ { be_const_key_weak(set_cb, -1), be_const_closure(Animate_animator_set_cb_closure) },
+ { be_const_key_weak(set_duration_ms, 8), be_const_closure(Animate_animator_set_duration_ms_closure) },
+ { be_const_key_weak(obj, -1), be_const_var(3) },
+ { be_const_key_weak(start, -1), be_const_closure(Animate_animator_start_closure) },
+ })),
+ be_str_weak(Animate_animator)
+);
+/*******************************************************************/
+
+void be_load_Animate_animator_class(bvm *vm) {
+ be_pushntvclass(vm, &be_class_Animate_animator);
+ be_setglobal(vm, "Animate_animator");
+ be_pop(vm, 1);
+}
+
+extern const bclass be_class_Animate_palette;
+
+/********************************************************************
+** Solidified function: init
+********************************************************************/
+be_local_closure(Animate_palette_init, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[11]) { /* constants */
+ /* K0 */ be_nested_str_weak(init),
+ /* K1 */ be_nested_str_weak(running),
+ /* K2 */ be_nested_str_weak(ptr),
+ /* K3 */ be_nested_str_weak(ptr_to_palette),
+ /* K4 */ be_nested_str_weak(palette),
+ /* K5 */ be_nested_str_weak(bri),
+ /* K6 */ be_nested_str_weak(slots),
+ /* K7 */ be_nested_str_weak(set_duration),
+ /* K8 */ be_nested_str_weak(color),
+ /* K9 */ be_nested_str_weak(light_state),
+ /* K10 */ be_nested_str_weak(RGB),
+ }),
+ be_str_weak(init),
+ &be_const_str_solidified,
+ ( &(const binstruction[38]) { /* code */
+ 0x600C0003, // 0000 GETGBL R3 G3
+ 0x5C100000, // 0001 MOVE R4 R0
+ 0x7C0C0200, // 0002 CALL R3 1
+ 0x8C0C0700, // 0003 GETMET R3 R3 K0
+ 0x5C140400, // 0004 MOVE R5 R2
+ 0x7C0C0400, // 0005 CALL R3 2
+ 0x500C0000, // 0006 LDBOOL R3 0 0
+ 0x90020203, // 0007 SETMBR R0 K1 R3
+ 0x600C0004, // 0008 GETGBL R3 G4
+ 0x5C100200, // 0009 MOVE R4 R1
+ 0x7C0C0200, // 000A CALL R3 1
+ 0x1C0C0702, // 000B EQ R3 R3 K2
+ 0x780E0003, // 000C JMPF R3 #0011
+ 0x8C0C0103, // 000D GETMET R3 R0 K3
+ 0x5C140200, // 000E MOVE R5 R1
+ 0x7C0C0400, // 000F CALL R3 2
+ 0x5C040600, // 0010 MOVE R1 R3
+ 0x90020801, // 0011 SETMBR R0 K4 R1
+ 0x540E0063, // 0012 LDINT R3 100
+ 0x90020A03, // 0013 SETMBR R0 K5 R3
+ 0x600C000C, // 0014 GETGBL R3 G12
+ 0x5C100200, // 0015 MOVE R4 R1
+ 0x7C0C0200, // 0016 CALL R3 1
+ 0x54120003, // 0017 LDINT R4 4
+ 0x0C0C0604, // 0018 DIV R3 R3 R4
+ 0x90020C03, // 0019 SETMBR R0 K6 R3
+ 0x4C0C0000, // 001A LDNIL R3
+ 0x200C0403, // 001B NE R3 R2 R3
+ 0x780E0002, // 001C JMPF R3 #0020
+ 0x8C0C0107, // 001D GETMET R3 R0 K7
+ 0x5C140400, // 001E MOVE R5 R2
+ 0x7C0C0400, // 001F CALL R3 2
+ 0xB80E1200, // 0020 GETNGBL R3 K9
+ 0xB8121200, // 0021 GETNGBL R4 K9
+ 0x8810090A, // 0022 GETMBR R4 R4 K10
+ 0x7C0C0200, // 0023 CALL R3 1
+ 0x90021003, // 0024 SETMBR R0 K8 R3
+ 0x80000000, // 0025 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
/********************************************************************
** Solidified function: animate
********************************************************************/
@@ -335,8 +357,8 @@ be_local_closure(Animate_palette_animate, /* name */
/* K16 */ be_nested_str_weak(r),
/* K17 */ be_nested_str_weak(g),
/* K18 */ be_nested_str_weak(b),
- /* K19 */ be_nested_str_weak(animate_obj),
- /* K20 */ be_nested_str_weak(animate_mth),
+ /* K19 */ be_nested_str_weak(obj),
+ /* K20 */ be_nested_str_weak(mth),
}),
be_str_weak(animate),
&be_const_str_solidified,
@@ -540,6 +562,79 @@ be_local_closure(Animate_palette_animate, /* name */
/*******************************************************************/
+/********************************************************************
+** Solidified function: ptr_to_palette
+********************************************************************/
+be_local_closure(Animate_palette_ptr_to_palette, /* name */
+ be_nested_proto(
+ 8, /* nstack */
+ 1, /* argc */
+ 4, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_const_class(be_class_Animate_palette),
+ /* K1 */ be_nested_str_weak(ptr),
+ /* K2 */ be_const_int(1),
+ /* K3 */ be_const_int(0),
+ }),
+ be_str_weak(ptr_to_palette),
+ &be_const_str_solidified,
+ ( &(const binstruction[45]) { /* code */
+ 0x58040000, // 0000 LDCONST R1 K0
+ 0x60080004, // 0001 GETGBL R2 G4
+ 0x5C0C0000, // 0002 MOVE R3 R0
+ 0x7C080200, // 0003 CALL R2 1
+ 0x1C080501, // 0004 EQ R2 R2 K1
+ 0x780A0025, // 0005 JMPF R2 #002C
+ 0x60080015, // 0006 GETGBL R2 G21
+ 0x5C0C0000, // 0007 MOVE R3 R0
+ 0x541207CF, // 0008 LDINT R4 2000
+ 0x7C080400, // 0009 CALL R2 2
+ 0x580C0002, // 000A LDCONST R3 K2
+ 0x94100503, // 000B GETIDX R4 R2 K3
+ 0x20100903, // 000C NE R4 R4 K3
+ 0x7812000A, // 000D JMPF R4 #0019
+ 0x50100200, // 000E LDBOOL R4 1 0
+ 0x78120007, // 000F JMPF R4 #0018
+ 0x54120003, // 0010 LDINT R4 4
+ 0x08100604, // 0011 MUL R4 R3 R4
+ 0x94100404, // 0012 GETIDX R4 R2 R4
+ 0x1C100903, // 0013 EQ R4 R4 K3
+ 0x78120000, // 0014 JMPF R4 #0016
+ 0x70020001, // 0015 JMP #0018
+ 0x000C0702, // 0016 ADD R3 R3 K2
+ 0x7001FFF5, // 0017 JMP #000E
+ 0x7002000A, // 0018 JMP #0024
+ 0x50100200, // 0019 LDBOOL R4 1 0
+ 0x78120008, // 001A JMPF R4 #0024
+ 0x54120003, // 001B LDINT R4 4
+ 0x08100604, // 001C MUL R4 R3 R4
+ 0x94100404, // 001D GETIDX R4 R2 R4
+ 0x541600FE, // 001E LDINT R5 255
+ 0x1C100805, // 001F EQ R4 R4 R5
+ 0x78120000, // 0020 JMPF R4 #0022
+ 0x70020001, // 0021 JMP #0024
+ 0x000C0702, // 0022 ADD R3 R3 K2
+ 0x7001FFF4, // 0023 JMP #0019
+ 0x00100702, // 0024 ADD R4 R3 K2
+ 0x54160003, // 0025 LDINT R5 4
+ 0x08100805, // 0026 MUL R4 R4 R5
+ 0x60140015, // 0027 GETGBL R5 G21
+ 0x5C180000, // 0028 MOVE R6 R0
+ 0x5C1C0800, // 0029 MOVE R7 R4
+ 0x7C140400, // 002A CALL R5 2
+ 0x80040A00, // 002B RET 1 R5
+ 0x80000000, // 002C RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
/********************************************************************
** Solidified function: set_range
********************************************************************/
@@ -581,6 +676,109 @@ be_local_closure(Animate_palette_set_range, /* name */
/*******************************************************************/
+/********************************************************************
+** Solidified function: parse_palette
+********************************************************************/
+be_local_closure(Animate_palette_parse_palette, /* name */
+ be_nested_proto(
+ 15, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 8]) { /* constants */
+ /* K0 */ be_nested_str_weak(slots),
+ /* K1 */ be_nested_str_weak(resize),
+ /* K2 */ be_nested_str_weak(palette),
+ /* K3 */ be_nested_str_weak(get),
+ /* K4 */ be_const_int(0),
+ /* K5 */ be_const_int(1),
+ /* K6 */ be_nested_str_weak(tasmota),
+ /* K7 */ be_nested_str_weak(scale_int),
+ }),
+ be_str_weak(parse_palette),
+ &be_const_str_solidified,
+ ( &(const binstruction[71]) { /* code */
+ 0x600C0012, // 0000 GETGBL R3 G18
+ 0x7C0C0000, // 0001 CALL R3 0
+ 0x88100100, // 0002 GETMBR R4 R0 K0
+ 0x8C140701, // 0003 GETMET R5 R3 K1
+ 0x5C1C0800, // 0004 MOVE R7 R4
+ 0x7C140400, // 0005 CALL R5 2
+ 0x88140102, // 0006 GETMBR R5 R0 K2
+ 0x8C140B03, // 0007 GETMET R5 R5 K3
+ 0x581C0004, // 0008 LDCONST R7 K4
+ 0x58200005, // 0009 LDCONST R8 K5
+ 0x7C140600, // 000A CALL R5 3
+ 0x20140B04, // 000B NE R5 R5 K4
+ 0x78160024, // 000C JMPF R5 #0032
+ 0x58140004, // 000D LDCONST R5 K4
+ 0x58180004, // 000E LDCONST R6 K4
+ 0x041C0905, // 000F SUB R7 R4 K5
+ 0x141C0C07, // 0010 LT R7 R6 R7
+ 0x781E0008, // 0011 JMPF R7 #001B
+ 0x881C0102, // 0012 GETMBR R7 R0 K2
+ 0x8C1C0F03, // 0013 GETMET R7 R7 K3
+ 0x54260003, // 0014 LDINT R9 4
+ 0x08240C09, // 0015 MUL R9 R6 R9
+ 0x58280005, // 0016 LDCONST R10 K5
+ 0x7C1C0600, // 0017 CALL R7 3
+ 0x00140A07, // 0018 ADD R5 R5 R7
+ 0x00180D05, // 0019 ADD R6 R6 K5
+ 0x7001FFF3, // 001A JMP #000F
+ 0x581C0004, // 001B LDCONST R7 K4
+ 0x58180004, // 001C LDCONST R6 K4
+ 0x14200C04, // 001D LT R8 R6 R4
+ 0x78220011, // 001E JMPF R8 #0031
+ 0xB8220C00, // 001F GETNGBL R8 K6
+ 0x8C201107, // 0020 GETMET R8 R8 K7
+ 0x5C280E00, // 0021 MOVE R10 R7
+ 0x582C0004, // 0022 LDCONST R11 K4
+ 0x5C300A00, // 0023 MOVE R12 R5
+ 0x5C340200, // 0024 MOVE R13 R1
+ 0x5C380400, // 0025 MOVE R14 R2
+ 0x7C200C00, // 0026 CALL R8 6
+ 0x980C0C08, // 0027 SETIDX R3 R6 R8
+ 0x88200102, // 0028 GETMBR R8 R0 K2
+ 0x8C201103, // 0029 GETMET R8 R8 K3
+ 0x542A0003, // 002A LDINT R10 4
+ 0x08280C0A, // 002B MUL R10 R6 R10
+ 0x582C0005, // 002C LDCONST R11 K5
+ 0x7C200600, // 002D CALL R8 3
+ 0x001C0E08, // 002E ADD R7 R7 R8
+ 0x00180D05, // 002F ADD R6 R6 K5
+ 0x7001FFEB, // 0030 JMP #001D
+ 0x70020013, // 0031 JMP #0046
+ 0x58140004, // 0032 LDCONST R5 K4
+ 0x14180A04, // 0033 LT R6 R5 R4
+ 0x781A0010, // 0034 JMPF R6 #0046
+ 0x88180102, // 0035 GETMBR R6 R0 K2
+ 0x8C180D03, // 0036 GETMET R6 R6 K3
+ 0x54220003, // 0037 LDINT R8 4
+ 0x08200A08, // 0038 MUL R8 R5 R8
+ 0x58240005, // 0039 LDCONST R9 K5
+ 0x7C180600, // 003A CALL R6 3
+ 0xB81E0C00, // 003B GETNGBL R7 K6
+ 0x8C1C0F07, // 003C GETMET R7 R7 K7
+ 0x5C240C00, // 003D MOVE R9 R6
+ 0x58280004, // 003E LDCONST R10 K4
+ 0x542E00FE, // 003F LDINT R11 255
+ 0x5C300200, // 0040 MOVE R12 R1
+ 0x5C340400, // 0041 MOVE R13 R2
+ 0x7C1C0C00, // 0042 CALL R7 6
+ 0x980C0A07, // 0043 SETIDX R3 R5 R7
+ 0x00140B05, // 0044 ADD R5 R5 K5
+ 0x7001FFEC, // 0045 JMP #0033
+ 0x80040600, // 0046 RET 1 R3
+ })
+ )
+);
+/*******************************************************************/
+
+
/********************************************************************
** Solidified function: set_bri
********************************************************************/
@@ -611,35 +809,6 @@ be_local_closure(Animate_palette_set_bri, /* name */
/*******************************************************************/
-/********************************************************************
-** Solidified function: is_running
-********************************************************************/
-be_local_closure(Animate_palette_is_running, /* name */
- be_nested_proto(
- 3, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(running),
- }),
- be_str_weak(is_running),
- &be_const_str_solidified,
- ( &(const binstruction[ 4]) { /* code */
- 0x60040017, // 0000 GETGBL R1 G23
- 0x88080100, // 0001 GETMBR R2 R0 K0
- 0x7C040200, // 0002 CALL R1 1
- 0x80040200, // 0003 RET 1 R1
- })
- )
-);
-/*******************************************************************/
-
-
/********************************************************************
** Solidified function: set_duration
********************************************************************/
@@ -710,8 +879,8 @@ be_local_closure(Animate_palette_set_value, /* name */
/* K8 */ be_const_int(1),
/* K9 */ be_nested_str_weak(palette),
/* K10 */ be_nested_str_weak(get),
- /* K11 */ be_nested_str_weak(animate_obj),
- /* K12 */ be_nested_str_weak(animate_mth),
+ /* K11 */ be_nested_str_weak(obj),
+ /* K12 */ be_nested_str_weak(mth),
}),
be_str_weak(set_value),
&be_const_str_solidified,
@@ -819,11 +988,129 @@ be_local_closure(Animate_palette_set_value, /* name */
/********************************************************************
-** Solidified function: start
+** Solidified function: to_css_gradient
********************************************************************/
-be_local_closure(Animate_palette_start, /* name */
+be_local_closure(Animate_palette_to_css_gradient, /* name */
be_nested_proto(
- 4, /* nstack */
+ 17, /* nstack */
+ 1, /* argc */
+ 4, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[10]) { /* constants */
+ /* K0 */ be_const_class(be_class_Animate_palette),
+ /* K1 */ be_nested_str_weak(parse_palette),
+ /* K2 */ be_const_int(0),
+ /* K3 */ be_nested_str_weak(background_X3Alinear_X2Dgradient_X28to_X20right),
+ /* K4 */ be_nested_str_weak(palette),
+ /* K5 */ be_nested_str_weak(get),
+ /* K6 */ be_nested_str_weak(_X2C_X23_X2502X_X2502X_X2502X_X20_X25_X2E1f_X25_X25),
+ /* K7 */ be_const_real_hex(0x41200000),
+ /* K8 */ be_const_int(1),
+ /* K9 */ be_nested_str_weak(_X29_X3B),
+ }),
+ be_str_weak(to_css_gradient),
+ &be_const_str_solidified,
+ ( &(const binstruction[46]) { /* code */
+ 0x58040000, // 0000 LDCONST R1 K0
+ 0x5C080200, // 0001 MOVE R2 R1
+ 0x5C0C0000, // 0002 MOVE R3 R0
+ 0x7C080200, // 0003 CALL R2 1
+ 0x8C0C0501, // 0004 GETMET R3 R2 K1
+ 0x58140002, // 0005 LDCONST R5 K2
+ 0x541A03E7, // 0006 LDINT R6 1000
+ 0x7C0C0600, // 0007 CALL R3 3
+ 0x58100003, // 0008 LDCONST R4 K3
+ 0x58140002, // 0009 LDCONST R5 K2
+ 0x6018000C, // 000A GETGBL R6 G12
+ 0x5C1C0600, // 000B MOVE R7 R3
+ 0x7C180200, // 000C CALL R6 1
+ 0x14180A06, // 000D LT R6 R5 R6
+ 0x781A001C, // 000E JMPF R6 #002C
+ 0x94180605, // 000F GETIDX R6 R3 R5
+ 0x881C0504, // 0010 GETMBR R7 R2 K4
+ 0x8C1C0F05, // 0011 GETMET R7 R7 K5
+ 0x54260003, // 0012 LDINT R9 4
+ 0x08240A09, // 0013 MUL R9 R5 R9
+ 0x542A0003, // 0014 LDINT R10 4
+ 0x7C1C0600, // 0015 CALL R7 3
+ 0x54220007, // 0016 LDINT R8 8
+ 0x3C200E08, // 0017 SHR R8 R7 R8
+ 0x542600FE, // 0018 LDINT R9 255
+ 0x2C201009, // 0019 AND R8 R8 R9
+ 0x5426000F, // 001A LDINT R9 16
+ 0x3C240E09, // 001B SHR R9 R7 R9
+ 0x542A00FE, // 001C LDINT R10 255
+ 0x2C24120A, // 001D AND R9 R9 R10
+ 0x542A0017, // 001E LDINT R10 24
+ 0x3C280E0A, // 001F SHR R10 R7 R10
+ 0x542E00FE, // 0020 LDINT R11 255
+ 0x2C28140B, // 0021 AND R10 R10 R11
+ 0x602C0018, // 0022 GETGBL R11 G24
+ 0x58300006, // 0023 LDCONST R12 K6
+ 0x5C341000, // 0024 MOVE R13 R8
+ 0x5C381200, // 0025 MOVE R14 R9
+ 0x5C3C1400, // 0026 MOVE R15 R10
+ 0x0C400D07, // 0027 DIV R16 R6 K7
+ 0x7C2C0A00, // 0028 CALL R11 5
+ 0x0010080B, // 0029 ADD R4 R4 R11
+ 0x00140B08, // 002A ADD R5 R5 K8
+ 0x7001FFDD, // 002B JMP #000A
+ 0x00100909, // 002C ADD R4 R4 K9
+ 0x80040800, // 002D RET 1 R4
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified class: Animate_palette
+********************************************************************/
+extern const bclass be_class_Animate_animator;
+be_local_class(Animate_palette,
+ 7,
+ &be_class_Animate_animator,
+ be_nested_map(16,
+ ( (struct bmapnode*) &(const bmapnode[]) {
+ { be_const_key_weak(palette, 5), be_const_var(0) },
+ { be_const_key_weak(range_min, -1), be_const_var(3) },
+ { be_const_key_weak(slots_arr, -1), be_const_var(1) },
+ { be_const_key_weak(init, -1), be_const_closure(Animate_palette_init_closure) },
+ { be_const_key_weak(bri, 14), be_const_var(5) },
+ { be_const_key_weak(animate, -1), be_const_closure(Animate_palette_animate_closure) },
+ { be_const_key_weak(slots, -1), be_const_var(2) },
+ { be_const_key_weak(ptr_to_palette, -1), be_const_static_closure(Animate_palette_ptr_to_palette_closure) },
+ { be_const_key_weak(color, -1), be_const_var(6) },
+ { be_const_key_weak(set_range, 10), be_const_closure(Animate_palette_set_range_closure) },
+ { be_const_key_weak(to_css_gradient, -1), be_const_static_closure(Animate_palette_to_css_gradient_closure) },
+ { be_const_key_weak(set_bri, -1), be_const_closure(Animate_palette_set_bri_closure) },
+ { be_const_key_weak(set_duration, -1), be_const_closure(Animate_palette_set_duration_closure) },
+ { be_const_key_weak(set_value, -1), be_const_closure(Animate_palette_set_value_closure) },
+ { be_const_key_weak(parse_palette, -1), be_const_closure(Animate_palette_parse_palette_closure) },
+ { be_const_key_weak(range_max, -1), be_const_var(4) },
+ })),
+ be_str_weak(Animate_palette)
+);
+/*******************************************************************/
+
+void be_load_Animate_palette_class(bvm *vm) {
+ be_pushntvclass(vm, &be_class_Animate_palette);
+ be_setglobal(vm, "Animate_palette");
+ be_pop(vm, 1);
+}
+
+extern const bclass be_class_Animate_oscillator;
+
+/********************************************************************
+** Solidified function: set_b
+********************************************************************/
+be_local_closure(Animate_oscillator_set_b, /* name */
+ be_nested_proto(
+ 2, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
@@ -831,16 +1118,132 @@ be_local_closure(Animate_palette_start, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 5]) { /* constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(b),
+ }),
+ be_str_weak(set_b),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_a
+********************************************************************/
+be_local_closure(Animate_oscillator_set_a, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(a),
+ }),
+ be_str_weak(set_a),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: init
+********************************************************************/
+be_local_closure(Animate_oscillator_init, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 5, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 9]) { /* constants */
+ /* K0 */ be_nested_str_weak(phase),
+ /* K1 */ be_const_int(0),
+ /* K2 */ be_nested_str_weak(duty_cycle),
+ /* K3 */ be_nested_str_weak(a),
+ /* K4 */ be_nested_str_weak(b),
+ /* K5 */ be_nested_str_weak(duration_ms),
+ /* K6 */ be_nested_str_weak(value),
+ /* K7 */ be_const_int(1),
+ /* K8 */ be_nested_str_weak(form),
+ }),
+ be_str_weak(init),
+ &be_const_str_solidified,
+ ( &(const binstruction[13]) { /* code */
+ 0x90020101, // 0000 SETMBR R0 K0 K1
+ 0x54160031, // 0001 LDINT R5 50
+ 0x90020405, // 0002 SETMBR R0 K2 R5
+ 0x90020601, // 0003 SETMBR R0 K3 R1
+ 0x90020802, // 0004 SETMBR R0 K4 R2
+ 0x90020A03, // 0005 SETMBR R0 K5 R3
+ 0x90020C01, // 0006 SETMBR R0 K6 R1
+ 0x4C140000, // 0007 LDNIL R5
+ 0x1C140805, // 0008 EQ R5 R4 R5
+ 0x78160000, // 0009 JMPF R5 #000B
+ 0x58100007, // 000A LDCONST R4 K7
+ 0x90021004, // 000B SETMBR R0 K8 R4
+ 0x80000000, // 000C RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: animate
+********************************************************************/
+be_local_closure(Animate_oscillator_animate, /* name */
+ be_nested_proto(
+ 18, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[21]) { /* constants */
/* K0 */ be_nested_str_weak(duration_ms),
/* K1 */ be_nested_str_weak(tasmota),
/* K2 */ be_nested_str_weak(millis),
/* K3 */ be_nested_str_weak(origin),
- /* K4 */ be_nested_str_weak(running),
+ /* K4 */ be_const_int(0),
+ /* K5 */ be_nested_str_weak(originally),
+ /* K6 */ be_nested_str_weak(scale_uint),
+ /* K7 */ be_nested_str_weak(duty_cycle),
+ /* K8 */ be_nested_str_weak(beat),
+ /* K9 */ be_nested_str_weak(a),
+ /* K10 */ be_nested_str_weak(b),
+ /* K11 */ be_nested_str_weak(value),
+ /* K12 */ be_nested_str_weak(phase),
+ /* K13 */ be_nested_str_weak(form),
+ /* K14 */ be_const_int(1),
+ /* K15 */ be_nested_str_weak(scale_int),
+ /* K16 */ be_const_int(2),
+ /* K17 */ be_const_int(3),
+ /* K18 */ be_nested_str_weak(sine_int),
+ /* K19 */ be_nested_str_weak(obj),
+ /* K20 */ be_nested_str_weak(mth),
}),
- be_str_weak(start),
+ be_str_weak(animate),
&be_const_str_solidified,
- ( &(const binstruction[16]) { /* code */
+ ( &(const binstruction[150]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x4C0C0000, // 0001 LDNIL R3
0x1C080403, // 0002 EQ R2 R2 R3
@@ -853,10 +1256,144 @@ be_local_closure(Animate_palette_start, /* name */
0x8C080502, // 0009 GETMET R2 R2 K2
0x7C080200, // 000A CALL R2 1
0x5C040400, // 000B MOVE R1 R2
- 0x90020601, // 000C SETMBR R0 K3 R1
- 0x50080200, // 000D LDBOOL R2 1 0
- 0x90020802, // 000E SETMBR R0 K4 R2
- 0x80000000, // 000F RET 0
+ 0x88080103, // 000C GETMBR R2 R0 K3
+ 0x04080202, // 000D SUB R2 R1 R2
+ 0x140C0504, // 000E LT R3 R2 K4
+ 0x780E0001, // 000F JMPF R3 #0012
+ 0x58080004, // 0010 LDCONST R2 K4
+ 0x88040105, // 0011 GETMBR R1 R0 K5
+ 0x880C0100, // 0012 GETMBR R3 R0 K0
+ 0x4C100000, // 0013 LDNIL R4
+ 0xB8160200, // 0014 GETNGBL R5 K1
+ 0x8C140B06, // 0015 GETMET R5 R5 K6
+ 0x881C0107, // 0016 GETMBR R7 R0 K7
+ 0x58200004, // 0017 LDCONST R8 K4
+ 0x54260063, // 0018 LDINT R9 100
+ 0x58280004, // 0019 LDCONST R10 K4
+ 0x5C2C0600, // 001A MOVE R11 R3
+ 0x7C140C00, // 001B CALL R5 6
+ 0x5C100A00, // 001C MOVE R4 R5
+ 0x28140403, // 001D GE R5 R2 R3
+ 0x78160007, // 001E JMPF R5 #0027
+ 0x0C180403, // 001F DIV R6 R2 R3
+ 0x08180C03, // 0020 MUL R6 R6 R3
+ 0x88140103, // 0021 GETMBR R5 R0 K3
+ 0x00140A06, // 0022 ADD R5 R5 R6
+ 0x90020605, // 0023 SETMBR R0 K3 R5
+ 0x10080403, // 0024 MOD R2 R2 R3
+ 0x8C140108, // 0025 GETMET R5 R0 K8
+ 0x7C140200, // 0026 CALL R5 1
+ 0x88140109, // 0027 GETMBR R5 R0 K9
+ 0x8818010A, // 0028 GETMBR R6 R0 K10
+ 0x881C010B, // 0029 GETMBR R7 R0 K11
+ 0x5C200400, // 002A MOVE R8 R2
+ 0x8824010C, // 002B GETMBR R9 R0 K12
+ 0x24241304, // 002C GT R9 R9 K4
+ 0x7826000B, // 002D JMPF R9 #003A
+ 0xB8260200, // 002E GETNGBL R9 K1
+ 0x8C241306, // 002F GETMET R9 R9 K6
+ 0x882C010C, // 0030 GETMBR R11 R0 K12
+ 0x58300004, // 0031 LDCONST R12 K4
+ 0x54360063, // 0032 LDINT R13 100
+ 0x58380004, // 0033 LDCONST R14 K4
+ 0x5C3C0600, // 0034 MOVE R15 R3
+ 0x7C240C00, // 0035 CALL R9 6
+ 0x00201009, // 0036 ADD R8 R8 R9
+ 0x24241003, // 0037 GT R9 R8 R3
+ 0x78260000, // 0038 JMPF R9 #003A
+ 0x04201003, // 0039 SUB R8 R8 R3
+ 0x8824010D, // 003A GETMBR R9 R0 K13
+ 0x1C24130E, // 003B EQ R9 R9 K14
+ 0x78260009, // 003C JMPF R9 #0047
+ 0xB8260200, // 003D GETNGBL R9 K1
+ 0x8C24130F, // 003E GETMET R9 R9 K15
+ 0x5C2C1000, // 003F MOVE R11 R8
+ 0x58300004, // 0040 LDCONST R12 K4
+ 0x0434070E, // 0041 SUB R13 R3 K14
+ 0x5C380A00, // 0042 MOVE R14 R5
+ 0x5C3C0C00, // 0043 MOVE R15 R6
+ 0x7C240C00, // 0044 CALL R9 6
+ 0x5C1C1200, // 0045 MOVE R7 R9
+ 0x70020044, // 0046 JMP #008C
+ 0x8824010D, // 0047 GETMBR R9 R0 K13
+ 0x1C241310, // 0048 EQ R9 R9 K16
+ 0x78260015, // 0049 JMPF R9 #0060
+ 0x14241004, // 004A LT R9 R8 R4
+ 0x78260009, // 004B JMPF R9 #0056
+ 0xB8260200, // 004C GETNGBL R9 K1
+ 0x8C24130F, // 004D GETMET R9 R9 K15
+ 0x5C2C1000, // 004E MOVE R11 R8
+ 0x58300004, // 004F LDCONST R12 K4
+ 0x0434090E, // 0050 SUB R13 R4 K14
+ 0x5C380A00, // 0051 MOVE R14 R5
+ 0x5C3C0C00, // 0052 MOVE R15 R6
+ 0x7C240C00, // 0053 CALL R9 6
+ 0x5C1C1200, // 0054 MOVE R7 R9
+ 0x70020008, // 0055 JMP #005F
+ 0xB8260200, // 0056 GETNGBL R9 K1
+ 0x8C24130F, // 0057 GETMET R9 R9 K15
+ 0x5C2C1000, // 0058 MOVE R11 R8
+ 0x5C300800, // 0059 MOVE R12 R4
+ 0x0434070E, // 005A SUB R13 R3 K14
+ 0x5C380C00, // 005B MOVE R14 R6
+ 0x5C3C0A00, // 005C MOVE R15 R5
+ 0x7C240C00, // 005D CALL R9 6
+ 0x5C1C1200, // 005E MOVE R7 R9
+ 0x7002002B, // 005F JMP #008C
+ 0x8824010D, // 0060 GETMBR R9 R0 K13
+ 0x1C241311, // 0061 EQ R9 R9 K17
+ 0x78260005, // 0062 JMPF R9 #0069
+ 0x14241004, // 0063 LT R9 R8 R4
+ 0x78260001, // 0064 JMPF R9 #0067
+ 0x5C1C0A00, // 0065 MOVE R7 R5
+ 0x70020000, // 0066 JMP #0068
+ 0x5C1C0C00, // 0067 MOVE R7 R6
+ 0x70020022, // 0068 JMP #008C
+ 0x8824010D, // 0069 GETMBR R9 R0 K13
+ 0x542A0003, // 006A LDINT R10 4
+ 0x1C24120A, // 006B EQ R9 R9 R10
+ 0x74260003, // 006C JMPT R9 #0071
+ 0x8824010D, // 006D GETMBR R9 R0 K13
+ 0x542A0004, // 006E LDINT R10 5
+ 0x1C24120A, // 006F EQ R9 R9 R10
+ 0x7826001A, // 0070 JMPF R9 #008C
+ 0xB8260200, // 0071 GETNGBL R9 K1
+ 0x8C24130F, // 0072 GETMET R9 R9 K15
+ 0x5C2C1000, // 0073 MOVE R11 R8
+ 0x58300004, // 0074 LDCONST R12 K4
+ 0x0434070E, // 0075 SUB R13 R3 K14
+ 0x58380004, // 0076 LDCONST R14 K4
+ 0x543E7FFE, // 0077 LDINT R15 32767
+ 0x7C240C00, // 0078 CALL R9 6
+ 0x8828010D, // 0079 GETMBR R10 R0 K13
+ 0x542E0003, // 007A LDINT R11 4
+ 0x1C28140B, // 007B EQ R10 R10 R11
+ 0x782A0001, // 007C JMPF R10 #007F
+ 0x542A1FFF, // 007D LDINT R10 8192
+ 0x0424120A, // 007E SUB R9 R9 R10
+ 0xB82A0200, // 007F GETNGBL R10 K1
+ 0x8C281512, // 0080 GETMET R10 R10 K18
+ 0x5C301200, // 0081 MOVE R12 R9
+ 0x7C280400, // 0082 CALL R10 2
+ 0xB82E0200, // 0083 GETNGBL R11 K1
+ 0x8C2C170F, // 0084 GETMET R11 R11 K15
+ 0x5C341400, // 0085 MOVE R13 R10
+ 0x5439EFFF, // 0086 LDINT R14 -4096
+ 0x543E0FFF, // 0087 LDINT R15 4096
+ 0x5C400A00, // 0088 MOVE R16 R5
+ 0x5C440C00, // 0089 MOVE R17 R6
+ 0x7C2C0C00, // 008A CALL R11 6
+ 0x5C1C1600, // 008B MOVE R7 R11
+ 0x90021607, // 008C SETMBR R0 K11 R7
+ 0x88240113, // 008D GETMBR R9 R0 K19
+ 0x88280114, // 008E GETMBR R10 R0 K20
+ 0x78260004, // 008F JMPF R9 #0095
+ 0x782A0003, // 0090 JMPF R10 #0095
+ 0x5C2C1400, // 0091 MOVE R11 R10
+ 0x5C301200, // 0092 MOVE R12 R9
+ 0x5C340E00, // 0093 MOVE R13 R7
+ 0x7C2C0400, // 0094 CALL R11 2
+ 0x80040E00, // 0095 RET 1 R7
})
)
);
@@ -864,223 +1401,11 @@ be_local_closure(Animate_palette_start, /* name */
/********************************************************************
-** Solidified class: Animate_palette
+** Solidified function: set_duty_cycle
********************************************************************/
-be_local_class(Animate_palette,
- 12,
- NULL,
- be_nested_map(24,
- ( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(start, -1), be_const_closure(Animate_palette_start_closure) },
- { be_const_key_weak(to_css_gradient, -1), be_const_closure(Animate_palette_to_css_gradient_closure) },
- { be_const_key_weak(range_min, -1), be_const_var(6) },
- { be_const_key_weak(init, -1), be_const_closure(Animate_palette_init_closure) },
- { be_const_key_weak(set_value, -1), be_const_closure(Animate_palette_set_value_closure) },
- { be_const_key_weak(stop, -1), be_const_closure(Animate_palette_stop_closure) },
- { be_const_key_weak(slots, 15), be_const_var(2) },
- { be_const_key_weak(origin, -1), be_const_var(5) },
- { be_const_key_weak(animate, 19), be_const_closure(Animate_palette_animate_closure) },
- { be_const_key_weak(set_range, 2), be_const_closure(Animate_palette_set_range_closure) },
- { be_const_key_weak(slots_arr, -1), be_const_var(1) },
- { be_const_key_weak(set_bri, -1), be_const_closure(Animate_palette_set_bri_closure) },
- { be_const_key_weak(bri, 17), be_const_var(10) },
- { be_const_key_weak(is_running, -1), be_const_closure(Animate_palette_is_running_closure) },
- { be_const_key_weak(animate_mth, -1), be_const_var(9) },
- { be_const_key_weak(duration_ms, -1), be_const_var(4) },
- { be_const_key_weak(color, -1), be_const_var(11) },
- { be_const_key_weak(set_duration, 22), be_const_closure(Animate_palette_set_duration_closure) },
- { be_const_key_weak(animate_obj, -1), be_const_var(8) },
- { be_const_key_weak(palette, -1), be_const_var(0) },
- { be_const_key_weak(parse_palette, 14), be_const_closure(Animate_palette_parse_palette_closure) },
- { be_const_key_weak(set_cb, 4), be_const_closure(Animate_palette_set_cb_closure) },
- { be_const_key_weak(running, -1), be_const_var(3) },
- { be_const_key_weak(range_max, 0), be_const_var(7) },
- })),
- be_str_weak(Animate_palette)
-);
-
-extern const bclass be_class_Animate_rotate;
-
-/********************************************************************
-** Solidified function: init
-********************************************************************/
-be_local_closure(Animate_rotate_init, /* name */
+be_local_closure(Animate_oscillator_set_duty_cycle, /* name */
be_nested_proto(
- 13, /* nstack */
- 6, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 8]) { /* constants */
- /* K0 */ be_nested_str_weak(init),
- /* K1 */ be_nested_str_weak(set_cb),
- /* K2 */ be_nested_str_weak(code),
- /* K3 */ be_nested_str_weak(push),
- /* K4 */ be_nested_str_weak(animate),
- /* K5 */ be_nested_str_weak(ins_ramp),
- /* K6 */ be_nested_str_weak(ins_goto),
- /* K7 */ be_const_int(0),
- }),
- be_str_weak(init),
- &be_const_str_solidified,
- ( &(const binstruction[28]) { /* code */
- 0x60180003, // 0000 GETGBL R6 G3
- 0x5C1C0000, // 0001 MOVE R7 R0
- 0x7C180200, // 0002 CALL R6 1
- 0x8C180D00, // 0003 GETMET R6 R6 K0
- 0x7C180200, // 0004 CALL R6 1
- 0x8C180101, // 0005 GETMET R6 R0 K1
- 0x5C200200, // 0006 MOVE R8 R1
- 0x5C240400, // 0007 MOVE R9 R2
- 0x7C180600, // 0008 CALL R6 3
- 0x88180102, // 0009 GETMBR R6 R0 K2
- 0x8C180D03, // 000A GETMET R6 R6 K3
- 0xB8220800, // 000B GETNGBL R8 K4
- 0x8C201105, // 000C GETMET R8 R8 K5
- 0x5C280600, // 000D MOVE R10 R3
- 0x5C2C0800, // 000E MOVE R11 R4
- 0x5C300A00, // 000F MOVE R12 R5
- 0x7C200800, // 0010 CALL R8 4
- 0x7C180400, // 0011 CALL R6 2
- 0x88180102, // 0012 GETMBR R6 R0 K2
- 0x8C180D03, // 0013 GETMET R6 R6 K3
- 0xB8220800, // 0014 GETNGBL R8 K4
- 0x8C201106, // 0015 GETMET R8 R8 K6
- 0x58280007, // 0016 LDCONST R10 K7
- 0x582C0007, // 0017 LDCONST R11 K7
- 0x58300007, // 0018 LDCONST R12 K7
- 0x7C200800, // 0019 CALL R8 4
- 0x7C180400, // 001A CALL R6 2
- 0x80000000, // 001B RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified class: Animate_rotate
-********************************************************************/
-extern const bclass be_class_Animate_engine;
-be_local_class(Animate_rotate,
- 0,
- &be_class_Animate_engine,
- be_nested_map(1,
- ( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(init, -1), be_const_closure(Animate_rotate_init_closure) },
- })),
- be_str_weak(Animate_rotate)
-);
-
-extern const bclass be_class_Animate_ins_goto;
-
-/********************************************************************
-** Solidified function: init
-********************************************************************/
-be_local_closure(Animate_ins_goto_init, /* name */
- be_nested_proto(
- 4, /* nstack */
- 4, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 3]) { /* constants */
- /* K0 */ be_nested_str_weak(pc_rel),
- /* K1 */ be_nested_str_weak(pc_abs),
- /* K2 */ be_nested_str_weak(duration),
- }),
- be_str_weak(init),
- &be_const_str_solidified,
- ( &(const binstruction[ 4]) { /* code */
- 0x90020001, // 0000 SETMBR R0 K0 R1
- 0x90020202, // 0001 SETMBR R0 K1 R2
- 0x90020403, // 0002 SETMBR R0 K2 R3
- 0x80000000, // 0003 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified class: Animate_ins_goto
-********************************************************************/
-be_local_class(Animate_ins_goto,
- 3,
- NULL,
- be_nested_map(4,
- ( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(pc_rel, -1), be_const_var(0) },
- { be_const_key_weak(duration, -1), be_const_var(2) },
- { be_const_key_weak(init, -1), be_const_closure(Animate_ins_goto_init_closure) },
- { be_const_key_weak(pc_abs, 2), be_const_var(1) },
- })),
- be_str_weak(Animate_ins_goto)
-);
-
-extern const bclass be_class_Animate_ins_ramp;
-
-/********************************************************************
-** Solidified function: init
-********************************************************************/
-be_local_closure(Animate_ins_ramp_init, /* name */
- be_nested_proto(
- 4, /* nstack */
- 4, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 3]) { /* constants */
- /* K0 */ be_nested_str_weak(a),
- /* K1 */ be_nested_str_weak(b),
- /* K2 */ be_nested_str_weak(duration),
- }),
- be_str_weak(init),
- &be_const_str_solidified,
- ( &(const binstruction[ 4]) { /* code */
- 0x90020001, // 0000 SETMBR R0 K0 R1
- 0x90020202, // 0001 SETMBR R0 K1 R2
- 0x90020403, // 0002 SETMBR R0 K2 R3
- 0x80000000, // 0003 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified class: Animate_ins_ramp
-********************************************************************/
-be_local_class(Animate_ins_ramp,
- 3,
- NULL,
- be_nested_map(4,
- ( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(a, -1), be_const_var(0) },
- { be_const_key_weak(b, 2), be_const_var(1) },
- { be_const_key_weak(duration, -1), be_const_var(2) },
- { be_const_key_weak(init, -1), be_const_closure(Animate_ins_ramp_init_closure) },
- })),
- be_str_weak(Animate_ins_ramp)
-);
-
-extern const bclass be_class_Animate_engine;
-
-/********************************************************************
-** Solidified function: animate
-********************************************************************/
-be_local_closure(Animate_engine_animate, /* name */
- be_nested_proto(
- 14, /* nstack */
+ 3, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
@@ -1088,148 +1413,22 @@ be_local_closure(Animate_engine_animate, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[24]) { /* constants */
- /* K0 */ be_nested_str_weak(running),
- /* K1 */ be_nested_str_weak(tasmota),
- /* K2 */ be_nested_str_weak(millis),
- /* K3 */ be_nested_str_weak(ins_time),
- /* K4 */ be_nested_str_weak(pc),
- /* K5 */ be_nested_str_weak(code),
- /* K6 */ be_const_int(0),
- /* K7 */ be_nested_str_weak(internal_error),
- /* K8 */ be_nested_str_weak(Animate_X20pc_X20is_X20out_X20of_X20range),
- /* K9 */ be_nested_str_weak(animate),
- /* K10 */ be_nested_str_weak(ins_ramp),
- /* K11 */ be_nested_str_weak(closure),
- /* K12 */ be_nested_str_weak(animate_obj),
- /* K13 */ be_nested_str_weak(animate_mth),
- /* K14 */ be_nested_str_weak(duration),
- /* K15 */ be_nested_str_weak(value),
- /* K16 */ be_nested_str_weak(scale_uint),
- /* K17 */ be_nested_str_weak(a),
- /* K18 */ be_nested_str_weak(b),
- /* K19 */ be_const_int(1),
- /* K20 */ be_nested_str_weak(ins_goto),
- /* K21 */ be_nested_str_weak(pc_rel),
- /* K22 */ be_nested_str_weak(pc_abs),
- /* K23 */ be_nested_str_weak(unknown_X20instruction),
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_const_int(0),
+ /* K1 */ be_nested_str_weak(duty_cycle),
}),
- be_str_weak(animate),
+ be_str_weak(set_duty_cycle),
&be_const_str_solidified,
- ( &(const binstruction[113]) { /* code */
- 0x88080100, // 0000 GETMBR R2 R0 K0
- 0x740A0000, // 0001 JMPT R2 #0003
- 0x80000400, // 0002 RET 0
- 0x4C080000, // 0003 LDNIL R2
- 0x1C080202, // 0004 EQ R2 R1 R2
- 0x780A0003, // 0005 JMPF R2 #000A
- 0xB80A0200, // 0006 GETNGBL R2 K1
- 0x8C080502, // 0007 GETMET R2 R2 K2
- 0x7C080200, // 0008 CALL R2 1
- 0x5C040400, // 0009 MOVE R1 R2
- 0x50080200, // 000A LDBOOL R2 1 0
- 0x780A0062, // 000B JMPF R2 #006F
- 0x88080103, // 000C GETMBR R2 R0 K3
- 0x04080202, // 000D SUB R2 R1 R2
- 0x880C0104, // 000E GETMBR R3 R0 K4
- 0x6010000C, // 000F GETGBL R4 G12
- 0x88140105, // 0010 GETMBR R5 R0 K5
- 0x7C100200, // 0011 CALL R4 1
- 0x280C0604, // 0012 GE R3 R3 R4
- 0x780E0002, // 0013 JMPF R3 #0017
- 0x500C0000, // 0014 LDBOOL R3 0 0
- 0x90020003, // 0015 SETMBR R0 K0 R3
- 0x70020057, // 0016 JMP #006F
- 0x880C0104, // 0017 GETMBR R3 R0 K4
- 0x140C0706, // 0018 LT R3 R3 K6
- 0x780E0000, // 0019 JMPF R3 #001B
- 0xB0060F08, // 001A RAISE 1 K7 K8
- 0x880C0105, // 001B GETMBR R3 R0 K5
- 0x88100104, // 001C GETMBR R4 R0 K4
- 0x940C0604, // 001D GETIDX R3 R3 R4
- 0x6010000F, // 001E GETGBL R4 G15
- 0x5C140600, // 001F MOVE R5 R3
- 0xB81A1200, // 0020 GETNGBL R6 K9
- 0x88180D0A, // 0021 GETMBR R6 R6 K10
- 0x7C100400, // 0022 CALL R4 2
- 0x7812002E, // 0023 JMPF R4 #0053
- 0x8810010B, // 0024 GETMBR R4 R0 K11
- 0x8814010C, // 0025 GETMBR R5 R0 K12
- 0x8818010D, // 0026 GETMBR R6 R0 K13
- 0x881C070E, // 0027 GETMBR R7 R3 K14
- 0x141C0407, // 0028 LT R7 R2 R7
- 0x781E0014, // 0029 JMPF R7 #003F
- 0xB81E0200, // 002A GETNGBL R7 K1
- 0x8C1C0F10, // 002B GETMET R7 R7 K16
- 0x5C240400, // 002C MOVE R9 R2
- 0x58280006, // 002D LDCONST R10 K6
- 0x882C070E, // 002E GETMBR R11 R3 K14
- 0x88300711, // 002F GETMBR R12 R3 K17
- 0x88340712, // 0030 GETMBR R13 R3 K18
- 0x7C1C0C00, // 0031 CALL R7 6
- 0x90021E07, // 0032 SETMBR R0 K15 R7
- 0x78160004, // 0033 JMPF R5 #0039
- 0x781A0003, // 0034 JMPF R6 #0039
- 0x5C1C0C00, // 0035 MOVE R7 R6
- 0x5C200A00, // 0036 MOVE R8 R5
- 0x8824010F, // 0037 GETMBR R9 R0 K15
- 0x7C1C0400, // 0038 CALL R7 2
- 0x78120002, // 0039 JMPF R4 #003D
- 0x5C1C0800, // 003A MOVE R7 R4
- 0x8820010F, // 003B GETMBR R8 R0 K15
- 0x7C1C0200, // 003C CALL R7 1
- 0x70020030, // 003D JMP #006F
- 0x70020012, // 003E JMP #0052
- 0x881C0712, // 003F GETMBR R7 R3 K18
- 0x90021E07, // 0040 SETMBR R0 K15 R7
- 0x78160004, // 0041 JMPF R5 #0047
- 0x781A0003, // 0042 JMPF R6 #0047
- 0x5C1C0C00, // 0043 MOVE R7 R6
- 0x5C200A00, // 0044 MOVE R8 R5
- 0x8824010F, // 0045 GETMBR R9 R0 K15
- 0x7C1C0400, // 0046 CALL R7 2
- 0x78120002, // 0047 JMPF R4 #004B
- 0x5C1C0800, // 0048 MOVE R7 R4
- 0x8820010F, // 0049 GETMBR R8 R0 K15
- 0x7C1C0200, // 004A CALL R7 1
- 0x881C0104, // 004B GETMBR R7 R0 K4
- 0x001C0F13, // 004C ADD R7 R7 K19
- 0x90020807, // 004D SETMBR R0 K4 R7
- 0x881C070E, // 004E GETMBR R7 R3 K14
- 0x041C0407, // 004F SUB R7 R2 R7
- 0x041C0207, // 0050 SUB R7 R1 R7
- 0x90020607, // 0051 SETMBR R0 K3 R7
- 0x7002001A, // 0052 JMP #006E
- 0x6010000F, // 0053 GETGBL R4 G15
- 0x5C140600, // 0054 MOVE R5 R3
- 0xB81A1200, // 0055 GETNGBL R6 K9
- 0x88180D14, // 0056 GETMBR R6 R6 K20
- 0x7C100400, // 0057 CALL R4 2
- 0x78120013, // 0058 JMPF R4 #006D
- 0x8810070E, // 0059 GETMBR R4 R3 K14
- 0x14100404, // 005A LT R4 R2 R4
- 0x78120001, // 005B JMPF R4 #005E
- 0x70020011, // 005C JMP #006F
- 0x7002000D, // 005D JMP #006C
- 0x88100715, // 005E GETMBR R4 R3 K21
- 0x20100906, // 005F NE R4 R4 K6
- 0x78120004, // 0060 JMPF R4 #0066
- 0x88100104, // 0061 GETMBR R4 R0 K4
- 0x88140715, // 0062 GETMBR R5 R3 K21
- 0x00100805, // 0063 ADD R4 R4 R5
- 0x90020804, // 0064 SETMBR R0 K4 R4
- 0x70020001, // 0065 JMP #0068
- 0x88100716, // 0066 GETMBR R4 R3 K22
- 0x90020804, // 0067 SETMBR R0 K4 R4
- 0x8810070E, // 0068 GETMBR R4 R3 K14
- 0x04100404, // 0069 SUB R4 R2 R4
- 0x04100204, // 006A SUB R4 R1 R4
- 0x90020604, // 006B SETMBR R0 K3 R4
- 0x70020000, // 006C JMP #006E
- 0xB0060F17, // 006D RAISE 1 K7 K23
- 0x7001FF9A, // 006E JMP #000A
- 0x8808010F, // 006F GETMBR R2 R0 K15
- 0x80040400, // 0070 RET 1 R2
+ ( &(const binstruction[ 9]) { /* code */
+ 0x14080300, // 0000 LT R2 R1 K0
+ 0x780A0000, // 0001 JMPF R2 #0003
+ 0x58040000, // 0002 LDCONST R1 K0
+ 0x540A0063, // 0003 LDINT R2 100
+ 0x24080202, // 0004 GT R2 R1 R2
+ 0x780A0000, // 0005 JMPF R2 #0007
+ 0x54060063, // 0006 LDINT R1 100
+ 0x90020201, // 0007 SETMBR R0 K1 R1
+ 0x80000000, // 0008 RET 0
})
)
);
@@ -1237,104 +1436,12 @@ be_local_closure(Animate_engine_animate, /* name */
/********************************************************************
-** Solidified function: init
+** Solidified function: set_phase
********************************************************************/
-be_local_closure(Animate_engine_init, /* name */
- be_nested_proto(
- 2, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 5]) { /* constants */
- /* K0 */ be_nested_str_weak(code),
- /* K1 */ be_nested_str_weak(pc),
- /* K2 */ be_const_int(0),
- /* K3 */ be_nested_str_weak(ins_time),
- /* K4 */ be_nested_str_weak(running),
- }),
- be_str_weak(init),
- &be_const_str_solidified,
- ( &(const binstruction[ 8]) { /* code */
- 0x60040012, // 0000 GETGBL R1 G18
- 0x7C040000, // 0001 CALL R1 0
- 0x90020001, // 0002 SETMBR R0 K0 R1
- 0x90020302, // 0003 SETMBR R0 K1 K2
- 0x90020702, // 0004 SETMBR R0 K3 K2
- 0x50040000, // 0005 LDBOOL R1 0 0
- 0x90020801, // 0006 SETMBR R0 K4 R1
- 0x80000000, // 0007 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: stop
-********************************************************************/
-be_local_closure(Animate_engine_stop, /* name */
- be_nested_proto(
- 2, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(running),
- }),
- be_str_weak(stop),
- &be_const_str_solidified,
- ( &(const binstruction[ 3]) { /* code */
- 0x50040000, // 0000 LDBOOL R1 0 0
- 0x90020001, // 0001 SETMBR R0 K0 R1
- 0x80000000, // 0002 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: is_running
-********************************************************************/
-be_local_closure(Animate_engine_is_running, /* name */
- be_nested_proto(
- 2, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(running),
- }),
- be_str_weak(is_running),
- &be_const_str_solidified,
- ( &(const binstruction[ 2]) { /* code */
- 0x88040100, // 0000 GETMBR R1 R0 K0
- 0x80040200, // 0001 RET 1 R1
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: set_cb
-********************************************************************/
-be_local_closure(Animate_engine_set_cb, /* name */
+be_local_closure(Animate_oscillator_set_phase, /* name */
be_nested_proto(
3, /* nstack */
- 3, /* argc */
+ 2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
@@ -1342,15 +1449,21 @@ be_local_closure(Animate_engine_set_cb, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(animate_obj),
- /* K1 */ be_nested_str_weak(animate_mth),
+ /* K0 */ be_const_int(0),
+ /* K1 */ be_nested_str_weak(phase),
}),
- be_str_weak(set_cb),
+ be_str_weak(set_phase),
&be_const_str_solidified,
- ( &(const binstruction[ 3]) { /* code */
- 0x90020001, // 0000 SETMBR R0 K0 R1
- 0x90020202, // 0001 SETMBR R0 K1 R2
- 0x80000000, // 0002 RET 0
+ ( &(const binstruction[ 9]) { /* code */
+ 0x14080300, // 0000 LT R2 R1 K0
+ 0x780A0000, // 0001 JMPF R2 #0003
+ 0x58040000, // 0002 LDCONST R1 K0
+ 0x540A0063, // 0003 LDINT R2 100
+ 0x24080202, // 0004 GT R2 R1 R2
+ 0x780A0000, // 0005 JMPF R2 #0007
+ 0x54060063, // 0006 LDINT R1 100
+ 0x90020201, // 0007 SETMBR R0 K1 R1
+ 0x80000000, // 0008 RET 0
})
)
);
@@ -1358,242 +1471,35 @@ be_local_closure(Animate_engine_set_cb, /* name */
/********************************************************************
-** Solidified function: start
+** Solidified class: Animate_oscillator
********************************************************************/
-be_local_closure(Animate_engine_start, /* name */
- be_nested_proto(
- 5, /* nstack */
- 3, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 5]) { /* constants */
- /* K0 */ be_nested_str_weak(tasmota),
- /* K1 */ be_nested_str_weak(millis),
- /* K2 */ be_nested_str_weak(value),
- /* K3 */ be_nested_str_weak(ins_time),
- /* K4 */ be_nested_str_weak(running),
- }),
- be_str_weak(start),
- &be_const_str_solidified,
- ( &(const binstruction[15]) { /* code */
- 0x4C0C0000, // 0000 LDNIL R3
- 0x1C0C0203, // 0001 EQ R3 R1 R3
- 0x780E0003, // 0002 JMPF R3 #0007
- 0xB80E0000, // 0003 GETNGBL R3 K0
- 0x8C0C0701, // 0004 GETMET R3 R3 K1
- 0x7C0C0200, // 0005 CALL R3 1
- 0x5C040600, // 0006 MOVE R1 R3
- 0x4C0C0000, // 0007 LDNIL R3
- 0x200C0403, // 0008 NE R3 R2 R3
- 0x780E0000, // 0009 JMPF R3 #000B
- 0x90020402, // 000A SETMBR R0 K2 R2
- 0x90020601, // 000B SETMBR R0 K3 R1
- 0x500C0200, // 000C LDBOOL R3 1 0
- 0x90020803, // 000D SETMBR R0 K4 R3
- 0x80000000, // 000E RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified class: Animate_engine
-********************************************************************/
-be_local_class(Animate_engine,
- 8,
- NULL,
- be_nested_map(14,
+extern const bclass be_class_Animate_animator;
+be_local_class(Animate_oscillator,
+ 6,
+ &be_class_Animate_animator,
+ be_nested_map(12,
( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(animate, -1), be_const_closure(Animate_engine_animate_closure) },
- { be_const_key_weak(ins_time, -1), be_const_var(5) },
- { be_const_key_weak(running, 10), be_const_var(6) },
- { be_const_key_weak(stop, 7), be_const_closure(Animate_engine_stop_closure) },
- { be_const_key_weak(closure, -1), be_const_var(1) },
- { be_const_key_weak(init, 1), be_const_closure(Animate_engine_init_closure) },
- { be_const_key_weak(animate_mth, -1), be_const_var(3) },
- { be_const_key_weak(set_cb, -1), be_const_closure(Animate_engine_set_cb_closure) },
- { be_const_key_weak(code, -1), be_const_var(0) },
- { be_const_key_weak(is_running, -1), be_const_closure(Animate_engine_is_running_closure) },
- { be_const_key_weak(animate_obj, 11), be_const_var(2) },
- { be_const_key_weak(pc, -1), be_const_var(4) },
- { be_const_key_weak(value, 6), be_const_var(7) },
- { be_const_key_weak(start, -1), be_const_closure(Animate_engine_start_closure) },
+ { be_const_key_weak(phase, -1), be_const_var(0) },
+ { be_const_key_weak(b, -1), be_const_var(3) },
+ { be_const_key_weak(set_b, -1), be_const_closure(Animate_oscillator_set_b_closure) },
+ { be_const_key_weak(set_a, 10), be_const_closure(Animate_oscillator_set_a_closure) },
+ { be_const_key_weak(a, -1), be_const_var(2) },
+ { be_const_key_weak(set_phase, -1), be_const_closure(Animate_oscillator_set_phase_closure) },
+ { be_const_key_weak(value, -1), be_const_var(5) },
+ { be_const_key_weak(duty_cycle, -1), be_const_var(1) },
+ { be_const_key_weak(animate, 7), be_const_closure(Animate_oscillator_animate_closure) },
+ { be_const_key_weak(set_duty_cycle, -1), be_const_closure(Animate_oscillator_set_duty_cycle_closure) },
+ { be_const_key_weak(init, -1), be_const_closure(Animate_oscillator_init_closure) },
+ { be_const_key_weak(form, 5), be_const_var(4) },
})),
- be_str_weak(Animate_engine)
-);
-
-extern const bclass be_class_Animate_back_forth;
-
-/********************************************************************
-** Solidified function: init
-********************************************************************/
-be_local_closure(Animate_back_forth_init, /* name */
- be_nested_proto(
- 13, /* nstack */
- 6, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 8]) { /* constants */
- /* K0 */ be_nested_str_weak(init),
- /* K1 */ be_nested_str_weak(set_cb),
- /* K2 */ be_nested_str_weak(code),
- /* K3 */ be_nested_str_weak(push),
- /* K4 */ be_nested_str_weak(animate),
- /* K5 */ be_nested_str_weak(ins_ramp),
- /* K6 */ be_nested_str_weak(ins_goto),
- /* K7 */ be_const_int(0),
- }),
- be_str_weak(init),
- &be_const_str_solidified,
- ( &(const binstruction[37]) { /* code */
- 0x60180003, // 0000 GETGBL R6 G3
- 0x5C1C0000, // 0001 MOVE R7 R0
- 0x7C180200, // 0002 CALL R6 1
- 0x8C180D00, // 0003 GETMET R6 R6 K0
- 0x7C180200, // 0004 CALL R6 1
- 0x8C180101, // 0005 GETMET R6 R0 K1
- 0x5C200200, // 0006 MOVE R8 R1
- 0x5C240400, // 0007 MOVE R9 R2
- 0x7C180600, // 0008 CALL R6 3
- 0x88180102, // 0009 GETMBR R6 R0 K2
- 0x8C180D03, // 000A GETMET R6 R6 K3
- 0xB8220800, // 000B GETNGBL R8 K4
- 0x8C201105, // 000C GETMET R8 R8 K5
- 0x5C280600, // 000D MOVE R10 R3
- 0x5C2C0800, // 000E MOVE R11 R4
- 0x5C300A00, // 000F MOVE R12 R5
- 0x7C200800, // 0010 CALL R8 4
- 0x7C180400, // 0011 CALL R6 2
- 0x88180102, // 0012 GETMBR R6 R0 K2
- 0x8C180D03, // 0013 GETMET R6 R6 K3
- 0xB8220800, // 0014 GETNGBL R8 K4
- 0x8C201105, // 0015 GETMET R8 R8 K5
- 0x5C280800, // 0016 MOVE R10 R4
- 0x5C2C0600, // 0017 MOVE R11 R3
- 0x5C300A00, // 0018 MOVE R12 R5
- 0x7C200800, // 0019 CALL R8 4
- 0x7C180400, // 001A CALL R6 2
- 0x88180102, // 001B GETMBR R6 R0 K2
- 0x8C180D03, // 001C GETMET R6 R6 K3
- 0xB8220800, // 001D GETNGBL R8 K4
- 0x8C201106, // 001E GETMET R8 R8 K6
- 0x58280007, // 001F LDCONST R10 K7
- 0x582C0007, // 0020 LDCONST R11 K7
- 0x58300007, // 0021 LDCONST R12 K7
- 0x7C200800, // 0022 CALL R8 4
- 0x7C180400, // 0023 CALL R6 2
- 0x80000000, // 0024 RET 0
- })
- )
+ be_str_weak(Animate_oscillator)
);
/*******************************************************************/
-
-/********************************************************************
-** Solidified class: Animate_back_forth
-********************************************************************/
-extern const bclass be_class_Animate_engine;
-be_local_class(Animate_back_forth,
- 0,
- &be_class_Animate_engine,
- be_nested_map(1,
- ( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(init, -1), be_const_closure(Animate_back_forth_init_closure) },
- })),
- be_str_weak(Animate_back_forth)
-);
-
-extern const bclass be_class_Animate_from_to;
-
-/********************************************************************
-** Solidified function: init
-********************************************************************/
-be_local_closure(Animate_from_to_init, /* name */
- be_nested_proto(
- 13, /* nstack */
- 6, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 6]) { /* constants */
- /* K0 */ be_nested_str_weak(init),
- /* K1 */ be_nested_str_weak(set_cb),
- /* K2 */ be_nested_str_weak(code),
- /* K3 */ be_nested_str_weak(push),
- /* K4 */ be_nested_str_weak(animate),
- /* K5 */ be_nested_str_weak(ins_ramp),
- }),
- be_str_weak(init),
- &be_const_str_solidified,
- ( &(const binstruction[19]) { /* code */
- 0x60180003, // 0000 GETGBL R6 G3
- 0x5C1C0000, // 0001 MOVE R7 R0
- 0x7C180200, // 0002 CALL R6 1
- 0x8C180D00, // 0003 GETMET R6 R6 K0
- 0x7C180200, // 0004 CALL R6 1
- 0x8C180101, // 0005 GETMET R6 R0 K1
- 0x5C200200, // 0006 MOVE R8 R1
- 0x5C240400, // 0007 MOVE R9 R2
- 0x7C180600, // 0008 CALL R6 3
- 0x88180102, // 0009 GETMBR R6 R0 K2
- 0x8C180D03, // 000A GETMET R6 R6 K3
- 0xB8220800, // 000B GETNGBL R8 K4
- 0x8C201105, // 000C GETMET R8 R8 K5
- 0x5C280600, // 000D MOVE R10 R3
- 0x5C2C0800, // 000E MOVE R11 R4
- 0x5C300A00, // 000F MOVE R12 R5
- 0x7C200800, // 0010 CALL R8 4
- 0x7C180400, // 0011 CALL R6 2
- 0x80000000, // 0012 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified class: Animate_from_to
-********************************************************************/
-extern const bclass be_class_Animate_engine;
-be_local_class(Animate_from_to,
- 0,
- &be_class_Animate_engine,
- be_nested_map(1,
- ( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(init, -1), be_const_closure(Animate_from_to_init_closure) },
- })),
- be_str_weak(Animate_from_to)
-);
-
-/********************************************************************
-** Solidified module: animate
-********************************************************************/
-be_local_module(animate,
- "animate",
- be_nested_map(7,
- ( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(ins_ramp, -1), be_const_class(be_class_Animate_ins_ramp) },
- { be_const_key_weak(from_to, -1), be_const_class(be_class_Animate_from_to) },
- { be_const_key_weak(palette, 3), be_const_class(be_class_Animate_palette) },
- { be_const_key_weak(engine, 5), be_const_class(be_class_Animate_engine) },
- { be_const_key_weak(back_forth, -1), be_const_class(be_class_Animate_back_forth) },
- { be_const_key_weak(rotate, -1), be_const_class(be_class_Animate_rotate) },
- { be_const_key_weak(ins_goto, -1), be_const_class(be_class_Animate_ins_goto) },
- }))
-);
-BE_EXPORT_VARIABLE be_define_const_native_module(animate);
-/********************************************************************/
+void be_load_Animate_oscillator_class(bvm *vm) {
+ be_pushntvclass(vm, &be_class_Animate_oscillator);
+ be_setglobal(vm, "Animate_oscillator");
+ be_pop(vm, 1);
+}
/********************************************************************/
/* End of solidification */
diff --git a/tasmota/berry/animate_demo/animate_demo_palette_background.be b/tasmota/berry/animate_demo/animate_demo_palette_background.be
new file mode 100644
index 000000000..03648b419
--- /dev/null
+++ b/tasmota/berry/animate_demo/animate_demo_palette_background.be
@@ -0,0 +1,11 @@
+#
+# Example for M5Stack Led Matrix
+# 5 x 5 WS2812
+#
+import animate
+
+var duration = 10000
+var strip = Leds(5 * 5, gpio.pin(gpio.WS2812, 0))
+var anim = animate(strip)
+anim.add_background_animator(animate.palette(animate.PALETTE_RAINBOW_WHITE, duration))
+anim.start()
diff --git a/tasmota/berry/animate_demo/animate_demo_pulse.be b/tasmota/berry/animate_demo/animate_demo_pulse.be
new file mode 100644
index 000000000..0a2b6dd40
--- /dev/null
+++ b/tasmota/berry/animate_demo/animate_demo_pulse.be
@@ -0,0 +1,23 @@
+#
+# Example for M5Stack Led Matrix
+# 5 x 5 WS2812
+#
+import animate
+
+var duration = 10000
+var strip = Leds(5 * 5, gpio.pin(gpio.WS2812, 0))
+var anim = animate(strip)
+anim.set_back_color(0x2222AA)
+var pulse = animate.pulse(0xFF4444, 2, 1)
+var osc1 = animate.oscillator(-3, 26, 5000, animate.COSINE)
+osc1.set_cb(pulse, pulse.set_pos)
+
+anim.add_animator(osc1)
+anim.add_painter(pulse)
+
+# animate color of pulse
+var palette = animate.palette(animate.PALETTE_RAINBOW_WHITE, 30000)
+palette.set_cb(pulse, pulse.set_color)
+anim.add_animator(palette)
+
+anim.start()
diff --git a/tasmota/berry/animate_demo/leds_animation.be b/tasmota/berry/animate_demo/leds_animation.be
new file mode 100644
index 000000000..96f4d47ea
--- /dev/null
+++ b/tasmota/berry/animate_demo/leds_animation.be
@@ -0,0 +1,173 @@
+#################################################################################
+# Web UI for Leds animation
+#
+#################################################################################
+
+var leds_animation = module('leds_animation')
+
+#################################################################################
+# Leds_animation_UI
+#
+# WebUI for the Leds animation
+#################################################################################
+class Leds_animation_UI
+
+ def init()
+ tasmota.add_driver(self)
+ end
+
+ # create a method for adding a button to the main menu
+ # the button 'Leds animation' redirects to '/leds_anim?'
+ def web_add_button()
+ import webserver
+ webserver.content_send(
+ "
")
+ end
+
+ #- ---------------------------------------------------------------------- -#
+ #- Show page to migrate to factory layout + single OTA
+ #- ---------------------------------------------------------------------- -#
+ def show_migrate_to_factory(p)
+ # display ota partitions
+ import webserver
+ import string
+
+ if !self.factory_migrate_eligible(p) return end
+
+ webserver.content_send("")
+ end
+
+ #######################################################################
+ # Show background colors
+ #######################################################################
+ def show_background_color()
+ import webserver
+ var back_color = 0xFF8800
+ var back_anim_time = 5.0
+
+
+ webserver.content_send("")
+ end
+
+ #######################################################################
+ # Show main config
+ #######################################################################
+ def show_main_config()
+ import webserver
+ var leds_anim_enabled = true
+ var leds_size = 25
+
+ webserver.content_send("")
+ end
+
+ #######################################################################
+ # Display the complete page
+ #######################################################################
+ def page_view()
+ import webserver
+ if !webserver.check_privileged_access() return nil end
+
+ webserver.content_start("Leds animation") #- title of the web page -#
+ webserver.content_send_style() #- send standard Tasmota styles -#
+
+ self.show_main_config()
+ self.show_background_color()
+ webserver.content_button(webserver.BUTTON_MANAGEMENT) #- button back to management page -#
+
+ webserver.content_stop() #- end of web page -#
+ end
+
+ #- ---------------------------------------------------------------------- -#
+ # respond to web_add_handler() event to register web listeners
+ #- ---------------------------------------------------------------------- -#
+ #- this is called at Tasmota start-up, as soon as Wifi/Eth is up and web server running -#
+ def web_add_handler()
+ import webserver
+ #- we need to register a closure, not just a function, that captures the current instance -#
+ webserver.on("/leds_anim", / -> self.page_view(), webserver.HTTP_GET)
+ webserver.on("/leds_anim", / -> self.page_ctl(), webserver.HTTP_POST)
+ end
+end
+leds_animation.Leds_animation_UI = Leds_animation_UI
+
+
+#- create and register driver in Tasmota -#
+if tasmota
+ var ui = leds_animation.Leds_animation_UI()
+ ## can be removed if put in 'autoexec.bat'
+ ui.web_add_handler()
+end
+
+return leds_animation
+
+#- Example
+
+import leds_animation
+
+-#
diff --git a/tasmota/berry/animate_demo/leds_blend_demo.be b/tasmota/berry/animate_demo/leds_blend_demo.be
new file mode 100644
index 000000000..88596e276
--- /dev/null
+++ b/tasmota/berry/animate_demo/leds_blend_demo.be
@@ -0,0 +1,37 @@
+# test blending
+
+import animate
+
+var LEDS_LENGTH = 25
+var strip
+var front, back
+var bri
+
+strip = Leds(LEDS_LENGTH, gpio.pin(gpio.WS2812,0))
+bri = 70
+
+back = bytes().resize(LEDS_LENGTH * 4)
+front = bytes().resize(LEDS_LENGTH * 4)
+strip.clear_to(0x442211)
+strip.show()
+
+var back = animate.frame(LEDS_LENGTH)
+var front = animate.frame(LEDS_LENGTH)
+back.fill_pixels(0xFF2200, 80)
+for i:0..24
+ front.set_pixel(i, 0, 255, 0, (i*255)/24)
+end
+back.blend_pixels(back, front)
+
+print("front=", front.tohex())
+print("back =", back.tohex())
+var pixels_buffer = strip.pixels_buffer()
+print("pixs =", pixels_buffer.tohex())
+back.paste_pixels(pixels_buffer, bri, true)
+strip.dirty()
+strip.show()
+
+## Output:
+# front= 00FF000000FF000A00FF001500FF001F00FF002A00FF003500FF003F00FF004A00FF005500FF005F00FF006A00FF007400FF007F00FF008A00FF009400FF009F00FF00AA00FF00B400FF00BF00FF00C900FF00D400FF00DF00FF00E900FF00F400FF00FF
+# back = 0022FF000022FF000022FF000022FF000022FF000022FF000022FF000022FF000022FF000022FF000022FF000022FF000022FF000022FF000022FF000022FF000022FF000022FF000022FF000022FF000022FF000022FF000022FF000022FF000022FF00
+# pixs = 020701020701020701020701020701020701020701020701020701020701020701020701020701020701020701020701020701020701020701020701020701020701020701020701020701
diff --git a/tasmota/berry/emulator/Leds_frame.be b/tasmota/berry/emulator/Leds_frame.be
new file mode 100644
index 000000000..eb3f520ee
--- /dev/null
+++ b/tasmota/berry/emulator/Leds_frame.be
@@ -0,0 +1,42 @@
+# Leds_frame
+
+class Leds_frame
+ var pixel_size
+
+ def init()
+ end
+
+ def blend(color_a, color_b, alpha)
+ var r = (color_a >> 16) & 0xFF
+ var g = (color_a >> 8) & 0xFF
+ var b = (color_a ) & 0xFF
+ var r2 = (color_b >> 16) & 0xFF
+ var g2 = (color_b >> 8) & 0xFF
+ var b2 = (color_b ) & 0xFF
+ var r3 = tasmota.scale_uint(alpha, 0, 255, r2, r)
+ var g3 = tasmota.scale_uint(alpha, 0, 255, g2, g)
+ var b3 = tasmota.scale_uint(alpha, 0, 255, b2, b)
+ var rgb = (r3 << 16) | (g3 << 8) | b3
+ return rgb
+ end
+
+end
+
+return Leds_frame
+
+# /* @const_object_info_begin
+# class be_class_Leds_frame (scope: global, name: Leds_frame, super:be_class_bytes, strings: weak) {
+# pixel_size, var
+
+# init, closure(Leds_frame_be_init_closure)
+
+# item, closure(Leds_frame_be_item_closure)
+# setitem, closure(Leds_frame_be_setitem_closure)
+# set_pixel, closure(Leds_frame_be_set_pixel_closure)
+
+# // the following are on buffers
+# blend, static_func(be_leds_blend)
+# fill_pixels, func(be_leds_fill_pixels)
+# blend_pixels, func(be_leds_blend_pixels)
+# paste_pixels, func(be_leds_paste_pixels)
+# }
\ No newline at end of file
diff --git a/tasmota/berry/leds/leds_animate_demo_palette_background.be b/tasmota/berry/leds/leds_animate_demo_palette_background.be
deleted file mode 100644
index 1e1681000..000000000
--- a/tasmota/berry/leds/leds_animate_demo_palette_background.be
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Example for M5Stack Led Matrix
-# 5 x 5 WS2812
-#
-import animate
-class Background_demo : Leds_animator
- static var PALETTE_STANDARD_TAG = bytes(
- "40" "FF0000" # red
- "40" "FFA500" # orange
- "40" "FFFF00" # yellow
- "40" "00EE00" # green
- "40" "0000FF" # blue
- "40" "4B00FF" # indigo
- "40" "FF82FF" # violet
- "00" "FF0000" # red
- )
-
- static var PALETTE_RAINBOW_WHITE = bytes(
- "50" "FF0000" # red
- "30" "FF0000" # red
- "50" "FFA500" # orange
- "30" "FFA500" # orange
- "50" "FFFF00" # yellow
- "30" "FFFF00" # yellow
- "50" "00FF00" # green
- "30" "00FF00" # green
- "50" "0000FF" # blue
- "30" "0000FF" # blue
- "50" "FF00FF" # indigo
- "30" "FF00FF" # indigo
- "50" "FFFFFF" # white
- "30" "FFFFFF" # white
- "00" "FF0000" # red
- )
-
- # duration in seconds
- def init(strip, duration)
- import animate
- super(self).init(strip)
- # var pal = animate.palette(self.PALETTE_STANDARD_TAG, duration)
- var pal = animate.palette(self.PALETTE_RAINBOW_WHITE, duration)
- self.add_background_animator(pal)
- end
-
- def animate()
- end
-end
-
-var strip = Leds(5 * 5, gpio.pin(gpio.WS2812, 0))
-var r = Background_demo(strip, 20)
-r.start()
diff --git a/tasmota/berry/leds/rainbow.be b/tasmota/berry/leds/rainbow.be
deleted file mode 100644
index d29720c93..000000000
--- a/tasmota/berry/leds/rainbow.be
+++ /dev/null
@@ -1,185 +0,0 @@
-# simple Rainbow animator
-
-#-
-# Ex: if WS2812 configured to WS2812 - channel 2
-
-var strip = neopixelbus(25, gpio.pin(gpio.WS2812, 1))
-rainbow = Rainbow(strip)
-rainbow.start()
-
--#
-
-import animate
-
-class Rainbow : Leds_animator
- var cur_offset # current offset in the palette
- static palette = [ 0xFF0000, #- red -#
- 0xFFA500, #- orange -#
- 0xFFFF00, #- yellow -#
- 0x008800, #- green -#
- 0x0000FF, #- blue -#
- 0x4B0082, #- indigo -#
- 0xEE82EE, #- violet -#
- ]
-
- def init(strip, duration)
- import animate
- super(self).init(strip)
- self.cur_offset = 0
- # add an animator to change `self.cur_offset` to each value of the palette
- self.add_anim(animate.rotate(def(v) self.cur_offset = v end, 0, size(self.palette), int(duration * 1000)))
- end
-
- def animate()
- # move instance variables to registers to avoid GETMBR inside the loop
- var cur_offset = self.cur_offset
- var modulus = size(self.palette)
- var palette = self.palette
- var strip = self.strip
- var bri = self.bri
- var set_pixel_color = strip.set_pixel_color
-
- var i = 0
- while i < self.pixel_count # doing a loop rather than a `for` prevents from allocating a new object
- var col = palette[(cur_offset + i) % modulus]
- set_pixel_color(strip, i, col, bri) # simulate the method call without GETMET
- i += 1
- end
- strip.show()
- end
-
-end
-
-#-
-
-var strip = Leds.matrix(5,5, gpio.pin(gpio.WS2812, 1))
-var r = Rainbow(strip, 1.0)
-r.start()
-
--#
-
-class Rainbow_stripes : Leds_animator
- var cur_offset # current offset in the palette
- static palette = [ 0xFF0000, #- red -#
- 0xFFA500, #- orange -#
- 0xFFFF00, #- yellow -#
- 0x008800, #- green -#
- 0x0000FF, #- blue -#
- 0x4B0082, #- indigo -#
- 0xEE82EE, #- violet -#
- ]
-
- def init(strip, duration)
- import animate
- super(self).init(strip)
- self.cur_offset = 0
- # add an animator to change `self.cur_offset` to each value of the palette
- self.add_anim(animate.rotate(def(v) self.cur_offset = v end, 0, size(self.palette), int(duration * 1000)))
- end
-
- def animate()
- # move instance variables to registers to avoid GETMBR inside the loop
- var cur_offset = self.cur_offset
- var modulus = size(self.palette)
- var palette = self.palette
- var strip = self.strip
- var bri = self.bri
- var set_matrix_pixel_color = strip.set_matrix_pixel_color
- var h = self.strip.h
- var w = self.strip.w
-
- var y = 0
- while y < h
- var x = 0
- var col = palette[(cur_offset + y) % modulus]
- while x < w
- set_matrix_pixel_color(strip, x, y, col, bri) # simulate the method call without GETMET
- x += 1
- end
- y += 1
- end
- strip.show()
- end
-
-end
-
-#-
-
-var strip = Leds.matrix(5,5, gpio.pin(gpio.WS2812, 1))
-var r = Rainbow_stripes(strip, 0.5)
-r.start()
-
--#
-
-class Round : Leds_animator
- var cur_val
- var min_val, max_val
- var incr_val
- var h
-
- def init(strip, glow_duration, color_duration)
- import animate
- super(self).init(strip)
- self.cur_val = 5 << 8
- self.h = 0 # start with hue = 0 (red)
- # add animator for color over 30 colors
- self.add_anim(animate.rotate(def(h) self.h = h end, 0, 359, int(color_duration * 1000)))
- self.add_anim(animate.back_forth(def(v) self.cur_val = v end, 2 << 8, 6 << 8, int(glow_duration * 1000)))
- end
-
- def animate()
- # move instance variables to registers to avoid GETMBR inside the loop
- var strip = self.strip
- var bri = self.bri
- var set_matrix_pixel_color = strip.set_matrix_pixel_color
- var h = self.strip.h
- var w = self.strip.w
- var ch = h / 2
- var cw = w / 2
- var col_ref = tasmota.hs2rgb(self.h)
-
- var y = 0
- while y < h
- var x = 0
- while x < w
- var col = col_ref
- var dist = self.fast_sqrt_int( ((y - ch)*(y - ch) + (x - cw)*(x - cw)) << 16)
- var rel_bri = tasmota.scale_uint(dist, 0, self.cur_val, bri, 0)
- set_matrix_pixel_color(strip, x, y, col, rel_bri) # simulate the method call without GETMET
- x += 1
- end
- y += 1
- end
- strip.show()
- end
-
- # https://stackoverflow.com/questions/34187171/fast-integer-square-root-approximation
- static def fast_sqrt_int(val)
- var a, b
-
- if val < 2 return val end
-
- a = 1255 # starting point is relatively unimportant
-
- b = val / a; a = (a+b) /2;
- b = val / a; a = (a+b) /2;
- b = val / a; a = (a+b) /2;
- b = val / a; a = (a+b) /2;
- b = val / a; a = (a+b) /2;
- b = val / a; a = (a+b) /2;
- if (val < 20000)
- b = val / a; a = (a+b) /2;
- b = val / a; a = (a+b) /2;
- end
-
- return a
- end
-end
-
-#-
-
-var strip = Leds.matrix(5,5, gpio.pin(gpio.WS2812, 1))
-var r = Round(strip, 2, 30)
-r.start()
-
--#
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota.ino
index 320023b34..c4df2e318 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota.ino
@@ -427,6 +427,61 @@ extern "C" {
be_raise(vm, kTypeError, nullptr);
}
+ /*
+ Implements the 5-order polynomial approximation to sin(x).
+ @param i angle (with 2^15 units/circle)
+ @return 16 bit fixed point Sine value (4.12) (ie: +4096 = +1 & -4096 = -1)
+
+ The result is accurate to within +- 1 count. ie: +/-2.44e-4.
+ */
+ int16_t fpsin(int16_t i)
+ {
+ /* Convert (signed) input to a value between 0 and 8192. (8192 is pi/2, which is the region of the curve fit). */
+ /* ------------------------------------------------------------------- */
+ i <<= 1;
+ uint8_t c = i<0; //set carry for output pos/neg
+
+ if(i == (i|0x4000)) // flip input value to corresponding value in range [0..8192)
+ i = (1<<15) - i;
+ i = (i & 0x7FFF) >> 1;
+ /* ------------------------------------------------------------------- */
+
+ /* The following section implements the formula:
+ = y * 2^-n * ( A1 - 2^(q-p)* y * 2^-n * y * 2^-n * [B1 - 2^-r * y * 2^-n * C1 * y]) * 2^(a-q)
+ Where the constants are defined as follows:
+ */
+ // enum {A1=3370945099UL, B1=2746362156UL, C1=292421UL};
+ // enum {n=13, p=32, q=31, r=3, a=12};
+
+ uint32_t y = (292421UL*((uint32_t)i))>>13;
+ y = 2746362156UL - (((uint32_t)i*y)>>3);
+ y = (uint32_t)i * (y>>13);
+ y = (uint32_t)i * (y>>13);
+ y = 3370945099UL - (y>>(32-31));
+ y = (uint32_t)i * (y>>13);
+ y = (y+(1UL<<(31-12-1)))>>(31-12); // Rounding
+
+ return c ? -y : y;
+ }
+
+ // Berry: tasmota.sine_int(int) -> int
+ //
+ // Input: 8192 is pi/2
+ // Output: -4096 is -1, 4096 is +1
+ //
+ // https://www.nullhardware.com/blog/fixed-point-sine-and-cosine-for-embedded-systems/
+ int32_t l_sineint(struct bvm *vm);
+ int32_t l_sineint(struct bvm *vm) {
+ int32_t top = be_top(vm); // Get the number of arguments
+ if (top == 1 && be_isint(vm, 1)) {
+ int32_t val = be_toint(vm, 1);
+
+ be_pushint(vm, fpsin(val));
+ be_return(vm);
+ }
+ be_raise(vm, kTypeError, nullptr);
+ }
+
int32_t l_respCmnd(bvm *vm);
int32_t l_respCmnd(bvm *vm) {
int32_t top = be_top(vm); // Get the number of arguments
From d6bf19190f3ddad1a338e92f97f0ab2922a973bd Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Thu, 14 Dec 2023 23:09:40 +0100
Subject: [PATCH 007/303] Small fixes to animate module (#20238)
---
.../berry_tasmota/src/be_animate_module.c | 3 +-
.../src/embedded/animate_0_core.be | 12 +-
.../src/solidify/solidified_animate_0_core.h | 148 +++++++++---------
.../animate_demo_palette_background.be | 2 +-
.../berry/animate_demo/animate_demo_pulse.be | 2 +-
5 files changed, 83 insertions(+), 84 deletions(-)
diff --git a/lib/libesp32/berry_tasmota/src/be_animate_module.c b/lib/libesp32/berry_tasmota/src/be_animate_module.c
index b21102e8f..688585f06 100644
--- a/lib/libesp32/berry_tasmota/src/be_animate_module.c
+++ b/lib/libesp32/berry_tasmota/src/be_animate_module.c
@@ -111,8 +111,7 @@ module animate (scope: global, strings: weak) {
PALETTE_STANDARD_VAL, comptr(PALETTE_STANDARD_VAL)
PALETTE_SATURATED_TAG, comptr(PALETTE_SATURATED_TAG)
- (), class(be_class_Animate_core)
- core, class(be_class_Animate_core) // alias
+ core, class(be_class_Animate_core)
animator, class(be_class_Animate_animator)
frame, class(be_class_Leds_frame)
pulse, class(be_class_Animate_pulse)
diff --git a/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be b/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be
index f7bdf2e52..5e91278fe 100644
--- a/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be
+++ b/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be
@@ -22,8 +22,8 @@ class Animate_core
static var FAST_LOOP_MIN = 20
var fast_loop_next # next time-stamp for fast_loop
# cb for animation
- var animate_object # object called at each tick
- var animate_method # method of object called at each tick
+ var obj # object called at each tick
+ var mth # method of object called at each tick
# frame ojects
var frame # Leds_frame frame object
var layer # Leds_frame for layer on top of frame
@@ -101,8 +101,8 @@ class Animate_core
end
def set_cb(obj, method)
- self.animate_object = obj
- self.animate_method = method
+ self.obj = obj
+ self.mth = method
end
def fast_loop()
@@ -136,8 +136,8 @@ class Animate_core
i += 1
end
# tirgger animate and display
- var obj = self.animate_object
- var mth = self.animate_method
+ var obj = self.obj
+ var mth = self.mth
if (obj && mth)
mth(obj)
end
diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h
index f507d4144..d124cc5b3 100644
--- a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h
+++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h
@@ -164,33 +164,6 @@ be_local_closure(Animate_core_animate, /* name */
/*******************************************************************/
-/********************************************************************
-** Solidified function: get_bri
-********************************************************************/
-be_local_closure(Animate_core_get_bri, /* name */
- be_nested_proto(
- 3, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(bri),
- }),
- be_str_weak(get_bri),
- &be_const_str_solidified,
- ( &(const binstruction[ 2]) { /* code */
- 0x88080100, // 0000 GETMBR R2 R0 K0
- 0x80040400, // 0001 RET 1 R2
- })
- )
-);
-/*******************************************************************/
-
-
/********************************************************************
** Solidified function: set_bri
********************************************************************/
@@ -218,33 +191,6 @@ be_local_closure(Animate_core_set_bri, /* name */
/*******************************************************************/
-/********************************************************************
-** Solidified function: set_back_color
-********************************************************************/
-be_local_closure(Animate_core_set_back_color, /* name */
- be_nested_proto(
- 2, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(back_color),
- }),
- be_str_weak(set_back_color),
- &be_const_str_solidified,
- ( &(const binstruction[ 2]) { /* code */
- 0x90020001, // 0000 SETMBR R0 K0 R1
- 0x80000000, // 0001 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
/********************************************************************
** Solidified function: stop
********************************************************************/
@@ -296,6 +242,33 @@ be_local_closure(Animate_core_stop, /* name */
/*******************************************************************/
+/********************************************************************
+** Solidified function: set_back_color
+********************************************************************/
+be_local_closure(Animate_core_set_back_color, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(back_color),
+ }),
+ be_str_weak(set_back_color),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
/********************************************************************
** Solidified function: set_cb
********************************************************************/
@@ -310,8 +283,8 @@ be_local_closure(Animate_core_set_cb, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(animate_object),
- /* K1 */ be_nested_str_weak(animate_method),
+ /* K0 */ be_nested_str_weak(obj),
+ /* K1 */ be_nested_str_weak(mth),
}),
be_str_weak(set_cb),
&be_const_str_solidified,
@@ -450,6 +423,33 @@ be_local_closure(Animate_core_add_painter, /* name */
/*******************************************************************/
+/********************************************************************
+** Solidified function: get_bri
+********************************************************************/
+be_local_closure(Animate_core_get_bri, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(bri),
+ }),
+ be_str_weak(get_bri),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x80040400, // 0001 RET 1 R2
+ })
+ )
+);
+/*******************************************************************/
+
+
/********************************************************************
** Solidified function: fast_loop
********************************************************************/
@@ -484,8 +484,8 @@ be_local_closure(Animate_core_fast_loop, /* name */
/* K17 */ be_const_int(-16777216),
/* K18 */ be_nested_str_weak(paint),
/* K19 */ be_nested_str_weak(blend_pixels),
- /* K20 */ be_nested_str_weak(animate_object),
- /* K21 */ be_nested_str_weak(animate_method),
+ /* K20 */ be_nested_str_weak(obj),
+ /* K21 */ be_nested_str_weak(mth),
/* K22 */ be_nested_str_weak(paste_pixels),
/* K23 */ be_nested_str_weak(pixels_buffer),
/* K24 */ be_nested_str_weak(bri),
@@ -644,31 +644,31 @@ be_local_class(Animate_core,
NULL,
be_nested_map(28,
( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(bri, 23), be_const_var(2) },
+ { be_const_key_weak(bri, 8), be_const_var(2) },
{ be_const_key_weak(remove, -1), be_const_closure(Animate_core_remove_closure) },
- { be_const_key_weak(start, 21), be_const_closure(Animate_core_start_closure) },
+ { be_const_key_weak(start, 11), be_const_closure(Animate_core_start_closure) },
{ be_const_key_weak(fast_loop, -1), be_const_closure(Animate_core_fast_loop_closure) },
{ be_const_key_weak(add_animator, -1), be_const_closure(Animate_core_add_animator_closure) },
- { be_const_key_weak(FAST_LOOP_MIN, 8), be_const_int(20) },
- { be_const_key_weak(animate, -1), be_const_closure(Animate_core_animate_closure) },
+ { be_const_key_weak(FAST_LOOP_MIN, 9), be_const_int(20) },
+ { be_const_key_weak(obj, -1), be_const_var(8) },
{ be_const_key_weak(pixel_count, -1), be_const_var(1) },
+ { be_const_key_weak(animate, -1), be_const_closure(Animate_core_animate_closure) },
{ be_const_key_weak(animators, -1), be_const_var(4) },
- { be_const_key_weak(back_color, 11), be_const_var(12) },
- { be_const_key_weak(fast_loop_cb, 12), be_const_var(6) },
+ { be_const_key_weak(fast_loop_cb, -1), be_const_var(6) },
+ { be_const_key_weak(get_bri, 24), be_const_closure(Animate_core_get_bri_closure) },
+ { be_const_key_weak(back_color, 13), be_const_var(12) },
{ be_const_key_weak(frame, -1), be_const_var(10) },
- { be_const_key_weak(animate_object, -1), be_const_var(8) },
- { be_const_key_weak(stop, -1), be_const_closure(Animate_core_stop_closure) },
+ { be_const_key_weak(set_cb, 23), be_const_closure(Animate_core_set_cb_closure) },
{ be_const_key_weak(init, -1), be_const_closure(Animate_core_init_closure) },
- { be_const_key_weak(set_cb, 13), be_const_closure(Animate_core_set_cb_closure) },
- { be_const_key_weak(running, -1), be_const_var(3) },
- { be_const_key_weak(strip, 15), be_const_var(0) },
+ { be_const_key_weak(running, 21), be_const_var(3) },
+ { be_const_key_weak(strip, 14), be_const_var(0) },
{ be_const_key_weak(fast_loop_next, -1), be_const_var(7) },
- { be_const_key_weak(set_back_color, 14), be_const_closure(Animate_core_set_back_color_closure) },
+ { be_const_key_weak(set_back_color, 15), be_const_closure(Animate_core_set_back_color_closure) },
{ be_const_key_weak(add_painter, -1), be_const_closure(Animate_core_add_painter_closure) },
- { be_const_key_weak(set_bri, 24), be_const_closure(Animate_core_set_bri_closure) },
- { be_const_key_weak(layer, 9), be_const_var(11) },
- { be_const_key_weak(animate_method, 6), be_const_var(9) },
- { be_const_key_weak(get_bri, -1), be_const_closure(Animate_core_get_bri_closure) },
+ { be_const_key_weak(mth, -1), be_const_var(9) },
+ { be_const_key_weak(layer, 12), be_const_var(11) },
+ { be_const_key_weak(stop, -1), be_const_closure(Animate_core_stop_closure) },
+ { be_const_key_weak(set_bri, -1), be_const_closure(Animate_core_set_bri_closure) },
{ be_const_key_weak(painters, -1), be_const_var(5) },
{ be_const_key_weak(clear, 3), be_const_closure(Animate_core_clear_closure) },
{ be_const_key_weak(add_background_animator, 2), be_const_closure(Animate_core_add_background_animator_closure) },
diff --git a/tasmota/berry/animate_demo/animate_demo_palette_background.be b/tasmota/berry/animate_demo/animate_demo_palette_background.be
index 03648b419..6c314e42f 100644
--- a/tasmota/berry/animate_demo/animate_demo_palette_background.be
+++ b/tasmota/berry/animate_demo/animate_demo_palette_background.be
@@ -6,6 +6,6 @@ import animate
var duration = 10000
var strip = Leds(5 * 5, gpio.pin(gpio.WS2812, 0))
-var anim = animate(strip)
+var anim = animate.core(strip)
anim.add_background_animator(animate.palette(animate.PALETTE_RAINBOW_WHITE, duration))
anim.start()
diff --git a/tasmota/berry/animate_demo/animate_demo_pulse.be b/tasmota/berry/animate_demo/animate_demo_pulse.be
index 0a2b6dd40..09b075683 100644
--- a/tasmota/berry/animate_demo/animate_demo_pulse.be
+++ b/tasmota/berry/animate_demo/animate_demo_pulse.be
@@ -6,7 +6,7 @@ import animate
var duration = 10000
var strip = Leds(5 * 5, gpio.pin(gpio.WS2812, 0))
-var anim = animate(strip)
+var anim = animate.core(strip)
anim.set_back_color(0x2222AA)
var pulse = animate.pulse(0xFF4444, 2, 1)
var osc1 = animate.oscillator(-3, 26, 5000, animate.COSINE)
From d10b30ef5565b162b0fe2dee020a9723e59eac0d Mon Sep 17 00:00:00 2001
From: Norbert Richter
Date: Sat, 16 Dec 2023 14:40:18 +0100
Subject: [PATCH 008/303] Update NeoPool register desc (#20245)
---
.../tasmota_xsns_sensor/xsns_83_neopool.ino | 326 ++++++++----------
1 file changed, 152 insertions(+), 174 deletions(-)
diff --git a/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino b/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino
index ac4901c4f..18b30b914 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino
@@ -1,7 +1,7 @@
/*
xsns_83_neopool.ino - Sugar Valley NeoPool Control System Modbus support for Tasmota
- Copyright (C) 2022 Norbert Richter
+ Copyright (C) 2023 Norbert Richter
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,10 +31,7 @@
* Bayrol
* Hay
*
- * Sugar Valley RS485 connector inside (DISPLAY/WIFI/EXTERN)
- * pins (from top to bottom):
- *
- * RS485 MODBUS
+ * Sugar Valley RS485 connector inside (DISPLAY/WIFI/EXTERN) pins (from top to bottom):
* ___
* 1 |* |- +12V (internal power supply)
* 2 |* |- (not connected)
@@ -42,10 +39,13 @@
* 4 |* |- Modbus B-
* 5 |*__|- Modbus GND
*
- * RS485 Parameter: 19200 Baud / 1 Stopbit / Parity None
+ * Parameter: 19200 Baud / 1 Stopbit / Parity None
+ * Protocol: Modbus RTU
+ * NeoPool controller is Modbus server (formerly known as slave)
+ * Tasmota is Modbus client (formerly known as master)
*
- * Channel connector DISPLAY is useless as long as the internal display is also connect,
- * use WIFI or EXTERN instead.
+ * Connector DISPLAY is useless as long as the internal display is also connected to the
+ * second DISPLAY connector. Use WIFI or EXTERN.
*
* Hardware serial will be selected if GPIO1 = [NeoPool Rx] and GPIO3 = [NeoPool Tx]
\*********************************************************************************************/
@@ -81,62 +81,62 @@
* (see https://downloads.vodnici.net/uploads/wpforo/attachments/69/171-Modbus-registers.pdf)
\*********************************************************************************************/
enum NeoPoolRegister {
- // addr Unit Description
+ // addr Unit Description - "!" indicates register is not officially documented
// ------ ------ ------------------------------------------------------------
- // MODBUS page (0x00xx) - undocumented - for internal use
- MBF_POWER_MODULE_VERSION = 0x0002, // 0x0002 undocumented - power module version (MSB=Major, LSB=Minor)
- MBF_POWER_MODULE_NODEID = 0x0004, // 0x0004 undocumented - power module Node ID (6 register 0x0004 - 0x0009)
- MBF_POWER_MODULE_REGISTER = 0x000C, // 0x000C undocumented - Writing an address in this register causes the power module register address to be read out into MBF_POWER_MODULE_DATA, see MBF_POWER_MODULE_REG_*
- MBF_POWER_MODULE_DATA = 0x000D, // 0x000D undocumented - power module data as requested in MBF_POWER_MODULE_REGISTER
- MBF_VOLT_24_36 = 0x0022, // 0x0022* undocumented - Current 24-36V line in mV
- MBF_VOLT_12 = 0x0023, // 0x0023* undocumented - Current 12V line in mV
- MBF_VOLT_5 = 0x006A, // 0x006A* undocumented - 5V line in mV / 0,62069
- MBF_AMP_4_20_MICRO = 0x0072, // 0x0072* undocumented - 2-40mA line in µA * 10 (1=0,01mA)
+ // MODBUS page (0x00xx) - Manages general configuration of the box. This page is reserved for internal purposes
+ MBF_POWER_MODULE_VERSION = 0x0002, // 0x0002 ! Power module version (MSB=Major, LSB=Minor)
+ MBF_POWER_MODULE_NODEID = 0x0004, // 0x0004 ! Power module Node ID (6 register 0x0004 - 0x0009)
+ MBF_POWER_MODULE_REGISTER = 0x000C, // 0x000C ! Writing an address in this register causes the power module register address to be read out into MBF_POWER_MODULE_DATA, see MBF_POWER_MODULE_REG_*
+ MBF_POWER_MODULE_DATA = 0x000D, // 0x000D ! power module data as requested in MBF_POWER_MODULE_REGISTER
+ MBF_VOLT_24_36 = 0x0022, // 0x0022* ! Current 24-36V line in mV
+ MBF_VOLT_12 = 0x0023, // 0x0023* ! Current 12V line in mV
+ MBF_VOLT_5 = 0x006A, // 0x006A* ! 5V line in mV / 0,62069
+ MBF_AMP_4_20_MICRO = 0x0072, // 0x0072* ! 2-40mA line in µA * 10 (1=0,01mA)
- // MEASURE page (0x01xx)
- MBF_ION_CURRENT = 0x0100, // 0x0100* Current measured in the ionization system
- MBF_HIDRO_CURRENT, // 0x0101* Intensity level currently measured in the hydrolysissystem
- MBF_MEASURE_PH, // 0x0102* ph Level measured in hundredths (700 = 7.00)
- MBF_MEASURE_RX, // 0x0103* mV Redox level in mV
- MBF_MEASURE_CL, // 0x0104* ppm Level measured in hundredths of chlorine ppm (100 = 1.00 ppm)
- MBF_MEASURE_CONDUCTIVITY, // 0x0105* % Level of conductivity measured in the water.
- MBF_MEASURE_TEMPERATURE, // 0x0106* °C Water temperature sensor (100 = 10.0°C)
- MBF_PH_STATUS, // 0x0107* mask Status of the module control pH
+ // MEASURE page (0x01xx) - Contains the different measurement information including hydrolysis current, pH level, redox level, etc.
+ MBF_ION_CURRENT = 0x0100, // 0x0100* Ionization level measured
+ MBF_HIDRO_CURRENT, // 0x0101* Hydrolysis intensity level
+ MBF_MEASURE_PH, // 0x0102* ph pH level measured in 1/100 (700 = 7.00)
+ MBF_MEASURE_RX, // 0x0103* mV Redox level measured in mV
+ MBF_MEASURE_CL, // 0x0104* ppm Chlorine level measured in 1/100 ppm (100 = 1.00 ppm)
+ MBF_MEASURE_CONDUCTIVITY, // 0x0105* % Conductivity level measured in %
+ MBF_MEASURE_TEMPERATURE, // 0x0106* °C Temperature sensor measured in 1/10° C (100 = 10.0°C)
+ MBF_PH_STATUS, // 0x0107* mask Status of the pH-module
MBF_RX_STATUS, // 0x0108* mask Status of the Rx-module
MBF_CL_STATUS, // 0x0109* mask Status of the Chlorine-module
MBF_CD_STATUS, // 0x010A* mask Status of the Conductivity-module
MBF_ION_STATUS = 0x010C, // 0x010C* mask Status of the Ionization-module
MBF_HIDRO_STATUS, // 0x010D* mask Status of the Hydrolysis-module
- MBF_RELAY_STATE, // 0x010E* mask Status of each configurable relays
+ MBF_RELAY_STATE, // 0x010E* mask Status of each configurable relay
MBF_HIDRO_SWITCH_VALUE, // 0x010F* INTERNAL - contains the opening of the hydrolysis PWM.
- MBF_NOTIFICATION, // 0x0110* mask Reports whether a page of properties has changed since the last time it was consulted.
- MBF_HIDRO_VOLTAGE, // 0x0111 Reports on the stress applied to the hydrolysis cell. This register, together with that of MBF_HIDRO_CURRENT allows extrapolating the salinity of the water.
+ MBF_NOTIFICATION, // 0x0110* mask Bit field that informs whether a property page has changed since the last time it was queried. (see MBMSK_NOTIF_*). This register makes it possible to refresh the content of the registers maintained by a modbus master in an optimized way, without the need to reread all registers periodically, but only those on a page that has been changed.
+ MBF_HIDRO_VOLTAGE, // 0x0111 The voltage applied to the hydrolysis cell. This register, together with that of MBF_HIDRO_CURRENT allows extrapolation of water salinity.
- // GLOBAL page (0x02xx)
- MBF_CELL_RUNTIME_LOW = 0x0206, // 0x0206* undocumented - cell runtime (32 bit) - low word
- MBF_CELL_RUNTIME_HIGH, // 0x0207* undocumented - cell runtime (32 bit) - high word
- MBF_CELL_RUNTIME_PART_LOW, // 0x0208* undocumented - cell part runtime (32 bit) - low word
- MBF_CELL_RUNTIME_PART_HIGH, // 0x0209* undocumented - cell part runtime (32 bit) - high word
- MBF_CELL_BOOST = 0x020C, // 0x020C* mask undocumented - 0x0000 = Boost Off, 0x05A0 = Boost with redox ctrl, 0x85A0 = Boost without redox ctrl
- MBF_CELL_RUNTIME_POLA_LOW = 0x0214, // 0x0214* undocumented - cell runtime polarity A (32 bit) - low word
- MBF_CELL_RUNTIME_POLA_HIGH, // 0x0215* undocumented - cell runtime polarity A (32 bit) - high word
- MBF_CELL_RUNTIME_POLB_LOW, // 0x0216* undocumented - cell runtime polarity B (32 bit) - low word
- MBF_CELL_RUNTIME_POLB_HIGH, // 0x0217* undocumented - cell runtime polarity B (32 bit) - high word
- MBF_CELL_RUNTIME_POL_CHANGES_LOW, // 0x0218* undocumented - cell runtime polarity changes (32 bit) - low word
- MBF_CELL_RUNTIME_POL_CHANGES_HIGH, // 0x0219* undocumented - cell runtime polarity changes (32 bit) - high word
- MBF_HIDRO_MODULE_VERSION = 0x0280, // 0x0280 undocumented - Hydrolysis module version
- MBF_HIDRO_MODULE_CONNECTIVITY = 0x0281, // 0x0281 undocumented - Hydrolysis module connection quality (in myriad: 0..10000)
- MBF_SET_COUNTDOWN_KEY_AUX_OFF = 0x0287, // 0x0287 mask undocumented - switch AUX1-4 OFF - only for AUX which is assigned as AUX and set to MBV_PAR_CTIMER_COUNTDOWN_KEY_* mode - see MBV_PAR_CTIMER_COUNTDOWN_KEY_AUX*
- MBF_SET_COUNTDOWN_KEY_AUX_ON, // 0x0288 mask undocumented - switch AUX1-4 ON - only for AUX which is assigned as AUX and set to MBV_PAR_CTIMER_COUNTDOWN_KEY_* mode - see MBV_PAR_CTIMER_COUNTDOWN_KEY_AUX*
- MBF_SET_MANUAL_CTRL, // 0x0289 undocumented - write a 1 before manual control MBF_RELAY_STATE, after done write 0 and do MBF_EXEC
- MBF_ESCAPE = 0x0297, // 0x0297 undocumented - A write operation to this register is the same as using the ESC button on main screen - clears error
- MBF_SAVE_TO_EEPROM = 0x02F0, // 0x02F0 A write operation to this register starts a EEPROM storage operation immediately. During the EEPROM storage procedure, the system may be unresponsive to MODBUS requests. The operation will last always less than 1 second.
- MBF_EXEC = 0x02F5, // 0x02F5 undocumented - immediately take over settings - a write operation to this register take over the previous written data
+ // GLOBAL page (0x02xx) - Contains global information, such as the amount of time that each power unit has been working.
+ MBF_CELL_RUNTIME_LOW = 0x0206, // 0x0206* ! Cell runtime (32 bit value - low word)
+ MBF_CELL_RUNTIME_HIGH, // 0x0207* ! Cell runtime (32 bit value - high word)
+ MBF_CELL_RUNTIME_PART_LOW, // 0x0208* ! Cell part runtime (32 bit value - low word)
+ MBF_CELL_RUNTIME_PART_HIGH, // 0x0209* ! Cell part runtime (32 bit value - high word)
+ MBF_CELL_BOOST = 0x020C, // 0x020C* mask ! Boost control (see MBMSK_CELL_BOOST_*)
+ MBF_CELL_RUNTIME_POLA_LOW = 0x0214, // 0x0214* ! Cell runtime polarity 1 (32 bit value - low word)
+ MBF_CELL_RUNTIME_POLA_HIGH, // 0x0215* ! Cell runtime polarity 1 (32 bit value - high word)
+ MBF_CELL_RUNTIME_POLB_LOW, // 0x0216* ! Cell runtime polarity 2 (32 bit value - low word)
+ MBF_CELL_RUNTIME_POLB_HIGH, // 0x0217* ! Cell runtime polarity 2 (32 bit value - high word)
+ MBF_CELL_RUNTIME_POL_CHANGES_LOW, // 0x0218* ! Cell runtime polarity change count (32 bit value - low word)
+ MBF_CELL_RUNTIME_POL_CHANGES_HIGH, // 0x0219* ! Cell runtime polarity change count (32 bit value - high word)
+ MBF_HIDRO_MODULE_VERSION = 0x0280, // 0x0280 ! Hydrolysis module version
+ MBF_HIDRO_MODULE_CONNECTIVITY = 0x0281, // 0x0281 ! Hydrolysis module connection quality (in myriad: 0..10000)
+ MBF_SET_COUNTDOWN_KEY_AUX_OFF = 0x0287, // 0x0287 mask ! switch AUX1-4 OFF - only for AUX which is assigned as AUX and set to MBV_PAR_CTIMER_COUNTDOWN_KEY_* mode - see MBV_PAR_CTIMER_COUNTDOWN_KEY_AUX*
+ MBF_SET_COUNTDOWN_KEY_AUX_ON, // 0x0288 mask ! switch AUX1-4 ON - only for AUX which is assigned as AUX and set to MBV_PAR_CTIMER_COUNTDOWN_KEY_* mode - see MBV_PAR_CTIMER_COUNTDOWN_KEY_AUX*
+ MBF_SET_MANUAL_CTRL, // 0x0289 ! write a 1 before manual control MBF_RELAY_STATE, after done write 0 and do MBF_EXEC
+ MBF_ESCAPE = 0x0297, // 0x0297 ! A write operation to this register is the same as using the ESC button on main screen - clears error
+ MBF_SAVE_TO_EEPROM = 0x02F0, // 0x02F0 A write operation to this register immediately starts a EEPROM storage operation. During the EEPROM storage procedure, the system may be unresponsive to MODBUS requests. The operation will last always less than 1 second.
+ MBF_EXEC = 0x02F5, // 0x02F5 ! A write operation to this register immediately take over settings of the previous written data
- // FACTORY page (0x03xx)
- MBF_PAR_VERSION = 0x0300, // 0x0300* Software version of the PowerBox (unused)
+ // FACTORY page (0x03xx) - Contains factory data such as calibration parameters for the different power units.
+ MBF_PAR_VERSION = 0x0300, // 0x0300* Software version of the PowerBox
MBF_PAR_MODEL, // 0x0301* mask System model options
- MBF_PAR_SERNUM, // 0x0302* Serial number of the PowerBox (unused)
+ MBF_PAR_SERNUM, // 0x0302* Serial number of the PowerBox
MBF_PAR_ION_NOM, // 0x0303* Ionization maximum production level (DO NOT WRITE!)
MBF_PAR_HIDRO_NOM = 0x0306, // 0x0306* Hydrolysis maximum production level. (DO NOT WRITE!) If the hydrolysis is set to work in percent mode, this value will be 100. If the hydrolysis module is set to work in g/h production, this module will contain the maximum amount of production in g/h units. (DO NOT WRITE!)
MBF_PAR_SAL_AMPS = 0x030A, // 0x030A Current command in regulation for which we are going to measure voltage
@@ -147,17 +147,17 @@ enum NeoPoolRegister {
MBF_PAR_HIDRO_MAX_PWM_STEP_UP, // 0x0324 This register sets the PWM ramp up of the hydrolysis in pulses per duty cycle. This register makes it possible to adjust the rate at which the power delivered to the cell increases, allowing a gradual rise in power so that the operation of the switching source of the equipment is not saturated. Default 150
MBF_PAR_HIDRO_MAX_PWM_STEP_DOWN, // 0x0325 This register sets the PWM down ramp of the hydrolysis in pulses per duty cycle. This register allows adjusting the rate at which the power delivered to the cell decreases, allowing a gradual drop in power so that the switched source of the equipment is not disconnected due to lack of consumption. This gradual fall must be in accordance with the type of cell used, since said cell stores charge once the current stimulus has ceased. Default 20
- // INSTALLER page (0x04xx)
- MBF_PAR_ION_POL0 = 0x0400, // 0x0400 Time in min the team must spend working on positive polarization in copper-silver ionization.
- MBF_PAR_ION_POL1, // 0x0401 Time in min the team must spend working on positive polarization in copper-silver ionization.
- MBF_PAR_ION_POL2, // 0x0402 Time in min the team must spend working on positive polarization in copper-silver ionization.
- MBF_PAR_HIDRO_ION_CAUDAL, // 0x0403 mask Bitmask register regulates the external control mode of ionization, hydrolysis and pumps.
- MBF_PAR_HIDRO_MODE, // 0x0404 Regulates the external control mode of hydrolysis from the modules of measure. 0: no control, 1: standard control (on / off), 2: with timed pump
- MBF_PAR_HIDRO_POL0, // 0x0405 Time must spend working on positive polarization in hydrolysis / electrolysis. Time is stored in minutes.
- MBF_PAR_HIDRO_POL1, // 0x0406 Time must spend working on positive polarization in hydrolysis / electrolysis. Time is stored in minutes.
- MBF_PAR_HIDRO_POL2, // 0x0407 Time must spend working on positive polarization in hydrolysis / electrolysis. Time is stored in minutes.
- MBF_PAR_TIME_LOW, // 0x0408* System timestamp (32 bit unixtime) - low word
- MBF_PAR_TIME_HIGH, // 0x0409* System timestamp (32 bit unixtime) - high word
+ // INSTALLER page (0x04xx) - Contains a set of configuration registers related to the equipment installation, such as the relays used for each function, the amount of time that each pump must operate, etc.
+ MBF_PAR_ION_POL0 = 0x0400, // 0x0400 Time in minutes that the equipment must remain working in positive polarization in the copper-silver ionization.
+ MBF_PAR_ION_POL1, // 0x0401 Time in minutes that the equipment must remain working in negative polarization in the copper-silver ionization.
+ MBF_PAR_ION_POL2, // 0x0402 Time in minutes that the equipment must remain working in dead time (without delivering power) in the copper-silver ionization.
+ MBF_PAR_HIDRO_ION_CAUDAL, // 0x0403 mask Bitmask register regulates the external control mode of ionization, hydrolysis and pumps (see MBMSK_HIDRO_ION_CAUDAL_*)
+ MBF_PAR_HIDRO_MODE, // 0x0404 Regulates the external control mode of hydrolysis from the modules of measure. 0 = no control, 1 = standard control (on / off), 2 = with timed pump
+ MBF_PAR_HIDRO_POL0, // 0x0405 Time in minutes that the equipment must remain in positive polarization during hydrolysis/electrolysis.
+ MBF_PAR_HIDRO_POL1, // 0x0406 Time in minutes that the equipment must remain in negative polarization during hydrolysis/electrolysis.
+ MBF_PAR_HIDRO_POL2, // 0x0407 Time in minutes that the equipment must remain working in dead time (without delivering power) in the hydrolysis/electrolysis.
+ MBF_PAR_TIME_LOW, // 0x0408* System timestamp as unix timestamp (32 bit value - low word).
+ MBF_PAR_TIME_HIGH, // 0x0409* System timestamp as unix timestsmp (32 bit value - high word).
MBF_PAR_PH_ACID_RELAY_GPIO, // 0x040A* Relay number assigned to the acid pump function (only with pH module).
MBF_PAR_PH_BASE_RELAY_GPIO, // 0x040B* Relay number assigned to the base pump function (only with pH module).
MBF_PAR_RX_RELAY_GPIO, // 0x040C* Relay number assigned to the Redox level regulation function. If the value is 0, there is no relay assigned, and therefore there is no pump function (ON / OFF should not be displayed)
@@ -168,27 +168,27 @@ enum NeoPoolRegister {
MBF_PAR_FILT_MODE, // 0x0411* Filtration mode (see MBV_PAR_FILT_*)
MBF_PAR_FILT_GPIO, // 0x0412* Relay selected to perform the filtering function (by default it is relay 2). When this value is at zero, there is no relay assigned and therefore it is understood that the equipment does not control the filtration. In this case, the filter option does not appear in the user menu.
MBF_PAR_FILT_MANUAL_STATE, // 0x0413 Filtration status in manual mode (on = 1; off = 0)
- MBF_PAR_HEATING_MODE, // 0x0414 Heating mode. 0: the equipment is not heated. 1: the equipment is heating.
- MBF_PAR_HEATING_GPIO, // 0x0415 Relay selected to perform the heating function (by default it is relay 7). When this value is at zero, there is no relay assigned and therefore it is understood that the equipment does not control the heating. In this case, the filter modes associated with heating will not be displayed.
- MBF_PAR_HEATING_TEMP, // 0x0416 Heating setpoint temperature
- MBF_PAR_CLIMA_ONOFF, // 0x0417 Activation of the air conditioning mode (0 inactive; 1 active.
- MBF_PAR_SMART_TEMP_HIGH, // 0x0418 Superior temperature of the Smart mode
- MBF_PAR_SMART_TEMP_LOW, // 0x0419 Lower temperature of the Smart mode
- MBF_PAR_SMART_ANTI_FREEZE, // 0x041A Antifreeze mode activated (1) or not (0). This adjustment is only available in the Smart filtration mode.
- MBF_PAR_SMART_INTERVAL_REDUCTION, // 0x041B This register is read-only and reports to the outside what percentage (0 to 100%) is being applied to the nominal filtration time. 100% means that the total programmed time is being filtered.
- MBF_PAR_INTELLIGENT_TEMP, // 0x041C Setpoint temperature for smart mode
- MBF_PAR_INTELLIGENT_FILT_MIN_TIME, // 0x041D Minimum filtration time in minutes
- MBF_PAR_INTELLIGENT_BONUS_TIME, // 0x041E Bonus time for the current set of intervals
- MBF_PAR_INTELLIGENT_TT_NEXT_INTERVAL, // 0x041F Time to next filtration interval. When it reaches 0 an interval is started and the number of seconds is reloaded for the next interval (2x3600)
- MBF_PAR_INTELLIGENT_INTERVALS, // 0x0420 Number of started intervals. When it reaches 12 it is reset to 0 and the bonus time is reloaded with the value of MBF_PAR_INTELLIGENT_FILT_MIN_TIME
- MBF_PAR_FILTRATION_STATE, // 0x0421 Filtration function state: 0 is off and 1 is on. The filtration state is regulated according to the MBF_PAR_FILT_MANUAL_STATE register if the filtration mode held in register MBF_PAR_FILT_MODE is set to FILT_MODE_MANUAL (0).
+ MBF_PAR_HEATING_MODE, // 0x0414 Heating mode: 0 = the equipment is not heated. 1 = the equipment is heating.
+ MBF_PAR_HEATING_GPIO, // 0x0415 Relay number assigned to perform the heating function (by default it is relay 7). When this value is at zero, there is no relay assigned and therefore it is understood that the equipment does not control the heating. In this case, the filter modes associated with heating will not be displayed.
+ MBF_PAR_HEATING_TEMP, // 0x0416 Heating mode: Heating setpoint temperature
+ MBF_PAR_CLIMA_ONOFF, // 0x0417 Activation of the climate mode (0 = inactive, 1 = active).
+ MBF_PAR_SMART_TEMP_HIGH, // 0x0418 Smart mode: Upper temperature
+ MBF_PAR_SMART_TEMP_LOW, // 0x0419 Smart mode: Lower temperature
+ MBF_PAR_SMART_ANTI_FREEZE, // 0x041A Smart mode: Antifreeze mode activated (1) or not (0).
+ MBF_PAR_SMART_INTERVAL_REDUCTION, // 0x041B Smart mode: This register is read-only and reports to the outside what percentage (0 to 100%) is being applied to the nominal filtration time. 100% means that the total programmed time is being filtered.
+ MBF_PAR_INTELLIGENT_TEMP, // 0x041C Intelligent mode: Setpoint temperature
+ MBF_PAR_INTELLIGENT_FILT_MIN_TIME, // 0x041D Intelligent mode: Minimum filtration time in minutes
+ MBF_PAR_INTELLIGENT_BONUS_TIME, // 0x041E Intelligent mode: Bonus time for the current set of intervals
+ MBF_PAR_INTELLIGENT_TT_NEXT_INTERVAL, // 0x041F Intelligent mode: Time to next filtration interval. When it reaches 0 an interval is started and the number of seconds is reloaded for the next interval (2x3600)
+ MBF_PAR_INTELLIGENT_INTERVALS, // 0x0420 Intelligent mode: Number of started intervals. When it reaches 12 it is reset to 0 and the bonus time is reloaded with the value of MBF_PAR_INTELLIGENT_FILT_MIN_TIME
+ MBF_PAR_FILTRATION_STATE, // 0x0421 Filtration state: 0 is off and 1 is on. The filtration state is regulated according to the MBF_PAR_FILT_MANUAL_STATE register if the filtration mode held in register MBF_PAR_FILT_MODE is set to FILT_MODE_MANUAL (0).
MBF_PAR_HEATING_DELAY_TIME, // 0x0422 Timer in seconds that counts up when the heating is to be enabled. Once this counter reaches 60 seconds, the heating is then enabled. This counter is for internal use only.
- MBF_PAR_FILTERING_TIME_LOW, // 0x0423 32-bit value:
- MBF_PAR_FILTERING_TIME_HIGH, // 0x0424 Internal timer for the intelligent filtering mode. It counts the filtering time done during a given day. This register is only for internal use and should not be modified by the user.
- MBF_PAR_INTELLIGENT_INTERVAL_TIME_LOW, // 0x0425 32-bit value:
- MBF_PAR_INTELLIGENT_INTERVAL_TIME_HIGH, // 0x0426 Internal timer that counts the filtration interval assigned to the the intelligent mode. This register is only for internal use and should not be modified by the user.
+ MBF_PAR_FILTERING_TIME_LOW, // 0x0423 Internal timer for the intelligent filtering mode (32-bit value - low word). It counts the filtering time done during a given day. This register is only for internal use and should not be modified by the user.
+ MBF_PAR_FILTERING_TIME_HIGH, // 0x0424 Internal timer for the intelligent filtering mode (32-bit value - high word)
+ MBF_PAR_INTELLIGENT_INTERVAL_TIME_LOW, // 0x0425 Internal timer that counts the filtration interval assigned to the the intelligent mode (32-bit value - low word). This register is only for internal use and should not be modified by the user.
+ MBF_PAR_INTELLIGENT_INTERVAL_TIME_HIGH, // 0x0426 Internal timer that counts the filtration interval assigned to the the intelligent mode (32-bit value - high word)
MBF_PAR_UV_MODE, // 0x0427 UV mode active or not - see MBV_PAR_UV_MODE*. To enable UV support for a given device, add the mask MBMSK_MODEL_UV to the MBF_PAR_MODEL register.
- MBF_PAR_UV_HIDE_WARN, // 0x0428 mask Suppression for warning messages in the UV mode.
+ MBF_PAR_UV_HIDE_WARN, // 0x0428 mask Suppression for warning messages in the UV mode (see MBMSK_UV_HIDE_WARN_*)
MBF_PAR_UV_RELAY_GPIO, // 0x0429 Relay number assigned to the UV function.
MBF_PAR_PH_PUMP_REP_TIME_ON, // 0x042A mask Time that the pH pump will be turn on in the repetitive mode (see MBMSK_PH_PUMP_*). Contains a special time format, see desc for MBMSK_PH_PUMP_TIME.
MBF_PAR_PH_PUMP_REP_TIME_OFF, // 0x042B mask Time that the pH pump will be turn off in the repetitive mode. Contains a special time format, see desc for MBMSK_PH_PUMP_TIME, has no upper configuration bit 0x8000
@@ -197,33 +197,33 @@ enum NeoPoolRegister {
MBF_PAR_PUMP_RELAY_TIME_OFF, // 0x042E Time level in minutes or seconds that the dosing pump must remain off when the temporized pump mode is selected. This time level register applies to all pumps except pH. Contains a special time format, see desc for MBMSK_PH_PUMP_TIME, has no upper configuration bit 0x8000
MBF_PAR_PUMP_RELAY_TIME_ON, // 0x042F Time level in minutes or seconds that the dosing pump must remain on when the temporized pump mode is selected. This time level register applies to all pumps except pH. Contains a special time format, see desc for MBMSK_PH_PUMP_TIME, has no upper configuration bit 0x8000
MBF_PAR_RELAY_PH, // 0x0430 Determine what pH regulation configuration the equipment has (see MBV_PAR_RELAY_PH_*)
- MBF_PAR_RELAY_MAX_TIME, // 0x0431 Maximum amount of time, in seconds, that a dosing pump can operate before rising an alarm signal. The behavior of the system when the dosing time is exceeded is regulated by the type of action stored in the MBF_PAR_RELAY_MODE register.
+ MBF_PAR_RELAY_MAX_TIME, // 0x0431 Maximum amount of time in seconds, that a dosing pump can operate before rising an alarm signal. The behavior of the system when the dosing time is exceeded is regulated by the type of action stored in the MBF_PAR_RELAY_MODE register.
MBF_PAR_RELAY_MODE, // 0x0432 Behavior of the system when the dosing time is exceeded (see MBMSK_PAR_RELAY_MODE_* and MBV_PAR_RELAY_MODE_*)
MBF_PAR_RELAY_ACTIVATION_DELAY, // 0x0433 Delay time in seconds for the pH pump when the measured pH value is outside the allowable pH setpoints. The system internally adds an extra time of 10 seconds to the value stored here. The pump starts the dosing operation once the condition of pH out of valid interval is maintained during the time specified in this register.
- MBF_PAR_TIMER_BLOCK_BASE, // 0x0434 This block of 180 registers holds the configuration of the system timers. The system has a set of 12 fully configurable timers, each one assigned to a specific function, described below:
- MBF_PAR_TIMER_BLOCK_FILT_INT1 = 0x0434, // 0x0434 Filtration interval 1 (15 register - see MBV_TIMER_OFFMB_* for desc)
- MBF_PAR_TIMER_BLOCK_FILT_INT2 = 0x0443, // 0x0443 Filtration interval 2 (15 register - see MBV_TIMER_OFFMB_* for desc)
- MBF_PAR_TIMER_BLOCK_FILT_INT3 = 0x0452, // 0x0452 Filtration interval 3 (15 register - see MBV_TIMER_OFFMB_* for desc)
- MBF_PAR_TIMER_BLOCK_AUX1_INT2 = 0x0461, // 0x0461 Auxiliary relay 1 - 2. interval (15 register - see MBV_TIMER_OFFMB_* for desc)
- MBF_PAR_TIMER_BLOCK_LIGHT_INT = 0x0470, // 0x0470 Lighting interval (15 register - see MBV_TIMER_OFFMB_* for desc)
- MBF_PAR_TIMER_BLOCK_AUX2_INT2 = 0x047F, // 0x047F Auxiliary relay 2 - 2. interval (15 register - see MBV_TIMER_OFFMB_* for desc)
- MBF_PAR_TIMER_BLOCK_AUX3_INT2 = 0x048E, // 0x048E Auxiliary relay 3 - 2. interval (15 register - see MBV_TIMER_OFFMB_* for desc)
- MBF_PAR_TIMER_BLOCK_AUX4_INT2 = 0x049D, // 0x049D Auxiliary relay 4 - 2. interval (15 register - see MBV_TIMER_OFFMB_* for desc)
- MBF_PAR_TIMER_BLOCK_AUX1_INT1 = 0x04AC, // 0x04AC Auxiliary relay 1 - 1. interval (15 register - see MBV_TIMER_OFFMB_* for desc)
- MBF_PAR_TIMER_BLOCK_AUX2_INT1 = 0x04BB, // 0x04BB Auxiliary relay 2 - 1. interval (15 register - see MBV_TIMER_OFFMB_* for desc)
- MBF_PAR_TIMER_BLOCK_AUX3_INT1 = 0x04CA, // 0x04CA Auxiliary relay 3 - 1. interval (15 register - see MBV_TIMER_OFFMB_* for desc)
- MBF_PAR_TIMER_BLOCK_AUX4_INT1 = 0x04D9, // 0x04D9 Auxiliary relay 4 - 1. interval (15 register - see MBV_TIMER_OFFMB_* for desc)
+ MBF_PAR_TIMER_BLOCK_BASE, // 0x0434 Block of 180 registers containing the configuration of the 12 timers with 15 registers each (see MBV_TIMER_OFFMB_*). The system has a set of 12 fully configurable timers, each one assigned to a specific function:
+ MBF_PAR_TIMER_BLOCK_FILT_INT1 = 0x0434, // 0x0434 Filtration timer 1
+ MBF_PAR_TIMER_BLOCK_FILT_INT2 = 0x0443, // 0x0443 Filtration tiemr 2
+ MBF_PAR_TIMER_BLOCK_FILT_INT3 = 0x0452, // 0x0452 Filtration timer 3
+ MBF_PAR_TIMER_BLOCK_AUX1_INT2 = 0x0461, // 0x0461 Aux1 timer 2
+ MBF_PAR_TIMER_BLOCK_LIGHT_INT = 0x0470, // 0x0470 Lighting timer
+ MBF_PAR_TIMER_BLOCK_AUX2_INT2 = 0x047F, // 0x047F Aux2 timer 2
+ MBF_PAR_TIMER_BLOCK_AUX3_INT2 = 0x048E, // 0x048E Aux3 timer 2
+ MBF_PAR_TIMER_BLOCK_AUX4_INT2 = 0x049D, // 0x049D Aux4 timer 2
+ MBF_PAR_TIMER_BLOCK_AUX1_INT1 = 0x04AC, // 0x04AC Aux1 timer 1
+ MBF_PAR_TIMER_BLOCK_AUX2_INT1 = 0x04BB, // 0x04BB Aux2 timer 1
+ MBF_PAR_TIMER_BLOCK_AUX3_INT1 = 0x04CA, // 0x04CA Aux3 timer 1
+ MBF_PAR_TIMER_BLOCK_AUX4_INT1 = 0x04D9, // 0x04D9 Aux4 timer 1
MBF_PAR_FILTVALVE_ENABLE = 0x04E8, // 0x04E8 Filter cleaning functionality mode (0 = off, 1 = Besgo)
MBF_PAR_FILTVALVE_MODE, // 0x04E9 Filter cleaning valve timing mode, possible modes: MBV_PAR_CTIMER_ENABLED, MBV_PAR_CTIMER_ALWAYS_ON, MBV_PAR_CTIMER_ALWAYS_OFF
MBF_PAR_FILTVALVE_GPIO, // 0x04EA Relay associated with the filter cleaning function. default AUX2 (value 5)
- MBF_PAR_FILTVALVE_START_LOW, // 0x04EB start timestamp of filter cleaning (32-bit)
- MBF_PAR_FILTVALVE_START_HIGH, // 0x04EC "
+ MBF_PAR_FILTVALVE_START_LOW, // 0x04EB Start timestamp of filter cleaning (32-bit value - low word)
+ MBF_PAR_FILTVALVE_START_HIGH, // 0x04EC Start timestamp of filter cleaning (32-bit value - high word)
MBF_PAR_FILTVALVE_PERIOD_MINUTES, // 0x04ED Period in minutes between cleaning actions. For example, if a value of 60 is stored in this registry, a cleanup action will occur every hour.
MBF_PAR_FILTVALVE_INTERVAL, // 0x04EE Cleaning action duration in seconds.
MBF_PAR_FILTVALVE_REMAINING, // 0x04EF Time remaining for the current cleaning action in seconds. If this register is 0, it means that there is no cleaning function running. When a cleanup function is started, the contents of the MBF_PAR_FILTVALVE_INTERVAL register are copied to this register, then decremented once per second. The display uses this log to track the progress of the cleaning function.
MBF_ACTION_COPY_TO_RTC, // 0x04F0 A write (any value) forces the writing of the RTC time registers MBF_PAR_TIME_LOW (0x0408) and MBF_PAR_TIME_HIGH (0x0409) into the RTC internal microcontroller clock management registers.
- // USER page (0x05xx) To make the modification of this register persistent, execute the EEPROM storage procedure described in global register MBF_SAVE_TO_EEPROM.
+ // USER page (0x05xx) - Contains user configuration registers, such as the production level for the ionization and the hydrolysis, or the set points for the pH, redox, or chlorine regulation loops.
MBF_PAR_ION = 0x0500, // 0x0500* Ionization target production level. The value adjusted in this register must not exceed the value set in the MBF_PAR_ION_NOM factory register.
MBF_PAR_ION_PR, // 0x0501* Amount of time in minutes that the ionization must be activated each time that the filtration starts.
MBF_PAR_HIDRO, // 0x0502* Hydrolisis target production level. When the hydrolysis production is to be set in percent values, this value will contain the percent of production. If the hydrolysis module is set to work in g/h production, this module will contain the desired amount of production in g/h units. The value adjusted in this register must not exceed the value set in the MBF_PAR_HIDRO_NOM factory register.
@@ -231,47 +231,25 @@ enum NeoPoolRegister {
MBF_PAR_PH2, // 0x0505* Lower limit of the pH regulation system. The value set in this register is multiplied by 100. This means that if we want to set a value of 7.0, the numerical content that we must write in this register is 700. This register must be always lower than MBF_PAR_PH1.
MBF_PAR_RX1 = 0x0508, // 0x0508* Set point for the redox regulation system. This value must be in the range of 0 to 1000.
MBF_PAR_CL1 = 0x050A, // 0x050A* Set point for the chlorine regulation system. The value stored in this register is multiplied by 100. This mean that if we want to set a value of 1.5 ppm, we will have to write a numerical value of 150. This value stored in this register must be in the range of 0 to 1000.
- MBF_PAR_FILTRATION_CONF = 0x050F, // 0x050F* mask undocumented - filtration type and speed, see MBMSK_PAR_FILTRATION_CONF_*
- MBF_PAR_FILTRATION_SPEED_FUNC = 0x0513, // 0x0513 undocumented - filtration speed function control
+ MBF_PAR_FILTRATION_CONF = 0x050F, // 0x050F* mask ! filtration type and speed, see MBMSK_PAR_FILTRATION_CONF_*
+ MBF_PAR_FILTRATION_SPEED_FUNC = 0x0513, // 0x0513 ! filtration speed function control
MBF_PAR_FUNCTION_DEPENDENCY = 0x051B, // 0x051B mask Specification for the dependency of different functions, such as heating, from external events like FL1 (see MBMSK_FCTDEP_HEATING/MBMSK_DEPENDENCY_*)
- // MISC page (0x06xx)
+ // MISC page (0x06xx) - Contains the configuration parameters for the screen controllers (language, colours, sound, etc).
MBF_PAR_UICFG_MACHINE = 0x0600, // 0x0600* Machine type (see MBV_PAR_MACH_* and kNeoPoolMachineNames[])
MBF_PAR_UICFG_LANGUAGE, // 0x0601* Selected language (see MBV_PAR_LANG_*)
MBF_PAR_UICFG_BACKLIGHT, // 0x0602* Display backlight (see MBV_PAR_BACKLIGHT_*)
MBF_PAR_UICFG_SOUND, // 0x0603* mask Audible alerts (see MBMSK_PAR_SOUND_*)
MBF_PAR_UICFG_PASSWORD, // 0x0604* System password encoded in BCD
MBF_PAR_UICFG_VISUAL_OPTIONS, // 0x0605* mask Stores the different display options for the user interface menus (bitmask). Some bits allow you to hide options that are normally visible (bits 0 to 3) while other bits allow you to show options that are normally hidden (bits 9 to 15)
- MBF_PAR_UICFG_VISUAL_OPTIONS_EXT, // 0x0606* mask This register stores additional display options for the user interface menus, see MBMSK_VOE_*
+ MBF_PAR_UICFG_VISUAL_OPTIONS_EXT, // 0x0606* mask This register stores additional display options for the user interface menus (see MBMSK_VOE_*)
MBF_PAR_UICFG_MACH_VISUAL_STYLE, // 0x0607* mask This register is an expansion of register 0x0600 and 0x0605. The lower part of the register (8 bits LSB) is used to store the type of color selected when in register 0x600 has been specified that the machine is of type "generic". Colors and styles correspond to those listed in record 0x600 MBF_PAR_UICFG_MACHINE. The upper part (8-bit MSB) contains extra bits MBMSK_VS_FORCE_UNITS_GRH, MBMSK_VS_FORCE_UNITS_PERCENTAGE and MBMSK_ELECTROLISIS
- MBF_PAR_UICFG_MACH_NAME_BOLD_0, // 0x0608 This set of 4 registers stores an ASCIIZ string of up to 8 characters that is used to specify the bold part of the title to be displayed at startup if the specified machine type is generic. Note: only lowercase letters (a-z) can be used.
- MBF_PAR_UICFG_MACH_NAME_BOLD_1, // 0x0609
- MBF_PAR_UICFG_MACH_NAME_BOLD_2, // 0x060A
- MBF_PAR_UICFG_MACH_NAME_BOLD_3, // 0x060B
- MBF_PAR_UICFG_MACH_NAME_LIGHT_0, // 0x060C This set of 4 registers stores an ASCIIZ string of up to 8 characters that is used to specify the normal intensity part of the title that will be displayed at startup if the specified machine type is generic. Note: Only lowercase letters (a-z) can be used.
- MBF_PAR_UICFG_MACH_NAME_LIGHT_1, // 0x060D
- MBF_PAR_UICFG_MACH_NAME_LIGHT_2, // 0x060E
- MBF_PAR_UICFG_MACH_NAME_LIGHT_3, // 0x060F
- MBF_PAR_UICFG_MACH_NAME_AUX1_0, // 0x0610 Aux1 relay name: 5 registers ASCIIZ string of up to 10 characters
- MBF_PAR_UICFG_MACH_NAME_AUX1_1, // 0x0611
- MBF_PAR_UICFG_MACH_NAME_AUX1_2, // 0x0612
- MBF_PAR_UICFG_MACH_NAME_AUX1_3, // 0x0613
- MBF_PAR_UICFG_MACH_NAME_AUX1_4, // 0x0614
- MBF_PAR_UICFG_MACH_NAME_AUX2_0, // 0x0615 Aux2 relay name: 5 registers ASCIIZ string of up to 10 characters
- MBF_PAR_UICFG_MACH_NAME_AUX2_1, // 0x0616
- MBF_PAR_UICFG_MACH_NAME_AUX2_2, // 0x0617
- MBF_PAR_UICFG_MACH_NAME_AUX2_3, // 0x0618
- MBF_PAR_UICFG_MACH_NAME_AUX2_4, // 0x0619
- MBF_PAR_UICFG_MACH_NAME_AUX3_0, // 0x061A Aux3 relay name: 5 registers ASCIIZ string of up to 10 characters
- MBF_PAR_UICFG_MACH_NAME_AUX3_1, // 0x061B
- MBF_PAR_UICFG_MACH_NAME_AUX3_2, // 0x061C
- MBF_PAR_UICFG_MACH_NAME_AUX3_3, // 0x061D
- MBF_PAR_UICFG_MACH_NAME_AUX3_4, // 0x061E
- MBF_PAR_UICFG_MACH_NAME_AUX4_0, // 0x061F Aux4 relay name: 5 registers ASCIIZ string of up to 10 characters
- MBF_PAR_UICFG_MACH_NAME_AUX4_1, // 0x0620
- MBF_PAR_UICFG_MACH_NAME_AUX4_2, // 0x0621
- MBF_PAR_UICFG_MACH_NAME_AUX4_3, // 0x0622
- MBF_PAR_UICFG_MACH_NAME_AUX4_4, // 0x0623
+ MBF_PAR_UICFG_MACH_NAME_BOLD = 0x0608, // 0x0608 Machine name bold part title displayed during startup (if machine type is generic). Note: Only lowercase letters (a-z) can be used. 4 register ASCIIZ string with up to 8 characters
+ MBF_PAR_UICFG_MACH_NAME_LIGHT = 0x060C, // 0x060C Machine name normal intensity part title displayed during startup (if machine type is generic). Note: Only lowercase letters (a-z) can be used. 4 register ASCIIZ string with up to 8 characters
+ MBF_PAR_UICFG_MACH_NAME_AUX1 = 0x0610, // 0x0610 Aux1 relay name: 5 register ASCIIZ string with up to 10 characters
+ MBF_PAR_UICFG_MACH_NAME_AUX2 = 0x0615, // 0x0615 Aux2 relay name: 5 register ASCIIZ string with up to 10 characters
+ MBF_PAR_UICFG_MACH_NAME_AUX3 = 0x061A, // 0x061A Aux3 relay name: 5 register ASCIIZ string with up to 10 characters
+ MBF_PAR_UICFG_MACH_NAME_AUX4 = 0x061F, // 0x061F Aux4 relay name: 5 register ASCIIZ string with up to 10 characters
};
// Sugar Valley register constants and bit masks
@@ -279,14 +257,14 @@ enum NeoPoolConstAndBitMask {
// MBF_PH_STATUS
MBMSK_PH_STATUS_ALARM = 0x000F, // PH alarm. The possible alarm values are depending on the regulation model:
// Valid alarm values for pH regulation with acid and base:
- MBV_PH_ACID_BASE_ALARM0 = 0, // no alarm
- MBV_PH_ACID_BASE_ALARM1 = 1, // pH too high; the pH value is 0.8 points higher than the setpoint (PH1 on acid systems, PH2 on base systems, PH1 on acid+base systems)
- MBV_PH_ACID_BASE_ALARM2 = 2, // pH too low: the pH value is 0.8 points lower than the set point value set in (PH1 on acid systems, PH2 on base systems, PH2 on acid+base systems)
- MBV_PH_ACID_BASE_ALARM3 = 3, // pH pump has exceeded the working time set by the MBF_PAR_RELAY_PH_MAX_TIME parameter and has stopped.
- MBV_PH_ACID_BASE_ALARM4 = 4, // pH higher than the set point (PH1 + 0.1 on acid systems, PH2 + 0.1 on base systems, PH1 on acid+base systems)
- MBV_PH_ACID_BASE_ALARM5 = 5, // pH lower than the set point (PH1 - 0.3 on acid systems, PH2 - 0.3 on base systems, PH2 on acid+base systems)
- MBV_PH_ACID_BASE_ALARM6 = 6, // undocumented - tank level alarm
-
+ MBV_PH_ACID_BASE_ALARM0 = 0, // no alarm
+ MBV_PH_ACID_BASE_ALARM1 = 1, // pH too high; the pH value is 0.8 points higher than the setpoint (PH1 on acid systems, PH2 on base systems, PH1 on acid+base systems)
+ MBV_PH_ACID_BASE_ALARM2 = 2, // pH too low: the pH value is 0.8 points lower than the set point value set in (PH1 on acid systems, PH2 on base systems, PH2 on acid+base systems)
+ MBV_PH_ACID_BASE_ALARM3 = 3, // pH pump has exceeded the working time set by the MBF_PAR_RELAY_PH_MAX_TIME parameter and has stopped.
+ MBV_PH_ACID_BASE_ALARM4 = 4, // pH higher than the set point (PH1 + 0.1 on acid systems, PH2 + 0.1 on base systems, PH1 on acid+base systems)
+ MBV_PH_ACID_BASE_ALARM5 = 5, // pH lower than the set point (PH1 - 0.3 on acid systems, PH2 - 0.3 on base systems, PH2 on acid+base systems)
+ MBV_PH_ACID_BASE_ALARM6 = 6, // ! tank level alarm
+ // bit
MBMSK_PH_STATUS_CTRL_BY_FL = 0x0400, // 10 Control status of the pH module by flow detection (if enabled by MBF_PAR_HIDRO_ION_CAUDAL)
MBMSK_PH_STATUS_ACID_PUMP_ACTIVE = 0x0800, // 11 Acid pH pump relay on (pump on)
MBMSK_PH_STATUS_BASE_PUMP_ACTIVE = 0x1000, // 12 Base pH Pump Relay On (Pump On)
@@ -294,38 +272,38 @@ enum NeoPoolConstAndBitMask {
MBMSK_PH_STATUS_MEASURE_ACTIVE = 0x4000, // 14 Active pH measurement module and making measurements. If this bit is at 1, the pH bar should be displayed.
MBMSK_PH_STATUS_MODULE_PRESENT = 0x8000, // 15 Detected pH measurement module
- // MBF_RX_STATUS
+ // MBF_RX_STATUS // bit
MBMSK_RX_STATUS_RX_PUMP_ACTIVE = 0x1000, // 12 Redox pump relay on (pump activated)
MBMSK_RX_STATUS_CTRL_ACTIVE = 0x2000, // 13 Active Redox control module and controlling pump
MBMSK_RX_STATUS_MEASURE_ACTIVE = 0x4000, // 14 Active Redox measurement module and performing measurements. If this bit is at 1, the Redox bar should be displayed on the screen.
MBMSK_RX_STATUS_MODULE_PRESENT = 0x8000, // 15 Redox measurement module detected in the system
- // MBF_CL_STATUS
+ // MBF_CL_STATUS // bit
MBMSK_CL_STATUS_CHLORINE_FLOW = 0x0008, // 3 Chlorine Probe Flow Sensor. This sensor is built into the probe itself and serves to detect whether there is water passing through the chlorine measurement probe. In case the sensor is at 0, the chlorine measurement will not be valid.
MBMSK_CL_STATUS_CL_PUMP_ACTIVE = 0x1000, // 12 Chlorine pump relay on (pump on)
MBMSK_CL_STATUS_CTRL_ACTIVE = 0x2000, // 13 Active chlorine control module and controlling pump
MBMSK_CL_STATUS_MEASURE_ACTIVE = 0x4000, // 14 Active chlorine measurement module and taking measurements. If this bit is 1, the chlorine bar should be displayed on the screen.
MBMSK_CL_STATUS_MODULE_PRESENT = 0x8000, // 15 Chlorine measurement module detected in the system
- // MBF_CD_STATUS
+ // MBF_CD_STATUS // bit
MBMSK_CD_STATUS_RX_PUMP_ACTIVE = 0x1000, // 12 Conductivity pump relay on (pump active)
MBMSK_CD_STATUS_CTRL_ACTIVE = 0x2000, // 13 Active conductivity control module and controlling pump
MBMSK_CD_STATUS_MEASURE_ACTIVE = 0x4000, // 14 Active conductivity measurement module and making measurements. If this bit is 1, the conditionality bar should be displayed on the screen.
MBMSK_CD_STATUS_MODULE_PRESENT = 0x8000, // 15 Conductivity measurement module detected in the system
- // MBF_ION_STATUS
+ // MBF_ION_STATUS // bit
MBMSK_ION_STATUS_ON_TARGET = 0x0001, // 0 On Target - the system has reached the set point.
MBMSK_ION_STATUS_LOW = 0x0002, // 1 Low - Ionization cannot reach the set point.
- MBMSK_ION_STATUS_RESERVED = 0x0004, // 2
+ MBMSK_ION_STATUS_RESERVED = 0x0004, // 2 reserved
MBMSK_ION_STATUS_PROGTIME_EXCEEDED = 0x0008, // 3 Pr off - The programmed ionization time has been exceeded
MBMSK_ION_STATUS_POLOFF = 0x1000, // 12 Ion Pol off - Ionization in dead time
MBMSK_ION_STATUS_POL1 = 0x2000, // 13 Ion Pol 1 - Ionization working in polarization 1
MBMSK_ION_STATUS_POL2 = 0x4000, // 14 Ion Pol 2 - Ionization working in polarization 2
- // MBF_HIDRO_STATUS
+ // MBF_HIDRO_STATUS // bit
MBMSK_HIDRO_STATUS_ON_TARGET = 0x0001, // 0 On Target - the system has reached the set point.
MBMSK_HIDRO_STATUS_LOW = 0x0002, // 1 Low - Hydrolysis cannot reach the set point.
- MBMSK_HIDRO_STATUS_RESERVED = 0x0004, // 2
+ MBMSK_HIDRO_STATUS_RESERVED = 0x0004, // 2 reserved
MBMSK_HIDRO_STATUS_FL1 = 0x0008, // 3 Flow - Hydrolysis cell flow indicator (FL1)
MBMSK_HIDRO_STATUS_COVER = 0x0010, // 4 Cover - Cover input activated
MBMSK_HIDRO_STATUS_MODULE_ACTIVE = 0x0020, // 5 Active - Active Module hydrolysis (hidroEnable)
@@ -338,7 +316,7 @@ enum NeoPoolConstAndBitMask {
MBMSK_HIDRO_STATUS_POL1 = 0x2000, // 13 Ion Pol 1 - Ionization working in polarization 1
MBMSK_HIDRO_STATUS_POL2 = 0x4000, // 14 Ion Pol 2 - Ionization working in polarization 2
- // MBF_RELAY_STATE
+ // MBF_RELAY_STATE // bit
MBMSK_RELAY_STATE1 = 0x0001, // 0 Relay 1 state (1 on; 0 off) (normally assigned to ph)
MBMSK_RELAY_STATE2 = 0x0002, // 1 Relay 2 state (1 on; 0 off) (normally assigned to filtering)
MBMSK_RELAY_STATE3 = 0x0004, // 2 Relay 3 status (1 on; 0 off) (normally assigned to lighting)
@@ -352,7 +330,7 @@ enum NeoPoolConstAndBitMask {
MBMSK_RELAY_FILTSPEED = 0x0700, // Filtration current speed mask
MBSHFT_RELAY_FILTSPEED = 8, // Filtration current speed bit shift
- // MBF_NOTIFICATION
+ // MBF_NOTIFICATION // bit
MBMSK_NOTIF_MODBUS_CHANGED = 0x0001, // 0 Modbus page changed
MBMSK_NOTIF_GLOBAL_CHANGED = 0x0002, // 1 Global page changed
MBMSK_NOTIF_FACTORY_CHANGED = 0x0004, // 2 Factory page changed
@@ -361,11 +339,11 @@ enum NeoPoolConstAndBitMask {
MBMSK_NOTIF_MISC_CHANGED = 0x0020, // 5 Misc page changed
// MBF_CELL_BOOST
- MBMSK_CELL_BOOST_NO_REDOX_CTL = 0x8000, // undocumented - Disable redox ctrl
- MBMSK_CELL_BOOST_STATE = 0x0500, // undocumented - Boost
- MBMSK_CELL_BOOST_START = 0x00A0, // undocumented - Start boost
+ MBMSK_CELL_BOOST_NO_REDOX_CTL = 0x8000, // ! Disable redox ctrl
+ MBMSK_CELL_BOOST_STATE = 0x0500, // ! Boost
+ MBMSK_CELL_BOOST_START = 0x00A0, // ! Start boost
- // MBF_PAR_MODEL
+ // MBF_PAR_MODEL // bit
MBMSK_MODEL_ION = 0x0001, // 0 The equipment includes ionization control
MBMSK_MODEL_HIDRO = 0x0002, // 1 The equipment includes hydrolysis or electrolysis
MBMSK_MODEL_UV = 0x0004, // 2 The equipment includes disinfection control by ultraviolet lamp
@@ -378,7 +356,7 @@ enum NeoPoolConstAndBitMask {
MBV_PAR_HIDRO_FLOW_SIGNAL_PADDLE_AND_STD= 3, // Detection based on the paddle switch, associated with the FL1 input, and the standard detector. The system will understand that there is flow when both elements detect flow. If either one opens, the hydrolysis will stop.
MBV_PAR_HIDRO_FLOW_SIGNAL_PADDLE_OR_STD = 4, // Detection based on the paddle switch, associated with the FL1 input, or the standard detector. The system will understand that there is flow when either of the two elements detects flow. Hydrolysis will stop only if both detectors detect no flow.
- // MBF_PAR_HIDRO_ION_CAUDAL
+ // MBF_PAR_HIDRO_ION_CAUDAL // bit
MBMSK_HIDRO_ION_CAUDAL_FL1_CTRL = 0x0001, // 0 If the FL1 signal is detected to be inactive, the actuation of the different elements of the system is disabled.
MBMSK_HIDRO_ION_CAUDAL_FL2_CTRL = 0x0002, // 1 If the FL2 signal is detected to be inactive, the actuation of the different elements of the system is disabled.
MBMSK_HIDRO_ION_CAUDAL_FULL_CL_HIDRO_CTRL=0x0004, // 2 If there is a chlorine module installed and it is detected that its flow sensor is inactive, the action of the different elements of the system is disabled.
@@ -399,9 +377,9 @@ enum NeoPoolConstAndBitMask {
MBV_PAR_UV_MODE0 = 0, // UV is switched off and it will not turn on when filtration starts
MBV_PAR_UV_MODE1 = 1, // UV is switched on and it will turn on when filtration starts. Time counter for the UV lamp will be incremented.
- // MBF_PAR_UV_HIDE_WARN
- MBMSK_UV_HIDE_WARN_CLEAN = 0x0001, // 0
- MBMSK_UV_HIDE_WARN_REPLACE = 0x0002, // 1
+ // MBF_PAR_UV_HIDE_WARN // bit
+ MBMSK_UV_HIDE_WARN_CLEAN = 0x0001, // 0 Suppress UV lamp clean wanring
+ MBMSK_UV_HIDE_WARN_REPLACE = 0x0002, // 1 Suppress UV lamp replace warning
// MBF_PAR_PH_PUMP_REP_TIME_ON
MBMSK_PH_PUMP_TIME = 0x7FFF, // Time level for the pump: The time level has a special coding format. It can cover periods of 1 to 180 seconds with 1 second granularity and from 3 to 999 minutes with 1 minute granularity. f the value is set to 30 for example, a 30 second time will be considered. If we have the value 200, we will have an on time of (200-180+3) = 23 minutes.
@@ -496,7 +474,7 @@ enum NeoPoolConstAndBitMask {
MBV_TIMER_OFFMB_TIMER_INTERVAL = 7, // Time in seconds that the timer has to run when started (32-bit, LSB first)
MBV_TIMER_OFFMB_TIMER_COUNTDOWN = 9, // Time remaining in seconds for the countdown mode (32-bit, LSB first)
MBV_TIMER_OFFMB_TIMER_FUNCTION = 11, // Function assigned to this timer, see MBV_PAR_CTIMER_FCT_*
- MBV_TIMER_OFFMB_TIMER_WORK_TIME = 13, // Number of seconds that the timer has been operating
+ MBV_TIMER_OFFMB_TIMER_WORK_TIME = 13, // Number of seconds that the timer has been operating (valid only if MBV_TIMER_OFFMB_TIMER_ENABLE is in MBV_PAR_CTIMER_COUNTDOWN_KEY_* mode)
// MBV_TIMER_OFFMB_TIMER_ENABLE working modes:
MBV_PAR_CTIMER_DISABLE = 0, // Timer disabled
MBV_PAR_CTIMER_ENABLED = 1, // Timer enabled and independent
@@ -517,21 +495,21 @@ enum NeoPoolConstAndBitMask {
MBV_PAR_CTIMER_FCT_FILTRATION = 0x0001, // Filtration function of the system
MBV_PAR_CTIMER_FCT_LIGHTING = 0x0002, // Lighting function of the system
MBV_PAR_CTIMER_FCT_HEATING = 0x0004, // Heating function of the system
- MBV_PAR_CTIMER_FCT_AUXREL1 = 0x0100, // Function assigned to relay 1 (Filtration)
- MBV_PAR_CTIMER_FCT_AUXREL2 = 0x0200, // Function assigned to relay 2 (Light)
- MBV_PAR_CTIMER_FCT_AUXREL3 = 0x0400, // Function assigned to relay 3 (Heating)
- MBV_PAR_CTIMER_FCT_AUXREL4 = 0x0800, // Function assigned to relay 4 (AUX1)
- MBV_PAR_CTIMER_FCT_AUXREL5 = 0x1000, // Function assigned to relay 5 (AUX2)
- MBV_PAR_CTIMER_FCT_AUXREL6 = 0x2000, // Function assigned to relay 6 (AUX3)
- MBV_PAR_CTIMER_FCT_AUXREL7 = 0x4000, // Function assigned to relay 7 (AUX4)
+ MBV_PAR_CTIMER_FCT_RELAY1 = 0x0100, // Function assigned to relay 1 (Filtration)
+ MBV_PAR_CTIMER_FCT_RELAY2 = 0x0200, // Function assigned to relay 2 (Light)
+ MBV_PAR_CTIMER_FCT_RELAY3 = 0x0400, // Function assigned to relay 3 (pH Pump)
+ MBV_PAR_CTIMER_FCT_RELAY4 = 0x0800, // Function assigned to relay 4 (AUX1)
+ MBV_PAR_CTIMER_FCT_RELAY5 = 0x1000, // Function assigned to relay 5 (AUX2)
+ MBV_PAR_CTIMER_FCT_RELAY6 = 0x2000, // Function assigned to relay 6 (AUX3)
+ MBV_PAR_CTIMER_FCT_RELAY7 = 0x4000, // Function assigned to relay 7 (AUX4)
- // MBF_PAR_UICFG_SOUND
+ // MBF_PAR_UICFG_SOUND // bit
MBMSK_PAR_SOUND_CLICK = 0x0001, // 0 Click sounds every time a key is pressed
MBMSK_PAR_SOUND_POPUP = 0x0002, // 1 Sound plays each time a pop-up message appears
MBMSK_PAR_SOUND_ALERTS = 0x0004, // 2 An alarm sounds when there is an alert on the equipment (AL3)
MBMSK_PAR_SOUND_FILTRATION = 0x0008, // 3 Audible warning every time the filtration is started
- // MBF_PAR_UICFG_VISUAL_OPTIONS
+ // MBF_PAR_UICFG_VISUAL_OPTIONS // bit
MBMSK_HIDE_TEMPERATURE = 0x0001, // 0 Hide temperature measurement from main menu
MBMSK_HIDE_FILTRATION = 0x0002, // 1 Hide filter status from main menu
MBMSK_HIDE_LIGHTING = 0x0004, // 2 Hide lighting status from main menu
@@ -549,7 +527,7 @@ enum NeoPoolConstAndBitMask {
MBMSK_SHOW_INSTALLER_MENU = 0x4000, // 14 Shows access to the installer menu in the main menu without the need for a password.
MBMSK_SHOW_FACTORY_MENU = 0x8000, // 15 Shows access to the factory menu in the main menu without the need for a password.
- // MBF_PAR_UICFG_VISUAL_OPTIONS_EXT
+ // MBF_PAR_UICFG_VISUAL_OPTIONS_EXT // bit
MBMSK_VOE_SHOW_PNEUMATIC_VALVE = 0x0001, // 0 Shows the pneumatic valve
MBMSK_VOE_HIDE_AUX_REL_DEPENDENCY = 0x0002, // 1 Hides the auxiliary relay dependency
MBMSK_VOE_SHOW_BESGO_NAME = 0x0004, // 2 Show “Besgo” instead of “Pneumatic” for the pneumatic valve titles.
@@ -564,13 +542,13 @@ enum NeoPoolConstAndBitMask {
MBMSK_VOE_HIDE_BASIC_EXT_CONTROL = 0x0800, // 11 Hide basic external controls
MBMSK_VOE_HIDE_DIAGNOSTICS = 0x1000, // 12 Hide diagnostics
- // MBF_PAR_UICFG_MACH_VISUAL_STYLE
+ // MBF_PAR_UICFG_MACH_VISUAL_STYLE // bit
MBMSK_VS_FORCE_UNITS_GRH = 0x2000, // 13 Display the hydrolysis/electrolysis in units of grams per hour (gr/h).
MBMSK_VS_FORCE_UNITS_PERCENTAGE = 0x4000, // 14 Display the hydrolysis/electrolysis in percentage units (%).
MBMSK_ELECTROLISIS = 0x8000, // 15 Display the word electrolysis instead of hydrolysis in generic mode.
// MBF_POWER_MODULE_REG_*
- MBV_POWER_MODULE_REG_INFO = 0, // undocumented - set of 26-byte power module register stores an ASCIIZ string containing the subversion and timestamp of the module, e. g. ".57\nMay 26 2020\n01:08:10\n\0"
+ MBV_POWER_MODULE_REG_INFO = 0, // ! set of 26-byte power module register stores an ASCIIZ string containing the subversion and timestamp of the module, e. g. ".57\nMay 26 2020\n01:08:10\n\0"
};
#include
@@ -2165,9 +2143,9 @@ void NeoPoolShow(bool json)
strncpy_P(sdesc, PSTR(D_NEOPOOL_RELAY_VALVE), sizeof(sdesc));
} else if (i > 2) {
// Aux
- char sname[(MBF_PAR_UICFG_MACH_NAME_AUX2_0 - MBF_PAR_UICFG_MACH_NAME_AUX1_0) * 2 + 1];
- uint16_t base = MBF_PAR_UICFG_MACH_NAME_AUX1_0 + ((i - 3) * (MBF_PAR_UICFG_MACH_NAME_AUX2_0 - MBF_PAR_UICFG_MACH_NAME_AUX1_0));
- for (uint16_t k = 0; k < (MBF_PAR_UICFG_MACH_NAME_AUX2_0 - MBF_PAR_UICFG_MACH_NAME_AUX1_0); k++) {
+ char sname[(MBF_PAR_UICFG_MACH_NAME_AUX2 - MBF_PAR_UICFG_MACH_NAME_AUX1) * 2 + 1];
+ uint16_t base = MBF_PAR_UICFG_MACH_NAME_AUX1 + ((i - 3) * (MBF_PAR_UICFG_MACH_NAME_AUX2 - MBF_PAR_UICFG_MACH_NAME_AUX1));
+ for (uint16_t k = 0; k < (MBF_PAR_UICFG_MACH_NAME_AUX2 - MBF_PAR_UICFG_MACH_NAME_AUX1); k++) {
uint16_t data = NeoPoolGetData(base + k);
sname[k*2] = (char)(data >> 8);
sname[k*2 + 1] = (char)(data & 0xFF);
@@ -3019,7 +2997,7 @@ void NeopoolCheckChanges(void) {
uint16_t data = NeoPoolGetData(pgm_read_word(NeoPoolRegCheck + i) & 0x0FFF);
if (NeoPoolRegCheckData[i] != data) {
#ifdef DEBUG_TASMOTA_SENSOR
- AddLog(LOG_LEVEL_DEBUG, PSTR("NEO: NeopoolCheckChanges() addr 0x%04X: data stored %d (0x%04X), data read %d (0x%04X)"),
+ AddLog(LOG_LEVEL_DEBUG, PSTR("NEO: NeopoolCheckChanges() addr 0x%04X: data stored %d (0x%04X), data read %d (0x%04X)"),
pgm_read_word(NeoPoolRegCheck + i) & 0x0FFF,
NeoPoolRegCheckData[i], NeoPoolRegCheckData[i],
data, data);
From 3f4b69f91ccce6f9c2669b82092e5f460baca0dc Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Sat, 16 Dec 2023 17:26:58 +0100
Subject: [PATCH 009/303] Improve animation (#20246)
---
.../src/embedded/animate_0_core.be | 22 +
.../src/embedded/animate_9_module.be | 5 +
.../src/solidify/solidified_animate_0_core.h | 1018 +++++++++--------
.../solidify/solidified_animate_9_module.h | 213 ++--
.../xdrv_52_3_berry_leds.ino | 5 +-
5 files changed, 705 insertions(+), 558 deletions(-)
diff --git a/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be b/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be
index 5e91278fe..5809ed3f3 100644
--- a/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be
+++ b/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be
@@ -62,6 +62,28 @@ class Animate_core
self.animators.push(anim)
end
+ # remove a specific animator
+ # remove all animators if no parameter or nil
+ # silently ignores if the animator can't be found
+ def remove_animator(anim)
+ var animators = self.animators
+ if (anim != nil)
+ animators.remove(animators.find(anim))
+ else
+ animators.clear()
+ end
+ end
+
+ def remove_painter(p)
+ var painters = self.painters
+ if (p != nil)
+ painters.remove(painters.find(p))
+ else
+ painters.clear()
+ end
+ end
+
+
def add_painter(painter)
self.painters.push(painter)
end
diff --git a/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be b/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be
index 45f22b81b..aa9ef07e6 100644
--- a/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be
+++ b/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be
@@ -444,6 +444,11 @@ class Animate_oscillator : Animate_animator
self.b = b
end
+ def set_form(form)
+ if (form == nil) form = 1 end
+ self.form = form
+ end
+
def animate(millis)
if (self.duration_ms == nil) return end
if millis == nil millis = tasmota.millis() end
diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h
index d124cc5b3..2221e785c 100644
--- a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h
+++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h
@@ -6,450 +6,6 @@
extern const bclass be_class_Animate_core;
-/********************************************************************
-** Solidified function: remove
-********************************************************************/
-be_local_closure(Animate_core_remove, /* name */
- be_nested_proto(
- 4, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_nested_str_weak(clear),
- /* K1 */ be_nested_str_weak(tasmota),
- /* K2 */ be_nested_str_weak(remove_fast_loop),
- /* K3 */ be_nested_str_weak(fast_loop_cb),
- }),
- be_str_weak(remove),
- &be_const_str_solidified,
- ( &(const binstruction[ 7]) { /* code */
- 0x8C040100, // 0000 GETMET R1 R0 K0
- 0x7C040200, // 0001 CALL R1 1
- 0xB8060200, // 0002 GETNGBL R1 K1
- 0x8C040302, // 0003 GETMET R1 R1 K2
- 0x880C0103, // 0004 GETMBR R3 R0 K3
- 0x7C040400, // 0005 CALL R1 2
- 0x80000000, // 0006 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: add_background_animator
-********************************************************************/
-be_local_closure(Animate_core_add_background_animator, /* name */
- be_nested_proto(
- 6, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 3]) { /* constants */
- /* K0 */ be_nested_str_weak(set_cb),
- /* K1 */ be_nested_str_weak(set_back_color),
- /* K2 */ be_nested_str_weak(add_animator),
- }),
- be_str_weak(add_background_animator),
- &be_const_str_solidified,
- ( &(const binstruction[ 8]) { /* code */
- 0x8C080300, // 0000 GETMET R2 R1 K0
- 0x5C100000, // 0001 MOVE R4 R0
- 0x88140101, // 0002 GETMBR R5 R0 K1
- 0x7C080600, // 0003 CALL R2 3
- 0x8C080102, // 0004 GETMET R2 R0 K2
- 0x5C100200, // 0005 MOVE R4 R1
- 0x7C080400, // 0006 CALL R2 2
- 0x80000000, // 0007 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: clear
-********************************************************************/
-be_local_closure(Animate_core_clear, /* name */
- be_nested_proto(
- 3, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 3]) { /* constants */
- /* K0 */ be_nested_str_weak(stop),
- /* K1 */ be_nested_str_weak(strip),
- /* K2 */ be_nested_str_weak(clear),
- }),
- be_str_weak(clear),
- &be_const_str_solidified,
- ( &(const binstruction[ 6]) { /* code */
- 0x8C040100, // 0000 GETMET R1 R0 K0
- 0x7C040200, // 0001 CALL R1 1
- 0x88040101, // 0002 GETMBR R1 R0 K1
- 0x8C040302, // 0003 GETMET R1 R1 K2
- 0x7C040200, // 0004 CALL R1 1
- 0x80000000, // 0005 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: add_animator
-********************************************************************/
-be_local_closure(Animate_core_add_animator, /* name */
- be_nested_proto(
- 5, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(animators),
- /* K1 */ be_nested_str_weak(push),
- }),
- be_str_weak(add_animator),
- &be_const_str_solidified,
- ( &(const binstruction[ 5]) { /* code */
- 0x88080100, // 0000 GETMBR R2 R0 K0
- 0x8C080501, // 0001 GETMET R2 R2 K1
- 0x5C100200, // 0002 MOVE R4 R1
- 0x7C080400, // 0003 CALL R2 2
- 0x80000000, // 0004 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: animate
-********************************************************************/
-be_local_closure(Animate_core_animate, /* name */
- be_nested_proto(
- 1, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 0, /* has constants */
- NULL, /* no const */
- be_str_weak(animate),
- &be_const_str_solidified,
- ( &(const binstruction[ 1]) { /* code */
- 0x80000000, // 0000 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: set_bri
-********************************************************************/
-be_local_closure(Animate_core_set_bri, /* name */
- be_nested_proto(
- 2, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(bri),
- }),
- be_str_weak(set_bri),
- &be_const_str_solidified,
- ( &(const binstruction[ 2]) { /* code */
- 0x90020001, // 0000 SETMBR R0 K0 R1
- 0x80000000, // 0001 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: stop
-********************************************************************/
-be_local_closure(Animate_core_stop, /* name */
- be_nested_proto(
- 6, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 8]) { /* constants */
- /* K0 */ be_nested_str_weak(running),
- /* K1 */ be_nested_str_weak(animators),
- /* K2 */ be_const_int(0),
- /* K3 */ be_nested_str_weak(stop),
- /* K4 */ be_const_int(1),
- /* K5 */ be_nested_str_weak(tasmota),
- /* K6 */ be_nested_str_weak(remove_fast_loop),
- /* K7 */ be_nested_str_weak(fast_loop_cb),
- }),
- be_str_weak(stop),
- &be_const_str_solidified,
- ( &(const binstruction[19]) { /* code */
- 0x50040000, // 0000 LDBOOL R1 0 0
- 0x90020001, // 0001 SETMBR R0 K0 R1
- 0x88040101, // 0002 GETMBR R1 R0 K1
- 0x58080002, // 0003 LDCONST R2 K2
- 0x600C000C, // 0004 GETGBL R3 G12
- 0x5C100200, // 0005 MOVE R4 R1
- 0x7C0C0200, // 0006 CALL R3 1
- 0x140C0403, // 0007 LT R3 R2 R3
- 0x780E0004, // 0008 JMPF R3 #000E
- 0x940C0202, // 0009 GETIDX R3 R1 R2
- 0x8C0C0703, // 000A GETMET R3 R3 K3
- 0x7C0C0200, // 000B CALL R3 1
- 0x00080504, // 000C ADD R2 R2 K4
- 0x7001FFF5, // 000D JMP #0004
- 0xB80E0A00, // 000E GETNGBL R3 K5
- 0x8C0C0706, // 000F GETMET R3 R3 K6
- 0x88140107, // 0010 GETMBR R5 R0 K7
- 0x7C0C0400, // 0011 CALL R3 2
- 0x80000000, // 0012 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: set_back_color
-********************************************************************/
-be_local_closure(Animate_core_set_back_color, /* name */
- be_nested_proto(
- 2, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(back_color),
- }),
- be_str_weak(set_back_color),
- &be_const_str_solidified,
- ( &(const binstruction[ 2]) { /* code */
- 0x90020001, // 0000 SETMBR R0 K0 R1
- 0x80000000, // 0001 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: set_cb
-********************************************************************/
-be_local_closure(Animate_core_set_cb, /* name */
- be_nested_proto(
- 3, /* nstack */
- 3, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(obj),
- /* K1 */ be_nested_str_weak(mth),
- }),
- be_str_weak(set_cb),
- &be_const_str_solidified,
- ( &(const binstruction[ 3]) { /* code */
- 0x90020001, // 0000 SETMBR R0 K0 R1
- 0x90020202, // 0001 SETMBR R0 K1 R2
- 0x80000000, // 0002 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: init
-********************************************************************/
-be_local_closure(Animate_core_init, /* name */
- be_nested_proto(
- 7, /* nstack */
- 3, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 1, /* has sup protos */
- ( &(const struct bproto*[ 1]) {
- be_nested_proto(
- 2, /* nstack */
- 0, /* argc */
- 0, /* varg */
- 1, /* has upvals */
- ( &(const bupvaldesc[ 1]) { /* upvals */
- be_local_const_upval(1, 0),
- }),
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(fast_loop),
- }),
- be_str_weak(_anonymous_),
- &be_const_str_solidified,
- ( &(const binstruction[ 4]) { /* code */
- 0x68000000, // 0000 GETUPV R0 U0
- 0x8C000100, // 0001 GETMET R0 R0 K0
- 0x7C000200, // 0002 CALL R0 1
- 0x80000000, // 0003 RET 0
- })
- ),
- }),
- 1, /* has constants */
- ( &(const bvalue[13]) { /* constants */
- /* K0 */ be_nested_str_weak(animate),
- /* K1 */ be_nested_str_weak(strip),
- /* K2 */ be_nested_str_weak(bri),
- /* K3 */ be_nested_str_weak(running),
- /* K4 */ be_nested_str_weak(pixel_count),
- /* K5 */ be_nested_str_weak(animators),
- /* K6 */ be_nested_str_weak(painters),
- /* K7 */ be_nested_str_weak(clear),
- /* K8 */ be_nested_str_weak(frame),
- /* K9 */ be_nested_str_weak(layer),
- /* K10 */ be_nested_str_weak(fast_loop_cb),
- /* K11 */ be_nested_str_weak(back_color),
- /* K12 */ be_const_int(0),
- }),
- be_str_weak(init),
- &be_const_str_solidified,
- ( &(const binstruction[33]) { /* code */
- 0xA40E0000, // 0000 IMPORT R3 K0
- 0x90020201, // 0001 SETMBR R0 K1 R1
- 0x4C100000, // 0002 LDNIL R4
- 0x1C100404, // 0003 EQ R4 R2 R4
- 0x78120000, // 0004 JMPF R4 #0006
- 0x540A0031, // 0005 LDINT R2 50
- 0x90020402, // 0006 SETMBR R0 K2 R2
- 0x50100000, // 0007 LDBOOL R4 0 0
- 0x90020604, // 0008 SETMBR R0 K3 R4
- 0x8C100304, // 0009 GETMET R4 R1 K4
- 0x7C100200, // 000A CALL R4 1
- 0x90020804, // 000B SETMBR R0 K4 R4
- 0x60100012, // 000C GETGBL R4 G18
- 0x7C100000, // 000D CALL R4 0
- 0x90020A04, // 000E SETMBR R0 K5 R4
- 0x60100012, // 000F GETGBL R4 G18
- 0x7C100000, // 0010 CALL R4 0
- 0x90020C04, // 0011 SETMBR R0 K6 R4
- 0x8C100107, // 0012 GETMET R4 R0 K7
- 0x7C100200, // 0013 CALL R4 1
- 0x8C100708, // 0014 GETMET R4 R3 K8
- 0x88180104, // 0015 GETMBR R6 R0 K4
- 0x7C100400, // 0016 CALL R4 2
- 0x90021004, // 0017 SETMBR R0 K8 R4
- 0x8C100708, // 0018 GETMET R4 R3 K8
- 0x88180104, // 0019 GETMBR R6 R0 K4
- 0x7C100400, // 001A CALL R4 2
- 0x90021204, // 001B SETMBR R0 K9 R4
- 0x84100000, // 001C CLOSURE R4 P0
- 0x90021404, // 001D SETMBR R0 K10 R4
- 0x9002170C, // 001E SETMBR R0 K11 K12
- 0xA0000000, // 001F CLOSE R0
- 0x80000000, // 0020 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: add_painter
-********************************************************************/
-be_local_closure(Animate_core_add_painter, /* name */
- be_nested_proto(
- 5, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(painters),
- /* K1 */ be_nested_str_weak(push),
- }),
- be_str_weak(add_painter),
- &be_const_str_solidified,
- ( &(const binstruction[ 5]) { /* code */
- 0x88080100, // 0000 GETMBR R2 R0 K0
- 0x8C080501, // 0001 GETMET R2 R2 K1
- 0x5C100200, // 0002 MOVE R4 R1
- 0x7C080400, // 0003 CALL R2 2
- 0x80000000, // 0004 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: get_bri
-********************************************************************/
-be_local_closure(Animate_core_get_bri, /* name */
- be_nested_proto(
- 3, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(bri),
- }),
- be_str_weak(get_bri),
- &be_const_str_solidified,
- ( &(const binstruction[ 2]) { /* code */
- 0x88080100, // 0000 GETMBR R2 R0 K0
- 0x80040400, // 0001 RET 1 R2
- })
- )
-);
-/*******************************************************************/
-
-
/********************************************************************
** Solidified function: fast_loop
********************************************************************/
@@ -583,6 +139,189 @@ be_local_closure(Animate_core_fast_loop, /* name */
/*******************************************************************/
+/********************************************************************
+** Solidified function: add_animator
+********************************************************************/
+be_local_closure(Animate_core_add_animator, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(animators),
+ /* K1 */ be_nested_str_weak(push),
+ }),
+ be_str_weak(add_animator),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 5]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x8C080501, // 0001 GETMET R2 R2 K1
+ 0x5C100200, // 0002 MOVE R4 R1
+ 0x7C080400, // 0003 CALL R2 2
+ 0x80000000, // 0004 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: remove_painter
+********************************************************************/
+be_local_closure(Animate_core_remove_painter, /* name */
+ be_nested_proto(
+ 8, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(painters),
+ /* K1 */ be_nested_str_weak(remove),
+ /* K2 */ be_nested_str_weak(find),
+ /* K3 */ be_nested_str_weak(clear),
+ }),
+ be_str_weak(remove_painter),
+ &be_const_str_solidified,
+ ( &(const binstruction[13]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x4C0C0000, // 0001 LDNIL R3
+ 0x200C0203, // 0002 NE R3 R1 R3
+ 0x780E0005, // 0003 JMPF R3 #000A
+ 0x8C0C0501, // 0004 GETMET R3 R2 K1
+ 0x8C140502, // 0005 GETMET R5 R2 K2
+ 0x5C1C0200, // 0006 MOVE R7 R1
+ 0x7C140400, // 0007 CALL R5 2
+ 0x7C0C0400, // 0008 CALL R3 2
+ 0x70020001, // 0009 JMP #000C
+ 0x8C0C0503, // 000A GETMET R3 R2 K3
+ 0x7C0C0200, // 000B CALL R3 1
+ 0x80000000, // 000C RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: remove_animator
+********************************************************************/
+be_local_closure(Animate_core_remove_animator, /* name */
+ be_nested_proto(
+ 8, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(animators),
+ /* K1 */ be_nested_str_weak(remove),
+ /* K2 */ be_nested_str_weak(find),
+ /* K3 */ be_nested_str_weak(clear),
+ }),
+ be_str_weak(remove_animator),
+ &be_const_str_solidified,
+ ( &(const binstruction[13]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x4C0C0000, // 0001 LDNIL R3
+ 0x200C0203, // 0002 NE R3 R1 R3
+ 0x780E0005, // 0003 JMPF R3 #000A
+ 0x8C0C0501, // 0004 GETMET R3 R2 K1
+ 0x8C140502, // 0005 GETMET R5 R2 K2
+ 0x5C1C0200, // 0006 MOVE R7 R1
+ 0x7C140400, // 0007 CALL R5 2
+ 0x7C0C0400, // 0008 CALL R3 2
+ 0x70020001, // 0009 JMP #000C
+ 0x8C0C0503, // 000A GETMET R3 R2 K3
+ 0x7C0C0200, // 000B CALL R3 1
+ 0x80000000, // 000C RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: remove
+********************************************************************/
+be_local_closure(Animate_core_remove, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(clear),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(remove_fast_loop),
+ /* K3 */ be_nested_str_weak(fast_loop_cb),
+ }),
+ be_str_weak(remove),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 7]) { /* code */
+ 0x8C040100, // 0000 GETMET R1 R0 K0
+ 0x7C040200, // 0001 CALL R1 1
+ 0xB8060200, // 0002 GETNGBL R1 K1
+ 0x8C040302, // 0003 GETMET R1 R1 K2
+ 0x880C0103, // 0004 GETMBR R3 R0 K3
+ 0x7C040400, // 0005 CALL R1 2
+ 0x80000000, // 0006 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: add_background_animator
+********************************************************************/
+be_local_closure(Animate_core_add_background_animator, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(set_cb),
+ /* K1 */ be_nested_str_weak(set_back_color),
+ /* K2 */ be_nested_str_weak(add_animator),
+ }),
+ be_str_weak(add_background_animator),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 8]) { /* code */
+ 0x8C080300, // 0000 GETMET R2 R1 K0
+ 0x5C100000, // 0001 MOVE R4 R0
+ 0x88140101, // 0002 GETMBR R5 R0 K1
+ 0x7C080600, // 0003 CALL R2 3
+ 0x8C080102, // 0004 GETMET R2 R0 K2
+ 0x5C100200, // 0005 MOVE R4 R1
+ 0x7C080400, // 0006 CALL R2 2
+ 0x80000000, // 0007 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
/********************************************************************
** Solidified function: start
********************************************************************/
@@ -636,42 +375,387 @@ be_local_closure(Animate_core_start, /* name */
/*******************************************************************/
+/********************************************************************
+** Solidified function: clear
+********************************************************************/
+be_local_closure(Animate_core_clear, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(stop),
+ /* K1 */ be_nested_str_weak(strip),
+ /* K2 */ be_nested_str_weak(clear),
+ }),
+ be_str_weak(clear),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 6]) { /* code */
+ 0x8C040100, // 0000 GETMET R1 R0 K0
+ 0x7C040200, // 0001 CALL R1 1
+ 0x88040101, // 0002 GETMBR R1 R0 K1
+ 0x8C040302, // 0003 GETMET R1 R1 K2
+ 0x7C040200, // 0004 CALL R1 1
+ 0x80000000, // 0005 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: init
+********************************************************************/
+be_local_closure(Animate_core_init, /* name */
+ be_nested_proto(
+ 7, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 1, /* has sup protos */
+ ( &(const struct bproto*[ 1]) {
+ be_nested_proto(
+ 2, /* nstack */
+ 0, /* argc */
+ 0, /* varg */
+ 1, /* has upvals */
+ ( &(const bupvaldesc[ 1]) { /* upvals */
+ be_local_const_upval(1, 0),
+ }),
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(fast_loop),
+ }),
+ be_str_weak(_anonymous_),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 4]) { /* code */
+ 0x68000000, // 0000 GETUPV R0 U0
+ 0x8C000100, // 0001 GETMET R0 R0 K0
+ 0x7C000200, // 0002 CALL R0 1
+ 0x80000000, // 0003 RET 0
+ })
+ ),
+ }),
+ 1, /* has constants */
+ ( &(const bvalue[13]) { /* constants */
+ /* K0 */ be_nested_str_weak(animate),
+ /* K1 */ be_nested_str_weak(strip),
+ /* K2 */ be_nested_str_weak(bri),
+ /* K3 */ be_nested_str_weak(running),
+ /* K4 */ be_nested_str_weak(pixel_count),
+ /* K5 */ be_nested_str_weak(animators),
+ /* K6 */ be_nested_str_weak(painters),
+ /* K7 */ be_nested_str_weak(clear),
+ /* K8 */ be_nested_str_weak(frame),
+ /* K9 */ be_nested_str_weak(layer),
+ /* K10 */ be_nested_str_weak(fast_loop_cb),
+ /* K11 */ be_nested_str_weak(back_color),
+ /* K12 */ be_const_int(0),
+ }),
+ be_str_weak(init),
+ &be_const_str_solidified,
+ ( &(const binstruction[33]) { /* code */
+ 0xA40E0000, // 0000 IMPORT R3 K0
+ 0x90020201, // 0001 SETMBR R0 K1 R1
+ 0x4C100000, // 0002 LDNIL R4
+ 0x1C100404, // 0003 EQ R4 R2 R4
+ 0x78120000, // 0004 JMPF R4 #0006
+ 0x540A0031, // 0005 LDINT R2 50
+ 0x90020402, // 0006 SETMBR R0 K2 R2
+ 0x50100000, // 0007 LDBOOL R4 0 0
+ 0x90020604, // 0008 SETMBR R0 K3 R4
+ 0x8C100304, // 0009 GETMET R4 R1 K4
+ 0x7C100200, // 000A CALL R4 1
+ 0x90020804, // 000B SETMBR R0 K4 R4
+ 0x60100012, // 000C GETGBL R4 G18
+ 0x7C100000, // 000D CALL R4 0
+ 0x90020A04, // 000E SETMBR R0 K5 R4
+ 0x60100012, // 000F GETGBL R4 G18
+ 0x7C100000, // 0010 CALL R4 0
+ 0x90020C04, // 0011 SETMBR R0 K6 R4
+ 0x8C100107, // 0012 GETMET R4 R0 K7
+ 0x7C100200, // 0013 CALL R4 1
+ 0x8C100708, // 0014 GETMET R4 R3 K8
+ 0x88180104, // 0015 GETMBR R6 R0 K4
+ 0x7C100400, // 0016 CALL R4 2
+ 0x90021004, // 0017 SETMBR R0 K8 R4
+ 0x8C100708, // 0018 GETMET R4 R3 K8
+ 0x88180104, // 0019 GETMBR R6 R0 K4
+ 0x7C100400, // 001A CALL R4 2
+ 0x90021204, // 001B SETMBR R0 K9 R4
+ 0x84100000, // 001C CLOSURE R4 P0
+ 0x90021404, // 001D SETMBR R0 K10 R4
+ 0x9002170C, // 001E SETMBR R0 K11 K12
+ 0xA0000000, // 001F CLOSE R0
+ 0x80000000, // 0020 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: stop
+********************************************************************/
+be_local_closure(Animate_core_stop, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 8]) { /* constants */
+ /* K0 */ be_nested_str_weak(running),
+ /* K1 */ be_nested_str_weak(animators),
+ /* K2 */ be_const_int(0),
+ /* K3 */ be_nested_str_weak(stop),
+ /* K4 */ be_const_int(1),
+ /* K5 */ be_nested_str_weak(tasmota),
+ /* K6 */ be_nested_str_weak(remove_fast_loop),
+ /* K7 */ be_nested_str_weak(fast_loop_cb),
+ }),
+ be_str_weak(stop),
+ &be_const_str_solidified,
+ ( &(const binstruction[19]) { /* code */
+ 0x50040000, // 0000 LDBOOL R1 0 0
+ 0x90020001, // 0001 SETMBR R0 K0 R1
+ 0x88040101, // 0002 GETMBR R1 R0 K1
+ 0x58080002, // 0003 LDCONST R2 K2
+ 0x600C000C, // 0004 GETGBL R3 G12
+ 0x5C100200, // 0005 MOVE R4 R1
+ 0x7C0C0200, // 0006 CALL R3 1
+ 0x140C0403, // 0007 LT R3 R2 R3
+ 0x780E0004, // 0008 JMPF R3 #000E
+ 0x940C0202, // 0009 GETIDX R3 R1 R2
+ 0x8C0C0703, // 000A GETMET R3 R3 K3
+ 0x7C0C0200, // 000B CALL R3 1
+ 0x00080504, // 000C ADD R2 R2 K4
+ 0x7001FFF5, // 000D JMP #0004
+ 0xB80E0A00, // 000E GETNGBL R3 K5
+ 0x8C0C0706, // 000F GETMET R3 R3 K6
+ 0x88140107, // 0010 GETMBR R5 R0 K7
+ 0x7C0C0400, // 0011 CALL R3 2
+ 0x80000000, // 0012 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: animate
+********************************************************************/
+be_local_closure(Animate_core_animate, /* name */
+ be_nested_proto(
+ 1, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 0, /* has constants */
+ NULL, /* no const */
+ be_str_weak(animate),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 1]) { /* code */
+ 0x80000000, // 0000 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_cb
+********************************************************************/
+be_local_closure(Animate_core_set_cb, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(obj),
+ /* K1 */ be_nested_str_weak(mth),
+ }),
+ be_str_weak(set_cb),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 3]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x90020202, // 0001 SETMBR R0 K1 R2
+ 0x80000000, // 0002 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: add_painter
+********************************************************************/
+be_local_closure(Animate_core_add_painter, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(painters),
+ /* K1 */ be_nested_str_weak(push),
+ }),
+ be_str_weak(add_painter),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 5]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x8C080501, // 0001 GETMET R2 R2 K1
+ 0x5C100200, // 0002 MOVE R4 R1
+ 0x7C080400, // 0003 CALL R2 2
+ 0x80000000, // 0004 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: get_bri
+********************************************************************/
+be_local_closure(Animate_core_get_bri, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(bri),
+ }),
+ be_str_weak(get_bri),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x80040400, // 0001 RET 1 R2
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_back_color
+********************************************************************/
+be_local_closure(Animate_core_set_back_color, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(back_color),
+ }),
+ be_str_weak(set_back_color),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_bri
+********************************************************************/
+be_local_closure(Animate_core_set_bri, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(bri),
+ }),
+ be_str_weak(set_bri),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
/********************************************************************
** Solidified class: Animate_core
********************************************************************/
be_local_class(Animate_core,
13,
NULL,
- be_nested_map(28,
+ be_nested_map(30,
( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(bri, 8), be_const_var(2) },
- { be_const_key_weak(remove, -1), be_const_closure(Animate_core_remove_closure) },
- { be_const_key_weak(start, 11), be_const_closure(Animate_core_start_closure) },
- { be_const_key_weak(fast_loop, -1), be_const_closure(Animate_core_fast_loop_closure) },
- { be_const_key_weak(add_animator, -1), be_const_closure(Animate_core_add_animator_closure) },
- { be_const_key_weak(FAST_LOOP_MIN, 9), be_const_int(20) },
- { be_const_key_weak(obj, -1), be_const_var(8) },
+ { be_const_key_weak(running, -1), be_const_var(3) },
{ be_const_key_weak(pixel_count, -1), be_const_var(1) },
- { be_const_key_weak(animate, -1), be_const_closure(Animate_core_animate_closure) },
- { be_const_key_weak(animators, -1), be_const_var(4) },
- { be_const_key_weak(fast_loop_cb, -1), be_const_var(6) },
- { be_const_key_weak(get_bri, 24), be_const_closure(Animate_core_get_bri_closure) },
- { be_const_key_weak(back_color, 13), be_const_var(12) },
+ { be_const_key_weak(fast_loop, -1), be_const_closure(Animate_core_fast_loop_closure) },
+ { be_const_key_weak(animators, 8), be_const_var(4) },
+ { be_const_key_weak(fast_loop_cb, 7), be_const_var(6) },
+ { be_const_key_weak(set_back_color, 26), be_const_closure(Animate_core_set_back_color_closure) },
+ { be_const_key_weak(add_animator, -1), be_const_closure(Animate_core_add_animator_closure) },
{ be_const_key_weak(frame, -1), be_const_var(10) },
- { be_const_key_weak(set_cb, 23), be_const_closure(Animate_core_set_cb_closure) },
+ { be_const_key_weak(strip, 27), be_const_var(0) },
+ { be_const_key_weak(remove_animator, 5), be_const_closure(Animate_core_remove_animator_closure) },
{ be_const_key_weak(init, -1), be_const_closure(Animate_core_init_closure) },
- { be_const_key_weak(running, 21), be_const_var(3) },
- { be_const_key_weak(strip, 14), be_const_var(0) },
- { be_const_key_weak(fast_loop_next, -1), be_const_var(7) },
- { be_const_key_weak(set_back_color, 15), be_const_closure(Animate_core_set_back_color_closure) },
- { be_const_key_weak(add_painter, -1), be_const_closure(Animate_core_add_painter_closure) },
+ { be_const_key_weak(start, -1), be_const_closure(Animate_core_start_closure) },
{ be_const_key_weak(mth, -1), be_const_var(9) },
- { be_const_key_weak(layer, 12), be_const_var(11) },
+ { be_const_key_weak(add_painter, -1), be_const_closure(Animate_core_add_painter_closure) },
+ { be_const_key_weak(clear, -1), be_const_closure(Animate_core_clear_closure) },
+ { be_const_key_weak(remove_painter, 23), be_const_closure(Animate_core_remove_painter_closure) },
+ { be_const_key_weak(layer, -1), be_const_var(11) },
{ be_const_key_weak(stop, -1), be_const_closure(Animate_core_stop_closure) },
+ { be_const_key_weak(fast_loop_next, 16), be_const_var(7) },
+ { be_const_key_weak(FAST_LOOP_MIN, -1), be_const_int(20) },
+ { be_const_key_weak(animate, -1), be_const_closure(Animate_core_animate_closure) },
+ { be_const_key_weak(back_color, -1), be_const_var(12) },
+ { be_const_key_weak(obj, 21), be_const_var(8) },
+ { be_const_key_weak(set_cb, 10), be_const_closure(Animate_core_set_cb_closure) },
+ { be_const_key_weak(bri, 13), be_const_var(2) },
+ { be_const_key_weak(get_bri, -1), be_const_closure(Animate_core_get_bri_closure) },
+ { be_const_key_weak(painters, 28), be_const_var(5) },
+ { be_const_key_weak(add_background_animator, 1), be_const_closure(Animate_core_add_background_animator_closure) },
+ { be_const_key_weak(remove, -1), be_const_closure(Animate_core_remove_closure) },
{ be_const_key_weak(set_bri, -1), be_const_closure(Animate_core_set_bri_closure) },
- { be_const_key_weak(painters, -1), be_const_var(5) },
- { be_const_key_weak(clear, 3), be_const_closure(Animate_core_clear_closure) },
- { be_const_key_weak(add_background_animator, 2), be_const_closure(Animate_core_add_background_animator_closure) },
})),
be_str_weak(Animate_core)
);
diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_9_module.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_9_module.h
index a337b5f82..a1def1f3d 100644
--- a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_9_module.h
+++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_9_module.h
@@ -1106,11 +1106,11 @@ void be_load_Animate_palette_class(bvm *vm) {
extern const bclass be_class_Animate_oscillator;
/********************************************************************
-** Solidified function: set_b
+** Solidified function: set_duty_cycle
********************************************************************/
-be_local_closure(Animate_oscillator_set_b, /* name */
+be_local_closure(Animate_oscillator_set_duty_cycle, /* name */
be_nested_proto(
- 2, /* nstack */
+ 3, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
@@ -1118,14 +1118,22 @@ be_local_closure(Animate_oscillator_set_b, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(b),
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_const_int(0),
+ /* K1 */ be_nested_str_weak(duty_cycle),
}),
- be_str_weak(set_b),
+ be_str_weak(set_duty_cycle),
&be_const_str_solidified,
- ( &(const binstruction[ 2]) { /* code */
- 0x90020001, // 0000 SETMBR R0 K0 R1
- 0x80000000, // 0001 RET 0
+ ( &(const binstruction[ 9]) { /* code */
+ 0x14080300, // 0000 LT R2 R1 K0
+ 0x780A0000, // 0001 JMPF R2 #0003
+ 0x58040000, // 0002 LDCONST R1 K0
+ 0x540A0063, // 0003 LDINT R2 100
+ 0x24080202, // 0004 GT R2 R1 R2
+ 0x780A0000, // 0005 JMPF R2 #0007
+ 0x54060063, // 0006 LDINT R1 100
+ 0x90020201, // 0007 SETMBR R0 K1 R1
+ 0x80000000, // 0008 RET 0
})
)
);
@@ -1159,6 +1167,100 @@ be_local_closure(Animate_oscillator_set_a, /* name */
/*******************************************************************/
+/********************************************************************
+** Solidified function: set_b
+********************************************************************/
+be_local_closure(Animate_oscillator_set_b, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(b),
+ }),
+ be_str_weak(set_b),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_form
+********************************************************************/
+be_local_closure(Animate_oscillator_set_form, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_const_int(1),
+ /* K1 */ be_nested_str_weak(form),
+ }),
+ be_str_weak(set_form),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 6]) { /* code */
+ 0x4C080000, // 0000 LDNIL R2
+ 0x1C080202, // 0001 EQ R2 R1 R2
+ 0x780A0000, // 0002 JMPF R2 #0004
+ 0x58040000, // 0003 LDCONST R1 K0
+ 0x90020201, // 0004 SETMBR R0 K1 R1
+ 0x80000000, // 0005 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_phase
+********************************************************************/
+be_local_closure(Animate_oscillator_set_phase, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_const_int(0),
+ /* K1 */ be_nested_str_weak(phase),
+ }),
+ be_str_weak(set_phase),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 9]) { /* code */
+ 0x14080300, // 0000 LT R2 R1 K0
+ 0x780A0000, // 0001 JMPF R2 #0003
+ 0x58040000, // 0002 LDCONST R1 K0
+ 0x540A0063, // 0003 LDINT R2 100
+ 0x24080202, // 0004 GT R2 R1 R2
+ 0x780A0000, // 0005 JMPF R2 #0007
+ 0x54060063, // 0006 LDINT R1 100
+ 0x90020201, // 0007 SETMBR R0 K1 R1
+ 0x80000000, // 0008 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
/********************************************************************
** Solidified function: init
********************************************************************/
@@ -1400,76 +1502,6 @@ be_local_closure(Animate_oscillator_animate, /* name */
/*******************************************************************/
-/********************************************************************
-** Solidified function: set_duty_cycle
-********************************************************************/
-be_local_closure(Animate_oscillator_set_duty_cycle, /* name */
- be_nested_proto(
- 3, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_const_int(0),
- /* K1 */ be_nested_str_weak(duty_cycle),
- }),
- be_str_weak(set_duty_cycle),
- &be_const_str_solidified,
- ( &(const binstruction[ 9]) { /* code */
- 0x14080300, // 0000 LT R2 R1 K0
- 0x780A0000, // 0001 JMPF R2 #0003
- 0x58040000, // 0002 LDCONST R1 K0
- 0x540A0063, // 0003 LDINT R2 100
- 0x24080202, // 0004 GT R2 R1 R2
- 0x780A0000, // 0005 JMPF R2 #0007
- 0x54060063, // 0006 LDINT R1 100
- 0x90020201, // 0007 SETMBR R0 K1 R1
- 0x80000000, // 0008 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: set_phase
-********************************************************************/
-be_local_closure(Animate_oscillator_set_phase, /* name */
- be_nested_proto(
- 3, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_const_int(0),
- /* K1 */ be_nested_str_weak(phase),
- }),
- be_str_weak(set_phase),
- &be_const_str_solidified,
- ( &(const binstruction[ 9]) { /* code */
- 0x14080300, // 0000 LT R2 R1 K0
- 0x780A0000, // 0001 JMPF R2 #0003
- 0x58040000, // 0002 LDCONST R1 K0
- 0x540A0063, // 0003 LDINT R2 100
- 0x24080202, // 0004 GT R2 R1 R2
- 0x780A0000, // 0005 JMPF R2 #0007
- 0x54060063, // 0006 LDINT R1 100
- 0x90020201, // 0007 SETMBR R0 K1 R1
- 0x80000000, // 0008 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
/********************************************************************
** Solidified class: Animate_oscillator
********************************************************************/
@@ -1477,20 +1509,21 @@ extern const bclass be_class_Animate_animator;
be_local_class(Animate_oscillator,
6,
&be_class_Animate_animator,
- be_nested_map(12,
+ be_nested_map(13,
( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(phase, -1), be_const_var(0) },
- { be_const_key_weak(b, -1), be_const_var(3) },
- { be_const_key_weak(set_b, -1), be_const_closure(Animate_oscillator_set_b_closure) },
- { be_const_key_weak(set_a, 10), be_const_closure(Animate_oscillator_set_a_closure) },
+ { be_const_key_weak(animate, -1), be_const_closure(Animate_oscillator_animate_closure) },
{ be_const_key_weak(a, -1), be_const_var(2) },
- { be_const_key_weak(set_phase, -1), be_const_closure(Animate_oscillator_set_phase_closure) },
+ { be_const_key_weak(init, 11), be_const_closure(Animate_oscillator_init_closure) },
+ { be_const_key_weak(duty_cycle, 10), be_const_var(1) },
+ { be_const_key_weak(b, -1), be_const_var(3) },
{ be_const_key_weak(value, -1), be_const_var(5) },
- { be_const_key_weak(duty_cycle, -1), be_const_var(1) },
- { be_const_key_weak(animate, 7), be_const_closure(Animate_oscillator_animate_closure) },
- { be_const_key_weak(set_duty_cycle, -1), be_const_closure(Animate_oscillator_set_duty_cycle_closure) },
- { be_const_key_weak(init, -1), be_const_closure(Animate_oscillator_init_closure) },
- { be_const_key_weak(form, 5), be_const_var(4) },
+ { be_const_key_weak(set_duty_cycle, 2), be_const_closure(Animate_oscillator_set_duty_cycle_closure) },
+ { be_const_key_weak(set_a, -1), be_const_closure(Animate_oscillator_set_a_closure) },
+ { be_const_key_weak(set_b, -1), be_const_closure(Animate_oscillator_set_b_closure) },
+ { be_const_key_weak(set_form, -1), be_const_closure(Animate_oscillator_set_form_closure) },
+ { be_const_key_weak(phase, -1), be_const_var(0) },
+ { be_const_key_weak(form, -1), be_const_var(4) },
+ { be_const_key_weak(set_phase, 0), be_const_closure(Animate_oscillator_set_phase_closure) },
})),
be_str_weak(Animate_oscillator)
);
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_leds.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_leds.ino
index 47d80c98f..9ac9c4c45 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_leds.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_leds.ino
@@ -348,13 +348,16 @@ extern "C" {
uint32_t r = (color_a >> 16) & 0xFF;
uint32_t g = (color_a >> 8) & 0xFF;
uint32_t b = (color_a ) & 0xFF;
+ uint32_t a = (color_a >> 24) & 0xFF;
uint32_t r2 = (color_b >> 16) & 0xFF;
uint32_t g2 = (color_b >> 8) & 0xFF;
uint32_t b2 = (color_b ) & 0xFF;
+ uint32_t a2 = (color_b >> 24) & 0xFF;
uint32_t r3 = changeUIntScale(alpha, 0, 255, r2, r);
uint32_t g3 = changeUIntScale(alpha, 0, 255, g2, g);
uint32_t b3 = changeUIntScale(alpha, 0, 255, b2, b);
- uint32_t rgb = (r3 << 16) | (g3 << 8) | b3;
+ uint32_t a3 = changeUIntScale(alpha, 0, 255, a2, a);
+ uint32_t rgb = (a3 << 24) | (r3 << 16) | (g3 << 8) | b3;
be_pushint(vm, rgb);
be_return(vm);
}
From 7c290388d9ca70501536d0939178d574890567d8 Mon Sep 17 00:00:00 2001
From: Barbudor
Date: Sat, 16 Dec 2023 18:23:51 +0100
Subject: [PATCH 010/303] Sonoff Basic R4 Magic switch (#20247)
* magic switch take 1
* good to go
* good to go
* final, including in tasmota32c3
---
.../include/tasmota_configurations_ESP32.h | 3 +
tasmota/include/tasmota_template.h | 7 +
tasmota/language/af_AF.h | 3 +-
tasmota/language/bg_BG.h | 1 +
tasmota/language/ca_AD.h | 1 +
tasmota/language/cs_CZ.h | 1 +
tasmota/language/de_DE.h | 1 +
tasmota/language/el_GR.h | 1 +
tasmota/language/en_GB.h | 1 +
tasmota/language/es_ES.h | 1 +
tasmota/language/fr_FR.h | 1 +
tasmota/language/fy_NL.h | 1 +
tasmota/language/he_HE.h | 1 +
tasmota/language/hu_HU.h | 1 +
tasmota/language/it_IT.h | 3 +-
tasmota/language/ko_KO.h | 1 +
tasmota/language/nl_NL.h | 1 +
tasmota/language/pl_PL.h | 1 +
tasmota/language/pt_BR.h | 1 +
tasmota/language/pt_PT.h | 1 +
tasmota/language/ro_RO.h | 1 +
tasmota/language/ru_RU.h | 1 +
tasmota/language/sk_SK.h | 1 +
tasmota/language/sv_SE.h | 1 +
tasmota/language/tr_TR.h | 1 +
tasmota/language/uk_UA.h | 1 +
tasmota/language/vi_VN.h | 1 +
tasmota/language/zh_CN.h | 1 +
tasmota/language/zh_TW.h | 1 +
tasmota/my_user_config.h | 3 +
.../xdrv_91_magic_switch.ino | 187 ++++++++++++++++++
31 files changed, 229 insertions(+), 2 deletions(-)
create mode 100644 tasmota/tasmota_xdrv_driver/xdrv_91_magic_switch.ino
diff --git a/tasmota/include/tasmota_configurations_ESP32.h b/tasmota/include/tasmota_configurations_ESP32.h
index 4a9716d16..06891b607 100644
--- a/tasmota/include/tasmota_configurations_ESP32.h
+++ b/tasmota/include/tasmota_configurations_ESP32.h
@@ -606,6 +606,9 @@
#define USE_LIGHT_PALETTE // Add support for color palette (+0k9 code)
#define USE_LIGHT_ARTNET // Add support for DMX/ArtNet via UDP on port 6454 (+3.5k code)
+#ifdef CONFIG_IDF_TARGET_ESP32C3
+#define USE_MAGIC_SWITCH // Add Sonoff MagicSwitch support as implemented in Sonoff Basic R4
+#endif
#define USE_DS18x20 // Add support for DS18x20 sensors with id sort, single scan and read retry (+1k3 code)
diff --git a/tasmota/include/tasmota_template.h b/tasmota/include/tasmota_template.h
index 260e59a46..63779e918 100644
--- a/tasmota/include/tasmota_template.h
+++ b/tasmota/include/tasmota_template.h
@@ -214,6 +214,7 @@ enum UserSelectablePins {
GPIO_HDMI_CEC, // Support for HDMI CEC
GPIO_HC8_RXD, // HC8 Serial interface
GPIO_I2S_DAC, // Audio DAC support for ESP32 and ESP32S2
+ GPIO_MAGIC_SWITCH, // MagicSwitch as in Sonoff BasicR4
GPIO_SENSOR_END };
// Error as warning to rethink GPIO usage with max 2045
@@ -475,6 +476,7 @@ const char kSensorNames[] PROGMEM =
D_SENSOR_HDMI_CEC "|"
D_SENSOR_HC8_RX "|"
D_SENSOR_I2S_DAC "|"
+ D_GPIO_MAGIC_SWITCH "|"
;
const char kSensorNamesFixed[] PROGMEM =
@@ -493,6 +495,7 @@ const char kSensorNamesFixed[] PROGMEM =
#define MAX_DSB 4
#define MAX_BP1658CJ_DAT 16
#define MAX_DINGTIAN_SHIFT 4
+#define MAX_MAGIC_SWITCH_MODES 2
#define MAX_BL0942_RX 4 // Baudrates 1 (4800), 2 (9600), 3 (19200), 4 (38400)
const uint16_t kGpioNiceList[] PROGMEM = {
@@ -1143,6 +1146,10 @@ const uint16_t kGpioNiceList[] PROGMEM = {
AGPIO(GPIO_DINGTIAN_RCK),
#endif
+#ifdef USE_MAGIC_SWITCH
+ AGPIO(GPIO_MAGIC_SWITCH) + MAX_MAGIC_SWITCH_MODES,
+#endif
+
/*-------------------------------------------------------------------------------------------*\
* ESP32 specifics
\*-------------------------------------------------------------------------------------------*/
diff --git a/tasmota/language/af_AF.h b/tasmota/language/af_AF.h
index 95a4ff647..d90ee06c7 100644
--- a/tasmota/language/af_AF.h
+++ b/tasmota/language/af_AF.h
@@ -288,7 +288,7 @@
#define D_RESET_CONFIGURATION "Stel die konfigurasie terug"
#define D_BACKUP_CONFIGURATION "Rugsteun die konfigurasie"
#define D_RESTORE_CONFIGURATION "Herstel die konfigurasie"
-#define D_START_RESTORE "Start restore"
+#define D_START_RESTORE "Start restore"
#define D_MAIN_MENU "Hoofkieslys"
#define D_MODULE_PARAMETERS "Moduleparameters"
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/bg_BG.h b/tasmota/language/bg_BG.h
index b7f00e51a..bffd921e2 100644
--- a/tasmota/language/bg_BG.h
+++ b/tasmota/language/bg_BG.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "А"
diff --git a/tasmota/language/ca_AD.h b/tasmota/language/ca_AD.h
index 4683b5c55..834481513 100644
--- a/tasmota/language/ca_AD.h
+++ b/tasmota/language/ca_AD.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/cs_CZ.h b/tasmota/language/cs_CZ.h
index 1441d328d..9a8197a40 100644
--- a/tasmota/language/cs_CZ.h
+++ b/tasmota/language/cs_CZ.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/de_DE.h b/tasmota/language/de_DE.h
index 8d5ef0279..c76ddbb29 100644
--- a/tasmota/language/de_DE.h
+++ b/tasmota/language/de_DE.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/el_GR.h b/tasmota/language/el_GR.h
index 4cf6fc13e..1edf65357 100644
--- a/tasmota/language/el_GR.h
+++ b/tasmota/language/el_GR.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/en_GB.h b/tasmota/language/en_GB.h
index aa91d4c55..139316d74 100644
--- a/tasmota/language/en_GB.h
+++ b/tasmota/language/en_GB.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/es_ES.h b/tasmota/language/es_ES.h
index 06add4a53..8c0ed3475 100644
--- a/tasmota/language/es_ES.h
+++ b/tasmota/language/es_ES.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/fr_FR.h b/tasmota/language/fr_FR.h
index 861fe57cb..0e89c0560 100644
--- a/tasmota/language/fr_FR.h
+++ b/tasmota/language/fr_FR.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
diff --git a/tasmota/language/fy_NL.h b/tasmota/language/fy_NL.h
index cf4d8a187..436782c93 100644
--- a/tasmota/language/fy_NL.h
+++ b/tasmota/language/fy_NL.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/he_HE.h b/tasmota/language/he_HE.h
index e4199ab15..d489b2f64 100644
--- a/tasmota/language/he_HE.h
+++ b/tasmota/language/he_HE.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/hu_HU.h b/tasmota/language/hu_HU.h
index 914ae053a..a9715ef10 100644
--- a/tasmota/language/hu_HU.h
+++ b/tasmota/language/hu_HU.h
@@ -960,6 +960,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/it_IT.h b/tasmota/language/it_IT.h
index 46b6a50cd..1a412fcff 100644
--- a/tasmota/language/it_IT.h
+++ b/tasmota/language/it_IT.h
@@ -956,7 +956,8 @@
#define D_SENSOR_BIOPDU_PZEM0XX_TX "BioPDU PZEM0XX - TX"
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 - RX"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
-#define D_SENSOR_LOX_O2_RX "LoxO2 - RX"
+#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/ko_KO.h b/tasmota/language/ko_KO.h
index 9ceffb0ab..8fe87643b 100644
--- a/tasmota/language/ko_KO.h
+++ b/tasmota/language/ko_KO.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/nl_NL.h b/tasmota/language/nl_NL.h
index 9927eb5e0..1ad5fa61f 100644
--- a/tasmota/language/nl_NL.h
+++ b/tasmota/language/nl_NL.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/pl_PL.h b/tasmota/language/pl_PL.h
index 1f1f44bef..7693b986d 100644
--- a/tasmota/language/pl_PL.h
+++ b/tasmota/language/pl_PL.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/pt_BR.h b/tasmota/language/pt_BR.h
index 3dac6d2bc..0ee9a4433 100644
--- a/tasmota/language/pt_BR.h
+++ b/tasmota/language/pt_BR.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/pt_PT.h b/tasmota/language/pt_PT.h
index 8ae556c7e..e94a640f2 100644
--- a/tasmota/language/pt_PT.h
+++ b/tasmota/language/pt_PT.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/ro_RO.h b/tasmota/language/ro_RO.h
index 6f09c9a27..b90c3a960 100644
--- a/tasmota/language/ro_RO.h
+++ b/tasmota/language/ro_RO.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/ru_RU.h b/tasmota/language/ru_RU.h
index 9de1e95cb..82f01ca3f 100644
--- a/tasmota/language/ru_RU.h
+++ b/tasmota/language/ru_RU.h
@@ -958,6 +958,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "А"
diff --git a/tasmota/language/sk_SK.h b/tasmota/language/sk_SK.h
index e943a2438..5ea1875bd 100644
--- a/tasmota/language/sk_SK.h
+++ b/tasmota/language/sk_SK.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/sv_SE.h b/tasmota/language/sv_SE.h
index 72e940b12..99d27f132 100644
--- a/tasmota/language/sv_SE.h
+++ b/tasmota/language/sv_SE.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/tr_TR.h b/tasmota/language/tr_TR.h
index 259825231..3377a17f6 100644
--- a/tasmota/language/tr_TR.h
+++ b/tasmota/language/tr_TR.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/uk_UA.h b/tasmota/language/uk_UA.h
index ad9834916..d8b33392d 100644
--- a/tasmota/language/uk_UA.h
+++ b/tasmota/language/uk_UA.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "А"
diff --git a/tasmota/language/vi_VN.h b/tasmota/language/vi_VN.h
index 4f4297646..990f558a0 100644
--- a/tasmota/language/vi_VN.h
+++ b/tasmota/language/vi_VN.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/zh_CN.h b/tasmota/language/zh_CN.h
index 1c49fd023..dc0a6ec4c 100644
--- a/tasmota/language/zh_CN.h
+++ b/tasmota/language/zh_CN.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
diff --git a/tasmota/language/zh_TW.h b/tasmota/language/zh_TW.h
index f45bb2b90..992838e00 100644
--- a/tasmota/language/zh_TW.h
+++ b/tasmota/language/zh_TW.h
@@ -957,6 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "安培"
diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h
index 2f5543e15..22a7fb877 100644
--- a/tasmota/my_user_config.h
+++ b/tasmota/my_user_config.h
@@ -538,6 +538,9 @@
#define SHELLY_CMDS // Add command to send co-processor commands (+0k3 code)
#define SHELLY_FW_UPGRADE // Add firmware upgrade option for co-processor (+3k4 code)
// #define SHELLY_VOLTAGE_MON // Add support for reading voltage and current measurment (-0k0 code)
+//#define USE_MAGIC_SWITCH // Add Sonoff MagicSwitch support as implemented in Sonoff Basic R4 (+612B flash, +64B IRAM for intr)
+// #define MAGICSWITCH_MIN_PULSE 4000 // Overridable minimum pulse, also overridable by command MagicSwitchPulse (not saved to flash)
+// #define MAGICSWITCH_MASKING_WINDOW_LEN 5 // Overridable masking window (in number of 50ms loops)
// -- Optional light modules ----------------------
#define USE_LIGHT // Add support for light control
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_91_magic_switch.ino b/tasmota/tasmota_xdrv_driver/xdrv_91_magic_switch.ino
new file mode 100644
index 000000000..5356ada69
--- /dev/null
+++ b/tasmota/tasmota_xdrv_driver/xdrv_91_magic_switch.ino
@@ -0,0 +1,187 @@
+/*
+ xdrv_91_magic_switch.ino - Driver for MagicSwitch as implemented in Sonoff BasicR4
+
+ Copyright (C) 2021 Barbudor
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+#ifdef USE_MAGIC_SWITCH
+
+#define XDRV_91 91
+
+/********************************************************************************************************
+ * Check defines
+ */
+
+#ifndef MAGICSWITCH_MIN_PULSE
+#define MAGICSWITCH_MIN_PULSE 4000
+#endif
+
+#ifndef MAGICSWITCH_MASKING_WINDOW_LEN
+#define MAGICSWITCH_MASKING_WINDOW_LEN 5
+#endif
+
+/********************************************************************************************************
+ * Global private data
+ */
+
+// MagicSwitch Index => Mode
+//
+//
+//
+// Index Mode Pull-Up
+// 1 0 Pull-Up
+// 2 1 No Pull-up
+// 3 2 Pull-Up
+// 4 3 No Pull-up
+// 5 4 Pull-Up
+// 6 5 No Pull-up
+// 7 6 Pull-Up
+// 8 7 No Pull-up
+
+#define MAGICSWITCH_MODE_NO_PULLUP 0x01
+
+
+struct MAGICSWITCH_DATA {
+ uint32_t start_time; // timestamp at rising edge
+ uint32_t pulse_len; // measured pulse length
+ uint32_t min_pulse; // minimum pulse length
+ uint8_t switch_state; // switch state - count down for masking window
+ uint8_t pin; // the GPIO of the input
+ uint8_t mode; // mode
+ int8_t key_offset; // index of the MagicSwitch in the list of Switches
+} *MagicSwitch = nullptr;
+
+
+/********************************************************************************************************
+ * Interrupt level operations
+ */
+
+extern "C" void IRAM_ATTR MagicSwitch_intr(void *arg) {
+ struct MAGICSWITCH_DATA* ms = (struct MAGICSWITCH_DATA*)arg;
+ uint32_t now = micros();
+ bool pin_state = digitalRead(ms->pin);
+ if (ms->pulse_len) { // previous pulse not aknowledged, ignoring the edge
+ return;
+ } else if (pin_state) { // rising edge (hopefully if we didn't missed), record start time
+ ms->start_time = now | 1; // "| 1" => avoid 1 in 4M chance to get 0
+ } else if (ms->start_time) { // falling edge, compute pulse length
+ uint32_t pulse_len = now - ms->start_time;
+ ms->start_time = 0; // in case of missing an rising edge, avoid triggering false detection
+ if (pulse_len >= ms->min_pulse)
+ ms->pulse_len = pulse_len;
+ }
+}
+
+/********************************************************************************************************
+ * Driver operations
+ */
+
+void MagicSwitchLoop()
+{
+ if (MagicSwitch->switch_state) {
+ MagicSwitch->switch_state--;
+ if (!MagicSwitch->switch_state) {
+ SwitchSetVirtualPinState(MagicSwitch->key_offset, 0);
+ MagicSwitch->pulse_len = 0; // acknowledge the pulse, close the masking window
+ AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("MSW: end"));
+ }
+ } else if (MagicSwitch->pulse_len) {
+ SwitchSetVirtualPinState(MagicSwitch->key_offset, 1);
+ MagicSwitch->switch_state = MAGICSWITCH_MASKING_WINDOW_LEN;
+ AddLog(LOG_LEVEL_DEBUG, PSTR("MSW: length:%d, window:%d"), MagicSwitch->pulse_len, MagicSwitch->switch_state);
+ }
+}
+
+/********************************************************************************************************
+ * Driver initialisation
+ */
+
+void MagicSwitchInit(void) {
+ if (PinUsed(GPIO_MAGIC_SWITCH, GPIO_ANY)) {
+ // allocate data structure
+ MagicSwitch = (struct MAGICSWITCH_DATA*)calloc(1, sizeof(struct MAGICSWITCH_DATA));
+ if (MagicSwitch) {
+ // get pins
+ MagicSwitch->pin = Pin(GPIO_MAGIC_SWITCH, GPIO_ANY); // input
+ MagicSwitch->mode = GetPin(MagicSwitch->pin) - AGPIO(GPIO_MAGIC_SWITCH); // Index 1 => mode 0, etc...
+ MagicSwitch->key_offset = -1; // means not yet configured
+ MagicSwitch->min_pulse = MAGICSWITCH_MIN_PULSE;
+
+ AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("MSW: pin:%d, mode:%d"), MagicSwitch->pin, MagicSwitch->mode);
+
+ pinMode(MagicSwitch->pin, (MagicSwitch->mode & MAGICSWITCH_MODE_NO_PULLUP) ? INPUT : INPUT_PULLUP);
+ attachInterruptArg(MagicSwitch->pin, MagicSwitch_intr, MagicSwitch, CHANGE);
+ }
+ }
+}
+
+bool MagicSwitchAddSwitch(void) {
+ if (MagicSwitch->key_offset < 0) {
+ MagicSwitch->key_offset = XdrvMailbox.index;
+ Settings->switchmode[MagicSwitch->key_offset] = 4;
+ AddLog(LOG_LEVEL_INFO, PSTR("MSW: Switch %d, Switchmode 4"), MagicSwitch->key_offset + 1);
+ return true;
+ }
+ return false;
+}
+
+/********************************************************************************************************
+ * Commands
+ */
+
+const char kMagicSwitchCommands[] PROGMEM = "MagicSwitch|"
+ "Pulse"
+ ;
+
+void (* const MagicSwitchCommand[])(void) PROGMEM = {
+ &CmndMagicSwitchPulse
+ };
+
+void CmndMagicSwitchPulse(void)
+{
+ if ((XdrvMailbox.payload >= 1000) && (XdrvMailbox.payload < 500000)) {
+ MagicSwitch->min_pulse = XdrvMailbox.payload;
+ }
+ ResponseCmndNumber(MagicSwitch->min_pulse);
+}
+
+/*********************************************************************************************\
+ * Interface
+\*********************************************************************************************/
+
+bool Xdrv91(uint32_t function) {
+ bool result = false;
+
+ if (FUNC_SETUP_RING2 == function) {
+ MagicSwitchInit();
+ } else if (MagicSwitch) {
+ switch (function) {
+ case FUNC_EVERY_50_MSECOND:
+ //case FUNC_EVERY_250_MSECOND:
+ MagicSwitchLoop();
+ break;
+ case FUNC_ADD_SWITCH:
+ result = MagicSwitchAddSwitch();
+ break;
+ case FUNC_COMMAND:
+ result = DecodeCommand(kMagicSwitchCommands, MagicSwitchCommand);
+ break;
+ }
+ }
+ return result;
+}
+
+#endif // USE_MAGIC_SWITCH
From 70768ea8ad122b583c92c02db37dfdcd760e8d04 Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Sat, 16 Dec 2023 18:29:09 +0100
Subject: [PATCH 011/303] Update changelogs
---
CHANGELOG.md | 3 ++-
RELEASENOTES.md | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2a77974ef..adce0b539 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,9 +5,10 @@ All notable changes to this project will be documented in this file.
## [13.3.0.1]
### Added
+- Support for Sonoff Basic R4 Magic Switch (#20247)
### Breaking Changed
-- Refactoring of Berry `animate` module for WS2812 Leds
+- Refactoring of Berry `animate` module for WS2812 Leds (#20236)
### Changed
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 6eb72fe2e..7f886e45f 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -118,8 +118,10 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
## Changelog v13.3.0.1
### Added
+- Support for Sonoff Basic R4 Magic Switch [#20247](https://github.com/arendst/Tasmota/issues/20247)
### Breaking Changed
+- Refactoring of Berry `animate` module for WS2812 Leds [#20236](https://github.com/arendst/Tasmota/issues/20236)
### Changed
From cc5eb732ea8e9581ddd311547832c98cd669f0bf Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Sat, 16 Dec 2023 22:38:04 +0100
Subject: [PATCH 012/303] Fix animation (#20250)
---
lib/libesp32/berry_tasmota/src/be_animate_module.c | 14 ++++++--------
.../src/embedded/animate_1_animate_effects.be | 1 +
.../solidified_animate_1_animate_effects.h | 8 +++++---
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/lib/libesp32/berry_tasmota/src/be_animate_module.c b/lib/libesp32/berry_tasmota/src/be_animate_module.c
index 688585f06..7d741e0a9 100644
--- a/lib/libesp32/berry_tasmota/src/be_animate_module.c
+++ b/lib/libesp32/berry_tasmota/src/be_animate_module.c
@@ -57,7 +57,7 @@ static const uint8_t PALETTE_STANDARD_TAG[] = {
0x40, 0x00, 0xFF, 0x00, // green
0x40, 0x00, 0x00, 0xFF, // blue
0x40, 0xFF, 0x00, 0xFF, // indigo
- 0x40, 0xFF, 0xFF, 0xFF, // violet
+ 0x40, 0xEE, 0x44, 0xA5, // violet
0x00, 0xFF, 0x00, 0x00, // red
};
@@ -72,12 +72,11 @@ static const uint8_t PALETTE_ib_jul01_gp[] = {
static const uint8_t PALETTE_STANDARD_VAL[] = {
0x00, 0xFF, 0x00, 0x00, // red
- 0x24, 0xFF, 0xA5, 0x00, // orange
- 0x49, 0xFF, 0xFF, 0x00, // yellow
- 0x6E, 0x00, 0xFF, 0x00, // green
- 0x92, 0x00, 0x00, 0xFF, // blue
- 0xB7, 0xFF, 0x00, 0xFF, // indigo
- 0xDB, 0xFF, 0xFF, 0xFF, // violet
+ 0x2A, 0xFF, 0xA5, 0x00, // orange
+ 0x55, 0xFF, 0xFF, 0x00, // yellow
+ 0x7F, 0x00, 0xFF, 0x00, // green
+ 0xAA, 0x00, 0x00, 0xFF, // blue
+ 0xD4, 0xFF, 0x00, 0xFF, // indigo
0xFF, 0xFF, 0x00, 0x00, // red
};
@@ -88,7 +87,6 @@ static const uint8_t PALETTE_SATURATED_TAG[] = {
0x40, 0x00, 0xFF, 0x00, // green
0x40, 0x00, 0x00, 0xFF, // blue
0x40, 0xFF, 0x00, 0xFF, // indigo
- 0x40, 0xFF, 0xFF, 0xFF, // violet
0x00, 0xFF, 0x00, 0x00, // red
};
diff --git a/lib/libesp32/berry_tasmota/src/embedded/animate_1_animate_effects.be b/lib/libesp32/berry_tasmota/src/embedded/animate_1_animate_effects.be
index e2a5a9736..e96f37f93 100644
--- a/lib/libesp32/berry_tasmota/src/embedded/animate_1_animate_effects.be
+++ b/lib/libesp32/berry_tasmota/src/embedded/animate_1_animate_effects.be
@@ -40,6 +40,7 @@ class Animate_pulse
self.pulse_size = pulse_size
if slew_size < 0 slew_size = 0 end
self.slew_size = slew_size
+ self.pos = 0
end
##
diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_1_animate_effects.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_1_animate_effects.h
index bb8b9dee3..9831e5a6e 100644
--- a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_1_animate_effects.h
+++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_1_animate_effects.h
@@ -154,7 +154,7 @@ be_local_closure(Animate_pulse_init, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 8]) { /* constants */
+ ( &(const bvalue[ 9]) { /* constants */
/* K0 */ be_const_int(16777215),
/* K1 */ be_const_int(1),
/* K2 */ be_const_int(0),
@@ -163,10 +163,11 @@ be_local_closure(Animate_pulse_init, /* name */
/* K5 */ be_const_int(-16777216),
/* K6 */ be_nested_str_weak(pulse_size),
/* K7 */ be_nested_str_weak(slew_size),
+ /* K8 */ be_nested_str_weak(pos),
}),
be_str_weak(init),
&be_const_str_solidified,
- ( &(const binstruction[23]) { /* code */
+ ( &(const binstruction[24]) { /* code */
0x4C100000, // 0000 LDNIL R4
0x1C100204, // 0001 EQ R4 R1 R4
0x78120000, // 0002 JMPF R4 #0004
@@ -189,7 +190,8 @@ be_local_closure(Animate_pulse_init, /* name */
0x78120000, // 0013 JMPF R4 #0015
0x580C0002, // 0014 LDCONST R3 K2
0x90020E03, // 0015 SETMBR R0 K7 R3
- 0x80000000, // 0016 RET 0
+ 0x90021102, // 0016 SETMBR R0 K8 K2
+ 0x80000000, // 0017 RET 0
})
)
);
From dc98f6e1909a10ef995b976757dbc453358bb6cd Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Sun, 17 Dec 2023 20:47:18 +0100
Subject: [PATCH 013/303] Simplify animate (#20254)
* Simplify animate
* make add_ methods idempotent
---
.../src/embedded/animate_0_core.be | 16 +-
.../src/embedded/animate_1_animate_effects.be | 24 +-
.../src/embedded/animate_9_module.be | 30 +-
.../src/solidify/solidified_animate_0_core.h | 993 +++++++++---------
.../solidified_animate_1_animate_effects.h | 162 ++-
.../solidify/solidified_animate_9_module.h | 670 ++++++------
.../animate_demo/animate_demo_breathe.be | 28 +
.../berry/animate_demo/animate_demo_pulse.be | 4 -
8 files changed, 1102 insertions(+), 825 deletions(-)
create mode 100644 tasmota/berry/animate_demo/animate_demo_breathe.be
diff --git a/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be b/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be
index 5809ed3f3..747376d9d 100644
--- a/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be
+++ b/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be
@@ -32,6 +32,7 @@ class Animate_core
def init(strip, bri)
import animate
+
self.strip = strip
if (bri == nil) bri = 50 end
self.bri = bri # percentage of brightness 0..100
@@ -46,6 +47,13 @@ class Animate_core
#
self.fast_loop_cb = def() self.fast_loop() end
self.back_color = 0x000000
+ #
+ self.set_current()
+ end
+
+ # set this animate.core as the current animator for configuration
+ def set_current()
+ global._cur_anim = self # declare the current animate.core for painters and animators to register
end
# cb
@@ -59,7 +67,9 @@ class Animate_core
end
def add_animator(anim)
- self.animators.push(anim)
+ if self.animators.find(anim) == nil
+ self.animators.push(anim)
+ end
end
# remove a specific animator
@@ -85,7 +95,9 @@ class Animate_core
def add_painter(painter)
- self.painters.push(painter)
+ if self.painters.find(painter) == nil
+ self.painters.push(painter)
+ end
end
def clear()
diff --git a/lib/libesp32/berry_tasmota/src/embedded/animate_1_animate_effects.be b/lib/libesp32/berry_tasmota/src/embedded/animate_1_animate_effects.be
index e96f37f93..a059ee85c 100644
--- a/lib/libesp32/berry_tasmota/src/embedded/animate_1_animate_effects.be
+++ b/lib/libesp32/berry_tasmota/src/embedded/animate_1_animate_effects.be
@@ -1,5 +1,25 @@
# class Animate_pulse
+#@ solidify:Animate_painter,weak
+# painter superclass
+class Animate_painter
+
+ def init()
+ # register ourselves into the current animate.core
+ var core = global._cur_anim
+ if (core != nil)
+ core.add_painter(self)
+ end
+ end
+
+ # return true if buffer was filled successfully
+ #
+ # Needs to be overwritten
+ def paint(frame)
+ end
+
+end
+
##########################################################################################
#
# class Animate_pulse
@@ -22,7 +42,7 @@
##########################################################################################
#@ solidify:Animate_pulse,weak
-class Animate_pulse
+class Animate_pulse : Animate_painter
var color
var back_color
var pos
@@ -30,6 +50,8 @@ class Animate_pulse
var pulse_size
def init(color, pulse_size, slew_size)
+ super(self).init()
+
if (color == nil) color = 0xFFFFFF end # white by default
if (pulse_size == nil) pulse_size = 1 end
if (slew_size == nil) slew_size = 0 end
diff --git a/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be b/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be
index aa9ef07e6..46fdcb16f 100644
--- a/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be
+++ b/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be
@@ -96,8 +96,12 @@ class Animate_animator
var obj # object to call
var mth # object method to call
- def init(duration_ms)
- self.duration_ms = duration_ms
+ def init()
+ # register ourselves into the current animate.core
+ var core = global._cur_anim
+ if (core != nil)
+ core.add_animator(self)
+ end
end
def set_duration_ms(duration_ms)
@@ -155,16 +159,27 @@ class Animate_palette : Animate_animator
var color # instance of light_state, used for color calculation (reuse of object)
def init(palette, duration_ms)
- super(self).init(duration_ms)
+ super(self).init()
+
+ self.duration_ms = duration_ms
self.running = false
+ self.bri = 100
+ self.color = light_state(light_state.RGB)
+ #
+ self.set_palette(palette)
+ end
+
+ # load or change palette
+ def set_palette(palette)
if (type(palette) == 'ptr') palette = self.ptr_to_palette(palette) end # convert comptr to palette buffer
self.palette = palette
- self.bri = 100
self.slots = size(palette) / 4
- if duration_ms != nil
- self.set_duration(duration_ms)
+ # recompute palette
+ if self.duration_ms != nil
+ self.set_duration(self.duration_ms)
+ elif (self.range_min != nil) && (self.range_max != nil)
+ self.set_range(self.range_min, self.range_max)
end
- self.color = light_state(light_state.RGB)
end
# setter to be used as cb
@@ -415,6 +430,7 @@ class Animate_oscillator : Animate_animator
var value
def init(a, b, duration_ms, form)
+ super(self).init()
self.phase = 0
self.duty_cycle = 50
self.a = a
diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h
index 2221e785c..cc86ccf2e 100644
--- a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h
+++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h
@@ -6,6 +6,482 @@
extern const bclass be_class_Animate_core;
+/********************************************************************
+** Solidified function: start
+********************************************************************/
+be_local_closure(Animate_core_start, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 9]) { /* constants */
+ /* K0 */ be_nested_str_weak(running),
+ /* K1 */ be_nested_str_weak(animators),
+ /* K2 */ be_const_int(0),
+ /* K3 */ be_nested_str_weak(start),
+ /* K4 */ be_const_int(1),
+ /* K5 */ be_nested_str_weak(fast_loop_next),
+ /* K6 */ be_nested_str_weak(tasmota),
+ /* K7 */ be_nested_str_weak(add_fast_loop),
+ /* K8 */ be_nested_str_weak(fast_loop_cb),
+ }),
+ be_str_weak(start),
+ &be_const_str_solidified,
+ ( &(const binstruction[20]) { /* code */
+ 0x50040200, // 0000 LDBOOL R1 1 0
+ 0x90020001, // 0001 SETMBR R0 K0 R1
+ 0x88040101, // 0002 GETMBR R1 R0 K1
+ 0x58080002, // 0003 LDCONST R2 K2
+ 0x600C000C, // 0004 GETGBL R3 G12
+ 0x5C100200, // 0005 MOVE R4 R1
+ 0x7C0C0200, // 0006 CALL R3 1
+ 0x140C0403, // 0007 LT R3 R2 R3
+ 0x780E0004, // 0008 JMPF R3 #000E
+ 0x940C0202, // 0009 GETIDX R3 R1 R2
+ 0x8C0C0703, // 000A GETMET R3 R3 K3
+ 0x7C0C0200, // 000B CALL R3 1
+ 0x00080504, // 000C ADD R2 R2 K4
+ 0x7001FFF5, // 000D JMP #0004
+ 0x90020B02, // 000E SETMBR R0 K5 K2
+ 0xB80E0C00, // 000F GETNGBL R3 K6
+ 0x8C0C0707, // 0010 GETMET R3 R3 K7
+ 0x88140108, // 0011 GETMBR R5 R0 K8
+ 0x7C0C0400, // 0012 CALL R3 2
+ 0x80000000, // 0013 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: remove
+********************************************************************/
+be_local_closure(Animate_core_remove, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(clear),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(remove_fast_loop),
+ /* K3 */ be_nested_str_weak(fast_loop_cb),
+ }),
+ be_str_weak(remove),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 7]) { /* code */
+ 0x8C040100, // 0000 GETMET R1 R0 K0
+ 0x7C040200, // 0001 CALL R1 1
+ 0xB8060200, // 0002 GETNGBL R1 K1
+ 0x8C040302, // 0003 GETMET R1 R1 K2
+ 0x880C0103, // 0004 GETMBR R3 R0 K3
+ 0x7C040400, // 0005 CALL R1 2
+ 0x80000000, // 0006 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: add_background_animator
+********************************************************************/
+be_local_closure(Animate_core_add_background_animator, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(set_cb),
+ /* K1 */ be_nested_str_weak(set_back_color),
+ /* K2 */ be_nested_str_weak(add_animator),
+ }),
+ be_str_weak(add_background_animator),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 8]) { /* code */
+ 0x8C080300, // 0000 GETMET R2 R1 K0
+ 0x5C100000, // 0001 MOVE R4 R0
+ 0x88140101, // 0002 GETMBR R5 R0 K1
+ 0x7C080600, // 0003 CALL R2 3
+ 0x8C080102, // 0004 GETMET R2 R0 K2
+ 0x5C100200, // 0005 MOVE R4 R1
+ 0x7C080400, // 0006 CALL R2 2
+ 0x80000000, // 0007 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: remove_painter
+********************************************************************/
+be_local_closure(Animate_core_remove_painter, /* name */
+ be_nested_proto(
+ 8, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(painters),
+ /* K1 */ be_nested_str_weak(remove),
+ /* K2 */ be_nested_str_weak(find),
+ /* K3 */ be_nested_str_weak(clear),
+ }),
+ be_str_weak(remove_painter),
+ &be_const_str_solidified,
+ ( &(const binstruction[13]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x4C0C0000, // 0001 LDNIL R3
+ 0x200C0203, // 0002 NE R3 R1 R3
+ 0x780E0005, // 0003 JMPF R3 #000A
+ 0x8C0C0501, // 0004 GETMET R3 R2 K1
+ 0x8C140502, // 0005 GETMET R5 R2 K2
+ 0x5C1C0200, // 0006 MOVE R7 R1
+ 0x7C140400, // 0007 CALL R5 2
+ 0x7C0C0400, // 0008 CALL R3 2
+ 0x70020001, // 0009 JMP #000C
+ 0x8C0C0503, // 000A GETMET R3 R2 K3
+ 0x7C0C0200, // 000B CALL R3 1
+ 0x80000000, // 000C RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: add_animator
+********************************************************************/
+be_local_closure(Animate_core_add_animator, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(animators),
+ /* K1 */ be_nested_str_weak(find),
+ /* K2 */ be_nested_str_weak(push),
+ }),
+ be_str_weak(add_animator),
+ &be_const_str_solidified,
+ ( &(const binstruction[12]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x8C080501, // 0001 GETMET R2 R2 K1
+ 0x5C100200, // 0002 MOVE R4 R1
+ 0x7C080400, // 0003 CALL R2 2
+ 0x4C0C0000, // 0004 LDNIL R3
+ 0x1C080403, // 0005 EQ R2 R2 R3
+ 0x780A0003, // 0006 JMPF R2 #000B
+ 0x88080100, // 0007 GETMBR R2 R0 K0
+ 0x8C080502, // 0008 GETMET R2 R2 K2
+ 0x5C100200, // 0009 MOVE R4 R1
+ 0x7C080400, // 000A CALL R2 2
+ 0x80000000, // 000B RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: animate
+********************************************************************/
+be_local_closure(Animate_core_animate, /* name */
+ be_nested_proto(
+ 1, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 0, /* has constants */
+ NULL, /* no const */
+ be_str_weak(animate),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 1]) { /* code */
+ 0x80000000, // 0000 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: clear
+********************************************************************/
+be_local_closure(Animate_core_clear, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(stop),
+ /* K1 */ be_nested_str_weak(strip),
+ /* K2 */ be_nested_str_weak(clear),
+ }),
+ be_str_weak(clear),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 6]) { /* code */
+ 0x8C040100, // 0000 GETMET R1 R0 K0
+ 0x7C040200, // 0001 CALL R1 1
+ 0x88040101, // 0002 GETMBR R1 R0 K1
+ 0x8C040302, // 0003 GETMET R1 R1 K2
+ 0x7C040200, // 0004 CALL R1 1
+ 0x80000000, // 0005 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: stop
+********************************************************************/
+be_local_closure(Animate_core_stop, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 8]) { /* constants */
+ /* K0 */ be_nested_str_weak(running),
+ /* K1 */ be_nested_str_weak(animators),
+ /* K2 */ be_const_int(0),
+ /* K3 */ be_nested_str_weak(stop),
+ /* K4 */ be_const_int(1),
+ /* K5 */ be_nested_str_weak(tasmota),
+ /* K6 */ be_nested_str_weak(remove_fast_loop),
+ /* K7 */ be_nested_str_weak(fast_loop_cb),
+ }),
+ be_str_weak(stop),
+ &be_const_str_solidified,
+ ( &(const binstruction[19]) { /* code */
+ 0x50040000, // 0000 LDBOOL R1 0 0
+ 0x90020001, // 0001 SETMBR R0 K0 R1
+ 0x88040101, // 0002 GETMBR R1 R0 K1
+ 0x58080002, // 0003 LDCONST R2 K2
+ 0x600C000C, // 0004 GETGBL R3 G12
+ 0x5C100200, // 0005 MOVE R4 R1
+ 0x7C0C0200, // 0006 CALL R3 1
+ 0x140C0403, // 0007 LT R3 R2 R3
+ 0x780E0004, // 0008 JMPF R3 #000E
+ 0x940C0202, // 0009 GETIDX R3 R1 R2
+ 0x8C0C0703, // 000A GETMET R3 R3 K3
+ 0x7C0C0200, // 000B CALL R3 1
+ 0x00080504, // 000C ADD R2 R2 K4
+ 0x7001FFF5, // 000D JMP #0004
+ 0xB80E0A00, // 000E GETNGBL R3 K5
+ 0x8C0C0706, // 000F GETMET R3 R3 K6
+ 0x88140107, // 0010 GETMBR R5 R0 K7
+ 0x7C0C0400, // 0011 CALL R3 2
+ 0x80000000, // 0012 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: add_painter
+********************************************************************/
+be_local_closure(Animate_core_add_painter, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(painters),
+ /* K1 */ be_nested_str_weak(find),
+ /* K2 */ be_nested_str_weak(push),
+ }),
+ be_str_weak(add_painter),
+ &be_const_str_solidified,
+ ( &(const binstruction[12]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x8C080501, // 0001 GETMET R2 R2 K1
+ 0x5C100200, // 0002 MOVE R4 R1
+ 0x7C080400, // 0003 CALL R2 2
+ 0x4C0C0000, // 0004 LDNIL R3
+ 0x1C080403, // 0005 EQ R2 R2 R3
+ 0x780A0003, // 0006 JMPF R2 #000B
+ 0x88080100, // 0007 GETMBR R2 R0 K0
+ 0x8C080502, // 0008 GETMET R2 R2 K2
+ 0x5C100200, // 0009 MOVE R4 R1
+ 0x7C080400, // 000A CALL R2 2
+ 0x80000000, // 000B RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_bri
+********************************************************************/
+be_local_closure(Animate_core_set_bri, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(bri),
+ }),
+ be_str_weak(set_bri),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_current
+********************************************************************/
+be_local_closure(Animate_core_set_current, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(global),
+ /* K1 */ be_nested_str_weak(_cur_anim),
+ }),
+ be_str_weak(set_current),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 3]) { /* code */
+ 0xB8060000, // 0000 GETNGBL R1 K0
+ 0x90060200, // 0001 SETMBR R1 K1 R0
+ 0x80000000, // 0002 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: remove_animator
+********************************************************************/
+be_local_closure(Animate_core_remove_animator, /* name */
+ be_nested_proto(
+ 8, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(animators),
+ /* K1 */ be_nested_str_weak(remove),
+ /* K2 */ be_nested_str_weak(find),
+ /* K3 */ be_nested_str_weak(clear),
+ }),
+ be_str_weak(remove_animator),
+ &be_const_str_solidified,
+ ( &(const binstruction[13]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x4C0C0000, // 0001 LDNIL R3
+ 0x200C0203, // 0002 NE R3 R1 R3
+ 0x780E0005, // 0003 JMPF R3 #000A
+ 0x8C0C0501, // 0004 GETMET R3 R2 K1
+ 0x8C140502, // 0005 GETMET R5 R2 K2
+ 0x5C1C0200, // 0006 MOVE R7 R1
+ 0x7C140400, // 0007 CALL R5 2
+ 0x7C0C0400, // 0008 CALL R3 2
+ 0x70020001, // 0009 JMP #000C
+ 0x8C0C0503, // 000A GETMET R3 R2 K3
+ 0x7C0C0200, // 000B CALL R3 1
+ 0x80000000, // 000C RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_cb
+********************************************************************/
+be_local_closure(Animate_core_set_cb, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(obj),
+ /* K1 */ be_nested_str_weak(mth),
+ }),
+ be_str_weak(set_cb),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 3]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x90020202, // 0001 SETMBR R0 K1 R2
+ 0x80000000, // 0002 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
/********************************************************************
** Solidified function: fast_loop
********************************************************************/
@@ -140,11 +616,11 @@ be_local_closure(Animate_core_fast_loop, /* name */
/********************************************************************
-** Solidified function: add_animator
+** Solidified function: set_back_color
********************************************************************/
-be_local_closure(Animate_core_add_animator, /* name */
+be_local_closure(Animate_core_set_back_color, /* name */
be_nested_proto(
- 5, /* nstack */
+ 2, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
@@ -152,256 +628,14 @@ be_local_closure(Animate_core_add_animator, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(animators),
- /* K1 */ be_nested_str_weak(push),
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(back_color),
}),
- be_str_weak(add_animator),
+ be_str_weak(set_back_color),
&be_const_str_solidified,
- ( &(const binstruction[ 5]) { /* code */
- 0x88080100, // 0000 GETMBR R2 R0 K0
- 0x8C080501, // 0001 GETMET R2 R2 K1
- 0x5C100200, // 0002 MOVE R4 R1
- 0x7C080400, // 0003 CALL R2 2
- 0x80000000, // 0004 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: remove_painter
-********************************************************************/
-be_local_closure(Animate_core_remove_painter, /* name */
- be_nested_proto(
- 8, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_nested_str_weak(painters),
- /* K1 */ be_nested_str_weak(remove),
- /* K2 */ be_nested_str_weak(find),
- /* K3 */ be_nested_str_weak(clear),
- }),
- be_str_weak(remove_painter),
- &be_const_str_solidified,
- ( &(const binstruction[13]) { /* code */
- 0x88080100, // 0000 GETMBR R2 R0 K0
- 0x4C0C0000, // 0001 LDNIL R3
- 0x200C0203, // 0002 NE R3 R1 R3
- 0x780E0005, // 0003 JMPF R3 #000A
- 0x8C0C0501, // 0004 GETMET R3 R2 K1
- 0x8C140502, // 0005 GETMET R5 R2 K2
- 0x5C1C0200, // 0006 MOVE R7 R1
- 0x7C140400, // 0007 CALL R5 2
- 0x7C0C0400, // 0008 CALL R3 2
- 0x70020001, // 0009 JMP #000C
- 0x8C0C0503, // 000A GETMET R3 R2 K3
- 0x7C0C0200, // 000B CALL R3 1
- 0x80000000, // 000C RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: remove_animator
-********************************************************************/
-be_local_closure(Animate_core_remove_animator, /* name */
- be_nested_proto(
- 8, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_nested_str_weak(animators),
- /* K1 */ be_nested_str_weak(remove),
- /* K2 */ be_nested_str_weak(find),
- /* K3 */ be_nested_str_weak(clear),
- }),
- be_str_weak(remove_animator),
- &be_const_str_solidified,
- ( &(const binstruction[13]) { /* code */
- 0x88080100, // 0000 GETMBR R2 R0 K0
- 0x4C0C0000, // 0001 LDNIL R3
- 0x200C0203, // 0002 NE R3 R1 R3
- 0x780E0005, // 0003 JMPF R3 #000A
- 0x8C0C0501, // 0004 GETMET R3 R2 K1
- 0x8C140502, // 0005 GETMET R5 R2 K2
- 0x5C1C0200, // 0006 MOVE R7 R1
- 0x7C140400, // 0007 CALL R5 2
- 0x7C0C0400, // 0008 CALL R3 2
- 0x70020001, // 0009 JMP #000C
- 0x8C0C0503, // 000A GETMET R3 R2 K3
- 0x7C0C0200, // 000B CALL R3 1
- 0x80000000, // 000C RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: remove
-********************************************************************/
-be_local_closure(Animate_core_remove, /* name */
- be_nested_proto(
- 4, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_nested_str_weak(clear),
- /* K1 */ be_nested_str_weak(tasmota),
- /* K2 */ be_nested_str_weak(remove_fast_loop),
- /* K3 */ be_nested_str_weak(fast_loop_cb),
- }),
- be_str_weak(remove),
- &be_const_str_solidified,
- ( &(const binstruction[ 7]) { /* code */
- 0x8C040100, // 0000 GETMET R1 R0 K0
- 0x7C040200, // 0001 CALL R1 1
- 0xB8060200, // 0002 GETNGBL R1 K1
- 0x8C040302, // 0003 GETMET R1 R1 K2
- 0x880C0103, // 0004 GETMBR R3 R0 K3
- 0x7C040400, // 0005 CALL R1 2
- 0x80000000, // 0006 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: add_background_animator
-********************************************************************/
-be_local_closure(Animate_core_add_background_animator, /* name */
- be_nested_proto(
- 6, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 3]) { /* constants */
- /* K0 */ be_nested_str_weak(set_cb),
- /* K1 */ be_nested_str_weak(set_back_color),
- /* K2 */ be_nested_str_weak(add_animator),
- }),
- be_str_weak(add_background_animator),
- &be_const_str_solidified,
- ( &(const binstruction[ 8]) { /* code */
- 0x8C080300, // 0000 GETMET R2 R1 K0
- 0x5C100000, // 0001 MOVE R4 R0
- 0x88140101, // 0002 GETMBR R5 R0 K1
- 0x7C080600, // 0003 CALL R2 3
- 0x8C080102, // 0004 GETMET R2 R0 K2
- 0x5C100200, // 0005 MOVE R4 R1
- 0x7C080400, // 0006 CALL R2 2
- 0x80000000, // 0007 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: start
-********************************************************************/
-be_local_closure(Animate_core_start, /* name */
- be_nested_proto(
- 6, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 9]) { /* constants */
- /* K0 */ be_nested_str_weak(running),
- /* K1 */ be_nested_str_weak(animators),
- /* K2 */ be_const_int(0),
- /* K3 */ be_nested_str_weak(start),
- /* K4 */ be_const_int(1),
- /* K5 */ be_nested_str_weak(fast_loop_next),
- /* K6 */ be_nested_str_weak(tasmota),
- /* K7 */ be_nested_str_weak(add_fast_loop),
- /* K8 */ be_nested_str_weak(fast_loop_cb),
- }),
- be_str_weak(start),
- &be_const_str_solidified,
- ( &(const binstruction[20]) { /* code */
- 0x50040200, // 0000 LDBOOL R1 1 0
- 0x90020001, // 0001 SETMBR R0 K0 R1
- 0x88040101, // 0002 GETMBR R1 R0 K1
- 0x58080002, // 0003 LDCONST R2 K2
- 0x600C000C, // 0004 GETGBL R3 G12
- 0x5C100200, // 0005 MOVE R4 R1
- 0x7C0C0200, // 0006 CALL R3 1
- 0x140C0403, // 0007 LT R3 R2 R3
- 0x780E0004, // 0008 JMPF R3 #000E
- 0x940C0202, // 0009 GETIDX R3 R1 R2
- 0x8C0C0703, // 000A GETMET R3 R3 K3
- 0x7C0C0200, // 000B CALL R3 1
- 0x00080504, // 000C ADD R2 R2 K4
- 0x7001FFF5, // 000D JMP #0004
- 0x90020B02, // 000E SETMBR R0 K5 K2
- 0xB80E0C00, // 000F GETNGBL R3 K6
- 0x8C0C0707, // 0010 GETMET R3 R3 K7
- 0x88140108, // 0011 GETMBR R5 R0 K8
- 0x7C0C0400, // 0012 CALL R3 2
- 0x80000000, // 0013 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: clear
-********************************************************************/
-be_local_closure(Animate_core_clear, /* name */
- be_nested_proto(
- 3, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 3]) { /* constants */
- /* K0 */ be_nested_str_weak(stop),
- /* K1 */ be_nested_str_weak(strip),
- /* K2 */ be_nested_str_weak(clear),
- }),
- be_str_weak(clear),
- &be_const_str_solidified,
- ( &(const binstruction[ 6]) { /* code */
- 0x8C040100, // 0000 GETMET R1 R0 K0
- 0x7C040200, // 0001 CALL R1 1
- 0x88040101, // 0002 GETMBR R1 R0 K1
- 0x8C040302, // 0003 GETMET R1 R1 K2
- 0x7C040200, // 0004 CALL R1 1
- 0x80000000, // 0005 RET 0
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
})
)
);
@@ -445,7 +679,7 @@ be_local_closure(Animate_core_init, /* name */
),
}),
1, /* has constants */
- ( &(const bvalue[13]) { /* constants */
+ ( &(const bvalue[14]) { /* constants */
/* K0 */ be_nested_str_weak(animate),
/* K1 */ be_nested_str_weak(strip),
/* K2 */ be_nested_str_weak(bri),
@@ -459,10 +693,11 @@ be_local_closure(Animate_core_init, /* name */
/* K10 */ be_nested_str_weak(fast_loop_cb),
/* K11 */ be_nested_str_weak(back_color),
/* K12 */ be_const_int(0),
+ /* K13 */ be_nested_str_weak(set_current),
}),
be_str_weak(init),
&be_const_str_solidified,
- ( &(const binstruction[33]) { /* code */
+ ( &(const binstruction[35]) { /* code */
0xA40E0000, // 0000 IMPORT R3 K0
0x90020201, // 0001 SETMBR R0 K1 R1
0x4C100000, // 0002 LDNIL R4
@@ -494,143 +729,10 @@ be_local_closure(Animate_core_init, /* name */
0x84100000, // 001C CLOSURE R4 P0
0x90021404, // 001D SETMBR R0 K10 R4
0x9002170C, // 001E SETMBR R0 K11 K12
- 0xA0000000, // 001F CLOSE R0
- 0x80000000, // 0020 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: stop
-********************************************************************/
-be_local_closure(Animate_core_stop, /* name */
- be_nested_proto(
- 6, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 8]) { /* constants */
- /* K0 */ be_nested_str_weak(running),
- /* K1 */ be_nested_str_weak(animators),
- /* K2 */ be_const_int(0),
- /* K3 */ be_nested_str_weak(stop),
- /* K4 */ be_const_int(1),
- /* K5 */ be_nested_str_weak(tasmota),
- /* K6 */ be_nested_str_weak(remove_fast_loop),
- /* K7 */ be_nested_str_weak(fast_loop_cb),
- }),
- be_str_weak(stop),
- &be_const_str_solidified,
- ( &(const binstruction[19]) { /* code */
- 0x50040000, // 0000 LDBOOL R1 0 0
- 0x90020001, // 0001 SETMBR R0 K0 R1
- 0x88040101, // 0002 GETMBR R1 R0 K1
- 0x58080002, // 0003 LDCONST R2 K2
- 0x600C000C, // 0004 GETGBL R3 G12
- 0x5C100200, // 0005 MOVE R4 R1
- 0x7C0C0200, // 0006 CALL R3 1
- 0x140C0403, // 0007 LT R3 R2 R3
- 0x780E0004, // 0008 JMPF R3 #000E
- 0x940C0202, // 0009 GETIDX R3 R1 R2
- 0x8C0C0703, // 000A GETMET R3 R3 K3
- 0x7C0C0200, // 000B CALL R3 1
- 0x00080504, // 000C ADD R2 R2 K4
- 0x7001FFF5, // 000D JMP #0004
- 0xB80E0A00, // 000E GETNGBL R3 K5
- 0x8C0C0706, // 000F GETMET R3 R3 K6
- 0x88140107, // 0010 GETMBR R5 R0 K7
- 0x7C0C0400, // 0011 CALL R3 2
- 0x80000000, // 0012 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: animate
-********************************************************************/
-be_local_closure(Animate_core_animate, /* name */
- be_nested_proto(
- 1, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 0, /* has constants */
- NULL, /* no const */
- be_str_weak(animate),
- &be_const_str_solidified,
- ( &(const binstruction[ 1]) { /* code */
- 0x80000000, // 0000 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: set_cb
-********************************************************************/
-be_local_closure(Animate_core_set_cb, /* name */
- be_nested_proto(
- 3, /* nstack */
- 3, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(obj),
- /* K1 */ be_nested_str_weak(mth),
- }),
- be_str_weak(set_cb),
- &be_const_str_solidified,
- ( &(const binstruction[ 3]) { /* code */
- 0x90020001, // 0000 SETMBR R0 K0 R1
- 0x90020202, // 0001 SETMBR R0 K1 R2
- 0x80000000, // 0002 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: add_painter
-********************************************************************/
-be_local_closure(Animate_core_add_painter, /* name */
- be_nested_proto(
- 5, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(painters),
- /* K1 */ be_nested_str_weak(push),
- }),
- be_str_weak(add_painter),
- &be_const_str_solidified,
- ( &(const binstruction[ 5]) { /* code */
- 0x88080100, // 0000 GETMBR R2 R0 K0
- 0x8C080501, // 0001 GETMET R2 R2 K1
- 0x5C100200, // 0002 MOVE R4 R1
- 0x7C080400, // 0003 CALL R2 2
- 0x80000000, // 0004 RET 0
+ 0x8C10010D, // 001F GETMET R4 R0 K13
+ 0x7C100200, // 0020 CALL R4 1
+ 0xA0000000, // 0021 CLOSE R0
+ 0x80000000, // 0022 RET 0
})
)
);
@@ -664,98 +766,45 @@ be_local_closure(Animate_core_get_bri, /* name */
/*******************************************************************/
-/********************************************************************
-** Solidified function: set_back_color
-********************************************************************/
-be_local_closure(Animate_core_set_back_color, /* name */
- be_nested_proto(
- 2, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(back_color),
- }),
- be_str_weak(set_back_color),
- &be_const_str_solidified,
- ( &(const binstruction[ 2]) { /* code */
- 0x90020001, // 0000 SETMBR R0 K0 R1
- 0x80000000, // 0001 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: set_bri
-********************************************************************/
-be_local_closure(Animate_core_set_bri, /* name */
- be_nested_proto(
- 2, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(bri),
- }),
- be_str_weak(set_bri),
- &be_const_str_solidified,
- ( &(const binstruction[ 2]) { /* code */
- 0x90020001, // 0000 SETMBR R0 K0 R1
- 0x80000000, // 0001 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
/********************************************************************
** Solidified class: Animate_core
********************************************************************/
be_local_class(Animate_core,
13,
NULL,
- be_nested_map(30,
+ be_nested_map(31,
( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(running, -1), be_const_var(3) },
- { be_const_key_weak(pixel_count, -1), be_const_var(1) },
- { be_const_key_weak(fast_loop, -1), be_const_closure(Animate_core_fast_loop_closure) },
- { be_const_key_weak(animators, 8), be_const_var(4) },
- { be_const_key_weak(fast_loop_cb, 7), be_const_var(6) },
- { be_const_key_weak(set_back_color, 26), be_const_closure(Animate_core_set_back_color_closure) },
- { be_const_key_weak(add_animator, -1), be_const_closure(Animate_core_add_animator_closure) },
- { be_const_key_weak(frame, -1), be_const_var(10) },
- { be_const_key_weak(strip, 27), be_const_var(0) },
- { be_const_key_weak(remove_animator, 5), be_const_closure(Animate_core_remove_animator_closure) },
- { be_const_key_weak(init, -1), be_const_closure(Animate_core_init_closure) },
- { be_const_key_weak(start, -1), be_const_closure(Animate_core_start_closure) },
- { be_const_key_weak(mth, -1), be_const_var(9) },
- { be_const_key_weak(add_painter, -1), be_const_closure(Animate_core_add_painter_closure) },
- { be_const_key_weak(clear, -1), be_const_closure(Animate_core_clear_closure) },
- { be_const_key_weak(remove_painter, 23), be_const_closure(Animate_core_remove_painter_closure) },
- { be_const_key_weak(layer, -1), be_const_var(11) },
- { be_const_key_weak(stop, -1), be_const_closure(Animate_core_stop_closure) },
- { be_const_key_weak(fast_loop_next, 16), be_const_var(7) },
- { be_const_key_weak(FAST_LOOP_MIN, -1), be_const_int(20) },
- { be_const_key_weak(animate, -1), be_const_closure(Animate_core_animate_closure) },
- { be_const_key_weak(back_color, -1), be_const_var(12) },
- { be_const_key_weak(obj, 21), be_const_var(8) },
- { be_const_key_weak(set_cb, 10), be_const_closure(Animate_core_set_cb_closure) },
- { be_const_key_weak(bri, 13), be_const_var(2) },
{ be_const_key_weak(get_bri, -1), be_const_closure(Animate_core_get_bri_closure) },
- { be_const_key_weak(painters, 28), be_const_var(5) },
- { be_const_key_weak(add_background_animator, 1), be_const_closure(Animate_core_add_background_animator_closure) },
{ be_const_key_weak(remove, -1), be_const_closure(Animate_core_remove_closure) },
+ { be_const_key_weak(painters, -1), be_const_var(5) },
+ { be_const_key_weak(fast_loop_cb, -1), be_const_var(6) },
+ { be_const_key_weak(start, 6), be_const_closure(Animate_core_start_closure) },
+ { be_const_key_weak(add_background_animator, -1), be_const_closure(Animate_core_add_background_animator_closure) },
+ { be_const_key_weak(set_back_color, 30), be_const_closure(Animate_core_set_back_color_closure) },
+ { be_const_key_weak(add_animator, -1), be_const_closure(Animate_core_add_animator_closure) },
+ { be_const_key_weak(strip, 3), be_const_var(0) },
+ { be_const_key_weak(animate, 14), be_const_closure(Animate_core_animate_closure) },
+ { be_const_key_weak(clear, 0), be_const_closure(Animate_core_clear_closure) },
+ { be_const_key_weak(stop, -1), be_const_closure(Animate_core_stop_closure) },
+ { be_const_key_weak(remove_painter, 28), be_const_closure(Animate_core_remove_painter_closure) },
+ { be_const_key_weak(fast_loop_next, 21), be_const_var(7) },
+ { be_const_key_weak(animators, -1), be_const_var(4) },
+ { be_const_key_weak(add_painter, -1), be_const_closure(Animate_core_add_painter_closure) },
{ be_const_key_weak(set_bri, -1), be_const_closure(Animate_core_set_bri_closure) },
+ { be_const_key_weak(frame, -1), be_const_var(10) },
+ { be_const_key_weak(mth, 26), be_const_var(9) },
+ { be_const_key_weak(back_color, -1), be_const_var(12) },
+ { be_const_key_weak(set_current, -1), be_const_closure(Animate_core_set_current_closure) },
+ { be_const_key_weak(bri, -1), be_const_var(2) },
+ { be_const_key_weak(fast_loop, -1), be_const_closure(Animate_core_fast_loop_closure) },
+ { be_const_key_weak(layer, -1), be_const_var(11) },
+ { be_const_key_weak(set_cb, 23), be_const_closure(Animate_core_set_cb_closure) },
+ { be_const_key_weak(remove_animator, 22), be_const_closure(Animate_core_remove_animator_closure) },
+ { be_const_key_weak(FAST_LOOP_MIN, -1), be_const_int(20) },
+ { be_const_key_weak(pixel_count, -1), be_const_var(1) },
+ { be_const_key_weak(obj, -1), be_const_var(8) },
+ { be_const_key_weak(init, -1), be_const_closure(Animate_core_init_closure) },
+ { be_const_key_weak(running, -1), be_const_var(3) },
})),
be_str_weak(Animate_core)
);
diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_1_animate_effects.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_1_animate_effects.h
index 9831e5a6e..21bcdeb19 100644
--- a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_1_animate_effects.h
+++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_1_animate_effects.h
@@ -4,6 +4,89 @@
\********************************************************************/
#include "be_constobj.h"
+extern const bclass be_class_Animate_painter;
+
+/********************************************************************
+** Solidified function: init
+********************************************************************/
+be_local_closure(Animate_painter_init, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(global),
+ /* K1 */ be_nested_str_weak(_cur_anim),
+ /* K2 */ be_nested_str_weak(add_painter),
+ }),
+ be_str_weak(init),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 9]) { /* code */
+ 0xB8060000, // 0000 GETNGBL R1 K0
+ 0x88040301, // 0001 GETMBR R1 R1 K1
+ 0x4C080000, // 0002 LDNIL R2
+ 0x20080202, // 0003 NE R2 R1 R2
+ 0x780A0002, // 0004 JMPF R2 #0008
+ 0x8C080302, // 0005 GETMET R2 R1 K2
+ 0x5C100000, // 0006 MOVE R4 R0
+ 0x7C080400, // 0007 CALL R2 2
+ 0x80000000, // 0008 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: paint
+********************************************************************/
+be_local_closure(Animate_painter_paint, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 0, /* has constants */
+ NULL, /* no const */
+ be_str_weak(paint),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 1]) { /* code */
+ 0x80000000, // 0000 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified class: Animate_painter
+********************************************************************/
+be_local_class(Animate_painter,
+ 0,
+ NULL,
+ be_nested_map(2,
+ ( (struct bmapnode*) &(const bmapnode[]) {
+ { be_const_key_weak(paint, -1), be_const_closure(Animate_painter_paint_closure) },
+ { be_const_key_weak(init, 0), be_const_closure(Animate_painter_init_closure) },
+ })),
+ be_str_weak(Animate_painter)
+);
+/*******************************************************************/
+
+void be_load_Animate_painter_class(bvm *vm) {
+ be_pushntvclass(vm, &be_class_Animate_painter);
+ be_setglobal(vm, "Animate_painter");
+ be_pop(vm, 1);
+}
+
extern const bclass be_class_Animate_pulse;
/********************************************************************
@@ -146,7 +229,7 @@ be_local_closure(Animate_pulse_set_color, /* name */
********************************************************************/
be_local_closure(Animate_pulse_init, /* name */
be_nested_proto(
- 5, /* nstack */
+ 6, /* nstack */
4, /* argc */
2, /* varg */
0, /* has upvals */
@@ -154,44 +237,50 @@ be_local_closure(Animate_pulse_init, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 9]) { /* constants */
- /* K0 */ be_const_int(16777215),
- /* K1 */ be_const_int(1),
- /* K2 */ be_const_int(0),
- /* K3 */ be_nested_str_weak(color),
- /* K4 */ be_nested_str_weak(back_color),
- /* K5 */ be_const_int(-16777216),
- /* K6 */ be_nested_str_weak(pulse_size),
- /* K7 */ be_nested_str_weak(slew_size),
- /* K8 */ be_nested_str_weak(pos),
+ ( &(const bvalue[10]) { /* constants */
+ /* K0 */ be_nested_str_weak(init),
+ /* K1 */ be_const_int(16777215),
+ /* K2 */ be_const_int(1),
+ /* K3 */ be_const_int(0),
+ /* K4 */ be_nested_str_weak(color),
+ /* K5 */ be_nested_str_weak(back_color),
+ /* K6 */ be_const_int(-16777216),
+ /* K7 */ be_nested_str_weak(pulse_size),
+ /* K8 */ be_nested_str_weak(slew_size),
+ /* K9 */ be_nested_str_weak(pos),
}),
be_str_weak(init),
&be_const_str_solidified,
- ( &(const binstruction[24]) { /* code */
- 0x4C100000, // 0000 LDNIL R4
- 0x1C100204, // 0001 EQ R4 R1 R4
- 0x78120000, // 0002 JMPF R4 #0004
- 0x58040000, // 0003 LDCONST R1 K0
- 0x4C100000, // 0004 LDNIL R4
- 0x1C100404, // 0005 EQ R4 R2 R4
- 0x78120000, // 0006 JMPF R4 #0008
- 0x58080001, // 0007 LDCONST R2 K1
- 0x4C100000, // 0008 LDNIL R4
- 0x1C100604, // 0009 EQ R4 R3 R4
- 0x78120000, // 000A JMPF R4 #000C
- 0x580C0002, // 000B LDCONST R3 K2
- 0x90020601, // 000C SETMBR R0 K3 R1
- 0x90020905, // 000D SETMBR R0 K4 K5
- 0x14100502, // 000E LT R4 R2 K2
+ ( &(const binstruction[29]) { /* code */
+ 0x60100003, // 0000 GETGBL R4 G3
+ 0x5C140000, // 0001 MOVE R5 R0
+ 0x7C100200, // 0002 CALL R4 1
+ 0x8C100900, // 0003 GETMET R4 R4 K0
+ 0x7C100200, // 0004 CALL R4 1
+ 0x4C100000, // 0005 LDNIL R4
+ 0x1C100204, // 0006 EQ R4 R1 R4
+ 0x78120000, // 0007 JMPF R4 #0009
+ 0x58040001, // 0008 LDCONST R1 K1
+ 0x4C100000, // 0009 LDNIL R4
+ 0x1C100404, // 000A EQ R4 R2 R4
+ 0x78120000, // 000B JMPF R4 #000D
+ 0x58080002, // 000C LDCONST R2 K2
+ 0x4C100000, // 000D LDNIL R4
+ 0x1C100604, // 000E EQ R4 R3 R4
0x78120000, // 000F JMPF R4 #0011
- 0x58080002, // 0010 LDCONST R2 K2
- 0x90020C02, // 0011 SETMBR R0 K6 R2
- 0x14100702, // 0012 LT R4 R3 K2
- 0x78120000, // 0013 JMPF R4 #0015
- 0x580C0002, // 0014 LDCONST R3 K2
- 0x90020E03, // 0015 SETMBR R0 K7 R3
- 0x90021102, // 0016 SETMBR R0 K8 K2
- 0x80000000, // 0017 RET 0
+ 0x580C0003, // 0010 LDCONST R3 K3
+ 0x90020801, // 0011 SETMBR R0 K4 R1
+ 0x90020B06, // 0012 SETMBR R0 K5 K6
+ 0x14100503, // 0013 LT R4 R2 K3
+ 0x78120000, // 0014 JMPF R4 #0016
+ 0x58080003, // 0015 LDCONST R2 K3
+ 0x90020E02, // 0016 SETMBR R0 K7 R2
+ 0x14100703, // 0017 LT R4 R3 K3
+ 0x78120000, // 0018 JMPF R4 #001A
+ 0x580C0003, // 0019 LDCONST R3 K3
+ 0x90021003, // 001A SETMBR R0 K8 R3
+ 0x90021303, // 001B SETMBR R0 K9 K3
+ 0x80000000, // 001C RET 0
})
)
);
@@ -329,9 +418,10 @@ be_local_closure(Animate_pulse_paint, /* name */
/********************************************************************
** Solidified class: Animate_pulse
********************************************************************/
+extern const bclass be_class_Animate_painter;
be_local_class(Animate_pulse,
5,
- NULL,
+ &be_class_Animate_painter,
be_nested_map(12,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(paint, -1), be_const_closure(Animate_pulse_paint_closure) },
diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_9_module.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_9_module.h
index a1def1f3d..7f12ffcca 100644
--- a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_9_module.h
+++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_9_module.h
@@ -64,22 +64,31 @@ be_local_closure(Animate_animator_beat, /* name */
********************************************************************/
be_local_closure(Animate_animator_init, /* name */
be_nested_proto(
- 2, /* nstack */
- 2, /* argc */
+ 5, /* nstack */
+ 1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(duration_ms),
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(global),
+ /* K1 */ be_nested_str_weak(_cur_anim),
+ /* K2 */ be_nested_str_weak(add_animator),
}),
be_str_weak(init),
&be_const_str_solidified,
- ( &(const binstruction[ 2]) { /* code */
- 0x90020001, // 0000 SETMBR R0 K0 R1
- 0x80000000, // 0001 RET 0
+ ( &(const binstruction[ 9]) { /* code */
+ 0xB8060000, // 0000 GETNGBL R1 K0
+ 0x88040301, // 0001 GETMBR R1 R1 K1
+ 0x4C080000, // 0002 LDNIL R2
+ 0x20080202, // 0003 NE R2 R1 R2
+ 0x780A0002, // 0004 JMPF R2 #0008
+ 0x8C080302, // 0005 GETMET R2 R1 K2
+ 0x5C100000, // 0006 MOVE R4 R0
+ 0x7C080400, // 0007 CALL R2 2
+ 0x80000000, // 0008 RET 0
})
)
);
@@ -252,72 +261,72 @@ void be_load_Animate_animator_class(bvm *vm) {
extern const bclass be_class_Animate_palette;
/********************************************************************
-** Solidified function: init
+** Solidified function: ptr_to_palette
********************************************************************/
-be_local_closure(Animate_palette_init, /* name */
+be_local_closure(Animate_palette_ptr_to_palette, /* name */
be_nested_proto(
- 6, /* nstack */
- 3, /* argc */
- 2, /* varg */
+ 8, /* nstack */
+ 1, /* argc */
+ 4, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[11]) { /* constants */
- /* K0 */ be_nested_str_weak(init),
- /* K1 */ be_nested_str_weak(running),
- /* K2 */ be_nested_str_weak(ptr),
- /* K3 */ be_nested_str_weak(ptr_to_palette),
- /* K4 */ be_nested_str_weak(palette),
- /* K5 */ be_nested_str_weak(bri),
- /* K6 */ be_nested_str_weak(slots),
- /* K7 */ be_nested_str_weak(set_duration),
- /* K8 */ be_nested_str_weak(color),
- /* K9 */ be_nested_str_weak(light_state),
- /* K10 */ be_nested_str_weak(RGB),
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_const_class(be_class_Animate_palette),
+ /* K1 */ be_nested_str_weak(ptr),
+ /* K2 */ be_const_int(1),
+ /* K3 */ be_const_int(0),
}),
- be_str_weak(init),
+ be_str_weak(ptr_to_palette),
&be_const_str_solidified,
- ( &(const binstruction[38]) { /* code */
- 0x600C0003, // 0000 GETGBL R3 G3
- 0x5C100000, // 0001 MOVE R4 R0
- 0x7C0C0200, // 0002 CALL R3 1
- 0x8C0C0700, // 0003 GETMET R3 R3 K0
- 0x5C140400, // 0004 MOVE R5 R2
- 0x7C0C0400, // 0005 CALL R3 2
- 0x500C0000, // 0006 LDBOOL R3 0 0
- 0x90020203, // 0007 SETMBR R0 K1 R3
- 0x600C0004, // 0008 GETGBL R3 G4
- 0x5C100200, // 0009 MOVE R4 R1
- 0x7C0C0200, // 000A CALL R3 1
- 0x1C0C0702, // 000B EQ R3 R3 K2
- 0x780E0003, // 000C JMPF R3 #0011
- 0x8C0C0103, // 000D GETMET R3 R0 K3
- 0x5C140200, // 000E MOVE R5 R1
- 0x7C0C0400, // 000F CALL R3 2
- 0x5C040600, // 0010 MOVE R1 R3
- 0x90020801, // 0011 SETMBR R0 K4 R1
- 0x540E0063, // 0012 LDINT R3 100
- 0x90020A03, // 0013 SETMBR R0 K5 R3
- 0x600C000C, // 0014 GETGBL R3 G12
- 0x5C100200, // 0015 MOVE R4 R1
- 0x7C0C0200, // 0016 CALL R3 1
- 0x54120003, // 0017 LDINT R4 4
- 0x0C0C0604, // 0018 DIV R3 R3 R4
- 0x90020C03, // 0019 SETMBR R0 K6 R3
- 0x4C0C0000, // 001A LDNIL R3
- 0x200C0403, // 001B NE R3 R2 R3
- 0x780E0002, // 001C JMPF R3 #0020
- 0x8C0C0107, // 001D GETMET R3 R0 K7
- 0x5C140400, // 001E MOVE R5 R2
- 0x7C0C0400, // 001F CALL R3 2
- 0xB80E1200, // 0020 GETNGBL R3 K9
- 0xB8121200, // 0021 GETNGBL R4 K9
- 0x8810090A, // 0022 GETMBR R4 R4 K10
- 0x7C0C0200, // 0023 CALL R3 1
- 0x90021003, // 0024 SETMBR R0 K8 R3
- 0x80000000, // 0025 RET 0
+ ( &(const binstruction[45]) { /* code */
+ 0x58040000, // 0000 LDCONST R1 K0
+ 0x60080004, // 0001 GETGBL R2 G4
+ 0x5C0C0000, // 0002 MOVE R3 R0
+ 0x7C080200, // 0003 CALL R2 1
+ 0x1C080501, // 0004 EQ R2 R2 K1
+ 0x780A0025, // 0005 JMPF R2 #002C
+ 0x60080015, // 0006 GETGBL R2 G21
+ 0x5C0C0000, // 0007 MOVE R3 R0
+ 0x541207CF, // 0008 LDINT R4 2000
+ 0x7C080400, // 0009 CALL R2 2
+ 0x580C0002, // 000A LDCONST R3 K2
+ 0x94100503, // 000B GETIDX R4 R2 K3
+ 0x20100903, // 000C NE R4 R4 K3
+ 0x7812000A, // 000D JMPF R4 #0019
+ 0x50100200, // 000E LDBOOL R4 1 0
+ 0x78120007, // 000F JMPF R4 #0018
+ 0x54120003, // 0010 LDINT R4 4
+ 0x08100604, // 0011 MUL R4 R3 R4
+ 0x94100404, // 0012 GETIDX R4 R2 R4
+ 0x1C100903, // 0013 EQ R4 R4 K3
+ 0x78120000, // 0014 JMPF R4 #0016
+ 0x70020001, // 0015 JMP #0018
+ 0x000C0702, // 0016 ADD R3 R3 K2
+ 0x7001FFF5, // 0017 JMP #000E
+ 0x7002000A, // 0018 JMP #0024
+ 0x50100200, // 0019 LDBOOL R4 1 0
+ 0x78120008, // 001A JMPF R4 #0024
+ 0x54120003, // 001B LDINT R4 4
+ 0x08100604, // 001C MUL R4 R3 R4
+ 0x94100404, // 001D GETIDX R4 R2 R4
+ 0x541600FE, // 001E LDINT R5 255
+ 0x1C100805, // 001F EQ R4 R4 R5
+ 0x78120000, // 0020 JMPF R4 #0022
+ 0x70020001, // 0021 JMP #0024
+ 0x000C0702, // 0022 ADD R3 R3 K2
+ 0x7001FFF4, // 0023 JMP #0019
+ 0x00100702, // 0024 ADD R4 R3 K2
+ 0x54160003, // 0025 LDINT R5 4
+ 0x08100805, // 0026 MUL R4 R4 R5
+ 0x60140015, // 0027 GETGBL R5 G21
+ 0x5C180000, // 0028 MOVE R6 R0
+ 0x5C1C0800, // 0029 MOVE R7 R4
+ 0x7C140400, // 002A CALL R5 2
+ 0x80040A00, // 002B RET 1 R5
+ 0x80000000, // 002C RET 0
})
)
);
@@ -563,72 +572,69 @@ be_local_closure(Animate_palette_animate, /* name */
/********************************************************************
-** Solidified function: ptr_to_palette
+** Solidified function: set_palette
********************************************************************/
-be_local_closure(Animate_palette_ptr_to_palette, /* name */
+be_local_closure(Animate_palette_set_palette, /* name */
be_nested_proto(
- 8, /* nstack */
- 1, /* argc */
- 4, /* varg */
+ 6, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_const_class(be_class_Animate_palette),
- /* K1 */ be_nested_str_weak(ptr),
- /* K2 */ be_const_int(1),
- /* K3 */ be_const_int(0),
+ ( &(const bvalue[ 9]) { /* constants */
+ /* K0 */ be_nested_str_weak(ptr),
+ /* K1 */ be_nested_str_weak(ptr_to_palette),
+ /* K2 */ be_nested_str_weak(palette),
+ /* K3 */ be_nested_str_weak(slots),
+ /* K4 */ be_nested_str_weak(duration_ms),
+ /* K5 */ be_nested_str_weak(set_duration),
+ /* K6 */ be_nested_str_weak(range_min),
+ /* K7 */ be_nested_str_weak(range_max),
+ /* K8 */ be_nested_str_weak(set_range),
}),
- be_str_weak(ptr_to_palette),
+ be_str_weak(set_palette),
&be_const_str_solidified,
- ( &(const binstruction[45]) { /* code */
- 0x58040000, // 0000 LDCONST R1 K0
- 0x60080004, // 0001 GETGBL R2 G4
- 0x5C0C0000, // 0002 MOVE R3 R0
- 0x7C080200, // 0003 CALL R2 1
- 0x1C080501, // 0004 EQ R2 R2 K1
- 0x780A0025, // 0005 JMPF R2 #002C
- 0x60080015, // 0006 GETGBL R2 G21
- 0x5C0C0000, // 0007 MOVE R3 R0
- 0x541207CF, // 0008 LDINT R4 2000
- 0x7C080400, // 0009 CALL R2 2
- 0x580C0002, // 000A LDCONST R3 K2
- 0x94100503, // 000B GETIDX R4 R2 K3
- 0x20100903, // 000C NE R4 R4 K3
- 0x7812000A, // 000D JMPF R4 #0019
- 0x50100200, // 000E LDBOOL R4 1 0
- 0x78120007, // 000F JMPF R4 #0018
- 0x54120003, // 0010 LDINT R4 4
- 0x08100604, // 0011 MUL R4 R3 R4
- 0x94100404, // 0012 GETIDX R4 R2 R4
- 0x1C100903, // 0013 EQ R4 R4 K3
- 0x78120000, // 0014 JMPF R4 #0016
- 0x70020001, // 0015 JMP #0018
- 0x000C0702, // 0016 ADD R3 R3 K2
- 0x7001FFF5, // 0017 JMP #000E
- 0x7002000A, // 0018 JMP #0024
- 0x50100200, // 0019 LDBOOL R4 1 0
- 0x78120008, // 001A JMPF R4 #0024
- 0x54120003, // 001B LDINT R4 4
- 0x08100604, // 001C MUL R4 R3 R4
- 0x94100404, // 001D GETIDX R4 R2 R4
- 0x541600FE, // 001E LDINT R5 255
- 0x1C100805, // 001F EQ R4 R4 R5
- 0x78120000, // 0020 JMPF R4 #0022
- 0x70020001, // 0021 JMP #0024
- 0x000C0702, // 0022 ADD R3 R3 K2
- 0x7001FFF4, // 0023 JMP #0019
- 0x00100702, // 0024 ADD R4 R3 K2
- 0x54160003, // 0025 LDINT R5 4
- 0x08100805, // 0026 MUL R4 R4 R5
- 0x60140015, // 0027 GETGBL R5 G21
- 0x5C180000, // 0028 MOVE R6 R0
- 0x5C1C0800, // 0029 MOVE R7 R4
- 0x7C140400, // 002A CALL R5 2
- 0x80040A00, // 002B RET 1 R5
- 0x80000000, // 002C RET 0
+ ( &(const binstruction[37]) { /* code */
+ 0x60080004, // 0000 GETGBL R2 G4
+ 0x5C0C0200, // 0001 MOVE R3 R1
+ 0x7C080200, // 0002 CALL R2 1
+ 0x1C080500, // 0003 EQ R2 R2 K0
+ 0x780A0003, // 0004 JMPF R2 #0009
+ 0x8C080101, // 0005 GETMET R2 R0 K1
+ 0x5C100200, // 0006 MOVE R4 R1
+ 0x7C080400, // 0007 CALL R2 2
+ 0x5C040400, // 0008 MOVE R1 R2
+ 0x90020401, // 0009 SETMBR R0 K2 R1
+ 0x6008000C, // 000A GETGBL R2 G12
+ 0x5C0C0200, // 000B MOVE R3 R1
+ 0x7C080200, // 000C CALL R2 1
+ 0x540E0003, // 000D LDINT R3 4
+ 0x0C080403, // 000E DIV R2 R2 R3
+ 0x90020602, // 000F SETMBR R0 K3 R2
+ 0x88080104, // 0010 GETMBR R2 R0 K4
+ 0x4C0C0000, // 0011 LDNIL R3
+ 0x20080403, // 0012 NE R2 R2 R3
+ 0x780A0003, // 0013 JMPF R2 #0018
+ 0x8C080105, // 0014 GETMET R2 R0 K5
+ 0x88100104, // 0015 GETMBR R4 R0 K4
+ 0x7C080400, // 0016 CALL R2 2
+ 0x7002000B, // 0017 JMP #0024
+ 0x88080106, // 0018 GETMBR R2 R0 K6
+ 0x4C0C0000, // 0019 LDNIL R3
+ 0x20080403, // 001A NE R2 R2 R3
+ 0x780A0007, // 001B JMPF R2 #0024
+ 0x88080107, // 001C GETMBR R2 R0 K7
+ 0x4C0C0000, // 001D LDNIL R3
+ 0x20080403, // 001E NE R2 R2 R3
+ 0x780A0003, // 001F JMPF R2 #0024
+ 0x8C080108, // 0020 GETMET R2 R0 K8
+ 0x88100106, // 0021 GETMBR R4 R0 K6
+ 0x88140107, // 0022 GETMBR R5 R0 K7
+ 0x7C080600, // 0023 CALL R2 3
+ 0x80000000, // 0024 RET 0
})
)
);
@@ -636,40 +642,109 @@ be_local_closure(Animate_palette_ptr_to_palette, /* name */
/********************************************************************
-** Solidified function: set_range
+** Solidified function: to_css_gradient
********************************************************************/
-be_local_closure(Animate_palette_set_range, /* name */
+be_local_closure(Animate_palette_to_css_gradient, /* name */
be_nested_proto(
- 7, /* nstack */
- 3, /* argc */
+ 17, /* nstack */
+ 1, /* argc */
+ 4, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[10]) { /* constants */
+ /* K0 */ be_const_class(be_class_Animate_palette),
+ /* K1 */ be_nested_str_weak(parse_palette),
+ /* K2 */ be_const_int(0),
+ /* K3 */ be_nested_str_weak(background_X3Alinear_X2Dgradient_X28to_X20right),
+ /* K4 */ be_nested_str_weak(palette),
+ /* K5 */ be_nested_str_weak(get),
+ /* K6 */ be_nested_str_weak(_X2C_X23_X2502X_X2502X_X2502X_X20_X25_X2E1f_X25_X25),
+ /* K7 */ be_const_real_hex(0x41200000),
+ /* K8 */ be_const_int(1),
+ /* K9 */ be_nested_str_weak(_X29_X3B),
+ }),
+ be_str_weak(to_css_gradient),
+ &be_const_str_solidified,
+ ( &(const binstruction[46]) { /* code */
+ 0x58040000, // 0000 LDCONST R1 K0
+ 0x5C080200, // 0001 MOVE R2 R1
+ 0x5C0C0000, // 0002 MOVE R3 R0
+ 0x7C080200, // 0003 CALL R2 1
+ 0x8C0C0501, // 0004 GETMET R3 R2 K1
+ 0x58140002, // 0005 LDCONST R5 K2
+ 0x541A03E7, // 0006 LDINT R6 1000
+ 0x7C0C0600, // 0007 CALL R3 3
+ 0x58100003, // 0008 LDCONST R4 K3
+ 0x58140002, // 0009 LDCONST R5 K2
+ 0x6018000C, // 000A GETGBL R6 G12
+ 0x5C1C0600, // 000B MOVE R7 R3
+ 0x7C180200, // 000C CALL R6 1
+ 0x14180A06, // 000D LT R6 R5 R6
+ 0x781A001C, // 000E JMPF R6 #002C
+ 0x94180605, // 000F GETIDX R6 R3 R5
+ 0x881C0504, // 0010 GETMBR R7 R2 K4
+ 0x8C1C0F05, // 0011 GETMET R7 R7 K5
+ 0x54260003, // 0012 LDINT R9 4
+ 0x08240A09, // 0013 MUL R9 R5 R9
+ 0x542A0003, // 0014 LDINT R10 4
+ 0x7C1C0600, // 0015 CALL R7 3
+ 0x54220007, // 0016 LDINT R8 8
+ 0x3C200E08, // 0017 SHR R8 R7 R8
+ 0x542600FE, // 0018 LDINT R9 255
+ 0x2C201009, // 0019 AND R8 R8 R9
+ 0x5426000F, // 001A LDINT R9 16
+ 0x3C240E09, // 001B SHR R9 R7 R9
+ 0x542A00FE, // 001C LDINT R10 255
+ 0x2C24120A, // 001D AND R9 R9 R10
+ 0x542A0017, // 001E LDINT R10 24
+ 0x3C280E0A, // 001F SHR R10 R7 R10
+ 0x542E00FE, // 0020 LDINT R11 255
+ 0x2C28140B, // 0021 AND R10 R10 R11
+ 0x602C0018, // 0022 GETGBL R11 G24
+ 0x58300006, // 0023 LDCONST R12 K6
+ 0x5C341000, // 0024 MOVE R13 R8
+ 0x5C381200, // 0025 MOVE R14 R9
+ 0x5C3C1400, // 0026 MOVE R15 R10
+ 0x0C400D07, // 0027 DIV R16 R6 K7
+ 0x7C2C0A00, // 0028 CALL R11 5
+ 0x0010080B, // 0029 ADD R4 R4 R11
+ 0x00140B08, // 002A ADD R5 R5 K8
+ 0x7001FFDD, // 002B JMP #000A
+ 0x00100909, // 002C ADD R4 R4 K9
+ 0x80040800, // 002D RET 1 R4
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_bri
+********************************************************************/
+be_local_closure(Animate_palette_set_bri, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 6]) { /* constants */
- /* K0 */ be_nested_str_weak(value_error),
- /* K1 */ be_nested_str_weak(min_X20must_X20be_X20lower_X20than_X20mex),
- /* K2 */ be_nested_str_weak(range_min),
- /* K3 */ be_nested_str_weak(range_max),
- /* K4 */ be_nested_str_weak(slots_arr),
- /* K5 */ be_nested_str_weak(parse_palette),
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(bri),
}),
- be_str_weak(set_range),
+ be_str_weak(set_bri),
&be_const_str_solidified,
- ( &(const binstruction[11]) { /* code */
- 0x280C0202, // 0000 GE R3 R1 R2
- 0x780E0000, // 0001 JMPF R3 #0003
- 0xB0060101, // 0002 RAISE 1 K0 K1
- 0x90020401, // 0003 SETMBR R0 K2 R1
- 0x90020602, // 0004 SETMBR R0 K3 R2
- 0x8C0C0105, // 0005 GETMET R3 R0 K5
- 0x5C140200, // 0006 MOVE R5 R1
- 0x5C180400, // 0007 MOVE R6 R2
- 0x7C0C0600, // 0008 CALL R3 3
- 0x90020803, // 0009 SETMBR R0 K4 R3
- 0x80000000, // 000A RET 0
+ ( &(const binstruction[ 5]) { /* code */
+ 0x60080009, // 0000 GETGBL R2 G9
+ 0x5C0C0200, // 0001 MOVE R3 R1
+ 0x7C080200, // 0002 CALL R2 1
+ 0x90020002, // 0003 SETMBR R0 K0 R2
+ 0x80000000, // 0004 RET 0
})
)
);
@@ -780,74 +855,40 @@ be_local_closure(Animate_palette_parse_palette, /* name */
/********************************************************************
-** Solidified function: set_bri
+** Solidified function: set_range
********************************************************************/
-be_local_closure(Animate_palette_set_bri, /* name */
+be_local_closure(Animate_palette_set_range, /* name */
be_nested_proto(
- 4, /* nstack */
- 2, /* argc */
+ 7, /* nstack */
+ 3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(bri),
- }),
- be_str_weak(set_bri),
- &be_const_str_solidified,
- ( &(const binstruction[ 5]) { /* code */
- 0x60080009, // 0000 GETGBL R2 G9
- 0x5C0C0200, // 0001 MOVE R3 R1
- 0x7C080200, // 0002 CALL R2 1
- 0x90020002, // 0003 SETMBR R0 K0 R2
- 0x80000000, // 0004 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: set_duration
-********************************************************************/
-be_local_closure(Animate_palette_set_duration, /* name */
- be_nested_proto(
- 6, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 7]) { /* constants */
- /* K0 */ be_const_int(0),
- /* K1 */ be_nested_str_weak(value_error),
- /* K2 */ be_nested_str_weak(duration_ms_X20must_X20be_X20positive),
- /* K3 */ be_nested_str_weak(duration_ms),
+ ( &(const bvalue[ 6]) { /* constants */
+ /* K0 */ be_nested_str_weak(value_error),
+ /* K1 */ be_nested_str_weak(min_X20must_X20be_X20lower_X20than_X20mex),
+ /* K2 */ be_nested_str_weak(range_min),
+ /* K3 */ be_nested_str_weak(range_max),
/* K4 */ be_nested_str_weak(slots_arr),
/* K5 */ be_nested_str_weak(parse_palette),
- /* K6 */ be_const_int(1),
}),
- be_str_weak(set_duration),
+ be_str_weak(set_range),
&be_const_str_solidified,
- ( &(const binstruction[14]) { /* code */
- 0x4C080000, // 0000 LDNIL R2
- 0x1C080202, // 0001 EQ R2 R1 R2
- 0x780A0000, // 0002 JMPF R2 #0004
- 0x80000400, // 0003 RET 0
- 0x18080300, // 0004 LE R2 R1 K0
- 0x780A0000, // 0005 JMPF R2 #0007
- 0xB0060302, // 0006 RAISE 1 K1 K2
- 0x90020601, // 0007 SETMBR R0 K3 R1
- 0x8C080105, // 0008 GETMET R2 R0 K5
- 0x58100000, // 0009 LDCONST R4 K0
- 0x04140306, // 000A SUB R5 R1 K6
- 0x7C080600, // 000B CALL R2 3
- 0x90020802, // 000C SETMBR R0 K4 R2
- 0x80000000, // 000D RET 0
+ ( &(const binstruction[11]) { /* code */
+ 0x280C0202, // 0000 GE R3 R1 R2
+ 0x780E0000, // 0001 JMPF R3 #0003
+ 0xB0060101, // 0002 RAISE 1 K0 K1
+ 0x90020401, // 0003 SETMBR R0 K2 R1
+ 0x90020602, // 0004 SETMBR R0 K3 R2
+ 0x8C0C0105, // 0005 GETMET R3 R0 K5
+ 0x5C140200, // 0006 MOVE R5 R1
+ 0x5C180400, // 0007 MOVE R6 R2
+ 0x7C0C0600, // 0008 CALL R3 3
+ 0x90020803, // 0009 SETMBR R0 K4 R3
+ 0x80000000, // 000A RET 0
})
)
);
@@ -988,79 +1029,95 @@ be_local_closure(Animate_palette_set_value, /* name */
/********************************************************************
-** Solidified function: to_css_gradient
+** Solidified function: set_duration
********************************************************************/
-be_local_closure(Animate_palette_to_css_gradient, /* name */
+be_local_closure(Animate_palette_set_duration, /* name */
be_nested_proto(
- 17, /* nstack */
- 1, /* argc */
- 4, /* varg */
+ 6, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[10]) { /* constants */
- /* K0 */ be_const_class(be_class_Animate_palette),
- /* K1 */ be_nested_str_weak(parse_palette),
- /* K2 */ be_const_int(0),
- /* K3 */ be_nested_str_weak(background_X3Alinear_X2Dgradient_X28to_X20right),
- /* K4 */ be_nested_str_weak(palette),
- /* K5 */ be_nested_str_weak(get),
- /* K6 */ be_nested_str_weak(_X2C_X23_X2502X_X2502X_X2502X_X20_X25_X2E1f_X25_X25),
- /* K7 */ be_const_real_hex(0x41200000),
- /* K8 */ be_const_int(1),
- /* K9 */ be_nested_str_weak(_X29_X3B),
+ ( &(const bvalue[ 7]) { /* constants */
+ /* K0 */ be_const_int(0),
+ /* K1 */ be_nested_str_weak(value_error),
+ /* K2 */ be_nested_str_weak(duration_ms_X20must_X20be_X20positive),
+ /* K3 */ be_nested_str_weak(duration_ms),
+ /* K4 */ be_nested_str_weak(slots_arr),
+ /* K5 */ be_nested_str_weak(parse_palette),
+ /* K6 */ be_const_int(1),
}),
- be_str_weak(to_css_gradient),
+ be_str_weak(set_duration),
&be_const_str_solidified,
- ( &(const binstruction[46]) { /* code */
- 0x58040000, // 0000 LDCONST R1 K0
- 0x5C080200, // 0001 MOVE R2 R1
- 0x5C0C0000, // 0002 MOVE R3 R0
- 0x7C080200, // 0003 CALL R2 1
- 0x8C0C0501, // 0004 GETMET R3 R2 K1
- 0x58140002, // 0005 LDCONST R5 K2
- 0x541A03E7, // 0006 LDINT R6 1000
- 0x7C0C0600, // 0007 CALL R3 3
- 0x58100003, // 0008 LDCONST R4 K3
- 0x58140002, // 0009 LDCONST R5 K2
- 0x6018000C, // 000A GETGBL R6 G12
- 0x5C1C0600, // 000B MOVE R7 R3
- 0x7C180200, // 000C CALL R6 1
- 0x14180A06, // 000D LT R6 R5 R6
- 0x781A001C, // 000E JMPF R6 #002C
- 0x94180605, // 000F GETIDX R6 R3 R5
- 0x881C0504, // 0010 GETMBR R7 R2 K4
- 0x8C1C0F05, // 0011 GETMET R7 R7 K5
- 0x54260003, // 0012 LDINT R9 4
- 0x08240A09, // 0013 MUL R9 R5 R9
- 0x542A0003, // 0014 LDINT R10 4
- 0x7C1C0600, // 0015 CALL R7 3
- 0x54220007, // 0016 LDINT R8 8
- 0x3C200E08, // 0017 SHR R8 R7 R8
- 0x542600FE, // 0018 LDINT R9 255
- 0x2C201009, // 0019 AND R8 R8 R9
- 0x5426000F, // 001A LDINT R9 16
- 0x3C240E09, // 001B SHR R9 R7 R9
- 0x542A00FE, // 001C LDINT R10 255
- 0x2C24120A, // 001D AND R9 R9 R10
- 0x542A0017, // 001E LDINT R10 24
- 0x3C280E0A, // 001F SHR R10 R7 R10
- 0x542E00FE, // 0020 LDINT R11 255
- 0x2C28140B, // 0021 AND R10 R10 R11
- 0x602C0018, // 0022 GETGBL R11 G24
- 0x58300006, // 0023 LDCONST R12 K6
- 0x5C341000, // 0024 MOVE R13 R8
- 0x5C381200, // 0025 MOVE R14 R9
- 0x5C3C1400, // 0026 MOVE R15 R10
- 0x0C400D07, // 0027 DIV R16 R6 K7
- 0x7C2C0A00, // 0028 CALL R11 5
- 0x0010080B, // 0029 ADD R4 R4 R11
- 0x00140B08, // 002A ADD R5 R5 K8
- 0x7001FFDD, // 002B JMP #000A
- 0x00100909, // 002C ADD R4 R4 K9
- 0x80040800, // 002D RET 1 R4
+ ( &(const binstruction[14]) { /* code */
+ 0x4C080000, // 0000 LDNIL R2
+ 0x1C080202, // 0001 EQ R2 R1 R2
+ 0x780A0000, // 0002 JMPF R2 #0004
+ 0x80000400, // 0003 RET 0
+ 0x18080300, // 0004 LE R2 R1 K0
+ 0x780A0000, // 0005 JMPF R2 #0007
+ 0xB0060302, // 0006 RAISE 1 K1 K2
+ 0x90020601, // 0007 SETMBR R0 K3 R1
+ 0x8C080105, // 0008 GETMET R2 R0 K5
+ 0x58100000, // 0009 LDCONST R4 K0
+ 0x04140306, // 000A SUB R5 R1 K6
+ 0x7C080600, // 000B CALL R2 3
+ 0x90020802, // 000C SETMBR R0 K4 R2
+ 0x80000000, // 000D RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: init
+********************************************************************/
+be_local_closure(Animate_palette_init, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 8]) { /* constants */
+ /* K0 */ be_nested_str_weak(init),
+ /* K1 */ be_nested_str_weak(duration_ms),
+ /* K2 */ be_nested_str_weak(running),
+ /* K3 */ be_nested_str_weak(bri),
+ /* K4 */ be_nested_str_weak(color),
+ /* K5 */ be_nested_str_weak(light_state),
+ /* K6 */ be_nested_str_weak(RGB),
+ /* K7 */ be_nested_str_weak(set_palette),
+ }),
+ be_str_weak(init),
+ &be_const_str_solidified,
+ ( &(const binstruction[19]) { /* code */
+ 0x600C0003, // 0000 GETGBL R3 G3
+ 0x5C100000, // 0001 MOVE R4 R0
+ 0x7C0C0200, // 0002 CALL R3 1
+ 0x8C0C0700, // 0003 GETMET R3 R3 K0
+ 0x7C0C0200, // 0004 CALL R3 1
+ 0x90020202, // 0005 SETMBR R0 K1 R2
+ 0x500C0000, // 0006 LDBOOL R3 0 0
+ 0x90020403, // 0007 SETMBR R0 K2 R3
+ 0x540E0063, // 0008 LDINT R3 100
+ 0x90020603, // 0009 SETMBR R0 K3 R3
+ 0xB80E0A00, // 000A GETNGBL R3 K5
+ 0xB8120A00, // 000B GETNGBL R4 K5
+ 0x88100906, // 000C GETMBR R4 R4 K6
+ 0x7C0C0200, // 000D CALL R3 1
+ 0x90020803, // 000E SETMBR R0 K4 R3
+ 0x8C0C0107, // 000F GETMET R3 R0 K7
+ 0x5C140200, // 0010 MOVE R5 R1
+ 0x7C0C0400, // 0011 CALL R3 2
+ 0x80000000, // 0012 RET 0
})
)
);
@@ -1074,24 +1131,25 @@ extern const bclass be_class_Animate_animator;
be_local_class(Animate_palette,
7,
&be_class_Animate_animator,
- be_nested_map(16,
+ be_nested_map(17,
( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(palette, 5), be_const_var(0) },
- { be_const_key_weak(range_min, -1), be_const_var(3) },
- { be_const_key_weak(slots_arr, -1), be_const_var(1) },
- { be_const_key_weak(init, -1), be_const_closure(Animate_palette_init_closure) },
- { be_const_key_weak(bri, 14), be_const_var(5) },
- { be_const_key_weak(animate, -1), be_const_closure(Animate_palette_animate_closure) },
+ { be_const_key_weak(color, 13), be_const_var(6) },
{ be_const_key_weak(slots, -1), be_const_var(2) },
- { be_const_key_weak(ptr_to_palette, -1), be_const_static_closure(Animate_palette_ptr_to_palette_closure) },
- { be_const_key_weak(color, -1), be_const_var(6) },
- { be_const_key_weak(set_range, 10), be_const_closure(Animate_palette_set_range_closure) },
- { be_const_key_weak(to_css_gradient, -1), be_const_static_closure(Animate_palette_to_css_gradient_closure) },
+ { be_const_key_weak(animate, 11), be_const_closure(Animate_palette_animate_closure) },
+ { be_const_key_weak(range_max, 10), be_const_var(4) },
+ { be_const_key_weak(set_palette, -1), be_const_closure(Animate_palette_set_palette_closure) },
{ be_const_key_weak(set_bri, -1), be_const_closure(Animate_palette_set_bri_closure) },
- { be_const_key_weak(set_duration, -1), be_const_closure(Animate_palette_set_duration_closure) },
+ { be_const_key_weak(bri, -1), be_const_var(5) },
+ { be_const_key_weak(to_css_gradient, 12), be_const_static_closure(Animate_palette_to_css_gradient_closure) },
+ { be_const_key_weak(slots_arr, 1), be_const_var(1) },
+ { be_const_key_weak(range_min, 5), be_const_var(3) },
{ be_const_key_weak(set_value, -1), be_const_closure(Animate_palette_set_value_closure) },
+ { be_const_key_weak(set_range, -1), be_const_closure(Animate_palette_set_range_closure) },
{ be_const_key_weak(parse_palette, -1), be_const_closure(Animate_palette_parse_palette_closure) },
- { be_const_key_weak(range_max, -1), be_const_var(4) },
+ { be_const_key_weak(palette, -1), be_const_var(0) },
+ { be_const_key_weak(set_duration, -1), be_const_closure(Animate_palette_set_duration_closure) },
+ { be_const_key_weak(init, -1), be_const_closure(Animate_palette_init_closure) },
+ { be_const_key_weak(ptr_to_palette, 0), be_const_static_closure(Animate_palette_ptr_to_palette_closure) },
})),
be_str_weak(Animate_palette)
);
@@ -1266,7 +1324,7 @@ be_local_closure(Animate_oscillator_set_phase, /* name */
********************************************************************/
be_local_closure(Animate_oscillator_init, /* name */
be_nested_proto(
- 6, /* nstack */
+ 7, /* nstack */
5, /* argc */
2, /* varg */
0, /* has upvals */
@@ -1274,33 +1332,39 @@ be_local_closure(Animate_oscillator_init, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 9]) { /* constants */
- /* K0 */ be_nested_str_weak(phase),
- /* K1 */ be_const_int(0),
- /* K2 */ be_nested_str_weak(duty_cycle),
- /* K3 */ be_nested_str_weak(a),
- /* K4 */ be_nested_str_weak(b),
- /* K5 */ be_nested_str_weak(duration_ms),
- /* K6 */ be_nested_str_weak(value),
- /* K7 */ be_const_int(1),
- /* K8 */ be_nested_str_weak(form),
+ ( &(const bvalue[10]) { /* constants */
+ /* K0 */ be_nested_str_weak(init),
+ /* K1 */ be_nested_str_weak(phase),
+ /* K2 */ be_const_int(0),
+ /* K3 */ be_nested_str_weak(duty_cycle),
+ /* K4 */ be_nested_str_weak(a),
+ /* K5 */ be_nested_str_weak(b),
+ /* K6 */ be_nested_str_weak(duration_ms),
+ /* K7 */ be_nested_str_weak(value),
+ /* K8 */ be_const_int(1),
+ /* K9 */ be_nested_str_weak(form),
}),
be_str_weak(init),
&be_const_str_solidified,
- ( &(const binstruction[13]) { /* code */
- 0x90020101, // 0000 SETMBR R0 K0 K1
- 0x54160031, // 0001 LDINT R5 50
- 0x90020405, // 0002 SETMBR R0 K2 R5
- 0x90020601, // 0003 SETMBR R0 K3 R1
- 0x90020802, // 0004 SETMBR R0 K4 R2
- 0x90020A03, // 0005 SETMBR R0 K5 R3
- 0x90020C01, // 0006 SETMBR R0 K6 R1
- 0x4C140000, // 0007 LDNIL R5
- 0x1C140805, // 0008 EQ R5 R4 R5
- 0x78160000, // 0009 JMPF R5 #000B
- 0x58100007, // 000A LDCONST R4 K7
- 0x90021004, // 000B SETMBR R0 K8 R4
- 0x80000000, // 000C RET 0
+ ( &(const binstruction[18]) { /* code */
+ 0x60140003, // 0000 GETGBL R5 G3
+ 0x5C180000, // 0001 MOVE R6 R0
+ 0x7C140200, // 0002 CALL R5 1
+ 0x8C140B00, // 0003 GETMET R5 R5 K0
+ 0x7C140200, // 0004 CALL R5 1
+ 0x90020302, // 0005 SETMBR R0 K1 K2
+ 0x54160031, // 0006 LDINT R5 50
+ 0x90020605, // 0007 SETMBR R0 K3 R5
+ 0x90020801, // 0008 SETMBR R0 K4 R1
+ 0x90020A02, // 0009 SETMBR R0 K5 R2
+ 0x90020C03, // 000A SETMBR R0 K6 R3
+ 0x90020E01, // 000B SETMBR R0 K7 R1
+ 0x4C140000, // 000C LDNIL R5
+ 0x1C140805, // 000D EQ R5 R4 R5
+ 0x78160000, // 000E JMPF R5 #0010
+ 0x58100008, // 000F LDCONST R4 K8
+ 0x90021204, // 0010 SETMBR R0 K9 R4
+ 0x80000000, // 0011 RET 0
})
)
);
diff --git a/tasmota/berry/animate_demo/animate_demo_breathe.be b/tasmota/berry/animate_demo/animate_demo_breathe.be
new file mode 100644
index 000000000..d9394adb4
--- /dev/null
+++ b/tasmota/berry/animate_demo/animate_demo_breathe.be
@@ -0,0 +1,28 @@
+#
+# Example for M5Stack Led Matrix
+# 5 x 5 WS2812
+#
+import animate
+
+var PALETTE_BLACK_RED = bytes(
+ "00" "000000" # black
+ "88" "880000" # red
+ "FF" "FF5500" # orange
+ )
+
+ var duration = 3000
+ var leds = 25
+
+ var strip = Leds(leds, gpio.pin(gpio.WS2812, 0))
+ var anim = animate.core(strip, 100)
+ anim.set_back_color(0x000000)
+
+ var pulse = animate.pulse(0xFF0000, leds, 0)
+ var palette = animate.palette(PALETTE_BLACK_RED)
+ palette.set_range(0, 255)
+ palette.set_cb(pulse, pulse.set_color)
+
+ var osc1 = animate.oscillator(50, 255, duration, animate.COSINE)
+ osc1.set_cb(palette, palette.set_value)
+
+ anim.start()
diff --git a/tasmota/berry/animate_demo/animate_demo_pulse.be b/tasmota/berry/animate_demo/animate_demo_pulse.be
index 09b075683..82c2d5ee3 100644
--- a/tasmota/berry/animate_demo/animate_demo_pulse.be
+++ b/tasmota/berry/animate_demo/animate_demo_pulse.be
@@ -12,12 +12,8 @@ var pulse = animate.pulse(0xFF4444, 2, 1)
var osc1 = animate.oscillator(-3, 26, 5000, animate.COSINE)
osc1.set_cb(pulse, pulse.set_pos)
-anim.add_animator(osc1)
-anim.add_painter(pulse)
-
# animate color of pulse
var palette = animate.palette(animate.PALETTE_RAINBOW_WHITE, 30000)
palette.set_cb(pulse, pulse.set_color)
-anim.add_animator(palette)
anim.start()
From d3a30681b225b137420432b407c9101f2153d2c5 Mon Sep 17 00:00:00 2001
From: bovirus <1262554+bovirus@users.noreply.github.com>
Date: Sun, 17 Dec 2023 21:13:07 +0100
Subject: [PATCH 014/303] Update Italian language (#20255)
---
tasmota/language/it_IT.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tasmota/language/it_IT.h b/tasmota/language/it_IT.h
index 1a412fcff..29a012781 100644
--- a/tasmota/language/it_IT.h
+++ b/tasmota/language/it_IT.h
@@ -28,7 +28,7 @@
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
* Use online command Prefix to translate cmnd, stat and tele.
*
- * Updated until v9.4.0.1 - Last update 18.11.2023
+ * Updated until v9.4.0.1 - Last update 17.12.2023
\*********************************************************************/
#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
@@ -956,8 +956,8 @@
#define D_SENSOR_BIOPDU_PZEM0XX_TX "BioPDU PZEM0XX - TX"
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 - RX"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
-#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
-#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
+#define D_SENSOR_LOX_O2_RX "LoxO2 - RX"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
From 5fd8faa63370ae3e7bc8b6c82afc6823cd3ee82a Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Sun, 17 Dec 2023 21:23:43 +0100
Subject: [PATCH 015/303] Add animate palettes (#20256)
---
.../berry_tasmota/src/be_animate_module.c | 58 +++++++++++++++++++
1 file changed, 58 insertions(+)
diff --git a/lib/libesp32/berry_tasmota/src/be_animate_module.c b/lib/libesp32/berry_tasmota/src/be_animate_module.c
index 7d741e0a9..d638cbb79 100644
--- a/lib/libesp32/berry_tasmota/src/be_animate_module.c
+++ b/lib/libesp32/berry_tasmota/src/be_animate_module.c
@@ -70,6 +70,59 @@ static const uint8_t PALETTE_ib_jul01_gp[] = {
0xFF, 0xBB, 0x03, 0x0D, // rgb(187, 3, 13) 100.000%
};
+// Gradient palette "ib44"
+// http://soliton.vm.bytemark.co.uk/pub/cpt-city/ing/general/tn/ib44.png.index.html
+static const uint8_t PALETTE_ib_44[] = {
+ 0, 214, 24, 16,
+ 64, 227, 115, 78,
+ 255, 239, 206, 140,
+};
+
+// Gradient palette "Fire-1"
+// http://soliton.vm.bytemark.co.uk/pub/cpt-city/ds/icons/Fire-1.c3g
+static const uint8_t PALETTE_Fire_1[] = {
+ 0, 255, 0, 0,
+ 128, 255, 128, 0,
+ 255, 255, 255, 0,
+};
+
+// Gradient palette "bhw1_sunconure"
+// http://soliton.vm.bytemark.co.uk/pub/cpt-city/bhw/bhw1/tn/bhw1_sunconure.png.index.html
+static const uint8_t PALETTE_bhw1_sunconure[] = {
+ 0, 97, 240, 78,
+ 161, 246, 137, 30,
+ 255, 246, 45, 30,
+};
+
+// Gradient palette "bhw3_41"
+// http://soliton.vm.bytemark.co.uk/pub/cpt-city/bhw/bhw3/tn/bhw3_41.png.index.html
+static const uint8_t PALETTE_bhw3_41[] = {
+ 0, 0, 0, 128,
+ 71, 64, 64, 255,
+ 75, 160, 160, 255,
+ 76, 255, 255, 255,
+ 178, 255, 255, 255,
+ 179, 255, 128, 128,
+ 196, 255, 0, 0,
+ 255, 128, 0, 0,
+};
+
+// Gradient palette "bhw4_089"
+// http://soliton.vm.bytemark.co.uk/pub/cpt-city/bhw/bhw4/tn/bhw4_089.png.index.html
+static const uint8_t PALETTE_bhw4_089[] = {
+ 0, 174, 52, 28,
+ 28, 224, 154, 133,
+ 53, 235, 208, 206,
+ 79, 249, 208, 118,
+ 109, 228, 95, 50,
+ 132, 227, 165, 116,
+ 163, 226, 131, 67,
+ 184, 252, 213, 118,
+ 201, 252, 169, 125,
+ 224, 255, 194, 101,
+ 255, 215, 80, 35,
+};
+
static const uint8_t PALETTE_STANDARD_VAL[] = {
0x00, 0xFF, 0x00, 0x00, // red
0x2A, 0xFF, 0xA5, 0x00, // orange
@@ -108,6 +161,11 @@ module animate (scope: global, strings: weak) {
PALETTE_RAINBOW_WHITE, comptr(PALETTE_RAINBOW_WHITE)
PALETTE_STANDARD_VAL, comptr(PALETTE_STANDARD_VAL)
PALETTE_SATURATED_TAG, comptr(PALETTE_SATURATED_TAG)
+ PALETTE_ib_jul01_gp, comptr(PALETTE_ib_jul01_gp)
+ PALETTE_ib_44, comptr(PALETTE_ib_44)
+ PALETTE_Fire_1, comptr(PALETTE_Fire_1)
+ PALETTE_bhw1_sunconure, comptr(PALETTE_bhw1_sunconure)
+ PALETTE_bhw4_089, comptr(PALETTE_bhw4_089)
core, class(be_class_Animate_core)
animator, class(be_class_Animate_animator)
From 2204ecdc516b885e88f02caff5c83688e7d0b1af Mon Sep 17 00:00:00 2001
From: SteWers <42718143+SteWers@users.noreply.github.com>
Date: Mon, 18 Dec 2023 10:17:39 +0100
Subject: [PATCH 016/303] Unify de_DE (#20257)
* Unify de_DE
Make de_DE more unify
* Update de_DE.h
---
tasmota/language/de_DE.h | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/tasmota/language/de_DE.h b/tasmota/language/de_DE.h
index c76ddbb29..31aaa5721 100644
--- a/tasmota/language/de_DE.h
+++ b/tasmota/language/de_DE.h
@@ -28,7 +28,7 @@
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
* Use online command Prefix to translate cmnd, stat and tele.
*
- * Updated until v13.2.0.2 - Last update 19.11.2023
+ * Updated until v13.3.0.1 - Last update 17.12.2023
\*********************************************************************/
//#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
@@ -278,12 +278,12 @@
#define D_CONSOLE "Konsole"
#define D_CONFIRM_RESTART "Wirklich neustarten?"
-#define D_CONFIGURE_MODULE "Gerät konfigurieren"
-#define D_CONFIGURE_WIFI "WLAN konfigurieren"
-#define D_CONFIGURE_MQTT "MQTT konfigurieren"
-#define D_CONFIGURE_DOMOTICZ "Domoticz konfigurieren"
-#define D_CONFIGURE_LOGGING "Logging konfigurieren"
-#define D_CONFIGURE_OTHER "Sonstige Konfiguration"
+#define D_CONFIGURE_MODULE "Geräteeinstellungen"
+#define D_CONFIGURE_WIFI "WLAN-Einstellungen"
+#define D_CONFIGURE_MQTT "MQTT-Einstellungen"
+#define D_CONFIGURE_DOMOTICZ "Domoticz-Einstellungen"
+#define D_CONFIGURE_LOGGING "Logging-Einstellungen"
+#define D_CONFIGURE_OTHER "Weitere Einstellungen"
#define D_CONFIRM_RESET_CONFIGURATION "Zurücksetzen der Konfiguration bestätigen"
#define D_RESET_CONFIGURATION "Konfiguration zurücksetzen"
#define D_BACKUP_CONFIGURATION "Konfiguration sichern"
@@ -322,7 +322,7 @@
#define D_SHOW_MORE_OPTIONS "Mehr Optionen"
#define D_CHECK_CREDENTIALS "Bitte SSID/Passwort überprüfen"
#define D_SUCCESSFUL_WIFI_CONNECTION "mit Wifi verbunden"
-#define D_NOW_YOU_CAN_CLOSE_THIS_WINDOW "Fenster kann geschlossen werden"
+#define D_NOW_YOU_CAN_CLOSE_THIS_WINDOW "Das Fenster kann geschlossen werden"
#define D_REDIRECTING_TO_NEW_IP "Umleitung zur neuen Geräte IP-Adresse"
#define D_MQTT_PARAMETERS "MQTT-Einstellungen"
@@ -339,7 +339,7 @@
#define D_SYSLOG_PORT "Syslog Port"
#define D_TELEMETRY_PERIOD "Telemetrieperiode"
-#define D_OTHER_PARAMETERS "Sonstige Einstellungen"
+#define D_OTHER_PARAMETERS "Weiterte Einstellungen"
#define D_TEMPLATE "Vorlage"
#define D_ACTIVATE "Aktivieren"
#define D_DEVICE_NAME "Gerätename"
@@ -348,7 +348,7 @@
#define D_MQTT_TLS_ENABLE "MQTT TLS"
#define D_HTTP_API "HTTP API"
#define D_HTTP_API_ENABLE "HTTP API aktivieren"
-#define D_FRIENDLY_NAME "Name [Friendly Name]"
+#define D_FRIENDLY_NAME "Friendly Name"
#define D_BELKIN_WEMO "Belkin WeMo"
#define D_HUE_BRIDGE "Hue Bridge"
#define D_SINGLE_DEVICE "Einzelnes Gerät"
@@ -443,7 +443,7 @@
#define D_3_RESPONSE_PACKETS_SENT "3 Antwortpakete gesendet"
// xdrv_07_domoticz.ino
-#define D_DOMOTICZ_PARAMETERS "Domoticz-Parameter"
+#define D_DOMOTICZ_PARAMETERS "Domoticz-Einstellungen"
#define D_DOMOTICZ_IDX "Idx"
#define D_DOMOTICZ_KEY_IDX "Key idx"
#define D_DOMOTICZ_SWITCH_IDX "Switch idx"
@@ -461,7 +461,7 @@
#define D_DOMOTICZ_UPDATE_TIMER "Update Zeitplan"
// xdrv_09_timers.ino
-#define D_CONFIGURE_TIMER "Zeitplan konfigurieren"
+#define D_CONFIGURE_TIMER "Zeitplaneinstellungen"
#define D_TIMER_PARAMETERS "Zeitplaneinstellungen"
#define D_TIMER_ENABLE "Zeitpläne aktivieren"
#define D_TIMER_ARM "Aktiv"
@@ -957,7 +957,7 @@
#define D_SENSOR_BIOPDU_PZEM016_RX "BioPDU PZEM016 Rx"
#define D_SENSOR_BIOPDU_BIT "BioPDU Bit"
#define D_SENSOR_LOX_O2_RX "LoxO2 RX"
-#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
+#define D_GPIO_MAGIC_SWITCH "MagicSwitch"
// Units
#define D_UNIT_AMPERE "A"
From 6b35fc8ddb050dd891352e646044ffcfba80045d Mon Sep 17 00:00:00 2001
From: Arne Meeuw
Date: Mon, 18 Dec 2023 11:03:18 +0100
Subject: [PATCH 017/303] Add support for CST816S touch interface (#20213)
* Add initial version (prints coordinates)
* Add CST816S_found
* Revert formatting
* Add supported gestures (untested)
* Correct use of enums
* Remove library dependency
* Unification of methods
* Remove redundant variables and format
---
tasmota/tasmota_xdrv_driver/xdrv_55_touch.ino | 71 +++++++++++++++++--
.../xdsp_17_universal.ino | 16 ++++-
2 files changed, 82 insertions(+), 5 deletions(-)
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_55_touch.ino b/tasmota/tasmota_xdrv_driver/xdrv_55_touch.ino
index 01bbe97ca..44eca227e 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_55_touch.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_55_touch.ino
@@ -71,6 +71,7 @@ typedef struct TSGlobal_t {
TSGlobal_t TSGlobal;
+bool CST816S_found = false;
bool FT5206_found = false;
bool GT911_found = false;
bool XPT2046_found = false;
@@ -97,7 +98,7 @@ void Touch_SetStatus(uint8_t touches, uint16_t raw_x, uint16_t raw_y, uint8_t ge
// return true if succesful, false if not configured
bool Touch_GetStatus(uint8_t* touches, uint16_t* x, uint16_t* y, uint8_t* gesture,
uint16_t* raw_x, uint16_t* raw_y) {
- if (TSGlobal.external_ts || FT5206_found || XPT2046_found) {
+ if (TSGlobal.external_ts || CST816S_found || FT5206_found || XPT2046_found) {
if (touches) { *touches = TSGlobal.touches; }
if (x) { *x = TSGlobal.touch_xp; }
if (y) { *y = TSGlobal.touch_yp; }
@@ -110,7 +111,7 @@ bool Touch_GetStatus(uint8_t* touches, uint16_t* x, uint16_t* y, uint8_t* gestur
}
uint32_t Touch_Status(int32_t sel) {
- if (TSGlobal.external_ts || FT5206_found || GT911_found || XPT2046_found || SRES_found) {
+ if (TSGlobal.external_ts || CST816S_found || FT5206_found || GT911_found || XPT2046_found || SRES_found) {
switch (sel) {
case 0:
return TSGlobal.touched;
@@ -185,6 +186,62 @@ int16_t SRES_y() {
}
#endif
+#ifdef USE_CST816S
+#undef CST816S_address
+#define CST816S_address 0x15
+
+bool CST816S_event_available = false;
+uint8_t CST816S_bus = 0;
+
+uint8_t CST816S_map_gesture(uint8_t gesture) {
+ switch (gesture) {
+ case 0x01: return TS_Gest_Move_Up; // SWIPE_UP
+ case 0x02: return TS_Gest_Move_Down; // SWIPE_DOWN
+ case 0x03: return TS_Gest_Move_Left; // SWIPE_LEFT
+ case 0x04: return TS_Gest_Move_Right; // SWIPE_RIGHT
+ case 0x05: return TS_Gest_None; // SINGLE_CLICK
+ case 0x0B: return TS_Gest_None; // DOUBLE_CLICK
+ case 0x0C: return TS_Gest_None; // LONG_PRESS
+ default: return TS_Gest_None; // NONE
+ }
+}
+
+bool CST816S_available() {
+ if (CST816S_event_available) {
+ byte data_raw[8];
+ I2cReadBuffer(CST816S_address, 0x01, data_raw, 6, CST816S_bus);
+ TSGlobal.raw_touch_xp = ((data_raw[2] & 0xF) << 8) + data_raw[3];
+ TSGlobal.raw_touch_yp = ((data_raw[4] & 0xF) << 8) + data_raw[5];
+ TSGlobal.gesture = CST816S_map_gesture(data_raw[0]);
+ CST816S_event_available = false;
+ return true;
+ }
+ return false;
+}
+
+bool CST816S_Touch_Init(uint8_t bus, int8_t irq_pin, int8_t rst_pin, int interrupt = RISING) {
+ CST816S_found = false;
+ CST816S_bus = bus;
+ pinMode(irq_pin, INPUT);
+ pinMode(rst_pin, OUTPUT);
+ digitalWrite(rst_pin, HIGH);
+ delay(50);
+ digitalWrite(rst_pin, LOW);
+ delay(5);
+ digitalWrite(rst_pin, HIGH);
+ delay(50);
+ uint8_t version;
+ I2cReadBuffer(CST816S_address, 0x15, &version, 1, CST816S_bus);
+ delay(5);
+ uint8_t versionInfo[3];
+ I2cReadBuffer(CST816S_address, 0xA7, versionInfo, 3, CST816S_bus);
+ attachInterrupt(irq_pin, []{ CST816S_event_available = true; }, interrupt);
+ CST816S_found = true;
+ AddLog(LOG_LEVEL_INFO, PSTR("TI: CST816S, version: %d, versionInfo: %d.%d.%d"), version, versionInfo[0], versionInfo[1], versionInfo[2]);
+ return CST816S_found;
+}
+#endif // USE_CST816S
+
#ifdef USE_FT5206
#include
// touch panel controller
@@ -307,6 +364,12 @@ void Touch_Check(void(*rotconvert)(int16_t *x, int16_t *y)) {
}
#endif
+#ifdef USE_CST816S
+ if (CST816S_found) {
+ TSGlobal.touched = CST816S_available();
+ }
+#endif // USE_CST816S
+
#ifdef USE_FT5206
if (FT5206_found) {
TSGlobal.touched = FT5206_touched();
@@ -360,7 +423,7 @@ void Touch_Check(void(*rotconvert)(int16_t *x, int16_t *y)) {
#endif // USE_TOUCH_BUTTONS
rotconvert(&TSGlobal.touch_xp, &TSGlobal.touch_yp);
- AddLog(LOG_LEVEL_DEBUG_MORE, "TS : TSGlobal.touched x=%i y=%i (raw x=%i y=%i)", TSGlobal.touch_xp, TSGlobal.touch_yp, TSGlobal.raw_touch_xp, TSGlobal.raw_touch_yp);
+ AddLog(LOG_LEVEL_DEBUG_MORE, "TS : TSGlobal.touched x=%i y=%i gest=0x%02x (raw x=%i y=%i)", TSGlobal.touch_xp, TSGlobal.touch_yp, TSGlobal.gesture, TSGlobal.raw_touch_xp, TSGlobal.raw_touch_yp);
#ifdef USE_TOUCH_BUTTONS
CheckTouchButtons(TSGlobal.touched, TSGlobal.touch_xp, TSGlobal.touch_yp);
@@ -522,7 +585,7 @@ bool Xdrv55(uint32_t function) {
case FUNC_INIT:
break;
case FUNC_EVERY_100_MSECOND:
- if (FT5206_found || XPT2046_found || GT911_found || SRES_found) {
+ if (CST816S_found || FT5206_found || XPT2046_found || GT911_found || SRES_found) {
Touch_Check(TS_RotConvert);
}
break;
diff --git a/tasmota/tasmota_xdsp_display/xdsp_17_universal.ino b/tasmota/tasmota_xdsp_display/xdsp_17_universal.ino
index c0a1a377f..b9213ed17 100644
--- a/tasmota/tasmota_xdsp_display/xdsp_17_universal.ino
+++ b/tasmota/tasmota_xdsp_display/xdsp_17_universal.ino
@@ -35,6 +35,8 @@ extern FS *ffsp;
#undef GT911_address
#define GT911_address 0x5D
+#undef CST816S_address
+#define CST816S_address 0x15
enum {GPIO_DP_RES=GPIO_SENSOR_END-1,GPIO_DP_CS,GPIO_DP_RS,GPIO_DP_WR,GPIO_DP_RD,GPIO_DPAR0,GPIO_DPAR1,GPIO_DPAR2,GPIO_DPAR3,GPIO_DPAR4,GPIO_DPAR5,GPIO_DPAR6,GPIO_DPAR7,GPIO_DPAR8,GPIO_DPAR9,GPIO_DPAR10,GPIO_DPAR11,GPIO_DPAR12,GPIO_DPAR13,GPIO_DPAR14,GPIO_DPAR15};
@@ -312,7 +314,7 @@ int8_t cs;
udisp = new uDisplay(ddesc);
// checck for touch option TI1 or TI2
-#if defined(USE_FT5206) || defined(USE_GT911)
+#if defined (USE_CST816S) || defined(USE_FT5206) || defined(USE_GT911)
cp = strstr(ddesc, ":TI");
if (cp) {
uint8_t wire_n = 1;
@@ -350,6 +352,8 @@ int8_t cs;
if (I2cSetDevice(i2caddr, wire_n)) {
if (i2caddr == GT911_address) {
I2cSetActiveFound(i2caddr, "GT911", wire_n);
+ } else if (i2caddr == CST816S_address) {
+ I2cSetActiveFound(i2caddr, "CST816S", wire_n);
} else {
I2cSetActiveFound(i2caddr, "FT5206", wire_n);
}
@@ -361,6 +365,8 @@ int8_t cs;
if (I2cSetDevice(i2caddr)) {
if (i2caddr == GT911_address) {
I2cSetActiveFound(i2caddr, "GT911");
+ } else if (i2caddr == CST816S_address) {
+ I2cSetActiveFound(i2caddr, "CST816S");
} else {
I2cSetActiveFound(i2caddr, "FT5206");
}
@@ -373,6 +379,10 @@ int8_t cs;
#ifdef USE_GT911
if (!wire_n) GT911_Touch_Init(&Wire, irq, rst, xs, ys);
else GT911_Touch_Init(&Wire1, irq, rst, xs, ys);
+#endif
+ } else if (i2caddr == CST816S_address) {
+#ifdef USE_CST816S
+ CST816S_Touch_Init(wire_n, irq, rst);
#endif
} else {
#ifdef USE_FT5206
@@ -386,6 +396,10 @@ int8_t cs;
if (i2caddr == GT911_address) {
#ifdef USE_GT911
if (!wire_n) GT911_Touch_Init(&Wire, irq, rst, xs, ys);
+#endif
+ } else if (i2caddr == CST816S_address) {
+#ifdef USE_CST816S
+ CST816S_Touch_Init(wire_n, irq, rst);
#endif
} else {
#ifdef USE_FT5206
From c111bb963ff4d22e970a71539b174ca7eaafaf8a Mon Sep 17 00:00:00 2001
From: Norbert Richter
Date: Mon, 18 Dec 2023 11:27:12 +0100
Subject: [PATCH 018/303] Add NeoPool hydrolysis FL1 and Redox flag (#20258)
---
tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino b/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino
index 18b30b914..81abf890f 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino
@@ -1882,6 +1882,10 @@ void NeoPoolShow(bool json)
ResponseAppend_P(PSTR(",\"" D_NEOPOOL_JSON_SHOCK "\":%d"), (NeoPoolGetData(MBF_HIDRO_STATUS) & MBMSK_HIDRO_STATUS_SHOCK_ENABLED) ? ((NeoPoolGetData(MBF_CELL_BOOST) & MBMSK_CELL_BOOST_NO_REDOX_CTL) ? 1 : 2) : 0 );
// S4
ResponseAppend_P(PSTR(",\"" D_NEOPOOL_JSON_LOW "\":%d"), (NeoPoolGetData(MBF_HIDRO_STATUS) & MBMSK_HIDRO_STATUS_LOW) ? 1 : 0 );
+ // S5
+ ResponseAppend_P(PSTR(",\"" D_NEOPOOL_JSON_FLOW1 "\":%d"), (NeoPoolGetData(MBF_HIDRO_STATUS) & MBMSK_HIDRO_STATUS_FL1) ? 0 : 1);
+ // S6
+ ResponseAppend_P(PSTR(",\"" D_NEOPOOL_JSON_REDOX "\":%d"), (NeoPoolGetData(MBF_HIDRO_STATUS) & MBMSK_HIDRO_STATUS_REDOX_ENABLED) ? 1 : 0);
ResponseJsonEnd();
}
From f65ae0694b99f454a0525bc387ef8cac0162b5d7 Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Mon, 18 Dec 2023 12:31:14 +0100
Subject: [PATCH 019/303] Fix XSS phase 1
---
.../xdrv_01_9_webserver.ino | 47 ++++++++++---------
.../tasmota_xdrv_driver/xdrv_02_9_mqtt.ino | 10 ++--
.../tasmota_xdrv_driver/xdrv_06_snfbridge.ino | 2 +-
.../tasmota_xdrv_driver/xdrv_10_scripter.ino | 2 +-
.../xdrv_16_tuyamcu_v1.ino | 2 +-
.../xdrv_16_tuyamcu_v2.ino | 2 +-
.../tasmota_xlgt_light/xlgt_07_lsc_mcsl.ino | 2 +-
7 files changed, 36 insertions(+), 31 deletions(-)
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino b/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino
index 79c953b72..df267b533 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino
@@ -477,6 +477,10 @@ static void WebGetArg(const char* arg, char* out, size_t max)
// out[max-1] = '\0'; // Ensure terminating NUL
}
+String SettingsTextEscaped(uint32_t index) {
+ return HtmlEscape(SettingsText(index));
+}
+
String AddWebCommand(const char* command, const char* arg, const char* dflt) {
/*
// OK but fixed max argument
@@ -865,7 +869,7 @@ void WSContentStart_P(const char* title, bool auth) {
WSContentBegin(200, CT_HTML);
if (title != nullptr) {
- WSContentSend_P(HTTP_HEADER1, PSTR(D_HTML_LANGUAGE), SettingsText(SET_DEVICENAME), title);
+ WSContentSend_P(HTTP_HEADER1, PSTR(D_HTML_LANGUAGE), SettingsTextEscaped(SET_DEVICENAME).c_str(), title);
}
}
@@ -909,7 +913,7 @@ void WSContentSendStyle_P(const char* formatP, ...) {
WebColor(COL_TEXT_WARNING),
#endif
WebColor(COL_TITLE),
- (Web.initial_config) ? "" : (Settings->flag5.gui_module_name) ? "" : ModuleName().c_str(), SettingsText(SET_DEVICENAME));
+ (Web.initial_config) ? "" : (Settings->flag5.gui_module_name) ? "" : ModuleName().c_str(), SettingsTextEscaped(SET_DEVICENAME).c_str());
// SetOption53 - Show hostname and IP address in GUI main menu
#if (RESTART_AFTER_INITIAL_WIFI_CONFIG)
@@ -1264,12 +1268,12 @@ void HandleRoot(void)
#ifdef USE_SONOFF_IFAN
if (IsModuleIfan()) {
WSContentSend_P(HTTP_DEVICE_CONTROL, 36, 1,
- (strlen(SettingsText(SET_BUTTON1))) ? SettingsText(SET_BUTTON1) : PSTR(D_BUTTON_TOGGLE),
+ (strlen(SettingsText(SET_BUTTON1))) ? SettingsTextEscaped(SET_BUTTON1).c_str() : PSTR(D_BUTTON_TOGGLE),
"");
for (uint32_t i = 0; i < MaxFanspeed(); i++) {
snprintf_P(stemp, sizeof(stemp), PSTR("%d"), i);
WSContentSend_P(HTTP_DEVICE_CONTROL, 16, i +2,
- (strlen(SettingsText(SET_BUTTON2 + i))) ? SettingsText(SET_BUTTON2 + i) : stemp,
+ (strlen(SettingsText(SET_BUTTON2 + i))) ? SettingsTextEscaped(SET_BUTTON2 + i).c_str() : stemp,
"");
}
} else {
@@ -1281,13 +1285,13 @@ void HandleRoot(void)
int32_t ShutterWebButton;
if (ShutterWebButton = IsShutterWebButton(idx)) {
WSContentSend_P(HTTP_DEVICE_CONTROL, 100 / cols, idx,
- (set_button) ? GetWebButton(idx -1) : ((ShutterGetOptions(abs(ShutterWebButton)-1) & 2) /* is locked */ ? "-" : ((ShutterGetOptions(abs(ShutterWebButton)-1) & 8) /* invert web buttons */ ? ((ShutterWebButton>0) ? "▼" : "▲") : ((ShutterWebButton>0) ? "▲" : "▼"))),
+ (set_button) ? HtmlEscape(GetWebButton(idx -1)).c_str() : ((ShutterGetOptions(abs(ShutterWebButton)-1) & 2) /* is locked */ ? "-" : ((ShutterGetOptions(abs(ShutterWebButton)-1) & 8) /* invert web buttons */ ? ((ShutterWebButton>0) ? "▼" : "▲") : ((ShutterWebButton>0) ? "▲" : "▼"))),
"");
} else {
#endif // USE_SHUTTER
snprintf_P(stemp, sizeof(stemp), PSTR(" %d"), idx);
WSContentSend_P(HTTP_DEVICE_CONTROL, 100 / cols, idx,
- (set_button) ? GetWebButton(idx -1) : (cols < 5) ? PSTR(D_BUTTON_TOGGLE) : "",
+ (set_button) ? HtmlEscape(GetWebButton(idx -1)).c_str() : (cols < 5) ? PSTR(D_BUTTON_TOGGLE) : "",
(set_button) ? "" : (TasmotaGlobal.devices_present > 1) ? stemp : "");
#ifdef USE_SHUTTER
}
@@ -2078,15 +2082,15 @@ void HandleWifiConfiguration(void) {
}
WSContentSend_P(PSTR("
"), (limitScannedNetworks) ? PSTR(D_SHOW_MORE_WIFI_NETWORKS) : PSTR(D_SCAN_FOR_WIFI_NETWORKS));
- WSContentSend_P(HTTP_FORM_WIFI_PART1, (WifiIsInManagerMode()) ? "" : PSTR(" (" STA_SSID1 ")"), SettingsText(SET_STASSID1));
+ WSContentSend_P(HTTP_FORM_WIFI_PART1, (WifiIsInManagerMode()) ? "" : PSTR(" (" STA_SSID1 ")"), SettingsTextEscaped(SET_STASSID1).c_str());
if (WifiIsInManagerMode()) {
// As WIFI_HOSTNAME may contain %s-%04d it cannot be part of HTTP_FORM_WIFI where it will exception
WSContentSend_P(PSTR(">"));
} else {
#ifdef USE_CORS
- WSContentSend_P(HTTP_FORM_WIFI_PART2, SettingsText(SET_STASSID2), WIFI_HOSTNAME, WIFI_HOSTNAME, SettingsText(SET_HOSTNAME), SettingsText(SET_CORS));
+ WSContentSend_P(HTTP_FORM_WIFI_PART2, SettingsTextEscaped(SET_STASSID2).c_str(), WIFI_HOSTNAME, WIFI_HOSTNAME, SettingsTextEscaped(SET_HOSTNAME).c_str(), SettingsTextEscaped(SET_CORS).c_str());
#else
- WSContentSend_P(HTTP_FORM_WIFI_PART2, SettingsText(SET_STASSID2), WIFI_HOSTNAME, WIFI_HOSTNAME, SettingsText(SET_HOSTNAME));
+ WSContentSend_P(HTTP_FORM_WIFI_PART2, SettingsTextEscaped(SET_STASSID2).c_str(), WIFI_HOSTNAME, WIFI_HOSTNAME, SettingsTextEscaped(SET_HOSTNAME).c_str());
#endif
}
@@ -2099,9 +2103,9 @@ void HandleWifiConfiguration(void) {
WSContentSend_P(PSTR(""));
if (WIFI_TESTING == Wifi.wifiTest) {
- WSContentSend_P(PSTR(D_TRYING_TO_CONNECT "
%s
"), SettingsText(SET_STASSID1));
+ WSContentSend_P(PSTR(D_TRYING_TO_CONNECT "
%s"), SettingsTextEscaped(SET_STASSID1).c_str());
} else if (WIFI_TEST_FINISHED_BAD == Wifi.wifiTest) {
- WSContentSend_P(PSTR(D_CONNECT_FAILED_TO " %s
" D_CHECK_CREDENTIALS ""), SettingsText(SET_STASSID1));
+ WSContentSend_P(PSTR(D_CONNECT_FAILED_TO " %s
" D_CHECK_CREDENTIALS ""), SettingsTextEscaped(SET_STASSID1).c_str());
}
// More Options Button
WSContentSend_P(PSTR(""),
@@ -2163,7 +2167,7 @@ void HandleLoggingConfiguration(void) {
}
WSContentSend_P(PSTR(""));
}
- WSContentSend_P(HTTP_FORM_LOG2, SettingsText(SET_SYSLOG_HOST), Settings->syslog_port, Settings->tele_period);
+ WSContentSend_P(HTTP_FORM_LOG2, SettingsTextEscaped(SET_SYSLOG_HOST).c_str(), Settings->syslog_port, Settings->tele_period);
WSContentSend_P(HTTP_FORM_END);
WSContentSpaceButton(BUTTON_CONFIGURATION);
WSContentStop();
@@ -2198,10 +2202,10 @@ void HandleOtherConfiguration(void) {
WSContentSendStyle();
TemplateJson();
- WSContentSend_P(HTTP_FORM_OTHER, ResponseData(), (USER_MODULE == Settings->module) ? PSTR(" checked disabled") : "",
+ WSContentSend_P(HTTP_FORM_OTHER, HtmlEscape(ResponseData()).c_str(), (USER_MODULE == Settings->module) ? PSTR(" checked disabled") : "",
(Settings->flag5.disable_referer_chk) ? PSTR(" checked") : "", // SetOption128 - Enable HTTP API
(Settings->flag.mqtt_enabled) ? PSTR(" checked") : "", // SetOption3 - Enable MQTT
- SettingsText(SET_FRIENDLYNAME1), SettingsText(SET_DEVICENAME));
+ SettingsTextEscaped(SET_FRIENDLYNAME1).c_str(), SettingsTextEscaped(SET_DEVICENAME).c_str());
char stemp[32];
uint32_t maxfn = (TasmotaGlobal.devices_present > MAX_FRIENDLYNAMES) ? MAX_FRIENDLYNAMES : (!TasmotaGlobal.devices_present) ? 1 : TasmotaGlobal.devices_present;
@@ -2215,7 +2219,7 @@ void HandleOtherConfiguration(void) {
(i) ? stemp : "",
i,
(i) ? stemp : "",
- SettingsText(SET_FRIENDLYNAME1 + i));
+ SettingsTextEscaped(SET_FRIENDLYNAME1 + i).c_str());
}
#ifdef USE_EMULATION
@@ -2377,7 +2381,7 @@ void HandleInformation(void)
if (IsModuleIfan()) { maxfn = 1; }
#endif // USE_SONOFF_IFAN
for (uint32_t i = 0; i < maxfn; i++) {
- WSContentSend_P(PSTR("}1" D_FRIENDLY_NAME " %d}2%s"), i +1, SettingsText(SET_FRIENDLYNAME1 +i));
+ WSContentSend_P(PSTR("}1" D_FRIENDLY_NAME " %d}2%s"), i +1, SettingsTextEscaped(SET_FRIENDLYNAME1 +i).c_str());
}
WSContentSend_P(PSTR("}1}2 ")); // Empty line
bool show_hr = false;
@@ -2391,7 +2395,7 @@ void HandleInformation(void)
int32_t rssi = WiFi.RSSI();
WSContentSend_P(PSTR("}1" D_AP "%d " D_INFORMATION "}2" D_SSID " %s
" D_RSSI " %d%%, %d dBm
" D_MODE " 11%c
" D_CHANNEL " %d
" D_BSSID " %s"),
Settings->sta_active +1,
- HtmlEscape(SettingsText(SET_STASSID1 + Settings->sta_active)).c_str(),
+ SettingsTextEscaped(SET_STASSID1 + Settings->sta_active).c_str(),
WifiGetRssiAsQuality(rssi), rssi,
pgm_read_byte(&kWifiPhyMode[WiFi.getPhyMode() & 0x3]),
WiFi.channel(),
@@ -2460,14 +2464,14 @@ void HandleInformation(void)
WSContentSend_P(PSTR("}1" D_HTTP_API "}2%s"), Settings->flag5.disable_referer_chk ? PSTR(D_ENABLED) : PSTR(D_DISABLED)); // SetOption 128
WSContentSend_P(PSTR("}1}2 ")); // Empty line
if (Settings->flag.mqtt_enabled) { // SetOption3 - Enable MQTT
- WSContentSend_P(PSTR("}1" D_MQTT_HOST "}2%s"), SettingsText(SET_MQTT_HOST));
+ WSContentSend_P(PSTR("}1" D_MQTT_HOST "}2%s"), SettingsTextEscaped(SET_MQTT_HOST).c_str());
WSContentSend_P(PSTR("}1" D_MQTT_PORT "}2%d"), Settings->mqtt_port);
#ifdef USE_MQTT_TLS
WSContentSend_P(PSTR("}1" D_MQTT_TLS_ENABLE "}2%s"), Settings->flag4.mqtt_tls ? PSTR(D_ENABLED) : PSTR(D_DISABLED));
#endif // USE_MQTT_TLS
- WSContentSend_P(PSTR("}1" D_MQTT_USER "}2%s"), SettingsText(SET_MQTT_USER));
+ WSContentSend_P(PSTR("}1" D_MQTT_USER "}2%s"), SettingsTextEscaped(SET_MQTT_USER).c_str());
WSContentSend_P(PSTR("}1" D_MQTT_CLIENT "}2%s"), TasmotaGlobal.mqtt_client);
- WSContentSend_P(PSTR("}1" D_MQTT_TOPIC "}2%s"), SettingsText(SET_MQTT_TOPIC));
+ WSContentSend_P(PSTR("}1" D_MQTT_TOPIC "}2%s"), SettingsTextEscaped(SET_MQTT_TOPIC).c_str());
uint32_t real_index = SET_MQTT_GRP_TOPIC;
for (uint32_t i = 0; i < MAX_GROUP_TOPICS; i++) {
if (1 == i) { real_index = SET_MQTT_GRP_TOPIC2 -1; }
@@ -2634,7 +2638,7 @@ void HandleUpgradeFirmware(void) {
WSContentStart_P(PSTR(D_FIRMWARE_UPGRADE));
WSContentSendStyle();
- WSContentSend_P(HTTP_FORM_UPG, SettingsText(SET_OTAURL));
+ WSContentSend_P(HTTP_FORM_UPG, SettingsTextEscaped(SET_OTAURL).c_str());
#ifdef ESP32
if (EspSingleOtaPartition() && !EspRunningFactoryPartition()) {
WSContentSend_P(HTTP_FORM_RST_UPG_FCT, PSTR(D_START_UPGRADE));
@@ -3780,6 +3784,7 @@ void CmndWebCanvas(void) {
- WebCanvas linear-gradient(#F02 7%,#F93,#FF4,#082,#00F,#708 93%) // Gradient pride flag
- WebCanvas linear-gradient(#F02 16%,#F93 16% 33%,#FF4 33% 50%,#082 50% 67%,#00F 67% 84%,#708 84%) // Pride flag
- WebCanvas linear-gradient(90deg,#05A 33%,#FFF 33% 67%,#F43 67%) // Flag France
+ - WebCanvas linear-gradient(#000 33%,#D00 33% 67%,#FC0 67%) // Flag Germany
- WebCanvas linear-gradient(#059 33%,#FFF 33% 67%,#F43 67%) // Flag The Netherlands
- WebCanvas linear-gradient(#05B 50%,#FD0 50%) // Flag Ukraine
- WebCanvas linear-gradient(#FFF 33%,#07D 33% 67%,#F34 67%) // Flag Russia
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino b/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino
index 91eb1ef6d..7312135e8 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino
@@ -1974,16 +1974,16 @@ void HandleMqttConfiguration(void)
WSContentStart_P(PSTR(D_CONFIGURE_MQTT));
WSContentSendStyle();
WSContentSend_P(HTTP_FORM_MQTT1,
- SettingsText(SET_MQTT_HOST),
+ SettingsTextEscaped(SET_MQTT_HOST).c_str(),
Settings->mqtt_port,
#ifdef USE_MQTT_TLS
Mqtt.mqtt_tls ? PSTR(" checked") : "", // SetOption103 - Enable MQTT TLS
#endif // USE_MQTT_TLS
- Format(str, PSTR(MQTT_CLIENT_ID), sizeof(str)), PSTR(MQTT_CLIENT_ID), SettingsText(SET_MQTT_CLIENT));
+ Format(str, PSTR(MQTT_CLIENT_ID), sizeof(str)), PSTR(MQTT_CLIENT_ID), SettingsTextEscaped(SET_MQTT_CLIENT).c_str());
WSContentSend_P(HTTP_FORM_MQTT2,
- (!strlen(SettingsText(SET_MQTT_USER))) ? "0" : SettingsText(SET_MQTT_USER),
- Format(str, PSTR(MQTT_TOPIC), sizeof(str)), PSTR(MQTT_TOPIC), SettingsText(SET_MQTT_TOPIC),
- PSTR(MQTT_FULLTOPIC), PSTR(MQTT_FULLTOPIC), SettingsText(SET_MQTT_FULLTOPIC));
+ (!strlen(SettingsText(SET_MQTT_USER))) ? "0" : SettingsTextEscaped(SET_MQTT_USER).c_str(),
+ Format(str, PSTR(MQTT_TOPIC), sizeof(str)), PSTR(MQTT_TOPIC), SettingsTextEscaped(SET_MQTT_TOPIC).c_str(),
+ PSTR(MQTT_FULLTOPIC), PSTR(MQTT_FULLTOPIC), SettingsTextEscaped(SET_MQTT_FULLTOPIC).c_str());
WSContentSend_P(HTTP_FORM_END);
WSContentSpaceButton(BUTTON_CONFIGURATION);
WSContentStop();
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_06_snfbridge.ino b/tasmota/tasmota_xdrv_driver/xdrv_06_snfbridge.ino
index 9b34c497d..2b9988ec6 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_06_snfbridge.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_06_snfbridge.ino
@@ -516,7 +516,7 @@ void SonoffBridgeAddButton(void) {
for (uint32_t j = 0; j < 4; j++) {
idx++;
WSContentSend_P(PSTR(" | "), idx, // &k is related to WebGetArg("k", tmp, sizeof(tmp));
- (strlen(GetWebButton(idx -1))) ? GetWebButton(idx -1) : itoa(idx, number, 10));
+ (strlen(GetWebButton(idx -1))) ? HtmlEscape(GetWebButton(idx -1)).c_str() : itoa(idx, number, 10));
}
}
WSContentSend_P(PSTR(""));
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino b/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino
index f18ba4bc7..98a9c352f 100755
--- a/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino
@@ -10325,7 +10325,7 @@ void ScriptFullWebpage(uint8_t page) {
}
WSContentBegin(200, CT_HTML);
- WSContentSend_P(HTTP_HEADER1, PSTR(D_HTML_LANGUAGE), SettingsText(SET_DEVICENAME), PSTR("Full Screen"));
+ WSContentSend_P(HTTP_HEADER1, PSTR(D_HTML_LANGUAGE), SettingsTextEscaped(SET_DEVICENAME).c_str(), PSTR("Full Screen"));
WSContentSend_P(HTTP_SCRIPT_FULLPAGE1, page , fullpage_refresh);
WSContentSend_P(HTTP_SCRIPT_FULLPAGE2, fullpage_refresh);
//WSContentSend_P(PSTR(""));
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino
index 5ea82165d..1c0e29315 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino
@@ -1624,7 +1624,7 @@ void TuyaAddButton(void) {
char stemp[33];
snprintf_P(stemp, sizeof(stemp), PSTR("" D_JSON_IRHVAC_MODE ""));
WSContentSend_P(HTTP_DEVICE_CONTROL, 26, TasmotaGlobal.devices_present + 1,
- (strlen(GetWebButton(TasmotaGlobal.devices_present))) ? GetWebButton(TasmotaGlobal.devices_present) : stemp, "");
+ (strlen(GetWebButton(TasmotaGlobal.devices_present))) ? HtmlEscape(GetWebButton(TasmotaGlobal.devices_present)).c_str() : stemp, "");
WSContentSend_P(PSTR(""));
}
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino
index a85b7fe53..78d562546 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino
@@ -2432,7 +2432,7 @@ void TuyaAddButton(void) {
char stemp[33];
snprintf_P(stemp, sizeof(stemp), PSTR("" D_JSON_IRHVAC_MODE ""));
WSContentSend_P(HTTP_DEVICE_CONTROL, 26, TasmotaGlobal.devices_present + 1,
- (strlen(GetWebButton(TasmotaGlobal.devices_present))) ? GetWebButton(TasmotaGlobal.devices_present) : stemp, "");
+ (strlen(GetWebButton(TasmotaGlobal.devices_present))) ? HtmlEscape(GetWebButton(TasmotaGlobal.devices_present)).c_str() : stemp, "");
WSContentSend_P(PSTR(""));
}
}
diff --git a/tasmota/tasmota_xlgt_light/xlgt_07_lsc_mcsl.ino b/tasmota/tasmota_xlgt_light/xlgt_07_lsc_mcsl.ino
index 684c63cbb..4270fc665 100644
--- a/tasmota/tasmota_xlgt_light/xlgt_07_lsc_mcsl.ino
+++ b/tasmota/tasmota_xlgt_light/xlgt_07_lsc_mcsl.ino
@@ -269,7 +269,7 @@ void LscMcAddFuctionButtons(void) {
WSContentSend_P(PSTR(" | "), // &lsc is related to WebGetArg("lsc", tmp, sizeof(tmp));
100 / cols,
idx -1,
- (strlen(GetWebButton(idx))) ? GetWebButton(idx) : itoa(idx, number, 10));
+ (strlen(GetWebButton(idx))) ? HtmlEscape(GetWebButton(idx)).c_str() : itoa(idx, number, 10));
}
}
WSContentSend_P(PSTR(""));
From d2690ef7c00639c3c6330349858e622b95dfa4bf Mon Sep 17 00:00:00 2001
From: Jason2866 <24528715+Jason2866@users.noreply.github.com>
Date: Mon, 18 Dec 2023 14:02:00 +0100
Subject: [PATCH 020/303] enable CST816S touch driver in firmware lvgl (#20264)
---
tasmota/include/tasmota_configurations_ESP32.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/tasmota/include/tasmota_configurations_ESP32.h b/tasmota/include/tasmota_configurations_ESP32.h
index 06891b607..7b86bdd3c 100644
--- a/tasmota/include/tasmota_configurations_ESP32.h
+++ b/tasmota/include/tasmota_configurations_ESP32.h
@@ -322,6 +322,7 @@
#define USE_XPT2046
#define USE_FT5206
#define USE_GT911
+#define USE_CST816S
#define USE_MPU_ACCEL
#define USE_RTC_CHIPS // Enable RTC chip support and NTP server - Select only one
#define USE_BM8563
From b69a335634fe45926b390c164e13066ed62c84ab Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Mon, 18 Dec 2023 14:26:13 +0100
Subject: [PATCH 021/303] Update changelogs
---
CHANGELOG.md | 3 +++
RELEASENOTES.md | 3 +++
2 files changed, 6 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index adce0b539..a5e0040d6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,8 @@ All notable changes to this project will be documented in this file.
## [13.3.0.1]
### Added
- Support for Sonoff Basic R4 Magic Switch (#20247)
+- Support for CST816S touch interface (#20213)
+- NeoPool hydrolysis FL1 and Redox flag (#20258)
### Breaking Changed
- Refactoring of Berry `animate` module for WS2812 Leds (#20236)
@@ -14,6 +16,7 @@ All notable changes to this project will be documented in this file.
### Fixed
- Matter Contact sensor was not triggering any update (#20232)
+- CVE-2021-36603 Cross Site Scripting (XSS) vulnerability (#12221)
### Removed
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 7f886e45f..dd63b29dc 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -118,7 +118,9 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
## Changelog v13.3.0.1
### Added
+- Support for CST816S touch interface [#20213](https://github.com/arendst/Tasmota/issues/20213)
- Support for Sonoff Basic R4 Magic Switch [#20247](https://github.com/arendst/Tasmota/issues/20247)
+- NeoPool hydrolysis FL1 and Redox flag [#20258](https://github.com/arendst/Tasmota/issues/20258)
### Breaking Changed
- Refactoring of Berry `animate` module for WS2812 Leds [#20236](https://github.com/arendst/Tasmota/issues/20236)
@@ -126,6 +128,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
### Changed
### Fixed
+- CVE-2021-36603 Cross Site Scripting (XSS) vulnerability [#12221](https://github.com/arendst/Tasmota/issues/12221)
- Matter Contact sensor was not triggering any update [#20232](https://github.com/arendst/Tasmota/issues/20232)
### Removed
\ No newline at end of file
From 81f90a251ccac097a136513b2f042fa8ec6d82cd Mon Sep 17 00:00:00 2001
From: SteWers <42718143+SteWers@users.noreply.github.com>
Date: Tue, 19 Dec 2023 09:37:02 +0100
Subject: [PATCH 022/303] de_DE Fixes and typos (#20269)
* de_DE Fixes and typos
* Hyphen
---
tasmota/language/de_DE.h | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/tasmota/language/de_DE.h b/tasmota/language/de_DE.h
index 31aaa5721..c3bfe2dd7 100644
--- a/tasmota/language/de_DE.h
+++ b/tasmota/language/de_DE.h
@@ -28,7 +28,7 @@
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
* Use online command Prefix to translate cmnd, stat and tele.
*
- * Updated until v13.3.0.1 - Last update 17.12.2023
+ * Updated until v13.3.0.1 - Last update 18.12.2023
\*********************************************************************/
//#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
@@ -176,7 +176,7 @@
#define D_STOP "Stop"
#define D_SUBNET_MASK "Subnetzmaske"
#define D_SUBSCRIBE_TO "abonniere"
-#define D_UNSUBSCRIBE_FROM "löse abo․ von"
+#define D_UNSUBSCRIBE_FROM "löse Abo․ von"
#define D_SUCCESSFUL "erfolgreich"
#define D_SUNRISE "Sonnenaufgang"
#define D_SUNSET "Sonnenuntergang"
@@ -243,7 +243,7 @@
#define D_CONNECT_FAILED_AP_TIMEOUT "Verbindung fehlgeschlagen, da der AP nicht antwortet (timeout)"
#define D_ATTEMPTING_CONNECTION "Verbindungsversuch…"
#define D_CHECKING_CONNECTION "Prüfe Verbindung…"
-#define D_QUERY_DONE "Suchanfrage abgeschlossen․ MQTT-Services gefunden"
+#define D_QUERY_DONE "Suche abgeschlossen․ MQTT-Services gefunden"
#define D_MQTT_SERVICE_FOUND "MQTT-Service gefunden bei"
#define D_FOUND_AT "gefunden bei"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog-Host nicht gefunden"
@@ -339,7 +339,7 @@
#define D_SYSLOG_PORT "Syslog Port"
#define D_TELEMETRY_PERIOD "Telemetrieperiode"
-#define D_OTHER_PARAMETERS "Weiterte Einstellungen"
+#define D_OTHER_PARAMETERS "Weitere Einstellungen"
#define D_TEMPLATE "Vorlage"
#define D_ACTIVATE "Aktivieren"
#define D_DEVICE_NAME "Gerätename"
@@ -399,7 +399,7 @@
#define D_UPLOAD_ERR_3 "Falsche Dateisignatur"
#define D_UPLOAD_ERR_4 "Datei überschreitet vorhdn․ Flashspeicher"
#define D_UPLOAD_ERR_5 "Upload Buffer Vergleich weicht ab"
-#define D_UPLOAD_ERR_6 "Upload fehlgeschlagen․ Aktiviere logging 3"
+#define D_UPLOAD_ERR_6 "Upload fehlgeschlagen․ Aktiviere Logging 3"
#define D_UPLOAD_ERR_7 "Upload abgebrochen"
#define D_UPLOAD_ERR_8 "Datei ungültig"
#define D_UPLOAD_ERR_9 "Datei zu groß"
@@ -408,7 +408,7 @@
#define D_UPLOAD_ERR_12 "RF Chip beschreiben fehlgeschlagen"
#define D_UPLOAD_ERR_13 "RF Firmware ungültig"
#define D_UPLOAD_ERR_14 "Nicht kompatibel"
-#define D_UPLOAD_ERROR_CODE "Upload Fehler Nummer"
+#define D_UPLOAD_ERROR_CODE "Upload Fehlernummer"
#define D_ENTER_COMMAND "Befehl eingeben"
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Aktivere Web Log Level 2 falls Reaktion erwartet"
@@ -445,9 +445,9 @@
// xdrv_07_domoticz.ino
#define D_DOMOTICZ_PARAMETERS "Domoticz-Einstellungen"
#define D_DOMOTICZ_IDX "Idx"
-#define D_DOMOTICZ_KEY_IDX "Key idx"
-#define D_DOMOTICZ_SWITCH_IDX "Switch idx"
-#define D_DOMOTICZ_SENSOR_IDX "Sensor idx"
+#define D_DOMOTICZ_KEY_IDX "Key Idx"
+#define D_DOMOTICZ_SWITCH_IDX "Switch Idx"
+#define D_DOMOTICZ_SENSOR_IDX "Sensor Idx"
#define D_DOMOTICZ_TEMP "Temp"
#define D_DOMOTICZ_TEMP_HUM "Temp,Hum"
#define D_DOMOTICZ_TEMP_HUM_BARO "Temp,Hum,Baro"
@@ -458,7 +458,7 @@
#define D_DOMOTICZ_CURRENT "Current/PM10"
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
#define D_DOMOTICZ_P1_SMART_METER "P1SmartMeter"
-#define D_DOMOTICZ_UPDATE_TIMER "Update Zeitplan"
+#define D_DOMOTICZ_UPDATE_TIMER "Zeitplan-Update"
// xdrv_09_timers.ino
#define D_CONFIGURE_TIMER "Zeitplaneinstellungen"
@@ -472,7 +472,7 @@
#define D_TIMER_ACTION "Aktion"
// xdrv_10_knx.ino
-#define D_CONFIGURE_KNX "KNX konfigurieren"
+#define D_CONFIGURE_KNX "KNX-Einstellungen"
#define D_KNX_PARAMETERS "KNX-Parameter"
#define D_KNX_GENERAL_CONFIG "Allgemein"
#define D_KNX_PHYSICAL_ADDRESS "Physikalische Adresse"
@@ -526,7 +526,7 @@
// xdrv_89_dali.ino
#define D_SENSOR_DALI_RX "Dali RX"
#define D_SENSOR_DALI_TX "Dali TX"
-#define D_CONFIGURE_DALI "Konfig․ DALI"
+#define D_CONFIGURE_DALI "DALI-Einstellungen"
// xdrv_03_energy.ino
#define D_ENERGY_TODAY "Energie heute"
@@ -539,9 +539,9 @@
#define D_DOMOTICZ_SHUTTER "Rollo"
// xdrv_28_pcf8574.ino
-#define D_CONFIGURE_PCF8574 "Konfiguriere PCF8574"
+#define D_CONFIGURE_PCF8574 "PCF8574-Einstellungen"
#define D_PCF8574_PARAMETERS "PCF8574 Parameter"
-#define D_INVERT_PORTS "Invertiere Ports"
+#define D_INVERT_PORTS "Ports invertieren"
#define D_DEVICE "Gerät"
#define D_DEVICE_INPUT "Eingang"
#define D_DEVICE_OUTPUT "Ausgang"
From 23b4cd08d469797ab65515d64a1405db93021ec0 Mon Sep 17 00:00:00 2001
From: budulinek
Date: Tue, 19 Dec 2023 12:29:39 +0100
Subject: [PATCH 023/303] Realtime syslog (#20260)
* Realtime Syslog
* Update tasmota.ino
---------
Co-authored-by: Theo Arends <11044339+arendst@users.noreply.github.com>
---
tasmota/tasmota.ino | 2 ++
tasmota/tasmota_support/support_tasmota.ino | 1 -
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino
index 953db16b4..926839510 100644
--- a/tasmota/tasmota.ino
+++ b/tasmota/tasmota.ino
@@ -886,6 +886,8 @@ void Scheduler(void) {
ArduinoOtaLoop();
#endif // USE_ARDUINO_OTA
#endif // ESP8266
+
+ SyslogAsync(false);
}
void loop(void) {
diff --git a/tasmota/tasmota_support/support_tasmota.ino b/tasmota/tasmota_support/support_tasmota.ino
index 6f8c2870a..5df42a0d2 100644
--- a/tasmota/tasmota_support/support_tasmota.ino
+++ b/tasmota/tasmota_support/support_tasmota.ino
@@ -1142,7 +1142,6 @@ void PerformEverySecond(void)
}
MqttPublishLoggingAsync(false);
- SyslogAsync(false);
ResetGlobalValues();
From b81eaf5bc8276ec1d306358848ae130c14ab2f4a Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Tue, 19 Dec 2023 12:45:13 +0100
Subject: [PATCH 024/303] Support syslog updates every sleep
Support syslog updates every sleep or every second if `#define SYSLOG_UPDATE_SECOND` (#20260)
---
CHANGELOG.md | 1 +
RELEASENOTES.md | 1 +
tasmota/tasmota.ino | 2 ++
tasmota/tasmota_support/support_tasmota.ino | 3 +++
4 files changed, 7 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a5e0040d6..2609fcd7f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file.
- Refactoring of Berry `animate` module for WS2812 Leds (#20236)
### Changed
+- Support syslog updates every sleep or every second if `#define SYSLOG_UPDATE_SECOND` (#20260)
### Fixed
- Matter Contact sensor was not triggering any update (#20232)
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index dd63b29dc..2d809a33a 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -126,6 +126,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- Refactoring of Berry `animate` module for WS2812 Leds [#20236](https://github.com/arendst/Tasmota/issues/20236)
### Changed
+- Support syslog updates every sleep or every second if `#define SYSLOG_UPDATE_SECOND` [#20260](https://github.com/arendst/Tasmota/issues/20260)
### Fixed
- CVE-2021-36603 Cross Site Scripting (XSS) vulnerability [#12221](https://github.com/arendst/Tasmota/issues/12221)
diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino
index 926839510..1cf661f04 100644
--- a/tasmota/tasmota.ino
+++ b/tasmota/tasmota.ino
@@ -887,7 +887,9 @@ void Scheduler(void) {
#endif // USE_ARDUINO_OTA
#endif // ESP8266
+#ifndef SYSLOG_UPDATE_SECOND
SyslogAsync(false);
+#endif // SYSLOG_UPDATE_SECOND
}
void loop(void) {
diff --git a/tasmota/tasmota_support/support_tasmota.ino b/tasmota/tasmota_support/support_tasmota.ino
index 5df42a0d2..94c431e86 100644
--- a/tasmota/tasmota_support/support_tasmota.ino
+++ b/tasmota/tasmota_support/support_tasmota.ino
@@ -1142,6 +1142,9 @@ void PerformEverySecond(void)
}
MqttPublishLoggingAsync(false);
+#ifdef SYSLOG_UPDATE_SECOND
+ SyslogAsync(false);
+#endif // SYSLOG_UPDATE_SECOND
ResetGlobalValues();
From d78a223646b2d474f0ee818823cf98294ec2e841 Mon Sep 17 00:00:00 2001
From: Jason2866 <24528715+Jason2866@users.noreply.github.com>
Date: Tue, 19 Dec 2023 15:14:57 +0100
Subject: [PATCH 025/303] enable lib `ESP32 Async UDP` for core 3.0.0
---
platformio_tasmota32.ini | 1 -
1 file changed, 1 deletion(-)
diff --git a/platformio_tasmota32.ini b/platformio_tasmota32.ini
index d27d9a7d6..da646960f 100644
--- a/platformio_tasmota32.ini
+++ b/platformio_tasmota32.ini
@@ -39,7 +39,6 @@ build_flags = ${esp_defaults.build_flags}
lib_ignore =
HTTPUpdateServer
USB
- ESP32 Async UDP
esp-nimble-cpp
NetBIOS
Preferences
From 87b5886ea7d21e1fb6d73baf8a81cdd54bd17f3f Mon Sep 17 00:00:00 2001
From: Jason2866 <24528715+Jason2866@users.noreply.github.com>
Date: Tue, 19 Dec 2023 15:18:03 +0100
Subject: [PATCH 026/303] correct enable `ESP32 Async UDP` for core 3.0.0
---
platformio_tasmota32.ini | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/platformio_tasmota32.ini b/platformio_tasmota32.ini
index da646960f..a930178d0 100644
--- a/platformio_tasmota32.ini
+++ b/platformio_tasmota32.ini
@@ -39,6 +39,7 @@ build_flags = ${esp_defaults.build_flags}
lib_ignore =
HTTPUpdateServer
USB
+ ESP32 Async UDP
esp-nimble-cpp
NetBIOS
Preferences
@@ -85,7 +86,6 @@ lib_extra_dirs = lib/lib_ssl, lib/lib_basic, lib/lib_i2c, lib/lib_d
lib_ignore =
HTTPUpdateServer
USB
- ESP32 Async UDP
NetBIOS
Preferences
ArduinoOTA
From 9e2ae391fc33bca88acdeb3a468912840936bb59 Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Tue, 19 Dec 2023 15:38:12 +0100
Subject: [PATCH 027/303] Fix ESP32 piezo ceramic buzzer
Fix ESP32 piezo ceramic buzzer doesn't buzz (#20118)
---
CHANGELOG.md | 1 +
RELEASENOTES.md | 1 +
tasmota/tasmota_xdrv_driver/xdrv_24_buzzer.ino | 7 +++++++
3 files changed, 9 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2609fcd7f..4f1887cb2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file.
### Fixed
- Matter Contact sensor was not triggering any update (#20232)
- CVE-2021-36603 Cross Site Scripting (XSS) vulnerability (#12221)
+- ESP32 piezo ceramic buzzer doesn't buzz (#20118)
### Removed
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 2d809a33a..8953e8264 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -130,6 +130,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
### Fixed
- CVE-2021-36603 Cross Site Scripting (XSS) vulnerability [#12221](https://github.com/arendst/Tasmota/issues/12221)
+- ESP32 piezo ceramic buzzer doesn't buzz [#20118](https://github.com/arendst/Tasmota/issues/20118)
- Matter Contact sensor was not triggering any update [#20232](https://github.com/arendst/Tasmota/issues/20232)
### Removed
\ No newline at end of file
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_24_buzzer.ino b/tasmota/tasmota_xdrv_driver/xdrv_24_buzzer.ino
index 81dcc1dc7..9a54076d5 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_24_buzzer.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_24_buzzer.ino
@@ -52,7 +52,14 @@ void BuzzerSet(uint32_t state) {
if (last_state != state) {
// Set 50% duty cycle for frequency output
// Set 0% (or 100% for inverted PWM) duty cycle which turns off frequency output either way
+#ifdef ESP8266
analogWrite(Pin(GPIO_BUZZER), (state) ? Settings->pwm_range / 2 : 0); // set duty cycle for frequency output
+#else
+ int32_t pin = Pin(GPIO_BUZZER);
+ if (analogAttach(pin, Buzzer.inverted) >= 0) {
+ analogWritePhase(pin, (state) ? Settings->pwm_range / 2 : 0, 0);
+ }
+#endif
last_state = state;
}
} else {
From 04a841421711165888ba5f4f06762c807f82478d Mon Sep 17 00:00:00 2001
From: Marcus Better
Date: Wed, 20 Dec 2023 04:00:52 -0500
Subject: [PATCH 028/303] Fix Tuya v2 module compilation (#20272)
---
tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino
index 78d562546..c3fc0b395 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino
@@ -2129,7 +2129,7 @@ void TuyaProcessCommand(unsigned char *buffer){
}
*/
for (uint8_t cmdsID = 0; cmdsID < sizeof(TuyaExcludeCMDsFromMQTT); cmdsID++) {
- if (pgm_read_byte(TuyaExcludeCMDsFromMQTT +cmdsID) == Tuya.buffer[3]) {
+ if (pgm_read_byte(TuyaExcludeCMDsFromMQTT +cmdsID) == cmd) {
isCmdToSuppress = true;
break;
}
From a445c7f23a32a18fa126286bd179aa8f050e6853 Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Wed, 20 Dec 2023 16:00:27 +0100
Subject: [PATCH 029/303] Fix syslog server warning
Fix syslog server warning caused by lack of field and hostname starting with 'z' (#14689)
---
CHANGELOG.md | 1 +
RELEASENOTES.md | 1 +
tasmota/tasmota_support/support.ino | 14 +++++++++++---
tasmota/tasmota_support/support_rtc.ino | 12 ++++++++++++
4 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4f1887cb2..a17df4982 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,7 @@ All notable changes to this project will be documented in this file.
- Matter Contact sensor was not triggering any update (#20232)
- CVE-2021-36603 Cross Site Scripting (XSS) vulnerability (#12221)
- ESP32 piezo ceramic buzzer doesn't buzz (#20118)
+- Syslog server warning caused by lack of field and hostname starting with 'z' (#14689)
### Removed
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 8953e8264..52c7e1e08 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -130,6 +130,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
### Fixed
- CVE-2021-36603 Cross Site Scripting (XSS) vulnerability [#12221](https://github.com/arendst/Tasmota/issues/12221)
+- Syslog server warning caused by lack of field and hostname starting with 'z' [#14689](https://github.com/arendst/Tasmota/issues/14689)
- ESP32 piezo ceramic buzzer doesn't buzz [#20118](https://github.com/arendst/Tasmota/issues/20118)
- Matter Contact sensor was not triggering any update [#20232](https://github.com/arendst/Tasmota/issues/20232)
diff --git a/tasmota/tasmota_support/support.ino b/tasmota/tasmota_support/support.ino
index 361e4c425..c2e8ba855 100755
--- a/tasmota/tasmota_support/support.ino
+++ b/tasmota/tasmota_support/support.ino
@@ -2297,8 +2297,9 @@ void SyslogAsync(bool refresh) {
char* line;
size_t len;
while (GetLog(TasmotaGlobal.syslog_level, &index, &line, &len)) {
- // 00:00:02.096 HTP: Web server active on wemos5 with IP address 192.168.2.172
- // HTP: Web server active on wemos5 with IP address 192.168.2.172
+ // <--- mxtime ---> TAG MSG
+ // 00:00:02.096-029 HTP: Web server active on wemos5 with IP address 192.168.2.172
+ // HTP: Web server active on wemos5 with IP address 192.168.2.172
uint32_t mxtime = strchr(line, ' ') - line +1; // Remove mxtime
if (mxtime > 0) {
uint32_t current_hash = GetHash(SettingsText(SET_SYSLOG_HOST), strlen(SettingsText(SET_SYSLOG_HOST)));
@@ -2321,7 +2322,14 @@ void SyslogAsync(bool refresh) {
}
char header[64];
- snprintf_P(header, sizeof(header), PSTR("%s ESP-"), NetworkHostname());
+ // RFC3164 - BSD syslog protocol - TIMESTAMP HOSTNAME TAG MSG
+ // = Facility 16 (= local use 0), Severity 6 (= informational) => 16 * 8 + 6 = <134>
+ // TIMESTAMP = Mmm dd hh:mm:ss
+ // <134>Jan 1 00:00:02 wemos5 ESP-HTP: server active on wemos5 with IP address 192.168.2.172
+ snprintf_P(header, sizeof(header), PSTR("<134>%s %s ESP-"), GetSyslogDate(line).c_str(), NetworkHostname());
+ // Legacy format
+// snprintf_P(header, sizeof(header), PSTR("%s ESP-"), NetworkHostname());
+
char* line_start = line +mxtime;
#ifdef ESP8266
// Packets over 1460 bytes are not send
diff --git a/tasmota/tasmota_support/support_rtc.ino b/tasmota/tasmota_support/support_rtc.ino
index ff93c14d6..95c1af38a 100644
--- a/tasmota/tasmota_support/support_rtc.ino
+++ b/tasmota/tasmota_support/support_rtc.ino
@@ -109,6 +109,18 @@ String GetBuildDateAndTime(void) {
return String(bdt); // 2017-03-07T11:08:02
}
+String GetSyslogDate(char* mxtime) {
+ // Mmm dd hh:mm:ss
+ // Jan 3 09:23:45
+ // Assuming the day hasn't changed yet ;-)
+ uint32_t month_idx = (RtcTime.month -1) * 3;
+ char month[4] = { 0 };
+ strncpy_P(month, kMonthNamesEnglish + month_idx, 3);
+ char dt[16];
+ snprintf_P(dt, sizeof(dt), PSTR("%s %2d %s"), month, RtcTime.day_of_month, mxtime);
+ return String(dt);
+}
+
String GetMinuteTime(uint32_t minutes) {
char tm[6];
snprintf_P(tm, sizeof(tm), PSTR("%02d:%02d"), minutes / 60, minutes % 60);
From 2f824b1976cd4ca3ef47087a387026121f4cffd4 Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Thu, 21 Dec 2023 14:30:49 +0100
Subject: [PATCH 030/303] Document different syslog layouts
---
tasmota/tasmota_support/support.ino | 55 +++++++++++++++++++++----
tasmota/tasmota_support/support_rtc.ino | 16 +++++--
2 files changed, 61 insertions(+), 10 deletions(-)
diff --git a/tasmota/tasmota_support/support.ino b/tasmota/tasmota_support/support.ino
index c2e8ba855..aca1e11d0 100755
--- a/tasmota/tasmota_support/support.ino
+++ b/tasmota/tasmota_support/support.ino
@@ -2297,7 +2297,7 @@ void SyslogAsync(bool refresh) {
char* line;
size_t len;
while (GetLog(TasmotaGlobal.syslog_level, &index, &line, &len)) {
- // <--- mxtime ---> TAG MSG
+ // <--- mxtime ---> TAG: <---------------------- MSG ---------------------------->
// 00:00:02.096-029 HTP: Web server active on wemos5 with IP address 192.168.2.172
// HTP: Web server active on wemos5 with IP address 192.168.2.172
uint32_t mxtime = strchr(line, ' ') - line +1; // Remove mxtime
@@ -2322,14 +2322,55 @@ void SyslogAsync(bool refresh) {
}
char header[64];
- // RFC3164 - BSD syslog protocol - TIMESTAMP HOSTNAME TAG MSG
- // = Facility 16 (= local use 0), Severity 6 (= informational) => 16 * 8 + 6 = <134>
- // TIMESTAMP = Mmm dd hh:mm:ss
- // <134>Jan 1 00:00:02 wemos5 ESP-HTP: server active on wemos5 with IP address 192.168.2.172
- snprintf_P(header, sizeof(header), PSTR("<134>%s %s ESP-"), GetSyslogDate(line).c_str(), NetworkHostname());
- // Legacy format
+ /* Legacy format (until v13.3.0.1) - HOSTNAME TAG: MSG
+ SYSLOG-MSG = wemos5 ESP-HTP: Web server active on wemos5 with IP address 192.168.2.172
+ Result = 2023-12-20T13:41:11.825749+01:00 wemos5 ESP-HTP: Web server active on wemos5 with IP address 192.168.2.172
+ and below message in syslog if hostname starts with a "z"
+ 2023-12-17T00:09:52.797782+01:00 domus8 rsyslogd: Uncompression of a message failed with return code -3 - enable debug logging if you need further information. Message ignored. [v8.2302.0]
+ Notice in both cases the date and time is taken from the syslog server
+ */
// snprintf_P(header, sizeof(header), PSTR("%s ESP-"), NetworkHostname());
+ /* Legacy format - HOSTNAME TAG: MSG
+ = Facility 16 (= local use 0), Severity 6 (= informational) => 16 * 8 + 6 = <134>
+ SYSLOG-MSG = <134>wemos5 ESP-HTP: Web server active on wemos5 with IP address 192.168.2.172
+ Result = 2023-12-21T11:31:50.378816+01:00 wemos5 ESP-HTP: Web server active on wemos5 with IP address 192.168.2.172
+ Notice in both cases the date and time is taken from the syslog server. Uncompression message is gone.
+ */
+ snprintf_P(header, sizeof(header), PSTR("<134>%s ESP-"), NetworkHostname());
+// Result = 2023-12-21T11:31:50.378816+01:00 wemos5 Tasmota HTP: Web server active on wemos5 with IP address 192.168.2.172
+// snprintf_P(header, sizeof(header), PSTR("<134>%s Tasmota "), NetworkHostname());
+
+ /* RFC3164 - BSD syslog protocol - TIMESTAMP HOSTNAME TAG: MSG
+ = Facility 16 (= local use 0), Severity 6 (= informational) => 16 * 8 + 6 = <134>
+ TIMESTAMP = Mmm dd hh:mm:ss
+ SYSLOG-MSG = <134>Jan 1 00:00:02 wemos5 ESP-HTP: Web server active on wemos5 with IP address 192.168.2.172
+ Result = 2023-01-01T00:00:02+01:00 wemos5 ESP-HTP: Web server active on wemos5 with IP address 192.168.2.172
+ Notice Year is taken from syslog server. Month, day and time is provided by Tasmota device. No milliseconds
+ */
+// snprintf_P(header, sizeof(header), PSTR("<134>%s %s ESP-"), GetSyslogDate(line).c_str(), NetworkHostname());
+// Result = 2023-01-01T00:00:02+01:00 wemos5 Tasmota HTP: Web server active on wemos5 with IP address 192.168.2.172
+// snprintf_P(header, sizeof(header), PSTR("<134>%s %s Tasmota "), GetSyslogDate(line).c_str(), NetworkHostname());
+
+ /* RFC5425 - Syslog protocol - VERSION TIMESTAMP HOSTNAME APP_NAME PROCID STRUCTURED-DATA MSGID MSG
+ = Facility 16 (= local use 0), Severity 6 (= informational) => 16 * 8 + 6 = <134>
+ TIMESTAMP = yyyy-mm-ddThh:mm:ss.nnnZ (= UTC) or yyyy-mm-ddThh:mm:ss.nnn-hh:mm (= local with timezone)
+ APP_NAME = Tasmota
+ PROCID = -
+ STRUCTURED-DATA = -
+ MSGID = -
+ SYSLOG-MSG = <134>1 2023-01-01T00:00:02.096000+01:00 wemos5 Tasmota - - HTP: Web server active on wemos5 with IP address 192.168.2.172
+ Result = 1970-01-01T00:00:02.096000+00:00 wemos5 Tasmota ESP-HTP: Web server active on wemos5 with IP address 192.168.2.172
+ Notice date and time is provided by Tasmota device.
+ */
+// char line_time[13];
+// subStr(line_time, line, " ", 1); // 00:00:02.096-026
+// subStr(line_time, line_time, "-", 1); // 00:00:02.096
+// String systime = GetDate() + line_time + "000" + GetTimeZone(); // 1970-01-01T00:00:02.096000+01:00
+// snprintf_P(header, sizeof(header), PSTR("<134>1 %s %s Tasmota - - ESP-"), systime.c_str(), NetworkHostname());
+// Result = 1970-01-01T00:00:02.096000+00:00 wemos5 Tasmota HTP: Web server active on wemos5 with IP address 192.168.2.172
+// snprintf_P(header, sizeof(header), PSTR("<134>1 %s %s Tasmota - - "), systime.c_str(), NetworkHostname());
+
char* line_start = line +mxtime;
#ifdef ESP8266
// Packets over 1460 bytes are not send
diff --git a/tasmota/tasmota_support/support_rtc.ino b/tasmota/tasmota_support/support_rtc.ino
index 95c1af38a..3c6e9c983 100644
--- a/tasmota/tasmota_support/support_rtc.ino
+++ b/tasmota/tasmota_support/support_rtc.ino
@@ -121,6 +121,13 @@ String GetSyslogDate(char* mxtime) {
return String(dt);
}
+String GetDate(void) {
+ // yyyy-mm-ddT
+ char dt[12];
+ snprintf_P(dt, sizeof(dt), PSTR("%04d-%02d-%02dT"), RtcTime.year, RtcTime.month, RtcTime.day_of_month);
+ return String(dt);
+}
+
String GetMinuteTime(uint32_t minutes) {
char tm[6];
snprintf_P(tm, sizeof(tm), PSTR("%02d:%02d"), minutes / 60, minutes % 60);
@@ -207,14 +214,17 @@ String GetDateAndTime(uint8_t time_type) {
if (DT_LOCAL_MILLIS == time_type) {
char ms[10];
snprintf_P(ms, sizeof(ms), PSTR(".%03d"), RtcMillis());
- dt += ms;
+ dt += ms; // 2017-03-07T11:08:02.123
time_type = DT_LOCAL;
}
- if (Settings->flag3.time_append_timezone && (DT_LOCAL == time_type)) { // SetOption52 - Append timezone to JSON time
+ if (DT_UTC == time_type) {
+ dt += "Z"; // 2017-03-07T11:08:02.123Z
+ }
+ else if (Settings->flag3.time_append_timezone && (DT_LOCAL == time_type)) { // SetOption52 - Append timezone to JSON time
dt += GetTimeZone(); // 2017-03-07T11:08:02-07:00
}
- return dt; // 2017-03-07T11:08:02-07:00
+ return dt; // 2017-03-07T11:08:02-07:00 or 2017-03-07T11:08:02.123-07:00
}
uint32_t UpTime(void) {
From e5abd47c867ad88737e156408f3940f83927b54e Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Thu, 21 Dec 2023 14:49:37 +0100
Subject: [PATCH 031/303] More syslog explaining
---
tasmota/tasmota_support/support.ino | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/tasmota/tasmota_support/support.ino b/tasmota/tasmota_support/support.ino
index aca1e11d0..adc2e2fb6 100755
--- a/tasmota/tasmota_support/support.ino
+++ b/tasmota/tasmota_support/support.ino
@@ -2338,36 +2338,44 @@ void SyslogAsync(bool refresh) {
Notice in both cases the date and time is taken from the syslog server. Uncompression message is gone.
*/
snprintf_P(header, sizeof(header), PSTR("<134>%s ESP-"), NetworkHostname());
+
+// SYSLOG-MSG = <134>wemos5 Tasmota HTP: Web server active on wemos5 with IP address 192.168.2.172
// Result = 2023-12-21T11:31:50.378816+01:00 wemos5 Tasmota HTP: Web server active on wemos5 with IP address 192.168.2.172
// snprintf_P(header, sizeof(header), PSTR("<134>%s Tasmota "), NetworkHostname());
/* RFC3164 - BSD syslog protocol - TIMESTAMP HOSTNAME TAG: MSG
= Facility 16 (= local use 0), Severity 6 (= informational) => 16 * 8 + 6 = <134>
TIMESTAMP = Mmm dd hh:mm:ss
+ TAG: = ESP-HTP:
SYSLOG-MSG = <134>Jan 1 00:00:02 wemos5 ESP-HTP: Web server active on wemos5 with IP address 192.168.2.172
Result = 2023-01-01T00:00:02+01:00 wemos5 ESP-HTP: Web server active on wemos5 with IP address 192.168.2.172
Notice Year is taken from syslog server. Month, day and time is provided by Tasmota device. No milliseconds
*/
// snprintf_P(header, sizeof(header), PSTR("<134>%s %s ESP-"), GetSyslogDate(line).c_str(), NetworkHostname());
+
+// SYSLOG-MSG = <134>Jan 1 00:00:02 wemos5 Tasmota HTP: Web server active on wemos5 with IP address 192.168.2.172
// Result = 2023-01-01T00:00:02+01:00 wemos5 Tasmota HTP: Web server active on wemos5 with IP address 192.168.2.172
// snprintf_P(header, sizeof(header), PSTR("<134>%s %s Tasmota "), GetSyslogDate(line).c_str(), NetworkHostname());
/* RFC5425 - Syslog protocol - VERSION TIMESTAMP HOSTNAME APP_NAME PROCID STRUCTURED-DATA MSGID MSG
= Facility 16 (= local use 0), Severity 6 (= informational) => 16 * 8 + 6 = <134>
- TIMESTAMP = yyyy-mm-ddThh:mm:ss.nnnZ (= UTC) or yyyy-mm-ddThh:mm:ss.nnn-hh:mm (= local with timezone)
+ VERSION = 1
+ TIMESTAMP = yyyy-mm-ddThh:mm:ss.nnnnnn-hh:mm (= local with timezone)
APP_NAME = Tasmota
PROCID = -
STRUCTURED-DATA = -
- MSGID = -
- SYSLOG-MSG = <134>1 2023-01-01T00:00:02.096000+01:00 wemos5 Tasmota - - HTP: Web server active on wemos5 with IP address 192.168.2.172
+ MSGID = ESP-HTP:
+ SYSLOG-MSG = <134>1 1970-01-01T00:00:02.096000+01:00 wemos5 Tasmota - - ESP-HTP: Web server active on wemos5 with IP address 192.168.2.172
Result = 1970-01-01T00:00:02.096000+00:00 wemos5 Tasmota ESP-HTP: Web server active on wemos5 with IP address 192.168.2.172
Notice date and time is provided by Tasmota device.
*/
-// char line_time[13];
+// char line_time[mxtime];
// subStr(line_time, line, " ", 1); // 00:00:02.096-026
// subStr(line_time, line_time, "-", 1); // 00:00:02.096
// String systime = GetDate() + line_time + "000" + GetTimeZone(); // 1970-01-01T00:00:02.096000+01:00
// snprintf_P(header, sizeof(header), PSTR("<134>1 %s %s Tasmota - - ESP-"), systime.c_str(), NetworkHostname());
+
+// SYSLOG-MSG = <134>1 1970-01-01T00:00:02.096000+01:00 wemos5 Tasmota - - HTP: Web server active on wemos5 with IP address 192.168.2.172
// Result = 1970-01-01T00:00:02.096000+00:00 wemos5 Tasmota HTP: Web server active on wemos5 with IP address 192.168.2.172
// snprintf_P(header, sizeof(header), PSTR("<134>1 %s %s Tasmota - - "), systime.c_str(), NetworkHostname());
From 0e87096bade23a8e82552d45e78bfad965c00365 Mon Sep 17 00:00:00 2001
From: Christian Baars
Date: Thu, 21 Dec 2023 20:28:08 +0100
Subject: [PATCH 032/303] allow Berry fast_loop for BLE module (#20281)
---
lib/libesp32/berry_tasmota/src/be_MI32_lib.c | 4 +++
.../xdrv_52_3_berry_MI32.ino | 5 ++++
.../tasmota_xsns_sensor/xsns_62_esp32_mi.ino | 30 ++++++++++++-------
3 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/lib/libesp32/berry_tasmota/src/be_MI32_lib.c b/lib/libesp32/berry_tasmota/src/be_MI32_lib.c
index 22c0a0bc6..e56ad7ae2 100644
--- a/lib/libesp32/berry_tasmota/src/be_MI32_lib.c
+++ b/lib/libesp32/berry_tasmota/src/be_MI32_lib.c
@@ -46,6 +46,9 @@ module MI32 (scope: global) {
extern int be_BLE_init(bvm *vm);
+extern void be_BLE_loop(void);
+BE_FUNC_CTYPE_DECLARE(be_BLE_loop, "", "");
+
extern void be_BLE_reg_conn_cb(void* function, uint8_t *buffer);
BE_FUNC_CTYPE_DECLARE(be_BLE_reg_conn_cb, "", "cc");
@@ -79,6 +82,7 @@ BE_FUNC_CTYPE_DECLARE(be_BLE_adv_block, "", "@(bytes)~[i]");
/* @const_object_info_begin
module BLE (scope: global) {
init, func(be_BLE_init)
+ loop, ctype_func(be_BLE_loop)
conn_cb, ctype_func(be_BLE_reg_conn_cb)
set_svc, ctype_func(be_BLE_set_service)
run, ctype_func(be_BLE_run)
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_MI32.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_MI32.ino
index eb5e9ed33..27a8ed9ba 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_MI32.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_MI32.ino
@@ -76,6 +76,7 @@ extern "C" {
** BLE - generic BLE functions
********************************************************************/
extern bool MI32checkBLEinitialization();
+ extern void MI32BerryLoop();
extern void MI32setBerryAdvCB(void* function, uint8_t *buffer);
extern void MI32setBerryConnCB(void* function, uint8_t *buffer);
extern void MI32setBerryServerCB(void* function, uint8_t *buffer);
@@ -95,6 +96,10 @@ extern "C" {
be_return_nil(vm);
}
+ void be_BLE_loop(void){
+ MI32BerryLoop();
+ }
+
void be_BLE_reg_conn_cb(void* function, uint8_t *buffer);
void be_BLE_reg_conn_cb(void* function, uint8_t *buffer){
MI32setBerryConnCB(function,buffer);
diff --git a/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino b/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino
index c10a559c7..415b2b556 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino
@@ -707,6 +707,10 @@ extern "C" {
return (MI32.mode.init && Settings->flag5.mi32_enable);
}
+ void MI32BerryLoop(){
+ MI32BLELoop();
+ }
+
bool MI32runBerryServer(uint16_t operation, bool response){
MI32.conCtx->operation = operation;
MI32.conCtx->response = response;
@@ -1861,15 +1865,10 @@ void MI32ParseResponse(char *buf, uint16_t bufsize, uint8_t addr[6], int RSSI) {
}
/**
- * @brief Launch functions from Core 1 to make race conditions less likely
- *
- */
-
-void MI32Every50mSecond(){
- if(MI32.mode.shallTriggerTele){
- MI32.mode.shallTriggerTele = 0;
- MI32triggerTele();
- }
+ * Called automatically every 50 milliseconds or can be triggered from Berry with BLE.loop() - useful from fast_loop
+*/
+void MI32BLELoop()
+{
if(MI32.mode.triggerBerryAdvCB == 1){
if(MI32.beAdvCB != nullptr){
// AddLogBuffer(LOG_LEVEL_DEBUG,MI32.beAdvBuf,40);
@@ -1945,14 +1944,25 @@ void MI32Every50mSecond(){
}
}
}
-
if(MI32.infoMsg > 0){
char _message[32];
GetTextIndexed(_message, sizeof(_message), MI32.infoMsg-1, kMI32_BLEInfoMsg);
AddLog(LOG_LEVEL_DEBUG,PSTR("M32: %s"),_message);
MI32.infoMsg = 0;
}
+}
+/**
+ * @brief Launch functions from Core 1 to make race conditions less likely
+ *
+ */
+
+void MI32Every50mSecond(){
+ if(MI32.mode.shallTriggerTele){
+ MI32.mode.shallTriggerTele = 0;
+ MI32triggerTele();
+ }
+ MI32BLELoop();
}
/**
From 5988e77f8c79f750d31507b42689798329da6097 Mon Sep 17 00:00:00 2001
From: Bernhard Urban-Forster
Date: Fri, 22 Dec 2023 14:21:59 +0100
Subject: [PATCH 033/303] as608: send mqtt message on non-matching finger
(#20287)
---
tasmota/tasmota_xsns_sensor/xsns_79_as608.ino | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tasmota/tasmota_xsns_sensor/xsns_79_as608.ino b/tasmota/tasmota_xsns_sensor/xsns_79_as608.ino
index a69f62b08..b2059a90d 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_79_as608.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_79_as608.ino
@@ -172,6 +172,8 @@ void As608Loop(void) {
p = As608Finger->fingerSearch(); // Match found
if (p != FINGERPRINT_OK) {
// AddLog(LOG_LEVEL_DEBUG, PSTR("AS6: No matching finger"));
+ Response_P(PSTR("{\"" D_JSON_FPRINT "\":\"NOMATCH\"}"));
+ MqttPublishPrefixTopicRulesProcess_P(RESULT_OR_STAT, PSTR(D_JSON_FPRINT));
return;
}
From 4ac93a4d1a6f4d76a1306548eb3754189c24cbe9 Mon Sep 17 00:00:00 2001
From: lis0r <2305601+lis0r@users.noreply.github.com>
Date: Fri, 22 Dec 2023 14:31:14 +0000
Subject: [PATCH 034/303] Add support for SJWS01LM BLE flooding sensor (#20288)
---
.../xsns_62_esp32_mi_ble.ino | 40 +++++++++++++++++--
1 file changed, 37 insertions(+), 3 deletions(-)
diff --git a/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi_ble.ino b/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi_ble.ino
index 85e332e3f..c286bad38 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi_ble.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi_ble.ino
@@ -376,6 +376,7 @@ struct mi_sensor_t{
uint32_t light:1; // binary light sensor
uint32_t scale:1;
uint32_t impedance:1;
+ uint32_t flooding:1;
};
uint32_t raw;
} feature;
@@ -395,6 +396,7 @@ struct mi_sensor_t{
uint32_t PairBtn:1;
uint32_t light:1; // binary light sensor
uint32_t scale:1;
+ uint32_t flooding:1;
};
uint32_t raw;
} eventType;
@@ -403,6 +405,7 @@ struct mi_sensor_t{
uint8_t pairing;
int8_t light; // binary light sensor - initialise to -1
int16_t Btn; // moved so we can initialise to -1
+ int16_t flooding;
uint32_t lastTime;
uint32_t lux;
@@ -486,8 +489,9 @@ void (*const MI32_Commands[])(void) PROGMEM = {
#define MI_SCALE_V2 16
#define MI_CGDK2 17
#define AT_BTN 18
+#define MI_SJWS01LM 19
-#define MI_MI32_TYPES 18 //count this manually
+#define MI_MI32_TYPES 19 //count this manually
const uint16_t kMI32DeviceID[MI_MI32_TYPES]={
0x0000, // Unkown
@@ -507,7 +511,8 @@ const uint16_t kMI32DeviceID[MI_MI32_TYPES]={
0x181d, // Mi Scale V1
0x181b, // Mi Scale V2
0x066f, // CGDK2
- 0x004e // Avago Tech Bluetooth Buttons (Company Id)
+ 0x004e, // Avago Tech Bluetooth Buttons (Company Id)
+ 0x0863 // SJWS01LM
};
const char kMI32DeviceType0[] PROGMEM = "Unknown";
@@ -528,7 +533,8 @@ const char kMI32DeviceType14[] PROGMEM ="MISCALEV1";
const char kMI32DeviceType15[] PROGMEM ="MISCALEV2";
const char kMI32DeviceType16[] PROGMEM ="CGDK2";
const char kMI32DeviceType17[] PROGMEM ="ATBTN";
-const char * kMI32DeviceType[] PROGMEM = {kMI32DeviceType0,kMI32DeviceType1,kMI32DeviceType2,kMI32DeviceType3,kMI32DeviceType4,kMI32DeviceType5,kMI32DeviceType6,kMI32DeviceType7,kMI32DeviceType8,kMI32DeviceType9,kMI32DeviceType10,kMI32DeviceType11,kMI32DeviceType12,kMI32DeviceType13,kMI32DeviceType14,kMI32DeviceType15,kMI32DeviceType16,kMI32DeviceType17};
+const char kMI32DeviceType18[] PROGMEM = "SJWS01LM";
+const char * kMI32DeviceType[] PROGMEM = {kMI32DeviceType0,kMI32DeviceType1,kMI32DeviceType2,kMI32DeviceType3,kMI32DeviceType4,kMI32DeviceType5,kMI32DeviceType6,kMI32DeviceType7,kMI32DeviceType8,kMI32DeviceType9,kMI32DeviceType10,kMI32DeviceType11,kMI32DeviceType12,kMI32DeviceType13,kMI32DeviceType14,kMI32DeviceType15,kMI32DeviceType16,kMI32DeviceType17,kMI32DeviceType18};
typedef int BATREAD_FUNCTION(int slot);
typedef int UNITWRITE_FUNCTION(int slot, int unit);
@@ -1539,6 +1545,7 @@ uint32_t MIBLEgetSensorSlot(const uint8_t *mac, uint16_t _type, uint8_t counter,
_newSensor.lux = 0x00ffffff;
_newSensor.light = -1;
_newSensor.Btn = -1;
+ _newSensor.flooding = -1;
_newSensor.lastCnt = counter;
switch (_type)
{
@@ -1586,6 +1593,11 @@ uint32_t MIBLEgetSensorSlot(const uint8_t *mac, uint16_t _type, uint8_t counter,
_newSensor.feature.Btn=1;
_newSensor.needkey = KEY_NOT_REQUIRED;
break;
+ case MI_SJWS01LM:
+ _newSensor.feature.flooding = 1;
+ _newSensor.feature.Btn = 1;
+ _newSensor.feature.bat = 1;
+ break;
default:
_newSensor.hum=NAN;
@@ -2104,6 +2116,14 @@ int MI32parseMiPayload(int _slot, struct mi_beacon_data_t *parsed){
res = 0;
} break;
//Flooding 0x1014 1 1
+ case 0x1014:{ //'Flooding sensor' - 0=dry, 1=wet SJWS01LM
+ MIBLEsensors[_slot].flooding = (uint8_t)parsed->payload.data[0]; // just an 8 bit value in a union.
+ MIBLEsensors[_slot].eventType.flooding = 1;
+ MI32.mode.shallTriggerTele = 1;
+ MIBLEsensors[_slot].shallSendMQTT = 1;
+ MIBLEsensors[_slot].feature.flooding = 1;
+ }
+ break;
//smoke 0x1015 1 1
//Gas 0x1016
case 0x1017:{ // 'No one moves'
@@ -2752,6 +2772,7 @@ const char HTTP_MISCALE_WEIGHT_REMOVED[] PROGMEM = "{s}%s" " Weight removed" "{m
const char HTTP_MISCALE_WEIGHT_STABILIZED[] PROGMEM = "{s}%s" " Weight stabilized" "{m}%s{e}";
const char HTTP_MISCALE_IMPEDANCE[] PROGMEM = "{s}%s" " Impedance" "{m}%u{e}";
const char HTTP_MISCALE_IMPEDANCE_STABILIZED[] PROGMEM = "{s}%s" " Impedance stabilized" "{m}%s{e}";
+const char HTTP_SJWS01LM_FLOODING[] PROGMEM = "{s}%s Flooding{m}%u {e}";
//const char HTTP_NEEDKEY[] PROGMEM = "{s}%s Btn);
}
}
+ if (p->feature.flooding){
+ if(p->eventType.flooding || !MI32.mode.triggeredTele || MI32.option.allwaysAggregate
+#ifdef USE_HOME_ASSISTANT
+ ||(hass_mode==2)
+#endif //USE_HOME_ASSISTANT
+ ){
+ ResponseAppend_P(PSTR(",\"Flooding\":%d"),p->flooding);
+ }
+ }
if(p->eventType.PairBtn && p->pairing){
ResponseAppend_P(PSTR(",\"Pair\":%u"),p->pairing);
}
@@ -3648,6 +3678,10 @@ void MI32Show(bool json)
if (p->feature.Btn){
WSContentSend_PD(HTTP_LASTBUTTON, typeName, p->Btn);
}
+ if (p->feature.flooding)
+ {
+ WSContentSend_PD(HTTP_SJWS01LM_FLOODING, typeName, p->flooding);
+ }
if (p->pairing){
WSContentSend_PD(HTTP_PAIRING, typeName);
}
From fbc827d11d0a6ed03e13dff0b389ac2a5a70676c Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Fri, 22 Dec 2023 18:10:34 +0100
Subject: [PATCH 035/303] Berry fix leds brightness (#20292)
---
.../berry_tasmota/src/be_animate_module.c | 23 +-
.../berry_tasmota/src/embedded/animate_0.be | 3 +
.../{animate_0_core.be => animate_1_core.be} | 12 +-
...ffects.be => animate_2_animate_effects.be} | 7 +-
.../src/embedded/animate_9_module.be | 23 +-
.../berry_tasmota/src/embedded/leds.be | 26 +
.../src/solidify/solidified_animate_0.h | 7 +
...e_0_core.h => solidified_animate_1_core.h} | 902 ++++++-----
...=> solidified_animate_2_animate_effects.h} | 2 +-
.../solidify/solidified_animate_9_module.h | 162 +-
.../src/solidify/solidified_leds.h | 1375 +++++++++--------
.../berry/animate_demo/animate_demo_pulse.be | 3 +-
.../xdrv_52_3_berry_leds.ino | 24 +-
13 files changed, 1401 insertions(+), 1168 deletions(-)
create mode 100644 lib/libesp32/berry_tasmota/src/embedded/animate_0.be
rename lib/libesp32/berry_tasmota/src/embedded/{animate_0_core.be => animate_1_core.be} (92%)
rename lib/libesp32/berry_tasmota/src/embedded/{animate_1_animate_effects.be => animate_2_animate_effects.be} (97%)
create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0.h
rename lib/libesp32/berry_tasmota/src/solidify/{solidified_animate_0_core.h => solidified_animate_1_core.h} (83%)
rename lib/libesp32/berry_tasmota/src/solidify/{solidified_animate_1_animate_effects.h => solidified_animate_2_animate_effects.h} (99%)
diff --git a/lib/libesp32/berry_tasmota/src/be_animate_module.c b/lib/libesp32/berry_tasmota/src/be_animate_module.c
index d638cbb79..3c920e6be 100644
--- a/lib/libesp32/berry_tasmota/src/be_animate_module.c
+++ b/lib/libesp32/berry_tasmota/src/be_animate_module.c
@@ -24,8 +24,8 @@
#include "be_constobj.h"
#include "be_mapping.h"
-#include "solidify/solidified_animate_0_core.h"
-#include "solidify/solidified_animate_1_animate_effects.h"
+#include "solidify/solidified_animate_1_core.h"
+#include "solidify/solidified_animate_2_animate_effects.h"
#include "solidify/solidified_animate_9_module.h"
@@ -154,7 +154,6 @@ module animate (scope: global, strings: weak) {
TRIANGLE, int(2)
SQUARE, int(3)
COSINE, int(4)
- SINE, int(5)
LASTFORM, int(5)
PALETTE_STANDARD_TAG, comptr(PALETTE_STANDARD_TAG)
@@ -182,14 +181,14 @@ module animate (scope: global, strings: weak) {
import animate
var p, gradient
p = animate.palette.ptr_to_palette(animate.PALETTE_STANDARD_TAG)
-assert(p == bytes('40FF000040FFA50040FFFF004000FF00400000FF40FF00FF40FFFFFF00FF0000'))
+assert(p == bytes('40FF000040FFA50040FFFF004000FF00400000FF40FF00FF40EE44A500FF0000'))
gradient = animate.palette.to_css_gradient(p)
-assert(gradient == 'background:linear-gradient(to right,#FF0000 0.0%,#FFA500 14.3%,#FFFF00 28.6%,#00FF00 42.9%,#0000FF 57.1%,#FF00FF 71.4%,#FFFFFF 85.7%,#FF0000 100.0%);')
+assert(gradient == 'background:linear-gradient(to right,#FF0000 0.0%,#FFA500 14.3%,#FFFF00 28.6%,#00FF00 42.9%,#0000FF 57.1%,#FF00FF 71.4%,#EE44A5 85.7%,#FF0000 100.0%);')
p = animate.palette.ptr_to_palette(animate.PALETTE_STANDARD_VAL)
-assert(p == bytes('00FF000024FFA50049FFFF006E00FF00920000FFB7FF00FFDBFFFFFFFFFF0000'))
+assert(p == bytes('00FF00002AFFA50055FFFF007F00FF00AA0000FFD4FF00FFFFFF0000'))
gradient = animate.palette.to_css_gradient(animate.PALETTE_STANDARD_VAL)
-assert(gradient == 'background:linear-gradient(to right,#FF0000 0.0%,#FFA500 14.1%,#FFFF00 28.6%,#00FF00 43.1%,#0000FF 57.3%,#FF00FF 71.8%,#FFFFFF 85.9%,#FF0000 100.0%);')
+assert(gradient == 'background:linear-gradient(to right,#FF0000 0.0%,#FFA500 16.5%,#FFFF00 33.3%,#00FF00 49.8%,#0000FF 66.7%,#FF00FF 83.1%,#FF0000 100.0%);')
# unit tests
@@ -227,16 +226,6 @@ assert(o.animate(6000) == 1000)
assert(o.animate(7000) == -1000)
assert(o.animate(7100) == -1000)
-o = animate.oscillator(-1000, 1000, 6000, animate.SINE)
-o.start(1000)
-assert(o.animate(1000) == 0)
-assert(o.animate(1500) == 500)
-assert(o.animate(2000) == 867)
-assert(o.animate(2500) == 1000)
-assert(o.animate(4000) == 0)
-assert(o.animate(5500) == -1000)
-assert(o.animate(7000) == 0)
-
o = animate.oscillator(-1000, 1000, 6000, animate.COSINE)
o.start(1000)
assert(o.animate(1000) == -1000)
diff --git a/lib/libesp32/berry_tasmota/src/embedded/animate_0.be b/lib/libesp32/berry_tasmota/src/embedded/animate_0.be
new file mode 100644
index 000000000..5c854f6e1
--- /dev/null
+++ b/lib/libesp32/berry_tasmota/src/embedded/animate_0.be
@@ -0,0 +1,3 @@
+# prepare for module `animate`
+
+global.animate = module('animate')
\ No newline at end of file
diff --git a/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be b/lib/libesp32/berry_tasmota/src/embedded/animate_1_core.be
similarity index 92%
rename from lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be
rename to lib/libesp32/berry_tasmota/src/embedded/animate_1_core.be
index 747376d9d..bacaf561d 100644
--- a/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be
+++ b/lib/libesp32/berry_tasmota/src/embedded/animate_1_core.be
@@ -36,6 +36,7 @@ class Animate_core
self.strip = strip
if (bri == nil) bri = 50 end
self.bri = bri # percentage of brightness 0..100
+ self.set_strip_bri()
self.running = false
self.pixel_count = strip.pixel_count()
self.animators = []
@@ -51,6 +52,10 @@ class Animate_core
self.set_current()
end
+ def set_strip_bri()
+ self.strip.set_bri(tasmota.scale_uint(self.bri, 0, 100, 0, 255))
+ end
+
# set this animate.core as the current animator for configuration
def set_current()
global._cur_anim = self # declare the current animate.core for painters and animators to register
@@ -129,6 +134,7 @@ class Animate_core
def set_bri(bri)
self.bri = bri
+ self.set_strip_bri()
end
def get_bri(bri)
return self.bri
@@ -165,7 +171,10 @@ class Animate_core
while i < size(self.painters)
layer.fill_pixels(0xFF000000) # fill with transparent color
if (self.painters[i].paint(layer))
+# print(f"frame0 {self.frame.tohex()}")
+# print(f"layer0 {self.layer.tohex()}")
frame.blend_pixels(layer)
+# print(f"frame1 {self.frame.tohex()}")
end
i += 1
end
@@ -177,7 +186,7 @@ class Animate_core
end
self.animate()
# now display the frame
- self.frame.paste_pixels(self.strip.pixels_buffer(), self.bri, self.strip.gamma)
+ self.frame.paste_pixels(self.strip.pixels_buffer(), self.strip.get_bri(), self.strip.get_gamma())
self.strip.dirty()
self.strip.show()
end
@@ -192,3 +201,4 @@ class Animate_core
tasmota.remove_fast_loop(self.fast_loop_cb)
end
end
+animate.core = global.Animate_core
diff --git a/lib/libesp32/berry_tasmota/src/embedded/animate_1_animate_effects.be b/lib/libesp32/berry_tasmota/src/embedded/animate_2_animate_effects.be
similarity index 97%
rename from lib/libesp32/berry_tasmota/src/embedded/animate_1_animate_effects.be
rename to lib/libesp32/berry_tasmota/src/embedded/animate_2_animate_effects.be
index a059ee85c..d2653db67 100644
--- a/lib/libesp32/berry_tasmota/src/embedded/animate_1_animate_effects.be
+++ b/lib/libesp32/berry_tasmota/src/embedded/animate_2_animate_effects.be
@@ -19,6 +19,7 @@ class Animate_painter
end
end
+animate.painter = global.Animate_painter
##########################################################################################
#
@@ -144,8 +145,8 @@ class Animate_pulse : Animate_painter
return true
end
-
end
+animate.pulse = global.Animate_pulse
#
# Unit tests
@@ -156,8 +157,8 @@ import animate
var frame = animate.frame(10)
assert(frame.tohex() == '00000000000000000000000000000000000000000000000000000000000000000000000000000000')
-var pulse = Animate_pulse(0x00FF00, 3, 2)
-pulse.set_index(5)
+var pulse = animate.pulse(0x00FF00, 3, 2)
+pulse.set_pos(5)
pulse.paint(frame)
assert(frame.tohex() == '0000000000000000000000000055000000AA000000FF000000FF000000FF000000AA000000550000')
diff --git a/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be b/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be
index 46fdcb16f..6991f0fde 100644
--- a/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be
+++ b/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be
@@ -4,15 +4,6 @@
# Animation framework
#
-animate = module("animate")
-
-# for solidification
-class Leds_frame end
-
-animate.("()") = Animate_core # make it available as `animate()`
-animate.frame = Leds_frame
-animate.pulse = Animate_pulse
-
#################################################################################
# class Animate_palette
#
@@ -85,7 +76,6 @@ animate.pulse = Animate_pulse
# )
# # animate.PALETTE_STANDARD = PALETTE_STANDARD
-
#@ solidify:Animate_animator,weak
class Animate_animator
# timing information
@@ -134,6 +124,7 @@ class Animate_animator
end
end
+animate.animator = Animate_animator
#@ solidify:Animate_palette,weak
class Animate_palette : Animate_animator
@@ -408,7 +399,6 @@ animate.SAWTOOTH = 1
animate.TRIANGLE = 2
animate.SQUARE = 3
animate.COSINE = 4
-animate.SINE = 5
animate.LASTFOMR = 5 # identify last form
#@ solidify:Animate_oscillator,weak
@@ -471,7 +461,7 @@ class Animate_oscillator : Animate_animator
var past = millis - self.origin
if past < 0
past = 0
- millis = self.originally
+ millis = self.origin
end
var duration_ms = self.duration_ms
var duration_ms_mid # mid point considering duty cycle
@@ -506,13 +496,10 @@ class Animate_oscillator : Animate_animator
else
value = b
end
- elif (self.form == 4) #-COSINE-# || (self.form == 5) #-SINE-#
+ elif (self.form == 4) #-COSINE-#
# map timing to 0..32767
var angle = tasmota.scale_int(past_with_phase, 0, duration_ms - 1, 0, 32767)
- if (self.form == 4) #-COSINE-#
- angle -= 8192
- end
- var x = tasmota.sine_int(angle) # -4096 .. 4096
+ var x = tasmota.sine_int(angle - 8192) # -4096 .. 4096, dephase from cosine to sine
value = tasmota.scale_int(x, -4096, 4096, a, b)
end
self.value = value
@@ -526,4 +513,4 @@ class Animate_oscillator : Animate_animator
return value
end
end
-animate.oscillator = Animate_oscillator
+global.animate.oscillator = Animate_oscillator
diff --git a/lib/libesp32/berry_tasmota/src/embedded/leds.be b/lib/libesp32/berry_tasmota/src/embedded/leds.be
index 3e20b1c4a..1d9e505ac 100644
--- a/lib/libesp32/berry_tasmota/src/embedded/leds.be
+++ b/lib/libesp32/berry_tasmota/src/embedded/leds.be
@@ -27,6 +27,7 @@ class Leds_ntv end
class Leds : Leds_ntv
var gamma # if true, apply gamma (true is default)
var leds # number of leds
+ var bri # implicit brightness for this led strip (0..255, default is 50% = 127)
# leds:int = number of leds of the strip
# gpio:int (optional) = GPIO for NeoPixel. If not specified, takes the WS2812 gpio
# typ:int (optional) = Type of LED, defaults to WS2812 RGB
@@ -34,6 +35,7 @@ class Leds : Leds_ntv
def init(leds, gpio_phy, typ, rmt) # rmt is optional
self.gamma = true # gamma is enabled by default, it should be disabled explicitly if needed
self.leds = int(leds)
+ self.bri = 127 # 50% brightness by default
# if no GPIO, abort
if gpio_phy == nil
@@ -93,6 +95,16 @@ class Leds : Leds_ntv
self.show()
end
+ # set bri (0..255)
+ def set_bri(bri)
+ if (bri < 0) bri = 0 end
+ if (bri > 255) bri = 255 end
+ self.bri = bri
+ end
+ def get_bri()
+ return self.bri
+ end
+
def ctor(leds, gpio_phy, typ, rmt)
if typ == nil
typ = self.WS2812_GRB
@@ -136,14 +148,22 @@ class Leds : Leds_ntv
return 0
end
def clear_to(col, bri)
+ if (bri == nil) bri = self.bri end
self.call_native(9, self.to_gamma(col, bri))
end
def set_pixel_color(idx, col, bri)
+ if (bri == nil) bri = self.bri end
self.call_native(10, idx, self.to_gamma(col, bri))
end
def get_pixel_color(idx)
return self.call_native(11, idx)
end
+ def set_gamma(gamma)
+ self.gamma = bool(gamma)
+ end
+ def get_gamma()
+ return self.gamma
+ end
# def rotate_left(rot, first, last)
# self.call_native(20, rot, first, last)
# end
@@ -159,6 +179,7 @@ class Leds : Leds_ntv
# apply gamma and bri
def to_gamma(rgb, bri)
+ if (bri == nil) bri = self.bri end
return self.apply_bri_gamma(rgb, bri, self.gamma)
end
@@ -216,6 +237,7 @@ class Leds : Leds_ntv
return self.leds
end
def clear_to(col, bri)
+ if (bri == nil) bri = self.bri end
self.strip.call_native(9, self.strip.to_gamma(col, bri), self.offset, self.leds)
# var i = 0
# while i < self.leds
@@ -224,6 +246,7 @@ class Leds : Leds_ntv
# end
end
def set_pixel_color(idx, col, bri)
+ if (bri == nil) bri = self.bri end
self.strip.set_pixel_color(idx + self.offset, col, bri)
end
def get_pixel_color(idx)
@@ -301,9 +324,11 @@ class Leds : Leds_ntv
return self.offset
end
def clear_to(col, bri)
+ if (bri == nil) bri = self.bri end
self.strip.call_native(9, self.strip.to_gamma(col, bri), self.offset, self.w * self.h)
end
def set_pixel_color(idx, col, bri)
+ if (bri == nil) bri = self.bri end
self.strip.set_pixel_color(idx + self.offset, col, bri)
end
def get_pixel_color(idx)
@@ -328,6 +353,7 @@ class Leds : Leds_ntv
end
def set_matrix_pixel_color(x, y, col, bri)
+ if (bri == nil) bri = self.bri end
if self.alternate && x % 2
# reversed line
self.strip.set_pixel_color(x * self.w + self.h - y - 1 + self.offset, col, bri)
diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0.h
new file mode 100644
index 000000000..a0a262928
--- /dev/null
+++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0.h
@@ -0,0 +1,7 @@
+/* Solidification of animate_0.h */
+/********************************************************************\
+* Generated code, don't edit *
+\********************************************************************/
+#include "be_constobj.h"
+/********************************************************************/
+/* End of solidification */
diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_1_core.h
similarity index 83%
rename from lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h
rename to lib/libesp32/berry_tasmota/src/solidify/solidified_animate_1_core.h
index cc86ccf2e..280b7de5c 100644
--- a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h
+++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_1_core.h
@@ -1,4 +1,4 @@
-/* Solidification of animate_0_core.h */
+/* Solidification of animate_1_core.h */
/********************************************************************\
* Generated code, don't edit *
\********************************************************************/
@@ -7,11 +7,11 @@
extern const bclass be_class_Animate_core;
/********************************************************************
-** Solidified function: start
+** Solidified function: clear
********************************************************************/
-be_local_closure(Animate_core_start, /* name */
+be_local_closure(Animate_core_clear, /* name */
be_nested_proto(
- 6, /* nstack */
+ 3, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
@@ -19,110 +19,62 @@ be_local_closure(Animate_core_start, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 9]) { /* constants */
- /* K0 */ be_nested_str_weak(running),
- /* K1 */ be_nested_str_weak(animators),
- /* K2 */ be_const_int(0),
- /* K3 */ be_nested_str_weak(start),
- /* K4 */ be_const_int(1),
- /* K5 */ be_nested_str_weak(fast_loop_next),
- /* K6 */ be_nested_str_weak(tasmota),
- /* K7 */ be_nested_str_weak(add_fast_loop),
- /* K8 */ be_nested_str_weak(fast_loop_cb),
- }),
- be_str_weak(start),
- &be_const_str_solidified,
- ( &(const binstruction[20]) { /* code */
- 0x50040200, // 0000 LDBOOL R1 1 0
- 0x90020001, // 0001 SETMBR R0 K0 R1
- 0x88040101, // 0002 GETMBR R1 R0 K1
- 0x58080002, // 0003 LDCONST R2 K2
- 0x600C000C, // 0004 GETGBL R3 G12
- 0x5C100200, // 0005 MOVE R4 R1
- 0x7C0C0200, // 0006 CALL R3 1
- 0x140C0403, // 0007 LT R3 R2 R3
- 0x780E0004, // 0008 JMPF R3 #000E
- 0x940C0202, // 0009 GETIDX R3 R1 R2
- 0x8C0C0703, // 000A GETMET R3 R3 K3
- 0x7C0C0200, // 000B CALL R3 1
- 0x00080504, // 000C ADD R2 R2 K4
- 0x7001FFF5, // 000D JMP #0004
- 0x90020B02, // 000E SETMBR R0 K5 K2
- 0xB80E0C00, // 000F GETNGBL R3 K6
- 0x8C0C0707, // 0010 GETMET R3 R3 K7
- 0x88140108, // 0011 GETMBR R5 R0 K8
- 0x7C0C0400, // 0012 CALL R3 2
- 0x80000000, // 0013 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: remove
-********************************************************************/
-be_local_closure(Animate_core_remove, /* name */
- be_nested_proto(
- 4, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_nested_str_weak(clear),
- /* K1 */ be_nested_str_weak(tasmota),
- /* K2 */ be_nested_str_weak(remove_fast_loop),
- /* K3 */ be_nested_str_weak(fast_loop_cb),
- }),
- be_str_weak(remove),
- &be_const_str_solidified,
- ( &(const binstruction[ 7]) { /* code */
- 0x8C040100, // 0000 GETMET R1 R0 K0
- 0x7C040200, // 0001 CALL R1 1
- 0xB8060200, // 0002 GETNGBL R1 K1
- 0x8C040302, // 0003 GETMET R1 R1 K2
- 0x880C0103, // 0004 GETMBR R3 R0 K3
- 0x7C040400, // 0005 CALL R1 2
- 0x80000000, // 0006 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: add_background_animator
-********************************************************************/
-be_local_closure(Animate_core_add_background_animator, /* name */
- be_nested_proto(
- 6, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
( &(const bvalue[ 3]) { /* constants */
- /* K0 */ be_nested_str_weak(set_cb),
- /* K1 */ be_nested_str_weak(set_back_color),
- /* K2 */ be_nested_str_weak(add_animator),
+ /* K0 */ be_nested_str_weak(stop),
+ /* K1 */ be_nested_str_weak(strip),
+ /* K2 */ be_nested_str_weak(clear),
}),
- be_str_weak(add_background_animator),
+ be_str_weak(clear),
&be_const_str_solidified,
- ( &(const binstruction[ 8]) { /* code */
- 0x8C080300, // 0000 GETMET R2 R1 K0
- 0x5C100000, // 0001 MOVE R4 R0
- 0x88140101, // 0002 GETMBR R5 R0 K1
- 0x7C080600, // 0003 CALL R2 3
- 0x8C080102, // 0004 GETMET R2 R0 K2
- 0x5C100200, // 0005 MOVE R4 R1
- 0x7C080400, // 0006 CALL R2 2
- 0x80000000, // 0007 RET 0
+ ( &(const binstruction[ 6]) { /* code */
+ 0x8C040100, // 0000 GETMET R1 R0 K0
+ 0x7C040200, // 0001 CALL R1 1
+ 0x88040101, // 0002 GETMBR R1 R0 K1
+ 0x8C040302, // 0003 GETMET R1 R1 K2
+ 0x7C040200, // 0004 CALL R1 1
+ 0x80000000, // 0005 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_strip_bri
+********************************************************************/
+be_local_closure(Animate_core_set_strip_bri, /* name */
+ be_nested_proto(
+ 10, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 6]) { /* constants */
+ /* K0 */ be_nested_str_weak(strip),
+ /* K1 */ be_nested_str_weak(set_bri),
+ /* K2 */ be_nested_str_weak(tasmota),
+ /* K3 */ be_nested_str_weak(scale_uint),
+ /* K4 */ be_nested_str_weak(bri),
+ /* K5 */ be_const_int(0),
+ }),
+ be_str_weak(set_strip_bri),
+ &be_const_str_solidified,
+ ( &(const binstruction[12]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x8C040301, // 0001 GETMET R1 R1 K1
+ 0xB80E0400, // 0002 GETNGBL R3 K2
+ 0x8C0C0703, // 0003 GETMET R3 R3 K3
+ 0x88140104, // 0004 GETMBR R5 R0 K4
+ 0x58180005, // 0005 LDCONST R6 K5
+ 0x541E0063, // 0006 LDINT R7 100
+ 0x58200005, // 0007 LDCONST R8 K5
+ 0x542600FE, // 0008 LDINT R9 255
+ 0x7C0C0C00, // 0009 CALL R3 6
+ 0x7C040400, // 000A CALL R1 2
+ 0x80000000, // 000B RET 0
})
)
);
@@ -170,102 +122,6 @@ be_local_closure(Animate_core_remove_painter, /* name */
/*******************************************************************/
-/********************************************************************
-** Solidified function: add_animator
-********************************************************************/
-be_local_closure(Animate_core_add_animator, /* name */
- be_nested_proto(
- 5, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 3]) { /* constants */
- /* K0 */ be_nested_str_weak(animators),
- /* K1 */ be_nested_str_weak(find),
- /* K2 */ be_nested_str_weak(push),
- }),
- be_str_weak(add_animator),
- &be_const_str_solidified,
- ( &(const binstruction[12]) { /* code */
- 0x88080100, // 0000 GETMBR R2 R0 K0
- 0x8C080501, // 0001 GETMET R2 R2 K1
- 0x5C100200, // 0002 MOVE R4 R1
- 0x7C080400, // 0003 CALL R2 2
- 0x4C0C0000, // 0004 LDNIL R3
- 0x1C080403, // 0005 EQ R2 R2 R3
- 0x780A0003, // 0006 JMPF R2 #000B
- 0x88080100, // 0007 GETMBR R2 R0 K0
- 0x8C080502, // 0008 GETMET R2 R2 K2
- 0x5C100200, // 0009 MOVE R4 R1
- 0x7C080400, // 000A CALL R2 2
- 0x80000000, // 000B RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: animate
-********************************************************************/
-be_local_closure(Animate_core_animate, /* name */
- be_nested_proto(
- 1, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 0, /* has constants */
- NULL, /* no const */
- be_str_weak(animate),
- &be_const_str_solidified,
- ( &(const binstruction[ 1]) { /* code */
- 0x80000000, // 0000 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: clear
-********************************************************************/
-be_local_closure(Animate_core_clear, /* name */
- be_nested_proto(
- 3, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 3]) { /* constants */
- /* K0 */ be_nested_str_weak(stop),
- /* K1 */ be_nested_str_weak(strip),
- /* K2 */ be_nested_str_weak(clear),
- }),
- be_str_weak(clear),
- &be_const_str_solidified,
- ( &(const binstruction[ 6]) { /* code */
- 0x8C040100, // 0000 GETMET R1 R0 K0
- 0x7C040200, // 0001 CALL R1 1
- 0x88040101, // 0002 GETMBR R1 R0 K1
- 0x8C040302, // 0003 GETMET R1 R1 K2
- 0x7C040200, // 0004 CALL R1 1
- 0x80000000, // 0005 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
/********************************************************************
** Solidified function: stop
********************************************************************/
@@ -317,6 +173,63 @@ be_local_closure(Animate_core_stop, /* name */
/*******************************************************************/
+/********************************************************************
+** Solidified function: get_bri
+********************************************************************/
+be_local_closure(Animate_core_get_bri, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(bri),
+ }),
+ be_str_weak(get_bri),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x80040400, // 0001 RET 1 R2
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_bri
+********************************************************************/
+be_local_closure(Animate_core_set_bri, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(bri),
+ /* K1 */ be_nested_str_weak(set_strip_bri),
+ }),
+ be_str_weak(set_bri),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 4]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x8C080101, // 0001 GETMET R2 R0 K1
+ 0x7C080200, // 0002 CALL R2 1
+ 0x80000000, // 0003 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
/********************************************************************
** Solidified function: add_painter
********************************************************************/
@@ -356,138 +269,12 @@ be_local_closure(Animate_core_add_painter, /* name */
/*******************************************************************/
-/********************************************************************
-** Solidified function: set_bri
-********************************************************************/
-be_local_closure(Animate_core_set_bri, /* name */
- be_nested_proto(
- 2, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(bri),
- }),
- be_str_weak(set_bri),
- &be_const_str_solidified,
- ( &(const binstruction[ 2]) { /* code */
- 0x90020001, // 0000 SETMBR R0 K0 R1
- 0x80000000, // 0001 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: set_current
-********************************************************************/
-be_local_closure(Animate_core_set_current, /* name */
- be_nested_proto(
- 2, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(global),
- /* K1 */ be_nested_str_weak(_cur_anim),
- }),
- be_str_weak(set_current),
- &be_const_str_solidified,
- ( &(const binstruction[ 3]) { /* code */
- 0xB8060000, // 0000 GETNGBL R1 K0
- 0x90060200, // 0001 SETMBR R1 K1 R0
- 0x80000000, // 0002 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: remove_animator
-********************************************************************/
-be_local_closure(Animate_core_remove_animator, /* name */
- be_nested_proto(
- 8, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_nested_str_weak(animators),
- /* K1 */ be_nested_str_weak(remove),
- /* K2 */ be_nested_str_weak(find),
- /* K3 */ be_nested_str_weak(clear),
- }),
- be_str_weak(remove_animator),
- &be_const_str_solidified,
- ( &(const binstruction[13]) { /* code */
- 0x88080100, // 0000 GETMBR R2 R0 K0
- 0x4C0C0000, // 0001 LDNIL R3
- 0x200C0203, // 0002 NE R3 R1 R3
- 0x780E0005, // 0003 JMPF R3 #000A
- 0x8C0C0501, // 0004 GETMET R3 R2 K1
- 0x8C140502, // 0005 GETMET R5 R2 K2
- 0x5C1C0200, // 0006 MOVE R7 R1
- 0x7C140400, // 0007 CALL R5 2
- 0x7C0C0400, // 0008 CALL R3 2
- 0x70020001, // 0009 JMP #000C
- 0x8C0C0503, // 000A GETMET R3 R2 K3
- 0x7C0C0200, // 000B CALL R3 1
- 0x80000000, // 000C RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: set_cb
-********************************************************************/
-be_local_closure(Animate_core_set_cb, /* name */
- be_nested_proto(
- 3, /* nstack */
- 3, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(obj),
- /* K1 */ be_nested_str_weak(mth),
- }),
- be_str_weak(set_cb),
- &be_const_str_solidified,
- ( &(const binstruction[ 3]) { /* code */
- 0x90020001, // 0000 SETMBR R0 K0 R1
- 0x90020202, // 0001 SETMBR R0 K1 R2
- 0x80000000, // 0002 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
/********************************************************************
** Solidified function: fast_loop
********************************************************************/
be_local_closure(Animate_core_fast_loop, /* name */
be_nested_proto(
- 12, /* nstack */
+ 13, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
@@ -520,25 +307,25 @@ be_local_closure(Animate_core_fast_loop, /* name */
/* K21 */ be_nested_str_weak(mth),
/* K22 */ be_nested_str_weak(paste_pixels),
/* K23 */ be_nested_str_weak(pixels_buffer),
- /* K24 */ be_nested_str_weak(bri),
- /* K25 */ be_nested_str_weak(gamma),
+ /* K24 */ be_nested_str_weak(get_bri),
+ /* K25 */ be_nested_str_weak(get_gamma),
/* K26 */ be_nested_str_weak(dirty),
/* K27 */ be_nested_str_weak(show),
}),
be_str_weak(fast_loop),
&be_const_str_solidified,
- ( &(const binstruction[81]) { /* code */
+ ( &(const binstruction[84]) { /* code */
0x88040100, // 0000 GETMBR R1 R0 K0
- 0x7806004D, // 0001 JMPF R1 #0050
+ 0x78060050, // 0001 JMPF R1 #0053
0xB8060200, // 0002 GETNGBL R1 K1
0x8C040302, // 0003 GETMET R1 R1 K2
0x880C0103, // 0004 GETMBR R3 R0 K3
0x7C040400, // 0005 CALL R1 2
- 0x78060048, // 0006 JMPF R1 #0050
+ 0x7806004B, // 0006 JMPF R1 #0053
0x88040104, // 0007 GETMBR R1 R0 K4
0x8C040305, // 0008 GETMET R1 R1 K5
0x7C040200, // 0009 CALL R1 1
- 0x78060044, // 000A JMPF R1 #0050
+ 0x78060047, // 000A JMPF R1 #0053
0x88040106, // 000B GETMBR R1 R0 K6
0x8C040307, // 000C GETMET R1 R1 K7
0x880C0108, // 000D GETMBR R3 R0 K8
@@ -598,17 +385,20 @@ be_local_closure(Animate_core_fast_loop, /* name */
0x88240104, // 0043 GETMBR R9 R0 K4
0x8C241317, // 0044 GETMET R9 R9 K23
0x7C240200, // 0045 CALL R9 1
- 0x88280118, // 0046 GETMBR R10 R0 K24
- 0x882C0104, // 0047 GETMBR R11 R0 K4
- 0x882C1719, // 0048 GETMBR R11 R11 K25
- 0x7C1C0800, // 0049 CALL R7 4
- 0x881C0104, // 004A GETMBR R7 R0 K4
- 0x8C1C0F1A, // 004B GETMET R7 R7 K26
- 0x7C1C0200, // 004C CALL R7 1
+ 0x88280104, // 0046 GETMBR R10 R0 K4
+ 0x8C281518, // 0047 GETMET R10 R10 K24
+ 0x7C280200, // 0048 CALL R10 1
+ 0x882C0104, // 0049 GETMBR R11 R0 K4
+ 0x8C2C1719, // 004A GETMET R11 R11 K25
+ 0x7C2C0200, // 004B CALL R11 1
+ 0x7C1C0800, // 004C CALL R7 4
0x881C0104, // 004D GETMBR R7 R0 K4
- 0x8C1C0F1B, // 004E GETMET R7 R7 K27
+ 0x8C1C0F1A, // 004E GETMET R7 R7 K26
0x7C1C0200, // 004F CALL R7 1
- 0x80000000, // 0050 RET 0
+ 0x881C0104, // 0050 GETMBR R7 R0 K4
+ 0x8C1C0F1B, // 0051 GETMET R7 R7 K27
+ 0x7C1C0200, // 0052 CALL R7 1
+ 0x80000000, // 0053 RET 0
})
)
);
@@ -616,11 +406,11 @@ be_local_closure(Animate_core_fast_loop, /* name */
/********************************************************************
-** Solidified function: set_back_color
+** Solidified function: remove_animator
********************************************************************/
-be_local_closure(Animate_core_set_back_color, /* name */
+be_local_closure(Animate_core_remove_animator, /* name */
be_nested_proto(
- 2, /* nstack */
+ 8, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
@@ -628,14 +418,81 @@ be_local_closure(Animate_core_set_back_color, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(back_color),
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(animators),
+ /* K1 */ be_nested_str_weak(remove),
+ /* K2 */ be_nested_str_weak(find),
+ /* K3 */ be_nested_str_weak(clear),
}),
- be_str_weak(set_back_color),
+ be_str_weak(remove_animator),
&be_const_str_solidified,
- ( &(const binstruction[ 2]) { /* code */
- 0x90020001, // 0000 SETMBR R0 K0 R1
- 0x80000000, // 0001 RET 0
+ ( &(const binstruction[13]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x4C0C0000, // 0001 LDNIL R3
+ 0x200C0203, // 0002 NE R3 R1 R3
+ 0x780E0005, // 0003 JMPF R3 #000A
+ 0x8C0C0501, // 0004 GETMET R3 R2 K1
+ 0x8C140502, // 0005 GETMET R5 R2 K2
+ 0x5C1C0200, // 0006 MOVE R7 R1
+ 0x7C140400, // 0007 CALL R5 2
+ 0x7C0C0400, // 0008 CALL R3 2
+ 0x70020001, // 0009 JMP #000C
+ 0x8C0C0503, // 000A GETMET R3 R2 K3
+ 0x7C0C0200, // 000B CALL R3 1
+ 0x80000000, // 000C RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: animate
+********************************************************************/
+be_local_closure(Animate_core_animate, /* name */
+ be_nested_proto(
+ 1, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 0, /* has constants */
+ NULL, /* no const */
+ be_str_weak(animate),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 1]) { /* code */
+ 0x80000000, // 0000 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_current
+********************************************************************/
+be_local_closure(Animate_core_set_current, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(global),
+ /* K1 */ be_nested_str_weak(_cur_anim),
+ }),
+ be_str_weak(set_current),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 3]) { /* code */
+ 0xB8060000, // 0000 GETNGBL R1 K0
+ 0x90060200, // 0001 SETMBR R1 K1 R0
+ 0x80000000, // 0002 RET 0
})
)
);
@@ -679,25 +536,26 @@ be_local_closure(Animate_core_init, /* name */
),
}),
1, /* has constants */
- ( &(const bvalue[14]) { /* constants */
+ ( &(const bvalue[15]) { /* constants */
/* K0 */ be_nested_str_weak(animate),
/* K1 */ be_nested_str_weak(strip),
/* K2 */ be_nested_str_weak(bri),
- /* K3 */ be_nested_str_weak(running),
- /* K4 */ be_nested_str_weak(pixel_count),
- /* K5 */ be_nested_str_weak(animators),
- /* K6 */ be_nested_str_weak(painters),
- /* K7 */ be_nested_str_weak(clear),
- /* K8 */ be_nested_str_weak(frame),
- /* K9 */ be_nested_str_weak(layer),
- /* K10 */ be_nested_str_weak(fast_loop_cb),
- /* K11 */ be_nested_str_weak(back_color),
- /* K12 */ be_const_int(0),
- /* K13 */ be_nested_str_weak(set_current),
+ /* K3 */ be_nested_str_weak(set_strip_bri),
+ /* K4 */ be_nested_str_weak(running),
+ /* K5 */ be_nested_str_weak(pixel_count),
+ /* K6 */ be_nested_str_weak(animators),
+ /* K7 */ be_nested_str_weak(painters),
+ /* K8 */ be_nested_str_weak(clear),
+ /* K9 */ be_nested_str_weak(frame),
+ /* K10 */ be_nested_str_weak(layer),
+ /* K11 */ be_nested_str_weak(fast_loop_cb),
+ /* K12 */ be_nested_str_weak(back_color),
+ /* K13 */ be_const_int(0),
+ /* K14 */ be_nested_str_weak(set_current),
}),
be_str_weak(init),
&be_const_str_solidified,
- ( &(const binstruction[35]) { /* code */
+ ( &(const binstruction[37]) { /* code */
0xA40E0000, // 0000 IMPORT R3 K0
0x90020201, // 0001 SETMBR R0 K1 R1
0x4C100000, // 0002 LDNIL R4
@@ -705,34 +563,36 @@ be_local_closure(Animate_core_init, /* name */
0x78120000, // 0004 JMPF R4 #0006
0x540A0031, // 0005 LDINT R2 50
0x90020402, // 0006 SETMBR R0 K2 R2
- 0x50100000, // 0007 LDBOOL R4 0 0
- 0x90020604, // 0008 SETMBR R0 K3 R4
- 0x8C100304, // 0009 GETMET R4 R1 K4
- 0x7C100200, // 000A CALL R4 1
- 0x90020804, // 000B SETMBR R0 K4 R4
- 0x60100012, // 000C GETGBL R4 G18
- 0x7C100000, // 000D CALL R4 0
- 0x90020A04, // 000E SETMBR R0 K5 R4
- 0x60100012, // 000F GETGBL R4 G18
- 0x7C100000, // 0010 CALL R4 0
- 0x90020C04, // 0011 SETMBR R0 K6 R4
- 0x8C100107, // 0012 GETMET R4 R0 K7
- 0x7C100200, // 0013 CALL R4 1
- 0x8C100708, // 0014 GETMET R4 R3 K8
- 0x88180104, // 0015 GETMBR R6 R0 K4
- 0x7C100400, // 0016 CALL R4 2
- 0x90021004, // 0017 SETMBR R0 K8 R4
- 0x8C100708, // 0018 GETMET R4 R3 K8
- 0x88180104, // 0019 GETMBR R6 R0 K4
- 0x7C100400, // 001A CALL R4 2
- 0x90021204, // 001B SETMBR R0 K9 R4
- 0x84100000, // 001C CLOSURE R4 P0
+ 0x8C100103, // 0007 GETMET R4 R0 K3
+ 0x7C100200, // 0008 CALL R4 1
+ 0x50100000, // 0009 LDBOOL R4 0 0
+ 0x90020804, // 000A SETMBR R0 K4 R4
+ 0x8C100305, // 000B GETMET R4 R1 K5
+ 0x7C100200, // 000C CALL R4 1
+ 0x90020A04, // 000D SETMBR R0 K5 R4
+ 0x60100012, // 000E GETGBL R4 G18
+ 0x7C100000, // 000F CALL R4 0
+ 0x90020C04, // 0010 SETMBR R0 K6 R4
+ 0x60100012, // 0011 GETGBL R4 G18
+ 0x7C100000, // 0012 CALL R4 0
+ 0x90020E04, // 0013 SETMBR R0 K7 R4
+ 0x8C100108, // 0014 GETMET R4 R0 K8
+ 0x7C100200, // 0015 CALL R4 1
+ 0x8C100709, // 0016 GETMET R4 R3 K9
+ 0x88180105, // 0017 GETMBR R6 R0 K5
+ 0x7C100400, // 0018 CALL R4 2
+ 0x90021204, // 0019 SETMBR R0 K9 R4
+ 0x8C100709, // 001A GETMET R4 R3 K9
+ 0x88180105, // 001B GETMBR R6 R0 K5
+ 0x7C100400, // 001C CALL R4 2
0x90021404, // 001D SETMBR R0 K10 R4
- 0x9002170C, // 001E SETMBR R0 K11 K12
- 0x8C10010D, // 001F GETMET R4 R0 K13
- 0x7C100200, // 0020 CALL R4 1
- 0xA0000000, // 0021 CLOSE R0
- 0x80000000, // 0022 RET 0
+ 0x84100000, // 001E CLOSURE R4 P0
+ 0x90021604, // 001F SETMBR R0 K11 R4
+ 0x9002190D, // 0020 SETMBR R0 K12 K13
+ 0x8C10010E, // 0021 GETMET R4 R0 K14
+ 0x7C100200, // 0022 CALL R4 1
+ 0xA0000000, // 0023 CLOSE R0
+ 0x80000000, // 0024 RET 0
})
)
);
@@ -740,11 +600,40 @@ be_local_closure(Animate_core_init, /* name */
/********************************************************************
-** Solidified function: get_bri
+** Solidified function: set_cb
********************************************************************/
-be_local_closure(Animate_core_get_bri, /* name */
+be_local_closure(Animate_core_set_cb, /* name */
be_nested_proto(
3, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(obj),
+ /* K1 */ be_nested_str_weak(mth),
+ }),
+ be_str_weak(set_cb),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 3]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x90020202, // 0001 SETMBR R0 K1 R2
+ 0x80000000, // 0002 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_back_color
+********************************************************************/
+be_local_closure(Animate_core_set_back_color, /* name */
+ be_nested_proto(
+ 2, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
@@ -753,13 +642,175 @@ be_local_closure(Animate_core_get_bri, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(bri),
+ /* K0 */ be_nested_str_weak(back_color),
}),
- be_str_weak(get_bri),
+ be_str_weak(set_back_color),
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: add_background_animator
+********************************************************************/
+be_local_closure(Animate_core_add_background_animator, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(set_cb),
+ /* K1 */ be_nested_str_weak(set_back_color),
+ /* K2 */ be_nested_str_weak(add_animator),
+ }),
+ be_str_weak(add_background_animator),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 8]) { /* code */
+ 0x8C080300, // 0000 GETMET R2 R1 K0
+ 0x5C100000, // 0001 MOVE R4 R0
+ 0x88140101, // 0002 GETMBR R5 R0 K1
+ 0x7C080600, // 0003 CALL R2 3
+ 0x8C080102, // 0004 GETMET R2 R0 K2
+ 0x5C100200, // 0005 MOVE R4 R1
+ 0x7C080400, // 0006 CALL R2 2
+ 0x80000000, // 0007 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: add_animator
+********************************************************************/
+be_local_closure(Animate_core_add_animator, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(animators),
+ /* K1 */ be_nested_str_weak(find),
+ /* K2 */ be_nested_str_weak(push),
+ }),
+ be_str_weak(add_animator),
+ &be_const_str_solidified,
+ ( &(const binstruction[12]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
- 0x80040400, // 0001 RET 1 R2
+ 0x8C080501, // 0001 GETMET R2 R2 K1
+ 0x5C100200, // 0002 MOVE R4 R1
+ 0x7C080400, // 0003 CALL R2 2
+ 0x4C0C0000, // 0004 LDNIL R3
+ 0x1C080403, // 0005 EQ R2 R2 R3
+ 0x780A0003, // 0006 JMPF R2 #000B
+ 0x88080100, // 0007 GETMBR R2 R0 K0
+ 0x8C080502, // 0008 GETMET R2 R2 K2
+ 0x5C100200, // 0009 MOVE R4 R1
+ 0x7C080400, // 000A CALL R2 2
+ 0x80000000, // 000B RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: remove
+********************************************************************/
+be_local_closure(Animate_core_remove, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(clear),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(remove_fast_loop),
+ /* K3 */ be_nested_str_weak(fast_loop_cb),
+ }),
+ be_str_weak(remove),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 7]) { /* code */
+ 0x8C040100, // 0000 GETMET R1 R0 K0
+ 0x7C040200, // 0001 CALL R1 1
+ 0xB8060200, // 0002 GETNGBL R1 K1
+ 0x8C040302, // 0003 GETMET R1 R1 K2
+ 0x880C0103, // 0004 GETMBR R3 R0 K3
+ 0x7C040400, // 0005 CALL R1 2
+ 0x80000000, // 0006 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: start
+********************************************************************/
+be_local_closure(Animate_core_start, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 9]) { /* constants */
+ /* K0 */ be_nested_str_weak(running),
+ /* K1 */ be_nested_str_weak(animators),
+ /* K2 */ be_const_int(0),
+ /* K3 */ be_nested_str_weak(start),
+ /* K4 */ be_const_int(1),
+ /* K5 */ be_nested_str_weak(fast_loop_next),
+ /* K6 */ be_nested_str_weak(tasmota),
+ /* K7 */ be_nested_str_weak(add_fast_loop),
+ /* K8 */ be_nested_str_weak(fast_loop_cb),
+ }),
+ be_str_weak(start),
+ &be_const_str_solidified,
+ ( &(const binstruction[20]) { /* code */
+ 0x50040200, // 0000 LDBOOL R1 1 0
+ 0x90020001, // 0001 SETMBR R0 K0 R1
+ 0x88040101, // 0002 GETMBR R1 R0 K1
+ 0x58080002, // 0003 LDCONST R2 K2
+ 0x600C000C, // 0004 GETGBL R3 G12
+ 0x5C100200, // 0005 MOVE R4 R1
+ 0x7C0C0200, // 0006 CALL R3 1
+ 0x140C0403, // 0007 LT R3 R2 R3
+ 0x780E0004, // 0008 JMPF R3 #000E
+ 0x940C0202, // 0009 GETIDX R3 R1 R2
+ 0x8C0C0703, // 000A GETMET R3 R3 K3
+ 0x7C0C0200, // 000B CALL R3 1
+ 0x00080504, // 000C ADD R2 R2 K4
+ 0x7001FFF5, // 000D JMP #0004
+ 0x90020B02, // 000E SETMBR R0 K5 K2
+ 0xB80E0C00, // 000F GETNGBL R3 K6
+ 0x8C0C0707, // 0010 GETMET R3 R3 K7
+ 0x88140108, // 0011 GETMBR R5 R0 K8
+ 0x7C0C0400, // 0012 CALL R3 2
+ 0x80000000, // 0013 RET 0
})
)
);
@@ -772,39 +823,40 @@ be_local_closure(Animate_core_get_bri, /* name */
be_local_class(Animate_core,
13,
NULL,
- be_nested_map(31,
+ be_nested_map(32,
( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(get_bri, -1), be_const_closure(Animate_core_get_bri_closure) },
- { be_const_key_weak(remove, -1), be_const_closure(Animate_core_remove_closure) },
- { be_const_key_weak(painters, -1), be_const_var(5) },
- { be_const_key_weak(fast_loop_cb, -1), be_const_var(6) },
- { be_const_key_weak(start, 6), be_const_closure(Animate_core_start_closure) },
- { be_const_key_weak(add_background_animator, -1), be_const_closure(Animate_core_add_background_animator_closure) },
- { be_const_key_weak(set_back_color, 30), be_const_closure(Animate_core_set_back_color_closure) },
- { be_const_key_weak(add_animator, -1), be_const_closure(Animate_core_add_animator_closure) },
- { be_const_key_weak(strip, 3), be_const_var(0) },
- { be_const_key_weak(animate, 14), be_const_closure(Animate_core_animate_closure) },
- { be_const_key_weak(clear, 0), be_const_closure(Animate_core_clear_closure) },
- { be_const_key_weak(stop, -1), be_const_closure(Animate_core_stop_closure) },
- { be_const_key_weak(remove_painter, 28), be_const_closure(Animate_core_remove_painter_closure) },
- { be_const_key_weak(fast_loop_next, 21), be_const_var(7) },
+ { be_const_key_weak(set_strip_bri, -1), be_const_closure(Animate_core_set_strip_bri_closure) },
{ be_const_key_weak(animators, -1), be_const_var(4) },
- { be_const_key_weak(add_painter, -1), be_const_closure(Animate_core_add_painter_closure) },
- { be_const_key_weak(set_bri, -1), be_const_closure(Animate_core_set_bri_closure) },
- { be_const_key_weak(frame, -1), be_const_var(10) },
- { be_const_key_weak(mth, 26), be_const_var(9) },
- { be_const_key_weak(back_color, -1), be_const_var(12) },
- { be_const_key_weak(set_current, -1), be_const_closure(Animate_core_set_current_closure) },
- { be_const_key_weak(bri, -1), be_const_var(2) },
- { be_const_key_weak(fast_loop, -1), be_const_closure(Animate_core_fast_loop_closure) },
- { be_const_key_weak(layer, -1), be_const_var(11) },
- { be_const_key_weak(set_cb, 23), be_const_closure(Animate_core_set_cb_closure) },
- { be_const_key_weak(remove_animator, 22), be_const_closure(Animate_core_remove_animator_closure) },
+ { be_const_key_weak(clear, 0), be_const_closure(Animate_core_clear_closure) },
+ { be_const_key_weak(remove, -1), be_const_closure(Animate_core_remove_closure) },
+ { be_const_key_weak(mth, -1), be_const_var(9) },
+ { be_const_key_weak(stop, 1), be_const_closure(Animate_core_stop_closure) },
+ { be_const_key_weak(fast_loop_cb, 30), be_const_var(6) },
+ { be_const_key_weak(get_bri, -1), be_const_closure(Animate_core_get_bri_closure) },
+ { be_const_key_weak(add_animator, -1), be_const_closure(Animate_core_add_animator_closure) },
+ { be_const_key_weak(add_background_animator, -1), be_const_closure(Animate_core_add_background_animator_closure) },
+ { be_const_key_weak(fast_loop_next, -1), be_const_var(7) },
+ { be_const_key_weak(remove_animator, -1), be_const_closure(Animate_core_remove_animator_closure) },
+ { be_const_key_weak(add_painter, 28), be_const_closure(Animate_core_add_painter_closure) },
{ be_const_key_weak(FAST_LOOP_MIN, -1), be_const_int(20) },
- { be_const_key_weak(pixel_count, -1), be_const_var(1) },
- { be_const_key_weak(obj, -1), be_const_var(8) },
+ { be_const_key_weak(fast_loop, -1), be_const_closure(Animate_core_fast_loop_closure) },
+ { be_const_key_weak(set_back_color, 11), be_const_closure(Animate_core_set_back_color_closure) },
+ { be_const_key_weak(animate, 8), be_const_closure(Animate_core_animate_closure) },
+ { be_const_key_weak(strip, 24), be_const_var(0) },
+ { be_const_key_weak(layer, -1), be_const_var(11) },
{ be_const_key_weak(init, -1), be_const_closure(Animate_core_init_closure) },
+ { be_const_key_weak(bri, -1), be_const_var(2) },
+ { be_const_key_weak(set_cb, 13), be_const_closure(Animate_core_set_cb_closure) },
+ { be_const_key_weak(back_color, 18), be_const_var(12) },
+ { be_const_key_weak(pixel_count, 15), be_const_var(1) },
+ { be_const_key_weak(set_current, -1), be_const_closure(Animate_core_set_current_closure) },
+ { be_const_key_weak(painters, -1), be_const_var(5) },
+ { be_const_key_weak(obj, 10), be_const_var(8) },
+ { be_const_key_weak(set_bri, 9), be_const_closure(Animate_core_set_bri_closure) },
{ be_const_key_weak(running, -1), be_const_var(3) },
+ { be_const_key_weak(remove_painter, 3), be_const_closure(Animate_core_remove_painter_closure) },
+ { be_const_key_weak(frame, -1), be_const_var(10) },
+ { be_const_key_weak(start, -1), be_const_closure(Animate_core_start_closure) },
})),
be_str_weak(Animate_core)
);
diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_1_animate_effects.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_2_animate_effects.h
similarity index 99%
rename from lib/libesp32/berry_tasmota/src/solidify/solidified_animate_1_animate_effects.h
rename to lib/libesp32/berry_tasmota/src/solidify/solidified_animate_2_animate_effects.h
index 21bcdeb19..360e3d2d8 100644
--- a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_1_animate_effects.h
+++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_2_animate_effects.h
@@ -1,4 +1,4 @@
-/* Solidification of animate_1_animate_effects.h */
+/* Solidification of animate_2_animate_effects.h */
/********************************************************************\
* Generated code, don't edit *
\********************************************************************/
diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_9_module.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_9_module.h
index 7f12ffcca..e64059188 100644
--- a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_9_module.h
+++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_9_module.h
@@ -1384,32 +1384,31 @@ be_local_closure(Animate_oscillator_animate, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[21]) { /* constants */
+ ( &(const bvalue[20]) { /* constants */
/* K0 */ be_nested_str_weak(duration_ms),
/* K1 */ be_nested_str_weak(tasmota),
/* K2 */ be_nested_str_weak(millis),
/* K3 */ be_nested_str_weak(origin),
/* K4 */ be_const_int(0),
- /* K5 */ be_nested_str_weak(originally),
- /* K6 */ be_nested_str_weak(scale_uint),
- /* K7 */ be_nested_str_weak(duty_cycle),
- /* K8 */ be_nested_str_weak(beat),
- /* K9 */ be_nested_str_weak(a),
- /* K10 */ be_nested_str_weak(b),
- /* K11 */ be_nested_str_weak(value),
- /* K12 */ be_nested_str_weak(phase),
- /* K13 */ be_nested_str_weak(form),
- /* K14 */ be_const_int(1),
- /* K15 */ be_nested_str_weak(scale_int),
- /* K16 */ be_const_int(2),
- /* K17 */ be_const_int(3),
- /* K18 */ be_nested_str_weak(sine_int),
- /* K19 */ be_nested_str_weak(obj),
- /* K20 */ be_nested_str_weak(mth),
+ /* K5 */ be_nested_str_weak(scale_uint),
+ /* K6 */ be_nested_str_weak(duty_cycle),
+ /* K7 */ be_nested_str_weak(beat),
+ /* K8 */ be_nested_str_weak(a),
+ /* K9 */ be_nested_str_weak(b),
+ /* K10 */ be_nested_str_weak(value),
+ /* K11 */ be_nested_str_weak(phase),
+ /* K12 */ be_nested_str_weak(form),
+ /* K13 */ be_const_int(1),
+ /* K14 */ be_nested_str_weak(scale_int),
+ /* K15 */ be_const_int(2),
+ /* K16 */ be_const_int(3),
+ /* K17 */ be_nested_str_weak(sine_int),
+ /* K18 */ be_nested_str_weak(obj),
+ /* K19 */ be_nested_str_weak(mth),
}),
be_str_weak(animate),
&be_const_str_solidified,
- ( &(const binstruction[150]) { /* code */
+ ( &(const binstruction[141]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x4C0C0000, // 0001 LDNIL R3
0x1C080403, // 0002 EQ R2 R2 R3
@@ -1427,12 +1426,12 @@ be_local_closure(Animate_oscillator_animate, /* name */
0x140C0504, // 000E LT R3 R2 K4
0x780E0001, // 000F JMPF R3 #0012
0x58080004, // 0010 LDCONST R2 K4
- 0x88040105, // 0011 GETMBR R1 R0 K5
+ 0x88040103, // 0011 GETMBR R1 R0 K3
0x880C0100, // 0012 GETMBR R3 R0 K0
0x4C100000, // 0013 LDNIL R4
0xB8160200, // 0014 GETNGBL R5 K1
- 0x8C140B06, // 0015 GETMET R5 R5 K6
- 0x881C0107, // 0016 GETMBR R7 R0 K7
+ 0x8C140B05, // 0015 GETMET R5 R5 K5
+ 0x881C0106, // 0016 GETMBR R7 R0 K6
0x58200004, // 0017 LDCONST R8 K4
0x54260063, // 0018 LDINT R9 100
0x58280004, // 0019 LDCONST R10 K4
@@ -1447,18 +1446,18 @@ be_local_closure(Animate_oscillator_animate, /* name */
0x00140A06, // 0022 ADD R5 R5 R6
0x90020605, // 0023 SETMBR R0 K3 R5
0x10080403, // 0024 MOD R2 R2 R3
- 0x8C140108, // 0025 GETMET R5 R0 K8
+ 0x8C140107, // 0025 GETMET R5 R0 K7
0x7C140200, // 0026 CALL R5 1
- 0x88140109, // 0027 GETMBR R5 R0 K9
- 0x8818010A, // 0028 GETMBR R6 R0 K10
- 0x881C010B, // 0029 GETMBR R7 R0 K11
+ 0x88140108, // 0027 GETMBR R5 R0 K8
+ 0x88180109, // 0028 GETMBR R6 R0 K9
+ 0x881C010A, // 0029 GETMBR R7 R0 K10
0x5C200400, // 002A MOVE R8 R2
- 0x8824010C, // 002B GETMBR R9 R0 K12
+ 0x8824010B, // 002B GETMBR R9 R0 K11
0x24241304, // 002C GT R9 R9 K4
0x7826000B, // 002D JMPF R9 #003A
0xB8260200, // 002E GETNGBL R9 K1
- 0x8C241306, // 002F GETMET R9 R9 K6
- 0x882C010C, // 0030 GETMBR R11 R0 K12
+ 0x8C241305, // 002F GETMET R9 R9 K5
+ 0x882C010B, // 0030 GETMBR R11 R0 K11
0x58300004, // 0031 LDCONST R12 K4
0x54360063, // 0032 LDINT R13 100
0x58380004, // 0033 LDCONST R14 K4
@@ -1468,98 +1467,89 @@ be_local_closure(Animate_oscillator_animate, /* name */
0x24241003, // 0037 GT R9 R8 R3
0x78260000, // 0038 JMPF R9 #003A
0x04201003, // 0039 SUB R8 R8 R3
- 0x8824010D, // 003A GETMBR R9 R0 K13
- 0x1C24130E, // 003B EQ R9 R9 K14
+ 0x8824010C, // 003A GETMBR R9 R0 K12
+ 0x1C24130D, // 003B EQ R9 R9 K13
0x78260009, // 003C JMPF R9 #0047
0xB8260200, // 003D GETNGBL R9 K1
- 0x8C24130F, // 003E GETMET R9 R9 K15
+ 0x8C24130E, // 003E GETMET R9 R9 K14
0x5C2C1000, // 003F MOVE R11 R8
0x58300004, // 0040 LDCONST R12 K4
- 0x0434070E, // 0041 SUB R13 R3 K14
+ 0x0434070D, // 0041 SUB R13 R3 K13
0x5C380A00, // 0042 MOVE R14 R5
0x5C3C0C00, // 0043 MOVE R15 R6
0x7C240C00, // 0044 CALL R9 6
0x5C1C1200, // 0045 MOVE R7 R9
- 0x70020044, // 0046 JMP #008C
- 0x8824010D, // 0047 GETMBR R9 R0 K13
- 0x1C241310, // 0048 EQ R9 R9 K16
+ 0x7002003B, // 0046 JMP #0083
+ 0x8824010C, // 0047 GETMBR R9 R0 K12
+ 0x1C24130F, // 0048 EQ R9 R9 K15
0x78260015, // 0049 JMPF R9 #0060
0x14241004, // 004A LT R9 R8 R4
0x78260009, // 004B JMPF R9 #0056
0xB8260200, // 004C GETNGBL R9 K1
- 0x8C24130F, // 004D GETMET R9 R9 K15
+ 0x8C24130E, // 004D GETMET R9 R9 K14
0x5C2C1000, // 004E MOVE R11 R8
0x58300004, // 004F LDCONST R12 K4
- 0x0434090E, // 0050 SUB R13 R4 K14
+ 0x0434090D, // 0050 SUB R13 R4 K13
0x5C380A00, // 0051 MOVE R14 R5
0x5C3C0C00, // 0052 MOVE R15 R6
0x7C240C00, // 0053 CALL R9 6
0x5C1C1200, // 0054 MOVE R7 R9
0x70020008, // 0055 JMP #005F
0xB8260200, // 0056 GETNGBL R9 K1
- 0x8C24130F, // 0057 GETMET R9 R9 K15
+ 0x8C24130E, // 0057 GETMET R9 R9 K14
0x5C2C1000, // 0058 MOVE R11 R8
0x5C300800, // 0059 MOVE R12 R4
- 0x0434070E, // 005A SUB R13 R3 K14
+ 0x0434070D, // 005A SUB R13 R3 K13
0x5C380C00, // 005B MOVE R14 R6
0x5C3C0A00, // 005C MOVE R15 R5
0x7C240C00, // 005D CALL R9 6
0x5C1C1200, // 005E MOVE R7 R9
- 0x7002002B, // 005F JMP #008C
- 0x8824010D, // 0060 GETMBR R9 R0 K13
- 0x1C241311, // 0061 EQ R9 R9 K17
+ 0x70020022, // 005F JMP #0083
+ 0x8824010C, // 0060 GETMBR R9 R0 K12
+ 0x1C241310, // 0061 EQ R9 R9 K16
0x78260005, // 0062 JMPF R9 #0069
0x14241004, // 0063 LT R9 R8 R4
0x78260001, // 0064 JMPF R9 #0067
0x5C1C0A00, // 0065 MOVE R7 R5
0x70020000, // 0066 JMP #0068
0x5C1C0C00, // 0067 MOVE R7 R6
- 0x70020022, // 0068 JMP #008C
- 0x8824010D, // 0069 GETMBR R9 R0 K13
+ 0x70020019, // 0068 JMP #0083
+ 0x8824010C, // 0069 GETMBR R9 R0 K12
0x542A0003, // 006A LDINT R10 4
0x1C24120A, // 006B EQ R9 R9 R10
- 0x74260003, // 006C JMPT R9 #0071
- 0x8824010D, // 006D GETMBR R9 R0 K13
- 0x542A0004, // 006E LDINT R10 5
- 0x1C24120A, // 006F EQ R9 R9 R10
- 0x7826001A, // 0070 JMPF R9 #008C
- 0xB8260200, // 0071 GETNGBL R9 K1
- 0x8C24130F, // 0072 GETMET R9 R9 K15
- 0x5C2C1000, // 0073 MOVE R11 R8
- 0x58300004, // 0074 LDCONST R12 K4
- 0x0434070E, // 0075 SUB R13 R3 K14
- 0x58380004, // 0076 LDCONST R14 K4
- 0x543E7FFE, // 0077 LDINT R15 32767
- 0x7C240C00, // 0078 CALL R9 6
- 0x8828010D, // 0079 GETMBR R10 R0 K13
- 0x542E0003, // 007A LDINT R11 4
- 0x1C28140B, // 007B EQ R10 R10 R11
- 0x782A0001, // 007C JMPF R10 #007F
- 0x542A1FFF, // 007D LDINT R10 8192
- 0x0424120A, // 007E SUB R9 R9 R10
- 0xB82A0200, // 007F GETNGBL R10 K1
- 0x8C281512, // 0080 GETMET R10 R10 K18
- 0x5C301200, // 0081 MOVE R12 R9
- 0x7C280400, // 0082 CALL R10 2
- 0xB82E0200, // 0083 GETNGBL R11 K1
- 0x8C2C170F, // 0084 GETMET R11 R11 K15
- 0x5C341400, // 0085 MOVE R13 R10
- 0x5439EFFF, // 0086 LDINT R14 -4096
- 0x543E0FFF, // 0087 LDINT R15 4096
- 0x5C400A00, // 0088 MOVE R16 R5
- 0x5C440C00, // 0089 MOVE R17 R6
- 0x7C2C0C00, // 008A CALL R11 6
- 0x5C1C1600, // 008B MOVE R7 R11
- 0x90021607, // 008C SETMBR R0 K11 R7
- 0x88240113, // 008D GETMBR R9 R0 K19
- 0x88280114, // 008E GETMBR R10 R0 K20
- 0x78260004, // 008F JMPF R9 #0095
- 0x782A0003, // 0090 JMPF R10 #0095
- 0x5C2C1400, // 0091 MOVE R11 R10
- 0x5C301200, // 0092 MOVE R12 R9
- 0x5C340E00, // 0093 MOVE R13 R7
- 0x7C2C0400, // 0094 CALL R11 2
- 0x80040E00, // 0095 RET 1 R7
+ 0x78260015, // 006C JMPF R9 #0083
+ 0xB8260200, // 006D GETNGBL R9 K1
+ 0x8C24130E, // 006E GETMET R9 R9 K14
+ 0x5C2C1000, // 006F MOVE R11 R8
+ 0x58300004, // 0070 LDCONST R12 K4
+ 0x0434070D, // 0071 SUB R13 R3 K13
+ 0x58380004, // 0072 LDCONST R14 K4
+ 0x543E7FFE, // 0073 LDINT R15 32767
+ 0x7C240C00, // 0074 CALL R9 6
+ 0xB82A0200, // 0075 GETNGBL R10 K1
+ 0x8C281511, // 0076 GETMET R10 R10 K17
+ 0x54321FFF, // 0077 LDINT R12 8192
+ 0x0430120C, // 0078 SUB R12 R9 R12
+ 0x7C280400, // 0079 CALL R10 2
+ 0xB82E0200, // 007A GETNGBL R11 K1
+ 0x8C2C170E, // 007B GETMET R11 R11 K14
+ 0x5C341400, // 007C MOVE R13 R10
+ 0x5439EFFF, // 007D LDINT R14 -4096
+ 0x543E0FFF, // 007E LDINT R15 4096
+ 0x5C400A00, // 007F MOVE R16 R5
+ 0x5C440C00, // 0080 MOVE R17 R6
+ 0x7C2C0C00, // 0081 CALL R11 6
+ 0x5C1C1600, // 0082 MOVE R7 R11
+ 0x90021407, // 0083 SETMBR R0 K10 R7
+ 0x88240112, // 0084 GETMBR R9 R0 K18
+ 0x88280113, // 0085 GETMBR R10 R0 K19
+ 0x78260004, // 0086 JMPF R9 #008C
+ 0x782A0003, // 0087 JMPF R10 #008C
+ 0x5C2C1400, // 0088 MOVE R11 R10
+ 0x5C301200, // 0089 MOVE R12 R9
+ 0x5C340E00, // 008A MOVE R13 R7
+ 0x7C2C0400, // 008B CALL R11 2
+ 0x80040E00, // 008C RET 1 R7
})
)
);
diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_leds.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_leds.h
index ef3af9aba..3e0ef7846 100644
--- a/lib/libesp32/berry_tasmota/src/solidify/solidified_leds.h
+++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_leds.h
@@ -6,36 +6,6 @@
extern const bclass be_class_Leds;
-/********************************************************************
-** Solidified function: show
-********************************************************************/
-be_local_closure(Leds_show, /* name */
- be_nested_proto(
- 4, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str(call_native),
- /* K1 */ be_const_int(2),
- }),
- &be_const_str_show,
- &be_const_str_solidified,
- ( &(const binstruction[ 4]) { /* code */
- 0x8C040100, // 0000 GETMET R1 R0 K0
- 0x580C0001, // 0001 LDCONST R3 K1
- 0x7C040400, // 0002 CALL R1 2
- 0x80000000, // 0003 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
extern const bclass be_class_Leds_segment;
/********************************************************************
@@ -78,28 +48,33 @@ be_local_closure(Leds_segment_clear_to, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 5]) { /* constants */
- /* K0 */ be_nested_str(strip),
- /* K1 */ be_nested_str(call_native),
- /* K2 */ be_nested_str(to_gamma),
- /* K3 */ be_nested_str(offset),
- /* K4 */ be_nested_str(leds),
+ ( &(const bvalue[ 6]) { /* constants */
+ /* K0 */ be_nested_str(bri),
+ /* K1 */ be_nested_str(strip),
+ /* K2 */ be_nested_str(call_native),
+ /* K3 */ be_nested_str(to_gamma),
+ /* K4 */ be_nested_str(offset),
+ /* K5 */ be_nested_str(leds),
}),
&be_const_str_clear_to,
&be_const_str_solidified,
- ( &(const binstruction[12]) { /* code */
- 0x880C0100, // 0000 GETMBR R3 R0 K0
- 0x8C0C0701, // 0001 GETMET R3 R3 K1
- 0x54160008, // 0002 LDINT R5 9
- 0x88180100, // 0003 GETMBR R6 R0 K0
- 0x8C180D02, // 0004 GETMET R6 R6 K2
- 0x5C200200, // 0005 MOVE R8 R1
- 0x5C240400, // 0006 MOVE R9 R2
- 0x7C180600, // 0007 CALL R6 3
- 0x881C0103, // 0008 GETMBR R7 R0 K3
- 0x88200104, // 0009 GETMBR R8 R0 K4
- 0x7C0C0A00, // 000A CALL R3 5
- 0x80000000, // 000B RET 0
+ ( &(const binstruction[16]) { /* code */
+ 0x4C0C0000, // 0000 LDNIL R3
+ 0x1C0C0403, // 0001 EQ R3 R2 R3
+ 0x780E0000, // 0002 JMPF R3 #0004
+ 0x88080100, // 0003 GETMBR R2 R0 K0
+ 0x880C0101, // 0004 GETMBR R3 R0 K1
+ 0x8C0C0702, // 0005 GETMET R3 R3 K2
+ 0x54160008, // 0006 LDINT R5 9
+ 0x88180101, // 0007 GETMBR R6 R0 K1
+ 0x8C180D03, // 0008 GETMET R6 R6 K3
+ 0x5C200200, // 0009 MOVE R8 R1
+ 0x5C240400, // 000A MOVE R9 R2
+ 0x7C180600, // 000B CALL R6 3
+ 0x881C0104, // 000C GETMBR R7 R0 K4
+ 0x88200105, // 000D GETMBR R8 R0 K5
+ 0x7C0C0A00, // 000E CALL R3 5
+ 0x80000000, // 000F RET 0
})
)
);
@@ -231,22 +206,27 @@ be_local_closure(Leds_segment_set_pixel_color, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 3]) { /* constants */
- /* K0 */ be_nested_str(strip),
- /* K1 */ be_nested_str(set_pixel_color),
- /* K2 */ be_nested_str(offset),
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str(bri),
+ /* K1 */ be_nested_str(strip),
+ /* K2 */ be_nested_str(set_pixel_color),
+ /* K3 */ be_nested_str(offset),
}),
&be_const_str_set_pixel_color,
&be_const_str_solidified,
- ( &(const binstruction[ 8]) { /* code */
- 0x88100100, // 0000 GETMBR R4 R0 K0
- 0x8C100901, // 0001 GETMET R4 R4 K1
- 0x88180102, // 0002 GETMBR R6 R0 K2
- 0x00180206, // 0003 ADD R6 R1 R6
- 0x5C1C0400, // 0004 MOVE R7 R2
- 0x5C200600, // 0005 MOVE R8 R3
- 0x7C100800, // 0006 CALL R4 4
- 0x80000000, // 0007 RET 0
+ ( &(const binstruction[12]) { /* code */
+ 0x4C100000, // 0000 LDNIL R4
+ 0x1C100604, // 0001 EQ R4 R3 R4
+ 0x78120000, // 0002 JMPF R4 #0004
+ 0x880C0100, // 0003 GETMBR R3 R0 K0
+ 0x88100101, // 0004 GETMBR R4 R0 K1
+ 0x8C100902, // 0005 GETMET R4 R4 K2
+ 0x88180103, // 0006 GETMBR R6 R0 K3
+ 0x00180206, // 0007 ADD R6 R1 R6
+ 0x5C1C0400, // 0008 MOVE R7 R2
+ 0x5C200600, // 0009 MOVE R8 R3
+ 0x7C100800, // 000A CALL R4 4
+ 0x80000000, // 000B RET 0
})
)
);
@@ -567,112 +547,34 @@ be_local_closure(Leds_create_segment, /* name */
/********************************************************************
-** Solidified function: assign_rmt
+** Solidified function: set_bri
********************************************************************/
-be_local_closure(Leds_assign_rmt, /* name */
+be_local_closure(Leds_set_bri, /* name */
be_nested_proto(
- 9, /* nstack */
- 1, /* argc */
- 4, /* varg */
+ 3, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[17]) { /* constants */
- /* K0 */ be_const_class(be_class_Leds),
- /* K1 */ be_const_int(0),
- /* K2 */ be_nested_str(value_error),
- /* K3 */ be_nested_str(invalid_X20GPIO_X20number),
- /* K4 */ be_nested_str(global),
- /* K5 */ be_nested_str(contains),
- /* K6 */ be_nested_str(_rmt),
- /* K7 */ be_nested_str(gpio),
- /* K8 */ be_nested_str(MAX_RMT),
- /* K9 */ be_const_int(1),
- /* K10 */ be_nested_str(push),
- /* K11 */ be_nested_str(stop_iteration),
- /* K12 */ be_nested_str(pin_used),
- /* K13 */ be_nested_str(WS2812),
- /* K14 */ be_nested_str(pin),
- /* K15 */ be_nested_str(internal_error),
- /* K16 */ be_nested_str(no_X20more_X20RMT_X20channel_X20available),
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_const_int(0),
+ /* K1 */ be_nested_str(bri),
}),
- &be_const_str_assign_rmt,
+ &be_const_str_set_bri,
&be_const_str_solidified,
- ( &(const binstruction[72]) { /* code */
- 0x58040000, // 0000 LDCONST R1 K0
- 0x60080009, // 0001 GETGBL R2 G9
- 0x5C0C0000, // 0002 MOVE R3 R0
- 0x7C080200, // 0003 CALL R2 1
- 0x5C000400, // 0004 MOVE R0 R2
- 0x14080101, // 0005 LT R2 R0 K1
- 0x780A0000, // 0006 JMPF R2 #0008
- 0xB0060503, // 0007 RAISE 1 K2 K3
- 0xA40A0800, // 0008 IMPORT R2 K4
- 0x4C0C0000, // 0009 LDNIL R3
- 0x8C100505, // 000A GETMET R4 R2 K5
- 0x58180006, // 000B LDCONST R6 K6
- 0x7C100400, // 000C CALL R4 2
- 0x74120021, // 000D JMPT R4 #0030
- 0x60100012, // 000E GETGBL R4 G18
- 0x7C100000, // 000F CALL R4 0
- 0x5C0C0800, // 0010 MOVE R3 R4
- 0x900A0C03, // 0011 SETMBR R2 K6 R3
- 0x60100010, // 0012 GETGBL R4 G16
- 0xB8160E00, // 0013 GETNGBL R5 K7
- 0x88140B08, // 0014 GETMBR R5 R5 K8
- 0x04140B09, // 0015 SUB R5 R5 K9
- 0x40160205, // 0016 CONNECT R5 K1 R5
- 0x7C100200, // 0017 CALL R4 1
- 0xA8020005, // 0018 EXBLK 0 #001F
- 0x5C140800, // 0019 MOVE R5 R4
- 0x7C140000, // 001A CALL R5 0
- 0x8C18070A, // 001B GETMET R6 R3 K10
- 0x5421FFFE, // 001C LDINT R8 -1
- 0x7C180400, // 001D CALL R6 2
- 0x7001FFF9, // 001E JMP #0019
- 0x5810000B, // 001F LDCONST R4 K11
- 0xAC100200, // 0020 CATCH R4 1 0
- 0xB0080000, // 0021 RAISE 2 R0 R0
- 0xB8120E00, // 0022 GETNGBL R4 K7
- 0x8C10090C, // 0023 GETMET R4 R4 K12
- 0xB81A0E00, // 0024 GETNGBL R6 K7
- 0x88180D0D, // 0025 GETMBR R6 R6 K13
- 0x581C0001, // 0026 LDCONST R7 K1
- 0x7C100600, // 0027 CALL R4 3
- 0x78120006, // 0028 JMPF R4 #0030
- 0xB8120E00, // 0029 GETNGBL R4 K7
- 0x8C10090E, // 002A GETMET R4 R4 K14
- 0xB81A0E00, // 002B GETNGBL R6 K7
- 0x88180D0D, // 002C GETMBR R6 R6 K13
- 0x581C0001, // 002D LDCONST R7 K1
- 0x7C100600, // 002E CALL R4 3
- 0x980E0204, // 002F SETIDX R3 K1 R4
- 0x880C0506, // 0030 GETMBR R3 R2 K6
- 0x58100001, // 0031 LDCONST R4 K1
- 0x5415FFFE, // 0032 LDINT R5 -1
- 0xB81A0E00, // 0033 GETNGBL R6 K7
- 0x88180D08, // 0034 GETMBR R6 R6 K8
- 0x14180806, // 0035 LT R6 R4 R6
- 0x781A000A, // 0036 JMPF R6 #0042
- 0x94180604, // 0037 GETIDX R6 R3 R4
- 0x1C1C0C00, // 0038 EQ R7 R6 R0
- 0x781E0000, // 0039 JMPF R7 #003B
- 0x80040800, // 003A RET 1 R4
- 0x141C0D01, // 003B LT R7 R6 K1
- 0x781E0002, // 003C JMPF R7 #0040
- 0x141C0B01, // 003D LT R7 R5 K1
- 0x781E0000, // 003E JMPF R7 #0040
- 0x5C140800, // 003F MOVE R5 R4
- 0x00100909, // 0040 ADD R4 R4 K9
- 0x7001FFF0, // 0041 JMP #0033
- 0x28180B01, // 0042 GE R6 R5 K1
- 0x781A0001, // 0043 JMPF R6 #0046
- 0x980C0A00, // 0044 SETIDX R3 R5 R0
- 0x80040A00, // 0045 RET 1 R5
- 0xB0061F10, // 0046 RAISE 1 K15 K16
- 0x80000000, // 0047 RET 0
+ ( &(const binstruction[ 9]) { /* code */
+ 0x14080300, // 0000 LT R2 R1 K0
+ 0x780A0000, // 0001 JMPF R2 #0003
+ 0x58040000, // 0002 LDCONST R1 K0
+ 0x540A00FE, // 0003 LDINT R2 255
+ 0x24080202, // 0004 GT R2 R1 R2
+ 0x780A0000, // 0005 JMPF R2 #0007
+ 0x540600FE, // 0006 LDINT R1 255
+ 0x90020201, // 0007 SETMBR R0 K1 R1
+ 0x80000000, // 0008 RET 0
})
)
);
@@ -680,9 +582,9 @@ be_local_closure(Leds_assign_rmt, /* name */
/********************************************************************
-** Solidified function: can_show
+** Solidified function: begin
********************************************************************/
-be_local_closure(Leds_can_show, /* name */
+be_local_closure(Leds_begin, /* name */
be_nested_proto(
4, /* nstack */
1, /* argc */
@@ -694,14 +596,203 @@ be_local_closure(Leds_can_show, /* name */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str(call_native),
- /* K1 */ be_const_int(3),
+ /* K1 */ be_const_int(1),
}),
- &be_const_str_can_show,
+ &be_const_str_begin,
&be_const_str_solidified,
( &(const binstruction[ 4]) { /* code */
0x8C040100, // 0000 GETMET R1 R0 K0
0x580C0001, // 0001 LDCONST R3 K1
0x7C040400, // 0002 CALL R1 2
+ 0x80000000, // 0003 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: clear
+********************************************************************/
+be_local_closure(Leds_clear, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str(clear_to),
+ /* K1 */ be_const_int(0),
+ /* K2 */ be_nested_str(show),
+ }),
+ &be_const_str_clear,
+ &be_const_str_solidified,
+ ( &(const binstruction[ 6]) { /* code */
+ 0x8C040100, // 0000 GETMET R1 R0 K0
+ 0x580C0001, // 0001 LDCONST R3 K1
+ 0x7C040400, // 0002 CALL R1 2
+ 0x8C040102, // 0003 GETMET R1 R0 K2
+ 0x7C040200, // 0004 CALL R1 1
+ 0x80000000, // 0005 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: init
+********************************************************************/
+be_local_closure(Leds_init, /* name */
+ be_nested_proto(
+ 11, /* nstack */
+ 5, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[10]) { /* constants */
+ /* K0 */ be_nested_str(gamma),
+ /* K1 */ be_nested_str(leds),
+ /* K2 */ be_nested_str(bri),
+ /* K3 */ be_nested_str(valuer_error),
+ /* K4 */ be_nested_str(no_X20GPIO_X20specified_X20for_X20neopixelbus),
+ /* K5 */ be_nested_str(ctor),
+ /* K6 */ be_nested_str(_p),
+ /* K7 */ be_nested_str(internal_error),
+ /* K8 */ be_nested_str(couldn_X27t_X20not_X20initialize_X20noepixelbus),
+ /* K9 */ be_nested_str(begin),
+ }),
+ &be_const_str_init,
+ &be_const_str_solidified,
+ ( &(const binstruction[26]) { /* code */
+ 0x50140200, // 0000 LDBOOL R5 1 0
+ 0x90020005, // 0001 SETMBR R0 K0 R5
+ 0x60140009, // 0002 GETGBL R5 G9
+ 0x5C180200, // 0003 MOVE R6 R1
+ 0x7C140200, // 0004 CALL R5 1
+ 0x90020205, // 0005 SETMBR R0 K1 R5
+ 0x5416007E, // 0006 LDINT R5 127
+ 0x90020405, // 0007 SETMBR R0 K2 R5
+ 0x4C140000, // 0008 LDNIL R5
+ 0x1C140405, // 0009 EQ R5 R2 R5
+ 0x78160000, // 000A JMPF R5 #000C
+ 0xB0060704, // 000B RAISE 1 K3 K4
+ 0x8C140105, // 000C GETMET R5 R0 K5
+ 0x881C0101, // 000D GETMBR R7 R0 K1
+ 0x5C200400, // 000E MOVE R8 R2
+ 0x5C240600, // 000F MOVE R9 R3
+ 0x5C280800, // 0010 MOVE R10 R4
+ 0x7C140A00, // 0011 CALL R5 5
+ 0x88140106, // 0012 GETMBR R5 R0 K6
+ 0x4C180000, // 0013 LDNIL R6
+ 0x1C140A06, // 0014 EQ R5 R5 R6
+ 0x78160000, // 0015 JMPF R5 #0017
+ 0xB0060F08, // 0016 RAISE 1 K7 K8
+ 0x8C140109, // 0017 GETMET R5 R0 K9
+ 0x7C140200, // 0018 CALL R5 1
+ 0x80000000, // 0019 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: to_gamma
+********************************************************************/
+be_local_closure(Leds_to_gamma, /* name */
+ be_nested_proto(
+ 8, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str(bri),
+ /* K1 */ be_nested_str(apply_bri_gamma),
+ /* K2 */ be_nested_str(gamma),
+ }),
+ &be_const_str_to_gamma,
+ &be_const_str_solidified,
+ ( &(const binstruction[10]) { /* code */
+ 0x4C0C0000, // 0000 LDNIL R3
+ 0x1C0C0403, // 0001 EQ R3 R2 R3
+ 0x780E0000, // 0002 JMPF R3 #0004
+ 0x88080100, // 0003 GETMBR R2 R0 K0
+ 0x8C0C0101, // 0004 GETMET R3 R0 K1
+ 0x5C140200, // 0005 MOVE R5 R1
+ 0x5C180400, // 0006 MOVE R6 R2
+ 0x881C0102, // 0007 GETMBR R7 R0 K2
+ 0x7C0C0800, // 0008 CALL R3 4
+ 0x80040600, // 0009 RET 1 R3
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: show
+********************************************************************/
+be_local_closure(Leds_show, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str(call_native),
+ /* K1 */ be_const_int(2),
+ }),
+ &be_const_str_show,
+ &be_const_str_solidified,
+ ( &(const binstruction[ 4]) { /* code */
+ 0x8C040100, // 0000 GETMET R1 R0 K0
+ 0x580C0001, // 0001 LDCONST R3 K1
+ 0x7C040400, // 0002 CALL R1 2
+ 0x80000000, // 0003 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: pixel_count
+********************************************************************/
+be_local_closure(Leds_pixel_count, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str(call_native),
+ }),
+ &be_const_str_pixel_count,
+ &be_const_str_solidified,
+ ( &(const binstruction[ 4]) { /* code */
+ 0x8C040100, // 0000 GETMET R1 R0 K0
+ 0x540E0007, // 0001 LDINT R3 8
+ 0x7C040400, // 0002 CALL R1 2
0x80040200, // 0003 RET 1 R1
})
)
@@ -709,6 +800,122 @@ be_local_closure(Leds_can_show, /* name */
/*******************************************************************/
+/********************************************************************
+** Solidified function: get_bri
+********************************************************************/
+be_local_closure(Leds_get_bri, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str(bri),
+ }),
+ &be_const_str_get_bri,
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x80040200, // 0001 RET 1 R1
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_gamma
+********************************************************************/
+be_local_closure(Leds_set_gamma, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str(gamma),
+ }),
+ &be_const_str_set_gamma,
+ &be_const_str_solidified,
+ ( &(const binstruction[ 5]) { /* code */
+ 0x60080017, // 0000 GETGBL R2 G23
+ 0x5C0C0200, // 0001 MOVE R3 R1
+ 0x7C080200, // 0002 CALL R2 1
+ 0x90020002, // 0003 SETMBR R0 K0 R2
+ 0x80000000, // 0004 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: get_pixel_color
+********************************************************************/
+be_local_closure(Leds_get_pixel_color, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str(call_native),
+ }),
+ &be_const_str_get_pixel_color,
+ &be_const_str_solidified,
+ ( &(const binstruction[ 5]) { /* code */
+ 0x8C080100, // 0000 GETMET R2 R0 K0
+ 0x5412000A, // 0001 LDINT R4 11
+ 0x5C140200, // 0002 MOVE R5 R1
+ 0x7C080600, // 0003 CALL R2 3
+ 0x80040400, // 0004 RET 1 R2
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: dirty
+********************************************************************/
+be_local_closure(Leds_dirty, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str(call_native),
+ }),
+ &be_const_str_dirty,
+ &be_const_str_solidified,
+ ( &(const binstruction[ 4]) { /* code */
+ 0x8C040100, // 0000 GETMET R1 R0 K0
+ 0x540E0004, // 0001 LDINT R3 5
+ 0x7C040400, // 0002 CALL R1 2
+ 0x80000000, // 0003 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
/********************************************************************
** Solidified function: matrix
********************************************************************/
@@ -750,11 +957,11 @@ be_local_closure(Leds_matrix, /* name */
/********************************************************************
-** Solidified function: pixel_count
+** Solidified function: pixel_offset
********************************************************************/
-be_local_closure(Leds_pixel_count, /* name */
+be_local_closure(Leds_pixel_offset, /* name */
be_nested_proto(
- 4, /* nstack */
+ 1, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
@@ -763,15 +970,12 @@ be_local_closure(Leds_pixel_count, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str(call_native),
+ /* K0 */ be_const_int(0),
}),
- &be_const_str_pixel_count,
+ &be_const_str_pixel_offset,
&be_const_str_solidified,
- ( &(const binstruction[ 4]) { /* code */
- 0x8C040100, // 0000 GETMET R1 R0 K0
- 0x540E0007, // 0001 LDINT R3 8
- 0x7C040400, // 0002 CALL R1 2
- 0x80040200, // 0003 RET 1 R1
+ ( &(const binstruction[ 1]) { /* code */
+ 0x80060000, // 0000 RET 1 K0
})
)
);
@@ -779,77 +983,38 @@ be_local_closure(Leds_pixel_count, /* name */
/********************************************************************
-** Solidified function: is_dirty
+** Solidified function: clear_to
********************************************************************/
-be_local_closure(Leds_is_dirty, /* name */
+be_local_closure(Leds_clear_to, /* name */
be_nested_proto(
- 4, /* nstack */
- 1, /* argc */
+ 10, /* nstack */
+ 3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str(call_native),
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str(bri),
+ /* K1 */ be_nested_str(call_native),
+ /* K2 */ be_nested_str(to_gamma),
}),
- &be_const_str_is_dirty,
+ &be_const_str_clear_to,
&be_const_str_solidified,
- ( &(const binstruction[ 4]) { /* code */
- 0x8C040100, // 0000 GETMET R1 R0 K0
- 0x540E0003, // 0001 LDINT R3 4
- 0x7C040400, // 0002 CALL R1 2
- 0x80040200, // 0003 RET 1 R1
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: pixels_buffer
-********************************************************************/
-be_local_closure(Leds_pixels_buffer, /* name */
- be_nested_proto(
- 8, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_nested_str(call_native),
- /* K1 */ be_nested_str(pixel_size),
- /* K2 */ be_nested_str(pixel_count),
- /* K3 */ be_nested_str(_change_buffer),
- }),
- &be_const_str_pixels_buffer,
- &be_const_str_solidified,
- ( &(const binstruction[21]) { /* code */
- 0x8C080100, // 0000 GETMET R2 R0 K0
- 0x54120005, // 0001 LDINT R4 6
- 0x7C080400, // 0002 CALL R2 2
- 0x4C0C0000, // 0003 LDNIL R3
- 0x1C0C0203, // 0004 EQ R3 R1 R3
- 0x780E0009, // 0005 JMPF R3 #0010
- 0x600C0015, // 0006 GETGBL R3 G21
- 0x5C100400, // 0007 MOVE R4 R2
- 0x8C140101, // 0008 GETMET R5 R0 K1
- 0x7C140200, // 0009 CALL R5 1
- 0x8C180102, // 000A GETMET R6 R0 K2
- 0x7C180200, // 000B CALL R6 1
- 0x08140A06, // 000C MUL R5 R5 R6
- 0x7C0C0400, // 000D CALL R3 2
- 0x80040600, // 000E RET 1 R3
- 0x70020003, // 000F JMP #0014
- 0x8C0C0303, // 0010 GETMET R3 R1 K3
- 0x5C140400, // 0011 MOVE R5 R2
- 0x7C0C0400, // 0012 CALL R3 2
- 0x80040200, // 0013 RET 1 R1
- 0x80000000, // 0014 RET 0
+ ( &(const binstruction[12]) { /* code */
+ 0x4C0C0000, // 0000 LDNIL R3
+ 0x1C0C0403, // 0001 EQ R3 R2 R3
+ 0x780E0000, // 0002 JMPF R3 #0004
+ 0x88080100, // 0003 GETMBR R2 R0 K0
+ 0x8C0C0101, // 0004 GETMET R3 R0 K1
+ 0x54160008, // 0005 LDINT R5 9
+ 0x8C180102, // 0006 GETMET R6 R0 K2
+ 0x5C200200, // 0007 MOVE R8 R1
+ 0x5C240400, // 0008 MOVE R9 R2
+ 0x7C180600, // 0009 CALL R6 3
+ 0x7C0C0600, // 000A CALL R3 3
+ 0x80000000, // 000B RET 0
})
)
);
@@ -869,22 +1034,56 @@ be_local_closure(Leds_set_pixel_color, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str(call_native),
- /* K1 */ be_nested_str(to_gamma),
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str(bri),
+ /* K1 */ be_nested_str(call_native),
+ /* K2 */ be_nested_str(to_gamma),
}),
&be_const_str_set_pixel_color,
&be_const_str_solidified,
- ( &(const binstruction[ 9]) { /* code */
- 0x8C100100, // 0000 GETMET R4 R0 K0
- 0x541A0009, // 0001 LDINT R6 10
- 0x5C1C0200, // 0002 MOVE R7 R1
- 0x8C200101, // 0003 GETMET R8 R0 K1
- 0x5C280400, // 0004 MOVE R10 R2
- 0x5C2C0600, // 0005 MOVE R11 R3
- 0x7C200600, // 0006 CALL R8 3
- 0x7C100800, // 0007 CALL R4 4
- 0x80000000, // 0008 RET 0
+ ( &(const binstruction[13]) { /* code */
+ 0x4C100000, // 0000 LDNIL R4
+ 0x1C100604, // 0001 EQ R4 R3 R4
+ 0x78120000, // 0002 JMPF R4 #0004
+ 0x880C0100, // 0003 GETMBR R3 R0 K0
+ 0x8C100101, // 0004 GETMET R4 R0 K1
+ 0x541A0009, // 0005 LDINT R6 10
+ 0x5C1C0200, // 0006 MOVE R7 R1
+ 0x8C200102, // 0007 GETMET R8 R0 K2
+ 0x5C280400, // 0008 MOVE R10 R2
+ 0x5C2C0600, // 0009 MOVE R11 R3
+ 0x7C200600, // 000A CALL R8 3
+ 0x7C100800, // 000B CALL R4 4
+ 0x80000000, // 000C RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: pixel_size
+********************************************************************/
+be_local_closure(Leds_pixel_size, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str(call_native),
+ }),
+ &be_const_str_pixel_size,
+ &be_const_str_solidified,
+ ( &(const binstruction[ 4]) { /* code */
+ 0x8C040100, // 0000 GETMET R1 R0 K0
+ 0x540E0006, // 0001 LDINT R3 7
+ 0x7C040400, // 0002 CALL R1 2
+ 0x80040200, // 0003 RET 1 R1
})
)
);
@@ -906,31 +1105,36 @@ be_local_closure(Leds_matrix_clear_to, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 6]) { /* constants */
- /* K0 */ be_nested_str(strip),
- /* K1 */ be_nested_str(call_native),
- /* K2 */ be_nested_str(to_gamma),
- /* K3 */ be_nested_str(offset),
- /* K4 */ be_nested_str(w),
- /* K5 */ be_nested_str(h),
+ ( &(const bvalue[ 7]) { /* constants */
+ /* K0 */ be_nested_str(bri),
+ /* K1 */ be_nested_str(strip),
+ /* K2 */ be_nested_str(call_native),
+ /* K3 */ be_nested_str(to_gamma),
+ /* K4 */ be_nested_str(offset),
+ /* K5 */ be_nested_str(w),
+ /* K6 */ be_nested_str(h),
}),
&be_const_str_clear_to,
&be_const_str_solidified,
- ( &(const binstruction[14]) { /* code */
- 0x880C0100, // 0000 GETMBR R3 R0 K0
- 0x8C0C0701, // 0001 GETMET R3 R3 K1
- 0x54160008, // 0002 LDINT R5 9
- 0x88180100, // 0003 GETMBR R6 R0 K0
- 0x8C180D02, // 0004 GETMET R6 R6 K2
- 0x5C200200, // 0005 MOVE R8 R1
- 0x5C240400, // 0006 MOVE R9 R2
- 0x7C180600, // 0007 CALL R6 3
- 0x881C0103, // 0008 GETMBR R7 R0 K3
- 0x88200104, // 0009 GETMBR R8 R0 K4
- 0x88240105, // 000A GETMBR R9 R0 K5
- 0x08201009, // 000B MUL R8 R8 R9
- 0x7C0C0A00, // 000C CALL R3 5
- 0x80000000, // 000D RET 0
+ ( &(const binstruction[18]) { /* code */
+ 0x4C0C0000, // 0000 LDNIL R3
+ 0x1C0C0403, // 0001 EQ R3 R2 R3
+ 0x780E0000, // 0002 JMPF R3 #0004
+ 0x88080100, // 0003 GETMBR R2 R0 K0
+ 0x880C0101, // 0004 GETMBR R3 R0 K1
+ 0x8C0C0702, // 0005 GETMET R3 R3 K2
+ 0x54160008, // 0006 LDINT R5 9
+ 0x88180101, // 0007 GETMBR R6 R0 K1
+ 0x8C180D03, // 0008 GETMET R6 R6 K3
+ 0x5C200200, // 0009 MOVE R8 R1
+ 0x5C240400, // 000A MOVE R9 R2
+ 0x7C180600, // 000B CALL R6 3
+ 0x881C0104, // 000C GETMBR R7 R0 K4
+ 0x88200105, // 000D GETMBR R8 R0 K5
+ 0x88240106, // 000E GETMBR R9 R0 K6
+ 0x08201009, // 000F MUL R8 R8 R9
+ 0x7C0C0A00, // 0010 CALL R3 5
+ 0x80000000, // 0011 RET 0
})
)
);
@@ -1081,22 +1285,27 @@ be_local_closure(Leds_matrix_set_pixel_color, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 3]) { /* constants */
- /* K0 */ be_nested_str(strip),
- /* K1 */ be_nested_str(set_pixel_color),
- /* K2 */ be_nested_str(offset),
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str(bri),
+ /* K1 */ be_nested_str(strip),
+ /* K2 */ be_nested_str(set_pixel_color),
+ /* K3 */ be_nested_str(offset),
}),
&be_const_str_set_pixel_color,
&be_const_str_solidified,
- ( &(const binstruction[ 8]) { /* code */
- 0x88100100, // 0000 GETMBR R4 R0 K0
- 0x8C100901, // 0001 GETMET R4 R4 K1
- 0x88180102, // 0002 GETMBR R6 R0 K2
- 0x00180206, // 0003 ADD R6 R1 R6
- 0x5C1C0400, // 0004 MOVE R7 R2
- 0x5C200600, // 0005 MOVE R8 R3
- 0x7C100800, // 0006 CALL R4 4
- 0x80000000, // 0007 RET 0
+ ( &(const binstruction[12]) { /* code */
+ 0x4C100000, // 0000 LDNIL R4
+ 0x1C100604, // 0001 EQ R4 R3 R4
+ 0x78120000, // 0002 JMPF R4 #0004
+ 0x880C0100, // 0003 GETMBR R3 R0 K0
+ 0x88100101, // 0004 GETMBR R4 R0 K1
+ 0x8C100902, // 0005 GETMET R4 R4 K2
+ 0x88180103, // 0006 GETMBR R6 R0 K3
+ 0x00180206, // 0007 ADD R6 R1 R6
+ 0x5C1C0400, // 0008 MOVE R7 R2
+ 0x5C200600, // 0009 MOVE R8 R3
+ 0x7C100800, // 000A CALL R4 4
+ 0x80000000, // 000B RET 0
})
)
);
@@ -1176,48 +1385,53 @@ be_local_closure(Leds_matrix_set_matrix_pixel_color, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 8]) { /* constants */
- /* K0 */ be_nested_str(alternate),
- /* K1 */ be_const_int(2),
- /* K2 */ be_nested_str(strip),
- /* K3 */ be_nested_str(set_pixel_color),
- /* K4 */ be_nested_str(w),
- /* K5 */ be_nested_str(h),
- /* K6 */ be_const_int(1),
- /* K7 */ be_nested_str(offset),
+ ( &(const bvalue[ 9]) { /* constants */
+ /* K0 */ be_nested_str(bri),
+ /* K1 */ be_nested_str(alternate),
+ /* K2 */ be_const_int(2),
+ /* K3 */ be_nested_str(strip),
+ /* K4 */ be_nested_str(set_pixel_color),
+ /* K5 */ be_nested_str(w),
+ /* K6 */ be_nested_str(h),
+ /* K7 */ be_const_int(1),
+ /* K8 */ be_nested_str(offset),
}),
&be_const_str_set_matrix_pixel_color,
&be_const_str_solidified,
- ( &(const binstruction[29]) { /* code */
- 0x88140100, // 0000 GETMBR R5 R0 K0
- 0x7816000F, // 0001 JMPF R5 #0012
- 0x10140301, // 0002 MOD R5 R1 K1
- 0x7816000D, // 0003 JMPF R5 #0012
- 0x88140102, // 0004 GETMBR R5 R0 K2
- 0x8C140B03, // 0005 GETMET R5 R5 K3
- 0x881C0104, // 0006 GETMBR R7 R0 K4
- 0x081C0207, // 0007 MUL R7 R1 R7
- 0x88200105, // 0008 GETMBR R8 R0 K5
- 0x001C0E08, // 0009 ADD R7 R7 R8
- 0x041C0E02, // 000A SUB R7 R7 R2
- 0x041C0F06, // 000B SUB R7 R7 K6
- 0x88200107, // 000C GETMBR R8 R0 K7
+ ( &(const binstruction[33]) { /* code */
+ 0x4C140000, // 0000 LDNIL R5
+ 0x1C140805, // 0001 EQ R5 R4 R5
+ 0x78160000, // 0002 JMPF R5 #0004
+ 0x88100100, // 0003 GETMBR R4 R0 K0
+ 0x88140101, // 0004 GETMBR R5 R0 K1
+ 0x7816000F, // 0005 JMPF R5 #0016
+ 0x10140302, // 0006 MOD R5 R1 K2
+ 0x7816000D, // 0007 JMPF R5 #0016
+ 0x88140103, // 0008 GETMBR R5 R0 K3
+ 0x8C140B04, // 0009 GETMET R5 R5 K4
+ 0x881C0105, // 000A GETMBR R7 R0 K5
+ 0x081C0207, // 000B MUL R7 R1 R7
+ 0x88200106, // 000C GETMBR R8 R0 K6
0x001C0E08, // 000D ADD R7 R7 R8
- 0x5C200600, // 000E MOVE R8 R3
- 0x5C240800, // 000F MOVE R9 R4
- 0x7C140800, // 0010 CALL R5 4
- 0x70020009, // 0011 JMP #001C
- 0x88140102, // 0012 GETMBR R5 R0 K2
- 0x8C140B03, // 0013 GETMET R5 R5 K3
- 0x881C0104, // 0014 GETMBR R7 R0 K4
- 0x081C0207, // 0015 MUL R7 R1 R7
- 0x001C0E02, // 0016 ADD R7 R7 R2
- 0x88200107, // 0017 GETMBR R8 R0 K7
- 0x001C0E08, // 0018 ADD R7 R7 R8
- 0x5C200600, // 0019 MOVE R8 R3
- 0x5C240800, // 001A MOVE R9 R4
- 0x7C140800, // 001B CALL R5 4
- 0x80000000, // 001C RET 0
+ 0x041C0E02, // 000E SUB R7 R7 R2
+ 0x041C0F07, // 000F SUB R7 R7 K7
+ 0x88200108, // 0010 GETMBR R8 R0 K8
+ 0x001C0E08, // 0011 ADD R7 R7 R8
+ 0x5C200600, // 0012 MOVE R8 R3
+ 0x5C240800, // 0013 MOVE R9 R4
+ 0x7C140800, // 0014 CALL R5 4
+ 0x70020009, // 0015 JMP #0020
+ 0x88140103, // 0016 GETMBR R5 R0 K3
+ 0x8C140B04, // 0017 GETMET R5 R5 K4
+ 0x881C0105, // 0018 GETMBR R7 R0 K5
+ 0x081C0207, // 0019 MUL R7 R1 R7
+ 0x001C0E02, // 001A ADD R7 R7 R2
+ 0x88200108, // 001B GETMBR R8 R0 K8
+ 0x001C0E08, // 001C ADD R7 R7 R8
+ 0x5C200600, // 001D MOVE R8 R3
+ 0x5C240800, // 001E MOVE R9 R4
+ 0x7C140800, // 001F CALL R5 4
+ 0x80000000, // 0020 RET 0
})
)
);
@@ -1635,12 +1849,68 @@ be_local_closure(Leds_create_matrix, /* name */
/********************************************************************
-** Solidified function: to_gamma
+** Solidified function: get_gamma
********************************************************************/
-be_local_closure(Leds_to_gamma, /* name */
+be_local_closure(Leds_get_gamma, /* name */
be_nested_proto(
- 8, /* nstack */
- 3, /* argc */
+ 2, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str(gamma),
+ }),
+ &be_const_str_get_gamma,
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x80040200, // 0001 RET 1 R1
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: is_dirty
+********************************************************************/
+be_local_closure(Leds_is_dirty, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str(call_native),
+ }),
+ &be_const_str_is_dirty,
+ &be_const_str_solidified,
+ ( &(const binstruction[ 4]) { /* code */
+ 0x8C040100, // 0000 GETMET R1 R0 K0
+ 0x540E0003, // 0001 LDINT R3 4
+ 0x7C040400, // 0002 CALL R1 2
+ 0x80040200, // 0003 RET 1 R1
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: can_show
+********************************************************************/
+be_local_closure(Leds_can_show, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
@@ -1648,18 +1918,129 @@ be_local_closure(Leds_to_gamma, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str(apply_bri_gamma),
- /* K1 */ be_nested_str(gamma),
+ /* K0 */ be_nested_str(call_native),
+ /* K1 */ be_const_int(3),
}),
- &be_const_str_to_gamma,
+ &be_const_str_can_show,
&be_const_str_solidified,
- ( &(const binstruction[ 6]) { /* code */
- 0x8C0C0100, // 0000 GETMET R3 R0 K0
- 0x5C140200, // 0001 MOVE R5 R1
- 0x5C180400, // 0002 MOVE R6 R2
- 0x881C0101, // 0003 GETMBR R7 R0 K1
- 0x7C0C0800, // 0004 CALL R3 4
- 0x80040600, // 0005 RET 1 R3
+ ( &(const binstruction[ 4]) { /* code */
+ 0x8C040100, // 0000 GETMET R1 R0 K0
+ 0x580C0001, // 0001 LDCONST R3 K1
+ 0x7C040400, // 0002 CALL R1 2
+ 0x80040200, // 0003 RET 1 R1
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: assign_rmt
+********************************************************************/
+be_local_closure(Leds_assign_rmt, /* name */
+ be_nested_proto(
+ 9, /* nstack */
+ 1, /* argc */
+ 4, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[17]) { /* constants */
+ /* K0 */ be_const_class(be_class_Leds),
+ /* K1 */ be_const_int(0),
+ /* K2 */ be_nested_str(value_error),
+ /* K3 */ be_nested_str(invalid_X20GPIO_X20number),
+ /* K4 */ be_nested_str(global),
+ /* K5 */ be_nested_str(contains),
+ /* K6 */ be_nested_str(_rmt),
+ /* K7 */ be_nested_str(gpio),
+ /* K8 */ be_nested_str(MAX_RMT),
+ /* K9 */ be_const_int(1),
+ /* K10 */ be_nested_str(push),
+ /* K11 */ be_nested_str(stop_iteration),
+ /* K12 */ be_nested_str(pin_used),
+ /* K13 */ be_nested_str(WS2812),
+ /* K14 */ be_nested_str(pin),
+ /* K15 */ be_nested_str(internal_error),
+ /* K16 */ be_nested_str(no_X20more_X20RMT_X20channel_X20available),
+ }),
+ &be_const_str_assign_rmt,
+ &be_const_str_solidified,
+ ( &(const binstruction[72]) { /* code */
+ 0x58040000, // 0000 LDCONST R1 K0
+ 0x60080009, // 0001 GETGBL R2 G9
+ 0x5C0C0000, // 0002 MOVE R3 R0
+ 0x7C080200, // 0003 CALL R2 1
+ 0x5C000400, // 0004 MOVE R0 R2
+ 0x14080101, // 0005 LT R2 R0 K1
+ 0x780A0000, // 0006 JMPF R2 #0008
+ 0xB0060503, // 0007 RAISE 1 K2 K3
+ 0xA40A0800, // 0008 IMPORT R2 K4
+ 0x4C0C0000, // 0009 LDNIL R3
+ 0x8C100505, // 000A GETMET R4 R2 K5
+ 0x58180006, // 000B LDCONST R6 K6
+ 0x7C100400, // 000C CALL R4 2
+ 0x74120021, // 000D JMPT R4 #0030
+ 0x60100012, // 000E GETGBL R4 G18
+ 0x7C100000, // 000F CALL R4 0
+ 0x5C0C0800, // 0010 MOVE R3 R4
+ 0x900A0C03, // 0011 SETMBR R2 K6 R3
+ 0x60100010, // 0012 GETGBL R4 G16
+ 0xB8160E00, // 0013 GETNGBL R5 K7
+ 0x88140B08, // 0014 GETMBR R5 R5 K8
+ 0x04140B09, // 0015 SUB R5 R5 K9
+ 0x40160205, // 0016 CONNECT R5 K1 R5
+ 0x7C100200, // 0017 CALL R4 1
+ 0xA8020005, // 0018 EXBLK 0 #001F
+ 0x5C140800, // 0019 MOVE R5 R4
+ 0x7C140000, // 001A CALL R5 0
+ 0x8C18070A, // 001B GETMET R6 R3 K10
+ 0x5421FFFE, // 001C LDINT R8 -1
+ 0x7C180400, // 001D CALL R6 2
+ 0x7001FFF9, // 001E JMP #0019
+ 0x5810000B, // 001F LDCONST R4 K11
+ 0xAC100200, // 0020 CATCH R4 1 0
+ 0xB0080000, // 0021 RAISE 2 R0 R0
+ 0xB8120E00, // 0022 GETNGBL R4 K7
+ 0x8C10090C, // 0023 GETMET R4 R4 K12
+ 0xB81A0E00, // 0024 GETNGBL R6 K7
+ 0x88180D0D, // 0025 GETMBR R6 R6 K13
+ 0x581C0001, // 0026 LDCONST R7 K1
+ 0x7C100600, // 0027 CALL R4 3
+ 0x78120006, // 0028 JMPF R4 #0030
+ 0xB8120E00, // 0029 GETNGBL R4 K7
+ 0x8C10090E, // 002A GETMET R4 R4 K14
+ 0xB81A0E00, // 002B GETNGBL R6 K7
+ 0x88180D0D, // 002C GETMBR R6 R6 K13
+ 0x581C0001, // 002D LDCONST R7 K1
+ 0x7C100600, // 002E CALL R4 3
+ 0x980E0204, // 002F SETIDX R3 K1 R4
+ 0x880C0506, // 0030 GETMBR R3 R2 K6
+ 0x58100001, // 0031 LDCONST R4 K1
+ 0x5415FFFE, // 0032 LDINT R5 -1
+ 0xB81A0E00, // 0033 GETNGBL R6 K7
+ 0x88180D08, // 0034 GETMBR R6 R6 K8
+ 0x14180806, // 0035 LT R6 R4 R6
+ 0x781A000A, // 0036 JMPF R6 #0042
+ 0x94180604, // 0037 GETIDX R6 R3 R4
+ 0x1C1C0C00, // 0038 EQ R7 R6 R0
+ 0x781E0000, // 0039 JMPF R7 #003B
+ 0x80040800, // 003A RET 1 R4
+ 0x141C0D01, // 003B LT R7 R6 K1
+ 0x781E0002, // 003C JMPF R7 #0040
+ 0x141C0B01, // 003D LT R7 R5 K1
+ 0x781E0000, // 003E JMPF R7 #0040
+ 0x5C140800, // 003F MOVE R5 R4
+ 0x00100909, // 0040 ADD R4 R4 K9
+ 0x7001FFF0, // 0041 JMP #0033
+ 0x28180B01, // 0042 GE R6 R5 K1
+ 0x781A0001, // 0043 JMPF R6 #0046
+ 0x980C0A00, // 0044 SETIDX R3 R5 R0
+ 0x80040A00, // 0045 RET 1 R5
+ 0xB0061F10, // 0046 RAISE 1 K15 K16
+ 0x80000000, // 0047 RET 0
})
)
);
@@ -1714,74 +2095,11 @@ be_local_closure(Leds_ctor, /* name */
/********************************************************************
-** Solidified function: dirty
+** Solidified function: pixels_buffer
********************************************************************/
-be_local_closure(Leds_dirty, /* name */
+be_local_closure(Leds_pixels_buffer, /* name */
be_nested_proto(
- 4, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str(call_native),
- }),
- &be_const_str_dirty,
- &be_const_str_solidified,
- ( &(const binstruction[ 4]) { /* code */
- 0x8C040100, // 0000 GETMET R1 R0 K0
- 0x540E0004, // 0001 LDINT R3 5
- 0x7C040400, // 0002 CALL R1 2
- 0x80000000, // 0003 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: clear_to
-********************************************************************/
-be_local_closure(Leds_clear_to, /* name */
- be_nested_proto(
- 10, /* nstack */
- 3, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str(call_native),
- /* K1 */ be_nested_str(to_gamma),
- }),
- &be_const_str_clear_to,
- &be_const_str_solidified,
- ( &(const binstruction[ 8]) { /* code */
- 0x8C0C0100, // 0000 GETMET R3 R0 K0
- 0x54160008, // 0001 LDINT R5 9
- 0x8C180101, // 0002 GETMET R6 R0 K1
- 0x5C200200, // 0003 MOVE R8 R1
- 0x5C240400, // 0004 MOVE R9 R2
- 0x7C180600, // 0005 CALL R6 3
- 0x7C0C0600, // 0006 CALL R3 3
- 0x80000000, // 0007 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: get_pixel_color
-********************************************************************/
-be_local_closure(Leds_get_pixel_color, /* name */
- be_nested_proto(
- 6, /* nstack */
+ 8, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
@@ -1789,192 +2107,36 @@ be_local_closure(Leds_get_pixel_color, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
+ ( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str(call_native),
+ /* K1 */ be_nested_str(pixel_size),
+ /* K2 */ be_nested_str(pixel_count),
+ /* K3 */ be_nested_str(_change_buffer),
}),
- &be_const_str_get_pixel_color,
+ &be_const_str_pixels_buffer,
&be_const_str_solidified,
- ( &(const binstruction[ 5]) { /* code */
+ ( &(const binstruction[21]) { /* code */
0x8C080100, // 0000 GETMET R2 R0 K0
- 0x5412000A, // 0001 LDINT R4 11
- 0x5C140200, // 0002 MOVE R5 R1
- 0x7C080600, // 0003 CALL R2 3
- 0x80040400, // 0004 RET 1 R2
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: init
-********************************************************************/
-be_local_closure(Leds_init, /* name */
- be_nested_proto(
- 11, /* nstack */
- 5, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 9]) { /* constants */
- /* K0 */ be_nested_str(gamma),
- /* K1 */ be_nested_str(leds),
- /* K2 */ be_nested_str(valuer_error),
- /* K3 */ be_nested_str(no_X20GPIO_X20specified_X20for_X20neopixelbus),
- /* K4 */ be_nested_str(ctor),
- /* K5 */ be_nested_str(_p),
- /* K6 */ be_nested_str(internal_error),
- /* K7 */ be_nested_str(couldn_X27t_X20not_X20initialize_X20noepixelbus),
- /* K8 */ be_nested_str(begin),
- }),
- &be_const_str_init,
- &be_const_str_solidified,
- ( &(const binstruction[24]) { /* code */
- 0x50140200, // 0000 LDBOOL R5 1 0
- 0x90020005, // 0001 SETMBR R0 K0 R5
- 0x60140009, // 0002 GETGBL R5 G9
- 0x5C180200, // 0003 MOVE R6 R1
- 0x7C140200, // 0004 CALL R5 1
- 0x90020205, // 0005 SETMBR R0 K1 R5
- 0x4C140000, // 0006 LDNIL R5
- 0x1C140405, // 0007 EQ R5 R2 R5
- 0x78160000, // 0008 JMPF R5 #000A
- 0xB0060503, // 0009 RAISE 1 K2 K3
- 0x8C140104, // 000A GETMET R5 R0 K4
- 0x881C0101, // 000B GETMBR R7 R0 K1
- 0x5C200400, // 000C MOVE R8 R2
- 0x5C240600, // 000D MOVE R9 R3
- 0x5C280800, // 000E MOVE R10 R4
- 0x7C140A00, // 000F CALL R5 5
- 0x88140105, // 0010 GETMBR R5 R0 K5
- 0x4C180000, // 0011 LDNIL R6
- 0x1C140A06, // 0012 EQ R5 R5 R6
- 0x78160000, // 0013 JMPF R5 #0015
- 0xB0060D07, // 0014 RAISE 1 K6 K7
- 0x8C140108, // 0015 GETMET R5 R0 K8
- 0x7C140200, // 0016 CALL R5 1
- 0x80000000, // 0017 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: begin
-********************************************************************/
-be_local_closure(Leds_begin, /* name */
- be_nested_proto(
- 4, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str(call_native),
- /* K1 */ be_const_int(1),
- }),
- &be_const_str_begin,
- &be_const_str_solidified,
- ( &(const binstruction[ 4]) { /* code */
- 0x8C040100, // 0000 GETMET R1 R0 K0
- 0x580C0001, // 0001 LDCONST R3 K1
- 0x7C040400, // 0002 CALL R1 2
- 0x80000000, // 0003 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: pixel_offset
-********************************************************************/
-be_local_closure(Leds_pixel_offset, /* name */
- be_nested_proto(
- 1, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_const_int(0),
- }),
- &be_const_str_pixel_offset,
- &be_const_str_solidified,
- ( &(const binstruction[ 1]) { /* code */
- 0x80060000, // 0000 RET 1 K0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: clear
-********************************************************************/
-be_local_closure(Leds_clear, /* name */
- be_nested_proto(
- 4, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 3]) { /* constants */
- /* K0 */ be_nested_str(clear_to),
- /* K1 */ be_const_int(0),
- /* K2 */ be_nested_str(show),
- }),
- &be_const_str_clear,
- &be_const_str_solidified,
- ( &(const binstruction[ 6]) { /* code */
- 0x8C040100, // 0000 GETMET R1 R0 K0
- 0x580C0001, // 0001 LDCONST R3 K1
- 0x7C040400, // 0002 CALL R1 2
- 0x8C040102, // 0003 GETMET R1 R0 K2
- 0x7C040200, // 0004 CALL R1 1
- 0x80000000, // 0005 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: pixel_size
-********************************************************************/
-be_local_closure(Leds_pixel_size, /* name */
- be_nested_proto(
- 4, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str(call_native),
- }),
- &be_const_str_pixel_size,
- &be_const_str_solidified,
- ( &(const binstruction[ 4]) { /* code */
- 0x8C040100, // 0000 GETMET R1 R0 K0
- 0x540E0006, // 0001 LDINT R3 7
- 0x7C040400, // 0002 CALL R1 2
- 0x80040200, // 0003 RET 1 R1
+ 0x54120005, // 0001 LDINT R4 6
+ 0x7C080400, // 0002 CALL R2 2
+ 0x4C0C0000, // 0003 LDNIL R3
+ 0x1C0C0203, // 0004 EQ R3 R1 R3
+ 0x780E0009, // 0005 JMPF R3 #0010
+ 0x600C0015, // 0006 GETGBL R3 G21
+ 0x5C100400, // 0007 MOVE R4 R2
+ 0x8C140101, // 0008 GETMET R5 R0 K1
+ 0x7C140200, // 0009 CALL R5 1
+ 0x8C180102, // 000A GETMET R6 R0 K2
+ 0x7C180200, // 000B CALL R6 1
+ 0x08140A06, // 000C MUL R5 R5 R6
+ 0x7C0C0400, // 000D CALL R3 2
+ 0x80040600, // 000E RET 1 R3
+ 0x70020003, // 000F JMP #0014
+ 0x8C0C0303, // 0010 GETMET R3 R1 K3
+ 0x5C140400, // 0011 MOVE R5 R2
+ 0x7C0C0400, // 0012 CALL R3 2
+ 0x80040200, // 0013 RET 1 R1
+ 0x80000000, // 0014 RET 0
})
)
);
@@ -1986,32 +2148,37 @@ be_local_closure(Leds_pixel_size, /* name */
********************************************************************/
extern const bclass be_class_Leds_ntv;
be_local_class(Leds,
- 2,
+ 3,
&be_class_Leds_ntv,
- be_nested_map(22,
+ be_nested_map(27,
( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key(show, -1), be_const_closure(Leds_show_closure) },
- { be_const_key(create_segment, -1), be_const_closure(Leds_create_segment_closure) },
- { be_const_key(assign_rmt, -1), be_const_static_closure(Leds_assign_rmt_closure) },
- { be_const_key(pixel_size, -1), be_const_closure(Leds_pixel_size_closure) },
- { be_const_key(matrix, 18), be_const_static_closure(Leds_matrix_closure) },
- { be_const_key(pixel_count, -1), be_const_closure(Leds_pixel_count_closure) },
- { be_const_key(ctor, -1), be_const_closure(Leds_ctor_closure) },
- { be_const_key(pixels_buffer, -1), be_const_closure(Leds_pixels_buffer_closure) },
- { be_const_key(set_pixel_color, -1), be_const_closure(Leds_set_pixel_color_closure) },
- { be_const_key(create_matrix, 15), be_const_closure(Leds_create_matrix_closure) },
- { be_const_key(is_dirty, 14), be_const_closure(Leds_is_dirty_closure) },
- { be_const_key(can_show, 6), be_const_closure(Leds_can_show_closure) },
- { be_const_key(to_gamma, -1), be_const_closure(Leds_to_gamma_closure) },
- { be_const_key(dirty, 19), be_const_closure(Leds_dirty_closure) },
- { be_const_key(begin, 12), be_const_closure(Leds_begin_closure) },
- { be_const_key(init, -1), be_const_closure(Leds_init_closure) },
- { be_const_key(gamma, 17), be_const_var(0) },
- { be_const_key(get_pixel_color, -1), be_const_closure(Leds_get_pixel_color_closure) },
- { be_const_key(clear_to, -1), be_const_closure(Leds_clear_to_closure) },
{ be_const_key(leds, -1), be_const_var(1) },
+ { be_const_key(create_segment, 25), be_const_closure(Leds_create_segment_closure) },
{ be_const_key(clear, -1), be_const_closure(Leds_clear_closure) },
- { be_const_key(pixel_offset, 3), be_const_closure(Leds_pixel_offset_closure) },
+ { be_const_key(begin, -1), be_const_closure(Leds_begin_closure) },
+ { be_const_key(ctor, 7), be_const_closure(Leds_ctor_closure) },
+ { be_const_key(assign_rmt, 12), be_const_static_closure(Leds_assign_rmt_closure) },
+ { be_const_key(to_gamma, 8), be_const_closure(Leds_to_gamma_closure) },
+ { be_const_key(dirty, -1), be_const_closure(Leds_dirty_closure) },
+ { be_const_key(matrix, -1), be_const_static_closure(Leds_matrix_closure) },
+ { be_const_key(pixel_offset, 2), be_const_closure(Leds_pixel_offset_closure) },
+ { be_const_key(set_gamma, 4), be_const_closure(Leds_set_gamma_closure) },
+ { be_const_key(get_pixel_color, -1), be_const_closure(Leds_get_pixel_color_closure) },
+ { be_const_key(pixel_size, -1), be_const_closure(Leds_pixel_size_closure) },
+ { be_const_key(create_matrix, -1), be_const_closure(Leds_create_matrix_closure) },
+ { be_const_key(set_bri, 9), be_const_closure(Leds_set_bri_closure) },
+ { be_const_key(clear_to, -1), be_const_closure(Leds_clear_to_closure) },
+ { be_const_key(set_pixel_color, -1), be_const_closure(Leds_set_pixel_color_closure) },
+ { be_const_key(gamma, -1), be_const_var(0) },
+ { be_const_key(pixel_count, 17), be_const_closure(Leds_pixel_count_closure) },
+ { be_const_key(get_bri, 13), be_const_closure(Leds_get_bri_closure) },
+ { be_const_key(get_gamma, -1), be_const_closure(Leds_get_gamma_closure) },
+ { be_const_key(bri, -1), be_const_var(2) },
+ { be_const_key(is_dirty, -1), be_const_closure(Leds_is_dirty_closure) },
+ { be_const_key(can_show, -1), be_const_closure(Leds_can_show_closure) },
+ { be_const_key(init, 5), be_const_closure(Leds_init_closure) },
+ { be_const_key(show, -1), be_const_closure(Leds_show_closure) },
+ { be_const_key(pixels_buffer, -1), be_const_closure(Leds_pixels_buffer_closure) },
})),
(bstring*) &be_const_str_Leds
);
diff --git a/tasmota/berry/animate_demo/animate_demo_pulse.be b/tasmota/berry/animate_demo/animate_demo_pulse.be
index 82c2d5ee3..0b60b0993 100644
--- a/tasmota/berry/animate_demo/animate_demo_pulse.be
+++ b/tasmota/berry/animate_demo/animate_demo_pulse.be
@@ -8,12 +8,13 @@ var duration = 10000
var strip = Leds(5 * 5, gpio.pin(gpio.WS2812, 0))
var anim = animate.core(strip)
anim.set_back_color(0x2222AA)
+anim.set_bri(60) # set brightness to 40%
var pulse = animate.pulse(0xFF4444, 2, 1)
var osc1 = animate.oscillator(-3, 26, 5000, animate.COSINE)
osc1.set_cb(pulse, pulse.set_pos)
# animate color of pulse
-var palette = animate.palette(animate.PALETTE_RAINBOW_WHITE, 30000)
+var palette = animate.palette(animate.PALETTE_STANDARD_VAL, 30000)
palette.set_cb(pulse, pulse.set_color)
anim.start()
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_leds.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_leds.ino
index 9ac9c4c45..e75f5cbed 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_leds.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_leds.ino
@@ -291,16 +291,16 @@ extern "C" {
be_raise(vm, kTypeError, nullptr);
}
- static uint32_t ApplyBriGamma(uint32_t color_a /* 0xRRGGBB */, uint32_t bri /* 0..100 */, bool gamma) {
+ static uint32_t ApplyBriGamma(uint32_t color_a /* 0xRRGGBB */, uint32_t bri /* 0..255 */, bool gamma) {
if (bri == 0) { return 0x000000; } // if bri is zero, short-cut
uint32_t r = (color_a >> 16) & 0xFF;
uint32_t g = (color_a >> 8) & 0xFF;
uint32_t b = (color_a ) & 0xFF;
- if (bri < 100) { // apply bri
- r = changeUIntScale(bri, 0, 100, 0, r);
- g = changeUIntScale(bri, 0, 100, 0, g);
- b = changeUIntScale(bri, 0, 100, 0, b);
+ if (bri < 255) { // apply bri
+ r = changeUIntScale(bri, 0, 255, 0, r);
+ g = changeUIntScale(bri, 0, 255, 0, g);
+ b = changeUIntScale(bri, 0, 255, 0, b);
}
if (gamma) { // apply gamma
@@ -312,23 +312,23 @@ extern "C" {
return rgb;
}
- // Leds.apply_bri_gamma(color_rgb:int (0xRRGGBB) [bri:int (0..100), gamma:bool]) -> color:int (0xRRGGBB)
+ // Leds.apply_bri_gamma(color_rgb:int (0xRRGGBB) [bri:int (0..255), gamma:bool]) -> color:int (0xRRGGBB)
//
int32_t be_leds_apply_bri_gamma(bvm *vm);
int32_t be_leds_apply_bri_gamma(bvm *vm) {
int32_t top = be_top(vm); // Get the number of arguments
if (top >= 1 && be_isint(vm, 1)) {
uint32_t color_a = be_toint(vm, 1);
- uint32_t bri = 100;
+ uint32_t bri255 = 255;
if (top >= 2 && be_isint(vm, 2)) {
- bri = be_toint(vm, 2);
+ bri255 = be_toint(vm, 2);
}
bool gamma = false;
if (top >= 3) {
gamma = be_tobool(vm, 3);
}
- uint32_t rgb = ApplyBriGamma(color_a, bri, gamma);
+ uint32_t rgb = ApplyBriGamma(color_a, bri255, gamma);
be_pushint(vm, rgb);
be_return(vm);
@@ -453,9 +453,9 @@ extern "C" {
size_t dest_len = 0;
uint8_t * dest_buf = (uint8_t*) be_tobytes(vm, 2, &dest_len);
- uint32_t bri = 100;
+ uint32_t bri255 = 255;
if (top >= 3 && be_isint(vm, 3)) {
- bri = be_toint(vm, 3);
+ bri255 = be_toint(vm, 3);
}
bool gamma = false;
if (top >= 4 && be_isbool(vm, 4)) {
@@ -466,7 +466,7 @@ extern "C" {
if (pixels_count > dest_len / 3) { pixels_count = dest_len / 3; }
if (pixels_count > 0) {
for (size_t i = 0; i < pixels_count; i++) {
- uint32_t src_argb = ApplyBriGamma(src_buf[i], bri, gamma);
+ uint32_t src_argb = ApplyBriGamma(src_buf[i], bri255, gamma);
uint32_t src_r = (src_argb >> 16) & 0xFF;
uint32_t src_g = (src_argb >> 8) & 0xFF;
uint32_t src_b = (src_argb ) & 0xFF;
From 18e5f53e971dcab1a15ab74b6c9762c7b791a9ea Mon Sep 17 00:00:00 2001
From: Jason2866 <24528715+Jason2866@users.noreply.github.com>
Date: Fri, 22 Dec 2023 19:40:47 +0100
Subject: [PATCH 036/303] Add new board setting "download speed" to esp32x
boards json (#20291)
* add download_speed setting
* add "download speed"
* add / change up- download speed
---
boards/esp32-fix.json | 3 +++
boards/esp32.json | 3 +++
boards/esp32_solo1.json | 3 +++
boards/esp32c2.json | 3 +++
boards/esp32c2_2M.json | 3 +++
boards/esp32c3.json | 3 +++
boards/esp32c3cdc.json | 5 ++++-
boards/esp32c6.json | 3 +++
boards/esp32c6cdc.json | 5 ++++-
boards/esp32s2.json | 3 +++
boards/esp32s2cdc.json | 5 ++++-
boards/esp32s3-opi_opi.json | 3 +++
boards/esp32s3-qio_opi.json | 3 +++
boards/esp32s3-qio_qspi.json | 3 +++
boards/esp32s3cdc-opi_opi.json | 5 ++++-
boards/esp32s3cdc-qio_opi.json | 5 ++++-
boards/esp32s3cdc-qio_qspi.json | 5 ++++-
pio-tools/custom_target.py | 11 +++++++----
18 files changed, 64 insertions(+), 10 deletions(-)
diff --git a/boards/esp32-fix.json b/boards/esp32-fix.json
index 8287019b8..73cf149fa 100644
--- a/boards/esp32-fix.json
+++ b/boards/esp32-fix.json
@@ -41,6 +41,9 @@
"require_upload_port": true,
"speed": 460800
},
+ "download": {
+ "speed": 230400
+ },
"url": "https://en.wikipedia.org/wiki/ESP32",
"vendor": "Espressif"
}
diff --git a/boards/esp32.json b/boards/esp32.json
index 4dd2a3602..10c117cd7 100644
--- a/boards/esp32.json
+++ b/boards/esp32.json
@@ -41,6 +41,9 @@
"require_upload_port": true,
"speed": 460800
},
+ "download": {
+ "speed": 230400
+ },
"url": "https://en.wikipedia.org/wiki/ESP32",
"vendor": "Espressif"
}
diff --git a/boards/esp32_solo1.json b/boards/esp32_solo1.json
index f3d9913b0..b80a58156 100644
--- a/boards/esp32_solo1.json
+++ b/boards/esp32_solo1.json
@@ -41,6 +41,9 @@
"require_upload_port": true,
"speed": 460800
},
+ "download": {
+ "speed": 230400
+ },
"url": "https://en.wikipedia.org/wiki/ESP32",
"vendor": "Espressif"
}
diff --git a/boards/esp32c2.json b/boards/esp32c2.json
index cabab4cb4..ea5cbae2c 100644
--- a/boards/esp32c2.json
+++ b/boards/esp32c2.json
@@ -39,6 +39,9 @@
"require_upload_port": true,
"speed": 460800
},
+ "download": {
+ "speed": 230400
+ },
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
"vendor": "Espressif"
}
diff --git a/boards/esp32c2_2M.json b/boards/esp32c2_2M.json
index 969ff519c..fbffa167c 100644
--- a/boards/esp32c2_2M.json
+++ b/boards/esp32c2_2M.json
@@ -39,6 +39,9 @@
"require_upload_port": true,
"speed": 460800
},
+ "download": {
+ "speed": 230400
+ },
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
"vendor": "Espressif"
}
diff --git a/boards/esp32c3.json b/boards/esp32c3.json
index 2bb2f7660..6a49ba922 100644
--- a/boards/esp32c3.json
+++ b/boards/esp32c3.json
@@ -39,6 +39,9 @@
"require_upload_port": true,
"speed": 460800
},
+ "download": {
+ "speed": 230400
+ },
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/hw-reference/esp32c3/user-guide-devkitm-1.html",
"vendor": "Espressif"
}
diff --git a/boards/esp32c3cdc.json b/boards/esp32c3cdc.json
index 8e46134b3..7ee0326f0 100644
--- a/boards/esp32c3cdc.json
+++ b/boards/esp32c3cdc.json
@@ -41,7 +41,10 @@
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
- "speed": 460800
+ "speed": 2000000
+ },
+ "download": {
+ "speed": 2000000
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/hw-reference/esp32c3/user-guide-devkitm-1.html",
"vendor": "Espressif"
diff --git a/boards/esp32c6.json b/boards/esp32c6.json
index 76e7620db..68feaec6e 100644
--- a/boards/esp32c6.json
+++ b/boards/esp32c6.json
@@ -39,6 +39,9 @@
"require_upload_port": true,
"speed": 460800
},
+ "download": {
+ "speed": 230400
+ },
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
"vendor": "Espressif"
}
diff --git a/boards/esp32c6cdc.json b/boards/esp32c6cdc.json
index eb8a6ffbb..9cde9e62b 100644
--- a/boards/esp32c6cdc.json
+++ b/boards/esp32c6cdc.json
@@ -41,7 +41,10 @@
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
- "speed": 460800
+ "speed": 2000000
+ },
+ "download": {
+ "speed": 2000000
},
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
"vendor": "Espressif"
diff --git a/boards/esp32s2.json b/boards/esp32s2.json
index aa9efca8b..18bd9200a 100644
--- a/boards/esp32s2.json
+++ b/boards/esp32s2.json
@@ -38,6 +38,9 @@
"require_upload_port": true,
"speed": 460800
},
+ "download": {
+ "speed": 230400
+ },
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/hw-reference/esp32s2/user-guide-saola-1-v1.2.html",
"vendor": "Espressif"
}
diff --git a/boards/esp32s2cdc.json b/boards/esp32s2cdc.json
index f9a302699..c379be423 100644
--- a/boards/esp32s2cdc.json
+++ b/boards/esp32s2cdc.json
@@ -37,7 +37,10 @@
"maximum_size": 4194304,
"require_upload_port": true,
"before_reset": "usb_reset",
- "speed": 460800
+ "speed": 2000000
+ },
+ "download": {
+ "speed": 2000000
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/hw-reference/esp32s2/user-guide-saola-1-v1.2.html",
"vendor": "Espressif"
diff --git a/boards/esp32s3-opi_opi.json b/boards/esp32s3-opi_opi.json
index aa7e5db2a..92803a838 100644
--- a/boards/esp32s3-opi_opi.json
+++ b/boards/esp32s3-opi_opi.json
@@ -41,6 +41,9 @@
"require_upload_port": true,
"speed": 460800
},
+ "download": {
+ "speed": 230400
+ },
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
"vendor": "Espressif"
}
\ No newline at end of file
diff --git a/boards/esp32s3-qio_opi.json b/boards/esp32s3-qio_opi.json
index 4f2a06c47..614831574 100644
--- a/boards/esp32s3-qio_opi.json
+++ b/boards/esp32s3-qio_opi.json
@@ -41,6 +41,9 @@
"require_upload_port": true,
"speed": 460800
},
+ "download": {
+ "speed": 230400
+ },
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
"vendor": "Espressif"
}
diff --git a/boards/esp32s3-qio_qspi.json b/boards/esp32s3-qio_qspi.json
index 42b20a4bc..9b11a31b0 100644
--- a/boards/esp32s3-qio_qspi.json
+++ b/boards/esp32s3-qio_qspi.json
@@ -41,6 +41,9 @@
"require_upload_port": true,
"speed": 460800
},
+ "download": {
+ "speed": 230400
+ },
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
"vendor": "Espressif"
}
diff --git a/boards/esp32s3cdc-opi_opi.json b/boards/esp32s3cdc-opi_opi.json
index a5992333c..684cba031 100644
--- a/boards/esp32s3cdc-opi_opi.json
+++ b/boards/esp32s3cdc-opi_opi.json
@@ -49,7 +49,10 @@
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
- "speed": 460800
+ "speed": 2000000
+ },
+ "download": {
+ "speed": 2000000
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
"vendor": "Espressif"
diff --git a/boards/esp32s3cdc-qio_opi.json b/boards/esp32s3cdc-qio_opi.json
index 46ed77fca..46b363266 100644
--- a/boards/esp32s3cdc-qio_opi.json
+++ b/boards/esp32s3cdc-qio_opi.json
@@ -49,7 +49,10 @@
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
- "speed": 460800
+ "speed": 2000000
+ },
+ "download": {
+ "speed": 2000000
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
"vendor": "Espressif"
diff --git a/boards/esp32s3cdc-qio_qspi.json b/boards/esp32s3cdc-qio_qspi.json
index 7e80448e3..fa90e8509 100644
--- a/boards/esp32s3cdc-qio_qspi.json
+++ b/boards/esp32s3cdc-qio_qspi.json
@@ -49,7 +49,10 @@
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
- "speed": 460800
+ "speed": 2000000
+ },
+ "download": {
+ "speed": 2000000
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
"vendor": "Espressif"
diff --git a/pio-tools/custom_target.py b/pio-tools/custom_target.py
index a11d6a3ae..9623105aa 100644
--- a/pio-tools/custom_target.py
+++ b/pio-tools/custom_target.py
@@ -186,6 +186,7 @@ def parse_partition_table(content):
def get_partition_table():
esptoolpy = join(platform.get_package_dir("tool-esptoolpy") or "", "esptool.py")
upload_port = join(env.get("UPLOAD_PORT", "none"))
+ download_speed = join(str(board.get("download.speed", "115200")))
if "none" in upload_port:
env.AutodetectUploadPort()
upload_port = join(env.get("UPLOAD_PORT", "none"))
@@ -193,7 +194,7 @@ def get_partition_table():
esptoolpy_flags = [
"--chip", mcu,
"--port", upload_port,
- "--baud", env.subst("$UPLOAD_SPEED"),
+ "--baud", download_speed,
"--before", "default_reset",
"--after", "hard_reset",
"read_flash",
@@ -246,6 +247,7 @@ def download_fs(fs_info: FSInfo):
print(fs_info)
esptoolpy = join(platform.get_package_dir("tool-esptoolpy") or "", "esptool.py")
upload_port = join(env.get("UPLOAD_PORT", "none"))
+ download_speed = join(str(board.get("download.speed", "115200")))
if "none" in upload_port:
env.AutodetectUploadPort()
upload_port = join(env.get("UPLOAD_PORT", "none"))
@@ -253,7 +255,7 @@ def download_fs(fs_info: FSInfo):
esptoolpy_flags = [
"--chip", mcu,
"--port", upload_port,
- "--baud", env.subst("$UPLOAD_SPEED"),
+ "--baud", download_speed,
"--before", "default_reset",
"--after", "hard_reset",
"read_flash",
@@ -278,7 +280,7 @@ def unpack_fs(fs_info: FSInfo, downloaded_file: str):
unpack_dir = env.GetProjectOption("custom_unpack_dir", "unpacked_fs")
#unpack_dir = "unpacked_fs"
if not os.path.exists(downloaded_file):
- print(f"ERROR: {downloaded_file} with filesystem not found, maybe download failed due to upload_speed setting being too high.")
+ print(f"ERROR: {downloaded_file} with filesystem not found, maybe download failed due to download_speed setting being too high.")
assert(0)
try:
if os.path.exists(unpack_dir):
@@ -305,7 +307,7 @@ def display_fs(extracted_dir):
print("Extracted " + str(file_count) + " file(s) from filesystem.")
def command_download_fs(*args, **kwargs):
- print("Entrypoint")
+ #print("Entrypoint")
#print(env.Dump())
get_partition_table()
info = get_fs_type_start_and_length()
@@ -356,3 +358,4 @@ env.AddCustomTarget(
title="Flash factory",
description="Flash factory firmware"
)
+
From fb90a34b0a82a7399eaca7f5d07b4b42732de764 Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Sat, 23 Dec 2023 10:54:22 +0100
Subject: [PATCH 037/303] Matter support for password for remote Tasmota
devices (#20296)
---
.../src/embedded/Matter_HTTP_async.be | 28 +-
.../solidify/solidified_Matter_HTTP_async.h | 1424 +++++++++--------
2 files changed, 764 insertions(+), 688 deletions(-)
diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_HTTP_async.be b/lib/libesp32/berry_matter/src/embedded/Matter_HTTP_async.be
index 3d9abbf95..3b2947664 100644
--- a/lib/libesp32/berry_matter/src/embedded/Matter_HTTP_async.be
+++ b/lib/libesp32/berry_matter/src/embedded/Matter_HTTP_async.be
@@ -31,6 +31,7 @@ class Matter_HTTP_async : Matter_TCP_async
# var tcp # instance of tcpclientasync
# var time_start # timestamp when starting connection
# var tcp_connected # is tcp connected, true/false/nil (nil is in-progress)
+ var auth # web authentication string (Basic Auth) or `nil`, in format `user:password` as bade64
var cmd # GET url command
var response # aggrated response
var response_offset # offset to parse in response
@@ -42,8 +43,16 @@ class Matter_HTTP_async : Matter_TCP_async
var phase # parsing phase: 0/ status line, 1/ headers, 2/ payload chunked
var is_chunked # true if the content is chunked
var chunk_size # nil or int, size of the current chunk
- static var HTTP_GET = "GET %s HTTP/1.1\r\nHost %s:%s\r\nConnection: close\r\n\r\n" # see https://stackoverflow.com/questions/6686261/what-at-the-bare-minimum-is-required-for-an-http-request
+ static var HTTP_GET = "GET %s HTTP/1.1\r\n" # see https://stackoverflow.com/questions/6686261/what-at-the-bare-minimum-is-required-for-an-http-request
+ "Host %s:%s\r\n"
+ "Connection: close\r\n"
+ "\r\n"
+ static var HTTP_GET_AUTH = "GET %s HTTP/1.1\r\n" # same with auth
+ "Host %s:%s\r\n"
+ "Authorization: Basic %s\r\n"
+ "Connection: close\r\n"
+ "\r\n"
static var HTTP_STATUS_REGEX = "HTTP/1\\.[0-1] (\\d+) .*?\r\n" # extract stattus code from first line
static var HTTP_HEADER_REGEX = "([A-Za-z0-9-]+): (.*?)\r\n" # extract a header with its 2 parts
static var HTTP_BODY_REGEX = "\r\n" # end of headers
@@ -53,6 +62,15 @@ class Matter_HTTP_async : Matter_TCP_async
#############################################################
# init
def init(addr, port, timeout, fastloop)
+ # extract auth from add first
+ import string
+ addr = str(addr) # force string
+ var x = string.find(addr, "@")
+ if x >= 0
+ self.auth = bytes().fromstring(addr[0 .. x-1]).tob64()
+ addr = addr[x+1 .. ]
+ end
+ # `addr` is cleaned from authentication information
super(self).init(addr, port, timeout, fastloop)
self.compile_re()
end
@@ -253,7 +271,13 @@ class Matter_HTTP_async : Matter_TCP_async
addr = "[" + addr + "]" # IPv6 must be enclosed in brakets
end
- var req = format(self.HTTP_GET, self.cmd, addr, self.port)
+ var req
+ if (self.auth == nil)
+ req = format(self.HTTP_GET, self.cmd, addr, self.port)
+ else
+ # use AUTH information
+ req = format(self.HTTP_GET_AUTH, self.cmd, addr, self.port, self.auth)
+ end
var ret = self.write(req)
if ret != size(req)
# print("Could not send","size=",size(req),"ret=",ret)
diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_HTTP_async.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_HTTP_async.h
index 49b05e0a9..d55db99f7 100644
--- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_HTTP_async.h
+++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_HTTP_async.h
@@ -6,375 +6,6 @@
extern const bclass be_class_Matter_HTTP_async;
-/********************************************************************
-** Solidified function: init
-********************************************************************/
-be_local_closure(Matter_HTTP_async_init, /* name */
- be_nested_proto(
- 11, /* nstack */
- 5, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(init),
- /* K1 */ be_nested_str_weak(compile_re),
- }),
- be_str_weak(init),
- &be_const_str_solidified,
- ( &(const binstruction[12]) { /* code */
- 0x60140003, // 0000 GETGBL R5 G3
- 0x5C180000, // 0001 MOVE R6 R0
- 0x7C140200, // 0002 CALL R5 1
- 0x8C140B00, // 0003 GETMET R5 R5 K0
- 0x5C1C0200, // 0004 MOVE R7 R1
- 0x5C200400, // 0005 MOVE R8 R2
- 0x5C240600, // 0006 MOVE R9 R3
- 0x5C280800, // 0007 MOVE R10 R4
- 0x7C140A00, // 0008 CALL R5 5
- 0x8C140101, // 0009 GETMET R5 R0 K1
- 0x7C140200, // 000A CALL R5 1
- 0x80000000, // 000B RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: event_http_failed
-********************************************************************/
-be_local_closure(Matter_HTTP_async_event_http_failed, /* name */
- be_nested_proto(
- 1, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 0, /* has constants */
- NULL, /* no const */
- be_str_weak(event_http_failed),
- &be_const_str_solidified,
- ( &(const binstruction[ 1]) { /* code */
- 0x80000000, // 0000 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: compile_re
-********************************************************************/
-be_local_closure(Matter_HTTP_async_compile_re, /* name */
- be_nested_proto(
- 6, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[12]) { /* constants */
- /* K0 */ be_nested_str_weak(re),
- /* K1 */ be_nested_str_weak(global),
- /* K2 */ be_nested_str_weak(contains),
- /* K3 */ be_nested_str_weak(_re_http_status),
- /* K4 */ be_nested_str_weak(compile),
- /* K5 */ be_nested_str_weak(HTTP_STATUS_REGEX),
- /* K6 */ be_nested_str_weak(_re_http_header),
- /* K7 */ be_nested_str_weak(HTTP_HEADER_REGEX),
- /* K8 */ be_nested_str_weak(_re_http_body),
- /* K9 */ be_nested_str_weak(HTTP_BODY_REGEX),
- /* K10 */ be_nested_str_weak(_re_http_chunk),
- /* K11 */ be_nested_str_weak(HTTP_CHUNK_REGEX),
- }),
- be_str_weak(compile_re),
- &be_const_str_solidified,
- ( &(const binstruction[27]) { /* code */
- 0xA4060000, // 0000 IMPORT R1 K0
- 0xB80A0200, // 0001 GETNGBL R2 K1
- 0x8C080502, // 0002 GETMET R2 R2 K2
- 0x58100003, // 0003 LDCONST R4 K3
- 0x7C080400, // 0004 CALL R2 2
- 0x740A0013, // 0005 JMPT R2 #001A
- 0xB80A0200, // 0006 GETNGBL R2 K1
- 0x8C0C0304, // 0007 GETMET R3 R1 K4
- 0x88140105, // 0008 GETMBR R5 R0 K5
- 0x7C0C0400, // 0009 CALL R3 2
- 0x900A0603, // 000A SETMBR R2 K3 R3
- 0xB80A0200, // 000B GETNGBL R2 K1
- 0x8C0C0304, // 000C GETMET R3 R1 K4
- 0x88140107, // 000D GETMBR R5 R0 K7
- 0x7C0C0400, // 000E CALL R3 2
- 0x900A0C03, // 000F SETMBR R2 K6 R3
- 0xB80A0200, // 0010 GETNGBL R2 K1
- 0x8C0C0304, // 0011 GETMET R3 R1 K4
- 0x88140109, // 0012 GETMBR R5 R0 K9
- 0x7C0C0400, // 0013 CALL R3 2
- 0x900A1003, // 0014 SETMBR R2 K8 R3
- 0xB80A0200, // 0015 GETNGBL R2 K1
- 0x8C0C0304, // 0016 GETMET R3 R1 K4
- 0x8814010B, // 0017 GETMBR R5 R0 K11
- 0x7C0C0400, // 0018 CALL R3 2
- 0x900A1403, // 0019 SETMBR R2 K10 R3
- 0x80000000, // 001A RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: parse_http_response
-********************************************************************/
-be_local_closure(Matter_HTTP_async_parse_http_response, /* name */
- be_nested_proto(
- 3, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 7]) { /* constants */
- /* K0 */ be_nested_str_weak(phase),
- /* K1 */ be_const_int(0),
- /* K2 */ be_nested_str_weak(parse_http_status_line),
- /* K3 */ be_const_int(1),
- /* K4 */ be_nested_str_weak(parse_http_headers),
- /* K5 */ be_const_int(2),
- /* K6 */ be_nested_str_weak(parse_http_payload),
- }),
- be_str_weak(parse_http_response),
- &be_const_str_solidified,
- ( &(const binstruction[18]) { /* code */
- 0x88040100, // 0000 GETMBR R1 R0 K0
- 0x1C040301, // 0001 EQ R1 R1 K1
- 0x78060002, // 0002 JMPF R1 #0006
- 0x8C040102, // 0003 GETMET R1 R0 K2
- 0x7C040200, // 0004 CALL R1 1
- 0x7002000A, // 0005 JMP #0011
- 0x88040100, // 0006 GETMBR R1 R0 K0
- 0x1C040303, // 0007 EQ R1 R1 K3
- 0x78060002, // 0008 JMPF R1 #000C
- 0x8C040104, // 0009 GETMET R1 R0 K4
- 0x7C040200, // 000A CALL R1 1
- 0x70020004, // 000B JMP #0011
- 0x88040100, // 000C GETMBR R1 R0 K0
- 0x1C040305, // 000D EQ R1 R1 K5
- 0x78060001, // 000E JMPF R1 #0011
- 0x8C040106, // 000F GETMET R1 R0 K6
- 0x7C040200, // 0010 CALL R1 1
- 0x80000000, // 0011 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: event_available
-********************************************************************/
-be_local_closure(Matter_HTTP_async_event_available, /* name */
- be_nested_proto(
- 3, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(receive),
- }),
- be_str_weak(event_available),
- &be_const_str_solidified,
- ( &(const binstruction[ 3]) { /* code */
- 0x8C040100, // 0000 GETMET R1 R0 K0
- 0x7C040200, // 0001 CALL R1 1
- 0x80000000, // 0002 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: receive
-********************************************************************/
-be_local_closure(Matter_HTTP_async_receive, /* name */
- be_nested_proto(
- 6, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[15]) { /* constants */
- /* K0 */ be_nested_str_weak(tcp_connected),
- /* K1 */ be_nested_str_weak(tasmota),
- /* K2 */ be_nested_str_weak(millis),
- /* K3 */ be_nested_str_weak(time_start),
- /* K4 */ be_nested_str_weak(timeout),
- /* K5 */ be_nested_str_weak(status),
- /* K6 */ be_nested_str_weak(close),
- /* K7 */ be_nested_str_weak(http_status),
- /* K8 */ be_nested_str_weak(event_http_timeout),
- /* K9 */ be_nested_str_weak(tcp),
- /* K10 */ be_nested_str_weak(available),
- /* K11 */ be_const_int(0),
- /* K12 */ be_nested_str_weak(read),
- /* K13 */ be_nested_str_weak(response),
- /* K14 */ be_nested_str_weak(parse_http_response),
- }),
- be_str_weak(receive),
- &be_const_str_solidified,
- ( &(const binstruction[48]) { /* code */
- 0x88040100, // 0000 GETMBR R1 R0 K0
- 0x50080200, // 0001 LDBOOL R2 1 0
- 0x20040202, // 0002 NE R1 R1 R2
- 0x78060000, // 0003 JMPF R1 #0005
- 0x80000200, // 0004 RET 0
- 0xB8060200, // 0005 GETNGBL R1 K1
- 0x8C040302, // 0006 GETMET R1 R1 K2
- 0x7C040200, // 0007 CALL R1 1
- 0x88080103, // 0008 GETMBR R2 R0 K3
- 0x04040202, // 0009 SUB R1 R1 R2
- 0x88080104, // 000A GETMBR R2 R0 K4
- 0x24040202, // 000B GT R1 R1 R2
- 0x78060008, // 000C JMPF R1 #0016
- 0x5405FFFC, // 000D LDINT R1 -3
- 0x90020A01, // 000E SETMBR R0 K5 R1
- 0x8C040106, // 000F GETMET R1 R0 K6
- 0x7C040200, // 0010 CALL R1 1
- 0x5405FFFD, // 0011 LDINT R1 -2
- 0x90020E01, // 0012 SETMBR R0 K7 R1
- 0x8C040108, // 0013 GETMET R1 R0 K8
- 0x7C040200, // 0014 CALL R1 1
- 0x70020018, // 0015 JMP #002F
- 0x88040109, // 0016 GETMBR R1 R0 K9
- 0x8C04030A, // 0017 GETMET R1 R1 K10
- 0x7C040200, // 0018 CALL R1 1
- 0x5808000B, // 0019 LDCONST R2 K11
- 0x240C030B, // 001A GT R3 R1 K11
- 0x780E000E, // 001B JMPF R3 #002B
- 0x880C0109, // 001C GETMBR R3 R0 K9
- 0x8C0C070C, // 001D GETMET R3 R3 K12
- 0x7C0C0200, // 001E CALL R3 1
- 0x8810010D, // 001F GETMBR R4 R0 K13
- 0x00100803, // 0020 ADD R4 R4 R3
- 0x90021A04, // 0021 SETMBR R0 K13 R4
- 0x6010000C, // 0022 GETGBL R4 G12
- 0x5C140600, // 0023 MOVE R5 R3
- 0x7C100200, // 0024 CALL R4 1
- 0x00080404, // 0025 ADD R2 R2 R4
- 0x88100109, // 0026 GETMBR R4 R0 K9
- 0x8C10090A, // 0027 GETMET R4 R4 K10
- 0x7C100200, // 0028 CALL R4 1
- 0x5C040800, // 0029 MOVE R1 R4
- 0x7001FFEE, // 002A JMP #001A
- 0x240C050B, // 002B GT R3 R2 K11
- 0x780E0001, // 002C JMPF R3 #002F
- 0x8C0C010E, // 002D GETMET R3 R0 K14
- 0x7C0C0200, // 002E CALL R3 1
- 0x80000000, // 002F RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: reset
-********************************************************************/
-be_local_closure(Matter_HTTP_async_reset, /* name */
- be_nested_proto(
- 3, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[11]) { /* constants */
- /* K0 */ be_nested_str_weak(reset),
- /* K1 */ be_nested_str_weak(cmd),
- /* K2 */ be_nested_str_weak(response),
- /* K3 */ be_nested_str_weak(response_offset),
- /* K4 */ be_const_int(0),
- /* K5 */ be_nested_str_weak(payload),
- /* K6 */ be_nested_str_weak(),
- /* K7 */ be_nested_str_weak(phase),
- /* K8 */ be_nested_str_weak(http_status),
- /* K9 */ be_nested_str_weak(is_chunked),
- /* K10 */ be_nested_str_weak(chunk_size),
- }),
- be_str_weak(reset),
- &be_const_str_solidified,
- ( &(const binstruction[18]) { /* code */
- 0x60040003, // 0000 GETGBL R1 G3
- 0x5C080000, // 0001 MOVE R2 R0
- 0x7C040200, // 0002 CALL R1 1
- 0x8C040300, // 0003 GETMET R1 R1 K0
- 0x7C040200, // 0004 CALL R1 1
- 0x4C040000, // 0005 LDNIL R1
- 0x90020201, // 0006 SETMBR R0 K1 R1
- 0x4C040000, // 0007 LDNIL R1
- 0x90020401, // 0008 SETMBR R0 K2 R1
- 0x90020704, // 0009 SETMBR R0 K3 K4
- 0x90020B06, // 000A SETMBR R0 K5 K6
- 0x90020F04, // 000B SETMBR R0 K7 K4
- 0x90021104, // 000C SETMBR R0 K8 K4
- 0x50040000, // 000D LDBOOL R1 0 0
- 0x90021201, // 000E SETMBR R0 K9 R1
- 0x4C040000, // 000F LDNIL R1
- 0x90021401, // 0010 SETMBR R0 K10 R1
- 0x80000000, // 0011 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: event_http_status_code
-********************************************************************/
-be_local_closure(Matter_HTTP_async_event_http_status_code, /* name */
- be_nested_proto(
- 3, /* nstack */
- 3, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(status_code),
- }),
- be_str_weak(event_http_status_code),
- &be_const_str_solidified,
- ( &(const binstruction[ 2]) { /* code */
- 0x90020001, // 0000 SETMBR R0 K0 R1
- 0x80000000, // 0001 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
/********************************************************************
** Solidified function: parse_http_payload
********************************************************************/
@@ -497,149 +128,6 @@ be_local_closure(Matter_HTTP_async_parse_http_payload, /* name */
/*******************************************************************/
-/********************************************************************
-** Solidified function: send_http
-********************************************************************/
-be_local_closure(Matter_HTTP_async_send_http, /* name */
- be_nested_proto(
- 8, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[17]) { /* constants */
- /* K0 */ be_nested_str_weak(string),
- /* K1 */ be_nested_str_weak(response),
- /* K2 */ be_nested_str_weak(),
- /* K3 */ be_nested_str_weak(addr),
- /* K4 */ be_nested_str_weak(find),
- /* K5 */ be_nested_str_weak(_X3A),
- /* K6 */ be_const_int(0),
- /* K7 */ be_nested_str_weak(_X5B),
- /* K8 */ be_nested_str_weak(_X5D),
- /* K9 */ be_nested_str_weak(HTTP_GET),
- /* K10 */ be_nested_str_weak(cmd),
- /* K11 */ be_nested_str_weak(port),
- /* K12 */ be_nested_str_weak(write),
- /* K13 */ be_nested_str_weak(close),
- /* K14 */ be_nested_str_weak(status),
- /* K15 */ be_nested_str_weak(http_status),
- /* K16 */ be_nested_str_weak(event_http_failed),
- }),
- be_str_weak(send_http),
- &be_const_str_solidified,
- ( &(const binstruction[35]) { /* code */
- 0xA4060000, // 0000 IMPORT R1 K0
- 0x90020302, // 0001 SETMBR R0 K1 K2
- 0x88080103, // 0002 GETMBR R2 R0 K3
- 0x8C0C0304, // 0003 GETMET R3 R1 K4
- 0x5C140400, // 0004 MOVE R5 R2
- 0x58180005, // 0005 LDCONST R6 K5
- 0x7C0C0600, // 0006 CALL R3 3
- 0x280C0706, // 0007 GE R3 R3 K6
- 0x780E0002, // 0008 JMPF R3 #000C
- 0x000E0E02, // 0009 ADD R3 K7 R2
- 0x000C0708, // 000A ADD R3 R3 K8
- 0x5C080600, // 000B MOVE R2 R3
- 0x600C0018, // 000C GETGBL R3 G24
- 0x88100109, // 000D GETMBR R4 R0 K9
- 0x8814010A, // 000E GETMBR R5 R0 K10
- 0x5C180400, // 000F MOVE R6 R2
- 0x881C010B, // 0010 GETMBR R7 R0 K11
- 0x7C0C0800, // 0011 CALL R3 4
- 0x8C10010C, // 0012 GETMET R4 R0 K12
- 0x5C180600, // 0013 MOVE R6 R3
- 0x7C100400, // 0014 CALL R4 2
- 0x6014000C, // 0015 GETGBL R5 G12
- 0x5C180600, // 0016 MOVE R6 R3
- 0x7C140200, // 0017 CALL R5 1
- 0x20140805, // 0018 NE R5 R4 R5
- 0x78160007, // 0019 JMPF R5 #0022
- 0x8C14010D, // 001A GETMET R5 R0 K13
- 0x7C140200, // 001B CALL R5 1
- 0x5415FFFB, // 001C LDINT R5 -4
- 0x90021C05, // 001D SETMBR R0 K14 R5
- 0x5415FFFE, // 001E LDINT R5 -1
- 0x90021E05, // 001F SETMBR R0 K15 R5
- 0x8C140110, // 0020 GETMET R5 R0 K16
- 0x7C140200, // 0021 CALL R5 1
- 0x80000000, // 0022 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: begin_sync
-********************************************************************/
-be_local_closure(Matter_HTTP_async_begin_sync, /* name */
- be_nested_proto(
- 10, /* nstack */
- 3, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[10]) { /* constants */
- /* K0 */ be_nested_str_weak(timeout),
- /* K1 */ be_nested_str_weak(set_timeout),
- /* K2 */ be_nested_str_weak(SPINLOCK),
- /* K3 */ be_nested_str_weak(begin),
- /* K4 */ be_nested_str_weak(http_status),
- /* K5 */ be_const_int(0),
- /* K6 */ be_nested_str_weak(loop),
- /* K7 */ be_nested_str_weak(tasmota),
- /* K8 */ be_nested_str_weak(delay),
- /* K9 */ be_nested_str_weak(payload),
- }),
- be_str_weak(begin_sync),
- &be_const_str_solidified,
- ( &(const binstruction[33]) { /* code */
- 0x880C0100, // 0000 GETMBR R3 R0 K0
- 0x4C100000, // 0001 LDNIL R4
- 0x20100404, // 0002 NE R4 R2 R4
- 0x78120002, // 0003 JMPF R4 #0007
- 0x8C100101, // 0004 GETMET R4 R0 K1
- 0x5C180400, // 0005 MOVE R6 R2
- 0x7C100400, // 0006 CALL R4 2
- 0x4C100000, // 0007 LDNIL R4
- 0x88140102, // 0008 GETMBR R5 R0 K2
- 0x8C180103, // 0009 GETMET R6 R0 K3
- 0x5C200200, // 000A MOVE R8 R1
- 0x7C180400, // 000B CALL R6 2
- 0x781A0009, // 000C JMPF R6 #0017
- 0x881C0104, // 000D GETMBR R7 R0 K4
- 0x1C1C0F05, // 000E EQ R7 R7 K5
- 0x781E0006, // 000F JMPF R7 #0017
- 0x8C1C0106, // 0010 GETMET R7 R0 K6
- 0x7C1C0200, // 0011 CALL R7 1
- 0xB81E0E00, // 0012 GETNGBL R7 K7
- 0x8C1C0F08, // 0013 GETMET R7 R7 K8
- 0x5C240A00, // 0014 MOVE R9 R5
- 0x7C1C0400, // 0015 CALL R7 2
- 0x7001FFF5, // 0016 JMP #000D
- 0x8C1C0101, // 0017 GETMET R7 R0 K1
- 0x5C240600, // 0018 MOVE R9 R3
- 0x7C1C0400, // 0019 CALL R7 2
- 0x881C0104, // 001A GETMBR R7 R0 K4
- 0x241C0F05, // 001B GT R7 R7 K5
- 0x781E0001, // 001C JMPF R7 #001F
- 0x881C0109, // 001D GETMBR R7 R0 K9
- 0x70020000, // 001E JMP #0020
- 0x4C1C0000, // 001F LDNIL R7
- 0x80040E00, // 0020 RET 1 R7
- })
- )
-);
-/*******************************************************************/
-
-
/********************************************************************
** Solidified function: event_http_finished
********************************************************************/
@@ -665,30 +153,47 @@ be_local_closure(Matter_HTTP_async_event_http_finished, /* name */
/********************************************************************
-** Solidified function: event_timeout
+** Solidified function: event_http_header
********************************************************************/
-be_local_closure(Matter_HTTP_async_event_timeout, /* name */
+be_local_closure(Matter_HTTP_async_event_http_header, /* name */
be_nested_proto(
- 3, /* nstack */
- 1, /* argc */
+ 7, /* nstack */
+ 3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(http_status),
- /* K1 */ be_nested_str_weak(event_http_timeout),
+ ( &(const bvalue[ 5]) { /* constants */
+ /* K0 */ be_nested_str_weak(string),
+ /* K1 */ be_nested_str_weak(tolower),
+ /* K2 */ be_nested_str_weak(transfer_X2Dencoding),
+ /* K3 */ be_nested_str_weak(chunked),
+ /* K4 */ be_nested_str_weak(is_chunked),
}),
- be_str_weak(event_timeout),
+ be_str_weak(event_http_header),
&be_const_str_solidified,
- ( &(const binstruction[ 5]) { /* code */
- 0x5405FFFD, // 0000 LDINT R1 -2
- 0x90020001, // 0001 SETMBR R0 K0 R1
- 0x8C040101, // 0002 GETMET R1 R0 K1
- 0x7C040200, // 0003 CALL R1 1
- 0x80000000, // 0004 RET 0
+ ( &(const binstruction[19]) { /* code */
+ 0xA40E0000, // 0000 IMPORT R3 K0
+ 0x8C100701, // 0001 GETMET R4 R3 K1
+ 0x5C180200, // 0002 MOVE R6 R1
+ 0x7C100400, // 0003 CALL R4 2
+ 0x5C040800, // 0004 MOVE R1 R4
+ 0x8C100701, // 0005 GETMET R4 R3 K1
+ 0x5C180400, // 0006 MOVE R6 R2
+ 0x7C100400, // 0007 CALL R4 2
+ 0x5C080800, // 0008 MOVE R2 R4
+ 0x1C100302, // 0009 EQ R4 R1 K2
+ 0x78120006, // 000A JMPF R4 #0012
+ 0x8C100701, // 000B GETMET R4 R3 K1
+ 0x5C180400, // 000C MOVE R6 R2
+ 0x7C100400, // 000D CALL R4 2
+ 0x1C100903, // 000E EQ R4 R4 K3
+ 0x78120001, // 000F JMPF R4 #0012
+ 0x50100200, // 0010 LDBOOL R4 1 0
+ 0x90020804, // 0011 SETMBR R0 K4 R4
+ 0x80000000, // 0012 RET 0
})
)
);
@@ -696,9 +201,104 @@ be_local_closure(Matter_HTTP_async_event_timeout, /* name */
/********************************************************************
-** Solidified function: event_established
+** Solidified function: init
********************************************************************/
-be_local_closure(Matter_HTTP_async_event_established, /* name */
+be_local_closure(Matter_HTTP_async_init, /* name */
+ be_nested_proto(
+ 13, /* nstack */
+ 5, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[11]) { /* constants */
+ /* K0 */ be_nested_str_weak(string),
+ /* K1 */ be_nested_str_weak(find),
+ /* K2 */ be_nested_str_weak(_X40),
+ /* K3 */ be_const_int(0),
+ /* K4 */ be_nested_str_weak(auth),
+ /* K5 */ be_nested_str_weak(fromstring),
+ /* K6 */ be_const_int(1),
+ /* K7 */ be_nested_str_weak(tob64),
+ /* K8 */ be_const_int(2147483647),
+ /* K9 */ be_nested_str_weak(init),
+ /* K10 */ be_nested_str_weak(compile_re),
+ }),
+ be_str_weak(init),
+ &be_const_str_solidified,
+ ( &(const binstruction[36]) { /* code */
+ 0xA4160000, // 0000 IMPORT R5 K0
+ 0x60180008, // 0001 GETGBL R6 G8
+ 0x5C1C0200, // 0002 MOVE R7 R1
+ 0x7C180200, // 0003 CALL R6 1
+ 0x5C040C00, // 0004 MOVE R1 R6
+ 0x8C180B01, // 0005 GETMET R6 R5 K1
+ 0x5C200200, // 0006 MOVE R8 R1
+ 0x58240002, // 0007 LDCONST R9 K2
+ 0x7C180600, // 0008 CALL R6 3
+ 0x281C0D03, // 0009 GE R7 R6 K3
+ 0x781E000C, // 000A JMPF R7 #0018
+ 0x601C0015, // 000B GETGBL R7 G21
+ 0x7C1C0000, // 000C CALL R7 0
+ 0x8C1C0F05, // 000D GETMET R7 R7 K5
+ 0x04240D06, // 000E SUB R9 R6 K6
+ 0x40260609, // 000F CONNECT R9 K3 R9
+ 0x94240209, // 0010 GETIDX R9 R1 R9
+ 0x7C1C0400, // 0011 CALL R7 2
+ 0x8C1C0F07, // 0012 GETMET R7 R7 K7
+ 0x7C1C0200, // 0013 CALL R7 1
+ 0x90020807, // 0014 SETMBR R0 K4 R7
+ 0x001C0D06, // 0015 ADD R7 R6 K6
+ 0x401C0F08, // 0016 CONNECT R7 R7 K8
+ 0x94040207, // 0017 GETIDX R1 R1 R7
+ 0x601C0003, // 0018 GETGBL R7 G3
+ 0x5C200000, // 0019 MOVE R8 R0
+ 0x7C1C0200, // 001A CALL R7 1
+ 0x8C1C0F09, // 001B GETMET R7 R7 K9
+ 0x5C240200, // 001C MOVE R9 R1
+ 0x5C280400, // 001D MOVE R10 R2
+ 0x5C2C0600, // 001E MOVE R11 R3
+ 0x5C300800, // 001F MOVE R12 R4
+ 0x7C1C0A00, // 0020 CALL R7 5
+ 0x8C1C010A, // 0021 GETMET R7 R0 K10
+ 0x7C1C0200, // 0022 CALL R7 1
+ 0x80000000, // 0023 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: event_http_failed
+********************************************************************/
+be_local_closure(Matter_HTTP_async_event_http_failed, /* name */
+ be_nested_proto(
+ 1, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 0, /* has constants */
+ NULL, /* no const */
+ be_str_weak(event_http_failed),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 1]) { /* code */
+ 0x80000000, // 0000 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: parse_http_response
+********************************************************************/
+be_local_closure(Matter_HTTP_async_parse_http_response, /* name */
be_nested_proto(
3, /* nstack */
1, /* argc */
@@ -708,15 +308,36 @@ be_local_closure(Matter_HTTP_async_event_established, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(send_http),
+ ( &(const bvalue[ 7]) { /* constants */
+ /* K0 */ be_nested_str_weak(phase),
+ /* K1 */ be_const_int(0),
+ /* K2 */ be_nested_str_weak(parse_http_status_line),
+ /* K3 */ be_const_int(1),
+ /* K4 */ be_nested_str_weak(parse_http_headers),
+ /* K5 */ be_const_int(2),
+ /* K6 */ be_nested_str_weak(parse_http_payload),
}),
- be_str_weak(event_established),
+ be_str_weak(parse_http_response),
&be_const_str_solidified,
- ( &(const binstruction[ 3]) { /* code */
- 0x8C040100, // 0000 GETMET R1 R0 K0
- 0x7C040200, // 0001 CALL R1 1
- 0x80000000, // 0002 RET 0
+ ( &(const binstruction[18]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x1C040301, // 0001 EQ R1 R1 K1
+ 0x78060002, // 0002 JMPF R1 #0006
+ 0x8C040102, // 0003 GETMET R1 R0 K2
+ 0x7C040200, // 0004 CALL R1 1
+ 0x7002000A, // 0005 JMP #0011
+ 0x88040100, // 0006 GETMBR R1 R0 K0
+ 0x1C040303, // 0007 EQ R1 R1 K3
+ 0x78060002, // 0008 JMPF R1 #000C
+ 0x8C040104, // 0009 GETMET R1 R0 K4
+ 0x7C040200, // 000A CALL R1 1
+ 0x70020004, // 000B JMP #0011
+ 0x88040100, // 000C GETMBR R1 R0 K0
+ 0x1C040305, // 000D EQ R1 R1 K5
+ 0x78060001, // 000E JMPF R1 #0011
+ 0x8C040106, // 000F GETMET R1 R0 K6
+ 0x7C040200, // 0010 CALL R1 1
+ 0x80000000, // 0011 RET 0
})
)
);
@@ -755,9 +376,9 @@ be_local_closure(Matter_HTTP_async_event_refused, /* name */
/********************************************************************
-** Solidified function: event_closed
+** Solidified function: reset
********************************************************************/
-be_local_closure(Matter_HTTP_async_event_closed, /* name */
+be_local_closure(Matter_HTTP_async_reset, /* name */
be_nested_proto(
3, /* nstack */
1, /* argc */
@@ -767,22 +388,40 @@ be_local_closure(Matter_HTTP_async_event_closed, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_nested_str_weak(http_status),
- /* K1 */ be_const_int(0),
- /* K2 */ be_const_int(1),
- /* K3 */ be_nested_str_weak(event_http_finished),
+ ( &(const bvalue[11]) { /* constants */
+ /* K0 */ be_nested_str_weak(reset),
+ /* K1 */ be_nested_str_weak(cmd),
+ /* K2 */ be_nested_str_weak(response),
+ /* K3 */ be_nested_str_weak(response_offset),
+ /* K4 */ be_const_int(0),
+ /* K5 */ be_nested_str_weak(payload),
+ /* K6 */ be_nested_str_weak(),
+ /* K7 */ be_nested_str_weak(phase),
+ /* K8 */ be_nested_str_weak(http_status),
+ /* K9 */ be_nested_str_weak(is_chunked),
+ /* K10 */ be_nested_str_weak(chunk_size),
}),
- be_str_weak(event_closed),
+ be_str_weak(reset),
&be_const_str_solidified,
- ( &(const binstruction[ 7]) { /* code */
- 0x88040100, // 0000 GETMBR R1 R0 K0
- 0x1C040301, // 0001 EQ R1 R1 K1
- 0x78060002, // 0002 JMPF R1 #0006
- 0x90020102, // 0003 SETMBR R0 K0 K2
- 0x8C040103, // 0004 GETMET R1 R0 K3
- 0x7C040200, // 0005 CALL R1 1
- 0x80000000, // 0006 RET 0
+ ( &(const binstruction[18]) { /* code */
+ 0x60040003, // 0000 GETGBL R1 G3
+ 0x5C080000, // 0001 MOVE R2 R0
+ 0x7C040200, // 0002 CALL R1 1
+ 0x8C040300, // 0003 GETMET R1 R1 K0
+ 0x7C040200, // 0004 CALL R1 1
+ 0x4C040000, // 0005 LDNIL R1
+ 0x90020201, // 0006 SETMBR R0 K1 R1
+ 0x4C040000, // 0007 LDNIL R1
+ 0x90020401, // 0008 SETMBR R0 K2 R1
+ 0x90020704, // 0009 SETMBR R0 K3 K4
+ 0x90020B06, // 000A SETMBR R0 K5 K6
+ 0x90020F04, // 000B SETMBR R0 K7 K4
+ 0x90021104, // 000C SETMBR R0 K8 K4
+ 0x50040000, // 000D LDBOOL R1 0 0
+ 0x90021201, // 000E SETMBR R0 K9 R1
+ 0x4C040000, // 000F LDNIL R1
+ 0x90021401, // 0010 SETMBR R0 K10 R1
+ 0x80000000, // 0011 RET 0
})
)
);
@@ -790,11 +429,44 @@ be_local_closure(Matter_HTTP_async_event_closed, /* name */
/********************************************************************
-** Solidified function: parse_http_status_line
+** Solidified function: begin
********************************************************************/
-be_local_closure(Matter_HTTP_async_parse_http_status_line, /* name */
+be_local_closure(Matter_HTTP_async_begin, /* name */
be_nested_proto(
- 5, /* nstack */
+ 4, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(begin),
+ /* K1 */ be_nested_str_weak(cmd),
+ }),
+ be_str_weak(begin),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 7]) { /* code */
+ 0x60080003, // 0000 GETGBL R2 G3
+ 0x5C0C0000, // 0001 MOVE R3 R0
+ 0x7C080200, // 0002 CALL R2 1
+ 0x8C080500, // 0003 GETMET R2 R2 K0
+ 0x7C080200, // 0004 CALL R2 1
+ 0x90020201, // 0005 SETMBR R0 K1 R1
+ 0x80040400, // 0006 RET 1 R2
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: event_established
+********************************************************************/
+be_local_closure(Matter_HTTP_async_event_established, /* name */
+ be_nested_proto(
+ 3, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
@@ -802,51 +474,15 @@ be_local_closure(Matter_HTTP_async_parse_http_status_line, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[12]) { /* constants */
- /* K0 */ be_nested_str_weak(global),
- /* K1 */ be_nested_str_weak(_re_http_status),
- /* K2 */ be_nested_str_weak(match2),
- /* K3 */ be_nested_str_weak(response),
- /* K4 */ be_nested_str_weak(response_offset),
- /* K5 */ be_const_int(0),
- /* K6 */ be_nested_str_weak(status_code),
- /* K7 */ be_const_int(1),
- /* K8 */ be_nested_str_weak(phase),
- /* K9 */ be_nested_str_weak(parse_http_headers),
- /* K10 */ be_nested_str_weak(close),
- /* K11 */ be_nested_str_weak(status),
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(send_http),
}),
- be_str_weak(parse_http_status_line),
+ be_str_weak(event_established),
&be_const_str_solidified,
- ( &(const binstruction[28]) { /* code */
- 0xB8060000, // 0000 GETNGBL R1 K0
- 0x88040301, // 0001 GETMBR R1 R1 K1
- 0x8C040302, // 0002 GETMET R1 R1 K2
- 0x880C0103, // 0003 GETMBR R3 R0 K3
- 0x88100104, // 0004 GETMBR R4 R0 K4
- 0x7C040600, // 0005 CALL R1 3
- 0x78060009, // 0006 JMPF R1 #0011
- 0x94080305, // 0007 GETIDX R2 R1 K5
- 0x90020802, // 0008 SETMBR R0 K4 R2
- 0x60080009, // 0009 GETGBL R2 G9
- 0x940C0307, // 000A GETIDX R3 R1 K7
- 0x7C080200, // 000B CALL R2 1
- 0x90020C02, // 000C SETMBR R0 K6 R2
- 0x90021107, // 000D SETMBR R0 K8 K7
- 0x8C080109, // 000E GETMET R2 R0 K9
- 0x7C080200, // 000F CALL R2 1
- 0x70020009, // 0010 JMP #001B
- 0x6008000C, // 0011 GETGBL R2 G12
- 0x880C0103, // 0012 GETMBR R3 R0 K3
- 0x7C080200, // 0013 CALL R2 1
- 0x540E0063, // 0014 LDINT R3 100
- 0x24080403, // 0015 GT R2 R2 R3
- 0x780A0003, // 0016 JMPF R2 #001B
- 0x8C08010A, // 0017 GETMET R2 R0 K10
- 0x7C080200, // 0018 CALL R2 1
- 0x5409FFFB, // 0019 LDINT R2 -4
- 0x90021602, // 001A SETMBR R0 K11 R2
- 0x80000000, // 001B RET 0
+ ( &(const binstruction[ 3]) { /* code */
+ 0x8C040100, // 0000 GETMET R1 R0 K0
+ 0x7C040200, // 0001 CALL R1 1
+ 0x80000000, // 0002 RET 0
})
)
);
@@ -942,23 +578,316 @@ be_local_closure(Matter_HTTP_async_parse_http_headers, /* name */
/********************************************************************
-** Solidified function: event_http_timeout
+** Solidified function: event_available
********************************************************************/
-be_local_closure(Matter_HTTP_async_event_http_timeout, /* name */
+be_local_closure(Matter_HTTP_async_event_available, /* name */
be_nested_proto(
- 1, /* nstack */
+ 3, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
- 0, /* has constants */
- NULL, /* no const */
- be_str_weak(event_http_timeout),
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(receive),
+ }),
+ be_str_weak(event_available),
&be_const_str_solidified,
- ( &(const binstruction[ 1]) { /* code */
- 0x80000000, // 0000 RET 0
+ ( &(const binstruction[ 3]) { /* code */
+ 0x8C040100, // 0000 GETMET R1 R0 K0
+ 0x7C040200, // 0001 CALL R1 1
+ 0x80000000, // 0002 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: event_timeout
+********************************************************************/
+be_local_closure(Matter_HTTP_async_event_timeout, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(http_status),
+ /* K1 */ be_nested_str_weak(event_http_timeout),
+ }),
+ be_str_weak(event_timeout),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 5]) { /* code */
+ 0x5405FFFD, // 0000 LDINT R1 -2
+ 0x90020001, // 0001 SETMBR R0 K0 R1
+ 0x8C040101, // 0002 GETMET R1 R0 K1
+ 0x7C040200, // 0003 CALL R1 1
+ 0x80000000, // 0004 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: compile_re
+********************************************************************/
+be_local_closure(Matter_HTTP_async_compile_re, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[12]) { /* constants */
+ /* K0 */ be_nested_str_weak(re),
+ /* K1 */ be_nested_str_weak(global),
+ /* K2 */ be_nested_str_weak(contains),
+ /* K3 */ be_nested_str_weak(_re_http_status),
+ /* K4 */ be_nested_str_weak(compile),
+ /* K5 */ be_nested_str_weak(HTTP_STATUS_REGEX),
+ /* K6 */ be_nested_str_weak(_re_http_header),
+ /* K7 */ be_nested_str_weak(HTTP_HEADER_REGEX),
+ /* K8 */ be_nested_str_weak(_re_http_body),
+ /* K9 */ be_nested_str_weak(HTTP_BODY_REGEX),
+ /* K10 */ be_nested_str_weak(_re_http_chunk),
+ /* K11 */ be_nested_str_weak(HTTP_CHUNK_REGEX),
+ }),
+ be_str_weak(compile_re),
+ &be_const_str_solidified,
+ ( &(const binstruction[27]) { /* code */
+ 0xA4060000, // 0000 IMPORT R1 K0
+ 0xB80A0200, // 0001 GETNGBL R2 K1
+ 0x8C080502, // 0002 GETMET R2 R2 K2
+ 0x58100003, // 0003 LDCONST R4 K3
+ 0x7C080400, // 0004 CALL R2 2
+ 0x740A0013, // 0005 JMPT R2 #001A
+ 0xB80A0200, // 0006 GETNGBL R2 K1
+ 0x8C0C0304, // 0007 GETMET R3 R1 K4
+ 0x88140105, // 0008 GETMBR R5 R0 K5
+ 0x7C0C0400, // 0009 CALL R3 2
+ 0x900A0603, // 000A SETMBR R2 K3 R3
+ 0xB80A0200, // 000B GETNGBL R2 K1
+ 0x8C0C0304, // 000C GETMET R3 R1 K4
+ 0x88140107, // 000D GETMBR R5 R0 K7
+ 0x7C0C0400, // 000E CALL R3 2
+ 0x900A0C03, // 000F SETMBR R2 K6 R3
+ 0xB80A0200, // 0010 GETNGBL R2 K1
+ 0x8C0C0304, // 0011 GETMET R3 R1 K4
+ 0x88140109, // 0012 GETMBR R5 R0 K9
+ 0x7C0C0400, // 0013 CALL R3 2
+ 0x900A1003, // 0014 SETMBR R2 K8 R3
+ 0xB80A0200, // 0015 GETNGBL R2 K1
+ 0x8C0C0304, // 0016 GETMET R3 R1 K4
+ 0x8814010B, // 0017 GETMBR R5 R0 K11
+ 0x7C0C0400, // 0018 CALL R3 2
+ 0x900A1403, // 0019 SETMBR R2 K10 R3
+ 0x80000000, // 001A RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: event_closed
+********************************************************************/
+be_local_closure(Matter_HTTP_async_event_closed, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(http_status),
+ /* K1 */ be_const_int(0),
+ /* K2 */ be_const_int(1),
+ /* K3 */ be_nested_str_weak(event_http_finished),
+ }),
+ be_str_weak(event_closed),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 7]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x1C040301, // 0001 EQ R1 R1 K1
+ 0x78060002, // 0002 JMPF R1 #0006
+ 0x90020102, // 0003 SETMBR R0 K0 K2
+ 0x8C040103, // 0004 GETMET R1 R0 K3
+ 0x7C040200, // 0005 CALL R1 1
+ 0x80000000, // 0006 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: begin_sync
+********************************************************************/
+be_local_closure(Matter_HTTP_async_begin_sync, /* name */
+ be_nested_proto(
+ 10, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[10]) { /* constants */
+ /* K0 */ be_nested_str_weak(timeout),
+ /* K1 */ be_nested_str_weak(set_timeout),
+ /* K2 */ be_nested_str_weak(SPINLOCK),
+ /* K3 */ be_nested_str_weak(begin),
+ /* K4 */ be_nested_str_weak(http_status),
+ /* K5 */ be_const_int(0),
+ /* K6 */ be_nested_str_weak(loop),
+ /* K7 */ be_nested_str_weak(tasmota),
+ /* K8 */ be_nested_str_weak(delay),
+ /* K9 */ be_nested_str_weak(payload),
+ }),
+ be_str_weak(begin_sync),
+ &be_const_str_solidified,
+ ( &(const binstruction[33]) { /* code */
+ 0x880C0100, // 0000 GETMBR R3 R0 K0
+ 0x4C100000, // 0001 LDNIL R4
+ 0x20100404, // 0002 NE R4 R2 R4
+ 0x78120002, // 0003 JMPF R4 #0007
+ 0x8C100101, // 0004 GETMET R4 R0 K1
+ 0x5C180400, // 0005 MOVE R6 R2
+ 0x7C100400, // 0006 CALL R4 2
+ 0x4C100000, // 0007 LDNIL R4
+ 0x88140102, // 0008 GETMBR R5 R0 K2
+ 0x8C180103, // 0009 GETMET R6 R0 K3
+ 0x5C200200, // 000A MOVE R8 R1
+ 0x7C180400, // 000B CALL R6 2
+ 0x781A0009, // 000C JMPF R6 #0017
+ 0x881C0104, // 000D GETMBR R7 R0 K4
+ 0x1C1C0F05, // 000E EQ R7 R7 K5
+ 0x781E0006, // 000F JMPF R7 #0017
+ 0x8C1C0106, // 0010 GETMET R7 R0 K6
+ 0x7C1C0200, // 0011 CALL R7 1
+ 0xB81E0E00, // 0012 GETNGBL R7 K7
+ 0x8C1C0F08, // 0013 GETMET R7 R7 K8
+ 0x5C240A00, // 0014 MOVE R9 R5
+ 0x7C1C0400, // 0015 CALL R7 2
+ 0x7001FFF5, // 0016 JMP #000D
+ 0x8C1C0101, // 0017 GETMET R7 R0 K1
+ 0x5C240600, // 0018 MOVE R9 R3
+ 0x7C1C0400, // 0019 CALL R7 2
+ 0x881C0104, // 001A GETMBR R7 R0 K4
+ 0x241C0F05, // 001B GT R7 R7 K5
+ 0x781E0001, // 001C JMPF R7 #001F
+ 0x881C0109, // 001D GETMBR R7 R0 K9
+ 0x70020000, // 001E JMP #0020
+ 0x4C1C0000, // 001F LDNIL R7
+ 0x80040E00, // 0020 RET 1 R7
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: send_http
+********************************************************************/
+be_local_closure(Matter_HTTP_async_send_http, /* name */
+ be_nested_proto(
+ 10, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[19]) { /* constants */
+ /* K0 */ be_nested_str_weak(string),
+ /* K1 */ be_nested_str_weak(response),
+ /* K2 */ be_nested_str_weak(),
+ /* K3 */ be_nested_str_weak(addr),
+ /* K4 */ be_nested_str_weak(find),
+ /* K5 */ be_nested_str_weak(_X3A),
+ /* K6 */ be_const_int(0),
+ /* K7 */ be_nested_str_weak(_X5B),
+ /* K8 */ be_nested_str_weak(_X5D),
+ /* K9 */ be_nested_str_weak(auth),
+ /* K10 */ be_nested_str_weak(HTTP_GET),
+ /* K11 */ be_nested_str_weak(cmd),
+ /* K12 */ be_nested_str_weak(port),
+ /* K13 */ be_nested_str_weak(HTTP_GET_AUTH),
+ /* K14 */ be_nested_str_weak(write),
+ /* K15 */ be_nested_str_weak(close),
+ /* K16 */ be_nested_str_weak(status),
+ /* K17 */ be_nested_str_weak(http_status),
+ /* K18 */ be_nested_str_weak(event_http_failed),
+ }),
+ be_str_weak(send_http),
+ &be_const_str_solidified,
+ ( &(const binstruction[50]) { /* code */
+ 0xA4060000, // 0000 IMPORT R1 K0
+ 0x90020302, // 0001 SETMBR R0 K1 K2
+ 0x88080103, // 0002 GETMBR R2 R0 K3
+ 0x8C0C0304, // 0003 GETMET R3 R1 K4
+ 0x5C140400, // 0004 MOVE R5 R2
+ 0x58180005, // 0005 LDCONST R6 K5
+ 0x7C0C0600, // 0006 CALL R3 3
+ 0x280C0706, // 0007 GE R3 R3 K6
+ 0x780E0002, // 0008 JMPF R3 #000C
+ 0x000E0E02, // 0009 ADD R3 K7 R2
+ 0x000C0708, // 000A ADD R3 R3 K8
+ 0x5C080600, // 000B MOVE R2 R3
+ 0x4C0C0000, // 000C LDNIL R3
+ 0x88100109, // 000D GETMBR R4 R0 K9
+ 0x4C140000, // 000E LDNIL R5
+ 0x1C100805, // 000F EQ R4 R4 R5
+ 0x78120007, // 0010 JMPF R4 #0019
+ 0x60100018, // 0011 GETGBL R4 G24
+ 0x8814010A, // 0012 GETMBR R5 R0 K10
+ 0x8818010B, // 0013 GETMBR R6 R0 K11
+ 0x5C1C0400, // 0014 MOVE R7 R2
+ 0x8820010C, // 0015 GETMBR R8 R0 K12
+ 0x7C100800, // 0016 CALL R4 4
+ 0x5C0C0800, // 0017 MOVE R3 R4
+ 0x70020007, // 0018 JMP #0021
+ 0x60100018, // 0019 GETGBL R4 G24
+ 0x8814010D, // 001A GETMBR R5 R0 K13
+ 0x8818010B, // 001B GETMBR R6 R0 K11
+ 0x5C1C0400, // 001C MOVE R7 R2
+ 0x8820010C, // 001D GETMBR R8 R0 K12
+ 0x88240109, // 001E GETMBR R9 R0 K9
+ 0x7C100A00, // 001F CALL R4 5
+ 0x5C0C0800, // 0020 MOVE R3 R4
+ 0x8C10010E, // 0021 GETMET R4 R0 K14
+ 0x5C180600, // 0022 MOVE R6 R3
+ 0x7C100400, // 0023 CALL R4 2
+ 0x6014000C, // 0024 GETGBL R5 G12
+ 0x5C180600, // 0025 MOVE R6 R3
+ 0x7C140200, // 0026 CALL R5 1
+ 0x20140805, // 0027 NE R5 R4 R5
+ 0x78160007, // 0028 JMPF R5 #0031
+ 0x8C14010F, // 0029 GETMET R5 R0 K15
+ 0x7C140200, // 002A CALL R5 1
+ 0x5415FFFB, // 002B LDINT R5 -4
+ 0x90022005, // 002C SETMBR R0 K16 R5
+ 0x5415FFFE, // 002D LDINT R5 -1
+ 0x90022205, // 002E SETMBR R0 K17 R5
+ 0x8C140112, // 002F GETMET R5 R0 K18
+ 0x7C140200, // 0030 CALL R5 1
+ 0x80000000, // 0031 RET 0
})
)
);
@@ -1004,11 +933,11 @@ be_local_closure(Matter_HTTP_async_event_http_headers_end, /* name */
/********************************************************************
-** Solidified function: event_http_header
+** Solidified function: event_http_status_code
********************************************************************/
-be_local_closure(Matter_HTTP_async_event_http_header, /* name */
+be_local_closure(Matter_HTTP_async_event_http_status_code, /* name */
be_nested_proto(
- 7, /* nstack */
+ 3, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
@@ -1016,35 +945,14 @@ be_local_closure(Matter_HTTP_async_event_http_header, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 5]) { /* constants */
- /* K0 */ be_nested_str_weak(string),
- /* K1 */ be_nested_str_weak(tolower),
- /* K2 */ be_nested_str_weak(transfer_X2Dencoding),
- /* K3 */ be_nested_str_weak(chunked),
- /* K4 */ be_nested_str_weak(is_chunked),
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(status_code),
}),
- be_str_weak(event_http_header),
+ be_str_weak(event_http_status_code),
&be_const_str_solidified,
- ( &(const binstruction[19]) { /* code */
- 0xA40E0000, // 0000 IMPORT R3 K0
- 0x8C100701, // 0001 GETMET R4 R3 K1
- 0x5C180200, // 0002 MOVE R6 R1
- 0x7C100400, // 0003 CALL R4 2
- 0x5C040800, // 0004 MOVE R1 R4
- 0x8C100701, // 0005 GETMET R4 R3 K1
- 0x5C180400, // 0006 MOVE R6 R2
- 0x7C100400, // 0007 CALL R4 2
- 0x5C080800, // 0008 MOVE R2 R4
- 0x1C100302, // 0009 EQ R4 R1 K2
- 0x78120006, // 000A JMPF R4 #0012
- 0x8C100701, // 000B GETMET R4 R3 K1
- 0x5C180400, // 000C MOVE R6 R2
- 0x7C100400, // 000D CALL R4 2
- 0x1C100903, // 000E EQ R4 R4 K3
- 0x78120001, // 000F JMPF R4 #0012
- 0x50100200, // 0010 LDBOOL R4 1 0
- 0x90020804, // 0011 SETMBR R0 K4 R4
- 0x80000000, // 0012 RET 0
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
})
)
);
@@ -1052,32 +960,174 @@ be_local_closure(Matter_HTTP_async_event_http_header, /* name */
/********************************************************************
-** Solidified function: begin
+** Solidified function: parse_http_status_line
********************************************************************/
-be_local_closure(Matter_HTTP_async_begin, /* name */
+be_local_closure(Matter_HTTP_async_parse_http_status_line, /* name */
be_nested_proto(
- 4, /* nstack */
- 2, /* argc */
+ 5, /* nstack */
+ 1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(begin),
- /* K1 */ be_nested_str_weak(cmd),
+ ( &(const bvalue[12]) { /* constants */
+ /* K0 */ be_nested_str_weak(global),
+ /* K1 */ be_nested_str_weak(_re_http_status),
+ /* K2 */ be_nested_str_weak(match2),
+ /* K3 */ be_nested_str_weak(response),
+ /* K4 */ be_nested_str_weak(response_offset),
+ /* K5 */ be_const_int(0),
+ /* K6 */ be_nested_str_weak(status_code),
+ /* K7 */ be_const_int(1),
+ /* K8 */ be_nested_str_weak(phase),
+ /* K9 */ be_nested_str_weak(parse_http_headers),
+ /* K10 */ be_nested_str_weak(close),
+ /* K11 */ be_nested_str_weak(status),
}),
- be_str_weak(begin),
+ be_str_weak(parse_http_status_line),
&be_const_str_solidified,
- ( &(const binstruction[ 7]) { /* code */
- 0x60080003, // 0000 GETGBL R2 G3
- 0x5C0C0000, // 0001 MOVE R3 R0
- 0x7C080200, // 0002 CALL R2 1
- 0x8C080500, // 0003 GETMET R2 R2 K0
- 0x7C080200, // 0004 CALL R2 1
- 0x90020201, // 0005 SETMBR R0 K1 R1
- 0x80040400, // 0006 RET 1 R2
+ ( &(const binstruction[28]) { /* code */
+ 0xB8060000, // 0000 GETNGBL R1 K0
+ 0x88040301, // 0001 GETMBR R1 R1 K1
+ 0x8C040302, // 0002 GETMET R1 R1 K2
+ 0x880C0103, // 0003 GETMBR R3 R0 K3
+ 0x88100104, // 0004 GETMBR R4 R0 K4
+ 0x7C040600, // 0005 CALL R1 3
+ 0x78060009, // 0006 JMPF R1 #0011
+ 0x94080305, // 0007 GETIDX R2 R1 K5
+ 0x90020802, // 0008 SETMBR R0 K4 R2
+ 0x60080009, // 0009 GETGBL R2 G9
+ 0x940C0307, // 000A GETIDX R3 R1 K7
+ 0x7C080200, // 000B CALL R2 1
+ 0x90020C02, // 000C SETMBR R0 K6 R2
+ 0x90021107, // 000D SETMBR R0 K8 K7
+ 0x8C080109, // 000E GETMET R2 R0 K9
+ 0x7C080200, // 000F CALL R2 1
+ 0x70020009, // 0010 JMP #001B
+ 0x6008000C, // 0011 GETGBL R2 G12
+ 0x880C0103, // 0012 GETMBR R3 R0 K3
+ 0x7C080200, // 0013 CALL R2 1
+ 0x540E0063, // 0014 LDINT R3 100
+ 0x24080403, // 0015 GT R2 R2 R3
+ 0x780A0003, // 0016 JMPF R2 #001B
+ 0x8C08010A, // 0017 GETMET R2 R0 K10
+ 0x7C080200, // 0018 CALL R2 1
+ 0x5409FFFB, // 0019 LDINT R2 -4
+ 0x90021602, // 001A SETMBR R0 K11 R2
+ 0x80000000, // 001B RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: event_http_timeout
+********************************************************************/
+be_local_closure(Matter_HTTP_async_event_http_timeout, /* name */
+ be_nested_proto(
+ 1, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 0, /* has constants */
+ NULL, /* no const */
+ be_str_weak(event_http_timeout),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 1]) { /* code */
+ 0x80000000, // 0000 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: receive
+********************************************************************/
+be_local_closure(Matter_HTTP_async_receive, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[15]) { /* constants */
+ /* K0 */ be_nested_str_weak(tcp_connected),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(millis),
+ /* K3 */ be_nested_str_weak(time_start),
+ /* K4 */ be_nested_str_weak(timeout),
+ /* K5 */ be_nested_str_weak(status),
+ /* K6 */ be_nested_str_weak(close),
+ /* K7 */ be_nested_str_weak(http_status),
+ /* K8 */ be_nested_str_weak(event_http_timeout),
+ /* K9 */ be_nested_str_weak(tcp),
+ /* K10 */ be_nested_str_weak(available),
+ /* K11 */ be_const_int(0),
+ /* K12 */ be_nested_str_weak(read),
+ /* K13 */ be_nested_str_weak(response),
+ /* K14 */ be_nested_str_weak(parse_http_response),
+ }),
+ be_str_weak(receive),
+ &be_const_str_solidified,
+ ( &(const binstruction[48]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x50080200, // 0001 LDBOOL R2 1 0
+ 0x20040202, // 0002 NE R1 R1 R2
+ 0x78060000, // 0003 JMPF R1 #0005
+ 0x80000200, // 0004 RET 0
+ 0xB8060200, // 0005 GETNGBL R1 K1
+ 0x8C040302, // 0006 GETMET R1 R1 K2
+ 0x7C040200, // 0007 CALL R1 1
+ 0x88080103, // 0008 GETMBR R2 R0 K3
+ 0x04040202, // 0009 SUB R1 R1 R2
+ 0x88080104, // 000A GETMBR R2 R0 K4
+ 0x24040202, // 000B GT R1 R1 R2
+ 0x78060008, // 000C JMPF R1 #0016
+ 0x5405FFFC, // 000D LDINT R1 -3
+ 0x90020A01, // 000E SETMBR R0 K5 R1
+ 0x8C040106, // 000F GETMET R1 R0 K6
+ 0x7C040200, // 0010 CALL R1 1
+ 0x5405FFFD, // 0011 LDINT R1 -2
+ 0x90020E01, // 0012 SETMBR R0 K7 R1
+ 0x8C040108, // 0013 GETMET R1 R0 K8
+ 0x7C040200, // 0014 CALL R1 1
+ 0x70020018, // 0015 JMP #002F
+ 0x88040109, // 0016 GETMBR R1 R0 K9
+ 0x8C04030A, // 0017 GETMET R1 R1 K10
+ 0x7C040200, // 0018 CALL R1 1
+ 0x5808000B, // 0019 LDCONST R2 K11
+ 0x240C030B, // 001A GT R3 R1 K11
+ 0x780E000E, // 001B JMPF R3 #002B
+ 0x880C0109, // 001C GETMBR R3 R0 K9
+ 0x8C0C070C, // 001D GETMET R3 R3 K12
+ 0x7C0C0200, // 001E CALL R3 1
+ 0x8810010D, // 001F GETMBR R4 R0 K13
+ 0x00100803, // 0020 ADD R4 R4 R3
+ 0x90021A04, // 0021 SETMBR R0 K13 R4
+ 0x6010000C, // 0022 GETGBL R4 G12
+ 0x5C140600, // 0023 MOVE R5 R3
+ 0x7C100200, // 0024 CALL R4 1
+ 0x00080404, // 0025 ADD R2 R2 R4
+ 0x88100109, // 0026 GETMBR R4 R0 K9
+ 0x8C10090A, // 0027 GETMET R4 R4 K10
+ 0x7C100200, // 0028 CALL R4 1
+ 0x5C040800, // 0029 MOVE R1 R4
+ 0x7001FFEE, // 002A JMP #001A
+ 0x240C050B, // 002B GT R3 R2 K11
+ 0x780E0001, // 002C JMPF R3 #002F
+ 0x8C0C010E, // 002D GETMET R3 R0 K14
+ 0x7C0C0200, // 002E CALL R3 1
+ 0x80000000, // 002F RET 0
})
)
);
@@ -1089,47 +1139,49 @@ be_local_closure(Matter_HTTP_async_begin, /* name */
********************************************************************/
extern const bclass be_class_Matter_TCP_async;
be_local_class(Matter_HTTP_async,
- 9,
+ 10,
&be_class_Matter_TCP_async,
- be_nested_map(37,
+ be_nested_map(39,
( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(init, 2), be_const_closure(Matter_HTTP_async_init_closure) },
- { be_const_key_weak(response, 28), be_const_var(1) },
- { be_const_key_weak(http_status, -1), be_const_var(5) },
- { be_const_key_weak(HTTP_STATUS_REGEX, 14), be_nested_str_weak(HTTP_X2F1_X5C_X2E_X5B0_X2D1_X5D_X20_X28_X5Cd_X2B_X29_X20_X2E_X2A_X3F_X0D_X0A) },
- { be_const_key_weak(HTTP_GET, 8), be_nested_str_weak(GET_X20_X25s_X20HTTP_X2F1_X2E1_X0D_X0AHost_X20_X25s_X3A_X25s_X0D_X0AConnection_X3A_X20close_X0D_X0A_X0D_X0A) },
- { be_const_key_weak(response_offset, -1), be_const_var(2) },
- { be_const_key_weak(compile_re, -1), be_const_closure(Matter_HTTP_async_compile_re_closure) },
- { be_const_key_weak(event_http_header, -1), be_const_closure(Matter_HTTP_async_event_http_header_closure) },
- { be_const_key_weak(event_http_status_code, -1), be_const_closure(Matter_HTTP_async_event_http_status_code_closure) },
- { be_const_key_weak(payload, -1), be_const_var(4) },
- { be_const_key_weak(event_available, -1), be_const_closure(Matter_HTTP_async_event_available_closure) },
- { be_const_key_weak(chunk_size, 16), be_const_var(8) },
- { be_const_key_weak(event_http_timeout, -1), be_const_closure(Matter_HTTP_async_event_http_timeout_closure) },
+ { be_const_key_weak(response, -1), be_const_var(2) },
{ be_const_key_weak(parse_http_payload, -1), be_const_closure(Matter_HTTP_async_parse_http_payload_closure) },
- { be_const_key_weak(parse_http_status_line, 29), be_const_closure(Matter_HTTP_async_parse_http_status_line_closure) },
- { be_const_key_weak(begin_sync, -1), be_const_closure(Matter_HTTP_async_begin_sync_closure) },
- { be_const_key_weak(cmd, -1), be_const_var(0) },
- { be_const_key_weak(event_http_failed, 13), be_const_closure(Matter_HTTP_async_event_http_failed_closure) },
- { be_const_key_weak(SPINLOCK, -1), be_const_int(5) },
- { be_const_key_weak(reset, 31), be_const_closure(Matter_HTTP_async_reset_closure) },
- { be_const_key_weak(send_http, -1), be_const_closure(Matter_HTTP_async_send_http_closure) },
- { be_const_key_weak(parse_http_response, 15), be_const_closure(Matter_HTTP_async_parse_http_response_closure) },
- { be_const_key_weak(event_http_finished, -1), be_const_closure(Matter_HTTP_async_event_http_finished_closure) },
+ { be_const_key_weak(receive, 10), be_const_closure(Matter_HTTP_async_receive_closure) },
+ { be_const_key_weak(event_http_finished, 22), be_const_closure(Matter_HTTP_async_event_http_finished_closure) },
{ be_const_key_weak(HTTP_BODY_REGEX, -1), be_nested_str_weak(_X0D_X0A) },
+ { be_const_key_weak(HTTP_GET_AUTH, -1), be_nested_str_weak(GET_X20_X25s_X20HTTP_X2F1_X2E1_X0D_X0AHost_X20_X25s_X3A_X25s_X0D_X0AAuthorization_X3A_X20Basic_X20_X25s_X0D_X0AConnection_X3A_X20close_X0D_X0A_X0D_X0A) },
+ { be_const_key_weak(init, -1), be_const_closure(Matter_HTTP_async_init_closure) },
+ { be_const_key_weak(response_offset, 23), be_const_var(3) },
+ { be_const_key_weak(parse_http_response, -1), be_const_closure(Matter_HTTP_async_parse_http_response_closure) },
{ be_const_key_weak(event_refused, -1), be_const_closure(Matter_HTTP_async_event_refused_closure) },
- { be_const_key_weak(HTTP_HEADER_REGEX, -1), be_nested_str_weak(_X28_X5BA_X2DZa_X2Dz0_X2D9_X2D_X5D_X2B_X29_X3A_X20_X28_X2E_X2A_X3F_X29_X0D_X0A) },
- { be_const_key_weak(is_chunked, 25), be_const_var(7) },
- { be_const_key_weak(event_established, 24), be_const_closure(Matter_HTTP_async_event_established_closure) },
- { be_const_key_weak(HTTP_CHUNK_REGEX, -1), be_nested_str_weak(_X0D_X0A_X28_X5BA_X2DFa_X2Df0_X2D9_X5D_X2B_X29_X5B_X20_X09_X5D_X2A_X2E_X2A_X3F_X0D_X0A) },
- { be_const_key_weak(receive, -1), be_const_closure(Matter_HTTP_async_receive_closure) },
- { be_const_key_weak(event_closed, -1), be_const_closure(Matter_HTTP_async_event_closed_closure) },
- { be_const_key_weak(phase, -1), be_const_var(6) },
- { be_const_key_weak(parse_http_headers, -1), be_const_closure(Matter_HTTP_async_parse_http_headers_closure) },
- { be_const_key_weak(event_timeout, 12), be_const_closure(Matter_HTTP_async_event_timeout_closure) },
+ { be_const_key_weak(event_http_timeout, -1), be_const_closure(Matter_HTTP_async_event_http_timeout_closure) },
+ { be_const_key_weak(HTTP_STATUS_REGEX, -1), be_nested_str_weak(HTTP_X2F1_X5C_X2E_X5B0_X2D1_X5D_X20_X28_X5Cd_X2B_X29_X20_X2E_X2A_X3F_X0D_X0A) },
+ { be_const_key_weak(cmd, -1), be_const_var(1) },
+ { be_const_key_weak(event_http_status_code, -1), be_const_closure(Matter_HTTP_async_event_http_status_code_closure) },
+ { be_const_key_weak(payload, -1), be_const_var(5) },
+ { be_const_key_weak(is_chunked, -1), be_const_var(8) },
+ { be_const_key_weak(HTTP_GET, -1), be_nested_str_weak(GET_X20_X25s_X20HTTP_X2F1_X2E1_X0D_X0AHost_X20_X25s_X3A_X25s_X0D_X0AConnection_X3A_X20close_X0D_X0A_X0D_X0A) },
+ { be_const_key_weak(chunk_size, 16), be_const_var(9) },
+ { be_const_key_weak(auth, 35), be_const_var(0) },
+ { be_const_key_weak(parse_http_headers, 26), be_const_closure(Matter_HTTP_async_parse_http_headers_closure) },
+ { be_const_key_weak(event_available, -1), be_const_closure(Matter_HTTP_async_event_available_closure) },
+ { be_const_key_weak(status_code, 11), be_const_var(4) },
+ { be_const_key_weak(phase, 36), be_const_var(7) },
{ be_const_key_weak(event_http_headers_end, -1), be_const_closure(Matter_HTTP_async_event_http_headers_end_closure) },
- { be_const_key_weak(status_code, 7), be_const_var(3) },
- { be_const_key_weak(begin, -1), be_const_closure(Matter_HTTP_async_begin_closure) },
+ { be_const_key_weak(reset, 31), be_const_closure(Matter_HTTP_async_reset_closure) },
+ { be_const_key_weak(begin_sync, -1), be_const_closure(Matter_HTTP_async_begin_sync_closure) },
+ { be_const_key_weak(send_http, -1), be_const_closure(Matter_HTTP_async_send_http_closure) },
+ { be_const_key_weak(event_timeout, 28), be_const_closure(Matter_HTTP_async_event_timeout_closure) },
+ { be_const_key_weak(HTTP_CHUNK_REGEX, -1), be_nested_str_weak(_X0D_X0A_X28_X5BA_X2DFa_X2Df0_X2D9_X5D_X2B_X29_X5B_X20_X09_X5D_X2A_X2E_X2A_X3F_X0D_X0A) },
+ { be_const_key_weak(compile_re, 7), be_const_closure(Matter_HTTP_async_compile_re_closure) },
+ { be_const_key_weak(HTTP_HEADER_REGEX, -1), be_nested_str_weak(_X28_X5BA_X2DZa_X2Dz0_X2D9_X2D_X5D_X2B_X29_X3A_X20_X28_X2E_X2A_X3F_X29_X0D_X0A) },
+ { be_const_key_weak(event_closed, 30), be_const_closure(Matter_HTTP_async_event_closed_closure) },
+ { be_const_key_weak(event_http_header, 14), be_const_closure(Matter_HTTP_async_event_http_header_closure) },
+ { be_const_key_weak(event_http_failed, 13), be_const_closure(Matter_HTTP_async_event_http_failed_closure) },
+ { be_const_key_weak(parse_http_status_line, -1), be_const_closure(Matter_HTTP_async_parse_http_status_line_closure) },
+ { be_const_key_weak(event_established, -1), be_const_closure(Matter_HTTP_async_event_established_closure) },
+ { be_const_key_weak(begin, 4), be_const_closure(Matter_HTTP_async_begin_closure) },
+ { be_const_key_weak(http_status, -1), be_const_var(6) },
+ { be_const_key_weak(SPINLOCK, 2), be_const_int(5) },
})),
be_str_weak(Matter_HTTP_async)
);
From 15e181ac53f285da66b26389d593871c9966784d Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Sat, 23 Dec 2023 11:57:01 +0100
Subject: [PATCH 038/303] Update CHANGELOG for Matter remote password
---
CHANGELOG.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a17df4982..c1b85a015 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
- Support for Sonoff Basic R4 Magic Switch (#20247)
- Support for CST816S touch interface (#20213)
- NeoPool hydrolysis FL1 and Redox flag (#20258)
+- Matter support for password for remote Tasmota devices (#20296)
### Breaking Changed
- Refactoring of Berry `animate` module for WS2812 Leds (#20236)
From b4f1aafc4cc10b8f037cdfefe47c2cea4711f70d Mon Sep 17 00:00:00 2001
From: Jason2866 <24528715+Jason2866@users.noreply.github.com>
Date: Sat, 23 Dec 2023 12:18:25 +0100
Subject: [PATCH 039/303] Platform 2023.12.00 (#20298)
---
platformio_tasmota32.ini | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/platformio_tasmota32.ini b/platformio_tasmota32.ini
index a930178d0..13b6f35e6 100644
--- a/platformio_tasmota32.ini
+++ b/platformio_tasmota32.ini
@@ -93,7 +93,7 @@ lib_ignore =
[core32]
-platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.11.01/platform-espressif32.zip
+platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.12.00/platform-espressif32.zip
platform_packages =
build_unflags = ${esp32_defaults.build_unflags}
build_flags = ${esp32_defaults.build_flags}
From a6a8214ea7ca3fef365070f2c806f3aaa3e78f18 Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Sat, 23 Dec 2023 16:13:13 +0100
Subject: [PATCH 040/303] Fix support for Domoticz floor/room topics
Fix support for Domoticz floor/room topics. Regression from v12.0.1 (#20299)
---
CHANGELOG.md | 1 +
RELEASENOTES.md | 2 ++
.../tasmota_xdrv_driver/xdrv_07_domoticz.ino | 20 ++++++++++---------
3 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c1b85a015..2a7795908 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file.
- CVE-2021-36603 Cross Site Scripting (XSS) vulnerability (#12221)
- ESP32 piezo ceramic buzzer doesn't buzz (#20118)
- Syslog server warning caused by lack of field and hostname starting with 'z' (#14689)
+- Support for Domoticz floor/room topics. Regression from v12.0.1 (#20299)
### Removed
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 52c7e1e08..dba6bb153 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -121,6 +121,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- Support for CST816S touch interface [#20213](https://github.com/arendst/Tasmota/issues/20213)
- Support for Sonoff Basic R4 Magic Switch [#20247](https://github.com/arendst/Tasmota/issues/20247)
- NeoPool hydrolysis FL1 and Redox flag [#20258](https://github.com/arendst/Tasmota/issues/20258)
+- Matter support for password for remote Tasmota devices [#20296](https://github.com/arendst/Tasmota/issues/20296)
### Breaking Changed
- Refactoring of Berry `animate` module for WS2812 Leds [#20236](https://github.com/arendst/Tasmota/issues/20236)
@@ -131,6 +132,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
### Fixed
- CVE-2021-36603 Cross Site Scripting (XSS) vulnerability [#12221](https://github.com/arendst/Tasmota/issues/12221)
- Syslog server warning caused by lack of field and hostname starting with 'z' [#14689](https://github.com/arendst/Tasmota/issues/14689)
+- Support for Domoticz floor/room topics. Regression from v12.0.1 [#20299](https://github.com/arendst/Tasmota/issues/20299)
- ESP32 piezo ceramic buzzer doesn't buzz [#20118](https://github.com/arendst/Tasmota/issues/20118)
- Matter Contact sensor was not triggering any update [#20232](https://github.com/arendst/Tasmota/issues/20232)
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_07_domoticz.ino b/tasmota/tasmota_xdrv_driver/xdrv_07_domoticz.ino
index d3e18c4d0..2994eeafc 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_07_domoticz.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_07_domoticz.ino
@@ -218,14 +218,18 @@ bool DomoticzMqttData(void) {
return true; // No valid data
}
- int32_t relay_index = -1;
+// char dom_data[XdrvMailbox.data_len +1];
+// strcpy(dom_data, XdrvMailbox.data);
+// AddLog(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_DOMOTICZ "Topic '%s', Data '%s'"), XdrvMailbox.topic, RemoveControlCharacter(dom_data));
// Quick check if this is mine using topic domoticz/out/{$idx}
if (strlen(XdrvMailbox.topic) > strlen(DOMOTICZ_OUT_TOPIC)) {
char* topic_index = &XdrvMailbox.topic[strlen(DOMOTICZ_OUT_TOPIC) +1];
- relay_index = DomoticzIdx2Relay(atoi(topic_index));
- if (relay_index < 0) {
- return true; // Idx not mine
+ int32_t top_index = atoi(topic_index); // 0 if no number (in case of domoticz/out/floor/room)
+ if (top_index > 0) {
+ if (DomoticzIdx2Relay(top_index) < 0) {
+ return true; // Idx not mine
+ }
}
}
@@ -235,18 +239,16 @@ bool DomoticzMqttData(void) {
if (!domoticz) {
return true; // To much or invalid data
}
+ int32_t relay_index = DomoticzIdx2Relay(domoticz.getUInt(PSTR("idx"), 0));
if (relay_index < 0) {
- relay_index = DomoticzIdx2Relay(domoticz.getUInt(PSTR("idx"), 0));
- if (relay_index < 0) {
- return true; // Idx not mine
- }
+ return true; // Idx not mine
}
int32_t nvalue = domoticz.getInt(PSTR("nvalue"), -1);
if ((nvalue < 0) || (nvalue > 16)) {
return true; // Nvalue out of boundaries
}
- AddLog(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_DOMOTICZ "idx %d, nvalue %d"), Settings->domoticz_relay_idx[relay_index], nvalue);
+ AddLog(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_DOMOTICZ "Topic %s, idx %d, nvalue %d"), XdrvMailbox.topic, Settings->domoticz_relay_idx[relay_index], nvalue);
bool iscolordimmer = (strcmp_P(domoticz.getStr(PSTR("dtype")), PSTR("Color Switch")) == 0);
bool isShutter = (strcmp_P(domoticz.getStr(PSTR("dtype")), PSTR("Light/Switch")) == 0) && (strncmp_P(domoticz.getStr(PSTR("switchType")),PSTR("Blinds"), 6) == 0);
From 6c0028de4e297ee416efeb12051daae0d0000d5d Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Sun, 24 Dec 2023 09:31:53 +0100
Subject: [PATCH 041/303] Matter improve read sensors (#20302)
* Matter improve read_sensors scheduling
* Imprtove logging
* add scheduler call
* remove unwanted print
* fix
---
.../src/embedded/Matter_Plugin_2_Sensor.be | 11 +
.../src/embedded/Matter_zz_Device.be | 35 +-
.../solidified_Matter_Plugin_2_Sensor.h | 434 +-
.../solidify/solidified_Matter_zz_Device.h | 9689 +++++++++--------
4 files changed, 5164 insertions(+), 5005 deletions(-)
diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Sensor.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Sensor.be
index cdeb53217..1678f2a4f 100644
--- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Sensor.be
+++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Sensor.be
@@ -32,6 +32,17 @@ class Matter_Plugin_Sensor : Matter_Plugin_Device
var tasmota_sensor_matcher # Actual matcher object
var shadow_value # Last known value
+ #############################################################
+ # Constructor
+ #
+ # device: contains the root device object so the plugin can "call home"
+ # endpoint: (int) the endpoint number (16 bits)
+ # arguments: (map) the map for all complementary arguments that are plugin specific
+ def init(device, endpoint, config)
+ super(self).init(device, endpoint, config)
+ device.add_read_sensors_schedule(self.UPDATE_TIME)
+ end
+
#############################################################
# parse_configuration
#
diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_zz_Device.be b/lib/libesp32/berry_matter/src/embedded/Matter_zz_Device.be
index b0b01434d..64aa38ba6 100644
--- a/lib/libesp32/berry_matter/src/embedded/Matter_zz_Device.be
+++ b/lib/libesp32/berry_matter/src/embedded/Matter_zz_Device.be
@@ -72,6 +72,11 @@ class Matter_Device
var root_salt
var root_w0
var root_L
+ # cron equivalent to call `read_sensors()` regularly and dispatch to all entpoints
+ var probe_sensor_time # number of milliseconds to wait between each `read_sensors()` or `nil` if none active
+ var probe_sensor_timestamp # timestamp for `read_sensors()` probe (in millis())
+ # if timestamp is `0`, this should be scheduled in priority
+
#############################################################
def init()
@@ -132,10 +137,6 @@ class Matter_Device
# autoconfigure other plugins if needed
self.autoconf_device()
- # for now read sensors every 30 seconds
- # TODO still needed?
- tasmota.add_cron("*/30 * * * * *", def () self._trigger_read_sensors() end, "matter_sensors_30s")
-
self._start_udp(self.UDP_PORT)
self.start_mdns_announce_hostnames()
@@ -317,6 +318,8 @@ class Matter_Device
# dispatch every 250ms to all plugins
def every_250ms()
self.message_handler.every_250ms()
+ # call read_sensors if needed
+ self.read_sensors_scheduler()
# call all plugins, use a manual loop to avoid creating a new object
var idx = 0
while idx < size(self.plugins)
@@ -325,12 +328,36 @@ class Matter_Device
end
end
+ #############################################################
+ # add a scheduler for `read_sensors` and update schedule time
+ # if it's more often than previously
+ def add_read_sensors_schedule(update_time)
+ if (self.probe_sensor_time == nil) || (self.probe_sensor_time > update_time)
+ self.probe_sensor_time = update_time
+ self.probe_sensor_timestamp = matter.jitter(update_time)
+ end
+ end
+
+ #############################################################
+ # check if we need to call `read_sensors()`
+ def read_sensors_scheduler()
+ if (self.probe_sensor_time == nil) return end # nothing to schedule
+ if (self.probe_sensor_timestamp == 0) || (tasmota.time_reached(self.probe_sensor_timestamp))
+ self._trigger_read_sensors()
+ # set new next timestamp
+ self.probe_sensor_timestamp = tasmota.millis(self.probe_sensor_time)
+ end
+ end
+
#############################################################
# trigger a read_sensors and dispatch to plugins
# Internally used by cron
def _trigger_read_sensors()
import json
var rs_json = tasmota.read_sensors()
+ if tasmota.loglevel(3)
+ tasmota.log("MTR: read_sensors: "+str(rs_json), 3)
+ end
if rs_json == nil return end
var rs = json.load(rs_json)
if rs != nil
diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Sensor.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Sensor.h
index 2a86d3ae8..e2d100e7b 100644
--- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Sensor.h
+++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Sensor.h
@@ -6,6 +6,230 @@
extern const bclass be_class_Matter_Plugin_Sensor;
+/********************************************************************
+** Solidified function: append_state_json
+********************************************************************/
+be_local_closure(Matter_Plugin_Sensor_append_state_json, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(shadow_value),
+ /* K1 */ be_nested_str_weak(null),
+ /* K2 */ be_nested_str_weak(_X2C_X22_X25s_X22_X3A_X25s),
+ /* K3 */ be_nested_str_weak(JSON_NAME),
+ }),
+ be_str_weak(append_state_json),
+ &be_const_str_solidified,
+ ( &(const binstruction[13]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x4C080000, // 0001 LDNIL R2
+ 0x20040202, // 0002 NE R1 R1 R2
+ 0x78060001, // 0003 JMPF R1 #0006
+ 0x88040100, // 0004 GETMBR R1 R0 K0
+ 0x70020000, // 0005 JMP #0007
+ 0x58040001, // 0006 LDCONST R1 K1
+ 0x60080018, // 0007 GETGBL R2 G24
+ 0x580C0002, // 0008 LDCONST R3 K2
+ 0x88100103, // 0009 GETMBR R4 R0 K3
+ 0x5C140200, // 000A MOVE R5 R1
+ 0x7C080600, // 000B CALL R2 3
+ 0x80040400, // 000C RET 1 R2
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: init
+********************************************************************/
+be_local_closure(Matter_Plugin_Sensor_init, /* name */
+ be_nested_proto(
+ 9, /* nstack */
+ 4, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(init),
+ /* K1 */ be_nested_str_weak(add_read_sensors_schedule),
+ /* K2 */ be_nested_str_weak(UPDATE_TIME),
+ }),
+ be_str_weak(init),
+ &be_const_str_solidified,
+ ( &(const binstruction[12]) { /* code */
+ 0x60100003, // 0000 GETGBL R4 G3
+ 0x5C140000, // 0001 MOVE R5 R0
+ 0x7C100200, // 0002 CALL R4 1
+ 0x8C100900, // 0003 GETMET R4 R4 K0
+ 0x5C180200, // 0004 MOVE R6 R1
+ 0x5C1C0400, // 0005 MOVE R7 R2
+ 0x5C200600, // 0006 MOVE R8 R3
+ 0x7C100800, // 0007 CALL R4 4
+ 0x8C100301, // 0008 GETMET R4 R1 K1
+ 0x88180102, // 0009 GETMBR R6 R0 K2
+ 0x7C100400, // 000A CALL R4 2
+ 0x80000000, // 000B RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: value_changed
+********************************************************************/
+be_local_closure(Matter_Plugin_Sensor_value_changed, /* name */
+ be_nested_proto(
+ 1, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 0, /* has constants */
+ NULL, /* no const */
+ be_str_weak(value_changed),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 1]) { /* code */
+ 0x80000000, // 0000 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: parse_configuration
+********************************************************************/
+be_local_closure(Matter_Plugin_Sensor_parse_configuration, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 7]) { /* constants */
+ /* K0 */ be_nested_str_weak(tasmota_sensor_filter),
+ /* K1 */ be_nested_str_weak(find),
+ /* K2 */ be_nested_str_weak(ARG),
+ /* K3 */ be_nested_str_weak(tasmota_sensor_matcher),
+ /* K4 */ be_nested_str_weak(tasmota),
+ /* K5 */ be_nested_str_weak(Rule_Matcher),
+ /* K6 */ be_nested_str_weak(parse),
+ }),
+ be_str_weak(parse_configuration),
+ &be_const_str_solidified,
+ ( &(const binstruction[13]) { /* code */
+ 0x8C080301, // 0000 GETMET R2 R1 K1
+ 0x88100102, // 0001 GETMBR R4 R0 K2
+ 0x7C080400, // 0002 CALL R2 2
+ 0x90020002, // 0003 SETMBR R0 K0 R2
+ 0x88080100, // 0004 GETMBR R2 R0 K0
+ 0x780A0005, // 0005 JMPF R2 #000C
+ 0xB80A0800, // 0006 GETNGBL R2 K4
+ 0x88080505, // 0007 GETMBR R2 R2 K5
+ 0x8C080506, // 0008 GETMET R2 R2 K6
+ 0x88100100, // 0009 GETMBR R4 R0 K0
+ 0x7C080400, // 000A CALL R2 2
+ 0x90020602, // 000B SETMBR R0 K3 R2
+ 0x80000000, // 000C RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: parse_sensors
+********************************************************************/
+be_local_closure(Matter_Plugin_Sensor_parse_sensors, /* name */
+ be_nested_proto(
+ 8, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 6]) { /* constants */
+ /* K0 */ be_nested_str_weak(VIRTUAL),
+ /* K1 */ be_nested_str_weak(tasmota_sensor_matcher),
+ /* K2 */ be_nested_str_weak(pre_value),
+ /* K3 */ be_nested_str_weak(match),
+ /* K4 */ be_nested_str_weak(shadow_value),
+ /* K5 */ be_nested_str_weak(value_changed),
+ }),
+ be_str_weak(parse_sensors),
+ &be_const_str_solidified,
+ ( &(const binstruction[22]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x740A0012, // 0001 JMPT R2 #0015
+ 0x88080101, // 0002 GETMBR R2 R0 K1
+ 0x780A0010, // 0003 JMPF R2 #0015
+ 0x8C080102, // 0004 GETMET R2 R0 K2
+ 0x6010000A, // 0005 GETGBL R4 G10
+ 0x88140101, // 0006 GETMBR R5 R0 K1
+ 0x8C140B03, // 0007 GETMET R5 R5 K3
+ 0x5C1C0200, // 0008 MOVE R7 R1
+ 0x7C140400, // 0009 CALL R5 2
+ 0x7C100200, // 000A CALL R4 1
+ 0x7C080400, // 000B CALL R2 2
+ 0x4C0C0000, // 000C LDNIL R3
+ 0x200C0403, // 000D NE R3 R2 R3
+ 0x780E0005, // 000E JMPF R3 #0015
+ 0x880C0104, // 000F GETMBR R3 R0 K4
+ 0x200C0403, // 0010 NE R3 R2 R3
+ 0x780E0002, // 0011 JMPF R3 #0015
+ 0x8C0C0105, // 0012 GETMET R3 R0 K5
+ 0x7C0C0200, // 0013 CALL R3 1
+ 0x90020802, // 0014 SETMBR R0 K4 R2
+ 0x80000000, // 0015 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: pre_value
+********************************************************************/
+be_local_closure(Matter_Plugin_Sensor_pre_value, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 0, /* has constants */
+ NULL, /* no const */
+ be_str_weak(pre_value),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 1]) { /* code */
+ 0x80040200, // 0000 RET 1 R1
+ })
+ )
+);
+/*******************************************************************/
+
+
/********************************************************************
** Solidified function: update_virtual
********************************************************************/
@@ -64,191 +288,6 @@ be_local_closure(Matter_Plugin_Sensor_update_virtual, /* name */
/*******************************************************************/
-/********************************************************************
-** Solidified function: parse_sensors
-********************************************************************/
-be_local_closure(Matter_Plugin_Sensor_parse_sensors, /* name */
- be_nested_proto(
- 8, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 6]) { /* constants */
- /* K0 */ be_nested_str_weak(VIRTUAL),
- /* K1 */ be_nested_str_weak(tasmota_sensor_matcher),
- /* K2 */ be_nested_str_weak(pre_value),
- /* K3 */ be_nested_str_weak(match),
- /* K4 */ be_nested_str_weak(shadow_value),
- /* K5 */ be_nested_str_weak(value_changed),
- }),
- be_str_weak(parse_sensors),
- &be_const_str_solidified,
- ( &(const binstruction[22]) { /* code */
- 0x88080100, // 0000 GETMBR R2 R0 K0
- 0x740A0012, // 0001 JMPT R2 #0015
- 0x88080101, // 0002 GETMBR R2 R0 K1
- 0x780A0010, // 0003 JMPF R2 #0015
- 0x8C080102, // 0004 GETMET R2 R0 K2
- 0x6010000A, // 0005 GETGBL R4 G10
- 0x88140101, // 0006 GETMBR R5 R0 K1
- 0x8C140B03, // 0007 GETMET R5 R5 K3
- 0x5C1C0200, // 0008 MOVE R7 R1
- 0x7C140400, // 0009 CALL R5 2
- 0x7C100200, // 000A CALL R4 1
- 0x7C080400, // 000B CALL R2 2
- 0x4C0C0000, // 000C LDNIL R3
- 0x200C0403, // 000D NE R3 R2 R3
- 0x780E0005, // 000E JMPF R3 #0015
- 0x880C0104, // 000F GETMBR R3 R0 K4
- 0x200C0403, // 0010 NE R3 R2 R3
- 0x780E0002, // 0011 JMPF R3 #0015
- 0x8C0C0105, // 0012 GETMET R3 R0 K5
- 0x7C0C0200, // 0013 CALL R3 1
- 0x90020802, // 0014 SETMBR R0 K4 R2
- 0x80000000, // 0015 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: parse_configuration
-********************************************************************/
-be_local_closure(Matter_Plugin_Sensor_parse_configuration, /* name */
- be_nested_proto(
- 5, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 7]) { /* constants */
- /* K0 */ be_nested_str_weak(tasmota_sensor_filter),
- /* K1 */ be_nested_str_weak(find),
- /* K2 */ be_nested_str_weak(ARG),
- /* K3 */ be_nested_str_weak(tasmota_sensor_matcher),
- /* K4 */ be_nested_str_weak(tasmota),
- /* K5 */ be_nested_str_weak(Rule_Matcher),
- /* K6 */ be_nested_str_weak(parse),
- }),
- be_str_weak(parse_configuration),
- &be_const_str_solidified,
- ( &(const binstruction[13]) { /* code */
- 0x8C080301, // 0000 GETMET R2 R1 K1
- 0x88100102, // 0001 GETMBR R4 R0 K2
- 0x7C080400, // 0002 CALL R2 2
- 0x90020002, // 0003 SETMBR R0 K0 R2
- 0x88080100, // 0004 GETMBR R2 R0 K0
- 0x780A0005, // 0005 JMPF R2 #000C
- 0xB80A0800, // 0006 GETNGBL R2 K4
- 0x88080505, // 0007 GETMBR R2 R2 K5
- 0x8C080506, // 0008 GETMET R2 R2 K6
- 0x88100100, // 0009 GETMBR R4 R0 K0
- 0x7C080400, // 000A CALL R2 2
- 0x90020602, // 000B SETMBR R0 K3 R2
- 0x80000000, // 000C RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: pre_value
-********************************************************************/
-be_local_closure(Matter_Plugin_Sensor_pre_value, /* name */
- be_nested_proto(
- 2, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 0, /* has constants */
- NULL, /* no const */
- be_str_weak(pre_value),
- &be_const_str_solidified,
- ( &(const binstruction[ 1]) { /* code */
- 0x80040200, // 0000 RET 1 R1
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: append_state_json
-********************************************************************/
-be_local_closure(Matter_Plugin_Sensor_append_state_json, /* name */
- be_nested_proto(
- 6, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_nested_str_weak(shadow_value),
- /* K1 */ be_nested_str_weak(null),
- /* K2 */ be_nested_str_weak(_X2C_X22_X25s_X22_X3A_X25s),
- /* K3 */ be_nested_str_weak(JSON_NAME),
- }),
- be_str_weak(append_state_json),
- &be_const_str_solidified,
- ( &(const binstruction[13]) { /* code */
- 0x88040100, // 0000 GETMBR R1 R0 K0
- 0x4C080000, // 0001 LDNIL R2
- 0x20040202, // 0002 NE R1 R1 R2
- 0x78060001, // 0003 JMPF R1 #0006
- 0x88040100, // 0004 GETMBR R1 R0 K0
- 0x70020000, // 0005 JMP #0007
- 0x58040001, // 0006 LDCONST R1 K1
- 0x60080018, // 0007 GETGBL R2 G24
- 0x580C0002, // 0008 LDCONST R3 K2
- 0x88100103, // 0009 GETMBR R4 R0 K3
- 0x5C140200, // 000A MOVE R5 R1
- 0x7C080600, // 000B CALL R2 3
- 0x80040400, // 000C RET 1 R2
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: value_changed
-********************************************************************/
-be_local_closure(Matter_Plugin_Sensor_value_changed, /* name */
- be_nested_proto(
- 1, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 0, /* has constants */
- NULL, /* no const */
- be_str_weak(value_changed),
- &be_const_str_solidified,
- ( &(const binstruction[ 1]) { /* code */
- 0x80000000, // 0000 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
/********************************************************************
** Solidified class: Matter_Plugin_Sensor
********************************************************************/
@@ -256,21 +295,22 @@ extern const bclass be_class_Matter_Plugin_Device;
be_local_class(Matter_Plugin_Sensor,
3,
&be_class_Matter_Plugin_Device,
- be_nested_map(13,
+ be_nested_map(14,
( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(ARG, 1), be_nested_str_weak(filter) },
- { be_const_key_weak(value_changed, -1), be_const_closure(Matter_Plugin_Sensor_value_changed_closure) },
+ { be_const_key_weak(UPDATE_TIME, 3), be_const_int(5000) },
+ { be_const_key_weak(ARG, -1), be_nested_str_weak(filter) },
+ { be_const_key_weak(append_state_json, 0), be_const_closure(Matter_Plugin_Sensor_append_state_json_closure) },
{ be_const_key_weak(update_virtual, -1), be_const_closure(Matter_Plugin_Sensor_update_virtual_closure) },
- { be_const_key_weak(ARG_HINT, 8), be_nested_str_weak(Filter_X20pattern) },
- { be_const_key_weak(tasmota_sensor_matcher, -1), be_const_var(1) },
- { be_const_key_weak(parse_sensors, -1), be_const_closure(Matter_Plugin_Sensor_parse_sensors_closure) },
- { be_const_key_weak(JSON_NAME, -1), be_nested_str_weak() },
- { be_const_key_weak(parse_configuration, -1), be_const_closure(Matter_Plugin_Sensor_parse_configuration_closure) },
- { be_const_key_weak(pre_value, 12), be_const_closure(Matter_Plugin_Sensor_pre_value_closure) },
- { be_const_key_weak(append_state_json, -1), be_const_closure(Matter_Plugin_Sensor_append_state_json_closure) },
- { be_const_key_weak(shadow_value, 9), be_const_var(2) },
- { be_const_key_weak(UPDATE_TIME, -1), be_const_int(5000) },
{ be_const_key_weak(tasmota_sensor_filter, -1), be_const_var(0) },
+ { be_const_key_weak(init, 13), be_const_closure(Matter_Plugin_Sensor_init_closure) },
+ { be_const_key_weak(tasmota_sensor_matcher, -1), be_const_var(1) },
+ { be_const_key_weak(ARG_HINT, 12), be_nested_str_weak(Filter_X20pattern) },
+ { be_const_key_weak(parse_sensors, 10), be_const_closure(Matter_Plugin_Sensor_parse_sensors_closure) },
+ { be_const_key_weak(JSON_NAME, -1), be_nested_str_weak() },
+ { be_const_key_weak(pre_value, -1), be_const_closure(Matter_Plugin_Sensor_pre_value_closure) },
+ { be_const_key_weak(shadow_value, 7), be_const_var(2) },
+ { be_const_key_weak(parse_configuration, -1), be_const_closure(Matter_Plugin_Sensor_parse_configuration_closure) },
+ { be_const_key_weak(value_changed, -1), be_const_closure(Matter_Plugin_Sensor_value_changed_closure) },
})),
be_str_weak(Matter_Plugin_Sensor)
);
diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_zz_Device.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_zz_Device.h
index a008118ea..aeb9d3b26 100644
--- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_zz_Device.h
+++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_zz_Device.h
@@ -6,6 +6,121 @@
extern const bclass be_class_Matter_Device;
+/********************************************************************
+** Solidified function: bridge_add_endpoint
+********************************************************************/
+be_local_closure(Matter_Device_bridge_add_endpoint, /* name */
+ be_nested_proto(
+ 17, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[21]) { /* constants */
+ /* K0 */ be_nested_str_weak(plugins_classes),
+ /* K1 */ be_nested_str_weak(find),
+ /* K2 */ be_nested_str_weak(tasmota),
+ /* K3 */ be_nested_str_weak(log),
+ /* K4 */ be_nested_str_weak(MTR_X3A_X20unknown_X20class_X20name_X20_X27),
+ /* K5 */ be_nested_str_weak(_X27_X20skipping),
+ /* K6 */ be_const_int(3),
+ /* K7 */ be_nested_str_weak(next_ep),
+ /* K8 */ be_nested_str_weak(plugins),
+ /* K9 */ be_nested_str_weak(push),
+ /* K10 */ be_nested_str_weak(type),
+ /* K11 */ be_nested_str_weak(keys),
+ /* K12 */ be_nested_str_weak(stop_iteration),
+ /* K13 */ be_nested_str_weak(MTR_X3A_X20adding_X20endpoint_X20_X3D_X20_X25i_X20type_X3A_X25s_X25s),
+ /* K14 */ be_nested_str_weak(conf_to_log),
+ /* K15 */ be_const_int(2),
+ /* K16 */ be_nested_str_weak(plugins_config),
+ /* K17 */ be_nested_str_weak(plugins_persist),
+ /* K18 */ be_const_int(1),
+ /* K19 */ be_nested_str_weak(save_param),
+ /* K20 */ be_nested_str_weak(signal_endpoints_changed),
+ }),
+ be_str_weak(bridge_add_endpoint),
+ &be_const_str_solidified,
+ ( &(const binstruction[70]) { /* code */
+ 0x880C0100, // 0000 GETMBR R3 R0 K0
+ 0x8C0C0701, // 0001 GETMET R3 R3 K1
+ 0x5C140200, // 0002 MOVE R5 R1
+ 0x7C0C0400, // 0003 CALL R3 2
+ 0x4C100000, // 0004 LDNIL R4
+ 0x1C100604, // 0005 EQ R4 R3 R4
+ 0x78120009, // 0006 JMPF R4 #0011
+ 0xB8120400, // 0007 GETNGBL R4 K2
+ 0x8C100903, // 0008 GETMET R4 R4 K3
+ 0x60180008, // 0009 GETGBL R6 G8
+ 0x5C1C0200, // 000A MOVE R7 R1
+ 0x7C180200, // 000B CALL R6 1
+ 0x001A0806, // 000C ADD R6 K4 R6
+ 0x00180D05, // 000D ADD R6 R6 K5
+ 0x581C0006, // 000E LDCONST R7 K6
+ 0x7C100600, // 000F CALL R4 3
+ 0x80000800, // 0010 RET 0
+ 0x88100107, // 0011 GETMBR R4 R0 K7
+ 0x60140008, // 0012 GETGBL R5 G8
+ 0x5C180800, // 0013 MOVE R6 R4
+ 0x7C140200, // 0014 CALL R5 1
+ 0x5C180600, // 0015 MOVE R6 R3
+ 0x5C1C0000, // 0016 MOVE R7 R0
+ 0x5C200800, // 0017 MOVE R8 R4
+ 0x5C240400, // 0018 MOVE R9 R2
+ 0x7C180600, // 0019 CALL R6 3
+ 0x881C0108, // 001A GETMBR R7 R0 K8
+ 0x8C1C0F09, // 001B GETMET R7 R7 K9
+ 0x5C240C00, // 001C MOVE R9 R6
+ 0x7C1C0400, // 001D CALL R7 2
+ 0x601C0013, // 001E GETGBL R7 G19
+ 0x7C1C0000, // 001F CALL R7 0
+ 0x981E1401, // 0020 SETIDX R7 K10 R1
+ 0x60200010, // 0021 GETGBL R8 G16
+ 0x8C24050B, // 0022 GETMET R9 R2 K11
+ 0x7C240200, // 0023 CALL R9 1
+ 0x7C200200, // 0024 CALL R8 1
+ 0xA8020004, // 0025 EXBLK 0 #002B
+ 0x5C241000, // 0026 MOVE R9 R8
+ 0x7C240000, // 0027 CALL R9 0
+ 0x94280409, // 0028 GETIDX R10 R2 R9
+ 0x981C120A, // 0029 SETIDX R7 R9 R10
+ 0x7001FFFA, // 002A JMP #0026
+ 0x5820000C, // 002B LDCONST R8 K12
+ 0xAC200200, // 002C CATCH R8 1 0
+ 0xB0080000, // 002D RAISE 2 R0 R0
+ 0xB8220400, // 002E GETNGBL R8 K2
+ 0x8C201103, // 002F GETMET R8 R8 K3
+ 0x60280018, // 0030 GETGBL R10 G24
+ 0x582C000D, // 0031 LDCONST R11 K13
+ 0x5C300800, // 0032 MOVE R12 R4
+ 0x5C340200, // 0033 MOVE R13 R1
+ 0x8C38010E, // 0034 GETMET R14 R0 K14
+ 0x5C400400, // 0035 MOVE R16 R2
+ 0x7C380400, // 0036 CALL R14 2
+ 0x7C280800, // 0037 CALL R10 4
+ 0x582C000F, // 0038 LDCONST R11 K15
+ 0x7C200600, // 0039 CALL R8 3
+ 0x88200110, // 003A GETMBR R8 R0 K16
+ 0x98200A07, // 003B SETIDX R8 R5 R7
+ 0x50200200, // 003C LDBOOL R8 1 0
+ 0x90022208, // 003D SETMBR R0 K17 R8
+ 0x88200107, // 003E GETMBR R8 R0 K7
+ 0x00201112, // 003F ADD R8 R8 K18
+ 0x90020E08, // 0040 SETMBR R0 K7 R8
+ 0x8C200113, // 0041 GETMET R8 R0 K19
+ 0x7C200200, // 0042 CALL R8 1
+ 0x8C200114, // 0043 GETMET R8 R0 K20
+ 0x7C200200, // 0044 CALL R8 1
+ 0x80040800, // 0045 RET 1 R4
+ })
+ )
+);
+/*******************************************************************/
+
+
/********************************************************************
** Solidified function: save_before_restart
********************************************************************/
@@ -38,30 +153,59 @@ be_local_closure(Matter_Device_save_before_restart, /* name */
/********************************************************************
-** Solidified function: msg_send
+** Solidified function: compute_manual_pairing_code
********************************************************************/
-be_local_closure(Matter_Device_msg_send, /* name */
+be_local_closure(Matter_Device_compute_manual_pairing_code, /* name */
be_nested_proto(
- 5, /* nstack */
- 2, /* argc */
+ 9, /* nstack */
+ 1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(udp_server),
- /* K1 */ be_nested_str_weak(send_UDP),
+ ( &(const bvalue[ 6]) { /* constants */
+ /* K0 */ be_nested_str_weak(root_discriminator),
+ /* K1 */ be_nested_str_weak(root_passcode),
+ /* K2 */ be_nested_str_weak(_X251i_X2505i_X2504i),
+ /* K3 */ be_nested_str_weak(matter),
+ /* K4 */ be_nested_str_weak(Verhoeff),
+ /* K5 */ be_nested_str_weak(checksum),
}),
- be_str_weak(msg_send),
+ be_str_weak(compute_manual_pairing_code),
&be_const_str_solidified,
- ( &(const binstruction[ 5]) { /* code */
- 0x88080100, // 0000 GETMBR R2 R0 K0
- 0x8C080501, // 0001 GETMET R2 R2 K1
- 0x5C100200, // 0002 MOVE R4 R1
- 0x7C080400, // 0003 CALL R2 2
- 0x80040400, // 0004 RET 1 R2
+ ( &(const binstruction[30]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x540A0FFE, // 0001 LDINT R2 4095
+ 0x2C040202, // 0002 AND R1 R1 R2
+ 0x540A0009, // 0003 LDINT R2 10
+ 0x3C040202, // 0004 SHR R1 R1 R2
+ 0x88080100, // 0005 GETMBR R2 R0 K0
+ 0x540E02FF, // 0006 LDINT R3 768
+ 0x2C080403, // 0007 AND R2 R2 R3
+ 0x540E0005, // 0008 LDINT R3 6
+ 0x38080403, // 0009 SHL R2 R2 R3
+ 0x880C0101, // 000A GETMBR R3 R0 K1
+ 0x54123FFE, // 000B LDINT R4 16383
+ 0x2C0C0604, // 000C AND R3 R3 R4
+ 0x30080403, // 000D OR R2 R2 R3
+ 0x880C0101, // 000E GETMBR R3 R0 K1
+ 0x5412000D, // 000F LDINT R4 14
+ 0x3C0C0604, // 0010 SHR R3 R3 R4
+ 0x60100018, // 0011 GETGBL R4 G24
+ 0x58140002, // 0012 LDCONST R5 K2
+ 0x5C180200, // 0013 MOVE R6 R1
+ 0x5C1C0400, // 0014 MOVE R7 R2
+ 0x5C200600, // 0015 MOVE R8 R3
+ 0x7C100800, // 0016 CALL R4 4
+ 0xB8160600, // 0017 GETNGBL R5 K3
+ 0x88140B04, // 0018 GETMBR R5 R5 K4
+ 0x8C140B05, // 0019 GETMET R5 R5 K5
+ 0x5C1C0800, // 001A MOVE R7 R4
+ 0x7C140400, // 001B CALL R5 2
+ 0x00100805, // 001C ADD R4 R4 R5
+ 0x80040800, // 001D RET 1 R4
})
)
);
@@ -195,596 +339,53 @@ be_local_closure(Matter_Device_mdns_remove_PASE, /* name */
/********************************************************************
-** Solidified function: compute_qrcode_content
+** Solidified function: conf_to_log
********************************************************************/
-be_local_closure(Matter_Device_compute_qrcode_content, /* name */
- be_nested_proto(
- 8, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[12]) { /* constants */
- /* K0 */ be_nested_str_weak(resize),
- /* K1 */ be_nested_str_weak(setbits),
- /* K2 */ be_const_int(3),
- /* K3 */ be_nested_str_weak(vendorid),
- /* K4 */ be_nested_str_weak(productid),
- /* K5 */ be_nested_str_weak(root_discriminator),
- /* K6 */ be_nested_str_weak(root_passcode),
- /* K7 */ be_const_int(134217727),
- /* K8 */ be_nested_str_weak(MT_X3A),
- /* K9 */ be_nested_str_weak(matter),
- /* K10 */ be_nested_str_weak(Base38),
- /* K11 */ be_nested_str_weak(encode),
- }),
- be_str_weak(compute_qrcode_content),
- &be_const_str_solidified,
- ( &(const binstruction[40]) { /* code */
- 0x60040015, // 0000 GETGBL R1 G21
- 0x7C040000, // 0001 CALL R1 0
- 0x8C040300, // 0002 GETMET R1 R1 K0
- 0x540E000A, // 0003 LDINT R3 11
- 0x7C040400, // 0004 CALL R1 2
- 0x8C080301, // 0005 GETMET R2 R1 K1
- 0x58100002, // 0006 LDCONST R4 K2
- 0x5416000F, // 0007 LDINT R5 16
- 0x88180103, // 0008 GETMBR R6 R0 K3
- 0x7C080800, // 0009 CALL R2 4
- 0x8C080301, // 000A GETMET R2 R1 K1
- 0x54120012, // 000B LDINT R4 19
- 0x5416000F, // 000C LDINT R5 16
- 0x88180104, // 000D GETMBR R6 R0 K4
- 0x7C080800, // 000E CALL R2 4
- 0x8C080301, // 000F GETMET R2 R1 K1
- 0x54120024, // 0010 LDINT R4 37
- 0x54160007, // 0011 LDINT R5 8
- 0x541A0003, // 0012 LDINT R6 4
- 0x7C080800, // 0013 CALL R2 4
- 0x8C080301, // 0014 GETMET R2 R1 K1
- 0x5412002C, // 0015 LDINT R4 45
- 0x5416000B, // 0016 LDINT R5 12
- 0x88180105, // 0017 GETMBR R6 R0 K5
- 0x541E0FFE, // 0018 LDINT R7 4095
- 0x2C180C07, // 0019 AND R6 R6 R7
- 0x7C080800, // 001A CALL R2 4
- 0x8C080301, // 001B GETMET R2 R1 K1
- 0x54120038, // 001C LDINT R4 57
- 0x5416001A, // 001D LDINT R5 27
- 0x88180106, // 001E GETMBR R6 R0 K6
- 0x2C180D07, // 001F AND R6 R6 K7
- 0x7C080800, // 0020 CALL R2 4
- 0xB80A1200, // 0021 GETNGBL R2 K9
- 0x8808050A, // 0022 GETMBR R2 R2 K10
- 0x8C08050B, // 0023 GETMET R2 R2 K11
- 0x5C100200, // 0024 MOVE R4 R1
- 0x7C080400, // 0025 CALL R2 2
- 0x000A1002, // 0026 ADD R2 K8 R2
- 0x80040400, // 0027 RET 1 R2
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: _init_basic_commissioning
-********************************************************************/
-be_local_closure(Matter_Device__init_basic_commissioning, /* name */
- be_nested_proto(
- 3, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_nested_str_weak(sessions),
- /* K1 */ be_nested_str_weak(count_active_fabrics),
- /* K2 */ be_const_int(0),
- /* K3 */ be_nested_str_weak(start_root_basic_commissioning),
- }),
- be_str_weak(_init_basic_commissioning),
- &be_const_str_solidified,
- ( &(const binstruction[ 8]) { /* code */
- 0x88040100, // 0000 GETMBR R1 R0 K0
- 0x8C040301, // 0001 GETMET R1 R1 K1
- 0x7C040200, // 0002 CALL R1 1
- 0x1C040302, // 0003 EQ R1 R1 K2
- 0x78060001, // 0004 JMPF R1 #0007
- 0x8C040103, // 0005 GETMET R1 R0 K3
- 0x7C040200, // 0006 CALL R1 1
- 0x80000000, // 0007 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: every_250ms
-********************************************************************/
-be_local_closure(Matter_Device_every_250ms, /* name */
- be_nested_proto(
- 4, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 5]) { /* constants */
- /* K0 */ be_nested_str_weak(message_handler),
- /* K1 */ be_nested_str_weak(every_250ms),
- /* K2 */ be_const_int(0),
- /* K3 */ be_nested_str_weak(plugins),
- /* K4 */ be_const_int(1),
- }),
- be_str_weak(every_250ms),
- &be_const_str_solidified,
- ( &(const binstruction[16]) { /* code */
- 0x88040100, // 0000 GETMBR R1 R0 K0
- 0x8C040301, // 0001 GETMET R1 R1 K1
- 0x7C040200, // 0002 CALL R1 1
- 0x58040002, // 0003 LDCONST R1 K2
- 0x6008000C, // 0004 GETGBL R2 G12
- 0x880C0103, // 0005 GETMBR R3 R0 K3
- 0x7C080200, // 0006 CALL R2 1
- 0x14080202, // 0007 LT R2 R1 R2
- 0x780A0005, // 0008 JMPF R2 #000F
- 0x88080103, // 0009 GETMBR R2 R0 K3
- 0x94080401, // 000A GETIDX R2 R2 R1
- 0x8C080501, // 000B GETMET R2 R2 K1
- 0x7C080200, // 000C CALL R2 1
- 0x00040304, // 000D ADD R1 R1 K4
- 0x7001FFF4, // 000E JMP #0004
- 0x80000000, // 000F RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: invoke_request
-********************************************************************/
-be_local_closure(Matter_Device_invoke_request, /* name */
- be_nested_proto(
- 12, /* nstack */
- 4, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 8]) { /* constants */
- /* K0 */ be_const_int(0),
- /* K1 */ be_nested_str_weak(endpoint),
- /* K2 */ be_nested_str_weak(plugins),
- /* K3 */ be_nested_str_weak(invoke_request),
- /* K4 */ be_const_int(1),
- /* K5 */ be_nested_str_weak(status),
- /* K6 */ be_nested_str_weak(matter),
- /* K7 */ be_nested_str_weak(UNSUPPORTED_ENDPOINT),
- }),
- be_str_weak(invoke_request),
- &be_const_str_solidified,
- ( &(const binstruction[24]) { /* code */
- 0x58100000, // 0000 LDCONST R4 K0
- 0x88140701, // 0001 GETMBR R5 R3 K1
- 0x6018000C, // 0002 GETGBL R6 G12
- 0x881C0102, // 0003 GETMBR R7 R0 K2
- 0x7C180200, // 0004 CALL R6 1
- 0x14180806, // 0005 LT R6 R4 R6
- 0x781A000C, // 0006 JMPF R6 #0014
- 0x88180102, // 0007 GETMBR R6 R0 K2
- 0x94180C04, // 0008 GETIDX R6 R6 R4
- 0x881C0D01, // 0009 GETMBR R7 R6 K1
- 0x1C1C0E05, // 000A EQ R7 R7 R5
- 0x781E0005, // 000B JMPF R7 #0012
- 0x8C1C0D03, // 000C GETMET R7 R6 K3
- 0x5C240200, // 000D MOVE R9 R1
- 0x5C280400, // 000E MOVE R10 R2
- 0x5C2C0600, // 000F MOVE R11 R3
- 0x7C1C0800, // 0010 CALL R7 4
- 0x80040E00, // 0011 RET 1 R7
- 0x00100904, // 0012 ADD R4 R4 K4
- 0x7001FFED, // 0013 JMP #0002
- 0xB81A0C00, // 0014 GETNGBL R6 K6
- 0x88180D07, // 0015 GETMBR R6 R6 K7
- 0x900E0A06, // 0016 SETMBR R3 K5 R6
- 0x80000000, // 0017 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: start_operational_discovery_deferred
-********************************************************************/
-be_local_closure(Matter_Device_start_operational_discovery_deferred, /* name */
- be_nested_proto(
- 6, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 1, /* has sup protos */
- ( &(const struct bproto*[ 1]) {
- be_nested_proto(
- 3, /* nstack */
- 0, /* argc */
- 0, /* varg */
- 1, /* has upvals */
- ( &(const bupvaldesc[ 2]) { /* upvals */
- be_local_const_upval(1, 0),
- be_local_const_upval(1, 1),
- }),
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(start_operational_discovery),
- }),
- be_str_weak(_X3Clambda_X3E),
- &be_const_str_solidified,
- ( &(const binstruction[ 5]) { /* code */
- 0x68000000, // 0000 GETUPV R0 U0
- 0x8C000100, // 0001 GETMET R0 R0 K0
- 0x68080001, // 0002 GETUPV R2 U1
- 0x7C000400, // 0003 CALL R0 2
- 0x80040000, // 0004 RET 1 R0
- })
- ),
- }),
- 1, /* has constants */
- ( &(const bvalue[ 3]) { /* constants */
- /* K0 */ be_nested_str_weak(tasmota),
- /* K1 */ be_nested_str_weak(set_timer),
- /* K2 */ be_const_int(0),
- }),
- be_str_weak(start_operational_discovery_deferred),
- &be_const_str_solidified,
- ( &(const binstruction[ 7]) { /* code */
- 0xB80A0000, // 0000 GETNGBL R2 K0
- 0x8C080501, // 0001 GETMET R2 R2 K1
- 0x58100002, // 0002 LDCONST R4 K2
- 0x84140000, // 0003 CLOSURE R5 P0
- 0x7C080600, // 0004 CALL R2 3
- 0xA0000000, // 0005 CLOSE R0
- 0x80000000, // 0006 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: get_active_endpoints
-********************************************************************/
-be_local_closure(Matter_Device_get_active_endpoints, /* name */
+be_local_closure(Matter_Device_conf_to_log, /* name */
be_nested_proto(
9, /* nstack */
- 2, /* argc */
- 2, /* varg */
+ 1, /* argc */
+ 4, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 6]) { /* constants */
- /* K0 */ be_nested_str_weak(plugins),
- /* K1 */ be_nested_str_weak(get_endpoint),
- /* K2 */ be_const_int(0),
- /* K3 */ be_nested_str_weak(find),
- /* K4 */ be_nested_str_weak(push),
+ /* K0 */ be_const_class(be_class_Matter_Device),
+ /* K1 */ be_nested_str_weak(),
+ /* K2 */ be_nested_str_weak(k2l),
+ /* K3 */ be_nested_str_weak(type),
+ /* K4 */ be_nested_str_weak(_X20_X25s_X3A_X25s),
/* K5 */ be_nested_str_weak(stop_iteration),
}),
- be_str_weak(get_active_endpoints),
+ be_str_weak(conf_to_log),
&be_const_str_solidified,
- ( &(const binstruction[28]) { /* code */
- 0x60080012, // 0000 GETGBL R2 G18
- 0x7C080000, // 0001 CALL R2 0
+ ( &(const binstruction[24]) { /* code */
+ 0x58040000, // 0000 LDCONST R1 K0
+ 0x58080001, // 0001 LDCONST R2 K1
0x600C0010, // 0002 GETGBL R3 G16
- 0x88100100, // 0003 GETMBR R4 R0 K0
- 0x7C0C0200, // 0004 CALL R3 1
- 0xA8020011, // 0005 EXBLK 0 #0018
- 0x5C100600, // 0006 MOVE R4 R3
- 0x7C100000, // 0007 CALL R4 0
- 0x8C140901, // 0008 GETMET R5 R4 K1
- 0x7C140200, // 0009 CALL R5 1
- 0x78060002, // 000A JMPF R1 #000E
- 0x1C180B02, // 000B EQ R6 R5 K2
- 0x781A0000, // 000C JMPF R6 #000E
- 0x7001FFF7, // 000D JMP #0006
- 0x8C180503, // 000E GETMET R6 R2 K3
- 0x5C200A00, // 000F MOVE R8 R5
- 0x7C180400, // 0010 CALL R6 2
- 0x4C1C0000, // 0011 LDNIL R7
- 0x1C180C07, // 0012 EQ R6 R6 R7
- 0x781A0002, // 0013 JMPF R6 #0017
- 0x8C180504, // 0014 GETMET R6 R2 K4
- 0x5C200A00, // 0015 MOVE R8 R5
- 0x7C180400, // 0016 CALL R6 2
- 0x7001FFED, // 0017 JMP #0006
- 0x580C0005, // 0018 LDCONST R3 K5
- 0xAC0C0200, // 0019 CATCH R3 1 0
- 0xB0080000, // 001A RAISE 2 R0 R0
- 0x80040400, // 001B RET 1 R2
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: start_commissioning_complete_deferred
-********************************************************************/
-be_local_closure(Matter_Device_start_commissioning_complete_deferred, /* name */
- be_nested_proto(
- 6, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 1, /* has sup protos */
- ( &(const struct bproto*[ 1]) {
- be_nested_proto(
- 3, /* nstack */
- 0, /* argc */
- 0, /* varg */
- 1, /* has upvals */
- ( &(const bupvaldesc[ 2]) { /* upvals */
- be_local_const_upval(1, 0),
- be_local_const_upval(1, 1),
- }),
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(start_commissioning_complete),
- }),
- be_str_weak(_X3Clambda_X3E),
- &be_const_str_solidified,
- ( &(const binstruction[ 5]) { /* code */
- 0x68000000, // 0000 GETUPV R0 U0
- 0x8C000100, // 0001 GETMET R0 R0 K0
- 0x68080001, // 0002 GETUPV R2 U1
- 0x7C000400, // 0003 CALL R0 2
- 0x80040000, // 0004 RET 1 R0
- })
- ),
- }),
- 1, /* has constants */
- ( &(const bvalue[ 3]) { /* constants */
- /* K0 */ be_nested_str_weak(tasmota),
- /* K1 */ be_nested_str_weak(set_timer),
- /* K2 */ be_const_int(0),
- }),
- be_str_weak(start_commissioning_complete_deferred),
- &be_const_str_solidified,
- ( &(const binstruction[ 7]) { /* code */
- 0xB80A0000, // 0000 GETNGBL R2 K0
- 0x8C080501, // 0001 GETMET R2 R2 K1
- 0x58100002, // 0002 LDCONST R4 K2
- 0x84140000, // 0003 CLOSURE R5 P0
- 0x7C080600, // 0004 CALL R2 3
- 0xA0000000, // 0005 CLOSE R0
- 0x80000000, // 0006 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: _instantiate_plugins_from_config
-********************************************************************/
-be_local_closure(Matter_Device__instantiate_plugins_from_config, /* name */
- be_nested_proto(
- 18, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[30]) { /* constants */
- /* K0 */ be_nested_str_weak(k2l_num),
- /* K1 */ be_nested_str_weak(tasmota),
- /* K2 */ be_nested_str_weak(log),
- /* K3 */ be_nested_str_weak(MTR_X3A_X20Configuring_X20endpoints),
- /* K4 */ be_const_int(2),
- /* K5 */ be_nested_str_weak(plugins),
- /* K6 */ be_nested_str_weak(push),
- /* K7 */ be_nested_str_weak(matter),
- /* K8 */ be_nested_str_weak(Plugin_Root),
- /* K9 */ be_const_int(0),
- /* K10 */ be_nested_str_weak(MTR_X3A_X20_X20_X20endpoint_X20_X3D_X20_X255i_X20type_X3A_X25s_X25s),
- /* K11 */ be_nested_str_weak(root),
- /* K12 */ be_nested_str_weak(),
- /* K13 */ be_nested_str_weak(Plugin_Aggregator),
- /* K14 */ be_nested_str_weak(find),
- /* K15 */ be_nested_str_weak(type),
- /* K16 */ be_nested_str_weak(MTR_X3A_X20no_X20class_X20name_X2C_X20skipping),
- /* K17 */ be_const_int(3),
- /* K18 */ be_nested_str_weak(MTR_X3A_X20only_X20one_X20root_X20node_X20allowed),
- /* K19 */ be_nested_str_weak(plugins_classes),
- /* K20 */ be_nested_str_weak(MTR_X3A_X20unknown_X20class_X20name_X20_X27),
- /* K21 */ be_nested_str_weak(_X27_X20skipping),
- /* K22 */ be_nested_str_weak(conf_to_log),
- /* K23 */ be_nested_str_weak(MTR_X3A_X20Exception),
- /* K24 */ be_nested_str_weak(_X7C),
- /* K25 */ be_nested_str_weak(stop_iteration),
- /* K26 */ be_nested_str_weak(aggregator),
- /* K27 */ be_nested_str_weak(publish_result),
- /* K28 */ be_nested_str_weak(_X7B_X22Matter_X22_X3A_X7B_X22Initialized_X22_X3A1_X7D_X7D),
- /* K29 */ be_nested_str_weak(Matter),
- }),
- be_str_weak(_instantiate_plugins_from_config),
- &be_const_str_solidified,
- ( &(const binstruction[152]) { /* code */
- 0x8C080100, // 0000 GETMET R2 R0 K0
- 0x5C100200, // 0001 MOVE R4 R1
- 0x7C080400, // 0002 CALL R2 2
- 0xB80E0200, // 0003 GETNGBL R3 K1
- 0x8C0C0702, // 0004 GETMET R3 R3 K2
- 0x58140003, // 0005 LDCONST R5 K3
- 0x58180004, // 0006 LDCONST R6 K4
- 0x7C0C0600, // 0007 CALL R3 3
- 0x880C0105, // 0008 GETMBR R3 R0 K5
- 0x8C0C0706, // 0009 GETMET R3 R3 K6
- 0xB8160E00, // 000A GETNGBL R5 K7
- 0x8C140B08, // 000B GETMET R5 R5 K8
- 0x5C1C0000, // 000C MOVE R7 R0
- 0x58200009, // 000D LDCONST R8 K9
- 0x60240013, // 000E GETGBL R9 G19
- 0x7C240000, // 000F CALL R9 0
- 0x7C140800, // 0010 CALL R5 4
- 0x7C0C0400, // 0011 CALL R3 2
- 0xB80E0200, // 0012 GETNGBL R3 K1
- 0x8C0C0702, // 0013 GETMET R3 R3 K2
- 0x60140018, // 0014 GETGBL R5 G24
- 0x5818000A, // 0015 LDCONST R6 K10
- 0x581C0009, // 0016 LDCONST R7 K9
- 0x5820000B, // 0017 LDCONST R8 K11
- 0x5824000C, // 0018 LDCONST R9 K12
- 0x7C140800, // 0019 CALL R5 4
- 0x58180004, // 001A LDCONST R6 K4
- 0x7C0C0600, // 001B CALL R3 3
- 0x880C0105, // 001C GETMBR R3 R0 K5
- 0x8C0C0706, // 001D GETMET R3 R3 K6
- 0xB8160E00, // 001E GETNGBL R5 K7
- 0x8C140B0D, // 001F GETMET R5 R5 K13
- 0x5C1C0000, // 0020 MOVE R7 R0
- 0x5422FEFF, // 0021 LDINT R8 65280
- 0x60240013, // 0022 GETGBL R9 G19
- 0x7C240000, // 0023 CALL R9 0
- 0x7C140800, // 0024 CALL R5 4
- 0x7C0C0400, // 0025 CALL R3 2
- 0x600C0010, // 0026 GETGBL R3 G16
- 0x5C100400, // 0027 MOVE R4 R2
- 0x7C0C0200, // 0028 CALL R3 1
- 0xA802005A, // 0029 EXBLK 0 #0085
- 0x5C100600, // 002A MOVE R4 R3
- 0x7C100000, // 002B CALL R4 0
- 0x1C140909, // 002C EQ R5 R4 K9
- 0x78160000, // 002D JMPF R5 #002F
- 0x7001FFFA, // 002E JMP #002A
- 0xA8020042, // 002F EXBLK 0 #0073
- 0x60140008, // 0030 GETGBL R5 G8
- 0x5C180800, // 0031 MOVE R6 R4
- 0x7C140200, // 0032 CALL R5 1
- 0x94140205, // 0033 GETIDX R5 R1 R5
- 0x8C180B0E, // 0034 GETMET R6 R5 K14
- 0x5820000F, // 0035 LDCONST R8 K15
- 0x7C180400, // 0036 CALL R6 2
- 0x4C1C0000, // 0037 LDNIL R7
- 0x1C1C0C07, // 0038 EQ R7 R6 R7
- 0x781E0006, // 0039 JMPF R7 #0041
- 0xB81E0200, // 003A GETNGBL R7 K1
- 0x8C1C0F02, // 003B GETMET R7 R7 K2
- 0x58240010, // 003C LDCONST R9 K16
- 0x58280011, // 003D LDCONST R10 K17
- 0x7C1C0600, // 003E CALL R7 3
- 0xA8040001, // 003F EXBLK 1 1
- 0x7001FFE8, // 0040 JMP #002A
- 0x1C1C0D0B, // 0041 EQ R7 R6 K11
- 0x781E0006, // 0042 JMPF R7 #004A
- 0xB81E0200, // 0043 GETNGBL R7 K1
- 0x8C1C0F02, // 0044 GETMET R7 R7 K2
- 0x58240012, // 0045 LDCONST R9 K18
- 0x58280011, // 0046 LDCONST R10 K17
- 0x7C1C0600, // 0047 CALL R7 3
- 0xA8040001, // 0048 EXBLK 1 1
- 0x7001FFDF, // 0049 JMP #002A
- 0x881C0113, // 004A GETMBR R7 R0 K19
- 0x8C1C0F0E, // 004B GETMET R7 R7 K14
- 0x5C240C00, // 004C MOVE R9 R6
- 0x7C1C0400, // 004D CALL R7 2
- 0x4C200000, // 004E LDNIL R8
- 0x1C200E08, // 004F EQ R8 R7 R8
- 0x7822000A, // 0050 JMPF R8 #005C
- 0xB8220200, // 0051 GETNGBL R8 K1
- 0x8C201102, // 0052 GETMET R8 R8 K2
- 0x60280008, // 0053 GETGBL R10 G8
- 0x5C2C0C00, // 0054 MOVE R11 R6
- 0x7C280200, // 0055 CALL R10 1
- 0x002A280A, // 0056 ADD R10 K20 R10
- 0x00281515, // 0057 ADD R10 R10 K21
- 0x582C0004, // 0058 LDCONST R11 K4
- 0x7C200600, // 0059 CALL R8 3
- 0xA8040001, // 005A EXBLK 1 1
- 0x7001FFCD, // 005B JMP #002A
- 0x5C200E00, // 005C MOVE R8 R7
- 0x5C240000, // 005D MOVE R9 R0
- 0x5C280800, // 005E MOVE R10 R4
- 0x5C2C0A00, // 005F MOVE R11 R5
- 0x7C200600, // 0060 CALL R8 3
- 0x88240105, // 0061 GETMBR R9 R0 K5
- 0x8C241306, // 0062 GETMET R9 R9 K6
- 0x5C2C1000, // 0063 MOVE R11 R8
- 0x7C240400, // 0064 CALL R9 2
- 0xB8260200, // 0065 GETNGBL R9 K1
- 0x8C241302, // 0066 GETMET R9 R9 K2
- 0x602C0018, // 0067 GETGBL R11 G24
- 0x5830000A, // 0068 LDCONST R12 K10
- 0x5C340800, // 0069 MOVE R13 R4
- 0x5C380C00, // 006A MOVE R14 R6
- 0x8C3C0116, // 006B GETMET R15 R0 K22
- 0x5C440A00, // 006C MOVE R17 R5
- 0x7C3C0400, // 006D CALL R15 2
- 0x7C2C0800, // 006E CALL R11 4
- 0x58300004, // 006F LDCONST R12 K4
- 0x7C240600, // 0070 CALL R9 3
- 0xA8040001, // 0071 EXBLK 1 1
- 0x70020010, // 0072 JMP #0084
- 0xAC140002, // 0073 CATCH R5 0 2
- 0x7002000D, // 0074 JMP #0083
- 0xB81E0200, // 0075 GETNGBL R7 K1
- 0x8C1C0F02, // 0076 GETMET R7 R7 K2
- 0x60240008, // 0077 GETGBL R9 G8
- 0x5C280A00, // 0078 MOVE R10 R5
- 0x7C240200, // 0079 CALL R9 1
- 0x00262E09, // 007A ADD R9 K23 R9
- 0x00241318, // 007B ADD R9 R9 K24
- 0x60280008, // 007C GETGBL R10 G8
- 0x5C2C0C00, // 007D MOVE R11 R6
- 0x7C280200, // 007E CALL R10 1
- 0x0024120A, // 007F ADD R9 R9 R10
- 0x58280004, // 0080 LDCONST R10 K4
- 0x7C1C0600, // 0081 CALL R7 3
- 0x70020000, // 0082 JMP #0084
- 0xB0080000, // 0083 RAISE 2 R0 R0
- 0x7001FFA4, // 0084 JMP #002A
- 0x580C0019, // 0085 LDCONST R3 K25
- 0xAC0C0200, // 0086 CATCH R3 1 0
- 0xB0080000, // 0087 RAISE 2 R0 R0
- 0xB80E0200, // 0088 GETNGBL R3 K1
- 0x8C0C0702, // 0089 GETMET R3 R3 K2
- 0x60140018, // 008A GETGBL R5 G24
- 0x5818000A, // 008B LDCONST R6 K10
- 0x541EFEFF, // 008C LDINT R7 65280
- 0x5820001A, // 008D LDCONST R8 K26
- 0x5824000C, // 008E LDCONST R9 K12
- 0x7C140800, // 008F CALL R5 4
- 0x58180004, // 0090 LDCONST R6 K4
- 0x7C0C0600, // 0091 CALL R3 3
- 0xB80E0200, // 0092 GETNGBL R3 K1
- 0x8C0C071B, // 0093 GETMET R3 R3 K27
- 0x5814001C, // 0094 LDCONST R5 K28
- 0x5818001D, // 0095 LDCONST R6 K29
- 0x7C0C0600, // 0096 CALL R3 3
- 0x80000000, // 0097 RET 0
+ 0x8C100302, // 0003 GETMET R4 R1 K2
+ 0x5C180000, // 0004 MOVE R6 R0
+ 0x7C100400, // 0005 CALL R4 2
+ 0x7C0C0200, // 0006 CALL R3 1
+ 0xA802000B, // 0007 EXBLK 0 #0014
+ 0x5C100600, // 0008 MOVE R4 R3
+ 0x7C100000, // 0009 CALL R4 0
+ 0x1C140903, // 000A EQ R5 R4 K3
+ 0x78160000, // 000B JMPF R5 #000D
+ 0x7001FFFA, // 000C JMP #0008
+ 0x60140018, // 000D GETGBL R5 G24
+ 0x58180004, // 000E LDCONST R6 K4
+ 0x5C1C0800, // 000F MOVE R7 R4
+ 0x94200004, // 0010 GETIDX R8 R0 R4
+ 0x7C140600, // 0011 CALL R5 3
+ 0x00080405, // 0012 ADD R2 R2 R5
+ 0x7001FFF3, // 0013 JMP #0008
+ 0x580C0005, // 0014 LDCONST R3 K5
+ 0xAC0C0200, // 0015 CATCH R3 1 0
+ 0xB0080000, // 0016 RAISE 2 R0 R0
+ 0x80040400, // 0017 RET 1 R2
})
)
);
@@ -1033,536 +634,12 @@ be_local_closure(Matter_Device__mdns_announce_hostname, /* name */
/********************************************************************
-** Solidified function: bridge_remove_endpoint
+** Solidified function: invoke_request
********************************************************************/
-be_local_closure(Matter_Device_bridge_remove_endpoint, /* name */
+be_local_closure(Matter_Device_invoke_request, /* name */
be_nested_proto(
- 11, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[18]) { /* constants */
- /* K0 */ be_nested_str_weak(json),
- /* K1 */ be_nested_str_weak(plugins_config),
- /* K2 */ be_nested_str_weak(contains),
- /* K3 */ be_nested_str_weak(tasmota),
- /* K4 */ be_nested_str_weak(log),
- /* K5 */ be_nested_str_weak(MTR_X3A_X20Cannot_X20remove_X20an_X20enpoint_X20not_X20configured_X3A_X20),
- /* K6 */ be_const_int(3),
- /* K7 */ be_nested_str_weak(MTR_X3A_X20deleting_X20endpoint_X20_X3D_X20_X25i),
- /* K8 */ be_const_int(2),
- /* K9 */ be_nested_str_weak(remove),
- /* K10 */ be_nested_str_weak(plugins_persist),
- /* K11 */ be_const_int(0),
- /* K12 */ be_nested_str_weak(plugins),
- /* K13 */ be_nested_str_weak(get_endpoint),
- /* K14 */ be_const_int(1),
- /* K15 */ be_nested_str_weak(clean_remotes),
- /* K16 */ be_nested_str_weak(save_param),
- /* K17 */ be_nested_str_weak(signal_endpoints_changed),
- }),
- be_str_weak(bridge_remove_endpoint),
- &be_const_str_solidified,
- ( &(const binstruction[58]) { /* code */
- 0xA40A0000, // 0000 IMPORT R2 K0
- 0x600C0008, // 0001 GETGBL R3 G8
- 0x5C100200, // 0002 MOVE R4 R1
- 0x7C0C0200, // 0003 CALL R3 1
- 0x4C100000, // 0004 LDNIL R4
- 0x4C140000, // 0005 LDNIL R5
- 0x88180101, // 0006 GETMBR R6 R0 K1
- 0x8C180D02, // 0007 GETMET R6 R6 K2
- 0x5C200600, // 0008 MOVE R8 R3
- 0x7C180400, // 0009 CALL R6 2
- 0x741A0005, // 000A JMPT R6 #0011
- 0xB81A0600, // 000B GETNGBL R6 K3
- 0x8C180D04, // 000C GETMET R6 R6 K4
- 0x00220A03, // 000D ADD R8 K5 R3
- 0x58240006, // 000E LDCONST R9 K6
- 0x7C180600, // 000F CALL R6 3
- 0x80000C00, // 0010 RET 0
- 0xB81A0600, // 0011 GETNGBL R6 K3
- 0x8C180D04, // 0012 GETMET R6 R6 K4
- 0x60200018, // 0013 GETGBL R8 G24
- 0x58240007, // 0014 LDCONST R9 K7
- 0x5C280200, // 0015 MOVE R10 R1
- 0x7C200400, // 0016 CALL R8 2
- 0x58240008, // 0017 LDCONST R9 K8
- 0x7C180600, // 0018 CALL R6 3
- 0x88180101, // 0019 GETMBR R6 R0 K1
- 0x8C180D09, // 001A GETMET R6 R6 K9
- 0x5C200600, // 001B MOVE R8 R3
- 0x7C180400, // 001C CALL R6 2
- 0x50180200, // 001D LDBOOL R6 1 0
- 0x90021406, // 001E SETMBR R0 K10 R6
- 0x5818000B, // 001F LDCONST R6 K11
- 0x601C000C, // 0020 GETGBL R7 G12
- 0x8820010C, // 0021 GETMBR R8 R0 K12
- 0x7C1C0200, // 0022 CALL R7 1
- 0x141C0C07, // 0023 LT R7 R6 R7
- 0x781E000D, // 0024 JMPF R7 #0033
- 0x881C010C, // 0025 GETMBR R7 R0 K12
- 0x941C0E06, // 0026 GETIDX R7 R7 R6
- 0x8C1C0F0D, // 0027 GETMET R7 R7 K13
- 0x7C1C0200, // 0028 CALL R7 1
- 0x1C1C0207, // 0029 EQ R7 R1 R7
- 0x781E0005, // 002A JMPF R7 #0031
- 0x881C010C, // 002B GETMBR R7 R0 K12
- 0x8C1C0F09, // 002C GETMET R7 R7 K9
- 0x5C240C00, // 002D MOVE R9 R6
- 0x7C1C0400, // 002E CALL R7 2
- 0x70020002, // 002F JMP #0033
- 0x70020000, // 0030 JMP #0032
- 0x00180D0E, // 0031 ADD R6 R6 K14
- 0x7001FFEC, // 0032 JMP #0020
- 0x8C1C010F, // 0033 GETMET R7 R0 K15
- 0x7C1C0200, // 0034 CALL R7 1
- 0x8C1C0110, // 0035 GETMET R7 R0 K16
- 0x7C1C0200, // 0036 CALL R7 1
- 0x8C1C0111, // 0037 GETMET R7 R0 K17
- 0x7C1C0200, // 0038 CALL R7 1
- 0x80000000, // 0039 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: find_plugin_by_endpoint
-********************************************************************/
-be_local_closure(Matter_Device_find_plugin_by_endpoint, /* name */
- be_nested_proto(
- 6, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_const_int(0),
- /* K1 */ be_nested_str_weak(plugins),
- /* K2 */ be_nested_str_weak(get_endpoint),
- /* K3 */ be_const_int(1),
- }),
- be_str_weak(find_plugin_by_endpoint),
- &be_const_str_solidified,
- ( &(const binstruction[17]) { /* code */
- 0x58080000, // 0000 LDCONST R2 K0
- 0x600C000C, // 0001 GETGBL R3 G12
- 0x88100101, // 0002 GETMBR R4 R0 K1
- 0x7C0C0200, // 0003 CALL R3 1
- 0x140C0403, // 0004 LT R3 R2 R3
- 0x780E0008, // 0005 JMPF R3 #000F
- 0x880C0101, // 0006 GETMBR R3 R0 K1
- 0x940C0602, // 0007 GETIDX R3 R3 R2
- 0x8C100702, // 0008 GETMET R4 R3 K2
- 0x7C100200, // 0009 CALL R4 1
- 0x1C100801, // 000A EQ R4 R4 R1
- 0x78120000, // 000B JMPF R4 #000D
- 0x80040600, // 000C RET 1 R3
- 0x00080503, // 000D ADD R2 R2 K3
- 0x7001FFF1, // 000E JMP #0001
- 0x4C0C0000, // 000F LDNIL R3
- 0x80040600, // 0010 RET 1 R3
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: start_mdns_announce_hostnames
-********************************************************************/
-be_local_closure(Matter_Device_start_mdns_announce_hostnames, /* name */
- be_nested_proto(
- 6, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 1, /* has sup protos */
- ( &(const struct bproto*[ 2]) {
- be_nested_proto(
- 4, /* nstack */
- 0, /* argc */
- 0, /* varg */
- 1, /* has upvals */
- ( &(const bupvaldesc[ 1]) { /* upvals */
- be_local_const_upval(1, 0),
- }),
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 5]) { /* constants */
- /* K0 */ be_nested_str_weak(_mdns_announce_hostname),
- /* K1 */ be_nested_str_weak(tasmota),
- /* K2 */ be_nested_str_weak(remove_rule),
- /* K3 */ be_nested_str_weak(Wifi_X23Connected),
- /* K4 */ be_nested_str_weak(matter_mdns_host),
- }),
- be_str_weak(_anonymous_),
- &be_const_str_solidified,
- ( &(const binstruction[10]) { /* code */
- 0x68000000, // 0000 GETUPV R0 U0
- 0x8C000100, // 0001 GETMET R0 R0 K0
- 0x50080000, // 0002 LDBOOL R2 0 0
- 0x7C000400, // 0003 CALL R0 2
- 0xB8020200, // 0004 GETNGBL R0 K1
- 0x8C000102, // 0005 GETMET R0 R0 K2
- 0x58080003, // 0006 LDCONST R2 K3
- 0x580C0004, // 0007 LDCONST R3 K4
- 0x7C000600, // 0008 CALL R0 3
- 0x80000000, // 0009 RET 0
- })
- ),
- be_nested_proto(
- 4, /* nstack */
- 0, /* argc */
- 0, /* varg */
- 1, /* has upvals */
- ( &(const bupvaldesc[ 1]) { /* upvals */
- be_local_const_upval(1, 0),
- }),
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 5]) { /* constants */
- /* K0 */ be_nested_str_weak(_mdns_announce_hostname),
- /* K1 */ be_nested_str_weak(tasmota),
- /* K2 */ be_nested_str_weak(remove_rule),
- /* K3 */ be_nested_str_weak(Eth_X23Connected),
- /* K4 */ be_nested_str_weak(matter_mdns_host),
- }),
- be_str_weak(_anonymous_),
- &be_const_str_solidified,
- ( &(const binstruction[10]) { /* code */
- 0x68000000, // 0000 GETUPV R0 U0
- 0x8C000100, // 0001 GETMET R0 R0 K0
- 0x50080200, // 0002 LDBOOL R2 1 0
- 0x7C000400, // 0003 CALL R0 2
- 0xB8020200, // 0004 GETNGBL R0 K1
- 0x8C000102, // 0005 GETMET R0 R0 K2
- 0x58080003, // 0006 LDCONST R2 K3
- 0x580C0004, // 0007 LDCONST R3 K4
- 0x7C000600, // 0008 CALL R0 3
- 0x80000000, // 0009 RET 0
- })
- ),
- }),
- 1, /* has constants */
- ( &(const bvalue[ 9]) { /* constants */
- /* K0 */ be_nested_str_weak(tasmota),
- /* K1 */ be_nested_str_weak(wifi),
- /* K2 */ be_nested_str_weak(up),
- /* K3 */ be_nested_str_weak(_mdns_announce_hostname),
- /* K4 */ be_nested_str_weak(add_rule),
- /* K5 */ be_nested_str_weak(Wifi_X23Connected),
- /* K6 */ be_nested_str_weak(matter_mdns_host),
- /* K7 */ be_nested_str_weak(eth),
- /* K8 */ be_nested_str_weak(Eth_X23Connected),
- }),
- be_str_weak(start_mdns_announce_hostnames),
- &be_const_str_solidified,
- ( &(const binstruction[32]) { /* code */
- 0xB8060000, // 0000 GETNGBL R1 K0
- 0x8C040301, // 0001 GETMET R1 R1 K1
- 0x7C040200, // 0002 CALL R1 1
- 0x94040302, // 0003 GETIDX R1 R1 K2
- 0x78060003, // 0004 JMPF R1 #0009
- 0x8C040103, // 0005 GETMET R1 R0 K3
- 0x500C0000, // 0006 LDBOOL R3 0 0
- 0x7C040400, // 0007 CALL R1 2
- 0x70020005, // 0008 JMP #000F
- 0xB8060000, // 0009 GETNGBL R1 K0
- 0x8C040304, // 000A GETMET R1 R1 K4
- 0x580C0005, // 000B LDCONST R3 K5
- 0x84100000, // 000C CLOSURE R4 P0
- 0x58140006, // 000D LDCONST R5 K6
- 0x7C040800, // 000E CALL R1 4
- 0xB8060000, // 000F GETNGBL R1 K0
- 0x8C040307, // 0010 GETMET R1 R1 K7
- 0x7C040200, // 0011 CALL R1 1
- 0x94040302, // 0012 GETIDX R1 R1 K2
- 0x78060003, // 0013 JMPF R1 #0018
- 0x8C040103, // 0014 GETMET R1 R0 K3
- 0x500C0200, // 0015 LDBOOL R3 1 0
- 0x7C040400, // 0016 CALL R1 2
- 0x70020005, // 0017 JMP #001E
- 0xB8060000, // 0018 GETNGBL R1 K0
- 0x8C040304, // 0019 GETMET R1 R1 K4
- 0x580C0008, // 001A LDCONST R3 K8
- 0x84100001, // 001B CLOSURE R4 P1
- 0x58140006, // 001C LDCONST R5 K6
- 0x7C040800, // 001D CALL R1 4
- 0xA0000000, // 001E CLOSE R0
- 0x80000000, // 001F RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: _start_udp
-********************************************************************/
-be_local_closure(Matter_Device__start_udp, /* name */
- be_nested_proto(
- 7, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 1, /* has sup protos */
- ( &(const struct bproto*[ 1]) {
- be_nested_proto(
- 8, /* nstack */
- 3, /* argc */
- 0, /* varg */
- 1, /* has upvals */
- ( &(const bupvaldesc[ 1]) { /* upvals */
- be_local_const_upval(1, 0),
- }),
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(msg_received),
- }),
- be_str_weak(_X3Clambda_X3E),
- &be_const_str_solidified,
- ( &(const binstruction[ 7]) { /* code */
- 0x680C0000, // 0000 GETUPV R3 U0
- 0x8C0C0700, // 0001 GETMET R3 R3 K0
- 0x5C140000, // 0002 MOVE R5 R0
- 0x5C180200, // 0003 MOVE R6 R1
- 0x5C1C0400, // 0004 MOVE R7 R2
- 0x7C0C0800, // 0005 CALL R3 4
- 0x80040600, // 0006 RET 1 R3
- })
- ),
- }),
- 1, /* has constants */
- ( &(const bvalue[ 9]) { /* constants */
- /* K0 */ be_nested_str_weak(udp_server),
- /* K1 */ be_nested_str_weak(tasmota),
- /* K2 */ be_nested_str_weak(log),
- /* K3 */ be_nested_str_weak(MTR_X3A_X20Starting_X20UDP_X20server_X20on_X20port_X3A_X20),
- /* K4 */ be_const_int(2),
- /* K5 */ be_nested_str_weak(matter),
- /* K6 */ be_nested_str_weak(UDPServer),
- /* K7 */ be_nested_str_weak(),
- /* K8 */ be_nested_str_weak(start),
- }),
- be_str_weak(_start_udp),
- &be_const_str_solidified,
- ( &(const binstruction[28]) { /* code */
- 0x88080100, // 0000 GETMBR R2 R0 K0
- 0x780A0000, // 0001 JMPF R2 #0003
- 0x80000400, // 0002 RET 0
- 0x4C080000, // 0003 LDNIL R2
- 0x1C080202, // 0004 EQ R2 R1 R2
- 0x780A0000, // 0005 JMPF R2 #0007
- 0x540615A3, // 0006 LDINT R1 5540
- 0xB80A0200, // 0007 GETNGBL R2 K1
- 0x8C080502, // 0008 GETMET R2 R2 K2
- 0x60100008, // 0009 GETGBL R4 G8
- 0x5C140200, // 000A MOVE R5 R1
- 0x7C100200, // 000B CALL R4 1
- 0x00120604, // 000C ADD R4 K3 R4
- 0x58140004, // 000D LDCONST R5 K4
- 0x7C080600, // 000E CALL R2 3
- 0xB80A0A00, // 000F GETNGBL R2 K5
- 0x8C080506, // 0010 GETMET R2 R2 K6
- 0x5C100000, // 0011 MOVE R4 R0
- 0x58140007, // 0012 LDCONST R5 K7
- 0x5C180200, // 0013 MOVE R6 R1
- 0x7C080800, // 0014 CALL R2 4
- 0x90020002, // 0015 SETMBR R0 K0 R2
- 0x88080100, // 0016 GETMBR R2 R0 K0
- 0x8C080508, // 0017 GETMET R2 R2 K8
- 0x84100000, // 0018 CLOSURE R4 P0
- 0x7C080400, // 0019 CALL R2 2
- 0xA0000000, // 001A CLOSE R0
- 0x80000000, // 001B RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: signal_endpoints_changed
-********************************************************************/
-be_local_closure(Matter_Device_signal_endpoints_changed, /* name */
- be_nested_proto(
- 7, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 3]) { /* constants */
- /* K0 */ be_nested_str_weak(attribute_updated),
- /* K1 */ be_const_int(0),
- /* K2 */ be_const_int(3),
- }),
- be_str_weak(signal_endpoints_changed),
- &be_const_str_solidified,
- ( &(const binstruction[13]) { /* code */
- 0x8C040100, // 0000 GETMET R1 R0 K0
- 0x580C0001, // 0001 LDCONST R3 K1
- 0x5412001C, // 0002 LDINT R4 29
- 0x58140002, // 0003 LDCONST R5 K2
- 0x50180000, // 0004 LDBOOL R6 0 0
- 0x7C040A00, // 0005 CALL R1 5
- 0x8C040100, // 0006 GETMET R1 R0 K0
- 0x540EFEFF, // 0007 LDINT R3 65280
- 0x5412001C, // 0008 LDINT R4 29
- 0x58140002, // 0009 LDCONST R5 K2
- 0x50180000, // 000A LDBOOL R6 0 0
- 0x7C040A00, // 000B CALL R1 5
- 0x80000000, // 000C RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: sort_distinct
-********************************************************************/
-be_local_closure(Matter_Device_sort_distinct, /* name */
- be_nested_proto(
- 7, /* nstack */
- 1, /* argc */
- 4, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 5]) { /* constants */
- /* K0 */ be_const_class(be_class_Matter_Device),
- /* K1 */ be_const_int(1),
- /* K2 */ be_const_int(0),
- /* K3 */ be_nested_str_weak(stop_iteration),
- /* K4 */ be_nested_str_weak(remove),
- }),
- be_str_weak(sort_distinct),
- &be_const_str_solidified,
- ( &(const binstruction[53]) { /* code */
- 0x58040000, // 0000 LDCONST R1 K0
- 0x60080010, // 0001 GETGBL R2 G16
- 0x600C000C, // 0002 GETGBL R3 G12
- 0x5C100000, // 0003 MOVE R4 R0
- 0x7C0C0200, // 0004 CALL R3 1
- 0x040C0701, // 0005 SUB R3 R3 K1
- 0x400E0203, // 0006 CONNECT R3 K1 R3
- 0x7C080200, // 0007 CALL R2 1
- 0xA8020010, // 0008 EXBLK 0 #001A
- 0x5C0C0400, // 0009 MOVE R3 R2
- 0x7C0C0000, // 000A CALL R3 0
- 0x94100003, // 000B GETIDX R4 R0 R3
- 0x5C140600, // 000C MOVE R5 R3
- 0x24180B02, // 000D GT R6 R5 K2
- 0x781A0008, // 000E JMPF R6 #0018
- 0x04180B01, // 000F SUB R6 R5 K1
- 0x94180006, // 0010 GETIDX R6 R0 R6
- 0x24180C04, // 0011 GT R6 R6 R4
- 0x781A0004, // 0012 JMPF R6 #0018
- 0x04180B01, // 0013 SUB R6 R5 K1
- 0x94180006, // 0014 GETIDX R6 R0 R6
- 0x98000A06, // 0015 SETIDX R0 R5 R6
- 0x04140B01, // 0016 SUB R5 R5 K1
- 0x7001FFF4, // 0017 JMP #000D
- 0x98000A04, // 0018 SETIDX R0 R5 R4
- 0x7001FFEE, // 0019 JMP #0009
- 0x58080003, // 001A LDCONST R2 K3
- 0xAC080200, // 001B CATCH R2 1 0
- 0xB0080000, // 001C RAISE 2 R0 R0
- 0x58080001, // 001D LDCONST R2 K1
- 0x600C000C, // 001E GETGBL R3 G12
- 0x5C100000, // 001F MOVE R4 R0
- 0x7C0C0200, // 0020 CALL R3 1
- 0x180C0701, // 0021 LE R3 R3 K1
- 0x780E0000, // 0022 JMPF R3 #0024
- 0x80040000, // 0023 RET 1 R0
- 0x940C0102, // 0024 GETIDX R3 R0 K2
- 0x6010000C, // 0025 GETGBL R4 G12
- 0x5C140000, // 0026 MOVE R5 R0
- 0x7C100200, // 0027 CALL R4 1
- 0x14100404, // 0028 LT R4 R2 R4
- 0x78120009, // 0029 JMPF R4 #0034
- 0x94100002, // 002A GETIDX R4 R0 R2
- 0x1C100803, // 002B EQ R4 R4 R3
- 0x78120003, // 002C JMPF R4 #0031
- 0x8C100104, // 002D GETMET R4 R0 K4
- 0x5C180400, // 002E MOVE R6 R2
- 0x7C100400, // 002F CALL R4 2
- 0x70020001, // 0030 JMP #0033
- 0x940C0002, // 0031 GETIDX R3 R0 R2
- 0x00080501, // 0032 ADD R2 R2 K1
- 0x7001FFF0, // 0033 JMP #0025
- 0x80040000, // 0034 RET 1 R0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: is_root_commissioning_open
-********************************************************************/
-be_local_closure(Matter_Device_is_root_commissioning_open, /* name */
- be_nested_proto(
- 3, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(commissioning_open),
- /* K1 */ be_nested_str_weak(commissioning_admin_fabric),
- }),
- be_str_weak(is_root_commissioning_open),
- &be_const_str_solidified,
- ( &(const binstruction[11]) { /* code */
- 0x88040100, // 0000 GETMBR R1 R0 K0
- 0x4C080000, // 0001 LDNIL R2
- 0x20040202, // 0002 NE R1 R1 R2
- 0x78060003, // 0003 JMPF R1 #0008
- 0x88040101, // 0004 GETMBR R1 R0 K1
- 0x4C080000, // 0005 LDNIL R2
- 0x1C040202, // 0006 EQ R1 R1 R2
- 0x74060000, // 0007 JMPT R1 #0009
- 0x50040001, // 0008 LDBOOL R1 0 1
- 0x50040200, // 0009 LDBOOL R1 1 0
- 0x80040200, // 000A RET 1 R1
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: register_http_remote
-********************************************************************/
-be_local_closure(Matter_Device_register_http_remote, /* name */
- be_nested_proto(
- 9, /* nstack */
- 3, /* argc */
+ 12, /* nstack */
+ 4, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
@@ -1570,60 +647,42 @@ be_local_closure(Matter_Device_register_http_remote, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 8]) { /* constants */
- /* K0 */ be_nested_str_weak(http_remotes),
- /* K1 */ be_nested_str_weak(contains),
- /* K2 */ be_nested_str_weak(get_timeout),
- /* K3 */ be_nested_str_weak(set_timeout),
- /* K4 */ be_nested_str_weak(matter),
- /* K5 */ be_nested_str_weak(HTTP_remote),
- /* K6 */ be_nested_str_weak(plugins_config_remotes),
- /* K7 */ be_nested_str_weak(set_info),
+ /* K0 */ be_const_int(0),
+ /* K1 */ be_nested_str_weak(endpoint),
+ /* K2 */ be_nested_str_weak(plugins),
+ /* K3 */ be_nested_str_weak(invoke_request),
+ /* K4 */ be_const_int(1),
+ /* K5 */ be_nested_str_weak(status),
+ /* K6 */ be_nested_str_weak(matter),
+ /* K7 */ be_nested_str_weak(UNSUPPORTED_ENDPOINT),
}),
- be_str_weak(register_http_remote),
+ be_str_weak(invoke_request),
&be_const_str_solidified,
- ( &(const binstruction[42]) { /* code */
- 0x880C0100, // 0000 GETMBR R3 R0 K0
- 0x4C100000, // 0001 LDNIL R4
- 0x1C0C0604, // 0002 EQ R3 R3 R4
- 0x780E0002, // 0003 JMPF R3 #0007
- 0x600C0013, // 0004 GETGBL R3 G19
- 0x7C0C0000, // 0005 CALL R3 0
- 0x90020003, // 0006 SETMBR R0 K0 R3
- 0x4C0C0000, // 0007 LDNIL R3
- 0x88100100, // 0008 GETMBR R4 R0 K0
- 0x8C100901, // 0009 GETMET R4 R4 K1
- 0x5C180200, // 000A MOVE R6 R1
- 0x7C100400, // 000B CALL R4 2
- 0x78120009, // 000C JMPF R4 #0017
- 0x88100100, // 000D GETMBR R4 R0 K0
- 0x940C0801, // 000E GETIDX R3 R4 R1
- 0x8C140702, // 000F GETMET R5 R3 K2
- 0x7C140200, // 0010 CALL R5 1
- 0x14140405, // 0011 LT R5 R2 R5
- 0x78160002, // 0012 JMPF R5 #0016
- 0x8C140703, // 0013 GETMET R5 R3 K3
- 0x5C1C0400, // 0014 MOVE R7 R2
- 0x7C140400, // 0015 CALL R5 2
- 0x70020011, // 0016 JMP #0029
- 0xB8120800, // 0017 GETNGBL R4 K4
- 0x8C100905, // 0018 GETMET R4 R4 K5
- 0x5C180000, // 0019 MOVE R6 R0
- 0x5C1C0200, // 001A MOVE R7 R1
- 0x5C200400, // 001B MOVE R8 R2
- 0x7C100800, // 001C CALL R4 4
- 0x5C0C0800, // 001D MOVE R3 R4
- 0x88100106, // 001E GETMBR R4 R0 K6
- 0x8C100901, // 001F GETMET R4 R4 K1
- 0x5C180200, // 0020 MOVE R6 R1
- 0x7C100400, // 0021 CALL R4 2
- 0x78120003, // 0022 JMPF R4 #0027
- 0x8C100707, // 0023 GETMET R4 R3 K7
- 0x88180106, // 0024 GETMBR R6 R0 K6
- 0x94180C01, // 0025 GETIDX R6 R6 R1
- 0x7C100400, // 0026 CALL R4 2
- 0x88100100, // 0027 GETMBR R4 R0 K0
- 0x98100203, // 0028 SETIDX R4 R1 R3
- 0x80040600, // 0029 RET 1 R3
+ ( &(const binstruction[24]) { /* code */
+ 0x58100000, // 0000 LDCONST R4 K0
+ 0x88140701, // 0001 GETMBR R5 R3 K1
+ 0x6018000C, // 0002 GETGBL R6 G12
+ 0x881C0102, // 0003 GETMBR R7 R0 K2
+ 0x7C180200, // 0004 CALL R6 1
+ 0x14180806, // 0005 LT R6 R4 R6
+ 0x781A000C, // 0006 JMPF R6 #0014
+ 0x88180102, // 0007 GETMBR R6 R0 K2
+ 0x94180C04, // 0008 GETIDX R6 R6 R4
+ 0x881C0D01, // 0009 GETMBR R7 R6 K1
+ 0x1C1C0E05, // 000A EQ R7 R7 R5
+ 0x781E0005, // 000B JMPF R7 #0012
+ 0x8C1C0D03, // 000C GETMET R7 R6 K3
+ 0x5C240200, // 000D MOVE R9 R1
+ 0x5C280400, // 000E MOVE R10 R2
+ 0x5C2C0600, // 000F MOVE R11 R3
+ 0x7C1C0800, // 0010 CALL R7 4
+ 0x80040E00, // 0011 RET 1 R7
+ 0x00100904, // 0012 ADD R4 R4 K4
+ 0x7001FFED, // 0013 JMP #0002
+ 0xB81A0C00, // 0014 GETNGBL R6 K6
+ 0x88180D07, // 0015 GETMBR R6 R6 K7
+ 0x900E0A06, // 0016 SETMBR R3 K5 R6
+ 0x80000000, // 0017 RET 0
})
)
);
@@ -1631,362 +690,9 @@ be_local_closure(Matter_Device_register_http_remote, /* name */
/********************************************************************
-** Solidified function: bridge_add_endpoint
+** Solidified function: MtrInfo
********************************************************************/
-be_local_closure(Matter_Device_bridge_add_endpoint, /* name */
- be_nested_proto(
- 17, /* nstack */
- 3, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[21]) { /* constants */
- /* K0 */ be_nested_str_weak(plugins_classes),
- /* K1 */ be_nested_str_weak(find),
- /* K2 */ be_nested_str_weak(tasmota),
- /* K3 */ be_nested_str_weak(log),
- /* K4 */ be_nested_str_weak(MTR_X3A_X20unknown_X20class_X20name_X20_X27),
- /* K5 */ be_nested_str_weak(_X27_X20skipping),
- /* K6 */ be_const_int(3),
- /* K7 */ be_nested_str_weak(next_ep),
- /* K8 */ be_nested_str_weak(plugins),
- /* K9 */ be_nested_str_weak(push),
- /* K10 */ be_nested_str_weak(type),
- /* K11 */ be_nested_str_weak(keys),
- /* K12 */ be_nested_str_weak(stop_iteration),
- /* K13 */ be_nested_str_weak(MTR_X3A_X20adding_X20endpoint_X20_X3D_X20_X25i_X20type_X3A_X25s_X25s),
- /* K14 */ be_nested_str_weak(conf_to_log),
- /* K15 */ be_const_int(2),
- /* K16 */ be_nested_str_weak(plugins_config),
- /* K17 */ be_nested_str_weak(plugins_persist),
- /* K18 */ be_const_int(1),
- /* K19 */ be_nested_str_weak(save_param),
- /* K20 */ be_nested_str_weak(signal_endpoints_changed),
- }),
- be_str_weak(bridge_add_endpoint),
- &be_const_str_solidified,
- ( &(const binstruction[70]) { /* code */
- 0x880C0100, // 0000 GETMBR R3 R0 K0
- 0x8C0C0701, // 0001 GETMET R3 R3 K1
- 0x5C140200, // 0002 MOVE R5 R1
- 0x7C0C0400, // 0003 CALL R3 2
- 0x4C100000, // 0004 LDNIL R4
- 0x1C100604, // 0005 EQ R4 R3 R4
- 0x78120009, // 0006 JMPF R4 #0011
- 0xB8120400, // 0007 GETNGBL R4 K2
- 0x8C100903, // 0008 GETMET R4 R4 K3
- 0x60180008, // 0009 GETGBL R6 G8
- 0x5C1C0200, // 000A MOVE R7 R1
- 0x7C180200, // 000B CALL R6 1
- 0x001A0806, // 000C ADD R6 K4 R6
- 0x00180D05, // 000D ADD R6 R6 K5
- 0x581C0006, // 000E LDCONST R7 K6
- 0x7C100600, // 000F CALL R4 3
- 0x80000800, // 0010 RET 0
- 0x88100107, // 0011 GETMBR R4 R0 K7
- 0x60140008, // 0012 GETGBL R5 G8
- 0x5C180800, // 0013 MOVE R6 R4
- 0x7C140200, // 0014 CALL R5 1
- 0x5C180600, // 0015 MOVE R6 R3
- 0x5C1C0000, // 0016 MOVE R7 R0
- 0x5C200800, // 0017 MOVE R8 R4
- 0x5C240400, // 0018 MOVE R9 R2
- 0x7C180600, // 0019 CALL R6 3
- 0x881C0108, // 001A GETMBR R7 R0 K8
- 0x8C1C0F09, // 001B GETMET R7 R7 K9
- 0x5C240C00, // 001C MOVE R9 R6
- 0x7C1C0400, // 001D CALL R7 2
- 0x601C0013, // 001E GETGBL R7 G19
- 0x7C1C0000, // 001F CALL R7 0
- 0x981E1401, // 0020 SETIDX R7 K10 R1
- 0x60200010, // 0021 GETGBL R8 G16
- 0x8C24050B, // 0022 GETMET R9 R2 K11
- 0x7C240200, // 0023 CALL R9 1
- 0x7C200200, // 0024 CALL R8 1
- 0xA8020004, // 0025 EXBLK 0 #002B
- 0x5C241000, // 0026 MOVE R9 R8
- 0x7C240000, // 0027 CALL R9 0
- 0x94280409, // 0028 GETIDX R10 R2 R9
- 0x981C120A, // 0029 SETIDX R7 R9 R10
- 0x7001FFFA, // 002A JMP #0026
- 0x5820000C, // 002B LDCONST R8 K12
- 0xAC200200, // 002C CATCH R8 1 0
- 0xB0080000, // 002D RAISE 2 R0 R0
- 0xB8220400, // 002E GETNGBL R8 K2
- 0x8C201103, // 002F GETMET R8 R8 K3
- 0x60280018, // 0030 GETGBL R10 G24
- 0x582C000D, // 0031 LDCONST R11 K13
- 0x5C300800, // 0032 MOVE R12 R4
- 0x5C340200, // 0033 MOVE R13 R1
- 0x8C38010E, // 0034 GETMET R14 R0 K14
- 0x5C400400, // 0035 MOVE R16 R2
- 0x7C380400, // 0036 CALL R14 2
- 0x7C280800, // 0037 CALL R10 4
- 0x582C000F, // 0038 LDCONST R11 K15
- 0x7C200600, // 0039 CALL R8 3
- 0x88200110, // 003A GETMBR R8 R0 K16
- 0x98200A07, // 003B SETIDX R8 R5 R7
- 0x50200200, // 003C LDBOOL R8 1 0
- 0x90022208, // 003D SETMBR R0 K17 R8
- 0x88200107, // 003E GETMBR R8 R0 K7
- 0x00201112, // 003F ADD R8 R8 K18
- 0x90020E08, // 0040 SETMBR R0 K7 R8
- 0x8C200113, // 0041 GETMET R8 R0 K19
- 0x7C200200, // 0042 CALL R8 1
- 0x8C200114, // 0043 GETMET R8 R0 K20
- 0x7C200200, // 0044 CALL R8 1
- 0x80040800, // 0045 RET 1 R4
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: mdns_remove_op_discovery_all_fabrics
-********************************************************************/
-be_local_closure(Matter_Device_mdns_remove_op_discovery_all_fabrics, /* name */
- be_nested_proto(
- 6, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 6]) { /* constants */
- /* K0 */ be_nested_str_weak(sessions),
- /* K1 */ be_nested_str_weak(active_fabrics),
- /* K2 */ be_nested_str_weak(get_device_id),
- /* K3 */ be_nested_str_weak(get_fabric_id),
- /* K4 */ be_nested_str_weak(mdns_remove_op_discovery),
- /* K5 */ be_nested_str_weak(stop_iteration),
- }),
- be_str_weak(mdns_remove_op_discovery_all_fabrics),
- &be_const_str_solidified,
- ( &(const binstruction[22]) { /* code */
- 0x60040010, // 0000 GETGBL R1 G16
- 0x88080100, // 0001 GETMBR R2 R0 K0
- 0x8C080501, // 0002 GETMET R2 R2 K1
- 0x7C080200, // 0003 CALL R2 1
- 0x7C040200, // 0004 CALL R1 1
- 0xA802000B, // 0005 EXBLK 0 #0012
- 0x5C080200, // 0006 MOVE R2 R1
- 0x7C080000, // 0007 CALL R2 0
- 0x8C0C0502, // 0008 GETMET R3 R2 K2
- 0x7C0C0200, // 0009 CALL R3 1
- 0x780E0005, // 000A JMPF R3 #0011
- 0x8C0C0503, // 000B GETMET R3 R2 K3
- 0x7C0C0200, // 000C CALL R3 1
- 0x780E0002, // 000D JMPF R3 #0011
- 0x8C0C0104, // 000E GETMET R3 R0 K4
- 0x5C140400, // 000F MOVE R5 R2
- 0x7C0C0400, // 0010 CALL R3 2
- 0x7001FFF3, // 0011 JMP #0006
- 0x58040005, // 0012 LDCONST R1 K5
- 0xAC040200, // 0013 CATCH R1 1 0
- 0xB0080000, // 0014 RAISE 2 R0 R0
- 0x80000000, // 0015 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: load_param
-********************************************************************/
-be_local_closure(Matter_Device_load_param, /* name */
- be_nested_proto(
- 11, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[35]) { /* constants */
- /* K0 */ be_nested_str_weak(crypto),
- /* K1 */ be_nested_str_weak(FILENAME),
- /* K2 */ be_nested_str_weak(read),
- /* K3 */ be_nested_str_weak(close),
- /* K4 */ be_nested_str_weak(json),
- /* K5 */ be_nested_str_weak(load),
- /* K6 */ be_nested_str_weak(root_discriminator),
- /* K7 */ be_nested_str_weak(find),
- /* K8 */ be_nested_str_weak(distinguish),
- /* K9 */ be_nested_str_weak(root_passcode),
- /* K10 */ be_nested_str_weak(passcode),
- /* K11 */ be_nested_str_weak(ipv4only),
- /* K12 */ be_nested_str_weak(disable_bridge_mode),
- /* K13 */ be_nested_str_weak(next_ep),
- /* K14 */ be_nested_str_weak(nextep),
- /* K15 */ be_nested_str_weak(plugins_config),
- /* K16 */ be_nested_str_weak(config),
- /* K17 */ be_nested_str_weak(tasmota),
- /* K18 */ be_nested_str_weak(log),
- /* K19 */ be_nested_str_weak(MTR_X3A_X20load_config_X20_X3D_X20),
- /* K20 */ be_const_int(3),
- /* K21 */ be_nested_str_weak(adjust_next_ep),
- /* K22 */ be_nested_str_weak(plugins_persist),
- /* K23 */ be_nested_str_weak(plugins_config_remotes),
- /* K24 */ be_nested_str_weak(remotes),
- /* K25 */ be_nested_str_weak(MTR_X3A_X20load_remotes_X20_X3D_X20),
- /* K26 */ be_nested_str_weak(io_error),
- /* K27 */ be_nested_str_weak(MTR_X3A_X20Session_Store_X3A_X3Aload_X20Exception_X3A),
- /* K28 */ be_nested_str_weak(_X7C),
- /* K29 */ be_const_int(2),
- /* K30 */ be_nested_str_weak(random),
- /* K31 */ be_nested_str_weak(get),
- /* K32 */ be_const_int(0),
- /* K33 */ be_nested_str_weak(generate_random_passcode),
- /* K34 */ be_nested_str_weak(save_param),
- }),
- be_str_weak(load_param),
- &be_const_str_solidified,
- ( &(const binstruction[127]) { /* code */
- 0xA4060000, // 0000 IMPORT R1 K0
- 0xA802004D, // 0001 EXBLK 0 #0050
- 0x60080011, // 0002 GETGBL R2 G17
- 0x880C0101, // 0003 GETMBR R3 R0 K1
- 0x7C080200, // 0004 CALL R2 1
- 0x8C0C0502, // 0005 GETMET R3 R2 K2
- 0x7C0C0200, // 0006 CALL R3 1
- 0x8C100503, // 0007 GETMET R4 R2 K3
- 0x7C100200, // 0008 CALL R4 1
- 0xA4120800, // 0009 IMPORT R4 K4
- 0x8C140905, // 000A GETMET R5 R4 K5
- 0x5C1C0600, // 000B MOVE R7 R3
- 0x7C140400, // 000C CALL R5 2
- 0x8C180B07, // 000D GETMET R6 R5 K7
- 0x58200008, // 000E LDCONST R8 K8
- 0x88240106, // 000F GETMBR R9 R0 K6
- 0x7C180600, // 0010 CALL R6 3
- 0x90020C06, // 0011 SETMBR R0 K6 R6
- 0x8C180B07, // 0012 GETMET R6 R5 K7
- 0x5820000A, // 0013 LDCONST R8 K10
- 0x88240109, // 0014 GETMBR R9 R0 K9
- 0x7C180600, // 0015 CALL R6 3
- 0x90021206, // 0016 SETMBR R0 K9 R6
- 0x60180017, // 0017 GETGBL R6 G23
- 0x8C1C0B07, // 0018 GETMET R7 R5 K7
- 0x5824000B, // 0019 LDCONST R9 K11
- 0x50280000, // 001A LDBOOL R10 0 0
- 0x7C1C0600, // 001B CALL R7 3
- 0x7C180200, // 001C CALL R6 1
- 0x90021606, // 001D SETMBR R0 K11 R6
- 0x60180017, // 001E GETGBL R6 G23
- 0x8C1C0B07, // 001F GETMET R7 R5 K7
- 0x5824000C, // 0020 LDCONST R9 K12
- 0x50280000, // 0021 LDBOOL R10 0 0
- 0x7C1C0600, // 0022 CALL R7 3
- 0x7C180200, // 0023 CALL R6 1
- 0x90021806, // 0024 SETMBR R0 K12 R6
- 0x8C180B07, // 0025 GETMET R6 R5 K7
- 0x5820000E, // 0026 LDCONST R8 K14
- 0x8824010D, // 0027 GETMBR R9 R0 K13
- 0x7C180600, // 0028 CALL R6 3
- 0x90021A06, // 0029 SETMBR R0 K13 R6
- 0x8C180B07, // 002A GETMET R6 R5 K7
- 0x58200010, // 002B LDCONST R8 K16
- 0x7C180400, // 002C CALL R6 2
- 0x90021E06, // 002D SETMBR R0 K15 R6
- 0x8818010F, // 002E GETMBR R6 R0 K15
- 0x4C1C0000, // 002F LDNIL R7
- 0x20180C07, // 0030 NE R6 R6 R7
- 0x781A000B, // 0031 JMPF R6 #003E
- 0xB81A2200, // 0032 GETNGBL R6 K17
- 0x8C180D12, // 0033 GETMET R6 R6 K18
- 0x60200008, // 0034 GETGBL R8 G8
- 0x8824010F, // 0035 GETMBR R9 R0 K15
- 0x7C200200, // 0036 CALL R8 1
- 0x00222608, // 0037 ADD R8 K19 R8
- 0x58240014, // 0038 LDCONST R9 K20
- 0x7C180600, // 0039 CALL R6 3
- 0x8C180115, // 003A GETMET R6 R0 K21
- 0x7C180200, // 003B CALL R6 1
- 0x50180200, // 003C LDBOOL R6 1 0
- 0x90022C06, // 003D SETMBR R0 K22 R6
- 0x8C180B07, // 003E GETMET R6 R5 K7
- 0x58200018, // 003F LDCONST R8 K24
- 0x60240013, // 0040 GETGBL R9 G19
- 0x7C240000, // 0041 CALL R9 0
- 0x7C180600, // 0042 CALL R6 3
- 0x90022E06, // 0043 SETMBR R0 K23 R6
- 0x88180117, // 0044 GETMBR R6 R0 K23
- 0x781A0007, // 0045 JMPF R6 #004E
- 0xB81A2200, // 0046 GETNGBL R6 K17
- 0x8C180D12, // 0047 GETMET R6 R6 K18
- 0x60200008, // 0048 GETGBL R8 G8
- 0x88240117, // 0049 GETMBR R9 R0 K23
- 0x7C200200, // 004A CALL R8 1
- 0x00223208, // 004B ADD R8 K25 R8
- 0x58240014, // 004C LDCONST R9 K20
- 0x7C180600, // 004D CALL R6 3
- 0xA8040001, // 004E EXBLK 1 1
- 0x70020012, // 004F JMP #0063
- 0xAC080002, // 0050 CATCH R2 0 2
- 0x7002000F, // 0051 JMP #0062
- 0x2010051A, // 0052 NE R4 R2 K26
- 0x7812000C, // 0053 JMPF R4 #0061
- 0xB8122200, // 0054 GETNGBL R4 K17
- 0x8C100912, // 0055 GETMET R4 R4 K18
- 0x60180008, // 0056 GETGBL R6 G8
- 0x5C1C0400, // 0057 MOVE R7 R2
- 0x7C180200, // 0058 CALL R6 1
- 0x001A3606, // 0059 ADD R6 K27 R6
- 0x00180D1C, // 005A ADD R6 R6 K28
- 0x601C0008, // 005B GETGBL R7 G8
- 0x5C200600, // 005C MOVE R8 R3
- 0x7C1C0200, // 005D CALL R7 1
- 0x00180C07, // 005E ADD R6 R6 R7
- 0x581C001D, // 005F LDCONST R7 K29
- 0x7C100600, // 0060 CALL R4 3
- 0x70020000, // 0061 JMP #0063
- 0xB0080000, // 0062 RAISE 2 R0 R0
- 0x50080000, // 0063 LDBOOL R2 0 0
- 0x880C0106, // 0064 GETMBR R3 R0 K6
- 0x4C100000, // 0065 LDNIL R4
- 0x1C0C0604, // 0066 EQ R3 R3 R4
- 0x780E000A, // 0067 JMPF R3 #0073
- 0x8C0C031E, // 0068 GETMET R3 R1 K30
- 0x5814001D, // 0069 LDCONST R5 K29
- 0x7C0C0400, // 006A CALL R3 2
- 0x8C0C071F, // 006B GETMET R3 R3 K31
- 0x58140020, // 006C LDCONST R5 K32
- 0x5818001D, // 006D LDCONST R6 K29
- 0x7C0C0600, // 006E CALL R3 3
- 0x54120FFE, // 006F LDINT R4 4095
- 0x2C0C0604, // 0070 AND R3 R3 R4
- 0x90020C03, // 0071 SETMBR R0 K6 R3
- 0x50080200, // 0072 LDBOOL R2 1 0
- 0x880C0109, // 0073 GETMBR R3 R0 K9
- 0x4C100000, // 0074 LDNIL R4
- 0x1C0C0604, // 0075 EQ R3 R3 R4
- 0x780E0003, // 0076 JMPF R3 #007B
- 0x8C0C0121, // 0077 GETMET R3 R0 K33
- 0x7C0C0200, // 0078 CALL R3 1
- 0x90021203, // 0079 SETMBR R0 K9 R3
- 0x50080200, // 007A LDBOOL R2 1 0
- 0x780A0001, // 007B JMPF R2 #007E
- 0x8C0C0122, // 007C GETMET R3 R0 K34
- 0x7C0C0200, // 007D CALL R3 1
- 0x80000000, // 007E RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: attribute_updated
-********************************************************************/
-be_local_closure(Matter_Device_attribute_updated, /* name */
+be_local_closure(Matter_Device_MtrInfo, /* name */
be_nested_proto(
10, /* nstack */
5, /* argc */
@@ -1997,190 +703,58 @@ be_local_closure(Matter_Device_attribute_updated, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 9]) { /* constants */
- /* K0 */ be_nested_str_weak(matter),
- /* K1 */ be_nested_str_weak(Path),
- /* K2 */ be_nested_str_weak(endpoint),
- /* K3 */ be_nested_str_weak(cluster),
- /* K4 */ be_nested_str_weak(attribute),
- /* K5 */ be_nested_str_weak(message_handler),
- /* K6 */ be_nested_str_weak(im),
- /* K7 */ be_nested_str_weak(subs_shop),
- /* K8 */ be_nested_str_weak(attribute_updated_ctx),
+ /* K0 */ be_nested_str_weak(),
+ /* K1 */ be_nested_str_weak(plugins),
+ /* K2 */ be_nested_str_weak(MtrInfo_one),
+ /* K3 */ be_nested_str_weak(endpoint),
+ /* K4 */ be_nested_str_weak(stop_iteration),
+ /* K5 */ be_nested_str_weak(int),
+ /* K6 */ be_nested_str_weak(find_plugin_by_friendly_name),
+ /* K7 */ be_nested_str_weak(tasmota),
+ /* K8 */ be_nested_str_weak(resp_cmnd_done),
}),
- be_str_weak(attribute_updated),
- &be_const_str_solidified,
- ( &(const binstruction[18]) { /* code */
- 0x4C140000, // 0000 LDNIL R5
- 0x1C140805, // 0001 EQ R5 R4 R5
- 0x78160000, // 0002 JMPF R5 #0004
- 0x50100000, // 0003 LDBOOL R4 0 0
- 0xB8160000, // 0004 GETNGBL R5 K0
- 0x8C140B01, // 0005 GETMET R5 R5 K1
- 0x7C140200, // 0006 CALL R5 1
- 0x90160401, // 0007 SETMBR R5 K2 R1
- 0x90160602, // 0008 SETMBR R5 K3 R2
- 0x90160803, // 0009 SETMBR R5 K4 R3
- 0x88180105, // 000A GETMBR R6 R0 K5
- 0x88180D06, // 000B GETMBR R6 R6 K6
- 0x88180D07, // 000C GETMBR R6 R6 K7
- 0x8C180D08, // 000D GETMET R6 R6 K8
- 0x5C200A00, // 000E MOVE R8 R5
- 0x5C240800, // 000F MOVE R9 R4
- 0x7C180600, // 0010 CALL R6 3
- 0x80000000, // 0011 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: k2l
-********************************************************************/
-be_local_closure(Matter_Device_k2l, /* name */
- be_nested_proto(
- 8, /* nstack */
- 1, /* argc */
- 4, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 6]) { /* constants */
- /* K0 */ be_const_class(be_class_Matter_Device),
- /* K1 */ be_nested_str_weak(keys),
- /* K2 */ be_nested_str_weak(push),
- /* K3 */ be_nested_str_weak(stop_iteration),
- /* K4 */ be_const_int(1),
- /* K5 */ be_const_int(0),
- }),
- be_str_weak(k2l),
- &be_const_str_solidified,
- ( &(const binstruction[50]) { /* code */
- 0x58040000, // 0000 LDCONST R1 K0
- 0x60080012, // 0001 GETGBL R2 G18
- 0x7C080000, // 0002 CALL R2 0
- 0x4C0C0000, // 0003 LDNIL R3
- 0x1C0C0003, // 0004 EQ R3 R0 R3
- 0x780E0000, // 0005 JMPF R3 #0007
- 0x80040400, // 0006 RET 1 R2
- 0x600C0010, // 0007 GETGBL R3 G16
- 0x8C100101, // 0008 GETMET R4 R0 K1
- 0x7C100200, // 0009 CALL R4 1
- 0x7C0C0200, // 000A CALL R3 1
- 0xA8020005, // 000B EXBLK 0 #0012
- 0x5C100600, // 000C MOVE R4 R3
- 0x7C100000, // 000D CALL R4 0
- 0x8C140502, // 000E GETMET R5 R2 K2
- 0x5C1C0800, // 000F MOVE R7 R4
- 0x7C140400, // 0010 CALL R5 2
- 0x7001FFF9, // 0011 JMP #000C
- 0x580C0003, // 0012 LDCONST R3 K3
- 0xAC0C0200, // 0013 CATCH R3 1 0
- 0xB0080000, // 0014 RAISE 2 R0 R0
- 0x600C0010, // 0015 GETGBL R3 G16
- 0x6010000C, // 0016 GETGBL R4 G12
- 0x5C140400, // 0017 MOVE R5 R2
- 0x7C100200, // 0018 CALL R4 1
- 0x04100904, // 0019 SUB R4 R4 K4
- 0x40120804, // 001A CONNECT R4 K4 R4
- 0x7C0C0200, // 001B CALL R3 1
- 0xA8020010, // 001C EXBLK 0 #002E
- 0x5C100600, // 001D MOVE R4 R3
- 0x7C100000, // 001E CALL R4 0
- 0x94140404, // 001F GETIDX R5 R2 R4
- 0x5C180800, // 0020 MOVE R6 R4
- 0x241C0D05, // 0021 GT R7 R6 K5
- 0x781E0008, // 0022 JMPF R7 #002C
- 0x041C0D04, // 0023 SUB R7 R6 K4
- 0x941C0407, // 0024 GETIDX R7 R2 R7
- 0x241C0E05, // 0025 GT R7 R7 R5
- 0x781E0004, // 0026 JMPF R7 #002C
- 0x041C0D04, // 0027 SUB R7 R6 K4
- 0x941C0407, // 0028 GETIDX R7 R2 R7
- 0x98080C07, // 0029 SETIDX R2 R6 R7
- 0x04180D04, // 002A SUB R6 R6 K4
- 0x7001FFF4, // 002B JMP #0021
- 0x98080C05, // 002C SETIDX R2 R6 R5
- 0x7001FFEE, // 002D JMP #001D
- 0x580C0003, // 002E LDCONST R3 K3
- 0xAC0C0200, // 002F CATCH R3 1 0
- 0xB0080000, // 0030 RAISE 2 R0 R0
- 0x80040400, // 0031 RET 1 R2
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: _compute_pbkdf
-********************************************************************/
-be_local_closure(Matter_Device__compute_pbkdf, /* name */
- be_nested_proto(
- 13, /* nstack */
- 4, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[10]) { /* constants */
- /* K0 */ be_nested_str_weak(crypto),
- /* K1 */ be_nested_str_weak(add),
- /* K2 */ be_nested_str_weak(PBKDF2_HMAC_SHA256),
- /* K3 */ be_nested_str_weak(derive),
- /* K4 */ be_const_int(0),
- /* K5 */ be_nested_str_weak(root_w0),
- /* K6 */ be_nested_str_weak(EC_P256),
- /* K7 */ be_nested_str_weak(mod),
- /* K8 */ be_nested_str_weak(root_L),
- /* K9 */ be_nested_str_weak(public_key),
- }),
- be_str_weak(_compute_pbkdf),
+ be_str_weak(MtrInfo),
&be_const_str_solidified,
( &(const binstruction[40]) { /* code */
- 0xA4120000, // 0000 IMPORT R4 K0
- 0x60140015, // 0001 GETGBL R5 G21
- 0x7C140000, // 0002 CALL R5 0
- 0x8C140B01, // 0003 GETMET R5 R5 K1
- 0x5C1C0200, // 0004 MOVE R7 R1
- 0x54220003, // 0005 LDINT R8 4
- 0x7C140600, // 0006 CALL R5 3
- 0x8C180902, // 0007 GETMET R6 R4 K2
- 0x7C180200, // 0008 CALL R6 1
- 0x8C180D03, // 0009 GETMET R6 R6 K3
- 0x5C200A00, // 000A MOVE R8 R5
- 0x5C240600, // 000B MOVE R9 R3
- 0x5C280400, // 000C MOVE R10 R2
- 0x542E004F, // 000D LDINT R11 80
- 0x7C180A00, // 000E CALL R6 5
- 0x541E0026, // 000F LDINT R7 39
- 0x401E0807, // 0010 CONNECT R7 K4 R7
- 0x941C0C07, // 0011 GETIDX R7 R6 R7
- 0x54220027, // 0012 LDINT R8 40
- 0x5426004E, // 0013 LDINT R9 79
- 0x40201009, // 0014 CONNECT R8 R8 R9
- 0x94200C08, // 0015 GETIDX R8 R6 R8
- 0x8C240906, // 0016 GETMET R9 R4 K6
- 0x7C240200, // 0017 CALL R9 1
- 0x8C241307, // 0018 GETMET R9 R9 K7
- 0x5C2C0E00, // 0019 MOVE R11 R7
- 0x7C240400, // 001A CALL R9 2
- 0x90020A09, // 001B SETMBR R0 K5 R9
- 0x8C240906, // 001C GETMET R9 R4 K6
- 0x7C240200, // 001D CALL R9 1
- 0x8C241307, // 001E GETMET R9 R9 K7
- 0x5C2C1000, // 001F MOVE R11 R8
- 0x7C240400, // 0020 CALL R9 2
- 0x8C280906, // 0021 GETMET R10 R4 K6
- 0x7C280200, // 0022 CALL R10 1
- 0x8C281509, // 0023 GETMET R10 R10 K9
- 0x5C301200, // 0024 MOVE R12 R9
- 0x7C280400, // 0025 CALL R10 2
- 0x9002100A, // 0026 SETMBR R0 K8 R10
+ 0x1C140700, // 0000 EQ R5 R3 K0
+ 0x7815FFFF, // 0001 JMPF R5 #0002
+ 0x1C140700, // 0002 EQ R5 R3 K0
+ 0x7816000D, // 0003 JMPF R5 #0012
+ 0x60140010, // 0004 GETGBL R5 G16
+ 0x88180101, // 0005 GETMBR R6 R0 K1
+ 0x7C140200, // 0006 CALL R5 1
+ 0xA8020005, // 0007 EXBLK 0 #000E
+ 0x5C180A00, // 0008 MOVE R6 R5
+ 0x7C180000, // 0009 CALL R6 0
+ 0x8C1C0102, // 000A GETMET R7 R0 K2
+ 0x88240D03, // 000B GETMBR R9 R6 K3
+ 0x7C1C0400, // 000C CALL R7 2
+ 0x7001FFF9, // 000D JMP #0008
+ 0x58140004, // 000E LDCONST R5 K4
+ 0xAC140200, // 000F CATCH R5 1 0
+ 0xB0080000, // 0010 RAISE 2 R0 R0
+ 0x70020011, // 0011 JMP #0024
+ 0x60140004, // 0012 GETGBL R5 G4
+ 0x5C180800, // 0013 MOVE R6 R4
+ 0x7C140200, // 0014 CALL R5 1
+ 0x1C140B05, // 0015 EQ R5 R5 K5
+ 0x78160003, // 0016 JMPF R5 #001B
+ 0x8C140102, // 0017 GETMET R5 R0 K2
+ 0x5C1C0800, // 0018 MOVE R7 R4
+ 0x7C140400, // 0019 CALL R5 2
+ 0x70020008, // 001A JMP #0024
+ 0x8C140106, // 001B GETMET R5 R0 K6
+ 0x5C1C0600, // 001C MOVE R7 R3
+ 0x7C140400, // 001D CALL R5 2
+ 0x4C180000, // 001E LDNIL R6
+ 0x20180A06, // 001F NE R6 R5 R6
+ 0x781A0002, // 0020 JMPF R6 #0024
+ 0x8C180102, // 0021 GETMET R6 R0 K2
+ 0x88200B03, // 0022 GETMBR R8 R5 K3
+ 0x7C180400, // 0023 CALL R6 2
+ 0xB8160E00, // 0024 GETNGBL R5 K7
+ 0x8C140B08, // 0025 GETMET R5 R5 K8
+ 0x7C140200, // 0026 CALL R5 1
0x80000000, // 0027 RET 0
})
)
@@ -2188,1766 +762,6 @@ be_local_closure(Matter_Device__compute_pbkdf, /* name */
/*******************************************************************/
-/********************************************************************
-** Solidified function: register_commands
-********************************************************************/
-be_local_closure(Matter_Device_register_commands, /* name */
- be_nested_proto(
- 5, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 1, /* has sup protos */
- ( &(const struct bproto*[ 3]) {
- be_nested_proto(
- 10, /* nstack */
- 4, /* argc */
- 0, /* varg */
- 1, /* has upvals */
- ( &(const bupvaldesc[ 1]) { /* upvals */
- be_local_const_upval(1, 0),
- }),
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(MtrJoin),
- }),
- be_str_weak(_X3Clambda_X3E),
- &be_const_str_solidified,
- ( &(const binstruction[ 8]) { /* code */
- 0x68100000, // 0000 GETUPV R4 U0
- 0x8C100900, // 0001 GETMET R4 R4 K0
- 0x5C180000, // 0002 MOVE R6 R0
- 0x5C1C0200, // 0003 MOVE R7 R1
- 0x5C200400, // 0004 MOVE R8 R2
- 0x5C240600, // 0005 MOVE R9 R3
- 0x7C100A00, // 0006 CALL R4 5
- 0x80040800, // 0007 RET 1 R4
- })
- ),
- be_nested_proto(
- 10, /* nstack */
- 4, /* argc */
- 0, /* varg */
- 1, /* has upvals */
- ( &(const bupvaldesc[ 1]) { /* upvals */
- be_local_const_upval(1, 0),
- }),
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(MtrUpdate),
- }),
- be_str_weak(_X3Clambda_X3E),
- &be_const_str_solidified,
- ( &(const binstruction[ 8]) { /* code */
- 0x68100000, // 0000 GETUPV R4 U0
- 0x8C100900, // 0001 GETMET R4 R4 K0
- 0x5C180000, // 0002 MOVE R6 R0
- 0x5C1C0200, // 0003 MOVE R7 R1
- 0x5C200400, // 0004 MOVE R8 R2
- 0x5C240600, // 0005 MOVE R9 R3
- 0x7C100A00, // 0006 CALL R4 5
- 0x80040800, // 0007 RET 1 R4
- })
- ),
- be_nested_proto(
- 10, /* nstack */
- 4, /* argc */
- 0, /* varg */
- 1, /* has upvals */
- ( &(const bupvaldesc[ 1]) { /* upvals */
- be_local_const_upval(1, 0),
- }),
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(MtrInfo),
- }),
- be_str_weak(_X3Clambda_X3E),
- &be_const_str_solidified,
- ( &(const binstruction[ 8]) { /* code */
- 0x68100000, // 0000 GETUPV R4 U0
- 0x8C100900, // 0001 GETMET R4 R4 K0
- 0x5C180000, // 0002 MOVE R6 R0
- 0x5C1C0200, // 0003 MOVE R7 R1
- 0x5C200400, // 0004 MOVE R8 R2
- 0x5C240600, // 0005 MOVE R9 R3
- 0x7C100A00, // 0006 CALL R4 5
- 0x80040800, // 0007 RET 1 R4
- })
- ),
- }),
- 1, /* has constants */
- ( &(const bvalue[ 5]) { /* constants */
- /* K0 */ be_nested_str_weak(tasmota),
- /* K1 */ be_nested_str_weak(add_cmd),
- /* K2 */ be_nested_str_weak(MtrJoin),
- /* K3 */ be_nested_str_weak(MtrUpdate),
- /* K4 */ be_nested_str_weak(MtrInfo),
- }),
- be_str_weak(register_commands),
- &be_const_str_solidified,
- ( &(const binstruction[17]) { /* code */
- 0xB8060000, // 0000 GETNGBL R1 K0
- 0x8C040301, // 0001 GETMET R1 R1 K1
- 0x580C0002, // 0002 LDCONST R3 K2
- 0x84100000, // 0003 CLOSURE R4 P0
- 0x7C040600, // 0004 CALL R1 3
- 0xB8060000, // 0005 GETNGBL R1 K0
- 0x8C040301, // 0006 GETMET R1 R1 K1
- 0x580C0003, // 0007 LDCONST R3 K3
- 0x84100001, // 0008 CLOSURE R4 P1
- 0x7C040600, // 0009 CALL R1 3
- 0xB8060000, // 000A GETNGBL R1 K0
- 0x8C040301, // 000B GETMET R1 R1 K1
- 0x580C0004, // 000C LDCONST R3 K4
- 0x84100002, // 000D CLOSURE R4 P2
- 0x7C040600, // 000E CALL R1 3
- 0xA0000000, // 000F CLOSE R0
- 0x80000000, // 0010 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: init
-********************************************************************/
-be_local_closure(Matter_Device_init, /* name */
- be_nested_proto(
- 7, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 1, /* has sup protos */
- ( &(const struct bproto*[ 2]) {
- be_nested_proto(
- 4, /* nstack */
- 0, /* argc */
- 0, /* varg */
- 1, /* has upvals */
- ( &(const bupvaldesc[ 1]) { /* upvals */
- be_local_const_upval(1, 0),
- }),
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 5]) { /* constants */
- /* K0 */ be_nested_str_weak(start),
- /* K1 */ be_nested_str_weak(tasmota),
- /* K2 */ be_nested_str_weak(remove_rule),
- /* K3 */ be_nested_str_weak(Wifi_X23Connected),
- /* K4 */ be_nested_str_weak(matter_start),
- }),
- be_str_weak(_anonymous_),
- &be_const_str_solidified,
- ( &(const binstruction[ 9]) { /* code */
- 0x68000000, // 0000 GETUPV R0 U0
- 0x8C000100, // 0001 GETMET R0 R0 K0
- 0x7C000200, // 0002 CALL R0 1
- 0xB8020200, // 0003 GETNGBL R0 K1
- 0x8C000102, // 0004 GETMET R0 R0 K2
- 0x58080003, // 0005 LDCONST R2 K3
- 0x580C0004, // 0006 LDCONST R3 K4
- 0x7C000600, // 0007 CALL R0 3
- 0x80000000, // 0008 RET 0
- })
- ),
- be_nested_proto(
- 4, /* nstack */
- 0, /* argc */
- 0, /* varg */
- 1, /* has upvals */
- ( &(const bupvaldesc[ 1]) { /* upvals */
- be_local_const_upval(1, 0),
- }),
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 5]) { /* constants */
- /* K0 */ be_nested_str_weak(start),
- /* K1 */ be_nested_str_weak(tasmota),
- /* K2 */ be_nested_str_weak(remove_rule),
- /* K3 */ be_nested_str_weak(Eth_X23Connected),
- /* K4 */ be_nested_str_weak(matter_start),
- }),
- be_str_weak(_anonymous_),
- &be_const_str_solidified,
- ( &(const binstruction[ 9]) { /* code */
- 0x68000000, // 0000 GETUPV R0 U0
- 0x8C000100, // 0001 GETMET R0 R0 K0
- 0x7C000200, // 0002 CALL R0 1
- 0xB8020200, // 0003 GETNGBL R0 K1
- 0x8C000102, // 0004 GETMET R0 R0 K2
- 0x58080003, // 0005 LDCONST R2 K3
- 0x580C0004, // 0006 LDCONST R3 K4
- 0x7C000600, // 0007 CALL R0 3
- 0x80000000, // 0008 RET 0
- })
- ),
- }),
- 1, /* has constants */
- ( &(const bvalue[44]) { /* constants */
- /* K0 */ be_nested_str_weak(crypto),
- /* K1 */ be_nested_str_weak(tasmota),
- /* K2 */ be_nested_str_weak(get_option),
- /* K3 */ be_nested_str_weak(matter),
- /* K4 */ be_nested_str_weak(MATTER_OPTION),
- /* K5 */ be_nested_str_weak(UI),
- /* K6 */ be_nested_str_weak(profiler),
- /* K7 */ be_nested_str_weak(Profiler),
- /* K8 */ be_nested_str_weak(started),
- /* K9 */ be_nested_str_weak(tick),
- /* K10 */ be_const_int(0),
- /* K11 */ be_nested_str_weak(plugins),
- /* K12 */ be_nested_str_weak(plugins_persist),
- /* K13 */ be_nested_str_weak(plugins_config_remotes),
- /* K14 */ be_nested_str_weak(vendorid),
- /* K15 */ be_nested_str_weak(VENDOR_ID),
- /* K16 */ be_nested_str_weak(productid),
- /* K17 */ be_nested_str_weak(PRODUCT_ID),
- /* K18 */ be_nested_str_weak(root_iterations),
- /* K19 */ be_nested_str_weak(PBKDF_ITERATIONS),
- /* K20 */ be_nested_str_weak(next_ep),
- /* K21 */ be_const_int(1),
- /* K22 */ be_nested_str_weak(root_salt),
- /* K23 */ be_nested_str_weak(random),
- /* K24 */ be_nested_str_weak(ipv4only),
- /* K25 */ be_nested_str_weak(disable_bridge_mode),
- /* K26 */ be_nested_str_weak(load_param),
- /* K27 */ be_nested_str_weak(sessions),
- /* K28 */ be_nested_str_weak(Session_Store),
- /* K29 */ be_nested_str_weak(load_fabrics),
- /* K30 */ be_nested_str_weak(message_handler),
- /* K31 */ be_nested_str_weak(MessageHandler),
- /* K32 */ be_nested_str_weak(ui),
- /* K33 */ be_nested_str_weak(wifi),
- /* K34 */ be_nested_str_weak(up),
- /* K35 */ be_nested_str_weak(eth),
- /* K36 */ be_nested_str_weak(start),
- /* K37 */ be_nested_str_weak(add_rule),
- /* K38 */ be_nested_str_weak(Wifi_X23Connected),
- /* K39 */ be_nested_str_weak(matter_start),
- /* K40 */ be_nested_str_weak(Eth_X23Connected),
- /* K41 */ be_nested_str_weak(_init_basic_commissioning),
- /* K42 */ be_nested_str_weak(add_driver),
- /* K43 */ be_nested_str_weak(register_commands),
- }),
- be_str_weak(init),
- &be_const_str_solidified,
- ( &(const binstruction[107]) { /* code */
- 0xA4060000, // 0000 IMPORT R1 K0
- 0xB80A0200, // 0001 GETNGBL R2 K1
- 0x8C080502, // 0002 GETMET R2 R2 K2
- 0xB8120600, // 0003 GETNGBL R4 K3
- 0x88100904, // 0004 GETMBR R4 R4 K4
- 0x7C080400, // 0005 CALL R2 2
- 0x740A0004, // 0006 JMPT R2 #000C
- 0xB80A0600, // 0007 GETNGBL R2 K3
- 0x8C080505, // 0008 GETMET R2 R2 K5
- 0x5C100000, // 0009 MOVE R4 R0
- 0x7C080400, // 000A CALL R2 2
- 0x80000400, // 000B RET 0
- 0xB80A0600, // 000C GETNGBL R2 K3
- 0xB80E0600, // 000D GETNGBL R3 K3
- 0x8C0C0707, // 000E GETMET R3 R3 K7
- 0x7C0C0200, // 000F CALL R3 1
- 0x900A0C03, // 0010 SETMBR R2 K6 R3
- 0x50080000, // 0011 LDBOOL R2 0 0
- 0x90021002, // 0012 SETMBR R0 K8 R2
- 0x9002130A, // 0013 SETMBR R0 K9 K10
- 0x60080012, // 0014 GETGBL R2 G18
- 0x7C080000, // 0015 CALL R2 0
- 0x90021602, // 0016 SETMBR R0 K11 R2
- 0x50080000, // 0017 LDBOOL R2 0 0
- 0x90021802, // 0018 SETMBR R0 K12 R2
- 0x60080013, // 0019 GETGBL R2 G19
- 0x7C080000, // 001A CALL R2 0
- 0x90021A02, // 001B SETMBR R0 K13 R2
- 0x8808010F, // 001C GETMBR R2 R0 K15
- 0x90021C02, // 001D SETMBR R0 K14 R2
- 0x88080111, // 001E GETMBR R2 R0 K17
- 0x90022002, // 001F SETMBR R0 K16 R2
- 0x88080113, // 0020 GETMBR R2 R0 K19
- 0x90022402, // 0021 SETMBR R0 K18 R2
- 0x90022915, // 0022 SETMBR R0 K20 K21
- 0x8C080317, // 0023 GETMET R2 R1 K23
- 0x5412000F, // 0024 LDINT R4 16
- 0x7C080400, // 0025 CALL R2 2
- 0x90022C02, // 0026 SETMBR R0 K22 R2
- 0x50080000, // 0027 LDBOOL R2 0 0
- 0x90023002, // 0028 SETMBR R0 K24 R2
- 0x50080000, // 0029 LDBOOL R2 0 0
- 0x90023202, // 002A SETMBR R0 K25 R2
- 0x8C08011A, // 002B GETMET R2 R0 K26
- 0x7C080200, // 002C CALL R2 1
- 0xB80A0600, // 002D GETNGBL R2 K3
- 0x8C08051C, // 002E GETMET R2 R2 K28
- 0x5C100000, // 002F MOVE R4 R0
- 0x7C080400, // 0030 CALL R2 2
- 0x90023602, // 0031 SETMBR R0 K27 R2
- 0x8808011B, // 0032 GETMBR R2 R0 K27
- 0x8C08051D, // 0033 GETMET R2 R2 K29
- 0x7C080200, // 0034 CALL R2 1
- 0xB80A0600, // 0035 GETNGBL R2 K3
- 0x8C08051F, // 0036 GETMET R2 R2 K31
- 0x5C100000, // 0037 MOVE R4 R0
- 0x7C080400, // 0038 CALL R2 2
- 0x90023C02, // 0039 SETMBR R0 K30 R2
- 0xB80A0600, // 003A GETNGBL R2 K3
- 0x8C080505, // 003B GETMET R2 R2 K5
- 0x5C100000, // 003C MOVE R4 R0
- 0x7C080400, // 003D CALL R2 2
- 0x90024002, // 003E SETMBR R0 K32 R2
- 0xB80A0200, // 003F GETNGBL R2 K1
- 0x8C080521, // 0040 GETMET R2 R2 K33
- 0x7C080200, // 0041 CALL R2 1
- 0x94080522, // 0042 GETIDX R2 R2 K34
- 0x740A0004, // 0043 JMPT R2 #0049
- 0xB80A0200, // 0044 GETNGBL R2 K1
- 0x8C080523, // 0045 GETMET R2 R2 K35
- 0x7C080200, // 0046 CALL R2 1
- 0x94080522, // 0047 GETIDX R2 R2 K34
- 0x780A0001, // 0048 JMPF R2 #004B
- 0x8C080124, // 0049 GETMET R2 R0 K36
- 0x7C080200, // 004A CALL R2 1
- 0xB80A0200, // 004B GETNGBL R2 K1
- 0x8C080521, // 004C GETMET R2 R2 K33
- 0x7C080200, // 004D CALL R2 1
- 0x94080522, // 004E GETIDX R2 R2 K34
- 0x740A0005, // 004F JMPT R2 #0056
- 0xB80A0200, // 0050 GETNGBL R2 K1
- 0x8C080525, // 0051 GETMET R2 R2 K37
- 0x58100026, // 0052 LDCONST R4 K38
- 0x84140000, // 0053 CLOSURE R5 P0
- 0x58180027, // 0054 LDCONST R6 K39
- 0x7C080800, // 0055 CALL R2 4
- 0xB80A0200, // 0056 GETNGBL R2 K1
- 0x8C080523, // 0057 GETMET R2 R2 K35
- 0x7C080200, // 0058 CALL R2 1
- 0x94080522, // 0059 GETIDX R2 R2 K34
- 0x740A0005, // 005A JMPT R2 #0061
- 0xB80A0200, // 005B GETNGBL R2 K1
- 0x8C080525, // 005C GETMET R2 R2 K37
- 0x58100028, // 005D LDCONST R4 K40
- 0x84140001, // 005E CLOSURE R5 P1
- 0x58180027, // 005F LDCONST R6 K39
- 0x7C080800, // 0060 CALL R2 4
- 0x8C080129, // 0061 GETMET R2 R0 K41
- 0x7C080200, // 0062 CALL R2 1
- 0xB80A0200, // 0063 GETNGBL R2 K1
- 0x8C08052A, // 0064 GETMET R2 R2 K42
- 0x5C100000, // 0065 MOVE R4 R0
- 0x7C080400, // 0066 CALL R2 2
- 0x8C08012B, // 0067 GETMET R2 R0 K43
- 0x7C080200, // 0068 CALL R2 1
- 0xA0000000, // 0069 CLOSE R0
- 0x80000000, // 006A RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: adjust_next_ep
-********************************************************************/
-be_local_closure(Matter_Device_adjust_next_ep, /* name */
- be_nested_proto(
- 5, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 5]) { /* constants */
- /* K0 */ be_nested_str_weak(plugins_config),
- /* K1 */ be_nested_str_weak(keys),
- /* K2 */ be_nested_str_weak(next_ep),
- /* K3 */ be_const_int(1),
- /* K4 */ be_nested_str_weak(stop_iteration),
- }),
- be_str_weak(adjust_next_ep),
- &be_const_str_solidified,
- ( &(const binstruction[21]) { /* code */
- 0x60040010, // 0000 GETGBL R1 G16
- 0x88080100, // 0001 GETMBR R2 R0 K0
- 0x8C080501, // 0002 GETMET R2 R2 K1
- 0x7C080200, // 0003 CALL R2 1
- 0x7C040200, // 0004 CALL R1 1
- 0xA802000A, // 0005 EXBLK 0 #0011
- 0x5C080200, // 0006 MOVE R2 R1
- 0x7C080000, // 0007 CALL R2 0
- 0x600C0009, // 0008 GETGBL R3 G9
- 0x5C100400, // 0009 MOVE R4 R2
- 0x7C0C0200, // 000A CALL R3 1
- 0x88100102, // 000B GETMBR R4 R0 K2
- 0x28100604, // 000C GE R4 R3 R4
- 0x78120001, // 000D JMPF R4 #0010
- 0x00100703, // 000E ADD R4 R3 K3
- 0x90020404, // 000F SETMBR R0 K2 R4
- 0x7001FFF4, // 0010 JMP #0006
- 0x58040004, // 0011 LDCONST R1 K4
- 0xAC040200, // 0012 CATCH R1 1 0
- 0xB0080000, // 0013 RAISE 2 R0 R0
- 0x80000000, // 0014 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: conf_to_log
-********************************************************************/
-be_local_closure(Matter_Device_conf_to_log, /* name */
- be_nested_proto(
- 9, /* nstack */
- 1, /* argc */
- 4, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 6]) { /* constants */
- /* K0 */ be_const_class(be_class_Matter_Device),
- /* K1 */ be_nested_str_weak(),
- /* K2 */ be_nested_str_weak(k2l),
- /* K3 */ be_nested_str_weak(type),
- /* K4 */ be_nested_str_weak(_X20_X25s_X3A_X25s),
- /* K5 */ be_nested_str_weak(stop_iteration),
- }),
- be_str_weak(conf_to_log),
- &be_const_str_solidified,
- ( &(const binstruction[24]) { /* code */
- 0x58040000, // 0000 LDCONST R1 K0
- 0x58080001, // 0001 LDCONST R2 K1
- 0x600C0010, // 0002 GETGBL R3 G16
- 0x8C100302, // 0003 GETMET R4 R1 K2
- 0x5C180000, // 0004 MOVE R6 R0
- 0x7C100400, // 0005 CALL R4 2
- 0x7C0C0200, // 0006 CALL R3 1
- 0xA802000B, // 0007 EXBLK 0 #0014
- 0x5C100600, // 0008 MOVE R4 R3
- 0x7C100000, // 0009 CALL R4 0
- 0x1C140903, // 000A EQ R5 R4 K3
- 0x78160000, // 000B JMPF R5 #000D
- 0x7001FFFA, // 000C JMP #0008
- 0x60140018, // 000D GETGBL R5 G24
- 0x58180004, // 000E LDCONST R6 K4
- 0x5C1C0800, // 000F MOVE R7 R4
- 0x94200004, // 0010 GETIDX R8 R0 R4
- 0x7C140600, // 0011 CALL R5 3
- 0x00080405, // 0012 ADD R2 R2 R5
- 0x7001FFF3, // 0013 JMP #0008
- 0x580C0005, // 0014 LDCONST R3 K5
- 0xAC0C0200, // 0015 CATCH R3 1 0
- 0xB0080000, // 0016 RAISE 2 R0 R0
- 0x80040400, // 0017 RET 1 R2
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: every_50ms
-********************************************************************/
-be_local_closure(Matter_Device_every_50ms, /* name */
- be_nested_proto(
- 2, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(tick),
- /* K1 */ be_const_int(1),
- }),
- be_str_weak(every_50ms),
- &be_const_str_solidified,
- ( &(const binstruction[ 4]) { /* code */
- 0x88040100, // 0000 GETMBR R1 R0 K0
- 0x00040301, // 0001 ADD R1 R1 K1
- 0x90020001, // 0002 SETMBR R0 K0 R1
- 0x80000000, // 0003 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: k2l_num
-********************************************************************/
-be_local_closure(Matter_Device_k2l_num, /* name */
- be_nested_proto(
- 9, /* nstack */
- 1, /* argc */
- 4, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 6]) { /* constants */
- /* K0 */ be_const_class(be_class_Matter_Device),
- /* K1 */ be_nested_str_weak(keys),
- /* K2 */ be_nested_str_weak(push),
- /* K3 */ be_nested_str_weak(stop_iteration),
- /* K4 */ be_const_int(1),
- /* K5 */ be_const_int(0),
- }),
- be_str_weak(k2l_num),
- &be_const_str_solidified,
- ( &(const binstruction[52]) { /* code */
- 0x58040000, // 0000 LDCONST R1 K0
- 0x60080012, // 0001 GETGBL R2 G18
- 0x7C080000, // 0002 CALL R2 0
- 0x4C0C0000, // 0003 LDNIL R3
- 0x1C0C0003, // 0004 EQ R3 R0 R3
- 0x780E0000, // 0005 JMPF R3 #0007
- 0x80040400, // 0006 RET 1 R2
- 0x600C0010, // 0007 GETGBL R3 G16
- 0x8C100101, // 0008 GETMET R4 R0 K1
- 0x7C100200, // 0009 CALL R4 1
- 0x7C0C0200, // 000A CALL R3 1
- 0xA8020007, // 000B EXBLK 0 #0014
- 0x5C100600, // 000C MOVE R4 R3
- 0x7C100000, // 000D CALL R4 0
- 0x8C140502, // 000E GETMET R5 R2 K2
- 0x601C0009, // 000F GETGBL R7 G9
- 0x5C200800, // 0010 MOVE R8 R4
- 0x7C1C0200, // 0011 CALL R7 1
- 0x7C140400, // 0012 CALL R5 2
- 0x7001FFF7, // 0013 JMP #000C
- 0x580C0003, // 0014 LDCONST R3 K3
- 0xAC0C0200, // 0015 CATCH R3 1 0
- 0xB0080000, // 0016 RAISE 2 R0 R0
- 0x600C0010, // 0017 GETGBL R3 G16
- 0x6010000C, // 0018 GETGBL R4 G12
- 0x5C140400, // 0019 MOVE R5 R2
- 0x7C100200, // 001A CALL R4 1
- 0x04100904, // 001B SUB R4 R4 K4
- 0x40120804, // 001C CONNECT R4 K4 R4
- 0x7C0C0200, // 001D CALL R3 1
- 0xA8020010, // 001E EXBLK 0 #0030
- 0x5C100600, // 001F MOVE R4 R3
- 0x7C100000, // 0020 CALL R4 0
- 0x94140404, // 0021 GETIDX R5 R2 R4
- 0x5C180800, // 0022 MOVE R6 R4
- 0x241C0D05, // 0023 GT R7 R6 K5
- 0x781E0008, // 0024 JMPF R7 #002E
- 0x041C0D04, // 0025 SUB R7 R6 K4
- 0x941C0407, // 0026 GETIDX R7 R2 R7
- 0x241C0E05, // 0027 GT R7 R7 R5
- 0x781E0004, // 0028 JMPF R7 #002E
- 0x041C0D04, // 0029 SUB R7 R6 K4
- 0x941C0407, // 002A GETIDX R7 R2 R7
- 0x98080C07, // 002B SETIDX R2 R6 R7
- 0x04180D04, // 002C SUB R6 R6 K4
- 0x7001FFF4, // 002D JMP #0023
- 0x98080C05, // 002E SETIDX R2 R6 R5
- 0x7001FFEE, // 002F JMP #001F
- 0x580C0003, // 0030 LDCONST R3 K3
- 0xAC0C0200, // 0031 CATCH R3 1 0
- 0xB0080000, // 0032 RAISE 2 R0 R0
- 0x80040400, // 0033 RET 1 R2
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: get_plugin_class_arg
-********************************************************************/
-be_local_closure(Matter_Device_get_plugin_class_arg, /* name */
- be_nested_proto(
- 5, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_nested_str_weak(plugins_classes),
- /* K1 */ be_nested_str_weak(find),
- /* K2 */ be_nested_str_weak(ARG),
- /* K3 */ be_nested_str_weak(),
- }),
- be_str_weak(get_plugin_class_arg),
- &be_const_str_solidified,
- ( &(const binstruction[ 9]) { /* code */
- 0x88080100, // 0000 GETMBR R2 R0 K0
- 0x8C080501, // 0001 GETMET R2 R2 K1
- 0x5C100200, // 0002 MOVE R4 R1
- 0x7C080400, // 0003 CALL R2 2
- 0x780A0001, // 0004 JMPF R2 #0007
- 0x880C0502, // 0005 GETMBR R3 R2 K2
- 0x70020000, // 0006 JMP #0008
- 0x580C0003, // 0007 LDCONST R3 K3
- 0x80040600, // 0008 RET 1 R3
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: autoconf_device_map
-********************************************************************/
-be_local_closure(Matter_Device_autoconf_device_map, /* name */
- be_nested_proto(
- 20, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[36]) { /* constants */
- /* K0 */ be_nested_str_weak(json),
- /* K1 */ be_const_int(1),
- /* K2 */ be_nested_str_weak(light),
- /* K3 */ be_nested_str_weak(get),
- /* K4 */ be_nested_str_weak(find),
- /* K5 */ be_nested_str_weak(channels),
- /* K6 */ be_nested_str_weak(),
- /* K7 */ be_const_int(0),
- /* K8 */ be_nested_str_weak(type),
- /* K9 */ be_nested_str_weak(light1),
- /* K10 */ be_const_int(2),
- /* K11 */ be_nested_str_weak(light2),
- /* K12 */ be_nested_str_weak(light3),
- /* K13 */ be_nested_str_weak(tasmota),
- /* K14 */ be_nested_str_weak(cmd),
- /* K15 */ be_nested_str_weak(Status_X2013),
- /* K16 */ be_nested_str_weak(log),
- /* K17 */ be_nested_str_weak(MTR_X3A_X20Status_X2013_X20_X3D_X20),
- /* K18 */ be_const_int(3),
- /* K19 */ be_nested_str_weak(contains),
- /* K20 */ be_nested_str_weak(StatusSHT),
- /* K21 */ be_nested_str_weak(SHT),
- /* K22 */ be_nested_str_weak(MTR_X3A_X20_X27_X25s_X27_X20_X3D_X20_X25s),
- /* K23 */ be_nested_str_weak(Relay1),
- /* K24 */ be_nested_str_weak(Relay2),
- /* K25 */ be_nested_str_weak(push),
- /* K26 */ be_nested_str_weak(MTR_X3A_X20relay1_X3D_X25s_X20relay2_X3D_X25s),
- /* K27 */ be_nested_str_weak(TiltConfig),
- /* K28 */ be_nested_str_weak(shutter_X2Btilt),
- /* K29 */ be_nested_str_weak(shutter),
- /* K30 */ be_nested_str_weak(get_power),
- /* K31 */ be_nested_str_weak(relay),
- /* K32 */ be_nested_str_weak(load),
- /* K33 */ be_nested_str_weak(read_sensors),
- /* K34 */ be_nested_str_weak(autoconf_sensors_list),
- /* K35 */ be_nested_str_weak(stop_iteration),
- }),
- be_str_weak(autoconf_device_map),
- &be_const_str_solidified,
- ( &(const binstruction[198]) { /* code */
- 0xA4060000, // 0000 IMPORT R1 K0
- 0x60080013, // 0001 GETGBL R2 G19
- 0x7C080000, // 0002 CALL R2 0
- 0x580C0001, // 0003 LDCONST R3 K1
- 0x50100000, // 0004 LDBOOL R4 0 0
- 0xA4160400, // 0005 IMPORT R5 K2
- 0x8C180B03, // 0006 GETMET R6 R5 K3
- 0x7C180200, // 0007 CALL R6 1
- 0x4C1C0000, // 0008 LDNIL R7
- 0x201C0C07, // 0009 NE R7 R6 R7
- 0x781E0024, // 000A JMPF R7 #0030
- 0x601C000C, // 000B GETGBL R7 G12
- 0x8C200D04, // 000C GETMET R8 R6 K4
- 0x58280005, // 000D LDCONST R10 K5
- 0x582C0006, // 000E LDCONST R11 K6
- 0x7C200600, // 000F CALL R8 3
- 0x7C1C0200, // 0010 CALL R7 1
- 0x24200F07, // 0011 GT R8 R7 K7
- 0x7822001C, // 0012 JMPF R8 #0030
- 0x1C200F01, // 0013 EQ R8 R7 K1
- 0x78220007, // 0014 JMPF R8 #001D
- 0x60200008, // 0015 GETGBL R8 G8
- 0x5C240600, // 0016 MOVE R9 R3
- 0x7C200200, // 0017 CALL R8 1
- 0x60240013, // 0018 GETGBL R9 G19
- 0x7C240000, // 0019 CALL R9 0
- 0x98261109, // 001A SETIDX R9 K8 K9
- 0x98081009, // 001B SETIDX R2 R8 R9
- 0x70020010, // 001C JMP #002E
- 0x1C200F0A, // 001D EQ R8 R7 K10
- 0x78220007, // 001E JMPF R8 #0027
- 0x60200008, // 001F GETGBL R8 G8
- 0x5C240600, // 0020 MOVE R9 R3
- 0x7C200200, // 0021 CALL R8 1
- 0x60240013, // 0022 GETGBL R9 G19
- 0x7C240000, // 0023 CALL R9 0
- 0x9826110B, // 0024 SETIDX R9 K8 K11
- 0x98081009, // 0025 SETIDX R2 R8 R9
- 0x70020006, // 0026 JMP #002E
- 0x60200008, // 0027 GETGBL R8 G8
- 0x5C240600, // 0028 MOVE R9 R3
- 0x7C200200, // 0029 CALL R8 1
- 0x60240013, // 002A GETGBL R9 G19
- 0x7C240000, // 002B CALL R9 0
- 0x9826110C, // 002C SETIDX R9 K8 K12
- 0x98081009, // 002D SETIDX R2 R8 R9
- 0x50100200, // 002E LDBOOL R4 1 0
- 0x000C0701, // 002F ADD R3 R3 K1
- 0xB81E1A00, // 0030 GETNGBL R7 K13
- 0x8C1C0F0E, // 0031 GETMET R7 R7 K14
- 0x5824000F, // 0032 LDCONST R9 K15
- 0x50280200, // 0033 LDBOOL R10 1 0
- 0x7C1C0600, // 0034 CALL R7 3
- 0x60200012, // 0035 GETGBL R8 G18
- 0x7C200000, // 0036 CALL R8 0
- 0xB8261A00, // 0037 GETNGBL R9 K13
- 0x8C241310, // 0038 GETMET R9 R9 K16
- 0x602C0008, // 0039 GETGBL R11 G8
- 0x5C300E00, // 003A MOVE R12 R7
- 0x7C2C0200, // 003B CALL R11 1
- 0x002E220B, // 003C ADD R11 K17 R11
- 0x58300012, // 003D LDCONST R12 K18
- 0x7C240600, // 003E CALL R9 3
- 0x4C240000, // 003F LDNIL R9
- 0x20240E09, // 0040 NE R9 R7 R9
- 0x7826004F, // 0041 JMPF R9 #0092
- 0x8C240F13, // 0042 GETMET R9 R7 K19
- 0x582C0014, // 0043 LDCONST R11 K20
- 0x7C240400, // 0044 CALL R9 2
- 0x7826004B, // 0045 JMPF R9 #0092
- 0x941C0F14, // 0046 GETIDX R7 R7 K20
- 0x58240007, // 0047 LDCONST R9 K7
- 0x50280200, // 0048 LDBOOL R10 1 0
- 0x782A0047, // 0049 JMPF R10 #0092
- 0x60280008, // 004A GETGBL R10 G8
- 0x5C2C1200, // 004B MOVE R11 R9
- 0x7C280200, // 004C CALL R10 1
- 0x002A2A0A, // 004D ADD R10 K21 R10
- 0x8C2C0F13, // 004E GETMET R11 R7 K19
- 0x5C341400, // 004F MOVE R13 R10
- 0x7C2C0400, // 0050 CALL R11 2
- 0x742E0000, // 0051 JMPT R11 #0053
- 0x7002003E, // 0052 JMP #0092
- 0x942C0E0A, // 0053 GETIDX R11 R7 R10
- 0xB8321A00, // 0054 GETNGBL R12 K13
- 0x8C301910, // 0055 GETMET R12 R12 K16
- 0x60380018, // 0056 GETGBL R14 G24
- 0x583C0016, // 0057 LDCONST R15 K22
- 0x5C401400, // 0058 MOVE R16 R10
- 0x60440008, // 0059 GETGBL R17 G8
- 0x5C481600, // 005A MOVE R18 R11
- 0x7C440200, // 005B CALL R17 1
- 0x7C380600, // 005C CALL R14 3
- 0x583C0012, // 005D LDCONST R15 K18
- 0x7C300600, // 005E CALL R12 3
- 0x8C301704, // 005F GETMET R12 R11 K4
- 0x58380017, // 0060 LDCONST R14 K23
- 0x543DFFFE, // 0061 LDINT R15 -1
- 0x7C300600, // 0062 CALL R12 3
- 0x8C341704, // 0063 GETMET R13 R11 K4
- 0x583C0018, // 0064 LDCONST R15 K24
- 0x5441FFFE, // 0065 LDINT R16 -1
- 0x7C340600, // 0066 CALL R13 3
- 0x24381907, // 0067 GT R14 R12 K7
- 0x783A0002, // 0068 JMPF R14 #006C
- 0x8C381119, // 0069 GETMET R14 R8 K25
- 0x04401901, // 006A SUB R16 R12 K1
- 0x7C380400, // 006B CALL R14 2
- 0x24381B07, // 006C GT R14 R13 K7
- 0x783A0002, // 006D JMPF R14 #0071
- 0x8C381119, // 006E GETMET R14 R8 K25
- 0x04401B01, // 006F SUB R16 R13 K1
- 0x7C380400, // 0070 CALL R14 2
- 0xB83A1A00, // 0071 GETNGBL R14 K13
- 0x8C381D10, // 0072 GETMET R14 R14 K16
- 0x60400018, // 0073 GETGBL R16 G24
- 0x5844001A, // 0074 LDCONST R17 K26
- 0x5C481800, // 0075 MOVE R18 R12
- 0x5C4C1A00, // 0076 MOVE R19 R13
- 0x7C400600, // 0077 CALL R16 3
- 0x58440012, // 0078 LDCONST R17 K18
- 0x7C380600, // 0079 CALL R14 3
- 0x8C381704, // 007A GETMET R14 R11 K4
- 0x5840001B, // 007B LDCONST R16 K27
- 0x7C380400, // 007C CALL R14 2
- 0x783A0002, // 007D JMPF R14 #0081
- 0x943C1D0A, // 007E GETIDX R15 R14 K10
- 0x243C1F07, // 007F GT R15 R15 K7
- 0x743E0000, // 0080 JMPT R15 #0082
- 0x503C0001, // 0081 LDBOOL R15 0 1
- 0x503C0200, // 0082 LDBOOL R15 1 0
- 0x60400008, // 0083 GETGBL R16 G8
- 0x5C440600, // 0084 MOVE R17 R3
- 0x7C400200, // 0085 CALL R16 1
- 0x60440013, // 0086 GETGBL R17 G19
- 0x7C440000, // 0087 CALL R17 0
- 0x783E0001, // 0088 JMPF R15 #008B
- 0x5848001C, // 0089 LDCONST R18 K28
- 0x70020000, // 008A JMP #008C
- 0x5848001D, // 008B LDCONST R18 K29
- 0x98461012, // 008C SETIDX R17 K8 R18
- 0x98463A09, // 008D SETIDX R17 K29 R9
- 0x98082011, // 008E SETIDX R2 R16 R17
- 0x000C0701, // 008F ADD R3 R3 K1
- 0x00241301, // 0090 ADD R9 R9 K1
- 0x7001FFB5, // 0091 JMP #0048
- 0x6024000C, // 0092 GETGBL R9 G12
- 0xB82A1A00, // 0093 GETNGBL R10 K13
- 0x8C28151E, // 0094 GETMET R10 R10 K30
- 0x7C280200, // 0095 CALL R10 1
- 0x7C240200, // 0096 CALL R9 1
- 0x58280007, // 0097 LDCONST R10 K7
- 0x78120000, // 0098 JMPF R4 #009A
- 0x04241301, // 0099 SUB R9 R9 K1
- 0x142C1409, // 009A LT R11 R10 R9
- 0x782E0011, // 009B JMPF R11 #00AE
- 0x8C2C1104, // 009C GETMET R11 R8 K4
- 0x5C341400, // 009D MOVE R13 R10
- 0x7C2C0400, // 009E CALL R11 2
- 0x4C300000, // 009F LDNIL R12
- 0x1C2C160C, // 00A0 EQ R11 R11 R12
- 0x782E0009, // 00A1 JMPF R11 #00AC
- 0x602C0008, // 00A2 GETGBL R11 G8
- 0x5C300600, // 00A3 MOVE R12 R3
- 0x7C2C0200, // 00A4 CALL R11 1
- 0x60300013, // 00A5 GETGBL R12 G19
- 0x7C300000, // 00A6 CALL R12 0
- 0x9832111F, // 00A7 SETIDX R12 K8 K31
- 0x00341501, // 00A8 ADD R13 R10 K1
- 0x98323E0D, // 00A9 SETIDX R12 K31 R13
- 0x9808160C, // 00AA SETIDX R2 R11 R12
- 0x000C0701, // 00AB ADD R3 R3 K1
- 0x00281501, // 00AC ADD R10 R10 K1
- 0x7001FFEB, // 00AD JMP #009A
- 0x8C2C0320, // 00AE GETMET R11 R1 K32
- 0xB8361A00, // 00AF GETNGBL R13 K13
- 0x8C341B21, // 00B0 GETMET R13 R13 K33
- 0x7C340200, // 00B1 CALL R13 1
- 0x7C2C0400, // 00B2 CALL R11 2
- 0x8C300122, // 00B3 GETMET R12 R0 K34
- 0x5C381600, // 00B4 MOVE R14 R11
- 0x7C300400, // 00B5 CALL R12 2
- 0x60340010, // 00B6 GETGBL R13 G16
- 0x5C381800, // 00B7 MOVE R14 R12
- 0x7C340200, // 00B8 CALL R13 1
- 0xA8020007, // 00B9 EXBLK 0 #00C2
- 0x5C381A00, // 00BA MOVE R14 R13
- 0x7C380000, // 00BB CALL R14 0
- 0x603C0008, // 00BC GETGBL R15 G8
- 0x5C400600, // 00BD MOVE R16 R3
- 0x7C3C0200, // 00BE CALL R15 1
- 0x98081E0E, // 00BF SETIDX R2 R15 R14
- 0x000C0701, // 00C0 ADD R3 R3 K1
- 0x7001FFF7, // 00C1 JMP #00BA
- 0x58340023, // 00C2 LDCONST R13 K35
- 0xAC340200, // 00C3 CATCH R13 1 0
- 0xB0080000, // 00C4 RAISE 2 R0 R0
- 0x80040400, // 00C5 RET 1 R2
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: remove_fabric
-********************************************************************/
-be_local_closure(Matter_Device_remove_fabric, /* name */
- be_nested_proto(
- 6, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[16]) { /* constants */
- /* K0 */ be_nested_str_weak(tasmota),
- /* K1 */ be_nested_str_weak(log),
- /* K2 */ be_nested_str_weak(MTR_X3A_X20removing_X20fabric_X20),
- /* K3 */ be_nested_str_weak(get_fabric_id),
- /* K4 */ be_nested_str_weak(copy),
- /* K5 */ be_nested_str_weak(reverse),
- /* K6 */ be_nested_str_weak(tohex),
- /* K7 */ be_const_int(2),
- /* K8 */ be_nested_str_weak(message_handler),
- /* K9 */ be_nested_str_weak(im),
- /* K10 */ be_nested_str_weak(subs_shop),
- /* K11 */ be_nested_str_weak(remove_by_fabric),
- /* K12 */ be_nested_str_weak(mdns_remove_op_discovery),
- /* K13 */ be_nested_str_weak(sessions),
- /* K14 */ be_nested_str_weak(remove_fabric),
- /* K15 */ be_nested_str_weak(save_fabrics),
- }),
- be_str_weak(remove_fabric),
- &be_const_str_solidified,
- ( &(const binstruction[33]) { /* code */
- 0x4C080000, // 0000 LDNIL R2
- 0x20080202, // 0001 NE R2 R1 R2
- 0x780A0019, // 0002 JMPF R2 #001D
- 0xB80A0000, // 0003 GETNGBL R2 K0
- 0x8C080501, // 0004 GETMET R2 R2 K1
- 0x8C100303, // 0005 GETMET R4 R1 K3
- 0x7C100200, // 0006 CALL R4 1
- 0x8C100904, // 0007 GETMET R4 R4 K4
- 0x7C100200, // 0008 CALL R4 1
- 0x8C100905, // 0009 GETMET R4 R4 K5
- 0x7C100200, // 000A CALL R4 1
- 0x8C100906, // 000B GETMET R4 R4 K6
- 0x7C100200, // 000C CALL R4 1
- 0x00120404, // 000D ADD R4 K2 R4
- 0x58140007, // 000E LDCONST R5 K7
- 0x7C080600, // 000F CALL R2 3
- 0x88080108, // 0010 GETMBR R2 R0 K8
- 0x88080509, // 0011 GETMBR R2 R2 K9
- 0x8808050A, // 0012 GETMBR R2 R2 K10
- 0x8C08050B, // 0013 GETMET R2 R2 K11
- 0x5C100200, // 0014 MOVE R4 R1
- 0x7C080400, // 0015 CALL R2 2
- 0x8C08010C, // 0016 GETMET R2 R0 K12
- 0x5C100200, // 0017 MOVE R4 R1
- 0x7C080400, // 0018 CALL R2 2
- 0x8808010D, // 0019 GETMBR R2 R0 K13
- 0x8C08050E, // 001A GETMET R2 R2 K14
- 0x5C100200, // 001B MOVE R4 R1
- 0x7C080400, // 001C CALL R2 2
- 0x8808010D, // 001D GETMBR R2 R0 K13
- 0x8C08050F, // 001E GETMET R2 R2 K15
- 0x7C080200, // 001F CALL R2 1
- 0x80000000, // 0020 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: stop
-********************************************************************/
-be_local_closure(Matter_Device_stop, /* name */
- be_nested_proto(
- 4, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_nested_str_weak(tasmota),
- /* K1 */ be_nested_str_weak(remove_driver),
- /* K2 */ be_nested_str_weak(udp_server),
- /* K3 */ be_nested_str_weak(stop),
- }),
- be_str_weak(stop),
- &be_const_str_solidified,
- ( &(const binstruction[10]) { /* code */
- 0xB8060000, // 0000 GETNGBL R1 K0
- 0x8C040301, // 0001 GETMET R1 R1 K1
- 0x5C0C0000, // 0002 MOVE R3 R0
- 0x7C040400, // 0003 CALL R1 2
- 0x88040102, // 0004 GETMBR R1 R0 K2
- 0x78060002, // 0005 JMPF R1 #0009
- 0x88040102, // 0006 GETMBR R1 R0 K2
- 0x8C040303, // 0007 GETMET R1 R1 K3
- 0x7C040200, // 0008 CALL R1 1
- 0x80000000, // 0009 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: mdns_announce_op_discovery
-********************************************************************/
-be_local_closure(Matter_Device_mdns_announce_op_discovery, /* name */
- be_nested_proto(
- 14, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[27]) { /* constants */
- /* K0 */ be_nested_str_weak(mdns),
- /* K1 */ be_nested_str_weak(get_device_id),
- /* K2 */ be_nested_str_weak(copy),
- /* K3 */ be_nested_str_weak(reverse),
- /* K4 */ be_nested_str_weak(get_fabric_compressed),
- /* K5 */ be_nested_str_weak(tohex),
- /* K6 */ be_nested_str_weak(_X2D),
- /* K7 */ be_nested_str_weak(tasmota),
- /* K8 */ be_nested_str_weak(log),
- /* K9 */ be_nested_str_weak(MTR_X3A_X20Operational_X20Discovery_X20node_X20_X3D_X20),
- /* K10 */ be_const_int(3),
- /* K11 */ be_nested_str_weak(eth),
- /* K12 */ be_nested_str_weak(find),
- /* K13 */ be_nested_str_weak(up),
- /* K14 */ be_nested_str_weak(MTR_X3A_X20adding_X20mDNS_X20on_X20_X25s_X20_X27_X25s_X27_X20ptr_X20to_X20_X60_X25s_X2Elocal_X60),
- /* K15 */ be_nested_str_weak(hostname_eth),
- /* K16 */ be_nested_str_weak(add_service),
- /* K17 */ be_nested_str_weak(_matter),
- /* K18 */ be_nested_str_weak(_tcp),
- /* K19 */ be_nested_str_weak(_I),
- /* K20 */ be_nested_str_weak(MTR_X3A_X20adding_X20subtype_X3A_X20),
- /* K21 */ be_nested_str_weak(add_subtype),
- /* K22 */ be_nested_str_weak(wifi),
- /* K23 */ be_nested_str_weak(hostname_wifi),
- /* K24 */ be_nested_str_weak(MTR_X3A_X20Exception),
- /* K25 */ be_nested_str_weak(_X7C),
- /* K26 */ be_const_int(2),
- }),
- be_str_weak(mdns_announce_op_discovery),
- &be_const_str_solidified,
- ( &(const binstruction[121]) { /* code */
- 0xA40A0000, // 0000 IMPORT R2 K0
- 0xA8020064, // 0001 EXBLK 0 #0067
- 0x8C0C0301, // 0002 GETMET R3 R1 K1
- 0x7C0C0200, // 0003 CALL R3 1
- 0x8C0C0702, // 0004 GETMET R3 R3 K2
- 0x7C0C0200, // 0005 CALL R3 1
- 0x8C0C0703, // 0006 GETMET R3 R3 K3
- 0x7C0C0200, // 0007 CALL R3 1
- 0x8C100304, // 0008 GETMET R4 R1 K4
- 0x7C100200, // 0009 CALL R4 1
- 0x8C140905, // 000A GETMET R5 R4 K5
- 0x7C140200, // 000B CALL R5 1
- 0x00140B06, // 000C ADD R5 R5 K6
- 0x8C180705, // 000D GETMET R6 R3 K5
- 0x7C180200, // 000E CALL R6 1
- 0x00140A06, // 000F ADD R5 R5 R6
- 0xB81A0E00, // 0010 GETNGBL R6 K7
- 0x8C180D08, // 0011 GETMET R6 R6 K8
- 0x00221205, // 0012 ADD R8 K9 R5
- 0x5824000A, // 0013 LDCONST R9 K10
- 0x7C180600, // 0014 CALL R6 3
- 0xB81A0E00, // 0015 GETNGBL R6 K7
- 0x8C180D0B, // 0016 GETMET R6 R6 K11
- 0x7C180200, // 0017 CALL R6 1
- 0x8C180D0C, // 0018 GETMET R6 R6 K12
- 0x5820000D, // 0019 LDCONST R8 K13
- 0x7C180400, // 001A CALL R6 2
- 0x781A0020, // 001B JMPF R6 #003D
- 0xB81A0E00, // 001C GETNGBL R6 K7
- 0x8C180D08, // 001D GETMET R6 R6 K8
- 0x60200018, // 001E GETGBL R8 G24
- 0x5824000E, // 001F LDCONST R9 K14
- 0x5828000B, // 0020 LDCONST R10 K11
- 0x5C2C0A00, // 0021 MOVE R11 R5
- 0x8830010F, // 0022 GETMBR R12 R0 K15
- 0x7C200800, // 0023 CALL R8 4
- 0x5824000A, // 0024 LDCONST R9 K10
- 0x7C180600, // 0025 CALL R6 3
- 0x8C180510, // 0026 GETMET R6 R2 K16
- 0x58200011, // 0027 LDCONST R8 K17
- 0x58240012, // 0028 LDCONST R9 K18
- 0x542A15A3, // 0029 LDINT R10 5540
- 0x4C2C0000, // 002A LDNIL R11
- 0x5C300A00, // 002B MOVE R12 R5
- 0x8834010F, // 002C GETMBR R13 R0 K15
- 0x7C180E00, // 002D CALL R6 7
- 0x8C180905, // 002E GETMET R6 R4 K5
- 0x7C180200, // 002F CALL R6 1
- 0x001A2606, // 0030 ADD R6 K19 R6
- 0xB81E0E00, // 0031 GETNGBL R7 K7
- 0x8C1C0F08, // 0032 GETMET R7 R7 K8
- 0x00262806, // 0033 ADD R9 K20 R6
- 0x5828000A, // 0034 LDCONST R10 K10
- 0x7C1C0600, // 0035 CALL R7 3
- 0x8C1C0515, // 0036 GETMET R7 R2 K21
- 0x58240011, // 0037 LDCONST R9 K17
- 0x58280012, // 0038 LDCONST R10 K18
- 0x5C2C0A00, // 0039 MOVE R11 R5
- 0x8830010F, // 003A GETMBR R12 R0 K15
- 0x5C340C00, // 003B MOVE R13 R6
- 0x7C1C0C00, // 003C CALL R7 6
- 0xB81A0E00, // 003D GETNGBL R6 K7
- 0x8C180D16, // 003E GETMET R6 R6 K22
- 0x7C180200, // 003F CALL R6 1
- 0x8C180D0C, // 0040 GETMET R6 R6 K12
- 0x5820000D, // 0041 LDCONST R8 K13
- 0x7C180400, // 0042 CALL R6 2
- 0x781A0020, // 0043 JMPF R6 #0065
- 0xB81A0E00, // 0044 GETNGBL R6 K7
- 0x8C180D08, // 0045 GETMET R6 R6 K8
- 0x60200018, // 0046 GETGBL R8 G24
- 0x5824000E, // 0047 LDCONST R9 K14
- 0x58280016, // 0048 LDCONST R10 K22
- 0x5C2C0A00, // 0049 MOVE R11 R5
- 0x88300117, // 004A GETMBR R12 R0 K23
- 0x7C200800, // 004B CALL R8 4
- 0x5824000A, // 004C LDCONST R9 K10
- 0x7C180600, // 004D CALL R6 3
- 0x8C180510, // 004E GETMET R6 R2 K16
- 0x58200011, // 004F LDCONST R8 K17
- 0x58240012, // 0050 LDCONST R9 K18
- 0x542A15A3, // 0051 LDINT R10 5540
- 0x4C2C0000, // 0052 LDNIL R11
- 0x5C300A00, // 0053 MOVE R12 R5
- 0x88340117, // 0054 GETMBR R13 R0 K23
- 0x7C180E00, // 0055 CALL R6 7
- 0x8C180905, // 0056 GETMET R6 R4 K5
- 0x7C180200, // 0057 CALL R6 1
- 0x001A2606, // 0058 ADD R6 K19 R6
- 0xB81E0E00, // 0059 GETNGBL R7 K7
- 0x8C1C0F08, // 005A GETMET R7 R7 K8
- 0x00262806, // 005B ADD R9 K20 R6
- 0x5828000A, // 005C LDCONST R10 K10
- 0x7C1C0600, // 005D CALL R7 3
- 0x8C1C0515, // 005E GETMET R7 R2 K21
- 0x58240011, // 005F LDCONST R9 K17
- 0x58280012, // 0060 LDCONST R10 K18
- 0x5C2C0A00, // 0061 MOVE R11 R5
- 0x88300117, // 0062 GETMBR R12 R0 K23
- 0x5C340C00, // 0063 MOVE R13 R6
- 0x7C1C0C00, // 0064 CALL R7 6
- 0xA8040001, // 0065 EXBLK 1 1
- 0x70020010, // 0066 JMP #0078
- 0xAC0C0002, // 0067 CATCH R3 0 2
- 0x7002000D, // 0068 JMP #0077
- 0xB8160E00, // 0069 GETNGBL R5 K7
- 0x8C140B08, // 006A GETMET R5 R5 K8
- 0x601C0008, // 006B GETGBL R7 G8
- 0x5C200600, // 006C MOVE R8 R3
- 0x7C1C0200, // 006D CALL R7 1
- 0x001E3007, // 006E ADD R7 K24 R7
- 0x001C0F19, // 006F ADD R7 R7 K25
- 0x60200008, // 0070 GETGBL R8 G8
- 0x5C240800, // 0071 MOVE R9 R4
- 0x7C200200, // 0072 CALL R8 1
- 0x001C0E08, // 0073 ADD R7 R7 R8
- 0x5820001A, // 0074 LDCONST R8 K26
- 0x7C140600, // 0075 CALL R5 3
- 0x70020000, // 0076 JMP #0078
- 0xB0080000, // 0077 RAISE 2 R0 R0
- 0x80000000, // 0078 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: stop_basic_commissioning
-********************************************************************/
-be_local_closure(Matter_Device_stop_basic_commissioning, /* name */
- be_nested_proto(
- 5, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[13]) { /* constants */
- /* K0 */ be_nested_str_weak(is_root_commissioning_open),
- /* K1 */ be_nested_str_weak(tasmota),
- /* K2 */ be_nested_str_weak(publish_result),
- /* K3 */ be_nested_str_weak(_X7B_X22Matter_X22_X3A_X7B_X22Commissioning_X22_X3A0_X7D_X7D),
- /* K4 */ be_nested_str_weak(Matter),
- /* K5 */ be_nested_str_weak(commissioning_open),
- /* K6 */ be_nested_str_weak(mdns_remove_PASE),
- /* K7 */ be_nested_str_weak(commissioning_iterations),
- /* K8 */ be_nested_str_weak(commissioning_discriminator),
- /* K9 */ be_nested_str_weak(commissioning_salt),
- /* K10 */ be_nested_str_weak(commissioning_w0),
- /* K11 */ be_nested_str_weak(commissioning_L),
- /* K12 */ be_nested_str_weak(commissioning_admin_fabric),
- }),
- be_str_weak(stop_basic_commissioning),
- &be_const_str_solidified,
- ( &(const binstruction[25]) { /* code */
- 0x8C040100, // 0000 GETMET R1 R0 K0
- 0x7C040200, // 0001 CALL R1 1
- 0x78060004, // 0002 JMPF R1 #0008
- 0xB8060200, // 0003 GETNGBL R1 K1
- 0x8C040302, // 0004 GETMET R1 R1 K2
- 0x580C0003, // 0005 LDCONST R3 K3
- 0x58100004, // 0006 LDCONST R4 K4
- 0x7C040600, // 0007 CALL R1 3
- 0x4C040000, // 0008 LDNIL R1
- 0x90020A01, // 0009 SETMBR R0 K5 R1
- 0x8C040106, // 000A GETMET R1 R0 K6
- 0x7C040200, // 000B CALL R1 1
- 0x4C040000, // 000C LDNIL R1
- 0x90020E01, // 000D SETMBR R0 K7 R1
- 0x4C040000, // 000E LDNIL R1
- 0x90021001, // 000F SETMBR R0 K8 R1
- 0x4C040000, // 0010 LDNIL R1
- 0x90021201, // 0011 SETMBR R0 K9 R1
- 0x4C040000, // 0012 LDNIL R1
- 0x90021401, // 0013 SETMBR R0 K10 R1
- 0x4C040000, // 0014 LDNIL R1
- 0x90021601, // 0015 SETMBR R0 K11 R1
- 0x4C040000, // 0016 LDNIL R1
- 0x90021801, // 0017 SETMBR R0 K12 R1
- 0x80000000, // 0018 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: autoconf_sensors_list
-********************************************************************/
-be_local_closure(Matter_Device_autoconf_sensors_list, /* name */
- be_nested_proto(
- 10, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[18]) { /* constants */
- /* K0 */ be_nested_str_weak(k2l),
- /* K1 */ be_nested_str_weak(contains),
- /* K2 */ be_nested_str_weak(Temperature),
- /* K3 */ be_nested_str_weak(_X23Temperature),
- /* K4 */ be_nested_str_weak(push),
- /* K5 */ be_nested_str_weak(type),
- /* K6 */ be_nested_str_weak(temperature),
- /* K7 */ be_nested_str_weak(filter),
- /* K8 */ be_nested_str_weak(stop_iteration),
- /* K9 */ be_nested_str_weak(Pressure),
- /* K10 */ be_nested_str_weak(_X23Pressure),
- /* K11 */ be_nested_str_weak(pressure),
- /* K12 */ be_nested_str_weak(Illuminance),
- /* K13 */ be_nested_str_weak(_X23Illuminance),
- /* K14 */ be_nested_str_weak(illuminance),
- /* K15 */ be_nested_str_weak(Humidity),
- /* K16 */ be_nested_str_weak(_X23Humidity),
- /* K17 */ be_nested_str_weak(humidity),
- }),
- be_str_weak(autoconf_sensors_list),
- &be_const_str_solidified,
- ( &(const binstruction[119]) { /* code */
- 0x60080012, // 0000 GETGBL R2 G18
- 0x7C080000, // 0001 CALL R2 0
- 0x600C0010, // 0002 GETGBL R3 G16
- 0x8C100100, // 0003 GETMET R4 R0 K0
- 0x5C180200, // 0004 MOVE R6 R1
- 0x7C100400, // 0005 CALL R4 2
- 0x7C0C0200, // 0006 CALL R3 1
- 0xA8020013, // 0007 EXBLK 0 #001C
- 0x5C100600, // 0008 MOVE R4 R3
- 0x7C100000, // 0009 CALL R4 0
- 0x94140204, // 000A GETIDX R5 R1 R4
- 0x6018000F, // 000B GETGBL R6 G15
- 0x5C1C0A00, // 000C MOVE R7 R5
- 0x60200013, // 000D GETGBL R8 G19
- 0x7C180400, // 000E CALL R6 2
- 0x781A000A, // 000F JMPF R6 #001B
- 0x8C180B01, // 0010 GETMET R6 R5 K1
- 0x58200002, // 0011 LDCONST R8 K2
- 0x7C180400, // 0012 CALL R6 2
- 0x781A0006, // 0013 JMPF R6 #001B
- 0x00180903, // 0014 ADD R6 R4 K3
- 0x8C1C0504, // 0015 GETMET R7 R2 K4
- 0x60240013, // 0016 GETGBL R9 G19
- 0x7C240000, // 0017 CALL R9 0
- 0x98260B06, // 0018 SETIDX R9 K5 K6
- 0x98260E06, // 0019 SETIDX R9 K7 R6
- 0x7C1C0400, // 001A CALL R7 2
- 0x7001FFEB, // 001B JMP #0008
- 0x580C0008, // 001C LDCONST R3 K8
- 0xAC0C0200, // 001D CATCH R3 1 0
- 0xB0080000, // 001E RAISE 2 R0 R0
- 0x600C0010, // 001F GETGBL R3 G16
- 0x8C100100, // 0020 GETMET R4 R0 K0
- 0x5C180200, // 0021 MOVE R6 R1
- 0x7C100400, // 0022 CALL R4 2
- 0x7C0C0200, // 0023 CALL R3 1
- 0xA8020013, // 0024 EXBLK 0 #0039
- 0x5C100600, // 0025 MOVE R4 R3
- 0x7C100000, // 0026 CALL R4 0
- 0x94140204, // 0027 GETIDX R5 R1 R4
- 0x6018000F, // 0028 GETGBL R6 G15
- 0x5C1C0A00, // 0029 MOVE R7 R5
- 0x60200013, // 002A GETGBL R8 G19
- 0x7C180400, // 002B CALL R6 2
- 0x781A000A, // 002C JMPF R6 #0038
- 0x8C180B01, // 002D GETMET R6 R5 K1
- 0x58200009, // 002E LDCONST R8 K9
- 0x7C180400, // 002F CALL R6 2
- 0x781A0006, // 0030 JMPF R6 #0038
- 0x0018090A, // 0031 ADD R6 R4 K10
- 0x8C1C0504, // 0032 GETMET R7 R2 K4
- 0x60240013, // 0033 GETGBL R9 G19
- 0x7C240000, // 0034 CALL R9 0
- 0x98260B0B, // 0035 SETIDX R9 K5 K11
- 0x98260E06, // 0036 SETIDX R9 K7 R6
- 0x7C1C0400, // 0037 CALL R7 2
- 0x7001FFEB, // 0038 JMP #0025
- 0x580C0008, // 0039 LDCONST R3 K8
- 0xAC0C0200, // 003A CATCH R3 1 0
- 0xB0080000, // 003B RAISE 2 R0 R0
- 0x600C0010, // 003C GETGBL R3 G16
- 0x8C100100, // 003D GETMET R4 R0 K0
- 0x5C180200, // 003E MOVE R6 R1
- 0x7C100400, // 003F CALL R4 2
- 0x7C0C0200, // 0040 CALL R3 1
- 0xA8020013, // 0041 EXBLK 0 #0056
- 0x5C100600, // 0042 MOVE R4 R3
- 0x7C100000, // 0043 CALL R4 0
- 0x94140204, // 0044 GETIDX R5 R1 R4
- 0x6018000F, // 0045 GETGBL R6 G15
- 0x5C1C0A00, // 0046 MOVE R7 R5
- 0x60200013, // 0047 GETGBL R8 G19
- 0x7C180400, // 0048 CALL R6 2
- 0x781A000A, // 0049 JMPF R6 #0055
- 0x8C180B01, // 004A GETMET R6 R5 K1
- 0x5820000C, // 004B LDCONST R8 K12
- 0x7C180400, // 004C CALL R6 2
- 0x781A0006, // 004D JMPF R6 #0055
- 0x0018090D, // 004E ADD R6 R4 K13
- 0x8C1C0504, // 004F GETMET R7 R2 K4
- 0x60240013, // 0050 GETGBL R9 G19
- 0x7C240000, // 0051 CALL R9 0
- 0x98260B0E, // 0052 SETIDX R9 K5 K14
- 0x98260E06, // 0053 SETIDX R9 K7 R6
- 0x7C1C0400, // 0054 CALL R7 2
- 0x7001FFEB, // 0055 JMP #0042
- 0x580C0008, // 0056 LDCONST R3 K8
- 0xAC0C0200, // 0057 CATCH R3 1 0
- 0xB0080000, // 0058 RAISE 2 R0 R0
- 0x600C0010, // 0059 GETGBL R3 G16
- 0x8C100100, // 005A GETMET R4 R0 K0
- 0x5C180200, // 005B MOVE R6 R1
- 0x7C100400, // 005C CALL R4 2
- 0x7C0C0200, // 005D CALL R3 1
- 0xA8020013, // 005E EXBLK 0 #0073
- 0x5C100600, // 005F MOVE R4 R3
- 0x7C100000, // 0060 CALL R4 0
- 0x94140204, // 0061 GETIDX R5 R1 R4
- 0x6018000F, // 0062 GETGBL R6 G15
- 0x5C1C0A00, // 0063 MOVE R7 R5
- 0x60200013, // 0064 GETGBL R8 G19
- 0x7C180400, // 0065 CALL R6 2
- 0x781A000A, // 0066 JMPF R6 #0072
- 0x8C180B01, // 0067 GETMET R6 R5 K1
- 0x5820000F, // 0068 LDCONST R8 K15
- 0x7C180400, // 0069 CALL R6 2
- 0x781A0006, // 006A JMPF R6 #0072
- 0x00180910, // 006B ADD R6 R4 K16
- 0x8C1C0504, // 006C GETMET R7 R2 K4
- 0x60240013, // 006D GETGBL R9 G19
- 0x7C240000, // 006E CALL R9 0
- 0x98260B11, // 006F SETIDX R9 K5 K17
- 0x98260E06, // 0070 SETIDX R9 K7 R6
- 0x7C1C0400, // 0071 CALL R7 2
- 0x7001FFEB, // 0072 JMP #005F
- 0x580C0008, // 0073 LDCONST R3 K8
- 0xAC0C0200, // 0074 CATCH R3 1 0
- 0xB0080000, // 0075 RAISE 2 R0 R0
- 0x80040400, // 0076 RET 1 R2
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: clean_remotes
-********************************************************************/
-be_local_closure(Matter_Device_clean_remotes, /* name */
- be_nested_proto(
- 10, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[18]) { /* constants */
- /* K0 */ be_nested_str_weak(introspect),
- /* K1 */ be_nested_str_weak(http_remotes),
- /* K2 */ be_const_int(0),
- /* K3 */ be_nested_str_weak(stop_iteration),
- /* K4 */ be_nested_str_weak(plugins),
- /* K5 */ be_nested_str_weak(get),
- /* K6 */ be_nested_str_weak(http_remote),
- /* K7 */ be_nested_str_weak(find),
- /* K8 */ be_const_int(1),
- /* K9 */ be_nested_str_weak(keys),
- /* K10 */ be_nested_str_weak(push),
- /* K11 */ be_nested_str_weak(tasmota),
- /* K12 */ be_nested_str_weak(log),
- /* K13 */ be_nested_str_weak(MTR_X3A_X20remove_X20unused_X20remote_X3A_X20),
- /* K14 */ be_nested_str_weak(addr),
- /* K15 */ be_const_int(3),
- /* K16 */ be_nested_str_weak(close),
- /* K17 */ be_nested_str_weak(remove),
- }),
- be_str_weak(clean_remotes),
- &be_const_str_solidified,
- ( &(const binstruction[81]) { /* code */
- 0xA4060000, // 0000 IMPORT R1 K0
- 0x88080101, // 0001 GETMBR R2 R0 K1
- 0x780A004C, // 0002 JMPF R2 #0050
- 0x60080013, // 0003 GETGBL R2 G19
- 0x7C080000, // 0004 CALL R2 0
- 0x600C0010, // 0005 GETGBL R3 G16
- 0x88100101, // 0006 GETMBR R4 R0 K1
- 0x7C0C0200, // 0007 CALL R3 1
- 0xA8020003, // 0008 EXBLK 0 #000D
- 0x5C100600, // 0009 MOVE R4 R3
- 0x7C100000, // 000A CALL R4 0
- 0x98080902, // 000B SETIDX R2 R4 K2
- 0x7001FFFB, // 000C JMP #0009
- 0x580C0003, // 000D LDCONST R3 K3
- 0xAC0C0200, // 000E CATCH R3 1 0
- 0xB0080000, // 000F RAISE 2 R0 R0
- 0x600C0010, // 0010 GETGBL R3 G16
- 0x88100104, // 0011 GETMBR R4 R0 K4
- 0x7C0C0200, // 0012 CALL R3 1
- 0xA802000F, // 0013 EXBLK 0 #0024
- 0x5C100600, // 0014 MOVE R4 R3
- 0x7C100000, // 0015 CALL R4 0
- 0x8C140305, // 0016 GETMET R5 R1 K5
- 0x5C1C0800, // 0017 MOVE R7 R4
- 0x58200006, // 0018 LDCONST R8 K6
- 0x7C140600, // 0019 CALL R5 3
- 0x4C180000, // 001A LDNIL R6
- 0x20180A06, // 001B NE R6 R5 R6
- 0x781A0005, // 001C JMPF R6 #0023
- 0x8C180507, // 001D GETMET R6 R2 K7
- 0x5C200A00, // 001E MOVE R8 R5
- 0x58240002, // 001F LDCONST R9 K2
- 0x7C180600, // 0020 CALL R6 3
- 0x00180D08, // 0021 ADD R6 R6 K8
- 0x98080A06, // 0022 SETIDX R2 R5 R6
- 0x7001FFEF, // 0023 JMP #0014
- 0x580C0003, // 0024 LDCONST R3 K3
- 0xAC0C0200, // 0025 CATCH R3 1 0
- 0xB0080000, // 0026 RAISE 2 R0 R0
- 0x600C0012, // 0027 GETGBL R3 G18
- 0x7C0C0000, // 0028 CALL R3 0
- 0x60100010, // 0029 GETGBL R4 G16
- 0x8C140509, // 002A GETMET R5 R2 K9
- 0x7C140200, // 002B CALL R5 1
- 0x7C100200, // 002C CALL R4 1
- 0xA8020008, // 002D EXBLK 0 #0037
- 0x5C140800, // 002E MOVE R5 R4
- 0x7C140000, // 002F CALL R5 0
- 0x94180405, // 0030 GETIDX R6 R2 R5
- 0x1C180D02, // 0031 EQ R6 R6 K2
- 0x781A0002, // 0032 JMPF R6 #0036
- 0x8C18070A, // 0033 GETMET R6 R3 K10
- 0x5C200A00, // 0034 MOVE R8 R5
- 0x7C180400, // 0035 CALL R6 2
- 0x7001FFF6, // 0036 JMP #002E
- 0x58100003, // 0037 LDCONST R4 K3
- 0xAC100200, // 0038 CATCH R4 1 0
- 0xB0080000, // 0039 RAISE 2 R0 R0
- 0x60100010, // 003A GETGBL R4 G16
- 0x5C140600, // 003B MOVE R5 R3
- 0x7C100200, // 003C CALL R4 1
- 0xA802000E, // 003D EXBLK 0 #004D
- 0x5C140800, // 003E MOVE R5 R4
- 0x7C140000, // 003F CALL R5 0
- 0xB81A1600, // 0040 GETNGBL R6 K11
- 0x8C180D0C, // 0041 GETMET R6 R6 K12
- 0x88200B0E, // 0042 GETMBR R8 R5 K14
- 0x00221A08, // 0043 ADD R8 K13 R8
- 0x5824000F, // 0044 LDCONST R9 K15
- 0x7C180600, // 0045 CALL R6 3
- 0x8C180B10, // 0046 GETMET R6 R5 K16
- 0x7C180200, // 0047 CALL R6 1
- 0x88180101, // 0048 GETMBR R6 R0 K1
- 0x8C180D11, // 0049 GETMET R6 R6 K17
- 0x88200B0E, // 004A GETMBR R8 R5 K14
- 0x7C180400, // 004B CALL R6 2
- 0x7001FFF0, // 004C JMP #003E
- 0x58100003, // 004D LDCONST R4 K3
- 0xAC100200, // 004E CATCH R4 1 0
- 0xB0080000, // 004F RAISE 2 R0 R0
- 0x80000000, // 0050 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: update_remotes_info
-********************************************************************/
-be_local_closure(Matter_Device_update_remotes_info, /* name */
- be_nested_proto(
- 7, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 6]) { /* constants */
- /* K0 */ be_nested_str_weak(http_remotes),
- /* K1 */ be_nested_str_weak(keys),
- /* K2 */ be_nested_str_weak(get_info),
- /* K3 */ be_const_int(0),
- /* K4 */ be_nested_str_weak(stop_iteration),
- /* K5 */ be_nested_str_weak(plugins_config_remotes),
- }),
- be_str_weak(update_remotes_info),
- &be_const_str_solidified,
- ( &(const binstruction[33]) { /* code */
- 0x60040013, // 0000 GETGBL R1 G19
- 0x7C040000, // 0001 CALL R1 0
- 0x88080100, // 0002 GETMBR R2 R0 K0
- 0x4C0C0000, // 0003 LDNIL R3
- 0x20080403, // 0004 NE R2 R2 R3
- 0x780A0018, // 0005 JMPF R2 #001F
- 0x60080010, // 0006 GETGBL R2 G16
- 0x880C0100, // 0007 GETMBR R3 R0 K0
- 0x8C0C0701, // 0008 GETMET R3 R3 K1
- 0x7C0C0200, // 0009 CALL R3 1
- 0x7C080200, // 000A CALL R2 1
- 0xA802000F, // 000B EXBLK 0 #001C
- 0x5C0C0400, // 000C MOVE R3 R2
- 0x7C0C0000, // 000D CALL R3 0
- 0x88100100, // 000E GETMBR R4 R0 K0
- 0x94100803, // 000F GETIDX R4 R4 R3
- 0x8C100902, // 0010 GETMET R4 R4 K2
- 0x7C100200, // 0011 CALL R4 1
- 0x4C140000, // 0012 LDNIL R5
- 0x20140805, // 0013 NE R5 R4 R5
- 0x78160005, // 0014 JMPF R5 #001B
- 0x6014000C, // 0015 GETGBL R5 G12
- 0x5C180800, // 0016 MOVE R6 R4
- 0x7C140200, // 0017 CALL R5 1
- 0x24140B03, // 0018 GT R5 R5 K3
- 0x78160000, // 0019 JMPF R5 #001B
- 0x98040604, // 001A SETIDX R1 R3 R4
- 0x7001FFEF, // 001B JMP #000C
- 0x58080004, // 001C LDCONST R2 K4
- 0xAC080200, // 001D CATCH R2 1 0
- 0xB0080000, // 001E RAISE 2 R0 R0
- 0x90020A01, // 001F SETMBR R0 K5 R1
- 0x80040200, // 0020 RET 1 R1
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: get_plugin_class_displayname
-********************************************************************/
-be_local_closure(Matter_Device_get_plugin_class_displayname, /* name */
- be_nested_proto(
- 5, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_nested_str_weak(plugins_classes),
- /* K1 */ be_nested_str_weak(find),
- /* K2 */ be_nested_str_weak(DISPLAY_NAME),
- /* K3 */ be_nested_str_weak(),
- }),
- be_str_weak(get_plugin_class_displayname),
- &be_const_str_solidified,
- ( &(const binstruction[ 9]) { /* code */
- 0x88080100, // 0000 GETMBR R2 R0 K0
- 0x8C080501, // 0001 GETMET R2 R2 K1
- 0x5C100200, // 0002 MOVE R4 R1
- 0x7C080400, // 0003 CALL R2 2
- 0x780A0001, // 0004 JMPF R2 #0007
- 0x880C0502, // 0005 GETMBR R3 R2 K2
- 0x70020000, // 0006 JMP #0008
- 0x580C0003, // 0007 LDCONST R3 K3
- 0x80040600, // 0008 RET 1 R3
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: process_attribute_read_solo
-********************************************************************/
-be_local_closure(Matter_Device_process_attribute_read_solo, /* name */
- be_nested_proto(
- 10, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[11]) { /* constants */
- /* K0 */ be_nested_str_weak(endpoint),
- /* K1 */ be_nested_str_weak(cluster),
- /* K2 */ be_nested_str_weak(attribute),
- /* K3 */ be_nested_str_weak(find_plugin_by_endpoint),
- /* K4 */ be_nested_str_weak(status),
- /* K5 */ be_nested_str_weak(matter),
- /* K6 */ be_nested_str_weak(UNSUPPORTED_ENDPOINT),
- /* K7 */ be_nested_str_weak(contains_cluster),
- /* K8 */ be_nested_str_weak(UNSUPPORTED_CLUSTER),
- /* K9 */ be_nested_str_weak(contains_attribute),
- /* K10 */ be_nested_str_weak(UNSUPPORTED_ATTRIBUTE),
- }),
- be_str_weak(process_attribute_read_solo),
- &be_const_str_solidified,
- ( &(const binstruction[45]) { /* code */
- 0x88080300, // 0000 GETMBR R2 R1 K0
- 0x880C0301, // 0001 GETMBR R3 R1 K1
- 0x88100302, // 0002 GETMBR R4 R1 K2
- 0x4C140000, // 0003 LDNIL R5
- 0x1C140405, // 0004 EQ R5 R2 R5
- 0x74160005, // 0005 JMPT R5 #000C
- 0x4C140000, // 0006 LDNIL R5
- 0x1C140605, // 0007 EQ R5 R3 R5
- 0x74160002, // 0008 JMPT R5 #000C
- 0x4C140000, // 0009 LDNIL R5
- 0x1C140805, // 000A EQ R5 R4 R5
- 0x78160001, // 000B JMPF R5 #000E
- 0x4C140000, // 000C LDNIL R5
- 0x80040A00, // 000D RET 1 R5
- 0x8C140103, // 000E GETMET R5 R0 K3
- 0x5C1C0400, // 000F MOVE R7 R2
- 0x7C140400, // 0010 CALL R5 2
- 0x4C180000, // 0011 LDNIL R6
- 0x1C180A06, // 0012 EQ R6 R5 R6
- 0x781A0004, // 0013 JMPF R6 #0019
- 0xB81A0A00, // 0014 GETNGBL R6 K5
- 0x88180D06, // 0015 GETMBR R6 R6 K6
- 0x90060806, // 0016 SETMBR R1 K4 R6
- 0x4C180000, // 0017 LDNIL R6
- 0x80040C00, // 0018 RET 1 R6
- 0x8C180B07, // 0019 GETMET R6 R5 K7
- 0x5C200600, // 001A MOVE R8 R3
- 0x7C180400, // 001B CALL R6 2
- 0x741A0004, // 001C JMPT R6 #0022
- 0xB81A0A00, // 001D GETNGBL R6 K5
- 0x88180D08, // 001E GETMBR R6 R6 K8
- 0x90060806, // 001F SETMBR R1 K4 R6
- 0x4C180000, // 0020 LDNIL R6
- 0x80040C00, // 0021 RET 1 R6
- 0x8C180B09, // 0022 GETMET R6 R5 K9
- 0x5C200600, // 0023 MOVE R8 R3
- 0x5C240800, // 0024 MOVE R9 R4
- 0x7C180600, // 0025 CALL R6 3
- 0x741A0004, // 0026 JMPT R6 #002C
- 0xB81A0A00, // 0027 GETNGBL R6 K5
- 0x88180D0A, // 0028 GETMBR R6 R6 K10
- 0x90060806, // 0029 SETMBR R1 K4 R6
- 0x4C180000, // 002A LDNIL R6
- 0x80040C00, // 002B RET 1 R6
- 0x80040A00, // 002C RET 1 R5
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: _trigger_read_sensors
-********************************************************************/
-be_local_closure(Matter_Device__trigger_read_sensors, /* name */
- be_nested_proto(
- 8, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[11]) { /* constants */
- /* K0 */ be_nested_str_weak(json),
- /* K1 */ be_nested_str_weak(tasmota),
- /* K2 */ be_nested_str_weak(read_sensors),
- /* K3 */ be_nested_str_weak(load),
- /* K4 */ be_const_int(0),
- /* K5 */ be_nested_str_weak(plugins),
- /* K6 */ be_nested_str_weak(parse_sensors),
- /* K7 */ be_const_int(1),
- /* K8 */ be_nested_str_weak(log),
- /* K9 */ be_nested_str_weak(MTR_X3A_X20unable_X20to_X20parse_X20read_sensors_X3A_X20),
- /* K10 */ be_const_int(3),
- }),
- be_str_weak(_trigger_read_sensors),
- &be_const_str_solidified,
- ( &(const binstruction[37]) { /* code */
- 0xA4060000, // 0000 IMPORT R1 K0
- 0xB80A0200, // 0001 GETNGBL R2 K1
- 0x8C080502, // 0002 GETMET R2 R2 K2
- 0x7C080200, // 0003 CALL R2 1
- 0x4C0C0000, // 0004 LDNIL R3
- 0x1C0C0403, // 0005 EQ R3 R2 R3
- 0x780E0000, // 0006 JMPF R3 #0008
- 0x80000600, // 0007 RET 0
- 0x8C0C0303, // 0008 GETMET R3 R1 K3
- 0x5C140400, // 0009 MOVE R5 R2
- 0x7C0C0400, // 000A CALL R3 2
- 0x4C100000, // 000B LDNIL R4
- 0x20100604, // 000C NE R4 R3 R4
- 0x7812000D, // 000D JMPF R4 #001C
- 0x58100004, // 000E LDCONST R4 K4
- 0x6014000C, // 000F GETGBL R5 G12
- 0x88180105, // 0010 GETMBR R6 R0 K5
- 0x7C140200, // 0011 CALL R5 1
- 0x14140805, // 0012 LT R5 R4 R5
- 0x78160006, // 0013 JMPF R5 #001B
- 0x88140105, // 0014 GETMBR R5 R0 K5
- 0x94140A04, // 0015 GETIDX R5 R5 R4
- 0x8C140B06, // 0016 GETMET R5 R5 K6
- 0x5C1C0600, // 0017 MOVE R7 R3
- 0x7C140400, // 0018 CALL R5 2
- 0x00100907, // 0019 ADD R4 R4 K7
- 0x7001FFF3, // 001A JMP #000F
- 0x70020007, // 001B JMP #0024
- 0xB8120200, // 001C GETNGBL R4 K1
- 0x8C100908, // 001D GETMET R4 R4 K8
- 0x60180008, // 001E GETGBL R6 G8
- 0x5C1C0400, // 001F MOVE R7 R2
- 0x7C180200, // 0020 CALL R6 1
- 0x001A1206, // 0021 ADD R6 K9 R6
- 0x581C000A, // 0022 LDCONST R7 K10
- 0x7C100600, // 0023 CALL R4 3
- 0x80000000, // 0024 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
/********************************************************************
** Solidified function: received_ack
********************************************************************/
@@ -3980,12 +794,12 @@ be_local_closure(Matter_Device_received_ack, /* name */
/********************************************************************
-** Solidified function: every_second
+** Solidified function: MtrInfo_one
********************************************************************/
-be_local_closure(Matter_Device_every_second, /* name */
+be_local_closure(Matter_Device_MtrInfo_one, /* name */
be_nested_proto(
- 4, /* nstack */
- 1, /* argc */
+ 9, /* nstack */
+ 2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
@@ -3993,34 +807,36 @@ be_local_closure(Matter_Device_every_second, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 6]) { /* constants */
- /* K0 */ be_nested_str_weak(sessions),
- /* K1 */ be_nested_str_weak(every_second),
- /* K2 */ be_nested_str_weak(message_handler),
- /* K3 */ be_nested_str_weak(commissioning_open),
- /* K4 */ be_nested_str_weak(tasmota),
- /* K5 */ be_nested_str_weak(time_reached),
+ /* K0 */ be_nested_str_weak(find_plugin_by_endpoint),
+ /* K1 */ be_nested_str_weak(state_json),
+ /* K2 */ be_nested_str_weak(_X7B_X22MtrInfo_X22_X3A_X25s_X7D),
+ /* K3 */ be_nested_str_weak(tasmota),
+ /* K4 */ be_nested_str_weak(publish_result),
+ /* K5 */ be_nested_str_weak(),
}),
- be_str_weak(every_second),
+ be_str_weak(MtrInfo_one),
&be_const_str_solidified,
- ( &(const binstruction[18]) { /* code */
- 0x88040100, // 0000 GETMBR R1 R0 K0
- 0x8C040301, // 0001 GETMET R1 R1 K1
- 0x7C040200, // 0002 CALL R1 1
- 0x88040102, // 0003 GETMBR R1 R0 K2
- 0x8C040301, // 0004 GETMET R1 R1 K1
- 0x7C040200, // 0005 CALL R1 1
- 0x88040103, // 0006 GETMBR R1 R0 K3
- 0x4C080000, // 0007 LDNIL R2
- 0x20040202, // 0008 NE R1 R1 R2
- 0x78060006, // 0009 JMPF R1 #0011
- 0xB8060800, // 000A GETNGBL R1 K4
- 0x8C040305, // 000B GETMET R1 R1 K5
- 0x880C0103, // 000C GETMBR R3 R0 K3
- 0x7C040400, // 000D CALL R1 2
- 0x78060001, // 000E JMPF R1 #0011
- 0x4C040000, // 000F LDNIL R1
- 0x90020601, // 0010 SETMBR R0 K3 R1
- 0x80000000, // 0011 RET 0
+ ( &(const binstruction[20]) { /* code */
+ 0x8C080100, // 0000 GETMET R2 R0 K0
+ 0x5C100200, // 0001 MOVE R4 R1
+ 0x7C080400, // 0002 CALL R2 2
+ 0x4C0C0000, // 0003 LDNIL R3
+ 0x1C0C0403, // 0004 EQ R3 R2 R3
+ 0x780E0000, // 0005 JMPF R3 #0007
+ 0x80000600, // 0006 RET 0
+ 0x8C0C0501, // 0007 GETMET R3 R2 K1
+ 0x7C0C0200, // 0008 CALL R3 1
+ 0x780E0008, // 0009 JMPF R3 #0013
+ 0x60100018, // 000A GETGBL R4 G24
+ 0x58140002, // 000B LDCONST R5 K2
+ 0x5C180600, // 000C MOVE R6 R3
+ 0x7C100400, // 000D CALL R4 2
+ 0xB8160600, // 000E GETNGBL R5 K3
+ 0x8C140B04, // 000F GETMET R5 R5 K4
+ 0x5C1C0800, // 0010 MOVE R7 R4
+ 0x58200005, // 0011 LDCONST R8 K5
+ 0x7C140600, // 0012 CALL R5 3
+ 0x80000000, // 0013 RET 0
})
)
);
@@ -4171,11 +987,11 @@ be_local_closure(Matter_Device_start_basic_commissioning, /* name */
/********************************************************************
-** Solidified function: compute_manual_pairing_code
+** Solidified function: compute_qrcode_content
********************************************************************/
-be_local_closure(Matter_Device_compute_manual_pairing_code, /* name */
+be_local_closure(Matter_Device_compute_qrcode_content, /* name */
be_nested_proto(
- 9, /* nstack */
+ 8, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
@@ -4183,121 +999,63 @@ be_local_closure(Matter_Device_compute_manual_pairing_code, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 6]) { /* constants */
- /* K0 */ be_nested_str_weak(root_discriminator),
- /* K1 */ be_nested_str_weak(root_passcode),
- /* K2 */ be_nested_str_weak(_X251i_X2505i_X2504i),
- /* K3 */ be_nested_str_weak(matter),
- /* K4 */ be_nested_str_weak(Verhoeff),
- /* K5 */ be_nested_str_weak(checksum),
+ ( &(const bvalue[12]) { /* constants */
+ /* K0 */ be_nested_str_weak(resize),
+ /* K1 */ be_nested_str_weak(setbits),
+ /* K2 */ be_const_int(3),
+ /* K3 */ be_nested_str_weak(vendorid),
+ /* K4 */ be_nested_str_weak(productid),
+ /* K5 */ be_nested_str_weak(root_discriminator),
+ /* K6 */ be_nested_str_weak(root_passcode),
+ /* K7 */ be_const_int(134217727),
+ /* K8 */ be_nested_str_weak(MT_X3A),
+ /* K9 */ be_nested_str_weak(matter),
+ /* K10 */ be_nested_str_weak(Base38),
+ /* K11 */ be_nested_str_weak(encode),
}),
- be_str_weak(compute_manual_pairing_code),
+ be_str_weak(compute_qrcode_content),
&be_const_str_solidified,
- ( &(const binstruction[30]) { /* code */
- 0x88040100, // 0000 GETMBR R1 R0 K0
- 0x540A0FFE, // 0001 LDINT R2 4095
- 0x2C040202, // 0002 AND R1 R1 R2
- 0x540A0009, // 0003 LDINT R2 10
- 0x3C040202, // 0004 SHR R1 R1 R2
- 0x88080100, // 0005 GETMBR R2 R0 K0
- 0x540E02FF, // 0006 LDINT R3 768
- 0x2C080403, // 0007 AND R2 R2 R3
- 0x540E0005, // 0008 LDINT R3 6
- 0x38080403, // 0009 SHL R2 R2 R3
- 0x880C0101, // 000A GETMBR R3 R0 K1
- 0x54123FFE, // 000B LDINT R4 16383
- 0x2C0C0604, // 000C AND R3 R3 R4
- 0x30080403, // 000D OR R2 R2 R3
- 0x880C0101, // 000E GETMBR R3 R0 K1
- 0x5412000D, // 000F LDINT R4 14
- 0x3C0C0604, // 0010 SHR R3 R3 R4
- 0x60100018, // 0011 GETGBL R4 G24
- 0x58140002, // 0012 LDCONST R5 K2
- 0x5C180200, // 0013 MOVE R6 R1
- 0x5C1C0400, // 0014 MOVE R7 R2
- 0x5C200600, // 0015 MOVE R8 R3
- 0x7C100800, // 0016 CALL R4 4
- 0xB8160600, // 0017 GETNGBL R5 K3
- 0x88140B04, // 0018 GETMBR R5 R5 K4
- 0x8C140B05, // 0019 GETMET R5 R5 K5
- 0x5C1C0800, // 001A MOVE R7 R4
- 0x7C140400, // 001B CALL R5 2
- 0x00100805, // 001C ADD R4 R4 R5
- 0x80040800, // 001D RET 1 R4
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: get_plugin_remote_info
-********************************************************************/
-be_local_closure(Matter_Device_get_plugin_remote_info, /* name */
- be_nested_proto(
- 6, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(plugins_config_remotes),
- /* K1 */ be_nested_str_weak(find),
- }),
- be_str_weak(get_plugin_remote_info),
- &be_const_str_solidified,
- ( &(const binstruction[ 7]) { /* code */
- 0x88080100, // 0000 GETMBR R2 R0 K0
- 0x8C080501, // 0001 GETMET R2 R2 K1
- 0x5C100200, // 0002 MOVE R4 R1
- 0x60140013, // 0003 GETGBL R5 G19
- 0x7C140000, // 0004 CALL R5 0
- 0x7C080600, // 0005 CALL R2 3
- 0x80040400, // 0006 RET 1 R2
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: event_fabrics_saved
-********************************************************************/
-be_local_closure(Matter_Device_event_fabrics_saved, /* name */
- be_nested_proto(
- 3, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 5]) { /* constants */
- /* K0 */ be_nested_str_weak(sessions),
- /* K1 */ be_nested_str_weak(count_active_fabrics),
- /* K2 */ be_const_int(0),
- /* K3 */ be_nested_str_weak(plugins_persist),
- /* K4 */ be_nested_str_weak(save_param),
- }),
- be_str_weak(event_fabrics_saved),
- &be_const_str_solidified,
- ( &(const binstruction[12]) { /* code */
- 0x88040100, // 0000 GETMBR R1 R0 K0
- 0x8C040301, // 0001 GETMET R1 R1 K1
- 0x7C040200, // 0002 CALL R1 1
- 0x24040302, // 0003 GT R1 R1 K2
- 0x78060005, // 0004 JMPF R1 #000B
- 0x88040103, // 0005 GETMBR R1 R0 K3
- 0x74060003, // 0006 JMPT R1 #000B
- 0x50040200, // 0007 LDBOOL R1 1 0
- 0x90020601, // 0008 SETMBR R0 K3 R1
- 0x8C040104, // 0009 GETMET R1 R0 K4
- 0x7C040200, // 000A CALL R1 1
- 0x80000000, // 000B RET 0
+ ( &(const binstruction[40]) { /* code */
+ 0x60040015, // 0000 GETGBL R1 G21
+ 0x7C040000, // 0001 CALL R1 0
+ 0x8C040300, // 0002 GETMET R1 R1 K0
+ 0x540E000A, // 0003 LDINT R3 11
+ 0x7C040400, // 0004 CALL R1 2
+ 0x8C080301, // 0005 GETMET R2 R1 K1
+ 0x58100002, // 0006 LDCONST R4 K2
+ 0x5416000F, // 0007 LDINT R5 16
+ 0x88180103, // 0008 GETMBR R6 R0 K3
+ 0x7C080800, // 0009 CALL R2 4
+ 0x8C080301, // 000A GETMET R2 R1 K1
+ 0x54120012, // 000B LDINT R4 19
+ 0x5416000F, // 000C LDINT R5 16
+ 0x88180104, // 000D GETMBR R6 R0 K4
+ 0x7C080800, // 000E CALL R2 4
+ 0x8C080301, // 000F GETMET R2 R1 K1
+ 0x54120024, // 0010 LDINT R4 37
+ 0x54160007, // 0011 LDINT R5 8
+ 0x541A0003, // 0012 LDINT R6 4
+ 0x7C080800, // 0013 CALL R2 4
+ 0x8C080301, // 0014 GETMET R2 R1 K1
+ 0x5412002C, // 0015 LDINT R4 45
+ 0x5416000B, // 0016 LDINT R5 12
+ 0x88180105, // 0017 GETMBR R6 R0 K5
+ 0x541E0FFE, // 0018 LDINT R7 4095
+ 0x2C180C07, // 0019 AND R6 R6 R7
+ 0x7C080800, // 001A CALL R2 4
+ 0x8C080301, // 001B GETMET R2 R1 K1
+ 0x54120038, // 001C LDINT R4 57
+ 0x5416001A, // 001D LDINT R5 27
+ 0x88180106, // 001E GETMBR R6 R0 K6
+ 0x2C180D07, // 001F AND R6 R6 K7
+ 0x7C080800, // 0020 CALL R2 4
+ 0xB80A1200, // 0021 GETNGBL R2 K9
+ 0x8808050A, // 0022 GETMBR R2 R2 K10
+ 0x8C08050B, // 0023 GETMET R2 R2 K11
+ 0x5C100200, // 0024 MOVE R4 R1
+ 0x7C080400, // 0025 CALL R2 2
+ 0x000A1002, // 0026 ADD R2 K8 R2
+ 0x80040400, // 0027 RET 1 R2
})
)
);
@@ -4385,909 +1143,81 @@ be_local_closure(Matter_Device_autoconf_device, /* name */
/********************************************************************
-** Solidified function: start_root_basic_commissioning
+** Solidified function: sort_distinct
********************************************************************/
-be_local_closure(Matter_Device_start_root_basic_commissioning, /* name */
+be_local_closure(Matter_Device_sort_distinct, /* name */
be_nested_proto(
- 13, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[18]) { /* constants */
- /* K0 */ be_nested_str_weak(PASE_TIMEOUT),
- /* K1 */ be_nested_str_weak(compute_manual_pairing_code),
- /* K2 */ be_nested_str_weak(tasmota),
- /* K3 */ be_nested_str_weak(log),
- /* K4 */ be_nested_str_weak(MTR_X3A_X20Manual_X20pairing_X20code_X3A_X20_X25s),
- /* K5 */ be_const_int(2),
- /* K6 */ be_nested_str_weak(compute_qrcode_content),
- /* K7 */ be_nested_str_weak(publish_result),
- /* K8 */ be_nested_str_weak(_X7B_X22Matter_X22_X3A_X7B_X22Commissioning_X22_X3A1_X2C_X22PairingCode_X22_X3A_X22_X25s_X22_X2C_X22QRCode_X22_X3A_X22_X25s_X22_X7D_X7D),
- /* K9 */ be_nested_str_weak(Matter),
- /* K10 */ be_nested_str_weak(_compute_pbkdf),
- /* K11 */ be_nested_str_weak(root_passcode),
- /* K12 */ be_nested_str_weak(root_iterations),
- /* K13 */ be_nested_str_weak(root_salt),
- /* K14 */ be_nested_str_weak(start_basic_commissioning),
- /* K15 */ be_nested_str_weak(root_discriminator),
- /* K16 */ be_nested_str_weak(root_w0),
- /* K17 */ be_nested_str_weak(root_L),
- }),
- be_str_weak(start_root_basic_commissioning),
- &be_const_str_solidified,
- ( &(const binstruction[40]) { /* code */
- 0x4C080000, // 0000 LDNIL R2
- 0x1C080202, // 0001 EQ R2 R1 R2
- 0x780A0000, // 0002 JMPF R2 #0004
- 0x88040100, // 0003 GETMBR R1 R0 K0
- 0x8C080101, // 0004 GETMET R2 R0 K1
- 0x7C080200, // 0005 CALL R2 1
- 0xB80E0400, // 0006 GETNGBL R3 K2
- 0x8C0C0703, // 0007 GETMET R3 R3 K3
- 0x60140018, // 0008 GETGBL R5 G24
- 0x58180004, // 0009 LDCONST R6 K4
- 0x5C1C0400, // 000A MOVE R7 R2
- 0x7C140400, // 000B CALL R5 2
- 0x58180005, // 000C LDCONST R6 K5
- 0x7C0C0600, // 000D CALL R3 3
- 0x8C0C0106, // 000E GETMET R3 R0 K6
- 0x7C0C0200, // 000F CALL R3 1
- 0xB8120400, // 0010 GETNGBL R4 K2
- 0x8C100907, // 0011 GETMET R4 R4 K7
- 0x60180018, // 0012 GETGBL R6 G24
- 0x581C0008, // 0013 LDCONST R7 K8
- 0x5C200400, // 0014 MOVE R8 R2
- 0x5C240600, // 0015 MOVE R9 R3
- 0x7C180600, // 0016 CALL R6 3
- 0x581C0009, // 0017 LDCONST R7 K9
- 0x7C100600, // 0018 CALL R4 3
- 0x8C10010A, // 0019 GETMET R4 R0 K10
- 0x8818010B, // 001A GETMBR R6 R0 K11
- 0x881C010C, // 001B GETMBR R7 R0 K12
- 0x8820010D, // 001C GETMBR R8 R0 K13
- 0x7C100800, // 001D CALL R4 4
- 0x8C10010E, // 001E GETMET R4 R0 K14
- 0x5C180200, // 001F MOVE R6 R1
- 0x881C010C, // 0020 GETMBR R7 R0 K12
- 0x8820010F, // 0021 GETMBR R8 R0 K15
- 0x8824010D, // 0022 GETMBR R9 R0 K13
- 0x88280110, // 0023 GETMBR R10 R0 K16
- 0x882C0111, // 0024 GETMBR R11 R0 K17
- 0x4C300000, // 0025 LDNIL R12
- 0x7C101000, // 0026 CALL R4 8
- 0x80000000, // 0027 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: mdns_announce_op_discovery_all_fabrics
-********************************************************************/
-be_local_closure(Matter_Device_mdns_announce_op_discovery_all_fabrics, /* name */
- be_nested_proto(
- 6, /* nstack */
+ 7, /* nstack */
1, /* argc */
- 2, /* varg */
+ 4, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 6]) { /* constants */
- /* K0 */ be_nested_str_weak(sessions),
- /* K1 */ be_nested_str_weak(active_fabrics),
- /* K2 */ be_nested_str_weak(get_device_id),
- /* K3 */ be_nested_str_weak(get_fabric_id),
- /* K4 */ be_nested_str_weak(mdns_announce_op_discovery),
- /* K5 */ be_nested_str_weak(stop_iteration),
+ ( &(const bvalue[ 5]) { /* constants */
+ /* K0 */ be_const_class(be_class_Matter_Device),
+ /* K1 */ be_const_int(1),
+ /* K2 */ be_const_int(0),
+ /* K3 */ be_nested_str_weak(stop_iteration),
+ /* K4 */ be_nested_str_weak(remove),
}),
- be_str_weak(mdns_announce_op_discovery_all_fabrics),
+ be_str_weak(sort_distinct),
&be_const_str_solidified,
- ( &(const binstruction[22]) { /* code */
- 0x60040010, // 0000 GETGBL R1 G16
- 0x88080100, // 0001 GETMBR R2 R0 K0
- 0x8C080501, // 0002 GETMET R2 R2 K1
- 0x7C080200, // 0003 CALL R2 1
- 0x7C040200, // 0004 CALL R1 1
- 0xA802000B, // 0005 EXBLK 0 #0012
- 0x5C080200, // 0006 MOVE R2 R1
- 0x7C080000, // 0007 CALL R2 0
- 0x8C0C0502, // 0008 GETMET R3 R2 K2
- 0x7C0C0200, // 0009 CALL R3 1
- 0x780E0005, // 000A JMPF R3 #0011
- 0x8C0C0503, // 000B GETMET R3 R2 K3
- 0x7C0C0200, // 000C CALL R3 1
- 0x780E0002, // 000D JMPF R3 #0011
- 0x8C0C0104, // 000E GETMET R3 R0 K4
- 0x5C140400, // 000F MOVE R5 R2
- 0x7C0C0400, // 0010 CALL R3 2
- 0x7001FFF3, // 0011 JMP #0006
- 0x58040005, // 0012 LDCONST R1 K5
- 0xAC040200, // 0013 CATCH R1 1 0
- 0xB0080000, // 0014 RAISE 2 R0 R0
- 0x80000000, // 0015 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: mdns_remove_op_discovery
-********************************************************************/
-be_local_closure(Matter_Device_mdns_remove_op_discovery, /* name */
- be_nested_proto(
- 12, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[23]) { /* constants */
- /* K0 */ be_nested_str_weak(mdns),
- /* K1 */ be_nested_str_weak(get_device_id),
- /* K2 */ be_nested_str_weak(copy),
- /* K3 */ be_nested_str_weak(reverse),
- /* K4 */ be_nested_str_weak(get_fabric_compressed),
- /* K5 */ be_nested_str_weak(tohex),
- /* K6 */ be_nested_str_weak(_X2D),
- /* K7 */ be_nested_str_weak(tasmota),
- /* K8 */ be_nested_str_weak(eth),
- /* K9 */ be_nested_str_weak(find),
- /* K10 */ be_nested_str_weak(up),
- /* K11 */ be_nested_str_weak(log),
- /* K12 */ be_nested_str_weak(MTR_X3A_X20remove_X20mDNS_X20on_X20_X25s_X20_X27_X25s_X27),
- /* K13 */ be_const_int(3),
- /* K14 */ be_nested_str_weak(remove_service),
- /* K15 */ be_nested_str_weak(_matter),
- /* K16 */ be_nested_str_weak(_tcp),
- /* K17 */ be_nested_str_weak(hostname_eth),
- /* K18 */ be_nested_str_weak(wifi),
- /* K19 */ be_nested_str_weak(hostname_wifi),
- /* K20 */ be_nested_str_weak(MTR_X3A_X20Exception),
- /* K21 */ be_nested_str_weak(_X7C),
- /* K22 */ be_const_int(2),
- }),
- be_str_weak(mdns_remove_op_discovery),
- &be_const_str_solidified,
- ( &(const binstruction[80]) { /* code */
- 0xA40A0000, // 0000 IMPORT R2 K0
- 0xA802003B, // 0001 EXBLK 0 #003E
- 0x8C0C0301, // 0002 GETMET R3 R1 K1
- 0x7C0C0200, // 0003 CALL R3 1
- 0x8C0C0702, // 0004 GETMET R3 R3 K2
- 0x7C0C0200, // 0005 CALL R3 1
- 0x8C0C0703, // 0006 GETMET R3 R3 K3
- 0x7C0C0200, // 0007 CALL R3 1
- 0x8C100304, // 0008 GETMET R4 R1 K4
- 0x7C100200, // 0009 CALL R4 1
- 0x8C140905, // 000A GETMET R5 R4 K5
- 0x7C140200, // 000B CALL R5 1
- 0x00140B06, // 000C ADD R5 R5 K6
- 0x8C180705, // 000D GETMET R6 R3 K5
- 0x7C180200, // 000E CALL R6 1
- 0x00140A06, // 000F ADD R5 R5 R6
- 0xB81A0E00, // 0010 GETNGBL R6 K7
- 0x8C180D08, // 0011 GETMET R6 R6 K8
- 0x7C180200, // 0012 CALL R6 1
- 0x8C180D09, // 0013 GETMET R6 R6 K9
- 0x5820000A, // 0014 LDCONST R8 K10
- 0x7C180400, // 0015 CALL R6 2
- 0x781A000E, // 0016 JMPF R6 #0026
- 0xB81A0E00, // 0017 GETNGBL R6 K7
- 0x8C180D0B, // 0018 GETMET R6 R6 K11
- 0x60200018, // 0019 GETGBL R8 G24
- 0x5824000C, // 001A LDCONST R9 K12
- 0x58280008, // 001B LDCONST R10 K8
- 0x5C2C0A00, // 001C MOVE R11 R5
- 0x7C200600, // 001D CALL R8 3
- 0x5824000D, // 001E LDCONST R9 K13
- 0x7C180600, // 001F CALL R6 3
- 0x8C18050E, // 0020 GETMET R6 R2 K14
- 0x5820000F, // 0021 LDCONST R8 K15
- 0x58240010, // 0022 LDCONST R9 K16
- 0x5C280A00, // 0023 MOVE R10 R5
- 0x882C0111, // 0024 GETMBR R11 R0 K17
- 0x7C180A00, // 0025 CALL R6 5
- 0xB81A0E00, // 0026 GETNGBL R6 K7
- 0x8C180D12, // 0027 GETMET R6 R6 K18
- 0x7C180200, // 0028 CALL R6 1
- 0x8C180D09, // 0029 GETMET R6 R6 K9
- 0x5820000A, // 002A LDCONST R8 K10
- 0x7C180400, // 002B CALL R6 2
- 0x781A000E, // 002C JMPF R6 #003C
- 0xB81A0E00, // 002D GETNGBL R6 K7
- 0x8C180D0B, // 002E GETMET R6 R6 K11
- 0x60200018, // 002F GETGBL R8 G24
- 0x5824000C, // 0030 LDCONST R9 K12
- 0x58280012, // 0031 LDCONST R10 K18
- 0x5C2C0A00, // 0032 MOVE R11 R5
- 0x7C200600, // 0033 CALL R8 3
- 0x5824000D, // 0034 LDCONST R9 K13
- 0x7C180600, // 0035 CALL R6 3
- 0x8C18050E, // 0036 GETMET R6 R2 K14
- 0x5820000F, // 0037 LDCONST R8 K15
- 0x58240010, // 0038 LDCONST R9 K16
- 0x5C280A00, // 0039 MOVE R10 R5
- 0x882C0113, // 003A GETMBR R11 R0 K19
- 0x7C180A00, // 003B CALL R6 5
- 0xA8040001, // 003C EXBLK 1 1
- 0x70020010, // 003D JMP #004F
- 0xAC0C0002, // 003E CATCH R3 0 2
- 0x7002000D, // 003F JMP #004E
- 0xB8160E00, // 0040 GETNGBL R5 K7
- 0x8C140B0B, // 0041 GETMET R5 R5 K11
- 0x601C0008, // 0042 GETGBL R7 G8
- 0x5C200600, // 0043 MOVE R8 R3
- 0x7C1C0200, // 0044 CALL R7 1
- 0x001E2807, // 0045 ADD R7 K20 R7
- 0x001C0F15, // 0046 ADD R7 R7 K21
- 0x60200008, // 0047 GETGBL R8 G8
- 0x5C240800, // 0048 MOVE R9 R4
- 0x7C200200, // 0049 CALL R8 1
- 0x001C0E08, // 004A ADD R7 R7 R8
- 0x58200016, // 004B LDCONST R8 K22
- 0x7C140600, // 004C CALL R5 3
- 0x70020000, // 004D JMP #004F
- 0xB0080000, // 004E RAISE 2 R0 R0
- 0x80000000, // 004F RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: mdns_announce_PASE
-********************************************************************/
-be_local_closure(Matter_Device_mdns_announce_PASE, /* name */
- be_nested_proto(
- 12, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[41]) { /* constants */
- /* K0 */ be_nested_str_weak(mdns),
- /* K1 */ be_nested_str_weak(crypto),
- /* K2 */ be_nested_str_weak(VP),
- /* K3 */ be_nested_str_weak(vendorid),
- /* K4 */ be_nested_str_weak(_X2B),
- /* K5 */ be_nested_str_weak(productid),
- /* K6 */ be_nested_str_weak(D),
- /* K7 */ be_nested_str_weak(commissioning_discriminator),
- /* K8 */ be_nested_str_weak(CM),
- /* K9 */ be_const_int(1),
- /* K10 */ be_nested_str_weak(T),
- /* K11 */ be_const_int(0),
- /* K12 */ be_nested_str_weak(SII),
- /* K13 */ be_nested_str_weak(SAI),
- /* K14 */ be_nested_str_weak(commissioning_instance_wifi),
- /* K15 */ be_nested_str_weak(random),
- /* K16 */ be_nested_str_weak(tohex),
- /* K17 */ be_nested_str_weak(commissioning_instance_eth),
- /* K18 */ be_nested_str_weak(hostname_eth),
- /* K19 */ be_nested_str_weak(add_service),
- /* K20 */ be_nested_str_weak(_matterc),
- /* K21 */ be_nested_str_weak(_udp),
- /* K22 */ be_nested_str_weak(mdns_pase_eth),
- /* K23 */ be_nested_str_weak(tasmota),
- /* K24 */ be_nested_str_weak(log),
- /* K25 */ be_nested_str_weak(MTR_X3A_X20announce_X20mDNS_X20on_X20_X25s_X20_X27_X25s_X27_X20ptr_X20to_X20_X60_X25s_X2Elocal_X60),
- /* K26 */ be_nested_str_weak(eth),
- /* K27 */ be_const_int(2),
- /* K28 */ be_nested_str_weak(_L),
- /* K29 */ be_nested_str_weak(MTR_X3A_X20adding_X20subtype_X3A_X20),
- /* K30 */ be_const_int(3),
- /* K31 */ be_nested_str_weak(add_subtype),
- /* K32 */ be_nested_str_weak(_S),
- /* K33 */ be_nested_str_weak(_V),
- /* K34 */ be_nested_str_weak(_CM1),
- /* K35 */ be_nested_str_weak(hostname_wifi),
- /* K36 */ be_nested_str_weak(mdns_pase_wifi),
- /* K37 */ be_nested_str_weak(MTR_X3A_X20starting_X20mDNS_X20on_X20_X25s_X20_X27_X25s_X27_X20ptr_X20to_X20_X60_X25s_X2Elocal_X60),
- /* K38 */ be_nested_str_weak(wifi),
- /* K39 */ be_nested_str_weak(MTR_X3A_X20Exception),
- /* K40 */ be_nested_str_weak(_X7C),
- }),
- be_str_weak(mdns_announce_PASE),
- &be_const_str_solidified,
- ( &(const binstruction[236]) { /* code */
- 0xA4060000, // 0000 IMPORT R1 K0
- 0xA40A0200, // 0001 IMPORT R2 K1
- 0x600C0013, // 0002 GETGBL R3 G19
- 0x7C0C0000, // 0003 CALL R3 0
- 0x60100008, // 0004 GETGBL R4 G8
- 0x88140103, // 0005 GETMBR R5 R0 K3
- 0x7C100200, // 0006 CALL R4 1
- 0x00100904, // 0007 ADD R4 R4 K4
- 0x60140008, // 0008 GETGBL R5 G8
- 0x88180105, // 0009 GETMBR R6 R0 K5
- 0x7C140200, // 000A CALL R5 1
- 0x00100805, // 000B ADD R4 R4 R5
- 0x980E0404, // 000C SETIDX R3 K2 R4
- 0x88100107, // 000D GETMBR R4 R0 K7
- 0x980E0C04, // 000E SETIDX R3 K6 R4
- 0x980E1109, // 000F SETIDX R3 K8 K9
- 0x980E150B, // 0010 SETIDX R3 K10 K11
- 0x54121387, // 0011 LDINT R4 5000
- 0x980E1804, // 0012 SETIDX R3 K12 R4
- 0x5412012B, // 0013 LDINT R4 300
- 0x980E1A04, // 0014 SETIDX R3 K13 R4
- 0x8C10050F, // 0015 GETMET R4 R2 K15
- 0x541A0007, // 0016 LDINT R6 8
- 0x7C100400, // 0017 CALL R4 2
- 0x8C100910, // 0018 GETMET R4 R4 K16
- 0x7C100200, // 0019 CALL R4 1
- 0x90021C04, // 001A SETMBR R0 K14 R4
- 0x8C10050F, // 001B GETMET R4 R2 K15
- 0x541A0007, // 001C LDINT R6 8
- 0x7C100400, // 001D CALL R4 2
- 0x8C100910, // 001E GETMET R4 R4 K16
- 0x7C100200, // 001F CALL R4 1
- 0x90022204, // 0020 SETMBR R0 K17 R4
- 0xA80200B7, // 0021 EXBLK 0 #00DA
- 0x88100112, // 0022 GETMBR R4 R0 K18
- 0x78120058, // 0023 JMPF R4 #007D
- 0x8C100313, // 0024 GETMET R4 R1 K19
- 0x58180014, // 0025 LDCONST R6 K20
- 0x581C0015, // 0026 LDCONST R7 K21
- 0x542215A3, // 0027 LDINT R8 5540
- 0x5C240600, // 0028 MOVE R9 R3
- 0x88280111, // 0029 GETMBR R10 R0 K17
- 0x882C0112, // 002A GETMBR R11 R0 K18
- 0x7C100E00, // 002B CALL R4 7
- 0x50100200, // 002C LDBOOL R4 1 0
- 0x90022C04, // 002D SETMBR R0 K22 R4
- 0xB8122E00, // 002E GETNGBL R4 K23
- 0x8C100918, // 002F GETMET R4 R4 K24
- 0x60180018, // 0030 GETGBL R6 G24
- 0x581C0019, // 0031 LDCONST R7 K25
- 0x5820001A, // 0032 LDCONST R8 K26
- 0x88240111, // 0033 GETMBR R9 R0 K17
- 0x88280112, // 0034 GETMBR R10 R0 K18
- 0x7C180800, // 0035 CALL R6 4
- 0x581C001B, // 0036 LDCONST R7 K27
- 0x7C100600, // 0037 CALL R4 3
- 0x60100008, // 0038 GETGBL R4 G8
- 0x88140107, // 0039 GETMBR R5 R0 K7
- 0x541A0FFE, // 003A LDINT R6 4095
- 0x2C140A06, // 003B AND R5 R5 R6
- 0x7C100200, // 003C CALL R4 1
- 0x00123804, // 003D ADD R4 K28 R4
- 0xB8162E00, // 003E GETNGBL R5 K23
- 0x8C140B18, // 003F GETMET R5 R5 K24
- 0x001E3A04, // 0040 ADD R7 K29 R4
- 0x5820001E, // 0041 LDCONST R8 K30
- 0x7C140600, // 0042 CALL R5 3
- 0x8C14031F, // 0043 GETMET R5 R1 K31
- 0x581C0014, // 0044 LDCONST R7 K20
- 0x58200015, // 0045 LDCONST R8 K21
- 0x88240111, // 0046 GETMBR R9 R0 K17
- 0x88280112, // 0047 GETMBR R10 R0 K18
- 0x5C2C0800, // 0048 MOVE R11 R4
- 0x7C140C00, // 0049 CALL R5 6
- 0x60140008, // 004A GETGBL R5 G8
- 0x88180107, // 004B GETMBR R6 R0 K7
- 0x541E0EFF, // 004C LDINT R7 3840
- 0x2C180C07, // 004D AND R6 R6 R7
- 0x541E0007, // 004E LDINT R7 8
- 0x3C180C07, // 004F SHR R6 R6 R7
- 0x7C140200, // 0050 CALL R5 1
- 0x00164005, // 0051 ADD R5 K32 R5
- 0x5C100A00, // 0052 MOVE R4 R5
- 0xB8162E00, // 0053 GETNGBL R5 K23
- 0x8C140B18, // 0054 GETMET R5 R5 K24
- 0x001E3A04, // 0055 ADD R7 K29 R4
- 0x5820001E, // 0056 LDCONST R8 K30
- 0x7C140600, // 0057 CALL R5 3
- 0x8C14031F, // 0058 GETMET R5 R1 K31
- 0x581C0014, // 0059 LDCONST R7 K20
- 0x58200015, // 005A LDCONST R8 K21
- 0x88240111, // 005B GETMBR R9 R0 K17
- 0x88280112, // 005C GETMBR R10 R0 K18
- 0x5C2C0800, // 005D MOVE R11 R4
- 0x7C140C00, // 005E CALL R5 6
- 0x60140008, // 005F GETGBL R5 G8
- 0x88180103, // 0060 GETMBR R6 R0 K3
- 0x7C140200, // 0061 CALL R5 1
- 0x00164205, // 0062 ADD R5 K33 R5
- 0x5C100A00, // 0063 MOVE R4 R5
- 0xB8162E00, // 0064 GETNGBL R5 K23
- 0x8C140B18, // 0065 GETMET R5 R5 K24
- 0x001E3A04, // 0066 ADD R7 K29 R4
- 0x5820001E, // 0067 LDCONST R8 K30
- 0x7C140600, // 0068 CALL R5 3
- 0x8C14031F, // 0069 GETMET R5 R1 K31
- 0x581C0014, // 006A LDCONST R7 K20
- 0x58200015, // 006B LDCONST R8 K21
- 0x88240111, // 006C GETMBR R9 R0 K17
- 0x88280112, // 006D GETMBR R10 R0 K18
- 0x5C2C0800, // 006E MOVE R11 R4
- 0x7C140C00, // 006F CALL R5 6
- 0x58100022, // 0070 LDCONST R4 K34
- 0xB8162E00, // 0071 GETNGBL R5 K23
- 0x8C140B18, // 0072 GETMET R5 R5 K24
- 0x001E3A04, // 0073 ADD R7 K29 R4
- 0x5820001E, // 0074 LDCONST R8 K30
- 0x7C140600, // 0075 CALL R5 3
- 0x8C14031F, // 0076 GETMET R5 R1 K31
- 0x581C0014, // 0077 LDCONST R7 K20
- 0x58200015, // 0078 LDCONST R8 K21
- 0x88240111, // 0079 GETMBR R9 R0 K17
- 0x88280112, // 007A GETMBR R10 R0 K18
- 0x5C2C0800, // 007B MOVE R11 R4
- 0x7C140C00, // 007C CALL R5 6
- 0x88100123, // 007D GETMBR R4 R0 K35
- 0x78120058, // 007E JMPF R4 #00D8
- 0x8C100313, // 007F GETMET R4 R1 K19
- 0x58180014, // 0080 LDCONST R6 K20
- 0x581C0015, // 0081 LDCONST R7 K21
- 0x542215A3, // 0082 LDINT R8 5540
- 0x5C240600, // 0083 MOVE R9 R3
- 0x8828010E, // 0084 GETMBR R10 R0 K14
- 0x882C0123, // 0085 GETMBR R11 R0 K35
- 0x7C100E00, // 0086 CALL R4 7
- 0x50100200, // 0087 LDBOOL R4 1 0
- 0x90024804, // 0088 SETMBR R0 K36 R4
- 0xB8122E00, // 0089 GETNGBL R4 K23
- 0x8C100918, // 008A GETMET R4 R4 K24
- 0x60180018, // 008B GETGBL R6 G24
- 0x581C0025, // 008C LDCONST R7 K37
- 0x58200026, // 008D LDCONST R8 K38
- 0x8824010E, // 008E GETMBR R9 R0 K14
- 0x88280123, // 008F GETMBR R10 R0 K35
- 0x7C180800, // 0090 CALL R6 4
- 0x581C001E, // 0091 LDCONST R7 K30
- 0x7C100600, // 0092 CALL R4 3
- 0x60100008, // 0093 GETGBL R4 G8
- 0x88140107, // 0094 GETMBR R5 R0 K7
- 0x541A0FFE, // 0095 LDINT R6 4095
- 0x2C140A06, // 0096 AND R5 R5 R6
- 0x7C100200, // 0097 CALL R4 1
- 0x00123804, // 0098 ADD R4 K28 R4
- 0xB8162E00, // 0099 GETNGBL R5 K23
- 0x8C140B18, // 009A GETMET R5 R5 K24
- 0x001E3A04, // 009B ADD R7 K29 R4
- 0x5820001E, // 009C LDCONST R8 K30
- 0x7C140600, // 009D CALL R5 3
- 0x8C14031F, // 009E GETMET R5 R1 K31
- 0x581C0014, // 009F LDCONST R7 K20
- 0x58200015, // 00A0 LDCONST R8 K21
- 0x8824010E, // 00A1 GETMBR R9 R0 K14
- 0x88280123, // 00A2 GETMBR R10 R0 K35
- 0x5C2C0800, // 00A3 MOVE R11 R4
- 0x7C140C00, // 00A4 CALL R5 6
- 0x60140008, // 00A5 GETGBL R5 G8
- 0x88180107, // 00A6 GETMBR R6 R0 K7
- 0x541E0EFF, // 00A7 LDINT R7 3840
- 0x2C180C07, // 00A8 AND R6 R6 R7
- 0x541E0007, // 00A9 LDINT R7 8
- 0x3C180C07, // 00AA SHR R6 R6 R7
- 0x7C140200, // 00AB CALL R5 1
- 0x00164005, // 00AC ADD R5 K32 R5
- 0x5C100A00, // 00AD MOVE R4 R5
- 0xB8162E00, // 00AE GETNGBL R5 K23
- 0x8C140B18, // 00AF GETMET R5 R5 K24
- 0x001E3A04, // 00B0 ADD R7 K29 R4
- 0x5820001E, // 00B1 LDCONST R8 K30
- 0x7C140600, // 00B2 CALL R5 3
- 0x8C14031F, // 00B3 GETMET R5 R1 K31
- 0x581C0014, // 00B4 LDCONST R7 K20
- 0x58200015, // 00B5 LDCONST R8 K21
- 0x8824010E, // 00B6 GETMBR R9 R0 K14
- 0x88280123, // 00B7 GETMBR R10 R0 K35
- 0x5C2C0800, // 00B8 MOVE R11 R4
- 0x7C140C00, // 00B9 CALL R5 6
- 0x60140008, // 00BA GETGBL R5 G8
- 0x88180103, // 00BB GETMBR R6 R0 K3
- 0x7C140200, // 00BC CALL R5 1
- 0x00164205, // 00BD ADD R5 K33 R5
- 0x5C100A00, // 00BE MOVE R4 R5
- 0xB8162E00, // 00BF GETNGBL R5 K23
- 0x8C140B18, // 00C0 GETMET R5 R5 K24
- 0x001E3A04, // 00C1 ADD R7 K29 R4
- 0x5820001E, // 00C2 LDCONST R8 K30
- 0x7C140600, // 00C3 CALL R5 3
- 0x8C14031F, // 00C4 GETMET R5 R1 K31
- 0x581C0014, // 00C5 LDCONST R7 K20
- 0x58200015, // 00C6 LDCONST R8 K21
- 0x8824010E, // 00C7 GETMBR R9 R0 K14
- 0x88280123, // 00C8 GETMBR R10 R0 K35
- 0x5C2C0800, // 00C9 MOVE R11 R4
- 0x7C140C00, // 00CA CALL R5 6
- 0x58100022, // 00CB LDCONST R4 K34
- 0xB8162E00, // 00CC GETNGBL R5 K23
- 0x8C140B18, // 00CD GETMET R5 R5 K24
- 0x001E3A04, // 00CE ADD R7 K29 R4
- 0x5820001E, // 00CF LDCONST R8 K30
- 0x7C140600, // 00D0 CALL R5 3
- 0x8C14031F, // 00D1 GETMET R5 R1 K31
- 0x581C0014, // 00D2 LDCONST R7 K20
- 0x58200015, // 00D3 LDCONST R8 K21
- 0x8824010E, // 00D4 GETMBR R9 R0 K14
- 0x88280123, // 00D5 GETMBR R10 R0 K35
- 0x5C2C0800, // 00D6 MOVE R11 R4
- 0x7C140C00, // 00D7 CALL R5 6
- 0xA8040001, // 00D8 EXBLK 1 1
- 0x70020010, // 00D9 JMP #00EB
- 0xAC100002, // 00DA CATCH R4 0 2
- 0x7002000D, // 00DB JMP #00EA
- 0xB81A2E00, // 00DC GETNGBL R6 K23
- 0x8C180D18, // 00DD GETMET R6 R6 K24
- 0x60200008, // 00DE GETGBL R8 G8
- 0x5C240800, // 00DF MOVE R9 R4
- 0x7C200200, // 00E0 CALL R8 1
- 0x00224E08, // 00E1 ADD R8 K39 R8
- 0x00201128, // 00E2 ADD R8 R8 K40
- 0x60240008, // 00E3 GETGBL R9 G8
- 0x5C280A00, // 00E4 MOVE R10 R5
- 0x7C240200, // 00E5 CALL R9 1
- 0x00201009, // 00E6 ADD R8 R8 R9
- 0x5824001B, // 00E7 LDCONST R9 K27
- 0x7C180600, // 00E8 CALL R6 3
- 0x70020000, // 00E9 JMP #00EB
- 0xB0080000, // 00EA RAISE 2 R0 R0
- 0x80000000, // 00EB RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: start_commissioning_complete
-********************************************************************/
-be_local_closure(Matter_Device_start_commissioning_complete, /* name */
- be_nested_proto(
- 11, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[11]) { /* constants */
- /* K0 */ be_nested_str_weak(get_fabric),
- /* K1 */ be_nested_str_weak(get_fabric_id),
- /* K2 */ be_nested_str_weak(copy),
- /* K3 */ be_nested_str_weak(reverse),
- /* K4 */ be_nested_str_weak(tohex),
- /* K5 */ be_nested_str_weak(get_admin_vendor_name),
- /* K6 */ be_nested_str_weak(tasmota),
- /* K7 */ be_nested_str_weak(log),
- /* K8 */ be_nested_str_weak(MTR_X3A_X20_X2D_X2D_X2D_X20Commissioning_X20complete_X20for_X20Fabric_X20_X27_X25s_X27_X20_X28Vendor_X20_X25s_X29_X20_X2D_X2D_X2D),
- /* K9 */ be_const_int(2),
- /* K10 */ be_nested_str_weak(stop_basic_commissioning),
- }),
- be_str_weak(start_commissioning_complete),
- &be_const_str_solidified,
- ( &(const binstruction[24]) { /* code */
- 0x8C080300, // 0000 GETMET R2 R1 K0
- 0x7C080200, // 0001 CALL R2 1
- 0x8C0C0501, // 0002 GETMET R3 R2 K1
- 0x7C0C0200, // 0003 CALL R3 1
- 0x8C0C0702, // 0004 GETMET R3 R3 K2
- 0x7C0C0200, // 0005 CALL R3 1
- 0x8C0C0703, // 0006 GETMET R3 R3 K3
- 0x7C0C0200, // 0007 CALL R3 1
- 0x8C0C0704, // 0008 GETMET R3 R3 K4
- 0x7C0C0200, // 0009 CALL R3 1
- 0x8C100505, // 000A GETMET R4 R2 K5
- 0x7C100200, // 000B CALL R4 1
- 0xB8160C00, // 000C GETNGBL R5 K6
- 0x8C140B07, // 000D GETMET R5 R5 K7
- 0x601C0018, // 000E GETGBL R7 G24
- 0x58200008, // 000F LDCONST R8 K8
- 0x5C240600, // 0010 MOVE R9 R3
- 0x5C280800, // 0011 MOVE R10 R4
- 0x7C1C0600, // 0012 CALL R7 3
- 0x58200009, // 0013 LDCONST R8 K9
- 0x7C140600, // 0014 CALL R5 3
- 0x8C14010A, // 0015 GETMET R5 R0 K10
- 0x7C140200, // 0016 CALL R5 1
- 0x80000000, // 0017 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: MtrInfo
-********************************************************************/
-be_local_closure(Matter_Device_MtrInfo, /* name */
- be_nested_proto(
- 10, /* nstack */
- 5, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 9]) { /* constants */
- /* K0 */ be_nested_str_weak(),
- /* K1 */ be_nested_str_weak(plugins),
- /* K2 */ be_nested_str_weak(MtrInfo_one),
- /* K3 */ be_nested_str_weak(endpoint),
- /* K4 */ be_nested_str_weak(stop_iteration),
- /* K5 */ be_nested_str_weak(int),
- /* K6 */ be_nested_str_weak(find_plugin_by_friendly_name),
- /* K7 */ be_nested_str_weak(tasmota),
- /* K8 */ be_nested_str_weak(resp_cmnd_done),
- }),
- be_str_weak(MtrInfo),
- &be_const_str_solidified,
- ( &(const binstruction[40]) { /* code */
- 0x1C140700, // 0000 EQ R5 R3 K0
- 0x7815FFFF, // 0001 JMPF R5 #0002
- 0x1C140700, // 0002 EQ R5 R3 K0
- 0x7816000D, // 0003 JMPF R5 #0012
- 0x60140010, // 0004 GETGBL R5 G16
- 0x88180101, // 0005 GETMBR R6 R0 K1
- 0x7C140200, // 0006 CALL R5 1
- 0xA8020005, // 0007 EXBLK 0 #000E
- 0x5C180A00, // 0008 MOVE R6 R5
- 0x7C180000, // 0009 CALL R6 0
- 0x8C1C0102, // 000A GETMET R7 R0 K2
- 0x88240D03, // 000B GETMBR R9 R6 K3
- 0x7C1C0400, // 000C CALL R7 2
- 0x7001FFF9, // 000D JMP #0008
- 0x58140004, // 000E LDCONST R5 K4
- 0xAC140200, // 000F CATCH R5 1 0
- 0xB0080000, // 0010 RAISE 2 R0 R0
- 0x70020011, // 0011 JMP #0024
- 0x60140004, // 0012 GETGBL R5 G4
- 0x5C180800, // 0013 MOVE R6 R4
- 0x7C140200, // 0014 CALL R5 1
- 0x1C140B05, // 0015 EQ R5 R5 K5
- 0x78160003, // 0016 JMPF R5 #001B
- 0x8C140102, // 0017 GETMET R5 R0 K2
- 0x5C1C0800, // 0018 MOVE R7 R4
- 0x7C140400, // 0019 CALL R5 2
- 0x70020008, // 001A JMP #0024
- 0x8C140106, // 001B GETMET R5 R0 K6
- 0x5C1C0600, // 001C MOVE R7 R3
- 0x7C140400, // 001D CALL R5 2
- 0x4C180000, // 001E LDNIL R6
- 0x20180A06, // 001F NE R6 R5 R6
- 0x781A0002, // 0020 JMPF R6 #0024
- 0x8C180102, // 0021 GETMET R6 R0 K2
- 0x88200B03, // 0022 GETMBR R8 R5 K3
- 0x7C180400, // 0023 CALL R6 2
- 0xB8160E00, // 0024 GETNGBL R5 K7
- 0x8C140B08, // 0025 GETMET R5 R5 K8
- 0x7C140200, // 0026 CALL R5 1
- 0x80000000, // 0027 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: MtrUpdate
-********************************************************************/
-be_local_closure(Matter_Device_MtrUpdate, /* name */
- be_nested_proto(
- 18, /* nstack */
- 5, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[25]) { /* constants */
- /* K0 */ be_nested_str_weak(tasmota),
- /* K1 */ be_nested_str_weak(resp_cmnd_str),
- /* K2 */ be_nested_str_weak(Invalid_X20JSON),
- /* K3 */ be_nested_str_weak(find_key_i),
- /* K4 */ be_nested_str_weak(Ep),
- /* K5 */ be_nested_str_weak(Name),
- /* K6 */ be_const_int(0),
- /* K7 */ be_nested_str_weak(Invalid_X20_X27Ep_X27_X20attribute),
- /* K8 */ be_nested_str_weak(find_plugin_by_endpoint),
- /* K9 */ be_nested_str_weak(remove),
- /* K10 */ be_nested_str_weak(find_plugin_by_friendly_name),
- /* K11 */ be_nested_str_weak(Invalid_X20Device),
- /* K12 */ be_nested_str_weak(VIRTUAL),
- /* K13 */ be_nested_str_weak(Device_X20is_X20not_X20virtual),
- /* K14 */ be_nested_str_weak(consolidate_update_commands),
- /* K15 */ be_nested_str_weak(keys),
- /* K16 */ be_nested_str_weak(find_list_i),
- /* K17 */ be_nested_str_weak(Invalid_X20attribute_X20_X27_X25s_X27),
- /* K18 */ be_nested_str_weak(stop_iteration),
- /* K19 */ be_nested_str_weak(update_virtual),
- /* K20 */ be_nested_str_weak(state_json),
- /* K21 */ be_nested_str_weak(_X7B_X22_X25s_X22_X3A_X25s_X7D),
- /* K22 */ be_nested_str_weak(resp_cmnd),
- /* K23 */ be_nested_str_weak(resp_cmnd_done),
- /* K24 */ be_nested_str_weak(Missing_X20_X27Device_X27_X20attribute),
- }),
- be_str_weak(MtrUpdate),
- &be_const_str_solidified,
- ( &(const binstruction[126]) { /* code */
- 0x4C140000, // 0000 LDNIL R5
- 0x1C140805, // 0001 EQ R5 R4 R5
- 0x78160004, // 0002 JMPF R5 #0008
- 0xB8160000, // 0003 GETNGBL R5 K0
- 0x8C140B01, // 0004 GETMET R5 R5 K1
- 0x581C0002, // 0005 LDCONST R7 K2
- 0x7C140400, // 0006 CALL R5 2
- 0x80040A00, // 0007 RET 1 R5
- 0xB8160000, // 0008 GETNGBL R5 K0
- 0x8C140B03, // 0009 GETMET R5 R5 K3
- 0x5C1C0800, // 000A MOVE R7 R4
- 0x58200004, // 000B LDCONST R8 K4
- 0x7C140600, // 000C CALL R5 3
- 0xB81A0000, // 000D GETNGBL R6 K0
- 0x8C180D03, // 000E GETMET R6 R6 K3
- 0x5C200800, // 000F MOVE R8 R4
- 0x58240005, // 0010 LDCONST R9 K5
- 0x7C180600, // 0011 CALL R6 3
- 0x74160000, // 0012 JMPT R5 #0014
- 0x781A0064, // 0013 JMPF R6 #0079
- 0x4C1C0000, // 0014 LDNIL R7
- 0x78160010, // 0015 JMPF R5 #0027
- 0x60200009, // 0016 GETGBL R8 G9
- 0x94240805, // 0017 GETIDX R9 R4 R5
- 0x7C200200, // 0018 CALL R8 1
- 0x18241106, // 0019 LE R9 R8 K6
- 0x78260004, // 001A JMPF R9 #0020
- 0xB8260000, // 001B GETNGBL R9 K0
- 0x8C241301, // 001C GETMET R9 R9 K1
- 0x582C0007, // 001D LDCONST R11 K7
- 0x7C240400, // 001E CALL R9 2
- 0x80041200, // 001F RET 1 R9
- 0x8C240108, // 0020 GETMET R9 R0 K8
- 0x5C2C1000, // 0021 MOVE R11 R8
- 0x7C240400, // 0022 CALL R9 2
- 0x5C1C1200, // 0023 MOVE R7 R9
- 0x8C240909, // 0024 GETMET R9 R4 K9
- 0x5C2C0A00, // 0025 MOVE R11 R5
- 0x7C240400, // 0026 CALL R9 2
- 0x781A0009, // 0027 JMPF R6 #0032
- 0x4C200000, // 0028 LDNIL R8
- 0x1C200E08, // 0029 EQ R8 R7 R8
- 0x78220003, // 002A JMPF R8 #002F
- 0x8C20010A, // 002B GETMET R8 R0 K10
- 0x94280806, // 002C GETIDX R10 R4 R6
- 0x7C200400, // 002D CALL R8 2
- 0x5C1C1000, // 002E MOVE R7 R8
- 0x8C200909, // 002F GETMET R8 R4 K9
- 0x5C280C00, // 0030 MOVE R10 R6
- 0x7C200400, // 0031 CALL R8 2
- 0x4C200000, // 0032 LDNIL R8
- 0x1C200E08, // 0033 EQ R8 R7 R8
- 0x78220004, // 0034 JMPF R8 #003A
- 0xB8220000, // 0035 GETNGBL R8 K0
- 0x8C201101, // 0036 GETMET R8 R8 K1
- 0x5828000B, // 0037 LDCONST R10 K11
- 0x7C200400, // 0038 CALL R8 2
- 0x80041000, // 0039 RET 1 R8
- 0x88200F0C, // 003A GETMBR R8 R7 K12
- 0x74220004, // 003B JMPT R8 #0041
- 0xB8220000, // 003C GETNGBL R8 K0
- 0x8C201101, // 003D GETMET R8 R8 K1
- 0x5828000D, // 003E LDCONST R10 K13
- 0x7C200400, // 003F CALL R8 2
- 0x80041000, // 0040 RET 1 R8
- 0x8C200F0E, // 0041 GETMET R8 R7 K14
- 0x7C200200, // 0042 CALL R8 1
- 0x60240013, // 0043 GETGBL R9 G19
- 0x7C240000, // 0044 CALL R9 0
- 0x60280010, // 0045 GETGBL R10 G16
- 0x8C2C090F, // 0046 GETMET R11 R4 K15
- 0x7C2C0200, // 0047 CALL R11 1
- 0x7C280200, // 0048 CALL R10 1
- 0xA8020016, // 0049 EXBLK 0 #0061
- 0x5C2C1400, // 004A MOVE R11 R10
- 0x7C2C0000, // 004B CALL R11 0
- 0xB8320000, // 004C GETNGBL R12 K0
- 0x8C301910, // 004D GETMET R12 R12 K16
- 0x5C381000, // 004E MOVE R14 R8
- 0x5C3C1600, // 004F MOVE R15 R11
- 0x7C300600, // 0050 CALL R12 3
- 0x4C340000, // 0051 LDNIL R13
- 0x1C34180D, // 0052 EQ R13 R12 R13
- 0x78360008, // 0053 JMPF R13 #005D
- 0xB8360000, // 0054 GETNGBL R13 K0
- 0x8C341B01, // 0055 GETMET R13 R13 K1
- 0x603C0018, // 0056 GETGBL R15 G24
- 0x58400011, // 0057 LDCONST R16 K17
- 0x5C441600, // 0058 MOVE R17 R11
- 0x7C3C0400, // 0059 CALL R15 2
- 0x7C340400, // 005A CALL R13 2
- 0xA8040001, // 005B EXBLK 1 1
- 0x80001A00, // 005C RET 0
- 0x9434100C, // 005D GETIDX R13 R8 R12
- 0x9438080B, // 005E GETIDX R14 R4 R11
- 0x98241A0E, // 005F SETIDX R9 R13 R14
- 0x7001FFE8, // 0060 JMP #004A
- 0x58280012, // 0061 LDCONST R10 K18
- 0xAC280200, // 0062 CATCH R10 1 0
- 0xB0080000, // 0063 RAISE 2 R0 R0
- 0x8C280F13, // 0064 GETMET R10 R7 K19
- 0x5C301200, // 0065 MOVE R12 R9
- 0x7C280400, // 0066 CALL R10 2
- 0x8C280F14, // 0067 GETMET R10 R7 K20
- 0x7C280200, // 0068 CALL R10 1
- 0x782A000A, // 0069 JMPF R10 #0075
- 0x602C0018, // 006A GETGBL R11 G24
- 0x58300015, // 006B LDCONST R12 K21
- 0x5C340200, // 006C MOVE R13 R1
- 0x5C381400, // 006D MOVE R14 R10
- 0x7C2C0600, // 006E CALL R11 3
- 0xB8320000, // 006F GETNGBL R12 K0
- 0x8C301916, // 0070 GETMET R12 R12 K22
- 0x5C381600, // 0071 MOVE R14 R11
- 0x7C300400, // 0072 CALL R12 2
- 0x80041800, // 0073 RET 1 R12
- 0x70020003, // 0074 JMP #0079
- 0xB82E0000, // 0075 GETNGBL R11 K0
- 0x8C2C1717, // 0076 GETMET R11 R11 K23
- 0x7C2C0200, // 0077 CALL R11 1
- 0x80041600, // 0078 RET 1 R11
- 0xB81E0000, // 0079 GETNGBL R7 K0
- 0x8C1C0F01, // 007A GETMET R7 R7 K1
- 0x58240018, // 007B LDCONST R9 K24
- 0x7C1C0400, // 007C CALL R7 2
- 0x80000000, // 007D RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: MtrJoin
-********************************************************************/
-be_local_closure(Matter_Device_MtrJoin, /* name */
- be_nested_proto(
- 8, /* nstack */
- 5, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_nested_str_weak(start_root_basic_commissioning),
- /* K1 */ be_nested_str_weak(stop_basic_commissioning),
- /* K2 */ be_nested_str_weak(tasmota),
- /* K3 */ be_nested_str_weak(resp_cmnd_done),
- }),
- be_str_weak(MtrJoin),
- &be_const_str_solidified,
- ( &(const binstruction[13]) { /* code */
- 0x60140009, // 0000 GETGBL R5 G9
- 0x5C180600, // 0001 MOVE R6 R3
- 0x7C140200, // 0002 CALL R5 1
- 0x78160002, // 0003 JMPF R5 #0007
- 0x8C180100, // 0004 GETMET R6 R0 K0
- 0x7C180200, // 0005 CALL R6 1
- 0x70020001, // 0006 JMP #0009
- 0x8C180101, // 0007 GETMET R6 R0 K1
- 0x7C180200, // 0008 CALL R6 1
- 0xB81A0400, // 0009 GETNGBL R6 K2
- 0x8C180D03, // 000A GETMET R6 R6 K3
- 0x7C180200, // 000B CALL R6 1
- 0x80000000, // 000C RET 0
+ ( &(const binstruction[53]) { /* code */
+ 0x58040000, // 0000 LDCONST R1 K0
+ 0x60080010, // 0001 GETGBL R2 G16
+ 0x600C000C, // 0002 GETGBL R3 G12
+ 0x5C100000, // 0003 MOVE R4 R0
+ 0x7C0C0200, // 0004 CALL R3 1
+ 0x040C0701, // 0005 SUB R3 R3 K1
+ 0x400E0203, // 0006 CONNECT R3 K1 R3
+ 0x7C080200, // 0007 CALL R2 1
+ 0xA8020010, // 0008 EXBLK 0 #001A
+ 0x5C0C0400, // 0009 MOVE R3 R2
+ 0x7C0C0000, // 000A CALL R3 0
+ 0x94100003, // 000B GETIDX R4 R0 R3
+ 0x5C140600, // 000C MOVE R5 R3
+ 0x24180B02, // 000D GT R6 R5 K2
+ 0x781A0008, // 000E JMPF R6 #0018
+ 0x04180B01, // 000F SUB R6 R5 K1
+ 0x94180006, // 0010 GETIDX R6 R0 R6
+ 0x24180C04, // 0011 GT R6 R6 R4
+ 0x781A0004, // 0012 JMPF R6 #0018
+ 0x04180B01, // 0013 SUB R6 R5 K1
+ 0x94180006, // 0014 GETIDX R6 R0 R6
+ 0x98000A06, // 0015 SETIDX R0 R5 R6
+ 0x04140B01, // 0016 SUB R5 R5 K1
+ 0x7001FFF4, // 0017 JMP #000D
+ 0x98000A04, // 0018 SETIDX R0 R5 R4
+ 0x7001FFEE, // 0019 JMP #0009
+ 0x58080003, // 001A LDCONST R2 K3
+ 0xAC080200, // 001B CATCH R2 1 0
+ 0xB0080000, // 001C RAISE 2 R0 R0
+ 0x58080001, // 001D LDCONST R2 K1
+ 0x600C000C, // 001E GETGBL R3 G12
+ 0x5C100000, // 001F MOVE R4 R0
+ 0x7C0C0200, // 0020 CALL R3 1
+ 0x180C0701, // 0021 LE R3 R3 K1
+ 0x780E0000, // 0022 JMPF R3 #0024
+ 0x80040000, // 0023 RET 1 R0
+ 0x940C0102, // 0024 GETIDX R3 R0 K2
+ 0x6010000C, // 0025 GETGBL R4 G12
+ 0x5C140000, // 0026 MOVE R5 R0
+ 0x7C100200, // 0027 CALL R4 1
+ 0x14100404, // 0028 LT R4 R2 R4
+ 0x78120009, // 0029 JMPF R4 #0034
+ 0x94100002, // 002A GETIDX R4 R0 R2
+ 0x1C100803, // 002B EQ R4 R4 R3
+ 0x78120003, // 002C JMPF R4 #0031
+ 0x8C100104, // 002D GETMET R4 R0 K4
+ 0x5C180400, // 002E MOVE R6 R2
+ 0x7C100400, // 002F CALL R4 2
+ 0x70020001, // 0030 JMP #0033
+ 0x940C0002, // 0031 GETIDX R3 R0 R2
+ 0x00080501, // 0032 ADD R2 R2 K1
+ 0x7001FFF0, // 0033 JMP #0025
+ 0x80040000, // 0034 RET 1 R0
})
)
);
@@ -5605,11 +1535,11 @@ be_local_closure(Matter_Device_process_attribute_expansion, /* name */
/********************************************************************
-** Solidified function: find_plugin_by_friendly_name
+** Solidified function: add_read_sensors_schedule
********************************************************************/
-be_local_closure(Matter_Device_find_plugin_by_friendly_name, /* name */
+be_local_closure(Matter_Device_add_read_sensors_schedule, /* name */
be_nested_proto(
- 7, /* nstack */
+ 5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
@@ -5618,49 +1548,365 @@ be_local_closure(Matter_Device_find_plugin_by_friendly_name, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_const_int(0),
- /* K1 */ be_nested_str_weak(plugins),
- /* K2 */ be_nested_str_weak(get_name),
- /* K3 */ be_const_int(1),
+ /* K0 */ be_nested_str_weak(probe_sensor_time),
+ /* K1 */ be_nested_str_weak(probe_sensor_timestamp),
+ /* K2 */ be_nested_str_weak(matter),
+ /* K3 */ be_nested_str_weak(jitter),
}),
- be_str_weak(find_plugin_by_friendly_name),
+ be_str_weak(add_read_sensors_schedule),
&be_const_str_solidified,
- ( &(const binstruction[35]) { /* code */
- 0x4C080000, // 0000 LDNIL R2
- 0x1C080202, // 0001 EQ R2 R1 R2
- 0x740A0004, // 0002 JMPT R2 #0008
- 0x6008000C, // 0003 GETGBL R2 G12
- 0x5C0C0200, // 0004 MOVE R3 R1
- 0x7C080200, // 0005 CALL R2 1
- 0x1C080500, // 0006 EQ R2 R2 K0
- 0x780A0001, // 0007 JMPF R2 #000A
- 0x4C080000, // 0008 LDNIL R2
- 0x80040400, // 0009 RET 1 R2
- 0x58080000, // 000A LDCONST R2 K0
- 0x600C000C, // 000B GETGBL R3 G12
- 0x88100101, // 000C GETMBR R4 R0 K1
- 0x7C0C0200, // 000D CALL R3 1
- 0x140C0403, // 000E LT R3 R2 R3
- 0x780E0010, // 000F JMPF R3 #0021
- 0x880C0101, // 0010 GETMBR R3 R0 K1
- 0x940C0602, // 0011 GETIDX R3 R3 R2
- 0x8C100702, // 0012 GETMET R4 R3 K2
- 0x7C100200, // 0013 CALL R4 1
- 0x4C140000, // 0014 LDNIL R5
- 0x20140805, // 0015 NE R5 R4 R5
- 0x78160007, // 0016 JMPF R5 #001F
- 0x6014000C, // 0017 GETGBL R5 G12
- 0x5C180800, // 0018 MOVE R6 R4
- 0x7C140200, // 0019 CALL R5 1
- 0x24140B00, // 001A GT R5 R5 K0
- 0x78160002, // 001B JMPF R5 #001F
- 0x1C140801, // 001C EQ R5 R4 R1
- 0x78160000, // 001D JMPF R5 #001F
- 0x80040600, // 001E RET 1 R3
- 0x00080503, // 001F ADD R2 R2 K3
- 0x7001FFE9, // 0020 JMP #000B
- 0x4C0C0000, // 0021 LDNIL R3
- 0x80040600, // 0022 RET 1 R3
+ ( &(const binstruction[14]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x4C0C0000, // 0001 LDNIL R3
+ 0x1C080403, // 0002 EQ R2 R2 R3
+ 0x740A0002, // 0003 JMPT R2 #0007
+ 0x88080100, // 0004 GETMBR R2 R0 K0
+ 0x24080401, // 0005 GT R2 R2 R1
+ 0x780A0005, // 0006 JMPF R2 #000D
+ 0x90020001, // 0007 SETMBR R0 K0 R1
+ 0xB80A0400, // 0008 GETNGBL R2 K2
+ 0x8C080503, // 0009 GETMET R2 R2 K3
+ 0x5C100200, // 000A MOVE R4 R1
+ 0x7C080400, // 000B CALL R2 2
+ 0x90020202, // 000C SETMBR R0 K1 R2
+ 0x80000000, // 000D RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: attribute_updated
+********************************************************************/
+be_local_closure(Matter_Device_attribute_updated, /* name */
+ be_nested_proto(
+ 10, /* nstack */
+ 5, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 9]) { /* constants */
+ /* K0 */ be_nested_str_weak(matter),
+ /* K1 */ be_nested_str_weak(Path),
+ /* K2 */ be_nested_str_weak(endpoint),
+ /* K3 */ be_nested_str_weak(cluster),
+ /* K4 */ be_nested_str_weak(attribute),
+ /* K5 */ be_nested_str_weak(message_handler),
+ /* K6 */ be_nested_str_weak(im),
+ /* K7 */ be_nested_str_weak(subs_shop),
+ /* K8 */ be_nested_str_weak(attribute_updated_ctx),
+ }),
+ be_str_weak(attribute_updated),
+ &be_const_str_solidified,
+ ( &(const binstruction[18]) { /* code */
+ 0x4C140000, // 0000 LDNIL R5
+ 0x1C140805, // 0001 EQ R5 R4 R5
+ 0x78160000, // 0002 JMPF R5 #0004
+ 0x50100000, // 0003 LDBOOL R4 0 0
+ 0xB8160000, // 0004 GETNGBL R5 K0
+ 0x8C140B01, // 0005 GETMET R5 R5 K1
+ 0x7C140200, // 0006 CALL R5 1
+ 0x90160401, // 0007 SETMBR R5 K2 R1
+ 0x90160602, // 0008 SETMBR R5 K3 R2
+ 0x90160803, // 0009 SETMBR R5 K4 R3
+ 0x88180105, // 000A GETMBR R6 R0 K5
+ 0x88180D06, // 000B GETMBR R6 R6 K6
+ 0x88180D07, // 000C GETMBR R6 R6 K7
+ 0x8C180D08, // 000D GETMET R6 R6 K8
+ 0x5C200A00, // 000E MOVE R8 R5
+ 0x5C240800, // 000F MOVE R9 R4
+ 0x7C180600, // 0010 CALL R6 3
+ 0x80000000, // 0011 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: _trigger_read_sensors
+********************************************************************/
+be_local_closure(Matter_Device__trigger_read_sensors, /* name */
+ be_nested_proto(
+ 8, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[13]) { /* constants */
+ /* K0 */ be_nested_str_weak(json),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(read_sensors),
+ /* K3 */ be_nested_str_weak(loglevel),
+ /* K4 */ be_const_int(3),
+ /* K5 */ be_nested_str_weak(log),
+ /* K6 */ be_nested_str_weak(MTR_X3A_X20read_sensors_X3A_X20),
+ /* K7 */ be_nested_str_weak(load),
+ /* K8 */ be_const_int(0),
+ /* K9 */ be_nested_str_weak(plugins),
+ /* K10 */ be_nested_str_weak(parse_sensors),
+ /* K11 */ be_const_int(1),
+ /* K12 */ be_nested_str_weak(MTR_X3A_X20unable_X20to_X20parse_X20read_sensors_X3A_X20),
+ }),
+ be_str_weak(_trigger_read_sensors),
+ &be_const_str_solidified,
+ ( &(const binstruction[50]) { /* code */
+ 0xA4060000, // 0000 IMPORT R1 K0
+ 0xB80A0200, // 0001 GETNGBL R2 K1
+ 0x8C080502, // 0002 GETMET R2 R2 K2
+ 0x7C080200, // 0003 CALL R2 1
+ 0xB80E0200, // 0004 GETNGBL R3 K1
+ 0x8C0C0703, // 0005 GETMET R3 R3 K3
+ 0x58140004, // 0006 LDCONST R5 K4
+ 0x7C0C0400, // 0007 CALL R3 2
+ 0x780E0007, // 0008 JMPF R3 #0011
+ 0xB80E0200, // 0009 GETNGBL R3 K1
+ 0x8C0C0705, // 000A GETMET R3 R3 K5
+ 0x60140008, // 000B GETGBL R5 G8
+ 0x5C180400, // 000C MOVE R6 R2
+ 0x7C140200, // 000D CALL R5 1
+ 0x00160C05, // 000E ADD R5 K6 R5
+ 0x58180004, // 000F LDCONST R6 K4
+ 0x7C0C0600, // 0010 CALL R3 3
+ 0x4C0C0000, // 0011 LDNIL R3
+ 0x1C0C0403, // 0012 EQ R3 R2 R3
+ 0x780E0000, // 0013 JMPF R3 #0015
+ 0x80000600, // 0014 RET 0
+ 0x8C0C0307, // 0015 GETMET R3 R1 K7
+ 0x5C140400, // 0016 MOVE R5 R2
+ 0x7C0C0400, // 0017 CALL R3 2
+ 0x4C100000, // 0018 LDNIL R4
+ 0x20100604, // 0019 NE R4 R3 R4
+ 0x7812000D, // 001A JMPF R4 #0029
+ 0x58100008, // 001B LDCONST R4 K8
+ 0x6014000C, // 001C GETGBL R5 G12
+ 0x88180109, // 001D GETMBR R6 R0 K9
+ 0x7C140200, // 001E CALL R5 1
+ 0x14140805, // 001F LT R5 R4 R5
+ 0x78160006, // 0020 JMPF R5 #0028
+ 0x88140109, // 0021 GETMBR R5 R0 K9
+ 0x94140A04, // 0022 GETIDX R5 R5 R4
+ 0x8C140B0A, // 0023 GETMET R5 R5 K10
+ 0x5C1C0600, // 0024 MOVE R7 R3
+ 0x7C140400, // 0025 CALL R5 2
+ 0x0010090B, // 0026 ADD R4 R4 K11
+ 0x7001FFF3, // 0027 JMP #001C
+ 0x70020007, // 0028 JMP #0031
+ 0xB8120200, // 0029 GETNGBL R4 K1
+ 0x8C100905, // 002A GETMET R4 R4 K5
+ 0x60180008, // 002B GETGBL R6 G8
+ 0x5C1C0400, // 002C MOVE R7 R2
+ 0x7C180200, // 002D CALL R6 1
+ 0x001A1806, // 002E ADD R6 K12 R6
+ 0x581C0004, // 002F LDCONST R7 K4
+ 0x7C100600, // 0030 CALL R4 3
+ 0x80000000, // 0031 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: start_commissioning_complete
+********************************************************************/
+be_local_closure(Matter_Device_start_commissioning_complete, /* name */
+ be_nested_proto(
+ 11, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[11]) { /* constants */
+ /* K0 */ be_nested_str_weak(get_fabric),
+ /* K1 */ be_nested_str_weak(get_fabric_id),
+ /* K2 */ be_nested_str_weak(copy),
+ /* K3 */ be_nested_str_weak(reverse),
+ /* K4 */ be_nested_str_weak(tohex),
+ /* K5 */ be_nested_str_weak(get_admin_vendor_name),
+ /* K6 */ be_nested_str_weak(tasmota),
+ /* K7 */ be_nested_str_weak(log),
+ /* K8 */ be_nested_str_weak(MTR_X3A_X20_X2D_X2D_X2D_X20Commissioning_X20complete_X20for_X20Fabric_X20_X27_X25s_X27_X20_X28Vendor_X20_X25s_X29_X20_X2D_X2D_X2D),
+ /* K9 */ be_const_int(2),
+ /* K10 */ be_nested_str_weak(stop_basic_commissioning),
+ }),
+ be_str_weak(start_commissioning_complete),
+ &be_const_str_solidified,
+ ( &(const binstruction[24]) { /* code */
+ 0x8C080300, // 0000 GETMET R2 R1 K0
+ 0x7C080200, // 0001 CALL R2 1
+ 0x8C0C0501, // 0002 GETMET R3 R2 K1
+ 0x7C0C0200, // 0003 CALL R3 1
+ 0x8C0C0702, // 0004 GETMET R3 R3 K2
+ 0x7C0C0200, // 0005 CALL R3 1
+ 0x8C0C0703, // 0006 GETMET R3 R3 K3
+ 0x7C0C0200, // 0007 CALL R3 1
+ 0x8C0C0704, // 0008 GETMET R3 R3 K4
+ 0x7C0C0200, // 0009 CALL R3 1
+ 0x8C100505, // 000A GETMET R4 R2 K5
+ 0x7C100200, // 000B CALL R4 1
+ 0xB8160C00, // 000C GETNGBL R5 K6
+ 0x8C140B07, // 000D GETMET R5 R5 K7
+ 0x601C0018, // 000E GETGBL R7 G24
+ 0x58200008, // 000F LDCONST R8 K8
+ 0x5C240600, // 0010 MOVE R9 R3
+ 0x5C280800, // 0011 MOVE R10 R4
+ 0x7C1C0600, // 0012 CALL R7 3
+ 0x58200009, // 0013 LDCONST R8 K9
+ 0x7C140600, // 0014 CALL R5 3
+ 0x8C14010A, // 0015 GETMET R5 R0 K10
+ 0x7C140200, // 0016 CALL R5 1
+ 0x80000000, // 0017 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: process_attribute_read_solo
+********************************************************************/
+be_local_closure(Matter_Device_process_attribute_read_solo, /* name */
+ be_nested_proto(
+ 10, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[11]) { /* constants */
+ /* K0 */ be_nested_str_weak(endpoint),
+ /* K1 */ be_nested_str_weak(cluster),
+ /* K2 */ be_nested_str_weak(attribute),
+ /* K3 */ be_nested_str_weak(find_plugin_by_endpoint),
+ /* K4 */ be_nested_str_weak(status),
+ /* K5 */ be_nested_str_weak(matter),
+ /* K6 */ be_nested_str_weak(UNSUPPORTED_ENDPOINT),
+ /* K7 */ be_nested_str_weak(contains_cluster),
+ /* K8 */ be_nested_str_weak(UNSUPPORTED_CLUSTER),
+ /* K9 */ be_nested_str_weak(contains_attribute),
+ /* K10 */ be_nested_str_weak(UNSUPPORTED_ATTRIBUTE),
+ }),
+ be_str_weak(process_attribute_read_solo),
+ &be_const_str_solidified,
+ ( &(const binstruction[45]) { /* code */
+ 0x88080300, // 0000 GETMBR R2 R1 K0
+ 0x880C0301, // 0001 GETMBR R3 R1 K1
+ 0x88100302, // 0002 GETMBR R4 R1 K2
+ 0x4C140000, // 0003 LDNIL R5
+ 0x1C140405, // 0004 EQ R5 R2 R5
+ 0x74160005, // 0005 JMPT R5 #000C
+ 0x4C140000, // 0006 LDNIL R5
+ 0x1C140605, // 0007 EQ R5 R3 R5
+ 0x74160002, // 0008 JMPT R5 #000C
+ 0x4C140000, // 0009 LDNIL R5
+ 0x1C140805, // 000A EQ R5 R4 R5
+ 0x78160001, // 000B JMPF R5 #000E
+ 0x4C140000, // 000C LDNIL R5
+ 0x80040A00, // 000D RET 1 R5
+ 0x8C140103, // 000E GETMET R5 R0 K3
+ 0x5C1C0400, // 000F MOVE R7 R2
+ 0x7C140400, // 0010 CALL R5 2
+ 0x4C180000, // 0011 LDNIL R6
+ 0x1C180A06, // 0012 EQ R6 R5 R6
+ 0x781A0004, // 0013 JMPF R6 #0019
+ 0xB81A0A00, // 0014 GETNGBL R6 K5
+ 0x88180D06, // 0015 GETMBR R6 R6 K6
+ 0x90060806, // 0016 SETMBR R1 K4 R6
+ 0x4C180000, // 0017 LDNIL R6
+ 0x80040C00, // 0018 RET 1 R6
+ 0x8C180B07, // 0019 GETMET R6 R5 K7
+ 0x5C200600, // 001A MOVE R8 R3
+ 0x7C180400, // 001B CALL R6 2
+ 0x741A0004, // 001C JMPT R6 #0022
+ 0xB81A0A00, // 001D GETNGBL R6 K5
+ 0x88180D08, // 001E GETMBR R6 R6 K8
+ 0x90060806, // 001F SETMBR R1 K4 R6
+ 0x4C180000, // 0020 LDNIL R6
+ 0x80040C00, // 0021 RET 1 R6
+ 0x8C180B09, // 0022 GETMET R6 R5 K9
+ 0x5C200600, // 0023 MOVE R8 R3
+ 0x5C240800, // 0024 MOVE R9 R4
+ 0x7C180600, // 0025 CALL R6 3
+ 0x741A0004, // 0026 JMPT R6 #002C
+ 0xB81A0A00, // 0027 GETNGBL R6 K5
+ 0x88180D0A, // 0028 GETMBR R6 R6 K10
+ 0x90060806, // 0029 SETMBR R1 K4 R6
+ 0x4C180000, // 002A LDNIL R6
+ 0x80040C00, // 002B RET 1 R6
+ 0x80040A00, // 002C RET 1 R5
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: start_commissioning_complete_deferred
+********************************************************************/
+be_local_closure(Matter_Device_start_commissioning_complete_deferred, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 1, /* has sup protos */
+ ( &(const struct bproto*[ 1]) {
+ be_nested_proto(
+ 3, /* nstack */
+ 0, /* argc */
+ 0, /* varg */
+ 1, /* has upvals */
+ ( &(const bupvaldesc[ 2]) { /* upvals */
+ be_local_const_upval(1, 0),
+ be_local_const_upval(1, 1),
+ }),
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(start_commissioning_complete),
+ }),
+ be_str_weak(_X3Clambda_X3E),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 5]) { /* code */
+ 0x68000000, // 0000 GETUPV R0 U0
+ 0x8C000100, // 0001 GETMET R0 R0 K0
+ 0x68080001, // 0002 GETUPV R2 U1
+ 0x7C000400, // 0003 CALL R0 2
+ 0x80040000, // 0004 RET 1 R0
+ })
+ ),
+ }),
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(tasmota),
+ /* K1 */ be_nested_str_weak(set_timer),
+ /* K2 */ be_const_int(0),
+ }),
+ be_str_weak(start_commissioning_complete_deferred),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 7]) { /* code */
+ 0xB80A0000, // 0000 GETNGBL R2 K0
+ 0x8C080501, // 0001 GETMET R2 R2 K1
+ 0x58100002, // 0002 LDCONST R4 K2
+ 0x84140000, // 0003 CLOSURE R5 P0
+ 0x7C080600, // 0004 CALL R2 3
+ 0xA0000000, // 0005 CLOSE R0
+ 0x80000000, // 0006 RET 0
})
)
);
@@ -5803,6 +2049,3492 @@ be_local_closure(Matter_Device_save_param, /* name */
/*******************************************************************/
+/********************************************************************
+** Solidified function: mdns_announce_op_discovery_all_fabrics
+********************************************************************/
+be_local_closure(Matter_Device_mdns_announce_op_discovery_all_fabrics, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 6]) { /* constants */
+ /* K0 */ be_nested_str_weak(sessions),
+ /* K1 */ be_nested_str_weak(active_fabrics),
+ /* K2 */ be_nested_str_weak(get_device_id),
+ /* K3 */ be_nested_str_weak(get_fabric_id),
+ /* K4 */ be_nested_str_weak(mdns_announce_op_discovery),
+ /* K5 */ be_nested_str_weak(stop_iteration),
+ }),
+ be_str_weak(mdns_announce_op_discovery_all_fabrics),
+ &be_const_str_solidified,
+ ( &(const binstruction[22]) { /* code */
+ 0x60040010, // 0000 GETGBL R1 G16
+ 0x88080100, // 0001 GETMBR R2 R0 K0
+ 0x8C080501, // 0002 GETMET R2 R2 K1
+ 0x7C080200, // 0003 CALL R2 1
+ 0x7C040200, // 0004 CALL R1 1
+ 0xA802000B, // 0005 EXBLK 0 #0012
+ 0x5C080200, // 0006 MOVE R2 R1
+ 0x7C080000, // 0007 CALL R2 0
+ 0x8C0C0502, // 0008 GETMET R3 R2 K2
+ 0x7C0C0200, // 0009 CALL R3 1
+ 0x780E0005, // 000A JMPF R3 #0011
+ 0x8C0C0503, // 000B GETMET R3 R2 K3
+ 0x7C0C0200, // 000C CALL R3 1
+ 0x780E0002, // 000D JMPF R3 #0011
+ 0x8C0C0104, // 000E GETMET R3 R0 K4
+ 0x5C140400, // 000F MOVE R5 R2
+ 0x7C0C0400, // 0010 CALL R3 2
+ 0x7001FFF3, // 0011 JMP #0006
+ 0x58040005, // 0012 LDCONST R1 K5
+ 0xAC040200, // 0013 CATCH R1 1 0
+ 0xB0080000, // 0014 RAISE 2 R0 R0
+ 0x80000000, // 0015 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: adjust_next_ep
+********************************************************************/
+be_local_closure(Matter_Device_adjust_next_ep, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 5]) { /* constants */
+ /* K0 */ be_nested_str_weak(plugins_config),
+ /* K1 */ be_nested_str_weak(keys),
+ /* K2 */ be_nested_str_weak(next_ep),
+ /* K3 */ be_const_int(1),
+ /* K4 */ be_nested_str_weak(stop_iteration),
+ }),
+ be_str_weak(adjust_next_ep),
+ &be_const_str_solidified,
+ ( &(const binstruction[21]) { /* code */
+ 0x60040010, // 0000 GETGBL R1 G16
+ 0x88080100, // 0001 GETMBR R2 R0 K0
+ 0x8C080501, // 0002 GETMET R2 R2 K1
+ 0x7C080200, // 0003 CALL R2 1
+ 0x7C040200, // 0004 CALL R1 1
+ 0xA802000A, // 0005 EXBLK 0 #0011
+ 0x5C080200, // 0006 MOVE R2 R1
+ 0x7C080000, // 0007 CALL R2 0
+ 0x600C0009, // 0008 GETGBL R3 G9
+ 0x5C100400, // 0009 MOVE R4 R2
+ 0x7C0C0200, // 000A CALL R3 1
+ 0x88100102, // 000B GETMBR R4 R0 K2
+ 0x28100604, // 000C GE R4 R3 R4
+ 0x78120001, // 000D JMPF R4 #0010
+ 0x00100703, // 000E ADD R4 R3 K3
+ 0x90020404, // 000F SETMBR R0 K2 R4
+ 0x7001FFF4, // 0010 JMP #0006
+ 0x58040004, // 0011 LDCONST R1 K4
+ 0xAC040200, // 0012 CATCH R1 1 0
+ 0xB0080000, // 0013 RAISE 2 R0 R0
+ 0x80000000, // 0014 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: init
+********************************************************************/
+be_local_closure(Matter_Device_init, /* name */
+ be_nested_proto(
+ 7, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 1, /* has sup protos */
+ ( &(const struct bproto*[ 2]) {
+ be_nested_proto(
+ 4, /* nstack */
+ 0, /* argc */
+ 0, /* varg */
+ 1, /* has upvals */
+ ( &(const bupvaldesc[ 1]) { /* upvals */
+ be_local_const_upval(1, 0),
+ }),
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 5]) { /* constants */
+ /* K0 */ be_nested_str_weak(start),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(remove_rule),
+ /* K3 */ be_nested_str_weak(Wifi_X23Connected),
+ /* K4 */ be_nested_str_weak(matter_start),
+ }),
+ be_str_weak(_anonymous_),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 9]) { /* code */
+ 0x68000000, // 0000 GETUPV R0 U0
+ 0x8C000100, // 0001 GETMET R0 R0 K0
+ 0x7C000200, // 0002 CALL R0 1
+ 0xB8020200, // 0003 GETNGBL R0 K1
+ 0x8C000102, // 0004 GETMET R0 R0 K2
+ 0x58080003, // 0005 LDCONST R2 K3
+ 0x580C0004, // 0006 LDCONST R3 K4
+ 0x7C000600, // 0007 CALL R0 3
+ 0x80000000, // 0008 RET 0
+ })
+ ),
+ be_nested_proto(
+ 4, /* nstack */
+ 0, /* argc */
+ 0, /* varg */
+ 1, /* has upvals */
+ ( &(const bupvaldesc[ 1]) { /* upvals */
+ be_local_const_upval(1, 0),
+ }),
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 5]) { /* constants */
+ /* K0 */ be_nested_str_weak(start),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(remove_rule),
+ /* K3 */ be_nested_str_weak(Eth_X23Connected),
+ /* K4 */ be_nested_str_weak(matter_start),
+ }),
+ be_str_weak(_anonymous_),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 9]) { /* code */
+ 0x68000000, // 0000 GETUPV R0 U0
+ 0x8C000100, // 0001 GETMET R0 R0 K0
+ 0x7C000200, // 0002 CALL R0 1
+ 0xB8020200, // 0003 GETNGBL R0 K1
+ 0x8C000102, // 0004 GETMET R0 R0 K2
+ 0x58080003, // 0005 LDCONST R2 K3
+ 0x580C0004, // 0006 LDCONST R3 K4
+ 0x7C000600, // 0007 CALL R0 3
+ 0x80000000, // 0008 RET 0
+ })
+ ),
+ }),
+ 1, /* has constants */
+ ( &(const bvalue[44]) { /* constants */
+ /* K0 */ be_nested_str_weak(crypto),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(get_option),
+ /* K3 */ be_nested_str_weak(matter),
+ /* K4 */ be_nested_str_weak(MATTER_OPTION),
+ /* K5 */ be_nested_str_weak(UI),
+ /* K6 */ be_nested_str_weak(profiler),
+ /* K7 */ be_nested_str_weak(Profiler),
+ /* K8 */ be_nested_str_weak(started),
+ /* K9 */ be_nested_str_weak(tick),
+ /* K10 */ be_const_int(0),
+ /* K11 */ be_nested_str_weak(plugins),
+ /* K12 */ be_nested_str_weak(plugins_persist),
+ /* K13 */ be_nested_str_weak(plugins_config_remotes),
+ /* K14 */ be_nested_str_weak(vendorid),
+ /* K15 */ be_nested_str_weak(VENDOR_ID),
+ /* K16 */ be_nested_str_weak(productid),
+ /* K17 */ be_nested_str_weak(PRODUCT_ID),
+ /* K18 */ be_nested_str_weak(root_iterations),
+ /* K19 */ be_nested_str_weak(PBKDF_ITERATIONS),
+ /* K20 */ be_nested_str_weak(next_ep),
+ /* K21 */ be_const_int(1),
+ /* K22 */ be_nested_str_weak(root_salt),
+ /* K23 */ be_nested_str_weak(random),
+ /* K24 */ be_nested_str_weak(ipv4only),
+ /* K25 */ be_nested_str_weak(disable_bridge_mode),
+ /* K26 */ be_nested_str_weak(load_param),
+ /* K27 */ be_nested_str_weak(sessions),
+ /* K28 */ be_nested_str_weak(Session_Store),
+ /* K29 */ be_nested_str_weak(load_fabrics),
+ /* K30 */ be_nested_str_weak(message_handler),
+ /* K31 */ be_nested_str_weak(MessageHandler),
+ /* K32 */ be_nested_str_weak(ui),
+ /* K33 */ be_nested_str_weak(wifi),
+ /* K34 */ be_nested_str_weak(up),
+ /* K35 */ be_nested_str_weak(eth),
+ /* K36 */ be_nested_str_weak(start),
+ /* K37 */ be_nested_str_weak(add_rule),
+ /* K38 */ be_nested_str_weak(Wifi_X23Connected),
+ /* K39 */ be_nested_str_weak(matter_start),
+ /* K40 */ be_nested_str_weak(Eth_X23Connected),
+ /* K41 */ be_nested_str_weak(_init_basic_commissioning),
+ /* K42 */ be_nested_str_weak(add_driver),
+ /* K43 */ be_nested_str_weak(register_commands),
+ }),
+ be_str_weak(init),
+ &be_const_str_solidified,
+ ( &(const binstruction[107]) { /* code */
+ 0xA4060000, // 0000 IMPORT R1 K0
+ 0xB80A0200, // 0001 GETNGBL R2 K1
+ 0x8C080502, // 0002 GETMET R2 R2 K2
+ 0xB8120600, // 0003 GETNGBL R4 K3
+ 0x88100904, // 0004 GETMBR R4 R4 K4
+ 0x7C080400, // 0005 CALL R2 2
+ 0x740A0004, // 0006 JMPT R2 #000C
+ 0xB80A0600, // 0007 GETNGBL R2 K3
+ 0x8C080505, // 0008 GETMET R2 R2 K5
+ 0x5C100000, // 0009 MOVE R4 R0
+ 0x7C080400, // 000A CALL R2 2
+ 0x80000400, // 000B RET 0
+ 0xB80A0600, // 000C GETNGBL R2 K3
+ 0xB80E0600, // 000D GETNGBL R3 K3
+ 0x8C0C0707, // 000E GETMET R3 R3 K7
+ 0x7C0C0200, // 000F CALL R3 1
+ 0x900A0C03, // 0010 SETMBR R2 K6 R3
+ 0x50080000, // 0011 LDBOOL R2 0 0
+ 0x90021002, // 0012 SETMBR R0 K8 R2
+ 0x9002130A, // 0013 SETMBR R0 K9 K10
+ 0x60080012, // 0014 GETGBL R2 G18
+ 0x7C080000, // 0015 CALL R2 0
+ 0x90021602, // 0016 SETMBR R0 K11 R2
+ 0x50080000, // 0017 LDBOOL R2 0 0
+ 0x90021802, // 0018 SETMBR R0 K12 R2
+ 0x60080013, // 0019 GETGBL R2 G19
+ 0x7C080000, // 001A CALL R2 0
+ 0x90021A02, // 001B SETMBR R0 K13 R2
+ 0x8808010F, // 001C GETMBR R2 R0 K15
+ 0x90021C02, // 001D SETMBR R0 K14 R2
+ 0x88080111, // 001E GETMBR R2 R0 K17
+ 0x90022002, // 001F SETMBR R0 K16 R2
+ 0x88080113, // 0020 GETMBR R2 R0 K19
+ 0x90022402, // 0021 SETMBR R0 K18 R2
+ 0x90022915, // 0022 SETMBR R0 K20 K21
+ 0x8C080317, // 0023 GETMET R2 R1 K23
+ 0x5412000F, // 0024 LDINT R4 16
+ 0x7C080400, // 0025 CALL R2 2
+ 0x90022C02, // 0026 SETMBR R0 K22 R2
+ 0x50080000, // 0027 LDBOOL R2 0 0
+ 0x90023002, // 0028 SETMBR R0 K24 R2
+ 0x50080000, // 0029 LDBOOL R2 0 0
+ 0x90023202, // 002A SETMBR R0 K25 R2
+ 0x8C08011A, // 002B GETMET R2 R0 K26
+ 0x7C080200, // 002C CALL R2 1
+ 0xB80A0600, // 002D GETNGBL R2 K3
+ 0x8C08051C, // 002E GETMET R2 R2 K28
+ 0x5C100000, // 002F MOVE R4 R0
+ 0x7C080400, // 0030 CALL R2 2
+ 0x90023602, // 0031 SETMBR R0 K27 R2
+ 0x8808011B, // 0032 GETMBR R2 R0 K27
+ 0x8C08051D, // 0033 GETMET R2 R2 K29
+ 0x7C080200, // 0034 CALL R2 1
+ 0xB80A0600, // 0035 GETNGBL R2 K3
+ 0x8C08051F, // 0036 GETMET R2 R2 K31
+ 0x5C100000, // 0037 MOVE R4 R0
+ 0x7C080400, // 0038 CALL R2 2
+ 0x90023C02, // 0039 SETMBR R0 K30 R2
+ 0xB80A0600, // 003A GETNGBL R2 K3
+ 0x8C080505, // 003B GETMET R2 R2 K5
+ 0x5C100000, // 003C MOVE R4 R0
+ 0x7C080400, // 003D CALL R2 2
+ 0x90024002, // 003E SETMBR R0 K32 R2
+ 0xB80A0200, // 003F GETNGBL R2 K1
+ 0x8C080521, // 0040 GETMET R2 R2 K33
+ 0x7C080200, // 0041 CALL R2 1
+ 0x94080522, // 0042 GETIDX R2 R2 K34
+ 0x740A0004, // 0043 JMPT R2 #0049
+ 0xB80A0200, // 0044 GETNGBL R2 K1
+ 0x8C080523, // 0045 GETMET R2 R2 K35
+ 0x7C080200, // 0046 CALL R2 1
+ 0x94080522, // 0047 GETIDX R2 R2 K34
+ 0x780A0001, // 0048 JMPF R2 #004B
+ 0x8C080124, // 0049 GETMET R2 R0 K36
+ 0x7C080200, // 004A CALL R2 1
+ 0xB80A0200, // 004B GETNGBL R2 K1
+ 0x8C080521, // 004C GETMET R2 R2 K33
+ 0x7C080200, // 004D CALL R2 1
+ 0x94080522, // 004E GETIDX R2 R2 K34
+ 0x740A0005, // 004F JMPT R2 #0056
+ 0xB80A0200, // 0050 GETNGBL R2 K1
+ 0x8C080525, // 0051 GETMET R2 R2 K37
+ 0x58100026, // 0052 LDCONST R4 K38
+ 0x84140000, // 0053 CLOSURE R5 P0
+ 0x58180027, // 0054 LDCONST R6 K39
+ 0x7C080800, // 0055 CALL R2 4
+ 0xB80A0200, // 0056 GETNGBL R2 K1
+ 0x8C080523, // 0057 GETMET R2 R2 K35
+ 0x7C080200, // 0058 CALL R2 1
+ 0x94080522, // 0059 GETIDX R2 R2 K34
+ 0x740A0005, // 005A JMPT R2 #0061
+ 0xB80A0200, // 005B GETNGBL R2 K1
+ 0x8C080525, // 005C GETMET R2 R2 K37
+ 0x58100028, // 005D LDCONST R4 K40
+ 0x84140001, // 005E CLOSURE R5 P1
+ 0x58180027, // 005F LDCONST R6 K39
+ 0x7C080800, // 0060 CALL R2 4
+ 0x8C080129, // 0061 GETMET R2 R0 K41
+ 0x7C080200, // 0062 CALL R2 1
+ 0xB80A0200, // 0063 GETNGBL R2 K1
+ 0x8C08052A, // 0064 GETMET R2 R2 K42
+ 0x5C100000, // 0065 MOVE R4 R0
+ 0x7C080400, // 0066 CALL R2 2
+ 0x8C08012B, // 0067 GETMET R2 R0 K43
+ 0x7C080200, // 0068 CALL R2 1
+ 0xA0000000, // 0069 CLOSE R0
+ 0x80000000, // 006A RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: _instantiate_plugins_from_config
+********************************************************************/
+be_local_closure(Matter_Device__instantiate_plugins_from_config, /* name */
+ be_nested_proto(
+ 18, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[30]) { /* constants */
+ /* K0 */ be_nested_str_weak(k2l_num),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(log),
+ /* K3 */ be_nested_str_weak(MTR_X3A_X20Configuring_X20endpoints),
+ /* K4 */ be_const_int(2),
+ /* K5 */ be_nested_str_weak(plugins),
+ /* K6 */ be_nested_str_weak(push),
+ /* K7 */ be_nested_str_weak(matter),
+ /* K8 */ be_nested_str_weak(Plugin_Root),
+ /* K9 */ be_const_int(0),
+ /* K10 */ be_nested_str_weak(MTR_X3A_X20_X20_X20endpoint_X20_X3D_X20_X255i_X20type_X3A_X25s_X25s),
+ /* K11 */ be_nested_str_weak(root),
+ /* K12 */ be_nested_str_weak(),
+ /* K13 */ be_nested_str_weak(Plugin_Aggregator),
+ /* K14 */ be_nested_str_weak(find),
+ /* K15 */ be_nested_str_weak(type),
+ /* K16 */ be_nested_str_weak(MTR_X3A_X20no_X20class_X20name_X2C_X20skipping),
+ /* K17 */ be_const_int(3),
+ /* K18 */ be_nested_str_weak(MTR_X3A_X20only_X20one_X20root_X20node_X20allowed),
+ /* K19 */ be_nested_str_weak(plugins_classes),
+ /* K20 */ be_nested_str_weak(MTR_X3A_X20unknown_X20class_X20name_X20_X27),
+ /* K21 */ be_nested_str_weak(_X27_X20skipping),
+ /* K22 */ be_nested_str_weak(conf_to_log),
+ /* K23 */ be_nested_str_weak(MTR_X3A_X20Exception),
+ /* K24 */ be_nested_str_weak(_X7C),
+ /* K25 */ be_nested_str_weak(stop_iteration),
+ /* K26 */ be_nested_str_weak(aggregator),
+ /* K27 */ be_nested_str_weak(publish_result),
+ /* K28 */ be_nested_str_weak(_X7B_X22Matter_X22_X3A_X7B_X22Initialized_X22_X3A1_X7D_X7D),
+ /* K29 */ be_nested_str_weak(Matter),
+ }),
+ be_str_weak(_instantiate_plugins_from_config),
+ &be_const_str_solidified,
+ ( &(const binstruction[152]) { /* code */
+ 0x8C080100, // 0000 GETMET R2 R0 K0
+ 0x5C100200, // 0001 MOVE R4 R1
+ 0x7C080400, // 0002 CALL R2 2
+ 0xB80E0200, // 0003 GETNGBL R3 K1
+ 0x8C0C0702, // 0004 GETMET R3 R3 K2
+ 0x58140003, // 0005 LDCONST R5 K3
+ 0x58180004, // 0006 LDCONST R6 K4
+ 0x7C0C0600, // 0007 CALL R3 3
+ 0x880C0105, // 0008 GETMBR R3 R0 K5
+ 0x8C0C0706, // 0009 GETMET R3 R3 K6
+ 0xB8160E00, // 000A GETNGBL R5 K7
+ 0x8C140B08, // 000B GETMET R5 R5 K8
+ 0x5C1C0000, // 000C MOVE R7 R0
+ 0x58200009, // 000D LDCONST R8 K9
+ 0x60240013, // 000E GETGBL R9 G19
+ 0x7C240000, // 000F CALL R9 0
+ 0x7C140800, // 0010 CALL R5 4
+ 0x7C0C0400, // 0011 CALL R3 2
+ 0xB80E0200, // 0012 GETNGBL R3 K1
+ 0x8C0C0702, // 0013 GETMET R3 R3 K2
+ 0x60140018, // 0014 GETGBL R5 G24
+ 0x5818000A, // 0015 LDCONST R6 K10
+ 0x581C0009, // 0016 LDCONST R7 K9
+ 0x5820000B, // 0017 LDCONST R8 K11
+ 0x5824000C, // 0018 LDCONST R9 K12
+ 0x7C140800, // 0019 CALL R5 4
+ 0x58180004, // 001A LDCONST R6 K4
+ 0x7C0C0600, // 001B CALL R3 3
+ 0x880C0105, // 001C GETMBR R3 R0 K5
+ 0x8C0C0706, // 001D GETMET R3 R3 K6
+ 0xB8160E00, // 001E GETNGBL R5 K7
+ 0x8C140B0D, // 001F GETMET R5 R5 K13
+ 0x5C1C0000, // 0020 MOVE R7 R0
+ 0x5422FEFF, // 0021 LDINT R8 65280
+ 0x60240013, // 0022 GETGBL R9 G19
+ 0x7C240000, // 0023 CALL R9 0
+ 0x7C140800, // 0024 CALL R5 4
+ 0x7C0C0400, // 0025 CALL R3 2
+ 0x600C0010, // 0026 GETGBL R3 G16
+ 0x5C100400, // 0027 MOVE R4 R2
+ 0x7C0C0200, // 0028 CALL R3 1
+ 0xA802005A, // 0029 EXBLK 0 #0085
+ 0x5C100600, // 002A MOVE R4 R3
+ 0x7C100000, // 002B CALL R4 0
+ 0x1C140909, // 002C EQ R5 R4 K9
+ 0x78160000, // 002D JMPF R5 #002F
+ 0x7001FFFA, // 002E JMP #002A
+ 0xA8020042, // 002F EXBLK 0 #0073
+ 0x60140008, // 0030 GETGBL R5 G8
+ 0x5C180800, // 0031 MOVE R6 R4
+ 0x7C140200, // 0032 CALL R5 1
+ 0x94140205, // 0033 GETIDX R5 R1 R5
+ 0x8C180B0E, // 0034 GETMET R6 R5 K14
+ 0x5820000F, // 0035 LDCONST R8 K15
+ 0x7C180400, // 0036 CALL R6 2
+ 0x4C1C0000, // 0037 LDNIL R7
+ 0x1C1C0C07, // 0038 EQ R7 R6 R7
+ 0x781E0006, // 0039 JMPF R7 #0041
+ 0xB81E0200, // 003A GETNGBL R7 K1
+ 0x8C1C0F02, // 003B GETMET R7 R7 K2
+ 0x58240010, // 003C LDCONST R9 K16
+ 0x58280011, // 003D LDCONST R10 K17
+ 0x7C1C0600, // 003E CALL R7 3
+ 0xA8040001, // 003F EXBLK 1 1
+ 0x7001FFE8, // 0040 JMP #002A
+ 0x1C1C0D0B, // 0041 EQ R7 R6 K11
+ 0x781E0006, // 0042 JMPF R7 #004A
+ 0xB81E0200, // 0043 GETNGBL R7 K1
+ 0x8C1C0F02, // 0044 GETMET R7 R7 K2
+ 0x58240012, // 0045 LDCONST R9 K18
+ 0x58280011, // 0046 LDCONST R10 K17
+ 0x7C1C0600, // 0047 CALL R7 3
+ 0xA8040001, // 0048 EXBLK 1 1
+ 0x7001FFDF, // 0049 JMP #002A
+ 0x881C0113, // 004A GETMBR R7 R0 K19
+ 0x8C1C0F0E, // 004B GETMET R7 R7 K14
+ 0x5C240C00, // 004C MOVE R9 R6
+ 0x7C1C0400, // 004D CALL R7 2
+ 0x4C200000, // 004E LDNIL R8
+ 0x1C200E08, // 004F EQ R8 R7 R8
+ 0x7822000A, // 0050 JMPF R8 #005C
+ 0xB8220200, // 0051 GETNGBL R8 K1
+ 0x8C201102, // 0052 GETMET R8 R8 K2
+ 0x60280008, // 0053 GETGBL R10 G8
+ 0x5C2C0C00, // 0054 MOVE R11 R6
+ 0x7C280200, // 0055 CALL R10 1
+ 0x002A280A, // 0056 ADD R10 K20 R10
+ 0x00281515, // 0057 ADD R10 R10 K21
+ 0x582C0004, // 0058 LDCONST R11 K4
+ 0x7C200600, // 0059 CALL R8 3
+ 0xA8040001, // 005A EXBLK 1 1
+ 0x7001FFCD, // 005B JMP #002A
+ 0x5C200E00, // 005C MOVE R8 R7
+ 0x5C240000, // 005D MOVE R9 R0
+ 0x5C280800, // 005E MOVE R10 R4
+ 0x5C2C0A00, // 005F MOVE R11 R5
+ 0x7C200600, // 0060 CALL R8 3
+ 0x88240105, // 0061 GETMBR R9 R0 K5
+ 0x8C241306, // 0062 GETMET R9 R9 K6
+ 0x5C2C1000, // 0063 MOVE R11 R8
+ 0x7C240400, // 0064 CALL R9 2
+ 0xB8260200, // 0065 GETNGBL R9 K1
+ 0x8C241302, // 0066 GETMET R9 R9 K2
+ 0x602C0018, // 0067 GETGBL R11 G24
+ 0x5830000A, // 0068 LDCONST R12 K10
+ 0x5C340800, // 0069 MOVE R13 R4
+ 0x5C380C00, // 006A MOVE R14 R6
+ 0x8C3C0116, // 006B GETMET R15 R0 K22
+ 0x5C440A00, // 006C MOVE R17 R5
+ 0x7C3C0400, // 006D CALL R15 2
+ 0x7C2C0800, // 006E CALL R11 4
+ 0x58300004, // 006F LDCONST R12 K4
+ 0x7C240600, // 0070 CALL R9 3
+ 0xA8040001, // 0071 EXBLK 1 1
+ 0x70020010, // 0072 JMP #0084
+ 0xAC140002, // 0073 CATCH R5 0 2
+ 0x7002000D, // 0074 JMP #0083
+ 0xB81E0200, // 0075 GETNGBL R7 K1
+ 0x8C1C0F02, // 0076 GETMET R7 R7 K2
+ 0x60240008, // 0077 GETGBL R9 G8
+ 0x5C280A00, // 0078 MOVE R10 R5
+ 0x7C240200, // 0079 CALL R9 1
+ 0x00262E09, // 007A ADD R9 K23 R9
+ 0x00241318, // 007B ADD R9 R9 K24
+ 0x60280008, // 007C GETGBL R10 G8
+ 0x5C2C0C00, // 007D MOVE R11 R6
+ 0x7C280200, // 007E CALL R10 1
+ 0x0024120A, // 007F ADD R9 R9 R10
+ 0x58280004, // 0080 LDCONST R10 K4
+ 0x7C1C0600, // 0081 CALL R7 3
+ 0x70020000, // 0082 JMP #0084
+ 0xB0080000, // 0083 RAISE 2 R0 R0
+ 0x7001FFA4, // 0084 JMP #002A
+ 0x580C0019, // 0085 LDCONST R3 K25
+ 0xAC0C0200, // 0086 CATCH R3 1 0
+ 0xB0080000, // 0087 RAISE 2 R0 R0
+ 0xB80E0200, // 0088 GETNGBL R3 K1
+ 0x8C0C0702, // 0089 GETMET R3 R3 K2
+ 0x60140018, // 008A GETGBL R5 G24
+ 0x5818000A, // 008B LDCONST R6 K10
+ 0x541EFEFF, // 008C LDINT R7 65280
+ 0x5820001A, // 008D LDCONST R8 K26
+ 0x5824000C, // 008E LDCONST R9 K12
+ 0x7C140800, // 008F CALL R5 4
+ 0x58180004, // 0090 LDCONST R6 K4
+ 0x7C0C0600, // 0091 CALL R3 3
+ 0xB80E0200, // 0092 GETNGBL R3 K1
+ 0x8C0C071B, // 0093 GETMET R3 R3 K27
+ 0x5814001C, // 0094 LDCONST R5 K28
+ 0x5818001D, // 0095 LDCONST R6 K29
+ 0x7C0C0600, // 0096 CALL R3 3
+ 0x80000000, // 0097 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: k2l_num
+********************************************************************/
+be_local_closure(Matter_Device_k2l_num, /* name */
+ be_nested_proto(
+ 9, /* nstack */
+ 1, /* argc */
+ 4, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 6]) { /* constants */
+ /* K0 */ be_const_class(be_class_Matter_Device),
+ /* K1 */ be_nested_str_weak(keys),
+ /* K2 */ be_nested_str_weak(push),
+ /* K3 */ be_nested_str_weak(stop_iteration),
+ /* K4 */ be_const_int(1),
+ /* K5 */ be_const_int(0),
+ }),
+ be_str_weak(k2l_num),
+ &be_const_str_solidified,
+ ( &(const binstruction[52]) { /* code */
+ 0x58040000, // 0000 LDCONST R1 K0
+ 0x60080012, // 0001 GETGBL R2 G18
+ 0x7C080000, // 0002 CALL R2 0
+ 0x4C0C0000, // 0003 LDNIL R3
+ 0x1C0C0003, // 0004 EQ R3 R0 R3
+ 0x780E0000, // 0005 JMPF R3 #0007
+ 0x80040400, // 0006 RET 1 R2
+ 0x600C0010, // 0007 GETGBL R3 G16
+ 0x8C100101, // 0008 GETMET R4 R0 K1
+ 0x7C100200, // 0009 CALL R4 1
+ 0x7C0C0200, // 000A CALL R3 1
+ 0xA8020007, // 000B EXBLK 0 #0014
+ 0x5C100600, // 000C MOVE R4 R3
+ 0x7C100000, // 000D CALL R4 0
+ 0x8C140502, // 000E GETMET R5 R2 K2
+ 0x601C0009, // 000F GETGBL R7 G9
+ 0x5C200800, // 0010 MOVE R8 R4
+ 0x7C1C0200, // 0011 CALL R7 1
+ 0x7C140400, // 0012 CALL R5 2
+ 0x7001FFF7, // 0013 JMP #000C
+ 0x580C0003, // 0014 LDCONST R3 K3
+ 0xAC0C0200, // 0015 CATCH R3 1 0
+ 0xB0080000, // 0016 RAISE 2 R0 R0
+ 0x600C0010, // 0017 GETGBL R3 G16
+ 0x6010000C, // 0018 GETGBL R4 G12
+ 0x5C140400, // 0019 MOVE R5 R2
+ 0x7C100200, // 001A CALL R4 1
+ 0x04100904, // 001B SUB R4 R4 K4
+ 0x40120804, // 001C CONNECT R4 K4 R4
+ 0x7C0C0200, // 001D CALL R3 1
+ 0xA8020010, // 001E EXBLK 0 #0030
+ 0x5C100600, // 001F MOVE R4 R3
+ 0x7C100000, // 0020 CALL R4 0
+ 0x94140404, // 0021 GETIDX R5 R2 R4
+ 0x5C180800, // 0022 MOVE R6 R4
+ 0x241C0D05, // 0023 GT R7 R6 K5
+ 0x781E0008, // 0024 JMPF R7 #002E
+ 0x041C0D04, // 0025 SUB R7 R6 K4
+ 0x941C0407, // 0026 GETIDX R7 R2 R7
+ 0x241C0E05, // 0027 GT R7 R7 R5
+ 0x781E0004, // 0028 JMPF R7 #002E
+ 0x041C0D04, // 0029 SUB R7 R6 K4
+ 0x941C0407, // 002A GETIDX R7 R2 R7
+ 0x98080C07, // 002B SETIDX R2 R6 R7
+ 0x04180D04, // 002C SUB R6 R6 K4
+ 0x7001FFF4, // 002D JMP #0023
+ 0x98080C05, // 002E SETIDX R2 R6 R5
+ 0x7001FFEE, // 002F JMP #001F
+ 0x580C0003, // 0030 LDCONST R3 K3
+ 0xAC0C0200, // 0031 CATCH R3 1 0
+ 0xB0080000, // 0032 RAISE 2 R0 R0
+ 0x80040400, // 0033 RET 1 R2
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: find_plugin_by_friendly_name
+********************************************************************/
+be_local_closure(Matter_Device_find_plugin_by_friendly_name, /* name */
+ be_nested_proto(
+ 7, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_const_int(0),
+ /* K1 */ be_nested_str_weak(plugins),
+ /* K2 */ be_nested_str_weak(get_name),
+ /* K3 */ be_const_int(1),
+ }),
+ be_str_weak(find_plugin_by_friendly_name),
+ &be_const_str_solidified,
+ ( &(const binstruction[35]) { /* code */
+ 0x4C080000, // 0000 LDNIL R2
+ 0x1C080202, // 0001 EQ R2 R1 R2
+ 0x740A0004, // 0002 JMPT R2 #0008
+ 0x6008000C, // 0003 GETGBL R2 G12
+ 0x5C0C0200, // 0004 MOVE R3 R1
+ 0x7C080200, // 0005 CALL R2 1
+ 0x1C080500, // 0006 EQ R2 R2 K0
+ 0x780A0001, // 0007 JMPF R2 #000A
+ 0x4C080000, // 0008 LDNIL R2
+ 0x80040400, // 0009 RET 1 R2
+ 0x58080000, // 000A LDCONST R2 K0
+ 0x600C000C, // 000B GETGBL R3 G12
+ 0x88100101, // 000C GETMBR R4 R0 K1
+ 0x7C0C0200, // 000D CALL R3 1
+ 0x140C0403, // 000E LT R3 R2 R3
+ 0x780E0010, // 000F JMPF R3 #0021
+ 0x880C0101, // 0010 GETMBR R3 R0 K1
+ 0x940C0602, // 0011 GETIDX R3 R3 R2
+ 0x8C100702, // 0012 GETMET R4 R3 K2
+ 0x7C100200, // 0013 CALL R4 1
+ 0x4C140000, // 0014 LDNIL R5
+ 0x20140805, // 0015 NE R5 R4 R5
+ 0x78160007, // 0016 JMPF R5 #001F
+ 0x6014000C, // 0017 GETGBL R5 G12
+ 0x5C180800, // 0018 MOVE R6 R4
+ 0x7C140200, // 0019 CALL R5 1
+ 0x24140B00, // 001A GT R5 R5 K0
+ 0x78160002, // 001B JMPF R5 #001F
+ 0x1C140801, // 001C EQ R5 R4 R1
+ 0x78160000, // 001D JMPF R5 #001F
+ 0x80040600, // 001E RET 1 R3
+ 0x00080503, // 001F ADD R2 R2 K3
+ 0x7001FFE9, // 0020 JMP #000B
+ 0x4C0C0000, // 0021 LDNIL R3
+ 0x80040600, // 0022 RET 1 R3
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: msg_send
+********************************************************************/
+be_local_closure(Matter_Device_msg_send, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(udp_server),
+ /* K1 */ be_nested_str_weak(send_UDP),
+ }),
+ be_str_weak(msg_send),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 5]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x8C080501, // 0001 GETMET R2 R2 K1
+ 0x5C100200, // 0002 MOVE R4 R1
+ 0x7C080400, // 0003 CALL R2 2
+ 0x80040400, // 0004 RET 1 R2
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: get_active_endpoints
+********************************************************************/
+be_local_closure(Matter_Device_get_active_endpoints, /* name */
+ be_nested_proto(
+ 9, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 6]) { /* constants */
+ /* K0 */ be_nested_str_weak(plugins),
+ /* K1 */ be_nested_str_weak(get_endpoint),
+ /* K2 */ be_const_int(0),
+ /* K3 */ be_nested_str_weak(find),
+ /* K4 */ be_nested_str_weak(push),
+ /* K5 */ be_nested_str_weak(stop_iteration),
+ }),
+ be_str_weak(get_active_endpoints),
+ &be_const_str_solidified,
+ ( &(const binstruction[28]) { /* code */
+ 0x60080012, // 0000 GETGBL R2 G18
+ 0x7C080000, // 0001 CALL R2 0
+ 0x600C0010, // 0002 GETGBL R3 G16
+ 0x88100100, // 0003 GETMBR R4 R0 K0
+ 0x7C0C0200, // 0004 CALL R3 1
+ 0xA8020011, // 0005 EXBLK 0 #0018
+ 0x5C100600, // 0006 MOVE R4 R3
+ 0x7C100000, // 0007 CALL R4 0
+ 0x8C140901, // 0008 GETMET R5 R4 K1
+ 0x7C140200, // 0009 CALL R5 1
+ 0x78060002, // 000A JMPF R1 #000E
+ 0x1C180B02, // 000B EQ R6 R5 K2
+ 0x781A0000, // 000C JMPF R6 #000E
+ 0x7001FFF7, // 000D JMP #0006
+ 0x8C180503, // 000E GETMET R6 R2 K3
+ 0x5C200A00, // 000F MOVE R8 R5
+ 0x7C180400, // 0010 CALL R6 2
+ 0x4C1C0000, // 0011 LDNIL R7
+ 0x1C180C07, // 0012 EQ R6 R6 R7
+ 0x781A0002, // 0013 JMPF R6 #0017
+ 0x8C180504, // 0014 GETMET R6 R2 K4
+ 0x5C200A00, // 0015 MOVE R8 R5
+ 0x7C180400, // 0016 CALL R6 2
+ 0x7001FFED, // 0017 JMP #0006
+ 0x580C0005, // 0018 LDCONST R3 K5
+ 0xAC0C0200, // 0019 CATCH R3 1 0
+ 0xB0080000, // 001A RAISE 2 R0 R0
+ 0x80040400, // 001B RET 1 R2
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: start_root_basic_commissioning
+********************************************************************/
+be_local_closure(Matter_Device_start_root_basic_commissioning, /* name */
+ be_nested_proto(
+ 13, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[18]) { /* constants */
+ /* K0 */ be_nested_str_weak(PASE_TIMEOUT),
+ /* K1 */ be_nested_str_weak(compute_manual_pairing_code),
+ /* K2 */ be_nested_str_weak(tasmota),
+ /* K3 */ be_nested_str_weak(log),
+ /* K4 */ be_nested_str_weak(MTR_X3A_X20Manual_X20pairing_X20code_X3A_X20_X25s),
+ /* K5 */ be_const_int(2),
+ /* K6 */ be_nested_str_weak(compute_qrcode_content),
+ /* K7 */ be_nested_str_weak(publish_result),
+ /* K8 */ be_nested_str_weak(_X7B_X22Matter_X22_X3A_X7B_X22Commissioning_X22_X3A1_X2C_X22PairingCode_X22_X3A_X22_X25s_X22_X2C_X22QRCode_X22_X3A_X22_X25s_X22_X7D_X7D),
+ /* K9 */ be_nested_str_weak(Matter),
+ /* K10 */ be_nested_str_weak(_compute_pbkdf),
+ /* K11 */ be_nested_str_weak(root_passcode),
+ /* K12 */ be_nested_str_weak(root_iterations),
+ /* K13 */ be_nested_str_weak(root_salt),
+ /* K14 */ be_nested_str_weak(start_basic_commissioning),
+ /* K15 */ be_nested_str_weak(root_discriminator),
+ /* K16 */ be_nested_str_weak(root_w0),
+ /* K17 */ be_nested_str_weak(root_L),
+ }),
+ be_str_weak(start_root_basic_commissioning),
+ &be_const_str_solidified,
+ ( &(const binstruction[40]) { /* code */
+ 0x4C080000, // 0000 LDNIL R2
+ 0x1C080202, // 0001 EQ R2 R1 R2
+ 0x780A0000, // 0002 JMPF R2 #0004
+ 0x88040100, // 0003 GETMBR R1 R0 K0
+ 0x8C080101, // 0004 GETMET R2 R0 K1
+ 0x7C080200, // 0005 CALL R2 1
+ 0xB80E0400, // 0006 GETNGBL R3 K2
+ 0x8C0C0703, // 0007 GETMET R3 R3 K3
+ 0x60140018, // 0008 GETGBL R5 G24
+ 0x58180004, // 0009 LDCONST R6 K4
+ 0x5C1C0400, // 000A MOVE R7 R2
+ 0x7C140400, // 000B CALL R5 2
+ 0x58180005, // 000C LDCONST R6 K5
+ 0x7C0C0600, // 000D CALL R3 3
+ 0x8C0C0106, // 000E GETMET R3 R0 K6
+ 0x7C0C0200, // 000F CALL R3 1
+ 0xB8120400, // 0010 GETNGBL R4 K2
+ 0x8C100907, // 0011 GETMET R4 R4 K7
+ 0x60180018, // 0012 GETGBL R6 G24
+ 0x581C0008, // 0013 LDCONST R7 K8
+ 0x5C200400, // 0014 MOVE R8 R2
+ 0x5C240600, // 0015 MOVE R9 R3
+ 0x7C180600, // 0016 CALL R6 3
+ 0x581C0009, // 0017 LDCONST R7 K9
+ 0x7C100600, // 0018 CALL R4 3
+ 0x8C10010A, // 0019 GETMET R4 R0 K10
+ 0x8818010B, // 001A GETMBR R6 R0 K11
+ 0x881C010C, // 001B GETMBR R7 R0 K12
+ 0x8820010D, // 001C GETMBR R8 R0 K13
+ 0x7C100800, // 001D CALL R4 4
+ 0x8C10010E, // 001E GETMET R4 R0 K14
+ 0x5C180200, // 001F MOVE R6 R1
+ 0x881C010C, // 0020 GETMBR R7 R0 K12
+ 0x8820010F, // 0021 GETMBR R8 R0 K15
+ 0x8824010D, // 0022 GETMBR R9 R0 K13
+ 0x88280110, // 0023 GETMBR R10 R0 K16
+ 0x882C0111, // 0024 GETMBR R11 R0 K17
+ 0x4C300000, // 0025 LDNIL R12
+ 0x7C101000, // 0026 CALL R4 8
+ 0x80000000, // 0027 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: bridge_remove_endpoint
+********************************************************************/
+be_local_closure(Matter_Device_bridge_remove_endpoint, /* name */
+ be_nested_proto(
+ 11, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[18]) { /* constants */
+ /* K0 */ be_nested_str_weak(json),
+ /* K1 */ be_nested_str_weak(plugins_config),
+ /* K2 */ be_nested_str_weak(contains),
+ /* K3 */ be_nested_str_weak(tasmota),
+ /* K4 */ be_nested_str_weak(log),
+ /* K5 */ be_nested_str_weak(MTR_X3A_X20Cannot_X20remove_X20an_X20enpoint_X20not_X20configured_X3A_X20),
+ /* K6 */ be_const_int(3),
+ /* K7 */ be_nested_str_weak(MTR_X3A_X20deleting_X20endpoint_X20_X3D_X20_X25i),
+ /* K8 */ be_const_int(2),
+ /* K9 */ be_nested_str_weak(remove),
+ /* K10 */ be_nested_str_weak(plugins_persist),
+ /* K11 */ be_const_int(0),
+ /* K12 */ be_nested_str_weak(plugins),
+ /* K13 */ be_nested_str_weak(get_endpoint),
+ /* K14 */ be_const_int(1),
+ /* K15 */ be_nested_str_weak(clean_remotes),
+ /* K16 */ be_nested_str_weak(save_param),
+ /* K17 */ be_nested_str_weak(signal_endpoints_changed),
+ }),
+ be_str_weak(bridge_remove_endpoint),
+ &be_const_str_solidified,
+ ( &(const binstruction[58]) { /* code */
+ 0xA40A0000, // 0000 IMPORT R2 K0
+ 0x600C0008, // 0001 GETGBL R3 G8
+ 0x5C100200, // 0002 MOVE R4 R1
+ 0x7C0C0200, // 0003 CALL R3 1
+ 0x4C100000, // 0004 LDNIL R4
+ 0x4C140000, // 0005 LDNIL R5
+ 0x88180101, // 0006 GETMBR R6 R0 K1
+ 0x8C180D02, // 0007 GETMET R6 R6 K2
+ 0x5C200600, // 0008 MOVE R8 R3
+ 0x7C180400, // 0009 CALL R6 2
+ 0x741A0005, // 000A JMPT R6 #0011
+ 0xB81A0600, // 000B GETNGBL R6 K3
+ 0x8C180D04, // 000C GETMET R6 R6 K4
+ 0x00220A03, // 000D ADD R8 K5 R3
+ 0x58240006, // 000E LDCONST R9 K6
+ 0x7C180600, // 000F CALL R6 3
+ 0x80000C00, // 0010 RET 0
+ 0xB81A0600, // 0011 GETNGBL R6 K3
+ 0x8C180D04, // 0012 GETMET R6 R6 K4
+ 0x60200018, // 0013 GETGBL R8 G24
+ 0x58240007, // 0014 LDCONST R9 K7
+ 0x5C280200, // 0015 MOVE R10 R1
+ 0x7C200400, // 0016 CALL R8 2
+ 0x58240008, // 0017 LDCONST R9 K8
+ 0x7C180600, // 0018 CALL R6 3
+ 0x88180101, // 0019 GETMBR R6 R0 K1
+ 0x8C180D09, // 001A GETMET R6 R6 K9
+ 0x5C200600, // 001B MOVE R8 R3
+ 0x7C180400, // 001C CALL R6 2
+ 0x50180200, // 001D LDBOOL R6 1 0
+ 0x90021406, // 001E SETMBR R0 K10 R6
+ 0x5818000B, // 001F LDCONST R6 K11
+ 0x601C000C, // 0020 GETGBL R7 G12
+ 0x8820010C, // 0021 GETMBR R8 R0 K12
+ 0x7C1C0200, // 0022 CALL R7 1
+ 0x141C0C07, // 0023 LT R7 R6 R7
+ 0x781E000D, // 0024 JMPF R7 #0033
+ 0x881C010C, // 0025 GETMBR R7 R0 K12
+ 0x941C0E06, // 0026 GETIDX R7 R7 R6
+ 0x8C1C0F0D, // 0027 GETMET R7 R7 K13
+ 0x7C1C0200, // 0028 CALL R7 1
+ 0x1C1C0207, // 0029 EQ R7 R1 R7
+ 0x781E0005, // 002A JMPF R7 #0031
+ 0x881C010C, // 002B GETMBR R7 R0 K12
+ 0x8C1C0F09, // 002C GETMET R7 R7 K9
+ 0x5C240C00, // 002D MOVE R9 R6
+ 0x7C1C0400, // 002E CALL R7 2
+ 0x70020002, // 002F JMP #0033
+ 0x70020000, // 0030 JMP #0032
+ 0x00180D0E, // 0031 ADD R6 R6 K14
+ 0x7001FFEC, // 0032 JMP #0020
+ 0x8C1C010F, // 0033 GETMET R7 R0 K15
+ 0x7C1C0200, // 0034 CALL R7 1
+ 0x8C1C0110, // 0035 GETMET R7 R0 K16
+ 0x7C1C0200, // 0036 CALL R7 1
+ 0x8C1C0111, // 0037 GETMET R7 R0 K17
+ 0x7C1C0200, // 0038 CALL R7 1
+ 0x80000000, // 0039 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: get_plugin_class_displayname
+********************************************************************/
+be_local_closure(Matter_Device_get_plugin_class_displayname, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(plugins_classes),
+ /* K1 */ be_nested_str_weak(find),
+ /* K2 */ be_nested_str_weak(DISPLAY_NAME),
+ /* K3 */ be_nested_str_weak(),
+ }),
+ be_str_weak(get_plugin_class_displayname),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 9]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x8C080501, // 0001 GETMET R2 R2 K1
+ 0x5C100200, // 0002 MOVE R4 R1
+ 0x7C080400, // 0003 CALL R2 2
+ 0x780A0001, // 0004 JMPF R2 #0007
+ 0x880C0502, // 0005 GETMBR R3 R2 K2
+ 0x70020000, // 0006 JMP #0008
+ 0x580C0003, // 0007 LDCONST R3 K3
+ 0x80040600, // 0008 RET 1 R3
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: update_remotes_info
+********************************************************************/
+be_local_closure(Matter_Device_update_remotes_info, /* name */
+ be_nested_proto(
+ 7, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 6]) { /* constants */
+ /* K0 */ be_nested_str_weak(http_remotes),
+ /* K1 */ be_nested_str_weak(keys),
+ /* K2 */ be_nested_str_weak(get_info),
+ /* K3 */ be_const_int(0),
+ /* K4 */ be_nested_str_weak(stop_iteration),
+ /* K5 */ be_nested_str_weak(plugins_config_remotes),
+ }),
+ be_str_weak(update_remotes_info),
+ &be_const_str_solidified,
+ ( &(const binstruction[33]) { /* code */
+ 0x60040013, // 0000 GETGBL R1 G19
+ 0x7C040000, // 0001 CALL R1 0
+ 0x88080100, // 0002 GETMBR R2 R0 K0
+ 0x4C0C0000, // 0003 LDNIL R3
+ 0x20080403, // 0004 NE R2 R2 R3
+ 0x780A0018, // 0005 JMPF R2 #001F
+ 0x60080010, // 0006 GETGBL R2 G16
+ 0x880C0100, // 0007 GETMBR R3 R0 K0
+ 0x8C0C0701, // 0008 GETMET R3 R3 K1
+ 0x7C0C0200, // 0009 CALL R3 1
+ 0x7C080200, // 000A CALL R2 1
+ 0xA802000F, // 000B EXBLK 0 #001C
+ 0x5C0C0400, // 000C MOVE R3 R2
+ 0x7C0C0000, // 000D CALL R3 0
+ 0x88100100, // 000E GETMBR R4 R0 K0
+ 0x94100803, // 000F GETIDX R4 R4 R3
+ 0x8C100902, // 0010 GETMET R4 R4 K2
+ 0x7C100200, // 0011 CALL R4 1
+ 0x4C140000, // 0012 LDNIL R5
+ 0x20140805, // 0013 NE R5 R4 R5
+ 0x78160005, // 0014 JMPF R5 #001B
+ 0x6014000C, // 0015 GETGBL R5 G12
+ 0x5C180800, // 0016 MOVE R6 R4
+ 0x7C140200, // 0017 CALL R5 1
+ 0x24140B03, // 0018 GT R5 R5 K3
+ 0x78160000, // 0019 JMPF R5 #001B
+ 0x98040604, // 001A SETIDX R1 R3 R4
+ 0x7001FFEF, // 001B JMP #000C
+ 0x58080004, // 001C LDCONST R2 K4
+ 0xAC080200, // 001D CATCH R2 1 0
+ 0xB0080000, // 001E RAISE 2 R0 R0
+ 0x90020A01, // 001F SETMBR R0 K5 R1
+ 0x80040200, // 0020 RET 1 R1
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: start
+********************************************************************/
+be_local_closure(Matter_Device_start, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 5]) { /* constants */
+ /* K0 */ be_nested_str_weak(started),
+ /* K1 */ be_nested_str_weak(autoconf_device),
+ /* K2 */ be_nested_str_weak(_start_udp),
+ /* K3 */ be_nested_str_weak(UDP_PORT),
+ /* K4 */ be_nested_str_weak(start_mdns_announce_hostnames),
+ }),
+ be_str_weak(start),
+ &be_const_str_solidified,
+ ( &(const binstruction[13]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x78060000, // 0001 JMPF R1 #0003
+ 0x80000200, // 0002 RET 0
+ 0x8C040101, // 0003 GETMET R1 R0 K1
+ 0x7C040200, // 0004 CALL R1 1
+ 0x8C040102, // 0005 GETMET R1 R0 K2
+ 0x880C0103, // 0006 GETMBR R3 R0 K3
+ 0x7C040400, // 0007 CALL R1 2
+ 0x8C040104, // 0008 GETMET R1 R0 K4
+ 0x7C040200, // 0009 CALL R1 1
+ 0x50040200, // 000A LDBOOL R1 1 0
+ 0x90020001, // 000B SETMBR R0 K0 R1
+ 0x80000000, // 000C RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: k2l
+********************************************************************/
+be_local_closure(Matter_Device_k2l, /* name */
+ be_nested_proto(
+ 8, /* nstack */
+ 1, /* argc */
+ 4, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 6]) { /* constants */
+ /* K0 */ be_const_class(be_class_Matter_Device),
+ /* K1 */ be_nested_str_weak(keys),
+ /* K2 */ be_nested_str_weak(push),
+ /* K3 */ be_nested_str_weak(stop_iteration),
+ /* K4 */ be_const_int(1),
+ /* K5 */ be_const_int(0),
+ }),
+ be_str_weak(k2l),
+ &be_const_str_solidified,
+ ( &(const binstruction[50]) { /* code */
+ 0x58040000, // 0000 LDCONST R1 K0
+ 0x60080012, // 0001 GETGBL R2 G18
+ 0x7C080000, // 0002 CALL R2 0
+ 0x4C0C0000, // 0003 LDNIL R3
+ 0x1C0C0003, // 0004 EQ R3 R0 R3
+ 0x780E0000, // 0005 JMPF R3 #0007
+ 0x80040400, // 0006 RET 1 R2
+ 0x600C0010, // 0007 GETGBL R3 G16
+ 0x8C100101, // 0008 GETMET R4 R0 K1
+ 0x7C100200, // 0009 CALL R4 1
+ 0x7C0C0200, // 000A CALL R3 1
+ 0xA8020005, // 000B EXBLK 0 #0012
+ 0x5C100600, // 000C MOVE R4 R3
+ 0x7C100000, // 000D CALL R4 0
+ 0x8C140502, // 000E GETMET R5 R2 K2
+ 0x5C1C0800, // 000F MOVE R7 R4
+ 0x7C140400, // 0010 CALL R5 2
+ 0x7001FFF9, // 0011 JMP #000C
+ 0x580C0003, // 0012 LDCONST R3 K3
+ 0xAC0C0200, // 0013 CATCH R3 1 0
+ 0xB0080000, // 0014 RAISE 2 R0 R0
+ 0x600C0010, // 0015 GETGBL R3 G16
+ 0x6010000C, // 0016 GETGBL R4 G12
+ 0x5C140400, // 0017 MOVE R5 R2
+ 0x7C100200, // 0018 CALL R4 1
+ 0x04100904, // 0019 SUB R4 R4 K4
+ 0x40120804, // 001A CONNECT R4 K4 R4
+ 0x7C0C0200, // 001B CALL R3 1
+ 0xA8020010, // 001C EXBLK 0 #002E
+ 0x5C100600, // 001D MOVE R4 R3
+ 0x7C100000, // 001E CALL R4 0
+ 0x94140404, // 001F GETIDX R5 R2 R4
+ 0x5C180800, // 0020 MOVE R6 R4
+ 0x241C0D05, // 0021 GT R7 R6 K5
+ 0x781E0008, // 0022 JMPF R7 #002C
+ 0x041C0D04, // 0023 SUB R7 R6 K4
+ 0x941C0407, // 0024 GETIDX R7 R2 R7
+ 0x241C0E05, // 0025 GT R7 R7 R5
+ 0x781E0004, // 0026 JMPF R7 #002C
+ 0x041C0D04, // 0027 SUB R7 R6 K4
+ 0x941C0407, // 0028 GETIDX R7 R2 R7
+ 0x98080C07, // 0029 SETIDX R2 R6 R7
+ 0x04180D04, // 002A SUB R6 R6 K4
+ 0x7001FFF4, // 002B JMP #0021
+ 0x98080C05, // 002C SETIDX R2 R6 R5
+ 0x7001FFEE, // 002D JMP #001D
+ 0x580C0003, // 002E LDCONST R3 K3
+ 0xAC0C0200, // 002F CATCH R3 1 0
+ 0xB0080000, // 0030 RAISE 2 R0 R0
+ 0x80040400, // 0031 RET 1 R2
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: start_operational_discovery_deferred
+********************************************************************/
+be_local_closure(Matter_Device_start_operational_discovery_deferred, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 1, /* has sup protos */
+ ( &(const struct bproto*[ 1]) {
+ be_nested_proto(
+ 3, /* nstack */
+ 0, /* argc */
+ 0, /* varg */
+ 1, /* has upvals */
+ ( &(const bupvaldesc[ 2]) { /* upvals */
+ be_local_const_upval(1, 0),
+ be_local_const_upval(1, 1),
+ }),
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(start_operational_discovery),
+ }),
+ be_str_weak(_X3Clambda_X3E),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 5]) { /* code */
+ 0x68000000, // 0000 GETUPV R0 U0
+ 0x8C000100, // 0001 GETMET R0 R0 K0
+ 0x68080001, // 0002 GETUPV R2 U1
+ 0x7C000400, // 0003 CALL R0 2
+ 0x80040000, // 0004 RET 1 R0
+ })
+ ),
+ }),
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(tasmota),
+ /* K1 */ be_nested_str_weak(set_timer),
+ /* K2 */ be_const_int(0),
+ }),
+ be_str_weak(start_operational_discovery_deferred),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 7]) { /* code */
+ 0xB80A0000, // 0000 GETNGBL R2 K0
+ 0x8C080501, // 0001 GETMET R2 R2 K1
+ 0x58100002, // 0002 LDCONST R4 K2
+ 0x84140000, // 0003 CLOSURE R5 P0
+ 0x7C080600, // 0004 CALL R2 3
+ 0xA0000000, // 0005 CLOSE R0
+ 0x80000000, // 0006 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: autoconf_device_map
+********************************************************************/
+be_local_closure(Matter_Device_autoconf_device_map, /* name */
+ be_nested_proto(
+ 20, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[36]) { /* constants */
+ /* K0 */ be_nested_str_weak(json),
+ /* K1 */ be_const_int(1),
+ /* K2 */ be_nested_str_weak(light),
+ /* K3 */ be_nested_str_weak(get),
+ /* K4 */ be_nested_str_weak(find),
+ /* K5 */ be_nested_str_weak(channels),
+ /* K6 */ be_nested_str_weak(),
+ /* K7 */ be_const_int(0),
+ /* K8 */ be_nested_str_weak(type),
+ /* K9 */ be_nested_str_weak(light1),
+ /* K10 */ be_const_int(2),
+ /* K11 */ be_nested_str_weak(light2),
+ /* K12 */ be_nested_str_weak(light3),
+ /* K13 */ be_nested_str_weak(tasmota),
+ /* K14 */ be_nested_str_weak(cmd),
+ /* K15 */ be_nested_str_weak(Status_X2013),
+ /* K16 */ be_nested_str_weak(log),
+ /* K17 */ be_nested_str_weak(MTR_X3A_X20Status_X2013_X20_X3D_X20),
+ /* K18 */ be_const_int(3),
+ /* K19 */ be_nested_str_weak(contains),
+ /* K20 */ be_nested_str_weak(StatusSHT),
+ /* K21 */ be_nested_str_weak(SHT),
+ /* K22 */ be_nested_str_weak(MTR_X3A_X20_X27_X25s_X27_X20_X3D_X20_X25s),
+ /* K23 */ be_nested_str_weak(Relay1),
+ /* K24 */ be_nested_str_weak(Relay2),
+ /* K25 */ be_nested_str_weak(push),
+ /* K26 */ be_nested_str_weak(MTR_X3A_X20relay1_X3D_X25s_X20relay2_X3D_X25s),
+ /* K27 */ be_nested_str_weak(TiltConfig),
+ /* K28 */ be_nested_str_weak(shutter_X2Btilt),
+ /* K29 */ be_nested_str_weak(shutter),
+ /* K30 */ be_nested_str_weak(get_power),
+ /* K31 */ be_nested_str_weak(relay),
+ /* K32 */ be_nested_str_weak(load),
+ /* K33 */ be_nested_str_weak(read_sensors),
+ /* K34 */ be_nested_str_weak(autoconf_sensors_list),
+ /* K35 */ be_nested_str_weak(stop_iteration),
+ }),
+ be_str_weak(autoconf_device_map),
+ &be_const_str_solidified,
+ ( &(const binstruction[198]) { /* code */
+ 0xA4060000, // 0000 IMPORT R1 K0
+ 0x60080013, // 0001 GETGBL R2 G19
+ 0x7C080000, // 0002 CALL R2 0
+ 0x580C0001, // 0003 LDCONST R3 K1
+ 0x50100000, // 0004 LDBOOL R4 0 0
+ 0xA4160400, // 0005 IMPORT R5 K2
+ 0x8C180B03, // 0006 GETMET R6 R5 K3
+ 0x7C180200, // 0007 CALL R6 1
+ 0x4C1C0000, // 0008 LDNIL R7
+ 0x201C0C07, // 0009 NE R7 R6 R7
+ 0x781E0024, // 000A JMPF R7 #0030
+ 0x601C000C, // 000B GETGBL R7 G12
+ 0x8C200D04, // 000C GETMET R8 R6 K4
+ 0x58280005, // 000D LDCONST R10 K5
+ 0x582C0006, // 000E LDCONST R11 K6
+ 0x7C200600, // 000F CALL R8 3
+ 0x7C1C0200, // 0010 CALL R7 1
+ 0x24200F07, // 0011 GT R8 R7 K7
+ 0x7822001C, // 0012 JMPF R8 #0030
+ 0x1C200F01, // 0013 EQ R8 R7 K1
+ 0x78220007, // 0014 JMPF R8 #001D
+ 0x60200008, // 0015 GETGBL R8 G8
+ 0x5C240600, // 0016 MOVE R9 R3
+ 0x7C200200, // 0017 CALL R8 1
+ 0x60240013, // 0018 GETGBL R9 G19
+ 0x7C240000, // 0019 CALL R9 0
+ 0x98261109, // 001A SETIDX R9 K8 K9
+ 0x98081009, // 001B SETIDX R2 R8 R9
+ 0x70020010, // 001C JMP #002E
+ 0x1C200F0A, // 001D EQ R8 R7 K10
+ 0x78220007, // 001E JMPF R8 #0027
+ 0x60200008, // 001F GETGBL R8 G8
+ 0x5C240600, // 0020 MOVE R9 R3
+ 0x7C200200, // 0021 CALL R8 1
+ 0x60240013, // 0022 GETGBL R9 G19
+ 0x7C240000, // 0023 CALL R9 0
+ 0x9826110B, // 0024 SETIDX R9 K8 K11
+ 0x98081009, // 0025 SETIDX R2 R8 R9
+ 0x70020006, // 0026 JMP #002E
+ 0x60200008, // 0027 GETGBL R8 G8
+ 0x5C240600, // 0028 MOVE R9 R3
+ 0x7C200200, // 0029 CALL R8 1
+ 0x60240013, // 002A GETGBL R9 G19
+ 0x7C240000, // 002B CALL R9 0
+ 0x9826110C, // 002C SETIDX R9 K8 K12
+ 0x98081009, // 002D SETIDX R2 R8 R9
+ 0x50100200, // 002E LDBOOL R4 1 0
+ 0x000C0701, // 002F ADD R3 R3 K1
+ 0xB81E1A00, // 0030 GETNGBL R7 K13
+ 0x8C1C0F0E, // 0031 GETMET R7 R7 K14
+ 0x5824000F, // 0032 LDCONST R9 K15
+ 0x50280200, // 0033 LDBOOL R10 1 0
+ 0x7C1C0600, // 0034 CALL R7 3
+ 0x60200012, // 0035 GETGBL R8 G18
+ 0x7C200000, // 0036 CALL R8 0
+ 0xB8261A00, // 0037 GETNGBL R9 K13
+ 0x8C241310, // 0038 GETMET R9 R9 K16
+ 0x602C0008, // 0039 GETGBL R11 G8
+ 0x5C300E00, // 003A MOVE R12 R7
+ 0x7C2C0200, // 003B CALL R11 1
+ 0x002E220B, // 003C ADD R11 K17 R11
+ 0x58300012, // 003D LDCONST R12 K18
+ 0x7C240600, // 003E CALL R9 3
+ 0x4C240000, // 003F LDNIL R9
+ 0x20240E09, // 0040 NE R9 R7 R9
+ 0x7826004F, // 0041 JMPF R9 #0092
+ 0x8C240F13, // 0042 GETMET R9 R7 K19
+ 0x582C0014, // 0043 LDCONST R11 K20
+ 0x7C240400, // 0044 CALL R9 2
+ 0x7826004B, // 0045 JMPF R9 #0092
+ 0x941C0F14, // 0046 GETIDX R7 R7 K20
+ 0x58240007, // 0047 LDCONST R9 K7
+ 0x50280200, // 0048 LDBOOL R10 1 0
+ 0x782A0047, // 0049 JMPF R10 #0092
+ 0x60280008, // 004A GETGBL R10 G8
+ 0x5C2C1200, // 004B MOVE R11 R9
+ 0x7C280200, // 004C CALL R10 1
+ 0x002A2A0A, // 004D ADD R10 K21 R10
+ 0x8C2C0F13, // 004E GETMET R11 R7 K19
+ 0x5C341400, // 004F MOVE R13 R10
+ 0x7C2C0400, // 0050 CALL R11 2
+ 0x742E0000, // 0051 JMPT R11 #0053
+ 0x7002003E, // 0052 JMP #0092
+ 0x942C0E0A, // 0053 GETIDX R11 R7 R10
+ 0xB8321A00, // 0054 GETNGBL R12 K13
+ 0x8C301910, // 0055 GETMET R12 R12 K16
+ 0x60380018, // 0056 GETGBL R14 G24
+ 0x583C0016, // 0057 LDCONST R15 K22
+ 0x5C401400, // 0058 MOVE R16 R10
+ 0x60440008, // 0059 GETGBL R17 G8
+ 0x5C481600, // 005A MOVE R18 R11
+ 0x7C440200, // 005B CALL R17 1
+ 0x7C380600, // 005C CALL R14 3
+ 0x583C0012, // 005D LDCONST R15 K18
+ 0x7C300600, // 005E CALL R12 3
+ 0x8C301704, // 005F GETMET R12 R11 K4
+ 0x58380017, // 0060 LDCONST R14 K23
+ 0x543DFFFE, // 0061 LDINT R15 -1
+ 0x7C300600, // 0062 CALL R12 3
+ 0x8C341704, // 0063 GETMET R13 R11 K4
+ 0x583C0018, // 0064 LDCONST R15 K24
+ 0x5441FFFE, // 0065 LDINT R16 -1
+ 0x7C340600, // 0066 CALL R13 3
+ 0x24381907, // 0067 GT R14 R12 K7
+ 0x783A0002, // 0068 JMPF R14 #006C
+ 0x8C381119, // 0069 GETMET R14 R8 K25
+ 0x04401901, // 006A SUB R16 R12 K1
+ 0x7C380400, // 006B CALL R14 2
+ 0x24381B07, // 006C GT R14 R13 K7
+ 0x783A0002, // 006D JMPF R14 #0071
+ 0x8C381119, // 006E GETMET R14 R8 K25
+ 0x04401B01, // 006F SUB R16 R13 K1
+ 0x7C380400, // 0070 CALL R14 2
+ 0xB83A1A00, // 0071 GETNGBL R14 K13
+ 0x8C381D10, // 0072 GETMET R14 R14 K16
+ 0x60400018, // 0073 GETGBL R16 G24
+ 0x5844001A, // 0074 LDCONST R17 K26
+ 0x5C481800, // 0075 MOVE R18 R12
+ 0x5C4C1A00, // 0076 MOVE R19 R13
+ 0x7C400600, // 0077 CALL R16 3
+ 0x58440012, // 0078 LDCONST R17 K18
+ 0x7C380600, // 0079 CALL R14 3
+ 0x8C381704, // 007A GETMET R14 R11 K4
+ 0x5840001B, // 007B LDCONST R16 K27
+ 0x7C380400, // 007C CALL R14 2
+ 0x783A0002, // 007D JMPF R14 #0081
+ 0x943C1D0A, // 007E GETIDX R15 R14 K10
+ 0x243C1F07, // 007F GT R15 R15 K7
+ 0x743E0000, // 0080 JMPT R15 #0082
+ 0x503C0001, // 0081 LDBOOL R15 0 1
+ 0x503C0200, // 0082 LDBOOL R15 1 0
+ 0x60400008, // 0083 GETGBL R16 G8
+ 0x5C440600, // 0084 MOVE R17 R3
+ 0x7C400200, // 0085 CALL R16 1
+ 0x60440013, // 0086 GETGBL R17 G19
+ 0x7C440000, // 0087 CALL R17 0
+ 0x783E0001, // 0088 JMPF R15 #008B
+ 0x5848001C, // 0089 LDCONST R18 K28
+ 0x70020000, // 008A JMP #008C
+ 0x5848001D, // 008B LDCONST R18 K29
+ 0x98461012, // 008C SETIDX R17 K8 R18
+ 0x98463A09, // 008D SETIDX R17 K29 R9
+ 0x98082011, // 008E SETIDX R2 R16 R17
+ 0x000C0701, // 008F ADD R3 R3 K1
+ 0x00241301, // 0090 ADD R9 R9 K1
+ 0x7001FFB5, // 0091 JMP #0048
+ 0x6024000C, // 0092 GETGBL R9 G12
+ 0xB82A1A00, // 0093 GETNGBL R10 K13
+ 0x8C28151E, // 0094 GETMET R10 R10 K30
+ 0x7C280200, // 0095 CALL R10 1
+ 0x7C240200, // 0096 CALL R9 1
+ 0x58280007, // 0097 LDCONST R10 K7
+ 0x78120000, // 0098 JMPF R4 #009A
+ 0x04241301, // 0099 SUB R9 R9 K1
+ 0x142C1409, // 009A LT R11 R10 R9
+ 0x782E0011, // 009B JMPF R11 #00AE
+ 0x8C2C1104, // 009C GETMET R11 R8 K4
+ 0x5C341400, // 009D MOVE R13 R10
+ 0x7C2C0400, // 009E CALL R11 2
+ 0x4C300000, // 009F LDNIL R12
+ 0x1C2C160C, // 00A0 EQ R11 R11 R12
+ 0x782E0009, // 00A1 JMPF R11 #00AC
+ 0x602C0008, // 00A2 GETGBL R11 G8
+ 0x5C300600, // 00A3 MOVE R12 R3
+ 0x7C2C0200, // 00A4 CALL R11 1
+ 0x60300013, // 00A5 GETGBL R12 G19
+ 0x7C300000, // 00A6 CALL R12 0
+ 0x9832111F, // 00A7 SETIDX R12 K8 K31
+ 0x00341501, // 00A8 ADD R13 R10 K1
+ 0x98323E0D, // 00A9 SETIDX R12 K31 R13
+ 0x9808160C, // 00AA SETIDX R2 R11 R12
+ 0x000C0701, // 00AB ADD R3 R3 K1
+ 0x00281501, // 00AC ADD R10 R10 K1
+ 0x7001FFEB, // 00AD JMP #009A
+ 0x8C2C0320, // 00AE GETMET R11 R1 K32
+ 0xB8361A00, // 00AF GETNGBL R13 K13
+ 0x8C341B21, // 00B0 GETMET R13 R13 K33
+ 0x7C340200, // 00B1 CALL R13 1
+ 0x7C2C0400, // 00B2 CALL R11 2
+ 0x8C300122, // 00B3 GETMET R12 R0 K34
+ 0x5C381600, // 00B4 MOVE R14 R11
+ 0x7C300400, // 00B5 CALL R12 2
+ 0x60340010, // 00B6 GETGBL R13 G16
+ 0x5C381800, // 00B7 MOVE R14 R12
+ 0x7C340200, // 00B8 CALL R13 1
+ 0xA8020007, // 00B9 EXBLK 0 #00C2
+ 0x5C381A00, // 00BA MOVE R14 R13
+ 0x7C380000, // 00BB CALL R14 0
+ 0x603C0008, // 00BC GETGBL R15 G8
+ 0x5C400600, // 00BD MOVE R16 R3
+ 0x7C3C0200, // 00BE CALL R15 1
+ 0x98081E0E, // 00BF SETIDX R2 R15 R14
+ 0x000C0701, // 00C0 ADD R3 R3 K1
+ 0x7001FFF7, // 00C1 JMP #00BA
+ 0x58340023, // 00C2 LDCONST R13 K35
+ 0xAC340200, // 00C3 CATCH R13 1 0
+ 0xB0080000, // 00C4 RAISE 2 R0 R0
+ 0x80040400, // 00C5 RET 1 R2
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: mdns_announce_PASE
+********************************************************************/
+be_local_closure(Matter_Device_mdns_announce_PASE, /* name */
+ be_nested_proto(
+ 12, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[41]) { /* constants */
+ /* K0 */ be_nested_str_weak(mdns),
+ /* K1 */ be_nested_str_weak(crypto),
+ /* K2 */ be_nested_str_weak(VP),
+ /* K3 */ be_nested_str_weak(vendorid),
+ /* K4 */ be_nested_str_weak(_X2B),
+ /* K5 */ be_nested_str_weak(productid),
+ /* K6 */ be_nested_str_weak(D),
+ /* K7 */ be_nested_str_weak(commissioning_discriminator),
+ /* K8 */ be_nested_str_weak(CM),
+ /* K9 */ be_const_int(1),
+ /* K10 */ be_nested_str_weak(T),
+ /* K11 */ be_const_int(0),
+ /* K12 */ be_nested_str_weak(SII),
+ /* K13 */ be_nested_str_weak(SAI),
+ /* K14 */ be_nested_str_weak(commissioning_instance_wifi),
+ /* K15 */ be_nested_str_weak(random),
+ /* K16 */ be_nested_str_weak(tohex),
+ /* K17 */ be_nested_str_weak(commissioning_instance_eth),
+ /* K18 */ be_nested_str_weak(hostname_eth),
+ /* K19 */ be_nested_str_weak(add_service),
+ /* K20 */ be_nested_str_weak(_matterc),
+ /* K21 */ be_nested_str_weak(_udp),
+ /* K22 */ be_nested_str_weak(mdns_pase_eth),
+ /* K23 */ be_nested_str_weak(tasmota),
+ /* K24 */ be_nested_str_weak(log),
+ /* K25 */ be_nested_str_weak(MTR_X3A_X20announce_X20mDNS_X20on_X20_X25s_X20_X27_X25s_X27_X20ptr_X20to_X20_X60_X25s_X2Elocal_X60),
+ /* K26 */ be_nested_str_weak(eth),
+ /* K27 */ be_const_int(2),
+ /* K28 */ be_nested_str_weak(_L),
+ /* K29 */ be_nested_str_weak(MTR_X3A_X20adding_X20subtype_X3A_X20),
+ /* K30 */ be_const_int(3),
+ /* K31 */ be_nested_str_weak(add_subtype),
+ /* K32 */ be_nested_str_weak(_S),
+ /* K33 */ be_nested_str_weak(_V),
+ /* K34 */ be_nested_str_weak(_CM1),
+ /* K35 */ be_nested_str_weak(hostname_wifi),
+ /* K36 */ be_nested_str_weak(mdns_pase_wifi),
+ /* K37 */ be_nested_str_weak(MTR_X3A_X20starting_X20mDNS_X20on_X20_X25s_X20_X27_X25s_X27_X20ptr_X20to_X20_X60_X25s_X2Elocal_X60),
+ /* K38 */ be_nested_str_weak(wifi),
+ /* K39 */ be_nested_str_weak(MTR_X3A_X20Exception),
+ /* K40 */ be_nested_str_weak(_X7C),
+ }),
+ be_str_weak(mdns_announce_PASE),
+ &be_const_str_solidified,
+ ( &(const binstruction[236]) { /* code */
+ 0xA4060000, // 0000 IMPORT R1 K0
+ 0xA40A0200, // 0001 IMPORT R2 K1
+ 0x600C0013, // 0002 GETGBL R3 G19
+ 0x7C0C0000, // 0003 CALL R3 0
+ 0x60100008, // 0004 GETGBL R4 G8
+ 0x88140103, // 0005 GETMBR R5 R0 K3
+ 0x7C100200, // 0006 CALL R4 1
+ 0x00100904, // 0007 ADD R4 R4 K4
+ 0x60140008, // 0008 GETGBL R5 G8
+ 0x88180105, // 0009 GETMBR R6 R0 K5
+ 0x7C140200, // 000A CALL R5 1
+ 0x00100805, // 000B ADD R4 R4 R5
+ 0x980E0404, // 000C SETIDX R3 K2 R4
+ 0x88100107, // 000D GETMBR R4 R0 K7
+ 0x980E0C04, // 000E SETIDX R3 K6 R4
+ 0x980E1109, // 000F SETIDX R3 K8 K9
+ 0x980E150B, // 0010 SETIDX R3 K10 K11
+ 0x54121387, // 0011 LDINT R4 5000
+ 0x980E1804, // 0012 SETIDX R3 K12 R4
+ 0x5412012B, // 0013 LDINT R4 300
+ 0x980E1A04, // 0014 SETIDX R3 K13 R4
+ 0x8C10050F, // 0015 GETMET R4 R2 K15
+ 0x541A0007, // 0016 LDINT R6 8
+ 0x7C100400, // 0017 CALL R4 2
+ 0x8C100910, // 0018 GETMET R4 R4 K16
+ 0x7C100200, // 0019 CALL R4 1
+ 0x90021C04, // 001A SETMBR R0 K14 R4
+ 0x8C10050F, // 001B GETMET R4 R2 K15
+ 0x541A0007, // 001C LDINT R6 8
+ 0x7C100400, // 001D CALL R4 2
+ 0x8C100910, // 001E GETMET R4 R4 K16
+ 0x7C100200, // 001F CALL R4 1
+ 0x90022204, // 0020 SETMBR R0 K17 R4
+ 0xA80200B7, // 0021 EXBLK 0 #00DA
+ 0x88100112, // 0022 GETMBR R4 R0 K18
+ 0x78120058, // 0023 JMPF R4 #007D
+ 0x8C100313, // 0024 GETMET R4 R1 K19
+ 0x58180014, // 0025 LDCONST R6 K20
+ 0x581C0015, // 0026 LDCONST R7 K21
+ 0x542215A3, // 0027 LDINT R8 5540
+ 0x5C240600, // 0028 MOVE R9 R3
+ 0x88280111, // 0029 GETMBR R10 R0 K17
+ 0x882C0112, // 002A GETMBR R11 R0 K18
+ 0x7C100E00, // 002B CALL R4 7
+ 0x50100200, // 002C LDBOOL R4 1 0
+ 0x90022C04, // 002D SETMBR R0 K22 R4
+ 0xB8122E00, // 002E GETNGBL R4 K23
+ 0x8C100918, // 002F GETMET R4 R4 K24
+ 0x60180018, // 0030 GETGBL R6 G24
+ 0x581C0019, // 0031 LDCONST R7 K25
+ 0x5820001A, // 0032 LDCONST R8 K26
+ 0x88240111, // 0033 GETMBR R9 R0 K17
+ 0x88280112, // 0034 GETMBR R10 R0 K18
+ 0x7C180800, // 0035 CALL R6 4
+ 0x581C001B, // 0036 LDCONST R7 K27
+ 0x7C100600, // 0037 CALL R4 3
+ 0x60100008, // 0038 GETGBL R4 G8
+ 0x88140107, // 0039 GETMBR R5 R0 K7
+ 0x541A0FFE, // 003A LDINT R6 4095
+ 0x2C140A06, // 003B AND R5 R5 R6
+ 0x7C100200, // 003C CALL R4 1
+ 0x00123804, // 003D ADD R4 K28 R4
+ 0xB8162E00, // 003E GETNGBL R5 K23
+ 0x8C140B18, // 003F GETMET R5 R5 K24
+ 0x001E3A04, // 0040 ADD R7 K29 R4
+ 0x5820001E, // 0041 LDCONST R8 K30
+ 0x7C140600, // 0042 CALL R5 3
+ 0x8C14031F, // 0043 GETMET R5 R1 K31
+ 0x581C0014, // 0044 LDCONST R7 K20
+ 0x58200015, // 0045 LDCONST R8 K21
+ 0x88240111, // 0046 GETMBR R9 R0 K17
+ 0x88280112, // 0047 GETMBR R10 R0 K18
+ 0x5C2C0800, // 0048 MOVE R11 R4
+ 0x7C140C00, // 0049 CALL R5 6
+ 0x60140008, // 004A GETGBL R5 G8
+ 0x88180107, // 004B GETMBR R6 R0 K7
+ 0x541E0EFF, // 004C LDINT R7 3840
+ 0x2C180C07, // 004D AND R6 R6 R7
+ 0x541E0007, // 004E LDINT R7 8
+ 0x3C180C07, // 004F SHR R6 R6 R7
+ 0x7C140200, // 0050 CALL R5 1
+ 0x00164005, // 0051 ADD R5 K32 R5
+ 0x5C100A00, // 0052 MOVE R4 R5
+ 0xB8162E00, // 0053 GETNGBL R5 K23
+ 0x8C140B18, // 0054 GETMET R5 R5 K24
+ 0x001E3A04, // 0055 ADD R7 K29 R4
+ 0x5820001E, // 0056 LDCONST R8 K30
+ 0x7C140600, // 0057 CALL R5 3
+ 0x8C14031F, // 0058 GETMET R5 R1 K31
+ 0x581C0014, // 0059 LDCONST R7 K20
+ 0x58200015, // 005A LDCONST R8 K21
+ 0x88240111, // 005B GETMBR R9 R0 K17
+ 0x88280112, // 005C GETMBR R10 R0 K18
+ 0x5C2C0800, // 005D MOVE R11 R4
+ 0x7C140C00, // 005E CALL R5 6
+ 0x60140008, // 005F GETGBL R5 G8
+ 0x88180103, // 0060 GETMBR R6 R0 K3
+ 0x7C140200, // 0061 CALL R5 1
+ 0x00164205, // 0062 ADD R5 K33 R5
+ 0x5C100A00, // 0063 MOVE R4 R5
+ 0xB8162E00, // 0064 GETNGBL R5 K23
+ 0x8C140B18, // 0065 GETMET R5 R5 K24
+ 0x001E3A04, // 0066 ADD R7 K29 R4
+ 0x5820001E, // 0067 LDCONST R8 K30
+ 0x7C140600, // 0068 CALL R5 3
+ 0x8C14031F, // 0069 GETMET R5 R1 K31
+ 0x581C0014, // 006A LDCONST R7 K20
+ 0x58200015, // 006B LDCONST R8 K21
+ 0x88240111, // 006C GETMBR R9 R0 K17
+ 0x88280112, // 006D GETMBR R10 R0 K18
+ 0x5C2C0800, // 006E MOVE R11 R4
+ 0x7C140C00, // 006F CALL R5 6
+ 0x58100022, // 0070 LDCONST R4 K34
+ 0xB8162E00, // 0071 GETNGBL R5 K23
+ 0x8C140B18, // 0072 GETMET R5 R5 K24
+ 0x001E3A04, // 0073 ADD R7 K29 R4
+ 0x5820001E, // 0074 LDCONST R8 K30
+ 0x7C140600, // 0075 CALL R5 3
+ 0x8C14031F, // 0076 GETMET R5 R1 K31
+ 0x581C0014, // 0077 LDCONST R7 K20
+ 0x58200015, // 0078 LDCONST R8 K21
+ 0x88240111, // 0079 GETMBR R9 R0 K17
+ 0x88280112, // 007A GETMBR R10 R0 K18
+ 0x5C2C0800, // 007B MOVE R11 R4
+ 0x7C140C00, // 007C CALL R5 6
+ 0x88100123, // 007D GETMBR R4 R0 K35
+ 0x78120058, // 007E JMPF R4 #00D8
+ 0x8C100313, // 007F GETMET R4 R1 K19
+ 0x58180014, // 0080 LDCONST R6 K20
+ 0x581C0015, // 0081 LDCONST R7 K21
+ 0x542215A3, // 0082 LDINT R8 5540
+ 0x5C240600, // 0083 MOVE R9 R3
+ 0x8828010E, // 0084 GETMBR R10 R0 K14
+ 0x882C0123, // 0085 GETMBR R11 R0 K35
+ 0x7C100E00, // 0086 CALL R4 7
+ 0x50100200, // 0087 LDBOOL R4 1 0
+ 0x90024804, // 0088 SETMBR R0 K36 R4
+ 0xB8122E00, // 0089 GETNGBL R4 K23
+ 0x8C100918, // 008A GETMET R4 R4 K24
+ 0x60180018, // 008B GETGBL R6 G24
+ 0x581C0025, // 008C LDCONST R7 K37
+ 0x58200026, // 008D LDCONST R8 K38
+ 0x8824010E, // 008E GETMBR R9 R0 K14
+ 0x88280123, // 008F GETMBR R10 R0 K35
+ 0x7C180800, // 0090 CALL R6 4
+ 0x581C001E, // 0091 LDCONST R7 K30
+ 0x7C100600, // 0092 CALL R4 3
+ 0x60100008, // 0093 GETGBL R4 G8
+ 0x88140107, // 0094 GETMBR R5 R0 K7
+ 0x541A0FFE, // 0095 LDINT R6 4095
+ 0x2C140A06, // 0096 AND R5 R5 R6
+ 0x7C100200, // 0097 CALL R4 1
+ 0x00123804, // 0098 ADD R4 K28 R4
+ 0xB8162E00, // 0099 GETNGBL R5 K23
+ 0x8C140B18, // 009A GETMET R5 R5 K24
+ 0x001E3A04, // 009B ADD R7 K29 R4
+ 0x5820001E, // 009C LDCONST R8 K30
+ 0x7C140600, // 009D CALL R5 3
+ 0x8C14031F, // 009E GETMET R5 R1 K31
+ 0x581C0014, // 009F LDCONST R7 K20
+ 0x58200015, // 00A0 LDCONST R8 K21
+ 0x8824010E, // 00A1 GETMBR R9 R0 K14
+ 0x88280123, // 00A2 GETMBR R10 R0 K35
+ 0x5C2C0800, // 00A3 MOVE R11 R4
+ 0x7C140C00, // 00A4 CALL R5 6
+ 0x60140008, // 00A5 GETGBL R5 G8
+ 0x88180107, // 00A6 GETMBR R6 R0 K7
+ 0x541E0EFF, // 00A7 LDINT R7 3840
+ 0x2C180C07, // 00A8 AND R6 R6 R7
+ 0x541E0007, // 00A9 LDINT R7 8
+ 0x3C180C07, // 00AA SHR R6 R6 R7
+ 0x7C140200, // 00AB CALL R5 1
+ 0x00164005, // 00AC ADD R5 K32 R5
+ 0x5C100A00, // 00AD MOVE R4 R5
+ 0xB8162E00, // 00AE GETNGBL R5 K23
+ 0x8C140B18, // 00AF GETMET R5 R5 K24
+ 0x001E3A04, // 00B0 ADD R7 K29 R4
+ 0x5820001E, // 00B1 LDCONST R8 K30
+ 0x7C140600, // 00B2 CALL R5 3
+ 0x8C14031F, // 00B3 GETMET R5 R1 K31
+ 0x581C0014, // 00B4 LDCONST R7 K20
+ 0x58200015, // 00B5 LDCONST R8 K21
+ 0x8824010E, // 00B6 GETMBR R9 R0 K14
+ 0x88280123, // 00B7 GETMBR R10 R0 K35
+ 0x5C2C0800, // 00B8 MOVE R11 R4
+ 0x7C140C00, // 00B9 CALL R5 6
+ 0x60140008, // 00BA GETGBL R5 G8
+ 0x88180103, // 00BB GETMBR R6 R0 K3
+ 0x7C140200, // 00BC CALL R5 1
+ 0x00164205, // 00BD ADD R5 K33 R5
+ 0x5C100A00, // 00BE MOVE R4 R5
+ 0xB8162E00, // 00BF GETNGBL R5 K23
+ 0x8C140B18, // 00C0 GETMET R5 R5 K24
+ 0x001E3A04, // 00C1 ADD R7 K29 R4
+ 0x5820001E, // 00C2 LDCONST R8 K30
+ 0x7C140600, // 00C3 CALL R5 3
+ 0x8C14031F, // 00C4 GETMET R5 R1 K31
+ 0x581C0014, // 00C5 LDCONST R7 K20
+ 0x58200015, // 00C6 LDCONST R8 K21
+ 0x8824010E, // 00C7 GETMBR R9 R0 K14
+ 0x88280123, // 00C8 GETMBR R10 R0 K35
+ 0x5C2C0800, // 00C9 MOVE R11 R4
+ 0x7C140C00, // 00CA CALL R5 6
+ 0x58100022, // 00CB LDCONST R4 K34
+ 0xB8162E00, // 00CC GETNGBL R5 K23
+ 0x8C140B18, // 00CD GETMET R5 R5 K24
+ 0x001E3A04, // 00CE ADD R7 K29 R4
+ 0x5820001E, // 00CF LDCONST R8 K30
+ 0x7C140600, // 00D0 CALL R5 3
+ 0x8C14031F, // 00D1 GETMET R5 R1 K31
+ 0x581C0014, // 00D2 LDCONST R7 K20
+ 0x58200015, // 00D3 LDCONST R8 K21
+ 0x8824010E, // 00D4 GETMBR R9 R0 K14
+ 0x88280123, // 00D5 GETMBR R10 R0 K35
+ 0x5C2C0800, // 00D6 MOVE R11 R4
+ 0x7C140C00, // 00D7 CALL R5 6
+ 0xA8040001, // 00D8 EXBLK 1 1
+ 0x70020010, // 00D9 JMP #00EB
+ 0xAC100002, // 00DA CATCH R4 0 2
+ 0x7002000D, // 00DB JMP #00EA
+ 0xB81A2E00, // 00DC GETNGBL R6 K23
+ 0x8C180D18, // 00DD GETMET R6 R6 K24
+ 0x60200008, // 00DE GETGBL R8 G8
+ 0x5C240800, // 00DF MOVE R9 R4
+ 0x7C200200, // 00E0 CALL R8 1
+ 0x00224E08, // 00E1 ADD R8 K39 R8
+ 0x00201128, // 00E2 ADD R8 R8 K40
+ 0x60240008, // 00E3 GETGBL R9 G8
+ 0x5C280A00, // 00E4 MOVE R10 R5
+ 0x7C240200, // 00E5 CALL R9 1
+ 0x00201009, // 00E6 ADD R8 R8 R9
+ 0x5824001B, // 00E7 LDCONST R9 K27
+ 0x7C180600, // 00E8 CALL R6 3
+ 0x70020000, // 00E9 JMP #00EB
+ 0xB0080000, // 00EA RAISE 2 R0 R0
+ 0x80000000, // 00EB RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: clean_remotes
+********************************************************************/
+be_local_closure(Matter_Device_clean_remotes, /* name */
+ be_nested_proto(
+ 10, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[18]) { /* constants */
+ /* K0 */ be_nested_str_weak(introspect),
+ /* K1 */ be_nested_str_weak(http_remotes),
+ /* K2 */ be_const_int(0),
+ /* K3 */ be_nested_str_weak(stop_iteration),
+ /* K4 */ be_nested_str_weak(plugins),
+ /* K5 */ be_nested_str_weak(get),
+ /* K6 */ be_nested_str_weak(http_remote),
+ /* K7 */ be_nested_str_weak(find),
+ /* K8 */ be_const_int(1),
+ /* K9 */ be_nested_str_weak(keys),
+ /* K10 */ be_nested_str_weak(push),
+ /* K11 */ be_nested_str_weak(tasmota),
+ /* K12 */ be_nested_str_weak(log),
+ /* K13 */ be_nested_str_weak(MTR_X3A_X20remove_X20unused_X20remote_X3A_X20),
+ /* K14 */ be_nested_str_weak(addr),
+ /* K15 */ be_const_int(3),
+ /* K16 */ be_nested_str_weak(close),
+ /* K17 */ be_nested_str_weak(remove),
+ }),
+ be_str_weak(clean_remotes),
+ &be_const_str_solidified,
+ ( &(const binstruction[81]) { /* code */
+ 0xA4060000, // 0000 IMPORT R1 K0
+ 0x88080101, // 0001 GETMBR R2 R0 K1
+ 0x780A004C, // 0002 JMPF R2 #0050
+ 0x60080013, // 0003 GETGBL R2 G19
+ 0x7C080000, // 0004 CALL R2 0
+ 0x600C0010, // 0005 GETGBL R3 G16
+ 0x88100101, // 0006 GETMBR R4 R0 K1
+ 0x7C0C0200, // 0007 CALL R3 1
+ 0xA8020003, // 0008 EXBLK 0 #000D
+ 0x5C100600, // 0009 MOVE R4 R3
+ 0x7C100000, // 000A CALL R4 0
+ 0x98080902, // 000B SETIDX R2 R4 K2
+ 0x7001FFFB, // 000C JMP #0009
+ 0x580C0003, // 000D LDCONST R3 K3
+ 0xAC0C0200, // 000E CATCH R3 1 0
+ 0xB0080000, // 000F RAISE 2 R0 R0
+ 0x600C0010, // 0010 GETGBL R3 G16
+ 0x88100104, // 0011 GETMBR R4 R0 K4
+ 0x7C0C0200, // 0012 CALL R3 1
+ 0xA802000F, // 0013 EXBLK 0 #0024
+ 0x5C100600, // 0014 MOVE R4 R3
+ 0x7C100000, // 0015 CALL R4 0
+ 0x8C140305, // 0016 GETMET R5 R1 K5
+ 0x5C1C0800, // 0017 MOVE R7 R4
+ 0x58200006, // 0018 LDCONST R8 K6
+ 0x7C140600, // 0019 CALL R5 3
+ 0x4C180000, // 001A LDNIL R6
+ 0x20180A06, // 001B NE R6 R5 R6
+ 0x781A0005, // 001C JMPF R6 #0023
+ 0x8C180507, // 001D GETMET R6 R2 K7
+ 0x5C200A00, // 001E MOVE R8 R5
+ 0x58240002, // 001F LDCONST R9 K2
+ 0x7C180600, // 0020 CALL R6 3
+ 0x00180D08, // 0021 ADD R6 R6 K8
+ 0x98080A06, // 0022 SETIDX R2 R5 R6
+ 0x7001FFEF, // 0023 JMP #0014
+ 0x580C0003, // 0024 LDCONST R3 K3
+ 0xAC0C0200, // 0025 CATCH R3 1 0
+ 0xB0080000, // 0026 RAISE 2 R0 R0
+ 0x600C0012, // 0027 GETGBL R3 G18
+ 0x7C0C0000, // 0028 CALL R3 0
+ 0x60100010, // 0029 GETGBL R4 G16
+ 0x8C140509, // 002A GETMET R5 R2 K9
+ 0x7C140200, // 002B CALL R5 1
+ 0x7C100200, // 002C CALL R4 1
+ 0xA8020008, // 002D EXBLK 0 #0037
+ 0x5C140800, // 002E MOVE R5 R4
+ 0x7C140000, // 002F CALL R5 0
+ 0x94180405, // 0030 GETIDX R6 R2 R5
+ 0x1C180D02, // 0031 EQ R6 R6 K2
+ 0x781A0002, // 0032 JMPF R6 #0036
+ 0x8C18070A, // 0033 GETMET R6 R3 K10
+ 0x5C200A00, // 0034 MOVE R8 R5
+ 0x7C180400, // 0035 CALL R6 2
+ 0x7001FFF6, // 0036 JMP #002E
+ 0x58100003, // 0037 LDCONST R4 K3
+ 0xAC100200, // 0038 CATCH R4 1 0
+ 0xB0080000, // 0039 RAISE 2 R0 R0
+ 0x60100010, // 003A GETGBL R4 G16
+ 0x5C140600, // 003B MOVE R5 R3
+ 0x7C100200, // 003C CALL R4 1
+ 0xA802000E, // 003D EXBLK 0 #004D
+ 0x5C140800, // 003E MOVE R5 R4
+ 0x7C140000, // 003F CALL R5 0
+ 0xB81A1600, // 0040 GETNGBL R6 K11
+ 0x8C180D0C, // 0041 GETMET R6 R6 K12
+ 0x88200B0E, // 0042 GETMBR R8 R5 K14
+ 0x00221A08, // 0043 ADD R8 K13 R8
+ 0x5824000F, // 0044 LDCONST R9 K15
+ 0x7C180600, // 0045 CALL R6 3
+ 0x8C180B10, // 0046 GETMET R6 R5 K16
+ 0x7C180200, // 0047 CALL R6 1
+ 0x88180101, // 0048 GETMBR R6 R0 K1
+ 0x8C180D11, // 0049 GETMET R6 R6 K17
+ 0x88200B0E, // 004A GETMBR R8 R5 K14
+ 0x7C180400, // 004B CALL R6 2
+ 0x7001FFF0, // 004C JMP #003E
+ 0x58100003, // 004D LDCONST R4 K3
+ 0xAC100200, // 004E CATCH R4 1 0
+ 0xB0080000, // 004F RAISE 2 R0 R0
+ 0x80000000, // 0050 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: every_250ms
+********************************************************************/
+be_local_closure(Matter_Device_every_250ms, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 6]) { /* constants */
+ /* K0 */ be_nested_str_weak(message_handler),
+ /* K1 */ be_nested_str_weak(every_250ms),
+ /* K2 */ be_nested_str_weak(read_sensors_scheduler),
+ /* K3 */ be_const_int(0),
+ /* K4 */ be_nested_str_weak(plugins),
+ /* K5 */ be_const_int(1),
+ }),
+ be_str_weak(every_250ms),
+ &be_const_str_solidified,
+ ( &(const binstruction[18]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x8C040301, // 0001 GETMET R1 R1 K1
+ 0x7C040200, // 0002 CALL R1 1
+ 0x8C040102, // 0003 GETMET R1 R0 K2
+ 0x7C040200, // 0004 CALL R1 1
+ 0x58040003, // 0005 LDCONST R1 K3
+ 0x6008000C, // 0006 GETGBL R2 G12
+ 0x880C0104, // 0007 GETMBR R3 R0 K4
+ 0x7C080200, // 0008 CALL R2 1
+ 0x14080202, // 0009 LT R2 R1 R2
+ 0x780A0005, // 000A JMPF R2 #0011
+ 0x88080104, // 000B GETMBR R2 R0 K4
+ 0x94080401, // 000C GETIDX R2 R2 R1
+ 0x8C080501, // 000D GETMET R2 R2 K1
+ 0x7C080200, // 000E CALL R2 1
+ 0x00040305, // 000F ADD R1 R1 K5
+ 0x7001FFF4, // 0010 JMP #0006
+ 0x80000000, // 0011 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: read_sensors_scheduler
+********************************************************************/
+be_local_closure(Matter_Device_read_sensors_scheduler, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 7]) { /* constants */
+ /* K0 */ be_nested_str_weak(probe_sensor_time),
+ /* K1 */ be_nested_str_weak(probe_sensor_timestamp),
+ /* K2 */ be_const_int(0),
+ /* K3 */ be_nested_str_weak(tasmota),
+ /* K4 */ be_nested_str_weak(time_reached),
+ /* K5 */ be_nested_str_weak(_trigger_read_sensors),
+ /* K6 */ be_nested_str_weak(millis),
+ }),
+ be_str_weak(read_sensors_scheduler),
+ &be_const_str_solidified,
+ ( &(const binstruction[21]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x4C080000, // 0001 LDNIL R2
+ 0x1C040202, // 0002 EQ R1 R1 R2
+ 0x78060000, // 0003 JMPF R1 #0005
+ 0x80000200, // 0004 RET 0
+ 0x88040101, // 0005 GETMBR R1 R0 K1
+ 0x1C040302, // 0006 EQ R1 R1 K2
+ 0x74060004, // 0007 JMPT R1 #000D
+ 0xB8060600, // 0008 GETNGBL R1 K3
+ 0x8C040304, // 0009 GETMET R1 R1 K4
+ 0x880C0101, // 000A GETMBR R3 R0 K1
+ 0x7C040400, // 000B CALL R1 2
+ 0x78060006, // 000C JMPF R1 #0014
+ 0x8C040105, // 000D GETMET R1 R0 K5
+ 0x7C040200, // 000E CALL R1 1
+ 0xB8060600, // 000F GETNGBL R1 K3
+ 0x8C040306, // 0010 GETMET R1 R1 K6
+ 0x880C0100, // 0011 GETMBR R3 R0 K0
+ 0x7C040400, // 0012 CALL R1 2
+ 0x90020201, // 0013 SETMBR R0 K1 R1
+ 0x80000000, // 0014 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: mdns_announce_op_discovery
+********************************************************************/
+be_local_closure(Matter_Device_mdns_announce_op_discovery, /* name */
+ be_nested_proto(
+ 14, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[27]) { /* constants */
+ /* K0 */ be_nested_str_weak(mdns),
+ /* K1 */ be_nested_str_weak(get_device_id),
+ /* K2 */ be_nested_str_weak(copy),
+ /* K3 */ be_nested_str_weak(reverse),
+ /* K4 */ be_nested_str_weak(get_fabric_compressed),
+ /* K5 */ be_nested_str_weak(tohex),
+ /* K6 */ be_nested_str_weak(_X2D),
+ /* K7 */ be_nested_str_weak(tasmota),
+ /* K8 */ be_nested_str_weak(log),
+ /* K9 */ be_nested_str_weak(MTR_X3A_X20Operational_X20Discovery_X20node_X20_X3D_X20),
+ /* K10 */ be_const_int(3),
+ /* K11 */ be_nested_str_weak(eth),
+ /* K12 */ be_nested_str_weak(find),
+ /* K13 */ be_nested_str_weak(up),
+ /* K14 */ be_nested_str_weak(MTR_X3A_X20adding_X20mDNS_X20on_X20_X25s_X20_X27_X25s_X27_X20ptr_X20to_X20_X60_X25s_X2Elocal_X60),
+ /* K15 */ be_nested_str_weak(hostname_eth),
+ /* K16 */ be_nested_str_weak(add_service),
+ /* K17 */ be_nested_str_weak(_matter),
+ /* K18 */ be_nested_str_weak(_tcp),
+ /* K19 */ be_nested_str_weak(_I),
+ /* K20 */ be_nested_str_weak(MTR_X3A_X20adding_X20subtype_X3A_X20),
+ /* K21 */ be_nested_str_weak(add_subtype),
+ /* K22 */ be_nested_str_weak(wifi),
+ /* K23 */ be_nested_str_weak(hostname_wifi),
+ /* K24 */ be_nested_str_weak(MTR_X3A_X20Exception),
+ /* K25 */ be_nested_str_weak(_X7C),
+ /* K26 */ be_const_int(2),
+ }),
+ be_str_weak(mdns_announce_op_discovery),
+ &be_const_str_solidified,
+ ( &(const binstruction[121]) { /* code */
+ 0xA40A0000, // 0000 IMPORT R2 K0
+ 0xA8020064, // 0001 EXBLK 0 #0067
+ 0x8C0C0301, // 0002 GETMET R3 R1 K1
+ 0x7C0C0200, // 0003 CALL R3 1
+ 0x8C0C0702, // 0004 GETMET R3 R3 K2
+ 0x7C0C0200, // 0005 CALL R3 1
+ 0x8C0C0703, // 0006 GETMET R3 R3 K3
+ 0x7C0C0200, // 0007 CALL R3 1
+ 0x8C100304, // 0008 GETMET R4 R1 K4
+ 0x7C100200, // 0009 CALL R4 1
+ 0x8C140905, // 000A GETMET R5 R4 K5
+ 0x7C140200, // 000B CALL R5 1
+ 0x00140B06, // 000C ADD R5 R5 K6
+ 0x8C180705, // 000D GETMET R6 R3 K5
+ 0x7C180200, // 000E CALL R6 1
+ 0x00140A06, // 000F ADD R5 R5 R6
+ 0xB81A0E00, // 0010 GETNGBL R6 K7
+ 0x8C180D08, // 0011 GETMET R6 R6 K8
+ 0x00221205, // 0012 ADD R8 K9 R5
+ 0x5824000A, // 0013 LDCONST R9 K10
+ 0x7C180600, // 0014 CALL R6 3
+ 0xB81A0E00, // 0015 GETNGBL R6 K7
+ 0x8C180D0B, // 0016 GETMET R6 R6 K11
+ 0x7C180200, // 0017 CALL R6 1
+ 0x8C180D0C, // 0018 GETMET R6 R6 K12
+ 0x5820000D, // 0019 LDCONST R8 K13
+ 0x7C180400, // 001A CALL R6 2
+ 0x781A0020, // 001B JMPF R6 #003D
+ 0xB81A0E00, // 001C GETNGBL R6 K7
+ 0x8C180D08, // 001D GETMET R6 R6 K8
+ 0x60200018, // 001E GETGBL R8 G24
+ 0x5824000E, // 001F LDCONST R9 K14
+ 0x5828000B, // 0020 LDCONST R10 K11
+ 0x5C2C0A00, // 0021 MOVE R11 R5
+ 0x8830010F, // 0022 GETMBR R12 R0 K15
+ 0x7C200800, // 0023 CALL R8 4
+ 0x5824000A, // 0024 LDCONST R9 K10
+ 0x7C180600, // 0025 CALL R6 3
+ 0x8C180510, // 0026 GETMET R6 R2 K16
+ 0x58200011, // 0027 LDCONST R8 K17
+ 0x58240012, // 0028 LDCONST R9 K18
+ 0x542A15A3, // 0029 LDINT R10 5540
+ 0x4C2C0000, // 002A LDNIL R11
+ 0x5C300A00, // 002B MOVE R12 R5
+ 0x8834010F, // 002C GETMBR R13 R0 K15
+ 0x7C180E00, // 002D CALL R6 7
+ 0x8C180905, // 002E GETMET R6 R4 K5
+ 0x7C180200, // 002F CALL R6 1
+ 0x001A2606, // 0030 ADD R6 K19 R6
+ 0xB81E0E00, // 0031 GETNGBL R7 K7
+ 0x8C1C0F08, // 0032 GETMET R7 R7 K8
+ 0x00262806, // 0033 ADD R9 K20 R6
+ 0x5828000A, // 0034 LDCONST R10 K10
+ 0x7C1C0600, // 0035 CALL R7 3
+ 0x8C1C0515, // 0036 GETMET R7 R2 K21
+ 0x58240011, // 0037 LDCONST R9 K17
+ 0x58280012, // 0038 LDCONST R10 K18
+ 0x5C2C0A00, // 0039 MOVE R11 R5
+ 0x8830010F, // 003A GETMBR R12 R0 K15
+ 0x5C340C00, // 003B MOVE R13 R6
+ 0x7C1C0C00, // 003C CALL R7 6
+ 0xB81A0E00, // 003D GETNGBL R6 K7
+ 0x8C180D16, // 003E GETMET R6 R6 K22
+ 0x7C180200, // 003F CALL R6 1
+ 0x8C180D0C, // 0040 GETMET R6 R6 K12
+ 0x5820000D, // 0041 LDCONST R8 K13
+ 0x7C180400, // 0042 CALL R6 2
+ 0x781A0020, // 0043 JMPF R6 #0065
+ 0xB81A0E00, // 0044 GETNGBL R6 K7
+ 0x8C180D08, // 0045 GETMET R6 R6 K8
+ 0x60200018, // 0046 GETGBL R8 G24
+ 0x5824000E, // 0047 LDCONST R9 K14
+ 0x58280016, // 0048 LDCONST R10 K22
+ 0x5C2C0A00, // 0049 MOVE R11 R5
+ 0x88300117, // 004A GETMBR R12 R0 K23
+ 0x7C200800, // 004B CALL R8 4
+ 0x5824000A, // 004C LDCONST R9 K10
+ 0x7C180600, // 004D CALL R6 3
+ 0x8C180510, // 004E GETMET R6 R2 K16
+ 0x58200011, // 004F LDCONST R8 K17
+ 0x58240012, // 0050 LDCONST R9 K18
+ 0x542A15A3, // 0051 LDINT R10 5540
+ 0x4C2C0000, // 0052 LDNIL R11
+ 0x5C300A00, // 0053 MOVE R12 R5
+ 0x88340117, // 0054 GETMBR R13 R0 K23
+ 0x7C180E00, // 0055 CALL R6 7
+ 0x8C180905, // 0056 GETMET R6 R4 K5
+ 0x7C180200, // 0057 CALL R6 1
+ 0x001A2606, // 0058 ADD R6 K19 R6
+ 0xB81E0E00, // 0059 GETNGBL R7 K7
+ 0x8C1C0F08, // 005A GETMET R7 R7 K8
+ 0x00262806, // 005B ADD R9 K20 R6
+ 0x5828000A, // 005C LDCONST R10 K10
+ 0x7C1C0600, // 005D CALL R7 3
+ 0x8C1C0515, // 005E GETMET R7 R2 K21
+ 0x58240011, // 005F LDCONST R9 K17
+ 0x58280012, // 0060 LDCONST R10 K18
+ 0x5C2C0A00, // 0061 MOVE R11 R5
+ 0x88300117, // 0062 GETMBR R12 R0 K23
+ 0x5C340C00, // 0063 MOVE R13 R6
+ 0x7C1C0C00, // 0064 CALL R7 6
+ 0xA8040001, // 0065 EXBLK 1 1
+ 0x70020010, // 0066 JMP #0078
+ 0xAC0C0002, // 0067 CATCH R3 0 2
+ 0x7002000D, // 0068 JMP #0077
+ 0xB8160E00, // 0069 GETNGBL R5 K7
+ 0x8C140B08, // 006A GETMET R5 R5 K8
+ 0x601C0008, // 006B GETGBL R7 G8
+ 0x5C200600, // 006C MOVE R8 R3
+ 0x7C1C0200, // 006D CALL R7 1
+ 0x001E3007, // 006E ADD R7 K24 R7
+ 0x001C0F19, // 006F ADD R7 R7 K25
+ 0x60200008, // 0070 GETGBL R8 G8
+ 0x5C240800, // 0071 MOVE R9 R4
+ 0x7C200200, // 0072 CALL R8 1
+ 0x001C0E08, // 0073 ADD R7 R7 R8
+ 0x5820001A, // 0074 LDCONST R8 K26
+ 0x7C140600, // 0075 CALL R5 3
+ 0x70020000, // 0076 JMP #0078
+ 0xB0080000, // 0077 RAISE 2 R0 R0
+ 0x80000000, // 0078 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: MtrJoin
+********************************************************************/
+be_local_closure(Matter_Device_MtrJoin, /* name */
+ be_nested_proto(
+ 8, /* nstack */
+ 5, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(start_root_basic_commissioning),
+ /* K1 */ be_nested_str_weak(stop_basic_commissioning),
+ /* K2 */ be_nested_str_weak(tasmota),
+ /* K3 */ be_nested_str_weak(resp_cmnd_done),
+ }),
+ be_str_weak(MtrJoin),
+ &be_const_str_solidified,
+ ( &(const binstruction[13]) { /* code */
+ 0x60140009, // 0000 GETGBL R5 G9
+ 0x5C180600, // 0001 MOVE R6 R3
+ 0x7C140200, // 0002 CALL R5 1
+ 0x78160002, // 0003 JMPF R5 #0007
+ 0x8C180100, // 0004 GETMET R6 R0 K0
+ 0x7C180200, // 0005 CALL R6 1
+ 0x70020001, // 0006 JMP #0009
+ 0x8C180101, // 0007 GETMET R6 R0 K1
+ 0x7C180200, // 0008 CALL R6 1
+ 0xB81A0400, // 0009 GETNGBL R6 K2
+ 0x8C180D03, // 000A GETMET R6 R6 K3
+ 0x7C180200, // 000B CALL R6 1
+ 0x80000000, // 000C RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: remove_fabric
+********************************************************************/
+be_local_closure(Matter_Device_remove_fabric, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[16]) { /* constants */
+ /* K0 */ be_nested_str_weak(tasmota),
+ /* K1 */ be_nested_str_weak(log),
+ /* K2 */ be_nested_str_weak(MTR_X3A_X20removing_X20fabric_X20),
+ /* K3 */ be_nested_str_weak(get_fabric_id),
+ /* K4 */ be_nested_str_weak(copy),
+ /* K5 */ be_nested_str_weak(reverse),
+ /* K6 */ be_nested_str_weak(tohex),
+ /* K7 */ be_const_int(2),
+ /* K8 */ be_nested_str_weak(message_handler),
+ /* K9 */ be_nested_str_weak(im),
+ /* K10 */ be_nested_str_weak(subs_shop),
+ /* K11 */ be_nested_str_weak(remove_by_fabric),
+ /* K12 */ be_nested_str_weak(mdns_remove_op_discovery),
+ /* K13 */ be_nested_str_weak(sessions),
+ /* K14 */ be_nested_str_weak(remove_fabric),
+ /* K15 */ be_nested_str_weak(save_fabrics),
+ }),
+ be_str_weak(remove_fabric),
+ &be_const_str_solidified,
+ ( &(const binstruction[33]) { /* code */
+ 0x4C080000, // 0000 LDNIL R2
+ 0x20080202, // 0001 NE R2 R1 R2
+ 0x780A0019, // 0002 JMPF R2 #001D
+ 0xB80A0000, // 0003 GETNGBL R2 K0
+ 0x8C080501, // 0004 GETMET R2 R2 K1
+ 0x8C100303, // 0005 GETMET R4 R1 K3
+ 0x7C100200, // 0006 CALL R4 1
+ 0x8C100904, // 0007 GETMET R4 R4 K4
+ 0x7C100200, // 0008 CALL R4 1
+ 0x8C100905, // 0009 GETMET R4 R4 K5
+ 0x7C100200, // 000A CALL R4 1
+ 0x8C100906, // 000B GETMET R4 R4 K6
+ 0x7C100200, // 000C CALL R4 1
+ 0x00120404, // 000D ADD R4 K2 R4
+ 0x58140007, // 000E LDCONST R5 K7
+ 0x7C080600, // 000F CALL R2 3
+ 0x88080108, // 0010 GETMBR R2 R0 K8
+ 0x88080509, // 0011 GETMBR R2 R2 K9
+ 0x8808050A, // 0012 GETMBR R2 R2 K10
+ 0x8C08050B, // 0013 GETMET R2 R2 K11
+ 0x5C100200, // 0014 MOVE R4 R1
+ 0x7C080400, // 0015 CALL R2 2
+ 0x8C08010C, // 0016 GETMET R2 R0 K12
+ 0x5C100200, // 0017 MOVE R4 R1
+ 0x7C080400, // 0018 CALL R2 2
+ 0x8808010D, // 0019 GETMBR R2 R0 K13
+ 0x8C08050E, // 001A GETMET R2 R2 K14
+ 0x5C100200, // 001B MOVE R4 R1
+ 0x7C080400, // 001C CALL R2 2
+ 0x8808010D, // 001D GETMBR R2 R0 K13
+ 0x8C08050F, // 001E GETMET R2 R2 K15
+ 0x7C080200, // 001F CALL R2 1
+ 0x80000000, // 0020 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: _compute_pbkdf
+********************************************************************/
+be_local_closure(Matter_Device__compute_pbkdf, /* name */
+ be_nested_proto(
+ 13, /* nstack */
+ 4, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[10]) { /* constants */
+ /* K0 */ be_nested_str_weak(crypto),
+ /* K1 */ be_nested_str_weak(add),
+ /* K2 */ be_nested_str_weak(PBKDF2_HMAC_SHA256),
+ /* K3 */ be_nested_str_weak(derive),
+ /* K4 */ be_const_int(0),
+ /* K5 */ be_nested_str_weak(root_w0),
+ /* K6 */ be_nested_str_weak(EC_P256),
+ /* K7 */ be_nested_str_weak(mod),
+ /* K8 */ be_nested_str_weak(root_L),
+ /* K9 */ be_nested_str_weak(public_key),
+ }),
+ be_str_weak(_compute_pbkdf),
+ &be_const_str_solidified,
+ ( &(const binstruction[40]) { /* code */
+ 0xA4120000, // 0000 IMPORT R4 K0
+ 0x60140015, // 0001 GETGBL R5 G21
+ 0x7C140000, // 0002 CALL R5 0
+ 0x8C140B01, // 0003 GETMET R5 R5 K1
+ 0x5C1C0200, // 0004 MOVE R7 R1
+ 0x54220003, // 0005 LDINT R8 4
+ 0x7C140600, // 0006 CALL R5 3
+ 0x8C180902, // 0007 GETMET R6 R4 K2
+ 0x7C180200, // 0008 CALL R6 1
+ 0x8C180D03, // 0009 GETMET R6 R6 K3
+ 0x5C200A00, // 000A MOVE R8 R5
+ 0x5C240600, // 000B MOVE R9 R3
+ 0x5C280400, // 000C MOVE R10 R2
+ 0x542E004F, // 000D LDINT R11 80
+ 0x7C180A00, // 000E CALL R6 5
+ 0x541E0026, // 000F LDINT R7 39
+ 0x401E0807, // 0010 CONNECT R7 K4 R7
+ 0x941C0C07, // 0011 GETIDX R7 R6 R7
+ 0x54220027, // 0012 LDINT R8 40
+ 0x5426004E, // 0013 LDINT R9 79
+ 0x40201009, // 0014 CONNECT R8 R8 R9
+ 0x94200C08, // 0015 GETIDX R8 R6 R8
+ 0x8C240906, // 0016 GETMET R9 R4 K6
+ 0x7C240200, // 0017 CALL R9 1
+ 0x8C241307, // 0018 GETMET R9 R9 K7
+ 0x5C2C0E00, // 0019 MOVE R11 R7
+ 0x7C240400, // 001A CALL R9 2
+ 0x90020A09, // 001B SETMBR R0 K5 R9
+ 0x8C240906, // 001C GETMET R9 R4 K6
+ 0x7C240200, // 001D CALL R9 1
+ 0x8C241307, // 001E GETMET R9 R9 K7
+ 0x5C2C1000, // 001F MOVE R11 R8
+ 0x7C240400, // 0020 CALL R9 2
+ 0x8C280906, // 0021 GETMET R10 R4 K6
+ 0x7C280200, // 0022 CALL R10 1
+ 0x8C281509, // 0023 GETMET R10 R10 K9
+ 0x5C301200, // 0024 MOVE R12 R9
+ 0x7C280400, // 0025 CALL R10 2
+ 0x9002100A, // 0026 SETMBR R0 K8 R10
+ 0x80000000, // 0027 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: _init_basic_commissioning
+********************************************************************/
+be_local_closure(Matter_Device__init_basic_commissioning, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(sessions),
+ /* K1 */ be_nested_str_weak(count_active_fabrics),
+ /* K2 */ be_const_int(0),
+ /* K3 */ be_nested_str_weak(start_root_basic_commissioning),
+ }),
+ be_str_weak(_init_basic_commissioning),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 8]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x8C040301, // 0001 GETMET R1 R1 K1
+ 0x7C040200, // 0002 CALL R1 1
+ 0x1C040302, // 0003 EQ R1 R1 K2
+ 0x78060001, // 0004 JMPF R1 #0007
+ 0x8C040103, // 0005 GETMET R1 R0 K3
+ 0x7C040200, // 0006 CALL R1 1
+ 0x80000000, // 0007 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: msg_received
+********************************************************************/
+be_local_closure(Matter_Device_msg_received, /* name */
+ be_nested_proto(
+ 9, /* nstack */
+ 4, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(message_handler),
+ /* K1 */ be_nested_str_weak(msg_received),
+ }),
+ be_str_weak(msg_received),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 7]) { /* code */
+ 0x88100100, // 0000 GETMBR R4 R0 K0
+ 0x8C100901, // 0001 GETMET R4 R4 K1
+ 0x5C180200, // 0002 MOVE R6 R1
+ 0x5C1C0400, // 0003 MOVE R7 R2
+ 0x5C200600, // 0004 MOVE R8 R3
+ 0x7C100800, // 0005 CALL R4 4
+ 0x80040800, // 0006 RET 1 R4
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: register_commands
+********************************************************************/
+be_local_closure(Matter_Device_register_commands, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 1, /* has sup protos */
+ ( &(const struct bproto*[ 3]) {
+ be_nested_proto(
+ 10, /* nstack */
+ 4, /* argc */
+ 0, /* varg */
+ 1, /* has upvals */
+ ( &(const bupvaldesc[ 1]) { /* upvals */
+ be_local_const_upval(1, 0),
+ }),
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(MtrJoin),
+ }),
+ be_str_weak(_X3Clambda_X3E),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 8]) { /* code */
+ 0x68100000, // 0000 GETUPV R4 U0
+ 0x8C100900, // 0001 GETMET R4 R4 K0
+ 0x5C180000, // 0002 MOVE R6 R0
+ 0x5C1C0200, // 0003 MOVE R7 R1
+ 0x5C200400, // 0004 MOVE R8 R2
+ 0x5C240600, // 0005 MOVE R9 R3
+ 0x7C100A00, // 0006 CALL R4 5
+ 0x80040800, // 0007 RET 1 R4
+ })
+ ),
+ be_nested_proto(
+ 10, /* nstack */
+ 4, /* argc */
+ 0, /* varg */
+ 1, /* has upvals */
+ ( &(const bupvaldesc[ 1]) { /* upvals */
+ be_local_const_upval(1, 0),
+ }),
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(MtrUpdate),
+ }),
+ be_str_weak(_X3Clambda_X3E),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 8]) { /* code */
+ 0x68100000, // 0000 GETUPV R4 U0
+ 0x8C100900, // 0001 GETMET R4 R4 K0
+ 0x5C180000, // 0002 MOVE R6 R0
+ 0x5C1C0200, // 0003 MOVE R7 R1
+ 0x5C200400, // 0004 MOVE R8 R2
+ 0x5C240600, // 0005 MOVE R9 R3
+ 0x7C100A00, // 0006 CALL R4 5
+ 0x80040800, // 0007 RET 1 R4
+ })
+ ),
+ be_nested_proto(
+ 10, /* nstack */
+ 4, /* argc */
+ 0, /* varg */
+ 1, /* has upvals */
+ ( &(const bupvaldesc[ 1]) { /* upvals */
+ be_local_const_upval(1, 0),
+ }),
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(MtrInfo),
+ }),
+ be_str_weak(_X3Clambda_X3E),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 8]) { /* code */
+ 0x68100000, // 0000 GETUPV R4 U0
+ 0x8C100900, // 0001 GETMET R4 R4 K0
+ 0x5C180000, // 0002 MOVE R6 R0
+ 0x5C1C0200, // 0003 MOVE R7 R1
+ 0x5C200400, // 0004 MOVE R8 R2
+ 0x5C240600, // 0005 MOVE R9 R3
+ 0x7C100A00, // 0006 CALL R4 5
+ 0x80040800, // 0007 RET 1 R4
+ })
+ ),
+ }),
+ 1, /* has constants */
+ ( &(const bvalue[ 5]) { /* constants */
+ /* K0 */ be_nested_str_weak(tasmota),
+ /* K1 */ be_nested_str_weak(add_cmd),
+ /* K2 */ be_nested_str_weak(MtrJoin),
+ /* K3 */ be_nested_str_weak(MtrUpdate),
+ /* K4 */ be_nested_str_weak(MtrInfo),
+ }),
+ be_str_weak(register_commands),
+ &be_const_str_solidified,
+ ( &(const binstruction[17]) { /* code */
+ 0xB8060000, // 0000 GETNGBL R1 K0
+ 0x8C040301, // 0001 GETMET R1 R1 K1
+ 0x580C0002, // 0002 LDCONST R3 K2
+ 0x84100000, // 0003 CLOSURE R4 P0
+ 0x7C040600, // 0004 CALL R1 3
+ 0xB8060000, // 0005 GETNGBL R1 K0
+ 0x8C040301, // 0006 GETMET R1 R1 K1
+ 0x580C0003, // 0007 LDCONST R3 K3
+ 0x84100001, // 0008 CLOSURE R4 P1
+ 0x7C040600, // 0009 CALL R1 3
+ 0xB8060000, // 000A GETNGBL R1 K0
+ 0x8C040301, // 000B GETMET R1 R1 K1
+ 0x580C0004, // 000C LDCONST R3 K4
+ 0x84100002, // 000D CLOSURE R4 P2
+ 0x7C040600, // 000E CALL R1 3
+ 0xA0000000, // 000F CLOSE R0
+ 0x80000000, // 0010 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: is_commissioning_open
+********************************************************************/
+be_local_closure(Matter_Device_is_commissioning_open, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(commissioning_open),
+ }),
+ be_str_weak(is_commissioning_open),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 4]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x4C080000, // 0001 LDNIL R2
+ 0x20040202, // 0002 NE R1 R1 R2
+ 0x80040200, // 0003 RET 1 R1
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: event_fabrics_saved
+********************************************************************/
+be_local_closure(Matter_Device_event_fabrics_saved, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 5]) { /* constants */
+ /* K0 */ be_nested_str_weak(sessions),
+ /* K1 */ be_nested_str_weak(count_active_fabrics),
+ /* K2 */ be_const_int(0),
+ /* K3 */ be_nested_str_weak(plugins_persist),
+ /* K4 */ be_nested_str_weak(save_param),
+ }),
+ be_str_weak(event_fabrics_saved),
+ &be_const_str_solidified,
+ ( &(const binstruction[12]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x8C040301, // 0001 GETMET R1 R1 K1
+ 0x7C040200, // 0002 CALL R1 1
+ 0x24040302, // 0003 GT R1 R1 K2
+ 0x78060005, // 0004 JMPF R1 #000B
+ 0x88040103, // 0005 GETMBR R1 R0 K3
+ 0x74060003, // 0006 JMPT R1 #000B
+ 0x50040200, // 0007 LDBOOL R1 1 0
+ 0x90020601, // 0008 SETMBR R0 K3 R1
+ 0x8C040104, // 0009 GETMET R1 R0 K4
+ 0x7C040200, // 000A CALL R1 1
+ 0x80000000, // 000B RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: MtrUpdate
+********************************************************************/
+be_local_closure(Matter_Device_MtrUpdate, /* name */
+ be_nested_proto(
+ 18, /* nstack */
+ 5, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[25]) { /* constants */
+ /* K0 */ be_nested_str_weak(tasmota),
+ /* K1 */ be_nested_str_weak(resp_cmnd_str),
+ /* K2 */ be_nested_str_weak(Invalid_X20JSON),
+ /* K3 */ be_nested_str_weak(find_key_i),
+ /* K4 */ be_nested_str_weak(Ep),
+ /* K5 */ be_nested_str_weak(Name),
+ /* K6 */ be_const_int(0),
+ /* K7 */ be_nested_str_weak(Invalid_X20_X27Ep_X27_X20attribute),
+ /* K8 */ be_nested_str_weak(find_plugin_by_endpoint),
+ /* K9 */ be_nested_str_weak(remove),
+ /* K10 */ be_nested_str_weak(find_plugin_by_friendly_name),
+ /* K11 */ be_nested_str_weak(Invalid_X20Device),
+ /* K12 */ be_nested_str_weak(VIRTUAL),
+ /* K13 */ be_nested_str_weak(Device_X20is_X20not_X20virtual),
+ /* K14 */ be_nested_str_weak(consolidate_update_commands),
+ /* K15 */ be_nested_str_weak(keys),
+ /* K16 */ be_nested_str_weak(find_list_i),
+ /* K17 */ be_nested_str_weak(Invalid_X20attribute_X20_X27_X25s_X27),
+ /* K18 */ be_nested_str_weak(stop_iteration),
+ /* K19 */ be_nested_str_weak(update_virtual),
+ /* K20 */ be_nested_str_weak(state_json),
+ /* K21 */ be_nested_str_weak(_X7B_X22_X25s_X22_X3A_X25s_X7D),
+ /* K22 */ be_nested_str_weak(resp_cmnd),
+ /* K23 */ be_nested_str_weak(resp_cmnd_done),
+ /* K24 */ be_nested_str_weak(Missing_X20_X27Device_X27_X20attribute),
+ }),
+ be_str_weak(MtrUpdate),
+ &be_const_str_solidified,
+ ( &(const binstruction[126]) { /* code */
+ 0x4C140000, // 0000 LDNIL R5
+ 0x1C140805, // 0001 EQ R5 R4 R5
+ 0x78160004, // 0002 JMPF R5 #0008
+ 0xB8160000, // 0003 GETNGBL R5 K0
+ 0x8C140B01, // 0004 GETMET R5 R5 K1
+ 0x581C0002, // 0005 LDCONST R7 K2
+ 0x7C140400, // 0006 CALL R5 2
+ 0x80040A00, // 0007 RET 1 R5
+ 0xB8160000, // 0008 GETNGBL R5 K0
+ 0x8C140B03, // 0009 GETMET R5 R5 K3
+ 0x5C1C0800, // 000A MOVE R7 R4
+ 0x58200004, // 000B LDCONST R8 K4
+ 0x7C140600, // 000C CALL R5 3
+ 0xB81A0000, // 000D GETNGBL R6 K0
+ 0x8C180D03, // 000E GETMET R6 R6 K3
+ 0x5C200800, // 000F MOVE R8 R4
+ 0x58240005, // 0010 LDCONST R9 K5
+ 0x7C180600, // 0011 CALL R6 3
+ 0x74160000, // 0012 JMPT R5 #0014
+ 0x781A0064, // 0013 JMPF R6 #0079
+ 0x4C1C0000, // 0014 LDNIL R7
+ 0x78160010, // 0015 JMPF R5 #0027
+ 0x60200009, // 0016 GETGBL R8 G9
+ 0x94240805, // 0017 GETIDX R9 R4 R5
+ 0x7C200200, // 0018 CALL R8 1
+ 0x18241106, // 0019 LE R9 R8 K6
+ 0x78260004, // 001A JMPF R9 #0020
+ 0xB8260000, // 001B GETNGBL R9 K0
+ 0x8C241301, // 001C GETMET R9 R9 K1
+ 0x582C0007, // 001D LDCONST R11 K7
+ 0x7C240400, // 001E CALL R9 2
+ 0x80041200, // 001F RET 1 R9
+ 0x8C240108, // 0020 GETMET R9 R0 K8
+ 0x5C2C1000, // 0021 MOVE R11 R8
+ 0x7C240400, // 0022 CALL R9 2
+ 0x5C1C1200, // 0023 MOVE R7 R9
+ 0x8C240909, // 0024 GETMET R9 R4 K9
+ 0x5C2C0A00, // 0025 MOVE R11 R5
+ 0x7C240400, // 0026 CALL R9 2
+ 0x781A0009, // 0027 JMPF R6 #0032
+ 0x4C200000, // 0028 LDNIL R8
+ 0x1C200E08, // 0029 EQ R8 R7 R8
+ 0x78220003, // 002A JMPF R8 #002F
+ 0x8C20010A, // 002B GETMET R8 R0 K10
+ 0x94280806, // 002C GETIDX R10 R4 R6
+ 0x7C200400, // 002D CALL R8 2
+ 0x5C1C1000, // 002E MOVE R7 R8
+ 0x8C200909, // 002F GETMET R8 R4 K9
+ 0x5C280C00, // 0030 MOVE R10 R6
+ 0x7C200400, // 0031 CALL R8 2
+ 0x4C200000, // 0032 LDNIL R8
+ 0x1C200E08, // 0033 EQ R8 R7 R8
+ 0x78220004, // 0034 JMPF R8 #003A
+ 0xB8220000, // 0035 GETNGBL R8 K0
+ 0x8C201101, // 0036 GETMET R8 R8 K1
+ 0x5828000B, // 0037 LDCONST R10 K11
+ 0x7C200400, // 0038 CALL R8 2
+ 0x80041000, // 0039 RET 1 R8
+ 0x88200F0C, // 003A GETMBR R8 R7 K12
+ 0x74220004, // 003B JMPT R8 #0041
+ 0xB8220000, // 003C GETNGBL R8 K0
+ 0x8C201101, // 003D GETMET R8 R8 K1
+ 0x5828000D, // 003E LDCONST R10 K13
+ 0x7C200400, // 003F CALL R8 2
+ 0x80041000, // 0040 RET 1 R8
+ 0x8C200F0E, // 0041 GETMET R8 R7 K14
+ 0x7C200200, // 0042 CALL R8 1
+ 0x60240013, // 0043 GETGBL R9 G19
+ 0x7C240000, // 0044 CALL R9 0
+ 0x60280010, // 0045 GETGBL R10 G16
+ 0x8C2C090F, // 0046 GETMET R11 R4 K15
+ 0x7C2C0200, // 0047 CALL R11 1
+ 0x7C280200, // 0048 CALL R10 1
+ 0xA8020016, // 0049 EXBLK 0 #0061
+ 0x5C2C1400, // 004A MOVE R11 R10
+ 0x7C2C0000, // 004B CALL R11 0
+ 0xB8320000, // 004C GETNGBL R12 K0
+ 0x8C301910, // 004D GETMET R12 R12 K16
+ 0x5C381000, // 004E MOVE R14 R8
+ 0x5C3C1600, // 004F MOVE R15 R11
+ 0x7C300600, // 0050 CALL R12 3
+ 0x4C340000, // 0051 LDNIL R13
+ 0x1C34180D, // 0052 EQ R13 R12 R13
+ 0x78360008, // 0053 JMPF R13 #005D
+ 0xB8360000, // 0054 GETNGBL R13 K0
+ 0x8C341B01, // 0055 GETMET R13 R13 K1
+ 0x603C0018, // 0056 GETGBL R15 G24
+ 0x58400011, // 0057 LDCONST R16 K17
+ 0x5C441600, // 0058 MOVE R17 R11
+ 0x7C3C0400, // 0059 CALL R15 2
+ 0x7C340400, // 005A CALL R13 2
+ 0xA8040001, // 005B EXBLK 1 1
+ 0x80001A00, // 005C RET 0
+ 0x9434100C, // 005D GETIDX R13 R8 R12
+ 0x9438080B, // 005E GETIDX R14 R4 R11
+ 0x98241A0E, // 005F SETIDX R9 R13 R14
+ 0x7001FFE8, // 0060 JMP #004A
+ 0x58280012, // 0061 LDCONST R10 K18
+ 0xAC280200, // 0062 CATCH R10 1 0
+ 0xB0080000, // 0063 RAISE 2 R0 R0
+ 0x8C280F13, // 0064 GETMET R10 R7 K19
+ 0x5C301200, // 0065 MOVE R12 R9
+ 0x7C280400, // 0066 CALL R10 2
+ 0x8C280F14, // 0067 GETMET R10 R7 K20
+ 0x7C280200, // 0068 CALL R10 1
+ 0x782A000A, // 0069 JMPF R10 #0075
+ 0x602C0018, // 006A GETGBL R11 G24
+ 0x58300015, // 006B LDCONST R12 K21
+ 0x5C340200, // 006C MOVE R13 R1
+ 0x5C381400, // 006D MOVE R14 R10
+ 0x7C2C0600, // 006E CALL R11 3
+ 0xB8320000, // 006F GETNGBL R12 K0
+ 0x8C301916, // 0070 GETMET R12 R12 K22
+ 0x5C381600, // 0071 MOVE R14 R11
+ 0x7C300400, // 0072 CALL R12 2
+ 0x80041800, // 0073 RET 1 R12
+ 0x70020003, // 0074 JMP #0079
+ 0xB82E0000, // 0075 GETNGBL R11 K0
+ 0x8C2C1717, // 0076 GETMET R11 R11 K23
+ 0x7C2C0200, // 0077 CALL R11 1
+ 0x80041600, // 0078 RET 1 R11
+ 0xB81E0000, // 0079 GETNGBL R7 K0
+ 0x8C1C0F01, // 007A GETMET R7 R7 K1
+ 0x58240018, // 007B LDCONST R9 K24
+ 0x7C1C0400, // 007C CALL R7 2
+ 0x80000000, // 007D RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: find_plugin_by_endpoint
+********************************************************************/
+be_local_closure(Matter_Device_find_plugin_by_endpoint, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_const_int(0),
+ /* K1 */ be_nested_str_weak(plugins),
+ /* K2 */ be_nested_str_weak(get_endpoint),
+ /* K3 */ be_const_int(1),
+ }),
+ be_str_weak(find_plugin_by_endpoint),
+ &be_const_str_solidified,
+ ( &(const binstruction[17]) { /* code */
+ 0x58080000, // 0000 LDCONST R2 K0
+ 0x600C000C, // 0001 GETGBL R3 G12
+ 0x88100101, // 0002 GETMBR R4 R0 K1
+ 0x7C0C0200, // 0003 CALL R3 1
+ 0x140C0403, // 0004 LT R3 R2 R3
+ 0x780E0008, // 0005 JMPF R3 #000F
+ 0x880C0101, // 0006 GETMBR R3 R0 K1
+ 0x940C0602, // 0007 GETIDX R3 R3 R2
+ 0x8C100702, // 0008 GETMET R4 R3 K2
+ 0x7C100200, // 0009 CALL R4 1
+ 0x1C100801, // 000A EQ R4 R4 R1
+ 0x78120000, // 000B JMPF R4 #000D
+ 0x80040600, // 000C RET 1 R3
+ 0x00080503, // 000D ADD R2 R2 K3
+ 0x7001FFF1, // 000E JMP #0001
+ 0x4C0C0000, // 000F LDNIL R3
+ 0x80040600, // 0010 RET 1 R3
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: start_mdns_announce_hostnames
+********************************************************************/
+be_local_closure(Matter_Device_start_mdns_announce_hostnames, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 1, /* has sup protos */
+ ( &(const struct bproto*[ 2]) {
+ be_nested_proto(
+ 4, /* nstack */
+ 0, /* argc */
+ 0, /* varg */
+ 1, /* has upvals */
+ ( &(const bupvaldesc[ 1]) { /* upvals */
+ be_local_const_upval(1, 0),
+ }),
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 5]) { /* constants */
+ /* K0 */ be_nested_str_weak(_mdns_announce_hostname),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(remove_rule),
+ /* K3 */ be_nested_str_weak(Wifi_X23Connected),
+ /* K4 */ be_nested_str_weak(matter_mdns_host),
+ }),
+ be_str_weak(_anonymous_),
+ &be_const_str_solidified,
+ ( &(const binstruction[10]) { /* code */
+ 0x68000000, // 0000 GETUPV R0 U0
+ 0x8C000100, // 0001 GETMET R0 R0 K0
+ 0x50080000, // 0002 LDBOOL R2 0 0
+ 0x7C000400, // 0003 CALL R0 2
+ 0xB8020200, // 0004 GETNGBL R0 K1
+ 0x8C000102, // 0005 GETMET R0 R0 K2
+ 0x58080003, // 0006 LDCONST R2 K3
+ 0x580C0004, // 0007 LDCONST R3 K4
+ 0x7C000600, // 0008 CALL R0 3
+ 0x80000000, // 0009 RET 0
+ })
+ ),
+ be_nested_proto(
+ 4, /* nstack */
+ 0, /* argc */
+ 0, /* varg */
+ 1, /* has upvals */
+ ( &(const bupvaldesc[ 1]) { /* upvals */
+ be_local_const_upval(1, 0),
+ }),
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 5]) { /* constants */
+ /* K0 */ be_nested_str_weak(_mdns_announce_hostname),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(remove_rule),
+ /* K3 */ be_nested_str_weak(Eth_X23Connected),
+ /* K4 */ be_nested_str_weak(matter_mdns_host),
+ }),
+ be_str_weak(_anonymous_),
+ &be_const_str_solidified,
+ ( &(const binstruction[10]) { /* code */
+ 0x68000000, // 0000 GETUPV R0 U0
+ 0x8C000100, // 0001 GETMET R0 R0 K0
+ 0x50080200, // 0002 LDBOOL R2 1 0
+ 0x7C000400, // 0003 CALL R0 2
+ 0xB8020200, // 0004 GETNGBL R0 K1
+ 0x8C000102, // 0005 GETMET R0 R0 K2
+ 0x58080003, // 0006 LDCONST R2 K3
+ 0x580C0004, // 0007 LDCONST R3 K4
+ 0x7C000600, // 0008 CALL R0 3
+ 0x80000000, // 0009 RET 0
+ })
+ ),
+ }),
+ 1, /* has constants */
+ ( &(const bvalue[ 9]) { /* constants */
+ /* K0 */ be_nested_str_weak(tasmota),
+ /* K1 */ be_nested_str_weak(wifi),
+ /* K2 */ be_nested_str_weak(up),
+ /* K3 */ be_nested_str_weak(_mdns_announce_hostname),
+ /* K4 */ be_nested_str_weak(add_rule),
+ /* K5 */ be_nested_str_weak(Wifi_X23Connected),
+ /* K6 */ be_nested_str_weak(matter_mdns_host),
+ /* K7 */ be_nested_str_weak(eth),
+ /* K8 */ be_nested_str_weak(Eth_X23Connected),
+ }),
+ be_str_weak(start_mdns_announce_hostnames),
+ &be_const_str_solidified,
+ ( &(const binstruction[32]) { /* code */
+ 0xB8060000, // 0000 GETNGBL R1 K0
+ 0x8C040301, // 0001 GETMET R1 R1 K1
+ 0x7C040200, // 0002 CALL R1 1
+ 0x94040302, // 0003 GETIDX R1 R1 K2
+ 0x78060003, // 0004 JMPF R1 #0009
+ 0x8C040103, // 0005 GETMET R1 R0 K3
+ 0x500C0000, // 0006 LDBOOL R3 0 0
+ 0x7C040400, // 0007 CALL R1 2
+ 0x70020005, // 0008 JMP #000F
+ 0xB8060000, // 0009 GETNGBL R1 K0
+ 0x8C040304, // 000A GETMET R1 R1 K4
+ 0x580C0005, // 000B LDCONST R3 K5
+ 0x84100000, // 000C CLOSURE R4 P0
+ 0x58140006, // 000D LDCONST R5 K6
+ 0x7C040800, // 000E CALL R1 4
+ 0xB8060000, // 000F GETNGBL R1 K0
+ 0x8C040307, // 0010 GETMET R1 R1 K7
+ 0x7C040200, // 0011 CALL R1 1
+ 0x94040302, // 0012 GETIDX R1 R1 K2
+ 0x78060003, // 0013 JMPF R1 #0018
+ 0x8C040103, // 0014 GETMET R1 R0 K3
+ 0x500C0200, // 0015 LDBOOL R3 1 0
+ 0x7C040400, // 0016 CALL R1 2
+ 0x70020005, // 0017 JMP #001E
+ 0xB8060000, // 0018 GETNGBL R1 K0
+ 0x8C040304, // 0019 GETMET R1 R1 K4
+ 0x580C0008, // 001A LDCONST R3 K8
+ 0x84100001, // 001B CLOSURE R4 P1
+ 0x58140006, // 001C LDCONST R5 K6
+ 0x7C040800, // 001D CALL R1 4
+ 0xA0000000, // 001E CLOSE R0
+ 0x80000000, // 001F RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: every_50ms
+********************************************************************/
+be_local_closure(Matter_Device_every_50ms, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(tick),
+ /* K1 */ be_const_int(1),
+ }),
+ be_str_weak(every_50ms),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 4]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x00040301, // 0001 ADD R1 R1 K1
+ 0x90020001, // 0002 SETMBR R0 K0 R1
+ 0x80000000, // 0003 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: stop
+********************************************************************/
+be_local_closure(Matter_Device_stop, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(tasmota),
+ /* K1 */ be_nested_str_weak(remove_driver),
+ /* K2 */ be_nested_str_weak(udp_server),
+ /* K3 */ be_nested_str_weak(stop),
+ }),
+ be_str_weak(stop),
+ &be_const_str_solidified,
+ ( &(const binstruction[10]) { /* code */
+ 0xB8060000, // 0000 GETNGBL R1 K0
+ 0x8C040301, // 0001 GETMET R1 R1 K1
+ 0x5C0C0000, // 0002 MOVE R3 R0
+ 0x7C040400, // 0003 CALL R1 2
+ 0x88040102, // 0004 GETMBR R1 R0 K2
+ 0x78060002, // 0005 JMPF R1 #0009
+ 0x88040102, // 0006 GETMBR R1 R0 K2
+ 0x8C040303, // 0007 GETMET R1 R1 K3
+ 0x7C040200, // 0008 CALL R1 1
+ 0x80000000, // 0009 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: mdns_remove_op_discovery
+********************************************************************/
+be_local_closure(Matter_Device_mdns_remove_op_discovery, /* name */
+ be_nested_proto(
+ 12, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[23]) { /* constants */
+ /* K0 */ be_nested_str_weak(mdns),
+ /* K1 */ be_nested_str_weak(get_device_id),
+ /* K2 */ be_nested_str_weak(copy),
+ /* K3 */ be_nested_str_weak(reverse),
+ /* K4 */ be_nested_str_weak(get_fabric_compressed),
+ /* K5 */ be_nested_str_weak(tohex),
+ /* K6 */ be_nested_str_weak(_X2D),
+ /* K7 */ be_nested_str_weak(tasmota),
+ /* K8 */ be_nested_str_weak(eth),
+ /* K9 */ be_nested_str_weak(find),
+ /* K10 */ be_nested_str_weak(up),
+ /* K11 */ be_nested_str_weak(log),
+ /* K12 */ be_nested_str_weak(MTR_X3A_X20remove_X20mDNS_X20on_X20_X25s_X20_X27_X25s_X27),
+ /* K13 */ be_const_int(3),
+ /* K14 */ be_nested_str_weak(remove_service),
+ /* K15 */ be_nested_str_weak(_matter),
+ /* K16 */ be_nested_str_weak(_tcp),
+ /* K17 */ be_nested_str_weak(hostname_eth),
+ /* K18 */ be_nested_str_weak(wifi),
+ /* K19 */ be_nested_str_weak(hostname_wifi),
+ /* K20 */ be_nested_str_weak(MTR_X3A_X20Exception),
+ /* K21 */ be_nested_str_weak(_X7C),
+ /* K22 */ be_const_int(2),
+ }),
+ be_str_weak(mdns_remove_op_discovery),
+ &be_const_str_solidified,
+ ( &(const binstruction[80]) { /* code */
+ 0xA40A0000, // 0000 IMPORT R2 K0
+ 0xA802003B, // 0001 EXBLK 0 #003E
+ 0x8C0C0301, // 0002 GETMET R3 R1 K1
+ 0x7C0C0200, // 0003 CALL R3 1
+ 0x8C0C0702, // 0004 GETMET R3 R3 K2
+ 0x7C0C0200, // 0005 CALL R3 1
+ 0x8C0C0703, // 0006 GETMET R3 R3 K3
+ 0x7C0C0200, // 0007 CALL R3 1
+ 0x8C100304, // 0008 GETMET R4 R1 K4
+ 0x7C100200, // 0009 CALL R4 1
+ 0x8C140905, // 000A GETMET R5 R4 K5
+ 0x7C140200, // 000B CALL R5 1
+ 0x00140B06, // 000C ADD R5 R5 K6
+ 0x8C180705, // 000D GETMET R6 R3 K5
+ 0x7C180200, // 000E CALL R6 1
+ 0x00140A06, // 000F ADD R5 R5 R6
+ 0xB81A0E00, // 0010 GETNGBL R6 K7
+ 0x8C180D08, // 0011 GETMET R6 R6 K8
+ 0x7C180200, // 0012 CALL R6 1
+ 0x8C180D09, // 0013 GETMET R6 R6 K9
+ 0x5820000A, // 0014 LDCONST R8 K10
+ 0x7C180400, // 0015 CALL R6 2
+ 0x781A000E, // 0016 JMPF R6 #0026
+ 0xB81A0E00, // 0017 GETNGBL R6 K7
+ 0x8C180D0B, // 0018 GETMET R6 R6 K11
+ 0x60200018, // 0019 GETGBL R8 G24
+ 0x5824000C, // 001A LDCONST R9 K12
+ 0x58280008, // 001B LDCONST R10 K8
+ 0x5C2C0A00, // 001C MOVE R11 R5
+ 0x7C200600, // 001D CALL R8 3
+ 0x5824000D, // 001E LDCONST R9 K13
+ 0x7C180600, // 001F CALL R6 3
+ 0x8C18050E, // 0020 GETMET R6 R2 K14
+ 0x5820000F, // 0021 LDCONST R8 K15
+ 0x58240010, // 0022 LDCONST R9 K16
+ 0x5C280A00, // 0023 MOVE R10 R5
+ 0x882C0111, // 0024 GETMBR R11 R0 K17
+ 0x7C180A00, // 0025 CALL R6 5
+ 0xB81A0E00, // 0026 GETNGBL R6 K7
+ 0x8C180D12, // 0027 GETMET R6 R6 K18
+ 0x7C180200, // 0028 CALL R6 1
+ 0x8C180D09, // 0029 GETMET R6 R6 K9
+ 0x5820000A, // 002A LDCONST R8 K10
+ 0x7C180400, // 002B CALL R6 2
+ 0x781A000E, // 002C JMPF R6 #003C
+ 0xB81A0E00, // 002D GETNGBL R6 K7
+ 0x8C180D0B, // 002E GETMET R6 R6 K11
+ 0x60200018, // 002F GETGBL R8 G24
+ 0x5824000C, // 0030 LDCONST R9 K12
+ 0x58280012, // 0031 LDCONST R10 K18
+ 0x5C2C0A00, // 0032 MOVE R11 R5
+ 0x7C200600, // 0033 CALL R8 3
+ 0x5824000D, // 0034 LDCONST R9 K13
+ 0x7C180600, // 0035 CALL R6 3
+ 0x8C18050E, // 0036 GETMET R6 R2 K14
+ 0x5820000F, // 0037 LDCONST R8 K15
+ 0x58240010, // 0038 LDCONST R9 K16
+ 0x5C280A00, // 0039 MOVE R10 R5
+ 0x882C0113, // 003A GETMBR R11 R0 K19
+ 0x7C180A00, // 003B CALL R6 5
+ 0xA8040001, // 003C EXBLK 1 1
+ 0x70020010, // 003D JMP #004F
+ 0xAC0C0002, // 003E CATCH R3 0 2
+ 0x7002000D, // 003F JMP #004E
+ 0xB8160E00, // 0040 GETNGBL R5 K7
+ 0x8C140B0B, // 0041 GETMET R5 R5 K11
+ 0x601C0008, // 0042 GETGBL R7 G8
+ 0x5C200600, // 0043 MOVE R8 R3
+ 0x7C1C0200, // 0044 CALL R7 1
+ 0x001E2807, // 0045 ADD R7 K20 R7
+ 0x001C0F15, // 0046 ADD R7 R7 K21
+ 0x60200008, // 0047 GETGBL R8 G8
+ 0x5C240800, // 0048 MOVE R9 R4
+ 0x7C200200, // 0049 CALL R8 1
+ 0x001C0E08, // 004A ADD R7 R7 R8
+ 0x58200016, // 004B LDCONST R8 K22
+ 0x7C140600, // 004C CALL R5 3
+ 0x70020000, // 004D JMP #004F
+ 0xB0080000, // 004E RAISE 2 R0 R0
+ 0x80000000, // 004F RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: _start_udp
+********************************************************************/
+be_local_closure(Matter_Device__start_udp, /* name */
+ be_nested_proto(
+ 7, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 1, /* has sup protos */
+ ( &(const struct bproto*[ 1]) {
+ be_nested_proto(
+ 8, /* nstack */
+ 3, /* argc */
+ 0, /* varg */
+ 1, /* has upvals */
+ ( &(const bupvaldesc[ 1]) { /* upvals */
+ be_local_const_upval(1, 0),
+ }),
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(msg_received),
+ }),
+ be_str_weak(_X3Clambda_X3E),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 7]) { /* code */
+ 0x680C0000, // 0000 GETUPV R3 U0
+ 0x8C0C0700, // 0001 GETMET R3 R3 K0
+ 0x5C140000, // 0002 MOVE R5 R0
+ 0x5C180200, // 0003 MOVE R6 R1
+ 0x5C1C0400, // 0004 MOVE R7 R2
+ 0x7C0C0800, // 0005 CALL R3 4
+ 0x80040600, // 0006 RET 1 R3
+ })
+ ),
+ }),
+ 1, /* has constants */
+ ( &(const bvalue[ 9]) { /* constants */
+ /* K0 */ be_nested_str_weak(udp_server),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(log),
+ /* K3 */ be_nested_str_weak(MTR_X3A_X20Starting_X20UDP_X20server_X20on_X20port_X3A_X20),
+ /* K4 */ be_const_int(2),
+ /* K5 */ be_nested_str_weak(matter),
+ /* K6 */ be_nested_str_weak(UDPServer),
+ /* K7 */ be_nested_str_weak(),
+ /* K8 */ be_nested_str_weak(start),
+ }),
+ be_str_weak(_start_udp),
+ &be_const_str_solidified,
+ ( &(const binstruction[28]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x780A0000, // 0001 JMPF R2 #0003
+ 0x80000400, // 0002 RET 0
+ 0x4C080000, // 0003 LDNIL R2
+ 0x1C080202, // 0004 EQ R2 R1 R2
+ 0x780A0000, // 0005 JMPF R2 #0007
+ 0x540615A3, // 0006 LDINT R1 5540
+ 0xB80A0200, // 0007 GETNGBL R2 K1
+ 0x8C080502, // 0008 GETMET R2 R2 K2
+ 0x60100008, // 0009 GETGBL R4 G8
+ 0x5C140200, // 000A MOVE R5 R1
+ 0x7C100200, // 000B CALL R4 1
+ 0x00120604, // 000C ADD R4 K3 R4
+ 0x58140004, // 000D LDCONST R5 K4
+ 0x7C080600, // 000E CALL R2 3
+ 0xB80A0A00, // 000F GETNGBL R2 K5
+ 0x8C080506, // 0010 GETMET R2 R2 K6
+ 0x5C100000, // 0011 MOVE R4 R0
+ 0x58140007, // 0012 LDCONST R5 K7
+ 0x5C180200, // 0013 MOVE R6 R1
+ 0x7C080800, // 0014 CALL R2 4
+ 0x90020002, // 0015 SETMBR R0 K0 R2
+ 0x88080100, // 0016 GETMBR R2 R0 K0
+ 0x8C080508, // 0017 GETMET R2 R2 K8
+ 0x84100000, // 0018 CLOSURE R4 P0
+ 0x7C080400, // 0019 CALL R2 2
+ 0xA0000000, // 001A CLOSE R0
+ 0x80000000, // 001B RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: get_plugin_remote_info
+********************************************************************/
+be_local_closure(Matter_Device_get_plugin_remote_info, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(plugins_config_remotes),
+ /* K1 */ be_nested_str_weak(find),
+ }),
+ be_str_weak(get_plugin_remote_info),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 7]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x8C080501, // 0001 GETMET R2 R2 K1
+ 0x5C100200, // 0002 MOVE R4 R1
+ 0x60140013, // 0003 GETGBL R5 G19
+ 0x7C140000, // 0004 CALL R5 0
+ 0x7C080600, // 0005 CALL R2 3
+ 0x80040400, // 0006 RET 1 R2
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: register_http_remote
+********************************************************************/
+be_local_closure(Matter_Device_register_http_remote, /* name */
+ be_nested_proto(
+ 9, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 8]) { /* constants */
+ /* K0 */ be_nested_str_weak(http_remotes),
+ /* K1 */ be_nested_str_weak(contains),
+ /* K2 */ be_nested_str_weak(get_timeout),
+ /* K3 */ be_nested_str_weak(set_timeout),
+ /* K4 */ be_nested_str_weak(matter),
+ /* K5 */ be_nested_str_weak(HTTP_remote),
+ /* K6 */ be_nested_str_weak(plugins_config_remotes),
+ /* K7 */ be_nested_str_weak(set_info),
+ }),
+ be_str_weak(register_http_remote),
+ &be_const_str_solidified,
+ ( &(const binstruction[42]) { /* code */
+ 0x880C0100, // 0000 GETMBR R3 R0 K0
+ 0x4C100000, // 0001 LDNIL R4
+ 0x1C0C0604, // 0002 EQ R3 R3 R4
+ 0x780E0002, // 0003 JMPF R3 #0007
+ 0x600C0013, // 0004 GETGBL R3 G19
+ 0x7C0C0000, // 0005 CALL R3 0
+ 0x90020003, // 0006 SETMBR R0 K0 R3
+ 0x4C0C0000, // 0007 LDNIL R3
+ 0x88100100, // 0008 GETMBR R4 R0 K0
+ 0x8C100901, // 0009 GETMET R4 R4 K1
+ 0x5C180200, // 000A MOVE R6 R1
+ 0x7C100400, // 000B CALL R4 2
+ 0x78120009, // 000C JMPF R4 #0017
+ 0x88100100, // 000D GETMBR R4 R0 K0
+ 0x940C0801, // 000E GETIDX R3 R4 R1
+ 0x8C140702, // 000F GETMET R5 R3 K2
+ 0x7C140200, // 0010 CALL R5 1
+ 0x14140405, // 0011 LT R5 R2 R5
+ 0x78160002, // 0012 JMPF R5 #0016
+ 0x8C140703, // 0013 GETMET R5 R3 K3
+ 0x5C1C0400, // 0014 MOVE R7 R2
+ 0x7C140400, // 0015 CALL R5 2
+ 0x70020011, // 0016 JMP #0029
+ 0xB8120800, // 0017 GETNGBL R4 K4
+ 0x8C100905, // 0018 GETMET R4 R4 K5
+ 0x5C180000, // 0019 MOVE R6 R0
+ 0x5C1C0200, // 001A MOVE R7 R1
+ 0x5C200400, // 001B MOVE R8 R2
+ 0x7C100800, // 001C CALL R4 4
+ 0x5C0C0800, // 001D MOVE R3 R4
+ 0x88100106, // 001E GETMBR R4 R0 K6
+ 0x8C100901, // 001F GETMET R4 R4 K1
+ 0x5C180200, // 0020 MOVE R6 R1
+ 0x7C100400, // 0021 CALL R4 2
+ 0x78120003, // 0022 JMPF R4 #0027
+ 0x8C100707, // 0023 GETMET R4 R3 K7
+ 0x88180106, // 0024 GETMBR R6 R0 K6
+ 0x94180C01, // 0025 GETIDX R6 R6 R1
+ 0x7C100400, // 0026 CALL R4 2
+ 0x88100100, // 0027 GETMBR R4 R0 K0
+ 0x98100203, // 0028 SETIDX R4 R1 R3
+ 0x80040600, // 0029 RET 1 R3
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: mdns_remove_op_discovery_all_fabrics
+********************************************************************/
+be_local_closure(Matter_Device_mdns_remove_op_discovery_all_fabrics, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 6]) { /* constants */
+ /* K0 */ be_nested_str_weak(sessions),
+ /* K1 */ be_nested_str_weak(active_fabrics),
+ /* K2 */ be_nested_str_weak(get_device_id),
+ /* K3 */ be_nested_str_weak(get_fabric_id),
+ /* K4 */ be_nested_str_weak(mdns_remove_op_discovery),
+ /* K5 */ be_nested_str_weak(stop_iteration),
+ }),
+ be_str_weak(mdns_remove_op_discovery_all_fabrics),
+ &be_const_str_solidified,
+ ( &(const binstruction[22]) { /* code */
+ 0x60040010, // 0000 GETGBL R1 G16
+ 0x88080100, // 0001 GETMBR R2 R0 K0
+ 0x8C080501, // 0002 GETMET R2 R2 K1
+ 0x7C080200, // 0003 CALL R2 1
+ 0x7C040200, // 0004 CALL R1 1
+ 0xA802000B, // 0005 EXBLK 0 #0012
+ 0x5C080200, // 0006 MOVE R2 R1
+ 0x7C080000, // 0007 CALL R2 0
+ 0x8C0C0502, // 0008 GETMET R3 R2 K2
+ 0x7C0C0200, // 0009 CALL R3 1
+ 0x780E0005, // 000A JMPF R3 #0011
+ 0x8C0C0503, // 000B GETMET R3 R2 K3
+ 0x7C0C0200, // 000C CALL R3 1
+ 0x780E0002, // 000D JMPF R3 #0011
+ 0x8C0C0104, // 000E GETMET R3 R0 K4
+ 0x5C140400, // 000F MOVE R5 R2
+ 0x7C0C0400, // 0010 CALL R3 2
+ 0x7001FFF3, // 0011 JMP #0006
+ 0x58040005, // 0012 LDCONST R1 K5
+ 0xAC040200, // 0013 CATCH R1 1 0
+ 0xB0080000, // 0014 RAISE 2 R0 R0
+ 0x80000000, // 0015 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: get_plugin_class_arg
+********************************************************************/
+be_local_closure(Matter_Device_get_plugin_class_arg, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(plugins_classes),
+ /* K1 */ be_nested_str_weak(find),
+ /* K2 */ be_nested_str_weak(ARG),
+ /* K3 */ be_nested_str_weak(),
+ }),
+ be_str_weak(get_plugin_class_arg),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 9]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x8C080501, // 0001 GETMET R2 R2 K1
+ 0x5C100200, // 0002 MOVE R4 R1
+ 0x7C080400, // 0003 CALL R2 2
+ 0x780A0001, // 0004 JMPF R2 #0007
+ 0x880C0502, // 0005 GETMBR R3 R2 K2
+ 0x70020000, // 0006 JMP #0008
+ 0x580C0003, // 0007 LDCONST R3 K3
+ 0x80040600, // 0008 RET 1 R3
+ })
+ )
+);
+/*******************************************************************/
+
+
/********************************************************************
** Solidified function: generate_random_passcode
********************************************************************/
@@ -5871,42 +5603,9 @@ be_local_closure(Matter_Device_generate_random_passcode, /* name */
/********************************************************************
-** Solidified function: msg_received
+** Solidified function: is_root_commissioning_open
********************************************************************/
-be_local_closure(Matter_Device_msg_received, /* name */
- be_nested_proto(
- 9, /* nstack */
- 4, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(message_handler),
- /* K1 */ be_nested_str_weak(msg_received),
- }),
- be_str_weak(msg_received),
- &be_const_str_solidified,
- ( &(const binstruction[ 7]) { /* code */
- 0x88100100, // 0000 GETMBR R4 R0 K0
- 0x8C100901, // 0001 GETMET R4 R4 K1
- 0x5C180200, // 0002 MOVE R6 R1
- 0x5C1C0400, // 0003 MOVE R7 R2
- 0x5C200600, // 0004 MOVE R8 R3
- 0x7C100800, // 0005 CALL R4 4
- 0x80040800, // 0006 RET 1 R4
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: is_commissioning_open
-********************************************************************/
-be_local_closure(Matter_Device_is_commissioning_open, /* name */
+be_local_closure(Matter_Device_is_root_commissioning_open, /* name */
be_nested_proto(
3, /* nstack */
1, /* argc */
@@ -5916,16 +5615,24 @@ be_local_closure(Matter_Device_is_commissioning_open, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
+ ( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str_weak(commissioning_open),
+ /* K1 */ be_nested_str_weak(commissioning_admin_fabric),
}),
- be_str_weak(is_commissioning_open),
+ be_str_weak(is_root_commissioning_open),
&be_const_str_solidified,
- ( &(const binstruction[ 4]) { /* code */
+ ( &(const binstruction[11]) { /* code */
0x88040100, // 0000 GETMBR R1 R0 K0
0x4C080000, // 0001 LDNIL R2
0x20040202, // 0002 NE R1 R1 R2
- 0x80040200, // 0003 RET 1 R1
+ 0x78060003, // 0003 JMPF R1 #0008
+ 0x88040101, // 0004 GETMBR R1 R0 K1
+ 0x4C080000, // 0005 LDNIL R2
+ 0x1C040202, // 0006 EQ R1 R1 R2
+ 0x74060000, // 0007 JMPT R1 #0009
+ 0x50040001, // 0008 LDBOOL R1 0 1
+ 0x50040200, // 0009 LDBOOL R1 1 0
+ 0x80040200, // 000A RET 1 R1
})
)
);
@@ -5933,11 +5640,73 @@ be_local_closure(Matter_Device_is_commissioning_open, /* name */
/********************************************************************
-** Solidified function: MtrInfo_one
+** Solidified function: stop_basic_commissioning
********************************************************************/
-be_local_closure(Matter_Device_MtrInfo_one, /* name */
+be_local_closure(Matter_Device_stop_basic_commissioning, /* name */
be_nested_proto(
- 9, /* nstack */
+ 5, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[13]) { /* constants */
+ /* K0 */ be_nested_str_weak(is_root_commissioning_open),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(publish_result),
+ /* K3 */ be_nested_str_weak(_X7B_X22Matter_X22_X3A_X7B_X22Commissioning_X22_X3A0_X7D_X7D),
+ /* K4 */ be_nested_str_weak(Matter),
+ /* K5 */ be_nested_str_weak(commissioning_open),
+ /* K6 */ be_nested_str_weak(mdns_remove_PASE),
+ /* K7 */ be_nested_str_weak(commissioning_iterations),
+ /* K8 */ be_nested_str_weak(commissioning_discriminator),
+ /* K9 */ be_nested_str_weak(commissioning_salt),
+ /* K10 */ be_nested_str_weak(commissioning_w0),
+ /* K11 */ be_nested_str_weak(commissioning_L),
+ /* K12 */ be_nested_str_weak(commissioning_admin_fabric),
+ }),
+ be_str_weak(stop_basic_commissioning),
+ &be_const_str_solidified,
+ ( &(const binstruction[25]) { /* code */
+ 0x8C040100, // 0000 GETMET R1 R0 K0
+ 0x7C040200, // 0001 CALL R1 1
+ 0x78060004, // 0002 JMPF R1 #0008
+ 0xB8060200, // 0003 GETNGBL R1 K1
+ 0x8C040302, // 0004 GETMET R1 R1 K2
+ 0x580C0003, // 0005 LDCONST R3 K3
+ 0x58100004, // 0006 LDCONST R4 K4
+ 0x7C040600, // 0007 CALL R1 3
+ 0x4C040000, // 0008 LDNIL R1
+ 0x90020A01, // 0009 SETMBR R0 K5 R1
+ 0x8C040106, // 000A GETMET R1 R0 K6
+ 0x7C040200, // 000B CALL R1 1
+ 0x4C040000, // 000C LDNIL R1
+ 0x90020E01, // 000D SETMBR R0 K7 R1
+ 0x4C040000, // 000E LDNIL R1
+ 0x90021001, // 000F SETMBR R0 K8 R1
+ 0x4C040000, // 0010 LDNIL R1
+ 0x90021201, // 0011 SETMBR R0 K9 R1
+ 0x4C040000, // 0012 LDNIL R1
+ 0x90021401, // 0013 SETMBR R0 K10 R1
+ 0x4C040000, // 0014 LDNIL R1
+ 0x90021601, // 0015 SETMBR R0 K11 R1
+ 0x4C040000, // 0016 LDNIL R1
+ 0x90021801, // 0017 SETMBR R0 K12 R1
+ 0x80000000, // 0018 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: autoconf_sensors_list
+********************************************************************/
+be_local_closure(Matter_Device_autoconf_sensors_list, /* name */
+ be_nested_proto(
+ 10, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
@@ -5945,37 +5714,148 @@ be_local_closure(Matter_Device_MtrInfo_one, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 6]) { /* constants */
- /* K0 */ be_nested_str_weak(find_plugin_by_endpoint),
- /* K1 */ be_nested_str_weak(state_json),
- /* K2 */ be_nested_str_weak(_X7B_X22MtrInfo_X22_X3A_X25s_X7D),
- /* K3 */ be_nested_str_weak(tasmota),
- /* K4 */ be_nested_str_weak(publish_result),
- /* K5 */ be_nested_str_weak(),
+ ( &(const bvalue[18]) { /* constants */
+ /* K0 */ be_nested_str_weak(k2l),
+ /* K1 */ be_nested_str_weak(contains),
+ /* K2 */ be_nested_str_weak(Temperature),
+ /* K3 */ be_nested_str_weak(_X23Temperature),
+ /* K4 */ be_nested_str_weak(push),
+ /* K5 */ be_nested_str_weak(type),
+ /* K6 */ be_nested_str_weak(temperature),
+ /* K7 */ be_nested_str_weak(filter),
+ /* K8 */ be_nested_str_weak(stop_iteration),
+ /* K9 */ be_nested_str_weak(Pressure),
+ /* K10 */ be_nested_str_weak(_X23Pressure),
+ /* K11 */ be_nested_str_weak(pressure),
+ /* K12 */ be_nested_str_weak(Illuminance),
+ /* K13 */ be_nested_str_weak(_X23Illuminance),
+ /* K14 */ be_nested_str_weak(illuminance),
+ /* K15 */ be_nested_str_weak(Humidity),
+ /* K16 */ be_nested_str_weak(_X23Humidity),
+ /* K17 */ be_nested_str_weak(humidity),
}),
- be_str_weak(MtrInfo_one),
+ be_str_weak(autoconf_sensors_list),
&be_const_str_solidified,
- ( &(const binstruction[20]) { /* code */
- 0x8C080100, // 0000 GETMET R2 R0 K0
- 0x5C100200, // 0001 MOVE R4 R1
- 0x7C080400, // 0002 CALL R2 2
- 0x4C0C0000, // 0003 LDNIL R3
- 0x1C0C0403, // 0004 EQ R3 R2 R3
- 0x780E0000, // 0005 JMPF R3 #0007
- 0x80000600, // 0006 RET 0
- 0x8C0C0501, // 0007 GETMET R3 R2 K1
- 0x7C0C0200, // 0008 CALL R3 1
- 0x780E0008, // 0009 JMPF R3 #0013
- 0x60100018, // 000A GETGBL R4 G24
- 0x58140002, // 000B LDCONST R5 K2
- 0x5C180600, // 000C MOVE R6 R3
- 0x7C100400, // 000D CALL R4 2
- 0xB8160600, // 000E GETNGBL R5 K3
- 0x8C140B04, // 000F GETMET R5 R5 K4
- 0x5C1C0800, // 0010 MOVE R7 R4
- 0x58200005, // 0011 LDCONST R8 K5
- 0x7C140600, // 0012 CALL R5 3
- 0x80000000, // 0013 RET 0
+ ( &(const binstruction[119]) { /* code */
+ 0x60080012, // 0000 GETGBL R2 G18
+ 0x7C080000, // 0001 CALL R2 0
+ 0x600C0010, // 0002 GETGBL R3 G16
+ 0x8C100100, // 0003 GETMET R4 R0 K0
+ 0x5C180200, // 0004 MOVE R6 R1
+ 0x7C100400, // 0005 CALL R4 2
+ 0x7C0C0200, // 0006 CALL R3 1
+ 0xA8020013, // 0007 EXBLK 0 #001C
+ 0x5C100600, // 0008 MOVE R4 R3
+ 0x7C100000, // 0009 CALL R4 0
+ 0x94140204, // 000A GETIDX R5 R1 R4
+ 0x6018000F, // 000B GETGBL R6 G15
+ 0x5C1C0A00, // 000C MOVE R7 R5
+ 0x60200013, // 000D GETGBL R8 G19
+ 0x7C180400, // 000E CALL R6 2
+ 0x781A000A, // 000F JMPF R6 #001B
+ 0x8C180B01, // 0010 GETMET R6 R5 K1
+ 0x58200002, // 0011 LDCONST R8 K2
+ 0x7C180400, // 0012 CALL R6 2
+ 0x781A0006, // 0013 JMPF R6 #001B
+ 0x00180903, // 0014 ADD R6 R4 K3
+ 0x8C1C0504, // 0015 GETMET R7 R2 K4
+ 0x60240013, // 0016 GETGBL R9 G19
+ 0x7C240000, // 0017 CALL R9 0
+ 0x98260B06, // 0018 SETIDX R9 K5 K6
+ 0x98260E06, // 0019 SETIDX R9 K7 R6
+ 0x7C1C0400, // 001A CALL R7 2
+ 0x7001FFEB, // 001B JMP #0008
+ 0x580C0008, // 001C LDCONST R3 K8
+ 0xAC0C0200, // 001D CATCH R3 1 0
+ 0xB0080000, // 001E RAISE 2 R0 R0
+ 0x600C0010, // 001F GETGBL R3 G16
+ 0x8C100100, // 0020 GETMET R4 R0 K0
+ 0x5C180200, // 0021 MOVE R6 R1
+ 0x7C100400, // 0022 CALL R4 2
+ 0x7C0C0200, // 0023 CALL R3 1
+ 0xA8020013, // 0024 EXBLK 0 #0039
+ 0x5C100600, // 0025 MOVE R4 R3
+ 0x7C100000, // 0026 CALL R4 0
+ 0x94140204, // 0027 GETIDX R5 R1 R4
+ 0x6018000F, // 0028 GETGBL R6 G15
+ 0x5C1C0A00, // 0029 MOVE R7 R5
+ 0x60200013, // 002A GETGBL R8 G19
+ 0x7C180400, // 002B CALL R6 2
+ 0x781A000A, // 002C JMPF R6 #0038
+ 0x8C180B01, // 002D GETMET R6 R5 K1
+ 0x58200009, // 002E LDCONST R8 K9
+ 0x7C180400, // 002F CALL R6 2
+ 0x781A0006, // 0030 JMPF R6 #0038
+ 0x0018090A, // 0031 ADD R6 R4 K10
+ 0x8C1C0504, // 0032 GETMET R7 R2 K4
+ 0x60240013, // 0033 GETGBL R9 G19
+ 0x7C240000, // 0034 CALL R9 0
+ 0x98260B0B, // 0035 SETIDX R9 K5 K11
+ 0x98260E06, // 0036 SETIDX R9 K7 R6
+ 0x7C1C0400, // 0037 CALL R7 2
+ 0x7001FFEB, // 0038 JMP #0025
+ 0x580C0008, // 0039 LDCONST R3 K8
+ 0xAC0C0200, // 003A CATCH R3 1 0
+ 0xB0080000, // 003B RAISE 2 R0 R0
+ 0x600C0010, // 003C GETGBL R3 G16
+ 0x8C100100, // 003D GETMET R4 R0 K0
+ 0x5C180200, // 003E MOVE R6 R1
+ 0x7C100400, // 003F CALL R4 2
+ 0x7C0C0200, // 0040 CALL R3 1
+ 0xA8020013, // 0041 EXBLK 0 #0056
+ 0x5C100600, // 0042 MOVE R4 R3
+ 0x7C100000, // 0043 CALL R4 0
+ 0x94140204, // 0044 GETIDX R5 R1 R4
+ 0x6018000F, // 0045 GETGBL R6 G15
+ 0x5C1C0A00, // 0046 MOVE R7 R5
+ 0x60200013, // 0047 GETGBL R8 G19
+ 0x7C180400, // 0048 CALL R6 2
+ 0x781A000A, // 0049 JMPF R6 #0055
+ 0x8C180B01, // 004A GETMET R6 R5 K1
+ 0x5820000C, // 004B LDCONST R8 K12
+ 0x7C180400, // 004C CALL R6 2
+ 0x781A0006, // 004D JMPF R6 #0055
+ 0x0018090D, // 004E ADD R6 R4 K13
+ 0x8C1C0504, // 004F GETMET R7 R2 K4
+ 0x60240013, // 0050 GETGBL R9 G19
+ 0x7C240000, // 0051 CALL R9 0
+ 0x98260B0E, // 0052 SETIDX R9 K5 K14
+ 0x98260E06, // 0053 SETIDX R9 K7 R6
+ 0x7C1C0400, // 0054 CALL R7 2
+ 0x7001FFEB, // 0055 JMP #0042
+ 0x580C0008, // 0056 LDCONST R3 K8
+ 0xAC0C0200, // 0057 CATCH R3 1 0
+ 0xB0080000, // 0058 RAISE 2 R0 R0
+ 0x600C0010, // 0059 GETGBL R3 G16
+ 0x8C100100, // 005A GETMET R4 R0 K0
+ 0x5C180200, // 005B MOVE R6 R1
+ 0x7C100400, // 005C CALL R4 2
+ 0x7C0C0200, // 005D CALL R3 1
+ 0xA8020013, // 005E EXBLK 0 #0073
+ 0x5C100600, // 005F MOVE R4 R3
+ 0x7C100000, // 0060 CALL R4 0
+ 0x94140204, // 0061 GETIDX R5 R1 R4
+ 0x6018000F, // 0062 GETGBL R6 G15
+ 0x5C1C0A00, // 0063 MOVE R7 R5
+ 0x60200013, // 0064 GETGBL R8 G19
+ 0x7C180400, // 0065 CALL R6 2
+ 0x781A000A, // 0066 JMPF R6 #0072
+ 0x8C180B01, // 0067 GETMET R6 R5 K1
+ 0x5820000F, // 0068 LDCONST R8 K15
+ 0x7C180400, // 0069 CALL R6 2
+ 0x781A0006, // 006A JMPF R6 #0072
+ 0x00180910, // 006B ADD R6 R4 K16
+ 0x8C1C0504, // 006C GETMET R7 R2 K4
+ 0x60240013, // 006D GETGBL R9 G19
+ 0x7C240000, // 006E CALL R9 0
+ 0x98260B11, // 006F SETIDX R9 K5 K17
+ 0x98260E06, // 0070 SETIDX R9 K7 R6
+ 0x7C1C0400, // 0071 CALL R7 2
+ 0x7001FFEB, // 0072 JMP #005F
+ 0x580C0008, // 0073 LDCONST R3 K8
+ 0xAC0C0200, // 0074 CATCH R3 1 0
+ 0xB0080000, // 0075 RAISE 2 R0 R0
+ 0x80040400, // 0076 RET 1 R2
})
)
);
@@ -5983,76 +5863,273 @@ be_local_closure(Matter_Device_MtrInfo_one, /* name */
/********************************************************************
-** Solidified function: start
+** Solidified function: signal_endpoints_changed
********************************************************************/
-be_local_closure(Matter_Device_start, /* name */
+be_local_closure(Matter_Device_signal_endpoints_changed, /* name */
be_nested_proto(
- 6, /* nstack */
+ 7, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
- 1, /* has sup protos */
- ( &(const struct bproto*[ 1]) {
- be_nested_proto(
- 2, /* nstack */
- 0, /* argc */
- 0, /* varg */
- 1, /* has upvals */
- ( &(const bupvaldesc[ 1]) { /* upvals */
- be_local_const_upval(1, 0),
- }),
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(_trigger_read_sensors),
- }),
- be_str_weak(_anonymous_),
- &be_const_str_solidified,
- ( &(const binstruction[ 4]) { /* code */
- 0x68000000, // 0000 GETUPV R0 U0
- 0x8C000100, // 0001 GETMET R0 R0 K0
- 0x7C000200, // 0002 CALL R0 1
- 0x80000000, // 0003 RET 0
- })
- ),
- }),
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[ 9]) { /* constants */
- /* K0 */ be_nested_str_weak(started),
- /* K1 */ be_nested_str_weak(autoconf_device),
- /* K2 */ be_nested_str_weak(tasmota),
- /* K3 */ be_nested_str_weak(add_cron),
- /* K4 */ be_nested_str_weak(_X2A_X2F30_X20_X2A_X20_X2A_X20_X2A_X20_X2A_X20_X2A),
- /* K5 */ be_nested_str_weak(matter_sensors_30s),
- /* K6 */ be_nested_str_weak(_start_udp),
- /* K7 */ be_nested_str_weak(UDP_PORT),
- /* K8 */ be_nested_str_weak(start_mdns_announce_hostnames),
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(attribute_updated),
+ /* K1 */ be_const_int(0),
+ /* K2 */ be_const_int(3),
}),
- be_str_weak(start),
+ be_str_weak(signal_endpoints_changed),
&be_const_str_solidified,
- ( &(const binstruction[20]) { /* code */
+ ( &(const binstruction[13]) { /* code */
+ 0x8C040100, // 0000 GETMET R1 R0 K0
+ 0x580C0001, // 0001 LDCONST R3 K1
+ 0x5412001C, // 0002 LDINT R4 29
+ 0x58140002, // 0003 LDCONST R5 K2
+ 0x50180000, // 0004 LDBOOL R6 0 0
+ 0x7C040A00, // 0005 CALL R1 5
+ 0x8C040100, // 0006 GETMET R1 R0 K0
+ 0x540EFEFF, // 0007 LDINT R3 65280
+ 0x5412001C, // 0008 LDINT R4 29
+ 0x58140002, // 0009 LDCONST R5 K2
+ 0x50180000, // 000A LDBOOL R6 0 0
+ 0x7C040A00, // 000B CALL R1 5
+ 0x80000000, // 000C RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: every_second
+********************************************************************/
+be_local_closure(Matter_Device_every_second, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 6]) { /* constants */
+ /* K0 */ be_nested_str_weak(sessions),
+ /* K1 */ be_nested_str_weak(every_second),
+ /* K2 */ be_nested_str_weak(message_handler),
+ /* K3 */ be_nested_str_weak(commissioning_open),
+ /* K4 */ be_nested_str_weak(tasmota),
+ /* K5 */ be_nested_str_weak(time_reached),
+ }),
+ be_str_weak(every_second),
+ &be_const_str_solidified,
+ ( &(const binstruction[18]) { /* code */
0x88040100, // 0000 GETMBR R1 R0 K0
- 0x78060000, // 0001 JMPF R1 #0003
- 0x80000200, // 0002 RET 0
- 0x8C040101, // 0003 GETMET R1 R0 K1
- 0x7C040200, // 0004 CALL R1 1
- 0xB8060400, // 0005 GETNGBL R1 K2
- 0x8C040303, // 0006 GETMET R1 R1 K3
- 0x580C0004, // 0007 LDCONST R3 K4
- 0x84100000, // 0008 CLOSURE R4 P0
- 0x58140005, // 0009 LDCONST R5 K5
- 0x7C040800, // 000A CALL R1 4
- 0x8C040106, // 000B GETMET R1 R0 K6
- 0x880C0107, // 000C GETMBR R3 R0 K7
+ 0x8C040301, // 0001 GETMET R1 R1 K1
+ 0x7C040200, // 0002 CALL R1 1
+ 0x88040102, // 0003 GETMBR R1 R0 K2
+ 0x8C040301, // 0004 GETMET R1 R1 K1
+ 0x7C040200, // 0005 CALL R1 1
+ 0x88040103, // 0006 GETMBR R1 R0 K3
+ 0x4C080000, // 0007 LDNIL R2
+ 0x20040202, // 0008 NE R1 R1 R2
+ 0x78060006, // 0009 JMPF R1 #0011
+ 0xB8060800, // 000A GETNGBL R1 K4
+ 0x8C040305, // 000B GETMET R1 R1 K5
+ 0x880C0103, // 000C GETMBR R3 R0 K3
0x7C040400, // 000D CALL R1 2
- 0x8C040108, // 000E GETMET R1 R0 K8
- 0x7C040200, // 000F CALL R1 1
- 0x50040200, // 0010 LDBOOL R1 1 0
- 0x90020001, // 0011 SETMBR R0 K0 R1
- 0xA0000000, // 0012 CLOSE R0
- 0x80000000, // 0013 RET 0
+ 0x78060001, // 000E JMPF R1 #0011
+ 0x4C040000, // 000F LDNIL R1
+ 0x90020601, // 0010 SETMBR R0 K3 R1
+ 0x80000000, // 0011 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: load_param
+********************************************************************/
+be_local_closure(Matter_Device_load_param, /* name */
+ be_nested_proto(
+ 11, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[35]) { /* constants */
+ /* K0 */ be_nested_str_weak(crypto),
+ /* K1 */ be_nested_str_weak(FILENAME),
+ /* K2 */ be_nested_str_weak(read),
+ /* K3 */ be_nested_str_weak(close),
+ /* K4 */ be_nested_str_weak(json),
+ /* K5 */ be_nested_str_weak(load),
+ /* K6 */ be_nested_str_weak(root_discriminator),
+ /* K7 */ be_nested_str_weak(find),
+ /* K8 */ be_nested_str_weak(distinguish),
+ /* K9 */ be_nested_str_weak(root_passcode),
+ /* K10 */ be_nested_str_weak(passcode),
+ /* K11 */ be_nested_str_weak(ipv4only),
+ /* K12 */ be_nested_str_weak(disable_bridge_mode),
+ /* K13 */ be_nested_str_weak(next_ep),
+ /* K14 */ be_nested_str_weak(nextep),
+ /* K15 */ be_nested_str_weak(plugins_config),
+ /* K16 */ be_nested_str_weak(config),
+ /* K17 */ be_nested_str_weak(tasmota),
+ /* K18 */ be_nested_str_weak(log),
+ /* K19 */ be_nested_str_weak(MTR_X3A_X20load_config_X20_X3D_X20),
+ /* K20 */ be_const_int(3),
+ /* K21 */ be_nested_str_weak(adjust_next_ep),
+ /* K22 */ be_nested_str_weak(plugins_persist),
+ /* K23 */ be_nested_str_weak(plugins_config_remotes),
+ /* K24 */ be_nested_str_weak(remotes),
+ /* K25 */ be_nested_str_weak(MTR_X3A_X20load_remotes_X20_X3D_X20),
+ /* K26 */ be_nested_str_weak(io_error),
+ /* K27 */ be_nested_str_weak(MTR_X3A_X20Session_Store_X3A_X3Aload_X20Exception_X3A),
+ /* K28 */ be_nested_str_weak(_X7C),
+ /* K29 */ be_const_int(2),
+ /* K30 */ be_nested_str_weak(random),
+ /* K31 */ be_nested_str_weak(get),
+ /* K32 */ be_const_int(0),
+ /* K33 */ be_nested_str_weak(generate_random_passcode),
+ /* K34 */ be_nested_str_weak(save_param),
+ }),
+ be_str_weak(load_param),
+ &be_const_str_solidified,
+ ( &(const binstruction[127]) { /* code */
+ 0xA4060000, // 0000 IMPORT R1 K0
+ 0xA802004D, // 0001 EXBLK 0 #0050
+ 0x60080011, // 0002 GETGBL R2 G17
+ 0x880C0101, // 0003 GETMBR R3 R0 K1
+ 0x7C080200, // 0004 CALL R2 1
+ 0x8C0C0502, // 0005 GETMET R3 R2 K2
+ 0x7C0C0200, // 0006 CALL R3 1
+ 0x8C100503, // 0007 GETMET R4 R2 K3
+ 0x7C100200, // 0008 CALL R4 1
+ 0xA4120800, // 0009 IMPORT R4 K4
+ 0x8C140905, // 000A GETMET R5 R4 K5
+ 0x5C1C0600, // 000B MOVE R7 R3
+ 0x7C140400, // 000C CALL R5 2
+ 0x8C180B07, // 000D GETMET R6 R5 K7
+ 0x58200008, // 000E LDCONST R8 K8
+ 0x88240106, // 000F GETMBR R9 R0 K6
+ 0x7C180600, // 0010 CALL R6 3
+ 0x90020C06, // 0011 SETMBR R0 K6 R6
+ 0x8C180B07, // 0012 GETMET R6 R5 K7
+ 0x5820000A, // 0013 LDCONST R8 K10
+ 0x88240109, // 0014 GETMBR R9 R0 K9
+ 0x7C180600, // 0015 CALL R6 3
+ 0x90021206, // 0016 SETMBR R0 K9 R6
+ 0x60180017, // 0017 GETGBL R6 G23
+ 0x8C1C0B07, // 0018 GETMET R7 R5 K7
+ 0x5824000B, // 0019 LDCONST R9 K11
+ 0x50280000, // 001A LDBOOL R10 0 0
+ 0x7C1C0600, // 001B CALL R7 3
+ 0x7C180200, // 001C CALL R6 1
+ 0x90021606, // 001D SETMBR R0 K11 R6
+ 0x60180017, // 001E GETGBL R6 G23
+ 0x8C1C0B07, // 001F GETMET R7 R5 K7
+ 0x5824000C, // 0020 LDCONST R9 K12
+ 0x50280000, // 0021 LDBOOL R10 0 0
+ 0x7C1C0600, // 0022 CALL R7 3
+ 0x7C180200, // 0023 CALL R6 1
+ 0x90021806, // 0024 SETMBR R0 K12 R6
+ 0x8C180B07, // 0025 GETMET R6 R5 K7
+ 0x5820000E, // 0026 LDCONST R8 K14
+ 0x8824010D, // 0027 GETMBR R9 R0 K13
+ 0x7C180600, // 0028 CALL R6 3
+ 0x90021A06, // 0029 SETMBR R0 K13 R6
+ 0x8C180B07, // 002A GETMET R6 R5 K7
+ 0x58200010, // 002B LDCONST R8 K16
+ 0x7C180400, // 002C CALL R6 2
+ 0x90021E06, // 002D SETMBR R0 K15 R6
+ 0x8818010F, // 002E GETMBR R6 R0 K15
+ 0x4C1C0000, // 002F LDNIL R7
+ 0x20180C07, // 0030 NE R6 R6 R7
+ 0x781A000B, // 0031 JMPF R6 #003E
+ 0xB81A2200, // 0032 GETNGBL R6 K17
+ 0x8C180D12, // 0033 GETMET R6 R6 K18
+ 0x60200008, // 0034 GETGBL R8 G8
+ 0x8824010F, // 0035 GETMBR R9 R0 K15
+ 0x7C200200, // 0036 CALL R8 1
+ 0x00222608, // 0037 ADD R8 K19 R8
+ 0x58240014, // 0038 LDCONST R9 K20
+ 0x7C180600, // 0039 CALL R6 3
+ 0x8C180115, // 003A GETMET R6 R0 K21
+ 0x7C180200, // 003B CALL R6 1
+ 0x50180200, // 003C LDBOOL R6 1 0
+ 0x90022C06, // 003D SETMBR R0 K22 R6
+ 0x8C180B07, // 003E GETMET R6 R5 K7
+ 0x58200018, // 003F LDCONST R8 K24
+ 0x60240013, // 0040 GETGBL R9 G19
+ 0x7C240000, // 0041 CALL R9 0
+ 0x7C180600, // 0042 CALL R6 3
+ 0x90022E06, // 0043 SETMBR R0 K23 R6
+ 0x88180117, // 0044 GETMBR R6 R0 K23
+ 0x781A0007, // 0045 JMPF R6 #004E
+ 0xB81A2200, // 0046 GETNGBL R6 K17
+ 0x8C180D12, // 0047 GETMET R6 R6 K18
+ 0x60200008, // 0048 GETGBL R8 G8
+ 0x88240117, // 0049 GETMBR R9 R0 K23
+ 0x7C200200, // 004A CALL R8 1
+ 0x00223208, // 004B ADD R8 K25 R8
+ 0x58240014, // 004C LDCONST R9 K20
+ 0x7C180600, // 004D CALL R6 3
+ 0xA8040001, // 004E EXBLK 1 1
+ 0x70020012, // 004F JMP #0063
+ 0xAC080002, // 0050 CATCH R2 0 2
+ 0x7002000F, // 0051 JMP #0062
+ 0x2010051A, // 0052 NE R4 R2 K26
+ 0x7812000C, // 0053 JMPF R4 #0061
+ 0xB8122200, // 0054 GETNGBL R4 K17
+ 0x8C100912, // 0055 GETMET R4 R4 K18
+ 0x60180008, // 0056 GETGBL R6 G8
+ 0x5C1C0400, // 0057 MOVE R7 R2
+ 0x7C180200, // 0058 CALL R6 1
+ 0x001A3606, // 0059 ADD R6 K27 R6
+ 0x00180D1C, // 005A ADD R6 R6 K28
+ 0x601C0008, // 005B GETGBL R7 G8
+ 0x5C200600, // 005C MOVE R8 R3
+ 0x7C1C0200, // 005D CALL R7 1
+ 0x00180C07, // 005E ADD R6 R6 R7
+ 0x581C001D, // 005F LDCONST R7 K29
+ 0x7C100600, // 0060 CALL R4 3
+ 0x70020000, // 0061 JMP #0063
+ 0xB0080000, // 0062 RAISE 2 R0 R0
+ 0x50080000, // 0063 LDBOOL R2 0 0
+ 0x880C0106, // 0064 GETMBR R3 R0 K6
+ 0x4C100000, // 0065 LDNIL R4
+ 0x1C0C0604, // 0066 EQ R3 R3 R4
+ 0x780E000A, // 0067 JMPF R3 #0073
+ 0x8C0C031E, // 0068 GETMET R3 R1 K30
+ 0x5814001D, // 0069 LDCONST R5 K29
+ 0x7C0C0400, // 006A CALL R3 2
+ 0x8C0C071F, // 006B GETMET R3 R3 K31
+ 0x58140020, // 006C LDCONST R5 K32
+ 0x5818001D, // 006D LDCONST R6 K29
+ 0x7C0C0600, // 006E CALL R3 3
+ 0x54120FFE, // 006F LDINT R4 4095
+ 0x2C0C0604, // 0070 AND R3 R3 R4
+ 0x90020C03, // 0071 SETMBR R0 K6 R3
+ 0x50080200, // 0072 LDBOOL R2 1 0
+ 0x880C0109, // 0073 GETMBR R3 R0 K9
+ 0x4C100000, // 0074 LDNIL R4
+ 0x1C0C0604, // 0075 EQ R3 R3 R4
+ 0x780E0003, // 0076 JMPF R3 #007B
+ 0x8C0C0121, // 0077 GETMET R3 R0 K33
+ 0x7C0C0200, // 0078 CALL R3 1
+ 0x90021203, // 0079 SETMBR R0 K9 R3
+ 0x50080200, // 007A LDBOOL R2 1 0
+ 0x780A0001, // 007B JMPF R2 #007E
+ 0x8C0C0122, // 007C GETMET R3 R0 K34
+ 0x7C0C0200, // 007D CALL R3 1
+ 0x80000000, // 007E RET 0
})
)
);
@@ -6063,109 +6140,26 @@ be_local_closure(Matter_Device_start, /* name */
** Solidified class: Matter_Device
********************************************************************/
be_local_class(Matter_Device,
- 36,
+ 38,
NULL,
- be_nested_map(112,
+ be_nested_map(116,
( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(signal_endpoints_changed, -1), be_const_closure(Matter_Device_signal_endpoints_changed_closure) },
- { be_const_key_weak(msg_send, 105), be_const_closure(Matter_Device_msg_send_closure) },
- { be_const_key_weak(sort_distinct, -1), be_const_static_closure(Matter_Device_sort_distinct_closure) },
- { be_const_key_weak(MtrInfo_one, -1), be_const_closure(Matter_Device_MtrInfo_one_closure) },
- { be_const_key_weak(plugins_persist, -1), be_const_var(2) },
- { be_const_key_weak(_init_basic_commissioning, -1), be_const_closure(Matter_Device__init_basic_commissioning_closure) },
- { be_const_key_weak(root_discriminator, -1), be_const_var(27) },
- { be_const_key_weak(hostname_wifi, 85), be_const_var(20) },
- { be_const_key_weak(plugins, 15), be_const_var(1) },
- { be_const_key_weak(start_operational_discovery_deferred, -1), be_const_closure(Matter_Device_start_operational_discovery_deferred_closure) },
- { be_const_key_weak(plugins_config, -1), be_const_var(3) },
- { be_const_key_weak(get_active_endpoints, -1), be_const_closure(Matter_Device_get_active_endpoints_closure) },
- { be_const_key_weak(is_commissioning_open, 56), be_const_closure(Matter_Device_is_commissioning_open_closure) },
- { be_const_key_weak(http_remotes, 34), be_const_var(26) },
- { be_const_key_weak(vendorid, -1), be_const_var(22) },
- { be_const_key_weak(ui, 77), be_const_var(9) },
- { be_const_key_weak(ipv4only, -1), be_const_var(29) },
- { be_const_key_weak(start_operational_discovery, 49), be_const_closure(Matter_Device_start_operational_discovery_closure) },
- { be_const_key_weak(_mdns_announce_hostname, -1), be_const_closure(Matter_Device__mdns_announce_hostname_closure) },
- { be_const_key_weak(bridge_remove_endpoint, 37), be_const_closure(Matter_Device_bridge_remove_endpoint_closure) },
- { be_const_key_weak(find_plugin_by_endpoint, -1), be_const_closure(Matter_Device_find_plugin_by_endpoint_closure) },
- { be_const_key_weak(start_mdns_announce_hostnames, -1), be_const_closure(Matter_Device_start_mdns_announce_hostnames_closure) },
- { be_const_key_weak(_start_udp, 2), be_const_closure(Matter_Device__start_udp_closure) },
- { be_const_key_weak(compute_qrcode_content, 0), be_const_closure(Matter_Device_compute_qrcode_content_closure) },
- { be_const_key_weak(msg_received, -1), be_const_closure(Matter_Device_msg_received_closure) },
- { be_const_key_weak(_instantiate_plugins_from_config, 75), be_const_closure(Matter_Device__instantiate_plugins_from_config_closure) },
- { be_const_key_weak(root_salt, 103), be_const_var(33) },
- { be_const_key_weak(udp_server, -1), be_const_var(5) },
- { be_const_key_weak(sessions, -1), be_const_var(8) },
- { be_const_key_weak(PASSCODE_INVALID, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
- be_const_list( * be_nested_list(12,
- ( (struct bvalue*) &(const bvalue[]) {
- be_const_int(0),
- be_const_int(11111111),
- be_const_int(22222222),
- be_const_int(33333333),
- be_const_int(44444444),
- be_const_int(55555555),
- be_const_int(66666666),
- be_const_int(77777777),
- be_const_int(88888888),
- be_const_int(99999999),
- be_const_int(12345678),
- be_const_int(87654321),
- })) ) } )) },
- { be_const_key_weak(started, 93), be_const_var(0) },
- { be_const_key_weak(profiler, -1), be_const_var(6) },
- { be_const_key_weak(bridge_add_endpoint, 46), be_const_closure(Matter_Device_bridge_add_endpoint_closure) },
- { be_const_key_weak(productid, -1), be_const_var(23) },
- { be_const_key_weak(generate_random_passcode, -1), be_const_closure(Matter_Device_generate_random_passcode_closure) },
+ { be_const_key_weak(bridge_add_endpoint, -1), be_const_closure(Matter_Device_bridge_add_endpoint_closure) },
{ be_const_key_weak(load_param, -1), be_const_closure(Matter_Device_load_param_closure) },
- { be_const_key_weak(save_param, 62), be_const_closure(Matter_Device_save_param_closure) },
- { be_const_key_weak(init, -1), be_const_closure(Matter_Device_init_closure) },
- { be_const_key_weak(root_L, -1), be_const_var(35) },
- { be_const_key_weak(root_iterations, -1), be_const_var(32) },
- { be_const_key_weak(process_attribute_expansion, 86), be_const_closure(Matter_Device_process_attribute_expansion_closure) },
- { be_const_key_weak(_compute_pbkdf, -1), be_const_closure(Matter_Device__compute_pbkdf_closure) },
- { be_const_key_weak(commissioning_instance_wifi, -1), be_const_var(18) },
- { be_const_key_weak(register_commands, 45), be_const_closure(Matter_Device_register_commands_closure) },
- { be_const_key_weak(stop_basic_commissioning, -1), be_const_closure(Matter_Device_stop_basic_commissioning_closure) },
- { be_const_key_weak(MtrUpdate, -1), be_const_closure(Matter_Device_MtrUpdate_closure) },
- { be_const_key_weak(commissioning_admin_fabric, -1), be_const_var(17) },
- { be_const_key_weak(commissioning_L, -1), be_const_var(16) },
+ { be_const_key_weak(compute_manual_pairing_code, 36), be_const_closure(Matter_Device_compute_manual_pairing_code_closure) },
+ { be_const_key_weak(ipv4only, -1), be_const_var(29) },
{ be_const_key_weak(conf_to_log, -1), be_const_static_closure(Matter_Device_conf_to_log_closure) },
- { be_const_key_weak(update_remotes_info, -1), be_const_closure(Matter_Device_update_remotes_info_closure) },
- { be_const_key_weak(get_plugin_class_displayname, -1), be_const_closure(Matter_Device_get_plugin_class_displayname_closure) },
- { be_const_key_weak(mdns_pase_eth, 65), be_const_var(24) },
- { be_const_key_weak(tick, -1), be_const_var(10) },
- { be_const_key_weak(mdns_pase_wifi, -1), be_const_var(25) },
- { be_const_key_weak(autoconf_device_map, -1), be_const_closure(Matter_Device_autoconf_device_map_closure) },
- { be_const_key_weak(remove_fabric, 67), be_const_closure(Matter_Device_remove_fabric_closure) },
- { be_const_key_weak(commissioning_instance_eth, -1), be_const_var(19) },
- { be_const_key_weak(start_commissioning_complete, 80), be_const_closure(Matter_Device_start_commissioning_complete_closure) },
- { be_const_key_weak(adjust_next_ep, 39), be_const_closure(Matter_Device_adjust_next_ep_closure) },
- { be_const_key_weak(commissioning_discriminator, 8), be_const_var(13) },
- { be_const_key_weak(PRODUCT_ID, 44), be_const_int(32768) },
- { be_const_key_weak(autoconf_sensors_list, -1), be_const_closure(Matter_Device_autoconf_sensors_list_closure) },
- { be_const_key_weak(UDP_PORT, 76), be_const_int(5540) },
- { be_const_key_weak(PBKDF_ITERATIONS, -1), be_const_int(1000) },
- { be_const_key_weak(every_250ms, 92), be_const_closure(Matter_Device_every_250ms_closure) },
- { be_const_key_weak(mdns_announce_PASE, 99), be_const_closure(Matter_Device_mdns_announce_PASE_closure) },
- { be_const_key_weak(mdns_remove_PASE, 50), be_const_closure(Matter_Device_mdns_remove_PASE_closure) },
- { be_const_key_weak(mdns_remove_op_discovery, -1), be_const_closure(Matter_Device_mdns_remove_op_discovery_closure) },
- { be_const_key_weak(mdns_announce_op_discovery_all_fabrics, -1), be_const_closure(Matter_Device_mdns_announce_op_discovery_all_fabrics_closure) },
- { be_const_key_weak(received_ack, -1), be_const_closure(Matter_Device_received_ack_closure) },
- { be_const_key_weak(start_basic_commissioning, -1), be_const_closure(Matter_Device_start_basic_commissioning_closure) },
- { be_const_key_weak(_trigger_read_sensors, -1), be_const_closure(Matter_Device__trigger_read_sensors_closure) },
- { be_const_key_weak(every_50ms, 69), be_const_closure(Matter_Device_every_50ms_closure) },
- { be_const_key_weak(every_second, -1), be_const_closure(Matter_Device_every_second_closure) },
- { be_const_key_weak(plugins_config_remotes, 70), be_const_var(4) },
- { be_const_key_weak(VENDOR_ID, -1), be_const_int(65521) },
- { be_const_key_weak(compute_manual_pairing_code, -1), be_const_closure(Matter_Device_compute_manual_pairing_code_closure) },
- { be_const_key_weak(get_plugin_remote_info, -1), be_const_closure(Matter_Device_get_plugin_remote_info_closure) },
- { be_const_key_weak(event_fabrics_saved, -1), be_const_closure(Matter_Device_event_fabrics_saved_closure) },
- { be_const_key_weak(autoconf_device, -1), be_const_closure(Matter_Device_autoconf_device_closure) },
- { be_const_key_weak(message_handler, -1), be_const_var(7) },
- { be_const_key_weak(start_root_basic_commissioning, -1), be_const_closure(Matter_Device_start_root_basic_commissioning_closure) },
+ { be_const_key_weak(start_operational_discovery, -1), be_const_closure(Matter_Device_start_operational_discovery_closure) },
{ be_const_key_weak(commissioning_w0, -1), be_const_var(15) },
- { be_const_key_weak(start_commissioning_complete_deferred, 68), be_const_closure(Matter_Device_start_commissioning_complete_deferred_closure) },
+ { be_const_key_weak(every_second, -1), be_const_closure(Matter_Device_every_second_closure) },
+ { be_const_key_weak(tick, 96), be_const_var(10) },
+ { be_const_key_weak(profiler, 3), be_const_var(6) },
+ { be_const_key_weak(MtrInfo, -1), be_const_closure(Matter_Device_MtrInfo_closure) },
+ { be_const_key_weak(mdns_pase_eth, -1), be_const_var(24) },
+ { be_const_key_weak(signal_endpoints_changed, 72), be_const_closure(Matter_Device_signal_endpoints_changed_closure) },
+ { be_const_key_weak(MtrInfo_one, 58), be_const_closure(Matter_Device_MtrInfo_one_closure) },
+ { be_const_key_weak(vendorid, 97), be_const_var(22) },
+ { be_const_key_weak(commissioning_L, -1), be_const_var(16) },
{ be_const_key_weak(plugins_classes, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(41,
( (struct bmapnode*) &(const bmapnode[]) {
@@ -6211,33 +6205,120 @@ be_local_class(Matter_Device,
{ be_const_key_weak(humidity, -1), be_const_class(be_class_Matter_Plugin_Sensor_Humidity) },
{ be_const_key_weak(http_flow, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Flow) },
})) ) } )) },
- { be_const_key_weak(process_attribute_read_solo, -1), be_const_closure(Matter_Device_process_attribute_read_solo_closure) },
- { be_const_key_weak(attribute_updated, -1), be_const_closure(Matter_Device_attribute_updated_closure) },
- { be_const_key_weak(k2l_num, 57), be_const_static_closure(Matter_Device_k2l_num_closure) },
- { be_const_key_weak(FILENAME, 24), be_nested_str_weak(_matter_device_X2Ejson) },
- { be_const_key_weak(commissioning_open, -1), be_const_var(11) },
- { be_const_key_weak(MtrInfo, -1), be_const_closure(Matter_Device_MtrInfo_closure) },
- { be_const_key_weak(invoke_request, 47), be_const_closure(Matter_Device_invoke_request_closure) },
- { be_const_key_weak(next_ep, 84), be_const_var(31) },
- { be_const_key_weak(clean_remotes, -1), be_const_closure(Matter_Device_clean_remotes_closure) },
- { be_const_key_weak(MtrJoin, -1), be_const_closure(Matter_Device_MtrJoin_closure) },
- { be_const_key_weak(is_root_commissioning_open, 40), be_const_closure(Matter_Device_is_root_commissioning_open_closure) },
- { be_const_key_weak(find_plugin_by_friendly_name, -1), be_const_closure(Matter_Device_find_plugin_by_friendly_name_closure) },
- { be_const_key_weak(disable_bridge_mode, -1), be_const_var(30) },
- { be_const_key_weak(PASE_TIMEOUT, 36), be_const_int(600) },
- { be_const_key_weak(get_plugin_class_arg, -1), be_const_closure(Matter_Device_get_plugin_class_arg_closure) },
- { be_const_key_weak(register_http_remote, 31), be_const_closure(Matter_Device_register_http_remote_closure) },
- { be_const_key_weak(stop, 29), be_const_closure(Matter_Device_stop_closure) },
- { be_const_key_weak(mdns_announce_op_discovery, 27), be_const_closure(Matter_Device_mdns_announce_op_discovery_closure) },
- { be_const_key_weak(mdns_remove_op_discovery_all_fabrics, -1), be_const_closure(Matter_Device_mdns_remove_op_discovery_all_fabrics_closure) },
- { be_const_key_weak(hostname_eth, 16), be_const_var(21) },
- { be_const_key_weak(commissioning_salt, 107), be_const_var(14) },
- { be_const_key_weak(save_before_restart, 12), be_const_closure(Matter_Device_save_before_restart_closure) },
- { be_const_key_weak(root_w0, -1), be_const_var(34) },
- { be_const_key_weak(k2l, 7), be_const_static_closure(Matter_Device_k2l_closure) },
- { be_const_key_weak(commissioning_iterations, 3), be_const_var(12) },
- { be_const_key_weak(root_passcode, -1), be_const_var(28) },
+ { be_const_key_weak(root_L, 28), be_const_var(35) },
+ { be_const_key_weak(hostname_eth, -1), be_const_var(21) },
+ { be_const_key_weak(autoconf_device, 11), be_const_closure(Matter_Device_autoconf_device_closure) },
+ { be_const_key_weak(init, -1), be_const_closure(Matter_Device_init_closure) },
+ { be_const_key_weak(root_salt, -1), be_const_var(33) },
+ { be_const_key_weak(started, -1), be_const_var(0) },
+ { be_const_key_weak(add_read_sensors_schedule, -1), be_const_closure(Matter_Device_add_read_sensors_schedule_closure) },
+ { be_const_key_weak(hostname_wifi, 65), be_const_var(20) },
+ { be_const_key_weak(disable_bridge_mode, 71), be_const_var(30) },
+ { be_const_key_weak(generate_random_passcode, 66), be_const_closure(Matter_Device_generate_random_passcode_closure) },
+ { be_const_key_weak(get_active_endpoints, -1), be_const_closure(Matter_Device_get_active_endpoints_closure) },
+ { be_const_key_weak(_mdns_announce_hostname, -1), be_const_closure(Matter_Device__mdns_announce_hostname_closure) },
+ { be_const_key_weak(productid, 84), be_const_var(23) },
+ { be_const_key_weak(plugins_config_remotes, -1), be_const_var(4) },
+ { be_const_key_weak(start_commissioning_complete, -1), be_const_closure(Matter_Device_start_commissioning_complete_closure) },
+ { be_const_key_weak(bridge_remove_endpoint, -1), be_const_closure(Matter_Device_bridge_remove_endpoint_closure) },
+ { be_const_key_weak(commissioning_admin_fabric, -1), be_const_var(17) },
+ { be_const_key_weak(sort_distinct, 110), be_const_static_closure(Matter_Device_sort_distinct_closure) },
+ { be_const_key_weak(mdns_announce_op_discovery_all_fabrics, -1), be_const_closure(Matter_Device_mdns_announce_op_discovery_all_fabrics_closure) },
+ { be_const_key_weak(get_plugin_class_displayname, -1), be_const_closure(Matter_Device_get_plugin_class_displayname_closure) },
{ be_const_key_weak(start, -1), be_const_closure(Matter_Device_start_closure) },
+ { be_const_key_weak(adjust_next_ep, -1), be_const_closure(Matter_Device_adjust_next_ep_closure) },
+ { be_const_key_weak(attribute_updated, 20), be_const_closure(Matter_Device_attribute_updated_closure) },
+ { be_const_key_weak(PRODUCT_ID, -1), be_const_int(32768) },
+ { be_const_key_weak(_instantiate_plugins_from_config, -1), be_const_closure(Matter_Device__instantiate_plugins_from_config_closure) },
+ { be_const_key_weak(PASE_TIMEOUT, 17), be_const_int(600) },
+ { be_const_key_weak(commissioning_discriminator, 56), be_const_var(13) },
+ { be_const_key_weak(find_plugin_by_friendly_name, -1), be_const_closure(Matter_Device_find_plugin_by_friendly_name_closure) },
+ { be_const_key_weak(msg_send, -1), be_const_closure(Matter_Device_msg_send_closure) },
+ { be_const_key_weak(save_before_restart, 42), be_const_closure(Matter_Device_save_before_restart_closure) },
+ { be_const_key_weak(UDP_PORT, -1), be_const_int(5540) },
+ { be_const_key_weak(mdns_pase_wifi, -1), be_const_var(25) },
+ { be_const_key_weak(start_root_basic_commissioning, -1), be_const_closure(Matter_Device_start_root_basic_commissioning_closure) },
+ { be_const_key_weak(mdns_remove_op_discovery, 32), be_const_closure(Matter_Device_mdns_remove_op_discovery_closure) },
+ { be_const_key_weak(invoke_request, 50), be_const_closure(Matter_Device_invoke_request_closure) },
+ { be_const_key_weak(probe_sensor_time, 33), be_const_var(36) },
+ { be_const_key_weak(commissioning_open, -1), be_const_var(11) },
+ { be_const_key_weak(start_basic_commissioning, 101), be_const_closure(Matter_Device_start_basic_commissioning_closure) },
+ { be_const_key_weak(commissioning_instance_wifi, -1), be_const_var(18) },
+ { be_const_key_weak(read_sensors_scheduler, 27), be_const_closure(Matter_Device_read_sensors_scheduler_closure) },
+ { be_const_key_weak(http_remotes, -1), be_const_var(26) },
+ { be_const_key_weak(commissioning_iterations, -1), be_const_var(12) },
+ { be_const_key_weak(PBKDF_ITERATIONS, -1), be_const_int(1000) },
+ { be_const_key_weak(k2l, -1), be_const_static_closure(Matter_Device_k2l_closure) },
+ { be_const_key_weak(start_operational_discovery_deferred, 48), be_const_closure(Matter_Device_start_operational_discovery_deferred_closure) },
+ { be_const_key_weak(autoconf_device_map, -1), be_const_closure(Matter_Device_autoconf_device_map_closure) },
+ { be_const_key_weak(mdns_announce_PASE, -1), be_const_closure(Matter_Device_mdns_announce_PASE_closure) },
+ { be_const_key_weak(message_handler, -1), be_const_var(7) },
+ { be_const_key_weak(every_50ms, -1), be_const_closure(Matter_Device_every_50ms_closure) },
+ { be_const_key_weak(start_mdns_announce_hostnames, -1), be_const_closure(Matter_Device_start_mdns_announce_hostnames_closure) },
+ { be_const_key_weak(_trigger_read_sensors, 95), be_const_closure(Matter_Device__trigger_read_sensors_closure) },
+ { be_const_key_weak(every_250ms, -1), be_const_closure(Matter_Device_every_250ms_closure) },
+ { be_const_key_weak(PASSCODE_INVALID, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
+ be_const_list( * be_nested_list(12,
+ ( (struct bvalue*) &(const bvalue[]) {
+ be_const_int(0),
+ be_const_int(11111111),
+ be_const_int(22222222),
+ be_const_int(33333333),
+ be_const_int(44444444),
+ be_const_int(55555555),
+ be_const_int(66666666),
+ be_const_int(77777777),
+ be_const_int(88888888),
+ be_const_int(99999999),
+ be_const_int(12345678),
+ be_const_int(87654321),
+ })) ) } )) },
+ { be_const_key_weak(udp_server, 81), be_const_var(5) },
+ { be_const_key_weak(_init_basic_commissioning, -1), be_const_closure(Matter_Device__init_basic_commissioning_closure) },
+ { be_const_key_weak(MtrUpdate, -1), be_const_closure(Matter_Device_MtrUpdate_closure) },
+ { be_const_key_weak(probe_sensor_timestamp, 37), be_const_var(37) },
+ { be_const_key_weak(mdns_announce_op_discovery, 90), be_const_closure(Matter_Device_mdns_announce_op_discovery_closure) },
+ { be_const_key_weak(remove_fabric, -1), be_const_closure(Matter_Device_remove_fabric_closure) },
+ { be_const_key_weak(sessions, -1), be_const_var(8) },
+ { be_const_key_weak(_compute_pbkdf, -1), be_const_closure(Matter_Device__compute_pbkdf_closure) },
+ { be_const_key_weak(msg_received, 18), be_const_closure(Matter_Device_msg_received_closure) },
+ { be_const_key_weak(k2l_num, 73), be_const_static_closure(Matter_Device_k2l_num_closure) },
+ { be_const_key_weak(process_attribute_read_solo, 78), be_const_closure(Matter_Device_process_attribute_read_solo_closure) },
+ { be_const_key_weak(is_commissioning_open, -1), be_const_closure(Matter_Device_is_commissioning_open_closure) },
+ { be_const_key_weak(plugins_config, 47), be_const_var(3) },
+ { be_const_key_weak(register_commands, -1), be_const_closure(Matter_Device_register_commands_closure) },
+ { be_const_key_weak(root_w0, -1), be_const_var(34) },
+ { be_const_key_weak(commissioning_salt, -1), be_const_var(14) },
+ { be_const_key_weak(event_fabrics_saved, -1), be_const_closure(Matter_Device_event_fabrics_saved_closure) },
+ { be_const_key_weak(compute_qrcode_content, 12), be_const_closure(Matter_Device_compute_qrcode_content_closure) },
+ { be_const_key_weak(find_plugin_by_endpoint, -1), be_const_closure(Matter_Device_find_plugin_by_endpoint_closure) },
+ { be_const_key_weak(update_remotes_info, 26), be_const_closure(Matter_Device_update_remotes_info_closure) },
+ { be_const_key_weak(MtrJoin, -1), be_const_closure(Matter_Device_MtrJoin_closure) },
+ { be_const_key_weak(start_commissioning_complete_deferred, 64), be_const_closure(Matter_Device_start_commissioning_complete_deferred_closure) },
+ { be_const_key_weak(next_ep, -1), be_const_var(31) },
+ { be_const_key_weak(stop, -1), be_const_closure(Matter_Device_stop_closure) },
+ { be_const_key_weak(mdns_remove_PASE, 55), be_const_closure(Matter_Device_mdns_remove_PASE_closure) },
+ { be_const_key_weak(plugins, -1), be_const_var(1) },
+ { be_const_key_weak(plugins_persist, -1), be_const_var(2) },
+ { be_const_key_weak(commissioning_instance_eth, 105), be_const_var(19) },
+ { be_const_key_weak(_start_udp, -1), be_const_closure(Matter_Device__start_udp_closure) },
+ { be_const_key_weak(get_plugin_remote_info, -1), be_const_closure(Matter_Device_get_plugin_remote_info_closure) },
+ { be_const_key_weak(register_http_remote, -1), be_const_closure(Matter_Device_register_http_remote_closure) },
+ { be_const_key_weak(root_passcode, -1), be_const_var(28) },
+ { be_const_key_weak(mdns_remove_op_discovery_all_fabrics, -1), be_const_closure(Matter_Device_mdns_remove_op_discovery_all_fabrics_closure) },
+ { be_const_key_weak(get_plugin_class_arg, -1), be_const_closure(Matter_Device_get_plugin_class_arg_closure) },
+ { be_const_key_weak(FILENAME, -1), be_nested_str_weak(_matter_device_X2Ejson) },
+ { be_const_key_weak(root_discriminator, -1), be_const_var(27) },
+ { be_const_key_weak(clean_remotes, 21), be_const_closure(Matter_Device_clean_remotes_closure) },
+ { be_const_key_weak(is_root_commissioning_open, -1), be_const_closure(Matter_Device_is_root_commissioning_open_closure) },
+ { be_const_key_weak(stop_basic_commissioning, -1), be_const_closure(Matter_Device_stop_basic_commissioning_closure) },
+ { be_const_key_weak(autoconf_sensors_list, -1), be_const_closure(Matter_Device_autoconf_sensors_list_closure) },
+ { be_const_key_weak(save_param, -1), be_const_closure(Matter_Device_save_param_closure) },
+ { be_const_key_weak(ui, -1), be_const_var(9) },
+ { be_const_key_weak(received_ack, 9), be_const_closure(Matter_Device_received_ack_closure) },
+ { be_const_key_weak(VENDOR_ID, 7), be_const_int(65521) },
+ { be_const_key_weak(root_iterations, -1), be_const_var(32) },
+ { be_const_key_weak(process_attribute_expansion, 1), be_const_closure(Matter_Device_process_attribute_expansion_closure) },
})),
be_str_weak(Matter_Device)
);
From c13886e00d68e4b1ccc1f6505a9ef371ea32d7ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?DUPONCHEEL=20S=C3=A9bastien?=
Date: Mon, 25 Dec 2023 08:54:53 +0100
Subject: [PATCH 042/303] HDMI CEC: Fix HDMIType command (#20308)
According to documentation HDMIType is from 0 to 5 but the actual check is lower than 1 and above or equal 6, so the function is never applied. Also note that setting the HDMIType to 0 use the default type value 4, that make impossible the emulation of a TV device.
---
tasmota/tasmota_xdrv_driver/xdrv_70_1_hdmi_cec.ino | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_70_1_hdmi_cec.ino b/tasmota/tasmota_xdrv_driver/xdrv_70_1_hdmi_cec.ino
index e77e1a5b0..4a1daf136 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_70_1_hdmi_cec.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_70_1_hdmi_cec.ino
@@ -189,7 +189,7 @@ void CmndHDMISend(void) {
//
void CmndHDMIType(void) {
if (XdrvMailbox.data_len > 0) {
- if ((XdrvMailbox.payload < 1) && (XdrvMailbox.payload >= CEC_Device::CDT_LAST)) {
+ if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload < CEC_Device::CDT_LAST)) {
uint8_t type = XdrvMailbox.payload;
if (type != Settings->hdmi_cec_device_type) {
Settings->hdmi_cec_device_type = XdrvMailbox.payload;
From bebffa040f8ed1eaa6d727f171855f981f0de922 Mon Sep 17 00:00:00 2001
From: UBWH <72185209+UBWH@users.noreply.github.com>
Date: Mon, 25 Dec 2023 16:13:32 +0800
Subject: [PATCH 043/303] Update xdrv_58_range_extender.ino (#20295)
RESULT to RgxSSId command is not valid JSON
BEFORE:
RSL: RESULT = {"Rgx":{"Valid":"true","SSId":"solar_5BDBFC","Password":"MyPassword","IPAddress":"192.168.99.1","Subnetmask":"255.255.255.0"}
AFTER
RSL: RESULT = {"Rgx":{"Valid":"true","SSId":"solar_5BDBFC","Password":"MyPassword","IPAddress":"192.168.99.1","Subnetmask":"255.255.255.0"}}
Not extra terminating '}'
---
tasmota/tasmota_xdrv_driver/xdrv_58_range_extender.ino | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_58_range_extender.ino b/tasmota/tasmota_xdrv_driver/xdrv_58_range_extender.ino
index 3868dde46..d72880649 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_58_range_extender.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_58_range_extender.ino
@@ -377,7 +377,7 @@ void CmndRgxPort(void)
void ResponseRgxConfig(void)
{
RgxCheckConfig();
- Response_P(PSTR("{\"Rgx\":{\"Valid\":\"%s\",\"" D_CMND_SSID "\":\"%s\",\"" D_CMND_PASSWORD "\":\"%s\",\"" D_CMND_IPADDRESS "\":\"%_I\",\"" D_JSON_SUBNETMASK "\":\"%_I\"}"),
+ Response_P(PSTR("{\"Rgx\":{\"Valid\":\"%s\",\"" D_CMND_SSID "\":\"%s\",\"" D_CMND_PASSWORD "\":\"%s\",\"" D_CMND_IPADDRESS "\":\"%_I\",\"" D_JSON_SUBNETMASK "\":\"%_I\"}}"),
(RgxSettings.status == RGX_CONFIG_INCOMPLETE) ? "false" : "true",
EscapeJSONString(SettingsText(SET_RGX_SSID)).c_str(),
EscapeJSONString(SettingsText(SET_RGX_PASSWORD)).c_str(),
@@ -529,4 +529,4 @@ bool Xdrv58(uint32_t function)
return result;
}
-#endif // USE_WIFI_RANGE_EXTENDER
\ No newline at end of file
+#endif // USE_WIFI_RANGE_EXTENDER
From 2808653ad97b4b59b713d174416c549c9caaca41 Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Mon, 25 Dec 2023 11:01:19 +0100
Subject: [PATCH 044/303] Moved Berry animate to its own `berry_animate` lib
(#20309)
* Moved Berry animate to its own `berry_animate` lib
* Fix solidification
* fix compilation
* Fix compilation
---
.github/workflows/Tasmota_build_devel.yml | 10 +-
CHANGELOG.md | 1 +
lib/libesp32/berry/gen.sh | 2 +-
lib/libesp32/berry_animate/library.json | 17 +
lib/libesp32/berry_animate/path.be | 2 +
lib/libesp32/berry_animate/solidify_all.be | 99 +
.../src/be_animate_module.c | 5 +-
.../berry_animate/src/be_berry_leds_frame.cpp | 179 ++
.../src/be_leds_frame_lib.c | 2 +
.../berry_animate/src/berry_animate.h | 8 +
.../src/embedded/animate_0.be | 0
.../src/embedded/animate_1_core.be | 0
.../src/embedded/animate_2_animate_effects.be | 0
.../src/embedded/animate_9_module.be | 0
.../src/embedded/leds_frame_be_methods.be | 0
lib/libesp32/berry_animate/src/solidify/.keep | 0
.../src/solidify/solidified_animate_0.h | 7 +
.../src/solidify/solidified_animate_1_core.h | 871 +++++++++
.../solidified_animate_2_animate_effects.h | 450 +++++
.../solidify/solidified_animate_9_module.h | 1592 +++++++++++++++++
.../solidified_leds_frame_be_methods.h | 186 ++
pio-tools/gen-berry-structures.py | 2 +-
.../xdrv_52_3_berry_leds.ino | 188 +-
.../tasmota_xdrv_driver/xdrv_52_9_berry.ino | 3 +
24 files changed, 3452 insertions(+), 172 deletions(-)
create mode 100644 lib/libesp32/berry_animate/library.json
create mode 100644 lib/libesp32/berry_animate/path.be
create mode 100755 lib/libesp32/berry_animate/solidify_all.be
rename lib/libesp32/{berry_tasmota => berry_animate}/src/be_animate_module.c (99%)
create mode 100644 lib/libesp32/berry_animate/src/be_berry_leds_frame.cpp
rename lib/libesp32/{berry_tasmota => berry_animate}/src/be_leds_frame_lib.c (96%)
create mode 100644 lib/libesp32/berry_animate/src/berry_animate.h
rename lib/libesp32/{berry_tasmota => berry_animate}/src/embedded/animate_0.be (100%)
rename lib/libesp32/{berry_tasmota => berry_animate}/src/embedded/animate_1_core.be (100%)
rename lib/libesp32/{berry_tasmota => berry_animate}/src/embedded/animate_2_animate_effects.be (100%)
rename lib/libesp32/{berry_tasmota => berry_animate}/src/embedded/animate_9_module.be (100%)
rename lib/libesp32/{berry_tasmota => berry_animate}/src/embedded/leds_frame_be_methods.be (100%)
create mode 100644 lib/libesp32/berry_animate/src/solidify/.keep
create mode 100644 lib/libesp32/berry_animate/src/solidify/solidified_animate_0.h
create mode 100644 lib/libesp32/berry_animate/src/solidify/solidified_animate_1_core.h
create mode 100644 lib/libesp32/berry_animate/src/solidify/solidified_animate_2_animate_effects.h
create mode 100644 lib/libesp32/berry_animate/src/solidify/solidified_animate_9_module.h
create mode 100644 lib/libesp32/berry_animate/src/solidify/solidified_leds_frame_be_methods.h
diff --git a/.github/workflows/Tasmota_build_devel.yml b/.github/workflows/Tasmota_build_devel.yml
index 50eedbea2..48fc99fa4 100644
--- a/.github/workflows/Tasmota_build_devel.yml
+++ b/.github/workflows/Tasmota_build_devel.yml
@@ -38,14 +38,18 @@ jobs:
run: |
cd lib/libesp32/berry_matter
../berry/berry -s -g solidify_all.be
+ - name: Berry Animate Code
+ run: |
+ cd lib/libesp32/berry_animate
+ ../berry/berry -s -g solidify_all.be
- name: LVGL Berry Code
run: |
cd lib/libesp32_lvgl/lv_binding_berry
../../libesp32/berry/berry -s -g solidify_all.be
- uses: jason2866/upload-artifact@v2.0.2
with:
- name: '["berry_tasmota", "berry_matter", "berry_lvgl", "berry_header"]'
- path: '["./lib/libesp32/berry_tasmota/src/solidify", "./lib/libesp32/berry_matter/src/solidify", "./lib/libesp32_lvgl/lv_binding_berry/src/solidify", "./lib/libesp32/berry/generate"]'
+ name: '["berry_tasmota", "berry_matter", "berry_animate", "berry_lvgl", "berry_header"]'
+ path: '["./lib/libesp32/berry_tasmota/src/solidify", "./lib/libesp32/berry_matter/src/solidify", "./lib/libesp32/berry_animate/src/solidify", "./lib/libesp32_lvgl/lv_binding_berry/src/solidify", "./lib/libesp32/berry/generate"]'
push_solidified:
needs: be_solidify
@@ -63,11 +67,13 @@ jobs:
name: |
berry_tasmota
berry_matter
+ berrt_animate
berry_lvgl
berry_header
path: |
./lib/libesp32/berry_tasmota/src/solidify
./lib/libesp32/berry_matter/src/solidify
+ ./lib/libesp32/berry_animate/src/solidify
./lib/libesp32_lvgl/lv_binding_berry/src/solidify
./lib/libesp32/berry/generate
- uses: stefanzweifel/git-auto-commit-action@v4
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2a7795908..828a099c7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file.
### Changed
- Support syslog updates every sleep or every second if `#define SYSLOG_UPDATE_SECOND` (#20260)
+- Moved Berry animate to its own `berry_animate` lib
### Fixed
- Matter Contact sensor was not triggering any update (#20232)
diff --git a/lib/libesp32/berry/gen.sh b/lib/libesp32/berry/gen.sh
index 2df6ad838..a0edbd2df 100755
--- a/lib/libesp32/berry/gen.sh
+++ b/lib/libesp32/berry/gen.sh
@@ -5,4 +5,4 @@
# Included in the Platformio build process with `pio-tools/gen-berry-structures.py
#
rm -Rf ./generate/be_*.h
-python3 tools/coc/coc -o generate src default ../berry_tasmota/src ../berry_mapping/src ../berry_int64/src ../../libesp32_lvgl/lv_binding_berry/src ../berry_matter/src/solidify ../berry_matter/src ../../libesp32_lvgl/lv_binding_berry/src/solidify ../../libesp32_lvgl/lv_binding_berry/generate -c default/berry_conf.h
+python3 tools/coc/coc -o generate src default ../berry_tasmota/src ../berry_mapping/src ../berry_int64/src ../../libesp32_lvgl/lv_binding_berry/src ../berry_matter/src/solidify ../berry_matter/src ../berry_animate/src/solidify ../berry_animate/src ../../libesp32_lvgl/lv_binding_berry/src/solidify ../../libesp32_lvgl/lv_binding_berry/generate -c default/berry_conf.h
diff --git a/lib/libesp32/berry_animate/library.json b/lib/libesp32/berry_animate/library.json
new file mode 100644
index 000000000..3033e8a52
--- /dev/null
+++ b/lib/libesp32/berry_animate/library.json
@@ -0,0 +1,17 @@
+{
+ "name": "Berry animation library for WS2812 leds",
+ "version": "0.1",
+ "description": "Berry animation library for WS2812 leds",
+ "license": "MIT",
+ "homepage": "https://github.com/arendst/Tasmota",
+ "frameworks": "arduino",
+ "platforms": "espressif32",
+ "authors":
+ {
+ "name": "Stephan Hadinger",
+ "maintainer": true
+ },
+ "build": {
+ "flags": [ "-I$PROJECT_DIR/include", "-includetasmota_options.h" ]
+ }
+}
\ No newline at end of file
diff --git a/lib/libesp32/berry_animate/path.be b/lib/libesp32/berry_animate/path.be
new file mode 100644
index 000000000..afba51adc
--- /dev/null
+++ b/lib/libesp32/berry_animate/path.be
@@ -0,0 +1,2 @@
+# empty module
+# allows stand-alone `import path`
diff --git a/lib/libesp32/berry_animate/solidify_all.be b/lib/libesp32/berry_animate/solidify_all.be
new file mode 100755
index 000000000..cf19458aa
--- /dev/null
+++ b/lib/libesp32/berry_animate/solidify_all.be
@@ -0,0 +1,99 @@
+#!/usr/bin/env -S ../berry/berry -s -g
+#
+# Berry solidify files
+
+import os
+import global
+import solidify
+import string as string2
+import re
+
+import sys
+sys.path().push('src/embedded') # allow to import from src/embedded
+
+# globals that need to exist to make compilation succeed
+var globs = "path,ctypes_bytes_dyn,tasmota,ccronexpr,gpio,light,webclient,load,MD5,lv,light_state,udp,tcpclientasync,"
+ "lv_clock,lv_clock_icon,lv_signal_arcs,lv_signal_bars,lv_wifi_arcs_icon,lv_wifi_arcs,"
+ "lv_wifi_bars_icon,lv_wifi_bars,"
+ "_lvgl,"
+ "int64"
+
+for g:string2.split(globs, ",")
+ global.(g) = nil
+end
+
+var prefix_dir = "src/embedded/"
+var prefix_out = "src/solidify/"
+
+def sort(l)
+ # insertion sort
+ for i:1..size(l)-1
+ var k = l[i]
+ var j = i
+ while (j > 0) && (l[j-1] > k)
+ l[j] = l[j-1]
+ j -= 1
+ end
+ l[j] = k
+ end
+ return l
+end
+
+def clean_directory(dir)
+ var file_list = os.listdir(dir)
+ for f : file_list
+ if f[0] == '.' continue end # ignore files starting with `.`
+ os.remove(dir + f)
+ end
+end
+
+var pattern = "#@\\s*solidify:([A-Za-z0-9_.,]+)"
+
+def parse_file(fname, prefix_out)
+ print("Parsing: ", fname)
+ var f = open(prefix_dir + fname)
+ var src = f.read()
+ f.close()
+ # try to compile
+ var compiled = compile(src)
+ compiled() # run the compile code to instanciate the classes and modules
+ # output solidified
+ var fname_h = string2.split(fname, '.be')[0] + '.h' # take whatever is before the first '.be'
+ var fout = open(prefix_out + "solidified_" + fname_h, "w")
+ fout.write(f"/* Solidification of {fname_h} */\n")
+ fout.write("/********************************************************************\\\n")
+ fout.write("* Generated code, don't edit *\n")
+ fout.write("\\********************************************************************/\n")
+ fout.write('#include "be_constobj.h"\n')
+
+ var directives = re.searchall(pattern, src)
+ # print(directives)
+
+ for directive : directives
+ var object_list = string2.split(directive[1], ',')
+ var object_name = object_list[0]
+ var weak = (object_list.find('weak') != nil) # do we solidify with weak strings?
+ var o = global
+ var cl_name = nil
+ var obj_name = nil
+ for subname : string2.split(object_name, '.')
+ o = o.(subname)
+ cl_name = obj_name
+ obj_name = subname
+ end
+ solidify.dump(o, weak, fout, cl_name)
+ end
+
+ fout.write("/********************************************************************/\n")
+ fout.write("/* End of solidification */\n")
+ fout.close()
+end
+
+clean_directory(prefix_out)
+
+var src_file_list = os.listdir(prefix_dir)
+src_file_list = sort(src_file_list)
+for src_file : src_file_list
+ if src_file[0] == '.' continue end
+ parse_file(src_file, prefix_out)
+end
diff --git a/lib/libesp32/berry_tasmota/src/be_animate_module.c b/lib/libesp32/berry_animate/src/be_animate_module.c
similarity index 99%
rename from lib/libesp32/berry_tasmota/src/be_animate_module.c
rename to lib/libesp32/berry_animate/src/be_animate_module.c
index 3c920e6be..83ba2bb62 100644
--- a/lib/libesp32/berry_tasmota/src/be_animate_module.c
+++ b/lib/libesp32/berry_animate/src/be_animate_module.c
@@ -21,6 +21,7 @@
* `animate` global module
\*******************************************************************/
+#ifdef USE_BERRY
#include "be_constobj.h"
#include "be_mapping.h"
@@ -238,4 +239,6 @@ assert(o.animate(7000) == -1000)
-*/
\ No newline at end of file
+*/
+
+#endif // USE_BERRY
diff --git a/lib/libesp32/berry_animate/src/be_berry_leds_frame.cpp b/lib/libesp32/berry_animate/src/be_berry_leds_frame.cpp
new file mode 100644
index 000000000..70917593f
--- /dev/null
+++ b/lib/libesp32/berry_animate/src/be_berry_leds_frame.cpp
@@ -0,0 +1,179 @@
+/*
+ xdrv_52_3_berry_leds.ino - Berry scripting language, native fucnctions
+
+ Copyright (C) 2021 Stephan Hadinger, Berry language by Guan Wenliang https://github.com/Skiars/berry
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+
+#ifdef USE_BERRY
+
+#include
+
+#ifdef USE_WS2812
+
+extern uint16_t changeUIntScale(uint16_t inum, uint16_t ifrom_min, uint16_t ifrom_max,uint16_t ito_min, uint16_t ito_max);
+extern uint32_t ApplyBriGamma(uint32_t color_a /* 0xRRGGBB */, uint32_t bri /* 0..255 */, bool gamma);
+
+extern "C" {
+ // Leds_frame.blend(color1:int, color2:int, alpha:int) -> int
+ //
+ int32_t be_leds_blend(bvm *vm);
+ int32_t be_leds_blend(bvm *vm) {
+ int32_t top = be_top(vm); // Get the number of arguments
+ if (top >= 3 && be_isint(vm, 1) && be_isint(vm, 2) && be_isint(vm, 3)) {
+ uint32_t color_a = be_toint(vm, 1);
+ uint32_t color_b = be_toint(vm, 2);
+ uint32_t alpha = be_toint(vm, 3);
+ uint32_t r = (color_a >> 16) & 0xFF;
+ uint32_t g = (color_a >> 8) & 0xFF;
+ uint32_t b = (color_a ) & 0xFF;
+ uint32_t a = (color_a >> 24) & 0xFF;
+ uint32_t r2 = (color_b >> 16) & 0xFF;
+ uint32_t g2 = (color_b >> 8) & 0xFF;
+ uint32_t b2 = (color_b ) & 0xFF;
+ uint32_t a2 = (color_b >> 24) & 0xFF;
+ uint32_t r3 = changeUIntScale(alpha, 0, 255, r2, r);
+ uint32_t g3 = changeUIntScale(alpha, 0, 255, g2, g);
+ uint32_t b3 = changeUIntScale(alpha, 0, 255, b2, b);
+ uint32_t a3 = changeUIntScale(alpha, 0, 255, a2, a);
+ uint32_t rgb = (a3 << 24) | (r3 << 16) | (g3 << 8) | b3;
+ be_pushint(vm, rgb);
+ be_return(vm);
+ }
+ be_raise(vm, "type_error", nullptr);
+ }
+
+ // Leds_frame.blend_pixels(dest:bytes(), foreground:bytes) -> nil
+ // Destination can be the same as foreground or background
+ //
+ // All calculation are done in `0xAARRGGBB` format, AA=0 if opaque (i.e. ignored)
+ // Background has always alpha = 0 (any other value is ignored) - for simplification
+ // Size is truncated to smallest of all 3 buffers
+ int32_t be_leds_blend_pixels(bvm *vm);
+ int32_t be_leds_blend_pixels(bvm *vm) {
+ int32_t top = be_top(vm); // Get the number of arguments
+ if (top >= 2 && be_isbytes(vm, 2)) {
+ size_t dest_len = 0;
+ uint32_t * dest_buf = (uint32_t*) be_tobytes(vm, 1, &dest_len);
+ // back = dest for now, could be changed in the future
+ size_t back_len = 0;
+ const uint32_t * back_buf = (const uint32_t*) be_tobytes(vm, 1, &back_len);
+ size_t fore_len = 0;
+ const uint32_t * fore_buf = (const uint32_t*) be_tobytes(vm, 2, &fore_len);
+
+ if (fore_len < dest_len) { dest_len = fore_len; }
+ if (back_len < dest_len) { dest_len = back_len; }
+ size_t pixels_count = dest_len / 4;
+ if (pixels_count > 0) {
+ uint32_t * dest = (uint32_t *)dest_buf;
+ uint32_t * back = (uint32_t *)back_buf;
+ uint32_t * fore = (uint32_t *)fore_buf;
+ for (size_t i = 0; i < pixels_count; i++) {
+ uint32_t back_argb = back[i];
+ uint32_t fore_argb = fore[i];
+ uint32_t fore_alpha = (fore_argb >> 24) & 0xFF;
+ uint32_t dest_rgb_new = back_argb;
+ if (fore_alpha == 0) { // opaque layer, copy value from fore
+ dest_rgb_new = fore_argb;
+ } else if (fore_alpha == 255) { // fore is transparent, use back
+ // nothing to do, dest_rgb_new = back_argb above
+ } else {
+ uint32_t back_r = (back_argb >> 16) & 0xFF;
+ uint32_t fore_r = (fore_argb >> 16) & 0xFF;
+ uint32_t back_g = (back_argb >> 8) & 0xFF;
+ uint32_t fore_g = (fore_argb >> 8) & 0xFF;
+ uint32_t back_b = (back_argb ) & 0xFF;
+ uint32_t fore_b = (fore_argb ) & 0xFF;
+ uint32_t dest_r_new = changeUIntScale(fore_alpha, 0, 255, fore_r, back_r);
+ uint32_t dest_g_new = changeUIntScale(fore_alpha, 0, 255, fore_g, back_g);
+ uint32_t dest_b_new = changeUIntScale(fore_alpha, 0, 255, fore_b, back_b);
+ dest_rgb_new = (dest_r_new << 16) | (dest_g_new << 8) | dest_b_new;
+ }
+ dest[i] = dest_rgb_new;
+ }
+ }
+ be_return_nil(vm);
+ }
+ be_raise(vm, "type_error", nullptr);
+ }
+
+ // Leds_frame.fill_pixels(dest:bytes(), color:int) -> nil
+ //
+ // Fill buffer with same color
+ int32_t be_leds_fill_pixels(bvm *vm);
+ int32_t be_leds_fill_pixels(bvm *vm) {
+ int32_t top = be_top(vm); // Get the number of arguments
+ if (top >= 2 && be_isint(vm, 2)) {
+ size_t dest_len = 0;
+ uint32_t * dest_buf = (uint32_t*) be_tobytes(vm, 1, &dest_len);
+ uint32_t color = be_toint(vm, 2);
+
+ size_t pixels_count = dest_len / 4;
+ if (pixels_count > 0) {
+ uint32_t * dest = (uint32_t *)dest_buf;
+ for (size_t i = 0; i < pixels_count; i++) {
+ dest[i] = color;
+ }
+ }
+ be_return_nil(vm);
+ }
+ be_raise(vm, "type_error", nullptr);
+ }
+
+ // Leds_frame.paste_pixels(neopixel:bytes(), led_buffer:bytes(), bri:int 0..100, gamma:bool)
+ //
+ // Copy from ARGB buffer to GRB
+ int32_t be_leds_paste_pixels(bvm *vm);
+ int32_t be_leds_paste_pixels(bvm *vm) {
+ int32_t top = be_top(vm); // Get the number of arguments
+ if (top >= 2 && be_isbytes(vm, 2)) {
+ size_t src_len = 0;
+ uint32_t * src_buf = (uint32_t*) be_tobytes(vm, 1, &src_len);
+ size_t dest_len = 0;
+ uint8_t * dest_buf = (uint8_t*) be_tobytes(vm, 2, &dest_len);
+
+ uint32_t bri255 = 255;
+ if (top >= 3 && be_isint(vm, 3)) {
+ bri255 = be_toint(vm, 3);
+ }
+ bool gamma = false;
+ if (top >= 4 && be_isbool(vm, 4)) {
+ gamma = be_tobool(vm, 4);
+ }
+
+ size_t pixels_count = src_len / 4;
+ if (pixels_count > dest_len / 3) { pixels_count = dest_len / 3; }
+ if (pixels_count > 0) {
+ for (size_t i = 0; i < pixels_count; i++) {
+ uint32_t src_argb = ApplyBriGamma(src_buf[i], bri255, gamma);
+ uint32_t src_r = (src_argb >> 16) & 0xFF;
+ uint32_t src_g = (src_argb >> 8) & 0xFF;
+ uint32_t src_b = (src_argb ) & 0xFF;
+ dest_buf[i * 3 + 0] = src_g;
+ dest_buf[i * 3 + 1] = src_r;
+ dest_buf[i * 3 + 2] = src_b;
+ }
+ }
+ be_return_nil(vm);
+ }
+ be_raise(vm, "type_error", nullptr);
+ }
+
+
+}
+
+#endif // USE_WS2812
+#endif // USE_BERRY
diff --git a/lib/libesp32/berry_tasmota/src/be_leds_frame_lib.c b/lib/libesp32/berry_animate/src/be_leds_frame_lib.c
similarity index 96%
rename from lib/libesp32/berry_tasmota/src/be_leds_frame_lib.c
rename to lib/libesp32/berry_animate/src/be_leds_frame_lib.c
index a1b1c353b..36d82d28e 100644
--- a/lib/libesp32/berry_tasmota/src/be_leds_frame_lib.c
+++ b/lib/libesp32/berry_animate/src/be_leds_frame_lib.c
@@ -3,6 +3,7 @@
*
*******************************************************************/
+#ifdef USE_BERRY
#include "be_constobj.h"
#ifdef USE_WS2812
@@ -37,3 +38,4 @@ class be_class_Leds_frame (scope: global, name: Leds_frame, super:be_class_bytes
#include "be_fixed_be_class_Leds_frame.h"
#endif // USE_WS2812
+#endif // USE_BERRY
diff --git a/lib/libesp32/berry_animate/src/berry_animate.h b/lib/libesp32/berry_animate/src/berry_animate.h
new file mode 100644
index 000000000..87e27bd27
--- /dev/null
+++ b/lib/libesp32/berry_animate/src/berry_animate.h
@@ -0,0 +1,8 @@
+// force include of module by including this file
+
+#ifndef __BERRY_ANIMATE__
+#define __BERRY_ANIMATE__
+
+
+
+#endif // __BERRY_ANIMATE__
diff --git a/lib/libesp32/berry_tasmota/src/embedded/animate_0.be b/lib/libesp32/berry_animate/src/embedded/animate_0.be
similarity index 100%
rename from lib/libesp32/berry_tasmota/src/embedded/animate_0.be
rename to lib/libesp32/berry_animate/src/embedded/animate_0.be
diff --git a/lib/libesp32/berry_tasmota/src/embedded/animate_1_core.be b/lib/libesp32/berry_animate/src/embedded/animate_1_core.be
similarity index 100%
rename from lib/libesp32/berry_tasmota/src/embedded/animate_1_core.be
rename to lib/libesp32/berry_animate/src/embedded/animate_1_core.be
diff --git a/lib/libesp32/berry_tasmota/src/embedded/animate_2_animate_effects.be b/lib/libesp32/berry_animate/src/embedded/animate_2_animate_effects.be
similarity index 100%
rename from lib/libesp32/berry_tasmota/src/embedded/animate_2_animate_effects.be
rename to lib/libesp32/berry_animate/src/embedded/animate_2_animate_effects.be
diff --git a/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be b/lib/libesp32/berry_animate/src/embedded/animate_9_module.be
similarity index 100%
rename from lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be
rename to lib/libesp32/berry_animate/src/embedded/animate_9_module.be
diff --git a/lib/libesp32/berry_tasmota/src/embedded/leds_frame_be_methods.be b/lib/libesp32/berry_animate/src/embedded/leds_frame_be_methods.be
similarity index 100%
rename from lib/libesp32/berry_tasmota/src/embedded/leds_frame_be_methods.be
rename to lib/libesp32/berry_animate/src/embedded/leds_frame_be_methods.be
diff --git a/lib/libesp32/berry_animate/src/solidify/.keep b/lib/libesp32/berry_animate/src/solidify/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/lib/libesp32/berry_animate/src/solidify/solidified_animate_0.h b/lib/libesp32/berry_animate/src/solidify/solidified_animate_0.h
new file mode 100644
index 000000000..a0a262928
--- /dev/null
+++ b/lib/libesp32/berry_animate/src/solidify/solidified_animate_0.h
@@ -0,0 +1,7 @@
+/* Solidification of animate_0.h */
+/********************************************************************\
+* Generated code, don't edit *
+\********************************************************************/
+#include "be_constobj.h"
+/********************************************************************/
+/* End of solidification */
diff --git a/lib/libesp32/berry_animate/src/solidify/solidified_animate_1_core.h b/lib/libesp32/berry_animate/src/solidify/solidified_animate_1_core.h
new file mode 100644
index 000000000..280b7de5c
--- /dev/null
+++ b/lib/libesp32/berry_animate/src/solidify/solidified_animate_1_core.h
@@ -0,0 +1,871 @@
+/* Solidification of animate_1_core.h */
+/********************************************************************\
+* Generated code, don't edit *
+\********************************************************************/
+#include "be_constobj.h"
+
+extern const bclass be_class_Animate_core;
+
+/********************************************************************
+** Solidified function: clear
+********************************************************************/
+be_local_closure(Animate_core_clear, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(stop),
+ /* K1 */ be_nested_str_weak(strip),
+ /* K2 */ be_nested_str_weak(clear),
+ }),
+ be_str_weak(clear),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 6]) { /* code */
+ 0x8C040100, // 0000 GETMET R1 R0 K0
+ 0x7C040200, // 0001 CALL R1 1
+ 0x88040101, // 0002 GETMBR R1 R0 K1
+ 0x8C040302, // 0003 GETMET R1 R1 K2
+ 0x7C040200, // 0004 CALL R1 1
+ 0x80000000, // 0005 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_strip_bri
+********************************************************************/
+be_local_closure(Animate_core_set_strip_bri, /* name */
+ be_nested_proto(
+ 10, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 6]) { /* constants */
+ /* K0 */ be_nested_str_weak(strip),
+ /* K1 */ be_nested_str_weak(set_bri),
+ /* K2 */ be_nested_str_weak(tasmota),
+ /* K3 */ be_nested_str_weak(scale_uint),
+ /* K4 */ be_nested_str_weak(bri),
+ /* K5 */ be_const_int(0),
+ }),
+ be_str_weak(set_strip_bri),
+ &be_const_str_solidified,
+ ( &(const binstruction[12]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x8C040301, // 0001 GETMET R1 R1 K1
+ 0xB80E0400, // 0002 GETNGBL R3 K2
+ 0x8C0C0703, // 0003 GETMET R3 R3 K3
+ 0x88140104, // 0004 GETMBR R5 R0 K4
+ 0x58180005, // 0005 LDCONST R6 K5
+ 0x541E0063, // 0006 LDINT R7 100
+ 0x58200005, // 0007 LDCONST R8 K5
+ 0x542600FE, // 0008 LDINT R9 255
+ 0x7C0C0C00, // 0009 CALL R3 6
+ 0x7C040400, // 000A CALL R1 2
+ 0x80000000, // 000B RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: remove_painter
+********************************************************************/
+be_local_closure(Animate_core_remove_painter, /* name */
+ be_nested_proto(
+ 8, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(painters),
+ /* K1 */ be_nested_str_weak(remove),
+ /* K2 */ be_nested_str_weak(find),
+ /* K3 */ be_nested_str_weak(clear),
+ }),
+ be_str_weak(remove_painter),
+ &be_const_str_solidified,
+ ( &(const binstruction[13]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x4C0C0000, // 0001 LDNIL R3
+ 0x200C0203, // 0002 NE R3 R1 R3
+ 0x780E0005, // 0003 JMPF R3 #000A
+ 0x8C0C0501, // 0004 GETMET R3 R2 K1
+ 0x8C140502, // 0005 GETMET R5 R2 K2
+ 0x5C1C0200, // 0006 MOVE R7 R1
+ 0x7C140400, // 0007 CALL R5 2
+ 0x7C0C0400, // 0008 CALL R3 2
+ 0x70020001, // 0009 JMP #000C
+ 0x8C0C0503, // 000A GETMET R3 R2 K3
+ 0x7C0C0200, // 000B CALL R3 1
+ 0x80000000, // 000C RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: stop
+********************************************************************/
+be_local_closure(Animate_core_stop, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 8]) { /* constants */
+ /* K0 */ be_nested_str_weak(running),
+ /* K1 */ be_nested_str_weak(animators),
+ /* K2 */ be_const_int(0),
+ /* K3 */ be_nested_str_weak(stop),
+ /* K4 */ be_const_int(1),
+ /* K5 */ be_nested_str_weak(tasmota),
+ /* K6 */ be_nested_str_weak(remove_fast_loop),
+ /* K7 */ be_nested_str_weak(fast_loop_cb),
+ }),
+ be_str_weak(stop),
+ &be_const_str_solidified,
+ ( &(const binstruction[19]) { /* code */
+ 0x50040000, // 0000 LDBOOL R1 0 0
+ 0x90020001, // 0001 SETMBR R0 K0 R1
+ 0x88040101, // 0002 GETMBR R1 R0 K1
+ 0x58080002, // 0003 LDCONST R2 K2
+ 0x600C000C, // 0004 GETGBL R3 G12
+ 0x5C100200, // 0005 MOVE R4 R1
+ 0x7C0C0200, // 0006 CALL R3 1
+ 0x140C0403, // 0007 LT R3 R2 R3
+ 0x780E0004, // 0008 JMPF R3 #000E
+ 0x940C0202, // 0009 GETIDX R3 R1 R2
+ 0x8C0C0703, // 000A GETMET R3 R3 K3
+ 0x7C0C0200, // 000B CALL R3 1
+ 0x00080504, // 000C ADD R2 R2 K4
+ 0x7001FFF5, // 000D JMP #0004
+ 0xB80E0A00, // 000E GETNGBL R3 K5
+ 0x8C0C0706, // 000F GETMET R3 R3 K6
+ 0x88140107, // 0010 GETMBR R5 R0 K7
+ 0x7C0C0400, // 0011 CALL R3 2
+ 0x80000000, // 0012 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: get_bri
+********************************************************************/
+be_local_closure(Animate_core_get_bri, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(bri),
+ }),
+ be_str_weak(get_bri),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x80040400, // 0001 RET 1 R2
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_bri
+********************************************************************/
+be_local_closure(Animate_core_set_bri, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(bri),
+ /* K1 */ be_nested_str_weak(set_strip_bri),
+ }),
+ be_str_weak(set_bri),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 4]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x8C080101, // 0001 GETMET R2 R0 K1
+ 0x7C080200, // 0002 CALL R2 1
+ 0x80000000, // 0003 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: add_painter
+********************************************************************/
+be_local_closure(Animate_core_add_painter, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(painters),
+ /* K1 */ be_nested_str_weak(find),
+ /* K2 */ be_nested_str_weak(push),
+ }),
+ be_str_weak(add_painter),
+ &be_const_str_solidified,
+ ( &(const binstruction[12]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x8C080501, // 0001 GETMET R2 R2 K1
+ 0x5C100200, // 0002 MOVE R4 R1
+ 0x7C080400, // 0003 CALL R2 2
+ 0x4C0C0000, // 0004 LDNIL R3
+ 0x1C080403, // 0005 EQ R2 R2 R3
+ 0x780A0003, // 0006 JMPF R2 #000B
+ 0x88080100, // 0007 GETMBR R2 R0 K0
+ 0x8C080502, // 0008 GETMET R2 R2 K2
+ 0x5C100200, // 0009 MOVE R4 R1
+ 0x7C080400, // 000A CALL R2 2
+ 0x80000000, // 000B RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: fast_loop
+********************************************************************/
+be_local_closure(Animate_core_fast_loop, /* name */
+ be_nested_proto(
+ 13, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[28]) { /* constants */
+ /* K0 */ be_nested_str_weak(running),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(time_reached),
+ /* K3 */ be_nested_str_weak(fast_loop_next),
+ /* K4 */ be_nested_str_weak(strip),
+ /* K5 */ be_nested_str_weak(can_show),
+ /* K6 */ be_nested_str_weak(frame),
+ /* K7 */ be_nested_str_weak(fill_pixels),
+ /* K8 */ be_nested_str_weak(back_color),
+ /* K9 */ be_const_int(0),
+ /* K10 */ be_nested_str_weak(millis),
+ /* K11 */ be_nested_str_weak(FAST_LOOP_MIN),
+ /* K12 */ be_nested_str_weak(animators),
+ /* K13 */ be_nested_str_weak(animate),
+ /* K14 */ be_const_int(1),
+ /* K15 */ be_nested_str_weak(layer),
+ /* K16 */ be_nested_str_weak(painters),
+ /* K17 */ be_const_int(-16777216),
+ /* K18 */ be_nested_str_weak(paint),
+ /* K19 */ be_nested_str_weak(blend_pixels),
+ /* K20 */ be_nested_str_weak(obj),
+ /* K21 */ be_nested_str_weak(mth),
+ /* K22 */ be_nested_str_weak(paste_pixels),
+ /* K23 */ be_nested_str_weak(pixels_buffer),
+ /* K24 */ be_nested_str_weak(get_bri),
+ /* K25 */ be_nested_str_weak(get_gamma),
+ /* K26 */ be_nested_str_weak(dirty),
+ /* K27 */ be_nested_str_weak(show),
+ }),
+ be_str_weak(fast_loop),
+ &be_const_str_solidified,
+ ( &(const binstruction[84]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x78060050, // 0001 JMPF R1 #0053
+ 0xB8060200, // 0002 GETNGBL R1 K1
+ 0x8C040302, // 0003 GETMET R1 R1 K2
+ 0x880C0103, // 0004 GETMBR R3 R0 K3
+ 0x7C040400, // 0005 CALL R1 2
+ 0x7806004B, // 0006 JMPF R1 #0053
+ 0x88040104, // 0007 GETMBR R1 R0 K4
+ 0x8C040305, // 0008 GETMET R1 R1 K5
+ 0x7C040200, // 0009 CALL R1 1
+ 0x78060047, // 000A JMPF R1 #0053
+ 0x88040106, // 000B GETMBR R1 R0 K6
+ 0x8C040307, // 000C GETMET R1 R1 K7
+ 0x880C0108, // 000D GETMBR R3 R0 K8
+ 0x7C040400, // 000E CALL R1 2
+ 0x58040009, // 000F LDCONST R1 K9
+ 0xB80A0200, // 0010 GETNGBL R2 K1
+ 0x8C08050A, // 0011 GETMET R2 R2 K10
+ 0x7C080200, // 0012 CALL R2 1
+ 0x880C010B, // 0013 GETMBR R3 R0 K11
+ 0x000C0403, // 0014 ADD R3 R2 R3
+ 0x90020603, // 0015 SETMBR R0 K3 R3
+ 0x600C000C, // 0016 GETGBL R3 G12
+ 0x8810010C, // 0017 GETMBR R4 R0 K12
+ 0x7C0C0200, // 0018 CALL R3 1
+ 0x140C0203, // 0019 LT R3 R1 R3
+ 0x780E0006, // 001A JMPF R3 #0022
+ 0x880C010C, // 001B GETMBR R3 R0 K12
+ 0x940C0601, // 001C GETIDX R3 R3 R1
+ 0x8C0C070D, // 001D GETMET R3 R3 K13
+ 0x5C140400, // 001E MOVE R5 R2
+ 0x7C0C0400, // 001F CALL R3 2
+ 0x0004030E, // 0020 ADD R1 R1 K14
+ 0x7001FFF3, // 0021 JMP #0016
+ 0x58040009, // 0022 LDCONST R1 K9
+ 0x880C0106, // 0023 GETMBR R3 R0 K6
+ 0x8810010F, // 0024 GETMBR R4 R0 K15
+ 0x6014000C, // 0025 GETGBL R5 G12
+ 0x88180110, // 0026 GETMBR R6 R0 K16
+ 0x7C140200, // 0027 CALL R5 1
+ 0x14140205, // 0028 LT R5 R1 R5
+ 0x7816000D, // 0029 JMPF R5 #0038
+ 0x8C140907, // 002A GETMET R5 R4 K7
+ 0x581C0011, // 002B LDCONST R7 K17
+ 0x7C140400, // 002C CALL R5 2
+ 0x88140110, // 002D GETMBR R5 R0 K16
+ 0x94140A01, // 002E GETIDX R5 R5 R1
+ 0x8C140B12, // 002F GETMET R5 R5 K18
+ 0x5C1C0800, // 0030 MOVE R7 R4
+ 0x7C140400, // 0031 CALL R5 2
+ 0x78160002, // 0032 JMPF R5 #0036
+ 0x8C140713, // 0033 GETMET R5 R3 K19
+ 0x5C1C0800, // 0034 MOVE R7 R4
+ 0x7C140400, // 0035 CALL R5 2
+ 0x0004030E, // 0036 ADD R1 R1 K14
+ 0x7001FFEC, // 0037 JMP #0025
+ 0x88140114, // 0038 GETMBR R5 R0 K20
+ 0x88180115, // 0039 GETMBR R6 R0 K21
+ 0x78160003, // 003A JMPF R5 #003F
+ 0x781A0002, // 003B JMPF R6 #003F
+ 0x5C1C0C00, // 003C MOVE R7 R6
+ 0x5C200A00, // 003D MOVE R8 R5
+ 0x7C1C0200, // 003E CALL R7 1
+ 0x8C1C010D, // 003F GETMET R7 R0 K13
+ 0x7C1C0200, // 0040 CALL R7 1
+ 0x881C0106, // 0041 GETMBR R7 R0 K6
+ 0x8C1C0F16, // 0042 GETMET R7 R7 K22
+ 0x88240104, // 0043 GETMBR R9 R0 K4
+ 0x8C241317, // 0044 GETMET R9 R9 K23
+ 0x7C240200, // 0045 CALL R9 1
+ 0x88280104, // 0046 GETMBR R10 R0 K4
+ 0x8C281518, // 0047 GETMET R10 R10 K24
+ 0x7C280200, // 0048 CALL R10 1
+ 0x882C0104, // 0049 GETMBR R11 R0 K4
+ 0x8C2C1719, // 004A GETMET R11 R11 K25
+ 0x7C2C0200, // 004B CALL R11 1
+ 0x7C1C0800, // 004C CALL R7 4
+ 0x881C0104, // 004D GETMBR R7 R0 K4
+ 0x8C1C0F1A, // 004E GETMET R7 R7 K26
+ 0x7C1C0200, // 004F CALL R7 1
+ 0x881C0104, // 0050 GETMBR R7 R0 K4
+ 0x8C1C0F1B, // 0051 GETMET R7 R7 K27
+ 0x7C1C0200, // 0052 CALL R7 1
+ 0x80000000, // 0053 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: remove_animator
+********************************************************************/
+be_local_closure(Animate_core_remove_animator, /* name */
+ be_nested_proto(
+ 8, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(animators),
+ /* K1 */ be_nested_str_weak(remove),
+ /* K2 */ be_nested_str_weak(find),
+ /* K3 */ be_nested_str_weak(clear),
+ }),
+ be_str_weak(remove_animator),
+ &be_const_str_solidified,
+ ( &(const binstruction[13]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x4C0C0000, // 0001 LDNIL R3
+ 0x200C0203, // 0002 NE R3 R1 R3
+ 0x780E0005, // 0003 JMPF R3 #000A
+ 0x8C0C0501, // 0004 GETMET R3 R2 K1
+ 0x8C140502, // 0005 GETMET R5 R2 K2
+ 0x5C1C0200, // 0006 MOVE R7 R1
+ 0x7C140400, // 0007 CALL R5 2
+ 0x7C0C0400, // 0008 CALL R3 2
+ 0x70020001, // 0009 JMP #000C
+ 0x8C0C0503, // 000A GETMET R3 R2 K3
+ 0x7C0C0200, // 000B CALL R3 1
+ 0x80000000, // 000C RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: animate
+********************************************************************/
+be_local_closure(Animate_core_animate, /* name */
+ be_nested_proto(
+ 1, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 0, /* has constants */
+ NULL, /* no const */
+ be_str_weak(animate),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 1]) { /* code */
+ 0x80000000, // 0000 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_current
+********************************************************************/
+be_local_closure(Animate_core_set_current, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(global),
+ /* K1 */ be_nested_str_weak(_cur_anim),
+ }),
+ be_str_weak(set_current),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 3]) { /* code */
+ 0xB8060000, // 0000 GETNGBL R1 K0
+ 0x90060200, // 0001 SETMBR R1 K1 R0
+ 0x80000000, // 0002 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: init
+********************************************************************/
+be_local_closure(Animate_core_init, /* name */
+ be_nested_proto(
+ 7, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 1, /* has sup protos */
+ ( &(const struct bproto*[ 1]) {
+ be_nested_proto(
+ 2, /* nstack */
+ 0, /* argc */
+ 0, /* varg */
+ 1, /* has upvals */
+ ( &(const bupvaldesc[ 1]) { /* upvals */
+ be_local_const_upval(1, 0),
+ }),
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(fast_loop),
+ }),
+ be_str_weak(_anonymous_),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 4]) { /* code */
+ 0x68000000, // 0000 GETUPV R0 U0
+ 0x8C000100, // 0001 GETMET R0 R0 K0
+ 0x7C000200, // 0002 CALL R0 1
+ 0x80000000, // 0003 RET 0
+ })
+ ),
+ }),
+ 1, /* has constants */
+ ( &(const bvalue[15]) { /* constants */
+ /* K0 */ be_nested_str_weak(animate),
+ /* K1 */ be_nested_str_weak(strip),
+ /* K2 */ be_nested_str_weak(bri),
+ /* K3 */ be_nested_str_weak(set_strip_bri),
+ /* K4 */ be_nested_str_weak(running),
+ /* K5 */ be_nested_str_weak(pixel_count),
+ /* K6 */ be_nested_str_weak(animators),
+ /* K7 */ be_nested_str_weak(painters),
+ /* K8 */ be_nested_str_weak(clear),
+ /* K9 */ be_nested_str_weak(frame),
+ /* K10 */ be_nested_str_weak(layer),
+ /* K11 */ be_nested_str_weak(fast_loop_cb),
+ /* K12 */ be_nested_str_weak(back_color),
+ /* K13 */ be_const_int(0),
+ /* K14 */ be_nested_str_weak(set_current),
+ }),
+ be_str_weak(init),
+ &be_const_str_solidified,
+ ( &(const binstruction[37]) { /* code */
+ 0xA40E0000, // 0000 IMPORT R3 K0
+ 0x90020201, // 0001 SETMBR R0 K1 R1
+ 0x4C100000, // 0002 LDNIL R4
+ 0x1C100404, // 0003 EQ R4 R2 R4
+ 0x78120000, // 0004 JMPF R4 #0006
+ 0x540A0031, // 0005 LDINT R2 50
+ 0x90020402, // 0006 SETMBR R0 K2 R2
+ 0x8C100103, // 0007 GETMET R4 R0 K3
+ 0x7C100200, // 0008 CALL R4 1
+ 0x50100000, // 0009 LDBOOL R4 0 0
+ 0x90020804, // 000A SETMBR R0 K4 R4
+ 0x8C100305, // 000B GETMET R4 R1 K5
+ 0x7C100200, // 000C CALL R4 1
+ 0x90020A04, // 000D SETMBR R0 K5 R4
+ 0x60100012, // 000E GETGBL R4 G18
+ 0x7C100000, // 000F CALL R4 0
+ 0x90020C04, // 0010 SETMBR R0 K6 R4
+ 0x60100012, // 0011 GETGBL R4 G18
+ 0x7C100000, // 0012 CALL R4 0
+ 0x90020E04, // 0013 SETMBR R0 K7 R4
+ 0x8C100108, // 0014 GETMET R4 R0 K8
+ 0x7C100200, // 0015 CALL R4 1
+ 0x8C100709, // 0016 GETMET R4 R3 K9
+ 0x88180105, // 0017 GETMBR R6 R0 K5
+ 0x7C100400, // 0018 CALL R4 2
+ 0x90021204, // 0019 SETMBR R0 K9 R4
+ 0x8C100709, // 001A GETMET R4 R3 K9
+ 0x88180105, // 001B GETMBR R6 R0 K5
+ 0x7C100400, // 001C CALL R4 2
+ 0x90021404, // 001D SETMBR R0 K10 R4
+ 0x84100000, // 001E CLOSURE R4 P0
+ 0x90021604, // 001F SETMBR R0 K11 R4
+ 0x9002190D, // 0020 SETMBR R0 K12 K13
+ 0x8C10010E, // 0021 GETMET R4 R0 K14
+ 0x7C100200, // 0022 CALL R4 1
+ 0xA0000000, // 0023 CLOSE R0
+ 0x80000000, // 0024 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_cb
+********************************************************************/
+be_local_closure(Animate_core_set_cb, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(obj),
+ /* K1 */ be_nested_str_weak(mth),
+ }),
+ be_str_weak(set_cb),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 3]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x90020202, // 0001 SETMBR R0 K1 R2
+ 0x80000000, // 0002 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_back_color
+********************************************************************/
+be_local_closure(Animate_core_set_back_color, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(back_color),
+ }),
+ be_str_weak(set_back_color),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: add_background_animator
+********************************************************************/
+be_local_closure(Animate_core_add_background_animator, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(set_cb),
+ /* K1 */ be_nested_str_weak(set_back_color),
+ /* K2 */ be_nested_str_weak(add_animator),
+ }),
+ be_str_weak(add_background_animator),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 8]) { /* code */
+ 0x8C080300, // 0000 GETMET R2 R1 K0
+ 0x5C100000, // 0001 MOVE R4 R0
+ 0x88140101, // 0002 GETMBR R5 R0 K1
+ 0x7C080600, // 0003 CALL R2 3
+ 0x8C080102, // 0004 GETMET R2 R0 K2
+ 0x5C100200, // 0005 MOVE R4 R1
+ 0x7C080400, // 0006 CALL R2 2
+ 0x80000000, // 0007 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: add_animator
+********************************************************************/
+be_local_closure(Animate_core_add_animator, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(animators),
+ /* K1 */ be_nested_str_weak(find),
+ /* K2 */ be_nested_str_weak(push),
+ }),
+ be_str_weak(add_animator),
+ &be_const_str_solidified,
+ ( &(const binstruction[12]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x8C080501, // 0001 GETMET R2 R2 K1
+ 0x5C100200, // 0002 MOVE R4 R1
+ 0x7C080400, // 0003 CALL R2 2
+ 0x4C0C0000, // 0004 LDNIL R3
+ 0x1C080403, // 0005 EQ R2 R2 R3
+ 0x780A0003, // 0006 JMPF R2 #000B
+ 0x88080100, // 0007 GETMBR R2 R0 K0
+ 0x8C080502, // 0008 GETMET R2 R2 K2
+ 0x5C100200, // 0009 MOVE R4 R1
+ 0x7C080400, // 000A CALL R2 2
+ 0x80000000, // 000B RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: remove
+********************************************************************/
+be_local_closure(Animate_core_remove, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(clear),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(remove_fast_loop),
+ /* K3 */ be_nested_str_weak(fast_loop_cb),
+ }),
+ be_str_weak(remove),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 7]) { /* code */
+ 0x8C040100, // 0000 GETMET R1 R0 K0
+ 0x7C040200, // 0001 CALL R1 1
+ 0xB8060200, // 0002 GETNGBL R1 K1
+ 0x8C040302, // 0003 GETMET R1 R1 K2
+ 0x880C0103, // 0004 GETMBR R3 R0 K3
+ 0x7C040400, // 0005 CALL R1 2
+ 0x80000000, // 0006 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: start
+********************************************************************/
+be_local_closure(Animate_core_start, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 9]) { /* constants */
+ /* K0 */ be_nested_str_weak(running),
+ /* K1 */ be_nested_str_weak(animators),
+ /* K2 */ be_const_int(0),
+ /* K3 */ be_nested_str_weak(start),
+ /* K4 */ be_const_int(1),
+ /* K5 */ be_nested_str_weak(fast_loop_next),
+ /* K6 */ be_nested_str_weak(tasmota),
+ /* K7 */ be_nested_str_weak(add_fast_loop),
+ /* K8 */ be_nested_str_weak(fast_loop_cb),
+ }),
+ be_str_weak(start),
+ &be_const_str_solidified,
+ ( &(const binstruction[20]) { /* code */
+ 0x50040200, // 0000 LDBOOL R1 1 0
+ 0x90020001, // 0001 SETMBR R0 K0 R1
+ 0x88040101, // 0002 GETMBR R1 R0 K1
+ 0x58080002, // 0003 LDCONST R2 K2
+ 0x600C000C, // 0004 GETGBL R3 G12
+ 0x5C100200, // 0005 MOVE R4 R1
+ 0x7C0C0200, // 0006 CALL R3 1
+ 0x140C0403, // 0007 LT R3 R2 R3
+ 0x780E0004, // 0008 JMPF R3 #000E
+ 0x940C0202, // 0009 GETIDX R3 R1 R2
+ 0x8C0C0703, // 000A GETMET R3 R3 K3
+ 0x7C0C0200, // 000B CALL R3 1
+ 0x00080504, // 000C ADD R2 R2 K4
+ 0x7001FFF5, // 000D JMP #0004
+ 0x90020B02, // 000E SETMBR R0 K5 K2
+ 0xB80E0C00, // 000F GETNGBL R3 K6
+ 0x8C0C0707, // 0010 GETMET R3 R3 K7
+ 0x88140108, // 0011 GETMBR R5 R0 K8
+ 0x7C0C0400, // 0012 CALL R3 2
+ 0x80000000, // 0013 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified class: Animate_core
+********************************************************************/
+be_local_class(Animate_core,
+ 13,
+ NULL,
+ be_nested_map(32,
+ ( (struct bmapnode*) &(const bmapnode[]) {
+ { be_const_key_weak(set_strip_bri, -1), be_const_closure(Animate_core_set_strip_bri_closure) },
+ { be_const_key_weak(animators, -1), be_const_var(4) },
+ { be_const_key_weak(clear, 0), be_const_closure(Animate_core_clear_closure) },
+ { be_const_key_weak(remove, -1), be_const_closure(Animate_core_remove_closure) },
+ { be_const_key_weak(mth, -1), be_const_var(9) },
+ { be_const_key_weak(stop, 1), be_const_closure(Animate_core_stop_closure) },
+ { be_const_key_weak(fast_loop_cb, 30), be_const_var(6) },
+ { be_const_key_weak(get_bri, -1), be_const_closure(Animate_core_get_bri_closure) },
+ { be_const_key_weak(add_animator, -1), be_const_closure(Animate_core_add_animator_closure) },
+ { be_const_key_weak(add_background_animator, -1), be_const_closure(Animate_core_add_background_animator_closure) },
+ { be_const_key_weak(fast_loop_next, -1), be_const_var(7) },
+ { be_const_key_weak(remove_animator, -1), be_const_closure(Animate_core_remove_animator_closure) },
+ { be_const_key_weak(add_painter, 28), be_const_closure(Animate_core_add_painter_closure) },
+ { be_const_key_weak(FAST_LOOP_MIN, -1), be_const_int(20) },
+ { be_const_key_weak(fast_loop, -1), be_const_closure(Animate_core_fast_loop_closure) },
+ { be_const_key_weak(set_back_color, 11), be_const_closure(Animate_core_set_back_color_closure) },
+ { be_const_key_weak(animate, 8), be_const_closure(Animate_core_animate_closure) },
+ { be_const_key_weak(strip, 24), be_const_var(0) },
+ { be_const_key_weak(layer, -1), be_const_var(11) },
+ { be_const_key_weak(init, -1), be_const_closure(Animate_core_init_closure) },
+ { be_const_key_weak(bri, -1), be_const_var(2) },
+ { be_const_key_weak(set_cb, 13), be_const_closure(Animate_core_set_cb_closure) },
+ { be_const_key_weak(back_color, 18), be_const_var(12) },
+ { be_const_key_weak(pixel_count, 15), be_const_var(1) },
+ { be_const_key_weak(set_current, -1), be_const_closure(Animate_core_set_current_closure) },
+ { be_const_key_weak(painters, -1), be_const_var(5) },
+ { be_const_key_weak(obj, 10), be_const_var(8) },
+ { be_const_key_weak(set_bri, 9), be_const_closure(Animate_core_set_bri_closure) },
+ { be_const_key_weak(running, -1), be_const_var(3) },
+ { be_const_key_weak(remove_painter, 3), be_const_closure(Animate_core_remove_painter_closure) },
+ { be_const_key_weak(frame, -1), be_const_var(10) },
+ { be_const_key_weak(start, -1), be_const_closure(Animate_core_start_closure) },
+ })),
+ be_str_weak(Animate_core)
+);
+/*******************************************************************/
+
+void be_load_Animate_core_class(bvm *vm) {
+ be_pushntvclass(vm, &be_class_Animate_core);
+ be_setglobal(vm, "Animate_core");
+ be_pop(vm, 1);
+}
+/********************************************************************/
+/* End of solidification */
diff --git a/lib/libesp32/berry_animate/src/solidify/solidified_animate_2_animate_effects.h b/lib/libesp32/berry_animate/src/solidify/solidified_animate_2_animate_effects.h
new file mode 100644
index 000000000..360e3d2d8
--- /dev/null
+++ b/lib/libesp32/berry_animate/src/solidify/solidified_animate_2_animate_effects.h
@@ -0,0 +1,450 @@
+/* Solidification of animate_2_animate_effects.h */
+/********************************************************************\
+* Generated code, don't edit *
+\********************************************************************/
+#include "be_constobj.h"
+
+extern const bclass be_class_Animate_painter;
+
+/********************************************************************
+** Solidified function: init
+********************************************************************/
+be_local_closure(Animate_painter_init, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(global),
+ /* K1 */ be_nested_str_weak(_cur_anim),
+ /* K2 */ be_nested_str_weak(add_painter),
+ }),
+ be_str_weak(init),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 9]) { /* code */
+ 0xB8060000, // 0000 GETNGBL R1 K0
+ 0x88040301, // 0001 GETMBR R1 R1 K1
+ 0x4C080000, // 0002 LDNIL R2
+ 0x20080202, // 0003 NE R2 R1 R2
+ 0x780A0002, // 0004 JMPF R2 #0008
+ 0x8C080302, // 0005 GETMET R2 R1 K2
+ 0x5C100000, // 0006 MOVE R4 R0
+ 0x7C080400, // 0007 CALL R2 2
+ 0x80000000, // 0008 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: paint
+********************************************************************/
+be_local_closure(Animate_painter_paint, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 0, /* has constants */
+ NULL, /* no const */
+ be_str_weak(paint),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 1]) { /* code */
+ 0x80000000, // 0000 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified class: Animate_painter
+********************************************************************/
+be_local_class(Animate_painter,
+ 0,
+ NULL,
+ be_nested_map(2,
+ ( (struct bmapnode*) &(const bmapnode[]) {
+ { be_const_key_weak(paint, -1), be_const_closure(Animate_painter_paint_closure) },
+ { be_const_key_weak(init, 0), be_const_closure(Animate_painter_init_closure) },
+ })),
+ be_str_weak(Animate_painter)
+);
+/*******************************************************************/
+
+void be_load_Animate_painter_class(bvm *vm) {
+ be_pushntvclass(vm, &be_class_Animate_painter);
+ be_setglobal(vm, "Animate_painter");
+ be_pop(vm, 1);
+}
+
+extern const bclass be_class_Animate_pulse;
+
+/********************************************************************
+** Solidified function: set_pulse_size
+********************************************************************/
+be_local_closure(Animate_pulse_set_pulse_size, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(pulse_size),
+ }),
+ be_str_weak(set_pulse_size),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_slew_size
+********************************************************************/
+be_local_closure(Animate_pulse_set_slew_size, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(slew_size),
+ }),
+ be_str_weak(set_slew_size),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_back_color
+********************************************************************/
+be_local_closure(Animate_pulse_set_back_color, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(back_color),
+ }),
+ be_str_weak(set_back_color),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_pos
+********************************************************************/
+be_local_closure(Animate_pulse_set_pos, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(pos),
+ }),
+ be_str_weak(set_pos),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_color
+********************************************************************/
+be_local_closure(Animate_pulse_set_color, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(color),
+ }),
+ be_str_weak(set_color),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: init
+********************************************************************/
+be_local_closure(Animate_pulse_init, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 4, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[10]) { /* constants */
+ /* K0 */ be_nested_str_weak(init),
+ /* K1 */ be_const_int(16777215),
+ /* K2 */ be_const_int(1),
+ /* K3 */ be_const_int(0),
+ /* K4 */ be_nested_str_weak(color),
+ /* K5 */ be_nested_str_weak(back_color),
+ /* K6 */ be_const_int(-16777216),
+ /* K7 */ be_nested_str_weak(pulse_size),
+ /* K8 */ be_nested_str_weak(slew_size),
+ /* K9 */ be_nested_str_weak(pos),
+ }),
+ be_str_weak(init),
+ &be_const_str_solidified,
+ ( &(const binstruction[29]) { /* code */
+ 0x60100003, // 0000 GETGBL R4 G3
+ 0x5C140000, // 0001 MOVE R5 R0
+ 0x7C100200, // 0002 CALL R4 1
+ 0x8C100900, // 0003 GETMET R4 R4 K0
+ 0x7C100200, // 0004 CALL R4 1
+ 0x4C100000, // 0005 LDNIL R4
+ 0x1C100204, // 0006 EQ R4 R1 R4
+ 0x78120000, // 0007 JMPF R4 #0009
+ 0x58040001, // 0008 LDCONST R1 K1
+ 0x4C100000, // 0009 LDNIL R4
+ 0x1C100404, // 000A EQ R4 R2 R4
+ 0x78120000, // 000B JMPF R4 #000D
+ 0x58080002, // 000C LDCONST R2 K2
+ 0x4C100000, // 000D LDNIL R4
+ 0x1C100604, // 000E EQ R4 R3 R4
+ 0x78120000, // 000F JMPF R4 #0011
+ 0x580C0003, // 0010 LDCONST R3 K3
+ 0x90020801, // 0011 SETMBR R0 K4 R1
+ 0x90020B06, // 0012 SETMBR R0 K5 K6
+ 0x14100503, // 0013 LT R4 R2 K3
+ 0x78120000, // 0014 JMPF R4 #0016
+ 0x58080003, // 0015 LDCONST R2 K3
+ 0x90020E02, // 0016 SETMBR R0 K7 R2
+ 0x14100703, // 0017 LT R4 R3 K3
+ 0x78120000, // 0018 JMPF R4 #001A
+ 0x580C0003, // 0019 LDCONST R3 K3
+ 0x90021003, // 001A SETMBR R0 K8 R3
+ 0x90021303, // 001B SETMBR R0 K9 K3
+ 0x80000000, // 001C RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: paint
+********************************************************************/
+be_local_closure(Animate_pulse_paint, /* name */
+ be_nested_proto(
+ 22, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[13]) { /* constants */
+ /* K0 */ be_nested_str_weak(back_color),
+ /* K1 */ be_const_int(-16777216),
+ /* K2 */ be_nested_str_weak(fill_pixels),
+ /* K3 */ be_nested_str_weak(pos),
+ /* K4 */ be_nested_str_weak(slew_size),
+ /* K5 */ be_nested_str_weak(pulse_size),
+ /* K6 */ be_nested_str_weak(color),
+ /* K7 */ be_nested_str_weak(pixel_size),
+ /* K8 */ be_const_int(0),
+ /* K9 */ be_const_int(1),
+ /* K10 */ be_nested_str_weak(blend),
+ /* K11 */ be_nested_str_weak(tasmota),
+ /* K12 */ be_nested_str_weak(scale_int),
+ }),
+ be_str_weak(paint),
+ &be_const_str_solidified,
+ ( &(const binstruction[91]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x200C0501, // 0001 NE R3 R2 K1
+ 0x780E0002, // 0002 JMPF R3 #0006
+ 0x8C0C0302, // 0003 GETMET R3 R1 K2
+ 0x5C140400, // 0004 MOVE R5 R2
+ 0x7C0C0400, // 0005 CALL R3 2
+ 0x880C0103, // 0006 GETMBR R3 R0 K3
+ 0x88100104, // 0007 GETMBR R4 R0 K4
+ 0x88140105, // 0008 GETMBR R5 R0 K5
+ 0x88180106, // 0009 GETMBR R6 R0 K6
+ 0x881C0307, // 000A GETMBR R7 R1 K7
+ 0x4C200000, // 000B LDNIL R8
+ 0x4C240000, // 000C LDNIL R9
+ 0x5C200600, // 000D MOVE R8 R3
+ 0x00280605, // 000E ADD R10 R3 R5
+ 0x5C241400, // 000F MOVE R9 R10
+ 0x14281108, // 0010 LT R10 R8 K8
+ 0x782A0000, // 0011 JMPF R10 #0013
+ 0x58200008, // 0012 LDCONST R8 K8
+ 0x28281207, // 0013 GE R10 R9 R7
+ 0x782A0000, // 0014 JMPF R10 #0016
+ 0x5C240E00, // 0015 MOVE R9 R7
+ 0x5C281000, // 0016 MOVE R10 R8
+ 0x142C1409, // 0017 LT R11 R10 R9
+ 0x782E0002, // 0018 JMPF R11 #001C
+ 0x98041406, // 0019 SETIDX R1 R10 R6
+ 0x00281509, // 001A ADD R10 R10 K9
+ 0x7001FFFA, // 001B JMP #0017
+ 0x242C0908, // 001C GT R11 R4 K8
+ 0x782E003A, // 001D JMPF R11 #0059
+ 0x042C0604, // 001E SUB R11 R3 R4
+ 0x5C201600, // 001F MOVE R8 R11
+ 0x5C240600, // 0020 MOVE R9 R3
+ 0x142C1108, // 0021 LT R11 R8 K8
+ 0x782E0000, // 0022 JMPF R11 #0024
+ 0x58200008, // 0023 LDCONST R8 K8
+ 0x282C1207, // 0024 GE R11 R9 R7
+ 0x782E0000, // 0025 JMPF R11 #0027
+ 0x5C240E00, // 0026 MOVE R9 R7
+ 0x5C281000, // 0027 MOVE R10 R8
+ 0x142C1409, // 0028 LT R11 R10 R9
+ 0x782E000F, // 0029 JMPF R11 #003A
+ 0x8C2C030A, // 002A GETMET R11 R1 K10
+ 0x5C340400, // 002B MOVE R13 R2
+ 0x5C380C00, // 002C MOVE R14 R6
+ 0xB83E1600, // 002D GETNGBL R15 K11
+ 0x8C3C1F0C, // 002E GETMET R15 R15 K12
+ 0x5C441400, // 002F MOVE R17 R10
+ 0x04480604, // 0030 SUB R18 R3 R4
+ 0x04482509, // 0031 SUB R18 R18 K9
+ 0x5C4C0600, // 0032 MOVE R19 R3
+ 0x545200FE, // 0033 LDINT R20 255
+ 0x58540008, // 0034 LDCONST R21 K8
+ 0x7C3C0C00, // 0035 CALL R15 6
+ 0x7C2C0800, // 0036 CALL R11 4
+ 0x9804140B, // 0037 SETIDX R1 R10 R11
+ 0x00281509, // 0038 ADD R10 R10 K9
+ 0x7001FFED, // 0039 JMP #0028
+ 0x002C0605, // 003A ADD R11 R3 R5
+ 0x5C201600, // 003B MOVE R8 R11
+ 0x002C0605, // 003C ADD R11 R3 R5
+ 0x002C1604, // 003D ADD R11 R11 R4
+ 0x5C241600, // 003E MOVE R9 R11
+ 0x142C1108, // 003F LT R11 R8 K8
+ 0x782E0000, // 0040 JMPF R11 #0042
+ 0x58200008, // 0041 LDCONST R8 K8
+ 0x282C1207, // 0042 GE R11 R9 R7
+ 0x782E0000, // 0043 JMPF R11 #0045
+ 0x5C240E00, // 0044 MOVE R9 R7
+ 0x5C281000, // 0045 MOVE R10 R8
+ 0x142C1409, // 0046 LT R11 R10 R9
+ 0x782E0010, // 0047 JMPF R11 #0059
+ 0x8C2C030A, // 0048 GETMET R11 R1 K10
+ 0x5C340400, // 0049 MOVE R13 R2
+ 0x5C380C00, // 004A MOVE R14 R6
+ 0xB83E1600, // 004B GETNGBL R15 K11
+ 0x8C3C1F0C, // 004C GETMET R15 R15 K12
+ 0x5C441400, // 004D MOVE R17 R10
+ 0x00480605, // 004E ADD R18 R3 R5
+ 0x04482509, // 004F SUB R18 R18 K9
+ 0x004C0605, // 0050 ADD R19 R3 R5
+ 0x004C2604, // 0051 ADD R19 R19 R4
+ 0x58500008, // 0052 LDCONST R20 K8
+ 0x545600FE, // 0053 LDINT R21 255
+ 0x7C3C0C00, // 0054 CALL R15 6
+ 0x7C2C0800, // 0055 CALL R11 4
+ 0x9804140B, // 0056 SETIDX R1 R10 R11
+ 0x00281509, // 0057 ADD R10 R10 K9
+ 0x7001FFEC, // 0058 JMP #0046
+ 0x502C0200, // 0059 LDBOOL R11 1 0
+ 0x80041600, // 005A RET 1 R11
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified class: Animate_pulse
+********************************************************************/
+extern const bclass be_class_Animate_painter;
+be_local_class(Animate_pulse,
+ 5,
+ &be_class_Animate_painter,
+ be_nested_map(12,
+ ( (struct bmapnode*) &(const bmapnode[]) {
+ { be_const_key_weak(paint, -1), be_const_closure(Animate_pulse_paint_closure) },
+ { be_const_key_weak(set_slew_size, -1), be_const_closure(Animate_pulse_set_slew_size_closure) },
+ { be_const_key_weak(pulse_size, -1), be_const_var(4) },
+ { be_const_key_weak(set_back_color, 8), be_const_closure(Animate_pulse_set_back_color_closure) },
+ { be_const_key_weak(color, -1), be_const_var(0) },
+ { be_const_key_weak(back_color, -1), be_const_var(1) },
+ { be_const_key_weak(set_pos, -1), be_const_closure(Animate_pulse_set_pos_closure) },
+ { be_const_key_weak(set_color, -1), be_const_closure(Animate_pulse_set_color_closure) },
+ { be_const_key_weak(init, 7), be_const_closure(Animate_pulse_init_closure) },
+ { be_const_key_weak(pos, -1), be_const_var(2) },
+ { be_const_key_weak(slew_size, 5), be_const_var(3) },
+ { be_const_key_weak(set_pulse_size, 0), be_const_closure(Animate_pulse_set_pulse_size_closure) },
+ })),
+ be_str_weak(Animate_pulse)
+);
+/*******************************************************************/
+
+void be_load_Animate_pulse_class(bvm *vm) {
+ be_pushntvclass(vm, &be_class_Animate_pulse);
+ be_setglobal(vm, "Animate_pulse");
+ be_pop(vm, 1);
+}
+/********************************************************************/
+/* End of solidification */
diff --git a/lib/libesp32/berry_animate/src/solidify/solidified_animate_9_module.h b/lib/libesp32/berry_animate/src/solidify/solidified_animate_9_module.h
new file mode 100644
index 000000000..e64059188
--- /dev/null
+++ b/lib/libesp32/berry_animate/src/solidify/solidified_animate_9_module.h
@@ -0,0 +1,1592 @@
+/* Solidification of animate_9_module.h */
+/********************************************************************\
+* Generated code, don't edit *
+\********************************************************************/
+#include "be_constobj.h"
+
+extern const bclass be_class_Animate_animator;
+
+/********************************************************************
+** Solidified function: is_running
+********************************************************************/
+be_local_closure(Animate_animator_is_running, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(running),
+ }),
+ be_str_weak(is_running),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 4]) { /* code */
+ 0x60040017, // 0000 GETGBL R1 G23
+ 0x88080100, // 0001 GETMBR R2 R0 K0
+ 0x7C040200, // 0002 CALL R1 1
+ 0x80040200, // 0003 RET 1 R1
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: beat
+********************************************************************/
+be_local_closure(Animate_animator_beat, /* name */
+ be_nested_proto(
+ 1, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 0, /* has constants */
+ NULL, /* no const */
+ be_str_weak(beat),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 1]) { /* code */
+ 0x80000000, // 0000 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: init
+********************************************************************/
+be_local_closure(Animate_animator_init, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(global),
+ /* K1 */ be_nested_str_weak(_cur_anim),
+ /* K2 */ be_nested_str_weak(add_animator),
+ }),
+ be_str_weak(init),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 9]) { /* code */
+ 0xB8060000, // 0000 GETNGBL R1 K0
+ 0x88040301, // 0001 GETMBR R1 R1 K1
+ 0x4C080000, // 0002 LDNIL R2
+ 0x20080202, // 0003 NE R2 R1 R2
+ 0x780A0002, // 0004 JMPF R2 #0008
+ 0x8C080302, // 0005 GETMET R2 R1 K2
+ 0x5C100000, // 0006 MOVE R4 R0
+ 0x7C080400, // 0007 CALL R2 2
+ 0x80000000, // 0008 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: stop
+********************************************************************/
+be_local_closure(Animate_animator_stop, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(origin),
+ /* K1 */ be_nested_str_weak(running),
+ }),
+ be_str_weak(stop),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 5]) { /* code */
+ 0x4C040000, // 0000 LDNIL R1
+ 0x90020001, // 0001 SETMBR R0 K0 R1
+ 0x50040000, // 0002 LDBOOL R1 0 0
+ 0x90020201, // 0003 SETMBR R0 K1 R1
+ 0x80000000, // 0004 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_duration_ms
+********************************************************************/
+be_local_closure(Animate_animator_set_duration_ms, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(duration_ms),
+ }),
+ be_str_weak(set_duration_ms),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_cb
+********************************************************************/
+be_local_closure(Animate_animator_set_cb, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(obj),
+ /* K1 */ be_nested_str_weak(mth),
+ }),
+ be_str_weak(set_cb),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 3]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x90020202, // 0001 SETMBR R0 K1 R2
+ 0x80000000, // 0002 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: start
+********************************************************************/
+be_local_closure(Animate_animator_start, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 5]) { /* constants */
+ /* K0 */ be_nested_str_weak(duration_ms),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(millis),
+ /* K3 */ be_nested_str_weak(origin),
+ /* K4 */ be_nested_str_weak(running),
+ }),
+ be_str_weak(start),
+ &be_const_str_solidified,
+ ( &(const binstruction[16]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x4C0C0000, // 0001 LDNIL R3
+ 0x1C080403, // 0002 EQ R2 R2 R3
+ 0x780A0000, // 0003 JMPF R2 #0005
+ 0x80000400, // 0004 RET 0
+ 0x4C080000, // 0005 LDNIL R2
+ 0x1C080202, // 0006 EQ R2 R1 R2
+ 0x780A0003, // 0007 JMPF R2 #000C
+ 0xB80A0200, // 0008 GETNGBL R2 K1
+ 0x8C080502, // 0009 GETMET R2 R2 K2
+ 0x7C080200, // 000A CALL R2 1
+ 0x5C040400, // 000B MOVE R1 R2
+ 0x90020601, // 000C SETMBR R0 K3 R1
+ 0x50080200, // 000D LDBOOL R2 1 0
+ 0x90020802, // 000E SETMBR R0 K4 R2
+ 0x80000000, // 000F RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified class: Animate_animator
+********************************************************************/
+be_local_class(Animate_animator,
+ 5,
+ NULL,
+ be_nested_map(12,
+ ( (struct bmapnode*) &(const bmapnode[]) {
+ { be_const_key_weak(running, 4), be_const_var(0) },
+ { be_const_key_weak(is_running, 2), be_const_closure(Animate_animator_is_running_closure) },
+ { be_const_key_weak(beat, -1), be_const_closure(Animate_animator_beat_closure) },
+ { be_const_key_weak(init, -1), be_const_closure(Animate_animator_init_closure) },
+ { be_const_key_weak(mth, -1), be_const_var(4) },
+ { be_const_key_weak(stop, -1), be_const_closure(Animate_animator_stop_closure) },
+ { be_const_key_weak(duration_ms, -1), be_const_var(1) },
+ { be_const_key_weak(origin, -1), be_const_var(2) },
+ { be_const_key_weak(set_cb, -1), be_const_closure(Animate_animator_set_cb_closure) },
+ { be_const_key_weak(set_duration_ms, 8), be_const_closure(Animate_animator_set_duration_ms_closure) },
+ { be_const_key_weak(obj, -1), be_const_var(3) },
+ { be_const_key_weak(start, -1), be_const_closure(Animate_animator_start_closure) },
+ })),
+ be_str_weak(Animate_animator)
+);
+/*******************************************************************/
+
+void be_load_Animate_animator_class(bvm *vm) {
+ be_pushntvclass(vm, &be_class_Animate_animator);
+ be_setglobal(vm, "Animate_animator");
+ be_pop(vm, 1);
+}
+
+extern const bclass be_class_Animate_palette;
+
+/********************************************************************
+** Solidified function: ptr_to_palette
+********************************************************************/
+be_local_closure(Animate_palette_ptr_to_palette, /* name */
+ be_nested_proto(
+ 8, /* nstack */
+ 1, /* argc */
+ 4, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_const_class(be_class_Animate_palette),
+ /* K1 */ be_nested_str_weak(ptr),
+ /* K2 */ be_const_int(1),
+ /* K3 */ be_const_int(0),
+ }),
+ be_str_weak(ptr_to_palette),
+ &be_const_str_solidified,
+ ( &(const binstruction[45]) { /* code */
+ 0x58040000, // 0000 LDCONST R1 K0
+ 0x60080004, // 0001 GETGBL R2 G4
+ 0x5C0C0000, // 0002 MOVE R3 R0
+ 0x7C080200, // 0003 CALL R2 1
+ 0x1C080501, // 0004 EQ R2 R2 K1
+ 0x780A0025, // 0005 JMPF R2 #002C
+ 0x60080015, // 0006 GETGBL R2 G21
+ 0x5C0C0000, // 0007 MOVE R3 R0
+ 0x541207CF, // 0008 LDINT R4 2000
+ 0x7C080400, // 0009 CALL R2 2
+ 0x580C0002, // 000A LDCONST R3 K2
+ 0x94100503, // 000B GETIDX R4 R2 K3
+ 0x20100903, // 000C NE R4 R4 K3
+ 0x7812000A, // 000D JMPF R4 #0019
+ 0x50100200, // 000E LDBOOL R4 1 0
+ 0x78120007, // 000F JMPF R4 #0018
+ 0x54120003, // 0010 LDINT R4 4
+ 0x08100604, // 0011 MUL R4 R3 R4
+ 0x94100404, // 0012 GETIDX R4 R2 R4
+ 0x1C100903, // 0013 EQ R4 R4 K3
+ 0x78120000, // 0014 JMPF R4 #0016
+ 0x70020001, // 0015 JMP #0018
+ 0x000C0702, // 0016 ADD R3 R3 K2
+ 0x7001FFF5, // 0017 JMP #000E
+ 0x7002000A, // 0018 JMP #0024
+ 0x50100200, // 0019 LDBOOL R4 1 0
+ 0x78120008, // 001A JMPF R4 #0024
+ 0x54120003, // 001B LDINT R4 4
+ 0x08100604, // 001C MUL R4 R3 R4
+ 0x94100404, // 001D GETIDX R4 R2 R4
+ 0x541600FE, // 001E LDINT R5 255
+ 0x1C100805, // 001F EQ R4 R4 R5
+ 0x78120000, // 0020 JMPF R4 #0022
+ 0x70020001, // 0021 JMP #0024
+ 0x000C0702, // 0022 ADD R3 R3 K2
+ 0x7001FFF4, // 0023 JMP #0019
+ 0x00100702, // 0024 ADD R4 R3 K2
+ 0x54160003, // 0025 LDINT R5 4
+ 0x08100805, // 0026 MUL R4 R4 R5
+ 0x60140015, // 0027 GETGBL R5 G21
+ 0x5C180000, // 0028 MOVE R6 R0
+ 0x5C1C0800, // 0029 MOVE R7 R4
+ 0x7C140400, // 002A CALL R5 2
+ 0x80040A00, // 002B RET 1 R5
+ 0x80000000, // 002C RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: animate
+********************************************************************/
+be_local_closure(Animate_palette_animate, /* name */
+ be_nested_proto(
+ 26, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[21]) { /* constants */
+ /* K0 */ be_nested_str_weak(duration_ms),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(millis),
+ /* K3 */ be_nested_str_weak(origin),
+ /* K4 */ be_const_int(0),
+ /* K5 */ be_nested_str_weak(scale_uint),
+ /* K6 */ be_nested_str_weak(slots),
+ /* K7 */ be_const_int(2),
+ /* K8 */ be_nested_str_weak(slots_arr),
+ /* K9 */ be_const_int(1),
+ /* K10 */ be_nested_str_weak(palette),
+ /* K11 */ be_nested_str_weak(get),
+ /* K12 */ be_nested_str_weak(color),
+ /* K13 */ be_nested_str_weak(set_rgb),
+ /* K14 */ be_nested_str_weak(bri),
+ /* K15 */ be_nested_str_weak(set_bri),
+ /* K16 */ be_nested_str_weak(r),
+ /* K17 */ be_nested_str_weak(g),
+ /* K18 */ be_nested_str_weak(b),
+ /* K19 */ be_nested_str_weak(obj),
+ /* K20 */ be_nested_str_weak(mth),
+ }),
+ be_str_weak(animate),
+ &be_const_str_solidified,
+ ( &(const binstruction[193]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x4C0C0000, // 0001 LDNIL R3
+ 0x1C080403, // 0002 EQ R2 R2 R3
+ 0x780A0000, // 0003 JMPF R2 #0005
+ 0x80000400, // 0004 RET 0
+ 0x4C080000, // 0005 LDNIL R2
+ 0x1C080202, // 0006 EQ R2 R1 R2
+ 0x780A0003, // 0007 JMPF R2 #000C
+ 0xB80A0200, // 0008 GETNGBL R2 K1
+ 0x8C080502, // 0009 GETMET R2 R2 K2
+ 0x7C080200, // 000A CALL R2 1
+ 0x5C040400, // 000B MOVE R1 R2
+ 0x88080103, // 000C GETMBR R2 R0 K3
+ 0x04080202, // 000D SUB R2 R1 R2
+ 0x140C0504, // 000E LT R3 R2 K4
+ 0x780E0001, // 000F JMPF R3 #0012
+ 0x58080004, // 0010 LDCONST R2 K4
+ 0x88040103, // 0011 GETMBR R1 R0 K3
+ 0x880C0100, // 0012 GETMBR R3 R0 K0
+ 0xB8120200, // 0013 GETNGBL R4 K1
+ 0x88100905, // 0014 GETMBR R4 R4 K5
+ 0x28140403, // 0015 GE R5 R2 R3
+ 0x78160005, // 0016 JMPF R5 #001D
+ 0x0C180403, // 0017 DIV R6 R2 R3
+ 0x08180C03, // 0018 MUL R6 R6 R3
+ 0x88140103, // 0019 GETMBR R5 R0 K3
+ 0x00140A06, // 001A ADD R5 R5 R6
+ 0x90020605, // 001B SETMBR R0 K3 R5
+ 0x10080403, // 001C MOD R2 R2 R3
+ 0x88140106, // 001D GETMBR R5 R0 K6
+ 0x04180B07, // 001E SUB R6 R5 K7
+ 0x241C0D04, // 001F GT R7 R6 K4
+ 0x781E0006, // 0020 JMPF R7 #0028
+ 0x881C0108, // 0021 GETMBR R7 R0 K8
+ 0x941C0E06, // 0022 GETIDX R7 R7 R6
+ 0x281C0407, // 0023 GE R7 R2 R7
+ 0x781E0000, // 0024 JMPF R7 #0026
+ 0x70020001, // 0025 JMP #0028
+ 0x04180D09, // 0026 SUB R6 R6 K9
+ 0x7001FFF6, // 0027 JMP #001F
+ 0x881C010A, // 0028 GETMBR R7 R0 K10
+ 0x8C1C0F0B, // 0029 GETMET R7 R7 K11
+ 0x54260003, // 002A LDINT R9 4
+ 0x08240C09, // 002B MUL R9 R6 R9
+ 0x542A0003, // 002C LDINT R10 4
+ 0x7C1C0600, // 002D CALL R7 3
+ 0x8820010A, // 002E GETMBR R8 R0 K10
+ 0x8C20110B, // 002F GETMET R8 R8 K11
+ 0x00280D09, // 0030 ADD R10 R6 K9
+ 0x542E0003, // 0031 LDINT R11 4
+ 0x0828140B, // 0032 MUL R10 R10 R11
+ 0x542E0003, // 0033 LDINT R11 4
+ 0x7C200600, // 0034 CALL R8 3
+ 0x88240108, // 0035 GETMBR R9 R0 K8
+ 0x94241206, // 0036 GETIDX R9 R9 R6
+ 0x00280D09, // 0037 ADD R10 R6 K9
+ 0x882C0108, // 0038 GETMBR R11 R0 K8
+ 0x9428160A, // 0039 GETIDX R10 R11 R10
+ 0x5C300800, // 003A MOVE R12 R4
+ 0x5C340400, // 003B MOVE R13 R2
+ 0x5C381200, // 003C MOVE R14 R9
+ 0x5C3C1400, // 003D MOVE R15 R10
+ 0x54420007, // 003E LDINT R16 8
+ 0x3C400E10, // 003F SHR R16 R7 R16
+ 0x544600FE, // 0040 LDINT R17 255
+ 0x2C402011, // 0041 AND R16 R16 R17
+ 0x54460007, // 0042 LDINT R17 8
+ 0x3C441011, // 0043 SHR R17 R8 R17
+ 0x544A00FE, // 0044 LDINT R18 255
+ 0x2C442212, // 0045 AND R17 R17 R18
+ 0x7C300A00, // 0046 CALL R12 5
+ 0x5C2C1800, // 0047 MOVE R11 R12
+ 0x5C300800, // 0048 MOVE R12 R4
+ 0x5C340400, // 0049 MOVE R13 R2
+ 0x5C381200, // 004A MOVE R14 R9
+ 0x5C3C1400, // 004B MOVE R15 R10
+ 0x5442000F, // 004C LDINT R16 16
+ 0x3C400E10, // 004D SHR R16 R7 R16
+ 0x544600FE, // 004E LDINT R17 255
+ 0x2C402011, // 004F AND R16 R16 R17
+ 0x5446000F, // 0050 LDINT R17 16
+ 0x3C441011, // 0051 SHR R17 R8 R17
+ 0x544A00FE, // 0052 LDINT R18 255
+ 0x2C442212, // 0053 AND R17 R17 R18
+ 0x7C300A00, // 0054 CALL R12 5
+ 0x5C340800, // 0055 MOVE R13 R4
+ 0x5C380400, // 0056 MOVE R14 R2
+ 0x5C3C1200, // 0057 MOVE R15 R9
+ 0x5C401400, // 0058 MOVE R16 R10
+ 0x54460017, // 0059 LDINT R17 24
+ 0x3C440E11, // 005A SHR R17 R7 R17
+ 0x544A00FE, // 005B LDINT R18 255
+ 0x2C442212, // 005C AND R17 R17 R18
+ 0x544A0017, // 005D LDINT R18 24
+ 0x3C481012, // 005E SHR R18 R8 R18
+ 0x544E00FE, // 005F LDINT R19 255
+ 0x2C482413, // 0060 AND R18 R18 R19
+ 0x7C340A00, // 0061 CALL R13 5
+ 0x8838010C, // 0062 GETMBR R14 R0 K12
+ 0x8C3C1D0D, // 0063 GETMET R15 R14 K13
+ 0x54460007, // 0064 LDINT R17 8
+ 0x3C440E11, // 0065 SHR R17 R7 R17
+ 0x544A00FE, // 0066 LDINT R18 255
+ 0x2C442212, // 0067 AND R17 R17 R18
+ 0x544A000F, // 0068 LDINT R18 16
+ 0x3C480E12, // 0069 SHR R18 R7 R18
+ 0x544E00FE, // 006A LDINT R19 255
+ 0x2C482413, // 006B AND R18 R18 R19
+ 0x544E0017, // 006C LDINT R19 24
+ 0x3C4C0E13, // 006D SHR R19 R7 R19
+ 0x545200FE, // 006E LDINT R20 255
+ 0x2C4C2614, // 006F AND R19 R19 R20
+ 0x7C3C0800, // 0070 CALL R15 4
+ 0x883C1D0E, // 0071 GETMBR R15 R14 K14
+ 0x8C401D0D, // 0072 GETMET R16 R14 K13
+ 0x544A0007, // 0073 LDINT R18 8
+ 0x3C481012, // 0074 SHR R18 R8 R18
+ 0x544E00FE, // 0075 LDINT R19 255
+ 0x2C482413, // 0076 AND R18 R18 R19
+ 0x544E000F, // 0077 LDINT R19 16
+ 0x3C4C1013, // 0078 SHR R19 R8 R19
+ 0x545200FE, // 0079 LDINT R20 255
+ 0x2C4C2614, // 007A AND R19 R19 R20
+ 0x54520017, // 007B LDINT R20 24
+ 0x3C501014, // 007C SHR R20 R8 R20
+ 0x545600FE, // 007D LDINT R21 255
+ 0x2C502815, // 007E AND R20 R20 R21
+ 0x7C400800, // 007F CALL R16 4
+ 0x88401D0E, // 0080 GETMBR R16 R14 K14
+ 0x5C440800, // 0081 MOVE R17 R4
+ 0x5C480400, // 0082 MOVE R18 R2
+ 0x5C4C1200, // 0083 MOVE R19 R9
+ 0x5C501400, // 0084 MOVE R20 R10
+ 0x5C541E00, // 0085 MOVE R21 R15
+ 0x5C582000, // 0086 MOVE R22 R16
+ 0x7C440A00, // 0087 CALL R17 5
+ 0x8C481D0D, // 0088 GETMET R18 R14 K13
+ 0x5C501600, // 0089 MOVE R20 R11
+ 0x5C541800, // 008A MOVE R21 R12
+ 0x5C581A00, // 008B MOVE R22 R13
+ 0x7C480800, // 008C CALL R18 4
+ 0x8C481D0F, // 008D GETMET R18 R14 K15
+ 0x5C502200, // 008E MOVE R20 R17
+ 0x7C480400, // 008F CALL R18 2
+ 0x882C1D10, // 0090 GETMBR R11 R14 K16
+ 0x88301D11, // 0091 GETMBR R12 R14 K17
+ 0x88341D12, // 0092 GETMBR R13 R14 K18
+ 0x8848010E, // 0093 GETMBR R18 R0 K14
+ 0x544E0063, // 0094 LDINT R19 100
+ 0x204C2413, // 0095 NE R19 R18 R19
+ 0x784E001A, // 0096 JMPF R19 #00B2
+ 0xB84E0200, // 0097 GETNGBL R19 K1
+ 0x8C4C2705, // 0098 GETMET R19 R19 K5
+ 0x5C541600, // 0099 MOVE R21 R11
+ 0x58580004, // 009A LDCONST R22 K4
+ 0x545E0063, // 009B LDINT R23 100
+ 0x58600004, // 009C LDCONST R24 K4
+ 0x5C642400, // 009D MOVE R25 R18
+ 0x7C4C0C00, // 009E CALL R19 6
+ 0x5C2C2600, // 009F MOVE R11 R19
+ 0xB84E0200, // 00A0 GETNGBL R19 K1
+ 0x8C4C2705, // 00A1 GETMET R19 R19 K5
+ 0x5C541800, // 00A2 MOVE R21 R12
+ 0x58580004, // 00A3 LDCONST R22 K4
+ 0x545E0063, // 00A4 LDINT R23 100
+ 0x58600004, // 00A5 LDCONST R24 K4
+ 0x5C642400, // 00A6 MOVE R25 R18
+ 0x7C4C0C00, // 00A7 CALL R19 6
+ 0x5C302600, // 00A8 MOVE R12 R19
+ 0xB84E0200, // 00A9 GETNGBL R19 K1
+ 0x8C4C2705, // 00AA GETMET R19 R19 K5
+ 0x5C541A00, // 00AB MOVE R21 R13
+ 0x58580004, // 00AC LDCONST R22 K4
+ 0x545E0063, // 00AD LDINT R23 100
+ 0x58600004, // 00AE LDCONST R24 K4
+ 0x5C642400, // 00AF MOVE R25 R18
+ 0x7C4C0C00, // 00B0 CALL R19 6
+ 0x5C342600, // 00B1 MOVE R13 R19
+ 0x544E000F, // 00B2 LDINT R19 16
+ 0x384C1613, // 00B3 SHL R19 R11 R19
+ 0x54520007, // 00B4 LDINT R20 8
+ 0x38501814, // 00B5 SHL R20 R12 R20
+ 0x304C2614, // 00B6 OR R19 R19 R20
+ 0x304C260D, // 00B7 OR R19 R19 R13
+ 0x88500113, // 00B8 GETMBR R20 R0 K19
+ 0x88540114, // 00B9 GETMBR R21 R0 K20
+ 0x78520004, // 00BA JMPF R20 #00C0
+ 0x78560003, // 00BB JMPF R21 #00C0
+ 0x5C582A00, // 00BC MOVE R22 R21
+ 0x5C5C2800, // 00BD MOVE R23 R20
+ 0x5C602600, // 00BE MOVE R24 R19
+ 0x7C580400, // 00BF CALL R22 2
+ 0x80042600, // 00C0 RET 1 R19
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_palette
+********************************************************************/
+be_local_closure(Animate_palette_set_palette, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 9]) { /* constants */
+ /* K0 */ be_nested_str_weak(ptr),
+ /* K1 */ be_nested_str_weak(ptr_to_palette),
+ /* K2 */ be_nested_str_weak(palette),
+ /* K3 */ be_nested_str_weak(slots),
+ /* K4 */ be_nested_str_weak(duration_ms),
+ /* K5 */ be_nested_str_weak(set_duration),
+ /* K6 */ be_nested_str_weak(range_min),
+ /* K7 */ be_nested_str_weak(range_max),
+ /* K8 */ be_nested_str_weak(set_range),
+ }),
+ be_str_weak(set_palette),
+ &be_const_str_solidified,
+ ( &(const binstruction[37]) { /* code */
+ 0x60080004, // 0000 GETGBL R2 G4
+ 0x5C0C0200, // 0001 MOVE R3 R1
+ 0x7C080200, // 0002 CALL R2 1
+ 0x1C080500, // 0003 EQ R2 R2 K0
+ 0x780A0003, // 0004 JMPF R2 #0009
+ 0x8C080101, // 0005 GETMET R2 R0 K1
+ 0x5C100200, // 0006 MOVE R4 R1
+ 0x7C080400, // 0007 CALL R2 2
+ 0x5C040400, // 0008 MOVE R1 R2
+ 0x90020401, // 0009 SETMBR R0 K2 R1
+ 0x6008000C, // 000A GETGBL R2 G12
+ 0x5C0C0200, // 000B MOVE R3 R1
+ 0x7C080200, // 000C CALL R2 1
+ 0x540E0003, // 000D LDINT R3 4
+ 0x0C080403, // 000E DIV R2 R2 R3
+ 0x90020602, // 000F SETMBR R0 K3 R2
+ 0x88080104, // 0010 GETMBR R2 R0 K4
+ 0x4C0C0000, // 0011 LDNIL R3
+ 0x20080403, // 0012 NE R2 R2 R3
+ 0x780A0003, // 0013 JMPF R2 #0018
+ 0x8C080105, // 0014 GETMET R2 R0 K5
+ 0x88100104, // 0015 GETMBR R4 R0 K4
+ 0x7C080400, // 0016 CALL R2 2
+ 0x7002000B, // 0017 JMP #0024
+ 0x88080106, // 0018 GETMBR R2 R0 K6
+ 0x4C0C0000, // 0019 LDNIL R3
+ 0x20080403, // 001A NE R2 R2 R3
+ 0x780A0007, // 001B JMPF R2 #0024
+ 0x88080107, // 001C GETMBR R2 R0 K7
+ 0x4C0C0000, // 001D LDNIL R3
+ 0x20080403, // 001E NE R2 R2 R3
+ 0x780A0003, // 001F JMPF R2 #0024
+ 0x8C080108, // 0020 GETMET R2 R0 K8
+ 0x88100106, // 0021 GETMBR R4 R0 K6
+ 0x88140107, // 0022 GETMBR R5 R0 K7
+ 0x7C080600, // 0023 CALL R2 3
+ 0x80000000, // 0024 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: to_css_gradient
+********************************************************************/
+be_local_closure(Animate_palette_to_css_gradient, /* name */
+ be_nested_proto(
+ 17, /* nstack */
+ 1, /* argc */
+ 4, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[10]) { /* constants */
+ /* K0 */ be_const_class(be_class_Animate_palette),
+ /* K1 */ be_nested_str_weak(parse_palette),
+ /* K2 */ be_const_int(0),
+ /* K3 */ be_nested_str_weak(background_X3Alinear_X2Dgradient_X28to_X20right),
+ /* K4 */ be_nested_str_weak(palette),
+ /* K5 */ be_nested_str_weak(get),
+ /* K6 */ be_nested_str_weak(_X2C_X23_X2502X_X2502X_X2502X_X20_X25_X2E1f_X25_X25),
+ /* K7 */ be_const_real_hex(0x41200000),
+ /* K8 */ be_const_int(1),
+ /* K9 */ be_nested_str_weak(_X29_X3B),
+ }),
+ be_str_weak(to_css_gradient),
+ &be_const_str_solidified,
+ ( &(const binstruction[46]) { /* code */
+ 0x58040000, // 0000 LDCONST R1 K0
+ 0x5C080200, // 0001 MOVE R2 R1
+ 0x5C0C0000, // 0002 MOVE R3 R0
+ 0x7C080200, // 0003 CALL R2 1
+ 0x8C0C0501, // 0004 GETMET R3 R2 K1
+ 0x58140002, // 0005 LDCONST R5 K2
+ 0x541A03E7, // 0006 LDINT R6 1000
+ 0x7C0C0600, // 0007 CALL R3 3
+ 0x58100003, // 0008 LDCONST R4 K3
+ 0x58140002, // 0009 LDCONST R5 K2
+ 0x6018000C, // 000A GETGBL R6 G12
+ 0x5C1C0600, // 000B MOVE R7 R3
+ 0x7C180200, // 000C CALL R6 1
+ 0x14180A06, // 000D LT R6 R5 R6
+ 0x781A001C, // 000E JMPF R6 #002C
+ 0x94180605, // 000F GETIDX R6 R3 R5
+ 0x881C0504, // 0010 GETMBR R7 R2 K4
+ 0x8C1C0F05, // 0011 GETMET R7 R7 K5
+ 0x54260003, // 0012 LDINT R9 4
+ 0x08240A09, // 0013 MUL R9 R5 R9
+ 0x542A0003, // 0014 LDINT R10 4
+ 0x7C1C0600, // 0015 CALL R7 3
+ 0x54220007, // 0016 LDINT R8 8
+ 0x3C200E08, // 0017 SHR R8 R7 R8
+ 0x542600FE, // 0018 LDINT R9 255
+ 0x2C201009, // 0019 AND R8 R8 R9
+ 0x5426000F, // 001A LDINT R9 16
+ 0x3C240E09, // 001B SHR R9 R7 R9
+ 0x542A00FE, // 001C LDINT R10 255
+ 0x2C24120A, // 001D AND R9 R9 R10
+ 0x542A0017, // 001E LDINT R10 24
+ 0x3C280E0A, // 001F SHR R10 R7 R10
+ 0x542E00FE, // 0020 LDINT R11 255
+ 0x2C28140B, // 0021 AND R10 R10 R11
+ 0x602C0018, // 0022 GETGBL R11 G24
+ 0x58300006, // 0023 LDCONST R12 K6
+ 0x5C341000, // 0024 MOVE R13 R8
+ 0x5C381200, // 0025 MOVE R14 R9
+ 0x5C3C1400, // 0026 MOVE R15 R10
+ 0x0C400D07, // 0027 DIV R16 R6 K7
+ 0x7C2C0A00, // 0028 CALL R11 5
+ 0x0010080B, // 0029 ADD R4 R4 R11
+ 0x00140B08, // 002A ADD R5 R5 K8
+ 0x7001FFDD, // 002B JMP #000A
+ 0x00100909, // 002C ADD R4 R4 K9
+ 0x80040800, // 002D RET 1 R4
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_bri
+********************************************************************/
+be_local_closure(Animate_palette_set_bri, /* name */
+ be_nested_proto(
+ 4, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(bri),
+ }),
+ be_str_weak(set_bri),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 5]) { /* code */
+ 0x60080009, // 0000 GETGBL R2 G9
+ 0x5C0C0200, // 0001 MOVE R3 R1
+ 0x7C080200, // 0002 CALL R2 1
+ 0x90020002, // 0003 SETMBR R0 K0 R2
+ 0x80000000, // 0004 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: parse_palette
+********************************************************************/
+be_local_closure(Animate_palette_parse_palette, /* name */
+ be_nested_proto(
+ 15, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 8]) { /* constants */
+ /* K0 */ be_nested_str_weak(slots),
+ /* K1 */ be_nested_str_weak(resize),
+ /* K2 */ be_nested_str_weak(palette),
+ /* K3 */ be_nested_str_weak(get),
+ /* K4 */ be_const_int(0),
+ /* K5 */ be_const_int(1),
+ /* K6 */ be_nested_str_weak(tasmota),
+ /* K7 */ be_nested_str_weak(scale_int),
+ }),
+ be_str_weak(parse_palette),
+ &be_const_str_solidified,
+ ( &(const binstruction[71]) { /* code */
+ 0x600C0012, // 0000 GETGBL R3 G18
+ 0x7C0C0000, // 0001 CALL R3 0
+ 0x88100100, // 0002 GETMBR R4 R0 K0
+ 0x8C140701, // 0003 GETMET R5 R3 K1
+ 0x5C1C0800, // 0004 MOVE R7 R4
+ 0x7C140400, // 0005 CALL R5 2
+ 0x88140102, // 0006 GETMBR R5 R0 K2
+ 0x8C140B03, // 0007 GETMET R5 R5 K3
+ 0x581C0004, // 0008 LDCONST R7 K4
+ 0x58200005, // 0009 LDCONST R8 K5
+ 0x7C140600, // 000A CALL R5 3
+ 0x20140B04, // 000B NE R5 R5 K4
+ 0x78160024, // 000C JMPF R5 #0032
+ 0x58140004, // 000D LDCONST R5 K4
+ 0x58180004, // 000E LDCONST R6 K4
+ 0x041C0905, // 000F SUB R7 R4 K5
+ 0x141C0C07, // 0010 LT R7 R6 R7
+ 0x781E0008, // 0011 JMPF R7 #001B
+ 0x881C0102, // 0012 GETMBR R7 R0 K2
+ 0x8C1C0F03, // 0013 GETMET R7 R7 K3
+ 0x54260003, // 0014 LDINT R9 4
+ 0x08240C09, // 0015 MUL R9 R6 R9
+ 0x58280005, // 0016 LDCONST R10 K5
+ 0x7C1C0600, // 0017 CALL R7 3
+ 0x00140A07, // 0018 ADD R5 R5 R7
+ 0x00180D05, // 0019 ADD R6 R6 K5
+ 0x7001FFF3, // 001A JMP #000F
+ 0x581C0004, // 001B LDCONST R7 K4
+ 0x58180004, // 001C LDCONST R6 K4
+ 0x14200C04, // 001D LT R8 R6 R4
+ 0x78220011, // 001E JMPF R8 #0031
+ 0xB8220C00, // 001F GETNGBL R8 K6
+ 0x8C201107, // 0020 GETMET R8 R8 K7
+ 0x5C280E00, // 0021 MOVE R10 R7
+ 0x582C0004, // 0022 LDCONST R11 K4
+ 0x5C300A00, // 0023 MOVE R12 R5
+ 0x5C340200, // 0024 MOVE R13 R1
+ 0x5C380400, // 0025 MOVE R14 R2
+ 0x7C200C00, // 0026 CALL R8 6
+ 0x980C0C08, // 0027 SETIDX R3 R6 R8
+ 0x88200102, // 0028 GETMBR R8 R0 K2
+ 0x8C201103, // 0029 GETMET R8 R8 K3
+ 0x542A0003, // 002A LDINT R10 4
+ 0x08280C0A, // 002B MUL R10 R6 R10
+ 0x582C0005, // 002C LDCONST R11 K5
+ 0x7C200600, // 002D CALL R8 3
+ 0x001C0E08, // 002E ADD R7 R7 R8
+ 0x00180D05, // 002F ADD R6 R6 K5
+ 0x7001FFEB, // 0030 JMP #001D
+ 0x70020013, // 0031 JMP #0046
+ 0x58140004, // 0032 LDCONST R5 K4
+ 0x14180A04, // 0033 LT R6 R5 R4
+ 0x781A0010, // 0034 JMPF R6 #0046
+ 0x88180102, // 0035 GETMBR R6 R0 K2
+ 0x8C180D03, // 0036 GETMET R6 R6 K3
+ 0x54220003, // 0037 LDINT R8 4
+ 0x08200A08, // 0038 MUL R8 R5 R8
+ 0x58240005, // 0039 LDCONST R9 K5
+ 0x7C180600, // 003A CALL R6 3
+ 0xB81E0C00, // 003B GETNGBL R7 K6
+ 0x8C1C0F07, // 003C GETMET R7 R7 K7
+ 0x5C240C00, // 003D MOVE R9 R6
+ 0x58280004, // 003E LDCONST R10 K4
+ 0x542E00FE, // 003F LDINT R11 255
+ 0x5C300200, // 0040 MOVE R12 R1
+ 0x5C340400, // 0041 MOVE R13 R2
+ 0x7C1C0C00, // 0042 CALL R7 6
+ 0x980C0A07, // 0043 SETIDX R3 R5 R7
+ 0x00140B05, // 0044 ADD R5 R5 K5
+ 0x7001FFEC, // 0045 JMP #0033
+ 0x80040600, // 0046 RET 1 R3
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_range
+********************************************************************/
+be_local_closure(Animate_palette_set_range, /* name */
+ be_nested_proto(
+ 7, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 6]) { /* constants */
+ /* K0 */ be_nested_str_weak(value_error),
+ /* K1 */ be_nested_str_weak(min_X20must_X20be_X20lower_X20than_X20mex),
+ /* K2 */ be_nested_str_weak(range_min),
+ /* K3 */ be_nested_str_weak(range_max),
+ /* K4 */ be_nested_str_weak(slots_arr),
+ /* K5 */ be_nested_str_weak(parse_palette),
+ }),
+ be_str_weak(set_range),
+ &be_const_str_solidified,
+ ( &(const binstruction[11]) { /* code */
+ 0x280C0202, // 0000 GE R3 R1 R2
+ 0x780E0000, // 0001 JMPF R3 #0003
+ 0xB0060101, // 0002 RAISE 1 K0 K1
+ 0x90020401, // 0003 SETMBR R0 K2 R1
+ 0x90020602, // 0004 SETMBR R0 K3 R2
+ 0x8C0C0105, // 0005 GETMET R3 R0 K5
+ 0x5C140200, // 0006 MOVE R5 R1
+ 0x5C180400, // 0007 MOVE R6 R2
+ 0x7C0C0600, // 0008 CALL R3 3
+ 0x90020803, // 0009 SETMBR R0 K4 R3
+ 0x80000000, // 000A RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_value
+********************************************************************/
+be_local_closure(Animate_palette_set_value, /* name */
+ be_nested_proto(
+ 18, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[13]) { /* constants */
+ /* K0 */ be_nested_str_weak(range_min),
+ /* K1 */ be_nested_str_weak(range_max),
+ /* K2 */ be_nested_str_weak(tasmota),
+ /* K3 */ be_nested_str_weak(scale_int),
+ /* K4 */ be_nested_str_weak(slots),
+ /* K5 */ be_const_int(2),
+ /* K6 */ be_const_int(0),
+ /* K7 */ be_nested_str_weak(slots_arr),
+ /* K8 */ be_const_int(1),
+ /* K9 */ be_nested_str_weak(palette),
+ /* K10 */ be_nested_str_weak(get),
+ /* K11 */ be_nested_str_weak(obj),
+ /* K12 */ be_nested_str_weak(mth),
+ }),
+ be_str_weak(set_value),
+ &be_const_str_solidified,
+ ( &(const binstruction[96]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x4C0C0000, // 0001 LDNIL R3
+ 0x1C080403, // 0002 EQ R2 R2 R3
+ 0x740A0003, // 0003 JMPT R2 #0008
+ 0x88080101, // 0004 GETMBR R2 R0 K1
+ 0x4C0C0000, // 0005 LDNIL R3
+ 0x1C080403, // 0006 EQ R2 R2 R3
+ 0x780A0001, // 0007 JMPF R2 #000A
+ 0x4C080000, // 0008 LDNIL R2
+ 0x80040400, // 0009 RET 1 R2
+ 0xB80A0400, // 000A GETNGBL R2 K2
+ 0x88080503, // 000B GETMBR R2 R2 K3
+ 0x880C0104, // 000C GETMBR R3 R0 K4
+ 0x04100705, // 000D SUB R4 R3 K5
+ 0x24140906, // 000E GT R5 R4 K6
+ 0x78160006, // 000F JMPF R5 #0017
+ 0x88140107, // 0010 GETMBR R5 R0 K7
+ 0x94140A04, // 0011 GETIDX R5 R5 R4
+ 0x28140205, // 0012 GE R5 R1 R5
+ 0x78160000, // 0013 JMPF R5 #0015
+ 0x70020001, // 0014 JMP #0017
+ 0x04100908, // 0015 SUB R4 R4 K8
+ 0x7001FFF6, // 0016 JMP #000E
+ 0x88140109, // 0017 GETMBR R5 R0 K9
+ 0x8C140B0A, // 0018 GETMET R5 R5 K10
+ 0x541E0003, // 0019 LDINT R7 4
+ 0x081C0807, // 001A MUL R7 R4 R7
+ 0x54220003, // 001B LDINT R8 4
+ 0x7C140600, // 001C CALL R5 3
+ 0x88180109, // 001D GETMBR R6 R0 K9
+ 0x8C180D0A, // 001E GETMET R6 R6 K10
+ 0x00200908, // 001F ADD R8 R4 K8
+ 0x54260003, // 0020 LDINT R9 4
+ 0x08201009, // 0021 MUL R8 R8 R9
+ 0x54260003, // 0022 LDINT R9 4
+ 0x7C180600, // 0023 CALL R6 3
+ 0x881C0107, // 0024 GETMBR R7 R0 K7
+ 0x941C0E04, // 0025 GETIDX R7 R7 R4
+ 0x00200908, // 0026 ADD R8 R4 K8
+ 0x88240107, // 0027 GETMBR R9 R0 K7
+ 0x94201208, // 0028 GETIDX R8 R9 R8
+ 0x5C280400, // 0029 MOVE R10 R2
+ 0x5C2C0200, // 002A MOVE R11 R1
+ 0x5C300E00, // 002B MOVE R12 R7
+ 0x5C341000, // 002C MOVE R13 R8
+ 0x543A0007, // 002D LDINT R14 8
+ 0x3C380A0E, // 002E SHR R14 R5 R14
+ 0x543E00FE, // 002F LDINT R15 255
+ 0x2C381C0F, // 0030 AND R14 R14 R15
+ 0x543E0007, // 0031 LDINT R15 8
+ 0x3C3C0C0F, // 0032 SHR R15 R6 R15
+ 0x544200FE, // 0033 LDINT R16 255
+ 0x2C3C1E10, // 0034 AND R15 R15 R16
+ 0x7C280A00, // 0035 CALL R10 5
+ 0x5C241400, // 0036 MOVE R9 R10
+ 0x5C280400, // 0037 MOVE R10 R2
+ 0x5C2C0200, // 0038 MOVE R11 R1
+ 0x5C300E00, // 0039 MOVE R12 R7
+ 0x5C341000, // 003A MOVE R13 R8
+ 0x543A000F, // 003B LDINT R14 16
+ 0x3C380A0E, // 003C SHR R14 R5 R14
+ 0x543E00FE, // 003D LDINT R15 255
+ 0x2C381C0F, // 003E AND R14 R14 R15
+ 0x543E000F, // 003F LDINT R15 16
+ 0x3C3C0C0F, // 0040 SHR R15 R6 R15
+ 0x544200FE, // 0041 LDINT R16 255
+ 0x2C3C1E10, // 0042 AND R15 R15 R16
+ 0x7C280A00, // 0043 CALL R10 5
+ 0x5C2C0400, // 0044 MOVE R11 R2
+ 0x5C300200, // 0045 MOVE R12 R1
+ 0x5C340E00, // 0046 MOVE R13 R7
+ 0x5C381000, // 0047 MOVE R14 R8
+ 0x543E0017, // 0048 LDINT R15 24
+ 0x3C3C0A0F, // 0049 SHR R15 R5 R15
+ 0x544200FE, // 004A LDINT R16 255
+ 0x2C3C1E10, // 004B AND R15 R15 R16
+ 0x54420017, // 004C LDINT R16 24
+ 0x3C400C10, // 004D SHR R16 R6 R16
+ 0x544600FE, // 004E LDINT R17 255
+ 0x2C402011, // 004F AND R16 R16 R17
+ 0x7C2C0A00, // 0050 CALL R11 5
+ 0x5432000F, // 0051 LDINT R12 16
+ 0x3830120C, // 0052 SHL R12 R9 R12
+ 0x54360007, // 0053 LDINT R13 8
+ 0x3834140D, // 0054 SHL R13 R10 R13
+ 0x3030180D, // 0055 OR R12 R12 R13
+ 0x3030180B, // 0056 OR R12 R12 R11
+ 0x8834010B, // 0057 GETMBR R13 R0 K11
+ 0x8838010C, // 0058 GETMBR R14 R0 K12
+ 0x78360004, // 0059 JMPF R13 #005F
+ 0x783A0003, // 005A JMPF R14 #005F
+ 0x5C3C1C00, // 005B MOVE R15 R14
+ 0x5C401A00, // 005C MOVE R16 R13
+ 0x5C441800, // 005D MOVE R17 R12
+ 0x7C3C0400, // 005E CALL R15 2
+ 0x80041800, // 005F RET 1 R12
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_duration
+********************************************************************/
+be_local_closure(Animate_palette_set_duration, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 7]) { /* constants */
+ /* K0 */ be_const_int(0),
+ /* K1 */ be_nested_str_weak(value_error),
+ /* K2 */ be_nested_str_weak(duration_ms_X20must_X20be_X20positive),
+ /* K3 */ be_nested_str_weak(duration_ms),
+ /* K4 */ be_nested_str_weak(slots_arr),
+ /* K5 */ be_nested_str_weak(parse_palette),
+ /* K6 */ be_const_int(1),
+ }),
+ be_str_weak(set_duration),
+ &be_const_str_solidified,
+ ( &(const binstruction[14]) { /* code */
+ 0x4C080000, // 0000 LDNIL R2
+ 0x1C080202, // 0001 EQ R2 R1 R2
+ 0x780A0000, // 0002 JMPF R2 #0004
+ 0x80000400, // 0003 RET 0
+ 0x18080300, // 0004 LE R2 R1 K0
+ 0x780A0000, // 0005 JMPF R2 #0007
+ 0xB0060302, // 0006 RAISE 1 K1 K2
+ 0x90020601, // 0007 SETMBR R0 K3 R1
+ 0x8C080105, // 0008 GETMET R2 R0 K5
+ 0x58100000, // 0009 LDCONST R4 K0
+ 0x04140306, // 000A SUB R5 R1 K6
+ 0x7C080600, // 000B CALL R2 3
+ 0x90020802, // 000C SETMBR R0 K4 R2
+ 0x80000000, // 000D RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: init
+********************************************************************/
+be_local_closure(Animate_palette_init, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 8]) { /* constants */
+ /* K0 */ be_nested_str_weak(init),
+ /* K1 */ be_nested_str_weak(duration_ms),
+ /* K2 */ be_nested_str_weak(running),
+ /* K3 */ be_nested_str_weak(bri),
+ /* K4 */ be_nested_str_weak(color),
+ /* K5 */ be_nested_str_weak(light_state),
+ /* K6 */ be_nested_str_weak(RGB),
+ /* K7 */ be_nested_str_weak(set_palette),
+ }),
+ be_str_weak(init),
+ &be_const_str_solidified,
+ ( &(const binstruction[19]) { /* code */
+ 0x600C0003, // 0000 GETGBL R3 G3
+ 0x5C100000, // 0001 MOVE R4 R0
+ 0x7C0C0200, // 0002 CALL R3 1
+ 0x8C0C0700, // 0003 GETMET R3 R3 K0
+ 0x7C0C0200, // 0004 CALL R3 1
+ 0x90020202, // 0005 SETMBR R0 K1 R2
+ 0x500C0000, // 0006 LDBOOL R3 0 0
+ 0x90020403, // 0007 SETMBR R0 K2 R3
+ 0x540E0063, // 0008 LDINT R3 100
+ 0x90020603, // 0009 SETMBR R0 K3 R3
+ 0xB80E0A00, // 000A GETNGBL R3 K5
+ 0xB8120A00, // 000B GETNGBL R4 K5
+ 0x88100906, // 000C GETMBR R4 R4 K6
+ 0x7C0C0200, // 000D CALL R3 1
+ 0x90020803, // 000E SETMBR R0 K4 R3
+ 0x8C0C0107, // 000F GETMET R3 R0 K7
+ 0x5C140200, // 0010 MOVE R5 R1
+ 0x7C0C0400, // 0011 CALL R3 2
+ 0x80000000, // 0012 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified class: Animate_palette
+********************************************************************/
+extern const bclass be_class_Animate_animator;
+be_local_class(Animate_palette,
+ 7,
+ &be_class_Animate_animator,
+ be_nested_map(17,
+ ( (struct bmapnode*) &(const bmapnode[]) {
+ { be_const_key_weak(color, 13), be_const_var(6) },
+ { be_const_key_weak(slots, -1), be_const_var(2) },
+ { be_const_key_weak(animate, 11), be_const_closure(Animate_palette_animate_closure) },
+ { be_const_key_weak(range_max, 10), be_const_var(4) },
+ { be_const_key_weak(set_palette, -1), be_const_closure(Animate_palette_set_palette_closure) },
+ { be_const_key_weak(set_bri, -1), be_const_closure(Animate_palette_set_bri_closure) },
+ { be_const_key_weak(bri, -1), be_const_var(5) },
+ { be_const_key_weak(to_css_gradient, 12), be_const_static_closure(Animate_palette_to_css_gradient_closure) },
+ { be_const_key_weak(slots_arr, 1), be_const_var(1) },
+ { be_const_key_weak(range_min, 5), be_const_var(3) },
+ { be_const_key_weak(set_value, -1), be_const_closure(Animate_palette_set_value_closure) },
+ { be_const_key_weak(set_range, -1), be_const_closure(Animate_palette_set_range_closure) },
+ { be_const_key_weak(parse_palette, -1), be_const_closure(Animate_palette_parse_palette_closure) },
+ { be_const_key_weak(palette, -1), be_const_var(0) },
+ { be_const_key_weak(set_duration, -1), be_const_closure(Animate_palette_set_duration_closure) },
+ { be_const_key_weak(init, -1), be_const_closure(Animate_palette_init_closure) },
+ { be_const_key_weak(ptr_to_palette, 0), be_const_static_closure(Animate_palette_ptr_to_palette_closure) },
+ })),
+ be_str_weak(Animate_palette)
+);
+/*******************************************************************/
+
+void be_load_Animate_palette_class(bvm *vm) {
+ be_pushntvclass(vm, &be_class_Animate_palette);
+ be_setglobal(vm, "Animate_palette");
+ be_pop(vm, 1);
+}
+
+extern const bclass be_class_Animate_oscillator;
+
+/********************************************************************
+** Solidified function: set_duty_cycle
+********************************************************************/
+be_local_closure(Animate_oscillator_set_duty_cycle, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_const_int(0),
+ /* K1 */ be_nested_str_weak(duty_cycle),
+ }),
+ be_str_weak(set_duty_cycle),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 9]) { /* code */
+ 0x14080300, // 0000 LT R2 R1 K0
+ 0x780A0000, // 0001 JMPF R2 #0003
+ 0x58040000, // 0002 LDCONST R1 K0
+ 0x540A0063, // 0003 LDINT R2 100
+ 0x24080202, // 0004 GT R2 R1 R2
+ 0x780A0000, // 0005 JMPF R2 #0007
+ 0x54060063, // 0006 LDINT R1 100
+ 0x90020201, // 0007 SETMBR R0 K1 R1
+ 0x80000000, // 0008 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_a
+********************************************************************/
+be_local_closure(Animate_oscillator_set_a, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(a),
+ }),
+ be_str_weak(set_a),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_b
+********************************************************************/
+be_local_closure(Animate_oscillator_set_b, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(b),
+ }),
+ be_str_weak(set_b),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x80000000, // 0001 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_form
+********************************************************************/
+be_local_closure(Animate_oscillator_set_form, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_const_int(1),
+ /* K1 */ be_nested_str_weak(form),
+ }),
+ be_str_weak(set_form),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 6]) { /* code */
+ 0x4C080000, // 0000 LDNIL R2
+ 0x1C080202, // 0001 EQ R2 R1 R2
+ 0x780A0000, // 0002 JMPF R2 #0004
+ 0x58040000, // 0003 LDCONST R1 K0
+ 0x90020201, // 0004 SETMBR R0 K1 R1
+ 0x80000000, // 0005 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_phase
+********************************************************************/
+be_local_closure(Animate_oscillator_set_phase, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_const_int(0),
+ /* K1 */ be_nested_str_weak(phase),
+ }),
+ be_str_weak(set_phase),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 9]) { /* code */
+ 0x14080300, // 0000 LT R2 R1 K0
+ 0x780A0000, // 0001 JMPF R2 #0003
+ 0x58040000, // 0002 LDCONST R1 K0
+ 0x540A0063, // 0003 LDINT R2 100
+ 0x24080202, // 0004 GT R2 R1 R2
+ 0x780A0000, // 0005 JMPF R2 #0007
+ 0x54060063, // 0006 LDINT R1 100
+ 0x90020201, // 0007 SETMBR R0 K1 R1
+ 0x80000000, // 0008 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: init
+********************************************************************/
+be_local_closure(Animate_oscillator_init, /* name */
+ be_nested_proto(
+ 7, /* nstack */
+ 5, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[10]) { /* constants */
+ /* K0 */ be_nested_str_weak(init),
+ /* K1 */ be_nested_str_weak(phase),
+ /* K2 */ be_const_int(0),
+ /* K3 */ be_nested_str_weak(duty_cycle),
+ /* K4 */ be_nested_str_weak(a),
+ /* K5 */ be_nested_str_weak(b),
+ /* K6 */ be_nested_str_weak(duration_ms),
+ /* K7 */ be_nested_str_weak(value),
+ /* K8 */ be_const_int(1),
+ /* K9 */ be_nested_str_weak(form),
+ }),
+ be_str_weak(init),
+ &be_const_str_solidified,
+ ( &(const binstruction[18]) { /* code */
+ 0x60140003, // 0000 GETGBL R5 G3
+ 0x5C180000, // 0001 MOVE R6 R0
+ 0x7C140200, // 0002 CALL R5 1
+ 0x8C140B00, // 0003 GETMET R5 R5 K0
+ 0x7C140200, // 0004 CALL R5 1
+ 0x90020302, // 0005 SETMBR R0 K1 K2
+ 0x54160031, // 0006 LDINT R5 50
+ 0x90020605, // 0007 SETMBR R0 K3 R5
+ 0x90020801, // 0008 SETMBR R0 K4 R1
+ 0x90020A02, // 0009 SETMBR R0 K5 R2
+ 0x90020C03, // 000A SETMBR R0 K6 R3
+ 0x90020E01, // 000B SETMBR R0 K7 R1
+ 0x4C140000, // 000C LDNIL R5
+ 0x1C140805, // 000D EQ R5 R4 R5
+ 0x78160000, // 000E JMPF R5 #0010
+ 0x58100008, // 000F LDCONST R4 K8
+ 0x90021204, // 0010 SETMBR R0 K9 R4
+ 0x80000000, // 0011 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: animate
+********************************************************************/
+be_local_closure(Animate_oscillator_animate, /* name */
+ be_nested_proto(
+ 18, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[20]) { /* constants */
+ /* K0 */ be_nested_str_weak(duration_ms),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(millis),
+ /* K3 */ be_nested_str_weak(origin),
+ /* K4 */ be_const_int(0),
+ /* K5 */ be_nested_str_weak(scale_uint),
+ /* K6 */ be_nested_str_weak(duty_cycle),
+ /* K7 */ be_nested_str_weak(beat),
+ /* K8 */ be_nested_str_weak(a),
+ /* K9 */ be_nested_str_weak(b),
+ /* K10 */ be_nested_str_weak(value),
+ /* K11 */ be_nested_str_weak(phase),
+ /* K12 */ be_nested_str_weak(form),
+ /* K13 */ be_const_int(1),
+ /* K14 */ be_nested_str_weak(scale_int),
+ /* K15 */ be_const_int(2),
+ /* K16 */ be_const_int(3),
+ /* K17 */ be_nested_str_weak(sine_int),
+ /* K18 */ be_nested_str_weak(obj),
+ /* K19 */ be_nested_str_weak(mth),
+ }),
+ be_str_weak(animate),
+ &be_const_str_solidified,
+ ( &(const binstruction[141]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x4C0C0000, // 0001 LDNIL R3
+ 0x1C080403, // 0002 EQ R2 R2 R3
+ 0x780A0000, // 0003 JMPF R2 #0005
+ 0x80000400, // 0004 RET 0
+ 0x4C080000, // 0005 LDNIL R2
+ 0x1C080202, // 0006 EQ R2 R1 R2
+ 0x780A0003, // 0007 JMPF R2 #000C
+ 0xB80A0200, // 0008 GETNGBL R2 K1
+ 0x8C080502, // 0009 GETMET R2 R2 K2
+ 0x7C080200, // 000A CALL R2 1
+ 0x5C040400, // 000B MOVE R1 R2
+ 0x88080103, // 000C GETMBR R2 R0 K3
+ 0x04080202, // 000D SUB R2 R1 R2
+ 0x140C0504, // 000E LT R3 R2 K4
+ 0x780E0001, // 000F JMPF R3 #0012
+ 0x58080004, // 0010 LDCONST R2 K4
+ 0x88040103, // 0011 GETMBR R1 R0 K3
+ 0x880C0100, // 0012 GETMBR R3 R0 K0
+ 0x4C100000, // 0013 LDNIL R4
+ 0xB8160200, // 0014 GETNGBL R5 K1
+ 0x8C140B05, // 0015 GETMET R5 R5 K5
+ 0x881C0106, // 0016 GETMBR R7 R0 K6
+ 0x58200004, // 0017 LDCONST R8 K4
+ 0x54260063, // 0018 LDINT R9 100
+ 0x58280004, // 0019 LDCONST R10 K4
+ 0x5C2C0600, // 001A MOVE R11 R3
+ 0x7C140C00, // 001B CALL R5 6
+ 0x5C100A00, // 001C MOVE R4 R5
+ 0x28140403, // 001D GE R5 R2 R3
+ 0x78160007, // 001E JMPF R5 #0027
+ 0x0C180403, // 001F DIV R6 R2 R3
+ 0x08180C03, // 0020 MUL R6 R6 R3
+ 0x88140103, // 0021 GETMBR R5 R0 K3
+ 0x00140A06, // 0022 ADD R5 R5 R6
+ 0x90020605, // 0023 SETMBR R0 K3 R5
+ 0x10080403, // 0024 MOD R2 R2 R3
+ 0x8C140107, // 0025 GETMET R5 R0 K7
+ 0x7C140200, // 0026 CALL R5 1
+ 0x88140108, // 0027 GETMBR R5 R0 K8
+ 0x88180109, // 0028 GETMBR R6 R0 K9
+ 0x881C010A, // 0029 GETMBR R7 R0 K10
+ 0x5C200400, // 002A MOVE R8 R2
+ 0x8824010B, // 002B GETMBR R9 R0 K11
+ 0x24241304, // 002C GT R9 R9 K4
+ 0x7826000B, // 002D JMPF R9 #003A
+ 0xB8260200, // 002E GETNGBL R9 K1
+ 0x8C241305, // 002F GETMET R9 R9 K5
+ 0x882C010B, // 0030 GETMBR R11 R0 K11
+ 0x58300004, // 0031 LDCONST R12 K4
+ 0x54360063, // 0032 LDINT R13 100
+ 0x58380004, // 0033 LDCONST R14 K4
+ 0x5C3C0600, // 0034 MOVE R15 R3
+ 0x7C240C00, // 0035 CALL R9 6
+ 0x00201009, // 0036 ADD R8 R8 R9
+ 0x24241003, // 0037 GT R9 R8 R3
+ 0x78260000, // 0038 JMPF R9 #003A
+ 0x04201003, // 0039 SUB R8 R8 R3
+ 0x8824010C, // 003A GETMBR R9 R0 K12
+ 0x1C24130D, // 003B EQ R9 R9 K13
+ 0x78260009, // 003C JMPF R9 #0047
+ 0xB8260200, // 003D GETNGBL R9 K1
+ 0x8C24130E, // 003E GETMET R9 R9 K14
+ 0x5C2C1000, // 003F MOVE R11 R8
+ 0x58300004, // 0040 LDCONST R12 K4
+ 0x0434070D, // 0041 SUB R13 R3 K13
+ 0x5C380A00, // 0042 MOVE R14 R5
+ 0x5C3C0C00, // 0043 MOVE R15 R6
+ 0x7C240C00, // 0044 CALL R9 6
+ 0x5C1C1200, // 0045 MOVE R7 R9
+ 0x7002003B, // 0046 JMP #0083
+ 0x8824010C, // 0047 GETMBR R9 R0 K12
+ 0x1C24130F, // 0048 EQ R9 R9 K15
+ 0x78260015, // 0049 JMPF R9 #0060
+ 0x14241004, // 004A LT R9 R8 R4
+ 0x78260009, // 004B JMPF R9 #0056
+ 0xB8260200, // 004C GETNGBL R9 K1
+ 0x8C24130E, // 004D GETMET R9 R9 K14
+ 0x5C2C1000, // 004E MOVE R11 R8
+ 0x58300004, // 004F LDCONST R12 K4
+ 0x0434090D, // 0050 SUB R13 R4 K13
+ 0x5C380A00, // 0051 MOVE R14 R5
+ 0x5C3C0C00, // 0052 MOVE R15 R6
+ 0x7C240C00, // 0053 CALL R9 6
+ 0x5C1C1200, // 0054 MOVE R7 R9
+ 0x70020008, // 0055 JMP #005F
+ 0xB8260200, // 0056 GETNGBL R9 K1
+ 0x8C24130E, // 0057 GETMET R9 R9 K14
+ 0x5C2C1000, // 0058 MOVE R11 R8
+ 0x5C300800, // 0059 MOVE R12 R4
+ 0x0434070D, // 005A SUB R13 R3 K13
+ 0x5C380C00, // 005B MOVE R14 R6
+ 0x5C3C0A00, // 005C MOVE R15 R5
+ 0x7C240C00, // 005D CALL R9 6
+ 0x5C1C1200, // 005E MOVE R7 R9
+ 0x70020022, // 005F JMP #0083
+ 0x8824010C, // 0060 GETMBR R9 R0 K12
+ 0x1C241310, // 0061 EQ R9 R9 K16
+ 0x78260005, // 0062 JMPF R9 #0069
+ 0x14241004, // 0063 LT R9 R8 R4
+ 0x78260001, // 0064 JMPF R9 #0067
+ 0x5C1C0A00, // 0065 MOVE R7 R5
+ 0x70020000, // 0066 JMP #0068
+ 0x5C1C0C00, // 0067 MOVE R7 R6
+ 0x70020019, // 0068 JMP #0083
+ 0x8824010C, // 0069 GETMBR R9 R0 K12
+ 0x542A0003, // 006A LDINT R10 4
+ 0x1C24120A, // 006B EQ R9 R9 R10
+ 0x78260015, // 006C JMPF R9 #0083
+ 0xB8260200, // 006D GETNGBL R9 K1
+ 0x8C24130E, // 006E GETMET R9 R9 K14
+ 0x5C2C1000, // 006F MOVE R11 R8
+ 0x58300004, // 0070 LDCONST R12 K4
+ 0x0434070D, // 0071 SUB R13 R3 K13
+ 0x58380004, // 0072 LDCONST R14 K4
+ 0x543E7FFE, // 0073 LDINT R15 32767
+ 0x7C240C00, // 0074 CALL R9 6
+ 0xB82A0200, // 0075 GETNGBL R10 K1
+ 0x8C281511, // 0076 GETMET R10 R10 K17
+ 0x54321FFF, // 0077 LDINT R12 8192
+ 0x0430120C, // 0078 SUB R12 R9 R12
+ 0x7C280400, // 0079 CALL R10 2
+ 0xB82E0200, // 007A GETNGBL R11 K1
+ 0x8C2C170E, // 007B GETMET R11 R11 K14
+ 0x5C341400, // 007C MOVE R13 R10
+ 0x5439EFFF, // 007D LDINT R14 -4096
+ 0x543E0FFF, // 007E LDINT R15 4096
+ 0x5C400A00, // 007F MOVE R16 R5
+ 0x5C440C00, // 0080 MOVE R17 R6
+ 0x7C2C0C00, // 0081 CALL R11 6
+ 0x5C1C1600, // 0082 MOVE R7 R11
+ 0x90021407, // 0083 SETMBR R0 K10 R7
+ 0x88240112, // 0084 GETMBR R9 R0 K18
+ 0x88280113, // 0085 GETMBR R10 R0 K19
+ 0x78260004, // 0086 JMPF R9 #008C
+ 0x782A0003, // 0087 JMPF R10 #008C
+ 0x5C2C1400, // 0088 MOVE R11 R10
+ 0x5C301200, // 0089 MOVE R12 R9
+ 0x5C340E00, // 008A MOVE R13 R7
+ 0x7C2C0400, // 008B CALL R11 2
+ 0x80040E00, // 008C RET 1 R7
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified class: Animate_oscillator
+********************************************************************/
+extern const bclass be_class_Animate_animator;
+be_local_class(Animate_oscillator,
+ 6,
+ &be_class_Animate_animator,
+ be_nested_map(13,
+ ( (struct bmapnode*) &(const bmapnode[]) {
+ { be_const_key_weak(animate, -1), be_const_closure(Animate_oscillator_animate_closure) },
+ { be_const_key_weak(a, -1), be_const_var(2) },
+ { be_const_key_weak(init, 11), be_const_closure(Animate_oscillator_init_closure) },
+ { be_const_key_weak(duty_cycle, 10), be_const_var(1) },
+ { be_const_key_weak(b, -1), be_const_var(3) },
+ { be_const_key_weak(value, -1), be_const_var(5) },
+ { be_const_key_weak(set_duty_cycle, 2), be_const_closure(Animate_oscillator_set_duty_cycle_closure) },
+ { be_const_key_weak(set_a, -1), be_const_closure(Animate_oscillator_set_a_closure) },
+ { be_const_key_weak(set_b, -1), be_const_closure(Animate_oscillator_set_b_closure) },
+ { be_const_key_weak(set_form, -1), be_const_closure(Animate_oscillator_set_form_closure) },
+ { be_const_key_weak(phase, -1), be_const_var(0) },
+ { be_const_key_weak(form, -1), be_const_var(4) },
+ { be_const_key_weak(set_phase, 0), be_const_closure(Animate_oscillator_set_phase_closure) },
+ })),
+ be_str_weak(Animate_oscillator)
+);
+/*******************************************************************/
+
+void be_load_Animate_oscillator_class(bvm *vm) {
+ be_pushntvclass(vm, &be_class_Animate_oscillator);
+ be_setglobal(vm, "Animate_oscillator");
+ be_pop(vm, 1);
+}
+/********************************************************************/
+/* End of solidification */
diff --git a/lib/libesp32/berry_animate/src/solidify/solidified_leds_frame_be_methods.h b/lib/libesp32/berry_animate/src/solidify/solidified_leds_frame_be_methods.h
new file mode 100644
index 000000000..7a565f9f2
--- /dev/null
+++ b/lib/libesp32/berry_animate/src/solidify/solidified_leds_frame_be_methods.h
@@ -0,0 +1,186 @@
+/* Solidification of leds_frame_be_methods.h */
+/********************************************************************\
+* Generated code, don't edit *
+\********************************************************************/
+#include "be_constobj.h"
+
+extern const bclass be_class_Leds_frame_be;
+
+/********************************************************************
+** Solidified function: setitem
+********************************************************************/
+be_local_closure(Leds_frame_be_setitem, /* name */
+ be_nested_proto(
+ 8, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str(set),
+ }),
+ &be_const_str_setitem,
+ &be_const_str_solidified,
+ ( &(const binstruction[ 7]) { /* code */
+ 0x8C0C0100, // 0000 GETMET R3 R0 K0
+ 0x54160003, // 0001 LDINT R5 4
+ 0x08140205, // 0002 MUL R5 R1 R5
+ 0x5C180400, // 0003 MOVE R6 R2
+ 0x541E0003, // 0004 LDINT R7 4
+ 0x7C0C0800, // 0005 CALL R3 4
+ 0x80000000, // 0006 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_pixel
+********************************************************************/
+be_local_closure(Leds_frame_be_set_pixel, /* name */
+ be_nested_proto(
+ 11, /* nstack */
+ 6, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_const_int(0),
+ /* K1 */ be_nested_str(setitem),
+ }),
+ &be_const_str_set_pixel,
+ &be_const_str_solidified,
+ ( &(const binstruction[26]) { /* code */
+ 0x4C180000, // 0000 LDNIL R6
+ 0x1C180A06, // 0001 EQ R6 R5 R6
+ 0x781A0000, // 0002 JMPF R6 #0004
+ 0x58140000, // 0003 LDCONST R5 K0
+ 0x541A00FE, // 0004 LDINT R6 255
+ 0x2C180A06, // 0005 AND R6 R5 R6
+ 0x541E0017, // 0006 LDINT R7 24
+ 0x38180C07, // 0007 SHL R6 R6 R7
+ 0x541E00FE, // 0008 LDINT R7 255
+ 0x2C1C0407, // 0009 AND R7 R2 R7
+ 0x5422000F, // 000A LDINT R8 16
+ 0x381C0E08, // 000B SHL R7 R7 R8
+ 0x30180C07, // 000C OR R6 R6 R7
+ 0x541E00FE, // 000D LDINT R7 255
+ 0x2C1C0607, // 000E AND R7 R3 R7
+ 0x54220007, // 000F LDINT R8 8
+ 0x381C0E08, // 0010 SHL R7 R7 R8
+ 0x30180C07, // 0011 OR R6 R6 R7
+ 0x541E00FE, // 0012 LDINT R7 255
+ 0x2C1C0807, // 0013 AND R7 R4 R7
+ 0x30180C07, // 0014 OR R6 R6 R7
+ 0x8C1C0101, // 0015 GETMET R7 R0 K1
+ 0x5C240200, // 0016 MOVE R9 R1
+ 0x5C280C00, // 0017 MOVE R10 R6
+ 0x7C1C0600, // 0018 CALL R7 3
+ 0x80000000, // 0019 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: item
+********************************************************************/
+be_local_closure(Leds_frame_be_item, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str(get),
+ }),
+ &be_const_str_item,
+ &be_const_str_solidified,
+ ( &(const binstruction[ 6]) { /* code */
+ 0x8C080100, // 0000 GETMET R2 R0 K0
+ 0x54120003, // 0001 LDINT R4 4
+ 0x08100204, // 0002 MUL R4 R1 R4
+ 0x54160003, // 0003 LDINT R5 4
+ 0x7C080600, // 0004 CALL R2 3
+ 0x80040400, // 0005 RET 1 R2
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: init
+********************************************************************/
+be_local_closure(Leds_frame_be_init, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_const_int(0),
+ /* K1 */ be_nested_str(pixel_size),
+ /* K2 */ be_nested_str(init),
+ }),
+ &be_const_str_init,
+ &be_const_str_solidified,
+ ( &(const binstruction[12]) { /* code */
+ 0x14080300, // 0000 LT R2 R1 K0
+ 0x780A0000, // 0001 JMPF R2 #0003
+ 0x44040200, // 0002 NEG R1 R1
+ 0x90020201, // 0003 SETMBR R0 K1 R1
+ 0x60080003, // 0004 GETGBL R2 G3
+ 0x5C0C0000, // 0005 MOVE R3 R0
+ 0x7C080200, // 0006 CALL R2 1
+ 0x8C080502, // 0007 GETMET R2 R2 K2
+ 0x5411FFFB, // 0008 LDINT R4 -4
+ 0x08100204, // 0009 MUL R4 R1 R4
+ 0x7C080400, // 000A CALL R2 2
+ 0x80000000, // 000B RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified class: Leds_frame_be
+********************************************************************/
+be_local_class(Leds_frame_be,
+ 0,
+ NULL,
+ be_nested_map(4,
+ ( (struct bmapnode*) &(const bmapnode[]) {
+ { be_const_key(setitem, 1), be_const_closure(Leds_frame_be_setitem_closure) },
+ { be_const_key(set_pixel, -1), be_const_closure(Leds_frame_be_set_pixel_closure) },
+ { be_const_key(item, -1), be_const_closure(Leds_frame_be_item_closure) },
+ { be_const_key(init, -1), be_const_closure(Leds_frame_be_init_closure) },
+ })),
+ (bstring*) &be_const_str_Leds_frame_be
+);
+/*******************************************************************/
+
+void be_load_Leds_frame_be_class(bvm *vm) {
+ be_pushntvclass(vm, &be_class_Leds_frame_be);
+ be_setglobal(vm, "Leds_frame_be");
+ be_pop(vm, 1);
+}
+/********************************************************************/
+/* End of solidification */
diff --git a/pio-tools/gen-berry-structures.py b/pio-tools/gen-berry-structures.py
index 923ff723b..f1cf36052 100644
--- a/pio-tools/gen-berry-structures.py
+++ b/pio-tools/gen-berry-structures.py
@@ -16,6 +16,6 @@ for filePath in fileList:
# print("Deleting file : ", filePath)
except:
print("Error while deleting file : ", filePath)
-cmd = (env["PYTHONEXE"],join("tools","coc","coc"),"-o","generate","src","default",join("..","berry_tasmota","src"),join("..","berry_matter","src","solidify"),join("..","berry_matter","src"),join("..","berry_tasmota","src","solidify"),join("..","berry_mapping","src"),join("..","berry_int64","src"),join("..","..","libesp32_lvgl","lv_binding_berry","src"),join("..","..","libesp32_lvgl","lv_binding_berry","src","solidify"),join("..","..","libesp32_lvgl","lv_binding_berry","generate"),"-c",join("default","berry_conf.h"))
+cmd = (env["PYTHONEXE"],join("tools","coc","coc"),"-o","generate","src","default",join("..","berry_tasmota","src"),join("..","berry_matter","src","solidify"),join("..","berry_matter","src"),join("..","berry_animate","src","solidify"),join("..","berry_animate","src"),join("..","berry_tasmota","src","solidify"),join("..","berry_mapping","src"),join("..","berry_int64","src"),join("..","..","libesp32_lvgl","lv_binding_berry","src"),join("..","..","libesp32_lvgl","lv_binding_berry","src","solidify"),join("..","..","libesp32_lvgl","lv_binding_berry","generate"),"-c",join("default","berry_conf.h"))
returncode = subprocess.call(cmd, shell=False)
os.chdir(CURRENT_DIR)
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_leds.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_leds.ino
index e75f5cbed..08f287567 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_leds.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_leds.ino
@@ -251,6 +251,27 @@ extern "C" {
}
}
+uint32_t ApplyBriGamma(uint32_t color_a /* 0xRRGGBB */, uint32_t bri /* 0..255 */, bool gamma) {
+ if (bri == 0) { return 0x000000; } // if bri is zero, short-cut
+ uint32_t r = (color_a >> 16) & 0xFF;
+ uint32_t g = (color_a >> 8) & 0xFF;
+ uint32_t b = (color_a ) & 0xFF;
+
+ if (bri < 255) { // apply bri
+ r = changeUIntScale(bri, 0, 255, 0, r);
+ g = changeUIntScale(bri, 0, 255, 0, g);
+ b = changeUIntScale(bri, 0, 255, 0, b);
+ }
+
+ if (gamma) { // apply gamma
+ r = ledGamma(r);
+ g = ledGamma(g);
+ b = ledGamma(b);
+ }
+ uint32_t rgb = (r << 16) | (g << 8) | b;
+ return rgb;
+}
+
extern "C" {
// Leds.blend_color(color_a:int, color_b:int [, alpha:int]) -> color:int
//
@@ -291,27 +312,6 @@ extern "C" {
be_raise(vm, kTypeError, nullptr);
}
- static uint32_t ApplyBriGamma(uint32_t color_a /* 0xRRGGBB */, uint32_t bri /* 0..255 */, bool gamma) {
- if (bri == 0) { return 0x000000; } // if bri is zero, short-cut
- uint32_t r = (color_a >> 16) & 0xFF;
- uint32_t g = (color_a >> 8) & 0xFF;
- uint32_t b = (color_a ) & 0xFF;
-
- if (bri < 255) { // apply bri
- r = changeUIntScale(bri, 0, 255, 0, r);
- g = changeUIntScale(bri, 0, 255, 0, g);
- b = changeUIntScale(bri, 0, 255, 0, b);
- }
-
- if (gamma) { // apply gamma
- r = ledGamma(r);
- g = ledGamma(g);
- b = ledGamma(b);
- }
- uint32_t rgb = (r << 16) | (g << 8) | b;
- return rgb;
- }
-
// Leds.apply_bri_gamma(color_rgb:int (0xRRGGBB) [bri:int (0..255), gamma:bool]) -> color:int (0xRRGGBB)
//
int32_t be_leds_apply_bri_gamma(bvm *vm);
@@ -335,152 +335,6 @@ extern "C" {
}
be_raise(vm, kTypeError, nullptr);
}
-
- // Leds_frame.blend(color1:int, color2:int, alpha:int) -> int
- //
- int32_t be_leds_blend(bvm *vm);
- int32_t be_leds_blend(bvm *vm) {
- int32_t top = be_top(vm); // Get the number of arguments
- if (top >= 3 && be_isint(vm, 1) && be_isint(vm, 2) && be_isint(vm, 3)) {
- uint32_t color_a = be_toint(vm, 1);
- uint32_t color_b = be_toint(vm, 2);
- uint32_t alpha = be_toint(vm, 3);
- uint32_t r = (color_a >> 16) & 0xFF;
- uint32_t g = (color_a >> 8) & 0xFF;
- uint32_t b = (color_a ) & 0xFF;
- uint32_t a = (color_a >> 24) & 0xFF;
- uint32_t r2 = (color_b >> 16) & 0xFF;
- uint32_t g2 = (color_b >> 8) & 0xFF;
- uint32_t b2 = (color_b ) & 0xFF;
- uint32_t a2 = (color_b >> 24) & 0xFF;
- uint32_t r3 = changeUIntScale(alpha, 0, 255, r2, r);
- uint32_t g3 = changeUIntScale(alpha, 0, 255, g2, g);
- uint32_t b3 = changeUIntScale(alpha, 0, 255, b2, b);
- uint32_t a3 = changeUIntScale(alpha, 0, 255, a2, a);
- uint32_t rgb = (a3 << 24) | (r3 << 16) | (g3 << 8) | b3;
- be_pushint(vm, rgb);
- be_return(vm);
- }
- be_raise(vm, kTypeError, nullptr);
- }
-
- // Leds_frame.blend_pixels(dest:bytes(), foreground:bytes) -> nil
- // Destination can be the same as foreground or background
- //
- // All calculation are done in `0xAARRGGBB` format, AA=0 if opaque (i.e. ignored)
- // Background has always alpha = 0 (any other value is ignored) - for simplification
- // Size is truncated to smallest of all 3 buffers
- int32_t be_leds_blend_pixels(bvm *vm);
- int32_t be_leds_blend_pixels(bvm *vm) {
- int32_t top = be_top(vm); // Get the number of arguments
- if (top >= 2 && be_isbytes(vm, 2)) {
- size_t dest_len = 0;
- uint32_t * dest_buf = (uint32_t*) be_tobytes(vm, 1, &dest_len);
- // back = dest for now, could be changed in the future
- size_t back_len = 0;
- const uint32_t * back_buf = (const uint32_t*) be_tobytes(vm, 1, &back_len);
- size_t fore_len = 0;
- const uint32_t * fore_buf = (const uint32_t*) be_tobytes(vm, 2, &fore_len);
-
- if (fore_len < dest_len) { dest_len = fore_len; }
- if (back_len < dest_len) { dest_len = back_len; }
- size_t pixels_count = dest_len / 4;
- if (pixels_count > 0) {
- uint32_t * dest = (uint32_t *)dest_buf;
- uint32_t * back = (uint32_t *)back_buf;
- uint32_t * fore = (uint32_t *)fore_buf;
- for (size_t i = 0; i < pixels_count; i++) {
- uint32_t back_argb = back[i];
- uint32_t fore_argb = fore[i];
- uint32_t fore_alpha = (fore_argb >> 24) & 0xFF;
- uint32_t dest_rgb_new = back_argb;
- if (fore_alpha == 0) { // opaque layer, copy value from fore
- dest_rgb_new = fore_argb;
- } else if (fore_alpha == 255) { // fore is transparent, use back
- // nothing to do, dest_rgb_new = back_argb above
- } else {
- uint32_t back_r = (back_argb >> 16) & 0xFF;
- uint32_t fore_r = (fore_argb >> 16) & 0xFF;
- uint32_t back_g = (back_argb >> 8) & 0xFF;
- uint32_t fore_g = (fore_argb >> 8) & 0xFF;
- uint32_t back_b = (back_argb ) & 0xFF;
- uint32_t fore_b = (fore_argb ) & 0xFF;
- uint32_t dest_r_new = changeUIntScale(fore_alpha, 0, 255, fore_r, back_r);
- uint32_t dest_g_new = changeUIntScale(fore_alpha, 0, 255, fore_g, back_g);
- uint32_t dest_b_new = changeUIntScale(fore_alpha, 0, 255, fore_b, back_b);
- dest_rgb_new = (dest_r_new << 16) | (dest_g_new << 8) | dest_b_new;
- }
- dest[i] = dest_rgb_new;
- }
- }
- be_return_nil(vm);
- }
- be_raise(vm, kTypeError, nullptr);
- }
-
- // Leds_frame.fill_pixels(dest:bytes(), color:int) -> nil
- //
- // Fill buffer with same color
- int32_t be_leds_fill_pixels(bvm *vm);
- int32_t be_leds_fill_pixels(bvm *vm) {
- int32_t top = be_top(vm); // Get the number of arguments
- if (top >= 2 && be_isint(vm, 2)) {
- size_t dest_len = 0;
- uint32_t * dest_buf = (uint32_t*) be_tobytes(vm, 1, &dest_len);
- uint32_t color = be_toint(vm, 2);
-
- size_t pixels_count = dest_len / 4;
- if (pixels_count > 0) {
- uint32_t * dest = (uint32_t *)dest_buf;
- for (size_t i = 0; i < pixels_count; i++) {
- dest[i] = color;
- }
- }
- be_return_nil(vm);
- }
- be_raise(vm, kTypeError, nullptr);
- }
-
- // Leds_frame.paste_pixels(neopixel:bytes(), led_buffer:bytes(), bri:int 0..100, gamma:bool)
- //
- // Copy from ARGB buffer to GRB
- int32_t be_leds_paste_pixels(bvm *vm);
- int32_t be_leds_paste_pixels(bvm *vm) {
- int32_t top = be_top(vm); // Get the number of arguments
- if (top >= 2 && be_isbytes(vm, 2)) {
- size_t src_len = 0;
- uint32_t * src_buf = (uint32_t*) be_tobytes(vm, 1, &src_len);
- size_t dest_len = 0;
- uint8_t * dest_buf = (uint8_t*) be_tobytes(vm, 2, &dest_len);
-
- uint32_t bri255 = 255;
- if (top >= 3 && be_isint(vm, 3)) {
- bri255 = be_toint(vm, 3);
- }
- bool gamma = false;
- if (top >= 4 && be_isbool(vm, 4)) {
- gamma = be_tobool(vm, 4);
- }
-
- size_t pixels_count = src_len / 4;
- if (pixels_count > dest_len / 3) { pixels_count = dest_len / 3; }
- if (pixels_count > 0) {
- for (size_t i = 0; i < pixels_count; i++) {
- uint32_t src_argb = ApplyBriGamma(src_buf[i], bri255, gamma);
- uint32_t src_r = (src_argb >> 16) & 0xFF;
- uint32_t src_g = (src_argb >> 8) & 0xFF;
- uint32_t src_b = (src_argb ) & 0xFF;
- dest_buf[i * 3 + 0] = src_g;
- dest_buf[i * 3 + 1] = src_r;
- dest_buf[i * 3 + 2] = src_b;
- }
- }
- be_return_nil(vm);
- }
- be_raise(vm, kTypeError, nullptr);
- }
-
-
}
#endif // USE_WS2812
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino
index a075a2e8d..38bbf9aa6 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino
@@ -31,6 +31,9 @@ extern "C" {
#ifdef USE_MATTER_DEVICE
#include "berry_matter.h"
#endif
+#ifdef USE_WS2812
+ #include "berry_animate.h"
+#endif
#include "be_vm.h"
#include "ZipReadFS.h"
#include "ccronexpr.h"
From bb1e3cac97e6caf7d8cea92ca69f1eb706168ab8 Mon Sep 17 00:00:00 2001
From: Jason2866 <24528715+Jason2866@users.noreply.github.com>
Date: Mon, 25 Dec 2023 11:41:51 +0100
Subject: [PATCH 045/303] Fix typo in Berry solidify GH actions
---
.github/workflows/Tasmota_build_devel.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/Tasmota_build_devel.yml b/.github/workflows/Tasmota_build_devel.yml
index 48fc99fa4..9d660b3a1 100644
--- a/.github/workflows/Tasmota_build_devel.yml
+++ b/.github/workflows/Tasmota_build_devel.yml
@@ -67,7 +67,7 @@ jobs:
name: |
berry_tasmota
berry_matter
- berrt_animate
+ berry_animate
berry_lvgl
berry_header
path: |
From d39896f6a2ff217dee649b9154bb52ebddc2c61d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?DUPONCHEEL=20S=C3=A9bastien?=
Date: Mon, 25 Dec 2023 12:42:20 +0100
Subject: [PATCH 046/303] HDMI CEC: Allow TV device type emulation. (#20310)
The previous check set device type default when HDMIType was set to CEC_Device::CDT_TV.
---
tasmota/tasmota_xdrv_driver/xdrv_70_1_hdmi_cec.ino | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_70_1_hdmi_cec.ino b/tasmota/tasmota_xdrv_driver/xdrv_70_1_hdmi_cec.ino
index 4a1daf136..deb7c9776 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_70_1_hdmi_cec.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_70_1_hdmi_cec.ino
@@ -65,7 +65,7 @@ void HdmiCecInit(void)
{
// CEC device type
CEC_Device::CEC_DEVICE_TYPE device_type = (CEC_Device::CEC_DEVICE_TYPE) Settings->hdmi_cec_device_type;
- if (device_type == CEC_Device::CDT_TV || device_type >= CEC_Device::CDT_LAST) {
+ if (device_type < 0 || device_type >= CEC_Device::CDT_LAST) {
// if type in Settings is invalid, default to PLAYBACK_DEVICE
device_type = CEC_Device::CDT_PLAYBACK_DEVICE;
Settings->hdmi_cec_device_type = (uint8_t) device_type;
From 77a58a3642f151fa4d49882ea5db7ff63df87260 Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Mon, 25 Dec 2023 14:18:59 +0100
Subject: [PATCH 047/303] Fix domoticz topic edge case
---
CHANGELOG.md | 2 +-
.../tasmota_xdrv_driver/xdrv_07_domoticz.ino | 36 ++++++++++++++-----
2 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 828a099c7..da65a65c0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,7 +15,7 @@ All notable changes to this project will be documented in this file.
### Changed
- Support syslog updates every sleep or every second if `#define SYSLOG_UPDATE_SECOND` (#20260)
-- Moved Berry animate to its own `berry_animate` lib
+- Moved Berry animate to its own `berry_animate` lib (#20309)
### Fixed
- Matter Contact sensor was not triggering any update (#20232)
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_07_domoticz.ino b/tasmota/tasmota_xdrv_driver/xdrv_07_domoticz.ino
index 2994eeafc..99e45cfce 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_07_domoticz.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_07_domoticz.ino
@@ -18,10 +18,29 @@
*/
#ifdef USE_DOMOTICZ
+/*********************************************************************************************\
+ * Domoticz support
+ *
+ * Adds commands:
+ * DzIdx - Set power number to Domoticz Idx allowing Domoticz to control Tasmota power
+ * DzKeyIdx - Set button number to Domoticz Idx allowing Tasmota button as input to Domoticz
+ * DzSwitchId - Set switch number to Domoticz Idx allowing Tasmota switch as input to Domoticz
+ * DzSensorIdx - Set sensor type to Domoticz Idx
+ * DzUpdateTimer 0 - Send power state at teleperiod to Domoticz (default)
+ * DzUpdateTimer - Send power state at interval to Domoticz
+ * DzSend1 , - {\"idx\":,\"nvalue\":0,\"svalue\":\"\",\"Battery\":xx,\"RSSI\":yy}
+ * Example: rule1 on power1#state do dzsend1 9001,%value% endon
+ * DzSend1 418,%var1%;%var2% or DzSend1 418,%var1%:%var2% - Notice colon as substitute to semi-colon
+ * DzSend2 , - USE_SHUTTER only - {\"idx\":,\"nvalue\":,\"svalue\":\"\",\"Battery\":xx,\"RSSI\":yy}
+ * DzSend3 , - {\"idx\":,\"nvalue\":,\"Battery\":xx,\"RSSI\":yy}
+ * DzSend4 , - {\"command\":\"switchlight\",\"idx\":,\"switchcmd\":\"\"}
+ * DzSend5 , - {\"command\":\"switchscene\",\"idx\":,\"switchcmd\":\"\"}
+\*********************************************************************************************/
#define XDRV_07 7
-//#define D_PRFX_DOMOTICZ "Domoticz"
+//#define USE_DOMOTICZ_DEBUG // Enable additional debug logging
+
#define D_PRFX_DOMOTICZ "Dz"
#define D_CMND_IDX "Idx"
#define D_CMND_KEYIDX "KeyIdx"
@@ -218,16 +237,17 @@ bool DomoticzMqttData(void) {
return true; // No valid data
}
-// char dom_data[XdrvMailbox.data_len +1];
-// strcpy(dom_data, XdrvMailbox.data);
-// AddLog(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_DOMOTICZ "Topic '%s', Data '%s'"), XdrvMailbox.topic, RemoveControlCharacter(dom_data));
+#ifdef USE_DOMOTICZ_DEBUG
+ char dom_data[XdrvMailbox.data_len +1];
+ strcpy(dom_data, XdrvMailbox.data);
+ AddLog(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_DOMOTICZ "%s = %s"), XdrvMailbox.topic, RemoveControlCharacter(dom_data));
+#endif // USE_DOMOTICZ_DEBUG
// Quick check if this is mine using topic domoticz/out/{$idx}
if (strlen(XdrvMailbox.topic) > strlen(DOMOTICZ_OUT_TOPIC)) {
char* topic_index = &XdrvMailbox.topic[strlen(DOMOTICZ_OUT_TOPIC) +1];
- int32_t top_index = atoi(topic_index); // 0 if no number (in case of domoticz/out/floor/room)
- if (top_index > 0) {
- if (DomoticzIdx2Relay(top_index) < 0) {
+ if (strchr(topic_index, '/') == nullptr) { // Skip if topic ...floor/room
+ if (DomoticzIdx2Relay(atoi(topic_index)) < 0) {
return true; // Idx not mine
}
}
@@ -248,7 +268,7 @@ bool DomoticzMqttData(void) {
return true; // Nvalue out of boundaries
}
- AddLog(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_DOMOTICZ "Topic %s, idx %d, nvalue %d"), XdrvMailbox.topic, Settings->domoticz_relay_idx[relay_index], nvalue);
+ AddLog(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_DOMOTICZ "%s, idx %d, nvalue %d"), XdrvMailbox.topic, Settings->domoticz_relay_idx[relay_index], nvalue);
bool iscolordimmer = (strcmp_P(domoticz.getStr(PSTR("dtype")), PSTR("Color Switch")) == 0);
bool isShutter = (strcmp_P(domoticz.getStr(PSTR("dtype")), PSTR("Light/Switch")) == 0) && (strncmp_P(domoticz.getStr(PSTR("switchType")),PSTR("Blinds"), 6) == 0);
From 341545362076c531fc7ee8d435a7a11aff8eb759 Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Tue, 26 Dec 2023 12:29:50 +0100
Subject: [PATCH 048/303] Berry Improve error message when constructor returns
NULL (#20314)
---
lib/libesp32/berry_mapping/src/be_class_wrapper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/libesp32/berry_mapping/src/be_class_wrapper.c b/lib/libesp32/berry_mapping/src/be_class_wrapper.c
index 94cbb9f51..a1abc23ee 100644
--- a/lib/libesp32/berry_mapping/src/be_class_wrapper.c
+++ b/lib/libesp32/berry_mapping/src/be_class_wrapper.c
@@ -399,7 +399,7 @@ int be_check_arg_type(bvm *vm, int arg_start, int argc, const char * arg_type, i
// `+` forbids any NULL value (raises an exception) while `=` allows a NULL value
static void be_set_ctor_ptr(bvm *vm, void * ptr, const char *name) {
if (name == NULL) return; // do nothing if no name of attribute
- if (name[0] == '+' && ptr == NULL) { be_raise(vm, "value_error", "argument cannot be NULL"); }
+ if (name[0] == '+' && ptr == NULL) { be_raise(vm, "value_error", "native constructor cannot return NULL"); }
if (name[0] == '+' || name[0] == '=') { name++; } // skip prefix '^' if any
if (strlen(name) == 0) return; // do nothing if name is empty
From b7b83eaaaad487aa66a8b1eeadb645da49aac7fd Mon Sep 17 00:00:00 2001
From: smhc
Date: Tue, 26 Dec 2023 21:41:55 +1000
Subject: [PATCH 049/303] Only reduce sleep for lights if necessary (#20146)
Co-authored-by: Shane Hird
---
tasmota/tasmota_xdrv_driver/xdrv_04_light.ino | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_04_light.ino b/tasmota/tasmota_xdrv_driver/xdrv_04_light.ino
index 127e036c3..e52f31783 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_04_light.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_04_light.ino
@@ -1777,9 +1777,10 @@ void LightAnimate(void)
// make sure we update CT range in case SetOption82 was changed
Light.strip_timer_counter++;
- // set sleep parameter: either settings,
- // or set a maximum of PWM_MAX_SLEEP if light is on or Fade is running
- if (Light.power || Light.fade_running) {
+ // Set a maximum sleep of PWM_MAX_SLEEP if Fade is running, or if light is on and
+ // a frequently updating light scheme is in use. This is to allow smooth transitions
+ // between light levels and colors.
+ if ((Settings->light_scheme > LS_POWER && Light.power) || Light.fade_running) {
if (TasmotaGlobal.sleep > PWM_MAX_SLEEP) {
sleep_previous = TasmotaGlobal.sleep; // save previous value of sleep
TasmotaGlobal.sleep = PWM_MAX_SLEEP; // set a maximum value (in milliseconds) to sleep to ensure that animations are smooth
From c744612a29084b13f7fb350665980c1e727e842a Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Tue, 26 Dec 2023 14:22:47 +0100
Subject: [PATCH 050/303] Fix scripter buffer overflow (#20303)
---
tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino b/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino
index 98a9c352f..6e8f41d3c 100755
--- a/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino
@@ -9349,8 +9349,10 @@ bool Script_SubCmd(void) {
cp += tlen;
if (XdrvMailbox.data_len > 0) {
*cp++ = '(';
- strncpy(cp, XdrvMailbox.data,XdrvMailbox.data_len);
- cp += XdrvMailbox.data_len;
+ uint32_t max_space = sizeof(cmdbuff) - tlen - 4; // 4 = #()0
+ uint32_t max_len = min(XdrvMailbox.data_len, max_space);
+ strncpy(cp, XdrvMailbox.data, max_len);
+ cp += max_len;
*cp++ = ')';
*cp = 0;
}
From 84fb3879c7d17431cb732f371a32054bb291e0b9 Mon Sep 17 00:00:00 2001
From: hk2k2 <70974088+hk2k2@users.noreply.github.com>
Date: Wed, 27 Dec 2023 09:27:16 +0100
Subject: [PATCH 051/303] Update xdsp_15_tm1637.ino (#20317)
Displaydimmer command has not worked correctly on 2 daisy-Chained MAX7219 7-Segment Displays.
Only the first Module (8 Segments) changed their brightness.
---
tasmota/tasmota_xdsp_display/xdsp_15_tm1637.ino | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tasmota/tasmota_xdsp_display/xdsp_15_tm1637.ino b/tasmota/tasmota_xdsp_display/xdsp_15_tm1637.ino
index b4599132c..4d43d23ff 100644
--- a/tasmota/tasmota_xdsp_display/xdsp_15_tm1637.ino
+++ b/tasmota/tasmota_xdsp_display/xdsp_15_tm1637.ino
@@ -1131,7 +1131,7 @@ void TM1637Dim(void)
{
for (uint8_t dev_addr = 0; dev_addr < Settings->display_width / 8; dev_addr++)
{
- max7219display->setIntensity(MAX7219_ADDR, brightness); // 0 - 7
+ max7219display->setIntensity(MAX7219_ADDR + dev_addr, brightness); // 0 - 7
}
}
}
From 13a9c3b5b23f5075de419138b0c2b114854e349f Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Wed, 27 Dec 2023 17:29:03 +0100
Subject: [PATCH 052/303] Add delays to wifi init code
Add delays to wifi init code to fix some edge power cases.
---
tasmota/tasmota_support/support_wifi.ino | 28 ++++++++++++------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/tasmota/tasmota_support/support_wifi.ino b/tasmota/tasmota_support/support_wifi.ino
index 348266166..c76a278a1 100644
--- a/tasmota/tasmota_support/support_wifi.ino
+++ b/tasmota/tasmota_support/support_wifi.ino
@@ -102,6 +102,7 @@ void WifiConfig(uint8_t type)
UdpDisconnect();
#endif // USE_EMULATION
WiFi.disconnect(); // Solve possible Wifi hangs
+ delay(100);
Wifi.config_type = type;
#ifndef USE_WEBSERVER
@@ -146,7 +147,6 @@ void WifiSetMode(WiFiMode_t wifi_mode) {
// See: https://github.com/esp8266/Arduino/issues/6172#issuecomment-500457407
WiFi.forceSleepWake(); // Make sure WiFi is really active.
- delay(100);
}
uint32_t retry = 2;
@@ -158,10 +158,8 @@ void WifiSetMode(WiFiMode_t wifi_mode) {
if (wifi_mode == WIFI_OFF) {
delay(1000);
WiFi.forceSleepBegin();
- delay(1);
- } else {
- delay(30); // Must allow for some time to init.
}
+ delay(100); // Must allow for some time to init.
}
void WiFiSetSleepMode(void)
@@ -201,6 +199,7 @@ void WiFiSetSleepMode(void)
WiFi.setSleepMode(WIFI_MODEM_SLEEP); // Sleep (Esp8288/Arduino core and sdk default)
}
}
+ delay(100);
}
void WifiBegin(uint8_t flag, uint8_t channel) {
@@ -215,15 +214,13 @@ void WifiBegin(uint8_t flag, uint8_t channel) {
#ifdef USE_WIFI_RANGE_EXTENDER
if (WiFi.getMode() != WIFI_AP_STA || !RgxApUp()) { // Preserve range extender connections (#17103)
- WiFi.disconnect(true); // Delete SDK wifi config
- delay(200);
- WifiSetMode(WIFI_STA); // Disable AP mode
- }
-#else
- WiFi.disconnect(true); // Delete SDK wifi config
+#endif // USE_WIFI_RANGE_EXTENDER
+ WiFi.disconnect(true); // Delete SDK wifi config
delay(200);
- WifiSetMode(WIFI_STA); // Disable AP mode
-#endif
+ WifiSetMode(WIFI_STA); // Disable AP mode
+#ifdef USE_WIFI_RANGE_EXTENDER
+ }
+#endif // USE_WIFI_RANGE_EXTENDER
WiFiSetSleepMode();
WifiSetOutputPower();
@@ -261,6 +258,7 @@ void WifiBegin(uint8_t flag, uint8_t channel) {
} else {
WiFi.begin(SettingsText(SET_STASSID1 + Settings->sta_active), SettingsText(SET_STAPWD1 + Settings->sta_active));
}
+ delay(500);
AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_WIFI D_CONNECTING_TO_AP "%d %s%s " D_IN_MODE " 11%c " D_AS " %s..."),
Settings->sta_active +1, SettingsText(SET_STASSID1 + Settings->sta_active), stemp, pgm_read_byte(&kWifiPhyMode[WiFi.getPhyMode() & 0x3]), TasmotaGlobal.hostname);
@@ -804,6 +802,9 @@ bool HasIP(void) {
}
void WifiCheckIp(void) {
+ AddLog(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_WIFI D_CHECKING_CONNECTION));
+ Wifi.counter = WIFI_CHECK_SEC;
+
#ifdef USE_IPV6
if (WL_CONNECTED == WiFi.status()) {
#ifdef ESP32
@@ -939,8 +940,6 @@ void WifiCheck(uint8_t param)
}
} else {
if (Wifi.counter <= 0) {
- AddLog(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_WIFI D_CHECKING_CONNECTION));
- Wifi.counter = WIFI_CHECK_SEC;
WifiCheckIp();
}
if ((WL_CONNECTED == WiFi.status()) && WifiHasIP() && !Wifi.config_type) {
@@ -978,6 +977,7 @@ float WifiGetOutputPower(void) {
void WifiSetOutputPower(void) {
if (Settings->wifi_output_power) {
WiFi.setOutputPower((float)(Settings->wifi_output_power) / 10);
+ delay(100);
} else {
AddLog(LOG_LEVEL_DEBUG, PSTR("WIF: Dynamic Tx power enabled")); // WifiPower 0
}
From 21c7edcb50daa890a8f642c2a9c8171d7cb794d3 Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Wed, 27 Dec 2023 22:03:56 +0100
Subject: [PATCH 053/303] Add display of active drivers using command ``status
4``
---
CHANGELOG.md | 1 +
RELEASENOTES.md | 1 +
tasmota/include/tasmota.h | 2 +-
tasmota/tasmota.ino | 2 +
.../xdrv_01_9_webserver.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_02_9_mqtt.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_03_energy.ino | 3 ++
.../xdrv_03_esp32_energy.ino | 3 ++
tasmota/tasmota_xdrv_driver/xdrv_04_light.ino | 23 +++++----
.../tasmota_xdrv_driver/xdrv_05_irremote.ino | 3 ++
.../xdrv_05_irremote_full.ino | 5 ++
.../tasmota_xdrv_driver/xdrv_06_snfbridge.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_07_domoticz.ino | 3 ++
.../xdrv_08_serial_bridge.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_09_timers.ino | 3 ++
tasmota/tasmota_xdrv_driver/xdrv_10_rules.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_10_scripter.ino | 4 ++
tasmota/tasmota_xdrv_driver/xdrv_11_knx.ino | 3 ++
.../xdrv_122_file_settings_demo.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_127_debug.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_12_discovery.ino | 3 ++
.../xdrv_12_home_assistant.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_13_display.ino | 3 ++
tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino | 4 ++
.../tasmota_xdrv_driver/xdrv_15_pca9685.ino | 3 ++
.../xdrv_15_pca9685_v2.ino | 3 ++
.../xdrv_16_tuyamcu_v1.ino | 3 ++
.../xdrv_16_tuyamcu_v2.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_17_rcswitch.ino | 3 ++
.../xdrv_18_armtronix_dimmers.ino | 3 ++
.../xdrv_19_ps16dz_dimmer.ino | 3 ++
tasmota/tasmota_xdrv_driver/xdrv_20_hue.ino | 3 ++
tasmota/tasmota_xdrv_driver/xdrv_21_wemo.ino | 3 ++
.../xdrv_21_wemo_multi.ino | 3 ++
.../xdrv_22_sonoff_ifan.ino | 3 ++
.../xdrv_23_zigbee_A_impl.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_24_buzzer.ino | 3 ++
.../xdrv_25_A4988_Stepper.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_26_ariluxrf.ino | 3 ++
.../xdrv_27_esp32_shutter.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_27_shutter.ino | 3 ++
.../xdrv_28_pcf8574_v2.ino | 6 +++
.../tasmota_xdrv_driver/xdrv_29_deepsleep.ino | 3 ++
.../xdrv_30_exs_dimmer.ino | 3 ++
.../xdrv_31_tasmota_client.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_32_hotplug.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_33_nrf24l01.ino | 4 ++
.../xdrv_34_wemos_motor_v1.ino | 3 ++
.../xdrv_35_pwm_dimmer.ino | 4 ++
.../tasmota_xdrv_driver/xdrv_36_keeloq.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_37_sonoff_d1.ino | 3 ++
tasmota/tasmota_xdrv_driver/xdrv_38_ping.ino | 11 ++--
.../xdrv_39_thermostat.ino | 4 ++
.../tasmota_xdrv_driver/xdrv_40_telegram.ino | 3 ++
.../xdrv_41_tcp_bridge.ino | 3 ++
.../xdrv_42_0_i2s_audio.ino | 4 ++
.../tasmota_xdrv_driver/xdrv_43_mlx90640.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_44_miel_hvac.ino | 4 ++
.../xdrv_45_shelly_dimmer.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_46_ccloader.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_47_ftc532.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_48_timeprop.ino | 3 ++
tasmota/tasmota_xdrv_driver/xdrv_49_pid.ino | 3 ++
.../xdrv_50_filesystem.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_51_bs814a2.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_52_9_berry.ino | 3 ++
.../xdrv_53_projector_ctrl.ino | 4 ++
tasmota/tasmota_xdrv_driver/xdrv_54_lvgl.ino | 4 ++
tasmota/tasmota_xdrv_driver/xdrv_55_touch.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_56_rtc_chips.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_57_9_tasmesh.ino | 3 ++
.../xdrv_58_range_extender.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_59_influxdb.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_60_shift595.ino | 21 ++++----
.../tasmota_xdrv_driver/xdrv_61_ds3502.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_62_improv.ino | 3 ++
.../xdrv_63_modbus_bridge.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_64_pca9632.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_65_tuyamcubr.ino | 4 ++
.../tasmota_xdrv_driver/xdrv_66_tm1638.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_67_mcp23xxx.ino | 3 ++
.../xdrv_68_zerocrossDimmer.ino | 3 ++
.../tasmota_xdrv_driver/xdrv_69_pca9557.ino | 3 ++
.../xdrv_70_1_hdmi_cec.ino | 26 +++++-----
.../tasmota_xdrv_driver/xdrv_79_esp32_ble.ino | 3 ++
.../xdrv_81_esp32_webcam.ino | 3 ++
.../xdrv_81_esp32_webcam_task.ino | 3 ++
.../xdrv_82_esp32_ethernet.ino | 3 ++
.../xdrv_83_esp32_watch.ino | 3 ++
.../xdrv_85_esp32_ble_eq3_trv.ino | 3 ++
.../xdrv_86_esp32_sonoff_spm.ino | 3 ++
.../xdrv_87_esp32_sonoff_tm1621.ino | 3 ++
.../xdrv_88_esp32_shelly_pro.ino | 39 +++++++-------
.../xdrv_88_esp32_shelly_pro_v1.ino | 33 ++++++------
.../xdrv_88_esp32_shelly_pro_v2.ino | 51 ++++++++++---------
.../xdrv_89_esp32_dali.ino | 3 ++
.../xdrv_90_esp32_dingtian_relay.ino | 3 ++
.../xdrv_91_magic_switch.ino | 3 ++
.../tasmota_xx2c_global/xdrv_interface.ino | 11 +++-
.../tasmota_xx2c_global/xsns_interface.ino | 4 ++
100 files changed, 406 insertions(+), 95 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index da65a65c0..722216896 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
- Support for CST816S touch interface (#20213)
- NeoPool hydrolysis FL1 and Redox flag (#20258)
- Matter support for password for remote Tasmota devices (#20296)
+- Display of active drivers using command ``status 4``
### Breaking Changed
- Refactoring of Berry `animate` module for WS2812 Leds (#20236)
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index dba6bb153..1dfa0a653 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -120,6 +120,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
### Added
- Support for CST816S touch interface [#20213](https://github.com/arendst/Tasmota/issues/20213)
- Support for Sonoff Basic R4 Magic Switch [#20247](https://github.com/arendst/Tasmota/issues/20247)
+- Display of active drivers using command ``status 4``
- NeoPool hydrolysis FL1 and Redox flag [#20258](https://github.com/arendst/Tasmota/issues/20258)
- Matter support for password for remote Tasmota devices [#20296](https://github.com/arendst/Tasmota/issues/20296)
diff --git a/tasmota/include/tasmota.h b/tasmota/include/tasmota.h
index d6ff4b2b7..1feca3fef 100644
--- a/tasmota/include/tasmota.h
+++ b/tasmota/include/tasmota.h
@@ -423,7 +423,7 @@ enum LightSubtypes { LST_NONE, LST_SINGLE, LST_COLDWARM, LST_RGB, LST_RGBW, LS
enum LightTypes { LT_BASIC, LT_PWM1, LT_PWM2, LT_PWM3, LT_PWM4, LT_PWM5, LT_PWM6, LT_PWM7,
LT_NU8, LT_SERIAL1, LT_SERIAL2, LT_RGB, LT_RGBW, LT_RGBWC, LT_NU14, LT_NU15 }; // Do not insert new fields
-enum XsnsFunctions { FUNC_SETTINGS_OVERRIDE, FUNC_SETUP_RING1, FUNC_SETUP_RING2, FUNC_PRE_INIT, FUNC_INIT,
+enum XsnsFunctions { FUNC_SETTINGS_OVERRIDE, FUNC_SETUP_RING1, FUNC_SETUP_RING2, FUNC_PRE_INIT, FUNC_INIT, FUNC_ACTIVE,
FUNC_LOOP, FUNC_SLEEP_LOOP, FUNC_EVERY_50_MSECOND, FUNC_EVERY_100_MSECOND, FUNC_EVERY_200_MSECOND, FUNC_EVERY_250_MSECOND, FUNC_EVERY_SECOND,
FUNC_RESET_SETTINGS, FUNC_RESTORE_SETTINGS, FUNC_SAVE_SETTINGS, FUNC_SAVE_AT_MIDNIGHT, FUNC_SAVE_BEFORE_RESTART, FUNC_INTERRUPT_STOP, FUNC_INTERRUPT_START,
FUNC_AFTER_TELEPERIOD, FUNC_JSON_APPEND, FUNC_WEB_SENSOR, FUNC_WEB_COL_SENSOR,
diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino
index 1cf661f04..7febc7a3b 100644
--- a/tasmota/tasmota.ino
+++ b/tasmota/tasmota.ino
@@ -775,6 +775,8 @@ void setup(void) {
if (bitRead(Settings->rule_enabled, 0)) Run_Scripter(">BS",3,0);
#endif
+ XdrvCall(FUNC_ACTIVE); // FUNC_ACTIVE
+
TasmotaGlobal.rules_flag.system_init = 1;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino b/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino
index df267b533..20ce791f0 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino
@@ -3894,6 +3894,9 @@ bool Xdrv01(uint32_t function)
case FUNC_COMMAND:
result = DecodeCommand(kWebCommands, WebCommand);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino b/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino
index 7312135e8..047a9eb5f 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino
@@ -2033,6 +2033,9 @@ bool Xdrv02(uint32_t function)
case FUNC_PRE_INIT:
MqttInit();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino b/tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino
index fa58c4725..66bf50acd 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino
@@ -1497,6 +1497,9 @@ bool Xdrv03(uint32_t function)
case FUNC_NETWORK_DOWN:
XnrgCall(FUNC_NETWORK_DOWN);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino b/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino
index a4bb1c615..228e8b9de 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino
@@ -1799,6 +1799,9 @@ bool Xdrv03(uint32_t function)
case FUNC_NETWORK_DOWN:
XnrgCall(FUNC_NETWORK_DOWN);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_04_light.ino b/tasmota/tasmota_xdrv_driver/xdrv_04_light.ino
index e52f31783..14799f208 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_04_light.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_04_light.ino
@@ -3460,17 +3460,20 @@ bool Xdrv04(uint32_t function)
LightInit();
break;
#ifdef USE_LIGHT_ARTNET
- case FUNC_JSON_APPEND:
- ArtNetJSONAppend();
- break;
- case FUNC_NETWORK_UP:
- ArtNetFuncNetworkUp();
- break;
- case FUNC_NETWORK_DOWN:
- ArtNetFuncNetworkDown();
- break;
+ case FUNC_JSON_APPEND:
+ ArtNetJSONAppend();
+ break;
+ case FUNC_NETWORK_UP:
+ ArtNetFuncNetworkUp();
+ break;
+ case FUNC_NETWORK_DOWN:
+ ArtNetFuncNetworkDown();
+ break;
#endif // USE_LIGHT_ARTNET
- }
+ case FUNC_ACTIVE:
+ result = true;
+ break;
+ }
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_05_irremote.ino b/tasmota/tasmota_xdrv_driver/xdrv_05_irremote.ino
index 0996484b5..271a34b9d 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_05_irremote.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_05_irremote.ino
@@ -444,6 +444,9 @@ bool Xdrv05(uint32_t function)
result = DecodeCommand(kIrRemoteCommands, IrRemoteCommand);
}
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_05_irremote_full.ino b/tasmota/tasmota_xdrv_driver/xdrv_05_irremote_full.ino
index 98f45373e..5115903ab 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_05_irremote_full.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_05_irremote_full.ino
@@ -916,6 +916,11 @@ bool Xdrv05(uint32_t function)
result = DecodeCommand(kIrRemoteCommands, IrRemoteCommand);
}
break;
+ case FUNC_ACTIVE:
+ if (ir_recv_active || ir_recv_active) {
+ result = true;
+ }
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_06_snfbridge.ino b/tasmota/tasmota_xdrv_driver/xdrv_06_snfbridge.ino
index 2b9988ec6..8bcb3e41e 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_06_snfbridge.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_06_snfbridge.ino
@@ -566,6 +566,9 @@ bool Xdrv06(uint32_t function)
case FUNC_PRE_INIT:
SetSerial(19200, TS_SERIAL_8N1);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
#endif // ESP8266
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_07_domoticz.ino b/tasmota/tasmota_xdrv_driver/xdrv_07_domoticz.ino
index 99e45cfce..4d4c54102 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_07_domoticz.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_07_domoticz.ino
@@ -699,6 +699,9 @@ bool Xdrv07(uint32_t function) {
case FUNC_COMMAND:
result = DecodeCommand(kDomoticzCommands, DomoticzCommand);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino b/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino
index bcb38fc90..c3d432808 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino
@@ -336,6 +336,9 @@ bool Xdrv08(uint32_t function) {
case FUNC_COMMAND:
result = DecodeCommand(kSerialBridgeCommands, SerialBridgeCommand);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_09_timers.ino b/tasmota/tasmota_xdrv_driver/xdrv_09_timers.ino
index 14026806f..fa96bf3c3 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_09_timers.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_09_timers.ino
@@ -979,6 +979,9 @@ bool Xdrv09(uint32_t function)
case FUNC_COMMAND:
result = DecodeCommand(kTimerCommands, TimerCommand);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_10_rules.ino b/tasmota/tasmota_xdrv_driver/xdrv_10_rules.ino
index 945c9b8c2..13389b082 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_10_rules.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_10_rules.ino
@@ -2504,6 +2504,9 @@ bool Xdrv10(uint32_t function)
case FUNC_PRE_INIT:
RulesInit();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino b/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino
index 6e8f41d3c..63730602f 100755
--- a/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino
@@ -13039,6 +13039,10 @@ bool Xdrv10(uint32_t function)
case FUNC_NETWORK_UP:
break;
+
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_11_knx.ino b/tasmota/tasmota_xdrv_driver/xdrv_11_knx.ino
index 719eea482..67fa26f49 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_11_knx.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_11_knx.ino
@@ -1342,6 +1342,9 @@ bool Xdrv11(uint32_t function)
break;
// case FUNC_SET_POWER:
// break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_122_file_settings_demo.ino b/tasmota/tasmota_xdrv_driver/xdrv_122_file_settings_demo.ino
index 0e1dd13f3..7680df760 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_122_file_settings_demo.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_122_file_settings_demo.ino
@@ -188,6 +188,9 @@ bool Xdrv122(uint32_t function) {
case FUNC_SAVE_BEFORE_RESTART:
// !!! DO NOT USE AS IT'S FUNCTION IS BETTER HANDLED BY FUNC_SAVE_SETTINGS !!!
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_127_debug.ino b/tasmota/tasmota_xdrv_driver/xdrv_127_debug.ino
index fd4e99cf7..35d3a9ace 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_127_debug.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_127_debug.ino
@@ -812,6 +812,9 @@ bool Xdrv127(uint32_t function)
case FUNC_COMMAND:
result = DecodeCommand(kDebugCommands, DebugCommand);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_12_discovery.ino b/tasmota/tasmota_xdrv_driver/xdrv_12_discovery.ino
index f71a19b8d..07e963088 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_12_discovery.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_12_discovery.ino
@@ -328,6 +328,9 @@ bool Xdrv12(uint32_t function) {
case FUNC_MQTT_INIT:
TasDiscoverInit();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_12_home_assistant.ino b/tasmota/tasmota_xdrv_driver/xdrv_12_home_assistant.ino
index 3b6378694..a58983ec2 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_12_home_assistant.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_12_home_assistant.ino
@@ -1321,6 +1321,9 @@ bool Xdrv12(uint32_t function)
case FUNC_MQTT_DATA:
result = HAssMqttLWT();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_13_display.ino b/tasmota/tasmota_xdrv_driver/xdrv_13_display.ino
index 47bfd7c62..18a387e41 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_13_display.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_13_display.ino
@@ -2939,6 +2939,9 @@ bool Xdrv13(uint32_t function)
case FUNC_COMMAND:
result = DecodeCommand(kDisplayCommands, DisplayCommand);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino b/tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino
index 625f0359c..82582b5c5 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino
@@ -414,6 +414,10 @@ bool Xdrv14(uint32_t function)
case FUNC_EVERY_SECOND:
MP3_EVERY_SECOND();
break;
+
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_15_pca9685.ino b/tasmota/tasmota_xdrv_driver/xdrv_15_pca9685.ino
index 8f82432c2..c9c980f9f 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_15_pca9685.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_15_pca9685.ino
@@ -228,6 +228,9 @@ bool Xdrv15(uint32_t function)
result = PCA9685_Command();
}
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_15_pca9685_v2.ino b/tasmota/tasmota_xdrv_driver/xdrv_15_pca9685_v2.ino
index 75ff7dd08..5ba364e30 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_15_pca9685_v2.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_15_pca9685_v2.ino
@@ -613,6 +613,9 @@ bool Xdrv15(uint32_t function)
result = PCA9685_Command();
}
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino
index 1c0e29315..cb7184922 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino
@@ -1725,6 +1725,9 @@ bool Xdrv16(uint32_t function) {
TuyaSensorsShow(0);
break;
#endif // USE_WEBSERVER
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino
index c3fc0b395..c9c0908e0 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino
@@ -2575,6 +2575,9 @@ bool Xdrv16(uint32_t function) {
TuyaSensorsShow(0);
break;
#endif // USE_WEBSERVER
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_17_rcswitch.ino b/tasmota/tasmota_xdrv_driver/xdrv_17_rcswitch.ino
index 05c28fa07..51b868634 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_17_rcswitch.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_17_rcswitch.ino
@@ -246,6 +246,9 @@ bool Xdrv17(uint32_t function)
case FUNC_INIT:
RfInit();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_18_armtronix_dimmers.ino b/tasmota/tasmota_xdrv_driver/xdrv_18_armtronix_dimmers.ino
index e070e5d82..c512fdc3c 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_18_armtronix_dimmers.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_18_armtronix_dimmers.ino
@@ -190,6 +190,9 @@ bool Xdrv18(uint32_t function)
case FUNC_SET_CHANNELS:
result = ArmtronixSetChannels();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_19_ps16dz_dimmer.ino b/tasmota/tasmota_xdrv_driver/xdrv_19_ps16dz_dimmer.ino
index 69d0a69c0..a7c513bd7 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_19_ps16dz_dimmer.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_19_ps16dz_dimmer.ino
@@ -225,6 +225,9 @@ bool Xdrv19(uint32_t function)
case FUNC_MODULE_INIT:
result = PS16DZModuleSelected();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_20_hue.ino b/tasmota/tasmota_xdrv_driver/xdrv_20_hue.ino
index 74611fa78..3fae7ed2f 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_20_hue.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_20_hue.ino
@@ -1168,6 +1168,9 @@ bool Xdrv20(uint32_t function)
case FUNC_NETWORK_DOWN:
UdpDisconnect();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_21_wemo.ino b/tasmota/tasmota_xdrv_driver/xdrv_21_wemo.ino
index f3fa8ab92..a2fd187c7 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_21_wemo.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_21_wemo.ino
@@ -366,6 +366,9 @@ bool Xdrv21(uint32_t function)
case FUNC_NETWORK_DOWN:
UdpDisconnect();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_21_wemo_multi.ino b/tasmota/tasmota_xdrv_driver/xdrv_21_wemo_multi.ino
index c6b5f9410..641f9109d 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_21_wemo_multi.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_21_wemo_multi.ino
@@ -465,6 +465,9 @@ bool Xdrv21(uint32_t function)
case FUNC_NETWORK_DOWN:
UdpDisconnect();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_22_sonoff_ifan.ino b/tasmota/tasmota_xdrv_driver/xdrv_22_sonoff_ifan.ino
index 6cf5da0c5..13d8cfe24 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_22_sonoff_ifan.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_22_sonoff_ifan.ino
@@ -261,6 +261,9 @@ bool Xdrv22(uint32_t function) {
case FUNC_MODULE_INIT:
result = SonoffIfanInit();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_A_impl.ino b/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_A_impl.ino
index 175f7bd6b..341a82c2f 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_A_impl.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_A_impl.ino
@@ -2484,6 +2484,9 @@ bool Xdrv23(uint32_t function) {
restoreDumpAllDevices();
}
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_24_buzzer.ino b/tasmota/tasmota_xdrv_driver/xdrv_24_buzzer.ino
index 9a54076d5..8f4c52b3f 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_24_buzzer.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_24_buzzer.ino
@@ -253,6 +253,9 @@ bool Xdrv24(uint32_t function) {
case FUNC_PIN_STATE:
result = BuzzerPinState();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_25_A4988_Stepper.ino b/tasmota/tasmota_xdrv_driver/xdrv_25_A4988_Stepper.ino
index d72c51545..0d97adae1 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_25_A4988_Stepper.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_25_A4988_Stepper.ino
@@ -137,6 +137,9 @@ bool Xdrv25(uint32_t function)
case FUNC_COMMAND:
result = DecodeCommand(kA4988Commands, A4988Command);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_26_ariluxrf.ino b/tasmota/tasmota_xdrv_driver/xdrv_26_ariluxrf.ino
index ede03b44c..cf45edef1 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_26_ariluxrf.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_26_ariluxrf.ino
@@ -187,6 +187,9 @@ bool Xdrv26(uint32_t function)
case FUNC_INTERRUPT_START:
AriluxRfInit();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino
index e42402bc2..c40832657 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino
@@ -2371,6 +2371,9 @@ bool Xdrv27(uint32_t function)
ShutterShow();
break;
#endif // USE_WEBSERVER
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino
index a3c926220..b6a11b3bb 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino
@@ -1972,6 +1972,9 @@ bool Xdrv27(uint32_t function)
ShutterShow();
break;
#endif // USE_WEBSERVER
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_28_pcf8574_v2.ino b/tasmota/tasmota_xdrv_driver/xdrv_28_pcf8574_v2.ino
index 6fb855bb4..7c56f460c 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_28_pcf8574_v2.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_28_pcf8574_v2.ino
@@ -720,6 +720,9 @@ bool Xdrv28(uint32_t function) {
break;
#endif // USE_PCF8574_DISPLAYINPUT
#endif // USE_WEBSERVER
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
#ifdef USE_PCF8574_MODE2
} else if (2 == Pcf8574.mode) {
@@ -747,6 +750,9 @@ bool Xdrv28(uint32_t function) {
case FUNC_ADD_SWITCH:
result = Pcf8574AddSwitch();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
#endif // USE_PCF8574_MODE2
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_29_deepsleep.ino b/tasmota/tasmota_xdrv_driver/xdrv_29_deepsleep.ino
index bae29c8f1..b64880465 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_29_deepsleep.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_29_deepsleep.ino
@@ -332,6 +332,9 @@ bool Xdrv29(uint32_t function)
case FUNC_PRE_INIT:
DeepSleepReInit();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_30_exs_dimmer.ino b/tasmota/tasmota_xdrv_driver/xdrv_30_exs_dimmer.ino
index 7579072b3..fed86a93d 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_30_exs_dimmer.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_30_exs_dimmer.ino
@@ -611,6 +611,9 @@ bool Xdrv30(uint32_t function)
result = DecodeCommand(kExsCommands, ExsCommand);
break;
#endif
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_31_tasmota_client.ino b/tasmota/tasmota_xdrv_driver/xdrv_31_tasmota_client.ino
index e4d41988e..345fc9dba 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_31_tasmota_client.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_31_tasmota_client.ino
@@ -559,6 +559,9 @@ bool Xdrv31(uint32_t function) {
case FUNC_COMMAND:
result = DecodeCommand(kTasmotaClientCommands, TasmotaClientCommand);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_32_hotplug.ino b/tasmota/tasmota_xdrv_driver/xdrv_32_hotplug.ino
index d5dba3b3c..6a247e5e5 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_32_hotplug.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_32_hotplug.ino
@@ -94,6 +94,9 @@ bool Xdrv32(uint32_t function)
case FUNC_PRE_INIT:
HotPlugInit();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_33_nrf24l01.ino b/tasmota/tasmota_xdrv_driver/xdrv_33_nrf24l01.ino
index 83381d203..2289aec23 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_33_nrf24l01.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_33_nrf24l01.ino
@@ -85,6 +85,10 @@ bool Xdrv33(uint32_t function) {
if (FUNC_INIT == function) {
NRF24Detect();
+ } else if (NRF24.chipType) {
+ if (FUNC_ACTIVE == function) {
+ result = true;
+ }
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_34_wemos_motor_v1.ino b/tasmota/tasmota_xdrv_driver/xdrv_34_wemos_motor_v1.ino
index 4b25b714d..3708f2d82 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_34_wemos_motor_v1.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_34_wemos_motor_v1.ino
@@ -284,6 +284,9 @@ bool Xdrv34(uint32_t function)
result = WMotorV1Command();
}
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_35_pwm_dimmer.ino b/tasmota/tasmota_xdrv_driver/xdrv_35_pwm_dimmer.ino
index 76e9e7bca..d5d2b00d3 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_35_pwm_dimmer.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_35_pwm_dimmer.ino
@@ -948,6 +948,10 @@ bool Xdrv35(uint32_t function)
case FUNC_PRE_INIT:
PWMModulePreInit();
break;
+
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_36_keeloq.ino b/tasmota/tasmota_xdrv_driver/xdrv_36_keeloq.ino
index 13b700920..2487f8495 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_36_keeloq.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_36_keeloq.ino
@@ -276,6 +276,9 @@ bool Xdrv36(uint32_t function)
KeeloqInit();
DEBUG_DRIVER_LOG(PSTR("KLQ: init done"));
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_37_sonoff_d1.ino b/tasmota/tasmota_xdrv_driver/xdrv_37_sonoff_d1.ino
index a727b6080..0e656fc79 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_37_sonoff_d1.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_37_sonoff_d1.ino
@@ -191,6 +191,9 @@ bool Xdrv37(uint32_t function)
case FUNC_MODULE_INIT:
result = SonoffD1ModuleSelected();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_38_ping.ino b/tasmota/tasmota_xdrv_driver/xdrv_38_ping.ino
index ba7914c5f..77e8c5b6a 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_38_ping.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_38_ping.ino
@@ -442,11 +442,14 @@ bool Xdrv38(uint32_t function)
switch (function) {
case FUNC_EVERY_250_MSECOND:
- PingResponsePoll(); // TODO
- break;
+ PingResponsePoll(); // TODO
+ break;
case FUNC_COMMAND:
- result = DecodeCommand(kPingCommands, PingCommand);
- break;
+ result = DecodeCommand(kPingCommands, PingCommand);
+ break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_39_thermostat.ino b/tasmota/tasmota_xdrv_driver/xdrv_39_thermostat.ino
index e4ea49af2..3e32ca7dc 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_39_thermostat.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_39_thermostat.ino
@@ -2204,6 +2204,10 @@ bool Xdrv39(uint32_t function)
case FUNC_COMMAND:
result = DecodeCommand(kThermostatCommands, ThermostatCommand);
break;
+
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_40_telegram.ino b/tasmota/tasmota_xdrv_driver/xdrv_40_telegram.ino
index a511cdf2d..fddd5eed3 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_40_telegram.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_40_telegram.ino
@@ -487,6 +487,9 @@ bool Xdrv40(uint32_t function)
case FUNC_COMMAND:
result = DecodeCommand(kTelegramCommands, TelegramCommand);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_41_tcp_bridge.ino b/tasmota/tasmota_xdrv_driver/xdrv_41_tcp_bridge.ino
index 811bbb7ce..55ada143a 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_41_tcp_bridge.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_41_tcp_bridge.ino
@@ -290,6 +290,9 @@ bool Xdrv41(uint32_t function)
case FUNC_COMMAND:
result = DecodeCommand(kTCPCommands, TCPCommand);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_42_0_i2s_audio.ino b/tasmota/tasmota_xdrv_driver/xdrv_42_0_i2s_audio.ino
index 616465717..c49798fa1 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_42_0_i2s_audio.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_42_0_i2s_audio.ino
@@ -760,6 +760,10 @@ bool Xdrv42(uint32_t function) {
I2S_WR_Show(true);
break;
#endif // USE_I2S_WEBRADIO
+
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_43_mlx90640.ino b/tasmota/tasmota_xdrv_driver/xdrv_43_mlx90640.ino
index d13dd4416..2d74780b8 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_43_mlx90640.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_43_mlx90640.ino
@@ -617,6 +617,9 @@ bool Xdrv43(uint32_t function)
case FUNC_COMMAND:
result = MLX90640Cmd();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino b/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino
index 6c2fd55d4..5b9f19054 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino
@@ -1336,6 +1336,10 @@ bool Xdrv44(uint32_t function) {
case FUNC_COMMAND:
result = DecodeCommand(miel_hvac_cmnd_names, miel_hvac_cmnds);
break;
+
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return (result);
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_45_shelly_dimmer.ino b/tasmota/tasmota_xdrv_driver/xdrv_45_shelly_dimmer.ino
index 42ba5df0b..2bd091488 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_45_shelly_dimmer.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_45_shelly_dimmer.ino
@@ -872,6 +872,9 @@ bool Xdrv45(uint32_t function) {
result = DecodeCommand(kShdCommands, ShdCommand);
break;
#endif // SHELLY_CMDS
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_46_ccloader.ino b/tasmota/tasmota_xdrv_driver/xdrv_46_ccloader.ino
index ab37d271a..a85275fa7 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_46_ccloader.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_46_ccloader.ino
@@ -689,6 +689,9 @@ bool Xdrv46(uint32_t function) {
CCLoadershow(0);
break;
#endif // USE_WEBSERVER
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_47_ftc532.ino b/tasmota/tasmota_xdrv_driver/xdrv_47_ftc532.ino
index 220ab6078..c7afd9682 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_47_ftc532.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_47_ftc532.ino
@@ -232,6 +232,9 @@ bool Xdrv47(uint32_t function) {
ftc532_show();
break;
}
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
// Return bool result
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_48_timeprop.ino b/tasmota/tasmota_xdrv_driver/xdrv_48_timeprop.ino
index d1fc6754a..035bf8869 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_48_timeprop.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_48_timeprop.ino
@@ -345,6 +345,9 @@ bool Xdrv48(uint32_t function) {
case FUNC_JSON_APPEND:
ShowValues();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_49_pid.ino b/tasmota/tasmota_xdrv_driver/xdrv_49_pid.ino
index 22d86dbf9..40077b306 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_49_pid.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_49_pid.ino
@@ -543,6 +543,9 @@ bool Xdrv49(uint32_t function) {
PIDShowValuesWeb();
break;
#endif // USE_WEBSERVER
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_50_filesystem.ino b/tasmota/tasmota_xdrv_driver/xdrv_50_filesystem.ino
index 58240cf2a..1a515bd47 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_50_filesystem.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_50_filesystem.ino
@@ -1398,6 +1398,9 @@ bool Xdrv50(uint32_t function) {
#endif
break;
#endif // USE_WEBSERVER
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_51_bs814a2.ino b/tasmota/tasmota_xdrv_driver/xdrv_51_bs814a2.ino
index 5199b3919..8cd89310d 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_51_bs814a2.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_51_bs814a2.ino
@@ -182,6 +182,9 @@ bool Xdrv51(uint32_t function) {
case FUNC_JSON_APPEND:
bs814_show();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
// Return bool result
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino
index 38bbf9aa6..70db00be5 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino
@@ -969,6 +969,9 @@ bool Xdrv52(uint32_t function)
callBerryEventDispatcher(PSTR("button_pressed"), nullptr, 0, nullptr);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_53_projector_ctrl.ino b/tasmota/tasmota_xdrv_driver/xdrv_53_projector_ctrl.ino
index 999f6a738..801a1ab00 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_53_projector_ctrl.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_53_projector_ctrl.ino
@@ -473,6 +473,10 @@ bool Xdrv53(uint32_t function) {
result = projector_ctrl_set_power(sc);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
+
}
return (result);
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_54_lvgl.ino b/tasmota/tasmota_xdrv_driver/xdrv_54_lvgl.ino
index 58293139b..9540bf562 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_54_lvgl.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_54_lvgl.ino
@@ -471,6 +471,10 @@ bool Xdrv54(uint32_t function)
case FUNC_BUTTON_PRESSED:
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
+
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_55_touch.ino b/tasmota/tasmota_xdrv_driver/xdrv_55_touch.ino
index 44eca227e..d7738e80a 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_55_touch.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_55_touch.ino
@@ -589,6 +589,9 @@ bool Xdrv55(uint32_t function) {
Touch_Check(TS_RotConvert);
}
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_56_rtc_chips.ino b/tasmota/tasmota_xdrv_driver/xdrv_56_rtc_chips.ino
index 1b4e4f598..eacd3a9d2 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_56_rtc_chips.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_56_rtc_chips.ino
@@ -518,6 +518,9 @@ bool Xdrv56(uint32_t function) {
case FUNC_JSON_APPEND:
if (RtcChip.ShowSensor) RtcChip.ShowSensor(1);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_57_9_tasmesh.ino b/tasmota/tasmota_xdrv_driver/xdrv_57_9_tasmesh.ino
index 6691017af..b6fc08630 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_57_9_tasmesh.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_57_9_tasmesh.ino
@@ -855,6 +855,9 @@ bool Xdrv57(uint32_t function) {
MESHdeInit();
break;
#endif // USE_DEEPSLEEP
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_58_range_extender.ino b/tasmota/tasmota_xdrv_driver/xdrv_58_range_extender.ino
index d72880649..73fb3daab 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_58_range_extender.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_58_range_extender.ino
@@ -524,6 +524,9 @@ bool Xdrv58(uint32_t function)
}
}
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_59_influxdb.ino b/tasmota/tasmota_xdrv_driver/xdrv_59_influxdb.ino
index d53330e25..c8c6122d9 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_59_influxdb.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_59_influxdb.ino
@@ -626,6 +626,9 @@ bool Xdrv59(uint32_t function) {
case FUNC_EVERY_SECOND:
InfluxDbLoop();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_60_shift595.ino b/tasmota/tasmota_xdrv_driver/xdrv_60_shift595.ino
index f477fc8ff..809ec86ac 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_60_shift595.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_60_shift595.ino
@@ -104,16 +104,19 @@ bool Xdrv60(uint32_t function) {
if (FUNC_PRE_INIT == function) {
Shift595Init();
- } else if (Shift595) {
- switch (function) {
- case FUNC_SET_POWER:
- Shift595SwitchRelay();
- break;
- case FUNC_COMMAND:
- result = DecodeCommand(kShift595Commands, Shift595Command);
- break;
- }
+ } else if (Shift595) {
+ switch (function) {
+ case FUNC_SET_POWER:
+ Shift595SwitchRelay();
+ break;
+ case FUNC_COMMAND:
+ result = DecodeCommand(kShift595Commands, Shift595Command);
+ break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
+ }
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_61_ds3502.ino b/tasmota/tasmota_xdrv_driver/xdrv_61_ds3502.ino
index 0b158bdef..537885495 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_61_ds3502.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_61_ds3502.ino
@@ -86,6 +86,9 @@ bool Xdrv61(uint32_t function) {
case FUNC_COMMAND:
result = DecodeCommand(kDS3502Commands, DS3502Command);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_62_improv.ino b/tasmota/tasmota_xdrv_driver/xdrv_62_improv.ino
index 4b3a15154..f68954b1a 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_62_improv.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_62_improv.ino
@@ -353,6 +353,9 @@ bool Xdrv62(uint32_t function) {
case FUNC_PRE_INIT:
ImprovInit();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_63_modbus_bridge.ino b/tasmota/tasmota_xdrv_driver/xdrv_63_modbus_bridge.ino
index c93be3cb5..c8f3fa109 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_63_modbus_bridge.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_63_modbus_bridge.ino
@@ -1169,6 +1169,9 @@ bool Xdrv63(uint32_t function)
case FUNC_COMMAND:
result = DecodeCommand(kModbusBridgeCommands, ModbusBridgeCommand);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_64_pca9632.ino b/tasmota/tasmota_xdrv_driver/xdrv_64_pca9632.ino
index 7c36c6ab3..591495010 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_64_pca9632.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_64_pca9632.ino
@@ -266,6 +266,9 @@ bool Xdrv64(uint32_t function) {
result = PCA9632_Command();
}
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_65_tuyamcubr.ino b/tasmota/tasmota_xdrv_driver/xdrv_65_tuyamcubr.ino
index d5d4b0ac8..caa1cefd3 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_65_tuyamcubr.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_65_tuyamcubr.ino
@@ -1110,6 +1110,10 @@ Xdrv65(uint32_t function)
case FUNC_COMMAND:
result = DecodeCommand(tuyamcubr_cmnd_names, tuyamcubr_cmnds);
break;
+
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return (result);
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_66_tm1638.ino b/tasmota/tasmota_xdrv_driver/xdrv_66_tm1638.ino
index e7d5f5a63..f93073411 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_66_tm1638.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_66_tm1638.ino
@@ -232,6 +232,9 @@ bool Xdrv66(uint32_t function) {
#endif
result = TmAddKey();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_67_mcp23xxx.ino b/tasmota/tasmota_xdrv_driver/xdrv_67_mcp23xxx.ino
index 1186bf5db..82aea1edb 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_67_mcp23xxx.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_67_mcp23xxx.ino
@@ -834,6 +834,9 @@ bool Xdrv67(uint32_t function) {
case FUNC_ADD_SWITCH:
result = MCP23xAddSwitch();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_68_zerocrossDimmer.ino b/tasmota/tasmota_xdrv_driver/xdrv_68_zerocrossDimmer.ino
index 49f6f9cfb..da7fc794e 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_68_zerocrossDimmer.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_68_zerocrossDimmer.ino
@@ -316,6 +316,9 @@ bool Xdrv68(uint32_t function)
break;
#endif // ZCDIMMERSET_SHOW
#endif // USE_WEBSERVER
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_69_pca9557.ino b/tasmota/tasmota_xdrv_driver/xdrv_69_pca9557.ino
index 190fb0e34..9ee9c1c87 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_69_pca9557.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_69_pca9557.ino
@@ -527,6 +527,9 @@ bool Xdrv69(uint32_t function) {
case FUNC_ADD_SWITCH:
result = PCA9557AddSwitch();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_70_1_hdmi_cec.ino b/tasmota/tasmota_xdrv_driver/xdrv_70_1_hdmi_cec.ino
index deb7c9776..981829691 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_70_1_hdmi_cec.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_70_1_hdmi_cec.ino
@@ -302,21 +302,21 @@ bool Xdrv70(uint32_t function)
{
bool result = false;
- switch (function) {
- case FUNC_INIT:
- HdmiCecInit();
- break;
- case FUNC_LOOP:
- case FUNC_SLEEP_LOOP:
- if (HDMI_CEC_device) {
+ if (FUNC_INIT == function) {
+ HdmiCecInit();
+ } else if (HDMI_CEC_device) {
+ switch (function) {
+ case FUNC_LOOP:
+ case FUNC_SLEEP_LOOP:
HDMI_CEC_device->run();
- }
- break;
- case FUNC_COMMAND:
- if (HDMI_CEC_device) {
+ break;
+ case FUNC_COMMAND:
result = DecodeCommand(kHDMICommands, HDMICommand);
- }
- break;
+ break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
+ }
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_79_esp32_ble.ino b/tasmota/tasmota_xdrv_driver/xdrv_79_esp32_ble.ino
index 6a2e01cc7..c907868e1 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_79_esp32_ble.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_79_esp32_ble.ino
@@ -3634,6 +3634,9 @@ bool Xdrv79(uint32_t function)
WebServer_on(PSTR("/" WEB_HANDLE_BLE), BLE_ESP32::HandleBleConfiguration);
break;
#endif // USE_WEBSERVER
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_81_esp32_webcam.ino b/tasmota/tasmota_xdrv_driver/xdrv_81_esp32_webcam.ino
index 541e2c55b..904e73c84 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_81_esp32_webcam.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_81_esp32_webcam.ino
@@ -1533,6 +1533,9 @@ bool Xdrv81(uint32_t function) {
case FUNC_INIT:
if(Wc.up == 0) WcSetup(Settings->webcam_config.resolution);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_81_esp32_webcam_task.ino b/tasmota/tasmota_xdrv_driver/xdrv_81_esp32_webcam_task.ino
index 2b0e637d8..77636cf8b 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_81_esp32_webcam_task.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_81_esp32_webcam_task.ino
@@ -3037,6 +3037,9 @@ bool Xdrv99(uint32_t function) {
AddLog(LOG_LEVEL_DEBUG, PSTR("CAM: FUNC_SAVE_BEFORE_RESTART after delay"));
#endif
} break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_82_esp32_ethernet.ino b/tasmota/tasmota_xdrv_driver/xdrv_82_esp32_ethernet.ino
index f484566fa..8ae9c8d6a 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_82_esp32_ethernet.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_82_esp32_ethernet.ino
@@ -384,6 +384,9 @@ bool Xdrv82(uint32_t function) {
case FUNC_INIT:
EthernetInit();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_83_esp32_watch.ino b/tasmota/tasmota_xdrv_driver/xdrv_83_esp32_watch.ino
index 939fab4d9..236db41f3 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_83_esp32_watch.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_83_esp32_watch.ino
@@ -458,6 +458,9 @@ bool Xdrv83(uint32_t function) {
case FUNC_LOOP:
TTGO_loop(1);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_85_esp32_ble_eq3_trv.ino b/tasmota/tasmota_xdrv_driver/xdrv_85_esp32_ble_eq3_trv.ino
index 3e170c2c3..87883192c 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_85_esp32_ble_eq3_trv.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_85_esp32_ble_eq3_trv.ino
@@ -1785,6 +1785,9 @@ bool Xdrv85(uint32_t function)
case FUNC_WEB_SENSOR:
break;
#endif // USE_WEBSERVER
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_86_esp32_sonoff_spm.ino b/tasmota/tasmota_xdrv_driver/xdrv_86_esp32_sonoff_spm.ino
index 03cc63bf6..882407f21 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_86_esp32_sonoff_spm.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_86_esp32_sonoff_spm.ino
@@ -2682,6 +2682,9 @@ bool Xdrv86(uint32_t function) {
case FUNC_BUTTON_PRESSED:
result = SSPMButton();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_87_esp32_sonoff_tm1621.ino b/tasmota/tasmota_xdrv_driver/xdrv_87_esp32_sonoff_tm1621.ino
index 642f32ce3..b9006c740 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_87_esp32_sonoff_tm1621.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_87_esp32_sonoff_tm1621.ino
@@ -600,6 +600,9 @@ bool Xdrv87(uint32_t function) {
case FUNC_COMMAND:
result = DecodeCommand(kTm1621Commands, kTm1621Command);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_88_esp32_shelly_pro.ino b/tasmota/tasmota_xdrv_driver/xdrv_88_esp32_shelly_pro.ino
index db7671733..20d0d01c7 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_88_esp32_shelly_pro.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_88_esp32_shelly_pro.ino
@@ -240,27 +240,30 @@ bool Xdrv88(uint32_t function) {
if (FUNC_PRE_INIT == function) {
ShellyProPreInit();
- } else if (SPro.detected) {
- switch (function) {
+ } else if (SPro.detected) {
+ switch (function) {
/*
- case FUNC_BUTTON_PRESSED:
- result = ShellyProButton();
- break;
+ case FUNC_BUTTON_PRESSED:
+ result = ShellyProButton();
+ break;
*/
- case FUNC_EVERY_SECOND:
- ShellyProLedLinkWifiOff();
- break;
- case FUNC_SET_POWER:
- ShellyProPower();
- break;
- case FUNC_INIT:
- ShellyProInit();
- break;
- case FUNC_LED_LINK:
- ShellyProLedLink();
- break;
- }
+ case FUNC_EVERY_SECOND:
+ ShellyProLedLinkWifiOff();
+ break;
+ case FUNC_SET_POWER:
+ ShellyProPower();
+ break;
+ case FUNC_INIT:
+ ShellyProInit();
+ break;
+ case FUNC_LED_LINK:
+ ShellyProLedLink();
+ break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
+ }
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_88_esp32_shelly_pro_v1.ino b/tasmota/tasmota_xdrv_driver/xdrv_88_esp32_shelly_pro_v1.ino
index 6af3d65b7..2c01a5a4a 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_88_esp32_shelly_pro_v1.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_88_esp32_shelly_pro_v1.ino
@@ -153,22 +153,25 @@ bool Xdrv88(uint32_t function) {
if (FUNC_PRE_INIT == function) {
ShellyProPreInit();
- } else if (SPro.detected) {
- switch (function) {
- case FUNC_EVERY_SECOND:
- ShellyProLedLinkWifiOff();
- break;
- case FUNC_SET_POWER:
- ShellyProPower();
- break;
- case FUNC_LED_LINK:
- ShellyProLedLink();
- break;
- case FUNC_INIT:
- ShellyProInit();
- break;
- }
+ } else if (SPro.detected) {
+ switch (function) {
+ case FUNC_EVERY_SECOND:
+ ShellyProLedLinkWifiOff();
+ break;
+ case FUNC_SET_POWER:
+ ShellyProPower();
+ break;
+ case FUNC_LED_LINK:
+ ShellyProLedLink();
+ break;
+ case FUNC_INIT:
+ ShellyProInit();
+ break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
+ }
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_88_esp32_shelly_pro_v2.ino b/tasmota/tasmota_xdrv_driver/xdrv_88_esp32_shelly_pro_v2.ino
index f7bea6ca5..06456b990 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_88_esp32_shelly_pro_v2.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_88_esp32_shelly_pro_v2.ino
@@ -486,33 +486,36 @@ bool Xdrv88(uint32_t function) {
if (FUNC_SETUP_RING2 == function) {
ShellyProPreInit();
- } else if (SPro.detected) {
- switch (function) {
+ } else if (SPro.detected) {
+ switch (function) {
/*
- case FUNC_BUTTON_PRESSED:
- result = ShellyProButton();
- break;
+ case FUNC_BUTTON_PRESSED:
+ result = ShellyProButton();
+ break;
*/
- case FUNC_EVERY_SECOND:
- ShellyProLedLinkWifiOff();
- break;
- case FUNC_SET_POWER:
- ShellyProPower();
- break;
- case FUNC_INIT:
- ShellyProInit();
- break;
- case FUNC_ADD_BUTTON:
- result = ShellyProAddButton();
- break;
- case FUNC_ADD_SWITCH:
- result = ShellyProAddSwitch();
- break;
- case FUNC_LED_LINK:
- ShellyProLedLink();
- break;
- }
+ case FUNC_EVERY_SECOND:
+ ShellyProLedLinkWifiOff();
+ break;
+ case FUNC_SET_POWER:
+ ShellyProPower();
+ break;
+ case FUNC_INIT:
+ ShellyProInit();
+ break;
+ case FUNC_ADD_BUTTON:
+ result = ShellyProAddButton();
+ break;
+ case FUNC_ADD_SWITCH:
+ result = ShellyProAddSwitch();
+ break;
+ case FUNC_LED_LINK:
+ ShellyProLedLink();
+ break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
+ }
return result;
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_89_esp32_dali.ino b/tasmota/tasmota_xdrv_driver/xdrv_89_esp32_dali.ino
index d1fbeee5c..5168d077f 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_89_esp32_dali.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_89_esp32_dali.ino
@@ -574,6 +574,9 @@ bool Xdrv89(uint32_t function)
case FUNC_COMMAND:
result = DaliCmd();
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_90_esp32_dingtian_relay.ino b/tasmota/tasmota_xdrv_driver/xdrv_90_esp32_dingtian_relay.ino
index c6dbd9193..d6d7da25a 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_90_esp32_dingtian_relay.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_90_esp32_dingtian_relay.ino
@@ -271,6 +271,9 @@ bool Xdrv90(uint32_t function) {
result = DingtianAddKey();
break;
#endif
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_91_magic_switch.ino b/tasmota/tasmota_xdrv_driver/xdrv_91_magic_switch.ino
index 5356ada69..c0c128bcd 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_91_magic_switch.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_91_magic_switch.ino
@@ -179,6 +179,9 @@ bool Xdrv91(uint32_t function) {
case FUNC_COMMAND:
result = DecodeCommand(kMagicSwitchCommands, MagicSwitchCommand);
break;
+ case FUNC_ACTIVE:
+ result = true;
+ break;
}
}
return result;
diff --git a/tasmota/tasmota_xx2c_global/xdrv_interface.ino b/tasmota/tasmota_xx2c_global/xdrv_interface.ino
index fda25f067..03ff1b2d9 100644
--- a/tasmota/tasmota_xx2c_global/xdrv_interface.ino
+++ b/tasmota/tasmota_xx2c_global/xdrv_interface.ino
@@ -1063,6 +1063,8 @@ const uint8_t kXdrvList[] = {
/*********************************************************************************************/
+uint32_t Xdrv_active[4] = { 0 };
+
void XsnsDriverState(void) {
ResponseAppend_P(PSTR(",\"Drivers\":\"")); // Use string for future enable/disable signal
for (uint32_t i = 0; i < sizeof(kXdrvList); i++) {
@@ -1071,7 +1073,7 @@ void XsnsDriverState(void) {
#else
uint32_t driverid = kXdrvList[i];
#endif
- ResponseAppend_P(PSTR("%s%d"), (i) ? "," : "", driverid);
+ ResponseAppend_P(PSTR("%s%s%d"), (i) ? "," : "", (!bitRead(Xdrv_active[i / 32], i % 32)) ? "!" : "", driverid);
}
ResponseAppend_P(PSTR("\""));
}
@@ -1133,11 +1135,15 @@ bool XdrvCall(uint32_t function) {
// DEBUG_TRACE_LOG(PSTR("DRV: %d"), function);
+#ifdef USE_PROFILE_FUNCTION
uint32_t profile_driver_start = millis();
+#endif // USE_PROFILE_FUNCTION
for (uint32_t x = 0; x < xdrv_present; x++) {
+#ifdef USE_PROFILE_FUNCTION
uint32_t profile_function_start = millis();
+#endif // USE_PROFILE_FUNCTION
result = xdrv_func_ptr[x](function);
@@ -1150,6 +1156,9 @@ bool XdrvCall(uint32_t function) {
PROFILE_FUNCTION("drv", index, function, profile_function_start);
#endif // USE_PROFILE_FUNCTION
+ if (FUNC_ACTIVE == function) {
+ bitWrite(Xdrv_active[x / 32], x % 32, result);
+ }
if (result && (function > FUNC_return_result)) {
break;
}
diff --git a/tasmota/tasmota_xx2c_global/xsns_interface.ino b/tasmota/tasmota_xx2c_global/xsns_interface.ino
index f78d5e9e2..2f020b92d 100644
--- a/tasmota/tasmota_xx2c_global/xsns_interface.ino
+++ b/tasmota/tasmota_xx2c_global/xsns_interface.ino
@@ -1116,13 +1116,17 @@ bool XsnsCall(uint32_t function) {
// DEBUG_TRACE_LOG(PSTR("SNS: %d"), function);
+#ifdef USE_PROFILE_FUNCTION
uint32_t profile_driver_start = millis();
+#endif // USE_PROFILE_FUNCTION
for (uint32_t x = 0; x < xsns_present; x++) {
if (XsnsEnabled(0, x)) { // Skip disabled sensor
if ((FUNC_WEB_SENSOR == function) && !XsnsEnabled(1, x)) { continue; } // Skip web info for disabled sensors
+#ifdef USE_PROFILE_FUNCTION
uint32_t profile_function_start = millis();
+#endif // USE_PROFILE_FUNCTION
result = xsns_func_ptr[x](function);
From 21de682f5898942c6f1122b3d23a4426fb0bab30 Mon Sep 17 00:00:00 2001
From: Jason2866 <24528715+Jason2866@users.noreply.github.com>
Date: Thu, 28 Dec 2023 13:48:27 +0100
Subject: [PATCH 054/303] Fix compile (#20329)
---
tasmota/tasmota_xdrv_driver/xdrv_47_ftc532.ino | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_47_ftc532.ino b/tasmota/tasmota_xdrv_driver/xdrv_47_ftc532.ino
index c7afd9682..b31e2fe94 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_47_ftc532.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_47_ftc532.ino
@@ -231,10 +231,10 @@ bool Xdrv47(uint32_t function) {
case FUNC_JSON_APPEND:
ftc532_show();
break;
- }
case FUNC_ACTIVE:
result = true;
break;
+ }
}
// Return bool result
return result;
From 67b36030dc028592bb49d52cbddaf2f90ac5beab Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Thu, 28 Dec 2023 17:00:35 +0100
Subject: [PATCH 055/303] Berry sync upstream #369 (#20330)
---
lib/libesp32/berry/CMakeLists.txt | 38 ++++++++++++++
lib/libesp32/berry/default/berry.c | 81 ++++++++++++++++++++++--------
lib/libesp32/berry/src/be_mem.c | 69 +++++++++++++------------
3 files changed, 135 insertions(+), 53 deletions(-)
create mode 100644 lib/libesp32/berry/CMakeLists.txt
diff --git a/lib/libesp32/berry/CMakeLists.txt b/lib/libesp32/berry/CMakeLists.txt
new file mode 100644
index 000000000..aba79bf1b
--- /dev/null
+++ b/lib/libesp32/berry/CMakeLists.txt
@@ -0,0 +1,38 @@
+cmake_minimum_required(VERSION 3.10)
+
+project(Berry C)
+set(CMAKE_C_STANDARD 99)
+
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+
+set(BERRY_COC ${CMAKE_CURRENT_SOURCE_DIR}/tools/coc/coc)
+set(BERRY_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
+set(BERRY_CONFIG_DIR default CACHE FILEPATH "The directory of berry_conf.h.")
+set(BERRY_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/${BERRY_CONFIG_DIR}/berry_conf.h)
+set(BERRY_GENERATE ${CMAKE_CURRENT_SOURCE_DIR}/generate)
+
+if (${CMAKE_HOST_WIN32})
+ set(BERRY_COC python ${BERRY_COC})
+endif ()
+
+file(MAKE_DIRECTORY generate)
+
+# berry library
+file(GLOB SOURCES src/*.c)
+add_library(libberry ${SOURCES})
+target_include_directories(libberry PUBLIC src ${BERRY_CONFIG_DIR})
+
+add_custom_target(berry-coc
+ COMMAND ${BERRY_COC} -o ${BERRY_GENERATE} ${BERRY_SOURCE_DIR} -c ${BERRY_CONFIG}
+ DEPENDS ${SOURCES} COMMAND_EXPAND_LISTS
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMENT "Generate coc objects"
+)
+add_dependencies(libberry berry-coc)
+
+# berry default exe
+file(GLOB SOURCES_EXE default/*.c)
+add_executable(berry ${SOURCES_EXE})
+target_link_libraries(berry PUBLIC libberry)
diff --git a/lib/libesp32/berry/default/berry.c b/lib/libesp32/berry/default/berry.c
index 8a63d8ea8..4ddf7b6f0 100644
--- a/lib/libesp32/berry/default/berry.c
+++ b/lib/libesp32/berry/default/berry.c
@@ -59,6 +59,13 @@
FULL_VERSION " (build in " __DATE__ ", " __TIME__ ")\n" \
"[" COMPILER "] on " OS_NAME " (default)\n" \
+#if defined(_WIN32)
+#define PATH_SEPARATOR ";"
+#else
+#define PATH_SEPARATOR ":"
+#endif
+
+
/* command help information */
#define help_information \
"Usage: berry [options] [script [args]]\n" \
@@ -66,6 +73,7 @@
" -i enter interactive mode after executing 'file'\n" \
" -l all variables in 'file' are parsed as local\n" \
" -e load 'script' source string and execute\n" \
+ " -m custom module search path(s) separated by '" PATH_SEPARATOR "'\n"\
" -c compile script 'file' to bytecode file\n" \
" -o save bytecode to 'file'\n" \
" -g force named globals in VM\n" \
@@ -87,6 +95,7 @@
#define arg_g (1 << 7)
#define arg_s (1 << 8)
#define arg_err (1 << 9)
+#define arg_m (1 << 10)
struct arg_opts {
int idx;
@@ -95,6 +104,7 @@ struct arg_opts {
const char *errarg;
const char *src;
const char *dst;
+ const char *modulepath;
};
/* check if the character is a letter */
@@ -257,6 +267,10 @@ static int parse_arg(struct arg_opts *opt, int argc, char *argv[])
case 'e': args |= arg_e; break;
case 'g': args |= arg_g; break;
case 's': args |= arg_s; break;
+ case 'm':
+ args |= arg_m;
+ opt->modulepath = opt->optarg;
+ break;
case '?': return args | arg_err;
case 'c':
args |= arg_c;
@@ -286,12 +300,47 @@ static void push_args(bvm *vm, int argc, char *argv[])
be_pop(vm, 1);
}
+#if defined(_WIN32)
+#define BERRY_ROOT "\\Windows\\system32"
+static const char *module_paths[] = {
+ BERRY_ROOT "\\berry\\packages",
+};
+#else
+#define BERRY_ROOT "/usr/local"
+static const char *module_paths[] = {
+ BERRY_ROOT "/lib/berry/packages",
+};
+#endif
+
+static void berry_paths(bvm * vm)
+{
+ size_t i;
+ for (i = 0; i < array_count(module_paths); ++i) {
+ be_module_path_set(vm, module_paths[i]);
+ }
+}
+
+static void berry_custom_paths(bvm *vm, const char *modulepath)
+{
+ const char delim[] = PATH_SEPARATOR;
+ char *copy = malloc(strlen(modulepath) + 1);
+ strcpy(copy, modulepath);
+ char *ptr = strtok(copy, delim);
+
+ while (ptr != NULL) {
+ be_module_path_set(vm, ptr);
+ ptr = strtok(NULL, delim);
+ }
+ free(copy);
+}
+
/*
* command format: berry [options] [script [args]]
* command options:
* -i: enter interactive mode after executing 'script'
* -b: load code from bytecode file
* -e: load 'script' source and execute
+ * -m: specify custom module search path(s)
* command format: berry options
* command options:
* -v: show version information
@@ -305,7 +354,7 @@ static int analysis_args(bvm *vm, int argc, char *argv[])
{
int args = 0;
struct arg_opts opt = { 0 };
- opt.pattern = "vhilegsc?o?";
+ opt.pattern = "m?vhilegsc?o?";
args = parse_arg(&opt, argc, argv);
argc -= opt.idx;
argv += opt.idx;
@@ -315,6 +364,16 @@ static int analysis_args(bvm *vm, int argc, char *argv[])
be_pop(vm, 1);
return -1;
}
+
+ if (args & arg_m) {
+ berry_custom_paths(vm, opt.modulepath);
+ args &= ~arg_m;
+ }
+ else {
+ // use default module paths
+ berry_paths(vm);
+ }
+
if (args & arg_g) {
comp_set_named_gbl(vm); /* forced named global in VM code */
args &= ~arg_g; /* clear the flag for this option not to interfere with other options */
@@ -339,31 +398,11 @@ static int analysis_args(bvm *vm, int argc, char *argv[])
return load_script(vm, argc, argv, args);
}
-#if defined(_WIN32)
-#define BERRY_ROOT "\\Windows\\system32"
-static const char *module_paths[] = {
- BERRY_ROOT "\\berry\\packages",
-};
-#else
-#define BERRY_ROOT "/usr/local"
-static const char *module_paths[] = {
- BERRY_ROOT "/lib/berry/packages",
-};
-#endif
-
-static void berry_paths(bvm * vm)
-{
- size_t i;
- for (i = 0; i < array_count(module_paths); ++i) {
- be_module_path_set(vm, module_paths[i]);
- }
-}
int main(int argc, char *argv[])
{
int res;
bvm *vm = be_vm_new(); /* create a virtual machine instance */
- berry_paths(vm);
res = analysis_args(vm, argc, argv);
be_vm_delete(vm); /* free all objects and vm */
return res;
diff --git a/lib/libesp32/berry/src/be_mem.c b/lib/libesp32/berry/src/be_mem.c
index 24b75ec18..9d20ca055 100644
--- a/lib/libesp32/berry/src/be_mem.c
+++ b/lib/libesp32/berry/src/be_mem.c
@@ -26,12 +26,43 @@
#define realloc BE_EXPLICIT_REALLOC
#endif
-static void* malloc_from_pool(bvm *vm, size_t size);
-static void free_from_pool(bvm *vm, void* ptr, size_t old_size);
-
#define POOL16_SIZE 16
#define POOL32_SIZE 32
+#ifdef _MSC_VER
+#include
+#pragma intrinsic(_BitScanForward)
+#endif
+
+#if defined(__GNUC__)
+#define popcount(v) __builtin_popcount(v)
+#define ffs(v) __builtin_ffs(v)
+#elif defined(_MSC_VER)
+#define popcount(v) __popcnt(v)
+
+static int ffs(unsigned x)
+{
+ unsigned long i;
+ return _BitScanForward(&i, x) ? i : 0;
+}
+#else
+/* https://github.com/hcs0/Hackers-Delight/blob/master/pop.c.txt - count number of 1-bits */
+static int popcount(uint32_t n)
+{
+ n = (n & 0x55555555u) + ((n >> 1) & 0x55555555u);
+ n = (n & 0x33333333u) + ((n >> 2) & 0x33333333u);
+ n = (n & 0x0f0f0f0fu) + ((n >> 4) & 0x0f0f0f0fu);
+ n = (n & 0x00ff00ffu) + ((n >> 8) & 0x00ff00ffu);
+ n = (n & 0x0000ffffu) + ((n >>16) & 0x0000ffffu);
+ return n;
+}
+
+#error "unsupport compiler for ffs()"
+#endif
+
+static void* malloc_from_pool(bvm *vm, size_t size);
+static void free_from_pool(bvm *vm, void* ptr, size_t old_size);
+
BERRY_API void* be_os_malloc(size_t size)
{
return malloc(size);
@@ -66,7 +97,7 @@ BERRY_API void* be_realloc(bvm *vm, void *ptr, size_t old_size, size_t new_size)
if (!ptr || (old_size == 0)) {
block = malloc_from_pool(vm, new_size);
}
-
+
/* Case 2: deallocate */
else if (new_size == 0) {
#if BE_USE_PERF_COUNTERS
@@ -176,11 +207,7 @@ static void* malloc_from_pool(bvm *vm, size_t size) {
/* look for an empty slot */
if (pool16->bitmap != 0x0000) {
/* there is a free slot */
-#ifdef __GNUC__
- int bit = __builtin_ffs(pool16->bitmap) - 1;
-#else
int bit = ffs(pool16->bitmap) - 1;
-#endif
if (bit >= 0) {
/* we found a free slot */
// bitClear(pool16->bitmap, bit);
@@ -208,11 +235,7 @@ static void* malloc_from_pool(bvm *vm, size_t size) {
/* look for an empty slot */
if (pool32->bitmap != 0x0000) {
/* there is a free slot */
-#ifdef __GNUC__
- int bit = __builtin_ffs(pool32->bitmap) - 1;
-#else
int bit = ffs(pool32->bitmap) - 1;
-#endif
if (bit >= 0) {
/* we found a free slot */
// bitClear(pool32->bitmap, bit);
@@ -327,24 +350,6 @@ BERRY_API void be_gc_free_memory_pools(bvm *vm) {
vm->gc.pool32 = NULL;
}
-/* https://github.com/hcs0/Hackers-Delight/blob/master/pop.c.txt - count number of 1-bits */
-static int pop0(uint32_t n) __attribute__((unused));
-static int pop0(uint32_t n) {
- n = (n & 0x55555555u) + ((n >> 1) & 0x55555555u);
- n = (n & 0x33333333u) + ((n >> 2) & 0x33333333u);
- n = (n & 0x0f0f0f0fu) + ((n >> 4) & 0x0f0f0f0fu);
- n = (n & 0x00ff00ffu) + ((n >> 8) & 0x00ff00ffu);
- n = (n & 0x0000ffffu) + ((n >>16) & 0x0000ffffu);
- return n;
-}
-
-#ifdef __GNUC__
- #define count_bits_1(v) __builtin_popcount(v)
-#else
- #define count_bits_1(v) pop0(v)
-#endif
-
-
BERRY_API void be_gc_memory_pools_info(bvm *vm, size_t* slots_used, size_t* slots_allocated) {
size_t used = 0;
size_t allocated = 0;
@@ -352,14 +357,14 @@ BERRY_API void be_gc_memory_pools_info(bvm *vm, size_t* slots_used, size_t* slot
gc16_t* pool16 = vm->gc.pool16;
while (pool16) {
allocated += POOL16_SLOTS;
- used += POOL16_SLOTS - count_bits_1(pool16->bitmap);
+ used += POOL16_SLOTS - popcount(pool16->bitmap);
pool16 = pool16->next;
}
gc32_t* pool32 = vm->gc.pool32;
while (pool32) {
allocated += POOL32_SLOTS;
- used += POOL32_SLOTS - count_bits_1(pool32->bitmap);
+ used += POOL32_SLOTS - popcount(pool32->bitmap);
pool32 = pool32->next;
}
if (slots_used) { *slots_used = used; }
From d5a4f8441bfc0b98d6b482b684cc542d5ed4969b Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Thu, 28 Dec 2023 17:25:01 +0100
Subject: [PATCH 056/303] Fix Berry claiming UART0 if needed (#20324)
---
CHANGELOG.md | 2 ++
RELEASENOTES.md | 2 ++
tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino | 6 ++++++
tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino | 3 +++
tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino | 3 +++
tasmota/tasmota_xdrv_driver/xdrv_18_armtronix_dimmers.ino | 3 +++
tasmota/tasmota_xdrv_driver/xdrv_19_ps16dz_dimmer.ino | 3 +++
tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_9_serial.ino | 3 +++
tasmota/tasmota_xdrv_driver/xdrv_30_exs_dimmer.ino | 3 +++
tasmota/tasmota_xdrv_driver/xdrv_41_tcp_bridge.ino | 2 +-
tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino | 3 +++
tasmota/tasmota_xdrv_driver/xdrv_45_shelly_dimmer.ino | 4 ++++
tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_serial.ino | 5 +++++
tasmota/tasmota_xdrv_driver/xdrv_53_projector_ctrl.ino | 3 +++
tasmota/tasmota_xdrv_driver/xdrv_63_modbus_bridge.ino | 3 +++
tasmota/tasmota_xdrv_driver/xdrv_65_tuyamcubr.ino | 4 ++++
tasmota/tasmota_xdrv_driver/xdrv_86_esp32_sonoff_spm.ino | 5 +++++
tasmota/tasmota_xnrg_energy/xnrg_02_cse7766.ino | 3 +++
tasmota/tasmota_xnrg_energy/xnrg_03_pzem004t.ino | 3 +++
tasmota/tasmota_xnrg_energy/xnrg_04_mcp39f501.ino | 3 +++
tasmota/tasmota_xnrg_energy/xnrg_12_solaxX1.ino | 3 +++
tasmota/tasmota_xnrg_energy/xnrg_14_bl09xx.ino | 3 +++
tasmota/tasmota_xnrg_energy/xnrg_19_cse7761.ino | 3 +++
tasmota/tasmota_xnrg_energy/xnrg_22_bl6523.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_102_ld2410.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_105_lox_o2.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_107_gm861.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_113_hc8.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_15_mhz19.ino | 4 +++-
tasmota/tasmota_xsns_sensor/xsns_18_pms5003.ino | 4 +++-
tasmota/tasmota_xsns_sensor/xsns_20_novasds.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_22_sr04.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_23_me007.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_38_az7798.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_40_pn532.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_51_rdm6300.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_52_ibeacon.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_56_hpma.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_60_GPS.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_62_MI_HM10.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_64_hrxl.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_76_dyp.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_79_as608.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_86_tfminiplus.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_90_hrg15.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_91_vindriktning.ino | 3 +++
tasmota/tasmota_xsns_sensor/xsns_95_cm110x.ino | 3 +++
47 files changed, 146 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 722216896..e726623d6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file.
- NeoPool hydrolysis FL1 and Redox flag (#20258)
- Matter support for password for remote Tasmota devices (#20296)
- Display of active drivers using command ``status 4``
+- ESP32 used UART information
### Breaking Changed
- Refactoring of Berry `animate` module for WS2812 Leds (#20236)
@@ -24,6 +25,7 @@ All notable changes to this project will be documented in this file.
- ESP32 piezo ceramic buzzer doesn't buzz (#20118)
- Syslog server warning caused by lack of field and hostname starting with 'z' (#14689)
- Support for Domoticz floor/room topics. Regression from v12.0.1 (#20299)
+- Berry claiming UART0 if needed (#20324)
### Removed
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 1dfa0a653..9fe82cdde 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -122,6 +122,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- Support for Sonoff Basic R4 Magic Switch [#20247](https://github.com/arendst/Tasmota/issues/20247)
- Display of active drivers using command ``status 4``
- NeoPool hydrolysis FL1 and Redox flag [#20258](https://github.com/arendst/Tasmota/issues/20258)
+- ESP32 used UART information
- Matter support for password for remote Tasmota devices [#20296](https://github.com/arendst/Tasmota/issues/20296)
### Breaking Changed
@@ -135,6 +136,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- Syslog server warning caused by lack of field and hostname starting with 'z' [#14689](https://github.com/arendst/Tasmota/issues/14689)
- Support for Domoticz floor/room topics. Regression from v12.0.1 [#20299](https://github.com/arendst/Tasmota/issues/20299)
- ESP32 piezo ceramic buzzer doesn't buzz [#20118](https://github.com/arendst/Tasmota/issues/20118)
+- Berry claiming UART0 if needed [#20324](https://github.com/arendst/Tasmota/issues/20324)
- Matter Contact sensor was not triggering any update [#20232](https://github.com/arendst/Tasmota/issues/20232)
### Removed
\ No newline at end of file
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino b/tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino
index 82582b5c5..e4855ee2e 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino
@@ -183,6 +183,12 @@ void MP3PlayerInit(void)
// start serial communication fixed to 9600 baud
if (MP3Player->begin(9600))
{
+#ifdef ESP32
+ if (MP3Player->hardwareSerial()) {
+ ClaimSerial(); // Disable console using uart0
+ }
+ AddLog(LOG_LEVEL_DEBUG, PSTR("MP3: Serial UART%d"), MP3Player->getUart());
+#endif // ESP32
MP3Player->flush();
delay(1000);
MP3_CMD(MP3_CMD_RESET, MP3_CMD_RESET_VALUE); // reset the player to defaults
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino
index cb7184922..9e8e4d462 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino
@@ -1248,6 +1248,9 @@ void TuyaInit(void) {
TuyaSerial = new TasmotaSerial(Pin(GPIO_TUYA_RX), Pin(GPIO_TUYA_TX), 2);
if (TuyaSerial->begin(baudrate)) {
if (TuyaSerial->hardwareSerial()) { ClaimSerial(); }
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("TYA: Serial UART%d"), TuyaSerial->getUart());
+#endif // ESP32
// Get MCU Configuration
Tuya.SuspendTopic = true;
Tuya.ignore_topic_timeout = millis() + 1000; // suppress /STAT topic for 1000ms to avoid data overflow
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino
index c9c0908e0..549e48be3 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino
@@ -2032,6 +2032,9 @@ void TuyaInit(void) {
TuyaSerial = new TasmotaSerial(Pin(GPIO_TUYA_RX), Pin(GPIO_TUYA_TX), 2);
if (TuyaSerial->begin(baudrate)) {
if (TuyaSerial->hardwareSerial()) { ClaimSerial(); }
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("TYA: Serial UART%d"), TuyaSerial->getUart());
+#endif // ESP32
// Get MCU Configuration
pTuya->SuspendTopic = true;
pTuya->ignore_topic_timeout = millis() + 1000; // suppress /STAT topic for 1000ms to avoid data overflow
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_18_armtronix_dimmers.ino b/tasmota/tasmota_xdrv_driver/xdrv_18_armtronix_dimmers.ino
index c512fdc3c..e67a0e542 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_18_armtronix_dimmers.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_18_armtronix_dimmers.ino
@@ -101,6 +101,9 @@ void ArmtronixInit(void)
if (ArmtronixSerial->begin(115200)) {
if (ArmtronixSerial->hardwareSerial()) { ClaimSerial(); }
ArmtronixSerial->println("Status");
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("ARM: Serial UART%d"), ArmtronixSerial->getUart());
+#endif // ESP32
}
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_19_ps16dz_dimmer.ino b/tasmota/tasmota_xdrv_driver/xdrv_19_ps16dz_dimmer.ino
index a7c513bd7..09d4715e9 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_19_ps16dz_dimmer.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_19_ps16dz_dimmer.ino
@@ -190,6 +190,9 @@ void PS16DZInit(void)
PS16DZSerial = new TasmotaSerial(Pin(GPIO_RXD), Pin(GPIO_TXD), 2);
if (PS16DZSerial->begin(19200)) {
if (PS16DZSerial->hardwareSerial()) { ClaimSerial(); }
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("PS1: Serial UART%d"), PS16DZSerial->getUart());
+#endif // ESP32
}
}
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_9_serial.ino b/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_9_serial.ino
index 05a049c8c..0f5249258 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_9_serial.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_9_serial.ino
@@ -303,6 +303,9 @@ void ZigbeeInitSerial(void)
if (ZigbeeSerial->hardwareSerial()) {
ClaimSerial();
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_ZIGBEE "Serial UART%d"), ZigbeeSerial->getUart());
+#endif // ESP32
zigbee_buffer = new SBuffer(ZIGBEE_BUFFER_SIZE);
zigbee.active = true;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_30_exs_dimmer.ino b/tasmota/tasmota_xdrv_driver/xdrv_30_exs_dimmer.ino
index fed86a93d..6b80805c6 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_30_exs_dimmer.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_30_exs_dimmer.ino
@@ -415,6 +415,9 @@ void ExsInit(void)
{
ClaimSerial();
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("EXS: Serial UART%d"), ExsSerial->getUart());
+#endif // ESP32
ExsSerial->flush();
EsxMcuStart();
ExsSendCmd(EXS_CH_LOCK, 0);
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_41_tcp_bridge.ino b/tasmota/tasmota_xdrv_driver/xdrv_41_tcp_bridge.ino
index 55ada143a..fdd4a2ad3 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_41_tcp_bridge.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_41_tcp_bridge.ino
@@ -156,7 +156,7 @@ void TCPInit(void) {
ClaimSerial();
}
#ifdef ESP32
- AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_TCP "using hardserial %d"), TCPSerial->getUart());
+ AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_TCP "Serial UART%d"), TCPSerial->getUart());
#endif
} else {
AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_TCP "failed init serial"));
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino b/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino
index 5b9f19054..36baa3749 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino
@@ -1084,6 +1084,9 @@ miel_hvac_pre_init(void)
ClaimSerial();
SetSerial(baudrate, TS_SERIAL_8E1);
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR(MIEL_HVAC_LOGNAME ": Serial UART%d"), sc->sc_serial->getUart());
+#endif
sc->sc_device = TasmotaGlobal.devices_present;
UpdateDevicesPresent(1); /* claim a POWER device slot */
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_45_shelly_dimmer.ino b/tasmota/tasmota_xdrv_driver/xdrv_45_shelly_dimmer.ino
index 2bd091488..560f2cfbe 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_45_shelly_dimmer.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_45_shelly_dimmer.ino
@@ -664,6 +664,10 @@ void ShdInit(void)
if (ShdSerial->hardwareSerial())
ClaimSerial();
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR(SHD_LOGNAME "Serial UART%d"), ShdSerial->getUart());
+#endif
+
ShdSerial->flush();
ShdResetToAppMode();
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_serial.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_serial.ino
index 5f20c8a8a..2ffe1dab6 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_serial.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_serial.ino
@@ -56,6 +56,11 @@ extern "C" {
if (!ok) {
delete ser;
be_raise(vm, "internal_error", "Unable to start serial");
+ } else {
+ if (ser->hardwareSerial()) {
+ ClaimSerial(); // Disable console using uart0
+ }
+ AddLog(LOG_LEVEL_DEBUG, PSTR("BRY: Serial UART%d"), ser->getUart());
}
be_pushcomptr(vm, (void*) ser);
be_setmember(vm, 1, ".p");
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_53_projector_ctrl.ino b/tasmota/tasmota_xdrv_driver/xdrv_53_projector_ctrl.ino
index 801a1ab00..0a4224d30 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_53_projector_ctrl.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_53_projector_ctrl.ino
@@ -122,6 +122,9 @@ projector_ctrl_pre_init(void)
ClaimSerial();
SetSerial(baudrate, TS_SERIAL_8N1);
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR(PROJECTOR_CTRL_LOGNAME ": Serial UART%d"), sc->sc_serial->getUart());
+#endif
UpdateDevicesPresent(1); /* claim a POWER device slot */
sc->sc_device = TasmotaGlobal.devices_present;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_63_modbus_bridge.ino b/tasmota/tasmota_xdrv_driver/xdrv_63_modbus_bridge.ino
index c8f3fa109..ed82cd0ff 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_63_modbus_bridge.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_63_modbus_bridge.ino
@@ -207,6 +207,9 @@ bool ModbusBridgeBegin(void) {
if (2 == result) {
ClaimSerial();
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("MBS: Serial UART%d"), modbusBridgeModbus->getUart());
+#endif
AddLog(LOG_LEVEL_DEBUG, PSTR("MBS: MBR %s ser init at %d baud"), (2 == result ? "HW" : "SW"), Settings->modbus_sbaudrate * 300);
if (nullptr == modbusBridge.buffer) {
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_65_tuyamcubr.ino b/tasmota/tasmota_xdrv_driver/xdrv_65_tuyamcubr.ino
index caa1cefd3..150930dab 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_65_tuyamcubr.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_65_tuyamcubr.ino
@@ -996,6 +996,10 @@ tuyamcubr_pre_init(void)
if (sc->sc_serial->hardwareSerial())
ClaimSerial();
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR(TUYAMCUBR_LOGNAME ": Serial UART%d"), sc->sc_serial->getUart());
+#endif
+
/* commit */
tuyamcubr_sc = sc;
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_86_esp32_sonoff_spm.ino b/tasmota/tasmota_xdrv_driver/xdrv_86_esp32_sonoff_spm.ino
index 882407f21..e9319da56 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_86_esp32_sonoff_spm.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_86_esp32_sonoff_spm.ino
@@ -1917,6 +1917,11 @@ void SSPMInit(void) {
return;
}
+ if (SspmSerial->hardwareSerial()) {
+ ClaimSerial();
+ }
+ AddLog(LOG_LEVEL_DEBUG, PSTR("SPM: Serial UART%d"), SspmSerial->getUart());
+
Xdrv86SettingsLoad(0);
pinMode(SSPM_GPIO_ARM_RESET, OUTPUT);
diff --git a/tasmota/tasmota_xnrg_energy/xnrg_02_cse7766.ino b/tasmota/tasmota_xnrg_energy/xnrg_02_cse7766.ino
index 9ca4c5ce8..6e33897dd 100644
--- a/tasmota/tasmota_xnrg_energy/xnrg_02_cse7766.ino
+++ b/tasmota/tasmota_xnrg_energy/xnrg_02_cse7766.ino
@@ -232,6 +232,9 @@ void CseSnsInit(void) {
SetSerial(4800, TS_SERIAL_8E1);
ClaimSerial();
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("CSE: Serial UART%d"), CseSerial->getUart());
+#endif
if (0 == Settings->param[P_CSE7766_INVALID_POWER]) {
Settings->param[P_CSE7766_INVALID_POWER] = CSE_MAX_INVALID_POWER; // SetOption39 1..255
}
diff --git a/tasmota/tasmota_xnrg_energy/xnrg_03_pzem004t.ino b/tasmota/tasmota_xnrg_energy/xnrg_03_pzem004t.ino
index a965dbb6d..a275483c5 100644
--- a/tasmota/tasmota_xnrg_energy/xnrg_03_pzem004t.ino
+++ b/tasmota/tasmota_xnrg_energy/xnrg_03_pzem004t.ino
@@ -246,6 +246,9 @@ void PzemSnsInit(void)
if (PzemSerial->hardwareSerial()) {
ClaimSerial();
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("PZM: Serial UART%d"), PzemSerial->getUart());
+#endif
Energy->phase_count = ENERGY_MAX_PHASES; // Start off with three phases
Pzem.phase = 0;
Pzem.read_state = 1;
diff --git a/tasmota/tasmota_xnrg_energy/xnrg_04_mcp39f501.ino b/tasmota/tasmota_xnrg_energy/xnrg_04_mcp39f501.ino
index 9cd8c4a52..1c4695b4d 100644
--- a/tasmota/tasmota_xnrg_energy/xnrg_04_mcp39f501.ino
+++ b/tasmota/tasmota_xnrg_energy/xnrg_04_mcp39f501.ino
@@ -572,6 +572,9 @@ void McpSnsInit(void)
} else {
mcp_buffer = (char*)(malloc(MCP_BUFFER_SIZE));
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("MCP: Serial UART%d"), McpSerial->getUart());
+#endif
DigitalWrite(GPIO_MCP39F5_RST, 0, 1); // MCP enable
Energy->use_overtemp = true; // Use global temperature for overtemp detection
} else {
diff --git a/tasmota/tasmota_xnrg_energy/xnrg_12_solaxX1.ino b/tasmota/tasmota_xnrg_energy/xnrg_12_solaxX1.ino
index a087295b9..5945cf1f6 100644
--- a/tasmota/tasmota_xnrg_energy/xnrg_12_solaxX1.ino
+++ b/tasmota/tasmota_xnrg_energy/xnrg_12_solaxX1.ino
@@ -470,6 +470,9 @@ void solaxX1_SnsInit(void)
solaxX1Serial = new TasmotaSerial(Pin(GPIO_SOLAXX1_RX), Pin(GPIO_SOLAXX1_TX), 1);
if (solaxX1Serial->begin(SOLAXX1_SPEED)) {
if (solaxX1Serial->hardwareSerial()) { ClaimSerial(); }
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("SX1: Serial UART%d"), solaxX1Serial->getUart());
+#endif
} else {
TasmotaGlobal.energy_driver = ENERGY_NONE;
}
diff --git a/tasmota/tasmota_xnrg_energy/xnrg_14_bl09xx.ino b/tasmota/tasmota_xnrg_energy/xnrg_14_bl09xx.ino
index 343210e71..af1f0f6fc 100644
--- a/tasmota/tasmota_xnrg_energy/xnrg_14_bl09xx.ino
+++ b/tasmota/tasmota_xnrg_energy/xnrg_14_bl09xx.ino
@@ -307,6 +307,9 @@ void Bl09XXInit(void) {
if (Bl09XXSerial->hardwareSerial()) {
ClaimSerial();
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("BL9: Serial UART%d"), Bl09XXSerial->getUart());
+#endif
if (HLW_UREF_PULSE == EnergyGetCalibration(ENERGY_VOLTAGE_CALIBRATION)) {
for (uint32_t i = 0; i < 2; i++) {
EnergySetCalibration(ENERGY_POWER_CALIBRATION, bl09xx_pref[Bl09XX.model], i);
diff --git a/tasmota/tasmota_xnrg_energy/xnrg_19_cse7761.ino b/tasmota/tasmota_xnrg_energy/xnrg_19_cse7761.ino
index b176065df..09a454201 100644
--- a/tasmota/tasmota_xnrg_energy/xnrg_19_cse7761.ino
+++ b/tasmota/tasmota_xnrg_energy/xnrg_19_cse7761.ino
@@ -583,6 +583,9 @@ void Cse7761SnsInit(void) {
SetSerial(38400, TS_SERIAL_8E1);
ClaimSerial();
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("C61: Serial UART%d"), Cse7761Serial->getUart());
+#endif
#ifdef CSE7761_FREQUENCY
#ifdef CSE7761_ZEROCROSS
diff --git a/tasmota/tasmota_xnrg_energy/xnrg_22_bl6523.ino b/tasmota/tasmota_xnrg_energy/xnrg_22_bl6523.ino
index 6df796461..b0b5d442a 100644
--- a/tasmota/tasmota_xnrg_energy/xnrg_22_bl6523.ino
+++ b/tasmota/tasmota_xnrg_energy/xnrg_22_bl6523.ino
@@ -238,6 +238,9 @@ void Bl6523Init(void)
{
ClaimSerial();
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("BL6: Serial UART%d and UART%d"), Bl6523RxSerial->getUart(), Bl6523TxSerial->getUart());
+#endif
Bl6523.type = 1;
Energy->phase_count = 1;
AddLog(LOG_LEVEL_DEBUG, PSTR("BL6:Init Success" ));
diff --git a/tasmota/tasmota_xsns_sensor/xsns_102_ld2410.ino b/tasmota/tasmota_xsns_sensor/xsns_102_ld2410.ino
index b21a9b03a..3914179cd 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_102_ld2410.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_102_ld2410.ino
@@ -407,6 +407,9 @@ void Ld2410Detect(void) {
LD2410Serial = new TasmotaSerial(Pin(GPIO_LD2410_RX), Pin(GPIO_LD2410_TX), 2);
if (LD2410Serial->begin(256000)) {
if (LD2410Serial->hardwareSerial()) { ClaimSerial(); }
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("LD2: Serial UART%d"), LD2410Serial->getUart());
+#endif
LD2410.retry = 4;
LD2410.step = 12;
diff --git a/tasmota/tasmota_xsns_sensor/xsns_105_lox_o2.ino b/tasmota/tasmota_xsns_sensor/xsns_105_lox_o2.ino
index a644e964f..f006498b5 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_105_lox_o2.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_105_lox_o2.ino
@@ -65,6 +65,9 @@ void LOXInit()
if (LOXSerial->hardwareSerial())
ClaimSerial();
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("LOX: Serial UART%d"), LOXSerial->getUart());
+#endif
}
}
diff --git a/tasmota/tasmota_xsns_sensor/xsns_107_gm861.ino b/tasmota/tasmota_xsns_sensor/xsns_107_gm861.ino
index c54019c09..6d79911ac 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_107_gm861.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_107_gm861.ino
@@ -265,6 +265,9 @@ void Gm861Init(void) {
if (Gm861Serial->hardwareSerial()) {
ClaimSerial();
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("GM8: Serial UART%d"), Gm861Serial->getUart());
+#endif
Gm861->barcode[0] = '0'; // No barcode yet
Gm861->state = GM861_STATE_INIT_OFFSET;
}
diff --git a/tasmota/tasmota_xsns_sensor/xsns_113_hc8.ino b/tasmota/tasmota_xsns_sensor/xsns_113_hc8.ino
index 79845e837..bc1abae22 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_113_hc8.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_113_hc8.ino
@@ -86,6 +86,9 @@ void Hc8Init(void)
Hc8Serial = new TasmotaSerial(Pin(GPIO_HC8_RXD), -1, 1);
if (Hc8Serial->begin(9600)) {
if (Hc8Serial->hardwareSerial()) { ClaimSerial(); }
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("HC8: Serial UART%d"), Hc8Serial->getUart());
+#endif
Hc8Initialized = true;
}
}
diff --git a/tasmota/tasmota_xsns_sensor/xsns_15_mhz19.ino b/tasmota/tasmota_xsns_sensor/xsns_15_mhz19.ino
index 3d89ff470..e1c21fffc 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_15_mhz19.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_15_mhz19.ino
@@ -329,9 +329,11 @@ void MhzInit(void)
MhzSerial = new TasmotaSerial(Pin(GPIO_MHZ_RXD), Pin(GPIO_MHZ_TXD), 1);
if (MhzSerial->begin(9600)) {
if (MhzSerial->hardwareSerial()) { ClaimSerial(); }
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("MHZ: Serial UART%d"), MhzSerial->getUart());
+#endif
mhz_type = 1;
}
-
}
}
diff --git a/tasmota/tasmota_xsns_sensor/xsns_18_pms5003.ino b/tasmota/tasmota_xsns_sensor/xsns_18_pms5003.ino
index 426b6e286..a5f9e0ced 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_18_pms5003.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_18_pms5003.ino
@@ -332,6 +332,9 @@ void PmsInit(void) {
PmsSerial = new TasmotaSerial(Pin(GPIO_PMS5003_RX), (PinUsed(GPIO_PMS5003_TX)) ? Pin(GPIO_PMS5003_TX) : -1, 1);
if (PmsSerial->begin(9600)) {
if (PmsSerial->hardwareSerial()) { ClaimSerial(); }
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("PMS: Serial UART%d"), PmsSerial->getUart());
+#endif
if (!PinUsed(GPIO_PMS5003_TX)) { // setting interval not supported if TX pin not connected
Settings->pms_wake_interval = 0;
@@ -345,7 +348,6 @@ void PmsInit(void) {
Pms.time = Settings->pms_wake_interval - WARMUP_PERIOD; // Let it wake up in the next second
}
}
-
Pms.type = 1;
}
}
diff --git a/tasmota/tasmota_xsns_sensor/xsns_20_novasds.ino b/tasmota/tasmota_xsns_sensor/xsns_20_novasds.ino
index 20f6d8e30..417aa699d 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_20_novasds.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_20_novasds.ino
@@ -208,6 +208,9 @@ void NovaSdsInit(void)
if (NovaSdsSerial->hardwareSerial()) {
ClaimSerial();
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("SDS: Serial UART%d"), NovaSdsSerial->getUart());
+#endif
novasds_type = 1;
NovaSdsSetWorkPeriod();
}
diff --git a/tasmota/tasmota_xsns_sensor/xsns_22_sr04.ino b/tasmota/tasmota_xsns_sensor/xsns_22_sr04.ino
index 4a4e28e17..21bd425da 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_22_sr04.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_22_sr04.ino
@@ -146,6 +146,9 @@ void Sr04TModeDetect(void) {
if (sonar_serial->hardwareSerial()) {
ClaimSerial();
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("SR4: Serial UART%d"), sonar_serial->getUart());
+#endif
}
}
diff --git a/tasmota/tasmota_xsns_sensor/xsns_23_me007.ino b/tasmota/tasmota_xsns_sensor/xsns_23_me007.ino
index ebef6edd3..1332d7ae9 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_23_me007.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_23_me007.ino
@@ -211,6 +211,9 @@ void me007_init( void )
{
ClaimSerial();
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR(ME007_DEBUG_MSG_TAG "Serial UART%d"), gp_serial_if->getUart());
+#endif
pinMode( me007_data_s.pin_trig_u8, OUTPUT ); /**< @details Configure trigger pin as output */
digitalWrite( me007_data_s.pin_trig_u8, HIGH ); /**< @details Set trigger pin to high-level as it ME007 requires a falling edge to initiate measurement */
diff --git a/tasmota/tasmota_xsns_sensor/xsns_38_az7798.ino b/tasmota/tasmota_xsns_sensor/xsns_38_az7798.ino
index 1869ed76f..b456f8dd2 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_38_az7798.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_38_az7798.ino
@@ -271,6 +271,9 @@ void AzInit(void)
AzSerial = new TasmotaSerial(Pin(GPIO_AZ_RXD), Pin(GPIO_AZ_TXD), 1);
if (AzSerial->begin(9600)) {
if (AzSerial->hardwareSerial()) { ClaimSerial(); }
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("AZ7: Serial UART%d"), AzSerial->getUart());
+#endif
az_type = 1;
}
}
diff --git a/tasmota/tasmota_xsns_sensor/xsns_40_pn532.ino b/tasmota/tasmota_xsns_sensor/xsns_40_pn532.ino
index dee669dd5..716178358 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_40_pn532.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_40_pn532.ino
@@ -97,6 +97,9 @@ void PN532_Init(void) {
PN532_Serial = new TasmotaSerial(Pin(GPIO_PN532_RXD), Pin(GPIO_PN532_TXD), 1);
if (PN532_Serial->begin(115200)) {
if (PN532_Serial->hardwareSerial()) { ClaimSerial(); }
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("NFC: Serial UART%d"), PN532_Serial->getUart());
+#endif
PN532_wakeup();
uint32_t ver = PN532_getFirmwareVersion();
if (ver) {
diff --git a/tasmota/tasmota_xsns_sensor/xsns_51_rdm6300.ino b/tasmota/tasmota_xsns_sensor/xsns_51_rdm6300.ino
index 5a929524d..c4ca3a7ca 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_51_rdm6300.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_51_rdm6300.ino
@@ -70,6 +70,9 @@ void RDM6300Init() {
if (RDM6300Serial->hardwareSerial()) {
ClaimSerial();
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("RDM: Serial UART%d"), RDM6300Serial->getUart());
+#endif
}
}
}
diff --git a/tasmota/tasmota_xsns_sensor/xsns_52_ibeacon.ino b/tasmota/tasmota_xsns_sensor/xsns_52_ibeacon.ino
index 411e82e21..96420a010 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_52_ibeacon.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_52_ibeacon.ino
@@ -326,6 +326,9 @@ void IBEACON_Init() {
if (IBEACON_Serial->hardwareSerial()) {
ClaimSerial();
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("BLE: Serial UART%d"), IBEACON_Serial->getUart());
+#endif
hm17_sendcmd(HM17_TEST);
hm17_lastms=millis();
// in case of using Settings this has to be moved
diff --git a/tasmota/tasmota_xsns_sensor/xsns_56_hpma.ino b/tasmota/tasmota_xsns_sensor/xsns_56_hpma.ino
index a318150d7..358b8febd 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_56_hpma.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_56_hpma.ino
@@ -71,6 +71,9 @@ void HpmaInit(void)
if (HpmaSerial->hardwareSerial()) {
ClaimSerial();
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("HPM: Serial UART%d"), HpmaSerial->getUart());
+#endif
hpma_type = 1;
hpma115S0->Init();
hpma115S0->StartParticleMeasurement();
diff --git a/tasmota/tasmota_xsns_sensor/xsns_60_GPS.ino b/tasmota/tasmota_xsns_sensor/xsns_60_GPS.ino
index fc53bd920..d37e4cf0c 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_60_GPS.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_60_GPS.ino
@@ -383,6 +383,9 @@ void UBXDetect(void)
ClaimSerial();
DEBUG_SENSOR_LOG(PSTR("UBX: claim HW"));
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("UBX: Serial UART%d"), UBXSerial->getUart());
+#endif
}
}
else {
diff --git a/tasmota/tasmota_xsns_sensor/xsns_62_MI_HM10.ino b/tasmota/tasmota_xsns_sensor/xsns_62_MI_HM10.ino
index b9334cf96..80609ff73 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_62_MI_HM10.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_62_MI_HM10.ino
@@ -698,6 +698,9 @@ void HM10SerialInit(void) {
ClaimSerial();
DEBUG_SENSOR_LOG(PSTR("%s: claim HW"),D_CMND_HM10);
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("HM1: Serial UART%d"), HM10Serial->getUart());
+#endif
HM10_Reset();
HM10.mode.pending_task = 1;
HM10.mode.init = 1;
diff --git a/tasmota/tasmota_xsns_sensor/xsns_64_hrxl.ino b/tasmota/tasmota_xsns_sensor/xsns_64_hrxl.ino
index 727778fe1..22c40487a 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_64_hrxl.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_64_hrxl.ino
@@ -43,6 +43,9 @@ void HRXLInit(void) {
if (HRXLSerial->hardwareSerial()) {
ClaimSerial();
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("HRX: Serial UART%d"), HRXLSerial->getUart());
+#endif
HRXLSerial->setTimeout(HRXL_READ_TIMEOUT);
}
}
diff --git a/tasmota/tasmota_xsns_sensor/xsns_76_dyp.ino b/tasmota/tasmota_xsns_sensor/xsns_76_dyp.ino
index 9aa3ecaa2..203de7b56 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_76_dyp.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_76_dyp.ino
@@ -52,6 +52,9 @@ void DYPInit(void) {
if (DYPSerial->hardwareSerial()) {
ClaimSerial();
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("DYP: Serial UART%d"), DYPSerial->getUart());
+#endif
}
}
}
diff --git a/tasmota/tasmota_xsns_sensor/xsns_79_as608.ino b/tasmota/tasmota_xsns_sensor/xsns_79_as608.ino
index b2059a90d..7850ecb0c 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_79_as608.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_79_as608.ino
@@ -116,6 +116,9 @@ void As608Init(void) {
As608Finger->begin(57600);
if (As608Serial->hardwareSerial()) { ClaimSerial(); }
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("AS6: Serial UART%d"), As608Serial->getUart());
+#endif
if (As608Finger->verifyPassword()) {
As608Finger->getTemplateCount();
diff --git a/tasmota/tasmota_xsns_sensor/xsns_86_tfminiplus.ino b/tasmota/tasmota_xsns_sensor/xsns_86_tfminiplus.ino
index 02cce9e27..ebfcdd551 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_86_tfminiplus.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_86_tfminiplus.ino
@@ -97,6 +97,9 @@ void TfmpInit(void)
{
ClaimSerial();
}
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("TFM: Serial UART%d"), TfmpSerial->getUart());
+#endif
tfminiplus_sensor.ready = true;
TfmpSerial->flush();
}
diff --git a/tasmota/tasmota_xsns_sensor/xsns_90_hrg15.ino b/tasmota/tasmota_xsns_sensor/xsns_90_hrg15.ino
index c83d92238..0f2f45244 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_90_hrg15.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_90_hrg15.ino
@@ -159,6 +159,9 @@ void Rg15Init(void) {
if (HydreonSerial) {
if (HydreonSerial->begin(RG15_BAUDRATE)) {
if (HydreonSerial->hardwareSerial()) { ClaimSerial(); }
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("HRG: Serial UART%d"), HydreonSerial->getUart());
+#endif
Rg15.init_step = 5; // Perform RG-15 init
}
}
diff --git a/tasmota/tasmota_xsns_sensor/xsns_91_vindriktning.ino b/tasmota/tasmota_xsns_sensor/xsns_91_vindriktning.ino
index 2f866bf9c..f98605294 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_91_vindriktning.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_91_vindriktning.ino
@@ -114,6 +114,9 @@ void VindriktningInit(void) {
VindriktningSerial = new TasmotaSerial(Pin(GPIO_VINDRIKTNING_RX), -1, 1);
if (VindriktningSerial->begin(9600)) {
if (VindriktningSerial->hardwareSerial()) { ClaimSerial(); }
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("VDN: Serial UART%d"), VindriktningSerial->getUart());
+#endif
Vindriktning.type = 1;
}
}
diff --git a/tasmota/tasmota_xsns_sensor/xsns_95_cm110x.ino b/tasmota/tasmota_xsns_sensor/xsns_95_cm110x.ino
index c71a91093..aa0b22697 100644
--- a/tasmota/tasmota_xsns_sensor/xsns_95_cm110x.ino
+++ b/tasmota/tasmota_xsns_sensor/xsns_95_cm110x.ino
@@ -394,6 +394,9 @@ void CM11Init(void)
CM11Serial = new TasmotaSerial(Pin(GPIO_CM11_RXD), Pin(GPIO_CM11_TXD), 1);
if (CM11Serial->begin(9600)) {
if (CM11Serial->hardwareSerial()) { ClaimSerial(); }
+#ifdef ESP32
+ AddLog(LOG_LEVEL_DEBUG, PSTR("CM1: Serial UART%d"), CM11Serial->getUart());
+#endif
cm11_type = 1;
CM11SendCmd(CM11_CMND_SW_VERSION);
}
From 6d94d9e766ced73135154a681114ad8d49cff308 Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Thu, 28 Dec 2023 17:53:21 +0100
Subject: [PATCH 057/303] Cleanup
---
tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino | 4 ++--
tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino | 4 +---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino b/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino
index c3d432808..fdce70e4a 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino
@@ -198,11 +198,11 @@ void SerialBridgeInit(void) {
} else {
serial_bridge_buffer = (char*)(malloc(SERIAL_BRIDGE_BUFSIZE));
}
- SerialBridgeSerial->flush();
- SerialBridgePrintf("\r\n");
#ifdef ESP32
AddLog(LOG_LEVEL_DEBUG, PSTR("SBR: Serial UART%d"), SerialBridgeSerial->getUart());
#endif
+ SerialBridgeSerial->flush();
+ SerialBridgePrintf("\r\n");
}
}
}
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino b/tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino
index e4855ee2e..58daa63ed 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino
@@ -183,10 +183,8 @@ void MP3PlayerInit(void)
// start serial communication fixed to 9600 baud
if (MP3Player->begin(9600))
{
+ if (MP3Player->hardwareSerial()) { ClaimSerial(); }
#ifdef ESP32
- if (MP3Player->hardwareSerial()) {
- ClaimSerial(); // Disable console using uart0
- }
AddLog(LOG_LEVEL_DEBUG, PSTR("MP3: Serial UART%d"), MP3Player->getUart());
#endif // ESP32
MP3Player->flush();
From 1f662a6dad8fd14a5dbf17b308f1306c85aecc0a Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Thu, 28 Dec 2023 22:19:58 +0100
Subject: [PATCH 058/303] HASPmota added `haspmota.page_show()` to change page
(#20333)
---
CHANGELOG.md | 1 +
.../berry_tasmota/src/be_lv_haspmota.c | 1261 +++++++++--------
.../haspmota_src/haspmota_core/haspmota.be | 13 +-
3 files changed, 656 insertions(+), 619 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e726623d6..759b427a3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
- Matter support for password for remote Tasmota devices (#20296)
- Display of active drivers using command ``status 4``
- ESP32 used UART information
+- HASPmota added `haspmota.page_show()` to change page
### Breaking Changed
- Refactoring of Berry `animate` module for WS2812 Leds (#20236)
diff --git a/lib/libesp32/berry_tasmota/src/be_lv_haspmota.c b/lib/libesp32/berry_tasmota/src/be_lv_haspmota.c
index bf20a03e5..70f239d36 100644
--- a/lib/libesp32/berry_tasmota/src/be_lv_haspmota.c
+++ b/lib/libesp32/berry_tasmota/src/be_lv_haspmota.c
@@ -6335,12 +6335,115 @@ void be_load_lvh_qrcode_class(bvm *vm) {
extern const bclass be_class_HASPmota;
+/********************************************************************
+** Solidified function: page_show
+********************************************************************/
+be_local_closure(HASPmota_page_show, /* name */
+ be_nested_proto(
+ 8, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[11]) { /* constants */
+ /* K0 */ be_nested_str_weak(lvh_pages),
+ /* K1 */ be_nested_str_weak(lvh_page_cur_idx),
+ /* K2 */ be_nested_str_weak(pages_list_sorted),
+ /* K3 */ be_const_int(1),
+ /* K4 */ be_nested_str_weak(prev),
+ /* K5 */ be_nested_str_weak(next),
+ /* K6 */ be_nested_str_weak(back),
+ /* K7 */ be_nested_str_weak(re_page_target),
+ /* K8 */ be_nested_str_weak(match),
+ /* K9 */ be_const_int(0),
+ /* K10 */ be_nested_str_weak(show),
+ }),
+ be_str_weak(page_show),
+ &be_const_str_solidified,
+ ( &(const binstruction[68]) { /* code */
+ 0x4C080000, // 0000 LDNIL R2
+ 0x880C0100, // 0001 GETMBR R3 R0 K0
+ 0x88100101, // 0002 GETMBR R4 R0 K1
+ 0x940C0604, // 0003 GETIDX R3 R3 R4
+ 0x8C100102, // 0004 GETMET R4 R0 K2
+ 0x88180101, // 0005 GETMBR R6 R0 K1
+ 0x7C100400, // 0006 CALL R4 2
+ 0x6014000C, // 0007 GETGBL R5 G12
+ 0x5C180800, // 0008 MOVE R6 R4
+ 0x7C140200, // 0009 CALL R5 1
+ 0x18140B03, // 000A LE R5 R5 K3
+ 0x78160000, // 000B JMPF R5 #000D
+ 0x80000A00, // 000C RET 0
+ 0x1C140304, // 000D EQ R5 R1 K4
+ 0x78160009, // 000E JMPF R5 #0019
+ 0x60140009, // 000F GETGBL R5 G9
+ 0x88180704, // 0010 GETMBR R6 R3 K4
+ 0x7C140200, // 0011 CALL R5 1
+ 0x5C080A00, // 0012 MOVE R2 R5
+ 0x4C140000, // 0013 LDNIL R5
+ 0x1C140405, // 0014 EQ R5 R2 R5
+ 0x78160001, // 0015 JMPF R5 #0018
+ 0x5415FFFE, // 0016 LDINT R5 -1
+ 0x94080805, // 0017 GETIDX R2 R4 R5
+ 0x70020020, // 0018 JMP #003A
+ 0x1C140305, // 0019 EQ R5 R1 K5
+ 0x78160008, // 001A JMPF R5 #0024
+ 0x60140009, // 001B GETGBL R5 G9
+ 0x88180705, // 001C GETMBR R6 R3 K5
+ 0x7C140200, // 001D CALL R5 1
+ 0x5C080A00, // 001E MOVE R2 R5
+ 0x4C140000, // 001F LDNIL R5
+ 0x1C140405, // 0020 EQ R5 R2 R5
+ 0x78160000, // 0021 JMPF R5 #0023
+ 0x94080903, // 0022 GETIDX R2 R4 K3
+ 0x70020015, // 0023 JMP #003A
+ 0x1C140306, // 0024 EQ R5 R1 K6
+ 0x78160008, // 0025 JMPF R5 #002F
+ 0x60140009, // 0026 GETGBL R5 G9
+ 0x88180706, // 0027 GETMBR R6 R3 K6
+ 0x7C140200, // 0028 CALL R5 1
+ 0x5C080A00, // 0029 MOVE R2 R5
+ 0x4C140000, // 002A LDNIL R5
+ 0x1C140405, // 002B EQ R5 R2 R5
+ 0x78160000, // 002C JMPF R5 #002E
+ 0x58080003, // 002D LDCONST R2 K3
+ 0x7002000A, // 002E JMP #003A
+ 0x88140107, // 002F GETMBR R5 R0 K7
+ 0x8C140B08, // 0030 GETMET R5 R5 K8
+ 0x5C1C0200, // 0031 MOVE R7 R1
+ 0x7C140400, // 0032 CALL R5 2
+ 0x78160005, // 0033 JMPF R5 #003A
+ 0x60140009, // 0034 GETGBL R5 G9
+ 0x5419FFFE, // 0035 LDINT R6 -1
+ 0x401A0606, // 0036 CONNECT R6 K3 R6
+ 0x94180206, // 0037 GETIDX R6 R1 R6
+ 0x7C140200, // 0038 CALL R5 1
+ 0x5C080A00, // 0039 MOVE R2 R5
+ 0x4C140000, // 003A LDNIL R5
+ 0x20140405, // 003B NE R5 R2 R5
+ 0x78160005, // 003C JMPF R5 #0043
+ 0x24140509, // 003D GT R5 R2 K9
+ 0x78160003, // 003E JMPF R5 #0043
+ 0x88140100, // 003F GETMBR R5 R0 K0
+ 0x94140A02, // 0040 GETIDX R5 R5 R2
+ 0x8C140B0A, // 0041 GETMET R5 R5 K10
+ 0x7C140200, // 0042 CALL R5 1
+ 0x80000000, // 0043 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
/********************************************************************
** Solidified function: do_action
********************************************************************/
be_local_closure(HASPmota_do_action, /* name */
be_nested_proto(
- 10, /* nstack */
+ 6, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
@@ -6348,99 +6451,224 @@ be_local_closure(HASPmota_do_action, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[14]) { /* constants */
+ ( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str_weak(lv),
/* K1 */ be_nested_str_weak(EVENT_CLICKED),
- /* K2 */ be_nested_str_weak(_action),
- /* K3 */ be_nested_str_weak(lvh_pages),
- /* K4 */ be_nested_str_weak(lvh_page_cur_idx),
- /* K5 */ be_nested_str_weak(pages_list_sorted),
- /* K6 */ be_const_int(1),
- /* K7 */ be_nested_str_weak(prev),
- /* K8 */ be_nested_str_weak(next),
- /* K9 */ be_nested_str_weak(back),
- /* K10 */ be_nested_str_weak(re_page_target),
- /* K11 */ be_nested_str_weak(match),
- /* K12 */ be_const_int(0),
- /* K13 */ be_nested_str_weak(show),
+ /* K2 */ be_nested_str_weak(page_show),
+ /* K3 */ be_nested_str_weak(_action),
}),
be_str_weak(do_action),
&be_const_str_solidified,
- ( &(const binstruction[74]) { /* code */
+ ( &(const binstruction[ 9]) { /* code */
0xB80E0000, // 0000 GETNGBL R3 K0
0x880C0701, // 0001 GETMBR R3 R3 K1
0x200C0403, // 0002 NE R3 R2 R3
0x780E0000, // 0003 JMPF R3 #0005
0x80000600, // 0004 RET 0
- 0x880C0302, // 0005 GETMBR R3 R1 K2
- 0x88100103, // 0006 GETMBR R4 R0 K3
- 0x88140104, // 0007 GETMBR R5 R0 K4
- 0x94100805, // 0008 GETIDX R4 R4 R5
- 0x4C140000, // 0009 LDNIL R5
- 0x8C180105, // 000A GETMET R6 R0 K5
- 0x88200104, // 000B GETMBR R8 R0 K4
- 0x7C180400, // 000C CALL R6 2
- 0x601C000C, // 000D GETGBL R7 G12
- 0x5C200C00, // 000E MOVE R8 R6
- 0x7C1C0200, // 000F CALL R7 1
- 0x181C0F06, // 0010 LE R7 R7 K6
- 0x781E0000, // 0011 JMPF R7 #0013
- 0x80000E00, // 0012 RET 0
- 0x1C1C0707, // 0013 EQ R7 R3 K7
- 0x781E0009, // 0014 JMPF R7 #001F
- 0x601C0009, // 0015 GETGBL R7 G9
- 0x88200907, // 0016 GETMBR R8 R4 K7
- 0x7C1C0200, // 0017 CALL R7 1
- 0x5C140E00, // 0018 MOVE R5 R7
- 0x4C1C0000, // 0019 LDNIL R7
- 0x1C1C0A07, // 001A EQ R7 R5 R7
- 0x781E0001, // 001B JMPF R7 #001E
- 0x541DFFFE, // 001C LDINT R7 -1
- 0x94140C07, // 001D GETIDX R5 R6 R7
- 0x70020020, // 001E JMP #0040
- 0x1C1C0708, // 001F EQ R7 R3 K8
- 0x781E0008, // 0020 JMPF R7 #002A
- 0x601C0009, // 0021 GETGBL R7 G9
- 0x88200908, // 0022 GETMBR R8 R4 K8
- 0x7C1C0200, // 0023 CALL R7 1
- 0x5C140E00, // 0024 MOVE R5 R7
- 0x4C1C0000, // 0025 LDNIL R7
- 0x1C1C0A07, // 0026 EQ R7 R5 R7
- 0x781E0000, // 0027 JMPF R7 #0029
- 0x94140D06, // 0028 GETIDX R5 R6 K6
- 0x70020015, // 0029 JMP #0040
- 0x1C1C0709, // 002A EQ R7 R3 K9
- 0x781E0008, // 002B JMPF R7 #0035
- 0x601C0009, // 002C GETGBL R7 G9
- 0x88200909, // 002D GETMBR R8 R4 K9
- 0x7C1C0200, // 002E CALL R7 1
- 0x5C140E00, // 002F MOVE R5 R7
- 0x4C1C0000, // 0030 LDNIL R7
- 0x1C1C0A07, // 0031 EQ R7 R5 R7
- 0x781E0000, // 0032 JMPF R7 #0034
- 0x58140006, // 0033 LDCONST R5 K6
- 0x7002000A, // 0034 JMP #0040
- 0x881C010A, // 0035 GETMBR R7 R0 K10
- 0x8C1C0F0B, // 0036 GETMET R7 R7 K11
- 0x5C240600, // 0037 MOVE R9 R3
- 0x7C1C0400, // 0038 CALL R7 2
- 0x781E0005, // 0039 JMPF R7 #0040
- 0x601C0009, // 003A GETGBL R7 G9
- 0x5421FFFE, // 003B LDINT R8 -1
- 0x40220C08, // 003C CONNECT R8 K6 R8
- 0x94200608, // 003D GETIDX R8 R3 R8
- 0x7C1C0200, // 003E CALL R7 1
- 0x5C140E00, // 003F MOVE R5 R7
- 0x4C1C0000, // 0040 LDNIL R7
- 0x201C0A07, // 0041 NE R7 R5 R7
- 0x781E0005, // 0042 JMPF R7 #0049
- 0x241C0B0C, // 0043 GT R7 R5 K12
- 0x781E0003, // 0044 JMPF R7 #0049
- 0x881C0103, // 0045 GETMBR R7 R0 K3
- 0x941C0E05, // 0046 GETIDX R7 R7 R5
- 0x8C1C0F0D, // 0047 GETMET R7 R7 K13
- 0x7C1C0200, // 0048 CALL R7 1
- 0x80000000, // 0049 RET 0
+ 0x8C0C0102, // 0005 GETMET R3 R0 K2
+ 0x88140303, // 0006 GETMBR R5 R1 K3
+ 0x7C0C0400, // 0007 CALL R3 2
+ 0x80000000, // 0008 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: register_event
+********************************************************************/
+be_local_closure(HASPmota_register_event, /* name */
+ be_nested_proto(
+ 13, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 1, /* has sup protos */
+ ( &(const struct bproto*[ 1]) {
+ be_nested_proto(
+ 4, /* nstack */
+ 1, /* argc */
+ 0, /* varg */
+ 1, /* has upvals */
+ ( &(const bupvaldesc[ 1]) { /* upvals */
+ be_local_const_upval(1, 0),
+ }),
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(event_dispatch),
+ }),
+ be_str_weak(_X3Clambda_X3E),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 5]) { /* code */
+ 0x68040000, // 0000 GETUPV R1 U0
+ 0x8C040300, // 0001 GETMET R1 R1 K0
+ 0x5C0C0000, // 0002 MOVE R3 R0
+ 0x7C040400, // 0003 CALL R1 2
+ 0x80040200, // 0004 RET 1 R1
+ })
+ ),
+ }),
+ 1, /* has constants */
+ ( &(const bvalue[ 7]) { /* constants */
+ /* K0 */ be_nested_str_weak(cb),
+ /* K1 */ be_nested_str_weak(introspect),
+ /* K2 */ be_nested_str_weak(event_cb),
+ /* K3 */ be_nested_str_weak(gen_cb),
+ /* K4 */ be_nested_str_weak(_lv_obj),
+ /* K5 */ be_nested_str_weak(add_event_cb),
+ /* K6 */ be_nested_str_weak(toptr),
+ }),
+ be_str_weak(register_event),
+ &be_const_str_solidified,
+ ( &(const binstruction[20]) { /* code */
+ 0xA40E0000, // 0000 IMPORT R3 K0
+ 0xA4120200, // 0001 IMPORT R4 K1
+ 0x88140102, // 0002 GETMBR R5 R0 K2
+ 0x4C180000, // 0003 LDNIL R6
+ 0x1C140A06, // 0004 EQ R5 R5 R6
+ 0x78160003, // 0005 JMPF R5 #000A
+ 0x8C140703, // 0006 GETMET R5 R3 K3
+ 0x841C0000, // 0007 CLOSURE R7 P0
+ 0x7C140400, // 0008 CALL R5 2
+ 0x90020405, // 0009 SETMBR R0 K2 R5
+ 0x88140304, // 000A GETMBR R5 R1 K4
+ 0x8C180B05, // 000B GETMET R6 R5 K5
+ 0x88200102, // 000C GETMBR R8 R0 K2
+ 0x5C240400, // 000D MOVE R9 R2
+ 0x8C280906, // 000E GETMET R10 R4 K6
+ 0x5C300200, // 000F MOVE R12 R1
+ 0x7C280400, // 0010 CALL R10 2
+ 0x7C180800, // 0011 CALL R6 4
+ 0xA0000000, // 0012 CLOSE R0
+ 0x80000000, // 0013 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: parse
+********************************************************************/
+be_local_closure(HASPmota_parse, /* name */
+ be_nested_proto(
+ 9, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 9]) { /* constants */
+ /* K0 */ be_nested_str_weak(json),
+ /* K1 */ be_nested_str_weak(load),
+ /* K2 */ be_nested_str_weak(instance),
+ /* K3 */ be_nested_str_weak(parse_page),
+ /* K4 */ be_nested_str_weak(parse_obj),
+ /* K5 */ be_nested_str_weak(lvh_pages),
+ /* K6 */ be_nested_str_weak(lvh_page_cur_idx),
+ /* K7 */ be_nested_str_weak(value_error),
+ /* K8 */ be_nested_str_weak(unable_X20to_X20parse_X20JSON_X20line),
+ }),
+ be_str_weak(parse),
+ &be_const_str_solidified,
+ ( &(const binstruction[21]) { /* code */
+ 0xA40A0000, // 0000 IMPORT R2 K0
+ 0x8C0C0501, // 0001 GETMET R3 R2 K1
+ 0x5C140200, // 0002 MOVE R5 R1
+ 0x7C0C0400, // 0003 CALL R3 2
+ 0x60100004, // 0004 GETGBL R4 G4
+ 0x5C140600, // 0005 MOVE R5 R3
+ 0x7C100200, // 0006 CALL R4 1
+ 0x1C100902, // 0007 EQ R4 R4 K2
+ 0x78120009, // 0008 JMPF R4 #0013
+ 0x8C100103, // 0009 GETMET R4 R0 K3
+ 0x5C180600, // 000A MOVE R6 R3
+ 0x7C100400, // 000B CALL R4 2
+ 0x8C100104, // 000C GETMET R4 R0 K4
+ 0x5C180600, // 000D MOVE R6 R3
+ 0x881C0105, // 000E GETMBR R7 R0 K5
+ 0x88200106, // 000F GETMBR R8 R0 K6
+ 0x941C0E08, // 0010 GETIDX R7 R7 R8
+ 0x7C100600, // 0011 CALL R4 3
+ 0x70020000, // 0012 JMP #0014
+ 0xB0060F08, // 0013 RAISE 1 K7 K8
+ 0x80000000, // 0014 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: event_dispatch
+********************************************************************/
+be_local_closure(HASPmota_event_dispatch, /* name */
+ be_nested_proto(
+ 9, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[11]) { /* constants */
+ /* K0 */ be_nested_str_weak(introspect),
+ /* K1 */ be_nested_str_weak(toptr),
+ /* K2 */ be_nested_str_weak(event),
+ /* K3 */ be_nested_str_weak(_change_buffer),
+ /* K4 */ be_nested_str_weak(lv),
+ /* K5 */ be_nested_str_weak(lv_event),
+ /* K6 */ be_nested_str_weak(user_data),
+ /* K7 */ be_const_int(0),
+ /* K8 */ be_nested_str_weak(fromptr),
+ /* K9 */ be_nested_str_weak(instance),
+ /* K10 */ be_nested_str_weak(event_cb),
+ }),
+ be_str_weak(event_dispatch),
+ &be_const_str_solidified,
+ ( &(const binstruction[35]) { /* code */
+ 0xA40A0000, // 0000 IMPORT R2 K0
+ 0x8C0C0501, // 0001 GETMET R3 R2 K1
+ 0x5C140200, // 0002 MOVE R5 R1
+ 0x7C0C0400, // 0003 CALL R3 2
+ 0x88100102, // 0004 GETMBR R4 R0 K2
+ 0x78120004, // 0005 JMPF R4 #000B
+ 0x88100102, // 0006 GETMBR R4 R0 K2
+ 0x8C100903, // 0007 GETMET R4 R4 K3
+ 0x5C180600, // 0008 MOVE R6 R3
+ 0x7C100400, // 0009 CALL R4 2
+ 0x70020004, // 000A JMP #0010
+ 0xB8120800, // 000B GETNGBL R4 K4
+ 0x8C100905, // 000C GETMET R4 R4 K5
+ 0x5C180600, // 000D MOVE R6 R3
+ 0x7C100400, // 000E CALL R4 2
+ 0x90020404, // 000F SETMBR R0 K2 R4
+ 0x88100102, // 0010 GETMBR R4 R0 K2
+ 0x88100906, // 0011 GETMBR R4 R4 K6
+ 0x60140009, // 0012 GETGBL R5 G9
+ 0x5C180800, // 0013 MOVE R6 R4
+ 0x7C140200, // 0014 CALL R5 1
+ 0x20140B07, // 0015 NE R5 R5 K7
+ 0x7816000A, // 0016 JMPF R5 #0022
+ 0x8C140508, // 0017 GETMET R5 R2 K8
+ 0x5C1C0800, // 0018 MOVE R7 R4
+ 0x7C140400, // 0019 CALL R5 2
+ 0x60180004, // 001A GETGBL R6 G4
+ 0x5C1C0A00, // 001B MOVE R7 R5
+ 0x7C180200, // 001C CALL R6 1
+ 0x1C180D09, // 001D EQ R6 R6 K9
+ 0x781A0002, // 001E JMPF R6 #0022
+ 0x8C180B0A, // 001F GETMET R6 R5 K10
+ 0x88200102, // 0020 GETMBR R8 R0 K2
+ 0x7C180400, // 0021 CALL R6 2
+ 0x80000000, // 0022 RET 0
})
)
);
@@ -6527,6 +6755,251 @@ be_local_closure(HASPmota_pages_list_sorted, /* name */
/*******************************************************************/
+/********************************************************************
+** Solidified function: sort
+********************************************************************/
+be_local_closure(HASPmota_sort, /* name */
+ be_nested_proto(
+ 7, /* nstack */
+ 1, /* argc */
+ 4, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_const_class(be_class_HASPmota),
+ /* K1 */ be_const_int(1),
+ /* K2 */ be_const_int(0),
+ /* K3 */ be_nested_str_weak(stop_iteration),
+ }),
+ be_str_weak(sort),
+ &be_const_str_solidified,
+ ( &(const binstruction[30]) { /* code */
+ 0x58040000, // 0000 LDCONST R1 K0
+ 0x60080010, // 0001 GETGBL R2 G16
+ 0x600C000C, // 0002 GETGBL R3 G12
+ 0x5C100000, // 0003 MOVE R4 R0
+ 0x7C0C0200, // 0004 CALL R3 1
+ 0x040C0701, // 0005 SUB R3 R3 K1
+ 0x400E0203, // 0006 CONNECT R3 K1 R3
+ 0x7C080200, // 0007 CALL R2 1
+ 0xA8020010, // 0008 EXBLK 0 #001A
+ 0x5C0C0400, // 0009 MOVE R3 R2
+ 0x7C0C0000, // 000A CALL R3 0
+ 0x94100003, // 000B GETIDX R4 R0 R3
+ 0x5C140600, // 000C MOVE R5 R3
+ 0x24180B02, // 000D GT R6 R5 K2
+ 0x781A0008, // 000E JMPF R6 #0018
+ 0x04180B01, // 000F SUB R6 R5 K1
+ 0x94180006, // 0010 GETIDX R6 R0 R6
+ 0x24180C04, // 0011 GT R6 R6 R4
+ 0x781A0004, // 0012 JMPF R6 #0018
+ 0x04180B01, // 0013 SUB R6 R5 K1
+ 0x94180006, // 0014 GETIDX R6 R0 R6
+ 0x98000A06, // 0015 SETIDX R0 R5 R6
+ 0x04140B01, // 0016 SUB R5 R5 K1
+ 0x7001FFF4, // 0017 JMP #000D
+ 0x98000A04, // 0018 SETIDX R0 R5 R4
+ 0x7001FFEE, // 0019 JMP #0009
+ 0x58080003, // 001A LDCONST R2 K3
+ 0xAC080200, // 001B CATCH R2 1 0
+ 0xB0080000, // 001C RAISE 2 R0 R0
+ 0x80040000, // 001D RET 1 R0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: parse_page
+********************************************************************/
+be_local_closure(HASPmota_parse_page, /* name */
+ be_nested_proto(
+ 9, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[14]) { /* constants */
+ /* K0 */ be_nested_str_weak(has),
+ /* K1 */ be_nested_str_weak(page),
+ /* K2 */ be_nested_str_weak(int),
+ /* K3 */ be_nested_str_weak(lvh_page_cur_idx),
+ /* K4 */ be_nested_str_weak(lvh_pages),
+ /* K5 */ be_nested_str_weak(contains),
+ /* K6 */ be_nested_str_weak(lvh_page),
+ /* K7 */ be_nested_str_weak(find),
+ /* K8 */ be_nested_str_weak(id),
+ /* K9 */ be_const_int(0),
+ /* K10 */ be_nested_str_weak(get_page_cur),
+ /* K11 */ be_nested_str_weak(prev),
+ /* K12 */ be_nested_str_weak(next),
+ /* K13 */ be_nested_str_weak(back),
+ }),
+ be_str_weak(parse_page),
+ &be_const_str_solidified,
+ ( &(const binstruction[54]) { /* code */
+ 0x8C080300, // 0000 GETMET R2 R1 K0
+ 0x58100001, // 0001 LDCONST R4 K1
+ 0x7C080400, // 0002 CALL R2 2
+ 0x780A0030, // 0003 JMPF R2 #0035
+ 0x60080004, // 0004 GETGBL R2 G4
+ 0x940C0301, // 0005 GETIDX R3 R1 K1
+ 0x7C080200, // 0006 CALL R2 1
+ 0x1C080502, // 0007 EQ R2 R2 K2
+ 0x780A002B, // 0008 JMPF R2 #0035
+ 0x60080009, // 0009 GETGBL R2 G9
+ 0x940C0301, // 000A GETIDX R3 R1 K1
+ 0x7C080200, // 000B CALL R2 1
+ 0x90020602, // 000C SETMBR R0 K3 R2
+ 0x880C0104, // 000D GETMBR R3 R0 K4
+ 0x8C0C0705, // 000E GETMET R3 R3 K5
+ 0x5C140400, // 000F MOVE R5 R2
+ 0x7C0C0400, // 0010 CALL R3 2
+ 0x740E0006, // 0011 JMPT R3 #0019
+ 0x880C0106, // 0012 GETMBR R3 R0 K6
+ 0x88100104, // 0013 GETMBR R4 R0 K4
+ 0x5C140600, // 0014 MOVE R5 R3
+ 0x5C180400, // 0015 MOVE R6 R2
+ 0x5C1C0000, // 0016 MOVE R7 R0
+ 0x7C140400, // 0017 CALL R5 2
+ 0x98100405, // 0018 SETIDX R4 R2 R5
+ 0x8C0C0307, // 0019 GETMET R3 R1 K7
+ 0x58140008, // 001A LDCONST R5 K8
+ 0x7C0C0400, // 001B CALL R3 2
+ 0x1C0C0709, // 001C EQ R3 R3 K9
+ 0x780E0016, // 001D JMPF R3 #0035
+ 0x8C0C010A, // 001E GETMET R3 R0 K10
+ 0x7C0C0200, // 001F CALL R3 1
+ 0x60100009, // 0020 GETGBL R4 G9
+ 0x8C140307, // 0021 GETMET R5 R1 K7
+ 0x581C000B, // 0022 LDCONST R7 K11
+ 0x4C200000, // 0023 LDNIL R8
+ 0x7C140600, // 0024 CALL R5 3
+ 0x7C100200, // 0025 CALL R4 1
+ 0x900E1604, // 0026 SETMBR R3 K11 R4
+ 0x60100009, // 0027 GETGBL R4 G9
+ 0x8C140307, // 0028 GETMET R5 R1 K7
+ 0x581C000C, // 0029 LDCONST R7 K12
+ 0x4C200000, // 002A LDNIL R8
+ 0x7C140600, // 002B CALL R5 3
+ 0x7C100200, // 002C CALL R4 1
+ 0x900E1804, // 002D SETMBR R3 K12 R4
+ 0x60100009, // 002E GETGBL R4 G9
+ 0x8C140307, // 002F GETMET R5 R1 K7
+ 0x581C000D, // 0030 LDCONST R7 K13
+ 0x4C200000, // 0031 LDNIL R8
+ 0x7C140600, // 0032 CALL R5 3
+ 0x7C100200, // 0033 CALL R4 1
+ 0x900E1A04, // 0034 SETMBR R3 K13 R4
+ 0x80000000, // 0035 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: _load
+********************************************************************/
+be_local_closure(HASPmota__load, /* name */
+ be_nested_proto(
+ 14, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[17]) { /* constants */
+ /* K0 */ be_nested_str_weak(string),
+ /* K1 */ be_nested_str_weak(json),
+ /* K2 */ be_nested_str_weak(lvh_page_cur_idx),
+ /* K3 */ be_const_int(1),
+ /* K4 */ be_nested_str_weak(lvh_page),
+ /* K5 */ be_nested_str_weak(lvh_pages),
+ /* K6 */ be_nested_str_weak(r),
+ /* K7 */ be_nested_str_weak(read),
+ /* K8 */ be_nested_str_weak(close),
+ /* K9 */ be_nested_str_weak(split),
+ /* K10 */ be_nested_str_weak(_X0A),
+ /* K11 */ be_const_int(0),
+ /* K12 */ be_nested_str_weak(load),
+ /* K13 */ be_nested_str_weak(instance),
+ /* K14 */ be_nested_str_weak(parse_page),
+ /* K15 */ be_nested_str_weak(parse_obj),
+ /* K16 */ be_nested_str_weak(remove),
+ }),
+ be_str_weak(_load),
+ &be_const_str_solidified,
+ ( &(const binstruction[54]) { /* code */
+ 0xA40A0000, // 0000 IMPORT R2 K0
+ 0xA40E0200, // 0001 IMPORT R3 K1
+ 0x90020503, // 0002 SETMBR R0 K2 K3
+ 0x88100104, // 0003 GETMBR R4 R0 K4
+ 0x88140105, // 0004 GETMBR R5 R0 K5
+ 0x5C180800, // 0005 MOVE R6 R4
+ 0x581C0003, // 0006 LDCONST R7 K3
+ 0x5C200000, // 0007 MOVE R8 R0
+ 0x7C180400, // 0008 CALL R6 2
+ 0x98160606, // 0009 SETIDX R5 K3 R6
+ 0x60140011, // 000A GETGBL R5 G17
+ 0x5C180200, // 000B MOVE R6 R1
+ 0x581C0006, // 000C LDCONST R7 K6
+ 0x7C140400, // 000D CALL R5 2
+ 0x8C180B07, // 000E GETMET R6 R5 K7
+ 0x7C180200, // 000F CALL R6 1
+ 0x8C1C0B08, // 0010 GETMET R7 R5 K8
+ 0x7C1C0200, // 0011 CALL R7 1
+ 0x8C1C0509, // 0012 GETMET R7 R2 K9
+ 0x5C240C00, // 0013 MOVE R9 R6
+ 0x5828000A, // 0014 LDCONST R10 K10
+ 0x7C1C0600, // 0015 CALL R7 3
+ 0x4C140000, // 0016 LDNIL R5
+ 0x4C180000, // 0017 LDNIL R6
+ 0x6020000C, // 0018 GETGBL R8 G12
+ 0x5C240E00, // 0019 MOVE R9 R7
+ 0x7C200200, // 001A CALL R8 1
+ 0x2420110B, // 001B GT R8 R8 K11
+ 0x78220015, // 001C JMPF R8 #0033
+ 0x8C20070C, // 001D GETMET R8 R3 K12
+ 0x94280F0B, // 001E GETIDX R10 R7 K11
+ 0x7C200400, // 001F CALL R8 2
+ 0x60240004, // 0020 GETGBL R9 G4
+ 0x5C281000, // 0021 MOVE R10 R8
+ 0x7C240200, // 0022 CALL R9 1
+ 0x1C24130D, // 0023 EQ R9 R9 K13
+ 0x78260008, // 0024 JMPF R9 #002E
+ 0x8C24010E, // 0025 GETMET R9 R0 K14
+ 0x5C2C1000, // 0026 MOVE R11 R8
+ 0x7C240400, // 0027 CALL R9 2
+ 0x8C24010F, // 0028 GETMET R9 R0 K15
+ 0x5C2C1000, // 0029 MOVE R11 R8
+ 0x88300105, // 002A GETMBR R12 R0 K5
+ 0x88340102, // 002B GETMBR R13 R0 K2
+ 0x9430180D, // 002C GETIDX R12 R12 R13
+ 0x7C240600, // 002D CALL R9 3
+ 0x4C200000, // 002E LDNIL R8
+ 0x8C240F10, // 002F GETMET R9 R7 K16
+ 0x582C000B, // 0030 LDCONST R11 K11
+ 0x7C240400, // 0031 CALL R9 2
+ 0x7001FFE4, // 0032 JMP #0018
+ 0x4C1C0000, // 0033 LDNIL R7
+ 0x90020503, // 0034 SETMBR R0 K2 K3
+ 0x80000000, // 0035 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
/********************************************************************
** Solidified function: get_page_cur
********************************************************************/
@@ -6557,6 +7030,53 @@ be_local_closure(HASPmota_get_page_cur, /* name */
/*******************************************************************/
+/********************************************************************
+** Solidified function: deinit
+********************************************************************/
+be_local_closure(HASPmota_deinit, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(_val_rule),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(remove_rule),
+ /* K3 */ be_nested_str_weak(_text_rule),
+ }),
+ be_str_weak(deinit),
+ &be_const_str_solidified,
+ ( &(const binstruction[19]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x4C080000, // 0001 LDNIL R2
+ 0x20040202, // 0002 NE R1 R1 R2
+ 0x78060004, // 0003 JMPF R1 #0009
+ 0xB8060200, // 0004 GETNGBL R1 K1
+ 0x8C040302, // 0005 GETMET R1 R1 K2
+ 0x880C0100, // 0006 GETMBR R3 R0 K0
+ 0x5C100000, // 0007 MOVE R4 R0
+ 0x7C040600, // 0008 CALL R1 3
+ 0x88040103, // 0009 GETMBR R1 R0 K3
+ 0x4C080000, // 000A LDNIL R2
+ 0x20040202, // 000B NE R1 R1 R2
+ 0x78060004, // 000C JMPF R1 #0012
+ 0xB8060200, // 000D GETNGBL R1 K1
+ 0x8C040302, // 000E GETMET R1 R1 K2
+ 0x880C0103, // 000F GETMBR R3 R0 K3
+ 0x5C100000, // 0010 MOVE R4 R0
+ 0x7C040600, // 0011 CALL R1 3
+ 0x80000000, // 0012 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
/********************************************************************
** Solidified function: start
********************************************************************/
@@ -6753,221 +7273,6 @@ be_local_closure(HASPmota_init, /* name */
/*******************************************************************/
-/********************************************************************
-** Solidified function: register_event
-********************************************************************/
-be_local_closure(HASPmota_register_event, /* name */
- be_nested_proto(
- 13, /* nstack */
- 3, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 1, /* has sup protos */
- ( &(const struct bproto*[ 1]) {
- be_nested_proto(
- 4, /* nstack */
- 1, /* argc */
- 0, /* varg */
- 1, /* has upvals */
- ( &(const bupvaldesc[ 1]) { /* upvals */
- be_local_const_upval(1, 0),
- }),
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 1]) { /* constants */
- /* K0 */ be_nested_str_weak(event_dispatch),
- }),
- be_str_weak(_X3Clambda_X3E),
- &be_const_str_solidified,
- ( &(const binstruction[ 5]) { /* code */
- 0x68040000, // 0000 GETUPV R1 U0
- 0x8C040300, // 0001 GETMET R1 R1 K0
- 0x5C0C0000, // 0002 MOVE R3 R0
- 0x7C040400, // 0003 CALL R1 2
- 0x80040200, // 0004 RET 1 R1
- })
- ),
- }),
- 1, /* has constants */
- ( &(const bvalue[ 7]) { /* constants */
- /* K0 */ be_nested_str_weak(cb),
- /* K1 */ be_nested_str_weak(introspect),
- /* K2 */ be_nested_str_weak(event_cb),
- /* K3 */ be_nested_str_weak(gen_cb),
- /* K4 */ be_nested_str_weak(_lv_obj),
- /* K5 */ be_nested_str_weak(add_event_cb),
- /* K6 */ be_nested_str_weak(toptr),
- }),
- be_str_weak(register_event),
- &be_const_str_solidified,
- ( &(const binstruction[20]) { /* code */
- 0xA40E0000, // 0000 IMPORT R3 K0
- 0xA4120200, // 0001 IMPORT R4 K1
- 0x88140102, // 0002 GETMBR R5 R0 K2
- 0x4C180000, // 0003 LDNIL R6
- 0x1C140A06, // 0004 EQ R5 R5 R6
- 0x78160003, // 0005 JMPF R5 #000A
- 0x8C140703, // 0006 GETMET R5 R3 K3
- 0x841C0000, // 0007 CLOSURE R7 P0
- 0x7C140400, // 0008 CALL R5 2
- 0x90020405, // 0009 SETMBR R0 K2 R5
- 0x88140304, // 000A GETMBR R5 R1 K4
- 0x8C180B05, // 000B GETMET R6 R5 K5
- 0x88200102, // 000C GETMBR R8 R0 K2
- 0x5C240400, // 000D MOVE R9 R2
- 0x8C280906, // 000E GETMET R10 R4 K6
- 0x5C300200, // 000F MOVE R12 R1
- 0x7C280400, // 0010 CALL R10 2
- 0x7C180800, // 0011 CALL R6 4
- 0xA0000000, // 0012 CLOSE R0
- 0x80000000, // 0013 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: parse_page
-********************************************************************/
-be_local_closure(HASPmota_parse_page, /* name */
- be_nested_proto(
- 9, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[14]) { /* constants */
- /* K0 */ be_nested_str_weak(has),
- /* K1 */ be_nested_str_weak(page),
- /* K2 */ be_nested_str_weak(int),
- /* K3 */ be_nested_str_weak(lvh_page_cur_idx),
- /* K4 */ be_nested_str_weak(lvh_pages),
- /* K5 */ be_nested_str_weak(contains),
- /* K6 */ be_nested_str_weak(lvh_page),
- /* K7 */ be_nested_str_weak(find),
- /* K8 */ be_nested_str_weak(id),
- /* K9 */ be_const_int(0),
- /* K10 */ be_nested_str_weak(get_page_cur),
- /* K11 */ be_nested_str_weak(prev),
- /* K12 */ be_nested_str_weak(next),
- /* K13 */ be_nested_str_weak(back),
- }),
- be_str_weak(parse_page),
- &be_const_str_solidified,
- ( &(const binstruction[54]) { /* code */
- 0x8C080300, // 0000 GETMET R2 R1 K0
- 0x58100001, // 0001 LDCONST R4 K1
- 0x7C080400, // 0002 CALL R2 2
- 0x780A0030, // 0003 JMPF R2 #0035
- 0x60080004, // 0004 GETGBL R2 G4
- 0x940C0301, // 0005 GETIDX R3 R1 K1
- 0x7C080200, // 0006 CALL R2 1
- 0x1C080502, // 0007 EQ R2 R2 K2
- 0x780A002B, // 0008 JMPF R2 #0035
- 0x60080009, // 0009 GETGBL R2 G9
- 0x940C0301, // 000A GETIDX R3 R1 K1
- 0x7C080200, // 000B CALL R2 1
- 0x90020602, // 000C SETMBR R0 K3 R2
- 0x880C0104, // 000D GETMBR R3 R0 K4
- 0x8C0C0705, // 000E GETMET R3 R3 K5
- 0x5C140400, // 000F MOVE R5 R2
- 0x7C0C0400, // 0010 CALL R3 2
- 0x740E0006, // 0011 JMPT R3 #0019
- 0x880C0106, // 0012 GETMBR R3 R0 K6
- 0x88100104, // 0013 GETMBR R4 R0 K4
- 0x5C140600, // 0014 MOVE R5 R3
- 0x5C180400, // 0015 MOVE R6 R2
- 0x5C1C0000, // 0016 MOVE R7 R0
- 0x7C140400, // 0017 CALL R5 2
- 0x98100405, // 0018 SETIDX R4 R2 R5
- 0x8C0C0307, // 0019 GETMET R3 R1 K7
- 0x58140008, // 001A LDCONST R5 K8
- 0x7C0C0400, // 001B CALL R3 2
- 0x1C0C0709, // 001C EQ R3 R3 K9
- 0x780E0016, // 001D JMPF R3 #0035
- 0x8C0C010A, // 001E GETMET R3 R0 K10
- 0x7C0C0200, // 001F CALL R3 1
- 0x60100009, // 0020 GETGBL R4 G9
- 0x8C140307, // 0021 GETMET R5 R1 K7
- 0x581C000B, // 0022 LDCONST R7 K11
- 0x4C200000, // 0023 LDNIL R8
- 0x7C140600, // 0024 CALL R5 3
- 0x7C100200, // 0025 CALL R4 1
- 0x900E1604, // 0026 SETMBR R3 K11 R4
- 0x60100009, // 0027 GETGBL R4 G9
- 0x8C140307, // 0028 GETMET R5 R1 K7
- 0x581C000C, // 0029 LDCONST R7 K12
- 0x4C200000, // 002A LDNIL R8
- 0x7C140600, // 002B CALL R5 3
- 0x7C100200, // 002C CALL R4 1
- 0x900E1804, // 002D SETMBR R3 K12 R4
- 0x60100009, // 002E GETGBL R4 G9
- 0x8C140307, // 002F GETMET R5 R1 K7
- 0x581C000D, // 0030 LDCONST R7 K13
- 0x4C200000, // 0031 LDNIL R8
- 0x7C140600, // 0032 CALL R5 3
- 0x7C100200, // 0033 CALL R4 1
- 0x900E1A04, // 0034 SETMBR R3 K13 R4
- 0x80000000, // 0035 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: deinit
-********************************************************************/
-be_local_closure(HASPmota_deinit, /* name */
- be_nested_proto(
- 5, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_nested_str_weak(_val_rule),
- /* K1 */ be_nested_str_weak(tasmota),
- /* K2 */ be_nested_str_weak(remove_rule),
- /* K3 */ be_nested_str_weak(_text_rule),
- }),
- be_str_weak(deinit),
- &be_const_str_solidified,
- ( &(const binstruction[19]) { /* code */
- 0x88040100, // 0000 GETMBR R1 R0 K0
- 0x4C080000, // 0001 LDNIL R2
- 0x20040202, // 0002 NE R1 R1 R2
- 0x78060004, // 0003 JMPF R1 #0009
- 0xB8060200, // 0004 GETNGBL R1 K1
- 0x8C040302, // 0005 GETMET R1 R1 K2
- 0x880C0100, // 0006 GETMBR R3 R0 K0
- 0x5C100000, // 0007 MOVE R4 R0
- 0x7C040600, // 0008 CALL R1 3
- 0x88040103, // 0009 GETMBR R1 R0 K3
- 0x4C080000, // 000A LDNIL R2
- 0x20040202, // 000B NE R1 R1 R2
- 0x78060004, // 000C JMPF R1 #0012
- 0xB8060200, // 000D GETNGBL R1 K1
- 0x8C040302, // 000E GETMET R1 R1 K2
- 0x880C0103, // 000F GETMBR R3 R0 K3
- 0x5C100000, // 0010 MOVE R4 R0
- 0x7C040600, // 0011 CALL R1 3
- 0x80000000, // 0012 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
/********************************************************************
** Solidified function: page_dir_to
********************************************************************/
@@ -7029,213 +7334,6 @@ be_local_closure(HASPmota_page_dir_to, /* name */
/*******************************************************************/
-/********************************************************************
-** Solidified function: _load
-********************************************************************/
-be_local_closure(HASPmota__load, /* name */
- be_nested_proto(
- 14, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[17]) { /* constants */
- /* K0 */ be_nested_str_weak(string),
- /* K1 */ be_nested_str_weak(json),
- /* K2 */ be_nested_str_weak(lvh_page_cur_idx),
- /* K3 */ be_const_int(1),
- /* K4 */ be_nested_str_weak(lvh_page),
- /* K5 */ be_nested_str_weak(lvh_pages),
- /* K6 */ be_nested_str_weak(r),
- /* K7 */ be_nested_str_weak(read),
- /* K8 */ be_nested_str_weak(close),
- /* K9 */ be_nested_str_weak(split),
- /* K10 */ be_nested_str_weak(_X0A),
- /* K11 */ be_const_int(0),
- /* K12 */ be_nested_str_weak(load),
- /* K13 */ be_nested_str_weak(instance),
- /* K14 */ be_nested_str_weak(parse_page),
- /* K15 */ be_nested_str_weak(parse_obj),
- /* K16 */ be_nested_str_weak(remove),
- }),
- be_str_weak(_load),
- &be_const_str_solidified,
- ( &(const binstruction[54]) { /* code */
- 0xA40A0000, // 0000 IMPORT R2 K0
- 0xA40E0200, // 0001 IMPORT R3 K1
- 0x90020503, // 0002 SETMBR R0 K2 K3
- 0x88100104, // 0003 GETMBR R4 R0 K4
- 0x88140105, // 0004 GETMBR R5 R0 K5
- 0x5C180800, // 0005 MOVE R6 R4
- 0x581C0003, // 0006 LDCONST R7 K3
- 0x5C200000, // 0007 MOVE R8 R0
- 0x7C180400, // 0008 CALL R6 2
- 0x98160606, // 0009 SETIDX R5 K3 R6
- 0x60140011, // 000A GETGBL R5 G17
- 0x5C180200, // 000B MOVE R6 R1
- 0x581C0006, // 000C LDCONST R7 K6
- 0x7C140400, // 000D CALL R5 2
- 0x8C180B07, // 000E GETMET R6 R5 K7
- 0x7C180200, // 000F CALL R6 1
- 0x8C1C0B08, // 0010 GETMET R7 R5 K8
- 0x7C1C0200, // 0011 CALL R7 1
- 0x8C1C0509, // 0012 GETMET R7 R2 K9
- 0x5C240C00, // 0013 MOVE R9 R6
- 0x5828000A, // 0014 LDCONST R10 K10
- 0x7C1C0600, // 0015 CALL R7 3
- 0x4C140000, // 0016 LDNIL R5
- 0x4C180000, // 0017 LDNIL R6
- 0x6020000C, // 0018 GETGBL R8 G12
- 0x5C240E00, // 0019 MOVE R9 R7
- 0x7C200200, // 001A CALL R8 1
- 0x2420110B, // 001B GT R8 R8 K11
- 0x78220015, // 001C JMPF R8 #0033
- 0x8C20070C, // 001D GETMET R8 R3 K12
- 0x94280F0B, // 001E GETIDX R10 R7 K11
- 0x7C200400, // 001F CALL R8 2
- 0x60240004, // 0020 GETGBL R9 G4
- 0x5C281000, // 0021 MOVE R10 R8
- 0x7C240200, // 0022 CALL R9 1
- 0x1C24130D, // 0023 EQ R9 R9 K13
- 0x78260008, // 0024 JMPF R9 #002E
- 0x8C24010E, // 0025 GETMET R9 R0 K14
- 0x5C2C1000, // 0026 MOVE R11 R8
- 0x7C240400, // 0027 CALL R9 2
- 0x8C24010F, // 0028 GETMET R9 R0 K15
- 0x5C2C1000, // 0029 MOVE R11 R8
- 0x88300105, // 002A GETMBR R12 R0 K5
- 0x88340102, // 002B GETMBR R13 R0 K2
- 0x9430180D, // 002C GETIDX R12 R12 R13
- 0x7C240600, // 002D CALL R9 3
- 0x4C200000, // 002E LDNIL R8
- 0x8C240F10, // 002F GETMET R9 R7 K16
- 0x582C000B, // 0030 LDCONST R11 K11
- 0x7C240400, // 0031 CALL R9 2
- 0x7001FFE4, // 0032 JMP #0018
- 0x4C1C0000, // 0033 LDNIL R7
- 0x90020503, // 0034 SETMBR R0 K2 K3
- 0x80000000, // 0035 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: parse
-********************************************************************/
-be_local_closure(HASPmota_parse, /* name */
- be_nested_proto(
- 9, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 9]) { /* constants */
- /* K0 */ be_nested_str_weak(json),
- /* K1 */ be_nested_str_weak(load),
- /* K2 */ be_nested_str_weak(instance),
- /* K3 */ be_nested_str_weak(parse_page),
- /* K4 */ be_nested_str_weak(parse_obj),
- /* K5 */ be_nested_str_weak(lvh_pages),
- /* K6 */ be_nested_str_weak(lvh_page_cur_idx),
- /* K7 */ be_nested_str_weak(value_error),
- /* K8 */ be_nested_str_weak(unable_X20to_X20parse_X20JSON_X20line),
- }),
- be_str_weak(parse),
- &be_const_str_solidified,
- ( &(const binstruction[21]) { /* code */
- 0xA40A0000, // 0000 IMPORT R2 K0
- 0x8C0C0501, // 0001 GETMET R3 R2 K1
- 0x5C140200, // 0002 MOVE R5 R1
- 0x7C0C0400, // 0003 CALL R3 2
- 0x60100004, // 0004 GETGBL R4 G4
- 0x5C140600, // 0005 MOVE R5 R3
- 0x7C100200, // 0006 CALL R4 1
- 0x1C100902, // 0007 EQ R4 R4 K2
- 0x78120009, // 0008 JMPF R4 #0013
- 0x8C100103, // 0009 GETMET R4 R0 K3
- 0x5C180600, // 000A MOVE R6 R3
- 0x7C100400, // 000B CALL R4 2
- 0x8C100104, // 000C GETMET R4 R0 K4
- 0x5C180600, // 000D MOVE R6 R3
- 0x881C0105, // 000E GETMBR R7 R0 K5
- 0x88200106, // 000F GETMBR R8 R0 K6
- 0x941C0E08, // 0010 GETIDX R7 R7 R8
- 0x7C100600, // 0011 CALL R4 3
- 0x70020000, // 0012 JMP #0014
- 0xB0060F08, // 0013 RAISE 1 K7 K8
- 0x80000000, // 0014 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: sort
-********************************************************************/
-be_local_closure(HASPmota_sort, /* name */
- be_nested_proto(
- 7, /* nstack */
- 1, /* argc */
- 4, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_const_class(be_class_HASPmota),
- /* K1 */ be_const_int(1),
- /* K2 */ be_const_int(0),
- /* K3 */ be_nested_str_weak(stop_iteration),
- }),
- be_str_weak(sort),
- &be_const_str_solidified,
- ( &(const binstruction[30]) { /* code */
- 0x58040000, // 0000 LDCONST R1 K0
- 0x60080010, // 0001 GETGBL R2 G16
- 0x600C000C, // 0002 GETGBL R3 G12
- 0x5C100000, // 0003 MOVE R4 R0
- 0x7C0C0200, // 0004 CALL R3 1
- 0x040C0701, // 0005 SUB R3 R3 K1
- 0x400E0203, // 0006 CONNECT R3 K1 R3
- 0x7C080200, // 0007 CALL R2 1
- 0xA8020010, // 0008 EXBLK 0 #001A
- 0x5C0C0400, // 0009 MOVE R3 R2
- 0x7C0C0000, // 000A CALL R3 0
- 0x94100003, // 000B GETIDX R4 R0 R3
- 0x5C140600, // 000C MOVE R5 R3
- 0x24180B02, // 000D GT R6 R5 K2
- 0x781A0008, // 000E JMPF R6 #0018
- 0x04180B01, // 000F SUB R6 R5 K1
- 0x94180006, // 0010 GETIDX R6 R0 R6
- 0x24180C04, // 0011 GT R6 R6 R4
- 0x781A0004, // 0012 JMPF R6 #0018
- 0x04180B01, // 0013 SUB R6 R5 K1
- 0x94180006, // 0014 GETIDX R6 R0 R6
- 0x98000A06, // 0015 SETIDX R0 R5 R6
- 0x04140B01, // 0016 SUB R5 R5 K1
- 0x7001FFF4, // 0017 JMP #000D
- 0x98000A04, // 0018 SETIDX R0 R5 R4
- 0x7001FFEE, // 0019 JMP #0009
- 0x58080003, // 001A LDCONST R2 K3
- 0xAC080200, // 001B CATCH R2 1 0
- 0xB0080000, // 001C RAISE 2 R0 R0
- 0x80040000, // 001D RET 1 R0
- })
- )
-);
-/*******************************************************************/
-
-
/********************************************************************
** Solidified function: parse_obj
********************************************************************/
@@ -7507,127 +7605,58 @@ be_local_closure(HASPmota_parse_obj, /* name */
/*******************************************************************/
-/********************************************************************
-** Solidified function: event_dispatch
-********************************************************************/
-be_local_closure(HASPmota_event_dispatch, /* name */
- be_nested_proto(
- 9, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[11]) { /* constants */
- /* K0 */ be_nested_str_weak(introspect),
- /* K1 */ be_nested_str_weak(toptr),
- /* K2 */ be_nested_str_weak(event),
- /* K3 */ be_nested_str_weak(_change_buffer),
- /* K4 */ be_nested_str_weak(lv),
- /* K5 */ be_nested_str_weak(lv_event),
- /* K6 */ be_nested_str_weak(user_data),
- /* K7 */ be_const_int(0),
- /* K8 */ be_nested_str_weak(fromptr),
- /* K9 */ be_nested_str_weak(instance),
- /* K10 */ be_nested_str_weak(event_cb),
- }),
- be_str_weak(event_dispatch),
- &be_const_str_solidified,
- ( &(const binstruction[35]) { /* code */
- 0xA40A0000, // 0000 IMPORT R2 K0
- 0x8C0C0501, // 0001 GETMET R3 R2 K1
- 0x5C140200, // 0002 MOVE R5 R1
- 0x7C0C0400, // 0003 CALL R3 2
- 0x88100102, // 0004 GETMBR R4 R0 K2
- 0x78120004, // 0005 JMPF R4 #000B
- 0x88100102, // 0006 GETMBR R4 R0 K2
- 0x8C100903, // 0007 GETMET R4 R4 K3
- 0x5C180600, // 0008 MOVE R6 R3
- 0x7C100400, // 0009 CALL R4 2
- 0x70020004, // 000A JMP #0010
- 0xB8120800, // 000B GETNGBL R4 K4
- 0x8C100905, // 000C GETMET R4 R4 K5
- 0x5C180600, // 000D MOVE R6 R3
- 0x7C100400, // 000E CALL R4 2
- 0x90020404, // 000F SETMBR R0 K2 R4
- 0x88100102, // 0010 GETMBR R4 R0 K2
- 0x88100906, // 0011 GETMBR R4 R4 K6
- 0x60140009, // 0012 GETGBL R5 G9
- 0x5C180800, // 0013 MOVE R6 R4
- 0x7C140200, // 0014 CALL R5 1
- 0x20140B07, // 0015 NE R5 R5 K7
- 0x7816000A, // 0016 JMPF R5 #0022
- 0x8C140508, // 0017 GETMET R5 R2 K8
- 0x5C1C0800, // 0018 MOVE R7 R4
- 0x7C140400, // 0019 CALL R5 2
- 0x60180004, // 001A GETGBL R6 G4
- 0x5C1C0A00, // 001B MOVE R7 R5
- 0x7C180200, // 001C CALL R6 1
- 0x1C180D09, // 001D EQ R6 R6 K9
- 0x781A0002, // 001E JMPF R6 #0022
- 0x8C180B0A, // 001F GETMET R6 R5 K10
- 0x88200102, // 0020 GETMBR R8 R0 K2
- 0x7C180400, // 0021 CALL R6 2
- 0x80000000, // 0022 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
/********************************************************************
** Solidified class: HASPmota
********************************************************************/
be_local_class(HASPmota,
10,
NULL,
- be_nested_map(43,
+ be_nested_map(44,
( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(lvh_textarea, 41), be_const_class(be_class_lvh_textarea) },
- { be_const_key_weak(scr, -1), be_const_var(3) },
- { be_const_key_weak(event_dispatch, 16), be_const_closure(HASPmota_event_dispatch_closure) },
- { be_const_key_weak(lvh_bar, -1), be_const_class(be_class_lvh_bar) },
- { be_const_key_weak(lvh_img, -1), be_const_class(be_class_lvh_img) },
{ be_const_key_weak(event, -1), be_const_var(8) },
- { be_const_key_weak(do_action, 33), be_const_closure(HASPmota_do_action_closure) },
- { be_const_key_weak(pages_list_sorted, -1), be_const_closure(HASPmota_pages_list_sorted_closure) },
- { be_const_key_weak(lvh_btnmatrix, 42), be_const_class(be_class_lvh_btnmatrix) },
- { be_const_key_weak(start, -1), be_const_closure(HASPmota_start_closure) },
- { be_const_key_weak(init, 5), be_const_closure(HASPmota_init_closure) },
+ { be_const_key_weak(parse_obj, 4), be_const_closure(HASPmota_parse_obj_closure) },
{ be_const_key_weak(lvh_scr, -1), be_const_class(be_class_lvh_scr) },
- { be_const_key_weak(parse_page, -1), be_const_closure(HASPmota_parse_page_closure) },
- { be_const_key_weak(register_event, 24), be_const_closure(HASPmota_register_event_closure) },
- { be_const_key_weak(lvh_roller, 34), be_const_class(be_class_lvh_roller) },
- { be_const_key_weak(lvh_page, 11), be_const_class(be_class_lvh_page) },
- { be_const_key_weak(lvh_page_cur_idx, -1), be_const_var(6) },
- { be_const_key_weak(lvh_arc, 12), be_const_class(be_class_lvh_arc) },
- { be_const_key_weak(hres, 38), be_const_var(1) },
- { be_const_key_weak(dark, -1), be_const_var(0) },
- { be_const_key_weak(lvh_label, 37), be_const_class(be_class_lvh_label) },
- { be_const_key_weak(deinit, 14), be_const_closure(HASPmota_deinit_closure) },
- { be_const_key_weak(page_dir_to, -1), be_const_closure(HASPmota_page_dir_to_closure) },
- { be_const_key_weak(parse_obj, -1), be_const_closure(HASPmota_parse_obj_closure) },
- { be_const_key_weak(lvh_spinner, -1), be_const_class(be_class_lvh_spinner) },
- { be_const_key_weak(_load, -1), be_const_closure(HASPmota__load_closure) },
- { be_const_key_weak(lvh_qrcode, -1), be_const_class(be_class_lvh_qrcode) },
- { be_const_key_weak(parse, -1), be_const_closure(HASPmota_parse_closure) },
- { be_const_key_weak(lvh_pages, 2), be_const_var(5) },
- { be_const_key_weak(lvh_line, -1), be_const_class(be_class_lvh_line) },
+ { be_const_key_weak(do_action, 16), be_const_closure(HASPmota_do_action_closure) },
{ be_const_key_weak(lvh_switch, -1), be_const_class(be_class_lvh_switch) },
- { be_const_key_weak(re_page_target, -1), be_const_var(7) },
- { be_const_key_weak(r16, -1), be_const_var(4) },
- { be_const_key_weak(def_templ_name, -1), be_nested_str_weak(pages_X2Ejsonl) },
- { be_const_key_weak(lvh_obj, 19), be_const_class(be_class_lvh_obj) },
- { be_const_key_weak(sort, 23), be_const_static_closure(HASPmota_sort_closure) },
- { be_const_key_weak(lvh_dropdown, -1), be_const_class(be_class_lvh_dropdown) },
- { be_const_key_weak(lvh_checkbox, -1), be_const_class(be_class_lvh_checkbox) },
- { be_const_key_weak(lvh_slider, -1), be_const_class(be_class_lvh_slider) },
- { be_const_key_weak(vres, -1), be_const_var(2) },
- { be_const_key_weak(lvh_btn, -1), be_const_class(be_class_lvh_btn) },
+ { be_const_key_weak(lvh_page, 9), be_const_class(be_class_lvh_page) },
+ { be_const_key_weak(lvh_obj, -1), be_const_class(be_class_lvh_obj) },
+ { be_const_key_weak(register_event, -1), be_const_closure(HASPmota_register_event_closure) },
+ { be_const_key_weak(parse, 35), be_const_closure(HASPmota_parse_closure) },
{ be_const_key_weak(event_cb, -1), be_const_var(9) },
- { be_const_key_weak(get_page_cur, -1), be_const_closure(HASPmota_get_page_cur_closure) },
+ { be_const_key_weak(event_dispatch, -1), be_const_closure(HASPmota_event_dispatch_closure) },
+ { be_const_key_weak(lvh_dropdown, 6), be_const_class(be_class_lvh_dropdown) },
+ { be_const_key_weak(pages_list_sorted, -1), be_const_closure(HASPmota_pages_list_sorted_closure) },
+ { be_const_key_weak(dark, -1), be_const_var(0) },
+ { be_const_key_weak(lvh_roller, 21), be_const_class(be_class_lvh_roller) },
+ { be_const_key_weak(lvh_btnmatrix, 23), be_const_class(be_class_lvh_btnmatrix) },
+ { be_const_key_weak(hres, -1), be_const_var(1) },
+ { be_const_key_weak(sort, -1), be_const_static_closure(HASPmota_sort_closure) },
+ { be_const_key_weak(parse_page, 25), be_const_closure(HASPmota_parse_page_closure) },
+ { be_const_key_weak(lvh_spinner, -1), be_const_class(be_class_lvh_spinner) },
+ { be_const_key_weak(lvh_btn, 39), be_const_class(be_class_lvh_btn) },
+ { be_const_key_weak(r16, -1), be_const_var(4) },
+ { be_const_key_weak(page_show, 20), be_const_closure(HASPmota_page_show_closure) },
+ { be_const_key_weak(scr, 41), be_const_var(3) },
+ { be_const_key_weak(deinit, -1), be_const_closure(HASPmota_deinit_closure) },
+ { be_const_key_weak(lvh_arc, -1), be_const_class(be_class_lvh_arc) },
+ { be_const_key_weak(lvh_pages, -1), be_const_var(5) },
+ { be_const_key_weak(start, 28), be_const_closure(HASPmota_start_closure) },
+ { be_const_key_weak(lvh_bar, -1), be_const_class(be_class_lvh_bar) },
+ { be_const_key_weak(vres, -1), be_const_var(2) },
+ { be_const_key_weak(lvh_textarea, -1), be_const_class(be_class_lvh_textarea) },
+ { be_const_key_weak(init, -1), be_const_closure(HASPmota_init_closure) },
+ { be_const_key_weak(lvh_line, 30), be_const_class(be_class_lvh_line) },
+ { be_const_key_weak(def_templ_name, -1), be_nested_str_weak(pages_X2Ejsonl) },
+ { be_const_key_weak(re_page_target, -1), be_const_var(7) },
+ { be_const_key_weak(lvh_qrcode, -1), be_const_class(be_class_lvh_qrcode) },
+ { be_const_key_weak(lvh_page_cur_idx, -1), be_const_var(6) },
+ { be_const_key_weak(lvh_img, -1), be_const_class(be_class_lvh_img) },
+ { be_const_key_weak(page_dir_to, -1), be_const_closure(HASPmota_page_dir_to_closure) },
+ { be_const_key_weak(_load, -1), be_const_closure(HASPmota__load_closure) },
+ { be_const_key_weak(lvh_label, -1), be_const_class(be_class_lvh_label) },
+ { be_const_key_weak(lvh_checkbox, -1), be_const_class(be_class_lvh_checkbox) },
+ { be_const_key_weak(get_page_cur, 1), be_const_closure(HASPmota_get_page_cur_closure) },
+ { be_const_key_weak(lvh_slider, 0), be_const_class(be_class_lvh_slider) },
})),
be_str_weak(HASPmota)
);
diff --git a/tasmota/berry/haspmota_src/haspmota_core/haspmota.be b/tasmota/berry/haspmota_src/haspmota_core/haspmota.be
index a960af47b..2352c3128 100644
--- a/tasmota/berry/haspmota_src/haspmota_core/haspmota.be
+++ b/tasmota/berry/haspmota_src/haspmota_core/haspmota.be
@@ -1740,12 +1740,19 @@ class HASPmota
#====================================================================
def do_action(lvh_object, event_code)
if event_code != lv.EVENT_CLICKED return end
- var action = lvh_object._action
- var cur_page = self.lvh_pages[self.lvh_page_cur_idx]
- # print("do_action","lvh_object",lvh_object,"action",action,"cur_page",cur_page,self.lvh_page_cur_idx)
+ self.page_show(lvh_object._action)
+ end
+ #====================================================================
+ # Execute a page changing action from string `action`
+ #
+ # Arg1 `action` can be `prev`, `next`, `back` or `p`
+ # Returns: nil
+ #====================================================================
+ def page_show(action)
# action can be `prev`, `next`, `back`, or `p` like `p1`
var to_page = nil
+ var cur_page = self.lvh_pages[self.lvh_page_cur_idx]
var sorted_pages_list = self.pages_list_sorted(self.lvh_page_cur_idx)
if size(sorted_pages_list) <= 1 return end # if only 1 page, do nothing
# handle prev/next/back values
From 6a8435b7313fee41bfdb497984186b63bdcb426b Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Fri, 29 Dec 2023 10:17:10 +0100
Subject: [PATCH 059/303] Berry added `introspect.set()` for class attributes
(#20339)
---
CHANGELOG.md | 1 +
lib/libesp32/berry/src/be_api.c | 4 ++++
lib/libesp32/berry/src/be_introspectlib.c | 2 +-
lib/libesp32/berry/tests/introspect.be | 22 ++++++++++++++++++++++
4 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 759b427a3..d24aea8b2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.
- Display of active drivers using command ``status 4``
- ESP32 used UART information
- HASPmota added `haspmota.page_show()` to change page
+- Berry added `introspect.set()` for class attributes
### Breaking Changed
- Refactoring of Berry `animate` module for WS2812 Leds (#20236)
diff --git a/lib/libesp32/berry/src/be_api.c b/lib/libesp32/berry/src/be_api.c
index ba5b915d2..5cc755929 100644
--- a/lib/libesp32/berry/src/be_api.c
+++ b/lib/libesp32/berry/src/be_api.c
@@ -643,6 +643,10 @@ BERRY_API bbool be_setmember(bvm *vm, int index, const char *k)
bstring *key = be_newstr(vm, k);
bmodule *mod = var_toobj(o);
return be_module_setmember(vm, mod, key, v);
+ } else if (var_isclass(o)) {
+ bstring *key = be_newstr(vm, k);
+ bclass *cl = var_toobj(o);
+ return be_class_setmember(vm, cl, key, v);
}
return bfalse;
}
diff --git a/lib/libesp32/berry/src/be_introspectlib.c b/lib/libesp32/berry/src/be_introspectlib.c
index 4f98f2d94..73e2da466 100644
--- a/lib/libesp32/berry/src/be_introspectlib.c
+++ b/lib/libesp32/berry/src/be_introspectlib.c
@@ -96,7 +96,7 @@ static int m_findmember(bvm *vm)
static int m_setmember(bvm *vm)
{
int top = be_top(vm);
- if (top >= 3 && (be_isinstance(vm, 1) || be_ismodule(vm, 1)) && be_isstring(vm, 2)) {
+ if (top >= 3 && (be_isinstance(vm, 1) || be_ismodule(vm, 1) || be_isclass(vm, 1)) && be_isstring(vm, 2)) {
be_setmember(vm, 1, be_tostring(vm, 2));
be_return(vm);
}
diff --git a/lib/libesp32/berry/tests/introspect.be b/lib/libesp32/berry/tests/introspect.be
index c93033982..1d9c7af29 100644
--- a/lib/libesp32/berry/tests/introspect.be
+++ b/lib/libesp32/berry/tests/introspect.be
@@ -42,3 +42,25 @@ assert(introspect.name(A) == 'A')
assert(introspect.name(A.a) == 'a')
assert(introspect.name(A.b) == 'b')
assert(introspect.name(A.c) == nil)
+
+# test introspect get and set
+# class and instance
+class A
+ static var a
+ var b
+end
+
+a = A()
+introspect.set(A, "a", 10)
+assert(A.a == 10)
+assert(introspect.get(A, "a") == 10)
+
+introspect.set(a, "b", 20)
+assert(a.b == 20)
+assert(introspect.get(a, "b") == 20)
+
+# module
+m = module('m')
+introspect.set(m, 'c', 30)
+assert(m.c == 30)
+assert(introspect.get(m, 'c') == 30)
From 4393327bb9929baae856df3a432073f27ae9ec59 Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Fri, 29 Dec 2023 22:54:32 +0100
Subject: [PATCH 060/303] Add support negative power on BL0942 using index 5..8
(#20322)
---
CHANGELOG.md | 5 +++--
RELEASENOTES.md | 3 +++
tasmota/include/tasmota_template.h | 2 +-
.../tasmota_xnrg_energy/xnrg_14_bl09xx.ino | 19 +++++++++++++------
4 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d24aea8b2..b34fad6bb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,8 +11,9 @@ All notable changes to this project will be documented in this file.
- Matter support for password for remote Tasmota devices (#20296)
- Display of active drivers using command ``status 4``
- ESP32 used UART information
-- HASPmota added `haspmota.page_show()` to change page
-- Berry added `introspect.set()` for class attributes
+- HASPmota added `haspmota.page_show()` to change page (#20333)
+- Berry added `introspect.set()` for class attributes (#20339)
+- Support negative power on BL0942 using index 5..8 (#20322)
### Breaking Changed
- Refactoring of Berry `animate` module for WS2812 Leds (#20236)
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 9fe82cdde..a526e6cbe 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -122,7 +122,10 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- Support for Sonoff Basic R4 Magic Switch [#20247](https://github.com/arendst/Tasmota/issues/20247)
- Display of active drivers using command ``status 4``
- NeoPool hydrolysis FL1 and Redox flag [#20258](https://github.com/arendst/Tasmota/issues/20258)
+- Support negative power on BL0942 using index 5..8 [#20322](https://github.com/arendst/Tasmota/issues/20322)
- ESP32 used UART information
+- Berry added `introspect.set()` for class attributes [#20339](https://github.com/arendst/Tasmota/issues/20339)
+- HASPmota added `haspmota.page_show()` to change page [#20333](https://github.com/arendst/Tasmota/issues/20333)
- Matter support for password for remote Tasmota devices [#20296](https://github.com/arendst/Tasmota/issues/20296)
### Breaking Changed
diff --git a/tasmota/include/tasmota_template.h b/tasmota/include/tasmota_template.h
index 63779e918..1d09cb47b 100644
--- a/tasmota/include/tasmota_template.h
+++ b/tasmota/include/tasmota_template.h
@@ -496,7 +496,7 @@ const char kSensorNamesFixed[] PROGMEM =
#define MAX_BP1658CJ_DAT 16
#define MAX_DINGTIAN_SHIFT 4
#define MAX_MAGIC_SWITCH_MODES 2
-#define MAX_BL0942_RX 4 // Baudrates 1 (4800), 2 (9600), 3 (19200), 4 (38400)
+#define MAX_BL0942_RX 8 // Baudrates 1/5 (4800), 2/6 (9600), 3/7 (19200), 4/8 (38400), Support Positive values only 1..4, Support also negative values 5..8
const uint16_t kGpioNiceList[] PROGMEM = {
GPIO_NONE, // Not used
diff --git a/tasmota/tasmota_xnrg_energy/xnrg_14_bl09xx.ino b/tasmota/tasmota_xnrg_energy/xnrg_14_bl09xx.ino
index af1f0f6fc..da66a5cf4 100644
--- a/tasmota/tasmota_xnrg_energy/xnrg_14_bl09xx.ino
+++ b/tasmota/tasmota_xnrg_energy/xnrg_14_bl09xx.ino
@@ -102,6 +102,7 @@ struct BL09XX {
uint8_t address = 0;
uint8_t model = 0;
uint8_t rx_pin;
+ bool support_negative = 0;
bool received = false;
} Bl09XX;
@@ -187,11 +188,15 @@ bool Bl09XXDecode42(void) {
Bl09XX.voltage = Bl09XX.rx_buffer[6] << 16 | Bl09XX.rx_buffer[5] << 8 | Bl09XX.rx_buffer[4]; // V_RMS unsigned
Bl09XX.current[0] = Bl09XX.rx_buffer[3] << 16 | Bl09XX.rx_buffer[2] << 8 | Bl09XX.rx_buffer[1]; // IA_RMS unsigned
-// Bl09XX.power[0] = Bl09XX.rx_buffer[12] << 16 | Bl09XX.rx_buffer[11] << 8 | Bl09XX.rx_buffer[10]; // WATT_A signed
-// if (bitRead(Bl09XX.power[0], 23)) { Bl09XX.power[0] |= 0xFF000000; } // Extend sign bit
- // Above reverted in favour of https://github.com/arendst/Tasmota/issues/15374#issuecomment-1105293179
- int32_t tmp = Bl09XX.rx_buffer[12] << 24 | Bl09XX.rx_buffer[11] << 16 | Bl09XX.rx_buffer[10] << 8; // WATT_A signed
- Bl09XX.power[0] = abs(tmp >> 8);
+
+ if (Bl09XX.support_negative) {
+ Bl09XX.power[0] = Bl09XX.rx_buffer[12] << 16 | Bl09XX.rx_buffer[11] << 8 | Bl09XX.rx_buffer[10]; // WATT_A signed
+ if (bitRead(Bl09XX.power[0], 23)) { Bl09XX.power[0] |= 0xFF000000; } // Extend sign bit
+ // Above reverted in favour of https://github.com/arendst/Tasmota/issues/15374#issuecomment-1105293179
+ } else {
+ int32_t tmp = Bl09XX.rx_buffer[12] << 24 | Bl09XX.rx_buffer[11] << 16 | Bl09XX.rx_buffer[10] << 8; // WATT_A signed
+ Bl09XX.power[0] = abs(tmp >> 8);
+ }
#ifdef DEBUG_BL09XX
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("BL9: U %d, I %d, P %d"),
@@ -361,7 +366,9 @@ void Bl09XXPreInit(void) {
else if (PinUsed(GPIO_BL0942_RX, GPIO_ANY)) {
Bl09XX.model = BL0942_MODEL;
Bl09XX.rx_pin = Pin(GPIO_BL0942_RX, GPIO_ANY);
- uint32_t baudrate = GetPin(Bl09XX.rx_pin) - AGPIO(GPIO_BL0942_RX); // 0 .. 3
+ uint32_t option = GetPin(Bl09XX.rx_pin) - AGPIO(GPIO_BL0942_RX); // 0 .. 7
+ Bl09XX.support_negative = (option > 3); // 4 .. 7
+ uint32_t baudrate = option & 0x3; // 0 .. 3 and 4 .. 7
Bl09XX.baudrate <<= baudrate; // Support 1 (4800), 2 (9600), 3 (19200), 4 (38400)
}
if (Bl09XX.model != BL09XX_MODEL) {
From a0f6b7f1a31f39703262d00a99c488c298b78351 Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Fri, 29 Dec 2023 23:10:26 +0100
Subject: [PATCH 061/303] Relax checks of Partition Wizard for newest Shelly
(#20349)
---
CHANGELOG.md | 1 +
tasmota/berry/modules/Partition_Wizard.tapp | Bin 35678 -> 35680 bytes
.../Partition_Wizard/partition_wizard.be | 4 ++--
.../Partition_Wizard/partition_wizard.bec | Bin 16720 -> 16661 bytes
4 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b34fad6bb..ce8b3922a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file.
### Changed
- Support syslog updates every sleep or every second if `#define SYSLOG_UPDATE_SECOND` (#20260)
- Moved Berry animate to its own `berry_animate` lib (#20309)
+- Relax checks of Partition Wizard for newest Shelly
### Fixed
- Matter Contact sensor was not triggering any update (#20232)
diff --git a/tasmota/berry/modules/Partition_Wizard.tapp b/tasmota/berry/modules/Partition_Wizard.tapp
index 1f4e94e0a28bc106209cb68eda6653e3ebb4c616..8198ccd14cac3222ccbec601defb071169aa4c85 100644
GIT binary patch
delta 114
zcmcaNjp@NOrU^zYwr+Z<6U`codlt?Ozg?{$v%Hgm0fdDaWEct(i%K#}GV}A|%QLGI
zi&FHGQbR*H8JNYT`coyO`ZvBj<~dp4o@?`VFBb=16ayx6bnAkYO}6M(U|Z0|00aOq
C=_eon
delta 93
zcmaDbjp^PrrU^zY)l1$bO*Cr|UcJ*PJjeS(;nGe91`rlzkeMvkEyl&kz+7Y`omyff
hz47HS&&?aXd>nXD)K2E=)&(h (self.app_size_min * 1024) raise "internal_error", "safeboot is too large "+str(safeboot_size / 1024)+"kB" end
tasmota.log(string.format("UPL: flashing `safeboot` from %s %ikB", safeboot_url, (safeboot_size / 1024) + 1), 2)
var app0 = p.get_ota_slot(0)
- if app0.start != 0x10000 raise "internal_error", "`app0` offset is not 0x10000" end
+ # if app0.start != 0x10000 raise "internal_error", "`app0` offset is not 0x10000" end
cl.write_flash(app0.start)
cl.close()
return true
diff --git a/tasmota/berry/modules/Partition_Wizard/partition_wizard.bec b/tasmota/berry/modules/Partition_Wizard/partition_wizard.bec
index e6e82953351dc4f9cefc1fa6255d1485af6aa58d..3f884314cae6823852fe0e93558d63d085cbed6f 100644
GIT binary patch
delta 412
zcmZ{fy-EW?5P)ZI_bz+6&CkU(Ug9OJ;f$a*3W8N)Wo2P;U>Tz*3Ko(a81xEBwO|S{
zm!}X!+$XTM@c{%|U&6#qQadnwGsAwv&SxKu`snr6LMQ6Zx<36msSo>wmFl6*0-DPSY3BvdYV|Si2)#oL
zpNdB%U;a*3LYnoHQf@Yl)2{FUYRXvp%AyDLz50v-7s@>gdvZLfgem4F3mIRsjF8%c
z39e0jrry?C=^fL64CugAKhA`h&;)=TV8Vn6*&Z^P9OFVrET+X78CYt6`^Pz@29*9$
zU9AFU`mgR(O`1>$QHo0=<>^bj*h+I4<8nCVWKPzAdEcCqnKVz;sIh^NJ$!HOZgFk$
n*nwh%Z7zw!1%+Y{VJ=OF4;c8z2nz{@A6q$}0O4wVua5ozLFQG?
delta 471
zcmZ{fK}sV*6oy}=x;xdKYEx-3R5ER*7~0sVizo`N%mrpKiv~f2Bn#sR!x&71L3<%C
zq!w8SM(_@b2z3xWfCq5r2~7K(tmi@Tzgm2J|GT{;FPG%$%pr&7+!>HoCDM7ml6XO+
z0Ggw4-g#OqMdNRkH4RpjHE@SQl;QgYfpziS6j??#Z5XD#lT?Jz?F|O4t~&1bhX<)T
z8mhm?scMbZTR5Twrzc10L8t$xH~ekx+(%wR6^~iD9BEX7+h|;inc}8X-K{D8kuN2#
z2q(32jN&-+7GepoVxFt7b7X8DmhMR$Kz-y;si*m3QsivyNV`HoPMgRp4kFw)
z=gS>$%PD{lIFupaC)8pS0P)kZgt8$R5nJdfttK`T2>(kC%#=6YN{3zn>i
Date: Sat, 30 Dec 2023 18:14:56 +1000
Subject: [PATCH 062/303] don't send commands to the AC while reading data from
the AC. (#20352)
on some units it can take around 250ms to reply to a request, by which
time we're shoving another command to the unit. if this happens, the
unit gives up and starts replying to the new command, which can again
take 250ms. in this situation effectively nothing gets through.
avoid this by checking if we're in the parser state machine. this also
gives us timeout handling.
tested on 4 different AC units. one which was unusable before is now
functioning as expected, and the other 3 appear just as functional as
they were before.
---
tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino b/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino
index 36baa3749..a51166ae6 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino
@@ -329,6 +329,7 @@ enum miel_hvac_parser_state {
struct miel_hvac_parser {
enum miel_hvac_parser_state
p_state;
+ uint8_t p_tmo;
uint8_t p_type;
uint8_t p_sum;
uint8_t p_len;
@@ -386,6 +387,7 @@ miel_hvac_parse(struct miel_hvac_softc *sc, uint8_t byte)
/* reset state */
p->p_sum = 0;
+ p->p_tmo = 0;
nstate = MIEL_HVAC_P_TYPE;
break;
@@ -1234,8 +1236,20 @@ miel_hvac_tick(struct miel_hvac_softc *sc)
MIEL_HVAC_REQUEST_STAGE,
};
+ struct miel_hvac_parser *p = &sc->sc_parser;
unsigned int i;
+ if (p->p_state != MIEL_HVAC_P_START) {
+ if (p->p_tmo) {
+ AddLog(LOG_LEVEL_DEBUG, PSTR(MIEL_HVAC_LOGNAME
+ ": read timeout"));
+ sc->sc_parser.p_state = MIEL_HVAC_P_START;
+ } else {
+ p->p_tmo = 1;
+ return;
+ }
+ }
+
if (miel_hvac_update_pending(sc)) {
struct miel_hvac_msg_update *update = &sc->sc_update;
From 2de3d427deb60e4d931f3bc3f95ec97682518bc2 Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Sat, 30 Dec 2023 10:29:30 +0100
Subject: [PATCH 063/303] LVGL fix type for lv_imgbtn (#20354)
---
CHANGELOG.md | 1 +
lib/libesp32_lvgl/lv_binding_berry/generate/be_lv_c_mapping.h | 4 ++--
lib/libesp32_lvgl/lv_binding_berry/tools/convert.py | 2 ++
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ce8b3922a..614794a2c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -30,6 +30,7 @@ All notable changes to this project will be documented in this file.
- Syslog server warning caused by lack of field and hostname starting with 'z' (#14689)
- Support for Domoticz floor/room topics. Regression from v12.0.1 (#20299)
- Berry claiming UART0 if needed (#20324)
+- LVGL fix type for lv_imgbtn
### Removed
diff --git a/lib/libesp32_lvgl/lv_binding_berry/generate/be_lv_c_mapping.h b/lib/libesp32_lvgl/lv_binding_berry/generate/be_lv_c_mapping.h
index 18ca143e1..aacce81e8 100644
--- a/lib/libesp32_lvgl/lv_binding_berry/generate/be_lv_c_mapping.h
+++ b/lib/libesp32_lvgl/lv_binding_berry/generate/be_lv_c_mapping.h
@@ -651,8 +651,8 @@ const be_ntv_func_def_t lv_colorwheel_func[] = {
/* `lv_imgbtn` methods */
#ifdef BE_LV_WIDGET_IMGBTN
const be_ntv_func_def_t lv_imgbtn_func[] = {
- { "set_src", { (const void*) &lv_imgbtn_set_src, "", "(lv.lv_obj)(lv.lv_imgbtn_state)..." } },
- { "set_state", { (const void*) &lv_imgbtn_set_state, "", "(lv.lv_obj)(lv.lv_imgbtn_state)" } },
+ { "set_src", { (const void*) &lv_imgbtn_set_src, "", "(lv.lv_obj)i..." } },
+ { "set_state", { (const void*) &lv_imgbtn_set_state, "", "(lv.lv_obj)i" } },
};
#endif // BE_LV_WIDGET_IMGBTN
diff --git a/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py b/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py
index 8089c817e..3b69f8a44 100644
--- a/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py
+++ b/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py
@@ -124,6 +124,8 @@ return_types = {
"lv_anim_path_cb_t": "c",
"lv_anim_ready_cb_t": "c",
"lv_anim_start_cb_t": "c",
+ # lv_imgbtn
+ "lv_imgbtn_state_t": "i",
# arrays
"constchar * []": "str_arr",
From a38f86905278ce08dac01f385033ad84d9eb38c1 Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Sat, 30 Dec 2023 11:23:26 +0100
Subject: [PATCH 064/303] Fix other LVGL conversion to int (#20355)
---
.../generate/be_lv_c_mapping.h | 20 +++++++++----------
.../lv_binding_berry/tools/convert.py | 6 ++++++
2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/lib/libesp32_lvgl/lv_binding_berry/generate/be_lv_c_mapping.h b/lib/libesp32_lvgl/lv_binding_berry/generate/be_lv_c_mapping.h
index aacce81e8..44bdaf460 100644
--- a/lib/libesp32_lvgl/lv_binding_berry/generate/be_lv_c_mapping.h
+++ b/lib/libesp32_lvgl/lv_binding_berry/generate/be_lv_c_mapping.h
@@ -561,7 +561,7 @@ const be_ntv_func_def_t lv_group_func[] = {
{ "set_edge_cb", { (const void*) &lv_group_set_edge_cb, "", "(lv.lv_group)^lv_group_edge_cb^" } },
{ "set_editing", { (const void*) &lv_group_set_editing, "", "(lv.lv_group)b" } },
{ "set_focus_cb", { (const void*) &lv_group_set_focus_cb, "", "(lv.lv_group)^lv_group_focus_cb^" } },
- { "set_refocus_policy", { (const void*) &lv_group_set_refocus_policy, "", "(lv.lv_group)(lv.lv_group_refocus_policy)" } },
+ { "set_refocus_policy", { (const void*) &lv_group_set_refocus_policy, "", "(lv.lv_group)i" } },
{ "set_wrap", { (const void*) &lv_group_set_wrap, "", "(lv.lv_group)b" } },
{ "swap_obj", { (const void*) &lv_group_swap_obj, "", "(lv.lv_obj)(lv.lv_obj)" } },
};
@@ -818,15 +818,15 @@ const be_ntv_func_def_t lv_btn_func[] = {
/* `lv_btnmatrix` methods */
#ifdef BE_LV_WIDGET_BTNMATRIX
const be_ntv_func_def_t lv_btnmatrix_func[] = {
- { "clear_btn_ctrl", { (const void*) &lv_btnmatrix_clear_btn_ctrl, "", "(lv.lv_obj)i(lv.lv_btnmatrix_ctrl)" } },
- { "clear_btn_ctrl_all", { (const void*) &lv_btnmatrix_clear_btn_ctrl_all, "", "(lv.lv_obj)(lv.lv_btnmatrix_ctrl)" } },
+ { "clear_btn_ctrl", { (const void*) &lv_btnmatrix_clear_btn_ctrl, "", "(lv.lv_obj)ii" } },
+ { "clear_btn_ctrl_all", { (const void*) &lv_btnmatrix_clear_btn_ctrl_all, "", "(lv.lv_obj)i" } },
{ "get_btn_text", { (const void*) &lv_btnmatrix_get_btn_text, "s", "(lv.lv_obj)i" } },
{ "get_map", { (const void*) &lv_btnmatrix_get_map, "c", "(lv.lv_obj)" } },
{ "get_one_checked", { (const void*) &lv_btnmatrix_get_one_checked, "b", "(lv.lv_obj)" } },
{ "get_selected_btn", { (const void*) &lv_btnmatrix_get_selected_btn, "i", "(lv.lv_obj)" } },
- { "has_btn_ctrl", { (const void*) &lv_btnmatrix_has_btn_ctrl, "b", "(lv.lv_obj)i(lv.lv_btnmatrix_ctrl)" } },
- { "set_btn_ctrl", { (const void*) &lv_btnmatrix_set_btn_ctrl, "", "(lv.lv_obj)i(lv.lv_btnmatrix_ctrl)" } },
- { "set_btn_ctrl_all", { (const void*) &lv_btnmatrix_set_btn_ctrl_all, "", "(lv.lv_obj)(lv.lv_btnmatrix_ctrl)" } },
+ { "has_btn_ctrl", { (const void*) &lv_btnmatrix_has_btn_ctrl, "b", "(lv.lv_obj)ii" } },
+ { "set_btn_ctrl", { (const void*) &lv_btnmatrix_set_btn_ctrl, "", "(lv.lv_obj)ii" } },
+ { "set_btn_ctrl_all", { (const void*) &lv_btnmatrix_set_btn_ctrl_all, "", "(lv.lv_obj)i" } },
{ "set_btn_width", { (const void*) &lv_btnmatrix_set_btn_width, "", "(lv.lv_obj)ii" } },
{ "set_ctrl_map", { (const void*) &lv_btnmatrix_set_ctrl_map, "", "(lv.lv_obj)(lv.lv_btnmatrix_ctrl)" } },
{ "set_map", { (const void*) &lv_btnmatrix_set_map, "", "(lv.lv_obj)(lv.str_arr)" } },
@@ -935,7 +935,7 @@ const be_ntv_func_def_t lv_roller_func[] = {
{ "get_options", { (const void*) &lv_roller_get_options, "s", "(lv.lv_obj)" } },
{ "get_selected", { (const void*) &lv_roller_get_selected, "i", "(lv.lv_obj)" } },
{ "get_selected_str", { (const void*) &lv_roller_get_selected_str, "", "(lv.lv_obj)ci" } },
- { "set_options", { (const void*) &lv_roller_set_options, "", "(lv.lv_obj)s(lv.lv_roller_mode)" } },
+ { "set_options", { (const void*) &lv_roller_set_options, "", "(lv.lv_obj)si" } },
{ "set_selected", { (const void*) &lv_roller_set_selected, "", "(lv.lv_obj)ii" } },
{ "set_visible_row_count", { (const void*) &lv_roller_set_visible_row_count, "", "(lv.lv_obj)i" } },
};
@@ -966,15 +966,15 @@ const be_ntv_func_def_t lv_switch_func[] = {
/* `lv_table` methods */
#ifdef BE_LV_WIDGET_TABLE
const be_ntv_func_def_t lv_table_func[] = {
- { "add_cell_ctrl", { (const void*) &lv_table_add_cell_ctrl, "", "(lv.lv_obj)ii(lv.lv_table_cell_ctrl)" } },
- { "clear_cell_ctrl", { (const void*) &lv_table_clear_cell_ctrl, "", "(lv.lv_obj)ii(lv.lv_table_cell_ctrl)" } },
+ { "add_cell_ctrl", { (const void*) &lv_table_add_cell_ctrl, "", "(lv.lv_obj)iii" } },
+ { "clear_cell_ctrl", { (const void*) &lv_table_clear_cell_ctrl, "", "(lv.lv_obj)iii" } },
{ "get_cell_user_data", { (const void*) &lv_table_get_cell_user_data, ".", "(lv.lv_obj)ii" } },
{ "get_cell_value", { (const void*) &lv_table_get_cell_value, "s", "(lv.lv_obj)ii" } },
{ "get_col_cnt", { (const void*) &lv_table_get_col_cnt, "i", "(lv.lv_obj)" } },
{ "get_col_width", { (const void*) &lv_table_get_col_width, "i", "(lv.lv_obj)i" } },
{ "get_row_cnt", { (const void*) &lv_table_get_row_cnt, "i", "(lv.lv_obj)" } },
{ "get_selected_cell", { (const void*) &lv_table_get_selected_cell, "", "(lv.lv_obj)(lv.uint16)(lv.uint16)" } },
- { "has_cell_ctrl", { (const void*) &lv_table_has_cell_ctrl, "b", "(lv.lv_obj)ii(lv.lv_table_cell_ctrl)" } },
+ { "has_cell_ctrl", { (const void*) &lv_table_has_cell_ctrl, "b", "(lv.lv_obj)iii" } },
{ "set_cell_user_data", { (const void*) &lv_table_set_cell_user_data, "", "(lv.lv_obj)ii." } },
{ "set_cell_value", { (const void*) &lv_table_set_cell_value, "", "(lv.lv_obj)iis" } },
{ "set_cell_value_fmt", { (const void*) &lv_table_set_cell_value_fmt, "", "(lv.lv_obj)iis[......]" } },
diff --git a/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py b/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py
index 3b69f8a44..0e7dc1c3b 100644
--- a/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py
+++ b/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py
@@ -126,6 +126,12 @@ return_types = {
"lv_anim_start_cb_t": "c",
# lv_imgbtn
"lv_imgbtn_state_t": "i",
+ # lv_btnmatrix
+ "lv_btnmatrix_ctrl_t": "i",
+
+ "lv_group_refocus_policy_t": "i",
+ "lv_roller_mode_t": "i",
+ "lv_table_cell_ctrl_t": "i",
# arrays
"constchar * []": "str_arr",
From 9194ac6c9424b667f71094c2e4452acb82a3ab01 Mon Sep 17 00:00:00 2001
From: gemu
Date: Sat, 30 Dec 2023 13:20:33 +0100
Subject: [PATCH 065/303] max variables > 256 (#20358)
---
.../tasmota_xdrv_driver/xdrv_10_scripter.ino | 138 ++++++++++++++----
1 file changed, 106 insertions(+), 32 deletions(-)
diff --git a/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino b/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino
index 63730602f..0049e0a30 100755
--- a/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino
@@ -70,9 +70,13 @@ const uint8_t SCRIPT_VERS[2] = {5, 2};
#endif // USE_SML_M
#ifndef MAXFILT
-#define MAXFILT 5
+#define MAXFILT 10
#endif
+
+#ifndef SCRIPT_SVARSIZE
#define SCRIPT_SVARSIZE 20
+#endif
+
#ifndef SCRIPT_MAXSSIZE
#define SCRIPT_MAXSSIZE 48
#endif
@@ -156,6 +160,7 @@ char *Get_esc_char(char *cp, char *esc_chr);
#define MAX_EXT_ARRAYS 5
#endif
+
#ifndef STASK_PRIO
#define STASK_PRIO 1
#endif
@@ -335,10 +340,18 @@ typedef union {
};
} SCRIPT_TYPE;
+
+#if 1
+struct T_INDEX {
+ uint16_t index;
+ SCRIPT_TYPE bits;
+};
+#else
struct T_INDEX {
uint8_t index;
SCRIPT_TYPE bits;
};
+#endif
struct M_FILT {
#ifdef LARGE_ARRAYS
@@ -479,7 +492,7 @@ struct SCRIPT_MEM {
uint16_t script_size;
uint8_t *script_pram;
uint16_t script_pram_size;
- uint8_t numvars;
+ uint16_t numvars;
uint8_t arres;
void *script_mem;
uint16_t script_mem_size;
@@ -627,7 +640,7 @@ void ScriptEverySecond(void) {
struct T_INDEX *vtp = glob_script_mem.type;
TS_FLOAT delta = (millis() - glob_script_mem.script_lastmillis) / 1000.0;
glob_script_mem.script_lastmillis = millis();
- for (uint8_t count=0; count 1) cpos -= 2;
// now seek back to last line
- uint8_t lbuff[256];
+ uint8_t lbuff[FEXT_MAX_LINE_LENGTH];
uint8_t iob;
uint16_t index = sizeof(lbuff) -1;
fp->seek(cpos - sizeof(lbuff), SeekSet);
@@ -1928,6 +1945,9 @@ int32_t extract_from_file(File *fp, char *ts_from, char *ts_to, int8_t coffs, T
uint8_t buff[2], iob;
fp->read(buff, 1);
iob = buff[0];
+ TS_FLOAT fval;
+ uint16_t curpos;
+
if (iob == '\t' || iob == ',' || iob == '\n' || iob == '\r') {
rstr[sindex] = 0;
sindex = 0;
@@ -1964,10 +1984,11 @@ int32_t extract_from_file(File *fp, char *ts_from, char *ts_to, int8_t coffs, T
} else {
// data columns
if (range) {
- uint8_t curpos = colpos - coffs;
+ curpos = colpos - coffs;
if (colpos >= coffs && curpos < numa) {
if (a_len[curpos]) {
- TS_FLOAT fval = CharToFloat(rstr);
+ fval = CharToFloat(rstr);
+nextcol:
uint8_t flg = 1;
if ((mflg[curpos] & 1) == 1) {
// absolute values, build diffs
@@ -2008,12 +2029,20 @@ int32_t extract_from_file(File *fp, char *ts_from, char *ts_to, int8_t coffs, T
}
colpos++;
if (iob == '\n' || iob == '\r') {
- lastpos = fp->position();
- colpos = 0;
- lines ++;
- if (lines == 1) {
- if (ipos) {
- fp->seek(ipos, SeekSet);
+ // end of line
+ if (colpos <= numa) {
+ // empty column
+ curpos = colpos - coffs;
+ fval = 0;
+ goto nextcol;
+ } else {
+ lastpos = fp->position();
+ colpos = 0;
+ lines ++;
+ if (lines == 1) {
+ if (ipos) {
+ fp->seek(ipos, SeekSet);
+ }
}
}
}
@@ -2315,7 +2344,7 @@ uint32_t match_vars(char *dvnam, TS_FLOAT **fp, char **sp, uint32_t *ind) {
uint8_t slen = strlen(cp);
if (slen == olen && *cp == dvnam[0]) {
if (!strncmp(cp, dvnam, olen)) {
- uint8_t index = vtp[count].index;
+ uint16_t index = vtp[count].index;
if (vtp[count].bits.is_string == 0) {
if (vtp[count].bits.is_filter) {
// error
@@ -2852,7 +2881,17 @@ chknext:
SCRIPT_SKIP_SPACES
uint16_t alens;
TS_FLOAT *fps;
+ char *slp = lp;
lp = get_array_by_name(lp, &fps, &alens, 0);
+ if (lp == 0 || fps == 0) {
+ lp = slp;
+ lp = GetNumericArgument(lp, OPER_EQU, &fvar, 0);
+ for (uint32_t cnt = 0; cnt < alend; cnt++ ) {
+ fpd[cnt] = fvar;
+ }
+ fvar = alend;
+ goto nfuncexit;
+ }
SCRIPT_SKIP_SPACES
if (alens < alend) {
alend = alens;
@@ -2983,7 +3022,7 @@ chknext:
uint8_t vtype;
lp = isvar(lp + 4, &vtype, &ind, 0, 0, gv);
if (!ind.bits.constant) {
- uint8_t index = glob_script_mem.type[ind.index].index;
+ uint16_t index = glob_script_mem.type[ind.index].index;
fvar = glob_script_mem.fvars[index] != glob_script_mem.s_fvars[index];
glob_script_mem.s_fvars[index] = glob_script_mem.fvars[index];
} else {
@@ -3145,7 +3184,7 @@ extern void W8960_SetGain(uint8_t sel, uint16_t value);
uint8_t vtype;
lp = isvar(lp + 5, &vtype, &ind, 0, 0, gv);
if (!ind.bits.constant) {
- uint8_t index = glob_script_mem.type[ind.index].index;
+ uint16_t index = glob_script_mem.type[ind.index].index;
fvar = glob_script_mem.fvars[index] - glob_script_mem.s_fvars[index];
glob_script_mem.s_fvars[index] = glob_script_mem.fvars[index];
} else {
@@ -3341,7 +3380,7 @@ extern void W8960_SetGain(uint8_t sel, uint16_t value);
if (!strncmp_XP(lp, XPSTR("fr("), 3)) {
struct T_INDEX ind;
uint8_t vtype;
- uint8_t sindex = 0;
+ uint16_t sindex = 0;
lp = isvar(lp + 3, &vtype, &ind, 0, 0, gv);
if (vtype != VAR_NV) {
// found variable as result
@@ -4934,7 +4973,7 @@ extern char *SML_GetSVal(uint32_t index);
fvar = -1;
} else {
// string result
- uint8_t sindex = glob_script_mem.type[ind.index].index;
+ uint16_t sindex = glob_script_mem.type[ind.index].index;
char *cp = glob_script_mem.glob_snp + (sindex * glob_script_mem.max_ssize);
fvar = SML_Set_WStr(fvar1, cp);
}
@@ -4957,6 +4996,14 @@ extern char *SML_GetSVal(uint32_t index);
SML_Decode(fvar - 1);
goto nfuncexit;
}
+ if (!strncmp_XP(lp, XPSTR("smls("), 5)) {
+ TS_FLOAT meter;
+ lp = GetNumericArgument(lp + 5, OPER_EQU, &meter, gv);
+ if (meter < 1) meter = 1;
+ lp = GetNumericArgument(lp, OPER_EQU, &fvar, gv);
+ SML_Shift_Num(meter - 1, fvar);
+ goto nfuncexit;
+ }
if (!strncmp_XP(lp, XPSTR("smlv["), 5)) {
lp = GetNumericArgument(lp + 5, OPER_EQU, &fvar, gv);
fvar = sml_getv(fvar);
@@ -6424,7 +6471,7 @@ extern "C" {
int32_t UpdVar(char *vname, float *fvar, uint32_t mode) {
uint8_t type;
- uint8_t index;
+ uint16_t index;
if (*vname == '@') {
vname++;
type = *vname;
@@ -8304,9 +8351,9 @@ void Scripter_save_pvars(void) {
TS_FLOAT *fp = (TS_FLOAT*)glob_script_mem.script_pram;
mlen+=sizeof(TS_FLOAT);
struct T_INDEX *vtp = glob_script_mem.type;
- for (uint8_t count = 0; count 0) {
@@ -10537,7 +10584,7 @@ uint16_t cipos = 0;
lp = isvar(lp, &vtype, &ind, &sysvar, 0, 0);
if (vtype != VAR_NV) {
SCRIPT_SKIP_SPACES
- uint8_t index = glob_script_mem.type[ind.index].index;
+ uint16_t index = glob_script_mem.type[ind.index].index;
if ((vtype & STYPE) == 0) {
// numeric result
//Serial.printf("numeric %d - %d \n",ind.index,index);
@@ -10631,6 +10678,8 @@ uint32_t cnt;
#define WSO_FORCEPLAIN 4
#define WSO_FORCEMAIN 8
#define WSO_FORCEGUI 16
+#define WSO_FORCETAB 32
+#define WSO_FORCESUBFILE 64
#define WSO_STOP_DIV 0x80
void WCS_DIV(uint8_t flag) {
@@ -10731,7 +10780,7 @@ void ScriptWebShow(char mc, uint8_t page) {
//goto nextwebline;
} else if (!strncmp(lp, "%/", 2)) {
// send file
- if (mc) {
+ if (mc || (specopt & WSO_FORCESUBFILE)) {
web_send_file(mc, lp + 1);
}
} else {
@@ -10775,6 +10824,9 @@ int32_t web_send_file(char mc, char *fname) {
// skip comment lines
continue;
}
+ if (*lp == ';') {
+ // continue;
+ }
web_send_line(mc, lbuff);
}
file.close();
@@ -10814,6 +10866,15 @@ const char *gc_str;
bool dogui = ((!mc && (*lin != '$')) || (mc == 'w' && (*lin != '$'))) && (!(specopt & WSO_FORCEMAIN));
+ if (!strncmp(lin, "%=#", 3)) {
+ // subroutine
+ uint8_t sflg = specopt;
+ specopt = WSO_FORCEPLAIN;
+ lin = scripter_sub(lin + 1, 0);
+ specopt = sflg;
+ return lin;
+ }
+
if ((dogui && !(specopt & WSO_FORCEGUI)) || (!dogui && (specopt & WSO_FORCEGUI))) {
//if ( ((!mc && (*lin != '$')) || (mc == 'w' && (*lin != '$'))) && (!(specopt & WSO_FORCEMAIN)) || (specopt & WSO_FORCEGUI)) {
// normal web section
@@ -11208,13 +11269,17 @@ const char *gc_str;
lp++;
} else {
- if (mc == 'w' || (specopt & WSO_FORCEPLAIN)) {
- WSContentSend_P(PSTR("%s"), lin);
+ if (specopt & WSO_FORCETAB) {
+ WSContentSend_P(PSTR("{s}%s{e}"), lin);
} else {
- if (optflg) {
- WSContentSend_P(PSTR("%s
"), lin);
+ if (mc == 'w' || (specopt & WSO_FORCEPLAIN)) {
+ WSContentSend_P(PSTR("%s"), lin);
} else {
- WSContentSend_P(PSTR("{s}%s{e}"), lin);
+ if (optflg) {
+ WSContentSend_P(PSTR("%s
"), lin);
+ } else {
+ WSContentSend_P(PSTR("{s}%s{e}"), lin);
+ }
}
}
}
@@ -12140,15 +12205,24 @@ int32_t call2pwl(const char *url) {
#endif // TESLA_POWERWALL
+//#ifdef ESP8266
#include "WiFiClientSecureLightBearSSL.h"
+//#else
+//#include
+//#endif //ESP8266
// get https info page json string
uint32_t call2https(const char *host, const char *path) {
//if (TasmotaGlobal.global_state.wifi_down) return 1;
uint32_t status = 0;
+//#ifdef ESP32
+// WiFiClientSecure *httpsClient;
+// httpsClient = new WiFiClientSecure;
+//#else
BearSSL::WiFiClientSecure_light *httpsClient;
httpsClient = new BearSSL::WiFiClientSecure_light(1024, 1024);
+//#endif
httpsClient->setTimeout(2000);
httpsClient->setInsecure();
@@ -13039,7 +13113,7 @@ bool Xdrv10(uint32_t function)
case FUNC_NETWORK_UP:
break;
-
+
case FUNC_ACTIVE:
result = true;
break;
From 92c3261fb002eb7b1dec328bc9ab00718809fe8d Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Sat, 30 Dec 2023 14:59:16 +0100
Subject: [PATCH 066/303] Update changelogs
---
CHANGELOG.md | 4 ++--
RELEASENOTES.md | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 614794a2c..a8b5bd711 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -21,7 +21,7 @@ All notable changes to this project will be documented in this file.
### Changed
- Support syslog updates every sleep or every second if `#define SYSLOG_UPDATE_SECOND` (#20260)
- Moved Berry animate to its own `berry_animate` lib (#20309)
-- Relax checks of Partition Wizard for newest Shelly
+- Relax checks of Partition Wizard for newest Shelly (#20349)
### Fixed
- Matter Contact sensor was not triggering any update (#20232)
@@ -30,7 +30,7 @@ All notable changes to this project will be documented in this file.
- Syslog server warning caused by lack of field and hostname starting with 'z' (#14689)
- Support for Domoticz floor/room topics. Regression from v12.0.1 (#20299)
- Berry claiming UART0 if needed (#20324)
-- LVGL fix type for lv_imgbtn
+- LVGL fix type for lv_imgbtn (#20354)
### Removed
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index a526e6cbe..822337b19 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -139,6 +139,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- Syslog server warning caused by lack of field and hostname starting with 'z' [#14689](https://github.com/arendst/Tasmota/issues/14689)
- Support for Domoticz floor/room topics. Regression from v12.0.1 [#20299](https://github.com/arendst/Tasmota/issues/20299)
- ESP32 piezo ceramic buzzer doesn't buzz [#20118](https://github.com/arendst/Tasmota/issues/20118)
+- LVGL fix type for lv_imgbtn [#20354](https://github.com/arendst/Tasmota/issues/20354)
- Berry claiming UART0 if needed [#20324](https://github.com/arendst/Tasmota/issues/20324)
- Matter Contact sensor was not triggering any update [#20232](https://github.com/arendst/Tasmota/issues/20232)
From 516621af5250d3ec39dfb349db1f07ba1730e7c0 Mon Sep 17 00:00:00 2001
From: Jason2866 <24528715+Jason2866@users.noreply.github.com>
Date: Mon, 1 Jan 2024 18:22:01 +0100
Subject: [PATCH 067/303] don't change zip files
---
.gitattributes | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/.gitattributes b/.gitattributes
index 745bc27a1..ad391420f 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -15,3 +15,9 @@
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
+
+# No changes for zip files
+*.zip binary
+*.autoconf binary
+*.bin binary
+*.tapp binary
From 54e88c29262b78c2d917c52a423360b034a6aae3 Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Tue, 2 Jan 2024 12:16:50 +0100
Subject: [PATCH 068/303] HASPmota type `chart` (#20372)
---
CHANGELOG.md | 1 +
.../berry_tasmota/src/be_lv_haspmota.c | 1771 +++++++++++------
.../haspmota_src/haspmota_core/haspmota.be | 100 +-
3 files changed, 1259 insertions(+), 613 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a8b5bd711..32eb2fd88 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
- HASPmota added `haspmota.page_show()` to change page (#20333)
- Berry added `introspect.set()` for class attributes (#20339)
- Support negative power on BL0942 using index 5..8 (#20322)
+- HASPmota type `chart`
### Breaking Changed
- Refactoring of Berry `animate` module for WS2812 Leds (#20236)
diff --git a/lib/libesp32/berry_tasmota/src/be_lv_haspmota.c b/lib/libesp32/berry_tasmota/src/be_lv_haspmota.c
index 70f239d36..c00dba442 100644
--- a/lib/libesp32/berry_tasmota/src/be_lv_haspmota.c
+++ b/lib/libesp32/berry_tasmota/src/be_lv_haspmota.c
@@ -40,6 +40,7 @@ extern const bclass be_class_lv_textarea;
extern const bclass be_class_lv_theme;
extern const bclass be_class_lv_timer;
extern const bclass be_class_lv_qrcode;
+extern const bclass be_class_lv_chart;
extern const bclass be_class_lvh_page;
@@ -1902,7 +1903,7 @@ be_local_closure(lvh_obj_setmember, /* name */
}),
be_str_weak(setmember),
&be_const_str_solidified,
- ( &(const binstruction[134]) { /* code */
+ ( &(const binstruction[159]) { /* code */
0xA40E0000, // 0000 IMPORT R3 K0
0xA4120200, // 0001 IMPORT R4 K1
0x40160503, // 0002 CONNECT R5 K2 K3
@@ -2031,12 +2032,37 @@ be_local_closure(lvh_obj_setmember, /* name */
0x60240001, // 007D GETGBL R9 G1
0x002A2808, // 007E ADD R10 K20 R8
0x7C240200, // 007F CALL R9 1
- 0x70020003, // 0080 JMP #0085
- 0x60200001, // 0081 GETGBL R8 G1
- 0x58240015, // 0082 LDCONST R9 K21
- 0x5C280200, // 0083 MOVE R10 R1
- 0x7C200400, // 0084 CALL R8 2
- 0x80000000, // 0085 RET 0
+ 0x7002001C, // 0080 JMP #009E
+ 0x8C20090B, // 0081 GETMET R8 R4 K11
+ 0x8828010F, // 0082 GETMBR R10 R0 K15
+ 0x002E0801, // 0083 ADD R11 K4 R1
+ 0x7C200600, // 0084 CALL R8 3
+ 0x5C1C1000, // 0085 MOVE R7 R8
+ 0x60200004, // 0086 GETGBL R8 G4
+ 0x5C240E00, // 0087 MOVE R9 R7
+ 0x7C200200, // 0088 CALL R8 1
+ 0x1C20110C, // 0089 EQ R8 R8 K12
+ 0x7822000E, // 008A JMPF R8 #009A
+ 0xA8020005, // 008B EXBLK 0 #0092
+ 0x5C200E00, // 008C MOVE R8 R7
+ 0x8824010F, // 008D GETMBR R9 R0 K15
+ 0x5C280400, // 008E MOVE R10 R2
+ 0x7C200400, // 008F CALL R8 2
+ 0xA8040001, // 0090 EXBLK 1 1
+ 0x70020006, // 0091 JMP #0099
+ 0xAC200002, // 0092 CATCH R8 0 2
+ 0x70020003, // 0093 JMP #0098
+ 0x00281313, // 0094 ADD R10 R9 K19
+ 0x00281401, // 0095 ADD R10 R10 R1
+ 0xB004100A, // 0096 RAISE 1 R8 R10
+ 0x70020000, // 0097 JMP #0099
+ 0xB0080000, // 0098 RAISE 2 R0 R0
+ 0x70020003, // 0099 JMP #009E
+ 0x60200001, // 009A GETGBL R8 G1
+ 0x58240015, // 009B LDCONST R9 K21
+ 0x5C280200, // 009C MOVE R10 R1
+ 0x7C200400, // 009D CALL R8 2
+ 0x80000000, // 009E RET 0
})
)
);
@@ -2277,7 +2303,7 @@ be_local_closure(lvh_obj_member, /* name */
}),
be_str_weak(member),
&be_const_str_solidified,
- ( &(const binstruction[110]) { /* code */
+ ( &(const binstruction[124]) { /* code */
0xA40A0000, // 0000 IMPORT R2 K0
0xA40E0200, // 0001 IMPORT R3 K1
0x40120503, // 0002 CONNECT R4 K2 K3
@@ -2382,12 +2408,26 @@ be_local_closure(lvh_obj_member, /* name */
0x8824010F, // 0065 GETMBR R9 R0 K15
0x7C200200, // 0066 CALL R8 1
0x80041000, // 0067 RET 1 R8
- 0x601C0008, // 0068 GETGBL R7 G8
- 0x5C200200, // 0069 MOVE R8 R1
- 0x7C1C0200, // 006A CALL R7 1
- 0x001E2207, // 006B ADD R7 K17 R7
- 0xB0062407, // 006C RAISE 1 K18 R7
- 0x80000000, // 006D RET 0
+ 0x8C1C070B, // 0068 GETMET R7 R3 K11
+ 0x8824010F, // 0069 GETMBR R9 R0 K15
+ 0x002A0A01, // 006A ADD R10 K5 R1
+ 0x7C1C0600, // 006B CALL R7 3
+ 0x5C180E00, // 006C MOVE R6 R7
+ 0x601C0004, // 006D GETGBL R7 G4
+ 0x5C200C00, // 006E MOVE R8 R6
+ 0x7C1C0200, // 006F CALL R7 1
+ 0x1C1C0F0C, // 0070 EQ R7 R7 K12
+ 0x781E0003, // 0071 JMPF R7 #0076
+ 0x5C1C0C00, // 0072 MOVE R7 R6
+ 0x8820010F, // 0073 GETMBR R8 R0 K15
+ 0x7C1C0200, // 0074 CALL R7 1
+ 0x80040E00, // 0075 RET 1 R7
+ 0x601C0008, // 0076 GETGBL R7 G8
+ 0x5C200200, // 0077 MOVE R8 R1
+ 0x7C1C0200, // 0078 CALL R7 1
+ 0x001E2207, // 0079 ADD R7 K17 R7
+ 0xB0062407, // 007A RAISE 1 K18 R7
+ 0x80000000, // 007B RET 0
})
)
);
@@ -4140,34 +4180,37 @@ be_local_class(lvh_obj,
{ be_const_key_weak(get_action, -1), be_const_closure(lvh_obj_get_action_closure) },
{ be_const_key_weak(get_obj, 84), be_const_closure(lvh_obj_get_obj_closure) },
{ be_const_key_weak(_attr_map, 50), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
- be_const_map( * be_nested_map(26,
+ be_const_map( * be_nested_map(29,
( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(rotation, -1), be_nested_str_weak(rotation) },
- { be_const_key_weak(bg_opa, -1), be_nested_str_weak(style_bg_opa) },
- { be_const_key_weak(end_angle, 3), be_nested_str_weak(bg_end_angle) },
- { be_const_key_weak(w, 18), be_nested_str_weak(width) },
- { be_const_key_weak(src, 6), be_nested_str_weak(src) },
- { be_const_key_weak(x, -1), be_nested_str_weak(x) },
- { be_const_key_weak(border_color, -1), be_nested_str_weak(style_border_color) },
- { be_const_key_weak(bg_grad_color, 0), be_nested_str_weak(style_bg_grad_color) },
- { be_const_key_weak(pad_all, -1), be_nested_str_weak(style_pad_all) },
- { be_const_key_weak(bg_color, 20), be_nested_str_weak(style_bg_color) },
- { be_const_key_weak(y, 8), be_nested_str_weak(y) },
- { be_const_key_weak(line_color, -1), be_nested_str_weak(style_line_color) },
- { be_const_key_weak(image_recolor_opa, 10), be_nested_str_weak(style_img_recolor_opa) },
- { be_const_key_weak(start_angle, 5), be_nested_str_weak(bg_start_angle) },
- { be_const_key_weak(end_angle1, 11), be_nested_str_weak(end_angle) },
+ { be_const_key_weak(bg_grad_color, -1), be_nested_str_weak(style_bg_grad_color) },
+ { be_const_key_weak(pad_bottom, -1), be_nested_str_weak(style_pad_bottom) },
+ { be_const_key_weak(pad_top, -1), be_nested_str_weak(style_pad_top) },
+ { be_const_key_weak(y, 10), be_nested_str_weak(y) },
{ be_const_key_weak(border_side, -1), be_nested_str_weak(style_border_side) },
- { be_const_key_weak(pad_bottom, 9), be_nested_str_weak(style_pad_bottom) },
- { be_const_key_weak(radius, 4), be_nested_str_weak(style_radius) },
- { be_const_key_weak(pad_left, -1), be_nested_str_weak(style_pad_left) },
- { be_const_key_weak(image_recolor, -1), be_nested_str_weak(style_img_recolor) },
- { be_const_key_weak(border_width, -1), be_nested_str_weak(style_border_width) },
- { be_const_key_weak(pad_right, -1), be_nested_str_weak(style_pad_right) },
+ { be_const_key_weak(w, -1), be_nested_str_weak(width) },
{ be_const_key_weak(start_angle1, -1), be_nested_str_weak(start_angle) },
+ { be_const_key_weak(width, 5), be_nested_str_weak(style_width) },
+ { be_const_key_weak(start_angle, 23), be_nested_str_weak(bg_start_angle) },
{ be_const_key_weak(h, -1), be_nested_str_weak(height) },
- { be_const_key_weak(pad_top, 16), be_nested_str_weak(style_pad_top) },
- { be_const_key_weak(bg_grad_dir, 14), be_nested_str_weak(style_bg_grad_dir) },
+ { be_const_key_weak(rotation, -1), be_nested_str_weak(rotation) },
+ { be_const_key_weak(src, 27), be_nested_str_weak(src) },
+ { be_const_key_weak(line_color, -1), be_nested_str_weak(style_line_color) },
+ { be_const_key_weak(image_recolor_opa, -1), be_nested_str_weak(style_img_recolor_opa) },
+ { be_const_key_weak(end_angle, -1), be_nested_str_weak(bg_end_angle) },
+ { be_const_key_weak(pad_right, 19), be_nested_str_weak(style_pad_right) },
+ { be_const_key_weak(bg_grad_dir, -1), be_nested_str_weak(style_bg_grad_dir) },
+ { be_const_key_weak(pad_all, -1), be_nested_str_weak(style_pad_all) },
+ { be_const_key_weak(bg_color, 13), be_nested_str_weak(style_bg_color) },
+ { be_const_key_weak(image_recolor, -1), be_nested_str_weak(style_img_recolor) },
+ { be_const_key_weak(x, 12), be_nested_str_weak(x) },
+ { be_const_key_weak(line_rounded, -1), be_nested_str_weak(style_line_rounded) },
+ { be_const_key_weak(bg_opa, -1), be_nested_str_weak(style_bg_opa) },
+ { be_const_key_weak(end_angle1, -1), be_nested_str_weak(end_angle) },
+ { be_const_key_weak(border_color, 21), be_nested_str_weak(style_border_color) },
+ { be_const_key_weak(height, -1), be_nested_str_weak(style_height) },
+ { be_const_key_weak(pad_left, 17), be_nested_str_weak(style_pad_left) },
+ { be_const_key_weak(radius, -1), be_nested_str_weak(style_radius) },
+ { be_const_key_weak(border_width, 15), be_nested_str_weak(style_border_width) },
})) ) } )) },
{ be_const_key_weak(register_event_cb, 17), be_const_closure(lvh_obj_register_event_cb_closure) },
{ be_const_key_weak(set_pad_top2, 61), be_const_closure(lvh_obj_set_pad_top2_closure) },
@@ -6333,14 +6376,14 @@ void be_load_lvh_qrcode_class(bvm *vm) {
be_pop(vm, 1);
}
-extern const bclass be_class_HASPmota;
+extern const bclass be_class_lvh_chart;
/********************************************************************
-** Solidified function: page_show
+** Solidified function: add_point
********************************************************************/
-be_local_closure(HASPmota_page_show, /* name */
+be_local_closure(lvh_chart_add_point, /* name */
be_nested_proto(
- 8, /* nstack */
+ 6, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
@@ -6348,90 +6391,20 @@ be_local_closure(HASPmota_page_show, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[11]) { /* constants */
- /* K0 */ be_nested_str_weak(lvh_pages),
- /* K1 */ be_nested_str_weak(lvh_page_cur_idx),
- /* K2 */ be_nested_str_weak(pages_list_sorted),
- /* K3 */ be_const_int(1),
- /* K4 */ be_nested_str_weak(prev),
- /* K5 */ be_nested_str_weak(next),
- /* K6 */ be_nested_str_weak(back),
- /* K7 */ be_nested_str_weak(re_page_target),
- /* K8 */ be_nested_str_weak(match),
- /* K9 */ be_const_int(0),
- /* K10 */ be_nested_str_weak(show),
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(_lv_obj),
+ /* K1 */ be_nested_str_weak(set_next_value),
+ /* K2 */ be_nested_str_weak(ser1),
}),
- be_str_weak(page_show),
+ be_str_weak(add_point),
&be_const_str_solidified,
- ( &(const binstruction[68]) { /* code */
- 0x4C080000, // 0000 LDNIL R2
- 0x880C0100, // 0001 GETMBR R3 R0 K0
- 0x88100101, // 0002 GETMBR R4 R0 K1
- 0x940C0604, // 0003 GETIDX R3 R3 R4
- 0x8C100102, // 0004 GETMET R4 R0 K2
- 0x88180101, // 0005 GETMBR R6 R0 K1
- 0x7C100400, // 0006 CALL R4 2
- 0x6014000C, // 0007 GETGBL R5 G12
- 0x5C180800, // 0008 MOVE R6 R4
- 0x7C140200, // 0009 CALL R5 1
- 0x18140B03, // 000A LE R5 R5 K3
- 0x78160000, // 000B JMPF R5 #000D
- 0x80000A00, // 000C RET 0
- 0x1C140304, // 000D EQ R5 R1 K4
- 0x78160009, // 000E JMPF R5 #0019
- 0x60140009, // 000F GETGBL R5 G9
- 0x88180704, // 0010 GETMBR R6 R3 K4
- 0x7C140200, // 0011 CALL R5 1
- 0x5C080A00, // 0012 MOVE R2 R5
- 0x4C140000, // 0013 LDNIL R5
- 0x1C140405, // 0014 EQ R5 R2 R5
- 0x78160001, // 0015 JMPF R5 #0018
- 0x5415FFFE, // 0016 LDINT R5 -1
- 0x94080805, // 0017 GETIDX R2 R4 R5
- 0x70020020, // 0018 JMP #003A
- 0x1C140305, // 0019 EQ R5 R1 K5
- 0x78160008, // 001A JMPF R5 #0024
- 0x60140009, // 001B GETGBL R5 G9
- 0x88180705, // 001C GETMBR R6 R3 K5
- 0x7C140200, // 001D CALL R5 1
- 0x5C080A00, // 001E MOVE R2 R5
- 0x4C140000, // 001F LDNIL R5
- 0x1C140405, // 0020 EQ R5 R2 R5
- 0x78160000, // 0021 JMPF R5 #0023
- 0x94080903, // 0022 GETIDX R2 R4 K3
- 0x70020015, // 0023 JMP #003A
- 0x1C140306, // 0024 EQ R5 R1 K6
- 0x78160008, // 0025 JMPF R5 #002F
- 0x60140009, // 0026 GETGBL R5 G9
- 0x88180706, // 0027 GETMBR R6 R3 K6
- 0x7C140200, // 0028 CALL R5 1
- 0x5C080A00, // 0029 MOVE R2 R5
- 0x4C140000, // 002A LDNIL R5
- 0x1C140405, // 002B EQ R5 R2 R5
- 0x78160000, // 002C JMPF R5 #002E
- 0x58080003, // 002D LDCONST R2 K3
- 0x7002000A, // 002E JMP #003A
- 0x88140107, // 002F GETMBR R5 R0 K7
- 0x8C140B08, // 0030 GETMET R5 R5 K8
- 0x5C1C0200, // 0031 MOVE R7 R1
- 0x7C140400, // 0032 CALL R5 2
- 0x78160005, // 0033 JMPF R5 #003A
- 0x60140009, // 0034 GETGBL R5 G9
- 0x5419FFFE, // 0035 LDINT R6 -1
- 0x401A0606, // 0036 CONNECT R6 K3 R6
- 0x94180206, // 0037 GETIDX R6 R1 R6
- 0x7C140200, // 0038 CALL R5 1
- 0x5C080A00, // 0039 MOVE R2 R5
- 0x4C140000, // 003A LDNIL R5
- 0x20140405, // 003B NE R5 R2 R5
- 0x78160005, // 003C JMPF R5 #0043
- 0x24140509, // 003D GT R5 R2 K9
- 0x78160003, // 003E JMPF R5 #0043
- 0x88140100, // 003F GETMBR R5 R0 K0
- 0x94140A02, // 0040 GETIDX R5 R5 R2
- 0x8C140B0A, // 0041 GETMET R5 R5 K10
- 0x7C140200, // 0042 CALL R5 1
- 0x80000000, // 0043 RET 0
+ ( &(const binstruction[ 6]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x8C080501, // 0001 GETMET R2 R2 K1
+ 0x88100102, // 0002 GETMBR R4 R0 K2
+ 0x5C140200, // 0003 MOVE R5 R1
+ 0x7C080600, // 0004 CALL R2 3
+ 0x80000000, // 0005 RET 0
})
)
);
@@ -6439,12 +6412,347 @@ be_local_closure(HASPmota_page_show, /* name */
/********************************************************************
-** Solidified function: do_action
+** Solidified function: post_init
********************************************************************/
-be_local_closure(HASPmota_do_action, /* name */
+be_local_closure(lvh_chart_post_init, /* name */
be_nested_proto(
6, /* nstack */
- 3, /* argc */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[17]) { /* constants */
+ /* K0 */ be_nested_str_weak(y_min),
+ /* K1 */ be_const_int(0),
+ /* K2 */ be_nested_str_weak(y_max),
+ /* K3 */ be_nested_str_weak(h_div),
+ /* K4 */ be_const_int(3),
+ /* K5 */ be_nested_str_weak(v_div),
+ /* K6 */ be_nested_str_weak(_lv_obj),
+ /* K7 */ be_nested_str_weak(set_update_mode),
+ /* K8 */ be_nested_str_weak(lv),
+ /* K9 */ be_nested_str_weak(CHART_UPDATE_MODE_SHIFT),
+ /* K10 */ be_nested_str_weak(ser1),
+ /* K11 */ be_nested_str_weak(add_series),
+ /* K12 */ be_nested_str_weak(color),
+ /* K13 */ be_const_int(15615044),
+ /* K14 */ be_nested_str_weak(CHART_AXIS_PRIMARY_Y),
+ /* K15 */ be_nested_str_weak(ser2),
+ /* K16 */ be_const_int(4517444),
+ }),
+ be_str_weak(post_init),
+ &be_const_str_solidified,
+ ( &(const binstruction[32]) { /* code */
+ 0x90020101, // 0000 SETMBR R0 K0 K1
+ 0x54060063, // 0001 LDINT R1 100
+ 0x90020401, // 0002 SETMBR R0 K2 R1
+ 0x90020704, // 0003 SETMBR R0 K3 K4
+ 0x54060004, // 0004 LDINT R1 5
+ 0x90020A01, // 0005 SETMBR R0 K5 R1
+ 0x88040106, // 0006 GETMBR R1 R0 K6
+ 0x8C040307, // 0007 GETMET R1 R1 K7
+ 0xB80E1000, // 0008 GETNGBL R3 K8
+ 0x880C0709, // 0009 GETMBR R3 R3 K9
+ 0x7C040400, // 000A CALL R1 2
+ 0x88040106, // 000B GETMBR R1 R0 K6
+ 0x8C04030B, // 000C GETMET R1 R1 K11
+ 0xB80E1000, // 000D GETNGBL R3 K8
+ 0x8C0C070C, // 000E GETMET R3 R3 K12
+ 0x5814000D, // 000F LDCONST R5 K13
+ 0x7C0C0400, // 0010 CALL R3 2
+ 0xB8121000, // 0011 GETNGBL R4 K8
+ 0x8810090E, // 0012 GETMBR R4 R4 K14
+ 0x7C040600, // 0013 CALL R1 3
+ 0x90021401, // 0014 SETMBR R0 K10 R1
+ 0x88040106, // 0015 GETMBR R1 R0 K6
+ 0x8C04030B, // 0016 GETMET R1 R1 K11
+ 0xB80E1000, // 0017 GETNGBL R3 K8
+ 0x8C0C070C, // 0018 GETMET R3 R3 K12
+ 0x58140010, // 0019 LDCONST R5 K16
+ 0x7C0C0400, // 001A CALL R3 2
+ 0xB8121000, // 001B GETNGBL R4 K8
+ 0x8810090E, // 001C GETMBR R4 R4 K14
+ 0x7C040600, // 001D CALL R1 3
+ 0x90021E01, // 001E SETMBR R0 K15 R1
+ 0x80000000, // 001F RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_y_min
+********************************************************************/
+be_local_closure(lvh_chart_set_y_min, /* name */
+ be_nested_proto(
+ 7, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 6]) { /* constants */
+ /* K0 */ be_nested_str_weak(y_min),
+ /* K1 */ be_nested_str_weak(_lv_obj),
+ /* K2 */ be_nested_str_weak(set_range),
+ /* K3 */ be_nested_str_weak(lv),
+ /* K4 */ be_nested_str_weak(CHART_AXIS_PRIMARY_Y),
+ /* K5 */ be_nested_str_weak(y_max),
+ }),
+ be_str_weak(set_y_min),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 9]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x88080101, // 0001 GETMBR R2 R0 K1
+ 0x8C080502, // 0002 GETMET R2 R2 K2
+ 0xB8120600, // 0003 GETNGBL R4 K3
+ 0x88100904, // 0004 GETMBR R4 R4 K4
+ 0x88140100, // 0005 GETMBR R5 R0 K0
+ 0x88180105, // 0006 GETMBR R6 R0 K5
+ 0x7C080800, // 0007 CALL R2 4
+ 0x80000000, // 0008 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_series1_color
+********************************************************************/
+be_local_closure(lvh_chart_set_series1_color, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(_lv_obj),
+ /* K1 */ be_nested_str_weak(set_series_color),
+ /* K2 */ be_nested_str_weak(ser1),
+ }),
+ be_str_weak(set_series1_color),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 6]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x8C080501, // 0001 GETMET R2 R2 K1
+ 0x88100102, // 0002 GETMBR R4 R0 K2
+ 0x5C140200, // 0003 MOVE R5 R1
+ 0x7C080600, // 0004 CALL R2 3
+ 0x80000000, // 0005 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_series2_color
+********************************************************************/
+be_local_closure(lvh_chart_set_series2_color, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(_lv_obj),
+ /* K1 */ be_nested_str_weak(set_series_color),
+ /* K2 */ be_nested_str_weak(ser2),
+ }),
+ be_str_weak(set_series2_color),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 6]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x8C080501, // 0001 GETMET R2 R2 K1
+ 0x88100102, // 0002 GETMBR R4 R0 K2
+ 0x5C140200, // 0003 MOVE R5 R1
+ 0x7C080600, // 0004 CALL R2 3
+ 0x80000000, // 0005 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_y_max
+********************************************************************/
+be_local_closure(lvh_chart_set_y_max, /* name */
+ be_nested_proto(
+ 7, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 6]) { /* constants */
+ /* K0 */ be_nested_str_weak(y_max),
+ /* K1 */ be_nested_str_weak(_lv_obj),
+ /* K2 */ be_nested_str_weak(set_range),
+ /* K3 */ be_nested_str_weak(lv),
+ /* K4 */ be_nested_str_weak(CHART_AXIS_PRIMARY_Y),
+ /* K5 */ be_nested_str_weak(y_min),
+ }),
+ be_str_weak(set_y_max),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 9]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x88080101, // 0001 GETMBR R2 R0 K1
+ 0x8C080502, // 0002 GETMET R2 R2 K2
+ 0xB8120600, // 0003 GETNGBL R4 K3
+ 0x88100904, // 0004 GETMBR R4 R4 K4
+ 0x88140105, // 0005 GETMBR R5 R0 K5
+ 0x88180100, // 0006 GETMBR R6 R0 K0
+ 0x7C080800, // 0007 CALL R2 4
+ 0x80000000, // 0008 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: add_point2
+********************************************************************/
+be_local_closure(lvh_chart_add_point2, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 3]) { /* constants */
+ /* K0 */ be_nested_str_weak(_lv_obj),
+ /* K1 */ be_nested_str_weak(set_next_value),
+ /* K2 */ be_nested_str_weak(ser2),
+ }),
+ be_str_weak(add_point2),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 6]) { /* code */
+ 0x88080100, // 0000 GETMBR R2 R0 K0
+ 0x8C080501, // 0001 GETMET R2 R2 K1
+ 0x88100102, // 0002 GETMBR R4 R0 K2
+ 0x5C140200, // 0003 MOVE R5 R1
+ 0x7C080600, // 0004 CALL R2 3
+ 0x80000000, // 0005 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: get_y_max
+********************************************************************/
+be_local_closure(lvh_chart_get_y_max, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(y_max),
+ }),
+ be_str_weak(get_y_max),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x80040200, // 0001 RET 1 R1
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_val
+********************************************************************/
+be_local_closure(lvh_chart_set_val, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(add_point),
+ }),
+ be_str_weak(set_val),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 4]) { /* code */
+ 0x8C080100, // 0000 GETMET R2 R0 K0
+ 0x5C100200, // 0001 MOVE R4 R1
+ 0x7C080400, // 0002 CALL R2 2
+ 0x80000000, // 0003 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_val2
+********************************************************************/
+be_local_closure(lvh_chart_set_val2, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(add_point2),
+ }),
+ be_str_weak(set_val2),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 4]) { /* code */
+ 0x8C080100, // 0000 GETMET R2 R0 K0
+ 0x5C100200, // 0001 MOVE R4 R1
+ 0x7C080400, // 0002 CALL R2 2
+ 0x80000000, // 0003 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_v_div_line_count
+********************************************************************/
+be_local_closure(lvh_chart_set_v_div_line_count, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
@@ -6452,29 +6760,131 @@ be_local_closure(HASPmota_do_action, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_nested_str_weak(lv),
- /* K1 */ be_nested_str_weak(EVENT_CLICKED),
- /* K2 */ be_nested_str_weak(page_show),
- /* K3 */ be_nested_str_weak(_action),
+ /* K0 */ be_nested_str_weak(v_div),
+ /* K1 */ be_nested_str_weak(_lv_obj),
+ /* K2 */ be_nested_str_weak(set_div_line_count),
+ /* K3 */ be_nested_str_weak(h_div),
}),
- be_str_weak(do_action),
+ be_str_weak(set_v_div_line_count),
&be_const_str_solidified,
- ( &(const binstruction[ 9]) { /* code */
- 0xB80E0000, // 0000 GETNGBL R3 K0
- 0x880C0701, // 0001 GETMBR R3 R3 K1
- 0x200C0403, // 0002 NE R3 R2 R3
- 0x780E0000, // 0003 JMPF R3 #0005
- 0x80000600, // 0004 RET 0
- 0x8C0C0102, // 0005 GETMET R3 R0 K2
- 0x88140303, // 0006 GETMBR R5 R1 K3
- 0x7C0C0400, // 0007 CALL R3 2
- 0x80000000, // 0008 RET 0
+ ( &(const binstruction[ 7]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x88080101, // 0001 GETMBR R2 R0 K1
+ 0x8C080502, // 0002 GETMET R2 R2 K2
+ 0x88100103, // 0003 GETMBR R4 R0 K3
+ 0x88140100, // 0004 GETMBR R5 R0 K0
+ 0x7C080600, // 0005 CALL R2 3
+ 0x80000000, // 0006 RET 0
})
)
);
/*******************************************************************/
+/********************************************************************
+** Solidified function: get_y_min
+********************************************************************/
+be_local_closure(lvh_chart_get_y_min, /* name */
+ be_nested_proto(
+ 2, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 1]) { /* constants */
+ /* K0 */ be_nested_str_weak(y_min),
+ }),
+ be_str_weak(get_y_min),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 2]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x80040200, // 0001 RET 1 R1
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: set_h_div_line_count
+********************************************************************/
+be_local_closure(lvh_chart_set_h_div_line_count, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(h_div),
+ /* K1 */ be_nested_str_weak(_lv_obj),
+ /* K2 */ be_nested_str_weak(set_div_line_count),
+ /* K3 */ be_nested_str_weak(v_div),
+ }),
+ be_str_weak(set_h_div_line_count),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 7]) { /* code */
+ 0x90020001, // 0000 SETMBR R0 K0 R1
+ 0x88080101, // 0001 GETMBR R2 R0 K1
+ 0x8C080502, // 0002 GETMET R2 R2 K2
+ 0x88100100, // 0003 GETMBR R4 R0 K0
+ 0x88140103, // 0004 GETMBR R5 R0 K3
+ 0x7C080600, // 0005 CALL R2 3
+ 0x80000000, // 0006 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified class: lvh_chart
+********************************************************************/
+extern const bclass be_class_lvh_obj;
+be_local_class(lvh_chart,
+ 6,
+ &be_class_lvh_obj,
+ be_nested_map(20,
+ ( (struct bmapnode*) &(const bmapnode[]) {
+ { be_const_key_weak(y_max, -1), be_const_var(3) },
+ { be_const_key_weak(get_y_min, 18), be_const_closure(lvh_chart_get_y_min_closure) },
+ { be_const_key_weak(set_v_div_line_count, 0), be_const_closure(lvh_chart_set_v_div_line_count_closure) },
+ { be_const_key_weak(h_div, 6), be_const_var(4) },
+ { be_const_key_weak(set_y_min, -1), be_const_closure(lvh_chart_set_y_min_closure) },
+ { be_const_key_weak(ser2, 12), be_const_var(1) },
+ { be_const_key_weak(set_val2, -1), be_const_closure(lvh_chart_set_val2_closure) },
+ { be_const_key_weak(_lv_class, -1), be_const_class(be_class_lv_chart) },
+ { be_const_key_weak(ser1, 1), be_const_var(0) },
+ { be_const_key_weak(set_series2_color, -1), be_const_closure(lvh_chart_set_series2_color_closure) },
+ { be_const_key_weak(post_init, 16), be_const_closure(lvh_chart_post_init_closure) },
+ { be_const_key_weak(set_val, -1), be_const_closure(lvh_chart_set_val_closure) },
+ { be_const_key_weak(add_point2, -1), be_const_closure(lvh_chart_add_point2_closure) },
+ { be_const_key_weak(v_div, -1), be_const_var(5) },
+ { be_const_key_weak(get_y_max, -1), be_const_closure(lvh_chart_get_y_max_closure) },
+ { be_const_key_weak(y_min, 11), be_const_var(2) },
+ { be_const_key_weak(set_y_max, -1), be_const_closure(lvh_chart_set_y_max_closure) },
+ { be_const_key_weak(add_point, 2), be_const_closure(lvh_chart_add_point_closure) },
+ { be_const_key_weak(set_series1_color, -1), be_const_closure(lvh_chart_set_series1_color_closure) },
+ { be_const_key_weak(set_h_div_line_count, -1), be_const_closure(lvh_chart_set_h_div_line_count_closure) },
+ })),
+ be_str_weak(lvh_chart)
+);
+/*******************************************************************/
+
+void be_load_lvh_chart_class(bvm *vm) {
+ be_pushntvclass(vm, &be_class_lvh_chart);
+ be_setglobal(vm, "lvh_chart");
+ be_pop(vm, 1);
+}
+
+extern const bclass be_class_HASPmota;
+
/********************************************************************
** Solidified function: register_event
********************************************************************/
@@ -6551,130 +6961,6 @@ be_local_closure(HASPmota_register_event, /* name */
/*******************************************************************/
-/********************************************************************
-** Solidified function: parse
-********************************************************************/
-be_local_closure(HASPmota_parse, /* name */
- be_nested_proto(
- 9, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 9]) { /* constants */
- /* K0 */ be_nested_str_weak(json),
- /* K1 */ be_nested_str_weak(load),
- /* K2 */ be_nested_str_weak(instance),
- /* K3 */ be_nested_str_weak(parse_page),
- /* K4 */ be_nested_str_weak(parse_obj),
- /* K5 */ be_nested_str_weak(lvh_pages),
- /* K6 */ be_nested_str_weak(lvh_page_cur_idx),
- /* K7 */ be_nested_str_weak(value_error),
- /* K8 */ be_nested_str_weak(unable_X20to_X20parse_X20JSON_X20line),
- }),
- be_str_weak(parse),
- &be_const_str_solidified,
- ( &(const binstruction[21]) { /* code */
- 0xA40A0000, // 0000 IMPORT R2 K0
- 0x8C0C0501, // 0001 GETMET R3 R2 K1
- 0x5C140200, // 0002 MOVE R5 R1
- 0x7C0C0400, // 0003 CALL R3 2
- 0x60100004, // 0004 GETGBL R4 G4
- 0x5C140600, // 0005 MOVE R5 R3
- 0x7C100200, // 0006 CALL R4 1
- 0x1C100902, // 0007 EQ R4 R4 K2
- 0x78120009, // 0008 JMPF R4 #0013
- 0x8C100103, // 0009 GETMET R4 R0 K3
- 0x5C180600, // 000A MOVE R6 R3
- 0x7C100400, // 000B CALL R4 2
- 0x8C100104, // 000C GETMET R4 R0 K4
- 0x5C180600, // 000D MOVE R6 R3
- 0x881C0105, // 000E GETMBR R7 R0 K5
- 0x88200106, // 000F GETMBR R8 R0 K6
- 0x941C0E08, // 0010 GETIDX R7 R7 R8
- 0x7C100600, // 0011 CALL R4 3
- 0x70020000, // 0012 JMP #0014
- 0xB0060F08, // 0013 RAISE 1 K7 K8
- 0x80000000, // 0014 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: event_dispatch
-********************************************************************/
-be_local_closure(HASPmota_event_dispatch, /* name */
- be_nested_proto(
- 9, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[11]) { /* constants */
- /* K0 */ be_nested_str_weak(introspect),
- /* K1 */ be_nested_str_weak(toptr),
- /* K2 */ be_nested_str_weak(event),
- /* K3 */ be_nested_str_weak(_change_buffer),
- /* K4 */ be_nested_str_weak(lv),
- /* K5 */ be_nested_str_weak(lv_event),
- /* K6 */ be_nested_str_weak(user_data),
- /* K7 */ be_const_int(0),
- /* K8 */ be_nested_str_weak(fromptr),
- /* K9 */ be_nested_str_weak(instance),
- /* K10 */ be_nested_str_weak(event_cb),
- }),
- be_str_weak(event_dispatch),
- &be_const_str_solidified,
- ( &(const binstruction[35]) { /* code */
- 0xA40A0000, // 0000 IMPORT R2 K0
- 0x8C0C0501, // 0001 GETMET R3 R2 K1
- 0x5C140200, // 0002 MOVE R5 R1
- 0x7C0C0400, // 0003 CALL R3 2
- 0x88100102, // 0004 GETMBR R4 R0 K2
- 0x78120004, // 0005 JMPF R4 #000B
- 0x88100102, // 0006 GETMBR R4 R0 K2
- 0x8C100903, // 0007 GETMET R4 R4 K3
- 0x5C180600, // 0008 MOVE R6 R3
- 0x7C100400, // 0009 CALL R4 2
- 0x70020004, // 000A JMP #0010
- 0xB8120800, // 000B GETNGBL R4 K4
- 0x8C100905, // 000C GETMET R4 R4 K5
- 0x5C180600, // 000D MOVE R6 R3
- 0x7C100400, // 000E CALL R4 2
- 0x90020404, // 000F SETMBR R0 K2 R4
- 0x88100102, // 0010 GETMBR R4 R0 K2
- 0x88100906, // 0011 GETMBR R4 R4 K6
- 0x60140009, // 0012 GETGBL R5 G9
- 0x5C180800, // 0013 MOVE R6 R4
- 0x7C140200, // 0014 CALL R5 1
- 0x20140B07, // 0015 NE R5 R5 K7
- 0x7816000A, // 0016 JMPF R5 #0022
- 0x8C140508, // 0017 GETMET R5 R2 K8
- 0x5C1C0800, // 0018 MOVE R7 R4
- 0x7C140400, // 0019 CALL R5 2
- 0x60180004, // 001A GETGBL R6 G4
- 0x5C1C0A00, // 001B MOVE R7 R5
- 0x7C180200, // 001C CALL R6 1
- 0x1C180D09, // 001D EQ R6 R6 K9
- 0x781A0002, // 001E JMPF R6 #0022
- 0x8C180B0A, // 001F GETMET R6 R5 K10
- 0x88200102, // 0020 GETMBR R8 R0 K2
- 0x7C180400, // 0021 CALL R6 2
- 0x80000000, // 0022 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
/********************************************************************
** Solidified function: pages_list_sorted
********************************************************************/
@@ -6756,67 +7042,9 @@ be_local_closure(HASPmota_pages_list_sorted, /* name */
/********************************************************************
-** Solidified function: sort
+** Solidified function: parse
********************************************************************/
-be_local_closure(HASPmota_sort, /* name */
- be_nested_proto(
- 7, /* nstack */
- 1, /* argc */
- 4, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_const_class(be_class_HASPmota),
- /* K1 */ be_const_int(1),
- /* K2 */ be_const_int(0),
- /* K3 */ be_nested_str_weak(stop_iteration),
- }),
- be_str_weak(sort),
- &be_const_str_solidified,
- ( &(const binstruction[30]) { /* code */
- 0x58040000, // 0000 LDCONST R1 K0
- 0x60080010, // 0001 GETGBL R2 G16
- 0x600C000C, // 0002 GETGBL R3 G12
- 0x5C100000, // 0003 MOVE R4 R0
- 0x7C0C0200, // 0004 CALL R3 1
- 0x040C0701, // 0005 SUB R3 R3 K1
- 0x400E0203, // 0006 CONNECT R3 K1 R3
- 0x7C080200, // 0007 CALL R2 1
- 0xA8020010, // 0008 EXBLK 0 #001A
- 0x5C0C0400, // 0009 MOVE R3 R2
- 0x7C0C0000, // 000A CALL R3 0
- 0x94100003, // 000B GETIDX R4 R0 R3
- 0x5C140600, // 000C MOVE R5 R3
- 0x24180B02, // 000D GT R6 R5 K2
- 0x781A0008, // 000E JMPF R6 #0018
- 0x04180B01, // 000F SUB R6 R5 K1
- 0x94180006, // 0010 GETIDX R6 R0 R6
- 0x24180C04, // 0011 GT R6 R6 R4
- 0x781A0004, // 0012 JMPF R6 #0018
- 0x04180B01, // 0013 SUB R6 R5 K1
- 0x94180006, // 0014 GETIDX R6 R0 R6
- 0x98000A06, // 0015 SETIDX R0 R5 R6
- 0x04140B01, // 0016 SUB R5 R5 K1
- 0x7001FFF4, // 0017 JMP #000D
- 0x98000A04, // 0018 SETIDX R0 R5 R4
- 0x7001FFEE, // 0019 JMP #0009
- 0x58080003, // 001A LDCONST R2 K3
- 0xAC080200, // 001B CATCH R2 1 0
- 0xB0080000, // 001C RAISE 2 R0 R0
- 0x80040000, // 001D RET 1 R0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: parse_page
-********************************************************************/
-be_local_closure(HASPmota_parse_page, /* name */
+be_local_closure(HASPmota_parse, /* name */
be_nested_proto(
9, /* nstack */
2, /* argc */
@@ -6826,251 +7054,41 @@ be_local_closure(HASPmota_parse_page, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
- ( &(const bvalue[14]) { /* constants */
- /* K0 */ be_nested_str_weak(has),
- /* K1 */ be_nested_str_weak(page),
- /* K2 */ be_nested_str_weak(int),
- /* K3 */ be_nested_str_weak(lvh_page_cur_idx),
- /* K4 */ be_nested_str_weak(lvh_pages),
- /* K5 */ be_nested_str_weak(contains),
- /* K6 */ be_nested_str_weak(lvh_page),
- /* K7 */ be_nested_str_weak(find),
- /* K8 */ be_nested_str_weak(id),
- /* K9 */ be_const_int(0),
- /* K10 */ be_nested_str_weak(get_page_cur),
- /* K11 */ be_nested_str_weak(prev),
- /* K12 */ be_nested_str_weak(next),
- /* K13 */ be_nested_str_weak(back),
- }),
- be_str_weak(parse_page),
- &be_const_str_solidified,
- ( &(const binstruction[54]) { /* code */
- 0x8C080300, // 0000 GETMET R2 R1 K0
- 0x58100001, // 0001 LDCONST R4 K1
- 0x7C080400, // 0002 CALL R2 2
- 0x780A0030, // 0003 JMPF R2 #0035
- 0x60080004, // 0004 GETGBL R2 G4
- 0x940C0301, // 0005 GETIDX R3 R1 K1
- 0x7C080200, // 0006 CALL R2 1
- 0x1C080502, // 0007 EQ R2 R2 K2
- 0x780A002B, // 0008 JMPF R2 #0035
- 0x60080009, // 0009 GETGBL R2 G9
- 0x940C0301, // 000A GETIDX R3 R1 K1
- 0x7C080200, // 000B CALL R2 1
- 0x90020602, // 000C SETMBR R0 K3 R2
- 0x880C0104, // 000D GETMBR R3 R0 K4
- 0x8C0C0705, // 000E GETMET R3 R3 K5
- 0x5C140400, // 000F MOVE R5 R2
- 0x7C0C0400, // 0010 CALL R3 2
- 0x740E0006, // 0011 JMPT R3 #0019
- 0x880C0106, // 0012 GETMBR R3 R0 K6
- 0x88100104, // 0013 GETMBR R4 R0 K4
- 0x5C140600, // 0014 MOVE R5 R3
- 0x5C180400, // 0015 MOVE R6 R2
- 0x5C1C0000, // 0016 MOVE R7 R0
- 0x7C140400, // 0017 CALL R5 2
- 0x98100405, // 0018 SETIDX R4 R2 R5
- 0x8C0C0307, // 0019 GETMET R3 R1 K7
- 0x58140008, // 001A LDCONST R5 K8
- 0x7C0C0400, // 001B CALL R3 2
- 0x1C0C0709, // 001C EQ R3 R3 K9
- 0x780E0016, // 001D JMPF R3 #0035
- 0x8C0C010A, // 001E GETMET R3 R0 K10
- 0x7C0C0200, // 001F CALL R3 1
- 0x60100009, // 0020 GETGBL R4 G9
- 0x8C140307, // 0021 GETMET R5 R1 K7
- 0x581C000B, // 0022 LDCONST R7 K11
- 0x4C200000, // 0023 LDNIL R8
- 0x7C140600, // 0024 CALL R5 3
- 0x7C100200, // 0025 CALL R4 1
- 0x900E1604, // 0026 SETMBR R3 K11 R4
- 0x60100009, // 0027 GETGBL R4 G9
- 0x8C140307, // 0028 GETMET R5 R1 K7
- 0x581C000C, // 0029 LDCONST R7 K12
- 0x4C200000, // 002A LDNIL R8
- 0x7C140600, // 002B CALL R5 3
- 0x7C100200, // 002C CALL R4 1
- 0x900E1804, // 002D SETMBR R3 K12 R4
- 0x60100009, // 002E GETGBL R4 G9
- 0x8C140307, // 002F GETMET R5 R1 K7
- 0x581C000D, // 0030 LDCONST R7 K13
- 0x4C200000, // 0031 LDNIL R8
- 0x7C140600, // 0032 CALL R5 3
- 0x7C100200, // 0033 CALL R4 1
- 0x900E1A04, // 0034 SETMBR R3 K13 R4
- 0x80000000, // 0035 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: _load
-********************************************************************/
-be_local_closure(HASPmota__load, /* name */
- be_nested_proto(
- 14, /* nstack */
- 2, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[17]) { /* constants */
- /* K0 */ be_nested_str_weak(string),
- /* K1 */ be_nested_str_weak(json),
- /* K2 */ be_nested_str_weak(lvh_page_cur_idx),
- /* K3 */ be_const_int(1),
- /* K4 */ be_nested_str_weak(lvh_page),
+ ( &(const bvalue[ 9]) { /* constants */
+ /* K0 */ be_nested_str_weak(json),
+ /* K1 */ be_nested_str_weak(load),
+ /* K2 */ be_nested_str_weak(instance),
+ /* K3 */ be_nested_str_weak(parse_page),
+ /* K4 */ be_nested_str_weak(parse_obj),
/* K5 */ be_nested_str_weak(lvh_pages),
- /* K6 */ be_nested_str_weak(r),
- /* K7 */ be_nested_str_weak(read),
- /* K8 */ be_nested_str_weak(close),
- /* K9 */ be_nested_str_weak(split),
- /* K10 */ be_nested_str_weak(_X0A),
- /* K11 */ be_const_int(0),
- /* K12 */ be_nested_str_weak(load),
- /* K13 */ be_nested_str_weak(instance),
- /* K14 */ be_nested_str_weak(parse_page),
- /* K15 */ be_nested_str_weak(parse_obj),
- /* K16 */ be_nested_str_weak(remove),
+ /* K6 */ be_nested_str_weak(lvh_page_cur_idx),
+ /* K7 */ be_nested_str_weak(value_error),
+ /* K8 */ be_nested_str_weak(unable_X20to_X20parse_X20JSON_X20line),
}),
- be_str_weak(_load),
+ be_str_weak(parse),
&be_const_str_solidified,
- ( &(const binstruction[54]) { /* code */
+ ( &(const binstruction[21]) { /* code */
0xA40A0000, // 0000 IMPORT R2 K0
- 0xA40E0200, // 0001 IMPORT R3 K1
- 0x90020503, // 0002 SETMBR R0 K2 K3
- 0x88100104, // 0003 GETMBR R4 R0 K4
- 0x88140105, // 0004 GETMBR R5 R0 K5
- 0x5C180800, // 0005 MOVE R6 R4
- 0x581C0003, // 0006 LDCONST R7 K3
- 0x5C200000, // 0007 MOVE R8 R0
- 0x7C180400, // 0008 CALL R6 2
- 0x98160606, // 0009 SETIDX R5 K3 R6
- 0x60140011, // 000A GETGBL R5 G17
- 0x5C180200, // 000B MOVE R6 R1
- 0x581C0006, // 000C LDCONST R7 K6
- 0x7C140400, // 000D CALL R5 2
- 0x8C180B07, // 000E GETMET R6 R5 K7
- 0x7C180200, // 000F CALL R6 1
- 0x8C1C0B08, // 0010 GETMET R7 R5 K8
- 0x7C1C0200, // 0011 CALL R7 1
- 0x8C1C0509, // 0012 GETMET R7 R2 K9
- 0x5C240C00, // 0013 MOVE R9 R6
- 0x5828000A, // 0014 LDCONST R10 K10
- 0x7C1C0600, // 0015 CALL R7 3
- 0x4C140000, // 0016 LDNIL R5
- 0x4C180000, // 0017 LDNIL R6
- 0x6020000C, // 0018 GETGBL R8 G12
- 0x5C240E00, // 0019 MOVE R9 R7
- 0x7C200200, // 001A CALL R8 1
- 0x2420110B, // 001B GT R8 R8 K11
- 0x78220015, // 001C JMPF R8 #0033
- 0x8C20070C, // 001D GETMET R8 R3 K12
- 0x94280F0B, // 001E GETIDX R10 R7 K11
- 0x7C200400, // 001F CALL R8 2
- 0x60240004, // 0020 GETGBL R9 G4
- 0x5C281000, // 0021 MOVE R10 R8
- 0x7C240200, // 0022 CALL R9 1
- 0x1C24130D, // 0023 EQ R9 R9 K13
- 0x78260008, // 0024 JMPF R9 #002E
- 0x8C24010E, // 0025 GETMET R9 R0 K14
- 0x5C2C1000, // 0026 MOVE R11 R8
- 0x7C240400, // 0027 CALL R9 2
- 0x8C24010F, // 0028 GETMET R9 R0 K15
- 0x5C2C1000, // 0029 MOVE R11 R8
- 0x88300105, // 002A GETMBR R12 R0 K5
- 0x88340102, // 002B GETMBR R13 R0 K2
- 0x9430180D, // 002C GETIDX R12 R12 R13
- 0x7C240600, // 002D CALL R9 3
- 0x4C200000, // 002E LDNIL R8
- 0x8C240F10, // 002F GETMET R9 R7 K16
- 0x582C000B, // 0030 LDCONST R11 K11
- 0x7C240400, // 0031 CALL R9 2
- 0x7001FFE4, // 0032 JMP #0018
- 0x4C1C0000, // 0033 LDNIL R7
- 0x90020503, // 0034 SETMBR R0 K2 K3
- 0x80000000, // 0035 RET 0
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: get_page_cur
-********************************************************************/
-be_local_closure(HASPmota_get_page_cur, /* name */
- be_nested_proto(
- 3, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 2]) { /* constants */
- /* K0 */ be_nested_str_weak(lvh_pages),
- /* K1 */ be_nested_str_weak(lvh_page_cur_idx),
- }),
- be_str_weak(get_page_cur),
- &be_const_str_solidified,
- ( &(const binstruction[ 4]) { /* code */
- 0x88040100, // 0000 GETMBR R1 R0 K0
- 0x88080101, // 0001 GETMBR R2 R0 K1
- 0x94040202, // 0002 GETIDX R1 R1 R2
- 0x80040200, // 0003 RET 1 R1
- })
- )
-);
-/*******************************************************************/
-
-
-/********************************************************************
-** Solidified function: deinit
-********************************************************************/
-be_local_closure(HASPmota_deinit, /* name */
- be_nested_proto(
- 5, /* nstack */
- 1, /* argc */
- 2, /* varg */
- 0, /* has upvals */
- NULL, /* no upvals */
- 0, /* has sup protos */
- NULL, /* no sub protos */
- 1, /* has constants */
- ( &(const bvalue[ 4]) { /* constants */
- /* K0 */ be_nested_str_weak(_val_rule),
- /* K1 */ be_nested_str_weak(tasmota),
- /* K2 */ be_nested_str_weak(remove_rule),
- /* K3 */ be_nested_str_weak(_text_rule),
- }),
- be_str_weak(deinit),
- &be_const_str_solidified,
- ( &(const binstruction[19]) { /* code */
- 0x88040100, // 0000 GETMBR R1 R0 K0
- 0x4C080000, // 0001 LDNIL R2
- 0x20040202, // 0002 NE R1 R1 R2
- 0x78060004, // 0003 JMPF R1 #0009
- 0xB8060200, // 0004 GETNGBL R1 K1
- 0x8C040302, // 0005 GETMET R1 R1 K2
- 0x880C0100, // 0006 GETMBR R3 R0 K0
- 0x5C100000, // 0007 MOVE R4 R0
- 0x7C040600, // 0008 CALL R1 3
- 0x88040103, // 0009 GETMBR R1 R0 K3
- 0x4C080000, // 000A LDNIL R2
- 0x20040202, // 000B NE R1 R1 R2
- 0x78060004, // 000C JMPF R1 #0012
- 0xB8060200, // 000D GETNGBL R1 K1
- 0x8C040302, // 000E GETMET R1 R1 K2
- 0x880C0103, // 000F GETMBR R3 R0 K3
- 0x5C100000, // 0010 MOVE R4 R0
- 0x7C040600, // 0011 CALL R1 3
- 0x80000000, // 0012 RET 0
+ 0x8C0C0501, // 0001 GETMET R3 R2 K1
+ 0x5C140200, // 0002 MOVE R5 R1
+ 0x7C0C0400, // 0003 CALL R3 2
+ 0x60100004, // 0004 GETGBL R4 G4
+ 0x5C140600, // 0005 MOVE R5 R3
+ 0x7C100200, // 0006 CALL R4 1
+ 0x1C100902, // 0007 EQ R4 R4 K2
+ 0x78120009, // 0008 JMPF R4 #0013
+ 0x8C100103, // 0009 GETMET R4 R0 K3
+ 0x5C180600, // 000A MOVE R6 R3
+ 0x7C100400, // 000B CALL R4 2
+ 0x8C100104, // 000C GETMET R4 R0 K4
+ 0x5C180600, // 000D MOVE R6 R3
+ 0x881C0105, // 000E GETMBR R7 R0 K5
+ 0x88200106, // 000F GETMBR R8 R0 K6
+ 0x941C0E08, // 0010 GETIDX R7 R7 R8
+ 0x7C100600, // 0011 CALL R4 3
+ 0x70020000, // 0012 JMP #0014
+ 0xB0060F08, // 0013 RAISE 1 K7 K8
+ 0x80000000, // 0014 RET 0
})
)
);
@@ -7239,6 +7257,109 @@ be_local_closure(HASPmota_start, /* name */
/*******************************************************************/
+/********************************************************************
+** Solidified function: page_show
+********************************************************************/
+be_local_closure(HASPmota_page_show, /* name */
+ be_nested_proto(
+ 8, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[11]) { /* constants */
+ /* K0 */ be_nested_str_weak(lvh_pages),
+ /* K1 */ be_nested_str_weak(lvh_page_cur_idx),
+ /* K2 */ be_nested_str_weak(pages_list_sorted),
+ /* K3 */ be_const_int(1),
+ /* K4 */ be_nested_str_weak(prev),
+ /* K5 */ be_nested_str_weak(next),
+ /* K6 */ be_nested_str_weak(back),
+ /* K7 */ be_nested_str_weak(re_page_target),
+ /* K8 */ be_nested_str_weak(match),
+ /* K9 */ be_const_int(0),
+ /* K10 */ be_nested_str_weak(show),
+ }),
+ be_str_weak(page_show),
+ &be_const_str_solidified,
+ ( &(const binstruction[68]) { /* code */
+ 0x4C080000, // 0000 LDNIL R2
+ 0x880C0100, // 0001 GETMBR R3 R0 K0
+ 0x88100101, // 0002 GETMBR R4 R0 K1
+ 0x940C0604, // 0003 GETIDX R3 R3 R4
+ 0x8C100102, // 0004 GETMET R4 R0 K2
+ 0x88180101, // 0005 GETMBR R6 R0 K1
+ 0x7C100400, // 0006 CALL R4 2
+ 0x6014000C, // 0007 GETGBL R5 G12
+ 0x5C180800, // 0008 MOVE R6 R4
+ 0x7C140200, // 0009 CALL R5 1
+ 0x18140B03, // 000A LE R5 R5 K3
+ 0x78160000, // 000B JMPF R5 #000D
+ 0x80000A00, // 000C RET 0
+ 0x1C140304, // 000D EQ R5 R1 K4
+ 0x78160009, // 000E JMPF R5 #0019
+ 0x60140009, // 000F GETGBL R5 G9
+ 0x88180704, // 0010 GETMBR R6 R3 K4
+ 0x7C140200, // 0011 CALL R5 1
+ 0x5C080A00, // 0012 MOVE R2 R5
+ 0x4C140000, // 0013 LDNIL R5
+ 0x1C140405, // 0014 EQ R5 R2 R5
+ 0x78160001, // 0015 JMPF R5 #0018
+ 0x5415FFFE, // 0016 LDINT R5 -1
+ 0x94080805, // 0017 GETIDX R2 R4 R5
+ 0x70020020, // 0018 JMP #003A
+ 0x1C140305, // 0019 EQ R5 R1 K5
+ 0x78160008, // 001A JMPF R5 #0024
+ 0x60140009, // 001B GETGBL R5 G9
+ 0x88180705, // 001C GETMBR R6 R3 K5
+ 0x7C140200, // 001D CALL R5 1
+ 0x5C080A00, // 001E MOVE R2 R5
+ 0x4C140000, // 001F LDNIL R5
+ 0x1C140405, // 0020 EQ R5 R2 R5
+ 0x78160000, // 0021 JMPF R5 #0023
+ 0x94080903, // 0022 GETIDX R2 R4 K3
+ 0x70020015, // 0023 JMP #003A
+ 0x1C140306, // 0024 EQ R5 R1 K6
+ 0x78160008, // 0025 JMPF R5 #002F
+ 0x60140009, // 0026 GETGBL R5 G9
+ 0x88180706, // 0027 GETMBR R6 R3 K6
+ 0x7C140200, // 0028 CALL R5 1
+ 0x5C080A00, // 0029 MOVE R2 R5
+ 0x4C140000, // 002A LDNIL R5
+ 0x1C140405, // 002B EQ R5 R2 R5
+ 0x78160000, // 002C JMPF R5 #002E
+ 0x58080003, // 002D LDCONST R2 K3
+ 0x7002000A, // 002E JMP #003A
+ 0x88140107, // 002F GETMBR R5 R0 K7
+ 0x8C140B08, // 0030 GETMET R5 R5 K8
+ 0x5C1C0200, // 0031 MOVE R7 R1
+ 0x7C140400, // 0032 CALL R5 2
+ 0x78160005, // 0033 JMPF R5 #003A
+ 0x60140009, // 0034 GETGBL R5 G9
+ 0x5419FFFE, // 0035 LDINT R6 -1
+ 0x401A0606, // 0036 CONNECT R6 K3 R6
+ 0x94180206, // 0037 GETIDX R6 R1 R6
+ 0x7C140200, // 0038 CALL R5 1
+ 0x5C080A00, // 0039 MOVE R2 R5
+ 0x4C140000, // 003A LDNIL R5
+ 0x20140405, // 003B NE R5 R2 R5
+ 0x78160005, // 003C JMPF R5 #0043
+ 0x24140509, // 003D GT R5 R2 K9
+ 0x78160003, // 003E JMPF R5 #0043
+ 0x88140100, // 003F GETMBR R5 R0 K0
+ 0x94140A02, // 0040 GETIDX R5 R5 R2
+ 0x8C140B0A, // 0041 GETMET R5 R5 K10
+ 0x7C140200, // 0042 CALL R5 1
+ 0x80000000, // 0043 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
/********************************************************************
** Solidified function: init
********************************************************************/
@@ -7273,6 +7394,435 @@ be_local_closure(HASPmota_init, /* name */
/*******************************************************************/
+/********************************************************************
+** Solidified function: get_page_cur
+********************************************************************/
+be_local_closure(HASPmota_get_page_cur, /* name */
+ be_nested_proto(
+ 3, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 2]) { /* constants */
+ /* K0 */ be_nested_str_weak(lvh_pages),
+ /* K1 */ be_nested_str_weak(lvh_page_cur_idx),
+ }),
+ be_str_weak(get_page_cur),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 4]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x88080101, // 0001 GETMBR R2 R0 K1
+ 0x94040202, // 0002 GETIDX R1 R1 R2
+ 0x80040200, // 0003 RET 1 R1
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: deinit
+********************************************************************/
+be_local_closure(HASPmota_deinit, /* name */
+ be_nested_proto(
+ 5, /* nstack */
+ 1, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(_val_rule),
+ /* K1 */ be_nested_str_weak(tasmota),
+ /* K2 */ be_nested_str_weak(remove_rule),
+ /* K3 */ be_nested_str_weak(_text_rule),
+ }),
+ be_str_weak(deinit),
+ &be_const_str_solidified,
+ ( &(const binstruction[19]) { /* code */
+ 0x88040100, // 0000 GETMBR R1 R0 K0
+ 0x4C080000, // 0001 LDNIL R2
+ 0x20040202, // 0002 NE R1 R1 R2
+ 0x78060004, // 0003 JMPF R1 #0009
+ 0xB8060200, // 0004 GETNGBL R1 K1
+ 0x8C040302, // 0005 GETMET R1 R1 K2
+ 0x880C0100, // 0006 GETMBR R3 R0 K0
+ 0x5C100000, // 0007 MOVE R4 R0
+ 0x7C040600, // 0008 CALL R1 3
+ 0x88040103, // 0009 GETMBR R1 R0 K3
+ 0x4C080000, // 000A LDNIL R2
+ 0x20040202, // 000B NE R1 R1 R2
+ 0x78060004, // 000C JMPF R1 #0012
+ 0xB8060200, // 000D GETNGBL R1 K1
+ 0x8C040302, // 000E GETMET R1 R1 K2
+ 0x880C0103, // 000F GETMBR R3 R0 K3
+ 0x5C100000, // 0010 MOVE R4 R0
+ 0x7C040600, // 0011 CALL R1 3
+ 0x80000000, // 0012 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: event_dispatch
+********************************************************************/
+be_local_closure(HASPmota_event_dispatch, /* name */
+ be_nested_proto(
+ 9, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[11]) { /* constants */
+ /* K0 */ be_nested_str_weak(introspect),
+ /* K1 */ be_nested_str_weak(toptr),
+ /* K2 */ be_nested_str_weak(event),
+ /* K3 */ be_nested_str_weak(_change_buffer),
+ /* K4 */ be_nested_str_weak(lv),
+ /* K5 */ be_nested_str_weak(lv_event),
+ /* K6 */ be_nested_str_weak(user_data),
+ /* K7 */ be_const_int(0),
+ /* K8 */ be_nested_str_weak(fromptr),
+ /* K9 */ be_nested_str_weak(instance),
+ /* K10 */ be_nested_str_weak(event_cb),
+ }),
+ be_str_weak(event_dispatch),
+ &be_const_str_solidified,
+ ( &(const binstruction[35]) { /* code */
+ 0xA40A0000, // 0000 IMPORT R2 K0
+ 0x8C0C0501, // 0001 GETMET R3 R2 K1
+ 0x5C140200, // 0002 MOVE R5 R1
+ 0x7C0C0400, // 0003 CALL R3 2
+ 0x88100102, // 0004 GETMBR R4 R0 K2
+ 0x78120004, // 0005 JMPF R4 #000B
+ 0x88100102, // 0006 GETMBR R4 R0 K2
+ 0x8C100903, // 0007 GETMET R4 R4 K3
+ 0x5C180600, // 0008 MOVE R6 R3
+ 0x7C100400, // 0009 CALL R4 2
+ 0x70020004, // 000A JMP #0010
+ 0xB8120800, // 000B GETNGBL R4 K4
+ 0x8C100905, // 000C GETMET R4 R4 K5
+ 0x5C180600, // 000D MOVE R6 R3
+ 0x7C100400, // 000E CALL R4 2
+ 0x90020404, // 000F SETMBR R0 K2 R4
+ 0x88100102, // 0010 GETMBR R4 R0 K2
+ 0x88100906, // 0011 GETMBR R4 R4 K6
+ 0x60140009, // 0012 GETGBL R5 G9
+ 0x5C180800, // 0013 MOVE R6 R4
+ 0x7C140200, // 0014 CALL R5 1
+ 0x20140B07, // 0015 NE R5 R5 K7
+ 0x7816000A, // 0016 JMPF R5 #0022
+ 0x8C140508, // 0017 GETMET R5 R2 K8
+ 0x5C1C0800, // 0018 MOVE R7 R4
+ 0x7C140400, // 0019 CALL R5 2
+ 0x60180004, // 001A GETGBL R6 G4
+ 0x5C1C0A00, // 001B MOVE R7 R5
+ 0x7C180200, // 001C CALL R6 1
+ 0x1C180D09, // 001D EQ R6 R6 K9
+ 0x781A0002, // 001E JMPF R6 #0022
+ 0x8C180B0A, // 001F GETMET R6 R5 K10
+ 0x88200102, // 0020 GETMBR R8 R0 K2
+ 0x7C180400, // 0021 CALL R6 2
+ 0x80000000, // 0022 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: do_action
+********************************************************************/
+be_local_closure(HASPmota_do_action, /* name */
+ be_nested_proto(
+ 6, /* nstack */
+ 3, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_nested_str_weak(lv),
+ /* K1 */ be_nested_str_weak(EVENT_CLICKED),
+ /* K2 */ be_nested_str_weak(page_show),
+ /* K3 */ be_nested_str_weak(_action),
+ }),
+ be_str_weak(do_action),
+ &be_const_str_solidified,
+ ( &(const binstruction[ 9]) { /* code */
+ 0xB80E0000, // 0000 GETNGBL R3 K0
+ 0x880C0701, // 0001 GETMBR R3 R3 K1
+ 0x200C0403, // 0002 NE R3 R2 R3
+ 0x780E0000, // 0003 JMPF R3 #0005
+ 0x80000600, // 0004 RET 0
+ 0x8C0C0102, // 0005 GETMET R3 R0 K2
+ 0x88140303, // 0006 GETMBR R5 R1 K3
+ 0x7C0C0400, // 0007 CALL R3 2
+ 0x80000000, // 0008 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: sort
+********************************************************************/
+be_local_closure(HASPmota_sort, /* name */
+ be_nested_proto(
+ 7, /* nstack */
+ 1, /* argc */
+ 4, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[ 4]) { /* constants */
+ /* K0 */ be_const_class(be_class_HASPmota),
+ /* K1 */ be_const_int(1),
+ /* K2 */ be_const_int(0),
+ /* K3 */ be_nested_str_weak(stop_iteration),
+ }),
+ be_str_weak(sort),
+ &be_const_str_solidified,
+ ( &(const binstruction[30]) { /* code */
+ 0x58040000, // 0000 LDCONST R1 K0
+ 0x60080010, // 0001 GETGBL R2 G16
+ 0x600C000C, // 0002 GETGBL R3 G12
+ 0x5C100000, // 0003 MOVE R4 R0
+ 0x7C0C0200, // 0004 CALL R3 1
+ 0x040C0701, // 0005 SUB R3 R3 K1
+ 0x400E0203, // 0006 CONNECT R3 K1 R3
+ 0x7C080200, // 0007 CALL R2 1
+ 0xA8020010, // 0008 EXBLK 0 #001A
+ 0x5C0C0400, // 0009 MOVE R3 R2
+ 0x7C0C0000, // 000A CALL R3 0
+ 0x94100003, // 000B GETIDX R4 R0 R3
+ 0x5C140600, // 000C MOVE R5 R3
+ 0x24180B02, // 000D GT R6 R5 K2
+ 0x781A0008, // 000E JMPF R6 #0018
+ 0x04180B01, // 000F SUB R6 R5 K1
+ 0x94180006, // 0010 GETIDX R6 R0 R6
+ 0x24180C04, // 0011 GT R6 R6 R4
+ 0x781A0004, // 0012 JMPF R6 #0018
+ 0x04180B01, // 0013 SUB R6 R5 K1
+ 0x94180006, // 0014 GETIDX R6 R0 R6
+ 0x98000A06, // 0015 SETIDX R0 R5 R6
+ 0x04140B01, // 0016 SUB R5 R5 K1
+ 0x7001FFF4, // 0017 JMP #000D
+ 0x98000A04, // 0018 SETIDX R0 R5 R4
+ 0x7001FFEE, // 0019 JMP #0009
+ 0x58080003, // 001A LDCONST R2 K3
+ 0xAC080200, // 001B CATCH R2 1 0
+ 0xB0080000, // 001C RAISE 2 R0 R0
+ 0x80040000, // 001D RET 1 R0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: _load
+********************************************************************/
+be_local_closure(HASPmota__load, /* name */
+ be_nested_proto(
+ 14, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[17]) { /* constants */
+ /* K0 */ be_nested_str_weak(string),
+ /* K1 */ be_nested_str_weak(json),
+ /* K2 */ be_nested_str_weak(lvh_page_cur_idx),
+ /* K3 */ be_const_int(1),
+ /* K4 */ be_nested_str_weak(lvh_page),
+ /* K5 */ be_nested_str_weak(lvh_pages),
+ /* K6 */ be_nested_str_weak(r),
+ /* K7 */ be_nested_str_weak(read),
+ /* K8 */ be_nested_str_weak(close),
+ /* K9 */ be_nested_str_weak(split),
+ /* K10 */ be_nested_str_weak(_X0A),
+ /* K11 */ be_const_int(0),
+ /* K12 */ be_nested_str_weak(load),
+ /* K13 */ be_nested_str_weak(instance),
+ /* K14 */ be_nested_str_weak(parse_page),
+ /* K15 */ be_nested_str_weak(parse_obj),
+ /* K16 */ be_nested_str_weak(remove),
+ }),
+ be_str_weak(_load),
+ &be_const_str_solidified,
+ ( &(const binstruction[54]) { /* code */
+ 0xA40A0000, // 0000 IMPORT R2 K0
+ 0xA40E0200, // 0001 IMPORT R3 K1
+ 0x90020503, // 0002 SETMBR R0 K2 K3
+ 0x88100104, // 0003 GETMBR R4 R0 K4
+ 0x88140105, // 0004 GETMBR R5 R0 K5
+ 0x5C180800, // 0005 MOVE R6 R4
+ 0x581C0003, // 0006 LDCONST R7 K3
+ 0x5C200000, // 0007 MOVE R8 R0
+ 0x7C180400, // 0008 CALL R6 2
+ 0x98160606, // 0009 SETIDX R5 K3 R6
+ 0x60140011, // 000A GETGBL R5 G17
+ 0x5C180200, // 000B MOVE R6 R1
+ 0x581C0006, // 000C LDCONST R7 K6
+ 0x7C140400, // 000D CALL R5 2
+ 0x8C180B07, // 000E GETMET R6 R5 K7
+ 0x7C180200, // 000F CALL R6 1
+ 0x8C1C0B08, // 0010 GETMET R7 R5 K8
+ 0x7C1C0200, // 0011 CALL R7 1
+ 0x8C1C0509, // 0012 GETMET R7 R2 K9
+ 0x5C240C00, // 0013 MOVE R9 R6
+ 0x5828000A, // 0014 LDCONST R10 K10
+ 0x7C1C0600, // 0015 CALL R7 3
+ 0x4C140000, // 0016 LDNIL R5
+ 0x4C180000, // 0017 LDNIL R6
+ 0x6020000C, // 0018 GETGBL R8 G12
+ 0x5C240E00, // 0019 MOVE R9 R7
+ 0x7C200200, // 001A CALL R8 1
+ 0x2420110B, // 001B GT R8 R8 K11
+ 0x78220015, // 001C JMPF R8 #0033
+ 0x8C20070C, // 001D GETMET R8 R3 K12
+ 0x94280F0B, // 001E GETIDX R10 R7 K11
+ 0x7C200400, // 001F CALL R8 2
+ 0x60240004, // 0020 GETGBL R9 G4
+ 0x5C281000, // 0021 MOVE R10 R8
+ 0x7C240200, // 0022 CALL R9 1
+ 0x1C24130D, // 0023 EQ R9 R9 K13
+ 0x78260008, // 0024 JMPF R9 #002E
+ 0x8C24010E, // 0025 GETMET R9 R0 K14
+ 0x5C2C1000, // 0026 MOVE R11 R8
+ 0x7C240400, // 0027 CALL R9 2
+ 0x8C24010F, // 0028 GETMET R9 R0 K15
+ 0x5C2C1000, // 0029 MOVE R11 R8
+ 0x88300105, // 002A GETMBR R12 R0 K5
+ 0x88340102, // 002B GETMBR R13 R0 K2
+ 0x9430180D, // 002C GETIDX R12 R12 R13
+ 0x7C240600, // 002D CALL R9 3
+ 0x4C200000, // 002E LDNIL R8
+ 0x8C240F10, // 002F GETMET R9 R7 K16
+ 0x582C000B, // 0030 LDCONST R11 K11
+ 0x7C240400, // 0031 CALL R9 2
+ 0x7001FFE4, // 0032 JMP #0018
+ 0x4C1C0000, // 0033 LDNIL R7
+ 0x90020503, // 0034 SETMBR R0 K2 K3
+ 0x80000000, // 0035 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
+/********************************************************************
+** Solidified function: parse_page
+********************************************************************/
+be_local_closure(HASPmota_parse_page, /* name */
+ be_nested_proto(
+ 9, /* nstack */
+ 2, /* argc */
+ 2, /* varg */
+ 0, /* has upvals */
+ NULL, /* no upvals */
+ 0, /* has sup protos */
+ NULL, /* no sub protos */
+ 1, /* has constants */
+ ( &(const bvalue[14]) { /* constants */
+ /* K0 */ be_nested_str_weak(has),
+ /* K1 */ be_nested_str_weak(page),
+ /* K2 */ be_nested_str_weak(int),
+ /* K3 */ be_nested_str_weak(lvh_page_cur_idx),
+ /* K4 */ be_nested_str_weak(lvh_pages),
+ /* K5 */ be_nested_str_weak(contains),
+ /* K6 */ be_nested_str_weak(lvh_page),
+ /* K7 */ be_nested_str_weak(find),
+ /* K8 */ be_nested_str_weak(id),
+ /* K9 */ be_const_int(0),
+ /* K10 */ be_nested_str_weak(get_page_cur),
+ /* K11 */ be_nested_str_weak(prev),
+ /* K12 */ be_nested_str_weak(next),
+ /* K13 */ be_nested_str_weak(back),
+ }),
+ be_str_weak(parse_page),
+ &be_const_str_solidified,
+ ( &(const binstruction[54]) { /* code */
+ 0x8C080300, // 0000 GETMET R2 R1 K0
+ 0x58100001, // 0001 LDCONST R4 K1
+ 0x7C080400, // 0002 CALL R2 2
+ 0x780A0030, // 0003 JMPF R2 #0035
+ 0x60080004, // 0004 GETGBL R2 G4
+ 0x940C0301, // 0005 GETIDX R3 R1 K1
+ 0x7C080200, // 0006 CALL R2 1
+ 0x1C080502, // 0007 EQ R2 R2 K2
+ 0x780A002B, // 0008 JMPF R2 #0035
+ 0x60080009, // 0009 GETGBL R2 G9
+ 0x940C0301, // 000A GETIDX R3 R1 K1
+ 0x7C080200, // 000B CALL R2 1
+ 0x90020602, // 000C SETMBR R0 K3 R2
+ 0x880C0104, // 000D GETMBR R3 R0 K4
+ 0x8C0C0705, // 000E GETMET R3 R3 K5
+ 0x5C140400, // 000F MOVE R5 R2
+ 0x7C0C0400, // 0010 CALL R3 2
+ 0x740E0006, // 0011 JMPT R3 #0019
+ 0x880C0106, // 0012 GETMBR R3 R0 K6
+ 0x88100104, // 0013 GETMBR R4 R0 K4
+ 0x5C140600, // 0014 MOVE R5 R3
+ 0x5C180400, // 0015 MOVE R6 R2
+ 0x5C1C0000, // 0016 MOVE R7 R0
+ 0x7C140400, // 0017 CALL R5 2
+ 0x98100405, // 0018 SETIDX R4 R2 R5
+ 0x8C0C0307, // 0019 GETMET R3 R1 K7
+ 0x58140008, // 001A LDCONST R5 K8
+ 0x7C0C0400, // 001B CALL R3 2
+ 0x1C0C0709, // 001C EQ R3 R3 K9
+ 0x780E0016, // 001D JMPF R3 #0035
+ 0x8C0C010A, // 001E GETMET R3 R0 K10
+ 0x7C0C0200, // 001F CALL R3 1
+ 0x60100009, // 0020 GETGBL R4 G9
+ 0x8C140307, // 0021 GETMET R5 R1 K7
+ 0x581C000B, // 0022 LDCONST R7 K11
+ 0x4C200000, // 0023 LDNIL R8
+ 0x7C140600, // 0024 CALL R5 3
+ 0x7C100200, // 0025 CALL R4 1
+ 0x900E1604, // 0026 SETMBR R3 K11 R4
+ 0x60100009, // 0027 GETGBL R4 G9
+ 0x8C140307, // 0028 GETMET R5 R1 K7
+ 0x581C000C, // 0029 LDCONST R7 K12
+ 0x4C200000, // 002A LDNIL R8
+ 0x7C140600, // 002B CALL R5 3
+ 0x7C100200, // 002C CALL R4 1
+ 0x900E1804, // 002D SETMBR R3 K12 R4
+ 0x60100009, // 002E GETGBL R4 G9
+ 0x8C140307, // 002F GETMET R5 R1 K7
+ 0x581C000D, // 0030 LDCONST R7 K13
+ 0x4C200000, // 0031 LDNIL R8
+ 0x7C140600, // 0032 CALL R5 3
+ 0x7C100200, // 0033 CALL R4 1
+ 0x900E1A04, // 0034 SETMBR R3 K13 R4
+ 0x80000000, // 0035 RET 0
+ })
+ )
+);
+/*******************************************************************/
+
+
/********************************************************************
** Solidified function: page_dir_to
********************************************************************/
@@ -7369,7 +7919,7 @@ be_local_closure(HASPmota_parse_obj, /* name */
/* K18 */ be_nested_str_weak(class),
/* K19 */ be_nested_str_weak(lvh_obj),
/* K20 */ be_nested_str_weak(module),
- /* K21 */ be_nested_str_weak(HSP_X3A_X20cannot_X20find_X20object_X20of_X20type_X20),
+ /* K21 */ be_nested_str_weak(HSP_X3A_X20Cannot_X20find_X20object_X20of_X20type_X20),
/* K22 */ be_nested_str_weak(set_obj),
/* K23 */ be_nested_str_weak(p_X25ib_X25i),
/* K24 */ be_nested_str_weak(function),
@@ -7611,52 +8161,53 @@ be_local_closure(HASPmota_parse_obj, /* name */
be_local_class(HASPmota,
10,
NULL,
- be_nested_map(44,
+ be_nested_map(45,
( (struct bmapnode*) &(const bmapnode[]) {
- { be_const_key_weak(event, -1), be_const_var(8) },
- { be_const_key_weak(parse_obj, 4), be_const_closure(HASPmota_parse_obj_closure) },
- { be_const_key_weak(lvh_scr, -1), be_const_class(be_class_lvh_scr) },
- { be_const_key_weak(do_action, 16), be_const_closure(HASPmota_do_action_closure) },
- { be_const_key_weak(lvh_switch, -1), be_const_class(be_class_lvh_switch) },
- { be_const_key_weak(lvh_page, 9), be_const_class(be_class_lvh_page) },
- { be_const_key_weak(lvh_obj, -1), be_const_class(be_class_lvh_obj) },
- { be_const_key_weak(register_event, -1), be_const_closure(HASPmota_register_event_closure) },
- { be_const_key_weak(parse, 35), be_const_closure(HASPmota_parse_closure) },
- { be_const_key_weak(event_cb, -1), be_const_var(9) },
- { be_const_key_weak(event_dispatch, -1), be_const_closure(HASPmota_event_dispatch_closure) },
- { be_const_key_weak(lvh_dropdown, 6), be_const_class(be_class_lvh_dropdown) },
- { be_const_key_weak(pages_list_sorted, -1), be_const_closure(HASPmota_pages_list_sorted_closure) },
- { be_const_key_weak(dark, -1), be_const_var(0) },
- { be_const_key_weak(lvh_roller, 21), be_const_class(be_class_lvh_roller) },
- { be_const_key_weak(lvh_btnmatrix, 23), be_const_class(be_class_lvh_btnmatrix) },
- { be_const_key_weak(hres, -1), be_const_var(1) },
- { be_const_key_weak(sort, -1), be_const_static_closure(HASPmota_sort_closure) },
- { be_const_key_weak(parse_page, 25), be_const_closure(HASPmota_parse_page_closure) },
- { be_const_key_weak(lvh_spinner, -1), be_const_class(be_class_lvh_spinner) },
- { be_const_key_weak(lvh_btn, 39), be_const_class(be_class_lvh_btn) },
- { be_const_key_weak(r16, -1), be_const_var(4) },
- { be_const_key_weak(page_show, 20), be_const_closure(HASPmota_page_show_closure) },
- { be_const_key_weak(scr, 41), be_const_var(3) },
- { be_const_key_weak(deinit, -1), be_const_closure(HASPmota_deinit_closure) },
- { be_const_key_weak(lvh_arc, -1), be_const_class(be_class_lvh_arc) },
- { be_const_key_weak(lvh_pages, -1), be_const_var(5) },
- { be_const_key_weak(start, 28), be_const_closure(HASPmota_start_closure) },
- { be_const_key_weak(lvh_bar, -1), be_const_class(be_class_lvh_bar) },
- { be_const_key_weak(vres, -1), be_const_var(2) },
- { be_const_key_weak(lvh_textarea, -1), be_const_class(be_class_lvh_textarea) },
- { be_const_key_weak(init, -1), be_const_closure(HASPmota_init_closure) },
- { be_const_key_weak(lvh_line, 30), be_const_class(be_class_lvh_line) },
- { be_const_key_weak(def_templ_name, -1), be_nested_str_weak(pages_X2Ejsonl) },
{ be_const_key_weak(re_page_target, -1), be_const_var(7) },
- { be_const_key_weak(lvh_qrcode, -1), be_const_class(be_class_lvh_qrcode) },
- { be_const_key_weak(lvh_page_cur_idx, -1), be_const_var(6) },
- { be_const_key_weak(lvh_img, -1), be_const_class(be_class_lvh_img) },
- { be_const_key_weak(page_dir_to, -1), be_const_closure(HASPmota_page_dir_to_closure) },
- { be_const_key_weak(_load, -1), be_const_closure(HASPmota__load_closure) },
+ { be_const_key_weak(lvh_pages, -1), be_const_var(5) },
+ { be_const_key_weak(lvh_scr, -1), be_const_class(be_class_lvh_scr) },
+ { be_const_key_weak(register_event, 44), be_const_closure(HASPmota_register_event_closure) },
+ { be_const_key_weak(lvh_line, -1), be_const_class(be_class_lvh_line) },
+ { be_const_key_weak(dark, 33), be_const_var(0) },
+ { be_const_key_weak(pages_list_sorted, 37), be_const_closure(HASPmota_pages_list_sorted_closure) },
+ { be_const_key_weak(parse, -1), be_const_closure(HASPmota_parse_closure) },
+ { be_const_key_weak(lvh_page_cur_idx, 19), be_const_var(6) },
+ { be_const_key_weak(parse_obj, 23), be_const_closure(HASPmota_parse_obj_closure) },
{ be_const_key_weak(lvh_label, -1), be_const_class(be_class_lvh_label) },
+ { be_const_key_weak(start, 10), be_const_closure(HASPmota_start_closure) },
+ { be_const_key_weak(lvh_chart, -1), be_const_class(be_class_lvh_chart) },
+ { be_const_key_weak(page_show, -1), be_const_closure(HASPmota_page_show_closure) },
{ be_const_key_weak(lvh_checkbox, -1), be_const_class(be_class_lvh_checkbox) },
- { be_const_key_weak(get_page_cur, 1), be_const_closure(HASPmota_get_page_cur_closure) },
- { be_const_key_weak(lvh_slider, 0), be_const_class(be_class_lvh_slider) },
+ { be_const_key_weak(init, -1), be_const_closure(HASPmota_init_closure) },
+ { be_const_key_weak(lvh_obj, -1), be_const_class(be_class_lvh_obj) },
+ { be_const_key_weak(get_page_cur, -1), be_const_closure(HASPmota_get_page_cur_closure) },
+ { be_const_key_weak(hres, 12), be_const_var(1) },
+ { be_const_key_weak(parse_page, 17), be_const_closure(HASPmota_parse_page_closure) },
+ { be_const_key_weak(_load, 21), be_const_closure(HASPmota__load_closure) },
+ { be_const_key_weak(lvh_slider, -1), be_const_class(be_class_lvh_slider) },
+ { be_const_key_weak(deinit, -1), be_const_closure(HASPmota_deinit_closure) },
+ { be_const_key_weak(lvh_roller, -1), be_const_class(be_class_lvh_roller) },
+ { be_const_key_weak(lvh_spinner, 28), be_const_class(be_class_lvh_spinner) },
+ { be_const_key_weak(event_dispatch, -1), be_const_closure(HASPmota_event_dispatch_closure) },
+ { be_const_key_weak(vres, -1), be_const_var(2) },
+ { be_const_key_weak(event_cb, 32), be_const_var(9) },
+ { be_const_key_weak(event, 38), be_const_var(8) },
+ { be_const_key_weak(lvh_btn, -1), be_const_class(be_class_lvh_btn) },
+ { be_const_key_weak(r16, -1), be_const_var(4) },
+ { be_const_key_weak(lvh_arc, -1), be_const_class(be_class_lvh_arc) },
+ { be_const_key_weak(lvh_dropdown, 18), be_const_class(be_class_lvh_dropdown) },
+ { be_const_key_weak(do_action, 16), be_const_closure(HASPmota_do_action_closure) },
+ { be_const_key_weak(def_templ_name, 26), be_nested_str_weak(pages_X2Ejsonl) },
+ { be_const_key_weak(lvh_btnmatrix, 9), be_const_class(be_class_lvh_btnmatrix) },
+ { be_const_key_weak(sort, 20), be_const_static_closure(HASPmota_sort_closure) },
+ { be_const_key_weak(lvh_qrcode, -1), be_const_class(be_class_lvh_qrcode) },
+ { be_const_key_weak(lvh_bar, -1), be_const_class(be_class_lvh_bar) },
+ { be_const_key_weak(lvh_page, -1), be_const_class(be_class_lvh_page) },
+ { be_const_key_weak(lvh_textarea, -1), be_const_class(be_class_lvh_textarea) },
+ { be_const_key_weak(scr, -1), be_const_var(3) },
+ { be_const_key_weak(page_dir_to, -1), be_const_closure(HASPmota_page_dir_to_closure) },
+ { be_const_key_weak(lvh_switch, -1), be_const_class(be_class_lvh_switch) },
+ { be_const_key_weak(lvh_img, -1), be_const_class(be_class_lvh_img) },
})),
be_str_weak(HASPmota)
);
diff --git a/tasmota/berry/haspmota_src/haspmota_core/haspmota.be b/tasmota/berry/haspmota_src/haspmota_core/haspmota.be
index 2352c3128..40c5bb438 100644
--- a/tasmota/berry/haspmota_src/haspmota_core/haspmota.be
+++ b/tasmota/berry/haspmota_src/haspmota_core/haspmota.be
@@ -20,7 +20,7 @@ var classes = [
"btn", "switch", "checkbox",
"label", "spinner", "line", "img", "roller", "btnmatrix",
"bar", "slider", "arc", "textarea", "dropdown",
- "qrcode"
+ "qrcode", "chart"
]
var f = open("haspmota.c", "w")
for c:classes
@@ -73,6 +73,9 @@ class lvh_obj
"y": "y",
"w": "width",
"h": "height",
+ # special case for height/width that can be in styles
+ "height": "style_height",
+ "width": "style_width",
# arc
# "asjustable": nil,
# "mode": nil,
@@ -96,6 +99,7 @@ class lvh_obj
"bg_grad_color": "style_bg_grad_color",
"bg_grad_dir": "style_bg_grad_dir",
"line_color": "style_line_color",
+ "line_rounded": "style_line_rounded",
"pad_left": "style_pad_left",
"pad_right": "style_pad_right",
"pad_top": "style_pad_top",
@@ -836,6 +840,12 @@ class lvh_obj
end
end
+ # finally try any `get_XXX` within the LVGL object
+ f = introspect.get(self._lv_obj, "get_" + k)
+ if type(f) == 'function' # found and function, call it
+ return f(self._lv_obj)
+ end
+
# fallback to exception if attribute unknown or not a function
raise "value_error", "unknown attribute " + str(k)
end
@@ -905,7 +915,16 @@ class lvh_obj
print("HSP: Could not find function set_"+kv)
end
else
- print("HSP: unknown attribute:", k)
+ f = introspect.get(self._lv_obj, "set_" + k)
+ if type(f) == 'function'
+ try
+ f(self._lv_obj, v)
+ except .. as e, m
+ raise e, m + " for " + k
+ end
+ else
+ print("HSP: unknown attribute:", k)
+ end
end
end
@@ -1328,6 +1347,79 @@ class lvh_bar : lvh_obj
end
end
+#################################################################################
+# Special case for lv.chart
+# Adapted to getting values one after the other
+#################################################################################
+class lvh_chart : lvh_obj
+ static _lv_class = lv.chart
+ # ser1/ser2 contains the first/second series of data
+ var ser1, ser2
+ # y_min/y_max contain the main range for y. Since LVGL does not have getters, we need to memorize on our side the lates tvalues
+ var y_min, y_max
+ # h_div/v_div contain the horizontal and vertical divisions, we need to memorize values because both are set from same API
+ var h_div, v_div
+
+ def post_init()
+ # default values from LVGL are 0..100
+ self.y_min = 0
+ self.y_max = 100
+ # default values
+ #define LV_CHART_HDIV_DEF 3
+ #define LV_CHART_VDIV_DEF 5
+ self.h_div = 3
+ self.v_div = 5
+
+ self._lv_obj.set_update_mode(lv.CHART_UPDATE_MODE_SHIFT)
+
+ self.ser1 = self._lv_obj.add_series(lv.color(0xEE4444), lv.CHART_AXIS_PRIMARY_Y)
+ self.ser2 = self._lv_obj.add_series(lv.color(0x44EE44), lv.CHART_AXIS_PRIMARY_Y)
+ end
+
+ def add_point(v)
+ self._lv_obj.set_next_value(self.ser1, v)
+ end
+ def add_point2(v)
+ self._lv_obj.set_next_value(self.ser2, v)
+ end
+
+ def set_val(v)
+ self.add_point(v)
+ end
+ def set_val2(v)
+ self.add_point2(v)
+ end
+ def get_y_min()
+ return self.y_min
+ end
+ def get_y_max()
+ return self.y_max
+ end
+ def set_y_min(y_min)
+ self.y_min = y_min
+ self._lv_obj.set_range(lv.CHART_AXIS_PRIMARY_Y, self.y_min, self.y_max)
+ end
+ def set_y_max(y_max)
+ self.y_max = y_max
+ self._lv_obj.set_range(lv.CHART_AXIS_PRIMARY_Y, self.y_min, self.y_max)
+ end
+
+ def set_series1_color(color)
+ self._lv_obj.set_series_color(self.ser1, color)
+ end
+ def set_series2_color(color)
+ self._lv_obj.set_series_color(self.ser2, color)
+ end
+ def set_h_div_line_count(h_div)
+ self.h_div = h_div
+ self._lv_obj.set_div_line_count(self.h_div, self.v_div)
+ end
+ def set_v_div_line_count(v_div)
+ self.v_div = v_div
+ self._lv_obj.set_div_line_count(self.h_div, self.v_div)
+ end
+end
+
#################################################################################
#
# All other subclasses than just map the LVGL object
@@ -1523,6 +1615,8 @@ class HASPmota
# static lvh_gauge = lvh_gauge
static lvh_textarea = lvh_textarea # additional?
static lvh_qrcode = lvh_qrcode
+ # special cases
+ static lvh_chart = lvh_chart
static def_templ_name = "pages.jsonl" # default template name
@@ -1912,7 +2006,7 @@ class HASPmota
end
if obj_class == nil
- print("HSP: cannot find object of type " + str(obj_type))
+ print("HSP: Cannot find object of type " + str(obj_type))
return
end
From 03aea58a4cd8aabef08830b0e21879e9596f26cd Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Tue, 2 Jan 2024 14:29:23 +0100
Subject: [PATCH 069/303] Bump version v13.2.0.2
---
CHANGELOG.md | 22 ++++++++++++++++------
RELEASENOTES.md | 7 ++++---
tasmota/include/tasmota_version.h | 2 +-
3 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 32eb2fd88..11631b509 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,7 +3,20 @@ All notable changes to this project will be documented in this file.
## [Unreleased] - Development
-## [13.3.0.1]
+## [13.3.0.2]
+### Added
+- HASPmota type `chart` (#20372)
+
+### Breaking Changed
+
+### Changed
+
+### Fixed
+
+### Removed
+
+
+## [13.3.0.1] 20240101
### Added
- Support for Sonoff Basic R4 Magic Switch (#20247)
- Support for CST816S touch interface (#20213)
@@ -11,10 +24,9 @@ All notable changes to this project will be documented in this file.
- Matter support for password for remote Tasmota devices (#20296)
- Display of active drivers using command ``status 4``
- ESP32 used UART information
-- HASPmota added `haspmota.page_show()` to change page (#20333)
-- Berry added `introspect.set()` for class attributes (#20339)
+- HASPmota `haspmota.page_show()` to change page (#20333)
+- Berry `introspect.set()` for class attributes (#20339)
- Support negative power on BL0942 using index 5..8 (#20322)
-- HASPmota type `chart`
### Breaking Changed
- Refactoring of Berry `animate` module for WS2812 Leds (#20236)
@@ -33,8 +45,6 @@ All notable changes to this project will be documented in this file.
- Berry claiming UART0 if needed (#20324)
- LVGL fix type for lv_imgbtn (#20354)
-### Removed
-
## [Released]
## [13.3.0] 20231213
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 822337b19..6198b8991 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -116,7 +116,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
[Complete list](BUILDS.md) of available feature and sensors.
-## Changelog v13.3.0.1
+## Changelog v13.3.0.2
### Added
- Support for CST816S touch interface [#20213](https://github.com/arendst/Tasmota/issues/20213)
- Support for Sonoff Basic R4 Magic Switch [#20247](https://github.com/arendst/Tasmota/issues/20247)
@@ -124,8 +124,9 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- NeoPool hydrolysis FL1 and Redox flag [#20258](https://github.com/arendst/Tasmota/issues/20258)
- Support negative power on BL0942 using index 5..8 [#20322](https://github.com/arendst/Tasmota/issues/20322)
- ESP32 used UART information
-- Berry added `introspect.set()` for class attributes [#20339](https://github.com/arendst/Tasmota/issues/20339)
-- HASPmota added `haspmota.page_show()` to change page [#20333](https://github.com/arendst/Tasmota/issues/20333)
+- Berry `introspect.set()` for class attributes [#20339](https://github.com/arendst/Tasmota/issues/20339)
+- HASPmota `haspmota.page_show()` to change page [#20333](https://github.com/arendst/Tasmota/issues/20333)
+- HASPmota type `chart` [#20372](https://github.com/arendst/Tasmota/issues/20372)
- Matter support for password for remote Tasmota devices [#20296](https://github.com/arendst/Tasmota/issues/20296)
### Breaking Changed
diff --git a/tasmota/include/tasmota_version.h b/tasmota/include/tasmota_version.h
index 94bd18c62..ac87a0ef4 100644
--- a/tasmota/include/tasmota_version.h
+++ b/tasmota/include/tasmota_version.h
@@ -20,6 +20,6 @@
#ifndef _TASMOTA_VERSION_H_
#define _TASMOTA_VERSION_H_
-const uint32_t TASMOTA_VERSION = 0x0D030001; // 13.3.0.1
+const uint32_t TASMOTA_VERSION = 0x0D030002; // 13.3.0.2
#endif // _TASMOTA_VERSION_H_
From 6768ebc2ac8d76b788495259ceee78eccdd25255 Mon Sep 17 00:00:00 2001
From: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Date: Wed, 3 Jan 2024 16:12:47 +0100
Subject: [PATCH 070/303] Berry fix static allocation when superclass is a
member (#20385)
---
lib/libesp32/berry/src/be_parser.c | 14 +++++---------
lib/libesp32/berry/tests/class_static.be | 9 +++++++++
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/lib/libesp32/berry/src/be_parser.c b/lib/libesp32/berry/src/be_parser.c
index 3afedf41c..be001bf97 100644
--- a/lib/libesp32/berry/src/be_parser.c
+++ b/lib/libesp32/berry/src/be_parser.c
@@ -1571,15 +1571,11 @@ static void class_stmt(bparser *parser)
begin_block(parser->finfo, &binfo, 0);
bstring *class_str = parser_newstr(parser, "_class"); /* we always define `_class` local variable */
- if (e.type == ETLOCAL) {
- bexpdesc e1; /* if inline class, we add a second local variable for _class */
- init_exp(&e1, ETLOCAL, 0);
- e1.v.idx = new_localvar(parser, class_str);
- be_code_setvar(parser->finfo, &e1, &e, 1);
- } else { /* if global class, we just reuse the newly created class in the register */
- init_exp(&e, ETLOCAL, 0);
- e.v.idx = new_localvar(parser, class_str);
- }
+ bexpdesc e1; /* if inline class, we add a second local variable for _class */
+ init_exp(&e1, ETLOCAL, 0);
+ e1.v.idx = new_localvar(parser, class_str);
+ be_code_setvar(parser->finfo, &e1, &e, 1);
+
begin_varinfo(parser, class_str);
class_block(parser, c, &e);
diff --git a/lib/libesp32/berry/tests/class_static.be b/lib/libesp32/berry/tests/class_static.be
index dbe8c222e..b56c5d282 100644
--- a/lib/libesp32/berry/tests/class_static.be
+++ b/lib/libesp32/berry/tests/class_static.be
@@ -155,3 +155,12 @@ assert(A.a == 1)
assert(A.b == A)
assert(A.c == [1, A])
assert(A.f(1) == A)
+
+# bug when superclass is a member
+# the following would break with:
+#
+# attribute_error: class 'B' cannot assign to static attribute 'aa'
+# stack traceback:
+# stdin:1: in function `main`
+class B end m = module('m') m.B = B
+class A : m.B static aa = 1 end
From 9d27f395d8012c4fd1e3d74384d50d215679fecb Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Thu, 4 Jan 2024 18:28:37 +0100
Subject: [PATCH 071/303] Add ESP32 experimental support GPIOViewer when
``define USE_ESP32_GPIO_VIEWER`` is enabled
---
CHANGELOG.md | 1 +
RELEASENOTES.md | 1 +
tasmota/tasmota.ino | 15 +++++++++++++++
3 files changed, 17 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 11631b509..d6382c1f2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.
## [13.3.0.2]
### Added
- HASPmota type `chart` (#20372)
+- ESP32 experimental support GPIOViewer when ``define USE_ESP32_GPIO_VIEWER`` is enabled
### Breaking Changed
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 6198b8991..f566b94db 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -124,6 +124,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- NeoPool hydrolysis FL1 and Redox flag [#20258](https://github.com/arendst/Tasmota/issues/20258)
- Support negative power on BL0942 using index 5..8 [#20322](https://github.com/arendst/Tasmota/issues/20322)
- ESP32 used UART information
+- ESP32 experimental support GPIOViewer when ``define USE_ESP32_GPIO_VIEWER`` is enabled
- Berry `introspect.set()` for class attributes [#20339](https://github.com/arendst/Tasmota/issues/20339)
- HASPmota `haspmota.page_show()` to change page [#20333](https://github.com/arendst/Tasmota/issues/20333)
- HASPmota type `chart` [#20372](https://github.com/arendst/Tasmota/issues/20372)
diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino
index 7febc7a3b..aa8802215 100644
--- a/tasmota/tasmota.ino
+++ b/tasmota/tasmota.ino
@@ -17,6 +17,12 @@
along with this program. If not, see .
*/
+//#define USE_ESP32_GPIO_VIEWER
+#ifdef USE_ESP32_GPIO_VIEWER
+#include // Must me the first include in your project
+GPIOViewer gpio_viewer;
+#endif // USE_ESP32_GPIO_VIEWER
+
// Location specific includes
#ifndef ESP32_STAGE // ESP32 Stage has no core_version.h file. Disable include via PlatformIO Option
#include // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_7_1)
@@ -892,6 +898,15 @@ void Scheduler(void) {
#ifndef SYSLOG_UPDATE_SECOND
SyslogAsync(false);
#endif // SYSLOG_UPDATE_SECOND
+
+#ifdef USE_ESP32_GPIO_VIEWER
+ static bool gpio_viewer_wifi_connected = false;
+ if (!gpio_viewer_wifi_connected && !TasmotaGlobal.global_state.network_down) {
+ gpio_viewer_wifi_connected = true;
+ gpio_viewer.setSamplingInterval(200); // You can set the sampling interval in ms, if not set default is 100ms
+ gpio_viewer.begin();
+ }
+#endif // USE_ESP32_GPIO_VIEWER
}
void loop(void) {
From 7042b8344cdcffa2e91dc0f9fdb701b0b629ad8d Mon Sep 17 00:00:00 2001
From: Theo Arends <11044339+arendst@users.noreply.github.com>
Date: Thu, 4 Jan 2024 18:31:04 +0100
Subject: [PATCH 072/303] Add libs
---
lib/libesp32/AsyncTCP/LICENSE | 165 ++
lib/libesp32/AsyncTCP/README.md | 8 +
lib/libesp32/AsyncTCP/library.properties | 9 +
lib/libesp32/AsyncTCP/src/AsyncTCP.cpp | 1357 +++++++++++++++
lib/libesp32/AsyncTCP/src/AsyncTCP.h | 217 +++
lib/libesp32/ESPAsyncWebServer/.gitignore | 2 +
lib/libesp32/ESPAsyncWebServer/.travis.yml | 46 +
lib/libesp32/ESPAsyncWebServer/CMakeLists.txt | 17 +
lib/libesp32/ESPAsyncWebServer/README.md | 1521 +++++++++++++++++
lib/libesp32/ESPAsyncWebServer/_config.yml | 1 +
lib/libesp32/ESPAsyncWebServer/component.mk | 3 +
.../examples/CaptivePortal/CaptivePortal.ino | 47 +
.../ESP_AsyncFSBrowser/ESP_AsyncFSBrowser.ino | 221 +++
.../examples/regex_patterns/.test.build_flags | 1 +
.../regex_patterns/regex_patterns.ino | 77 +
.../examples/simple_server/simple_server.ino | 74 +
lib/libesp32/ESPAsyncWebServer/keywords.txt | 3 +
lib/libesp32/ESPAsyncWebServer/library.json | 37 +
.../ESPAsyncWebServer/library.properties | 9 +
.../src/AsyncEventSource.cpp | 368 ++++
.../ESPAsyncWebServer/src/AsyncEventSource.h | 133 ++
.../ESPAsyncWebServer/src/AsyncJson.h | 254 +++
.../ESPAsyncWebServer/src/AsyncWebSocket.cpp | 1294 ++++++++++++++
.../ESPAsyncWebServer/src/AsyncWebSocket.h | 350 ++++
.../src/AsyncWebSynchronization.h | 87 +
.../ESPAsyncWebServer/src/ESPAsyncWebServer.h | 471 +++++
.../ESPAsyncWebServer/src/SPIFFSEditor.cpp | 544 ++++++
.../ESPAsyncWebServer/src/SPIFFSEditor.h | 24 +
.../ESPAsyncWebServer/src/StringArray.h | 193 +++
.../src/WebAuthentication.cpp | 235 +++
.../ESPAsyncWebServer/src/WebAuthentication.h | 34 +
.../ESPAsyncWebServer/src/WebHandlerImpl.h | 151 ++
.../ESPAsyncWebServer/src/WebHandlers.cpp | 220 +++
.../ESPAsyncWebServer/src/WebRequest.cpp | 1008 +++++++++++
.../ESPAsyncWebServer/src/WebResponseImpl.h | 136 ++
.../ESPAsyncWebServer/src/WebResponses.cpp | 699 ++++++++
.../ESPAsyncWebServer/src/WebServer.cpp | 193 +++
lib/libesp32/ESPAsyncWebServer/src/edit.htm | 627 +++++++
lib/libesp32/gpio_viewer/.gitignore | 4 +
lib/libesp32/gpio_viewer/LICENSE | 21 +
lib/libesp32/gpio_viewer/README.md | 94 +
.../examples/gpioviewer/gpioviewer.ino | 30 +
lib/libesp32/gpio_viewer/gpio_viewer.ino | 149 ++
lib/libesp32/gpio_viewer/keywords.txt | 16 +
lib/libesp32/gpio_viewer/library.properties | 11 +
lib/libesp32/gpio_viewer/src/gpio_viewer.h | 360 ++++
46 files changed, 11521 insertions(+)
create mode 100644 lib/libesp32/AsyncTCP/LICENSE
create mode 100644 lib/libesp32/AsyncTCP/README.md
create mode 100644 lib/libesp32/AsyncTCP/library.properties
create mode 100644 lib/libesp32/AsyncTCP/src/AsyncTCP.cpp
create mode 100644 lib/libesp32/AsyncTCP/src/AsyncTCP.h
create mode 100644 lib/libesp32/ESPAsyncWebServer/.gitignore
create mode 100644 lib/libesp32/ESPAsyncWebServer/.travis.yml
create mode 100644 lib/libesp32/ESPAsyncWebServer/CMakeLists.txt
create mode 100644 lib/libesp32/ESPAsyncWebServer/README.md
create mode 100644 lib/libesp32/ESPAsyncWebServer/_config.yml
create mode 100644 lib/libesp32/ESPAsyncWebServer/component.mk
create mode 100644 lib/libesp32/ESPAsyncWebServer/examples/CaptivePortal/CaptivePortal.ino
create mode 100644 lib/libesp32/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/ESP_AsyncFSBrowser.ino
create mode 100644 lib/libesp32/ESPAsyncWebServer/examples/regex_patterns/.test.build_flags
create mode 100644 lib/libesp32/ESPAsyncWebServer/examples/regex_patterns/regex_patterns.ino
create mode 100644 lib/libesp32/ESPAsyncWebServer/examples/simple_server/simple_server.ino
create mode 100644 lib/libesp32/ESPAsyncWebServer/keywords.txt
create mode 100644 lib/libesp32/ESPAsyncWebServer/library.json
create mode 100644 lib/libesp32/ESPAsyncWebServer/library.properties
create mode 100644 lib/libesp32/ESPAsyncWebServer/src/AsyncEventSource.cpp
create mode 100644 lib/libesp32/ESPAsyncWebServer/src/AsyncEventSource.h
create mode 100644 lib/libesp32/ESPAsyncWebServer/src/AsyncJson.h
create mode 100644 lib/libesp32/ESPAsyncWebServer/src/AsyncWebSocket.cpp
create mode 100644 lib/libesp32/ESPAsyncWebServer/src/AsyncWebSocket.h
create mode 100644 lib/libesp32/ESPAsyncWebServer/src/AsyncWebSynchronization.h
create mode 100644 lib/libesp32/ESPAsyncWebServer/src/ESPAsyncWebServer.h
create mode 100644 lib/libesp32/ESPAsyncWebServer/src/SPIFFSEditor.cpp
create mode 100644 lib/libesp32/ESPAsyncWebServer/src/SPIFFSEditor.h
create mode 100644 lib/libesp32/ESPAsyncWebServer/src/StringArray.h
create mode 100644 lib/libesp32/ESPAsyncWebServer/src/WebAuthentication.cpp
create mode 100644 lib/libesp32/ESPAsyncWebServer/src/WebAuthentication.h
create mode 100644 lib/libesp32/ESPAsyncWebServer/src/WebHandlerImpl.h
create mode 100644 lib/libesp32/ESPAsyncWebServer/src/WebHandlers.cpp
create mode 100644 lib/libesp32/ESPAsyncWebServer/src/WebRequest.cpp
create mode 100644 lib/libesp32/ESPAsyncWebServer/src/WebResponseImpl.h
create mode 100644 lib/libesp32/ESPAsyncWebServer/src/WebResponses.cpp
create mode 100644 lib/libesp32/ESPAsyncWebServer/src/WebServer.cpp
create mode 100644 lib/libesp32/ESPAsyncWebServer/src/edit.htm
create mode 100644 lib/libesp32/gpio_viewer/.gitignore
create mode 100644 lib/libesp32/gpio_viewer/LICENSE
create mode 100644 lib/libesp32/gpio_viewer/README.md
create mode 100644 lib/libesp32/gpio_viewer/examples/gpioviewer/gpioviewer.ino
create mode 100644 lib/libesp32/gpio_viewer/gpio_viewer.ino
create mode 100644 lib/libesp32/gpio_viewer/keywords.txt
create mode 100644 lib/libesp32/gpio_viewer/library.properties
create mode 100644 lib/libesp32/gpio_viewer/src/gpio_viewer.h
diff --git a/lib/libesp32/AsyncTCP/LICENSE b/lib/libesp32/AsyncTCP/LICENSE
new file mode 100644
index 000000000..65c5ca88a
--- /dev/null
+++ b/lib/libesp32/AsyncTCP/LICENSE
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git a/lib/libesp32/AsyncTCP/README.md b/lib/libesp32/AsyncTCP/README.md
new file mode 100644
index 000000000..cde5f1482
--- /dev/null
+++ b/lib/libesp32/AsyncTCP/README.md
@@ -0,0 +1,8 @@
+### Async TCP Library for ESP32 Arduino
+
+This is a fully asynchronous TCP library, aimed at enabling trouble-free, multi-connection network environment for Espressif's ESP32 MCUs.
+
+This library is the base for [ESPAsyncWebServer](https://github.com/dvarrel/ESPAsyncWebServer)
+
+## AsyncClient and AsyncServer
+The base classes on which everything else is built. They expose all possible scenarios, but are really raw and require more skills to use.
diff --git a/lib/libesp32/AsyncTCP/library.properties b/lib/libesp32/AsyncTCP/library.properties
new file mode 100644
index 000000000..2c6ff0a23
--- /dev/null
+++ b/lib/libesp32/AsyncTCP/library.properties
@@ -0,0 +1,9 @@
+name=AsyncTCP
+version=1.1.4
+author=dvarrel
+maintainer=dvarrel
+sentence=Async TCP Library for ESP32. Forked from https://github.com/me-no-dev/AsyncTCP
+paragraph=to build a WebServer, with files saved in flash
+category=Communication
+url=https://github.com/dvarrel/AsyncTCP
+architectures=esp32
diff --git a/lib/libesp32/AsyncTCP/src/AsyncTCP.cpp b/lib/libesp32/AsyncTCP/src/AsyncTCP.cpp
new file mode 100644
index 000000000..89ff6ee32
--- /dev/null
+++ b/lib/libesp32/AsyncTCP/src/AsyncTCP.cpp
@@ -0,0 +1,1357 @@
+/*
+ Asynchronous TCP library for Espressif MCUs
+
+ Copyright (c) 2016 Hristo Gochkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "Arduino.h"
+
+#include "AsyncTCP.h"
+extern "C"{
+#include "lwip/opt.h"
+#include "lwip/tcp.h"
+#include "lwip/inet.h"
+#include "lwip/dns.h"
+#include "lwip/err.h"
+}
+#include "esp_task_wdt.h"
+
+/*
+ * TCP/IP Event Task
+ * */
+
+typedef enum {
+ LWIP_TCP_SENT, LWIP_TCP_RECV, LWIP_TCP_FIN, LWIP_TCP_ERROR, LWIP_TCP_POLL, LWIP_TCP_CLEAR, LWIP_TCP_ACCEPT, LWIP_TCP_CONNECTED, LWIP_TCP_DNS
+} lwip_event_t;
+
+typedef struct {
+ lwip_event_t event;
+ void *arg;
+ union {
+ struct {
+ void * pcb;
+ int8_t err;
+ } connected;
+ struct {
+ int8_t err;
+ } error;
+ struct {
+ tcp_pcb * pcb;
+ uint16_t len;
+ } sent;
+ struct {
+ tcp_pcb * pcb;
+ pbuf * pb;
+ int8_t err;
+ } recv;
+ struct {
+ tcp_pcb * pcb;
+ int8_t err;
+ } fin;
+ struct {
+ tcp_pcb * pcb;
+ } poll;
+ struct {
+ AsyncClient * client;
+ } accept;
+ struct {
+ const char * name;
+ ip_addr_t addr;
+ } dns;
+ };
+} lwip_event_packet_t;
+
+static xQueueHandle _async_queue;
+static TaskHandle_t _async_service_task_handle = NULL;
+
+
+SemaphoreHandle_t _slots_lock;
+const int _number_of_closed_slots = CONFIG_LWIP_MAX_ACTIVE_TCP;
+static uint32_t _closed_slots[_number_of_closed_slots];
+static uint32_t _closed_index = []() {
+ _slots_lock = xSemaphoreCreateBinary();
+ xSemaphoreGive(_slots_lock);
+ for (int i = 0; i < _number_of_closed_slots; ++ i) {
+ _closed_slots[i] = 1;
+ }
+ return 1;
+}();
+
+
+static inline bool _init_async_event_queue(){
+ if(!_async_queue){
+ _async_queue = xQueueCreate(32, sizeof(lwip_event_packet_t *));
+ if(!_async_queue){
+ return false;
+ }
+ }
+ return true;
+}
+
+static inline bool _send_async_event(lwip_event_packet_t ** e){
+ return _async_queue && xQueueSend(_async_queue, e, portMAX_DELAY) == pdPASS;
+}
+
+static inline bool _prepend_async_event(lwip_event_packet_t ** e){
+ return _async_queue && xQueueSendToFront(_async_queue, e, portMAX_DELAY) == pdPASS;
+}
+
+static inline bool _get_async_event(lwip_event_packet_t ** e){
+ return _async_queue && xQueueReceive(_async_queue, e, portMAX_DELAY) == pdPASS;
+}
+
+static bool _remove_events_with_arg(void * arg){
+ lwip_event_packet_t * first_packet = NULL;
+ lwip_event_packet_t * packet = NULL;
+
+ if(!_async_queue){
+ return false;
+ }
+ //figure out which is the first packet so we can keep the order
+ while(!first_packet){
+ if(xQueueReceive(_async_queue, &first_packet, 0) != pdPASS){
+ return false;
+ }
+ //discard packet if matching
+ if((int)first_packet->arg == (int)arg){
+ free(first_packet);
+ first_packet = NULL;
+ //return first packet to the back of the queue
+ } else if(xQueueSend(_async_queue, &first_packet, portMAX_DELAY) != pdPASS){
+ return false;
+ }
+ }
+
+ while(xQueuePeek(_async_queue, &packet, 0) == pdPASS && packet != first_packet){
+ if(xQueueReceive(_async_queue, &packet, 0) != pdPASS){
+ return false;
+ }
+ if((int)packet->arg == (int)arg){
+ free(packet);
+ packet = NULL;
+ } else if(xQueueSend(_async_queue, &packet, portMAX_DELAY) != pdPASS){
+ return false;
+ }
+ }
+ return true;
+}
+
+static void _handle_async_event(lwip_event_packet_t * e){
+ if(e->arg == NULL){
+ // do nothing when arg is NULL
+ //ets_printf("event arg == NULL: 0x%08x\n", e->recv.pcb);
+ } else if(e->event == LWIP_TCP_CLEAR){
+ _remove_events_with_arg(e->arg);
+ } else if(e->event == LWIP_TCP_RECV){
+ //ets_printf("-R: 0x%08x\n", e->recv.pcb);
+ AsyncClient::_s_recv(e->arg, e->recv.pcb, e->recv.pb, e->recv.err);
+ } else if(e->event == LWIP_TCP_FIN){
+ //ets_printf("-F: 0x%08x\n", e->fin.pcb);
+ AsyncClient::_s_fin(e->arg, e->fin.pcb, e->fin.err);
+ } else if(e->event == LWIP_TCP_SENT){
+ //ets_printf("-S: 0x%08x\n", e->sent.pcb);
+ AsyncClient::_s_sent(e->arg, e->sent.pcb, e->sent.len);
+ } else if(e->event == LWIP_TCP_POLL){
+ //ets_printf("-P: 0x%08x\n", e->poll.pcb);
+ AsyncClient::_s_poll(e->arg, e->poll.pcb);
+ } else if(e->event == LWIP_TCP_ERROR){
+ //ets_printf("-E: 0x%08x %d\n", e->arg, e->error.err);
+ AsyncClient::_s_error(e->arg, e->error.err);
+ } else if(e->event == LWIP_TCP_CONNECTED){
+ //ets_printf("C: 0x%08x 0x%08x %d\n", e->arg, e->connected.pcb, e->connected.err);
+ AsyncClient::_s_connected(e->arg, e->connected.pcb, e->connected.err);
+ } else if(e->event == LWIP_TCP_ACCEPT){
+ //ets_printf("A: 0x%08x 0x%08x\n", e->arg, e->accept.client);
+ AsyncServer::_s_accepted(e->arg, e->accept.client);
+ } else if(e->event == LWIP_TCP_DNS){
+ //ets_printf("D: 0x%08x %s = %s\n", e->arg, e->dns.name, ipaddr_ntoa(&e->dns.addr));
+ AsyncClient::_s_dns_found(e->dns.name, &e->dns.addr, e->arg);
+ }
+ free((void*)(e));
+}
+
+static void _async_service_task(void *pvParameters){
+ lwip_event_packet_t * packet = NULL;
+ for (;;) {
+ if(_get_async_event(&packet)){
+#if CONFIG_ASYNC_TCP_USE_WDT
+ if(esp_task_wdt_add(NULL) != ESP_OK){
+ log_e("Failed to add async task to WDT");
+ }
+#endif
+ _handle_async_event(packet);
+#if CONFIG_ASYNC_TCP_USE_WDT
+ if(esp_task_wdt_delete(NULL) != ESP_OK){
+ log_e("Failed to remove loop task from WDT");
+ }
+#endif
+ }
+ }
+ vTaskDelete(NULL);
+ _async_service_task_handle = NULL;
+}
+/*
+static void _stop_async_task(){
+ if(_async_service_task_handle){
+ vTaskDelete(_async_service_task_handle);
+ _async_service_task_handle = NULL;
+ }
+}
+*/
+static bool _start_async_task(){
+ if(!_init_async_event_queue()){
+ return false;
+ }
+ if(!_async_service_task_handle){
+ xTaskCreateUniversal(_async_service_task, "async_tcp", 8192 * 2, NULL, 3, &_async_service_task_handle, CONFIG_ASYNC_TCP_RUNNING_CORE);
+ if(!_async_service_task_handle){
+ return false;
+ }
+ }
+ return true;
+}
+
+/*
+ * LwIP Callbacks
+ * */
+
+static int8_t _tcp_clear_events(void * arg) {
+ lwip_event_packet_t * e = (lwip_event_packet_t *)malloc(sizeof(lwip_event_packet_t));
+ e->event = LWIP_TCP_CLEAR;
+ e->arg = arg;
+ if (!_prepend_async_event(&e)) {
+ free((void*)(e));
+ }
+ return ERR_OK;
+}
+
+static int8_t _tcp_connected(void * arg, tcp_pcb * pcb, int8_t err) {
+ //ets_printf("+C: 0x%08x\n", pcb);
+ lwip_event_packet_t * e = (lwip_event_packet_t *)malloc(sizeof(lwip_event_packet_t));
+ e->event = LWIP_TCP_CONNECTED;
+ e->arg = arg;
+ e->connected.pcb = pcb;
+ e->connected.err = err;
+ if (!_prepend_async_event(&e)) {
+ free((void*)(e));
+ }
+ return ERR_OK;
+}
+
+static int8_t _tcp_poll(void * arg, struct tcp_pcb * pcb) {
+ //ets_printf("+P: 0x%08x\n", pcb);
+ lwip_event_packet_t * e = (lwip_event_packet_t *)malloc(sizeof(lwip_event_packet_t));
+ e->event = LWIP_TCP_POLL;
+ e->arg = arg;
+ e->poll.pcb = pcb;
+ if (!_send_async_event(&e)) {
+ free((void*)(e));
+ }
+ return ERR_OK;
+}
+
+static int8_t _tcp_recv(void * arg, struct tcp_pcb * pcb, struct pbuf *pb, int8_t err) {
+ lwip_event_packet_t * e = (lwip_event_packet_t *)malloc(sizeof(lwip_event_packet_t));
+ e->arg = arg;
+ if(pb){
+ //ets_printf("+R: 0x%08x\n", pcb);
+ e->event = LWIP_TCP_RECV;
+ e->recv.pcb = pcb;
+ e->recv.pb = pb;
+ e->recv.err = err;
+ } else {
+ //ets_printf("+F: 0x%08x\n", pcb);
+ e->event = LWIP_TCP_FIN;
+ e->fin.pcb = pcb;
+ e->fin.err = err;
+ //close the PCB in LwIP thread
+ AsyncClient::_s_lwip_fin(e->arg, e->fin.pcb, e->fin.err);
+ }
+ if (!_send_async_event(&e)) {
+ free((void*)(e));
+ }
+ return ERR_OK;
+}
+
+static int8_t _tcp_sent(void * arg, struct tcp_pcb * pcb, uint16_t len) {
+ //ets_printf("+S: 0x%08x\n", pcb);
+ lwip_event_packet_t * e = (lwip_event_packet_t *)malloc(sizeof(lwip_event_packet_t));
+ e->event = LWIP_TCP_SENT;
+ e->arg = arg;
+ e->sent.pcb = pcb;
+ e->sent.len = len;
+ if (!_send_async_event(&e)) {
+ free((void*)(e));
+ }
+ return ERR_OK;
+}
+
+static void _tcp_error(void * arg, int8_t err) {
+ //ets_printf("+E: 0x%08x\n", arg);
+ lwip_event_packet_t * e = (lwip_event_packet_t *)malloc(sizeof(lwip_event_packet_t));
+ e->event = LWIP_TCP_ERROR;
+ e->arg = arg;
+ e->error.err = err;
+ if (!_send_async_event(&e)) {
+ free((void*)(e));
+ }
+}
+
+static void _tcp_dns_found(const char * name, struct ip_addr * ipaddr, void * arg) {
+ lwip_event_packet_t * e = (lwip_event_packet_t *)malloc(sizeof(lwip_event_packet_t));
+ //ets_printf("+DNS: name=%s ipaddr=0x%08x arg=%x\n", name, ipaddr, arg);
+ e->event = LWIP_TCP_DNS;
+ e->arg = arg;
+ e->dns.name = name;
+ if (ipaddr) {
+ memcpy(&e->dns.addr, ipaddr, sizeof(struct ip_addr));
+ } else {
+ memset(&e->dns.addr, 0, sizeof(e->dns.addr));
+ }
+ if (!_send_async_event(&e)) {
+ free((void*)(e));
+ }
+}
+
+//Used to switch out from LwIP thread
+static int8_t _tcp_accept(void * arg, AsyncClient * client) {
+ lwip_event_packet_t * e = (lwip_event_packet_t *)malloc(sizeof(lwip_event_packet_t));
+ e->event = LWIP_TCP_ACCEPT;
+ e->arg = arg;
+ e->accept.client = client;
+ if (!_prepend_async_event(&e)) {
+ free((void*)(e));
+ }
+ return ERR_OK;
+}
+
+/*
+ * TCP/IP API Calls
+ * */
+
+#include "lwip/priv/tcpip_priv.h"
+
+typedef struct {
+ struct tcpip_api_call_data call;
+ tcp_pcb * pcb;
+ int8_t closed_slot;
+ int8_t err;
+ union {
+ struct {
+ const char* data;
+ size_t size;
+ uint8_t apiflags;
+ } write;
+ size_t received;
+ struct {
+ ip_addr_t * addr;
+ uint16_t port;
+ tcp_connected_fn cb;
+ } connect;
+ struct {
+ ip_addr_t * addr;
+ uint16_t port;
+ } bind;
+ uint8_t backlog;
+ };
+} tcp_api_call_t;
+
+static err_t _tcp_output_api(struct tcpip_api_call_data *api_call_msg){
+ tcp_api_call_t * msg = (tcp_api_call_t *)api_call_msg;
+ msg->err = ERR_CONN;
+ if(msg->closed_slot == -1 || !_closed_slots[msg->closed_slot]) {
+ msg->err = tcp_output(msg->pcb);
+ }
+ return msg->err;
+}
+
+static esp_err_t _tcp_output(tcp_pcb * pcb, int8_t closed_slot) {
+ if(!pcb){
+ return ERR_CONN;
+ }
+ tcp_api_call_t msg;
+ msg.pcb = pcb;
+ msg.closed_slot = closed_slot;
+ tcpip_api_call(_tcp_output_api, (struct tcpip_api_call_data*)&msg);
+ return msg.err;
+}
+
+static err_t _tcp_write_api(struct tcpip_api_call_data *api_call_msg){
+ tcp_api_call_t * msg = (tcp_api_call_t *)api_call_msg;
+ msg->err = ERR_CONN;
+ if(msg->closed_slot == -1 || !_closed_slots[msg->closed_slot]) {
+ msg->err = tcp_write(msg->pcb, msg->write.data, msg->write.size, msg->write.apiflags);
+ }
+ return msg->err;
+}
+
+static esp_err_t _tcp_write(tcp_pcb * pcb, int8_t closed_slot, const char* data, size_t size, uint8_t apiflags) {
+ if(!pcb){
+ return ERR_CONN;
+ }
+ tcp_api_call_t msg;
+ msg.pcb = pcb;
+ msg.closed_slot = closed_slot;
+ msg.write.data = data;
+ msg.write.size = size;
+ msg.write.apiflags = apiflags;
+ tcpip_api_call(_tcp_write_api, (struct tcpip_api_call_data*)&msg);
+ return msg.err;
+}
+
+static err_t _tcp_recved_api(struct tcpip_api_call_data *api_call_msg){
+ tcp_api_call_t * msg = (tcp_api_call_t *)api_call_msg;
+ msg->err = ERR_CONN;
+ if(msg->closed_slot == -1 || !_closed_slots[msg->closed_slot]) {
+ msg->err = 0;
+ tcp_recved(msg->pcb, msg->received);
+ }
+ return msg->err;
+}
+
+static esp_err_t _tcp_recved(tcp_pcb * pcb, int8_t closed_slot, size_t len) {
+ if(!pcb){
+ return ERR_CONN;
+ }
+ tcp_api_call_t msg;
+ msg.pcb = pcb;
+ msg.closed_slot = closed_slot;
+ msg.received = len;
+ tcpip_api_call(_tcp_recved_api, (struct tcpip_api_call_data*)&msg);
+ return msg.err;
+}
+
+static err_t _tcp_close_api(struct tcpip_api_call_data *api_call_msg){
+ tcp_api_call_t * msg = (tcp_api_call_t *)api_call_msg;
+ msg->err = ERR_CONN;
+ if(msg->closed_slot == -1 || !_closed_slots[msg->closed_slot]) {
+ msg->err = tcp_close(msg->pcb);
+ }
+ return msg->err;
+}
+
+static esp_err_t _tcp_close(tcp_pcb * pcb, int8_t closed_slot) {
+ if(!pcb){
+ return ERR_CONN;
+ }
+ tcp_api_call_t msg;
+ msg.pcb = pcb;
+ msg.closed_slot = closed_slot;
+ tcpip_api_call(_tcp_close_api, (struct tcpip_api_call_data*)&msg);
+ return msg.err;
+}
+
+static err_t _tcp_abort_api(struct tcpip_api_call_data *api_call_msg){
+ tcp_api_call_t * msg = (tcp_api_call_t *)api_call_msg;
+ msg->err = ERR_CONN;
+ if(msg->closed_slot == -1 || !_closed_slots[msg->closed_slot]) {
+ tcp_abort(msg->pcb);
+ }
+ return msg->err;
+}
+
+static esp_err_t _tcp_abort(tcp_pcb * pcb, int8_t closed_slot) {
+ if(!pcb){
+ return ERR_CONN;
+ }
+ tcp_api_call_t msg;
+ msg.pcb = pcb;
+ msg.closed_slot = closed_slot;
+ tcpip_api_call(_tcp_abort_api, (struct tcpip_api_call_data*)&msg);
+ return msg.err;
+}
+
+static err_t _tcp_connect_api(struct tcpip_api_call_data *api_call_msg){
+ tcp_api_call_t * msg = (tcp_api_call_t *)api_call_msg;
+ msg->err = tcp_connect(msg->pcb, msg->connect.addr, msg->connect.port, msg->connect.cb);
+ return msg->err;
+}
+
+static esp_err_t _tcp_connect(tcp_pcb * pcb, int8_t closed_slot, ip_addr_t * addr, uint16_t port, tcp_connected_fn cb) {
+ if(!pcb){
+ return ESP_FAIL;
+ }
+ tcp_api_call_t msg;
+ msg.pcb = pcb;
+ msg.closed_slot = closed_slot;
+ msg.connect.addr = addr;
+ msg.connect.port = port;
+ msg.connect.cb = cb;
+ tcpip_api_call(_tcp_connect_api, (struct tcpip_api_call_data*)&msg);
+ return msg.err;
+}
+
+static err_t _tcp_bind_api(struct tcpip_api_call_data *api_call_msg){
+ tcp_api_call_t * msg = (tcp_api_call_t *)api_call_msg;
+ msg->err = tcp_bind(msg->pcb, msg->bind.addr, msg->bind.port);
+ return msg->err;
+}
+
+static esp_err_t _tcp_bind(tcp_pcb * pcb, ip_addr_t * addr, uint16_t port) {
+ if(!pcb){
+ return ESP_FAIL;
+ }
+ tcp_api_call_t msg;
+ msg.pcb = pcb;
+ msg.closed_slot = -1;
+ msg.bind.addr = addr;
+ msg.bind.port = port;
+ tcpip_api_call(_tcp_bind_api, (struct tcpip_api_call_data*)&msg);
+ return msg.err;
+}
+
+static err_t _tcp_listen_api(struct tcpip_api_call_data *api_call_msg){
+ tcp_api_call_t * msg = (tcp_api_call_t *)api_call_msg;
+ msg->err = 0;
+ msg->pcb = tcp_listen_with_backlog(msg->pcb, msg->backlog);
+ return msg->err;
+}
+
+static tcp_pcb * _tcp_listen_with_backlog(tcp_pcb * pcb, uint8_t backlog) {
+ if(!pcb){
+ return NULL;
+ }
+ tcp_api_call_t msg;
+ msg.pcb = pcb;
+ msg.closed_slot = -1;
+ msg.backlog = backlog?backlog:0xFF;
+ tcpip_api_call(_tcp_listen_api, (struct tcpip_api_call_data*)&msg);
+ return msg.pcb;
+}
+
+
+
+/*
+ Async TCP Client
+ */
+
+AsyncClient::AsyncClient(tcp_pcb* pcb)
+: _connect_cb(0)
+, _connect_cb_arg(0)
+, _discard_cb(0)
+, _discard_cb_arg(0)
+, _sent_cb(0)
+, _sent_cb_arg(0)
+, _error_cb(0)
+, _error_cb_arg(0)
+, _recv_cb(0)
+, _recv_cb_arg(0)
+, _pb_cb(0)
+, _pb_cb_arg(0)
+, _timeout_cb(0)
+, _timeout_cb_arg(0)
+, _pcb_busy(false)
+, _pcb_sent_at(0)
+, _ack_pcb(true)
+, _rx_last_packet(0)
+, _rx_since_timeout(0)
+, _ack_timeout(ASYNC_MAX_ACK_TIME)
+, _connect_port(0)
+, prev(NULL)
+, next(NULL)
+{
+ _pcb = pcb;
+ _closed_slot = -1;
+ if(_pcb){
+ _allocate_closed_slot();
+ _rx_last_packet = millis();
+ tcp_arg(_pcb, this);
+ tcp_recv(_pcb, &_tcp_recv);
+ tcp_sent(_pcb, &_tcp_sent);
+ tcp_err(_pcb, &_tcp_error);
+ tcp_poll(_pcb, &_tcp_poll, 1);
+ }
+}
+
+AsyncClient::~AsyncClient(){
+ if(_pcb) {
+ _close();
+ }
+ _free_closed_slot();
+}
+
+/*
+ * Operators
+ * */
+
+AsyncClient& AsyncClient::operator=(const AsyncClient& other){
+ if (_pcb) {
+ _close();
+ }
+
+ _pcb = other._pcb;
+ _closed_slot = other._closed_slot;
+ if (_pcb) {
+ _rx_last_packet = millis();
+ tcp_arg(_pcb, this);
+ tcp_recv(_pcb, &_tcp_recv);
+ tcp_sent(_pcb, &_tcp_sent);
+ tcp_err(_pcb, &_tcp_error);
+ tcp_poll(_pcb, &_tcp_poll, 1);
+ }
+ return *this;
+}
+
+bool AsyncClient::operator==(const AsyncClient &other) {
+ return _pcb == other._pcb;
+}
+
+AsyncClient & AsyncClient::operator+=(const AsyncClient &other) {
+ if(next == NULL){
+ next = (AsyncClient*)(&other);
+ next->prev = this;
+ } else {
+ AsyncClient *c = next;
+ while(c->next != NULL) {
+ c = c->next;
+ }
+ c->next =(AsyncClient*)(&other);
+ c->next->prev = c;
+ }
+ return *this;
+}
+
+/*
+ * Callback Setters
+ * */
+
+void AsyncClient::onConnect(AcConnectHandler cb, void* arg){
+ _connect_cb = cb;
+ _connect_cb_arg = arg;
+}
+
+void AsyncClient::onDisconnect(AcConnectHandler cb, void* arg){
+ _discard_cb = cb;
+ _discard_cb_arg = arg;
+}
+
+void AsyncClient::onAck(AcAckHandler cb, void* arg){
+ _sent_cb = cb;
+ _sent_cb_arg = arg;
+}
+
+void AsyncClient::onError(AcErrorHandler cb, void* arg){
+ _error_cb = cb;
+ _error_cb_arg = arg;
+}
+
+void AsyncClient::onData(AcDataHandler cb, void* arg){
+ _recv_cb = cb;
+ _recv_cb_arg = arg;
+}
+
+void AsyncClient::onPacket(AcPacketHandler cb, void* arg){
+ _pb_cb = cb;
+ _pb_cb_arg = arg;
+}
+
+void AsyncClient::onTimeout(AcTimeoutHandler cb, void* arg){
+ _timeout_cb = cb;
+ _timeout_cb_arg = arg;
+}
+
+void AsyncClient::onPoll(AcConnectHandler cb, void* arg){
+ _poll_cb = cb;
+ _poll_cb_arg = arg;
+}
+
+/*
+ * Main Public Methods
+ * */
+
+bool AsyncClient::connect(IPAddress ip, uint16_t port){
+ if (_pcb){
+ log_w("already connected, state %d", _pcb->state);
+ return false;
+ }
+ if(!_start_async_task()){
+ log_e("failed to start task");
+ return false;
+ }
+
+ ip_addr_t addr;
+ addr.type = IPADDR_TYPE_V4;
+ addr.u_addr.ip4.addr = ip;
+
+ tcp_pcb* pcb = tcp_new_ip_type(IPADDR_TYPE_V4);
+ if (!pcb){
+ log_e("pcb == NULL");
+ return false;
+ }
+
+ tcp_arg(pcb, this);
+ tcp_err(pcb, &_tcp_error);
+ tcp_recv(pcb, &_tcp_recv);
+ tcp_sent(pcb, &_tcp_sent);
+ tcp_poll(pcb, &_tcp_poll, 1);
+ //_tcp_connect(pcb, &addr, port,(tcp_connected_fn)&_s_connected);
+ _tcp_connect(pcb, _closed_slot, &addr, port,(tcp_connected_fn)&_tcp_connected);
+ return true;
+}
+
+bool AsyncClient::connect(const char* host, uint16_t port){
+ ip_addr_t addr;
+
+ if(!_start_async_task()){
+ log_e("failed to start task");
+ return false;
+ }
+
+ err_t err = dns_gethostbyname(host, &addr, (dns_found_callback)&_tcp_dns_found, this);
+ if(err == ERR_OK) {
+ return connect(IPAddress(addr.u_addr.ip4.addr), port);
+ } else if(err == ERR_INPROGRESS) {
+ _connect_port = port;
+ return true;
+ }
+ log_e("error: %d", err);
+ return false;
+}
+
+void AsyncClient::close(bool now){
+ if(_pcb){
+ _tcp_recved(_pcb, _closed_slot, _rx_ack_len);
+ }
+ _close();
+}
+
+int8_t AsyncClient::abort(){
+ if(_pcb) {
+ _tcp_abort(_pcb, _closed_slot );
+ _pcb = NULL;
+ }
+ return ERR_ABRT;
+}
+
+size_t AsyncClient::space(){
+ if((_pcb != NULL) && (_pcb->state == 4)){
+ return tcp_sndbuf(_pcb);
+ }
+ return 0;
+}
+
+size_t AsyncClient::add(const char* data, size_t size, uint8_t apiflags) {
+ if(!_pcb || size == 0 || data == NULL) {
+ return 0;
+ }
+ size_t room = space();
+ if(!room) {
+ return 0;
+ }
+ size_t will_send = (room < size) ? room : size;
+ int8_t err = ERR_OK;
+ err = _tcp_write(_pcb, _closed_slot, data, will_send, apiflags);
+ if(err != ERR_OK) {
+ return 0;
+ }
+ return will_send;
+}
+
+bool AsyncClient::send(){
+ int8_t err = ERR_OK;
+ err = _tcp_output(_pcb, _closed_slot);
+ if(err == ERR_OK){
+ _pcb_busy = true;
+ _pcb_sent_at = millis();
+ return true;
+ }
+ return false;
+}
+
+size_t AsyncClient::ack(size_t len){
+ if(len > _rx_ack_len)
+ len = _rx_ack_len;
+ if(len){
+ _tcp_recved(_pcb, _closed_slot, len);
+ }
+ _rx_ack_len -= len;
+ return len;
+}
+
+void AsyncClient::ackPacket(struct pbuf * pb){
+ if(!pb){
+ return;
+ }
+ _tcp_recved(_pcb, _closed_slot, pb->len);
+ pbuf_free(pb);
+}
+
+/*
+ * Main Private Methods
+ * */
+
+int8_t AsyncClient::_close(){
+ //ets_printf("X: 0x%08x\n", (uint32_t)this);
+ int8_t err = ERR_OK;
+ if(_pcb) {
+ //log_i("");
+ tcp_arg(_pcb, NULL);
+ tcp_sent(_pcb, NULL);
+ tcp_recv(_pcb, NULL);
+ tcp_err(_pcb, NULL);
+ tcp_poll(_pcb, NULL, 0);
+ _tcp_clear_events(this);
+ err = _tcp_close(_pcb, _closed_slot);
+ if(err != ERR_OK) {
+ err = abort();
+ }
+ _pcb = NULL;
+ if(_discard_cb) {
+ _discard_cb(_discard_cb_arg, this);
+ }
+ }
+ return err;
+}
+
+void AsyncClient::_allocate_closed_slot(){
+ xSemaphoreTake(_slots_lock, portMAX_DELAY);
+ uint32_t closed_slot_min_index = 0;
+ for (int i = 0; i < _number_of_closed_slots; ++ i) {
+ if ((_closed_slot == -1 || _closed_slots[i] <= closed_slot_min_index) && _closed_slots[i] != 0) {
+ closed_slot_min_index = _closed_slots[i];
+ _closed_slot = i;
+ }
+ }
+ if (_closed_slot != -1) {
+ _closed_slots[_closed_slot] = 0;
+ }
+ xSemaphoreGive(_slots_lock);
+}
+
+void AsyncClient::_free_closed_slot(){
+ if (_closed_slot != -1) {
+ _closed_slots[_closed_slot] = _closed_index;
+ _closed_slot = -1;
+ ++ _closed_index;
+ }
+}
+
+/*
+ * Private Callbacks
+ * */
+
+int8_t AsyncClient::_connected(void* pcb, int8_t err){
+ _pcb = reinterpret_cast(pcb);
+ if(_pcb){
+ _rx_last_packet = millis();
+ _pcb_busy = false;
+// tcp_recv(_pcb, &_tcp_recv);
+// tcp_sent(_pcb, &_tcp_sent);
+// tcp_poll(_pcb, &_tcp_poll, 1);
+ }
+ if(_connect_cb) {
+ _connect_cb(_connect_cb_arg, this);
+ }
+ return ERR_OK;
+}
+
+void AsyncClient::_error(int8_t err) {
+ if(_pcb){
+ tcp_arg(_pcb, NULL);
+ if(_pcb->state == LISTEN) {
+ tcp_sent(_pcb, NULL);
+ tcp_recv(_pcb, NULL);
+ tcp_err(_pcb, NULL);
+ tcp_poll(_pcb, NULL, 0);
+ }
+ _pcb = NULL;
+ }
+ if(_error_cb) {
+ _error_cb(_error_cb_arg, this, err);
+ }
+ if(_discard_cb) {
+ _discard_cb(_discard_cb_arg, this);
+ }
+}
+
+//In LwIP Thread
+int8_t AsyncClient::_lwip_fin(tcp_pcb* pcb, int8_t err) {
+ if(!_pcb || pcb != _pcb){
+ log_e("0x%08x != 0x%08x", (uint32_t)pcb, (uint32_t)_pcb);
+ return ERR_OK;
+ }
+ tcp_arg(_pcb, NULL);
+ if(_pcb->state == LISTEN) {
+ tcp_sent(_pcb, NULL);
+ tcp_recv(_pcb, NULL);
+ tcp_err(_pcb, NULL);
+ tcp_poll(_pcb, NULL, 0);
+ }
+ if(tcp_close(_pcb) != ERR_OK) {
+ tcp_abort(_pcb);
+ }
+ _free_closed_slot();
+ _pcb = NULL;
+ return ERR_OK;
+}
+
+//In Async Thread
+int8_t AsyncClient::_fin(tcp_pcb* pcb, int8_t err) {
+ _tcp_clear_events(this);
+ if(_discard_cb) {
+ _discard_cb(_discard_cb_arg, this);
+ }
+ return ERR_OK;
+}
+
+int8_t AsyncClient::_sent(tcp_pcb* pcb, uint16_t len) {
+ _rx_last_packet = millis();
+ //log_i("%u", len);
+ _pcb_busy = false;
+ if(_sent_cb) {
+ _sent_cb(_sent_cb_arg, this, len, (millis() - _pcb_sent_at));
+ }
+ return ERR_OK;
+}
+
+int8_t AsyncClient::_recv(tcp_pcb* pcb, pbuf* pb, int8_t err) {
+ while(pb != NULL) {
+ _rx_last_packet = millis();
+ //we should not ack before we assimilate the data
+ _ack_pcb = true;
+ pbuf *b = pb;
+ pb = b->next;
+ b->next = NULL;
+ if(_pb_cb){
+ _pb_cb(_pb_cb_arg, this, b);
+ } else {
+ if(_recv_cb) {
+ _recv_cb(_recv_cb_arg, this, b->payload, b->len);
+ }
+ if(!_ack_pcb) {
+ _rx_ack_len += b->len;
+ } else if(_pcb) {
+ _tcp_recved(_pcb, _closed_slot, b->len);
+ }
+ pbuf_free(b);
+ }
+ }
+ return ERR_OK;
+}
+
+int8_t AsyncClient::_poll(tcp_pcb* pcb){
+ if(!_pcb){
+ log_w("pcb is NULL");
+ return ERR_OK;
+ }
+ if(pcb != _pcb){
+ log_e("0x%08x != 0x%08x", (uint32_t)pcb, (uint32_t)_pcb);
+ return ERR_OK;
+ }
+
+ uint32_t now = millis();
+
+ // ACK Timeout
+ if(_pcb_busy && _ack_timeout && (now - _pcb_sent_at) >= _ack_timeout){
+ _pcb_busy = false;
+ log_w("ack timeout %d", pcb->state);
+ if(_timeout_cb)
+ _timeout_cb(_timeout_cb_arg, this, (now - _pcb_sent_at));
+ return ERR_OK;
+ }
+ // RX Timeout
+ if(_rx_since_timeout && (now - _rx_last_packet) >= (_rx_since_timeout * 1000)){
+ log_w("rx timeout %d", pcb->state);
+ _close();
+ return ERR_OK;
+ }
+ // Everything is fine
+ if(_poll_cb) {
+ _poll_cb(_poll_cb_arg, this);
+ }
+ return ERR_OK;
+}
+
+void AsyncClient::_dns_found(struct ip_addr *ipaddr){
+ if(ipaddr && ipaddr->u_addr.ip4.addr){
+ connect(IPAddress(ipaddr->u_addr.ip4.addr), _connect_port);
+ } else {
+ if(_error_cb) {
+ _error_cb(_error_cb_arg, this, -55);
+ }
+ if(_discard_cb) {
+ _discard_cb(_discard_cb_arg, this);
+ }
+ }
+}
+
+/*
+ * Public Helper Methods
+ * */
+
+void AsyncClient::stop() {
+ close(false);
+}
+
+bool AsyncClient::free(){
+ if(!_pcb) {
+ return true;
+ }
+ if(_pcb->state == 0 || _pcb->state > 4) {
+ return true;
+ }
+ return false;
+}
+
+size_t AsyncClient::write(const char* data) {
+ if(data == NULL) {
+ return 0;
+ }
+ return write(data, strlen(data));
+}
+
+size_t AsyncClient::write(const char* data, size_t size, uint8_t apiflags) {
+ size_t will_send = add(data, size, apiflags);
+ if(!will_send || !send()) {
+ return 0;
+ }
+ return will_send;
+}
+
+void AsyncClient::setRxTimeout(uint32_t timeout){
+ _rx_since_timeout = timeout;
+}
+
+uint32_t AsyncClient::getRxTimeout(){
+ return _rx_since_timeout;
+}
+
+uint32_t AsyncClient::getAckTimeout(){
+ return _ack_timeout;
+}
+
+void AsyncClient::setAckTimeout(uint32_t timeout){
+ _ack_timeout = timeout;
+}
+
+void AsyncClient::setNoDelay(bool nodelay){
+ if(!_pcb) {
+ return;
+ }
+ if(nodelay) {
+ tcp_nagle_disable(_pcb);
+ } else {
+ tcp_nagle_enable(_pcb);
+ }
+}
+
+bool AsyncClient::getNoDelay(){
+ if(!_pcb) {
+ return false;
+ }
+ return tcp_nagle_disabled(_pcb);
+}
+
+uint16_t AsyncClient::getMss(){
+ if(!_pcb) {
+ return 0;
+ }
+ return tcp_mss(_pcb);
+}
+
+uint32_t AsyncClient::getRemoteAddress() {
+ if(!_pcb) {
+ return 0;
+ }
+ return _pcb->remote_ip.u_addr.ip4.addr;
+}
+
+uint16_t AsyncClient::getRemotePort() {
+ if(!_pcb) {
+ return 0;
+ }
+ return _pcb->remote_port;
+}
+
+uint32_t AsyncClient::getLocalAddress() {
+ if(!_pcb) {
+ return 0;
+ }
+ return _pcb->local_ip.u_addr.ip4.addr;
+}
+
+uint16_t AsyncClient::getLocalPort() {
+ if(!_pcb) {
+ return 0;
+ }
+ return _pcb->local_port;
+}
+
+IPAddress AsyncClient::remoteIP() {
+ return IPAddress(getRemoteAddress());
+}
+
+uint16_t AsyncClient::remotePort() {
+ return getRemotePort();
+}
+
+IPAddress AsyncClient::localIP() {
+ return IPAddress(getLocalAddress());
+}
+
+uint16_t AsyncClient::localPort() {
+ return getLocalPort();
+}
+
+uint8_t AsyncClient::state() {
+ if(!_pcb) {
+ return 0;
+ }
+ return _pcb->state;
+}
+
+bool AsyncClient::connected(){
+ if (!_pcb) {
+ return false;
+ }
+ return _pcb->state == 4;
+}
+
+bool AsyncClient::connecting(){
+ if (!_pcb) {
+ return false;
+ }
+ return _pcb->state > 0 && _pcb->state < 4;
+}
+
+bool AsyncClient::disconnecting(){
+ if (!_pcb) {
+ return false;
+ }
+ return _pcb->state > 4 && _pcb->state < 10;
+}
+
+bool AsyncClient::disconnected(){
+ if (!_pcb) {
+ return true;
+ }
+ return _pcb->state == 0 || _pcb->state == 10;
+}
+
+bool AsyncClient::freeable(){
+ if (!_pcb) {
+ return true;
+ }
+ return _pcb->state == 0 || _pcb->state > 4;
+}
+
+bool AsyncClient::canSend(){
+ return space() > 0;
+}
+
+const char * AsyncClient::errorToString(int8_t error){
+ switch(error){
+ case ERR_OK: return "OK";
+ case ERR_MEM: return "Out of memory error";
+ case ERR_BUF: return "Buffer error";
+ case ERR_TIMEOUT: return "Timeout";
+ case ERR_RTE: return "Routing problem";
+ case ERR_INPROGRESS: return "Operation in progress";
+ case ERR_VAL: return "Illegal value";
+ case ERR_WOULDBLOCK: return "Operation would block";
+ case ERR_USE: return "Address in use";
+ case ERR_ALREADY: return "Already connected";
+ case ERR_CONN: return "Not connected";
+ case ERR_IF: return "Low-level netif error";
+ case ERR_ABRT: return "Connection aborted";
+ case ERR_RST: return "Connection reset";
+ case ERR_CLSD: return "Connection closed";
+ case ERR_ARG: return "Illegal argument";
+ case -55: return "DNS failed";
+ default: return "UNKNOWN";
+ }
+}
+
+const char * AsyncClient::stateToString(){
+ switch(state()){
+ case 0: return "Closed";
+ case 1: return "Listen";
+ case 2: return "SYN Sent";
+ case 3: return "SYN Received";
+ case 4: return "Established";
+ case 5: return "FIN Wait 1";
+ case 6: return "FIN Wait 2";
+ case 7: return "Close Wait";
+ case 8: return "Closing";
+ case 9: return "Last ACK";
+ case 10: return "Time Wait";
+ default: return "UNKNOWN";
+ }
+}
+
+/*
+ * Static Callbacks (LwIP C2C++ interconnect)
+ * */
+
+void AsyncClient::_s_dns_found(const char * name, struct ip_addr * ipaddr, void * arg){
+ reinterpret_cast(arg)->_dns_found(ipaddr);
+}
+
+int8_t AsyncClient::_s_poll(void * arg, struct tcp_pcb * pcb) {
+ return reinterpret_cast(arg)->_poll(pcb);
+}
+
+int8_t AsyncClient::_s_recv(void * arg, struct tcp_pcb * pcb, struct pbuf *pb, int8_t err) {
+ return reinterpret_cast(arg)->_recv(pcb, pb, err);
+}
+
+int8_t AsyncClient::_s_fin(void * arg, struct tcp_pcb * pcb, int8_t err) {
+ return reinterpret_cast(arg)->_fin(pcb, err);
+}
+
+int8_t AsyncClient::_s_lwip_fin(void * arg, struct tcp_pcb * pcb, int8_t err) {
+ return reinterpret_cast(arg)->_lwip_fin(pcb, err);
+}
+
+int8_t AsyncClient::_s_sent(void * arg, struct tcp_pcb * pcb, uint16_t len) {
+ return reinterpret_cast(arg)->_sent(pcb, len);
+}
+
+void AsyncClient::_s_error(void * arg, int8_t err) {
+ reinterpret_cast(arg)->_error(err);
+}
+
+int8_t AsyncClient::_s_connected(void * arg, void * pcb, int8_t err){
+ return reinterpret_cast(arg)->_connected(pcb, err);
+}
+
+/*
+ Async TCP Server
+ */
+
+AsyncServer::AsyncServer(IPAddress addr, uint16_t port)
+: _port(port)
+, _addr(addr)
+, _noDelay(false)
+, _pcb(0)
+, _connect_cb(0)
+, _connect_cb_arg(0)
+{}
+
+AsyncServer::AsyncServer(uint16_t port)
+: _port(port)
+, _addr((uint32_t) IPADDR_ANY)
+, _noDelay(false)
+, _pcb(0)
+, _connect_cb(0)
+, _connect_cb_arg(0)
+{}
+
+AsyncServer::~AsyncServer(){
+ end();
+}
+
+void AsyncServer::onClient(AcConnectHandler cb, void* arg){
+ _connect_cb = cb;
+ _connect_cb_arg = arg;
+}
+
+void AsyncServer::begin(){
+ if(_pcb) {
+ return;
+ }
+
+ if(!_start_async_task()){
+ log_e("failed to start task");
+ return;
+ }
+ int8_t err;
+ _pcb = tcp_new_ip_type(IPADDR_TYPE_V4);
+ if (!_pcb){
+ log_e("_pcb == NULL");
+ return;
+ }
+
+ ip_addr_t local_addr;
+ local_addr.type = IPADDR_TYPE_V4;
+ local_addr.u_addr.ip4.addr = (uint32_t) _addr;
+ err = _tcp_bind(_pcb, &local_addr, _port);
+
+ if (err != ERR_OK) {
+ _tcp_close(_pcb, -1);
+ log_e("bind error: %d", err);
+ return;
+ }
+
+ static uint8_t backlog = 5;
+ _pcb = _tcp_listen_with_backlog(_pcb, backlog);
+ if (!_pcb) {
+ log_e("listen_pcb == NULL");
+ return;
+ }
+ tcp_arg(_pcb, (void*) this);
+ tcp_accept(_pcb, &_s_accept);
+}
+
+void AsyncServer::end(){
+ if(_pcb){
+ tcp_arg(_pcb, NULL);
+ tcp_accept(_pcb, NULL);
+ if(tcp_close(_pcb) != ERR_OK){
+ _tcp_abort(_pcb, -1);
+ }
+ _pcb = NULL;
+ }
+}
+
+//runs on LwIP thread
+int8_t AsyncServer::_accept(tcp_pcb* pcb, int8_t err){
+ //ets_printf("+A: 0x%08x\n", pcb);
+ if(_connect_cb){
+ AsyncClient *c = new AsyncClient(pcb);
+ if(c){
+ c->setNoDelay(_noDelay);
+ return _tcp_accept(this, c);
+ }
+ }
+ if(tcp_close(pcb) != ERR_OK){
+ tcp_abort(pcb);
+ }
+ log_e("FAIL");
+ return ERR_OK;
+}
+
+int8_t AsyncServer::_accepted(AsyncClient* client){
+ if(_connect_cb){
+ _connect_cb(_connect_cb_arg, client);
+ }
+ return ERR_OK;
+}
+
+void AsyncServer::setNoDelay(bool nodelay){
+ _noDelay = nodelay;
+}
+
+bool AsyncServer::getNoDelay(){
+ return _noDelay;
+}
+
+uint8_t AsyncServer::status(){
+ if (!_pcb) {
+ return 0;
+ }
+ return _pcb->state;
+}
+
+int8_t AsyncServer::_s_accept(void * arg, tcp_pcb * pcb, int8_t err){
+ return reinterpret_cast(arg)->_accept(pcb, err);
+}
+
+int8_t AsyncServer::_s_accepted(void *arg, AsyncClient* client){
+ return reinterpret_cast(arg)->_accepted(client);
+}
diff --git a/lib/libesp32/AsyncTCP/src/AsyncTCP.h b/lib/libesp32/AsyncTCP/src/AsyncTCP.h
new file mode 100644
index 000000000..ac87dedac
--- /dev/null
+++ b/lib/libesp32/AsyncTCP/src/AsyncTCP.h
@@ -0,0 +1,217 @@
+/*
+ Asynchronous TCP library for Espressif MCUs
+
+ Copyright (c) 2016 Hristo Gochkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifndef ASYNCTCP_H_
+#define ASYNCTCP_H_
+
+#include "IPAddress.h"
+#include "sdkconfig.h"
+#include
+extern "C" {
+ #include "freertos/semphr.h"
+ #include "lwip/pbuf.h"
+}
+
+//If core is not defined, then we are running in Arduino or PIO
+#ifndef CONFIG_ASYNC_TCP_RUNNING_CORE
+#define CONFIG_ASYNC_TCP_RUNNING_CORE -1 //any available core
+#define CONFIG_ASYNC_TCP_USE_WDT 1 //if enabled, adds between 33us and 200us per event
+#endif
+
+class AsyncClient;
+
+#define ASYNC_MAX_ACK_TIME 5000
+#define ASYNC_WRITE_FLAG_COPY 0x01 //will allocate new buffer to hold the data while sending (else will hold reference to the data given)
+#define ASYNC_WRITE_FLAG_MORE 0x02 //will not send PSH flag, meaning that there should be more data to be sent before the application should react.
+
+typedef std::function AcConnectHandler;
+typedef std::function AcAckHandler;
+typedef std::function AcErrorHandler;
+typedef std::function AcDataHandler;
+typedef std::function AcPacketHandler;
+typedef std::function AcTimeoutHandler;
+
+struct tcp_pcb;
+struct ip_addr;
+
+class AsyncClient {
+ public:
+ AsyncClient(tcp_pcb* pcb = 0);
+ ~AsyncClient();
+
+ AsyncClient & operator=(const AsyncClient &other);
+ AsyncClient & operator+=(const AsyncClient &other);
+
+ bool operator==(const AsyncClient &other);
+
+ bool operator!=(const AsyncClient &other) {
+ return !(*this == other);
+ }
+ bool connect(IPAddress ip, uint16_t port);
+ bool connect(const char* host, uint16_t port);
+ void close(bool now = false);
+ void stop();
+ int8_t abort();
+ bool free();
+
+ bool canSend();//ack is not pending
+ size_t space();//space available in the TCP window
+ size_t add(const char* data, size_t size, uint8_t apiflags=ASYNC_WRITE_FLAG_COPY);//add for sending
+ bool send();//send all data added with the method above
+
+ //write equals add()+send()
+ size_t write(const char* data);
+ size_t write(const char* data, size_t size, uint8_t apiflags=ASYNC_WRITE_FLAG_COPY); //only when canSend() == true
+
+ uint8_t state();
+ bool connecting();
+ bool connected();
+ bool disconnecting();
+ bool disconnected();
+ bool freeable();//disconnected or disconnecting
+
+ uint16_t getMss();
+
+ uint32_t getRxTimeout();
+ void setRxTimeout(uint32_t timeout);//no RX data timeout for the connection in seconds
+
+ uint32_t getAckTimeout();
+ void setAckTimeout(uint32_t timeout);//no ACK timeout for the last sent packet in milliseconds
+
+ void setNoDelay(bool nodelay);
+ bool getNoDelay();
+
+ uint32_t getRemoteAddress();
+ uint16_t getRemotePort();
+ uint32_t getLocalAddress();
+ uint16_t getLocalPort();
+
+ //compatibility
+ IPAddress remoteIP();
+ uint16_t remotePort();
+ IPAddress localIP();
+ uint16_t localPort();
+
+ void onConnect(AcConnectHandler cb, void* arg = 0); //on successful connect
+ void onDisconnect(AcConnectHandler cb, void* arg = 0); //disconnected
+ void onAck(AcAckHandler cb, void* arg = 0); //ack received
+ void onError(AcErrorHandler cb, void* arg = 0); //unsuccessful connect or error
+ void onData(AcDataHandler cb, void* arg = 0); //data received (called if onPacket is not used)
+ void onPacket(AcPacketHandler cb, void* arg = 0); //data received
+ void onTimeout(AcTimeoutHandler cb, void* arg = 0); //ack timeout
+ void onPoll(AcConnectHandler cb, void* arg = 0); //every 125ms when connected
+
+ void ackPacket(struct pbuf * pb);//ack pbuf from onPacket
+ size_t ack(size_t len); //ack data that you have not acked using the method below
+ void ackLater(){ _ack_pcb = false; } //will not ack the current packet. Call from onData
+
+ const char * errorToString(int8_t error);
+ const char * stateToString();
+
+ //Do not use any of the functions below!
+ static int8_t _s_poll(void *arg, struct tcp_pcb *tpcb);
+ static int8_t _s_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *pb, int8_t err);
+ static int8_t _s_fin(void *arg, struct tcp_pcb *tpcb, int8_t err);
+ static int8_t _s_lwip_fin(void *arg, struct tcp_pcb *tpcb, int8_t err);
+ static void _s_error(void *arg, int8_t err);
+ static int8_t _s_sent(void *arg, struct tcp_pcb *tpcb, uint16_t len);
+ static int8_t _s_connected(void* arg, void* tpcb, int8_t err);
+ static void _s_dns_found(const char *name, struct ip_addr *ipaddr, void *arg);
+
+ int8_t _recv(tcp_pcb* pcb, pbuf* pb, int8_t err);
+ tcp_pcb * pcb(){ return _pcb; }
+
+ protected:
+ tcp_pcb* _pcb;
+ int8_t _closed_slot;
+
+ AcConnectHandler _connect_cb;
+ void* _connect_cb_arg;
+ AcConnectHandler _discard_cb;
+ void* _discard_cb_arg;
+ AcAckHandler _sent_cb;
+ void* _sent_cb_arg;
+ AcErrorHandler _error_cb;
+ void* _error_cb_arg;
+ AcDataHandler _recv_cb;
+ void* _recv_cb_arg;
+ AcPacketHandler _pb_cb;
+ void* _pb_cb_arg;
+ AcTimeoutHandler _timeout_cb;
+ void* _timeout_cb_arg;
+ AcConnectHandler _poll_cb;
+ void* _poll_cb_arg;
+
+ bool _pcb_busy;
+ uint32_t _pcb_sent_at;
+ bool _ack_pcb;
+ uint32_t _rx_ack_len;
+ uint32_t _rx_last_packet;
+ uint32_t _rx_since_timeout;
+ uint32_t _ack_timeout;
+ uint16_t _connect_port;
+
+ int8_t _close();
+ void _free_closed_slot();
+ void _allocate_closed_slot();
+ int8_t _connected(void* pcb, int8_t err);
+ void _error(int8_t err);
+ int8_t _poll(tcp_pcb* pcb);
+ int8_t _sent(tcp_pcb* pcb, uint16_t len);
+ int8_t _fin(tcp_pcb* pcb, int8_t err);
+ int8_t _lwip_fin(tcp_pcb* pcb, int8_t err);
+ void _dns_found(struct ip_addr *ipaddr);
+
+ public:
+ AsyncClient* prev;
+ AsyncClient* next;
+};
+
+class AsyncServer {
+ public:
+ AsyncServer(IPAddress addr, uint16_t port);
+ AsyncServer(uint16_t port);
+ ~AsyncServer();
+ void onClient(AcConnectHandler cb, void* arg);
+ void begin();
+ void end();
+ void setNoDelay(bool nodelay);
+ bool getNoDelay();
+ uint8_t status();
+
+ //Do not use any of the functions below!
+ static int8_t _s_accept(void *arg, tcp_pcb* newpcb, int8_t err);
+ static int8_t _s_accepted(void *arg, AsyncClient* client);
+
+ protected:
+ uint16_t _port;
+ IPAddress _addr;
+ bool _noDelay;
+ tcp_pcb* _pcb;
+ AcConnectHandler _connect_cb;
+ void* _connect_cb_arg;
+
+ int8_t _accept(tcp_pcb* newpcb, int8_t err);
+ int8_t _accepted(AsyncClient* client);
+};
+
+
+#endif /* ASYNCTCP_H_ */
diff --git a/lib/libesp32/ESPAsyncWebServer/.gitignore b/lib/libesp32/ESPAsyncWebServer/.gitignore
new file mode 100644
index 000000000..a0f0e5386
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/.gitignore
@@ -0,0 +1,2 @@
+.vscode
+.DS_Store
diff --git a/lib/libesp32/ESPAsyncWebServer/.travis.yml b/lib/libesp32/ESPAsyncWebServer/.travis.yml
new file mode 100644
index 000000000..e1b703527
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/.travis.yml
@@ -0,0 +1,46 @@
+sudo: false
+
+language: python
+
+os:
+ - linux
+
+git:
+ depth: false
+
+stages:
+ - build
+
+jobs:
+ include:
+
+ - name: "Build Arduino ESP32"
+ if: tag IS blank AND (type = pull_request OR (type = push AND branch = master))
+ stage: build
+ script: bash $TRAVIS_BUILD_DIR/.github/scripts/on-push.sh esp32
+
+ - name: "Build Arduino ESP8266"
+ if: tag IS blank AND (type = pull_request OR (type = push AND branch = master))
+ stage: build
+ script: bash $TRAVIS_BUILD_DIR/.github/scripts/on-push.sh esp8266
+
+ - name: "Build Platformio ESP32"
+ if: tag IS blank AND (type = pull_request OR (type = push AND branch = master))
+ stage: build
+ script: bash $TRAVIS_BUILD_DIR/.github/scripts/on-push.sh esp32 1 1
+
+ - name: "Build Platformio ESP8266"
+ if: tag IS blank AND (type = pull_request OR (type = push AND branch = master))
+ stage: build
+ script: bash $TRAVIS_BUILD_DIR/.github/scripts/on-push.sh esp8266 1 1
+
+notifications:
+ email:
+ on_success: change
+ on_failure: change
+ webhooks:
+ urls:
+ - https://webhooks.gitter.im/e/60e65d0c78ea0a920347
+ on_success: change # options: [always|never|change] default: always
+ on_failure: always # options: [always|never|change] default: always
+ on_start: never # options: [always|never|change] default: always
diff --git a/lib/libesp32/ESPAsyncWebServer/CMakeLists.txt b/lib/libesp32/ESPAsyncWebServer/CMakeLists.txt
new file mode 100644
index 000000000..64292eca4
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/CMakeLists.txt
@@ -0,0 +1,17 @@
+set(COMPONENT_SRCDIRS
+ "src"
+)
+
+set(COMPONENT_ADD_INCLUDEDIRS
+ "src"
+)
+
+set(COMPONENT_REQUIRES
+ "arduino-esp32"
+ "AsyncTCP"
+)
+
+register_component()
+
+target_compile_definitions(${COMPONENT_TARGET} PUBLIC -DESP32)
+target_compile_options(${COMPONENT_TARGET} PRIVATE -fno-rtti)
diff --git a/lib/libesp32/ESPAsyncWebServer/README.md b/lib/libesp32/ESPAsyncWebServer/README.md
new file mode 100644
index 000000000..d6dd3206a
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/README.md
@@ -0,0 +1,1521 @@
+# ESPAsyncWebServer
+[](https://travis-ci.org/me-no-dev/ESPAsyncWebServer)  [](https://www.codacy.com/manual/me-no-dev/ESPAsyncWebServer?utm_source=github.com&utm_medium=referral&utm_content=me-no-dev/ESPAsyncWebServer&utm_campaign=Badge_Grade)
+
+For help and support [](https://gitter.im/me-no-dev/ESPAsyncWebServer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
+Async HTTP and WebSocket Server for ESP8266 Arduino
+
+For ESP8266 it requires [ESPAsyncTCP](https://github.com/me-no-dev/ESPAsyncTCP)
+To use this library you might need to have the latest git versions of [ESP8266](https://github.com/esp8266/Arduino) Arduino Core
+
+For ESP32 it requires [AsyncTCP](https://github.com/me-no-dev/AsyncTCP) to work
+To use this library you might need to have the latest git versions of [ESP32](https://github.com/espressif/arduino-esp32) Arduino Core
+
+## Table of contents
+- [ESPAsyncWebServer](#espasyncwebserver)
+ - [Table of contents](#table-of-contents)
+ - [Installation](#installation)
+ - [Using PlatformIO](#using-platformio)
+ - [Why should you care](#why-should-you-care)
+ - [Important things to remember](#important-things-to-remember)
+ - [Principles of operation](#principles-of-operation)
+ - [The Async Web server](#the-async-web-server)
+ - [Request Life Cycle](#request-life-cycle)
+ - [Rewrites and how do they work](#rewrites-and-how-do-they-work)
+ - [Handlers and how do they work](#handlers-and-how-do-they-work)
+ - [Responses and how do they work](#responses-and-how-do-they-work)
+ - [Template processing](#template-processing)
+ - [Libraries and projects that use AsyncWebServer](#libraries-and-projects-that-use-asyncwebserver)
+ - [Request Variables](#request-variables)
+ - [Common Variables](#common-variables)
+ - [Headers](#headers)
+ - [GET, POST and FILE parameters](#get-post-and-file-parameters)
+ - [FILE Upload handling](#file-upload-handling)
+ - [Body data handling](#body-data-handling)
+ - [JSON body handling with ArduinoJson](#json-body-handling-with-arduinojson)
+ - [Responses](#responses)
+ - [Redirect to another URL](#redirect-to-another-url)
+ - [Basic response with HTTP Code](#basic-response-with-http-code)
+ - [Basic response with HTTP Code and extra headers](#basic-response-with-http-code-and-extra-headers)
+ - [Basic response with string content](#basic-response-with-string-content)
+ - [Basic response with string content and extra headers](#basic-response-with-string-content-and-extra-headers)
+ - [Send large webpage from PROGMEM](#send-large-webpage-from-progmem)
+ - [Send large webpage from PROGMEM and extra headers](#send-large-webpage-from-progmem-and-extra-headers)
+ - [Send large webpage from PROGMEM containing templates](#send-large-webpage-from-progmem-containing-templates)
+ - [Send large webpage from PROGMEM containing templates and extra headers](#send-large-webpage-from-progmem-containing-templates-and-extra-headers)
+ - [Send binary content from PROGMEM](#send-binary-content-from-progmem)
+ - [Respond with content coming from a Stream](#respond-with-content-coming-from-a-stream)
+ - [Respond with content coming from a Stream and extra headers](#respond-with-content-coming-from-a-stream-and-extra-headers)
+ - [Respond with content coming from a Stream containing templates](#respond-with-content-coming-from-a-stream-containing-templates)
+ - [Respond with content coming from a Stream containing templates and extra headers](#respond-with-content-coming-from-a-stream-containing-templates-and-extra-headers)
+ - [Respond with content coming from a File](#respond-with-content-coming-from-a-file)
+ - [Respond with content coming from a File and extra headers](#respond-with-content-coming-from-a-file-and-extra-headers)
+ - [Respond with content coming from a File containing templates](#respond-with-content-coming-from-a-file-containing-templates)
+ - [Respond with content using a callback](#respond-with-content-using-a-callback)
+ - [Respond with content using a callback and extra headers](#respond-with-content-using-a-callback-and-extra-headers)
+ - [Respond with content using a callback containing templates](#respond-with-content-using-a-callback-containing-templates)
+ - [Respond with content using a callback containing templates and extra headers](#respond-with-content-using-a-callback-containing-templates-and-extra-headers)
+ - [Chunked Response](#chunked-response)
+ - [Chunked Response containing templates](#chunked-response-containing-templates)
+ - [Print to response](#print-to-response)
+ - [ArduinoJson Basic Response](#arduinojson-basic-response)
+ - [ArduinoJson Advanced Response](#arduinojson-advanced-response)
+ - [Serving static files](#serving-static-files)
+ - [Serving specific file by name](#serving-specific-file-by-name)
+ - [Serving files in directory](#serving-files-in-directory)
+ - [Serving static files with authentication](#serving-static-files-with-authentication)
+ - [Specifying Cache-Control header](#specifying-cache-control-header)
+ - [Specifying Date-Modified header](#specifying-date-modified-header)
+ - [Specifying Template Processor callback](#specifying-template-processor-callback)
+ - [Param Rewrite With Matching](#param-rewrite-with-matching)
+ - [Using filters](#using-filters)
+ - [Serve different site files in AP mode](#serve-different-site-files-in-ap-mode)
+ - [Rewrite to different index on AP](#rewrite-to-different-index-on-ap)
+ - [Serving different hosts](#serving-different-hosts)
+ - [Determine interface inside callbacks](#determine-interface-inside-callbacks)
+ - [Bad Responses](#bad-responses)
+ - [Respond with content using a callback without content length to HTTP/1.0 clients](#respond-with-content-using-a-callback-without-content-length-to-http10-clients)
+ - [Async WebSocket Plugin](#async-websocket-plugin)
+ - [Async WebSocket Event](#async-websocket-event)
+ - [Methods for sending data to a socket client](#methods-for-sending-data-to-a-socket-client)
+ - [Direct access to web socket message buffer](#direct-access-to-web-socket-message-buffer)
+ - [Limiting the number of web socket clients](#limiting-the-number-of-web-socket-clients)
+ - [Async Event Source Plugin](#async-event-source-plugin)
+ - [Setup Event Source on the server](#setup-event-source-on-the-server)
+ - [Setup Event Source in the browser](#setup-event-source-in-the-browser)
+ - [Scanning for available WiFi Networks](#scanning-for-available-wifi-networks)
+ - [Remove handlers and rewrites](#remove-handlers-and-rewrites)
+ - [Setting up the server](#setting-up-the-server)
+ - [Setup global and class functions as request handlers](#setup-global-and-class-functions-as-request-handlers)
+ - [Methods for controlling websocket connections](#methods-for-controlling-websocket-connections)
+ - [Adding Default Headers](#adding-default-headers)
+ - [Path variable](#path-variable)
+
+## Installation
+
+### Using PlatformIO
+
+[PlatformIO](http://platformio.org) is an open source ecosystem for IoT development with cross platform build system, library manager and full support for Espressif ESP8266/ESP32 development. It works on the popular host OS: Mac OS X, Windows, Linux 32/64, Linux ARM (like Raspberry Pi, BeagleBone, CubieBoard).
+
+1. Install [PlatformIO IDE](http://platformio.org/platformio-ide)
+2. Create new project using "PlatformIO Home > New Project"
+3. Update dev/platform to staging version:
+ - [Instruction for Espressif 8266](http://docs.platformio.org/en/latest/platforms/espressif8266.html#using-arduino-framework-with-staging-version)
+ - [Instruction for Espressif 32](http://docs.platformio.org/en/latest/platforms/espressif32.html#using-arduino-framework-with-staging-version)
+ 4. Add "ESP Async WebServer" to project using [Project Configuration File `platformio.ini`](http://docs.platformio.org/page/projectconf.html) and [lib_deps](http://docs.platformio.org/page/projectconf/section_env_library.html#lib-deps) option:
+
+```ini
+[env:myboard]
+platform = espressif...
+board = ...
+framework = arduino
+
+# using the latest stable version
+lib_deps = ESP Async WebServer
+
+# or using GIT Url (the latest development version)
+lib_deps = https://github.com/me-no-dev/ESPAsyncWebServer.git
+```
+ 5. Happy coding with PlatformIO!
+
+## Why should you care
+- Using asynchronous network means that you can handle more than one connection at the same time
+- You are called once the request is ready and parsed
+- When you send the response, you are immediately ready to handle other connections
+ while the server is taking care of sending the response in the background
+- Speed is OMG
+- Easy to use API, HTTP Basic and Digest MD5 Authentication (default), ChunkedResponse
+- Easily extendible to handle any type of content
+- Supports Continue 100
+- Async WebSocket plugin offering different locations without extra servers or ports
+- Async EventSource (Server-Sent Events) plugin to send events to the browser
+- URL Rewrite plugin for conditional and permanent url rewrites
+- ServeStatic plugin that supports cache, Last-Modified, default index and more
+- Simple template processing engine to handle templates
+
+## Important things to remember
+- This is fully asynchronous server and as such does not run on the loop thread.
+- You can not use yield or delay or any function that uses them inside the callbacks
+- The server is smart enough to know when to close the connection and free resources
+- You can not send more than one response to a single request
+
+## Principles of operation
+
+### The Async Web server
+- Listens for connections
+- Wraps the new clients into ```Request```
+- Keeps track of clients and cleans memory
+- Manages ```Rewrites``` and apply them on the request url
+- Manages ```Handlers``` and attaches them to Requests
+
+### Request Life Cycle
+- TCP connection is received by the server
+- The connection is wrapped inside ```Request``` object
+- When the request head is received (type, url, get params, http version and host),
+ the server goes through all ```Rewrites``` (in the order they were added) to rewrite the url and inject query parameters,
+ next, it goes through all attached ```Handlers```(in the order they were added) trying to find one
+ that ```canHandle``` the given request. If none are found, the default(catch-all) handler is attached.
+- The rest of the request is received, calling the ```handleUpload``` or ```handleBody``` methods of the ```Handler``` if they are needed (POST+File/Body)
+- When the whole request is parsed, the result is given to the ```handleRequest``` method of the ```Handler``` and is ready to be responded to
+- In the ```handleRequest``` method, to the ```Request``` is attached a ```Response``` object (see below) that will serve the response data back to the client
+- When the ```Response``` is sent, the client is closed and freed from the memory
+
+### Rewrites and how do they work
+- The ```Rewrites``` are used to rewrite the request url and/or inject get parameters for a specific request url path.
+- All ```Rewrites``` are evaluated on the request in the order they have been added to the server.
+- The ```Rewrite``` will change the request url only if the request url (excluding get parameters) is fully match
+ the rewrite url, and when the optional ```Filter``` callback return true.
+- Setting a ```Filter``` to the ```Rewrite``` enables to control when to apply the rewrite, decision can be based on
+ request url, http version, request host/port/target host, get parameters or the request client's localIP or remoteIP.
+- Two filter callbacks are provided: ```ON_AP_FILTER``` to execute the rewrite when request is made to the AP interface,
+ ```ON_STA_FILTER``` to execute the rewrite when request is made to the STA interface.
+- The ```Rewrite``` can specify a target url with optional get parameters, e.g. ```/to-url?with=params```
+
+### Handlers and how do they work
+- The ```Handlers``` are used for executing specific actions to particular requests
+- One ```Handler``` instance can be attached to any request and lives together with the server
+- Setting a ```Filter``` to the ```Handler``` enables to control when to apply the handler, decision can be based on
+ request url, http version, request host/port/target host, get parameters or the request client's localIP or remoteIP.
+- Two filter callbacks are provided: ```ON_AP_FILTER``` to execute the rewrite when request is made to the AP interface,
+ ```ON_STA_FILTER``` to execute the rewrite when request is made to the STA interface.
+- The ```canHandle``` method is used for handler specific control on whether the requests can be handled
+ and for declaring any interesting headers that the ```Request``` should parse. Decision can be based on request
+ method, request url, http version, request host/port/target host and get parameters
+- Once a ```Handler``` is attached to given ```Request``` (```canHandle``` returned true)
+ that ```Handler``` takes care to receive any file/data upload and attach a ```Response```
+ once the ```Request``` has been fully parsed
+- ```Handlers``` are evaluated in the order they are attached to the server. The ```canHandle``` is called only
+ if the ```Filter``` that was set to the ```Handler``` return true.
+- The first ```Handler``` that can handle the request is selected, not further ```Filter``` and ```canHandle``` are called.
+
+### Responses and how do they work
+- The ```Response``` objects are used to send the response data back to the client
+- The ```Response``` object lives with the ```Request``` and is freed on end or disconnect
+- Different techniques are used depending on the response type to send the data in packets
+ returning back almost immediately and sending the next packet when this one is received.
+ Any time in between is spent to run the user loop and handle other network packets
+- Responding asynchronously is probably the most difficult thing for most to understand
+- Many different options exist for the user to make responding a background task
+
+### Template processing
+- ESPAsyncWebserver contains simple template processing engine.
+- Template processing can be added to most response types.
+- Currently it supports only replacing template placeholders with actual values. No conditional processing, cycles, etc.
+- Placeholders are delimited with ```%``` symbols. Like this: ```%TEMPLATE_PLACEHOLDER%```.
+- It works by extracting placeholder name from response text and passing it to user provided function which should return actual value to be used instead of placeholder.
+- Since it's user provided function, it is possible for library users to implement conditional processing and cycles themselves.
+- Since it's impossible to know the actual response size after template processing step in advance (and, therefore, to include it in response headers), the response becomes [chunked](#chunked-response).
+
+## Libraries and projects that use AsyncWebServer
+- [WebSocketToSerial](https://github.com/hallard/WebSocketToSerial) - Debug serial devices through the web browser
+- [Sattrack](https://github.com/Hopperpop/Sattrack) - Track the ISS with ESP8266
+- [ESP Radio](https://github.com/Edzelf/Esp-radio) - Icecast radio based on ESP8266 and VS1053
+- [VZero](https://github.com/andig/vzero) - the Wireless zero-config controller for volkszaehler.org
+- [ESPurna](https://bitbucket.org/xoseperez/espurna) - ESPurna ("spark" in Catalan) is a custom C firmware for ESP8266 based smart switches. It was originally developed with the ITead Sonoff in mind.
+- [fauxmoESP](https://bitbucket.org/xoseperez/fauxmoesp) - Belkin WeMo emulator library for ESP8266.
+- [ESP-RFID](https://github.com/omersiar/esp-rfid) - MFRC522 RFID Access Control Management project for ESP8266.
+
+## Request Variables
+
+### Common Variables
+```cpp
+request->version(); // uint8_t: 0 = HTTP/1.0, 1 = HTTP/1.1
+request->method(); // enum: HTTP_GET, HTTP_POST, HTTP_DELETE, HTTP_PUT, HTTP_PATCH, HTTP_HEAD, HTTP_OPTIONS
+request->url(); // String: URL of the request (not including host, port or GET parameters)
+request->host(); // String: The requested host (can be used for virtual hosting)
+request->contentType(); // String: ContentType of the request (not avaiable in Handler::canHandle)
+request->contentLength(); // size_t: ContentLength of the request (not avaiable in Handler::canHandle)
+request->multipart(); // bool: True if the request has content type "multipart"
+```
+
+### Headers
+```cpp
+//List all collected headers
+int headers = request->headers();
+int i;
+for(i=0;igetHeader(i);
+ Serial.printf("HEADER[%s]: %s\n", h->name().c_str(), h->value().c_str());
+}
+
+//get specific header by name
+if(request->hasHeader("MyHeader")){
+ AsyncWebHeader* h = request->getHeader("MyHeader");
+ Serial.printf("MyHeader: %s\n", h->value().c_str());
+}
+
+//List all collected headers (Compatibility)
+int headers = request->headers();
+int i;
+for(i=0;iheaderName(i).c_str(), request->header(i).c_str());
+}
+
+//get specific header by name (Compatibility)
+if(request->hasHeader("MyHeader")){
+ Serial.printf("MyHeader: %s\n", request->header("MyHeader").c_str());
+}
+```
+
+### GET, POST and FILE parameters
+```cpp
+//List all parameters
+int params = request->params();
+for(int i=0;igetParam(i);
+ if(p->isFile()){ //p->isPost() is also true
+ Serial.printf("FILE[%s]: %s, size: %u\n", p->name().c_str(), p->value().c_str(), p->size());
+ } else if(p->isPost()){
+ Serial.printf("POST[%s]: %s\n", p->name().c_str(), p->value().c_str());
+ } else {
+ Serial.printf("GET[%s]: %s\n", p->name().c_str(), p->value().c_str());
+ }
+}
+
+//Check if GET parameter exists
+if(request->hasParam("download"))
+ AsyncWebParameter* p = request->getParam("download");
+
+//Check if POST (but not File) parameter exists
+if(request->hasParam("download", true))
+ AsyncWebParameter* p = request->getParam("download", true);
+
+//Check if FILE was uploaded
+if(request->hasParam("download", true, true))
+ AsyncWebParameter* p = request->getParam("download", true, true);
+
+//List all parameters (Compatibility)
+int args = request->args();
+for(int i=0;iargName(i).c_str(), request->arg(i).c_str());
+}
+
+//Check if parameter exists (Compatibility)
+if(request->hasArg("download"))
+ String arg = request->arg("download");
+```
+
+### FILE Upload handling
+```cpp
+void handleUpload(AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final){
+ if(!index){
+ Serial.printf("UploadStart: %s\n", filename.c_str());
+ }
+ for(size_t i=0; i();
+ // ...
+});
+server.addHandler(handler);
+```
+
+## Responses
+### Redirect to another URL
+```cpp
+//to local url
+request->redirect("/login");
+
+//to external url
+request->redirect("http://esp8266.com");
+```
+
+### Basic response with HTTP Code
+```cpp
+request->send(404); //Sends 404 File Not Found
+```
+
+### Basic response with HTTP Code and extra headers
+```cpp
+AsyncWebServerResponse *response = request->beginResponse(404); //Sends 404 File Not Found
+response->addHeader("Server","ESP Async Web Server");
+request->send(response);
+```
+
+### Basic response with string content
+```cpp
+request->send(200, "text/plain", "Hello World!");
+```
+
+### Basic response with string content and extra headers
+```cpp
+AsyncWebServerResponse *response = request->beginResponse(200, "text/plain", "Hello World!");
+response->addHeader("Server","ESP Async Web Server");
+request->send(response);
+```
+
+### Send large webpage from PROGMEM
+```cpp
+const char index_html[] PROGMEM = "..."; // large char array, tested with 14k
+request->send_P(200, "text/html", index_html);
+```
+
+### Send large webpage from PROGMEM and extra headers
+```cpp
+const char index_html[] PROGMEM = "..."; // large char array, tested with 14k
+AsyncWebServerResponse *response = request->beginResponse_P(200, "text/html", index_html);
+response->addHeader("Server","ESP Async Web Server");
+request->send(response);
+```
+
+### Send large webpage from PROGMEM containing templates
+```cpp
+String processor(const String& var)
+{
+ if(var == "HELLO_FROM_TEMPLATE")
+ return F("Hello world!");
+ return String();
+}
+
+// ...
+
+const char index_html[] PROGMEM = "..."; // large char array, tested with 14k
+request->send_P(200, "text/html", index_html, processor);
+```
+
+### Send large webpage from PROGMEM containing templates and extra headers
+```cpp
+String processor(const String& var)
+{
+ if(var == "HELLO_FROM_TEMPLATE")
+ return F("Hello world!");
+ return String();
+}
+
+// ...
+
+const char index_html[] PROGMEM = "..."; // large char array, tested with 14k
+AsyncWebServerResponse *response = request->beginResponse_P(200, "text/html", index_html, processor);
+response->addHeader("Server","ESP Async Web Server");
+request->send(response);
+```
+
+### Send binary content from PROGMEM
+```cpp
+
+//File: favicon.ico.gz, Size: 726
+#define favicon_ico_gz_len 726
+const uint8_t favicon_ico_gz[] PROGMEM = {
+ 0x1F, 0x8B, 0x08, 0x08, 0x0B, 0x87, 0x90, 0x57, 0x00, 0x03, 0x66, 0x61, 0x76, 0x69, 0x63, 0x6F,
+ 0x6E, 0x2E, 0x69, 0x63, 0x6F, 0x00, 0xCD, 0x53, 0x5F, 0x48, 0x9A, 0x51, 0x14, 0xBF, 0x62, 0x6D,
+ 0x86, 0x96, 0xA9, 0x64, 0xD3, 0xFE, 0xA8, 0x99, 0x65, 0x1A, 0xB4, 0x8A, 0xA8, 0x51, 0x54, 0x23,
+ 0xA8, 0x11, 0x49, 0x51, 0x8A, 0x34, 0x62, 0x93, 0x85, 0x31, 0x58, 0x44, 0x12, 0x45, 0x2D, 0x58,
+ 0xF5, 0x52, 0x41, 0x10, 0x23, 0x82, 0xA0, 0x20, 0x98, 0x2F, 0xC1, 0x26, 0xED, 0xA1, 0x20, 0x89,
+ 0x04, 0xD7, 0x83, 0x58, 0x20, 0x28, 0x04, 0xAB, 0xD1, 0x9B, 0x8C, 0xE5, 0xC3, 0x60, 0x32, 0x64,
+ 0x0E, 0x56, 0xBF, 0x9D, 0xEF, 0xF6, 0x30, 0x82, 0xED, 0xAD, 0x87, 0xDD, 0x8F, 0xF3, 0xDD, 0x8F,
+ 0x73, 0xCF, 0xEF, 0x9C, 0xDF, 0x39, 0xBF, 0xFB, 0x31, 0x26, 0xA2, 0x27, 0x37, 0x97, 0xD1, 0x5B,
+ 0xCF, 0x9E, 0x67, 0x30, 0xA6, 0x66, 0x8C, 0x99, 0xC9, 0xC8, 0x45, 0x9E, 0x6B, 0x3F, 0x5F, 0x74,
+ 0xA6, 0x94, 0x5E, 0xDB, 0xFF, 0xB2, 0xE6, 0xE7, 0xE7, 0xF9, 0xDE, 0xD6, 0xD6, 0x96, 0xDB, 0xD8,
+ 0xD8, 0x78, 0xBF, 0xA1, 0xA1, 0xC1, 0xDA, 0xDC, 0xDC, 0x2C, 0xEB, 0xED, 0xED, 0x15, 0x9B, 0xCD,
+ 0xE6, 0x4A, 0x83, 0xC1, 0xE0, 0x2E, 0x29, 0x29, 0x99, 0xD6, 0x6A, 0xB5, 0x4F, 0x75, 0x3A, 0x9D,
+ 0x61, 0x75, 0x75, 0x95, 0xB5, 0xB7, 0xB7, 0xDF, 0xC8, 0xD1, 0xD4, 0xD4, 0xF4, 0xB0, 0xBA, 0xBA,
+ 0xFA, 0x83, 0xD5, 0x6A, 0xFD, 0x5A, 0x5E, 0x5E, 0x9E, 0x28, 0x2D, 0x2D, 0x0D, 0x10, 0xC6, 0x4B,
+ 0x98, 0x78, 0x5E, 0x5E, 0xDE, 0x95, 0x42, 0xA1, 0x40, 0x4E, 0x4E, 0xCE, 0x65, 0x76, 0x76, 0xF6,
+ 0x47, 0xB5, 0x5A, 0x6D, 0x4F, 0x26, 0x93, 0xA2, 0xD6, 0xD6, 0x56, 0x8E, 0x6D, 0x69, 0x69, 0xD1,
+ 0x11, 0x36, 0x62, 0xB1, 0x58, 0x60, 0x32, 0x99, 0xA0, 0xD7, 0xEB, 0x51, 0x58, 0x58, 0x88, 0xFC,
+ 0xFC, 0x7C, 0x10, 0x16, 0x02, 0x56, 0x2E, 0x97, 0x43, 0x2A, 0x95, 0x42, 0x2C, 0x16, 0x23, 0x33,
+ 0x33, 0x33, 0xAE, 0x52, 0xA9, 0x1E, 0x64, 0x65, 0x65, 0x71, 0x7C, 0x7D, 0x7D, 0xBD, 0x93, 0xEA,
+ 0xFE, 0x30, 0x1A, 0x8D, 0xE8, 0xEC, 0xEC, 0xC4, 0xE2, 0xE2, 0x22, 0x6A, 0x6A, 0x6A, 0x40, 0x39,
+ 0x41, 0xB5, 0x38, 0x4E, 0xC8, 0x33, 0x3C, 0x3C, 0x0C, 0x87, 0xC3, 0xC1, 0x6B, 0x54, 0x54, 0x54,
+ 0xBC, 0xE9, 0xEB, 0xEB, 0x93, 0x5F, 0x5C, 0x5C, 0x30, 0x8A, 0x9D, 0x2E, 0x2B, 0x2B, 0xBB, 0xA2,
+ 0x3E, 0x41, 0xBD, 0x21, 0x1E, 0x8F, 0x63, 0x6A, 0x6A, 0x0A, 0x81, 0x40, 0x00, 0x94, 0x1B, 0x3D,
+ 0x3D, 0x3D, 0x42, 0x3C, 0x96, 0x96, 0x96, 0x70, 0x7E, 0x7E, 0x8E, 0xE3, 0xE3, 0x63, 0xF8, 0xFD,
+ 0xFE, 0xB4, 0xD7, 0xEB, 0xF5, 0x8F, 0x8F, 0x8F, 0x5B, 0x68, 0x5E, 0x6F, 0x05, 0xCE, 0xB4, 0xE3,
+ 0xE8, 0xE8, 0x08, 0x27, 0x27, 0x27, 0xD8, 0xDF, 0xDF, 0xC7, 0xD9, 0xD9, 0x19, 0x6C, 0x36, 0x1B,
+ 0x36, 0x36, 0x36, 0x38, 0x9F, 0x85, 0x85, 0x05, 0xAC, 0xAF, 0xAF, 0x23, 0x1A, 0x8D, 0x22, 0x91,
+ 0x48, 0x20, 0x16, 0x8B, 0xFD, 0xDA, 0xDA, 0xDA, 0x7A, 0x41, 0x33, 0x7E, 0x57, 0x50, 0x50, 0x80,
+ 0x89, 0x89, 0x09, 0x84, 0xC3, 0x61, 0x6C, 0x6F, 0x6F, 0x23, 0x12, 0x89, 0xE0, 0xE0, 0xE0, 0x00,
+ 0x43, 0x43, 0x43, 0x58, 0x5E, 0x5E, 0xE6, 0x9C, 0x7D, 0x3E, 0x1F, 0x46, 0x47, 0x47, 0x79, 0xBE,
+ 0xBD, 0xBD, 0x3D, 0xE1, 0x3C, 0x1D, 0x0C, 0x06, 0x9F, 0x10, 0xB7, 0xC7, 0x84, 0x4F, 0xF6, 0xF7,
+ 0xF7, 0x63, 0x60, 0x60, 0x00, 0x83, 0x83, 0x83, 0x18, 0x19, 0x19, 0xC1, 0xDC, 0xDC, 0x1C, 0x8F,
+ 0x17, 0x7C, 0xA4, 0x27, 0xE7, 0x34, 0x39, 0x39, 0x89, 0x9D, 0x9D, 0x1D, 0x6E, 0x54, 0xE3, 0x13,
+ 0xE5, 0x34, 0x11, 0x37, 0x49, 0x51, 0x51, 0xD1, 0x4B, 0xA5, 0x52, 0xF9, 0x45, 0x26, 0x93, 0x5D,
+ 0x0A, 0xF3, 0x92, 0x48, 0x24, 0xA0, 0x6F, 0x14, 0x17, 0x17, 0xA3, 0xB6, 0xB6, 0x16, 0x5D, 0x5D,
+ 0x5D, 0x7C, 0x1E, 0xBB, 0xBB, 0xBB, 0x9C, 0xD7, 0xE1, 0xE1, 0x21, 0x42, 0xA1, 0xD0, 0x6B, 0xD2,
+ 0x45, 0x4C, 0x33, 0x12, 0x34, 0xCC, 0xA0, 0x19, 0x54, 0x92, 0x56, 0x0E, 0xD2, 0xD9, 0x43, 0xF8,
+ 0xCF, 0x82, 0x56, 0xC2, 0xDC, 0xEB, 0xEA, 0xEA, 0x38, 0x7E, 0x6C, 0x6C, 0x4C, 0xE0, 0xFE, 0x9D,
+ 0xB8, 0xBF, 0xA7, 0xFA, 0xAF, 0x56, 0x56, 0x56, 0xEE, 0x6D, 0x6E, 0x6E, 0xDE, 0xB8, 0x47, 0x55,
+ 0x55, 0x55, 0x6C, 0x66, 0x66, 0x46, 0x44, 0xDA, 0x3B, 0x34, 0x1A, 0x4D, 0x94, 0xB0, 0x3F, 0x09,
+ 0x7B, 0x45, 0xBD, 0xA5, 0x5D, 0x2E, 0x57, 0x8C, 0x7A, 0x73, 0xD9, 0xED, 0xF6, 0x3B, 0x84, 0xFF,
+ 0xE7, 0x7D, 0xA6, 0x3A, 0x2C, 0x95, 0x4A, 0xB1, 0x8E, 0x8E, 0x0E, 0x6D, 0x77, 0x77, 0xB7, 0xCD,
+ 0xE9, 0x74, 0x3E, 0x73, 0xBB, 0xDD, 0x8F, 0x3C, 0x1E, 0x8F, 0xE6, 0xF4, 0xF4, 0x94, 0xAD, 0xAD,
+ 0xAD, 0xDD, 0xDE, 0xCF, 0x73, 0x0B, 0x0B, 0xB8, 0xB6, 0xE0, 0x5D, 0xC6, 0x66, 0xC5, 0xE4, 0x10,
+ 0x4C, 0xF4, 0xF7, 0xD8, 0x59, 0xF2, 0x7F, 0xA3, 0xB8, 0xB4, 0xFC, 0x0F, 0xEE, 0x37, 0x70, 0xEC,
+ 0x16, 0x4A, 0x7E, 0x04, 0x00, 0x00
+};
+
+AsyncWebServerResponse *response = request->beginResponse_P(200, "image/x-icon", favicon_ico_gz, favicon_ico_gz_len);
+response->addHeader("Content-Encoding", "gzip");
+request->send(response);
+```
+
+### Respond with content coming from a Stream
+```cpp
+//read 12 bytes from Serial and send them as Content Type text/plain
+request->send(Serial, "text/plain", 12);
+```
+
+### Respond with content coming from a Stream and extra headers
+```cpp
+//read 12 bytes from Serial and send them as Content Type text/plain
+AsyncWebServerResponse *response = request->beginResponse(Serial, "text/plain", 12);
+response->addHeader("Server","ESP Async Web Server");
+request->send(response);
+```
+
+### Respond with content coming from a Stream containing templates
+```cpp
+String processor(const String& var)
+{
+ if(var == "HELLO_FROM_TEMPLATE")
+ return F("Hello world!");
+ return String();
+}
+
+// ...
+
+//read 12 bytes from Serial and send them as Content Type text/plain
+request->send(Serial, "text/plain", 12, processor);
+```
+
+### Respond with content coming from a Stream containing templates and extra headers
+```cpp
+String processor(const String& var)
+{
+ if(var == "HELLO_FROM_TEMPLATE")
+ return F("Hello world!");
+ return String();
+}
+
+// ...
+
+//read 12 bytes from Serial and send them as Content Type text/plain
+AsyncWebServerResponse *response = request->beginResponse(Serial, "text/plain", 12, processor);
+response->addHeader("Server","ESP Async Web Server");
+request->send(response);
+```
+
+### Respond with content coming from a File
+```cpp
+//Send index.htm with default content type
+request->send(SPIFFS, "/index.htm");
+
+//Send index.htm as text
+request->send(SPIFFS, "/index.htm", "text/plain");
+
+//Download index.htm
+request->send(SPIFFS, "/index.htm", String(), true);
+```
+
+### Respond with content coming from a File and extra headers
+```cpp
+//Send index.htm with default content type
+AsyncWebServerResponse *response = request->beginResponse(SPIFFS, "/index.htm");
+
+//Send index.htm as text
+AsyncWebServerResponse *response = request->beginResponse(SPIFFS, "/index.htm", "text/plain");
+
+//Download index.htm
+AsyncWebServerResponse *response = request->beginResponse(SPIFFS, "/index.htm", String(), true);
+
+response->addHeader("Server","ESP Async Web Server");
+request->send(response);
+```
+
+### Respond with content coming from a File containing templates
+Internally uses [Chunked Response](#chunked-response).
+
+Index.htm contents:
+```
+%HELLO_FROM_TEMPLATE%
+```
+
+Somewhere in source files:
+```cpp
+String processor(const String& var)
+{
+ if(var == "HELLO_FROM_TEMPLATE")
+ return F("Hello world!");
+ return String();
+}
+
+// ...
+
+//Send index.htm with template processor function
+request->send(SPIFFS, "/index.htm", String(), false, processor);
+```
+
+### Respond with content using a callback
+```cpp
+//send 128 bytes as plain text
+request->send("text/plain", 128, [](uint8_t *buffer, size_t maxLen, size_t index) -> size_t {
+ //Write up to "maxLen" bytes into "buffer" and return the amount written.
+ //index equals the amount of bytes that have been already sent
+ //You will not be asked for more bytes once the content length has been reached.
+ //Keep in mind that you can not delay or yield waiting for more data!
+ //Send what you currently have and you will be asked for more again
+ return mySource.read(buffer, maxLen);
+});
+```
+
+### Respond with content using a callback and extra headers
+```cpp
+//send 128 bytes as plain text
+AsyncWebServerResponse *response = request->beginResponse("text/plain", 128, [](uint8_t *buffer, size_t maxLen, size_t index) -> size_t {
+ //Write up to "maxLen" bytes into "buffer" and return the amount written.
+ //index equals the amount of bytes that have been already sent
+ //You will not be asked for more bytes once the content length has been reached.
+ //Keep in mind that you can not delay or yield waiting for more data!
+ //Send what you currently have and you will be asked for more again
+ return mySource.read(buffer, maxLen);
+});
+response->addHeader("Server","ESP Async Web Server");
+request->send(response);
+```
+
+### Respond with content using a callback containing templates
+```cpp
+String processor(const String& var)
+{
+ if(var == "HELLO_FROM_TEMPLATE")
+ return F("Hello world!");
+ return String();
+}
+
+// ...
+
+//send 128 bytes as plain text
+request->send("text/plain", 128, [](uint8_t *buffer, size_t maxLen, size_t index) -> size_t {
+ //Write up to "maxLen" bytes into "buffer" and return the amount written.
+ //index equals the amount of bytes that have been already sent
+ //You will not be asked for more bytes once the content length has been reached.
+ //Keep in mind that you can not delay or yield waiting for more data!
+ //Send what you currently have and you will be asked for more again
+ return mySource.read(buffer, maxLen);
+}, processor);
+```
+
+### Respond with content using a callback containing templates and extra headers
+```cpp
+String processor(const String& var)
+{
+ if(var == "HELLO_FROM_TEMPLATE")
+ return F("Hello world!");
+ return String();
+}
+
+// ...
+
+//send 128 bytes as plain text
+AsyncWebServerResponse *response = request->beginResponse("text/plain", 128, [](uint8_t *buffer, size_t maxLen, size_t index) -> size_t {
+ //Write up to "maxLen" bytes into "buffer" and return the amount written.
+ //index equals the amount of bytes that have been already sent
+ //You will not be asked for more bytes once the content length has been reached.
+ //Keep in mind that you can not delay or yield waiting for more data!
+ //Send what you currently have and you will be asked for more again
+ return mySource.read(buffer, maxLen);
+}, processor);
+response->addHeader("Server","ESP Async Web Server");
+request->send(response);
+```
+
+### Chunked Response
+Used when content length is unknown. Works best if the client supports HTTP/1.1
+```cpp
+AsyncWebServerResponse *response = request->beginChunkedResponse("text/plain", [](uint8_t *buffer, size_t maxLen, size_t index) -> size_t {
+ //Write up to "maxLen" bytes into "buffer" and return the amount written.
+ //index equals the amount of bytes that have been already sent
+ //You will be asked for more data until 0 is returned
+ //Keep in mind that you can not delay or yield waiting for more data!
+ return mySource.read(buffer, maxLen);
+});
+response->addHeader("Server","ESP Async Web Server");
+request->send(response);
+```
+
+### Chunked Response containing templates
+Used when content length is unknown. Works best if the client supports HTTP/1.1
+```cpp
+String processor(const String& var)
+{
+ if(var == "HELLO_FROM_TEMPLATE")
+ return F("Hello world!");
+ return String();
+}
+
+// ...
+
+AsyncWebServerResponse *response = request->beginChunkedResponse("text/plain", [](uint8_t *buffer, size_t maxLen, size_t index) -> size_t {
+ //Write up to "maxLen" bytes into "buffer" and return the amount written.
+ //index equals the amount of bytes that have been already sent
+ //You will be asked for more data until 0 is returned
+ //Keep in mind that you can not delay or yield waiting for more data!
+ return mySource.read(buffer, maxLen);
+}, processor);
+response->addHeader("Server","ESP Async Web Server");
+request->send(response);
+```
+
+### Print to response
+```cpp
+AsyncResponseStream *response = request->beginResponseStream("text/html");
+response->addHeader("Server","ESP Async Web Server");
+response->printf("Webpage at %s", request->url().c_str());
+
+response->print("Hello ");
+response->print(request->client()->remoteIP());
+response->print("
");
+
+response->print("General
");
+response->print("");
+response->printf("- Version: HTTP/1.%u
", request->version());
+response->printf("- Method: %s
", request->methodToString());
+response->printf("- URL: %s
", request->url().c_str());
+response->printf("- Host: %s
", request->host().c_str());
+response->printf("- ContentType: %s
", request->contentType().c_str());
+response->printf("- ContentLength: %u
", request->contentLength());
+response->printf("- Multipart: %s
", request->multipart()?"true":"false");
+response->print("
");
+
+response->print("Headers
");
+response->print("");
+int headers = request->headers();
+for(int i=0;igetHeader(i);
+ response->printf("- %s: %s
", h->name().c_str(), h->value().c_str());
+}
+response->print("
");
+
+response->print("Parameters
");
+response->print("");
+int params = request->params();
+for(int i=0;igetParam(i);
+ if(p->isFile()){
+ response->printf("- FILE[%s]: %s, size: %u
", p->name().c_str(), p->value().c_str(), p->size());
+ } else if(p->isPost()){
+ response->printf("- POST[%s]: %s
", p->name().c_str(), p->value().c_str());
+ } else {
+ response->printf("- GET[%s]: %s
", p->name().c_str(), p->value().c_str());
+ }
+}
+response->print("
");
+
+response->print("");
+//send the response last
+request->send(response);
+```
+
+### ArduinoJson Basic Response
+This way of sending Json is great for when the result is below 4KB
+```cpp
+#include "AsyncJson.h"
+#include "ArduinoJson.h"
+
+
+AsyncResponseStream *response = request->beginResponseStream("application/json");
+DynamicJsonBuffer jsonBuffer;
+JsonObject &root = jsonBuffer.createObject();
+root["heap"] = ESP.getFreeHeap();
+root["ssid"] = WiFi.SSID();
+root.printTo(*response);
+request->send(response);
+```
+
+### ArduinoJson Advanced Response
+This response can handle really large Json objects (tested to 40KB)
+There isn't any noticeable speed decrease for small results with the method above
+Since ArduinoJson does not allow reading parts of the string, the whole Json has to
+be passed every time a chunks needs to be sent, which shows speed decrease proportional
+to the resulting json packets
+```cpp
+#include "AsyncJson.h"
+#include "ArduinoJson.h"
+
+
+AsyncJsonResponse * response = new AsyncJsonResponse();
+response->addHeader("Server","ESP Async Web Server");
+JsonObject& root = response->getRoot();
+root["heap"] = ESP.getFreeHeap();
+root["ssid"] = WiFi.SSID();
+response->setLength();
+request->send(response);
+```
+
+## Serving static files
+In addition to serving files from SPIFFS as described above, the server provide a dedicated handler that optimize the
+performance of serving files from SPIFFS - ```AsyncStaticWebHandler```. Use ```server.serveStatic()``` function to
+initialize and add a new instance of ```AsyncStaticWebHandler``` to the server.
+The Handler will not handle the request if the file does not exists, e.g. the server will continue to look for another
+handler that can handle the request.
+Notice that you can chain setter functions to setup the handler, or keep a pointer to change it at a later time.
+
+### Serving specific file by name
+```cpp
+// Serve the file "/www/page.htm" when request url is "/page.htm"
+server.serveStatic("/page.htm", SPIFFS, "/www/page.htm");
+```
+
+### Serving files in directory
+To serve files in a directory, the path to the files should specify a directory in SPIFFS and ends with "/".
+```cpp
+// Serve files in directory "/www/" when request url starts with "/"
+// Request to the root or none existing files will try to server the defualt
+// file name "index.htm" if exists
+server.serveStatic("/", SPIFFS, "/www/");
+
+// Server with different default file
+server.serveStatic("/", SPIFFS, "/www/").setDefaultFile("default.html");
+```
+
+### Serving static files with authentication
+
+```cpp
+server
+ .serveStatic("/", SPIFFS, "/www/")
+ .setDefaultFile("default.html")
+ .setAuthentication("user", "pass");
+```
+
+### Specifying Cache-Control header
+It is possible to specify Cache-Control header value to reduce the number of calls to the server once the client loaded
+the files. For more information on Cache-Control values see [Cache-Control](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9)
+```cpp
+// Cache responses for 10 minutes (600 seconds)
+server.serveStatic("/", SPIFFS, "/www/").setCacheControl("max-age=600");
+
+//*** Change Cache-Control after server setup ***
+
+// During setup - keep a pointer to the handler
+AsyncStaticWebHandler* handler = &server.serveStatic("/", SPIFFS, "/www/").setCacheControl("max-age=600");
+
+// At a later event - change Cache-Control
+handler->setCacheControl("max-age=30");
+```
+
+### Specifying Date-Modified header
+It is possible to specify Date-Modified header to enable the server to return Not-Modified (304) response for requests
+with "If-Modified-Since" header with the same value, instead of responding with the actual file content.
+```cpp
+// Update the date modified string every time files are updated
+server.serveStatic("/", SPIFFS, "/www/").setLastModified("Mon, 20 Jun 2016 14:00:00 GMT");
+
+//*** Chage last modified value at a later stage ***
+
+// During setup - read last modified value from config or EEPROM
+String date_modified = loadDateModified();
+AsyncStaticWebHandler* handler = &server.serveStatic("/", SPIFFS, "/www/");
+handler->setLastModified(date_modified);
+
+// At a later event when files are updated
+String date_modified = getNewDateModfied();
+saveDateModified(date_modified); // Save for next reset
+handler->setLastModified(date_modified);
+```
+
+### Specifying Template Processor callback
+It is possible to specify template processor for static files. For information on template processor see
+[Respond with content coming from a File containing templates](#respond-with-content-coming-from-a-file-containing-templates).
+```cpp
+String processor(const String& var)
+{
+ if(var == "HELLO_FROM_TEMPLATE")
+ return F("Hello world!");
+ return String();
+}
+
+// ...
+
+server.serveStatic("/", SPIFFS, "/www/").setTemplateProcessor(processor);
+```
+
+## Param Rewrite With Matching
+It is possible to rewrite the request url with parameter matchg. Here is an example with one parameter:
+Rewrite for example "/radio/{frequence}" -> "/radio?f={frequence}"
+
+```cpp
+class OneParamRewrite : public AsyncWebRewrite
+{
+ protected:
+ String _urlPrefix;
+ int _paramIndex;
+ String _paramsBackup;
+
+ public:
+ OneParamRewrite(const char* from, const char* to)
+ : AsyncWebRewrite(from, to) {
+
+ _paramIndex = _from.indexOf('{');
+
+ if( _paramIndex >=0 && _from.endsWith("}")) {
+ _urlPrefix = _from.substring(0, _paramIndex);
+ int index = _params.indexOf('{');
+ if(index >= 0) {
+ _params = _params.substring(0, index);
+ }
+ } else {
+ _urlPrefix = _from;
+ }
+ _paramsBackup = _params;
+ }
+
+ bool match(AsyncWebServerRequest *request) override {
+ if(request->url().startsWith(_urlPrefix)) {
+ if(_paramIndex >= 0) {
+ _params = _paramsBackup + request->url().substring(_paramIndex);
+ } else {
+ _params = _paramsBackup;
+ }
+ return true;
+
+ } else {
+ return false;
+ }
+ }
+};
+```
+
+Usage:
+
+```cpp
+ server.addRewrite( new OneParamRewrite("/radio/{frequence}", "/radio?f={frequence}") );
+```
+
+## Using filters
+Filters can be set to `Rewrite` or `Handler` in order to control when to apply the rewrite and consider the handler.
+A filter is a callback function that evaluates the request and return a boolean `true` to include the item
+or `false` to exclude it.
+Two filter callback are provided for convince:
+* `ON_STA_FILTER` - return true when requests are made to the STA (station mode) interface.
+* `ON_AP_FILTER` - return true when requests are made to the AP (access point) interface.
+
+### Serve different site files in AP mode
+```cpp
+server.serveStatic("/", SPIFFS, "/www/").setFilter(ON_STA_FILTER);
+server.serveStatic("/", SPIFFS, "/ap/").setFilter(ON_AP_FILTER);
+```
+
+### Rewrite to different index on AP
+```cpp
+// Serve the file "/www/index-ap.htm" in AP, and the file "/www/index.htm" on STA
+server.rewrite("/", "index.htm");
+server.rewrite("/index.htm", "index-ap.htm").setFilter(ON_AP_FILTER);
+server.serveStatic("/", SPIFFS, "/www/");
+```
+
+### Serving different hosts
+```cpp
+// Filter callback using request host
+bool filterOnHost1(AsyncWebServerRequest *request) { return request->host() == "host1"; }
+
+// Server setup: server files in "/host1/" to requests for "host1", and files in "/www/" otherwise.
+server.serveStatic("/", SPIFFS, "/host1/").setFilter(filterOnHost1);
+server.serveStatic("/", SPIFFS, "/www/");
+```
+
+### Determine interface inside callbacks
+```cpp
+ String RedirectUrl = "http://";
+ if (ON_STA_FILTER(request)) {
+ RedirectUrl += WiFi.localIP().toString();
+ } else {
+ RedirectUrl += WiFi.softAPIP().toString();
+ }
+ RedirectUrl += "/index.htm";
+ request->redirect(RedirectUrl);
+```
+
+## Bad Responses
+Some responses are implemented, but you should not use them, because they do not conform to HTTP.
+The following example will lead to unclean close of the connection and more time wasted
+than providing the length of the content
+
+### Respond with content using a callback without content length to HTTP/1.0 clients
+```cpp
+//This is used as fallback for chunked responses to HTTP/1.0 Clients
+request->send("text/plain", 0, [](uint8_t *buffer, size_t maxLen, size_t index) -> size_t {
+ //Write up to "maxLen" bytes into "buffer" and return the amount written.
+ //You will be asked for more data until 0 is returned
+ //Keep in mind that you can not delay or yield waiting for more data!
+ return mySource.read(buffer, maxLen);
+});
+```
+
+## Async WebSocket Plugin
+The server includes a web socket plugin which lets you define different WebSocket locations to connect to
+without starting another listening service or using different port
+
+### Async WebSocket Event
+```cpp
+
+void onEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len){
+ if(type == WS_EVT_CONNECT){
+ //client connected
+ os_printf("ws[%s][%u] connect\n", server->url(), client->id());
+ client->printf("Hello Client %u :)", client->id());
+ client->ping();
+ } else if(type == WS_EVT_DISCONNECT){
+ //client disconnected
+ os_printf("ws[%s][%u] disconnect: %u\n", server->url(), client->id());
+ } else if(type == WS_EVT_ERROR){
+ //error was received from the other end
+ os_printf("ws[%s][%u] error(%u): %s\n", server->url(), client->id(), *((uint16_t*)arg), (char*)data);
+ } else if(type == WS_EVT_PONG){
+ //pong message was received (in response to a ping request maybe)
+ os_printf("ws[%s][%u] pong[%u]: %s\n", server->url(), client->id(), len, (len)?(char*)data:"");
+ } else if(type == WS_EVT_DATA){
+ //data packet
+ AwsFrameInfo * info = (AwsFrameInfo*)arg;
+ if(info->final && info->index == 0 && info->len == len){
+ //the whole message is in a single frame and we got all of it's data
+ os_printf("ws[%s][%u] %s-message[%llu]: ", server->url(), client->id(), (info->opcode == WS_TEXT)?"text":"binary", info->len);
+ if(info->opcode == WS_TEXT){
+ data[len] = 0;
+ os_printf("%s\n", (char*)data);
+ } else {
+ for(size_t i=0; i < info->len; i++){
+ os_printf("%02x ", data[i]);
+ }
+ os_printf("\n");
+ }
+ if(info->opcode == WS_TEXT)
+ client->text("I got your text message");
+ else
+ client->binary("I got your binary message");
+ } else {
+ //message is comprised of multiple frames or the frame is split into multiple packets
+ if(info->index == 0){
+ if(info->num == 0)
+ os_printf("ws[%s][%u] %s-message start\n", server->url(), client->id(), (info->message_opcode == WS_TEXT)?"text":"binary");
+ os_printf("ws[%s][%u] frame[%u] start[%llu]\n", server->url(), client->id(), info->num, info->len);
+ }
+
+ os_printf("ws[%s][%u] frame[%u] %s[%llu - %llu]: ", server->url(), client->id(), info->num, (info->message_opcode == WS_TEXT)?"text":"binary", info->index, info->index + len);
+ if(info->message_opcode == WS_TEXT){
+ data[len] = 0;
+ os_printf("%s\n", (char*)data);
+ } else {
+ for(size_t i=0; i < len; i++){
+ os_printf("%02x ", data[i]);
+ }
+ os_printf("\n");
+ }
+
+ if((info->index + len) == info->len){
+ os_printf("ws[%s][%u] frame[%u] end[%llu]\n", server->url(), client->id(), info->num, info->len);
+ if(info->final){
+ os_printf("ws[%s][%u] %s-message end\n", server->url(), client->id(), (info->message_opcode == WS_TEXT)?"text":"binary");
+ if(info->message_opcode == WS_TEXT)
+ client->text("I got your text message");
+ else
+ client->binary("I got your binary message");
+ }
+ }
+ }
+ }
+}
+```
+
+### Methods for sending data to a socket client
+```cpp
+
+
+
+//Server methods
+AsyncWebSocket ws("/ws");
+//printf to a client
+ws.printf((uint32_t)client_id, arguments...);
+//printf to all clients
+ws.printfAll(arguments...);
+//printf_P to a client
+ws.printf_P((uint32_t)client_id, PSTR(format), arguments...);
+//printfAll_P to all clients
+ws.printfAll_P(PSTR(format), arguments...);
+//send text to a client
+ws.text((uint32_t)client_id, (char*)text);
+ws.text((uint32_t)client_id, (uint8_t*)text, (size_t)len);
+//send text from PROGMEM to a client
+ws.text((uint32_t)client_id, PSTR("text"));
+const char flash_text[] PROGMEM = "Text to send"
+ws.text((uint32_t)client_id, FPSTR(flash_text));
+//send text to all clients
+ws.textAll((char*)text);
+ws.textAll((uint8_t*)text, (size_t)len);
+//send binary to a client
+ws.binary((uint32_t)client_id, (char*)binary);
+ws.binary((uint32_t)client_id, (uint8_t*)binary, (size_t)len);
+//send binary from PROGMEM to a client
+const uint8_t flash_binary[] PROGMEM = { 0x01, 0x02, 0x03, 0x04 };
+ws.binary((uint32_t)client_id, flash_binary, 4);
+//send binary to all clients
+ws.binaryAll((char*)binary);
+ws.binaryAll((uint8_t*)binary, (size_t)len);
+//HTTP Authenticate before switch to Websocket protocol
+ws.setAuthentication("user", "pass");
+
+//client methods
+AsyncWebSocketClient * client;
+//printf
+client->printf(arguments...);
+//printf_P
+client->printf_P(PSTR(format), arguments...);
+//send text
+client->text((char*)text);
+client->text((uint8_t*)text, (size_t)len);
+//send text from PROGMEM
+client->text(PSTR("text"));
+const char flash_text[] PROGMEM = "Text to send";
+client->text(FPSTR(flash_text));
+//send binary
+client->binary((char*)binary);
+client->binary((uint8_t*)binary, (size_t)len);
+//send binary from PROGMEM
+const uint8_t flash_binary[] PROGMEM = { 0x01, 0x02, 0x03, 0x04 };
+client->binary(flash_binary, 4);
+```
+
+### Direct access to web socket message buffer
+When sending a web socket message using the above methods a buffer is created. Under certain circumstances you might want to manipulate or populate this buffer directly from your application, for example to prevent unnecessary duplications of the data. This example below shows how to create a buffer and print data to it from an ArduinoJson object then send it.
+
+```cpp
+void sendDataWs(AsyncWebSocketClient * client)
+{
+ DynamicJsonBuffer jsonBuffer;
+ JsonObject& root = jsonBuffer.createObject();
+ root["a"] = "abc";
+ root["b"] = "abcd";
+ root["c"] = "abcde";
+ root["d"] = "abcdef";
+ root["e"] = "abcdefg";
+ size_t len = root.measureLength();
+ AsyncWebSocketMessageBuffer * buffer = ws.makeBuffer(len); // creates a buffer (len + 1) for you.
+ if (buffer) {
+ root.printTo((char *)buffer->get(), len + 1);
+ if (client) {
+ client->text(buffer);
+ } else {
+ ws.textAll(buffer);
+ }
+ }
+}
+```
+
+### Limiting the number of web socket clients
+Browsers sometimes do not correctly close the websocket connection, even when the close() function is called in javascript. This will eventually exhaust the web server's resources and will cause the server to crash. Periodically calling the cleanClients() function from the main loop() function limits the number of clients by closing the oldest client when the maximum number of clients has been exceeded. This can called be every cycle, however, if you wish to use less power, then calling as infrequently as once per second is sufficient.
+
+```cpp
+void loop(){
+ ws.cleanupClients();
+}
+```
+
+
+## Async Event Source Plugin
+The server includes EventSource (Server-Sent Events) plugin which can be used to send short text events to the browser.
+Difference between EventSource and WebSockets is that EventSource is single direction, text-only protocol.
+
+### Setup Event Source on the server
+```cpp
+AsyncWebServer server(80);
+AsyncEventSource events("/events");
+
+void setup(){
+ // setup ......
+ events.onConnect([](AsyncEventSourceClient *client){
+ if(client->lastId()){
+ Serial.printf("Client reconnected! Last message ID that it gat is: %u\n", client->lastId());
+ }
+ //send event with message "hello!", id current millis
+ // and set reconnect delay to 1 second
+ client->send("hello!",NULL,millis(),1000);
+ });
+ //HTTP Basic authentication
+ events.setAuthentication("user", "pass");
+ server.addHandler(&events);
+ // setup ......
+}
+
+void loop(){
+ if(eventTriggered){ // your logic here
+ //send event "myevent"
+ events.send("my event content","myevent",millis());
+ }
+}
+```
+
+### Setup Event Source in the browser
+```javascript
+if (!!window.EventSource) {
+ var source = new EventSource('/events');
+
+ source.addEventListener('open', function(e) {
+ console.log("Events Connected");
+ }, false);
+
+ source.addEventListener('error', function(e) {
+ if (e.target.readyState != EventSource.OPEN) {
+ console.log("Events Disconnected");
+ }
+ }, false);
+
+ source.addEventListener('message', function(e) {
+ console.log("message", e.data);
+ }, false);
+
+ source.addEventListener('myevent', function(e) {
+ console.log("myevent", e.data);
+ }, false);
+}
+```
+
+## Scanning for available WiFi Networks
+```cpp
+//First request will return 0 results unless you start scan from somewhere else (loop/setup)
+//Do not request more often than 3-5 seconds
+server.on("/scan", HTTP_GET, [](AsyncWebServerRequest *request){
+ String json = "[";
+ int n = WiFi.scanComplete();
+ if(n == -2){
+ WiFi.scanNetworks(true);
+ } else if(n){
+ for (int i = 0; i < n; ++i){
+ if(i) json += ",";
+ json += "{";
+ json += "\"rssi\":"+String(WiFi.RSSI(i));
+ json += ",\"ssid\":\""+WiFi.SSID(i)+"\"";
+ json += ",\"bssid\":\""+WiFi.BSSIDstr(i)+"\"";
+ json += ",\"channel\":"+String(WiFi.channel(i));
+ json += ",\"secure\":"+String(WiFi.encryptionType(i));
+ json += ",\"hidden\":"+String(WiFi.isHidden(i)?"true":"false");
+ json += "}";
+ }
+ WiFi.scanDelete();
+ if(WiFi.scanComplete() == -2){
+ WiFi.scanNetworks(true);
+ }
+ }
+ json += "]";
+ request->send(200, "application/json", json);
+ json = String();
+});
+```
+
+## Remove handlers and rewrites
+
+Server goes through handlers in same order as they were added. You can't simple add handler with same path to override them.
+To remove handler:
+```arduino
+// save callback for particular URL path
+auto handler = server.on("/some/path", [](AsyncWebServerRequest *request){
+ //do something useful
+});
+// when you don't need handler anymore remove it
+server.removeHandler(&handler);
+
+// same with rewrites
+server.removeRewrite(&someRewrite);
+
+server.onNotFound([](AsyncWebServerRequest *request){
+ request->send(404);
+});
+
+// remove server.onNotFound handler
+server.onNotFound(NULL);
+
+// remove all rewrites, handlers and onNotFound/onFileUpload/onRequestBody callbacks
+server.reset();
+```
+
+## Setting up the server
+```cpp
+#include "ESPAsyncTCP.h"
+#include "ESPAsyncWebServer.h"
+
+AsyncWebServer server(80);
+AsyncWebSocket ws("/ws"); // access at ws://[esp ip]/ws
+AsyncEventSource events("/events"); // event source (Server-Sent events)
+
+const char* ssid = "your-ssid";
+const char* password = "your-pass";
+const char* http_username = "admin";
+const char* http_password = "admin";
+
+//flag to use from web update to reboot the ESP
+bool shouldReboot = false;
+
+void onRequest(AsyncWebServerRequest *request){
+ //Handle Unknown Request
+ request->send(404);
+}
+
+void onBody(AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total){
+ //Handle body
+}
+
+void onUpload(AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final){
+ //Handle upload
+}
+
+void onEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len){
+ //Handle WebSocket event
+}
+
+void setup(){
+ Serial.begin(115200);
+ WiFi.mode(WIFI_STA);
+ WiFi.begin(ssid, password);
+ if (WiFi.waitForConnectResult() != WL_CONNECTED) {
+ Serial.printf("WiFi Failed!\n");
+ return;
+ }
+
+ // attach AsyncWebSocket
+ ws.onEvent(onEvent);
+ server.addHandler(&ws);
+
+ // attach AsyncEventSource
+ server.addHandler(&events);
+
+ // respond to GET requests on URL /heap
+ server.on("/heap", HTTP_GET, [](AsyncWebServerRequest *request){
+ request->send(200, "text/plain", String(ESP.getFreeHeap()));
+ });
+
+ // upload a file to /upload
+ server.on("/upload", HTTP_POST, [](AsyncWebServerRequest *request){
+ request->send(200);
+ }, onUpload);
+
+ // send a file when /index is requested
+ server.on("/index", HTTP_ANY, [](AsyncWebServerRequest *request){
+ request->send(SPIFFS, "/index.htm");
+ });
+
+ // HTTP basic authentication
+ server.on("/login", HTTP_GET, [](AsyncWebServerRequest *request){
+ if(!request->authenticate(http_username, http_password))
+ return request->requestAuthentication();
+ request->send(200, "text/plain", "Login Success!");
+ });
+
+ // Simple Firmware Update Form
+ server.on("/update", HTTP_GET, [](AsyncWebServerRequest *request){
+ request->send(200, "text/html", "");
+ });
+ server.on("/update", HTTP_POST, [](AsyncWebServerRequest *request){
+ shouldReboot = !Update.hasError();
+ AsyncWebServerResponse *response = request->beginResponse(200, "text/plain", shouldReboot?"OK":"FAIL");
+ response->addHeader("Connection", "close");
+ request->send(response);
+ },[](AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final){
+ if(!index){
+ Serial.printf("Update Start: %s\n", filename.c_str());
+ Update.runAsync(true);
+ if(!Update.begin((ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000)){
+ Update.printError(Serial);
+ }
+ }
+ if(!Update.hasError()){
+ if(Update.write(data, len) != len){
+ Update.printError(Serial);
+ }
+ }
+ if(final){
+ if(Update.end(true)){
+ Serial.printf("Update Success: %uB\n", index+len);
+ } else {
+ Update.printError(Serial);
+ }
+ }
+ });
+
+ // attach filesystem root at URL /fs
+ server.serveStatic("/fs", SPIFFS, "/");
+
+ // Catch-All Handlers
+ // Any request that can not find a Handler that canHandle it
+ // ends in the callbacks below.
+ server.onNotFound(onRequest);
+ server.onFileUpload(onUpload);
+ server.onRequestBody(onBody);
+
+ server.begin();
+}
+
+void loop(){
+ if(shouldReboot){
+ Serial.println("Rebooting...");
+ delay(100);
+ ESP.restart();
+ }
+ static char temp[128];
+ sprintf(temp, "Seconds since boot: %u", millis()/1000);
+ events.send(temp, "time"); //send event "time"
+}
+```
+
+### Setup global and class functions as request handlers
+
+```cpp
+#include
+#include
+#include
+#include
+
+void handleRequest(AsyncWebServerRequest *request){}
+
+class WebClass {
+public :
+ AsyncWebServer classWebServer = AsyncWebServer(81);
+
+ WebClass(){};
+
+ void classRequest (AsyncWebServerRequest *request){}
+
+ void begin(){
+ // attach global request handler
+ classWebServer.on("/example", HTTP_ANY, handleRequest);
+
+ // attach class request handler
+ classWebServer.on("/example", HTTP_ANY, std::bind(&WebClass::classRequest, this, std::placeholders::_1));
+ }
+};
+
+AsyncWebServer globalWebServer(80);
+WebClass webClassInstance;
+
+void setup() {
+ // attach global request handler
+ globalWebServer.on("/example", HTTP_ANY, handleRequest);
+
+ // attach class request handler
+ globalWebServer.on("/example", HTTP_ANY, std::bind(&WebClass::classRequest, webClassInstance, std::placeholders::_1));
+}
+
+void loop() {
+
+}
+```
+
+### Methods for controlling websocket connections
+
+```cpp
+ // Disable client connections if it was activated
+ if ( ws.enabled() )
+ ws.enable(false);
+
+ // enable client connections if it was disabled
+ if ( !ws.enabled() )
+ ws.enable(true);
+```
+
+Example of OTA code
+
+```cpp
+ // OTA callbacks
+ ArduinoOTA.onStart([]() {
+ // Clean SPIFFS
+ SPIFFS.end();
+
+ // Disable client connections
+ ws.enable(false);
+
+ // Advertise connected clients what's going on
+ ws.textAll("OTA Update Started");
+
+ // Close them
+ ws.closeAll();
+
+ });
+
+```
+
+### Adding Default Headers
+
+In some cases, such as when working with CORS, or with some sort of custom authentication system,
+you might need to define a header that should get added to all responses (including static, websocket and EventSource).
+The DefaultHeaders singleton allows you to do this.
+
+Example:
+
+```cpp
+DefaultHeaders::Instance().addHeader("Access-Control-Allow-Origin", "*");
+webServer.begin();
+```
+
+*NOTE*: You will still need to respond to the OPTIONS method for CORS pre-flight in most cases. (unless you are only using GET)
+
+This is one option:
+
+```cpp
+webServer.onNotFound([](AsyncWebServerRequest *request) {
+ if (request->method() == HTTP_OPTIONS) {
+ request->send(200);
+ } else {
+ request->send(404);
+ }
+});
+```
+
+### Path variable
+
+With path variable you can create a custom regex rule for a specific parameter in a route.
+For example we want a `sensorId` parameter in a route rule to match only a integer.
+
+```cpp
+ server.on("^\\/sensor\\/([0-9]+)$", HTTP_GET, [] (AsyncWebServerRequest *request) {
+ String sensorId = request->pathArg(0);
+ });
+```
+*NOTE*: All regex patterns starts with `^` and ends with `$`
+
+To enable the `Path variable` support, you have to define the buildflag `-DASYNCWEBSERVER_REGEX`.
+
+
+For Arduino IDE create/update `platform.local.txt`:
+
+`Windows`: C:\Users\(username)\AppData\Local\Arduino15\packages\\`{espxxxx}`\hardware\\`espxxxx`\\`{version}`\platform.local.txt
+
+`Linux`: ~/.arduino15/packages/`{espxxxx}`/hardware/`{espxxxx}`/`{version}`/platform.local.txt
+
+Add/Update the following line:
+```
+ compiler.cpp.extra_flags=-DDASYNCWEBSERVER_REGEX
+```
+
+For platformio modify `platformio.ini`:
+```ini
+[env:myboard]
+build_flags =
+ -DASYNCWEBSERVER_REGEX
+```
+*NOTE*: By enabling `ASYNCWEBSERVER_REGEX`, `` will be included. This will add an 100k to your binary.
diff --git a/lib/libesp32/ESPAsyncWebServer/_config.yml b/lib/libesp32/ESPAsyncWebServer/_config.yml
new file mode 100644
index 000000000..c4192631f
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/_config.yml
@@ -0,0 +1 @@
+theme: jekyll-theme-cayman
\ No newline at end of file
diff --git a/lib/libesp32/ESPAsyncWebServer/component.mk b/lib/libesp32/ESPAsyncWebServer/component.mk
new file mode 100644
index 000000000..bb5bb1614
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/component.mk
@@ -0,0 +1,3 @@
+COMPONENT_ADD_INCLUDEDIRS := src
+COMPONENT_SRCDIRS := src
+CXXFLAGS += -fno-rtti
diff --git a/lib/libesp32/ESPAsyncWebServer/examples/CaptivePortal/CaptivePortal.ino b/lib/libesp32/ESPAsyncWebServer/examples/CaptivePortal/CaptivePortal.ino
new file mode 100644
index 000000000..f97f142a6
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/examples/CaptivePortal/CaptivePortal.ino
@@ -0,0 +1,47 @@
+#include
+#ifdef ESP32
+#include
+#include
+#elif defined(ESP8266)
+#include
+#include
+#endif
+#include "ESPAsyncWebServer.h"
+
+DNSServer dnsServer;
+AsyncWebServer server(80);
+
+class CaptiveRequestHandler : public AsyncWebHandler {
+public:
+ CaptiveRequestHandler() {}
+ virtual ~CaptiveRequestHandler() {}
+
+ bool canHandle(AsyncWebServerRequest *request){
+ //request->addInterestingHeader("ANY");
+ return true;
+ }
+
+ void handleRequest(AsyncWebServerRequest *request) {
+ AsyncResponseStream *response = request->beginResponseStream("text/html");
+ response->print("Captive Portal");
+ response->print("This is out captive portal front page.
");
+ response->printf("You were trying to reach: http://%s%s
", request->host().c_str(), request->url().c_str());
+ response->printf("Try opening this link instead
", WiFi.softAPIP().toString().c_str());
+ response->print("");
+ request->send(response);
+ }
+};
+
+
+void setup(){
+ //your other setup stuff...
+ WiFi.softAP("esp-captive");
+ dnsServer.start(53, "*", WiFi.softAPIP());
+ server.addHandler(new CaptiveRequestHandler()).setFilter(ON_AP_FILTER);//only when requested from AP
+ //more handlers...
+ server.begin();
+}
+
+void loop(){
+ dnsServer.processNextRequest();
+}
diff --git a/lib/libesp32/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/ESP_AsyncFSBrowser.ino b/lib/libesp32/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/ESP_AsyncFSBrowser.ino
new file mode 100644
index 000000000..bf42d0038
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/ESP_AsyncFSBrowser.ino
@@ -0,0 +1,221 @@
+#include
+#ifdef ESP32
+#include
+#include
+#include
+#include
+#include
+#elif defined(ESP8266)
+#include
+#include
+#include
+#endif
+#include
+#include
+
+// SKETCH BEGIN
+AsyncWebServer server(80);
+AsyncWebSocket ws("/ws");
+AsyncEventSource events("/events");
+
+void onWsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len){
+ if(type == WS_EVT_CONNECT){
+ Serial.printf("ws[%s][%u] connect\n", server->url(), client->id());
+ client->printf("Hello Client %u :)", client->id());
+ client->ping();
+ } else if(type == WS_EVT_DISCONNECT){
+ Serial.printf("ws[%s][%u] disconnect\n", server->url(), client->id());
+ } else if(type == WS_EVT_ERROR){
+ Serial.printf("ws[%s][%u] error(%u): %s\n", server->url(), client->id(), *((uint16_t*)arg), (char*)data);
+ } else if(type == WS_EVT_PONG){
+ Serial.printf("ws[%s][%u] pong[%u]: %s\n", server->url(), client->id(), len, (len)?(char*)data:"");
+ } else if(type == WS_EVT_DATA){
+ AwsFrameInfo * info = (AwsFrameInfo*)arg;
+ String msg = "";
+ if(info->final && info->index == 0 && info->len == len){
+ //the whole message is in a single frame and we got all of it's data
+ Serial.printf("ws[%s][%u] %s-message[%llu]: ", server->url(), client->id(), (info->opcode == WS_TEXT)?"text":"binary", info->len);
+
+ if(info->opcode == WS_TEXT){
+ for(size_t i=0; i < info->len; i++) {
+ msg += (char) data[i];
+ }
+ } else {
+ char buff[3];
+ for(size_t i=0; i < info->len; i++) {
+ sprintf(buff, "%02x ", (uint8_t) data[i]);
+ msg += buff ;
+ }
+ }
+ Serial.printf("%s\n",msg.c_str());
+
+ if(info->opcode == WS_TEXT)
+ client->text("I got your text message");
+ else
+ client->binary("I got your binary message");
+ } else {
+ //message is comprised of multiple frames or the frame is split into multiple packets
+ if(info->index == 0){
+ if(info->num == 0)
+ Serial.printf("ws[%s][%u] %s-message start\n", server->url(), client->id(), (info->message_opcode == WS_TEXT)?"text":"binary");
+ Serial.printf("ws[%s][%u] frame[%u] start[%llu]\n", server->url(), client->id(), info->num, info->len);
+ }
+
+ Serial.printf("ws[%s][%u] frame[%u] %s[%llu - %llu]: ", server->url(), client->id(), info->num, (info->message_opcode == WS_TEXT)?"text":"binary", info->index, info->index + len);
+
+ if(info->opcode == WS_TEXT){
+ for(size_t i=0; i < len; i++) {
+ msg += (char) data[i];
+ }
+ } else {
+ char buff[3];
+ for(size_t i=0; i < len; i++) {
+ sprintf(buff, "%02x ", (uint8_t) data[i]);
+ msg += buff ;
+ }
+ }
+ Serial.printf("%s\n",msg.c_str());
+
+ if((info->index + len) == info->len){
+ Serial.printf("ws[%s][%u] frame[%u] end[%llu]\n", server->url(), client->id(), info->num, info->len);
+ if(info->final){
+ Serial.printf("ws[%s][%u] %s-message end\n", server->url(), client->id(), (info->message_opcode == WS_TEXT)?"text":"binary");
+ if(info->message_opcode == WS_TEXT)
+ client->text("I got your text message");
+ else
+ client->binary("I got your binary message");
+ }
+ }
+ }
+ }
+}
+
+
+const char* ssid = "*******";
+const char* password = "*******";
+const char * hostName = "esp-async";
+const char* http_username = "admin";
+const char* http_password = "admin";
+
+void setup(){
+ Serial.begin(115200);
+ Serial.setDebugOutput(true);
+ WiFi.mode(WIFI_AP_STA);
+ WiFi.softAP(hostName);
+ WiFi.begin(ssid, password);
+ if (WiFi.waitForConnectResult() != WL_CONNECTED) {
+ Serial.printf("STA: Failed!\n");
+ WiFi.disconnect(false);
+ delay(1000);
+ WiFi.begin(ssid, password);
+ }
+
+ //Send OTA events to the browser
+ ArduinoOTA.onStart([]() { events.send("Update Start", "ota"); });
+ ArduinoOTA.onEnd([]() { events.send("Update End", "ota"); });
+ ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
+ char p[32];
+ sprintf(p, "Progress: %u%%\n", (progress/(total/100)));
+ events.send(p, "ota");
+ });
+ ArduinoOTA.onError([](ota_error_t error) {
+ if(error == OTA_AUTH_ERROR) events.send("Auth Failed", "ota");
+ else if(error == OTA_BEGIN_ERROR) events.send("Begin Failed", "ota");
+ else if(error == OTA_CONNECT_ERROR) events.send("Connect Failed", "ota");
+ else if(error == OTA_RECEIVE_ERROR) events.send("Recieve Failed", "ota");
+ else if(error == OTA_END_ERROR) events.send("End Failed", "ota");
+ });
+ ArduinoOTA.setHostname(hostName);
+ ArduinoOTA.begin();
+
+ MDNS.addService("http","tcp",80);
+
+ SPIFFS.begin();
+
+ ws.onEvent(onWsEvent);
+ server.addHandler(&ws);
+
+ events.onConnect([](AsyncEventSourceClient *client){
+ client->send("hello!",NULL,millis(),1000);
+ });
+ server.addHandler(&events);
+
+#ifdef ESP32
+ server.addHandler(new SPIFFSEditor(SPIFFS, http_username,http_password));
+#elif defined(ESP8266)
+ server.addHandler(new SPIFFSEditor(http_username,http_password));
+#endif
+
+ server.on("/heap", HTTP_GET, [](AsyncWebServerRequest *request){
+ request->send(200, "text/plain", String(ESP.getFreeHeap()));
+ });
+
+ server.serveStatic("/", SPIFFS, "/").setDefaultFile("index.htm");
+
+ server.onNotFound([](AsyncWebServerRequest *request){
+ Serial.printf("NOT_FOUND: ");
+ if(request->method() == HTTP_GET)
+ Serial.printf("GET");
+ else if(request->method() == HTTP_POST)
+ Serial.printf("POST");
+ else if(request->method() == HTTP_DELETE)
+ Serial.printf("DELETE");
+ else if(request->method() == HTTP_PUT)
+ Serial.printf("PUT");
+ else if(request->method() == HTTP_PATCH)
+ Serial.printf("PATCH");
+ else if(request->method() == HTTP_HEAD)
+ Serial.printf("HEAD");
+ else if(request->method() == HTTP_OPTIONS)
+ Serial.printf("OPTIONS");
+ else
+ Serial.printf("UNKNOWN");
+ Serial.printf(" http://%s%s\n", request->host().c_str(), request->url().c_str());
+
+ if(request->contentLength()){
+ Serial.printf("_CONTENT_TYPE: %s\n", request->contentType().c_str());
+ Serial.printf("_CONTENT_LENGTH: %u\n", request->contentLength());
+ }
+
+ int headers = request->headers();
+ int i;
+ for(i=0;igetHeader(i);
+ Serial.printf("_HEADER[%s]: %s\n", h->name().c_str(), h->value().c_str());
+ }
+
+ int params = request->params();
+ for(i=0;igetParam(i);
+ if(p->isFile()){
+ Serial.printf("_FILE[%s]: %s, size: %u\n", p->name().c_str(), p->value().c_str(), p->size());
+ } else if(p->isPost()){
+ Serial.printf("_POST[%s]: %s\n", p->name().c_str(), p->value().c_str());
+ } else {
+ Serial.printf("_GET[%s]: %s\n", p->name().c_str(), p->value().c_str());
+ }
+ }
+
+ request->send(404);
+ });
+ server.onFileUpload([](AsyncWebServerRequest *request, const String& filename, size_t index, uint8_t *data, size_t len, bool final){
+ if(!index)
+ Serial.printf("UploadStart: %s\n", filename.c_str());
+ Serial.printf("%s", (const char*)data);
+ if(final)
+ Serial.printf("UploadEnd: %s (%u)\n", filename.c_str(), index+len);
+ });
+ server.onRequestBody([](AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total){
+ if(!index)
+ Serial.printf("BodyStart: %u\n", total);
+ Serial.printf("%s", (const char*)data);
+ if(index + len == total)
+ Serial.printf("BodyEnd: %u\n", total);
+ });
+ server.begin();
+}
+
+void loop(){
+ ArduinoOTA.handle();
+ ws.cleanupClients();
+}
diff --git a/lib/libesp32/ESPAsyncWebServer/examples/regex_patterns/.test.build_flags b/lib/libesp32/ESPAsyncWebServer/examples/regex_patterns/.test.build_flags
new file mode 100644
index 000000000..9ea3bb74a
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/examples/regex_patterns/.test.build_flags
@@ -0,0 +1 @@
+-DASYNCWEBSERVER_REGEX=1
diff --git a/lib/libesp32/ESPAsyncWebServer/examples/regex_patterns/regex_patterns.ino b/lib/libesp32/ESPAsyncWebServer/examples/regex_patterns/regex_patterns.ino
new file mode 100644
index 000000000..fb013063e
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/examples/regex_patterns/regex_patterns.ino
@@ -0,0 +1,77 @@
+//
+// A simple server implementation with regex routes:
+// * serve static messages
+// * read GET and POST parameters
+// * handle missing pages / 404s
+//
+
+// Add buildflag ASYNCWEBSERVER_REGEX to enable the regex support
+
+// For platformio: platformio.ini:
+// build_flags =
+// -DASYNCWEBSERVER_REGEX
+
+// For arduino IDE: create/update platform.local.txt
+// Windows: C:\Users\(username)\AppData\Local\Arduino15\packages\espxxxx\hardware\espxxxx\{version}\platform.local.txt
+// Linux: ~/.arduino15/packages/espxxxx/hardware/espxxxx/{version}/platform.local.txt
+//
+// compiler.cpp.extra_flags=-DASYNCWEBSERVER_REGEX=1
+
+#include
+#ifdef ESP32
+#include
+#include
+#elif defined(ESP8266)
+#include
+#include
+#endif
+#include
+
+AsyncWebServer server(80);
+
+const char* ssid = "YOUR_SSID";
+const char* password = "YOUR_PASSWORD";
+
+const char* PARAM_MESSAGE = "message";
+
+void notFound(AsyncWebServerRequest *request) {
+ request->send(404, "text/plain", "Not found");
+}
+
+void setup() {
+
+ Serial.begin(115200);
+ WiFi.mode(WIFI_STA);
+ WiFi.begin(ssid, password);
+ if (WiFi.waitForConnectResult() != WL_CONNECTED) {
+ Serial.printf("WiFi Failed!\n");
+ return;
+ }
+
+ Serial.print("IP Address: ");
+ Serial.println(WiFi.localIP());
+
+ server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
+ request->send(200, "text/plain", "Hello, world");
+ });
+
+ // Send a GET request to /sensor/
+ server.on("^\\/sensor\\/([0-9]+)$", HTTP_GET, [] (AsyncWebServerRequest *request) {
+ String sensorNumber = request->pathArg(0);
+ request->send(200, "text/plain", "Hello, sensor: " + sensorNumber);
+ });
+
+ // Send a GET request to /sensor//action/
+ server.on("^\\/sensor\\/([0-9]+)\\/action\\/([a-zA-Z0-9]+)$", HTTP_GET, [] (AsyncWebServerRequest *request) {
+ String sensorNumber = request->pathArg(0);
+ String action = request->pathArg(1);
+ request->send(200, "text/plain", "Hello, sensor: " + sensorNumber + ", with action: " + action);
+ });
+
+ server.onNotFound(notFound);
+
+ server.begin();
+}
+
+void loop() {
+}
diff --git a/lib/libesp32/ESPAsyncWebServer/examples/simple_server/simple_server.ino b/lib/libesp32/ESPAsyncWebServer/examples/simple_server/simple_server.ino
new file mode 100644
index 000000000..bdbcf60dc
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/examples/simple_server/simple_server.ino
@@ -0,0 +1,74 @@
+//
+// A simple server implementation showing how to:
+// * serve static messages
+// * read GET and POST parameters
+// * handle missing pages / 404s
+//
+
+#include
+#ifdef ESP32
+#include
+#include
+#elif defined(ESP8266)
+#include
+#include
+#endif
+#include
+
+AsyncWebServer server(80);
+
+const char* ssid = "YOUR_SSID";
+const char* password = "YOUR_PASSWORD";
+
+const char* PARAM_MESSAGE = "message";
+
+void notFound(AsyncWebServerRequest *request) {
+ request->send(404, "text/plain", "Not found");
+}
+
+void setup() {
+
+ Serial.begin(115200);
+ WiFi.mode(WIFI_STA);
+ WiFi.begin(ssid, password);
+ if (WiFi.waitForConnectResult() != WL_CONNECTED) {
+ Serial.printf("WiFi Failed!\n");
+ return;
+ }
+
+ Serial.print("IP Address: ");
+ Serial.println(WiFi.localIP());
+
+ server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
+ request->send(200, "text/plain", "Hello, world");
+ });
+
+ // Send a GET request to /get?message=
+ server.on("/get", HTTP_GET, [] (AsyncWebServerRequest *request) {
+ String message;
+ if (request->hasParam(PARAM_MESSAGE)) {
+ message = request->getParam(PARAM_MESSAGE)->value();
+ } else {
+ message = "No message sent";
+ }
+ request->send(200, "text/plain", "Hello, GET: " + message);
+ });
+
+ // Send a POST request to /post with a form field message set to
+ server.on("/post", HTTP_POST, [](AsyncWebServerRequest *request){
+ String message;
+ if (request->hasParam(PARAM_MESSAGE, true)) {
+ message = request->getParam(PARAM_MESSAGE, true)->value();
+ } else {
+ message = "No message sent";
+ }
+ request->send(200, "text/plain", "Hello, POST: " + message);
+ });
+
+ server.onNotFound(notFound);
+
+ server.begin();
+}
+
+void loop() {
+}
\ No newline at end of file
diff --git a/lib/libesp32/ESPAsyncWebServer/keywords.txt b/lib/libesp32/ESPAsyncWebServer/keywords.txt
new file mode 100644
index 000000000..c391e6c43
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/keywords.txt
@@ -0,0 +1,3 @@
+JsonArray KEYWORD1
+add KEYWORD2
+createArray KEYWORD3
diff --git a/lib/libesp32/ESPAsyncWebServer/library.json b/lib/libesp32/ESPAsyncWebServer/library.json
new file mode 100644
index 000000000..750ca28d2
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/library.json
@@ -0,0 +1,37 @@
+{
+ "name":"ESP Async WebServer",
+ "description":"Asynchronous HTTP and WebSocket Server Library for ESP8266 and ESP32",
+ "keywords":"http,async,websocket,webserver",
+ "authors":
+ {
+ "name": "Hristo Gochkov",
+ "maintainer": true
+ },
+ "repository":
+ {
+ "type": "git",
+ "url": "https://github.com/me-no-dev/ESPAsyncWebServer.git"
+ },
+ "version": "1.2.3",
+ "license": "LGPL-3.0",
+ "frameworks": "arduino",
+ "platforms": ["espressif8266", "espressif32"],
+ "dependencies": [
+ {
+ "owner": "me-no-dev",
+ "name": "ESPAsyncTCP",
+ "version": "^1.2.2",
+ "platforms": "espressif8266"
+ },
+ {
+ "owner": "me-no-dev",
+ "name": "AsyncTCP",
+ "version": "^1.1.1",
+ "platforms": "espressif32"
+ },
+ {
+ "name": "Hash",
+ "platforms": "espressif8266"
+ }
+ ]
+}
diff --git a/lib/libesp32/ESPAsyncWebServer/library.properties b/lib/libesp32/ESPAsyncWebServer/library.properties
new file mode 100644
index 000000000..401b04173
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/library.properties
@@ -0,0 +1,9 @@
+name=ESP Async WebServer
+version=1.2.3
+author=Me-No-Dev
+maintainer=Me-No-Dev
+sentence=Async Web Server for ESP8266 and ESP31B
+paragraph=Async Web Server for ESP8266 and ESP31B
+category=Other
+url=https://github.com/me-no-dev/ESPAsyncWebServer
+architectures=*
diff --git a/lib/libesp32/ESPAsyncWebServer/src/AsyncEventSource.cpp b/lib/libesp32/ESPAsyncWebServer/src/AsyncEventSource.cpp
new file mode 100644
index 000000000..663177b59
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/src/AsyncEventSource.cpp
@@ -0,0 +1,368 @@
+/*
+ Asynchronous WebServer library for Espressif MCUs
+
+ Copyright (c) 2016 Hristo Gochkov. All rights reserved.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+#include "Arduino.h"
+#include "AsyncEventSource.h"
+
+static String generateEventMessage(const char *message, const char *event, uint32_t id, uint32_t reconnect){
+ String ev = "";
+
+ if(reconnect){
+ ev += "retry: ";
+ ev += String(reconnect);
+ ev += "\r\n";
+ }
+
+ if(id){
+ ev += "id: ";
+ ev += String(id);
+ ev += "\r\n";
+ }
+
+ if(event != NULL){
+ ev += "event: ";
+ ev += String(event);
+ ev += "\r\n";
+ }
+
+ if(message != NULL){
+ size_t messageLen = strlen(message);
+ char * lineStart = (char *)message;
+ char * lineEnd;
+ do {
+ char * nextN = strchr(lineStart, '\n');
+ char * nextR = strchr(lineStart, '\r');
+ if(nextN == NULL && nextR == NULL){
+ size_t llen = ((char *)message + messageLen) - lineStart;
+ char * ldata = (char *)malloc(llen+1);
+ if(ldata != NULL){
+ memcpy(ldata, lineStart, llen);
+ ldata[llen] = 0;
+ ev += "data: ";
+ ev += ldata;
+ ev += "\r\n\r\n";
+ free(ldata);
+ }
+ lineStart = (char *)message + messageLen;
+ } else {
+ char * nextLine = NULL;
+ if(nextN != NULL && nextR != NULL){
+ if(nextR < nextN){
+ lineEnd = nextR;
+ if(nextN == (nextR + 1))
+ nextLine = nextN + 1;
+ else
+ nextLine = nextR + 1;
+ } else {
+ lineEnd = nextN;
+ if(nextR == (nextN + 1))
+ nextLine = nextR + 1;
+ else
+ nextLine = nextN + 1;
+ }
+ } else if(nextN != NULL){
+ lineEnd = nextN;
+ nextLine = nextN + 1;
+ } else {
+ lineEnd = nextR;
+ nextLine = nextR + 1;
+ }
+
+ size_t llen = lineEnd - lineStart;
+ char * ldata = (char *)malloc(llen+1);
+ if(ldata != NULL){
+ memcpy(ldata, lineStart, llen);
+ ldata[llen] = 0;
+ ev += "data: ";
+ ev += ldata;
+ ev += "\r\n";
+ free(ldata);
+ }
+ lineStart = nextLine;
+ if(lineStart == ((char *)message + messageLen))
+ ev += "\r\n";
+ }
+ } while(lineStart < ((char *)message + messageLen));
+ }
+
+ return ev;
+}
+
+// Message
+
+AsyncEventSourceMessage::AsyncEventSourceMessage(const char * data, size_t len)
+: _data(nullptr), _len(len), _sent(0), _acked(0)
+{
+ _data = (uint8_t*)malloc(_len+1);
+ if(_data == nullptr){
+ _len = 0;
+ } else {
+ memcpy(_data, data, len);
+ _data[_len] = 0;
+ }
+}
+
+AsyncEventSourceMessage::~AsyncEventSourceMessage() {
+ if(_data != NULL)
+ free(_data);
+}
+
+size_t AsyncEventSourceMessage::ack(size_t len, uint32_t time) {
+ (void)time;
+ // If the whole message is now acked...
+ if(_acked + len > _len){
+ // Return the number of extra bytes acked (they will be carried on to the next message)
+ const size_t extra = _acked + len - _len;
+ _acked = _len;
+ return extra;
+ }
+ // Return that no extra bytes left.
+ _acked += len;
+ return 0;
+}
+
+size_t AsyncEventSourceMessage::send(AsyncClient *client) {
+ const size_t len = _len - _sent;
+ if(client->space() < len){
+ return 0;
+ }
+ size_t sent = client->add((const char *)_data, len);
+ if(client->canSend())
+ client->send();
+ _sent += sent;
+ return sent;
+}
+
+// Client
+
+AsyncEventSourceClient::AsyncEventSourceClient(AsyncWebServerRequest *request, AsyncEventSource *server)
+: _messageQueue(AsyncLinkedList([](AsyncEventSourceMessage *m){ delete m; }))
+{
+ _client = request->client();
+ _server = server;
+ _lastId = 0;
+ if(request->hasHeader("Last-Event-ID"))
+ _lastId = atoi(request->getHeader("Last-Event-ID")->value().c_str());
+
+ _client->setRxTimeout(0);
+ _client->onError(NULL, NULL);
+ _client->onAck([](void *r, AsyncClient* c, size_t len, uint32_t time){ (void)c; ((AsyncEventSourceClient*)(r))->_onAck(len, time); }, this);
+ _client->onPoll([](void *r, AsyncClient* c){ (void)c; ((AsyncEventSourceClient*)(r))->_onPoll(); }, this);
+ _client->onData(NULL, NULL);
+ _client->onTimeout([this](void *r, AsyncClient* c __attribute__((unused)), uint32_t time){ ((AsyncEventSourceClient*)(r))->_onTimeout(time); }, this);
+ _client->onDisconnect([this](void *r, AsyncClient* c){ ((AsyncEventSourceClient*)(r))->_onDisconnect(); delete c; }, this);
+
+ _server->_addClient(this);
+ delete request;
+}
+
+AsyncEventSourceClient::~AsyncEventSourceClient(){
+ _messageQueue.free();
+ close();
+}
+
+void AsyncEventSourceClient::_queueMessage(AsyncEventSourceMessage *dataMessage){
+ if(dataMessage == NULL)
+ return;
+ if(!connected()){
+ delete dataMessage;
+ return;
+ }
+ if(_messageQueue.length() >= SSE_MAX_QUEUED_MESSAGES){
+ ets_printf("ERROR: Too many messages queued\n");
+ delete dataMessage;
+ } else {
+ _messageQueue.add(dataMessage);
+ }
+ if(_client->canSend())
+ _runQueue();
+}
+
+void AsyncEventSourceClient::_onAck(size_t len, uint32_t time){
+ while(len && !_messageQueue.isEmpty()){
+ len = _messageQueue.front()->ack(len, time);
+ if(_messageQueue.front()->finished())
+ _messageQueue.remove(_messageQueue.front());
+ }
+
+ _runQueue();
+}
+
+void AsyncEventSourceClient::_onPoll(){
+ if(!_messageQueue.isEmpty()){
+ _runQueue();
+ }
+}
+
+
+void AsyncEventSourceClient::_onTimeout(uint32_t time __attribute__((unused))){
+ _client->close(true);
+}
+
+void AsyncEventSourceClient::_onDisconnect(){
+ _client = NULL;
+ _server->_handleDisconnect(this);
+}
+
+void AsyncEventSourceClient::close(){
+ if(_client != NULL)
+ _client->close();
+}
+
+void AsyncEventSourceClient::write(const char * message, size_t len){
+ _queueMessage(new AsyncEventSourceMessage(message, len));
+}
+
+void AsyncEventSourceClient::send(const char *message, const char *event, uint32_t id, uint32_t reconnect){
+ String ev = generateEventMessage(message, event, id, reconnect);
+ _queueMessage(new AsyncEventSourceMessage(ev.c_str(), ev.length()));
+}
+
+void AsyncEventSourceClient::_runQueue(){
+ while(!_messageQueue.isEmpty() && _messageQueue.front()->finished()){
+ _messageQueue.remove(_messageQueue.front());
+ }
+
+ for(auto i = _messageQueue.begin(); i != _messageQueue.end(); ++i)
+ {
+ if(!(*i)->sent())
+ (*i)->send(_client);
+ }
+}
+
+
+// Handler
+
+AsyncEventSource::AsyncEventSource(const String& url)
+ : _url(url)
+ , _clients(AsyncLinkedList([](AsyncEventSourceClient *c){ delete c; }))
+ , _connectcb(NULL)
+{}
+
+AsyncEventSource::~AsyncEventSource(){
+ close();
+}
+
+void AsyncEventSource::onConnect(ArEventHandlerFunction cb){
+ _connectcb = cb;
+}
+
+void AsyncEventSource::_addClient(AsyncEventSourceClient * client){
+ /*char * temp = (char *)malloc(2054);
+ if(temp != NULL){
+ memset(temp+1,' ',2048);
+ temp[0] = ':';
+ temp[2049] = '\r';
+ temp[2050] = '\n';
+ temp[2051] = '\r';
+ temp[2052] = '\n';
+ temp[2053] = 0;
+ client->write((const char *)temp, 2053);
+ free(temp);
+ }*/
+
+ _clients.add(client);
+ if(_connectcb)
+ _connectcb(client);
+}
+
+void AsyncEventSource::_handleDisconnect(AsyncEventSourceClient * client){
+ _clients.remove(client);
+}
+
+void AsyncEventSource::close(){
+ for(const auto &c: _clients){
+ if(c->connected())
+ c->close();
+ }
+}
+
+// pmb fix
+size_t AsyncEventSource::avgPacketsWaiting() const {
+ if(_clients.isEmpty())
+ return 0;
+
+ size_t aql=0;
+ uint32_t nConnectedClients=0;
+
+ for(const auto &c: _clients){
+ if(c->connected()) {
+ aql+=c->packetsWaiting();
+ ++nConnectedClients;
+ }
+ }
+// return aql / nConnectedClients;
+ return ((aql) + (nConnectedClients/2))/(nConnectedClients); // round up
+}
+
+void AsyncEventSource::send(const char *message, const char *event, uint32_t id, uint32_t reconnect){
+
+
+ String ev = generateEventMessage(message, event, id, reconnect);
+ for(const auto &c: _clients){
+ if(c->connected()) {
+ c->write(ev.c_str(), ev.length());
+ }
+ }
+}
+
+size_t AsyncEventSource::count() const {
+ return _clients.count_if([](AsyncEventSourceClient *c){
+ return c->connected();
+ });
+}
+
+bool AsyncEventSource::canHandle(AsyncWebServerRequest *request){
+ if(request->method() != HTTP_GET || !request->url().equals(_url)) {
+ return false;
+ }
+ request->addInterestingHeader("Last-Event-ID");
+ return true;
+}
+
+void AsyncEventSource::handleRequest(AsyncWebServerRequest *request){
+ if((_username != "" && _password != "") && !request->authenticate(_username.c_str(), _password.c_str()))
+ return request->requestAuthentication();
+ request->send(new AsyncEventSourceResponse(this));
+}
+
+// Response
+
+AsyncEventSourceResponse::AsyncEventSourceResponse(AsyncEventSource *server){
+ _server = server;
+ _code = 200;
+ _contentType = "text/event-stream";
+ _sendContentLength = false;
+ addHeader("Cache-Control", "no-cache");
+ addHeader("Connection","keep-alive");
+}
+
+void AsyncEventSourceResponse::_respond(AsyncWebServerRequest *request){
+ String out = _assembleHead(request->version());
+ request->client()->write(out.c_str(), _headLength);
+ _state = RESPONSE_WAIT_ACK;
+}
+
+size_t AsyncEventSourceResponse::_ack(AsyncWebServerRequest *request, size_t len, uint32_t time __attribute__((unused))){
+ if(len){
+ new AsyncEventSourceClient(request, _server);
+ }
+ return 0;
+}
+
diff --git a/lib/libesp32/ESPAsyncWebServer/src/AsyncEventSource.h b/lib/libesp32/ESPAsyncWebServer/src/AsyncEventSource.h
new file mode 100644
index 000000000..6ff43a6e7
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/src/AsyncEventSource.h
@@ -0,0 +1,133 @@
+/*
+ Asynchronous WebServer library for Espressif MCUs
+
+ Copyright (c) 2016 Hristo Gochkov. All rights reserved.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+#ifndef ASYNCEVENTSOURCE_H_
+#define ASYNCEVENTSOURCE_H_
+
+#include
+#ifdef ESP32
+#include
+#define SSE_MAX_QUEUED_MESSAGES 32
+#else
+#include
+#define SSE_MAX_QUEUED_MESSAGES 8
+#endif
+#include
+
+#include "AsyncWebSynchronization.h"
+
+#ifdef ESP8266
+#include
+#ifdef CRYPTO_HASH_h // include Hash.h from espressif framework if the first include was from the crypto library
+#include <../src/Hash.h>
+#endif
+#endif
+
+#ifdef ESP32
+#define DEFAULT_MAX_SSE_CLIENTS 8
+#else
+#define DEFAULT_MAX_SSE_CLIENTS 4
+#endif
+
+class AsyncEventSource;
+class AsyncEventSourceResponse;
+class AsyncEventSourceClient;
+typedef std::function ArEventHandlerFunction;
+
+class AsyncEventSourceMessage {
+ private:
+ uint8_t * _data;
+ size_t _len;
+ size_t _sent;
+ //size_t _ack;
+ size_t _acked;
+ public:
+ AsyncEventSourceMessage(const char * data, size_t len);
+ ~AsyncEventSourceMessage();
+ size_t ack(size_t len, uint32_t time __attribute__((unused)));
+ size_t send(AsyncClient *client);
+ bool finished(){ return _acked == _len; }
+ bool sent() { return _sent == _len; }
+};
+
+class AsyncEventSourceClient {
+ private:
+ AsyncClient *_client;
+ AsyncEventSource *_server;
+ uint32_t _lastId;
+ AsyncLinkedList _messageQueue;
+ void _queueMessage(AsyncEventSourceMessage *dataMessage);
+ void _runQueue();
+
+ public:
+
+ AsyncEventSourceClient(AsyncWebServerRequest *request, AsyncEventSource *server);
+ ~AsyncEventSourceClient();
+
+ AsyncClient* client(){ return _client; }
+ void close();
+ void write(const char * message, size_t len);
+ void send(const char *message, const char *event=NULL, uint32_t id=0, uint32_t reconnect=0);
+ bool connected() const { return (_client != NULL) && _client->connected(); }
+ uint32_t lastId() const { return _lastId; }
+ size_t packetsWaiting() const { return _messageQueue.length(); }
+
+ //system callbacks (do not call)
+ void _onAck(size_t len, uint32_t time);
+ void _onPoll();
+ void _onTimeout(uint32_t time);
+ void _onDisconnect();
+};
+
+class AsyncEventSource: public AsyncWebHandler {
+ private:
+ String _url;
+ AsyncLinkedList _clients;
+ ArEventHandlerFunction _connectcb;
+ public:
+ AsyncEventSource(const String& url);
+ ~AsyncEventSource();
+
+ const char * url() const { return _url.c_str(); }
+ void close();
+ void onConnect(ArEventHandlerFunction cb);
+ void send(const char *message, const char *event=NULL, uint32_t id=0, uint32_t reconnect=0);
+ size_t count() const; //number clinets connected
+ size_t avgPacketsWaiting() const;
+
+ //system callbacks (do not call)
+ void _addClient(AsyncEventSourceClient * client);
+ void _handleDisconnect(AsyncEventSourceClient * client);
+ virtual bool canHandle(AsyncWebServerRequest *request) override final;
+ virtual void handleRequest(AsyncWebServerRequest *request) override final;
+};
+
+class AsyncEventSourceResponse: public AsyncWebServerResponse {
+ private:
+ String _content;
+ AsyncEventSource *_server;
+ public:
+ AsyncEventSourceResponse(AsyncEventSource *server);
+ void _respond(AsyncWebServerRequest *request);
+ size_t _ack(AsyncWebServerRequest *request, size_t len, uint32_t time);
+ bool _sourceValid() const { return true; }
+};
+
+
+#endif /* ASYNCEVENTSOURCE_H_ */
diff --git a/lib/libesp32/ESPAsyncWebServer/src/AsyncJson.h b/lib/libesp32/ESPAsyncWebServer/src/AsyncJson.h
new file mode 100644
index 000000000..2fa6a2d26
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/src/AsyncJson.h
@@ -0,0 +1,254 @@
+// AsyncJson.h
+/*
+ Async Response to use with ArduinoJson and AsyncWebServer
+ Written by Andrew Melvin (SticilFace) with help from me-no-dev and BBlanchon.
+
+ Example of callback in use
+
+ server.on("/json", HTTP_ANY, [](AsyncWebServerRequest * request) {
+
+ AsyncJsonResponse * response = new AsyncJsonResponse();
+ JsonObject& root = response->getRoot();
+ root["key1"] = "key number one";
+ JsonObject& nested = root.createNestedObject("nested");
+ nested["key1"] = "key number one";
+
+ response->setLength();
+ request->send(response);
+ });
+
+ --------------------
+
+ Async Request to use with ArduinoJson and AsyncWebServer
+ Written by Arsène von Wyss (avonwyss)
+
+ Example
+
+ AsyncCallbackJsonWebHandler* handler = new AsyncCallbackJsonWebHandler("/rest/endpoint");
+ handler->onRequest([](AsyncWebServerRequest *request, JsonVariant &json) {
+ JsonObject& jsonObj = json.as();
+ // ...
+ });
+ server.addHandler(handler);
+
+*/
+#ifndef ASYNC_JSON_H_
+#define ASYNC_JSON_H_
+#include
+#include
+#include
+
+#if ARDUINOJSON_VERSION_MAJOR == 5
+ #define ARDUINOJSON_5_COMPATIBILITY
+#else
+ #ifndef DYNAMIC_JSON_DOCUMENT_SIZE
+ #define DYNAMIC_JSON_DOCUMENT_SIZE 1024
+ #endif
+#endif
+
+constexpr const char* JSON_MIMETYPE = "application/json";
+
+/*
+ * Json Response
+ * */
+
+class ChunkPrint : public Print {
+ private:
+ uint8_t* _destination;
+ size_t _to_skip;
+ size_t _to_write;
+ size_t _pos;
+ public:
+ ChunkPrint(uint8_t* destination, size_t from, size_t len)
+ : _destination(destination), _to_skip(from), _to_write(len), _pos{0} {}
+ virtual ~ChunkPrint(){}
+ size_t write(uint8_t c){
+ if (_to_skip > 0) {
+ _to_skip--;
+ return 1;
+ } else if (_to_write > 0) {
+ _to_write--;
+ _destination[_pos++] = c;
+ return 1;
+ }
+ return 0;
+ }
+ size_t write(const uint8_t *buffer, size_t size)
+ {
+ return this->Print::write(buffer, size);
+ }
+};
+
+class AsyncJsonResponse: public AsyncAbstractResponse {
+ protected:
+
+#ifdef ARDUINOJSON_5_COMPATIBILITY
+ DynamicJsonBuffer _jsonBuffer;
+#else
+ DynamicJsonDocument _jsonBuffer;
+#endif
+
+ JsonVariant _root;
+ bool _isValid;
+
+ public:
+
+#ifdef ARDUINOJSON_5_COMPATIBILITY
+ AsyncJsonResponse(bool isArray=false): _isValid{false} {
+ _code = 200;
+ _contentType = JSON_MIMETYPE;
+ if(isArray)
+ _root = _jsonBuffer.createArray();
+ else
+ _root = _jsonBuffer.createObject();
+ }
+#else
+ AsyncJsonResponse(bool isArray=false, size_t maxJsonBufferSize = DYNAMIC_JSON_DOCUMENT_SIZE) : _jsonBuffer(maxJsonBufferSize), _isValid{false} {
+ _code = 200;
+ _contentType = JSON_MIMETYPE;
+ if(isArray)
+ _root = _jsonBuffer.createNestedArray();
+ else
+ _root = _jsonBuffer.createNestedObject();
+ }
+#endif
+
+ ~AsyncJsonResponse() {}
+ JsonVariant & getRoot() { return _root; }
+ bool _sourceValid() const { return _isValid; }
+ size_t setLength() {
+
+#ifdef ARDUINOJSON_5_COMPATIBILITY
+ _contentLength = _root.measureLength();
+#else
+ _contentLength = measureJson(_root);
+#endif
+
+ if (_contentLength) { _isValid = true; }
+ return _contentLength;
+ }
+
+ size_t getSize() { return _jsonBuffer.size(); }
+
+ size_t _fillBuffer(uint8_t *data, size_t len){
+ ChunkPrint dest(data, _sentLength, len);
+
+#ifdef ARDUINOJSON_5_COMPATIBILITY
+ _root.printTo( dest ) ;
+#else
+ serializeJson(_root, dest);
+#endif
+ return len;
+ }
+};
+
+class PrettyAsyncJsonResponse: public AsyncJsonResponse {
+public:
+#ifdef ARDUINOJSON_5_COMPATIBILITY
+ PrettyAsyncJsonResponse (bool isArray=false) : AsyncJsonResponse{isArray} {}
+#else
+ PrettyAsyncJsonResponse (bool isArray=false, size_t maxJsonBufferSize = DYNAMIC_JSON_DOCUMENT_SIZE) : AsyncJsonResponse{isArray, maxJsonBufferSize} {}
+#endif
+ size_t setLength () {
+#ifdef ARDUINOJSON_5_COMPATIBILITY
+ _contentLength = _root.measurePrettyLength ();
+#else
+ _contentLength = measureJsonPretty(_root);
+#endif
+ if (_contentLength) {_isValid = true;}
+ return _contentLength;
+ }
+ size_t _fillBuffer (uint8_t *data, size_t len) {
+ ChunkPrint dest (data, _sentLength, len);
+#ifdef ARDUINOJSON_5_COMPATIBILITY
+ _root.prettyPrintTo (dest);
+#else
+ serializeJsonPretty(_root, dest);
+#endif
+ return len;
+ }
+};
+
+typedef std::function ArJsonRequestHandlerFunction;
+
+class AsyncCallbackJsonWebHandler: public AsyncWebHandler {
+private:
+protected:
+ const String _uri;
+ WebRequestMethodComposite _method;
+ ArJsonRequestHandlerFunction _onRequest;
+ size_t _contentLength;
+#ifndef ARDUINOJSON_5_COMPATIBILITY
+ const size_t maxJsonBufferSize;
+#endif
+ size_t _maxContentLength;
+public:
+#ifdef ARDUINOJSON_5_COMPATIBILITY
+ AsyncCallbackJsonWebHandler(const String& uri, ArJsonRequestHandlerFunction onRequest)
+ : _uri(uri), _method(HTTP_POST|HTTP_PUT|HTTP_PATCH), _onRequest(onRequest), _maxContentLength(16384) {}
+#else
+ AsyncCallbackJsonWebHandler(const String& uri, ArJsonRequestHandlerFunction onRequest, size_t maxJsonBufferSize=DYNAMIC_JSON_DOCUMENT_SIZE)
+ : _uri(uri), _method(HTTP_POST|HTTP_PUT|HTTP_PATCH), _onRequest(onRequest), maxJsonBufferSize(maxJsonBufferSize), _maxContentLength(16384) {}
+#endif
+
+ void setMethod(WebRequestMethodComposite method){ _method = method; }
+ void setMaxContentLength(int maxContentLength){ _maxContentLength = maxContentLength; }
+ void onRequest(ArJsonRequestHandlerFunction fn){ _onRequest = fn; }
+
+ virtual bool canHandle(AsyncWebServerRequest *request) override final{
+ if(!_onRequest)
+ return false;
+
+ if(!(_method & request->method()))
+ return false;
+
+ if(_uri.length() && (_uri != request->url() && !request->url().startsWith(_uri+"/")))
+ return false;
+
+ if ( !request->contentType().equalsIgnoreCase(JSON_MIMETYPE) )
+ return false;
+
+ request->addInterestingHeader("ANY");
+ return true;
+ }
+
+ virtual void handleRequest(AsyncWebServerRequest *request) override final {
+ if(_onRequest) {
+ if (request->_tempObject != NULL) {
+
+#ifdef ARDUINOJSON_5_COMPATIBILITY
+ DynamicJsonBuffer jsonBuffer;
+ JsonVariant json = jsonBuffer.parse((uint8_t*)(request->_tempObject));
+ if (json.success()) {
+#else
+ DynamicJsonDocument jsonBuffer(this->maxJsonBufferSize);
+ DeserializationError error = deserializeJson(jsonBuffer, (uint8_t*)(request->_tempObject));
+ if(!error) {
+ JsonVariant json = jsonBuffer.as();
+#endif
+
+ _onRequest(request, json);
+ return;
+ }
+ }
+ request->send(_contentLength > _maxContentLength ? 413 : 400);
+ } else {
+ request->send(500);
+ }
+ }
+ virtual void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t index, uint8_t *data, size_t len, bool final) override final {
+ }
+ virtual void handleBody(AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total) override final {
+ if (_onRequest) {
+ _contentLength = total;
+ if (total > 0 && request->_tempObject == NULL && total < _maxContentLength) {
+ request->_tempObject = malloc(total);
+ }
+ if (request->_tempObject != NULL) {
+ memcpy((uint8_t*)(request->_tempObject) + index, data, len);
+ }
+ }
+ }
+ virtual bool isRequestHandlerTrivial() override final {return _onRequest ? false : true;}
+};
+#endif
diff --git a/lib/libesp32/ESPAsyncWebServer/src/AsyncWebSocket.cpp b/lib/libesp32/ESPAsyncWebServer/src/AsyncWebSocket.cpp
new file mode 100644
index 000000000..df0d668a9
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/src/AsyncWebSocket.cpp
@@ -0,0 +1,1294 @@
+/*
+ Asynchronous WebServer library for Espressif MCUs
+
+ Copyright (c) 2016 Hristo Gochkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+#include "Arduino.h"
+#include "AsyncWebSocket.h"
+
+#include
+
+#ifndef ESP8266
+#include "mbedtls/sha1.h"
+#else
+#include
+#endif
+
+#define MAX_PRINTF_LEN 64
+
+size_t webSocketSendFrameWindow(AsyncClient *client){
+ if(!client->canSend())
+ return 0;
+ size_t space = client->space();
+ if(space < 9)
+ return 0;
+ return space - 8;
+}
+
+size_t webSocketSendFrame(AsyncClient *client, bool final, uint8_t opcode, bool mask, uint8_t *data, size_t len){
+ if(!client->canSend())
+ return 0;
+ size_t space = client->space();
+ if(space < 2)
+ return 0;
+ uint8_t mbuf[4] = {0,0,0,0};
+ uint8_t headLen = 2;
+ if(len && mask){
+ headLen += 4;
+ mbuf[0] = rand() % 0xFF;
+ mbuf[1] = rand() % 0xFF;
+ mbuf[2] = rand() % 0xFF;
+ mbuf[3] = rand() % 0xFF;
+ }
+ if(len > 125)
+ headLen += 2;
+ if(space < headLen)
+ return 0;
+ space -= headLen;
+
+ if(len > space) len = space;
+
+ uint8_t *buf = (uint8_t*)malloc(headLen);
+ if(buf == NULL){
+ //os_printf("could not malloc %u bytes for frame header\n", headLen);
+ return 0;
+ }
+
+ buf[0] = opcode & 0x0F;
+ if(final)
+ buf[0] |= 0x80;
+ if(len < 126)
+ buf[1] = len & 0x7F;
+ else {
+ buf[1] = 126;
+ buf[2] = (uint8_t)((len >> 8) & 0xFF);
+ buf[3] = (uint8_t)(len & 0xFF);
+ }
+ if(len && mask){
+ buf[1] |= 0x80;
+ memcpy(buf + (headLen - 4), mbuf, 4);
+ }
+ if(client->add((const char *)buf, headLen) != headLen){
+ //os_printf("error adding %lu header bytes\n", headLen);
+ free(buf);
+ return 0;
+ }
+ free(buf);
+
+ if(len){
+ if(len && mask){
+ size_t i;
+ for(i=0;iadd((const char *)data, len) != len){
+ //os_printf("error adding %lu data bytes\n", len);
+ return 0;
+ }
+ }
+ if(!client->send()){
+ //os_printf("error sending frame: %lu\n", headLen+len);
+ return 0;
+ }
+ return len;
+}
+
+
+/*
+ * AsyncWebSocketMessageBuffer
+ */
+
+
+
+AsyncWebSocketMessageBuffer::AsyncWebSocketMessageBuffer()
+ :_data(nullptr)
+ ,_len(0)
+ ,_lock(false)
+ ,_count(0)
+{
+
+}
+
+AsyncWebSocketMessageBuffer::AsyncWebSocketMessageBuffer(uint8_t * data, size_t size)
+ :_data(nullptr)
+ ,_len(size)
+ ,_lock(false)
+ ,_count(0)
+{
+
+ if (!data) {
+ return;
+ }
+
+ _data = new uint8_t[_len + 1];
+
+ if (_data) {
+ memcpy(_data, data, _len);
+ _data[_len] = 0;
+ }
+}
+
+
+AsyncWebSocketMessageBuffer::AsyncWebSocketMessageBuffer(size_t size)
+ :_data(nullptr)
+ ,_len(size)
+ ,_lock(false)
+ ,_count(0)
+{
+ _data = new uint8_t[_len + 1];
+
+ if (_data) {
+ _data[_len] = 0;
+ }
+
+}
+
+AsyncWebSocketMessageBuffer::AsyncWebSocketMessageBuffer(const AsyncWebSocketMessageBuffer & copy)
+ :_data(nullptr)
+ ,_len(0)
+ ,_lock(false)
+ ,_count(0)
+{
+ _len = copy._len;
+ _lock = copy._lock;
+ _count = 0;
+
+ if (_len) {
+ _data = new uint8_t[_len + 1];
+ _data[_len] = 0;
+ }
+
+ if (_data) {
+ memcpy(_data, copy._data, _len);
+ _data[_len] = 0;
+ }
+
+}
+
+AsyncWebSocketMessageBuffer::AsyncWebSocketMessageBuffer(AsyncWebSocketMessageBuffer && copy)
+ :_data(nullptr)
+ ,_len(0)
+ ,_lock(false)
+ ,_count(0)
+{
+ _len = copy._len;
+ _lock = copy._lock;
+ _count = 0;
+
+ if (copy._data) {
+ _data = copy._data;
+ copy._data = nullptr;
+ }
+
+}
+
+AsyncWebSocketMessageBuffer::~AsyncWebSocketMessageBuffer()
+{
+ if (_data) {
+ delete[] _data;
+ }
+}
+
+bool AsyncWebSocketMessageBuffer::reserve(size_t size)
+{
+ _len = size;
+
+ if (_data) {
+ delete[] _data;
+ _data = nullptr;
+ }
+
+ _data = new uint8_t[_len + 1];
+
+ if (_data) {
+ _data[_len] = 0;
+ return true;
+ } else {
+ return false;
+ }
+
+}
+
+
+
+/*
+ * Control Frame
+ */
+
+class AsyncWebSocketControl {
+ private:
+ uint8_t _opcode;
+ uint8_t *_data;
+ size_t _len;
+ bool _mask;
+ bool _finished;
+ public:
+ AsyncWebSocketControl(uint8_t opcode, uint8_t *data=NULL, size_t len=0, bool mask=false)
+ :_opcode(opcode)
+ ,_len(len)
+ ,_mask(len && mask)
+ ,_finished(false)
+ {
+ if(data == NULL)
+ _len = 0;
+ if(_len){
+ if(_len > 125)
+ _len = 125;
+ _data = (uint8_t*)malloc(_len);
+ if(_data == NULL)
+ _len = 0;
+ else memcpy(_data, data, len);
+ } else _data = NULL;
+ }
+ virtual ~AsyncWebSocketControl(){
+ if(_data != NULL)
+ free(_data);
+ }
+ virtual bool finished() const { return _finished; }
+ uint8_t opcode(){ return _opcode; }
+ uint8_t len(){ return _len + 2; }
+ size_t send(AsyncClient *client){
+ _finished = true;
+ return webSocketSendFrame(client, true, _opcode & 0x0F, _mask, _data, _len);
+ }
+};
+
+/*
+ * Basic Buffered Message
+ */
+
+
+AsyncWebSocketBasicMessage::AsyncWebSocketBasicMessage(const char * data, size_t len, uint8_t opcode, bool mask)
+ :_len(len)
+ ,_sent(0)
+ ,_ack(0)
+ ,_acked(0)
+{
+ _opcode = opcode & 0x07;
+ _mask = mask;
+ _data = (uint8_t*)malloc(_len+1);
+ if(_data == NULL){
+ _len = 0;
+ _status = WS_MSG_ERROR;
+ } else {
+ _status = WS_MSG_SENDING;
+ memcpy(_data, data, _len);
+ _data[_len] = 0;
+ }
+}
+AsyncWebSocketBasicMessage::AsyncWebSocketBasicMessage(uint8_t opcode, bool mask)
+ :_len(0)
+ ,_sent(0)
+ ,_ack(0)
+ ,_acked(0)
+ ,_data(NULL)
+{
+ _opcode = opcode & 0x07;
+ _mask = mask;
+
+}
+
+
+AsyncWebSocketBasicMessage::~AsyncWebSocketBasicMessage() {
+ if(_data != NULL)
+ free(_data);
+}
+
+ void AsyncWebSocketBasicMessage::ack(size_t len, uint32_t time) {
+ (void)time;
+ _acked += len;
+ if(_sent == _len && _acked == _ack){
+ _status = WS_MSG_SENT;
+ }
+}
+ size_t AsyncWebSocketBasicMessage::send(AsyncClient *client) {
+ if(_status != WS_MSG_SENDING)
+ return 0;
+ if(_acked < _ack){
+ return 0;
+ }
+ if(_sent == _len){
+ if(_acked == _ack)
+ _status = WS_MSG_SENT;
+ return 0;
+ }
+ if(_sent > _len){
+ _status = WS_MSG_ERROR;
+ return 0;
+ }
+
+ size_t toSend = _len - _sent;
+ size_t window = webSocketSendFrameWindow(client);
+
+ if(window < toSend) {
+ toSend = window;
+ }
+
+ _sent += toSend;
+ _ack += toSend + ((toSend < 126)?2:4) + (_mask * 4);
+
+ bool final = (_sent == _len);
+ uint8_t* dPtr = (uint8_t*)(_data + (_sent - toSend));
+ uint8_t opCode = (toSend && _sent == toSend)?_opcode:(uint8_t)WS_CONTINUATION;
+
+ size_t sent = webSocketSendFrame(client, final, opCode, _mask, dPtr, toSend);
+ _status = WS_MSG_SENDING;
+ if(toSend && sent != toSend){
+ _sent -= (toSend - sent);
+ _ack -= (toSend - sent);
+ }
+ return sent;
+}
+
+// bool AsyncWebSocketBasicMessage::reserve(size_t size) {
+// if (size) {
+// _data = (uint8_t*)malloc(size +1);
+// if (_data) {
+// memset(_data, 0, size);
+// _len = size;
+// _status = WS_MSG_SENDING;
+// return true;
+// }
+// }
+// return false;
+// }
+
+
+/*
+ * AsyncWebSocketMultiMessage Message
+ */
+
+
+AsyncWebSocketMultiMessage::AsyncWebSocketMultiMessage(AsyncWebSocketMessageBuffer * buffer, uint8_t opcode, bool mask)
+ :_len(0)
+ ,_sent(0)
+ ,_ack(0)
+ ,_acked(0)
+ ,_WSbuffer(nullptr)
+{
+
+ _opcode = opcode & 0x07;
+ _mask = mask;
+
+ if (buffer) {
+ _WSbuffer = buffer;
+ (*_WSbuffer)++;
+ _data = buffer->get();
+ _len = buffer->length();
+ _status = WS_MSG_SENDING;
+ //ets_printf("M: %u\n", _len);
+ } else {
+ _status = WS_MSG_ERROR;
+ }
+
+}
+
+
+AsyncWebSocketMultiMessage::~AsyncWebSocketMultiMessage() {
+ if (_WSbuffer) {
+ (*_WSbuffer)--; // decreases the counter.
+ }
+}
+
+ void AsyncWebSocketMultiMessage::ack(size_t len, uint32_t time) {
+ (void)time;
+ _acked += len;
+ if(_sent >= _len && _acked >= _ack){
+ _status = WS_MSG_SENT;
+ }
+ //ets_printf("A: %u\n", len);
+}
+ size_t AsyncWebSocketMultiMessage::send(AsyncClient *client) {
+ if(_status != WS_MSG_SENDING)
+ return 0;
+ if(_acked < _ack){
+ return 0;
+ }
+ if(_sent == _len){
+ _status = WS_MSG_SENT;
+ return 0;
+ }
+ if(_sent > _len){
+ _status = WS_MSG_ERROR;
+ //ets_printf("E: %u > %u\n", _sent, _len);
+ return 0;
+ }
+
+ size_t toSend = _len - _sent;
+ size_t window = webSocketSendFrameWindow(client);
+
+ if(window < toSend) {
+ toSend = window;
+ }
+
+ _sent += toSend;
+ _ack += toSend + ((toSend < 126)?2:4) + (_mask * 4);
+
+ //ets_printf("W: %u %u\n", _sent - toSend, toSend);
+
+ bool final = (_sent == _len);
+ uint8_t* dPtr = (uint8_t*)(_data + (_sent - toSend));
+ uint8_t opCode = (toSend && _sent == toSend)?_opcode:(uint8_t)WS_CONTINUATION;
+
+ size_t sent = webSocketSendFrame(client, final, opCode, _mask, dPtr, toSend);
+ _status = WS_MSG_SENDING;
+ if(toSend && sent != toSend){
+ //ets_printf("E: %u != %u\n", toSend, sent);
+ _sent -= (toSend - sent);
+ _ack -= (toSend - sent);
+ }
+ //ets_printf("S: %u %u\n", _sent, sent);
+ return sent;
+}
+
+
+/*
+ * Async WebSocket Client
+ */
+ const char * AWSC_PING_PAYLOAD = "ESPAsyncWebServer-PING";
+ const size_t AWSC_PING_PAYLOAD_LEN = 22;
+
+AsyncWebSocketClient::AsyncWebSocketClient(AsyncWebServerRequest *request, AsyncWebSocket *server)
+ : _controlQueue(AsyncLinkedList([](AsyncWebSocketControl *c){ delete c; }))
+ , _messageQueue(AsyncLinkedList([](AsyncWebSocketMessage *m){ delete m; }))
+ , _tempObject(NULL)
+{
+ _client = request->client();
+ _server = server;
+ _clientId = _server->_getNextId();
+ _status = WS_CONNECTED;
+ _pstate = 0;
+ _lastMessageTime = millis();
+ _keepAlivePeriod = 0;
+ _client->setRxTimeout(0);
+ _client->onError([](void *r, AsyncClient* c, int8_t error){ (void)c; ((AsyncWebSocketClient*)(r))->_onError(error); }, this);
+ _client->onAck([](void *r, AsyncClient* c, size_t len, uint32_t time){ (void)c; ((AsyncWebSocketClient*)(r))->_onAck(len, time); }, this);
+ _client->onDisconnect([](void *r, AsyncClient* c){ ((AsyncWebSocketClient*)(r))->_onDisconnect(); delete c; }, this);
+ _client->onTimeout([](void *r, AsyncClient* c, uint32_t time){ (void)c; ((AsyncWebSocketClient*)(r))->_onTimeout(time); }, this);
+ _client->onData([](void *r, AsyncClient* c, void *buf, size_t len){ (void)c; ((AsyncWebSocketClient*)(r))->_onData(buf, len); }, this);
+ _client->onPoll([](void *r, AsyncClient* c){ (void)c; ((AsyncWebSocketClient*)(r))->_onPoll(); }, this);
+ _server->_addClient(this);
+ _server->_handleEvent(this, WS_EVT_CONNECT, request, NULL, 0);
+ delete request;
+}
+
+AsyncWebSocketClient::~AsyncWebSocketClient(){
+ _messageQueue.free();
+ _controlQueue.free();
+ _server->_handleEvent(this, WS_EVT_DISCONNECT, NULL, NULL, 0);
+}
+
+void AsyncWebSocketClient::_onAck(size_t len, uint32_t time){
+ _lastMessageTime = millis();
+ if(!_controlQueue.isEmpty()){
+ auto head = _controlQueue.front();
+ if(head->finished()){
+ len -= head->len();
+ if(_status == WS_DISCONNECTING && head->opcode() == WS_DISCONNECT){
+ _controlQueue.remove(head);
+ _status = WS_DISCONNECTED;
+ _client->close(true);
+ return;
+ }
+ _controlQueue.remove(head);
+ }
+ }
+ if(len && !_messageQueue.isEmpty()){
+ _messageQueue.front()->ack(len, time);
+ }
+ _server->_cleanBuffers();
+ _runQueue();
+}
+
+void AsyncWebSocketClient::_onPoll(){
+ if(_client->canSend() && (!_controlQueue.isEmpty() || !_messageQueue.isEmpty())){
+ _runQueue();
+ } else if(_keepAlivePeriod > 0 && _controlQueue.isEmpty() && _messageQueue.isEmpty() && (millis() - _lastMessageTime) >= _keepAlivePeriod){
+ ping((uint8_t *)AWSC_PING_PAYLOAD, AWSC_PING_PAYLOAD_LEN);
+ }
+}
+
+void AsyncWebSocketClient::_runQueue(){
+ while(!_messageQueue.isEmpty() && _messageQueue.front()->finished()){
+ _messageQueue.remove(_messageQueue.front());
+ }
+
+ if(!_controlQueue.isEmpty() && (_messageQueue.isEmpty() || _messageQueue.front()->betweenFrames()) && webSocketSendFrameWindow(_client) > (size_t)(_controlQueue.front()->len() - 1)){
+ _controlQueue.front()->send(_client);
+ } else if(!_messageQueue.isEmpty() && _messageQueue.front()->betweenFrames() && webSocketSendFrameWindow(_client)){
+ _messageQueue.front()->send(_client);
+ }
+}
+
+bool AsyncWebSocketClient::queueIsFull(){
+ if((_messageQueue.length() >= WS_MAX_QUEUED_MESSAGES) || (_status != WS_CONNECTED) ) return true;
+ return false;
+}
+
+void AsyncWebSocketClient::_queueMessage(AsyncWebSocketMessage *dataMessage){
+ if(dataMessage == NULL)
+ return;
+ if(_status != WS_CONNECTED){
+ delete dataMessage;
+ return;
+ }
+ if(_messageQueue.length() >= WS_MAX_QUEUED_MESSAGES){
+ ets_printf("ERROR: Too many messages queued\n");
+ delete dataMessage;
+ } else {
+ _messageQueue.add(dataMessage);
+ }
+ if(_client->canSend())
+ _runQueue();
+}
+
+void AsyncWebSocketClient::_queueControl(AsyncWebSocketControl *controlMessage){
+ if(controlMessage == NULL)
+ return;
+ _controlQueue.add(controlMessage);
+ if(_client->canSend())
+ _runQueue();
+}
+
+void AsyncWebSocketClient::close(uint16_t code, const char * message){
+ if(_status != WS_CONNECTED)
+ return;
+ if(code){
+ uint8_t packetLen = 2;
+ if(message != NULL){
+ size_t mlen = strlen(message);
+ if(mlen > 123) mlen = 123;
+ packetLen += mlen;
+ }
+ char * buf = (char*)malloc(packetLen);
+ if(buf != NULL){
+ buf[0] = (uint8_t)(code >> 8);
+ buf[1] = (uint8_t)(code & 0xFF);
+ if(message != NULL){
+ memcpy(buf+2, message, packetLen -2);
+ }
+ _queueControl(new AsyncWebSocketControl(WS_DISCONNECT,(uint8_t*)buf,packetLen));
+ free(buf);
+ return;
+ }
+ }
+ _queueControl(new AsyncWebSocketControl(WS_DISCONNECT));
+}
+
+void AsyncWebSocketClient::ping(uint8_t *data, size_t len){
+ if(_status == WS_CONNECTED)
+ _queueControl(new AsyncWebSocketControl(WS_PING, data, len));
+}
+
+void AsyncWebSocketClient::_onError(int8_t){}
+
+void AsyncWebSocketClient::_onTimeout(uint32_t time){
+ (void)time;
+ _client->close(true);
+}
+
+void AsyncWebSocketClient::_onDisconnect(){
+ _client = NULL;
+ _server->_handleDisconnect(this);
+}
+
+void AsyncWebSocketClient::_onData(void *pbuf, size_t plen){
+ _lastMessageTime = millis();
+ uint8_t *data = (uint8_t*)pbuf;
+ while(plen > 0){
+ if(!_pstate){
+ const uint8_t *fdata = data;
+ _pinfo.index = 0;
+ _pinfo.final = (fdata[0] & 0x80) != 0;
+ _pinfo.opcode = fdata[0] & 0x0F;
+ _pinfo.masked = (fdata[1] & 0x80) != 0;
+ _pinfo.len = fdata[1] & 0x7F;
+ data += 2;
+ plen -= 2;
+ if(_pinfo.len == 126){
+ _pinfo.len = fdata[3] | (uint16_t)(fdata[2]) << 8;
+ data += 2;
+ plen -= 2;
+ } else if(_pinfo.len == 127){
+ _pinfo.len = fdata[9] | (uint16_t)(fdata[8]) << 8 | (uint32_t)(fdata[7]) << 16 | (uint32_t)(fdata[6]) << 24 | (uint64_t)(fdata[5]) << 32 | (uint64_t)(fdata[4]) << 40 | (uint64_t)(fdata[3]) << 48 | (uint64_t)(fdata[2]) << 56;
+ data += 8;
+ plen -= 8;
+ }
+
+ if(_pinfo.masked){
+ memcpy(_pinfo.mask, data, 4);
+ data += 4;
+ plen -= 4;
+ }
+ }
+
+ const size_t datalen = std::min((size_t)(_pinfo.len - _pinfo.index), plen);
+ const auto datalast = data[datalen];
+
+ if(_pinfo.masked){
+ for(size_t i=0;i_handleEvent(this, WS_EVT_DATA, (void *)&_pinfo, (uint8_t*)data, datalen);
+
+ _pinfo.index += datalen;
+ } else if((datalen + _pinfo.index) == _pinfo.len){
+ _pstate = 0;
+ if(_pinfo.opcode == WS_DISCONNECT){
+ if(datalen){
+ uint16_t reasonCode = (uint16_t)(data[0] << 8) + data[1];
+ char * reasonString = (char*)(data+2);
+ if(reasonCode > 1001){
+ _server->_handleEvent(this, WS_EVT_ERROR, (void *)&reasonCode, (uint8_t*)reasonString, strlen(reasonString));
+ }
+ }
+ if(_status == WS_DISCONNECTING){
+ _status = WS_DISCONNECTED;
+ _client->close(true);
+ } else {
+ _status = WS_DISCONNECTING;
+ _client->ackLater();
+ _queueControl(new AsyncWebSocketControl(WS_DISCONNECT, data, datalen));
+ }
+ } else if(_pinfo.opcode == WS_PING){
+ _queueControl(new AsyncWebSocketControl(WS_PONG, data, datalen));
+ } else if(_pinfo.opcode == WS_PONG){
+ if(datalen != AWSC_PING_PAYLOAD_LEN || memcmp(AWSC_PING_PAYLOAD, data, AWSC_PING_PAYLOAD_LEN) != 0)
+ _server->_handleEvent(this, WS_EVT_PONG, NULL, data, datalen);
+ } else if(_pinfo.opcode < 8){//continuation or text/binary frame
+ _server->_handleEvent(this, WS_EVT_DATA, (void *)&_pinfo, data, datalen);
+ }
+ } else {
+ //os_printf("frame error: len: %u, index: %llu, total: %llu\n", datalen, _pinfo.index, _pinfo.len);
+ //what should we do?
+ break;
+ }
+
+ // restore byte as _handleEvent may have added a null terminator i.e., data[len] = 0;
+ if (datalen > 0)
+ data[datalen] = datalast;
+
+ data += datalen;
+ plen -= datalen;
+ }
+}
+
+size_t AsyncWebSocketClient::printf(const char *format, ...) {
+ va_list arg;
+ va_start(arg, format);
+ char* temp = new char[MAX_PRINTF_LEN];
+ if(!temp){
+ va_end(arg);
+ return 0;
+ }
+ char* buffer = temp;
+ size_t len = vsnprintf(temp, MAX_PRINTF_LEN, format, arg);
+ va_end(arg);
+
+ if (len > (MAX_PRINTF_LEN - 1)) {
+ buffer = new char[len + 1];
+ if (!buffer) {
+ delete[] temp;
+ return 0;
+ }
+ va_start(arg, format);
+ vsnprintf(buffer, len + 1, format, arg);
+ va_end(arg);
+ }
+ text(buffer, len);
+ if (buffer != temp) {
+ delete[] buffer;
+ }
+ delete[] temp;
+ return len;
+}
+
+#ifndef ESP32
+size_t AsyncWebSocketClient::printf_P(PGM_P formatP, ...) {
+ va_list arg;
+ va_start(arg, formatP);
+ char* temp = new char[MAX_PRINTF_LEN];
+ if(!temp){
+ va_end(arg);
+ return 0;
+ }
+ char* buffer = temp;
+ size_t len = vsnprintf_P(temp, MAX_PRINTF_LEN, formatP, arg);
+ va_end(arg);
+
+ if (len > (MAX_PRINTF_LEN - 1)) {
+ buffer = new char[len + 1];
+ if (!buffer) {
+ delete[] temp;
+ return 0;
+ }
+ va_start(arg, formatP);
+ vsnprintf_P(buffer, len + 1, formatP, arg);
+ va_end(arg);
+ }
+ text(buffer, len);
+ if (buffer != temp) {
+ delete[] buffer;
+ }
+ delete[] temp;
+ return len;
+}
+#endif
+
+void AsyncWebSocketClient::text(const char * message, size_t len){
+ _queueMessage(new AsyncWebSocketBasicMessage(message, len));
+}
+void AsyncWebSocketClient::text(const char * message){
+ text(message, strlen(message));
+}
+void AsyncWebSocketClient::text(uint8_t * message, size_t len){
+ text((const char *)message, len);
+}
+void AsyncWebSocketClient::text(char * message){
+ text(message, strlen(message));
+}
+void AsyncWebSocketClient::text(const String &message){
+ text(message.c_str(), message.length());
+}
+void AsyncWebSocketClient::text(const __FlashStringHelper *data){
+ PGM_P p = reinterpret_cast(data);
+ size_t n = 0;
+ while (1) {
+ if (pgm_read_byte(p+n) == 0) break;
+ n += 1;
+ }
+ char * message = (char*) malloc(n+1);
+ if(message){
+ for(size_t b=0; b(data);
+ char * message = (char*) malloc(len);
+ if(message){
+ for(size_t b=0; bremoteIP();
+}
+
+uint16_t AsyncWebSocketClient::remotePort() {
+ if(!_client) {
+ return 0;
+ }
+ return _client->remotePort();
+}
+
+
+
+/*
+ * Async Web Socket - Each separate socket location
+ */
+
+AsyncWebSocket::AsyncWebSocket(const String& url)
+ :_url(url)
+ ,_clients(AsyncLinkedList([](AsyncWebSocketClient *c){ delete c; }))
+ ,_cNextId(1)
+ ,_enabled(true)
+ ,_buffers(AsyncLinkedList([](AsyncWebSocketMessageBuffer *b){ delete b; }))
+{
+ _eventHandler = NULL;
+}
+
+AsyncWebSocket::~AsyncWebSocket(){}
+
+void AsyncWebSocket::_handleEvent(AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len){
+ if(_eventHandler != NULL){
+ _eventHandler(this, client, type, arg, data, len);
+ }
+}
+
+void AsyncWebSocket::_addClient(AsyncWebSocketClient * client){
+ _clients.add(client);
+}
+
+void AsyncWebSocket::_handleDisconnect(AsyncWebSocketClient * client){
+
+ _clients.remove_first([=](AsyncWebSocketClient * c){
+ return c->id() == client->id();
+ });
+}
+
+bool AsyncWebSocket::availableForWriteAll(){
+ for(const auto& c: _clients){
+ if(c->queueIsFull()) return false;
+ }
+ return true;
+}
+
+bool AsyncWebSocket::availableForWrite(uint32_t id){
+ for(const auto& c: _clients){
+ if(c->queueIsFull() && (c->id() == id )) return false;
+ }
+ return true;
+}
+
+size_t AsyncWebSocket::count() const {
+ return _clients.count_if([](AsyncWebSocketClient * c){
+ return c->status() == WS_CONNECTED;
+ });
+}
+
+AsyncWebSocketClient * AsyncWebSocket::client(uint32_t id){
+ for(const auto &c: _clients){
+ if(c->id() == id && c->status() == WS_CONNECTED){
+ return c;
+ }
+ }
+ return nullptr;
+}
+
+
+void AsyncWebSocket::close(uint32_t id, uint16_t code, const char * message){
+ AsyncWebSocketClient * c = client(id);
+ if(c)
+ c->close(code, message);
+}
+
+void AsyncWebSocket::closeAll(uint16_t code, const char * message){
+ for(const auto& c: _clients){
+ if(c->status() == WS_CONNECTED)
+ c->close(code, message);
+ }
+}
+
+void AsyncWebSocket::cleanupClients(uint16_t maxClients)
+{
+ if (count() > maxClients){
+ _clients.front()->close();
+ }
+}
+
+void AsyncWebSocket::ping(uint32_t id, uint8_t *data, size_t len){
+ AsyncWebSocketClient * c = client(id);
+ if(c)
+ c->ping(data, len);
+}
+
+void AsyncWebSocket::pingAll(uint8_t *data, size_t len){
+ for(const auto& c: _clients){
+ if(c->status() == WS_CONNECTED)
+ c->ping(data, len);
+ }
+}
+
+void AsyncWebSocket::text(uint32_t id, const char * message, size_t len){
+ AsyncWebSocketClient * c = client(id);
+ if(c)
+ c->text(message, len);
+}
+
+void AsyncWebSocket::textAll(AsyncWebSocketMessageBuffer * buffer){
+ if (!buffer) return;
+ buffer->lock();
+ for(const auto& c: _clients){
+ if(c->status() == WS_CONNECTED){
+ c->text(buffer);
+ }
+ }
+ buffer->unlock();
+ _cleanBuffers();
+}
+
+
+void AsyncWebSocket::textAll(const char * message, size_t len){
+ AsyncWebSocketMessageBuffer * WSBuffer = makeBuffer((uint8_t *)message, len);
+ textAll(WSBuffer);
+}
+
+void AsyncWebSocket::binary(uint32_t id, const char * message, size_t len){
+ AsyncWebSocketClient * c = client(id);
+ if(c)
+ c->binary(message, len);
+}
+
+void AsyncWebSocket::binaryAll(const char * message, size_t len){
+ AsyncWebSocketMessageBuffer * buffer = makeBuffer((uint8_t *)message, len);
+ binaryAll(buffer);
+}
+
+void AsyncWebSocket::binaryAll(AsyncWebSocketMessageBuffer * buffer)
+{
+ if (!buffer) return;
+ buffer->lock();
+ for(const auto& c: _clients){
+ if(c->status() == WS_CONNECTED)
+ c->binary(buffer);
+ }
+ buffer->unlock();
+ _cleanBuffers();
+}
+
+void AsyncWebSocket::message(uint32_t id, AsyncWebSocketMessage *message){
+ AsyncWebSocketClient * c = client(id);
+ if(c)
+ c->message(message);
+}
+
+void AsyncWebSocket::messageAll(AsyncWebSocketMultiMessage *message){
+ for(const auto& c: _clients){
+ if(c->status() == WS_CONNECTED)
+ c->message(message);
+ }
+ _cleanBuffers();
+}
+
+size_t AsyncWebSocket::printf(uint32_t id, const char *format, ...){
+ AsyncWebSocketClient * c = client(id);
+ if(c){
+ va_list arg;
+ va_start(arg, format);
+ size_t len = c->printf(format, arg);
+ va_end(arg);
+ return len;
+ }
+ return 0;
+}
+
+size_t AsyncWebSocket::printfAll(const char *format, ...) {
+ va_list arg;
+ char* temp = new char[MAX_PRINTF_LEN];
+ if(!temp){
+ return 0;
+ }
+ va_start(arg, format);
+ size_t len = vsnprintf(temp, MAX_PRINTF_LEN, format, arg);
+ va_end(arg);
+ delete[] temp;
+
+ AsyncWebSocketMessageBuffer * buffer = makeBuffer(len);
+ if (!buffer) {
+ return 0;
+ }
+
+ va_start(arg, format);
+ vsnprintf( (char *)buffer->get(), len + 1, format, arg);
+ va_end(arg);
+
+ textAll(buffer);
+ return len;
+}
+
+#ifndef ESP32
+size_t AsyncWebSocket::printf_P(uint32_t id, PGM_P formatP, ...){
+ AsyncWebSocketClient * c = client(id);
+ if(c != NULL){
+ va_list arg;
+ va_start(arg, formatP);
+ size_t len = c->printf_P(formatP, arg);
+ va_end(arg);
+ return len;
+ }
+ return 0;
+}
+#endif
+
+size_t AsyncWebSocket::printfAll_P(PGM_P formatP, ...) {
+ va_list arg;
+ char* temp = new char[MAX_PRINTF_LEN];
+ if(!temp){
+ return 0;
+ }
+ va_start(arg, formatP);
+ size_t len = vsnprintf_P(temp, MAX_PRINTF_LEN, formatP, arg);
+ va_end(arg);
+ delete[] temp;
+
+ AsyncWebSocketMessageBuffer * buffer = makeBuffer(len + 1);
+ if (!buffer) {
+ return 0;
+ }
+
+ va_start(arg, formatP);
+ vsnprintf_P((char *)buffer->get(), len + 1, formatP, arg);
+ va_end(arg);
+
+ textAll(buffer);
+ return len;
+}
+
+void AsyncWebSocket::text(uint32_t id, const char * message){
+ text(id, message, strlen(message));
+}
+void AsyncWebSocket::text(uint32_t id, uint8_t * message, size_t len){
+ text(id, (const char *)message, len);
+}
+void AsyncWebSocket::text(uint32_t id, char * message){
+ text(id, message, strlen(message));
+}
+void AsyncWebSocket::text(uint32_t id, const String &message){
+ text(id, message.c_str(), message.length());
+}
+void AsyncWebSocket::text(uint32_t id, const __FlashStringHelper *message){
+ AsyncWebSocketClient * c = client(id);
+ if(c != NULL)
+ c->text(message);
+}
+void AsyncWebSocket::textAll(const char * message){
+ textAll(message, strlen(message));
+}
+void AsyncWebSocket::textAll(uint8_t * message, size_t len){
+ textAll((const char *)message, len);
+}
+void AsyncWebSocket::textAll(char * message){
+ textAll(message, strlen(message));
+}
+void AsyncWebSocket::textAll(const String &message){
+ textAll(message.c_str(), message.length());
+}
+void AsyncWebSocket::textAll(const __FlashStringHelper *message){
+ for(const auto& c: _clients){
+ if(c->status() == WS_CONNECTED)
+ c->text(message);
+ }
+}
+void AsyncWebSocket::binary(uint32_t id, const char * message){
+ binary(id, message, strlen(message));
+}
+void AsyncWebSocket::binary(uint32_t id, uint8_t * message, size_t len){
+ binary(id, (const char *)message, len);
+}
+void AsyncWebSocket::binary(uint32_t id, char * message){
+ binary(id, message, strlen(message));
+}
+void AsyncWebSocket::binary(uint32_t id, const String &message){
+ binary(id, message.c_str(), message.length());
+}
+void AsyncWebSocket::binary(uint32_t id, const __FlashStringHelper *message, size_t len){
+ AsyncWebSocketClient * c = client(id);
+ if(c != NULL)
+ c-> binary(message, len);
+}
+void AsyncWebSocket::binaryAll(const char * message){
+ binaryAll(message, strlen(message));
+}
+void AsyncWebSocket::binaryAll(uint8_t * message, size_t len){
+ binaryAll((const char *)message, len);
+}
+void AsyncWebSocket::binaryAll(char * message){
+ binaryAll(message, strlen(message));
+}
+void AsyncWebSocket::binaryAll(const String &message){
+ binaryAll(message.c_str(), message.length());
+}
+void AsyncWebSocket::binaryAll(const __FlashStringHelper *message, size_t len){
+ for(const auto& c: _clients){
+ if(c->status() == WS_CONNECTED)
+ c-> binary(message, len);
+ }
+ }
+
+const char * WS_STR_CONNECTION = "Connection";
+const char * WS_STR_UPGRADE = "Upgrade";
+const char * WS_STR_ORIGIN = "Origin";
+const char * WS_STR_VERSION = "Sec-WebSocket-Version";
+const char * WS_STR_KEY = "Sec-WebSocket-Key";
+const char * WS_STR_PROTOCOL = "Sec-WebSocket-Protocol";
+const char * WS_STR_ACCEPT = "Sec-WebSocket-Accept";
+const char * WS_STR_UUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
+
+bool AsyncWebSocket::canHandle(AsyncWebServerRequest *request){
+ if(!_enabled)
+ return false;
+
+ if(request->method() != HTTP_GET || !request->url().equals(_url) || !request->isExpectedRequestedConnType(RCT_WS))
+ return false;
+
+ request->addInterestingHeader(WS_STR_CONNECTION);
+ request->addInterestingHeader(WS_STR_UPGRADE);
+ request->addInterestingHeader(WS_STR_ORIGIN);
+ request->addInterestingHeader(WS_STR_VERSION);
+ request->addInterestingHeader(WS_STR_KEY);
+ request->addInterestingHeader(WS_STR_PROTOCOL);
+ return true;
+}
+
+void AsyncWebSocket::handleRequest(AsyncWebServerRequest *request){
+ if(!request->hasHeader(WS_STR_VERSION) || !request->hasHeader(WS_STR_KEY)){
+ request->send(400);
+ return;
+ }
+ if((_username != "" && _password != "") && !request->authenticate(_username.c_str(), _password.c_str())){
+ return request->requestAuthentication();
+ }
+ AsyncWebHeader* version = request->getHeader(WS_STR_VERSION);
+ if(version->value().toInt() != 13){
+ AsyncWebServerResponse *response = request->beginResponse(400);
+ response->addHeader(WS_STR_VERSION,"13");
+ request->send(response);
+ return;
+ }
+ AsyncWebHeader* key = request->getHeader(WS_STR_KEY);
+ AsyncWebServerResponse *response = new AsyncWebSocketResponse(key->value(), this);
+ if(request->hasHeader(WS_STR_PROTOCOL)){
+ AsyncWebHeader* protocol = request->getHeader(WS_STR_PROTOCOL);
+ //ToDo: check protocol
+ response->addHeader(WS_STR_PROTOCOL, protocol->value());
+ }
+ request->send(response);
+}
+
+AsyncWebSocketMessageBuffer * AsyncWebSocket::makeBuffer(size_t size)
+{
+ AsyncWebSocketMessageBuffer * buffer = new AsyncWebSocketMessageBuffer(size);
+ if (buffer) {
+ AsyncWebLockGuard l(_lock);
+ _buffers.add(buffer);
+ }
+ return buffer;
+}
+
+AsyncWebSocketMessageBuffer * AsyncWebSocket::makeBuffer(uint8_t * data, size_t size)
+{
+ AsyncWebSocketMessageBuffer * buffer = new AsyncWebSocketMessageBuffer(data, size);
+
+ if (buffer) {
+ AsyncWebLockGuard l(_lock);
+ _buffers.add(buffer);
+ }
+
+ return buffer;
+}
+
+void AsyncWebSocket::_cleanBuffers()
+{
+ AsyncWebLockGuard l(_lock);
+
+ for(AsyncWebSocketMessageBuffer * c: _buffers){
+ if(c && c->canDelete()){
+ _buffers.remove(c);
+ }
+ }
+}
+
+AsyncWebSocket::AsyncWebSocketClientAsyncLinkedList AsyncWebSocket::getClients() const {
+ return _clients;
+}
+
+/*
+ * Response to Web Socket request - sends the authorization and detaches the TCP Client from the web server
+ * Authentication code from https://github.com/Links2004/arduinoWebSockets/blob/master/src/WebSockets.cpp#L480
+ */
+
+AsyncWebSocketResponse::AsyncWebSocketResponse(const String& key, AsyncWebSocket *server){
+ _server = server;
+ _code = 101;
+ _sendContentLength = false;
+
+ uint8_t * hash = (uint8_t*)malloc(20);
+ if(hash == NULL){
+ _state = RESPONSE_FAILED;
+ return;
+ }
+ char * buffer = (char *) malloc(33);
+ if(buffer == NULL){
+ free(hash);
+ _state = RESPONSE_FAILED;
+ return;
+ }
+#ifdef ESP8266
+ sha1(key + WS_STR_UUID, hash);
+#else
+ (String&)key += WS_STR_UUID;
+ mbedtls_sha1_context ctx;
+ mbedtls_sha1_init(&ctx);
+ mbedtls_sha1_starts_ret(&ctx);
+ mbedtls_sha1_update_ret(&ctx, (const unsigned char*)key.c_str(), key.length());
+ mbedtls_sha1_finish_ret(&ctx, hash);
+ mbedtls_sha1_free(&ctx);
+#endif
+ base64_encodestate _state;
+ base64_init_encodestate(&_state);
+ int len = base64_encode_block((const char *) hash, 20, buffer, &_state);
+ len = base64_encode_blockend((buffer + len), &_state);
+ addHeader(WS_STR_CONNECTION, WS_STR_UPGRADE);
+ addHeader(WS_STR_UPGRADE, "websocket");
+ addHeader(WS_STR_ACCEPT,buffer);
+ free(buffer);
+ free(hash);
+}
+
+void AsyncWebSocketResponse::_respond(AsyncWebServerRequest *request){
+ if(_state == RESPONSE_FAILED){
+ request->client()->close(true);
+ return;
+ }
+ String out = _assembleHead(request->version());
+ request->client()->write(out.c_str(), _headLength);
+ _state = RESPONSE_WAIT_ACK;
+}
+
+size_t AsyncWebSocketResponse::_ack(AsyncWebServerRequest *request, size_t len, uint32_t time){
+ (void)time;
+ if(len){
+ new AsyncWebSocketClient(request, _server);
+ }
+ return 0;
+}
diff --git a/lib/libesp32/ESPAsyncWebServer/src/AsyncWebSocket.h b/lib/libesp32/ESPAsyncWebServer/src/AsyncWebSocket.h
new file mode 100644
index 000000000..7fb1e92de
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/src/AsyncWebSocket.h
@@ -0,0 +1,350 @@
+/*
+ Asynchronous WebServer library for Espressif MCUs
+
+ Copyright (c) 2016 Hristo Gochkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+#ifndef ASYNCWEBSOCKET_H_
+#define ASYNCWEBSOCKET_H_
+
+#include
+#ifdef ESP32
+#include
+#define WS_MAX_QUEUED_MESSAGES 32
+#else
+#include
+#define WS_MAX_QUEUED_MESSAGES 8
+#endif
+#include
+
+#include "AsyncWebSynchronization.h"
+
+#ifdef ESP8266
+#include
+#ifdef CRYPTO_HASH_h // include Hash.h from espressif framework if the first include was from the crypto library
+#include <../src/Hash.h>
+#endif
+#endif
+
+#ifdef ESP32
+#define DEFAULT_MAX_WS_CLIENTS 8
+#else
+#define DEFAULT_MAX_WS_CLIENTS 4
+#endif
+
+class AsyncWebSocket;
+class AsyncWebSocketResponse;
+class AsyncWebSocketClient;
+class AsyncWebSocketControl;
+
+typedef struct {
+ /** Message type as defined by enum AwsFrameType.
+ * Note: Applications will only see WS_TEXT and WS_BINARY.
+ * All other types are handled by the library. */
+ uint8_t message_opcode;
+ /** Frame number of a fragmented message. */
+ uint32_t num;
+ /** Is this the last frame in a fragmented message ?*/
+ uint8_t final;
+ /** Is this frame masked? */
+ uint8_t masked;
+ /** Message type as defined by enum AwsFrameType.
+ * This value is the same as message_opcode for non-fragmented
+ * messages, but may also be WS_CONTINUATION in a fragmented message. */
+ uint8_t opcode;
+ /** Length of the current frame.
+ * This equals the total length of the message if num == 0 && final == true */
+ uint64_t len;
+ /** Mask key */
+ uint8_t mask[4];
+ /** Offset of the data inside the current frame. */
+ uint64_t index;
+} AwsFrameInfo;
+
+typedef enum { WS_DISCONNECTED, WS_CONNECTED, WS_DISCONNECTING } AwsClientStatus;
+typedef enum { WS_CONTINUATION, WS_TEXT, WS_BINARY, WS_DISCONNECT = 0x08, WS_PING, WS_PONG } AwsFrameType;
+typedef enum { WS_MSG_SENDING, WS_MSG_SENT, WS_MSG_ERROR } AwsMessageStatus;
+typedef enum { WS_EVT_CONNECT, WS_EVT_DISCONNECT, WS_EVT_PONG, WS_EVT_ERROR, WS_EVT_DATA } AwsEventType;
+
+class AsyncWebSocketMessageBuffer {
+ private:
+ uint8_t * _data;
+ size_t _len;
+ bool _lock;
+ uint32_t _count;
+
+ public:
+ AsyncWebSocketMessageBuffer();
+ AsyncWebSocketMessageBuffer(size_t size);
+ AsyncWebSocketMessageBuffer(uint8_t * data, size_t size);
+ AsyncWebSocketMessageBuffer(const AsyncWebSocketMessageBuffer &);
+ AsyncWebSocketMessageBuffer(AsyncWebSocketMessageBuffer &&);
+ ~AsyncWebSocketMessageBuffer();
+ void operator ++(int i) { (void)i; _count++; }
+ void operator --(int i) { (void)i; if (_count > 0) { _count--; } ; }
+ bool reserve(size_t size);
+ void lock() { _lock = true; }
+ void unlock() { _lock = false; }
+ uint8_t * get() { return _data; }
+ size_t length() { return _len; }
+ uint32_t count() { return _count; }
+ bool canDelete() { return (!_count && !_lock); }
+
+ friend AsyncWebSocket;
+
+};
+
+class AsyncWebSocketMessage {
+ protected:
+ uint8_t _opcode;
+ bool _mask;
+ AwsMessageStatus _status;
+ public:
+ AsyncWebSocketMessage():_opcode(WS_TEXT),_mask(false),_status(WS_MSG_ERROR){}
+ virtual ~AsyncWebSocketMessage(){}
+ virtual void ack(size_t len __attribute__((unused)), uint32_t time __attribute__((unused))){}
+ virtual size_t send(AsyncClient *client __attribute__((unused))){ return 0; }
+ virtual bool finished(){ return _status != WS_MSG_SENDING; }
+ virtual bool betweenFrames() const { return false; }
+};
+
+class AsyncWebSocketBasicMessage: public AsyncWebSocketMessage {
+ private:
+ size_t _len;
+ size_t _sent;
+ size_t _ack;
+ size_t _acked;
+ uint8_t * _data;
+public:
+ AsyncWebSocketBasicMessage(const char * data, size_t len, uint8_t opcode=WS_TEXT, bool mask=false);
+ AsyncWebSocketBasicMessage(uint8_t opcode=WS_TEXT, bool mask=false);
+ virtual ~AsyncWebSocketBasicMessage() override;
+ virtual bool betweenFrames() const override { return _acked == _ack; }
+ virtual void ack(size_t len, uint32_t time) override ;
+ virtual size_t send(AsyncClient *client) override ;
+};
+
+class AsyncWebSocketMultiMessage: public AsyncWebSocketMessage {
+ private:
+ uint8_t * _data;
+ size_t _len;
+ size_t _sent;
+ size_t _ack;
+ size_t _acked;
+ AsyncWebSocketMessageBuffer * _WSbuffer;
+public:
+ AsyncWebSocketMultiMessage(AsyncWebSocketMessageBuffer * buffer, uint8_t opcode=WS_TEXT, bool mask=false);
+ virtual ~AsyncWebSocketMultiMessage() override;
+ virtual bool betweenFrames() const override { return _acked == _ack; }
+ virtual void ack(size_t len, uint32_t time) override ;
+ virtual size_t send(AsyncClient *client) override ;
+};
+
+class AsyncWebSocketClient {
+ private:
+ AsyncClient *_client;
+ AsyncWebSocket *_server;
+ uint32_t _clientId;
+ AwsClientStatus _status;
+
+ AsyncLinkedList _controlQueue;
+ AsyncLinkedList _messageQueue;
+
+ uint8_t _pstate;
+ AwsFrameInfo _pinfo;
+
+ uint32_t _lastMessageTime;
+ uint32_t _keepAlivePeriod;
+
+ void _queueMessage(AsyncWebSocketMessage *dataMessage);
+ void _queueControl(AsyncWebSocketControl *controlMessage);
+ void _runQueue();
+
+ public:
+ void *_tempObject;
+
+ AsyncWebSocketClient(AsyncWebServerRequest *request, AsyncWebSocket *server);
+ ~AsyncWebSocketClient();
+
+ //client id increments for the given server
+ uint32_t id(){ return _clientId; }
+ AwsClientStatus status(){ return _status; }
+ AsyncClient* client(){ return _client; }
+ AsyncWebSocket *server(){ return _server; }
+ AwsFrameInfo const &pinfo() const { return _pinfo; }
+
+ IPAddress remoteIP();
+ uint16_t remotePort();
+
+ //control frames
+ void close(uint16_t code=0, const char * message=NULL);
+ void ping(uint8_t *data=NULL, size_t len=0);
+
+ //set auto-ping period in seconds. disabled if zero (default)
+ void keepAlivePeriod(uint16_t seconds){
+ _keepAlivePeriod = seconds * 1000;
+ }
+ uint16_t keepAlivePeriod(){
+ return (uint16_t)(_keepAlivePeriod / 1000);
+ }
+
+ //data packets
+ void message(AsyncWebSocketMessage *message){ _queueMessage(message); }
+ bool queueIsFull();
+
+ size_t printf(const char *format, ...) __attribute__ ((format (printf, 2, 3)));
+#ifndef ESP32
+ size_t printf_P(PGM_P formatP, ...) __attribute__ ((format (printf, 2, 3)));
+#endif
+ void text(const char * message, size_t len);
+ void text(const char * message);
+ void text(uint8_t * message, size_t len);
+ void text(char * message);
+ void text(const String &message);
+ void text(const __FlashStringHelper *data);
+ void text(AsyncWebSocketMessageBuffer *buffer);
+
+ void binary(const char * message, size_t len);
+ void binary(const char * message);
+ void binary(uint8_t * message, size_t len);
+ void binary(char * message);
+ void binary(const String &message);
+ void binary(const __FlashStringHelper *data, size_t len);
+ void binary(AsyncWebSocketMessageBuffer *buffer);
+
+ bool canSend() { return _messageQueue.length() < WS_MAX_QUEUED_MESSAGES; }
+
+ //system callbacks (do not call)
+ void _onAck(size_t len, uint32_t time);
+ void _onError(int8_t);
+ void _onPoll();
+ void _onTimeout(uint32_t time);
+ void _onDisconnect();
+ void _onData(void *pbuf, size_t plen);
+};
+
+typedef std::function AwsEventHandler;
+
+//WebServer Handler implementation that plays the role of a socket server
+class AsyncWebSocket: public AsyncWebHandler {
+ public:
+ typedef AsyncLinkedList AsyncWebSocketClientAsyncLinkedList;
+ private:
+ String _url;
+ AsyncWebSocketClientAsyncLinkedList _clients;
+ uint32_t _cNextId;
+ AwsEventHandler _eventHandler;
+ bool _enabled;
+ AsyncWebLock _lock;
+
+ public:
+ AsyncWebSocket(const String& url);
+ ~AsyncWebSocket();
+ const char * url() const { return _url.c_str(); }
+ void enable(bool e){ _enabled = e; }
+ bool enabled() const { return _enabled; }
+ bool availableForWriteAll();
+ bool availableForWrite(uint32_t id);
+
+ size_t count() const;
+ AsyncWebSocketClient * client(uint32_t id);
+ bool hasClient(uint32_t id){ return client(id) != NULL; }
+
+ void close(uint32_t id, uint16_t code=0, const char * message=NULL);
+ void closeAll(uint16_t code=0, const char * message=NULL);
+ void cleanupClients(uint16_t maxClients = DEFAULT_MAX_WS_CLIENTS);
+
+ void ping(uint32_t id, uint8_t *data=NULL, size_t len=0);
+ void pingAll(uint8_t *data=NULL, size_t len=0); // done
+
+ void text(uint32_t id, const char * message, size_t len);
+ void text(uint32_t id, const char * message);
+ void text(uint32_t id, uint8_t * message, size_t len);
+ void text(uint32_t id, char * message);
+ void text(uint32_t id, const String &message);
+ void text(uint32_t id, const __FlashStringHelper *message);
+
+ void textAll(const char * message, size_t len);
+ void textAll(const char * message);
+ void textAll(uint8_t * message, size_t len);
+ void textAll(char * message);
+ void textAll(const String &message);
+ void textAll(const __FlashStringHelper *message); // need to convert
+ void textAll(AsyncWebSocketMessageBuffer * buffer);
+
+ void binary(uint32_t id, const char * message, size_t len);
+ void binary(uint32_t id, const char * message);
+ void binary(uint32_t id, uint8_t * message, size_t len);
+ void binary(uint32_t id, char * message);
+ void binary(uint32_t id, const String &message);
+ void binary(uint32_t id, const __FlashStringHelper *message, size_t len);
+
+ void binaryAll(const char * message, size_t len);
+ void binaryAll(const char * message);
+ void binaryAll(uint8_t * message, size_t len);
+ void binaryAll(char * message);
+ void binaryAll(const String &message);
+ void binaryAll(const __FlashStringHelper *message, size_t len);
+ void binaryAll(AsyncWebSocketMessageBuffer * buffer);
+
+ void message(uint32_t id, AsyncWebSocketMessage *message);
+ void messageAll(AsyncWebSocketMultiMessage *message);
+
+ size_t printf(uint32_t id, const char *format, ...) __attribute__ ((format (printf, 3, 4)));
+ size_t printfAll(const char *format, ...) __attribute__ ((format (printf, 2, 3)));
+#ifndef ESP32
+ size_t printf_P(uint32_t id, PGM_P formatP, ...) __attribute__ ((format (printf, 3, 4)));
+#endif
+ size_t printfAll_P(PGM_P formatP, ...) __attribute__ ((format (printf, 2, 3)));
+
+ //event listener
+ void onEvent(AwsEventHandler handler){
+ _eventHandler = handler;
+ }
+
+ //system callbacks (do not call)
+ uint32_t _getNextId(){ return _cNextId++; }
+ void _addClient(AsyncWebSocketClient * client);
+ void _handleDisconnect(AsyncWebSocketClient * client);
+ void _handleEvent(AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len);
+ virtual bool canHandle(AsyncWebServerRequest *request) override final;
+ virtual void handleRequest(AsyncWebServerRequest *request) override final;
+
+
+ // messagebuffer functions/objects.
+ AsyncWebSocketMessageBuffer * makeBuffer(size_t size = 0);
+ AsyncWebSocketMessageBuffer * makeBuffer(uint8_t * data, size_t size);
+ AsyncLinkedList _buffers;
+ void _cleanBuffers();
+
+ AsyncWebSocketClientAsyncLinkedList getClients() const;
+};
+
+//WebServer response to authenticate the socket and detach the tcp client from the web server request
+class AsyncWebSocketResponse: public AsyncWebServerResponse {
+ private:
+ String _content;
+ AsyncWebSocket *_server;
+ public:
+ AsyncWebSocketResponse(const String& key, AsyncWebSocket *server);
+ void _respond(AsyncWebServerRequest *request);
+ size_t _ack(AsyncWebServerRequest *request, size_t len, uint32_t time);
+ bool _sourceValid() const { return true; }
+};
+
+
+#endif /* ASYNCWEBSOCKET_H_ */
diff --git a/lib/libesp32/ESPAsyncWebServer/src/AsyncWebSynchronization.h b/lib/libesp32/ESPAsyncWebServer/src/AsyncWebSynchronization.h
new file mode 100644
index 000000000..f36c52dcf
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/src/AsyncWebSynchronization.h
@@ -0,0 +1,87 @@
+#ifndef ASYNCWEBSYNCHRONIZATION_H_
+#define ASYNCWEBSYNCHRONIZATION_H_
+
+// Synchronisation is only available on ESP32, as the ESP8266 isn't using FreeRTOS by default
+
+#include
+
+#ifdef ESP32
+
+// This is the ESP32 version of the Sync Lock, using the FreeRTOS Semaphore
+class AsyncWebLock
+{
+private:
+ SemaphoreHandle_t _lock;
+ mutable void *_lockedBy;
+
+public:
+ AsyncWebLock() {
+ _lock = xSemaphoreCreateBinary();
+ _lockedBy = NULL;
+ xSemaphoreGive(_lock);
+ }
+
+ ~AsyncWebLock() {
+ vSemaphoreDelete(_lock);
+ }
+
+ bool lock() const {
+ extern void *pxCurrentTCB;
+ if (_lockedBy != pxCurrentTCB) {
+ xSemaphoreTake(_lock, portMAX_DELAY);
+ _lockedBy = pxCurrentTCB;
+ return true;
+ }
+ return false;
+ }
+
+ void unlock() const {
+ _lockedBy = NULL;
+ xSemaphoreGive(_lock);
+ }
+};
+
+#else
+
+// This is the 8266 version of the Sync Lock which is currently unimplemented
+class AsyncWebLock
+{
+
+public:
+ AsyncWebLock() {
+ }
+
+ ~AsyncWebLock() {
+ }
+
+ bool lock() const {
+ return false;
+ }
+
+ void unlock() const {
+ }
+};
+#endif
+
+class AsyncWebLockGuard
+{
+private:
+ const AsyncWebLock *_lock;
+
+public:
+ AsyncWebLockGuard(const AsyncWebLock &l) {
+ if (l.lock()) {
+ _lock = &l;
+ } else {
+ _lock = NULL;
+ }
+ }
+
+ ~AsyncWebLockGuard() {
+ if (_lock) {
+ _lock->unlock();
+ }
+ }
+};
+
+#endif // ASYNCWEBSYNCHRONIZATION_H_
\ No newline at end of file
diff --git a/lib/libesp32/ESPAsyncWebServer/src/ESPAsyncWebServer.h b/lib/libesp32/ESPAsyncWebServer/src/ESPAsyncWebServer.h
new file mode 100644
index 000000000..5f718c35c
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/src/ESPAsyncWebServer.h
@@ -0,0 +1,471 @@
+/*
+ Asynchronous WebServer library for Espressif MCUs
+
+ Copyright (c) 2016 Hristo Gochkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+#ifndef _ESPAsyncWebServer_H_
+#define _ESPAsyncWebServer_H_
+
+#include "Arduino.h"
+
+#include
+#include "FS.h"
+
+#include "StringArray.h"
+
+#ifdef ESP32
+#include
+#include
+#elif defined(ESP8266)
+#include
+#include
+#else
+#error Platform not supported
+#endif
+
+#ifdef ASYNCWEBSERVER_REGEX
+#define ASYNCWEBSERVER_REGEX_ATTRIBUTE
+#else
+#define ASYNCWEBSERVER_REGEX_ATTRIBUTE __attribute__((warning("ASYNCWEBSERVER_REGEX not defined")))
+#endif
+
+#define DEBUGF(...) //Serial.printf(__VA_ARGS__)
+
+class AsyncWebServer;
+class AsyncWebServerRequest;
+class AsyncWebServerResponse;
+class AsyncWebHeader;
+class AsyncWebParameter;
+class AsyncWebRewrite;
+class AsyncWebHandler;
+class AsyncStaticWebHandler;
+class AsyncCallbackWebHandler;
+class AsyncResponseStream;
+
+#ifndef WEBSERVER_H
+typedef enum {
+ HTTP_GET = 0b00000001,
+ HTTP_POST = 0b00000010,
+ HTTP_DELETE = 0b00000100,
+ HTTP_PUT = 0b00001000,
+ HTTP_PATCH = 0b00010000,
+ HTTP_HEAD = 0b00100000,
+ HTTP_OPTIONS = 0b01000000,
+ HTTP_ANY = 0b01111111,
+} WebRequestMethod;
+#endif
+
+//if this value is returned when asked for data, packet will not be sent and you will be asked for data again
+#define RESPONSE_TRY_AGAIN 0xFFFFFFFF
+
+typedef uint8_t WebRequestMethodComposite;
+typedef std::function ArDisconnectHandler;
+
+/*
+ * PARAMETER :: Chainable object to hold GET/POST and FILE parameters
+ * */
+
+class AsyncWebParameter {
+ private:
+ String _name;
+ String _value;
+ size_t _size;
+ bool _isForm;
+ bool _isFile;
+
+ public:
+
+ AsyncWebParameter(const String& name, const String& value, bool form=false, bool file=false, size_t size=0): _name(name), _value(value), _size(size), _isForm(form), _isFile(file){}
+ const String& name() const { return _name; }
+ const String& value() const { return _value; }
+ size_t size() const { return _size; }
+ bool isPost() const { return _isForm; }
+ bool isFile() const { return _isFile; }
+};
+
+/*
+ * HEADER :: Chainable object to hold the headers
+ * */
+
+class AsyncWebHeader {
+ private:
+ String _name;
+ String _value;
+
+ public:
+ AsyncWebHeader(const String& name, const String& value): _name(name), _value(value){}
+ AsyncWebHeader(const String& data): _name(), _value(){
+ if(!data) return;
+ int index = data.indexOf(':');
+ if (index < 0) return;
+ _name = data.substring(0, index);
+ _value = data.substring(index + 2);
+ }
+ ~AsyncWebHeader(){}
+ const String& name() const { return _name; }
+ const String& value() const { return _value; }
+ String toString() const { return String(_name+": "+_value+"\r\n"); }
+};
+
+/*
+ * REQUEST :: Each incoming Client is wrapped inside a Request and both live together until disconnect
+ * */
+
+typedef enum { RCT_NOT_USED = -1, RCT_DEFAULT = 0, RCT_HTTP, RCT_WS, RCT_EVENT, RCT_MAX } RequestedConnectionType;
+
+typedef std::function AwsResponseFiller;
+typedef std::function AwsTemplateProcessor;
+
+class AsyncWebServerRequest {
+ using File = fs::File;
+ using FS = fs::FS;
+ friend class AsyncWebServer;
+ friend class AsyncCallbackWebHandler;
+ private:
+ AsyncClient* _client;
+ AsyncWebServer* _server;
+ AsyncWebHandler* _handler;
+ AsyncWebServerResponse* _response;
+ StringArray _interestingHeaders;
+ ArDisconnectHandler _onDisconnectfn;
+
+ String _temp;
+ uint8_t _parseState;
+
+ uint8_t _version;
+ WebRequestMethodComposite _method;
+ String _url;
+ String _host;
+ String _contentType;
+ String _boundary;
+ String _authorization;
+ RequestedConnectionType _reqconntype;
+ void _removeNotInterestingHeaders();
+ bool _isDigest;
+ bool _isMultipart;
+ bool _isPlainPost;
+ bool _expectingContinue;
+ size_t _contentLength;
+ size_t _parsedLength;
+
+ AsyncLinkedList _headers;
+ AsyncLinkedList _params;
+ AsyncLinkedList _pathParams;
+
+ uint8_t _multiParseState;
+ uint8_t _boundaryPosition;
+ size_t _itemStartIndex;
+ size_t _itemSize;
+ String _itemName;
+ String _itemFilename;
+ String _itemType;
+ String _itemValue;
+ uint8_t *_itemBuffer;
+ size_t _itemBufferIndex;
+ bool _itemIsFile;
+
+ void _onPoll();
+ void _onAck(size_t len, uint32_t time);
+ void _onError(int8_t error);
+ void _onTimeout(uint32_t time);
+ void _onDisconnect();
+ void _onData(void *buf, size_t len);
+
+ void _addParam(AsyncWebParameter*);
+ void _addPathParam(const char *param);
+
+ bool _parseReqHead();
+ bool _parseReqHeader();
+ void _parseLine();
+ void _parsePlainPostChar(uint8_t data);
+ void _parseMultipartPostByte(uint8_t data, bool last);
+ void _addGetParams(const String& params);
+
+ void _handleUploadStart();
+ void _handleUploadByte(uint8_t data, bool last);
+ void _handleUploadEnd();
+
+ public:
+ File _tempFile;
+ void *_tempObject;
+
+ AsyncWebServerRequest(AsyncWebServer*, AsyncClient*);
+ ~AsyncWebServerRequest();
+
+ AsyncClient* client(){ return _client; }
+ uint8_t version() const { return _version; }
+ WebRequestMethodComposite method() const { return _method; }
+ const String& url() const { return _url; }
+ const String& host() const { return _host; }
+ const String& contentType() const { return _contentType; }
+ size_t contentLength() const { return _contentLength; }
+ bool multipart() const { return _isMultipart; }
+ const char * methodToString() const;
+ const char * requestedConnTypeToString() const;
+ RequestedConnectionType requestedConnType() const { return _reqconntype; }
+ bool isExpectedRequestedConnType(RequestedConnectionType erct1, RequestedConnectionType erct2 = RCT_NOT_USED, RequestedConnectionType erct3 = RCT_NOT_USED);
+ void onDisconnect (ArDisconnectHandler fn);
+
+ //hash is the string representation of:
+ // base64(user:pass) for basic or
+ // user:realm:md5(user:realm:pass) for digest
+ bool authenticate(const char * hash);
+ bool authenticate(const char * username, const char * password, const char * realm = NULL, bool passwordIsHash = false);
+ void requestAuthentication(const char * realm = NULL, bool isDigest = true);
+
+ void setHandler(AsyncWebHandler *handler){ _handler = handler; }
+ void addInterestingHeader(const String& name);
+
+ void redirect(const String& url);
+
+ void send(AsyncWebServerResponse *response);
+ void send(int code, const String& contentType=String(), const String& content=String());
+ void send(FS &fs, const String& path, const String& contentType=String(), bool download=false, AwsTemplateProcessor callback=nullptr);
+ void send(File content, const String& path, const String& contentType=String(), bool download=false, AwsTemplateProcessor callback=nullptr);
+ void send(Stream &stream, const String& contentType, size_t len, AwsTemplateProcessor callback=nullptr);
+ void send(const String& contentType, size_t len, AwsResponseFiller callback, AwsTemplateProcessor templateCallback=nullptr);
+ void sendChunked(const String& contentType, AwsResponseFiller callback, AwsTemplateProcessor templateCallback=nullptr);
+ void send_P(int code, const String& contentType, const uint8_t * content, size_t len, AwsTemplateProcessor callback=nullptr);
+ void send_P(int code, const String& contentType, PGM_P content, AwsTemplateProcessor callback=nullptr);
+
+ AsyncWebServerResponse *beginResponse(int code, const String& contentType=String(), const String& content=String());
+ AsyncWebServerResponse *beginResponse(FS &fs, const String& path, const String& contentType=String(), bool download=false, AwsTemplateProcessor callback=nullptr);
+ AsyncWebServerResponse *beginResponse(File content, const String& path, const String& contentType=String(), bool download=false, AwsTemplateProcessor callback=nullptr);
+ AsyncWebServerResponse *beginResponse(Stream &stream, const String& contentType, size_t len, AwsTemplateProcessor callback=nullptr);
+ AsyncWebServerResponse *beginResponse(const String& contentType, size_t len, AwsResponseFiller callback, AwsTemplateProcessor templateCallback=nullptr);
+ AsyncWebServerResponse *beginChunkedResponse(const String& contentType, AwsResponseFiller callback, AwsTemplateProcessor templateCallback=nullptr);
+ AsyncResponseStream *beginResponseStream(const String& contentType, size_t bufferSize=1460);
+ AsyncWebServerResponse *beginResponse_P(int code, const String& contentType, const uint8_t * content, size_t len, AwsTemplateProcessor callback=nullptr);
+ AsyncWebServerResponse *beginResponse_P(int code, const String& contentType, PGM_P content, AwsTemplateProcessor callback=nullptr);
+
+ size_t headers() const; // get header count
+ bool hasHeader(const String& name) const; // check if header exists
+ bool hasHeader(const __FlashStringHelper * data) const; // check if header exists
+
+ AsyncWebHeader* getHeader(const String& name) const;
+ AsyncWebHeader* getHeader(const __FlashStringHelper * data) const;
+ AsyncWebHeader* getHeader(size_t num) const;
+
+ size_t params() const; // get arguments count
+ bool hasParam(const String& name, bool post=false, bool file=false) const;
+ bool hasParam(const __FlashStringHelper * data, bool post=false, bool file=false) const;
+
+ AsyncWebParameter* getParam(const String& name, bool post=false, bool file=false) const;
+ AsyncWebParameter* getParam(const __FlashStringHelper * data, bool post, bool file) const;
+ AsyncWebParameter* getParam(size_t num) const;
+
+ size_t args() const { return params(); } // get arguments count
+ const String& arg(const String& name) const; // get request argument value by name
+ const String& arg(const __FlashStringHelper * data) const; // get request argument value by F(name)
+ const String& arg(size_t i) const; // get request argument value by number
+ const String& argName(size_t i) const; // get request argument name by number
+ bool hasArg(const char* name) const; // check if argument exists
+ bool hasArg(const __FlashStringHelper * data) const; // check if F(argument) exists
+
+ const String& ASYNCWEBSERVER_REGEX_ATTRIBUTE pathArg(size_t i) const;
+
+ const String& header(const char* name) const;// get request header value by name
+ const String& header(const __FlashStringHelper * data) const;// get request header value by F(name)
+ const String& header(size_t i) const; // get request header value by number
+ const String& headerName(size_t i) const; // get request header name by number
+ String urlDecode(const String& text) const;
+};
+
+/*
+ * FILTER :: Callback to filter AsyncWebRewrite and AsyncWebHandler (done by the Server)
+ * */
+
+typedef std::function ArRequestFilterFunction;
+
+bool ON_STA_FILTER(AsyncWebServerRequest *request);
+
+bool ON_AP_FILTER(AsyncWebServerRequest *request);
+
+/*
+ * REWRITE :: One instance can be handle any Request (done by the Server)
+ * */
+
+class AsyncWebRewrite {
+ protected:
+ String _from;
+ String _toUrl;
+ String _params;
+ ArRequestFilterFunction _filter;
+ public:
+ AsyncWebRewrite(const char* from, const char* to): _from(from), _toUrl(to), _params(String()), _filter(NULL){
+ int index = _toUrl.indexOf('?');
+ if (index > 0) {
+ _params = _toUrl.substring(index +1);
+ _toUrl = _toUrl.substring(0, index);
+ }
+ }
+ virtual ~AsyncWebRewrite(){}
+ AsyncWebRewrite& setFilter(ArRequestFilterFunction fn) { _filter = fn; return *this; }
+ bool filter(AsyncWebServerRequest *request) const { return _filter == NULL || _filter(request); }
+ const String& from(void) const { return _from; }
+ const String& toUrl(void) const { return _toUrl; }
+ const String& params(void) const { return _params; }
+ virtual bool match(AsyncWebServerRequest *request) { return from() == request->url() && filter(request); }
+};
+
+/*
+ * HANDLER :: One instance can be attached to any Request (done by the Server)
+ * */
+
+class AsyncWebHandler {
+ protected:
+ ArRequestFilterFunction _filter;
+ String _username;
+ String _password;
+ public:
+ AsyncWebHandler():_username(""), _password(""){}
+ AsyncWebHandler& setFilter(ArRequestFilterFunction fn) { _filter = fn; return *this; }
+ AsyncWebHandler& setAuthentication(const char *username, const char *password){ _username = String(username);_password = String(password); return *this; };
+ bool filter(AsyncWebServerRequest *request){ return _filter == NULL || _filter(request); }
+ virtual ~AsyncWebHandler(){}
+ virtual bool canHandle(AsyncWebServerRequest *request __attribute__((unused))){
+ return false;
+ }
+ virtual void handleRequest(AsyncWebServerRequest *request __attribute__((unused))){}
+ virtual void handleUpload(AsyncWebServerRequest *request __attribute__((unused)), const String& filename __attribute__((unused)), size_t index __attribute__((unused)), uint8_t *data __attribute__((unused)), size_t len __attribute__((unused)), bool final __attribute__((unused))){}
+ virtual void handleBody(AsyncWebServerRequest *request __attribute__((unused)), uint8_t *data __attribute__((unused)), size_t len __attribute__((unused)), size_t index __attribute__((unused)), size_t total __attribute__((unused))){}
+ virtual bool isRequestHandlerTrivial(){return true;}
+};
+
+/*
+ * RESPONSE :: One instance is created for each Request (attached by the Handler)
+ * */
+
+typedef enum {
+ RESPONSE_SETUP, RESPONSE_HEADERS, RESPONSE_CONTENT, RESPONSE_WAIT_ACK, RESPONSE_END, RESPONSE_FAILED
+} WebResponseState;
+
+class AsyncWebServerResponse {
+ protected:
+ int _code;
+ AsyncLinkedList _headers;
+ String _contentType;
+ size_t _contentLength;
+ bool _sendContentLength;
+ bool _chunked;
+ size_t _headLength;
+ size_t _sentLength;
+ size_t _ackedLength;
+ size_t _writtenLength;
+ WebResponseState _state;
+ const char* _responseCodeToString(int code);
+
+ public:
+ AsyncWebServerResponse();
+ virtual ~AsyncWebServerResponse();
+ virtual void setCode(int code);
+ virtual void setContentLength(size_t len);
+ virtual void setContentType(const String& type);
+ virtual void addHeader(const String& name, const String& value);
+ virtual String _assembleHead(uint8_t version);
+ virtual bool _started() const;
+ virtual bool _finished() const;
+ virtual bool _failed() const;
+ virtual bool _sourceValid() const;
+ virtual void _respond(AsyncWebServerRequest *request);
+ virtual size_t _ack(AsyncWebServerRequest *request, size_t len, uint32_t time);
+};
+
+/*
+ * SERVER :: One instance
+ * */
+
+typedef std::function ArRequestHandlerFunction;
+typedef std::function ArUploadHandlerFunction;
+typedef std::function ArBodyHandlerFunction;
+
+class AsyncWebServer {
+ protected:
+ AsyncServer _server;
+ AsyncLinkedList _rewrites;
+ AsyncLinkedList _handlers;
+ AsyncCallbackWebHandler* _catchAllHandler;
+
+ public:
+ AsyncWebServer(uint16_t port);
+ ~AsyncWebServer();
+
+ void begin();
+ void end();
+
+#if ASYNC_TCP_SSL_ENABLED
+ void onSslFileRequest(AcSSlFileHandler cb, void* arg);
+ void beginSecure(const char *cert, const char *private_key_file, const char *password);
+#endif
+
+ AsyncWebRewrite& addRewrite(AsyncWebRewrite* rewrite);
+ bool removeRewrite(AsyncWebRewrite* rewrite);
+ AsyncWebRewrite& rewrite(const char* from, const char* to);
+
+ AsyncWebHandler& addHandler(AsyncWebHandler* handler);
+ bool removeHandler(AsyncWebHandler* handler);
+
+ AsyncCallbackWebHandler& on(const char* uri, ArRequestHandlerFunction onRequest);
+ AsyncCallbackWebHandler& on(const char* uri, WebRequestMethodComposite method, ArRequestHandlerFunction onRequest);
+ AsyncCallbackWebHandler& on(const char* uri, WebRequestMethodComposite method, ArRequestHandlerFunction onRequest, ArUploadHandlerFunction onUpload);
+ AsyncCallbackWebHandler& on(const char* uri, WebRequestMethodComposite method, ArRequestHandlerFunction onRequest, ArUploadHandlerFunction onUpload, ArBodyHandlerFunction onBody);
+
+ AsyncStaticWebHandler& serveStatic(const char* uri, fs::FS& fs, const char* path, const char* cache_control = NULL);
+
+ void onNotFound(ArRequestHandlerFunction fn); //called when handler is not assigned
+ void onFileUpload(ArUploadHandlerFunction fn); //handle file uploads
+ void onRequestBody(ArBodyHandlerFunction fn); //handle posts with plain body content (JSON often transmitted this way as a request)
+
+ void reset(); //remove all writers and handlers, with onNotFound/onFileUpload/onRequestBody
+
+ void _handleDisconnect(AsyncWebServerRequest *request);
+ void _attachHandler(AsyncWebServerRequest *request);
+ void _rewriteRequest(AsyncWebServerRequest *request);
+};
+
+class DefaultHeaders {
+ using headers_t = AsyncLinkedList;
+ headers_t _headers;
+
+ DefaultHeaders()
+ :_headers(headers_t([](AsyncWebHeader *h){ delete h; }))
+ {}
+public:
+ using ConstIterator = headers_t::ConstIterator;
+
+ void addHeader(const String& name, const String& value){
+ _headers.add(new AsyncWebHeader(name, value));
+ }
+
+ ConstIterator begin() const { return _headers.begin(); }
+ ConstIterator end() const { return _headers.end(); }
+
+ DefaultHeaders(DefaultHeaders const &) = delete;
+ DefaultHeaders &operator=(DefaultHeaders const &) = delete;
+ static DefaultHeaders &Instance() {
+ static DefaultHeaders instance;
+ return instance;
+ }
+};
+
+#include "WebResponseImpl.h"
+#include "WebHandlerImpl.h"
+#include "AsyncWebSocket.h"
+#include "AsyncEventSource.h"
+
+#endif /* _AsyncWebServer_H_ */
diff --git a/lib/libesp32/ESPAsyncWebServer/src/SPIFFSEditor.cpp b/lib/libesp32/ESPAsyncWebServer/src/SPIFFSEditor.cpp
new file mode 100644
index 000000000..a84fa87dd
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/src/SPIFFSEditor.cpp
@@ -0,0 +1,544 @@
+#include "SPIFFSEditor.h"
+#include
+
+//File: edit.htm.gz, Size: 4151
+#define edit_htm_gz_len 4151
+const uint8_t edit_htm_gz[] PROGMEM = {
+ 0x1F, 0x8B, 0x08, 0x08, 0xB8, 0x94, 0xB1, 0x59, 0x00, 0x03, 0x65, 0x64, 0x69, 0x74, 0x2E, 0x68,
+ 0x74, 0x6D, 0x00, 0xB5, 0x3A, 0x0B, 0x7B, 0xDA, 0xB8, 0xB2, 0x7F, 0xC5, 0x71, 0xCF, 0x66, 0xED,
+ 0x83, 0x31, 0x90, 0xA4, 0xD9, 0xD6, 0xC4, 0xC9, 0x42, 0x92, 0x36, 0x6D, 0xF3, 0x6A, 0x80, 0xB6,
+ 0x69, 0x4F, 0xEE, 0x7E, 0xC2, 0x16, 0xA0, 0xC6, 0x96, 0x5D, 0x5B, 0x0E, 0x49, 0x59, 0xFE, 0xFB,
+ 0x9D, 0x91, 0x6C, 0xB0, 0x09, 0x69, 0x77, 0xCF, 0xBD, 0xBB, 0xDD, 0x2D, 0x92, 0x46, 0x33, 0x9A,
+ 0x19, 0xCD, 0x53, 0xDE, 0xBD, 0x8D, 0xA3, 0x8B, 0xC3, 0xFE, 0xF5, 0xE5, 0xB1, 0x36, 0x11, 0x61,
+ 0xB0, 0xBF, 0x87, 0x7F, 0x6B, 0x01, 0xE1, 0x63, 0x97, 0xF2, 0xFD, 0x3D, 0xC1, 0x44, 0x40, 0xF7,
+ 0x8F, 0x7B, 0x97, 0xDA, 0xB1, 0xCF, 0x44, 0x94, 0xEC, 0x35, 0xD4, 0xCA, 0x5E, 0x2A, 0x1E, 0x02,
+ 0xAA, 0x85, 0xD4, 0x67, 0xC4, 0x4D, 0xBD, 0x84, 0xC2, 0x66, 0xDB, 0x0B, 0x67, 0xDF, 0xEB, 0x8C,
+ 0xFB, 0xF4, 0xDE, 0xD9, 0x6E, 0x36, 0xDB, 0x71, 0x94, 0x32, 0xC1, 0x22, 0xEE, 0x90, 0x61, 0x1A,
+ 0x05, 0x99, 0xA0, 0xED, 0x80, 0x8E, 0x84, 0xF3, 0x3C, 0xBE, 0x6F, 0x0F, 0xA3, 0xC4, 0xA7, 0x89,
+ 0xD3, 0x8A, 0xEF, 0x35, 0x00, 0x31, 0x5F, 0x7B, 0xB6, 0xB3, 0xB3, 0xD3, 0x1E, 0x12, 0xEF, 0x76,
+ 0x9C, 0x44, 0x19, 0xF7, 0xEB, 0x5E, 0x14, 0x44, 0x89, 0xF3, 0x6C, 0xF4, 0x1C, 0xFF, 0xB4, 0x7D,
+ 0x96, 0xC6, 0x01, 0x79, 0x70, 0x78, 0xC4, 0x29, 0xE0, 0xDE, 0xD7, 0xD3, 0x09, 0xF1, 0xA3, 0xA9,
+ 0xD3, 0xD4, 0x9A, 0x5A, 0xAB, 0x09, 0x44, 0x92, 0xF1, 0x90, 0x18, 0x4D, 0x0B, 0xFF, 0xD8, 0x3B,
+ 0x66, 0x7B, 0x14, 0x71, 0x51, 0x4F, 0xD9, 0x77, 0xEA, 0xB4, 0xB6, 0xE0, 0x34, 0x39, 0x1D, 0x91,
+ 0x90, 0x05, 0x0F, 0x4E, 0x4A, 0x78, 0x5A, 0x4F, 0x69, 0xC2, 0x46, 0x6A, 0x79, 0x4A, 0xD9, 0x78,
+ 0x22, 0x9C, 0xDF, 0x9A, 0xCD, 0x39, 0xF0, 0xAF, 0x65, 0xC1, 0x2C, 0x60, 0x29, 0x20, 0xA3, 0x78,
+ 0xEA, 0x3C, 0x11, 0xC5, 0x4E, 0x53, 0xB1, 0xDE, 0x6C, 0x87, 0x24, 0x19, 0x33, 0x0E, 0x83, 0x98,
+ 0xF8, 0x3E, 0xE3, 0x63, 0x47, 0xA1, 0x05, 0x6C, 0xB6, 0x90, 0x36, 0xA1, 0x01, 0x11, 0xEC, 0x8E,
+ 0xB6, 0x43, 0xC6, 0xEB, 0x53, 0xE6, 0x8B, 0x89, 0xB3, 0x0B, 0x3C, 0xB6, 0xBD, 0x2C, 0x49, 0x41,
+ 0xA6, 0x38, 0x62, 0x5C, 0xD0, 0x44, 0xA2, 0xA5, 0x31, 0xE1, 0xB3, 0x5C, 0x54, 0x54, 0x40, 0x21,
+ 0x27, 0xE3, 0x01, 0xE3, 0xB4, 0x3E, 0x0C, 0x22, 0xEF, 0x76, 0x71, 0xD2, 0x6E, 0x7C, 0x9F, 0x9F,
+ 0xE5, 0x4C, 0xA2, 0x3B, 0x9A, 0xCC, 0x96, 0xEA, 0x92, 0xD8, 0x15, 0x60, 0x85, 0x34, 0xA5, 0x74,
+ 0x6E, 0x8B, 0xBB, 0x0C, 0xA0, 0x96, 0xFC, 0x05, 0x29, 0x17, 0xFC, 0x2F, 0x45, 0x5A, 0x11, 0x5C,
+ 0xA1, 0x30, 0x1E, 0x67, 0x62, 0xF6, 0xF8, 0x2A, 0xA3, 0x98, 0x78, 0x4C, 0x3C, 0xA0, 0xFC, 0xB0,
+ 0x6D, 0x86, 0xBA, 0x04, 0xAC, 0x24, 0x24, 0x81, 0x86, 0x3A, 0xD7, 0x3E, 0xD0, 0xC4, 0x27, 0x9C,
+ 0x58, 0x9D, 0x84, 0x91, 0xC0, 0xEA, 0x2D, 0xB5, 0x5E, 0x0F, 0xA3, 0xEF, 0xF5, 0x0C, 0xC6, 0x30,
+ 0x0F, 0xA8, 0x27, 0x94, 0x92, 0xE1, 0x1E, 0x86, 0xB7, 0x4C, 0x3C, 0x06, 0x3C, 0x5A, 0x28, 0xA9,
+ 0x4B, 0x2A, 0x69, 0xA2, 0x2E, 0xB0, 0x25, 0xD5, 0x83, 0x1C, 0x4B, 0xC9, 0x95, 0x50, 0xF5, 0x61,
+ 0x24, 0x44, 0x14, 0x4A, 0x93, 0x5B, 0x08, 0xAC, 0x49, 0xAB, 0x79, 0xF1, 0xE8, 0x46, 0xD6, 0x6B,
+ 0xBF, 0x44, 0xBE, 0x0D, 0x7A, 0x15, 0xCC, 0x23, 0x41, 0x9D, 0x04, 0x6C, 0xCC, 0x9D, 0x90, 0xF9,
+ 0x7E, 0x40, 0x4B, 0x56, 0xEB, 0x64, 0x49, 0x60, 0xF8, 0x44, 0x10, 0x87, 0x85, 0x64, 0x4C, 0x1B,
+ 0x31, 0x1F, 0x03, 0x34, 0xA5, 0xBB, 0x3B, 0x16, 0xFB, 0xD0, 0xBD, 0xB8, 0x9A, 0x36, 0xDF, 0xBD,
+ 0x1E, 0x47, 0x1D, 0xF8, 0xE7, 0xBC, 0x37, 0x98, 0x1C, 0x0F, 0xC6, 0x30, 0xEA, 0xE2, 0xB4, 0xF3,
+ 0xFE, 0xB0, 0xF3, 0x1E, 0x7E, 0x0E, 0x5B, 0xB5, 0xAF, 0xA3, 0x6F, 0xB8, 0xD0, 0x7D, 0xED, 0x77,
+ 0xFB, 0x83, 0xE3, 0x4E, 0xE7, 0x5D, 0xE3, 0xCD, 0xF9, 0xF4, 0xE3, 0xBB, 0x5D, 0x04, 0x77, 0x83,
+ 0xE6, 0xD5, 0x87, 0x49, 0x73, 0xB0, 0xF5, 0x32, 0xF4, 0x4F, 0xFC, 0x89, 0x17, 0x0E, 0x3A, 0xEF,
+ 0x3F, 0x5E, 0xDD, 0x5D, 0x87, 0x83, 0x71, 0xEF, 0x63, 0x6B, 0xF2, 0x79, 0xEB, 0x43, 0xEF, 0xF3,
+ 0xC7, 0x57, 0xB7, 0xF4, 0xD3, 0xC9, 0xDB, 0xCF, 0xFD, 0x29, 0x20, 0x1C, 0x45, 0xBD, 0xC1, 0x55,
+ 0xF7, 0x43, 0x77, 0xFC, 0xB9, 0xEB, 0x1D, 0xDF, 0x0F, 0x83, 0xF3, 0xEE, 0xEB, 0xCE, 0xB0, 0xB3,
+ 0xE5, 0x51, 0x3A, 0xEE, 0x5F, 0x75, 0xB3, 0x37, 0xEF, 0x2E, 0xC6, 0x8C, 0x4D, 0x7A, 0x9F, 0xCF,
+ 0xFB, 0xDE, 0xE1, 0xF3, 0xD3, 0xC1, 0x49, 0x87, 0x4D, 0xCE, 0xDF, 0x5E, 0x35, 0x6F, 0x5F, 0xBF,
+ 0x3B, 0x3C, 0xF2, 0xAE, 0xDF, 0x5E, 0xEF, 0x1E, 0x6D, 0x37, 0x7E, 0xFB, 0xED, 0xCC, 0xBF, 0x60,
+ 0xBC, 0x7F, 0xF7, 0xBD, 0x33, 0x3E, 0x9C, 0xBE, 0x78, 0x48, 0xFB, 0x93, 0x37, 0x77, 0xBC, 0xF1,
+ 0x21, 0xFA, 0xFA, 0xE6, 0xE1, 0x0C, 0xFE, 0xBB, 0xBC, 0xAC, 0x0D, 0x7B, 0xAD, 0x74, 0xF0, 0xFE,
+ 0xCD, 0x87, 0xAD, 0xF4, 0xE5, 0xF3, 0xB8, 0x7B, 0x74, 0x74, 0x17, 0x0E, 0x2F, 0x1B, 0xA1, 0x7F,
+ 0x3B, 0x12, 0x2F, 0xB6, 0x45, 0x7C, 0x3D, 0xCE, 0x3E, 0x7F, 0x7B, 0xFE, 0x76, 0xD2, 0xB8, 0xA0,
+ 0xE4, 0x7A, 0x52, 0x7B, 0xF8, 0xFE, 0xF0, 0x62, 0xD2, 0x3F, 0xB9, 0x3B, 0x0F, 0xC8, 0xFD, 0xF9,
+ 0xB9, 0xF7, 0x3D, 0xAC, 0x05, 0xE4, 0xE5, 0x45, 0x3F, 0x20, 0x49, 0x6B, 0xE0, 0x77, 0x1A, 0xB5,
+ 0xC3, 0xAD, 0xCE, 0x8E, 0x48, 0xAE, 0x0E, 0xF9, 0xD1, 0xF6, 0xD7, 0xDE, 0x8B, 0x6E, 0xB7, 0x15,
+ 0x0D, 0xBF, 0x6D, 0xBD, 0xBE, 0xDD, 0x7D, 0x3D, 0xD8, 0x7D, 0x3F, 0x7C, 0xDF, 0xE9, 0xED, 0x74,
+ 0x07, 0xE4, 0xBA, 0xF7, 0xBE, 0x33, 0xDA, 0x19, 0x4E, 0x26, 0xEF, 0xDE, 0xF5, 0x5F, 0xF9, 0x9D,
+ 0xEF, 0x49, 0xE7, 0x62, 0xDA, 0xB9, 0x3F, 0x1E, 0x74, 0x4E, 0x6A, 0xEF, 0x8E, 0xCF, 0x9A, 0xAD,
+ 0xDE, 0xF5, 0xF6, 0xF8, 0x6C, 0x77, 0xDA, 0x4D, 0x8F, 0x3B, 0xEF, 0xBB, 0xCD, 0xF1, 0xDB, 0x5A,
+ 0x48, 0x3E, 0x47, 0x87, 0xDB, 0xE3, 0x37, 0xBB, 0xEC, 0xF2, 0x9A, 0x74, 0xDE, 0x74, 0xDF, 0xA6,
+ 0xEC, 0x2A, 0x3C, 0x19, 0x34, 0x3B, 0x9D, 0xD3, 0x0B, 0xFA, 0xEA, 0x70, 0x9B, 0xBC, 0xDB, 0xF2,
+ 0x3E, 0x82, 0xFE, 0x07, 0x9F, 0xE8, 0x6F, 0xB5, 0xCE, 0xF4, 0xA2, 0x19, 0x78, 0x2F, 0x69, 0xFF,
+ 0xE4, 0xBA, 0x2F, 0x6F, 0xE7, 0x38, 0x78, 0xD5, 0xBF, 0xED, 0x65, 0xEF, 0xC3, 0xC3, 0x43, 0x53,
+ 0xE3, 0x51, 0x3D, 0xA1, 0x31, 0x25, 0xA2, 0x1C, 0xAE, 0x16, 0xFE, 0x01, 0xB6, 0xB5, 0xB4, 0xC2,
+ 0xDC, 0x4F, 0x05, 0xBD, 0x17, 0x75, 0x9F, 0x7A, 0x51, 0x42, 0xE4, 0x1E, 0x40, 0xA0, 0x09, 0x9A,
+ 0xD8, 0xFC, 0x77, 0x19, 0x3F, 0x35, 0x15, 0x3F, 0x35, 0xC2, 0x7D, 0xCD, 0x28, 0x1C, 0x01, 0x83,
+ 0x87, 0x4F, 0xEF, 0x98, 0x47, 0xEB, 0x31, 0xBB, 0xA7, 0x41, 0x5D, 0x22, 0x3B, 0x4D, 0x73, 0x26,
+ 0xFD, 0xAD, 0xD8, 0x46, 0x38, 0x98, 0x9A, 0xA4, 0x5A, 0x2C, 0xF8, 0x5F, 0x89, 0x47, 0x21, 0xB0,
+ 0x81, 0xCB, 0x84, 0xF8, 0xAB, 0x7C, 0x27, 0x4A, 0xEA, 0xC3, 0x6C, 0x3C, 0x62, 0xF7, 0xE0, 0xD0,
+ 0x23, 0xC6, 0x99, 0xA0, 0x5A, 0x2B, 0x9D, 0xFF, 0x5E, 0x90, 0xB9, 0xA5, 0x0F, 0xA3, 0x84, 0x84,
+ 0x34, 0xD5, 0xFE, 0x22, 0x99, 0xD9, 0x28, 0x89, 0xC2, 0x65, 0x10, 0x99, 0x8B, 0xA8, 0x34, 0x99,
+ 0xCF, 0x9F, 0x65, 0x71, 0x10, 0x11, 0x10, 0x73, 0x4D, 0xE4, 0x50, 0xF1, 0x34, 0x91, 0x6E, 0xB5,
+ 0x88, 0xAB, 0xB9, 0x9B, 0x6D, 0xA1, 0x5B, 0x96, 0xDD, 0x7A, 0x6B, 0x67, 0xE9, 0xBA, 0x75, 0xB9,
+ 0x17, 0xE3, 0xFD, 0x9A, 0x4C, 0x81, 0xF1, 0xA0, 0x14, 0xEE, 0x9E, 0x09, 0x50, 0xE9, 0x13, 0x87,
+ 0xCB, 0x43, 0xF2, 0xC8, 0xB0, 0x60, 0x40, 0x05, 0xEA, 0x96, 0x8C, 0xD4, 0x85, 0x24, 0xB0, 0x6F,
+ 0xFE, 0x8C, 0xCA, 0xBC, 0x67, 0x3D, 0x8B, 0x13, 0xB8, 0x0D, 0x3A, 0xFD, 0x11, 0xCD, 0x42, 0xA6,
+ 0x2A, 0x6D, 0x45, 0x53, 0x65, 0xBC, 0x5C, 0x84, 0x65, 0xDA, 0x93, 0xBC, 0x16, 0xA4, 0x1F, 0x4B,
+ 0x05, 0xE0, 0x05, 0x37, 0xCF, 0x91, 0x9B, 0x1F, 0x6A, 0x75, 0x7B, 0xF7, 0x97, 0x9C, 0x87, 0x9D,
+ 0xE6, 0x2F, 0x73, 0x3B, 0xDF, 0x5B, 0xA4, 0xE4, 0x56, 0x13, 0xFE, 0x29, 0x32, 0xEF, 0x8B, 0x25,
+ 0x0B, 0xC3, 0xE7, 0xF8, 0xA7, 0x60, 0x10, 0xE9, 0x94, 0x80, 0xDB, 0x3B, 0x2F, 0x5F, 0xF8, 0xC3,
+ 0x02, 0x98, 0x0B, 0xF6, 0x24, 0x3C, 0x21, 0x3E, 0xCB, 0x52, 0xE7, 0x79, 0xF3, 0x97, 0x5C, 0x9F,
+ 0x5B, 0x3B, 0x28, 0xFB, 0xE2, 0x2E, 0x71, 0xB2, 0xB4, 0xD8, 0x34, 0x66, 0x5C, 0xDB, 0x4A, 0x35,
+ 0xBC, 0x6F, 0x92, 0x2C, 0x0C, 0xB3, 0x92, 0xED, 0xE7, 0xBF, 0x2F, 0x4D, 0x13, 0xF7, 0xCF, 0x9A,
+ 0xBF, 0xCC, 0x44, 0x02, 0xD9, 0x64, 0x04, 0xB9, 0xC6, 0x49, 0x22, 0x41, 0x04, 0x35, 0x9A, 0xE6,
+ 0x1C, 0x84, 0x5B, 0x03, 0xD8, 0xDE, 0x6D, 0xFA, 0x74, 0x6C, 0xCE, 0xE7, 0x7B, 0x0D, 0x99, 0xD7,
+ 0xA0, 0x6C, 0xF1, 0x12, 0x16, 0x8B, 0xFD, 0x51, 0xC6, 0x3D, 0xE4, 0x41, 0x1B, 0x53, 0x83, 0x9A,
+ 0xB3, 0x84, 0x8A, 0x2C, 0xE1, 0x9A, 0x1F, 0x79, 0x19, 0x1A, 0xBB, 0x3D, 0xA6, 0xE2, 0x58, 0xD9,
+ 0x7D, 0xF7, 0xE1, 0x8D, 0x0F, 0x3B, 0xE6, 0x0B, 0x04, 0x6F, 0x2D, 0x02, 0x38, 0x30, 0x9C, 0x97,
+ 0xE3, 0x54, 0xF6, 0x43, 0x82, 0x01, 0x22, 0xEF, 0xE8, 0x83, 0x41, 0x2D, 0xB1, 0x40, 0xA4, 0x36,
+ 0xAE, 0x1B, 0xC5, 0x2E, 0x80, 0x71, 0x73, 0x76, 0x07, 0x4A, 0x20, 0x2E, 0xFD, 0x22, 0x6E, 0x2C,
+ 0xE6, 0x72, 0xF8, 0x69, 0xE7, 0xBB, 0xC9, 0x1E, 0x3B, 0xA8, 0xB7, 0x1C, 0xB2, 0xCF, 0x0E, 0x5A,
+ 0xE0, 0x5E, 0x65, 0x6E, 0xE4, 0xB9, 0xAF, 0x58, 0x40, 0x07, 0xB9, 0xC3, 0xE1, 0x31, 0x48, 0x6C,
+ 0xB1, 0x85, 0x28, 0xE2, 0x5B, 0xCD, 0xE6, 0x86, 0x4B, 0x0F, 0x48, 0x00, 0x39, 0xCC, 0xD0, 0x8F,
+ 0xAF, 0xAE, 0x2E, 0xAE, 0xBE, 0xE8, 0x35, 0x5A, 0xD3, 0x6F, 0x1C, 0x4D, 0xAF, 0x71, 0xD3, 0x11,
+ 0x76, 0x42, 0x47, 0x09, 0x4D, 0x27, 0x97, 0x44, 0x4C, 0x8C, 0xD4, 0xBE, 0x23, 0x41, 0x56, 0x16,
+ 0x84, 0xA1, 0xDC, 0xC8, 0xA2, 0x70, 0x39, 0x9D, 0x6A, 0xAF, 0x40, 0xCD, 0x47, 0x90, 0xEA, 0xDA,
+ 0xC2, 0x26, 0x71, 0x4C, 0xB9, 0x6F, 0xE8, 0x31, 0x20, 0xEA, 0x16, 0x35, 0xAD, 0x84, 0x7E, 0xCB,
+ 0x68, 0x2A, 0x52, 0x1B, 0x2C, 0xD7, 0xD0, 0x2F, 0x07, 0x7D, 0xDD, 0xD2, 0x1B, 0xE8, 0x47, 0x3A,
+ 0xF0, 0x46, 0xCC, 0x39, 0x52, 0x89, 0x5C, 0xD0, 0xA4, 0x3E, 0xCC, 0xC0, 0xA0, 0xB8, 0x6E, 0xB6,
+ 0x23, 0x9B, 0x71, 0x4E, 0x93, 0x93, 0xFE, 0xD9, 0xA9, 0xAB, 0x5F, 0x29, 0x46, 0xB4, 0x53, 0x28,
+ 0x48, 0x74, 0x4B, 0x5E, 0x51, 0x7E, 0xC8, 0xE1, 0x84, 0x05, 0xBE, 0x11, 0x99, 0x6D, 0x24, 0xE1,
+ 0x49, 0x12, 0xB2, 0x40, 0x01, 0x0A, 0x9E, 0x2D, 0x1E, 0x62, 0xEA, 0xEA, 0x23, 0x50, 0x86, 0x6E,
+ 0x79, 0x76, 0x98, 0x05, 0x82, 0xC5, 0x01, 0x75, 0x37, 0x5A, 0x30, 0xE3, 0x60, 0x41, 0xAE, 0x8E,
+ 0xB9, 0x19, 0x61, 0xCC, 0x77, 0x75, 0x15, 0xA1, 0xF2, 0xB8, 0xB6, 0xEE, 0x14, 0x4F, 0x9D, 0x92,
+ 0x56, 0x4E, 0x49, 0xCB, 0xB8, 0x4A, 0xE0, 0x34, 0x3F, 0x18, 0xC3, 0x3C, 0xCE, 0xD4, 0x51, 0x05,
+ 0xCC, 0xA7, 0x23, 0x02, 0x9C, 0x7C, 0x40, 0x6D, 0xBA, 0x7A, 0x63, 0xDD, 0x41, 0xA9, 0x3A, 0xC8,
+ 0xAF, 0x6A, 0xC4, 0x2F, 0x6B, 0x44, 0xDD, 0xEE, 0x3A, 0x64, 0x5F, 0x21, 0x07, 0x55, 0xE4, 0xA0,
+ 0x8C, 0x7C, 0x28, 0x8D, 0x64, 0x1D, 0x72, 0xA0, 0x90, 0x93, 0x8A, 0x88, 0x89, 0x14, 0x51, 0x85,
+ 0xBD, 0x3A, 0x6A, 0x13, 0x05, 0xD2, 0xAD, 0xA4, 0x22, 0x66, 0x62, 0x83, 0x97, 0x92, 0x61, 0x40,
+ 0x7D, 0x77, 0xA3, 0x09, 0x33, 0x2C, 0xB6, 0xDD, 0xAD, 0xE6, 0x9A, 0x33, 0x12, 0x75, 0x46, 0x56,
+ 0x65, 0x30, 0x2B, 0x33, 0xA8, 0xF5, 0xC8, 0x1D, 0xD5, 0xD6, 0x31, 0x98, 0x99, 0x56, 0x60, 0x47,
+ 0xDC, 0x0B, 0x98, 0x77, 0xEB, 0x2E, 0xBD, 0xC5, 0x9C, 0xB1, 0x85, 0x85, 0x5A, 0x5C, 0x06, 0xBA,
+ 0x01, 0x94, 0x5E, 0x8B, 0xA5, 0x7C, 0x80, 0xFA, 0x9E, 0x5B, 0xD9, 0x5A, 0x02, 0xDC, 0xA6, 0xF7,
+ 0xD4, 0x3B, 0x8C, 0xC2, 0x90, 0xA0, 0xED, 0xA6, 0xC0, 0x41, 0x3E, 0xD1, 0xCD, 0xB9, 0x15, 0xAD,
+ 0xC5, 0x79, 0xC2, 0x45, 0x2C, 0x7F, 0x3D, 0x8B, 0x23, 0x03, 0x5C, 0xCE, 0xF5, 0x6C, 0xD4, 0x61,
+ 0x6A, 0x83, 0x1E, 0xC7, 0x62, 0xF2, 0x13, 0x17, 0x2A, 0x0C, 0x54, 0xA2, 0x7C, 0x69, 0xDE, 0x58,
+ 0x0B, 0x91, 0x56, 0x7C, 0xEA, 0xA2, 0xB7, 0xE2, 0x54, 0xA8, 0xBC, 0x8A, 0x5D, 0x9A, 0x4B, 0x1D,
+ 0x94, 0x61, 0xB9, 0xBD, 0x2F, 0xA0, 0xFA, 0x7C, 0x0E, 0xE7, 0x01, 0xFF, 0x13, 0x68, 0xF9, 0xE8,
+ 0x5F, 0x17, 0x60, 0xC9, 0xA3, 0x34, 0x78, 0x8B, 0xBB, 0x0D, 0xE3, 0xC0, 0xF9, 0x8F, 0x6D, 0x7C,
+ 0xF9, 0x1F, 0xFB, 0xA6, 0x66, 0x9A, 0x07, 0xFF, 0x6A, 0x48, 0x0D, 0x1B, 0xC2, 0xFC, 0xD2, 0xBA,
+ 0xB1, 0x08, 0x80, 0xED, 0x7F, 0x9B, 0xFF, 0xB1, 0x25, 0xB8, 0x02, 0x6B, 0xDF, 0x45, 0x90, 0x49,
+ 0xF0, 0x24, 0x34, 0xB0, 0x68, 0xA4, 0x91, 0xCD, 0x4D, 0x43, 0xB8, 0xA4, 0x72, 0x8D, 0x35, 0x51,
+ 0xD3, 0x6D, 0x88, 0x53, 0x50, 0x5B, 0xAC, 0x04, 0xBF, 0x3E, 0x24, 0x7A, 0x15, 0x5B, 0x17, 0x00,
+ 0xC9, 0x3D, 0xCA, 0x0C, 0x3D, 0x22, 0x97, 0x52, 0xCB, 0x0C, 0x02, 0x42, 0xA7, 0x89, 0xE7, 0x2A,
+ 0xAD, 0x1D, 0x14, 0x30, 0x17, 0xA2, 0xE0, 0xBC, 0x1C, 0x2D, 0x15, 0xEA, 0xAA, 0xFD, 0x17, 0x0A,
+ 0xA3, 0xD6, 0x12, 0x8A, 0x04, 0x31, 0xAD, 0xD8, 0x79, 0xC6, 0x72, 0x75, 0x4C, 0x59, 0xBA, 0x35,
+ 0x59, 0x5D, 0x96, 0xAD, 0x04, 0xAE, 0x2F, 0x8D, 0xFE, 0xD7, 0x3D, 0x16, 0x8E, 0xB5, 0x12, 0x3F,
+ 0xF8, 0x97, 0xFB, 0x2B, 0x46, 0xE4, 0xCD, 0x3F, 0xBC, 0x21, 0x70, 0x05, 0xA6, 0x41, 0x6D, 0x1E,
+ 0x4D, 0x0D, 0xB3, 0xF6, 0xAB, 0xAE, 0x49, 0x8A, 0xAE, 0x1E, 0x92, 0xFB, 0xBC, 0xA7, 0xC4, 0x8C,
+ 0xD7, 0xD6, 0x70, 0x5E, 0xB4, 0x28, 0xF9, 0x82, 0xEC, 0xE6, 0x48, 0x26, 0xA2, 0xB6, 0x56, 0x64,
+ 0x52, 0xD5, 0xCA, 0xE8, 0x5A, 0x63, 0xFF, 0xD7, 0x4A, 0x40, 0xB7, 0x98, 0xBA, 0x4E, 0x15, 0x8C,
+ 0xB3, 0x00, 0x1C, 0x93, 0x3E, 0x1D, 0x69, 0x03, 0x26, 0x03, 0x75, 0x35, 0x46, 0x5A, 0x81, 0xC1,
+ 0xCC, 0x03, 0xC3, 0x2B, 0xFB, 0xF3, 0x1E, 0x16, 0xBF, 0xFB, 0x97, 0xAA, 0xAA, 0x81, 0xD4, 0x8B,
+ 0x33, 0x5D, 0x59, 0x59, 0xD5, 0x4B, 0xE0, 0xD2, 0x08, 0xA0, 0x5B, 0x8B, 0x3C, 0x3A, 0x8C, 0xFC,
+ 0x87, 0x52, 0xF6, 0x4D, 0xBB, 0x0F, 0x87, 0x01, 0x49, 0xD3, 0x73, 0xB8, 0x01, 0x43, 0xF7, 0x42,
+ 0x50, 0xB8, 0xB2, 0xC2, 0xFD, 0xE6, 0xE6, 0x66, 0x15, 0x29, 0xA1, 0x21, 0x14, 0xDB, 0x8A, 0x2B,
+ 0xF0, 0x49, 0xD3, 0xF1, 0x81, 0x30, 0x18, 0xD2, 0x1A, 0xC6, 0xF0, 0x25, 0xE3, 0x47, 0x5C, 0x71,
+ 0xF4, 0xF4, 0x22, 0xA6, 0xFC, 0x33, 0xDC, 0x95, 0x32, 0xCB, 0x1A, 0xAD, 0xA6, 0x68, 0xFA, 0x8F,
+ 0xD8, 0x3E, 0xCA, 0x0D, 0x76, 0xC1, 0x7A, 0xBA, 0x56, 0xA1, 0xFC, 0x9F, 0x61, 0xB9, 0x94, 0x28,
+ 0xD6, 0x70, 0x9C, 0x40, 0x80, 0x5A, 0xC3, 0x31, 0xC4, 0x1A, 0x41, 0x17, 0xFC, 0x26, 0x6B, 0xF9,
+ 0xCD, 0xFE, 0x19, 0x7E, 0x97, 0x76, 0x1E, 0x15, 0x25, 0x91, 0xAA, 0xAF, 0x50, 0x02, 0x9F, 0xDD,
+ 0xE9, 0xA6, 0x15, 0xB9, 0x55, 0x0A, 0x50, 0x1B, 0x46, 0x41, 0xD0, 0x8F, 0xE2, 0x83, 0x27, 0xD6,
+ 0x9D, 0xC5, 0x7A, 0x31, 0xC8, 0xD9, 0x5C, 0x6E, 0xB1, 0xBC, 0xB5, 0x44, 0x4F, 0xA1, 0xEC, 0x5F,
+ 0x4B, 0x15, 0x01, 0x3F, 0x23, 0x8B, 0x7B, 0xAC, 0xD4, 0xA5, 0x36, 0x28, 0x0F, 0x56, 0x3F, 0xD5,
+ 0x3C, 0xCB, 0x5F, 0xCC, 0xAE, 0x6B, 0x51, 0x9B, 0xC0, 0x38, 0x57, 0x92, 0x8B, 0x4A, 0xB2, 0xC8,
+ 0x13, 0x01, 0xA8, 0x58, 0xC7, 0x2E, 0xC4, 0x4D, 0x6B, 0x7A, 0x7C, 0xBF, 0x5C, 0x83, 0xC2, 0xDF,
+ 0xF5, 0xD5, 0x12, 0x33, 0x08, 0xC4, 0xD3, 0x95, 0x4B, 0x29, 0x5F, 0x37, 0x29, 0x8A, 0x0E, 0x62,
+ 0x47, 0xA3, 0x51, 0x4A, 0xC5, 0x47, 0x0C, 0x49, 0x56, 0xB2, 0x98, 0x9F, 0xC8, 0x90, 0x04, 0x8C,
+ 0x45, 0x3C, 0x8C, 0xB2, 0x94, 0x46, 0x99, 0xA8, 0xA4, 0x16, 0x63, 0x21, 0xCC, 0x5E, 0xFA, 0xE7,
+ 0x9F, 0x8B, 0xC9, 0x7E, 0x5A, 0x0B, 0x96, 0xD3, 0xEB, 0x3D, 0xBF, 0x34, 0xD9, 0xF7, 0x6B, 0x89,
+ 0xB9, 0x7A, 0xE9, 0xFF, 0x67, 0x4B, 0x21, 0x65, 0x4B, 0xF1, 0xB0, 0x54, 0x2E, 0x62, 0x62, 0x29,
+ 0xE6, 0xC9, 0x82, 0x91, 0x97, 0x7C, 0x16, 0x0D, 0x1A, 0x2B, 0x25, 0x55, 0x9E, 0x97, 0x7D, 0x95,
+ 0x43, 0x40, 0x59, 0x71, 0xE5, 0x35, 0x11, 0x06, 0x34, 0xE0, 0x63, 0x64, 0xF2, 0x41, 0xEB, 0xA7,
+ 0xD1, 0x94, 0x26, 0x87, 0x24, 0xA5, 0x06, 0x24, 0xCD, 0x65, 0xDC, 0x41, 0xA8, 0xE9, 0x04, 0xEB,
+ 0x76, 0x6D, 0x6E, 0x12, 0x05, 0xCE, 0x33, 0x77, 0xC4, 0xB1, 0x26, 0x03, 0xF9, 0xB2, 0xCA, 0x09,
+ 0xD4, 0xC6, 0xBE, 0x12, 0xA4, 0x3E, 0x52, 0x25, 0xA8, 0x61, 0x5A, 0xD0, 0x76, 0xC0, 0x35, 0x5F,
+ 0x26, 0x51, 0x4C, 0xC6, 0xB2, 0x07, 0x83, 0x35, 0x74, 0x0F, 0xA4, 0x66, 0x6D, 0x34, 0x91, 0x60,
+ 0xA9, 0x73, 0x29, 0xFC, 0x66, 0xD9, 0xC2, 0x70, 0x4B, 0x57, 0xC9, 0xB0, 0xBD, 0xF4, 0xA5, 0x35,
+ 0x59, 0x83, 0xE0, 0x0B, 0x6C, 0x62, 0xE0, 0x1E, 0x68, 0x64, 0xF2, 0x7B, 0x00, 0x77, 0x6B, 0xB6,
+ 0xA3, 0x3D, 0xD6, 0x8E, 0x6A, 0x35, 0x53, 0x55, 0xE9, 0xAE, 0x0B, 0x6D, 0x4E, 0x74, 0x23, 0x0B,
+ 0x4B, 0x10, 0xAA, 0x9A, 0x59, 0x0C, 0x38, 0x1B, 0x81, 0xAA, 0xBA, 0xC0, 0x11, 0xD6, 0x98, 0x66,
+ 0xA9, 0x23, 0xF1, 0x97, 0x1D, 0xC9, 0x13, 0xB5, 0x07, 0x95, 0xF5, 0x05, 0xD4, 0x31, 0xAB, 0x25,
+ 0x86, 0x30, 0xD3, 0x29, 0x13, 0xDE, 0x04, 0x03, 0x90, 0x07, 0x5A, 0xD5, 0x05, 0x14, 0xB5, 0x8E,
+ 0x1C, 0x4D, 0x44, 0xB8, 0x1C, 0x05, 0xF9, 0xF0, 0x6B, 0x9A, 0x0F, 0xBC, 0xB4, 0x18, 0xDD, 0x97,
+ 0x80, 0x50, 0xD2, 0xE6, 0xE0, 0x88, 0x8F, 0xF2, 0x21, 0xF4, 0xB2, 0x05, 0x9D, 0x02, 0x58, 0xFC,
+ 0xC6, 0x71, 0x3E, 0x8A, 0x27, 0xC5, 0x68, 0x42, 0xEF, 0x17, 0x78, 0x51, 0x01, 0xF5, 0xA9, 0xEE,
+ 0x28, 0x1B, 0xDB, 0x68, 0xCE, 0xF3, 0x41, 0x6B, 0x29, 0x7F, 0xF0, 0xFF, 0x28, 0x7F, 0xCC, 0xC7,
+ 0x85, 0x34, 0x71, 0x31, 0x1A, 0xB3, 0x42, 0x96, 0x61, 0x18, 0xFF, 0x90, 0x93, 0xA4, 0xD4, 0x13,
+ 0x97, 0x7A, 0x5A, 0xF1, 0xB3, 0xB6, 0x53, 0x98, 0x8E, 0x31, 0xAA, 0xF8, 0xE3, 0xC8, 0xF6, 0xF0,
+ 0xF7, 0x3C, 0xF2, 0x65, 0x6D, 0x69, 0x5A, 0xA1, 0x31, 0x82, 0x3A, 0x57, 0x37, 0xCB, 0x7E, 0x9A,
+ 0xFD, 0xB7, 0xAD, 0xE8, 0xD1, 0xF1, 0xE9, 0x71, 0xFF, 0xB8, 0x5C, 0x38, 0x23, 0xE7, 0x25, 0x93,
+ 0x8A, 0x2B, 0x5D, 0xFA, 0xB2, 0x22, 0x80, 0x02, 0x1B, 0x45, 0x01, 0x7B, 0xDD, 0xDC, 0x54, 0x7E,
+ 0xF1, 0xB6, 0x77, 0x71, 0x6E, 0xC7, 0x24, 0x01, 0x8F, 0x24, 0x15, 0xE6, 0xC2, 0x82, 0x44, 0xF9,
+ 0xE0, 0xD7, 0xC7, 0xA5, 0x72, 0x5D, 0x7E, 0x61, 0x70, 0xC4, 0xDC, 0x52, 0xA7, 0xA9, 0x7E, 0x78,
+ 0xE2, 0x62, 0x5D, 0x99, 0xBF, 0x04, 0x41, 0x72, 0x1A, 0x2D, 0x13, 0x55, 0x11, 0x67, 0x46, 0xE5,
+ 0x30, 0x2F, 0xEE, 0xB2, 0x75, 0x0D, 0xD3, 0xC8, 0xB4, 0xC4, 0x84, 0xA5, 0xE5, 0x46, 0xA5, 0x12,
+ 0x14, 0xFE, 0xA2, 0xB6, 0xE7, 0x8B, 0x91, 0x24, 0xB7, 0x5A, 0x73, 0xAB, 0x6F, 0x41, 0x2A, 0x3E,
+ 0x58, 0x04, 0x23, 0x66, 0x39, 0xDB, 0x16, 0x77, 0xA3, 0x43, 0xEE, 0x61, 0x5C, 0x7F, 0xBA, 0x35,
+ 0x78, 0xD2, 0x3C, 0x79, 0x61, 0x9E, 0xFC, 0xB1, 0x7B, 0x2E, 0x1C, 0x45, 0xF9, 0xDA, 0xE2, 0x98,
+ 0xF6, 0x10, 0x58, 0xBB, 0x6D, 0x2F, 0x7D, 0x18, 0x20, 0xD2, 0x83, 0xCB, 0x00, 0xF4, 0x63, 0x58,
+ 0xFF, 0x4A, 0xEE, 0x88, 0x7A, 0x09, 0xAA, 0xA2, 0xAD, 0x73, 0x54, 0xD8, 0xEE, 0xFD, 0x81, 0xA3,
+ 0xF2, 0xCE, 0x65, 0x18, 0x48, 0x97, 0xC3, 0x92, 0x37, 0x8B, 0x75, 0xC1, 0x61, 0x19, 0x31, 0x64,
+ 0x6C, 0x00, 0xE3, 0xCD, 0x5D, 0x49, 0x13, 0xD5, 0x1C, 0xB4, 0xF0, 0x1B, 0x08, 0x8A, 0x4F, 0x39,
+ 0xCE, 0x9A, 0x38, 0xAD, 0x62, 0x72, 0xC5, 0x23, 0xC8, 0x4A, 0x67, 0x89, 0xC0, 0x6E, 0x10, 0x0D,
+ 0x0D, 0x7C, 0x64, 0x9A, 0xA1, 0xB6, 0x1D, 0x3E, 0x37, 0xD7, 0xBC, 0xD9, 0x54, 0xFA, 0x4B, 0x62,
+ 0x79, 0xD5, 0xB0, 0x8B, 0x1C, 0x56, 0xCC, 0x75, 0x7D, 0x1F, 0xF4, 0xA3, 0x4E, 0x29, 0xAF, 0x48,
+ 0xA4, 0x53, 0xD1, 0x83, 0xC4, 0x86, 0xA2, 0x41, 0xBE, 0x91, 0x40, 0x44, 0x72, 0x4A, 0x33, 0x5D,
+ 0xC7, 0xCA, 0xD2, 0x0B, 0x28, 0x49, 0x7A, 0xB2, 0x73, 0x95, 0x49, 0x6B, 0x25, 0x06, 0xFE, 0xC8,
+ 0xD7, 0xF0, 0xC7, 0xA1, 0xD0, 0xA3, 0x83, 0x9B, 0x49, 0x2B, 0x83, 0xA4, 0x23, 0x64, 0x83, 0xA9,
+ 0x37, 0xE4, 0xBB, 0xA8, 0x2D, 0x2F, 0xCB, 0xB4, 0x16, 0x50, 0x70, 0x71, 0x83, 0xBB, 0x11, 0x30,
+ 0x52, 0x5A, 0xC4, 0x9E, 0x94, 0xA8, 0xC7, 0x8F, 0x10, 0x1F, 0x53, 0x4A, 0x20, 0x06, 0x20, 0xA6,
+ 0x40, 0xD0, 0xA7, 0x42, 0x8A, 0x54, 0xE6, 0x92, 0x53, 0x2A, 0x20, 0xCA, 0x48, 0xCD, 0xE2, 0xC1,
+ 0x85, 0x78, 0xD4, 0x46, 0xD6, 0x80, 0xFD, 0xDC, 0xBD, 0x73, 0x33, 0xDE, 0x90, 0x68, 0x09, 0x56,
+ 0x36, 0x3D, 0x9A, 0xA6, 0x52, 0x5C, 0x54, 0xC7, 0x19, 0xF8, 0xA8, 0xA1, 0x03, 0x5A, 0x23, 0x84,
+ 0x11, 0x1E, 0x84, 0x8A, 0x01, 0x40, 0x7F, 0x42, 0xC3, 0x1C, 0x22, 0x70, 0x08, 0x20, 0x82, 0xA0,
+ 0x7F, 0x49, 0x0D, 0xF7, 0x64, 0x05, 0xC9, 0xF8, 0xD8, 0x6D, 0x35, 0xF0, 0x9D, 0x66, 0x95, 0xEC,
+ 0x20, 0xA5, 0xBD, 0x68, 0x24, 0xFA, 0x64, 0x98, 0x1A, 0x50, 0x00, 0xAC, 0xD9, 0x01, 0xA0, 0x1E,
+ 0x24, 0x5E, 0x63, 0x2B, 0x3F, 0xEF, 0x04, 0x2A, 0xBB, 0x00, 0xAB, 0xBB, 0x8E, 0x87, 0x5F, 0x39,
+ 0x4F, 0x19, 0xA7, 0x39, 0x26, 0x00, 0x7B, 0x93, 0x68, 0x7A, 0x99, 0x30, 0x2E, 0xCE, 0x64, 0x1B,
+ 0x6A, 0x6C, 0xB4, 0xE4, 0xF5, 0xA9, 0x87, 0x15, 0x79, 0x3F, 0xC5, 0x8B, 0xCB, 0x0C, 0xF3, 0xBA,
+ 0x53, 0x79, 0x77, 0xB1, 0x86, 0x70, 0x21, 0x50, 0x66, 0x38, 0xB3, 0x29, 0x74, 0xB0, 0xFA, 0xA1,
+ 0x48, 0x82, 0x7A, 0x4F, 0xB7, 0x42, 0xE2, 0xC1, 0x44, 0xED, 0x81, 0xF9, 0xDC, 0xC2, 0xD8, 0xE1,
+ 0x94, 0x83, 0x5A, 0x0A, 0xB5, 0x02, 0x45, 0xC6, 0x95, 0xCD, 0x98, 0x35, 0x1D, 0x6A, 0x58, 0x88,
+ 0x61, 0xE0, 0xAF, 0xFE, 0x05, 0x0F, 0x1E, 0x1C, 0xC8, 0x55, 0x3F, 0xE1, 0x23, 0xE3, 0x7E, 0xF4,
+ 0x23, 0x3E, 0x3E, 0xAF, 0xF0, 0xF1, 0x79, 0x1D, 0x1F, 0xB4, 0xAA, 0x3C, 0x98, 0x0C, 0x80, 0xEC,
+ 0x19, 0xE1, 0x64, 0x4C, 0x13, 0x58, 0xC0, 0x43, 0x50, 0x25, 0x7F, 0x8B, 0xB3, 0x84, 0xFE, 0x98,
+ 0xB3, 0xDE, 0x84, 0x8D, 0xC4, 0x23, 0xFE, 0x8A, 0xD5, 0xFF, 0x82, 0x4B, 0x3C, 0x70, 0x3D, 0x97,
+ 0x79, 0x6D, 0x5A, 0x49, 0x28, 0x3F, 0x7E, 0x2B, 0x91, 0x7E, 0xE4, 0x42, 0x78, 0xA9, 0x38, 0xC8,
+ 0xDF, 0xB7, 0xF4, 0x00, 0xBC, 0x11, 0xF8, 0x29, 0x35, 0x75, 0xBC, 0x0B, 0xA5, 0xFC, 0x29, 0x30,
+ 0x64, 0xA8, 0xC0, 0x47, 0xDD, 0xD9, 0xDC, 0x12, 0xAE, 0x01, 0x8A, 0xF1, 0xA3, 0x29, 0xB0, 0xEA,
+ 0xC9, 0x02, 0xD7, 0x9E, 0x40, 0x26, 0x04, 0x91, 0xE0, 0x48, 0xC8, 0xA7, 0x8D, 0x2F, 0x07, 0x9B,
+ 0x37, 0x35, 0xC8, 0x43, 0x2E, 0xFC, 0x98, 0x2E, 0x0C, 0x36, 0x6F, 0xFE, 0x6D, 0x36, 0xC6, 0xCC,
+ 0x5A, 0x76, 0xA4, 0x96, 0x4C, 0xF6, 0xF4, 0x0B, 0xBF, 0x71, 0x09, 0x48, 0x5D, 0x49, 0x78, 0x45,
+ 0x34, 0x03, 0x6B, 0x43, 0x61, 0xE1, 0x07, 0xFF, 0x47, 0x09, 0xF8, 0x91, 0x9E, 0x07, 0xCE, 0xBD,
+ 0xE6, 0x3D, 0x5E, 0x2F, 0x3E, 0x85, 0xE9, 0x56, 0xE9, 0xC1, 0x4A, 0xC7, 0xEF, 0x53, 0x3A, 0x76,
+ 0x59, 0xA2, 0x14, 0x4A, 0x14, 0x59, 0x88, 0x1A, 0x6A, 0x50, 0x0E, 0x51, 0x98, 0x89, 0x17, 0xCD,
+ 0x81, 0x02, 0x9B, 0x73, 0x34, 0x5B, 0x3A, 0x02, 0x0F, 0xF4, 0xF5, 0x45, 0xEE, 0xFC, 0x74, 0x76,
+ 0x7A, 0x22, 0x44, 0x7C, 0xA5, 0x62, 0x22, 0xD0, 0xAA, 0x2E, 0x2C, 0x2F, 0xCF, 0x9C, 0x89, 0xE4,
+ 0xA1, 0x28, 0x75, 0x30, 0x31, 0x28, 0x87, 0xFE, 0x74, 0x31, 0xFC, 0x0A, 0x71, 0xD6, 0xD0, 0xCF,
+ 0x52, 0x48, 0x58, 0x5B, 0x36, 0xA2, 0xF7, 0xFB, 0x97, 0xF6, 0xAE, 0xDD, 0x84, 0xBA, 0x00, 0xB4,
+ 0x0A, 0x69, 0x19, 0xEE, 0x7D, 0xFE, 0xB7, 0x90, 0xB7, 0xFF, 0x1E, 0x32, 0x83, 0xA8, 0x95, 0x42,
+ 0x58, 0x2A, 0xF0, 0xAB, 0xB8, 0x93, 0x24, 0x9A, 0x4A, 0xB4, 0xE3, 0x24, 0xC1, 0x4B, 0xE9, 0x43,
+ 0x85, 0xA2, 0x0D, 0x61, 0x31, 0xA5, 0x89, 0xE6, 0x47, 0x34, 0xD5, 0x78, 0x24, 0xB4, 0x34, 0x8B,
+ 0x63, 0x68, 0x5C, 0x56, 0xF4, 0x61, 0xEB, 0xC5, 0xEB, 0xCB, 0xFB, 0x8C, 0x66, 0xD4, 0xCF, 0x97,
+ 0x69, 0x52, 0xD1, 0x0B, 0x56, 0x50, 0xDF, 0x10, 0xEE, 0x7E, 0xB9, 0xC9, 0xEB, 0xA9, 0x8C, 0x73,
+ 0x8C, 0xA2, 0x1B, 0x2D, 0x35, 0x07, 0xE9, 0x26, 0x40, 0xD5, 0xE5, 0x59, 0x10, 0xCC, 0xDB, 0x2B,
+ 0xB4, 0xA0, 0xF1, 0x8A, 0x44, 0x24, 0x9F, 0xCB, 0x67, 0x7F, 0xE4, 0xC9, 0xA9, 0xE2, 0x82, 0x50,
+ 0xF2, 0x54, 0xA9, 0x36, 0xAD, 0x0D, 0x63, 0x83, 0x6A, 0x8C, 0xA7, 0x82, 0x70, 0x0F, 0xAF, 0x51,
+ 0xE9, 0xC2, 0x2C, 0x6A, 0x29, 0xDC, 0xDE, 0x46, 0x5F, 0xCB, 0x6D, 0xE9, 0x89, 0x7C, 0x2A, 0x25,
+ 0xE3, 0xAE, 0xAE, 0x63, 0x55, 0x45, 0xB1, 0x3E, 0x25, 0x61, 0x5A, 0x26, 0x5B, 0x54, 0x06, 0x26,
+ 0x77, 0x0B, 0x70, 0x9B, 0x06, 0x29, 0x1C, 0xBD, 0x7E, 0x7F, 0xCE, 0x46, 0xD1, 0xCE, 0x11, 0x80,
+ 0x69, 0xC5, 0x3E, 0x93, 0xD7, 0xE0, 0x24, 0xCC, 0x73, 0x07, 0x32, 0xE9, 0x4A, 0x03, 0x0E, 0xA9,
+ 0x98, 0x44, 0xFE, 0x81, 0x7E, 0xA0, 0x3B, 0x3A, 0xFC, 0xBB, 0x09, 0x35, 0x47, 0xCD, 0xA5, 0xD0,
+ 0xA4, 0xFA, 0x74, 0x70, 0xF5, 0x06, 0xC2, 0x53, 0x0C, 0xA5, 0x01, 0x17, 0x50, 0x34, 0xD7, 0x74,
+ 0x7C, 0x7A, 0x7D, 0x0C, 0x29, 0xC8, 0x7F, 0x21, 0x37, 0x66, 0xBB, 0xAA, 0x6C, 0xB8, 0xF3, 0xEA,
+ 0x75, 0x56, 0x2E, 0x03, 0x7A, 0x61, 0x8C, 0x58, 0x0F, 0x29, 0x7E, 0xFB, 0x7B, 0xF4, 0x9E, 0x8D,
+ 0x15, 0xD2, 0x6A, 0x5D, 0x6F, 0xCE, 0x76, 0x90, 0x67, 0x89, 0xD5, 0x43, 0x2C, 0x70, 0x97, 0x1F,
+ 0x29, 0x59, 0x95, 0x35, 0xDC, 0xF6, 0x48, 0x10, 0xE0, 0xC7, 0x5A, 0x03, 0x1B, 0x6A, 0x22, 0xB2,
+ 0xD4, 0x42, 0x22, 0x29, 0x08, 0x90, 0xD2, 0x3E, 0x84, 0x39, 0xD3, 0x92, 0x65, 0x86, 0xB2, 0xA1,
+ 0xBC, 0xFF, 0xC5, 0x9A, 0xA3, 0x64, 0x46, 0xE8, 0xCE, 0xF9, 0x6C, 0x73, 0x53, 0xD8, 0x85, 0x99,
+ 0x18, 0x05, 0x52, 0x8A, 0x01, 0x1C, 0x9A, 0x7D, 0x68, 0x2D, 0x8C, 0xB2, 0x90, 0x58, 0xAB, 0x3D,
+ 0xD2, 0xB6, 0x51, 0x55, 0x03, 0x54, 0x7C, 0x46, 0x01, 0x03, 0xCE, 0xB2, 0x24, 0x80, 0xA8, 0x8B,
+ 0x39, 0xBA, 0xB2, 0x2D, 0xC5, 0xBA, 0xD0, 0x84, 0x0E, 0xEC, 0x67, 0xC8, 0x12, 0x95, 0x97, 0xAD,
+ 0xA2, 0x27, 0x12, 0xC5, 0x77, 0x95, 0x9E, 0xC8, 0x6F, 0xE5, 0x84, 0xAA, 0xC8, 0x77, 0x88, 0x2F,
+ 0x13, 0x5C, 0xD4, 0xD1, 0x13, 0xA0, 0x24, 0x83, 0x52, 0x34, 0x60, 0x2A, 0x2C, 0x37, 0xEE, 0xEB,
+ 0xD3, 0xE9, 0xB4, 0x8E, 0xDF, 0x6A, 0xEB, 0x70, 0x82, 0xB2, 0x02, 0x5F, 0x5F, 0xC7, 0x21, 0x47,
+ 0x15, 0x58, 0xF8, 0x6E, 0xE1, 0xAC, 0xBA, 0xE8, 0x42, 0x7F, 0x2B, 0xDE, 0xD4, 0xAA, 0xD2, 0x59,
+ 0xE1, 0x73, 0x79, 0xDB, 0x7B, 0x3B, 0x2B, 0x20, 0x32, 0xC4, 0xAF, 0xB2, 0x90, 0x69, 0x20, 0x0D,
+ 0x3B, 0xE5, 0x46, 0x56, 0x25, 0x85, 0x65, 0x5C, 0xB0, 0xE3, 0x2C, 0x9D, 0x18, 0x33, 0x60, 0xDD,
+ 0x11, 0x96, 0xD2, 0x95, 0x43, 0x2D, 0x65, 0xB7, 0x0E, 0xB7, 0x0A, 0xFB, 0x70, 0x30, 0x83, 0x94,
+ 0x79, 0xFB, 0xF3, 0x4F, 0x39, 0x5B, 0xDE, 0xF6, 0x92, 0x62, 0x71, 0xE1, 0xF3, 0xFC, 0xA9, 0x35,
+ 0xAF, 0x69, 0xA5, 0xD1, 0xAF, 0xC4, 0x97, 0xBD, 0x46, 0xFE, 0x19, 0x3B, 0xFF, 0x9C, 0xAD, 0x81,
+ 0xB1, 0x43, 0x23, 0x2A, 0xDC, 0x4C, 0x8C, 0xEA, 0x2F, 0x34, 0xE6, 0x63, 0x79, 0x29, 0xBF, 0x2D,
+ 0xA0, 0x54, 0xA9, 0xD3, 0x68, 0x78, 0x3E, 0xFF, 0x9A, 0x42, 0x19, 0x1D, 0x65, 0xFE, 0x28, 0x20,
+ 0x09, 0xC5, 0x82, 0xA3, 0x41, 0xBE, 0x92, 0xFB, 0x46, 0xC0, 0x86, 0x69, 0x03, 0x93, 0x6D, 0xCB,
+ 0xDE, 0xB2, 0x77, 0x71, 0x64, 0x7F, 0x4D, 0xF7, 0x57, 0x4F, 0xD8, 0x5F, 0x34, 0x69, 0x58, 0x0B,
+ 0xE7, 0xB5, 0xAB, 0x8A, 0x4D, 0x6A, 0x83, 0xFB, 0xC4, 0xA7, 0x70, 0x3D, 0x6F, 0xB3, 0xCC, 0xB6,
+ 0x1A, 0xE4, 0x5F, 0x60, 0xD4, 0x31, 0xBA, 0x95, 0x2F, 0x92, 0xF4, 0x81, 0x7B, 0x18, 0x5B, 0x17,
+ 0x54, 0x26, 0x70, 0x49, 0xD5, 0x87, 0x34, 0xB9, 0xD3, 0x9C, 0x2F, 0x39, 0xC3, 0xB7, 0x3C, 0xA8,
+ 0x03, 0xE4, 0x37, 0x9C, 0x72, 0x39, 0xB0, 0xBF, 0x07, 0x5D, 0x33, 0x2A, 0x41, 0x79, 0xB1, 0x26,
+ 0x9B, 0xE6, 0x7C, 0x02, 0x82, 0x01, 0x70, 0xB1, 0xA3, 0x48, 0xCD, 0x2B, 0xCB, 0x98, 0x9B, 0x57,
+ 0x96, 0x54, 0xE2, 0x5F, 0x59, 0xCC, 0xDB, 0x9F, 0xFC, 0xDB, 0x4C, 0xF9, 0x7F, 0x5B, 0x28, 0x36,
+ 0x32, 0xF9, 0xE1, 0x09, 0xF7, 0x56, 0x3F, 0x45, 0xAD, 0x47, 0x51, 0xBB, 0xF7, 0xFF, 0x17, 0x53,
+ 0xE8, 0x9D, 0x36, 0x92, 0x29, 0x00, 0x00
+};
+
+#define SPIFFS_MAXLENGTH_FILEPATH 32
+const char *excludeListFile = "/.exclude.files";
+
+typedef struct ExcludeListS {
+ char *item;
+ ExcludeListS *next;
+} ExcludeList;
+
+static ExcludeList *excludes = NULL;
+
+static bool matchWild(const char *pattern, const char *testee) {
+ const char *nxPat = NULL, *nxTst = NULL;
+
+ while (*testee) {
+ if (( *pattern == '?' ) || (*pattern == *testee)){
+ pattern++;testee++;
+ continue;
+ }
+ if (*pattern=='*'){
+ nxPat=pattern++; nxTst=testee;
+ continue;
+ }
+ if (nxPat){
+ pattern = nxPat+1; testee=++nxTst;
+ continue;
+ }
+ return false;
+ }
+ while (*pattern=='*'){pattern++;}
+ return (*pattern == 0);
+}
+
+static bool addExclude(const char *item){
+ size_t len = strlen(item);
+ if(!len){
+ return false;
+ }
+ ExcludeList *e = (ExcludeList *)malloc(sizeof(ExcludeList));
+ if(!e){
+ return false;
+ }
+ e->item = (char *)malloc(len+1);
+ if(!e->item){
+ free(e);
+ return false;
+ }
+ memcpy(e->item, item, len+1);
+ e->next = excludes;
+ excludes = e;
+ return true;
+}
+
+static void loadExcludeList(fs::FS &_fs, const char *filename){
+ static char linebuf[SPIFFS_MAXLENGTH_FILEPATH];
+ fs::File excludeFile=_fs.open(filename, "r");
+ if(!excludeFile){
+ //addExclude("/*.js.gz");
+ return;
+ }
+#ifdef ESP32
+ if(excludeFile.isDirectory()){
+ excludeFile.close();
+ return;
+ }
+#endif
+ if (excludeFile.size() > 0){
+ uint8_t idx;
+ bool isOverflowed = false;
+ while (excludeFile.available()){
+ linebuf[0] = '\0';
+ idx = 0;
+ int lastChar;
+ do {
+ lastChar = excludeFile.read();
+ if(lastChar != '\r'){
+ linebuf[idx++] = (char) lastChar;
+ }
+ } while ((lastChar >= 0) && (lastChar != '\n') && (idx < SPIFFS_MAXLENGTH_FILEPATH));
+
+ if(isOverflowed){
+ isOverflowed = (lastChar != '\n');
+ continue;
+ }
+ isOverflowed = (idx >= SPIFFS_MAXLENGTH_FILEPATH);
+ linebuf[idx-1] = '\0';
+ if(!addExclude(linebuf)){
+ excludeFile.close();
+ return;
+ }
+ }
+ }
+ excludeFile.close();
+}
+
+static bool isExcluded(fs::FS &_fs, const char *filename) {
+ if(excludes == NULL){
+ loadExcludeList(_fs, excludeListFile);
+ }
+ ExcludeList *e = excludes;
+ while(e){
+ if (matchWild(e->item, filename)){
+ return true;
+ }
+ e = e->next;
+ }
+ return false;
+}
+
+// WEB HANDLER IMPLEMENTATION
+
+#ifdef ESP32
+SPIFFSEditor::SPIFFSEditor(const fs::FS& fs, const String& username, const String& password)
+#else
+SPIFFSEditor::SPIFFSEditor(const String& username, const String& password, const fs::FS& fs)
+#endif
+:_fs(fs)
+,_username(username)
+,_password(password)
+,_authenticated(false)
+,_startTime(0)
+{}
+
+bool SPIFFSEditor::canHandle(AsyncWebServerRequest *request){
+ if(request->url().equalsIgnoreCase("/edit")){
+ if(request->method() == HTTP_GET){
+ if(request->hasParam("list"))
+ return true;
+ if(request->hasParam("edit")){
+ request->_tempFile = _fs.open(request->arg("edit"), "r");
+ if(!request->_tempFile){
+ return false;
+ }
+#ifdef ESP32
+ if(request->_tempFile.isDirectory()){
+ request->_tempFile.close();
+ return false;
+ }
+#endif
+ }
+ if(request->hasParam("download")){
+ request->_tempFile = _fs.open(request->arg("download"), "r");
+ if(!request->_tempFile){
+ return false;
+ }
+#ifdef ESP32
+ if(request->_tempFile.isDirectory()){
+ request->_tempFile.close();
+ return false;
+ }
+#endif
+ }
+ request->addInterestingHeader("If-Modified-Since");
+ return true;
+ }
+ else if(request->method() == HTTP_POST)
+ return true;
+ else if(request->method() == HTTP_DELETE)
+ return true;
+ else if(request->method() == HTTP_PUT)
+ return true;
+
+ }
+ return false;
+}
+
+
+void SPIFFSEditor::handleRequest(AsyncWebServerRequest *request){
+ if(_username.length() && _password.length() && !request->authenticate(_username.c_str(), _password.c_str()))
+ return request->requestAuthentication();
+
+ if(request->method() == HTTP_GET){
+ if(request->hasParam("list")){
+ String path = request->getParam("list")->value();
+#ifdef ESP32
+ File dir = _fs.open(path);
+#else
+ Dir dir = _fs.openDir(path);
+#endif
+ path = String();
+ String output = "[";
+#ifdef ESP32
+ File entry = dir.openNextFile();
+ while(entry){
+#else
+ while(dir.next()){
+ fs::File entry = dir.openFile("r");
+#endif
+ if (isExcluded(_fs, entry.name())) {
+#ifdef ESP32
+ entry = dir.openNextFile();
+#endif
+ continue;
+ }
+ if (output != "[") output += ',';
+ output += "{\"type\":\"";
+ output += "file";
+ output += "\",\"name\":\"";
+ output += String(entry.name());
+ output += "\",\"size\":";
+ output += String(entry.size());
+ output += "}";
+#ifdef ESP32
+ entry = dir.openNextFile();
+#else
+ entry.close();
+#endif
+ }
+#ifdef ESP32
+ dir.close();
+#endif
+ output += "]";
+ request->send(200, "application/json", output);
+ output = String();
+ }
+ else if(request->hasParam("edit") || request->hasParam("download")){
+ request->send(request->_tempFile, request->_tempFile.name(), String(), request->hasParam("download"));
+ }
+ else {
+ const char * buildTime = __DATE__ " " __TIME__ " GMT";
+ if (request->header("If-Modified-Since").equals(buildTime)) {
+ request->send(304);
+ } else {
+ AsyncWebServerResponse *response = request->beginResponse_P(200, "text/html", edit_htm_gz, edit_htm_gz_len);
+ response->addHeader("Content-Encoding", "gzip");
+ response->addHeader("Last-Modified", buildTime);
+ request->send(response);
+ }
+ }
+ } else if(request->method() == HTTP_DELETE){
+ if(request->hasParam("path", true)){
+ _fs.remove(request->getParam("path", true)->value());
+ request->send(200, "", "DELETE: "+request->getParam("path", true)->value());
+ } else
+ request->send(404);
+ } else if(request->method() == HTTP_POST){
+ if(request->hasParam("data", true, true) && _fs.exists(request->getParam("data", true, true)->value()))
+ request->send(200, "", "UPLOADED: "+request->getParam("data", true, true)->value());
+ else
+ request->send(500);
+ } else if(request->method() == HTTP_PUT){
+ if(request->hasParam("path", true)){
+ String filename = request->getParam("path", true)->value();
+ if(_fs.exists(filename)){
+ request->send(200);
+ } else {
+ fs::File f = _fs.open(filename, "w");
+ if(f){
+ f.write((uint8_t)0x00);
+ f.close();
+ request->send(200, "", "CREATE: "+filename);
+ } else {
+ request->send(500);
+ }
+ }
+ } else
+ request->send(400);
+ }
+}
+
+void SPIFFSEditor::handleUpload(AsyncWebServerRequest *request, const String& filename, size_t index, uint8_t *data, size_t len, bool final){
+ if(!index){
+ if(!_username.length() || request->authenticate(_username.c_str(),_password.c_str())){
+ _authenticated = true;
+ request->_tempFile = _fs.open(filename, "w");
+ _startTime = millis();
+ }
+ }
+ if(_authenticated && request->_tempFile){
+ if(len){
+ request->_tempFile.write(data,len);
+ }
+ if(final){
+ request->_tempFile.close();
+ }
+ }
+}
diff --git a/lib/libesp32/ESPAsyncWebServer/src/SPIFFSEditor.h b/lib/libesp32/ESPAsyncWebServer/src/SPIFFSEditor.h
new file mode 100644
index 000000000..3586429e1
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/src/SPIFFSEditor.h
@@ -0,0 +1,24 @@
+#ifndef SPIFFSEditor_H_
+#define SPIFFSEditor_H_
+#include
+
+class SPIFFSEditor: public AsyncWebHandler {
+ private:
+ fs::FS _fs;
+ String _username;
+ String _password;
+ bool _authenticated;
+ uint32_t _startTime;
+ public:
+#ifdef ESP32
+ SPIFFSEditor(const fs::FS& fs, const String& username=String(), const String& password=String());
+#else
+ SPIFFSEditor(const String& username=String(), const String& password=String(), const fs::FS& fs=SPIFFS);
+#endif
+ virtual bool canHandle(AsyncWebServerRequest *request) override final;
+ virtual void handleRequest(AsyncWebServerRequest *request) override final;
+ virtual void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t index, uint8_t *data, size_t len, bool final) override final;
+ virtual bool isRequestHandlerTrivial() override final {return false;}
+};
+
+#endif
diff --git a/lib/libesp32/ESPAsyncWebServer/src/StringArray.h b/lib/libesp32/ESPAsyncWebServer/src/StringArray.h
new file mode 100644
index 000000000..801643967
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/src/StringArray.h
@@ -0,0 +1,193 @@
+/*
+ Asynchronous WebServer library for Espressif MCUs
+
+ Copyright (c) 2016 Hristo Gochkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+#ifndef STRINGARRAY_H_
+#define STRINGARRAY_H_
+
+#include "stddef.h"
+#include "WString.h"
+
+template
+class AsyncLinkedListNode {
+ T _value;
+ public:
+ AsyncLinkedListNode* next;
+ AsyncLinkedListNode(const T val): _value(val), next(nullptr) {}
+ ~AsyncLinkedListNode(){}
+ const T& value() const { return _value; };
+ T& value(){ return _value; }
+};
+
+template class Item = AsyncLinkedListNode>
+class AsyncLinkedList {
+ public:
+ typedef Item ItemType;
+ typedef std::function OnRemove;
+ typedef std::function Predicate;
+ private:
+ ItemType* _root;
+ OnRemove _onRemove;
+
+ class Iterator {
+ ItemType* _node;
+ public:
+ Iterator(ItemType* current = nullptr) : _node(current) {}
+ Iterator(const Iterator& i) : _node(i._node) {}
+ Iterator& operator ++() { _node = _node->next; return *this; }
+ bool operator != (const Iterator& i) const { return _node != i._node; }
+ const T& operator * () const { return _node->value(); }
+ const T* operator -> () const { return &_node->value(); }
+ };
+
+ public:
+ typedef const Iterator ConstIterator;
+ ConstIterator begin() const { return ConstIterator(_root); }
+ ConstIterator end() const { return ConstIterator(nullptr); }
+
+ AsyncLinkedList(OnRemove onRemove) : _root(nullptr), _onRemove(onRemove) {}
+ ~AsyncLinkedList(){}
+ void add(const T& t){
+ auto it = new ItemType(t);
+ if(!_root){
+ _root = it;
+ } else {
+ auto i = _root;
+ while(i->next) i = i->next;
+ i->next = it;
+ }
+ }
+ T& front() const {
+ return _root->value();
+ }
+
+ bool isEmpty() const {
+ return _root == nullptr;
+ }
+ size_t length() const {
+ size_t i = 0;
+ auto it = _root;
+ while(it){
+ i++;
+ it = it->next;
+ }
+ return i;
+ }
+ size_t count_if(Predicate predicate) const {
+ size_t i = 0;
+ auto it = _root;
+ while(it){
+ if (!predicate){
+ i++;
+ }
+ else if (predicate(it->value())) {
+ i++;
+ }
+ it = it->next;
+ }
+ return i;
+ }
+ const T* nth(size_t N) const {
+ size_t i = 0;
+ auto it = _root;
+ while(it){
+ if(i++ == N)
+ return &(it->value());
+ it = it->next;
+ }
+ return nullptr;
+ }
+ bool remove(const T& t){
+ auto it = _root;
+ auto pit = _root;
+ while(it){
+ if(it->value() == t){
+ if(it == _root){
+ _root = _root->next;
+ } else {
+ pit->next = it->next;
+ }
+
+ if (_onRemove) {
+ _onRemove(it->value());
+ }
+
+ delete it;
+ return true;
+ }
+ pit = it;
+ it = it->next;
+ }
+ return false;
+ }
+ bool remove_first(Predicate predicate){
+ auto it = _root;
+ auto pit = _root;
+ while(it){
+ if(predicate(it->value())){
+ if(it == _root){
+ _root = _root->next;
+ } else {
+ pit->next = it->next;
+ }
+ if (_onRemove) {
+ _onRemove(it->value());
+ }
+ delete it;
+ return true;
+ }
+ pit = it;
+ it = it->next;
+ }
+ return false;
+ }
+
+ void free(){
+ while(_root != nullptr){
+ auto it = _root;
+ _root = _root->next;
+ if (_onRemove) {
+ _onRemove(it->value());
+ }
+ delete it;
+ }
+ _root = nullptr;
+ }
+};
+
+
+class StringArray : public AsyncLinkedList {
+public:
+
+ StringArray() : AsyncLinkedList(nullptr) {}
+
+ bool containsIgnoreCase(const String& str){
+ for (const auto& s : *this) {
+ if (str.equalsIgnoreCase(s)) {
+ return true;
+ }
+ }
+ return false;
+ }
+};
+
+
+
+
+#endif /* STRINGARRAY_H_ */
diff --git a/lib/libesp32/ESPAsyncWebServer/src/WebAuthentication.cpp b/lib/libesp32/ESPAsyncWebServer/src/WebAuthentication.cpp
new file mode 100644
index 000000000..45246a196
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/src/WebAuthentication.cpp
@@ -0,0 +1,235 @@
+/*
+ Asynchronous WebServer library for Espressif MCUs
+
+ Copyright (c) 2016 Hristo Gochkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+#include "WebAuthentication.h"
+#include
+#ifdef ESP32
+#include "mbedtls/md5.h"
+#else
+#include "md5.h"
+#endif
+
+
+// Basic Auth hash = base64("username:password")
+
+bool checkBasicAuthentication(const char * hash, const char * username, const char * password){
+ if(username == NULL || password == NULL || hash == NULL)
+ return false;
+
+ size_t toencodeLen = strlen(username)+strlen(password)+1;
+ size_t encodedLen = base64_encode_expected_len(toencodeLen);
+ if(strlen(hash) != encodedLen)
+ return false;
+
+ char *toencode = new char[toencodeLen+1];
+ if(toencode == NULL){
+ return false;
+ }
+ char *encoded = new char[base64_encode_expected_len(toencodeLen)+1];
+ if(encoded == NULL){
+ delete[] toencode;
+ return false;
+ }
+ sprintf(toencode, "%s:%s", username, password);
+ if(base64_encode_chars(toencode, toencodeLen, encoded) > 0 && memcmp(hash, encoded, encodedLen) == 0){
+ delete[] toencode;
+ delete[] encoded;
+ return true;
+ }
+ delete[] toencode;
+ delete[] encoded;
+ return false;
+}
+
+static bool getMD5(uint8_t * data, uint16_t len, char * output){//33 bytes or more
+#ifdef ESP32
+ mbedtls_md5_context _ctx;
+#else
+ md5_context_t _ctx;
+#endif
+ uint8_t i;
+ uint8_t * _buf = (uint8_t*)malloc(16);
+ if(_buf == NULL)
+ return false;
+ memset(_buf, 0x00, 16);
+#ifdef ESP32
+ mbedtls_md5_init(&_ctx);
+ mbedtls_md5_starts_ret(&_ctx);
+ mbedtls_md5_update_ret(&_ctx, data, len);
+ mbedtls_md5_finish_ret(&_ctx, _buf);
+#else
+ MD5Init(&_ctx);
+ MD5Update(&_ctx, data, len);
+ MD5Final(_buf, &_ctx);
+#endif
+ for(i = 0; i < 16; i++) {
+ sprintf(output + (i * 2), "%02x", _buf[i]);
+ }
+ free(_buf);
+ return true;
+}
+
+static String genRandomMD5(){
+#ifdef ESP8266
+ uint32_t r = RANDOM_REG32;
+#else
+ uint32_t r = rand();
+#endif
+ char * out = (char*)malloc(33);
+ if(out == NULL || !getMD5((uint8_t*)(&r), 4, out))
+ return "";
+ String res = String(out);
+ free(out);
+ return res;
+}
+
+static String stringMD5(const String& in){
+ char * out = (char*)malloc(33);
+ if(out == NULL || !getMD5((uint8_t*)(in.c_str()), in.length(), out))
+ return "";
+ String res = String(out);
+ free(out);
+ return res;
+}
+
+String generateDigestHash(const char * username, const char * password, const char * realm){
+ if(username == NULL || password == NULL || realm == NULL){
+ return "";
+ }
+ char * out = (char*)malloc(33);
+ String res = String(username);
+ res.concat(":");
+ res.concat(realm);
+ res.concat(":");
+ String in = res;
+ in.concat(password);
+ if(out == NULL || !getMD5((uint8_t*)(in.c_str()), in.length(), out))
+ return "";
+ res.concat(out);
+ free(out);
+ return res;
+}
+
+String requestDigestAuthentication(const char * realm){
+ String header = "realm=\"";
+ if(realm == NULL)
+ header.concat("asyncesp");
+ else
+ header.concat(realm);
+ header.concat( "\", qop=\"auth\", nonce=\"");
+ header.concat(genRandomMD5());
+ header.concat("\", opaque=\"");
+ header.concat(genRandomMD5());
+ header.concat("\"");
+ return header;
+}
+
+bool checkDigestAuthentication(const char * header, const char * method, const char * username, const char * password, const char * realm, bool passwordIsHash, const char * nonce, const char * opaque, const char * uri){
+ if(username == NULL || password == NULL || header == NULL || method == NULL){
+ //os_printf("AUTH FAIL: missing requred fields\n");
+ return false;
+ }
+
+ String myHeader = String(header);
+ int nextBreak = myHeader.indexOf(",");
+ if(nextBreak < 0){
+ //os_printf("AUTH FAIL: no variables\n");
+ return false;
+ }
+
+ String myUsername = String();
+ String myRealm = String();
+ String myNonce = String();
+ String myUri = String();
+ String myResponse = String();
+ String myQop = String();
+ String myNc = String();
+ String myCnonce = String();
+
+ myHeader += ", ";
+ do {
+ String avLine = myHeader.substring(0, nextBreak);
+ avLine.trim();
+ myHeader = myHeader.substring(nextBreak+1);
+ nextBreak = myHeader.indexOf(",");
+
+ int eqSign = avLine.indexOf("=");
+ if(eqSign < 0){
+ //os_printf("AUTH FAIL: no = sign\n");
+ return false;
+ }
+ String varName = avLine.substring(0, eqSign);
+ avLine = avLine.substring(eqSign + 1);
+ if(avLine.startsWith("\"")){
+ avLine = avLine.substring(1, avLine.length() - 1);
+ }
+
+ if(varName.equals("username")){
+ if(!avLine.equals(username)){
+ //os_printf("AUTH FAIL: username\n");
+ return false;
+ }
+ myUsername = avLine;
+ } else if(varName.equals("realm")){
+ if(realm != NULL && !avLine.equals(realm)){
+ //os_printf("AUTH FAIL: realm\n");
+ return false;
+ }
+ myRealm = avLine;
+ } else if(varName.equals("nonce")){
+ if(nonce != NULL && !avLine.equals(nonce)){
+ //os_printf("AUTH FAIL: nonce\n");
+ return false;
+ }
+ myNonce = avLine;
+ } else if(varName.equals("opaque")){
+ if(opaque != NULL && !avLine.equals(opaque)){
+ //os_printf("AUTH FAIL: opaque\n");
+ return false;
+ }
+ } else if(varName.equals("uri")){
+ if(uri != NULL && !avLine.equals(uri)){
+ //os_printf("AUTH FAIL: uri\n");
+ return false;
+ }
+ myUri = avLine;
+ } else if(varName.equals("response")){
+ myResponse = avLine;
+ } else if(varName.equals("qop")){
+ myQop = avLine;
+ } else if(varName.equals("nc")){
+ myNc = avLine;
+ } else if(varName.equals("cnonce")){
+ myCnonce = avLine;
+ }
+ } while(nextBreak > 0);
+
+ String ha1 = (passwordIsHash) ? String(password) : stringMD5(myUsername + ":" + myRealm + ":" + String(password));
+ String ha2 = String(method) + ":" + myUri;
+ String response = ha1 + ":" + myNonce + ":" + myNc + ":" + myCnonce + ":" + myQop + ":" + stringMD5(ha2);
+
+ if(myResponse.equals(stringMD5(response))){
+ //os_printf("AUTH SUCCESS\n");
+ return true;
+ }
+
+ //os_printf("AUTH FAIL: password\n");
+ return false;
+}
diff --git a/lib/libesp32/ESPAsyncWebServer/src/WebAuthentication.h b/lib/libesp32/ESPAsyncWebServer/src/WebAuthentication.h
new file mode 100644
index 000000000..ff68265d9
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/src/WebAuthentication.h
@@ -0,0 +1,34 @@
+/*
+ Asynchronous WebServer library for Espressif MCUs
+
+ Copyright (c) 2016 Hristo Gochkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifndef WEB_AUTHENTICATION_H_
+#define WEB_AUTHENTICATION_H_
+
+#include "Arduino.h"
+
+bool checkBasicAuthentication(const char * header, const char * username, const char * password);
+String requestDigestAuthentication(const char * realm);
+bool checkDigestAuthentication(const char * header, const char * method, const char * username, const char * password, const char * realm, bool passwordIsHash, const char * nonce, const char * opaque, const char * uri);
+
+//for storing hashed versions on the device that can be authenticated against
+String generateDigestHash(const char * username, const char * password, const char * realm);
+
+#endif
diff --git a/lib/libesp32/ESPAsyncWebServer/src/WebHandlerImpl.h b/lib/libesp32/ESPAsyncWebServer/src/WebHandlerImpl.h
new file mode 100644
index 000000000..9b7ba1b04
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/src/WebHandlerImpl.h
@@ -0,0 +1,151 @@
+/*
+ Asynchronous WebServer library for Espressif MCUs
+
+ Copyright (c) 2016 Hristo Gochkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+#ifndef ASYNCWEBSERVERHANDLERIMPL_H_
+#define ASYNCWEBSERVERHANDLERIMPL_H_
+
+#include
+#ifdef ASYNCWEBSERVER_REGEX
+#include
+#endif
+
+#include "stddef.h"
+#include
+
+class AsyncStaticWebHandler: public AsyncWebHandler {
+ using File = fs::File;
+ using FS = fs::FS;
+ private:
+ bool _getFile(AsyncWebServerRequest *request);
+ bool _fileExists(AsyncWebServerRequest *request, const String& path);
+ uint8_t _countBits(const uint8_t value) const;
+ protected:
+ FS _fs;
+ String _uri;
+ String _path;
+ String _default_file;
+ String _cache_control;
+ String _last_modified;
+ AwsTemplateProcessor _callback;
+ bool _isDir;
+ bool _gzipFirst;
+ uint8_t _gzipStats;
+ public:
+ AsyncStaticWebHandler(const char* uri, FS& fs, const char* path, const char* cache_control);
+ virtual bool canHandle(AsyncWebServerRequest *request) override final;
+ virtual void handleRequest(AsyncWebServerRequest *request) override final;
+ AsyncStaticWebHandler& setIsDir(bool isDir);
+ AsyncStaticWebHandler& setDefaultFile(const char* filename);
+ AsyncStaticWebHandler& setCacheControl(const char* cache_control);
+ AsyncStaticWebHandler& setLastModified(const char* last_modified);
+ AsyncStaticWebHandler& setLastModified(struct tm* last_modified);
+ #ifdef ESP8266
+ AsyncStaticWebHandler& setLastModified(time_t last_modified);
+ AsyncStaticWebHandler& setLastModified(); //sets to current time. Make sure sntp is runing and time is updated
+ #endif
+ AsyncStaticWebHandler& setTemplateProcessor(AwsTemplateProcessor newCallback) {_callback = newCallback; return *this;}
+};
+
+class AsyncCallbackWebHandler: public AsyncWebHandler {
+ private:
+ protected:
+ String _uri;
+ WebRequestMethodComposite _method;
+ ArRequestHandlerFunction _onRequest;
+ ArUploadHandlerFunction _onUpload;
+ ArBodyHandlerFunction _onBody;
+ bool _isRegex;
+ public:
+ AsyncCallbackWebHandler() : _uri(), _method(HTTP_ANY), _onRequest(NULL), _onUpload(NULL), _onBody(NULL), _isRegex(false) {}
+ void setUri(const String& uri){
+ _uri = uri;
+ _isRegex = uri.startsWith("^") && uri.endsWith("$");
+ }
+ void setMethod(WebRequestMethodComposite method){ _method = method; }
+ void onRequest(ArRequestHandlerFunction fn){ _onRequest = fn; }
+ void onUpload(ArUploadHandlerFunction fn){ _onUpload = fn; }
+ void onBody(ArBodyHandlerFunction fn){ _onBody = fn; }
+
+ virtual bool canHandle(AsyncWebServerRequest *request) override final{
+
+ if(!_onRequest)
+ return false;
+
+ if(!(_method & request->method()))
+ return false;
+
+#ifdef ASYNCWEBSERVER_REGEX
+ if (_isRegex) {
+ std::regex pattern(_uri.c_str());
+ std::smatch matches;
+ std::string s(request->url().c_str());
+ if(std::regex_search(s, matches, pattern)) {
+ for (size_t i = 1; i < matches.size(); ++i) { // start from 1
+ request->_addPathParam(matches[i].str().c_str());
+ }
+ } else {
+ return false;
+ }
+ } else
+#endif
+ if (_uri.length() && _uri.startsWith("/*.")) {
+ String uriTemplate = String (_uri);
+ uriTemplate = uriTemplate.substring(uriTemplate.lastIndexOf("."));
+ if (!request->url().endsWith(uriTemplate))
+ return false;
+ }
+ else
+ if (_uri.length() && _uri.endsWith("*")) {
+ String uriTemplate = String(_uri);
+ uriTemplate = uriTemplate.substring(0, uriTemplate.length() - 1);
+ if (!request->url().startsWith(uriTemplate))
+ return false;
+ }
+ else if(_uri.length() && (_uri != request->url() && !request->url().startsWith(_uri+"/")))
+ return false;
+
+ request->addInterestingHeader("ANY");
+ return true;
+ }
+
+ virtual void handleRequest(AsyncWebServerRequest *request) override final {
+ if((_username != "" && _password != "") && !request->authenticate(_username.c_str(), _password.c_str()))
+ return request->requestAuthentication();
+ if(_onRequest)
+ _onRequest(request);
+ else
+ request->send(500);
+ }
+ virtual void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t index, uint8_t *data, size_t len, bool final) override final {
+ if((_username != "" && _password != "") && !request->authenticate(_username.c_str(), _password.c_str()))
+ return request->requestAuthentication();
+ if(_onUpload)
+ _onUpload(request, filename, index, data, len, final);
+ }
+ virtual void handleBody(AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total) override final {
+ if((_username != "" && _password != "") && !request->authenticate(_username.c_str(), _password.c_str()))
+ return request->requestAuthentication();
+ if(_onBody)
+ _onBody(request, data, len, index, total);
+ }
+ virtual bool isRequestHandlerTrivial() override final {return _onRequest ? false : true;}
+};
+
+#endif /* ASYNCWEBSERVERHANDLERIMPL_H_ */
diff --git a/lib/libesp32/ESPAsyncWebServer/src/WebHandlers.cpp b/lib/libesp32/ESPAsyncWebServer/src/WebHandlers.cpp
new file mode 100644
index 000000000..1f435e68a
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/src/WebHandlers.cpp
@@ -0,0 +1,220 @@
+/*
+ Asynchronous WebServer library for Espressif MCUs
+
+ Copyright (c) 2016 Hristo Gochkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+#include "ESPAsyncWebServer.h"
+#include "WebHandlerImpl.h"
+
+AsyncStaticWebHandler::AsyncStaticWebHandler(const char* uri, FS& fs, const char* path, const char* cache_control)
+ : _fs(fs), _uri(uri), _path(path), _default_file("index.htm"), _cache_control(cache_control), _last_modified(""), _callback(nullptr)
+{
+ // Ensure leading '/'
+ if (_uri.length() == 0 || _uri[0] != '/') _uri = "/" + _uri;
+ if (_path.length() == 0 || _path[0] != '/') _path = "/" + _path;
+
+ // If path ends with '/' we assume a hint that this is a directory to improve performance.
+ // However - if it does not end with '/' we, can't assume a file, path can still be a directory.
+ _isDir = _path[_path.length()-1] == '/';
+
+ // Remove the trailing '/' so we can handle default file
+ // Notice that root will be "" not "/"
+ if (_uri[_uri.length()-1] == '/') _uri = _uri.substring(0, _uri.length()-1);
+ if (_path[_path.length()-1] == '/') _path = _path.substring(0, _path.length()-1);
+
+ // Reset stats
+ _gzipFirst = false;
+ _gzipStats = 0xF8;
+}
+
+AsyncStaticWebHandler& AsyncStaticWebHandler::setIsDir(bool isDir){
+ _isDir = isDir;
+ return *this;
+}
+
+AsyncStaticWebHandler& AsyncStaticWebHandler::setDefaultFile(const char* filename){
+ _default_file = String(filename);
+ return *this;
+}
+
+AsyncStaticWebHandler& AsyncStaticWebHandler::setCacheControl(const char* cache_control){
+ _cache_control = String(cache_control);
+ return *this;
+}
+
+AsyncStaticWebHandler& AsyncStaticWebHandler::setLastModified(const char* last_modified){
+ _last_modified = String(last_modified);
+ return *this;
+}
+
+AsyncStaticWebHandler& AsyncStaticWebHandler::setLastModified(struct tm* last_modified){
+ char result[30];
+ strftime (result,30,"%a, %d %b %Y %H:%M:%S %Z", last_modified);
+ return setLastModified((const char *)result);
+}
+
+#ifdef ESP8266
+AsyncStaticWebHandler& AsyncStaticWebHandler::setLastModified(time_t last_modified){
+ return setLastModified((struct tm *)gmtime(&last_modified));
+}
+
+AsyncStaticWebHandler& AsyncStaticWebHandler::setLastModified(){
+ time_t last_modified;
+ if(time(&last_modified) == 0) //time is not yet set
+ return *this;
+ return setLastModified(last_modified);
+}
+#endif
+bool AsyncStaticWebHandler::canHandle(AsyncWebServerRequest *request){
+ if(request->method() != HTTP_GET
+ || !request->url().startsWith(_uri)
+ || !request->isExpectedRequestedConnType(RCT_DEFAULT, RCT_HTTP)
+ ){
+ return false;
+ }
+ if (_getFile(request)) {
+ // We interested in "If-Modified-Since" header to check if file was modified
+ if (_last_modified.length())
+ request->addInterestingHeader("If-Modified-Since");
+
+ if(_cache_control.length())
+ request->addInterestingHeader("If-None-Match");
+
+ DEBUGF("[AsyncStaticWebHandler::canHandle] TRUE\n");
+ return true;
+ }
+
+ return false;
+}
+
+bool AsyncStaticWebHandler::_getFile(AsyncWebServerRequest *request)
+{
+ // Remove the found uri
+ String path = request->url().substring(_uri.length());
+
+ // We can skip the file check and look for default if request is to the root of a directory or that request path ends with '/'
+ bool canSkipFileCheck = (_isDir && path.length() == 0) || (path.length() && path[path.length()-1] == '/');
+
+ path = _path + path;
+
+ // Do we have a file or .gz file
+ if (!canSkipFileCheck && _fileExists(request, path))
+ return true;
+
+ // Can't handle if not default file
+ if (_default_file.length() == 0)
+ return false;
+
+ // Try to add default file, ensure there is a trailing '/' ot the path.
+ if (path.length() == 0 || path[path.length()-1] != '/')
+ path += "/";
+ path += _default_file;
+
+ return _fileExists(request, path);
+}
+
+#ifdef ESP32
+#define FILE_IS_REAL(f) (f == true && !f.isDirectory())
+#else
+#define FILE_IS_REAL(f) (f == true)
+#endif
+
+bool AsyncStaticWebHandler::_fileExists(AsyncWebServerRequest *request, const String& path)
+{
+ bool fileFound = false;
+ bool gzipFound = false;
+
+ String gzip = path + ".gz";
+
+ if (_gzipFirst) {
+ request->_tempFile = _fs.open(gzip, "r");
+ gzipFound = FILE_IS_REAL(request->_tempFile);
+ if (!gzipFound){
+ request->_tempFile = _fs.open(path, "r");
+ fileFound = FILE_IS_REAL(request->_tempFile);
+ }
+ } else {
+ request->_tempFile = _fs.open(path, "r");
+ fileFound = FILE_IS_REAL(request->_tempFile);
+ if (!fileFound){
+ request->_tempFile = _fs.open(gzip, "r");
+ gzipFound = FILE_IS_REAL(request->_tempFile);
+ }
+ }
+
+ bool found = fileFound || gzipFound;
+
+ if (found) {
+ // Extract the file name from the path and keep it in _tempObject
+ size_t pathLen = path.length();
+ char * _tempPath = (char*)malloc(pathLen+1);
+ snprintf(_tempPath, pathLen+1, "%s", path.c_str());
+ request->_tempObject = (void*)_tempPath;
+
+ // Calculate gzip statistic
+ _gzipStats = (_gzipStats << 1) + (gzipFound ? 1 : 0);
+ if (_gzipStats == 0x00) _gzipFirst = false; // All files are not gzip
+ else if (_gzipStats == 0xFF) _gzipFirst = true; // All files are gzip
+ else _gzipFirst = _countBits(_gzipStats) > 4; // IF we have more gzip files - try gzip first
+ }
+
+ return found;
+}
+
+uint8_t AsyncStaticWebHandler::_countBits(const uint8_t value) const
+{
+ uint8_t w = value;
+ uint8_t n;
+ for (n=0; w!=0; n++) w&=w-1;
+ return n;
+}
+
+void AsyncStaticWebHandler::handleRequest(AsyncWebServerRequest *request)
+{
+ // Get the filename from request->_tempObject and free it
+ String filename = String((char*)request->_tempObject);
+ free(request->_tempObject);
+ request->_tempObject = NULL;
+ if((_username != "" && _password != "") && !request->authenticate(_username.c_str(), _password.c_str()))
+ return request->requestAuthentication();
+
+ if (request->_tempFile == true) {
+ String etag = String(request->_tempFile.size());
+ if (_last_modified.length() && _last_modified == request->header("If-Modified-Since")) {
+ request->_tempFile.close();
+ request->send(304); // Not modified
+ } else if (_cache_control.length() && request->hasHeader("If-None-Match") && request->header("If-None-Match").equals(etag)) {
+ request->_tempFile.close();
+ AsyncWebServerResponse * response = new AsyncBasicResponse(304); // Not modified
+ response->addHeader("Cache-Control", _cache_control);
+ response->addHeader("ETag", etag);
+ request->send(response);
+ } else {
+ AsyncWebServerResponse * response = new AsyncFileResponse(request->_tempFile, filename, String(), false, _callback);
+ if (_last_modified.length())
+ response->addHeader("Last-Modified", _last_modified);
+ if (_cache_control.length()){
+ response->addHeader("Cache-Control", _cache_control);
+ response->addHeader("ETag", etag);
+ }
+ request->send(response);
+ }
+ } else {
+ request->send(404);
+ }
+}
diff --git a/lib/libesp32/ESPAsyncWebServer/src/WebRequest.cpp b/lib/libesp32/ESPAsyncWebServer/src/WebRequest.cpp
new file mode 100644
index 000000000..20b0b1fe4
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/src/WebRequest.cpp
@@ -0,0 +1,1008 @@
+/*
+ Asynchronous WebServer library for Espressif MCUs
+
+ Copyright (c) 2016 Hristo Gochkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+#include "ESPAsyncWebServer.h"
+#include "WebResponseImpl.h"
+#include "WebAuthentication.h"
+
+#ifndef ESP8266
+#define os_strlen strlen
+#endif
+
+static const String SharedEmptyString = String();
+
+#define __is_param_char(c) ((c) && ((c) != '{') && ((c) != '[') && ((c) != '&') && ((c) != '='))
+
+enum { PARSE_REQ_START, PARSE_REQ_HEADERS, PARSE_REQ_BODY, PARSE_REQ_END, PARSE_REQ_FAIL };
+
+AsyncWebServerRequest::AsyncWebServerRequest(AsyncWebServer* s, AsyncClient* c)
+ : _client(c)
+ , _server(s)
+ , _handler(NULL)
+ , _response(NULL)
+ , _temp()
+ , _parseState(0)
+ , _version(0)
+ , _method(HTTP_ANY)
+ , _url()
+ , _host()
+ , _contentType()
+ , _boundary()
+ , _authorization()
+ , _reqconntype(RCT_HTTP)
+ , _isDigest(false)
+ , _isMultipart(false)
+ , _isPlainPost(false)
+ , _expectingContinue(false)
+ , _contentLength(0)
+ , _parsedLength(0)
+ , _headers(AsyncLinkedList([](AsyncWebHeader *h){ delete h; }))
+ , _params(AsyncLinkedList([](AsyncWebParameter *p){ delete p; }))
+ , _pathParams(AsyncLinkedList([](String *p){ delete p; }))
+ , _multiParseState(0)
+ , _boundaryPosition(0)
+ , _itemStartIndex(0)
+ , _itemSize(0)
+ , _itemName()
+ , _itemFilename()
+ , _itemType()
+ , _itemValue()
+ , _itemBuffer(0)
+ , _itemBufferIndex(0)
+ , _itemIsFile(false)
+ , _tempObject(NULL)
+{
+ c->onError([](void *r, AsyncClient* c, int8_t error){ (void)c; AsyncWebServerRequest *req = (AsyncWebServerRequest*)r; req->_onError(error); }, this);
+ c->onAck([](void *r, AsyncClient* c, size_t len, uint32_t time){ (void)c; AsyncWebServerRequest *req = (AsyncWebServerRequest*)r; req->_onAck(len, time); }, this);
+ c->onDisconnect([](void *r, AsyncClient* c){ AsyncWebServerRequest *req = (AsyncWebServerRequest*)r; req->_onDisconnect(); delete c; }, this);
+ c->onTimeout([](void *r, AsyncClient* c, uint32_t time){ (void)c; AsyncWebServerRequest *req = (AsyncWebServerRequest*)r; req->_onTimeout(time); }, this);
+ c->onData([](void *r, AsyncClient* c, void *buf, size_t len){ (void)c; AsyncWebServerRequest *req = (AsyncWebServerRequest*)r; req->_onData(buf, len); }, this);
+ c->onPoll([](void *r, AsyncClient* c){ (void)c; AsyncWebServerRequest *req = ( AsyncWebServerRequest*)r; req->_onPoll(); }, this);
+}
+
+AsyncWebServerRequest::~AsyncWebServerRequest(){
+ _headers.free();
+
+ _params.free();
+ _pathParams.free();
+
+ _interestingHeaders.free();
+
+ if(_response != NULL){
+ delete _response;
+ }
+
+ if(_tempObject != NULL){
+ free(_tempObject);
+ }
+
+ if(_tempFile){
+ _tempFile.close();
+ }
+}
+
+void AsyncWebServerRequest::_onData(void *buf, size_t len){
+ size_t i = 0;
+ while (true) {
+
+ if(_parseState < PARSE_REQ_BODY){
+ // Find new line in buf
+ char *str = (char*)buf;
+ for (i = 0; i < len; i++) {
+ if (str[i] == '\n') {
+ break;
+ }
+ }
+ if (i == len) { // No new line, just add the buffer in _temp
+ char ch = str[len-1];
+ str[len-1] = 0;
+ _temp.reserve(_temp.length()+len);
+ _temp.concat(str);
+ _temp.concat(ch);
+ } else { // Found new line - extract it and parse
+ str[i] = 0; // Terminate the string at the end of the line.
+ _temp.concat(str);
+ _temp.trim();
+ _parseLine();
+ if (++i < len) {
+ // Still have more buffer to process
+ buf = str+i;
+ len-= i;
+ continue;
+ }
+ }
+ } else if(_parseState == PARSE_REQ_BODY){
+ // A handler should be already attached at this point in _parseLine function.
+ // If handler does nothing (_onRequest is NULL), we don't need to really parse the body.
+ const bool needParse = _handler && !_handler->isRequestHandlerTrivial();
+ if(_isMultipart){
+ if(needParse){
+ size_t i;
+ for(i=0; ihandleBody(this, (uint8_t*)buf, len, _parsedLength, _contentLength);
+ _parsedLength += len;
+ } else if(needParse) {
+ size_t i;
+ for(i=0; ihandleRequest(this);
+ else send(501);
+ }
+ }
+ break;
+ }
+}
+
+void AsyncWebServerRequest::_removeNotInterestingHeaders(){
+ if (_interestingHeaders.containsIgnoreCase("ANY")) return; // nothing to do
+ for(const auto& header: _headers){
+ if(!_interestingHeaders.containsIgnoreCase(header->name().c_str())){
+ _headers.remove(header);
+ }
+ }
+}
+
+void AsyncWebServerRequest::_onPoll(){
+ //os_printf("p\n");
+ if(_response != NULL && _client != NULL && _client->canSend() && !_response->_finished()){
+ _response->_ack(this, 0, 0);
+ }
+}
+
+void AsyncWebServerRequest::_onAck(size_t len, uint32_t time){
+ //os_printf("a:%u:%u\n", len, time);
+ if(_response != NULL){
+ if(!_response->_finished()){
+ _response->_ack(this, len, time);
+ } else {
+ AsyncWebServerResponse* r = _response;
+ _response = NULL;
+ delete r;
+ }
+ }
+}
+
+void AsyncWebServerRequest::_onError(int8_t error){
+ (void)error;
+}
+
+void AsyncWebServerRequest::_onTimeout(uint32_t time){
+ (void)time;
+ //os_printf("TIMEOUT: %u, state: %s\n", time, _client->stateToString());
+ _client->close();
+}
+
+void AsyncWebServerRequest::onDisconnect (ArDisconnectHandler fn){
+ _onDisconnectfn=fn;
+}
+
+void AsyncWebServerRequest::_onDisconnect(){
+ //os_printf("d\n");
+ if(_onDisconnectfn) {
+ _onDisconnectfn();
+ }
+ _server->_handleDisconnect(this);
+}
+
+void AsyncWebServerRequest::_addParam(AsyncWebParameter *p){
+ _params.add(p);
+}
+
+void AsyncWebServerRequest::_addPathParam(const char *p){
+ _pathParams.add(new String(p));
+}
+
+void AsyncWebServerRequest::_addGetParams(const String& params){
+ size_t start = 0;
+ while (start < params.length()){
+ int end = params.indexOf('&', start);
+ if (end < 0) end = params.length();
+ int equal = params.indexOf('=', start);
+ if (equal < 0 || equal > end) equal = end;
+ String name = params.substring(start, equal);
+ String value = equal + 1 < end ? params.substring(equal + 1, end) : String();
+ _addParam(new AsyncWebParameter(urlDecode(name), urlDecode(value)));
+ start = end + 1;
+ }
+}
+
+bool AsyncWebServerRequest::_parseReqHead(){
+ // Split the head into method, url and version
+ int index = _temp.indexOf(' ');
+ String m = _temp.substring(0, index);
+ index = _temp.indexOf(' ', index+1);
+ String u = _temp.substring(m.length()+1, index);
+ _temp = _temp.substring(index+1);
+
+ if(m == "GET"){
+ _method = HTTP_GET;
+ } else if(m == "POST"){
+ _method = HTTP_POST;
+ } else if(m == "DELETE"){
+ _method = HTTP_DELETE;
+ } else if(m == "PUT"){
+ _method = HTTP_PUT;
+ } else if(m == "PATCH"){
+ _method = HTTP_PATCH;
+ } else if(m == "HEAD"){
+ _method = HTTP_HEAD;
+ } else if(m == "OPTIONS"){
+ _method = HTTP_OPTIONS;
+ }
+
+ String g = String();
+ index = u.indexOf('?');
+ if(index > 0){
+ g = u.substring(index +1);
+ u = u.substring(0, index);
+ }
+ _url = urlDecode(u);
+ _addGetParams(g);
+
+ if(!_temp.startsWith("HTTP/1.0"))
+ _version = 1;
+
+ _temp = String();
+ return true;
+}
+
+bool strContains(String src, String find, bool mindcase = true) {
+ int pos=0, i=0;
+ const int slen = src.length();
+ const int flen = find.length();
+
+ if (slen < flen) return false;
+ while (pos <= (slen - flen)) {
+ for (i=0; i < flen; i++) {
+ if (mindcase) {
+ if (src[pos+i] != find[i]) i = flen + 1; // no match
+ } else if (tolower(src[pos+i]) != tolower(find[i])) i = flen + 1; // no match
+ }
+ if (i == flen) return true;
+ pos++;
+ }
+ return false;
+}
+
+bool AsyncWebServerRequest::_parseReqHeader(){
+ int index = _temp.indexOf(':');
+ if(index){
+ String name = _temp.substring(0, index);
+ String value = _temp.substring(index + 2);
+ if(name.equalsIgnoreCase("Host")){
+ _host = value;
+ } else if(name.equalsIgnoreCase("Content-Type")){
+ _contentType = value.substring(0, value.indexOf(';'));
+ if (value.startsWith("multipart/")){
+ _boundary = value.substring(value.indexOf('=')+1);
+ _boundary.replace("\"","");
+ _isMultipart = true;
+ }
+ } else if(name.equalsIgnoreCase("Content-Length")){
+ _contentLength = atoi(value.c_str());
+ } else if(name.equalsIgnoreCase("Expect") && value == "100-continue"){
+ _expectingContinue = true;
+ } else if(name.equalsIgnoreCase("Authorization")){
+ if(value.length() > 5 && value.substring(0,5).equalsIgnoreCase("Basic")){
+ _authorization = value.substring(6);
+ } else if(value.length() > 6 && value.substring(0,6).equalsIgnoreCase("Digest")){
+ _isDigest = true;
+ _authorization = value.substring(7);
+ }
+ } else {
+ if(name.equalsIgnoreCase("Upgrade") && value.equalsIgnoreCase("websocket")){
+ // WebSocket request can be uniquely identified by header: [Upgrade: websocket]
+ _reqconntype = RCT_WS;
+ } else {
+ if(name.equalsIgnoreCase("Accept") && strContains(value, "text/event-stream", false)){
+ // WebEvent request can be uniquely identified by header: [Accept: text/event-stream]
+ _reqconntype = RCT_EVENT;
+ }
+ }
+ }
+ _headers.add(new AsyncWebHeader(name, value));
+ }
+ _temp = String();
+ return true;
+}
+
+void AsyncWebServerRequest::_parsePlainPostChar(uint8_t data){
+ if(data && (char)data != '&')
+ _temp += (char)data;
+ if(!data || (char)data == '&' || _parsedLength == _contentLength){
+ String name = "body";
+ String value = _temp;
+ if(!_temp.startsWith("{") && !_temp.startsWith("[") && _temp.indexOf('=') > 0){
+ name = _temp.substring(0, _temp.indexOf('='));
+ value = _temp.substring(_temp.indexOf('=') + 1);
+ }
+ _addParam(new AsyncWebParameter(urlDecode(name), urlDecode(value), true));
+ _temp = String();
+ }
+}
+
+void AsyncWebServerRequest::_handleUploadByte(uint8_t data, bool last){
+ _itemBuffer[_itemBufferIndex++] = data;
+
+ if(last || _itemBufferIndex == 1460){
+ //check if authenticated before calling the upload
+ if(_handler)
+ _handler->handleUpload(this, _itemFilename, _itemSize - _itemBufferIndex, _itemBuffer, _itemBufferIndex, false);
+ _itemBufferIndex = 0;
+ }
+}
+
+enum {
+ EXPECT_BOUNDARY,
+ PARSE_HEADERS,
+ WAIT_FOR_RETURN1,
+ EXPECT_FEED1,
+ EXPECT_DASH1,
+ EXPECT_DASH2,
+ BOUNDARY_OR_DATA,
+ DASH3_OR_RETURN2,
+ EXPECT_FEED2,
+ PARSING_FINISHED,
+ PARSE_ERROR
+};
+
+void AsyncWebServerRequest::_parseMultipartPostByte(uint8_t data, bool last){
+#define itemWriteByte(b) do { _itemSize++; if(_itemIsFile) _handleUploadByte(b, last); else _itemValue+=(char)(b); } while(0)
+
+ if(!_parsedLength){
+ _multiParseState = EXPECT_BOUNDARY;
+ _temp = String();
+ _itemName = String();
+ _itemFilename = String();
+ _itemType = String();
+ }
+
+ if(_multiParseState == WAIT_FOR_RETURN1){
+ if(data != '\r'){
+ itemWriteByte(data);
+ } else {
+ _multiParseState = EXPECT_FEED1;
+ }
+ } else if(_multiParseState == EXPECT_BOUNDARY){
+ if(_parsedLength < 2 && data != '-'){
+ _multiParseState = PARSE_ERROR;
+ return;
+ } else if(_parsedLength - 2 < _boundary.length() && _boundary.c_str()[_parsedLength - 2] != data){
+ _multiParseState = PARSE_ERROR;
+ return;
+ } else if(_parsedLength - 2 == _boundary.length() && data != '\r'){
+ _multiParseState = PARSE_ERROR;
+ return;
+ } else if(_parsedLength - 3 == _boundary.length()){
+ if(data != '\n'){
+ _multiParseState = PARSE_ERROR;
+ return;
+ }
+ _multiParseState = PARSE_HEADERS;
+ _itemIsFile = false;
+ }
+ } else if(_multiParseState == PARSE_HEADERS){
+ if((char)data != '\r' && (char)data != '\n')
+ _temp += (char)data;
+ if((char)data == '\n'){
+ if(_temp.length()){
+ if(_temp.length() > 12 && _temp.substring(0, 12).equalsIgnoreCase("Content-Type")){
+ _itemType = _temp.substring(14);
+ _itemIsFile = true;
+ } else if(_temp.length() > 19 && _temp.substring(0, 19).equalsIgnoreCase("Content-Disposition")){
+ _temp = _temp.substring(_temp.indexOf(';') + 2);
+ while(_temp.indexOf(';') > 0){
+ String name = _temp.substring(0, _temp.indexOf('='));
+ String nameVal = _temp.substring(_temp.indexOf('=') + 2, _temp.indexOf(';') - 1);
+ if(name == "name"){
+ _itemName = nameVal;
+ } else if(name == "filename"){
+ _itemFilename = nameVal;
+ _itemIsFile = true;
+ }
+ _temp = _temp.substring(_temp.indexOf(';') + 2);
+ }
+ String name = _temp.substring(0, _temp.indexOf('='));
+ String nameVal = _temp.substring(_temp.indexOf('=') + 2, _temp.length() - 1);
+ if(name == "name"){
+ _itemName = nameVal;
+ } else if(name == "filename"){
+ _itemFilename = nameVal;
+ _itemIsFile = true;
+ }
+ }
+ _temp = String();
+ } else {
+ _multiParseState = WAIT_FOR_RETURN1;
+ //value starts from here
+ _itemSize = 0;
+ _itemStartIndex = _parsedLength;
+ _itemValue = String();
+ if(_itemIsFile){
+ if(_itemBuffer)
+ free(_itemBuffer);
+ _itemBuffer = (uint8_t*)malloc(1460);
+ if(_itemBuffer == NULL){
+ _multiParseState = PARSE_ERROR;
+ return;
+ }
+ _itemBufferIndex = 0;
+ }
+ }
+ }
+ } else if(_multiParseState == EXPECT_FEED1){
+ if(data != '\n'){
+ _multiParseState = WAIT_FOR_RETURN1;
+ itemWriteByte('\r'); _parseMultipartPostByte(data, last);
+ } else {
+ _multiParseState = EXPECT_DASH1;
+ }
+ } else if(_multiParseState == EXPECT_DASH1){
+ if(data != '-'){
+ _multiParseState = WAIT_FOR_RETURN1;
+ itemWriteByte('\r'); itemWriteByte('\n'); _parseMultipartPostByte(data, last);
+ } else {
+ _multiParseState = EXPECT_DASH2;
+ }
+ } else if(_multiParseState == EXPECT_DASH2){
+ if(data != '-'){
+ _multiParseState = WAIT_FOR_RETURN1;
+ itemWriteByte('\r'); itemWriteByte('\n'); itemWriteByte('-'); _parseMultipartPostByte(data, last);
+ } else {
+ _multiParseState = BOUNDARY_OR_DATA;
+ _boundaryPosition = 0;
+ }
+ } else if(_multiParseState == BOUNDARY_OR_DATA){
+ if(_boundaryPosition < _boundary.length() && _boundary.c_str()[_boundaryPosition] != data){
+ _multiParseState = WAIT_FOR_RETURN1;
+ itemWriteByte('\r'); itemWriteByte('\n'); itemWriteByte('-'); itemWriteByte('-');
+ uint8_t i;
+ for(i=0; i<_boundaryPosition; i++)
+ itemWriteByte(_boundary.c_str()[i]);
+ _parseMultipartPostByte(data, last);
+ } else if(_boundaryPosition == _boundary.length() - 1){
+ _multiParseState = DASH3_OR_RETURN2;
+ if(!_itemIsFile){
+ _addParam(new AsyncWebParameter(_itemName, _itemValue, true));
+ } else {
+ if(_itemSize){
+ //check if authenticated before calling the upload
+ if(_handler) _handler->handleUpload(this, _itemFilename, _itemSize - _itemBufferIndex, _itemBuffer, _itemBufferIndex, true);
+ _itemBufferIndex = 0;
+ _addParam(new AsyncWebParameter(_itemName, _itemFilename, true, true, _itemSize));
+ }
+ free(_itemBuffer);
+ _itemBuffer = NULL;
+ }
+
+ } else {
+ _boundaryPosition++;
+ }
+ } else if(_multiParseState == DASH3_OR_RETURN2){
+ if(data == '-' && (_contentLength - _parsedLength - 4) != 0){
+ //os_printf("ERROR: The parser got to the end of the POST but is expecting %u bytes more!\nDrop an issue so we can have more info on the matter!\n", _contentLength - _parsedLength - 4);
+ _contentLength = _parsedLength + 4;//lets close the request gracefully
+ }
+ if(data == '\r'){
+ _multiParseState = EXPECT_FEED2;
+ } else if(data == '-' && _contentLength == (_parsedLength + 4)){
+ _multiParseState = PARSING_FINISHED;
+ } else {
+ _multiParseState = WAIT_FOR_RETURN1;
+ itemWriteByte('\r'); itemWriteByte('\n'); itemWriteByte('-'); itemWriteByte('-');
+ uint8_t i; for(i=0; i<_boundary.length(); i++) itemWriteByte(_boundary.c_str()[i]);
+ _parseMultipartPostByte(data, last);
+ }
+ } else if(_multiParseState == EXPECT_FEED2){
+ if(data == '\n'){
+ _multiParseState = PARSE_HEADERS;
+ _itemIsFile = false;
+ } else {
+ _multiParseState = WAIT_FOR_RETURN1;
+ itemWriteByte('\r'); itemWriteByte('\n'); itemWriteByte('-'); itemWriteByte('-');
+ uint8_t i; for(i=0; i<_boundary.length(); i++) itemWriteByte(_boundary.c_str()[i]);
+ itemWriteByte('\r'); _parseMultipartPostByte(data, last);
+ }
+ }
+}
+
+void AsyncWebServerRequest::_parseLine(){
+ if(_parseState == PARSE_REQ_START){
+ if(!_temp.length()){
+ _parseState = PARSE_REQ_FAIL;
+ _client->close();
+ } else {
+ _parseReqHead();
+ _parseState = PARSE_REQ_HEADERS;
+ }
+ return;
+ }
+
+ if(_parseState == PARSE_REQ_HEADERS){
+ if(!_temp.length()){
+ //end of headers
+ _server->_rewriteRequest(this);
+ _server->_attachHandler(this);
+ _removeNotInterestingHeaders();
+ if(_expectingContinue){
+ const char * response = "HTTP/1.1 100 Continue\r\n\r\n";
+ _client->write(response, os_strlen(response));
+ }
+ //check handler for authentication
+ if(_contentLength){
+ _parseState = PARSE_REQ_BODY;
+ } else {
+ _parseState = PARSE_REQ_END;
+ if(_handler) _handler->handleRequest(this);
+ else send(501);
+ }
+ } else _parseReqHeader();
+ }
+}
+
+size_t AsyncWebServerRequest::headers() const{
+ return _headers.length();
+}
+
+bool AsyncWebServerRequest::hasHeader(const String& name) const {
+ for(const auto& h: _headers){
+ if(h->name().equalsIgnoreCase(name)){
+ return true;
+ }
+ }
+ return false;
+}
+
+bool AsyncWebServerRequest::hasHeader(const __FlashStringHelper * data) const {
+ PGM_P p = reinterpret_cast(data);
+ size_t n = 0;
+ while (1) {
+ if (pgm_read_byte(p+n) == 0) break;
+ n += 1;
+ }
+ char * name = (char*) malloc(n+1);
+ name[n] = 0;
+ if (name) {
+ for(size_t b=0; bname().equalsIgnoreCase(name)){
+ return h;
+ }
+ }
+ return nullptr;
+}
+
+AsyncWebHeader* AsyncWebServerRequest::getHeader(const __FlashStringHelper * data) const {
+ PGM_P p = reinterpret_cast(data);
+ size_t n = strlen_P(p);
+ char * name = (char*) malloc(n+1);
+ if (name) {
+ strcpy_P(name, p);
+ AsyncWebHeader* result = getHeader( String(name));
+ free(name);
+ return result;
+ } else {
+ return nullptr;
+ }
+}
+
+AsyncWebHeader* AsyncWebServerRequest::getHeader(size_t num) const {
+ auto header = _headers.nth(num);
+ return header ? *header : nullptr;
+}
+
+size_t AsyncWebServerRequest::params() const {
+ return _params.length();
+}
+
+bool AsyncWebServerRequest::hasParam(const String& name, bool post, bool file) const {
+ for(const auto& p: _params){
+ if(p->name() == name && p->isPost() == post && p->isFile() == file){
+ return true;
+ }
+ }
+ return false;
+}
+
+bool AsyncWebServerRequest::hasParam(const __FlashStringHelper * data, bool post, bool file) const {
+ PGM_P p = reinterpret_cast(data);
+ size_t n = strlen_P(p);
+
+ char * name = (char*) malloc(n+1);
+ name[n] = 0;
+ if (name) {
+ strcpy_P(name,p);
+ bool result = hasParam( name, post, file);
+ free(name);
+ return result;
+ } else {
+ return false;
+ }
+}
+
+AsyncWebParameter* AsyncWebServerRequest::getParam(const String& name, bool post, bool file) const {
+ for(const auto& p: _params){
+ if(p->name() == name && p->isPost() == post && p->isFile() == file){
+ return p;
+ }
+ }
+ return nullptr;
+}
+
+AsyncWebParameter* AsyncWebServerRequest::getParam(const __FlashStringHelper * data, bool post, bool file) const {
+ PGM_P p = reinterpret_cast(data);
+ size_t n = strlen_P(p);
+ char * name = (char*) malloc(n+1);
+ if (name) {
+ strcpy_P(name, p);
+ AsyncWebParameter* result = getParam(name, post, file);
+ free(name);
+ return result;
+ } else {
+ return nullptr;
+ }
+}
+
+AsyncWebParameter* AsyncWebServerRequest::getParam(size_t num) const {
+ auto param = _params.nth(num);
+ return param ? *param : nullptr;
+}
+
+void AsyncWebServerRequest::addInterestingHeader(const String& name){
+ if(!_interestingHeaders.containsIgnoreCase(name))
+ _interestingHeaders.add(name);
+}
+
+void AsyncWebServerRequest::send(AsyncWebServerResponse *response){
+ _response = response;
+ if(_response == NULL){
+ _client->close(true);
+ _onDisconnect();
+ return;
+ }
+ if(!_response->_sourceValid()){
+ delete response;
+ _response = NULL;
+ send(500);
+ }
+ else {
+ _client->setRxTimeout(0);
+ _response->_respond(this);
+ }
+}
+
+AsyncWebServerResponse * AsyncWebServerRequest::beginResponse(int code, const String& contentType, const String& content){
+ return new AsyncBasicResponse(code, contentType, content);
+}
+
+AsyncWebServerResponse * AsyncWebServerRequest::beginResponse(FS &fs, const String& path, const String& contentType, bool download, AwsTemplateProcessor callback){
+ if(fs.exists(path) || (!download && fs.exists(path+".gz")))
+ return new AsyncFileResponse(fs, path, contentType, download, callback);
+ return NULL;
+}
+
+AsyncWebServerResponse * AsyncWebServerRequest::beginResponse(File content, const String& path, const String& contentType, bool download, AwsTemplateProcessor callback){
+ if(content == true)
+ return new AsyncFileResponse(content, path, contentType, download, callback);
+ return NULL;
+}
+
+AsyncWebServerResponse * AsyncWebServerRequest::beginResponse(Stream &stream, const String& contentType, size_t len, AwsTemplateProcessor callback){
+ return new AsyncStreamResponse(stream, contentType, len, callback);
+}
+
+AsyncWebServerResponse * AsyncWebServerRequest::beginResponse(const String& contentType, size_t len, AwsResponseFiller callback, AwsTemplateProcessor templateCallback){
+ return new AsyncCallbackResponse(contentType, len, callback, templateCallback);
+}
+
+AsyncWebServerResponse * AsyncWebServerRequest::beginChunkedResponse(const String& contentType, AwsResponseFiller callback, AwsTemplateProcessor templateCallback){
+ if(_version)
+ return new AsyncChunkedResponse(contentType, callback, templateCallback);
+ return new AsyncCallbackResponse(contentType, 0, callback, templateCallback);
+}
+
+AsyncResponseStream * AsyncWebServerRequest::beginResponseStream(const String& contentType, size_t bufferSize){
+ return new AsyncResponseStream(contentType, bufferSize);
+}
+
+AsyncWebServerResponse * AsyncWebServerRequest::beginResponse_P(int code, const String& contentType, const uint8_t * content, size_t len, AwsTemplateProcessor callback){
+ return new AsyncProgmemResponse(code, contentType, content, len, callback);
+}
+
+AsyncWebServerResponse * AsyncWebServerRequest::beginResponse_P(int code, const String& contentType, PGM_P content, AwsTemplateProcessor callback){
+ return beginResponse_P(code, contentType, (const uint8_t *)content, strlen_P(content), callback);
+}
+
+void AsyncWebServerRequest::send(int code, const String& contentType, const String& content){
+ send(beginResponse(code, contentType, content));
+}
+
+void AsyncWebServerRequest::send(FS &fs, const String& path, const String& contentType, bool download, AwsTemplateProcessor callback){
+ if(fs.exists(path) || (!download && fs.exists(path+".gz"))){
+ send(beginResponse(fs, path, contentType, download, callback));
+ } else send(404);
+}
+
+void AsyncWebServerRequest::send(File content, const String& path, const String& contentType, bool download, AwsTemplateProcessor callback){
+ if(content == true){
+ send(beginResponse(content, path, contentType, download, callback));
+ } else send(404);
+}
+
+void AsyncWebServerRequest::send(Stream &stream, const String& contentType, size_t len, AwsTemplateProcessor callback){
+ send(beginResponse(stream, contentType, len, callback));
+}
+
+void AsyncWebServerRequest::send(const String& contentType, size_t len, AwsResponseFiller callback, AwsTemplateProcessor templateCallback){
+ send(beginResponse(contentType, len, callback, templateCallback));
+}
+
+void AsyncWebServerRequest::sendChunked(const String& contentType, AwsResponseFiller callback, AwsTemplateProcessor templateCallback){
+ send(beginChunkedResponse(contentType, callback, templateCallback));
+}
+
+void AsyncWebServerRequest::send_P(int code, const String& contentType, const uint8_t * content, size_t len, AwsTemplateProcessor callback){
+ send(beginResponse_P(code, contentType, content, len, callback));
+}
+
+void AsyncWebServerRequest::send_P(int code, const String& contentType, PGM_P content, AwsTemplateProcessor callback){
+ send(beginResponse_P(code, contentType, content, callback));
+}
+
+void AsyncWebServerRequest::redirect(const String& url){
+ AsyncWebServerResponse * response = beginResponse(302);
+ response->addHeader("Location",url);
+ send(response);
+}
+
+bool AsyncWebServerRequest::authenticate(const char * username, const char * password, const char * realm, bool passwordIsHash){
+ if(_authorization.length()){
+ if(_isDigest)
+ return checkDigestAuthentication(_authorization.c_str(), methodToString(), username, password, realm, passwordIsHash, NULL, NULL, NULL);
+ else if(!passwordIsHash)
+ return checkBasicAuthentication(_authorization.c_str(), username, password);
+ else
+ return _authorization.equals(password);
+ }
+ return false;
+}
+
+bool AsyncWebServerRequest::authenticate(const char * hash){
+ if(!_authorization.length() || hash == NULL)
+ return false;
+
+ if(_isDigest){
+ String hStr = String(hash);
+ int separator = hStr.indexOf(":");
+ if(separator <= 0)
+ return false;
+ String username = hStr.substring(0, separator);
+ hStr = hStr.substring(separator + 1);
+ separator = hStr.indexOf(":");
+ if(separator <= 0)
+ return false;
+ String realm = hStr.substring(0, separator);
+ hStr = hStr.substring(separator + 1);
+ return checkDigestAuthentication(_authorization.c_str(), methodToString(), username.c_str(), hStr.c_str(), realm.c_str(), true, NULL, NULL, NULL);
+ }
+
+ return (_authorization.equals(hash));
+}
+
+void AsyncWebServerRequest::requestAuthentication(const char * realm, bool isDigest){
+ AsyncWebServerResponse * r = beginResponse(401);
+ if(!isDigest && realm == NULL){
+ r->addHeader("WWW-Authenticate", "Basic realm=\"Login Required\"");
+ } else if(!isDigest){
+ String header = "Basic realm=\"";
+ header.concat(realm);
+ header.concat("\"");
+ r->addHeader("WWW-Authenticate", header);
+ } else {
+ String header = "Digest ";
+ header.concat(requestDigestAuthentication(realm));
+ r->addHeader("WWW-Authenticate", header);
+ }
+ send(r);
+}
+
+bool AsyncWebServerRequest::hasArg(const char* name) const {
+ for(const auto& arg: _params){
+ if(arg->name() == name){
+ return true;
+ }
+ }
+ return false;
+}
+
+bool AsyncWebServerRequest::hasArg(const __FlashStringHelper * data) const {
+ PGM_P p = reinterpret_cast(data);
+ size_t n = strlen_P(p);
+ char * name = (char*) malloc(n+1);
+ if (name) {
+ strcpy_P(name, p);
+ bool result = hasArg( name );
+ free(name);
+ return result;
+ } else {
+ return false;
+ }
+}
+
+
+const String& AsyncWebServerRequest::arg(const String& name) const {
+ for(const auto& arg: _params){
+ if(arg->name() == name){
+ return arg->value();
+ }
+ }
+ return SharedEmptyString;
+}
+
+const String& AsyncWebServerRequest::arg(const __FlashStringHelper * data) const {
+ PGM_P p = reinterpret_cast(data);
+ size_t n = strlen_P(p);
+ char * name = (char*) malloc(n+1);
+ if (name) {
+ strcpy_P(name, p);
+ const String & result = arg( String(name) );
+ free(name);
+ return result;
+ } else {
+ return SharedEmptyString;
+ }
+
+}
+
+const String& AsyncWebServerRequest::arg(size_t i) const {
+ return getParam(i)->value();
+}
+
+const String& AsyncWebServerRequest::argName(size_t i) const {
+ return getParam(i)->name();
+}
+
+const String& AsyncWebServerRequest::pathArg(size_t i) const {
+ auto param = _pathParams.nth(i);
+ return param ? **param : SharedEmptyString;
+}
+
+const String& AsyncWebServerRequest::header(const char* name) const {
+ AsyncWebHeader* h = getHeader(String(name));
+ return h ? h->value() : SharedEmptyString;
+}
+
+const String& AsyncWebServerRequest::header(const __FlashStringHelper * data) const {
+ PGM_P p = reinterpret_cast(data);
+ size_t n = strlen_P(p);
+ char * name = (char*) malloc(n+1);
+ if (name) {
+ strcpy_P(name, p);
+ const String & result = header( (const char *)name );
+ free(name);
+ return result;
+ } else {
+ return SharedEmptyString;
+ }
+};
+
+
+const String& AsyncWebServerRequest::header(size_t i) const {
+ AsyncWebHeader* h = getHeader(i);
+ return h ? h->value() : SharedEmptyString;
+}
+
+const String& AsyncWebServerRequest::headerName(size_t i) const {
+ AsyncWebHeader* h = getHeader(i);
+ return h ? h->name() : SharedEmptyString;
+}
+
+String AsyncWebServerRequest::urlDecode(const String& text) const {
+ char temp[] = "0x00";
+ unsigned int len = text.length();
+ unsigned int i = 0;
+ String decoded = String();
+ decoded.reserve(len); // Allocate the string internal buffer - never longer from source text
+ while (i < len){
+ char decodedChar;
+ char encodedChar = text.charAt(i++);
+ if ((encodedChar == '%') && (i + 1 < len)){
+ temp[2] = text.charAt(i++);
+ temp[3] = text.charAt(i++);
+ decodedChar = strtol(temp, NULL, 16);
+ } else if (encodedChar == '+') {
+ decodedChar = ' ';
+ } else {
+ decodedChar = encodedChar; // normal ascii char
+ }
+ decoded.concat(decodedChar);
+ }
+ return decoded;
+}
+
+
+const char * AsyncWebServerRequest::methodToString() const {
+ if(_method == HTTP_ANY) return "ANY";
+ else if(_method & HTTP_GET) return "GET";
+ else if(_method & HTTP_POST) return "POST";
+ else if(_method & HTTP_DELETE) return "DELETE";
+ else if(_method & HTTP_PUT) return "PUT";
+ else if(_method & HTTP_PATCH) return "PATCH";
+ else if(_method & HTTP_HEAD) return "HEAD";
+ else if(_method & HTTP_OPTIONS) return "OPTIONS";
+ return "UNKNOWN";
+}
+
+const char *AsyncWebServerRequest::requestedConnTypeToString() const {
+ switch (_reqconntype) {
+ case RCT_NOT_USED: return "RCT_NOT_USED";
+ case RCT_DEFAULT: return "RCT_DEFAULT";
+ case RCT_HTTP: return "RCT_HTTP";
+ case RCT_WS: return "RCT_WS";
+ case RCT_EVENT: return "RCT_EVENT";
+ default: return "ERROR";
+ }
+}
+
+bool AsyncWebServerRequest::isExpectedRequestedConnType(RequestedConnectionType erct1, RequestedConnectionType erct2, RequestedConnectionType erct3) {
+ bool res = false;
+ if ((erct1 != RCT_NOT_USED) && (erct1 == _reqconntype)) res = true;
+ if ((erct2 != RCT_NOT_USED) && (erct2 == _reqconntype)) res = true;
+ if ((erct3 != RCT_NOT_USED) && (erct3 == _reqconntype)) res = true;
+ return res;
+}
diff --git a/lib/libesp32/ESPAsyncWebServer/src/WebResponseImpl.h b/lib/libesp32/ESPAsyncWebServer/src/WebResponseImpl.h
new file mode 100644
index 000000000..9a64e3a52
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/src/WebResponseImpl.h
@@ -0,0 +1,136 @@
+/*
+ Asynchronous WebServer library for Espressif MCUs
+
+ Copyright (c) 2016 Hristo Gochkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+#ifndef ASYNCWEBSERVERRESPONSEIMPL_H_
+#define ASYNCWEBSERVERRESPONSEIMPL_H_
+
+#ifdef Arduino_h
+// arduino is not compatible with std::vector
+#undef min
+#undef max
+#endif
+#include
+// It is possible to restore these defines, but one can use _min and _max instead. Or std::min, std::max.
+
+class AsyncBasicResponse: public AsyncWebServerResponse {
+ private:
+ String _content;
+ public:
+ AsyncBasicResponse(int code, const String& contentType=String(), const String& content=String());
+ void _respond(AsyncWebServerRequest *request);
+ size_t _ack(AsyncWebServerRequest *request, size_t len, uint32_t time);
+ bool _sourceValid() const { return true; }
+};
+
+class AsyncAbstractResponse: public AsyncWebServerResponse {
+ private:
+ String _head;
+ // Data is inserted into cache at begin().
+ // This is inefficient with vector, but if we use some other container,
+ // we won't be able to access it as contiguous array of bytes when reading from it,
+ // so by gaining performance in one place, we'll lose it in another.
+ std::vector _cache;
+ size_t _readDataFromCacheOrContent(uint8_t* data, const size_t len);
+ size_t _fillBufferAndProcessTemplates(uint8_t* buf, size_t maxLen);
+ protected:
+ AwsTemplateProcessor _callback;
+ public:
+ AsyncAbstractResponse(AwsTemplateProcessor callback=nullptr);
+ void _respond(AsyncWebServerRequest *request);
+ size_t _ack(AsyncWebServerRequest *request, size_t len, uint32_t time);
+ bool _sourceValid() const { return false; }
+ virtual size_t _fillBuffer(uint8_t *buf __attribute__((unused)), size_t maxLen __attribute__((unused))) { return 0; }
+};
+
+#ifndef TEMPLATE_PLACEHOLDER
+#define TEMPLATE_PLACEHOLDER '%'
+#endif
+
+#define TEMPLATE_PARAM_NAME_LENGTH 32
+class AsyncFileResponse: public AsyncAbstractResponse {
+ using File = fs::File;
+ using FS = fs::FS;
+ private:
+ File _content;
+ String _path;
+ void _setContentType(const String& path);
+ public:
+ AsyncFileResponse(FS &fs, const String& path, const String& contentType=String(), bool download=false, AwsTemplateProcessor callback=nullptr);
+ AsyncFileResponse(File content, const String& path, const String& contentType=String(), bool download=false, AwsTemplateProcessor callback=nullptr);
+ ~AsyncFileResponse();
+ bool _sourceValid() const { return !!(_content); }
+ virtual size_t _fillBuffer(uint8_t *buf, size_t maxLen) override;
+};
+
+class AsyncStreamResponse: public AsyncAbstractResponse {
+ private:
+ Stream *_content;
+ public:
+ AsyncStreamResponse(Stream &stream, const String& contentType, size_t len, AwsTemplateProcessor callback=nullptr);
+ bool _sourceValid() const { return !!(_content); }
+ virtual size_t _fillBuffer(uint8_t *buf, size_t maxLen) override;
+};
+
+class AsyncCallbackResponse: public AsyncAbstractResponse {
+ private:
+ AwsResponseFiller _content;
+ size_t _filledLength;
+ public:
+ AsyncCallbackResponse(const String& contentType, size_t len, AwsResponseFiller callback, AwsTemplateProcessor templateCallback=nullptr);
+ bool _sourceValid() const { return !!(_content); }
+ virtual size_t _fillBuffer(uint8_t *buf, size_t maxLen) override;
+};
+
+class AsyncChunkedResponse: public AsyncAbstractResponse {
+ private:
+ AwsResponseFiller _content;
+ size_t _filledLength;
+ public:
+ AsyncChunkedResponse(const String& contentType, AwsResponseFiller callback, AwsTemplateProcessor templateCallback=nullptr);
+ bool _sourceValid() const { return !!(_content); }
+ virtual size_t _fillBuffer(uint8_t *buf, size_t maxLen) override;
+};
+
+class AsyncProgmemResponse: public AsyncAbstractResponse {
+ private:
+ const uint8_t * _content;
+ size_t _readLength;
+ public:
+ AsyncProgmemResponse(int code, const String& contentType, const uint8_t * content, size_t len, AwsTemplateProcessor callback=nullptr);
+ bool _sourceValid() const { return true; }
+ virtual size_t _fillBuffer(uint8_t *buf, size_t maxLen) override;
+};
+
+class cbuf;
+
+class AsyncResponseStream: public AsyncAbstractResponse, public Print {
+ private:
+ cbuf *_content;
+ public:
+ AsyncResponseStream(const String& contentType, size_t bufferSize);
+ ~AsyncResponseStream();
+ bool _sourceValid() const { return (_state < RESPONSE_END); }
+ virtual size_t _fillBuffer(uint8_t *buf, size_t maxLen) override;
+ size_t write(const uint8_t *data, size_t len);
+ size_t write(uint8_t data);
+ using Print::write;
+};
+
+#endif /* ASYNCWEBSERVERRESPONSEIMPL_H_ */
diff --git a/lib/libesp32/ESPAsyncWebServer/src/WebResponses.cpp b/lib/libesp32/ESPAsyncWebServer/src/WebResponses.cpp
new file mode 100644
index 000000000..cc66b00ea
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/src/WebResponses.cpp
@@ -0,0 +1,699 @@
+/*
+ Asynchronous WebServer library for Espressif MCUs
+
+ Copyright (c) 2016 Hristo Gochkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+#include "ESPAsyncWebServer.h"
+#include "WebResponseImpl.h"
+#include "cbuf.h"
+
+// Since ESP8266 does not link memchr by default, here's its implementation.
+void* memchr(void* ptr, int ch, size_t count)
+{
+ unsigned char* p = static_cast(ptr);
+ while(count--)
+ if(*p++ == static_cast(ch))
+ return --p;
+ return nullptr;
+}
+
+
+/*
+ * Abstract Response
+ * */
+const char* AsyncWebServerResponse::_responseCodeToString(int code) {
+ switch (code) {
+ case 100: return "Continue";
+ case 101: return "Switching Protocols";
+ case 200: return "OK";
+ case 201: return "Created";
+ case 202: return "Accepted";
+ case 203: return "Non-Authoritative Information";
+ case 204: return "No Content";
+ case 205: return "Reset Content";
+ case 206: return "Partial Content";
+ case 300: return "Multiple Choices";
+ case 301: return "Moved Permanently";
+ case 302: return "Found";
+ case 303: return "See Other";
+ case 304: return "Not Modified";
+ case 305: return "Use Proxy";
+ case 307: return "Temporary Redirect";
+ case 400: return "Bad Request";
+ case 401: return "Unauthorized";
+ case 402: return "Payment Required";
+ case 403: return "Forbidden";
+ case 404: return "Not Found";
+ case 405: return "Method Not Allowed";
+ case 406: return "Not Acceptable";
+ case 407: return "Proxy Authentication Required";
+ case 408: return "Request Time-out";
+ case 409: return "Conflict";
+ case 410: return "Gone";
+ case 411: return "Length Required";
+ case 412: return "Precondition Failed";
+ case 413: return "Request Entity Too Large";
+ case 414: return "Request-URI Too Large";
+ case 415: return "Unsupported Media Type";
+ case 416: return "Requested range not satisfiable";
+ case 417: return "Expectation Failed";
+ case 500: return "Internal Server Error";
+ case 501: return "Not Implemented";
+ case 502: return "Bad Gateway";
+ case 503: return "Service Unavailable";
+ case 504: return "Gateway Time-out";
+ case 505: return "HTTP Version not supported";
+ default: return "";
+ }
+}
+
+AsyncWebServerResponse::AsyncWebServerResponse()
+ : _code(0)
+ , _headers(AsyncLinkedList([](AsyncWebHeader *h){ delete h; }))
+ , _contentType()
+ , _contentLength(0)
+ , _sendContentLength(true)
+ , _chunked(false)
+ , _headLength(0)
+ , _sentLength(0)
+ , _ackedLength(0)
+ , _writtenLength(0)
+ , _state(RESPONSE_SETUP)
+{
+ for(auto header: DefaultHeaders::Instance()) {
+ _headers.add(new AsyncWebHeader(header->name(), header->value()));
+ }
+}
+
+AsyncWebServerResponse::~AsyncWebServerResponse(){
+ _headers.free();
+}
+
+void AsyncWebServerResponse::setCode(int code){
+ if(_state == RESPONSE_SETUP)
+ _code = code;
+}
+
+void AsyncWebServerResponse::setContentLength(size_t len){
+ if(_state == RESPONSE_SETUP)
+ _contentLength = len;
+}
+
+void AsyncWebServerResponse::setContentType(const String& type){
+ if(_state == RESPONSE_SETUP)
+ _contentType = type;
+}
+
+void AsyncWebServerResponse::addHeader(const String& name, const String& value){
+ _headers.add(new AsyncWebHeader(name, value));
+}
+
+String AsyncWebServerResponse::_assembleHead(uint8_t version){
+ if(version){
+ addHeader("Accept-Ranges","none");
+ if(_chunked)
+ addHeader("Transfer-Encoding","chunked");
+ }
+ String out = String();
+ int bufSize = 300;
+ char buf[bufSize];
+
+ snprintf(buf, bufSize, "HTTP/1.%d %d %s\r\n", version, _code, _responseCodeToString(_code));
+ out.concat(buf);
+
+ if(_sendContentLength) {
+ snprintf(buf, bufSize, "Content-Length: %d\r\n", _contentLength);
+ out.concat(buf);
+ }
+ if(_contentType.length()) {
+ snprintf(buf, bufSize, "Content-Type: %s\r\n", _contentType.c_str());
+ out.concat(buf);
+ }
+
+ for(const auto& header: _headers){
+ snprintf(buf, bufSize, "%s: %s\r\n", header->name().c_str(), header->value().c_str());
+ out.concat(buf);
+ }
+ _headers.free();
+
+ out.concat("\r\n");
+ _headLength = out.length();
+ return out;
+}
+
+bool AsyncWebServerResponse::_started() const { return _state > RESPONSE_SETUP; }
+bool AsyncWebServerResponse::_finished() const { return _state > RESPONSE_WAIT_ACK; }
+bool AsyncWebServerResponse::_failed() const { return _state == RESPONSE_FAILED; }
+bool AsyncWebServerResponse::_sourceValid() const { return false; }
+void AsyncWebServerResponse::_respond(AsyncWebServerRequest *request){ _state = RESPONSE_END; request->client()->close(); }
+size_t AsyncWebServerResponse::_ack(AsyncWebServerRequest *request, size_t len, uint32_t time){ (void)request; (void)len; (void)time; return 0; }
+
+/*
+ * String/Code Response
+ * */
+AsyncBasicResponse::AsyncBasicResponse(int code, const String& contentType, const String& content){
+ _code = code;
+ _content = content;
+ _contentType = contentType;
+ if(_content.length()){
+ _contentLength = _content.length();
+ if(!_contentType.length())
+ _contentType = "text/plain";
+ }
+ addHeader("Connection","close");
+}
+
+void AsyncBasicResponse::_respond(AsyncWebServerRequest *request){
+ _state = RESPONSE_HEADERS;
+ String out = _assembleHead(request->version());
+ size_t outLen = out.length();
+ size_t space = request->client()->space();
+ if(!_contentLength && space >= outLen){
+ _writtenLength += request->client()->write(out.c_str(), outLen);
+ _state = RESPONSE_WAIT_ACK;
+ } else if(_contentLength && space >= outLen + _contentLength){
+ out += _content;
+ outLen += _contentLength;
+ _writtenLength += request->client()->write(out.c_str(), outLen);
+ _state = RESPONSE_WAIT_ACK;
+ } else if(space && space < outLen){
+ String partial = out.substring(0, space);
+ _content = out.substring(space) + _content;
+ _contentLength += outLen - space;
+ _writtenLength += request->client()->write(partial.c_str(), partial.length());
+ _state = RESPONSE_CONTENT;
+ } else if(space > outLen && space < (outLen + _contentLength)){
+ size_t shift = space - outLen;
+ outLen += shift;
+ _sentLength += shift;
+ out += _content.substring(0, shift);
+ _content = _content.substring(shift);
+ _writtenLength += request->client()->write(out.c_str(), outLen);
+ _state = RESPONSE_CONTENT;
+ } else {
+ _content = out + _content;
+ _contentLength += outLen;
+ _state = RESPONSE_CONTENT;
+ }
+}
+
+size_t AsyncBasicResponse::_ack(AsyncWebServerRequest *request, size_t len, uint32_t time){
+ (void)time;
+ _ackedLength += len;
+ if(_state == RESPONSE_CONTENT){
+ size_t available = _contentLength - _sentLength;
+ size_t space = request->client()->space();
+ //we can fit in this packet
+ if(space > available){
+ _writtenLength += request->client()->write(_content.c_str(), available);
+ _content = String();
+ _state = RESPONSE_WAIT_ACK;
+ return available;
+ }
+ //send some data, the rest on ack
+ String out = _content.substring(0, space);
+ _content = _content.substring(space);
+ _sentLength += space;
+ _writtenLength += request->client()->write(out.c_str(), space);
+ return space;
+ } else if(_state == RESPONSE_WAIT_ACK){
+ if(_ackedLength >= _writtenLength){
+ _state = RESPONSE_END;
+ }
+ }
+ return 0;
+}
+
+
+/*
+ * Abstract Response
+ * */
+
+AsyncAbstractResponse::AsyncAbstractResponse(AwsTemplateProcessor callback): _callback(callback)
+{
+ // In case of template processing, we're unable to determine real response size
+ if(callback) {
+ _contentLength = 0;
+ _sendContentLength = false;
+ _chunked = true;
+ }
+}
+
+void AsyncAbstractResponse::_respond(AsyncWebServerRequest *request){
+ addHeader("Connection","close");
+ _head = _assembleHead(request->version());
+ _state = RESPONSE_HEADERS;
+ _ack(request, 0, 0);
+}
+
+size_t AsyncAbstractResponse::_ack(AsyncWebServerRequest *request, size_t len, uint32_t time){
+ (void)time;
+ if(!_sourceValid()){
+ _state = RESPONSE_FAILED;
+ request->client()->close();
+ return 0;
+ }
+ _ackedLength += len;
+ size_t space = request->client()->space();
+
+ size_t headLen = _head.length();
+ if(_state == RESPONSE_HEADERS){
+ if(space >= headLen){
+ _state = RESPONSE_CONTENT;
+ space -= headLen;
+ } else {
+ String out = _head.substring(0, space);
+ _head = _head.substring(space);
+ _writtenLength += request->client()->write(out.c_str(), out.length());
+ return out.length();
+ }
+ }
+
+ if(_state == RESPONSE_CONTENT){
+ size_t outLen;
+ if(_chunked){
+ if(space <= 8){
+ return 0;
+ }
+ outLen = space;
+ } else if(!_sendContentLength){
+ outLen = space;
+ } else {
+ outLen = ((_contentLength - _sentLength) > space)?space:(_contentLength - _sentLength);
+ }
+
+ uint8_t *buf = (uint8_t *)malloc(outLen+headLen);
+ if (!buf) {
+ // os_printf("_ack malloc %d failed\n", outLen+headLen);
+ return 0;
+ }
+
+ if(headLen){
+ memcpy(buf, _head.c_str(), _head.length());
+ }
+
+ size_t readLen = 0;
+
+ if(_chunked){
+ // HTTP 1.1 allows leading zeros in chunk length. Or spaces may be added.
+ // See RFC2616 sections 2, 3.6.1.
+ readLen = _fillBufferAndProcessTemplates(buf+headLen+6, outLen - 8);
+ if(readLen == RESPONSE_TRY_AGAIN){
+ free(buf);
+ return 0;
+ }
+ outLen = sprintf((char*)buf+headLen, "%x", readLen) + headLen;
+ while(outLen < headLen + 4) buf[outLen++] = ' ';
+ buf[outLen++] = '\r';
+ buf[outLen++] = '\n';
+ outLen += readLen;
+ buf[outLen++] = '\r';
+ buf[outLen++] = '\n';
+ } else {
+ readLen = _fillBufferAndProcessTemplates(buf+headLen, outLen);
+ if(readLen == RESPONSE_TRY_AGAIN){
+ free(buf);
+ return 0;
+ }
+ outLen = readLen + headLen;
+ }
+
+ if(headLen){
+ _head = String();
+ }
+
+ if(outLen){
+ _writtenLength += request->client()->write((const char*)buf, outLen);
+ }
+
+ if(_chunked){
+ _sentLength += readLen;
+ } else {
+ _sentLength += outLen - headLen;
+ }
+
+ free(buf);
+
+ if((_chunked && readLen == 0) || (!_sendContentLength && outLen == 0) || (!_chunked && _sentLength == _contentLength)){
+ _state = RESPONSE_WAIT_ACK;
+ }
+ return outLen;
+
+ } else if(_state == RESPONSE_WAIT_ACK){
+ if(!_sendContentLength || _ackedLength >= _writtenLength){
+ _state = RESPONSE_END;
+ if(!_chunked && !_sendContentLength)
+ request->client()->close(true);
+ }
+ }
+ return 0;
+}
+
+size_t AsyncAbstractResponse::_readDataFromCacheOrContent(uint8_t* data, const size_t len)
+{
+ // If we have something in cache, copy it to buffer
+ const size_t readFromCache = std::min(len, _cache.size());
+ if(readFromCache) {
+ memcpy(data, _cache.data(), readFromCache);
+ _cache.erase(_cache.begin(), _cache.begin() + readFromCache);
+ }
+ // If we need to read more...
+ const size_t needFromFile = len - readFromCache;
+ const size_t readFromContent = _fillBuffer(data + readFromCache, needFromFile);
+ return readFromCache + readFromContent;
+}
+
+size_t AsyncAbstractResponse::_fillBufferAndProcessTemplates(uint8_t* data, size_t len)
+{
+ if(!_callback)
+ return _fillBuffer(data, len);
+
+ const size_t originalLen = len;
+ len = _readDataFromCacheOrContent(data, len);
+ // Now we've read 'len' bytes, either from cache or from file
+ // Search for template placeholders
+ uint8_t* pTemplateStart = data;
+ while((pTemplateStart < &data[len]) && (pTemplateStart = (uint8_t*)memchr(pTemplateStart, TEMPLATE_PLACEHOLDER, &data[len - 1] - pTemplateStart + 1))) { // data[0] ... data[len - 1]
+ uint8_t* pTemplateEnd = (pTemplateStart < &data[len - 1]) ? (uint8_t*)memchr(pTemplateStart + 1, TEMPLATE_PLACEHOLDER, &data[len - 1] - pTemplateStart) : nullptr;
+ // temporary buffer to hold parameter name
+ uint8_t buf[TEMPLATE_PARAM_NAME_LENGTH + 1];
+ String paramName;
+ // If closing placeholder is found:
+ if(pTemplateEnd) {
+ // prepare argument to callback
+ const size_t paramNameLength = std::min(sizeof(buf) - 1, (unsigned int)(pTemplateEnd - pTemplateStart - 1));
+ if(paramNameLength) {
+ memcpy(buf, pTemplateStart + 1, paramNameLength);
+ buf[paramNameLength] = 0;
+ paramName = String(reinterpret_cast(buf));
+ } else { // double percent sign encountered, this is single percent sign escaped.
+ // remove the 2nd percent sign
+ memmove(pTemplateEnd, pTemplateEnd + 1, &data[len] - pTemplateEnd - 1);
+ len += _readDataFromCacheOrContent(&data[len - 1], 1) - 1;
+ ++pTemplateStart;
+ }
+ } else if(&data[len - 1] - pTemplateStart + 1 < TEMPLATE_PARAM_NAME_LENGTH + 2) { // closing placeholder not found, check if it's in the remaining file data
+ memcpy(buf, pTemplateStart + 1, &data[len - 1] - pTemplateStart);
+ const size_t readFromCacheOrContent = _readDataFromCacheOrContent(buf + (&data[len - 1] - pTemplateStart), TEMPLATE_PARAM_NAME_LENGTH + 2 - (&data[len - 1] - pTemplateStart + 1));
+ if(readFromCacheOrContent) {
+ pTemplateEnd = (uint8_t*)memchr(buf + (&data[len - 1] - pTemplateStart), TEMPLATE_PLACEHOLDER, readFromCacheOrContent);
+ if(pTemplateEnd) {
+ // prepare argument to callback
+ *pTemplateEnd = 0;
+ paramName = String(reinterpret_cast(buf));
+ // Copy remaining read-ahead data into cache
+ _cache.insert(_cache.begin(), pTemplateEnd + 1, buf + (&data[len - 1] - pTemplateStart) + readFromCacheOrContent);
+ pTemplateEnd = &data[len - 1];
+ }
+ else // closing placeholder not found in file data, store found percent symbol as is and advance to the next position
+ {
+ // but first, store read file data in cache
+ _cache.insert(_cache.begin(), buf + (&data[len - 1] - pTemplateStart), buf + (&data[len - 1] - pTemplateStart) + readFromCacheOrContent);
+ ++pTemplateStart;
+ }
+ }
+ else // closing placeholder not found in content data, store found percent symbol as is and advance to the next position
+ ++pTemplateStart;
+ }
+ else // closing placeholder not found in content data, store found percent symbol as is and advance to the next position
+ ++pTemplateStart;
+ if(paramName.length()) {
+ // call callback and replace with result.
+ // Everything in range [pTemplateStart, pTemplateEnd] can be safely replaced with parameter value.
+ // Data after pTemplateEnd may need to be moved.
+ // The first byte of data after placeholder is located at pTemplateEnd + 1.
+ // It should be located at pTemplateStart + numBytesCopied (to begin right after inserted parameter value).
+ const String paramValue(_callback(paramName));
+ const char* pvstr = paramValue.c_str();
+ const unsigned int pvlen = paramValue.length();
+ const size_t numBytesCopied = std::min(pvlen, static_cast(&data[originalLen - 1] - pTemplateStart + 1));
+ // make room for param value
+ // 1. move extra data to cache if parameter value is longer than placeholder AND if there is no room to store
+ if((pTemplateEnd + 1 < pTemplateStart + numBytesCopied) && (originalLen - (pTemplateStart + numBytesCopied - pTemplateEnd - 1) < len)) {
+ _cache.insert(_cache.begin(), &data[originalLen - (pTemplateStart + numBytesCopied - pTemplateEnd - 1)], &data[len]);
+ //2. parameter value is longer than placeholder text, push the data after placeholder which not saved into cache further to the end
+ memmove(pTemplateStart + numBytesCopied, pTemplateEnd + 1, &data[originalLen] - pTemplateStart - numBytesCopied);
+ len = originalLen; // fix issue with truncated data, not sure if it has any side effects
+ } else if(pTemplateEnd + 1 != pTemplateStart + numBytesCopied)
+ //2. Either parameter value is shorter than placeholder text OR there is enough free space in buffer to fit.
+ // Move the entire data after the placeholder
+ memmove(pTemplateStart + numBytesCopied, pTemplateEnd + 1, &data[len] - pTemplateEnd - 1);
+ // 3. replace placeholder with actual value
+ memcpy(pTemplateStart, pvstr, numBytesCopied);
+ // If result is longer than buffer, copy the remainder into cache (this could happen only if placeholder text itself did not fit entirely in buffer)
+ if(numBytesCopied < pvlen) {
+ _cache.insert(_cache.begin(), pvstr + numBytesCopied, pvstr + pvlen);
+ } else if(pTemplateStart + numBytesCopied < pTemplateEnd + 1) { // result is copied fully; if result is shorter than placeholder text...
+ // there is some free room, fill it from cache
+ const size_t roomFreed = pTemplateEnd + 1 - pTemplateStart - numBytesCopied;
+ const size_t totalFreeRoom = originalLen - len + roomFreed;
+ len += _readDataFromCacheOrContent(&data[len - roomFreed], totalFreeRoom) - roomFreed;
+ } else { // result is copied fully; it is longer than placeholder text
+ const size_t roomTaken = pTemplateStart + numBytesCopied - pTemplateEnd - 1;
+ len = std::min(len + roomTaken, originalLen);
+ }
+ }
+ } // while(pTemplateStart)
+ return len;
+}
+
+
+/*
+ * File Response
+ * */
+
+AsyncFileResponse::~AsyncFileResponse(){
+ if(_content)
+ _content.close();
+}
+
+void AsyncFileResponse::_setContentType(const String& path){
+ if (path.endsWith(".html")) _contentType = "text/html";
+ else if (path.endsWith(".htm")) _contentType = "text/html";
+ else if (path.endsWith(".css")) _contentType = "text/css";
+ else if (path.endsWith(".json")) _contentType = "application/json";
+ else if (path.endsWith(".js")) _contentType = "application/javascript";
+ else if (path.endsWith(".png")) _contentType = "image/png";
+ else if (path.endsWith(".gif")) _contentType = "image/gif";
+ else if (path.endsWith(".jpg")) _contentType = "image/jpeg";
+ else if (path.endsWith(".ico")) _contentType = "image/x-icon";
+ else if (path.endsWith(".svg")) _contentType = "image/svg+xml";
+ else if (path.endsWith(".eot")) _contentType = "font/eot";
+ else if (path.endsWith(".woff")) _contentType = "font/woff";
+ else if (path.endsWith(".woff2")) _contentType = "font/woff2";
+ else if (path.endsWith(".ttf")) _contentType = "font/ttf";
+ else if (path.endsWith(".xml")) _contentType = "text/xml";
+ else if (path.endsWith(".pdf")) _contentType = "application/pdf";
+ else if (path.endsWith(".zip")) _contentType = "application/zip";
+ else if(path.endsWith(".gz")) _contentType = "application/x-gzip";
+ else _contentType = "text/plain";
+}
+
+AsyncFileResponse::AsyncFileResponse(FS &fs, const String& path, const String& contentType, bool download, AwsTemplateProcessor callback): AsyncAbstractResponse(callback){
+ _code = 200;
+ _path = path;
+
+ if(!download && !fs.exists(_path) && fs.exists(_path+".gz")){
+ _path = _path+".gz";
+ addHeader("Content-Encoding", "gzip");
+ _callback = nullptr; // Unable to process zipped templates
+ _sendContentLength = true;
+ _chunked = false;
+ }
+
+ _content = fs.open(_path, "r");
+ _contentLength = _content.size();
+
+ if(contentType == "")
+ _setContentType(path);
+ else
+ _contentType = contentType;
+
+ int filenameStart = path.lastIndexOf('/') + 1;
+ char buf[26+path.length()-filenameStart];
+ char* filename = (char*)path.c_str() + filenameStart;
+
+ if(download) {
+ // set filename and force download
+ snprintf(buf, sizeof (buf), "attachment; filename=\"%s\"", filename);
+ } else {
+ // set filename and force rendering
+ snprintf(buf, sizeof (buf), "inline; filename=\"%s\"", filename);
+ }
+ addHeader("Content-Disposition", buf);
+}
+
+AsyncFileResponse::AsyncFileResponse(File content, const String& path, const String& contentType, bool download, AwsTemplateProcessor callback): AsyncAbstractResponse(callback){
+ _code = 200;
+ _path = path;
+
+ if(!download && String(content.name()).endsWith(".gz") && !path.endsWith(".gz")){
+ addHeader("Content-Encoding", "gzip");
+ _callback = nullptr; // Unable to process gzipped templates
+ _sendContentLength = true;
+ _chunked = false;
+ }
+
+ _content = content;
+ _contentLength = _content.size();
+
+ if(contentType == "")
+ _setContentType(path);
+ else
+ _contentType = contentType;
+
+ int filenameStart = path.lastIndexOf('/') + 1;
+ char buf[26+path.length()-filenameStart];
+ char* filename = (char*)path.c_str() + filenameStart;
+
+ if(download) {
+ snprintf(buf, sizeof (buf), "attachment; filename=\"%s\"", filename);
+ } else {
+ snprintf(buf, sizeof (buf), "inline; filename=\"%s\"", filename);
+ }
+ addHeader("Content-Disposition", buf);
+}
+
+size_t AsyncFileResponse::_fillBuffer(uint8_t *data, size_t len){
+ return _content.read(data, len);
+}
+
+/*
+ * Stream Response
+ * */
+
+AsyncStreamResponse::AsyncStreamResponse(Stream &stream, const String& contentType, size_t len, AwsTemplateProcessor callback): AsyncAbstractResponse(callback) {
+ _code = 200;
+ _content = &stream;
+ _contentLength = len;
+ _contentType = contentType;
+}
+
+size_t AsyncStreamResponse::_fillBuffer(uint8_t *data, size_t len){
+ size_t available = _content->available();
+ size_t outLen = (available > len)?len:available;
+ size_t i;
+ for(i=0;iread();
+ return outLen;
+}
+
+/*
+ * Callback Response
+ * */
+
+AsyncCallbackResponse::AsyncCallbackResponse(const String& contentType, size_t len, AwsResponseFiller callback, AwsTemplateProcessor templateCallback): AsyncAbstractResponse(templateCallback) {
+ _code = 200;
+ _content = callback;
+ _contentLength = len;
+ if(!len)
+ _sendContentLength = false;
+ _contentType = contentType;
+ _filledLength = 0;
+}
+
+size_t AsyncCallbackResponse::_fillBuffer(uint8_t *data, size_t len){
+ size_t ret = _content(data, len, _filledLength);
+ if(ret != RESPONSE_TRY_AGAIN){
+ _filledLength += ret;
+ }
+ return ret;
+}
+
+/*
+ * Chunked Response
+ * */
+
+AsyncChunkedResponse::AsyncChunkedResponse(const String& contentType, AwsResponseFiller callback, AwsTemplateProcessor processorCallback): AsyncAbstractResponse(processorCallback) {
+ _code = 200;
+ _content = callback;
+ _contentLength = 0;
+ _contentType = contentType;
+ _sendContentLength = false;
+ _chunked = true;
+ _filledLength = 0;
+}
+
+size_t AsyncChunkedResponse::_fillBuffer(uint8_t *data, size_t len){
+ size_t ret = _content(data, len, _filledLength);
+ if(ret != RESPONSE_TRY_AGAIN){
+ _filledLength += ret;
+ }
+ return ret;
+}
+
+/*
+ * Progmem Response
+ * */
+
+AsyncProgmemResponse::AsyncProgmemResponse(int code, const String& contentType, const uint8_t * content, size_t len, AwsTemplateProcessor callback): AsyncAbstractResponse(callback) {
+ _code = code;
+ _content = content;
+ _contentType = contentType;
+ _contentLength = len;
+ _readLength = 0;
+}
+
+size_t AsyncProgmemResponse::_fillBuffer(uint8_t *data, size_t len){
+ size_t left = _contentLength - _readLength;
+ if (left > len) {
+ memcpy_P(data, _content + _readLength, len);
+ _readLength += len;
+ return len;
+ }
+ memcpy_P(data, _content + _readLength, left);
+ _readLength += left;
+ return left;
+}
+
+
+/*
+ * Response Stream (You can print/write/printf to it, up to the contentLen bytes)
+ * */
+
+AsyncResponseStream::AsyncResponseStream(const String& contentType, size_t bufferSize){
+ _code = 200;
+ _contentLength = 0;
+ _contentType = contentType;
+ _content = new cbuf(bufferSize);
+}
+
+AsyncResponseStream::~AsyncResponseStream(){
+ delete _content;
+}
+
+size_t AsyncResponseStream::_fillBuffer(uint8_t *buf, size_t maxLen){
+ return _content->read((char*)buf, maxLen);
+}
+
+size_t AsyncResponseStream::write(const uint8_t *data, size_t len){
+ if(_started())
+ return 0;
+
+ if(len > _content->room()){
+ size_t needed = len - _content->room();
+ _content->resizeAdd(needed);
+ }
+ size_t written = _content->write((const char*)data, len);
+ _contentLength += written;
+ return written;
+}
+
+size_t AsyncResponseStream::write(uint8_t data){
+ return write(&data, 1);
+}
diff --git a/lib/libesp32/ESPAsyncWebServer/src/WebServer.cpp b/lib/libesp32/ESPAsyncWebServer/src/WebServer.cpp
new file mode 100644
index 000000000..3e2b2e40b
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/src/WebServer.cpp
@@ -0,0 +1,193 @@
+/*
+ Asynchronous WebServer library for Espressif MCUs
+
+ Copyright (c) 2016 Hristo Gochkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+#include "ESPAsyncWebServer.h"
+#include "WebHandlerImpl.h"
+
+bool ON_STA_FILTER(AsyncWebServerRequest *request) {
+ return WiFi.localIP() == request->client()->localIP();
+}
+
+bool ON_AP_FILTER(AsyncWebServerRequest *request) {
+ return WiFi.localIP() != request->client()->localIP();
+}
+
+
+AsyncWebServer::AsyncWebServer(uint16_t port)
+ : _server(port)
+ , _rewrites(AsyncLinkedList([](AsyncWebRewrite* r){ delete r; }))
+ , _handlers(AsyncLinkedList([](AsyncWebHandler* h){ delete h; }))
+{
+ _catchAllHandler = new AsyncCallbackWebHandler();
+ if(_catchAllHandler == NULL)
+ return;
+ _server.onClient([](void *s, AsyncClient* c){
+ if(c == NULL)
+ return;
+ c->setRxTimeout(3);
+ AsyncWebServerRequest *r = new AsyncWebServerRequest((AsyncWebServer*)s, c);
+ if(r == NULL){
+ c->close(true);
+ c->free();
+ delete c;
+ }
+ }, this);
+}
+
+AsyncWebServer::~AsyncWebServer(){
+ reset();
+ end();
+ if(_catchAllHandler) delete _catchAllHandler;
+}
+
+AsyncWebRewrite& AsyncWebServer::addRewrite(AsyncWebRewrite* rewrite){
+ _rewrites.add(rewrite);
+ return *rewrite;
+}
+
+bool AsyncWebServer::removeRewrite(AsyncWebRewrite *rewrite){
+ return _rewrites.remove(rewrite);
+}
+
+AsyncWebRewrite& AsyncWebServer::rewrite(const char* from, const char* to){
+ return addRewrite(new AsyncWebRewrite(from, to));
+}
+
+AsyncWebHandler& AsyncWebServer::addHandler(AsyncWebHandler* handler){
+ _handlers.add(handler);
+ return *handler;
+}
+
+bool AsyncWebServer::removeHandler(AsyncWebHandler *handler){
+ return _handlers.remove(handler);
+}
+
+void AsyncWebServer::begin(){
+ _server.setNoDelay(true);
+ _server.begin();
+}
+
+void AsyncWebServer::end(){
+ _server.end();
+}
+
+#if ASYNC_TCP_SSL_ENABLED
+void AsyncWebServer::onSslFileRequest(AcSSlFileHandler cb, void* arg){
+ _server.onSslFileRequest(cb, arg);
+}
+
+void AsyncWebServer::beginSecure(const char *cert, const char *key, const char *password){
+ _server.beginSecure(cert, key, password);
+}
+#endif
+
+void AsyncWebServer::_handleDisconnect(AsyncWebServerRequest *request){
+ delete request;
+}
+
+void AsyncWebServer::_rewriteRequest(AsyncWebServerRequest *request){
+ for(const auto& r: _rewrites){
+ if (r->match(request)){
+ request->_url = r->toUrl();
+ request->_addGetParams(r->params());
+ }
+ }
+}
+
+void AsyncWebServer::_attachHandler(AsyncWebServerRequest *request){
+ for(const auto& h: _handlers){
+ if (h->filter(request) && h->canHandle(request)){
+ request->setHandler(h);
+ return;
+ }
+ }
+
+ request->addInterestingHeader("ANY");
+ request->setHandler(_catchAllHandler);
+}
+
+
+AsyncCallbackWebHandler& AsyncWebServer::on(const char* uri, WebRequestMethodComposite method, ArRequestHandlerFunction onRequest, ArUploadHandlerFunction onUpload, ArBodyHandlerFunction onBody){
+ AsyncCallbackWebHandler* handler = new AsyncCallbackWebHandler();
+ handler->setUri(uri);
+ handler->setMethod(method);
+ handler->onRequest(onRequest);
+ handler->onUpload(onUpload);
+ handler->onBody(onBody);
+ addHandler(handler);
+ return *handler;
+}
+
+AsyncCallbackWebHandler& AsyncWebServer::on(const char* uri, WebRequestMethodComposite method, ArRequestHandlerFunction onRequest, ArUploadHandlerFunction onUpload){
+ AsyncCallbackWebHandler* handler = new AsyncCallbackWebHandler();
+ handler->setUri(uri);
+ handler->setMethod(method);
+ handler->onRequest(onRequest);
+ handler->onUpload(onUpload);
+ addHandler(handler);
+ return *handler;
+}
+
+AsyncCallbackWebHandler& AsyncWebServer::on(const char* uri, WebRequestMethodComposite method, ArRequestHandlerFunction onRequest){
+ AsyncCallbackWebHandler* handler = new AsyncCallbackWebHandler();
+ handler->setUri(uri);
+ handler->setMethod(method);
+ handler->onRequest(onRequest);
+ addHandler(handler);
+ return *handler;
+}
+
+AsyncCallbackWebHandler& AsyncWebServer::on(const char* uri, ArRequestHandlerFunction onRequest){
+ AsyncCallbackWebHandler* handler = new AsyncCallbackWebHandler();
+ handler->setUri(uri);
+ handler->onRequest(onRequest);
+ addHandler(handler);
+ return *handler;
+}
+
+AsyncStaticWebHandler& AsyncWebServer::serveStatic(const char* uri, fs::FS& fs, const char* path, const char* cache_control){
+ AsyncStaticWebHandler* handler = new AsyncStaticWebHandler(uri, fs, path, cache_control);
+ addHandler(handler);
+ return *handler;
+}
+
+void AsyncWebServer::onNotFound(ArRequestHandlerFunction fn){
+ _catchAllHandler->onRequest(fn);
+}
+
+void AsyncWebServer::onFileUpload(ArUploadHandlerFunction fn){
+ _catchAllHandler->onUpload(fn);
+}
+
+void AsyncWebServer::onRequestBody(ArBodyHandlerFunction fn){
+ _catchAllHandler->onBody(fn);
+}
+
+void AsyncWebServer::reset(){
+ _rewrites.free();
+ _handlers.free();
+
+ if (_catchAllHandler != NULL){
+ _catchAllHandler->onRequest(NULL);
+ _catchAllHandler->onUpload(NULL);
+ _catchAllHandler->onBody(NULL);
+ }
+}
+
diff --git a/lib/libesp32/ESPAsyncWebServer/src/edit.htm b/lib/libesp32/ESPAsyncWebServer/src/edit.htm
new file mode 100644
index 000000000..43d498455
--- /dev/null
+++ b/lib/libesp32/ESPAsyncWebServer/src/edit.htm
@@ -0,0 +1,627 @@
+
+
+
+
+ESP Editor
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lib/libesp32/gpio_viewer/.gitignore b/lib/libesp32/gpio_viewer/.gitignore
new file mode 100644
index 000000000..7f059b39f
--- /dev/null
+++ b/lib/libesp32/gpio_viewer/.gitignore
@@ -0,0 +1,4 @@
+build
+sounds
+secrets.h
+.vscode
\ No newline at end of file
diff --git a/lib/libesp32/gpio_viewer/LICENSE b/lib/libesp32/gpio_viewer/LICENSE
new file mode 100644
index 000000000..c868c9b62
--- /dev/null
+++ b/lib/libesp32/gpio_viewer/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2023 thelastoutpostworkshop
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/lib/libesp32/gpio_viewer/README.md b/lib/libesp32/gpio_viewer/README.md
new file mode 100644
index 000000000..b7291510a
--- /dev/null
+++ b/lib/libesp32/gpio_viewer/README.md
@@ -0,0 +1,94 @@
+# GPIOViewer Arduino Library to see live GPIO Pins on ESP32 boards
+
+**Transforms the way you troubleshoot your microcontroller projects**.
+
+### Youtube Tutorial
+[
](https://youtu.be/UxkOosaNohU)
+
+### Installation Arduino IDE (Version 2)
+>ℹ️ Make sure you have the latest ESP32 boards by Espressif Systems in your Board Manager
+
+- Install the **GPIOViewer Library with the Arduino IDE Library Manager** or Download the [latest release](https://github.com/thelastoutpostworkshop/gpio_viewer/releases/latest) and install the library in the Arduino IDE : `Sketch > Include Library > Add ZIP Library...`
+- Download [ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer) and install the library in the Arduino IDE `Sketch > Include Library > Add ZIP Library...`
+- Install the the [AsyncTCP](https://github.com/dvarrel/AsyncTCP) using the Arduino IDE Library Manager.
+
+### Installation VSCode + PlatformIO
+
+Add the following to your platformio.ini file:
+
+```
+lib_deps =
+ https://github.com/dvarrel/AsyncTCP.git
+ https://github.com/me-no-dev/ESPAsyncWebServer.git
+ https://github.com/thelastoutpostworkshop/gpio_viewer.git
+```
+
+### Usage
+>ℹ️ You can also use get examples provided with the library in the Arduino IDE through the menu `File > Examples > GPIOViewer`
+>ℹ️ You only need to include the library, declare the GPIOViewer and call begin() at the end of your setup, and that's it!
+>ℹ️ The URL to the web GPIO viewer application is printed on the serial monitor
+```c
+#include // Must me the first include in your project
+GPIOViewer gpio_viewer;
+
+void setup()
+{
+ Serial.begin(115200);
+
+ // Comment the next line, If your code aleady include connection to Wifi
+ gpio_viewer.connectToWifi("Your SSID network", "Your WiFi Password");
+ // gpio_viewer.setPort(5555); // You can set the http port, if not set default port is 8080
+
+ // Your own setup code start here
+
+ // Must be at the end of your setup
+ // gpio_viewer.setSamplingInterval(25); // You can set the sampling interval in ms, if not set default is 100ms
+ gpio_viewer.begin();
+}
+```
+>ℹ️ The default HTTP port is **8080** and default sampling interval is **100ms**.
+
+### GPIO Supported
+
+- Digital
+- Analog
+- PWM
+
+### Library Size
+
+- The GPIOViewer Library adds 50 KB to your projects.
+- No worries! All the assets (ex. board images) of the web application are loaded from github pages and don't add to the size of your projects.
+
+### Performance
+- Ensure you have a strong Wifi signal with a good transfer rate. 25ms sampling interval works great on Wifi 6 with 125 Mbps.
+- If you get "ERROR: Too many messages queued" on the Serial Monitor, this means the data is not read fast enough by the web application. The data will still be displayed, but with some latency. Reduce the sampling interval or try to improve your Wifi performance.
+
+### ESP32 Boards Supported
+>ℹ️ You can use the "Generic View" in the GPIO Web Application to see GPIO pin activites live even if your board image is not listed
+>ℹ️ You can also request an ESP32 board image addition by [creating a new issue](https://github.com/thelastoutpostworkshop/gpio_viewer/issues).
+
+
+| Description | Image | Pinout |
+|--------------------|-------------------------------------|-------------------------------------|
+| ESP32 VROOM 32D (38 pins) | !
|
|
+| ESP32 VROOM 32D (30 pins) | !
|
|
+| ESP32 D1 R32 | !
|
|
+| ESP32 C3 Wroom-02 | !
|
|
+| ESP32 Wroom-32UE | !
|
|
+| ESP32 EVB | !
|
|
+| ESP32 S3 Wroom-1 | !
|
|
+| Esp32 S2 Mini V1.0.0 | !
|
|
+| ESP32 POE | !
|
|
+| ESP32 C3 Mini | !
|
|
+| ESP32 Pico Kit v4.1 | !
|
|
+| Lilygo T7 Mini32 v1.5 | !
|
|
+| Freenove ESP32-S3 | !
|
|
+| Nano ESP32 | !
|
|
+| StickLite-V3-ESP32S3 | !
|
|
+| XIAO-ESP32-C3 | !
|
|
+| T-Display S3 AMOLED | !
|
|
+| TinyPICO Nano | !
|
|
+| TinyPico V3 | !
|
|
+| Wemos Lolin32 Lite V1 | !
|
|
+| Wemos D1 Mini ESP32 | !
|
|
+| XIAO-ESP32-C3 | !
|
|
diff --git a/lib/libesp32/gpio_viewer/examples/gpioviewer/gpioviewer.ino b/lib/libesp32/gpio_viewer/examples/gpioviewer/gpioviewer.ino
new file mode 100644
index 000000000..66def80f3
--- /dev/null
+++ b/lib/libesp32/gpio_viewer/examples/gpioviewer/gpioviewer.ino
@@ -0,0 +1,30 @@
+/***
+This example is intended to demonstrate the use of the GPIO Viewer Library.
+
+Tutorial : https://youtu.be/UxkOosaNohU
+Documentation : https://github.com/thelastoutpostworkshop/gpio_viewer
+***/
+
+#include // Must me the first include in your project
+GPIOViewer gpio_viewer;
+
+void setup()
+{
+ Serial.begin(115200);
+
+ // Comment the next line, If your code aleady include connection to Wifi
+ gpio_viewer.connectToWifi("Your SSID network", "Your WiFi Password");
+ // gpio_viewer.setPort(5555); // You can set the http port, if not set default port is 8080
+
+ // Your own setup code start here
+
+ // Must be at the end of your setup
+ // gpio_viewer.setSamplingInterval(25); // You can set the sampling interval in ms, if not set default is 100ms
+ gpio_viewer.begin();
+}
+
+// You don't need to change your loop function
+void loop() {
+
+}
+// The rest of your code here
\ No newline at end of file
diff --git a/lib/libesp32/gpio_viewer/gpio_viewer.ino b/lib/libesp32/gpio_viewer/gpio_viewer.ino
new file mode 100644
index 000000000..24386c2d3
--- /dev/null
+++ b/lib/libesp32/gpio_viewer/gpio_viewer.ino
@@ -0,0 +1,149 @@
+#include "src/gpio_viewer.h"
+#include
+#include // Install this library with the Arduino IDE Library Manager
+#include "secrets.h"
+
+GPIOViewer gpio_viewer;
+
+#define ROTARY_PIN_A 23
+#define ROTARY_PIN_B 22
+#define ROTARY_PUSH_BUTTON 22 // Not used
+SimpleRotary rotary(ROTARY_PIN_A, ROTARY_PIN_B, ROTARY_PUSH_BUTTON);
+
+int test_digital_pins[] = {33, 25, 26};
+const int testDigitalPinsCount = sizeof(test_digital_pins) / sizeof(test_digital_pins[0]);
+int currentLed = 0; // Start with the first LED
+
+const int analogPinsCount = 3;
+int test_analog_pins[analogPinsCount] = {32, 19, 18};
+int analogValue = 0;
+
+const int freq = 200;
+const int resolution = 16;
+
+struct PWM_PINS
+{
+ int pin;
+ int channel;
+ uint16_t level;
+};
+
+PWM_PINS test_pwm_pins[] = {{15, 0}, {2, 1}, {0, 2}, {4, 3}};
+const int testPWMPinsCount = sizeof(test_pwm_pins) / sizeof(test_pwm_pins[0]);
+
+void setup()
+{
+ Serial.begin(115200);
+
+ gpio_viewer.connectToWifi(ssid, password); // If your code aleady include connection to Wifi, you can comment this line
+ // gpio_viewer.setPort(5555); // You can set the http port, if not set default port is 8080
+
+ // Example - Your own setup code start here
+ test1_setup();
+
+ // Must be at the end of your setup
+ gpio_viewer.setSamplingInterval(75); // You can set the sampling interval in ms, if not set, default is 100ms
+ gpio_viewer.begin();
+}
+
+void loop()
+{
+ test1_loop();
+}
+
+void test1_setup()
+{
+ uint16_t amount = 0;
+ for (int i = 0; i < testPWMPinsCount; i++)
+ {
+ amount += (65535 / testPWMPinsCount);
+ ledcSetup(test_pwm_pins[i].channel, freq, resolution);
+ ledcAttachPin(test_pwm_pins[i].pin, test_pwm_pins[i].channel);
+ test_pwm_pins[i].level = amount;
+ }
+ for (int i = 0; i < testDigitalPinsCount; i++)
+ {
+ pinMode(test_digital_pins[i], OUTPUT);
+ digitalWrite(test_digital_pins[i], LOW);
+ }
+ for (int i = 0; i < analogPinsCount; i++)
+ {
+ pinMode(test_analog_pins[i], OUTPUT);
+ }
+ xTaskCreate(readRotaryEncoderTask, // Task function
+ "ReadRotaryEncoder", // Name of the task (for debugging)
+ 2048, // Stack size (bytes)
+ NULL, // Parameter to pass to the function
+ 1, // Task priority
+ NULL);
+}
+void test1_loop()
+{
+ for (int i = 0; i < analogPinsCount; i++)
+ {
+ analogValue += (i * 3);
+ analogWrite(test_analog_pins[i], analogValue++);
+ }
+ for (int i = 0; i < testPWMPinsCount; i++)
+ {
+ ledcWrite(test_pwm_pins[i].channel, test_pwm_pins[i].level);
+ delay(150);
+ }
+ delay(300);
+ for (int i = 0; i < testPWMPinsCount; i++)
+ {
+ ledcWrite(test_pwm_pins[i].channel, test_pwm_pins[i].level / 2);
+ delay(150);
+ }
+ for (int i = 0; i < testDigitalPinsCount; i++)
+ {
+ if (digitalRead(test_digital_pins[i]) == LOW)
+ {
+
+ digitalWrite(test_digital_pins[i], HIGH);
+ }
+ else
+ {
+
+ digitalWrite(test_digital_pins[i], LOW);
+ }
+ }
+ delay(300);
+}
+
+void updateLeds()
+{
+ for (int i = 0; i < testDigitalPinsCount; i++)
+ {
+ digitalWrite(test_digital_pins[i], i == currentLed ? HIGH : LOW);
+ }
+}
+
+void readRotaryEncoderTask(void *pvParameters)
+{
+ for (;;)
+ { // Infinite loop
+ readRotaryEncoder();
+ vTaskDelay(pdMS_TO_TICKS(10)); // Delay for debouncing, adjust as needed
+ }
+}
+
+void readRotaryEncoder(void)
+{
+ byte i;
+ i = rotary.rotate();
+
+ if (i == 1)
+ {
+ currentLed = (currentLed - 1 + testDigitalPinsCount) % testDigitalPinsCount;
+ updateLeds();
+ Serial.println("CounterClockwise");
+ }
+
+ if (i == 2)
+ {
+ currentLed = (currentLed + 1) % testDigitalPinsCount;
+ updateLeds();
+ Serial.println("Clockwise");
+ }
+}
diff --git a/lib/libesp32/gpio_viewer/keywords.txt b/lib/libesp32/gpio_viewer/keywords.txt
new file mode 100644
index 000000000..17719d72c
--- /dev/null
+++ b/lib/libesp32/gpio_viewer/keywords.txt
@@ -0,0 +1,16 @@
+[Keywords]
+#######################################
+# Datatypes (KEYWORD1)
+#######################################
+byte
+boolean
+uint16_t
+int16_t
+int
+enum
+
+#######################################
+# Methods and Functions (KEYWORD2)
+#######################################
+begin
+
diff --git a/lib/libesp32/gpio_viewer/library.properties b/lib/libesp32/gpio_viewer/library.properties
new file mode 100644
index 000000000..c65ff1276
--- /dev/null
+++ b/lib/libesp32/gpio_viewer/library.properties
@@ -0,0 +1,11 @@
+name=GPIOViewer
+version=1.0.4
+author=The Last Outpost Workshop
+maintainer=The Last Outpost Workshop
+sentence=Web Application to view GPIO pins live!
+paragraph=Works ESP32
+category=Other
+keywords=keywords.txt
+url=https://github.com/thelastoutpostworkshop/gpio_viewer
+architectures=esp32
+depends=AsyncTCP
\ No newline at end of file
diff --git a/lib/libesp32/gpio_viewer/src/gpio_viewer.h b/lib/libesp32/gpio_viewer/src/gpio_viewer.h
new file mode 100644
index 000000000..6a4f1a58d
--- /dev/null
+++ b/lib/libesp32/gpio_viewer/src/gpio_viewer.h
@@ -0,0 +1,360 @@
+#ifndef _GPIOVIEWER_
+#define _GPIOVIEWER_
+#ifndef WEBSERVER_H
+// Compatiblity with the Wifi Manager if your using it in your project
+#include