From 44db3f5e6f4d9d3f993f1edf989c814428e9f23f Mon Sep 17 00:00:00 2001 From: "pull[bot]" <39814207+pull[bot]@users.noreply.github.com> Date: Wed, 5 Jun 2024 12:27:39 +0200 Subject: [PATCH] [pull] development from arendst:development (#440) * Berry coc parser keeps order of variables (#21542) * Bugfix: crash when using tjpegd and LVGL (#21544) * prevent crashes when using tjpegd in other places in Tasmota * do not use external tjpegd in Tasmota * Update changelogs * SML: Allow larger offset when using x to ignore bytes (#21535) * Allow larger offset when using x to ignore bytes STW Klagenfurt sends 355 bytes, and the interesting values starts somewhere at position 304. Therefor we need to set a larger uint range to allow more than 255 bytes to ignore. * Update xsns_53_sml.ino --------- Co-authored-by: Theo Arends <11044339+arendst@users.noreply.github.com> * Change GPIOViewer from v1.5.3 to v1.5.4 (No functional change) * Fix GPIO16 as Transmit enable pin (#21269) * Support Levoit Core200s (WIP, Feedback requested) (#21502) * Support Levoit Core 200S Add berry script to support Levoit Core 200S (and possibly other too since levoit offers multiple similar devices) * Core200S: fix comments * forgotten safety check (#21549) * Bump v14.1.0.1 * Berry bytes solidification (#21558) * Berry prepare for bytes() solidification * Berry solidification of bytes objects * Berry solidification of `bytes` instances * Matter support for Air Quality sensors (#21559) * Add default value for `SetOption151` (#21560) * Update changelogs * Remove GPIO_I2S_BCLK_IN, GPIO_I2S_WS_IN * add uTouch settings * uTouch for m5core2 * Berry `input()` returns empty string and does not crash (#21565) --------- Co-authored-by: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Co-authored-by: Christian Baars Co-authored-by: Theo Arends <11044339+arendst@users.noreply.github.com> Co-authored-by: Andreas Doppelhofer Co-authored-by: blenk92 <30472652+blenk92@users.noreply.github.com> Co-authored-by: Christian Baars Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> --- CHANGELOG.md | 26 +- FIRMWARE.md | 2 +- README.md | 2 +- RELEASENOTES.md | 46 +- .../TasmotaSerial-3.6.0/src/TasmotaSerial.cpp | 5 + lib/libesp32/berry/src/be_byteslib.c | 105 +- lib/libesp32/berry/src/be_byteslib.h | 44 + lib/libesp32/berry/src/be_class.h | 10 + lib/libesp32/berry/src/be_constobj.h | 45 + lib/libesp32/berry/src/be_object.h | 1 + lib/libesp32/berry/src/be_solidifylib.c | 32 +- lib/libesp32/berry/tools/coc/bytes_build.py | 41 + lib/libesp32/berry/tools/coc/coc | 7 + lib/libesp32/berry/tools/coc/coc_parser.py | 14 + lib/libesp32/berry/tools/coc/hash_map.py | 25 +- .../berry_matter/src/be_matter_module.c | 3 + .../berry_matter/src/embedded/Matter_IM.be | 2 +- .../src/embedded/Matter_Plugin_0.be | 30 +- .../src/embedded/Matter_Plugin_1_Device.be | 37 + .../src/embedded/Matter_Plugin_2_Light1.be | 8 +- .../src/embedded/Matter_Plugin_2_OnOff.be | 6 +- .../src/embedded/Matter_Plugin_2_Sensor.be | 6 +- .../Matter_Plugin_2_Sensor_Air_Quality.be | 219 ++ .../Matter_Plugin_2_Sensor_Contact.be | 13 +- .../Matter_Plugin_2_Sensor_Occupancy.be | 13 +- ...tter_Plugin_3_Bridge_Sensor_Air_Quality.be | 112 + .../src/embedded/Matter_Plugin_3_Light2.be | 8 +- .../src/embedded/Matter_Plugin_3_Light3.be | 12 +- .../Matter_Plugin_4_Bridge_Sensor_Flow.be | 23 +- .../Matter_Plugin_4_Bridge_Sensor_Humidity.be | 23 +- ...tter_Plugin_4_Bridge_Sensor_Illuminance.be | 23 +- .../Matter_Plugin_4_Bridge_Sensor_Pressure.be | 23 +- .../Matter_Plugin_4_Bridge_Sensor_Temp.be | 23 +- .../embedded/Matter_Plugin_5_Bridge_Light2.be | 31 +- .../embedded/Matter_Plugin_5_Bridge_Light3.be | 40 +- ...Matter_Plugin_9_Virt_Sensor_Air_Quality.be | 34 + .../berry_matter/src/embedded/Matter_TLV.be | 14 + .../berry_matter/src/embedded/Matter_UI.be | 2 + .../src/solidify/solidified_Matter_IM.h | 52 +- .../src/solidify/solidified_Matter_Plugin_0.h | 1284 ++++---- .../solidified_Matter_Plugin_1_Device.h | 118 +- ...ified_Matter_Plugin_2_Sensor_Air_Quality.h | 816 +++++ ...olidified_Matter_Plugin_2_Sensor_Contact.h | 58 +- ...idified_Matter_Plugin_2_Sensor_Occupancy.h | 58 +- ...atter_Plugin_3_Bridge_Sensor_Air_Quality.h | 404 +++ .../solidified_Matter_Plugin_3_Light2.h | 39 +- .../solidified_Matter_Plugin_3_Light3.h | 27 +- ...ified_Matter_Plugin_4_Bridge_Sensor_Flow.h | 92 +- ...d_Matter_Plugin_4_Bridge_Sensor_Humidity.h | 92 +- ...atter_Plugin_4_Bridge_Sensor_Illuminance.h | 92 +- ...d_Matter_Plugin_4_Bridge_Sensor_Pressure.h | 92 +- ...ified_Matter_Plugin_4_Bridge_Sensor_Temp.h | 90 +- ...solidified_Matter_Plugin_5_Bridge_Light2.h | 125 +- ...solidified_Matter_Plugin_5_Bridge_Light3.h | 150 +- ..._Matter_Plugin_9_Virt_Sensor_Air_Quality.h | 27 + .../src/solidify/solidified_Matter_TLV.h | 2851 +++++++++-------- .../src/solidify/solidified_Matter_UI.h | 2 +- .../solidify/solidified_Matter_zz_Device.h | 77 +- lib/libesp32/berry_tasmota/src/be_port.cpp | 5 +- lib/libesp32_lvgl/lvgl/src/libs/tjpgd/tjpgd.c | 3 + lib/libesp32_lvgl/lvgl/src/libs/tjpgd/tjpgd.h | 2 + tasmota/berry/drivers/Core200S.be | 832 +++++ tasmota/displaydesc/Lanbon_L8_display.ini | 16 +- tasmota/displaydesc/M5stack_core2_display.ini | 16 +- tasmota/include/tasmota_template.h | 12 +- tasmota/include/tasmota_version.h | 2 +- tasmota/my_user_config.h | 7 + tasmota/tasmota_support/settings.ino | 3 + .../xdrv_121_gpioviewer.ino | 5 +- .../xdrv_42_0_i2s_audio_idf51.ino | 4 + tasmota/tasmota_xsns_sensor/xsns_53_sml.ino | 2 +- 71 files changed, 5307 insertions(+), 3258 deletions(-) create mode 100644 lib/libesp32/berry/src/be_byteslib.h create mode 100644 lib/libesp32/berry/tools/coc/bytes_build.py create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Sensor_Air_Quality.be create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Bridge_Sensor_Air_Quality.be create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_Plugin_9_Virt_Sensor_Air_Quality.be create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Sensor_Air_Quality.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Bridge_Sensor_Air_Quality.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_9_Virt_Sensor_Air_Quality.h create mode 100644 tasmota/berry/drivers/Core200S.be diff --git a/CHANGELOG.md b/CHANGELOG.md index cd5643e83e14..88c52a8ba20f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,17 +3,37 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - Development -## [14.0.0.4] +## [14.1.0.1] ### Added -- SML FastExit for binary SML parsing (#21497) +- Berry solidification of `bytes` instances (#21558) +- Matter support for Air Quality sensors (#21559) ### Breaking Changed ### Changed + +### Fixed +- Berry `input()` returns empty string and does not crash + +### Removed + +## [Released] + +## [14.1.0] 20240603 +- Release Rachel + +## [14.0.0.4] 20240603 +### Added +- SML FastExit for binary SML parsing (#21497) + +### Changed +- GPIOViewer from v1.5.3 to v1.5.4 (No functional change) - TCP bridge increased baudrate selection (#21528) +- Berry coc parser keeps order of variables (#21542) ### Fixed - uDisplay Parallel display on Core3 (#21529) +- LVGL exception when using tjpegd (#21544) ### Removed - Deprecated code from drivers, `USE_TTGO_WATCH` and `USE_M5STACK_CORE2` (#21533) @@ -73,8 +93,6 @@ All notable changes to this project will be documented in this file. ### Removed - Support of old insecure fingerprint algorithm. Deprecated since v8.4.0 (#21417) -## [Released] - ## [14.0.0] 20240515 - Release Rodney diff --git a/FIRMWARE.md b/FIRMWARE.md index 3e3bc594d858..91fa979239cd 100644 --- a/FIRMWARE.md +++ b/FIRMWARE.md @@ -18,7 +18,7 @@ See [CHANGELOG.md](https://github.com/arendst/Tasmota/blob/development/tasmota/C ## Development -[![Dev Version](https://img.shields.io/badge/development%20version-v14.0.x.x-blue.svg)](https://github.com/arendst/Tasmota) +[![Dev Version](https://img.shields.io/badge/development%20version-v14.1.x.x-blue.svg)](https://github.com/arendst/Tasmota) [![Download Dev](https://img.shields.io/badge/download-development-yellow.svg)](http://ota.tasmota.com/tasmota/) [![Tasmota CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+CI%22) [![Tasmota ESP32 CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20ESP32%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+ESP32+CI%22) diff --git a/README.md b/README.md index 746d7c4f24e7..b33390c3beb4 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Firmware binaries can be downloaded from http://ota.tasmota.com/tasmota/release/ ## Development -[![Dev Version](https://img.shields.io/badge/development%20version-v14.0.x.x-blue.svg)](https://github.com/arendst/Tasmota) +[![Dev Version](https://img.shields.io/badge/development%20version-v14.1.x.x-blue.svg)](https://github.com/arendst/Tasmota) [![Download Dev](https://img.shields.io/badge/download-development-yellow.svg)](http://ota.tasmota.com/tasmota/) [![Tasmota CI](https://github.com/arendst/Tasmota/actions/workflows/build_all_the_things.yml/badge.svg)](https://github.com/arendst/Tasmota/actions/workflows/build_all_the_things.yml) [![Build_development](https://github.com/arendst/Tasmota/actions/workflows/Tasmota_build_devel.yml/badge.svg)](https://github.com/arendst/Tasmota/actions/workflows/Tasmota_build_devel.yml) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 0d4791e2b3a6..0a917c20e822 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -40,7 +40,7 @@ This release will be supported from ESP32/Arduino library Core version **3.0.0** Support of ESP8266 Core versions before 2.7.6 and ESP32 Core versions before 3.0.0 have been removed. -### Known issues with v14.0.0 +### Known issues with v14.1.0 Due to the change from ESP32 Arduino Core2/IDF4 to Arduino Core3/IDF5 not all functionality has been restored. The following features are known not to work on ESP32: - Wifi Range Extender [#21200](https://github.com/arendst/Tasmota/issues/21200) @@ -80,7 +80,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-14.0.0 +- http://ota.tasmota.com/tasmota/release-14.1.0 The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmota.com/tasmota/release/tasmota.bin.gz`` @@ -109,7 +109,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-14.0.0 +- https://ota.tasmota.com/tasmota32/release-14.1.0 The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasmota.com/tasmota32/release/tasmota32.bin`` @@ -119,47 +119,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 v14.0.0.4 +## Changelog v14.1.0.1 ### Added -- Optional command ``WebRun`` (as WebQuery extension) [#21364](https://github.com/arendst/Tasmota/issues/21364) -- Support for Knx dimmer and color [#21434](https://github.com/arendst/Tasmota/issues/21434) -- SML FastExit for binary SML parsing [#21497](https://github.com/arendst/Tasmota/issues/21497) -- Berry add reuse of methods for interface-like code reuse [#21500](https://github.com/arendst/Tasmota/issues/21500) -- Support for Matter 1.3 Water leak detectors [#21456](https://github.com/arendst/Tasmota/issues/21456) - -### Breaking Changed +- Berry solidification of `bytes` instances [#21558](https://github.com/arendst/Tasmota/issues/21558) +- Matter support for Air Quality sensors [#21559](https://github.com/arendst/Tasmota/issues/21559) ### Changed -- ESP32 Core3 platform update from 2024.05.11 to 2024.05.13 [#21524](https://github.com/arendst/Tasmota/issues/21524) -- GPIOViewer from v1.5.2 to v1.5.3 -- On universal display remove default backlight power if a PWM channel is used for backlight -- TCP bridge increased baudrate selection [#21528](https://github.com/arendst/Tasmota/issues/21528) -- Support W5500 SPI ethernet using four SPI GPIOs only without IRQ and RESET -- ESP32 compiler option from `target-align` to `no-target-align` [#21407](https://github.com/arendst/Tasmota/issues/21407) -- ESP32 I2S audio improvements [#21433](https://github.com/arendst/Tasmota/issues/21433) -- Berry binary compiled with gcc [#21426](https://github.com/arendst/Tasmota/issues/21426) -- Berry allow easy solidification of external Berry [#21430](https://github.com/arendst/Tasmota/issues/21430) -- Berry change internal storage of parent class for methods [#21490](https://github.com/arendst/Tasmota/issues/21490) ### Fixed -- Domoticz re-subscribe on MQTT reconnect. Regression from v13.4.0.3 [#21281](https://github.com/arendst/Tasmota/issues/21281) -- Watchdog restart or freeze if ``displaytext`` is more than 128 characters [#21401](https://github.com/arendst/Tasmota/issues/21401) -- Wrong timeout in `WebQuery` and `webclient` since Core3 [#21442](https://github.com/arendst/Tasmota/issues/21442) -- uDisplay Parallel display on Core3 [#21529](https://github.com/arendst/Tasmota/issues/21529) -- UfsServe watchdog on large folder [#21486](https://github.com/arendst/Tasmota/issues/21486) -- SML compile error when median-filter is disabled [#21495](https://github.com/arendst/Tasmota/issues/21495) -- Hydreon RG15 malformed JSON string [#21508](https://github.com/arendst/Tasmota/issues/21508) -- Telegram TLS fingerprint, remove CA validation [#21514](https://github.com/arendst/Tasmota/issues/21514) -- Zigbee crash when removing `ZbName` [#21449](https://github.com/arendst/Tasmota/issues/21449) -- Avoid connection errors when switching to safeboot to upload OTA firmware [#21428](https://github.com/arendst/Tasmota/issues/21428) -- ESP32 slow response when using UDP as in emulation [#21470](https://github.com/arendst/Tasmota/issues/21470) -- ESP32 BLE fix scanning [#21451](https://github.com/arendst/Tasmota/issues/21451) -- ESP32 I2S multiple fixes [#21511](https://github.com/arendst/Tasmota/issues/21511) -- I2S APLL not supported on all SOCs [#21483](https://github.com/arendst/Tasmota/issues/21483) -- Webradio crash with invalid url [#21446](https://github.com/arendst/Tasmota/issues/21446) -- Berry Leds matrix alternate more and error about 'bri' attribute [#21431](https://github.com/arendst/Tasmota/issues/21431) -- Matter auto-fix IPv6 link-local zone id when network reconnects [#21494](https://github.com/arendst/Tasmota/issues/21494) ### Removed -- Support of old insecure fingerprint algorithm. Deprecated since v8.4.0 [#21417](https://github.com/arendst/Tasmota/issues/21417) -- Deprecated code from drivers, `USE_TTGO_WATCH` and `USE_M5STACK_CORE2` [#21533](https://github.com/arendst/Tasmota/issues/21533) diff --git a/lib/default/TasmotaSerial-3.6.0/src/TasmotaSerial.cpp b/lib/default/TasmotaSerial-3.6.0/src/TasmotaSerial.cpp index 72bf19e1daf3..3871fc33bcdd 100644 --- a/lib/default/TasmotaSerial-3.6.0/src/TasmotaSerial.cpp +++ b/lib/default/TasmotaSerial-3.6.0/src/TasmotaSerial.cpp @@ -136,7 +136,12 @@ bool TasmotaSerial::isValidGPIOpin(int pin) { } void TasmotaSerial::setTransmitEnablePin(int tx_enable_pin) { +#ifdef ESP8266 + if ((tx_enable_pin > -1) && (isValidGPIOpin(tx_enable_pin) || (16 == tx_enable_pin))) { +#endif +#ifdef ESP32 if ((tx_enable_pin > -1) && isValidGPIOpin(tx_enable_pin)) { +#endif m_tx_enable_pin = tx_enable_pin; pinMode(m_tx_enable_pin, OUTPUT); digitalWrite(m_tx_enable_pin, LOW); diff --git a/lib/libesp32/berry/src/be_byteslib.c b/lib/libesp32/berry/src/be_byteslib.c index 1789dca94d1a..5c50a36ba47b 100644 --- a/lib/libesp32/berry/src/be_byteslib.c +++ b/lib/libesp32/berry/src/be_byteslib.c @@ -16,28 +16,7 @@ #include "be_constobj.h" #include #include - -#define BYTES_DEFAULT_SIZE 28 // default pre-reserved size for buffer (keep 4 bytes for len/size) -#define BYTES_OVERHEAD 4 // bytes overhead to be added when allocating (used to store len and size) -#define BYTES_HEADROOM 8 // keep a natural headroom of 8 bytes when resizing - -#define BYTES_SIZE_FIXED -1 // if size is -1, then the bytes object cannot be reized -#define BYTES_SIZE_MAPPED -2 // if size is -2, then the bytes object is mapped to a fixed memory region, i.e. cannot be resized - -#define BYTES_RESIZE_ERROR "attribute_error" -#define BYTES_RESIZE_MESSAGE "bytes object size if fixed and cannot be resized" -/* be_raise(vm, BYTES_RESIZE_ERROR, BYTES_RESIZE_MESSAGE); */ - -typedef struct buf_impl { - int32_t size; // size in bytes of the buffer - int32_t len; // current size of the data in buffer. Invariant: len <= size - uint8_t *bufptr; // the actual data - int32_t prev_size; // previous value read from the instance - int32_t prev_len; // previous value read from the instance - uint8_t *prev_bufptr; - bbool fixed; // is size fixed? (actually encoded as negative size) - bbool mapped; -} buf_impl; +#include "be_byteslib.h" /******************************************************************** ** Base64 lib from https://github.com/Densaugeo/base64_arduino @@ -481,7 +460,16 @@ static void buf_add_hex(buf_impl* attr, const char *hex, size_t len) ********************************************************************/ /* if the bufptr is null, don't try to dereference and raise an exception instead */ -static void check_ptr(bvm *vm, buf_impl* attr) { +static void check_ptr(bvm *vm, const buf_impl* attr) { + if (!attr->bufptr) { + be_raise(vm, "value_error", "operation not allowed on pointer"); + } +} + +static void check_ptr_modifiable(bvm *vm, const buf_impl* attr) { + if (attr->solidified) { + be_raise(vm, "value_error", BYTES_READ_ONLY_MESSAGE); + } if (!attr->bufptr) { be_raise(vm, "value_error", "operation not allowed on pointer"); } @@ -504,10 +492,14 @@ buf_impl m_read_attributes(bvm *vm, int idx) int32_t signed_size = be_toint(vm, -1); attr.fixed = bfalse; attr.mapped = bfalse; + attr.solidified = bfalse; if (signed_size < 0) { if (signed_size == BYTES_SIZE_MAPPED) { attr.mapped = btrue; } + if (signed_size == BYTES_SIZE_SOLIDIFIED) { + attr.solidified = btrue; + } signed_size = attr.len; attr.fixed = btrue; } @@ -516,10 +508,18 @@ buf_impl m_read_attributes(bvm *vm, int idx) return attr; } +static void m_assert_not_readlonly(bvm *vm, const buf_impl* attr) +{ + if (attr->solidified) { + be_raise(vm, "value_error", BYTES_READ_ONLY_MESSAGE); + } +} + /* Write back attributes to the bytes instance, only if values changed after loading */ /* stack item 1 must contain the instance */ void m_write_attributes(bvm *vm, int rel_idx, const buf_impl * attr) { + m_assert_not_readlonly(vm, attr); int idx = be_absindex(vm, rel_idx); if (attr->bufptr != attr->prev_bufptr) { be_pushcomptr(vm, attr->bufptr); @@ -549,6 +549,7 @@ void m_write_attributes(bvm *vm, int rel_idx, const buf_impl * attr) // buf_impl * bytes_realloc(bvm *vm, buf_impl *oldbuf, int32_t size) void bytes_realloc(bvm *vm, buf_impl * attr, int32_t size) { + m_assert_not_readlonly(vm, attr); if (!attr->fixed && size < 4) { size = 4; } if (size > vm->bytesmaxsize) { size = vm->bytesmaxsize; } size_t oldsize = attr->bufptr ? attr->size : 0; @@ -590,7 +591,7 @@ static void bytes_new_object(bvm *vm, size_t size) static int m_init(bvm *vm) { int argc = be_top(vm); - buf_impl attr = { 0, 0, NULL, 0, -1, NULL, bfalse, bfalse }; /* initialize prev_values to invalid to force a write at the end */ + buf_impl attr = { 0, 0, NULL, 0, -1, NULL, bfalse, bfalse, bfalse }; /* initialize prev_values to invalid to force a write at the end */ /* size cannot be 0, len cannot be negative */ const char * hex_in = NULL; @@ -713,7 +714,7 @@ buf_impl bytes_check_data(bvm *vm, size_t add_size) { return attr; } -static size_t tohex(char * out, size_t outsz, const uint8_t * in, size_t insz) { +size_t be_bytes_tohex(char * out, size_t outsz, const uint8_t * in, size_t insz) { static const char * hex = "0123456789ABCDEF"; const uint8_t * pin = in; char * pout = out; @@ -745,7 +746,7 @@ static int m_tostring(bvm *vm) char * hex_out = be_pushbuffer(vm, hex_len); size_t l = be_strlcpy(hex_out, "bytes('", hex_len); - l += tohex(&hex_out[l], hex_len - l, attr.bufptr, len); + l += be_bytes_tohex(&hex_out[l], hex_len - l, attr.bufptr, len); if (truncated) { l += be_strlcpy(&hex_out[l], "...", hex_len - l); } @@ -767,7 +768,7 @@ static int m_tohex(bvm *vm) size_t hex_len = len * 2 + 1; char * hex_out = be_pushbuffer(vm, hex_len); - size_t l = tohex(hex_out, hex_len, attr.bufptr, len); + size_t l = be_bytes_tohex(hex_out, hex_len, attr.bufptr, len); be_pushnstring(vm, hex_out, l); /* make escape string from buffer */ be_remove(vm, -2); /* remove buffer */ @@ -795,7 +796,7 @@ static int m_fromstring(bvm *vm) const char *s = be_tostring(vm, 2); int32_t len = be_strlen(vm, 2); /* calling be_strlen to support null chars in string */ buf_impl attr = bytes_check_data(vm, 0); - check_ptr(vm, &attr); + check_ptr_modifiable(vm, &attr); if (attr.fixed && attr.len != len) { be_raise(vm, BYTES_RESIZE_ERROR, BYTES_RESIZE_MESSAGE); } @@ -823,7 +824,7 @@ static int m_add(bvm *vm) { int argc = be_top(vm); buf_impl attr = bytes_check_data(vm, 4); /* we reserve 4 bytes anyways */ - check_ptr(vm, &attr); + check_ptr_modifiable(vm, &attr); if (attr.fixed) { be_raise(vm, BYTES_RESIZE_ERROR, BYTES_RESIZE_MESSAGE); } if (argc >= 2 && be_isint(vm, 2)) { int32_t v = be_toint(vm, 2); @@ -949,7 +950,7 @@ static int m_set(bvm *vm) { int argc = be_top(vm); buf_impl attr = bytes_check_data(vm, 0); /* we reserve 4 bytes anyways */ - check_ptr(vm, &attr); + check_ptr_modifiable(vm, &attr); if (argc >=3 && be_isint(vm, 2) && be_isint(vm, 3)) { int32_t idx = be_toint(vm, 2); int32_t value = be_toint(vm, 3); @@ -985,7 +986,7 @@ static int m_setfloat(bvm *vm) { int argc = be_top(vm); buf_impl attr = bytes_check_data(vm, 0); /* we reserve 4 bytes anyways */ - check_ptr(vm, &attr); + check_ptr_modifiable(vm, &attr); if (argc >=3 && be_isint(vm, 2) && (be_isint(vm, 3) || be_isreal(vm, 3))) { int32_t idx = be_toint(vm, 2); float val_f = (float) be_toreal(vm, 3); @@ -1011,7 +1012,7 @@ static int m_addfloat(bvm *vm) { int argc = be_top(vm); buf_impl attr = bytes_check_data(vm, 4); /* we reserve 4 bytes anyways */ - check_ptr(vm, &attr); + check_ptr_modifiable(vm, &attr); if (attr.fixed) { be_raise(vm, BYTES_RESIZE_ERROR, BYTES_RESIZE_MESSAGE); } if (argc >=2 && (be_isint(vm, 2) || be_isreal(vm, 2))) { float val_f = (float) be_toreal(vm, 2); @@ -1040,7 +1041,7 @@ static int m_setbytes(bvm *vm) { int argc = be_top(vm); buf_impl attr = bytes_check_data(vm, 0); /* we reserve 4 bytes anyways */ - check_ptr(vm, &attr); + check_ptr_modifiable(vm, &attr); if (argc >=3 && be_isint(vm, 2) && (be_isbytes(vm, 3))) { int32_t idx = be_toint(vm, 2); size_t from_len_total; @@ -1084,7 +1085,7 @@ static int m_reverse(bvm *vm) { int argc = be_top(vm); buf_impl attr = bytes_check_data(vm, 0); /* we reserve 4 bytes anyways */ - check_ptr(vm, &attr); + check_ptr_modifiable(vm, &attr); int32_t idx = 0; /* start from index 0 */ int32_t len = attr.len; /* entire len */ @@ -1135,7 +1136,7 @@ static int m_setitem(bvm *vm) { int argc = be_top(vm); buf_impl attr = bytes_check_data(vm, 0); /* we reserve 4 bytes anyways */ - check_ptr(vm, &attr); + check_ptr_modifiable(vm, &attr); if (argc >=3 && be_isint(vm, 2) && be_isint(vm, 3)) { int index = be_toint(vm, 2); int val = be_toint(vm, 3); @@ -1153,7 +1154,7 @@ static int m_item(bvm *vm) { int argc = be_top(vm); buf_impl attr = bytes_check_data(vm, 0); /* we reserve 4 bytes anyways */ - check_ptr(vm, &attr); + check_ptr_modifiable(vm, &attr); if (argc >=2 && be_isint(vm, 2)) { /* single byte */ int index = be_toint(vm,2); if (index < 0) { @@ -1215,6 +1216,7 @@ static int m_resize(bvm *vm) { int argc = be_top(vm); buf_impl attr = m_read_attributes(vm, 1); + check_ptr_modifiable(vm, &attr); if (argc <= 1 || !be_isint(vm, 2)) { be_raise(vm, "type_error", "size must be of type 'int'"); @@ -1237,6 +1239,7 @@ static int m_resize(bvm *vm) static int m_clear(bvm *vm) { buf_impl attr = m_read_attributes(vm, 1); + check_ptr_modifiable(vm, &attr); if (attr.fixed) { be_raise(vm, BYTES_RESIZE_ERROR, BYTES_RESIZE_MESSAGE); } attr.len = 0; m_write_attributes(vm, 1, &attr); /* update instance */ @@ -1293,7 +1296,7 @@ static int m_connect(bvm *vm) { int argc = be_top(vm); buf_impl attr = m_read_attributes(vm, 1); - check_ptr(vm, &attr); + check_ptr_modifiable(vm, &attr); if (attr.fixed) { be_raise(vm, BYTES_RESIZE_ERROR, BYTES_RESIZE_MESSAGE); } if (argc >= 2 && (be_isbytes(vm, 2) || be_isint(vm, 2) || be_isstring(vm, 2))) { if (be_isint(vm, 2)) { @@ -1390,7 +1393,7 @@ static int m_fromb64(bvm *vm) int32_t bin_len = decode_base64_length((unsigned char*)s); /* do a first pass to calculate the buffer size */ buf_impl attr = m_read_attributes(vm, 1); - check_ptr(vm, &attr); + check_ptr_modifiable(vm, &attr); if (attr.fixed && attr.len != bin_len) { be_raise(vm, BYTES_RESIZE_ERROR, BYTES_RESIZE_MESSAGE); } @@ -1429,7 +1432,7 @@ static int m_fromhex(bvm *vm) int32_t bin_len = (s_len - from) / 2; buf_impl attr = m_read_attributes(vm, 1); - check_ptr(vm, &attr); + check_ptr_modifiable(vm, &attr); if (attr.fixed && attr.len != bin_len) { be_raise(vm, BYTES_RESIZE_ERROR, BYTES_RESIZE_MESSAGE); } @@ -1483,6 +1486,18 @@ static int m_is_mapped(bvm *vm) be_return(vm); } +/* + * Returns `btrue` if the buffer is solidified and read only + * + * `isreadonly() -> bool` + */ +static int m_is_readonly(bvm *vm) +{ + buf_impl attr = m_read_attributes(vm, 1); + be_pushbool(vm, attr.solidified); + be_return(vm); +} + /* * Change the pointer to a mapped buffer. * @@ -1497,6 +1512,9 @@ static int m_change_buffer(bvm *vm) int argc = be_top(vm); if (argc >= 2 && be_iscomptr(vm, 2)) { buf_impl attr = m_read_attributes(vm, 1); + if (attr.solidified) { + be_raise(vm, "value_error", BYTES_READ_ONLY_MESSAGE); + } if (!attr.mapped) { be_raise(vm, "type_error", "bytes() object must be mapped"); } @@ -1764,11 +1782,12 @@ void be_load_byteslib(bvm *vm) { static const bnfuncinfo members[] = { { ".p", NULL }, - { ".size", NULL }, { ".len", NULL }, + { ".size", NULL }, { "_buffer", m_buffer }, { "_change_buffer", m_change_buffer }, { "ismapped", m_is_mapped }, + { "isreadonly", m_is_readonly }, { "init", m_init }, { "deinit", m_deinit }, { "tostring", m_tostring }, @@ -1810,14 +1829,18 @@ void be_load_byteslib(bvm *vm) be_regclass(vm, "bytes", members); } #else + +#include "../generate/be_const_bytes_def.h" + /* @const_object_info_begin class be_class_bytes (scope: global, name: bytes) { .p, var - .size, var .len, var + .size, var _buffer, func(m_buffer) _change_buffer, func(m_change_buffer) ismapped, func(m_is_mapped) + isreadonly, func(m_is_readonly) init, func(m_init) deinit, func(m_deinit) tostring, func(m_tostring) diff --git a/lib/libesp32/berry/src/be_byteslib.h b/lib/libesp32/berry/src/be_byteslib.h new file mode 100644 index 000000000000..bcf98d125b8f --- /dev/null +++ b/lib/libesp32/berry/src/be_byteslib.h @@ -0,0 +1,44 @@ +/******************************************************************** +** Copyright (c) 2018-2020 Guan Wenliang - Stephan Hadinger +** This file is part of the Berry default interpreter. +** skiars@qq.com, https://github.com/Skiars/berry +** See Copyright Notice in the LICENSE file or at +** https://github.com/Skiars/berry/blob/master/LICENSE +********************************************************************/ +#ifndef __BE_BYTESLIB_H +#define __BE_BYTESLIB_H + +#include "be_object.h" + +#define BYTES_DEFAULT_SIZE 28 /* default pre-reserved size for buffer (keep 4 bytes for len/size) */ +#define BYTES_OVERHEAD 4 /* bytes overhead to be added when allocating (used to store len and size) */ +#define BYTES_HEADROOM 8 /* keep a natural headroom of 8 bytes when resizing */ + +#define BYTES_SIZE_FIXED -1 /* if size is -1, then the bytes object cannot be reized */ +#define BYTES_SIZE_MAPPED -2 /* if size is -2, then the bytes object is mapped to a fixed memory region, i.e. cannot be resized */ +#define BYTES_SIZE_SOLIDIFIED -3 /* is size is -3, then the bytes object is solidified and cannot be resized nor modified */ + +#define BYTES_RESIZE_ERROR "attribute_error" +#define BYTES_RESIZE_MESSAGE "bytes object size if fixed and cannot be resized" +#define BYTES_READ_ONLY_MESSAGE "bytes object is read only" +/* be_raise(vm, BYTES_RESIZE_ERROR, BYTES_RESIZE_MESSAGE); */ + +typedef struct buf_impl { + int32_t size; // size in bytes of the buffer + int32_t len; // current size of the data in buffer. Invariant: len <= size + uint8_t *bufptr; // the actual data + int32_t prev_size; // previous value read from the instance + int32_t prev_len; // previous value read from the instance + uint8_t *prev_bufptr; + bbool fixed; // is size fixed? (actually encoded as negative size) + bbool mapped; + bbool solidified; +} buf_impl; + +size_t be_bytes_tohex(char * out, size_t outsz, const uint8_t * in, size_t insz); + +#if BE_USE_PRECOMPILED_OBJECT +#include "../generate/be_const_bytes.h" +#endif + +#endif diff --git a/lib/libesp32/berry/src/be_class.h b/lib/libesp32/berry/src/be_class.h index f80ca87991d1..12f317b5ff40 100644 --- a/lib/libesp32/berry/src/be_class.h +++ b/lib/libesp32/berry/src/be_class.h @@ -49,6 +49,16 @@ struct binstance { bvalue members[1]; /* members variable data field */ }; +/* special structure accepting 3 instance variables used only for bytes() solidification */ +struct binstance_arg3 { + bcommon_header; + struct binstance *super; + struct binstance *sub; + bclass *_class; + bgcobject *gray; /* for gc gray list */ + bvalue members[3]; /* members variable data field */ +}; + bclass* be_newclass(bvm *vm, bstring *name, bclass *super); void be_class_compress(bvm *vm, bclass *c); int be_class_attribute(bvm *vm, bclass *c, bstring *attr); diff --git a/lib/libesp32/berry/src/be_constobj.h b/lib/libesp32/berry/src/be_constobj.h index 34245050a28e..f478b315010b 100644 --- a/lib/libesp32/berry/src/be_constobj.h +++ b/lib/libesp32/berry/src/be_constobj.h @@ -19,6 +19,7 @@ extern "C" { #include "be_class.h" #include "be_string.h" #include "be_module.h" +#include "be_byteslib.h" #ifndef __cplusplus @@ -27,6 +28,25 @@ extern "C" { .type = (_t), \ .marked = GC_CONST +#define be_define_const_bytes(_name, ...) \ + const uint8_t be_const_bin_##_name[] = { __VA_ARGS__ } + +#define be_const_bytes_instance(_bytes) { \ + .v.c = ( \ + & (const binstance_arg3) { \ + be_const_header(BE_INSTANCE), \ + .super = NULL, \ + .sub = NULL, \ + ._class = (bclass*) &be_class_bytes, \ + .members = { \ + be_const_comptr(&be_const_bin_##_bytes), \ + be_const_int(sizeof(#_bytes) / 2), \ + be_const_int(BYTES_SIZE_SOLIDIFIED) \ + } \ + }), \ + .type = BE_INSTANCE \ +} + #define be_define_const_str_weak(_name, _s, _len) \ const bcstring be_const_str_##_name = { \ .next = NULL, \ @@ -232,6 +252,27 @@ const bntvmodule_t be_native_module(_module) = { \ .members = _members \ } +#define be_nested_simple_instance_1_arg(_class_ptr, arg0) \ + & (const binstance) { \ + be_const_header(BE_INSTANCE), \ + .super = NULL, \ + .sub = NULL, \ + ._class = (bclass*) _class_ptr, \ + .members = { arg0 } \ + } + + +/* only instances with no super and no sub instance are supported */ +/* primarily for `list` and `map`*/ +#define be_nested_simple_instance_3_args(_class_ptr, arg0, arg1, arg2) \ + & (const binstance_arg3) { \ + be_const_header(BE_INSTANCE), \ + .super = NULL, \ + .sub = NULL, \ + ._class = (bclass*) _class_ptr, \ + .members = { arg0, arg1, arg2 } \ + } + #define be_nested_map(_size, _slots) \ & (const bmap) { \ be_const_header(BE_MAP), \ @@ -298,6 +339,9 @@ const bntvmodule_t be_native_module(_module) = { \ #else +#define be_define_const_bytes(_name, ...) \ + const uint8_t be_const_bin_##_name[] = { __VA_ARGS__ } + #define be_define_const_str_weak(_name, _s, _len) \ const bcstring be_const_str_##_name = { \ NULL, \ @@ -440,6 +484,7 @@ const bntvmodule_t be_native_module_##_module = { \ /* provide pointers to map and list classes for solidified code */ extern const bclass be_class_list; extern const bclass be_class_map; +extern const bclass be_class_bytes; #ifdef __cplusplus } diff --git a/lib/libesp32/berry/src/be_object.h b/lib/libesp32/berry/src/be_object.h index e386cfa25491..d479f9b1004e 100644 --- a/lib/libesp32/berry/src/be_object.h +++ b/lib/libesp32/berry/src/be_object.h @@ -62,6 +62,7 @@ typedef struct bclosure bclosure; typedef struct bntvclos bntvclos; typedef struct bclass bclass; typedef struct binstance binstance; +typedef struct binstance_arg3 binstance_arg3; typedef struct blist blist; typedef struct bmap bmap; typedef struct bupval bupval; diff --git a/lib/libesp32/berry/src/be_solidifylib.c b/lib/libesp32/berry/src/be_solidifylib.c index 78d5c6b4181d..5691dce5ecd8 100644 --- a/lib/libesp32/berry/src/be_solidifylib.c +++ b/lib/libesp32/berry/src/be_solidifylib.c @@ -17,6 +17,7 @@ #include "be_decoder.h" #include "be_sys.h" #include "be_mem.h" +#include "be_byteslib.h" #include #include #include @@ -24,6 +25,7 @@ extern const bclass be_class_list; extern const bclass be_class_map; +extern const bclass be_class_bytes; #if BE_USE_SOLIDIFY_MODULE #include @@ -288,20 +290,32 @@ static void m_solidify_bvalue(bvm *vm, bbool str_literal, const bvalue * value, bclass * cl = ins->_class; if (ins->super || ins->sub) { be_raise(vm, "internal_error", "instance must not have a super/sub class"); - } else if (cl->nvar != 1) { - be_raise(vm, "internal_error", "instance must have only one instance variable"); } else if ((cl != &be_class_map && cl != &be_class_list) || 1) { // TODO const char * cl_ptr = ""; if (cl == &be_class_map) { cl_ptr = "map"; } - if (cl == &be_class_list) { cl_ptr = "list"; } - logfmt("be_const_simple_instance(be_nested_simple_instance(&be_class_%s, {\n", cl_ptr); - if (cl == &be_class_map) { - logfmt(" be_const_map( * "); + else if (cl == &be_class_list) { cl_ptr = "list"; } + else if (cl == &be_class_bytes) { cl_ptr = "bytes"; } + else { be_raise(vm, "internal_error", "unsupported class"); } + + if (cl == &be_class_bytes) { + const void * bufptr = var_toobj(&ins->members[0]); + int32_t len = var_toint(&ins->members[1]); + size_t hex_len = len * 2 + 1; + + char * hex_out = be_pushbuffer(vm, hex_len); + be_bytes_tohex(hex_out, hex_len, bufptr, len); + logfmt("be_const_bytes_instance(%s)", hex_out); + be_pop(vm, 1); } else { - logfmt(" be_const_list( * "); + logfmt("be_const_simple_instance(be_nested_simple_instance(&be_class_%s, {\n", cl_ptr); + if (cl == &be_class_map) { + logfmt(" be_const_map( * "); + } else { + logfmt(" be_const_list( * "); + } + m_solidify_bvalue(vm, str_literal, &ins->members[0], prefixname, key, fout); + logfmt(" ) } ))"); } - m_solidify_bvalue(vm, str_literal, &ins->members[0], prefixname, key, fout); - logfmt(" ) } ))"); } } break; diff --git a/lib/libesp32/berry/tools/coc/bytes_build.py b/lib/libesp32/berry/tools/coc/bytes_build.py new file mode 100644 index 000000000000..ab266f0af9a3 --- /dev/null +++ b/lib/libesp32/berry/tools/coc/bytes_build.py @@ -0,0 +1,41 @@ +import json + +class bytes_build: + def __init__(self, map): + self.map = map.copy() + + def build(self, path): + prefix = path + "/be_const_bytes" + self.writefile(prefix + "_def.h", self.build_bytes_def()) + self.writefile(prefix + ".h", self.build_bytes_ext()) + + def writefile(self, filename, text): + buf = "" + try: + with open(filename) as f: + buf = f.read() + except FileNotFoundError: + pass + if buf != text: + with open(filename, "w") as f: + f.write(text) + + def build_bytes_def(self): + ostr = "" + ostr += "/* binary arrays */\n" + ostr += "be_define_const_bytes(,);\n" + for k in self.map: + ostr += "be_define_const_bytes(" + ostr += k + ", " + ", ".join( [ "0x" + k[i:i+2] for i in range(0, len(k), 2)] ) + ostr += ");\n" + + return ostr + + def build_bytes_ext(self): + ostr = "" + ostr += "/* extern binary arrays */\n" + ostr += "extern const uint8_t be_const_bin_[];\n" + for k in self.map: + ostr += "extern const uint8_t be_const_bin_" + k + "[];\n" + + return ostr \ No newline at end of file diff --git a/lib/libesp32/berry/tools/coc/coc b/lib/libesp32/berry/tools/coc/coc index b80d0ac08eba..ffc833433808 100755 --- a/lib/libesp32/berry/tools/coc/coc +++ b/lib/libesp32/berry/tools/coc/coc @@ -4,6 +4,7 @@ import re import os from coc_parser import * from str_build import * +from bytes_build import * from block_builder import * from macro_table import * @@ -20,6 +21,7 @@ class builder: self.strmap = {} self.strmap_weak = {} self.strmap_long = {} + self.bytesmap = {} self.macro = macro_table() for path in self.config: @@ -30,6 +32,9 @@ class builder: sb = str_build(self.strmap, self.strmap_weak, self.strmap_long) sb.build(self.output) + + sbytes = bytes_build(self.bytesmap) + sbytes.build(self.output) def parse_file(self, filename): if re.search(r"\.(h|c|cc|cpp)$", filename): @@ -45,6 +50,8 @@ class builder: self.strmap_weak[s] = 0 for s in parser.strtab_long: self.strmap_long[s] = 0 + for s in parser.bintab: + self.bytesmap[s] = 0 for obj in parser.objects: builder = block_builder(obj, self.macro) for s in builder.strtab: diff --git a/lib/libesp32/berry/tools/coc/coc_parser.py b/lib/libesp32/berry/tools/coc/coc_parser.py index 68c81a2baa9f..7319dc337cd3 100644 --- a/lib/libesp32/berry/tools/coc/coc_parser.py +++ b/lib/libesp32/berry/tools/coc/coc_parser.py @@ -23,10 +23,12 @@ def __init__(self, text): self.strtab = set() self.strtab_weak = set() self.strtab_long = set() + self.bintab = set() self.text = text self.parsers = { "@const_object_info_begin": self.parse_object, "be_const_str_": self.parse_string, + "be_const_bytes_instance(": self.parse_bin, "be_const_key(": self.parse_string, "be_nested_str(": self.parse_string, "be_const_key_weak(": self.parse_string_weak, @@ -77,6 +79,7 @@ def parse_char_continue(self, c, necessary = False): def parse_word(self): self.skip_space() r = re.match(r"\w+", self.text) + if not r: return None self.text = self.text[r.end(0):] return r[0] @@ -120,6 +123,7 @@ def parse_object(self): def parse_string(self): if not self.text[0].isalnum() and self.text[0] != '_': return # do not proceed, maybe false positive in solidify ident = self.parse_word() + if not ident: return literal = unescape_operator(ident) if not literal in self.strtab: self.strtab.add(literal) @@ -128,6 +132,7 @@ def parse_string(self): def parse_string_weak(self): if not self.text[0].isalnum() and self.text[0] != '_': return # do not proceed, maybe false positive in solidify ident = self.parse_word() + if not ident: return literal = unescape_operator(ident) if not literal in self.strtab: self.strtab_weak.add(literal) @@ -136,10 +141,19 @@ def parse_string_weak(self): def parse_string_long(self): if not self.text[0].isalnum() and self.text[0] != '_': return # do not proceed, maybe false positive in solidify ident = self.parse_word() + if not ident: return literal = unescape_operator(ident) if not literal in self.strtab: self.strtab_long.add(literal) + def parse_bin(self): + ident = self.parse_word() + if not ident: return + if not re.fullmatch(r"[0-9A-Za-z]*", ident): return + if not ident in self.bintab: + self.bintab.add(ident) + # print(f"str '{ident}' -> {literal}") + ################################################################################# # Parse a block of definition like module, class... ################################################################################# diff --git a/lib/libesp32/berry/tools/coc/hash_map.py b/lib/libesp32/berry/tools/coc/hash_map.py index 9d3da5365066..c842c9e0f322 100644 --- a/lib/libesp32/berry/tools/coc/hash_map.py +++ b/lib/libesp32/berry/tools/coc/hash_map.py @@ -27,6 +27,13 @@ def __init__(self, map): self.bucket = [] self.resize(2) + var_count = 0 + # replace any 'var' by its slot number + for (key, value) in map.items(): + if value == "var": + map[key] = var_count + var_count += 1 + for key in sorted(map.keys()): self.insert(key, map[key]) @@ -115,27 +122,21 @@ def insert(self, key, value): # Compute entries in the hash for modules or classes ################################################################################# # return a list (entiry, var_count) - def entry_modify(self, ent, var_count): + def entry_modify(self, ent): ent.key = escape_operator(ent.key) - if ent.value == "var": - ent.value = "be_const_var(" + str(var_count) + ")" - var_count += 1 + if isinstance(ent.value, int): + ent.value = "be_const_var(" + str(ent.value) + ")" else: ent.value = "be_const_" + ent.value - return (ent, var_count) + return ent # generate the final map def entry_list(self): l = [] - var_count = 0 self.resize(self.count) for it in self.bucket: - (ent, var_count) = self.entry_modify(it, var_count) - # print(f"ent={ent} var_count={var_count}") - # # ex: ent= var_count=0 - # # ex: ent= var_count=0 - l.append(ent) + l.append(self.entry_modify(it)) return l def var_count(self): @@ -143,7 +144,7 @@ def var_count(self): self.resize(self.count) for it in self.bucket: - if it.value == "var": count += 1 + if isinstance(it.value, int): count += 1 return count if __name__ == '__main__': diff --git a/lib/libesp32/berry_matter/src/be_matter_module.c b/lib/libesp32/berry_matter/src/be_matter_module.c index 3d7233f48391..c87cb24eedee 100644 --- a/lib/libesp32/berry_matter/src/be_matter_module.c +++ b/lib/libesp32/berry_matter/src/be_matter_module.c @@ -229,6 +229,8 @@ extern const bclass be_class_Matter_TLV; // need to declare it upfront because #include "solidify/solidified_Matter_Plugin_1_Device.h" #include "solidify/solidified_Matter_Plugin_2_OnOff.h" #include "solidify/solidified_Matter_Plugin_9_Virt_OnOff.h" +#include "solidify/solidified_Matter_Plugin_2_Sensor_Air_Quality.h" +#include "solidify/solidified_Matter_Plugin_9_Virt_Sensor_Air_Quality.h" #include "solidify/solidified_Matter_Plugin_3_Light0.h" #include "solidify/solidified_Matter_Plugin_9_Virt_Light0.h" #include "solidify/solidified_Matter_Plugin_2_Light1.h" @@ -271,6 +273,7 @@ extern const bclass be_class_Matter_TLV; // need to declare it upfront because #include "solidify/solidified_Matter_Plugin_3_Bridge_Sensor_Occupancy.h" #include "solidify/solidified_Matter_Plugin_3_Bridge_Sensor_Contact.h" #include "solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Flow.h" +#include "solidify/solidified_Matter_Plugin_3_Bridge_Sensor_Air_Quality.h" #include "solidify/solidified_Matter_Plugin_3_Bridge_Sensor_Waterleak.h" #include "solidify/solidified_Matter_Plugin_z_All.h" #include "solidify/solidified_Matter_zz_Device.h" diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_IM.be b/lib/libesp32/berry_matter/src/embedded/Matter_IM.be index 1e4ca0a781f7..d0977b242a5b 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_IM.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_IM.be @@ -830,7 +830,7 @@ class Matter_IM tasmota.log(format("MTR: >Subscribe (%6i) %s (min=%i, max=%i, keep=%i) sub=%i fabric_filtered=%s", msg.session.local_session_id, attr_req.concat(" "), sub.min_interval, sub.max_interval, query.keep_subscriptions ? 1 : 0, sub.subscription_id, query.fabric_filtered), 3) if query.event_requests != nil && size(query.event_requests) > 0 - tasmota.log(f"MTR: >Subscribe (%6i) event_requests_size={size(query.event_requests)}", 3) + tasmota.log(f"MTR: >Subscribe ({msg.session.local_session_id:6i}) event_requests_size={size(query.event_requests)}", 3) end var ret = self._inner_process_read_request(msg.session, query, msg, true #-no_log-#) diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_0.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_0.be index d8315c3ecd04..8f89f7d3ff78 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_0.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_0.be @@ -480,10 +480,38 @@ class Matter_Plugin # The map is pre-cleaned and contains only keys declared in # `self.UPDATE_COMMANDS` with the adequate case # (no need to handle case-insensitive) - def update_virtual(payload_json) + def update_virtual(payload) # pass end + ####################################################################### + # _parse_update_virtual: parse a single value out of MtrUpdate JSON + # + # Used internally by `update_virtual` + # + # Args + # payload: the native payload (converted from JSON) from MtrUpdate + # key: key name in the JSON payload to read from, do nothing if key does not exist or content is `null` + # old_val: previous value, used to detect a change or return the value unchanged + # type_func: type enforcer for value, typically `int`, `bool`, `str`, `number`, `real` + # cluster/attribute: in case the value has change, publish a change to cluster/attribute + # + # Returns: + # `old_val` if key does not exist, JSON value is `null`, or value is unchanged + # or new value from JSON (which is the new shadow value) + # + def _parse_update_virtual(payload, key, old_val, type_func, cluster, attribute) + var val = payload.find(key) + if (val != nil) + val = type_func(val) + if (val != old_val) + self.attribute_updated(cluster, attribute) + end + return val + end + return old_val + end + end matter.Plugin = Matter_Plugin diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Device.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Device.be index 619646386b33..94d0145bf1be 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Device.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Device.be @@ -200,9 +200,46 @@ class Matter_Plugin_Device : Matter_Plugin # sensors _stats_json_inner("shadow_contact", "Contact") _stats_json_inner("shadow_occupancy", "Occupancy") + + # air quality + _stats_json_inner("shadow_air_quality", "AirQuality") + _stats_json_inner("shadow_co2", "CO2") + _stats_json_inner("shadow_pm1", "PM1") + _stats_json_inner("shadow_pm2_5", "PM2.5") + _stats_json_inner("shadow_pm10", "PM10") + _stats_json_inner("shadow_tvoc", "TVOC") + # print(ret) return ret end + ####################################################################### + # _parse_sensor_entry: internal helper function + # + # Used internally by `update_virtual` + # + # Args + # payload: the native payload (converted from JSON) from MtrUpdate + # key: key name in the JSON payload to read from, do nothing if key does not exist or content is `null` + # type_func: type enforcer for value, typically `int`, `bool`, `str`, `number`, `real` + # old_val: previous value, used to detect a change or return the value unchanged + # cluster/attribute: in case the value has change, publish a change to cluster/attribute + # + # Returns: + # `old_val` if key does not exist, JSON value is `null`, or value is unchanged + # or new value from JSON (which is the new shadow value) + # + def _parse_sensor_entry(payload, key, old_val, type_func, cluster, attribute) + var val = payload.find(key) + if (val != nil) + val = type_func(val) + if val != old_val + self.attribute_updated(cluster, attribute) # CurrentPositionTiltPercent100ths + end + return val + end + return old_val + end + end matter.Plugin_Device = Matter_Plugin_Device diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Light1.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Light1.be index ab6de67fee6d..2b0e4225514e 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Light1.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Light1.be @@ -230,16 +230,16 @@ class Matter_Plugin_Light1 : Matter_Plugin_Device # update_virtual # # Update internal state for virtual devices - def update_virtual(payload_json) - var val_onoff = payload_json.find("Power") - var val_bri = payload_json.find("Bri") + def update_virtual(payload) + var val_onoff = payload.find("Power") + var val_bri = payload.find("Bri") if val_bri != nil self.set_bri(int(val_bri), val_onoff) return # don't call super() because we already handeld 'Power' elif val_onoff != nil self.set_onoff(bool(val_onoff)) end - super(self).update_virtual(payload_json) + super(self).update_virtual(payload) end end diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_OnOff.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_OnOff.be index 89f3a5430612..0c9dc1edbea9 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_OnOff.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_OnOff.be @@ -149,12 +149,12 @@ class Matter_Plugin_OnOff : Matter_Plugin_Device # update_virtual # # Update internal state for virtual devices - def update_virtual(payload_json) - var val_onoff = payload_json.find("Power") + def update_virtual(payload) + var val_onoff = payload.find("Power") if val_onoff != nil self.set_onoff(bool(val_onoff)) end - super(self).update_virtual(payload_json) + super(self).update_virtual(payload) end end 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 a702a11af00e..f2b2e7f3f6ea 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 @@ -93,8 +93,8 @@ class Matter_Plugin_Sensor : Matter_Plugin_Device # update_virtual # # Update internal state for virtual devices - def update_virtual(payload_json) - var val = payload_json.find(self.JSON_NAME) + def update_virtual(payload) + var val = payload.find(self.JSON_NAME) if val != nil if type(val) == 'bool' val = int(val) end @@ -103,7 +103,7 @@ class Matter_Plugin_Sensor : Matter_Plugin_Device self.shadow_value = val end end - super(self).update_virtual(payload_json) + super(self).update_virtual(payload) end end diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Sensor_Air_Quality.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Sensor_Air_Quality.be new file mode 100644 index 000000000000..42af254014b4 --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Sensor_Air_Quality.be @@ -0,0 +1,219 @@ +# +# Matter_Plugin_Sensor_Air_Quality.be - implements the behavior for a Air_Quality sensor +# +# 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 . +# + +import matter + +# Matter plug-in for core behavior + +#@ solidify:Matter_Plugin_Sensor_Air_Quality,weak + +class Matter_Plugin_Sensor_Air_Quality : Matter_Plugin_Device + static var TYPE = "airquality" # name of the plug-in in json + static var DISPLAY_NAME = "Air Quality" # display name of the plug-in + static var ARG = "airquality" # additional argument name (or empty if none) + static var ARG_HINT = "Device key (ex: SCD40)" +# static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type + static var JSON_NAME = "AirQuality" # Name of the sensor attribute in JSON payloads + static var UPDATE_TIME = 30000 # update every 30 s + static var UPDATE_COMMANDS = matter.UC_LIST(_class, "AirQuality", "CO2", "PM1", "PM2.5", "PM10", "TVOC", "NO2") + static var CLUSTERS = matter.consolidate_clusters(_class, { + 0x005B: [0], # Air Quality - no writable + 0x040D: [0,1,2,8,9], # Carbon Dioxide Concentration Measurement + 0x042C: [0,1,2,8,9], # PM1 Concentration Measurement + 0x042A: [0,1,2,8,9], # PM2.5 Concentration Measurement + 0x042D: [0,1,2,8,9], # PM10 Concentration Measurement + 0x042E: [0,1,2,8,9], # TVOC Total Volatile Organic Compounds Concentration Measurement + 0x0413: [0,1,2,8,9], # Nitrogen Dioxide Concentration Measurement + }) + + static var TYPES = { 0x002C: 1 } # Air Quality, rev 1 + + var prefix # key prefix in JSON + var shadow_air_quality # Human readable air quality index + # 0: Unknown + # 1: Good + # 4: Poor + # var shadow_pb0_3 + # var shadow_pb0_5 + # var shadow_pb1 + # var shadow_pb2_5 + # var shadow_pb5 + # var shadow_pb10 + var shadow_pm1 + var shadow_pm2_5 + # var shadow_pm5 + var shadow_pm10 + var shadow_co2 + # var shadow_eco2 + var shadow_no2 + var shadow_tvoc + + ############################################################# + # Constructor + def init(device, endpoint, config) + super(self).init(device, endpoint, config) + self.shadow_air_quality = false + end + + ############################################################# + # parse_configuration + # + # Parse configuration map + def parse_configuration(config) + self.prefix = str(config.find(self.ARG)) + end + + + ############################################################# + # parse sensor + # + # parse the output from `ShutterPosition` + # Ex: `{"Shutter1":{"Position":50,"Direction":0,"Target":50,"Tilt":30}}` + def _parse_sensor_entry(v, key, old_val, cluster, attribute) + var val = v.find(key) + if (val != nil) + if val != old_val + self.attribute_updated(cluster, attribute) # CurrentPositionTiltPercent100ths + end + return val + end + return old_val + end + # + def parse_sensors(payload) + var v = payload.find(self.prefix) + if (v != nil) + # CO2 + self.shadow_co2 = self._parse_sensor_entry(v, "CarbonDioxide", self.shadow_co2, number, 0x040D, 0x0000) + # PM1 + self.shadow_pm1 = self._parse_sensor_entry(v, "PM1", self.shadow_pm1, number, 0x042C, 0x0000) + # PM2.5 + self.shadow_pm2_5 = self._parse_sensor_entry(v, "PM2.5", self.shadow_pm2_5, number, 0x042A, 0x0000) + # PM10 + self.shadow_pm10 = self._parse_sensor_entry(v, "PM10", self.shadow_pm10, number, 0x042D, 0x0000) + # TVOC + self.shadow_tvoc = self._parse_sensor_entry(v, "TVOC", self.shadow_tvoc, number, 0x042E, 0x0000) + # NO2 + self.shadow_no2 = self._parse_sensor_entry(v, "NO2", self.shadow_no2, number, 0x0413, 0x0000) + end + super(self).parse_sensors(payload) # parse other shutter values + end + + ############################################################# + # read an attribute + # + def read_attribute(session, ctx, tlv_solo) + var TLV = matter.TLV + var cluster = ctx.cluster + var attribute = ctx.attribute + var ret + + # mutualize code for all values + # Args + # shadow_value: value of the shadow for the type + # unit: unit of value, `0`=PPM if not specified + # + # Returns + # `nil`: no attribute match + # : TLV value + def handle_value(shadow_value, unit) + if (unit == nil) unit = 0 end # default unit is `0` = PPM + if attribute == 0x0000 # ---------- Measured­ Value / float ---------- + if shadow_value != nil + return tlv_solo.set(TLV.FLOAT, shadow_value) + else + return tlv_solo.set(TLV.NULL, nil) + end + elif attribute == 0x0001 # ---------- MinMeasured Value / float ---------- + return tlv_solo.set(TLV.NULL, nil) + elif attribute == 0x0002 # ---------- MaxMeasured Value / float ---------- + return tlv_solo.set(TLV.NULL, nil) + elif attribute == 0x0008 # ---------- MeasurementUnit / u8 ---------- + return tlv_solo.set(TLV.U1, unit) + elif attribute == 0x0009 # ---------- MeasurementMedium / u8 ---------- + return tlv_solo.set(TLV.U1, 0) # 0 = Air + elif attribute == 0xFFFC # ---------- FeatureMap / map32 ---------- + return tlv_solo.set(TLV.U4, 1) # MEA = NumericMeasurement + end + return nil + end + + # ==================================================================================================== + if cluster == 0x005B # ========== Air Quality ========== + if attribute == 0x0000 # ---------- AirQuality / U8 ---------- + if self.shadow_air_quality != nil + return tlv_solo.set(TLV.U1, self.shadow_air_quality) + else + return tlv_solo.set(TLV.NULL, nil) + end + # elif attribute == 0xFFFC # ---------- FeatureMap / map32 ---------- + # return tlv_solo.set(TLV.U4, 0) # + end + + # ==================================================================================================== + elif cluster == 0x040D # ========== Carbon Dioxide Concentration Measurement ========== + if (ret := handle_value(self.shadow_co2)) + return ret + end + # ==================================================================================================== + elif cluster == 0x042C # ========== PM1 Concentration Measurement ========== + if (ret := handle_value(self.shadow_pm1)) + return ret + end + # ==================================================================================================== + elif cluster == 0x042A # ========== PM2.5 Concentration Measurement ========== + if (ret := handle_value(self.shadow_pm2_5)) + return ret + end + # ==================================================================================================== + elif cluster == 0x042D # ========== PM10 Concentration Measurement ========== + if (ret := handle_value(self.shadow_pm10)) + return ret + end + # ==================================================================================================== + elif cluster == 0x042E # ========== TVOC ========== + if (ret := handle_value(self.shadow_tvoc)) + return ret + end + # ==================================================================================================== + elif cluster == 0x0413 # ========== NO2 ========== + if (ret := handle_value(self.shadow_no2)) + return ret + end + + end + return super(self).read_attribute(session, ctx, tlv_solo) + end + + ####################################################################### + # update_virtual + # + # Update internal state for virtual devices + def update_virtual(payload) + self.shadow_air_quality = self._parse_update_virtual(payload, "AirQuality", number, self.shadow_air_quality, 0x005B, 0x0000) + self.shadow_co2 = self._parse_update_virtual(payload, "CO2", self.shadow_co2, number, 0x040D, 0x0000) + self.shadow_pm1 = self._parse_update_virtual(payload, "PM1", self.shadow_pm1, number, 0x042C, 0x0000) + self.shadow_pm2_5 = self._parse_update_virtual(payload, "PM2.5", self.shadow_pm2_5, number, 0x042A, 0x0000) + self.shadow_pm10 = self._parse_update_virtual(payload, "PM10", self.shadow_pm10, number, 0x042D, 0x0000) + self.shadow_tvoc = self._parse_update_virtual(payload, "TVOC", self.shadow_tvoc, number, 0x042E, 0x0000) + super(self).update_virtual(payload) + end + +end +matter.Plugin_Sensor_Air_Quality = Matter_Plugin_Sensor_Air_Quality 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 b7d683039e75..a6c2f71939b4 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 @@ -102,16 +102,9 @@ class Matter_Plugin_Sensor_Contact : Matter_Plugin_Device # update_virtual # # Update internal state for virtual devices - def update_virtual(payload_json) - var val_onoff = payload_json.find("Contact") - if val_onoff != nil - val_onoff = bool(val_onoff) - if self.shadow_contact != val_onoff - self.attribute_updated(0x0045, 0x0000) - self.shadow_contact = val_onoff - end - end - super(self).update_virtual(payload_json) + def update_virtual(payload) + self.shadow_contact = self._parse_update_virtual(payload, "Contact", self.shadow_contact, bool, 0x0045, 0x0000) + super(self).update_virtual(payload) end end diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Sensor_Occupancy.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Sensor_Occupancy.be index 2d9f09323fae..fbc6bf84b09e 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Sensor_Occupancy.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Sensor_Occupancy.be @@ -106,16 +106,9 @@ class Matter_Plugin_Sensor_Occupancy : Matter_Plugin_Device # update_virtual # # Update internal state for virtual devices - def update_virtual(payload_json) - var val_onoff = payload_json.find("Occupancy") - if val_onoff != nil - val_onoff = bool(val_onoff) - if self.shadow_occupancy != val_onoff - self.attribute_updated(0x0406, 0x0000) - self.shadow_occupancy = val_onoff - end - end - super(self).update_virtual(payload_json) + def update_virtual(payload) + self.val_onoff = self._parse_update_virtual(payload, "Occupancy", self.val_onoff, bool, 0x0406, 0x0000) + super(self).update_virtual(payload) end end diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Bridge_Sensor_Air_Quality.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Bridge_Sensor_Air_Quality.be new file mode 100644 index 000000000000..b0515eb9e1e2 --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Bridge_Sensor_Air_Quality.be @@ -0,0 +1,112 @@ +# +# Matter_Plugin_Bridge_Sensor_Contact.be - implements Air Quality Sensor via HTTP to Tasmota +# +# 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 . +# + +import matter + +# Matter plug-in for core behavior + +#@ solidify:Matter_Plugin_Bridge_Sensor_Air_Quality,weak + +class Matter_Plugin_Bridge_Sensor_Air_Quality : Matter_Plugin_Bridge_HTTP + static var TYPE = "http_airquality" # name of the plug-in in json + static var DISPLAY_NAME = "Air Quality" # display name of the plug-in + static var ARG = "airquality" # additional argument name (or empty if none) + static var ARG_HINT = "Sensor Model" +# static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type + static var UPDATE_TIME = 5000 # update every 5s + static var UPDATE_CMD = "Status 8" # command to send for updates + + static var CLUSTERS = matter.consolidate_clusters(_class, { + 0x005B: [0], # Air Quality - no writable + 0x040D: [0,1,2,8,9], # Carbon Dioxide Concentration Measurement + 0x042C: [0,1,2,8,9], # PM1 Concentration Measurement + 0x042A: [0,1,2,8,9], # PM2.5 Concentration Measurement + 0x042D: [0,1,2,8,9], # PM10 Concentration Measurement + 0x042E: [0,1,2,8,9], # TVOC Total Volatile Organic Compounds Concentration Measurement + 0x0413: [0,1,2,8,9], # Nitrogen Dioxide Concentration Measurement + }) + + static var TYPES = { 0x002C: 1 } # Air Quality, rev 1 + + var prefix # key prefix in JSON + var shadow_air_quality # Human readable air quality index + # 0: Unknown + # 1: Good + # 4: Poor + # var shadow_pb0_3 + # var shadow_pb0_5 + # var shadow_pb1 + # var shadow_pb2_5 + # var shadow_pb5 + # var shadow_pb10 + var shadow_pm1 + var shadow_pm2_5 + # var shadow_pm5 + var shadow_pm10 + var shadow_co2 + # var shadow_eco2 + var shadow_no2 + var shadow_tvoc + + ############################################################# + # Constructor + def init(device, endpoint, arguments) + super(self).init(device, endpoint, arguments) + self.prefix = str(arguments.find(self.ARG)) + end + + ############################################################# + # Stub for updating shadow values (local copies of what we published to the Matter gateway) + # + # This call is synnchronous and blocking. + def parse_update(data, index) + if index == 8 # Status 8 + var values = data.find(self.prefix) + end + end + + ############################################################# + # read an attribute + # + def read_attribute = matter.Plugin_Sensor_Air_Quality.read_attribute + + ############################################################# + # web_values + # + # Show values of the remote device as HTML + def web_values() + def web_values_single(name, val) + if val != nil + import webserver + webserver.content_send(f"{name} {val:i} ") + end + end + + self.web_values_prefix() # display '| ' and name if present + web_values_single("Air", self.shadow_air_quality) + web_values_single("PM1", self.shadow_pm1) + web_values_single("PM2.5", self.shadow_pm2_5) + web_values_single("PM10", self.shadow_pm10) + web_values_single("CO2", self.shadow_co2) + web_values_single("NO2", self.shadow_no2) + web_values_single("TVOC", self.shadow_tvoc) + end + +end +matter.Plugin_Bridge_Sensor_Air_Quality = Matter_Plugin_Bridge_Sensor_Air_Quality diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Light2.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Light2.be index 265514e29f81..066d0a8501d2 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Light2.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Light2.be @@ -120,7 +120,7 @@ class Matter_Plugin_Light2 : Matter_Plugin_Light1 if cluster == 0x0300 # ========== Color Control 3.2 p.111 ========== self.update_shadow_lazy() if attribute == 0x0007 # ---------- ColorTemperatureMireds / u2 ---------- - return tlv_solo.set(TLV.U1, self.shadow_ct) + return tlv_solo.set_or_nil(TLV.U1, self.shadow_ct) # if `nil` it is replaced with TLV.NULL elif attribute == 0x0008 # ---------- ColorMode / u1 ---------- return tlv_solo.set(TLV.U1, 2)# 2 = ColorTemperatureMireds elif attribute == 0x000F # ---------- Options / u1 ---------- @@ -179,12 +179,12 @@ class Matter_Plugin_Light2 : Matter_Plugin_Light1 # update_virtual # # Update internal state for virtual devices - def update_virtual(payload_json) - var val_ct = int(payload_json.find("CT")) # int or nil + def update_virtual(payload) + var val_ct = int(payload.find("CT")) # int or nil if (val_ct != nil) self.set_ct(val_ct) end - super(self).update_virtual(payload_json) + super(self).update_virtual(payload) end end diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Light3.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Light3.be index a0b77dd213d0..5f51f2bdca95 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Light3.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Light3.be @@ -127,9 +127,9 @@ class Matter_Plugin_Light3 : Matter_Plugin_Light1 if cluster == 0x0300 # ========== Color Control 3.2 p.111 ========== self.update_shadow_lazy() if attribute == 0x0000 # ---------- CurrentHue / u1 ---------- - return tlv_solo.set(TLV.U1, self.shadow_hue) + return tlv_solo.set_or_nil(TLV.U1, self.shadow_hue) elif attribute == 0x0001 # ---------- CurrentSaturation / u2 ---------- - return tlv_solo.set(TLV.U1, self.shadow_sat) + return tlv_solo.set_or_nil(TLV.U1, self.shadow_sat) elif attribute == 0x0007 # ---------- ColorTemperatureMireds / u2 ---------- return tlv_solo.set(TLV.U1, 0) elif attribute == 0x0008 # ---------- ColorMode / u1 ---------- @@ -213,13 +213,13 @@ class Matter_Plugin_Light3 : Matter_Plugin_Light1 # update_virtual # # Update internal state for virtual devices - def update_virtual(payload_json) - var val_hue = int(payload_json.find("Hue")) # int or nil - var val_sat = int(payload_json.find("Sat")) # int or nil + def update_virtual(payload) + var val_hue = int(payload.find("Hue")) # int or nil + var val_sat = int(payload.find("Sat")) # int or nil if (val_hue != nil) || (val_sat != nil) self.set_hue_sat(val_hue, val_sat) end - super(self).update_virtual(payload_json) + super(self).update_virtual(payload) end end diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Flow.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Flow.be index 24f765768ab1..a3e236acd03a 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Flow.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Flow.be @@ -53,28 +53,7 @@ class Matter_Plugin_Bridge_Sensor_Flow : Matter_Plugin_Bridge_Sensor ############################################################# # read an attribute # - def read_attribute(session, ctx, tlv_solo) - var TLV = matter.TLV - var cluster = ctx.cluster - var attribute = ctx.attribute - - # ==================================================================================================== - if cluster == 0x0404 # ========== Flow Measurement 2.1.2 p.127 ========== - if attribute == 0x0000 # ---------- MeasuredValue / i16 ---------- - if self.shadow_value != nil - return tlv_solo.set(TLV.U2, int(self.shadow_value)) # MeasuredValue represents 10 x flow in m3/h. - else - return tlv_solo.set(TLV.NULL, nil) - end - elif attribute == 0x0001 # ---------- MinMeasuredValue / i16 ---------- - return tlv_solo.set(TLV.U2, 0) # 0 m3/h - elif attribute == 0x0002 # ---------- MaxMeasuredValue / i16 ---------- - return tlv_solo.set(TLV.U2, 65534) # 65534 m3/h - end - - end - return super(self).read_attribute(session, ctx, tlv_solo) - end + static var read_attribute = matter.Plugin_Sensor_Flow.read_attribute ############################################################# # web_values diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Humidity.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Humidity.be index 05e25437ace2..d6801ced4cae 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Humidity.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Humidity.be @@ -53,28 +53,7 @@ class Matter_Plugin_Bridge_Sensor_Humidity : Matter_Plugin_Bridge_Sensor ############################################################# # read an attribute # - def read_attribute(session, ctx, tlv_solo) - var TLV = matter.TLV - var cluster = ctx.cluster - var attribute = ctx.attribute - - # ==================================================================================================== - if cluster == 0x0405 # ========== Humidity Measurement 2.4 p.98 ========== - if attribute == 0x0000 # ---------- Humidity / u16 ---------- - if self.shadow_value != nil - return tlv_solo.set(TLV.U2, int(self.shadow_value)) - else - return tlv_solo.set(TLV.NULL, nil) - end - elif attribute == 0x0001 # ---------- MinMeasuredValue / u16 ---------- - return tlv_solo.set(TLV.U2, 500) # 0% - elif attribute == 0x0002 # ---------- MaxMeasuredValue / u16 ---------- - return tlv_solo.set(TLV.U2, 10000) # 100% - end - - end - return super(self).read_attribute(session, ctx, tlv_solo) - end + def read_attribute = matter.Plugin_Sensor_Humidity.read_attribute ############################################################# # web_values diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Illuminance.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Illuminance.be index 88e0e32eef48..df31caec6a80 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Illuminance.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Illuminance.be @@ -60,28 +60,7 @@ class Matter_Plugin_Bridge_Sensor_Illuminance : Matter_Plugin_Bridge_Sensor ############################################################# # read an attribute # - def read_attribute(session, ctx, tlv_solo) - var TLV = matter.TLV - var cluster = ctx.cluster - var attribute = ctx.attribute - - # ==================================================================================================== - if cluster == 0x0400 # ========== Illuminance Measurement 2.2 p.95 ========== - if attribute == 0x0000 # ---------- MeasuredValue / i16 ---------- - if self.shadow_value != nil - return tlv_solo.set(TLV.U2, int(self.shadow_value)) - else - return tlv_solo.set(TLV.NULL, nil) - end - elif attribute == 0x0001 # ---------- MinMeasuredValue / i16 ---------- - return tlv_solo.set(TLV.U2, 1) # 1 lux - elif attribute == 0x0002 # ---------- MaxMeasuredValue / i16 ---------- - return tlv_solo.set(TLV.U2, 0xFFFE) - end - - end - return super(self).read_attribute(session, ctx, tlv_solo) - end + def read_attribute = matter.Plugin_Sensor_Illuminance.read_attribute ############################################################# # web_values diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Pressure.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Pressure.be index 53b78393a9c6..6b40a7b609cb 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Pressure.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Pressure.be @@ -53,28 +53,7 @@ class Matter_Plugin_Bridge_Sensor_Pressure : Matter_Plugin_Bridge_Sensor ############################################################# # read an attribute # - def read_attribute(session, ctx, tlv_solo) - var TLV = matter.TLV - var cluster = ctx.cluster - var attribute = ctx.attribute - - # ==================================================================================================== - if cluster == 0x0403 # ========== Pressure Measurement 2.4 p.98 ========== - if attribute == 0x0000 # ---------- MeasuredValue / i16 ---------- - if self.shadow_value != nil - return tlv_solo.set(TLV.I2, int(self.shadow_value)) - else - return tlv_solo.set(TLV.NULL, nil) - end - elif attribute == 0x0001 # ---------- MinMeasuredValue / i16 ---------- - return tlv_solo.set(TLV.I2, 500) # 500 hPA - elif attribute == 0x0002 # ---------- MaxMeasuredValue / i16 ---------- - return tlv_solo.set(TLV.I2, 1500) # 1500 hPA - end - - end - return super(self).read_attribute(session, ctx, tlv_solo) - end + def read_attribute = matter.Plugin_Sensor_Pressure.read_attribute ############################################################# # web_values diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Temp.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Temp.be index 8ee8f73d1a5d..daaaaa9f91e3 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Temp.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Bridge_Sensor_Temp.be @@ -56,28 +56,7 @@ class Matter_Plugin_Bridge_Sensor_Temp : Matter_Plugin_Bridge_Sensor ############################################################# # read an attribute # - def read_attribute(session, ctx, tlv_solo) - var TLV = matter.TLV - var cluster = ctx.cluster - var attribute = ctx.attribute - - # ==================================================================================================== - if cluster == 0x0402 # ========== Temperature Measurement 2.3 p.97 ========== - if attribute == 0x0000 # ---------- MeasuredValue / i16 (*100) ---------- - if self.shadow_value != nil - return tlv_solo.set(TLV.I2, self.shadow_value) - else - return tlv_solo.set(TLV.NULL, nil) - end - elif attribute == 0x0001 # ---------- MinMeasuredValue / i16 (*100) ---------- - return tlv_solo.set(TLV.I2, -5000) # -50 °C - elif attribute == 0x0002 # ---------- MaxMeasuredValue / i16 (*100) ---------- - return tlv_solo.set(TLV.I2, 15000) # 150 °C - end - - end - return super(self).read_attribute(session, ctx, tlv_solo) - end + def read_attribute = matter.Plugin_Sensor_Temp.read_attribute ############################################################# # web_values diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_5_Bridge_Light2.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_5_Bridge_Light2.be index 0c8595885a61..8d56223151db 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_5_Bridge_Light2.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_5_Bridge_Light2.be @@ -92,36 +92,7 @@ class Matter_Plugin_Bridge_Light2 : Matter_Plugin_Bridge_Light1 ############################################################# # read an attribute # - def read_attribute(session, ctx, tlv_solo) - var TLV = matter.TLV - var cluster = ctx.cluster - var attribute = ctx.attribute - - # ==================================================================================================== - if cluster == 0x0300 # ========== Color Control 3.2 p.111 ========== - self.update_shadow_lazy() - if attribute == 0x0007 # ---------- ColorTemperatureMireds / u2 ---------- - if self.shadow_ct != nil - return tlv_solo.set(TLV.U1, self.shadow_ct) - else - return tlv_solo.set(TLV.NULL, nil) - end - elif attribute == 0x0008 # ---------- ColorMode / u1 ---------- - return tlv_solo.set(TLV.U1, 2)# 2 = ColorTemperatureMireds - elif attribute == 0x000F # ---------- Options / u1 ---------- - return tlv_solo.set(TLV.U1, 0) - elif attribute == 0x400B # ---------- ColorTempPhysicalMinMireds / u2 ---------- - return tlv_solo.set(TLV.U1, self.ct_min) - elif attribute == 0x400C # ---------- ColorTempPhysicalMaxMireds / u2 ---------- - return tlv_solo.set(TLV.U1, self.ct_max) - - elif attribute == 0x400A # ---------- ColorCapabilities / map32 ---------- - return tlv_solo.set(TLV.U4, 0x10) # CT - end - - end - return super(self).read_attribute(session, ctx, tlv_solo) - end + def read_attribute = matter.Plugin_Light2.read_attribute ############################################################# # Invoke a command diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_5_Bridge_Light3.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_5_Bridge_Light3.be index 5b4f0ab3010c..9500481187b5 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_5_Bridge_Light3.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_5_Bridge_Light3.be @@ -92,45 +92,7 @@ class Matter_Plugin_Bridge_Light3 : Matter_Plugin_Bridge_Light1 ############################################################# # read an attribute # - def read_attribute(session, ctx, tlv_solo) - var TLV = matter.TLV - var cluster = ctx.cluster - var attribute = ctx.attribute - - # ==================================================================================================== - if cluster == 0x0300 # ========== Color Control 3.2 p.111 ========== - self.update_shadow_lazy() - if attribute == 0x0000 # ---------- CurrentHue / u1 ---------- - if self.shadow_hue != nil - return tlv_solo.set(TLV.U1, self.shadow_hue) - else - return tlv_solo.set(TLV.NULL, nil) - end - elif attribute == 0x0001 # ---------- CurrentSaturation / u2 ---------- - if self.shadow_sat != nil - return tlv_solo.set(TLV.U1, self.shadow_sat) - else - return tlv_solo.set(TLV.NULL, nil) - end - elif attribute == 0x0007 # ---------- ColorTemperatureMireds / u2 ---------- - return tlv_solo.set(TLV.U1, 0) - elif attribute == 0x0008 # ---------- ColorMode / u1 ---------- - return tlv_solo.set(TLV.U1, 0)# 0 = CurrentHue and CurrentSaturation - elif attribute == 0x000F # ---------- Options / u1 ---------- - return tlv_solo.set(TLV.U1, 0) - elif attribute == 0x4001 # ---------- EnhancedColorMode / u1 ---------- - return tlv_solo.set(TLV.U1, 0) - elif attribute == 0x400A # ---------- ColorCapabilities / map32 ---------- - return tlv_solo.set(TLV.U4, 0x01) # HS - - # Defined Primaries Information Attribute Set - elif attribute == 0x0010 # ---------- NumberOfPrimaries / u1 ---------- - return tlv_solo.set(TLV.U1, 0) - end - - end - return super(self).read_attribute(session, ctx, tlv_solo) - end + def read_attribute = matter.Plugin_Light3.read_attribute ############################################################# # Invoke a command diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_9_Virt_Sensor_Air_Quality.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_9_Virt_Sensor_Air_Quality.be new file mode 100644 index 000000000000..f969398c38bf --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_9_Virt_Sensor_Air_Quality.be @@ -0,0 +1,34 @@ +# +# Matter_Plugin_9_Virt_Sensor_Air_Quality.be - implements the behavior for a Virtual Air Quality Sensor +# +# 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 . +# + +import matter + +# Matter plug-in for core behavior + +#@ solidify:Matter_Plugin_Virt_Sensor_Air_Quality,weak + +class Matter_Plugin_Virt_Sensor_Air_Quality : Matter_Plugin_Sensor_Air_Quality + static var TYPE = "v_airquality" # name of the plug-in in json + static var DISPLAY_NAME = "v.Air Quality" # display name of the plug-in + static var ARG = "" # no arg for virtual device + static var ARG_HINT = "_Not used_" # Hint for entering the Argument (inside 'placeholder') + static var VIRTUAL = true # virtual device + +end +matter.Plugin_Virt_Sensor_Air_Quality = Matter_Plugin_Virt_Sensor_Air_Quality diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_TLV.be b/lib/libesp32/berry_matter/src/embedded/Matter_TLV.be index 74a10d25a33c..a48e4cbefefc 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_TLV.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_TLV.be @@ -141,6 +141,20 @@ class Matter_TLV return self end end + + ############################################################# + # set value, equivalent to create_TLV() without allocation + # + # if value is `nil` replace with TLV.NULL + def set_or_nil(t, value) + self.reset() + if (value == nil) t = 0x14 end # force TLV.NULL + if value != nil || t == 0x14 #-t == matter.TLV.NULL-# # put the actual number for performance + self.typ = t + self.val = value + return self + end + end ############################################################# # neutral converter diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_UI.be b/lib/libesp32/berry_matter/src/embedded/Matter_UI.be index d5f6d6e1bb7d..a325ead88528 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_UI.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_UI.be @@ -34,8 +34,10 @@ import matter class Matter_UI static var _CLASSES_TYPES = "|relay|light0|light1|light2|light3|shutter|shutter+tilt" "|temperature|pressure|illuminance|humidity|occupancy|onoff|contact|flow|waterleak" + "|airquality" "|-virtual|v_relay|v_light0|v_light1|v_light2|v_light3" "|v_temp|v_pressure|v_illuminance|v_humidity|v_occupancy|v_contact|v_flow|v_waterleak" + "|v_airquality" static var _CLASSES_TYPES2= "|http_relay|http_light0|http_light1|http_light2|http_light3" "|http_temperature|http_pressure|http_illuminance|http_humidity" "|http_occupancy|http_contact|http_flow|http_waterleak" diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_IM.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_IM.h index 463f9f498e93..8a8b3fe8de96 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_IM.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_IM.h @@ -3484,13 +3484,13 @@ be_local_closure(class_Matter_IM_subscribe_request, /* name */ /* K27 */ be_nested_str_weak(fabric_filtered), /* K28 */ be_const_int(3), /* K29 */ be_nested_str_weak(event_requests), - /* K30 */ be_nested_str_weak(MTR_X3A_X20_X3ESubscribe_X20_X28_X25_X256i_X29_X20event_requests_size_X3D_X25s), + /* K30 */ be_nested_str_weak(MTR_X3A_X20_X3ESubscribe_X20_X28_X256i_X29_X20event_requests_size_X3D_X25s), /* K31 */ be_nested_str_weak(_inner_process_read_request), /* K32 */ be_nested_str_weak(send_subscribe_response), }), be_str_weak(subscribe_request), &be_const_str_solidified, - ( &(const binstruction[99]) { /* code */ + ( &(const binstruction[101]) { /* code */ 0xB80E0000, // 0000 GETNGBL R3 K0 0x8C0C0701, // 0001 GETMET R3 R3 K1 0x7C0C0200, // 0002 CALL R3 1 @@ -3559,37 +3559,39 @@ be_local_closure(class_Matter_IM_subscribe_request, /* name */ 0x881C071D, // 0041 GETMBR R7 R3 K29 0x4C200000, // 0042 LDNIL R8 0x201C0E08, // 0043 NE R7 R7 R8 - 0x781E000E, // 0044 JMPF R7 #0054 + 0x781E0010, // 0044 JMPF R7 #0056 0x601C000C, // 0045 GETGBL R7 G12 0x8820071D, // 0046 GETMBR R8 R3 K29 0x7C1C0200, // 0047 CALL R7 1 0x241C0F19, // 0048 GT R7 R7 K25 - 0x781E0009, // 0049 JMPF R7 #0054 + 0x781E000B, // 0049 JMPF R7 #0056 0xB81E2000, // 004A GETNGBL R7 K16 0x8C1C0F11, // 004B GETMET R7 R7 K17 0x60240018, // 004C GETGBL R9 G24 0x5828001E, // 004D LDCONST R10 K30 - 0x602C000C, // 004E GETGBL R11 G12 - 0x8830071D, // 004F GETMBR R12 R3 K29 - 0x7C2C0200, // 0050 CALL R11 1 - 0x7C240400, // 0051 CALL R9 2 - 0x5828001C, // 0052 LDCONST R10 K28 - 0x7C1C0600, // 0053 CALL R7 3 - 0x8C1C011F, // 0054 GETMET R7 R0 K31 - 0x88240306, // 0055 GETMBR R9 R1 K6 - 0x5C280600, // 0056 MOVE R10 R3 - 0x5C2C0200, // 0057 MOVE R11 R1 - 0x50300200, // 0058 LDBOOL R12 1 0 - 0x7C1C0A00, // 0059 CALL R7 5 - 0x8820091A, // 005A GETMBR R8 R4 K26 - 0x901E3408, // 005B SETMBR R7 K26 R8 - 0x8C200120, // 005C GETMET R8 R0 K32 - 0x5C280200, // 005D MOVE R10 R1 - 0x5C2C0E00, // 005E MOVE R11 R7 - 0x5C300800, // 005F MOVE R12 R4 - 0x7C200800, // 0060 CALL R8 4 - 0x50200200, // 0061 LDBOOL R8 1 0 - 0x80041000, // 0062 RET 1 R8 + 0x882C0306, // 004E GETMBR R11 R1 K6 + 0x882C1713, // 004F GETMBR R11 R11 K19 + 0x6030000C, // 0050 GETGBL R12 G12 + 0x8834071D, // 0051 GETMBR R13 R3 K29 + 0x7C300200, // 0052 CALL R12 1 + 0x7C240600, // 0053 CALL R9 3 + 0x5828001C, // 0054 LDCONST R10 K28 + 0x7C1C0600, // 0055 CALL R7 3 + 0x8C1C011F, // 0056 GETMET R7 R0 K31 + 0x88240306, // 0057 GETMBR R9 R1 K6 + 0x5C280600, // 0058 MOVE R10 R3 + 0x5C2C0200, // 0059 MOVE R11 R1 + 0x50300200, // 005A LDBOOL R12 1 0 + 0x7C1C0A00, // 005B CALL R7 5 + 0x8820091A, // 005C GETMBR R8 R4 K26 + 0x901E3408, // 005D SETMBR R7 K26 R8 + 0x8C200120, // 005E GETMET R8 R0 K32 + 0x5C280200, // 005F MOVE R10 R1 + 0x5C2C0E00, // 0060 MOVE R11 R7 + 0x5C300800, // 0061 MOVE R12 R4 + 0x7C200800, // 0062 CALL R8 4 + 0x50200200, // 0063 LDBOOL R8 1 0 + 0x80041000, // 0064 RET 1 R8 }) ) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_0.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_0.h index 544c53173c2b..e22e8111a319 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_0.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_0.h @@ -7,62 +7,31 @@ extern const bclass be_class_Matter_Plugin; /******************************************************************** -** Solidified function: every_250ms +** Solidified function: contains_cluster ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_every_250ms, /* name */ +be_local_closure(class_Matter_Plugin_contains_cluster, /* name */ be_nested_proto( - 4, /* nstack */ - 1, /* argc */ + 5, /* nstack */ + 2, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_Plugin, 1, /* has constants */ - ( &(const bvalue[10]) { /* constants */ - /* K0 */ be_nested_str_weak(update_next), - /* K1 */ be_nested_str_weak(matter), - /* K2 */ be_nested_str_weak(jitter), - /* K3 */ be_nested_str_weak(UPDATE_TIME), - /* K4 */ be_nested_str_weak(tasmota), - /* K5 */ be_nested_str_weak(time_reached), - /* K6 */ be_nested_str_weak(tick), - /* K7 */ be_nested_str_weak(device), - /* K8 */ be_nested_str_weak(update_shadow), - /* K9 */ be_nested_str_weak(millis), + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(clusters), + /* K1 */ be_nested_str_weak(contains), }), - be_str_weak(every_250ms), + be_str_weak(contains_cluster), &be_const_str_solidified, - ( &(const binstruction[28]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x4C080000, // 0001 LDNIL R2 - 0x1C040202, // 0002 EQ R1 R1 R2 - 0x78060005, // 0003 JMPF R1 #000A - 0xB8060200, // 0004 GETNGBL R1 K1 - 0x8C040302, // 0005 GETMET R1 R1 K2 - 0x880C0103, // 0006 GETMBR R3 R0 K3 - 0x7C040400, // 0007 CALL R1 2 - 0x90020001, // 0008 SETMBR R0 K0 R1 - 0x70020010, // 0009 JMP #001B - 0xB8060800, // 000A GETNGBL R1 K4 - 0x8C040305, // 000B GETMET R1 R1 K5 - 0x880C0100, // 000C GETMBR R3 R0 K0 - 0x7C040400, // 000D CALL R1 2 - 0x7806000B, // 000E JMPF R1 #001B - 0x88040106, // 000F GETMBR R1 R0 K6 - 0x88080107, // 0010 GETMBR R2 R0 K7 - 0x88080506, // 0011 GETMBR R2 R2 K6 - 0x20040202, // 0012 NE R1 R1 R2 - 0x78060001, // 0013 JMPF R1 #0016 - 0x8C040108, // 0014 GETMET R1 R0 K8 - 0x7C040200, // 0015 CALL R1 1 - 0xB8060800, // 0016 GETNGBL R1 K4 - 0x8C040309, // 0017 GETMET R1 R1 K9 - 0x880C0103, // 0018 GETMBR R3 R0 K3 - 0x7C040400, // 0019 CALL R1 2 - 0x90020001, // 001A SETMBR R0 K0 R1 - 0x80000000, // 001B RET 0 + ( &(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 }) ) ); @@ -70,24 +39,26 @@ be_local_closure(class_Matter_Plugin_every_250ms, /* name */ /******************************************************************** -** Solidified function: parse_configuration +** Solidified function: append_state_json ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_parse_configuration, /* name */ +be_local_closure(class_Matter_Plugin_append_state_json, /* name */ be_nested_proto( - 2, /* nstack */ - 2, /* argc */ + 1, /* nstack */ + 1, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_Plugin, - 0, /* has constants */ - NULL, /* no const */ - be_str_weak(parse_configuration), + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(), + }), + be_str_weak(append_state_json), &be_const_str_solidified, ( &(const binstruction[ 1]) { /* code */ - 0x80000000, // 0000 RET 0 + 0x80060000, // 0000 RET 1 K0 }) ) ); @@ -95,25 +66,57 @@ be_local_closure(class_Matter_Plugin_parse_configuration, /* name */ /******************************************************************** -** Solidified function: subscribe_attribute +** Solidified function: state_json ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_subscribe_attribute, /* name */ +be_local_closure(class_Matter_Plugin_state_json, /* name */ be_nested_proto( - 6, /* nstack */ - 5, /* argc */ + 9, /* nstack */ + 1, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_Plugin, - 0, /* has constants */ - NULL, /* no const */ - be_str_weak(subscribe_attribute), + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(json), + /* K1 */ be_nested_str_weak(node_label), + /* K2 */ be_nested_str_weak(_X2C_X22Name_X22_X3A_X25s), + /* K3 */ be_nested_str_weak(dump), + /* K4 */ be_nested_str_weak(), + /* K5 */ be_nested_str_weak(append_state_json), + /* K6 */ be_nested_str_weak(_X7B_X22Ep_X22_X3A_X25i_X25s_X25s_X7D), + /* K7 */ be_nested_str_weak(endpoint), + }), + be_str_weak(state_json), &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x4C140000, // 0000 LDNIL R5 - 0x80040A00, // 0001 RET 1 R5 + ( &(const binstruction[25]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x88080101, // 0001 GETMBR R2 R0 K1 + 0x780A0006, // 0002 JMPF R2 #000A + 0x60080018, // 0003 GETGBL R2 G24 + 0x580C0002, // 0004 LDCONST R3 K2 + 0x8C100303, // 0005 GETMET R4 R1 K3 + 0x88180101, // 0006 GETMBR R6 R0 K1 + 0x7C100400, // 0007 CALL R4 2 + 0x7C080400, // 0008 CALL R2 2 + 0x70020000, // 0009 JMP #000B + 0x58080004, // 000A LDCONST R2 K4 + 0x8C0C0105, // 000B GETMET R3 R0 K5 + 0x7C0C0200, // 000C CALL R3 1 + 0x780E0007, // 000D JMPF R3 #0016 + 0x60100018, // 000E GETGBL R4 G24 + 0x58140006, // 000F LDCONST R5 K6 + 0x88180107, // 0010 GETMBR R6 R0 K7 + 0x5C1C0400, // 0011 MOVE R7 R2 + 0x5C200600, // 0012 MOVE R8 R3 + 0x7C100800, // 0013 CALL R4 4 + 0x80040800, // 0014 RET 1 R4 + 0x70020001, // 0015 JMP #0018 + 0x4C100000, // 0016 LDNIL R4 + 0x80040800, // 0017 RET 1 R4 + 0x80000000, // 0018 RET 0 }) ) ); @@ -121,47 +124,25 @@ be_local_closure(class_Matter_Plugin_subscribe_attribute, /* name */ /******************************************************************** -** Solidified function: init +** Solidified function: timed_request ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_init, /* name */ +be_local_closure(class_Matter_Plugin_timed_request, /* name */ be_nested_proto( - 8, /* nstack */ + 5, /* nstack */ 4, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_Plugin, - 1, /* has constants */ - ( &(const bvalue[ 9]) { /* constants */ - /* K0 */ be_nested_str_weak(device), - /* K1 */ be_nested_str_weak(endpoint), - /* K2 */ be_nested_str_weak(clusters), - /* K3 */ be_nested_str_weak(consolidate_clusters), - /* K4 */ be_nested_str_weak(parse_configuration), - /* K5 */ be_nested_str_weak(node_label), - /* K6 */ be_nested_str_weak(find), - /* K7 */ be_nested_str_weak(name), - /* K8 */ be_nested_str_weak(), - }), - be_str_weak(init), + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(timed_request), &be_const_str_solidified, - ( &(const binstruction[14]) { /* code */ - 0x90020001, // 0000 SETMBR R0 K0 R1 - 0x90020202, // 0001 SETMBR R0 K1 R2 - 0x8C100103, // 0002 GETMET R4 R0 K3 - 0x7C100200, // 0003 CALL R4 1 - 0x90020404, // 0004 SETMBR R0 K2 R4 - 0x8C100104, // 0005 GETMET R4 R0 K4 - 0x5C180600, // 0006 MOVE R6 R3 - 0x7C100400, // 0007 CALL R4 2 - 0x8C100706, // 0008 GETMET R4 R3 K6 - 0x58180007, // 0009 LDCONST R6 K7 - 0x581C0008, // 000A LDCONST R7 K8 - 0x7C100600, // 000B CALL R4 3 - 0x90020A04, // 000C SETMBR R0 K5 R4 - 0x80000000, // 000D RET 0 + ( &(const binstruction[ 2]) { /* code */ + 0x4C100000, // 0000 LDNIL R4 + 0x80040800, // 0001 RET 1 R4 }) ) ); @@ -169,35 +150,24 @@ be_local_closure(class_Matter_Plugin_init, /* name */ /******************************************************************** -** Solidified function: set_name +** Solidified function: parse_sensors ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_set_name, /* name */ +be_local_closure(class_Matter_Plugin_parse_sensors, /* name */ be_nested_proto( - 6, /* nstack */ + 2, /* nstack */ 2, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_Plugin, - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(node_label), - /* K1 */ be_nested_str_weak(attribute_updated), - }), - be_str_weak(set_name), + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(parse_sensors), &be_const_str_solidified, - ( &(const binstruction[ 9]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x20080202, // 0001 NE R2 R1 R2 - 0x780A0003, // 0002 JMPF R2 #0007 - 0x8C080101, // 0003 GETMET R2 R0 K1 - 0x54120038, // 0004 LDINT R4 57 - 0x54160004, // 0005 LDINT R5 5 - 0x7C080600, // 0006 CALL R2 3 - 0x90020001, // 0007 SETMBR R0 K0 R1 - 0x80000000, // 0008 RET 0 + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 }) ) ); @@ -205,25 +175,43 @@ be_local_closure(class_Matter_Plugin_set_name, /* name */ /******************************************************************** -** Solidified function: subscribe_event +** Solidified function: has ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_subscribe_event, /* name */ +be_local_closure(class_Matter_Plugin_has, /* name */ be_nested_proto( 6, /* nstack */ - 5, /* argc */ + 3, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_Plugin, - 0, /* has constants */ - NULL, /* no const */ - be_str_weak(subscribe_event), + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(clusters), + /* K1 */ be_nested_str_weak(contains), + /* K2 */ be_nested_str_weak(endpoints), + /* K3 */ be_nested_str_weak(find), + }), + be_str_weak(has), &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x4C140000, // 0000 LDNIL R5 - 0x80040A00, // 0001 RET 1 R5 + ( &(const binstruction[15]) { /* code */ + 0x880C0100, // 0000 GETMBR R3 R0 K0 + 0x8C0C0701, // 0001 GETMET R3 R3 K1 + 0x5C140200, // 0002 MOVE R5 R1 + 0x7C0C0400, // 0003 CALL R3 2 + 0x780E0006, // 0004 JMPF R3 #000C + 0x880C0102, // 0005 GETMBR R3 R0 K2 + 0x8C0C0703, // 0006 GETMET R3 R3 K3 + 0x5C140400, // 0007 MOVE R5 R2 + 0x7C0C0400, // 0008 CALL R3 2 + 0x4C100000, // 0009 LDNIL R4 + 0x200C0604, // 000A NE R3 R3 R4 + 0x740E0000, // 000B JMPT R3 #000D + 0x500C0001, // 000C LDBOOL R3 0 1 + 0x500C0200, // 000D LDBOOL R3 1 0 + 0x80040600, // 000E RET 1 R3 }) ) ); @@ -231,10 +219,10 @@ be_local_closure(class_Matter_Plugin_subscribe_event, /* name */ /******************************************************************** -** Solidified function: parse_sensors +** Solidified function: update_virtual ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_parse_sensors, /* name */ +be_local_closure(class_Matter_Plugin_update_virtual, /* name */ be_nested_proto( 2, /* nstack */ 2, /* argc */ @@ -245,7 +233,7 @@ be_local_closure(class_Matter_Plugin_parse_sensors, /* name */ &be_class_Matter_Plugin, 0, /* has constants */ NULL, /* no const */ - be_str_weak(parse_sensors), + be_str_weak(update_virtual), &be_const_str_solidified, ( &(const binstruction[ 1]) { /* code */ 0x80000000, // 0000 RET 0 @@ -256,93 +244,13 @@ be_local_closure(class_Matter_Plugin_parse_sensors, /* name */ /******************************************************************** -** Solidified function: publish_command +** Solidified function: read_attribute ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_publish_command, /* name */ +be_local_closure(class_Matter_Plugin_read_attribute, /* name */ be_nested_proto( - 16, /* nstack */ - 7, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - &be_class_Matter_Plugin, - 1, /* has constants */ - ( &(const bvalue[ 9]) { /* constants */ - /* K0 */ be_nested_str_weak(json), - /* K1 */ be_nested_str_weak(_X25s_X3A_X25s), - /* K2 */ be_nested_str_weak(dump), - /* K3 */ be_nested_str_weak(_X25s_X2C_X25s_X3A_X25s), - /* K4 */ be_nested_str_weak(matter), - /* K5 */ be_nested_str_weak(publish_command), - /* K6 */ be_nested_str_weak(MtrReceived), - /* K7 */ be_nested_str_weak(endpoint), - /* K8 */ be_nested_str_weak(node_label), - }), - be_str_weak(publish_command), - &be_const_str_solidified, - ( &(const binstruction[46]) { /* code */ - 0xA41E0000, // 0000 IMPORT R7 K0 - 0x60200018, // 0001 GETGBL R8 G24 - 0x58240001, // 0002 LDCONST R9 K1 - 0x8C280F02, // 0003 GETMET R10 R7 K2 - 0x5C300200, // 0004 MOVE R12 R1 - 0x7C280400, // 0005 CALL R10 2 - 0x8C2C0F02, // 0006 GETMET R11 R7 K2 - 0x5C340400, // 0007 MOVE R13 R2 - 0x7C2C0400, // 0008 CALL R11 2 - 0x7C200600, // 0009 CALL R8 3 - 0x4C240000, // 000A LDNIL R9 - 0x20240609, // 000B NE R9 R3 R9 - 0x7826000A, // 000C JMPF R9 #0018 - 0x60240018, // 000D GETGBL R9 G24 - 0x58280003, // 000E LDCONST R10 K3 - 0x5C2C1000, // 000F MOVE R11 R8 - 0x8C300F02, // 0010 GETMET R12 R7 K2 - 0x5C380600, // 0011 MOVE R14 R3 - 0x7C300400, // 0012 CALL R12 2 - 0x8C340F02, // 0013 GETMET R13 R7 K2 - 0x5C3C0800, // 0014 MOVE R15 R4 - 0x7C340400, // 0015 CALL R13 2 - 0x7C240800, // 0016 CALL R9 4 - 0x5C201200, // 0017 MOVE R8 R9 - 0x4C240000, // 0018 LDNIL R9 - 0x20240A09, // 0019 NE R9 R5 R9 - 0x7826000A, // 001A JMPF R9 #0026 - 0x60240018, // 001B GETGBL R9 G24 - 0x58280003, // 001C LDCONST R10 K3 - 0x5C2C1000, // 001D MOVE R11 R8 - 0x8C300F02, // 001E GETMET R12 R7 K2 - 0x5C380A00, // 001F MOVE R14 R5 - 0x7C300400, // 0020 CALL R12 2 - 0x8C340F02, // 0021 GETMET R13 R7 K2 - 0x5C3C0C00, // 0022 MOVE R15 R6 - 0x7C340400, // 0023 CALL R13 2 - 0x7C240800, // 0024 CALL R9 4 - 0x5C201200, // 0025 MOVE R8 R9 - 0xB8260800, // 0026 GETNGBL R9 K4 - 0x8C241305, // 0027 GETMET R9 R9 K5 - 0x582C0006, // 0028 LDCONST R11 K6 - 0x88300107, // 0029 GETMBR R12 R0 K7 - 0x88340108, // 002A GETMBR R13 R0 K8 - 0x5C381000, // 002B MOVE R14 R8 - 0x7C240A00, // 002C CALL R9 5 - 0x80000000, // 002D RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: read_attribute -********************************************************************/ -extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_read_attribute, /* name */ - be_nested_proto( - 17, /* nstack */ - 4, /* argc */ + 17, /* nstack */ + 4, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -584,92 +492,6 @@ be_local_closure(class_Matter_Plugin_ui_conf_to_string, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: write_attribute -********************************************************************/ -extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_write_attribute, /* name */ - be_nested_proto( - 5, /* nstack */ - 4, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - &be_class_Matter_Plugin, - 0, /* has constants */ - NULL, /* no const */ - be_str_weak(write_attribute), - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x4C100000, // 0000 LDNIL R4 - 0x80040800, // 0001 RET 1 R4 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_attribute_list -********************************************************************/ -extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_get_attribute_list, /* name */ - be_nested_proto( - 6, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - &be_class_Matter_Plugin, - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(clusters), - /* K1 */ be_nested_str_weak(find), - }), - be_str_weak(get_attribute_list), - &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 - 0x60140012, // 0003 GETGBL R5 G18 - 0x7C140000, // 0004 CALL R5 0 - 0x7C080600, // 0005 CALL R2 3 - 0x80040400, // 0006 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: read_event -********************************************************************/ -extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_read_event, /* name */ - be_nested_proto( - 6, /* nstack */ - 5, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - &be_class_Matter_Plugin, - 0, /* has constants */ - NULL, /* no const */ - be_str_weak(read_event), - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x4C140000, // 0000 LDNIL R5 - 0x80040A00, // 0001 RET 1 R5 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: ack_request ********************************************************************/ @@ -713,6 +535,32 @@ be_local_closure(class_Matter_Plugin_ack_request, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: write_attribute +********************************************************************/ +extern const bclass be_class_Matter_Plugin; +be_local_closure(class_Matter_Plugin_write_attribute, /* name */ + be_nested_proto( + 5, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_Plugin, + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(write_attribute), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x4C100000, // 0000 LDNIL R4 + 0x80040800, // 0001 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: get_cluster_list_sorted ********************************************************************/ @@ -747,12 +595,12 @@ be_local_closure(class_Matter_Plugin_get_cluster_list_sorted, /* name */ /******************************************************************** -** Solidified function: attribute_updated +** Solidified function: init ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_attribute_updated, /* name */ +be_local_closure(class_Matter_Plugin_init, /* name */ be_nested_proto( - 10, /* nstack */ + 8, /* nstack */ 4, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -760,22 +608,34 @@ be_local_closure(class_Matter_Plugin_attribute_updated, /* name */ 0, /* has sup protos */ &be_class_Matter_Plugin, 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ + ( &(const bvalue[ 9]) { /* constants */ /* K0 */ be_nested_str_weak(device), - /* K1 */ be_nested_str_weak(attribute_updated), - /* K2 */ be_nested_str_weak(endpoint), + /* K1 */ be_nested_str_weak(endpoint), + /* K2 */ be_nested_str_weak(clusters), + /* K3 */ be_nested_str_weak(consolidate_clusters), + /* K4 */ be_nested_str_weak(parse_configuration), + /* K5 */ be_nested_str_weak(node_label), + /* K6 */ be_nested_str_weak(find), + /* K7 */ be_nested_str_weak(name), + /* K8 */ be_nested_str_weak(), }), - be_str_weak(attribute_updated), + be_str_weak(init), &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 - 0x5C1C0200, // 0003 MOVE R7 R1 - 0x5C200400, // 0004 MOVE R8 R2 - 0x5C240600, // 0005 MOVE R9 R3 - 0x7C100A00, // 0006 CALL R4 5 - 0x80000000, // 0007 RET 0 + ( &(const binstruction[14]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x90020202, // 0001 SETMBR R0 K1 R2 + 0x8C100103, // 0002 GETMET R4 R0 K3 + 0x7C100200, // 0003 CALL R4 1 + 0x90020404, // 0004 SETMBR R0 K2 R4 + 0x8C100104, // 0005 GETMET R4 R0 K4 + 0x5C180600, // 0006 MOVE R6 R3 + 0x7C100400, // 0007 CALL R4 2 + 0x8C100706, // 0008 GETMET R4 R3 K6 + 0x58180007, // 0009 LDCONST R6 K7 + 0x581C0008, // 000A LDCONST R7 K8 + 0x7C100600, // 000B CALL R4 3 + 0x90020A04, // 000C SETMBR R0 K5 R4 + 0x80000000, // 000D RET 0 }) ) ); @@ -783,38 +643,50 @@ be_local_closure(class_Matter_Plugin_attribute_updated, /* name */ /******************************************************************** -** Solidified function: timed_request +** Solidified function: ui_string_to_conf ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_timed_request, /* name */ +be_local_closure(class_Matter_Plugin_ui_string_to_conf, /* name */ be_nested_proto( - 5, /* nstack */ - 4, /* argc */ - 2, /* varg */ + 8, /* nstack */ + 3, /* argc */ + 4, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_Plugin, - 0, /* has constants */ - NULL, /* no const */ - be_str_weak(timed_request), + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_const_class(be_class_Matter_Plugin), + /* K1 */ be_nested_str_weak(ARG), + /* K2 */ be_nested_str_weak(ARG_TYPE), + }), + be_str_weak(ui_string_to_conf), &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x4C100000, // 0000 LDNIL R4 - 0x80040800, // 0001 RET 1 R4 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_endpoint + ( &(const binstruction[10]) { /* code */ + 0x580C0000, // 0000 LDCONST R3 K0 + 0x88100101, // 0001 GETMBR R4 R0 K1 + 0x88140102, // 0002 GETMBR R5 R0 K2 + 0x780A0004, // 0003 JMPF R2 #0009 + 0x78120003, // 0004 JMPF R4 #0009 + 0x5C180A00, // 0005 MOVE R6 R5 + 0x5C1C0400, // 0006 MOVE R7 R2 + 0x7C180200, // 0007 CALL R6 1 + 0x98040806, // 0008 SETIDX R1 R4 R6 + 0x80040200, // 0009 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: every_250ms ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_get_endpoint, /* name */ +be_local_closure(class_Matter_Plugin_every_250ms, /* name */ be_nested_proto( - 2, /* nstack */ + 4, /* nstack */ 1, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -822,14 +694,49 @@ be_local_closure(class_Matter_Plugin_get_endpoint, /* name */ 0, /* has sup protos */ &be_class_Matter_Plugin, 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_weak(endpoint), + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str_weak(update_next), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(jitter), + /* K3 */ be_nested_str_weak(UPDATE_TIME), + /* K4 */ be_nested_str_weak(tasmota), + /* K5 */ be_nested_str_weak(time_reached), + /* K6 */ be_nested_str_weak(tick), + /* K7 */ be_nested_str_weak(device), + /* K8 */ be_nested_str_weak(update_shadow), + /* K9 */ be_nested_str_weak(millis), }), - be_str_weak(get_endpoint), + be_str_weak(every_250ms), &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ + ( &(const binstruction[28]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x80040200, // 0001 RET 1 R1 + 0x4C080000, // 0001 LDNIL R2 + 0x1C040202, // 0002 EQ R1 R1 R2 + 0x78060005, // 0003 JMPF R1 #000A + 0xB8060200, // 0004 GETNGBL R1 K1 + 0x8C040302, // 0005 GETMET R1 R1 K2 + 0x880C0103, // 0006 GETMBR R3 R0 K3 + 0x7C040400, // 0007 CALL R1 2 + 0x90020001, // 0008 SETMBR R0 K0 R1 + 0x70020010, // 0009 JMP #001B + 0xB8060800, // 000A GETNGBL R1 K4 + 0x8C040305, // 000B GETMET R1 R1 K5 + 0x880C0100, // 000C GETMBR R3 R0 K0 + 0x7C040400, // 000D CALL R1 2 + 0x7806000B, // 000E JMPF R1 #001B + 0x88040106, // 000F GETMBR R1 R0 K6 + 0x88080107, // 0010 GETMBR R2 R0 K7 + 0x88080506, // 0011 GETMBR R2 R2 K6 + 0x20040202, // 0012 NE R1 R1 R2 + 0x78060001, // 0013 JMPF R1 #0016 + 0x8C040108, // 0014 GETMET R1 R0 K8 + 0x7C040200, // 0015 CALL R1 1 + 0xB8060800, // 0016 GETNGBL R1 K4 + 0x8C040309, // 0017 GETMET R1 R1 K9 + 0x880C0103, // 0018 GETMBR R3 R0 K3 + 0x7C040400, // 0019 CALL R1 2 + 0x90020001, // 001A SETMBR R0 K0 R1 + 0x80000000, // 001B RET 0 }) ) ); @@ -837,13 +744,64 @@ be_local_closure(class_Matter_Plugin_get_endpoint, /* name */ /******************************************************************** -** Solidified function: update_shadow +** Solidified function: parse_configuration ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_update_shadow, /* name */ +be_local_closure(class_Matter_Plugin_parse_configuration, /* name */ be_nested_proto( 2, /* nstack */ - 1, /* argc */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_Plugin, + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(parse_configuration), + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: subscribe_event +********************************************************************/ +extern const bclass be_class_Matter_Plugin; +be_local_closure(class_Matter_Plugin_subscribe_event, /* name */ + be_nested_proto( + 6, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_Plugin, + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(subscribe_event), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x4C140000, // 0000 LDNIL R5 + 0x80040A00, // 0001 RET 1 R5 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_attribute_list +********************************************************************/ +extern const bclass be_class_Matter_Plugin; +be_local_closure(class_Matter_Plugin_get_attribute_list, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -851,16 +809,19 @@ be_local_closure(class_Matter_Plugin_update_shadow, /* name */ &be_class_Matter_Plugin, 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(tick), - /* K1 */ be_nested_str_weak(device), + /* K0 */ be_nested_str_weak(clusters), + /* K1 */ be_nested_str_weak(find), }), - be_str_weak(update_shadow), + be_str_weak(get_attribute_list), &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x88040101, // 0000 GETMBR R1 R0 K1 - 0x88040300, // 0001 GETMBR R1 R1 K0 - 0x90020001, // 0002 SETMBR R0 K0 R1 - 0x80000000, // 0003 RET 0 + ( &(const binstruction[ 7]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x5C100200, // 0002 MOVE R4 R1 + 0x60140012, // 0003 GETGBL R5 G18 + 0x7C140000, // 0004 CALL R5 0 + 0x7C080600, // 0005 CALL R2 3 + 0x80040400, // 0006 RET 1 R2 }) ) ); @@ -868,27 +829,44 @@ be_local_closure(class_Matter_Plugin_update_shadow, /* name */ /******************************************************************** -** Solidified function: consolidate_update_commands +** Solidified function: _parse_update_virtual ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_consolidate_update_commands, /* name */ +be_local_closure(class_Matter_Plugin__parse_update_virtual, /* name */ be_nested_proto( - 2, /* nstack */ - 1, /* argc */ + 12, /* nstack */ + 7, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_Plugin, 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_weak(UPDATE_COMMANDS), + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(find), + /* K1 */ be_nested_str_weak(attribute_updated), }), - be_str_weak(consolidate_update_commands), + be_str_weak(_parse_update_virtual), &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x80040200, // 0001 RET 1 R1 + ( &(const binstruction[18]) { /* code */ + 0x8C1C0300, // 0000 GETMET R7 R1 K0 + 0x5C240400, // 0001 MOVE R9 R2 + 0x7C1C0400, // 0002 CALL R7 2 + 0x4C200000, // 0003 LDNIL R8 + 0x20200E08, // 0004 NE R8 R7 R8 + 0x7822000A, // 0005 JMPF R8 #0011 + 0x5C200800, // 0006 MOVE R8 R4 + 0x5C240E00, // 0007 MOVE R9 R7 + 0x7C200200, // 0008 CALL R8 1 + 0x5C1C1000, // 0009 MOVE R7 R8 + 0x20200E03, // 000A NE R8 R7 R3 + 0x78220003, // 000B JMPF R8 #0010 + 0x8C200101, // 000C GETMET R8 R0 K1 + 0x5C280A00, // 000D MOVE R10 R5 + 0x5C2C0C00, // 000E MOVE R11 R6 + 0x7C200600, // 000F CALL R8 3 + 0x80040E00, // 0010 RET 1 R7 + 0x80040600, // 0011 RET 1 R3 }) ) ); @@ -896,12 +874,12 @@ be_local_closure(class_Matter_Plugin_consolidate_update_commands, /* name */ /******************************************************************** -** Solidified function: append_state_json +** Solidified function: get_endpoint ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_append_state_json, /* name */ +be_local_closure(class_Matter_Plugin_get_endpoint, /* name */ be_nested_proto( - 1, /* nstack */ + 2, /* nstack */ 1, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -910,12 +888,13 @@ be_local_closure(class_Matter_Plugin_append_state_json, /* name */ &be_class_Matter_Plugin, 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_weak(), + /* K0 */ be_nested_str_weak(endpoint), }), - be_str_weak(append_state_json), + be_str_weak(get_endpoint), &be_const_str_solidified, - ( &(const binstruction[ 1]) { /* code */ - 0x80060000, // 0000 RET 1 K0 + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 }) ) ); @@ -923,57 +902,25 @@ be_local_closure(class_Matter_Plugin_append_state_json, /* name */ /******************************************************************** -** Solidified function: state_json +** Solidified function: subscribe_attribute ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_state_json, /* name */ +be_local_closure(class_Matter_Plugin_subscribe_attribute, /* name */ be_nested_proto( - 9, /* nstack */ - 1, /* argc */ + 6, /* nstack */ + 5, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_Plugin, - 1, /* has constants */ - ( &(const bvalue[ 8]) { /* constants */ - /* K0 */ be_nested_str_weak(json), - /* K1 */ be_nested_str_weak(node_label), - /* K2 */ be_nested_str_weak(_X2C_X22Name_X22_X3A_X25s), - /* K3 */ be_nested_str_weak(dump), - /* K4 */ be_nested_str_weak(), - /* K5 */ be_nested_str_weak(append_state_json), - /* K6 */ be_nested_str_weak(_X7B_X22Ep_X22_X3A_X25i_X25s_X25s_X7D), - /* K7 */ be_nested_str_weak(endpoint), - }), - be_str_weak(state_json), + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(subscribe_attribute), &be_const_str_solidified, - ( &(const binstruction[25]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x88080101, // 0001 GETMBR R2 R0 K1 - 0x780A0006, // 0002 JMPF R2 #000A - 0x60080018, // 0003 GETGBL R2 G24 - 0x580C0002, // 0004 LDCONST R3 K2 - 0x8C100303, // 0005 GETMET R4 R1 K3 - 0x88180101, // 0006 GETMBR R6 R0 K1 - 0x7C100400, // 0007 CALL R4 2 - 0x7C080400, // 0008 CALL R2 2 - 0x70020000, // 0009 JMP #000B - 0x58080004, // 000A LDCONST R2 K4 - 0x8C0C0105, // 000B GETMET R3 R0 K5 - 0x7C0C0200, // 000C CALL R3 1 - 0x780E0007, // 000D JMPF R3 #0016 - 0x60100018, // 000E GETGBL R4 G24 - 0x58140006, // 000F LDCONST R5 K6 - 0x88180107, // 0010 GETMBR R6 R0 K7 - 0x5C1C0400, // 0011 MOVE R7 R2 - 0x5C200600, // 0012 MOVE R8 R3 - 0x7C100800, // 0013 CALL R4 4 - 0x80040800, // 0014 RET 1 R4 - 0x70020001, // 0015 JMP #0018 - 0x4C100000, // 0016 LDNIL R4 - 0x80040800, // 0017 RET 1 R4 - 0x80000000, // 0018 RET 0 + ( &(const binstruction[ 2]) { /* code */ + 0x4C140000, // 0000 LDNIL R5 + 0x80040A00, // 0001 RET 1 R5 }) ) ); @@ -981,12 +928,12 @@ be_local_closure(class_Matter_Plugin_state_json, /* name */ /******************************************************************** -** Solidified function: has +** Solidified function: contains_attribute ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_has, /* name */ +be_local_closure(class_Matter_Plugin_contains_attribute, /* name */ be_nested_proto( - 6, /* nstack */ + 7, /* nstack */ 3, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -996,28 +943,35 @@ be_local_closure(class_Matter_Plugin_has, /* name */ 1, /* has constants */ ( &(const bvalue[ 4]) { /* constants */ /* K0 */ be_nested_str_weak(clusters), - /* K1 */ be_nested_str_weak(contains), - /* K2 */ be_nested_str_weak(endpoints), - /* K3 */ be_nested_str_weak(find), + /* K1 */ be_nested_str_weak(find), + /* K2 */ be_const_int(0), + /* K3 */ be_const_int(1), }), - be_str_weak(has), + be_str_weak(contains_attribute), &be_const_str_solidified, - ( &(const binstruction[15]) { /* code */ + ( &(const binstruction[22]) { /* code */ 0x880C0100, // 0000 GETMBR R3 R0 K0 0x8C0C0701, // 0001 GETMET R3 R3 K1 0x5C140200, // 0002 MOVE R5 R1 0x7C0C0400, // 0003 CALL R3 2 - 0x780E0006, // 0004 JMPF R3 #000C - 0x880C0102, // 0005 GETMBR R3 R0 K2 - 0x8C0C0703, // 0006 GETMET R3 R3 K3 - 0x5C140400, // 0007 MOVE R5 R2 - 0x7C0C0400, // 0008 CALL R3 2 - 0x4C100000, // 0009 LDNIL R4 - 0x200C0604, // 000A NE R3 R3 R4 - 0x740E0000, // 000B JMPT R3 #000D - 0x500C0001, // 000C LDBOOL R3 0 1 - 0x500C0200, // 000D LDBOOL R3 1 0 - 0x80040600, // 000E RET 1 R3 + 0x4C100000, // 0004 LDNIL R4 + 0x20100604, // 0005 NE R4 R3 R4 + 0x7812000C, // 0006 JMPF R4 #0014 + 0x58100002, // 0007 LDCONST R4 K2 + 0x6014000C, // 0008 GETGBL R5 G12 + 0x5C180600, // 0009 MOVE R6 R3 + 0x7C140200, // 000A CALL R5 1 + 0x14140805, // 000B LT R5 R4 R5 + 0x78160006, // 000C JMPF R5 #0014 + 0x94140604, // 000D GETIDX R5 R3 R4 + 0x1C140A02, // 000E EQ R5 R5 R2 + 0x78160001, // 000F JMPF R5 #0012 + 0x50140200, // 0010 LDBOOL R5 1 0 + 0x80040A00, // 0011 RET 1 R5 + 0x00100903, // 0012 ADD R4 R4 K3 + 0x7001FFF3, // 0013 JMP #0008 + 0x50100000, // 0014 LDBOOL R4 0 0 + 0x80040800, // 0015 RET 1 R4 }) ) ); @@ -1025,25 +979,54 @@ be_local_closure(class_Matter_Plugin_has, /* name */ /******************************************************************** -** Solidified function: invoke_request +** Solidified function: consolidate_update_commands ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_invoke_request, /* name */ +be_local_closure(class_Matter_Plugin_consolidate_update_commands, /* name */ be_nested_proto( - 5, /* nstack */ - 4, /* argc */ + 2, /* nstack */ + 1, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_Plugin, + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(UPDATE_COMMANDS), + }), + be_str_weak(consolidate_update_commands), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: +********************************************************************/ +be_local_closure(class_Matter_Plugin__X3Clambda_X3E, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, 0, /* has constants */ NULL, /* no const */ - be_str_weak(invoke_request), + be_str_weak(_X3Clambda_X3E), &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x4C100000, // 0000 LDNIL R4 - 0x80040800, // 0001 RET 1 R4 + ( &(const binstruction[ 4]) { /* code */ + 0x60040008, // 0000 GETGBL R1 G8 + 0x5C080000, // 0001 MOVE R2 R0 + 0x7C040200, // 0002 CALL R1 1 + 0x80040200, // 0003 RET 1 R1 }) ) ); @@ -1051,12 +1034,12 @@ be_local_closure(class_Matter_Plugin_invoke_request, /* name */ /******************************************************************** -** Solidified function: update_shadow_lazy +** Solidified function: get_name ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_update_shadow_lazy, /* name */ +be_local_closure(class_Matter_Plugin_get_name, /* name */ be_nested_proto( - 3, /* nstack */ + 2, /* nstack */ 1, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -1064,25 +1047,14 @@ be_local_closure(class_Matter_Plugin_update_shadow_lazy, /* name */ 0, /* has sup protos */ &be_class_Matter_Plugin, 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_weak(tick), - /* K1 */ be_nested_str_weak(device), - /* K2 */ be_nested_str_weak(update_shadow), + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(node_label), }), - be_str_weak(update_shadow_lazy), + be_str_weak(get_name), &be_const_str_solidified, - ( &(const binstruction[11]) { /* code */ + ( &(const binstruction[ 2]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x88080101, // 0001 GETMBR R2 R0 K1 - 0x88080500, // 0002 GETMBR R2 R2 K0 - 0x20040202, // 0003 NE R1 R1 R2 - 0x78060004, // 0004 JMPF R1 #000A - 0x8C040102, // 0005 GETMET R1 R0 K2 - 0x7C040200, // 0006 CALL R1 1 - 0x88040101, // 0007 GETMBR R1 R0 K1 - 0x88040300, // 0008 GETMBR R1 R1 K0 - 0x90020001, // 0009 SETMBR R0 K0 R1 - 0x80000000, // 000A RET 0 + 0x80040200, // 0001 RET 1 R1 }) ) ); @@ -1090,24 +1062,79 @@ be_local_closure(class_Matter_Plugin_update_shadow_lazy, /* name */ /******************************************************************** -** Solidified function: update_virtual +** Solidified function: publish_command ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_update_virtual, /* name */ +be_local_closure(class_Matter_Plugin_publish_command, /* name */ be_nested_proto( - 2, /* nstack */ - 2, /* argc */ + 16, /* nstack */ + 7, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_Plugin, - 0, /* has constants */ - NULL, /* no const */ - be_str_weak(update_virtual), + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(json), + /* K1 */ be_nested_str_weak(_X25s_X3A_X25s), + /* K2 */ be_nested_str_weak(dump), + /* K3 */ be_nested_str_weak(_X25s_X2C_X25s_X3A_X25s), + /* K4 */ be_nested_str_weak(matter), + /* K5 */ be_nested_str_weak(publish_command), + /* K6 */ be_nested_str_weak(MtrReceived), + /* K7 */ be_nested_str_weak(endpoint), + /* K8 */ be_nested_str_weak(node_label), + }), + be_str_weak(publish_command), &be_const_str_solidified, - ( &(const binstruction[ 1]) { /* code */ - 0x80000000, // 0000 RET 0 + ( &(const binstruction[46]) { /* code */ + 0xA41E0000, // 0000 IMPORT R7 K0 + 0x60200018, // 0001 GETGBL R8 G24 + 0x58240001, // 0002 LDCONST R9 K1 + 0x8C280F02, // 0003 GETMET R10 R7 K2 + 0x5C300200, // 0004 MOVE R12 R1 + 0x7C280400, // 0005 CALL R10 2 + 0x8C2C0F02, // 0006 GETMET R11 R7 K2 + 0x5C340400, // 0007 MOVE R13 R2 + 0x7C2C0400, // 0008 CALL R11 2 + 0x7C200600, // 0009 CALL R8 3 + 0x4C240000, // 000A LDNIL R9 + 0x20240609, // 000B NE R9 R3 R9 + 0x7826000A, // 000C JMPF R9 #0018 + 0x60240018, // 000D GETGBL R9 G24 + 0x58280003, // 000E LDCONST R10 K3 + 0x5C2C1000, // 000F MOVE R11 R8 + 0x8C300F02, // 0010 GETMET R12 R7 K2 + 0x5C380600, // 0011 MOVE R14 R3 + 0x7C300400, // 0012 CALL R12 2 + 0x8C340F02, // 0013 GETMET R13 R7 K2 + 0x5C3C0800, // 0014 MOVE R15 R4 + 0x7C340400, // 0015 CALL R13 2 + 0x7C240800, // 0016 CALL R9 4 + 0x5C201200, // 0017 MOVE R8 R9 + 0x4C240000, // 0018 LDNIL R9 + 0x20240A09, // 0019 NE R9 R5 R9 + 0x7826000A, // 001A JMPF R9 #0026 + 0x60240018, // 001B GETGBL R9 G24 + 0x58280003, // 001C LDCONST R10 K3 + 0x5C2C1000, // 001D MOVE R11 R8 + 0x8C300F02, // 001E GETMET R12 R7 K2 + 0x5C380A00, // 001F MOVE R14 R5 + 0x7C300400, // 0020 CALL R12 2 + 0x8C340F02, // 0021 GETMET R13 R7 K2 + 0x5C3C0C00, // 0022 MOVE R15 R6 + 0x7C340400, // 0023 CALL R13 2 + 0x7C240800, // 0024 CALL R9 4 + 0x5C201200, // 0025 MOVE R8 R9 + 0xB8260800, // 0026 GETNGBL R9 K4 + 0x8C241305, // 0027 GETMET R9 R9 K5 + 0x582C0006, // 0028 LDCONST R11 K6 + 0x88300107, // 0029 GETMBR R12 R0 K7 + 0x88340108, // 002A GETMBR R13 R0 K8 + 0x5C381000, // 002B MOVE R14 R8 + 0x7C240A00, // 002C CALL R9 5 + 0x80000000, // 002D RET 0 }) ) ); @@ -1115,27 +1142,35 @@ be_local_closure(class_Matter_Plugin_update_virtual, /* name */ /******************************************************************** -** Solidified function: consolidate_clusters +** Solidified function: set_name ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_consolidate_clusters, /* name */ +be_local_closure(class_Matter_Plugin_set_name, /* name */ be_nested_proto( - 2, /* nstack */ - 1, /* argc */ + 6, /* nstack */ + 2, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_Plugin, 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_weak(CLUSTERS), + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(node_label), + /* K1 */ be_nested_str_weak(attribute_updated), }), - be_str_weak(consolidate_clusters), - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x80040200, // 0001 RET 1 R1 + be_str_weak(set_name), + &be_const_str_solidified, + ( &(const binstruction[ 9]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x20080202, // 0001 NE R2 R1 R2 + 0x780A0003, // 0002 JMPF R2 #0007 + 0x8C080101, // 0003 GETMET R2 R0 K1 + 0x54120038, // 0004 LDINT R4 57 + 0x54160004, // 0005 LDINT R5 5 + 0x7C080600, // 0006 CALL R2 3 + 0x90020001, // 0007 SETMBR R0 K0 R1 + 0x80000000, // 0008 RET 0 }) ) ); @@ -1143,50 +1178,38 @@ be_local_closure(class_Matter_Plugin_consolidate_clusters, /* name */ /******************************************************************** -** Solidified function: contains_attribute +** Solidified function: update_shadow_lazy ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_contains_attribute, /* name */ +be_local_closure(class_Matter_Plugin_update_shadow_lazy, /* name */ be_nested_proto( - 7, /* nstack */ - 3, /* argc */ + 3, /* nstack */ + 1, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_Plugin, 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_str_weak(clusters), - /* K1 */ be_nested_str_weak(find), - /* K2 */ be_const_int(0), - /* K3 */ be_const_int(1), + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(tick), + /* K1 */ be_nested_str_weak(device), + /* K2 */ be_nested_str_weak(update_shadow), }), - be_str_weak(contains_attribute), + be_str_weak(update_shadow_lazy), &be_const_str_solidified, - ( &(const binstruction[22]) { /* 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 - 0x20100604, // 0005 NE R4 R3 R4 - 0x7812000C, // 0006 JMPF R4 #0014 - 0x58100002, // 0007 LDCONST R4 K2 - 0x6014000C, // 0008 GETGBL R5 G12 - 0x5C180600, // 0009 MOVE R6 R3 - 0x7C140200, // 000A CALL R5 1 - 0x14140805, // 000B LT R5 R4 R5 - 0x78160006, // 000C JMPF R5 #0014 - 0x94140604, // 000D GETIDX R5 R3 R4 - 0x1C140A02, // 000E EQ R5 R5 R2 - 0x78160001, // 000F JMPF R5 #0012 - 0x50140200, // 0010 LDBOOL R5 1 0 - 0x80040A00, // 0011 RET 1 R5 - 0x00100903, // 0012 ADD R4 R4 K3 - 0x7001FFF3, // 0013 JMP #0008 - 0x50100000, // 0014 LDBOOL R4 0 0 - 0x80040800, // 0015 RET 1 R4 + ( &(const binstruction[11]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x88080101, // 0001 GETMBR R2 R0 K1 + 0x88080500, // 0002 GETMBR R2 R2 K0 + 0x20040202, // 0003 NE R1 R1 R2 + 0x78060004, // 0004 JMPF R1 #000A + 0x8C040102, // 0005 GETMET R1 R0 K2 + 0x7C040200, // 0006 CALL R1 1 + 0x88040101, // 0007 GETMBR R1 R0 K1 + 0x88040300, // 0008 GETMBR R1 R1 K0 + 0x90020001, // 0009 SETMBR R0 K0 R1 + 0x80000000, // 000A RET 0 }) ) ); @@ -1194,10 +1217,10 @@ be_local_closure(class_Matter_Plugin_contains_attribute, /* name */ /******************************************************************** -** Solidified function: get_name +** Solidified function: update_shadow ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_get_name, /* name */ +be_local_closure(class_Matter_Plugin_update_shadow, /* name */ be_nested_proto( 2, /* nstack */ 1, /* argc */ @@ -1207,14 +1230,17 @@ be_local_closure(class_Matter_Plugin_get_name, /* name */ 0, /* has sup protos */ &be_class_Matter_Plugin, 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_weak(node_label), + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(tick), + /* K1 */ be_nested_str_weak(device), }), - be_str_weak(get_name), + be_str_weak(update_shadow), &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x80040200, // 0001 RET 1 R1 + ( &(const binstruction[ 4]) { /* code */ + 0x88040101, // 0000 GETMBR R1 R0 K1 + 0x88040300, // 0001 GETMBR R1 R1 K0 + 0x90020001, // 0002 SETMBR R0 K0 R1 + 0x80000000, // 0003 RET 0 }) ) ); @@ -1222,26 +1248,25 @@ be_local_closure(class_Matter_Plugin_get_name, /* name */ /******************************************************************** -** Solidified function: +** Solidified function: invoke_request ********************************************************************/ -be_local_closure(class_Matter_Plugin__X3Clambda_X3E, /* name */ +extern const bclass be_class_Matter_Plugin; +be_local_closure(class_Matter_Plugin_invoke_request, /* name */ be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 0, /* varg */ + 5, /* nstack */ + 4, /* argc */ + 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ - NULL, + &be_class_Matter_Plugin, 0, /* has constants */ NULL, /* no const */ - be_str_weak(_X3Clambda_X3E), + be_str_weak(invoke_request), &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x60040008, // 0000 GETGBL R1 G8 - 0x5C080000, // 0001 MOVE R2 R0 - 0x7C040200, // 0002 CALL R1 1 - 0x80040200, // 0003 RET 1 R1 + ( &(const binstruction[ 2]) { /* code */ + 0x4C100000, // 0000 LDNIL R4 + 0x80040800, // 0001 RET 1 R4 }) ) ); @@ -1249,31 +1274,35 @@ be_local_closure(class_Matter_Plugin__X3Clambda_X3E, /* name */ /******************************************************************** -** Solidified function: contains_cluster +** Solidified function: attribute_updated ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_contains_cluster, /* name */ +be_local_closure(class_Matter_Plugin_attribute_updated, /* name */ be_nested_proto( - 5, /* nstack */ - 2, /* argc */ + 10, /* nstack */ + 4, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_Plugin, 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(clusters), - /* K1 */ be_nested_str_weak(contains), + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(device), + /* K1 */ be_nested_str_weak(attribute_updated), + /* K2 */ be_nested_str_weak(endpoint), }), - be_str_weak(contains_cluster), + be_str_weak(attribute_updated), &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[ 8]) { /* code */ + 0x88100100, // 0000 GETMBR R4 R0 K0 + 0x8C100901, // 0001 GETMET R4 R4 K1 + 0x88180102, // 0002 GETMBR R6 R0 K2 + 0x5C1C0200, // 0003 MOVE R7 R1 + 0x5C200400, // 0004 MOVE R8 R2 + 0x5C240600, // 0005 MOVE R9 R3 + 0x7C100A00, // 0006 CALL R4 5 + 0x80000000, // 0007 RET 0 }) ) ); @@ -1307,37 +1336,53 @@ be_local_closure(class_Matter_Plugin_is_local_device, /* name */ /******************************************************************** -** Solidified function: ui_string_to_conf +** Solidified function: consolidate_clusters ********************************************************************/ extern const bclass be_class_Matter_Plugin; -be_local_closure(class_Matter_Plugin_ui_string_to_conf, /* name */ +be_local_closure(class_Matter_Plugin_consolidate_clusters, /* name */ be_nested_proto( - 8, /* nstack */ - 3, /* argc */ - 4, /* varg */ + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_Plugin, 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_const_class(be_class_Matter_Plugin), - /* K1 */ be_nested_str_weak(ARG), - /* K2 */ be_nested_str_weak(ARG_TYPE), + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(CLUSTERS), }), - be_str_weak(ui_string_to_conf), + be_str_weak(consolidate_clusters), &be_const_str_solidified, - ( &(const binstruction[10]) { /* code */ - 0x580C0000, // 0000 LDCONST R3 K0 - 0x88100101, // 0001 GETMBR R4 R0 K1 - 0x88140102, // 0002 GETMBR R5 R0 K2 - 0x780A0004, // 0003 JMPF R2 #0009 - 0x78120003, // 0004 JMPF R4 #0009 - 0x5C180A00, // 0005 MOVE R6 R5 - 0x5C1C0400, // 0006 MOVE R7 R2 - 0x7C180200, // 0007 CALL R6 1 - 0x98040806, // 0008 SETIDX R1 R4 R6 - 0x80040200, // 0009 RET 1 R1 + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: read_event +********************************************************************/ +extern const bclass be_class_Matter_Plugin; +be_local_closure(class_Matter_Plugin_read_event, /* name */ + be_nested_proto( + 6, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_Plugin, + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(read_event), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x4C140000, // 0000 LDNIL R5 + 0x80040A00, // 0001 RET 1 R5 }) ) ); @@ -1350,37 +1395,45 @@ be_local_closure(class_Matter_Plugin_ui_string_to_conf, /* name */ be_local_class(Matter_Plugin, 6, NULL, - be_nested_map(50, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(every_250ms, -1), be_const_closure(class_Matter_Plugin_every_250ms_closure) }, - { be_const_key_weak(DISPLAY_NAME, -1), be_nested_str_weak() }, - { be_const_key_weak(FEATURE_MAPS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { - be_const_map( * be_nested_map(2, + be_nested_map(51, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_int(258, -1), be_const_int(5) }, - { be_const_key_int(49, -1), be_const_int(4) }, - })) ) } )) }, { be_const_key_weak(read_attribute, -1), be_const_closure(class_Matter_Plugin_read_attribute_closure) }, - { be_const_key_weak(subscribe_attribute, 33), be_const_closure(class_Matter_Plugin_subscribe_attribute_closure) }, - { be_const_key_weak(init, -1), be_const_closure(class_Matter_Plugin_init_closure) }, - { be_const_key_weak(UPDATE_TIME, -1), be_const_int(5000) }, - { be_const_key_weak(COMMANDS, 21), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { - be_const_map( * be_nested_map(1, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_int(29, -1), be_const_nil() }, - })) ) } )) }, - { be_const_key_weak(endpoint, -1), be_const_var(2) }, - { be_const_key_weak(UPDATE_COMMANDS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + { be_const_key_weak(append_state_json, -1), be_const_closure(class_Matter_Plugin_append_state_json_closure) }, + { be_const_key_weak(get_cluster_list_sorted, -1), be_const_closure(class_Matter_Plugin_get_cluster_list_sorted_closure) }, + { be_const_key_weak(state_json, -1), be_const_closure(class_Matter_Plugin_state_json_closure) }, + { be_const_key_weak(read_event, 38), be_const_closure(class_Matter_Plugin_read_event_closure) }, + { be_const_key_weak(timed_request, -1), be_const_closure(class_Matter_Plugin_timed_request_closure) }, + { be_const_key_weak(consolidate_clusters, -1), be_const_closure(class_Matter_Plugin_consolidate_clusters_closure) }, + { be_const_key_weak(has, -1), be_const_closure(class_Matter_Plugin_has_closure) }, + { be_const_key_weak(update_virtual, 6), be_const_closure(class_Matter_Plugin_update_virtual_closure) }, + { be_const_key_weak(is_local_device, -1), be_const_closure(class_Matter_Plugin_is_local_device_closure) }, + { be_const_key_weak(UPDATE_TIME, 0), be_const_int(5000) }, + { be_const_key_weak(ack_request, -1), be_const_closure(class_Matter_Plugin_ack_request_closure) }, + { be_const_key_weak(get_endpoint, 2), be_const_closure(class_Matter_Plugin_get_endpoint_closure) }, + { be_const_key_weak(ui_conf_to_string, 24), be_const_static_closure(class_Matter_Plugin_ui_conf_to_string_closure) }, + { be_const_key_weak(attribute_updated, -1), be_const_closure(class_Matter_Plugin_attribute_updated_closure) }, + { be_const_key_weak(UPDATE_COMMANDS, 48), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { be_const_list( * be_nested_list(0, ( (struct bvalue*) &(const bvalue[]) { })) ) } )) }, - { be_const_key_weak(VIRTUAL, -1), be_const_bool(0) }, + { be_const_key_weak(ui_string_to_conf, -1), be_const_static_closure(class_Matter_Plugin_ui_string_to_conf_closure) }, + { be_const_key_weak(every_250ms, 27), be_const_closure(class_Matter_Plugin_every_250ms_closure) }, { be_const_key_weak(device, -1), be_const_var(1) }, - { be_const_key_weak(subscribe_event, 3), be_const_closure(class_Matter_Plugin_subscribe_event_closure) }, - { be_const_key_weak(clusters, -1), be_const_var(3) }, - { be_const_key_weak(publish_command, -1), be_const_closure(class_Matter_Plugin_publish_command_closure) }, - { be_const_key_weak(is_local_device, 29), be_const_closure(class_Matter_Plugin_is_local_device_closure) }, - { be_const_key_weak(CLUSTER_REVISIONS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + { be_const_key_weak(ARG, -1), be_nested_str_weak() }, + { be_const_key_weak(subscribe_event, -1), be_const_closure(class_Matter_Plugin_subscribe_event_closure) }, + { be_const_key_weak(get_attribute_list, -1), be_const_closure(class_Matter_Plugin_get_attribute_list_closure) }, + { be_const_key_weak(write_attribute, 39), be_const_closure(class_Matter_Plugin_write_attribute_closure) }, + { be_const_key_weak(contains_attribute, -1), be_const_closure(class_Matter_Plugin_contains_attribute_closure) }, + { be_const_key_weak(consolidate_update_commands, 12), be_const_closure(class_Matter_Plugin_consolidate_update_commands_closure) }, + { be_const_key_weak(subscribe_attribute, -1), be_const_closure(class_Matter_Plugin_subscribe_attribute_closure) }, + { be_const_key_weak(contains_cluster, 23), be_const_closure(class_Matter_Plugin_contains_cluster_closure) }, + { be_const_key_weak(update_next, -1), be_const_var(0) }, + { be_const_key_weak(ARG_TYPE, -1), be_const_static_closure(class_Matter_Plugin__X3Clambda_X3E_closure) }, + { be_const_key_weak(get_name, 30), be_const_closure(class_Matter_Plugin_get_name_closure) }, + { be_const_key_weak(update_shadow_lazy, -1), be_const_closure(class_Matter_Plugin_update_shadow_lazy_closure) }, + { be_const_key_weak(TYPE, 34), be_nested_str_weak() }, + { be_const_key_weak(tick, -1), be_const_var(4) }, + { be_const_key_weak(CLUSTER_REVISIONS, 4), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(25, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(8, -1), be_const_int(5) }, @@ -1409,14 +1462,20 @@ be_local_class(Matter_Plugin, { be_const_key_int(6, -1), be_const_int(5) }, { be_const_key_int(1024, -1), be_const_int(3) }, })) ) } )) }, - { be_const_key_weak(contains_cluster, -1), be_const_closure(class_Matter_Plugin_contains_cluster_closure) }, - { be_const_key_weak(ack_request, -1), be_const_closure(class_Matter_Plugin_ack_request_closure) }, - { be_const_key_weak(parse_configuration, 34), be_const_closure(class_Matter_Plugin_parse_configuration_closure) }, - { be_const_key_weak(read_event, 28), be_const_closure(class_Matter_Plugin_read_event_closure) }, - { be_const_key_weak(get_name, 43), be_const_closure(class_Matter_Plugin_get_name_closure) }, - { be_const_key_weak(contains_attribute, 31), be_const_closure(class_Matter_Plugin_contains_attribute_closure) }, - { be_const_key_weak(get_cluster_list_sorted, -1), be_const_closure(class_Matter_Plugin_get_cluster_list_sorted_closure) }, - { be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + { be_const_key_weak(clusters, -1), be_const_var(3) }, + { be_const_key_weak(COMMANDS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + be_const_map( * be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_int(29, -1), be_const_nil() }, + })) ) } )) }, + { be_const_key_weak(ARG_HINT, -1), be_nested_str_weak(_Not_X20used_) }, + { be_const_key_weak(set_name, -1), be_const_closure(class_Matter_Plugin_set_name_closure) }, + { be_const_key_weak(publish_command, -1), be_const_closure(class_Matter_Plugin_publish_command_closure) }, + { be_const_key_weak(_parse_update_virtual, 47), be_const_closure(class_Matter_Plugin__parse_update_virtual_closure) }, + { be_const_key_weak(update_shadow, -1), be_const_closure(class_Matter_Plugin_update_shadow_closure) }, + { be_const_key_weak(invoke_request, -1), be_const_closure(class_Matter_Plugin_invoke_request_closure) }, + { be_const_key_weak(parse_sensors, 19), be_const_closure(class_Matter_Plugin_parse_sensors_closure) }, + { be_const_key_weak(CLUSTERS, 14), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(1, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(29, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { @@ -1434,31 +1493,18 @@ be_local_class(Matter_Plugin, be_const_int(65533), })) ) } )) }, })) ) } )) }, - { be_const_key_weak(attribute_updated, -1), be_const_closure(class_Matter_Plugin_attribute_updated_closure) }, - { be_const_key_weak(timed_request, 13), be_const_closure(class_Matter_Plugin_timed_request_closure) }, - { be_const_key_weak(get_endpoint, -1), be_const_closure(class_Matter_Plugin_get_endpoint_closure) }, - { be_const_key_weak(consolidate_clusters, -1), be_const_closure(class_Matter_Plugin_consolidate_clusters_closure) }, - { be_const_key_weak(append_state_json, 18), be_const_closure(class_Matter_Plugin_append_state_json_closure) }, - { be_const_key_weak(ui_conf_to_string, 41), be_const_static_closure(class_Matter_Plugin_ui_conf_to_string_closure) }, - { be_const_key_weak(TYPE, 32), be_nested_str_weak() }, - { be_const_key_weak(state_json, -1), be_const_closure(class_Matter_Plugin_state_json_closure) }, - { be_const_key_weak(tick, -1), be_const_var(4) }, - { be_const_key_weak(ARG, 47), be_nested_str_weak() }, - { be_const_key_weak(write_attribute, 36), be_const_closure(class_Matter_Plugin_write_attribute_closure) }, - { be_const_key_weak(has, -1), be_const_closure(class_Matter_Plugin_has_closure) }, - { be_const_key_weak(invoke_request, -1), be_const_closure(class_Matter_Plugin_invoke_request_closure) }, - { be_const_key_weak(update_shadow_lazy, -1), be_const_closure(class_Matter_Plugin_update_shadow_lazy_closure) }, - { be_const_key_weak(update_shadow, 22), be_const_closure(class_Matter_Plugin_update_shadow_closure) }, - { be_const_key_weak(update_virtual, -1), be_const_closure(class_Matter_Plugin_update_virtual_closure) }, - { be_const_key_weak(node_label, 42), be_const_var(5) }, - { be_const_key_weak(update_next, -1), be_const_var(0) }, - { be_const_key_weak(set_name, -1), be_const_closure(class_Matter_Plugin_set_name_closure) }, - { be_const_key_weak(ARG_TYPE, -1), be_const_static_closure(class_Matter_Plugin__X3Clambda_X3E_closure) }, - { be_const_key_weak(ARG_HINT, 17), be_nested_str_weak(_Not_X20used_) }, - { be_const_key_weak(parse_sensors, 15), be_const_closure(class_Matter_Plugin_parse_sensors_closure) }, - { be_const_key_weak(get_attribute_list, -1), be_const_closure(class_Matter_Plugin_get_attribute_list_closure) }, - { be_const_key_weak(ui_string_to_conf, -1), be_const_static_closure(class_Matter_Plugin_ui_string_to_conf_closure) }, - { be_const_key_weak(consolidate_update_commands, 2), be_const_closure(class_Matter_Plugin_consolidate_update_commands_closure) }, + { be_const_key_weak(VIRTUAL, -1), be_const_bool(0) }, + { be_const_key_weak(DISPLAY_NAME, 10), be_nested_str_weak() }, + { be_const_key_weak(node_label, 9), be_const_var(5) }, + { be_const_key_weak(parse_configuration, -1), be_const_closure(class_Matter_Plugin_parse_configuration_closure) }, + { be_const_key_weak(init, -1), be_const_closure(class_Matter_Plugin_init_closure) }, + { be_const_key_weak(endpoint, -1), be_const_var(2) }, + { be_const_key_weak(FEATURE_MAPS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + be_const_map( * be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_int(258, -1), be_const_int(5) }, + { be_const_key_int(49, -1), be_const_int(4) }, + })) ) } )) }, })), be_str_weak(Matter_Plugin) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_1_Device.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_1_Device.h index 83ab368713b4..0cb5a26f74e2 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_1_Device.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_1_Device.h @@ -328,7 +328,7 @@ be_local_closure(class_Matter_Plugin_Device_append_state_json, /* name */ &be_class_Matter_Plugin_Device, }), 1, /* has constants */ - ( &(const bvalue[30]) { /* constants */ + ( &(const bvalue[42]) { /* constants */ /* K0 */ be_nested_str_weak(introspect), /* K1 */ be_nested_str_weak(json), /* K2 */ be_nested_str_weak(), @@ -359,10 +359,22 @@ be_local_closure(class_Matter_Plugin_Device_append_state_json, /* name */ /* K27 */ be_nested_str_weak(Contact), /* K28 */ be_nested_str_weak(shadow_occupancy), /* K29 */ be_nested_str_weak(Occupancy), + /* K30 */ be_nested_str_weak(shadow_air_quality), + /* K31 */ be_nested_str_weak(AirQuality), + /* K32 */ be_nested_str_weak(shadow_co2), + /* K33 */ be_nested_str_weak(CO2), + /* K34 */ be_nested_str_weak(shadow_pm1), + /* K35 */ be_nested_str_weak(PM1), + /* K36 */ be_nested_str_weak(shadow_pm2_5), + /* K37 */ be_nested_str_weak(PM2_X2E5), + /* K38 */ be_nested_str_weak(shadow_pm10), + /* K39 */ be_nested_str_weak(PM10), + /* K40 */ be_nested_str_weak(shadow_tvoc), + /* K41 */ be_nested_str_weak(TVOC), }), be_str_weak(append_state_json), &be_const_str_solidified, - ( &(const binstruction[71]) { /* code */ + ( &(const binstruction[95]) { /* code */ 0xA4060000, // 0000 IMPORT R1 K0 0xA40A0200, // 0001 IMPORT R2 K1 0x580C0002, // 0002 LDCONST R3 K2 @@ -432,8 +444,77 @@ be_local_closure(class_Matter_Plugin_Device_append_state_json, /* name */ 0x581C001C, // 0042 LDCONST R7 K28 0x5820001D, // 0043 LDCONST R8 K29 0x7C180400, // 0044 CALL R6 2 - 0xA0000000, // 0045 CLOSE R0 - 0x80040600, // 0046 RET 1 R3 + 0x5C180800, // 0045 MOVE R6 R4 + 0x581C001E, // 0046 LDCONST R7 K30 + 0x5820001F, // 0047 LDCONST R8 K31 + 0x7C180400, // 0048 CALL R6 2 + 0x5C180800, // 0049 MOVE R6 R4 + 0x581C0020, // 004A LDCONST R7 K32 + 0x58200021, // 004B LDCONST R8 K33 + 0x7C180400, // 004C CALL R6 2 + 0x5C180800, // 004D MOVE R6 R4 + 0x581C0022, // 004E LDCONST R7 K34 + 0x58200023, // 004F LDCONST R8 K35 + 0x7C180400, // 0050 CALL R6 2 + 0x5C180800, // 0051 MOVE R6 R4 + 0x581C0024, // 0052 LDCONST R7 K36 + 0x58200025, // 0053 LDCONST R8 K37 + 0x7C180400, // 0054 CALL R6 2 + 0x5C180800, // 0055 MOVE R6 R4 + 0x581C0026, // 0056 LDCONST R7 K38 + 0x58200027, // 0057 LDCONST R8 K39 + 0x7C180400, // 0058 CALL R6 2 + 0x5C180800, // 0059 MOVE R6 R4 + 0x581C0028, // 005A LDCONST R7 K40 + 0x58200029, // 005B LDCONST R8 K41 + 0x7C180400, // 005C CALL R6 2 + 0xA0000000, // 005D CLOSE R0 + 0x80040600, // 005E RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: _parse_sensor_entry +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Device; +be_local_closure(class_Matter_Plugin_Device__parse_sensor_entry, /* name */ + be_nested_proto( + 12, /* nstack */ + 7, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_Plugin_Device, + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(find), + /* K1 */ be_nested_str_weak(attribute_updated), + }), + be_str_weak(_parse_sensor_entry), + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x8C1C0300, // 0000 GETMET R7 R1 K0 + 0x5C240400, // 0001 MOVE R9 R2 + 0x7C1C0400, // 0002 CALL R7 2 + 0x4C200000, // 0003 LDNIL R8 + 0x20200E08, // 0004 NE R8 R7 R8 + 0x7822000A, // 0005 JMPF R8 #0011 + 0x5C200800, // 0006 MOVE R8 R4 + 0x5C240E00, // 0007 MOVE R9 R7 + 0x7C200200, // 0008 CALL R8 1 + 0x5C1C1000, // 0009 MOVE R7 R8 + 0x20200E03, // 000A NE R8 R7 R3 + 0x78220003, // 000B JMPF R8 #0010 + 0x8C200101, // 000C GETMET R8 R0 K1 + 0x5C280A00, // 000D MOVE R10 R5 + 0x5C2C0C00, // 000E MOVE R11 R6 + 0x7C200600, // 000F CALL R8 3 + 0x80040E00, // 0010 RET 1 R7 + 0x80040600, // 0011 RET 1 R3 }) ) ); @@ -534,17 +615,18 @@ extern const bclass be_class_Matter_Plugin; be_local_class(Matter_Plugin_Device, 0, &be_class_Matter_Plugin, - be_nested_map(6, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(read_attribute, -1), be_const_closure(class_Matter_Plugin_Device_read_attribute_closure) }, - { be_const_key_weak(invoke_request, -1), be_const_closure(class_Matter_Plugin_Device_invoke_request_closure) }, - { be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { - be_const_map( * be_nested_map(1, + be_nested_map(7, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_int(19, -1), be_const_int(1) }, - })) ) } )) }, + { be_const_key_weak(read_attribute, 1), be_const_closure(class_Matter_Plugin_Device_read_attribute_closure) }, + { be_const_key_weak(invoke_request, 4), be_const_closure(class_Matter_Plugin_Device_invoke_request_closure) }, { be_const_key_weak(append_state_json, -1), be_const_closure(class_Matter_Plugin_Device_append_state_json_closure) }, - { be_const_key_weak(CLUSTERS, 3), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + { be_const_key_weak(NON_BRIDGE_VENDOR, 5), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(2, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(4631), + be_const_int(4993), + })) ) } )) }, + { be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(5, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(5, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { @@ -617,12 +699,12 @@ be_local_class(Matter_Plugin_Device, be_const_int(65533), })) ) } )) }, })) ) } )) }, - { be_const_key_weak(NON_BRIDGE_VENDOR, 1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { - be_const_list( * be_nested_list(2, - ( (struct bvalue*) &(const bvalue[]) { - be_const_int(4631), - be_const_int(4993), + { be_const_key_weak(TYPES, 6), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + be_const_map( * be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_int(19, -1), be_const_int(1) }, })) ) } )) }, + { be_const_key_weak(_parse_sensor_entry, -1), be_const_closure(class_Matter_Plugin_Device__parse_sensor_entry_closure) }, })), be_str_weak(Matter_Plugin_Device) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Sensor_Air_Quality.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Sensor_Air_Quality.h new file mode 100644 index 000000000000..179f66f25cd7 --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Sensor_Air_Quality.h @@ -0,0 +1,816 @@ +/* Solidification of Matter_Plugin_2_Sensor_Air_Quality.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_Plugin_Sensor_Air_Quality; + +/******************************************************************** +** Solidified function: _parse_sensor_entry +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Sensor_Air_Quality; +be_local_closure(class_Matter_Plugin_Sensor_Air_Quality__parse_sensor_entry, /* name */ + be_nested_proto( + 11, /* nstack */ + 6, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_Plugin_Sensor_Air_Quality, + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(find), + /* K1 */ be_nested_str_weak(attribute_updated), + }), + be_str_weak(_parse_sensor_entry), + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x8C180300, // 0000 GETMET R6 R1 K0 + 0x5C200400, // 0001 MOVE R8 R2 + 0x7C180400, // 0002 CALL R6 2 + 0x4C1C0000, // 0003 LDNIL R7 + 0x201C0C07, // 0004 NE R7 R6 R7 + 0x781E0006, // 0005 JMPF R7 #000D + 0x201C0C03, // 0006 NE R7 R6 R3 + 0x781E0003, // 0007 JMPF R7 #000C + 0x8C1C0101, // 0008 GETMET R7 R0 K1 + 0x5C240800, // 0009 MOVE R9 R4 + 0x5C280A00, // 000A MOVE R10 R5 + 0x7C1C0600, // 000B CALL R7 3 + 0x80040C00, // 000C RET 1 R6 + 0x80040600, // 000D RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: update_virtual +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Sensor_Air_Quality; +be_local_closure(class_Matter_Plugin_Sensor_Air_Quality_update_virtual, /* name */ + be_nested_proto( + 10, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_Plugin_Sensor_Air_Quality, + 1, /* has constants */ + ( &(const bvalue[15]) { /* constants */ + /* K0 */ be_nested_str_weak(shadow_air_quality), + /* K1 */ be_nested_str_weak(_parse_update_virtual), + /* K2 */ be_nested_str_weak(AirQuality), + /* K3 */ be_const_int(0), + /* K4 */ be_nested_str_weak(shadow_co2), + /* K5 */ be_nested_str_weak(CO2), + /* K6 */ be_nested_str_weak(shadow_pm1), + /* K7 */ be_nested_str_weak(PM1), + /* K8 */ be_nested_str_weak(shadow_pm2_5), + /* K9 */ be_nested_str_weak(PM2_X2E5), + /* K10 */ be_nested_str_weak(shadow_pm10), + /* K11 */ be_nested_str_weak(PM10), + /* K12 */ be_nested_str_weak(shadow_tvoc), + /* K13 */ be_nested_str_weak(TVOC), + /* K14 */ be_nested_str_weak(update_virtual), + }), + be_str_weak(update_virtual), + &be_const_str_solidified, + ( &(const binstruction[61]) { /* code */ + 0x8C080101, // 0000 GETMET R2 R0 K1 + 0x5C100200, // 0001 MOVE R4 R1 + 0x58140002, // 0002 LDCONST R5 K2 + 0x60180007, // 0003 GETGBL R6 G7 + 0x881C0100, // 0004 GETMBR R7 R0 K0 + 0x5422005A, // 0005 LDINT R8 91 + 0x58240003, // 0006 LDCONST R9 K3 + 0x7C080E00, // 0007 CALL R2 7 + 0x90020002, // 0008 SETMBR R0 K0 R2 + 0x8C080101, // 0009 GETMET R2 R0 K1 + 0x5C100200, // 000A MOVE R4 R1 + 0x58140005, // 000B LDCONST R5 K5 + 0x88180104, // 000C GETMBR R6 R0 K4 + 0x601C0007, // 000D GETGBL R7 G7 + 0x5422040C, // 000E LDINT R8 1037 + 0x58240003, // 000F LDCONST R9 K3 + 0x7C080E00, // 0010 CALL R2 7 + 0x90020802, // 0011 SETMBR R0 K4 R2 + 0x8C080101, // 0012 GETMET R2 R0 K1 + 0x5C100200, // 0013 MOVE R4 R1 + 0x58140007, // 0014 LDCONST R5 K7 + 0x88180106, // 0015 GETMBR R6 R0 K6 + 0x601C0007, // 0016 GETGBL R7 G7 + 0x5422042B, // 0017 LDINT R8 1068 + 0x58240003, // 0018 LDCONST R9 K3 + 0x7C080E00, // 0019 CALL R2 7 + 0x90020C02, // 001A SETMBR R0 K6 R2 + 0x8C080101, // 001B GETMET R2 R0 K1 + 0x5C100200, // 001C MOVE R4 R1 + 0x58140009, // 001D LDCONST R5 K9 + 0x88180108, // 001E GETMBR R6 R0 K8 + 0x601C0007, // 001F GETGBL R7 G7 + 0x54220429, // 0020 LDINT R8 1066 + 0x58240003, // 0021 LDCONST R9 K3 + 0x7C080E00, // 0022 CALL R2 7 + 0x90021002, // 0023 SETMBR R0 K8 R2 + 0x8C080101, // 0024 GETMET R2 R0 K1 + 0x5C100200, // 0025 MOVE R4 R1 + 0x5814000B, // 0026 LDCONST R5 K11 + 0x8818010A, // 0027 GETMBR R6 R0 K10 + 0x601C0007, // 0028 GETGBL R7 G7 + 0x5422042C, // 0029 LDINT R8 1069 + 0x58240003, // 002A LDCONST R9 K3 + 0x7C080E00, // 002B CALL R2 7 + 0x90021402, // 002C SETMBR R0 K10 R2 + 0x8C080101, // 002D GETMET R2 R0 K1 + 0x5C100200, // 002E MOVE R4 R1 + 0x5814000D, // 002F LDCONST R5 K13 + 0x8818010C, // 0030 GETMBR R6 R0 K12 + 0x601C0007, // 0031 GETGBL R7 G7 + 0x5422042D, // 0032 LDINT R8 1070 + 0x58240003, // 0033 LDCONST R9 K3 + 0x7C080E00, // 0034 CALL R2 7 + 0x90021802, // 0035 SETMBR R0 K12 R2 + 0x60080003, // 0036 GETGBL R2 G3 + 0x5C0C0000, // 0037 MOVE R3 R0 + 0x7C080200, // 0038 CALL R2 1 + 0x8C08050E, // 0039 GETMET R2 R2 K14 + 0x5C100200, // 003A MOVE R4 R1 + 0x7C080400, // 003B CALL R2 2 + 0x80000000, // 003C RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: parse_sensors +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Sensor_Air_Quality; +be_local_closure(class_Matter_Plugin_Sensor_Air_Quality_parse_sensors, /* name */ + be_nested_proto( + 11, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_Plugin_Sensor_Air_Quality, + 1, /* has constants */ + ( &(const bvalue[17]) { /* constants */ + /* K0 */ be_nested_str_weak(find), + /* K1 */ be_nested_str_weak(prefix), + /* K2 */ be_nested_str_weak(shadow_co2), + /* K3 */ be_nested_str_weak(_parse_sensor_entry), + /* K4 */ be_nested_str_weak(CarbonDioxide), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(shadow_pm1), + /* K7 */ be_nested_str_weak(PM1), + /* K8 */ be_nested_str_weak(shadow_pm2_5), + /* K9 */ be_nested_str_weak(PM2_X2E5), + /* K10 */ be_nested_str_weak(shadow_pm10), + /* K11 */ be_nested_str_weak(PM10), + /* K12 */ be_nested_str_weak(shadow_tvoc), + /* K13 */ be_nested_str_weak(TVOC), + /* K14 */ be_nested_str_weak(shadow_no2), + /* K15 */ be_nested_str_weak(NO2), + /* K16 */ be_nested_str_weak(parse_sensors), + }), + be_str_weak(parse_sensors), + &be_const_str_solidified, + ( &(const binstruction[67]) { /* code */ + 0x8C080300, // 0000 GETMET R2 R1 K0 + 0x88100101, // 0001 GETMBR R4 R0 K1 + 0x7C080400, // 0002 CALL R2 2 + 0x4C0C0000, // 0003 LDNIL R3 + 0x200C0403, // 0004 NE R3 R2 R3 + 0x780E0035, // 0005 JMPF R3 #003C + 0x8C0C0103, // 0006 GETMET R3 R0 K3 + 0x5C140400, // 0007 MOVE R5 R2 + 0x58180004, // 0008 LDCONST R6 K4 + 0x881C0102, // 0009 GETMBR R7 R0 K2 + 0x60200007, // 000A GETGBL R8 G7 + 0x5426040C, // 000B LDINT R9 1037 + 0x58280005, // 000C LDCONST R10 K5 + 0x7C0C0E00, // 000D CALL R3 7 + 0x90020403, // 000E SETMBR R0 K2 R3 + 0x8C0C0103, // 000F GETMET R3 R0 K3 + 0x5C140400, // 0010 MOVE R5 R2 + 0x58180007, // 0011 LDCONST R6 K7 + 0x881C0106, // 0012 GETMBR R7 R0 K6 + 0x60200007, // 0013 GETGBL R8 G7 + 0x5426042B, // 0014 LDINT R9 1068 + 0x58280005, // 0015 LDCONST R10 K5 + 0x7C0C0E00, // 0016 CALL R3 7 + 0x90020C03, // 0017 SETMBR R0 K6 R3 + 0x8C0C0103, // 0018 GETMET R3 R0 K3 + 0x5C140400, // 0019 MOVE R5 R2 + 0x58180009, // 001A LDCONST R6 K9 + 0x881C0108, // 001B GETMBR R7 R0 K8 + 0x60200007, // 001C GETGBL R8 G7 + 0x54260429, // 001D LDINT R9 1066 + 0x58280005, // 001E LDCONST R10 K5 + 0x7C0C0E00, // 001F CALL R3 7 + 0x90021003, // 0020 SETMBR R0 K8 R3 + 0x8C0C0103, // 0021 GETMET R3 R0 K3 + 0x5C140400, // 0022 MOVE R5 R2 + 0x5818000B, // 0023 LDCONST R6 K11 + 0x881C010A, // 0024 GETMBR R7 R0 K10 + 0x60200007, // 0025 GETGBL R8 G7 + 0x5426042C, // 0026 LDINT R9 1069 + 0x58280005, // 0027 LDCONST R10 K5 + 0x7C0C0E00, // 0028 CALL R3 7 + 0x90021403, // 0029 SETMBR R0 K10 R3 + 0x8C0C0103, // 002A GETMET R3 R0 K3 + 0x5C140400, // 002B MOVE R5 R2 + 0x5818000D, // 002C LDCONST R6 K13 + 0x881C010C, // 002D GETMBR R7 R0 K12 + 0x60200007, // 002E GETGBL R8 G7 + 0x5426042D, // 002F LDINT R9 1070 + 0x58280005, // 0030 LDCONST R10 K5 + 0x7C0C0E00, // 0031 CALL R3 7 + 0x90021803, // 0032 SETMBR R0 K12 R3 + 0x8C0C0103, // 0033 GETMET R3 R0 K3 + 0x5C140400, // 0034 MOVE R5 R2 + 0x5818000F, // 0035 LDCONST R6 K15 + 0x881C010E, // 0036 GETMBR R7 R0 K14 + 0x60200007, // 0037 GETGBL R8 G7 + 0x54260412, // 0038 LDINT R9 1043 + 0x58280005, // 0039 LDCONST R10 K5 + 0x7C0C0E00, // 003A CALL R3 7 + 0x90021C03, // 003B SETMBR R0 K14 R3 + 0x600C0003, // 003C GETGBL R3 G3 + 0x5C100000, // 003D MOVE R4 R0 + 0x7C0C0200, // 003E CALL R3 1 + 0x8C0C0710, // 003F GETMET R3 R3 K16 + 0x5C140200, // 0040 MOVE R5 R1 + 0x7C0C0400, // 0041 CALL R3 2 + 0x80000000, // 0042 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: read_attribute +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Sensor_Air_Quality; +be_local_closure(class_Matter_Plugin_Sensor_Air_Quality_read_attribute, /* name */ + be_nested_proto( + 14, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 2]) { + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 3]) { /* upvals */ + be_local_const_upval(1, 6), + be_local_const_upval(1, 3), + be_local_const_upval(1, 4), + }), + 0, /* has sup protos */ + NULL, + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str_weak(set), + /* K2 */ be_nested_str_weak(FLOAT), + /* K3 */ be_nested_str_weak(NULL), + /* K4 */ be_const_int(1), + /* K5 */ be_const_int(2), + /* K6 */ be_nested_str_weak(U1), + /* K7 */ be_nested_str_weak(U4), + }), + be_str_weak(handle_value), + &be_const_str_solidified, + ( &(const binstruction[85]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0000, // 0002 JMPF R2 #0004 + 0x58040000, // 0003 LDCONST R1 K0 + 0x68080000, // 0004 GETUPV R2 U0 + 0x1C080500, // 0005 EQ R2 R2 K0 + 0x780A0012, // 0006 JMPF R2 #001A + 0x4C080000, // 0007 LDNIL R2 + 0x20080002, // 0008 NE R2 R0 R2 + 0x780A0007, // 0009 JMPF R2 #0012 + 0x68080001, // 000A GETUPV R2 U1 + 0x8C080501, // 000B GETMET R2 R2 K1 + 0x68100002, // 000C GETUPV R4 U2 + 0x88100902, // 000D GETMBR R4 R4 K2 + 0x5C140000, // 000E MOVE R5 R0 + 0x7C080600, // 000F CALL R2 3 + 0x80040400, // 0010 RET 1 R2 + 0x70020006, // 0011 JMP #0019 + 0x68080001, // 0012 GETUPV R2 U1 + 0x8C080501, // 0013 GETMET R2 R2 K1 + 0x68100002, // 0014 GETUPV R4 U2 + 0x88100903, // 0015 GETMBR R4 R4 K3 + 0x4C140000, // 0016 LDNIL R5 + 0x7C080600, // 0017 CALL R2 3 + 0x80040400, // 0018 RET 1 R2 + 0x70020038, // 0019 JMP #0053 + 0x68080000, // 001A GETUPV R2 U0 + 0x1C080504, // 001B EQ R2 R2 K4 + 0x780A0007, // 001C JMPF R2 #0025 + 0x68080001, // 001D GETUPV R2 U1 + 0x8C080501, // 001E GETMET R2 R2 K1 + 0x68100002, // 001F GETUPV R4 U2 + 0x88100903, // 0020 GETMBR R4 R4 K3 + 0x4C140000, // 0021 LDNIL R5 + 0x7C080600, // 0022 CALL R2 3 + 0x80040400, // 0023 RET 1 R2 + 0x7002002D, // 0024 JMP #0053 + 0x68080000, // 0025 GETUPV R2 U0 + 0x1C080505, // 0026 EQ R2 R2 K5 + 0x780A0007, // 0027 JMPF R2 #0030 + 0x68080001, // 0028 GETUPV R2 U1 + 0x8C080501, // 0029 GETMET R2 R2 K1 + 0x68100002, // 002A GETUPV R4 U2 + 0x88100903, // 002B GETMBR R4 R4 K3 + 0x4C140000, // 002C LDNIL R5 + 0x7C080600, // 002D CALL R2 3 + 0x80040400, // 002E RET 1 R2 + 0x70020022, // 002F JMP #0053 + 0x68080000, // 0030 GETUPV R2 U0 + 0x540E0007, // 0031 LDINT R3 8 + 0x1C080403, // 0032 EQ R2 R2 R3 + 0x780A0007, // 0033 JMPF R2 #003C + 0x68080001, // 0034 GETUPV R2 U1 + 0x8C080501, // 0035 GETMET R2 R2 K1 + 0x68100002, // 0036 GETUPV R4 U2 + 0x88100906, // 0037 GETMBR R4 R4 K6 + 0x5C140200, // 0038 MOVE R5 R1 + 0x7C080600, // 0039 CALL R2 3 + 0x80040400, // 003A RET 1 R2 + 0x70020016, // 003B JMP #0053 + 0x68080000, // 003C GETUPV R2 U0 + 0x540E0008, // 003D LDINT R3 9 + 0x1C080403, // 003E EQ R2 R2 R3 + 0x780A0007, // 003F JMPF R2 #0048 + 0x68080001, // 0040 GETUPV R2 U1 + 0x8C080501, // 0041 GETMET R2 R2 K1 + 0x68100002, // 0042 GETUPV R4 U2 + 0x88100906, // 0043 GETMBR R4 R4 K6 + 0x58140000, // 0044 LDCONST R5 K0 + 0x7C080600, // 0045 CALL R2 3 + 0x80040400, // 0046 RET 1 R2 + 0x7002000A, // 0047 JMP #0053 + 0x68080000, // 0048 GETUPV R2 U0 + 0x540EFFFB, // 0049 LDINT R3 65532 + 0x1C080403, // 004A EQ R2 R2 R3 + 0x780A0006, // 004B JMPF R2 #0053 + 0x68080001, // 004C GETUPV R2 U1 + 0x8C080501, // 004D GETMET R2 R2 K1 + 0x68100002, // 004E GETUPV R4 U2 + 0x88100907, // 004F GETMBR R4 R4 K7 + 0x58140004, // 0050 LDCONST R5 K4 + 0x7C080600, // 0051 CALL R2 3 + 0x80040400, // 0052 RET 1 R2 + 0x4C080000, // 0053 LDNIL R2 + 0x80040400, // 0054 RET 1 R2 + }) + ), + &be_class_Matter_Plugin_Sensor_Air_Quality, + }), + 1, /* has constants */ + ( &(const bvalue[16]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(cluster), + /* K3 */ be_nested_str_weak(attribute), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(shadow_air_quality), + /* K6 */ be_nested_str_weak(set), + /* K7 */ be_nested_str_weak(U1), + /* K8 */ be_nested_str_weak(NULL), + /* K9 */ be_nested_str_weak(shadow_co2), + /* K10 */ be_nested_str_weak(shadow_pm1), + /* K11 */ be_nested_str_weak(shadow_pm2_5), + /* K12 */ be_nested_str_weak(shadow_pm10), + /* K13 */ be_nested_str_weak(shadow_tvoc), + /* K14 */ be_nested_str_weak(shadow_no2), + /* K15 */ be_nested_str_weak(read_attribute), + }), + be_str_weak(read_attribute), + &be_const_str_solidified, + ( &(const binstruction[104]) { /* code */ + 0xB8120000, // 0000 GETNGBL R4 K0 + 0x88100901, // 0001 GETMBR R4 R4 K1 + 0x88140502, // 0002 GETMBR R5 R2 K2 + 0x88180503, // 0003 GETMBR R6 R2 K3 + 0x4C1C0000, // 0004 LDNIL R7 + 0x84200000, // 0005 CLOSURE R8 P0 + 0x5426005A, // 0006 LDINT R9 91 + 0x1C240A09, // 0007 EQ R9 R5 R9 + 0x78260013, // 0008 JMPF R9 #001D + 0x1C240D04, // 0009 EQ R9 R6 K4 + 0x78260010, // 000A JMPF R9 #001C + 0x88240105, // 000B GETMBR R9 R0 K5 + 0x4C280000, // 000C LDNIL R10 + 0x2024120A, // 000D NE R9 R9 R10 + 0x78260006, // 000E JMPF R9 #0016 + 0x8C240706, // 000F GETMET R9 R3 K6 + 0x882C0907, // 0010 GETMBR R11 R4 K7 + 0x88300105, // 0011 GETMBR R12 R0 K5 + 0x7C240600, // 0012 CALL R9 3 + 0xA0000000, // 0013 CLOSE R0 + 0x80041200, // 0014 RET 1 R9 + 0x70020005, // 0015 JMP #001C + 0x8C240706, // 0016 GETMET R9 R3 K6 + 0x882C0908, // 0017 GETMBR R11 R4 K8 + 0x4C300000, // 0018 LDNIL R12 + 0x7C240600, // 0019 CALL R9 3 + 0xA0000000, // 001A CLOSE R0 + 0x80041200, // 001B RET 1 R9 + 0x70020040, // 001C JMP #005E + 0x5426040C, // 001D LDINT R9 1037 + 0x1C240A09, // 001E EQ R9 R5 R9 + 0x78260007, // 001F JMPF R9 #0028 + 0x5C241000, // 0020 MOVE R9 R8 + 0x88280109, // 0021 GETMBR R10 R0 K9 + 0x7C240200, // 0022 CALL R9 1 + 0x5C1C1200, // 0023 MOVE R7 R9 + 0x78260001, // 0024 JMPF R9 #0027 + 0xA0000000, // 0025 CLOSE R0 + 0x80040E00, // 0026 RET 1 R7 + 0x70020035, // 0027 JMP #005E + 0x5426042B, // 0028 LDINT R9 1068 + 0x1C240A09, // 0029 EQ R9 R5 R9 + 0x78260007, // 002A JMPF R9 #0033 + 0x5C241000, // 002B MOVE R9 R8 + 0x8828010A, // 002C GETMBR R10 R0 K10 + 0x7C240200, // 002D CALL R9 1 + 0x5C1C1200, // 002E MOVE R7 R9 + 0x78260001, // 002F JMPF R9 #0032 + 0xA0000000, // 0030 CLOSE R0 + 0x80040E00, // 0031 RET 1 R7 + 0x7002002A, // 0032 JMP #005E + 0x54260429, // 0033 LDINT R9 1066 + 0x1C240A09, // 0034 EQ R9 R5 R9 + 0x78260007, // 0035 JMPF R9 #003E + 0x5C241000, // 0036 MOVE R9 R8 + 0x8828010B, // 0037 GETMBR R10 R0 K11 + 0x7C240200, // 0038 CALL R9 1 + 0x5C1C1200, // 0039 MOVE R7 R9 + 0x78260001, // 003A JMPF R9 #003D + 0xA0000000, // 003B CLOSE R0 + 0x80040E00, // 003C RET 1 R7 + 0x7002001F, // 003D JMP #005E + 0x5426042C, // 003E LDINT R9 1069 + 0x1C240A09, // 003F EQ R9 R5 R9 + 0x78260007, // 0040 JMPF R9 #0049 + 0x5C241000, // 0041 MOVE R9 R8 + 0x8828010C, // 0042 GETMBR R10 R0 K12 + 0x7C240200, // 0043 CALL R9 1 + 0x5C1C1200, // 0044 MOVE R7 R9 + 0x78260001, // 0045 JMPF R9 #0048 + 0xA0000000, // 0046 CLOSE R0 + 0x80040E00, // 0047 RET 1 R7 + 0x70020014, // 0048 JMP #005E + 0x5426042D, // 0049 LDINT R9 1070 + 0x1C240A09, // 004A EQ R9 R5 R9 + 0x78260007, // 004B JMPF R9 #0054 + 0x5C241000, // 004C MOVE R9 R8 + 0x8828010D, // 004D GETMBR R10 R0 K13 + 0x7C240200, // 004E CALL R9 1 + 0x5C1C1200, // 004F MOVE R7 R9 + 0x78260001, // 0050 JMPF R9 #0053 + 0xA0000000, // 0051 CLOSE R0 + 0x80040E00, // 0052 RET 1 R7 + 0x70020009, // 0053 JMP #005E + 0x54260412, // 0054 LDINT R9 1043 + 0x1C240A09, // 0055 EQ R9 R5 R9 + 0x78260006, // 0056 JMPF R9 #005E + 0x5C241000, // 0057 MOVE R9 R8 + 0x8828010E, // 0058 GETMBR R10 R0 K14 + 0x7C240200, // 0059 CALL R9 1 + 0x5C1C1200, // 005A MOVE R7 R9 + 0x78260001, // 005B JMPF R9 #005E + 0xA0000000, // 005C CLOSE R0 + 0x80040E00, // 005D RET 1 R7 + 0x60240003, // 005E GETGBL R9 G3 + 0x5C280000, // 005F MOVE R10 R0 + 0x7C240200, // 0060 CALL R9 1 + 0x8C24130F, // 0061 GETMET R9 R9 K15 + 0x5C2C0200, // 0062 MOVE R11 R1 + 0x5C300400, // 0063 MOVE R12 R2 + 0x5C340600, // 0064 MOVE R13 R3 + 0x7C240800, // 0065 CALL R9 4 + 0xA0000000, // 0066 CLOSE R0 + 0x80041200, // 0067 RET 1 R9 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: parse_configuration +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Sensor_Air_Quality; +be_local_closure(class_Matter_Plugin_Sensor_Air_Quality_parse_configuration, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_Plugin_Sensor_Air_Quality, + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(prefix), + /* K1 */ be_nested_str_weak(find), + /* K2 */ be_nested_str_weak(ARG), + }), + be_str_weak(parse_configuration), + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x60080008, // 0000 GETGBL R2 G8 + 0x8C0C0301, // 0001 GETMET R3 R1 K1 + 0x88140102, // 0002 GETMBR R5 R0 K2 + 0x7C0C0400, // 0003 CALL R3 2 + 0x7C080200, // 0004 CALL R2 1 + 0x90020002, // 0005 SETMBR R0 K0 R2 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Sensor_Air_Quality; +be_local_closure(class_Matter_Plugin_Sensor_Air_Quality_init, /* name */ + be_nested_proto( + 9, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_Plugin_Sensor_Air_Quality, + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(init), + /* K1 */ be_nested_str_weak(shadow_air_quality), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[11]) { /* 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 + 0x50100000, // 0008 LDBOOL R4 0 0 + 0x90020204, // 0009 SETMBR R0 K1 R4 + 0x80000000, // 000A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_Plugin_Sensor_Air_Quality +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Device; +be_local_class(Matter_Plugin_Sensor_Air_Quality, + 8, + &be_class_Matter_Plugin_Device, + be_nested_map(23, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(update_virtual, -1), be_const_closure(class_Matter_Plugin_Sensor_Air_Quality_update_virtual_closure) }, + { be_const_key_weak(shadow_pm10, 0), be_const_var(4) }, + { be_const_key_weak(ARG, 1), be_nested_str_weak(airquality) }, + { be_const_key_weak(TYPE, -1), be_nested_str_weak(airquality) }, + { be_const_key_weak(parse_configuration, 21), be_const_closure(class_Matter_Plugin_Sensor_Air_Quality_parse_configuration_closure) }, + { be_const_key_weak(shadow_no2, -1), be_const_var(6) }, + { be_const_key_weak(UPDATE_TIME, -1), be_const_int(30000) }, + { be_const_key_weak(UPDATE_COMMANDS, 13), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(7, + ( (struct bvalue*) &(const bvalue[]) { + be_nested_str_weak(AirQuality), + be_nested_str_weak(CO2), + be_nested_str_weak(PM1), + be_nested_str_weak(PM2_X2E5), + be_nested_str_weak(PM10), + be_nested_str_weak(TVOC), + be_nested_str_weak(NO2), + })) ) } )) }, + { be_const_key_weak(shadow_pm2_5, -1), be_const_var(3) }, + { be_const_key_weak(shadow_air_quality, -1), be_const_var(1) }, + { be_const_key_weak(read_attribute, -1), be_const_closure(class_Matter_Plugin_Sensor_Air_Quality_read_attribute_closure) }, + { be_const_key_weak(shadow_tvoc, -1), be_const_var(7) }, + { be_const_key_weak(prefix, -1), be_const_var(0) }, + { be_const_key_weak(TYPES, 4), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + be_const_map( * be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_int(44, -1), be_const_int(1) }, + })) ) } )) }, + { be_const_key_weak(_parse_sensor_entry, 19), be_const_closure(class_Matter_Plugin_Sensor_Air_Quality__parse_sensor_entry_closure) }, + { be_const_key_weak(shadow_pm1, 9), be_const_var(2) }, + { be_const_key_weak(DISPLAY_NAME, -1), be_nested_str_weak(Air_X20Quality) }, + { be_const_key_weak(parse_sensors, 7), be_const_closure(class_Matter_Plugin_Sensor_Air_Quality_parse_sensors_closure) }, + { be_const_key_weak(shadow_co2, -1), be_const_var(5) }, + { be_const_key_weak(init, -1), be_const_closure(class_Matter_Plugin_Sensor_Air_Quality_init_closure) }, + { be_const_key_weak(ARG_HINT, -1), be_nested_str_weak(Device_X20key_X20_X28ex_X3A_X20SCD40_X29) }, + { be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + be_const_map( * be_nested_map(12, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_int(1068, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(11, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(2), + be_const_int(8), + be_const_int(9), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(1069, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(11, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(2), + be_const_int(8), + be_const_int(9), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(1070, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(11, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(2), + be_const_int(8), + be_const_int(9), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(3, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(8, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(4, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(7, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(5, 8), 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(1), + be_const_int(2), + be_const_int(3), + be_const_int(4), + be_const_int(5), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(1037, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(11, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(2), + be_const_int(8), + be_const_int(9), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(91, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(7, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(29, 6), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(10, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(2), + be_const_int(3), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(57, -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(3), + be_const_int(5), + be_const_int(10), + be_const_int(15), + be_const_int(17), + be_const_int(18), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(1066, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(11, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(2), + be_const_int(8), + be_const_int(9), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(1043, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(11, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(2), + be_const_int(8), + be_const_int(9), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + })) ) } )) }, + { be_const_key_weak(JSON_NAME, -1), be_nested_str_weak(AirQuality) }, + })), + be_str_weak(Matter_Plugin_Sensor_Air_Quality) +); +/********************************************************************/ +/* End of solidification */ 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 f4124fc0dc27..9882dd40fd12 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 @@ -269,7 +269,7 @@ be_local_closure(class_Matter_Plugin_Sensor_Contact_read_attribute, /* name */ extern const bclass be_class_Matter_Plugin_Sensor_Contact; be_local_closure(class_Matter_Plugin_Sensor_Contact_update_virtual, /* name */ be_nested_proto( - 7, /* nstack */ + 10, /* nstack */ 2, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -277,42 +277,32 @@ be_local_closure(class_Matter_Plugin_Sensor_Contact_update_virtual, /* name */ 0, /* has sup protos */ &be_class_Matter_Plugin_Sensor_Contact, 1, /* has constants */ - ( &(const bvalue[ 6]) { /* constants */ - /* K0 */ be_nested_str_weak(find), - /* K1 */ be_nested_str_weak(Contact), - /* K2 */ be_nested_str_weak(shadow_contact), - /* K3 */ be_nested_str_weak(attribute_updated), - /* K4 */ be_const_int(0), - /* K5 */ be_nested_str_weak(update_virtual), + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(shadow_contact), + /* K1 */ be_nested_str_weak(_parse_update_virtual), + /* K2 */ be_nested_str_weak(Contact), + /* K3 */ be_const_int(0), + /* K4 */ be_nested_str_weak(update_virtual), }), be_str_weak(update_virtual), &be_const_str_solidified, - ( &(const binstruction[25]) { /* code */ - 0x8C080300, // 0000 GETMET R2 R1 K0 - 0x58100001, // 0001 LDCONST R4 K1 - 0x7C080400, // 0002 CALL R2 2 - 0x4C0C0000, // 0003 LDNIL R3 - 0x200C0403, // 0004 NE R3 R2 R3 - 0x780E000B, // 0005 JMPF R3 #0012 - 0x600C0017, // 0006 GETGBL R3 G23 - 0x5C100400, // 0007 MOVE R4 R2 - 0x7C0C0200, // 0008 CALL R3 1 - 0x5C080600, // 0009 MOVE R2 R3 - 0x880C0102, // 000A GETMBR R3 R0 K2 - 0x200C0602, // 000B NE R3 R3 R2 - 0x780E0004, // 000C JMPF R3 #0012 - 0x8C0C0103, // 000D GETMET R3 R0 K3 - 0x54160044, // 000E LDINT R5 69 - 0x58180004, // 000F LDCONST R6 K4 - 0x7C0C0600, // 0010 CALL R3 3 - 0x90020402, // 0011 SETMBR R0 K2 R2 - 0x600C0003, // 0012 GETGBL R3 G3 - 0x5C100000, // 0013 MOVE R4 R0 - 0x7C0C0200, // 0014 CALL R3 1 - 0x8C0C0705, // 0015 GETMET R3 R3 K5 - 0x5C140200, // 0016 MOVE R5 R1 - 0x7C0C0400, // 0017 CALL R3 2 - 0x80000000, // 0018 RET 0 + ( &(const binstruction[16]) { /* code */ + 0x8C080101, // 0000 GETMET R2 R0 K1 + 0x5C100200, // 0001 MOVE R4 R1 + 0x58140002, // 0002 LDCONST R5 K2 + 0x88180100, // 0003 GETMBR R6 R0 K0 + 0x601C0017, // 0004 GETGBL R7 G23 + 0x54220044, // 0005 LDINT R8 69 + 0x58240003, // 0006 LDCONST R9 K3 + 0x7C080E00, // 0007 CALL R2 7 + 0x90020002, // 0008 SETMBR R0 K0 R2 + 0x60080003, // 0009 GETGBL R2 G3 + 0x5C0C0000, // 000A MOVE R3 R0 + 0x7C080200, // 000B CALL R2 1 + 0x8C080504, // 000C GETMET R2 R2 K4 + 0x5C100200, // 000D MOVE R4 R1 + 0x7C080400, // 000E CALL R2 2 + 0x80000000, // 000F RET 0 }) ) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Sensor_Occupancy.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Sensor_Occupancy.h index eb2704d72dbe..d74be2a22e63 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Sensor_Occupancy.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Sensor_Occupancy.h @@ -39,7 +39,7 @@ be_local_closure(class_Matter_Plugin_Sensor_Occupancy__X3Clambda_X3E, /* name extern const bclass be_class_Matter_Plugin_Sensor_Occupancy; be_local_closure(class_Matter_Plugin_Sensor_Occupancy_update_virtual, /* name */ be_nested_proto( - 7, /* nstack */ + 10, /* nstack */ 2, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -47,42 +47,32 @@ be_local_closure(class_Matter_Plugin_Sensor_Occupancy_update_virtual, /* name 0, /* has sup protos */ &be_class_Matter_Plugin_Sensor_Occupancy, 1, /* has constants */ - ( &(const bvalue[ 6]) { /* constants */ - /* K0 */ be_nested_str_weak(find), - /* K1 */ be_nested_str_weak(Occupancy), - /* K2 */ be_nested_str_weak(shadow_occupancy), - /* K3 */ be_nested_str_weak(attribute_updated), - /* K4 */ be_const_int(0), - /* K5 */ be_nested_str_weak(update_virtual), + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(val_onoff), + /* K1 */ be_nested_str_weak(_parse_update_virtual), + /* K2 */ be_nested_str_weak(Occupancy), + /* K3 */ be_const_int(0), + /* K4 */ be_nested_str_weak(update_virtual), }), be_str_weak(update_virtual), &be_const_str_solidified, - ( &(const binstruction[25]) { /* code */ - 0x8C080300, // 0000 GETMET R2 R1 K0 - 0x58100001, // 0001 LDCONST R4 K1 - 0x7C080400, // 0002 CALL R2 2 - 0x4C0C0000, // 0003 LDNIL R3 - 0x200C0403, // 0004 NE R3 R2 R3 - 0x780E000B, // 0005 JMPF R3 #0012 - 0x600C0017, // 0006 GETGBL R3 G23 - 0x5C100400, // 0007 MOVE R4 R2 - 0x7C0C0200, // 0008 CALL R3 1 - 0x5C080600, // 0009 MOVE R2 R3 - 0x880C0102, // 000A GETMBR R3 R0 K2 - 0x200C0602, // 000B NE R3 R3 R2 - 0x780E0004, // 000C JMPF R3 #0012 - 0x8C0C0103, // 000D GETMET R3 R0 K3 - 0x54160405, // 000E LDINT R5 1030 - 0x58180004, // 000F LDCONST R6 K4 - 0x7C0C0600, // 0010 CALL R3 3 - 0x90020402, // 0011 SETMBR R0 K2 R2 - 0x600C0003, // 0012 GETGBL R3 G3 - 0x5C100000, // 0013 MOVE R4 R0 - 0x7C0C0200, // 0014 CALL R3 1 - 0x8C0C0705, // 0015 GETMET R3 R3 K5 - 0x5C140200, // 0016 MOVE R5 R1 - 0x7C0C0400, // 0017 CALL R3 2 - 0x80000000, // 0018 RET 0 + ( &(const binstruction[16]) { /* code */ + 0x8C080101, // 0000 GETMET R2 R0 K1 + 0x5C100200, // 0001 MOVE R4 R1 + 0x58140002, // 0002 LDCONST R5 K2 + 0x88180100, // 0003 GETMBR R6 R0 K0 + 0x601C0017, // 0004 GETGBL R7 G23 + 0x54220405, // 0005 LDINT R8 1030 + 0x58240003, // 0006 LDCONST R9 K3 + 0x7C080E00, // 0007 CALL R2 7 + 0x90020002, // 0008 SETMBR R0 K0 R2 + 0x60080003, // 0009 GETGBL R2 G3 + 0x5C0C0000, // 000A MOVE R3 R0 + 0x7C080200, // 000B CALL R2 1 + 0x8C080504, // 000C GETMET R2 R2 K4 + 0x5C100200, // 000D MOVE R4 R1 + 0x7C080400, // 000E CALL R2 2 + 0x80000000, // 000F RET 0 }) ) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Bridge_Sensor_Air_Quality.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Bridge_Sensor_Air_Quality.h new file mode 100644 index 000000000000..fa6b7f956a87 --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Bridge_Sensor_Air_Quality.h @@ -0,0 +1,404 @@ +/* Solidification of Matter_Plugin_3_Bridge_Sensor_Air_Quality.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_Plugin_Bridge_Sensor_Air_Quality; +// Borrowed method 'read_attribute' from class 'class_Matter_Plugin_Sensor_Air_Quality' +extern bclosure *class_Matter_Plugin_Sensor_Air_Quality_read_attribute; + +/******************************************************************** +** Solidified function: web_values +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Bridge_Sensor_Air_Quality; +be_local_closure(class_Matter_Plugin_Bridge_Sensor_Air_Quality_web_values, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 2]) { + be_nested_proto( + 9, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(webserver), + /* K1 */ be_nested_str_weak(content_send), + /* K2 */ be_nested_str_weak(_X25s_X20_X25i_X20), + }), + be_str_weak(web_values_single), + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x20080202, // 0001 NE R2 R1 R2 + 0x780A0007, // 0002 JMPF R2 #000B + 0xA40A0000, // 0003 IMPORT R2 K0 + 0x8C0C0501, // 0004 GETMET R3 R2 K1 + 0x60140018, // 0005 GETGBL R5 G24 + 0x58180002, // 0006 LDCONST R6 K2 + 0x5C1C0000, // 0007 MOVE R7 R0 + 0x5C200200, // 0008 MOVE R8 R1 + 0x7C140600, // 0009 CALL R5 3 + 0x7C0C0400, // 000A CALL R3 2 + 0x80000000, // 000B RET 0 + }) + ), + &be_class_Matter_Plugin_Bridge_Sensor_Air_Quality, + }), + 1, /* has constants */ + ( &(const bvalue[15]) { /* constants */ + /* K0 */ be_nested_str_weak(web_values_prefix), + /* K1 */ be_nested_str_weak(Air), + /* K2 */ be_nested_str_weak(shadow_air_quality), + /* K3 */ be_nested_str_weak(PM1), + /* K4 */ be_nested_str_weak(shadow_pm1), + /* K5 */ be_nested_str_weak(PM2_X2E5), + /* K6 */ be_nested_str_weak(shadow_pm2_5), + /* K7 */ be_nested_str_weak(PM10), + /* K8 */ be_nested_str_weak(shadow_pm10), + /* K9 */ be_nested_str_weak(CO2), + /* K10 */ be_nested_str_weak(shadow_co2), + /* K11 */ be_nested_str_weak(NO2), + /* K12 */ be_nested_str_weak(shadow_no2), + /* K13 */ be_nested_str_weak(TVOC), + /* K14 */ be_nested_str_weak(shadow_tvoc), + }), + be_str_weak(web_values), + &be_const_str_solidified, + ( &(const binstruction[32]) { /* code */ + 0x84040000, // 0000 CLOSURE R1 P0 + 0x8C080100, // 0001 GETMET R2 R0 K0 + 0x7C080200, // 0002 CALL R2 1 + 0x5C080200, // 0003 MOVE R2 R1 + 0x580C0001, // 0004 LDCONST R3 K1 + 0x88100102, // 0005 GETMBR R4 R0 K2 + 0x7C080400, // 0006 CALL R2 2 + 0x5C080200, // 0007 MOVE R2 R1 + 0x580C0003, // 0008 LDCONST R3 K3 + 0x88100104, // 0009 GETMBR R4 R0 K4 + 0x7C080400, // 000A CALL R2 2 + 0x5C080200, // 000B MOVE R2 R1 + 0x580C0005, // 000C LDCONST R3 K5 + 0x88100106, // 000D GETMBR R4 R0 K6 + 0x7C080400, // 000E CALL R2 2 + 0x5C080200, // 000F MOVE R2 R1 + 0x580C0007, // 0010 LDCONST R3 K7 + 0x88100108, // 0011 GETMBR R4 R0 K8 + 0x7C080400, // 0012 CALL R2 2 + 0x5C080200, // 0013 MOVE R2 R1 + 0x580C0009, // 0014 LDCONST R3 K9 + 0x8810010A, // 0015 GETMBR R4 R0 K10 + 0x7C080400, // 0016 CALL R2 2 + 0x5C080200, // 0017 MOVE R2 R1 + 0x580C000B, // 0018 LDCONST R3 K11 + 0x8810010C, // 0019 GETMBR R4 R0 K12 + 0x7C080400, // 001A CALL R2 2 + 0x5C080200, // 001B MOVE R2 R1 + 0x580C000D, // 001C LDCONST R3 K13 + 0x8810010E, // 001D GETMBR R4 R0 K14 + 0x7C080400, // 001E CALL R2 2 + 0x80000000, // 001F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Bridge_Sensor_Air_Quality; +be_local_closure(class_Matter_Plugin_Bridge_Sensor_Air_Quality_init, /* name */ + be_nested_proto( + 9, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_Plugin_Bridge_Sensor_Air_Quality, + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(init), + /* K1 */ be_nested_str_weak(prefix), + /* K2 */ be_nested_str_weak(find), + /* K3 */ be_nested_str_weak(ARG), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[15]) { /* 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 + 0x60100008, // 0008 GETGBL R4 G8 + 0x8C140702, // 0009 GETMET R5 R3 K2 + 0x881C0103, // 000A GETMBR R7 R0 K3 + 0x7C140400, // 000B CALL R5 2 + 0x7C100200, // 000C CALL R4 1 + 0x90020204, // 000D SETMBR R0 K1 R4 + 0x80000000, // 000E RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: parse_update +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Bridge_Sensor_Air_Quality; +be_local_closure(class_Matter_Plugin_Bridge_Sensor_Air_Quality_parse_update, /* name */ + be_nested_proto( + 6, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_Plugin_Bridge_Sensor_Air_Quality, + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(find), + /* K1 */ be_nested_str_weak(prefix), + }), + be_str_weak(parse_update), + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x540E0007, // 0000 LDINT R3 8 + 0x1C0C0403, // 0001 EQ R3 R2 R3 + 0x780E0002, // 0002 JMPF R3 #0006 + 0x8C0C0300, // 0003 GETMET R3 R1 K0 + 0x88140101, // 0004 GETMBR R5 R0 K1 + 0x7C0C0400, // 0005 CALL R3 2 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_Plugin_Bridge_Sensor_Air_Quality +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Bridge_HTTP; +be_local_class(Matter_Plugin_Bridge_Sensor_Air_Quality, + 8, + &be_class_Matter_Plugin_Bridge_HTTP, + be_nested_map(20, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(UPDATE_CMD, -1), be_nested_str_weak(Status_X208) }, + { be_const_key_weak(DISPLAY_NAME, -1), be_nested_str_weak(Air_X20Quality) }, + { be_const_key_weak(shadow_tvoc, 8), be_const_var(7) }, + { be_const_key_weak(shadow_pm10, 7), be_const_var(4) }, + { be_const_key_weak(shadow_pm2_5, -1), be_const_var(3) }, + { be_const_key_weak(ARG_HINT, -1), be_nested_str_weak(Sensor_X20Model) }, + { be_const_key_weak(shadow_co2, -1), be_const_var(5) }, + { be_const_key_weak(parse_update, 18), be_const_closure(class_Matter_Plugin_Bridge_Sensor_Air_Quality_parse_update_closure) }, + { be_const_key_weak(read_attribute, -1), be_const_closure(class_Matter_Plugin_Sensor_Air_Quality_read_attribute_closure) }, + { be_const_key_weak(prefix, 13), be_const_var(0) }, + { be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + be_const_map( * be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_int(44, -1), be_const_int(1) }, + })) ) } )) }, + { be_const_key_weak(web_values, -1), be_const_closure(class_Matter_Plugin_Bridge_Sensor_Air_Quality_web_values_closure) }, + { be_const_key_weak(shadow_pm1, 11), be_const_var(2) }, + { be_const_key_weak(TYPE, -1), be_nested_str_weak(http_airquality) }, + { be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + be_const_map( * be_nested_map(12, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_int(1068, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(11, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(2), + be_const_int(8), + be_const_int(9), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(1069, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(11, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(2), + be_const_int(8), + be_const_int(9), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(1070, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(11, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(2), + be_const_int(8), + be_const_int(9), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(3, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(8, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(4, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(7, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(5, 8), 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(1), + be_const_int(2), + be_const_int(3), + be_const_int(4), + be_const_int(5), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(1037, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(11, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(2), + be_const_int(8), + be_const_int(9), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(91, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(7, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(29, 6), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(10, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(2), + be_const_int(3), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(57, -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(3), + be_const_int(5), + be_const_int(10), + be_const_int(15), + be_const_int(17), + be_const_int(18), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(1066, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(11, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(2), + be_const_int(8), + be_const_int(9), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(1043, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(11, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(2), + be_const_int(8), + be_const_int(9), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + })) ) } )) }, + { be_const_key_weak(init, -1), be_const_closure(class_Matter_Plugin_Bridge_Sensor_Air_Quality_init_closure) }, + { be_const_key_weak(UPDATE_TIME, 3), be_const_int(5000) }, + { be_const_key_weak(shadow_no2, 4), be_const_var(6) }, + { be_const_key_weak(shadow_air_quality, -1), be_const_var(1) }, + { be_const_key_weak(ARG, 0), be_nested_str_weak(airquality) }, + })), + be_str_weak(Matter_Plugin_Bridge_Sensor_Air_Quality) +); +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Light2.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Light2.h index cdf9539d223b..c69dec160baf 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Light2.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Light2.h @@ -340,21 +340,22 @@ be_local_closure(class_Matter_Plugin_Light2_read_attribute, /* name */ 0, /* has sup protos */ &be_class_Matter_Plugin_Light2, 1, /* has constants */ - ( &(const bvalue[14]) { /* constants */ + ( &(const bvalue[15]) { /* constants */ /* K0 */ be_nested_str_weak(matter), /* K1 */ be_nested_str_weak(TLV), /* K2 */ be_nested_str_weak(cluster), /* K3 */ be_nested_str_weak(attribute), /* K4 */ be_nested_str_weak(update_shadow_lazy), - /* K5 */ be_nested_str_weak(set), + /* K5 */ be_nested_str_weak(set_or_nil), /* K6 */ be_nested_str_weak(U1), /* K7 */ be_nested_str_weak(shadow_ct), - /* K8 */ be_const_int(2), - /* K9 */ be_const_int(0), - /* K10 */ be_nested_str_weak(ct_min), - /* K11 */ be_nested_str_weak(ct_max), - /* K12 */ be_nested_str_weak(U4), - /* K13 */ be_nested_str_weak(read_attribute), + /* K8 */ be_nested_str_weak(set), + /* K9 */ be_const_int(2), + /* K10 */ be_const_int(0), + /* K11 */ be_nested_str_weak(ct_min), + /* K12 */ be_nested_str_weak(ct_max), + /* K13 */ be_nested_str_weak(U4), + /* K14 */ be_nested_str_weak(read_attribute), }), be_str_weak(read_attribute), &be_const_str_solidified, @@ -380,51 +381,51 @@ be_local_closure(class_Matter_Plugin_Light2_read_attribute, /* name */ 0x541E0007, // 0012 LDINT R7 8 0x1C1C0C07, // 0013 EQ R7 R6 R7 0x781E0005, // 0014 JMPF R7 #001B - 0x8C1C0705, // 0015 GETMET R7 R3 K5 + 0x8C1C0708, // 0015 GETMET R7 R3 K8 0x88240906, // 0016 GETMBR R9 R4 K6 - 0x58280008, // 0017 LDCONST R10 K8 + 0x58280009, // 0017 LDCONST R10 K9 0x7C1C0600, // 0018 CALL R7 3 0x80040E00, // 0019 RET 1 R7 0x70020022, // 001A JMP #003E 0x541E000E, // 001B LDINT R7 15 0x1C1C0C07, // 001C EQ R7 R6 R7 0x781E0005, // 001D JMPF R7 #0024 - 0x8C1C0705, // 001E GETMET R7 R3 K5 + 0x8C1C0708, // 001E GETMET R7 R3 K8 0x88240906, // 001F GETMBR R9 R4 K6 - 0x58280009, // 0020 LDCONST R10 K9 + 0x5828000A, // 0020 LDCONST R10 K10 0x7C1C0600, // 0021 CALL R7 3 0x80040E00, // 0022 RET 1 R7 0x70020019, // 0023 JMP #003E 0x541E400A, // 0024 LDINT R7 16395 0x1C1C0C07, // 0025 EQ R7 R6 R7 0x781E0005, // 0026 JMPF R7 #002D - 0x8C1C0705, // 0027 GETMET R7 R3 K5 + 0x8C1C0708, // 0027 GETMET R7 R3 K8 0x88240906, // 0028 GETMBR R9 R4 K6 - 0x8828010A, // 0029 GETMBR R10 R0 K10 + 0x8828010B, // 0029 GETMBR R10 R0 K11 0x7C1C0600, // 002A CALL R7 3 0x80040E00, // 002B RET 1 R7 0x70020010, // 002C JMP #003E 0x541E400B, // 002D LDINT R7 16396 0x1C1C0C07, // 002E EQ R7 R6 R7 0x781E0005, // 002F JMPF R7 #0036 - 0x8C1C0705, // 0030 GETMET R7 R3 K5 + 0x8C1C0708, // 0030 GETMET R7 R3 K8 0x88240906, // 0031 GETMBR R9 R4 K6 - 0x8828010B, // 0032 GETMBR R10 R0 K11 + 0x8828010C, // 0032 GETMBR R10 R0 K12 0x7C1C0600, // 0033 CALL R7 3 0x80040E00, // 0034 RET 1 R7 0x70020007, // 0035 JMP #003E 0x541EFFFB, // 0036 LDINT R7 65532 0x1C1C0C07, // 0037 EQ R7 R6 R7 0x781E0004, // 0038 JMPF R7 #003E - 0x8C1C0705, // 0039 GETMET R7 R3 K5 - 0x8824090C, // 003A GETMBR R9 R4 K12 + 0x8C1C0708, // 0039 GETMET R7 R3 K8 + 0x8824090D, // 003A GETMBR R9 R4 K13 0x542A000F, // 003B LDINT R10 16 0x7C1C0600, // 003C CALL R7 3 0x80040E00, // 003D RET 1 R7 0x601C0003, // 003E GETGBL R7 G3 0x5C200000, // 003F MOVE R8 R0 0x7C1C0200, // 0040 CALL R7 1 - 0x8C1C0F0D, // 0041 GETMET R7 R7 K13 + 0x8C1C0F0E, // 0041 GETMET R7 R7 K14 0x5C240200, // 0042 MOVE R9 R1 0x5C280400, // 0043 MOVE R10 R2 0x5C2C0600, // 0044 MOVE R11 R3 diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Light3.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Light3.h index 2a4feefc7e61..8df599ab7079 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Light3.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Light3.h @@ -531,20 +531,21 @@ be_local_closure(class_Matter_Plugin_Light3_read_attribute, /* name */ 0, /* has sup protos */ &be_class_Matter_Plugin_Light3, 1, /* has constants */ - ( &(const bvalue[13]) { /* constants */ + ( &(const bvalue[14]) { /* constants */ /* K0 */ be_nested_str_weak(matter), /* K1 */ be_nested_str_weak(TLV), /* K2 */ be_nested_str_weak(cluster), /* K3 */ be_nested_str_weak(attribute), /* K4 */ be_nested_str_weak(update_shadow_lazy), /* K5 */ be_const_int(0), - /* K6 */ be_nested_str_weak(set), + /* K6 */ be_nested_str_weak(set_or_nil), /* K7 */ be_nested_str_weak(U1), /* K8 */ be_nested_str_weak(shadow_hue), /* K9 */ be_const_int(1), /* K10 */ be_nested_str_weak(shadow_sat), - /* K11 */ be_nested_str_weak(U4), - /* K12 */ be_nested_str_weak(read_attribute), + /* K11 */ be_nested_str_weak(set), + /* K12 */ be_nested_str_weak(U4), + /* K13 */ be_nested_str_weak(read_attribute), }), be_str_weak(read_attribute), &be_const_str_solidified, @@ -577,7 +578,7 @@ be_local_closure(class_Matter_Plugin_Light3_read_attribute, /* name */ 0x541E0006, // 0019 LDINT R7 7 0x1C1C0C07, // 001A EQ R7 R6 R7 0x781E0005, // 001B JMPF R7 #0022 - 0x8C1C0706, // 001C GETMET R7 R3 K6 + 0x8C1C070B, // 001C GETMET R7 R3 K11 0x88240907, // 001D GETMBR R9 R4 K7 0x58280005, // 001E LDCONST R10 K5 0x7C1C0600, // 001F CALL R7 3 @@ -586,7 +587,7 @@ be_local_closure(class_Matter_Plugin_Light3_read_attribute, /* name */ 0x541E0007, // 0022 LDINT R7 8 0x1C1C0C07, // 0023 EQ R7 R6 R7 0x781E0005, // 0024 JMPF R7 #002B - 0x8C1C0706, // 0025 GETMET R7 R3 K6 + 0x8C1C070B, // 0025 GETMET R7 R3 K11 0x88240907, // 0026 GETMBR R9 R4 K7 0x58280005, // 0027 LDCONST R10 K5 0x7C1C0600, // 0028 CALL R7 3 @@ -595,7 +596,7 @@ be_local_closure(class_Matter_Plugin_Light3_read_attribute, /* name */ 0x541E000E, // 002B LDINT R7 15 0x1C1C0C07, // 002C EQ R7 R6 R7 0x781E0005, // 002D JMPF R7 #0034 - 0x8C1C0706, // 002E GETMET R7 R3 K6 + 0x8C1C070B, // 002E GETMET R7 R3 K11 0x88240907, // 002F GETMBR R9 R4 K7 0x58280005, // 0030 LDCONST R10 K5 0x7C1C0600, // 0031 CALL R7 3 @@ -604,7 +605,7 @@ be_local_closure(class_Matter_Plugin_Light3_read_attribute, /* name */ 0x541E4000, // 0034 LDINT R7 16385 0x1C1C0C07, // 0035 EQ R7 R6 R7 0x781E0005, // 0036 JMPF R7 #003D - 0x8C1C0706, // 0037 GETMET R7 R3 K6 + 0x8C1C070B, // 0037 GETMET R7 R3 K11 0x88240907, // 0038 GETMBR R9 R4 K7 0x58280005, // 0039 LDCONST R10 K5 0x7C1C0600, // 003A CALL R7 3 @@ -613,7 +614,7 @@ be_local_closure(class_Matter_Plugin_Light3_read_attribute, /* name */ 0x541E4009, // 003D LDINT R7 16394 0x1C1C0C07, // 003E EQ R7 R6 R7 0x781E0005, // 003F JMPF R7 #0046 - 0x8C1C0706, // 0040 GETMET R7 R3 K6 + 0x8C1C070B, // 0040 GETMET R7 R3 K11 0x88240907, // 0041 GETMBR R9 R4 K7 0x58280009, // 0042 LDCONST R10 K9 0x7C1C0600, // 0043 CALL R7 3 @@ -622,7 +623,7 @@ be_local_closure(class_Matter_Plugin_Light3_read_attribute, /* name */ 0x541E000F, // 0046 LDINT R7 16 0x1C1C0C07, // 0047 EQ R7 R6 R7 0x781E0005, // 0048 JMPF R7 #004F - 0x8C1C0706, // 0049 GETMET R7 R3 K6 + 0x8C1C070B, // 0049 GETMET R7 R3 K11 0x88240907, // 004A GETMBR R9 R4 K7 0x58280005, // 004B LDCONST R10 K5 0x7C1C0600, // 004C CALL R7 3 @@ -631,15 +632,15 @@ be_local_closure(class_Matter_Plugin_Light3_read_attribute, /* name */ 0x541EFFFB, // 004F LDINT R7 65532 0x1C1C0C07, // 0050 EQ R7 R6 R7 0x781E0004, // 0051 JMPF R7 #0057 - 0x8C1C0706, // 0052 GETMET R7 R3 K6 - 0x8824090B, // 0053 GETMBR R9 R4 K11 + 0x8C1C070B, // 0052 GETMET R7 R3 K11 + 0x8824090C, // 0053 GETMBR R9 R4 K12 0x58280009, // 0054 LDCONST R10 K9 0x7C1C0600, // 0055 CALL R7 3 0x80040E00, // 0056 RET 1 R7 0x601C0003, // 0057 GETGBL R7 G3 0x5C200000, // 0058 MOVE R8 R0 0x7C1C0200, // 0059 CALL R7 1 - 0x8C1C0F0C, // 005A GETMET R7 R7 K12 + 0x8C1C0F0D, // 005A GETMET R7 R7 K13 0x5C240200, // 005B MOVE R9 R1 0x5C280400, // 005C MOVE R10 R2 0x5C2C0600, // 005D MOVE R11 R3 diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Flow.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Flow.h index 2bd05cb2ed78..b8f7cb5b0424 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Flow.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Flow.h @@ -71,94 +71,8 @@ be_local_closure(class_Matter_Plugin_Bridge_Sensor_Flow_value_changed, /* name ); /*******************************************************************/ - -/******************************************************************** -** Solidified function: read_attribute -********************************************************************/ -extern const bclass be_class_Matter_Plugin_Bridge_Sensor_Flow; -be_local_closure(class_Matter_Plugin_Bridge_Sensor_Flow_read_attribute, /* name */ - be_nested_proto( - 12, /* nstack */ - 4, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - &be_class_Matter_Plugin_Bridge_Sensor_Flow, - 1, /* has constants */ - ( &(const bvalue[12]) { /* constants */ - /* K0 */ be_nested_str_weak(matter), - /* K1 */ be_nested_str_weak(TLV), - /* K2 */ be_nested_str_weak(cluster), - /* K3 */ be_nested_str_weak(attribute), - /* K4 */ be_const_int(0), - /* K5 */ be_nested_str_weak(shadow_value), - /* K6 */ be_nested_str_weak(set), - /* K7 */ be_nested_str_weak(U2), - /* K8 */ be_nested_str_weak(NULL), - /* K9 */ be_const_int(1), - /* K10 */ be_const_int(2), - /* K11 */ be_nested_str_weak(read_attribute), - }), - be_str_weak(read_attribute), - &be_const_str_solidified, - ( &(const binstruction[51]) { /* code */ - 0xB8120000, // 0000 GETNGBL R4 K0 - 0x88100901, // 0001 GETMBR R4 R4 K1 - 0x88140502, // 0002 GETMBR R5 R2 K2 - 0x88180503, // 0003 GETMBR R6 R2 K3 - 0x541E0403, // 0004 LDINT R7 1028 - 0x1C1C0A07, // 0005 EQ R7 R5 R7 - 0x781E0022, // 0006 JMPF R7 #002A - 0x1C1C0D04, // 0007 EQ R7 R6 K4 - 0x781E0011, // 0008 JMPF R7 #001B - 0x881C0105, // 0009 GETMBR R7 R0 K5 - 0x4C200000, // 000A LDNIL R8 - 0x201C0E08, // 000B NE R7 R7 R8 - 0x781E0007, // 000C JMPF R7 #0015 - 0x8C1C0706, // 000D GETMET R7 R3 K6 - 0x88240907, // 000E GETMBR R9 R4 K7 - 0x60280009, // 000F GETGBL R10 G9 - 0x882C0105, // 0010 GETMBR R11 R0 K5 - 0x7C280200, // 0011 CALL R10 1 - 0x7C1C0600, // 0012 CALL R7 3 - 0x80040E00, // 0013 RET 1 R7 - 0x70020004, // 0014 JMP #001A - 0x8C1C0706, // 0015 GETMET R7 R3 K6 - 0x88240908, // 0016 GETMBR R9 R4 K8 - 0x4C280000, // 0017 LDNIL R10 - 0x7C1C0600, // 0018 CALL R7 3 - 0x80040E00, // 0019 RET 1 R7 - 0x7002000E, // 001A JMP #002A - 0x1C1C0D09, // 001B EQ R7 R6 K9 - 0x781E0005, // 001C JMPF R7 #0023 - 0x8C1C0706, // 001D GETMET R7 R3 K6 - 0x88240907, // 001E GETMBR R9 R4 K7 - 0x58280004, // 001F LDCONST R10 K4 - 0x7C1C0600, // 0020 CALL R7 3 - 0x80040E00, // 0021 RET 1 R7 - 0x70020006, // 0022 JMP #002A - 0x1C1C0D0A, // 0023 EQ R7 R6 K10 - 0x781E0004, // 0024 JMPF R7 #002A - 0x8C1C0706, // 0025 GETMET R7 R3 K6 - 0x88240907, // 0026 GETMBR R9 R4 K7 - 0x542AFFFD, // 0027 LDINT R10 65534 - 0x7C1C0600, // 0028 CALL R7 3 - 0x80040E00, // 0029 RET 1 R7 - 0x601C0003, // 002A GETGBL R7 G3 - 0x5C200000, // 002B MOVE R8 R0 - 0x7C1C0200, // 002C CALL R7 1 - 0x8C1C0F0B, // 002D GETMET R7 R7 K11 - 0x5C240200, // 002E MOVE R9 R1 - 0x5C280400, // 002F MOVE R10 R2 - 0x5C2C0600, // 0030 MOVE R11 R3 - 0x7C1C0800, // 0031 CALL R7 4 - 0x80040E00, // 0032 RET 1 R7 - }) - ) -); -/*******************************************************************/ - +// Borrowed method 'read_attribute' from class 'class_Matter_Plugin_Sensor_Flow' +extern bclosure *class_Matter_Plugin_Sensor_Flow_read_attribute; /******************************************************************** ** Solidified function: web_values @@ -218,7 +132,7 @@ be_local_class(Matter_Plugin_Bridge_Sensor_Flow, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(774, -1), be_const_int(1) }, })) ) } )) }, - { be_const_key_weak(read_attribute, 7), be_const_closure(class_Matter_Plugin_Bridge_Sensor_Flow_read_attribute_closure) }, + { be_const_key_weak(read_attribute, 7), be_const_static_closure(class_Matter_Plugin_Sensor_Flow_read_attribute_closure) }, { be_const_key_weak(value_changed, 6), be_const_closure(class_Matter_Plugin_Bridge_Sensor_Flow_value_changed_closure) }, { be_const_key_weak(DISPLAY_NAME, 4), be_nested_str_weak(Flow) }, { be_const_key_weak(TYPE, -1), be_nested_str_weak(http_flow) }, diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Humidity.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Humidity.h index 5805df777c24..0c1681ff3c01 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Humidity.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Humidity.h @@ -71,94 +71,8 @@ be_local_closure(class_Matter_Plugin_Bridge_Sensor_Humidity_value_changed, /* ); /*******************************************************************/ - -/******************************************************************** -** Solidified function: read_attribute -********************************************************************/ -extern const bclass be_class_Matter_Plugin_Bridge_Sensor_Humidity; -be_local_closure(class_Matter_Plugin_Bridge_Sensor_Humidity_read_attribute, /* name */ - be_nested_proto( - 12, /* nstack */ - 4, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - &be_class_Matter_Plugin_Bridge_Sensor_Humidity, - 1, /* has constants */ - ( &(const bvalue[12]) { /* constants */ - /* K0 */ be_nested_str_weak(matter), - /* K1 */ be_nested_str_weak(TLV), - /* K2 */ be_nested_str_weak(cluster), - /* K3 */ be_nested_str_weak(attribute), - /* K4 */ be_const_int(0), - /* K5 */ be_nested_str_weak(shadow_value), - /* K6 */ be_nested_str_weak(set), - /* K7 */ be_nested_str_weak(U2), - /* K8 */ be_nested_str_weak(NULL), - /* K9 */ be_const_int(1), - /* K10 */ be_const_int(2), - /* K11 */ be_nested_str_weak(read_attribute), - }), - be_str_weak(read_attribute), - &be_const_str_solidified, - ( &(const binstruction[51]) { /* code */ - 0xB8120000, // 0000 GETNGBL R4 K0 - 0x88100901, // 0001 GETMBR R4 R4 K1 - 0x88140502, // 0002 GETMBR R5 R2 K2 - 0x88180503, // 0003 GETMBR R6 R2 K3 - 0x541E0404, // 0004 LDINT R7 1029 - 0x1C1C0A07, // 0005 EQ R7 R5 R7 - 0x781E0022, // 0006 JMPF R7 #002A - 0x1C1C0D04, // 0007 EQ R7 R6 K4 - 0x781E0011, // 0008 JMPF R7 #001B - 0x881C0105, // 0009 GETMBR R7 R0 K5 - 0x4C200000, // 000A LDNIL R8 - 0x201C0E08, // 000B NE R7 R7 R8 - 0x781E0007, // 000C JMPF R7 #0015 - 0x8C1C0706, // 000D GETMET R7 R3 K6 - 0x88240907, // 000E GETMBR R9 R4 K7 - 0x60280009, // 000F GETGBL R10 G9 - 0x882C0105, // 0010 GETMBR R11 R0 K5 - 0x7C280200, // 0011 CALL R10 1 - 0x7C1C0600, // 0012 CALL R7 3 - 0x80040E00, // 0013 RET 1 R7 - 0x70020004, // 0014 JMP #001A - 0x8C1C0706, // 0015 GETMET R7 R3 K6 - 0x88240908, // 0016 GETMBR R9 R4 K8 - 0x4C280000, // 0017 LDNIL R10 - 0x7C1C0600, // 0018 CALL R7 3 - 0x80040E00, // 0019 RET 1 R7 - 0x7002000E, // 001A JMP #002A - 0x1C1C0D09, // 001B EQ R7 R6 K9 - 0x781E0005, // 001C JMPF R7 #0023 - 0x8C1C0706, // 001D GETMET R7 R3 K6 - 0x88240907, // 001E GETMBR R9 R4 K7 - 0x542A01F3, // 001F LDINT R10 500 - 0x7C1C0600, // 0020 CALL R7 3 - 0x80040E00, // 0021 RET 1 R7 - 0x70020006, // 0022 JMP #002A - 0x1C1C0D0A, // 0023 EQ R7 R6 K10 - 0x781E0004, // 0024 JMPF R7 #002A - 0x8C1C0706, // 0025 GETMET R7 R3 K6 - 0x88240907, // 0026 GETMBR R9 R4 K7 - 0x542A270F, // 0027 LDINT R10 10000 - 0x7C1C0600, // 0028 CALL R7 3 - 0x80040E00, // 0029 RET 1 R7 - 0x601C0003, // 002A GETGBL R7 G3 - 0x5C200000, // 002B MOVE R8 R0 - 0x7C1C0200, // 002C CALL R7 1 - 0x8C1C0F0B, // 002D GETMET R7 R7 K11 - 0x5C240200, // 002E MOVE R9 R1 - 0x5C280400, // 002F MOVE R10 R2 - 0x5C2C0600, // 0030 MOVE R11 R3 - 0x7C1C0800, // 0031 CALL R7 4 - 0x80040E00, // 0032 RET 1 R7 - }) - ) -); -/*******************************************************************/ - +// Borrowed method 'read_attribute' from class 'class_Matter_Plugin_Sensor_Humidity' +extern bclosure *class_Matter_Plugin_Sensor_Humidity_read_attribute; /******************************************************************** ** Solidified function: web_values @@ -226,7 +140,7 @@ be_local_class(Matter_Plugin_Bridge_Sensor_Humidity, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(775, -1), be_const_int(2) }, })) ) } )) }, - { be_const_key_weak(read_attribute, 7), be_const_closure(class_Matter_Plugin_Bridge_Sensor_Humidity_read_attribute_closure) }, + { be_const_key_weak(read_attribute, 7), be_const_closure(class_Matter_Plugin_Sensor_Humidity_read_attribute_closure) }, { be_const_key_weak(value_changed, 6), be_const_closure(class_Matter_Plugin_Bridge_Sensor_Humidity_value_changed_closure) }, { be_const_key_weak(DISPLAY_NAME, 4), be_nested_str_weak(Humidity) }, { be_const_key_weak(TYPE, -1), be_nested_str_weak(http_humidity) }, diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Illuminance.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Illuminance.h index e31c317b6eb4..49558b390918 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Illuminance.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Illuminance.h @@ -83,94 +83,8 @@ be_local_closure(class_Matter_Plugin_Bridge_Sensor_Illuminance_value_changed, ); /*******************************************************************/ - -/******************************************************************** -** Solidified function: read_attribute -********************************************************************/ -extern const bclass be_class_Matter_Plugin_Bridge_Sensor_Illuminance; -be_local_closure(class_Matter_Plugin_Bridge_Sensor_Illuminance_read_attribute, /* name */ - be_nested_proto( - 12, /* nstack */ - 4, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - &be_class_Matter_Plugin_Bridge_Sensor_Illuminance, - 1, /* has constants */ - ( &(const bvalue[12]) { /* constants */ - /* K0 */ be_nested_str_weak(matter), - /* K1 */ be_nested_str_weak(TLV), - /* K2 */ be_nested_str_weak(cluster), - /* K3 */ be_nested_str_weak(attribute), - /* K4 */ be_const_int(0), - /* K5 */ be_nested_str_weak(shadow_value), - /* K6 */ be_nested_str_weak(set), - /* K7 */ be_nested_str_weak(U2), - /* K8 */ be_nested_str_weak(NULL), - /* K9 */ be_const_int(1), - /* K10 */ be_const_int(2), - /* K11 */ be_nested_str_weak(read_attribute), - }), - be_str_weak(read_attribute), - &be_const_str_solidified, - ( &(const binstruction[51]) { /* code */ - 0xB8120000, // 0000 GETNGBL R4 K0 - 0x88100901, // 0001 GETMBR R4 R4 K1 - 0x88140502, // 0002 GETMBR R5 R2 K2 - 0x88180503, // 0003 GETMBR R6 R2 K3 - 0x541E03FF, // 0004 LDINT R7 1024 - 0x1C1C0A07, // 0005 EQ R7 R5 R7 - 0x781E0022, // 0006 JMPF R7 #002A - 0x1C1C0D04, // 0007 EQ R7 R6 K4 - 0x781E0011, // 0008 JMPF R7 #001B - 0x881C0105, // 0009 GETMBR R7 R0 K5 - 0x4C200000, // 000A LDNIL R8 - 0x201C0E08, // 000B NE R7 R7 R8 - 0x781E0007, // 000C JMPF R7 #0015 - 0x8C1C0706, // 000D GETMET R7 R3 K6 - 0x88240907, // 000E GETMBR R9 R4 K7 - 0x60280009, // 000F GETGBL R10 G9 - 0x882C0105, // 0010 GETMBR R11 R0 K5 - 0x7C280200, // 0011 CALL R10 1 - 0x7C1C0600, // 0012 CALL R7 3 - 0x80040E00, // 0013 RET 1 R7 - 0x70020004, // 0014 JMP #001A - 0x8C1C0706, // 0015 GETMET R7 R3 K6 - 0x88240908, // 0016 GETMBR R9 R4 K8 - 0x4C280000, // 0017 LDNIL R10 - 0x7C1C0600, // 0018 CALL R7 3 - 0x80040E00, // 0019 RET 1 R7 - 0x7002000E, // 001A JMP #002A - 0x1C1C0D09, // 001B EQ R7 R6 K9 - 0x781E0005, // 001C JMPF R7 #0023 - 0x8C1C0706, // 001D GETMET R7 R3 K6 - 0x88240907, // 001E GETMBR R9 R4 K7 - 0x58280009, // 001F LDCONST R10 K9 - 0x7C1C0600, // 0020 CALL R7 3 - 0x80040E00, // 0021 RET 1 R7 - 0x70020006, // 0022 JMP #002A - 0x1C1C0D0A, // 0023 EQ R7 R6 K10 - 0x781E0004, // 0024 JMPF R7 #002A - 0x8C1C0706, // 0025 GETMET R7 R3 K6 - 0x88240907, // 0026 GETMBR R9 R4 K7 - 0x542AFFFD, // 0027 LDINT R10 65534 - 0x7C1C0600, // 0028 CALL R7 3 - 0x80040E00, // 0029 RET 1 R7 - 0x601C0003, // 002A GETGBL R7 G3 - 0x5C200000, // 002B MOVE R8 R0 - 0x7C1C0200, // 002C CALL R7 1 - 0x8C1C0F0B, // 002D GETMET R7 R7 K11 - 0x5C240200, // 002E MOVE R9 R1 - 0x5C280400, // 002F MOVE R10 R2 - 0x5C2C0600, // 0030 MOVE R11 R3 - 0x7C1C0800, // 0031 CALL R7 4 - 0x80040E00, // 0032 RET 1 R7 - }) - ) -); -/*******************************************************************/ - +// Borrowed method 'read_attribute' from class 'class_Matter_Plugin_Sensor_Illuminance' +extern bclosure *class_Matter_Plugin_Sensor_Illuminance_read_attribute; /******************************************************************** ** Solidified function: web_values @@ -230,7 +144,7 @@ be_local_class(Matter_Plugin_Bridge_Sensor_Illuminance, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(262, -1), be_const_int(2) }, })) ) } )) }, - { be_const_key_weak(read_attribute, 7), be_const_closure(class_Matter_Plugin_Bridge_Sensor_Illuminance_read_attribute_closure) }, + { be_const_key_weak(read_attribute, 7), be_const_closure(class_Matter_Plugin_Sensor_Illuminance_read_attribute_closure) }, { be_const_key_weak(value_changed, 6), be_const_closure(class_Matter_Plugin_Bridge_Sensor_Illuminance_value_changed_closure) }, { be_const_key_weak(DISPLAY_NAME, 4), be_nested_str_weak(Illuminance) }, { be_const_key_weak(TYPE, -1), be_nested_str_weak(http_illuminance) }, diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Pressure.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Pressure.h index 1e4078565a32..4a8cf45cdb8f 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Pressure.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Pressure.h @@ -70,94 +70,8 @@ be_local_closure(class_Matter_Plugin_Bridge_Sensor_Pressure_value_changed, /* ); /*******************************************************************/ - -/******************************************************************** -** Solidified function: read_attribute -********************************************************************/ -extern const bclass be_class_Matter_Plugin_Bridge_Sensor_Pressure; -be_local_closure(class_Matter_Plugin_Bridge_Sensor_Pressure_read_attribute, /* name */ - be_nested_proto( - 12, /* nstack */ - 4, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - &be_class_Matter_Plugin_Bridge_Sensor_Pressure, - 1, /* has constants */ - ( &(const bvalue[12]) { /* constants */ - /* K0 */ be_nested_str_weak(matter), - /* K1 */ be_nested_str_weak(TLV), - /* K2 */ be_nested_str_weak(cluster), - /* K3 */ be_nested_str_weak(attribute), - /* K4 */ be_const_int(0), - /* K5 */ be_nested_str_weak(shadow_value), - /* K6 */ be_nested_str_weak(set), - /* K7 */ be_nested_str_weak(I2), - /* K8 */ be_nested_str_weak(NULL), - /* K9 */ be_const_int(1), - /* K10 */ be_const_int(2), - /* K11 */ be_nested_str_weak(read_attribute), - }), - be_str_weak(read_attribute), - &be_const_str_solidified, - ( &(const binstruction[51]) { /* code */ - 0xB8120000, // 0000 GETNGBL R4 K0 - 0x88100901, // 0001 GETMBR R4 R4 K1 - 0x88140502, // 0002 GETMBR R5 R2 K2 - 0x88180503, // 0003 GETMBR R6 R2 K3 - 0x541E0402, // 0004 LDINT R7 1027 - 0x1C1C0A07, // 0005 EQ R7 R5 R7 - 0x781E0022, // 0006 JMPF R7 #002A - 0x1C1C0D04, // 0007 EQ R7 R6 K4 - 0x781E0011, // 0008 JMPF R7 #001B - 0x881C0105, // 0009 GETMBR R7 R0 K5 - 0x4C200000, // 000A LDNIL R8 - 0x201C0E08, // 000B NE R7 R7 R8 - 0x781E0007, // 000C JMPF R7 #0015 - 0x8C1C0706, // 000D GETMET R7 R3 K6 - 0x88240907, // 000E GETMBR R9 R4 K7 - 0x60280009, // 000F GETGBL R10 G9 - 0x882C0105, // 0010 GETMBR R11 R0 K5 - 0x7C280200, // 0011 CALL R10 1 - 0x7C1C0600, // 0012 CALL R7 3 - 0x80040E00, // 0013 RET 1 R7 - 0x70020004, // 0014 JMP #001A - 0x8C1C0706, // 0015 GETMET R7 R3 K6 - 0x88240908, // 0016 GETMBR R9 R4 K8 - 0x4C280000, // 0017 LDNIL R10 - 0x7C1C0600, // 0018 CALL R7 3 - 0x80040E00, // 0019 RET 1 R7 - 0x7002000E, // 001A JMP #002A - 0x1C1C0D09, // 001B EQ R7 R6 K9 - 0x781E0005, // 001C JMPF R7 #0023 - 0x8C1C0706, // 001D GETMET R7 R3 K6 - 0x88240907, // 001E GETMBR R9 R4 K7 - 0x542A01F3, // 001F LDINT R10 500 - 0x7C1C0600, // 0020 CALL R7 3 - 0x80040E00, // 0021 RET 1 R7 - 0x70020006, // 0022 JMP #002A - 0x1C1C0D0A, // 0023 EQ R7 R6 K10 - 0x781E0004, // 0024 JMPF R7 #002A - 0x8C1C0706, // 0025 GETMET R7 R3 K6 - 0x88240907, // 0026 GETMBR R9 R4 K7 - 0x542A05DB, // 0027 LDINT R10 1500 - 0x7C1C0600, // 0028 CALL R7 3 - 0x80040E00, // 0029 RET 1 R7 - 0x601C0003, // 002A GETGBL R7 G3 - 0x5C200000, // 002B MOVE R8 R0 - 0x7C1C0200, // 002C CALL R7 1 - 0x8C1C0F0B, // 002D GETMET R7 R7 K11 - 0x5C240200, // 002E MOVE R9 R1 - 0x5C280400, // 002F MOVE R10 R2 - 0x5C2C0600, // 0030 MOVE R11 R3 - 0x7C1C0800, // 0031 CALL R7 4 - 0x80040E00, // 0032 RET 1 R7 - }) - ) -); -/*******************************************************************/ - +// Borrowed method 'read_attribute' from class 'class_Matter_Plugin_Sensor_Pressure' +extern bclosure *class_Matter_Plugin_Sensor_Pressure_read_attribute; /******************************************************************** ** Solidified function: web_values @@ -217,7 +131,7 @@ be_local_class(Matter_Plugin_Bridge_Sensor_Pressure, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(773, -1), be_const_int(2) }, })) ) } )) }, - { be_const_key_weak(read_attribute, 7), be_const_closure(class_Matter_Plugin_Bridge_Sensor_Pressure_read_attribute_closure) }, + { be_const_key_weak(read_attribute, 7), be_const_closure(class_Matter_Plugin_Sensor_Pressure_read_attribute_closure) }, { be_const_key_weak(value_changed, 6), be_const_closure(class_Matter_Plugin_Bridge_Sensor_Pressure_value_changed_closure) }, { be_const_key_weak(DISPLAY_NAME, 4), be_nested_str_weak(Pressure) }, { be_const_key_weak(TYPE, -1), be_nested_str_weak(http_pressure) }, diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Temp.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Temp.h index 491a9e29cd59..001b3984dfc1 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Temp.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Bridge_Sensor_Temp.h @@ -83,92 +83,8 @@ be_local_closure(class_Matter_Plugin_Bridge_Sensor_Temp_value_changed, /* name ); /*******************************************************************/ - -/******************************************************************** -** Solidified function: read_attribute -********************************************************************/ -extern const bclass be_class_Matter_Plugin_Bridge_Sensor_Temp; -be_local_closure(class_Matter_Plugin_Bridge_Sensor_Temp_read_attribute, /* name */ - be_nested_proto( - 12, /* nstack */ - 4, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - &be_class_Matter_Plugin_Bridge_Sensor_Temp, - 1, /* has constants */ - ( &(const bvalue[12]) { /* constants */ - /* K0 */ be_nested_str_weak(matter), - /* K1 */ be_nested_str_weak(TLV), - /* K2 */ be_nested_str_weak(cluster), - /* K3 */ be_nested_str_weak(attribute), - /* K4 */ be_const_int(0), - /* K5 */ be_nested_str_weak(shadow_value), - /* K6 */ be_nested_str_weak(set), - /* K7 */ be_nested_str_weak(I2), - /* K8 */ be_nested_str_weak(NULL), - /* K9 */ be_const_int(1), - /* K10 */ be_const_int(2), - /* K11 */ be_nested_str_weak(read_attribute), - }), - be_str_weak(read_attribute), - &be_const_str_solidified, - ( &(const binstruction[49]) { /* code */ - 0xB8120000, // 0000 GETNGBL R4 K0 - 0x88100901, // 0001 GETMBR R4 R4 K1 - 0x88140502, // 0002 GETMBR R5 R2 K2 - 0x88180503, // 0003 GETMBR R6 R2 K3 - 0x541E0401, // 0004 LDINT R7 1026 - 0x1C1C0A07, // 0005 EQ R7 R5 R7 - 0x781E0020, // 0006 JMPF R7 #0028 - 0x1C1C0D04, // 0007 EQ R7 R6 K4 - 0x781E000F, // 0008 JMPF R7 #0019 - 0x881C0105, // 0009 GETMBR R7 R0 K5 - 0x4C200000, // 000A LDNIL R8 - 0x201C0E08, // 000B NE R7 R7 R8 - 0x781E0005, // 000C JMPF R7 #0013 - 0x8C1C0706, // 000D GETMET R7 R3 K6 - 0x88240907, // 000E GETMBR R9 R4 K7 - 0x88280105, // 000F GETMBR R10 R0 K5 - 0x7C1C0600, // 0010 CALL R7 3 - 0x80040E00, // 0011 RET 1 R7 - 0x70020004, // 0012 JMP #0018 - 0x8C1C0706, // 0013 GETMET R7 R3 K6 - 0x88240908, // 0014 GETMBR R9 R4 K8 - 0x4C280000, // 0015 LDNIL R10 - 0x7C1C0600, // 0016 CALL R7 3 - 0x80040E00, // 0017 RET 1 R7 - 0x7002000E, // 0018 JMP #0028 - 0x1C1C0D09, // 0019 EQ R7 R6 K9 - 0x781E0005, // 001A JMPF R7 #0021 - 0x8C1C0706, // 001B GETMET R7 R3 K6 - 0x88240907, // 001C GETMBR R9 R4 K7 - 0x5429EC77, // 001D LDINT R10 -5000 - 0x7C1C0600, // 001E CALL R7 3 - 0x80040E00, // 001F RET 1 R7 - 0x70020006, // 0020 JMP #0028 - 0x1C1C0D0A, // 0021 EQ R7 R6 K10 - 0x781E0004, // 0022 JMPF R7 #0028 - 0x8C1C0706, // 0023 GETMET R7 R3 K6 - 0x88240907, // 0024 GETMBR R9 R4 K7 - 0x542A3A97, // 0025 LDINT R10 15000 - 0x7C1C0600, // 0026 CALL R7 3 - 0x80040E00, // 0027 RET 1 R7 - 0x601C0003, // 0028 GETGBL R7 G3 - 0x5C200000, // 0029 MOVE R8 R0 - 0x7C1C0200, // 002A CALL R7 1 - 0x8C1C0F0B, // 002B GETMET R7 R7 K11 - 0x5C240200, // 002C MOVE R9 R1 - 0x5C280400, // 002D MOVE R10 R2 - 0x5C2C0600, // 002E MOVE R11 R3 - 0x7C1C0800, // 002F CALL R7 4 - 0x80040E00, // 0030 RET 1 R7 - }) - ) -); -/*******************************************************************/ - +// Borrowed method 'read_attribute' from class 'class_Matter_Plugin_Sensor_Temp' +extern bclosure *class_Matter_Plugin_Sensor_Temp_read_attribute; /******************************************************************** ** Solidified function: web_values @@ -236,7 +152,7 @@ be_local_class(Matter_Plugin_Bridge_Sensor_Temp, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(770, -1), be_const_int(2) }, })) ) } )) }, - { be_const_key_weak(read_attribute, 7), be_const_closure(class_Matter_Plugin_Bridge_Sensor_Temp_read_attribute_closure) }, + { be_const_key_weak(read_attribute, 7), be_const_closure(class_Matter_Plugin_Sensor_Temp_read_attribute_closure) }, { be_const_key_weak(value_changed, 6), be_const_closure(class_Matter_Plugin_Bridge_Sensor_Temp_value_changed_closure) }, { be_const_key_weak(DISPLAY_NAME, 4), be_nested_str_weak(Temperature) }, { be_const_key_weak(TYPE, -1), be_nested_str_weak(http_temperature) }, diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_5_Bridge_Light2.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_5_Bridge_Light2.h index 8015c80eeca2..703f9b59563d 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_5_Bridge_Light2.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_5_Bridge_Light2.h @@ -354,127 +354,8 @@ be_local_closure(class_Matter_Plugin_Bridge_Light2_invoke_request, /* name */ ); /*******************************************************************/ - -/******************************************************************** -** Solidified function: read_attribute -********************************************************************/ -extern const bclass be_class_Matter_Plugin_Bridge_Light2; -be_local_closure(class_Matter_Plugin_Bridge_Light2_read_attribute, /* name */ - be_nested_proto( - 12, /* nstack */ - 4, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - &be_class_Matter_Plugin_Bridge_Light2, - 1, /* has constants */ - ( &(const bvalue[15]) { /* constants */ - /* K0 */ be_nested_str_weak(matter), - /* K1 */ be_nested_str_weak(TLV), - /* K2 */ be_nested_str_weak(cluster), - /* K3 */ be_nested_str_weak(attribute), - /* K4 */ be_nested_str_weak(update_shadow_lazy), - /* K5 */ be_nested_str_weak(shadow_ct), - /* K6 */ be_nested_str_weak(set), - /* K7 */ be_nested_str_weak(U1), - /* K8 */ be_nested_str_weak(NULL), - /* K9 */ be_const_int(2), - /* K10 */ be_const_int(0), - /* K11 */ be_nested_str_weak(ct_min), - /* K12 */ be_nested_str_weak(ct_max), - /* K13 */ be_nested_str_weak(U4), - /* K14 */ be_nested_str_weak(read_attribute), - }), - be_str_weak(read_attribute), - &be_const_str_solidified, - ( &(const binstruction[81]) { /* code */ - 0xB8120000, // 0000 GETNGBL R4 K0 - 0x88100901, // 0001 GETMBR R4 R4 K1 - 0x88140502, // 0002 GETMBR R5 R2 K2 - 0x88180503, // 0003 GETMBR R6 R2 K3 - 0x541E02FF, // 0004 LDINT R7 768 - 0x1C1C0A07, // 0005 EQ R7 R5 R7 - 0x781E0040, // 0006 JMPF R7 #0048 - 0x8C1C0104, // 0007 GETMET R7 R0 K4 - 0x7C1C0200, // 0008 CALL R7 1 - 0x541E0006, // 0009 LDINT R7 7 - 0x1C1C0C07, // 000A EQ R7 R6 R7 - 0x781E000F, // 000B JMPF R7 #001C - 0x881C0105, // 000C GETMBR R7 R0 K5 - 0x4C200000, // 000D LDNIL R8 - 0x201C0E08, // 000E NE R7 R7 R8 - 0x781E0005, // 000F JMPF R7 #0016 - 0x8C1C0706, // 0010 GETMET R7 R3 K6 - 0x88240907, // 0011 GETMBR R9 R4 K7 - 0x88280105, // 0012 GETMBR R10 R0 K5 - 0x7C1C0600, // 0013 CALL R7 3 - 0x80040E00, // 0014 RET 1 R7 - 0x70020004, // 0015 JMP #001B - 0x8C1C0706, // 0016 GETMET R7 R3 K6 - 0x88240908, // 0017 GETMBR R9 R4 K8 - 0x4C280000, // 0018 LDNIL R10 - 0x7C1C0600, // 0019 CALL R7 3 - 0x80040E00, // 001A RET 1 R7 - 0x7002002B, // 001B JMP #0048 - 0x541E0007, // 001C LDINT R7 8 - 0x1C1C0C07, // 001D EQ R7 R6 R7 - 0x781E0005, // 001E JMPF R7 #0025 - 0x8C1C0706, // 001F GETMET R7 R3 K6 - 0x88240907, // 0020 GETMBR R9 R4 K7 - 0x58280009, // 0021 LDCONST R10 K9 - 0x7C1C0600, // 0022 CALL R7 3 - 0x80040E00, // 0023 RET 1 R7 - 0x70020022, // 0024 JMP #0048 - 0x541E000E, // 0025 LDINT R7 15 - 0x1C1C0C07, // 0026 EQ R7 R6 R7 - 0x781E0005, // 0027 JMPF R7 #002E - 0x8C1C0706, // 0028 GETMET R7 R3 K6 - 0x88240907, // 0029 GETMBR R9 R4 K7 - 0x5828000A, // 002A LDCONST R10 K10 - 0x7C1C0600, // 002B CALL R7 3 - 0x80040E00, // 002C RET 1 R7 - 0x70020019, // 002D JMP #0048 - 0x541E400A, // 002E LDINT R7 16395 - 0x1C1C0C07, // 002F EQ R7 R6 R7 - 0x781E0005, // 0030 JMPF R7 #0037 - 0x8C1C0706, // 0031 GETMET R7 R3 K6 - 0x88240907, // 0032 GETMBR R9 R4 K7 - 0x8828010B, // 0033 GETMBR R10 R0 K11 - 0x7C1C0600, // 0034 CALL R7 3 - 0x80040E00, // 0035 RET 1 R7 - 0x70020010, // 0036 JMP #0048 - 0x541E400B, // 0037 LDINT R7 16396 - 0x1C1C0C07, // 0038 EQ R7 R6 R7 - 0x781E0005, // 0039 JMPF R7 #0040 - 0x8C1C0706, // 003A GETMET R7 R3 K6 - 0x88240907, // 003B GETMBR R9 R4 K7 - 0x8828010C, // 003C GETMBR R10 R0 K12 - 0x7C1C0600, // 003D CALL R7 3 - 0x80040E00, // 003E RET 1 R7 - 0x70020007, // 003F JMP #0048 - 0x541E4009, // 0040 LDINT R7 16394 - 0x1C1C0C07, // 0041 EQ R7 R6 R7 - 0x781E0004, // 0042 JMPF R7 #0048 - 0x8C1C0706, // 0043 GETMET R7 R3 K6 - 0x8824090D, // 0044 GETMBR R9 R4 K13 - 0x542A000F, // 0045 LDINT R10 16 - 0x7C1C0600, // 0046 CALL R7 3 - 0x80040E00, // 0047 RET 1 R7 - 0x601C0003, // 0048 GETGBL R7 G3 - 0x5C200000, // 0049 MOVE R8 R0 - 0x7C1C0200, // 004A CALL R7 1 - 0x8C1C0F0E, // 004B GETMET R7 R7 K14 - 0x5C240200, // 004C MOVE R9 R1 - 0x5C280400, // 004D MOVE R10 R2 - 0x5C2C0600, // 004E MOVE R11 R3 - 0x7C1C0800, // 004F CALL R7 4 - 0x80040E00, // 0050 RET 1 R7 - }) - ) -); -/*******************************************************************/ - +// Borrowed method 'read_attribute' from class 'class_Matter_Plugin_Light2' +extern bclosure *class_Matter_Plugin_Light2_read_attribute; /******************************************************************** ** Solidified function: update_ct_minmax @@ -659,7 +540,7 @@ be_local_class(Matter_Plugin_Bridge_Light2, { be_const_key_weak(shadow_ct, -1), be_const_var(0) }, { be_const_key_weak(update_ct_minmax, -1), be_const_closure(class_Matter_Plugin_Bridge_Light2_update_ct_minmax_closure) }, { be_const_key_weak(invoke_request, -1), be_const_closure(class_Matter_Plugin_Bridge_Light2_invoke_request_closure) }, - { be_const_key_weak(read_attribute, 10), be_const_closure(class_Matter_Plugin_Bridge_Light2_read_attribute_closure) }, + { be_const_key_weak(read_attribute, 10), be_const_closure(class_Matter_Plugin_Light2_read_attribute_closure) }, { be_const_key_weak(ct_min, -1), be_const_var(1) }, { be_const_key_weak(TYPE, -1), be_nested_str_weak(http_light2) }, })), diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_5_Bridge_Light3.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_5_Bridge_Light3.h index 303f3ecc777e..31cbfdca50f1 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_5_Bridge_Light3.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_5_Bridge_Light3.h @@ -298,152 +298,8 @@ be_local_closure(class_Matter_Plugin_Bridge_Light3_web_value_RGB, /* name */ ); /*******************************************************************/ - -/******************************************************************** -** Solidified function: read_attribute -********************************************************************/ -extern const bclass be_class_Matter_Plugin_Bridge_Light3; -be_local_closure(class_Matter_Plugin_Bridge_Light3_read_attribute, /* name */ - be_nested_proto( - 12, /* nstack */ - 4, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - &be_class_Matter_Plugin_Bridge_Light3, - 1, /* has constants */ - ( &(const bvalue[14]) { /* constants */ - /* K0 */ be_nested_str_weak(matter), - /* K1 */ be_nested_str_weak(TLV), - /* K2 */ be_nested_str_weak(cluster), - /* K3 */ be_nested_str_weak(attribute), - /* K4 */ be_nested_str_weak(update_shadow_lazy), - /* K5 */ be_const_int(0), - /* K6 */ be_nested_str_weak(shadow_hue), - /* K7 */ be_nested_str_weak(set), - /* K8 */ be_nested_str_weak(U1), - /* K9 */ be_nested_str_weak(NULL), - /* K10 */ be_const_int(1), - /* K11 */ be_nested_str_weak(shadow_sat), - /* K12 */ be_nested_str_weak(U4), - /* K13 */ be_nested_str_weak(read_attribute), - }), - be_str_weak(read_attribute), - &be_const_str_solidified, - ( &(const binstruction[107]) { /* code */ - 0xB8120000, // 0000 GETNGBL R4 K0 - 0x88100901, // 0001 GETMBR R4 R4 K1 - 0x88140502, // 0002 GETMBR R5 R2 K2 - 0x88180503, // 0003 GETMBR R6 R2 K3 - 0x541E02FF, // 0004 LDINT R7 768 - 0x1C1C0A07, // 0005 EQ R7 R5 R7 - 0x781E005A, // 0006 JMPF R7 #0062 - 0x8C1C0104, // 0007 GETMET R7 R0 K4 - 0x7C1C0200, // 0008 CALL R7 1 - 0x1C1C0D05, // 0009 EQ R7 R6 K5 - 0x781E000F, // 000A JMPF R7 #001B - 0x881C0106, // 000B GETMBR R7 R0 K6 - 0x4C200000, // 000C LDNIL R8 - 0x201C0E08, // 000D NE R7 R7 R8 - 0x781E0005, // 000E JMPF R7 #0015 - 0x8C1C0707, // 000F GETMET R7 R3 K7 - 0x88240908, // 0010 GETMBR R9 R4 K8 - 0x88280106, // 0011 GETMBR R10 R0 K6 - 0x7C1C0600, // 0012 CALL R7 3 - 0x80040E00, // 0013 RET 1 R7 - 0x70020004, // 0014 JMP #001A - 0x8C1C0707, // 0015 GETMET R7 R3 K7 - 0x88240909, // 0016 GETMBR R9 R4 K9 - 0x4C280000, // 0017 LDNIL R10 - 0x7C1C0600, // 0018 CALL R7 3 - 0x80040E00, // 0019 RET 1 R7 - 0x70020046, // 001A JMP #0062 - 0x1C1C0D0A, // 001B EQ R7 R6 K10 - 0x781E000F, // 001C JMPF R7 #002D - 0x881C010B, // 001D GETMBR R7 R0 K11 - 0x4C200000, // 001E LDNIL R8 - 0x201C0E08, // 001F NE R7 R7 R8 - 0x781E0005, // 0020 JMPF R7 #0027 - 0x8C1C0707, // 0021 GETMET R7 R3 K7 - 0x88240908, // 0022 GETMBR R9 R4 K8 - 0x8828010B, // 0023 GETMBR R10 R0 K11 - 0x7C1C0600, // 0024 CALL R7 3 - 0x80040E00, // 0025 RET 1 R7 - 0x70020004, // 0026 JMP #002C - 0x8C1C0707, // 0027 GETMET R7 R3 K7 - 0x88240909, // 0028 GETMBR R9 R4 K9 - 0x4C280000, // 0029 LDNIL R10 - 0x7C1C0600, // 002A CALL R7 3 - 0x80040E00, // 002B RET 1 R7 - 0x70020034, // 002C JMP #0062 - 0x541E0006, // 002D LDINT R7 7 - 0x1C1C0C07, // 002E EQ R7 R6 R7 - 0x781E0005, // 002F JMPF R7 #0036 - 0x8C1C0707, // 0030 GETMET R7 R3 K7 - 0x88240908, // 0031 GETMBR R9 R4 K8 - 0x58280005, // 0032 LDCONST R10 K5 - 0x7C1C0600, // 0033 CALL R7 3 - 0x80040E00, // 0034 RET 1 R7 - 0x7002002B, // 0035 JMP #0062 - 0x541E0007, // 0036 LDINT R7 8 - 0x1C1C0C07, // 0037 EQ R7 R6 R7 - 0x781E0005, // 0038 JMPF R7 #003F - 0x8C1C0707, // 0039 GETMET R7 R3 K7 - 0x88240908, // 003A GETMBR R9 R4 K8 - 0x58280005, // 003B LDCONST R10 K5 - 0x7C1C0600, // 003C CALL R7 3 - 0x80040E00, // 003D RET 1 R7 - 0x70020022, // 003E JMP #0062 - 0x541E000E, // 003F LDINT R7 15 - 0x1C1C0C07, // 0040 EQ R7 R6 R7 - 0x781E0005, // 0041 JMPF R7 #0048 - 0x8C1C0707, // 0042 GETMET R7 R3 K7 - 0x88240908, // 0043 GETMBR R9 R4 K8 - 0x58280005, // 0044 LDCONST R10 K5 - 0x7C1C0600, // 0045 CALL R7 3 - 0x80040E00, // 0046 RET 1 R7 - 0x70020019, // 0047 JMP #0062 - 0x541E4000, // 0048 LDINT R7 16385 - 0x1C1C0C07, // 0049 EQ R7 R6 R7 - 0x781E0005, // 004A JMPF R7 #0051 - 0x8C1C0707, // 004B GETMET R7 R3 K7 - 0x88240908, // 004C GETMBR R9 R4 K8 - 0x58280005, // 004D LDCONST R10 K5 - 0x7C1C0600, // 004E CALL R7 3 - 0x80040E00, // 004F RET 1 R7 - 0x70020010, // 0050 JMP #0062 - 0x541E4009, // 0051 LDINT R7 16394 - 0x1C1C0C07, // 0052 EQ R7 R6 R7 - 0x781E0005, // 0053 JMPF R7 #005A - 0x8C1C0707, // 0054 GETMET R7 R3 K7 - 0x8824090C, // 0055 GETMBR R9 R4 K12 - 0x5828000A, // 0056 LDCONST R10 K10 - 0x7C1C0600, // 0057 CALL R7 3 - 0x80040E00, // 0058 RET 1 R7 - 0x70020007, // 0059 JMP #0062 - 0x541E000F, // 005A LDINT R7 16 - 0x1C1C0C07, // 005B EQ R7 R6 R7 - 0x781E0004, // 005C JMPF R7 #0062 - 0x8C1C0707, // 005D GETMET R7 R3 K7 - 0x88240908, // 005E GETMBR R9 R4 K8 - 0x58280005, // 005F LDCONST R10 K5 - 0x7C1C0600, // 0060 CALL R7 3 - 0x80040E00, // 0061 RET 1 R7 - 0x601C0003, // 0062 GETGBL R7 G3 - 0x5C200000, // 0063 MOVE R8 R0 - 0x7C1C0200, // 0064 CALL R7 1 - 0x8C1C0F0D, // 0065 GETMET R7 R7 K13 - 0x5C240200, // 0066 MOVE R9 R1 - 0x5C280400, // 0067 MOVE R10 R2 - 0x5C2C0600, // 0068 MOVE R11 R3 - 0x7C1C0800, // 0069 CALL R7 4 - 0x80040E00, // 006A RET 1 R7 - }) - ) -); -/*******************************************************************/ - +// Borrowed method 'read_attribute' from class 'class_Matter_Plugin_Light3' +extern bclosure *class_Matter_Plugin_Light3_read_attribute; /******************************************************************** ** Solidified function: invoke_request @@ -835,7 +691,7 @@ be_local_class(Matter_Plugin_Bridge_Light3, { be_const_key_int(269, -1), be_const_int(2) }, })) ) } )) }, { be_const_key_weak(shadow_sat, -1), be_const_var(1) }, - { be_const_key_weak(read_attribute, -1), be_const_closure(class_Matter_Plugin_Bridge_Light3_read_attribute_closure) }, + { be_const_key_weak(read_attribute, -1), be_const_closure(class_Matter_Plugin_Light3_read_attribute_closure) }, })), be_str_weak(Matter_Plugin_Bridge_Light3) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_9_Virt_Sensor_Air_Quality.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_9_Virt_Sensor_Air_Quality.h new file mode 100644 index 000000000000..74d87f05fbdc --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_9_Virt_Sensor_Air_Quality.h @@ -0,0 +1,27 @@ +/* Solidification of Matter_Plugin_9_Virt_Sensor_Air_Quality.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_Plugin_Virt_Sensor_Air_Quality; + +/******************************************************************** +** Solidified class: Matter_Plugin_Virt_Sensor_Air_Quality +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Sensor_Air_Quality; +be_local_class(Matter_Plugin_Virt_Sensor_Air_Quality, + 0, + &be_class_Matter_Plugin_Sensor_Air_Quality, + be_nested_map(5, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(VIRTUAL, 3), be_const_bool(1) }, + { be_const_key_weak(DISPLAY_NAME, -1), be_nested_str_weak(v_X2EAir_X20Quality) }, + { be_const_key_weak(TYPE, -1), be_nested_str_weak(v_airquality) }, + { be_const_key_weak(ARG_HINT, -1), be_nested_str_weak(_Not_X20used_) }, + { be_const_key_weak(ARG, 2), be_nested_str_weak() }, + })), + be_str_weak(Matter_Plugin_Virt_Sensor_Air_Quality) +); +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_TLV.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_TLV.h index 7df38a55c9ba..d88b86b6b4ae 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_TLV.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_TLV.h @@ -7,37 +7,12 @@ extern const bclass be_class_Matter_TLV_item; /******************************************************************** -** Solidified function: to_TLV -********************************************************************/ -extern const bclass be_class_Matter_TLV_item; -be_local_closure(class_Matter_TLV_item_to_TLV, /* name */ - be_nested_proto( - 1, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - &be_class_Matter_TLV_item, - 0, /* has constants */ - NULL, /* no const */ - be_str_weak(to_TLV), - &be_const_str_solidified, - ( &(const binstruction[ 1]) { /* code */ - 0x80040000, // 0000 RET 1 R0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_parent +** Solidified function: reset ********************************************************************/ extern const bclass be_class_Matter_TLV_item; -be_local_closure(class_Matter_TLV_item_set_parent, /* name */ +be_local_closure(class_Matter_TLV_item_reset, /* name */ be_nested_proto( - 2, /* nstack */ + 3, /* nstack */ 2, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -45,58 +20,29 @@ be_local_closure(class_Matter_TLV_item_set_parent, /* name */ 0, /* has sup protos */ &be_class_Matter_TLV_item, 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ + ( &(const bvalue[ 8]) { /* constants */ /* K0 */ be_nested_str_weak(parent), + /* K1 */ be_nested_str_weak(next_idx), + /* K2 */ be_nested_str_weak(tag_vendor), + /* K3 */ be_nested_str_weak(tag_profile), + /* K4 */ be_nested_str_weak(tag_number), + /* K5 */ be_nested_str_weak(tag_sub), + /* K6 */ be_nested_str_weak(typ), + /* K7 */ be_nested_str_weak(val), }), - be_str_weak(set_parent), - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x90020001, // 0000 SETMBR R0 K0 R1 - 0x80000000, // 0001 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_fulltag -********************************************************************/ -extern const bclass be_class_Matter_TLV_item; -be_local_closure(class_Matter_TLV_item_set_fulltag, /* name */ - be_nested_proto( - 6, /* nstack */ - 4, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - &be_class_Matter_TLV_item, - 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_str_weak(tag_vendor), - /* K1 */ be_nested_str_weak(tag_profile), - /* K2 */ be_nested_str_weak(tag_number), - /* K3 */ be_nested_str_weak(tag_sub), - }), - be_str_weak(set_fulltag), + be_str_weak(reset), &be_const_str_solidified, - ( &(const binstruction[15]) { /* code */ - 0x60100009, // 0000 GETGBL R4 G9 - 0x5C140200, // 0001 MOVE R5 R1 - 0x7C100200, // 0002 CALL R4 1 - 0x90020004, // 0003 SETMBR R0 K0 R4 - 0x60100009, // 0004 GETGBL R4 G9 - 0x5C140400, // 0005 MOVE R5 R2 - 0x7C100200, // 0006 CALL R4 1 - 0x90020204, // 0007 SETMBR R0 K1 R4 - 0x60100009, // 0008 GETGBL R4 G9 - 0x5C140600, // 0009 MOVE R5 R3 - 0x7C100200, // 000A CALL R4 1 - 0x90020404, // 000B SETMBR R0 K2 R4 - 0x4C100000, // 000C LDNIL R4 - 0x90020604, // 000D SETMBR R0 K3 R4 - 0x80000000, // 000E RET 0 + ( &(const binstruction[10]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x90020001, // 0001 SETMBR R0 K0 R1 + 0x90020202, // 0002 SETMBR R0 K1 R2 + 0x90020402, // 0003 SETMBR R0 K2 R2 + 0x90020602, // 0004 SETMBR R0 K3 R2 + 0x90020802, // 0005 SETMBR R0 K4 R2 + 0x90020A02, // 0006 SETMBR R0 K5 R2 + 0x90020C02, // 0007 SETMBR R0 K6 R2 + 0x90020E02, // 0008 SETMBR R0 K7 R2 + 0x80000000, // 0009 RET 0 }) ) ); @@ -104,96 +50,43 @@ be_local_closure(class_Matter_TLV_item_set_fulltag, /* name */ /******************************************************************** -** Solidified function: set_contextspecific +** Solidified function: set_or_nil ********************************************************************/ extern const bclass be_class_Matter_TLV_item; -be_local_closure(class_Matter_TLV_item_set_contextspecific, /* name */ +be_local_closure(class_Matter_TLV_item_set_or_nil, /* name */ be_nested_proto( - 4, /* nstack */ - 2, /* argc */ + 5, /* nstack */ + 3, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_TLV_item, 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(set_fulltag), - /* K1 */ be_nested_str_weak(tag_sub), - }), - be_str_weak(set_contextspecific), - &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0x8C080100, // 0000 GETMET R2 R0 K0 - 0x7C080200, // 0001 CALL R2 1 - 0x60080009, // 0002 GETGBL R2 G9 - 0x5C0C0200, // 0003 MOVE R3 R1 - 0x7C080200, // 0004 CALL R2 1 - 0x90020202, // 0005 SETMBR R0 K1 R2 - 0x80000000, // 0006 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: sort -********************************************************************/ -extern const bclass be_class_Matter_TLV_item; -be_local_closure(class_Matter_TLV_item_sort, /* name */ - be_nested_proto( - 9, /* nstack */ - 1, /* argc */ - 4, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - &be_class_Matter_TLV_item, - 1, /* has constants */ - ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_const_class(be_class_Matter_TLV_item), - /* K1 */ be_const_int(1), - /* K2 */ be_const_int(0), - /* K3 */ be_nested_str_weak(_cmp_gt), - /* K4 */ be_nested_str_weak(stop_iteration), + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(reset), + /* K1 */ be_nested_str_weak(typ), + /* K2 */ be_nested_str_weak(val), }), - be_str_weak(sort), + be_str_weak(set_or_nil), &be_const_str_solidified, - ( &(const binstruction[33]) { /* 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 - 0xA8020013, // 0008 EXBLK 0 #001D - 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 - 0x781A000B, // 000E JMPF R6 #001B - 0x04180B01, // 000F SUB R6 R5 K1 - 0x94180006, // 0010 GETIDX R6 R0 R6 - 0x8C180D03, // 0011 GETMET R6 R6 K3 - 0x5C200800, // 0012 MOVE R8 R4 - 0x7C180400, // 0013 CALL R6 2 - 0x24180D02, // 0014 GT R6 R6 K2 - 0x781A0004, // 0015 JMPF R6 #001B - 0x04180B01, // 0016 SUB R6 R5 K1 - 0x94180006, // 0017 GETIDX R6 R0 R6 - 0x98000A06, // 0018 SETIDX R0 R5 R6 - 0x04140B01, // 0019 SUB R5 R5 K1 - 0x7001FFF1, // 001A JMP #000D - 0x98000A04, // 001B SETIDX R0 R5 R4 - 0x7001FFEB, // 001C JMP #0009 - 0x58080004, // 001D LDCONST R2 K4 - 0xAC080200, // 001E CATCH R2 1 0 - 0xB0080000, // 001F RAISE 2 R0 R0 - 0x80040000, // 0020 RET 1 R0 + ( &(const binstruction[16]) { /* code */ + 0x8C0C0100, // 0000 GETMET R3 R0 K0 + 0x7C0C0200, // 0001 CALL R3 1 + 0x4C0C0000, // 0002 LDNIL R3 + 0x1C0C0403, // 0003 EQ R3 R2 R3 + 0x780E0000, // 0004 JMPF R3 #0006 + 0x54060013, // 0005 LDINT R1 20 + 0x4C0C0000, // 0006 LDNIL R3 + 0x200C0403, // 0007 NE R3 R2 R3 + 0x740E0002, // 0008 JMPT R3 #000C + 0x540E0013, // 0009 LDINT R3 20 + 0x1C0C0203, // 000A EQ R3 R1 R3 + 0x780E0002, // 000B JMPF R3 #000F + 0x90020201, // 000C SETMBR R0 K1 R1 + 0x90020402, // 000D SETMBR R0 K2 R2 + 0x80040000, // 000E RET 1 R0 + 0x80000000, // 000F RET 0 }) ) ); @@ -201,12 +94,12 @@ be_local_closure(class_Matter_TLV_item_sort, /* name */ /******************************************************************** -** Solidified function: to_str_val +** Solidified function: encode_len ********************************************************************/ extern const bclass be_class_Matter_TLV_item; -be_local_closure(class_Matter_TLV_item_to_str_val, /* name */ +be_local_closure(class_Matter_TLV_item_encode_len, /* name */ be_nested_proto( - 4, /* nstack */ + 5, /* nstack */ 1, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -214,180 +107,41 @@ be_local_closure(class_Matter_TLV_item_to_str_val, /* name */ 0, /* has sup protos */ &be_class_Matter_TLV_item, 1, /* has constants */ - ( &(const bvalue[16]) { /* constants */ - /* K0 */ be_nested_str_weak(val), - /* K1 */ be_nested_str_weak(int), + ( &(const bvalue[32]) { /* constants */ + /* K0 */ be_nested_str_weak(TLV), + /* K1 */ be_const_int(0), /* K2 */ be_nested_str_weak(typ), - /* K3 */ be_nested_str_weak(TLV), - /* K4 */ be_nested_str_weak(U1), - /* K5 */ be_nested_str_weak(U8), - /* K6 */ be_nested_str_weak(U), - /* K7 */ be_nested_str_weak(bool), - /* K8 */ be_nested_str_weak(true), - /* K9 */ be_nested_str_weak(false), - /* K10 */ be_nested_str_weak(null), - /* K11 */ be_nested_str_weak(real), - /* K12 */ be_nested_str_weak(string), - /* K13 */ be_nested_str_weak(int64), - /* K14 */ be_nested_str_weak(tostring), - /* K15 */ be_nested_str_weak(instance), + /* K3 */ be_nested_str_weak(RAW), + /* K4 */ be_nested_str_weak(val), + /* K5 */ be_nested_str_weak(BFALSE), + /* K6 */ be_nested_str_weak(BTRUE), + /* K7 */ be_nested_str_weak(I2), + /* K8 */ be_nested_str_weak(I4), + /* K9 */ be_nested_str_weak(I1), + /* K10 */ be_nested_str_weak(U2), + /* K11 */ be_nested_str_weak(U4), + /* K12 */ be_nested_str_weak(U1), + /* K13 */ be_nested_str_weak(B1), + /* K14 */ be_nested_str_weak(B8), + /* K15 */ be_nested_str_weak(B2), + /* K16 */ be_nested_str_weak(B4), + /* K17 */ be_nested_str_weak(UTF1), + /* K18 */ be_nested_str_weak(UTF8), + /* K19 */ be_nested_str_weak(UTF2), + /* K20 */ be_nested_str_weak(UTF4), + /* K21 */ be_nested_str_weak(_encode_tag_len), + /* K22 */ be_const_int(1), + /* K23 */ be_const_int(2), + /* K24 */ be_nested_str_weak(I8), + /* K25 */ be_nested_str_weak(U8), + /* K26 */ be_nested_str_weak(FLOAT), + /* K27 */ be_nested_str_weak(DOUBLE), + /* K28 */ be_nested_str_weak(value_error), + /* K29 */ be_nested_str_weak(Unsupported_X20type_X20TLV_X2EDOUBLE), + /* K30 */ be_nested_str_weak(NULL), + /* K31 */ be_nested_str_weak(unsupported_X20type_X20), }), - be_str_weak(to_str_val), - &be_const_str_solidified, - ( &(const binstruction[98]) { /* code */ - 0x60040004, // 0000 GETGBL R1 G4 - 0x88080100, // 0001 GETMBR R2 R0 K0 - 0x7C040200, // 0002 CALL R1 1 - 0x1C040301, // 0003 EQ R1 R1 K1 - 0x78060014, // 0004 JMPF R1 #001A - 0x88040102, // 0005 GETMBR R1 R0 K2 - 0x88080103, // 0006 GETMBR R2 R0 K3 - 0x88080504, // 0007 GETMBR R2 R2 K4 - 0x28040202, // 0008 GE R1 R1 R2 - 0x7806000A, // 0009 JMPF R1 #0015 - 0x88040102, // 000A GETMBR R1 R0 K2 - 0x88080103, // 000B GETMBR R2 R0 K3 - 0x88080505, // 000C GETMBR R2 R2 K5 - 0x18040202, // 000D LE R1 R1 R2 - 0x78060005, // 000E JMPF R1 #0015 - 0x60040008, // 000F GETGBL R1 G8 - 0x88080100, // 0010 GETMBR R2 R0 K0 - 0x7C040200, // 0011 CALL R1 1 - 0x00040306, // 0012 ADD R1 R1 K6 - 0x80040200, // 0013 RET 1 R1 - 0x70020003, // 0014 JMP #0019 - 0x60040008, // 0015 GETGBL R1 G8 - 0x88080100, // 0016 GETMBR R2 R0 K0 - 0x7C040200, // 0017 CALL R1 1 - 0x80040200, // 0018 RET 1 R1 - 0x70020046, // 0019 JMP #0061 - 0x60040004, // 001A GETGBL R1 G4 - 0x88080100, // 001B GETMBR R2 R0 K0 - 0x7C040200, // 001C CALL R1 1 - 0x1C040307, // 001D EQ R1 R1 K7 - 0x78060006, // 001E JMPF R1 #0026 - 0x88040100, // 001F GETMBR R1 R0 K0 - 0x78060001, // 0020 JMPF R1 #0023 - 0x58040008, // 0021 LDCONST R1 K8 - 0x70020000, // 0022 JMP #0024 - 0x58040009, // 0023 LDCONST R1 K9 - 0x80040200, // 0024 RET 1 R1 - 0x7002003A, // 0025 JMP #0061 - 0x88040100, // 0026 GETMBR R1 R0 K0 - 0x4C080000, // 0027 LDNIL R2 - 0x1C040202, // 0028 EQ R1 R1 R2 - 0x78060001, // 0029 JMPF R1 #002C - 0x80061400, // 002A RET 1 K10 - 0x70020034, // 002B JMP #0061 - 0x60040004, // 002C GETGBL R1 G4 - 0x88080100, // 002D GETMBR R2 R0 K0 - 0x7C040200, // 002E CALL R1 1 - 0x1C04030B, // 002F EQ R1 R1 K11 - 0x78060004, // 0030 JMPF R1 #0036 - 0x60040008, // 0031 GETGBL R1 G8 - 0x88080100, // 0032 GETMBR R2 R0 K0 - 0x7C040200, // 0033 CALL R1 1 - 0x80040200, // 0034 RET 1 R1 - 0x7002002A, // 0035 JMP #0061 - 0x60040004, // 0036 GETGBL R1 G4 - 0x88080100, // 0037 GETMBR R2 R0 K0 - 0x7C040200, // 0038 CALL R1 1 - 0x1C04030C, // 0039 EQ R1 R1 K12 - 0x78060002, // 003A JMPF R1 #003E - 0x88040100, // 003B GETMBR R1 R0 K0 - 0x80040200, // 003C RET 1 R1 - 0x70020022, // 003D JMP #0061 - 0x6004000F, // 003E GETGBL R1 G15 - 0x88080100, // 003F GETMBR R2 R0 K0 - 0xB80E1A00, // 0040 GETNGBL R3 K13 - 0x7C040400, // 0041 CALL R1 2 - 0x78060014, // 0042 JMPF R1 #0058 - 0x88040102, // 0043 GETMBR R1 R0 K2 - 0x88080103, // 0044 GETMBR R2 R0 K3 - 0x88080504, // 0045 GETMBR R2 R2 K4 - 0x28040202, // 0046 GE R1 R1 R2 - 0x7806000A, // 0047 JMPF R1 #0053 - 0x88040102, // 0048 GETMBR R1 R0 K2 - 0x88080103, // 0049 GETMBR R2 R0 K3 - 0x88080505, // 004A GETMBR R2 R2 K5 - 0x18040202, // 004B LE R1 R1 R2 - 0x78060005, // 004C JMPF R1 #0053 - 0x88040100, // 004D GETMBR R1 R0 K0 - 0x8C04030E, // 004E GETMET R1 R1 K14 - 0x7C040200, // 004F CALL R1 1 - 0x00040306, // 0050 ADD R1 R1 K6 - 0x80040200, // 0051 RET 1 R1 - 0x70020003, // 0052 JMP #0057 - 0x88040100, // 0053 GETMBR R1 R0 K0 - 0x8C04030E, // 0054 GETMET R1 R1 K14 - 0x7C040200, // 0055 CALL R1 1 - 0x80040200, // 0056 RET 1 R1 - 0x70020008, // 0057 JMP #0061 - 0x60040004, // 0058 GETGBL R1 G4 - 0x88080100, // 0059 GETMBR R2 R0 K0 - 0x7C040200, // 005A CALL R1 1 - 0x1C04030F, // 005B EQ R1 R1 K15 - 0x78060003, // 005C JMPF R1 #0061 - 0x8C04010E, // 005D GETMET R1 R0 K14 - 0x500C0200, // 005E LDBOOL R3 1 0 - 0x7C040400, // 005F CALL R1 2 - 0x80040200, // 0060 RET 1 R1 - 0x80000000, // 0061 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: encode_len -********************************************************************/ -extern const bclass be_class_Matter_TLV_item; -be_local_closure(class_Matter_TLV_item_encode_len, /* name */ - be_nested_proto( - 5, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - &be_class_Matter_TLV_item, - 1, /* has constants */ - ( &(const bvalue[32]) { /* constants */ - /* K0 */ be_nested_str_weak(TLV), - /* K1 */ be_const_int(0), - /* K2 */ be_nested_str_weak(typ), - /* K3 */ be_nested_str_weak(RAW), - /* K4 */ be_nested_str_weak(val), - /* K5 */ be_nested_str_weak(BFALSE), - /* K6 */ be_nested_str_weak(BTRUE), - /* K7 */ be_nested_str_weak(I2), - /* K8 */ be_nested_str_weak(I4), - /* K9 */ be_nested_str_weak(I1), - /* K10 */ be_nested_str_weak(U2), - /* K11 */ be_nested_str_weak(U4), - /* K12 */ be_nested_str_weak(U1), - /* K13 */ be_nested_str_weak(B1), - /* K14 */ be_nested_str_weak(B8), - /* K15 */ be_nested_str_weak(B2), - /* K16 */ be_nested_str_weak(B4), - /* K17 */ be_nested_str_weak(UTF1), - /* K18 */ be_nested_str_weak(UTF8), - /* K19 */ be_nested_str_weak(UTF2), - /* K20 */ be_nested_str_weak(UTF4), - /* K21 */ be_nested_str_weak(_encode_tag_len), - /* K22 */ be_const_int(1), - /* K23 */ be_const_int(2), - /* K24 */ be_nested_str_weak(I8), - /* K25 */ be_nested_str_weak(U8), - /* K26 */ be_nested_str_weak(FLOAT), - /* K27 */ be_nested_str_weak(DOUBLE), - /* K28 */ be_nested_str_weak(value_error), - /* K29 */ be_nested_str_weak(Unsupported_X20type_X20TLV_X2EDOUBLE), - /* K30 */ be_nested_str_weak(NULL), - /* K31 */ be_nested_str_weak(unsupported_X20type_X20), - }), - be_str_weak(encode_len), + be_str_weak(encode_len), &be_const_str_solidified, ( &(const binstruction[258]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 @@ -655,42 +409,39 @@ be_local_closure(class_Matter_TLV_item_encode_len, /* name */ /******************************************************************** -** Solidified function: reset +** Solidified function: set ********************************************************************/ extern const bclass be_class_Matter_TLV_item; -be_local_closure(class_Matter_TLV_item_reset, /* name */ +be_local_closure(class_Matter_TLV_item_set, /* name */ be_nested_proto( - 3, /* nstack */ - 2, /* argc */ + 5, /* nstack */ + 3, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_TLV_item, 1, /* has constants */ - ( &(const bvalue[ 8]) { /* constants */ - /* K0 */ be_nested_str_weak(parent), - /* K1 */ be_nested_str_weak(next_idx), - /* K2 */ be_nested_str_weak(tag_vendor), - /* K3 */ be_nested_str_weak(tag_profile), - /* K4 */ be_nested_str_weak(tag_number), - /* K5 */ be_nested_str_weak(tag_sub), - /* K6 */ be_nested_str_weak(typ), - /* K7 */ be_nested_str_weak(val), + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(reset), + /* K1 */ be_nested_str_weak(typ), + /* K2 */ be_nested_str_weak(val), }), - be_str_weak(reset), + be_str_weak(set), &be_const_str_solidified, - ( &(const binstruction[10]) { /* code */ - 0x4C080000, // 0000 LDNIL R2 - 0x90020001, // 0001 SETMBR R0 K0 R1 - 0x90020202, // 0002 SETMBR R0 K1 R2 - 0x90020402, // 0003 SETMBR R0 K2 R2 - 0x90020602, // 0004 SETMBR R0 K3 R2 - 0x90020802, // 0005 SETMBR R0 K4 R2 - 0x90020A02, // 0006 SETMBR R0 K5 R2 - 0x90020C02, // 0007 SETMBR R0 K6 R2 - 0x90020E02, // 0008 SETMBR R0 K7 R2 - 0x80000000, // 0009 RET 0 + ( &(const binstruction[12]) { /* code */ + 0x8C0C0100, // 0000 GETMET R3 R0 K0 + 0x7C0C0200, // 0001 CALL R3 1 + 0x4C0C0000, // 0002 LDNIL R3 + 0x200C0403, // 0003 NE R3 R2 R3 + 0x740E0002, // 0004 JMPT R3 #0008 + 0x540E0013, // 0005 LDINT R3 20 + 0x1C0C0203, // 0006 EQ R3 R1 R3 + 0x780E0002, // 0007 JMPF R3 #000B + 0x90020201, // 0008 SETMBR R0 K1 R1 + 0x90020402, // 0009 SETMBR R0 K2 R2 + 0x80040000, // 000A RET 1 R0 + 0x80000000, // 000B RET 0 }) ) ); @@ -698,40 +449,24 @@ be_local_closure(class_Matter_TLV_item_reset, /* name */ /******************************************************************** -** Solidified function: create_TLV +** Solidified function: to_TLV ********************************************************************/ extern const bclass be_class_Matter_TLV_item; -be_local_closure(class_Matter_TLV_item_create_TLV, /* name */ +be_local_closure(class_Matter_TLV_item_to_TLV, /* name */ be_nested_proto( - 4, /* nstack */ - 2, /* argc */ - 4, /* varg */ + 1, /* nstack */ + 1, /* argc */ + 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_TLV_item, - 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_const_class(be_class_Matter_TLV_item), - /* K1 */ be_nested_str_weak(typ), - /* K2 */ be_nested_str_weak(val), - }), - be_str_weak(create_TLV), + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(to_TLV), &be_const_str_solidified, - ( &(const binstruction[13]) { /* code */ - 0x58080000, // 0000 LDCONST R2 K0 - 0x4C0C0000, // 0001 LDNIL R3 - 0x200C0203, // 0002 NE R3 R1 R3 - 0x740E0002, // 0003 JMPT R3 #0007 - 0x540E0013, // 0004 LDINT R3 20 - 0x1C0C0003, // 0005 EQ R3 R0 R3 - 0x780E0004, // 0006 JMPF R3 #000C - 0x5C0C0400, // 0007 MOVE R3 R2 - 0x7C0C0000, // 0008 CALL R3 0 - 0x900E0200, // 0009 SETMBR R3 K1 R0 - 0x900E0401, // 000A SETMBR R3 K2 R1 - 0x80040600, // 000B RET 1 R3 - 0x80000000, // 000C RET 0 + ( &(const binstruction[ 1]) { /* code */ + 0x80040000, // 0000 RET 1 R0 }) ) ); @@ -739,279 +474,225 @@ be_local_closure(class_Matter_TLV_item_create_TLV, /* name */ /******************************************************************** -** Solidified function: parse +** Solidified function: tostring ********************************************************************/ extern const bclass be_class_Matter_TLV_item; -be_local_closure(class_Matter_TLV_item_parse, /* name */ +be_local_closure(class_Matter_TLV_item_tostring, /* name */ be_nested_proto( - 10, /* nstack */ - 3, /* argc */ + 7, /* nstack */ + 2, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_TLV_item, 1, /* has constants */ - ( &(const bvalue[25]) { /* constants */ - /* K0 */ be_nested_str_weak(typ), - /* K1 */ be_nested_str_weak(TLV), - /* K2 */ be_nested_str_weak(_len), - /* K3 */ be_nested_str_weak(val), - /* K4 */ be_nested_str_weak(int64), - /* K5 */ be_nested_str_weak(frombytes), - /* K6 */ be_nested_str_weak(BFALSE), - /* K7 */ be_nested_str_weak(BTRUE), - /* K8 */ be_nested_str_weak(U8), - /* K9 */ be_nested_str_weak(I8), - /* K10 */ be_nested_str_weak(geti), - /* K11 */ be_nested_str_weak(get), - /* K12 */ be_nested_str_weak(FLOAT), - /* K13 */ be_nested_str_weak(getfloat), - /* K14 */ be_const_int(1), - /* K15 */ be_nested_str_weak(UTF8), - /* K16 */ be_nested_str_weak(asstring), - /* K17 */ be_nested_str_weak(NULL), - /* K18 */ be_nested_str_weak(EOC), - /* K19 */ be_nested_str_weak(tasmota), - /* K20 */ be_nested_str_weak(log), - /* K21 */ be_nested_str_weak(MTR_X3A_X20unexpected_X20eoc), - /* K22 */ be_const_int(3), - /* K23 */ be_nested_str_weak(MTR_X3A_X20unexpected_X20type_X3A_X20), - /* K24 */ be_nested_str_weak(next_idx), - }), - be_str_weak(parse), - &be_const_str_solidified, - ( &(const binstruction[103]) { /* code */ - 0x880C0100, // 0000 GETMBR R3 R0 K0 - 0x88100101, // 0001 GETMBR R4 R0 K1 - 0x88140902, // 0002 GETMBR R5 R4 K2 - 0x94140A03, // 0003 GETIDX R5 R5 R3 - 0x541A0007, // 0004 LDINT R6 8 - 0x1C180A06, // 0005 EQ R6 R5 R6 - 0x781A0008, // 0006 JMPF R6 #0010 - 0xB81A0800, // 0007 GETNGBL R6 K4 - 0x8C180D05, // 0008 GETMET R6 R6 K5 - 0x5C200200, // 0009 MOVE R8 R1 - 0x5C240400, // 000A MOVE R9 R2 - 0x7C180600, // 000B CALL R6 3 - 0x90020606, // 000C SETMBR R0 K3 R6 - 0x541A0007, // 000D LDINT R6 8 - 0x00080406, // 000E ADD R2 R2 R6 - 0x70020054, // 000F JMP #0065 - 0x88180906, // 0010 GETMBR R6 R4 K6 - 0x1C180606, // 0011 EQ R6 R3 R6 - 0x741A0002, // 0012 JMPT R6 #0016 - 0x88180907, // 0013 GETMBR R6 R4 K7 - 0x1C180606, // 0014 EQ R6 R3 R6 - 0x781A0003, // 0015 JMPF R6 #001A - 0x88180907, // 0016 GETMBR R6 R4 K7 - 0x1C180606, // 0017 EQ R6 R3 R6 - 0x90020606, // 0018 SETMBR R0 K3 R6 - 0x7002004A, // 0019 JMP #0065 - 0x88180908, // 001A GETMBR R6 R4 K8 - 0x14180606, // 001B LT R6 R3 R6 - 0x781A000E, // 001C JMPF R6 #002C - 0x88180909, // 001D GETMBR R6 R4 K9 - 0x18180606, // 001E LE R6 R3 R6 - 0x781A0004, // 001F JMPF R6 #0025 - 0x8C18030A, // 0020 GETMET R6 R1 K10 - 0x5C200400, // 0021 MOVE R8 R2 - 0x5C240A00, // 0022 MOVE R9 R5 - 0x7C180600, // 0023 CALL R6 3 - 0x70020003, // 0024 JMP #0029 - 0x8C18030B, // 0025 GETMET R6 R1 K11 - 0x5C200400, // 0026 MOVE R8 R2 - 0x5C240A00, // 0027 MOVE R9 R5 - 0x7C180600, // 0028 CALL R6 3 - 0x90020606, // 0029 SETMBR R0 K3 R6 - 0x00080405, // 002A ADD R2 R2 R5 - 0x70020038, // 002B JMP #0065 - 0x8818090C, // 002C GETMBR R6 R4 K12 - 0x1C180606, // 002D EQ R6 R3 R6 - 0x781A0006, // 002E JMPF R6 #0036 - 0x8C18030D, // 002F GETMET R6 R1 K13 - 0x5C200400, // 0030 MOVE R8 R2 - 0x7C180400, // 0031 CALL R6 2 - 0x90020606, // 0032 SETMBR R0 K3 R6 - 0x541A0003, // 0033 LDINT R6 4 - 0x00080406, // 0034 ADD R2 R2 R6 - 0x7002002E, // 0035 JMP #0065 - 0x5419FFF7, // 0036 LDINT R6 -8 - 0x28180A06, // 0037 GE R6 R5 R6 - 0x781A0016, // 0038 JMPF R6 #0050 - 0x5419FFFE, // 0039 LDINT R6 -1 - 0x18180A06, // 003A LE R6 R5 R6 - 0x781A0013, // 003B JMPF R6 #0050 - 0x8C18030B, // 003C GETMET R6 R1 K11 - 0x5C200400, // 003D MOVE R8 R2 - 0x44240A00, // 003E NEG R9 R5 - 0x7C180600, // 003F CALL R6 3 - 0x441C0A00, // 0040 NEG R7 R5 - 0x00080407, // 0041 ADD R2 R2 R7 - 0x001C0406, // 0042 ADD R7 R2 R6 - 0x041C0F0E, // 0043 SUB R7 R7 K14 - 0x401C0407, // 0044 CONNECT R7 R2 R7 - 0x941C0207, // 0045 GETIDX R7 R1 R7 - 0x90020607, // 0046 SETMBR R0 K3 R7 - 0x00080406, // 0047 ADD R2 R2 R6 - 0x881C090F, // 0048 GETMBR R7 R4 K15 - 0x181C0607, // 0049 LE R7 R3 R7 - 0x781E0003, // 004A JMPF R7 #004F - 0x881C0103, // 004B GETMBR R7 R0 K3 - 0x8C1C0F10, // 004C GETMET R7 R7 K16 - 0x7C1C0200, // 004D CALL R7 1 - 0x90020607, // 004E SETMBR R0 K3 R7 - 0x70020014, // 004F JMP #0065 - 0x88180911, // 0050 GETMBR R6 R4 K17 - 0x1C180606, // 0051 EQ R6 R3 R6 - 0x781A0000, // 0052 JMPF R6 #0054 - 0x70020010, // 0053 JMP #0065 - 0x88180912, // 0054 GETMBR R6 R4 K18 - 0x1C180606, // 0055 EQ R6 R3 R6 - 0x781A0005, // 0056 JMPF R6 #005D - 0xB81A2600, // 0057 GETNGBL R6 K19 - 0x8C180D14, // 0058 GETMET R6 R6 K20 - 0x58200015, // 0059 LDCONST R8 K21 - 0x58240016, // 005A LDCONST R9 K22 - 0x7C180600, // 005B CALL R6 3 - 0x70020007, // 005C JMP #0065 - 0xB81A2600, // 005D GETNGBL R6 K19 - 0x8C180D14, // 005E GETMET R6 R6 K20 - 0x60200008, // 005F GETGBL R8 G8 - 0x5C240600, // 0060 MOVE R9 R3 - 0x7C200200, // 0061 CALL R8 1 - 0x00222E08, // 0062 ADD R8 K23 R8 - 0x58240016, // 0063 LDCONST R9 K22 - 0x7C180600, // 0064 CALL R6 3 - 0x90023002, // 0065 SETMBR R0 K24 R2 - 0x80040400, // 0066 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: _encode_tag_len -********************************************************************/ -extern const bclass be_class_Matter_TLV_item; -be_local_closure(class_Matter_TLV_item__encode_tag_len, /* name */ - be_nested_proto( - 6, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - &be_class_Matter_TLV_item, - 1, /* has constants */ - ( &(const bvalue[ 8]) { /* constants */ - /* K0 */ be_nested_str_weak(tag_number), - /* K1 */ be_const_int(0), - /* K2 */ be_nested_str_weak(tag_vendor), - /* K3 */ be_nested_str_weak(tag_profile), - /* K4 */ be_const_int(3), - /* K5 */ be_nested_str_weak(tag_sub), - /* K6 */ be_const_int(2), - /* K7 */ be_const_int(1), + ( &(const bvalue[34]) { /* constants */ + /* K0 */ be_nested_str_weak(), + /* K1 */ be_nested_str_weak(tag_profile), + /* K2 */ be_nested_str_weak(Matter_X3A_X3A), + /* K3 */ be_nested_str_weak(tag_number), + /* K4 */ be_nested_str_weak(0x_X2508X_X20), + /* K5 */ be_nested_str_weak(tag_vendor), + /* K6 */ be_nested_str_weak(0x_X2504X_X3A_X3A), + /* K7 */ be_nested_str_weak(0x_X2504X_X3A), + /* K8 */ be_nested_str_weak(tag_sub), + /* K9 */ be_nested_str_weak(_X25i_X20), + /* K10 */ be_const_int(0), + /* K11 */ be_nested_str_weak(_X3D_X20), + /* K12 */ be_nested_str_weak(val), + /* K13 */ be_nested_str_weak(int), + /* K14 */ be_nested_str_weak(_X25i), + /* K15 */ be_nested_str_weak(typ), + /* K16 */ be_nested_str_weak(TLV), + /* K17 */ be_nested_str_weak(U1), + /* K18 */ be_nested_str_weak(U8), + /* K19 */ be_nested_str_weak(U), + /* K20 */ be_nested_str_weak(bool), + /* K21 */ be_nested_str_weak(true), + /* K22 */ be_nested_str_weak(false), + /* K23 */ be_nested_str_weak(null), + /* K24 */ be_nested_str_weak(real), + /* K25 */ be_nested_str_weak(_X25g), + /* K26 */ be_nested_str_weak(string), + /* K27 */ be_nested_str_weak(_X22_X25s_X22), + /* K28 */ be_nested_str_weak(int64), + /* K29 */ be_nested_str_weak(tostring), + /* K30 */ be_nested_str_weak(instance), + /* K31 */ be_nested_str_weak(_X25s), + /* K32 */ be_nested_str_weak(tohex), + /* K33 */ be_nested_str_weak(_X20), }), - be_str_weak(_encode_tag_len), + be_str_weak(tostring), &be_const_str_solidified, - ( &(const binstruction[54]) { /* 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 - 0x540AFFFF, // 0007 LDINT R2 65536 - 0x28080202, // 0008 GE R2 R1 R2 - 0x740A0002, // 0009 JMPT R2 #000D - 0x14080301, // 000A LT R2 R1 K1 - 0x740A0000, // 000B JMPT R2 #000D - 0x50080001, // 000C LDBOOL R2 0 1 - 0x50080200, // 000D LDBOOL R2 1 0 - 0x580C0001, // 000E LDCONST R3 K1 - 0x88100102, // 000F GETMBR R4 R0 K2 - 0x4C140000, // 0010 LDNIL R5 - 0x20100805, // 0011 NE R4 R4 R5 - 0x78120006, // 0012 JMPF R4 #001A - 0x780A0002, // 0013 JMPF R2 #0017 - 0x54120008, // 0014 LDINT R4 9 - 0x80040800, // 0015 RET 1 R4 - 0x70020001, // 0016 JMP #0019 - 0x54120006, // 0017 LDINT R4 7 - 0x80040800, // 0018 RET 1 R4 - 0x7002001A, // 0019 JMP #0035 - 0x88100103, // 001A GETMBR R4 R0 K3 - 0x5415FFFE, // 001B LDINT R5 -1 - 0x1C100805, // 001C EQ R4 R4 R5 - 0x78120005, // 001D JMPF R4 #0024 - 0x780A0002, // 001E JMPF R2 #0022 - 0x54120004, // 001F LDINT R4 5 - 0x80040800, // 0020 RET 1 R4 - 0x70020000, // 0021 JMP #0023 - 0x80060800, // 0022 RET 1 K4 - 0x70020010, // 0023 JMP #0035 - 0x88100103, // 0024 GETMBR R4 R0 K3 - 0x4C140000, // 0025 LDNIL R5 - 0x20100805, // 0026 NE R4 R4 R5 - 0x78120005, // 0027 JMPF R4 #002E - 0x780A0002, // 0028 JMPF R2 #002C - 0x54120004, // 0029 LDINT R4 5 - 0x80040800, // 002A RET 1 R4 - 0x70020000, // 002B JMP #002D - 0x80060800, // 002C RET 1 K4 - 0x70020006, // 002D JMP #0035 - 0x88100105, // 002E GETMBR R4 R0 K5 - 0x4C140000, // 002F LDNIL R5 - 0x20100805, // 0030 NE R4 R4 R5 - 0x78120001, // 0031 JMPF R4 #0034 - 0x80060C00, // 0032 RET 1 K6 - 0x70020000, // 0033 JMP #0035 - 0x80060E00, // 0034 RET 1 K7 - 0x80000000, // 0035 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set -********************************************************************/ -extern const bclass be_class_Matter_TLV_item; -be_local_closure(class_Matter_TLV_item_set, /* name */ - be_nested_proto( - 5, /* nstack */ - 3, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - &be_class_Matter_TLV_item, - 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_weak(reset), - /* K1 */ be_nested_str_weak(typ), - /* K2 */ be_nested_str_weak(val), - }), - be_str_weak(set), - &be_const_str_solidified, - ( &(const binstruction[12]) { /* code */ - 0x8C0C0100, // 0000 GETMET R3 R0 K0 - 0x7C0C0200, // 0001 CALL R3 1 - 0x4C0C0000, // 0002 LDNIL R3 - 0x200C0403, // 0003 NE R3 R2 R3 - 0x740E0002, // 0004 JMPT R3 #0008 - 0x540E0013, // 0005 LDINT R3 20 - 0x1C0C0203, // 0006 EQ R3 R1 R3 - 0x780E0002, // 0007 JMPF R3 #000B - 0x90020201, // 0008 SETMBR R0 K1 R1 - 0x90020402, // 0009 SETMBR R0 K2 R2 - 0x80040000, // 000A RET 1 R0 - 0x80000000, // 000B RET 0 + ( &(const binstruction[167]) { /* code */ + 0x58080000, // 0000 LDCONST R2 K0 + 0xA802009C, // 0001 EXBLK 0 #009F + 0x500C0200, // 0002 LDBOOL R3 1 0 + 0x200C0203, // 0003 NE R3 R1 R3 + 0x780E0038, // 0004 JMPF R3 #003E + 0x880C0101, // 0005 GETMBR R3 R0 K1 + 0x5411FFFE, // 0006 LDINT R4 -1 + 0x1C0C0604, // 0007 EQ R3 R3 R4 + 0x780E000A, // 0008 JMPF R3 #0014 + 0x00080502, // 0009 ADD R2 R2 K2 + 0x880C0103, // 000A GETMBR R3 R0 K3 + 0x4C100000, // 000B LDNIL R4 + 0x200C0604, // 000C NE R3 R3 R4 + 0x780E0004, // 000D JMPF R3 #0013 + 0x600C0018, // 000E GETGBL R3 G24 + 0x58100004, // 000F LDCONST R4 K4 + 0x88140103, // 0010 GETMBR R5 R0 K3 + 0x7C0C0400, // 0011 CALL R3 2 + 0x00080403, // 0012 ADD R2 R2 R3 + 0x70020023, // 0013 JMP #0038 + 0x880C0105, // 0014 GETMBR R3 R0 K5 + 0x4C100000, // 0015 LDNIL R4 + 0x200C0604, // 0016 NE R3 R3 R4 + 0x780E0004, // 0017 JMPF R3 #001D + 0x600C0018, // 0018 GETGBL R3 G24 + 0x58100006, // 0019 LDCONST R4 K6 + 0x88140105, // 001A GETMBR R5 R0 K5 + 0x7C0C0400, // 001B CALL R3 2 + 0x00080403, // 001C ADD R2 R2 R3 + 0x880C0101, // 001D GETMBR R3 R0 K1 + 0x4C100000, // 001E LDNIL R4 + 0x200C0604, // 001F NE R3 R3 R4 + 0x780E0004, // 0020 JMPF R3 #0026 + 0x600C0018, // 0021 GETGBL R3 G24 + 0x58100007, // 0022 LDCONST R4 K7 + 0x88140101, // 0023 GETMBR R5 R0 K1 + 0x7C0C0400, // 0024 CALL R3 2 + 0x00080403, // 0025 ADD R2 R2 R3 + 0x880C0103, // 0026 GETMBR R3 R0 K3 + 0x4C100000, // 0027 LDNIL R4 + 0x200C0604, // 0028 NE R3 R3 R4 + 0x780E0004, // 0029 JMPF R3 #002F + 0x600C0018, // 002A GETGBL R3 G24 + 0x58100004, // 002B LDCONST R4 K4 + 0x88140103, // 002C GETMBR R5 R0 K3 + 0x7C0C0400, // 002D CALL R3 2 + 0x00080403, // 002E ADD R2 R2 R3 + 0x880C0108, // 002F GETMBR R3 R0 K8 + 0x4C100000, // 0030 LDNIL R4 + 0x200C0604, // 0031 NE R3 R3 R4 + 0x780E0004, // 0032 JMPF R3 #0038 + 0x600C0018, // 0033 GETGBL R3 G24 + 0x58100009, // 0034 LDCONST R4 K9 + 0x88140108, // 0035 GETMBR R5 R0 K8 + 0x7C0C0400, // 0036 CALL R3 2 + 0x00080403, // 0037 ADD R2 R2 R3 + 0x600C000C, // 0038 GETGBL R3 G12 + 0x5C100400, // 0039 MOVE R4 R2 + 0x7C0C0200, // 003A CALL R3 1 + 0x240C070A, // 003B GT R3 R3 K10 + 0x780E0000, // 003C JMPF R3 #003E + 0x0008050B, // 003D ADD R2 R2 K11 + 0x600C0004, // 003E GETGBL R3 G4 + 0x8810010C, // 003F GETMBR R4 R0 K12 + 0x7C0C0200, // 0040 CALL R3 1 + 0x1C0C070D, // 0041 EQ R3 R3 K13 + 0x780E0010, // 0042 JMPF R3 #0054 + 0x600C0018, // 0043 GETGBL R3 G24 + 0x5810000E, // 0044 LDCONST R4 K14 + 0x8814010C, // 0045 GETMBR R5 R0 K12 + 0x7C0C0400, // 0046 CALL R3 2 + 0x00080403, // 0047 ADD R2 R2 R3 + 0x880C010F, // 0048 GETMBR R3 R0 K15 + 0x88100110, // 0049 GETMBR R4 R0 K16 + 0x88100911, // 004A GETMBR R4 R4 K17 + 0x280C0604, // 004B GE R3 R3 R4 + 0x780E0005, // 004C JMPF R3 #0053 + 0x880C010F, // 004D GETMBR R3 R0 K15 + 0x88100110, // 004E GETMBR R4 R0 K16 + 0x88100912, // 004F GETMBR R4 R4 K18 + 0x180C0604, // 0050 LE R3 R3 R4 + 0x780E0000, // 0051 JMPF R3 #0053 + 0x00080513, // 0052 ADD R2 R2 K19 + 0x70020048, // 0053 JMP #009D + 0x600C0004, // 0054 GETGBL R3 G4 + 0x8810010C, // 0055 GETMBR R4 R0 K12 + 0x7C0C0200, // 0056 CALL R3 1 + 0x1C0C0714, // 0057 EQ R3 R3 K20 + 0x780E0006, // 0058 JMPF R3 #0060 + 0x880C010C, // 0059 GETMBR R3 R0 K12 + 0x780E0001, // 005A JMPF R3 #005D + 0x580C0015, // 005B LDCONST R3 K21 + 0x70020000, // 005C JMP #005E + 0x580C0016, // 005D LDCONST R3 K22 + 0x00080403, // 005E ADD R2 R2 R3 + 0x7002003C, // 005F JMP #009D + 0x880C010C, // 0060 GETMBR R3 R0 K12 + 0x4C100000, // 0061 LDNIL R4 + 0x1C0C0604, // 0062 EQ R3 R3 R4 + 0x780E0001, // 0063 JMPF R3 #0066 + 0x00080517, // 0064 ADD R2 R2 K23 + 0x70020036, // 0065 JMP #009D + 0x600C0004, // 0066 GETGBL R3 G4 + 0x8810010C, // 0067 GETMBR R4 R0 K12 + 0x7C0C0200, // 0068 CALL R3 1 + 0x1C0C0718, // 0069 EQ R3 R3 K24 + 0x780E0005, // 006A JMPF R3 #0071 + 0x600C0018, // 006B GETGBL R3 G24 + 0x58100019, // 006C LDCONST R4 K25 + 0x8814010C, // 006D GETMBR R5 R0 K12 + 0x7C0C0400, // 006E CALL R3 2 + 0x00080403, // 006F ADD R2 R2 R3 + 0x7002002B, // 0070 JMP #009D + 0x600C0004, // 0071 GETGBL R3 G4 + 0x8810010C, // 0072 GETMBR R4 R0 K12 + 0x7C0C0200, // 0073 CALL R3 1 + 0x1C0C071A, // 0074 EQ R3 R3 K26 + 0x780E0005, // 0075 JMPF R3 #007C + 0x600C0018, // 0076 GETGBL R3 G24 + 0x5810001B, // 0077 LDCONST R4 K27 + 0x8814010C, // 0078 GETMBR R5 R0 K12 + 0x7C0C0400, // 0079 CALL R3 2 + 0x00080403, // 007A ADD R2 R2 R3 + 0x70020020, // 007B JMP #009D + 0x600C000F, // 007C GETGBL R3 G15 + 0x8810010C, // 007D GETMBR R4 R0 K12 + 0xB8163800, // 007E GETNGBL R5 K28 + 0x7C0C0400, // 007F CALL R3 2 + 0x780E000F, // 0080 JMPF R3 #0091 + 0x880C010C, // 0081 GETMBR R3 R0 K12 + 0x8C0C071D, // 0082 GETMET R3 R3 K29 + 0x7C0C0200, // 0083 CALL R3 1 + 0x00080403, // 0084 ADD R2 R2 R3 + 0x880C010F, // 0085 GETMBR R3 R0 K15 + 0x88100110, // 0086 GETMBR R4 R0 K16 + 0x88100911, // 0087 GETMBR R4 R4 K17 + 0x280C0604, // 0088 GE R3 R3 R4 + 0x780E0005, // 0089 JMPF R3 #0090 + 0x880C010F, // 008A GETMBR R3 R0 K15 + 0x88100110, // 008B GETMBR R4 R0 K16 + 0x88100912, // 008C GETMBR R4 R4 K18 + 0x180C0604, // 008D LE R3 R3 R4 + 0x780E0000, // 008E JMPF R3 #0090 + 0x00080513, // 008F ADD R2 R2 K19 + 0x7002000B, // 0090 JMP #009D + 0x600C0004, // 0091 GETGBL R3 G4 + 0x8810010C, // 0092 GETMBR R4 R0 K12 + 0x7C0C0200, // 0093 CALL R3 1 + 0x1C0C071E, // 0094 EQ R3 R3 K30 + 0x780E0006, // 0095 JMPF R3 #009D + 0x600C0018, // 0096 GETGBL R3 G24 + 0x5810001F, // 0097 LDCONST R4 K31 + 0x8814010C, // 0098 GETMBR R5 R0 K12 + 0x8C140B20, // 0099 GETMET R5 R5 K32 + 0x7C140200, // 009A CALL R5 1 + 0x7C0C0400, // 009B CALL R3 2 + 0x00080403, // 009C ADD R2 R2 R3 + 0xA8040001, // 009D EXBLK 1 1 + 0x70020006, // 009E JMP #00A6 + 0xAC0C0002, // 009F CATCH R3 0 2 + 0x70020003, // 00A0 JMP #00A5 + 0x00140721, // 00A1 ADD R5 R3 K33 + 0x00140A04, // 00A2 ADD R5 R5 R4 + 0x80040A00, // 00A3 RET 1 R5 + 0x70020000, // 00A4 JMP #00A6 + 0xB0080000, // 00A5 RAISE 2 R0 R0 + 0x80040400, // 00A6 RET 1 R2 }) ) ); @@ -1019,434 +700,182 @@ be_local_closure(class_Matter_TLV_item_set, /* name */ /******************************************************************** -** Solidified function: tlv2raw +** Solidified function: to_str_val ********************************************************************/ extern const bclass be_class_Matter_TLV_item; -be_local_closure(class_Matter_TLV_item_tlv2raw, /* name */ +be_local_closure(class_Matter_TLV_item_to_str_val, /* name */ be_nested_proto( - 9, /* nstack */ - 2, /* argc */ + 4, /* nstack */ + 1, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_TLV_item, 1, /* has constants */ - ( &(const bvalue[42]) { /* constants */ - /* K0 */ be_nested_str_weak(TLV), - /* K1 */ be_nested_str_weak(typ), - /* K2 */ be_nested_str_weak(RAW), - /* K3 */ be_nested_str_weak(val), - /* K4 */ be_nested_str_weak(BFALSE), - /* K5 */ be_nested_str_weak(BTRUE), - /* K6 */ be_nested_str_weak(I2), - /* K7 */ be_nested_str_weak(I4), - /* K8 */ be_nested_str_weak(I1), - /* K9 */ be_nested_str_weak(U2), - /* K10 */ be_nested_str_weak(U4), - /* K11 */ be_const_int(0), - /* K12 */ be_nested_str_weak(U1), - /* K13 */ be_nested_str_weak(B1), - /* K14 */ be_nested_str_weak(B8), - /* K15 */ be_nested_str_weak(B2), - /* K16 */ be_nested_str_weak(B4), - /* K17 */ be_nested_str_weak(UTF1), - /* K18 */ be_nested_str_weak(UTF8), - /* K19 */ be_nested_str_weak(UTF2), - /* K20 */ be_nested_str_weak(UTF4), - /* K21 */ be_nested_str_weak(_encode_tag), - /* K22 */ be_nested_str_weak(add), - /* K23 */ be_const_int(1), - /* K24 */ be_const_int(2), - /* K25 */ be_nested_str_weak(I8), - /* K26 */ be_nested_str_weak(U8), - /* K27 */ be_nested_str_weak(copy), - /* K28 */ be_nested_str_weak(resize), - /* K29 */ be_nested_str_weak(int64), - /* K30 */ be_nested_str_weak(tobytes), - /* K31 */ be_nested_str_weak(FLOAT), - /* K32 */ be_nested_str_weak(setfloat), - /* K33 */ be_nested_str_weak(DOUBLE), - /* K34 */ be_nested_str_weak(value_error), - /* K35 */ be_nested_str_weak(Unsupported_X20type_X20TLV_X2EDOUBLE), - /* K36 */ be_nested_str_weak(string_X20too_X20big), - /* K37 */ be_nested_str_weak(fromstring), - /* K38 */ be_nested_str_weak(frostring), - /* K39 */ be_nested_str_weak(bytes_X20too_X20big), - /* K40 */ be_nested_str_weak(NULL), - /* K41 */ be_nested_str_weak(unsupported_X20type_X20), + ( &(const bvalue[16]) { /* constants */ + /* K0 */ be_nested_str_weak(val), + /* K1 */ be_nested_str_weak(int), + /* K2 */ be_nested_str_weak(typ), + /* K3 */ be_nested_str_weak(TLV), + /* K4 */ be_nested_str_weak(U1), + /* K5 */ be_nested_str_weak(U8), + /* K6 */ be_nested_str_weak(U), + /* K7 */ be_nested_str_weak(bool), + /* K8 */ be_nested_str_weak(true), + /* K9 */ be_nested_str_weak(false), + /* K10 */ be_nested_str_weak(null), + /* K11 */ be_nested_str_weak(real), + /* K12 */ be_nested_str_weak(string), + /* K13 */ be_nested_str_weak(int64), + /* K14 */ be_nested_str_weak(tostring), + /* K15 */ be_nested_str_weak(instance), }), - be_str_weak(tlv2raw), + be_str_weak(to_str_val), &be_const_str_solidified, - ( &(const binstruction[368]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x4C0C0000, // 0001 LDNIL R3 - 0x1C0C0203, // 0002 EQ R3 R1 R3 - 0x780E0002, // 0003 JMPF R3 #0007 - 0x600C0015, // 0004 GETGBL R3 G21 - 0x7C0C0000, // 0005 CALL R3 0 - 0x5C040600, // 0006 MOVE R1 R3 - 0x880C0101, // 0007 GETMBR R3 R0 K1 - 0x88100502, // 0008 GETMBR R4 R2 K2 - 0x1C0C0604, // 0009 EQ R3 R3 R4 - 0x780E0002, // 000A JMPF R3 #000E - 0x880C0103, // 000B GETMBR R3 R0 K3 - 0x400C0203, // 000C CONNECT R3 R1 R3 - 0x80040200, // 000D RET 1 R1 - 0x880C0101, // 000E GETMBR R3 R0 K1 - 0x88100504, // 000F GETMBR R4 R2 K4 - 0x1C0C0604, // 0010 EQ R3 R3 R4 - 0x740E0003, // 0011 JMPT R3 #0016 - 0x880C0101, // 0012 GETMBR R3 R0 K1 - 0x88100505, // 0013 GETMBR R4 R2 K5 - 0x1C0C0604, // 0014 EQ R3 R3 R4 - 0x780E0008, // 0015 JMPF R3 #001F - 0x600C0017, // 0016 GETGBL R3 G23 - 0x88100103, // 0017 GETMBR R4 R0 K3 - 0x7C0C0200, // 0018 CALL R3 1 - 0x780E0001, // 0019 JMPF R3 #001C - 0x880C0505, // 001A GETMBR R3 R2 K5 - 0x70020000, // 001B JMP #001D - 0x880C0504, // 001C GETMBR R3 R2 K4 - 0x90020203, // 001D SETMBR R0 K1 R3 - 0x70020070, // 001E JMP #0090 - 0x880C0101, // 001F GETMBR R3 R0 K1 - 0x88100506, // 0020 GETMBR R4 R2 K6 - 0x280C0604, // 0021 GE R3 R3 R4 - 0x780E0018, // 0022 JMPF R3 #003C - 0x880C0101, // 0023 GETMBR R3 R0 K1 - 0x88100507, // 0024 GETMBR R4 R2 K7 - 0x180C0604, // 0025 LE R3 R3 R4 - 0x780E0014, // 0026 JMPF R3 #003C - 0x600C0009, // 0027 GETGBL R3 G9 - 0x88100103, // 0028 GETMBR R4 R0 K3 - 0x7C0C0200, // 0029 CALL R3 1 - 0x5412007E, // 002A LDINT R4 127 - 0x18100604, // 002B LE R4 R3 R4 - 0x78120005, // 002C JMPF R4 #0033 - 0x5411FF7F, // 002D LDINT R4 -128 - 0x28100604, // 002E GE R4 R3 R4 - 0x78120002, // 002F JMPF R4 #0033 - 0x88100508, // 0030 GETMBR R4 R2 K8 - 0x90020204, // 0031 SETMBR R0 K1 R4 - 0x70020007, // 0032 JMP #003B - 0x54127FFE, // 0033 LDINT R4 32767 - 0x18100604, // 0034 LE R4 R3 R4 - 0x78120004, // 0035 JMPF R4 #003B - 0x54117FFF, // 0036 LDINT R4 -32768 - 0x28100604, // 0037 GE R4 R3 R4 - 0x78120001, // 0038 JMPF R4 #003B - 0x88100506, // 0039 GETMBR R4 R2 K6 - 0x90020204, // 003A SETMBR R0 K1 R4 - 0x70020053, // 003B JMP #0090 - 0x880C0101, // 003C GETMBR R3 R0 K1 - 0x88100509, // 003D GETMBR R4 R2 K9 - 0x280C0604, // 003E GE R3 R3 R4 - 0x780E0016, // 003F JMPF R3 #0057 - 0x880C0101, // 0040 GETMBR R3 R0 K1 - 0x8810050A, // 0041 GETMBR R4 R2 K10 - 0x180C0604, // 0042 LE R3 R3 R4 - 0x780E0012, // 0043 JMPF R3 #0057 - 0x600C0009, // 0044 GETGBL R3 G9 - 0x88100103, // 0045 GETMBR R4 R0 K3 - 0x7C0C0200, // 0046 CALL R3 1 - 0x541200FE, // 0047 LDINT R4 255 - 0x18100604, // 0048 LE R4 R3 R4 - 0x78120004, // 0049 JMPF R4 #004F - 0x2810070B, // 004A GE R4 R3 K11 - 0x78120002, // 004B JMPF R4 #004F - 0x8810050C, // 004C GETMBR R4 R2 K12 - 0x90020204, // 004D SETMBR R0 K1 R4 - 0x70020006, // 004E JMP #0056 - 0x5412FFFE, // 004F LDINT R4 65535 - 0x18100604, // 0050 LE R4 R3 R4 - 0x78120003, // 0051 JMPF R4 #0056 - 0x2810070B, // 0052 GE R4 R3 K11 - 0x78120001, // 0053 JMPF R4 #0056 - 0x88100509, // 0054 GETMBR R4 R2 K9 - 0x90020204, // 0055 SETMBR R0 K1 R4 - 0x70020038, // 0056 JMP #0090 - 0x880C0101, // 0057 GETMBR R3 R0 K1 - 0x8810050D, // 0058 GETMBR R4 R2 K13 - 0x280C0604, // 0059 GE R3 R3 R4 - 0x780E0018, // 005A JMPF R3 #0074 - 0x880C0101, // 005B GETMBR R3 R0 K1 - 0x8810050E, // 005C GETMBR R4 R2 K14 - 0x180C0604, // 005D LE R3 R3 R4 - 0x780E0014, // 005E JMPF R3 #0074 - 0x600C000C, // 005F GETGBL R3 G12 - 0x88100103, // 0060 GETMBR R4 R0 K3 - 0x7C0C0200, // 0061 CALL R3 1 - 0x541200FE, // 0062 LDINT R4 255 - 0x180C0604, // 0063 LE R3 R3 R4 - 0x780E0002, // 0064 JMPF R3 #0068 - 0x880C050D, // 0065 GETMBR R3 R2 K13 - 0x90020203, // 0066 SETMBR R0 K1 R3 - 0x7002000A, // 0067 JMP #0073 - 0x600C000C, // 0068 GETGBL R3 G12 - 0x88100103, // 0069 GETMBR R4 R0 K3 - 0x7C0C0200, // 006A CALL R3 1 - 0x5412FFFE, // 006B LDINT R4 65535 - 0x180C0604, // 006C LE R3 R3 R4 - 0x780E0002, // 006D JMPF R3 #0071 - 0x880C050F, // 006E GETMBR R3 R2 K15 - 0x90020203, // 006F SETMBR R0 K1 R3 - 0x70020001, // 0070 JMP #0073 - 0x880C0510, // 0071 GETMBR R3 R2 K16 - 0x90020203, // 0072 SETMBR R0 K1 R3 - 0x7002001B, // 0073 JMP #0090 - 0x880C0101, // 0074 GETMBR R3 R0 K1 - 0x88100511, // 0075 GETMBR R4 R2 K17 - 0x280C0604, // 0076 GE R3 R3 R4 - 0x780E0017, // 0077 JMPF R3 #0090 - 0x880C0101, // 0078 GETMBR R3 R0 K1 - 0x88100512, // 0079 GETMBR R4 R2 K18 - 0x180C0604, // 007A LE R3 R3 R4 - 0x780E0013, // 007B JMPF R3 #0090 - 0x600C000C, // 007C GETGBL R3 G12 - 0x88100103, // 007D GETMBR R4 R0 K3 - 0x7C0C0200, // 007E CALL R3 1 - 0x541200FE, // 007F LDINT R4 255 - 0x180C0604, // 0080 LE R3 R3 R4 - 0x780E0002, // 0081 JMPF R3 #0085 - 0x880C0511, // 0082 GETMBR R3 R2 K17 - 0x90020203, // 0083 SETMBR R0 K1 R3 - 0x7002000A, // 0084 JMP #0090 - 0x600C000C, // 0085 GETGBL R3 G12 - 0x88100103, // 0086 GETMBR R4 R0 K3 - 0x7C0C0200, // 0087 CALL R3 1 - 0x5412FFFE, // 0088 LDINT R4 65535 - 0x180C0604, // 0089 LE R3 R3 R4 - 0x780E0002, // 008A JMPF R3 #008E - 0x880C0513, // 008B GETMBR R3 R2 K19 - 0x90020203, // 008C SETMBR R0 K1 R3 - 0x70020001, // 008D JMP #0090 - 0x880C0514, // 008E GETMBR R3 R2 K20 - 0x90020203, // 008F SETMBR R0 K1 R3 - 0x8C0C0115, // 0090 GETMET R3 R0 K21 - 0x5C140200, // 0091 MOVE R5 R1 - 0x7C0C0400, // 0092 CALL R3 2 - 0x880C0101, // 0093 GETMBR R3 R0 K1 - 0x88100508, // 0094 GETMBR R4 R2 K8 - 0x1C0C0604, // 0095 EQ R3 R3 R4 - 0x740E0003, // 0096 JMPT R3 #009B - 0x880C0101, // 0097 GETMBR R3 R0 K1 - 0x8810050C, // 0098 GETMBR R4 R2 K12 - 0x1C0C0604, // 0099 EQ R3 R3 R4 - 0x780E0006, // 009A JMPF R3 #00A2 - 0x8C0C0316, // 009B GETMET R3 R1 K22 - 0x60140009, // 009C GETGBL R5 G9 - 0x88180103, // 009D GETMBR R6 R0 K3 - 0x7C140200, // 009E CALL R5 1 - 0x58180017, // 009F LDCONST R6 K23 - 0x7C0C0600, // 00A0 CALL R3 3 - 0x700200CC, // 00A1 JMP #016F - 0x880C0101, // 00A2 GETMBR R3 R0 K1 - 0x88100506, // 00A3 GETMBR R4 R2 K6 - 0x1C0C0604, // 00A4 EQ R3 R3 R4 - 0x740E0003, // 00A5 JMPT R3 #00AA - 0x880C0101, // 00A6 GETMBR R3 R0 K1 - 0x88100509, // 00A7 GETMBR R4 R2 K9 - 0x1C0C0604, // 00A8 EQ R3 R3 R4 - 0x780E0006, // 00A9 JMPF R3 #00B1 - 0x8C0C0316, // 00AA GETMET R3 R1 K22 - 0x60140009, // 00AB GETGBL R5 G9 - 0x88180103, // 00AC GETMBR R6 R0 K3 - 0x7C140200, // 00AD CALL R5 1 - 0x58180018, // 00AE LDCONST R6 K24 - 0x7C0C0600, // 00AF CALL R3 3 - 0x700200BD, // 00B0 JMP #016F - 0x880C0101, // 00B1 GETMBR R3 R0 K1 - 0x88100507, // 00B2 GETMBR R4 R2 K7 - 0x1C0C0604, // 00B3 EQ R3 R3 R4 - 0x740E0003, // 00B4 JMPT R3 #00B9 - 0x880C0101, // 00B5 GETMBR R3 R0 K1 - 0x8810050A, // 00B6 GETMBR R4 R2 K10 - 0x1C0C0604, // 00B7 EQ R3 R3 R4 - 0x780E0006, // 00B8 JMPF R3 #00C0 - 0x8C0C0316, // 00B9 GETMET R3 R1 K22 - 0x60140009, // 00BA GETGBL R5 G9 - 0x88180103, // 00BB GETMBR R6 R0 K3 - 0x7C140200, // 00BC CALL R5 1 - 0x541A0003, // 00BD LDINT R6 4 - 0x7C0C0600, // 00BE CALL R3 3 - 0x700200AE, // 00BF JMP #016F - 0x880C0101, // 00C0 GETMBR R3 R0 K1 - 0x88100519, // 00C1 GETMBR R4 R2 K25 - 0x1C0C0604, // 00C2 EQ R3 R3 R4 - 0x740E0003, // 00C3 JMPT R3 #00C8 - 0x880C0101, // 00C4 GETMBR R3 R0 K1 - 0x8810051A, // 00C5 GETMBR R4 R2 K26 - 0x1C0C0604, // 00C6 EQ R3 R3 R4 - 0x780E001F, // 00C7 JMPF R3 #00E8 - 0x880C0103, // 00C8 GETMBR R3 R0 K3 - 0x6010000F, // 00C9 GETGBL R4 G15 - 0x5C140600, // 00CA MOVE R5 R3 - 0x60180015, // 00CB GETGBL R6 G21 - 0x7C100400, // 00CC CALL R4 2 - 0x78120006, // 00CD JMPF R4 #00D5 - 0x8C10071B, // 00CE GETMET R4 R3 K27 - 0x7C100200, // 00CF CALL R4 1 - 0x8C10091C, // 00D0 GETMET R4 R4 K28 - 0x541A0007, // 00D1 LDINT R6 8 - 0x7C100400, // 00D2 CALL R4 2 - 0x5C0C0800, // 00D3 MOVE R3 R4 - 0x70020010, // 00D4 JMP #00E6 - 0x6010000F, // 00D5 GETGBL R4 G15 - 0x5C140600, // 00D6 MOVE R5 R3 - 0xB81A3A00, // 00D7 GETNGBL R6 K29 - 0x7C100400, // 00D8 CALL R4 2 - 0x78120003, // 00D9 JMPF R4 #00DE - 0x8C10071E, // 00DA GETMET R4 R3 K30 - 0x7C100200, // 00DB CALL R4 1 - 0x5C0C0800, // 00DC MOVE R3 R4 - 0x70020007, // 00DD JMP #00E6 - 0xB8123A00, // 00DE GETNGBL R4 K29 - 0x60140009, // 00DF GETGBL R5 G9 - 0x5C180600, // 00E0 MOVE R6 R3 - 0x7C140200, // 00E1 CALL R5 1 - 0x7C100200, // 00E2 CALL R4 1 - 0x8C10091E, // 00E3 GETMET R4 R4 K30 - 0x7C100200, // 00E4 CALL R4 1 - 0x5C0C0800, // 00E5 MOVE R3 R4 - 0x40100203, // 00E6 CONNECT R4 R1 R3 - 0x70020086, // 00E7 JMP #016F - 0x880C0101, // 00E8 GETMBR R3 R0 K1 - 0x88100504, // 00E9 GETMBR R4 R2 K4 - 0x1C0C0604, // 00EA EQ R3 R3 R4 - 0x740E0003, // 00EB JMPT R3 #00F0 - 0x880C0101, // 00EC GETMBR R3 R0 K1 - 0x88100505, // 00ED GETMBR R4 R2 K5 - 0x1C0C0604, // 00EE EQ R3 R3 R4 - 0x780E0000, // 00EF JMPF R3 #00F1 - 0x7002007D, // 00F0 JMP #016F - 0x880C0101, // 00F1 GETMBR R3 R0 K1 - 0x8810051F, // 00F2 GETMBR R4 R2 K31 - 0x1C0C0604, // 00F3 EQ R3 R3 R4 - 0x780E000D, // 00F4 JMPF R3 #0103 - 0x600C000C, // 00F5 GETGBL R3 G12 - 0x5C100200, // 00F6 MOVE R4 R1 - 0x7C0C0200, // 00F7 CALL R3 1 - 0x8C100316, // 00F8 GETMET R4 R1 K22 - 0x5818000B, // 00F9 LDCONST R6 K11 - 0x541E0003, // 00FA LDINT R7 4 - 0x7C100600, // 00FB CALL R4 3 - 0x8C100320, // 00FC GETMET R4 R1 K32 - 0x5C180600, // 00FD MOVE R6 R3 - 0x601C000A, // 00FE GETGBL R7 G10 - 0x88200103, // 00FF GETMBR R8 R0 K3 - 0x7C1C0200, // 0100 CALL R7 1 - 0x7C100600, // 0101 CALL R4 3 - 0x7002006B, // 0102 JMP #016F - 0x880C0101, // 0103 GETMBR R3 R0 K1 - 0x88100521, // 0104 GETMBR R4 R2 K33 - 0x1C0C0604, // 0105 EQ R3 R3 R4 - 0x780E0001, // 0106 JMPF R3 #0109 - 0xB0064523, // 0107 RAISE 1 K34 K35 - 0x70020065, // 0108 JMP #016F - 0x880C0101, // 0109 GETMBR R3 R0 K1 - 0x88100511, // 010A GETMBR R4 R2 K17 - 0x1C0C0604, // 010B EQ R3 R3 R4 - 0x780E0015, // 010C JMPF R3 #0123 - 0x600C000C, // 010D GETGBL R3 G12 - 0x88100103, // 010E GETMBR R4 R0 K3 - 0x7C0C0200, // 010F CALL R3 1 - 0x541200FE, // 0110 LDINT R4 255 - 0x240C0604, // 0111 GT R3 R3 R4 - 0x780E0000, // 0112 JMPF R3 #0114 - 0xB0064524, // 0113 RAISE 1 K34 K36 - 0x8C0C0316, // 0114 GETMET R3 R1 K22 - 0x6014000C, // 0115 GETGBL R5 G12 - 0x88180103, // 0116 GETMBR R6 R0 K3 - 0x7C140200, // 0117 CALL R5 1 - 0x58180017, // 0118 LDCONST R6 K23 - 0x7C0C0600, // 0119 CALL R3 3 - 0x600C0015, // 011A GETGBL R3 G21 - 0x7C0C0000, // 011B CALL R3 0 - 0x8C0C0725, // 011C GETMET R3 R3 K37 - 0x60140008, // 011D GETGBL R5 G8 - 0x88180103, // 011E GETMBR R6 R0 K3 - 0x7C140200, // 011F CALL R5 1 - 0x7C0C0400, // 0120 CALL R3 2 - 0x400C0203, // 0121 CONNECT R3 R1 R3 - 0x7002004B, // 0122 JMP #016F - 0x880C0101, // 0123 GETMBR R3 R0 K1 - 0x88100513, // 0124 GETMBR R4 R2 K19 - 0x1C0C0604, // 0125 EQ R3 R3 R4 - 0x780E0015, // 0126 JMPF R3 #013D - 0x600C000C, // 0127 GETGBL R3 G12 - 0x88100103, // 0128 GETMBR R4 R0 K3 - 0x7C0C0200, // 0129 CALL R3 1 - 0x5412FFFE, // 012A LDINT R4 65535 - 0x240C0604, // 012B GT R3 R3 R4 - 0x780E0000, // 012C JMPF R3 #012E - 0xB0064524, // 012D RAISE 1 K34 K36 - 0x8C0C0316, // 012E GETMET R3 R1 K22 - 0x6014000C, // 012F GETGBL R5 G12 - 0x88180103, // 0130 GETMBR R6 R0 K3 - 0x7C140200, // 0131 CALL R5 1 - 0x58180018, // 0132 LDCONST R6 K24 - 0x7C0C0600, // 0133 CALL R3 3 - 0x600C0015, // 0134 GETGBL R3 G21 - 0x7C0C0000, // 0135 CALL R3 0 - 0x8C0C0726, // 0136 GETMET R3 R3 K38 - 0x60140008, // 0137 GETGBL R5 G8 - 0x88180103, // 0138 GETMBR R6 R0 K3 - 0x7C140200, // 0139 CALL R5 1 - 0x7C0C0400, // 013A CALL R3 2 - 0x400C0203, // 013B CONNECT R3 R1 R3 - 0x70020031, // 013C JMP #016F - 0x880C0101, // 013D GETMBR R3 R0 K1 - 0x8810050D, // 013E GETMBR R4 R2 K13 - 0x1C0C0604, // 013F EQ R3 R3 R4 - 0x780E000F, // 0140 JMPF R3 #0151 - 0x600C000C, // 0141 GETGBL R3 G12 - 0x88100103, // 0142 GETMBR R4 R0 K3 - 0x7C0C0200, // 0143 CALL R3 1 - 0x541200FE, // 0144 LDINT R4 255 - 0x240C0604, // 0145 GT R3 R3 R4 - 0x780E0000, // 0146 JMPF R3 #0148 - 0xB0064527, // 0147 RAISE 1 K34 K39 - 0x8C0C0316, // 0148 GETMET R3 R1 K22 - 0x6014000C, // 0149 GETGBL R5 G12 - 0x88180103, // 014A GETMBR R6 R0 K3 - 0x7C140200, // 014B CALL R5 1 - 0x58180017, // 014C LDCONST R6 K23 - 0x7C0C0600, // 014D CALL R3 3 - 0x880C0103, // 014E GETMBR R3 R0 K3 - 0x400C0203, // 014F CONNECT R3 R1 R3 - 0x7002001D, // 0150 JMP #016F - 0x880C0101, // 0151 GETMBR R3 R0 K1 - 0x8810050F, // 0152 GETMBR R4 R2 K15 - 0x1C0C0604, // 0153 EQ R3 R3 R4 - 0x780E000F, // 0154 JMPF R3 #0165 - 0x600C000C, // 0155 GETGBL R3 G12 - 0x88100103, // 0156 GETMBR R4 R0 K3 - 0x7C0C0200, // 0157 CALL R3 1 - 0x5412FFFE, // 0158 LDINT R4 65535 - 0x240C0604, // 0159 GT R3 R3 R4 - 0x780E0000, // 015A JMPF R3 #015C - 0xB0064527, // 015B RAISE 1 K34 K39 - 0x8C0C0316, // 015C GETMET R3 R1 K22 - 0x6014000C, // 015D GETGBL R5 G12 - 0x88180103, // 015E GETMBR R6 R0 K3 - 0x7C140200, // 015F CALL R5 1 - 0x58180018, // 0160 LDCONST R6 K24 - 0x7C0C0600, // 0161 CALL R3 3 - 0x880C0103, // 0162 GETMBR R3 R0 K3 - 0x400C0203, // 0163 CONNECT R3 R1 R3 - 0x70020009, // 0164 JMP #016F - 0x880C0101, // 0165 GETMBR R3 R0 K1 - 0x88100528, // 0166 GETMBR R4 R2 K40 - 0x1C0C0604, // 0167 EQ R3 R3 R4 - 0x780E0000, // 0168 JMPF R3 #016A - 0x70020004, // 0169 JMP #016F - 0x600C0008, // 016A GETGBL R3 G8 - 0x88100101, // 016B GETMBR R4 R0 K1 - 0x7C0C0200, // 016C CALL R3 1 - 0x000E5203, // 016D ADD R3 K41 R3 - 0xB0064403, // 016E RAISE 1 K34 R3 - 0x80040200, // 016F RET 1 R1 + ( &(const binstruction[98]) { /* code */ + 0x60040004, // 0000 GETGBL R1 G4 + 0x88080100, // 0001 GETMBR R2 R0 K0 + 0x7C040200, // 0002 CALL R1 1 + 0x1C040301, // 0003 EQ R1 R1 K1 + 0x78060014, // 0004 JMPF R1 #001A + 0x88040102, // 0005 GETMBR R1 R0 K2 + 0x88080103, // 0006 GETMBR R2 R0 K3 + 0x88080504, // 0007 GETMBR R2 R2 K4 + 0x28040202, // 0008 GE R1 R1 R2 + 0x7806000A, // 0009 JMPF R1 #0015 + 0x88040102, // 000A GETMBR R1 R0 K2 + 0x88080103, // 000B GETMBR R2 R0 K3 + 0x88080505, // 000C GETMBR R2 R2 K5 + 0x18040202, // 000D LE R1 R1 R2 + 0x78060005, // 000E JMPF R1 #0015 + 0x60040008, // 000F GETGBL R1 G8 + 0x88080100, // 0010 GETMBR R2 R0 K0 + 0x7C040200, // 0011 CALL R1 1 + 0x00040306, // 0012 ADD R1 R1 K6 + 0x80040200, // 0013 RET 1 R1 + 0x70020003, // 0014 JMP #0019 + 0x60040008, // 0015 GETGBL R1 G8 + 0x88080100, // 0016 GETMBR R2 R0 K0 + 0x7C040200, // 0017 CALL R1 1 + 0x80040200, // 0018 RET 1 R1 + 0x70020046, // 0019 JMP #0061 + 0x60040004, // 001A GETGBL R1 G4 + 0x88080100, // 001B GETMBR R2 R0 K0 + 0x7C040200, // 001C CALL R1 1 + 0x1C040307, // 001D EQ R1 R1 K7 + 0x78060006, // 001E JMPF R1 #0026 + 0x88040100, // 001F GETMBR R1 R0 K0 + 0x78060001, // 0020 JMPF R1 #0023 + 0x58040008, // 0021 LDCONST R1 K8 + 0x70020000, // 0022 JMP #0024 + 0x58040009, // 0023 LDCONST R1 K9 + 0x80040200, // 0024 RET 1 R1 + 0x7002003A, // 0025 JMP #0061 + 0x88040100, // 0026 GETMBR R1 R0 K0 + 0x4C080000, // 0027 LDNIL R2 + 0x1C040202, // 0028 EQ R1 R1 R2 + 0x78060001, // 0029 JMPF R1 #002C + 0x80061400, // 002A RET 1 K10 + 0x70020034, // 002B JMP #0061 + 0x60040004, // 002C GETGBL R1 G4 + 0x88080100, // 002D GETMBR R2 R0 K0 + 0x7C040200, // 002E CALL R1 1 + 0x1C04030B, // 002F EQ R1 R1 K11 + 0x78060004, // 0030 JMPF R1 #0036 + 0x60040008, // 0031 GETGBL R1 G8 + 0x88080100, // 0032 GETMBR R2 R0 K0 + 0x7C040200, // 0033 CALL R1 1 + 0x80040200, // 0034 RET 1 R1 + 0x7002002A, // 0035 JMP #0061 + 0x60040004, // 0036 GETGBL R1 G4 + 0x88080100, // 0037 GETMBR R2 R0 K0 + 0x7C040200, // 0038 CALL R1 1 + 0x1C04030C, // 0039 EQ R1 R1 K12 + 0x78060002, // 003A JMPF R1 #003E + 0x88040100, // 003B GETMBR R1 R0 K0 + 0x80040200, // 003C RET 1 R1 + 0x70020022, // 003D JMP #0061 + 0x6004000F, // 003E GETGBL R1 G15 + 0x88080100, // 003F GETMBR R2 R0 K0 + 0xB80E1A00, // 0040 GETNGBL R3 K13 + 0x7C040400, // 0041 CALL R1 2 + 0x78060014, // 0042 JMPF R1 #0058 + 0x88040102, // 0043 GETMBR R1 R0 K2 + 0x88080103, // 0044 GETMBR R2 R0 K3 + 0x88080504, // 0045 GETMBR R2 R2 K4 + 0x28040202, // 0046 GE R1 R1 R2 + 0x7806000A, // 0047 JMPF R1 #0053 + 0x88040102, // 0048 GETMBR R1 R0 K2 + 0x88080103, // 0049 GETMBR R2 R0 K3 + 0x88080505, // 004A GETMBR R2 R2 K5 + 0x18040202, // 004B LE R1 R1 R2 + 0x78060005, // 004C JMPF R1 #0053 + 0x88040100, // 004D GETMBR R1 R0 K0 + 0x8C04030E, // 004E GETMET R1 R1 K14 + 0x7C040200, // 004F CALL R1 1 + 0x00040306, // 0050 ADD R1 R1 K6 + 0x80040200, // 0051 RET 1 R1 + 0x70020003, // 0052 JMP #0057 + 0x88040100, // 0053 GETMBR R1 R0 K0 + 0x8C04030E, // 0054 GETMET R1 R1 K14 + 0x7C040200, // 0055 CALL R1 1 + 0x80040200, // 0056 RET 1 R1 + 0x70020008, // 0057 JMP #0061 + 0x60040004, // 0058 GETGBL R1 G4 + 0x88080100, // 0059 GETMBR R2 R0 K0 + 0x7C040200, // 005A CALL R1 1 + 0x1C04030F, // 005B EQ R1 R1 K15 + 0x78060003, // 005C JMPF R1 #0061 + 0x8C04010E, // 005D GETMET R1 R0 K14 + 0x500C0200, // 005E LDBOOL R3 1 0 + 0x7C040400, // 005F CALL R1 2 + 0x80040200, // 0060 RET 1 R1 + 0x80000000, // 0061 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_fulltag +********************************************************************/ +extern const bclass be_class_Matter_TLV_item; +be_local_closure(class_Matter_TLV_item_set_fulltag, /* name */ + be_nested_proto( + 6, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_TLV_item, + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(tag_vendor), + /* K1 */ be_nested_str_weak(tag_profile), + /* K2 */ be_nested_str_weak(tag_number), + /* K3 */ be_nested_str_weak(tag_sub), + }), + be_str_weak(set_fulltag), + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0x60100009, // 0000 GETGBL R4 G9 + 0x5C140200, // 0001 MOVE R5 R1 + 0x7C100200, // 0002 CALL R4 1 + 0x90020004, // 0003 SETMBR R0 K0 R4 + 0x60100009, // 0004 GETGBL R4 G9 + 0x5C140400, // 0005 MOVE R5 R2 + 0x7C100200, // 0006 CALL R4 1 + 0x90020204, // 0007 SETMBR R0 K1 R4 + 0x60100009, // 0008 GETGBL R4 G9 + 0x5C140600, // 0009 MOVE R5 R3 + 0x7C100200, // 000A CALL R4 1 + 0x90020404, // 000B SETMBR R0 K2 R4 + 0x4C100000, // 000C LDNIL R4 + 0x90020604, // 000D SETMBR R0 K3 R4 + 0x80000000, // 000E RET 0 }) ) ); @@ -1454,28 +883,152 @@ be_local_closure(class_Matter_TLV_item_tlv2raw, /* name */ /******************************************************************** -** Solidified function: set_anonymoustag +** Solidified function: parse ********************************************************************/ extern const bclass be_class_Matter_TLV_item; -be_local_closure(class_Matter_TLV_item_set_anonymoustag, /* name */ +be_local_closure(class_Matter_TLV_item_parse, /* name */ be_nested_proto( - 3, /* nstack */ - 1, /* argc */ + 10, /* nstack */ + 3, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_TLV_item, 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_weak(set_fulltag), + ( &(const bvalue[25]) { /* constants */ + /* K0 */ be_nested_str_weak(typ), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(_len), + /* K3 */ be_nested_str_weak(val), + /* K4 */ be_nested_str_weak(int64), + /* K5 */ be_nested_str_weak(frombytes), + /* K6 */ be_nested_str_weak(BFALSE), + /* K7 */ be_nested_str_weak(BTRUE), + /* K8 */ be_nested_str_weak(U8), + /* K9 */ be_nested_str_weak(I8), + /* K10 */ be_nested_str_weak(geti), + /* K11 */ be_nested_str_weak(get), + /* K12 */ be_nested_str_weak(FLOAT), + /* K13 */ be_nested_str_weak(getfloat), + /* K14 */ be_const_int(1), + /* K15 */ be_nested_str_weak(UTF8), + /* K16 */ be_nested_str_weak(asstring), + /* K17 */ be_nested_str_weak(NULL), + /* K18 */ be_nested_str_weak(EOC), + /* K19 */ be_nested_str_weak(tasmota), + /* K20 */ be_nested_str_weak(log), + /* K21 */ be_nested_str_weak(MTR_X3A_X20unexpected_X20eoc), + /* K22 */ be_const_int(3), + /* K23 */ be_nested_str_weak(MTR_X3A_X20unexpected_X20type_X3A_X20), + /* K24 */ be_nested_str_weak(next_idx), }), - be_str_weak(set_anonymoustag), + be_str_weak(parse), &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[103]) { /* code */ + 0x880C0100, // 0000 GETMBR R3 R0 K0 + 0x88100101, // 0001 GETMBR R4 R0 K1 + 0x88140902, // 0002 GETMBR R5 R4 K2 + 0x94140A03, // 0003 GETIDX R5 R5 R3 + 0x541A0007, // 0004 LDINT R6 8 + 0x1C180A06, // 0005 EQ R6 R5 R6 + 0x781A0008, // 0006 JMPF R6 #0010 + 0xB81A0800, // 0007 GETNGBL R6 K4 + 0x8C180D05, // 0008 GETMET R6 R6 K5 + 0x5C200200, // 0009 MOVE R8 R1 + 0x5C240400, // 000A MOVE R9 R2 + 0x7C180600, // 000B CALL R6 3 + 0x90020606, // 000C SETMBR R0 K3 R6 + 0x541A0007, // 000D LDINT R6 8 + 0x00080406, // 000E ADD R2 R2 R6 + 0x70020054, // 000F JMP #0065 + 0x88180906, // 0010 GETMBR R6 R4 K6 + 0x1C180606, // 0011 EQ R6 R3 R6 + 0x741A0002, // 0012 JMPT R6 #0016 + 0x88180907, // 0013 GETMBR R6 R4 K7 + 0x1C180606, // 0014 EQ R6 R3 R6 + 0x781A0003, // 0015 JMPF R6 #001A + 0x88180907, // 0016 GETMBR R6 R4 K7 + 0x1C180606, // 0017 EQ R6 R3 R6 + 0x90020606, // 0018 SETMBR R0 K3 R6 + 0x7002004A, // 0019 JMP #0065 + 0x88180908, // 001A GETMBR R6 R4 K8 + 0x14180606, // 001B LT R6 R3 R6 + 0x781A000E, // 001C JMPF R6 #002C + 0x88180909, // 001D GETMBR R6 R4 K9 + 0x18180606, // 001E LE R6 R3 R6 + 0x781A0004, // 001F JMPF R6 #0025 + 0x8C18030A, // 0020 GETMET R6 R1 K10 + 0x5C200400, // 0021 MOVE R8 R2 + 0x5C240A00, // 0022 MOVE R9 R5 + 0x7C180600, // 0023 CALL R6 3 + 0x70020003, // 0024 JMP #0029 + 0x8C18030B, // 0025 GETMET R6 R1 K11 + 0x5C200400, // 0026 MOVE R8 R2 + 0x5C240A00, // 0027 MOVE R9 R5 + 0x7C180600, // 0028 CALL R6 3 + 0x90020606, // 0029 SETMBR R0 K3 R6 + 0x00080405, // 002A ADD R2 R2 R5 + 0x70020038, // 002B JMP #0065 + 0x8818090C, // 002C GETMBR R6 R4 K12 + 0x1C180606, // 002D EQ R6 R3 R6 + 0x781A0006, // 002E JMPF R6 #0036 + 0x8C18030D, // 002F GETMET R6 R1 K13 + 0x5C200400, // 0030 MOVE R8 R2 + 0x7C180400, // 0031 CALL R6 2 + 0x90020606, // 0032 SETMBR R0 K3 R6 + 0x541A0003, // 0033 LDINT R6 4 + 0x00080406, // 0034 ADD R2 R2 R6 + 0x7002002E, // 0035 JMP #0065 + 0x5419FFF7, // 0036 LDINT R6 -8 + 0x28180A06, // 0037 GE R6 R5 R6 + 0x781A0016, // 0038 JMPF R6 #0050 + 0x5419FFFE, // 0039 LDINT R6 -1 + 0x18180A06, // 003A LE R6 R5 R6 + 0x781A0013, // 003B JMPF R6 #0050 + 0x8C18030B, // 003C GETMET R6 R1 K11 + 0x5C200400, // 003D MOVE R8 R2 + 0x44240A00, // 003E NEG R9 R5 + 0x7C180600, // 003F CALL R6 3 + 0x441C0A00, // 0040 NEG R7 R5 + 0x00080407, // 0041 ADD R2 R2 R7 + 0x001C0406, // 0042 ADD R7 R2 R6 + 0x041C0F0E, // 0043 SUB R7 R7 K14 + 0x401C0407, // 0044 CONNECT R7 R2 R7 + 0x941C0207, // 0045 GETIDX R7 R1 R7 + 0x90020607, // 0046 SETMBR R0 K3 R7 + 0x00080406, // 0047 ADD R2 R2 R6 + 0x881C090F, // 0048 GETMBR R7 R4 K15 + 0x181C0607, // 0049 LE R7 R3 R7 + 0x781E0003, // 004A JMPF R7 #004F + 0x881C0103, // 004B GETMBR R7 R0 K3 + 0x8C1C0F10, // 004C GETMET R7 R7 K16 + 0x7C1C0200, // 004D CALL R7 1 + 0x90020607, // 004E SETMBR R0 K3 R7 + 0x70020014, // 004F JMP #0065 + 0x88180911, // 0050 GETMBR R6 R4 K17 + 0x1C180606, // 0051 EQ R6 R3 R6 + 0x781A0000, // 0052 JMPF R6 #0054 + 0x70020010, // 0053 JMP #0065 + 0x88180912, // 0054 GETMBR R6 R4 K18 + 0x1C180606, // 0055 EQ R6 R3 R6 + 0x781A0005, // 0056 JMPF R6 #005D + 0xB81A2600, // 0057 GETNGBL R6 K19 + 0x8C180D14, // 0058 GETMET R6 R6 K20 + 0x58200015, // 0059 LDCONST R8 K21 + 0x58240016, // 005A LDCONST R9 K22 + 0x7C180600, // 005B CALL R6 3 + 0x70020007, // 005C JMP #0065 + 0xB81A2600, // 005D GETNGBL R6 K19 + 0x8C180D14, // 005E GETMET R6 R6 K20 + 0x60200008, // 005F GETGBL R8 G8 + 0x5C240600, // 0060 MOVE R9 R3 + 0x7C200200, // 0061 CALL R8 1 + 0x00222E08, // 0062 ADD R8 K23 R8 + 0x58240016, // 0063 LDCONST R9 K22 + 0x7C180600, // 0064 CALL R6 3 + 0x90023002, // 0065 SETMBR R0 K24 R2 + 0x80040400, // 0066 RET 1 R2 }) ) ); @@ -1483,102 +1036,31 @@ be_local_closure(class_Matter_TLV_item_set_anonymoustag, /* name */ /******************************************************************** -** Solidified function: _cmp_gt +** Solidified function: set_commonprofile ********************************************************************/ extern const bclass be_class_Matter_TLV_item; -be_local_closure(class_Matter_TLV_item__cmp_gt, /* name */ +be_local_closure(class_Matter_TLV_item_set_commonprofile, /* name */ be_nested_proto( - 4, /* nstack */ - 2, /* argc */ + 6, /* nstack */ + 1, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ &be_class_Matter_TLV_item, 1, /* has constants */ - ( &(const bvalue[ 6]) { /* constants */ - /* K0 */ be_nested_str_weak(tag_vendor), - /* K1 */ be_const_int(1), - /* K2 */ be_nested_str_weak(tag_profile), - /* K3 */ be_const_int(0), - /* K4 */ be_nested_str_weak(tag_number), - /* K5 */ be_nested_str_weak(tag_sub), + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(set_fulltag), }), - be_str_weak(_cmp_gt), + be_str_weak(set_commonprofile), &be_const_str_solidified, - ( &(const binstruction[72]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 + ( &(const binstruction[ 6]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 0x4C0C0000, // 0001 LDNIL R3 - 0x20080403, // 0002 NE R2 R2 R3 - 0x780A0012, // 0003 JMPF R2 #0017 - 0x88080300, // 0004 GETMBR R2 R1 K0 - 0x4C0C0000, // 0005 LDNIL R3 - 0x1C080403, // 0006 EQ R2 R2 R3 - 0x780A0000, // 0007 JMPF R2 #0009 - 0x80060200, // 0008 RET 1 K1 - 0x88080100, // 0009 GETMBR R2 R0 K0 - 0x880C0300, // 000A GETMBR R3 R1 K0 - 0x24080403, // 000B GT R2 R2 R3 - 0x780A0000, // 000C JMPF R2 #000E - 0x80060200, // 000D RET 1 K1 - 0x88080100, // 000E GETMBR R2 R0 K0 - 0x880C0300, // 000F GETMBR R3 R1 K0 - 0x1C080403, // 0010 EQ R2 R2 R3 - 0x780A0004, // 0011 JMPF R2 #0017 - 0x88080102, // 0012 GETMBR R2 R0 K2 - 0x880C0302, // 0013 GETMBR R3 R1 K2 - 0x24080403, // 0014 GT R2 R2 R3 - 0x780A0000, // 0015 JMPF R2 #0017 - 0x80060200, // 0016 RET 1 K1 - 0x88080102, // 0017 GETMBR R2 R0 K2 - 0x540DFFFE, // 0018 LDINT R3 -1 - 0x1C080403, // 0019 EQ R2 R2 R3 - 0x780A0005, // 001A JMPF R2 #0021 - 0x88080302, // 001B GETMBR R2 R1 K2 - 0x4C0C0000, // 001C LDNIL R3 - 0x1C080403, // 001D EQ R2 R2 R3 - 0x780A0000, // 001E JMPF R2 #0020 - 0x80060200, // 001F RET 1 K1 - 0x70020008, // 0020 JMP #002A - 0x88080102, // 0021 GETMBR R2 R0 K2 - 0x4C0C0000, // 0022 LDNIL R3 - 0x1C080403, // 0023 EQ R2 R2 R3 - 0x780A0004, // 0024 JMPF R2 #002A - 0x88080302, // 0025 GETMBR R2 R1 K2 - 0x540DFFFE, // 0026 LDINT R3 -1 - 0x1C080403, // 0027 EQ R2 R2 R3 - 0x780A0000, // 0028 JMPF R2 #002A - 0x80060600, // 0029 RET 1 K3 - 0x88080104, // 002A GETMBR R2 R0 K4 - 0x4C0C0000, // 002B LDNIL R3 - 0x20080403, // 002C NE R2 R2 R3 - 0x780A000A, // 002D JMPF R2 #0039 - 0x88080304, // 002E GETMBR R2 R1 K4 - 0x4C0C0000, // 002F LDNIL R3 - 0x1C080403, // 0030 EQ R2 R2 R3 - 0x780A0000, // 0031 JMPF R2 #0033 - 0x80060200, // 0032 RET 1 K1 - 0x88080104, // 0033 GETMBR R2 R0 K4 - 0x880C0304, // 0034 GETMBR R3 R1 K4 - 0x24080403, // 0035 GT R2 R2 R3 - 0x780A0000, // 0036 JMPF R2 #0038 - 0x80060200, // 0037 RET 1 K1 - 0x80060600, // 0038 RET 1 K3 - 0x88080105, // 0039 GETMBR R2 R0 K5 - 0x4C0C0000, // 003A LDNIL R3 - 0x20080403, // 003B NE R2 R2 R3 - 0x780A0009, // 003C JMPF R2 #0047 - 0x88080305, // 003D GETMBR R2 R1 K5 - 0x4C0C0000, // 003E LDNIL R3 - 0x1C080403, // 003F EQ R2 R2 R3 - 0x780A0000, // 0040 JMPF R2 #0042 - 0x80060200, // 0041 RET 1 K1 - 0x88080105, // 0042 GETMBR R2 R0 K5 - 0x880C0305, // 0043 GETMBR R3 R1 K5 - 0x24080403, // 0044 GT R2 R2 R3 - 0x780A0000, // 0045 JMPF R2 #0047 - 0x80060200, // 0046 RET 1 K1 - 0x80060600, // 0047 RET 1 K3 + 0x5411FFFE, // 0002 LDINT R4 -1 + 0x4C140000, // 0003 LDNIL R5 + 0x7C040800, // 0004 CALL R1 4 + 0x80000000, // 0005 RET 0 }) ) ); @@ -1753,12 +1235,75 @@ be_local_closure(class_Matter_TLV_item__encode_tag, /* name */ /******************************************************************** -** Solidified function: tostring +** Solidified function: sort ********************************************************************/ extern const bclass be_class_Matter_TLV_item; -be_local_closure(class_Matter_TLV_item_tostring, /* name */ +be_local_closure(class_Matter_TLV_item_sort, /* name */ be_nested_proto( - 7, /* nstack */ + 9, /* nstack */ + 1, /* argc */ + 4, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_TLV_item, + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_const_class(be_class_Matter_TLV_item), + /* K1 */ be_const_int(1), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(_cmp_gt), + /* K4 */ be_nested_str_weak(stop_iteration), + }), + be_str_weak(sort), + &be_const_str_solidified, + ( &(const binstruction[33]) { /* 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 + 0xA8020013, // 0008 EXBLK 0 #001D + 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 + 0x781A000B, // 000E JMPF R6 #001B + 0x04180B01, // 000F SUB R6 R5 K1 + 0x94180006, // 0010 GETIDX R6 R0 R6 + 0x8C180D03, // 0011 GETMET R6 R6 K3 + 0x5C200800, // 0012 MOVE R8 R4 + 0x7C180400, // 0013 CALL R6 2 + 0x24180D02, // 0014 GT R6 R6 K2 + 0x781A0004, // 0015 JMPF R6 #001B + 0x04180B01, // 0016 SUB R6 R5 K1 + 0x94180006, // 0017 GETIDX R6 R0 R6 + 0x98000A06, // 0018 SETIDX R0 R5 R6 + 0x04140B01, // 0019 SUB R5 R5 K1 + 0x7001FFF1, // 001A JMP #000D + 0x98000A04, // 001B SETIDX R0 R5 R4 + 0x7001FFEB, // 001C JMP #0009 + 0x58080004, // 001D LDCONST R2 K4 + 0xAC080200, // 001E CATCH R2 1 0 + 0xB0080000, // 001F RAISE 2 R0 R0 + 0x80040000, // 0020 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +extern const bclass be_class_Matter_TLV_item; +be_local_closure(class_Matter_TLV_item_init, /* name */ + be_nested_proto( + 2, /* nstack */ 2, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -1766,212 +1311,552 @@ be_local_closure(class_Matter_TLV_item_tostring, /* name */ 0, /* has sup protos */ &be_class_Matter_TLV_item, 1, /* has constants */ - ( &(const bvalue[34]) { /* constants */ - /* K0 */ be_nested_str_weak(), - /* K1 */ be_nested_str_weak(tag_profile), - /* K2 */ be_nested_str_weak(Matter_X3A_X3A), - /* K3 */ be_nested_str_weak(tag_number), - /* K4 */ be_nested_str_weak(0x_X2508X_X20), - /* K5 */ be_nested_str_weak(tag_vendor), - /* K6 */ be_nested_str_weak(0x_X2504X_X3A_X3A), - /* K7 */ be_nested_str_weak(0x_X2504X_X3A), - /* K8 */ be_nested_str_weak(tag_sub), - /* K9 */ be_nested_str_weak(_X25i_X20), - /* K10 */ be_const_int(0), - /* K11 */ be_nested_str_weak(_X3D_X20), - /* K12 */ be_nested_str_weak(val), - /* K13 */ be_nested_str_weak(int), - /* K14 */ be_nested_str_weak(_X25i), - /* K15 */ be_nested_str_weak(typ), - /* K16 */ be_nested_str_weak(TLV), - /* K17 */ be_nested_str_weak(U1), - /* K18 */ be_nested_str_weak(U8), - /* K19 */ be_nested_str_weak(U), - /* K20 */ be_nested_str_weak(bool), - /* K21 */ be_nested_str_weak(true), - /* K22 */ be_nested_str_weak(false), - /* K23 */ be_nested_str_weak(null), - /* K24 */ be_nested_str_weak(real), - /* K25 */ be_nested_str_weak(_X25g), - /* K26 */ be_nested_str_weak(string), - /* K27 */ be_nested_str_weak(_X22_X25s_X22), - /* K28 */ be_nested_str_weak(int64), - /* K29 */ be_nested_str_weak(tostring), - /* K30 */ be_nested_str_weak(instance), - /* K31 */ be_nested_str_weak(_X25s), - /* K32 */ be_nested_str_weak(tohex), - /* K33 */ be_nested_str_weak(_X20), + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(parent), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x80000000, // 0001 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: _cmp_gt +********************************************************************/ +extern const bclass be_class_Matter_TLV_item; +be_local_closure(class_Matter_TLV_item__cmp_gt, /* name */ + be_nested_proto( + 4, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_TLV_item, + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str_weak(tag_vendor), + /* K1 */ be_const_int(1), + /* K2 */ be_nested_str_weak(tag_profile), + /* K3 */ be_const_int(0), + /* K4 */ be_nested_str_weak(tag_number), + /* K5 */ be_nested_str_weak(tag_sub), + }), + be_str_weak(_cmp_gt), + &be_const_str_solidified, + ( &(const binstruction[72]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x4C0C0000, // 0001 LDNIL R3 + 0x20080403, // 0002 NE R2 R2 R3 + 0x780A0012, // 0003 JMPF R2 #0017 + 0x88080300, // 0004 GETMBR R2 R1 K0 + 0x4C0C0000, // 0005 LDNIL R3 + 0x1C080403, // 0006 EQ R2 R2 R3 + 0x780A0000, // 0007 JMPF R2 #0009 + 0x80060200, // 0008 RET 1 K1 + 0x88080100, // 0009 GETMBR R2 R0 K0 + 0x880C0300, // 000A GETMBR R3 R1 K0 + 0x24080403, // 000B GT R2 R2 R3 + 0x780A0000, // 000C JMPF R2 #000E + 0x80060200, // 000D RET 1 K1 + 0x88080100, // 000E GETMBR R2 R0 K0 + 0x880C0300, // 000F GETMBR R3 R1 K0 + 0x1C080403, // 0010 EQ R2 R2 R3 + 0x780A0004, // 0011 JMPF R2 #0017 + 0x88080102, // 0012 GETMBR R2 R0 K2 + 0x880C0302, // 0013 GETMBR R3 R1 K2 + 0x24080403, // 0014 GT R2 R2 R3 + 0x780A0000, // 0015 JMPF R2 #0017 + 0x80060200, // 0016 RET 1 K1 + 0x88080102, // 0017 GETMBR R2 R0 K2 + 0x540DFFFE, // 0018 LDINT R3 -1 + 0x1C080403, // 0019 EQ R2 R2 R3 + 0x780A0005, // 001A JMPF R2 #0021 + 0x88080302, // 001B GETMBR R2 R1 K2 + 0x4C0C0000, // 001C LDNIL R3 + 0x1C080403, // 001D EQ R2 R2 R3 + 0x780A0000, // 001E JMPF R2 #0020 + 0x80060200, // 001F RET 1 K1 + 0x70020008, // 0020 JMP #002A + 0x88080102, // 0021 GETMBR R2 R0 K2 + 0x4C0C0000, // 0022 LDNIL R3 + 0x1C080403, // 0023 EQ R2 R2 R3 + 0x780A0004, // 0024 JMPF R2 #002A + 0x88080302, // 0025 GETMBR R2 R1 K2 + 0x540DFFFE, // 0026 LDINT R3 -1 + 0x1C080403, // 0027 EQ R2 R2 R3 + 0x780A0000, // 0028 JMPF R2 #002A + 0x80060600, // 0029 RET 1 K3 + 0x88080104, // 002A GETMBR R2 R0 K4 + 0x4C0C0000, // 002B LDNIL R3 + 0x20080403, // 002C NE R2 R2 R3 + 0x780A000A, // 002D JMPF R2 #0039 + 0x88080304, // 002E GETMBR R2 R1 K4 + 0x4C0C0000, // 002F LDNIL R3 + 0x1C080403, // 0030 EQ R2 R2 R3 + 0x780A0000, // 0031 JMPF R2 #0033 + 0x80060200, // 0032 RET 1 K1 + 0x88080104, // 0033 GETMBR R2 R0 K4 + 0x880C0304, // 0034 GETMBR R3 R1 K4 + 0x24080403, // 0035 GT R2 R2 R3 + 0x780A0000, // 0036 JMPF R2 #0038 + 0x80060200, // 0037 RET 1 K1 + 0x80060600, // 0038 RET 1 K3 + 0x88080105, // 0039 GETMBR R2 R0 K5 + 0x4C0C0000, // 003A LDNIL R3 + 0x20080403, // 003B NE R2 R2 R3 + 0x780A0009, // 003C JMPF R2 #0047 + 0x88080305, // 003D GETMBR R2 R1 K5 + 0x4C0C0000, // 003E LDNIL R3 + 0x1C080403, // 003F EQ R2 R2 R3 + 0x780A0000, // 0040 JMPF R2 #0042 + 0x80060200, // 0041 RET 1 K1 + 0x88080105, // 0042 GETMBR R2 R0 K5 + 0x880C0305, // 0043 GETMBR R3 R1 K5 + 0x24080403, // 0044 GT R2 R2 R3 + 0x780A0000, // 0045 JMPF R2 #0047 + 0x80060200, // 0046 RET 1 K1 + 0x80060600, // 0047 RET 1 K3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: tlv2raw +********************************************************************/ +extern const bclass be_class_Matter_TLV_item; +be_local_closure(class_Matter_TLV_item_tlv2raw, /* name */ + be_nested_proto( + 9, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_TLV_item, + 1, /* has constants */ + ( &(const bvalue[42]) { /* constants */ + /* K0 */ be_nested_str_weak(TLV), + /* K1 */ be_nested_str_weak(typ), + /* K2 */ be_nested_str_weak(RAW), + /* K3 */ be_nested_str_weak(val), + /* K4 */ be_nested_str_weak(BFALSE), + /* K5 */ be_nested_str_weak(BTRUE), + /* K6 */ be_nested_str_weak(I2), + /* K7 */ be_nested_str_weak(I4), + /* K8 */ be_nested_str_weak(I1), + /* K9 */ be_nested_str_weak(U2), + /* K10 */ be_nested_str_weak(U4), + /* K11 */ be_const_int(0), + /* K12 */ be_nested_str_weak(U1), + /* K13 */ be_nested_str_weak(B1), + /* K14 */ be_nested_str_weak(B8), + /* K15 */ be_nested_str_weak(B2), + /* K16 */ be_nested_str_weak(B4), + /* K17 */ be_nested_str_weak(UTF1), + /* K18 */ be_nested_str_weak(UTF8), + /* K19 */ be_nested_str_weak(UTF2), + /* K20 */ be_nested_str_weak(UTF4), + /* K21 */ be_nested_str_weak(_encode_tag), + /* K22 */ be_nested_str_weak(add), + /* K23 */ be_const_int(1), + /* K24 */ be_const_int(2), + /* K25 */ be_nested_str_weak(I8), + /* K26 */ be_nested_str_weak(U8), + /* K27 */ be_nested_str_weak(copy), + /* K28 */ be_nested_str_weak(resize), + /* K29 */ be_nested_str_weak(int64), + /* K30 */ be_nested_str_weak(tobytes), + /* K31 */ be_nested_str_weak(FLOAT), + /* K32 */ be_nested_str_weak(setfloat), + /* K33 */ be_nested_str_weak(DOUBLE), + /* K34 */ be_nested_str_weak(value_error), + /* K35 */ be_nested_str_weak(Unsupported_X20type_X20TLV_X2EDOUBLE), + /* K36 */ be_nested_str_weak(string_X20too_X20big), + /* K37 */ be_nested_str_weak(fromstring), + /* K38 */ be_nested_str_weak(frostring), + /* K39 */ be_nested_str_weak(bytes_X20too_X20big), + /* K40 */ be_nested_str_weak(NULL), + /* K41 */ be_nested_str_weak(unsupported_X20type_X20), }), - be_str_weak(tostring), + be_str_weak(tlv2raw), &be_const_str_solidified, - ( &(const binstruction[167]) { /* code */ - 0x58080000, // 0000 LDCONST R2 K0 - 0xA802009C, // 0001 EXBLK 0 #009F - 0x500C0200, // 0002 LDBOOL R3 1 0 - 0x200C0203, // 0003 NE R3 R1 R3 - 0x780E0038, // 0004 JMPF R3 #003E - 0x880C0101, // 0005 GETMBR R3 R0 K1 - 0x5411FFFE, // 0006 LDINT R4 -1 - 0x1C0C0604, // 0007 EQ R3 R3 R4 - 0x780E000A, // 0008 JMPF R3 #0014 - 0x00080502, // 0009 ADD R2 R2 K2 - 0x880C0103, // 000A GETMBR R3 R0 K3 - 0x4C100000, // 000B LDNIL R4 - 0x200C0604, // 000C NE R3 R3 R4 - 0x780E0004, // 000D JMPF R3 #0013 - 0x600C0018, // 000E GETGBL R3 G24 - 0x58100004, // 000F LDCONST R4 K4 - 0x88140103, // 0010 GETMBR R5 R0 K3 - 0x7C0C0400, // 0011 CALL R3 2 - 0x00080403, // 0012 ADD R2 R2 R3 - 0x70020023, // 0013 JMP #0038 - 0x880C0105, // 0014 GETMBR R3 R0 K5 - 0x4C100000, // 0015 LDNIL R4 - 0x200C0604, // 0016 NE R3 R3 R4 - 0x780E0004, // 0017 JMPF R3 #001D - 0x600C0018, // 0018 GETGBL R3 G24 - 0x58100006, // 0019 LDCONST R4 K6 - 0x88140105, // 001A GETMBR R5 R0 K5 - 0x7C0C0400, // 001B CALL R3 2 - 0x00080403, // 001C ADD R2 R2 R3 - 0x880C0101, // 001D GETMBR R3 R0 K1 - 0x4C100000, // 001E LDNIL R4 - 0x200C0604, // 001F NE R3 R3 R4 - 0x780E0004, // 0020 JMPF R3 #0026 - 0x600C0018, // 0021 GETGBL R3 G24 - 0x58100007, // 0022 LDCONST R4 K7 - 0x88140101, // 0023 GETMBR R5 R0 K1 - 0x7C0C0400, // 0024 CALL R3 2 - 0x00080403, // 0025 ADD R2 R2 R3 - 0x880C0103, // 0026 GETMBR R3 R0 K3 - 0x4C100000, // 0027 LDNIL R4 - 0x200C0604, // 0028 NE R3 R3 R4 - 0x780E0004, // 0029 JMPF R3 #002F - 0x600C0018, // 002A GETGBL R3 G24 - 0x58100004, // 002B LDCONST R4 K4 - 0x88140103, // 002C GETMBR R5 R0 K3 - 0x7C0C0400, // 002D CALL R3 2 - 0x00080403, // 002E ADD R2 R2 R3 - 0x880C0108, // 002F GETMBR R3 R0 K8 - 0x4C100000, // 0030 LDNIL R4 - 0x200C0604, // 0031 NE R3 R3 R4 - 0x780E0004, // 0032 JMPF R3 #0038 - 0x600C0018, // 0033 GETGBL R3 G24 - 0x58100009, // 0034 LDCONST R4 K9 - 0x88140108, // 0035 GETMBR R5 R0 K8 - 0x7C0C0400, // 0036 CALL R3 2 - 0x00080403, // 0037 ADD R2 R2 R3 - 0x600C000C, // 0038 GETGBL R3 G12 - 0x5C100400, // 0039 MOVE R4 R2 - 0x7C0C0200, // 003A CALL R3 1 - 0x240C070A, // 003B GT R3 R3 K10 - 0x780E0000, // 003C JMPF R3 #003E - 0x0008050B, // 003D ADD R2 R2 K11 - 0x600C0004, // 003E GETGBL R3 G4 - 0x8810010C, // 003F GETMBR R4 R0 K12 - 0x7C0C0200, // 0040 CALL R3 1 - 0x1C0C070D, // 0041 EQ R3 R3 K13 - 0x780E0010, // 0042 JMPF R3 #0054 - 0x600C0018, // 0043 GETGBL R3 G24 - 0x5810000E, // 0044 LDCONST R4 K14 - 0x8814010C, // 0045 GETMBR R5 R0 K12 - 0x7C0C0400, // 0046 CALL R3 2 - 0x00080403, // 0047 ADD R2 R2 R3 - 0x880C010F, // 0048 GETMBR R3 R0 K15 - 0x88100110, // 0049 GETMBR R4 R0 K16 - 0x88100911, // 004A GETMBR R4 R4 K17 - 0x280C0604, // 004B GE R3 R3 R4 - 0x780E0005, // 004C JMPF R3 #0053 - 0x880C010F, // 004D GETMBR R3 R0 K15 - 0x88100110, // 004E GETMBR R4 R0 K16 - 0x88100912, // 004F GETMBR R4 R4 K18 - 0x180C0604, // 0050 LE R3 R3 R4 - 0x780E0000, // 0051 JMPF R3 #0053 - 0x00080513, // 0052 ADD R2 R2 K19 - 0x70020048, // 0053 JMP #009D - 0x600C0004, // 0054 GETGBL R3 G4 - 0x8810010C, // 0055 GETMBR R4 R0 K12 - 0x7C0C0200, // 0056 CALL R3 1 - 0x1C0C0714, // 0057 EQ R3 R3 K20 - 0x780E0006, // 0058 JMPF R3 #0060 - 0x880C010C, // 0059 GETMBR R3 R0 K12 - 0x780E0001, // 005A JMPF R3 #005D - 0x580C0015, // 005B LDCONST R3 K21 - 0x70020000, // 005C JMP #005E - 0x580C0016, // 005D LDCONST R3 K22 - 0x00080403, // 005E ADD R2 R2 R3 - 0x7002003C, // 005F JMP #009D - 0x880C010C, // 0060 GETMBR R3 R0 K12 - 0x4C100000, // 0061 LDNIL R4 - 0x1C0C0604, // 0062 EQ R3 R3 R4 - 0x780E0001, // 0063 JMPF R3 #0066 - 0x00080517, // 0064 ADD R2 R2 K23 - 0x70020036, // 0065 JMP #009D - 0x600C0004, // 0066 GETGBL R3 G4 - 0x8810010C, // 0067 GETMBR R4 R0 K12 - 0x7C0C0200, // 0068 CALL R3 1 - 0x1C0C0718, // 0069 EQ R3 R3 K24 - 0x780E0005, // 006A JMPF R3 #0071 - 0x600C0018, // 006B GETGBL R3 G24 - 0x58100019, // 006C LDCONST R4 K25 - 0x8814010C, // 006D GETMBR R5 R0 K12 - 0x7C0C0400, // 006E CALL R3 2 - 0x00080403, // 006F ADD R2 R2 R3 - 0x7002002B, // 0070 JMP #009D - 0x600C0004, // 0071 GETGBL R3 G4 - 0x8810010C, // 0072 GETMBR R4 R0 K12 - 0x7C0C0200, // 0073 CALL R3 1 - 0x1C0C071A, // 0074 EQ R3 R3 K26 - 0x780E0005, // 0075 JMPF R3 #007C - 0x600C0018, // 0076 GETGBL R3 G24 - 0x5810001B, // 0077 LDCONST R4 K27 - 0x8814010C, // 0078 GETMBR R5 R0 K12 - 0x7C0C0400, // 0079 CALL R3 2 - 0x00080403, // 007A ADD R2 R2 R3 - 0x70020020, // 007B JMP #009D - 0x600C000F, // 007C GETGBL R3 G15 - 0x8810010C, // 007D GETMBR R4 R0 K12 - 0xB8163800, // 007E GETNGBL R5 K28 - 0x7C0C0400, // 007F CALL R3 2 - 0x780E000F, // 0080 JMPF R3 #0091 - 0x880C010C, // 0081 GETMBR R3 R0 K12 - 0x8C0C071D, // 0082 GETMET R3 R3 K29 - 0x7C0C0200, // 0083 CALL R3 1 - 0x00080403, // 0084 ADD R2 R2 R3 - 0x880C010F, // 0085 GETMBR R3 R0 K15 - 0x88100110, // 0086 GETMBR R4 R0 K16 - 0x88100911, // 0087 GETMBR R4 R4 K17 - 0x280C0604, // 0088 GE R3 R3 R4 - 0x780E0005, // 0089 JMPF R3 #0090 - 0x880C010F, // 008A GETMBR R3 R0 K15 - 0x88100110, // 008B GETMBR R4 R0 K16 - 0x88100912, // 008C GETMBR R4 R4 K18 - 0x180C0604, // 008D LE R3 R3 R4 - 0x780E0000, // 008E JMPF R3 #0090 - 0x00080513, // 008F ADD R2 R2 K19 - 0x7002000B, // 0090 JMP #009D - 0x600C0004, // 0091 GETGBL R3 G4 - 0x8810010C, // 0092 GETMBR R4 R0 K12 - 0x7C0C0200, // 0093 CALL R3 1 - 0x1C0C071E, // 0094 EQ R3 R3 K30 - 0x780E0006, // 0095 JMPF R3 #009D - 0x600C0018, // 0096 GETGBL R3 G24 - 0x5810001F, // 0097 LDCONST R4 K31 - 0x8814010C, // 0098 GETMBR R5 R0 K12 - 0x8C140B20, // 0099 GETMET R5 R5 K32 - 0x7C140200, // 009A CALL R5 1 - 0x7C0C0400, // 009B CALL R3 2 - 0x00080403, // 009C ADD R2 R2 R3 - 0xA8040001, // 009D EXBLK 1 1 - 0x70020006, // 009E JMP #00A6 - 0xAC0C0002, // 009F CATCH R3 0 2 - 0x70020003, // 00A0 JMP #00A5 - 0x00140721, // 00A1 ADD R5 R3 K33 - 0x00140A04, // 00A2 ADD R5 R5 R4 - 0x80040A00, // 00A3 RET 1 R5 - 0x70020000, // 00A4 JMP #00A6 - 0xB0080000, // 00A5 RAISE 2 R0 R0 - 0x80040400, // 00A6 RET 1 R2 + ( &(const binstruction[368]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x4C0C0000, // 0001 LDNIL R3 + 0x1C0C0203, // 0002 EQ R3 R1 R3 + 0x780E0002, // 0003 JMPF R3 #0007 + 0x600C0015, // 0004 GETGBL R3 G21 + 0x7C0C0000, // 0005 CALL R3 0 + 0x5C040600, // 0006 MOVE R1 R3 + 0x880C0101, // 0007 GETMBR R3 R0 K1 + 0x88100502, // 0008 GETMBR R4 R2 K2 + 0x1C0C0604, // 0009 EQ R3 R3 R4 + 0x780E0002, // 000A JMPF R3 #000E + 0x880C0103, // 000B GETMBR R3 R0 K3 + 0x400C0203, // 000C CONNECT R3 R1 R3 + 0x80040200, // 000D RET 1 R1 + 0x880C0101, // 000E GETMBR R3 R0 K1 + 0x88100504, // 000F GETMBR R4 R2 K4 + 0x1C0C0604, // 0010 EQ R3 R3 R4 + 0x740E0003, // 0011 JMPT R3 #0016 + 0x880C0101, // 0012 GETMBR R3 R0 K1 + 0x88100505, // 0013 GETMBR R4 R2 K5 + 0x1C0C0604, // 0014 EQ R3 R3 R4 + 0x780E0008, // 0015 JMPF R3 #001F + 0x600C0017, // 0016 GETGBL R3 G23 + 0x88100103, // 0017 GETMBR R4 R0 K3 + 0x7C0C0200, // 0018 CALL R3 1 + 0x780E0001, // 0019 JMPF R3 #001C + 0x880C0505, // 001A GETMBR R3 R2 K5 + 0x70020000, // 001B JMP #001D + 0x880C0504, // 001C GETMBR R3 R2 K4 + 0x90020203, // 001D SETMBR R0 K1 R3 + 0x70020070, // 001E JMP #0090 + 0x880C0101, // 001F GETMBR R3 R0 K1 + 0x88100506, // 0020 GETMBR R4 R2 K6 + 0x280C0604, // 0021 GE R3 R3 R4 + 0x780E0018, // 0022 JMPF R3 #003C + 0x880C0101, // 0023 GETMBR R3 R0 K1 + 0x88100507, // 0024 GETMBR R4 R2 K7 + 0x180C0604, // 0025 LE R3 R3 R4 + 0x780E0014, // 0026 JMPF R3 #003C + 0x600C0009, // 0027 GETGBL R3 G9 + 0x88100103, // 0028 GETMBR R4 R0 K3 + 0x7C0C0200, // 0029 CALL R3 1 + 0x5412007E, // 002A LDINT R4 127 + 0x18100604, // 002B LE R4 R3 R4 + 0x78120005, // 002C JMPF R4 #0033 + 0x5411FF7F, // 002D LDINT R4 -128 + 0x28100604, // 002E GE R4 R3 R4 + 0x78120002, // 002F JMPF R4 #0033 + 0x88100508, // 0030 GETMBR R4 R2 K8 + 0x90020204, // 0031 SETMBR R0 K1 R4 + 0x70020007, // 0032 JMP #003B + 0x54127FFE, // 0033 LDINT R4 32767 + 0x18100604, // 0034 LE R4 R3 R4 + 0x78120004, // 0035 JMPF R4 #003B + 0x54117FFF, // 0036 LDINT R4 -32768 + 0x28100604, // 0037 GE R4 R3 R4 + 0x78120001, // 0038 JMPF R4 #003B + 0x88100506, // 0039 GETMBR R4 R2 K6 + 0x90020204, // 003A SETMBR R0 K1 R4 + 0x70020053, // 003B JMP #0090 + 0x880C0101, // 003C GETMBR R3 R0 K1 + 0x88100509, // 003D GETMBR R4 R2 K9 + 0x280C0604, // 003E GE R3 R3 R4 + 0x780E0016, // 003F JMPF R3 #0057 + 0x880C0101, // 0040 GETMBR R3 R0 K1 + 0x8810050A, // 0041 GETMBR R4 R2 K10 + 0x180C0604, // 0042 LE R3 R3 R4 + 0x780E0012, // 0043 JMPF R3 #0057 + 0x600C0009, // 0044 GETGBL R3 G9 + 0x88100103, // 0045 GETMBR R4 R0 K3 + 0x7C0C0200, // 0046 CALL R3 1 + 0x541200FE, // 0047 LDINT R4 255 + 0x18100604, // 0048 LE R4 R3 R4 + 0x78120004, // 0049 JMPF R4 #004F + 0x2810070B, // 004A GE R4 R3 K11 + 0x78120002, // 004B JMPF R4 #004F + 0x8810050C, // 004C GETMBR R4 R2 K12 + 0x90020204, // 004D SETMBR R0 K1 R4 + 0x70020006, // 004E JMP #0056 + 0x5412FFFE, // 004F LDINT R4 65535 + 0x18100604, // 0050 LE R4 R3 R4 + 0x78120003, // 0051 JMPF R4 #0056 + 0x2810070B, // 0052 GE R4 R3 K11 + 0x78120001, // 0053 JMPF R4 #0056 + 0x88100509, // 0054 GETMBR R4 R2 K9 + 0x90020204, // 0055 SETMBR R0 K1 R4 + 0x70020038, // 0056 JMP #0090 + 0x880C0101, // 0057 GETMBR R3 R0 K1 + 0x8810050D, // 0058 GETMBR R4 R2 K13 + 0x280C0604, // 0059 GE R3 R3 R4 + 0x780E0018, // 005A JMPF R3 #0074 + 0x880C0101, // 005B GETMBR R3 R0 K1 + 0x8810050E, // 005C GETMBR R4 R2 K14 + 0x180C0604, // 005D LE R3 R3 R4 + 0x780E0014, // 005E JMPF R3 #0074 + 0x600C000C, // 005F GETGBL R3 G12 + 0x88100103, // 0060 GETMBR R4 R0 K3 + 0x7C0C0200, // 0061 CALL R3 1 + 0x541200FE, // 0062 LDINT R4 255 + 0x180C0604, // 0063 LE R3 R3 R4 + 0x780E0002, // 0064 JMPF R3 #0068 + 0x880C050D, // 0065 GETMBR R3 R2 K13 + 0x90020203, // 0066 SETMBR R0 K1 R3 + 0x7002000A, // 0067 JMP #0073 + 0x600C000C, // 0068 GETGBL R3 G12 + 0x88100103, // 0069 GETMBR R4 R0 K3 + 0x7C0C0200, // 006A CALL R3 1 + 0x5412FFFE, // 006B LDINT R4 65535 + 0x180C0604, // 006C LE R3 R3 R4 + 0x780E0002, // 006D JMPF R3 #0071 + 0x880C050F, // 006E GETMBR R3 R2 K15 + 0x90020203, // 006F SETMBR R0 K1 R3 + 0x70020001, // 0070 JMP #0073 + 0x880C0510, // 0071 GETMBR R3 R2 K16 + 0x90020203, // 0072 SETMBR R0 K1 R3 + 0x7002001B, // 0073 JMP #0090 + 0x880C0101, // 0074 GETMBR R3 R0 K1 + 0x88100511, // 0075 GETMBR R4 R2 K17 + 0x280C0604, // 0076 GE R3 R3 R4 + 0x780E0017, // 0077 JMPF R3 #0090 + 0x880C0101, // 0078 GETMBR R3 R0 K1 + 0x88100512, // 0079 GETMBR R4 R2 K18 + 0x180C0604, // 007A LE R3 R3 R4 + 0x780E0013, // 007B JMPF R3 #0090 + 0x600C000C, // 007C GETGBL R3 G12 + 0x88100103, // 007D GETMBR R4 R0 K3 + 0x7C0C0200, // 007E CALL R3 1 + 0x541200FE, // 007F LDINT R4 255 + 0x180C0604, // 0080 LE R3 R3 R4 + 0x780E0002, // 0081 JMPF R3 #0085 + 0x880C0511, // 0082 GETMBR R3 R2 K17 + 0x90020203, // 0083 SETMBR R0 K1 R3 + 0x7002000A, // 0084 JMP #0090 + 0x600C000C, // 0085 GETGBL R3 G12 + 0x88100103, // 0086 GETMBR R4 R0 K3 + 0x7C0C0200, // 0087 CALL R3 1 + 0x5412FFFE, // 0088 LDINT R4 65535 + 0x180C0604, // 0089 LE R3 R3 R4 + 0x780E0002, // 008A JMPF R3 #008E + 0x880C0513, // 008B GETMBR R3 R2 K19 + 0x90020203, // 008C SETMBR R0 K1 R3 + 0x70020001, // 008D JMP #0090 + 0x880C0514, // 008E GETMBR R3 R2 K20 + 0x90020203, // 008F SETMBR R0 K1 R3 + 0x8C0C0115, // 0090 GETMET R3 R0 K21 + 0x5C140200, // 0091 MOVE R5 R1 + 0x7C0C0400, // 0092 CALL R3 2 + 0x880C0101, // 0093 GETMBR R3 R0 K1 + 0x88100508, // 0094 GETMBR R4 R2 K8 + 0x1C0C0604, // 0095 EQ R3 R3 R4 + 0x740E0003, // 0096 JMPT R3 #009B + 0x880C0101, // 0097 GETMBR R3 R0 K1 + 0x8810050C, // 0098 GETMBR R4 R2 K12 + 0x1C0C0604, // 0099 EQ R3 R3 R4 + 0x780E0006, // 009A JMPF R3 #00A2 + 0x8C0C0316, // 009B GETMET R3 R1 K22 + 0x60140009, // 009C GETGBL R5 G9 + 0x88180103, // 009D GETMBR R6 R0 K3 + 0x7C140200, // 009E CALL R5 1 + 0x58180017, // 009F LDCONST R6 K23 + 0x7C0C0600, // 00A0 CALL R3 3 + 0x700200CC, // 00A1 JMP #016F + 0x880C0101, // 00A2 GETMBR R3 R0 K1 + 0x88100506, // 00A3 GETMBR R4 R2 K6 + 0x1C0C0604, // 00A4 EQ R3 R3 R4 + 0x740E0003, // 00A5 JMPT R3 #00AA + 0x880C0101, // 00A6 GETMBR R3 R0 K1 + 0x88100509, // 00A7 GETMBR R4 R2 K9 + 0x1C0C0604, // 00A8 EQ R3 R3 R4 + 0x780E0006, // 00A9 JMPF R3 #00B1 + 0x8C0C0316, // 00AA GETMET R3 R1 K22 + 0x60140009, // 00AB GETGBL R5 G9 + 0x88180103, // 00AC GETMBR R6 R0 K3 + 0x7C140200, // 00AD CALL R5 1 + 0x58180018, // 00AE LDCONST R6 K24 + 0x7C0C0600, // 00AF CALL R3 3 + 0x700200BD, // 00B0 JMP #016F + 0x880C0101, // 00B1 GETMBR R3 R0 K1 + 0x88100507, // 00B2 GETMBR R4 R2 K7 + 0x1C0C0604, // 00B3 EQ R3 R3 R4 + 0x740E0003, // 00B4 JMPT R3 #00B9 + 0x880C0101, // 00B5 GETMBR R3 R0 K1 + 0x8810050A, // 00B6 GETMBR R4 R2 K10 + 0x1C0C0604, // 00B7 EQ R3 R3 R4 + 0x780E0006, // 00B8 JMPF R3 #00C0 + 0x8C0C0316, // 00B9 GETMET R3 R1 K22 + 0x60140009, // 00BA GETGBL R5 G9 + 0x88180103, // 00BB GETMBR R6 R0 K3 + 0x7C140200, // 00BC CALL R5 1 + 0x541A0003, // 00BD LDINT R6 4 + 0x7C0C0600, // 00BE CALL R3 3 + 0x700200AE, // 00BF JMP #016F + 0x880C0101, // 00C0 GETMBR R3 R0 K1 + 0x88100519, // 00C1 GETMBR R4 R2 K25 + 0x1C0C0604, // 00C2 EQ R3 R3 R4 + 0x740E0003, // 00C3 JMPT R3 #00C8 + 0x880C0101, // 00C4 GETMBR R3 R0 K1 + 0x8810051A, // 00C5 GETMBR R4 R2 K26 + 0x1C0C0604, // 00C6 EQ R3 R3 R4 + 0x780E001F, // 00C7 JMPF R3 #00E8 + 0x880C0103, // 00C8 GETMBR R3 R0 K3 + 0x6010000F, // 00C9 GETGBL R4 G15 + 0x5C140600, // 00CA MOVE R5 R3 + 0x60180015, // 00CB GETGBL R6 G21 + 0x7C100400, // 00CC CALL R4 2 + 0x78120006, // 00CD JMPF R4 #00D5 + 0x8C10071B, // 00CE GETMET R4 R3 K27 + 0x7C100200, // 00CF CALL R4 1 + 0x8C10091C, // 00D0 GETMET R4 R4 K28 + 0x541A0007, // 00D1 LDINT R6 8 + 0x7C100400, // 00D2 CALL R4 2 + 0x5C0C0800, // 00D3 MOVE R3 R4 + 0x70020010, // 00D4 JMP #00E6 + 0x6010000F, // 00D5 GETGBL R4 G15 + 0x5C140600, // 00D6 MOVE R5 R3 + 0xB81A3A00, // 00D7 GETNGBL R6 K29 + 0x7C100400, // 00D8 CALL R4 2 + 0x78120003, // 00D9 JMPF R4 #00DE + 0x8C10071E, // 00DA GETMET R4 R3 K30 + 0x7C100200, // 00DB CALL R4 1 + 0x5C0C0800, // 00DC MOVE R3 R4 + 0x70020007, // 00DD JMP #00E6 + 0xB8123A00, // 00DE GETNGBL R4 K29 + 0x60140009, // 00DF GETGBL R5 G9 + 0x5C180600, // 00E0 MOVE R6 R3 + 0x7C140200, // 00E1 CALL R5 1 + 0x7C100200, // 00E2 CALL R4 1 + 0x8C10091E, // 00E3 GETMET R4 R4 K30 + 0x7C100200, // 00E4 CALL R4 1 + 0x5C0C0800, // 00E5 MOVE R3 R4 + 0x40100203, // 00E6 CONNECT R4 R1 R3 + 0x70020086, // 00E7 JMP #016F + 0x880C0101, // 00E8 GETMBR R3 R0 K1 + 0x88100504, // 00E9 GETMBR R4 R2 K4 + 0x1C0C0604, // 00EA EQ R3 R3 R4 + 0x740E0003, // 00EB JMPT R3 #00F0 + 0x880C0101, // 00EC GETMBR R3 R0 K1 + 0x88100505, // 00ED GETMBR R4 R2 K5 + 0x1C0C0604, // 00EE EQ R3 R3 R4 + 0x780E0000, // 00EF JMPF R3 #00F1 + 0x7002007D, // 00F0 JMP #016F + 0x880C0101, // 00F1 GETMBR R3 R0 K1 + 0x8810051F, // 00F2 GETMBR R4 R2 K31 + 0x1C0C0604, // 00F3 EQ R3 R3 R4 + 0x780E000D, // 00F4 JMPF R3 #0103 + 0x600C000C, // 00F5 GETGBL R3 G12 + 0x5C100200, // 00F6 MOVE R4 R1 + 0x7C0C0200, // 00F7 CALL R3 1 + 0x8C100316, // 00F8 GETMET R4 R1 K22 + 0x5818000B, // 00F9 LDCONST R6 K11 + 0x541E0003, // 00FA LDINT R7 4 + 0x7C100600, // 00FB CALL R4 3 + 0x8C100320, // 00FC GETMET R4 R1 K32 + 0x5C180600, // 00FD MOVE R6 R3 + 0x601C000A, // 00FE GETGBL R7 G10 + 0x88200103, // 00FF GETMBR R8 R0 K3 + 0x7C1C0200, // 0100 CALL R7 1 + 0x7C100600, // 0101 CALL R4 3 + 0x7002006B, // 0102 JMP #016F + 0x880C0101, // 0103 GETMBR R3 R0 K1 + 0x88100521, // 0104 GETMBR R4 R2 K33 + 0x1C0C0604, // 0105 EQ R3 R3 R4 + 0x780E0001, // 0106 JMPF R3 #0109 + 0xB0064523, // 0107 RAISE 1 K34 K35 + 0x70020065, // 0108 JMP #016F + 0x880C0101, // 0109 GETMBR R3 R0 K1 + 0x88100511, // 010A GETMBR R4 R2 K17 + 0x1C0C0604, // 010B EQ R3 R3 R4 + 0x780E0015, // 010C JMPF R3 #0123 + 0x600C000C, // 010D GETGBL R3 G12 + 0x88100103, // 010E GETMBR R4 R0 K3 + 0x7C0C0200, // 010F CALL R3 1 + 0x541200FE, // 0110 LDINT R4 255 + 0x240C0604, // 0111 GT R3 R3 R4 + 0x780E0000, // 0112 JMPF R3 #0114 + 0xB0064524, // 0113 RAISE 1 K34 K36 + 0x8C0C0316, // 0114 GETMET R3 R1 K22 + 0x6014000C, // 0115 GETGBL R5 G12 + 0x88180103, // 0116 GETMBR R6 R0 K3 + 0x7C140200, // 0117 CALL R5 1 + 0x58180017, // 0118 LDCONST R6 K23 + 0x7C0C0600, // 0119 CALL R3 3 + 0x600C0015, // 011A GETGBL R3 G21 + 0x7C0C0000, // 011B CALL R3 0 + 0x8C0C0725, // 011C GETMET R3 R3 K37 + 0x60140008, // 011D GETGBL R5 G8 + 0x88180103, // 011E GETMBR R6 R0 K3 + 0x7C140200, // 011F CALL R5 1 + 0x7C0C0400, // 0120 CALL R3 2 + 0x400C0203, // 0121 CONNECT R3 R1 R3 + 0x7002004B, // 0122 JMP #016F + 0x880C0101, // 0123 GETMBR R3 R0 K1 + 0x88100513, // 0124 GETMBR R4 R2 K19 + 0x1C0C0604, // 0125 EQ R3 R3 R4 + 0x780E0015, // 0126 JMPF R3 #013D + 0x600C000C, // 0127 GETGBL R3 G12 + 0x88100103, // 0128 GETMBR R4 R0 K3 + 0x7C0C0200, // 0129 CALL R3 1 + 0x5412FFFE, // 012A LDINT R4 65535 + 0x240C0604, // 012B GT R3 R3 R4 + 0x780E0000, // 012C JMPF R3 #012E + 0xB0064524, // 012D RAISE 1 K34 K36 + 0x8C0C0316, // 012E GETMET R3 R1 K22 + 0x6014000C, // 012F GETGBL R5 G12 + 0x88180103, // 0130 GETMBR R6 R0 K3 + 0x7C140200, // 0131 CALL R5 1 + 0x58180018, // 0132 LDCONST R6 K24 + 0x7C0C0600, // 0133 CALL R3 3 + 0x600C0015, // 0134 GETGBL R3 G21 + 0x7C0C0000, // 0135 CALL R3 0 + 0x8C0C0726, // 0136 GETMET R3 R3 K38 + 0x60140008, // 0137 GETGBL R5 G8 + 0x88180103, // 0138 GETMBR R6 R0 K3 + 0x7C140200, // 0139 CALL R5 1 + 0x7C0C0400, // 013A CALL R3 2 + 0x400C0203, // 013B CONNECT R3 R1 R3 + 0x70020031, // 013C JMP #016F + 0x880C0101, // 013D GETMBR R3 R0 K1 + 0x8810050D, // 013E GETMBR R4 R2 K13 + 0x1C0C0604, // 013F EQ R3 R3 R4 + 0x780E000F, // 0140 JMPF R3 #0151 + 0x600C000C, // 0141 GETGBL R3 G12 + 0x88100103, // 0142 GETMBR R4 R0 K3 + 0x7C0C0200, // 0143 CALL R3 1 + 0x541200FE, // 0144 LDINT R4 255 + 0x240C0604, // 0145 GT R3 R3 R4 + 0x780E0000, // 0146 JMPF R3 #0148 + 0xB0064527, // 0147 RAISE 1 K34 K39 + 0x8C0C0316, // 0148 GETMET R3 R1 K22 + 0x6014000C, // 0149 GETGBL R5 G12 + 0x88180103, // 014A GETMBR R6 R0 K3 + 0x7C140200, // 014B CALL R5 1 + 0x58180017, // 014C LDCONST R6 K23 + 0x7C0C0600, // 014D CALL R3 3 + 0x880C0103, // 014E GETMBR R3 R0 K3 + 0x400C0203, // 014F CONNECT R3 R1 R3 + 0x7002001D, // 0150 JMP #016F + 0x880C0101, // 0151 GETMBR R3 R0 K1 + 0x8810050F, // 0152 GETMBR R4 R2 K15 + 0x1C0C0604, // 0153 EQ R3 R3 R4 + 0x780E000F, // 0154 JMPF R3 #0165 + 0x600C000C, // 0155 GETGBL R3 G12 + 0x88100103, // 0156 GETMBR R4 R0 K3 + 0x7C0C0200, // 0157 CALL R3 1 + 0x5412FFFE, // 0158 LDINT R4 65535 + 0x240C0604, // 0159 GT R3 R3 R4 + 0x780E0000, // 015A JMPF R3 #015C + 0xB0064527, // 015B RAISE 1 K34 K39 + 0x8C0C0316, // 015C GETMET R3 R1 K22 + 0x6014000C, // 015D GETGBL R5 G12 + 0x88180103, // 015E GETMBR R6 R0 K3 + 0x7C140200, // 015F CALL R5 1 + 0x58180018, // 0160 LDCONST R6 K24 + 0x7C0C0600, // 0161 CALL R3 3 + 0x880C0103, // 0162 GETMBR R3 R0 K3 + 0x400C0203, // 0163 CONNECT R3 R1 R3 + 0x70020009, // 0164 JMP #016F + 0x880C0101, // 0165 GETMBR R3 R0 K1 + 0x88100528, // 0166 GETMBR R4 R2 K40 + 0x1C0C0604, // 0167 EQ R3 R3 R4 + 0x780E0000, // 0168 JMPF R3 #016A + 0x70020004, // 0169 JMP #016F + 0x600C0008, // 016A GETGBL R3 G8 + 0x88100101, // 016B GETMBR R4 R0 K1 + 0x7C0C0200, // 016C CALL R3 1 + 0x000E5203, // 016D ADD R3 K41 R3 + 0xB0064403, // 016E RAISE 1 K34 R3 + 0x80040200, // 016F RET 1 R1 }) ) ); @@ -1979,10 +1864,10 @@ be_local_closure(class_Matter_TLV_item_tostring, /* name */ /******************************************************************** -** Solidified function: set_commonprofile +** Solidified function: _encode_tag_len ********************************************************************/ extern const bclass be_class_Matter_TLV_item; -be_local_closure(class_Matter_TLV_item_set_commonprofile, /* name */ +be_local_closure(class_Matter_TLV_item__encode_tag_len, /* name */ be_nested_proto( 6, /* nstack */ 1, /* argc */ @@ -1992,18 +1877,107 @@ be_local_closure(class_Matter_TLV_item_set_commonprofile, /* name */ 0, /* has sup protos */ &be_class_Matter_TLV_item, 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(tag_number), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str_weak(tag_vendor), + /* K3 */ be_nested_str_weak(tag_profile), + /* K4 */ be_const_int(3), + /* K5 */ be_nested_str_weak(tag_sub), + /* K6 */ be_const_int(2), + /* K7 */ be_const_int(1), + }), + be_str_weak(_encode_tag_len), + &be_const_str_solidified, + ( &(const binstruction[54]) { /* 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 + 0x540AFFFF, // 0007 LDINT R2 65536 + 0x28080202, // 0008 GE R2 R1 R2 + 0x740A0002, // 0009 JMPT R2 #000D + 0x14080301, // 000A LT R2 R1 K1 + 0x740A0000, // 000B JMPT R2 #000D + 0x50080001, // 000C LDBOOL R2 0 1 + 0x50080200, // 000D LDBOOL R2 1 0 + 0x580C0001, // 000E LDCONST R3 K1 + 0x88100102, // 000F GETMBR R4 R0 K2 + 0x4C140000, // 0010 LDNIL R5 + 0x20100805, // 0011 NE R4 R4 R5 + 0x78120006, // 0012 JMPF R4 #001A + 0x780A0002, // 0013 JMPF R2 #0017 + 0x54120008, // 0014 LDINT R4 9 + 0x80040800, // 0015 RET 1 R4 + 0x70020001, // 0016 JMP #0019 + 0x54120006, // 0017 LDINT R4 7 + 0x80040800, // 0018 RET 1 R4 + 0x7002001A, // 0019 JMP #0035 + 0x88100103, // 001A GETMBR R4 R0 K3 + 0x5415FFFE, // 001B LDINT R5 -1 + 0x1C100805, // 001C EQ R4 R4 R5 + 0x78120005, // 001D JMPF R4 #0024 + 0x780A0002, // 001E JMPF R2 #0022 + 0x54120004, // 001F LDINT R4 5 + 0x80040800, // 0020 RET 1 R4 + 0x70020000, // 0021 JMP #0023 + 0x80060800, // 0022 RET 1 K4 + 0x70020010, // 0023 JMP #0035 + 0x88100103, // 0024 GETMBR R4 R0 K3 + 0x4C140000, // 0025 LDNIL R5 + 0x20100805, // 0026 NE R4 R4 R5 + 0x78120005, // 0027 JMPF R4 #002E + 0x780A0002, // 0028 JMPF R2 #002C + 0x54120004, // 0029 LDINT R4 5 + 0x80040800, // 002A RET 1 R4 + 0x70020000, // 002B JMP #002D + 0x80060800, // 002C RET 1 K4 + 0x70020006, // 002D JMP #0035 + 0x88100105, // 002E GETMBR R4 R0 K5 + 0x4C140000, // 002F LDNIL R5 + 0x20100805, // 0030 NE R4 R4 R5 + 0x78120001, // 0031 JMPF R4 #0034 + 0x80060C00, // 0032 RET 1 K6 + 0x70020000, // 0033 JMP #0035 + 0x80060E00, // 0034 RET 1 K7 + 0x80000000, // 0035 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_contextspecific +********************************************************************/ +extern const bclass be_class_Matter_TLV_item; +be_local_closure(class_Matter_TLV_item_set_contextspecific, /* name */ + be_nested_proto( + 4, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_TLV_item, + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ /* K0 */ be_nested_str_weak(set_fulltag), + /* K1 */ be_nested_str_weak(tag_sub), }), - be_str_weak(set_commonprofile), + be_str_weak(set_contextspecific), &be_const_str_solidified, - ( &(const binstruction[ 6]) { /* code */ - 0x8C040100, // 0000 GETMET R1 R0 K0 - 0x4C0C0000, // 0001 LDNIL R3 - 0x5411FFFE, // 0002 LDINT R4 -1 - 0x4C140000, // 0003 LDNIL R5 - 0x7C040800, // 0004 CALL R1 4 - 0x80000000, // 0005 RET 0 + ( &(const binstruction[ 7]) { /* code */ + 0x8C080100, // 0000 GETMET R2 R0 K0 + 0x7C080200, // 0001 CALL R2 1 + 0x60080009, // 0002 GETGBL R2 G9 + 0x5C0C0200, // 0003 MOVE R3 R1 + 0x7C080200, // 0004 CALL R2 1 + 0x90020202, // 0005 SETMBR R0 K1 R2 + 0x80000000, // 0006 RET 0 }) ) ); @@ -2011,10 +1985,10 @@ be_local_closure(class_Matter_TLV_item_set_commonprofile, /* name */ /******************************************************************** -** Solidified function: init +** Solidified function: set_parent ********************************************************************/ extern const bclass be_class_Matter_TLV_item; -be_local_closure(class_Matter_TLV_item_init, /* name */ +be_local_closure(class_Matter_TLV_item_set_parent, /* name */ be_nested_proto( 2, /* nstack */ 2, /* argc */ @@ -2027,7 +2001,7 @@ be_local_closure(class_Matter_TLV_item_init, /* name */ ( &(const bvalue[ 1]) { /* constants */ /* K0 */ be_nested_str_weak(parent), }), - be_str_weak(init), + be_str_weak(set_parent), &be_const_str_solidified, ( &(const binstruction[ 2]) { /* code */ 0x90020001, // 0000 SETMBR R0 K0 R1 @@ -2038,45 +2012,116 @@ be_local_closure(class_Matter_TLV_item_init, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: create_TLV +********************************************************************/ +extern const bclass be_class_Matter_TLV_item; +be_local_closure(class_Matter_TLV_item_create_TLV, /* name */ + be_nested_proto( + 4, /* nstack */ + 2, /* argc */ + 4, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_TLV_item, + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_const_class(be_class_Matter_TLV_item), + /* K1 */ be_nested_str_weak(typ), + /* K2 */ be_nested_str_weak(val), + }), + be_str_weak(create_TLV), + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0x58080000, // 0000 LDCONST R2 K0 + 0x4C0C0000, // 0001 LDNIL R3 + 0x200C0203, // 0002 NE R3 R1 R3 + 0x740E0002, // 0003 JMPT R3 #0007 + 0x540E0013, // 0004 LDINT R3 20 + 0x1C0C0003, // 0005 EQ R3 R0 R3 + 0x780E0004, // 0006 JMPF R3 #000C + 0x5C0C0400, // 0007 MOVE R3 R2 + 0x7C0C0000, // 0008 CALL R3 0 + 0x900E0200, // 0009 SETMBR R3 K1 R0 + 0x900E0401, // 000A SETMBR R3 K2 R1 + 0x80040600, // 000B RET 1 R3 + 0x80000000, // 000C RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_anonymoustag +********************************************************************/ +extern const bclass be_class_Matter_TLV_item; +be_local_closure(class_Matter_TLV_item_set_anonymoustag, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_TLV_item, + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(set_fulltag), + }), + be_str_weak(set_anonymoustag), + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x7C040200, // 0001 CALL R1 1 + 0x80000000, // 0002 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified class: Matter_TLV_item ********************************************************************/ be_local_class(Matter_TLV_item, 8, NULL, - be_nested_map(31, + be_nested_map(32, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(is_array, 17), be_const_bool(0) }, - { be_const_key_weak(init, -1), be_const_closure(class_Matter_TLV_item_init_closure) }, - { be_const_key_weak(set_parent, -1), be_const_closure(class_Matter_TLV_item_set_parent_closure) }, - { be_const_key_weak(set_fulltag, -1), be_const_closure(class_Matter_TLV_item_set_fulltag_closure) }, - { be_const_key_weak(typ, -1), be_const_var(6) }, - { be_const_key_weak(parse, 30), be_const_closure(class_Matter_TLV_item_parse_closure) }, - { be_const_key_weak(parent, 22), be_const_var(0) }, - { be_const_key_weak(to_str_val, -1), be_const_closure(class_Matter_TLV_item_to_str_val_closure) }, - { be_const_key_weak(encode_len, 4), be_const_closure(class_Matter_TLV_item_encode_len_closure) }, - { be_const_key_weak(TLV, 20), be_const_class(be_class_Matter_TLV) }, - { be_const_key_weak(reset, 0), be_const_closure(class_Matter_TLV_item_reset_closure) }, - { be_const_key_weak(tag_profile, -1), be_const_var(3) }, + { be_const_key_weak(reset, -1), be_const_closure(class_Matter_TLV_item_reset_closure) }, + { be_const_key_weak(set_or_nil, -1), be_const_closure(class_Matter_TLV_item_set_or_nil_closure) }, + { be_const_key_weak(set_anonymoustag, 30), be_const_closure(class_Matter_TLV_item_set_anonymoustag_closure) }, + { be_const_key_weak(set, -1), be_const_closure(class_Matter_TLV_item_set_closure) }, { be_const_key_weak(create_TLV, -1), be_const_static_closure(class_Matter_TLV_item_create_TLV_closure) }, + { be_const_key_weak(tostring, 22), be_const_closure(class_Matter_TLV_item_tostring_closure) }, { be_const_key_weak(tag_sub, -1), be_const_var(5) }, - { be_const_key_weak(tag_vendor, -1), be_const_var(2) }, - { be_const_key_weak(tostring, -1), be_const_closure(class_Matter_TLV_item_tostring_closure) }, - { be_const_key_weak(val, 5), be_const_var(7) }, - { be_const_key_weak(_encode_tag, -1), be_const_closure(class_Matter_TLV_item__encode_tag_closure) }, - { be_const_key_weak(_cmp_gt, -1), be_const_closure(class_Matter_TLV_item__cmp_gt_closure) }, - { be_const_key_weak(_encode_tag_len, 25), be_const_closure(class_Matter_TLV_item__encode_tag_len_closure) }, - { be_const_key_weak(is_struct, -1), be_const_bool(0) }, - { be_const_key_weak(tlv2raw, -1), be_const_closure(class_Matter_TLV_item_tlv2raw_closure) }, - { be_const_key_weak(sort, -1), be_const_static_closure(class_Matter_TLV_item_sort_closure) }, + { be_const_key_weak(is_array, -1), be_const_bool(0) }, + { be_const_key_weak(to_str_val, 4), be_const_closure(class_Matter_TLV_item_to_str_val_closure) }, + { be_const_key_weak(parent, -1), be_const_var(0) }, { be_const_key_weak(is_list, -1), be_const_bool(0) }, - { be_const_key_weak(to_TLV, 18), be_const_closure(class_Matter_TLV_item_to_TLV_closure) }, - { be_const_key_weak(set, -1), be_const_closure(class_Matter_TLV_item_set_closure) }, - { be_const_key_weak(set_anonymoustag, 15), be_const_closure(class_Matter_TLV_item_set_anonymoustag_closure) }, + { be_const_key_weak(is_struct, -1), be_const_bool(0) }, + { be_const_key_weak(parse, -1), be_const_closure(class_Matter_TLV_item_parse_closure) }, + { be_const_key_weak(set_parent, -1), be_const_closure(class_Matter_TLV_item_set_parent_closure) }, { be_const_key_weak(set_commonprofile, -1), be_const_closure(class_Matter_TLV_item_set_commonprofile_closure) }, + { be_const_key_weak(_encode_tag, -1), be_const_closure(class_Matter_TLV_item__encode_tag_closure) }, + { be_const_key_weak(TLV, -1), be_const_class(be_class_Matter_TLV) }, + { be_const_key_weak(sort, 25), be_const_static_closure(class_Matter_TLV_item_sort_closure) }, + { be_const_key_weak(tag_vendor, -1), be_const_var(2) }, + { be_const_key_weak(init, -1), be_const_closure(class_Matter_TLV_item_init_closure) }, + { be_const_key_weak(_cmp_gt, -1), be_const_closure(class_Matter_TLV_item__cmp_gt_closure) }, { be_const_key_weak(tag_number, -1), be_const_var(4) }, - { be_const_key_weak(next_idx, 1), be_const_var(1) }, + { be_const_key_weak(tlv2raw, -1), be_const_closure(class_Matter_TLV_item_tlv2raw_closure) }, + { be_const_key_weak(_encode_tag_len, -1), be_const_closure(class_Matter_TLV_item__encode_tag_len_closure) }, + { be_const_key_weak(next_idx, -1), be_const_var(1) }, + { be_const_key_weak(tag_profile, 16), be_const_var(3) }, + { be_const_key_weak(typ, -1), be_const_var(6) }, { be_const_key_weak(set_contextspecific, -1), be_const_closure(class_Matter_TLV_item_set_contextspecific_closure) }, + { be_const_key_weak(val, 13), be_const_var(7) }, + { be_const_key_weak(to_TLV, 9), be_const_closure(class_Matter_TLV_item_to_TLV_closure) }, + { be_const_key_weak(set_fulltag, -1), be_const_closure(class_Matter_TLV_item_set_fulltag_closure) }, + { be_const_key_weak(encode_len, 2), be_const_closure(class_Matter_TLV_item_encode_len_closure) }, })), be_str_weak(Matter_TLV_item) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_UI.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_UI.h index 8bae5ab68ea1..4ed01b4c6ceb 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_UI.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_UI.h @@ -3419,7 +3419,7 @@ be_local_class(Matter_UI, { be_const_key_weak(show_commissioning_info, -1), be_const_closure(class_Matter_UI_show_commissioning_info_closure) }, { be_const_key_weak(page_part_ctl, 18), be_const_closure(class_Matter_UI_page_part_ctl_closure) }, { be_const_key_weak(show_fabric_info, -1), be_const_closure(class_Matter_UI_show_fabric_info_closure) }, - { be_const_key_weak(_CLASSES_TYPES, 4), be_nested_str_long(_X7Crelay_X7Clight0_X7Clight1_X7Clight2_X7Clight3_X7Cshutter_X7Cshutter_X2Btilt_X7Ctemperature_X7Cpressure_X7Cilluminance_X7Chumidity_X7Coccupancy_X7Conoff_X7Ccontact_X7Cflow_X7Cwaterleak_X7C_X2Dvirtual_X7Cv_relay_X7Cv_light0_X7Cv_light1_X7Cv_light2_X7Cv_light3_X7Cv_temp_X7Cv_pressure_X7Cv_illuminance_X7Cv_humidity_X7Cv_occupancy_X7Cv_contact_X7Cv_flow_X7Cv_waterleak) }, + { be_const_key_weak(_CLASSES_TYPES, 4), be_nested_str_long(_X7Crelay_X7Clight0_X7Clight1_X7Clight2_X7Clight3_X7Cshutter_X7Cshutter_X2Btilt_X7Ctemperature_X7Cpressure_X7Cilluminance_X7Chumidity_X7Coccupancy_X7Conoff_X7Ccontact_X7Cflow_X7Cwaterleak_X7Cairquality_X7C_X2Dvirtual_X7Cv_relay_X7Cv_light0_X7Cv_light1_X7Cv_light2_X7Cv_light3_X7Cv_temp_X7Cv_pressure_X7Cv_illuminance_X7Cv_humidity_X7Cv_occupancy_X7Cv_contact_X7Cv_flow_X7Cv_waterleak_X7Cv_airquality) }, { be_const_key_weak(web_get_arg, -1), be_const_closure(class_Matter_UI_web_get_arg_closure) }, { be_const_key_weak(plugin_option, 5), be_const_closure(class_Matter_UI_plugin_option_closure) }, { be_const_key_weak(web_add_config_button, -1), be_const_closure(class_Matter_UI_web_add_config_button_closure) }, 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 3a49183ffcc9..b1ad4546f320 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 @@ -6284,52 +6284,55 @@ be_local_class(Matter_Device, { be_const_key_weak(stop, 14), be_const_closure(class_Matter_Device_stop_closure) }, { be_const_key_weak(stop_basic_commissioning, 13), be_const_closure(class_Matter_Device_stop_basic_commissioning_closure) }, { be_const_key_weak(plugins_classes, 10), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { - be_const_map( * be_nested_map(44, + be_const_map( * be_nested_map(47, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(humidity, 37), be_const_class(be_class_Matter_Plugin_Sensor_Humidity) }, - { be_const_key_weak(flow, -1), be_const_class(be_class_Matter_Plugin_Sensor_Flow) }, - { be_const_key_weak(v_flow, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Flow) }, + { be_const_key_weak(v_waterleak, 43), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Waterleak) }, + { be_const_key_weak(light0, -1), be_const_class(be_class_Matter_Plugin_Light0) }, { be_const_key_weak(waterleak, -1), be_const_class(be_class_Matter_Plugin_Sensor_Waterleak) }, - { be_const_key_weak(http_flow, 25), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Flow) }, - { be_const_key_weak(v_pressure, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Pressure) }, - { be_const_key_weak(v_waterleak, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Waterleak) }, - { be_const_key_weak(onoff, -1), be_const_class(be_class_Matter_Plugin_Sensor_OnOff) }, - { be_const_key_weak(v_occupancy, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Occupancy) }, - { be_const_key_weak(temperature, -1), be_const_class(be_class_Matter_Plugin_Sensor_Temp) }, - { be_const_key_weak(illuminance, 22), be_const_class(be_class_Matter_Plugin_Sensor_Illuminance) }, - { be_const_key_weak(v_light3, 33), be_const_class(be_class_Matter_Plugin_Virt_Light3) }, - { be_const_key_weak(contact, -1), be_const_class(be_class_Matter_Plugin_Sensor_Contact) }, - { be_const_key_weak(v_light1, 14), be_const_class(be_class_Matter_Plugin_Virt_Light1) }, - { be_const_key_weak(http_light1, -1), be_const_class(be_class_Matter_Plugin_Bridge_Light1) }, - { be_const_key_weak(http_occupancy, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Occupancy) }, - { be_const_key_weak(http_illuminance, 12), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Illuminance) }, - { be_const_key_weak(http_pressure, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Pressure) }, + { be_const_key_weak(v_flow, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Flow) }, + { be_const_key_weak(humidity, 17), be_const_class(be_class_Matter_Plugin_Sensor_Humidity) }, { be_const_key_weak(http_contact, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Contact) }, - { be_const_key_weak(light2, -1), be_const_class(be_class_Matter_Plugin_Light2) }, - { be_const_key_weak(aggregator, -1), be_const_class(be_class_Matter_Plugin_Aggregator) }, - { be_const_key_weak(light0, -1), be_const_class(be_class_Matter_Plugin_Light0) }, - { be_const_key_weak(occupancy, -1), be_const_class(be_class_Matter_Plugin_Sensor_Occupancy) }, { be_const_key_weak(http_humidity, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Humidity) }, - { be_const_key_weak(shutter, 28), be_const_class(be_class_Matter_Plugin_Shutter) }, - { be_const_key_weak(http_light0, 24), be_const_class(be_class_Matter_Plugin_Bridge_Light0) }, + { be_const_key_weak(http_temperature, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Temp) }, + { be_const_key_weak(light3, -1), be_const_class(be_class_Matter_Plugin_Light3) }, + { be_const_key_weak(airquality, -1), be_const_class(be_class_Matter_Plugin_Sensor_Air_Quality) }, + { be_const_key_weak(http_flow, 36), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Flow) }, + { be_const_key_weak(v_illuminance, 24), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Illuminance) }, + { be_const_key_weak(v_light3, -1), be_const_class(be_class_Matter_Plugin_Virt_Light3) }, + { be_const_key_weak(http_relay, -1), be_const_class(be_class_Matter_Plugin_Bridge_OnOff) }, + { be_const_key_weak(http_light1, 26), be_const_class(be_class_Matter_Plugin_Bridge_Light1) }, + { be_const_key_weak(http_light0, 6), be_const_class(be_class_Matter_Plugin_Bridge_Light0) }, + { be_const_key_weak(v_temp, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Temp) }, { be_const_key_weak(http_light2, -1), be_const_class(be_class_Matter_Plugin_Bridge_Light2) }, - { be_const_key_weak(v_relay, -1), be_const_class(be_class_Matter_Plugin_Virt_OnOff) }, - { be_const_key_weak(v_contact, 41), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Contact) }, - { be_const_key_weak(root, 7), be_const_class(be_class_Matter_Plugin_Root) }, + { be_const_key_weak(http_pressure, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Pressure) }, + { be_const_key_weak(contact, 10), be_const_class(be_class_Matter_Plugin_Sensor_Contact) }, { be_const_key_weak(pressure, -1), be_const_class(be_class_Matter_Plugin_Sensor_Pressure) }, - { be_const_key_weak(v_illuminance, 8), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Illuminance) }, - { be_const_key_weak(v_light2, 26), be_const_class(be_class_Matter_Plugin_Virt_Light2) }, - { be_const_key_weak(http_light3, -1), be_const_class(be_class_Matter_Plugin_Bridge_Light3) }, - { be_const_key_weak(v_light0, 4), be_const_class(be_class_Matter_Plugin_Virt_Light0) }, { be_const_key_weak(v_humidity, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Humidity) }, - { be_const_key_weak(v_temp, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Temp) }, - { be_const_key_weak(shutter_X2Btilt, 43), be_const_class(be_class_Matter_Plugin_ShutterTilt) }, - { be_const_key_weak(http_waterleak, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Waterleak) }, - { be_const_key_weak(http_relay, 16), be_const_class(be_class_Matter_Plugin_Bridge_OnOff) }, - { be_const_key_weak(light3, -1), be_const_class(be_class_Matter_Plugin_Light3) }, + { be_const_key_weak(http_airquality, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Air_Quality) }, + { be_const_key_weak(v_light1, -1), be_const_class(be_class_Matter_Plugin_Virt_Light1) }, + { be_const_key_weak(temperature, -1), be_const_class(be_class_Matter_Plugin_Sensor_Temp) }, + { be_const_key_weak(occupancy, -1), be_const_class(be_class_Matter_Plugin_Sensor_Occupancy) }, + { be_const_key_weak(http_illuminance, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Illuminance) }, + { be_const_key_weak(v_relay, -1), be_const_class(be_class_Matter_Plugin_Virt_OnOff) }, + { be_const_key_weak(aggregator, -1), be_const_class(be_class_Matter_Plugin_Aggregator) }, + { be_const_key_weak(v_contact, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Contact) }, + { be_const_key_weak(flow, 34), be_const_class(be_class_Matter_Plugin_Sensor_Flow) }, + { be_const_key_weak(shutter, 5), be_const_class(be_class_Matter_Plugin_Shutter) }, + { be_const_key_weak(v_pressure, 2), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Pressure) }, + { be_const_key_weak(http_light3, -1), be_const_class(be_class_Matter_Plugin_Bridge_Light3) }, + { be_const_key_weak(v_light2, 39), be_const_class(be_class_Matter_Plugin_Virt_Light2) }, + { be_const_key_weak(onoff, -1), be_const_class(be_class_Matter_Plugin_Sensor_OnOff) }, + { be_const_key_weak(v_airquality, 42), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Air_Quality) }, + { be_const_key_weak(light2, 3), be_const_class(be_class_Matter_Plugin_Light2) }, + { be_const_key_weak(v_occupancy, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Occupancy) }, + { be_const_key_weak(illuminance, 40), be_const_class(be_class_Matter_Plugin_Sensor_Illuminance) }, { be_const_key_weak(relay, -1), be_const_class(be_class_Matter_Plugin_OnOff) }, + { be_const_key_weak(v_light0, -1), be_const_class(be_class_Matter_Plugin_Virt_Light0) }, { be_const_key_weak(light1, -1), be_const_class(be_class_Matter_Plugin_Light1) }, - { be_const_key_weak(http_temperature, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Temp) }, + { be_const_key_weak(shutter_X2Btilt, -1), be_const_class(be_class_Matter_Plugin_ShutterTilt) }, + { be_const_key_weak(http_waterleak, 14), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Waterleak) }, + { be_const_key_weak(http_occupancy, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Occupancy) }, + { be_const_key_weak(root, 29), be_const_class(be_class_Matter_Plugin_Root) }, })) ) } )) }, { be_const_key_weak(tick, 9), be_const_var(10) }, { be_const_key_weak(commissioning_admin_fabric, -1), be_const_var(17) }, diff --git a/lib/libesp32/berry_tasmota/src/be_port.cpp b/lib/libesp32/berry_tasmota/src/be_port.cpp index 0c70bf61c55f..db40e153f0ea 100644 --- a/lib/libesp32/berry_tasmota/src/be_port.cpp +++ b/lib/libesp32/berry_tasmota/src/be_port.cpp @@ -216,7 +216,10 @@ extern "C" { BERRY_API char* be_readstring(char *buffer, size_t size) { - return be_fgets(stdin, buffer, (int)size); + if ((size > 0) && (buffer != NULL)) { + *buffer = 0; + } + return buffer; } /* use the standard library implementation file API. */ diff --git a/lib/libesp32_lvgl/lvgl/src/libs/tjpgd/tjpgd.c b/lib/libesp32_lvgl/lvgl/src/libs/tjpgd/tjpgd.c index 22dfd563291b..63f4915d58cf 100644 --- a/lib/libesp32_lvgl/lvgl/src/libs/tjpgd/tjpgd.c +++ b/lib/libesp32_lvgl/lvgl/src/libs/tjpgd/tjpgd.c @@ -24,6 +24,7 @@ / Some performance improvement. /----------------------------------------------------------------------------*/ +#ifndef TASMOTA // has tjpegd in ROM #include "tjpgd.h" @@ -1135,3 +1136,5 @@ JRESULT jd_decomp( return rc; } +#endif // TASMOTA + diff --git a/lib/libesp32_lvgl/lvgl/src/libs/tjpgd/tjpgd.h b/lib/libesp32_lvgl/lvgl/src/libs/tjpgd/tjpgd.h index f1b578820e8b..7c0b91a00164 100644 --- a/lib/libesp32_lvgl/lvgl/src/libs/tjpgd/tjpgd.h +++ b/lib/libesp32_lvgl/lvgl/src/libs/tjpgd/tjpgd.h @@ -1,6 +1,7 @@ /*----------------------------------------------------------------------------/ / TJpgDec - Tiny JPEG Decompressor R0.03 include file (C)ChaN, 2021 /----------------------------------------------------------------------------*/ +#ifndef TASMOTA // has tjpegd in ROM #ifndef DEF_TJPGDEC #define DEF_TJPGDEC @@ -101,3 +102,4 @@ JRESULT jd_restart(JDEC * jd, uint16_t rstn); #endif #endif /* _TJPGDEC */ +#endif // TASMOTA diff --git a/tasmota/berry/drivers/Core200S.be b/tasmota/berry/drivers/Core200S.be new file mode 100644 index 000000000000..2764b8cfb3d7 --- /dev/null +++ b/tasmota/berry/drivers/Core200S.be @@ -0,0 +1,832 @@ +import string +import webserver + +#### +# Feature state classes +# In the section below there Classes that represent state of specific features of the air purifier (e.g. +# if the fan is on or off) +#### + +# Generic parent class that implements the shared functionality of all state classes +class StateEnum + var value_map + var value + + # Init a state + # param value_map map of valid states in readable and binary form (e.g. {"on":1, "off":0} + # param value value that this object reprents + def init(value_map, value) + self.value_map = value_map + if type(value) == 'int' + for v : self.value_map + if v == value + self.value = value + break + end + end + elif type(value) == 'string' + self.value = value_map.find(value) + end + + if self.value == nil + raise "StateEnumError", "Invalid type or value" + end + end + + def tostring() + for k : self.value_map.keys() + if self.value_map[k] == self.value + return k + end + end + return "invalid" + end + + def toint() + return self.value + end + + def ==(other) + return self.value == other.value && type(self) == type(other) + end + +end + +# Generic parent class that implementes On-Off only features (so features that only +# know these two states +class OnOffState : StateEnum + static ON = OnOffState("on") + static OFF = OnOffState("off") + def init(value) + super(self).init({"off": 0, "on": 1}, value) + end +end + +# Class that represent if the fan is running or nor +class FanMode : OnOffState + def init(value) + super(self).init(value) + end +end + +# Class that represents if the child lock is enabled or not +class ChildLockMode : OnOffState + def init(value) + super(self).init(value) + end +end + +# Class that represents if the sleep mode is enabled or not +class SleepMode : OnOffState + def init(value) + super(self).init(value) + end +end + +# Class that represent if the the display auto off mode is enabled or not +class DisplayAutoOffMode : StateEnum + static OFF = DisplayAutoOffMode("off") + static ON = DisplayAutoOffMode("on") + def init(value) + super(self).init({"off": 1, "on": 0}, value) + end +end + +# Class that represents if the display is currently turned on or not +# (Note this just represents the current state and can't only be controlled via +# sleep mode or display auto off mode) +class DisplayMode : StateEnum + def init(value) + super(self).init({"off": 0, "on": 100}, value) + end +end + +# Class that represents the current speed level of the fan +# (Note even if fan is turned off, the last speed state is stored) +class FanSpeedMode : StateEnum + static LOW = FanSpeedMode("low") + static MED = FanSpeedMode("med") + static FULL = FanSpeedMode("full") + + def init(value) + super(self).init({"low": 1, "med": 2, "full": 3}, value) + end +end + +# Class that reprensts the state of the night light +class NightLightMode : StateEnum + static OFF = NightLightMode("off") + static LOW = NightLightMode("low") + static FULL = NightLightMode("full") + def init(value) + super(self).init({"off": 0, "low": 50, "full": 100}, value) + end +end + + + +#### +# Utility classes +#### + +def info_c2s(msg) + log("C2S: " + msg, 2) +end + +def log_c2s(msg) + log("C2S: " + msg, 3) +end + +# Class that implements messaging functionality that is need and not provided by the +# "normal" serial class, such as +# * read byte by byte +# * read ahead (reading without actually consuming the content) +# and some device specifc functionality such a +# * checksum calculation and verification of each message +# * tracking of message count +# * reading of single messages instead of whole serial buffer +class Core200SSerial : serial + var msg_count + var read_buffer + var error_count + var expected_replies + + def init(RX, TX) + super(self).init(RX, TX, 115200) + self.reset_counters() + self.read_buffer = bytes() + end + + def deinit() + self.close() + end + + static def calc_checksum(msg) + var checksum = 0xff + var i = 0 + while i < msg.size() + if (i != 5) + checksum -= msg.get(i) + if checksum < 0 + checksum += 256 + end + end + i += 1 + end + return checksum + end + + # send message and wait for reply + # message counter is set and message checksum are calculated automatically + def send(msg) + self.send_nowait(msg) + tasmota.delay(50) + return self.read_msg() + end + + # send message and don't wait for reply here. Instead the reply needs to be handled asynchronously + def send_nowait(msg) + if msg.size() >= 2 && msg[1] == 0x22 + self.expected_replies += 1 + end + + # increase and set message counter + self.msg_count += 1 + msg[2] = self.msg_count + + # insert checksum + msg[5] = self.calc_checksum(msg) + + # send message + var i = 0 + while i < msg.size() + self.write(msg[i]) + i += 1 + end + + log_c2s(f"Send {msg.tohex()}") + end + + # Return number of available bytes + # (is specified because the available() method from serial would return incorrect values) + def available() + self.read_buffer += self.read() + return self.read_buffer.size() + end + + # read num bytes but don't actually remove them from the buffer + def read_ahead(num) + var content = self.read() + self.read_buffer += content + + if self.read_buffer.size() >= num + return self.read_buffer[0..(num-1)] + end + + return nil + end + + # read num bytes and remove them from buffer + def consume(num) + var content = self.read_ahead(num) + if content != nil + self.read_buffer = self.read_buffer[num..] + end + return content + end + + # Read whole message from internal buffer. Note there might be multiple messages in the buffer. + # Reading a message from the buffer will also consume this message (so it will be removed from the buffer) + def read_msg(allow_no_msg) + var max_read_attempts = 10 + var header = self.read_ahead(6) + if header == nil + header = bytes("0000") + end + + # Search for beginning of message (which is always a522 or a512) and read header information: + # e.g., [a5, 12, 00, message_size, 00, checksum] + # a512 headers indicate replies on messages that originate from the esp + # a522 headers indicate requests that originate from the MCU (which requires us to the a a512 reply) + while header[0] != 0xa5 || (header[1] != 0x12 && header[1] != 0x22) + if header != bytes("0000") + self.consume(1) + else + max_read_attempts -= 1 + if max_read_attempts <= 0 + if !allow_no_msg + info_c2s("Too many read attempts (couldn't read message header)") + self.error_count += 1 + end + return bytes() + end + tasmota.delay(25) + end + header = self.read_ahead(6) + if header == nil + header = bytes("0000") + end + end + + # consume header bytes + if header == bytes("0000") + info_c2s("Too many read attempts (couldn't read message header)") + self.error_count += 1 + return bytes() + else + self.consume(6) + end + + log_c2s(f"Got Header {header.tohex()}") + + # read payload of given size + var payload = self.consume(header[3]) + while payload == nil + max_read_attempts -= 1 + if max_read_attempts <= 0 + if !allow_no_msg + self.error_count += 1 + info_c2s("Too many read attempts (couldn't read message payload)") + end + return bytes() + end + payload = self.consume(header[3]) + end + + var msg = header + payload + info_c2s("Full Message " + msg.tohex()) + + # if we receive a reply, decrease a expected reply counter + if header[1] == 0x12 + self.expected_replies -= 1 + end + + # Verify that checksum is correct + var checksum = self.calc_checksum(msg) + if checksum != msg[5] + info_c2s("Invalid Checksum") + return bytes() + end + + return msg + + end + + # method to check amount of errors + # such errors are not expected, this is just make the implementation more robust + def check_errors() + return self.error_count > 10 || self.expected_replies > 10 + end + + # reset internal counters (should be used in case the whole connection has been re-initiliazed due to too many errors) + def reset_counters() + self.error_count = 0 + self.expected_replies = 0 + self.msg_count = 0 + end +end + +ser = Core200SSerial(16, 17) + +# Class that implements the interaction protocol with the MCU (to set state of specific features) +class Core200S + var wifi_on + var second_counter + var fan_mode + var sl_mode + var fan_speed_mode + var dp_mode + var dp_auto_off_mode + var cl_mode + var nl_mode + var timer_remaining + var timer_total + var init_counter + + def init() + self.wifi_on = nil + self.second_counter = 0 + self.timer_remaining = 0 + self.timer_total = 0 + self.reinit_connection() + end + + def reinit_connection() + ser.reset_counters() + ser.flush() + self.init_counter = 7 + self.init_cmds() + end + + # Connection initalization commands + def init_cmds() + if self.init_counter == 7 + ser.send(bytes("a522010500aa01e2a50000")) + elif self.init_counter == 6 + ser.read_msg(false) + elif self.init_counter == 5 + ser.send_nowait(bytes("a512000400a301604000")) + elif self.init_counter == 4 + ser.send(bytes("a5220204009001614000")) + elif self.init_counter == 3 + self.set_wifi_led(tasmota.wifi("up")) + elif self.init_counter == 2 + self.query_state() + elif self.init_counter == 1 + self.query_timer() + end + + if self.init_counter > 0 + self.init_counter -= 1 + end + end + + # Enable / Disable wifi led + def set_wifi_led(on) + if self.init_counter > 3 + return + end + if self.wifi_on != on + var msg + if on + msg = bytes("a522050a00630129a100017d007d0000") + else + msg = bytes("a522030a00760129a10000f401f40100") + end + ser.send_nowait(msg) + self.wifi_on = on + end + end + + # Query current state. The reply will contain the current state of all features except for the timers. + def query_state() + if self.init_counter <= 2 + ser.send_nowait(bytes("a5220604008c01614000")) + end + end + + # Query current state of timers. The reply will only contain the current state of the timers + def query_timer() + if self.init_counter <= 1 + ser.send_nowait(bytes("a522070400250165a200")) + end + end + + # Set fan speed mode to given mode + def set_fan_speed(mode) + if self.init_counter != 0 + return + end + var msg = bytes("a522070700250160a2000001") + msg.add(mode.toint(), 1) + return ser.send(msg) != bytes() + end + + # Toggle fan speed mode as the button on the air purifier would do (low -> med -> full -> low -> ...) + def toggle_fan_speed() + if self.fan_speed_mode == FanSpeedMode.LOW + return self.set_fan_speed(FanSpeedMode.MED) + elif self.fan_speed_mode == FanSpeedMode.MED + return self.set_fan_speed(FanSpeedMode.FULL) + else + # default case for nil value + return self.set_fan_speed(FanSpeedMode.LOW) + end + end + + # Set fan mode to given mode (on or off) + def set_fan_mode(mode) + if self.init_counter != 0 + return + end + var msg = bytes("a5220705008a0100a000") + msg.add(mode.toint(), 1) + return ser.send(msg) != bytes() + end + + # Toggle fan mode between off and on + def toggle_fan_mode() + if self.fan_mode == FanMode.ON + return self.set_fan_mode(FanMode.OFF) + else + return self.set_fan_mode(FanMode.ON) + end + end + + # Set night light to given mode + def set_night_light_mode(mode) + if self.init_counter != 0 + return + end + var msg = bytes("a522090600210103a00000") + msg.add(mode.toint(), 1) + return ser.send(msg) != bytes() + end + + # Toggle night light mode as the button on the air purifier would do (off -> full -> med -> off -> ...) + def toggle_night_light() + if self.nl_mode == NightLightMode.FULL + return self.set_night_light_mode(NightLightMode.LOW) + elif self.nl_mode == NightLightMode.LOW + return self.set_night_light_mode(NightLightMode.OFF) + else + return self.set_night_light_mode(NightLightMode.FULL) + end + end + + # Set child lock mode to given mode + def set_child_lock_mode(mode) + if self.init_counter != 0 + return + end + var msg = bytes("a5220705005a0100d100") + msg.add(mode.toint(), 1) + return ser.send(msg) != bytes() + end + + # Toggle chiled lock mode between off and on + def toggle_child_lock() + if self.cl_mode == ChildLockMode.ON + return self.set_child_lock_mode(ChildLockMode.OFF) + else + return self.set_child_lock_mode(ChildLockMode.ON) + end + end + + # Set sleep mode to given value + # Not if fan shall exit sleep mode the current fan speed mode needs to be re-set + def set_sleep_mode(mode) + if self.init_counter != 0 + return + end + if mode == SleepMode.ON + var msg = bytes("a522070500a501e0a50001") + return ser.send(msg) != bytes() + else + return self.set_fan_speed(self.fan_speed_mode) + end + end + + # Toggle sleep mode between off an on + def toggle_sleep_mode() + if self.sl_mode == SleepMode.ON + return self.set_sleep_mode(SleepMode.OFF) + else + return self.set_sleep_mode(SleepMode.ON) + end + end + + # Set display auto off mode to given mode + def set_display_auto_off_mode(mode) + if self.init_counter != 0 + return + end + var msg = bytes("a522070500210105a100") + if mode == DisplayAutoOffMode.ON + msg.add(0x00, 1) + else + msg.add(0x64, 1) + end + return ser.send(msg) != bytes() + end + + # Toggle display auto off mode between off an on + def toggle_display_auto_off() + if self.dp_auto_off_mode == DisplayAutoOffMode.ON + return self.set_display_auto_off_mode(DisplayAutoOffMode.OFF) + else + return self.set_display_auto_off_mode(DisplayAutoOffMode.ON) + end + end + + # Set timer (to auto turn off the air purifier) to given amount of seconds. + # Note: + # * Passing 0 will clear the current timer. + # * Maximum amount of seconds that is supported is 24*60*60 -1 + def set_timer(seconds) + if self.init_counter != 0 + return false + end + # check it timer if set and don't try to clean timer if not set + # (The stock firmware also checks if timer is set before it cleans it) + if seconds == 0 && self.timer_total == 0 + return true + end + var msg = bytes("a522080800210164a20000000000") + msg.set(10, seconds, 3) + return ser.send(msg) != bytes() + end + + # Parse a status message (for instance requested by query_status()) and set internal states accordingly + # Please note, on hardware button press on the air purifier the MCU will send a status messages by itself. + def parse_status_message(msg) + var filter_reset_msg = bytes("a522070400250165a200") + + if msg.size() == 22 # Generic status messsage + self.fan_mode = FanMode(msg[13]) + log_c2s(f"FanMode: {self.fan_mode.tostring()}") + self.sl_mode = SleepMode(msg[14]) + log_c2s(f"SleepMode: {self.sl_mode.tostring()}") + self.fan_speed_mode = FanSpeedMode(msg[15]) + log_c2s(f"FanSpeedMode: {self.fan_speed_mode.tostring()}") + self.dp_mode = DisplayMode(msg[16]) + log_c2s(f"DisplayMode: {self.dp_mode.tostring()}") + self.dp_auto_off_mode = DisplayAutoOffMode(msg[17]) + log_c2s(f"DisplayAutoOffMode: {self.dp_auto_off_mode.tostring()}") + self.cl_mode = ChildLockMode(msg[20]) + log_c2s(f"ChildLockMode: {self.cl_mode.tostring()}") + self.nl_mode = NightLightMode(msg[21]) + log_c2s(f"NightLightMode: {self.nl_mode.tostring()}") + + # When timer is set it sends a status message (but not a message that actually contains the timer values) + # Thus on each status update we should query if a timer has been set + if msg[1] == 0x22 + tasmota.delay(50) + self.query_timer() + end + elif filter_reset_msg == msg + # Filter reset is not implemented yet because the state of the filter is actually maintained on the esp not the MCU + info_c2s("Detected Filter Reset. Not Implemented...") + elif msg.size() == 18 # Timer statung message + self.timer_remaining = msg.get(10, 3) + self.timer_total = msg.get(14, 3) + log_c2s(f"TimerRemaining: {self.timer_remaining}") + log_c2s(f"TimerTotal: {self.timer_total}") + end + end + + def every_250ms() + # perform init commands if needed + self.init_cmds() + + var msg = ser.read_msg(true) + + while msg != bytes() + info_c2s(f"Incoming Message {msg.tohex()}") + + if msg[0] == 0xa5 + if msg[1] == 0x22 + # on received request (from the MCU) we need to send a generic reply + ser.send_nowait(bytes("a512000400a301604000")) + self.parse_status_message(msg) + elif msg[1] == 0x12 + self.parse_status_message(msg) + else + log_c2s("Unrecognized message type") + end + end + msg = ser.read_msg(true) + end + end + + def every_second() + self.second_counter += 1 + if self.second_counter == 60 + self.second_counter = 0 + self.set_wifi_led(tasmota.wifi("up")) + self.query_timer() + elif self.second_counter % 5 == 0 + if self.timer_total != 0 + self.query_timer() + end + end + + if ser.check_errors() + self.reinit_connection() + end + end + + def json_append() + tasmota.response_append(",\"C200S\":{") + + tasmota.response_append(f"\"FanSpeedMode\":\"{self.fan_speed_mode}\"") + tasmota.response_append(f",\"FanMode\":\"{self.fan_mode}\"") + tasmota.response_append(f",\"NightLightMode\":\"{self.nl_mode}\"") + tasmota.response_append(f",\"ChildLockMode\":\"{self.cl_mode}\"") + tasmota.response_append(f",\"SleepMode\":\"{self.sl_mode}\"") + tasmota.response_append(f",\"DisplayMode\":\"{self.dp_mode}\"") + tasmota.response_append(f",\"DisplayAutoOff\":\"{self.dp_auto_off_mode}\"") + tasmota.response_append(f",\"TimerTotal\":{self.timer_total}") + tasmota.response_append(f",\"TimerRemaining\":{self.timer_remaining}") + + tasmota.response_append("}") + end + + # Concert seconds to HH:MM:SS timer format + static def secondsToReadableTime(seconds) + var hours = seconds / 3600 + seconds -= hours * 3600 + var minutes = seconds / 60 + seconds -= minutes * 60 + return format("%02d:%02d:%02d", hours, minutes, seconds) + end + + def web_sensor() + var msg = format( + "{s}Fan Mode{m}%s{e}".. + "{s}Fan Speed{m}%s{e}".. + "{s}Night Light{m}%s{e}".. + "{s}Child Lock{m}%s{e}".. + "{s}Sleep Mode{m}%s{e}".. + "{s}Display Mode{m}%s{e}".. + "{s}Display Auto Off{m}%s{e}", + self.fan_mode, self.fan_speed_mode, self.nl_mode, self.cl_mode, + self.sl_mode, self.dp_mode, self.dp_auto_off_mode + ) + tasmota.web_send_decimal(msg) + + if self.timer_total != 0 + var timer_msg = format( + "{s}Timer Remaining{m}%s{e}".. + "{s}Timer Total{m}%s{e}", + self.secondsToReadableTime(self.timer_remaining), self.secondsToReadableTime(self.timer_total) + ) + tasmota.web_send_decimal(timer_msg) + else + tasmota.web_send_decimal("{s}Timer{m}not active{e}") + end + end + + def web_add_main_button() + var button_config = "" + webserver.content_send("

") + + webserver.content_send(format(button_config, "fan_mode", "Mode")) + webserver.content_send(format(button_config, "fan_speed", "Speed")) + webserver.content_send(format(button_config, "sleep_mode", "Sleep")) + + webserver.content_send("") + + webserver.content_send(format(button_config, "night_light", "Light")) + webserver.content_send(format(button_config, "child_lock", "Lock")) + webserver.content_send(format(button_config, "display_auto_off", "Display")) + + webserver.content_send("
") + + end + +end + +var c200s = Core200S() + +tasmota.add_driver(c200s) + +# valid payloads low, med, full, toggle +tasmota.add_cmd('C2S_fan_speed', def(cmd, idx, payload) + var res = false + if string.startswith(payload, "toggle") + res = c200s.toggle_fan_speed() + elif payload != "" + res = c200s.set_fan_speed(FanSpeedMode(payload)) + else + tasmota.resp_cmnd(format("{\"FanSpeedMode\": \"%s\"}", c200s.fan_speed_mode)) + return + end + + if res + tasmota.resp_cmnd_done() + end +end) + +# valid payloads on, off, toggle +tasmota.add_cmd('C2S_fan_mode', def(cmd, idx, payload) + var res = false + if string.startswith(payload, "toggle") + res = c200s.toggle_fan_mode() + elif payload != "" + res = c200s.set_fan_mode(FanMode(payload)) + else + tasmota.resp_cmnd(format("{\"FanMode\": \"%s\"}", c200s.fan_mode)) + return + end + + if res + tasmota.resp_cmnd_done() + end +end) + +# valid payloads on, off, toggle +tasmota.add_cmd('C2S_child_lock', def(cmd, idx, payload) + var res = false + if string.startswith(payload, "toggle") + res = c200s.toggle_child_lock() + elif payload != "" + res = c200s.set_child_lock_mode(ChildLockMode(payload)) + else + tasmota.resp_cmnd(format("{\"ChildLockMode\": \"%s\"}", c200s.cl_mode)) + return + end + + if res + tasmota.resp_cmnd_done() + end +end) + +# valid payloads off, low, full, toggle +tasmota.add_cmd('C2S_night_light', def(cmd, idx, payload) + var res = false + if string.startswith(payload, "toggle") + res = c200s.toggle_night_light() + elif payload != "" + res = c200s.set_night_light_mode(NightLightMode(payload)) + else + tasmota.resp_cmnd(format("{\"NightLightMode\": \"%s\"}", c200s.nl_mode)) + return + end + + if res + tasmota.resp_cmnd_done() + end +end) + +# valid payloads on, off, toggle +tasmota.add_cmd('C2S_sleep_mode', def(cmd, idx, payload) + var res = false + if string.startswith(payload, "toggle") + res = c200s.toggle_sleep_mode() + elif payload != "" + res = c200s.set_sleep_mode(SleepMode(payload)) + else + tasmota.resp_cmnd(format("{\"SleepMode\": \"%s\"}", c200s.sl_mode)) + return + end + + if res + tasmota.resp_cmnd_done() + end +end) + +# valid payloads on, off, toggle +tasmota.add_cmd('C2S_display_auto_off', def(cmd, idx, payload) + var res = false + if string.startswith(payload, "toggle") + res = c200s.toggle_display_auto_off() + elif payload != "" + res = c200s.set_display_auto_off_mode(DisplayAutoOffMode(payload)) + else + tasmota.resp_cmnd(format("{\"DisplayAutoOff\": \"%s\"}", c200s.dp_auto_off_mode)) + return + end + + if res + tasmota.resp_cmnd_done() + end +end) + +# valid payload amount of seconds (0 to clear timer) +tasmota.add_cmd('C2S_timer', def(cmd, idx, payload) + if payload != "" + var seconds = int(payload) + + if seconds >= 24*60*60 || seconds < 0 + # timer only supports max value of 24h - 1s + return + end + + if c200s.set_timer(seconds) + tasmota.resp_cmnd_done() + end + else + tasmota.resp_cmnd(format("{\"TimerTotal\":%d,\"TimerRemaining\":%d}", c200s.timer_total, c200s.timer_remaining)) + end +end) diff --git a/tasmota/displaydesc/Lanbon_L8_display.ini b/tasmota/displaydesc/Lanbon_L8_display.ini index 23ffc0f0730d..b1f66f350989 100644 --- a/tasmota/displaydesc/Lanbon_L8_display.ini +++ b/tasmota/displaydesc/Lanbon_L8_display.ini @@ -18,5 +18,19 @@ :2,00,00,00,02 :3,60,00,00,03 :i,20,21 -:TI1,38,0,4 +:UTI,FT6336U,I1,38,*,* +RD A0 +CP 02 +RTF +RT +:UTT +RDM 00 16 +MV 2 1 +RT +:UTX +MV 3 2 +RT +:UTY +MV 5 2 +RT # diff --git a/tasmota/displaydesc/M5stack_core2_display.ini b/tasmota/displaydesc/M5stack_core2_display.ini index 9426de46b10f..216e8b76d627 100644 --- a/tasmota/displaydesc/M5stack_core2_display.ini +++ b/tasmota/displaydesc/M5stack_core2_display.ini @@ -34,5 +34,19 @@ E1,0F,00,0E,14,03,11,07,31,C1,48,08,0F,0C,31,36,0F :2,C8,00,00,02 :3,68,00,00,85 :i,21,20 -:TI2,38,22,21 +:UTI,FT6336U,I2,38,22,21 +RD A0 +CP 02 +RTF +RT +:UTT +RDM 00 16 +MV 2 1 +RT +:UTX +MV 3 2 +RT +:UTY +MV 5 2 +RT # diff --git a/tasmota/include/tasmota_template.h b/tasmota/include/tasmota_template.h index 78343eb5a125..b1a9ee913ad8 100644 --- a/tasmota/include/tasmota_template.h +++ b/tasmota/include/tasmota_template.h @@ -166,8 +166,8 @@ enum UserSelectablePins { #ifdef ESP32 GPIO_KEY1_PD, GPIO_KEY1_INV_PD, GPIO_SWT1_PD, #endif - GPIO_I2S_DOUT, GPIO_I2S_BCLK, GPIO_I2S_WS, - GPIO_I2S_DIN, GPIO_I2S_BCLK_IN, GPIO_I2S_WS_IN, + GPIO_I2S_DOUT, GPIO_I2S_BCLK, GPIO_I2S_WS, GPIO_I2S_DIN, + GPIO_I2S_BCLK_IN, GPIO_I2S_WS_IN, // Spare since 20240603 GPIO_INTERRUPT, GPIO_MCP2515_CS, // MCP2515 Chip Select GPIO_HRG15_TX, GPIO_HRG15_RX, // Hydreon RG-15 rain sensor serial interface @@ -429,8 +429,8 @@ const char kSensorNames[] PROGMEM = #ifdef ESP32 D_SENSOR_BUTTON "_d|" D_SENSOR_BUTTON "_id|" D_SENSOR_SWITCH "_d|" #endif - D_SENSOR_I2S_DOUT "|" D_SENSOR_I2S_BCLK "|" D_SENSOR_I2S_WS "|" - D_SENSOR_I2S_DIN "|" D_SENSOR_I2S_BCLK_IN "|" D_SENSOR_I2S_WS_IN "|" + D_SENSOR_I2S_DOUT "|" D_SENSOR_I2S_BCLK "|" D_SENSOR_I2S_WS "|" D_SENSOR_I2S_DIN "|" + D_SENSOR_I2S_BCLK_IN "|" D_SENSOR_I2S_WS_IN "|" D_SENSOR_INTERRUPT "|" D_SENSOR_MCP2515_CS "|" D_SENSOR_HRG15_TX "|" D_SENSOR_HRG15_RX "|" @@ -600,10 +600,6 @@ const uint16_t kGpioNiceList[] PROGMEM = { AGPIO(GPIO_I2S_WS) + MAX_I2S, // I2S word select AGPIO(GPIO_I2S_DIN) + MAX_I2S, // I2S IN Data #endif -#ifdef USE_I2S - AGPIO(GPIO_I2S_BCLK_IN) + MAX_I2S, // I2S bit clock in - AGPIO(GPIO_I2S_WS_IN) + MAX_I2S, // I2S word select in -#endif #ifdef USE_SPI AGPIO(GPIO_SPI_MISO) + MAX_SPI, // SPI MISO diff --git a/tasmota/include/tasmota_version.h b/tasmota/include/tasmota_version.h index a46bf1d7d0ff..31371855c3d1 100644 --- a/tasmota/include/tasmota_version.h +++ b/tasmota/include/tasmota_version.h @@ -22,6 +22,6 @@ #define TASMOTA_SHA_SHORT // Filled by Github sed -const uint32_t TASMOTA_VERSION = 0x0E000004; // 14.0.0.4 +const uint32_t TASMOTA_VERSION = 0x0E010001; // 14.1.0.1 #endif // _TASMOTA_VERSION_H_ diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index 8bc62baae5a1..3692c6715250 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -1014,6 +1014,9 @@ #define USE_ZIGBEE_MAXTIME_LIGHT 60*60 // 1h #define USE_ZIGBEE_MAXTIME_LIFT 4*60*60 // 4h +// -- Matter support (ESP32 and variants) ---------------------------- +#define MATTER_ENABLED false // Is Matter enabled by default (ie `SO151 1`) + // -- Other sensors/drivers ----------------------- //#define USE_SHIFT595 // Add support for 74xx595 8-bit shift registers (+0k7 code) @@ -1239,6 +1242,10 @@ // #define BE_LV_WIDGET_TABVIEW // #define BE_LV_WIDGET_TILEVIEW +// -- Matter protocol --------------------------------- + // #define USE_MATTER_DEVICE // Enable Matter device support (+420KB) + // Enabled by default in standard ESP32 binary + #endif // ESP32 /*********************************************************************************************\ diff --git a/tasmota/tasmota_support/settings.ino b/tasmota/tasmota_support/settings.ino index 24dc0d636166..ca13e46a1382 100644 --- a/tasmota/tasmota_support/settings.ino +++ b/tasmota/tasmota_support/settings.ino @@ -1425,6 +1425,9 @@ void SettingsDefaultSet2(void) { #endif #endif // FIRMWARE_MINIMAL + // Matter + flag6.matter_enabled |= MATTER_ENABLED; + Settings->flag = flag; Settings->flag2 = flag2; Settings->flag3 = flag3; diff --git a/tasmota/tasmota_xdrv_driver/xdrv_121_gpioviewer.ino b/tasmota/tasmota_xdrv_driver/xdrv_121_gpioviewer.ino index 4e549ee508c3..0cce3bbf3772 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_121_gpioviewer.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_121_gpioviewer.ino @@ -30,6 +30,9 @@ * GvUrl 1 - Select default url (GV_BASE_URL) * GvUrl https://thelastoutpostworkshop.github.io/microcontroller_devkit/gpio_viewer_1_5/ * + * Note 20240602 + * - GVRelease 1.5.4 + * * Note 20240518 * - GVRelease 1.5.3 * @@ -62,7 +65,7 @@ #define GV_KEEP_ALIVE 1000 // milliseconds - If no activity after this do a heap size event anyway -const char *GVRelease = "1.5.3"; +const char *GVRelease = "1.5.4"; /*********************************************************************************************/ diff --git a/tasmota/tasmota_xdrv_driver/xdrv_42_0_i2s_audio_idf51.ino b/tasmota/tasmota_xdrv_driver/xdrv_42_0_i2s_audio_idf51.ino index 20a5b459c9b2..7b0545856955 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_42_0_i2s_audio_idf51.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_42_0_i2s_audio_idf51.ino @@ -1052,6 +1052,10 @@ void CmndI2SI2SRtttl(void) { } void CmndI2SMicRec(void) { + if (I2SPrepareRx()) { + ResponseCmndChar("I2S Mic not configured"); + return; + } if (audio_i2s_mp3.mp3ram == nullptr){ AddLog(LOG_LEVEL_DEBUG,PSTR("I2S: try late buffer allocation for mp3 encoder")); audio_i2s_mp3.mp3ram = special_malloc(preallocateCodecSize); diff --git a/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino b/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino index 59998d7fc27e..af3120d625ef 100755 --- a/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino @@ -2033,7 +2033,7 @@ void SML_Decode(uint8_t index) { } else { mp++; if (isdigit(*mp)) { - uint8_t skip = strtol((char*)mp, (char**)&mp, 10); + uint32_t skip = strtol((char*)mp, (char**)&mp, 10); cp += skip; } }