From a483991ba350a83587caa17efa0d46be2f69f9a5 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Sat, 4 Feb 2023 00:00:21 +0100 Subject: [PATCH] ESP32 preliminary support for Matter protocol, milestone 1 (commissioning) (#17871) * ESP32 preliminary support for Matter protocol, milestone 1 (commissioning) * Fix case --- CHANGELOG.md | 1 + lib/libesp32/berry/default/be_modtab.c | 6 + .../generate/Matter_generate_c.be | 121 + .../berry_matter/generate/be_matter_certs.h | 351 + .../generate/be_matter_clusters.h | 1572 ++++ .../berry_matter/generate/be_matter_opcodes.h | 29 + .../berry_matter/generate/matter_clusters.be | 7425 +++++++++++++++++ lib/libesp32/berry_matter/library.json | 17 + lib/libesp32/berry_matter/path.be | 2 + lib/libesp32/berry_matter/solidify_all.be | 86 + .../berry_matter/src/be_matter_counter.cpp | 266 + .../berry_matter/src/be_matter_module.c | 270 + .../src/be_matter_qrcode_min_js.h | 45 + .../berry_matter/src/be_matter_verhoeff.cpp | 105 + lib/libesp32/berry_matter/src/berry_tasmota.h | 8 + .../src/embedded/Matter_Base38.be | 71 + .../src/embedded/Matter_Commissioning.be | 632 ++ .../src/embedded/Matter_Commissioning_Data.be | 317 + .../src/embedded/Matter_Device.be | 508 ++ .../berry_matter/src/embedded/Matter_IM.be | 326 + .../src/embedded/Matter_IM_Data.be | 946 +++ .../src/embedded/Matter_Message.be | 407 + .../src/embedded/Matter_MessageHandler.be | 171 + .../src/embedded/Matter_Module.be | 46 + .../src/embedded/Matter_Plugin.be | 88 + .../src/embedded/Matter_Plugin_Relay.be | 52 + .../src/embedded/Matter_Plugin_core.be | 372 + .../src/embedded/Matter_Session.be | 574 ++ .../berry_matter/src/embedded/Matter_TLV.be | 874 ++ .../src/embedded/Matter_UDPServer.be | 187 + .../berry_matter/src/embedded/Matter_UI.be | 259 + .../src/embedded/Matter_inspect.be | 64 + .../berry_matter/src/embedded/matter.be | 4 + lib/libesp32/berry_matter/src/solidify/.keep | 0 .../src/solidify/solidified_Matter_Base38.h | 154 + .../solidified_Matter_Commissioning.h | 2430 ++++++ .../solidified_Matter_Commissioning_Data.h | 970 +++ .../src/solidify/solidified_Matter_Device.h | 2136 +++++ .../src/solidify/solidified_Matter_IM.h | 1274 +++ .../src/solidify/solidified_Matter_IM_Data.h | 4020 +++++++++ .../src/solidify/solidified_Matter_Message.h | 1227 +++ .../solidified_Matter_MessageHandler.h | 582 ++ .../src/solidify/solidified_Matter_Module.h | 90 + .../src/solidify/solidified_Matter_Plugin.h | 272 + .../solidify/solidified_Matter_Plugin_Relay.h | 118 + .../solidify/solidified_Matter_Plugin_core.h | 1053 +++ .../src/solidify/solidified_Matter_Session.h | 2239 +++++ .../src/solidify/solidified_Matter_TLV.h | 2909 +++++++ .../solidify/solidified_Matter_UDPServer.h | 626 ++ .../src/solidify/solidified_Matter_UI.h | 893 ++ .../src/solidify/solidified_Matter_inspect.h | 189 + .../src/solidify/solidified_matter.h | 7 + lib/libesp32/berry_tasmota/solidify_all.be | 5 +- .../src/embedded/autoconf_module.be | 2 +- pio-tools/gen-berry-structures.py | 2 +- .../xdrv_52_7_berry_embedded.ino | 5 + .../tasmota_xdrv_driver/xdrv_52_9_berry.ino | 3 + 57 files changed, 37404 insertions(+), 4 deletions(-) create mode 100644 lib/libesp32/berry_matter/generate/Matter_generate_c.be create mode 100644 lib/libesp32/berry_matter/generate/be_matter_certs.h create mode 100644 lib/libesp32/berry_matter/generate/be_matter_clusters.h create mode 100644 lib/libesp32/berry_matter/generate/be_matter_opcodes.h create mode 100644 lib/libesp32/berry_matter/generate/matter_clusters.be create mode 100644 lib/libesp32/berry_matter/library.json create mode 100644 lib/libesp32/berry_matter/path.be create mode 100755 lib/libesp32/berry_matter/solidify_all.be create mode 100644 lib/libesp32/berry_matter/src/be_matter_counter.cpp create mode 100644 lib/libesp32/berry_matter/src/be_matter_module.c create mode 100644 lib/libesp32/berry_matter/src/be_matter_qrcode_min_js.h create mode 100644 lib/libesp32/berry_matter/src/be_matter_verhoeff.cpp create mode 100644 lib/libesp32/berry_matter/src/berry_tasmota.h create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_Base38.be create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_Commissioning.be create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_Commissioning_Data.be create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_Device.be create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_IM.be create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_IM_Data.be create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_Message.be create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_MessageHandler.be create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_Module.be create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_Plugin.be create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Relay.be create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_Plugin_core.be create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_Session.be create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_TLV.be create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_UDPServer.be create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_UI.be create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_inspect.be create mode 100644 lib/libesp32/berry_matter/src/embedded/matter.be create mode 100644 lib/libesp32/berry_matter/src/solidify/.keep create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_Base38.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_Commissioning.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_Commissioning_Data.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_Device.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_IM.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_IM_Data.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_Message.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_MessageHandler.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_Module.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Relay.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_core.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_Session.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_TLV.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_UDPServer.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_UI.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_inspect.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_matter.h diff --git a/CHANGELOG.md b/CHANGELOG.md index 99b4e482f..3377495c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file. - support for SEN5X gas and air quality sensor by Tyeth Gundry (#17736) - Berry add ``mdns`` advanced features and query - ESP32 support for Biomine BioPDU 625x12 (#17857) +- ESP32 preliminary support for Matter protocol, milestone 1 (commissioning) ### Breaking Changed - Berry energy_ctypes changed with new energy driver diff --git a/lib/libesp32/berry/default/be_modtab.c b/lib/libesp32/berry/default/be_modtab.c index ad1844d0a..e95c65ba2 100644 --- a/lib/libesp32/berry/default/be_modtab.c +++ b/lib/libesp32/berry/default/be_modtab.c @@ -65,6 +65,9 @@ be_extern_native_module(lv_tasmota); be_extern_native_module(haspmota); #endif // USE_LVGL_HASPMOTA #endif // USE_LVGL +#ifdef USE_MATTER_DEVICE +be_extern_native_module(matter); +#endif // USE_MATTER_DEVICE /* user-defined modules declare start */ @@ -175,6 +178,9 @@ BERRY_LOCAL const bntvmodule* const be_module_table[] = { #ifdef USE_DISCOVERY &be_native_module(mdns), #endif // USE_DISCOVERY +#ifdef USE_MATTER_DEVICE + &be_native_module(matter), +#endif // USE_MATTER_DEVICE #endif // TASMOTA /* user-defined modules register end */ NULL /* do not remove */ diff --git a/lib/libesp32/berry_matter/generate/Matter_generate_c.be b/lib/libesp32/berry_matter/generate/Matter_generate_c.be new file mode 100644 index 000000000..6c9c13170 --- /dev/null +++ b/lib/libesp32/berry_matter/generate/Matter_generate_c.be @@ -0,0 +1,121 @@ +# ../../berry/berry -s -g Matter_generate_c.be +# +# generate C headers + +import matter_clusters +var c = matter_clusters + + +################################################################################# +# Simple insertion sort - sorts the list in place, and returns the list +################################################################################# +def sort(l) for i:1..size(l)-1 var k = l[i] var j = i while (j > 0) && (l[j-1] > k) l[j] = l[j-1] j -= 1 end l[j] = k end return l end + +# keys to llist +def k2l(m) var r=[] for k:m.keys() r.push(k) end return sort(r) end + +var cl_keys = {} +for cl:c + for k:cl.keys() + cl_keys[k] = true + end +end + +var attr_ids = {} +var attr_keys = {} +var attr_types = {} +for cl:c + for attr:cl['attributes'] + attr_ids[attr['attributeId']] = true + for k:attr.keys() + attr_keys[k] = true + end + attr_types[attr['type']] = true + end +end + +import string + +# prepare file +f=open("be_matter_clusters.h", "w") +def fprint(*l) + f.write(l.concat(" ")) + f.write("\n") +end + +# fprint("Cluster keys:",k2l(cl_keys)) +# fprint("Attribute ids:",k2l(attr_ids)) +# fprint("Attribute keys:",k2l(attr_keys)) +# fprint("Attribute types:",k2l(attr_types)) + +var cl_id_name = {} +for cl:c + cl_id_name[cl['clusterId']] = cl['clusterName'] +end +var cl_ids = k2l(cl_id_name) + +fprint("/*********************************************************************************\\") +fprint("* Compact form for attributes and clusters") +fprint("*") +fprint("* Generated content, do not edit") +fprint("\\*********************************************************************************/") +fprint() +fprint("typedef struct {") +fprint(" uint16_t id;") +fprint(" uint8_t type;") +fprint(" uint8_t flags;") +fprint(" const char* name;") +fprint("} matter_attribute_t;") +fprint() +fprint("typedef struct {") +fprint(" uint16_t id;") +fprint(" const char* name;") +fprint("} matter_command_t;") +fprint() +fprint("typedef struct {") +fprint(" uint16_t id;") +fprint(" const char* name;") +fprint(" const matter_attribute_t* attributes;") +fprint(" const matter_command_t* commands;") +fprint("} matter_cluster_t;") +fprint() +for cl:cl_ids + fprint(string.format("const matter_attribute_t matter_Attributes_%04X[] = {", cl)) + var attributes = c[cl_id_name[cl]]['attributes'] + var attr_id_name = {} + for attr:attributes + attr_id_name[attr['attributeId']] = attr['attributeName'] + end + var attr_ids_local = k2l(attr_id_name) + + for attr_id:attr_ids_local + fprint(string.format(' { 0x%04X, %i, 0x%02X, "%s" },', attr_id, 0, 0, attributes[attr_id]['attributeName'])) + end + fprint(' { 0xFFFF, 0, 0x00, NULL },') + fprint("};") + fprint() + # commands + fprint(string.format("const matter_command_t matter_Commands_%04X[] = {", cl)) + var commands = c[cl_id_name[cl]]['commands'] + var cmd_id_name = {} + for cmd:commands + cmd_id_name[cmd['commandId']] = cmd['commandName'] + end + var cmd_ids_local = k2l(cmd_id_name) + + for cmd_id:cmd_ids_local + fprint(string.format(' { 0x%04X, "%s" },', cmd_id, commands[cmd_id]['commandName'])) + end + fprint(' { 0xFFFF, NULL },') + fprint("};") + fprint() +end + +fprint("const matter_cluster_t matterAllClusters[] = {") +for cl:cl_ids + fprint(string.format(' { 0x%04X, "%s", matter_Attributes_%04X, matter_Commands_%04X },', cl, cl_id_name[cl], cl, cl)) +end + fprint(' { 0xFFFF, NULL, NULL },') +fprint("};") + +f.close() diff --git a/lib/libesp32/berry_matter/generate/be_matter_certs.h b/lib/libesp32/berry_matter/generate/be_matter_certs.h new file mode 100644 index 000000000..e3205013b --- /dev/null +++ b/lib/libesp32/berry_matter/generate/be_matter_certs.h @@ -0,0 +1,351 @@ +// Certificates and credentials from demo + +#include +#include + +const uint8_t kDevelopmentPAI_Cert_FFF1[463] = { + 0x30, 0x82, 0x01, 0xcb, 0x30, 0x82, 0x01, 0x71, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x56, 0xad, 0x82, 0x22, 0xad, 0x94, + 0x5b, 0x64, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x30, 0x31, 0x18, 0x30, 0x16, 0x06, + 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0f, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x50, 0x41, 0x41, + 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, 0x04, 0x46, 0x46, 0x46, + 0x31, 0x30, 0x20, 0x17, 0x0d, 0x32, 0x32, 0x30, 0x32, 0x30, 0x35, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x18, 0x0f, 0x39, + 0x39, 0x39, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x3d, 0x31, 0x25, 0x30, 0x23, 0x06, + 0x03, 0x55, 0x04, 0x03, 0x0c, 0x1c, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x44, 0x65, 0x76, 0x20, 0x50, 0x41, 0x49, 0x20, + 0x30, 0x78, 0x46, 0x46, 0x46, 0x31, 0x20, 0x6e, 0x6f, 0x20, 0x50, 0x49, 0x44, 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, 0x2b, 0x06, + 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, 0x04, 0x46, 0x46, 0x46, 0x31, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, + 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x41, + 0x9a, 0x93, 0x15, 0xc2, 0x17, 0x3e, 0x0c, 0x8c, 0x87, 0x6d, 0x03, 0xcc, 0xfc, 0x94, 0x48, 0x52, 0x64, 0x7f, 0x7f, 0xec, 0x5e, + 0x50, 0x82, 0xf4, 0x05, 0x99, 0x28, 0xec, 0xa8, 0x94, 0xc5, 0x94, 0x15, 0x13, 0x09, 0xac, 0x63, 0x1e, 0x4c, 0xb0, 0x33, 0x92, + 0xaf, 0x68, 0x4b, 0x0b, 0xaf, 0xb7, 0xe6, 0x5b, 0x3b, 0x81, 0x62, 0xc2, 0xf5, 0x2b, 0xf9, 0x31, 0xb8, 0xe7, 0x7a, 0xaa, 0x82, + 0xa3, 0x66, 0x30, 0x64, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, + 0x02, 0x01, 0x00, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x1d, + 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x63, 0x54, 0x0e, 0x47, 0xf6, 0x4b, 0x1c, 0x38, 0xd1, 0x38, 0x84, 0xa4, + 0x62, 0xd1, 0x6c, 0x19, 0x5d, 0x8f, 0xfb, 0x3c, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, + 0x6a, 0xfd, 0x22, 0x77, 0x1f, 0x51, 0x1f, 0xec, 0xbf, 0x16, 0x41, 0x97, 0x67, 0x10, 0xdc, 0xdc, 0x31, 0xa1, 0x71, 0x7e, 0x30, + 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x21, 0x00, 0xb2, 0xef, + 0x27, 0xf4, 0x9a, 0xe9, 0xb5, 0x0f, 0xb9, 0x1e, 0xea, 0xc9, 0x4c, 0x4d, 0x0b, 0xdb, 0xb8, 0xd7, 0x92, 0x9c, 0x6c, 0xb8, 0x8f, + 0xac, 0xe5, 0x29, 0x36, 0x8d, 0x12, 0x05, 0x4c, 0x0c, 0x02, 0x20, 0x65, 0x5d, 0xc9, 0x2b, 0x86, 0xbd, 0x90, 0x98, 0x82, 0xa6, + 0xc6, 0x21, 0x77, 0xb8, 0x25, 0xd7, 0xd0, 0x5e, 0xdb, 0xe7, 0xc2, 0x2f, 0x9f, 0xea, 0x71, 0x22, 0x0e, 0x7e, 0xa7, 0x03, 0xf8, + 0x91, +}; + +const uint8_t kDevelopmentPAI_PublicKey_FFF1[65] = { + 0x04, 0x41, 0x9a, 0x93, 0x15, 0xc2, 0x17, 0x3e, 0x0c, 0x8c, 0x87, 0x6d, 0x03, 0xcc, 0xfc, 0x94, 0x48, + 0x52, 0x64, 0x7f, 0x7f, 0xec, 0x5e, 0x50, 0x82, 0xf4, 0x05, 0x99, 0x28, 0xec, 0xa8, 0x94, 0xc5, 0x94, + 0x15, 0x13, 0x09, 0xac, 0x63, 0x1e, 0x4c, 0xb0, 0x33, 0x92, 0xaf, 0x68, 0x4b, 0x0b, 0xaf, 0xb7, 0xe6, + 0x5b, 0x3b, 0x81, 0x62, 0xc2, 0xf5, 0x2b, 0xf9, 0x31, 0xb8, 0xe7, 0x7a, 0xaa, 0x82, +}; +const uint8_t kDevelopmentPAI_PrivateKey_FFF1[32] = { + 0xc1, 0xab, 0x5f, 0xe2, 0x84, 0xb4, 0xc1, 0x89, 0x40, 0xa5, 0x31, 0x61, 0xf8, 0x06, 0x94, 0x40, + 0x50, 0xa1, 0x69, 0x7b, 0x71, 0x76, 0x1d, 0x38, 0x53, 0x37, 0xa8, 0xa3, 0xcd, 0x09, 0x5c, 0x34, +}; + +/* +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 56:ad:82:22:ad:94:5b:64 + Signature Algorithm: ecdsa-with-SHA256 + Issuer: CN = Matter Test PAA, 1.3.6.1.4.1.37244.2.1 = FFF1 + Validity + Not Before: Feb 5 00:00:00 2022 GMT + Not After : Dec 31 23:59:59 9999 GMT + Subject: CN = Matter Dev PAI 0xFFF1 no PID, 1.3.6.1.4.1.37244.2.1 = FFF1 + Subject Public Key Info: + Public Key Algorithm: id-ecPublicKey + Public-Key: (256 bit) + pub: + 04:41:9a:93:15:c2:17:3e:0c:8c:87:6d:03:cc:fc: + 94:48:52:64:7f:7f:ec:5e:50:82:f4:05:99:28:ec: + a8:94:c5:94:15:13:09:ac:63:1e:4c:b0:33:92:af: + 68:4b:0b:af:b7:e6:5b:3b:81:62:c2:f5:2b:f9:31: + b8:e7:7a:aa:82 + ASN1 OID: prime256v1 + NIST CURVE: P-256 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE, pathlen:0 + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + 63:54:0E:47:F6:4B:1C:38:D1:38:84:A4:62:D1:6C:19:5D:8F:FB:3C + X509v3 Authority Key Identifier: + keyid:6A:FD:22:77:1F:51:1F:EC:BF:16:41:97:67:10:DC:DC:31:A1:71:7E + + Signature Algorithm: ecdsa-with-SHA256 + 30:45:02:21:00:b2:ef:27:f4:9a:e9:b5:0f:b9:1e:ea:c9:4c: + 4d:0b:db:b8:d7:92:9c:6c:b8:8f:ac:e5:29:36:8d:12:05:4c: + 0c:02:20:65:5d:c9:2b:86:bd:90:98:82:a6:c6:21:77:b8:25: + d7:d0:5e:db:e7:c2:2f:9f:ea:71:22:0e:7e:a7:03:f8:91 +*/ + +/* +ASN.1 + +SEQUENCE (3 elem) + SEQUENCE (8 elem) + [0] (1 elem) + INTEGER 2 + INTEGER (63 bit) 6245791343685426020 + SEQUENCE (1 elem) + OBJECT IDENTIFIER 1.2.840.10045.4.3.2 ecdsaWithSHA256 (ANSI X9.62 ECDSA algorithm with SHA256) + SEQUENCE (2 elem) + SET (1 elem) + SEQUENCE (2 elem) + OBJECT IDENTIFIER 2.5.4.3 commonName (X.520 DN component) + UTF8String Matter Test PAA + SET (1 elem) + SEQUENCE (2 elem) + OBJECT IDENTIFIER 1.3.6.1.4.1.37244.2.1 + UTF8String FFF1 + SEQUENCE (2 elem) + UTCTime 2022-02-05 00:00:00 UTC + GeneralizedTime 9999-12-31 23:59:59 UTC + SEQUENCE (2 elem) + SET (1 elem) + SEQUENCE (2 elem) + OBJECT IDENTIFIER 2.5.4.3 commonName (X.520 DN component) + UTF8String Matter Dev PAI 0xFFF1 no PID + SET (1 elem) + SEQUENCE (2 elem) + OBJECT IDENTIFIER 1.3.6.1.4.1.37244.2.1 + UTF8String FFF1 + SEQUENCE (2 elem) + SEQUENCE (2 elem) + OBJECT IDENTIFIER 1.2.840.10045.2.1 ecPublicKey (ANSI X9.62 public key type) + OBJECT IDENTIFIER 1.2.840.10045.3.1.7 prime256v1 (ANSI X9.62 named elliptic curve) + BIT STRING (520 bit) 0000010001000001100110101001001100010101110000100001011100111110000011… + [3] (1 elem) + SEQUENCE (4 elem) + SEQUENCE (3 elem) + OBJECT IDENTIFIER 2.5.29.19 basicConstraints (X.509 extension) + BOOLEAN true + OCTET STRING (8 byte) 30060101FF020100 + SEQUENCE (2 elem) + BOOLEAN true + INTEGER 0 + SEQUENCE (3 elem) + OBJECT IDENTIFIER 2.5.29.15 keyUsage (X.509 extension) + BOOLEAN true + OCTET STRING (4 byte) 03020106 + BIT STRING (7 bit) 0000011 + SEQUENCE (2 elem) + OBJECT IDENTIFIER 2.5.29.14 subjectKeyIdentifier (X.509 extension) + OCTET STRING (22 byte) 041463540E47F64B1C38D13884A462D16C195D8FFB3C + OCTET STRING (20 byte) 63540E47F64B1C38D13884A462D16C195D8FFB3C + SEQUENCE (2 elem) + OBJECT IDENTIFIER 2.5.29.35 authorityKeyIdentifier (X.509 extension) + OCTET STRING (24 byte) 301680146AFD22771F511FECBF1641976710DCDC31A1717E + SEQUENCE (1 elem) + [0] (20 byte) 6AFD22771F511FECBF1641976710DCDC31A1717E + SEQUENCE (1 elem) +Offset: 377 +Length: 2+10 +(constructed) +Value: +(1 elem) + OBJECT IDENTIFIER 1.2.840.10045.4.3.2 ecdsaWithSHA256 (ANSI X9.62 ECDSA algorithm with SHA256) + BIT STRING (568 bit) 0011000001000101000000100010000100000000101100101110111100100111111101… + SEQUENCE (2 elem) + INTEGER (256 bit) 8093423925895219711386938045632983408737245943652937189339272815747009… + INTEGER (255 bit) 4584930290841753608947726397552150715869097421278636946745345682393985… +*/ + +const uint8_t kDevelopmentDAC_Cert_FFF1_8000[493] = { + 0x30, 0x82, 0x01, 0xe9, 0x30, 0x82, 0x01, 0x8e, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x23, 0x8a, 0x64, 0x7b, 0xbc, 0x4c, + 0x30, 0xdd, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x3d, 0x31, 0x25, 0x30, 0x23, 0x06, + 0x03, 0x55, 0x04, 0x03, 0x0c, 0x1c, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x44, 0x65, 0x76, 0x20, 0x50, 0x41, 0x49, 0x20, + 0x30, 0x78, 0x46, 0x46, 0x46, 0x31, 0x20, 0x6e, 0x6f, 0x20, 0x50, 0x49, 0x44, 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, 0x2b, 0x06, + 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, 0x04, 0x46, 0x46, 0x46, 0x31, 0x30, 0x20, 0x17, 0x0d, 0x32, 0x32, 0x30, + 0x32, 0x30, 0x35, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x18, 0x0f, 0x39, 0x39, 0x39, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, + 0x33, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x53, 0x31, 0x25, 0x30, 0x23, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x1c, 0x4d, 0x61, + 0x74, 0x74, 0x65, 0x72, 0x20, 0x44, 0x65, 0x76, 0x20, 0x44, 0x41, 0x43, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x31, 0x2f, 0x30, + 0x78, 0x38, 0x30, 0x30, 0x30, 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, + 0x0c, 0x04, 0x46, 0x46, 0x46, 0x31, 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, + 0x02, 0x0c, 0x04, 0x38, 0x30, 0x30, 0x30, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, + 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x62, 0xdb, 0x16, 0xba, 0xde, 0xa3, 0x26, 0xa6, + 0xdb, 0x84, 0x81, 0x4a, 0x06, 0x3f, 0xc6, 0xc7, 0xe9, 0xe2, 0xb1, 0x01, 0xb7, 0x21, 0x64, 0x8e, 0xba, 0x4e, 0x5a, 0xc8, 0x40, + 0xf5, 0xda, 0x30, 0x1e, 0xe6, 0x18, 0x12, 0x4e, 0xb4, 0x18, 0x0e, 0x2f, 0xc3, 0xa2, 0x04, 0x7a, 0x56, 0x4b, 0xa9, 0xbc, 0xfa, + 0x0b, 0xf7, 0x1f, 0x60, 0xce, 0x89, 0x30, 0xf1, 0xe7, 0xf6, 0x6e, 0xc8, 0xd7, 0x28, 0xa3, 0x60, 0x30, 0x5e, 0x30, 0x0c, 0x06, + 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, + 0x04, 0x04, 0x03, 0x02, 0x07, 0x80, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xbc, 0xf7, 0xb0, 0x07, + 0x49, 0x70, 0x63, 0x60, 0x6a, 0x26, 0xbe, 0x4e, 0x08, 0x7c, 0x59, 0x56, 0x87, 0x74, 0x5a, 0x5a, 0x30, 0x1f, 0x06, 0x03, 0x55, + 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x63, 0x54, 0x0e, 0x47, 0xf6, 0x4b, 0x1c, 0x38, 0xd1, 0x38, 0x84, 0xa4, 0x62, + 0xd1, 0x6c, 0x19, 0x5d, 0x8f, 0xfb, 0x3c, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x49, + 0x00, 0x30, 0x46, 0x02, 0x21, 0x00, 0x97, 0x97, 0x11, 0xec, 0x9e, 0x76, 0x18, 0xce, 0x41, 0x80, 0x11, 0x32, 0xc2, 0x50, 0xdb, + 0x70, 0x76, 0x74, 0x63, 0x0c, 0xd5, 0x8c, 0x12, 0xc6, 0xe2, 0x31, 0x5f, 0x08, 0xd0, 0x1e, 0xe1, 0x78, 0x02, 0x21, 0x00, 0xec, + 0xfc, 0x13, 0x06, 0xbd, 0x2a, 0x13, 0x3d, 0x12, 0x2a, 0x27, 0x86, 0x10, 0xea, 0x3d, 0xca, 0x47, 0xf0, 0x5c, 0x7a, 0x8b, 0x80, + 0x5f, 0xa7, 0x1c, 0x6f, 0xf4, 0x15, 0x38, 0xa8, 0x64, 0xc8, +}; + +/* +Decoded cert: openssl x509 -inform der -in DAC_Cert_FFF1_8000.der -text -noout + +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 23:8a:64:7b:bc:4c:30:dd + Signature Algorithm: ecdsa-with-SHA256 + Issuer: CN = Matter Dev PAI 0xFFF1 no PID, 1.3.6.1.4.1.37244.2.1 = FFF1 + Validity + Not Before: Feb 5 00:00:00 2022 GMT + Not After : Dec 31 23:59:59 9999 GMT + Subject: CN = Matter Dev DAC 0xFFF1/0x8000, 1.3.6.1.4.1.37244.2.1 = FFF1, 1.3.6.1.4.1.37244.2.2 = 8000 + Subject Public Key Info: + Public Key Algorithm: id-ecPublicKey + Public-Key: (256 bit) + pub: + 04:62:db:16:ba:de:a3:26:a6:db:84:81:4a:06:3f: + c6:c7:e9:e2:b1:01:b7:21:64:8e:ba:4e:5a:c8:40: + f5:da:30:1e:e6:18:12:4e:b4:18:0e:2f:c3:a2:04: + 7a:56:4b:a9:bc:fa:0b:f7:1f:60:ce:89:30:f1:e7: + f6:6e:c8:d7:28 + ASN1 OID: prime256v1 + NIST CURVE: P-256 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:FALSE + X509v3 Key Usage: critical + Digital Signature + X509v3 Subject Key Identifier: + BC:F7:B0:07:49:70:63:60:6A:26:BE:4E:08:7C:59:56:87:74:5A:5A + X509v3 Authority Key Identifier: + keyid:63:54:0E:47:F6:4B:1C:38:D1:38:84:A4:62:D1:6C:19:5D:8F:FB:3C + + Signature Algorithm: ecdsa-with-SHA256 + 30:46:02:21:00:97:97:11:ec:9e:76:18:ce:41:80:11:32:c2: + 50:db:70:76:74:63:0c:d5:8c:12:c6:e2:31:5f:08:d0:1e:e1: + 78:02:21:00:ec:fc:13:06:bd:2a:13:3d:12:2a:27:86:10:ea: + 3d:ca:47:f0:5c:7a:8b:80:5f:a7:1c:6f:f4:15:38:a8:64:c8 + +*/ + +/* Decoded ASN.1 + +SEQUENCE (3 elem) + SEQUENCE (8 elem) + [0] (1 elem) + INTEGER 2 + INTEGER (62 bit) 2560969820716413149 + SEQUENCE (1 elem) + OBJECT IDENTIFIER 1.2.840.10045.4.3.2 ecdsaWithSHA256 (ANSI X9.62 ECDSA algorithm with SHA256) + SEQUENCE (2 elem) + SET (1 elem) + SEQUENCE (2 elem) + OBJECT IDENTIFIER 2.5.4.3 commonName (X.520 DN component) + UTF8String Matter Dev PAI 0xFFF1 no PID + SET (1 elem) + SEQUENCE (2 elem) + OBJECT IDENTIFIER 1.3.6.1.4.1.37244.2.1 + UTF8String FFF1 + SEQUENCE (2 elem) + UTCTime 2022-02-05 00:00:00 UTC + GeneralizedTime 9999-12-31 23:59:59 UTC + SEQUENCE (3 elem) + SET (1 elem) + SEQUENCE (2 elem) + OBJECT IDENTIFIER 2.5.4.3 commonName (X.520 DN component) + UTF8String Matter Dev DAC 0xFFF1/0x8000 + SET (1 elem) + SEQUENCE (2 elem) + OBJECT IDENTIFIER 1.3.6.1.4.1.37244.2.1 + UTF8String FFF1 + SET (1 elem) + SEQUENCE (2 elem) + OBJECT IDENTIFIER 1.3.6.1.4.1.37244.2.2 + UTF8String 8000 + SEQUENCE (2 elem) + SEQUENCE (2 elem) + OBJECT IDENTIFIER 1.2.840.10045.2.1 ecPublicKey (ANSI X9.62 public key type) + OBJECT IDENTIFIER 1.2.840.10045.3.1.7 prime256v1 (ANSI X9.62 named elliptic curve) + BIT STRING (520 bit) 0000010001100010110110110001011010111010110111101010001100100110101001… + [3] (1 elem) + SEQUENCE (4 elem) + SEQUENCE (3 elem) + OBJECT IDENTIFIER 2.5.29.19 basicConstraints (X.509 extension) + BOOLEAN true + OCTET STRING (2 byte) 3000 + SEQUENCE (0 elem) + SEQUENCE (3 elem) + OBJECT IDENTIFIER 2.5.29.15 keyUsage (X.509 extension) + BOOLEAN true + OCTET STRING (4 byte) 03020780 + BIT STRING (1 bit) 1 + SEQUENCE (2 elem) + OBJECT IDENTIFIER 2.5.29.14 subjectKeyIdentifier (X.509 extension) + OCTET STRING (22 byte) 0414BCF7B007497063606A26BE4E087C595687745A5A + OCTET STRING (20 byte) BCF7B007497063606A26BE4E087C595687745A5A + SEQUENCE (2 elem) + OBJECT IDENTIFIER 2.5.29.35 authorityKeyIdentifier (X.509 extension) + OCTET STRING (24 byte) 3016801463540E47F64B1C38D13884A462D16C195D8FFB3C + SEQUENCE (1 elem) + [0] (20 byte) 63540E47F64B1C38D13884A462D16C195D8FFB3C + SEQUENCE (1 elem) + OBJECT IDENTIFIER 1.2.840.10045.4.3.2 ecdsaWithSHA256 (ANSI X9.62 ECDSA algorithm with SHA256) + BIT STRING (576 bit) 0011000001000110000000100010000100000000100101111001011100010001111011… + SEQUENCE (2 elem) + INTEGER (256 bit) 6856615775177799389454949658700013485116050405241433595512074226650010… + INTEGER (256 bit) 1071912090408366213691559168363210336766445086127676108978024779974417… +*/ + +const uint8_t kDevelopmentDAC_PublicKey_FFF1_8000[65] = { + 0x04, 0x62, 0xdb, 0x16, 0xba, 0xde, 0xa3, 0x26, 0xa6, 0xdb, 0x84, 0x81, 0x4a, 0x06, 0x3f, 0xc6, 0xc7, + 0xe9, 0xe2, 0xb1, 0x01, 0xb7, 0x21, 0x64, 0x8e, 0xba, 0x4e, 0x5a, 0xc8, 0x40, 0xf5, 0xda, 0x30, 0x1e, + 0xe6, 0x18, 0x12, 0x4e, 0xb4, 0x18, 0x0e, 0x2f, 0xc3, 0xa2, 0x04, 0x7a, 0x56, 0x4b, 0xa9, 0xbc, 0xfa, + 0x0b, 0xf7, 0x1f, 0x60, 0xce, 0x89, 0x30, 0xf1, 0xe7, 0xf6, 0x6e, 0xc8, 0xd7, 0x28, +}; + +const uint8_t kDevelopmentDAC_PrivateKey_FFF1_8000[32] = { + 0xcc, 0xcf, 0x9d, 0xc7, 0x05, 0x0e, 0xf5, 0xd9, 0x0b, 0xe4, 0x57, 0x07, 0xb9, 0x0e, 0x1f, 0x87, + 0x5d, 0x59, 0xbe, 0x1f, 0xa9, 0x42, 0xe8, 0xed, 0x2e, 0x42, 0x72, 0x03, 0xf6, 0xc2, 0xee, 0x3d, +}; + +/* CertificationDeclaration */ +//-> format_version = 1 +//-> vendor_id = 0xFFF1 +//-> product_id_array = [ 0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007, 0x8008, 0x8009, 0x800A, 0x800B, +// 0x800C, 0x800D, 0x800E, 0x800F, 0x8010, 0x8011, 0x8012, 0x8013, 0x8014, 0x8015, 0x8016, 0x8017, 0x8018, 0x8019, 0x801A, +// 0x801B, 0x801C, 0x801D, 0x801E, 0x801F, 0x8020, 0x8021, 0x8022, 0x8023, 0x8024, 0x8025, 0x8026, 0x8027, 0x8028, 0x8029, +// 0x802A, 0x802B, 0x802C, 0x802D, 0x802E, 0x802F, 0x8030, 0x8031, 0x8032, 0x8033, 0x8034, 0x8035, 0x8036, 0x8037, 0x8038, +// 0x8039, 0x803A, 0x803B, 0x803C, 0x803D, 0x803E, 0x803F, 0x8040, 0x8041, 0x8042, 0x8043, 0x8044, 0x8045, 0x8046, 0x8047, +// 0x8048, 0x8049, 0x804A, 0x804B, 0x804C, 0x804D, 0x804E, 0x804F, 0x8050, 0x8051, 0x8052, 0x8053, 0x8054, 0x8055, 0x8056, +// 0x8057, 0x8058, 0x8059, 0x805A, 0x805B, 0x805C, 0x805D, 0x805E, 0x805F, 0x8060, 0x8061, 0x8062, 0x8063 ] +//-> device_type_id = 0x0016 +//-> certificate_id = "CSA00000SWC00000-00" +//-> security_level = 0 +//-> security_information = 0 +//-> version_number = 1 +//-> certification_type = 0 +//-> dac_origin_vendor_id is not present +//-> dac_origin_product_id is not present +const uint8_t kCdForAllExamples[539] = { + 0x30, 0x82, 0x02, 0x17, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x02, 0x08, 0x30, + 0x82, 0x02, 0x04, 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, + 0x01, 0x30, 0x82, 0x01, 0x70, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, 0x01, 0x61, + 0x04, 0x82, 0x01, 0x5d, 0x15, 0x24, 0x00, 0x01, 0x25, 0x01, 0xf1, 0xff, 0x36, 0x02, 0x05, 0x00, 0x80, 0x05, 0x01, 0x80, + 0x05, 0x02, 0x80, 0x05, 0x03, 0x80, 0x05, 0x04, 0x80, 0x05, 0x05, 0x80, 0x05, 0x06, 0x80, 0x05, 0x07, 0x80, 0x05, 0x08, + 0x80, 0x05, 0x09, 0x80, 0x05, 0x0a, 0x80, 0x05, 0x0b, 0x80, 0x05, 0x0c, 0x80, 0x05, 0x0d, 0x80, 0x05, 0x0e, 0x80, 0x05, + 0x0f, 0x80, 0x05, 0x10, 0x80, 0x05, 0x11, 0x80, 0x05, 0x12, 0x80, 0x05, 0x13, 0x80, 0x05, 0x14, 0x80, 0x05, 0x15, 0x80, + 0x05, 0x16, 0x80, 0x05, 0x17, 0x80, 0x05, 0x18, 0x80, 0x05, 0x19, 0x80, 0x05, 0x1a, 0x80, 0x05, 0x1b, 0x80, 0x05, 0x1c, + 0x80, 0x05, 0x1d, 0x80, 0x05, 0x1e, 0x80, 0x05, 0x1f, 0x80, 0x05, 0x20, 0x80, 0x05, 0x21, 0x80, 0x05, 0x22, 0x80, 0x05, + 0x23, 0x80, 0x05, 0x24, 0x80, 0x05, 0x25, 0x80, 0x05, 0x26, 0x80, 0x05, 0x27, 0x80, 0x05, 0x28, 0x80, 0x05, 0x29, 0x80, + 0x05, 0x2a, 0x80, 0x05, 0x2b, 0x80, 0x05, 0x2c, 0x80, 0x05, 0x2d, 0x80, 0x05, 0x2e, 0x80, 0x05, 0x2f, 0x80, 0x05, 0x30, + 0x80, 0x05, 0x31, 0x80, 0x05, 0x32, 0x80, 0x05, 0x33, 0x80, 0x05, 0x34, 0x80, 0x05, 0x35, 0x80, 0x05, 0x36, 0x80, 0x05, + 0x37, 0x80, 0x05, 0x38, 0x80, 0x05, 0x39, 0x80, 0x05, 0x3a, 0x80, 0x05, 0x3b, 0x80, 0x05, 0x3c, 0x80, 0x05, 0x3d, 0x80, + 0x05, 0x3e, 0x80, 0x05, 0x3f, 0x80, 0x05, 0x40, 0x80, 0x05, 0x41, 0x80, 0x05, 0x42, 0x80, 0x05, 0x43, 0x80, 0x05, 0x44, + 0x80, 0x05, 0x45, 0x80, 0x05, 0x46, 0x80, 0x05, 0x47, 0x80, 0x05, 0x48, 0x80, 0x05, 0x49, 0x80, 0x05, 0x4a, 0x80, 0x05, + 0x4b, 0x80, 0x05, 0x4c, 0x80, 0x05, 0x4d, 0x80, 0x05, 0x4e, 0x80, 0x05, 0x4f, 0x80, 0x05, 0x50, 0x80, 0x05, 0x51, 0x80, + 0x05, 0x52, 0x80, 0x05, 0x53, 0x80, 0x05, 0x54, 0x80, 0x05, 0x55, 0x80, 0x05, 0x56, 0x80, 0x05, 0x57, 0x80, 0x05, 0x58, + 0x80, 0x05, 0x59, 0x80, 0x05, 0x5a, 0x80, 0x05, 0x5b, 0x80, 0x05, 0x5c, 0x80, 0x05, 0x5d, 0x80, 0x05, 0x5e, 0x80, 0x05, + 0x5f, 0x80, 0x05, 0x60, 0x80, 0x05, 0x61, 0x80, 0x05, 0x62, 0x80, 0x05, 0x63, 0x80, 0x18, 0x24, 0x03, 0x16, 0x2c, 0x04, + 0x13, 0x43, 0x53, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x53, 0x57, 0x43, 0x30, 0x30, 0x30, 0x30, 0x30, 0x2d, 0x30, 0x30, + 0x24, 0x05, 0x00, 0x24, 0x06, 0x00, 0x24, 0x07, 0x01, 0x24, 0x08, 0x00, 0x18, 0x31, 0x7c, 0x30, 0x7a, 0x02, 0x01, 0x03, + 0x80, 0x14, 0xfe, 0x34, 0x3f, 0x95, 0x99, 0x47, 0x76, 0x3b, 0x61, 0xee, 0x45, 0x39, 0x13, 0x13, 0x38, 0x49, 0x4f, 0xe6, + 0x7d, 0x8e, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x0a, 0x06, 0x08, 0x2a, + 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x04, 0x46, 0x30, 0x44, 0x02, 0x20, 0x4a, 0x12, 0xf8, 0xd4, 0x2f, 0x90, 0x23, + 0x5c, 0x05, 0xa7, 0x71, 0x21, 0xcb, 0xeb, 0xae, 0x15, 0xd5, 0x90, 0x14, 0x65, 0x58, 0xe9, 0xc9, 0xb4, 0x7a, 0x1a, 0x38, + 0xf7, 0xa3, 0x6a, 0x7d, 0xc5, 0x02, 0x20, 0x20, 0xa4, 0x74, 0x28, 0x97, 0xc3, 0x0a, 0xed, 0xa0, 0xa5, 0x6b, 0x36, 0xe1, + 0x4e, 0xbb, 0xc8, 0x5b, 0xbd, 0xb7, 0x44, 0x93, 0xf9, 0x93, 0x58, 0x1e, 0xb0, 0x44, 0x4e, 0xd6, 0xca, 0x94, 0x0b +}; diff --git a/lib/libesp32/berry_matter/generate/be_matter_clusters.h b/lib/libesp32/berry_matter/generate/be_matter_clusters.h new file mode 100644 index 000000000..fc9171ce6 --- /dev/null +++ b/lib/libesp32/berry_matter/generate/be_matter_clusters.h @@ -0,0 +1,1572 @@ +/*********************************************************************************\ +* Compact form for attributes and clusters +* +* Generated content, do not edit +\*********************************************************************************/ +#include +#include + +typedef struct { + uint16_t id; + uint8_t type; + uint8_t flags; + const char* name; +} matter_attribute_t; + +typedef struct { + uint16_t id; + const char* name; +} matter_command_t; + +typedef struct { + uint16_t id; + const char* name; + const matter_attribute_t* attributes; + const matter_command_t* commands; +} matter_cluster_t; + +const matter_attribute_t matter_Attributes_0003[] = { + { 0x0000, 0, 0x00, "IdentifyTime" }, + { 0x0001, 0, 0x00, "IdentifyType" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0003[] = { + { 0x0000, "Identify" }, + { 0x0040, "TriggerEffect" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0004[] = { + { 0x0000, 0, 0x00, "NameSupport" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0004[] = { + { 0x0000, "AddGroup" }, + { 0x0001, "ViewGroup" }, + { 0x0002, "GetGroupMembership" }, + { 0x0003, "RemoveGroup" }, + { 0x0004, "RemoveAllGroups" }, + { 0x0005, "AddGroupIfIdentifying" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0005[] = { + { 0x0000, 0, 0x00, "SceneCount" }, + { 0x0001, 0, 0x00, "CurrentScene" }, + { 0x0002, 0, 0x00, "CurrentGroup" }, + { 0x0003, 0, 0x00, "SceneValid" }, + { 0x0004, 0, 0x00, "NameSupport" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0005[] = { + { 0x0000, "AddScene" }, + { 0x0001, "ViewScene" }, + { 0x0002, "RemoveScene" }, + { 0x0003, "RemoveAllScenes" }, + { 0x0004, "StoreScene" }, + { 0x0005, "RecallScene" }, + { 0x0006, "GetSceneMembership" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0006[] = { + { 0x0000, 0, 0x00, "OnOff" }, + { 0x4000, 0, 0x00, "GlobalSceneControl" }, + { 0x4001, 0, 0x00, "OnTime" }, + { 0x4002, 0, 0x00, "OffWaitTime" }, + { 0x4003, 0, 0x00, "StartUpOnOff" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0006[] = { + { 0x0000, "Off" }, + { 0x0001, "On" }, + { 0x0002, "Toggle" }, + { 0x0040, "OffWithEffect" }, + { 0x0041, "OnWithRecallGlobalScene" }, + { 0x0042, "OnWithTimedOff" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0007[] = { + { 0x0000, 0, 0x00, "SwitchType" }, + { 0x0010, 0, 0x00, "SwitchActions" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0007[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0008[] = { + { 0x0000, 0, 0x00, "CurrentLevel" }, + { 0x0001, 0, 0x00, "RemainingTime" }, + { 0x0002, 0, 0x00, "MinLevel" }, + { 0x0003, 0, 0x00, "MaxLevel" }, + { 0x0004, 0, 0x00, "CurrentFrequency" }, + { 0x0005, 0, 0x00, "MinFrequency" }, + { 0x0006, 0, 0x00, "MaxFrequency" }, + { 0x000F, 0, 0x00, "Options" }, + { 0x0010, 0, 0x00, "OnOffTransitionTime" }, + { 0x0011, 0, 0x00, "OnLevel" }, + { 0x0012, 0, 0x00, "OnTransitionTime" }, + { 0x0013, 0, 0x00, "OffTransitionTime" }, + { 0x0014, 0, 0x00, "DefaultMoveRate" }, + { 0x4000, 0, 0x00, "StartUpCurrentLevel" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0008[] = { + { 0x0000, "MoveToLevel" }, + { 0x0001, "Move" }, + { 0x0002, "Step" }, + { 0x0003, "Stop" }, + { 0x0004, "MoveToLevelWithOnOff" }, + { 0x0005, "MoveWithOnOff" }, + { 0x0006, "StepWithOnOff" }, + { 0x0007, "StopWithOnOff" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_000F[] = { + { 0x0051, 0, 0x00, "OutOfService" }, + { 0x0055, 0, 0x00, "PresentValue" }, + { 0x006F, 0, 0x00, "StatusFlags" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_000F[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_001D[] = { + { 0x0000, 0, 0x00, "DeviceTypeList" }, + { 0x0001, 0, 0x00, "ServerList" }, + { 0x0002, 0, 0x00, "ClientList" }, + { 0x0003, 0, 0x00, "PartsList" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_001D[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_001E[] = { + { 0x0000, 0, 0x00, "Binding" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_001E[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_001F[] = { + { 0x0000, 0, 0x00, "Acl" }, + { 0x0001, 0, 0x00, "Extension" }, + { 0x0002, 0, 0x00, "SubjectsPerAccessControlEntry" }, + { 0x0003, 0, 0x00, "TargetsPerAccessControlEntry" }, + { 0x0004, 0, 0x00, "AccessControlEntriesPerFabric" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_001F[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0025[] = { + { 0x0000, 0, 0x00, "ActionList" }, + { 0x0001, 0, 0x00, "EndpointLists" }, + { 0x0002, 0, 0x00, "SetupURL" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0025[] = { + { 0x0000, "InstantAction" }, + { 0x0001, "InstantActionWithTransition" }, + { 0x0002, "StartAction" }, + { 0x0003, "StartActionWithDuration" }, + { 0x0004, "StopAction" }, + { 0x0005, "PauseAction" }, + { 0x0006, "PauseActionWithDuration" }, + { 0x0007, "ResumeAction" }, + { 0x0008, "EnableAction" }, + { 0x0009, "EnableActionWithDuration" }, + { 0x000A, "DisableAction" }, + { 0x000B, "DisableActionWithDuration" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0028[] = { + { 0x0000, 0, 0x00, "DataModelRevision" }, + { 0x0001, 0, 0x00, "VendorName" }, + { 0x0002, 0, 0x00, "VendorID" }, + { 0x0003, 0, 0x00, "ProductName" }, + { 0x0004, 0, 0x00, "ProductID" }, + { 0x0005, 0, 0x00, "NodeLabel" }, + { 0x0006, 0, 0x00, "Location" }, + { 0x0007, 0, 0x00, "HardwareVersion" }, + { 0x0008, 0, 0x00, "HardwareVersionString" }, + { 0x0009, 0, 0x00, "SoftwareVersion" }, + { 0x000A, 0, 0x00, "SoftwareVersionString" }, + { 0x000B, 0, 0x00, "ManufacturingDate" }, + { 0x000C, 0, 0x00, "PartNumber" }, + { 0x000D, 0, 0x00, "ProductURL" }, + { 0x000E, 0, 0x00, "ProductLabel" }, + { 0x000F, 0, 0x00, "SerialNumber" }, + { 0x0010, 0, 0x00, "LocalConfigDisabled" }, + { 0x0011, 0, 0x00, "Reachable" }, + { 0x0012, 0, 0x00, "UniqueID" }, + { 0x0013, 0, 0x00, "CapabilityMinima" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0028[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0029[] = { + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0029[] = { + { 0x0000, "QueryImage" }, + { 0x0002, "ApplyUpdateRequest" }, + { 0x0004, "NotifyUpdateApplied" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_002A[] = { + { 0x0000, 0, 0x00, "DefaultOtaProviders" }, + { 0x0001, 0, 0x00, "UpdatePossible" }, + { 0x0002, 0, 0x00, "UpdateState" }, + { 0x0003, 0, 0x00, "UpdateStateProgress" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_002A[] = { + { 0x0000, "AnnounceOtaProvider" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_002B[] = { + { 0x0000, 0, 0x00, "ActiveLocale" }, + { 0x0001, 0, 0x00, "SupportedLocales" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_002B[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_002C[] = { + { 0x0000, 0, 0x00, "HourFormat" }, + { 0x0001, 0, 0x00, "ActiveCalendarType" }, + { 0x0002, 0, 0x00, "SupportedCalendarTypes" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_002C[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_002D[] = { + { 0x0000, 0, 0x00, "TemperatureUnit" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_002D[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_002E[] = { + { 0x0000, 0, 0x00, "Sources" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_002E[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_002F[] = { + { 0x0000, 0, 0x00, "Status" }, + { 0x0001, 0, 0x00, "Order" }, + { 0x0002, 0, 0x00, "Description" }, + { 0x0003, 0, 0x00, "WiredAssessedInputVoltage" }, + { 0x0004, 0, 0x00, "WiredAssessedInputFrequency" }, + { 0x0005, 0, 0x00, "WiredCurrentType" }, + { 0x0006, 0, 0x00, "WiredAssessedCurrent" }, + { 0x0007, 0, 0x00, "WiredNominalVoltage" }, + { 0x0008, 0, 0x00, "WiredMaximumCurrent" }, + { 0x0009, 0, 0x00, "WiredPresent" }, + { 0x000A, 0, 0x00, "ActiveWiredFaults" }, + { 0x000B, 0, 0x00, "BatVoltage" }, + { 0x000C, 0, 0x00, "BatPercentRemaining" }, + { 0x000D, 0, 0x00, "BatTimeRemaining" }, + { 0x000E, 0, 0x00, "BatChargeLevel" }, + { 0x000F, 0, 0x00, "BatReplacementNeeded" }, + { 0x0010, 0, 0x00, "BatReplaceability" }, + { 0x0011, 0, 0x00, "BatPresent" }, + { 0x0012, 0, 0x00, "ActiveBatFaults" }, + { 0x0013, 0, 0x00, "BatReplacementDescription" }, + { 0x0014, 0, 0x00, "BatCommonDesignation" }, + { 0x0015, 0, 0x00, "BatANSIDesignation" }, + { 0x0016, 0, 0x00, "BatIECDesignation" }, + { 0x0017, 0, 0x00, "BatApprovedChemistry" }, + { 0x0018, 0, 0x00, "BatCapacity" }, + { 0x0019, 0, 0x00, "BatQuantity" }, + { 0x001A, 0, 0x00, "BatChargeState" }, + { 0x001B, 0, 0x00, "BatTimeToFullCharge" }, + { 0x001C, 0, 0x00, "BatFunctionalWhileCharging" }, + { 0x001D, 0, 0x00, "BatChargingCurrent" }, + { 0x001E, 0, 0x00, "ActiveBatChargeFaults" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_002F[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0030[] = { + { 0x0000, 0, 0x00, "Breadcrumb" }, + { 0x0001, 0, 0x00, "BasicCommissioningInfo" }, + { 0x0002, 0, 0x00, "RegulatoryConfig" }, + { 0x0003, 0, 0x00, "LocationCapability" }, + { 0x0004, 0, 0x00, "SupportsConcurrentConnection" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0030[] = { + { 0x0000, "ArmFailSafe" }, + { 0x0001, "ArmFailSafeResponse" }, + { 0x0002, "SetRegulatoryConfig" }, + { 0x0003, "SetRegulatoryConfigResponse" }, + { 0x0004, "CommissioningComplete" }, + { 0x0005, "CommissioningCompleteResponse" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0031[] = { + { 0x0000, 0, 0x00, "MaxNetworks" }, + { 0x0001, 0, 0x00, "Networks" }, + { 0x0002, 0, 0x00, "ScanMaxTimeSeconds" }, + { 0x0003, 0, 0x00, "ConnectMaxTimeSeconds" }, + { 0x0004, 0, 0x00, "InterfaceEnabled" }, + { 0x0005, 0, 0x00, "LastNetworkingStatus" }, + { 0x0006, 0, 0x00, "LastNetworkID" }, + { 0x0007, 0, 0x00, "LastConnectErrorValue" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0031[] = { + { 0x0000, "ScanNetworks" }, + { 0x0002, "AddOrUpdateWiFiNetwork" }, + { 0x0003, "AddOrUpdateThreadNetwork" }, + { 0x0004, "RemoveNetwork" }, + { 0x0006, "ConnectNetwork" }, + { 0x0008, "ReorderNetwork" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0032[] = { + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0032[] = { + { 0x0000, "RetrieveLogsRequest" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0033[] = { + { 0x0000, 0, 0x00, "NetworkInterfaces" }, + { 0x0001, 0, 0x00, "RebootCount" }, + { 0x0002, 0, 0x00, "UpTime" }, + { 0x0003, 0, 0x00, "TotalOperationalHours" }, + { 0x0004, 0, 0x00, "BootReasons" }, + { 0x0005, 0, 0x00, "ActiveHardwareFaults" }, + { 0x0006, 0, 0x00, "ActiveRadioFaults" }, + { 0x0007, 0, 0x00, "ActiveNetworkFaults" }, + { 0x0008, 0, 0x00, "TestEventTriggersEnabled" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0033[] = { + { 0x0000, "TestEventTrigger" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0034[] = { + { 0x0000, 0, 0x00, "ThreadMetrics" }, + { 0x0001, 0, 0x00, "CurrentHeapFree" }, + { 0x0002, 0, 0x00, "CurrentHeapUsed" }, + { 0x0003, 0, 0x00, "CurrentHeapHighWatermark" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0034[] = { + { 0x0000, "ResetWatermarks" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0035[] = { + { 0x0000, 0, 0x00, "Channel" }, + { 0x0001, 0, 0x00, "RoutingRole" }, + { 0x0002, 0, 0x00, "NetworkName" }, + { 0x0003, 0, 0x00, "PanId" }, + { 0x0004, 0, 0x00, "ExtendedPanId" }, + { 0x0005, 0, 0x00, "MeshLocalPrefix" }, + { 0x0006, 0, 0x00, "OverrunCount" }, + { 0x0007, 0, 0x00, "NeighborTableList" }, + { 0x0008, 0, 0x00, "RouteTableList" }, + { 0x0009, 0, 0x00, "PartitionId" }, + { 0x000A, 0, 0x00, "Weighting" }, + { 0x000B, 0, 0x00, "DataVersion" }, + { 0x000C, 0, 0x00, "StableDataVersion" }, + { 0x000D, 0, 0x00, "LeaderRouterId" }, + { 0x000E, 0, 0x00, "DetachedRoleCount" }, + { 0x000F, 0, 0x00, "ChildRoleCount" }, + { 0x0010, 0, 0x00, "RouterRoleCount" }, + { 0x0011, 0, 0x00, "LeaderRoleCount" }, + { 0x0012, 0, 0x00, "AttachAttemptCount" }, + { 0x0013, 0, 0x00, "PartitionIdChangeCount" }, + { 0x0014, 0, 0x00, "BetterPartitionAttachAttemptCount" }, + { 0x0015, 0, 0x00, "ParentChangeCount" }, + { 0x0016, 0, 0x00, "TxTotalCount" }, + { 0x0017, 0, 0x00, "TxUnicastCount" }, + { 0x0018, 0, 0x00, "TxBroadcastCount" }, + { 0x0019, 0, 0x00, "TxAckRequestedCount" }, + { 0x001A, 0, 0x00, "TxAckedCount" }, + { 0x001B, 0, 0x00, "TxNoAckRequestedCount" }, + { 0x001C, 0, 0x00, "TxDataCount" }, + { 0x001D, 0, 0x00, "TxDataPollCount" }, + { 0x001E, 0, 0x00, "TxBeaconCount" }, + { 0x001F, 0, 0x00, "TxBeaconRequestCount" }, + { 0x0020, 0, 0x00, "TxOtherCount" }, + { 0x0021, 0, 0x00, "TxRetryCount" }, + { 0x0022, 0, 0x00, "TxDirectMaxRetryExpiryCount" }, + { 0x0023, 0, 0x00, "TxIndirectMaxRetryExpiryCount" }, + { 0x0024, 0, 0x00, "TxErrCcaCount" }, + { 0x0025, 0, 0x00, "TxErrAbortCount" }, + { 0x0026, 0, 0x00, "TxErrBusyChannelCount" }, + { 0x0027, 0, 0x00, "RxTotalCount" }, + { 0x0028, 0, 0x00, "RxUnicastCount" }, + { 0x0029, 0, 0x00, "RxBroadcastCount" }, + { 0x002A, 0, 0x00, "RxDataCount" }, + { 0x002B, 0, 0x00, "RxDataPollCount" }, + { 0x002C, 0, 0x00, "RxBeaconCount" }, + { 0x002D, 0, 0x00, "RxBeaconRequestCount" }, + { 0x002E, 0, 0x00, "RxOtherCount" }, + { 0x002F, 0, 0x00, "RxAddressFilteredCount" }, + { 0x0030, 0, 0x00, "RxDestAddrFilteredCount" }, + { 0x0031, 0, 0x00, "RxDuplicatedCount" }, + { 0x0032, 0, 0x00, "RxErrNoFrameCount" }, + { 0x0033, 0, 0x00, "RxErrUnknownNeighborCount" }, + { 0x0034, 0, 0x00, "RxErrInvalidSrcAddrCount" }, + { 0x0035, 0, 0x00, "RxErrSecCount" }, + { 0x0036, 0, 0x00, "RxErrFcsCount" }, + { 0x0037, 0, 0x00, "RxErrOtherCount" }, + { 0x0038, 0, 0x00, "ActiveTimestamp" }, + { 0x0039, 0, 0x00, "PendingTimestamp" }, + { 0x003A, 0, 0x00, "Delay" }, + { 0x003B, 0, 0x00, "SecurityPolicy" }, + { 0x003C, 0, 0x00, "ChannelPage0Mask" }, + { 0x003D, 0, 0x00, "OperationalDatasetComponents" }, + { 0x003E, 0, 0x00, "ActiveNetworkFaultsList" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0035[] = { + { 0x0000, "ResetCounts" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0036[] = { + { 0x0000, 0, 0x00, "Bssid" }, + { 0x0001, 0, 0x00, "SecurityType" }, + { 0x0002, 0, 0x00, "WiFiVersion" }, + { 0x0003, 0, 0x00, "ChannelNumber" }, + { 0x0004, 0, 0x00, "Rssi" }, + { 0x0005, 0, 0x00, "BeaconLostCount" }, + { 0x0006, 0, 0x00, "BeaconRxCount" }, + { 0x0007, 0, 0x00, "PacketMulticastRxCount" }, + { 0x0008, 0, 0x00, "PacketMulticastTxCount" }, + { 0x0009, 0, 0x00, "PacketUnicastRxCount" }, + { 0x000A, 0, 0x00, "PacketUnicastTxCount" }, + { 0x000B, 0, 0x00, "CurrentMaxRate" }, + { 0x000C, 0, 0x00, "OverrunCount" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0036[] = { + { 0x0000, "ResetCounts" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0037[] = { + { 0x0000, 0, 0x00, "PHYRate" }, + { 0x0001, 0, 0x00, "FullDuplex" }, + { 0x0002, 0, 0x00, "PacketRxCount" }, + { 0x0003, 0, 0x00, "PacketTxCount" }, + { 0x0004, 0, 0x00, "TxErrCount" }, + { 0x0005, 0, 0x00, "CollisionCount" }, + { 0x0006, 0, 0x00, "OverrunCount" }, + { 0x0007, 0, 0x00, "CarrierDetect" }, + { 0x0008, 0, 0x00, "TimeSinceReset" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0037[] = { + { 0x0000, "ResetCounts" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0039[] = { + { 0x0001, 0, 0x00, "VendorName" }, + { 0x0002, 0, 0x00, "VendorID" }, + { 0x0003, 0, 0x00, "ProductName" }, + { 0x0005, 0, 0x00, "NodeLabel" }, + { 0x0007, 0, 0x00, "HardwareVersion" }, + { 0x0008, 0, 0x00, "HardwareVersionString" }, + { 0x0009, 0, 0x00, "SoftwareVersion" }, + { 0x000A, 0, 0x00, "SoftwareVersionString" }, + { 0x000B, 0, 0x00, "ManufacturingDate" }, + { 0x000C, 0, 0x00, "PartNumber" }, + { 0x000D, 0, 0x00, "ProductURL" }, + { 0x000E, 0, 0x00, "ProductLabel" }, + { 0x000F, 0, 0x00, "SerialNumber" }, + { 0x0011, 0, 0x00, "Reachable" }, + { 0x0012, 0, 0x00, "UniqueID" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0039[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_003B[] = { + { 0x0000, 0, 0x00, "NumberOfPositions" }, + { 0x0001, 0, 0x00, "CurrentPosition" }, + { 0x0002, 0, 0x00, "MultiPressMax" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_003B[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_003C[] = { + { 0x0000, 0, 0x00, "WindowStatus" }, + { 0x0001, 0, 0x00, "AdminFabricIndex" }, + { 0x0002, 0, 0x00, "AdminVendorId" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_003C[] = { + { 0x0000, "OpenCommissioningWindow" }, + { 0x0001, "OpenBasicCommissioningWindow" }, + { 0x0002, "RevokeCommissioning" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_003E[] = { + { 0x0000, 0, 0x00, "NOCs" }, + { 0x0001, 0, 0x00, "Fabrics" }, + { 0x0002, 0, 0x00, "SupportedFabrics" }, + { 0x0003, 0, 0x00, "CommissionedFabrics" }, + { 0x0004, 0, 0x00, "TrustedRootCertificates" }, + { 0x0005, 0, 0x00, "CurrentFabricIndex" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_003E[] = { + { 0x0000, "AttestationRequest" }, + { 0x0001, "AttestationResponse" }, + { 0x0002, "CertificateChainRequest" }, + { 0x0003, "CertificateChainResponse" }, + { 0x0004, "CSRRequest" }, + { 0x0005, "CSRResponse" }, + { 0x0006, "AddNOC" }, + { 0x0007, "UpdateNOC" }, + { 0x0008, "NOCResponse" }, + { 0x0009, "UpdateFabricLabel" }, + { 0x000A, "RemoveFabric" }, + { 0x000B, "AddTrustedRootCertificate" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_003F[] = { + { 0x0000, 0, 0x00, "GroupKeyMap" }, + { 0x0001, 0, 0x00, "GroupTable" }, + { 0x0002, 0, 0x00, "MaxGroupsPerFabric" }, + { 0x0003, 0, 0x00, "MaxGroupKeysPerFabric" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_003F[] = { + { 0x0000, "KeySetWrite" }, + { 0x0001, "KeySetRead" }, + { 0x0003, "KeySetRemove" }, + { 0x0004, "KeySetReadAllIndices" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0040[] = { + { 0x0000, 0, 0x00, "LabelList" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0040[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0041[] = { + { 0x0000, 0, 0x00, "LabelList" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0041[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0045[] = { + { 0x0000, 0, 0x00, "StateValue" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0045[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0050[] = { + { 0x0000, 0, 0x00, "Description" }, + { 0x0001, 0, 0x00, "StandardNamespace" }, + { 0x0002, 0, 0x00, "SupportedModes" }, + { 0x0003, 0, 0x00, "CurrentMode" }, + { 0x0004, 0, 0x00, "StartUpMode" }, + { 0x0005, 0, 0x00, "OnMode" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0050[] = { + { 0x0000, "ChangeToMode" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0101[] = { + { 0x0000, 0, 0x00, "LockState" }, + { 0x0001, 0, 0x00, "LockType" }, + { 0x0002, 0, 0x00, "ActuatorEnabled" }, + { 0x0003, 0, 0x00, "DoorState" }, + { 0x0011, 0, 0x00, "NumberOfTotalUsersSupported" }, + { 0x0012, 0, 0x00, "NumberOfPINUsersSupported" }, + { 0x0013, 0, 0x00, "NumberOfRFIDUsersSupported" }, + { 0x0014, 0, 0x00, "NumberOfWeekDaySchedulesSupportedPerUser" }, + { 0x0015, 0, 0x00, "NumberOfYearDaySchedulesSupportedPerUser" }, + { 0x0016, 0, 0x00, "NumberOfHolidaySchedulesSupported" }, + { 0x0017, 0, 0x00, "MaxPINCodeLength" }, + { 0x0018, 0, 0x00, "MinPINCodeLength" }, + { 0x0019, 0, 0x00, "MaxRFIDCodeLength" }, + { 0x001A, 0, 0x00, "MinRFIDCodeLength" }, + { 0x001C, 0, 0x00, "NumberOfCredentialsSupportedPerUser" }, + { 0x0021, 0, 0x00, "Language" }, + { 0x0023, 0, 0x00, "AutoRelockTime" }, + { 0x0024, 0, 0x00, "SoundVolume" }, + { 0x0025, 0, 0x00, "OperatingMode" }, + { 0x0026, 0, 0x00, "SupportedOperatingModes" }, + { 0x0029, 0, 0x00, "EnableOneTouchLocking" }, + { 0x002B, 0, 0x00, "EnablePrivacyModeButton" }, + { 0x0030, 0, 0x00, "WrongCodeEntryLimit" }, + { 0x0031, 0, 0x00, "UserCodeTemporaryDisableTime" }, + { 0x0033, 0, 0x00, "RequirePINforRemoteOperation" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0101[] = { + { 0x0000, "LockDoor" }, + { 0x0001, "UnlockDoor" }, + { 0x0003, "UnlockWithTimeout" }, + { 0x000B, "SetWeekDaySchedule" }, + { 0x000C, "GetWeekDaySchedule" }, + { 0x000D, "ClearWeekDaySchedule" }, + { 0x000E, "SetYearDaySchedule" }, + { 0x000F, "GetYearDaySchedule" }, + { 0x0010, "ClearYearDaySchedule" }, + { 0x0011, "SetHolidaySchedule" }, + { 0x0012, "GetHolidaySchedule" }, + { 0x0013, "ClearHolidaySchedule" }, + { 0x001A, "SetUser" }, + { 0x001B, "GetUser" }, + { 0x001D, "ClearUser" }, + { 0x0022, "SetCredential" }, + { 0x0024, "GetCredentialStatus" }, + { 0x0026, "ClearCredential" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0102[] = { + { 0x0000, 0, 0x00, "Type" }, + { 0x0001, 0, 0x00, "PhysicalClosedLimitLift" }, + { 0x0002, 0, 0x00, "PhysicalClosedLimitTilt" }, + { 0x0003, 0, 0x00, "CurrentPositionLift" }, + { 0x0004, 0, 0x00, "CurrentPositionTilt" }, + { 0x0005, 0, 0x00, "NumberOfActuationsLift" }, + { 0x0006, 0, 0x00, "NumberOfActuationsTilt" }, + { 0x0007, 0, 0x00, "ConfigStatus" }, + { 0x0008, 0, 0x00, "CurrentPositionLiftPercentage" }, + { 0x0009, 0, 0x00, "CurrentPositionTiltPercentage" }, + { 0x000A, 0, 0x00, "OperationalStatus" }, + { 0x000B, 0, 0x00, "TargetPositionLiftPercent100ths" }, + { 0x000C, 0, 0x00, "TargetPositionTiltPercent100ths" }, + { 0x000D, 0, 0x00, "EndProductType" }, + { 0x000E, 0, 0x00, "CurrentPositionLiftPercent100ths" }, + { 0x000F, 0, 0x00, "CurrentPositionTiltPercent100ths" }, + { 0x0010, 0, 0x00, "InstalledOpenLimitLift" }, + { 0x0011, 0, 0x00, "InstalledClosedLimitLift" }, + { 0x0012, 0, 0x00, "InstalledOpenLimitTilt" }, + { 0x0013, 0, 0x00, "InstalledClosedLimitTilt" }, + { 0x0017, 0, 0x00, "Mode" }, + { 0x001A, 0, 0x00, "SafetyStatus" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0102[] = { + { 0x0000, "UpOrOpen" }, + { 0x0001, "DownOrClose" }, + { 0x0002, "StopMotion" }, + { 0x0004, "GoToLiftValue" }, + { 0x0005, "GoToLiftPercentage" }, + { 0x0007, "GoToTiltValue" }, + { 0x0008, "GoToTiltPercentage" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0103[] = { + { 0x0001, 0, 0x00, "BarrierMovingState" }, + { 0x0002, 0, 0x00, "BarrierSafetyStatus" }, + { 0x0003, 0, 0x00, "BarrierCapabilities" }, + { 0x000A, 0, 0x00, "BarrierPosition" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0103[] = { + { 0x0000, "BarrierControlGoToPercent" }, + { 0x0001, "BarrierControlStop" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0200[] = { + { 0x0000, 0, 0x00, "MaxPressure" }, + { 0x0001, 0, 0x00, "MaxSpeed" }, + { 0x0002, 0, 0x00, "MaxFlow" }, + { 0x0003, 0, 0x00, "MinConstPressure" }, + { 0x0004, 0, 0x00, "MaxConstPressure" }, + { 0x0005, 0, 0x00, "MinCompPressure" }, + { 0x0006, 0, 0x00, "MaxCompPressure" }, + { 0x0007, 0, 0x00, "MinConstSpeed" }, + { 0x0008, 0, 0x00, "MaxConstSpeed" }, + { 0x0009, 0, 0x00, "MinConstFlow" }, + { 0x000A, 0, 0x00, "MaxConstFlow" }, + { 0x000B, 0, 0x00, "MinConstTemp" }, + { 0x000C, 0, 0x00, "MaxConstTemp" }, + { 0x0010, 0, 0x00, "PumpStatus" }, + { 0x0011, 0, 0x00, "EffectiveOperationMode" }, + { 0x0012, 0, 0x00, "EffectiveControlMode" }, + { 0x0013, 0, 0x00, "Capacity" }, + { 0x0014, 0, 0x00, "Speed" }, + { 0x0015, 0, 0x00, "LifetimeRunningHours" }, + { 0x0016, 0, 0x00, "Power" }, + { 0x0017, 0, 0x00, "LifetimeEnergyConsumed" }, + { 0x0020, 0, 0x00, "OperationMode" }, + { 0x0021, 0, 0x00, "ControlMode" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0200[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0201[] = { + { 0x0000, 0, 0x00, "LocalTemperature" }, + { 0x0003, 0, 0x00, "AbsMinHeatSetpointLimit" }, + { 0x0004, 0, 0x00, "AbsMaxHeatSetpointLimit" }, + { 0x0005, 0, 0x00, "AbsMinCoolSetpointLimit" }, + { 0x0006, 0, 0x00, "AbsMaxCoolSetpointLimit" }, + { 0x0011, 0, 0x00, "OccupiedCoolingSetpoint" }, + { 0x0012, 0, 0x00, "OccupiedHeatingSetpoint" }, + { 0x0015, 0, 0x00, "MinHeatSetpointLimit" }, + { 0x0016, 0, 0x00, "MaxHeatSetpointLimit" }, + { 0x0017, 0, 0x00, "MinCoolSetpointLimit" }, + { 0x0018, 0, 0x00, "MaxCoolSetpointLimit" }, + { 0x0019, 0, 0x00, "MinSetpointDeadBand" }, + { 0x001B, 0, 0x00, "ControlSequenceOfOperation" }, + { 0x001C, 0, 0x00, "SystemMode" }, + { 0x0020, 0, 0x00, "StartOfWeek" }, + { 0x0021, 0, 0x00, "NumberOfWeeklyTransitions" }, + { 0x0022, 0, 0x00, "NumberOfDailyTransitions" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0201[] = { + { 0x0000, "SetpointRaiseLower" }, + { 0x0001, "SetWeeklySchedule" }, + { 0x0002, "GetWeeklySchedule" }, + { 0x0003, "ClearWeeklySchedule" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0202[] = { + { 0x0000, 0, 0x00, "FanMode" }, + { 0x0001, 0, 0x00, "FanModeSequence" }, + { 0x0002, 0, 0x00, "PercentSetting" }, + { 0x0003, 0, 0x00, "PercentCurrent" }, + { 0x0004, 0, 0x00, "SpeedMax" }, + { 0x0005, 0, 0x00, "SpeedSetting" }, + { 0x0006, 0, 0x00, "SpeedCurrent" }, + { 0x0007, 0, 0x00, "RockSupport" }, + { 0x0008, 0, 0x00, "RockSetting" }, + { 0x0009, 0, 0x00, "WindSupport" }, + { 0x000A, 0, 0x00, "WindSetting" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0202[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0204[] = { + { 0x0000, 0, 0x00, "TemperatureDisplayMode" }, + { 0x0001, 0, 0x00, "KeypadLockout" }, + { 0x0002, 0, 0x00, "ScheduleProgrammingVisibility" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0204[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0300[] = { + { 0x0000, 0, 0x00, "CurrentHue" }, + { 0x0001, 0, 0x00, "CurrentSaturation" }, + { 0x0002, 0, 0x00, "RemainingTime" }, + { 0x0003, 0, 0x00, "CurrentX" }, + { 0x0004, 0, 0x00, "CurrentY" }, + { 0x0005, 0, 0x00, "DriftCompensation" }, + { 0x0006, 0, 0x00, "CompensationText" }, + { 0x0007, 0, 0x00, "ColorTemperatureMireds" }, + { 0x0008, 0, 0x00, "ColorMode" }, + { 0x000F, 0, 0x00, "Options" }, + { 0x0010, 0, 0x00, "NumberOfPrimaries" }, + { 0x0011, 0, 0x00, "Primary1X" }, + { 0x0012, 0, 0x00, "Primary1Y" }, + { 0x0013, 0, 0x00, "Primary1Intensity" }, + { 0x0015, 0, 0x00, "Primary2X" }, + { 0x0016, 0, 0x00, "Primary2Y" }, + { 0x0017, 0, 0x00, "Primary2Intensity" }, + { 0x0019, 0, 0x00, "Primary3X" }, + { 0x001A, 0, 0x00, "Primary3Y" }, + { 0x001B, 0, 0x00, "Primary3Intensity" }, + { 0x0020, 0, 0x00, "Primary4X" }, + { 0x0021, 0, 0x00, "Primary4Y" }, + { 0x0022, 0, 0x00, "Primary4Intensity" }, + { 0x0024, 0, 0x00, "Primary5X" }, + { 0x0025, 0, 0x00, "Primary5Y" }, + { 0x0026, 0, 0x00, "Primary5Intensity" }, + { 0x0028, 0, 0x00, "Primary6X" }, + { 0x0029, 0, 0x00, "Primary6Y" }, + { 0x002A, 0, 0x00, "Primary6Intensity" }, + { 0x0030, 0, 0x00, "WhitePointX" }, + { 0x0031, 0, 0x00, "WhitePointY" }, + { 0x0032, 0, 0x00, "ColorPointRX" }, + { 0x0033, 0, 0x00, "ColorPointRY" }, + { 0x0034, 0, 0x00, "ColorPointRIntensity" }, + { 0x0036, 0, 0x00, "ColorPointGX" }, + { 0x0037, 0, 0x00, "ColorPointGY" }, + { 0x0038, 0, 0x00, "ColorPointGIntensity" }, + { 0x003A, 0, 0x00, "ColorPointBX" }, + { 0x003B, 0, 0x00, "ColorPointBY" }, + { 0x003C, 0, 0x00, "ColorPointBIntensity" }, + { 0x4000, 0, 0x00, "EnhancedCurrentHue" }, + { 0x4001, 0, 0x00, "EnhancedColorMode" }, + { 0x4002, 0, 0x00, "ColorLoopActive" }, + { 0x4003, 0, 0x00, "ColorLoopDirection" }, + { 0x4004, 0, 0x00, "ColorLoopTime" }, + { 0x4005, 0, 0x00, "ColorLoopStartEnhancedHue" }, + { 0x4006, 0, 0x00, "ColorLoopStoredEnhancedHue" }, + { 0x400A, 0, 0x00, "ColorCapabilities" }, + { 0x400B, 0, 0x00, "ColorTempPhysicalMinMireds" }, + { 0x400C, 0, 0x00, "ColorTempPhysicalMaxMireds" }, + { 0x400D, 0, 0x00, "CoupleColorTempToLevelMinMireds" }, + { 0x4010, 0, 0x00, "StartUpColorTemperatureMireds" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0300[] = { + { 0x0000, "MoveToHue" }, + { 0x0001, "MoveHue" }, + { 0x0002, "StepHue" }, + { 0x0003, "MoveToSaturation" }, + { 0x0004, "MoveSaturation" }, + { 0x0005, "StepSaturation" }, + { 0x0006, "MoveToHueAndSaturation" }, + { 0x0007, "MoveToColor" }, + { 0x0008, "MoveColor" }, + { 0x0009, "StepColor" }, + { 0x000A, "MoveToColorTemperature" }, + { 0x0040, "EnhancedMoveToHue" }, + { 0x0041, "EnhancedMoveHue" }, + { 0x0042, "EnhancedStepHue" }, + { 0x0043, "EnhancedMoveToHueAndSaturation" }, + { 0x0044, "ColorLoopSet" }, + { 0x0047, "StopMoveStep" }, + { 0x004B, "MoveColorTemperature" }, + { 0x004C, "StepColorTemperature" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0301[] = { + { 0x0000, 0, 0x00, "PhysicalMinLevel" }, + { 0x0001, 0, 0x00, "PhysicalMaxLevel" }, + { 0x0002, 0, 0x00, "BallastStatus" }, + { 0x0010, 0, 0x00, "MinLevel" }, + { 0x0011, 0, 0x00, "MaxLevel" }, + { 0x0014, 0, 0x00, "IntrinsicBalanceFactor" }, + { 0x0015, 0, 0x00, "BallastFactorAdjustment" }, + { 0x0020, 0, 0x00, "LampQuantity" }, + { 0x0030, 0, 0x00, "LampType" }, + { 0x0031, 0, 0x00, "LampManufacturer" }, + { 0x0032, 0, 0x00, "LampRatedHours" }, + { 0x0033, 0, 0x00, "LampBurnHours" }, + { 0x0034, 0, 0x00, "LampAlarmMode" }, + { 0x0035, 0, 0x00, "LampBurnHoursTripPoint" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0301[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0400[] = { + { 0x0000, 0, 0x00, "MeasuredValue" }, + { 0x0001, 0, 0x00, "MinMeasuredValue" }, + { 0x0002, 0, 0x00, "MaxMeasuredValue" }, + { 0x0003, 0, 0x00, "Tolerance" }, + { 0x0004, 0, 0x00, "LightSensorType" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0400[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0402[] = { + { 0x0000, 0, 0x00, "MeasuredValue" }, + { 0x0001, 0, 0x00, "MinMeasuredValue" }, + { 0x0002, 0, 0x00, "MaxMeasuredValue" }, + { 0x0003, 0, 0x00, "Tolerance" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0402[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0403[] = { + { 0x0000, 0, 0x00, "MeasuredValue" }, + { 0x0001, 0, 0x00, "MinMeasuredValue" }, + { 0x0002, 0, 0x00, "MaxMeasuredValue" }, + { 0x0003, 0, 0x00, "Tolerance" }, + { 0x0010, 0, 0x00, "ScaledValue" }, + { 0x0011, 0, 0x00, "MinScaledValue" }, + { 0x0012, 0, 0x00, "MaxScaledValue" }, + { 0x0013, 0, 0x00, "ScaledTolerance" }, + { 0x0014, 0, 0x00, "Scale" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0403[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0404[] = { + { 0x0000, 0, 0x00, "MeasuredValue" }, + { 0x0001, 0, 0x00, "MinMeasuredValue" }, + { 0x0002, 0, 0x00, "MaxMeasuredValue" }, + { 0x0003, 0, 0x00, "Tolerance" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0404[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0405[] = { + { 0x0000, 0, 0x00, "MeasuredValue" }, + { 0x0001, 0, 0x00, "MinMeasuredValue" }, + { 0x0002, 0, 0x00, "MaxMeasuredValue" }, + { 0x0003, 0, 0x00, "Tolerance" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0405[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0406[] = { + { 0x0000, 0, 0x00, "Occupancy" }, + { 0x0001, 0, 0x00, "OccupancySensorType" }, + { 0x0002, 0, 0x00, "OccupancySensorTypeBitmap" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0406[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0503[] = { + { 0x0000, 0, 0x00, "MACAddress" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0503[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0504[] = { + { 0x0000, 0, 0x00, "ChannelList" }, + { 0x0001, 0, 0x00, "Lineup" }, + { 0x0002, 0, 0x00, "CurrentChannel" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0504[] = { + { 0x0000, "ChangeChannel" }, + { 0x0002, "ChangeChannelByNumber" }, + { 0x0003, "SkipChannel" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0505[] = { + { 0x0000, 0, 0x00, "TargetList" }, + { 0x0001, 0, 0x00, "CurrentTarget" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0505[] = { + { 0x0000, "NavigateTarget" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0506[] = { + { 0x0000, 0, 0x00, "CurrentState" }, + { 0x0001, 0, 0x00, "StartTime" }, + { 0x0002, 0, 0x00, "Duration" }, + { 0x0003, 0, 0x00, "SampledPosition" }, + { 0x0004, 0, 0x00, "PlaybackSpeed" }, + { 0x0005, 0, 0x00, "SeekRangeEnd" }, + { 0x0006, 0, 0x00, "SeekRangeStart" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0506[] = { + { 0x0000, "Play" }, + { 0x0001, "Pause" }, + { 0x0002, "StopPlayback" }, + { 0x0003, "StartOver" }, + { 0x0004, "Previous" }, + { 0x0005, "Next" }, + { 0x0006, "Rewind" }, + { 0x0007, "FastForward" }, + { 0x0008, "SkipForward" }, + { 0x0009, "SkipBackward" }, + { 0x000B, "Seek" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0507[] = { + { 0x0000, 0, 0x00, "InputList" }, + { 0x0001, 0, 0x00, "CurrentInput" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0507[] = { + { 0x0000, "SelectInput" }, + { 0x0001, "ShowInputStatus" }, + { 0x0002, "HideInputStatus" }, + { 0x0003, "RenameInput" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0508[] = { + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0508[] = { + { 0x0000, "Sleep" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0509[] = { + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0509[] = { + { 0x0000, "SendKey" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_050A[] = { + { 0x0000, 0, 0x00, "AcceptHeader" }, + { 0x0001, 0, 0x00, "SupportedStreamingProtocols" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_050A[] = { + { 0x0000, "LaunchContent" }, + { 0x0001, "LaunchURL" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_050B[] = { + { 0x0000, 0, 0x00, "OutputList" }, + { 0x0001, 0, 0x00, "CurrentOutput" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_050B[] = { + { 0x0000, "SelectOutput" }, + { 0x0001, "RenameOutput" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_050C[] = { + { 0x0000, 0, 0x00, "CatalogList" }, + { 0x0001, 0, 0x00, "CurrentApp" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_050C[] = { + { 0x0000, "LaunchApp" }, + { 0x0001, "StopApp" }, + { 0x0002, "HideApp" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_050D[] = { + { 0x0000, 0, 0x00, "VendorName" }, + { 0x0001, 0, 0x00, "VendorID" }, + { 0x0002, 0, 0x00, "ApplicationName" }, + { 0x0003, 0, 0x00, "ProductID" }, + { 0x0004, 0, 0x00, "Application" }, + { 0x0005, 0, 0x00, "Status" }, + { 0x0006, 0, 0x00, "ApplicationVersion" }, + { 0x0007, 0, 0x00, "AllowedVendorList" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_050D[] = { + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_050E[] = { + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_050E[] = { + { 0x0000, "GetSetupPIN" }, + { 0x0002, "Login" }, + { 0x0003, "Logout" }, + { 0xFFFF, NULL }, +}; + +const matter_attribute_t matter_Attributes_0B04[] = { + { 0x0000, 0, 0x00, "MeasurementType" }, + { 0x0304, 0, 0x00, "TotalActivePower" }, + { 0x0505, 0, 0x00, "RmsVoltage" }, + { 0x0506, 0, 0x00, "RmsVoltageMin" }, + { 0x0507, 0, 0x00, "RmsVoltageMax" }, + { 0x0508, 0, 0x00, "RmsCurrent" }, + { 0x0509, 0, 0x00, "RmsCurrentMin" }, + { 0x050A, 0, 0x00, "RmsCurrentMax" }, + { 0x050B, 0, 0x00, "ActivePower" }, + { 0x050C, 0, 0x00, "ActivePowerMin" }, + { 0x050D, 0, 0x00, "ActivePowerMax" }, + { 0xFFF8, 0, 0x00, "GeneratedCommandList" }, + { 0xFFF9, 0, 0x00, "AcceptedCommandList" }, + { 0xFFFB, 0, 0x00, "AttributeList" }, + { 0xFFFC, 0, 0x00, "FeatureMap" }, + { 0xFFFD, 0, 0x00, "ClusterRevision" }, + { 0xFFFF, 0, 0x00, NULL }, +}; + +const matter_command_t matter_Commands_0B04[] = { + { 0xFFFF, NULL }, +}; + +const matter_cluster_t matterAllClusters[] = { + { 0x0003, "Identify", matter_Attributes_0003, matter_Commands_0003 }, + { 0x0004, "Groups", matter_Attributes_0004, matter_Commands_0004 }, + { 0x0005, "Scenes", matter_Attributes_0005, matter_Commands_0005 }, + { 0x0006, "OnOff", matter_Attributes_0006, matter_Commands_0006 }, + { 0x0007, "OnOffSwitchConfiguration", matter_Attributes_0007, matter_Commands_0007 }, + { 0x0008, "LevelControl", matter_Attributes_0008, matter_Commands_0008 }, + { 0x000F, "BinaryInputBasic", matter_Attributes_000F, matter_Commands_000F }, + { 0x001D, "Descriptor", matter_Attributes_001D, matter_Commands_001D }, + { 0x001E, "Binding", matter_Attributes_001E, matter_Commands_001E }, + { 0x001F, "AccessControl", matter_Attributes_001F, matter_Commands_001F }, + { 0x0025, "Actions", matter_Attributes_0025, matter_Commands_0025 }, + { 0x0028, "Basic", matter_Attributes_0028, matter_Commands_0028 }, + { 0x0029, "OtaSoftwareUpdateProvider", matter_Attributes_0029, matter_Commands_0029 }, + { 0x002A, "OtaSoftwareUpdateRequestor", matter_Attributes_002A, matter_Commands_002A }, + { 0x002B, "LocalizationConfiguration", matter_Attributes_002B, matter_Commands_002B }, + { 0x002C, "TimeFormatLocalization", matter_Attributes_002C, matter_Commands_002C }, + { 0x002D, "UnitLocalization", matter_Attributes_002D, matter_Commands_002D }, + { 0x002E, "PowerSourceConfiguration", matter_Attributes_002E, matter_Commands_002E }, + { 0x002F, "PowerSource", matter_Attributes_002F, matter_Commands_002F }, + { 0x0030, "GeneralCommissioning", matter_Attributes_0030, matter_Commands_0030 }, + { 0x0031, "NetworkCommissioning", matter_Attributes_0031, matter_Commands_0031 }, + { 0x0032, "DiagnosticLogs", matter_Attributes_0032, matter_Commands_0032 }, + { 0x0033, "GeneralDiagnostics", matter_Attributes_0033, matter_Commands_0033 }, + { 0x0034, "SoftwareDiagnostics", matter_Attributes_0034, matter_Commands_0034 }, + { 0x0035, "ThreadNetworkDiagnostics", matter_Attributes_0035, matter_Commands_0035 }, + { 0x0036, "WiFiNetworkDiagnostics", matter_Attributes_0036, matter_Commands_0036 }, + { 0x0037, "EthernetNetworkDiagnostics", matter_Attributes_0037, matter_Commands_0037 }, + { 0x0039, "BridgedDeviceBasic", matter_Attributes_0039, matter_Commands_0039 }, + { 0x003B, "Switch", matter_Attributes_003B, matter_Commands_003B }, + { 0x003C, "AdministratorCommissioning", matter_Attributes_003C, matter_Commands_003C }, + { 0x003E, "OperationalCredentials", matter_Attributes_003E, matter_Commands_003E }, + { 0x003F, "GroupKeyManagement", matter_Attributes_003F, matter_Commands_003F }, + { 0x0040, "FixedLabel", matter_Attributes_0040, matter_Commands_0040 }, + { 0x0041, "UserLabel", matter_Attributes_0041, matter_Commands_0041 }, + { 0x0045, "BooleanState", matter_Attributes_0045, matter_Commands_0045 }, + { 0x0050, "ModeSelect", matter_Attributes_0050, matter_Commands_0050 }, + { 0x0101, "DoorLock", matter_Attributes_0101, matter_Commands_0101 }, + { 0x0102, "WindowCovering", matter_Attributes_0102, matter_Commands_0102 }, + { 0x0103, "BarrierControl", matter_Attributes_0103, matter_Commands_0103 }, + { 0x0200, "PumpConfigurationAndControl", matter_Attributes_0200, matter_Commands_0200 }, + { 0x0201, "Thermostat", matter_Attributes_0201, matter_Commands_0201 }, + { 0x0202, "FanControl", matter_Attributes_0202, matter_Commands_0202 }, + { 0x0204, "ThermostatUserInterfaceConfiguration", matter_Attributes_0204, matter_Commands_0204 }, + { 0x0300, "ColorControl", matter_Attributes_0300, matter_Commands_0300 }, + { 0x0301, "BallastConfiguration", matter_Attributes_0301, matter_Commands_0301 }, + { 0x0400, "IlluminanceMeasurement", matter_Attributes_0400, matter_Commands_0400 }, + { 0x0402, "TemperatureMeasurement", matter_Attributes_0402, matter_Commands_0402 }, + { 0x0403, "PressureMeasurement", matter_Attributes_0403, matter_Commands_0403 }, + { 0x0404, "FlowMeasurement", matter_Attributes_0404, matter_Commands_0404 }, + { 0x0405, "RelativeHumidityMeasurement", matter_Attributes_0405, matter_Commands_0405 }, + { 0x0406, "OccupancySensing", matter_Attributes_0406, matter_Commands_0406 }, + { 0x0503, "WakeOnLan", matter_Attributes_0503, matter_Commands_0503 }, + { 0x0504, "Channel", matter_Attributes_0504, matter_Commands_0504 }, + { 0x0505, "TargetNavigator", matter_Attributes_0505, matter_Commands_0505 }, + { 0x0506, "MediaPlayback", matter_Attributes_0506, matter_Commands_0506 }, + { 0x0507, "MediaInput", matter_Attributes_0507, matter_Commands_0507 }, + { 0x0508, "LowPower", matter_Attributes_0508, matter_Commands_0508 }, + { 0x0509, "KeypadInput", matter_Attributes_0509, matter_Commands_0509 }, + { 0x050A, "ContentLauncher", matter_Attributes_050A, matter_Commands_050A }, + { 0x050B, "AudioOutput", matter_Attributes_050B, matter_Commands_050B }, + { 0x050C, "ApplicationLauncher", matter_Attributes_050C, matter_Commands_050C }, + { 0x050D, "ApplicationBasic", matter_Attributes_050D, matter_Commands_050D }, + { 0x050E, "AccountLogin", matter_Attributes_050E, matter_Commands_050E }, + { 0x0B04, "ElectricalMeasurement", matter_Attributes_0B04, matter_Commands_0B04 }, + { 0xFFFF, NULL, NULL }, +}; diff --git a/lib/libesp32/berry_matter/generate/be_matter_opcodes.h b/lib/libesp32/berry_matter/generate/be_matter_opcodes.h new file mode 100644 index 000000000..7d361159b --- /dev/null +++ b/lib/libesp32/berry_matter/generate/be_matter_opcodes.h @@ -0,0 +1,29 @@ +/*********************************************************************************\ +* Compact form for attributes and clusters +* +* Generated content, do not edit +\*********************************************************************************/ +#include +#include + +typedef struct { + uint16_t id; + const char* name; +} matter_opcode_t; + +const matter_opcode_t matter_OpCodes[] = { + { 0x0000, "MsgCounterSyncReq" }, + { 0x0001, "MsgCounterSyncRsp" }, + { 0x0010, "MRP_Standalone_Acknowledgement" }, + { 0x0020, "PBKDFParamRequest" }, + { 0x0021, "PBKDFParamResponse" }, + { 0x0022, "PASE_Pake1" }, + { 0x0023, "PASE_Pake2" }, + { 0x0024, "PASE_Pake3" }, + { 0x0030, "CASE_Sigma1" }, + { 0x0031, "CASE_Sigma2" }, + { 0x0032, "CASE_Sigma3" }, + { 0x0033, "CASE_Sigma2_Resume" }, + { 0x0040, "StatusReport" }, + { 0xFFFF, NULL }, +}; diff --git a/lib/libesp32/berry_matter/generate/matter_clusters.be b/lib/libesp32/berry_matter/generate/matter_clusters.be new file mode 100644 index 000000000..2ca6fc239 --- /dev/null +++ b/lib/libesp32/berry_matter/generate/matter_clusters.be @@ -0,0 +1,7425 @@ +# Matter clusters +# +# Needs to be reword, this structure is huge... +# +# imported from Python definition + + +var _Matter_clusters = +{ + 'Identify': { + 'clusterName': 'Identify', + 'clusterId': 3, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'Identify', + 'args': { + 'identifyTime': 'int' + } + }, + 64: { + 'commandId': 64, + 'commandName': 'TriggerEffect', + 'args': { + 'effectIdentifier': 'int', + 'effectVariant': 'int' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'IdentifyTime', + 'attributeId': 0, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 1: { + 'attributeName': 'IdentifyType', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'Groups': { + 'clusterName': 'Groups', + 'clusterId': 4, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'AddGroup', + 'args': { + 'groupId': 'int', + 'groupName': 'str' + } + }, + 1: { + 'commandId': 1, + 'commandName': 'ViewGroup', + 'args': { + 'groupId': 'int' + } + }, + 2: { + 'commandId': 2, + 'commandName': 'GetGroupMembership', + 'args': { + 'groupList': 'int' + } + }, + 3: { + 'commandId': 3, + 'commandName': 'RemoveGroup', + 'args': { + 'groupId': 'int' + } + }, + 4: { + 'commandId': 4, + 'commandName': 'RemoveAllGroups', + 'args': {} + }, + 5: { + 'commandId': 5, + 'commandName': 'AddGroupIfIdentifying', + 'args': { + 'groupId': 'int', + 'groupName': 'str' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'NameSupport', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'Scenes': { + 'clusterName': 'Scenes', + 'clusterId': 5, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'AddScene', + 'args': { + 'groupId': 'int', + 'sceneId': 'int', + 'transitionTime': 'int', + 'sceneName': 'str', + 'clusterId': 'int', + 'attributeValueList': '' + } + }, + 1: { + 'commandId': 1, + 'commandName': 'ViewScene', + 'args': { + 'groupId': 'int', + 'sceneId': 'int' + } + }, + 2: { + 'commandId': 2, + 'commandName': 'RemoveScene', + 'args': { + 'groupId': 'int', + 'sceneId': 'int' + } + }, + 3: { + 'commandId': 3, + 'commandName': 'RemoveAllScenes', + 'args': { + 'groupId': 'int' + } + }, + 4: { + 'commandId': 4, + 'commandName': 'StoreScene', + 'args': { + 'groupId': 'int', + 'sceneId': 'int' + } + }, + 5: { + 'commandId': 5, + 'commandName': 'RecallScene', + 'args': { + 'groupId': 'int', + 'sceneId': 'int', + 'transitionTime': 'int' + } + }, + 6: { + 'commandId': 6, + 'commandName': 'GetSceneMembership', + 'args': { + 'groupId': 'int' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'SceneCount', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'CurrentScene', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'CurrentGroup', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'SceneValid', + 'attributeId': 3, + 'type': 'bool', + 'reportable': true + }, + 4: { + 'attributeName': 'NameSupport', + 'attributeId': 4, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'OnOff': { + 'clusterName': 'OnOff', + 'clusterId': 6, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'Off', + 'args': {} + }, + 1: { + 'commandId': 1, + 'commandName': 'On', + 'args': {} + }, + 2: { + 'commandId': 2, + 'commandName': 'Toggle', + 'args': {} + }, + 64: { + 'commandId': 64, + 'commandName': 'OffWithEffect', + 'args': { + 'effectId': 'int', + 'effectVariant': 'int' + } + }, + 65: { + 'commandId': 65, + 'commandName': 'OnWithRecallGlobalScene', + 'args': {} + }, + 66: { + 'commandId': 66, + 'commandName': 'OnWithTimedOff', + 'args': { + 'onOffControl': 'int', + 'onTime': 'int', + 'offWaitTime': 'int' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'OnOff', + 'attributeId': 0, + 'type': 'bool', + 'reportable': true + }, + 16384: { + 'attributeName': 'GlobalSceneControl', + 'attributeId': 16384, + 'type': 'bool', + 'reportable': true + }, + 16385: { + 'attributeName': 'OnTime', + 'attributeId': 16385, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 16386: { + 'attributeName': 'OffWaitTime', + 'attributeId': 16386, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 16387: { + 'attributeName': 'StartUpOnOff', + 'attributeId': 16387, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'OnOffSwitchConfiguration': { + 'clusterName': 'OnOffSwitchConfiguration', + 'clusterId': 7, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'SwitchType', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 16: { + 'attributeName': 'SwitchActions', + 'attributeId': 16, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'LevelControl': { + 'clusterName': 'LevelControl', + 'clusterId': 8, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'MoveToLevel', + 'args': { + 'level': 'int', + 'transitionTime': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 1: { + 'commandId': 1, + 'commandName': 'Move', + 'args': { + 'moveMode': 'int', + 'rate': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 2: { + 'commandId': 2, + 'commandName': 'Step', + 'args': { + 'stepMode': 'int', + 'stepSize': 'int', + 'transitionTime': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 3: { + 'commandId': 3, + 'commandName': 'Stop', + 'args': { + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 4: { + 'commandId': 4, + 'commandName': 'MoveToLevelWithOnOff', + 'args': { + 'level': 'int', + 'transitionTime': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 5: { + 'commandId': 5, + 'commandName': 'MoveWithOnOff', + 'args': { + 'moveMode': 'int', + 'rate': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 6: { + 'commandId': 6, + 'commandName': 'StepWithOnOff', + 'args': { + 'stepMode': 'int', + 'stepSize': 'int', + 'transitionTime': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 7: { + 'commandId': 7, + 'commandName': 'StopWithOnOff', + 'args': { + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'CurrentLevel', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'RemainingTime', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'MinLevel', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'MaxLevel', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 4: { + 'attributeName': 'CurrentFrequency', + 'attributeId': 4, + 'type': 'int', + 'reportable': true + }, + 5: { + 'attributeName': 'MinFrequency', + 'attributeId': 5, + 'type': 'int', + 'reportable': true + }, + 6: { + 'attributeName': 'MaxFrequency', + 'attributeId': 6, + 'type': 'int', + 'reportable': true + }, + 15: { + 'attributeName': 'Options', + 'attributeId': 15, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 16: { + 'attributeName': 'OnOffTransitionTime', + 'attributeId': 16, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 17: { + 'attributeName': 'OnLevel', + 'attributeId': 17, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 18: { + 'attributeName': 'OnTransitionTime', + 'attributeId': 18, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 19: { + 'attributeName': 'OffTransitionTime', + 'attributeId': 19, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 20: { + 'attributeName': 'DefaultMoveRate', + 'attributeId': 20, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 16384: { + 'attributeName': 'StartUpCurrentLevel', + 'attributeId': 16384, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'BinaryInputBasic': { + 'clusterName': 'BinaryInputBasic', + 'clusterId': 15, + 'commands': {}, + 'attributes': { + 81: { + 'attributeName': 'OutOfService', + 'attributeId': 81, + 'type': 'bool', + 'reportable': true, + 'writable': true + }, + 85: { + 'attributeName': 'PresentValue', + 'attributeId': 85, + 'type': 'bool', + 'reportable': true, + 'writable': true + }, + 111: { + 'attributeName': 'StatusFlags', + 'attributeId': 111, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'Descriptor': { + 'clusterName': 'Descriptor', + 'clusterId': 29, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'DeviceTypeList', + 'attributeId': 0, + 'type': '', + 'reportable': true + }, + 1: { + 'attributeName': 'ServerList', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'ClientList', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'PartsList', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'Binding': { + 'clusterName': 'Binding', + 'clusterId': 30, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'Binding', + 'attributeId': 0, + 'type': '', + 'reportable': true, + 'writable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'AccessControl': { + 'clusterName': 'AccessControl', + 'clusterId': 31, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'Acl', + 'attributeId': 0, + 'type': '', + 'reportable': true, + 'writable': true + }, + 1: { + 'attributeName': 'Extension', + 'attributeId': 1, + 'type': '', + 'reportable': true, + 'writable': true + }, + 2: { + 'attributeName': 'SubjectsPerAccessControlEntry', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'TargetsPerAccessControlEntry', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 4: { + 'attributeName': 'AccessControlEntriesPerFabric', + 'attributeId': 4, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'Actions': { + 'clusterName': 'Actions', + 'clusterId': 37, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'InstantAction', + 'args': { + 'actionID': 'int', + 'invokeID': 'int' + } + }, + 1: { + 'commandId': 1, + 'commandName': 'InstantActionWithTransition', + 'args': { + 'actionID': 'int', + 'invokeID': 'int', + 'transitionTime': 'int' + } + }, + 2: { + 'commandId': 2, + 'commandName': 'StartAction', + 'args': { + 'actionID': 'int', + 'invokeID': 'int' + } + }, + 3: { + 'commandId': 3, + 'commandName': 'StartActionWithDuration', + 'args': { + 'actionID': 'int', + 'invokeID': 'int', + 'duration': 'int' + } + }, + 4: { + 'commandId': 4, + 'commandName': 'StopAction', + 'args': { + 'actionID': 'int', + 'invokeID': 'int' + } + }, + 5: { + 'commandId': 5, + 'commandName': 'PauseAction', + 'args': { + 'actionID': 'int', + 'invokeID': 'int' + } + }, + 6: { + 'commandId': 6, + 'commandName': 'PauseActionWithDuration', + 'args': { + 'actionID': 'int', + 'invokeID': 'int', + 'duration': 'int' + } + }, + 7: { + 'commandId': 7, + 'commandName': 'ResumeAction', + 'args': { + 'actionID': 'int', + 'invokeID': 'int' + } + }, + 8: { + 'commandId': 8, + 'commandName': 'EnableAction', + 'args': { + 'actionID': 'int', + 'invokeID': 'int' + } + }, + 9: { + 'commandId': 9, + 'commandName': 'EnableActionWithDuration', + 'args': { + 'actionID': 'int', + 'invokeID': 'int', + 'duration': 'int' + } + }, + 10: { + 'commandId': 10, + 'commandName': 'DisableAction', + 'args': { + 'actionID': 'int', + 'invokeID': 'int' + } + }, + 11: { + 'commandId': 11, + 'commandName': 'DisableActionWithDuration', + 'args': { + 'actionID': 'int', + 'invokeID': 'int', + 'duration': 'int' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'ActionList', + 'attributeId': 0, + 'type': '', + 'reportable': true + }, + 1: { + 'attributeName': 'EndpointLists', + 'attributeId': 1, + 'type': '', + 'reportable': true + }, + 2: { + 'attributeName': 'SetupURL', + 'attributeId': 2, + 'type': 'str', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'Basic': { + 'clusterName': 'Basic', + 'clusterId': 40, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'DataModelRevision', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'VendorName', + 'attributeId': 1, + 'type': 'str', + 'reportable': true + }, + 2: { + 'attributeName': 'VendorID', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'ProductName', + 'attributeId': 3, + 'type': 'str', + 'reportable': true + }, + 4: { + 'attributeName': 'ProductID', + 'attributeId': 4, + 'type': 'int', + 'reportable': true + }, + 5: { + 'attributeName': 'NodeLabel', + 'attributeId': 5, + 'type': 'str', + 'reportable': true, + 'writable': true + }, + 6: { + 'attributeName': 'Location', + 'attributeId': 6, + 'type': 'str', + 'reportable': true, + 'writable': true + }, + 7: { + 'attributeName': 'HardwareVersion', + 'attributeId': 7, + 'type': 'int', + 'reportable': true + }, + 8: { + 'attributeName': 'HardwareVersionString', + 'attributeId': 8, + 'type': 'str', + 'reportable': true + }, + 9: { + 'attributeName': 'SoftwareVersion', + 'attributeId': 9, + 'type': 'int', + 'reportable': true + }, + 10: { + 'attributeName': 'SoftwareVersionString', + 'attributeId': 10, + 'type': 'str', + 'reportable': true + }, + 11: { + 'attributeName': 'ManufacturingDate', + 'attributeId': 11, + 'type': 'str', + 'reportable': true + }, + 12: { + 'attributeName': 'PartNumber', + 'attributeId': 12, + 'type': 'str', + 'reportable': true + }, + 13: { + 'attributeName': 'ProductURL', + 'attributeId': 13, + 'type': 'str', + 'reportable': true + }, + 14: { + 'attributeName': 'ProductLabel', + 'attributeId': 14, + 'type': 'str', + 'reportable': true + }, + 15: { + 'attributeName': 'SerialNumber', + 'attributeId': 15, + 'type': 'str', + 'reportable': true + }, + 16: { + 'attributeName': 'LocalConfigDisabled', + 'attributeId': 16, + 'type': 'bool', + 'reportable': true, + 'writable': true + }, + 17: { + 'attributeName': 'Reachable', + 'attributeId': 17, + 'type': 'bool', + 'reportable': true + }, + 18: { + 'attributeName': 'UniqueID', + 'attributeId': 18, + 'type': 'str', + 'reportable': true + }, + 19: { + 'attributeName': 'CapabilityMinima', + 'attributeId': 19, + 'type': '', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'OtaSoftwareUpdateProvider': { + 'clusterName': 'OtaSoftwareUpdateProvider', + 'clusterId': 41, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'QueryImage', + 'args': { + 'vendorId': 'int', + 'productId': 'int', + 'softwareVersion': 'int', + 'protocolsSupported': 'int', + 'hardwareVersion': 'int', + 'location': 'str', + 'requestorCanConsent': 'bool', + 'metadataForProvider': 'bytes' + } + }, + 2: { + 'commandId': 2, + 'commandName': 'ApplyUpdateRequest', + 'args': { + 'updateToken': 'bytes', + 'newVersion': 'int' + } + }, + 4: { + 'commandId': 4, + 'commandName': 'NotifyUpdateApplied', + 'args': { + 'updateToken': 'bytes', + 'softwareVersion': 'int' + } + } + }, + 'attributes': { + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'OtaSoftwareUpdateRequestor': { + 'clusterName': 'OtaSoftwareUpdateRequestor', + 'clusterId': 42, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'AnnounceOtaProvider', + 'args': { + 'providerNodeId': 'int', + 'vendorId': 'int', + 'announcementReason': 'int', + 'metadataForNode': 'bytes', + 'endpoint': 'int' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'DefaultOtaProviders', + 'attributeId': 0, + 'type': '', + 'reportable': true, + 'writable': true + }, + 1: { + 'attributeName': 'UpdatePossible', + 'attributeId': 1, + 'type': 'bool', + 'reportable': true + }, + 2: { + 'attributeName': 'UpdateState', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'UpdateStateProgress', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'LocalizationConfiguration': { + 'clusterName': 'LocalizationConfiguration', + 'clusterId': 43, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'ActiveLocale', + 'attributeId': 0, + 'type': 'str', + 'reportable': true, + 'writable': true + }, + 1: { + 'attributeName': 'SupportedLocales', + 'attributeId': 1, + 'type': 'str', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'TimeFormatLocalization': { + 'clusterName': 'TimeFormatLocalization', + 'clusterId': 44, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'HourFormat', + 'attributeId': 0, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 1: { + 'attributeName': 'ActiveCalendarType', + 'attributeId': 1, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 2: { + 'attributeName': 'SupportedCalendarTypes', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'UnitLocalization': { + 'clusterName': 'UnitLocalization', + 'clusterId': 45, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'TemperatureUnit', + 'attributeId': 0, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'PowerSourceConfiguration': { + 'clusterName': 'PowerSourceConfiguration', + 'clusterId': 46, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'Sources', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'PowerSource': { + 'clusterName': 'PowerSource', + 'clusterId': 47, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'Status', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'Order', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'Description', + 'attributeId': 2, + 'type': 'str', + 'reportable': true + }, + 3: { + 'attributeName': 'WiredAssessedInputVoltage', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 4: { + 'attributeName': 'WiredAssessedInputFrequency', + 'attributeId': 4, + 'type': 'int', + 'reportable': true + }, + 5: { + 'attributeName': 'WiredCurrentType', + 'attributeId': 5, + 'type': 'int', + 'reportable': true + }, + 6: { + 'attributeName': 'WiredAssessedCurrent', + 'attributeId': 6, + 'type': 'int', + 'reportable': true + }, + 7: { + 'attributeName': 'WiredNominalVoltage', + 'attributeId': 7, + 'type': 'int', + 'reportable': true + }, + 8: { + 'attributeName': 'WiredMaximumCurrent', + 'attributeId': 8, + 'type': 'int', + 'reportable': true + }, + 9: { + 'attributeName': 'WiredPresent', + 'attributeId': 9, + 'type': 'bool', + 'reportable': true + }, + 10: { + 'attributeName': 'ActiveWiredFaults', + 'attributeId': 10, + 'type': 'int', + 'reportable': true + }, + 11: { + 'attributeName': 'BatVoltage', + 'attributeId': 11, + 'type': 'int', + 'reportable': true + }, + 12: { + 'attributeName': 'BatPercentRemaining', + 'attributeId': 12, + 'type': 'int', + 'reportable': true + }, + 13: { + 'attributeName': 'BatTimeRemaining', + 'attributeId': 13, + 'type': 'int', + 'reportable': true + }, + 14: { + 'attributeName': 'BatChargeLevel', + 'attributeId': 14, + 'type': 'int', + 'reportable': true + }, + 15: { + 'attributeName': 'BatReplacementNeeded', + 'attributeId': 15, + 'type': 'bool', + 'reportable': true + }, + 16: { + 'attributeName': 'BatReplaceability', + 'attributeId': 16, + 'type': 'int', + 'reportable': true + }, + 17: { + 'attributeName': 'BatPresent', + 'attributeId': 17, + 'type': 'bool', + 'reportable': true + }, + 18: { + 'attributeName': 'ActiveBatFaults', + 'attributeId': 18, + 'type': 'int', + 'reportable': true + }, + 19: { + 'attributeName': 'BatReplacementDescription', + 'attributeId': 19, + 'type': 'str', + 'reportable': true + }, + 20: { + 'attributeName': 'BatCommonDesignation', + 'attributeId': 20, + 'type': 'int', + 'reportable': true + }, + 21: { + 'attributeName': 'BatANSIDesignation', + 'attributeId': 21, + 'type': 'str', + 'reportable': true + }, + 22: { + 'attributeName': 'BatIECDesignation', + 'attributeId': 22, + 'type': 'str', + 'reportable': true + }, + 23: { + 'attributeName': 'BatApprovedChemistry', + 'attributeId': 23, + 'type': 'int', + 'reportable': true + }, + 24: { + 'attributeName': 'BatCapacity', + 'attributeId': 24, + 'type': 'int', + 'reportable': true + }, + 25: { + 'attributeName': 'BatQuantity', + 'attributeId': 25, + 'type': 'int', + 'reportable': true + }, + 26: { + 'attributeName': 'BatChargeState', + 'attributeId': 26, + 'type': 'int', + 'reportable': true + }, + 27: { + 'attributeName': 'BatTimeToFullCharge', + 'attributeId': 27, + 'type': 'int', + 'reportable': true + }, + 28: { + 'attributeName': 'BatFunctionalWhileCharging', + 'attributeId': 28, + 'type': 'bool', + 'reportable': true + }, + 29: { + 'attributeName': 'BatChargingCurrent', + 'attributeId': 29, + 'type': 'int', + 'reportable': true + }, + 30: { + 'attributeName': 'ActiveBatChargeFaults', + 'attributeId': 30, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'GeneralCommissioning': { + 'clusterName': 'GeneralCommissioning', + 'clusterId': 48, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'ArmFailSafe', + 'args': { + 'expiryLengthSeconds': 'int', + 'breadcrumb': 'int' + } + }, + 2: { + 'commandId': 2, + 'commandName': 'SetRegulatoryConfig', + 'args': { + 'newRegulatoryConfig': 'int', + 'countryCode': 'str', + 'breadcrumb': 'int' + } + }, + 4: { + 'commandId': 4, + 'commandName': 'CommissioningComplete', + 'args': {} + } + }, + 'attributes': { + 0: { + 'attributeName': 'Breadcrumb', + 'attributeId': 0, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 1: { + 'attributeName': 'BasicCommissioningInfo', + 'attributeId': 1, + 'type': '', + 'reportable': true + }, + 2: { + 'attributeName': 'RegulatoryConfig', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'LocationCapability', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 4: { + 'attributeName': 'SupportsConcurrentConnection', + 'attributeId': 4, + 'type': 'bool', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'NetworkCommissioning': { + 'clusterName': 'NetworkCommissioning', + 'clusterId': 49, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'ScanNetworks', + 'args': { + 'ssid': 'bytes', + 'breadcrumb': 'int' + } + }, + 2: { + 'commandId': 2, + 'commandName': 'AddOrUpdateWiFiNetwork', + 'args': { + 'ssid': 'bytes', + 'credentials': 'bytes', + 'breadcrumb': 'int' + } + }, + 3: { + 'commandId': 3, + 'commandName': 'AddOrUpdateThreadNetwork', + 'args': { + 'operationalDataset': 'bytes', + 'breadcrumb': 'int' + } + }, + 4: { + 'commandId': 4, + 'commandName': 'RemoveNetwork', + 'args': { + 'networkID': 'bytes', + 'breadcrumb': 'int' + } + }, + 6: { + 'commandId': 6, + 'commandName': 'ConnectNetwork', + 'args': { + 'networkID': 'bytes', + 'breadcrumb': 'int' + } + }, + 8: { + 'commandId': 8, + 'commandName': 'ReorderNetwork', + 'args': { + 'networkID': 'bytes', + 'networkIndex': 'int', + 'breadcrumb': 'int' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'MaxNetworks', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'Networks', + 'attributeId': 1, + 'type': '', + 'reportable': true + }, + 2: { + 'attributeName': 'ScanMaxTimeSeconds', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'ConnectMaxTimeSeconds', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 4: { + 'attributeName': 'InterfaceEnabled', + 'attributeId': 4, + 'type': 'bool', + 'reportable': true, + 'writable': true + }, + 5: { + 'attributeName': 'LastNetworkingStatus', + 'attributeId': 5, + 'type': 'int', + 'reportable': true + }, + 6: { + 'attributeName': 'LastNetworkID', + 'attributeId': 6, + 'type': 'bytes', + 'reportable': true + }, + 7: { + 'attributeName': 'LastConnectErrorValue', + 'attributeId': 7, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'DiagnosticLogs': { + 'clusterName': 'DiagnosticLogs', + 'clusterId': 50, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'RetrieveLogsRequest', + 'args': { + 'intent': 'int', + 'requestedProtocol': 'int', + 'transferFileDesignator': 'bytes' + } + } + }, + 'attributes': { + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'GeneralDiagnostics': { + 'clusterName': 'GeneralDiagnostics', + 'clusterId': 51, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'TestEventTrigger', + 'args': { + 'enableKey': 'bytes', + 'eventTrigger': 'int' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'NetworkInterfaces', + 'attributeId': 0, + 'type': '', + 'reportable': true + }, + 1: { + 'attributeName': 'RebootCount', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'UpTime', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'TotalOperationalHours', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 4: { + 'attributeName': 'BootReasons', + 'attributeId': 4, + 'type': 'int', + 'reportable': true + }, + 5: { + 'attributeName': 'ActiveHardwareFaults', + 'attributeId': 5, + 'type': 'int', + 'reportable': true + }, + 6: { + 'attributeName': 'ActiveRadioFaults', + 'attributeId': 6, + 'type': 'int', + 'reportable': true + }, + 7: { + 'attributeName': 'ActiveNetworkFaults', + 'attributeId': 7, + 'type': 'int', + 'reportable': true + }, + 8: { + 'attributeName': 'TestEventTriggersEnabled', + 'attributeId': 8, + 'type': 'bool', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'SoftwareDiagnostics': { + 'clusterName': 'SoftwareDiagnostics', + 'clusterId': 52, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'ResetWatermarks', + 'args': {} + } + }, + 'attributes': { + 0: { + 'attributeName': 'ThreadMetrics', + 'attributeId': 0, + 'type': '', + 'reportable': true + }, + 1: { + 'attributeName': 'CurrentHeapFree', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'CurrentHeapUsed', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'CurrentHeapHighWatermark', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'ThreadNetworkDiagnostics': { + 'clusterName': 'ThreadNetworkDiagnostics', + 'clusterId': 53, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'ResetCounts', + 'args': {} + } + }, + 'attributes': { + 0: { + 'attributeName': 'Channel', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'RoutingRole', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'NetworkName', + 'attributeId': 2, + 'type': 'str', + 'reportable': true + }, + 3: { + 'attributeName': 'PanId', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 4: { + 'attributeName': 'ExtendedPanId', + 'attributeId': 4, + 'type': 'int', + 'reportable': true + }, + 5: { + 'attributeName': 'MeshLocalPrefix', + 'attributeId': 5, + 'type': 'bytes', + 'reportable': true + }, + 6: { + 'attributeName': 'OverrunCount', + 'attributeId': 6, + 'type': 'int', + 'reportable': true + }, + 7: { + 'attributeName': 'NeighborTableList', + 'attributeId': 7, + 'type': '', + 'reportable': true + }, + 8: { + 'attributeName': 'RouteTableList', + 'attributeId': 8, + 'type': '', + 'reportable': true + }, + 9: { + 'attributeName': 'PartitionId', + 'attributeId': 9, + 'type': 'int', + 'reportable': true + }, + 10: { + 'attributeName': 'Weighting', + 'attributeId': 10, + 'type': 'int', + 'reportable': true + }, + 11: { + 'attributeName': 'DataVersion', + 'attributeId': 11, + 'type': 'int', + 'reportable': true + }, + 12: { + 'attributeName': 'StableDataVersion', + 'attributeId': 12, + 'type': 'int', + 'reportable': true + }, + 13: { + 'attributeName': 'LeaderRouterId', + 'attributeId': 13, + 'type': 'int', + 'reportable': true + }, + 14: { + 'attributeName': 'DetachedRoleCount', + 'attributeId': 14, + 'type': 'int', + 'reportable': true + }, + 15: { + 'attributeName': 'ChildRoleCount', + 'attributeId': 15, + 'type': 'int', + 'reportable': true + }, + 16: { + 'attributeName': 'RouterRoleCount', + 'attributeId': 16, + 'type': 'int', + 'reportable': true + }, + 17: { + 'attributeName': 'LeaderRoleCount', + 'attributeId': 17, + 'type': 'int', + 'reportable': true + }, + 18: { + 'attributeName': 'AttachAttemptCount', + 'attributeId': 18, + 'type': 'int', + 'reportable': true + }, + 19: { + 'attributeName': 'PartitionIdChangeCount', + 'attributeId': 19, + 'type': 'int', + 'reportable': true + }, + 20: { + 'attributeName': 'BetterPartitionAttachAttemptCount', + 'attributeId': 20, + 'type': 'int', + 'reportable': true + }, + 21: { + 'attributeName': 'ParentChangeCount', + 'attributeId': 21, + 'type': 'int', + 'reportable': true + }, + 22: { + 'attributeName': 'TxTotalCount', + 'attributeId': 22, + 'type': 'int', + 'reportable': true + }, + 23: { + 'attributeName': 'TxUnicastCount', + 'attributeId': 23, + 'type': 'int', + 'reportable': true + }, + 24: { + 'attributeName': 'TxBroadcastCount', + 'attributeId': 24, + 'type': 'int', + 'reportable': true + }, + 25: { + 'attributeName': 'TxAckRequestedCount', + 'attributeId': 25, + 'type': 'int', + 'reportable': true + }, + 26: { + 'attributeName': 'TxAckedCount', + 'attributeId': 26, + 'type': 'int', + 'reportable': true + }, + 27: { + 'attributeName': 'TxNoAckRequestedCount', + 'attributeId': 27, + 'type': 'int', + 'reportable': true + }, + 28: { + 'attributeName': 'TxDataCount', + 'attributeId': 28, + 'type': 'int', + 'reportable': true + }, + 29: { + 'attributeName': 'TxDataPollCount', + 'attributeId': 29, + 'type': 'int', + 'reportable': true + }, + 30: { + 'attributeName': 'TxBeaconCount', + 'attributeId': 30, + 'type': 'int', + 'reportable': true + }, + 31: { + 'attributeName': 'TxBeaconRequestCount', + 'attributeId': 31, + 'type': 'int', + 'reportable': true + }, + 32: { + 'attributeName': 'TxOtherCount', + 'attributeId': 32, + 'type': 'int', + 'reportable': true + }, + 33: { + 'attributeName': 'TxRetryCount', + 'attributeId': 33, + 'type': 'int', + 'reportable': true + }, + 34: { + 'attributeName': 'TxDirectMaxRetryExpiryCount', + 'attributeId': 34, + 'type': 'int', + 'reportable': true + }, + 35: { + 'attributeName': 'TxIndirectMaxRetryExpiryCount', + 'attributeId': 35, + 'type': 'int', + 'reportable': true + }, + 36: { + 'attributeName': 'TxErrCcaCount', + 'attributeId': 36, + 'type': 'int', + 'reportable': true + }, + 37: { + 'attributeName': 'TxErrAbortCount', + 'attributeId': 37, + 'type': 'int', + 'reportable': true + }, + 38: { + 'attributeName': 'TxErrBusyChannelCount', + 'attributeId': 38, + 'type': 'int', + 'reportable': true + }, + 39: { + 'attributeName': 'RxTotalCount', + 'attributeId': 39, + 'type': 'int', + 'reportable': true + }, + 40: { + 'attributeName': 'RxUnicastCount', + 'attributeId': 40, + 'type': 'int', + 'reportable': true + }, + 41: { + 'attributeName': 'RxBroadcastCount', + 'attributeId': 41, + 'type': 'int', + 'reportable': true + }, + 42: { + 'attributeName': 'RxDataCount', + 'attributeId': 42, + 'type': 'int', + 'reportable': true + }, + 43: { + 'attributeName': 'RxDataPollCount', + 'attributeId': 43, + 'type': 'int', + 'reportable': true + }, + 44: { + 'attributeName': 'RxBeaconCount', + 'attributeId': 44, + 'type': 'int', + 'reportable': true + }, + 45: { + 'attributeName': 'RxBeaconRequestCount', + 'attributeId': 45, + 'type': 'int', + 'reportable': true + }, + 46: { + 'attributeName': 'RxOtherCount', + 'attributeId': 46, + 'type': 'int', + 'reportable': true + }, + 47: { + 'attributeName': 'RxAddressFilteredCount', + 'attributeId': 47, + 'type': 'int', + 'reportable': true + }, + 48: { + 'attributeName': 'RxDestAddrFilteredCount', + 'attributeId': 48, + 'type': 'int', + 'reportable': true + }, + 49: { + 'attributeName': 'RxDuplicatedCount', + 'attributeId': 49, + 'type': 'int', + 'reportable': true + }, + 50: { + 'attributeName': 'RxErrNoFrameCount', + 'attributeId': 50, + 'type': 'int', + 'reportable': true + }, + 51: { + 'attributeName': 'RxErrUnknownNeighborCount', + 'attributeId': 51, + 'type': 'int', + 'reportable': true + }, + 52: { + 'attributeName': 'RxErrInvalidSrcAddrCount', + 'attributeId': 52, + 'type': 'int', + 'reportable': true + }, + 53: { + 'attributeName': 'RxErrSecCount', + 'attributeId': 53, + 'type': 'int', + 'reportable': true + }, + 54: { + 'attributeName': 'RxErrFcsCount', + 'attributeId': 54, + 'type': 'int', + 'reportable': true + }, + 55: { + 'attributeName': 'RxErrOtherCount', + 'attributeId': 55, + 'type': 'int', + 'reportable': true + }, + 56: { + 'attributeName': 'ActiveTimestamp', + 'attributeId': 56, + 'type': 'int', + 'reportable': true + }, + 57: { + 'attributeName': 'PendingTimestamp', + 'attributeId': 57, + 'type': 'int', + 'reportable': true + }, + 58: { + 'attributeName': 'Delay', + 'attributeId': 58, + 'type': 'int', + 'reportable': true + }, + 59: { + 'attributeName': 'SecurityPolicy', + 'attributeId': 59, + 'type': '', + 'reportable': true + }, + 60: { + 'attributeName': 'ChannelPage0Mask', + 'attributeId': 60, + 'type': 'bytes', + 'reportable': true + }, + 61: { + 'attributeName': 'OperationalDatasetComponents', + 'attributeId': 61, + 'type': '', + 'reportable': true + }, + 62: { + 'attributeName': 'ActiveNetworkFaultsList', + 'attributeId': 62, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'WiFiNetworkDiagnostics': { + 'clusterName': 'WiFiNetworkDiagnostics', + 'clusterId': 54, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'ResetCounts', + 'args': {} + } + }, + 'attributes': { + 0: { + 'attributeName': 'Bssid', + 'attributeId': 0, + 'type': 'bytes', + 'reportable': true + }, + 1: { + 'attributeName': 'SecurityType', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'WiFiVersion', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'ChannelNumber', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 4: { + 'attributeName': 'Rssi', + 'attributeId': 4, + 'type': 'int', + 'reportable': true + }, + 5: { + 'attributeName': 'BeaconLostCount', + 'attributeId': 5, + 'type': 'int', + 'reportable': true + }, + 6: { + 'attributeName': 'BeaconRxCount', + 'attributeId': 6, + 'type': 'int', + 'reportable': true + }, + 7: { + 'attributeName': 'PacketMulticastRxCount', + 'attributeId': 7, + 'type': 'int', + 'reportable': true + }, + 8: { + 'attributeName': 'PacketMulticastTxCount', + 'attributeId': 8, + 'type': 'int', + 'reportable': true + }, + 9: { + 'attributeName': 'PacketUnicastRxCount', + 'attributeId': 9, + 'type': 'int', + 'reportable': true + }, + 10: { + 'attributeName': 'PacketUnicastTxCount', + 'attributeId': 10, + 'type': 'int', + 'reportable': true + }, + 11: { + 'attributeName': 'CurrentMaxRate', + 'attributeId': 11, + 'type': 'int', + 'reportable': true + }, + 12: { + 'attributeName': 'OverrunCount', + 'attributeId': 12, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'EthernetNetworkDiagnostics': { + 'clusterName': 'EthernetNetworkDiagnostics', + 'clusterId': 55, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'ResetCounts', + 'args': {} + } + }, + 'attributes': { + 0: { + 'attributeName': 'PHYRate', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'FullDuplex', + 'attributeId': 1, + 'type': 'bool', + 'reportable': true + }, + 2: { + 'attributeName': 'PacketRxCount', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'PacketTxCount', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 4: { + 'attributeName': 'TxErrCount', + 'attributeId': 4, + 'type': 'int', + 'reportable': true + }, + 5: { + 'attributeName': 'CollisionCount', + 'attributeId': 5, + 'type': 'int', + 'reportable': true + }, + 6: { + 'attributeName': 'OverrunCount', + 'attributeId': 6, + 'type': 'int', + 'reportable': true + }, + 7: { + 'attributeName': 'CarrierDetect', + 'attributeId': 7, + 'type': 'bool', + 'reportable': true + }, + 8: { + 'attributeName': 'TimeSinceReset', + 'attributeId': 8, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'BridgedDeviceBasic': { + 'clusterName': 'BridgedDeviceBasic', + 'clusterId': 57, + 'commands': {}, + 'attributes': { + 1: { + 'attributeName': 'VendorName', + 'attributeId': 1, + 'type': 'str', + 'reportable': true + }, + 2: { + 'attributeName': 'VendorID', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'ProductName', + 'attributeId': 3, + 'type': 'str', + 'reportable': true + }, + 5: { + 'attributeName': 'NodeLabel', + 'attributeId': 5, + 'type': 'str', + 'reportable': true, + 'writable': true + }, + 7: { + 'attributeName': 'HardwareVersion', + 'attributeId': 7, + 'type': 'int', + 'reportable': true + }, + 8: { + 'attributeName': 'HardwareVersionString', + 'attributeId': 8, + 'type': 'str', + 'reportable': true + }, + 9: { + 'attributeName': 'SoftwareVersion', + 'attributeId': 9, + 'type': 'int', + 'reportable': true + }, + 10: { + 'attributeName': 'SoftwareVersionString', + 'attributeId': 10, + 'type': 'str', + 'reportable': true + }, + 11: { + 'attributeName': 'ManufacturingDate', + 'attributeId': 11, + 'type': 'str', + 'reportable': true + }, + 12: { + 'attributeName': 'PartNumber', + 'attributeId': 12, + 'type': 'str', + 'reportable': true + }, + 13: { + 'attributeName': 'ProductURL', + 'attributeId': 13, + 'type': 'str', + 'reportable': true + }, + 14: { + 'attributeName': 'ProductLabel', + 'attributeId': 14, + 'type': 'str', + 'reportable': true + }, + 15: { + 'attributeName': 'SerialNumber', + 'attributeId': 15, + 'type': 'str', + 'reportable': true + }, + 17: { + 'attributeName': 'Reachable', + 'attributeId': 17, + 'type': 'bool', + 'reportable': true + }, + 18: { + 'attributeName': 'UniqueID', + 'attributeId': 18, + 'type': 'str', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'Switch': { + 'clusterName': 'Switch', + 'clusterId': 59, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'NumberOfPositions', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'CurrentPosition', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'MultiPressMax', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'AdministratorCommissioning': { + 'clusterName': 'AdministratorCommissioning', + 'clusterId': 60, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'OpenCommissioningWindow', + 'args': { + 'commissioningTimeout': 'int', + 'PAKEVerifier': 'bytes', + 'discriminator': 'int', + 'iterations': 'int', + 'salt': 'bytes' + } + }, + 1: { + 'commandId': 1, + 'commandName': 'OpenBasicCommissioningWindow', + 'args': { + 'commissioningTimeout': 'int' + } + }, + 2: { + 'commandId': 2, + 'commandName': 'RevokeCommissioning', + 'args': {} + } + }, + 'attributes': { + 0: { + 'attributeName': 'WindowStatus', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'AdminFabricIndex', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'AdminVendorId', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'OperationalCredentials': { + 'clusterName': 'OperationalCredentials', + 'clusterId': 62, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'AttestationRequest', + 'args': { + 'attestationNonce': 'bytes' + } + }, + 2: { + 'commandId': 2, + 'commandName': 'CertificateChainRequest', + 'args': { + 'certificateType': 'int' + } + }, + 4: { + 'commandId': 4, + 'commandName': 'CSRRequest', + 'args': { + 'CSRNonce': 'bytes', + 'isForUpdateNOC': 'bool' + } + }, + 6: { + 'commandId': 6, + 'commandName': 'AddNOC', + 'args': { + 'NOCValue': 'bytes', + 'ICACValue': 'bytes', + 'IPKValue': 'bytes', + 'caseAdminSubject': 'int', + 'adminVendorId': 'int' + } + }, + 7: { + 'commandId': 7, + 'commandName': 'UpdateNOC', + 'args': { + 'NOCValue': 'bytes', + 'ICACValue': 'bytes' + } + }, + 9: { + 'commandId': 9, + 'commandName': 'UpdateFabricLabel', + 'args': { + 'label': 'str' + } + }, + 10: { + 'commandId': 10, + 'commandName': 'RemoveFabric', + 'args': { + 'fabricIndex': 'int' + } + }, + 11: { + 'commandId': 11, + 'commandName': 'AddTrustedRootCertificate', + 'args': { + 'rootCertificate': 'bytes' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'NOCs', + 'attributeId': 0, + 'type': '', + 'reportable': true + }, + 1: { + 'attributeName': 'Fabrics', + 'attributeId': 1, + 'type': '', + 'reportable': true + }, + 2: { + 'attributeName': 'SupportedFabrics', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'CommissionedFabrics', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 4: { + 'attributeName': 'TrustedRootCertificates', + 'attributeId': 4, + 'type': 'bytes', + 'reportable': true + }, + 5: { + 'attributeName': 'CurrentFabricIndex', + 'attributeId': 5, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'GroupKeyManagement': { + 'clusterName': 'GroupKeyManagement', + 'clusterId': 63, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'KeySetWrite', + 'args': { + 'groupKeySetID': 'int', + 'groupKeySecurityPolicy': 'int', + 'epochKey0': 'bytes', + 'epochStartTime0': 'int', + 'epochKey1': 'bytes', + 'epochStartTime1': 'int', + 'epochKey2': 'bytes', + 'epochStartTime2': 'int' + } + }, + 1: { + 'commandId': 1, + 'commandName': 'KeySetRead', + 'args': { + 'groupKeySetID': 'int' + } + }, + 3: { + 'commandId': 3, + 'commandName': 'KeySetRemove', + 'args': { + 'groupKeySetID': 'int' + } + }, + 4: { + 'commandId': 4, + 'commandName': 'KeySetReadAllIndices', + 'args': { + 'groupKeySetIDs': 'int' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'GroupKeyMap', + 'attributeId': 0, + 'type': '', + 'reportable': true, + 'writable': true + }, + 1: { + 'attributeName': 'GroupTable', + 'attributeId': 1, + 'type': '', + 'reportable': true + }, + 2: { + 'attributeName': 'MaxGroupsPerFabric', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'MaxGroupKeysPerFabric', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'FixedLabel': { + 'clusterName': 'FixedLabel', + 'clusterId': 64, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'LabelList', + 'attributeId': 0, + 'type': '', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'UserLabel': { + 'clusterName': 'UserLabel', + 'clusterId': 65, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'LabelList', + 'attributeId': 0, + 'type': '', + 'reportable': true, + 'writable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'BooleanState': { + 'clusterName': 'BooleanState', + 'clusterId': 69, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'StateValue', + 'attributeId': 0, + 'type': 'bool', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'ModeSelect': { + 'clusterName': 'ModeSelect', + 'clusterId': 80, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'ChangeToMode', + 'args': { + 'newMode': 'int' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'Description', + 'attributeId': 0, + 'type': 'str', + 'reportable': true + }, + 1: { + 'attributeName': 'StandardNamespace', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'SupportedModes', + 'attributeId': 2, + 'type': '', + 'reportable': true + }, + 3: { + 'attributeName': 'CurrentMode', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 4: { + 'attributeName': 'StartUpMode', + 'attributeId': 4, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 5: { + 'attributeName': 'OnMode', + 'attributeId': 5, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'DoorLock': { + 'clusterName': 'DoorLock', + 'clusterId': 257, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'LockDoor', + 'args': { + 'pinCode': 'bytes' + } + }, + 1: { + 'commandId': 1, + 'commandName': 'UnlockDoor', + 'args': { + 'pinCode': 'bytes' + } + }, + 3: { + 'commandId': 3, + 'commandName': 'UnlockWithTimeout', + 'args': { + 'timeout': 'int', + 'pinCode': 'bytes' + } + }, + 11: { + 'commandId': 11, + 'commandName': 'SetWeekDaySchedule', + 'args': { + 'weekDayIndex': 'int', + 'userIndex': 'int', + 'daysMask': 'int', + 'startHour': 'int', + 'startMinute': 'int', + 'endHour': 'int', + 'endMinute': 'int' + } + }, + 12: { + 'commandId': 12, + 'commandName': 'GetWeekDaySchedule', + 'args': { + 'weekDayIndex': 'int', + 'userIndex': 'int' + } + }, + 13: { + 'commandId': 13, + 'commandName': 'ClearWeekDaySchedule', + 'args': { + 'weekDayIndex': 'int', + 'userIndex': 'int' + } + }, + 14: { + 'commandId': 14, + 'commandName': 'SetYearDaySchedule', + 'args': { + 'yearDayIndex': 'int', + 'userIndex': 'int', + 'localStartTime': 'int', + 'localEndTime': 'int' + } + }, + 15: { + 'commandId': 15, + 'commandName': 'GetYearDaySchedule', + 'args': { + 'yearDayIndex': 'int', + 'userIndex': 'int' + } + }, + 16: { + 'commandId': 16, + 'commandName': 'ClearYearDaySchedule', + 'args': { + 'yearDayIndex': 'int', + 'userIndex': 'int' + } + }, + 17: { + 'commandId': 17, + 'commandName': 'SetHolidaySchedule', + 'args': { + 'holidayIndex': 'int', + 'localStartTime': 'int', + 'localEndTime': 'int', + 'operatingMode': 'int' + } + }, + 18: { + 'commandId': 18, + 'commandName': 'GetHolidaySchedule', + 'args': { + 'holidayIndex': 'int' + } + }, + 19: { + 'commandId': 19, + 'commandName': 'ClearHolidaySchedule', + 'args': { + 'holidayIndex': 'int' + } + }, + 26: { + 'commandId': 26, + 'commandName': 'SetUser', + 'args': { + 'operationType': 'int', + 'userIndex': 'int', + 'userName': 'str', + 'userUniqueId': 'int', + 'userStatus': 'int', + 'userType': 'int', + 'credentialRule': 'int' + } + }, + 27: { + 'commandId': 27, + 'commandName': 'GetUser', + 'args': { + 'userIndex': 'int' + } + }, + 29: { + 'commandId': 29, + 'commandName': 'ClearUser', + 'args': { + 'userIndex': 'int' + } + }, + 34: { + 'commandId': 34, + 'commandName': 'SetCredential', + 'args': { + 'operationType': 'int', + 'credentialType': 'int', + 'credentialIndex': 'int', + 'credentialData': 'bytes', + 'userIndex': 'int', + 'userStatus': 'int', + 'userType': 'int' + } + }, + 36: { + 'commandId': 36, + 'commandName': 'GetCredentialStatus', + 'args': { + 'credentialType': 'int', + 'credentialIndex': 'int' + } + }, + 38: { + 'commandId': 38, + 'commandName': 'ClearCredential', + 'args': { + 'credentialType': 'int', + 'credentialIndex': 'int' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'LockState', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'LockType', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'ActuatorEnabled', + 'attributeId': 2, + 'type': 'bool', + 'reportable': true + }, + 3: { + 'attributeName': 'DoorState', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 17: { + 'attributeName': 'NumberOfTotalUsersSupported', + 'attributeId': 17, + 'type': 'int', + 'reportable': true + }, + 18: { + 'attributeName': 'NumberOfPINUsersSupported', + 'attributeId': 18, + 'type': 'int', + 'reportable': true + }, + 19: { + 'attributeName': 'NumberOfRFIDUsersSupported', + 'attributeId': 19, + 'type': 'int', + 'reportable': true + }, + 20: { + 'attributeName': 'NumberOfWeekDaySchedulesSupportedPerUser', + 'attributeId': 20, + 'type': 'int', + 'reportable': true + }, + 21: { + 'attributeName': 'NumberOfYearDaySchedulesSupportedPerUser', + 'attributeId': 21, + 'type': 'int', + 'reportable': true + }, + 22: { + 'attributeName': 'NumberOfHolidaySchedulesSupported', + 'attributeId': 22, + 'type': 'int', + 'reportable': true + }, + 23: { + 'attributeName': 'MaxPINCodeLength', + 'attributeId': 23, + 'type': 'int', + 'reportable': true + }, + 24: { + 'attributeName': 'MinPINCodeLength', + 'attributeId': 24, + 'type': 'int', + 'reportable': true + }, + 25: { + 'attributeName': 'MaxRFIDCodeLength', + 'attributeId': 25, + 'type': 'int', + 'reportable': true + }, + 26: { + 'attributeName': 'MinRFIDCodeLength', + 'attributeId': 26, + 'type': 'int', + 'reportable': true + }, + 28: { + 'attributeName': 'NumberOfCredentialsSupportedPerUser', + 'attributeId': 28, + 'type': 'int', + 'reportable': true + }, + 33: { + 'attributeName': 'Language', + 'attributeId': 33, + 'type': 'str', + 'reportable': true, + 'writable': true + }, + 35: { + 'attributeName': 'AutoRelockTime', + 'attributeId': 35, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 36: { + 'attributeName': 'SoundVolume', + 'attributeId': 36, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 37: { + 'attributeName': 'OperatingMode', + 'attributeId': 37, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 38: { + 'attributeName': 'SupportedOperatingModes', + 'attributeId': 38, + 'type': 'int', + 'reportable': true + }, + 41: { + 'attributeName': 'EnableOneTouchLocking', + 'attributeId': 41, + 'type': 'bool', + 'reportable': true, + 'writable': true + }, + 43: { + 'attributeName': 'EnablePrivacyModeButton', + 'attributeId': 43, + 'type': 'bool', + 'reportable': true, + 'writable': true + }, + 48: { + 'attributeName': 'WrongCodeEntryLimit', + 'attributeId': 48, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 49: { + 'attributeName': 'UserCodeTemporaryDisableTime', + 'attributeId': 49, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 51: { + 'attributeName': 'RequirePINforRemoteOperation', + 'attributeId': 51, + 'type': 'bool', + 'writable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'WindowCovering': { + 'clusterName': 'WindowCovering', + 'clusterId': 258, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'UpOrOpen', + 'args': {} + }, + 1: { + 'commandId': 1, + 'commandName': 'DownOrClose', + 'args': {} + }, + 2: { + 'commandId': 2, + 'commandName': 'StopMotion', + 'args': {} + }, + 4: { + 'commandId': 4, + 'commandName': 'GoToLiftValue', + 'args': { + 'liftValue': 'int' + } + }, + 5: { + 'commandId': 5, + 'commandName': 'GoToLiftPercentage', + 'args': { + 'liftPercent100thsValue': 'int' + } + }, + 7: { + 'commandId': 7, + 'commandName': 'GoToTiltValue', + 'args': { + 'tiltValue': 'int' + } + }, + 8: { + 'commandId': 8, + 'commandName': 'GoToTiltPercentage', + 'args': { + 'tiltPercent100thsValue': 'int' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'Type', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'PhysicalClosedLimitLift', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'PhysicalClosedLimitTilt', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'CurrentPositionLift', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 4: { + 'attributeName': 'CurrentPositionTilt', + 'attributeId': 4, + 'type': 'int', + 'reportable': true + }, + 5: { + 'attributeName': 'NumberOfActuationsLift', + 'attributeId': 5, + 'type': 'int', + 'reportable': true + }, + 6: { + 'attributeName': 'NumberOfActuationsTilt', + 'attributeId': 6, + 'type': 'int', + 'reportable': true + }, + 7: { + 'attributeName': 'ConfigStatus', + 'attributeId': 7, + 'type': 'int', + 'reportable': true + }, + 8: { + 'attributeName': 'CurrentPositionLiftPercentage', + 'attributeId': 8, + 'type': 'int', + 'reportable': true + }, + 9: { + 'attributeName': 'CurrentPositionTiltPercentage', + 'attributeId': 9, + 'type': 'int', + 'reportable': true + }, + 10: { + 'attributeName': 'OperationalStatus', + 'attributeId': 10, + 'type': 'int', + 'reportable': true + }, + 11: { + 'attributeName': 'TargetPositionLiftPercent100ths', + 'attributeId': 11, + 'type': 'int', + 'reportable': true + }, + 12: { + 'attributeName': 'TargetPositionTiltPercent100ths', + 'attributeId': 12, + 'type': 'int', + 'reportable': true + }, + 13: { + 'attributeName': 'EndProductType', + 'attributeId': 13, + 'type': 'int', + 'reportable': true + }, + 14: { + 'attributeName': 'CurrentPositionLiftPercent100ths', + 'attributeId': 14, + 'type': 'int', + 'reportable': true + }, + 15: { + 'attributeName': 'CurrentPositionTiltPercent100ths', + 'attributeId': 15, + 'type': 'int', + 'reportable': true + }, + 16: { + 'attributeName': 'InstalledOpenLimitLift', + 'attributeId': 16, + 'type': 'int', + 'reportable': true + }, + 17: { + 'attributeName': 'InstalledClosedLimitLift', + 'attributeId': 17, + 'type': 'int', + 'reportable': true + }, + 18: { + 'attributeName': 'InstalledOpenLimitTilt', + 'attributeId': 18, + 'type': 'int', + 'reportable': true + }, + 19: { + 'attributeName': 'InstalledClosedLimitTilt', + 'attributeId': 19, + 'type': 'int', + 'reportable': true + }, + 23: { + 'attributeName': 'Mode', + 'attributeId': 23, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 26: { + 'attributeName': 'SafetyStatus', + 'attributeId': 26, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'BarrierControl': { + 'clusterName': 'BarrierControl', + 'clusterId': 259, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'BarrierControlGoToPercent', + 'args': { + 'percentOpen': 'int' + } + }, + 1: { + 'commandId': 1, + 'commandName': 'BarrierControlStop', + 'args': {} + } + }, + 'attributes': { + 1: { + 'attributeName': 'BarrierMovingState', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'BarrierSafetyStatus', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'BarrierCapabilities', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 10: { + 'attributeName': 'BarrierPosition', + 'attributeId': 10, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'PumpConfigurationAndControl': { + 'clusterName': 'PumpConfigurationAndControl', + 'clusterId': 512, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'MaxPressure', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'MaxSpeed', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'MaxFlow', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'MinConstPressure', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 4: { + 'attributeName': 'MaxConstPressure', + 'attributeId': 4, + 'type': 'int', + 'reportable': true + }, + 5: { + 'attributeName': 'MinCompPressure', + 'attributeId': 5, + 'type': 'int', + 'reportable': true + }, + 6: { + 'attributeName': 'MaxCompPressure', + 'attributeId': 6, + 'type': 'int', + 'reportable': true + }, + 7: { + 'attributeName': 'MinConstSpeed', + 'attributeId': 7, + 'type': 'int', + 'reportable': true + }, + 8: { + 'attributeName': 'MaxConstSpeed', + 'attributeId': 8, + 'type': 'int', + 'reportable': true + }, + 9: { + 'attributeName': 'MinConstFlow', + 'attributeId': 9, + 'type': 'int', + 'reportable': true + }, + 10: { + 'attributeName': 'MaxConstFlow', + 'attributeId': 10, + 'type': 'int', + 'reportable': true + }, + 11: { + 'attributeName': 'MinConstTemp', + 'attributeId': 11, + 'type': 'int', + 'reportable': true + }, + 12: { + 'attributeName': 'MaxConstTemp', + 'attributeId': 12, + 'type': 'int', + 'reportable': true + }, + 16: { + 'attributeName': 'PumpStatus', + 'attributeId': 16, + 'type': 'int', + 'reportable': true + }, + 17: { + 'attributeName': 'EffectiveOperationMode', + 'attributeId': 17, + 'type': 'int', + 'reportable': true + }, + 18: { + 'attributeName': 'EffectiveControlMode', + 'attributeId': 18, + 'type': 'int', + 'reportable': true + }, + 19: { + 'attributeName': 'Capacity', + 'attributeId': 19, + 'type': 'int', + 'reportable': true + }, + 20: { + 'attributeName': 'Speed', + 'attributeId': 20, + 'type': 'int', + 'reportable': true + }, + 21: { + 'attributeName': 'LifetimeRunningHours', + 'attributeId': 21, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 22: { + 'attributeName': 'Power', + 'attributeId': 22, + 'type': 'int', + 'reportable': true + }, + 23: { + 'attributeName': 'LifetimeEnergyConsumed', + 'attributeId': 23, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 32: { + 'attributeName': 'OperationMode', + 'attributeId': 32, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 33: { + 'attributeName': 'ControlMode', + 'attributeId': 33, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'Thermostat': { + 'clusterName': 'Thermostat', + 'clusterId': 513, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'SetpointRaiseLower', + 'args': { + 'mode': 'int', + 'amount': 'int' + } + }, + 1: { + 'commandId': 1, + 'commandName': 'SetWeeklySchedule', + 'args': { + 'numberOfTransitionsForSequence': 'int', + 'dayOfWeekForSequence': 'int', + 'modeForSequence': 'int', + 'transitionTime': 'int', + 'heatSetpoint': 'int', + 'coolSetpoint': 'int' + } + }, + 2: { + 'commandId': 2, + 'commandName': 'GetWeeklySchedule', + 'args': { + 'daysToReturn': 'int', + 'modeToReturn': 'int' + } + }, + 3: { + 'commandId': 3, + 'commandName': 'ClearWeeklySchedule', + 'args': {} + } + }, + 'attributes': { + 0: { + 'attributeName': 'LocalTemperature', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'AbsMinHeatSetpointLimit', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 4: { + 'attributeName': 'AbsMaxHeatSetpointLimit', + 'attributeId': 4, + 'type': 'int', + 'reportable': true + }, + 5: { + 'attributeName': 'AbsMinCoolSetpointLimit', + 'attributeId': 5, + 'type': 'int', + 'reportable': true + }, + 6: { + 'attributeName': 'AbsMaxCoolSetpointLimit', + 'attributeId': 6, + 'type': 'int', + 'reportable': true + }, + 17: { + 'attributeName': 'OccupiedCoolingSetpoint', + 'attributeId': 17, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 18: { + 'attributeName': 'OccupiedHeatingSetpoint', + 'attributeId': 18, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 21: { + 'attributeName': 'MinHeatSetpointLimit', + 'attributeId': 21, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 22: { + 'attributeName': 'MaxHeatSetpointLimit', + 'attributeId': 22, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 23: { + 'attributeName': 'MinCoolSetpointLimit', + 'attributeId': 23, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 24: { + 'attributeName': 'MaxCoolSetpointLimit', + 'attributeId': 24, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 25: { + 'attributeName': 'MinSetpointDeadBand', + 'attributeId': 25, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 27: { + 'attributeName': 'ControlSequenceOfOperation', + 'attributeId': 27, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 28: { + 'attributeName': 'SystemMode', + 'attributeId': 28, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 32: { + 'attributeName': 'StartOfWeek', + 'attributeId': 32, + 'type': 'int', + 'reportable': true + }, + 33: { + 'attributeName': 'NumberOfWeeklyTransitions', + 'attributeId': 33, + 'type': 'int', + 'reportable': true + }, + 34: { + 'attributeName': 'NumberOfDailyTransitions', + 'attributeId': 34, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'FanControl': { + 'clusterName': 'FanControl', + 'clusterId': 514, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'FanMode', + 'attributeId': 0, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 1: { + 'attributeName': 'FanModeSequence', + 'attributeId': 1, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 2: { + 'attributeName': 'PercentSetting', + 'attributeId': 2, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 3: { + 'attributeName': 'PercentCurrent', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 4: { + 'attributeName': 'SpeedMax', + 'attributeId': 4, + 'type': 'int', + 'reportable': true + }, + 5: { + 'attributeName': 'SpeedSetting', + 'attributeId': 5, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 6: { + 'attributeName': 'SpeedCurrent', + 'attributeId': 6, + 'type': 'int', + 'reportable': true + }, + 7: { + 'attributeName': 'RockSupport', + 'attributeId': 7, + 'type': 'int', + 'reportable': true + }, + 8: { + 'attributeName': 'RockSetting', + 'attributeId': 8, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 9: { + 'attributeName': 'WindSupport', + 'attributeId': 9, + 'type': 'int', + 'reportable': true + }, + 10: { + 'attributeName': 'WindSetting', + 'attributeId': 10, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'ThermostatUserInterfaceConfiguration': { + 'clusterName': 'ThermostatUserInterfaceConfiguration', + 'clusterId': 516, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'TemperatureDisplayMode', + 'attributeId': 0, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 1: { + 'attributeName': 'KeypadLockout', + 'attributeId': 1, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 2: { + 'attributeName': 'ScheduleProgrammingVisibility', + 'attributeId': 2, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'ColorControl': { + 'clusterName': 'ColorControl', + 'clusterId': 768, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'MoveToHue', + 'args': { + 'hue': 'int', + 'direction': 'int', + 'transitionTime': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 1: { + 'commandId': 1, + 'commandName': 'MoveHue', + 'args': { + 'moveMode': 'int', + 'rate': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 2: { + 'commandId': 2, + 'commandName': 'StepHue', + 'args': { + 'stepMode': 'int', + 'stepSize': 'int', + 'transitionTime': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 3: { + 'commandId': 3, + 'commandName': 'MoveToSaturation', + 'args': { + 'saturation': 'int', + 'transitionTime': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 4: { + 'commandId': 4, + 'commandName': 'MoveSaturation', + 'args': { + 'moveMode': 'int', + 'rate': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 5: { + 'commandId': 5, + 'commandName': 'StepSaturation', + 'args': { + 'stepMode': 'int', + 'stepSize': 'int', + 'transitionTime': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 6: { + 'commandId': 6, + 'commandName': 'MoveToHueAndSaturation', + 'args': { + 'hue': 'int', + 'saturation': 'int', + 'transitionTime': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 7: { + 'commandId': 7, + 'commandName': 'MoveToColor', + 'args': { + 'colorX': 'int', + 'colorY': 'int', + 'transitionTime': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 8: { + 'commandId': 8, + 'commandName': 'MoveColor', + 'args': { + 'rateX': 'int', + 'rateY': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 9: { + 'commandId': 9, + 'commandName': 'StepColor', + 'args': { + 'stepX': 'int', + 'stepY': 'int', + 'transitionTime': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 10: { + 'commandId': 10, + 'commandName': 'MoveToColorTemperature', + 'args': { + 'colorTemperature': 'int', + 'transitionTime': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 64: { + 'commandId': 64, + 'commandName': 'EnhancedMoveToHue', + 'args': { + 'enhancedHue': 'int', + 'direction': 'int', + 'transitionTime': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 65: { + 'commandId': 65, + 'commandName': 'EnhancedMoveHue', + 'args': { + 'moveMode': 'int', + 'rate': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 66: { + 'commandId': 66, + 'commandName': 'EnhancedStepHue', + 'args': { + 'stepMode': 'int', + 'stepSize': 'int', + 'transitionTime': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 67: { + 'commandId': 67, + 'commandName': 'EnhancedMoveToHueAndSaturation', + 'args': { + 'enhancedHue': 'int', + 'saturation': 'int', + 'transitionTime': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 68: { + 'commandId': 68, + 'commandName': 'ColorLoopSet', + 'args': { + 'updateFlags': 'int', + 'action': 'int', + 'direction': 'int', + 'time': 'int', + 'startHue': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 71: { + 'commandId': 71, + 'commandName': 'StopMoveStep', + 'args': { + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 75: { + 'commandId': 75, + 'commandName': 'MoveColorTemperature', + 'args': { + 'moveMode': 'int', + 'rate': 'int', + 'colorTemperatureMinimumMireds': 'int', + 'colorTemperatureMaximumMireds': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + }, + 76: { + 'commandId': 76, + 'commandName': 'StepColorTemperature', + 'args': { + 'stepMode': 'int', + 'stepSize': 'int', + 'transitionTime': 'int', + 'colorTemperatureMinimumMireds': 'int', + 'colorTemperatureMaximumMireds': 'int', + 'optionsMask': 'int', + 'optionsOverride': 'int' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'CurrentHue', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'CurrentSaturation', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'RemainingTime', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'CurrentX', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 4: { + 'attributeName': 'CurrentY', + 'attributeId': 4, + 'type': 'int', + 'reportable': true + }, + 5: { + 'attributeName': 'DriftCompensation', + 'attributeId': 5, + 'type': 'int', + 'reportable': true + }, + 6: { + 'attributeName': 'CompensationText', + 'attributeId': 6, + 'type': 'str', + 'reportable': true + }, + 7: { + 'attributeName': 'ColorTemperatureMireds', + 'attributeId': 7, + 'type': 'int', + 'reportable': true + }, + 8: { + 'attributeName': 'ColorMode', + 'attributeId': 8, + 'type': 'int', + 'reportable': true + }, + 15: { + 'attributeName': 'Options', + 'attributeId': 15, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 16: { + 'attributeName': 'NumberOfPrimaries', + 'attributeId': 16, + 'type': 'int', + 'reportable': true + }, + 17: { + 'attributeName': 'Primary1X', + 'attributeId': 17, + 'type': 'int', + 'reportable': true + }, + 18: { + 'attributeName': 'Primary1Y', + 'attributeId': 18, + 'type': 'int', + 'reportable': true + }, + 19: { + 'attributeName': 'Primary1Intensity', + 'attributeId': 19, + 'type': 'int', + 'reportable': true + }, + 21: { + 'attributeName': 'Primary2X', + 'attributeId': 21, + 'type': 'int', + 'reportable': true + }, + 22: { + 'attributeName': 'Primary2Y', + 'attributeId': 22, + 'type': 'int', + 'reportable': true + }, + 23: { + 'attributeName': 'Primary2Intensity', + 'attributeId': 23, + 'type': 'int', + 'reportable': true + }, + 25: { + 'attributeName': 'Primary3X', + 'attributeId': 25, + 'type': 'int', + 'reportable': true + }, + 26: { + 'attributeName': 'Primary3Y', + 'attributeId': 26, + 'type': 'int', + 'reportable': true + }, + 27: { + 'attributeName': 'Primary3Intensity', + 'attributeId': 27, + 'type': 'int', + 'reportable': true + }, + 32: { + 'attributeName': 'Primary4X', + 'attributeId': 32, + 'type': 'int', + 'reportable': true + }, + 33: { + 'attributeName': 'Primary4Y', + 'attributeId': 33, + 'type': 'int', + 'reportable': true + }, + 34: { + 'attributeName': 'Primary4Intensity', + 'attributeId': 34, + 'type': 'int', + 'reportable': true + }, + 36: { + 'attributeName': 'Primary5X', + 'attributeId': 36, + 'type': 'int', + 'reportable': true + }, + 37: { + 'attributeName': 'Primary5Y', + 'attributeId': 37, + 'type': 'int', + 'reportable': true + }, + 38: { + 'attributeName': 'Primary5Intensity', + 'attributeId': 38, + 'type': 'int', + 'reportable': true + }, + 40: { + 'attributeName': 'Primary6X', + 'attributeId': 40, + 'type': 'int', + 'reportable': true + }, + 41: { + 'attributeName': 'Primary6Y', + 'attributeId': 41, + 'type': 'int', + 'reportable': true + }, + 42: { + 'attributeName': 'Primary6Intensity', + 'attributeId': 42, + 'type': 'int', + 'reportable': true + }, + 48: { + 'attributeName': 'WhitePointX', + 'attributeId': 48, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 49: { + 'attributeName': 'WhitePointY', + 'attributeId': 49, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 50: { + 'attributeName': 'ColorPointRX', + 'attributeId': 50, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 51: { + 'attributeName': 'ColorPointRY', + 'attributeId': 51, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 52: { + 'attributeName': 'ColorPointRIntensity', + 'attributeId': 52, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 54: { + 'attributeName': 'ColorPointGX', + 'attributeId': 54, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 55: { + 'attributeName': 'ColorPointGY', + 'attributeId': 55, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 56: { + 'attributeName': 'ColorPointGIntensity', + 'attributeId': 56, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 58: { + 'attributeName': 'ColorPointBX', + 'attributeId': 58, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 59: { + 'attributeName': 'ColorPointBY', + 'attributeId': 59, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 60: { + 'attributeName': 'ColorPointBIntensity', + 'attributeId': 60, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 16384: { + 'attributeName': 'EnhancedCurrentHue', + 'attributeId': 16384, + 'type': 'int', + 'reportable': true + }, + 16385: { + 'attributeName': 'EnhancedColorMode', + 'attributeId': 16385, + 'type': 'int', + 'reportable': true + }, + 16386: { + 'attributeName': 'ColorLoopActive', + 'attributeId': 16386, + 'type': 'int', + 'reportable': true + }, + 16387: { + 'attributeName': 'ColorLoopDirection', + 'attributeId': 16387, + 'type': 'int', + 'reportable': true + }, + 16388: { + 'attributeName': 'ColorLoopTime', + 'attributeId': 16388, + 'type': 'int', + 'reportable': true + }, + 16389: { + 'attributeName': 'ColorLoopStartEnhancedHue', + 'attributeId': 16389, + 'type': 'int', + 'reportable': true + }, + 16390: { + 'attributeName': 'ColorLoopStoredEnhancedHue', + 'attributeId': 16390, + 'type': 'int', + 'reportable': true + }, + 16394: { + 'attributeName': 'ColorCapabilities', + 'attributeId': 16394, + 'type': 'int', + 'reportable': true + }, + 16395: { + 'attributeName': 'ColorTempPhysicalMinMireds', + 'attributeId': 16395, + 'type': 'int', + 'reportable': true + }, + 16396: { + 'attributeName': 'ColorTempPhysicalMaxMireds', + 'attributeId': 16396, + 'type': 'int', + 'reportable': true + }, + 16397: { + 'attributeName': 'CoupleColorTempToLevelMinMireds', + 'attributeId': 16397, + 'type': 'int', + 'reportable': true + }, + 16400: { + 'attributeName': 'StartUpColorTemperatureMireds', + 'attributeId': 16400, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'BallastConfiguration': { + 'clusterName': 'BallastConfiguration', + 'clusterId': 769, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'PhysicalMinLevel', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'PhysicalMaxLevel', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'BallastStatus', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 16: { + 'attributeName': 'MinLevel', + 'attributeId': 16, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 17: { + 'attributeName': 'MaxLevel', + 'attributeId': 17, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 20: { + 'attributeName': 'IntrinsicBalanceFactor', + 'attributeId': 20, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 21: { + 'attributeName': 'BallastFactorAdjustment', + 'attributeId': 21, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 32: { + 'attributeName': 'LampQuantity', + 'attributeId': 32, + 'type': 'int', + 'reportable': true + }, + 48: { + 'attributeName': 'LampType', + 'attributeId': 48, + 'type': 'str', + 'reportable': true, + 'writable': true + }, + 49: { + 'attributeName': 'LampManufacturer', + 'attributeId': 49, + 'type': 'str', + 'reportable': true, + 'writable': true + }, + 50: { + 'attributeName': 'LampRatedHours', + 'attributeId': 50, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 51: { + 'attributeName': 'LampBurnHours', + 'attributeId': 51, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 52: { + 'attributeName': 'LampAlarmMode', + 'attributeId': 52, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 53: { + 'attributeName': 'LampBurnHoursTripPoint', + 'attributeId': 53, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'IlluminanceMeasurement': { + 'clusterName': 'IlluminanceMeasurement', + 'clusterId': 1024, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'MeasuredValue', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'MinMeasuredValue', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'MaxMeasuredValue', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'Tolerance', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 4: { + 'attributeName': 'LightSensorType', + 'attributeId': 4, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'TemperatureMeasurement': { + 'clusterName': 'TemperatureMeasurement', + 'clusterId': 1026, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'MeasuredValue', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'MinMeasuredValue', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'MaxMeasuredValue', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'Tolerance', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'PressureMeasurement': { + 'clusterName': 'PressureMeasurement', + 'clusterId': 1027, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'MeasuredValue', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'MinMeasuredValue', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'MaxMeasuredValue', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'Tolerance', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 16: { + 'attributeName': 'ScaledValue', + 'attributeId': 16, + 'type': 'int', + 'reportable': true + }, + 17: { + 'attributeName': 'MinScaledValue', + 'attributeId': 17, + 'type': 'int', + 'reportable': true + }, + 18: { + 'attributeName': 'MaxScaledValue', + 'attributeId': 18, + 'type': 'int', + 'reportable': true + }, + 19: { + 'attributeName': 'ScaledTolerance', + 'attributeId': 19, + 'type': 'int', + 'reportable': true + }, + 20: { + 'attributeName': 'Scale', + 'attributeId': 20, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'FlowMeasurement': { + 'clusterName': 'FlowMeasurement', + 'clusterId': 1028, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'MeasuredValue', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'MinMeasuredValue', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'MaxMeasuredValue', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'Tolerance', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'RelativeHumidityMeasurement': { + 'clusterName': 'RelativeHumidityMeasurement', + 'clusterId': 1029, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'MeasuredValue', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'MinMeasuredValue', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'MaxMeasuredValue', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'Tolerance', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'OccupancySensing': { + 'clusterName': 'OccupancySensing', + 'clusterId': 1030, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'Occupancy', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'OccupancySensorType', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'OccupancySensorTypeBitmap', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'WakeOnLan': { + 'clusterName': 'WakeOnLan', + 'clusterId': 1283, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'MACAddress', + 'attributeId': 0, + 'type': 'str', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'Channel': { + 'clusterName': 'Channel', + 'clusterId': 1284, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'ChangeChannel', + 'args': { + 'match': 'str' + } + }, + 2: { + 'commandId': 2, + 'commandName': 'ChangeChannelByNumber', + 'args': { + 'majorNumber': 'int', + 'minorNumber': 'int' + } + }, + 3: { + 'commandId': 3, + 'commandName': 'SkipChannel', + 'args': { + 'count': 'int' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'ChannelList', + 'attributeId': 0, + 'type': '', + 'reportable': true + }, + 1: { + 'attributeName': 'Lineup', + 'attributeId': 1, + 'type': '', + 'reportable': true + }, + 2: { + 'attributeName': 'CurrentChannel', + 'attributeId': 2, + 'type': '', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'TargetNavigator': { + 'clusterName': 'TargetNavigator', + 'clusterId': 1285, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'NavigateTarget', + 'args': { + 'target': 'int', + 'data': 'str' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'TargetList', + 'attributeId': 0, + 'type': '', + 'reportable': true + }, + 1: { + 'attributeName': 'CurrentTarget', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'MediaPlayback': { + 'clusterName': 'MediaPlayback', + 'clusterId': 1286, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'Play', + 'args': {} + }, + 1: { + 'commandId': 1, + 'commandName': 'Pause', + 'args': {} + }, + 2: { + 'commandId': 2, + 'commandName': 'StopPlayback', + 'args': {} + }, + 3: { + 'commandId': 3, + 'commandName': 'StartOver', + 'args': {} + }, + 4: { + 'commandId': 4, + 'commandName': 'Previous', + 'args': {} + }, + 5: { + 'commandId': 5, + 'commandName': 'Next', + 'args': {} + }, + 6: { + 'commandId': 6, + 'commandName': 'Rewind', + 'args': {} + }, + 7: { + 'commandId': 7, + 'commandName': 'FastForward', + 'args': {} + }, + 8: { + 'commandId': 8, + 'commandName': 'SkipForward', + 'args': { + 'deltaPositionMilliseconds': 'int' + } + }, + 9: { + 'commandId': 9, + 'commandName': 'SkipBackward', + 'args': { + 'deltaPositionMilliseconds': 'int' + } + }, + 11: { + 'commandId': 11, + 'commandName': 'Seek', + 'args': { + 'position': 'int' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'CurrentState', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'StartTime', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'Duration', + 'attributeId': 2, + 'type': 'int', + 'reportable': true + }, + 3: { + 'attributeName': 'SampledPosition', + 'attributeId': 3, + 'type': '', + 'reportable': true + }, + 4: { + 'attributeName': 'PlaybackSpeed', + 'attributeId': 4, + 'type': '', + 'reportable': true + }, + 5: { + 'attributeName': 'SeekRangeEnd', + 'attributeId': 5, + 'type': 'int', + 'reportable': true + }, + 6: { + 'attributeName': 'SeekRangeStart', + 'attributeId': 6, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'MediaInput': { + 'clusterName': 'MediaInput', + 'clusterId': 1287, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'SelectInput', + 'args': { + 'index': 'int' + } + }, + 1: { + 'commandId': 1, + 'commandName': 'ShowInputStatus', + 'args': {} + }, + 2: { + 'commandId': 2, + 'commandName': 'HideInputStatus', + 'args': {} + }, + 3: { + 'commandId': 3, + 'commandName': 'RenameInput', + 'args': { + 'index': 'int', + 'name': 'str' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'InputList', + 'attributeId': 0, + 'type': '', + 'reportable': true + }, + 1: { + 'attributeName': 'CurrentInput', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'LowPower': { + 'clusterName': 'LowPower', + 'clusterId': 1288, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'Sleep', + 'args': {} + } + }, + 'attributes': { + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'KeypadInput': { + 'clusterName': 'KeypadInput', + 'clusterId': 1289, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'SendKey', + 'args': { + 'keyCode': 'int' + } + } + }, + 'attributes': { + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'ContentLauncher': { + 'clusterName': 'ContentLauncher', + 'clusterId': 1290, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'LaunchContent', + 'args': { + 'parameterList': '', + 'autoPlay': 'bool', + 'data': 'str' + } + }, + 1: { + 'commandId': 1, + 'commandName': 'LaunchURL', + 'args': { + 'contentURL': 'str', + 'displayString': 'str', + 'providerName': 'str', + 'background': '', + 'logo': '', + 'progressBar': '', + 'splash': '', + 'waterMark': '' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'AcceptHeader', + 'attributeId': 0, + 'type': 'str', + 'reportable': true + }, + 1: { + 'attributeName': 'SupportedStreamingProtocols', + 'attributeId': 1, + 'type': 'int', + 'reportable': true, + 'writable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'AudioOutput': { + 'clusterName': 'AudioOutput', + 'clusterId': 1291, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'SelectOutput', + 'args': { + 'index': 'int' + } + }, + 1: { + 'commandId': 1, + 'commandName': 'RenameOutput', + 'args': { + 'index': 'int', + 'name': 'str' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'OutputList', + 'attributeId': 0, + 'type': '', + 'reportable': true + }, + 1: { + 'attributeName': 'CurrentOutput', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'ApplicationLauncher': { + 'clusterName': 'ApplicationLauncher', + 'clusterId': 1292, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'LaunchApp', + 'args': { + 'catalogVendorId': 'int', + 'applicationId': 'str', + 'data': 'bytes' + } + }, + 1: { + 'commandId': 1, + 'commandName': 'StopApp', + 'args': { + 'catalogVendorId': 'int', + 'applicationId': 'str' + } + }, + 2: { + 'commandId': 2, + 'commandName': 'HideApp', + 'args': { + 'catalogVendorId': 'int', + 'applicationId': 'str' + } + } + }, + 'attributes': { + 0: { + 'attributeName': 'CatalogList', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 1: { + 'attributeName': 'CurrentApp', + 'attributeId': 1, + 'type': '', + 'reportable': true, + 'writable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'ApplicationBasic': { + 'clusterName': 'ApplicationBasic', + 'clusterId': 1293, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'VendorName', + 'attributeId': 0, + 'type': 'str', + 'reportable': true + }, + 1: { + 'attributeName': 'VendorID', + 'attributeId': 1, + 'type': 'int', + 'reportable': true + }, + 2: { + 'attributeName': 'ApplicationName', + 'attributeId': 2, + 'type': 'str', + 'reportable': true + }, + 3: { + 'attributeName': 'ProductID', + 'attributeId': 3, + 'type': 'int', + 'reportable': true + }, + 4: { + 'attributeName': 'Application', + 'attributeId': 4, + 'type': '', + 'reportable': true + }, + 5: { + 'attributeName': 'Status', + 'attributeId': 5, + 'type': 'int', + 'reportable': true + }, + 6: { + 'attributeName': 'ApplicationVersion', + 'attributeId': 6, + 'type': 'str', + 'reportable': true + }, + 7: { + 'attributeName': 'AllowedVendorList', + 'attributeId': 7, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'AccountLogin': { + 'clusterName': 'AccountLogin', + 'clusterId': 1294, + 'commands': { + 0: { + 'commandId': 0, + 'commandName': 'GetSetupPIN', + 'args': { + 'tempAccountIdentifier': 'str' + } + }, + 2: { + 'commandId': 2, + 'commandName': 'Login', + 'args': { + 'tempAccountIdentifier': 'str', + 'setupPIN': 'str' + } + }, + 3: { + 'commandId': 3, + 'commandName': 'Logout', + 'args': {} + } + }, + 'attributes': { + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + 'ElectricalMeasurement': { + 'clusterName': 'ElectricalMeasurement', + 'clusterId': 2820, + 'commands': {}, + 'attributes': { + 0: { + 'attributeName': 'MeasurementType', + 'attributeId': 0, + 'type': 'int', + 'reportable': true + }, + 772: { + 'attributeName': 'TotalActivePower', + 'attributeId': 772, + 'type': 'int', + 'reportable': true + }, + 1285: { + 'attributeName': 'RmsVoltage', + 'attributeId': 1285, + 'type': 'int', + 'reportable': true + }, + 1286: { + 'attributeName': 'RmsVoltageMin', + 'attributeId': 1286, + 'type': 'int', + 'reportable': true + }, + 1287: { + 'attributeName': 'RmsVoltageMax', + 'attributeId': 1287, + 'type': 'int', + 'reportable': true + }, + 1288: { + 'attributeName': 'RmsCurrent', + 'attributeId': 1288, + 'type': 'int', + 'reportable': true + }, + 1289: { + 'attributeName': 'RmsCurrentMin', + 'attributeId': 1289, + 'type': 'int', + 'reportable': true + }, + 1290: { + 'attributeName': 'RmsCurrentMax', + 'attributeId': 1290, + 'type': 'int', + 'reportable': true + }, + 1291: { + 'attributeName': 'ActivePower', + 'attributeId': 1291, + 'type': 'int', + 'reportable': true + }, + 1292: { + 'attributeName': 'ActivePowerMin', + 'attributeId': 1292, + 'type': 'int', + 'reportable': true + }, + 1293: { + 'attributeName': 'ActivePowerMax', + 'attributeId': 1293, + 'type': 'int', + 'reportable': true + }, + 65528: { + 'attributeName': 'GeneratedCommandList', + 'attributeId': 65528, + 'type': 'int', + 'reportable': true + }, + 65529: { + 'attributeName': 'AcceptedCommandList', + 'attributeId': 65529, + 'type': 'int', + 'reportable': true + }, + 65531: { + 'attributeName': 'AttributeList', + 'attributeId': 65531, + 'type': 'int', + 'reportable': true + }, + 65532: { + 'attributeName': 'FeatureMap', + 'attributeId': 65532, + 'type': 'int', + 'reportable': true + }, + 65533: { + 'attributeName': 'ClusterRevision', + 'attributeId': 65533, + 'type': 'int', + 'reportable': true + } + } + }, + # 'UnitTesting': { + # 'clusterName': 'UnitTesting', + # 'clusterId': 4294048773, + # 'commands': { + # 0: { + # 'commandId': 0, + # 'commandName': 'Test', + # 'args': {} + # }, + # 1: { + # 'commandId': 1, + # 'commandName': 'TestNotHandled', + # 'args': {} + # }, + # 2: { + # 'commandId': 2, + # 'commandName': 'TestSpecific', + # 'args': {} + # }, + # 3: { + # 'commandId': 3, + # 'commandName': 'TestUnknownCommand', + # 'args': {} + # }, + # 4: { + # 'commandId': 4, + # 'commandName': 'TestAddArguments', + # 'args': { + # 'arg1': 'int', + # 'arg2': 'int' + # } + # }, + # 7: { + # 'commandId': 7, + # 'commandName': 'TestStructArgumentRequest', + # 'args': { + # 'a': 'int', + # 'b': 'bool', + # 'c': 'int', + # 'd': 'bytes', + # 'e': 'str', + # 'f': 'int', + # 'g': '', + # 'h': '' + # } + # }, + # 8: { + # 'commandId': 8, + # 'commandName': 'TestNestedStructArgumentRequest', + # 'args': { + # 'a': 'int', + # 'b': 'bool', + # 'c': '' + # } + # }, + # 9: { + # 'commandId': 9, + # 'commandName': 'TestListStructArgumentRequest', + # 'args': { + # 'a': 'int', + # 'b': 'bool', + # 'c': 'int', + # 'd': 'bytes', + # 'e': 'str', + # 'f': 'int', + # 'g': '', + # 'h': '' + # } + # }, + # 10: { + # 'commandId': 10, + # 'commandName': 'TestListInt8UArgumentRequest', + # 'args': { + # 'arg1': 'int' + # } + # }, + # 11: { + # 'commandId': 11, + # 'commandName': 'TestNestedStructListArgumentRequest', + # 'args': { + # 'a': 'int', + # 'b': 'bool', + # 'c': '', + # 'd': '', + # 'e': 'int', + # 'f': 'bytes', + # 'g': 'int' + # } + # }, + # 12: { + # 'commandId': 12, + # 'commandName': 'TestListNestedStructListArgumentRequest', + # 'args': { + # 'a': 'int', + # 'b': 'bool', + # 'c': '', + # 'd': '', + # 'e': 'int', + # 'f': 'bytes', + # 'g': 'int' + # } + # }, + # 13: { + # 'commandId': 13, + # 'commandName': 'TestListInt8UReverseRequest', + # 'args': { + # 'arg1': 'int' + # } + # }, + # 14: { + # 'commandId': 14, + # 'commandName': 'TestEnumsRequest', + # 'args': { + # 'arg1': 'int', + # 'arg2': 'int' + # } + # }, + # 15: { + # 'commandId': 15, + # 'commandName': 'TestNullableOptionalRequest', + # 'args': { + # 'arg1': 'int' + # } + # }, + # 17: { + # 'commandId': 17, + # 'commandName': 'SimpleStructEchoRequest', + # 'args': { + # 'a': 'int', + # 'b': 'bool', + # 'c': 'int', + # 'd': 'bytes', + # 'e': 'str', + # 'f': 'int', + # 'g': '', + # 'h': '' + # } + # }, + # 18: { + # 'commandId': 18, + # 'commandName': 'TimedInvokeRequest', + # 'args': {} + # }, + # 19: { + # 'commandId': 19, + # 'commandName': 'TestSimpleOptionalArgumentRequest', + # 'args': { + # 'arg1': 'bool' + # } + # }, + # 20: { + # 'commandId': 20, + # 'commandName': 'TestEmitTestEventRequest', + # 'args': { + # 'arg1': 'int', + # 'arg2': 'int', + # 'arg3': 'bool' + # } + # } + # }, + # 'attributes': { + # 0: { + # 'attributeName': 'Boolean', + # 'attributeId': 0, + # 'type': 'bool', + # 'reportable': true, + # 'writable': true + # }, + # 1: { + # 'attributeName': 'Bitmap8', + # 'attributeId': 1, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 2: { + # 'attributeName': 'Bitmap16', + # 'attributeId': 2, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 3: { + # 'attributeName': 'Bitmap32', + # 'attributeId': 3, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 4: { + # 'attributeName': 'Bitmap64', + # 'attributeId': 4, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 5: { + # 'attributeName': 'Int8u', + # 'attributeId': 5, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 6: { + # 'attributeName': 'Int16u', + # 'attributeId': 6, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 7: { + # 'attributeName': 'Int24u', + # 'attributeId': 7, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 8: { + # 'attributeName': 'Int32u', + # 'attributeId': 8, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 9: { + # 'attributeName': 'Int40u', + # 'attributeId': 9, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 10: { + # 'attributeName': 'Int48u', + # 'attributeId': 10, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 11: { + # 'attributeName': 'Int56u', + # 'attributeId': 11, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 12: { + # 'attributeName': 'Int64u', + # 'attributeId': 12, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 13: { + # 'attributeName': 'Int8s', + # 'attributeId': 13, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 14: { + # 'attributeName': 'Int16s', + # 'attributeId': 14, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 15: { + # 'attributeName': 'Int24s', + # 'attributeId': 15, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16: { + # 'attributeName': 'Int32s', + # 'attributeId': 16, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 17: { + # 'attributeName': 'Int40s', + # 'attributeId': 17, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 18: { + # 'attributeName': 'Int48s', + # 'attributeId': 18, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 19: { + # 'attributeName': 'Int56s', + # 'attributeId': 19, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 20: { + # 'attributeName': 'Int64s', + # 'attributeId': 20, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 21: { + # 'attributeName': 'Enum8', + # 'attributeId': 21, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 22: { + # 'attributeName': 'Enum16', + # 'attributeId': 22, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 23: { + # 'attributeName': 'FloatSingle', + # 'attributeId': 23, + # 'type': '', + # 'reportable': true, + # 'writable': true + # }, + # 24: { + # 'attributeName': 'FloatDouble', + # 'attributeId': 24, + # 'type': '', + # 'reportable': true, + # 'writable': true + # }, + # 25: { + # 'attributeName': 'OctetString', + # 'attributeId': 25, + # 'type': 'bytes', + # 'reportable': true, + # 'writable': true + # }, + # 26: { + # 'attributeName': 'ListInt8u', + # 'attributeId': 26, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 27: { + # 'attributeName': 'ListOctetString', + # 'attributeId': 27, + # 'type': 'bytes', + # 'reportable': true, + # 'writable': true + # }, + # 28: { + # 'attributeName': 'ListStructOctetString', + # 'attributeId': 28, + # 'type': '', + # 'reportable': true, + # 'writable': true + # }, + # 29: { + # 'attributeName': 'LongOctetString', + # 'attributeId': 29, + # 'type': 'bytes', + # 'reportable': true, + # 'writable': true + # }, + # 30: { + # 'attributeName': 'CharString', + # 'attributeId': 30, + # 'type': 'str', + # 'reportable': true, + # 'writable': true + # }, + # 31: { + # 'attributeName': 'LongCharString', + # 'attributeId': 31, + # 'type': 'str', + # 'reportable': true, + # 'writable': true + # }, + # 32: { + # 'attributeName': 'EpochUs', + # 'attributeId': 32, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 33: { + # 'attributeName': 'EpochS', + # 'attributeId': 33, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 34: { + # 'attributeName': 'VendorId', + # 'attributeId': 34, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 35: { + # 'attributeName': 'ListNullablesAndOptionalsStruct', + # 'attributeId': 35, + # 'type': '', + # 'reportable': true, + # 'writable': true + # }, + # 36: { + # 'attributeName': 'EnumAttr', + # 'attributeId': 36, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 37: { + # 'attributeName': 'StructAttr', + # 'attributeId': 37, + # 'type': '', + # 'reportable': true, + # 'writable': true + # }, + # 38: { + # 'attributeName': 'RangeRestrictedInt8u', + # 'attributeId': 38, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 39: { + # 'attributeName': 'RangeRestrictedInt8s', + # 'attributeId': 39, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 40: { + # 'attributeName': 'RangeRestrictedInt16u', + # 'attributeId': 40, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 41: { + # 'attributeName': 'RangeRestrictedInt16s', + # 'attributeId': 41, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 42: { + # 'attributeName': 'ListLongOctetString', + # 'attributeId': 42, + # 'type': 'bytes', + # 'reportable': true, + # 'writable': true + # }, + # 43: { + # 'attributeName': 'ListFabricScoped', + # 'attributeId': 43, + # 'type': '', + # 'reportable': true, + # 'writable': true + # }, + # 48: { + # 'attributeName': 'TimedWriteBoolean', + # 'attributeId': 48, + # 'type': 'bool', + # 'reportable': true, + # 'writable': true + # }, + # 49: { + # 'attributeName': 'GeneralErrorBoolean', + # 'attributeId': 49, + # 'type': 'bool', + # 'reportable': true, + # 'writable': true + # }, + # 50: { + # 'attributeName': 'ClusterErrorBoolean', + # 'attributeId': 50, + # 'type': 'bool', + # 'reportable': true, + # 'writable': true + # }, + # 255: { + # 'attributeName': 'Unsupported', + # 'attributeId': 255, + # 'type': 'bool', + # 'reportable': true, + # 'writable': true + # }, + # 16384: { + # 'attributeName': 'NullableBoolean', + # 'attributeId': 16384, + # 'type': 'bool', + # 'reportable': true, + # 'writable': true + # }, + # 16385: { + # 'attributeName': 'NullableBitmap8', + # 'attributeId': 16385, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16386: { + # 'attributeName': 'NullableBitmap16', + # 'attributeId': 16386, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16387: { + # 'attributeName': 'NullableBitmap32', + # 'attributeId': 16387, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16388: { + # 'attributeName': 'NullableBitmap64', + # 'attributeId': 16388, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16389: { + # 'attributeName': 'NullableInt8u', + # 'attributeId': 16389, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16390: { + # 'attributeName': 'NullableInt16u', + # 'attributeId': 16390, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16391: { + # 'attributeName': 'NullableInt24u', + # 'attributeId': 16391, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16392: { + # 'attributeName': 'NullableInt32u', + # 'attributeId': 16392, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16393: { + # 'attributeName': 'NullableInt40u', + # 'attributeId': 16393, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16394: { + # 'attributeName': 'NullableInt48u', + # 'attributeId': 16394, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16395: { + # 'attributeName': 'NullableInt56u', + # 'attributeId': 16395, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16396: { + # 'attributeName': 'NullableInt64u', + # 'attributeId': 16396, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16397: { + # 'attributeName': 'NullableInt8s', + # 'attributeId': 16397, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16398: { + # 'attributeName': 'NullableInt16s', + # 'attributeId': 16398, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16399: { + # 'attributeName': 'NullableInt24s', + # 'attributeId': 16399, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16400: { + # 'attributeName': 'NullableInt32s', + # 'attributeId': 16400, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16401: { + # 'attributeName': 'NullableInt40s', + # 'attributeId': 16401, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16402: { + # 'attributeName': 'NullableInt48s', + # 'attributeId': 16402, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16403: { + # 'attributeName': 'NullableInt56s', + # 'attributeId': 16403, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16404: { + # 'attributeName': 'NullableInt64s', + # 'attributeId': 16404, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16405: { + # 'attributeName': 'NullableEnum8', + # 'attributeId': 16405, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16406: { + # 'attributeName': 'NullableEnum16', + # 'attributeId': 16406, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16407: { + # 'attributeName': 'NullableFloatSingle', + # 'attributeId': 16407, + # 'type': '', + # 'reportable': true, + # 'writable': true + # }, + # 16408: { + # 'attributeName': 'NullableFloatDouble', + # 'attributeId': 16408, + # 'type': '', + # 'reportable': true, + # 'writable': true + # }, + # 16409: { + # 'attributeName': 'NullableOctetString', + # 'attributeId': 16409, + # 'type': 'bytes', + # 'reportable': true, + # 'writable': true + # }, + # 16414: { + # 'attributeName': 'NullableCharString', + # 'attributeId': 16414, + # 'type': 'str', + # 'reportable': true, + # 'writable': true + # }, + # 16420: { + # 'attributeName': 'NullableEnumAttr', + # 'attributeId': 16420, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16421: { + # 'attributeName': 'NullableStruct', + # 'attributeId': 16421, + # 'type': '', + # 'reportable': true, + # 'writable': true + # }, + # 16422: { + # 'attributeName': 'NullableRangeRestrictedInt8u', + # 'attributeId': 16422, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16423: { + # 'attributeName': 'NullableRangeRestrictedInt8s', + # 'attributeId': 16423, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16424: { + # 'attributeName': 'NullableRangeRestrictedInt16u', + # 'attributeId': 16424, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 16425: { + # 'attributeName': 'NullableRangeRestrictedInt16s', + # 'attributeId': 16425, + # 'type': 'int', + # 'reportable': true, + # 'writable': true + # }, + # 65528: { + # 'attributeName': 'GeneratedCommandList', + # 'attributeId': 65528, + # 'type': 'int', + # 'reportable': true + # }, + # 65529: { + # 'attributeName': 'AcceptedCommandList', + # 'attributeId': 65529, + # 'type': 'int', + # 'reportable': true + # }, + # 65531: { + # 'attributeName': 'AttributeList', + # 'attributeId': 65531, + # 'type': 'int', + # 'reportable': true + # }, + # 65532: { + # 'attributeName': 'FeatureMap', + # 'attributeId': 65532, + # 'type': 'int', + # 'reportable': true + # }, + # 65533: { + # 'attributeName': 'ClusterRevision', + # 'attributeId': 65533, + # 'type': 'int', + # 'reportable': true + # } + # } + # } +} + +return _Matter_clusters diff --git a/lib/libesp32/berry_matter/library.json b/lib/libesp32/berry_matter/library.json new file mode 100644 index 000000000..fce77cc08 --- /dev/null +++ b/lib/libesp32/berry_matter/library.json @@ -0,0 +1,17 @@ +{ + "name": "Berry Matter protocol implementation", + "version": "0.1", + "description": "Implementation of the Matter protocol specification in Berry for Tasmota, acting as an end-device over Wifi", + "license": "MIT", + "homepage": "https://github.com/arendst/Tasmota", + "frameworks": "arduino", + "platforms": "espressif32", + "authors": + { + "name": "Stephan Hadinger", + "maintainer": true + }, + "build": { + "flags": [ "-I$PROJECT_DIR/include", "-includetasmota_options.h" ] + } +} \ No newline at end of file diff --git a/lib/libesp32/berry_matter/path.be b/lib/libesp32/berry_matter/path.be new file mode 100644 index 000000000..afba51adc --- /dev/null +++ b/lib/libesp32/berry_matter/path.be @@ -0,0 +1,2 @@ +# empty module +# allows stand-alone `import path` diff --git a/lib/libesp32/berry_matter/solidify_all.be b/lib/libesp32/berry_matter/solidify_all.be new file mode 100755 index 000000000..81f392870 --- /dev/null +++ b/lib/libesp32/berry_matter/solidify_all.be @@ -0,0 +1,86 @@ +#! ../berry/berry -s -g +# +# Berry solidify files +# +# `../berry/berry -s -g` + +import os +import global +import solidify +import string +import re + +import sys +sys.path().push('src/embedded') # allow to import from src/embedded + +# globals that need to exist to make compilation succeed +var globs = "path,ctypes_bytes_dyn,tasmota,ccronexpr,gpio,light,webclient,load,MD5,lv,light_state,udp," + "lv_clock,lv_clock_icon,lv_signal_arcs,lv_signal_bars,lv_wifi_arcs_icon,lv_wifi_arcs," + "lv_wifi_bars_icon,lv_wifi_bars," + "_lvgl," + "int64" + +for g:string.split(globs, ",") + global.(g) = nil +end + +var prefix_dir = "src/embedded/" +var prefix_out = "src/solidify/" + +def clean_directory(dir) + var file_list = os.listdir(dir) + for f : file_list + if f[0] == '.' continue end # ignore files starting with `.` + os.remove(dir + f) + end +end + +var pattern = "#@\\s*solidify:([A-Za-z0-9_.,]+)" + +def parse_file(fname, prefix_out) + print("Parsing: ", fname) + var f = open(prefix_dir + fname) + var src = f.read() + f.close() + # try to compile + var compiled = compile(src) + compiled() # run the compile code to instanciate the classes and modules + # output solidified + var fname_h = string.split(fname, '.be')[0] + '.h' # take whatever is before the first '.be' + var fout = open(prefix_out + "solidified_" + fname_h, "w") + fout.write(string.format("/* Solidification of %s */\n", fname_h)) + fout.write("/********************************************************************\\\n") + fout.write("* Generated code, don't edit *\n") + fout.write("\\********************************************************************/\n") + fout.write('#include "be_constobj.h"\n') + + var directives = re.searchall(pattern, src) + # print(directives) + + for directive : directives + var object_list = string.split(directive[1], ',') + var object_name = object_list[0] + var weak = (object_list.find('weak') != nil) # do we solidify with weak strings? + var o = global + var cl_name = nil + var obj_name = nil + for subname : string.split(object_name, '.') + o = o.(subname) + cl_name = obj_name + obj_name = subname + end + solidify.dump(o, weak, fout, cl_name) + end + + fout.write("/********************************************************************/\n") + fout.write("/* End of solidification */\n") + fout.close() +end + +clean_directory(prefix_out) + +var src_file_list = os.listdir(prefix_dir) +for src_file : src_file_list + if src_file[0] == '.' continue end + parse_file(src_file, prefix_out) +end diff --git a/lib/libesp32/berry_matter/src/be_matter_counter.cpp b/lib/libesp32/berry_matter/src/be_matter_counter.cpp new file mode 100644 index 000000000..a33dd6442 --- /dev/null +++ b/lib/libesp32/berry_matter/src/be_matter_counter.cpp @@ -0,0 +1,266 @@ +/* + be_matter_counter.cpp - implements Matter counters for message replay prevention + + 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 . +*/ + +/******************************************************************** + * Matter_Counter - Support for 32 bits counter with history window + * + * This is used in Matter to detect collision and replay of packets + * See section "4.5. Message Counters" + *******************************************************************/ + +#include +#include "be_constobj.h" +#include "be_mapping.h" +#include "be_mem.h" + +#include "esp_random.h" + +#define MESSAGE_COUNTER_WINDOW_SIZE 32 + +typedef struct { + uint32_t counter; // value of the counter + std::bitset window; +} matter_counter_t; + +/* + * Initialize a local message counter with random value between [1, 2^28]. This increases the difficulty of traffic analysis + * attacks by making it harder to determine how long a particular session has been open. The initial counter is always 1 or + * higher to guarantee first message is always greater than initial peer counter set to 0. +*/ + +static void mc_randomize(matter_counter_t *c) { + // pick a random one in range 0..2^28 + esp_fill_random(&c->counter, sizeof(c->counter)); + c->counter = c->counter & 0x0FFFFFFF; // keep only 28 bits + if (c->counter == 0) { c->counter = 1; } // unfortunate event that the random generates `0` + c->window.reset(); +} + +// `Matter_Counter([counter:int]) -> instance(Matter_Counter)` +// +// Creates a new monotonic counter for sending or receiving +// If value is `0` or absent, a random counter is generated in the range 1..2^28 +static void* mc_init(bvm *vm, int32_t val) { + matter_counter_t *c = (matter_counter_t*)be_malloc(vm, sizeof(matter_counter_t)); + c->counter = val; + c->window.reset(); // reset the window + return c; +} +BE_FUNC_CTYPE_DECLARE(mc_init, "+_p", "@[i]") + +static void mc_deinit(bvm *vm, matter_counter_t *c) { + be_free(vm, c, sizeof(matter_counter_t)); +} +BE_FUNC_CTYPE_DECLARE(mc_deinit, "", "@.") + +static void mc_reset(matter_counter_t *c, int32_t val) { + c->counter = val; + c->window.reset(); +} +BE_FUNC_CTYPE_DECLARE(mc_reset, "", ".[i]") + + +int32_t mc_val(matter_counter_t *c) { + return c->counter; +} +BE_FUNC_CTYPE_DECLARE(mc_val, "i", ".") + +int32_t mc_next(matter_counter_t *c) { + if (c->counter == 0) { mc_randomize(c); } + c->counter++; + c->window <<= 1; + if (c->counter == 0) { + c->counter++; + c->window <<= 1; + } + return c->counter; +} +BE_FUNC_CTYPE_DECLARE(mc_next, "i", ".") + +// validate if the value is acceptable +// +// strict_mode is used for encrypted messages: roll-over is not permitted +// otherwise roll-over is permitted and counter in the past +// (outside of window) is allowed +// +// return `true` if ok, `false` if rejected +int32_t mc_validate(matter_counter_t *c, uint32_t new_val, bbool strict_mode) { + if (new_val == c->counter) { return bfalse; } // simple case of a collision of the last message + + if (c->counter == 0) { // first message received, accept any value + c->counter = new_val; + c->window.reset(); + return btrue; + } + + if (new_val > c->counter) { // counter is in the future, same handling for both modes + if (new_val - c->counter > MESSAGE_COUNTER_WINDOW_SIZE) { + c->window.reset(); // no index is in the window anymore, clear all + } else { + c->window <<= new_val - c->counter; + c->window[new_val - c->counter - 1] = true; // mark previous val + // adjust window + } + c->counter = new_val; + return btrue; + } else { // here: new_val < c->counter + // are we in the window? + uint32_t gap = c->counter - new_val; + if (gap <= 32) { + if (c->window[gap-1]) { + return false; // reject because already seen + } else { + c->window[gap-1] = btrue; + return true; + } + } else { + // in the past and out of the window (we ignore roll-over to simplify) + if (strict_mode) { + return bfalse; + } else { + c->counter = new_val; + c->window.reset(); + return btrue; + } + } + } +} +BE_FUNC_CTYPE_DECLARE(mc_validate, "b", ".ib") + + +static int mc_tostring(bvm *vm) { + be_getmember(vm, 1, "_p"); + matter_counter_t *c = (matter_counter_t*) be_tocomptr(vm, -1); + if (c->counter != 0) { + be_pushstring(vm, "["); + + for (uint32_t i = MESSAGE_COUNTER_WINDOW_SIZE; i > 0; i--) { + be_pushint(vm, c->window[i-1]); + be_toescape(vm, -1, 'x'); /* escape string */ + be_strconcat(vm, -2); + be_pop(vm, 1); + } + + be_pushstring(vm, "]"); + be_strconcat(vm, -2); + be_pop(vm, 1); + + be_pushint(vm, c->counter); + be_toescape(vm, -1, 'x'); /* escape string */ + be_strconcat(vm, -2); + be_pop(vm, 1); + } else { + be_pushstring(vm, "[]-"); + } + + be_return(vm); +} + +#include "be_fixed_be_class_Matter_Counter.h" + +/* @const_object_info_begin +class be_class_Matter_Counter (scope: global, name: Matter_Counter) { + _p, var + init, ctype_func(mc_init) + deinit, ctype_func(mc_deinit) + reset, ctype_func(mc_reset) + tostring, func(mc_tostring) + + val, ctype_func(mc_val) + next, ctype_func(mc_next) + validate, ctype_func(mc_validate) +} +@const_object_info_end */ + + +/* + +# Unit tests +import matter +var c = matter.Counter(100) +assert(str(c) == '[00000000000000000000000000000000]100') +assert(c.val() == 100) +assert(c.next() == 101) +assert(c.val() == 101) +assert(str(c) == '[00000000000000000000000000000000]101') + +c.reset(101) +assert(!c.validate(101, true)) +assert(str(c) == '[00000000000000000000000000000000]101') + +c.reset(101) +assert(c.validate(100, true)) +assert(str(c) == '[00000000000000000000000000000001]101') +assert(!c.validate(100, true)) +assert(str(c) == '[00000000000000000000000000000001]101') + +c.reset(101) +assert(c.validate(100, false)) +assert(str(c) == '[00000000000000000000000000000001]101') +assert(!c.validate(100, false)) +assert(str(c) == '[00000000000000000000000000000001]101') + + +c.reset(128) +assert(c.validate(96, true)) +assert(str(c) == '[10000000000000000000000000000000]128') +assert(!c.validate(95, true)) +assert(str(c) == '[10000000000000000000000000000000]128') + +c.reset(128) +assert(c.validate(96, false)) +assert(str(c) == '[10000000000000000000000000000000]128') +assert(c.validate(95, false)) +assert(str(c) == '[00000000000000000000000000000000]95') + + +c.reset(100) +# set the context as in the documentation +assert(c.validate(99, true)) +assert(c.validate(96, true)) +assert(c.validate(70, true)) +assert(str(c) == '[00100000000000000000000000001001]100') + +assert(c.validate(97, true)) +assert(str(c) == '[00100000000000000000000000001101]100') + +assert(!c.validate(100, true)) +assert(!c.validate(99, true)) +assert(!c.validate(97, true)) +assert(!c.validate(96, true)) +assert(!c.validate(70, true)) +assert(str(c) == '[00100000000000000000000000001101]100') # unchanged + +assert(c.validate(101, true)) +assert(str(c) == '[01000000000000000000000000011011]101') + +assert(c.validate(103, true)) +assert(str(c) == '[00000000000000000000000001101110]103') + +assert(!c.validate(70, true)) + +assert(c.validate(200, true)) +assert(str(c) == '[00000000000000000000000000000000]200') + +### counters for outgoing messages + +c.reset() +assert(c.val() == 0) + +*/ \ No newline at end of file diff --git a/lib/libesp32/berry_matter/src/be_matter_module.c b/lib/libesp32/berry_matter/src/be_matter_module.c new file mode 100644 index 000000000..b33a8939f --- /dev/null +++ b/lib/libesp32/berry_matter/src/be_matter_module.c @@ -0,0 +1,270 @@ +/* + be_matter_module.c - implements the high level `matter` Berry module + + 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 . +*/ + +/******************************************************************** + * Matter global module + * + *******************************************************************/ + +#include "be_constobj.h" +#include "be_mapping.h" + +#include "be_matter_qrcode_min_js.h" + +// Matter logo +static const uint8_t MATTER_LOGO[] = + "" + ""; + +extern const bclass be_class_Matter_Counter; +extern const bclass be_class_Matter_Verhoeff; + +#include "solidify/solidified_Matter_Module.h" + +#include "../generate/be_matter_clusters.h" +#include "../generate/be_matter_opcodes.h" + +const char* matter_get_cluster_name(uint16_t cluster) { + for (const matter_cluster_t * cl = matterAllClusters; cl->id != 0xFFFF; cl++) { + if (cl->id == cluster) { + return cl->name; + } + } + return NULL; +} +BE_FUNC_CTYPE_DECLARE(matter_get_cluster_name, "s", "i") + +const char* matter_get_opcode_name(uint16_t opcode) { + for (const matter_opcode_t * op = matter_OpCodes; op->id != 0xFFFF; op++) { + if (op->id == opcode) { + return op->name; + } + } + return NULL; +} +BE_FUNC_CTYPE_DECLARE(matter_get_opcode_name, "s", "i") + +const char* matter_get_attribute_name(uint16_t cluster, uint16_t attribute) { + for (const matter_cluster_t * cl = matterAllClusters; cl->id != 0xFFFF; cl++) { + if (cl->id == cluster) { + for (const matter_attribute_t * at = cl->attributes; at->id != 0xFFFF; at++) { + if (at->id == attribute) { + return at->name; + } + } + } + } + return NULL; +} +BE_FUNC_CTYPE_DECLARE(matter_get_attribute_name, "s", "ii") + +const char* matter_get_command_name(uint16_t cluster, uint16_t command) { + for (const matter_cluster_t * cl = matterAllClusters; cl->id != 0xFFFF; cl++) { + if (cl->id == cluster) { + for (const matter_command_t * cmd = cl->commands; cmd->id != 0xFFFF; cmd++) { + if (cmd->id == command) { + return cmd->name; + } + } + } + } + return NULL; +} +BE_FUNC_CTYPE_DECLARE(matter_get_command_name, "s", "ii") + +#include "solidify/solidified_Matter_inspect.h" + +extern const bclass be_class_Matter_TLV; // need to declare it upfront because of circular reference +#include "solidify/solidified_Matter_TLV.h" +#include "solidify/solidified_Matter_IM_Data.h" +#include "solidify/solidified_Matter_UDPServer.h" +#include "solidify/solidified_Matter_Session.h" +#include "solidify/solidified_Matter_Commissioning_Data.h" +#include "solidify/solidified_Matter_Commissioning.h" +#include "solidify/solidified_Matter_Message.h" +#include "solidify/solidified_Matter_MessageHandler.h" +#include "solidify/solidified_Matter_IM.h" +#include "solidify/solidified_Matter_Plugin.h" +#include "solidify/solidified_Matter_Base38.h" +#include "solidify/solidified_Matter_UI.h" +#include "solidify/solidified_Matter_Device.h" + +#include "../generate/be_matter_certs.h" + +#include "solidify/solidified_Matter_Plugin_core.h" +#include "solidify/solidified_Matter_Plugin_Relay.h" + +/*********************************************************************************************\ + * Get a bytes() object of the certificate DAC/PAI_Cert +\*********************************************************************************************/ +static int matter_return_static_bytes(bvm *vm, const uint8* addr, size_t len) { + be_getbuiltin(vm, "bytes"); + be_pushcomptr(vm, addr); + be_pushint(vm, - len); + be_call(vm, 2); + be_pop(vm, 2); + be_return(vm); +} +static int matter_PAI_Cert_FFF1(bvm *vm) { return matter_return_static_bytes(vm, kDevelopmentPAI_Cert_FFF1, sizeof(kDevelopmentPAI_Cert_FFF1)); } +static int matter_PAI_Pub_FFF1(bvm *vm) { return matter_return_static_bytes(vm, kDevelopmentPAI_PublicKey_FFF1, sizeof(kDevelopmentPAI_PublicKey_FFF1)); } +static int matter_PAI_Priv_FFF1(bvm *vm) { return matter_return_static_bytes(vm, kDevelopmentPAI_PrivateKey_FFF1, sizeof(kDevelopmentPAI_PrivateKey_FFF1)); } +static int matter_DAC_Cert_FFF1_8000(bvm *vm) { return matter_return_static_bytes(vm, kDevelopmentDAC_Cert_FFF1_8000, sizeof(kDevelopmentDAC_Cert_FFF1_8000)); } +static int matter_DAC_Pub_FFF1_8000(bvm *vm) { return matter_return_static_bytes(vm, kDevelopmentDAC_PublicKey_FFF1_8000, sizeof(kDevelopmentDAC_PublicKey_FFF1_8000)); } +static int matter_DAC_Priv_FFF1_8000(bvm *vm) { return matter_return_static_bytes(vm, kDevelopmentDAC_PrivateKey_FFF1_8000, sizeof(kDevelopmentDAC_PrivateKey_FFF1_8000)); } +static int matter_CD_FFF1_8000(bvm *vm) { return matter_return_static_bytes(vm, kCdForAllExamples, sizeof(kCdForAllExamples)); } + + +#include "be_fixed_matter.h" + +/* @const_object_info_begin + +module matter (scope: global) { + _LOGO, comptr(MATTER_LOGO) + _QRCODE_MINJS, comptr(QRCODE_MINJS) + MATTER_OPTION, int(151) // SetOption151 enables Matter + + Verhoeff, class(be_class_Matter_Verhoeff) + Counter, class(be_class_Matter_Counter) + setmember, closure(matter_setmember_closure) + member, closure(matter_member_closure) + + get_cluster_name, ctype_func(matter_get_cluster_name) + get_attribute_name, ctype_func(matter_get_attribute_name) + get_command_name, ctype_func(matter_get_command_name) + get_opcode_name, ctype_func(matter_get_opcode_name) + TLV, class(be_class_Matter_TLV) + sort, closure(matter_sort_closure) + inspect, closure(matter_inspect_closure) + + // Status codes + SUCCESS, int(0x00) + FAILURE, int(0x01) + INVALID_SUBSCRIPTION, int(0x7D) + UNSUPPORTED_ACCESS, int(0x7E) + UNSUPPORTED_ENDPOINT, int(0x7F) + INVALID_ACTION, int(0x80) + UNSUPPORTED_COMMAND, int(0x81) + INVALID_COMMAND, int(0x85) + UNSUPPORTED_ATTRIBUTE, int(0x86) + CONSTRAINT_ERROR, int(0x87) + UNSUPPORTED_WRITE, int(0x88) + RESOURCE_EXHAUSTED, int(0x89) + NOT_FOUND, int(0x8B) + UNREPORTABLE_ATTRIBUTE, int(0x8C) + INVALID_DATA_TYPE, int(0x8D) + UNSUPPORTED_READ, int(0x8F) + DATA_VERSION_MISMATCH, int(0x92) + TIMEOUT, int(0x94) + UNSUPPORTED_NODE, int(0x9B) + BUSY, int(0x9C) + UNSUPPORTED_CLUSTER, int(0xC3) + NO_UPSTREAM_SUBSCRIP­TION, int(0xC5) + NEEDS_TIMED_INTERACTION, int(0xC6) + UNSUPPORTED_EVENT, int(0xC7) + PATHS_EXHAUSTED, int(0xC8) + TIMED_REQUEST_MISMATCH, int(0xC9) + FAILSAFE_REQUIRED, int(0xCA) + + // Matter_Data_IM classes + AttributePathIB, class(be_class_Matter_AttributePathIB) + ClusterPathIB, class(be_class_Matter_ClusterPathIB) + DataVersionFilterIB, class(be_class_Matter_DataVersionFilterIB) + AttributeDataIB, class(be_class_Matter_AttributeDataIB) + AttributeReportIB, class(be_class_Matter_AttributeReportIB) + EventFilterIB, class(be_class_Matter_EventFilterIB) + EventPathIB, class(be_class_Matter_EventPathIB) + EventDataIB, class(be_class_Matter_EventDataIB) + EventReportIB, class(be_class_Matter_EventReportIB) + CommandPathIB, class(be_class_Matter_CommandPathIB) + CommandDataIB, class(be_class_Matter_CommandDataIB) + InvokeResponseIB, class(be_class_Matter_InvokeResponseIB) + CommandStatusIB, class(be_class_Matter_CommandStatusIB) + EventStatusIB, class(be_class_Matter_EventStatusIB) + AttributeStatusIB, class(be_class_Matter_AttributeStatusIB) + StatusIB, class(be_class_Matter_StatusIB) + StatusResponseMessage, class(be_class_Matter_StatusResponseMessage) + ReadRequestMessage, class(be_class_Matter_ReadRequestMessage) + ReportDataMessage, class(be_class_Matter_ReportDataMessage) + SubscribeRequestMessage, class(be_class_Matter_SubscribeRequestMessage) + SubscribeResponseMessage, class(be_class_Matter_SubscribeResponseMessage) + WriteRequestMessage, class(be_class_Matter_WriteRequestMessage) + WriteResponseMessage, class(be_class_Matter_WriteResponseMessage) + TimedRequestMessage, class(be_class_Matter_TimedRequestMessage) + InvokeRequestMessage, class(be_class_Matter_InvokeRequestMessage) + InvokeResponseMessage, class(be_class_Matter_InvokeResponseMessage) + + // Matter Commisioning messages + PBKDFParamRequest, class(be_class_Matter_PBKDFParamRequest) + PBKDFParamResponse, class(be_class_Matter_PBKDFParamResponse) + Pake1, class(be_class_Matter_Pake1) + Pake2, class(be_class_Matter_Pake2) + Pake3, class(be_class_Matter_Pake3) + Sigma1, class(be_class_Matter_Sigma1) + Sigma2, class(be_class_Matter_Sigma2) + Sigma2Resume, class(be_class_Matter_Sigma2Resume) + Sigma3, class(be_class_Matter_Sigma3) + + Commisioning_Context, class(be_class_Matter_Commisioning_Context) + + // UDP Server + UDPPacket_sent, class(be_class_Matter_UDPPacket_sent) + UDPServer, class(be_class_Matter_UDPServer) + + // Sessions + Session, class(be_class_Matter_Session) + Session_Store, class(be_class_Matter_Session_Store) + + // Message Handler + Frame, class(be_class_Matter_Frame) + MessageHandler, class(be_class_Matter_MessageHandler) + + // Interation Model + Response_container, class(be_class_Matter_Response_container) + IM, class(be_class_Matter_IM) + Plugin_core, class(be_class_Matter_Plugin_core) + UI, class(be_class_Matter_UI) + + // Base38 for QR Code + Base38, class(be_class_Matter_Base38) + + // Matter Device core class + Device, class(be_class_Matter_Device) + + // credentials from example + PAI_Cert_FFF1, func(matter_PAI_Cert_FFF1) + PAI_Pub_FFF1, func(matter_PAI_Pub_FFF1) + PAI_Priv_FFF1, func(matter_PAI_Priv_FFF1) + DAC_Cert_FFF1_8000, func(matter_DAC_Cert_FFF1_8000) + DAC_Pub_FFF1_8000, func(matter_DAC_Pub_FFF1_8000) + DAC_Priv_FFF1_8000, func(matter_DAC_Priv_FFF1_8000) + CD_FFF1_8000, func(matter_CD_FFF1_8000) // Certification Declaration + + // Plugins + Plugin_core, class(be_class_Matter_Plugin_core) // Generic behavior common to all devices + Plugin_Relay, class(be_class_Matter_Plugin_Relay) // Relay behavior (OnOff) +} + +@const_object_info_end */ + diff --git a/lib/libesp32/berry_matter/src/be_matter_qrcode_min_js.h b/lib/libesp32/berry_matter/src/be_matter_qrcode_min_js.h new file mode 100644 index 000000000..ee97215d0 --- /dev/null +++ b/lib/libesp32/berry_matter/src/be_matter_qrcode_min_js.h @@ -0,0 +1,45 @@ +/* + be_matter_qrcode_min_js.h - solidify in Flash `qrcode.min.js` for browser-side QRCode generation in Javascript + + 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 . +*/ + +// Lib JS from +// from https://github.com/davidshimjs/qrcodejs +// file qrcode.min.js + +// Converter: https://tomeko.net/online_tools/cpp_text_escape.php?lang=en + +/* +The MIT License (MIT) +--------------------- +Copyright (c) 2012 davidshimjs + +Permission is hereby granted, free of charge, +to any person obtaining a copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +static const uint8_t QRCODE_MINJS[] = +"var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this.parsedData=[];for(var b=[],d=0,e=this.data.length;e>d;d++){var f=this.data.charCodeAt(d);f>65536?(b[0]=240|(1835008&f)>>>18,b[1]=128|(258048&f)>>>12,b[2]=128|(4032&f)>>>6,b[3]=128|63&f):f>2048?(b[0]=224|(61440&f)>>>12,b[1]=128|(4032&f)>>>6,b[2]=128|63&f):f>128?(b[0]=192|(1984&f)>>>6,b[1]=128|63&f):b[0]=f,this.parsedData=this.parsedData.concat(b)}this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function b(a,b){this.typeNumber=a,this.errorCorrectLevel=b,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function i(a,b){if(void 0==a.length)throw new Error(a.length+\"/\"+b);for(var c=0;c=f;f++){var h=0;switch(b){case d.L:h=l[f][0];break;case d.M:h=l[f][1];break;case d.Q:h=l[f][2];break;case d.H:h=l[f][3]}if(h>=e)break;c++}if(c>l.length)throw new Error(\"Too long data\");return c}function s(a){var b=encodeURI(a).toString().replace(/\\%[0-9a-fA-F]{2}/g,\"a\");return b.length+(b.length!=a?3:0)}a.prototype={getLength:function(){return this.parsedData.length},write:function(a){for(var b=0,c=this.parsedData.length;c>b;b++)a.put(this.parsedData[b],8)}},b.prototype={addData:function(b){var c=new a(b);this.dataList.push(c),this.dataCache=null},isDark:function(a,b){if(0>a||this.moduleCount<=a||0>b||this.moduleCount<=b)throw new Error(a+\",\"+b);return this.modules[a][b]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var d=0;d=7&&this.setupTypeNumber(a),null==this.dataCache&&(this.dataCache=b.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,b){for(var c=-1;7>=c;c++)if(!(-1>=a+c||this.moduleCount<=a+c))for(var d=-1;7>=d;d++)-1>=b+d||this.moduleCount<=b+d||(this.modules[a+c][b+d]=c>=0&&6>=c&&(0==d||6==d)||d>=0&&6>=d&&(0==c||6==c)||c>=2&&4>=c&&d>=2&&4>=d?!0:!1)},getBestMaskPattern:function(){for(var a=0,b=0,c=0;8>c;c++){this.makeImpl(!0,c);var d=f.getLostPoint(this);(0==c||a>d)&&(a=d,b=c)}return b},createMovieClip:function(a,b,c){var d=a.createEmptyMovieClip(b,c),e=1;this.make();for(var f=0;f=g;g++)for(var h=-2;2>=h;h++)this.modules[d+g][e+h]=-2==g||2==g||-2==h||2==h||0==g&&0==h?!0:!1}},setupTypeNumber:function(a){for(var b=f.getBCHTypeNumber(this.typeNumber),c=0;18>c;c++){var d=!a&&1==(1&b>>c);this.modules[Math.floor(c/3)][c%3+this.moduleCount-8-3]=d}for(var c=0;18>c;c++){var d=!a&&1==(1&b>>c);this.modules[c%3+this.moduleCount-8-3][Math.floor(c/3)]=d}},setupTypeInfo:function(a,b){for(var c=this.errorCorrectLevel<<3|b,d=f.getBCHTypeInfo(c),e=0;15>e;e++){var g=!a&&1==(1&d>>e);6>e?this.modules[e][8]=g:8>e?this.modules[e+1][8]=g:this.modules[this.moduleCount-15+e][8]=g}for(var e=0;15>e;e++){var g=!a&&1==(1&d>>e);8>e?this.modules[8][this.moduleCount-e-1]=g:9>e?this.modules[8][15-e-1+1]=g:this.modules[8][15-e-1]=g}this.modules[this.moduleCount-8][8]=!a},mapData:function(a,b){for(var c=-1,d=this.moduleCount-1,e=7,g=0,h=this.moduleCount-1;h>0;h-=2)for(6==h&&h--;;){for(var i=0;2>i;i++)if(null==this.modules[d][h-i]){var j=!1;g>>e));var k=f.getMask(b,d,h-i);k&&(j=!j),this.modules[d][h-i]=j,e--,-1==e&&(g++,e=7)}if(d+=c,0>d||this.moduleCount<=d){d-=c,c=-c;break}}}},b.PAD0=236,b.PAD1=17,b.createData=function(a,c,d){for(var e=j.getRSBlocks(a,c),g=new k,h=0;h8*l)throw new Error(\"code length overflow. (\"+g.getLengthInBits()+\">\"+8*l+\")\");for(g.getLengthInBits()+4<=8*l&&g.put(0,4);0!=g.getLengthInBits()%8;)g.putBit(!1);for(;;){if(g.getLengthInBits()>=8*l)break;if(g.put(b.PAD0,8),g.getLengthInBits()>=8*l)break;g.put(b.PAD1,8)}return b.createBytes(g,e)},b.createBytes=function(a,b){for(var c=0,d=0,e=0,g=new Array(b.length),h=new Array(b.length),j=0;j=0?p.get(q):0}}for(var r=0,m=0;mm;m++)for(var j=0;jm;m++)for(var j=0;j=0;)b^=f.G15<=0;)b^=f.G18<>>=1;return b},getPatternPosition:function(a){return f.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,b,c){switch(a){case e.PATTERN000:return 0==(b+c)%2;case e.PATTERN001:return 0==b%2;case e.PATTERN010:return 0==c%3;case e.PATTERN011:return 0==(b+c)%3;case e.PATTERN100:return 0==(Math.floor(b/2)+Math.floor(c/3))%2;case e.PATTERN101:return 0==b*c%2+b*c%3;case e.PATTERN110:return 0==(b*c%2+b*c%3)%2;case e.PATTERN111:return 0==(b*c%3+(b+c)%2)%2;default:throw new Error(\"bad maskPattern:\"+a)}},getErrorCorrectPolynomial:function(a){for(var b=new i([1],0),c=0;a>c;c++)b=b.multiply(new i([1,g.gexp(c)],0));return b},getLengthInBits:function(a,b){if(b>=1&&10>b)switch(a){case c.MODE_NUMBER:return 10;case c.MODE_ALPHA_NUM:return 9;case c.MODE_8BIT_BYTE:return 8;case c.MODE_KANJI:return 8;default:throw new Error(\"mode:\"+a)}else if(27>b)switch(a){case c.MODE_NUMBER:return 12;case c.MODE_ALPHA_NUM:return 11;case c.MODE_8BIT_BYTE:return 16;case c.MODE_KANJI:return 10;default:throw new Error(\"mode:\"+a)}else{if(!(41>b))throw new Error(\"type:\"+b);switch(a){case c.MODE_NUMBER:return 14;case c.MODE_ALPHA_NUM:return 13;case c.MODE_8BIT_BYTE:return 16;case c.MODE_KANJI:return 12;default:throw new Error(\"mode:\"+a)}}},getLostPoint:function(a){for(var b=a.getModuleCount(),c=0,d=0;b>d;d++)for(var e=0;b>e;e++){for(var f=0,g=a.isDark(d,e),h=-1;1>=h;h++)if(!(0>d+h||d+h>=b))for(var i=-1;1>=i;i++)0>e+i||e+i>=b||(0!=h||0!=i)&&g==a.isDark(d+h,e+i)&&f++;f>5&&(c+=3+f-5)}for(var d=0;b-1>d;d++)for(var e=0;b-1>e;e++){var j=0;a.isDark(d,e)&&j++,a.isDark(d+1,e)&&j++,a.isDark(d,e+1)&&j++,a.isDark(d+1,e+1)&&j++,(0==j||4==j)&&(c+=3)}for(var d=0;b>d;d++)for(var e=0;b-6>e;e++)a.isDark(d,e)&&!a.isDark(d,e+1)&&a.isDark(d,e+2)&&a.isDark(d,e+3)&&a.isDark(d,e+4)&&!a.isDark(d,e+5)&&a.isDark(d,e+6)&&(c+=40);for(var e=0;b>e;e++)for(var d=0;b-6>d;d++)a.isDark(d,e)&&!a.isDark(d+1,e)&&a.isDark(d+2,e)&&a.isDark(d+3,e)&&a.isDark(d+4,e)&&!a.isDark(d+5,e)&&a.isDark(d+6,e)&&(c+=40);for(var k=0,e=0;b>e;e++)for(var d=0;b>d;d++)a.isDark(d,e)&&k++;var l=Math.abs(100*k/b/b-50)/5;return c+=10*l}},g={glog:function(a){if(1>a)throw new Error(\"glog(\"+a+\")\");return g.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;a>=256;)a-=255;return g.EXP_TABLE[a]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},h=0;8>h;h++)g.EXP_TABLE[h]=1<h;h++)g.EXP_TABLE[h]=g.EXP_TABLE[h-4]^g.EXP_TABLE[h-5]^g.EXP_TABLE[h-6]^g.EXP_TABLE[h-8];for(var h=0;255>h;h++)g.LOG_TABLE[g.EXP_TABLE[h]]=h;i.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var b=new Array(this.getLength()+a.getLength()-1),c=0;cf;f++)for(var g=c[3*f+0],h=c[3*f+1],i=c[3*f+2],k=0;g>k;k++)e.push(new j(h,i));return e},j.getRsBlockTable=function(a,b){switch(b){case d.L:return j.RS_BLOCK_TABLE[4*(a-1)+0];case d.M:return j.RS_BLOCK_TABLE[4*(a-1)+1];case d.Q:return j.RS_BLOCK_TABLE[4*(a-1)+2];case d.H:return j.RS_BLOCK_TABLE[4*(a-1)+3];default:return void 0}},k.prototype={get:function(a){var b=Math.floor(a/8);return 1==(1&this.buffer[b]>>>7-a%8)},put:function(a,b){for(var c=0;b>c;c++)this.putBit(1==(1&a>>>b-c-1))},getLengthInBits:function(){return this.length},putBit:function(a){var b=Math.floor(this.length/8);this.buffer.length<=b&&this.buffer.push(0),a&&(this.buffer[b]|=128>>>this.length%8),this.length++}};var l=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],o=function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.draw=function(a){function g(a,b){var c=document.createElementNS(\"http://www.w3.org/2000/svg\",a);for(var d in b)b.hasOwnProperty(d)&&c.setAttribute(d,b[d]);return c}var b=this._htOption,c=this._el,d=a.getModuleCount();Math.floor(b.width/d),Math.floor(b.height/d),this.clear();var h=g(\"svg\",{viewBox:\"0 0 \"+String(d)+\" \"+String(d),width:\"100%\",height:\"100%\",fill:b.colorLight});h.setAttributeNS(\"http://www.w3.org/2000/xmlns/\",\"xmlns:xlink\",\"http://www.w3.org/1999/xlink\"),c.appendChild(h),h.appendChild(g(\"rect\",{fill:b.colorDark,width:\"1\",height:\"1\",id:\"template\"}));for(var i=0;d>i;i++)for(var j=0;d>j;j++)if(a.isDark(i,j)){var k=g(\"use\",{x:String(i),y:String(j)});k.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"href\",\"#template\"),h.appendChild(k)}},a.prototype.clear=function(){for(;this._el.hasChildNodes();)this._el.removeChild(this._el.lastChild)},a}(),p=\"svg\"===document.documentElement.tagName.toLowerCase(),q=p?o:m()?function(){function a(){this._elImage.src=this._elCanvas.toDataURL(\"image/png\"),this._elImage.style.display=\"block\",this._elCanvas.style.display=\"none\"}function d(a,b){var c=this;if(c._fFail=b,c._fSuccess=a,null===c._bSupportDataURI){var d=document.createElement(\"img\"),e=function(){c._bSupportDataURI=!1,c._fFail&&_fFail.call(c)},f=function(){c._bSupportDataURI=!0,c._fSuccess&&c._fSuccess.call(c)};return d.onabort=e,d.onerror=e,d.onload=f,d.src=\"data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==\",void 0}c._bSupportDataURI===!0&&c._fSuccess?c._fSuccess.call(c):c._bSupportDataURI===!1&&c._fFail&&c._fFail.call(c)}if(this._android&&this._android<=2.1){var b=1/window.devicePixelRatio,c=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(a,d,e,f,g,h,i,j){if(\"nodeName\"in a&&/img/i.test(a.nodeName))for(var l=arguments.length-1;l>=1;l--)arguments[l]=arguments[l]*b;else\"undefined\"==typeof j&&(arguments[1]*=b,arguments[2]*=b,arguments[3]*=b,arguments[4]*=b);c.apply(this,arguments)}}var e=function(a,b){this._bIsPainted=!1,this._android=n(),this._htOption=b,this._elCanvas=document.createElement(\"canvas\"),this._elCanvas.width=b.width,this._elCanvas.height=b.height,a.appendChild(this._elCanvas),this._el=a,this._oContext=this._elCanvas.getContext(\"2d\"),this._bIsPainted=!1,this._elImage=document.createElement(\"img\"),this._elImage.style.display=\"none\",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return e.prototype.draw=function(a){var b=this._elImage,c=this._oContext,d=this._htOption,e=a.getModuleCount(),f=d.width/e,g=d.height/e,h=Math.round(f),i=Math.round(g);b.style.display=\"none\",this.clear();for(var j=0;e>j;j++)for(var k=0;e>k;k++){var l=a.isDark(j,k),m=k*f,n=j*g;c.strokeStyle=l?d.colorDark:d.colorLight,c.lineWidth=1,c.fillStyle=l?d.colorDark:d.colorLight,c.fillRect(m,n,f,g),c.strokeRect(Math.floor(m)+.5,Math.floor(n)+.5,h,i),c.strokeRect(Math.ceil(m)-.5,Math.ceil(n)-.5,h,i)}this._bIsPainted=!0},e.prototype.makeImage=function(){this._bIsPainted&&d.call(this,a)},e.prototype.isPainted=function(){return this._bIsPainted},e.prototype.clear=function(){this._oContext.clearRect(0,0,this._elCanvas.width,this._elCanvas.height),this._bIsPainted=!1},e.prototype.round=function(a){return a?Math.floor(1e3*a)/1e3:a},e}():function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.draw=function(a){for(var b=this._htOption,c=this._el,d=a.getModuleCount(),e=Math.floor(b.width/d),f=Math.floor(b.height/d),g=[''],h=0;d>h;h++){g.push(\"\");for(var i=0;d>i;i++)g.push('');g.push(\"\")}g.push(\"
\"),c.innerHTML=g.join(\"\");var j=c.childNodes[0],k=(b.width-j.offsetWidth)/2,l=(b.height-j.offsetHeight)/2;k>0&&l>0&&(j.style.margin=l+\"px \"+k+\"px\")},a.prototype.clear=function(){this._el.innerHTML=\"\"},a}();QRCode=function(a,b){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:\"#000000\",colorLight:\"#ffffff\",correctLevel:d.H},\"string\"==typeof b&&(b={text:b}),b)for(var c in b)this._htOption[c]=b[c];\"string\"==typeof a&&(a=document.getElementById(a)),this._android=n(),this._el=a,this._oQRCode=null,this._oDrawing=new q(this._el,this._htOption),this._htOption.text&&this.makeCode(this._htOption.text)},QRCode.prototype.makeCode=function(a){this._oQRCode=new b(r(a,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(a),this._oQRCode.make(),this._el.title=a,this._oDrawing.draw(this._oQRCode),this.makeImage()},QRCode.prototype.makeImage=function(){\"function\"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},QRCode.prototype.clear=function(){this._oDrawing.clear()},QRCode.CorrectLevel=d}();" +; diff --git a/lib/libesp32/berry_matter/src/be_matter_verhoeff.cpp b/lib/libesp32/berry_matter/src/be_matter_verhoeff.cpp new file mode 100644 index 000000000..5e8f56511 --- /dev/null +++ b/lib/libesp32/berry_matter/src/be_matter_verhoeff.cpp @@ -0,0 +1,105 @@ +/* + be_matter_verhoeff.cpp - implements the Verhoeff algorithm to compute a checksum digit for QR Code + + 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 . +*/ + +#include +#include +#include "be_constobj.h" +#include "be_mapping.h" + +// code inspired from https://www.programmingalgorithms.com/algorithm/verhoeff-algorithm/c/ + +static const int8_t _multiplicationTable[10][10] = { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, + { 1, 2, 3, 4, 0, 6, 7, 8, 9, 5 }, + { 2, 3, 4, 0, 1, 7, 8, 9, 5, 6 }, + { 3, 4, 0, 1, 2, 8, 9, 5, 6, 7 }, + { 4, 0, 1, 2, 3, 9, 5, 6, 7, 8 }, + { 5, 9, 8, 7, 6, 0, 4, 3, 2, 1 }, + { 6, 5, 9, 8, 7, 1, 0, 4, 3, 2 }, + { 7, 6, 5, 9, 8, 2, 1, 0, 4, 3 }, + { 8, 7, 6, 5, 9, 3, 2, 1, 0, 4 }, + { 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 } +}; + +static const int8_t _permutationTable[10][10] = { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, + { 1, 5, 7, 6, 2, 8, 3, 0, 9, 4 }, + { 5, 8, 0, 3, 7, 9, 6, 1, 4, 2 }, + { 8, 9, 1, 6, 0, 4, 3, 5, 2, 7 }, + { 9, 4, 5, 3, 1, 2, 6, 8, 7, 0 }, + { 4, 2, 8, 6, 5, 7, 3, 9, 0, 1 }, + { 2, 7, 9, 3, 8, 0, 6, 4, 1, 5 }, + { 7, 0, 4, 6, 9, 1, 3, 2, 5, 8 } +}; + +static const int8_t _inverseTable[10] = { 0, 4, 3, 2, 1, 5, 6, 7, 8, 9 }; + +static char ret_digit[] = "0"; // used as a placeholder to return a single digit string + +const char* vh_checksum(const char* number) { + int32_t c = 0; + int32_t len = strlen(number); + + for (int32_t i = 0; i < len; ++i) { + int8_t digit = number[len - i - 1] - '0'; + if (digit < 0) { digit = 0; } + if (digit > 9) { digit = 9; } + c = _multiplicationTable[c][_permutationTable[((i + 1) % 8)][digit]]; + } + + ret_digit[0] = _inverseTable[c] + '0'; + return ret_digit; +} +BE_FUNC_CTYPE_DECLARE(vh_checksum, "s", "s") + +static bbool vh_validate(char* number) { + int32_t c = 0; + int32_t len = strlen(number); + + for (int32_t i = 0; i < len; ++i) { + int8_t digit = number[len - i - 1] - '0'; + if (digit < 0) { digit = 0; } + if (digit > 9) { digit = 9; } + c = _multiplicationTable[c][_permutationTable[(i % 8)][digit]]; + } + return c == 0; +} +BE_FUNC_CTYPE_DECLARE(vh_validate, "b", "s") + +#include "be_fixed_be_class_Matter_Verhoeff.h" + +/* @const_object_info_begin +class be_class_Matter_Verhoeff (scope: global, name: Matter_Verhoeff) { + checksum, static_ctype_func(vh_checksum) + validate, static_ctype_func(vh_validate) +} +@const_object_info_end */ + + +/* + +# Unit tests +import matter + +assert(matter.Verhoeff.checksum("236") == "3") +assert(matter.Verhoeff.validate("236")) +assert(matter.Verhoeff.checksum("58564") == "9") +assert(matter.Verhoeff.validate("585649")) + +*/ \ No newline at end of file diff --git a/lib/libesp32/berry_matter/src/berry_tasmota.h b/lib/libesp32/berry_matter/src/berry_tasmota.h new file mode 100644 index 000000000..4d9bed92a --- /dev/null +++ b/lib/libesp32/berry_matter/src/berry_tasmota.h @@ -0,0 +1,8 @@ +// force include of module by including this file + +#ifndef __BERRY_MATTER__ +#define __BERRY_MATTER__ + + + +#endif // __BERRY_MATTER__ diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Base38.be b/lib/libesp32/berry_matter/src/embedded/Matter_Base38.be new file mode 100644 index 000000000..0992d682d --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Base38.be @@ -0,0 +1,71 @@ +# +# Matter_Base38.be - suppport for Base38 encoding which is used in QR Codes +# +# 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 + +#@ solidify:Matter_Base38,weak + +class Matter_Base38 + + static def encode(raw) + # encodes b38 (mutates `b`) + def b38_enc(v, l) + import string + var ENCODE = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-." + var i = 0 + var ret = "" + while i < l + ret += ENCODE[v % 38] + v = v / 38 + i += 1 + end + return ret + end + + var idx = 0 + var sz = size(raw) + var out = "" + + while idx < sz + var val + if idx + 2 < sz + # encode 3 bytes + val = raw[idx] | (raw[idx+1] << 8) | (raw[idx+2] << 16) + out += b38_enc(val, 5) + idx += 3 + elif idx + 1 < sz + # encode 2 bytes + val = raw[idx] | (raw[idx+1] << 8) + out += b38_enc(val, 4) + idx += 2 + else + # encode 1 byte + val = raw[idx] + out += b38_enc(val, 2) + idx += 1 + end + end + return out + end +end +matter.Base38 = Matter_Base38 + +#- + +-# diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Commissioning.be b/lib/libesp32/berry_matter/src/embedded/Matter_Commissioning.be new file mode 100644 index 000000000..0a027affd --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Commissioning.be @@ -0,0 +1,632 @@ +# +# Matter_Commissioning.be - suppport for Matter Commissioning process +# +# 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 + +#@ solidify:Matter_Commisioning_Context,weak + +################################################################################# +# Class Matter_Commisioning_Context +################################################################################# +class Matter_Commisioning_Context +# static Matter_Context_Prefix = "Matter PAKE V1 Commissioning" # spec is wrong + static var Matter_Context_Prefix = "CHIP PAKE V1 Commissioning" # from CHIP code + static var SEKeys_Info = "SessionKeys" + static var S2K_Info = "Sigma2" + static var S3K_Info = "Sigma3" + static var TBEData2_Nonce = "NCASE_Sigma2N" + static var TBEData3_Nonce = "NCASE_Sigma3N" + + var responder # reference to the caller, sending packets + var device # root device object + var spake + var future_initiator_session_id + var future_local_session_id + # used by TT hash + var PBKDFParamRequest, PBKDFParamResponse + # PAKE + var y # 32 bytes random known only by verifier + var pA, pB, cA, cB + var Ke + # CASE + var ResponderEph_priv, ResponderEph_pub + var initiatorEph_pub + # Session data + var session_timestamp + var I2RKey, R2IKey, AttestationChallenge + # is commissioning window open + var window_open + + def init(responder) + import crypto + self.responder = responder + self.device = responder.device + # generate y once + self.y = crypto.random(32) + + self.window_open = true # auto-commissioning for now + end + + def process_incoming(msg, remote_ip, remote_port) + # + if !self.window_open + tasmota.log("MTR: commissioning not open", 2) + return false + end + + tasmota.log("MTR: received message " + matter.inspect(msg), 3) + if msg.opcode == 0x20 + return self.parse_PBKDFParamRequest(msg, remote_ip, remote_port) + elif msg.opcode == 0x22 + return self.parse_Pake1(msg, remote_ip, remote_port) + elif msg.opcode == 0x24 + return self.parse_Pake3(msg, remote_ip, remote_port) + elif msg.opcode == 0x30 + return self.parse_Sigma1(msg, remote_ip, remote_port) + elif msg.opcode == 0x32 + return self.parse_Sigma3(msg, remote_ip, remote_port) + end + + return false + end + + def parse_PBKDFParamRequest(msg, addr, port) + import crypto + # sanity checks + if msg.opcode != 0x20 || msg.local_session_id != 0 || msg.protocol_id != 0 + raise "protocol_error", "invalid PBKDFParamRequest message" + end + var pbkdfparamreq = matter.PBKDFParamRequest().parse(msg.raw, msg.app_payload_idx) + msg.session.set_mode(matter.Session.__PASE) + + self.PBKDFParamRequest = msg.raw[msg.app_payload_idx..] + + # sanity check for PBKDFParamRequest + if pbkdfparamreq.passcodeId != 0 raise "protocol_error", "non-zero passcode id" end + + # record the initiator_session_id + self.future_initiator_session_id = pbkdfparamreq.initiator_session_id + self.future_local_session_id = self.device.sessions.gen_local_session_id() + + # prepare response + var pbkdfparamresp = matter.PBKDFParamResponse() + + pbkdfparamresp.initiatorRandom = pbkdfparamreq.initiatorRandom + # generate 32 bytes random + pbkdfparamresp.responderRandom = crypto.random(32) + pbkdfparamresp.responderSessionId = self.future_local_session_id + pbkdfparamresp.pbkdf_parameters_salt = self.device.salt + pbkdfparamresp.pbkdf_parameters_iterations = self.device.iterations + tasmota.log("MTR: pbkdfparamresp: " + str(matter.inspect(pbkdfparamresp)), 3) + var pbkdfparamresp_raw = pbkdfparamresp.encode() + tasmota.log("MTR: pbkdfparamresp_raw: " + pbkdfparamresp_raw.tohex(), 3) + + self.PBKDFParamResponse = pbkdfparamresp_raw + + var resp = msg.build_response(0x21 #-PBKDR Response-#, true) + var raw = resp.encode(pbkdfparamresp_raw) + + self.responder.send_response(raw, addr, port, resp.message_counter) + end + + def parse_Pake1(msg, addr, port) + import crypto + # sanity checks + if msg.opcode != 0x22 || msg.local_session_id != 0 || msg.protocol_id != 0 + raise "protocol_error", "invalid Pake1 message" + end + var pake1 = matter.Pake1().parse(msg.raw, msg.app_payload_idx) + + self.pA = pake1.pA + tasmota.log("MTR: received pA=" + self.pA.tohex(), 3) + + + tasmota.log("MTR: spake: " + matter.inspect(self.spake), 3) + # instanciate SPAKE + self.spake = crypto.SPAKE2P_Matter(self.device.w0, self.device.w1, self.device.L) + # compute pB + self.spake.compute_pB(self.y) + self.pB = self.spake.pB + tasmota.log("MTR: y=" + self.y.tohex(), 3) + tasmota.log("MTR: pb=" + self.pB.tohex(), 3) + + # compute ZV + self.spake.compute_ZV_verifier(self.pA) + tasmota.log("MTR: Z=" + self.spake.Z.tohex(), 3) + tasmota.log("MTR: V=" + self.spake.V.tohex(), 3) + + var context = crypto.SHA256() + context.update(bytes().fromstring(self.Matter_Context_Prefix)) + context.update(self.PBKDFParamRequest) + context.update(self.PBKDFParamResponse) + var context_hash = context.out() + + tasmota.log("MTR: Context=" + context_hash.tohex(), 3) + + # add pA + self.spake.pA = self.pA + + self.spake.set_context(context_hash) + self.spake.compute_TT_hash(true) # `true` to indicate it's Matter variant to SPAKE2+ + + tasmota.log("MTR: ------------------------------", 3) + tasmota.log("MTR: Context = " + self.spake.Context.tohex(), 3) + tasmota.log("MTR: A = " + self.spake.A.tohex(), 3) + tasmota.log("MTR: B = " + self.spake.B.tohex(), 3) + tasmota.log("MTR: M = " + self.spake.M.tohex(), 3) + tasmota.log("MTR: N = " + self.spake.N.tohex(), 3) + tasmota.log("MTR: pA = " + self.spake.pA.tohex(), 3) + tasmota.log("MTR: pB = " + self.spake.pB.tohex(), 3) + tasmota.log("MTR: Z = " + self.spake.Z.tohex(), 3) + tasmota.log("MTR: V = " + self.spake.V.tohex(), 3) + tasmota.log("MTR: w0 = " + self.spake.w0.tohex(), 3) + tasmota.log("MTR: ------------------------------", 3) + + tasmota.log("MTR: Kmain =" + self.spake.Kmain.tohex(), 3) + + tasmota.log("MTR: KcA =" + self.spake.KcA.tohex(), 3) + tasmota.log("MTR: KcB =" + self.spake.KcB.tohex(), 3) + tasmota.log("MTR: K_shared=" + self.spake.K_shared.tohex(), 3) + tasmota.log("MTR: Ke =" + self.spake.Ke.tohex(), 3) + self.cB = self.spake.cB + self.Ke = self.spake.Ke + tasmota.log("MTR: cB=" + self.cB.tohex(), 3) + + var pake2 = matter.Pake2() + pake2.pB = self.pB + pake2.cB = self.cB + tasmota.log("MTR: pake2: " + matter.inspect(pake2), 3) + var pake2_raw = pake2.encode() + tasmota.log("MTR: pake2_raw: " + pake2_raw.tohex(), 3) + + + # now package the response message + var resp = msg.build_response(0x23 #-pake-2-#, true) # no reliable flag + var raw = resp.encode(pake2_raw) + + self.responder.send_response(raw, addr, port, resp.message_counter) + end + + def parse_Pake3(msg, addr, port) + import crypto + # sanity checks + if msg.opcode != 0x24 || msg.local_session_id != 0 || msg.protocol_id != 0 + raise "protocol_error", "invalid Pake3 message" + end + var pake3 = matter.Pake3().parse(msg.raw, msg.app_payload_idx) + + self.cA = pake3.cA + tasmota.log("MTR: received cA=" + self.cA.tohex(), 3) + + # check the value against computed + if self.cA != self.spake.cA raise "protocol_error", "invalid cA received" end + + # send PakeFinished and compute session key + self.session_timestamp = tasmota.rtc()['utc'] + var session_keys = crypto.HKDF_SHA256().derive(self.Ke, bytes(), bytes().fromstring(self.SEKeys_Info), 48) + self.I2RKey = session_keys[0..15] + self.R2IKey = session_keys[16..31] + self.AttestationChallenge = session_keys[32..47] + + tasmota.log("MTR: ******************************", 3) + tasmota.log("MTR: session_keys=" + session_keys.tohex(), 3) + tasmota.log("MTR: I2RKey =" + self.I2RKey.tohex(), 3) + tasmota.log("MTR: R2IKey =" + self.R2IKey.tohex(), 3) + tasmota.log("MTR: AC =" + self.AttestationChallenge.tohex(), 3) + tasmota.log("MTR: ******************************", 3) + + # now package the response message + var resp = msg.build_response(0x40 #-StatusReport-#, false) # no reliable flag + + var status_raw = bytes() + status_raw.add(0x00, 2) # GeneralCode = SUCCESS + status_raw.add(0x0000, 4) # ProtocolID = 0 (PROTOCOL_ID_SECURE_CHANNEL) + status_raw.add(0x0000, 4) # ProtocolCode = 0 (SESSION_ESTABLISHMENT_SUCCESS) + + var raw = resp.encode(status_raw) + + self.responder.send_response(raw, addr, port, nil) + self.responder.add_session(self.future_local_session_id, self.future_initiator_session_id, self.I2RKey, self.R2IKey, self.AttestationChallenge, self.session_timestamp) + end + + def find_session_by_destination_id(destinationId, initiatorRandom) + import crypto + # Validate Sigma1 Destination ID, p.162 + # traverse all existing sessions + tasmota.log("MTR: SEARCHING: destinationId=" + destinationId.tohex(), 3) + for session:self.device.sessions.sessions + if session.noc == nil || session.fabric == nil || session.deviceid == nil continue end + # compute candidateDestinationId, Section 4.13.2.4.1, “Destination Identifier” + var destinationMessage = initiatorRandom + session.get_ca_pub() + session.get_fabric() + session.get_deviceid() + var key = session.get_ipk_group_key() + tasmota.log("MTR: SIGMA1: destinationMessage=" + destinationMessage.tohex(), 3) + tasmota.log("MTR: SIGMA1: key_ipk=" + key.tohex(), 3) + var h = crypto.HMAC_SHA256(key) + h.update(destinationMessage) + var candidateDestinationId = h.out() + tasmota.log("MTR: SIGMA1: candidateDestinationId=" + candidateDestinationId.tohex(), 3) + if candidateDestinationId == destinationId + return session + end + end + return nil + end + + def parse_Sigma1(msg, addr, port) + import crypto + # sanity checks + if msg.opcode != 0x30 || msg.local_session_id != 0 || msg.protocol_id != 0 + raise "protocol_error", "invalid Pake1 message" + end + var sigma1 = matter.Sigma1().parse(msg.raw, msg.app_payload_idx) + + self.initiatorEph_pub = sigma1.initiatorEphPubKey + + # find session + var session = self.find_session_by_destination_id(sigma1.destinationId, sigma1.initiatorRandom) + if session == nil raise "valuer_error", "StatusReport(GeneralCode: FAILURE, ProtocolId: SECURE_CHANNEL, ProtocolCode: NO_SHARED_TRUST_ROOTS)" end + session.source_node_id = msg.source_node_id + session.set_mode(matter.Session.__CASE) + + if msg.session + self.device.sessions.remove_session(msg.session) # drop the temporary session that was created + end + msg.session = session + session._future_initiator_session_id = sigma1.initiator_session_id # update initiator_session_id + session._future_local_session_id = self.device.sessions.gen_local_session_id() + self.future_local_session_id = session._future_local_session_id + + + # Check that it's a resumption + if sigma1.resumptionID != nil && sigma1.initiatorResumeMIC != nil && + session.shared_secret != nil + # Resumption p.169 + var s1rk_salt = sigma1.initiatorRandom + sigma1.resumptionID + var s1rk_info = bytes().fromstring("Sigma1_Resume") + var s1rk = crypto.HKDF_SHA256().derive(session.shared_secret, s1rk_salt, s1rk_info, 16) + + var Resume1MIC_Nonce = bytes().fromstring("NCASE_SigmaR1") + var encrypted = sigma1.initiatorResumeMIC[0..-17] + var tag = sigma1.initiatorResumeMIC[-16..] + var ec = crypto.AES_CCM(s1rk, Resume1MIC_Nonce, bytes(), size(encrypted), 16) + var Resume1MICPayload = ec.decrypt(encrypted) + var decrypted_tag = ec.tag() + + tasmota.log("****************************************", 3) + tasmota.log("MTR: * s1rk = " + s1rk.tohex(), 3) + tasmota.log("MTR: * tag = " + tag.tohex(), 3) + tasmota.log("MTR: * Resume1MICPayload = " + Resume1MICPayload.tohex(), 3) + tasmota.log("MTR: * decrypted_tag = " + decrypted_tag.tohex(), 3) + tasmota.log("****************************************", 3) + if tag == decrypted_tag + # Generate and Send Sigma2_Resume + session.resumption_id = crypto.random(16) # generate a new resumption id + + # compute S2RK + var s2rk_info = bytes().fromstring("Sigma2_Resume") + session.resumption_id + var s2rk_salt = sigma1.initiatorRandom + sigma1.resumptionID + var s2rk = crypto.HKDF_SHA256().derive(session.shared_secret, s2rk_salt, s2rk_info, 16) + + # compute Resume2MIC + var aes = crypto.AES_CCM(s2rk, bytes().fromstring("NCASE_SigmaR2"), bytes(), 0, 16) + var Resume2MIC = aes.tag() + + var sigma2resume = matter.Sigma2Resume() + sigma2resume.resumptionID = session.resumption_id + sigma2resume.responderSessionID = session._future_local_session_id + sigma2resume.sigma2ResumeMIC = Resume2MIC + + # # compute session key, p.178 + var session_keys = crypto.HKDF_SHA256().derive(session.shared_secret #- input key -#, + sigma1.initiatorRandom + sigma1.resumptionID #- salt -#, + bytes().fromstring("SessionResumptionKeys") #- info -#, + 48) + var i2r = session_keys[0..15] + var r2i = session_keys[16..31] + var ac = session_keys[32..47] + var session_timestamp = tasmota.rtc()['utc'] + + tasmota.log("MTR: ******************************", 3) + tasmota.log("MTR: I2RKey =" + i2r.tohex(), 3) + tasmota.log("MTR: R2IKey =" + r2i.tohex(), 3) + tasmota.log("MTR: AC =" + ac.tohex(), 3) + tasmota.log("MTR: ******************************", 3) + + var sigma2resume_raw = sigma2resume.encode() + session._Msg1 = nil + tasmota.log("MTR: sigma2resume_raw: " + sigma2resume_raw.tohex(), 3) + + # now package the response message + var resp = msg.build_response(0x33 #-sigma-2-resume-#, true) + var raw = resp.encode(sigma2resume_raw) + + self.responder.send_response(raw, addr, port, resp.message_counter) + + session.close() + session.set_keys(i2r, r2i, ac, session_timestamp) + session.set_persist(true) # keep session on flash + session.set_no_expiration() # never expire + session.save() + + return true + else + sigma1.resumptionID = nil + # fall through normal sigma1 (non-resumption) + end + end + + if sigma1.resumptionID == nil || sigma1.initiatorResumeMIC == nil + # Compute Sigma2, p.162 + session.resumption_id = crypto.random(16) + self.ResponderEph_priv = crypto.random(32) + self.ResponderEph_pub = crypto.EC_P256().public_key(self.ResponderEph_priv) + var responderRandom = crypto.random(32) + + session.shared_secret = crypto.EC_P256().shared_key(self.ResponderEph_priv, sigma1.initiatorEphPubKey) + + var sigma2_tbsdata = matter.TLV.Matter_TLV_struct() + sigma2_tbsdata.add_TLV(1, matter.TLV.B2, session.get_noc()) + sigma2_tbsdata.add_TLV(2, matter.TLV.B2, session.get_icac()) + sigma2_tbsdata.add_TLV(3, matter.TLV.B2, self.ResponderEph_pub) + sigma2_tbsdata.add_TLV(4, matter.TLV.B2, sigma1.initiatorEphPubKey) + + var TBSData2Signature = crypto.EC_P256().ecdsa_sign_sha256(session.get_pk(), sigma2_tbsdata.encode()) + + var sigma2_tbedata = matter.TLV.Matter_TLV_struct() + sigma2_tbedata.add_TLV(1, matter.TLV.B2, session.get_noc()) + sigma2_tbedata.add_TLV(2, matter.TLV.B2, session.get_icac()) + sigma2_tbedata.add_TLV(3, matter.TLV.B2, TBSData2Signature) + sigma2_tbedata.add_TLV(4, matter.TLV.B2, session.resumption_id) + + # compute TranscriptHash = Crypto_Hash(message = Msg1) + tasmota.log("****************************************", 3) + session._Msg1 = sigma1.Msg1 + tasmota.log("MTR: * MSG1 = " + session._Msg1.tohex(), 3) + var TranscriptHash = crypto.SHA256().update(session._Msg1).out() + + # Compute S2K, p.175 + var s2k_info = bytes().fromstring(self.S2K_Info) + var s2k_salt = session.get_ipk_group_key() + responderRandom + self.ResponderEph_pub + TranscriptHash + + var s2k = crypto.HKDF_SHA256().derive(session.shared_secret, s2k_salt, s2k_info, 16) + tasmota.log("MTR: * SharedSecret = " + session.shared_secret.tohex(), 3) + tasmota.log("MTR: * s2k_salt = " + s2k_salt.tohex(), 3) + tasmota.log("MTR: * s2k = " + s2k.tohex(), 3) + + var sigma2_tbedata_raw = sigma2_tbedata.encode() + # // `AES_CCM.init(secret_key:bytes(16 or 32), iv:bytes(7..13), aad:bytes(), data_len:int, tag_len:int) -> instance` + + var aes = crypto.AES_CCM(s2k, bytes().fromstring(self.TBEData2_Nonce), bytes(), size(sigma2_tbedata_raw), 16) + var TBEData2Encrypted = aes.encrypt(sigma2_tbedata_raw) + aes.tag() + tasmota.log("MTR: * TBEData2Enc = " + TBEData2Encrypted.tohex(), 3) + tasmota.log("****************************************", 3) + + var sigma2 = matter.Sigma2() + sigma2.responderRandom = responderRandom + sigma2.responderSessionId = self.future_local_session_id + sigma2.responderEphPubKey = self.ResponderEph_pub + sigma2.encrypted2 = TBEData2Encrypted + tasmota.log("MTR: sigma2: " + matter.inspect(sigma2), 3) + var sigma2_raw = sigma2.encode() + session._Msg2 = sigma2_raw + tasmota.log("MTR: sigma2_raw: " + sigma2_raw.tohex(), 3) + + # now package the response message + var resp = msg.build_response(0x31 #-sigma-2-#, true) # no reliable flag + var raw = resp.encode(sigma2_raw) + + self.responder.send_response(raw, addr, port, resp.message_counter) + return true + end + + return true + end + + def parse_Sigma3(msg, addr, port) + import crypto + # sanity checks + if msg.opcode != 0x32 || msg.local_session_id != 0 || msg.protocol_id != 0 + raise "protocol_error", "invalid Pake1 message" + end + var session = msg.session + var sigma3 = matter.Sigma3().parse(msg.raw, msg.app_payload_idx) + + tasmota.log("****************************************", 3) + # compute TranscriptHash = Crypto_Hash(message = Msg1 || Msg2) + var TranscriptHash = crypto.SHA256().update(session._Msg1).update(session._Msg2).out() + tasmota.log("MTR: * session = " + str(session), 3) + tasmota.log("MTR: session.ipk_epoch_key " + str(session.ipk_epoch_key), 3) + tasmota.log("MTR: session.fabric_compressed " + str(session.fabric_compressed), 3) + tasmota.log("MTR: * ipk_group_key = " + session.get_ipk_group_key().tohex(), 3) + tasmota.log("MTR: * TranscriptHash= " + TranscriptHash.tohex(), 3) + + var s3k_info = bytes().fromstring(self.S3K_Info) + var s3k = crypto.HKDF_SHA256().derive(session.shared_secret, session.get_ipk_group_key() + TranscriptHash, s3k_info, 16) + + tasmota.log("****************************************", 3) + # self.ipk_epoch_key == nil || self.fabric_compressed") + tasmota.log("MTR: * s3k_salt = " + (session.get_ipk_group_key() + TranscriptHash).tohex(), 3) + tasmota.log("MTR: * s3k = " + s3k.tohex(), 3) + tasmota.log("****************************************", 3) + + # decrypt + var encrypted = sigma3.TBEData3Encrypted[0..-17] + var tag = sigma3.TBEData3Encrypted[-16..] + var ec = crypto.AES_CCM(s3k, bytes().fromstring(self.TBEData3_Nonce), bytes(), size(encrypted), 16) + var TBEData3 = ec.decrypt(encrypted) + var TBETag3 = ec.tag() + tasmota.log("MTR: * TBEData3 = " + TBEData3.tohex(), 3) + tasmota.log("MTR: * TBETag3 = " + TBETag3.tohex(), 3) + tasmota.log("MTR: * tag_sent = " + tag.tohex(), 3) + tasmota.log("****************************************", 3) + + if TBETag3 != tag raise "value_error", "tag do not match" end + + var TBEData3TLV = matter.TLV.parse(TBEData3) + var initiatorNOC = TBEData3TLV.findsubval(1) + var initiatorICAC = TBEData3TLV.findsubval(2) + var ec_signature = TBEData3TLV.findsubval(3) + # Success = Crypto_VerifyChain(certificates = [TBEData3.initiatorNOC, TBEData3.initiatorICAC, TrustedRCAC]), when TBEData3.initiatorICAC is present + # TODO + var initiatorNOCTLV = matter.TLV.parse(initiatorNOC) + tasmota.log("MTR: initiatorNOCTLV = " + str(initiatorNOCTLV), 3) + var initiatorNOCPubKey = initiatorNOCTLV.findsubval(9) + var initiatorNOCListDN = initiatorNOCTLV.findsub(6) + var initiatorFabricId = initiatorNOCListDN.findsubval(17) + if type(initiatorFabricId) == 'int' initiatorFabricId = int64(initiatorFabricId) end + session.peer_node_id = initiatorFabricId.tobytes() + tasmota.log("MTR: initiatorFabricId="+str(session.peer_node_id), 3) + + var sigma3_tbs = matter.TLV.Matter_TLV_struct() + sigma3_tbs.add_TLV(1, matter.TLV.B1, initiatorNOC) + sigma3_tbs.add_TLV(2, matter.TLV.B1, initiatorICAC) + sigma3_tbs.add_TLV(3, matter.TLV.B1, self.initiatorEph_pub) + sigma3_tbs.add_TLV(4, matter.TLV.B1, self.ResponderEph_pub) + var sigma3_tbs_raw = sigma3_tbs.encode() + + tasmota.log("MTR: * initiatorNOCPubKey = " + initiatorNOCPubKey.tohex(), 3) + tasmota.log("MTR: * ec_signature = " + ec_signature.tohex(), 3) + tasmota.log("****************************************", 3) + + # `crypto.EC_P256().ecdsa_verify_sha256(public_key:bytes(65), message:bytes(), hash:bytes()) -> bool` + var sigma3_tbs_valid = crypto.EC_P256().ecdsa_verify_sha256(initiatorNOCPubKey, sigma3_tbs_raw, ec_signature) + + if !sigma3_tbs_valid raise "value_error", "sigma3_tbs does not have a valid signature" end + + # All good, compute new keys + tasmota.log("MTR: Sigma3 verified, computing new keys", 3) + + TranscriptHash = crypto.SHA256().update(session._Msg1).update(session._Msg2).update(sigma3.Msg3).out() + # we can now free _Msg1 and _Msg2 + session._Msg1 = nil + session._Msg2 = nil + + tasmota.log("MTR: ******************************", 3) + tasmota.log("MTR: shared_secret =" + session.shared_secret.tohex(), 3) + tasmota.log("MTR: ipk + hash =" + (session.get_ipk_group_key() + TranscriptHash).tohex(), 3) + # compute session key + var session_keys = crypto.HKDF_SHA256().derive(session.shared_secret #- input key -#, + session.get_ipk_group_key() + TranscriptHash #- salt -#, + bytes().fromstring(self.SEKeys_Info) #- info -#, + 48) + var i2r = session_keys[0..15] + var r2i = session_keys[16..31] + var ac = session_keys[32..47] + var session_timestamp = tasmota.rtc()['utc'] + + tasmota.log("MTR: ******************************", 3) + tasmota.log("MTR: I2RKey =" + i2r.tohex(), 3) + tasmota.log("MTR: R2IKey =" + r2i.tohex(), 3) + tasmota.log("MTR: AC =" + ac.tohex(), 3) + tasmota.log("MTR: ******************************", 3) + + # Send success status report + var resp = msg.build_response(0x40 #-StatusReport-#, true) # reliable flag + + var status_raw = bytes() + status_raw.add(0x00, 2) # GeneralCode = SUCCESS + status_raw.add(0x0000, 4) # ProtocolID = 0 (PROTOCOL_ID_SECURE_CHANNEL) + status_raw.add(0x0000, 4) # ProtocolCode = 0 (SESSION_ESTABLISHMENT_SUCCESS) + + var raw = resp.encode(status_raw) + + self.responder.send_response(raw, addr, port, resp.message_counter) + + session.close() + session.set_keys(i2r, r2i, ac, session_timestamp) + session.set_persist(true) # keep session on flash + session.set_no_expiration() # never expire + session.save() + + return true + end + + ############################################################# + # placeholder, nothing to run for now + def every_second() + end +end +matter.Commisioning_Context = Matter_Commisioning_Context + +#- + +# STEP 1 +PBKDF_PR = matter.PBKDFParamRequest().parse(bytes("15300120D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D662502054C240300280435052501881325022C011818")) +{'passcodeId': 0, 'initiatorRandom': bytes('D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D66'), +'hasPBKDFParameters': 0, 'SLEEPY_IDLE_INTERVAL': 5000, 'SLEEPY_ACTIVE_INTERVAL': 300, 'initiator_session_id': 19461} + + + + + +# ########################################################################################## +PBKDF_PR = matter.PBKDFParamRequest().parse(bytes("15300120D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D662502054C240300280435052501881325022C011818")) +print(matter.inspect(PBKDF_PR)) +{'passcodeId': 0, 'initiatorRandom': bytes('D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D66'), 'hasPBKDFParameters': 0, 'SLEEPY_IDLE_INTERVAL': 5000, 'SLEEPY_ACTIVE_INTERVAL': 300, 'initiator_session_id': 19461} + +var r = matter.PBKDFParamResponse() +r.initiatorRandom = bytes("112233445566778899AABBCCDDEEFF00112233445566778899AABBCCDDEEFF00") +r.responderRandom = bytes("112233445566778899AABBCCDDEEFF00112233445566778899AABBCCDDEEFF00") +r.responderSessionId = 1234 +r.pbkdf_parameters_iterations = 1000 +r.pbkdf_parameters_salt = bytes("deadbeef11223344deadbeef11223344") +r.SLEEPY_IDLE_INTERVAL = 100 +r.SLEEPY_ACTIVE_INTERVAL = 200 + +bytes('15300120112233445566778899AABBCCDDEEFF00112233445566778899AABBCCDDEEFF00300220112233445566778899AABBCCDDEEFF00112233445566778899AABBCCDDEEFF002503D20418') + + +# ########################################################################################## +var m = matter.Frame() +m.decode(bytes("0400000006747A09347BFD880AC8128005205FC3000015300120D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D662502054C240300280435052501881325022C011818")) + +# 'opcode': 32 +# 'local_session_id': 0 +# 'protocol_id': 0 + +#{'dest_node_id_8': nil, 'flag_dsiz': 0, 'x_flag_r': 1, 'sec_c': 0, 'app_payload_idx': 22, 'sec_flags': 0, +#'dest_node_id_2': nil, 'x_flag_sx': 0, 'sec_p': 0, 'message_counter': 159020038, 'x_flag_v': 0, 'flags': 4, +#'vendor_id': nil, 'x_flag_i': 1, 'source_node_id': bytes('347BFD880AC81280'), +#'ack_message_counter': nil, 'raw': bytes('0400000006747A09347BFD880AC8128005205FC3000015300120D2DAEE8760C9...'), +#'exchange_id': 50015, 'opcode': 32, 'local_session_id': 0, 'x_flag_a': 0, 'flag_s': 1, 'x_flags': 5, 'sec_sesstype': 0, +#'sec_extensions': nil, 'sec_mx': 0, 'protocol_id': 0} + +0400000006747A09347BFD880AC8128005205FC3000015300120D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D662502054C240300280435052501881325022C011818 + +12:09:05.561 MTR: sending packet to '192.168.2.109:5540' 050000000674C82B96B90B530000347BFD880AC8128000215FC3000015300120D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D66300220AA981992DB666B51DEDC0DD67ED6ABBB29AB30E67452C8893166FBF5FD95601D2503010018 + +050000000674C82B96B90B530000347BFD880AC8128000215FC3000015300120D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D66300220AA981992DB666B51DEDC0DD67ED6ABBB29AB30E67452C8893166FBF5FD95601D2503010018 +12:10:29.174 MTR: received message { + 'flag_s': 1, 'flag_dsiz': 1, 'x_flag_r': 1, 'x_flag_sx': 1, 'sec_mx': 0, 'sec_flags': 0, + 'dest_node_id_2': nil, 'sec_sesstype': 0, 'local_session_id': 0, 'ack_message_counter': -2014389550, + 'x_flag_v': 1, 'flags': 5, 'vendor_id': 8193, 'x_flag_i': 1, 'source_node_id': bytes('96B90B530000347B'), + 'app_payload_idx': 51590, + 'raw': bytes('050000000674C82B96B90B530000347BFD880AC8128000215FC3000015300120...'), + 'exchange_id': 0, 'opcode': 195, 'message_counter': 734557190, 'sec_p': 0, 'sec_c': 0, + 'protocol_id': 12309, 'dest_node_id_8': bytes('FD880AC812800021'), + 'sec_extensions': nil, 'x_flag_a': 1, 'x_flags': 95} + +347BFD880AC81280 + +fe80::1bf1:bd1a:c5ff:818a +b8:27:eb:8b:d2:59 + +{'mac': 'C8:2B:96:B9:0B:53', 'ip6local': 'fe80::ca2b:96ff:feb9:b53', 'ip': '192.168.1.116'} + +-# diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Commissioning_Data.be b/lib/libesp32/berry_matter/src/embedded/Matter_Commissioning_Data.be new file mode 100644 index 000000000..9aca4927c --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Commissioning_Data.be @@ -0,0 +1,317 @@ +# +# Matter_Commissioning_Data.be - suppport for Matter Commissioning messages structure +# +# 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 + +#@ solidify:Matter_PBKDFParamRequest,weak +#@ solidify:Matter_PBKDFParamResponse,weak +#@ solidify:Matter_Pake1,weak +#@ solidify:Matter_Pake2,weak +#@ solidify:Matter_Pake3,weak +#@ solidify:Matter_Sigma1,weak +#@ solidify:Matter_Sigma2,weak +#@ solidify:Matter_Sigma2Resume,weak +#@ solidify:Matter_Sigma3,weak + +################################################################################# +# class PBKDFParamRequest encaspulating pbkdfparamreq-struct (p. 151) +################################################################################# +class Matter_PBKDFParamRequest + var initiatorRandom + var initiator_session_id + var passcodeId + var hasPBKDFParameters + var SLEEPY_IDLE_INTERVAL + var SLEEPY_ACTIVE_INTERVAL + + def parse(b, idx) + if idx == nil idx = 0 end + var val = matter.TLV.parse(b, idx) + + self.initiatorRandom = val.getsubval(1) + self.initiator_session_id = val.getsubval(2) + self.passcodeId = val.getsubval(3) + self.hasPBKDFParameters = val.getsubval(4) + var initiatorSEDParams = val.findsub(5) + if initiatorSEDParams != nil + self.SLEEPY_IDLE_INTERVAL = initiatorSEDParams.findsubval(1) + self.SLEEPY_ACTIVE_INTERVAL = initiatorSEDParams.findsubval(2) + end + return self + end +end +matter.PBKDFParamRequest = Matter_PBKDFParamRequest + +################################################################################# +# class PBKDFParamResponse encaspulating pbkdfparamresp-struct (p. 153) +################################################################################# +class Matter_PBKDFParamResponse + var initiatorRandom + var responderRandom + var responderSessionId + var pbkdf_parameters_iterations + var pbkdf_parameters_salt + var SLEEPY_IDLE_INTERVAL + var SLEEPY_ACTIVE_INTERVAL + + def encode(b) + var s = matter.TLV.Matter_TLV_struct() + # initiatorRandom + s.add_TLV(1, matter.TLV.B1, self.initiatorRandom) + s.add_TLV(2, matter.TLV.B1, self.responderRandom) + s.add_TLV(3, matter.TLV.U2, self.responderSessionId) + var s_pbkdf = s.add_struct(4) + s_pbkdf.add_TLV(1, matter.TLV.U4, self.pbkdf_parameters_iterations) + s_pbkdf.add_TLV(2, matter.TLV.B1, self.pbkdf_parameters_salt) + if self.SLEEPY_IDLE_INTERVAL != nil || self.SLEEPY_ACTIVE_INTERVAL != nil + var s2 = s.add_struct(5) + s2.add_TLV(1, matter.TLV.U4, self.SLEEPY_IDLE_INTERVAL) + s2.add_TLV(2, matter.TLV.U4, self.SLEEPY_ACTIVE_INTERVAL) + end + return s.encode() + end +end +matter.PBKDFParamResponse = Matter_PBKDFParamResponse + +################################################################################# +# class Pake1 +################################################################################# +class Matter_Pake1 + var pA + + def parse(b, idx) + if idx == nil idx = 0 end + var val = matter.TLV.parse(b, idx) + tasmota.log("MTR: parsed TLV: " + str(val), 3) + + self.pA = val.getsubval(1) + return self + end +end +matter.Pake1 = Matter_Pake1 + +################################################################################# +# class Pake1 +################################################################################# +class Matter_Pake2 + var pB # 65 bytes + var cB # 32 bytes + + def encode(b) + var s = matter.TLV.Matter_TLV_struct() + # + s.add_TLV(1, matter.TLV.B1, self.pB) + s.add_TLV(2, matter.TLV.B1, self.cB) + return s.encode() + end +end +matter.Pake2 = Matter_Pake2 + +# class Pake3 +class Matter_Pake3 + var cA + + def parse(b, idx) + if idx == nil idx = 0 end + var val = matter.TLV.parse(b, idx) + tasmota.log("MTR: parsed TLV: " + str(val), 3) + + self.cA = val.getsubval(1) + return self + end +end +matter.Pake3 = Matter_Pake3 + +################################################################################# +# class Sigma1, p.160 +################################################################################# +class Matter_Sigma1 + var initiatorRandom # bytes(32) + var initiator_session_id # U16 + var destinationId # bytes(32) + var initiatorEphPubKey # bytes(65) + # var initiatorSEDParams # (opt) sed-parameter-struct + var SLEEPY_IDLE_INTERVAL + var SLEEPY_ACTIVE_INTERVAL + var resumptionID # (opt) bytes(16) + var initiatorResumeMIC # (opt) bytes(16) + var Msg1 + + def parse(b, idx) + if idx == nil idx = 0 end + var val = matter.TLV.parse(b, idx) + self.Msg1 = b[idx..] + tasmota.log("MTR: Sigma1 TLV=" + str(val), 3) + + self.initiatorRandom = val.getsubval(1) + self.initiator_session_id = val.getsubval(2) + self.destinationId = val.getsubval(3) + self.initiatorEphPubKey = val.getsubval(4) + var initiatorSEDParams = val.findsub(5) + if initiatorSEDParams != nil + self.SLEEPY_IDLE_INTERVAL = initiatorSEDParams.findsubval(1) + self.SLEEPY_ACTIVE_INTERVAL = initiatorSEDParams.findsubval(2) + end + var resumptionID = val.findsub(6) + var initiatorResumeMIC = val.findsub(7) + return self + end +end +matter.Sigma1 = Matter_Sigma1 + +################################################################################# +# class Sigma2 +################################################################################# +class Matter_Sigma2 + var responderRandom # bytes(32) + var responderSessionId # U16 + var responderEphPubKey # bytes(65) + var encrypted2 # bytes() + var SLEEPY_IDLE_INTERVAL + var SLEEPY_ACTIVE_INTERVAL + + def encode(b) + var s = matter.TLV.Matter_TLV_struct() + # initiatorRandom + s.add_TLV(1, matter.TLV.B1, self.responderRandom) + s.add_TLV(2, matter.TLV.U2, self.responderSessionId) + s.add_TLV(3, matter.TLV.B1, self.responderEphPubKey) + s.add_TLV(4, matter.TLV.B1, self.encrypted2) + if self.SLEEPY_IDLE_INTERVAL != nil || self.SLEEPY_ACTIVE_INTERVAL != nil + var s2 = s.add_struct(5) + s2.add_TLV(1, matter.TLV.U4, self.SLEEPY_IDLE_INTERVAL) + s2.add_TLV(2, matter.TLV.U4, self.SLEEPY_ACTIVE_INTERVAL) + end + return s.encode() + end +end +matter.Sigma2 = Matter_Sigma2 + +################################################################################# +# class Sigma2Resume, p.170 +################################################################################# +class Matter_Sigma2Resume + var resumptionID # bytes(16) + var sigma2ResumeMIC # bytes(16) + var responderSessionID # u16 + var SLEEPY_IDLE_INTERVAL + var SLEEPY_ACTIVE_INTERVAL + + def encode(b) + var s = matter.TLV.Matter_TLV_struct() + # initiatorRandom + s.add_TLV(1, matter.TLV.B1, self.resumptionID) + s.add_TLV(2, matter.TLV.B1, self.sigma2ResumeMIC) + s.add_TLV(3, matter.TLV.B1, self.responderSessionID) + if self.SLEEPY_IDLE_INTERVAL != nil || self.SLEEPY_ACTIVE_INTERVAL != nil + var s2 = s.add_struct(4) + s2.add_TLV(1, matter.TLV.U4, self.SLEEPY_IDLE_INTERVAL) + s2.add_TLV(2, matter.TLV.U4, self.SLEEPY_ACTIVE_INTERVAL) + end + return s.encode() + end +end +matter.Sigma2Resume = Matter_Sigma2Resume + +################################################################################# +# class Sigma3, p.160 +################################################################################# +class Matter_Sigma3 + var TBEData3Encrypted # bytes() + var Msg3 + + def parse(b, idx) + if idx == nil idx = 0 end + var val = matter.TLV.parse(b, idx) + self.Msg3 = b[idx..] + tasmota.log("MTR: Sigma3 TLV=" + str(val), 3) + + self.TBEData3Encrypted = val.getsubval(1) + return self + end +end +matter.Sigma3 = Matter_Sigma3 + + +#- + +# STEP 1 +PBKDF_PR = matter.PBKDFParamRequest().parse(bytes("15300120D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D662502054C240300280435052501881325022C011818")) +{'passcodeId': 0, 'initiatorRandom': bytes('D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D66'), +'hasPBKDFParameters': 0, 'SLEEPY_IDLE_INTERVAL': 5000, 'SLEEPY_ACTIVE_INTERVAL': 300, 'initiator_session_id': 19461} + + + + + +# ########################################################################################## +PBKDF_PR = matter.PBKDFParamRequest().parse(bytes("15300120D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D662502054C240300280435052501881325022C011818")) +print(matter.inspect(PBKDF_PR)) +{'passcodeId': 0, 'initiatorRandom': bytes('D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D66'), 'hasPBKDFParameters': 0, 'SLEEPY_IDLE_INTERVAL': 5000, 'SLEEPY_ACTIVE_INTERVAL': 300, 'initiator_session_id': 19461} + +var r = matter.PBKDFParamResponse() +r.initiatorRandom = bytes("112233445566778899AABBCCDDEEFF00112233445566778899AABBCCDDEEFF00") +r.responderRandom = bytes("112233445566778899AABBCCDDEEFF00112233445566778899AABBCCDDEEFF00") +r.responderSessionId = 1234 +r.pbkdf_parameters_iterations = 1000 +r.pbkdf_parameters_salt = bytes("deadbeef11223344deadbeef11223344") +r.SLEEPY_IDLE_INTERVAL = 100 +r.SLEEPY_ACTIVE_INTERVAL = 200 + +bytes('15300120112233445566778899AABBCCDDEEFF00112233445566778899AABBCCDDEEFF00300220112233445566778899AABBCCDDEEFF00112233445566778899AABBCCDDEEFF002503D20418') + + +# ########################################################################################## +var m = matter.Frame() +m.decode(bytes("0400000006747A09347BFD880AC8128005205FC3000015300120D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D662502054C240300280435052501881325022C011818")) + +# 'opcode': 32 +# 'local_session_id': 0 +# 'protocol_id': 0 + +#{'dest_node_id_8': nil, 'flag_dsiz': 0, 'x_flag_r': 1, 'sec_c': 0, 'app_payload_idx': 22, 'sec_flags': 0, +#'dest_node_id_2': nil, 'x_flag_sx': 0, 'sec_p': 0, 'message_counter': 159020038, 'x_flag_v': 0, 'flags': 4, +#'vendor_id': nil, 'x_flag_i': 1, 'source_node_id': bytes('347BFD880AC81280'), +#'ack_message_counter': nil, 'raw': bytes('0400000006747A09347BFD880AC8128005205FC3000015300120D2DAEE8760C9...'), +#'exchange_id': 50015, 'opcode': 32, 'local_session_id': 0, 'x_flag_a': 0, 'flag_s': 1, 'x_flags': 5, 'sec_sesstype': 0, +#'sec_extensions': nil, 'sec_mx': 0, 'protocol_id': 0} + +0400000006747A09347BFD880AC8128005205FC3000015300120D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D662502054C240300280435052501881325022C011818 + +12:09:05.561 MTR: sending packet to '192.168.2.109:5540' 050000000674C82B96B90B530000347BFD880AC8128000215FC3000015300120D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D66300220AA981992DB666B51DEDC0DD67ED6ABBB29AB30E67452C8893166FBF5FD95601D2503010018 + +050000000674C82B96B90B530000347BFD880AC8128000215FC3000015300120D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D66300220AA981992DB666B51DEDC0DD67ED6ABBB29AB30E67452C8893166FBF5FD95601D2503010018 +12:10:29.174 MTR: received message { + 'flag_s': 1, 'flag_dsiz': 1, 'x_flag_r': 1, 'x_flag_sx': 1, 'sec_mx': 0, 'sec_flags': 0, + 'dest_node_id_2': nil, 'sec_sesstype': 0, 'local_session_id': 0, 'ack_message_counter': -2014389550, + 'x_flag_v': 1, 'flags': 5, 'vendor_id': 8193, 'x_flag_i': 1, 'source_node_id': bytes('96B90B530000347B'), + 'app_payload_idx': 51590, + 'raw': bytes('050000000674C82B96B90B530000347BFD880AC8128000215FC3000015300120...'), + 'exchange_id': 0, 'opcode': 195, 'message_counter': 734557190, 'sec_p': 0, 'sec_c': 0, + 'protocol_id': 12309, 'dest_node_id_8': bytes('FD880AC812800021'), + 'sec_extensions': nil, 'x_flag_a': 1, 'x_flags': 95} + +347BFD880AC81280 + +fe80::1bf1:bd1a:c5ff:818a +b8:27:eb:8b:d2:59 + +{'mac': 'C8:2B:96:B9:0B:53', 'ip6local': 'fe80::ca2b:96ff:feb9:b53', 'ip': '192.168.1.116'} + +-# diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Device.be b/lib/libesp32/berry_matter/src/embedded/Matter_Device.be new file mode 100644 index 000000000..96463cac2 --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Device.be @@ -0,0 +1,508 @@ +# +# Matter_Device.be - implements a generic Matter device (commissionee) +# +# 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 . +# + +#@ solidify:Matter_Device,weak + +class Matter_Device + static var UDP_PORT = 5540 # this is the default port for group multicast, we also use it for unicast + static var PASSCODE_DEFAULT = 20202021 + static var PBKDF_ITERATIONS = 1000 # I don't see any reason to choose a different number + static var VENDOR_ID = 0xFFF1 + static var PRODUCT_ID = 0x8000 + static var FILENAME = "_matter_device.json" + var plugins # list of plugins + var udp_server # `matter.UDPServer()` object + var msg_handler # `matter.MessageHandler()` object + var sessions # `matter.Session_Store()` objet + var ui + # information about the device + var commissioning_instance_wifi # random instance name for commissioning + var commissioning_instance_eth # random instance name for commissioning + var hostname_wifi # MAC-derived hostname for commissioning + var hostname_eth # MAC-derived hostname for commissioning + var vendorid + var productid + var discriminator + # context for PBKDF + var passcode + var iterations + # PBKDF information used only during PASE (freed afterwards) + var salt + var w0, w1, L + + ############################################################# + def init() + import crypto + import string + if !tasmota.get_option(matter.MATTER_OPTION) + matter.UI(self) # minimal UI + return + end # abort if SetOption 151 is not set + + self.plugins = [] + self.vendorid = self.VENDOR_ID + self.productid = self.PRODUCT_ID + self.iterations = self.PBKDF_ITERATIONS + self.load_param() + self.commissioning_instance_wifi = crypto.random(8).tohex() # 16 characters random hostname + self.commissioning_instance_eth = crypto.random(8).tohex() # 16 characters random hostname + + self.sessions = matter.Session_Store() + self.sessions.load() + self.msg_handler = matter.MessageHandler(self) + self.ui = matter.UI(self) + + # add the default plugin + self.plugins.push(matter.Plugin_core(self)) + + self.start_mdns_announce_hostnames() + + if tasmota.wifi()['up'] + self.start_udp(self.UDP_PORT) + else + tasmota.add_rule("Wifi#Connected", def () + self.start_udp(self.UDP_PORT) + tasmota.remove_rule("Wifi#Connected", "matter_device_udp") + + end, self) + end + + if tasmota.eth()['up'] + self.start_udp(self.UDP_PORT) + else + tasmota.add_rule("Eth#Connected", def () + self.start_udp(self.UDP_PORT) + tasmota.remove_rule("Eth#Connected", "matter_device_udp") + end, self) + end + + self.start_basic_commissioning() + + tasmota.add_driver(self) + end + + ############################################################# + # Start Basic Commissioning Window + def start_basic_commissioning() + # compute PBKDF + self.compute_pbkdf(self.passcode) + end + + def finish_commissioning() + end + + ############################################################# + # Compute the PBKDF parameters for SPAKE2+ + # + # iterations is set to 1000 which is large enough + def compute_pbkdf(passcode_int) + import crypto + self.salt = crypto.random(16) # bytes("5350414B453250204B65792053616C74") + var passcode = bytes().add(passcode_int, 4) + + var tv = crypto.PBKDF2_HMAC_SHA256().derive(passcode, self.salt, self.iterations, 80) + var w0s = tv[0..39] + var w1s = tv[40..79] + + self.w0 = crypto.EC_P256().mod(w0s) + self.w1 = crypto.EC_P256().mod(w1s) + self.L = crypto.EC_P256().public_key(self.w1) + + tasmota.log("MTR: ******************************", 3) + tasmota.log("MTR: salt = " + self.salt.tohex(), 3) + tasmota.log("MTR: passcode = " + passcode.tohex(), 3) + tasmota.log("MTR: w0 = " + self.w0.tohex(), 3) + tasmota.log("MTR: w1 = " + self.w1.tohex(), 3) + tasmota.log("MTR: L = " + self.L.tohex(), 3) + tasmota.log("MTR: ******************************", 3) + end + + ############################################################# + # compute QR Code content + def compute_qrcode_content() + var raw = bytes().resize(11) # we don't use TLV Data so it's only 88 bits or 11 bytes + # version is `000` dont touch + raw.setbits(3, 16, self.vendorid) + raw.setbits(19, 16, self.productid) + # custom flow = 0 (offset=35, len=2) + raw.setbits(37, 8, 0x04) # already on IP network + raw.setbits(45, 12, self.discriminator & 0xFFF) + raw.setbits(57, 27, self.passcode & 0x7FFFFFF) + # padding (offset=84 len=4) + return "MT:" + matter.Base38.encode(raw) + end + + + ############################################################# + # compute the 11 digits manual pairing code (wihout vendorid nor productid) p.223 + def compute_manual_pairing_code() + import string + var digit_1 = (self.discriminator & 0x0FFF) >> 10 + var digit_2_6 = ((self.discriminator & 0x0300) << 6) | (self.passcode & 0x3FFF) + var digit_7_10 = (self.passcode >> 14) + + var ret = string.format("%1i%05i%04i", digit_1, digit_2_6, digit_7_10) + ret += matter.Verhoeff.checksum(ret) + return ret + end + + ############################################################# + # dispatch every second click to sub-objects that need it + def every_second() + self.sessions.every_second() + self.msg_handler.every_second() + end + + ############################################################# + def stop() + if self.udp_server self.udp_server.stop() end + end + + ############################################################# + # callback when message is received + def msg_received(raw, addr, port) + return self.msg_handler.msg_received(raw, addr, port) + end + + def msg_send(raw, addr, port, id) + return self.udp_server.send_response(raw, addr, port, id) + end + + def packet_ack(id) + return self.udp_server.packet_ack(id) + end + + ############################################################# + # Start UDP Server + def start_udp(port) + if self.udp_server return end # already started + if port == nil port = 5540 end + tasmota.log("MTR: starting UDP server on port: " + str(port), 2) + self.udp_server = matter.UDPServer("", port) + self.udp_server.start(/ raw, addr, port -> self.msg_received(raw, addr, port)) + end + + ############################################################# + # start_operational_dicovery + # + # Pass control to `device` + def start_operational_dicovery_deferred(session) + # defer to next click + tasmota.set_timer(0, /-> self.start_operational_dicovery(session)) + end + + ############################################################# + def start_commissioning_complete_deferred(session) + # defer to next click + tasmota.set_timer(0, /-> self.start_commissioning_complete(session)) + end + + ############################################################# + # Start UDP mDNS announcements for commissioning + # + # eth is `true` if ethernet turned up, `false` is wifi turned up + # def mdns_announce_commissioning() + # var services = { + # "VP":str(self.vendorid) + "+" + str(self.productid), + # "D": self.discriminator, + # "CM":1, # requires passcode + # "T":0, # no support for TCP + # "SII":5000, "SAI":300 + # } + + # if self.self.hostname_eth + # mdns.add_service("_matterc","_udp", 5540, services, self.commissioning_instance_eth, self.hostname_eth) + # end + # if self.self.hostname_wifi + # mdns.add_service("_matter","_tcp", 5540, services, self.commissioning_instance_wifi, self.hostname_wifi) + # end + # end + + ############################################################# + # Start Operational Discovery + def start_operational_dicovery(session) + import crypto + import mdns + import string + + # clear any PBKDF information to free memory + self.salt = nil + self.w0 = nil + self.w1 = nil + self.L = nil + + # save session as persistant + session.set_no_expiration() + session.set_persist(true) + # close the PASE session, it will be re-opened with a CASE session + session.close() + self.sessions.save() + + self.mdns_announce_op_discovery(session) + end + + ############################################################# + # Commissioning Complete + # + def start_commissioning_complete(session) + tasmota.log("MTR: *** Commissioning complete ***", 2) + end + + ############################################################# + # read an attribute + # + def read_attribute(msg, endpoint, cluster, attribute) + var idx = 0 + while idx < size(self.plugins) + var plugin = self.plugins[idx] + + var ret = plugin.read_attribute(msg, endpoint, cluster, attribute) + if ret != nil + return ret + end + + idx += 1 + end + end + + + + ############################################################# + # Persistance of Matter Device parameters + # + ############################################################# + # + def save_param() + import json + var j = json.dump({'distinguish':self.discriminator, 'passcode':self.passcode}) + try + import string + var f = open(self.FILENAME, "w") + f.write(j) + f.close() + return j + except .. as e, m + tasmota.log("MTR: Session_Store::save Exception:" + str(e) + "|" + str(m), 2) + return j + end + end + + ############################################################# + def load_param() + import string + import crypto + try + + var f = open(self.FILENAME) + var s = f.read() + f.close() + + import json + var j = json.load(s) + + self.discriminator = j.find("distinguish") + self.passcode = j.find("passcode") + except .. as e, m + if e != "io_error" + tasmota.log("MTR: Session_Store::load Exception:" + str(e) + "|" + str(m), 2) + end + end + + var dirty = false + if self.discriminator == nil + self.discriminator = crypto.random(2).get(0,2) & 0xFFF + dirty = true + end + if self.passcode == nil + self.passcode = self.PASSCODE_DEFAULT + dirty = true + end + if dirty self.save_param() end + end + + + ############################################################# + # Matter plugin management + # + # Plugins allow to specify response to read/write attributes + # and command invokes + ############################################################# + def invoke_request(msg, val, ctx) + var idx = 0 + while idx < size(self.plugins) + var plugin = self.plugins[idx] + + var ret = plugin.invoke_request(msg, val, ctx) + if ret != nil || ctx.status != matter.UNSUPPORTED_COMMAND # default value + return ret + end + + idx += 1 + end + end + + ############################################################# + # MDNS Configuration + ############################################################# + # Start MDNS and announce hostnames for Wifi and ETH from MAC + # + # When the announce is active, `hostname_wifi` and `hostname_eth` + # are defined + def start_mdns_announce_hostnames() + if tasmota.wifi()['up'] + self._start_mdns_announce(false) + else + tasmota.add_rule("Wifi#Connected", def () + self._start_mdns_announce(false) + tasmota.remove_rule("Wifi#Connected", "matter_device_mdns") + end, self) + end + + if tasmota.eth()['up'] + self._start_mdns_announce(true) + else + tasmota.add_rule("Eth#Connected", def () + self._start_mdns_announce(true) + tasmota.remove_rule("Eth#Connected", "matter_device_mdns") + end, self) + end + end + + ############################################################# + # Start UDP mDNS announcements for commissioning + # + # eth is `true` if ethernet turned up, `false` is wifi turned up + def _start_mdns_announce(is_eth) + import mdns + import string + + mdns.start() + + var services = { + "VP":str(self.vendorid) + "+" + str(self.productid), + "D": self.discriminator, + "CM":1, # requires passcode + "T":0, # no support for TCP + "SII":5000, "SAI":300 + } + + # mdns + try + if is_eth + var eth = tasmota.eth() + self.hostname_eth = string.replace(eth.find("mac"), ':', '') + mdns.add_hostname(self.hostname_eth, eth.find('ip6local',''), eth.find('ip',''), eth.find('ip6','')) + mdns.add_service("_matterc", "_udp", 5540, services, self.commissioning_instance_eth, self.hostname_eth) + + tasmota.log(string.format("MTR: starting mDNS on %s '%s' ptr to `%s.local`", is_eth ? "eth" : "wifi", + is_eth ? self.commissioning_instance_eth : self.commissioning_instance_wifi, + is_eth ? self.hostname_eth : self.hostname_wifi), 2) + + # `mdns.add_subtype(service:string, proto:string, instance:string, hostname:string, subtype:string) -> nil` + var subtype = "_L" + str(self.discriminator & 0xFFF) + tasmota.log("MTR: adding subtype: "+subtype, 3) + mdns.add_subtype("_matterc", "_udp", self.commissioning_instance_eth, self.hostname_eth, subtype) + subtype = "_S" + str((self.discriminator & 0xF00) >> 8) + tasmota.log("MTR: adding subtype: "+subtype, 3) + mdns.add_subtype("_matterc", "_udp", self.commissioning_instance_eth, self.hostname_eth, subtype) + subtype = "_V" + str(self.vendorid) + tasmota.log("MTR: adding subtype: "+subtype, 3) + mdns.add_subtype("_matterc", "_udp", self.commissioning_instance_eth, self.hostname_eth, subtype) + subtype = "_CM1" + tasmota.log("MTR: adding subtype: "+subtype, 3) + mdns.add_subtype("_matterc", "_udp", self.commissioning_instance_eth, self.hostname_eth, subtype) + else + var wifi = tasmota.wifi() + self.hostname_wifi = string.replace(wifi.find("mac"), ':', '') + mdns.add_hostname(self.hostname_wifi, wifi.find('ip6local',''), wifi.find('ip',''), wifi.find('ip6','')) + mdns.add_service("_matter", "_tcp", 5540, services, self.commissioning_instance_wifi, self.hostname_wifi) + + tasmota.log(string.format("MTR: starting mDNS on %s '%s' ptr to `%s.local`", is_eth ? "eth" : "wifi", + is_eth ? self.commissioning_instance_eth : self.commissioning_instance_wifi, + is_eth ? self.hostname_eth : self.hostname_wifi), 2) + + # `mdns.add_subtype(service:string, proto:string, instance:string, hostname:string, subtype:string) -> nil` + var subtype = "_L" + str(self.discriminator & 0xFFF) + tasmota.log("MTR: adding subtype: "+subtype, 3) + mdns.add_subtype("_matterc", "_udp", self.commissioning_instance_wifi, self.hostname_wifi, subtype) + subtype = "_S" + str((self.discriminator & 0xF00) >> 8) + tasmota.log("MTR: adding subtype: "+subtype, 3) + mdns.add_subtype("_matterc", "_udp", self.commissioning_instance_wifi, self.hostname_wifi, subtype) + subtype = "_V" + str(self.vendorid) + tasmota.log("MTR: adding subtype: "+subtype, 3) + mdns.add_subtype("_matterc", "_udp", self.commissioning_instance_wifi, self.hostname_wifi, subtype) + subtype = "_CM1" + tasmota.log("MTR: adding subtype: "+subtype, 3) + mdns.add_subtype("_matterc", "_udp", self.commissioning_instance_wifi, self.hostname_wifi, subtype) + end + except .. as e, m + tasmota.log("MTR: Exception" + str(e) + "|" + str(m), 2) + end + + self.mdns_announce_op_discovery_all_sessions() + end + + ############################################################# + # Start UDP mDNS announcements for commissioning for all persisted sessions + def mdns_announce_op_discovery_all_sessions() + for session: self.sessions.sessions + if session.get_deviceid() && session.get_fabric() + self.mdns_announce_op_discovery(session) + end + end + end + + ############################################################# + # Start UDP mDNS announcements for commissioning + def mdns_announce_op_discovery(session) + import mdns + import string + try + var device_id = session.get_deviceid().copy().reverse() + var k_fabric = session.get_fabric_compressed() + var op_node = k_fabric.tohex() + "-" + device_id.tohex() + tasmota.log("MTR: Operational Discovery node = " + op_node, 2) + + # mdns + if (tasmota.eth().find("up")) + tasmota.log(string.format("MTR: adding mDNS on %s '%s' ptr to `%s.local`", "eth", op_node, self.hostname_eth), 3) + mdns.add_service("_matter","_tcp", 5540, nil, op_node, self.hostname_eth) + var subtype = "_I" + k_fabric.tohex() + tasmota.log("MTR: adding subtype: "+subtype, 3) + mdns.add_subtype("_matter", "_tcp", op_node, self.hostname_eth, subtype) + end + if (tasmota.wifi().find("up")) + tasmota.log(string.format("MTR: adding mDNS on %s '%s' ptr to `%s.local`", "wifi", op_node, self.hostname_wifi), 3) + mdns.add_service("_matter","_tcp", 5540, nil, op_node, self.hostname_wifi) + var subtype = "_I" + k_fabric.tohex() + tasmota.log("MTR: adding subtype: "+subtype, 3) + mdns.add_subtype("_matter", "_tcp", op_node, self.hostname_wifi, subtype) + end + except .. as e, m + tasmota.log("MTR: Exception" + str(e) + "|" + str(m), 2) + end + end +end +matter.Device = Matter_Device + +#- +import global +global.matter_device = matter_device() +return matter_device +-# diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_IM.be b/lib/libesp32/berry_matter/src/embedded/Matter_IM.be new file mode 100644 index 000000000..35fdb74d7 --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_IM.be @@ -0,0 +1,326 @@ +# +# Matter_IM.be - suppport for Matter Interaction Model +# +# 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 + +#@ solidify:Matter_Response_container,weak +#@ solidify:Matter_IM,weak + +################################################################################# +# Matter_Response_container +# +# Used to store all the elements of the reponse to an attribute or command +################################################################################# +class Matter_Response_container + var endpoint + var cluster + var attribute + var command + var status +end +matter.Response_container = Matter_Response_container + +################################################################################# +# Matter_IM class +################################################################################# +class Matter_IM + var responder + + def init(responder) + self.responder = responder + end + + def process_incoming(msg, remote_ip, remote_port) + # messages are always TLV, decode payload + tasmota.log("MTR: received IM message " + matter.inspect(msg), 3) + + var val = matter.TLV.parse(msg.raw, msg.app_payload_idx) + + tasmota.log("MTR: IM TLV: " + str(val), 3) + + var InteractionModelRevision = val.findsubval(0xFF) + tasmota.log("MTR: InteractionModelRevision=" + (InteractionModelRevision != nil ? str(InteractionModelRevision) : "nil"), 3) + + var opcode = msg.opcode + if opcode == 0x01 # Status Response + return self.process_status_response(msg, val, remote_ip, remote_port) + elif opcode == 0x02 # Read Request + return self.process_read_request(msg, val, remote_ip, remote_port) + elif opcode == 0x03 # Subscribe Request + return self.subscribe_request(msg, val, remote_ip, remote_port) + elif opcode == 0x04 # Subscribe Response + return self.subscribe_response(msg, val, remote_ip, remote_port) + elif opcode == 0x05 # Report Data + return self.report_data(msg, val, remote_ip, remote_port) + elif opcode == 0x06 # Write Request + return self.process_write_request(msg, val, remote_ip, remote_port) + elif opcode == 0x07 # Write Response + return self.process_write_response(msg, val, remote_ip, remote_port) + elif opcode == 0x08 # Invoke Request + return self.process_invoke_request(msg, val, remote_ip, remote_port) + elif opcode == 0x09 # Invoke Response + return self.process_invoke_response(msg, val, remote_ip, remote_port) + elif opcode == 0x0A # Timed Request + return self.process_timed_request(msg, val, remote_ip, remote_port) + end + + return false + end + + ############################################################# + # process IM 0x01 Status Response + # + # val is the TLV structure + # returns `true` if processed, `false` if silently ignored, + # or raises an exception + def process_status_response(msg, val, remote_ip, remote_port) + import string + var status = val.findsubval(0, 0xFF) + tasmota.log(string.format("MTR: Status Response = 0x%02X", status), 3) + return true + end + + ############################################################# + # process IM 0x02 Read Request + # + # val is the TLV structure + # returns `true` if processed, `false` if silently ignored, + # or raises an exception + def process_read_request(msg, val, remote_ip, remote_port) + # structure is `ReadRequestMessage` 10.6.2 p.558 + tasmota.log("MTR: IM:read_request processing start", 3) + + var query = matter.ReadRequestMessage().from_TLV(val) + if query.attributes_requests != nil + # prepare the response + var ret = matter.ReportDataMessage() + ret.suppress_response = true + ret.attribute_reports = [] + + # TODO - we need to implement Concrete path expansion here + + for q:query.attributes_requests + var attr_name = matter.get_attribute_name(q.cluster, q.attribute) + tasmota.log("MTR: Read Attribute " + str(q) + (attr_name ? " (" + attr_name + ")" : ""), 2) + var res = self.responder.device.read_attribute(msg, q.endpoint, q.cluster, q.attribute) + if res != nil + var a1 = matter.AttributeReportIB() + # a1.attribute_status = matter.AttributeStatusIB() + # a1.attribute_status.path = matter.AttributePathIB() + # a1.attribute_status.status = matter.StatusIB() + # a1.attribute_status.path.endpoint = 0 + # a1.attribute_status.path.cluster = q.cluster + # a1.attribute_status.path.attribute = q.attribute + # a1.attribute_status.status.status = matter.SUCCESS + a1.attribute_data = matter.AttributeDataIB() + a1.attribute_data.data_version = 1 + a1.attribute_data.path = matter.AttributePathIB() + a1.attribute_data.path.endpoint = 0 + a1.attribute_data.path.cluster = q.cluster + a1.attribute_data.path.attribute = q.attribute + a1.attribute_data.data = res + + ret.attribute_reports.push(a1) + end + end + + tasmota.log("MTR: ReportDataMessage=" + str(ret), 3) + tasmota.log("MTR: ReportDataMessageTLV=" + str(ret.to_TLV()), 3) + + var resp = msg.build_response(0x05 #-Report Data-#, true) + resp.encode(ret.to_TLV().encode()) # payload in cleartext + resp.encrypt() + + self.responder.send_response(resp.raw, remote_ip, remote_port, resp.message_counter) + end + + return true + end + + ############################################################# + # process IM 0x08 Invoke Request + # + # val is the TLV structure + # returns `true` if processed, `false` if silently ignored, + # or raises an exception + def process_invoke_request(msg, val, remote_ip, remote_port) + import string + # structure is `ReadRequestMessage` 10.6.2 p.558 + tasmota.log("MTR: IM:invoke_request processing start", 3) + var ctx = matter.Response_container() + + var query = matter.InvokeRequestMessage().from_TLV(val) + if query.invoke_requests != nil + # prepare the response + var ret = matter.InvokeResponseMessage() + ret.suppress_response = false + ret.invoke_responses = [] + + for q:query.invoke_requests + ctx.endpoint = q.command_path.endpoint + ctx.cluster = q.command_path.cluster + ctx.command = q.command_path.command + ctx.status = matter.UNSUPPORTED_COMMAND #default error if returned `nil` + + var cmd_name = matter.get_command_name(ctx.cluster, ctx.command) + if cmd_name == nil cmd_name = string.format("0x%04X/0x02X", ctx.cluster, ctx.command) end + tasmota.log(string.format("MTR: >Received_cmd %s from [%s]:%i", cmd_name, remote_ip, remote_port), 2) + var res = self.responder.device.invoke_request(msg, q.command_fields, ctx) + var a1 = matter.InvokeResponseIB() + if res != nil + a1.command = matter.CommandDataIB() + a1.command.command_path = matter.CommandPathIB() + a1.command.command_path.endpoint = ctx.endpoint + a1.command.command_path.cluster = ctx.cluster + a1.command.command_path.command = ctx.command + a1.command.command_fields = res + ret.invoke_responses.push(a1) + + cmd_name = matter.get_command_name(ctx.cluster, ctx.command) + if cmd_name == nil cmd_name = string.format("0x%04X/0x%02X", ctx.cluster, ctx.command) end + tasmota.log(string.format("MTR: Received_IM TimedRequest=%i from [%s]:%i", query.timeout, remote_ip, remote_port), 2) + + # Send success status report + var sr = matter.StatusResponseMessage() + sr.status = matter.SUCCESS + var resp = msg.build_response(0x01 #-Status Response-#, true #-reliable-#) + resp.encode(sr.to_TLV().encode()) # payload in cleartext + resp.encrypt() + self.responder.send_response(resp.raw, remote_ip, remote_port, resp.message_counter) + + return true + end + + ############################################################# + # placeholder, nothing to run for now + def every_second() + end +end +matter.IM = Matter_IM + +#- + +# Unit tests + + +-# + diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_IM_Data.be b/lib/libesp32/berry_matter/src/embedded/Matter_IM_Data.be new file mode 100644 index 000000000..b6f367bc9 --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_IM_Data.be @@ -0,0 +1,946 @@ +# +# Matter_IM_Data.be - suppport for Matter Interation Model messages structure +# +# 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 + +#@ solidify:Matter_IM_base,weak +#@ solidify:Matter_IM_Message_base,weak + +#@ solidify:matter.AttributePathIB,weak +#@ solidify:matter.ClusterPathIB,weak +#@ solidify:matter.DataVersionFilterIB,weak +#@ solidify:matter.AttributeDataIB,weak +#@ solidify:matter.AttributeReportIB,weak +#@ solidify:matter.EventFilterIB,weak +#@ solidify:matter.EventPathIB,weak +#@ solidify:matter.EventDataIB,weak +#@ solidify:matter.EventReportIB,weak +#@ solidify:matter.CommandPathIB,weak +#@ solidify:matter.CommandDataIB,weak +#@ solidify:matter.InvokeResponseIB,weak +#@ solidify:matter.CommandStatusIB,weak +#@ solidify:matter.EventStatusIB,weak +#@ solidify:matter.AttributeStatusIB,weak +#@ solidify:matter.StatusIB,weak +#@ solidify:matter.StatusResponseMessage,weak +#@ solidify:matter.ReadRequestMessage,weak +#@ solidify:matter.ReportDataMessage,weak +#@ solidify:matter.SubscribeRequestMessage,weak +#@ solidify:matter.SubscribeResponseMessage,weak +#@ solidify:matter.WriteRequestMessage,weak +#@ solidify:matter.WriteResponseMessage,weak +#@ solidify:matter.TimedRequestMessage,weak +#@ solidify:matter.InvokeRequestMessage,weak +#@ solidify:matter.InvokeResponseMessage,weak + +################################################################################# +# Base class for all IM containers +################################################################################# +class Matter_IM_base + def tostring() + return "<" + classname(self) + ":" + matter.inspect(self) + ">" + end + + # arr: array (list) of TLV values + # cl: class for the TLV decoder + def from_TLV_array(arr, cl) + if arr == nil return nil end + var r = [] + for v:arr + r.push(cl().from_TLV(v)) + end + return r + end + + # add an array of objects to TLV + # s: current container to add to + # tag: tag for the array (inner items don't have tags) + # arr: the array of objects supporting `to_TLV()` + # + # if arr is `nil`, nothing happens + def to_TLV_array(s, tag, arr) + if arr == nil return nil end + var l = s.add_array(tag) # create the list container and add to the current container + for v:arr + l.add_obj(nil, v) + end + end +end + +################################################################################# +# Matter_AttributePathIB class +################################################################################# +class Matter_AttributePathIB : Matter_IM_base + var tag_compression # false if none + var node # u64 as bytes + var endpoint # u16 + var cluster # u32 + var attribute # u32 + var list_index # ? + + def tostring() + try + import string + var s = "" + if self.node s += string.format("node=%s ", self.node) end + s += (self.endpoint != nil ? string.format("[%02X]", self.endpoint) : "[**]") + s += (self.cluster != nil ? string.format("%04X/", self.cluster) : "****/") + s += (self.attribute != nil ? string.format("%04X", self.attribute) : "****") + return s + except .. as e, m + return "Exception> " + str(e) + ", " + str(m) + end + end + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.tag_compression = val.findsubval(0) + self.node = val.findsubval(1) + self.endpoint = val.findsubval(2) + self.cluster = val.findsubval(3) + self.attribute = val.findsubval(4) + self.list_index = val.findsubval(5) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_list() + s.add_TLV(0, TLV.BOOL, self.tag_compression) + s.add_TLV(1, TLV.U8, self.node) + s.add_TLV(2, TLV.U2, self.endpoint) + s.add_TLV(3, TLV.U4, self.cluster) + s.add_TLV(4, TLV.U4, self.attribute) + s.add_TLV(5, TLV.U2, self.list_index) + return s + end +end +matter.AttributePathIB = Matter_AttributePathIB + + +################################################################################# +# ClusterPathIB class +################################################################################# +class Matter_ClusterPathIB : Matter_IM_base + var node # u64 as bytes + var endpoint # u16 + var cluster # u32 + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.node = val.findsubval(0) + self.endpoint = val.findsubval(1) + self.cluster = val.findsubval(2) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_list() + s.add_TLV(0, TLV.U8, self.node) + s.add_TLV(1, TLV.U2, self.endpoint) + s.add_TLV(2, TLV.U4, self.cluster) + return s + end +end +matter.ClusterPathIB = Matter_ClusterPathIB + +################################################################################# +# DataVersionFilterIB class +################################################################################# +class Matter_DataVersionFilterIB : Matter_IM_base + var path # false if none + var data_version # u64 as bytes + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.path = matter.ClusterPathIB().from_TLV(val.findsub(0)) + self.data_version = val.findsubval(1) # u32 + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + s.add_obj(0, self.path) + s.add_TLV(1, TLV.U4, self.data_version) + return s + end +end +matter.DataVersionFilterIB = Matter_DataVersionFilterIB + +################################################################################# +# AttributeDataIB class +################################################################################# +class Matter_AttributeDataIB : Matter_IM_base + var data_version # u32 + var path # AttributePathIB + var data # any TLV + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.data_version = val.findsubval(0) # u32 + self.path = matter.AttributePathIB().from_TLV(val.findsub(1)) + self.data = val.findsubval(2) # any + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + s.add_TLV(0, TLV.U4, self.data_version) + s.add_obj(1, self.path) + s.add_obj(2, self.data) + return s + end +end +matter.AttributeDataIB = Matter_AttributeDataIB + +################################################################################# +# AttributeReportIB class +################################################################################# +class Matter_AttributeReportIB : Matter_IM_base + var attribute_status # AttributeStatusIB + var attribute_data # AttributeDataIB + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.attribute_status = matter.AttributeStatusIB().from_TLV(val.findsub(0)) + self.attribute_data = matter.AttributeDataIB().from_TLV(val.findsub(1)) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + s.add_obj(0, self.attribute_status) + s.add_obj(1, self.attribute_data) + return s + end +end +matter.AttributeReportIB = Matter_AttributeReportIB + +################################################################################# +# EventFilterIB class +################################################################################# +class Matter_EventFilterIB : Matter_IM_base + var node # u64 + var event_min # u64 + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.node = val.findsubval(0) + self.event_min = val.findsubval(1) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + s.add_TLV(0, TLV.U8, self.node) + s.add_TLV(1, TLV.U8, self.event_min) + return s + end +end +matter.EventFilterIB = Matter_EventFilterIB + +################################################################################# +# EventPathIB class +################################################################################# +class Matter_EventPathIB : Matter_IM_base + var node # u64 as bytes + var endpoint # u16 + var cluster # u32 + var event # u32 + var is_urgent # bool + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.node = val.findsubval(0) + self.endpoint = val.findsubval(1) + self.cluster = val.findsubval(2) + self.event = val.findsubval(3) + self.is_urgent = val.findsubval(4) + return self + end + + def to_TLV(s) + var TLV = matter.TLV + if s == nil s = TLV.Matter_TLV_list() end + s.add_TLV(0, TLV.U8, self.node) + s.add_TLV(1, TLV.U2, self.endpoint) + s.add_TLV(2, TLV.U4, self.cluster) + s.add_TLV(3, TLV.U4, self.event) + s.add_TLV(4, TLV.BOOL, self.is_urgent) + return s + end +end +matter.EventPathIB = Matter_EventPathIB + + +################################################################################# +# EventDataIB class +################################################################################# +class Matter_EventDataIB : Matter_IM_base + var path # + var event_number # u64 as bytes + var priority # u8 + # one of + var epoch_timestamp # u64 + var system_timestamp # u64 + var delta_epoch_timestamp # u64 + var delta_system_timestamp # u64 + # data + var data # any TLV + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.path = matter.EventPathIB().from_TLV(val.findsub(0)) + self.event_number = val.findsubval(1) # u64 + self.priority = val.findsubval(2) # u64 + self.epoch_timestamp = val.findsubval(3) # u64 + self.system_timestamp = val.findsubval(4) # u64 + self.delta_epoch_timestamp = val.findsubval(5) # u64 + self.delta_system_timestamp = val.findsubval(6) # u64 + self.data = val.findsubval(7) # any + return self + end + + def to_TLV(s) + var TLV = matter.TLV + if s == nil s = TLV.Matter_TLV_struct() end + if self.path + self.path.to_TLV(s.add_list(0)) + end + s.add_TLV(1, TLV.U8, self.event_number) + s.add_TLV(2, TLV.U1, self.priority) + s.add_TLV(3, TLV.U8, self.epoch_timestamp) + s.add_TLV(4, TLV.U8, self.system_timestamp) + s.add_TLV(5, TLV.U8, self.delta_epoch_timestamp) + s.add_TLV(6, TLV.U8, self.delta_system_timestamp) + s.add_obj(7, self.data) + return s + end +end +matter.EventDataIB = Matter_EventDataIB + + +################################################################################# +# EventReportIB class +################################################################################# +class Matter_EventReportIB : Matter_IM_base + var event_status # EventStatusIB + var event_data # EventDataIB + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.event_status = matter.EventStatusIB().from_TLV(val.findsub(0)) + self.event_data = matter.EventDataIB().from_TLV(val.findsub(1)) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + s.add_obj(0, self.event_status) + s.add_obj(1, self.event_data) + return s + end +end +matter.EventReportIB = Matter_EventReportIB + +################################################################################# +# CommandPathIB class +################################################################################# +class Matter_CommandPathIB : Matter_IM_base + var endpoint # u16 + var cluster # u32 + var command # u32 + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.endpoint = val.findsubval(0) + self.cluster = val.findsubval(1) + self.command = val.findsubval(2) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_list() + s.add_TLV(0, TLV.U2, self.endpoint) + s.add_TLV(1, TLV.U4, self.cluster) + s.add_TLV(2, TLV.U4, self.command) + return s + end +end +matter.CommandPathIB = Matter_CommandPathIB + +################################################################################# +# CommandDataIB class +################################################################################# +class Matter_CommandDataIB : Matter_IM_base + var command_path # CommandPathIB + var command_fields # any + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.command_path = matter.CommandPathIB().from_TLV(val.findsub(0)) + self.command_fields = val.findsub(1) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + s.add_obj(0, self.command_path) + s.add_obj(1, self.command_fields) + return s + end +end +matter.CommandDataIB = Matter_CommandDataIB + + +################################################################################# +# InvokeResponseIB class +################################################################################# +class Matter_InvokeResponseIB : Matter_IM_base + var command # CommandDataIB + var status # CommandStatusIB + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.command = matter.CommandDataIB().from_TLV(val.findsub(0)) + self.status = matter.CommandStatusIB().from_TLV(val.findsub(1)) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + s.add_obj(0, self.command) + s.add_obj(1, self.status) + return s + end +end +matter.InvokeResponseIB = Matter_InvokeResponseIB + + +################################################################################# +# CommandStatusIB class +################################################################################# +class Matter_CommandStatusIB : Matter_IM_base + var command_path # CommandPathIB + var status # StatusIB + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.command_path = matter.CommandPathIB().from_TLV(val.findsub(0)) + self.status = matter.StatusIB().from_TLV(val.findsub(1)) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + s.add_obj(0, self.command_path) + s.add_obj(1, self.status) + return s + end +end +matter.CommandStatusIB = Matter_CommandStatusIB + +################################################################################# +# EventStatusIB class +################################################################################# +class Matter_EventStatusIB : Matter_IM_base + var path # EventPathIB + var status # StatusIB + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.path = matter.EventPathIB().from_TLV(val.findsub(0)) + self.status = matter.StatusIB().from_TLV(val.findsub(1)) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + s.add_obj(0, self.path) + s.add_obj(1, self.status) + return s + end +end +matter.EventStatusIB = Matter_EventStatusIB + +################################################################################# +# AttributeStatusIB class +################################################################################# +class Matter_AttributeStatusIB : Matter_IM_base + var path # AttributePathIB + var status # StatusIB + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.path = matter.AttributePathIB().from_TLV(val.findsub(0)) + self.status = matter.StatusIB().from_TLV(val.findsub(1)) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + s.add_obj(0, self.path) + s.add_obj(1, self.status) + return s + end +end +matter.AttributeStatusIB = Matter_AttributeStatusIB + +################################################################################# +# StatusIB class +################################################################################# +class Matter_StatusIB : Matter_IM_base + var status # u16 + var cluster_status # u16 + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.status = val.findsubval(0) + self.cluster_status = val.findsubval(1) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_list() + s.add_TLV(0, TLV.U2, self.status) + s.add_TLV(1, TLV.U2, self.cluster_status) + return s + end +end +matter.StatusIB = Matter_StatusIB + +################################################################################# +################################################################################# +# Matter_IM_Message_base class +# +# This is the superclass for all high-level messages +################################################################################# +################################################################################# +class Matter_IM_Message_base : Matter_IM_base + var InteractionModelRevision # 0xFF + + def init() + self.InteractionModelRevision = 1 + end +end + + +################################################################################# +# StatusResponseMessage class +################################################################################# +class Matter_StatusResponseMessage : Matter_IM_Message_base + var status # u32 + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.status = val.findsubval(0) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + s.add_TLV(0, TLV.U4, self.status) + s.add_TLV(0xFF, TLV.U1, self.InteractionModelRevision) + return s + end +end +matter.StatusResponseMessage = Matter_StatusResponseMessage + +################################################################################# +# ReadRequestMessage class +################################################################################# +class Matter_ReadRequestMessage : Matter_IM_Message_base + var attributes_requests # array of AttributePathIB + var event_requests # array of EventPathIB + var event_filters # array of EventFilterIB + var fabric_filtered # bool + var data_version_filters # array of DataVersionFilterIB + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.attributes_requests = self.from_TLV_array(val.findsubval(0), matter.AttributePathIB) + self.event_requests = self.from_TLV_array(val.findsubval(1), matter.EventPathIB) + self.event_filters = self.from_TLV_array(val.findsubval(2), matter.EventFilterIB) + self.fabric_filtered = val.findsubval(3) + self.data_version_filters = self.from_TLV_array(val.findsubval(4), matter.DataVersionFilterIB) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + self.to_TLV_array(s, 0, self.attributes_requests) + self.to_TLV_array(s, 1, self.event_requests) + self.to_TLV_array(s, 2, self.event_filters) + s.add_TLV(3, TLV.BOOL, self.fabric_filtered) + self.to_TLV_array(s, 4, self.data_version_filters) + s.add_TLV(0xFF, TLV.U1, self.InteractionModelRevision) + return s + end +end +matter.ReadRequestMessage = Matter_ReadRequestMessage + +################################################################################# +# ReportDataMessage class +################################################################################# +class Matter_ReportDataMessage : Matter_IM_Message_base + var subscription_id # u32 + var attribute_reports # array of AttributeReportIB + var event_reports # array of EventReportIB + var more_chunked_messages # bool + var suppress_response # bool + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.subscription_id = val.findsubval(0) + self.attribute_reports = self.from_TLV_array(val.findsubval(1), matter.AttributeReportIB) + self.event_reports = self.from_TLV_array(val.findsubval(2), matter.EventReportIB) + self.more_chunked_messages = val.findsubval(3) + self.suppress_response = val.findsubval(4) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + s.add_TLV(0, TLV.U4, self.subscription_id) + self.to_TLV_array(s, 1, self.attribute_reports) + self.to_TLV_array(s, 2, self.event_reports) + s.add_TLV(3, TLV.BOOL, self.more_chunked_messages) + s.add_TLV(4, TLV.BOOL, self.suppress_response) + s.add_TLV(0xFF, TLV.U1, self.InteractionModelRevision) + return s + end +end +matter.ReportDataMessage = Matter_ReportDataMessage + +################################################################################# +# SubscribeRequestMessage class +################################################################################# +class Matter_SubscribeRequestMessage : Matter_IM_Message_base + var keep_subscriptions # bool + var min_interval_floor # u16 + var max_interval_ceiling # u16 + var attribute_requests # array of AttributePathIB + var event_requests # array of EventPathIB + var event_filters # array of EventFilterIB + var fabric_filtered # bool + var data_version_filters # array of DataVersionFilterIB + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.keep_subscriptions = val.findsubval(0) + self.min_interval_floor = val.findsubval(1) + self.max_interval_ceiling = val.findsubval(2) + self.attribute_requests = self.from_TLV_array(val.findsubval(3), matter.AttributePathIB) + self.event_requests = self.from_TLV_array(val.findsubval(4), matter.EventPathIB) + self.event_filters = self.from_TLV_array(val.findsubval(5), matter.EventFilterIB) + self.fabric_filtered = val.findsubval(7) + self.data_version_filters = self.from_TLV_array(val.findsubval(8), matter.DataVersionFilterIB) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + s.add_TLV(0, TLV.BOOL, self.keep_subscriptions) + s.add_TLV(1, TLV.U2, self.min_interval_floor) + s.add_TLV(2, TLV.U2, self.max_interval_ceiling) + self.to_TLV_array(s, 3, self.attribute_requests) + self.to_TLV_array(s, 4, self.event_requests) + self.to_TLV_array(s, 5, self.event_filters) + s.add_TLV(7, TLV.BOOL, self.fabric_filtered) + self.to_TLV_array(s, 8, self.data_version_filters) + s.add_TLV(0xFF, TLV.U1, self.InteractionModelRevision) + return s + end +end +matter.SubscribeRequestMessage = Matter_SubscribeRequestMessage + +################################################################################# +# SubscribeResponseMessage class +################################################################################# +class Matter_SubscribeResponseMessage : Matter_IM_Message_base + var subscription_id # u32 + var max_interval # u16 + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.subscription_id = val.findsubval(0) + self.max_interval = val.findsubval(2) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + s.add_TLV(0, TLV.U4, self.subscription_id) + s.add_TLV(2, TLV.U2, self.max_interval) + s.add_TLV(0xFF, TLV.U1, self.InteractionModelRevision) + return s + end +end +matter.SubscribeResponseMessage = Matter_SubscribeResponseMessage + +################################################################################# +# WriteRequestMessage class +################################################################################# +class Matter_WriteRequestMessage : Matter_IM_Message_base + var suppress_response # bool + var timed_request # bool + var write_requests # array of AttributeDataIB + var more_chunked_messages # bool + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.suppress_response = val.findsubval(0) + self.timed_request = val.findsubval(1) + self.write_requests = self.from_TLV_array(val.findsubval(2), matter.AttributeDataIB) + self.more_chunked_messages = val.findsubval(3) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + s.add_TLV(0, TLV.BOOL, self.suppress_response) + s.add_TLV(1, TLV.BOOL, self.timed_request) + self.to_TLV_array(s, 2, self.write_requests) + s.add_TLV(3, TLV.BOOL, self.more_chunked_messages) + s.add_TLV(0xFF, TLV.U1, self.InteractionModelRevision) + return s + end +end +matter.WriteRequestMessage = Matter_WriteRequestMessage + +################################################################################# +# WriteResponseMessage class +################################################################################# +class Matter_WriteResponseMessage : Matter_IM_Message_base + var write_responses # array of AttributeStatusIB + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.write_requests = self.from_TLV_array(val.findsubval(0), matter.AttributeStatusIB) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + self.to_TLV_array(s, 0, self.write_responses) + s.add_TLV(0xFF, TLV.U1, self.InteractionModelRevision) + return s + end +end +matter.WriteResponseMessage = Matter_WriteResponseMessage + +################################################################################# +# TimedRequestMessage class +################################################################################# +class Matter_TimedRequestMessage : Matter_IM_Message_base + var timeout # u16 + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.timeout = val.findsubval(0) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + s.add_TLV(0, TLV.U2, self.timeout) + s.add_TLV(0xFF, TLV.U1, self.InteractionModelRevision) + return s + end +end +matter.TimedRequestMessage = Matter_TimedRequestMessage + +################################################################################# +# InvokeRequestMessage class +################################################################################# +class Matter_InvokeRequestMessage : Matter_IM_Message_base + var suppress_response # bool + var timed_request # bool + var invoke_requests # array of CommandDataIB + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.suppress_response = val.findsubval(0) + self.timed_request = val.findsubval(1) + self.invoke_requests = self.from_TLV_array(val.findsubval(2), matter.CommandDataIB) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + s.add_TLV(0, TLV.BOOL, self.suppress_response) + s.add_TLV(1, TLV.BOOL, self.timed_request) + self.to_TLV_array(s, 2, self.invoke_requests) + s.add_TLV(0xFF, TLV.U1, self.InteractionModelRevision) + return s + end +end +matter.InvokeRequestMessage = Matter_InvokeRequestMessage + +################################################################################# +# InvokeResponseMessage class +################################################################################# +class Matter_InvokeResponseMessage : Matter_IM_Message_base + var suppress_response # bool + var invoke_responses # array of InvokeResponseIB + + # decode from TLV + def from_TLV(val) + if val == nil return nil end + self.suppress_response = val.findsubval(0) + self.invoke_responses = self.from_TLV_array(val.findsubval(1), matter.InvokeResponseIB) + return self + end + + def to_TLV() + var TLV = matter.TLV + var s = TLV.Matter_TLV_struct() + s.add_TLV(0, TLV.BOOL, self.suppress_response) + self.to_TLV_array(s, 1, self.invoke_responses) + s.add_TLV(0xFF, TLV.U1, self.InteractionModelRevision) + return s + end +end +matter.InvokeResponseMessage = Matter_InvokeResponseMessage + + +#- + +# Unit tests + +import matter + +m = matter.TLV.parse(bytes("1724020024033024040018")) +assert(m.tostring() == "[[2 = 0U, 3 = 48U, 4 = 0U]]") +#a = matter.IM.AttributePathIB().from_TLV(m) +a = matter.AttributePathIB().from_TLV(m) +assert(str(a) == "[00]0030/0000") +m = a.to_TLV() +assert(m.tostring() == "[[2 = 0U, 3 = 48U, 4 = 0U]]") +assert(m.encode() == bytes("1724020024033024040018")) + + +# create DataVersionFilterIB from scratch +c = matter.ClusterPathIB() +c.endpoint = 1 +c.cluster = 32 +c.to_TLV() +assert(str(c.to_TLV()) == "[[1 = 1U, 2 = 32U]]") + +d = matter.DataVersionFilterIB() +d.path = c +d.data_version = 10 +assert(str(d.to_TLV()) == '{0 = [[1 = 1U, 2 = 32U]], 1 = 10U}') +assert(d.to_TLV().encode() == bytes('1537002401012402201824010A18')) + +# decode DataVersionFilterIB from scratch +m = matter.TLV.parse(bytes("1537002401012402201824010A18")) +assert(str(m) == '{0 = [[1 = 1U, 2 = 32U]], 1 = 10U}') + +# ReadRequestMessage +m = matter.TLV.parse(bytes("153600172403312504FCFF18172402002403302404001817240200240330240401181724020024033024040218172402002403302404031817240200240328240402181724020024032824040418172403312404031818280324FF0118")) +assert(str(m) == "{0 = [[[3 = 49U, 4 = 65532U]], [[2 = 0U, 3 = 48U, 4 = 0U]], [[2 = 0U, 3 = 48U, 4 = 1U]], [[2 = 0U, 3 = 48U, 4 = 2U]], [[2 = 0U, 3 = 48U, 4 = 3U]], [[2 = 0U, 3 = 40U, 4 = 2U]], [[2 = 0U, 3 = 40U, 4 = 4U]], [[3 = 49U, 4 = 3U]]], 3 = false, 255 = 1U}") +r = matter.ReadRequestMessage().from_TLV(m) +assert(str(r) == "") +t = r.to_TLV() +assert(str(t) == "{0 = [[[3 = 49U, 4 = 65532U]], [[2 = 0U, 3 = 48U, 4 = 0U]], [[2 = 0U, 3 = 48U, 4 = 1U]], [[2 = 0U, 3 = 48U, 4 = 2U]], [[2 = 0U, 3 = 48U, 4 = 3U]], [[2 = 0U, 3 = 40U, 4 = 2U]], [[2 = 0U, 3 = 40U, 4 = 4U]], [[3 = 49U, 4 = 3U]]], 3 = false}") + + +# ReportDataMessage +r = matter.ReportDataMessage() +r.subscription_id = 1 +r.attribute_reports = [] +a1 = matter.AttributeReportIB() +a1.attribute_status = matter.AttributeStatusIB() +a1.attribute_status.path = matter.AttributePathIB() +a1.attribute_status.status = matter.StatusIB() +a1.attribute_status.path.endpoint = 0 +a1.attribute_status.path.cluster = 0x0030 +a1.attribute_status.path.attribute = 0 +a1.attribute_status.status.status = 0 +a1.attribute_status.status.cluster_status = 0 +a1.attribute_data = matter.AttributeDataIB() +a1.attribute_data.data_version = 1 +a1.attribute_data.path = matter.AttributePathIB() +a1.attribute_data.path.endpoint = 0 +a1.attribute_data.path.cluster = 0x0030 +a1.attribute_data.path.attribute = 0 +a1.attribute_data.data = matter.TLV.create_TLV(matter.TLV.UTF1, "Tasmota") +assert(str(a1.to_TLV()) == '{0 = {0 = [[2 = 0U, 3 = 48U, 4 = 0U]], 1 = [[0 = 0U, 1 = 0U]]}, 1 = {0 = 1U, 1 = [[2 = 0U, 3 = 48U, 4 = 0U]], 2 = "Tasmota"}}') +r.attribute_reports.push(a1) +#{0 = 1U, 1 = [{0 = {0 = [[2 = 0U, 3 = 48U, 4 = 0U]], 1 = [[0 = 0U, 1 = 0U]]}, 1 = {0 = 1U, 1 = [[2 = 0U, 3 = 48U, 4 = 0U]], 2 = "Tasmota"}}]} +assert(r.to_TLV().encode() == bytes('1524000136011535003700240200240330240400183701240000240100181835012400013701240200240330240400182C02075461736D6F746118181818')) + + +# , +# 'attribute_status': }>}> + +-# + diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Message.be b/lib/libesp32/berry_matter/src/embedded/Matter_Message.be new file mode 100644 index 000000000..3eadf0c55 --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Message.be @@ -0,0 +1,407 @@ +# +# Matter_Message.be - suppport for Matter Message Packet/Frame structure, deconding, enconding, encryption & decryption +# +# 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 + +#@ solidify:Matter_Frame,weak + +# Matter frame format, see 4.4 (p. 107) +class Matter_Frame + # context information + var message_handler # the message handler instance that decodes and generate responses + var session # the session object associated, or `nil` if no session + # content of the message + var raw # raw bytes of the packet + var payload_idx # index in raw for beginning of payload + # Message header + var flags + var flag_s # Note: Matter booleans are 1/0 not true/false + var flag_dsiz + var local_session_id + var sec_flags + var sec_p + var sec_c + var sec_mx + var sec_sesstype + var message_counter + var source_node_id + var dest_node_id_2 # if 2 bytes + var dest_node_id_8 # if 8 bytes + # Message payload + var x_flags + var x_flag_v + var x_flag_sx + var x_flag_r + var x_flag_a + var x_flag_i + var opcode + var exchange_id + var protocol_id + var vendor_id # (opt) + var ack_message_counter # (opt) + var sec_extensions + # var + var app_payload_idx # index where the application payload starts + + ############################################################# + # keep track of the message_handler object + # + def init(message_handler, raw) + self.message_handler = message_handler + self.raw = raw + end + + ############################################################# + # decode the header of the message and provide session + # information if decryption is required + # + # returns `true` if ok, `false` if message needs to be ignored + # or raises an exception if something went wrong + def decode_header() + var idx = 0 + var raw = self.raw + # flags + self.flags = raw.get(0, 1) + if (self.flags & 0xF8) != 0x00 return false end # ignore if Matter version if not 1.0 + self.flag_s = raw.getbits(2, 1) + self.flag_dsiz = raw.getbits(0, 2) + if self.flag_dsiz == 3 return false end # ignore if dsiz is unknown + + # security flagse + self.sec_flags = raw.get(3, 1) + self.sec_p = raw.getbits(3*8 + 7, 1) + self.sec_c = raw.getbits(3*8 + 6, 1) + self.sec_mx = raw.getbits(3*8 + 5, 1) + self.sec_sesstype = raw.getbits(3*8, 2) + if self.sec_sesstype > 1 return false end # ignore if session type is unknown + + # + self.local_session_id = raw.get(1, 2) + self.message_counter = raw.get(4, 4) + idx += 8 + # source node id? + if self.flag_s + self.source_node_id = raw[idx .. idx+7] + idx += 8 + end + # dest node id? + if self.flag_dsiz == 1 + self.dest_node_id_8 = raw[idx .. idx+7] + idx += 8 + elif self.flag_dsiz == 2 + self.dest_node_id_2 = raw.get(idx, 2) + idx += 2 + end + + # skip MX if any + if self.sec_mx + var sz = raw.get(idx, 2) + idx += sz + 2 # ignore bytes + end + + self.payload_idx = idx + return true + end + + ############################################################# + def decode_payload() + var idx = self.payload_idx # retrieve index for payload + var raw = self.raw + + # Message paylod + self.x_flags = raw.get(idx, 1) + # flags + self.x_flag_v = raw.getbits(idx*8 + 4, 1) + self.x_flag_sx = raw.getbits(idx*8 + 3, 1) + self.x_flag_r = raw.getbits(idx*8 + 2, 1) + self.x_flag_a = raw.getbits(idx*8 + 1, 1) + self.x_flag_i = raw.getbits(idx*8, 1) + + self.opcode = raw.get(idx+1, 1) + self.exchange_id = raw.get(idx+2, 2) + self.protocol_id = raw.get(idx+4, 2) + idx += 6 + + # optional protocol vendor id + if self.x_flag_v + self.vendor_id = raw.get(idx, 2) + idx += 2 + end + # optional Acknowledged Message Counter (32 bits) + if self.x_flag_a + self.ack_message_counter = raw.get(idx, 4) + idx += 4 + end + # optional secure extensions + if self.x_flag_sx + var sz = raw.get(idx, 2) + idx += sz + 2 # skip + end + + self.app_payload_idx = idx + return self + end + + ############################################################# + # Encode the packet as raw bytes + # + # If encryption is needed, it is done later + # + # Header is built from attributes + # `payload` is a bytes() buffer for the app payload + def encode(payload) + var raw = bytes() + # compute flags + if self.flags == nil + self.flags = 0x00 + if self.flag_s self.flags = self.flags | 0x04 end + if self.flag_dsiz self.flags = self.flags | (self.flag_dsiz & 0x03) end + end + raw.add(self.flags, 1) + # local_session_id (mandatory) + raw.add(self.local_session_id ? self.local_session_id : 0, 2) + # compute security flags + if self.sec_flags == nil + self.sec_flags = 0x00 + if self.sec_p self.sec_flags = self.sec_flags | 0x80 end + if self.sec_c self.sec_flags = self.sec_flags | 0x40 end + # if self.sec_mx self.sec_flags = self.sec_flags | 0x20 end # not supportedd + if self.sec_sesstype self.sec_flags = self.sec_flags | (self.sec_sesstype & 0x03) end + end + raw.add(self.sec_flags, 1) + # + raw.add(self.message_counter, 4) # mandatory + # + if self.flag_s raw .. self.source_node_id end # 8 bytes + if self.flag_dsiz == 0x01 raw .. self.dest_node_id_8 end # 8 bytes + if self.flag_dsiz == 0x02 raw.add(self.dest_node_id_2, 2) end # 2 bytes + # skip message extensions + self.payload_idx = size(raw) + # Message payload + if self.x_flags == nil + self.x_flags = 0x00 + if self.x_flag_v self.x_flags = self.x_flags | 0x10 end + # if self.x_flag_sx self.x_flags = self.x_flags | 0x08 end # not implemented + if self.x_flag_r self.x_flags = self.x_flags | 0x04 end + if self.x_flag_a self.x_flags = self.x_flags | 0x02 end + if self.x_flag_i self.x_flags = self.x_flags | 0x01 end + end + raw.add(self.x_flags, 1) + # opcode (mandatory) + raw.add(self.opcode, 1) + raw.add(self.exchange_id, 2) + raw.add(self.protocol_id, 2) + if self.x_flag_a raw.add(self.ack_message_counter, 4) end + # finally payload + self.app_payload_idx = size(raw) + if payload + raw .. payload + end + + self.debug(raw) + self.raw = raw + return raw + end + + ############################################################# + # Generate a Standalone Acknowledgment + # Uses `PROTOCOL_ID_SECURE_CHANNEL` no ecnryption required + def build_standalone_ack() + import string + # send back response + var resp = classof(self)(self.message_handler) + + if self.flag_s + resp.flag_dsiz = 0x01 + resp.dest_node_id_8 = self.source_node_id + else + resp.flag_dsiz = 0x00 + end + resp.session = self.session # also copy the session object + # message counter + resp.message_counter = self.session.counter_snd.next() + resp.local_session_id = self.session.initiator_session_id + + resp.x_flag_i = 0 # not sent by initiator + resp.opcode = 0x10 # MRP Standalone Acknowledgement + resp.exchange_id = self.exchange_id + resp.protocol_id = 0 # PROTOCOL_ID_SECURE_CHANNEL + resp.x_flag_a = 1 # ACK of previous message + resp.ack_message_counter = self.message_counter + resp.x_flag_r = 0 + + tasmota.log(string.format("MTR: . +# + +import matter + +#@ solidify:Matter_MessageHandler,weak + +class Matter_MessageHandler + # callback for sending messages + var device # `tansport.msg_send(raw:bytes() [,...]) -> bool` true if succeeded + + # handlers + var commissioning + var im # handler for Interaction Model + # counters + var counter_rcv # Global Unencrypted Message Counter incoming + + ############################################################# + def init(device) + self.device = device + self.commissioning = matter.Commisioning_Context(self) + self.im = matter.IM(self) + self.counter_rcv = matter.Counter() + end + + ############################################################# + # Called when a message is received + # + # Find or create a session for the message + # and dispacth to appropriate handler + # + def msg_received(raw, addr, port) + import string + try + tasmota.log("MTR: MessageHandler::msg_received raw="+raw.tohex(), 4) + var frame = matter.Frame(self, raw) + + var ok = frame.decode_header() + if !ok return false end + + # do we need decryption? + if frame.local_session_id == 0 && frame.sec_sesstype == 0 + ############################################################# + ### unencrypted session, handled by commissioning + var session = self.device.sessions.find_session_source_id_unsecure(frame.source_node_id, 90) # 90 seconds max + tasmota.log("MTR: find session by source_node_id = " + str(frame.source_node_id) + "session_id = " + str(session.local_session_id), 3) + frame.session = session + + # check if it's a duplicate + if !self.counter_rcv.validate(frame.message_counter, false) + tasmota.log(string.format("MTR: rejected duplicate unencrypted message = %i ref = %i", frame.message_counter, self.counter_rcv.val()), 3) + return false + end + + if !frame.decode_payload() return false end + self.device.packet_ack(frame.ack_message_counter) # acknowledge packet + if frame.opcode != 0x10 # don't show `MRP_Standalone_Acknowledgement` + var op_name = matter.get_opcode_name(frame.opcode) + if !op_name op_name = string.format("0x%02X", frame.opcode) end + tasmota.log(string.format("MTR: >Received %s from [%s]:%i", op_name, addr, port), 2) + end + self.commissioning.process_incoming(frame, addr, port) + return true + else + ############################################################# + # encrypted message + tasmota.log(string.format("MTR: decode header: local_session_id=%i message_counter=%i", frame.local_session_id, frame.message_counter), 3) + + var session = self.device.sessions.get_session_by_local_session_id(frame.local_session_id) + if session == nil + tasmota.log("MTR: unknown local_session_id "+str(frame.local_session_id), 3) + tasmota.log("MTR: frame="+matter.inspect(frame), 3) + return false + end + frame.session = session # keep a pointer of the session in the message + + # check if it's a duplicate + if !session.counter_rcv.validate(frame.message_counter, true) + tasmota.log("MTR: rejected duplicate encrypted message = " + str(frame.message_counter) + " counter=" + str(session.counter_rcv.val()), 3) + return false + end + + var cleartext = frame.decrypt() + if !cleartext return false end + + # packet is good, put back content in raw + frame.raw = frame.raw[0 .. frame.payload_idx - 1] # remove encrypted payload + frame.raw .. cleartext # add cleartext + + # continue decoding + tasmota.log(string.format("MTR: idx=%i clear=%s", frame.payload_idx, frame.raw.tohex()), 3) + frame.decode_payload() + tasmota.log("MTR: decrypted message: protocol_id:"+str(frame.protocol_id)+" opcode="+str(frame.opcode)+" exchange_id"+str(frame.exchange_id), 3) + + self.device.packet_ack(frame.ack_message_counter) # acknowledge packet + + # dispatch according to protocol_id + var protocol_id = frame.protocol_id + if protocol_id == 0x0000 # PROTOCOL_ID_SECURE_CHANNEL + # it should not be encrypted + tasmota.log("MTR: PROTOCOL_ID_SECURE_CHANNEL " + matter.inspect(frame), 3) + # if frame.opcode == 0x10 + # end + return true + elif protocol_id == 0x0001 # PROTOCOL_ID_INTERACTION_MODEL + # dispatch to IM Protocol Messages + return self.im.process_incoming(frame, addr, port) + + # -- PROTOCOL_ID_BDX is used for file transfer between devices, not used in Tasmota + # elif protocol_id == 0x0002 # PROTOCOL_ID_BDX -- BDX not handled at all in Tasmota + # tasmota.log("MTR: PROTOCOL_ID_BDX not yet handled", 2) + # return false # ignore for now TODO + # -- PROTOCOL_ID_USER_DIRECTED_COMMISSIONING is only used by devices, as a device we will not receive any + # elif protocol_id == 0x0003 # PROTOCOL_ID_USER_DIRECTED_COMMISSIONING + # tasmota.log("MTR: PROTOCOL_ID_USER_DIRECTED_COMMISSIONING not yet handled", 2) + # return false # ignore for now TODO + else + tasmota.log("MTR: ignoring unhandled protocol_id:"+str(protocol_id), 3) + return false + end + + end + + return true + except .. as e, m + tasmota.log("MTR: MessageHandler::msg_received exception: "+str(e)+";"+str(m)) + import debug + debug.traceback() + return false + end + end + + ############################################################# + def send_response(raw, addr, port, id) + self.device.msg_send(raw, addr, port, id) + end + + ############################################################# + def add_session(local_session_id, initiator_session_id, i2r, r2i, ac, session_timestamp) + import string + # create session object + tasmota.log(string.format("MTR: add_session local_session_id=%i initiator_session_id=%i", local_session_id, initiator_session_id), 3) + + var session = self.device.sessions.create_session(local_session_id, initiator_session_id) + session.set_keys(i2r, r2i, ac, session_timestamp) + end + + ############################################################# + # placeholder, nothing to run for now + def every_second() + self.commissioning.every_second() + self.im.every_second() + end +end +matter.MessageHandler = Matter_MessageHandler diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Module.be b/lib/libesp32/berry_matter/src/embedded/Matter_Module.be new file mode 100644 index 000000000..0f138d76f --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Module.be @@ -0,0 +1,46 @@ +# +# Matter_Module.be - implements the global `matter` module from a solidified module that can be dynamically enriched +# +# 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 . +# + +# matter module for extensibility +# +# this allows the module `matter` to be extended + +var matter = module("matter") + +def setmember(k, v) + import global + if !global.contains(".matter") global.(".matter") = {} end + global.(".matter")[k] = v +end + +def member(k) + import global + import undefined + + if global.contains(".matter") && global.(".matter").contains(k) + return global.(".matter")[k] + else + return undefined + end +end + +matter.setmember = setmember +matter.member = member +#@ solidify:matter.setmember,weak +#@ solidify:matter.member,weak diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin.be new file mode 100644 index 000000000..fb3c170de --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin.be @@ -0,0 +1,88 @@ +# +# Matter_Plugin.be - generic superclass for all Matter plugins, used to define specific behaviors (light, switch, media...) +# +# 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 . +# + +# Matter modules for extensibility +# template but not actually used + +#@ solidify:Matter_Plugin,weak + +class Matter_Plugin + var device + var endpoints + + ############################################################# + # Constructor + def init(device) + self.device = device + self.endpoints = [] + end + + ############################################################# + # Which endpoints does it handle (list of numbers) + def get_endpoints() + return self.endpoints + end + + ############################################################# + # read attribute + def read_attribute(msg, endpoint, cluster, attribute) + return nil + end + + ############################################################# + # read event + # TODO + def read_event(msg, endpoint, cluster, eventid) + return nil + end + + ############################################################# + # subscribe attribute + # TODO + def subscribe_attribute(msg, endpoint, cluster, attribute) + return nil + end + + ############################################################# + # subscribe event + # TODO + def subscribe_event(msg, endpoint, cluster, eventid) + return nil + end + + ############################################################# + # write attribute + def write_attribute(msg, endpoint, cluster, attribute) + return nil + end + + ############################################################# + # invoke command + def invoke_request(msg, val, ctx) + return nil + end + + ############################################################# + # timed request + # TODO - should we even support this? + def timed_request(msg, val, ctx) + return nil + end +end +matter.Plugin = Matter_Plugin diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Relay.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Relay.be new file mode 100644 index 000000000..3a923246d --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Relay.be @@ -0,0 +1,52 @@ +# +# Matter_Plugin_Relay.be - implements the behavior for a Relay (OnOff) +# +# 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 . +# + +# Matter plug-in for core behavior + +# dummy declaration for solidification +class Matter_Plugin end + +#@ solidify:Matter_Plugin_Relay,weak + +class Matter_Plugin_Relay : Matter_Plugin + ############################################################# + # Constructor + def init(device) + super(self).init(device) + self.endpoints = [ 1 ] + end + + ############################################################# + # read an attribute + # + def read_attribute(msg, endpoint, cluster, attribute) + # no match found, return that the attribute is unsupported + end + + ############################################################# + # Invoke a command + # + # returns a TLV object if successful, contains the response + # or an `int` to indicate a status + def invoke_request(msg, val, ctx) + # no match found, return that the command is unsupported + end +end +matter.Plugin_core = Matter_Plugin_core + \ No newline at end of file diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_core.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_core.be new file mode 100644 index 000000000..57f516825 --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_core.be @@ -0,0 +1,372 @@ +# +# Matter_Plugin_core.be - implements the core features that a Matter device must implemment +# +# 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 . +# + +# Matter plug-in for core behavior + +# dummy declaration for solidification +class Matter_Plugin end + +#@ solidify:Matter_Plugin_core,weak + +class Matter_Plugin_core : Matter_Plugin + ############################################################# + # Constructor + def init(device) + super(self).init(device) + self.endpoints = [ 0 ] + end + + ############################################################# + # read an attribute + # + def read_attribute(msg, endpoint, cluster, attribute) + var TLV = matter.TLV + + if cluster == 0x0030 # ========== GeneralCommissioning cluster 11.9 p.627 ========== + + if attribute == 0x0000 # ---------- Breadcrumb ---------- + return TLV.create_TLV(TLV.U8, msg.session.breadcrumb) + elif attribute == 0x0001 # ---------- BasicCommissioningInfo / BasicCommissioningInfo---------- + var bci = TLV.Matter_TLV_struct() + bci.add_TLV(0, TLV.U2, 60) # FailSafeExpiryLengthSeconds + bci.add_TLV(1, TLV.U2, 900) # MaxCumulativeFailsafeSeconds + return bci + elif attribute == 0x0002 # ---------- RegulatoryConfig / RegulatoryLocationType ---------- + return TLV.create_TLV(TLV.U1, 2) # 2 = IndoorOutdoor | esp-matter = 0 + elif attribute == 0x0003 # ---------- LocationCapability / RegulatoryLocationType---------- + return TLV.create_TLV(TLV.U1, 2) # 2 = IndoorOutdoor + elif attribute == 0x0004 # ---------- SupportsConcurrentConnection / bool ---------- + return TLV.create_TLV(TLV.BOOL, false) # false - maybe can set to true + end + # ==================================================================================================== + elif cluster == 0x0032 # ========== Diagnostic Logs Cluster 11.10 p.637 ========== + # no attributes + + # ==================================================================================================== + elif cluster == 0x0033 # ========== General Diagnostics Cluster 11.11 p.642 ========== + + if attribute == 0x0000 # ---------- NetworkInterfaces ---------- + var nwi = TLV.Matter_TLV_list() # TODO list network interfaces, empty list for now + return nwi + elif attribute == 0x0001 # ---------- RebootCount u16 ---------- + return TLV.create_TLV(TLV.U2, tasmota.cmd("Status 1")['StatusPRM']['BootCount']) + elif attribute == 0x0002 # ---------- UpTime u16 ---------- + return TLV.create_TLV(TLV.U4, tasmota.cmd("Status 11")['StatusSTS']['UptimeSec']) + # TODO add later other attributes + elif attribute == 0x0008 # ---------- TestEventTriggersEnabled bool ---------- + return TLV.create_TLV(TLV.BOOL, false) # false - maybe can set to true + end + + # ==================================================================================================== + elif cluster == 0x0034 # ========== Software Diagnostics Cluster 11.12 p.654 ========== + # no mandatory attributes - to be added later (maybe) + + # ==================================================================================================== + elif cluster == 0x0038 # ========== Time Synchronization 11.16 p.689 ========== + if attribute == 0x0000 # ---------- UTCTime / epoch_us ---------- + var epoch_us = int64(tasmota.rtc()['utc']) * int64(1000000) + return TLV.create_TLV(TLV.U8, epoch_us) # TODO test the conversion of int64() + elif attribute == 0x0001 # ---------- Granularity / enum ---------- + return TLV.create_TLV(TLV.U1, 3) # MillisecondsGranularity (NTP every hour, i.e. 36ms max drift) + # TODO add some missing args + elif attribute == 0x0007 # ---------- LocalTime / epoch_us ---------- + var epoch_us = int64(tasmota.rtc()['local']) * int64(1000000) + return TLV.create_TLV(TLV.U8, epoch_us) # TODO test the conversion of int64() + end + + # ==================================================================================================== + elif cluster == 0x003E # ========== Node Operational Credentials Cluster 11.17 p.704 ========== + + if attribute == 0x0000 # ---------- NOCs / list[NOCStruct] ---------- + # TODO + elif attribute == 0x0001 # ---------- Fabrics / list[FabricDescriptorStruct] ---------- + # TODO + elif attribute == 0x0002 # ---------- SupportedFabrics / u1 ---------- + return TLV.create_TLV(TLV.U1, 5) # Max 5 fabrics + elif attribute == 0x0003 # ---------- CommissionedFabrics / u1 ---------- + return TLV.create_TLV(TLV.U1, 1) # TODO + elif attribute == 0x0004 # ---------- TrustedRootCertificates / list[octstr] ---------- + # TODO + elif attribute == 0x0005 # ---------- Current­ FabricIndex / u1 ---------- + # TODO + end + + # ==================================================================================================== + elif cluster == 0x003C # ========== Administrator Commissioning Cluster 11.18 p.725 ========== + # TODO + + # ==================================================================================================== + elif cluster == 0x0028 # ========== Basic Information Cluster cluster 11.1 p.565 ========== + + if attribute == 0x0000 # ---------- DataModelRevision / u16 ---------- + return TLV.create_TLV(TLV.U2, 0) + elif attribute == 0x0001 # ---------- VendorName / string ---------- + return TLV.create_TLV(TLV.UTF1, "Tasmota") + elif attribute == 0x0002 # ---------- VendorID / vendor-id ---------- + return TLV.create_TLV(TLV.U2, self.device.vendorid) # Vendor ID reserved for development + elif attribute == 0x0003 # ---------- ProductName / string ---------- + return TLV.create_TLV(TLV.UTF1, tasmota.cmd("DeviceName")['DeviceName']) + elif attribute == 0x0004 # ---------- ProductID / u16 (opt) ---------- + return TLV.create_TLV(TLV.U2, 32768) # taken from esp-matter example + elif attribute == 0x0005 # ---------- NodeLabel / string ---------- + return TLV.create_TLV(TLV.UTF1, tasmota.cmd("FriendlyName")['FriendlyName1']) + elif attribute == 0x0006 # ---------- Location / string ---------- + return TLV.create_TLV(TLV.UTF1, "XX") # no location + elif attribute == 0x0007 # ---------- HardwareVersion / u16 ---------- + return TLV.create_TLV(TLV.U2, 0) + elif attribute == 0x0008 # ---------- HardwareVersionString / string ---------- + return TLV.create_TLV(TLV.UTF1, tasmota.cmd("Status 2")['StatusFWR']['Hardware']) + elif attribute == 0x0009 # ---------- SoftwareVersion / u32 ---------- + return TLV.create_TLV(TLV.U2, 0) + elif attribute == 0x000A # ---------- SoftwareVersionString / string ---------- + return TLV.create_TLV(TLV.UTF1, tasmota.cmd("Status 2")['StatusFWR']['Version']) + end + + # ==================================================================================================== + elif cluster == 0x003F # ========== Group Key Management Cluster 11.2 p.572 ========== + # TODO + + # ==================================================================================================== + elif cluster == 0x002B # ========== Localization Configuration Cluster 11.3 p.580 ========== + + if attribute == 0x0000 # ---------- ActiveLocale / string ---------- + return TLV.create_TLV(TLV.UTF1, tasmota.locale()) + elif attribute == 0x0001 # ---------- SupportedLocales / list[string] ---------- + var locl = TLV.Matter_TLV_list() + locl.add_TLV(nil, TLV.UTF1, tasmota.locale()) + return locl + end + + # ==================================================================================================== + elif cluster == 0x002C # ========== Time Format Localization Cluster 11.4 p.581 ========== + + if attribute == 0x0000 # ---------- HourFormat / HourFormat ---------- + return TLV.create_TLV(TLV.U1, 1) # 1 = 24hr + elif attribute == 0x0001 # ---------- ActiveCalendarType / CalendarType ---------- + return TLV.create_TLV(TLV.U1, 4) # 4 = Gregorian + elif attribute == 0x0002 # ---------- SupportedCalendarTypes / list[CalendarType] ---------- + var callist = TLV.Matter_TLV_list() + callist.add_TLV(nil, TLV.create_TLV(TLV.U1, 4)) + return callist + end + + # ==================================================================================================== + elif cluster == 0x0031 # ========== Network Commissioning Cluster cluster 11.8 p.606 ========== + if attribute == 0x0003 # ---------- ConnectMaxTimeSeconds / uint8 ---------- + return TLV.create_TLV(TLV.U1, 30) # 30 - value taking from example in esp-matter + elif attribute == 0xFFFC # ---------- FeatureMap / map32 ---------- + return TLV.create_TLV(TLV.U4, 0) # 15s ??? TOOD what should we put here? + end + end + # no match found, return that the attribute is unsupported + end + + ############################################################# + # Invoke a command + # + # returns a TLV object if successful, contains the response + # or an `int` to indicate a status + def invoke_request(msg, val, ctx) + import crypto + var TLV = matter.TLV + var cluster = ctx.cluster + var command = ctx.command + var session = msg.session + if cluster == 0x0030 # ========== GeneralCommissioning cluster 11.9 p.627 ========== + + if command == 0x0000 # ---------- ArmFailSafe ---------- + # create ArmFailSafeResponse + # ID=1 + # 0=ErrorCode (OK=0) + # 1=DebugText + var ExpiryLengthSeconds = val.findsubval(0, 900) + var Breadcrumb = val.findsubval(1, 0) + session.breadcrumb = Breadcrumb + + var afsr = TLV.Matter_TLV_struct() + afsr.add_TLV(0, TLV.U1, 0) # ErrorCode = OK + afsr.add_TLV(1, TLV.UTF1, "") # DebugText = "" + ctx.command = 0x01 # ArmFailSafeResponse + return afsr + + elif command == 0x0002 # ---------- SetRegulatoryConfig ---------- + var NewRegulatoryConfig = val.findsubval(0) # RegulatoryLocationType Enum + var CountryCode = val.findsubval(1, "XX") + var Breadcrumb = val.findsubval(2, 0) + session.breadcrumb = Breadcrumb + # create SetRegulatoryConfigResponse + # ID=1 + # 0=ErrorCode (OK=0) + # 1=DebugText + var srcr = TLV.Matter_TLV_struct() + srcr.add_TLV(0, TLV.U1, 0) # ErrorCode = OK + srcr.add_TLV(1, TLV.UTF1, "") # DebugText = "" + ctx.command = 0x03 # SetRegulatoryConfigResponse + return srcr + + elif command == 0x0004 # ---------- CommissioningComplete p.636 ---------- + # no data + session.breadcrumb = 0 # clear breadcrumb + session.set_no_expiration() + + # create CommissioningCompleteResponse + # ID=1 + # 0=ErrorCode (OK=0) + # 1=DebugText + var ccr = TLV.Matter_TLV_struct() + ccr.add_TLV(0, TLV.U1, 0) # ErrorCode = OK + ccr.add_TLV(1, TLV.UTF1, "") # DebugText = "" + ctx.command = 0x05 # CommissioningCompleteResponse + + self.device.start_commissioning_complete_deferred(session) + return ccr # trigger a standalone ack + end + + elif cluster == 0x003E # ========== Node Operational Credentials Cluster 11.17 p.704 ========== + + if command == 0x0002 # ---------- CertificateChainRequest ---------- + var CertificateType = val.findsubval(0) # CertificateChainType Enum 1=DACCertificate 2=PAICertificate + if CertificateType != 1 && CertificateType != 2 + ctx.status = matter.UNSUPPORTED_COMMAND + return nil + end + # create CertificateChainResponse + # ID=1 + # 0=Certificate (octstr) + var ccr = TLV.Matter_TLV_struct() + ccr.add_TLV(0, TLV.B2, CertificateType == 1 ? matter.DAC_Cert_FFF1_8000() : matter.PAI_Cert_FFF1()) # send DAC_Cert_FFF1_8000 or PAI_Cert_FFF1 + ctx.command = 0x03 # CertificateChainResponse + return ccr + + elif command == 0x0000 # ---------- AttestationRequest ---------- + var AttestationNonce = val.findsubval(0) # octstr + if size(AttestationNonce) != 32 return nil end # check size on nonce + ctx.command = 0x01 # AttestationResponse + + # build Attestation Elements 11.17.5.4 p.707 + var att_elts = TLV.Matter_TLV_struct() + att_elts.add_TLV(1, TLV.B2, matter.CD_FFF1_8000()) # certification_declaration + att_elts.add_TLV(2, TLV.B1, AttestationNonce) # attestation_nonce + att_elts.add_TLV(3, TLV.U4, tasmota.rtc()['utc']) # timestamp in epoch-s + var attestation_message = att_elts.encode() + + var ac = session.get_ac() + var attestation_tbs = attestation_message + ac + tasmota.log("MTR: attestation_tbs=" + attestation_tbs.tohex(), 3) + + var attestation_signature = crypto.EC_P256().ecdsa_sign_sha256(matter.DAC_Priv_FFF1_8000(), attestation_tbs) + + # create AttestationResponse + # 0=AttestationElements (octstr max 900 bytes) + # 1=AttestationSignature (octstr 64) + var ar = TLV.Matter_TLV_struct() + ar.add_TLV(0, TLV.B2, attestation_message) # AttestationElements + ar.add_TLV(1, TLV.B1, attestation_signature) # AttestationElements + ctx.command = 0x01 # AttestationResponse + return ar + + elif command == 0x0004 # ---------- CSRRequest ---------- + var CSRNonce = val.findsubval(0) # octstr 32 + if size(CSRNonce) != 32 return nil end # check size on nonce + var IsForUpdateNOC = val.findsubval(1, false) # bool + + var csr = session.gen_CSR() + + var nocsr_elements = TLV.Matter_TLV_struct() + nocsr_elements.add_TLV(1, TLV.B2, csr) + nocsr_elements.add_TLV(2, TLV.B1, CSRNonce) + var nocsr_elements_message = nocsr_elements.encode() + # sign with attestation challenge + var nocsr_tbs = nocsr_elements_message + session.get_ac() + tasmota.log("MTR: nocsr_tbs=" + nocsr_tbs.tohex(), 3) + var attestation_signature = crypto.EC_P256().ecdsa_sign_sha256(matter.DAC_Priv_FFF1_8000(), nocsr_tbs) + + # create CSRResponse + # 0=NOCSRElements (octstr max 900 bytes) + # 1=AttestationSignature (octstr 64) + var csrr = TLV.Matter_TLV_struct() + csrr.add_TLV(0, TLV.B2, nocsr_elements_message) # AttestationElements + csrr.add_TLV(1, TLV.B1, attestation_signature) # AttestationElements + ctx.command = 0x05 # CSRResponse + return csrr + + elif command == 0x000B # ---------- AddTrustedRootCertificate ---------- + var RootCACertificate = val.findsubval(0) # octstr 400 max + session.set_ca(RootCACertificate) + tasmota.log("MTR: received ca_root="+RootCACertificate.tohex(), 3) + ctx.status = matter.SUCCESS # OK + return nil # trigger a standalone ack + + elif command == 0x0006 # ---------- AddNOC ---------- + var NOCValue = val.findsubval(0) # octstr max 400 + var ICACValue = val.findsubval(1) # octstr max 400 + var IpkValue = val.findsubval(2) # octstr max 16 + var CaseAdminSubject = val.findsubval(3) + var AdminVendorId = val.findsubval(4) + + if session.get_ca() == nil + tasmota.log("MTR: Error: AdNOC without CA", 2) + return nil + end + + session.set_noc(NOCValue, ICACValue) + session.set_ipk_epoch_key(IpkValue) + session.admin_subject = CaseAdminSubject + session.admin_vendor = AdminVendorId + + # extract important information from NOC + var noc_cert = matter.TLV.parse(NOCValue) + var dnlist = noc_cert.findsub(6) + var fabric = dnlist.findsubval(21) + var deviceid = dnlist.findsubval(17) + if !fabric || !deviceid + tasmota.log("MTR: Error: no fabricid nor deviceid in NOC certificate", 2) + return false + end + # convert fo bytes(8) + if type(fabric) == 'int' fabric = int64(fabric).tobytes() else fabric = fabric.tobytes() end + if type(deviceid) == 'int' deviceid = int64(deviceid).tobytes() else deviceid = deviceid.tobytes() end + + var root_ca = matter.TLV.parse(session.get_ca()).findsubval(9) # extract public key from ca + root_ca = root_ca[1..] # remove first byte as per Matter specification + var info = bytes().fromstring("CompressedFabric") # as per spec, 4.3.2.2 p.99 + var hk = crypto.HKDF_SHA256() + var fabric_rev = fabric.copy().reverse() + var k_fabric = hk.derive(root_ca, fabric_rev, info, 8) + session.set_fabric_device(fabric, deviceid, k_fabric) + + # move to next step + self.device.start_operational_dicovery_deferred(session) + # create NOCResponse + # 0=StatusCode + # 1=FabricIndex (1-254) (opt) + # 2=DebugText (opt) + var nocr = TLV.Matter_TLV_struct() + nocr.add_TLV(0, TLV.U1, matter.SUCCESS) # Status + nocr.add_TLV(1, TLV.U1, 1) # fabric-index + ctx.command = 0x08 # NOCResponse + return nocr + + end + end + + end +end +matter.Plugin_core = Matter_Plugin_core + \ No newline at end of file diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Session.be b/lib/libesp32/berry_matter/src/embedded/Matter_Session.be new file mode 100644 index 000000000..8c1f56235 --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Session.be @@ -0,0 +1,574 @@ +# +# Matter_Session.be - Support for Matter Sessions and Session Store +# +# 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 + +#@ solidify:Matter_Session,weak +#@ solidify:Matter_Session_Store,weak + +################################################################################# +# Matter_Session class +# +# Session is refered by remote_session_id once a session is established +# It can also be retrived by `source_node_id` when `local_session_id` is 0 +# +# By convention, names starting with `_` are not persisted +################################################################################# +class Matter_Session + static var __PASE = 1 # PASE authentication in progress + static var __CASE = 2 # CASE authentication in progress + var __store # reference back to session store + # mode for Session. Can be PASE=1, CASE=2, Established=10 none=0 + var mode + # sesions + var local_session_id # id for the current local session, starts with 1 + var initiator_session_id # id used to respond to the initiator + var session_timestamp # timestamp (UTC) when the session was created + var source_node_id # source node if bytes(8) (opt, used only when session is not established) + # session_ids when the session will be active + var _future_initiator_session_id + var _future_local_session_id + # counters + var counter_rcv # counter for incoming messages + var counter_snd # counter for outgoing messages + # non-session counters + var _counter_insecure_rcv # counter for incoming messages + var _counter_insecure_snd # counter for outgoing messages + # encryption keys and challenges + var i2rkey # key initiator to receiver (incoming) + var r2ikey # key receiver to initiator (outgoing) + var attestation_challenge # Attestation challenge + var peer_node_id + # breadcrumb + var breadcrumb # breadcrumb attribute for this session + # our own private key + var no_private_key # private key of the device certificate (generated at commissioning) + # NOC information + var root_ca_certificate # root certificate of the initiator + var noc # Node Operational Certificate in TLV Matter Certificate + var icac # Initiator CA Certificate in TLV Matter Certificate + var ipk_epoch_key # timestamp + # CASE + var resumption_id # bytes(16) + var shared_secret # ECDH shared secret used in CASE + # Information extracted from `noc` + var fabric # fabric identifier as bytes(8) little endian + var fabric_compressed # comrpessed fabric identifier, hashed with root_ca public key + var deviceid # our own device id bytes(8) little endian + # Admin info extracted from NOC/ICAC + var admin_subject + var admin_vendor + # Previous CASE messages for Transcript hash + var _Msg1, _Msg2 + # Expiration + var _persist # do we persist this sessions or is it remporary + var expiration # if not `nil` the entry is removed after this timestamp + + # Group Key Derivation + static var __GROUP_KEY = "GroupKey v1.0" # starting with double `_` means it's not writable + + ############################################################# + def init(store, local_session_id, initiator_session_id) + self.__store = store + self.mode = 0 + self.local_session_id = local_session_id + self.initiator_session_id = initiator_session_id + self.counter_rcv = matter.Counter() + self.counter_snd = matter.Counter() + self._counter_insecure_rcv = matter.Counter() + self._counter_insecure_snd = matter.Counter() + self.breadcrumb = int64() + end + + ############################################################# + # Close the current PASE/CASE session to be re-negociated + # + def close() + # close the PASE session, it will be re-opened with a CASE session + var persist_save = self._persist + self.local_session_id = self._future_local_session_id + self.initiator_session_id = self._future_initiator_session_id + self.source_node_id = nil + self.counter_rcv.reset() + self.counter_snd.reset() + self.i2rkey = nil + self.r2ikey = nil + self.attestation_challenge = nil + # clear any attribute starting with `_` + import introspect + for k : introspect.members(self) + var v = introspect.get(self, k) + if type(v) != 'function' && type(v) != 'instance' && k[0] == '_' && k[1] != '_' + self.(k) = nil + end + end + self._persist = persist_save + # self._future_initiator_session_id = nil + # self._future_local_session_id = nil + end + + ############################################################# + def set_mode(mode) + self.mode = mode + end + def set_keys(i2r, r2i, ac, st) + self.i2rkey = i2r + self.r2ikey = r2i + self.attestation_challenge = ac + self.session_timestamp = st + end + def set_ca(ca) + self.root_ca_certificate = ca + end + def set_noc(noc, icac) + self.noc = noc + self.icac = icac + end + def set_ipk_epoch_key(ipk_epoch_key) + self.ipk_epoch_key = ipk_epoch_key + end + def set_fabric_device(fabric, deviceid, fc) + self.fabric = fabric + self.deviceid = deviceid + self.fabric_compressed = fc + self.__store.remove_redundant_session(self) + end + def set_persist(p) + self._persist = bool(p) + end + + ############################################################# + def get_mode() + return self.mode + end + def get_i2r() + return self.i2rkey + end + def get_r2i() + return self.r2ikey + end + def get_ac() + return self.attestation_challenge + end + def get_ca() + return self.root_ca_certificate + end + def get_ca_pub() + if self.root_ca_certificate + var m = matter.TLV.parse(self.root_ca_certificate) + return m.findsubval(9) + end + end + def get_noc() return self.noc end + def get_icac() return self.icac end + def get_ipk_epoch_key() return self.ipk_epoch_key end + def get_fabric() return self.fabric end + def get_deviceid() return self.deviceid end + def get_fabric_compressed() return self.fabric_compressed end + + ############################################################# + # Generate a private key (or retrieve it) + def get_pk() + if !self.no_private_key + import crypto + self.no_private_key = crypto.random(32) + end + return self.no_private_key + end + + ############################################################# + # Operational Group Key Derivation, 4.15.2, p.182 + def get_ipk_group_key() + if self.ipk_epoch_key == nil || self.fabric_compressed == nil return nil end + import crypto + var hk = crypto.HKDF_SHA256() + var info = bytes().fromstring(self.__GROUP_KEY) + var hash = hk.derive(self.ipk_epoch_key, self.fabric_compressed, info, 16) + return hash + end + + ############################################################# + # set absolute time for expiration + def set_no_expiration() + self.expiration = nil + end + + ############################################################# + # set absolute time for expiration + def set_expire_time(t) + self.expiration = int(t) + end + + ############################################################# + # set relative time in the future for expiration (in seconds) + def set_expire_in_seconds(s, now) + if s == nil return end + if now == nil now = tasmota.rtc()['utc'] end + self.set_expire_time(now + s) + end + + ############################################################# + # set relative time in the future for expiration (in seconds) + # returns `true` if expiration date has been reached + def has_expired(now) + if now == nil now = tasmota.rtc()['utc'] end + if self.expiration != nil + return now >= self.expiration + end + return false + end + + ############################################################# + # to_json() + # + # convert a single entry as json + # returns a JSON string + ############################################################# + def tojson() + import json + import string + import introspect + + var keys = [] + for k : introspect.members(self) + var v = introspect.get(self, k) + if type(v) != 'function' && k[0] != '_' keys.push(k) end + end + keys = matter.sort(keys) + + var r = [] + for k : keys + var v = introspect.get(self, k) + if v == nil continue end + + if k == "counter_rcv" v = v.val() + elif k == "counter_snd" v = v.val() + 256 # take a margin to avoid reusing the same counter + end + + if isinstance(v, bytes) v = "$$" + v.tob64() end # bytes + # if isinstance(v, bytes) v = "0x" + v.tohex() end + + # if type(v) == 'string' v = string.escape(v, true) end + r.push(string.format("%s:%s", json.dump(str(k)), json.dump(v))) + end + return "{" + r.concat(",") + "}" + end + + ############################################################# + # fromjson() + # + # reads a map and load arguments + # returns an new instance of session + ############################################################# + static def fromjson(store, values) + import string + import introspect + var self = matter.Session(store) + + for k:values.keys() + var v = values[k] + if k == "counter_rcv" self.counter_rcv.reset(int(v)) + elif k == "counter_snd" self.counter_snd.reset(int(v)) + else + # standard values + if type(v) == 'string' + if string.find(v, "0x") == 0 # treat as bytes + introspect.set(self, k, bytes().fromhex(v[2..])) + elif string.find(v, "$$") == 0 # treat as bytes + introspect.set(self, k, bytes().fromb64(v[2..])) + else + introspect.set(self, k, v) + end + else + introspect.set(self, k, v) + end + end + end + + return self + end + + ############################################################# + # Callback to Session store + def save() + self.__store.save() + end + + ############################################################# + def gen_CSR() + # Create CSR + # See 6.4.7. Node Operational Certificate Signing Request (NOCSR) p.302 + var pk = self.get_pk() # private key of device + + # Example + # 3081CA + # 3070020100300E310C300A060355040A0C034353523059301306072A8648CE3D020106082A8648CE3D030107 + # PubKey=034200.043AEFB8D1F25813BE355920577971814827B24F2784A729297F88FBD998A59D29D439604678C42D2FA5DE4E9402C30376015E05DF0AD4A8737DCD4E6D03B11CF5 + # A000 + # 300C06082A8648CE3D0403020500 + # 034800 + # ECDSA=3045022054907C4F096B30EFEB56190E0F2AFAEE447991C927003185AD044D1A971BDEDD02210088FB7E44116FBD7DE5277890A3F3BC26ACC35441DF04FD0BBF02A369E751241D + + import crypto + var ec256 = crypto.EC_P256() + var pub = ec256.public_key(pk) + + var seg1 = bytes("3070020100300E310C300A060355040A0C034353523059301306072A8648CE3D020106082A8648CE3D030107034200") + seg1 .. pub + seg1 .. bytes("A000") + var seg2 = bytes("300C06082A8648CE3D0403020500") # not mutable + # compute signature in ECDSA format + var sig = ec256.ecdsa_sign_sha256_asn1(pk, seg1) + var seg3 = bytes(128) + seg3.add(0x03, 1) + seg3.add(size(sig)+1, 1) + seg3.add(0x00, 1) + seg3 .. sig + # construct the global csr + var seg_123_size = size(seg1) + size(seg2) + size(seg3) + var csr = bytes(208) + csr.add(0x30, 1) + csr.add(0x81, 1) + csr.add(seg_123_size & 0xFF, 1) + csr .. seg1 + csr .. seg2 + csr .. seg3 + return csr + end + +end +matter.Session = Matter_Session + + +################################################################################# +# Matter_Session_Store class +################################################################################# +class Matter_Session_Store + var sessions + static var FILENAME = "_matter_sessions.json" + + ############################################################# + def init() + self.sessions = [] + end + + ############################################################# + # add session + def create_session(local_session_id, initiator_session_id) + var session = self.get_session_by_local_session_id(local_session_id) + if session != nil self.remove_session(session) end + session = matter.Session(self, local_session_id, initiator_session_id) + self.sessions.push(session) + return session + end + + ############################################################# + # add session + def add_session(s, expires_in_seconds) + if expires_in_seconds != nil + s.set_expire_in_seconds(expires_in_seconds) + end + self.sessions.push(s) + end + + ############################################################# + def get_session_by_local_session_id(id) + if id == nil return nil end + var sz = size(self.sessions) + var i = 0 + var sessions = self.sessions + while i < sz + if sessions[i].local_session_id == id return sessions[i] end + i += 1 + end + end + + ############################################################# + def get_session_by_source_node_id(nodeid) + if nodeid == nil return nil end + var sz = size(self.sessions) + var i = 0 + var sessions = self.sessions + while i < sz + if sessions[i].source_node_id == nodeid return sessions[i] end + i += 1 + end + end + + ############################################################# + # Remove session by reference + # + def remove_session(s) + var i = 0 + var sessions = self.sessions + while i < size(self.sessions) + if sessions[i] == s + sessions.remove(i) + else + i += 1 + end + end + end + + ############################################################# + # Remove session by reference + # + # remove all other sessions that have the same: + # fabric / deviceid / fc + def remove_redundant_session(s) + var i = 0 + var sessions = self.sessions + while i < size(self.sessions) + var session = sessions[i] + if session != s && session.fabric == s.fabric && session.deviceid == s.deviceid #- && session.fabric_compressed == s.fabric_compressed -# + sessions.remove(i) + else + i += 1 + end + end + end + + ############################################################# + # Generate a new local_session_id + def gen_local_session_id() + import crypto + while true + var candidate_local_session_id = crypto.random(2).get(0, 2) + + if self.get_session_by_local_session_id(candidate_local_session_id) == nil + return candidate_local_session_id + end + + end + end + + ############################################################# + # remove_expired + # + # Check is any session has expired + def remove_expired() + var dirty = false + var i = 0 + var sessions = self.sessions + while i < size(self.sessions) + if sessions[i].has_expired() + if sessions[i]._persist dirty = true end # do we need to save + sessions.remove(i) + else + i += 1 + end + end + if dirty self.save() end + end + def every_second() + self.remove_expired() + end + + ############################################################# + # find or create a session for unencrypted traffic + # expires in `expire` seconds + def find_session_source_id_unsecure(source_node_id, expire) + var session = self.get_session_by_source_node_id(source_node_id) + if session == nil + session = matter.Session(self, 0, 0) + session.source_node_id = source_node_id + self.sessions.push(session) + end + session.set_expire_in_seconds(expire) + return session + end + + ############################################################# + def save() + import json + self.remove_expired() # clean before saving + + var j = [] + for v:self.sessions + if v._persist + j.push(v.tojson()) + end + end + var j_size = size(j) + j = "[" + j.concat(",") + "]" + + try + import string + var f = open(self.FILENAME, "w") + f.write(j) + f.close() + tasmota.log(string.format("MTR: Saved %i session(s)", j_size), 2) + return j + except .. as e, m + tasmota.log("MTR: Session_Store::save Exception:" + str(e) + "|" + str(m), 2) + return j + end + end + + ############################################################# + def load() + import string + try + self.sessions = [] # remove any left-over + var f = open(self.FILENAME) + var s = f.read() + f.close() + + import json + var j = json.load(s) + s = nil + tasmota.gc() # clean-up a potential long string + + for v:j # iterate on values + var session = matter.Session.fromjson(self, v) + if session != nil + self.add_session(session) + end + end + + tasmota.log(string.format("MTR: Loaded %i session(s)", size(self.sessions)), 2) + except .. as e, m + if e != "io_error" + tasmota.log("MTR: Session_Store::load Exception:" + str(e) + "|" + str(m), 2) + end + end + self.remove_expired() # clean after load + end +end +matter.Session_Store = Matter_Session_Store + +#- + +# Unit test +var s = Matter_Session(1,2) +s.counter_rcv.validate(0x100, false) +s.counter_snd.validate(0x1000, false) +s.source_node_id = bytes("1122334455667788") +assert(s.tojson() == '{"breadcrumb":"0","counter_rcv":256,"counter_snd":4352,"initiator_session_id":2,"local_session_id":1,"source_node_id":"0x1122334455667788"}') + +var ss = Matter_Session_Store() +ss.add_session(s) +var j = ss.save() +assert(j == '{"1":{"breadcrumb":"0","counter_rcv":256,"counter_snd":4352,"initiator_session_id":2,"local_session_id":1,"source_node_id":"0x1122334455667788"}}') + + +var ss = Matter_Session_Store() +ss.load() + +-# diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_TLV.be b/lib/libesp32/berry_matter/src/embedded/Matter_TLV.be new file mode 100644 index 000000000..58a1e8e13 --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_TLV.be @@ -0,0 +1,874 @@ +# +# Matter_TLV.be - implements the encoding and decoding of Matter TLV structures (Tag/Lenght/Value) Appendix A. +# +# 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 . +# + +# Support for Matter Protocol: TLV encoding and decoding + +import matter + +#@ solidify:Matter_TLV.Matter_TLV_item,weak +#@ solidify:Matter_TLV.Matter_TLV_list,weak +#@ solidify:Matter_TLV.Matter_TLV_struct,weak +#@ solidify:Matter_TLV.Matter_TLV_array,weak +#@ solidify:Matter_TLV,weak + +class Matter_TLV + static var _type = [ + 'i1', 'i2', 'i4', 'i8', 'u1', 'u2', 'u4', 'u8', # signed and unsigned 0x00-0x07 + 'bool', 'bool', 'float', 'double', # 0x08-0x0B + 'UTF1', 'UTF2', 'UTF4', 'UTF8', # 0x0C-0x0F + 'b1', 'b2', 'b4', 'b8', # 0x10-0x13 + 'null', 'struct', 'array', 'list', 'end' # 0x14-0x18 + # all other are reserved +] + + static var _len = [ + 1, 2, 4, 8, 1, 2, 4, 8, + 0, 0, 4, 8, + -1, -2, -4, -8, + -1, -2, -4, -8, + 0, -99, -99, -99, 0 + ] + + # type values (enum like) + static var I1 = 0x00 + static var I2 = 0x01 + static var I4 = 0x02 + static var I8 = 0x03 + static var U1 = 0x04 + static var U2 = 0x05 + static var U4 = 0x06 + static var U8 = 0x07 + static var BOOL = 0x08 # when encoding, use indifferentiate + static var BFALSE = 0x08 + static var BTRUE = 0x09 + static var FLOAT = 0x0A + static var DOUBLE = 0x0B + static var UTF1 = 0x0C + static var UTF2 = 0x0D + static var UTF4 = 0x0E + static var UTF8 = 0x0F + static var B1 = 0x10 + static var B2 = 0x11 + static var B4 = 0x12 + static var B8 = 0x13 + static var NULL = 0x14 + static var STRUCT = 0x15 + static var ARRAY = 0x16 + static var LIST = 0x17 + static var EOC = 0x18 + + ################################################################################# + # Matter_TLV_item class + ################################################################################# + static class Matter_TLV_item + # we keep a shortcut reference to the Matter_TLV class + static var TLV = Matter_TLV + # parent tag to inherit vendor/profile/tag + var parent + var next_idx # next idx in buffer (when parsing) + # tags + var tag_vendor # 16 bit VendorID [opt] + var tag_profile # 16 bit profile number [opt] + var tag_number # 32 bit tag number + var tag_sub # context specific tag 8 bit [opt] + # type + var typ # TLV type number, set at decoding, mandatory for encoding + # value + var val # multi-type: int, float, bool, bytes, map, list + + ############################################################# + # constructor + def init(parent) + self.parent = parent + end + + ############################################################# + # neutral converter + def to_TLV() + return self + end + + ############################################################# + # create simple TLV + static def create_TLV(t, value) + if value != nil + var v = _class() # parent is nil + v.typ = t + v.val = value + return v + end + end + + ############################################################# + # tostring + # + # We are trying to follow the official Matter way of printing TLV + # Ex: '42U' or '1 = 42U' or '0xFFF1::0xDEED:0xAA55FEED = 42U' + def tostring() + import string + # var s = " 0 s += "= " end + + # print value + if type(self.val) == 'int' s += string.format("%i", self.val) + if self.typ >= self.TLV.U1 && self.typ <= self.TLV.U8 s += "U" end + elif type(self.val) == 'bool' s += self.val ? "true" : "false" + elif self.val == nil s += "null" + elif type(self.val) == 'real' s += string.format("%g", self.val) + elif type(self.val) == 'string' s += string.format('"%s"', self.val) + elif isinstance(self.val, int64) s += self.val.tostring() + if self.typ >= self.TLV.U1 && self.typ <= self.TLV.U8 s += "U" end + elif type(self.val) == 'instance' + s += string.format("%s", self.val.tohex()) + end + + except .. as e, m + return e + " " + m + end + return s + end + + ############################################################# + # parse a bytes() array from `idx` + # args: + # b: bytes() buffer + # idx: starting index in the bytes() buffer + # parent: (optional) the parent object to inherit tag values + # + # returns the next `idx` for the item following or `-1` if error + # The next `idx` is also stored in `self.next_idx` + def parse(b, idx) + var item_type = self.typ + # parse LV + var TLV = self.TLV # cache value in register + var item_len = TLV._len[item_type] + + if item_len == 8 # i64 / u64 / double + self.val = int64() + self.val.frombytes(b, idx) + idx += 8 + elif item_type == TLV.BFALSE || item_type == TLV.BTRUE # bool + self.val = (item_type == TLV.BTRUE) + elif item_type < TLV.U8 # i1/i2/i4 u1/u2/u4 + self.val = item_type <= TLV.I8 ? b.geti(idx, item_len) : b.get(idx, item_len) + idx += item_len + elif item_type == TLV.FLOAT # float + self.val = b.getfloat(idx) + idx += 4 + elif item_len >= -8 && item_len <= -1 # len prefix 1/2/4/8 + # TODO skip len == 8 for now + var b_len = b.get(idx, -item_len) + idx += -item_len + self.val = b[idx .. idx + b_len - 1] + idx += b_len + if (item_type <= TLV.UTF8) self.val = self.val.asstring() end + elif item_type == TLV.NULL # null + # do nothing + elif item_type == TLV.EOC + tasmota.log("MTR: unexpected eoc", 3) + else + tasmota.log("MTR: unexpected type: " + str(item_type), 3) + end + self.next_idx = idx + return idx + end + + ############################################################# + # encode TLV + # + # appends to the bytes() object + def encode(b) + var TLV = self.TLV + if b == nil b = bytes() end # start new buffer if none passed + + # special case for bool + # we need to change the type according to the value + if self.typ == TLV.BFALSE || self.typ == TLV.BTRUE + self.typ = bool(self.val) ? TLV.BTRUE : TLV.BFALSE + # try to compress ints + elif self.typ >= TLV.I2 && self.typ <= TLV.I4 + var i = int(self.val) + if i <= 127 && i >= -128 self.typ = TLV.I1 + elif i <= 32767 && i >= -32768 self.typ = TLV.I2 + end + elif self.typ >= TLV.U2 && self.typ <= TLV.U4 + var i = int(self.val) + if i <= 255 && i >= 0 self.typ = TLV.U1 + elif i <= 65535 && i >= 0 self.typ = TLV.U2 + end + elif self.typ >= TLV.B1 && self.typ <= TLV.B8 # encode length as minimum possible + if size(self.val) <= 255 + self.typ = TLV.B1 + elif size(self.val) <= 65535 + self.typ = TLV.B2 + else + self.typ = TLV.B4 # B4 is unlikely, B8 is impossible + end + elif self.typ >= TLV.UTF1 && self.typ <= TLV.UTF8 + if size(self.val) <= 255 + self.typ = TLV.UTF1 + elif size(self.val) <= 65535 + self.typ = TLV.UTF2 + else + self.typ = TLV.UTF4 # UTF4 is unlikely, UTF8 is impossible + end + end + + # encode tag and type + self._encode_tag(b) + # encode value + + if self.typ == TLV.I1 || self.typ == TLV.U1 + b.add(int(self.val), 1) + elif self.typ == TLV.I2 || self.typ == TLV.U2 + b.add(int(self.val), 2) + elif self.typ == TLV.I4 || self.typ == TLV.U4 + b.add(int(self.val), 4) + elif self.typ == TLV.I8 || self.typ == TLV.U8 + var i64 = self.val + if !isinstance(i64, int64) + i64 = int64(int(self.val)) + end + b .. i64.tobytes() + elif self.typ == TLV.BFALSE || self.typ == TLV.BTRUE + # push nothing + elif self.typ == TLV.FLOAT + var idx = size(b) + b.add(0, 4) + b.setfloat(idx, real(self.val)) + elif self.typ == TLV.DOUBLE + raise "value_error", "Unsupported type TLV.DOUBLE" + elif self.typ == TLV.UTF1 + if size(self.val) > 255 raise "value_error", "string too big" end + b.add(size(self.val), 1) + b..bytes().fromstring(str(self.val)) + elif self.typ == TLV.UTF2 + if size(self.val) > 65535 raise "value_error", "string too big" end + b.add(size(self.val), 2) + b..bytes().frostring(str(self.val)) + elif self.typ == TLV.B1 + if size(self.val) > 255 raise "value_error", "bytes too big" end + b.add(size(self.val), 1) + b..self.val + elif self.typ == TLV.B2 + if size(self.val) > 65535 raise "value_error", "bytes too big" end + b.add(size(self.val), 2) + b..self.val + elif self.typ == TLV.NULL + # push nothing + else + raise "value_error", "unsupported type " + str(self.typ) + end + + return b + end + + ############################################################# + # internal_function + # encode Tag+Type as the first bytes + def _encode_tag(b) + var tag_number = self.tag_number != nil ? self.tag_number : 0 + var tag_huge = (tag_number >= 65536) || (tag_number < 0) + var tag_control = 0x00 + if self.tag_vendor != nil + # full encoding + if tag_huge + b.add(0xE0 + self.typ, 1) + b.add(self.tag_vendor, 2) + b.add(self.tag_profile, 2) + b.add(self.tag_number, 4) + else + b.add(0xC0 + self.typ, 1) + b.add(self.tag_vendor, 2) + b.add(self.tag_profile, 2) + b.add(self.tag_number, 2) + end + elif self.tag_profile == -1 # Matter Common profile + if tag_huge + b.add(0x60 + self.typ, 1) + b.add(self.tag_number, 4) + else + b.add(0x40 + self.typ, 1) + b.add(self.tag_number, 2) + end + elif self.tag_profile != nil + if tag_huge + b.add(0xA0 + self.typ, 1) + b.add(self.tag_number, 4) + else + b.add(0x80 + self.typ, 1) + b.add(self.tag_number, 2) + end + elif self.tag_sub != nil + b.add(0x20 + self.typ, 1) + b.add(self.tag_sub, 1) + else # anonymous tag + b.add(0x00 + self.typ, 1) + end + end + + ############################################################# + # Compare the value index with an element + # returns: + # 1 if self is strictly greater than k + # 0 if equal or lower + def _cmp_gt(k) + # compare tag_vendor + if self.tag_vendor != nil + if k.tag_vendor == nil return 1 end + if self.tag_vendor > k.tag_vendor return 1 end + if self.tag_vendor == k.tag_vendor + if self.tag_profile > k.tag_profile return 1 end + end + # continue to tag comparison + end + + # Matter common profile + if self.tag_profile == -1 + if k.tag_profile == nil return 1 end + elif self.tag_profile == nil + if k.tag_profile == -1 return 0 end + end + + if self.tag_number != nil + if k.tag_number == nil return 1 end + if self.tag_number > k.tag_number return 1 end + return 0 + end + + if self.tag_sub != nil + if k.tag_sub == nil return 1 end + if self.tag_sub > k.tag_sub return 1 end + end + + return 0 + end + + ################################################################################# + # Simple insertion sort - sorts the list in place, and returns the list + ################################################################################# + static def sort(l) + # insertion sort + for i:1..size(l)-1 + var k = l[i] + var j = i + while (j > 0) && (l[j-1]._cmp_gt(k) > 0) + l[j] = l[j-1] + j -= 1 + end + l[j] = k + end + return l + end + + ############################################################# + # set parent + def set_parent(parent) + self.parent = parent + end + + ############################################################# + # Setters for tags + def set_fulltag(vendor, profile, tag) + self.tag_vendor = int(vendor) + self.tag_profile = int(profile) + self.tag_number = int(tag) + self.tag_sub = nil + end + # set context specific + def set_anonymoustag() + self.set_fulltag() + end + # set common profile + def set_commonprofile() + self.set_fulltag(nil, -1, nil) + end + # set context specific + def set_contextspecific(n) + self.set_fulltag() + self.tag_sub = int(n) + end + end + +# class Matter_TLV_array var _ end +# class Matter_TLV_struct var _ end + + static class Matter_TLV_list : Matter_TLV_item + ################################################################################# + def init(parent) + super(self).init(parent) + self.typ = self.TLV.LIST + self.val = [] + end + + ################################################################################# + def tostring() + return self.tostring_inner(false, "[[", "]]") + end + + def tostring_inner(sorted, pre, post) + import string + var s = "" + try + + if self.tag_profile == -1 + s += "Matter::" + if self.tag_number != nil s += string.format("0x%08X ", self.tag_number) end + else + if self.tag_vendor != nil s += string.format("0x%04X::", self.tag_vendor) end + if self.tag_profile != nil s += string.format("0x%04X:", self.tag_profile) end + if self.tag_number != nil s += string.format("0x%08X ", self.tag_number) end + if self.tag_sub != nil s += string.format("%i ", self.tag_sub) end + end + + if size(s) > 0 s += "= " end + + s += pre + + # sort values + var val_list = self.val.copy() + if sorted + self.sort(val_list) + end + + s += val_list.concat(", ") + + s += post + + except .. as e, m + return e + " " + m + end + return s + end + + ################################################################################# + def parse(b, idx) + # iterate until end of struct + while b[idx] != self.TLV.EOC + # read next + var item = self.TLV.parse(b, idx, self) + idx = item.next_idx + + self.val.push(item) + end + idx += 1 + + self.next_idx = idx + return idx + end + + ############################################################# + # encode TLV + # + # appends to the bytes() object + def _encode_inner(b, is_struct) + if b == nil b = bytes() end + # encode tag and type + self._encode_tag(b) + # sort values + var val_list = self.val.copy() + if is_struct + self.sort(val_list) + end + + # output each one after the other + for v : val_list + v.encode(b) + end + + # add 'end of container' + b.add(self.TLV.EOC, 1) + + return b + end + + ############################################################# + def encode(b) + return self._encode_inner(b, false) + end + + ############################################################# + # Getters + # + # get by index + def item(n) + return self.val[n] + end + def setitem(n, v) + self.val[n] = v + end + def push(v) + self.val.push(v) + end + def size() + return size(self.val) + end + + ############################################################# + # get by sub-tag, return nil if not found + def findsub(n, v) + for k : self.val + if k.tag_sub == n return k end + end + return v + end + def findsubval(n, v) + var r = self.findsub(n) + if r != nil return r.val end + return v + end + def findsubtyp(n) + var r = self.findsub(n) + if r != nil return r.typ end + return nil + end + def getsub(n) + var v = self.findsub(n) + if v == nil raise "value_error", "sub not found" end + return v + end + def getsubval(n) + return self.getsub(n).val + end + + ############################################################# + # adders + def add_TLV(tag, t, value) + if value != nil + var v = self.TLV.Matter_TLV_item(self) + v.tag_sub = tag + v.typ = t + v.val = value + self.val.push(v) + end + return self + end + + # add on object that implements `to_TLV()` and adds to the current container + # + # obj can be `nil`, in such case nothing happens + # returns `self` to allow calls to be chained + def add_obj(tag, obj) + if obj != nil + var value = obj.to_TLV() + value.tag_sub = tag + self.val.push(value) + end + return self + end + + def add_list(tag) + var s = self.TLV.Matter_TLV_list(self) + s.tag_sub = tag + self.val.push(s) + return s + end + + def add_array(tag) + var s = self.TLV.Matter_TLV_array(self) + s.tag_sub = tag + self.val.push(s) + return s + end + + def add_struct(tag) + var s = self.TLV.Matter_TLV_struct(self) + s.tag_sub = tag + self.val.push(s) + return s + end + + end + + ################################################################################# + # Matter_TLV_struct class + ################################################################################# + static class Matter_TLV_struct : Matter_TLV_list + def init(parent) + super(self).init(parent) + self.typ = self.TLV.STRUCT + self.val = [] + end + + ############################################################# + def tostring() + return self.tostring_inner(true, "{", "}") + end + + ############################################################# + # encode TLV + # + # appends to the bytes() object + def encode(b) + return self._encode_inner(b, true) + end + end + + ################################################################################# + # Matter_TLV_array class + ################################################################################# + static class Matter_TLV_array : Matter_TLV_list + def init(parent) + super(self).init(parent) + self.typ = self.TLV.ARRAY + self.val = [] + end + + ############################################################# + def tostring() + return self.tostring_inner(false, "[", "]") + end + + ############################################################# + def parse(b, idx) + # iterate until end of struct + while b[idx] != self.TLV.EOC + # read next + var item = self.TLV.parse(b, idx, self) + idx = item.next_idx + + # for arrays, all tags must be anonymous + item.tag_vendor = nil + item.tag_profile = nil + item.tag_number = nil + item.tag_sub = nil + self.val.push(item) + end + idx += 1 + + self.next_idx = idx + return idx + end + end + + ################################################################################# + # bookkeeping + ################################################################################# + # Matter_TLV.Matter_TLV_item = Matter_TLV_item + # Matter_TLV.Matter_TLV_struct = Matter_TLV_struct + # Matter_TLV.Matter_TLV_array = Matter_TLV_array + # Matter_TLV.Matter_TLV_list = Matter_TLV_list + + # parse a bytes() array from `idx` + # args: + # b: bytes() buffer + # idx: starting index in the bytes() buffer + # parent: (optional) the parent object to inherit tag values + # returns the next `idx` for the item following or `-1` if error + static def parse(b, idx, parent) + var TLV = _class + if idx == nil idx = 0 end + # read type and tag_control + var item_type = b[idx] & 0x1F # values 0x00 - 0x1F + var item_tag_control = b[idx] & 0xE0 # values 0x20 - 0xE0 + idx += 1 # skip tag/type byte + + if (item_type > TLV.EOC) raise "TLV_error", "invalid TLV type "+str(item_type) end + + # ############################################################ + # instanciate TLV item or struct + var item + if item_type == TLV.STRUCT + item = _class.Matter_TLV_struct(parent) + elif item_type == TLV.ARRAY + item = _class.Matter_TLV_array(parent) + elif item_type == TLV.LIST + item = _class.Matter_TLV_list(parent) + else + item = _class.Matter_TLV_item(parent) + end + item.typ = item_type # set type for item + + # ############################################################ + # parse Tag and length + # do we have a vendor? + if item_tag_control == 0xC0 || item_tag_control == 0xE0 + item.tag_vendor = b.get(idx, 2) + item.tag_profile = b.get(idx + 2, 2) + idx += 4 + end + # Common profile tags + if item_tag_control == 0x40 || item_tag_control == 0x60 + item.tag_vendor = nil + item.tag_profile = -1 + end + # Tags + if item_tag_control == 0x00 + # pass + elif item_tag_control == 0x20 + # context specific tag + item.tag_sub = b[idx] + idx += 1 + elif item_tag_control == 0xC0 || item_tag_control == 0x80 || item_tag_control == 0x40 + item.tag_number = b.get(idx, 2) + idx += 2 + else + item.tag_number = b.get(idx, 4) + idx += 4 + end + + # ############################################################ + # parse Value + idx = item.parse(b, idx) + + return item + end + ############################################################# + # create simple TLV + static def create_TLV(t, value) + return _class.Matter_TLV_item.create_TLV(t, value) + end +end + +# add to matter +import matter +matter.TLV = Matter_TLV + +#- + +# Test +import matter + +#load("Matter_TLV.be") + +var m +m = matter.TLV.parse(bytes("2502054C")) +assert(m.tostring() == "2 = 19461U") +assert(m.encode() == bytes("2502054C")) + +m = matter.TLV.parse(bytes("0001")) +assert(m.tostring() == "1") +assert(m.encode() == bytes("0001")) + +m = matter.TLV.parse(bytes("08")) +assert(m.tostring() == "false") +assert(m.encode() == bytes("08")) +m = matter.TLV.parse(bytes("09")) +assert(m.tostring() == "true") +assert(m.encode() == bytes("09")) + +m = matter.TLV.parse(bytes("01FFFF")) +assert(m.tostring() == "-1") +assert(m.encode() == bytes("00FF")) +m = matter.TLV.parse(bytes("05FFFF")) +assert(m.tostring() == "65535U") +assert(m.encode() == bytes("05FFFF")) + +m = matter.TLV.parse(bytes("0A0000C03F")) +assert(m.tostring() == "1.5") +assert(m.encode() == bytes("0A0000C03F")) + +m = matter.TLV.parse(bytes("0C06466f6f626172")) +assert(m.tostring() == '"Foobar"') +assert(m.encode() == bytes("0C06466f6f626172")) + +m = matter.TLV.parse(bytes("1006466f6f626172")) +assert(m.tostring() == "466F6F626172") +assert(m.encode() == bytes("1006466f6f626172")) + +m = matter.TLV.parse(bytes("e4f1ffeddeedfe55aa2a")) +assert(m.tostring() == "0xFFF1::0xDEED:0xAA55FEED = 42U") +assert(m.encode() == bytes("e4f1ffeddeedfe55aa2a")) + + +m = matter.TLV.parse(bytes("300120D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D66")) +assert(m.tostring() == "1 = D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D66") +assert(m.encode() == bytes("300120D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D66")) + +# context specific +m = matter.TLV.parse(bytes("24012a")) +assert(m.tostring() == "1 = 42U") +assert(m.encode() == bytes("24012a")) + +m = matter.TLV.parse(bytes("4401002a")) +assert(m.tostring() == "Matter::0x00000001 = 42U") +assert(m.encode() == bytes("4401002a")) + +# int64 +m = matter.TLV.parse(bytes("030102000000000000")) +assert(m.tostring() == "513") +assert(m.encode() == bytes("030102000000000000")) + +m = matter.TLV.parse(bytes("070102000000000000")) +assert(m.tostring() == "513U") +assert(m.encode() == bytes("070102000000000000")) + +m = matter.TLV.parse(bytes("03FFFFFFFFFFFFFFFF")) +assert(m.tostring() == "-1") +assert(m.encode() == bytes("03FFFFFFFFFFFFFFFF")) + +m = matter.TLV.parse(bytes("07FFFFFFFFFFFFFF7F")) +assert(m.tostring() == "9223372036854775807U") +assert(m.encode() == bytes("07FFFFFFFFFFFFFF7F")) + +# structure +m = matter.TLV.parse(bytes("1518")) +assert(m.tostring() == "{}") +assert(m.encode() == bytes("1518")) + +m = matter.TLV.parse(bytes("15300120D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D662502054C240300280418")) +assert(m.tostring() == "{1 = D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D66, 2 = 19461U, 3 = 0U, 4 = false}") +assert(m.encode() == bytes("15300120D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D662502054C240300280418")) + +m = matter.TLV.parse(bytes("15300120D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D662502054C240300280435052501881325022C011818")) +assert(m.tostring() == "{1 = D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D66, 2 = 19461U, 3 = 0U, 4 = false, 5 = {1 = 5000U, 2 = 300U}}") +assert(m.encode() == bytes("15300120D2DAEE8760C9B1D1B25E0E2E4DD6ECA8AEF6193C0203761356FCB06BBEDD7D662502054C240300280435052501881325022C011818")) + +# list +m = matter.TLV.parse(bytes("1718")) +assert(m.tostring() == "[[]]") +assert(m.encode() == bytes("1718")) + +m = matter.TLV.parse(bytes("17000120002a000200032000ef18")) +assert(m.tostring() == "[[1, 0 = 42, 2, 3, 0 = -17]]") +assert(m.encode() == bytes("17000120002a000200032000ef18")) + + +# array +m = matter.TLV.parse(bytes("1618")) +assert(m.tostring() == "[]") +assert(m.encode() == bytes("1618")) + +m = matter.TLV.parse(bytes("160000000100020003000418")) +assert(m.tostring() == "[0, 1, 2, 3, 4]") +assert(m.encode() == bytes("160000000100020003000418")) + +# mix +m = matter.TLV.parse(bytes("16002a02f067fdff15180a33338f410c0648656c6c6f2118")) +assert(m.tostring() == '[42, -170000, {}, 17.9, "Hello!"]') +assert(m.encode() == bytes("16002a02f067fdff15180a33338f410c0648656c6c6f2118")) + +m = matter.TLV.parse(bytes("153600172403312504FCFF18172402002403302404001817240200240330240401181724020024033024040218172402002403302404031817240200240328240402181724020024032824040418172403312404031818280324FF0118")) +assert(m.tostring() == '{0 = [[[3 = 49U, 4 = 65532U]], [[2 = 0U, 3 = 48U, 4 = 0U]], [[2 = 0U, 3 = 48U, 4 = 1U]], [[2 = 0U, 3 = 48U, 4 = 2U]], [[2 = 0U, 3 = 48U, 4 = 3U]], [[2 = 0U, 3 = 40U, 4 = 2U]], [[2 = 0U, 3 = 40U, 4 = 4U]], [[3 = 49U, 4 = 3U]]], 3 = false, 255 = 1U}') +assert(m.encode() == bytes("153600172403312504FCFF18172402002403302404001817240200240330240401181724020024033024040218172402002403302404031817240200240328240402181724020024032824040418172403312404031818280324FF0118")) + +-# diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_UDPServer.be b/lib/libesp32/berry_matter/src/embedded/Matter_UDPServer.be new file mode 100644 index 000000000..75df885c3 --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_UDPServer.be @@ -0,0 +1,187 @@ +# +# Matter_UDPServer.be - implements IPv6 UDP communication for Matter +# +# 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 . +# + +# Matter_UDPServer class +# +# For receiving and outgoing messages on UDP +# + +import matter + +#@ solidify:Matter_UDPPacket_sent,weak +#@ solidify:Matter_UDPServer,weak + +################################################################################# +# Matter_UDPPacket_sent class +# +# A packet that needs to be resent if not acknowledged by the other party +################################################################################# +class Matter_UDPPacket_sent + static var RETRY_MS = 500 # retry every 500 ms + static var RETRIES = 4 # retry every 500 ms + var raw # bytes() to be sent + var addr # ip_address (string) + var port # port (int) + var msg_id # (int) message identifier that needs to be acknowledged + var retries # how many retries are allowed, when `0` drop and log + var next_try # timestamp (millis) when to try again + + def init(raw, addr, port, id) + self.raw = raw + self.addr = addr + self.port = port + self.msg_id = id + self.retries = self.RETRIES + self.next_try = tasmota.millis() + self.RETRY_MS + end + + def send(udp_socket) + import string + var ok = udp_socket.send(self.addr ? self.addr : udp_socket.remote_ip, self.port ? self.port : udp_socket.remote_port, self.raw) + if ok + tasmota.log(string.format("MTR: sending packet to '[%s]:%i'", self.addr, self.port), 3) + else + tasmota.log(string.format("MTR: failed to send packet to '[%s]:%i'", self.addr, self.port), 2) + end + end +end +matter.UDPPacket_sent = Matter_UDPPacket_sent + +################################################################################# +# Matter_UDPServer class +# +################################################################################# +class Matter_UDPServer + static var MAX_PACKETS_READ = 4 # read at most 4 packets per tick + var address, port # local address and port + var listening # true if active + var udp_socket + var dispatch_cb # callback to call when a message is received + var packets_sent # map of packets sent to be acknowledged + + ############################################################# + def init(address, port) + self.address = address ? address : "" + self.port = port ? port : 5540 + self.listening = false + self.packets_sent = {} + end + + ############################################################# + # start the server + # raises an exception if something is wrong + # registers as device handle + # + # `cb`: callback to call when a message is received + def start(cb) + if !self.listening + self.udp_socket = udp() + var ok = self.udp_socket.begin(self.address, self.port) + if !ok raise "network_error", "could not open UDP server" end + self.listening = true + self.dispatch_cb = cb + tasmota.add_driver(self) + end + end + + ############################################################# + # stop the server + # remove driver + def stop() + if self.listening + self.udp_socket.stop() + self.listening = false + tasmota.remove_driver(self) + end + end + + ############################################################# + def every_50ms() + import string + var packet_read = 0 + if self.udp_socket == nil return end + var packet = self.udp_socket.read() + while packet != nil + # self.packet = packet + packet_read += 1 + var from_addr = self.udp_socket.remote_ip + var from_port = self.udp_socket.remote_port + tasmota.log(string.format("MTR: UDP received from [%s]:%i", from_addr, from_port), 4) + if self.dispatch_cb + self.dispatch_cb(packet, from_addr, from_port) + end + # are we reading new packets? + if packet_read < self.MAX_PACKETS_READ + packet = self.udp_socket.read() + else + packet = nil + end + end + self.resend_packets() # resend any packet + end + + ############################################################# + def resend_packets() + for packet:self.packets_sent + if tasmota.time_reached(packet.next_try) + tasmota.log("MTR: resending packet id=" + str(packet.msg_id), 3) + packet.send(self.udp_socket) # resend + packet.retries -= 1 + if packet.retries <= 0 + self.packets_sent.remove(packet.msg_id) + else + packet.next_try = tasmota.millis() + packet.RETRY_MS + end + end + end + end + + ############################################################# + # just received acknowledgment, remove packet from sender + def packet_ack(id) + if id == nil return end + if self.packets_sent.contains(id) + self.packets_sent.remove(id) + tasmota.log("MTR: removed packet from sending list id=" + str(id), 3) + end + end + + ############################################################# + def send_response(raw, addr, port, id) + var packet = matter.UDPPacket_sent(raw, addr, port, id) + packet.send(self.udp_socket) # send + if id + self.packets_sent[id] = packet + end + end + + ############################################################# + # placeholder, nothing to run for now + def every_second() + end +end +matter.UDPServer = Matter_UDPServer + +#- + +import matter +var udps = matter.UDPServer() +udps.listen() + +-# diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_UI.be b/lib/libesp32/berry_matter/src/embedded/Matter_UI.be new file mode 100644 index 000000000..7bd6921f4 --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_UI.be @@ -0,0 +1,259 @@ +# +# Matter_UI.be - WebUI for Matter configuration in 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 . +# + +####################################################################### +# Matter Web UI +# +####################################################################### + +import matter + +#@ solidify:Matter_UI,weak + +################################################################################# +# Partition_wizard_UI +# +# WebUI for the partition manager +################################################################################# +class Matter_UI + var device + + def init(device) + self.device = device + tasmota.add_driver(self) + end + + # #################################################################################################### + # Init web handlers + # #################################################################################################### + # Displays a "Autoconf" button on the configuration page + def web_add_config_button() + import webserver + # webserver.content_send("

") + webserver.content_send("

") + end + + #- ---------------------------------------------------------------------- -# + #- Show commissioning information and QR Code + # + # Returns true if Matter is enabled + #- ---------------------------------------------------------------------- -# + def show_enable(p) + import webserver + import string + var matter_enabled = tasmota.get_option(matter.MATTER_OPTION) + + webserver.content_send(string.format("
 Matter %s 

", + matter_enabled ? "Enabled" : "Disabled")) + + webserver.content_send("

Matter support is experimental.

") + + webserver.content_send("
") + webserver.content_send(string.format("

") + + webserver.content_send("

") + + return matter_enabled + end + + #- ---------------------------------------------------------------------- -# + #- Show commissioning information and QR Code + #- ---------------------------------------------------------------------- -# + def show_commissioning_info() + import webserver + import string + + webserver.content_send("
 Matter Passcode 

") + + var pairing_code = self.device.compute_manual_pairing_code() + webserver.content_send(string.format("

Manual pairing code:
%s-%s-%s


", pairing_code[0..3], pairing_code[4..6], pairing_code[7..])) + + var qr_text = self.device.compute_qrcode_content() + webserver.content_send('
') + webserver.content_send(string.format('', qr_text)) + webserver.content_send(string.format("

%s


", qr_text)) + + webserver.content_send("
") + webserver.content_send("

Passcode:

") + webserver.content_send(string.format("", self.device.passcode)) + webserver.content_send("

Distinguish id:

") + webserver.content_send(string.format("", self.device.discriminator)) + webserver.content_send("

") + + + webserver.content_send("

") + + end + + #- ---------------------------------------------------------------------- -# + #- Show commissioning information and QR Code + #- ---------------------------------------------------------------------- -# + def show_session_info(p) + import webserver + import string + + webserver.content_send("
 Sessions 

") + webserver.content_send("

Existing sessions:

") + + if size(self.device.sessions.sessions) == 0 + webserver.content_send("

None

") + else + var i = 0 + var sz = size(self.device.sessions.sessions) + while i < sz + var s = self.device.sessions.sessions[i] + if s.fabric + webserver.content_send(string.format("
 Session %i 

", s.local_session_id)) + if i != 0 webserver.content_send("
") end + var fabric_rev = s.fabric.copy().reverse() + var deviceid_rev = s.deviceid.copy().reverse() + webserver.content_send(string.format("Fabric: %s
", fabric_rev.tohex())) + webserver.content_send(string.format("Device: %s
 ", deviceid_rev.tohex())) + + webserver.content_send("
") + webserver.content_send(string.format("", s.local_session_id)) + webserver.content_send("

") + + webserver.content_send("

") + end + i += 1 + end + end + + webserver.content_send("

") + + end + + + ####################################################################### + # Serve qrcode.min.js static file + ####################################################################### + def page_qrcode_min_js() + import webserver + + webserver.content_open(200, "text/javascript") + webserver.content_send(matter._QRCODE_MINJS) + end + + ####################################################################### + # Display the complete page + ####################################################################### + def page_part_mgr() + import webserver + import string + + if !webserver.check_privileged_access() return nil end + + webserver.content_start("Matter") #- title of the web page -# + webserver.content_send_style() #- send standard Tasmota styles -# + + webserver.content_send('') + + if self.show_enable() + self.show_commissioning_info() + self.show_session_info() + end + webserver.content_button(webserver.BUTTON_CONFIGURATION) + webserver.content_stop() #- end of web page -# + end + + ####################################################################### + # Web Controller, called by POST to `/part_wiz` + ####################################################################### + def page_part_ctl() + import webserver + if !webserver.check_privileged_access() return nil end + + import string + import partition_core + import persist + + + #- check that the partition is valid -# + var p = partition_core.Partition() + + try + + #---------------------------------------------------------------------# + # Change Passcode and/or Passcode + #---------------------------------------------------------------------# + if webserver.has_arg("passcode") || webserver.has_arg("discriminator") + if webserver.has_arg("passcode") + self.device.passcode = int(webserver.arg("passcode")) + end + if webserver.has_arg("discriminator") + self.device.discriminator = int(webserver.arg("discriminator")) + end + self.device.save_param() + + #- and force restart -# + webserver.redirect("/?rst=") + + elif webserver.has_arg("enable") + tasmota.cmd("SetOption" + str(matter.MATTER_OPTION) + " 1") + #- and force restart -# + webserver.redirect("/?rst=") + + elif webserver.has_arg("disable") + tasmota.cmd("SetOption" + str(matter.MATTER_OPTION) + " 0") + #- and force restart -# + webserver.redirect("/?rst=") + + elif webserver.has_arg("del_session") + var session = self.device.sessions.get_session_by_local_session_id(int(webserver.arg("del_session"))) + if session != nil + self.device.sessions.remove_session(session) + self.device.sessions.save() + end + + #- and force restart -# + webserver.redirect("/?rst=") + + end + except .. as e, m + tasmota.log(string.format("BRY: Exception> '%s' - %s", e, m), 2) + #- display error page -# + webserver.content_start("Parameter error") #- title of the web page -# + webserver.content_send_style() #- send standard Tasmota styles -# + + webserver.content_send(string.format("

Exception:
'%s'
%s

", e, m)) + + webserver.content_button(webserver.BUTTON_MANAGEMENT) #- button back to management page -# + webserver.content_stop() #- end of web page -# + end + end + + #- ---------------------------------------------------------------------- -# + # respond to web_add_handler() event to register web listeners + #- ---------------------------------------------------------------------- -# + #- this is called at Tasmota start-up, as soon as Wifi/Eth is up and web server running -# + def web_add_handler() + import webserver + #- we need to register a closure, not just a function, that captures the current instance -# + webserver.on("/matterc", / -> self.page_part_mgr(), webserver.HTTP_GET) + webserver.on("/matterc", / -> self.page_part_ctl(), webserver.HTTP_POST) + webserver.on("/qrcode.min.js", / -> self.page_qrcode_min_js(), webserver.HTTP_GET) + end +end +matter.UI = Matter_UI diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_inspect.be b/lib/libesp32/berry_matter/src/embedded/Matter_inspect.be new file mode 100644 index 000000000..c9f9a15d2 --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_inspect.be @@ -0,0 +1,64 @@ +# +# Matter_inspect.be - implements a generic function to inspect an instance (for debugging only) +# +# 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 + +#@ solidify:matter.sort,weak +def sort(l) + # insertion sort + for i:1..size(l)-1 + var k = l[i] + var j = i + while (j > 0) && (l[j-1] > k) + l[j] = l[j-1] + j -= 1 + end + l[j] = k + end + return l +end +matter.sort = sort + +#@ solidify:matter.inspect,weak +# debug function +def inspect(p) + try + import string + import introspect + + var keys = [] + for k : introspect.members(p) + var v = introspect.get(p, k) + if type(v) != 'function' keys.push(k) end + end + keys = matter.sort(keys) + + var r = [] + for k : keys + var v = introspect.get(p, k) + # if type(v) == 'string' v = string.escape(v, true) end + r.push(string.format("'%s': %s", str(k), str(v))) + end + + return "{" + r.concat(", ") + "}" + except .. as e, m + return "Exception:" + str(e) + "|" + str(m) + end +end +matter.inspect = inspect diff --git a/lib/libesp32/berry_matter/src/embedded/matter.be b/lib/libesp32/berry_matter/src/embedded/matter.be new file mode 100644 index 000000000..49a23ab68 --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/matter.be @@ -0,0 +1,4 @@ +# placeholder for `import matter` not to fail when running solidification + +var m = module("matter") +return m diff --git a/lib/libesp32/berry_matter/src/solidify/.keep b/lib/libesp32/berry_matter/src/solidify/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Base38.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Base38.h new file mode 100644 index 000000000..2bef18e6f --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Base38.h @@ -0,0 +1,154 @@ +/* Solidification of Matter_Base38.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_Base38; + +/******************************************************************** +** Solidified function: encode +********************************************************************/ +be_local_closure(Matter_Base38_encode, /* name */ + be_nested_proto( + 10, /* nstack */ + 1, /* argc */ + 4, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_X2D_X2E), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(), + /* K4 */ be_const_int(1), + }), + be_str_weak(b38_enc), + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x580C0001, // 0001 LDCONST R3 K1 + 0x58100002, // 0002 LDCONST R4 K2 + 0x58140003, // 0003 LDCONST R5 K3 + 0x14180801, // 0004 LT R6 R4 R1 + 0x781A0007, // 0005 JMPF R6 #000E + 0x541A0025, // 0006 LDINT R6 38 + 0x10180006, // 0007 MOD R6 R0 R6 + 0x94180606, // 0008 GETIDX R6 R3 R6 + 0x00140A06, // 0009 ADD R5 R5 R6 + 0x541A0025, // 000A LDINT R6 38 + 0x0C000006, // 000B DIV R0 R0 R6 + 0x00100904, // 000C ADD R4 R4 K4 + 0x7001FFF5, // 000D JMP #0004 + 0x80040A00, // 000E RET 1 R5 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_const_class(be_class_Matter_Base38), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str_weak(), + /* K3 */ be_const_int(2), + /* K4 */ be_const_int(1), + /* K5 */ be_const_int(3), + }), + be_str_weak(encode), + &be_const_str_solidified, + ( &(const binstruction[58]) { /* code */ + 0x58040000, // 0000 LDCONST R1 K0 + 0x84080000, // 0001 CLOSURE R2 P0 + 0x580C0001, // 0002 LDCONST R3 K1 + 0x6010000C, // 0003 GETGBL R4 G12 + 0x5C140000, // 0004 MOVE R5 R0 + 0x7C100200, // 0005 CALL R4 1 + 0x58140002, // 0006 LDCONST R5 K2 + 0x14180604, // 0007 LT R6 R3 R4 + 0x781A002F, // 0008 JMPF R6 #0039 + 0x4C180000, // 0009 LDNIL R6 + 0x001C0703, // 000A ADD R7 R3 K3 + 0x141C0E04, // 000B LT R7 R7 R4 + 0x781E0012, // 000C JMPF R7 #0020 + 0x941C0003, // 000D GETIDX R7 R0 R3 + 0x00200704, // 000E ADD R8 R3 K4 + 0x94200008, // 000F GETIDX R8 R0 R8 + 0x54260007, // 0010 LDINT R9 8 + 0x38201009, // 0011 SHL R8 R8 R9 + 0x301C0E08, // 0012 OR R7 R7 R8 + 0x00200703, // 0013 ADD R8 R3 K3 + 0x94200008, // 0014 GETIDX R8 R0 R8 + 0x5426000F, // 0015 LDINT R9 16 + 0x38201009, // 0016 SHL R8 R8 R9 + 0x301C0E08, // 0017 OR R7 R7 R8 + 0x5C180E00, // 0018 MOVE R6 R7 + 0x5C1C0400, // 0019 MOVE R7 R2 + 0x5C200C00, // 001A MOVE R8 R6 + 0x54260004, // 001B LDINT R9 5 + 0x7C1C0400, // 001C CALL R7 2 + 0x00140A07, // 001D ADD R5 R5 R7 + 0x000C0705, // 001E ADD R3 R3 K5 + 0x70020017, // 001F JMP #0038 + 0x001C0704, // 0020 ADD R7 R3 K4 + 0x141C0E04, // 0021 LT R7 R7 R4 + 0x781E000D, // 0022 JMPF R7 #0031 + 0x941C0003, // 0023 GETIDX R7 R0 R3 + 0x00200704, // 0024 ADD R8 R3 K4 + 0x94200008, // 0025 GETIDX R8 R0 R8 + 0x54260007, // 0026 LDINT R9 8 + 0x38201009, // 0027 SHL R8 R8 R9 + 0x301C0E08, // 0028 OR R7 R7 R8 + 0x5C180E00, // 0029 MOVE R6 R7 + 0x5C1C0400, // 002A MOVE R7 R2 + 0x5C200C00, // 002B MOVE R8 R6 + 0x54260003, // 002C LDINT R9 4 + 0x7C1C0400, // 002D CALL R7 2 + 0x00140A07, // 002E ADD R5 R5 R7 + 0x000C0703, // 002F ADD R3 R3 K3 + 0x70020006, // 0030 JMP #0038 + 0x94180003, // 0031 GETIDX R6 R0 R3 + 0x5C1C0400, // 0032 MOVE R7 R2 + 0x5C200C00, // 0033 MOVE R8 R6 + 0x58240003, // 0034 LDCONST R9 K3 + 0x7C1C0400, // 0035 CALL R7 2 + 0x00140A07, // 0036 ADD R5 R5 R7 + 0x000C0704, // 0037 ADD R3 R3 K4 + 0x7001FFCD, // 0038 JMP #0007 + 0x80040A00, // 0039 RET 1 R5 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_Base38 +********************************************************************/ +be_local_class(Matter_Base38, + 0, + NULL, + be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(encode, -1), be_const_static_closure(Matter_Base38_encode_closure) }, + })), + be_str_weak(Matter_Base38) +); +/*******************************************************************/ + +void be_load_Matter_Base38_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_Base38); + be_setglobal(vm, "Matter_Base38"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Commissioning.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Commissioning.h new file mode 100644 index 000000000..4f922fc06 --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Commissioning.h @@ -0,0 +1,2430 @@ +/* Solidification of Matter_Commissioning.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_Commisioning_Context; + +/******************************************************************** +** Solidified function: parse_PBKDFParamRequest +********************************************************************/ +be_local_closure(Matter_Commisioning_Context_parse_PBKDFParamRequest, /* name */ + be_nested_proto( + 16, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[46]) { /* constants */ + /* K0 */ be_nested_str_weak(crypto), + /* K1 */ be_nested_str_weak(opcode), + /* K2 */ be_nested_str_weak(local_session_id), + /* K3 */ be_const_int(0), + /* K4 */ be_nested_str_weak(protocol_id), + /* K5 */ be_nested_str_weak(protocol_error), + /* K6 */ be_nested_str_weak(invalid_X20PBKDFParamRequest_X20message), + /* K7 */ be_nested_str_weak(matter), + /* K8 */ be_nested_str_weak(PBKDFParamRequest), + /* K9 */ be_nested_str_weak(parse), + /* K10 */ be_nested_str_weak(raw), + /* K11 */ be_nested_str_weak(app_payload_idx), + /* K12 */ be_nested_str_weak(session), + /* K13 */ be_nested_str_weak(set_mode), + /* K14 */ be_nested_str_weak(Session), + /* K15 */ be_nested_str_weak(__PASE), + /* K16 */ be_const_int(2147483647), + /* K17 */ be_nested_str_weak(passcodeId), + /* K18 */ be_nested_str_weak(non_X2Dzero_X20passcode_X20id), + /* K19 */ be_nested_str_weak(future_initiator_session_id), + /* K20 */ be_nested_str_weak(initiator_session_id), + /* K21 */ be_nested_str_weak(future_local_session_id), + /* K22 */ be_nested_str_weak(device), + /* K23 */ be_nested_str_weak(sessions), + /* K24 */ be_nested_str_weak(gen_local_session_id), + /* K25 */ be_nested_str_weak(PBKDFParamResponse), + /* K26 */ be_nested_str_weak(initiatorRandom), + /* K27 */ be_nested_str_weak(responderRandom), + /* K28 */ be_nested_str_weak(random), + /* K29 */ be_nested_str_weak(responderSessionId), + /* K30 */ be_nested_str_weak(pbkdf_parameters_salt), + /* K31 */ be_nested_str_weak(salt), + /* K32 */ be_nested_str_weak(pbkdf_parameters_iterations), + /* K33 */ be_nested_str_weak(iterations), + /* K34 */ be_nested_str_weak(tasmota), + /* K35 */ be_nested_str_weak(log), + /* K36 */ be_nested_str_weak(MTR_X3A_X20pbkdfparamresp_X3A_X20), + /* K37 */ be_nested_str_weak(inspect), + /* K38 */ be_const_int(3), + /* K39 */ be_nested_str_weak(encode), + /* K40 */ be_nested_str_weak(MTR_X3A_X20pbkdfparamresp_raw_X3A_X20), + /* K41 */ be_nested_str_weak(tohex), + /* K42 */ be_nested_str_weak(build_response), + /* K43 */ be_nested_str_weak(responder), + /* K44 */ be_nested_str_weak(send_response), + /* K45 */ be_nested_str_weak(message_counter), + }), + be_str_weak(parse_PBKDFParamRequest), + &be_const_str_solidified, + ( &(const binstruction[94]) { /* code */ + 0xA4120000, // 0000 IMPORT R4 K0 + 0x88140301, // 0001 GETMBR R5 R1 K1 + 0x541A001F, // 0002 LDINT R6 32 + 0x20140A06, // 0003 NE R5 R5 R6 + 0x74160005, // 0004 JMPT R5 #000B + 0x88140302, // 0005 GETMBR R5 R1 K2 + 0x20140B03, // 0006 NE R5 R5 K3 + 0x74160002, // 0007 JMPT R5 #000B + 0x88140304, // 0008 GETMBR R5 R1 K4 + 0x20140B03, // 0009 NE R5 R5 K3 + 0x78160000, // 000A JMPF R5 #000C + 0xB0060B06, // 000B RAISE 1 K5 K6 + 0xB8160E00, // 000C GETNGBL R5 K7 + 0x8C140B08, // 000D GETMET R5 R5 K8 + 0x7C140200, // 000E CALL R5 1 + 0x8C140B09, // 000F GETMET R5 R5 K9 + 0x881C030A, // 0010 GETMBR R7 R1 K10 + 0x8820030B, // 0011 GETMBR R8 R1 K11 + 0x7C140600, // 0012 CALL R5 3 + 0x8818030C, // 0013 GETMBR R6 R1 K12 + 0x8C180D0D, // 0014 GETMET R6 R6 K13 + 0xB8220E00, // 0015 GETNGBL R8 K7 + 0x8820110E, // 0016 GETMBR R8 R8 K14 + 0x8820110F, // 0017 GETMBR R8 R8 K15 + 0x7C180400, // 0018 CALL R6 2 + 0x8818030B, // 0019 GETMBR R6 R1 K11 + 0x40180D10, // 001A CONNECT R6 R6 K16 + 0x881C030A, // 001B GETMBR R7 R1 K10 + 0x94180E06, // 001C GETIDX R6 R7 R6 + 0x90021006, // 001D SETMBR R0 K8 R6 + 0x88180B11, // 001E GETMBR R6 R5 K17 + 0x20180D03, // 001F NE R6 R6 K3 + 0x781A0000, // 0020 JMPF R6 #0022 + 0xB0060B12, // 0021 RAISE 1 K5 K18 + 0x88180B14, // 0022 GETMBR R6 R5 K20 + 0x90022606, // 0023 SETMBR R0 K19 R6 + 0x88180116, // 0024 GETMBR R6 R0 K22 + 0x88180D17, // 0025 GETMBR R6 R6 K23 + 0x8C180D18, // 0026 GETMET R6 R6 K24 + 0x7C180200, // 0027 CALL R6 1 + 0x90022A06, // 0028 SETMBR R0 K21 R6 + 0xB81A0E00, // 0029 GETNGBL R6 K7 + 0x8C180D19, // 002A GETMET R6 R6 K25 + 0x7C180200, // 002B CALL R6 1 + 0x881C0B1A, // 002C GETMBR R7 R5 K26 + 0x901A3407, // 002D SETMBR R6 K26 R7 + 0x8C1C091C, // 002E GETMET R7 R4 K28 + 0x5426001F, // 002F LDINT R9 32 + 0x7C1C0400, // 0030 CALL R7 2 + 0x901A3607, // 0031 SETMBR R6 K27 R7 + 0x881C0115, // 0032 GETMBR R7 R0 K21 + 0x901A3A07, // 0033 SETMBR R6 K29 R7 + 0x881C0116, // 0034 GETMBR R7 R0 K22 + 0x881C0F1F, // 0035 GETMBR R7 R7 K31 + 0x901A3C07, // 0036 SETMBR R6 K30 R7 + 0x881C0116, // 0037 GETMBR R7 R0 K22 + 0x881C0F21, // 0038 GETMBR R7 R7 K33 + 0x901A4007, // 0039 SETMBR R6 K32 R7 + 0xB81E4400, // 003A GETNGBL R7 K34 + 0x8C1C0F23, // 003B GETMET R7 R7 K35 + 0x60240008, // 003C GETGBL R9 G8 + 0xB82A0E00, // 003D GETNGBL R10 K7 + 0x8C281525, // 003E GETMET R10 R10 K37 + 0x5C300C00, // 003F MOVE R12 R6 + 0x7C280400, // 0040 CALL R10 2 + 0x7C240200, // 0041 CALL R9 1 + 0x00264809, // 0042 ADD R9 K36 R9 + 0x58280026, // 0043 LDCONST R10 K38 + 0x7C1C0600, // 0044 CALL R7 3 + 0x8C1C0D27, // 0045 GETMET R7 R6 K39 + 0x7C1C0200, // 0046 CALL R7 1 + 0xB8224400, // 0047 GETNGBL R8 K34 + 0x8C201123, // 0048 GETMET R8 R8 K35 + 0x8C280F29, // 0049 GETMET R10 R7 K41 + 0x7C280200, // 004A CALL R10 1 + 0x002A500A, // 004B ADD R10 K40 R10 + 0x582C0026, // 004C LDCONST R11 K38 + 0x7C200600, // 004D CALL R8 3 + 0x90023207, // 004E SETMBR R0 K25 R7 + 0x8C20032A, // 004F GETMET R8 R1 K42 + 0x542A0020, // 0050 LDINT R10 33 + 0x502C0200, // 0051 LDBOOL R11 1 0 + 0x7C200600, // 0052 CALL R8 3 + 0x8C241127, // 0053 GETMET R9 R8 K39 + 0x5C2C0E00, // 0054 MOVE R11 R7 + 0x7C240400, // 0055 CALL R9 2 + 0x8828012B, // 0056 GETMBR R10 R0 K43 + 0x8C28152C, // 0057 GETMET R10 R10 K44 + 0x5C301200, // 0058 MOVE R12 R9 + 0x5C340400, // 0059 MOVE R13 R2 + 0x5C380600, // 005A MOVE R14 R3 + 0x883C112D, // 005B GETMBR R15 R8 K45 + 0x7C280A00, // 005C CALL R10 5 + 0x80000000, // 005D RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_Commisioning_Context_init, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str_weak(crypto), + /* K1 */ be_nested_str_weak(responder), + /* K2 */ be_nested_str_weak(device), + /* K3 */ be_nested_str_weak(y), + /* K4 */ be_nested_str_weak(random), + /* K5 */ be_nested_str_weak(window_open), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[11]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x90020201, // 0001 SETMBR R0 K1 R1 + 0x880C0302, // 0002 GETMBR R3 R1 K2 + 0x90020403, // 0003 SETMBR R0 K2 R3 + 0x8C0C0504, // 0004 GETMET R3 R2 K4 + 0x5416001F, // 0005 LDINT R5 32 + 0x7C0C0400, // 0006 CALL R3 2 + 0x90020603, // 0007 SETMBR R0 K3 R3 + 0x500C0200, // 0008 LDBOOL R3 1 0 + 0x90020A03, // 0009 SETMBR R0 K5 R3 + 0x80000000, // 000A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: parse_Pake1 +********************************************************************/ +be_local_closure(Matter_Commisioning_Context_parse_Pake1, /* name */ + be_nested_proto( + 18, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[82]) { /* constants */ + /* K0 */ be_nested_str_weak(crypto), + /* K1 */ be_nested_str_weak(opcode), + /* K2 */ be_nested_str_weak(local_session_id), + /* K3 */ be_const_int(0), + /* K4 */ be_nested_str_weak(protocol_id), + /* K5 */ be_nested_str_weak(protocol_error), + /* K6 */ be_nested_str_weak(invalid_X20Pake1_X20message), + /* K7 */ be_nested_str_weak(matter), + /* K8 */ be_nested_str_weak(Pake1), + /* K9 */ be_nested_str_weak(parse), + /* K10 */ be_nested_str_weak(raw), + /* K11 */ be_nested_str_weak(app_payload_idx), + /* K12 */ be_nested_str_weak(pA), + /* K13 */ be_nested_str_weak(tasmota), + /* K14 */ be_nested_str_weak(log), + /* K15 */ be_nested_str_weak(MTR_X3A_X20received_X20pA_X3D), + /* K16 */ be_nested_str_weak(tohex), + /* K17 */ be_const_int(3), + /* K18 */ be_nested_str_weak(MTR_X3A_X20spake_X3A_X20), + /* K19 */ be_nested_str_weak(inspect), + /* K20 */ be_nested_str_weak(spake), + /* K21 */ be_nested_str_weak(SPAKE2P_Matter), + /* K22 */ be_nested_str_weak(device), + /* K23 */ be_nested_str_weak(w0), + /* K24 */ be_nested_str_weak(w1), + /* K25 */ be_nested_str_weak(L), + /* K26 */ be_nested_str_weak(compute_pB), + /* K27 */ be_nested_str_weak(y), + /* K28 */ be_nested_str_weak(pB), + /* K29 */ be_nested_str_weak(MTR_X3A_X20y_X3D), + /* K30 */ be_nested_str_weak(MTR_X3A_X20pb_X3D), + /* K31 */ be_nested_str_weak(compute_ZV_verifier), + /* K32 */ be_nested_str_weak(MTR_X3A_X20Z_X3D), + /* K33 */ be_nested_str_weak(Z), + /* K34 */ be_nested_str_weak(MTR_X3A_X20V_X3D), + /* K35 */ be_nested_str_weak(V), + /* K36 */ be_nested_str_weak(SHA256), + /* K37 */ be_nested_str_weak(update), + /* K38 */ be_nested_str_weak(fromstring), + /* K39 */ be_nested_str_weak(Matter_Context_Prefix), + /* K40 */ be_nested_str_weak(PBKDFParamRequest), + /* K41 */ be_nested_str_weak(PBKDFParamResponse), + /* K42 */ be_nested_str_weak(out), + /* K43 */ be_nested_str_weak(MTR_X3A_X20Context_X3D), + /* K44 */ be_nested_str_weak(set_context), + /* K45 */ be_nested_str_weak(compute_TT_hash), + /* K46 */ be_nested_str_weak(MTR_X3A_X20_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D_X2D), + /* K47 */ be_nested_str_weak(MTR_X3A_X20Context_X20_X3D_X20), + /* K48 */ be_nested_str_weak(Context), + /* K49 */ be_nested_str_weak(MTR_X3A_X20A_X20_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K50 */ be_nested_str_weak(A), + /* K51 */ be_nested_str_weak(MTR_X3A_X20B_X20_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K52 */ be_nested_str_weak(B), + /* K53 */ be_nested_str_weak(MTR_X3A_X20M_X20_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K54 */ be_nested_str_weak(M), + /* K55 */ be_nested_str_weak(MTR_X3A_X20N_X20_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K56 */ be_nested_str_weak(N), + /* K57 */ be_nested_str_weak(MTR_X3A_X20pA_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K58 */ be_nested_str_weak(MTR_X3A_X20pB_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K59 */ be_nested_str_weak(MTR_X3A_X20Z_X20_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K60 */ be_nested_str_weak(MTR_X3A_X20V_X20_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K61 */ be_nested_str_weak(MTR_X3A_X20w0_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K62 */ be_nested_str_weak(MTR_X3A_X20Kmain_X20_X20_X20_X3D), + /* K63 */ be_nested_str_weak(Kmain), + /* K64 */ be_nested_str_weak(MTR_X3A_X20KcA_X20_X20_X20_X20_X20_X3D), + /* K65 */ be_nested_str_weak(KcA), + /* K66 */ be_nested_str_weak(MTR_X3A_X20KcB_X20_X20_X20_X20_X20_X3D), + /* K67 */ be_nested_str_weak(KcB), + /* K68 */ be_nested_str_weak(MTR_X3A_X20K_shared_X3D), + /* K69 */ be_nested_str_weak(K_shared), + /* K70 */ be_nested_str_weak(MTR_X3A_X20Ke_X20_X20_X20_X20_X20_X20_X3D), + /* K71 */ be_nested_str_weak(Ke), + /* K72 */ be_nested_str_weak(cB), + /* K73 */ be_nested_str_weak(MTR_X3A_X20cB_X3D), + /* K74 */ be_nested_str_weak(Pake2), + /* K75 */ be_nested_str_weak(MTR_X3A_X20pake2_X3A_X20), + /* K76 */ be_nested_str_weak(encode), + /* K77 */ be_nested_str_weak(MTR_X3A_X20pake2_raw_X3A_X20), + /* K78 */ be_nested_str_weak(build_response), + /* K79 */ be_nested_str_weak(responder), + /* K80 */ be_nested_str_weak(send_response), + /* K81 */ be_nested_str_weak(message_counter), + }), + be_str_weak(parse_Pake1), + &be_const_str_solidified, + ( &(const binstruction[326]) { /* code */ + 0xA4120000, // 0000 IMPORT R4 K0 + 0x88140301, // 0001 GETMBR R5 R1 K1 + 0x541A0021, // 0002 LDINT R6 34 + 0x20140A06, // 0003 NE R5 R5 R6 + 0x74160005, // 0004 JMPT R5 #000B + 0x88140302, // 0005 GETMBR R5 R1 K2 + 0x20140B03, // 0006 NE R5 R5 K3 + 0x74160002, // 0007 JMPT R5 #000B + 0x88140304, // 0008 GETMBR R5 R1 K4 + 0x20140B03, // 0009 NE R5 R5 K3 + 0x78160000, // 000A JMPF R5 #000C + 0xB0060B06, // 000B RAISE 1 K5 K6 + 0xB8160E00, // 000C GETNGBL R5 K7 + 0x8C140B08, // 000D GETMET R5 R5 K8 + 0x7C140200, // 000E CALL R5 1 + 0x8C140B09, // 000F GETMET R5 R5 K9 + 0x881C030A, // 0010 GETMBR R7 R1 K10 + 0x8820030B, // 0011 GETMBR R8 R1 K11 + 0x7C140600, // 0012 CALL R5 3 + 0x88180B0C, // 0013 GETMBR R6 R5 K12 + 0x90021806, // 0014 SETMBR R0 K12 R6 + 0xB81A1A00, // 0015 GETNGBL R6 K13 + 0x8C180D0E, // 0016 GETMET R6 R6 K14 + 0x8820010C, // 0017 GETMBR R8 R0 K12 + 0x8C201110, // 0018 GETMET R8 R8 K16 + 0x7C200200, // 0019 CALL R8 1 + 0x00221E08, // 001A ADD R8 K15 R8 + 0x58240011, // 001B LDCONST R9 K17 + 0x7C180600, // 001C CALL R6 3 + 0xB81A1A00, // 001D GETNGBL R6 K13 + 0x8C180D0E, // 001E GETMET R6 R6 K14 + 0xB8220E00, // 001F GETNGBL R8 K7 + 0x8C201113, // 0020 GETMET R8 R8 K19 + 0x88280114, // 0021 GETMBR R10 R0 K20 + 0x7C200400, // 0022 CALL R8 2 + 0x00222408, // 0023 ADD R8 K18 R8 + 0x58240011, // 0024 LDCONST R9 K17 + 0x7C180600, // 0025 CALL R6 3 + 0x8C180915, // 0026 GETMET R6 R4 K21 + 0x88200116, // 0027 GETMBR R8 R0 K22 + 0x88201117, // 0028 GETMBR R8 R8 K23 + 0x88240116, // 0029 GETMBR R9 R0 K22 + 0x88241318, // 002A GETMBR R9 R9 K24 + 0x88280116, // 002B GETMBR R10 R0 K22 + 0x88281519, // 002C GETMBR R10 R10 K25 + 0x7C180800, // 002D CALL R6 4 + 0x90022806, // 002E SETMBR R0 K20 R6 + 0x88180114, // 002F GETMBR R6 R0 K20 + 0x8C180D1A, // 0030 GETMET R6 R6 K26 + 0x8820011B, // 0031 GETMBR R8 R0 K27 + 0x7C180400, // 0032 CALL R6 2 + 0x88180114, // 0033 GETMBR R6 R0 K20 + 0x88180D1C, // 0034 GETMBR R6 R6 K28 + 0x90023806, // 0035 SETMBR R0 K28 R6 + 0xB81A1A00, // 0036 GETNGBL R6 K13 + 0x8C180D0E, // 0037 GETMET R6 R6 K14 + 0x8820011B, // 0038 GETMBR R8 R0 K27 + 0x8C201110, // 0039 GETMET R8 R8 K16 + 0x7C200200, // 003A CALL R8 1 + 0x00223A08, // 003B ADD R8 K29 R8 + 0x58240011, // 003C LDCONST R9 K17 + 0x7C180600, // 003D CALL R6 3 + 0xB81A1A00, // 003E GETNGBL R6 K13 + 0x8C180D0E, // 003F GETMET R6 R6 K14 + 0x8820011C, // 0040 GETMBR R8 R0 K28 + 0x8C201110, // 0041 GETMET R8 R8 K16 + 0x7C200200, // 0042 CALL R8 1 + 0x00223C08, // 0043 ADD R8 K30 R8 + 0x58240011, // 0044 LDCONST R9 K17 + 0x7C180600, // 0045 CALL R6 3 + 0x88180114, // 0046 GETMBR R6 R0 K20 + 0x8C180D1F, // 0047 GETMET R6 R6 K31 + 0x8820010C, // 0048 GETMBR R8 R0 K12 + 0x7C180400, // 0049 CALL R6 2 + 0xB81A1A00, // 004A GETNGBL R6 K13 + 0x8C180D0E, // 004B GETMET R6 R6 K14 + 0x88200114, // 004C GETMBR R8 R0 K20 + 0x88201121, // 004D GETMBR R8 R8 K33 + 0x8C201110, // 004E GETMET R8 R8 K16 + 0x7C200200, // 004F CALL R8 1 + 0x00224008, // 0050 ADD R8 K32 R8 + 0x58240011, // 0051 LDCONST R9 K17 + 0x7C180600, // 0052 CALL R6 3 + 0xB81A1A00, // 0053 GETNGBL R6 K13 + 0x8C180D0E, // 0054 GETMET R6 R6 K14 + 0x88200114, // 0055 GETMBR R8 R0 K20 + 0x88201123, // 0056 GETMBR R8 R8 K35 + 0x8C201110, // 0057 GETMET R8 R8 K16 + 0x7C200200, // 0058 CALL R8 1 + 0x00224408, // 0059 ADD R8 K34 R8 + 0x58240011, // 005A LDCONST R9 K17 + 0x7C180600, // 005B CALL R6 3 + 0x8C180924, // 005C GETMET R6 R4 K36 + 0x7C180200, // 005D CALL R6 1 + 0x8C1C0D25, // 005E GETMET R7 R6 K37 + 0x60240015, // 005F GETGBL R9 G21 + 0x7C240000, // 0060 CALL R9 0 + 0x8C241326, // 0061 GETMET R9 R9 K38 + 0x882C0127, // 0062 GETMBR R11 R0 K39 + 0x7C240400, // 0063 CALL R9 2 + 0x7C1C0400, // 0064 CALL R7 2 + 0x8C1C0D25, // 0065 GETMET R7 R6 K37 + 0x88240128, // 0066 GETMBR R9 R0 K40 + 0x7C1C0400, // 0067 CALL R7 2 + 0x8C1C0D25, // 0068 GETMET R7 R6 K37 + 0x88240129, // 0069 GETMBR R9 R0 K41 + 0x7C1C0400, // 006A CALL R7 2 + 0x8C1C0D2A, // 006B GETMET R7 R6 K42 + 0x7C1C0200, // 006C CALL R7 1 + 0xB8221A00, // 006D GETNGBL R8 K13 + 0x8C20110E, // 006E GETMET R8 R8 K14 + 0x8C280F10, // 006F GETMET R10 R7 K16 + 0x7C280200, // 0070 CALL R10 1 + 0x002A560A, // 0071 ADD R10 K43 R10 + 0x582C0011, // 0072 LDCONST R11 K17 + 0x7C200600, // 0073 CALL R8 3 + 0x88200114, // 0074 GETMBR R8 R0 K20 + 0x8824010C, // 0075 GETMBR R9 R0 K12 + 0x90221809, // 0076 SETMBR R8 K12 R9 + 0x88200114, // 0077 GETMBR R8 R0 K20 + 0x8C20112C, // 0078 GETMET R8 R8 K44 + 0x5C280E00, // 0079 MOVE R10 R7 + 0x7C200400, // 007A CALL R8 2 + 0x88200114, // 007B GETMBR R8 R0 K20 + 0x8C20112D, // 007C GETMET R8 R8 K45 + 0x50280200, // 007D LDBOOL R10 1 0 + 0x7C200400, // 007E CALL R8 2 + 0xB8221A00, // 007F GETNGBL R8 K13 + 0x8C20110E, // 0080 GETMET R8 R8 K14 + 0x5828002E, // 0081 LDCONST R10 K46 + 0x582C0011, // 0082 LDCONST R11 K17 + 0x7C200600, // 0083 CALL R8 3 + 0xB8221A00, // 0084 GETNGBL R8 K13 + 0x8C20110E, // 0085 GETMET R8 R8 K14 + 0x88280114, // 0086 GETMBR R10 R0 K20 + 0x88281530, // 0087 GETMBR R10 R10 K48 + 0x8C281510, // 0088 GETMET R10 R10 K16 + 0x7C280200, // 0089 CALL R10 1 + 0x002A5E0A, // 008A ADD R10 K47 R10 + 0x582C0011, // 008B LDCONST R11 K17 + 0x7C200600, // 008C CALL R8 3 + 0xB8221A00, // 008D GETNGBL R8 K13 + 0x8C20110E, // 008E GETMET R8 R8 K14 + 0x88280114, // 008F GETMBR R10 R0 K20 + 0x88281532, // 0090 GETMBR R10 R10 K50 + 0x8C281510, // 0091 GETMET R10 R10 K16 + 0x7C280200, // 0092 CALL R10 1 + 0x002A620A, // 0093 ADD R10 K49 R10 + 0x582C0011, // 0094 LDCONST R11 K17 + 0x7C200600, // 0095 CALL R8 3 + 0xB8221A00, // 0096 GETNGBL R8 K13 + 0x8C20110E, // 0097 GETMET R8 R8 K14 + 0x88280114, // 0098 GETMBR R10 R0 K20 + 0x88281534, // 0099 GETMBR R10 R10 K52 + 0x8C281510, // 009A GETMET R10 R10 K16 + 0x7C280200, // 009B CALL R10 1 + 0x002A660A, // 009C ADD R10 K51 R10 + 0x582C0011, // 009D LDCONST R11 K17 + 0x7C200600, // 009E CALL R8 3 + 0xB8221A00, // 009F GETNGBL R8 K13 + 0x8C20110E, // 00A0 GETMET R8 R8 K14 + 0x88280114, // 00A1 GETMBR R10 R0 K20 + 0x88281536, // 00A2 GETMBR R10 R10 K54 + 0x8C281510, // 00A3 GETMET R10 R10 K16 + 0x7C280200, // 00A4 CALL R10 1 + 0x002A6A0A, // 00A5 ADD R10 K53 R10 + 0x582C0011, // 00A6 LDCONST R11 K17 + 0x7C200600, // 00A7 CALL R8 3 + 0xB8221A00, // 00A8 GETNGBL R8 K13 + 0x8C20110E, // 00A9 GETMET R8 R8 K14 + 0x88280114, // 00AA GETMBR R10 R0 K20 + 0x88281538, // 00AB GETMBR R10 R10 K56 + 0x8C281510, // 00AC GETMET R10 R10 K16 + 0x7C280200, // 00AD CALL R10 1 + 0x002A6E0A, // 00AE ADD R10 K55 R10 + 0x582C0011, // 00AF LDCONST R11 K17 + 0x7C200600, // 00B0 CALL R8 3 + 0xB8221A00, // 00B1 GETNGBL R8 K13 + 0x8C20110E, // 00B2 GETMET R8 R8 K14 + 0x88280114, // 00B3 GETMBR R10 R0 K20 + 0x8828150C, // 00B4 GETMBR R10 R10 K12 + 0x8C281510, // 00B5 GETMET R10 R10 K16 + 0x7C280200, // 00B6 CALL R10 1 + 0x002A720A, // 00B7 ADD R10 K57 R10 + 0x582C0011, // 00B8 LDCONST R11 K17 + 0x7C200600, // 00B9 CALL R8 3 + 0xB8221A00, // 00BA GETNGBL R8 K13 + 0x8C20110E, // 00BB GETMET R8 R8 K14 + 0x88280114, // 00BC GETMBR R10 R0 K20 + 0x8828151C, // 00BD GETMBR R10 R10 K28 + 0x8C281510, // 00BE GETMET R10 R10 K16 + 0x7C280200, // 00BF CALL R10 1 + 0x002A740A, // 00C0 ADD R10 K58 R10 + 0x582C0011, // 00C1 LDCONST R11 K17 + 0x7C200600, // 00C2 CALL R8 3 + 0xB8221A00, // 00C3 GETNGBL R8 K13 + 0x8C20110E, // 00C4 GETMET R8 R8 K14 + 0x88280114, // 00C5 GETMBR R10 R0 K20 + 0x88281521, // 00C6 GETMBR R10 R10 K33 + 0x8C281510, // 00C7 GETMET R10 R10 K16 + 0x7C280200, // 00C8 CALL R10 1 + 0x002A760A, // 00C9 ADD R10 K59 R10 + 0x582C0011, // 00CA LDCONST R11 K17 + 0x7C200600, // 00CB CALL R8 3 + 0xB8221A00, // 00CC GETNGBL R8 K13 + 0x8C20110E, // 00CD GETMET R8 R8 K14 + 0x88280114, // 00CE GETMBR R10 R0 K20 + 0x88281523, // 00CF GETMBR R10 R10 K35 + 0x8C281510, // 00D0 GETMET R10 R10 K16 + 0x7C280200, // 00D1 CALL R10 1 + 0x002A780A, // 00D2 ADD R10 K60 R10 + 0x582C0011, // 00D3 LDCONST R11 K17 + 0x7C200600, // 00D4 CALL R8 3 + 0xB8221A00, // 00D5 GETNGBL R8 K13 + 0x8C20110E, // 00D6 GETMET R8 R8 K14 + 0x88280114, // 00D7 GETMBR R10 R0 K20 + 0x88281517, // 00D8 GETMBR R10 R10 K23 + 0x8C281510, // 00D9 GETMET R10 R10 K16 + 0x7C280200, // 00DA CALL R10 1 + 0x002A7A0A, // 00DB ADD R10 K61 R10 + 0x582C0011, // 00DC LDCONST R11 K17 + 0x7C200600, // 00DD CALL R8 3 + 0xB8221A00, // 00DE GETNGBL R8 K13 + 0x8C20110E, // 00DF GETMET R8 R8 K14 + 0x5828002E, // 00E0 LDCONST R10 K46 + 0x582C0011, // 00E1 LDCONST R11 K17 + 0x7C200600, // 00E2 CALL R8 3 + 0xB8221A00, // 00E3 GETNGBL R8 K13 + 0x8C20110E, // 00E4 GETMET R8 R8 K14 + 0x88280114, // 00E5 GETMBR R10 R0 K20 + 0x8828153F, // 00E6 GETMBR R10 R10 K63 + 0x8C281510, // 00E7 GETMET R10 R10 K16 + 0x7C280200, // 00E8 CALL R10 1 + 0x002A7C0A, // 00E9 ADD R10 K62 R10 + 0x582C0011, // 00EA LDCONST R11 K17 + 0x7C200600, // 00EB CALL R8 3 + 0xB8221A00, // 00EC GETNGBL R8 K13 + 0x8C20110E, // 00ED GETMET R8 R8 K14 + 0x88280114, // 00EE GETMBR R10 R0 K20 + 0x88281541, // 00EF GETMBR R10 R10 K65 + 0x8C281510, // 00F0 GETMET R10 R10 K16 + 0x7C280200, // 00F1 CALL R10 1 + 0x002A800A, // 00F2 ADD R10 K64 R10 + 0x582C0011, // 00F3 LDCONST R11 K17 + 0x7C200600, // 00F4 CALL R8 3 + 0xB8221A00, // 00F5 GETNGBL R8 K13 + 0x8C20110E, // 00F6 GETMET R8 R8 K14 + 0x88280114, // 00F7 GETMBR R10 R0 K20 + 0x88281543, // 00F8 GETMBR R10 R10 K67 + 0x8C281510, // 00F9 GETMET R10 R10 K16 + 0x7C280200, // 00FA CALL R10 1 + 0x002A840A, // 00FB ADD R10 K66 R10 + 0x582C0011, // 00FC LDCONST R11 K17 + 0x7C200600, // 00FD CALL R8 3 + 0xB8221A00, // 00FE GETNGBL R8 K13 + 0x8C20110E, // 00FF GETMET R8 R8 K14 + 0x88280114, // 0100 GETMBR R10 R0 K20 + 0x88281545, // 0101 GETMBR R10 R10 K69 + 0x8C281510, // 0102 GETMET R10 R10 K16 + 0x7C280200, // 0103 CALL R10 1 + 0x002A880A, // 0104 ADD R10 K68 R10 + 0x582C0011, // 0105 LDCONST R11 K17 + 0x7C200600, // 0106 CALL R8 3 + 0xB8221A00, // 0107 GETNGBL R8 K13 + 0x8C20110E, // 0108 GETMET R8 R8 K14 + 0x88280114, // 0109 GETMBR R10 R0 K20 + 0x88281547, // 010A GETMBR R10 R10 K71 + 0x8C281510, // 010B GETMET R10 R10 K16 + 0x7C280200, // 010C CALL R10 1 + 0x002A8C0A, // 010D ADD R10 K70 R10 + 0x582C0011, // 010E LDCONST R11 K17 + 0x7C200600, // 010F CALL R8 3 + 0x88200114, // 0110 GETMBR R8 R0 K20 + 0x88201148, // 0111 GETMBR R8 R8 K72 + 0x90029008, // 0112 SETMBR R0 K72 R8 + 0x88200114, // 0113 GETMBR R8 R0 K20 + 0x88201147, // 0114 GETMBR R8 R8 K71 + 0x90028E08, // 0115 SETMBR R0 K71 R8 + 0xB8221A00, // 0116 GETNGBL R8 K13 + 0x8C20110E, // 0117 GETMET R8 R8 K14 + 0x88280148, // 0118 GETMBR R10 R0 K72 + 0x8C281510, // 0119 GETMET R10 R10 K16 + 0x7C280200, // 011A CALL R10 1 + 0x002A920A, // 011B ADD R10 K73 R10 + 0x582C0011, // 011C LDCONST R11 K17 + 0x7C200600, // 011D CALL R8 3 + 0xB8220E00, // 011E GETNGBL R8 K7 + 0x8C20114A, // 011F GETMET R8 R8 K74 + 0x7C200200, // 0120 CALL R8 1 + 0x8824011C, // 0121 GETMBR R9 R0 K28 + 0x90223809, // 0122 SETMBR R8 K28 R9 + 0x88240148, // 0123 GETMBR R9 R0 K72 + 0x90229009, // 0124 SETMBR R8 K72 R9 + 0xB8261A00, // 0125 GETNGBL R9 K13 + 0x8C24130E, // 0126 GETMET R9 R9 K14 + 0xB82E0E00, // 0127 GETNGBL R11 K7 + 0x8C2C1713, // 0128 GETMET R11 R11 K19 + 0x5C341000, // 0129 MOVE R13 R8 + 0x7C2C0400, // 012A CALL R11 2 + 0x002E960B, // 012B ADD R11 K75 R11 + 0x58300011, // 012C LDCONST R12 K17 + 0x7C240600, // 012D CALL R9 3 + 0x8C24114C, // 012E GETMET R9 R8 K76 + 0x7C240200, // 012F CALL R9 1 + 0xB82A1A00, // 0130 GETNGBL R10 K13 + 0x8C28150E, // 0131 GETMET R10 R10 K14 + 0x8C301310, // 0132 GETMET R12 R9 K16 + 0x7C300200, // 0133 CALL R12 1 + 0x00329A0C, // 0134 ADD R12 K77 R12 + 0x58340011, // 0135 LDCONST R13 K17 + 0x7C280600, // 0136 CALL R10 3 + 0x8C28034E, // 0137 GETMET R10 R1 K78 + 0x54320022, // 0138 LDINT R12 35 + 0x50340200, // 0139 LDBOOL R13 1 0 + 0x7C280600, // 013A CALL R10 3 + 0x8C2C154C, // 013B GETMET R11 R10 K76 + 0x5C341200, // 013C MOVE R13 R9 + 0x7C2C0400, // 013D CALL R11 2 + 0x8830014F, // 013E GETMBR R12 R0 K79 + 0x8C301950, // 013F GETMET R12 R12 K80 + 0x5C381600, // 0140 MOVE R14 R11 + 0x5C3C0400, // 0141 MOVE R15 R2 + 0x5C400600, // 0142 MOVE R16 R3 + 0x88441551, // 0143 GETMBR R17 R10 K81 + 0x7C300A00, // 0144 CALL R12 5 + 0x80000000, // 0145 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: find_session_by_destination_id +********************************************************************/ +be_local_closure(Matter_Commisioning_Context_find_session_by_destination_id, /* name */ + be_nested_proto( + 14, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[22]) { /* constants */ + /* K0 */ be_nested_str_weak(crypto), + /* K1 */ be_nested_str_weak(tasmota), + /* K2 */ be_nested_str_weak(log), + /* K3 */ be_nested_str_weak(MTR_X3A_X20SEARCHING_X3A_X20destinationId_X3D), + /* K4 */ be_nested_str_weak(tohex), + /* K5 */ be_const_int(3), + /* K6 */ be_nested_str_weak(device), + /* K7 */ be_nested_str_weak(sessions), + /* K8 */ be_nested_str_weak(noc), + /* K9 */ be_nested_str_weak(fabric), + /* K10 */ be_nested_str_weak(deviceid), + /* K11 */ be_nested_str_weak(get_ca_pub), + /* K12 */ be_nested_str_weak(get_fabric), + /* K13 */ be_nested_str_weak(get_deviceid), + /* K14 */ be_nested_str_weak(get_ipk_group_key), + /* K15 */ be_nested_str_weak(MTR_X3A_X20SIGMA1_X3A_X20destinationMessage_X3D), + /* K16 */ be_nested_str_weak(MTR_X3A_X20SIGMA1_X3A_X20key_ipk_X3D), + /* K17 */ be_nested_str_weak(HMAC_SHA256), + /* K18 */ be_nested_str_weak(update), + /* K19 */ be_nested_str_weak(out), + /* K20 */ be_nested_str_weak(MTR_X3A_X20SIGMA1_X3A_X20candidateDestinationId_X3D), + /* K21 */ be_nested_str_weak(stop_iteration), + }), + be_str_weak(find_session_by_destination_id), + &be_const_str_solidified, + ( &(const binstruction[79]) { /* code */ + 0xA40E0000, // 0000 IMPORT R3 K0 + 0xB8120200, // 0001 GETNGBL R4 K1 + 0x8C100902, // 0002 GETMET R4 R4 K2 + 0x8C180304, // 0003 GETMET R6 R1 K4 + 0x7C180200, // 0004 CALL R6 1 + 0x001A0606, // 0005 ADD R6 K3 R6 + 0x581C0005, // 0006 LDCONST R7 K5 + 0x7C100600, // 0007 CALL R4 3 + 0x60100010, // 0008 GETGBL R4 G16 + 0x88140106, // 0009 GETMBR R5 R0 K6 + 0x88140B07, // 000A GETMBR R5 R5 K7 + 0x88140B07, // 000B GETMBR R5 R5 K7 + 0x7C100200, // 000C CALL R4 1 + 0xA802003B, // 000D EXBLK 0 #004A + 0x5C140800, // 000E MOVE R5 R4 + 0x7C140000, // 000F CALL R5 0 + 0x88180B08, // 0010 GETMBR R6 R5 K8 + 0x4C1C0000, // 0011 LDNIL R7 + 0x1C180C07, // 0012 EQ R6 R6 R7 + 0x741A0007, // 0013 JMPT R6 #001C + 0x88180B09, // 0014 GETMBR R6 R5 K9 + 0x4C1C0000, // 0015 LDNIL R7 + 0x1C180C07, // 0016 EQ R6 R6 R7 + 0x741A0003, // 0017 JMPT R6 #001C + 0x88180B0A, // 0018 GETMBR R6 R5 K10 + 0x4C1C0000, // 0019 LDNIL R7 + 0x1C180C07, // 001A EQ R6 R6 R7 + 0x781A0000, // 001B JMPF R6 #001D + 0x7001FFF0, // 001C JMP #000E + 0x8C180B0B, // 001D GETMET R6 R5 K11 + 0x7C180200, // 001E CALL R6 1 + 0x00180406, // 001F ADD R6 R2 R6 + 0x8C1C0B0C, // 0020 GETMET R7 R5 K12 + 0x7C1C0200, // 0021 CALL R7 1 + 0x00180C07, // 0022 ADD R6 R6 R7 + 0x8C1C0B0D, // 0023 GETMET R7 R5 K13 + 0x7C1C0200, // 0024 CALL R7 1 + 0x00180C07, // 0025 ADD R6 R6 R7 + 0x8C1C0B0E, // 0026 GETMET R7 R5 K14 + 0x7C1C0200, // 0027 CALL R7 1 + 0xB8220200, // 0028 GETNGBL R8 K1 + 0x8C201102, // 0029 GETMET R8 R8 K2 + 0x8C280D04, // 002A GETMET R10 R6 K4 + 0x7C280200, // 002B CALL R10 1 + 0x002A1E0A, // 002C ADD R10 K15 R10 + 0x582C0005, // 002D LDCONST R11 K5 + 0x7C200600, // 002E CALL R8 3 + 0xB8220200, // 002F GETNGBL R8 K1 + 0x8C201102, // 0030 GETMET R8 R8 K2 + 0x8C280F04, // 0031 GETMET R10 R7 K4 + 0x7C280200, // 0032 CALL R10 1 + 0x002A200A, // 0033 ADD R10 K16 R10 + 0x582C0005, // 0034 LDCONST R11 K5 + 0x7C200600, // 0035 CALL R8 3 + 0x8C200711, // 0036 GETMET R8 R3 K17 + 0x5C280E00, // 0037 MOVE R10 R7 + 0x7C200400, // 0038 CALL R8 2 + 0x8C241112, // 0039 GETMET R9 R8 K18 + 0x5C2C0C00, // 003A MOVE R11 R6 + 0x7C240400, // 003B CALL R9 2 + 0x8C241113, // 003C GETMET R9 R8 K19 + 0x7C240200, // 003D CALL R9 1 + 0xB82A0200, // 003E GETNGBL R10 K1 + 0x8C281502, // 003F GETMET R10 R10 K2 + 0x8C301304, // 0040 GETMET R12 R9 K4 + 0x7C300200, // 0041 CALL R12 1 + 0x0032280C, // 0042 ADD R12 K20 R12 + 0x58340005, // 0043 LDCONST R13 K5 + 0x7C280600, // 0044 CALL R10 3 + 0x1C281201, // 0045 EQ R10 R9 R1 + 0x782A0001, // 0046 JMPF R10 #0049 + 0xA8040001, // 0047 EXBLK 1 1 + 0x80040A00, // 0048 RET 1 R5 + 0x7001FFC3, // 0049 JMP #000E + 0x58100015, // 004A LDCONST R4 K21 + 0xAC100200, // 004B CATCH R4 1 0 + 0xB0080000, // 004C RAISE 2 R0 R0 + 0x4C100000, // 004D LDNIL R4 + 0x80040800, // 004E RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: every_second +********************************************************************/ +be_local_closure(Matter_Commisioning_Context_every_second, /* name */ + be_nested_proto( + 1, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(every_second), + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: parse_Sigma3 +********************************************************************/ +be_local_closure(Matter_Commisioning_Context_parse_Sigma3, /* name */ + be_nested_proto( + 40, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[92]) { /* constants */ + /* K0 */ be_nested_str_weak(crypto), + /* K1 */ be_nested_str_weak(opcode), + /* K2 */ be_nested_str_weak(local_session_id), + /* K3 */ be_const_int(0), + /* K4 */ be_nested_str_weak(protocol_id), + /* K5 */ be_nested_str_weak(protocol_error), + /* K6 */ be_nested_str_weak(invalid_X20Pake1_X20message), + /* K7 */ be_nested_str_weak(session), + /* K8 */ be_nested_str_weak(matter), + /* K9 */ be_nested_str_weak(Sigma3), + /* K10 */ be_nested_str_weak(parse), + /* K11 */ be_nested_str_weak(raw), + /* K12 */ be_nested_str_weak(app_payload_idx), + /* K13 */ be_nested_str_weak(tasmota), + /* K14 */ be_nested_str_weak(log), + /* K15 */ be_nested_str_weak(_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A), + /* K16 */ be_const_int(3), + /* K17 */ be_nested_str_weak(SHA256), + /* K18 */ be_nested_str_weak(update), + /* K19 */ be_nested_str_weak(_Msg1), + /* K20 */ be_nested_str_weak(_Msg2), + /* K21 */ be_nested_str_weak(out), + /* K22 */ be_nested_str_weak(MTR_X3A_X20_X2A_X20session_X20_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K23 */ be_nested_str_weak(MTR_X3A_X20session_X2Eipk_epoch_key_X20), + /* K24 */ be_nested_str_weak(ipk_epoch_key), + /* K25 */ be_nested_str_weak(MTR_X3A_X20session_X2Efabric_compressed_X20), + /* K26 */ be_nested_str_weak(fabric_compressed), + /* K27 */ be_nested_str_weak(MTR_X3A_X20_X2A_X20ipk_group_key_X20_X3D_X20), + /* K28 */ be_nested_str_weak(get_ipk_group_key), + /* K29 */ be_nested_str_weak(tohex), + /* K30 */ be_nested_str_weak(MTR_X3A_X20_X2A_X20TranscriptHash_X3D_X20), + /* K31 */ be_nested_str_weak(fromstring), + /* K32 */ be_nested_str_weak(S3K_Info), + /* K33 */ be_nested_str_weak(HKDF_SHA256), + /* K34 */ be_nested_str_weak(derive), + /* K35 */ be_nested_str_weak(shared_secret), + /* K36 */ be_nested_str_weak(MTR_X3A_X20_X2A_X20s3k_salt_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K37 */ be_nested_str_weak(MTR_X3A_X20_X2A_X20s3k_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K38 */ be_nested_str_weak(TBEData3Encrypted), + /* K39 */ be_const_int(2147483647), + /* K40 */ be_nested_str_weak(AES_CCM), + /* K41 */ be_nested_str_weak(TBEData3_Nonce), + /* K42 */ be_nested_str_weak(decrypt), + /* K43 */ be_nested_str_weak(tag), + /* K44 */ be_nested_str_weak(MTR_X3A_X20_X2A_X20TBEData3_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K45 */ be_nested_str_weak(MTR_X3A_X20_X2A_X20TBETag3_X20_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K46 */ be_nested_str_weak(MTR_X3A_X20_X2A_X20tag_sent_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K47 */ be_nested_str_weak(value_error), + /* K48 */ be_nested_str_weak(tag_X20do_X20not_X20match), + /* K49 */ be_nested_str_weak(TLV), + /* K50 */ be_nested_str_weak(findsubval), + /* K51 */ be_const_int(1), + /* K52 */ be_const_int(2), + /* K53 */ be_nested_str_weak(MTR_X3A_X20initiatorNOCTLV_X20_X3D_X20), + /* K54 */ be_nested_str_weak(findsub), + /* K55 */ be_nested_str_weak(int), + /* K56 */ be_nested_str_weak(int64), + /* K57 */ be_nested_str_weak(peer_node_id), + /* K58 */ be_nested_str_weak(tobytes), + /* K59 */ be_nested_str_weak(MTR_X3A_X20initiatorFabricId_X3D), + /* K60 */ be_nested_str_weak(Matter_TLV_struct), + /* K61 */ be_nested_str_weak(add_TLV), + /* K62 */ be_nested_str_weak(B1), + /* K63 */ be_nested_str_weak(initiatorEph_pub), + /* K64 */ be_nested_str_weak(ResponderEph_pub), + /* K65 */ be_nested_str_weak(encode), + /* K66 */ be_nested_str_weak(MTR_X3A_X20_X2A_X20initiatorNOCPubKey_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K67 */ be_nested_str_weak(MTR_X3A_X20_X2A_X20ec_signature_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K68 */ be_nested_str_weak(EC_P256), + /* K69 */ be_nested_str_weak(ecdsa_verify_sha256), + /* K70 */ be_nested_str_weak(sigma3_tbs_X20does_X20not_X20have_X20a_X20valid_X20signature), + /* K71 */ be_nested_str_weak(MTR_X3A_X20Sigma3_X20verified_X2C_X20computing_X20new_X20keys), + /* K72 */ be_nested_str_weak(Msg3), + /* K73 */ be_nested_str_weak(MTR_X3A_X20_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A), + /* K74 */ be_nested_str_weak(MTR_X3A_X20shared_secret_X20_X3D), + /* K75 */ be_nested_str_weak(MTR_X3A_X20ipk_X20_X2B_X20hash_X20_X20_X20_X20_X3D), + /* K76 */ be_nested_str_weak(SEKeys_Info), + /* K77 */ be_nested_str_weak(rtc), + /* K78 */ be_nested_str_weak(utc), + /* K79 */ be_nested_str_weak(MTR_X3A_X20I2RKey_X20_X20_X20_X20_X20_X20_X3D), + /* K80 */ be_nested_str_weak(MTR_X3A_X20R2IKey_X20_X20_X20_X20_X20_X20_X3D), + /* K81 */ be_nested_str_weak(MTR_X3A_X20AC_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D), + /* K82 */ be_nested_str_weak(build_response), + /* K83 */ be_nested_str_weak(add), + /* K84 */ be_nested_str_weak(responder), + /* K85 */ be_nested_str_weak(send_response), + /* K86 */ be_nested_str_weak(message_counter), + /* K87 */ be_nested_str_weak(close), + /* K88 */ be_nested_str_weak(set_keys), + /* K89 */ be_nested_str_weak(set_persist), + /* K90 */ be_nested_str_weak(set_no_expiration), + /* K91 */ be_nested_str_weak(save), + }), + be_str_weak(parse_Sigma3), + &be_const_str_solidified, + ( &(const binstruction[445]) { /* code */ + 0xA4120000, // 0000 IMPORT R4 K0 + 0x88140301, // 0001 GETMBR R5 R1 K1 + 0x541A0031, // 0002 LDINT R6 50 + 0x20140A06, // 0003 NE R5 R5 R6 + 0x74160005, // 0004 JMPT R5 #000B + 0x88140302, // 0005 GETMBR R5 R1 K2 + 0x20140B03, // 0006 NE R5 R5 K3 + 0x74160002, // 0007 JMPT R5 #000B + 0x88140304, // 0008 GETMBR R5 R1 K4 + 0x20140B03, // 0009 NE R5 R5 K3 + 0x78160000, // 000A JMPF R5 #000C + 0xB0060B06, // 000B RAISE 1 K5 K6 + 0x88140307, // 000C GETMBR R5 R1 K7 + 0xB81A1000, // 000D GETNGBL R6 K8 + 0x8C180D09, // 000E GETMET R6 R6 K9 + 0x7C180200, // 000F CALL R6 1 + 0x8C180D0A, // 0010 GETMET R6 R6 K10 + 0x8820030B, // 0011 GETMBR R8 R1 K11 + 0x8824030C, // 0012 GETMBR R9 R1 K12 + 0x7C180600, // 0013 CALL R6 3 + 0xB81E1A00, // 0014 GETNGBL R7 K13 + 0x8C1C0F0E, // 0015 GETMET R7 R7 K14 + 0x5824000F, // 0016 LDCONST R9 K15 + 0x58280010, // 0017 LDCONST R10 K16 + 0x7C1C0600, // 0018 CALL R7 3 + 0x8C1C0911, // 0019 GETMET R7 R4 K17 + 0x7C1C0200, // 001A CALL R7 1 + 0x8C1C0F12, // 001B GETMET R7 R7 K18 + 0x88240B13, // 001C GETMBR R9 R5 K19 + 0x7C1C0400, // 001D CALL R7 2 + 0x8C1C0F12, // 001E GETMET R7 R7 K18 + 0x88240B14, // 001F GETMBR R9 R5 K20 + 0x7C1C0400, // 0020 CALL R7 2 + 0x8C1C0F15, // 0021 GETMET R7 R7 K21 + 0x7C1C0200, // 0022 CALL R7 1 + 0xB8221A00, // 0023 GETNGBL R8 K13 + 0x8C20110E, // 0024 GETMET R8 R8 K14 + 0x60280008, // 0025 GETGBL R10 G8 + 0x5C2C0A00, // 0026 MOVE R11 R5 + 0x7C280200, // 0027 CALL R10 1 + 0x002A2C0A, // 0028 ADD R10 K22 R10 + 0x582C0010, // 0029 LDCONST R11 K16 + 0x7C200600, // 002A CALL R8 3 + 0xB8221A00, // 002B GETNGBL R8 K13 + 0x8C20110E, // 002C GETMET R8 R8 K14 + 0x60280008, // 002D GETGBL R10 G8 + 0x882C0B18, // 002E GETMBR R11 R5 K24 + 0x7C280200, // 002F CALL R10 1 + 0x002A2E0A, // 0030 ADD R10 K23 R10 + 0x582C0010, // 0031 LDCONST R11 K16 + 0x7C200600, // 0032 CALL R8 3 + 0xB8221A00, // 0033 GETNGBL R8 K13 + 0x8C20110E, // 0034 GETMET R8 R8 K14 + 0x60280008, // 0035 GETGBL R10 G8 + 0x882C0B1A, // 0036 GETMBR R11 R5 K26 + 0x7C280200, // 0037 CALL R10 1 + 0x002A320A, // 0038 ADD R10 K25 R10 + 0x582C0010, // 0039 LDCONST R11 K16 + 0x7C200600, // 003A CALL R8 3 + 0xB8221A00, // 003B GETNGBL R8 K13 + 0x8C20110E, // 003C GETMET R8 R8 K14 + 0x8C280B1C, // 003D GETMET R10 R5 K28 + 0x7C280200, // 003E CALL R10 1 + 0x8C28151D, // 003F GETMET R10 R10 K29 + 0x7C280200, // 0040 CALL R10 1 + 0x002A360A, // 0041 ADD R10 K27 R10 + 0x582C0010, // 0042 LDCONST R11 K16 + 0x7C200600, // 0043 CALL R8 3 + 0xB8221A00, // 0044 GETNGBL R8 K13 + 0x8C20110E, // 0045 GETMET R8 R8 K14 + 0x8C280F1D, // 0046 GETMET R10 R7 K29 + 0x7C280200, // 0047 CALL R10 1 + 0x002A3C0A, // 0048 ADD R10 K30 R10 + 0x582C0010, // 0049 LDCONST R11 K16 + 0x7C200600, // 004A CALL R8 3 + 0x60200015, // 004B GETGBL R8 G21 + 0x7C200000, // 004C CALL R8 0 + 0x8C20111F, // 004D GETMET R8 R8 K31 + 0x88280120, // 004E GETMBR R10 R0 K32 + 0x7C200400, // 004F CALL R8 2 + 0x8C240921, // 0050 GETMET R9 R4 K33 + 0x7C240200, // 0051 CALL R9 1 + 0x8C241322, // 0052 GETMET R9 R9 K34 + 0x882C0B23, // 0053 GETMBR R11 R5 K35 + 0x8C300B1C, // 0054 GETMET R12 R5 K28 + 0x7C300200, // 0055 CALL R12 1 + 0x00301807, // 0056 ADD R12 R12 R7 + 0x5C341000, // 0057 MOVE R13 R8 + 0x543A000F, // 0058 LDINT R14 16 + 0x7C240A00, // 0059 CALL R9 5 + 0xB82A1A00, // 005A GETNGBL R10 K13 + 0x8C28150E, // 005B GETMET R10 R10 K14 + 0x5830000F, // 005C LDCONST R12 K15 + 0x58340010, // 005D LDCONST R13 K16 + 0x7C280600, // 005E CALL R10 3 + 0xB82A1A00, // 005F GETNGBL R10 K13 + 0x8C28150E, // 0060 GETMET R10 R10 K14 + 0x8C300B1C, // 0061 GETMET R12 R5 K28 + 0x7C300200, // 0062 CALL R12 1 + 0x00301807, // 0063 ADD R12 R12 R7 + 0x8C30191D, // 0064 GETMET R12 R12 K29 + 0x7C300200, // 0065 CALL R12 1 + 0x0032480C, // 0066 ADD R12 K36 R12 + 0x58340010, // 0067 LDCONST R13 K16 + 0x7C280600, // 0068 CALL R10 3 + 0xB82A1A00, // 0069 GETNGBL R10 K13 + 0x8C28150E, // 006A GETMET R10 R10 K14 + 0x8C30131D, // 006B GETMET R12 R9 K29 + 0x7C300200, // 006C CALL R12 1 + 0x00324A0C, // 006D ADD R12 K37 R12 + 0x58340010, // 006E LDCONST R13 K16 + 0x7C280600, // 006F CALL R10 3 + 0xB82A1A00, // 0070 GETNGBL R10 K13 + 0x8C28150E, // 0071 GETMET R10 R10 K14 + 0x5830000F, // 0072 LDCONST R12 K15 + 0x58340010, // 0073 LDCONST R13 K16 + 0x7C280600, // 0074 CALL R10 3 + 0x5429FFEE, // 0075 LDINT R10 -17 + 0x402A060A, // 0076 CONNECT R10 K3 R10 + 0x882C0D26, // 0077 GETMBR R11 R6 K38 + 0x9428160A, // 0078 GETIDX R10 R11 R10 + 0x5431FFEF, // 0079 LDINT R12 -16 + 0x40301927, // 007A CONNECT R12 R12 K39 + 0x88340D26, // 007B GETMBR R13 R6 K38 + 0x942C1A0C, // 007C GETIDX R11 R13 R12 + 0x8C380928, // 007D GETMET R14 R4 K40 + 0x5C401200, // 007E MOVE R16 R9 + 0x60440015, // 007F GETGBL R17 G21 + 0x7C440000, // 0080 CALL R17 0 + 0x8C44231F, // 0081 GETMET R17 R17 K31 + 0x884C0129, // 0082 GETMBR R19 R0 K41 + 0x7C440400, // 0083 CALL R17 2 + 0x60480015, // 0084 GETGBL R18 G21 + 0x7C480000, // 0085 CALL R18 0 + 0x604C000C, // 0086 GETGBL R19 G12 + 0x5C501400, // 0087 MOVE R20 R10 + 0x7C4C0200, // 0088 CALL R19 1 + 0x5452000F, // 0089 LDINT R20 16 + 0x7C380C00, // 008A CALL R14 6 + 0x5C301C00, // 008B MOVE R12 R14 + 0x8C38192A, // 008C GETMET R14 R12 K42 + 0x5C401400, // 008D MOVE R16 R10 + 0x7C380400, // 008E CALL R14 2 + 0x5C341C00, // 008F MOVE R13 R14 + 0x8C38192B, // 0090 GETMET R14 R12 K43 + 0x7C380200, // 0091 CALL R14 1 + 0xB83E1A00, // 0092 GETNGBL R15 K13 + 0x8C3C1F0E, // 0093 GETMET R15 R15 K14 + 0x8C441B1D, // 0094 GETMET R17 R13 K29 + 0x7C440200, // 0095 CALL R17 1 + 0x00465811, // 0096 ADD R17 K44 R17 + 0x58480010, // 0097 LDCONST R18 K16 + 0x7C3C0600, // 0098 CALL R15 3 + 0xB83E1A00, // 0099 GETNGBL R15 K13 + 0x8C3C1F0E, // 009A GETMET R15 R15 K14 + 0x8C441D1D, // 009B GETMET R17 R14 K29 + 0x7C440200, // 009C CALL R17 1 + 0x00465A11, // 009D ADD R17 K45 R17 + 0x58480010, // 009E LDCONST R18 K16 + 0x7C3C0600, // 009F CALL R15 3 + 0xB83E1A00, // 00A0 GETNGBL R15 K13 + 0x8C3C1F0E, // 00A1 GETMET R15 R15 K14 + 0x8C44171D, // 00A2 GETMET R17 R11 K29 + 0x7C440200, // 00A3 CALL R17 1 + 0x00465C11, // 00A4 ADD R17 K46 R17 + 0x58480010, // 00A5 LDCONST R18 K16 + 0x7C3C0600, // 00A6 CALL R15 3 + 0xB83E1A00, // 00A7 GETNGBL R15 K13 + 0x8C3C1F0E, // 00A8 GETMET R15 R15 K14 + 0x5844000F, // 00A9 LDCONST R17 K15 + 0x58480010, // 00AA LDCONST R18 K16 + 0x7C3C0600, // 00AB CALL R15 3 + 0x203C1C0B, // 00AC NE R15 R14 R11 + 0x783E0000, // 00AD JMPF R15 #00AF + 0xB0065F30, // 00AE RAISE 1 K47 K48 + 0xB83E1000, // 00AF GETNGBL R15 K8 + 0x883C1F31, // 00B0 GETMBR R15 R15 K49 + 0x8C3C1F0A, // 00B1 GETMET R15 R15 K10 + 0x5C441A00, // 00B2 MOVE R17 R13 + 0x7C3C0400, // 00B3 CALL R15 2 + 0x8C401F32, // 00B4 GETMET R16 R15 K50 + 0x58480033, // 00B5 LDCONST R18 K51 + 0x7C400400, // 00B6 CALL R16 2 + 0x8C441F32, // 00B7 GETMET R17 R15 K50 + 0x584C0034, // 00B8 LDCONST R19 K52 + 0x7C440400, // 00B9 CALL R17 2 + 0x8C481F32, // 00BA GETMET R18 R15 K50 + 0x58500010, // 00BB LDCONST R20 K16 + 0x7C480400, // 00BC CALL R18 2 + 0xB84E1000, // 00BD GETNGBL R19 K8 + 0x884C2731, // 00BE GETMBR R19 R19 K49 + 0x8C4C270A, // 00BF GETMET R19 R19 K10 + 0x5C542000, // 00C0 MOVE R21 R16 + 0x7C4C0400, // 00C1 CALL R19 2 + 0xB8521A00, // 00C2 GETNGBL R20 K13 + 0x8C50290E, // 00C3 GETMET R20 R20 K14 + 0x60580008, // 00C4 GETGBL R22 G8 + 0x5C5C2600, // 00C5 MOVE R23 R19 + 0x7C580200, // 00C6 CALL R22 1 + 0x005A6A16, // 00C7 ADD R22 K53 R22 + 0x585C0010, // 00C8 LDCONST R23 K16 + 0x7C500600, // 00C9 CALL R20 3 + 0x8C502732, // 00CA GETMET R20 R19 K50 + 0x545A0008, // 00CB LDINT R22 9 + 0x7C500400, // 00CC CALL R20 2 + 0x8C542736, // 00CD GETMET R21 R19 K54 + 0x545E0005, // 00CE LDINT R23 6 + 0x7C540400, // 00CF CALL R21 2 + 0x8C582B32, // 00D0 GETMET R22 R21 K50 + 0x54620010, // 00D1 LDINT R24 17 + 0x7C580400, // 00D2 CALL R22 2 + 0x605C0004, // 00D3 GETGBL R23 G4 + 0x5C602C00, // 00D4 MOVE R24 R22 + 0x7C5C0200, // 00D5 CALL R23 1 + 0x1C5C2F37, // 00D6 EQ R23 R23 K55 + 0x785E0003, // 00D7 JMPF R23 #00DC + 0xB85E7000, // 00D8 GETNGBL R23 K56 + 0x5C602C00, // 00D9 MOVE R24 R22 + 0x7C5C0200, // 00DA CALL R23 1 + 0x5C582E00, // 00DB MOVE R22 R23 + 0x8C5C2D3A, // 00DC GETMET R23 R22 K58 + 0x7C5C0200, // 00DD CALL R23 1 + 0x90167217, // 00DE SETMBR R5 K57 R23 + 0xB85E1A00, // 00DF GETNGBL R23 K13 + 0x8C5C2F0E, // 00E0 GETMET R23 R23 K14 + 0x60640008, // 00E1 GETGBL R25 G8 + 0x88680B39, // 00E2 GETMBR R26 R5 K57 + 0x7C640200, // 00E3 CALL R25 1 + 0x00667619, // 00E4 ADD R25 K59 R25 + 0x58680010, // 00E5 LDCONST R26 K16 + 0x7C5C0600, // 00E6 CALL R23 3 + 0xB85E1000, // 00E7 GETNGBL R23 K8 + 0x885C2F31, // 00E8 GETMBR R23 R23 K49 + 0x8C5C2F3C, // 00E9 GETMET R23 R23 K60 + 0x7C5C0200, // 00EA CALL R23 1 + 0x8C602F3D, // 00EB GETMET R24 R23 K61 + 0x58680033, // 00EC LDCONST R26 K51 + 0xB86E1000, // 00ED GETNGBL R27 K8 + 0x886C3731, // 00EE GETMBR R27 R27 K49 + 0x886C373E, // 00EF GETMBR R27 R27 K62 + 0x5C702000, // 00F0 MOVE R28 R16 + 0x7C600800, // 00F1 CALL R24 4 + 0x8C602F3D, // 00F2 GETMET R24 R23 K61 + 0x58680034, // 00F3 LDCONST R26 K52 + 0xB86E1000, // 00F4 GETNGBL R27 K8 + 0x886C3731, // 00F5 GETMBR R27 R27 K49 + 0x886C373E, // 00F6 GETMBR R27 R27 K62 + 0x5C702200, // 00F7 MOVE R28 R17 + 0x7C600800, // 00F8 CALL R24 4 + 0x8C602F3D, // 00F9 GETMET R24 R23 K61 + 0x58680010, // 00FA LDCONST R26 K16 + 0xB86E1000, // 00FB GETNGBL R27 K8 + 0x886C3731, // 00FC GETMBR R27 R27 K49 + 0x886C373E, // 00FD GETMBR R27 R27 K62 + 0x8870013F, // 00FE GETMBR R28 R0 K63 + 0x7C600800, // 00FF CALL R24 4 + 0x8C602F3D, // 0100 GETMET R24 R23 K61 + 0x546A0003, // 0101 LDINT R26 4 + 0xB86E1000, // 0102 GETNGBL R27 K8 + 0x886C3731, // 0103 GETMBR R27 R27 K49 + 0x886C373E, // 0104 GETMBR R27 R27 K62 + 0x88700140, // 0105 GETMBR R28 R0 K64 + 0x7C600800, // 0106 CALL R24 4 + 0x8C602F41, // 0107 GETMET R24 R23 K65 + 0x7C600200, // 0108 CALL R24 1 + 0xB8661A00, // 0109 GETNGBL R25 K13 + 0x8C64330E, // 010A GETMET R25 R25 K14 + 0x8C6C291D, // 010B GETMET R27 R20 K29 + 0x7C6C0200, // 010C CALL R27 1 + 0x006E841B, // 010D ADD R27 K66 R27 + 0x58700010, // 010E LDCONST R28 K16 + 0x7C640600, // 010F CALL R25 3 + 0xB8661A00, // 0110 GETNGBL R25 K13 + 0x8C64330E, // 0111 GETMET R25 R25 K14 + 0x8C6C251D, // 0112 GETMET R27 R18 K29 + 0x7C6C0200, // 0113 CALL R27 1 + 0x006E861B, // 0114 ADD R27 K67 R27 + 0x58700010, // 0115 LDCONST R28 K16 + 0x7C640600, // 0116 CALL R25 3 + 0xB8661A00, // 0117 GETNGBL R25 K13 + 0x8C64330E, // 0118 GETMET R25 R25 K14 + 0x586C000F, // 0119 LDCONST R27 K15 + 0x58700010, // 011A LDCONST R28 K16 + 0x7C640600, // 011B CALL R25 3 + 0x8C640944, // 011C GETMET R25 R4 K68 + 0x7C640200, // 011D CALL R25 1 + 0x8C643345, // 011E GETMET R25 R25 K69 + 0x5C6C2800, // 011F MOVE R27 R20 + 0x5C703000, // 0120 MOVE R28 R24 + 0x5C742400, // 0121 MOVE R29 R18 + 0x7C640800, // 0122 CALL R25 4 + 0x5C683200, // 0123 MOVE R26 R25 + 0x746A0000, // 0124 JMPT R26 #0126 + 0xB0065F46, // 0125 RAISE 1 K47 K70 + 0xB86A1A00, // 0126 GETNGBL R26 K13 + 0x8C68350E, // 0127 GETMET R26 R26 K14 + 0x58700047, // 0128 LDCONST R28 K71 + 0x58740010, // 0129 LDCONST R29 K16 + 0x7C680600, // 012A CALL R26 3 + 0x8C680911, // 012B GETMET R26 R4 K17 + 0x7C680200, // 012C CALL R26 1 + 0x8C683512, // 012D GETMET R26 R26 K18 + 0x88700B13, // 012E GETMBR R28 R5 K19 + 0x7C680400, // 012F CALL R26 2 + 0x8C683512, // 0130 GETMET R26 R26 K18 + 0x88700B14, // 0131 GETMBR R28 R5 K20 + 0x7C680400, // 0132 CALL R26 2 + 0x8C683512, // 0133 GETMET R26 R26 K18 + 0x88700D48, // 0134 GETMBR R28 R6 K72 + 0x7C680400, // 0135 CALL R26 2 + 0x8C683515, // 0136 GETMET R26 R26 K21 + 0x7C680200, // 0137 CALL R26 1 + 0x5C1C3400, // 0138 MOVE R7 R26 + 0x4C680000, // 0139 LDNIL R26 + 0x9016261A, // 013A SETMBR R5 K19 R26 + 0x4C680000, // 013B LDNIL R26 + 0x9016281A, // 013C SETMBR R5 K20 R26 + 0xB86A1A00, // 013D GETNGBL R26 K13 + 0x8C68350E, // 013E GETMET R26 R26 K14 + 0x58700049, // 013F LDCONST R28 K73 + 0x58740010, // 0140 LDCONST R29 K16 + 0x7C680600, // 0141 CALL R26 3 + 0xB86A1A00, // 0142 GETNGBL R26 K13 + 0x8C68350E, // 0143 GETMET R26 R26 K14 + 0x88700B23, // 0144 GETMBR R28 R5 K35 + 0x8C70391D, // 0145 GETMET R28 R28 K29 + 0x7C700200, // 0146 CALL R28 1 + 0x0072941C, // 0147 ADD R28 K74 R28 + 0x58740010, // 0148 LDCONST R29 K16 + 0x7C680600, // 0149 CALL R26 3 + 0xB86A1A00, // 014A GETNGBL R26 K13 + 0x8C68350E, // 014B GETMET R26 R26 K14 + 0x8C700B1C, // 014C GETMET R28 R5 K28 + 0x7C700200, // 014D CALL R28 1 + 0x00703807, // 014E ADD R28 R28 R7 + 0x8C70391D, // 014F GETMET R28 R28 K29 + 0x7C700200, // 0150 CALL R28 1 + 0x0072961C, // 0151 ADD R28 K75 R28 + 0x58740010, // 0152 LDCONST R29 K16 + 0x7C680600, // 0153 CALL R26 3 + 0x8C680921, // 0154 GETMET R26 R4 K33 + 0x7C680200, // 0155 CALL R26 1 + 0x8C683522, // 0156 GETMET R26 R26 K34 + 0x88700B23, // 0157 GETMBR R28 R5 K35 + 0x8C740B1C, // 0158 GETMET R29 R5 K28 + 0x7C740200, // 0159 CALL R29 1 + 0x00743A07, // 015A ADD R29 R29 R7 + 0x60780015, // 015B GETGBL R30 G21 + 0x7C780000, // 015C CALL R30 0 + 0x8C783D1F, // 015D GETMET R30 R30 K31 + 0x8880014C, // 015E GETMBR R32 R0 K76 + 0x7C780400, // 015F CALL R30 2 + 0x547E002F, // 0160 LDINT R31 48 + 0x7C680A00, // 0161 CALL R26 5 + 0x546E000E, // 0162 LDINT R27 15 + 0x406E061B, // 0163 CONNECT R27 K3 R27 + 0x946C341B, // 0164 GETIDX R27 R26 R27 + 0x5472000F, // 0165 LDINT R28 16 + 0x5476001E, // 0166 LDINT R29 31 + 0x4070381D, // 0167 CONNECT R28 R28 R29 + 0x9470341C, // 0168 GETIDX R28 R26 R28 + 0x5476001F, // 0169 LDINT R29 32 + 0x547A002E, // 016A LDINT R30 47 + 0x40743A1E, // 016B CONNECT R29 R29 R30 + 0x9474341D, // 016C GETIDX R29 R26 R29 + 0xB87A1A00, // 016D GETNGBL R30 K13 + 0x8C783D4D, // 016E GETMET R30 R30 K77 + 0x7C780200, // 016F CALL R30 1 + 0x94783D4E, // 0170 GETIDX R30 R30 K78 + 0xB87E1A00, // 0171 GETNGBL R31 K13 + 0x8C7C3F0E, // 0172 GETMET R31 R31 K14 + 0x58840049, // 0173 LDCONST R33 K73 + 0x58880010, // 0174 LDCONST R34 K16 + 0x7C7C0600, // 0175 CALL R31 3 + 0xB87E1A00, // 0176 GETNGBL R31 K13 + 0x8C7C3F0E, // 0177 GETMET R31 R31 K14 + 0x8C84371D, // 0178 GETMET R33 R27 K29 + 0x7C840200, // 0179 CALL R33 1 + 0x00869E21, // 017A ADD R33 K79 R33 + 0x58880010, // 017B LDCONST R34 K16 + 0x7C7C0600, // 017C CALL R31 3 + 0xB87E1A00, // 017D GETNGBL R31 K13 + 0x8C7C3F0E, // 017E GETMET R31 R31 K14 + 0x8C84391D, // 017F GETMET R33 R28 K29 + 0x7C840200, // 0180 CALL R33 1 + 0x0086A021, // 0181 ADD R33 K80 R33 + 0x58880010, // 0182 LDCONST R34 K16 + 0x7C7C0600, // 0183 CALL R31 3 + 0xB87E1A00, // 0184 GETNGBL R31 K13 + 0x8C7C3F0E, // 0185 GETMET R31 R31 K14 + 0x8C843B1D, // 0186 GETMET R33 R29 K29 + 0x7C840200, // 0187 CALL R33 1 + 0x0086A221, // 0188 ADD R33 K81 R33 + 0x58880010, // 0189 LDCONST R34 K16 + 0x7C7C0600, // 018A CALL R31 3 + 0xB87E1A00, // 018B GETNGBL R31 K13 + 0x8C7C3F0E, // 018C GETMET R31 R31 K14 + 0x58840049, // 018D LDCONST R33 K73 + 0x58880010, // 018E LDCONST R34 K16 + 0x7C7C0600, // 018F CALL R31 3 + 0x8C7C0352, // 0190 GETMET R31 R1 K82 + 0x5486003F, // 0191 LDINT R33 64 + 0x50880200, // 0192 LDBOOL R34 1 0 + 0x7C7C0600, // 0193 CALL R31 3 + 0x60800015, // 0194 GETGBL R32 G21 + 0x7C800000, // 0195 CALL R32 0 + 0x8C844153, // 0196 GETMET R33 R32 K83 + 0x588C0003, // 0197 LDCONST R35 K3 + 0x58900034, // 0198 LDCONST R36 K52 + 0x7C840600, // 0199 CALL R33 3 + 0x8C844153, // 019A GETMET R33 R32 K83 + 0x588C0003, // 019B LDCONST R35 K3 + 0x54920003, // 019C LDINT R36 4 + 0x7C840600, // 019D CALL R33 3 + 0x8C844153, // 019E GETMET R33 R32 K83 + 0x588C0003, // 019F LDCONST R35 K3 + 0x54920003, // 01A0 LDINT R36 4 + 0x7C840600, // 01A1 CALL R33 3 + 0x8C843F41, // 01A2 GETMET R33 R31 K65 + 0x5C8C4000, // 01A3 MOVE R35 R32 + 0x7C840400, // 01A4 CALL R33 2 + 0x88880154, // 01A5 GETMBR R34 R0 K84 + 0x8C884555, // 01A6 GETMET R34 R34 K85 + 0x5C904200, // 01A7 MOVE R36 R33 + 0x5C940400, // 01A8 MOVE R37 R2 + 0x5C980600, // 01A9 MOVE R38 R3 + 0x889C3F56, // 01AA GETMBR R39 R31 K86 + 0x7C880A00, // 01AB CALL R34 5 + 0x8C880B57, // 01AC GETMET R34 R5 K87 + 0x7C880200, // 01AD CALL R34 1 + 0x8C880B58, // 01AE GETMET R34 R5 K88 + 0x5C903600, // 01AF MOVE R36 R27 + 0x5C943800, // 01B0 MOVE R37 R28 + 0x5C983A00, // 01B1 MOVE R38 R29 + 0x5C9C3C00, // 01B2 MOVE R39 R30 + 0x7C880A00, // 01B3 CALL R34 5 + 0x8C880B59, // 01B4 GETMET R34 R5 K89 + 0x50900200, // 01B5 LDBOOL R36 1 0 + 0x7C880400, // 01B6 CALL R34 2 + 0x8C880B5A, // 01B7 GETMET R34 R5 K90 + 0x7C880200, // 01B8 CALL R34 1 + 0x8C880B5B, // 01B9 GETMET R34 R5 K91 + 0x7C880200, // 01BA CALL R34 1 + 0x50880200, // 01BB LDBOOL R34 1 0 + 0x80044400, // 01BC RET 1 R34 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: parse_Sigma1 +********************************************************************/ +be_local_closure(Matter_Commisioning_Context_parse_Sigma1, /* name */ + be_nested_proto( + 36, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[116]) { /* constants */ + /* K0 */ be_nested_str_weak(crypto), + /* K1 */ be_nested_str_weak(opcode), + /* K2 */ be_nested_str_weak(local_session_id), + /* K3 */ be_const_int(0), + /* K4 */ be_nested_str_weak(protocol_id), + /* K5 */ be_nested_str_weak(protocol_error), + /* K6 */ be_nested_str_weak(invalid_X20Pake1_X20message), + /* K7 */ be_nested_str_weak(matter), + /* K8 */ be_nested_str_weak(Sigma1), + /* K9 */ be_nested_str_weak(parse), + /* K10 */ be_nested_str_weak(raw), + /* K11 */ be_nested_str_weak(app_payload_idx), + /* K12 */ be_nested_str_weak(initiatorEph_pub), + /* K13 */ be_nested_str_weak(initiatorEphPubKey), + /* K14 */ be_nested_str_weak(find_session_by_destination_id), + /* K15 */ be_nested_str_weak(destinationId), + /* K16 */ be_nested_str_weak(initiatorRandom), + /* K17 */ be_nested_str_weak(valuer_error), + /* K18 */ be_nested_str_weak(StatusReport_X28GeneralCode_X3A_X20FAILURE_X2C_X20ProtocolId_X3A_X20SECURE_CHANNEL_X2C_X20ProtocolCode_X3A_X20NO_SHARED_TRUST_ROOTS_X29), + /* K19 */ be_nested_str_weak(source_node_id), + /* K20 */ be_nested_str_weak(set_mode), + /* K21 */ be_nested_str_weak(Session), + /* K22 */ be_nested_str_weak(__CASE), + /* K23 */ be_nested_str_weak(session), + /* K24 */ be_nested_str_weak(device), + /* K25 */ be_nested_str_weak(sessions), + /* K26 */ be_nested_str_weak(remove_session), + /* K27 */ be_nested_str_weak(_future_initiator_session_id), + /* K28 */ be_nested_str_weak(initiator_session_id), + /* K29 */ be_nested_str_weak(_future_local_session_id), + /* K30 */ be_nested_str_weak(gen_local_session_id), + /* K31 */ be_nested_str_weak(future_local_session_id), + /* K32 */ be_nested_str_weak(resumptionID), + /* K33 */ be_nested_str_weak(initiatorResumeMIC), + /* K34 */ be_nested_str_weak(shared_secret), + /* K35 */ be_nested_str_weak(fromstring), + /* K36 */ be_nested_str_weak(Sigma1_Resume), + /* K37 */ be_nested_str_weak(HKDF_SHA256), + /* K38 */ be_nested_str_weak(derive), + /* K39 */ be_nested_str_weak(NCASE_SigmaR1), + /* K40 */ be_const_int(2147483647), + /* K41 */ be_nested_str_weak(AES_CCM), + /* K42 */ be_nested_str_weak(decrypt), + /* K43 */ be_nested_str_weak(tag), + /* K44 */ be_nested_str_weak(tasmota), + /* K45 */ be_nested_str_weak(log), + /* K46 */ be_nested_str_weak(_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A), + /* K47 */ be_const_int(3), + /* K48 */ be_nested_str_weak(MTR_X3A_X20_X2A_X20s1rk_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K49 */ be_nested_str_weak(tohex), + /* K50 */ be_nested_str_weak(MTR_X3A_X20_X2A_X20tag_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K51 */ be_nested_str_weak(MTR_X3A_X20_X2A_X20Resume1MICPayload_X20_X3D_X20), + /* K52 */ be_nested_str_weak(MTR_X3A_X20_X2A_X20decrypted_tag_X20_X20_X20_X20_X20_X3D_X20), + /* K53 */ be_nested_str_weak(resumption_id), + /* K54 */ be_nested_str_weak(random), + /* K55 */ be_nested_str_weak(Sigma2_Resume), + /* K56 */ be_nested_str_weak(NCASE_SigmaR2), + /* K57 */ be_nested_str_weak(Sigma2Resume), + /* K58 */ be_nested_str_weak(responderSessionID), + /* K59 */ be_nested_str_weak(sigma2ResumeMIC), + /* K60 */ be_nested_str_weak(SessionResumptionKeys), + /* K61 */ be_nested_str_weak(rtc), + /* K62 */ be_nested_str_weak(utc), + /* K63 */ be_nested_str_weak(MTR_X3A_X20_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A), + /* K64 */ be_nested_str_weak(MTR_X3A_X20I2RKey_X20_X20_X20_X20_X20_X20_X3D), + /* K65 */ be_nested_str_weak(MTR_X3A_X20R2IKey_X20_X20_X20_X20_X20_X20_X3D), + /* K66 */ be_nested_str_weak(MTR_X3A_X20AC_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D), + /* K67 */ be_nested_str_weak(encode), + /* K68 */ be_nested_str_weak(_Msg1), + /* K69 */ be_nested_str_weak(MTR_X3A_X20sigma2resume_raw_X3A_X20), + /* K70 */ be_nested_str_weak(build_response), + /* K71 */ be_nested_str_weak(responder), + /* K72 */ be_nested_str_weak(send_response), + /* K73 */ be_nested_str_weak(message_counter), + /* K74 */ be_nested_str_weak(close), + /* K75 */ be_nested_str_weak(set_keys), + /* K76 */ be_nested_str_weak(set_persist), + /* K77 */ be_nested_str_weak(set_no_expiration), + /* K78 */ be_nested_str_weak(save), + /* K79 */ be_nested_str_weak(ResponderEph_priv), + /* K80 */ be_nested_str_weak(ResponderEph_pub), + /* K81 */ be_nested_str_weak(EC_P256), + /* K82 */ be_nested_str_weak(public_key), + /* K83 */ be_nested_str_weak(shared_key), + /* K84 */ be_nested_str_weak(TLV), + /* K85 */ be_nested_str_weak(Matter_TLV_struct), + /* K86 */ be_nested_str_weak(add_TLV), + /* K87 */ be_const_int(1), + /* K88 */ be_nested_str_weak(B2), + /* K89 */ be_nested_str_weak(get_noc), + /* K90 */ be_const_int(2), + /* K91 */ be_nested_str_weak(get_icac), + /* K92 */ be_nested_str_weak(ecdsa_sign_sha256), + /* K93 */ be_nested_str_weak(get_pk), + /* K94 */ be_nested_str_weak(Msg1), + /* K95 */ be_nested_str_weak(MTR_X3A_X20_X2A_X20MSG1_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K96 */ be_nested_str_weak(SHA256), + /* K97 */ be_nested_str_weak(update), + /* K98 */ be_nested_str_weak(out), + /* K99 */ be_nested_str_weak(S2K_Info), + /* K100 */ be_nested_str_weak(get_ipk_group_key), + /* K101 */ be_nested_str_weak(MTR_X3A_X20_X2A_X20SharedSecret_X20_X20_X3D_X20), + /* K102 */ be_nested_str_weak(MTR_X3A_X20_X2A_X20s2k_salt_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K103 */ be_nested_str_weak(MTR_X3A_X20_X2A_X20s2k_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K104 */ be_nested_str_weak(TBEData2_Nonce), + /* K105 */ be_nested_str_weak(encrypt), + /* K106 */ be_nested_str_weak(MTR_X3A_X20_X2A_X20TBEData2Enc_X20_X20_X20_X3D_X20), + /* K107 */ be_nested_str_weak(Sigma2), + /* K108 */ be_nested_str_weak(responderRandom), + /* K109 */ be_nested_str_weak(responderSessionId), + /* K110 */ be_nested_str_weak(responderEphPubKey), + /* K111 */ be_nested_str_weak(encrypted2), + /* K112 */ be_nested_str_weak(MTR_X3A_X20sigma2_X3A_X20), + /* K113 */ be_nested_str_weak(inspect), + /* K114 */ be_nested_str_weak(_Msg2), + /* K115 */ be_nested_str_weak(MTR_X3A_X20sigma2_raw_X3A_X20), + }), + be_str_weak(parse_Sigma1), + &be_const_str_solidified, + ( &(const binstruction[551]) { /* code */ + 0xA4120000, // 0000 IMPORT R4 K0 + 0x88140301, // 0001 GETMBR R5 R1 K1 + 0x541A002F, // 0002 LDINT R6 48 + 0x20140A06, // 0003 NE R5 R5 R6 + 0x74160005, // 0004 JMPT R5 #000B + 0x88140302, // 0005 GETMBR R5 R1 K2 + 0x20140B03, // 0006 NE R5 R5 K3 + 0x74160002, // 0007 JMPT R5 #000B + 0x88140304, // 0008 GETMBR R5 R1 K4 + 0x20140B03, // 0009 NE R5 R5 K3 + 0x78160000, // 000A JMPF R5 #000C + 0xB0060B06, // 000B RAISE 1 K5 K6 + 0xB8160E00, // 000C GETNGBL R5 K7 + 0x8C140B08, // 000D GETMET R5 R5 K8 + 0x7C140200, // 000E CALL R5 1 + 0x8C140B09, // 000F GETMET R5 R5 K9 + 0x881C030A, // 0010 GETMBR R7 R1 K10 + 0x8820030B, // 0011 GETMBR R8 R1 K11 + 0x7C140600, // 0012 CALL R5 3 + 0x88180B0D, // 0013 GETMBR R6 R5 K13 + 0x90021806, // 0014 SETMBR R0 K12 R6 + 0x8C18010E, // 0015 GETMET R6 R0 K14 + 0x88200B0F, // 0016 GETMBR R8 R5 K15 + 0x88240B10, // 0017 GETMBR R9 R5 K16 + 0x7C180600, // 0018 CALL R6 3 + 0x4C1C0000, // 0019 LDNIL R7 + 0x1C1C0C07, // 001A EQ R7 R6 R7 + 0x781E0000, // 001B JMPF R7 #001D + 0xB0062312, // 001C RAISE 1 K17 K18 + 0x881C0313, // 001D GETMBR R7 R1 K19 + 0x901A2607, // 001E SETMBR R6 K19 R7 + 0x8C1C0D14, // 001F GETMET R7 R6 K20 + 0xB8260E00, // 0020 GETNGBL R9 K7 + 0x88241315, // 0021 GETMBR R9 R9 K21 + 0x88241316, // 0022 GETMBR R9 R9 K22 + 0x7C1C0400, // 0023 CALL R7 2 + 0x881C0317, // 0024 GETMBR R7 R1 K23 + 0x781E0004, // 0025 JMPF R7 #002B + 0x881C0118, // 0026 GETMBR R7 R0 K24 + 0x881C0F19, // 0027 GETMBR R7 R7 K25 + 0x8C1C0F1A, // 0028 GETMET R7 R7 K26 + 0x88240317, // 0029 GETMBR R9 R1 K23 + 0x7C1C0400, // 002A CALL R7 2 + 0x90062E06, // 002B SETMBR R1 K23 R6 + 0x881C0B1C, // 002C GETMBR R7 R5 K28 + 0x901A3607, // 002D SETMBR R6 K27 R7 + 0x881C0118, // 002E GETMBR R7 R0 K24 + 0x881C0F19, // 002F GETMBR R7 R7 K25 + 0x8C1C0F1E, // 0030 GETMET R7 R7 K30 + 0x7C1C0200, // 0031 CALL R7 1 + 0x901A3A07, // 0032 SETMBR R6 K29 R7 + 0x881C0D1D, // 0033 GETMBR R7 R6 K29 + 0x90023E07, // 0034 SETMBR R0 K31 R7 + 0x881C0B20, // 0035 GETMBR R7 R5 K32 + 0x4C200000, // 0036 LDNIL R8 + 0x201C0E08, // 0037 NE R7 R7 R8 + 0x781E00F2, // 0038 JMPF R7 #012C + 0x881C0B21, // 0039 GETMBR R7 R5 K33 + 0x4C200000, // 003A LDNIL R8 + 0x201C0E08, // 003B NE R7 R7 R8 + 0x781E00EE, // 003C JMPF R7 #012C + 0x881C0D22, // 003D GETMBR R7 R6 K34 + 0x4C200000, // 003E LDNIL R8 + 0x201C0E08, // 003F NE R7 R7 R8 + 0x781E00EA, // 0040 JMPF R7 #012C + 0x881C0B10, // 0041 GETMBR R7 R5 K16 + 0x88200B20, // 0042 GETMBR R8 R5 K32 + 0x001C0E08, // 0043 ADD R7 R7 R8 + 0x60200015, // 0044 GETGBL R8 G21 + 0x7C200000, // 0045 CALL R8 0 + 0x8C201123, // 0046 GETMET R8 R8 K35 + 0x58280024, // 0047 LDCONST R10 K36 + 0x7C200400, // 0048 CALL R8 2 + 0x8C240925, // 0049 GETMET R9 R4 K37 + 0x7C240200, // 004A CALL R9 1 + 0x8C241326, // 004B GETMET R9 R9 K38 + 0x882C0D22, // 004C GETMBR R11 R6 K34 + 0x5C300E00, // 004D MOVE R12 R7 + 0x5C341000, // 004E MOVE R13 R8 + 0x543A000F, // 004F LDINT R14 16 + 0x7C240A00, // 0050 CALL R9 5 + 0x60280015, // 0051 GETGBL R10 G21 + 0x7C280000, // 0052 CALL R10 0 + 0x8C281523, // 0053 GETMET R10 R10 K35 + 0x58300027, // 0054 LDCONST R12 K39 + 0x7C280400, // 0055 CALL R10 2 + 0x542DFFEE, // 0056 LDINT R11 -17 + 0x402E060B, // 0057 CONNECT R11 K3 R11 + 0x88300B21, // 0058 GETMBR R12 R5 K33 + 0x942C180B, // 0059 GETIDX R11 R12 R11 + 0x5435FFEF, // 005A LDINT R13 -16 + 0x40341B28, // 005B CONNECT R13 R13 K40 + 0x88380B21, // 005C GETMBR R14 R5 K33 + 0x94301C0D, // 005D GETIDX R12 R14 R13 + 0x8C3C0929, // 005E GETMET R15 R4 K41 + 0x5C441200, // 005F MOVE R17 R9 + 0x5C481400, // 0060 MOVE R18 R10 + 0x604C0015, // 0061 GETGBL R19 G21 + 0x7C4C0000, // 0062 CALL R19 0 + 0x6050000C, // 0063 GETGBL R20 G12 + 0x5C541600, // 0064 MOVE R21 R11 + 0x7C500200, // 0065 CALL R20 1 + 0x5456000F, // 0066 LDINT R21 16 + 0x7C3C0C00, // 0067 CALL R15 6 + 0x5C341E00, // 0068 MOVE R13 R15 + 0x8C3C1B2A, // 0069 GETMET R15 R13 K42 + 0x5C441600, // 006A MOVE R17 R11 + 0x7C3C0400, // 006B CALL R15 2 + 0x5C381E00, // 006C MOVE R14 R15 + 0x8C3C1B2B, // 006D GETMET R15 R13 K43 + 0x7C3C0200, // 006E CALL R15 1 + 0xB8425800, // 006F GETNGBL R16 K44 + 0x8C40212D, // 0070 GETMET R16 R16 K45 + 0x5848002E, // 0071 LDCONST R18 K46 + 0x584C002F, // 0072 LDCONST R19 K47 + 0x7C400600, // 0073 CALL R16 3 + 0xB8425800, // 0074 GETNGBL R16 K44 + 0x8C40212D, // 0075 GETMET R16 R16 K45 + 0x8C481331, // 0076 GETMET R18 R9 K49 + 0x7C480200, // 0077 CALL R18 1 + 0x004A6012, // 0078 ADD R18 K48 R18 + 0x584C002F, // 0079 LDCONST R19 K47 + 0x7C400600, // 007A CALL R16 3 + 0xB8425800, // 007B GETNGBL R16 K44 + 0x8C40212D, // 007C GETMET R16 R16 K45 + 0x8C481931, // 007D GETMET R18 R12 K49 + 0x7C480200, // 007E CALL R18 1 + 0x004A6412, // 007F ADD R18 K50 R18 + 0x584C002F, // 0080 LDCONST R19 K47 + 0x7C400600, // 0081 CALL R16 3 + 0xB8425800, // 0082 GETNGBL R16 K44 + 0x8C40212D, // 0083 GETMET R16 R16 K45 + 0x8C481D31, // 0084 GETMET R18 R14 K49 + 0x7C480200, // 0085 CALL R18 1 + 0x004A6612, // 0086 ADD R18 K51 R18 + 0x584C002F, // 0087 LDCONST R19 K47 + 0x7C400600, // 0088 CALL R16 3 + 0xB8425800, // 0089 GETNGBL R16 K44 + 0x8C40212D, // 008A GETMET R16 R16 K45 + 0x8C481F31, // 008B GETMET R18 R15 K49 + 0x7C480200, // 008C CALL R18 1 + 0x004A6812, // 008D ADD R18 K52 R18 + 0x584C002F, // 008E LDCONST R19 K47 + 0x7C400600, // 008F CALL R16 3 + 0xB8425800, // 0090 GETNGBL R16 K44 + 0x8C40212D, // 0091 GETMET R16 R16 K45 + 0x5848002E, // 0092 LDCONST R18 K46 + 0x584C002F, // 0093 LDCONST R19 K47 + 0x7C400600, // 0094 CALL R16 3 + 0x1C40180F, // 0095 EQ R16 R12 R15 + 0x78420092, // 0096 JMPF R16 #012A + 0x8C400936, // 0097 GETMET R16 R4 K54 + 0x544A000F, // 0098 LDINT R18 16 + 0x7C400400, // 0099 CALL R16 2 + 0x901A6A10, // 009A SETMBR R6 K53 R16 + 0x60400015, // 009B GETGBL R16 G21 + 0x7C400000, // 009C CALL R16 0 + 0x8C402123, // 009D GETMET R16 R16 K35 + 0x58480037, // 009E LDCONST R18 K55 + 0x7C400400, // 009F CALL R16 2 + 0x88440D35, // 00A0 GETMBR R17 R6 K53 + 0x00402011, // 00A1 ADD R16 R16 R17 + 0x88440B10, // 00A2 GETMBR R17 R5 K16 + 0x88480B20, // 00A3 GETMBR R18 R5 K32 + 0x00442212, // 00A4 ADD R17 R17 R18 + 0x8C480925, // 00A5 GETMET R18 R4 K37 + 0x7C480200, // 00A6 CALL R18 1 + 0x8C482526, // 00A7 GETMET R18 R18 K38 + 0x88500D22, // 00A8 GETMBR R20 R6 K34 + 0x5C542200, // 00A9 MOVE R21 R17 + 0x5C582000, // 00AA MOVE R22 R16 + 0x545E000F, // 00AB LDINT R23 16 + 0x7C480A00, // 00AC CALL R18 5 + 0x8C4C0929, // 00AD GETMET R19 R4 K41 + 0x5C542400, // 00AE MOVE R21 R18 + 0x60580015, // 00AF GETGBL R22 G21 + 0x7C580000, // 00B0 CALL R22 0 + 0x8C582D23, // 00B1 GETMET R22 R22 K35 + 0x58600038, // 00B2 LDCONST R24 K56 + 0x7C580400, // 00B3 CALL R22 2 + 0x605C0015, // 00B4 GETGBL R23 G21 + 0x7C5C0000, // 00B5 CALL R23 0 + 0x58600003, // 00B6 LDCONST R24 K3 + 0x5466000F, // 00B7 LDINT R25 16 + 0x7C4C0C00, // 00B8 CALL R19 6 + 0x8C50272B, // 00B9 GETMET R20 R19 K43 + 0x7C500200, // 00BA CALL R20 1 + 0xB8560E00, // 00BB GETNGBL R21 K7 + 0x8C542B39, // 00BC GETMET R21 R21 K57 + 0x7C540200, // 00BD CALL R21 1 + 0x88580D35, // 00BE GETMBR R22 R6 K53 + 0x90564016, // 00BF SETMBR R21 K32 R22 + 0x88580D1D, // 00C0 GETMBR R22 R6 K29 + 0x90567416, // 00C1 SETMBR R21 K58 R22 + 0x90567614, // 00C2 SETMBR R21 K59 R20 + 0x8C580925, // 00C3 GETMET R22 R4 K37 + 0x7C580200, // 00C4 CALL R22 1 + 0x8C582D26, // 00C5 GETMET R22 R22 K38 + 0x88600D22, // 00C6 GETMBR R24 R6 K34 + 0x88640B10, // 00C7 GETMBR R25 R5 K16 + 0x88680B20, // 00C8 GETMBR R26 R5 K32 + 0x0064321A, // 00C9 ADD R25 R25 R26 + 0x60680015, // 00CA GETGBL R26 G21 + 0x7C680000, // 00CB CALL R26 0 + 0x8C683523, // 00CC GETMET R26 R26 K35 + 0x5870003C, // 00CD LDCONST R28 K60 + 0x7C680400, // 00CE CALL R26 2 + 0x546E002F, // 00CF LDINT R27 48 + 0x7C580A00, // 00D0 CALL R22 5 + 0x545E000E, // 00D1 LDINT R23 15 + 0x405E0617, // 00D2 CONNECT R23 K3 R23 + 0x945C2C17, // 00D3 GETIDX R23 R22 R23 + 0x5462000F, // 00D4 LDINT R24 16 + 0x5466001E, // 00D5 LDINT R25 31 + 0x40603019, // 00D6 CONNECT R24 R24 R25 + 0x94602C18, // 00D7 GETIDX R24 R22 R24 + 0x5466001F, // 00D8 LDINT R25 32 + 0x546A002E, // 00D9 LDINT R26 47 + 0x4064321A, // 00DA CONNECT R25 R25 R26 + 0x94642C19, // 00DB GETIDX R25 R22 R25 + 0xB86A5800, // 00DC GETNGBL R26 K44 + 0x8C68353D, // 00DD GETMET R26 R26 K61 + 0x7C680200, // 00DE CALL R26 1 + 0x9468353E, // 00DF GETIDX R26 R26 K62 + 0xB86E5800, // 00E0 GETNGBL R27 K44 + 0x8C6C372D, // 00E1 GETMET R27 R27 K45 + 0x5874003F, // 00E2 LDCONST R29 K63 + 0x5878002F, // 00E3 LDCONST R30 K47 + 0x7C6C0600, // 00E4 CALL R27 3 + 0xB86E5800, // 00E5 GETNGBL R27 K44 + 0x8C6C372D, // 00E6 GETMET R27 R27 K45 + 0x8C742F31, // 00E7 GETMET R29 R23 K49 + 0x7C740200, // 00E8 CALL R29 1 + 0x0076801D, // 00E9 ADD R29 K64 R29 + 0x5878002F, // 00EA LDCONST R30 K47 + 0x7C6C0600, // 00EB CALL R27 3 + 0xB86E5800, // 00EC GETNGBL R27 K44 + 0x8C6C372D, // 00ED GETMET R27 R27 K45 + 0x8C743131, // 00EE GETMET R29 R24 K49 + 0x7C740200, // 00EF CALL R29 1 + 0x0076821D, // 00F0 ADD R29 K65 R29 + 0x5878002F, // 00F1 LDCONST R30 K47 + 0x7C6C0600, // 00F2 CALL R27 3 + 0xB86E5800, // 00F3 GETNGBL R27 K44 + 0x8C6C372D, // 00F4 GETMET R27 R27 K45 + 0x8C743331, // 00F5 GETMET R29 R25 K49 + 0x7C740200, // 00F6 CALL R29 1 + 0x0076841D, // 00F7 ADD R29 K66 R29 + 0x5878002F, // 00F8 LDCONST R30 K47 + 0x7C6C0600, // 00F9 CALL R27 3 + 0xB86E5800, // 00FA GETNGBL R27 K44 + 0x8C6C372D, // 00FB GETMET R27 R27 K45 + 0x5874003F, // 00FC LDCONST R29 K63 + 0x5878002F, // 00FD LDCONST R30 K47 + 0x7C6C0600, // 00FE CALL R27 3 + 0x8C6C2B43, // 00FF GETMET R27 R21 K67 + 0x7C6C0200, // 0100 CALL R27 1 + 0x4C700000, // 0101 LDNIL R28 + 0x901A881C, // 0102 SETMBR R6 K68 R28 + 0xB8725800, // 0103 GETNGBL R28 K44 + 0x8C70392D, // 0104 GETMET R28 R28 K45 + 0x8C783731, // 0105 GETMET R30 R27 K49 + 0x7C780200, // 0106 CALL R30 1 + 0x007A8A1E, // 0107 ADD R30 K69 R30 + 0x587C002F, // 0108 LDCONST R31 K47 + 0x7C700600, // 0109 CALL R28 3 + 0x8C700346, // 010A GETMET R28 R1 K70 + 0x547A0032, // 010B LDINT R30 51 + 0x507C0200, // 010C LDBOOL R31 1 0 + 0x7C700600, // 010D CALL R28 3 + 0x8C743943, // 010E GETMET R29 R28 K67 + 0x5C7C3600, // 010F MOVE R31 R27 + 0x7C740400, // 0110 CALL R29 2 + 0x88780147, // 0111 GETMBR R30 R0 K71 + 0x8C783D48, // 0112 GETMET R30 R30 K72 + 0x5C803A00, // 0113 MOVE R32 R29 + 0x5C840400, // 0114 MOVE R33 R2 + 0x5C880600, // 0115 MOVE R34 R3 + 0x888C3949, // 0116 GETMBR R35 R28 K73 + 0x7C780A00, // 0117 CALL R30 5 + 0x8C780D4A, // 0118 GETMET R30 R6 K74 + 0x7C780200, // 0119 CALL R30 1 + 0x8C780D4B, // 011A GETMET R30 R6 K75 + 0x5C802E00, // 011B MOVE R32 R23 + 0x5C843000, // 011C MOVE R33 R24 + 0x5C883200, // 011D MOVE R34 R25 + 0x5C8C3400, // 011E MOVE R35 R26 + 0x7C780A00, // 011F CALL R30 5 + 0x8C780D4C, // 0120 GETMET R30 R6 K76 + 0x50800200, // 0121 LDBOOL R32 1 0 + 0x7C780400, // 0122 CALL R30 2 + 0x8C780D4D, // 0123 GETMET R30 R6 K77 + 0x7C780200, // 0124 CALL R30 1 + 0x8C780D4E, // 0125 GETMET R30 R6 K78 + 0x7C780200, // 0126 CALL R30 1 + 0x50780200, // 0127 LDBOOL R30 1 0 + 0x80043C00, // 0128 RET 1 R30 + 0x70020001, // 0129 JMP #012C + 0x4C400000, // 012A LDNIL R16 + 0x90164010, // 012B SETMBR R5 K32 R16 + 0x881C0B20, // 012C GETMBR R7 R5 K32 + 0x4C200000, // 012D LDNIL R8 + 0x1C1C0E08, // 012E EQ R7 R7 R8 + 0x741E0003, // 012F JMPT R7 #0134 + 0x881C0B21, // 0130 GETMBR R7 R5 K33 + 0x4C200000, // 0131 LDNIL R8 + 0x1C1C0E08, // 0132 EQ R7 R7 R8 + 0x781E00F0, // 0133 JMPF R7 #0225 + 0x8C1C0936, // 0134 GETMET R7 R4 K54 + 0x5426000F, // 0135 LDINT R9 16 + 0x7C1C0400, // 0136 CALL R7 2 + 0x901A6A07, // 0137 SETMBR R6 K53 R7 + 0x8C1C0936, // 0138 GETMET R7 R4 K54 + 0x5426001F, // 0139 LDINT R9 32 + 0x7C1C0400, // 013A CALL R7 2 + 0x90029E07, // 013B SETMBR R0 K79 R7 + 0x8C1C0951, // 013C GETMET R7 R4 K81 + 0x7C1C0200, // 013D CALL R7 1 + 0x8C1C0F52, // 013E GETMET R7 R7 K82 + 0x8824014F, // 013F GETMBR R9 R0 K79 + 0x7C1C0400, // 0140 CALL R7 2 + 0x9002A007, // 0141 SETMBR R0 K80 R7 + 0x8C1C0936, // 0142 GETMET R7 R4 K54 + 0x5426001F, // 0143 LDINT R9 32 + 0x7C1C0400, // 0144 CALL R7 2 + 0x8C200951, // 0145 GETMET R8 R4 K81 + 0x7C200200, // 0146 CALL R8 1 + 0x8C201153, // 0147 GETMET R8 R8 K83 + 0x8828014F, // 0148 GETMBR R10 R0 K79 + 0x882C0B0D, // 0149 GETMBR R11 R5 K13 + 0x7C200600, // 014A CALL R8 3 + 0x901A4408, // 014B SETMBR R6 K34 R8 + 0xB8220E00, // 014C GETNGBL R8 K7 + 0x88201154, // 014D GETMBR R8 R8 K84 + 0x8C201155, // 014E GETMET R8 R8 K85 + 0x7C200200, // 014F CALL R8 1 + 0x8C241156, // 0150 GETMET R9 R8 K86 + 0x582C0057, // 0151 LDCONST R11 K87 + 0xB8320E00, // 0152 GETNGBL R12 K7 + 0x88301954, // 0153 GETMBR R12 R12 K84 + 0x88301958, // 0154 GETMBR R12 R12 K88 + 0x8C340D59, // 0155 GETMET R13 R6 K89 + 0x7C340200, // 0156 CALL R13 1 + 0x7C240800, // 0157 CALL R9 4 + 0x8C241156, // 0158 GETMET R9 R8 K86 + 0x582C005A, // 0159 LDCONST R11 K90 + 0xB8320E00, // 015A GETNGBL R12 K7 + 0x88301954, // 015B GETMBR R12 R12 K84 + 0x88301958, // 015C GETMBR R12 R12 K88 + 0x8C340D5B, // 015D GETMET R13 R6 K91 + 0x7C340200, // 015E CALL R13 1 + 0x7C240800, // 015F CALL R9 4 + 0x8C241156, // 0160 GETMET R9 R8 K86 + 0x582C002F, // 0161 LDCONST R11 K47 + 0xB8320E00, // 0162 GETNGBL R12 K7 + 0x88301954, // 0163 GETMBR R12 R12 K84 + 0x88301958, // 0164 GETMBR R12 R12 K88 + 0x88340150, // 0165 GETMBR R13 R0 K80 + 0x7C240800, // 0166 CALL R9 4 + 0x8C241156, // 0167 GETMET R9 R8 K86 + 0x542E0003, // 0168 LDINT R11 4 + 0xB8320E00, // 0169 GETNGBL R12 K7 + 0x88301954, // 016A GETMBR R12 R12 K84 + 0x88301958, // 016B GETMBR R12 R12 K88 + 0x88340B0D, // 016C GETMBR R13 R5 K13 + 0x7C240800, // 016D CALL R9 4 + 0x8C240951, // 016E GETMET R9 R4 K81 + 0x7C240200, // 016F CALL R9 1 + 0x8C24135C, // 0170 GETMET R9 R9 K92 + 0x8C2C0D5D, // 0171 GETMET R11 R6 K93 + 0x7C2C0200, // 0172 CALL R11 1 + 0x8C301143, // 0173 GETMET R12 R8 K67 + 0x7C300200, // 0174 CALL R12 1 + 0x7C240600, // 0175 CALL R9 3 + 0xB82A0E00, // 0176 GETNGBL R10 K7 + 0x88281554, // 0177 GETMBR R10 R10 K84 + 0x8C281555, // 0178 GETMET R10 R10 K85 + 0x7C280200, // 0179 CALL R10 1 + 0x8C2C1556, // 017A GETMET R11 R10 K86 + 0x58340057, // 017B LDCONST R13 K87 + 0xB83A0E00, // 017C GETNGBL R14 K7 + 0x88381D54, // 017D GETMBR R14 R14 K84 + 0x88381D58, // 017E GETMBR R14 R14 K88 + 0x8C3C0D59, // 017F GETMET R15 R6 K89 + 0x7C3C0200, // 0180 CALL R15 1 + 0x7C2C0800, // 0181 CALL R11 4 + 0x8C2C1556, // 0182 GETMET R11 R10 K86 + 0x5834005A, // 0183 LDCONST R13 K90 + 0xB83A0E00, // 0184 GETNGBL R14 K7 + 0x88381D54, // 0185 GETMBR R14 R14 K84 + 0x88381D58, // 0186 GETMBR R14 R14 K88 + 0x8C3C0D5B, // 0187 GETMET R15 R6 K91 + 0x7C3C0200, // 0188 CALL R15 1 + 0x7C2C0800, // 0189 CALL R11 4 + 0x8C2C1556, // 018A GETMET R11 R10 K86 + 0x5834002F, // 018B LDCONST R13 K47 + 0xB83A0E00, // 018C GETNGBL R14 K7 + 0x88381D54, // 018D GETMBR R14 R14 K84 + 0x88381D58, // 018E GETMBR R14 R14 K88 + 0x5C3C1200, // 018F MOVE R15 R9 + 0x7C2C0800, // 0190 CALL R11 4 + 0x8C2C1556, // 0191 GETMET R11 R10 K86 + 0x54360003, // 0192 LDINT R13 4 + 0xB83A0E00, // 0193 GETNGBL R14 K7 + 0x88381D54, // 0194 GETMBR R14 R14 K84 + 0x88381D58, // 0195 GETMBR R14 R14 K88 + 0x883C0D35, // 0196 GETMBR R15 R6 K53 + 0x7C2C0800, // 0197 CALL R11 4 + 0xB82E5800, // 0198 GETNGBL R11 K44 + 0x8C2C172D, // 0199 GETMET R11 R11 K45 + 0x5834002E, // 019A LDCONST R13 K46 + 0x5838002F, // 019B LDCONST R14 K47 + 0x7C2C0600, // 019C CALL R11 3 + 0x882C0B5E, // 019D GETMBR R11 R5 K94 + 0x901A880B, // 019E SETMBR R6 K68 R11 + 0xB82E5800, // 019F GETNGBL R11 K44 + 0x8C2C172D, // 01A0 GETMET R11 R11 K45 + 0x88340D44, // 01A1 GETMBR R13 R6 K68 + 0x8C341B31, // 01A2 GETMET R13 R13 K49 + 0x7C340200, // 01A3 CALL R13 1 + 0x0036BE0D, // 01A4 ADD R13 K95 R13 + 0x5838002F, // 01A5 LDCONST R14 K47 + 0x7C2C0600, // 01A6 CALL R11 3 + 0x8C2C0960, // 01A7 GETMET R11 R4 K96 + 0x7C2C0200, // 01A8 CALL R11 1 + 0x8C2C1761, // 01A9 GETMET R11 R11 K97 + 0x88340D44, // 01AA GETMBR R13 R6 K68 + 0x7C2C0400, // 01AB CALL R11 2 + 0x8C2C1762, // 01AC GETMET R11 R11 K98 + 0x7C2C0200, // 01AD CALL R11 1 + 0x60300015, // 01AE GETGBL R12 G21 + 0x7C300000, // 01AF CALL R12 0 + 0x8C301923, // 01B0 GETMET R12 R12 K35 + 0x88380163, // 01B1 GETMBR R14 R0 K99 + 0x7C300400, // 01B2 CALL R12 2 + 0x8C340D64, // 01B3 GETMET R13 R6 K100 + 0x7C340200, // 01B4 CALL R13 1 + 0x00341A07, // 01B5 ADD R13 R13 R7 + 0x88380150, // 01B6 GETMBR R14 R0 K80 + 0x00341A0E, // 01B7 ADD R13 R13 R14 + 0x00341A0B, // 01B8 ADD R13 R13 R11 + 0x8C380925, // 01B9 GETMET R14 R4 K37 + 0x7C380200, // 01BA CALL R14 1 + 0x8C381D26, // 01BB GETMET R14 R14 K38 + 0x88400D22, // 01BC GETMBR R16 R6 K34 + 0x5C441A00, // 01BD MOVE R17 R13 + 0x5C481800, // 01BE MOVE R18 R12 + 0x544E000F, // 01BF LDINT R19 16 + 0x7C380A00, // 01C0 CALL R14 5 + 0xB83E5800, // 01C1 GETNGBL R15 K44 + 0x8C3C1F2D, // 01C2 GETMET R15 R15 K45 + 0x88440D22, // 01C3 GETMBR R17 R6 K34 + 0x8C442331, // 01C4 GETMET R17 R17 K49 + 0x7C440200, // 01C5 CALL R17 1 + 0x0046CA11, // 01C6 ADD R17 K101 R17 + 0x5848002F, // 01C7 LDCONST R18 K47 + 0x7C3C0600, // 01C8 CALL R15 3 + 0xB83E5800, // 01C9 GETNGBL R15 K44 + 0x8C3C1F2D, // 01CA GETMET R15 R15 K45 + 0x8C441B31, // 01CB GETMET R17 R13 K49 + 0x7C440200, // 01CC CALL R17 1 + 0x0046CC11, // 01CD ADD R17 K102 R17 + 0x5848002F, // 01CE LDCONST R18 K47 + 0x7C3C0600, // 01CF CALL R15 3 + 0xB83E5800, // 01D0 GETNGBL R15 K44 + 0x8C3C1F2D, // 01D1 GETMET R15 R15 K45 + 0x8C441D31, // 01D2 GETMET R17 R14 K49 + 0x7C440200, // 01D3 CALL R17 1 + 0x0046CE11, // 01D4 ADD R17 K103 R17 + 0x5848002F, // 01D5 LDCONST R18 K47 + 0x7C3C0600, // 01D6 CALL R15 3 + 0x8C3C1543, // 01D7 GETMET R15 R10 K67 + 0x7C3C0200, // 01D8 CALL R15 1 + 0x8C400929, // 01D9 GETMET R16 R4 K41 + 0x5C481C00, // 01DA MOVE R18 R14 + 0x604C0015, // 01DB GETGBL R19 G21 + 0x7C4C0000, // 01DC CALL R19 0 + 0x8C4C2723, // 01DD GETMET R19 R19 K35 + 0x88540168, // 01DE GETMBR R21 R0 K104 + 0x7C4C0400, // 01DF CALL R19 2 + 0x60500015, // 01E0 GETGBL R20 G21 + 0x7C500000, // 01E1 CALL R20 0 + 0x6054000C, // 01E2 GETGBL R21 G12 + 0x5C581E00, // 01E3 MOVE R22 R15 + 0x7C540200, // 01E4 CALL R21 1 + 0x545A000F, // 01E5 LDINT R22 16 + 0x7C400C00, // 01E6 CALL R16 6 + 0x8C442169, // 01E7 GETMET R17 R16 K105 + 0x5C4C1E00, // 01E8 MOVE R19 R15 + 0x7C440400, // 01E9 CALL R17 2 + 0x8C48212B, // 01EA GETMET R18 R16 K43 + 0x7C480200, // 01EB CALL R18 1 + 0x00442212, // 01EC ADD R17 R17 R18 + 0xB84A5800, // 01ED GETNGBL R18 K44 + 0x8C48252D, // 01EE GETMET R18 R18 K45 + 0x8C502331, // 01EF GETMET R20 R17 K49 + 0x7C500200, // 01F0 CALL R20 1 + 0x0052D414, // 01F1 ADD R20 K106 R20 + 0x5854002F, // 01F2 LDCONST R21 K47 + 0x7C480600, // 01F3 CALL R18 3 + 0xB84A5800, // 01F4 GETNGBL R18 K44 + 0x8C48252D, // 01F5 GETMET R18 R18 K45 + 0x5850002E, // 01F6 LDCONST R20 K46 + 0x5854002F, // 01F7 LDCONST R21 K47 + 0x7C480600, // 01F8 CALL R18 3 + 0xB84A0E00, // 01F9 GETNGBL R18 K7 + 0x8C48256B, // 01FA GETMET R18 R18 K107 + 0x7C480200, // 01FB CALL R18 1 + 0x904AD807, // 01FC SETMBR R18 K108 R7 + 0x884C011F, // 01FD GETMBR R19 R0 K31 + 0x904ADA13, // 01FE SETMBR R18 K109 R19 + 0x884C0150, // 01FF GETMBR R19 R0 K80 + 0x904ADC13, // 0200 SETMBR R18 K110 R19 + 0x904ADE11, // 0201 SETMBR R18 K111 R17 + 0xB84E5800, // 0202 GETNGBL R19 K44 + 0x8C4C272D, // 0203 GETMET R19 R19 K45 + 0xB8560E00, // 0204 GETNGBL R21 K7 + 0x8C542B71, // 0205 GETMET R21 R21 K113 + 0x5C5C2400, // 0206 MOVE R23 R18 + 0x7C540400, // 0207 CALL R21 2 + 0x0056E015, // 0208 ADD R21 K112 R21 + 0x5858002F, // 0209 LDCONST R22 K47 + 0x7C4C0600, // 020A CALL R19 3 + 0x8C4C2543, // 020B GETMET R19 R18 K67 + 0x7C4C0200, // 020C CALL R19 1 + 0x901AE413, // 020D SETMBR R6 K114 R19 + 0xB8525800, // 020E GETNGBL R20 K44 + 0x8C50292D, // 020F GETMET R20 R20 K45 + 0x8C582731, // 0210 GETMET R22 R19 K49 + 0x7C580200, // 0211 CALL R22 1 + 0x005AE616, // 0212 ADD R22 K115 R22 + 0x585C002F, // 0213 LDCONST R23 K47 + 0x7C500600, // 0214 CALL R20 3 + 0x8C500346, // 0215 GETMET R20 R1 K70 + 0x545A0030, // 0216 LDINT R22 49 + 0x505C0200, // 0217 LDBOOL R23 1 0 + 0x7C500600, // 0218 CALL R20 3 + 0x8C542943, // 0219 GETMET R21 R20 K67 + 0x5C5C2600, // 021A MOVE R23 R19 + 0x7C540400, // 021B CALL R21 2 + 0x88580147, // 021C GETMBR R22 R0 K71 + 0x8C582D48, // 021D GETMET R22 R22 K72 + 0x5C602A00, // 021E MOVE R24 R21 + 0x5C640400, // 021F MOVE R25 R2 + 0x5C680600, // 0220 MOVE R26 R3 + 0x886C2949, // 0221 GETMBR R27 R20 K73 + 0x7C580A00, // 0222 CALL R22 5 + 0x50580200, // 0223 LDBOOL R22 1 0 + 0x80042C00, // 0224 RET 1 R22 + 0x501C0200, // 0225 LDBOOL R7 1 0 + 0x80040E00, // 0226 RET 1 R7 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: parse_Pake3 +********************************************************************/ +be_local_closure(Matter_Commisioning_Context_parse_Pake3, /* name */ + be_nested_proto( + 18, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[45]) { /* constants */ + /* K0 */ be_nested_str_weak(crypto), + /* K1 */ be_nested_str_weak(opcode), + /* K2 */ be_nested_str_weak(local_session_id), + /* K3 */ be_const_int(0), + /* K4 */ be_nested_str_weak(protocol_id), + /* K5 */ be_nested_str_weak(protocol_error), + /* K6 */ be_nested_str_weak(invalid_X20Pake3_X20message), + /* K7 */ be_nested_str_weak(matter), + /* K8 */ be_nested_str_weak(Pake3), + /* K9 */ be_nested_str_weak(parse), + /* K10 */ be_nested_str_weak(raw), + /* K11 */ be_nested_str_weak(app_payload_idx), + /* K12 */ be_nested_str_weak(cA), + /* K13 */ be_nested_str_weak(tasmota), + /* K14 */ be_nested_str_weak(log), + /* K15 */ be_nested_str_weak(MTR_X3A_X20received_X20cA_X3D), + /* K16 */ be_nested_str_weak(tohex), + /* K17 */ be_const_int(3), + /* K18 */ be_nested_str_weak(spake), + /* K19 */ be_nested_str_weak(invalid_X20cA_X20received), + /* K20 */ be_nested_str_weak(session_timestamp), + /* K21 */ be_nested_str_weak(rtc), + /* K22 */ be_nested_str_weak(utc), + /* K23 */ be_nested_str_weak(HKDF_SHA256), + /* K24 */ be_nested_str_weak(derive), + /* K25 */ be_nested_str_weak(Ke), + /* K26 */ be_nested_str_weak(fromstring), + /* K27 */ be_nested_str_weak(SEKeys_Info), + /* K28 */ be_nested_str_weak(I2RKey), + /* K29 */ be_nested_str_weak(R2IKey), + /* K30 */ be_nested_str_weak(AttestationChallenge), + /* K31 */ be_nested_str_weak(MTR_X3A_X20_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A), + /* K32 */ be_nested_str_weak(MTR_X3A_X20session_keys_X3D), + /* K33 */ be_nested_str_weak(MTR_X3A_X20I2RKey_X20_X20_X20_X20_X20_X20_X3D), + /* K34 */ be_nested_str_weak(MTR_X3A_X20R2IKey_X20_X20_X20_X20_X20_X20_X3D), + /* K35 */ be_nested_str_weak(MTR_X3A_X20AC_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D), + /* K36 */ be_nested_str_weak(build_response), + /* K37 */ be_nested_str_weak(add), + /* K38 */ be_const_int(2), + /* K39 */ be_nested_str_weak(encode), + /* K40 */ be_nested_str_weak(responder), + /* K41 */ be_nested_str_weak(send_response), + /* K42 */ be_nested_str_weak(add_session), + /* K43 */ be_nested_str_weak(future_local_session_id), + /* K44 */ be_nested_str_weak(future_initiator_session_id), + }), + be_str_weak(parse_Pake3), + &be_const_str_solidified, + ( &(const binstruction[146]) { /* code */ + 0xA4120000, // 0000 IMPORT R4 K0 + 0x88140301, // 0001 GETMBR R5 R1 K1 + 0x541A0023, // 0002 LDINT R6 36 + 0x20140A06, // 0003 NE R5 R5 R6 + 0x74160005, // 0004 JMPT R5 #000B + 0x88140302, // 0005 GETMBR R5 R1 K2 + 0x20140B03, // 0006 NE R5 R5 K3 + 0x74160002, // 0007 JMPT R5 #000B + 0x88140304, // 0008 GETMBR R5 R1 K4 + 0x20140B03, // 0009 NE R5 R5 K3 + 0x78160000, // 000A JMPF R5 #000C + 0xB0060B06, // 000B RAISE 1 K5 K6 + 0xB8160E00, // 000C GETNGBL R5 K7 + 0x8C140B08, // 000D GETMET R5 R5 K8 + 0x7C140200, // 000E CALL R5 1 + 0x8C140B09, // 000F GETMET R5 R5 K9 + 0x881C030A, // 0010 GETMBR R7 R1 K10 + 0x8820030B, // 0011 GETMBR R8 R1 K11 + 0x7C140600, // 0012 CALL R5 3 + 0x88180B0C, // 0013 GETMBR R6 R5 K12 + 0x90021806, // 0014 SETMBR R0 K12 R6 + 0xB81A1A00, // 0015 GETNGBL R6 K13 + 0x8C180D0E, // 0016 GETMET R6 R6 K14 + 0x8820010C, // 0017 GETMBR R8 R0 K12 + 0x8C201110, // 0018 GETMET R8 R8 K16 + 0x7C200200, // 0019 CALL R8 1 + 0x00221E08, // 001A ADD R8 K15 R8 + 0x58240011, // 001B LDCONST R9 K17 + 0x7C180600, // 001C CALL R6 3 + 0x8818010C, // 001D GETMBR R6 R0 K12 + 0x881C0112, // 001E GETMBR R7 R0 K18 + 0x881C0F0C, // 001F GETMBR R7 R7 K12 + 0x20180C07, // 0020 NE R6 R6 R7 + 0x781A0000, // 0021 JMPF R6 #0023 + 0xB0060B13, // 0022 RAISE 1 K5 K19 + 0xB81A1A00, // 0023 GETNGBL R6 K13 + 0x8C180D15, // 0024 GETMET R6 R6 K21 + 0x7C180200, // 0025 CALL R6 1 + 0x94180D16, // 0026 GETIDX R6 R6 K22 + 0x90022806, // 0027 SETMBR R0 K20 R6 + 0x8C180917, // 0028 GETMET R6 R4 K23 + 0x7C180200, // 0029 CALL R6 1 + 0x8C180D18, // 002A GETMET R6 R6 K24 + 0x88200119, // 002B GETMBR R8 R0 K25 + 0x60240015, // 002C GETGBL R9 G21 + 0x7C240000, // 002D CALL R9 0 + 0x60280015, // 002E GETGBL R10 G21 + 0x7C280000, // 002F CALL R10 0 + 0x8C28151A, // 0030 GETMET R10 R10 K26 + 0x8830011B, // 0031 GETMBR R12 R0 K27 + 0x7C280400, // 0032 CALL R10 2 + 0x542E002F, // 0033 LDINT R11 48 + 0x7C180A00, // 0034 CALL R6 5 + 0x541E000E, // 0035 LDINT R7 15 + 0x401E0607, // 0036 CONNECT R7 K3 R7 + 0x941C0C07, // 0037 GETIDX R7 R6 R7 + 0x90023807, // 0038 SETMBR R0 K28 R7 + 0x541E000F, // 0039 LDINT R7 16 + 0x5422001E, // 003A LDINT R8 31 + 0x401C0E08, // 003B CONNECT R7 R7 R8 + 0x941C0C07, // 003C GETIDX R7 R6 R7 + 0x90023A07, // 003D SETMBR R0 K29 R7 + 0x541E001F, // 003E LDINT R7 32 + 0x5422002E, // 003F LDINT R8 47 + 0x401C0E08, // 0040 CONNECT R7 R7 R8 + 0x941C0C07, // 0041 GETIDX R7 R6 R7 + 0x90023C07, // 0042 SETMBR R0 K30 R7 + 0xB81E1A00, // 0043 GETNGBL R7 K13 + 0x8C1C0F0E, // 0044 GETMET R7 R7 K14 + 0x5824001F, // 0045 LDCONST R9 K31 + 0x58280011, // 0046 LDCONST R10 K17 + 0x7C1C0600, // 0047 CALL R7 3 + 0xB81E1A00, // 0048 GETNGBL R7 K13 + 0x8C1C0F0E, // 0049 GETMET R7 R7 K14 + 0x8C240D10, // 004A GETMET R9 R6 K16 + 0x7C240200, // 004B CALL R9 1 + 0x00264009, // 004C ADD R9 K32 R9 + 0x58280011, // 004D LDCONST R10 K17 + 0x7C1C0600, // 004E CALL R7 3 + 0xB81E1A00, // 004F GETNGBL R7 K13 + 0x8C1C0F0E, // 0050 GETMET R7 R7 K14 + 0x8824011C, // 0051 GETMBR R9 R0 K28 + 0x8C241310, // 0052 GETMET R9 R9 K16 + 0x7C240200, // 0053 CALL R9 1 + 0x00264209, // 0054 ADD R9 K33 R9 + 0x58280011, // 0055 LDCONST R10 K17 + 0x7C1C0600, // 0056 CALL R7 3 + 0xB81E1A00, // 0057 GETNGBL R7 K13 + 0x8C1C0F0E, // 0058 GETMET R7 R7 K14 + 0x8824011D, // 0059 GETMBR R9 R0 K29 + 0x8C241310, // 005A GETMET R9 R9 K16 + 0x7C240200, // 005B CALL R9 1 + 0x00264409, // 005C ADD R9 K34 R9 + 0x58280011, // 005D LDCONST R10 K17 + 0x7C1C0600, // 005E CALL R7 3 + 0xB81E1A00, // 005F GETNGBL R7 K13 + 0x8C1C0F0E, // 0060 GETMET R7 R7 K14 + 0x8824011E, // 0061 GETMBR R9 R0 K30 + 0x8C241310, // 0062 GETMET R9 R9 K16 + 0x7C240200, // 0063 CALL R9 1 + 0x00264609, // 0064 ADD R9 K35 R9 + 0x58280011, // 0065 LDCONST R10 K17 + 0x7C1C0600, // 0066 CALL R7 3 + 0xB81E1A00, // 0067 GETNGBL R7 K13 + 0x8C1C0F0E, // 0068 GETMET R7 R7 K14 + 0x5824001F, // 0069 LDCONST R9 K31 + 0x58280011, // 006A LDCONST R10 K17 + 0x7C1C0600, // 006B CALL R7 3 + 0x8C1C0324, // 006C GETMET R7 R1 K36 + 0x5426003F, // 006D LDINT R9 64 + 0x50280000, // 006E LDBOOL R10 0 0 + 0x7C1C0600, // 006F CALL R7 3 + 0x60200015, // 0070 GETGBL R8 G21 + 0x7C200000, // 0071 CALL R8 0 + 0x8C241125, // 0072 GETMET R9 R8 K37 + 0x582C0003, // 0073 LDCONST R11 K3 + 0x58300026, // 0074 LDCONST R12 K38 + 0x7C240600, // 0075 CALL R9 3 + 0x8C241125, // 0076 GETMET R9 R8 K37 + 0x582C0003, // 0077 LDCONST R11 K3 + 0x54320003, // 0078 LDINT R12 4 + 0x7C240600, // 0079 CALL R9 3 + 0x8C241125, // 007A GETMET R9 R8 K37 + 0x582C0003, // 007B LDCONST R11 K3 + 0x54320003, // 007C LDINT R12 4 + 0x7C240600, // 007D CALL R9 3 + 0x8C240F27, // 007E GETMET R9 R7 K39 + 0x5C2C1000, // 007F MOVE R11 R8 + 0x7C240400, // 0080 CALL R9 2 + 0x88280128, // 0081 GETMBR R10 R0 K40 + 0x8C281529, // 0082 GETMET R10 R10 K41 + 0x5C301200, // 0083 MOVE R12 R9 + 0x5C340400, // 0084 MOVE R13 R2 + 0x5C380600, // 0085 MOVE R14 R3 + 0x4C3C0000, // 0086 LDNIL R15 + 0x7C280A00, // 0087 CALL R10 5 + 0x88280128, // 0088 GETMBR R10 R0 K40 + 0x8C28152A, // 0089 GETMET R10 R10 K42 + 0x8830012B, // 008A GETMBR R12 R0 K43 + 0x8834012C, // 008B GETMBR R13 R0 K44 + 0x8838011C, // 008C GETMBR R14 R0 K28 + 0x883C011D, // 008D GETMBR R15 R0 K29 + 0x8840011E, // 008E GETMBR R16 R0 K30 + 0x88440114, // 008F GETMBR R17 R0 K20 + 0x7C280E00, // 0090 CALL R10 7 + 0x80000000, // 0091 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: process_incoming +********************************************************************/ +be_local_closure(Matter_Commisioning_Context_process_incoming, /* name */ + be_nested_proto( + 9, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[15]) { /* constants */ + /* K0 */ be_nested_str_weak(window_open), + /* K1 */ be_nested_str_weak(tasmota), + /* K2 */ be_nested_str_weak(log), + /* K3 */ be_nested_str_weak(MTR_X3A_X20commissioning_X20not_X20open), + /* K4 */ be_const_int(2), + /* K5 */ be_nested_str_weak(MTR_X3A_X20received_X20message_X20), + /* K6 */ be_nested_str_weak(matter), + /* K7 */ be_nested_str_weak(inspect), + /* K8 */ be_const_int(3), + /* K9 */ be_nested_str_weak(opcode), + /* K10 */ be_nested_str_weak(parse_PBKDFParamRequest), + /* K11 */ be_nested_str_weak(parse_Pake1), + /* K12 */ be_nested_str_weak(parse_Pake3), + /* K13 */ be_nested_str_weak(parse_Sigma1), + /* K14 */ be_nested_str_weak(parse_Sigma3), + }), + be_str_weak(process_incoming), + &be_const_str_solidified, + ( &(const binstruction[74]) { /* code */ + 0x88100100, // 0000 GETMBR R4 R0 K0 + 0x74120006, // 0001 JMPT R4 #0009 + 0xB8120200, // 0002 GETNGBL R4 K1 + 0x8C100902, // 0003 GETMET R4 R4 K2 + 0x58180003, // 0004 LDCONST R6 K3 + 0x581C0004, // 0005 LDCONST R7 K4 + 0x7C100600, // 0006 CALL R4 3 + 0x50100000, // 0007 LDBOOL R4 0 0 + 0x80040800, // 0008 RET 1 R4 + 0xB8120200, // 0009 GETNGBL R4 K1 + 0x8C100902, // 000A GETMET R4 R4 K2 + 0xB81A0C00, // 000B GETNGBL R6 K6 + 0x8C180D07, // 000C GETMET R6 R6 K7 + 0x5C200200, // 000D MOVE R8 R1 + 0x7C180400, // 000E CALL R6 2 + 0x001A0A06, // 000F ADD R6 K5 R6 + 0x581C0008, // 0010 LDCONST R7 K8 + 0x7C100600, // 0011 CALL R4 3 + 0x88100309, // 0012 GETMBR R4 R1 K9 + 0x5416001F, // 0013 LDINT R5 32 + 0x1C100805, // 0014 EQ R4 R4 R5 + 0x78120006, // 0015 JMPF R4 #001D + 0x8C10010A, // 0016 GETMET R4 R0 K10 + 0x5C180200, // 0017 MOVE R6 R1 + 0x5C1C0400, // 0018 MOVE R7 R2 + 0x5C200600, // 0019 MOVE R8 R3 + 0x7C100800, // 001A CALL R4 4 + 0x80040800, // 001B RET 1 R4 + 0x7002002A, // 001C JMP #0048 + 0x88100309, // 001D GETMBR R4 R1 K9 + 0x54160021, // 001E LDINT R5 34 + 0x1C100805, // 001F EQ R4 R4 R5 + 0x78120006, // 0020 JMPF R4 #0028 + 0x8C10010B, // 0021 GETMET R4 R0 K11 + 0x5C180200, // 0022 MOVE R6 R1 + 0x5C1C0400, // 0023 MOVE R7 R2 + 0x5C200600, // 0024 MOVE R8 R3 + 0x7C100800, // 0025 CALL R4 4 + 0x80040800, // 0026 RET 1 R4 + 0x7002001F, // 0027 JMP #0048 + 0x88100309, // 0028 GETMBR R4 R1 K9 + 0x54160023, // 0029 LDINT R5 36 + 0x1C100805, // 002A EQ R4 R4 R5 + 0x78120006, // 002B JMPF R4 #0033 + 0x8C10010C, // 002C GETMET R4 R0 K12 + 0x5C180200, // 002D MOVE R6 R1 + 0x5C1C0400, // 002E MOVE R7 R2 + 0x5C200600, // 002F MOVE R8 R3 + 0x7C100800, // 0030 CALL R4 4 + 0x80040800, // 0031 RET 1 R4 + 0x70020014, // 0032 JMP #0048 + 0x88100309, // 0033 GETMBR R4 R1 K9 + 0x5416002F, // 0034 LDINT R5 48 + 0x1C100805, // 0035 EQ R4 R4 R5 + 0x78120006, // 0036 JMPF R4 #003E + 0x8C10010D, // 0037 GETMET R4 R0 K13 + 0x5C180200, // 0038 MOVE R6 R1 + 0x5C1C0400, // 0039 MOVE R7 R2 + 0x5C200600, // 003A MOVE R8 R3 + 0x7C100800, // 003B CALL R4 4 + 0x80040800, // 003C RET 1 R4 + 0x70020009, // 003D JMP #0048 + 0x88100309, // 003E GETMBR R4 R1 K9 + 0x54160031, // 003F LDINT R5 50 + 0x1C100805, // 0040 EQ R4 R4 R5 + 0x78120005, // 0041 JMPF R4 #0048 + 0x8C10010E, // 0042 GETMET R4 R0 K14 + 0x5C180200, // 0043 MOVE R6 R1 + 0x5C1C0400, // 0044 MOVE R7 R2 + 0x5C200600, // 0045 MOVE R8 R3 + 0x7C100800, // 0046 CALL R4 4 + 0x80040800, // 0047 RET 1 R4 + 0x50100000, // 0048 LDBOOL R4 0 0 + 0x80040800, // 0049 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_Commisioning_Context +********************************************************************/ +be_local_class(Matter_Commisioning_Context, + 21, + NULL, + be_nested_map(36, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(parse_PBKDFParamRequest, -1), be_const_closure(Matter_Commisioning_Context_parse_PBKDFParamRequest_closure) }, + { be_const_key_weak(cA, 32), be_const_var(10) }, + { be_const_key_weak(PBKDFParamRequest, -1), be_const_var(5) }, + { be_const_key_weak(parse_Pake3, 20), be_const_closure(Matter_Commisioning_Context_parse_Pake3_closure) }, + { be_const_key_weak(cB, -1), be_const_var(11) }, + { be_const_key_weak(spake, -1), be_const_var(2) }, + { be_const_key_weak(find_session_by_destination_id, 2), be_const_closure(Matter_Commisioning_Context_find_session_by_destination_id_closure) }, + { be_const_key_weak(R2IKey, -1), be_const_var(18) }, + { be_const_key_weak(Ke, -1), be_const_var(12) }, + { be_const_key_weak(parse_Sigma1, -1), be_const_closure(Matter_Commisioning_Context_parse_Sigma1_closure) }, + { be_const_key_weak(SEKeys_Info, -1), be_nested_str_weak(SessionKeys) }, + { be_const_key_weak(I2RKey, -1), be_const_var(17) }, + { be_const_key_weak(ResponderEph_priv, -1), be_const_var(13) }, + { be_const_key_weak(parse_Pake1, -1), be_const_closure(Matter_Commisioning_Context_parse_Pake1_closure) }, + { be_const_key_weak(AttestationChallenge, -1), be_const_var(19) }, + { be_const_key_weak(init, 3), be_const_closure(Matter_Commisioning_Context_init_closure) }, + { be_const_key_weak(ResponderEph_pub, 6), be_const_var(14) }, + { be_const_key_weak(initiatorEph_pub, -1), be_const_var(15) }, + { be_const_key_weak(window_open, -1), be_const_var(20) }, + { be_const_key_weak(session_timestamp, 26), be_const_var(16) }, + { be_const_key_weak(future_local_session_id, 34), be_const_var(4) }, + { be_const_key_weak(Matter_Context_Prefix, 27), be_nested_str_weak(CHIP_X20PAKE_X20V1_X20Commissioning) }, + { be_const_key_weak(pA, 30), be_const_var(8) }, + { be_const_key_weak(pB, -1), be_const_var(9) }, + { be_const_key_weak(TBEData2_Nonce, -1), be_nested_str_weak(NCASE_Sigma2N) }, + { be_const_key_weak(future_initiator_session_id, -1), be_const_var(3) }, + { be_const_key_weak(PBKDFParamResponse, -1), be_const_var(6) }, + { be_const_key_weak(every_second, -1), be_const_closure(Matter_Commisioning_Context_every_second_closure) }, + { be_const_key_weak(y, 19), be_const_var(7) }, + { be_const_key_weak(parse_Sigma3, 8), be_const_closure(Matter_Commisioning_Context_parse_Sigma3_closure) }, + { be_const_key_weak(S2K_Info, -1), be_nested_str_weak(Sigma2) }, + { be_const_key_weak(TBEData3_Nonce, 9), be_nested_str_weak(NCASE_Sigma3N) }, + { be_const_key_weak(responder, -1), be_const_var(0) }, + { be_const_key_weak(S3K_Info, -1), be_nested_str_weak(Sigma3) }, + { be_const_key_weak(device, -1), be_const_var(1) }, + { be_const_key_weak(process_incoming, -1), be_const_closure(Matter_Commisioning_Context_process_incoming_closure) }, + })), + be_str_weak(Matter_Commisioning_Context) +); +/*******************************************************************/ + +void be_load_Matter_Commisioning_Context_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_Commisioning_Context); + be_setglobal(vm, "Matter_Commisioning_Context"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Commissioning_Data.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Commissioning_Data.h new file mode 100644 index 000000000..2c2bb647a --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Commissioning_Data.h @@ -0,0 +1,970 @@ +/* Solidification of Matter_Commissioning_Data.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_PBKDFParamRequest; + +/******************************************************************** +** Solidified function: parse +********************************************************************/ +be_local_closure(Matter_PBKDFParamRequest_parse, /* name */ + be_nested_proto( + 8, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[16]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(TLV), + /* K3 */ be_nested_str_weak(parse), + /* K4 */ be_nested_str_weak(initiatorRandom), + /* K5 */ be_nested_str_weak(getsubval), + /* K6 */ be_const_int(1), + /* K7 */ be_nested_str_weak(initiator_session_id), + /* K8 */ be_const_int(2), + /* K9 */ be_nested_str_weak(passcodeId), + /* K10 */ be_const_int(3), + /* K11 */ be_nested_str_weak(hasPBKDFParameters), + /* K12 */ be_nested_str_weak(findsub), + /* K13 */ be_nested_str_weak(SLEEPY_IDLE_INTERVAL), + /* K14 */ be_nested_str_weak(findsubval), + /* K15 */ be_nested_str_weak(SLEEPY_ACTIVE_INTERVAL), + }), + be_str_weak(parse), + &be_const_str_solidified, + ( &(const binstruction[41]) { /* code */ + 0x4C0C0000, // 0000 LDNIL R3 + 0x1C0C0403, // 0001 EQ R3 R2 R3 + 0x780E0000, // 0002 JMPF R3 #0004 + 0x58080000, // 0003 LDCONST R2 K0 + 0xB80E0200, // 0004 GETNGBL R3 K1 + 0x880C0702, // 0005 GETMBR R3 R3 K2 + 0x8C0C0703, // 0006 GETMET R3 R3 K3 + 0x5C140200, // 0007 MOVE R5 R1 + 0x5C180400, // 0008 MOVE R6 R2 + 0x7C0C0600, // 0009 CALL R3 3 + 0x8C100705, // 000A GETMET R4 R3 K5 + 0x58180006, // 000B LDCONST R6 K6 + 0x7C100400, // 000C CALL R4 2 + 0x90020804, // 000D SETMBR R0 K4 R4 + 0x8C100705, // 000E GETMET R4 R3 K5 + 0x58180008, // 000F LDCONST R6 K8 + 0x7C100400, // 0010 CALL R4 2 + 0x90020E04, // 0011 SETMBR R0 K7 R4 + 0x8C100705, // 0012 GETMET R4 R3 K5 + 0x5818000A, // 0013 LDCONST R6 K10 + 0x7C100400, // 0014 CALL R4 2 + 0x90021204, // 0015 SETMBR R0 K9 R4 + 0x8C100705, // 0016 GETMET R4 R3 K5 + 0x541A0003, // 0017 LDINT R6 4 + 0x7C100400, // 0018 CALL R4 2 + 0x90021604, // 0019 SETMBR R0 K11 R4 + 0x8C10070C, // 001A GETMET R4 R3 K12 + 0x541A0004, // 001B LDINT R6 5 + 0x7C100400, // 001C CALL R4 2 + 0x4C140000, // 001D LDNIL R5 + 0x20140805, // 001E NE R5 R4 R5 + 0x78160007, // 001F JMPF R5 #0028 + 0x8C14090E, // 0020 GETMET R5 R4 K14 + 0x581C0006, // 0021 LDCONST R7 K6 + 0x7C140400, // 0022 CALL R5 2 + 0x90021A05, // 0023 SETMBR R0 K13 R5 + 0x8C14090E, // 0024 GETMET R5 R4 K14 + 0x581C0008, // 0025 LDCONST R7 K8 + 0x7C140400, // 0026 CALL R5 2 + 0x90021E05, // 0027 SETMBR R0 K15 R5 + 0x80040000, // 0028 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_PBKDFParamRequest +********************************************************************/ +be_local_class(Matter_PBKDFParamRequest, + 6, + NULL, + be_nested_map(7, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(initiatorRandom, 6), be_const_var(0) }, + { be_const_key_weak(passcodeId, -1), be_const_var(2) }, + { be_const_key_weak(hasPBKDFParameters, -1), be_const_var(3) }, + { be_const_key_weak(parse, -1), be_const_closure(Matter_PBKDFParamRequest_parse_closure) }, + { be_const_key_weak(initiator_session_id, 0), be_const_var(1) }, + { be_const_key_weak(SLEEPY_IDLE_INTERVAL, 3), be_const_var(4) }, + { be_const_key_weak(SLEEPY_ACTIVE_INTERVAL, -1), be_const_var(5) }, + })), + be_str_weak(Matter_PBKDFParamRequest) +); +/*******************************************************************/ + +void be_load_Matter_PBKDFParamRequest_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_PBKDFParamRequest); + be_setglobal(vm, "Matter_PBKDFParamRequest"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_PBKDFParamResponse; + +/******************************************************************** +** Solidified function: encode +********************************************************************/ +be_local_closure(Matter_PBKDFParamResponse_encode, /* name */ + be_nested_proto( + 10, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[19]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_TLV), + /* K4 */ be_const_int(1), + /* K5 */ be_nested_str_weak(B1), + /* K6 */ be_nested_str_weak(initiatorRandom), + /* K7 */ be_const_int(2), + /* K8 */ be_nested_str_weak(responderRandom), + /* K9 */ be_const_int(3), + /* K10 */ be_nested_str_weak(U2), + /* K11 */ be_nested_str_weak(responderSessionId), + /* K12 */ be_nested_str_weak(add_struct), + /* K13 */ be_nested_str_weak(U4), + /* K14 */ be_nested_str_weak(pbkdf_parameters_iterations), + /* K15 */ be_nested_str_weak(pbkdf_parameters_salt), + /* K16 */ be_nested_str_weak(SLEEPY_IDLE_INTERVAL), + /* K17 */ be_nested_str_weak(SLEEPY_ACTIVE_INTERVAL), + /* K18 */ be_nested_str_weak(encode), + }), + be_str_weak(encode), + &be_const_str_solidified, + ( &(const binstruction[70]) { /* code */ + 0xB80A0000, // 0000 GETNGBL R2 K0 + 0x88080501, // 0001 GETMBR R2 R2 K1 + 0x8C080502, // 0002 GETMET R2 R2 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0xB81A0000, // 0006 GETNGBL R6 K0 + 0x88180D01, // 0007 GETMBR R6 R6 K1 + 0x88180D05, // 0008 GETMBR R6 R6 K5 + 0x881C0106, // 0009 GETMBR R7 R0 K6 + 0x7C0C0800, // 000A CALL R3 4 + 0x8C0C0503, // 000B GETMET R3 R2 K3 + 0x58140007, // 000C LDCONST R5 K7 + 0xB81A0000, // 000D GETNGBL R6 K0 + 0x88180D01, // 000E GETMBR R6 R6 K1 + 0x88180D05, // 000F GETMBR R6 R6 K5 + 0x881C0108, // 0010 GETMBR R7 R0 K8 + 0x7C0C0800, // 0011 CALL R3 4 + 0x8C0C0503, // 0012 GETMET R3 R2 K3 + 0x58140009, // 0013 LDCONST R5 K9 + 0xB81A0000, // 0014 GETNGBL R6 K0 + 0x88180D01, // 0015 GETMBR R6 R6 K1 + 0x88180D0A, // 0016 GETMBR R6 R6 K10 + 0x881C010B, // 0017 GETMBR R7 R0 K11 + 0x7C0C0800, // 0018 CALL R3 4 + 0x8C0C050C, // 0019 GETMET R3 R2 K12 + 0x54160003, // 001A LDINT R5 4 + 0x7C0C0400, // 001B CALL R3 2 + 0x8C100703, // 001C GETMET R4 R3 K3 + 0x58180004, // 001D LDCONST R6 K4 + 0xB81E0000, // 001E GETNGBL R7 K0 + 0x881C0F01, // 001F GETMBR R7 R7 K1 + 0x881C0F0D, // 0020 GETMBR R7 R7 K13 + 0x8820010E, // 0021 GETMBR R8 R0 K14 + 0x7C100800, // 0022 CALL R4 4 + 0x8C100703, // 0023 GETMET R4 R3 K3 + 0x58180007, // 0024 LDCONST R6 K7 + 0xB81E0000, // 0025 GETNGBL R7 K0 + 0x881C0F01, // 0026 GETMBR R7 R7 K1 + 0x881C0F05, // 0027 GETMBR R7 R7 K5 + 0x8820010F, // 0028 GETMBR R8 R0 K15 + 0x7C100800, // 0029 CALL R4 4 + 0x88100110, // 002A GETMBR R4 R0 K16 + 0x4C140000, // 002B LDNIL R5 + 0x20100805, // 002C NE R4 R4 R5 + 0x74120003, // 002D JMPT R4 #0032 + 0x88100111, // 002E GETMBR R4 R0 K17 + 0x4C140000, // 002F LDNIL R5 + 0x20100805, // 0030 NE R4 R4 R5 + 0x78120010, // 0031 JMPF R4 #0043 + 0x8C10050C, // 0032 GETMET R4 R2 K12 + 0x541A0004, // 0033 LDINT R6 5 + 0x7C100400, // 0034 CALL R4 2 + 0x8C140903, // 0035 GETMET R5 R4 K3 + 0x581C0004, // 0036 LDCONST R7 K4 + 0xB8220000, // 0037 GETNGBL R8 K0 + 0x88201101, // 0038 GETMBR R8 R8 K1 + 0x8820110D, // 0039 GETMBR R8 R8 K13 + 0x88240110, // 003A GETMBR R9 R0 K16 + 0x7C140800, // 003B CALL R5 4 + 0x8C140903, // 003C GETMET R5 R4 K3 + 0x581C0007, // 003D LDCONST R7 K7 + 0xB8220000, // 003E GETNGBL R8 K0 + 0x88201101, // 003F GETMBR R8 R8 K1 + 0x8820110D, // 0040 GETMBR R8 R8 K13 + 0x88240111, // 0041 GETMBR R9 R0 K17 + 0x7C140800, // 0042 CALL R5 4 + 0x8C100512, // 0043 GETMET R4 R2 K18 + 0x7C100200, // 0044 CALL R4 1 + 0x80040800, // 0045 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_PBKDFParamResponse +********************************************************************/ +be_local_class(Matter_PBKDFParamResponse, + 7, + NULL, + be_nested_map(8, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(pbkdf_parameters_salt, -1), be_const_var(4) }, + { be_const_key_weak(SLEEPY_IDLE_INTERVAL, -1), be_const_var(5) }, + { be_const_key_weak(SLEEPY_ACTIVE_INTERVAL, 1), be_const_var(6) }, + { be_const_key_weak(responderRandom, -1), be_const_var(1) }, + { be_const_key_weak(pbkdf_parameters_iterations, -1), be_const_var(3) }, + { be_const_key_weak(initiatorRandom, -1), be_const_var(0) }, + { be_const_key_weak(responderSessionId, 3), be_const_var(2) }, + { be_const_key_weak(encode, -1), be_const_closure(Matter_PBKDFParamResponse_encode_closure) }, + })), + be_str_weak(Matter_PBKDFParamResponse) +); +/*******************************************************************/ + +void be_load_Matter_PBKDFParamResponse_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_PBKDFParamResponse); + be_setglobal(vm, "Matter_PBKDFParamResponse"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_Pake1; + +/******************************************************************** +** Solidified function: parse +********************************************************************/ +be_local_closure(Matter_Pake1_parse, /* name */ + be_nested_proto( + 8, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[11]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(TLV), + /* K3 */ be_nested_str_weak(parse), + /* K4 */ be_nested_str_weak(tasmota), + /* K5 */ be_nested_str_weak(log), + /* K6 */ be_nested_str_weak(MTR_X3A_X20parsed_X20TLV_X3A_X20), + /* K7 */ be_const_int(3), + /* K8 */ be_nested_str_weak(pA), + /* K9 */ be_nested_str_weak(getsubval), + /* K10 */ be_const_int(1), + }), + be_str_weak(parse), + &be_const_str_solidified, + ( &(const binstruction[23]) { /* code */ + 0x4C0C0000, // 0000 LDNIL R3 + 0x1C0C0403, // 0001 EQ R3 R2 R3 + 0x780E0000, // 0002 JMPF R3 #0004 + 0x58080000, // 0003 LDCONST R2 K0 + 0xB80E0200, // 0004 GETNGBL R3 K1 + 0x880C0702, // 0005 GETMBR R3 R3 K2 + 0x8C0C0703, // 0006 GETMET R3 R3 K3 + 0x5C140200, // 0007 MOVE R5 R1 + 0x5C180400, // 0008 MOVE R6 R2 + 0x7C0C0600, // 0009 CALL R3 3 + 0xB8120800, // 000A GETNGBL R4 K4 + 0x8C100905, // 000B GETMET R4 R4 K5 + 0x60180008, // 000C GETGBL R6 G8 + 0x5C1C0600, // 000D MOVE R7 R3 + 0x7C180200, // 000E CALL R6 1 + 0x001A0C06, // 000F ADD R6 K6 R6 + 0x581C0007, // 0010 LDCONST R7 K7 + 0x7C100600, // 0011 CALL R4 3 + 0x8C100709, // 0012 GETMET R4 R3 K9 + 0x5818000A, // 0013 LDCONST R6 K10 + 0x7C100400, // 0014 CALL R4 2 + 0x90021004, // 0015 SETMBR R0 K8 R4 + 0x80040000, // 0016 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_Pake1 +********************************************************************/ +be_local_class(Matter_Pake1, + 1, + NULL, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(pA, 1), be_const_var(0) }, + { be_const_key_weak(parse, -1), be_const_closure(Matter_Pake1_parse_closure) }, + })), + be_str_weak(Matter_Pake1) +); +/*******************************************************************/ + +void be_load_Matter_Pake1_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_Pake1); + be_setglobal(vm, "Matter_Pake1"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_Pake2; + +/******************************************************************** +** Solidified function: encode +********************************************************************/ +be_local_closure(Matter_Pake2_encode, /* name */ + be_nested_proto( + 8, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_TLV), + /* K4 */ be_const_int(1), + /* K5 */ be_nested_str_weak(B1), + /* K6 */ be_nested_str_weak(pB), + /* K7 */ be_const_int(2), + /* K8 */ be_nested_str_weak(cB), + /* K9 */ be_nested_str_weak(encode), + }), + be_str_weak(encode), + &be_const_str_solidified, + ( &(const binstruction[21]) { /* code */ + 0xB80A0000, // 0000 GETNGBL R2 K0 + 0x88080501, // 0001 GETMBR R2 R2 K1 + 0x8C080502, // 0002 GETMET R2 R2 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0xB81A0000, // 0006 GETNGBL R6 K0 + 0x88180D01, // 0007 GETMBR R6 R6 K1 + 0x88180D05, // 0008 GETMBR R6 R6 K5 + 0x881C0106, // 0009 GETMBR R7 R0 K6 + 0x7C0C0800, // 000A CALL R3 4 + 0x8C0C0503, // 000B GETMET R3 R2 K3 + 0x58140007, // 000C LDCONST R5 K7 + 0xB81A0000, // 000D GETNGBL R6 K0 + 0x88180D01, // 000E GETMBR R6 R6 K1 + 0x88180D05, // 000F GETMBR R6 R6 K5 + 0x881C0108, // 0010 GETMBR R7 R0 K8 + 0x7C0C0800, // 0011 CALL R3 4 + 0x8C0C0509, // 0012 GETMET R3 R2 K9 + 0x7C0C0200, // 0013 CALL R3 1 + 0x80040600, // 0014 RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_Pake2 +********************************************************************/ +be_local_class(Matter_Pake2, + 2, + NULL, + be_nested_map(3, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(encode, -1), be_const_closure(Matter_Pake2_encode_closure) }, + { be_const_key_weak(cB, -1), be_const_var(1) }, + { be_const_key_weak(pB, 0), be_const_var(0) }, + })), + be_str_weak(Matter_Pake2) +); +/*******************************************************************/ + +void be_load_Matter_Pake2_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_Pake2); + be_setglobal(vm, "Matter_Pake2"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_Pake3; + +/******************************************************************** +** Solidified function: parse +********************************************************************/ +be_local_closure(Matter_Pake3_parse, /* name */ + be_nested_proto( + 8, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[11]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(TLV), + /* K3 */ be_nested_str_weak(parse), + /* K4 */ be_nested_str_weak(tasmota), + /* K5 */ be_nested_str_weak(log), + /* K6 */ be_nested_str_weak(MTR_X3A_X20parsed_X20TLV_X3A_X20), + /* K7 */ be_const_int(3), + /* K8 */ be_nested_str_weak(cA), + /* K9 */ be_nested_str_weak(getsubval), + /* K10 */ be_const_int(1), + }), + be_str_weak(parse), + &be_const_str_solidified, + ( &(const binstruction[23]) { /* code */ + 0x4C0C0000, // 0000 LDNIL R3 + 0x1C0C0403, // 0001 EQ R3 R2 R3 + 0x780E0000, // 0002 JMPF R3 #0004 + 0x58080000, // 0003 LDCONST R2 K0 + 0xB80E0200, // 0004 GETNGBL R3 K1 + 0x880C0702, // 0005 GETMBR R3 R3 K2 + 0x8C0C0703, // 0006 GETMET R3 R3 K3 + 0x5C140200, // 0007 MOVE R5 R1 + 0x5C180400, // 0008 MOVE R6 R2 + 0x7C0C0600, // 0009 CALL R3 3 + 0xB8120800, // 000A GETNGBL R4 K4 + 0x8C100905, // 000B GETMET R4 R4 K5 + 0x60180008, // 000C GETGBL R6 G8 + 0x5C1C0600, // 000D MOVE R7 R3 + 0x7C180200, // 000E CALL R6 1 + 0x001A0C06, // 000F ADD R6 K6 R6 + 0x581C0007, // 0010 LDCONST R7 K7 + 0x7C100600, // 0011 CALL R4 3 + 0x8C100709, // 0012 GETMET R4 R3 K9 + 0x5818000A, // 0013 LDCONST R6 K10 + 0x7C100400, // 0014 CALL R4 2 + 0x90021004, // 0015 SETMBR R0 K8 R4 + 0x80040000, // 0016 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_Pake3 +********************************************************************/ +be_local_class(Matter_Pake3, + 1, + NULL, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(parse, -1), be_const_closure(Matter_Pake3_parse_closure) }, + { be_const_key_weak(cA, -1), be_const_var(0) }, + })), + be_str_weak(Matter_Pake3) +); +/*******************************************************************/ + +void be_load_Matter_Pake3_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_Pake3); + be_setglobal(vm, "Matter_Pake3"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_Sigma1; + +/******************************************************************** +** Solidified function: parse +********************************************************************/ +be_local_closure(Matter_Sigma1_parse, /* name */ + be_nested_proto( + 9, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[21]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(TLV), + /* K3 */ be_nested_str_weak(parse), + /* K4 */ be_nested_str_weak(Msg1), + /* K5 */ be_const_int(2147483647), + /* K6 */ be_nested_str_weak(tasmota), + /* K7 */ be_nested_str_weak(log), + /* K8 */ be_nested_str_weak(MTR_X3A_X20Sigma1_X20TLV_X3D), + /* K9 */ be_const_int(3), + /* K10 */ be_nested_str_weak(initiatorRandom), + /* K11 */ be_nested_str_weak(getsubval), + /* K12 */ be_const_int(1), + /* K13 */ be_nested_str_weak(initiator_session_id), + /* K14 */ be_const_int(2), + /* K15 */ be_nested_str_weak(destinationId), + /* K16 */ be_nested_str_weak(initiatorEphPubKey), + /* K17 */ be_nested_str_weak(findsub), + /* K18 */ be_nested_str_weak(SLEEPY_IDLE_INTERVAL), + /* K19 */ be_nested_str_weak(findsubval), + /* K20 */ be_nested_str_weak(SLEEPY_ACTIVE_INTERVAL), + }), + be_str_weak(parse), + &be_const_str_solidified, + ( &(const binstruction[58]) { /* code */ + 0x4C0C0000, // 0000 LDNIL R3 + 0x1C0C0403, // 0001 EQ R3 R2 R3 + 0x780E0000, // 0002 JMPF R3 #0004 + 0x58080000, // 0003 LDCONST R2 K0 + 0xB80E0200, // 0004 GETNGBL R3 K1 + 0x880C0702, // 0005 GETMBR R3 R3 K2 + 0x8C0C0703, // 0006 GETMET R3 R3 K3 + 0x5C140200, // 0007 MOVE R5 R1 + 0x5C180400, // 0008 MOVE R6 R2 + 0x7C0C0600, // 0009 CALL R3 3 + 0x40100505, // 000A CONNECT R4 R2 K5 + 0x94100204, // 000B GETIDX R4 R1 R4 + 0x90020804, // 000C SETMBR R0 K4 R4 + 0xB8120C00, // 000D GETNGBL R4 K6 + 0x8C100907, // 000E GETMET R4 R4 K7 + 0x60180008, // 000F GETGBL R6 G8 + 0x5C1C0600, // 0010 MOVE R7 R3 + 0x7C180200, // 0011 CALL R6 1 + 0x001A1006, // 0012 ADD R6 K8 R6 + 0x581C0009, // 0013 LDCONST R7 K9 + 0x7C100600, // 0014 CALL R4 3 + 0x8C10070B, // 0015 GETMET R4 R3 K11 + 0x5818000C, // 0016 LDCONST R6 K12 + 0x7C100400, // 0017 CALL R4 2 + 0x90021404, // 0018 SETMBR R0 K10 R4 + 0x8C10070B, // 0019 GETMET R4 R3 K11 + 0x5818000E, // 001A LDCONST R6 K14 + 0x7C100400, // 001B CALL R4 2 + 0x90021A04, // 001C SETMBR R0 K13 R4 + 0x8C10070B, // 001D GETMET R4 R3 K11 + 0x58180009, // 001E LDCONST R6 K9 + 0x7C100400, // 001F CALL R4 2 + 0x90021E04, // 0020 SETMBR R0 K15 R4 + 0x8C10070B, // 0021 GETMET R4 R3 K11 + 0x541A0003, // 0022 LDINT R6 4 + 0x7C100400, // 0023 CALL R4 2 + 0x90022004, // 0024 SETMBR R0 K16 R4 + 0x8C100711, // 0025 GETMET R4 R3 K17 + 0x541A0004, // 0026 LDINT R6 5 + 0x7C100400, // 0027 CALL R4 2 + 0x4C140000, // 0028 LDNIL R5 + 0x20140805, // 0029 NE R5 R4 R5 + 0x78160007, // 002A JMPF R5 #0033 + 0x8C140913, // 002B GETMET R5 R4 K19 + 0x581C000C, // 002C LDCONST R7 K12 + 0x7C140400, // 002D CALL R5 2 + 0x90022405, // 002E SETMBR R0 K18 R5 + 0x8C140913, // 002F GETMET R5 R4 K19 + 0x581C000E, // 0030 LDCONST R7 K14 + 0x7C140400, // 0031 CALL R5 2 + 0x90022805, // 0032 SETMBR R0 K20 R5 + 0x8C140711, // 0033 GETMET R5 R3 K17 + 0x541E0005, // 0034 LDINT R7 6 + 0x7C140400, // 0035 CALL R5 2 + 0x8C180711, // 0036 GETMET R6 R3 K17 + 0x54220006, // 0037 LDINT R8 7 + 0x7C180400, // 0038 CALL R6 2 + 0x80040000, // 0039 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_Sigma1 +********************************************************************/ +be_local_class(Matter_Sigma1, + 9, + NULL, + be_nested_map(10, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(SLEEPY_ACTIVE_INTERVAL, -1), be_const_var(5) }, + { be_const_key_weak(Msg1, -1), be_const_var(8) }, + { be_const_key_weak(parse, 6), be_const_closure(Matter_Sigma1_parse_closure) }, + { be_const_key_weak(initiatorRandom, -1), be_const_var(0) }, + { be_const_key_weak(SLEEPY_IDLE_INTERVAL, 7), be_const_var(4) }, + { be_const_key_weak(initiatorEphPubKey, -1), be_const_var(3) }, + { be_const_key_weak(initiatorResumeMIC, -1), be_const_var(7) }, + { be_const_key_weak(resumptionID, -1), be_const_var(6) }, + { be_const_key_weak(destinationId, -1), be_const_var(2) }, + { be_const_key_weak(initiator_session_id, 1), be_const_var(1) }, + })), + be_str_weak(Matter_Sigma1) +); +/*******************************************************************/ + +void be_load_Matter_Sigma1_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_Sigma1); + be_setglobal(vm, "Matter_Sigma1"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_Sigma2; + +/******************************************************************** +** Solidified function: encode +********************************************************************/ +be_local_closure(Matter_Sigma2_encode, /* name */ + be_nested_proto( + 9, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[18]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_TLV), + /* K4 */ be_const_int(1), + /* K5 */ be_nested_str_weak(B1), + /* K6 */ be_nested_str_weak(responderRandom), + /* K7 */ be_const_int(2), + /* K8 */ be_nested_str_weak(U2), + /* K9 */ be_nested_str_weak(responderSessionId), + /* K10 */ be_const_int(3), + /* K11 */ be_nested_str_weak(responderEphPubKey), + /* K12 */ be_nested_str_weak(encrypted2), + /* K13 */ be_nested_str_weak(SLEEPY_IDLE_INTERVAL), + /* K14 */ be_nested_str_weak(SLEEPY_ACTIVE_INTERVAL), + /* K15 */ be_nested_str_weak(add_struct), + /* K16 */ be_nested_str_weak(U4), + /* K17 */ be_nested_str_weak(encode), + }), + be_str_weak(encode), + &be_const_str_solidified, + ( &(const binstruction[60]) { /* code */ + 0xB80A0000, // 0000 GETNGBL R2 K0 + 0x88080501, // 0001 GETMBR R2 R2 K1 + 0x8C080502, // 0002 GETMET R2 R2 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0xB81A0000, // 0006 GETNGBL R6 K0 + 0x88180D01, // 0007 GETMBR R6 R6 K1 + 0x88180D05, // 0008 GETMBR R6 R6 K5 + 0x881C0106, // 0009 GETMBR R7 R0 K6 + 0x7C0C0800, // 000A CALL R3 4 + 0x8C0C0503, // 000B GETMET R3 R2 K3 + 0x58140007, // 000C LDCONST R5 K7 + 0xB81A0000, // 000D GETNGBL R6 K0 + 0x88180D01, // 000E GETMBR R6 R6 K1 + 0x88180D08, // 000F GETMBR R6 R6 K8 + 0x881C0109, // 0010 GETMBR R7 R0 K9 + 0x7C0C0800, // 0011 CALL R3 4 + 0x8C0C0503, // 0012 GETMET R3 R2 K3 + 0x5814000A, // 0013 LDCONST R5 K10 + 0xB81A0000, // 0014 GETNGBL R6 K0 + 0x88180D01, // 0015 GETMBR R6 R6 K1 + 0x88180D05, // 0016 GETMBR R6 R6 K5 + 0x881C010B, // 0017 GETMBR R7 R0 K11 + 0x7C0C0800, // 0018 CALL R3 4 + 0x8C0C0503, // 0019 GETMET R3 R2 K3 + 0x54160003, // 001A LDINT R5 4 + 0xB81A0000, // 001B GETNGBL R6 K0 + 0x88180D01, // 001C GETMBR R6 R6 K1 + 0x88180D05, // 001D GETMBR R6 R6 K5 + 0x881C010C, // 001E GETMBR R7 R0 K12 + 0x7C0C0800, // 001F CALL R3 4 + 0x880C010D, // 0020 GETMBR R3 R0 K13 + 0x4C100000, // 0021 LDNIL R4 + 0x200C0604, // 0022 NE R3 R3 R4 + 0x740E0003, // 0023 JMPT R3 #0028 + 0x880C010E, // 0024 GETMBR R3 R0 K14 + 0x4C100000, // 0025 LDNIL R4 + 0x200C0604, // 0026 NE R3 R3 R4 + 0x780E0010, // 0027 JMPF R3 #0039 + 0x8C0C050F, // 0028 GETMET R3 R2 K15 + 0x54160004, // 0029 LDINT R5 5 + 0x7C0C0400, // 002A CALL R3 2 + 0x8C100703, // 002B GETMET R4 R3 K3 + 0x58180004, // 002C LDCONST R6 K4 + 0xB81E0000, // 002D GETNGBL R7 K0 + 0x881C0F01, // 002E GETMBR R7 R7 K1 + 0x881C0F10, // 002F GETMBR R7 R7 K16 + 0x8820010D, // 0030 GETMBR R8 R0 K13 + 0x7C100800, // 0031 CALL R4 4 + 0x8C100703, // 0032 GETMET R4 R3 K3 + 0x58180007, // 0033 LDCONST R6 K7 + 0xB81E0000, // 0034 GETNGBL R7 K0 + 0x881C0F01, // 0035 GETMBR R7 R7 K1 + 0x881C0F10, // 0036 GETMBR R7 R7 K16 + 0x8820010E, // 0037 GETMBR R8 R0 K14 + 0x7C100800, // 0038 CALL R4 4 + 0x8C0C0511, // 0039 GETMET R3 R2 K17 + 0x7C0C0200, // 003A CALL R3 1 + 0x80040600, // 003B RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_Sigma2 +********************************************************************/ +be_local_class(Matter_Sigma2, + 6, + NULL, + be_nested_map(7, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(encrypted2, -1), be_const_var(3) }, + { be_const_key_weak(encode, -1), be_const_closure(Matter_Sigma2_encode_closure) }, + { be_const_key_weak(responderSessionId, -1), be_const_var(1) }, + { be_const_key_weak(SLEEPY_IDLE_INTERVAL, 6), be_const_var(4) }, + { be_const_key_weak(SLEEPY_ACTIVE_INTERVAL, 0), be_const_var(5) }, + { be_const_key_weak(responderRandom, 3), be_const_var(0) }, + { be_const_key_weak(responderEphPubKey, -1), be_const_var(2) }, + })), + be_str_weak(Matter_Sigma2) +); +/*******************************************************************/ + +void be_load_Matter_Sigma2_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_Sigma2); + be_setglobal(vm, "Matter_Sigma2"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_Sigma2Resume; + +/******************************************************************** +** Solidified function: encode +********************************************************************/ +be_local_closure(Matter_Sigma2Resume_encode, /* name */ + be_nested_proto( + 9, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[16]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_TLV), + /* K4 */ be_const_int(1), + /* K5 */ be_nested_str_weak(B1), + /* K6 */ be_nested_str_weak(resumptionID), + /* K7 */ be_const_int(2), + /* K8 */ be_nested_str_weak(sigma2ResumeMIC), + /* K9 */ be_const_int(3), + /* K10 */ be_nested_str_weak(responderSessionID), + /* K11 */ be_nested_str_weak(SLEEPY_IDLE_INTERVAL), + /* K12 */ be_nested_str_weak(SLEEPY_ACTIVE_INTERVAL), + /* K13 */ be_nested_str_weak(add_struct), + /* K14 */ be_nested_str_weak(U4), + /* K15 */ be_nested_str_weak(encode), + }), + be_str_weak(encode), + &be_const_str_solidified, + ( &(const binstruction[53]) { /* code */ + 0xB80A0000, // 0000 GETNGBL R2 K0 + 0x88080501, // 0001 GETMBR R2 R2 K1 + 0x8C080502, // 0002 GETMET R2 R2 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0xB81A0000, // 0006 GETNGBL R6 K0 + 0x88180D01, // 0007 GETMBR R6 R6 K1 + 0x88180D05, // 0008 GETMBR R6 R6 K5 + 0x881C0106, // 0009 GETMBR R7 R0 K6 + 0x7C0C0800, // 000A CALL R3 4 + 0x8C0C0503, // 000B GETMET R3 R2 K3 + 0x58140007, // 000C LDCONST R5 K7 + 0xB81A0000, // 000D GETNGBL R6 K0 + 0x88180D01, // 000E GETMBR R6 R6 K1 + 0x88180D05, // 000F GETMBR R6 R6 K5 + 0x881C0108, // 0010 GETMBR R7 R0 K8 + 0x7C0C0800, // 0011 CALL R3 4 + 0x8C0C0503, // 0012 GETMET R3 R2 K3 + 0x58140009, // 0013 LDCONST R5 K9 + 0xB81A0000, // 0014 GETNGBL R6 K0 + 0x88180D01, // 0015 GETMBR R6 R6 K1 + 0x88180D05, // 0016 GETMBR R6 R6 K5 + 0x881C010A, // 0017 GETMBR R7 R0 K10 + 0x7C0C0800, // 0018 CALL R3 4 + 0x880C010B, // 0019 GETMBR R3 R0 K11 + 0x4C100000, // 001A LDNIL R4 + 0x200C0604, // 001B NE R3 R3 R4 + 0x740E0003, // 001C JMPT R3 #0021 + 0x880C010C, // 001D GETMBR R3 R0 K12 + 0x4C100000, // 001E LDNIL R4 + 0x200C0604, // 001F NE R3 R3 R4 + 0x780E0010, // 0020 JMPF R3 #0032 + 0x8C0C050D, // 0021 GETMET R3 R2 K13 + 0x54160003, // 0022 LDINT R5 4 + 0x7C0C0400, // 0023 CALL R3 2 + 0x8C100703, // 0024 GETMET R4 R3 K3 + 0x58180004, // 0025 LDCONST R6 K4 + 0xB81E0000, // 0026 GETNGBL R7 K0 + 0x881C0F01, // 0027 GETMBR R7 R7 K1 + 0x881C0F0E, // 0028 GETMBR R7 R7 K14 + 0x8820010B, // 0029 GETMBR R8 R0 K11 + 0x7C100800, // 002A CALL R4 4 + 0x8C100703, // 002B GETMET R4 R3 K3 + 0x58180007, // 002C LDCONST R6 K7 + 0xB81E0000, // 002D GETNGBL R7 K0 + 0x881C0F01, // 002E GETMBR R7 R7 K1 + 0x881C0F0E, // 002F GETMBR R7 R7 K14 + 0x8820010C, // 0030 GETMBR R8 R0 K12 + 0x7C100800, // 0031 CALL R4 4 + 0x8C0C050F, // 0032 GETMET R3 R2 K15 + 0x7C0C0200, // 0033 CALL R3 1 + 0x80040600, // 0034 RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_Sigma2Resume +********************************************************************/ +be_local_class(Matter_Sigma2Resume, + 5, + NULL, + be_nested_map(6, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(SLEEPY_IDLE_INTERVAL, 3), be_const_var(3) }, + { be_const_key_weak(resumptionID, -1), be_const_var(0) }, + { be_const_key_weak(sigma2ResumeMIC, -1), be_const_var(1) }, + { be_const_key_weak(responderSessionID, 1), be_const_var(2) }, + { be_const_key_weak(SLEEPY_ACTIVE_INTERVAL, -1), be_const_var(4) }, + { be_const_key_weak(encode, -1), be_const_closure(Matter_Sigma2Resume_encode_closure) }, + })), + be_str_weak(Matter_Sigma2Resume) +); +/*******************************************************************/ + +void be_load_Matter_Sigma2Resume_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_Sigma2Resume); + be_setglobal(vm, "Matter_Sigma2Resume"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_Sigma3; + +/******************************************************************** +** Solidified function: parse +********************************************************************/ +be_local_closure(Matter_Sigma3_parse, /* name */ + be_nested_proto( + 8, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[13]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(TLV), + /* K3 */ be_nested_str_weak(parse), + /* K4 */ be_nested_str_weak(Msg3), + /* K5 */ be_const_int(2147483647), + /* K6 */ be_nested_str_weak(tasmota), + /* K7 */ be_nested_str_weak(log), + /* K8 */ be_nested_str_weak(MTR_X3A_X20Sigma3_X20TLV_X3D), + /* K9 */ be_const_int(3), + /* K10 */ be_nested_str_weak(TBEData3Encrypted), + /* K11 */ be_nested_str_weak(getsubval), + /* K12 */ be_const_int(1), + }), + be_str_weak(parse), + &be_const_str_solidified, + ( &(const binstruction[26]) { /* code */ + 0x4C0C0000, // 0000 LDNIL R3 + 0x1C0C0403, // 0001 EQ R3 R2 R3 + 0x780E0000, // 0002 JMPF R3 #0004 + 0x58080000, // 0003 LDCONST R2 K0 + 0xB80E0200, // 0004 GETNGBL R3 K1 + 0x880C0702, // 0005 GETMBR R3 R3 K2 + 0x8C0C0703, // 0006 GETMET R3 R3 K3 + 0x5C140200, // 0007 MOVE R5 R1 + 0x5C180400, // 0008 MOVE R6 R2 + 0x7C0C0600, // 0009 CALL R3 3 + 0x40100505, // 000A CONNECT R4 R2 K5 + 0x94100204, // 000B GETIDX R4 R1 R4 + 0x90020804, // 000C SETMBR R0 K4 R4 + 0xB8120C00, // 000D GETNGBL R4 K6 + 0x8C100907, // 000E GETMET R4 R4 K7 + 0x60180008, // 000F GETGBL R6 G8 + 0x5C1C0600, // 0010 MOVE R7 R3 + 0x7C180200, // 0011 CALL R6 1 + 0x001A1006, // 0012 ADD R6 K8 R6 + 0x581C0009, // 0013 LDCONST R7 K9 + 0x7C100600, // 0014 CALL R4 3 + 0x8C10070B, // 0015 GETMET R4 R3 K11 + 0x5818000C, // 0016 LDCONST R6 K12 + 0x7C100400, // 0017 CALL R4 2 + 0x90021404, // 0018 SETMBR R0 K10 R4 + 0x80040000, // 0019 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_Sigma3 +********************************************************************/ +be_local_class(Matter_Sigma3, + 2, + NULL, + be_nested_map(3, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(TBEData3Encrypted, 2), be_const_var(0) }, + { be_const_key_weak(parse, -1), be_const_closure(Matter_Sigma3_parse_closure) }, + { be_const_key_weak(Msg3, -1), be_const_var(1) }, + })), + be_str_weak(Matter_Sigma3) +); +/*******************************************************************/ + +void be_load_Matter_Sigma3_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_Sigma3); + be_setglobal(vm, "Matter_Sigma3"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Device.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Device.h new file mode 100644 index 000000000..8040cef05 --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Device.h @@ -0,0 +1,2136 @@ +/* Solidification of Matter_Device.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_Device; + +/******************************************************************** +** Solidified function: msg_send +********************************************************************/ +be_local_closure(Matter_Device_msg_send, /* name */ + be_nested_proto( + 11, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(udp_server), + /* K1 */ be_nested_str_weak(send_response), + }), + be_str_weak(msg_send), + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0x88140100, // 0000 GETMBR R5 R0 K0 + 0x8C140B01, // 0001 GETMET R5 R5 K1 + 0x5C1C0200, // 0002 MOVE R7 R1 + 0x5C200400, // 0003 MOVE R8 R2 + 0x5C240600, // 0004 MOVE R9 R3 + 0x5C280800, // 0005 MOVE R10 R4 + 0x7C140A00, // 0006 CALL R5 5 + 0x80040A00, // 0007 RET 1 R5 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: start_operational_dicovery_deferred +********************************************************************/ +be_local_closure(Matter_Device_start_operational_dicovery_deferred, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + be_nested_proto( + 3, /* nstack */ + 0, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 2]) { /* upvals */ + be_local_const_upval(1, 0), + be_local_const_upval(1, 1), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(start_operational_dicovery), + }), + be_str_weak(_X3Clambda_X3E), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x68000000, // 0000 GETUPV R0 U0 + 0x8C000100, // 0001 GETMET R0 R0 K0 + 0x68080001, // 0002 GETUPV R2 U1 + 0x7C000400, // 0003 CALL R0 2 + 0x80040000, // 0004 RET 1 R0 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(tasmota), + /* K1 */ be_nested_str_weak(set_timer), + /* K2 */ be_const_int(0), + }), + be_str_weak(start_operational_dicovery_deferred), + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0xB80A0000, // 0000 GETNGBL R2 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x58100002, // 0002 LDCONST R4 K2 + 0x84140000, // 0003 CLOSURE R5 P0 + 0x7C080600, // 0004 CALL R2 3 + 0xA0000000, // 0005 CLOSE R0 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: start_commissioning_complete_deferred +********************************************************************/ +be_local_closure(Matter_Device_start_commissioning_complete_deferred, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + be_nested_proto( + 3, /* nstack */ + 0, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 2]) { /* upvals */ + be_local_const_upval(1, 0), + be_local_const_upval(1, 1), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(start_commissioning_complete), + }), + be_str_weak(_X3Clambda_X3E), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x68000000, // 0000 GETUPV R0 U0 + 0x8C000100, // 0001 GETMET R0 R0 K0 + 0x68080001, // 0002 GETUPV R2 U1 + 0x7C000400, // 0003 CALL R0 2 + 0x80040000, // 0004 RET 1 R0 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(tasmota), + /* K1 */ be_nested_str_weak(set_timer), + /* K2 */ be_const_int(0), + }), + be_str_weak(start_commissioning_complete_deferred), + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0xB80A0000, // 0000 GETNGBL R2 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x58100002, // 0002 LDCONST R4 K2 + 0x84140000, // 0003 CLOSURE R5 P0 + 0x7C080600, // 0004 CALL R2 3 + 0xA0000000, // 0005 CLOSE R0 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: packet_ack +********************************************************************/ +be_local_closure(Matter_Device_packet_ack, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(udp_server), + /* K1 */ be_nested_str_weak(packet_ack), + }), + be_str_weak(packet_ack), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x5C100200, // 0002 MOVE R4 R1 + 0x7C080400, // 0003 CALL R2 2 + 0x80040400, // 0004 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: stop +********************************************************************/ +be_local_closure(Matter_Device_stop, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(udp_server), + /* K1 */ be_nested_str_weak(stop), + }), + be_str_weak(stop), + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x78060002, // 0001 JMPF R1 #0005 + 0x88040100, // 0002 GETMBR R1 R0 K0 + 0x8C040301, // 0003 GETMET R1 R1 K1 + 0x7C040200, // 0004 CALL R1 1 + 0x80000000, // 0005 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: load_param +********************************************************************/ +be_local_closure(Matter_Device_load_param, /* name */ + be_nested_proto( + 10, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[22]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(crypto), + /* K2 */ be_nested_str_weak(FILENAME), + /* K3 */ be_nested_str_weak(read), + /* K4 */ be_nested_str_weak(close), + /* K5 */ be_nested_str_weak(json), + /* K6 */ be_nested_str_weak(load), + /* K7 */ be_nested_str_weak(discriminator), + /* K8 */ be_nested_str_weak(find), + /* K9 */ be_nested_str_weak(distinguish), + /* K10 */ be_nested_str_weak(passcode), + /* K11 */ be_nested_str_weak(io_error), + /* K12 */ be_nested_str_weak(tasmota), + /* K13 */ be_nested_str_weak(log), + /* K14 */ be_nested_str_weak(MTR_X3A_X20Session_Store_X3A_X3Aload_X20Exception_X3A), + /* K15 */ be_nested_str_weak(_X7C), + /* K16 */ be_const_int(2), + /* K17 */ be_nested_str_weak(random), + /* K18 */ be_nested_str_weak(get), + /* K19 */ be_const_int(0), + /* K20 */ be_nested_str_weak(PASSCODE_DEFAULT), + /* K21 */ be_nested_str_weak(save_param), + }), + be_str_weak(load_param), + &be_const_str_solidified, + ( &(const binstruction[70]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0xA8020014, // 0002 EXBLK 0 #0018 + 0x600C0011, // 0003 GETGBL R3 G17 + 0x88100102, // 0004 GETMBR R4 R0 K2 + 0x7C0C0200, // 0005 CALL R3 1 + 0x8C100703, // 0006 GETMET R4 R3 K3 + 0x7C100200, // 0007 CALL R4 1 + 0x8C140704, // 0008 GETMET R5 R3 K4 + 0x7C140200, // 0009 CALL R5 1 + 0xA4160A00, // 000A IMPORT R5 K5 + 0x8C180B06, // 000B GETMET R6 R5 K6 + 0x5C200800, // 000C MOVE R8 R4 + 0x7C180400, // 000D CALL R6 2 + 0x8C1C0D08, // 000E GETMET R7 R6 K8 + 0x58240009, // 000F LDCONST R9 K9 + 0x7C1C0400, // 0010 CALL R7 2 + 0x90020E07, // 0011 SETMBR R0 K7 R7 + 0x8C1C0D08, // 0012 GETMET R7 R6 K8 + 0x5824000A, // 0013 LDCONST R9 K10 + 0x7C1C0400, // 0014 CALL R7 2 + 0x90021407, // 0015 SETMBR R0 K10 R7 + 0xA8040001, // 0016 EXBLK 1 1 + 0x70020012, // 0017 JMP #002B + 0xAC0C0002, // 0018 CATCH R3 0 2 + 0x7002000F, // 0019 JMP #002A + 0x2014070B, // 001A NE R5 R3 K11 + 0x7816000C, // 001B JMPF R5 #0029 + 0xB8161800, // 001C GETNGBL R5 K12 + 0x8C140B0D, // 001D GETMET R5 R5 K13 + 0x601C0008, // 001E GETGBL R7 G8 + 0x5C200600, // 001F MOVE R8 R3 + 0x7C1C0200, // 0020 CALL R7 1 + 0x001E1C07, // 0021 ADD R7 K14 R7 + 0x001C0F0F, // 0022 ADD R7 R7 K15 + 0x60200008, // 0023 GETGBL R8 G8 + 0x5C240800, // 0024 MOVE R9 R4 + 0x7C200200, // 0025 CALL R8 1 + 0x001C0E08, // 0026 ADD R7 R7 R8 + 0x58200010, // 0027 LDCONST R8 K16 + 0x7C140600, // 0028 CALL R5 3 + 0x70020000, // 0029 JMP #002B + 0xB0080000, // 002A RAISE 2 R0 R0 + 0x500C0000, // 002B LDBOOL R3 0 0 + 0x88100107, // 002C GETMBR R4 R0 K7 + 0x4C140000, // 002D LDNIL R5 + 0x1C100805, // 002E EQ R4 R4 R5 + 0x7812000A, // 002F JMPF R4 #003B + 0x8C100511, // 0030 GETMET R4 R2 K17 + 0x58180010, // 0031 LDCONST R6 K16 + 0x7C100400, // 0032 CALL R4 2 + 0x8C100912, // 0033 GETMET R4 R4 K18 + 0x58180013, // 0034 LDCONST R6 K19 + 0x581C0010, // 0035 LDCONST R7 K16 + 0x7C100600, // 0036 CALL R4 3 + 0x54160FFE, // 0037 LDINT R5 4095 + 0x2C100805, // 0038 AND R4 R4 R5 + 0x90020E04, // 0039 SETMBR R0 K7 R4 + 0x500C0200, // 003A LDBOOL R3 1 0 + 0x8810010A, // 003B GETMBR R4 R0 K10 + 0x4C140000, // 003C LDNIL R5 + 0x1C100805, // 003D EQ R4 R4 R5 + 0x78120002, // 003E JMPF R4 #0042 + 0x88100114, // 003F GETMBR R4 R0 K20 + 0x90021404, // 0040 SETMBR R0 K10 R4 + 0x500C0200, // 0041 LDBOOL R3 1 0 + 0x780E0001, // 0042 JMPF R3 #0045 + 0x8C100115, // 0043 GETMET R4 R0 K21 + 0x7C100200, // 0044 CALL R4 1 + 0x80000000, // 0045 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: every_second +********************************************************************/ +be_local_closure(Matter_Device_every_second, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(sessions), + /* K1 */ be_nested_str_weak(every_second), + /* K2 */ be_nested_str_weak(msg_handler), + }), + be_str_weak(every_second), + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x88040102, // 0003 GETMBR R1 R0 K2 + 0x8C040301, // 0004 GETMET R1 R1 K1 + 0x7C040200, // 0005 CALL R1 1 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: save_param +********************************************************************/ +be_local_closure(Matter_Device_save_param, /* name */ + be_nested_proto( + 10, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[15]) { /* constants */ + /* K0 */ be_nested_str_weak(json), + /* K1 */ be_nested_str_weak(dump), + /* K2 */ be_nested_str_weak(distinguish), + /* K3 */ be_nested_str_weak(discriminator), + /* K4 */ be_nested_str_weak(passcode), + /* K5 */ be_nested_str_weak(string), + /* K6 */ be_nested_str_weak(FILENAME), + /* K7 */ be_nested_str_weak(w), + /* K8 */ be_nested_str_weak(write), + /* K9 */ be_nested_str_weak(close), + /* K10 */ be_nested_str_weak(tasmota), + /* K11 */ be_nested_str_weak(log), + /* K12 */ be_nested_str_weak(MTR_X3A_X20Session_Store_X3A_X3Asave_X20Exception_X3A), + /* K13 */ be_nested_str_weak(_X7C), + /* K14 */ be_const_int(2), + }), + be_str_weak(save_param), + &be_const_str_solidified, + ( &(const binstruction[43]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080301, // 0001 GETMET R2 R1 K1 + 0x60100013, // 0002 GETGBL R4 G19 + 0x7C100000, // 0003 CALL R4 0 + 0x88140103, // 0004 GETMBR R5 R0 K3 + 0x98120405, // 0005 SETIDX R4 K2 R5 + 0x88140104, // 0006 GETMBR R5 R0 K4 + 0x98120805, // 0007 SETIDX R4 K4 R5 + 0x7C080400, // 0008 CALL R2 2 + 0xA802000D, // 0009 EXBLK 0 #0018 + 0xA40E0A00, // 000A IMPORT R3 K5 + 0x60100011, // 000B GETGBL R4 G17 + 0x88140106, // 000C GETMBR R5 R0 K6 + 0x58180007, // 000D LDCONST R6 K7 + 0x7C100400, // 000E CALL R4 2 + 0x8C140908, // 000F GETMET R5 R4 K8 + 0x5C1C0400, // 0010 MOVE R7 R2 + 0x7C140400, // 0011 CALL R5 2 + 0x8C140909, // 0012 GETMET R5 R4 K9 + 0x7C140200, // 0013 CALL R5 1 + 0xA8040001, // 0014 EXBLK 1 1 + 0x80040400, // 0015 RET 1 R2 + 0xA8040001, // 0016 EXBLK 1 1 + 0x70020011, // 0017 JMP #002A + 0xAC0C0002, // 0018 CATCH R3 0 2 + 0x7002000E, // 0019 JMP #0029 + 0xB8161400, // 001A GETNGBL R5 K10 + 0x8C140B0B, // 001B GETMET R5 R5 K11 + 0x601C0008, // 001C GETGBL R7 G8 + 0x5C200600, // 001D MOVE R8 R3 + 0x7C1C0200, // 001E CALL R7 1 + 0x001E1807, // 001F ADD R7 K12 R7 + 0x001C0F0D, // 0020 ADD R7 R7 K13 + 0x60200008, // 0021 GETGBL R8 G8 + 0x5C240800, // 0022 MOVE R9 R4 + 0x7C200200, // 0023 CALL R8 1 + 0x001C0E08, // 0024 ADD R7 R7 R8 + 0x5820000E, // 0025 LDCONST R8 K14 + 0x7C140600, // 0026 CALL R5 3 + 0x80040400, // 0027 RET 1 R2 + 0x70020000, // 0028 JMP #002A + 0xB0080000, // 0029 RAISE 2 R0 R0 + 0x80000000, // 002A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: start_operational_dicovery +********************************************************************/ +be_local_closure(Matter_Device_start_operational_dicovery, /* name */ + be_nested_proto( + 8, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[13]) { /* constants */ + /* K0 */ be_nested_str_weak(crypto), + /* K1 */ be_nested_str_weak(mdns), + /* K2 */ be_nested_str_weak(string), + /* K3 */ be_nested_str_weak(salt), + /* K4 */ be_nested_str_weak(w0), + /* K5 */ be_nested_str_weak(w1), + /* K6 */ be_nested_str_weak(L), + /* K7 */ be_nested_str_weak(set_no_expiration), + /* K8 */ be_nested_str_weak(set_persist), + /* K9 */ be_nested_str_weak(close), + /* K10 */ be_nested_str_weak(sessions), + /* K11 */ be_nested_str_weak(save), + /* K12 */ be_nested_str_weak(mdns_announce_op_discovery), + }), + be_str_weak(start_operational_dicovery), + &be_const_str_solidified, + ( &(const binstruction[25]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0xA40E0200, // 0001 IMPORT R3 K1 + 0xA4120400, // 0002 IMPORT R4 K2 + 0x4C140000, // 0003 LDNIL R5 + 0x90020605, // 0004 SETMBR R0 K3 R5 + 0x4C140000, // 0005 LDNIL R5 + 0x90020805, // 0006 SETMBR R0 K4 R5 + 0x4C140000, // 0007 LDNIL R5 + 0x90020A05, // 0008 SETMBR R0 K5 R5 + 0x4C140000, // 0009 LDNIL R5 + 0x90020C05, // 000A SETMBR R0 K6 R5 + 0x8C140307, // 000B GETMET R5 R1 K7 + 0x7C140200, // 000C CALL R5 1 + 0x8C140308, // 000D GETMET R5 R1 K8 + 0x501C0200, // 000E LDBOOL R7 1 0 + 0x7C140400, // 000F CALL R5 2 + 0x8C140309, // 0010 GETMET R5 R1 K9 + 0x7C140200, // 0011 CALL R5 1 + 0x8814010A, // 0012 GETMBR R5 R0 K10 + 0x8C140B0B, // 0013 GETMET R5 R5 K11 + 0x7C140200, // 0014 CALL R5 1 + 0x8C14010C, // 0015 GETMET R5 R0 K12 + 0x5C1C0200, // 0016 MOVE R7 R1 + 0x7C140400, // 0017 CALL R5 2 + 0x80000000, // 0018 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: compute_manual_pairing_code +********************************************************************/ +be_local_closure(Matter_Device_compute_manual_pairing_code, /* name */ + be_nested_proto( + 11, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(discriminator), + /* K2 */ be_nested_str_weak(passcode), + /* K3 */ be_nested_str_weak(format), + /* K4 */ be_nested_str_weak(_X251i_X2505i_X2504i), + /* K5 */ be_nested_str_weak(matter), + /* K6 */ be_nested_str_weak(Verhoeff), + /* K7 */ be_nested_str_weak(checksum), + }), + be_str_weak(compute_manual_pairing_code), + &be_const_str_solidified, + ( &(const binstruction[31]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x88080101, // 0001 GETMBR R2 R0 K1 + 0x540E0FFE, // 0002 LDINT R3 4095 + 0x2C080403, // 0003 AND R2 R2 R3 + 0x540E0009, // 0004 LDINT R3 10 + 0x3C080403, // 0005 SHR R2 R2 R3 + 0x880C0101, // 0006 GETMBR R3 R0 K1 + 0x541202FF, // 0007 LDINT R4 768 + 0x2C0C0604, // 0008 AND R3 R3 R4 + 0x54120005, // 0009 LDINT R4 6 + 0x380C0604, // 000A SHL R3 R3 R4 + 0x88100102, // 000B GETMBR R4 R0 K2 + 0x54163FFE, // 000C LDINT R5 16383 + 0x2C100805, // 000D AND R4 R4 R5 + 0x300C0604, // 000E OR R3 R3 R4 + 0x88100102, // 000F GETMBR R4 R0 K2 + 0x5416000D, // 0010 LDINT R5 14 + 0x3C100805, // 0011 SHR R4 R4 R5 + 0x8C140303, // 0012 GETMET R5 R1 K3 + 0x581C0004, // 0013 LDCONST R7 K4 + 0x5C200400, // 0014 MOVE R8 R2 + 0x5C240600, // 0015 MOVE R9 R3 + 0x5C280800, // 0016 MOVE R10 R4 + 0x7C140A00, // 0017 CALL R5 5 + 0xB81A0A00, // 0018 GETNGBL R6 K5 + 0x88180D06, // 0019 GETMBR R6 R6 K6 + 0x8C180D07, // 001A GETMET R6 R6 K7 + 0x5C200A00, // 001B MOVE R8 R5 + 0x7C180400, // 001C CALL R6 2 + 0x00140A06, // 001D ADD R5 R5 R6 + 0x80040A00, // 001E RET 1 R5 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: start_udp +********************************************************************/ +be_local_closure(Matter_Device_start_udp, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + be_nested_proto( + 8, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 1]) { /* upvals */ + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(msg_received), + }), + be_str_weak(_X3Clambda_X3E), + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x680C0000, // 0000 GETUPV R3 U0 + 0x8C0C0700, // 0001 GETMET R3 R3 K0 + 0x5C140000, // 0002 MOVE R5 R0 + 0x5C180200, // 0003 MOVE R6 R1 + 0x5C1C0400, // 0004 MOVE R7 R2 + 0x7C0C0800, // 0005 CALL R3 4 + 0x80040600, // 0006 RET 1 R3 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(udp_server), + /* K1 */ be_nested_str_weak(tasmota), + /* K2 */ be_nested_str_weak(log), + /* K3 */ be_nested_str_weak(MTR_X3A_X20starting_X20UDP_X20server_X20on_X20port_X3A_X20), + /* K4 */ be_const_int(2), + /* K5 */ be_nested_str_weak(matter), + /* K6 */ be_nested_str_weak(UDPServer), + /* K7 */ be_nested_str_weak(), + /* K8 */ be_nested_str_weak(start), + }), + be_str_weak(start_udp), + &be_const_str_solidified, + ( &(const binstruction[27]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x780A0000, // 0001 JMPF R2 #0003 + 0x80000400, // 0002 RET 0 + 0x4C080000, // 0003 LDNIL R2 + 0x1C080202, // 0004 EQ R2 R1 R2 + 0x780A0000, // 0005 JMPF R2 #0007 + 0x540615A3, // 0006 LDINT R1 5540 + 0xB80A0200, // 0007 GETNGBL R2 K1 + 0x8C080502, // 0008 GETMET R2 R2 K2 + 0x60100008, // 0009 GETGBL R4 G8 + 0x5C140200, // 000A MOVE R5 R1 + 0x7C100200, // 000B CALL R4 1 + 0x00120604, // 000C ADD R4 K3 R4 + 0x58140004, // 000D LDCONST R5 K4 + 0x7C080600, // 000E CALL R2 3 + 0xB80A0A00, // 000F GETNGBL R2 K5 + 0x8C080506, // 0010 GETMET R2 R2 K6 + 0x58100007, // 0011 LDCONST R4 K7 + 0x5C140200, // 0012 MOVE R5 R1 + 0x7C080600, // 0013 CALL R2 3 + 0x90020002, // 0014 SETMBR R0 K0 R2 + 0x88080100, // 0015 GETMBR R2 R0 K0 + 0x8C080508, // 0016 GETMET R2 R2 K8 + 0x84100000, // 0017 CLOSURE R4 P0 + 0x7C080400, // 0018 CALL R2 2 + 0xA0000000, // 0019 CLOSE R0 + 0x80000000, // 001A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: finish_commissioning +********************************************************************/ +be_local_closure(Matter_Device_finish_commissioning, /* name */ + be_nested_proto( + 1, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(finish_commissioning), + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: start_mdns_announce_hostnames +********************************************************************/ +be_local_closure(Matter_Device_start_mdns_announce_hostnames, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 2]) { + be_nested_proto( + 4, /* nstack */ + 0, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 1]) { /* upvals */ + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(_start_mdns_announce), + /* K1 */ be_nested_str_weak(tasmota), + /* K2 */ be_nested_str_weak(remove_rule), + /* K3 */ be_nested_str_weak(Wifi_X23Connected), + /* K4 */ be_nested_str_weak(matter_device_mdns), + }), + be_str_weak(_anonymous_), + &be_const_str_solidified, + ( &(const binstruction[10]) { /* code */ + 0x68000000, // 0000 GETUPV R0 U0 + 0x8C000100, // 0001 GETMET R0 R0 K0 + 0x50080000, // 0002 LDBOOL R2 0 0 + 0x7C000400, // 0003 CALL R0 2 + 0xB8020200, // 0004 GETNGBL R0 K1 + 0x8C000102, // 0005 GETMET R0 R0 K2 + 0x58080003, // 0006 LDCONST R2 K3 + 0x580C0004, // 0007 LDCONST R3 K4 + 0x7C000600, // 0008 CALL R0 3 + 0x80000000, // 0009 RET 0 + }) + ), + be_nested_proto( + 4, /* nstack */ + 0, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 1]) { /* upvals */ + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(_start_mdns_announce), + /* K1 */ be_nested_str_weak(tasmota), + /* K2 */ be_nested_str_weak(remove_rule), + /* K3 */ be_nested_str_weak(Eth_X23Connected), + /* K4 */ be_nested_str_weak(matter_device_mdns), + }), + be_str_weak(_anonymous_), + &be_const_str_solidified, + ( &(const binstruction[10]) { /* code */ + 0x68000000, // 0000 GETUPV R0 U0 + 0x8C000100, // 0001 GETMET R0 R0 K0 + 0x50080200, // 0002 LDBOOL R2 1 0 + 0x7C000400, // 0003 CALL R0 2 + 0xB8020200, // 0004 GETNGBL R0 K1 + 0x8C000102, // 0005 GETMET R0 R0 K2 + 0x58080003, // 0006 LDCONST R2 K3 + 0x580C0004, // 0007 LDCONST R3 K4 + 0x7C000600, // 0008 CALL R0 3 + 0x80000000, // 0009 RET 0 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(tasmota), + /* K1 */ be_nested_str_weak(wifi), + /* K2 */ be_nested_str_weak(up), + /* K3 */ be_nested_str_weak(_start_mdns_announce), + /* K4 */ be_nested_str_weak(add_rule), + /* K5 */ be_nested_str_weak(Wifi_X23Connected), + /* K6 */ be_nested_str_weak(eth), + /* K7 */ be_nested_str_weak(Eth_X23Connected), + }), + be_str_weak(start_mdns_announce_hostnames), + &be_const_str_solidified, + ( &(const binstruction[32]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x94040302, // 0003 GETIDX R1 R1 K2 + 0x78060003, // 0004 JMPF R1 #0009 + 0x8C040103, // 0005 GETMET R1 R0 K3 + 0x500C0000, // 0006 LDBOOL R3 0 0 + 0x7C040400, // 0007 CALL R1 2 + 0x70020005, // 0008 JMP #000F + 0xB8060000, // 0009 GETNGBL R1 K0 + 0x8C040304, // 000A GETMET R1 R1 K4 + 0x580C0005, // 000B LDCONST R3 K5 + 0x84100000, // 000C CLOSURE R4 P0 + 0x5C140000, // 000D MOVE R5 R0 + 0x7C040800, // 000E CALL R1 4 + 0xB8060000, // 000F GETNGBL R1 K0 + 0x8C040306, // 0010 GETMET R1 R1 K6 + 0x7C040200, // 0011 CALL R1 1 + 0x94040302, // 0012 GETIDX R1 R1 K2 + 0x78060003, // 0013 JMPF R1 #0018 + 0x8C040103, // 0014 GETMET R1 R0 K3 + 0x500C0200, // 0015 LDBOOL R3 1 0 + 0x7C040400, // 0016 CALL R1 2 + 0x70020005, // 0017 JMP #001E + 0xB8060000, // 0018 GETNGBL R1 K0 + 0x8C040304, // 0019 GETMET R1 R1 K4 + 0x580C0007, // 001A LDCONST R3 K7 + 0x84100001, // 001B CLOSURE R4 P1 + 0x5C140000, // 001C MOVE R5 R0 + 0x7C040800, // 001D CALL R1 4 + 0xA0000000, // 001E CLOSE R0 + 0x80000000, // 001F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: mdns_announce_op_discovery +********************************************************************/ +be_local_closure(Matter_Device_mdns_announce_op_discovery, /* name */ + be_nested_proto( + 15, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[29]) { /* constants */ + /* K0 */ be_nested_str_weak(mdns), + /* K1 */ be_nested_str_weak(string), + /* K2 */ be_nested_str_weak(get_deviceid), + /* K3 */ be_nested_str_weak(copy), + /* K4 */ be_nested_str_weak(reverse), + /* K5 */ be_nested_str_weak(get_fabric_compressed), + /* K6 */ be_nested_str_weak(tohex), + /* K7 */ be_nested_str_weak(_X2D), + /* K8 */ be_nested_str_weak(tasmota), + /* K9 */ be_nested_str_weak(log), + /* K10 */ be_nested_str_weak(MTR_X3A_X20Operational_X20Discovery_X20node_X20_X3D_X20), + /* K11 */ be_const_int(2), + /* K12 */ be_nested_str_weak(eth), + /* K13 */ be_nested_str_weak(find), + /* K14 */ be_nested_str_weak(up), + /* K15 */ be_nested_str_weak(format), + /* K16 */ be_nested_str_weak(MTR_X3A_X20adding_X20mDNS_X20on_X20_X25s_X20_X27_X25s_X27_X20ptr_X20to_X20_X60_X25s_X2Elocal_X60), + /* K17 */ be_nested_str_weak(hostname_eth), + /* K18 */ be_const_int(3), + /* K19 */ be_nested_str_weak(add_service), + /* K20 */ be_nested_str_weak(_matter), + /* K21 */ be_nested_str_weak(_tcp), + /* K22 */ be_nested_str_weak(_I), + /* K23 */ be_nested_str_weak(MTR_X3A_X20adding_X20subtype_X3A_X20), + /* K24 */ be_nested_str_weak(add_subtype), + /* K25 */ be_nested_str_weak(wifi), + /* K26 */ be_nested_str_weak(hostname_wifi), + /* K27 */ be_nested_str_weak(MTR_X3A_X20Exception), + /* K28 */ be_nested_str_weak(_X7C), + }), + be_str_weak(mdns_announce_op_discovery), + &be_const_str_solidified, + ( &(const binstruction[122]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0xA40E0200, // 0001 IMPORT R3 K1 + 0xA8020064, // 0002 EXBLK 0 #0068 + 0x8C100302, // 0003 GETMET R4 R1 K2 + 0x7C100200, // 0004 CALL R4 1 + 0x8C100903, // 0005 GETMET R4 R4 K3 + 0x7C100200, // 0006 CALL R4 1 + 0x8C100904, // 0007 GETMET R4 R4 K4 + 0x7C100200, // 0008 CALL R4 1 + 0x8C140305, // 0009 GETMET R5 R1 K5 + 0x7C140200, // 000A CALL R5 1 + 0x8C180B06, // 000B GETMET R6 R5 K6 + 0x7C180200, // 000C CALL R6 1 + 0x00180D07, // 000D ADD R6 R6 K7 + 0x8C1C0906, // 000E GETMET R7 R4 K6 + 0x7C1C0200, // 000F CALL R7 1 + 0x00180C07, // 0010 ADD R6 R6 R7 + 0xB81E1000, // 0011 GETNGBL R7 K8 + 0x8C1C0F09, // 0012 GETMET R7 R7 K9 + 0x00261406, // 0013 ADD R9 K10 R6 + 0x5828000B, // 0014 LDCONST R10 K11 + 0x7C1C0600, // 0015 CALL R7 3 + 0xB81E1000, // 0016 GETNGBL R7 K8 + 0x8C1C0F0C, // 0017 GETMET R7 R7 K12 + 0x7C1C0200, // 0018 CALL R7 1 + 0x8C1C0F0D, // 0019 GETMET R7 R7 K13 + 0x5824000E, // 001A LDCONST R9 K14 + 0x7C1C0400, // 001B CALL R7 2 + 0x781E0020, // 001C JMPF R7 #003E + 0xB81E1000, // 001D GETNGBL R7 K8 + 0x8C1C0F09, // 001E GETMET R7 R7 K9 + 0x8C24070F, // 001F GETMET R9 R3 K15 + 0x582C0010, // 0020 LDCONST R11 K16 + 0x5830000C, // 0021 LDCONST R12 K12 + 0x5C340C00, // 0022 MOVE R13 R6 + 0x88380111, // 0023 GETMBR R14 R0 K17 + 0x7C240A00, // 0024 CALL R9 5 + 0x58280012, // 0025 LDCONST R10 K18 + 0x7C1C0600, // 0026 CALL R7 3 + 0x8C1C0513, // 0027 GETMET R7 R2 K19 + 0x58240014, // 0028 LDCONST R9 K20 + 0x58280015, // 0029 LDCONST R10 K21 + 0x542E15A3, // 002A LDINT R11 5540 + 0x4C300000, // 002B LDNIL R12 + 0x5C340C00, // 002C MOVE R13 R6 + 0x88380111, // 002D GETMBR R14 R0 K17 + 0x7C1C0E00, // 002E CALL R7 7 + 0x8C1C0B06, // 002F GETMET R7 R5 K6 + 0x7C1C0200, // 0030 CALL R7 1 + 0x001E2C07, // 0031 ADD R7 K22 R7 + 0xB8221000, // 0032 GETNGBL R8 K8 + 0x8C201109, // 0033 GETMET R8 R8 K9 + 0x002A2E07, // 0034 ADD R10 K23 R7 + 0x582C0012, // 0035 LDCONST R11 K18 + 0x7C200600, // 0036 CALL R8 3 + 0x8C200518, // 0037 GETMET R8 R2 K24 + 0x58280014, // 0038 LDCONST R10 K20 + 0x582C0015, // 0039 LDCONST R11 K21 + 0x5C300C00, // 003A MOVE R12 R6 + 0x88340111, // 003B GETMBR R13 R0 K17 + 0x5C380E00, // 003C MOVE R14 R7 + 0x7C200C00, // 003D CALL R8 6 + 0xB81E1000, // 003E GETNGBL R7 K8 + 0x8C1C0F19, // 003F GETMET R7 R7 K25 + 0x7C1C0200, // 0040 CALL R7 1 + 0x8C1C0F0D, // 0041 GETMET R7 R7 K13 + 0x5824000E, // 0042 LDCONST R9 K14 + 0x7C1C0400, // 0043 CALL R7 2 + 0x781E0020, // 0044 JMPF R7 #0066 + 0xB81E1000, // 0045 GETNGBL R7 K8 + 0x8C1C0F09, // 0046 GETMET R7 R7 K9 + 0x8C24070F, // 0047 GETMET R9 R3 K15 + 0x582C0010, // 0048 LDCONST R11 K16 + 0x58300019, // 0049 LDCONST R12 K25 + 0x5C340C00, // 004A MOVE R13 R6 + 0x8838011A, // 004B GETMBR R14 R0 K26 + 0x7C240A00, // 004C CALL R9 5 + 0x58280012, // 004D LDCONST R10 K18 + 0x7C1C0600, // 004E CALL R7 3 + 0x8C1C0513, // 004F GETMET R7 R2 K19 + 0x58240014, // 0050 LDCONST R9 K20 + 0x58280015, // 0051 LDCONST R10 K21 + 0x542E15A3, // 0052 LDINT R11 5540 + 0x4C300000, // 0053 LDNIL R12 + 0x5C340C00, // 0054 MOVE R13 R6 + 0x8838011A, // 0055 GETMBR R14 R0 K26 + 0x7C1C0E00, // 0056 CALL R7 7 + 0x8C1C0B06, // 0057 GETMET R7 R5 K6 + 0x7C1C0200, // 0058 CALL R7 1 + 0x001E2C07, // 0059 ADD R7 K22 R7 + 0xB8221000, // 005A GETNGBL R8 K8 + 0x8C201109, // 005B GETMET R8 R8 K9 + 0x002A2E07, // 005C ADD R10 K23 R7 + 0x582C0012, // 005D LDCONST R11 K18 + 0x7C200600, // 005E CALL R8 3 + 0x8C200518, // 005F GETMET R8 R2 K24 + 0x58280014, // 0060 LDCONST R10 K20 + 0x582C0015, // 0061 LDCONST R11 K21 + 0x5C300C00, // 0062 MOVE R12 R6 + 0x8834011A, // 0063 GETMBR R13 R0 K26 + 0x5C380E00, // 0064 MOVE R14 R7 + 0x7C200C00, // 0065 CALL R8 6 + 0xA8040001, // 0066 EXBLK 1 1 + 0x70020010, // 0067 JMP #0079 + 0xAC100002, // 0068 CATCH R4 0 2 + 0x7002000D, // 0069 JMP #0078 + 0xB81A1000, // 006A GETNGBL R6 K8 + 0x8C180D09, // 006B GETMET R6 R6 K9 + 0x60200008, // 006C GETGBL R8 G8 + 0x5C240800, // 006D MOVE R9 R4 + 0x7C200200, // 006E CALL R8 1 + 0x00223608, // 006F ADD R8 K27 R8 + 0x0020111C, // 0070 ADD R8 R8 K28 + 0x60240008, // 0071 GETGBL R9 G8 + 0x5C280A00, // 0072 MOVE R10 R5 + 0x7C240200, // 0073 CALL R9 1 + 0x00201009, // 0074 ADD R8 R8 R9 + 0x5824000B, // 0075 LDCONST R9 K11 + 0x7C180600, // 0076 CALL R6 3 + 0x70020000, // 0077 JMP #0079 + 0xB0080000, // 0078 RAISE 2 R0 R0 + 0x80000000, // 0079 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: start_commissioning_complete +********************************************************************/ +be_local_closure(Matter_Device_start_commissioning_complete, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(tasmota), + /* K1 */ be_nested_str_weak(log), + /* K2 */ be_nested_str_weak(MTR_X3A_X20_X2A_X2A_X2A_X20Commissioning_X20complete_X20_X2A_X2A_X2A), + /* K3 */ be_const_int(2), + }), + be_str_weak(start_commissioning_complete), + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0xB80A0000, // 0000 GETNGBL R2 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x58100002, // 0002 LDCONST R4 K2 + 0x58140003, // 0003 LDCONST R5 K3 + 0x7C080600, // 0004 CALL R2 3 + 0x80000000, // 0005 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: start_basic_commissioning +********************************************************************/ +be_local_closure(Matter_Device_start_basic_commissioning, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(compute_pbkdf), + /* K1 */ be_nested_str_weak(passcode), + }), + be_str_weak(start_basic_commissioning), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x880C0101, // 0001 GETMBR R3 R0 K1 + 0x7C040400, // 0002 CALL R1 2 + 0x80000000, // 0003 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: compute_pbkdf +********************************************************************/ +be_local_closure(Matter_Device_compute_pbkdf, /* name */ + be_nested_proto( + 11, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[24]) { /* constants */ + /* K0 */ be_nested_str_weak(crypto), + /* K1 */ be_nested_str_weak(salt), + /* K2 */ be_nested_str_weak(random), + /* K3 */ be_nested_str_weak(add), + /* K4 */ be_nested_str_weak(PBKDF2_HMAC_SHA256), + /* K5 */ be_nested_str_weak(derive), + /* K6 */ be_nested_str_weak(iterations), + /* K7 */ be_const_int(0), + /* K8 */ be_nested_str_weak(w0), + /* K9 */ be_nested_str_weak(EC_P256), + /* K10 */ be_nested_str_weak(mod), + /* K11 */ be_nested_str_weak(w1), + /* K12 */ be_nested_str_weak(L), + /* K13 */ be_nested_str_weak(public_key), + /* K14 */ be_nested_str_weak(tasmota), + /* K15 */ be_nested_str_weak(log), + /* K16 */ be_nested_str_weak(MTR_X3A_X20_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A), + /* K17 */ be_const_int(3), + /* K18 */ be_nested_str_weak(MTR_X3A_X20salt_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K19 */ be_nested_str_weak(tohex), + /* K20 */ be_nested_str_weak(MTR_X3A_X20passcode_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K21 */ be_nested_str_weak(MTR_X3A_X20w0_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K22 */ be_nested_str_weak(MTR_X3A_X20w1_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D_X20), + /* K23 */ be_nested_str_weak(MTR_X3A_X20L_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D_X20), + }), + be_str_weak(compute_pbkdf), + &be_const_str_solidified, + ( &(const binstruction[94]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x8C0C0502, // 0001 GETMET R3 R2 K2 + 0x5416000F, // 0002 LDINT R5 16 + 0x7C0C0400, // 0003 CALL R3 2 + 0x90020203, // 0004 SETMBR R0 K1 R3 + 0x600C0015, // 0005 GETGBL R3 G21 + 0x7C0C0000, // 0006 CALL R3 0 + 0x8C0C0703, // 0007 GETMET R3 R3 K3 + 0x5C140200, // 0008 MOVE R5 R1 + 0x541A0003, // 0009 LDINT R6 4 + 0x7C0C0600, // 000A CALL R3 3 + 0x8C100504, // 000B GETMET R4 R2 K4 + 0x7C100200, // 000C CALL R4 1 + 0x8C100905, // 000D GETMET R4 R4 K5 + 0x5C180600, // 000E MOVE R6 R3 + 0x881C0101, // 000F GETMBR R7 R0 K1 + 0x88200106, // 0010 GETMBR R8 R0 K6 + 0x5426004F, // 0011 LDINT R9 80 + 0x7C100A00, // 0012 CALL R4 5 + 0x54160026, // 0013 LDINT R5 39 + 0x40160E05, // 0014 CONNECT R5 K7 R5 + 0x94140805, // 0015 GETIDX R5 R4 R5 + 0x541A0027, // 0016 LDINT R6 40 + 0x541E004E, // 0017 LDINT R7 79 + 0x40180C07, // 0018 CONNECT R6 R6 R7 + 0x94180806, // 0019 GETIDX R6 R4 R6 + 0x8C1C0509, // 001A GETMET R7 R2 K9 + 0x7C1C0200, // 001B CALL R7 1 + 0x8C1C0F0A, // 001C GETMET R7 R7 K10 + 0x5C240A00, // 001D MOVE R9 R5 + 0x7C1C0400, // 001E CALL R7 2 + 0x90021007, // 001F SETMBR R0 K8 R7 + 0x8C1C0509, // 0020 GETMET R7 R2 K9 + 0x7C1C0200, // 0021 CALL R7 1 + 0x8C1C0F0A, // 0022 GETMET R7 R7 K10 + 0x5C240C00, // 0023 MOVE R9 R6 + 0x7C1C0400, // 0024 CALL R7 2 + 0x90021607, // 0025 SETMBR R0 K11 R7 + 0x8C1C0509, // 0026 GETMET R7 R2 K9 + 0x7C1C0200, // 0027 CALL R7 1 + 0x8C1C0F0D, // 0028 GETMET R7 R7 K13 + 0x8824010B, // 0029 GETMBR R9 R0 K11 + 0x7C1C0400, // 002A CALL R7 2 + 0x90021807, // 002B SETMBR R0 K12 R7 + 0xB81E1C00, // 002C GETNGBL R7 K14 + 0x8C1C0F0F, // 002D GETMET R7 R7 K15 + 0x58240010, // 002E LDCONST R9 K16 + 0x58280011, // 002F LDCONST R10 K17 + 0x7C1C0600, // 0030 CALL R7 3 + 0xB81E1C00, // 0031 GETNGBL R7 K14 + 0x8C1C0F0F, // 0032 GETMET R7 R7 K15 + 0x88240101, // 0033 GETMBR R9 R0 K1 + 0x8C241313, // 0034 GETMET R9 R9 K19 + 0x7C240200, // 0035 CALL R9 1 + 0x00262409, // 0036 ADD R9 K18 R9 + 0x58280011, // 0037 LDCONST R10 K17 + 0x7C1C0600, // 0038 CALL R7 3 + 0xB81E1C00, // 0039 GETNGBL R7 K14 + 0x8C1C0F0F, // 003A GETMET R7 R7 K15 + 0x8C240713, // 003B GETMET R9 R3 K19 + 0x7C240200, // 003C CALL R9 1 + 0x00262809, // 003D ADD R9 K20 R9 + 0x58280011, // 003E LDCONST R10 K17 + 0x7C1C0600, // 003F CALL R7 3 + 0xB81E1C00, // 0040 GETNGBL R7 K14 + 0x8C1C0F0F, // 0041 GETMET R7 R7 K15 + 0x88240108, // 0042 GETMBR R9 R0 K8 + 0x8C241313, // 0043 GETMET R9 R9 K19 + 0x7C240200, // 0044 CALL R9 1 + 0x00262A09, // 0045 ADD R9 K21 R9 + 0x58280011, // 0046 LDCONST R10 K17 + 0x7C1C0600, // 0047 CALL R7 3 + 0xB81E1C00, // 0048 GETNGBL R7 K14 + 0x8C1C0F0F, // 0049 GETMET R7 R7 K15 + 0x8824010B, // 004A GETMBR R9 R0 K11 + 0x8C241313, // 004B GETMET R9 R9 K19 + 0x7C240200, // 004C CALL R9 1 + 0x00262C09, // 004D ADD R9 K22 R9 + 0x58280011, // 004E LDCONST R10 K17 + 0x7C1C0600, // 004F CALL R7 3 + 0xB81E1C00, // 0050 GETNGBL R7 K14 + 0x8C1C0F0F, // 0051 GETMET R7 R7 K15 + 0x8824010C, // 0052 GETMBR R9 R0 K12 + 0x8C241313, // 0053 GETMET R9 R9 K19 + 0x7C240200, // 0054 CALL R9 1 + 0x00262E09, // 0055 ADD R9 K23 R9 + 0x58280011, // 0056 LDCONST R10 K17 + 0x7C1C0600, // 0057 CALL R7 3 + 0xB81E1C00, // 0058 GETNGBL R7 K14 + 0x8C1C0F0F, // 0059 GETMET R7 R7 K15 + 0x58240010, // 005A LDCONST R9 K16 + 0x58280011, // 005B LDCONST R10 K17 + 0x7C1C0600, // 005C CALL R7 3 + 0x80000000, // 005D RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_Device_init, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 2]) { + be_nested_proto( + 4, /* nstack */ + 0, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 1]) { /* upvals */ + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str_weak(start_udp), + /* K1 */ be_nested_str_weak(UDP_PORT), + /* K2 */ be_nested_str_weak(tasmota), + /* K3 */ be_nested_str_weak(remove_rule), + /* K4 */ be_nested_str_weak(Wifi_X23Connected), + /* K5 */ be_nested_str_weak(matter_device_udp), + }), + be_str_weak(_anonymous_), + &be_const_str_solidified, + ( &(const binstruction[11]) { /* code */ + 0x68000000, // 0000 GETUPV R0 U0 + 0x8C000100, // 0001 GETMET R0 R0 K0 + 0x68080000, // 0002 GETUPV R2 U0 + 0x88080501, // 0003 GETMBR R2 R2 K1 + 0x7C000400, // 0004 CALL R0 2 + 0xB8020400, // 0005 GETNGBL R0 K2 + 0x8C000103, // 0006 GETMET R0 R0 K3 + 0x58080004, // 0007 LDCONST R2 K4 + 0x580C0005, // 0008 LDCONST R3 K5 + 0x7C000600, // 0009 CALL R0 3 + 0x80000000, // 000A RET 0 + }) + ), + be_nested_proto( + 4, /* nstack */ + 0, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 1]) { /* upvals */ + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str_weak(start_udp), + /* K1 */ be_nested_str_weak(UDP_PORT), + /* K2 */ be_nested_str_weak(tasmota), + /* K3 */ be_nested_str_weak(remove_rule), + /* K4 */ be_nested_str_weak(Eth_X23Connected), + /* K5 */ be_nested_str_weak(matter_device_udp), + }), + be_str_weak(_anonymous_), + &be_const_str_solidified, + ( &(const binstruction[11]) { /* code */ + 0x68000000, // 0000 GETUPV R0 U0 + 0x8C000100, // 0001 GETMET R0 R0 K0 + 0x68080000, // 0002 GETUPV R2 U0 + 0x88080501, // 0003 GETMBR R2 R2 K1 + 0x7C000400, // 0004 CALL R0 2 + 0xB8020400, // 0005 GETNGBL R0 K2 + 0x8C000103, // 0006 GETMET R0 R0 K3 + 0x58080004, // 0007 LDCONST R2 K4 + 0x580C0005, // 0008 LDCONST R3 K5 + 0x7C000600, // 0009 CALL R0 3 + 0x80000000, // 000A RET 0 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[38]) { /* constants */ + /* K0 */ be_nested_str_weak(crypto), + /* K1 */ be_nested_str_weak(string), + /* K2 */ be_nested_str_weak(tasmota), + /* K3 */ be_nested_str_weak(get_option), + /* K4 */ be_nested_str_weak(matter), + /* K5 */ be_nested_str_weak(MATTER_OPTION), + /* K6 */ be_nested_str_weak(UI), + /* K7 */ be_nested_str_weak(plugins), + /* K8 */ be_nested_str_weak(vendorid), + /* K9 */ be_nested_str_weak(VENDOR_ID), + /* K10 */ be_nested_str_weak(productid), + /* K11 */ be_nested_str_weak(PRODUCT_ID), + /* K12 */ be_nested_str_weak(iterations), + /* K13 */ be_nested_str_weak(PBKDF_ITERATIONS), + /* K14 */ be_nested_str_weak(load_param), + /* K15 */ be_nested_str_weak(commissioning_instance_wifi), + /* K16 */ be_nested_str_weak(random), + /* K17 */ be_nested_str_weak(tohex), + /* K18 */ be_nested_str_weak(commissioning_instance_eth), + /* K19 */ be_nested_str_weak(sessions), + /* K20 */ be_nested_str_weak(Session_Store), + /* K21 */ be_nested_str_weak(load), + /* K22 */ be_nested_str_weak(msg_handler), + /* K23 */ be_nested_str_weak(MessageHandler), + /* K24 */ be_nested_str_weak(ui), + /* K25 */ be_nested_str_weak(push), + /* K26 */ be_nested_str_weak(Plugin_core), + /* K27 */ be_nested_str_weak(start_mdns_announce_hostnames), + /* K28 */ be_nested_str_weak(wifi), + /* K29 */ be_nested_str_weak(up), + /* K30 */ be_nested_str_weak(start_udp), + /* K31 */ be_nested_str_weak(UDP_PORT), + /* K32 */ be_nested_str_weak(add_rule), + /* K33 */ be_nested_str_weak(Wifi_X23Connected), + /* K34 */ be_nested_str_weak(eth), + /* K35 */ be_nested_str_weak(Eth_X23Connected), + /* K36 */ be_nested_str_weak(start_basic_commissioning), + /* K37 */ be_nested_str_weak(add_driver), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[100]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0xB80E0400, // 0002 GETNGBL R3 K2 + 0x8C0C0703, // 0003 GETMET R3 R3 K3 + 0xB8160800, // 0004 GETNGBL R5 K4 + 0x88140B05, // 0005 GETMBR R5 R5 K5 + 0x7C0C0400, // 0006 CALL R3 2 + 0x740E0004, // 0007 JMPT R3 #000D + 0xB80E0800, // 0008 GETNGBL R3 K4 + 0x8C0C0706, // 0009 GETMET R3 R3 K6 + 0x5C140000, // 000A MOVE R5 R0 + 0x7C0C0400, // 000B CALL R3 2 + 0x80000600, // 000C RET 0 + 0x600C0012, // 000D GETGBL R3 G18 + 0x7C0C0000, // 000E CALL R3 0 + 0x90020E03, // 000F SETMBR R0 K7 R3 + 0x880C0109, // 0010 GETMBR R3 R0 K9 + 0x90021003, // 0011 SETMBR R0 K8 R3 + 0x880C010B, // 0012 GETMBR R3 R0 K11 + 0x90021403, // 0013 SETMBR R0 K10 R3 + 0x880C010D, // 0014 GETMBR R3 R0 K13 + 0x90021803, // 0015 SETMBR R0 K12 R3 + 0x8C0C010E, // 0016 GETMET R3 R0 K14 + 0x7C0C0200, // 0017 CALL R3 1 + 0x8C0C0310, // 0018 GETMET R3 R1 K16 + 0x54160007, // 0019 LDINT R5 8 + 0x7C0C0400, // 001A CALL R3 2 + 0x8C0C0711, // 001B GETMET R3 R3 K17 + 0x7C0C0200, // 001C CALL R3 1 + 0x90021E03, // 001D SETMBR R0 K15 R3 + 0x8C0C0310, // 001E GETMET R3 R1 K16 + 0x54160007, // 001F LDINT R5 8 + 0x7C0C0400, // 0020 CALL R3 2 + 0x8C0C0711, // 0021 GETMET R3 R3 K17 + 0x7C0C0200, // 0022 CALL R3 1 + 0x90022403, // 0023 SETMBR R0 K18 R3 + 0xB80E0800, // 0024 GETNGBL R3 K4 + 0x8C0C0714, // 0025 GETMET R3 R3 K20 + 0x7C0C0200, // 0026 CALL R3 1 + 0x90022603, // 0027 SETMBR R0 K19 R3 + 0x880C0113, // 0028 GETMBR R3 R0 K19 + 0x8C0C0715, // 0029 GETMET R3 R3 K21 + 0x7C0C0200, // 002A CALL R3 1 + 0xB80E0800, // 002B GETNGBL R3 K4 + 0x8C0C0717, // 002C GETMET R3 R3 K23 + 0x5C140000, // 002D MOVE R5 R0 + 0x7C0C0400, // 002E CALL R3 2 + 0x90022C03, // 002F SETMBR R0 K22 R3 + 0xB80E0800, // 0030 GETNGBL R3 K4 + 0x8C0C0706, // 0031 GETMET R3 R3 K6 + 0x5C140000, // 0032 MOVE R5 R0 + 0x7C0C0400, // 0033 CALL R3 2 + 0x90023003, // 0034 SETMBR R0 K24 R3 + 0x880C0107, // 0035 GETMBR R3 R0 K7 + 0x8C0C0719, // 0036 GETMET R3 R3 K25 + 0xB8160800, // 0037 GETNGBL R5 K4 + 0x8C140B1A, // 0038 GETMET R5 R5 K26 + 0x5C1C0000, // 0039 MOVE R7 R0 + 0x7C140400, // 003A CALL R5 2 + 0x7C0C0400, // 003B CALL R3 2 + 0x8C0C011B, // 003C GETMET R3 R0 K27 + 0x7C0C0200, // 003D CALL R3 1 + 0xB80E0400, // 003E GETNGBL R3 K2 + 0x8C0C071C, // 003F GETMET R3 R3 K28 + 0x7C0C0200, // 0040 CALL R3 1 + 0x940C071D, // 0041 GETIDX R3 R3 K29 + 0x780E0003, // 0042 JMPF R3 #0047 + 0x8C0C011E, // 0043 GETMET R3 R0 K30 + 0x8814011F, // 0044 GETMBR R5 R0 K31 + 0x7C0C0400, // 0045 CALL R3 2 + 0x70020005, // 0046 JMP #004D + 0xB80E0400, // 0047 GETNGBL R3 K2 + 0x8C0C0720, // 0048 GETMET R3 R3 K32 + 0x58140021, // 0049 LDCONST R5 K33 + 0x84180000, // 004A CLOSURE R6 P0 + 0x5C1C0000, // 004B MOVE R7 R0 + 0x7C0C0800, // 004C CALL R3 4 + 0xB80E0400, // 004D GETNGBL R3 K2 + 0x8C0C0722, // 004E GETMET R3 R3 K34 + 0x7C0C0200, // 004F CALL R3 1 + 0x940C071D, // 0050 GETIDX R3 R3 K29 + 0x780E0003, // 0051 JMPF R3 #0056 + 0x8C0C011E, // 0052 GETMET R3 R0 K30 + 0x8814011F, // 0053 GETMBR R5 R0 K31 + 0x7C0C0400, // 0054 CALL R3 2 + 0x70020005, // 0055 JMP #005C + 0xB80E0400, // 0056 GETNGBL R3 K2 + 0x8C0C0720, // 0057 GETMET R3 R3 K32 + 0x58140023, // 0058 LDCONST R5 K35 + 0x84180001, // 0059 CLOSURE R6 P1 + 0x5C1C0000, // 005A MOVE R7 R0 + 0x7C0C0800, // 005B CALL R3 4 + 0x8C0C0124, // 005C GETMET R3 R0 K36 + 0x7C0C0200, // 005D CALL R3 1 + 0xB80E0400, // 005E GETNGBL R3 K2 + 0x8C0C0725, // 005F GETMET R3 R3 K37 + 0x5C140000, // 0060 MOVE R5 R0 + 0x7C0C0400, // 0061 CALL R3 2 + 0xA0000000, // 0062 CLOSE R0 + 0x80000000, // 0063 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: _start_mdns_announce +********************************************************************/ +be_local_closure(Matter_Device__start_mdns_announce, /* name */ + be_nested_proto( + 15, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[50]) { /* constants */ + /* K0 */ be_nested_str_weak(mdns), + /* K1 */ be_nested_str_weak(string), + /* K2 */ be_nested_str_weak(start), + /* K3 */ be_nested_str_weak(VP), + /* K4 */ be_nested_str_weak(vendorid), + /* K5 */ be_nested_str_weak(_X2B), + /* K6 */ be_nested_str_weak(productid), + /* K7 */ be_nested_str_weak(D), + /* K8 */ be_nested_str_weak(discriminator), + /* K9 */ be_nested_str_weak(CM), + /* K10 */ be_const_int(1), + /* K11 */ be_nested_str_weak(T), + /* K12 */ be_const_int(0), + /* K13 */ be_nested_str_weak(SII), + /* K14 */ be_nested_str_weak(SAI), + /* K15 */ be_nested_str_weak(tasmota), + /* K16 */ be_nested_str_weak(eth), + /* K17 */ be_nested_str_weak(hostname_eth), + /* K18 */ be_nested_str_weak(replace), + /* K19 */ be_nested_str_weak(find), + /* K20 */ be_nested_str_weak(mac), + /* K21 */ be_nested_str_weak(_X3A), + /* K22 */ be_nested_str_weak(), + /* K23 */ be_nested_str_weak(add_hostname), + /* K24 */ be_nested_str_weak(ip6local), + /* K25 */ be_nested_str_weak(ip), + /* K26 */ be_nested_str_weak(ip6), + /* K27 */ be_nested_str_weak(add_service), + /* K28 */ be_nested_str_weak(_matterc), + /* K29 */ be_nested_str_weak(_udp), + /* K30 */ be_nested_str_weak(commissioning_instance_eth), + /* K31 */ be_nested_str_weak(log), + /* K32 */ be_nested_str_weak(format), + /* K33 */ be_nested_str_weak(MTR_X3A_X20starting_X20mDNS_X20on_X20_X25s_X20_X27_X25s_X27_X20ptr_X20to_X20_X60_X25s_X2Elocal_X60), + /* K34 */ be_nested_str_weak(wifi), + /* K35 */ be_nested_str_weak(commissioning_instance_wifi), + /* K36 */ be_nested_str_weak(hostname_wifi), + /* K37 */ be_const_int(2), + /* K38 */ be_nested_str_weak(_L), + /* K39 */ be_nested_str_weak(MTR_X3A_X20adding_X20subtype_X3A_X20), + /* K40 */ be_const_int(3), + /* K41 */ be_nested_str_weak(add_subtype), + /* K42 */ be_nested_str_weak(_S), + /* K43 */ be_nested_str_weak(_V), + /* K44 */ be_nested_str_weak(_CM1), + /* K45 */ be_nested_str_weak(_matter), + /* K46 */ be_nested_str_weak(_tcp), + /* K47 */ be_nested_str_weak(MTR_X3A_X20Exception), + /* K48 */ be_nested_str_weak(_X7C), + /* K49 */ be_nested_str_weak(mdns_announce_op_discovery_all_sessions), + }), + be_str_weak(_start_mdns_announce), + &be_const_str_solidified, + ( &(const binstruction[292]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0xA40E0200, // 0001 IMPORT R3 K1 + 0x8C100502, // 0002 GETMET R4 R2 K2 + 0x7C100200, // 0003 CALL R4 1 + 0x60100013, // 0004 GETGBL R4 G19 + 0x7C100000, // 0005 CALL R4 0 + 0x60140008, // 0006 GETGBL R5 G8 + 0x88180104, // 0007 GETMBR R6 R0 K4 + 0x7C140200, // 0008 CALL R5 1 + 0x00140B05, // 0009 ADD R5 R5 K5 + 0x60180008, // 000A GETGBL R6 G8 + 0x881C0106, // 000B GETMBR R7 R0 K6 + 0x7C180200, // 000C CALL R6 1 + 0x00140A06, // 000D ADD R5 R5 R6 + 0x98120605, // 000E SETIDX R4 K3 R5 + 0x88140108, // 000F GETMBR R5 R0 K8 + 0x98120E05, // 0010 SETIDX R4 K7 R5 + 0x9812130A, // 0011 SETIDX R4 K9 K10 + 0x9812170C, // 0012 SETIDX R4 K11 K12 + 0x54161387, // 0013 LDINT R5 5000 + 0x98121A05, // 0014 SETIDX R4 K13 R5 + 0x5416012B, // 0015 LDINT R5 300 + 0x98121C05, // 0016 SETIDX R4 K14 R5 + 0xA80200F7, // 0017 EXBLK 0 #0110 + 0x7806007A, // 0018 JMPF R1 #0094 + 0xB8161E00, // 0019 GETNGBL R5 K15 + 0x8C140B10, // 001A GETMET R5 R5 K16 + 0x7C140200, // 001B CALL R5 1 + 0x8C180712, // 001C GETMET R6 R3 K18 + 0x8C200B13, // 001D GETMET R8 R5 K19 + 0x58280014, // 001E LDCONST R10 K20 + 0x7C200400, // 001F CALL R8 2 + 0x58240015, // 0020 LDCONST R9 K21 + 0x58280016, // 0021 LDCONST R10 K22 + 0x7C180800, // 0022 CALL R6 4 + 0x90022206, // 0023 SETMBR R0 K17 R6 + 0x8C180517, // 0024 GETMET R6 R2 K23 + 0x88200111, // 0025 GETMBR R8 R0 K17 + 0x8C240B13, // 0026 GETMET R9 R5 K19 + 0x582C0018, // 0027 LDCONST R11 K24 + 0x58300016, // 0028 LDCONST R12 K22 + 0x7C240600, // 0029 CALL R9 3 + 0x8C280B13, // 002A GETMET R10 R5 K19 + 0x58300019, // 002B LDCONST R12 K25 + 0x58340016, // 002C LDCONST R13 K22 + 0x7C280600, // 002D CALL R10 3 + 0x8C2C0B13, // 002E GETMET R11 R5 K19 + 0x5834001A, // 002F LDCONST R13 K26 + 0x58380016, // 0030 LDCONST R14 K22 + 0x7C2C0600, // 0031 CALL R11 3 + 0x7C180A00, // 0032 CALL R6 5 + 0x8C18051B, // 0033 GETMET R6 R2 K27 + 0x5820001C, // 0034 LDCONST R8 K28 + 0x5824001D, // 0035 LDCONST R9 K29 + 0x542A15A3, // 0036 LDINT R10 5540 + 0x5C2C0800, // 0037 MOVE R11 R4 + 0x8830011E, // 0038 GETMBR R12 R0 K30 + 0x88340111, // 0039 GETMBR R13 R0 K17 + 0x7C180E00, // 003A CALL R6 7 + 0xB81A1E00, // 003B GETNGBL R6 K15 + 0x8C180D1F, // 003C GETMET R6 R6 K31 + 0x8C200720, // 003D GETMET R8 R3 K32 + 0x58280021, // 003E LDCONST R10 K33 + 0x78060001, // 003F JMPF R1 #0042 + 0x582C0010, // 0040 LDCONST R11 K16 + 0x70020000, // 0041 JMP #0043 + 0x582C0022, // 0042 LDCONST R11 K34 + 0x78060001, // 0043 JMPF R1 #0046 + 0x8830011E, // 0044 GETMBR R12 R0 K30 + 0x70020000, // 0045 JMP #0047 + 0x88300123, // 0046 GETMBR R12 R0 K35 + 0x78060001, // 0047 JMPF R1 #004A + 0x88340111, // 0048 GETMBR R13 R0 K17 + 0x70020000, // 0049 JMP #004B + 0x88340124, // 004A GETMBR R13 R0 K36 + 0x7C200A00, // 004B CALL R8 5 + 0x58240025, // 004C LDCONST R9 K37 + 0x7C180600, // 004D CALL R6 3 + 0x60180008, // 004E GETGBL R6 G8 + 0x881C0108, // 004F GETMBR R7 R0 K8 + 0x54220FFE, // 0050 LDINT R8 4095 + 0x2C1C0E08, // 0051 AND R7 R7 R8 + 0x7C180200, // 0052 CALL R6 1 + 0x001A4C06, // 0053 ADD R6 K38 R6 + 0xB81E1E00, // 0054 GETNGBL R7 K15 + 0x8C1C0F1F, // 0055 GETMET R7 R7 K31 + 0x00264E06, // 0056 ADD R9 K39 R6 + 0x58280028, // 0057 LDCONST R10 K40 + 0x7C1C0600, // 0058 CALL R7 3 + 0x8C1C0529, // 0059 GETMET R7 R2 K41 + 0x5824001C, // 005A LDCONST R9 K28 + 0x5828001D, // 005B LDCONST R10 K29 + 0x882C011E, // 005C GETMBR R11 R0 K30 + 0x88300111, // 005D GETMBR R12 R0 K17 + 0x5C340C00, // 005E MOVE R13 R6 + 0x7C1C0C00, // 005F CALL R7 6 + 0x601C0008, // 0060 GETGBL R7 G8 + 0x88200108, // 0061 GETMBR R8 R0 K8 + 0x54260EFF, // 0062 LDINT R9 3840 + 0x2C201009, // 0063 AND R8 R8 R9 + 0x54260007, // 0064 LDINT R9 8 + 0x3C201009, // 0065 SHR R8 R8 R9 + 0x7C1C0200, // 0066 CALL R7 1 + 0x001E5407, // 0067 ADD R7 K42 R7 + 0x5C180E00, // 0068 MOVE R6 R7 + 0xB81E1E00, // 0069 GETNGBL R7 K15 + 0x8C1C0F1F, // 006A GETMET R7 R7 K31 + 0x00264E06, // 006B ADD R9 K39 R6 + 0x58280028, // 006C LDCONST R10 K40 + 0x7C1C0600, // 006D CALL R7 3 + 0x8C1C0529, // 006E GETMET R7 R2 K41 + 0x5824001C, // 006F LDCONST R9 K28 + 0x5828001D, // 0070 LDCONST R10 K29 + 0x882C011E, // 0071 GETMBR R11 R0 K30 + 0x88300111, // 0072 GETMBR R12 R0 K17 + 0x5C340C00, // 0073 MOVE R13 R6 + 0x7C1C0C00, // 0074 CALL R7 6 + 0x601C0008, // 0075 GETGBL R7 G8 + 0x88200104, // 0076 GETMBR R8 R0 K4 + 0x7C1C0200, // 0077 CALL R7 1 + 0x001E5607, // 0078 ADD R7 K43 R7 + 0x5C180E00, // 0079 MOVE R6 R7 + 0xB81E1E00, // 007A GETNGBL R7 K15 + 0x8C1C0F1F, // 007B GETMET R7 R7 K31 + 0x00264E06, // 007C ADD R9 K39 R6 + 0x58280028, // 007D LDCONST R10 K40 + 0x7C1C0600, // 007E CALL R7 3 + 0x8C1C0529, // 007F GETMET R7 R2 K41 + 0x5824001C, // 0080 LDCONST R9 K28 + 0x5828001D, // 0081 LDCONST R10 K29 + 0x882C011E, // 0082 GETMBR R11 R0 K30 + 0x88300111, // 0083 GETMBR R12 R0 K17 + 0x5C340C00, // 0084 MOVE R13 R6 + 0x7C1C0C00, // 0085 CALL R7 6 + 0x5818002C, // 0086 LDCONST R6 K44 + 0xB81E1E00, // 0087 GETNGBL R7 K15 + 0x8C1C0F1F, // 0088 GETMET R7 R7 K31 + 0x00264E06, // 0089 ADD R9 K39 R6 + 0x58280028, // 008A LDCONST R10 K40 + 0x7C1C0600, // 008B CALL R7 3 + 0x8C1C0529, // 008C GETMET R7 R2 K41 + 0x5824001C, // 008D LDCONST R9 K28 + 0x5828001D, // 008E LDCONST R10 K29 + 0x882C011E, // 008F GETMBR R11 R0 K30 + 0x88300111, // 0090 GETMBR R12 R0 K17 + 0x5C340C00, // 0091 MOVE R13 R6 + 0x7C1C0C00, // 0092 CALL R7 6 + 0x70020079, // 0093 JMP #010E + 0xB8161E00, // 0094 GETNGBL R5 K15 + 0x8C140B22, // 0095 GETMET R5 R5 K34 + 0x7C140200, // 0096 CALL R5 1 + 0x8C180712, // 0097 GETMET R6 R3 K18 + 0x8C200B13, // 0098 GETMET R8 R5 K19 + 0x58280014, // 0099 LDCONST R10 K20 + 0x7C200400, // 009A CALL R8 2 + 0x58240015, // 009B LDCONST R9 K21 + 0x58280016, // 009C LDCONST R10 K22 + 0x7C180800, // 009D CALL R6 4 + 0x90024806, // 009E SETMBR R0 K36 R6 + 0x8C180517, // 009F GETMET R6 R2 K23 + 0x88200124, // 00A0 GETMBR R8 R0 K36 + 0x8C240B13, // 00A1 GETMET R9 R5 K19 + 0x582C0018, // 00A2 LDCONST R11 K24 + 0x58300016, // 00A3 LDCONST R12 K22 + 0x7C240600, // 00A4 CALL R9 3 + 0x8C280B13, // 00A5 GETMET R10 R5 K19 + 0x58300019, // 00A6 LDCONST R12 K25 + 0x58340016, // 00A7 LDCONST R13 K22 + 0x7C280600, // 00A8 CALL R10 3 + 0x8C2C0B13, // 00A9 GETMET R11 R5 K19 + 0x5834001A, // 00AA LDCONST R13 K26 + 0x58380016, // 00AB LDCONST R14 K22 + 0x7C2C0600, // 00AC CALL R11 3 + 0x7C180A00, // 00AD CALL R6 5 + 0x8C18051B, // 00AE GETMET R6 R2 K27 + 0x5820002D, // 00AF LDCONST R8 K45 + 0x5824002E, // 00B0 LDCONST R9 K46 + 0x542A15A3, // 00B1 LDINT R10 5540 + 0x5C2C0800, // 00B2 MOVE R11 R4 + 0x88300123, // 00B3 GETMBR R12 R0 K35 + 0x88340124, // 00B4 GETMBR R13 R0 K36 + 0x7C180E00, // 00B5 CALL R6 7 + 0xB81A1E00, // 00B6 GETNGBL R6 K15 + 0x8C180D1F, // 00B7 GETMET R6 R6 K31 + 0x8C200720, // 00B8 GETMET R8 R3 K32 + 0x58280021, // 00B9 LDCONST R10 K33 + 0x78060001, // 00BA JMPF R1 #00BD + 0x582C0010, // 00BB LDCONST R11 K16 + 0x70020000, // 00BC JMP #00BE + 0x582C0022, // 00BD LDCONST R11 K34 + 0x78060001, // 00BE JMPF R1 #00C1 + 0x8830011E, // 00BF GETMBR R12 R0 K30 + 0x70020000, // 00C0 JMP #00C2 + 0x88300123, // 00C1 GETMBR R12 R0 K35 + 0x78060001, // 00C2 JMPF R1 #00C5 + 0x88340111, // 00C3 GETMBR R13 R0 K17 + 0x70020000, // 00C4 JMP #00C6 + 0x88340124, // 00C5 GETMBR R13 R0 K36 + 0x7C200A00, // 00C6 CALL R8 5 + 0x58240025, // 00C7 LDCONST R9 K37 + 0x7C180600, // 00C8 CALL R6 3 + 0x60180008, // 00C9 GETGBL R6 G8 + 0x881C0108, // 00CA GETMBR R7 R0 K8 + 0x54220FFE, // 00CB LDINT R8 4095 + 0x2C1C0E08, // 00CC AND R7 R7 R8 + 0x7C180200, // 00CD CALL R6 1 + 0x001A4C06, // 00CE ADD R6 K38 R6 + 0xB81E1E00, // 00CF GETNGBL R7 K15 + 0x8C1C0F1F, // 00D0 GETMET R7 R7 K31 + 0x00264E06, // 00D1 ADD R9 K39 R6 + 0x58280028, // 00D2 LDCONST R10 K40 + 0x7C1C0600, // 00D3 CALL R7 3 + 0x8C1C0529, // 00D4 GETMET R7 R2 K41 + 0x5824001C, // 00D5 LDCONST R9 K28 + 0x5828001D, // 00D6 LDCONST R10 K29 + 0x882C0123, // 00D7 GETMBR R11 R0 K35 + 0x88300124, // 00D8 GETMBR R12 R0 K36 + 0x5C340C00, // 00D9 MOVE R13 R6 + 0x7C1C0C00, // 00DA CALL R7 6 + 0x601C0008, // 00DB GETGBL R7 G8 + 0x88200108, // 00DC GETMBR R8 R0 K8 + 0x54260EFF, // 00DD LDINT R9 3840 + 0x2C201009, // 00DE AND R8 R8 R9 + 0x54260007, // 00DF LDINT R9 8 + 0x3C201009, // 00E0 SHR R8 R8 R9 + 0x7C1C0200, // 00E1 CALL R7 1 + 0x001E5407, // 00E2 ADD R7 K42 R7 + 0x5C180E00, // 00E3 MOVE R6 R7 + 0xB81E1E00, // 00E4 GETNGBL R7 K15 + 0x8C1C0F1F, // 00E5 GETMET R7 R7 K31 + 0x00264E06, // 00E6 ADD R9 K39 R6 + 0x58280028, // 00E7 LDCONST R10 K40 + 0x7C1C0600, // 00E8 CALL R7 3 + 0x8C1C0529, // 00E9 GETMET R7 R2 K41 + 0x5824001C, // 00EA LDCONST R9 K28 + 0x5828001D, // 00EB LDCONST R10 K29 + 0x882C0123, // 00EC GETMBR R11 R0 K35 + 0x88300124, // 00ED GETMBR R12 R0 K36 + 0x5C340C00, // 00EE MOVE R13 R6 + 0x7C1C0C00, // 00EF CALL R7 6 + 0x601C0008, // 00F0 GETGBL R7 G8 + 0x88200104, // 00F1 GETMBR R8 R0 K4 + 0x7C1C0200, // 00F2 CALL R7 1 + 0x001E5607, // 00F3 ADD R7 K43 R7 + 0x5C180E00, // 00F4 MOVE R6 R7 + 0xB81E1E00, // 00F5 GETNGBL R7 K15 + 0x8C1C0F1F, // 00F6 GETMET R7 R7 K31 + 0x00264E06, // 00F7 ADD R9 K39 R6 + 0x58280028, // 00F8 LDCONST R10 K40 + 0x7C1C0600, // 00F9 CALL R7 3 + 0x8C1C0529, // 00FA GETMET R7 R2 K41 + 0x5824001C, // 00FB LDCONST R9 K28 + 0x5828001D, // 00FC LDCONST R10 K29 + 0x882C0123, // 00FD GETMBR R11 R0 K35 + 0x88300124, // 00FE GETMBR R12 R0 K36 + 0x5C340C00, // 00FF MOVE R13 R6 + 0x7C1C0C00, // 0100 CALL R7 6 + 0x5818002C, // 0101 LDCONST R6 K44 + 0xB81E1E00, // 0102 GETNGBL R7 K15 + 0x8C1C0F1F, // 0103 GETMET R7 R7 K31 + 0x00264E06, // 0104 ADD R9 K39 R6 + 0x58280028, // 0105 LDCONST R10 K40 + 0x7C1C0600, // 0106 CALL R7 3 + 0x8C1C0529, // 0107 GETMET R7 R2 K41 + 0x5824001C, // 0108 LDCONST R9 K28 + 0x5828001D, // 0109 LDCONST R10 K29 + 0x882C0123, // 010A GETMBR R11 R0 K35 + 0x88300124, // 010B GETMBR R12 R0 K36 + 0x5C340C00, // 010C MOVE R13 R6 + 0x7C1C0C00, // 010D CALL R7 6 + 0xA8040001, // 010E EXBLK 1 1 + 0x70020010, // 010F JMP #0121 + 0xAC140002, // 0110 CATCH R5 0 2 + 0x7002000D, // 0111 JMP #0120 + 0xB81E1E00, // 0112 GETNGBL R7 K15 + 0x8C1C0F1F, // 0113 GETMET R7 R7 K31 + 0x60240008, // 0114 GETGBL R9 G8 + 0x5C280A00, // 0115 MOVE R10 R5 + 0x7C240200, // 0116 CALL R9 1 + 0x00265E09, // 0117 ADD R9 K47 R9 + 0x00241330, // 0118 ADD R9 R9 K48 + 0x60280008, // 0119 GETGBL R10 G8 + 0x5C2C0C00, // 011A MOVE R11 R6 + 0x7C280200, // 011B CALL R10 1 + 0x0024120A, // 011C ADD R9 R9 R10 + 0x58280025, // 011D LDCONST R10 K37 + 0x7C1C0600, // 011E CALL R7 3 + 0x70020000, // 011F JMP #0121 + 0xB0080000, // 0120 RAISE 2 R0 R0 + 0x8C140131, // 0121 GETMET R5 R0 K49 + 0x7C140200, // 0122 CALL R5 1 + 0x80000000, // 0123 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: compute_qrcode_content +********************************************************************/ +be_local_closure(Matter_Device_compute_qrcode_content, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[12]) { /* constants */ + /* K0 */ be_nested_str_weak(resize), + /* K1 */ be_nested_str_weak(setbits), + /* K2 */ be_const_int(3), + /* K3 */ be_nested_str_weak(vendorid), + /* K4 */ be_nested_str_weak(productid), + /* K5 */ be_nested_str_weak(discriminator), + /* K6 */ be_nested_str_weak(passcode), + /* K7 */ be_const_int(134217727), + /* K8 */ be_nested_str_weak(MT_X3A), + /* K9 */ be_nested_str_weak(matter), + /* K10 */ be_nested_str_weak(Base38), + /* K11 */ be_nested_str_weak(encode), + }), + be_str_weak(compute_qrcode_content), + &be_const_str_solidified, + ( &(const binstruction[40]) { /* code */ + 0x60040015, // 0000 GETGBL R1 G21 + 0x7C040000, // 0001 CALL R1 0 + 0x8C040300, // 0002 GETMET R1 R1 K0 + 0x540E000A, // 0003 LDINT R3 11 + 0x7C040400, // 0004 CALL R1 2 + 0x8C080301, // 0005 GETMET R2 R1 K1 + 0x58100002, // 0006 LDCONST R4 K2 + 0x5416000F, // 0007 LDINT R5 16 + 0x88180103, // 0008 GETMBR R6 R0 K3 + 0x7C080800, // 0009 CALL R2 4 + 0x8C080301, // 000A GETMET R2 R1 K1 + 0x54120012, // 000B LDINT R4 19 + 0x5416000F, // 000C LDINT R5 16 + 0x88180104, // 000D GETMBR R6 R0 K4 + 0x7C080800, // 000E CALL R2 4 + 0x8C080301, // 000F GETMET R2 R1 K1 + 0x54120024, // 0010 LDINT R4 37 + 0x54160007, // 0011 LDINT R5 8 + 0x541A0003, // 0012 LDINT R6 4 + 0x7C080800, // 0013 CALL R2 4 + 0x8C080301, // 0014 GETMET R2 R1 K1 + 0x5412002C, // 0015 LDINT R4 45 + 0x5416000B, // 0016 LDINT R5 12 + 0x88180105, // 0017 GETMBR R6 R0 K5 + 0x541E0FFE, // 0018 LDINT R7 4095 + 0x2C180C07, // 0019 AND R6 R6 R7 + 0x7C080800, // 001A CALL R2 4 + 0x8C080301, // 001B GETMET R2 R1 K1 + 0x54120038, // 001C LDINT R4 57 + 0x5416001A, // 001D LDINT R5 27 + 0x88180106, // 001E GETMBR R6 R0 K6 + 0x2C180D07, // 001F AND R6 R6 K7 + 0x7C080800, // 0020 CALL R2 4 + 0xB80A1200, // 0021 GETNGBL R2 K9 + 0x8808050A, // 0022 GETMBR R2 R2 K10 + 0x8C08050B, // 0023 GETMET R2 R2 K11 + 0x5C100200, // 0024 MOVE R4 R1 + 0x7C080400, // 0025 CALL R2 2 + 0x000A1002, // 0026 ADD R2 K8 R2 + 0x80040400, // 0027 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: msg_received +********************************************************************/ +be_local_closure(Matter_Device_msg_received, /* name */ + be_nested_proto( + 9, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(msg_handler), + /* K1 */ be_nested_str_weak(msg_received), + }), + be_str_weak(msg_received), + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x88100100, // 0000 GETMBR R4 R0 K0 + 0x8C100901, // 0001 GETMET R4 R4 K1 + 0x5C180200, // 0002 MOVE R6 R1 + 0x5C1C0400, // 0003 MOVE R7 R2 + 0x5C200600, // 0004 MOVE R8 R3 + 0x7C100800, // 0005 CALL R4 4 + 0x80040800, // 0006 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: mdns_announce_op_discovery_all_sessions +********************************************************************/ +be_local_closure(Matter_Device_mdns_announce_op_discovery_all_sessions, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(sessions), + /* K1 */ be_nested_str_weak(get_deviceid), + /* K2 */ be_nested_str_weak(get_fabric), + /* K3 */ be_nested_str_weak(mdns_announce_op_discovery), + /* K4 */ be_nested_str_weak(stop_iteration), + }), + be_str_weak(mdns_announce_op_discovery_all_sessions), + &be_const_str_solidified, + ( &(const binstruction[21]) { /* code */ + 0x60040010, // 0000 GETGBL R1 G16 + 0x88080100, // 0001 GETMBR R2 R0 K0 + 0x88080500, // 0002 GETMBR R2 R2 K0 + 0x7C040200, // 0003 CALL R1 1 + 0xA802000B, // 0004 EXBLK 0 #0011 + 0x5C080200, // 0005 MOVE R2 R1 + 0x7C080000, // 0006 CALL R2 0 + 0x8C0C0501, // 0007 GETMET R3 R2 K1 + 0x7C0C0200, // 0008 CALL R3 1 + 0x780E0005, // 0009 JMPF R3 #0010 + 0x8C0C0502, // 000A GETMET R3 R2 K2 + 0x7C0C0200, // 000B CALL R3 1 + 0x780E0002, // 000C JMPF R3 #0010 + 0x8C0C0103, // 000D GETMET R3 R0 K3 + 0x5C140400, // 000E MOVE R5 R2 + 0x7C0C0400, // 000F CALL R3 2 + 0x7001FFF3, // 0010 JMP #0005 + 0x58040004, // 0011 LDCONST R1 K4 + 0xAC040200, // 0012 CATCH R1 1 0 + 0xB0080000, // 0013 RAISE 2 R0 R0 + 0x80000000, // 0014 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: invoke_request +********************************************************************/ +be_local_closure(Matter_Device_invoke_request, /* name */ + be_nested_proto( + 11, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str_weak(plugins), + /* K2 */ be_nested_str_weak(invoke_request), + /* K3 */ be_nested_str_weak(status), + /* K4 */ be_nested_str_weak(matter), + /* K5 */ be_nested_str_weak(UNSUPPORTED_COMMAND), + /* K6 */ be_const_int(1), + }), + be_str_weak(invoke_request), + &be_const_str_solidified, + ( &(const binstruction[25]) { /* code */ + 0x58100000, // 0000 LDCONST R4 K0 + 0x6014000C, // 0001 GETGBL R5 G12 + 0x88180101, // 0002 GETMBR R6 R0 K1 + 0x7C140200, // 0003 CALL R5 1 + 0x14140805, // 0004 LT R5 R4 R5 + 0x78160011, // 0005 JMPF R5 #0018 + 0x88140101, // 0006 GETMBR R5 R0 K1 + 0x94140A04, // 0007 GETIDX R5 R5 R4 + 0x8C180B02, // 0008 GETMET R6 R5 K2 + 0x5C200200, // 0009 MOVE R8 R1 + 0x5C240400, // 000A MOVE R9 R2 + 0x5C280600, // 000B MOVE R10 R3 + 0x7C180800, // 000C CALL R6 4 + 0x4C1C0000, // 000D LDNIL R7 + 0x201C0C07, // 000E NE R7 R6 R7 + 0x741E0004, // 000F JMPT R7 #0015 + 0x881C0703, // 0010 GETMBR R7 R3 K3 + 0xB8220800, // 0011 GETNGBL R8 K4 + 0x88201105, // 0012 GETMBR R8 R8 K5 + 0x201C0E08, // 0013 NE R7 R7 R8 + 0x781E0000, // 0014 JMPF R7 #0016 + 0x80040C00, // 0015 RET 1 R6 + 0x00100906, // 0016 ADD R4 R4 K6 + 0x7001FFE8, // 0017 JMP #0001 + 0x80000000, // 0018 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: read_attribute +********************************************************************/ +be_local_closure(Matter_Device_read_attribute, /* name */ + be_nested_proto( + 13, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str_weak(plugins), + /* K2 */ be_nested_str_weak(read_attribute), + /* K3 */ be_const_int(1), + }), + be_str_weak(read_attribute), + &be_const_str_solidified, + ( &(const binstruction[21]) { /* code */ + 0x58140000, // 0000 LDCONST R5 K0 + 0x6018000C, // 0001 GETGBL R6 G12 + 0x881C0101, // 0002 GETMBR R7 R0 K1 + 0x7C180200, // 0003 CALL R6 1 + 0x14180A06, // 0004 LT R6 R5 R6 + 0x781A000D, // 0005 JMPF R6 #0014 + 0x88180101, // 0006 GETMBR R6 R0 K1 + 0x94180C05, // 0007 GETIDX R6 R6 R5 + 0x8C1C0D02, // 0008 GETMET R7 R6 K2 + 0x5C240200, // 0009 MOVE R9 R1 + 0x5C280400, // 000A MOVE R10 R2 + 0x5C2C0600, // 000B MOVE R11 R3 + 0x5C300800, // 000C MOVE R12 R4 + 0x7C1C0A00, // 000D CALL R7 5 + 0x4C200000, // 000E LDNIL R8 + 0x20200E08, // 000F NE R8 R7 R8 + 0x78220000, // 0010 JMPF R8 #0012 + 0x80040E00, // 0011 RET 1 R7 + 0x00140B03, // 0012 ADD R5 R5 K3 + 0x7001FFEC, // 0013 JMP #0001 + 0x80000000, // 0014 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_Device +********************************************************************/ +be_local_class(Matter_Device, + 18, + NULL, + be_nested_map(48, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(read_attribute, 15), be_const_closure(Matter_Device_read_attribute_closure) }, + { be_const_key_weak(msg_send, -1), be_const_closure(Matter_Device_msg_send_closure) }, + { be_const_key_weak(start_operational_dicovery_deferred, 32), be_const_closure(Matter_Device_start_operational_dicovery_deferred_closure) }, + { be_const_key_weak(start_commissioning_complete_deferred, 30), be_const_closure(Matter_Device_start_commissioning_complete_deferred_closure) }, + { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Device_invoke_request_closure) }, + { be_const_key_weak(stop, -1), be_const_closure(Matter_Device_stop_closure) }, + { be_const_key_weak(udp_server, -1), be_const_var(1) }, + { be_const_key_weak(mdns_announce_op_discovery, -1), be_const_closure(Matter_Device_mdns_announce_op_discovery_closure) }, + { be_const_key_weak(hostname_eth, 38), be_const_var(8) }, + { be_const_key_weak(every_second, -1), be_const_closure(Matter_Device_every_second_closure) }, + { be_const_key_weak(start_commissioning_complete, -1), be_const_closure(Matter_Device_start_commissioning_complete_closure) }, + { be_const_key_weak(ui, 4), be_const_var(4) }, + { be_const_key_weak(PRODUCT_ID, -1), be_const_int(32768) }, + { be_const_key_weak(L, -1), be_const_var(17) }, + { be_const_key_weak(vendorid, -1), be_const_var(9) }, + { be_const_key_weak(mdns_announce_op_discovery_all_sessions, -1), be_const_closure(Matter_Device_mdns_announce_op_discovery_all_sessions_closure) }, + { be_const_key_weak(start_operational_dicovery, -1), be_const_closure(Matter_Device_start_operational_dicovery_closure) }, + { be_const_key_weak(productid, -1), be_const_var(10) }, + { be_const_key_weak(compute_manual_pairing_code, -1), be_const_closure(Matter_Device_compute_manual_pairing_code_closure) }, + { be_const_key_weak(start_udp, -1), be_const_closure(Matter_Device_start_udp_closure) }, + { be_const_key_weak(sessions, -1), be_const_var(3) }, + { be_const_key_weak(start_mdns_announce_hostnames, -1), be_const_closure(Matter_Device_start_mdns_announce_hostnames_closure) }, + { be_const_key_weak(finish_commissioning, 7), be_const_closure(Matter_Device_finish_commissioning_closure) }, + { be_const_key_weak(packet_ack, 10), be_const_closure(Matter_Device_packet_ack_closure) }, + { be_const_key_weak(discriminator, -1), be_const_var(11) }, + { be_const_key_weak(VENDOR_ID, -1), be_const_int(65521) }, + { be_const_key_weak(start_basic_commissioning, 41), be_const_closure(Matter_Device_start_basic_commissioning_closure) }, + { be_const_key_weak(plugins, 24), be_const_var(0) }, + { be_const_key_weak(compute_pbkdf, 20), be_const_closure(Matter_Device_compute_pbkdf_closure) }, + { be_const_key_weak(passcode, -1), be_const_var(12) }, + { be_const_key_weak(init, 47), be_const_closure(Matter_Device_init_closure) }, + { be_const_key_weak(PBKDF_ITERATIONS, -1), be_const_int(1000) }, + { be_const_key_weak(w0, 46), be_const_var(15) }, + { be_const_key_weak(salt, 36), be_const_var(14) }, + { be_const_key_weak(UDP_PORT, -1), be_const_int(5540) }, + { be_const_key_weak(_start_mdns_announce, -1), be_const_closure(Matter_Device__start_mdns_announce_closure) }, + { be_const_key_weak(msg_handler, -1), be_const_var(2) }, + { be_const_key_weak(w1, 35), be_const_var(16) }, + { be_const_key_weak(FILENAME, -1), be_nested_str_weak(_matter_device_X2Ejson) }, + { be_const_key_weak(compute_qrcode_content, -1), be_const_closure(Matter_Device_compute_qrcode_content_closure) }, + { be_const_key_weak(msg_received, -1), be_const_closure(Matter_Device_msg_received_closure) }, + { be_const_key_weak(commissioning_instance_eth, -1), be_const_var(6) }, + { be_const_key_weak(commissioning_instance_wifi, 0), be_const_var(5) }, + { be_const_key_weak(PASSCODE_DEFAULT, 13), be_const_int(20202021) }, + { be_const_key_weak(hostname_wifi, -1), be_const_var(7) }, + { be_const_key_weak(iterations, -1), be_const_var(13) }, + { be_const_key_weak(save_param, -1), be_const_closure(Matter_Device_save_param_closure) }, + { be_const_key_weak(load_param, -1), be_const_closure(Matter_Device_load_param_closure) }, + })), + be_str_weak(Matter_Device) +); +/*******************************************************************/ + +void be_load_Matter_Device_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_Device); + be_setglobal(vm, "Matter_Device"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_IM.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_IM.h new file mode 100644 index 000000000..2c89b8f4f --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_IM.h @@ -0,0 +1,1274 @@ +/* Solidification of Matter_IM.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_Response_container; + +/******************************************************************** +** Solidified class: Matter_Response_container +********************************************************************/ +be_local_class(Matter_Response_container, + 5, + NULL, + be_nested_map(5, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(command, -1), be_const_var(3) }, + { be_const_key_weak(attribute, -1), be_const_var(2) }, + { be_const_key_weak(cluster, -1), be_const_var(1) }, + { be_const_key_weak(endpoint, 0), be_const_var(0) }, + { be_const_key_weak(status, -1), be_const_var(4) }, + })), + be_str_weak(Matter_Response_container) +); +/*******************************************************************/ + +void be_load_Matter_Response_container_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_Response_container); + be_setglobal(vm, "Matter_Response_container"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_IM; + +/******************************************************************** +** Solidified function: process_timed_request +********************************************************************/ +be_local_closure(Matter_IM_process_timed_request, /* name */ + be_nested_proto( + 15, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[24]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(TimedRequestMessage), + /* K3 */ be_nested_str_weak(from_TLV), + /* K4 */ be_nested_str_weak(tasmota), + /* K5 */ be_nested_str_weak(log), + /* K6 */ be_nested_str_weak(MTR_X3A_X20received_X20TimedRequestMessage_X3D), + /* K7 */ be_const_int(3), + /* K8 */ be_nested_str_weak(format), + /* K9 */ be_nested_str_weak(MTR_X3A_X20_X3EReceived_IM_X20_X20_X20TimedRequest_X3D_X25i_X20from_X20_X5B_X25s_X5D_X3A_X25i), + /* K10 */ be_nested_str_weak(timeout), + /* K11 */ be_const_int(2), + /* K12 */ be_nested_str_weak(StatusResponseMessage), + /* K13 */ be_nested_str_weak(status), + /* K14 */ be_nested_str_weak(SUCCESS), + /* K15 */ be_nested_str_weak(build_response), + /* K16 */ be_const_int(1), + /* K17 */ be_nested_str_weak(encode), + /* K18 */ be_nested_str_weak(to_TLV), + /* K19 */ be_nested_str_weak(encrypt), + /* K20 */ be_nested_str_weak(responder), + /* K21 */ be_nested_str_weak(send_response), + /* K22 */ be_nested_str_weak(raw), + /* K23 */ be_nested_str_weak(message_counter), + }), + be_str_weak(process_timed_request), + &be_const_str_solidified, + ( &(const binstruction[52]) { /* code */ + 0xA4160000, // 0000 IMPORT R5 K0 + 0xB81A0200, // 0001 GETNGBL R6 K1 + 0x8C180D02, // 0002 GETMET R6 R6 K2 + 0x7C180200, // 0003 CALL R6 1 + 0x8C180D03, // 0004 GETMET R6 R6 K3 + 0x5C200400, // 0005 MOVE R8 R2 + 0x7C180400, // 0006 CALL R6 2 + 0xB81E0800, // 0007 GETNGBL R7 K4 + 0x8C1C0F05, // 0008 GETMET R7 R7 K5 + 0x60240008, // 0009 GETGBL R9 G8 + 0x5C280C00, // 000A MOVE R10 R6 + 0x7C240200, // 000B CALL R9 1 + 0x00260C09, // 000C ADD R9 K6 R9 + 0x58280007, // 000D LDCONST R10 K7 + 0x7C1C0600, // 000E CALL R7 3 + 0xB81E0800, // 000F GETNGBL R7 K4 + 0x8C1C0F05, // 0010 GETMET R7 R7 K5 + 0x8C240B08, // 0011 GETMET R9 R5 K8 + 0x582C0009, // 0012 LDCONST R11 K9 + 0x88300D0A, // 0013 GETMBR R12 R6 K10 + 0x5C340600, // 0014 MOVE R13 R3 + 0x5C380800, // 0015 MOVE R14 R4 + 0x7C240A00, // 0016 CALL R9 5 + 0x5828000B, // 0017 LDCONST R10 K11 + 0x7C1C0600, // 0018 CALL R7 3 + 0xB81E0200, // 0019 GETNGBL R7 K1 + 0x8C1C0F0C, // 001A GETMET R7 R7 K12 + 0x7C1C0200, // 001B CALL R7 1 + 0xB8220200, // 001C GETNGBL R8 K1 + 0x8820110E, // 001D GETMBR R8 R8 K14 + 0x901E1A08, // 001E SETMBR R7 K13 R8 + 0x8C20030F, // 001F GETMET R8 R1 K15 + 0x58280010, // 0020 LDCONST R10 K16 + 0x502C0200, // 0021 LDBOOL R11 1 0 + 0x7C200600, // 0022 CALL R8 3 + 0x8C241111, // 0023 GETMET R9 R8 K17 + 0x8C2C0F12, // 0024 GETMET R11 R7 K18 + 0x7C2C0200, // 0025 CALL R11 1 + 0x8C2C1711, // 0026 GETMET R11 R11 K17 + 0x7C2C0200, // 0027 CALL R11 1 + 0x7C240400, // 0028 CALL R9 2 + 0x8C241113, // 0029 GETMET R9 R8 K19 + 0x7C240200, // 002A CALL R9 1 + 0x88240114, // 002B GETMBR R9 R0 K20 + 0x8C241315, // 002C GETMET R9 R9 K21 + 0x882C1116, // 002D GETMBR R11 R8 K22 + 0x5C300600, // 002E MOVE R12 R3 + 0x5C340800, // 002F MOVE R13 R4 + 0x88381117, // 0030 GETMBR R14 R8 K23 + 0x7C240A00, // 0031 CALL R9 5 + 0x50240200, // 0032 LDBOOL R9 1 0 + 0x80041200, // 0033 RET 1 R9 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: process_status_response +********************************************************************/ +be_local_closure(Matter_IM_process_status_response, /* name */ + be_nested_proto( + 13, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(findsubval), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(tasmota), + /* K4 */ be_nested_str_weak(log), + /* K5 */ be_nested_str_weak(format), + /* K6 */ be_nested_str_weak(MTR_X3A_X20Status_X20Response_X20_X3D_X200x_X2502X), + /* K7 */ be_const_int(3), + }), + be_str_weak(process_status_response), + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0xA4160000, // 0000 IMPORT R5 K0 + 0x8C180501, // 0001 GETMET R6 R2 K1 + 0x58200002, // 0002 LDCONST R8 K2 + 0x542600FE, // 0003 LDINT R9 255 + 0x7C180600, // 0004 CALL R6 3 + 0xB81E0600, // 0005 GETNGBL R7 K3 + 0x8C1C0F04, // 0006 GETMET R7 R7 K4 + 0x8C240B05, // 0007 GETMET R9 R5 K5 + 0x582C0006, // 0008 LDCONST R11 K6 + 0x5C300C00, // 0009 MOVE R12 R6 + 0x7C240600, // 000A CALL R9 3 + 0x58280007, // 000B LDCONST R10 K7 + 0x7C1C0600, // 000C CALL R7 3 + 0x501C0200, // 000D LDBOOL R7 1 0 + 0x80040E00, // 000E RET 1 R7 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_IM_init, /* name */ + be_nested_proto( + 2, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(responder), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x80000000, // 0001 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: every_second +********************************************************************/ +be_local_closure(Matter_IM_every_second, /* name */ + be_nested_proto( + 1, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(every_second), + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: process_write_response +********************************************************************/ +be_local_closure(Matter_IM_process_write_response, /* name */ + be_nested_proto( + 11, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(WriteResponseMessage), + /* K3 */ be_nested_str_weak(from_TLV), + /* K4 */ be_nested_str_weak(tasmota), + /* K5 */ be_nested_str_weak(log), + /* K6 */ be_nested_str_weak(MTR_X3A_X20received_X20WriteResponseMessage_X3D), + /* K7 */ be_const_int(3), + }), + be_str_weak(process_write_response), + &be_const_str_solidified, + ( &(const binstruction[17]) { /* code */ + 0xA4160000, // 0000 IMPORT R5 K0 + 0xB81A0200, // 0001 GETNGBL R6 K1 + 0x8C180D02, // 0002 GETMET R6 R6 K2 + 0x7C180200, // 0003 CALL R6 1 + 0x8C180D03, // 0004 GETMET R6 R6 K3 + 0x5C200400, // 0005 MOVE R8 R2 + 0x7C180400, // 0006 CALL R6 2 + 0xB81E0800, // 0007 GETNGBL R7 K4 + 0x8C1C0F05, // 0008 GETMET R7 R7 K5 + 0x60240008, // 0009 GETGBL R9 G8 + 0x5C280C00, // 000A MOVE R10 R6 + 0x7C240200, // 000B CALL R9 1 + 0x00260C09, // 000C ADD R9 K6 R9 + 0x58280007, // 000D LDCONST R10 K7 + 0x7C1C0600, // 000E CALL R7 3 + 0x501C0000, // 000F LDBOOL R7 0 0 + 0x80040E00, // 0010 RET 1 R7 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: process_incoming +********************************************************************/ +be_local_closure(Matter_IM_process_incoming, /* name */ + be_nested_proto( + 13, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[27]) { /* constants */ + /* K0 */ be_nested_str_weak(tasmota), + /* K1 */ be_nested_str_weak(log), + /* K2 */ be_nested_str_weak(MTR_X3A_X20received_X20IM_X20message_X20), + /* K3 */ be_nested_str_weak(matter), + /* K4 */ be_nested_str_weak(inspect), + /* K5 */ be_const_int(3), + /* K6 */ be_nested_str_weak(TLV), + /* K7 */ be_nested_str_weak(parse), + /* K8 */ be_nested_str_weak(raw), + /* K9 */ be_nested_str_weak(app_payload_idx), + /* K10 */ be_nested_str_weak(MTR_X3A_X20IM_X20TLV_X3A_X20), + /* K11 */ be_nested_str_weak(findsubval), + /* K12 */ be_nested_str_weak(MTR_X3A_X20InteractionModelRevision_X3D), + /* K13 */ be_nested_str_weak(nil), + /* K14 */ be_nested_str_weak(opcode), + /* K15 */ be_const_int(1), + /* K16 */ be_nested_str_weak(process_status_response), + /* K17 */ be_const_int(2), + /* K18 */ be_nested_str_weak(process_read_request), + /* K19 */ be_nested_str_weak(subscribe_request), + /* K20 */ be_nested_str_weak(subscribe_response), + /* K21 */ be_nested_str_weak(report_data), + /* K22 */ be_nested_str_weak(process_write_request), + /* K23 */ be_nested_str_weak(process_write_response), + /* K24 */ be_nested_str_weak(process_invoke_request), + /* K25 */ be_nested_str_weak(process_invoke_response), + /* K26 */ be_nested_str_weak(process_timed_request), + }), + be_str_weak(process_incoming), + &be_const_str_solidified, + ( &(const binstruction[148]) { /* code */ + 0xB8120000, // 0000 GETNGBL R4 K0 + 0x8C100901, // 0001 GETMET R4 R4 K1 + 0xB81A0600, // 0002 GETNGBL R6 K3 + 0x8C180D04, // 0003 GETMET R6 R6 K4 + 0x5C200200, // 0004 MOVE R8 R1 + 0x7C180400, // 0005 CALL R6 2 + 0x001A0406, // 0006 ADD R6 K2 R6 + 0x581C0005, // 0007 LDCONST R7 K5 + 0x7C100600, // 0008 CALL R4 3 + 0xB8120600, // 0009 GETNGBL R4 K3 + 0x88100906, // 000A GETMBR R4 R4 K6 + 0x8C100907, // 000B GETMET R4 R4 K7 + 0x88180308, // 000C GETMBR R6 R1 K8 + 0x881C0309, // 000D GETMBR R7 R1 K9 + 0x7C100600, // 000E CALL R4 3 + 0xB8160000, // 000F GETNGBL R5 K0 + 0x8C140B01, // 0010 GETMET R5 R5 K1 + 0x601C0008, // 0011 GETGBL R7 G8 + 0x5C200800, // 0012 MOVE R8 R4 + 0x7C1C0200, // 0013 CALL R7 1 + 0x001E1407, // 0014 ADD R7 K10 R7 + 0x58200005, // 0015 LDCONST R8 K5 + 0x7C140600, // 0016 CALL R5 3 + 0x8C14090B, // 0017 GETMET R5 R4 K11 + 0x541E00FE, // 0018 LDINT R7 255 + 0x7C140400, // 0019 CALL R5 2 + 0xB81A0000, // 001A GETNGBL R6 K0 + 0x8C180D01, // 001B GETMET R6 R6 K1 + 0x4C200000, // 001C LDNIL R8 + 0x20200A08, // 001D NE R8 R5 R8 + 0x78220003, // 001E JMPF R8 #0023 + 0x60200008, // 001F GETGBL R8 G8 + 0x5C240A00, // 0020 MOVE R9 R5 + 0x7C200200, // 0021 CALL R8 1 + 0x70020000, // 0022 JMP #0024 + 0x5820000D, // 0023 LDCONST R8 K13 + 0x00221808, // 0024 ADD R8 K12 R8 + 0x58240005, // 0025 LDCONST R9 K5 + 0x7C180600, // 0026 CALL R6 3 + 0x8818030E, // 0027 GETMBR R6 R1 K14 + 0x1C1C0D0F, // 0028 EQ R7 R6 K15 + 0x781E0007, // 0029 JMPF R7 #0032 + 0x8C1C0110, // 002A GETMET R7 R0 K16 + 0x5C240200, // 002B MOVE R9 R1 + 0x5C280800, // 002C MOVE R10 R4 + 0x5C2C0400, // 002D MOVE R11 R2 + 0x5C300600, // 002E MOVE R12 R3 + 0x7C1C0A00, // 002F CALL R7 5 + 0x80040E00, // 0030 RET 1 R7 + 0x7002005F, // 0031 JMP #0092 + 0x1C1C0D11, // 0032 EQ R7 R6 K17 + 0x781E0007, // 0033 JMPF R7 #003C + 0x8C1C0112, // 0034 GETMET R7 R0 K18 + 0x5C240200, // 0035 MOVE R9 R1 + 0x5C280800, // 0036 MOVE R10 R4 + 0x5C2C0400, // 0037 MOVE R11 R2 + 0x5C300600, // 0038 MOVE R12 R3 + 0x7C1C0A00, // 0039 CALL R7 5 + 0x80040E00, // 003A RET 1 R7 + 0x70020055, // 003B JMP #0092 + 0x1C1C0D05, // 003C EQ R7 R6 K5 + 0x781E0007, // 003D JMPF R7 #0046 + 0x8C1C0113, // 003E GETMET R7 R0 K19 + 0x5C240200, // 003F MOVE R9 R1 + 0x5C280800, // 0040 MOVE R10 R4 + 0x5C2C0400, // 0041 MOVE R11 R2 + 0x5C300600, // 0042 MOVE R12 R3 + 0x7C1C0A00, // 0043 CALL R7 5 + 0x80040E00, // 0044 RET 1 R7 + 0x7002004B, // 0045 JMP #0092 + 0x541E0003, // 0046 LDINT R7 4 + 0x1C1C0C07, // 0047 EQ R7 R6 R7 + 0x781E0007, // 0048 JMPF R7 #0051 + 0x8C1C0114, // 0049 GETMET R7 R0 K20 + 0x5C240200, // 004A MOVE R9 R1 + 0x5C280800, // 004B MOVE R10 R4 + 0x5C2C0400, // 004C MOVE R11 R2 + 0x5C300600, // 004D MOVE R12 R3 + 0x7C1C0A00, // 004E CALL R7 5 + 0x80040E00, // 004F RET 1 R7 + 0x70020040, // 0050 JMP #0092 + 0x541E0004, // 0051 LDINT R7 5 + 0x1C1C0C07, // 0052 EQ R7 R6 R7 + 0x781E0007, // 0053 JMPF R7 #005C + 0x8C1C0115, // 0054 GETMET R7 R0 K21 + 0x5C240200, // 0055 MOVE R9 R1 + 0x5C280800, // 0056 MOVE R10 R4 + 0x5C2C0400, // 0057 MOVE R11 R2 + 0x5C300600, // 0058 MOVE R12 R3 + 0x7C1C0A00, // 0059 CALL R7 5 + 0x80040E00, // 005A RET 1 R7 + 0x70020035, // 005B JMP #0092 + 0x541E0005, // 005C LDINT R7 6 + 0x1C1C0C07, // 005D EQ R7 R6 R7 + 0x781E0007, // 005E JMPF R7 #0067 + 0x8C1C0116, // 005F GETMET R7 R0 K22 + 0x5C240200, // 0060 MOVE R9 R1 + 0x5C280800, // 0061 MOVE R10 R4 + 0x5C2C0400, // 0062 MOVE R11 R2 + 0x5C300600, // 0063 MOVE R12 R3 + 0x7C1C0A00, // 0064 CALL R7 5 + 0x80040E00, // 0065 RET 1 R7 + 0x7002002A, // 0066 JMP #0092 + 0x541E0006, // 0067 LDINT R7 7 + 0x1C1C0C07, // 0068 EQ R7 R6 R7 + 0x781E0007, // 0069 JMPF R7 #0072 + 0x8C1C0117, // 006A GETMET R7 R0 K23 + 0x5C240200, // 006B MOVE R9 R1 + 0x5C280800, // 006C MOVE R10 R4 + 0x5C2C0400, // 006D MOVE R11 R2 + 0x5C300600, // 006E MOVE R12 R3 + 0x7C1C0A00, // 006F CALL R7 5 + 0x80040E00, // 0070 RET 1 R7 + 0x7002001F, // 0071 JMP #0092 + 0x541E0007, // 0072 LDINT R7 8 + 0x1C1C0C07, // 0073 EQ R7 R6 R7 + 0x781E0007, // 0074 JMPF R7 #007D + 0x8C1C0118, // 0075 GETMET R7 R0 K24 + 0x5C240200, // 0076 MOVE R9 R1 + 0x5C280800, // 0077 MOVE R10 R4 + 0x5C2C0400, // 0078 MOVE R11 R2 + 0x5C300600, // 0079 MOVE R12 R3 + 0x7C1C0A00, // 007A CALL R7 5 + 0x80040E00, // 007B RET 1 R7 + 0x70020014, // 007C JMP #0092 + 0x541E0008, // 007D LDINT R7 9 + 0x1C1C0C07, // 007E EQ R7 R6 R7 + 0x781E0007, // 007F JMPF R7 #0088 + 0x8C1C0119, // 0080 GETMET R7 R0 K25 + 0x5C240200, // 0081 MOVE R9 R1 + 0x5C280800, // 0082 MOVE R10 R4 + 0x5C2C0400, // 0083 MOVE R11 R2 + 0x5C300600, // 0084 MOVE R12 R3 + 0x7C1C0A00, // 0085 CALL R7 5 + 0x80040E00, // 0086 RET 1 R7 + 0x70020009, // 0087 JMP #0092 + 0x541E0009, // 0088 LDINT R7 10 + 0x1C1C0C07, // 0089 EQ R7 R6 R7 + 0x781E0006, // 008A JMPF R7 #0092 + 0x8C1C011A, // 008B GETMET R7 R0 K26 + 0x5C240200, // 008C MOVE R9 R1 + 0x5C280800, // 008D MOVE R10 R4 + 0x5C2C0400, // 008E MOVE R11 R2 + 0x5C300600, // 008F MOVE R12 R3 + 0x7C1C0A00, // 0090 CALL R7 5 + 0x80040E00, // 0091 RET 1 R7 + 0x501C0000, // 0092 LDBOOL R7 0 0 + 0x80040E00, // 0093 RET 1 R7 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: process_write_request +********************************************************************/ +be_local_closure(Matter_IM_process_write_request, /* name */ + be_nested_proto( + 11, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(WriteRequestMessage), + /* K3 */ be_nested_str_weak(from_TLV), + /* K4 */ be_nested_str_weak(tasmota), + /* K5 */ be_nested_str_weak(log), + /* K6 */ be_nested_str_weak(MTR_X3A_X20received_X20WriteRequestMessage_X3D), + /* K7 */ be_const_int(3), + }), + be_str_weak(process_write_request), + &be_const_str_solidified, + ( &(const binstruction[17]) { /* code */ + 0xA4160000, // 0000 IMPORT R5 K0 + 0xB81A0200, // 0001 GETNGBL R6 K1 + 0x8C180D02, // 0002 GETMET R6 R6 K2 + 0x7C180200, // 0003 CALL R6 1 + 0x8C180D03, // 0004 GETMET R6 R6 K3 + 0x5C200400, // 0005 MOVE R8 R2 + 0x7C180400, // 0006 CALL R6 2 + 0xB81E0800, // 0007 GETNGBL R7 K4 + 0x8C1C0F05, // 0008 GETMET R7 R7 K5 + 0x60240008, // 0009 GETGBL R9 G8 + 0x5C280C00, // 000A MOVE R10 R6 + 0x7C240200, // 000B CALL R9 1 + 0x00260C09, // 000C ADD R9 K6 R9 + 0x58280007, // 000D LDCONST R10 K7 + 0x7C1C0600, // 000E CALL R7 3 + 0x501C0000, // 000F LDBOOL R7 0 0 + 0x80040E00, // 0010 RET 1 R7 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: process_invoke_request +********************************************************************/ +be_local_closure(Matter_IM_process_invoke_request, /* name */ + be_nested_proto( + 20, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[50]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(tasmota), + /* K2 */ be_nested_str_weak(log), + /* K3 */ be_nested_str_weak(MTR_X3A_X20IM_X3Ainvoke_request_X20processing_X20start), + /* K4 */ be_const_int(3), + /* K5 */ be_nested_str_weak(matter), + /* K6 */ be_nested_str_weak(Response_container), + /* K7 */ be_nested_str_weak(InvokeRequestMessage), + /* K8 */ be_nested_str_weak(from_TLV), + /* K9 */ be_nested_str_weak(invoke_requests), + /* K10 */ be_nested_str_weak(InvokeResponseMessage), + /* K11 */ be_nested_str_weak(suppress_response), + /* K12 */ be_nested_str_weak(invoke_responses), + /* K13 */ be_nested_str_weak(endpoint), + /* K14 */ be_nested_str_weak(command_path), + /* K15 */ be_nested_str_weak(cluster), + /* K16 */ be_nested_str_weak(command), + /* K17 */ be_nested_str_weak(status), + /* K18 */ be_nested_str_weak(UNSUPPORTED_COMMAND), + /* K19 */ be_nested_str_weak(get_command_name), + /* K20 */ be_nested_str_weak(format), + /* K21 */ be_nested_str_weak(0x_X2504X_X2F0x02X), + /* K22 */ be_nested_str_weak(MTR_X3A_X20_X3EReceived_cmd_X20_X20_X25s_X20from_X20_X5B_X25s_X5D_X3A_X25i), + /* K23 */ be_const_int(2), + /* K24 */ be_nested_str_weak(responder), + /* K25 */ be_nested_str_weak(device), + /* K26 */ be_nested_str_weak(invoke_request), + /* K27 */ be_nested_str_weak(command_fields), + /* K28 */ be_nested_str_weak(InvokeResponseIB), + /* K29 */ be_nested_str_weak(CommandDataIB), + /* K30 */ be_nested_str_weak(CommandPathIB), + /* K31 */ be_nested_str_weak(push), + /* K32 */ be_nested_str_weak(0x_X2504X_X2F0x_X2502X), + /* K33 */ be_nested_str_weak(MTR_X3A_X20_X3CReplied_cmd_X20_X20_X20_X25s), + /* K34 */ be_nested_str_weak(CommandStatusIB), + /* K35 */ be_nested_str_weak(StatusIB), + /* K36 */ be_nested_str_weak(stop_iteration), + /* K37 */ be_nested_str_weak(MTR_X3A_X20invoke_responses_X3D), + /* K38 */ be_const_int(0), + /* K39 */ be_nested_str_weak(MTR_X3A_X20InvokeResponse_X3D), + /* K40 */ be_nested_str_weak(MTR_X3A_X20InvokeResponseTLV_X3D), + /* K41 */ be_nested_str_weak(to_TLV), + /* K42 */ be_nested_str_weak(build_response), + /* K43 */ be_nested_str_weak(encode), + /* K44 */ be_nested_str_weak(encrypt), + /* K45 */ be_nested_str_weak(send_response), + /* K46 */ be_nested_str_weak(raw), + /* K47 */ be_nested_str_weak(message_counter), + /* K48 */ be_nested_str_weak(x_flag_r), + /* K49 */ be_nested_str_weak(build_standalone_ack), + }), + be_str_weak(process_invoke_request), + &be_const_str_solidified, + ( &(const binstruction[242]) { /* code */ + 0xA4160000, // 0000 IMPORT R5 K0 + 0xB81A0200, // 0001 GETNGBL R6 K1 + 0x8C180D02, // 0002 GETMET R6 R6 K2 + 0x58200003, // 0003 LDCONST R8 K3 + 0x58240004, // 0004 LDCONST R9 K4 + 0x7C180600, // 0005 CALL R6 3 + 0xB81A0A00, // 0006 GETNGBL R6 K5 + 0x8C180D06, // 0007 GETMET R6 R6 K6 + 0x7C180200, // 0008 CALL R6 1 + 0xB81E0A00, // 0009 GETNGBL R7 K5 + 0x8C1C0F07, // 000A GETMET R7 R7 K7 + 0x7C1C0200, // 000B CALL R7 1 + 0x8C1C0F08, // 000C GETMET R7 R7 K8 + 0x5C240400, // 000D MOVE R9 R2 + 0x7C1C0400, // 000E CALL R7 2 + 0x88200F09, // 000F GETMBR R8 R7 K9 + 0x4C240000, // 0010 LDNIL R9 + 0x20201009, // 0011 NE R8 R8 R9 + 0x782200DD, // 0012 JMPF R8 #00F1 + 0xB8220A00, // 0013 GETNGBL R8 K5 + 0x8C20110A, // 0014 GETMET R8 R8 K10 + 0x7C200200, // 0015 CALL R8 1 + 0x50240000, // 0016 LDBOOL R9 0 0 + 0x90221609, // 0017 SETMBR R8 K11 R9 + 0x60240012, // 0018 GETGBL R9 G18 + 0x7C240000, // 0019 CALL R9 0 + 0x90221809, // 001A SETMBR R8 K12 R9 + 0x60240010, // 001B GETGBL R9 G16 + 0x88280F09, // 001C GETMBR R10 R7 K9 + 0x7C240200, // 001D CALL R9 1 + 0xA802008D, // 001E EXBLK 0 #00AD + 0x5C281200, // 001F MOVE R10 R9 + 0x7C280000, // 0020 CALL R10 0 + 0x882C150E, // 0021 GETMBR R11 R10 K14 + 0x882C170D, // 0022 GETMBR R11 R11 K13 + 0x901A1A0B, // 0023 SETMBR R6 K13 R11 + 0x882C150E, // 0024 GETMBR R11 R10 K14 + 0x882C170F, // 0025 GETMBR R11 R11 K15 + 0x901A1E0B, // 0026 SETMBR R6 K15 R11 + 0x882C150E, // 0027 GETMBR R11 R10 K14 + 0x882C1710, // 0028 GETMBR R11 R11 K16 + 0x901A200B, // 0029 SETMBR R6 K16 R11 + 0xB82E0A00, // 002A GETNGBL R11 K5 + 0x882C1712, // 002B GETMBR R11 R11 K18 + 0x901A220B, // 002C SETMBR R6 K17 R11 + 0xB82E0A00, // 002D GETNGBL R11 K5 + 0x8C2C1713, // 002E GETMET R11 R11 K19 + 0x88340D0F, // 002F GETMBR R13 R6 K15 + 0x88380D10, // 0030 GETMBR R14 R6 K16 + 0x7C2C0600, // 0031 CALL R11 3 + 0x4C300000, // 0032 LDNIL R12 + 0x1C30160C, // 0033 EQ R12 R11 R12 + 0x78320005, // 0034 JMPF R12 #003B + 0x8C300B14, // 0035 GETMET R12 R5 K20 + 0x58380015, // 0036 LDCONST R14 K21 + 0x883C0D0F, // 0037 GETMBR R15 R6 K15 + 0x88400D10, // 0038 GETMBR R16 R6 K16 + 0x7C300800, // 0039 CALL R12 4 + 0x5C2C1800, // 003A MOVE R11 R12 + 0xB8320200, // 003B GETNGBL R12 K1 + 0x8C301902, // 003C GETMET R12 R12 K2 + 0x8C380B14, // 003D GETMET R14 R5 K20 + 0x58400016, // 003E LDCONST R16 K22 + 0x5C441600, // 003F MOVE R17 R11 + 0x5C480600, // 0040 MOVE R18 R3 + 0x5C4C0800, // 0041 MOVE R19 R4 + 0x7C380A00, // 0042 CALL R14 5 + 0x583C0017, // 0043 LDCONST R15 K23 + 0x7C300600, // 0044 CALL R12 3 + 0x88300118, // 0045 GETMBR R12 R0 K24 + 0x88301919, // 0046 GETMBR R12 R12 K25 + 0x8C30191A, // 0047 GETMET R12 R12 K26 + 0x5C380200, // 0048 MOVE R14 R1 + 0x883C151B, // 0049 GETMBR R15 R10 K27 + 0x5C400C00, // 004A MOVE R16 R6 + 0x7C300800, // 004B CALL R12 4 + 0xB8360A00, // 004C GETNGBL R13 K5 + 0x8C341B1C, // 004D GETMET R13 R13 K28 + 0x7C340200, // 004E CALL R13 1 + 0x4C380000, // 004F LDNIL R14 + 0x2038180E, // 0050 NE R14 R12 R14 + 0x783A0032, // 0051 JMPF R14 #0085 + 0xB83A0A00, // 0052 GETNGBL R14 K5 + 0x8C381D1D, // 0053 GETMET R14 R14 K29 + 0x7C380200, // 0054 CALL R14 1 + 0x9036200E, // 0055 SETMBR R13 K16 R14 + 0x88381B10, // 0056 GETMBR R14 R13 K16 + 0xB83E0A00, // 0057 GETNGBL R15 K5 + 0x8C3C1F1E, // 0058 GETMET R15 R15 K30 + 0x7C3C0200, // 0059 CALL R15 1 + 0x903A1C0F, // 005A SETMBR R14 K14 R15 + 0x88381B10, // 005B GETMBR R14 R13 K16 + 0x88381D0E, // 005C GETMBR R14 R14 K14 + 0x883C0D0D, // 005D GETMBR R15 R6 K13 + 0x903A1A0F, // 005E SETMBR R14 K13 R15 + 0x88381B10, // 005F GETMBR R14 R13 K16 + 0x88381D0E, // 0060 GETMBR R14 R14 K14 + 0x883C0D0F, // 0061 GETMBR R15 R6 K15 + 0x903A1E0F, // 0062 SETMBR R14 K15 R15 + 0x88381B10, // 0063 GETMBR R14 R13 K16 + 0x88381D0E, // 0064 GETMBR R14 R14 K14 + 0x883C0D10, // 0065 GETMBR R15 R6 K16 + 0x903A200F, // 0066 SETMBR R14 K16 R15 + 0x88381B10, // 0067 GETMBR R14 R13 K16 + 0x903A360C, // 0068 SETMBR R14 K27 R12 + 0x8838110C, // 0069 GETMBR R14 R8 K12 + 0x8C381D1F, // 006A GETMET R14 R14 K31 + 0x5C401A00, // 006B MOVE R16 R13 + 0x7C380400, // 006C CALL R14 2 + 0xB83A0A00, // 006D GETNGBL R14 K5 + 0x8C381D13, // 006E GETMET R14 R14 K19 + 0x88400D0F, // 006F GETMBR R16 R6 K15 + 0x88440D10, // 0070 GETMBR R17 R6 K16 + 0x7C380600, // 0071 CALL R14 3 + 0x5C2C1C00, // 0072 MOVE R11 R14 + 0x4C380000, // 0073 LDNIL R14 + 0x1C38160E, // 0074 EQ R14 R11 R14 + 0x783A0005, // 0075 JMPF R14 #007C + 0x8C380B14, // 0076 GETMET R14 R5 K20 + 0x58400020, // 0077 LDCONST R16 K32 + 0x88440D0F, // 0078 GETMBR R17 R6 K15 + 0x88480D10, // 0079 GETMBR R18 R6 K16 + 0x7C380800, // 007A CALL R14 4 + 0x5C2C1C00, // 007B MOVE R11 R14 + 0xB83A0200, // 007C GETNGBL R14 K1 + 0x8C381D02, // 007D GETMET R14 R14 K2 + 0x8C400B14, // 007E GETMET R16 R5 K20 + 0x58480021, // 007F LDCONST R18 K33 + 0x5C4C1600, // 0080 MOVE R19 R11 + 0x7C400600, // 0081 CALL R16 3 + 0x58440017, // 0082 LDCONST R17 K23 + 0x7C380600, // 0083 CALL R14 3 + 0x70020026, // 0084 JMP #00AC + 0x88380D11, // 0085 GETMBR R14 R6 K17 + 0x4C3C0000, // 0086 LDNIL R15 + 0x20381C0F, // 0087 NE R14 R14 R15 + 0x783A0022, // 0088 JMPF R14 #00AC + 0xB83A0A00, // 0089 GETNGBL R14 K5 + 0x8C381D22, // 008A GETMET R14 R14 K34 + 0x7C380200, // 008B CALL R14 1 + 0x9036220E, // 008C SETMBR R13 K17 R14 + 0x88381B11, // 008D GETMBR R14 R13 K17 + 0xB83E0A00, // 008E GETNGBL R15 K5 + 0x8C3C1F1E, // 008F GETMET R15 R15 K30 + 0x7C3C0200, // 0090 CALL R15 1 + 0x903A1C0F, // 0091 SETMBR R14 K14 R15 + 0x88381B11, // 0092 GETMBR R14 R13 K17 + 0x88381D0E, // 0093 GETMBR R14 R14 K14 + 0x883C0D0D, // 0094 GETMBR R15 R6 K13 + 0x903A1A0F, // 0095 SETMBR R14 K13 R15 + 0x88381B11, // 0096 GETMBR R14 R13 K17 + 0x88381D0E, // 0097 GETMBR R14 R14 K14 + 0x883C0D0F, // 0098 GETMBR R15 R6 K15 + 0x903A1E0F, // 0099 SETMBR R14 K15 R15 + 0x88381B11, // 009A GETMBR R14 R13 K17 + 0x88381D0E, // 009B GETMBR R14 R14 K14 + 0x883C0D10, // 009C GETMBR R15 R6 K16 + 0x903A200F, // 009D SETMBR R14 K16 R15 + 0x88381B11, // 009E GETMBR R14 R13 K17 + 0xB83E0A00, // 009F GETNGBL R15 K5 + 0x8C3C1F23, // 00A0 GETMET R15 R15 K35 + 0x7C3C0200, // 00A1 CALL R15 1 + 0x903A220F, // 00A2 SETMBR R14 K17 R15 + 0x88381B11, // 00A3 GETMBR R14 R13 K17 + 0x88381D11, // 00A4 GETMBR R14 R14 K17 + 0x883C0D11, // 00A5 GETMBR R15 R6 K17 + 0x903A220F, // 00A6 SETMBR R14 K17 R15 + 0x8838110C, // 00A7 GETMBR R14 R8 K12 + 0x8C381D1F, // 00A8 GETMET R14 R14 K31 + 0x5C401A00, // 00A9 MOVE R16 R13 + 0x7C380400, // 00AA CALL R14 2 + 0x7001FFFF, // 00AB JMP #00AC + 0x7001FF71, // 00AC JMP #001F + 0x58240024, // 00AD LDCONST R9 K36 + 0xAC240200, // 00AE CATCH R9 1 0 + 0xB0080000, // 00AF RAISE 2 R0 R0 + 0xB8260200, // 00B0 GETNGBL R9 K1 + 0x8C241302, // 00B1 GETMET R9 R9 K2 + 0x602C0008, // 00B2 GETGBL R11 G8 + 0x8830110C, // 00B3 GETMBR R12 R8 K12 + 0x7C2C0200, // 00B4 CALL R11 1 + 0x002E4A0B, // 00B5 ADD R11 K37 R11 + 0x58300004, // 00B6 LDCONST R12 K4 + 0x7C240600, // 00B7 CALL R9 3 + 0x6024000C, // 00B8 GETGBL R9 G12 + 0x8828110C, // 00B9 GETMBR R10 R8 K12 + 0x7C240200, // 00BA CALL R9 1 + 0x24241326, // 00BB GT R9 R9 K38 + 0x78260024, // 00BC JMPF R9 #00E2 + 0xB8260200, // 00BD GETNGBL R9 K1 + 0x8C241302, // 00BE GETMET R9 R9 K2 + 0x602C0008, // 00BF GETGBL R11 G8 + 0x5C301000, // 00C0 MOVE R12 R8 + 0x7C2C0200, // 00C1 CALL R11 1 + 0x002E4E0B, // 00C2 ADD R11 K39 R11 + 0x58300004, // 00C3 LDCONST R12 K4 + 0x7C240600, // 00C4 CALL R9 3 + 0xB8260200, // 00C5 GETNGBL R9 K1 + 0x8C241302, // 00C6 GETMET R9 R9 K2 + 0x602C0008, // 00C7 GETGBL R11 G8 + 0x8C301129, // 00C8 GETMET R12 R8 K41 + 0x7C300200, // 00C9 CALL R12 1 + 0x7C2C0200, // 00CA CALL R11 1 + 0x002E500B, // 00CB ADD R11 K40 R11 + 0x58300004, // 00CC LDCONST R12 K4 + 0x7C240600, // 00CD CALL R9 3 + 0x8C24032A, // 00CE GETMET R9 R1 K42 + 0x542E0008, // 00CF LDINT R11 9 + 0x50300200, // 00D0 LDBOOL R12 1 0 + 0x7C240600, // 00D1 CALL R9 3 + 0x8C28132B, // 00D2 GETMET R10 R9 K43 + 0x8C301129, // 00D3 GETMET R12 R8 K41 + 0x7C300200, // 00D4 CALL R12 1 + 0x8C30192B, // 00D5 GETMET R12 R12 K43 + 0x7C300200, // 00D6 CALL R12 1 + 0x7C280400, // 00D7 CALL R10 2 + 0x8C28132C, // 00D8 GETMET R10 R9 K44 + 0x7C280200, // 00D9 CALL R10 1 + 0x88280118, // 00DA GETMBR R10 R0 K24 + 0x8C28152D, // 00DB GETMET R10 R10 K45 + 0x8830132E, // 00DC GETMBR R12 R9 K46 + 0x5C340600, // 00DD MOVE R13 R3 + 0x5C380800, // 00DE MOVE R14 R4 + 0x883C132F, // 00DF GETMBR R15 R9 K47 + 0x7C280A00, // 00E0 CALL R10 5 + 0x7002000E, // 00E1 JMP #00F1 + 0x88240330, // 00E2 GETMBR R9 R1 K48 + 0x7826000C, // 00E3 JMPF R9 #00F1 + 0x8C240331, // 00E4 GETMET R9 R1 K49 + 0x7C240200, // 00E5 CALL R9 1 + 0x8C28132B, // 00E6 GETMET R10 R9 K43 + 0x7C280200, // 00E7 CALL R10 1 + 0x8C28132C, // 00E8 GETMET R10 R9 K44 + 0x7C280200, // 00E9 CALL R10 1 + 0x88280118, // 00EA GETMBR R10 R0 K24 + 0x8C28152D, // 00EB GETMET R10 R10 K45 + 0x8830132E, // 00EC GETMBR R12 R9 K46 + 0x5C340600, // 00ED MOVE R13 R3 + 0x5C380800, // 00EE MOVE R14 R4 + 0x883C132F, // 00EF GETMBR R15 R9 K47 + 0x7C280A00, // 00F0 CALL R10 5 + 0x80000000, // 00F1 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: subscribe_response +********************************************************************/ +be_local_closure(Matter_IM_subscribe_response, /* name */ + be_nested_proto( + 11, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(SubscribeResponseMessage), + /* K3 */ be_nested_str_weak(from_TLV), + /* K4 */ be_nested_str_weak(tasmota), + /* K5 */ be_nested_str_weak(log), + /* K6 */ be_nested_str_weak(MTR_X3A_X20received_X20SubscribeResponsetMessage_X3D), + /* K7 */ be_const_int(3), + }), + be_str_weak(subscribe_response), + &be_const_str_solidified, + ( &(const binstruction[17]) { /* code */ + 0xA4160000, // 0000 IMPORT R5 K0 + 0xB81A0200, // 0001 GETNGBL R6 K1 + 0x8C180D02, // 0002 GETMET R6 R6 K2 + 0x7C180200, // 0003 CALL R6 1 + 0x8C180D03, // 0004 GETMET R6 R6 K3 + 0x5C200400, // 0005 MOVE R8 R2 + 0x7C180400, // 0006 CALL R6 2 + 0xB81E0800, // 0007 GETNGBL R7 K4 + 0x8C1C0F05, // 0008 GETMET R7 R7 K5 + 0x60240008, // 0009 GETGBL R9 G8 + 0x5C280C00, // 000A MOVE R10 R6 + 0x7C240200, // 000B CALL R9 1 + 0x00260C09, // 000C ADD R9 K6 R9 + 0x58280007, // 000D LDCONST R10 K7 + 0x7C1C0600, // 000E CALL R7 3 + 0x501C0000, // 000F LDBOOL R7 0 0 + 0x80040E00, // 0010 RET 1 R7 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: subscribe_request +********************************************************************/ +be_local_closure(Matter_IM_subscribe_request, /* name */ + be_nested_proto( + 11, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(SubscribeRequestMessage), + /* K3 */ be_nested_str_weak(from_TLV), + /* K4 */ be_nested_str_weak(tasmota), + /* K5 */ be_nested_str_weak(log), + /* K6 */ be_nested_str_weak(MTR_X3A_X20received_X20SubscribeRequestMessage_X3D), + /* K7 */ be_const_int(3), + }), + be_str_weak(subscribe_request), + &be_const_str_solidified, + ( &(const binstruction[17]) { /* code */ + 0xA4160000, // 0000 IMPORT R5 K0 + 0xB81A0200, // 0001 GETNGBL R6 K1 + 0x8C180D02, // 0002 GETMET R6 R6 K2 + 0x7C180200, // 0003 CALL R6 1 + 0x8C180D03, // 0004 GETMET R6 R6 K3 + 0x5C200400, // 0005 MOVE R8 R2 + 0x7C180400, // 0006 CALL R6 2 + 0xB81E0800, // 0007 GETNGBL R7 K4 + 0x8C1C0F05, // 0008 GETMET R7 R7 K5 + 0x60240008, // 0009 GETGBL R9 G8 + 0x5C280C00, // 000A MOVE R10 R6 + 0x7C240200, // 000B CALL R9 1 + 0x00260C09, // 000C ADD R9 K6 R9 + 0x58280007, // 000D LDCONST R10 K7 + 0x7C1C0600, // 000E CALL R7 3 + 0x501C0000, // 000F LDBOOL R7 0 0 + 0x80040E00, // 0010 RET 1 R7 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: process_read_request +********************************************************************/ +be_local_closure(Matter_IM_process_read_request, /* name */ + be_nested_proto( + 16, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[43]) { /* constants */ + /* K0 */ be_nested_str_weak(tasmota), + /* K1 */ be_nested_str_weak(log), + /* K2 */ be_nested_str_weak(MTR_X3A_X20IM_X3Aread_request_X20processing_X20start), + /* K3 */ be_const_int(3), + /* K4 */ be_nested_str_weak(matter), + /* K5 */ be_nested_str_weak(ReadRequestMessage), + /* K6 */ be_nested_str_weak(from_TLV), + /* K7 */ be_nested_str_weak(attributes_requests), + /* K8 */ be_nested_str_weak(ReportDataMessage), + /* K9 */ be_nested_str_weak(suppress_response), + /* K10 */ be_nested_str_weak(attribute_reports), + /* K11 */ be_nested_str_weak(get_attribute_name), + /* K12 */ be_nested_str_weak(cluster), + /* K13 */ be_nested_str_weak(attribute), + /* K14 */ be_nested_str_weak(MTR_X3A_X20Read_X20Attribute_X20), + /* K15 */ be_nested_str_weak(_X20_X28), + /* K16 */ be_nested_str_weak(_X29), + /* K17 */ be_nested_str_weak(), + /* K18 */ be_const_int(2), + /* K19 */ be_nested_str_weak(responder), + /* K20 */ be_nested_str_weak(device), + /* K21 */ be_nested_str_weak(read_attribute), + /* K22 */ be_nested_str_weak(endpoint), + /* K23 */ be_nested_str_weak(AttributeReportIB), + /* K24 */ be_nested_str_weak(attribute_data), + /* K25 */ be_nested_str_weak(AttributeDataIB), + /* K26 */ be_nested_str_weak(data_version), + /* K27 */ be_const_int(1), + /* K28 */ be_nested_str_weak(path), + /* K29 */ be_nested_str_weak(AttributePathIB), + /* K30 */ be_const_int(0), + /* K31 */ be_nested_str_weak(data), + /* K32 */ be_nested_str_weak(push), + /* K33 */ be_nested_str_weak(stop_iteration), + /* K34 */ be_nested_str_weak(MTR_X3A_X20ReportDataMessage_X3D), + /* K35 */ be_nested_str_weak(MTR_X3A_X20ReportDataMessageTLV_X3D), + /* K36 */ be_nested_str_weak(to_TLV), + /* K37 */ be_nested_str_weak(build_response), + /* K38 */ be_nested_str_weak(encode), + /* K39 */ be_nested_str_weak(encrypt), + /* K40 */ be_nested_str_weak(send_response), + /* K41 */ be_nested_str_weak(raw), + /* K42 */ be_nested_str_weak(message_counter), + }), + be_str_weak(process_read_request), + &be_const_str_solidified, + ( &(const binstruction[132]) { /* code */ + 0xB8160000, // 0000 GETNGBL R5 K0 + 0x8C140B01, // 0001 GETMET R5 R5 K1 + 0x581C0002, // 0002 LDCONST R7 K2 + 0x58200003, // 0003 LDCONST R8 K3 + 0x7C140600, // 0004 CALL R5 3 + 0xB8160800, // 0005 GETNGBL R5 K4 + 0x8C140B05, // 0006 GETMET R5 R5 K5 + 0x7C140200, // 0007 CALL R5 1 + 0x8C140B06, // 0008 GETMET R5 R5 K6 + 0x5C1C0400, // 0009 MOVE R7 R2 + 0x7C140400, // 000A CALL R5 2 + 0x88180B07, // 000B GETMBR R6 R5 K7 + 0x4C1C0000, // 000C LDNIL R7 + 0x20180C07, // 000D NE R6 R6 R7 + 0x781A0072, // 000E JMPF R6 #0082 + 0xB81A0800, // 000F GETNGBL R6 K4 + 0x8C180D08, // 0010 GETMET R6 R6 K8 + 0x7C180200, // 0011 CALL R6 1 + 0x501C0200, // 0012 LDBOOL R7 1 0 + 0x901A1207, // 0013 SETMBR R6 K9 R7 + 0x601C0012, // 0014 GETGBL R7 G18 + 0x7C1C0000, // 0015 CALL R7 0 + 0x901A1407, // 0016 SETMBR R6 K10 R7 + 0x601C0010, // 0017 GETGBL R7 G16 + 0x88200B07, // 0018 GETMBR R8 R5 K7 + 0x7C1C0200, // 0019 CALL R7 1 + 0xA802003F, // 001A EXBLK 0 #005B + 0x5C200E00, // 001B MOVE R8 R7 + 0x7C200000, // 001C CALL R8 0 + 0xB8260800, // 001D GETNGBL R9 K4 + 0x8C24130B, // 001E GETMET R9 R9 K11 + 0x882C110C, // 001F GETMBR R11 R8 K12 + 0x8830110D, // 0020 GETMBR R12 R8 K13 + 0x7C240600, // 0021 CALL R9 3 + 0xB82A0000, // 0022 GETNGBL R10 K0 + 0x8C281501, // 0023 GETMET R10 R10 K1 + 0x60300008, // 0024 GETGBL R12 G8 + 0x5C341000, // 0025 MOVE R13 R8 + 0x7C300200, // 0026 CALL R12 1 + 0x00321C0C, // 0027 ADD R12 K14 R12 + 0x78260002, // 0028 JMPF R9 #002C + 0x00361E09, // 0029 ADD R13 K15 R9 + 0x00341B10, // 002A ADD R13 R13 K16 + 0x70020000, // 002B JMP #002D + 0x58340011, // 002C LDCONST R13 K17 + 0x0030180D, // 002D ADD R12 R12 R13 + 0x58340012, // 002E LDCONST R13 K18 + 0x7C280600, // 002F CALL R10 3 + 0x88280113, // 0030 GETMBR R10 R0 K19 + 0x88281514, // 0031 GETMBR R10 R10 K20 + 0x8C281515, // 0032 GETMET R10 R10 K21 + 0x5C300200, // 0033 MOVE R12 R1 + 0x88341116, // 0034 GETMBR R13 R8 K22 + 0x8838110C, // 0035 GETMBR R14 R8 K12 + 0x883C110D, // 0036 GETMBR R15 R8 K13 + 0x7C280A00, // 0037 CALL R10 5 + 0x4C2C0000, // 0038 LDNIL R11 + 0x202C140B, // 0039 NE R11 R10 R11 + 0x782E001E, // 003A JMPF R11 #005A + 0xB82E0800, // 003B GETNGBL R11 K4 + 0x8C2C1717, // 003C GETMET R11 R11 K23 + 0x7C2C0200, // 003D CALL R11 1 + 0xB8320800, // 003E GETNGBL R12 K4 + 0x8C301919, // 003F GETMET R12 R12 K25 + 0x7C300200, // 0040 CALL R12 1 + 0x902E300C, // 0041 SETMBR R11 K24 R12 + 0x88301718, // 0042 GETMBR R12 R11 K24 + 0x9032351B, // 0043 SETMBR R12 K26 K27 + 0x88301718, // 0044 GETMBR R12 R11 K24 + 0xB8360800, // 0045 GETNGBL R13 K4 + 0x8C341B1D, // 0046 GETMET R13 R13 K29 + 0x7C340200, // 0047 CALL R13 1 + 0x9032380D, // 0048 SETMBR R12 K28 R13 + 0x88301718, // 0049 GETMBR R12 R11 K24 + 0x8830191C, // 004A GETMBR R12 R12 K28 + 0x90322D1E, // 004B SETMBR R12 K22 K30 + 0x88301718, // 004C GETMBR R12 R11 K24 + 0x8830191C, // 004D GETMBR R12 R12 K28 + 0x8834110C, // 004E GETMBR R13 R8 K12 + 0x9032180D, // 004F SETMBR R12 K12 R13 + 0x88301718, // 0050 GETMBR R12 R11 K24 + 0x8830191C, // 0051 GETMBR R12 R12 K28 + 0x8834110D, // 0052 GETMBR R13 R8 K13 + 0x90321A0D, // 0053 SETMBR R12 K13 R13 + 0x88301718, // 0054 GETMBR R12 R11 K24 + 0x90323E0A, // 0055 SETMBR R12 K31 R10 + 0x88300D0A, // 0056 GETMBR R12 R6 K10 + 0x8C301920, // 0057 GETMET R12 R12 K32 + 0x5C381600, // 0058 MOVE R14 R11 + 0x7C300400, // 0059 CALL R12 2 + 0x7001FFBF, // 005A JMP #001B + 0x581C0021, // 005B LDCONST R7 K33 + 0xAC1C0200, // 005C CATCH R7 1 0 + 0xB0080000, // 005D RAISE 2 R0 R0 + 0xB81E0000, // 005E GETNGBL R7 K0 + 0x8C1C0F01, // 005F GETMET R7 R7 K1 + 0x60240008, // 0060 GETGBL R9 G8 + 0x5C280C00, // 0061 MOVE R10 R6 + 0x7C240200, // 0062 CALL R9 1 + 0x00264409, // 0063 ADD R9 K34 R9 + 0x58280003, // 0064 LDCONST R10 K3 + 0x7C1C0600, // 0065 CALL R7 3 + 0xB81E0000, // 0066 GETNGBL R7 K0 + 0x8C1C0F01, // 0067 GETMET R7 R7 K1 + 0x60240008, // 0068 GETGBL R9 G8 + 0x8C280D24, // 0069 GETMET R10 R6 K36 + 0x7C280200, // 006A CALL R10 1 + 0x7C240200, // 006B CALL R9 1 + 0x00264609, // 006C ADD R9 K35 R9 + 0x58280003, // 006D LDCONST R10 K3 + 0x7C1C0600, // 006E CALL R7 3 + 0x8C1C0325, // 006F GETMET R7 R1 K37 + 0x54260004, // 0070 LDINT R9 5 + 0x50280200, // 0071 LDBOOL R10 1 0 + 0x7C1C0600, // 0072 CALL R7 3 + 0x8C200F26, // 0073 GETMET R8 R7 K38 + 0x8C280D24, // 0074 GETMET R10 R6 K36 + 0x7C280200, // 0075 CALL R10 1 + 0x8C281526, // 0076 GETMET R10 R10 K38 + 0x7C280200, // 0077 CALL R10 1 + 0x7C200400, // 0078 CALL R8 2 + 0x8C200F27, // 0079 GETMET R8 R7 K39 + 0x7C200200, // 007A CALL R8 1 + 0x88200113, // 007B GETMBR R8 R0 K19 + 0x8C201128, // 007C GETMET R8 R8 K40 + 0x88280F29, // 007D GETMBR R10 R7 K41 + 0x5C2C0600, // 007E MOVE R11 R3 + 0x5C300800, // 007F MOVE R12 R4 + 0x88340F2A, // 0080 GETMBR R13 R7 K42 + 0x7C200A00, // 0081 CALL R8 5 + 0x50180200, // 0082 LDBOOL R6 1 0 + 0x80040C00, // 0083 RET 1 R6 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: report_data +********************************************************************/ +be_local_closure(Matter_IM_report_data, /* name */ + be_nested_proto( + 11, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(ReportDataMessage), + /* K3 */ be_nested_str_weak(from_TLV), + /* K4 */ be_nested_str_weak(tasmota), + /* K5 */ be_nested_str_weak(log), + /* K6 */ be_nested_str_weak(MTR_X3A_X20received_X20ReportDataMessage_X3D), + /* K7 */ be_const_int(3), + }), + be_str_weak(report_data), + &be_const_str_solidified, + ( &(const binstruction[17]) { /* code */ + 0xA4160000, // 0000 IMPORT R5 K0 + 0xB81A0200, // 0001 GETNGBL R6 K1 + 0x8C180D02, // 0002 GETMET R6 R6 K2 + 0x7C180200, // 0003 CALL R6 1 + 0x8C180D03, // 0004 GETMET R6 R6 K3 + 0x5C200400, // 0005 MOVE R8 R2 + 0x7C180400, // 0006 CALL R6 2 + 0xB81E0800, // 0007 GETNGBL R7 K4 + 0x8C1C0F05, // 0008 GETMET R7 R7 K5 + 0x60240008, // 0009 GETGBL R9 G8 + 0x5C280C00, // 000A MOVE R10 R6 + 0x7C240200, // 000B CALL R9 1 + 0x00260C09, // 000C ADD R9 K6 R9 + 0x58280007, // 000D LDCONST R10 K7 + 0x7C1C0600, // 000E CALL R7 3 + 0x501C0000, // 000F LDBOOL R7 0 0 + 0x80040E00, // 0010 RET 1 R7 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: process_invoke_response +********************************************************************/ +be_local_closure(Matter_IM_process_invoke_response, /* name */ + be_nested_proto( + 11, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(InvokeResponseMessage), + /* K3 */ be_nested_str_weak(from_TLV), + /* K4 */ be_nested_str_weak(tasmota), + /* K5 */ be_nested_str_weak(log), + /* K6 */ be_nested_str_weak(MTR_X3A_X20received_X20InvokeResponseMessage_X3D), + /* K7 */ be_const_int(3), + }), + be_str_weak(process_invoke_response), + &be_const_str_solidified, + ( &(const binstruction[17]) { /* code */ + 0xA4160000, // 0000 IMPORT R5 K0 + 0xB81A0200, // 0001 GETNGBL R6 K1 + 0x8C180D02, // 0002 GETMET R6 R6 K2 + 0x7C180200, // 0003 CALL R6 1 + 0x8C180D03, // 0004 GETMET R6 R6 K3 + 0x5C200400, // 0005 MOVE R8 R2 + 0x7C180400, // 0006 CALL R6 2 + 0xB81E0800, // 0007 GETNGBL R7 K4 + 0x8C1C0F05, // 0008 GETMET R7 R7 K5 + 0x60240008, // 0009 GETGBL R9 G8 + 0x5C280C00, // 000A MOVE R10 R6 + 0x7C240200, // 000B CALL R9 1 + 0x00260C09, // 000C ADD R9 K6 R9 + 0x58280007, // 000D LDCONST R10 K7 + 0x7C1C0600, // 000E CALL R7 3 + 0x501C0000, // 000F LDBOOL R7 0 0 + 0x80040E00, // 0010 RET 1 R7 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_IM +********************************************************************/ +be_local_class(Matter_IM, + 1, + NULL, + be_nested_map(14, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(process_timed_request, -1), be_const_closure(Matter_IM_process_timed_request_closure) }, + { be_const_key_weak(process_status_response, -1), be_const_closure(Matter_IM_process_status_response_closure) }, + { be_const_key_weak(process_incoming, -1), be_const_closure(Matter_IM_process_incoming_closure) }, + { be_const_key_weak(every_second, -1), be_const_closure(Matter_IM_every_second_closure) }, + { be_const_key_weak(process_write_response, -1), be_const_closure(Matter_IM_process_write_response_closure) }, + { be_const_key_weak(init, 10), be_const_closure(Matter_IM_init_closure) }, + { be_const_key_weak(process_write_request, -1), be_const_closure(Matter_IM_process_write_request_closure) }, + { be_const_key_weak(process_invoke_request, 2), be_const_closure(Matter_IM_process_invoke_request_closure) }, + { be_const_key_weak(process_read_request, -1), be_const_closure(Matter_IM_process_read_request_closure) }, + { be_const_key_weak(subscribe_response, -1), be_const_closure(Matter_IM_subscribe_response_closure) }, + { be_const_key_weak(subscribe_request, 7), be_const_closure(Matter_IM_subscribe_request_closure) }, + { be_const_key_weak(responder, 8), be_const_var(0) }, + { be_const_key_weak(report_data, -1), be_const_closure(Matter_IM_report_data_closure) }, + { be_const_key_weak(process_invoke_response, -1), be_const_closure(Matter_IM_process_invoke_response_closure) }, + })), + be_str_weak(Matter_IM) +); +/*******************************************************************/ + +void be_load_Matter_IM_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_IM); + be_setglobal(vm, "Matter_IM"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_IM_Data.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_IM_Data.h new file mode 100644 index 000000000..b0fe641e7 --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_IM_Data.h @@ -0,0 +1,4020 @@ +/* Solidification of Matter_IM_Data.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_IM_base; + +/******************************************************************** +** Solidified function: to_TLV_array +********************************************************************/ +be_local_closure(Matter_IM_base_to_TLV_array, /* name */ + be_nested_proto( + 11, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(add_array), + /* K1 */ be_nested_str_weak(add_obj), + /* K2 */ be_nested_str_weak(stop_iteration), + }), + be_str_weak(to_TLV_array), + &be_const_str_solidified, + ( &(const binstruction[23]) { /* code */ + 0x4C100000, // 0000 LDNIL R4 + 0x1C100604, // 0001 EQ R4 R3 R4 + 0x78120001, // 0002 JMPF R4 #0005 + 0x4C100000, // 0003 LDNIL R4 + 0x80040800, // 0004 RET 1 R4 + 0x8C100300, // 0005 GETMET R4 R1 K0 + 0x5C180400, // 0006 MOVE R6 R2 + 0x7C100400, // 0007 CALL R4 2 + 0x60140010, // 0008 GETGBL R5 G16 + 0x5C180600, // 0009 MOVE R6 R3 + 0x7C140200, // 000A CALL R5 1 + 0xA8020006, // 000B EXBLK 0 #0013 + 0x5C180A00, // 000C MOVE R6 R5 + 0x7C180000, // 000D CALL R6 0 + 0x8C1C0901, // 000E GETMET R7 R4 K1 + 0x4C240000, // 000F LDNIL R9 + 0x5C280C00, // 0010 MOVE R10 R6 + 0x7C1C0600, // 0011 CALL R7 3 + 0x7001FFF8, // 0012 JMP #000C + 0x58140002, // 0013 LDCONST R5 K2 + 0xAC140200, // 0014 CATCH R5 1 0 + 0xB0080000, // 0015 RAISE 2 R0 R0 + 0x80000000, // 0016 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: tostring +********************************************************************/ +be_local_closure(Matter_IM_base_tostring, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(_X3C), + /* K1 */ be_nested_str_weak(_X3A), + /* K2 */ be_nested_str_weak(matter), + /* K3 */ be_nested_str_weak(inspect), + /* K4 */ be_nested_str_weak(_X3E), + }), + be_str_weak(tostring), + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x60040005, // 0000 GETGBL R1 G5 + 0x5C080000, // 0001 MOVE R2 R0 + 0x7C040200, // 0002 CALL R1 1 + 0x00060001, // 0003 ADD R1 K0 R1 + 0x00040301, // 0004 ADD R1 R1 K1 + 0xB80A0400, // 0005 GETNGBL R2 K2 + 0x8C080503, // 0006 GETMET R2 R2 K3 + 0x5C100000, // 0007 MOVE R4 R0 + 0x7C080400, // 0008 CALL R2 2 + 0x00040202, // 0009 ADD R1 R1 R2 + 0x00040304, // 000A ADD R1 R1 K4 + 0x80040200, // 000B RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: from_TLV_array +********************************************************************/ +be_local_closure(Matter_IM_base_from_TLV_array, /* name */ + be_nested_proto( + 11, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(push), + /* K1 */ be_nested_str_weak(from_TLV), + /* K2 */ be_nested_str_weak(stop_iteration), + }), + be_str_weak(from_TLV_array), + &be_const_str_solidified, + ( &(const binstruction[25]) { /* code */ + 0x4C0C0000, // 0000 LDNIL R3 + 0x1C0C0203, // 0001 EQ R3 R1 R3 + 0x780E0001, // 0002 JMPF R3 #0005 + 0x4C0C0000, // 0003 LDNIL R3 + 0x80040600, // 0004 RET 1 R3 + 0x600C0012, // 0005 GETGBL R3 G18 + 0x7C0C0000, // 0006 CALL R3 0 + 0x60100010, // 0007 GETGBL R4 G16 + 0x5C140200, // 0008 MOVE R5 R1 + 0x7C100200, // 0009 CALL R4 1 + 0xA8020009, // 000A EXBLK 0 #0015 + 0x5C140800, // 000B MOVE R5 R4 + 0x7C140000, // 000C CALL R5 0 + 0x8C180700, // 000D GETMET R6 R3 K0 + 0x5C200400, // 000E MOVE R8 R2 + 0x7C200000, // 000F CALL R8 0 + 0x8C201101, // 0010 GETMET R8 R8 K1 + 0x5C280A00, // 0011 MOVE R10 R5 + 0x7C200400, // 0012 CALL R8 2 + 0x7C180400, // 0013 CALL R6 2 + 0x7001FFF5, // 0014 JMP #000B + 0x58100002, // 0015 LDCONST R4 K2 + 0xAC100200, // 0016 CATCH R4 1 0 + 0xB0080000, // 0017 RAISE 2 R0 R0 + 0x80040600, // 0018 RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_IM_base +********************************************************************/ +be_local_class(Matter_IM_base, + 0, + NULL, + be_nested_map(3, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(from_TLV_array, -1), be_const_closure(Matter_IM_base_from_TLV_array_closure) }, + { be_const_key_weak(tostring, -1), be_const_closure(Matter_IM_base_tostring_closure) }, + { be_const_key_weak(to_TLV_array, 0), be_const_closure(Matter_IM_base_to_TLV_array_closure) }, + })), + be_str_weak(Matter_IM_base) +); +/*******************************************************************/ + +void be_load_Matter_IM_base_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_IM_base); + be_setglobal(vm, "Matter_IM_base"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_IM_Message_base; + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_IM_Message_base_init, /* name */ + be_nested_proto( + 1, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(InteractionModelRevision), + /* K1 */ be_const_int(1), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x90020101, // 0000 SETMBR R0 K0 K1 + 0x80000000, // 0001 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_IM_Message_base +********************************************************************/ +extern const bclass be_class_Matter_IM_base; +be_local_class(Matter_IM_Message_base, + 1, + &be_class_Matter_IM_base, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(init, -1), be_const_closure(Matter_IM_Message_base_init_closure) }, + { be_const_key_weak(InteractionModelRevision, 0), be_const_var(0) }, + })), + be_str_weak(Matter_IM_Message_base) +); +/*******************************************************************/ + +void be_load_Matter_IM_Message_base_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_IM_Message_base); + be_setglobal(vm, "Matter_IM_Message_base"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_AttributePathIB; + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_AttributePathIB_to_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[18]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_list), + /* K3 */ be_nested_str_weak(add_TLV), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(BOOL), + /* K6 */ be_nested_str_weak(tag_compression), + /* K7 */ be_const_int(1), + /* K8 */ be_nested_str_weak(U8), + /* K9 */ be_nested_str_weak(node), + /* K10 */ be_const_int(2), + /* K11 */ be_nested_str_weak(U2), + /* K12 */ be_nested_str_weak(endpoint), + /* K13 */ be_const_int(3), + /* K14 */ be_nested_str_weak(U4), + /* K15 */ be_nested_str_weak(cluster), + /* K16 */ be_nested_str_weak(attribute), + /* K17 */ be_nested_str_weak(list_index), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[35]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180305, // 0006 GETMBR R6 R1 K5 + 0x881C0106, // 0007 GETMBR R7 R0 K6 + 0x7C0C0800, // 0008 CALL R3 4 + 0x8C0C0503, // 0009 GETMET R3 R2 K3 + 0x58140007, // 000A LDCONST R5 K7 + 0x88180308, // 000B GETMBR R6 R1 K8 + 0x881C0109, // 000C GETMBR R7 R0 K9 + 0x7C0C0800, // 000D CALL R3 4 + 0x8C0C0503, // 000E GETMET R3 R2 K3 + 0x5814000A, // 000F LDCONST R5 K10 + 0x8818030B, // 0010 GETMBR R6 R1 K11 + 0x881C010C, // 0011 GETMBR R7 R0 K12 + 0x7C0C0800, // 0012 CALL R3 4 + 0x8C0C0503, // 0013 GETMET R3 R2 K3 + 0x5814000D, // 0014 LDCONST R5 K13 + 0x8818030E, // 0015 GETMBR R6 R1 K14 + 0x881C010F, // 0016 GETMBR R7 R0 K15 + 0x7C0C0800, // 0017 CALL R3 4 + 0x8C0C0503, // 0018 GETMET R3 R2 K3 + 0x54160003, // 0019 LDINT R5 4 + 0x8818030E, // 001A GETMBR R6 R1 K14 + 0x881C0110, // 001B GETMBR R7 R0 K16 + 0x7C0C0800, // 001C CALL R3 4 + 0x8C0C0503, // 001D GETMET R3 R2 K3 + 0x54160004, // 001E LDINT R5 5 + 0x8818030B, // 001F GETMBR R6 R1 K11 + 0x881C0111, // 0020 GETMBR R7 R0 K17 + 0x7C0C0800, // 0021 CALL R3 4 + 0x80040400, // 0022 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: tostring +********************************************************************/ +be_local_closure(Matter_AttributePathIB_tostring, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[16]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(), + /* K2 */ be_nested_str_weak(node), + /* K3 */ be_nested_str_weak(format), + /* K4 */ be_nested_str_weak(node_X3D_X25s_X20), + /* K5 */ be_nested_str_weak(endpoint), + /* K6 */ be_nested_str_weak(_X5B_X2502X_X5D), + /* K7 */ be_nested_str_weak(_X5B_X2A_X2A_X5D), + /* K8 */ be_nested_str_weak(cluster), + /* K9 */ be_nested_str_weak(_X2504X_X2F), + /* K10 */ be_nested_str_weak(_X2A_X2A_X2A_X2A_X2F), + /* K11 */ be_nested_str_weak(attribute), + /* K12 */ be_nested_str_weak(_X2504X), + /* K13 */ be_nested_str_weak(_X2A_X2A_X2A_X2A), + /* K14 */ be_nested_str_weak(Exception_X3E_X20), + /* K15 */ be_nested_str_weak(_X2C_X20), + }), + be_str_weak(tostring), + &be_const_str_solidified, + ( &(const binstruction[62]) { /* code */ + 0xA802002D, // 0000 EXBLK 0 #002F + 0xA4060000, // 0001 IMPORT R1 K0 + 0x58080001, // 0002 LDCONST R2 K1 + 0x880C0102, // 0003 GETMBR R3 R0 K2 + 0x780E0004, // 0004 JMPF R3 #000A + 0x8C0C0303, // 0005 GETMET R3 R1 K3 + 0x58140004, // 0006 LDCONST R5 K4 + 0x88180102, // 0007 GETMBR R6 R0 K2 + 0x7C0C0600, // 0008 CALL R3 3 + 0x00080403, // 0009 ADD R2 R2 R3 + 0x880C0105, // 000A GETMBR R3 R0 K5 + 0x4C100000, // 000B LDNIL R4 + 0x200C0604, // 000C NE R3 R3 R4 + 0x780E0004, // 000D JMPF R3 #0013 + 0x8C0C0303, // 000E GETMET R3 R1 K3 + 0x58140006, // 000F LDCONST R5 K6 + 0x88180105, // 0010 GETMBR R6 R0 K5 + 0x7C0C0600, // 0011 CALL R3 3 + 0x70020000, // 0012 JMP #0014 + 0x580C0007, // 0013 LDCONST R3 K7 + 0x00080403, // 0014 ADD R2 R2 R3 + 0x880C0108, // 0015 GETMBR R3 R0 K8 + 0x4C100000, // 0016 LDNIL R4 + 0x200C0604, // 0017 NE R3 R3 R4 + 0x780E0004, // 0018 JMPF R3 #001E + 0x8C0C0303, // 0019 GETMET R3 R1 K3 + 0x58140009, // 001A LDCONST R5 K9 + 0x88180108, // 001B GETMBR R6 R0 K8 + 0x7C0C0600, // 001C CALL R3 3 + 0x70020000, // 001D JMP #001F + 0x580C000A, // 001E LDCONST R3 K10 + 0x00080403, // 001F ADD R2 R2 R3 + 0x880C010B, // 0020 GETMBR R3 R0 K11 + 0x4C100000, // 0021 LDNIL R4 + 0x200C0604, // 0022 NE R3 R3 R4 + 0x780E0004, // 0023 JMPF R3 #0029 + 0x8C0C0303, // 0024 GETMET R3 R1 K3 + 0x5814000C, // 0025 LDCONST R5 K12 + 0x8818010B, // 0026 GETMBR R6 R0 K11 + 0x7C0C0600, // 0027 CALL R3 3 + 0x70020000, // 0028 JMP #002A + 0x580C000D, // 0029 LDCONST R3 K13 + 0x00080403, // 002A ADD R2 R2 R3 + 0xA8040001, // 002B EXBLK 1 1 + 0x80040400, // 002C RET 1 R2 + 0xA8040001, // 002D EXBLK 1 1 + 0x7002000D, // 002E JMP #003D + 0xAC040002, // 002F CATCH R1 0 2 + 0x7002000A, // 0030 JMP #003C + 0x600C0008, // 0031 GETGBL R3 G8 + 0x5C100200, // 0032 MOVE R4 R1 + 0x7C0C0200, // 0033 CALL R3 1 + 0x000E1C03, // 0034 ADD R3 K14 R3 + 0x000C070F, // 0035 ADD R3 R3 K15 + 0x60100008, // 0036 GETGBL R4 G8 + 0x5C140400, // 0037 MOVE R5 R2 + 0x7C100200, // 0038 CALL R4 1 + 0x000C0604, // 0039 ADD R3 R3 R4 + 0x80040600, // 003A RET 1 R3 + 0x70020000, // 003B JMP #003D + 0xB0080000, // 003C RAISE 2 R0 R0 + 0x80000000, // 003D RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_AttributePathIB_from_TLV, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[11]) { /* constants */ + /* K0 */ be_nested_str_weak(tag_compression), + /* K1 */ be_nested_str_weak(findsubval), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(node), + /* K4 */ be_const_int(1), + /* K5 */ be_nested_str_weak(endpoint), + /* K6 */ be_const_int(2), + /* K7 */ be_nested_str_weak(cluster), + /* K8 */ be_const_int(3), + /* K9 */ be_nested_str_weak(attribute), + /* K10 */ be_nested_str_weak(list_index), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[30]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0x8C080301, // 0005 GETMET R2 R1 K1 + 0x58100002, // 0006 LDCONST R4 K2 + 0x7C080400, // 0007 CALL R2 2 + 0x90020002, // 0008 SETMBR R0 K0 R2 + 0x8C080301, // 0009 GETMET R2 R1 K1 + 0x58100004, // 000A LDCONST R4 K4 + 0x7C080400, // 000B CALL R2 2 + 0x90020602, // 000C SETMBR R0 K3 R2 + 0x8C080301, // 000D GETMET R2 R1 K1 + 0x58100006, // 000E LDCONST R4 K6 + 0x7C080400, // 000F CALL R2 2 + 0x90020A02, // 0010 SETMBR R0 K5 R2 + 0x8C080301, // 0011 GETMET R2 R1 K1 + 0x58100008, // 0012 LDCONST R4 K8 + 0x7C080400, // 0013 CALL R2 2 + 0x90020E02, // 0014 SETMBR R0 K7 R2 + 0x8C080301, // 0015 GETMET R2 R1 K1 + 0x54120003, // 0016 LDINT R4 4 + 0x7C080400, // 0017 CALL R2 2 + 0x90021202, // 0018 SETMBR R0 K9 R2 + 0x8C080301, // 0019 GETMET R2 R1 K1 + 0x54120004, // 001A LDINT R4 5 + 0x7C080400, // 001B CALL R2 2 + 0x90021402, // 001C SETMBR R0 K10 R2 + 0x80040000, // 001D RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_AttributePathIB +********************************************************************/ +extern const bclass be_class_Matter_IM_base; +be_local_class(Matter_AttributePathIB, + 6, + &be_class_Matter_IM_base, + be_nested_map(9, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(tostring, -1), be_const_closure(Matter_AttributePathIB_tostring_closure) }, + { be_const_key_weak(tag_compression, 0), be_const_var(0) }, + { be_const_key_weak(cluster, -1), be_const_var(3) }, + { be_const_key_weak(attribute, -1), be_const_var(4) }, + { be_const_key_weak(to_TLV, 2), be_const_closure(Matter_AttributePathIB_to_TLV_closure) }, + { be_const_key_weak(list_index, 3), be_const_var(5) }, + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_AttributePathIB_from_TLV_closure) }, + { be_const_key_weak(endpoint, 1), be_const_var(2) }, + { be_const_key_weak(node, -1), be_const_var(1) }, + })), + be_str_weak(Matter_AttributePathIB) +); +/*******************************************************************/ + +void be_load_Matter_AttributePathIB_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_AttributePathIB); + be_setglobal(vm, "Matter_AttributePathIB"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_ClusterPathIB; + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_ClusterPathIB_from_TLV, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str_weak(node), + /* K1 */ be_nested_str_weak(findsubval), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(endpoint), + /* K4 */ be_const_int(1), + /* K5 */ be_nested_str_weak(cluster), + /* K6 */ be_const_int(2), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0x8C080301, // 0005 GETMET R2 R1 K1 + 0x58100002, // 0006 LDCONST R4 K2 + 0x7C080400, // 0007 CALL R2 2 + 0x90020002, // 0008 SETMBR R0 K0 R2 + 0x8C080301, // 0009 GETMET R2 R1 K1 + 0x58100004, // 000A LDCONST R4 K4 + 0x7C080400, // 000B CALL R2 2 + 0x90020602, // 000C SETMBR R0 K3 R2 + 0x8C080301, // 000D GETMET R2 R1 K1 + 0x58100006, // 000E LDCONST R4 K6 + 0x7C080400, // 000F CALL R2 2 + 0x90020A02, // 0010 SETMBR R0 K5 R2 + 0x80040000, // 0011 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_ClusterPathIB_to_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[13]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_list), + /* K3 */ be_nested_str_weak(add_TLV), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(U8), + /* K6 */ be_nested_str_weak(node), + /* K7 */ be_const_int(1), + /* K8 */ be_nested_str_weak(U2), + /* K9 */ be_nested_str_weak(endpoint), + /* K10 */ be_const_int(2), + /* K11 */ be_nested_str_weak(U4), + /* K12 */ be_nested_str_weak(cluster), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[20]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180305, // 0006 GETMBR R6 R1 K5 + 0x881C0106, // 0007 GETMBR R7 R0 K6 + 0x7C0C0800, // 0008 CALL R3 4 + 0x8C0C0503, // 0009 GETMET R3 R2 K3 + 0x58140007, // 000A LDCONST R5 K7 + 0x88180308, // 000B GETMBR R6 R1 K8 + 0x881C0109, // 000C GETMBR R7 R0 K9 + 0x7C0C0800, // 000D CALL R3 4 + 0x8C0C0503, // 000E GETMET R3 R2 K3 + 0x5814000A, // 000F LDCONST R5 K10 + 0x8818030B, // 0010 GETMBR R6 R1 K11 + 0x881C010C, // 0011 GETMBR R7 R0 K12 + 0x7C0C0800, // 0012 CALL R3 4 + 0x80040400, // 0013 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_ClusterPathIB +********************************************************************/ +extern const bclass be_class_Matter_IM_base; +be_local_class(Matter_ClusterPathIB, + 3, + &be_class_Matter_IM_base, + be_nested_map(5, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_ClusterPathIB_from_TLV_closure) }, + { be_const_key_weak(node, -1), be_const_var(0) }, + { be_const_key_weak(cluster, -1), be_const_var(2) }, + { be_const_key_weak(endpoint, 0), be_const_var(1) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_ClusterPathIB_to_TLV_closure) }, + })), + be_str_weak(Matter_ClusterPathIB) +); +/*******************************************************************/ + +void be_load_Matter_ClusterPathIB_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_ClusterPathIB); + be_setglobal(vm, "Matter_ClusterPathIB"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_DataVersionFilterIB; + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_DataVersionFilterIB_from_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(path), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(ClusterPathIB), + /* K3 */ be_nested_str_weak(from_TLV), + /* K4 */ be_nested_str_weak(findsub), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(data_version), + /* K7 */ be_nested_str_weak(findsubval), + /* K8 */ be_const_int(1), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[19]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0xB80A0200, // 0005 GETNGBL R2 K1 + 0x8C080502, // 0006 GETMET R2 R2 K2 + 0x7C080200, // 0007 CALL R2 1 + 0x8C080503, // 0008 GETMET R2 R2 K3 + 0x8C100304, // 0009 GETMET R4 R1 K4 + 0x58180005, // 000A LDCONST R6 K5 + 0x7C100400, // 000B CALL R4 2 + 0x7C080400, // 000C CALL R2 2 + 0x90020002, // 000D SETMBR R0 K0 R2 + 0x8C080307, // 000E GETMET R2 R1 K7 + 0x58100008, // 000F LDCONST R4 K8 + 0x7C080400, // 0010 CALL R2 2 + 0x90020C02, // 0011 SETMBR R0 K6 R2 + 0x80040000, // 0012 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_DataVersionFilterIB_to_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_obj), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(path), + /* K6 */ be_nested_str_weak(add_TLV), + /* K7 */ be_const_int(1), + /* K8 */ be_nested_str_weak(U4), + /* K9 */ be_nested_str_weak(data_version), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180105, // 0006 GETMBR R6 R0 K5 + 0x7C0C0600, // 0007 CALL R3 3 + 0x8C0C0506, // 0008 GETMET R3 R2 K6 + 0x58140007, // 0009 LDCONST R5 K7 + 0x88180308, // 000A GETMBR R6 R1 K8 + 0x881C0109, // 000B GETMBR R7 R0 K9 + 0x7C0C0800, // 000C CALL R3 4 + 0x80040400, // 000D RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_DataVersionFilterIB +********************************************************************/ +extern const bclass be_class_Matter_IM_base; +be_local_class(Matter_DataVersionFilterIB, + 2, + &be_class_Matter_IM_base, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_DataVersionFilterIB_from_TLV_closure) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_DataVersionFilterIB_to_TLV_closure) }, + { be_const_key_weak(path, 3), be_const_var(0) }, + { be_const_key_weak(data_version, -1), be_const_var(1) }, + })), + be_str_weak(Matter_DataVersionFilterIB) +); +/*******************************************************************/ + +void be_load_Matter_DataVersionFilterIB_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_DataVersionFilterIB); + be_setglobal(vm, "Matter_DataVersionFilterIB"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_AttributeDataIB; + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_AttributeDataIB_from_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[11]) { /* constants */ + /* K0 */ be_nested_str_weak(data_version), + /* K1 */ be_nested_str_weak(findsubval), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(path), + /* K4 */ be_nested_str_weak(matter), + /* K5 */ be_nested_str_weak(AttributePathIB), + /* K6 */ be_nested_str_weak(from_TLV), + /* K7 */ be_nested_str_weak(findsub), + /* K8 */ be_const_int(1), + /* K9 */ be_nested_str_weak(data), + /* K10 */ be_const_int(2), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[23]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0x8C080301, // 0005 GETMET R2 R1 K1 + 0x58100002, // 0006 LDCONST R4 K2 + 0x7C080400, // 0007 CALL R2 2 + 0x90020002, // 0008 SETMBR R0 K0 R2 + 0xB80A0800, // 0009 GETNGBL R2 K4 + 0x8C080505, // 000A GETMET R2 R2 K5 + 0x7C080200, // 000B CALL R2 1 + 0x8C080506, // 000C GETMET R2 R2 K6 + 0x8C100307, // 000D GETMET R4 R1 K7 + 0x58180008, // 000E LDCONST R6 K8 + 0x7C100400, // 000F CALL R4 2 + 0x7C080400, // 0010 CALL R2 2 + 0x90020602, // 0011 SETMBR R0 K3 R2 + 0x8C080301, // 0012 GETMET R2 R1 K1 + 0x5810000A, // 0013 LDCONST R4 K10 + 0x7C080400, // 0014 CALL R2 2 + 0x90021202, // 0015 SETMBR R0 K9 R2 + 0x80040000, // 0016 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_AttributeDataIB_to_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[12]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_TLV), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(U4), + /* K6 */ be_nested_str_weak(data_version), + /* K7 */ be_nested_str_weak(add_obj), + /* K8 */ be_const_int(1), + /* K9 */ be_nested_str_weak(path), + /* K10 */ be_const_int(2), + /* K11 */ be_nested_str_weak(data), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180305, // 0006 GETMBR R6 R1 K5 + 0x881C0106, // 0007 GETMBR R7 R0 K6 + 0x7C0C0800, // 0008 CALL R3 4 + 0x8C0C0507, // 0009 GETMET R3 R2 K7 + 0x58140008, // 000A LDCONST R5 K8 + 0x88180109, // 000B GETMBR R6 R0 K9 + 0x7C0C0600, // 000C CALL R3 3 + 0x8C0C0507, // 000D GETMET R3 R2 K7 + 0x5814000A, // 000E LDCONST R5 K10 + 0x8818010B, // 000F GETMBR R6 R0 K11 + 0x7C0C0600, // 0010 CALL R3 3 + 0x80040400, // 0011 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_AttributeDataIB +********************************************************************/ +extern const bclass be_class_Matter_IM_base; +be_local_class(Matter_AttributeDataIB, + 3, + &be_class_Matter_IM_base, + be_nested_map(5, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(data_version, -1), be_const_var(0) }, + { be_const_key_weak(data, -1), be_const_var(2) }, + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_AttributeDataIB_from_TLV_closure) }, + { be_const_key_weak(path, 2), be_const_var(1) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_AttributeDataIB_to_TLV_closure) }, + })), + be_str_weak(Matter_AttributeDataIB) +); +/*******************************************************************/ + +void be_load_Matter_AttributeDataIB_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_AttributeDataIB); + be_setglobal(vm, "Matter_AttributeDataIB"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_AttributeReportIB; + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_AttributeReportIB_to_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_obj), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(attribute_status), + /* K6 */ be_const_int(1), + /* K7 */ be_nested_str_weak(attribute_data), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180105, // 0006 GETMBR R6 R0 K5 + 0x7C0C0600, // 0007 CALL R3 3 + 0x8C0C0503, // 0008 GETMET R3 R2 K3 + 0x58140006, // 0009 LDCONST R5 K6 + 0x88180107, // 000A GETMBR R6 R0 K7 + 0x7C0C0600, // 000B CALL R3 3 + 0x80040400, // 000C RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_AttributeReportIB_from_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(attribute_status), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(AttributeStatusIB), + /* K3 */ be_nested_str_weak(from_TLV), + /* K4 */ be_nested_str_weak(findsub), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(attribute_data), + /* K7 */ be_nested_str_weak(AttributeDataIB), + /* K8 */ be_const_int(1), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[24]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0xB80A0200, // 0005 GETNGBL R2 K1 + 0x8C080502, // 0006 GETMET R2 R2 K2 + 0x7C080200, // 0007 CALL R2 1 + 0x8C080503, // 0008 GETMET R2 R2 K3 + 0x8C100304, // 0009 GETMET R4 R1 K4 + 0x58180005, // 000A LDCONST R6 K5 + 0x7C100400, // 000B CALL R4 2 + 0x7C080400, // 000C CALL R2 2 + 0x90020002, // 000D SETMBR R0 K0 R2 + 0xB80A0200, // 000E GETNGBL R2 K1 + 0x8C080507, // 000F GETMET R2 R2 K7 + 0x7C080200, // 0010 CALL R2 1 + 0x8C080503, // 0011 GETMET R2 R2 K3 + 0x8C100304, // 0012 GETMET R4 R1 K4 + 0x58180008, // 0013 LDCONST R6 K8 + 0x7C100400, // 0014 CALL R4 2 + 0x7C080400, // 0015 CALL R2 2 + 0x90020C02, // 0016 SETMBR R0 K6 R2 + 0x80040000, // 0017 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_AttributeReportIB +********************************************************************/ +extern const bclass be_class_Matter_IM_base; +be_local_class(Matter_AttributeReportIB, + 2, + &be_class_Matter_IM_base, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(attribute_data, 3), be_const_var(1) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_AttributeReportIB_to_TLV_closure) }, + { be_const_key_weak(attribute_status, -1), be_const_var(0) }, + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_AttributeReportIB_from_TLV_closure) }, + })), + be_str_weak(Matter_AttributeReportIB) +); +/*******************************************************************/ + +void be_load_Matter_AttributeReportIB_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_AttributeReportIB); + be_setglobal(vm, "Matter_AttributeReportIB"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_EventFilterIB; + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_EventFilterIB_from_TLV, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(node), + /* K1 */ be_nested_str_weak(findsubval), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(event_min), + /* K4 */ be_const_int(1), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0x8C080301, // 0005 GETMET R2 R1 K1 + 0x58100002, // 0006 LDCONST R4 K2 + 0x7C080400, // 0007 CALL R2 2 + 0x90020002, // 0008 SETMBR R0 K0 R2 + 0x8C080301, // 0009 GETMET R2 R1 K1 + 0x58100004, // 000A LDCONST R4 K4 + 0x7C080400, // 000B CALL R2 2 + 0x90020602, // 000C SETMBR R0 K3 R2 + 0x80040000, // 000D RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_EventFilterIB_to_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_TLV), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(U8), + /* K6 */ be_nested_str_weak(node), + /* K7 */ be_const_int(1), + /* K8 */ be_nested_str_weak(event_min), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180305, // 0006 GETMBR R6 R1 K5 + 0x881C0106, // 0007 GETMBR R7 R0 K6 + 0x7C0C0800, // 0008 CALL R3 4 + 0x8C0C0503, // 0009 GETMET R3 R2 K3 + 0x58140007, // 000A LDCONST R5 K7 + 0x88180305, // 000B GETMBR R6 R1 K5 + 0x881C0108, // 000C GETMBR R7 R0 K8 + 0x7C0C0800, // 000D CALL R3 4 + 0x80040400, // 000E RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_EventFilterIB +********************************************************************/ +extern const bclass be_class_Matter_IM_base; +be_local_class(Matter_EventFilterIB, + 2, + &be_class_Matter_IM_base, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(event_min, 3), be_const_var(1) }, + { be_const_key_weak(node, 2), be_const_var(0) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_EventFilterIB_to_TLV_closure) }, + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_EventFilterIB_from_TLV_closure) }, + })), + be_str_weak(Matter_EventFilterIB) +); +/*******************************************************************/ + +void be_load_Matter_EventFilterIB_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_EventFilterIB); + be_setglobal(vm, "Matter_EventFilterIB"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_EventPathIB; + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_EventPathIB_from_TLV, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str_weak(node), + /* K1 */ be_nested_str_weak(findsubval), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(endpoint), + /* K4 */ be_const_int(1), + /* K5 */ be_nested_str_weak(cluster), + /* K6 */ be_const_int(2), + /* K7 */ be_nested_str_weak(event), + /* K8 */ be_const_int(3), + /* K9 */ be_nested_str_weak(is_urgent), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[26]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0x8C080301, // 0005 GETMET R2 R1 K1 + 0x58100002, // 0006 LDCONST R4 K2 + 0x7C080400, // 0007 CALL R2 2 + 0x90020002, // 0008 SETMBR R0 K0 R2 + 0x8C080301, // 0009 GETMET R2 R1 K1 + 0x58100004, // 000A LDCONST R4 K4 + 0x7C080400, // 000B CALL R2 2 + 0x90020602, // 000C SETMBR R0 K3 R2 + 0x8C080301, // 000D GETMET R2 R1 K1 + 0x58100006, // 000E LDCONST R4 K6 + 0x7C080400, // 000F CALL R2 2 + 0x90020A02, // 0010 SETMBR R0 K5 R2 + 0x8C080301, // 0011 GETMET R2 R1 K1 + 0x58100008, // 0012 LDCONST R4 K8 + 0x7C080400, // 0013 CALL R2 2 + 0x90020E02, // 0014 SETMBR R0 K7 R2 + 0x8C080301, // 0015 GETMET R2 R1 K1 + 0x54120003, // 0016 LDINT R4 4 + 0x7C080400, // 0017 CALL R2 2 + 0x90021202, // 0018 SETMBR R0 K9 R2 + 0x80040000, // 0019 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_EventPathIB_to_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[17]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_list), + /* K3 */ be_nested_str_weak(add_TLV), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(U8), + /* K6 */ be_nested_str_weak(node), + /* K7 */ be_const_int(1), + /* K8 */ be_nested_str_weak(U2), + /* K9 */ be_nested_str_weak(endpoint), + /* K10 */ be_const_int(2), + /* K11 */ be_nested_str_weak(U4), + /* K12 */ be_nested_str_weak(cluster), + /* K13 */ be_const_int(3), + /* K14 */ be_nested_str_weak(event), + /* K15 */ be_nested_str_weak(BOOL), + /* K16 */ be_nested_str_weak(is_urgent), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[34]) { /* code */ + 0xB80A0000, // 0000 GETNGBL R2 K0 + 0x88080501, // 0001 GETMBR R2 R2 K1 + 0x4C0C0000, // 0002 LDNIL R3 + 0x1C0C0203, // 0003 EQ R3 R1 R3 + 0x780E0002, // 0004 JMPF R3 #0008 + 0x8C0C0502, // 0005 GETMET R3 R2 K2 + 0x7C0C0200, // 0006 CALL R3 1 + 0x5C040600, // 0007 MOVE R1 R3 + 0x8C0C0303, // 0008 GETMET R3 R1 K3 + 0x58140004, // 0009 LDCONST R5 K4 + 0x88180505, // 000A GETMBR R6 R2 K5 + 0x881C0106, // 000B GETMBR R7 R0 K6 + 0x7C0C0800, // 000C CALL R3 4 + 0x8C0C0303, // 000D GETMET R3 R1 K3 + 0x58140007, // 000E LDCONST R5 K7 + 0x88180508, // 000F GETMBR R6 R2 K8 + 0x881C0109, // 0010 GETMBR R7 R0 K9 + 0x7C0C0800, // 0011 CALL R3 4 + 0x8C0C0303, // 0012 GETMET R3 R1 K3 + 0x5814000A, // 0013 LDCONST R5 K10 + 0x8818050B, // 0014 GETMBR R6 R2 K11 + 0x881C010C, // 0015 GETMBR R7 R0 K12 + 0x7C0C0800, // 0016 CALL R3 4 + 0x8C0C0303, // 0017 GETMET R3 R1 K3 + 0x5814000D, // 0018 LDCONST R5 K13 + 0x8818050B, // 0019 GETMBR R6 R2 K11 + 0x881C010E, // 001A GETMBR R7 R0 K14 + 0x7C0C0800, // 001B CALL R3 4 + 0x8C0C0303, // 001C GETMET R3 R1 K3 + 0x54160003, // 001D LDINT R5 4 + 0x8818050F, // 001E GETMBR R6 R2 K15 + 0x881C0110, // 001F GETMBR R7 R0 K16 + 0x7C0C0800, // 0020 CALL R3 4 + 0x80040200, // 0021 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_EventPathIB +********************************************************************/ +extern const bclass be_class_Matter_IM_base; +be_local_class(Matter_EventPathIB, + 5, + &be_class_Matter_IM_base, + be_nested_map(7, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(endpoint, 5), be_const_var(1) }, + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_EventPathIB_from_TLV_closure) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_EventPathIB_to_TLV_closure) }, + { be_const_key_weak(is_urgent, -1), be_const_var(4) }, + { be_const_key_weak(event, -1), be_const_var(3) }, + { be_const_key_weak(cluster, 3), be_const_var(2) }, + { be_const_key_weak(node, -1), be_const_var(0) }, + })), + be_str_weak(Matter_EventPathIB) +); +/*******************************************************************/ + +void be_load_Matter_EventPathIB_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_EventPathIB); + be_setglobal(vm, "Matter_EventPathIB"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_EventDataIB; + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_EventDataIB_from_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[17]) { /* constants */ + /* K0 */ be_nested_str_weak(path), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(EventPathIB), + /* K3 */ be_nested_str_weak(from_TLV), + /* K4 */ be_nested_str_weak(findsub), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(event_number), + /* K7 */ be_nested_str_weak(findsubval), + /* K8 */ be_const_int(1), + /* K9 */ be_nested_str_weak(priority), + /* K10 */ be_const_int(2), + /* K11 */ be_nested_str_weak(epoch_timestamp), + /* K12 */ be_const_int(3), + /* K13 */ be_nested_str_weak(system_timestamp), + /* K14 */ be_nested_str_weak(delta_epoch_timestamp), + /* K15 */ be_nested_str_weak(delta_system_timestamp), + /* K16 */ be_nested_str_weak(data), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[43]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0xB80A0200, // 0005 GETNGBL R2 K1 + 0x8C080502, // 0006 GETMET R2 R2 K2 + 0x7C080200, // 0007 CALL R2 1 + 0x8C080503, // 0008 GETMET R2 R2 K3 + 0x8C100304, // 0009 GETMET R4 R1 K4 + 0x58180005, // 000A LDCONST R6 K5 + 0x7C100400, // 000B CALL R4 2 + 0x7C080400, // 000C CALL R2 2 + 0x90020002, // 000D SETMBR R0 K0 R2 + 0x8C080307, // 000E GETMET R2 R1 K7 + 0x58100008, // 000F LDCONST R4 K8 + 0x7C080400, // 0010 CALL R2 2 + 0x90020C02, // 0011 SETMBR R0 K6 R2 + 0x8C080307, // 0012 GETMET R2 R1 K7 + 0x5810000A, // 0013 LDCONST R4 K10 + 0x7C080400, // 0014 CALL R2 2 + 0x90021202, // 0015 SETMBR R0 K9 R2 + 0x8C080307, // 0016 GETMET R2 R1 K7 + 0x5810000C, // 0017 LDCONST R4 K12 + 0x7C080400, // 0018 CALL R2 2 + 0x90021602, // 0019 SETMBR R0 K11 R2 + 0x8C080307, // 001A GETMET R2 R1 K7 + 0x54120003, // 001B LDINT R4 4 + 0x7C080400, // 001C CALL R2 2 + 0x90021A02, // 001D SETMBR R0 K13 R2 + 0x8C080307, // 001E GETMET R2 R1 K7 + 0x54120004, // 001F LDINT R4 5 + 0x7C080400, // 0020 CALL R2 2 + 0x90021C02, // 0021 SETMBR R0 K14 R2 + 0x8C080307, // 0022 GETMET R2 R1 K7 + 0x54120005, // 0023 LDINT R4 6 + 0x7C080400, // 0024 CALL R2 2 + 0x90021E02, // 0025 SETMBR R0 K15 R2 + 0x8C080307, // 0026 GETMET R2 R1 K7 + 0x54120006, // 0027 LDINT R4 7 + 0x7C080400, // 0028 CALL R2 2 + 0x90022002, // 0029 SETMBR R0 K16 R2 + 0x80040000, // 002A RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_EventDataIB_to_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[21]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(path), + /* K4 */ be_nested_str_weak(to_TLV), + /* K5 */ be_nested_str_weak(add_list), + /* K6 */ be_const_int(0), + /* K7 */ be_nested_str_weak(add_TLV), + /* K8 */ be_const_int(1), + /* K9 */ be_nested_str_weak(U8), + /* K10 */ be_nested_str_weak(event_number), + /* K11 */ be_const_int(2), + /* K12 */ be_nested_str_weak(U1), + /* K13 */ be_nested_str_weak(priority), + /* K14 */ be_const_int(3), + /* K15 */ be_nested_str_weak(epoch_timestamp), + /* K16 */ be_nested_str_weak(system_timestamp), + /* K17 */ be_nested_str_weak(delta_epoch_timestamp), + /* K18 */ be_nested_str_weak(delta_system_timestamp), + /* K19 */ be_nested_str_weak(add_obj), + /* K20 */ be_nested_str_weak(data), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[51]) { /* code */ + 0xB80A0000, // 0000 GETNGBL R2 K0 + 0x88080501, // 0001 GETMBR R2 R2 K1 + 0x4C0C0000, // 0002 LDNIL R3 + 0x1C0C0203, // 0003 EQ R3 R1 R3 + 0x780E0002, // 0004 JMPF R3 #0008 + 0x8C0C0502, // 0005 GETMET R3 R2 K2 + 0x7C0C0200, // 0006 CALL R3 1 + 0x5C040600, // 0007 MOVE R1 R3 + 0x880C0103, // 0008 GETMBR R3 R0 K3 + 0x780E0005, // 0009 JMPF R3 #0010 + 0x880C0103, // 000A GETMBR R3 R0 K3 + 0x8C0C0704, // 000B GETMET R3 R3 K4 + 0x8C140305, // 000C GETMET R5 R1 K5 + 0x581C0006, // 000D LDCONST R7 K6 + 0x7C140400, // 000E CALL R5 2 + 0x7C0C0400, // 000F CALL R3 2 + 0x8C0C0307, // 0010 GETMET R3 R1 K7 + 0x58140008, // 0011 LDCONST R5 K8 + 0x88180509, // 0012 GETMBR R6 R2 K9 + 0x881C010A, // 0013 GETMBR R7 R0 K10 + 0x7C0C0800, // 0014 CALL R3 4 + 0x8C0C0307, // 0015 GETMET R3 R1 K7 + 0x5814000B, // 0016 LDCONST R5 K11 + 0x8818050C, // 0017 GETMBR R6 R2 K12 + 0x881C010D, // 0018 GETMBR R7 R0 K13 + 0x7C0C0800, // 0019 CALL R3 4 + 0x8C0C0307, // 001A GETMET R3 R1 K7 + 0x5814000E, // 001B LDCONST R5 K14 + 0x88180509, // 001C GETMBR R6 R2 K9 + 0x881C010F, // 001D GETMBR R7 R0 K15 + 0x7C0C0800, // 001E CALL R3 4 + 0x8C0C0307, // 001F GETMET R3 R1 K7 + 0x54160003, // 0020 LDINT R5 4 + 0x88180509, // 0021 GETMBR R6 R2 K9 + 0x881C0110, // 0022 GETMBR R7 R0 K16 + 0x7C0C0800, // 0023 CALL R3 4 + 0x8C0C0307, // 0024 GETMET R3 R1 K7 + 0x54160004, // 0025 LDINT R5 5 + 0x88180509, // 0026 GETMBR R6 R2 K9 + 0x881C0111, // 0027 GETMBR R7 R0 K17 + 0x7C0C0800, // 0028 CALL R3 4 + 0x8C0C0307, // 0029 GETMET R3 R1 K7 + 0x54160005, // 002A LDINT R5 6 + 0x88180509, // 002B GETMBR R6 R2 K9 + 0x881C0112, // 002C GETMBR R7 R0 K18 + 0x7C0C0800, // 002D CALL R3 4 + 0x8C0C0313, // 002E GETMET R3 R1 K19 + 0x54160006, // 002F LDINT R5 7 + 0x88180114, // 0030 GETMBR R6 R0 K20 + 0x7C0C0600, // 0031 CALL R3 3 + 0x80040200, // 0032 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_EventDataIB +********************************************************************/ +extern const bclass be_class_Matter_IM_base; +be_local_class(Matter_EventDataIB, + 8, + &be_class_Matter_IM_base, + be_nested_map(10, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(delta_system_timestamp, -1), be_const_var(6) }, + { be_const_key_weak(data, -1), be_const_var(7) }, + { be_const_key_weak(to_TLV, 6), be_const_closure(Matter_EventDataIB_to_TLV_closure) }, + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_EventDataIB_from_TLV_closure) }, + { be_const_key_weak(delta_epoch_timestamp, -1), be_const_var(5) }, + { be_const_key_weak(epoch_timestamp, -1), be_const_var(3) }, + { be_const_key_weak(system_timestamp, -1), be_const_var(4) }, + { be_const_key_weak(priority, 5), be_const_var(2) }, + { be_const_key_weak(path, 3), be_const_var(0) }, + { be_const_key_weak(event_number, 2), be_const_var(1) }, + })), + be_str_weak(Matter_EventDataIB) +); +/*******************************************************************/ + +void be_load_Matter_EventDataIB_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_EventDataIB); + be_setglobal(vm, "Matter_EventDataIB"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_EventReportIB; + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_EventReportIB_to_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_obj), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(event_status), + /* K6 */ be_const_int(1), + /* K7 */ be_nested_str_weak(event_data), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180105, // 0006 GETMBR R6 R0 K5 + 0x7C0C0600, // 0007 CALL R3 3 + 0x8C0C0503, // 0008 GETMET R3 R2 K3 + 0x58140006, // 0009 LDCONST R5 K6 + 0x88180107, // 000A GETMBR R6 R0 K7 + 0x7C0C0600, // 000B CALL R3 3 + 0x80040400, // 000C RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_EventReportIB_from_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(event_status), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(EventStatusIB), + /* K3 */ be_nested_str_weak(from_TLV), + /* K4 */ be_nested_str_weak(findsub), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(event_data), + /* K7 */ be_nested_str_weak(EventDataIB), + /* K8 */ be_const_int(1), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[24]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0xB80A0200, // 0005 GETNGBL R2 K1 + 0x8C080502, // 0006 GETMET R2 R2 K2 + 0x7C080200, // 0007 CALL R2 1 + 0x8C080503, // 0008 GETMET R2 R2 K3 + 0x8C100304, // 0009 GETMET R4 R1 K4 + 0x58180005, // 000A LDCONST R6 K5 + 0x7C100400, // 000B CALL R4 2 + 0x7C080400, // 000C CALL R2 2 + 0x90020002, // 000D SETMBR R0 K0 R2 + 0xB80A0200, // 000E GETNGBL R2 K1 + 0x8C080507, // 000F GETMET R2 R2 K7 + 0x7C080200, // 0010 CALL R2 1 + 0x8C080503, // 0011 GETMET R2 R2 K3 + 0x8C100304, // 0012 GETMET R4 R1 K4 + 0x58180008, // 0013 LDCONST R6 K8 + 0x7C100400, // 0014 CALL R4 2 + 0x7C080400, // 0015 CALL R2 2 + 0x90020C02, // 0016 SETMBR R0 K6 R2 + 0x80040000, // 0017 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_EventReportIB +********************************************************************/ +extern const bclass be_class_Matter_IM_base; +be_local_class(Matter_EventReportIB, + 2, + &be_class_Matter_IM_base, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(event_data, 3), be_const_var(1) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_EventReportIB_to_TLV_closure) }, + { be_const_key_weak(event_status, -1), be_const_var(0) }, + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_EventReportIB_from_TLV_closure) }, + })), + be_str_weak(Matter_EventReportIB) +); +/*******************************************************************/ + +void be_load_Matter_EventReportIB_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_EventReportIB); + be_setglobal(vm, "Matter_EventReportIB"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_CommandPathIB; + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_CommandPathIB_from_TLV, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str_weak(endpoint), + /* K1 */ be_nested_str_weak(findsubval), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(cluster), + /* K4 */ be_const_int(1), + /* K5 */ be_nested_str_weak(command), + /* K6 */ be_const_int(2), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0x8C080301, // 0005 GETMET R2 R1 K1 + 0x58100002, // 0006 LDCONST R4 K2 + 0x7C080400, // 0007 CALL R2 2 + 0x90020002, // 0008 SETMBR R0 K0 R2 + 0x8C080301, // 0009 GETMET R2 R1 K1 + 0x58100004, // 000A LDCONST R4 K4 + 0x7C080400, // 000B CALL R2 2 + 0x90020602, // 000C SETMBR R0 K3 R2 + 0x8C080301, // 000D GETMET R2 R1 K1 + 0x58100006, // 000E LDCONST R4 K6 + 0x7C080400, // 000F CALL R2 2 + 0x90020A02, // 0010 SETMBR R0 K5 R2 + 0x80040000, // 0011 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_CommandPathIB_to_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[12]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_list), + /* K3 */ be_nested_str_weak(add_TLV), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(U2), + /* K6 */ be_nested_str_weak(endpoint), + /* K7 */ be_const_int(1), + /* K8 */ be_nested_str_weak(U4), + /* K9 */ be_nested_str_weak(cluster), + /* K10 */ be_const_int(2), + /* K11 */ be_nested_str_weak(command), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[20]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180305, // 0006 GETMBR R6 R1 K5 + 0x881C0106, // 0007 GETMBR R7 R0 K6 + 0x7C0C0800, // 0008 CALL R3 4 + 0x8C0C0503, // 0009 GETMET R3 R2 K3 + 0x58140007, // 000A LDCONST R5 K7 + 0x88180308, // 000B GETMBR R6 R1 K8 + 0x881C0109, // 000C GETMBR R7 R0 K9 + 0x7C0C0800, // 000D CALL R3 4 + 0x8C0C0503, // 000E GETMET R3 R2 K3 + 0x5814000A, // 000F LDCONST R5 K10 + 0x88180308, // 0010 GETMBR R6 R1 K8 + 0x881C010B, // 0011 GETMBR R7 R0 K11 + 0x7C0C0800, // 0012 CALL R3 4 + 0x80040400, // 0013 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_CommandPathIB +********************************************************************/ +extern const bclass be_class_Matter_IM_base; +be_local_class(Matter_CommandPathIB, + 3, + &be_class_Matter_IM_base, + be_nested_map(5, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(endpoint, -1), be_const_var(0) }, + { be_const_key_weak(from_TLV, 0), be_const_closure(Matter_CommandPathIB_from_TLV_closure) }, + { be_const_key_weak(cluster, -1), be_const_var(1) }, + { be_const_key_weak(command, 1), be_const_var(2) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_CommandPathIB_to_TLV_closure) }, + })), + be_str_weak(Matter_CommandPathIB) +); +/*******************************************************************/ + +void be_load_Matter_CommandPathIB_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_CommandPathIB); + be_setglobal(vm, "Matter_CommandPathIB"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_CommandDataIB; + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_CommandDataIB_to_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_obj), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(command_path), + /* K6 */ be_const_int(1), + /* K7 */ be_nested_str_weak(command_fields), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180105, // 0006 GETMBR R6 R0 K5 + 0x7C0C0600, // 0007 CALL R3 3 + 0x8C0C0503, // 0008 GETMET R3 R2 K3 + 0x58140006, // 0009 LDCONST R5 K6 + 0x88180107, // 000A GETMBR R6 R0 K7 + 0x7C0C0600, // 000B CALL R3 3 + 0x80040400, // 000C RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_CommandDataIB_from_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(command_path), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(CommandPathIB), + /* K3 */ be_nested_str_weak(from_TLV), + /* K4 */ be_nested_str_weak(findsub), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(command_fields), + /* K7 */ be_const_int(1), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[19]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0xB80A0200, // 0005 GETNGBL R2 K1 + 0x8C080502, // 0006 GETMET R2 R2 K2 + 0x7C080200, // 0007 CALL R2 1 + 0x8C080503, // 0008 GETMET R2 R2 K3 + 0x8C100304, // 0009 GETMET R4 R1 K4 + 0x58180005, // 000A LDCONST R6 K5 + 0x7C100400, // 000B CALL R4 2 + 0x7C080400, // 000C CALL R2 2 + 0x90020002, // 000D SETMBR R0 K0 R2 + 0x8C080304, // 000E GETMET R2 R1 K4 + 0x58100007, // 000F LDCONST R4 K7 + 0x7C080400, // 0010 CALL R2 2 + 0x90020C02, // 0011 SETMBR R0 K6 R2 + 0x80040000, // 0012 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_CommandDataIB +********************************************************************/ +extern const bclass be_class_Matter_IM_base; +be_local_class(Matter_CommandDataIB, + 2, + &be_class_Matter_IM_base, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(command_path, 3), be_const_var(0) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_CommandDataIB_to_TLV_closure) }, + { be_const_key_weak(command_fields, -1), be_const_var(1) }, + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_CommandDataIB_from_TLV_closure) }, + })), + be_str_weak(Matter_CommandDataIB) +); +/*******************************************************************/ + +void be_load_Matter_CommandDataIB_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_CommandDataIB); + be_setglobal(vm, "Matter_CommandDataIB"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_InvokeResponseIB; + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_InvokeResponseIB_from_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(command), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(CommandDataIB), + /* K3 */ be_nested_str_weak(from_TLV), + /* K4 */ be_nested_str_weak(findsub), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(status), + /* K7 */ be_nested_str_weak(CommandStatusIB), + /* K8 */ be_const_int(1), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[24]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0xB80A0200, // 0005 GETNGBL R2 K1 + 0x8C080502, // 0006 GETMET R2 R2 K2 + 0x7C080200, // 0007 CALL R2 1 + 0x8C080503, // 0008 GETMET R2 R2 K3 + 0x8C100304, // 0009 GETMET R4 R1 K4 + 0x58180005, // 000A LDCONST R6 K5 + 0x7C100400, // 000B CALL R4 2 + 0x7C080400, // 000C CALL R2 2 + 0x90020002, // 000D SETMBR R0 K0 R2 + 0xB80A0200, // 000E GETNGBL R2 K1 + 0x8C080507, // 000F GETMET R2 R2 K7 + 0x7C080200, // 0010 CALL R2 1 + 0x8C080503, // 0011 GETMET R2 R2 K3 + 0x8C100304, // 0012 GETMET R4 R1 K4 + 0x58180008, // 0013 LDCONST R6 K8 + 0x7C100400, // 0014 CALL R4 2 + 0x7C080400, // 0015 CALL R2 2 + 0x90020C02, // 0016 SETMBR R0 K6 R2 + 0x80040000, // 0017 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_InvokeResponseIB_to_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_obj), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(command), + /* K6 */ be_const_int(1), + /* K7 */ be_nested_str_weak(status), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180105, // 0006 GETMBR R6 R0 K5 + 0x7C0C0600, // 0007 CALL R3 3 + 0x8C0C0503, // 0008 GETMET R3 R2 K3 + 0x58140006, // 0009 LDCONST R5 K6 + 0x88180107, // 000A GETMBR R6 R0 K7 + 0x7C0C0600, // 000B CALL R3 3 + 0x80040400, // 000C RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_InvokeResponseIB +********************************************************************/ +extern const bclass be_class_Matter_IM_base; +be_local_class(Matter_InvokeResponseIB, + 2, + &be_class_Matter_IM_base, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_InvokeResponseIB_from_TLV_closure) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_InvokeResponseIB_to_TLV_closure) }, + { be_const_key_weak(command, -1), be_const_var(0) }, + { be_const_key_weak(status, -1), be_const_var(1) }, + })), + be_str_weak(Matter_InvokeResponseIB) +); +/*******************************************************************/ + +void be_load_Matter_InvokeResponseIB_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_InvokeResponseIB); + be_setglobal(vm, "Matter_InvokeResponseIB"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_CommandStatusIB; + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_CommandStatusIB_to_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_obj), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(command_path), + /* K6 */ be_const_int(1), + /* K7 */ be_nested_str_weak(status), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180105, // 0006 GETMBR R6 R0 K5 + 0x7C0C0600, // 0007 CALL R3 3 + 0x8C0C0503, // 0008 GETMET R3 R2 K3 + 0x58140006, // 0009 LDCONST R5 K6 + 0x88180107, // 000A GETMBR R6 R0 K7 + 0x7C0C0600, // 000B CALL R3 3 + 0x80040400, // 000C RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_CommandStatusIB_from_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(command_path), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(CommandPathIB), + /* K3 */ be_nested_str_weak(from_TLV), + /* K4 */ be_nested_str_weak(findsub), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(status), + /* K7 */ be_nested_str_weak(StatusIB), + /* K8 */ be_const_int(1), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[24]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0xB80A0200, // 0005 GETNGBL R2 K1 + 0x8C080502, // 0006 GETMET R2 R2 K2 + 0x7C080200, // 0007 CALL R2 1 + 0x8C080503, // 0008 GETMET R2 R2 K3 + 0x8C100304, // 0009 GETMET R4 R1 K4 + 0x58180005, // 000A LDCONST R6 K5 + 0x7C100400, // 000B CALL R4 2 + 0x7C080400, // 000C CALL R2 2 + 0x90020002, // 000D SETMBR R0 K0 R2 + 0xB80A0200, // 000E GETNGBL R2 K1 + 0x8C080507, // 000F GETMET R2 R2 K7 + 0x7C080200, // 0010 CALL R2 1 + 0x8C080503, // 0011 GETMET R2 R2 K3 + 0x8C100304, // 0012 GETMET R4 R1 K4 + 0x58180008, // 0013 LDCONST R6 K8 + 0x7C100400, // 0014 CALL R4 2 + 0x7C080400, // 0015 CALL R2 2 + 0x90020C02, // 0016 SETMBR R0 K6 R2 + 0x80040000, // 0017 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_CommandStatusIB +********************************************************************/ +extern const bclass be_class_Matter_IM_base; +be_local_class(Matter_CommandStatusIB, + 2, + &be_class_Matter_IM_base, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(command_path, 2), be_const_var(0) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_CommandStatusIB_to_TLV_closure) }, + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_CommandStatusIB_from_TLV_closure) }, + { be_const_key_weak(status, -1), be_const_var(1) }, + })), + be_str_weak(Matter_CommandStatusIB) +); +/*******************************************************************/ + +void be_load_Matter_CommandStatusIB_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_CommandStatusIB); + be_setglobal(vm, "Matter_CommandStatusIB"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_EventStatusIB; + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_EventStatusIB_from_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(path), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(EventPathIB), + /* K3 */ be_nested_str_weak(from_TLV), + /* K4 */ be_nested_str_weak(findsub), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(status), + /* K7 */ be_nested_str_weak(StatusIB), + /* K8 */ be_const_int(1), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[24]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0xB80A0200, // 0005 GETNGBL R2 K1 + 0x8C080502, // 0006 GETMET R2 R2 K2 + 0x7C080200, // 0007 CALL R2 1 + 0x8C080503, // 0008 GETMET R2 R2 K3 + 0x8C100304, // 0009 GETMET R4 R1 K4 + 0x58180005, // 000A LDCONST R6 K5 + 0x7C100400, // 000B CALL R4 2 + 0x7C080400, // 000C CALL R2 2 + 0x90020002, // 000D SETMBR R0 K0 R2 + 0xB80A0200, // 000E GETNGBL R2 K1 + 0x8C080507, // 000F GETMET R2 R2 K7 + 0x7C080200, // 0010 CALL R2 1 + 0x8C080503, // 0011 GETMET R2 R2 K3 + 0x8C100304, // 0012 GETMET R4 R1 K4 + 0x58180008, // 0013 LDCONST R6 K8 + 0x7C100400, // 0014 CALL R4 2 + 0x7C080400, // 0015 CALL R2 2 + 0x90020C02, // 0016 SETMBR R0 K6 R2 + 0x80040000, // 0017 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_EventStatusIB_to_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_obj), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(path), + /* K6 */ be_const_int(1), + /* K7 */ be_nested_str_weak(status), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180105, // 0006 GETMBR R6 R0 K5 + 0x7C0C0600, // 0007 CALL R3 3 + 0x8C0C0503, // 0008 GETMET R3 R2 K3 + 0x58140006, // 0009 LDCONST R5 K6 + 0x88180107, // 000A GETMBR R6 R0 K7 + 0x7C0C0600, // 000B CALL R3 3 + 0x80040400, // 000C RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_EventStatusIB +********************************************************************/ +extern const bclass be_class_Matter_IM_base; +be_local_class(Matter_EventStatusIB, + 2, + &be_class_Matter_IM_base, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_EventStatusIB_from_TLV_closure) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_EventStatusIB_to_TLV_closure) }, + { be_const_key_weak(path, -1), be_const_var(0) }, + { be_const_key_weak(status, -1), be_const_var(1) }, + })), + be_str_weak(Matter_EventStatusIB) +); +/*******************************************************************/ + +void be_load_Matter_EventStatusIB_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_EventStatusIB); + be_setglobal(vm, "Matter_EventStatusIB"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_AttributeStatusIB; + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_AttributeStatusIB_from_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(path), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(AttributePathIB), + /* K3 */ be_nested_str_weak(from_TLV), + /* K4 */ be_nested_str_weak(findsub), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(status), + /* K7 */ be_nested_str_weak(StatusIB), + /* K8 */ be_const_int(1), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[24]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0xB80A0200, // 0005 GETNGBL R2 K1 + 0x8C080502, // 0006 GETMET R2 R2 K2 + 0x7C080200, // 0007 CALL R2 1 + 0x8C080503, // 0008 GETMET R2 R2 K3 + 0x8C100304, // 0009 GETMET R4 R1 K4 + 0x58180005, // 000A LDCONST R6 K5 + 0x7C100400, // 000B CALL R4 2 + 0x7C080400, // 000C CALL R2 2 + 0x90020002, // 000D SETMBR R0 K0 R2 + 0xB80A0200, // 000E GETNGBL R2 K1 + 0x8C080507, // 000F GETMET R2 R2 K7 + 0x7C080200, // 0010 CALL R2 1 + 0x8C080503, // 0011 GETMET R2 R2 K3 + 0x8C100304, // 0012 GETMET R4 R1 K4 + 0x58180008, // 0013 LDCONST R6 K8 + 0x7C100400, // 0014 CALL R4 2 + 0x7C080400, // 0015 CALL R2 2 + 0x90020C02, // 0016 SETMBR R0 K6 R2 + 0x80040000, // 0017 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_AttributeStatusIB_to_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_obj), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(path), + /* K6 */ be_const_int(1), + /* K7 */ be_nested_str_weak(status), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180105, // 0006 GETMBR R6 R0 K5 + 0x7C0C0600, // 0007 CALL R3 3 + 0x8C0C0503, // 0008 GETMET R3 R2 K3 + 0x58140006, // 0009 LDCONST R5 K6 + 0x88180107, // 000A GETMBR R6 R0 K7 + 0x7C0C0600, // 000B CALL R3 3 + 0x80040400, // 000C RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_AttributeStatusIB +********************************************************************/ +extern const bclass be_class_Matter_IM_base; +be_local_class(Matter_AttributeStatusIB, + 2, + &be_class_Matter_IM_base, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_AttributeStatusIB_from_TLV_closure) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_AttributeStatusIB_to_TLV_closure) }, + { be_const_key_weak(path, -1), be_const_var(0) }, + { be_const_key_weak(status, -1), be_const_var(1) }, + })), + be_str_weak(Matter_AttributeStatusIB) +); +/*******************************************************************/ + +void be_load_Matter_AttributeStatusIB_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_AttributeStatusIB); + be_setglobal(vm, "Matter_AttributeStatusIB"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_StatusIB; + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_StatusIB_to_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_list), + /* K3 */ be_nested_str_weak(add_TLV), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(U2), + /* K6 */ be_nested_str_weak(status), + /* K7 */ be_const_int(1), + /* K8 */ be_nested_str_weak(cluster_status), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180305, // 0006 GETMBR R6 R1 K5 + 0x881C0106, // 0007 GETMBR R7 R0 K6 + 0x7C0C0800, // 0008 CALL R3 4 + 0x8C0C0503, // 0009 GETMET R3 R2 K3 + 0x58140007, // 000A LDCONST R5 K7 + 0x88180305, // 000B GETMBR R6 R1 K5 + 0x881C0108, // 000C GETMBR R7 R0 K8 + 0x7C0C0800, // 000D CALL R3 4 + 0x80040400, // 000E RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_StatusIB_from_TLV, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(status), + /* K1 */ be_nested_str_weak(findsubval), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(cluster_status), + /* K4 */ be_const_int(1), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0x8C080301, // 0005 GETMET R2 R1 K1 + 0x58100002, // 0006 LDCONST R4 K2 + 0x7C080400, // 0007 CALL R2 2 + 0x90020002, // 0008 SETMBR R0 K0 R2 + 0x8C080301, // 0009 GETMET R2 R1 K1 + 0x58100004, // 000A LDCONST R4 K4 + 0x7C080400, // 000B CALL R2 2 + 0x90020602, // 000C SETMBR R0 K3 R2 + 0x80040000, // 000D RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_StatusIB +********************************************************************/ +extern const bclass be_class_Matter_IM_base; +be_local_class(Matter_StatusIB, + 2, + &be_class_Matter_IM_base, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(cluster_status, 2), be_const_var(1) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_StatusIB_to_TLV_closure) }, + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_StatusIB_from_TLV_closure) }, + { be_const_key_weak(status, -1), be_const_var(0) }, + })), + be_str_weak(Matter_StatusIB) +); +/*******************************************************************/ + +void be_load_Matter_StatusIB_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_StatusIB); + be_setglobal(vm, "Matter_StatusIB"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_StatusResponseMessage; + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_StatusResponseMessage_from_TLV, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(status), + /* K1 */ be_nested_str_weak(findsubval), + /* K2 */ be_const_int(0), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[10]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0x8C080301, // 0005 GETMET R2 R1 K1 + 0x58100002, // 0006 LDCONST R4 K2 + 0x7C080400, // 0007 CALL R2 2 + 0x90020002, // 0008 SETMBR R0 K0 R2 + 0x80040000, // 0009 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_StatusResponseMessage_to_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_TLV), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(U4), + /* K6 */ be_nested_str_weak(status), + /* K7 */ be_nested_str_weak(U1), + /* K8 */ be_nested_str_weak(InteractionModelRevision), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180305, // 0006 GETMBR R6 R1 K5 + 0x881C0106, // 0007 GETMBR R7 R0 K6 + 0x7C0C0800, // 0008 CALL R3 4 + 0x8C0C0503, // 0009 GETMET R3 R2 K3 + 0x541600FE, // 000A LDINT R5 255 + 0x88180307, // 000B GETMBR R6 R1 K7 + 0x881C0108, // 000C GETMBR R7 R0 K8 + 0x7C0C0800, // 000D CALL R3 4 + 0x80040400, // 000E RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_StatusResponseMessage +********************************************************************/ +extern const bclass be_class_Matter_IM_Message_base; +be_local_class(Matter_StatusResponseMessage, + 1, + &be_class_Matter_IM_Message_base, + be_nested_map(3, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_StatusResponseMessage_from_TLV_closure) }, + { be_const_key_weak(to_TLV, 2), be_const_closure(Matter_StatusResponseMessage_to_TLV_closure) }, + { be_const_key_weak(status, -1), be_const_var(0) }, + })), + be_str_weak(Matter_StatusResponseMessage) +); +/*******************************************************************/ + +void be_load_Matter_StatusResponseMessage_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_StatusResponseMessage); + be_setglobal(vm, "Matter_StatusResponseMessage"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_ReadRequestMessage; + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_ReadRequestMessage_from_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[16]) { /* constants */ + /* K0 */ be_nested_str_weak(attributes_requests), + /* K1 */ be_nested_str_weak(from_TLV_array), + /* K2 */ be_nested_str_weak(findsubval), + /* K3 */ be_const_int(0), + /* K4 */ be_nested_str_weak(matter), + /* K5 */ be_nested_str_weak(AttributePathIB), + /* K6 */ be_nested_str_weak(event_requests), + /* K7 */ be_const_int(1), + /* K8 */ be_nested_str_weak(EventPathIB), + /* K9 */ be_nested_str_weak(event_filters), + /* K10 */ be_const_int(2), + /* K11 */ be_nested_str_weak(EventFilterIB), + /* K12 */ be_nested_str_weak(fabric_filtered), + /* K13 */ be_const_int(3), + /* K14 */ be_nested_str_weak(data_version_filters), + /* K15 */ be_nested_str_weak(DataVersionFilterIB), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[42]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0x8C080101, // 0005 GETMET R2 R0 K1 + 0x8C100302, // 0006 GETMET R4 R1 K2 + 0x58180003, // 0007 LDCONST R6 K3 + 0x7C100400, // 0008 CALL R4 2 + 0xB8160800, // 0009 GETNGBL R5 K4 + 0x88140B05, // 000A GETMBR R5 R5 K5 + 0x7C080600, // 000B CALL R2 3 + 0x90020002, // 000C SETMBR R0 K0 R2 + 0x8C080101, // 000D GETMET R2 R0 K1 + 0x8C100302, // 000E GETMET R4 R1 K2 + 0x58180007, // 000F LDCONST R6 K7 + 0x7C100400, // 0010 CALL R4 2 + 0xB8160800, // 0011 GETNGBL R5 K4 + 0x88140B08, // 0012 GETMBR R5 R5 K8 + 0x7C080600, // 0013 CALL R2 3 + 0x90020C02, // 0014 SETMBR R0 K6 R2 + 0x8C080101, // 0015 GETMET R2 R0 K1 + 0x8C100302, // 0016 GETMET R4 R1 K2 + 0x5818000A, // 0017 LDCONST R6 K10 + 0x7C100400, // 0018 CALL R4 2 + 0xB8160800, // 0019 GETNGBL R5 K4 + 0x88140B0B, // 001A GETMBR R5 R5 K11 + 0x7C080600, // 001B CALL R2 3 + 0x90021202, // 001C SETMBR R0 K9 R2 + 0x8C080302, // 001D GETMET R2 R1 K2 + 0x5810000D, // 001E LDCONST R4 K13 + 0x7C080400, // 001F CALL R2 2 + 0x90021802, // 0020 SETMBR R0 K12 R2 + 0x8C080101, // 0021 GETMET R2 R0 K1 + 0x8C100302, // 0022 GETMET R4 R1 K2 + 0x541A0003, // 0023 LDINT R6 4 + 0x7C100400, // 0024 CALL R4 2 + 0xB8160800, // 0025 GETNGBL R5 K4 + 0x88140B0F, // 0026 GETMBR R5 R5 K15 + 0x7C080600, // 0027 CALL R2 3 + 0x90021C02, // 0028 SETMBR R0 K14 R2 + 0x80040000, // 0029 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_ReadRequestMessage_to_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[17]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(to_TLV_array), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(attributes_requests), + /* K6 */ be_const_int(1), + /* K7 */ be_nested_str_weak(event_requests), + /* K8 */ be_const_int(2), + /* K9 */ be_nested_str_weak(event_filters), + /* K10 */ be_nested_str_weak(add_TLV), + /* K11 */ be_const_int(3), + /* K12 */ be_nested_str_weak(BOOL), + /* K13 */ be_nested_str_weak(fabric_filtered), + /* K14 */ be_nested_str_weak(data_version_filters), + /* K15 */ be_nested_str_weak(U1), + /* K16 */ be_nested_str_weak(InteractionModelRevision), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[35]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0103, // 0004 GETMET R3 R0 K3 + 0x5C140400, // 0005 MOVE R5 R2 + 0x58180004, // 0006 LDCONST R6 K4 + 0x881C0105, // 0007 GETMBR R7 R0 K5 + 0x7C0C0800, // 0008 CALL R3 4 + 0x8C0C0103, // 0009 GETMET R3 R0 K3 + 0x5C140400, // 000A MOVE R5 R2 + 0x58180006, // 000B LDCONST R6 K6 + 0x881C0107, // 000C GETMBR R7 R0 K7 + 0x7C0C0800, // 000D CALL R3 4 + 0x8C0C0103, // 000E GETMET R3 R0 K3 + 0x5C140400, // 000F MOVE R5 R2 + 0x58180008, // 0010 LDCONST R6 K8 + 0x881C0109, // 0011 GETMBR R7 R0 K9 + 0x7C0C0800, // 0012 CALL R3 4 + 0x8C0C050A, // 0013 GETMET R3 R2 K10 + 0x5814000B, // 0014 LDCONST R5 K11 + 0x8818030C, // 0015 GETMBR R6 R1 K12 + 0x881C010D, // 0016 GETMBR R7 R0 K13 + 0x7C0C0800, // 0017 CALL R3 4 + 0x8C0C0103, // 0018 GETMET R3 R0 K3 + 0x5C140400, // 0019 MOVE R5 R2 + 0x541A0003, // 001A LDINT R6 4 + 0x881C010E, // 001B GETMBR R7 R0 K14 + 0x7C0C0800, // 001C CALL R3 4 + 0x8C0C050A, // 001D GETMET R3 R2 K10 + 0x541600FE, // 001E LDINT R5 255 + 0x8818030F, // 001F GETMBR R6 R1 K15 + 0x881C0110, // 0020 GETMBR R7 R0 K16 + 0x7C0C0800, // 0021 CALL R3 4 + 0x80040400, // 0022 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_ReadRequestMessage +********************************************************************/ +extern const bclass be_class_Matter_IM_Message_base; +be_local_class(Matter_ReadRequestMessage, + 5, + &be_class_Matter_IM_Message_base, + be_nested_map(7, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(event_filters, -1), be_const_var(2) }, + { be_const_key_weak(fabric_filtered, 3), be_const_var(3) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_ReadRequestMessage_to_TLV_closure) }, + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_ReadRequestMessage_from_TLV_closure) }, + { be_const_key_weak(data_version_filters, -1), be_const_var(4) }, + { be_const_key_weak(attributes_requests, -1), be_const_var(0) }, + { be_const_key_weak(event_requests, 0), be_const_var(1) }, + })), + be_str_weak(Matter_ReadRequestMessage) +); +/*******************************************************************/ + +void be_load_Matter_ReadRequestMessage_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_ReadRequestMessage); + be_setglobal(vm, "Matter_ReadRequestMessage"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_ReportDataMessage; + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_ReportDataMessage_from_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[14]) { /* constants */ + /* K0 */ be_nested_str_weak(subscription_id), + /* K1 */ be_nested_str_weak(findsubval), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(attribute_reports), + /* K4 */ be_nested_str_weak(from_TLV_array), + /* K5 */ be_const_int(1), + /* K6 */ be_nested_str_weak(matter), + /* K7 */ be_nested_str_weak(AttributeReportIB), + /* K8 */ be_nested_str_weak(event_reports), + /* K9 */ be_const_int(2), + /* K10 */ be_nested_str_weak(EventReportIB), + /* K11 */ be_nested_str_weak(more_chunked_messages), + /* K12 */ be_const_int(3), + /* K13 */ be_nested_str_weak(suppress_response), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[34]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0x8C080301, // 0005 GETMET R2 R1 K1 + 0x58100002, // 0006 LDCONST R4 K2 + 0x7C080400, // 0007 CALL R2 2 + 0x90020002, // 0008 SETMBR R0 K0 R2 + 0x8C080104, // 0009 GETMET R2 R0 K4 + 0x8C100301, // 000A GETMET R4 R1 K1 + 0x58180005, // 000B LDCONST R6 K5 + 0x7C100400, // 000C CALL R4 2 + 0xB8160C00, // 000D GETNGBL R5 K6 + 0x88140B07, // 000E GETMBR R5 R5 K7 + 0x7C080600, // 000F CALL R2 3 + 0x90020602, // 0010 SETMBR R0 K3 R2 + 0x8C080104, // 0011 GETMET R2 R0 K4 + 0x8C100301, // 0012 GETMET R4 R1 K1 + 0x58180009, // 0013 LDCONST R6 K9 + 0x7C100400, // 0014 CALL R4 2 + 0xB8160C00, // 0015 GETNGBL R5 K6 + 0x88140B0A, // 0016 GETMBR R5 R5 K10 + 0x7C080600, // 0017 CALL R2 3 + 0x90021002, // 0018 SETMBR R0 K8 R2 + 0x8C080301, // 0019 GETMET R2 R1 K1 + 0x5810000C, // 001A LDCONST R4 K12 + 0x7C080400, // 001B CALL R2 2 + 0x90021602, // 001C SETMBR R0 K11 R2 + 0x8C080301, // 001D GETMET R2 R1 K1 + 0x54120003, // 001E LDINT R4 4 + 0x7C080400, // 001F CALL R2 2 + 0x90021A02, // 0020 SETMBR R0 K13 R2 + 0x80040000, // 0021 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_ReportDataMessage_to_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[18]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_TLV), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(U4), + /* K6 */ be_nested_str_weak(subscription_id), + /* K7 */ be_nested_str_weak(to_TLV_array), + /* K8 */ be_const_int(1), + /* K9 */ be_nested_str_weak(attribute_reports), + /* K10 */ be_const_int(2), + /* K11 */ be_nested_str_weak(event_reports), + /* K12 */ be_const_int(3), + /* K13 */ be_nested_str_weak(BOOL), + /* K14 */ be_nested_str_weak(more_chunked_messages), + /* K15 */ be_nested_str_weak(suppress_response), + /* K16 */ be_nested_str_weak(U1), + /* K17 */ be_nested_str_weak(InteractionModelRevision), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[35]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180305, // 0006 GETMBR R6 R1 K5 + 0x881C0106, // 0007 GETMBR R7 R0 K6 + 0x7C0C0800, // 0008 CALL R3 4 + 0x8C0C0107, // 0009 GETMET R3 R0 K7 + 0x5C140400, // 000A MOVE R5 R2 + 0x58180008, // 000B LDCONST R6 K8 + 0x881C0109, // 000C GETMBR R7 R0 K9 + 0x7C0C0800, // 000D CALL R3 4 + 0x8C0C0107, // 000E GETMET R3 R0 K7 + 0x5C140400, // 000F MOVE R5 R2 + 0x5818000A, // 0010 LDCONST R6 K10 + 0x881C010B, // 0011 GETMBR R7 R0 K11 + 0x7C0C0800, // 0012 CALL R3 4 + 0x8C0C0503, // 0013 GETMET R3 R2 K3 + 0x5814000C, // 0014 LDCONST R5 K12 + 0x8818030D, // 0015 GETMBR R6 R1 K13 + 0x881C010E, // 0016 GETMBR R7 R0 K14 + 0x7C0C0800, // 0017 CALL R3 4 + 0x8C0C0503, // 0018 GETMET R3 R2 K3 + 0x54160003, // 0019 LDINT R5 4 + 0x8818030D, // 001A GETMBR R6 R1 K13 + 0x881C010F, // 001B GETMBR R7 R0 K15 + 0x7C0C0800, // 001C CALL R3 4 + 0x8C0C0503, // 001D GETMET R3 R2 K3 + 0x541600FE, // 001E LDINT R5 255 + 0x88180310, // 001F GETMBR R6 R1 K16 + 0x881C0111, // 0020 GETMBR R7 R0 K17 + 0x7C0C0800, // 0021 CALL R3 4 + 0x80040400, // 0022 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_ReportDataMessage +********************************************************************/ +extern const bclass be_class_Matter_IM_Message_base; +be_local_class(Matter_ReportDataMessage, + 5, + &be_class_Matter_IM_Message_base, + be_nested_map(7, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(attribute_reports, -1), be_const_var(1) }, + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_ReportDataMessage_from_TLV_closure) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_ReportDataMessage_to_TLV_closure) }, + { be_const_key_weak(more_chunked_messages, -1), be_const_var(3) }, + { be_const_key_weak(event_reports, -1), be_const_var(2) }, + { be_const_key_weak(suppress_response, -1), be_const_var(4) }, + { be_const_key_weak(subscription_id, 5), be_const_var(0) }, + })), + be_str_weak(Matter_ReportDataMessage) +); +/*******************************************************************/ + +void be_load_Matter_ReportDataMessage_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_ReportDataMessage); + be_setglobal(vm, "Matter_ReportDataMessage"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_SubscribeRequestMessage; + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_SubscribeRequestMessage_from_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[19]) { /* constants */ + /* K0 */ be_nested_str_weak(keep_subscriptions), + /* K1 */ be_nested_str_weak(findsubval), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(min_interval_floor), + /* K4 */ be_const_int(1), + /* K5 */ be_nested_str_weak(max_interval_ceiling), + /* K6 */ be_const_int(2), + /* K7 */ be_nested_str_weak(attribute_requests), + /* K8 */ be_nested_str_weak(from_TLV_array), + /* K9 */ be_const_int(3), + /* K10 */ be_nested_str_weak(matter), + /* K11 */ be_nested_str_weak(AttributePathIB), + /* K12 */ be_nested_str_weak(event_requests), + /* K13 */ be_nested_str_weak(EventPathIB), + /* K14 */ be_nested_str_weak(event_filters), + /* K15 */ be_nested_str_weak(EventFilterIB), + /* K16 */ be_nested_str_weak(fabric_filtered), + /* K17 */ be_nested_str_weak(data_version_filters), + /* K18 */ be_nested_str_weak(DataVersionFilterIB), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[54]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0x8C080301, // 0005 GETMET R2 R1 K1 + 0x58100002, // 0006 LDCONST R4 K2 + 0x7C080400, // 0007 CALL R2 2 + 0x90020002, // 0008 SETMBR R0 K0 R2 + 0x8C080301, // 0009 GETMET R2 R1 K1 + 0x58100004, // 000A LDCONST R4 K4 + 0x7C080400, // 000B CALL R2 2 + 0x90020602, // 000C SETMBR R0 K3 R2 + 0x8C080301, // 000D GETMET R2 R1 K1 + 0x58100006, // 000E LDCONST R4 K6 + 0x7C080400, // 000F CALL R2 2 + 0x90020A02, // 0010 SETMBR R0 K5 R2 + 0x8C080108, // 0011 GETMET R2 R0 K8 + 0x8C100301, // 0012 GETMET R4 R1 K1 + 0x58180009, // 0013 LDCONST R6 K9 + 0x7C100400, // 0014 CALL R4 2 + 0xB8161400, // 0015 GETNGBL R5 K10 + 0x88140B0B, // 0016 GETMBR R5 R5 K11 + 0x7C080600, // 0017 CALL R2 3 + 0x90020E02, // 0018 SETMBR R0 K7 R2 + 0x8C080108, // 0019 GETMET R2 R0 K8 + 0x8C100301, // 001A GETMET R4 R1 K1 + 0x541A0003, // 001B LDINT R6 4 + 0x7C100400, // 001C CALL R4 2 + 0xB8161400, // 001D GETNGBL R5 K10 + 0x88140B0D, // 001E GETMBR R5 R5 K13 + 0x7C080600, // 001F CALL R2 3 + 0x90021802, // 0020 SETMBR R0 K12 R2 + 0x8C080108, // 0021 GETMET R2 R0 K8 + 0x8C100301, // 0022 GETMET R4 R1 K1 + 0x541A0004, // 0023 LDINT R6 5 + 0x7C100400, // 0024 CALL R4 2 + 0xB8161400, // 0025 GETNGBL R5 K10 + 0x88140B0F, // 0026 GETMBR R5 R5 K15 + 0x7C080600, // 0027 CALL R2 3 + 0x90021C02, // 0028 SETMBR R0 K14 R2 + 0x8C080301, // 0029 GETMET R2 R1 K1 + 0x54120006, // 002A LDINT R4 7 + 0x7C080400, // 002B CALL R2 2 + 0x90022002, // 002C SETMBR R0 K16 R2 + 0x8C080108, // 002D GETMET R2 R0 K8 + 0x8C100301, // 002E GETMET R4 R1 K1 + 0x541A0007, // 002F LDINT R6 8 + 0x7C100400, // 0030 CALL R4 2 + 0xB8161400, // 0031 GETNGBL R5 K10 + 0x88140B12, // 0032 GETMBR R5 R5 K18 + 0x7C080600, // 0033 CALL R2 3 + 0x90022202, // 0034 SETMBR R0 K17 R2 + 0x80040000, // 0035 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_SubscribeRequestMessage_to_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[21]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_TLV), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(BOOL), + /* K6 */ be_nested_str_weak(keep_subscriptions), + /* K7 */ be_const_int(1), + /* K8 */ be_nested_str_weak(U2), + /* K9 */ be_nested_str_weak(min_interval_floor), + /* K10 */ be_const_int(2), + /* K11 */ be_nested_str_weak(max_interval_ceiling), + /* K12 */ be_nested_str_weak(to_TLV_array), + /* K13 */ be_const_int(3), + /* K14 */ be_nested_str_weak(attribute_requests), + /* K15 */ be_nested_str_weak(event_requests), + /* K16 */ be_nested_str_weak(event_filters), + /* K17 */ be_nested_str_weak(fabric_filtered), + /* K18 */ be_nested_str_weak(data_version_filters), + /* K19 */ be_nested_str_weak(U1), + /* K20 */ be_nested_str_weak(InteractionModelRevision), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[50]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180305, // 0006 GETMBR R6 R1 K5 + 0x881C0106, // 0007 GETMBR R7 R0 K6 + 0x7C0C0800, // 0008 CALL R3 4 + 0x8C0C0503, // 0009 GETMET R3 R2 K3 + 0x58140007, // 000A LDCONST R5 K7 + 0x88180308, // 000B GETMBR R6 R1 K8 + 0x881C0109, // 000C GETMBR R7 R0 K9 + 0x7C0C0800, // 000D CALL R3 4 + 0x8C0C0503, // 000E GETMET R3 R2 K3 + 0x5814000A, // 000F LDCONST R5 K10 + 0x88180308, // 0010 GETMBR R6 R1 K8 + 0x881C010B, // 0011 GETMBR R7 R0 K11 + 0x7C0C0800, // 0012 CALL R3 4 + 0x8C0C010C, // 0013 GETMET R3 R0 K12 + 0x5C140400, // 0014 MOVE R5 R2 + 0x5818000D, // 0015 LDCONST R6 K13 + 0x881C010E, // 0016 GETMBR R7 R0 K14 + 0x7C0C0800, // 0017 CALL R3 4 + 0x8C0C010C, // 0018 GETMET R3 R0 K12 + 0x5C140400, // 0019 MOVE R5 R2 + 0x541A0003, // 001A LDINT R6 4 + 0x881C010F, // 001B GETMBR R7 R0 K15 + 0x7C0C0800, // 001C CALL R3 4 + 0x8C0C010C, // 001D GETMET R3 R0 K12 + 0x5C140400, // 001E MOVE R5 R2 + 0x541A0004, // 001F LDINT R6 5 + 0x881C0110, // 0020 GETMBR R7 R0 K16 + 0x7C0C0800, // 0021 CALL R3 4 + 0x8C0C0503, // 0022 GETMET R3 R2 K3 + 0x54160006, // 0023 LDINT R5 7 + 0x88180305, // 0024 GETMBR R6 R1 K5 + 0x881C0111, // 0025 GETMBR R7 R0 K17 + 0x7C0C0800, // 0026 CALL R3 4 + 0x8C0C010C, // 0027 GETMET R3 R0 K12 + 0x5C140400, // 0028 MOVE R5 R2 + 0x541A0007, // 0029 LDINT R6 8 + 0x881C0112, // 002A GETMBR R7 R0 K18 + 0x7C0C0800, // 002B CALL R3 4 + 0x8C0C0503, // 002C GETMET R3 R2 K3 + 0x541600FE, // 002D LDINT R5 255 + 0x88180313, // 002E GETMBR R6 R1 K19 + 0x881C0114, // 002F GETMBR R7 R0 K20 + 0x7C0C0800, // 0030 CALL R3 4 + 0x80040400, // 0031 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_SubscribeRequestMessage +********************************************************************/ +extern const bclass be_class_Matter_IM_Message_base; +be_local_class(Matter_SubscribeRequestMessage, + 8, + &be_class_Matter_IM_Message_base, + be_nested_map(10, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_SubscribeRequestMessage_to_TLV_closure) }, + { be_const_key_weak(event_filters, -1), be_const_var(5) }, + { be_const_key_weak(event_requests, 6), be_const_var(4) }, + { be_const_key_weak(min_interval_floor, -1), be_const_var(1) }, + { be_const_key_weak(data_version_filters, -1), be_const_var(7) }, + { be_const_key_weak(max_interval_ceiling, -1), be_const_var(2) }, + { be_const_key_weak(attribute_requests, 7), be_const_var(3) }, + { be_const_key_weak(fabric_filtered, 3), be_const_var(6) }, + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_SubscribeRequestMessage_from_TLV_closure) }, + { be_const_key_weak(keep_subscriptions, 0), be_const_var(0) }, + })), + be_str_weak(Matter_SubscribeRequestMessage) +); +/*******************************************************************/ + +void be_load_Matter_SubscribeRequestMessage_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_SubscribeRequestMessage); + be_setglobal(vm, "Matter_SubscribeRequestMessage"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_SubscribeResponseMessage; + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_SubscribeResponseMessage_to_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[12]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_TLV), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(U4), + /* K6 */ be_nested_str_weak(subscription_id), + /* K7 */ be_const_int(2), + /* K8 */ be_nested_str_weak(U2), + /* K9 */ be_nested_str_weak(max_interval), + /* K10 */ be_nested_str_weak(U1), + /* K11 */ be_nested_str_weak(InteractionModelRevision), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[20]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180305, // 0006 GETMBR R6 R1 K5 + 0x881C0106, // 0007 GETMBR R7 R0 K6 + 0x7C0C0800, // 0008 CALL R3 4 + 0x8C0C0503, // 0009 GETMET R3 R2 K3 + 0x58140007, // 000A LDCONST R5 K7 + 0x88180308, // 000B GETMBR R6 R1 K8 + 0x881C0109, // 000C GETMBR R7 R0 K9 + 0x7C0C0800, // 000D CALL R3 4 + 0x8C0C0503, // 000E GETMET R3 R2 K3 + 0x541600FE, // 000F LDINT R5 255 + 0x8818030A, // 0010 GETMBR R6 R1 K10 + 0x881C010B, // 0011 GETMBR R7 R0 K11 + 0x7C0C0800, // 0012 CALL R3 4 + 0x80040400, // 0013 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_SubscribeResponseMessage_from_TLV, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(subscription_id), + /* K1 */ be_nested_str_weak(findsubval), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(max_interval), + /* K4 */ be_const_int(2), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0x8C080301, // 0005 GETMET R2 R1 K1 + 0x58100002, // 0006 LDCONST R4 K2 + 0x7C080400, // 0007 CALL R2 2 + 0x90020002, // 0008 SETMBR R0 K0 R2 + 0x8C080301, // 0009 GETMET R2 R1 K1 + 0x58100004, // 000A LDCONST R4 K4 + 0x7C080400, // 000B CALL R2 2 + 0x90020602, // 000C SETMBR R0 K3 R2 + 0x80040000, // 000D RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_SubscribeResponseMessage +********************************************************************/ +extern const bclass be_class_Matter_IM_Message_base; +be_local_class(Matter_SubscribeResponseMessage, + 2, + &be_class_Matter_IM_Message_base, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(subscription_id, 2), be_const_var(0) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_SubscribeResponseMessage_to_TLV_closure) }, + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_SubscribeResponseMessage_from_TLV_closure) }, + { be_const_key_weak(max_interval, -1), be_const_var(1) }, + })), + be_str_weak(Matter_SubscribeResponseMessage) +); +/*******************************************************************/ + +void be_load_Matter_SubscribeResponseMessage_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_SubscribeResponseMessage); + be_setglobal(vm, "Matter_SubscribeResponseMessage"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_WriteRequestMessage; + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_WriteRequestMessage_to_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[16]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_TLV), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(BOOL), + /* K6 */ be_nested_str_weak(suppress_response), + /* K7 */ be_const_int(1), + /* K8 */ be_nested_str_weak(timed_request), + /* K9 */ be_nested_str_weak(to_TLV_array), + /* K10 */ be_const_int(2), + /* K11 */ be_nested_str_weak(write_requests), + /* K12 */ be_const_int(3), + /* K13 */ be_nested_str_weak(more_chunked_messages), + /* K14 */ be_nested_str_weak(U1), + /* K15 */ be_nested_str_weak(InteractionModelRevision), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[30]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180305, // 0006 GETMBR R6 R1 K5 + 0x881C0106, // 0007 GETMBR R7 R0 K6 + 0x7C0C0800, // 0008 CALL R3 4 + 0x8C0C0503, // 0009 GETMET R3 R2 K3 + 0x58140007, // 000A LDCONST R5 K7 + 0x88180305, // 000B GETMBR R6 R1 K5 + 0x881C0108, // 000C GETMBR R7 R0 K8 + 0x7C0C0800, // 000D CALL R3 4 + 0x8C0C0109, // 000E GETMET R3 R0 K9 + 0x5C140400, // 000F MOVE R5 R2 + 0x5818000A, // 0010 LDCONST R6 K10 + 0x881C010B, // 0011 GETMBR R7 R0 K11 + 0x7C0C0800, // 0012 CALL R3 4 + 0x8C0C0503, // 0013 GETMET R3 R2 K3 + 0x5814000C, // 0014 LDCONST R5 K12 + 0x88180305, // 0015 GETMBR R6 R1 K5 + 0x881C010D, // 0016 GETMBR R7 R0 K13 + 0x7C0C0800, // 0017 CALL R3 4 + 0x8C0C0503, // 0018 GETMET R3 R2 K3 + 0x541600FE, // 0019 LDINT R5 255 + 0x8818030E, // 001A GETMBR R6 R1 K14 + 0x881C010F, // 001B GETMBR R7 R0 K15 + 0x7C0C0800, // 001C CALL R3 4 + 0x80040400, // 001D RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_WriteRequestMessage_from_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[12]) { /* constants */ + /* K0 */ be_nested_str_weak(suppress_response), + /* K1 */ be_nested_str_weak(findsubval), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(timed_request), + /* K4 */ be_const_int(1), + /* K5 */ be_nested_str_weak(write_requests), + /* K6 */ be_nested_str_weak(from_TLV_array), + /* K7 */ be_const_int(2), + /* K8 */ be_nested_str_weak(matter), + /* K9 */ be_nested_str_weak(AttributeDataIB), + /* K10 */ be_nested_str_weak(more_chunked_messages), + /* K11 */ be_const_int(3), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[26]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0x8C080301, // 0005 GETMET R2 R1 K1 + 0x58100002, // 0006 LDCONST R4 K2 + 0x7C080400, // 0007 CALL R2 2 + 0x90020002, // 0008 SETMBR R0 K0 R2 + 0x8C080301, // 0009 GETMET R2 R1 K1 + 0x58100004, // 000A LDCONST R4 K4 + 0x7C080400, // 000B CALL R2 2 + 0x90020602, // 000C SETMBR R0 K3 R2 + 0x8C080106, // 000D GETMET R2 R0 K6 + 0x8C100301, // 000E GETMET R4 R1 K1 + 0x58180007, // 000F LDCONST R6 K7 + 0x7C100400, // 0010 CALL R4 2 + 0xB8161000, // 0011 GETNGBL R5 K8 + 0x88140B09, // 0012 GETMBR R5 R5 K9 + 0x7C080600, // 0013 CALL R2 3 + 0x90020A02, // 0014 SETMBR R0 K5 R2 + 0x8C080301, // 0015 GETMET R2 R1 K1 + 0x5810000B, // 0016 LDCONST R4 K11 + 0x7C080400, // 0017 CALL R2 2 + 0x90021402, // 0018 SETMBR R0 K10 R2 + 0x80040000, // 0019 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_WriteRequestMessage +********************************************************************/ +extern const bclass be_class_Matter_IM_Message_base; +be_local_class(Matter_WriteRequestMessage, + 4, + &be_class_Matter_IM_Message_base, + be_nested_map(6, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(suppress_response, 5), be_const_var(0) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_WriteRequestMessage_to_TLV_closure) }, + { be_const_key_weak(timed_request, -1), be_const_var(1) }, + { be_const_key_weak(write_requests, -1), be_const_var(2) }, + { be_const_key_weak(more_chunked_messages, -1), be_const_var(3) }, + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_WriteRequestMessage_from_TLV_closure) }, + })), + be_str_weak(Matter_WriteRequestMessage) +); +/*******************************************************************/ + +void be_load_Matter_WriteRequestMessage_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_WriteRequestMessage); + be_setglobal(vm, "Matter_WriteRequestMessage"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_WriteResponseMessage; + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_WriteResponseMessage_from_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str_weak(write_requests), + /* K1 */ be_nested_str_weak(from_TLV_array), + /* K2 */ be_nested_str_weak(findsubval), + /* K3 */ be_const_int(0), + /* K4 */ be_nested_str_weak(matter), + /* K5 */ be_nested_str_weak(AttributeStatusIB), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0x8C080101, // 0005 GETMET R2 R0 K1 + 0x8C100302, // 0006 GETMET R4 R1 K2 + 0x58180003, // 0007 LDCONST R6 K3 + 0x7C100400, // 0008 CALL R4 2 + 0xB8160800, // 0009 GETNGBL R5 K4 + 0x88140B05, // 000A GETMBR R5 R5 K5 + 0x7C080600, // 000B CALL R2 3 + 0x90020002, // 000C SETMBR R0 K0 R2 + 0x80040000, // 000D RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_WriteResponseMessage_to_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(to_TLV_array), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(write_responses), + /* K6 */ be_nested_str_weak(add_TLV), + /* K7 */ be_nested_str_weak(U1), + /* K8 */ be_nested_str_weak(InteractionModelRevision), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0103, // 0004 GETMET R3 R0 K3 + 0x5C140400, // 0005 MOVE R5 R2 + 0x58180004, // 0006 LDCONST R6 K4 + 0x881C0105, // 0007 GETMBR R7 R0 K5 + 0x7C0C0800, // 0008 CALL R3 4 + 0x8C0C0506, // 0009 GETMET R3 R2 K6 + 0x541600FE, // 000A LDINT R5 255 + 0x88180307, // 000B GETMBR R6 R1 K7 + 0x881C0108, // 000C GETMBR R7 R0 K8 + 0x7C0C0800, // 000D CALL R3 4 + 0x80040400, // 000E RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_WriteResponseMessage +********************************************************************/ +extern const bclass be_class_Matter_IM_Message_base; +be_local_class(Matter_WriteResponseMessage, + 1, + &be_class_Matter_IM_Message_base, + be_nested_map(3, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(from_TLV, 2), be_const_closure(Matter_WriteResponseMessage_from_TLV_closure) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_WriteResponseMessage_to_TLV_closure) }, + { be_const_key_weak(write_responses, -1), be_const_var(0) }, + })), + be_str_weak(Matter_WriteResponseMessage) +); +/*******************************************************************/ + +void be_load_Matter_WriteResponseMessage_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_WriteResponseMessage); + be_setglobal(vm, "Matter_WriteResponseMessage"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_TimedRequestMessage; + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_TimedRequestMessage_from_TLV, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(timeout), + /* K1 */ be_nested_str_weak(findsubval), + /* K2 */ be_const_int(0), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[10]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0x8C080301, // 0005 GETMET R2 R1 K1 + 0x58100002, // 0006 LDCONST R4 K2 + 0x7C080400, // 0007 CALL R2 2 + 0x90020002, // 0008 SETMBR R0 K0 R2 + 0x80040000, // 0009 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_TimedRequestMessage_to_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_TLV), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(U2), + /* K6 */ be_nested_str_weak(timeout), + /* K7 */ be_nested_str_weak(U1), + /* K8 */ be_nested_str_weak(InteractionModelRevision), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180305, // 0006 GETMBR R6 R1 K5 + 0x881C0106, // 0007 GETMBR R7 R0 K6 + 0x7C0C0800, // 0008 CALL R3 4 + 0x8C0C0503, // 0009 GETMET R3 R2 K3 + 0x541600FE, // 000A LDINT R5 255 + 0x88180307, // 000B GETMBR R6 R1 K7 + 0x881C0108, // 000C GETMBR R7 R0 K8 + 0x7C0C0800, // 000D CALL R3 4 + 0x80040400, // 000E RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_TimedRequestMessage +********************************************************************/ +extern const bclass be_class_Matter_IM_Message_base; +be_local_class(Matter_TimedRequestMessage, + 1, + &be_class_Matter_IM_Message_base, + be_nested_map(3, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_TimedRequestMessage_from_TLV_closure) }, + { be_const_key_weak(timeout, 2), be_const_var(0) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_TimedRequestMessage_to_TLV_closure) }, + })), + be_str_weak(Matter_TimedRequestMessage) +); +/*******************************************************************/ + +void be_load_Matter_TimedRequestMessage_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_TimedRequestMessage); + be_setglobal(vm, "Matter_TimedRequestMessage"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_InvokeRequestMessage; + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_InvokeRequestMessage_from_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str_weak(suppress_response), + /* K1 */ be_nested_str_weak(findsubval), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(timed_request), + /* K4 */ be_const_int(1), + /* K5 */ be_nested_str_weak(invoke_requests), + /* K6 */ be_nested_str_weak(from_TLV_array), + /* K7 */ be_const_int(2), + /* K8 */ be_nested_str_weak(matter), + /* K9 */ be_nested_str_weak(CommandDataIB), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[22]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0x8C080301, // 0005 GETMET R2 R1 K1 + 0x58100002, // 0006 LDCONST R4 K2 + 0x7C080400, // 0007 CALL R2 2 + 0x90020002, // 0008 SETMBR R0 K0 R2 + 0x8C080301, // 0009 GETMET R2 R1 K1 + 0x58100004, // 000A LDCONST R4 K4 + 0x7C080400, // 000B CALL R2 2 + 0x90020602, // 000C SETMBR R0 K3 R2 + 0x8C080106, // 000D GETMET R2 R0 K6 + 0x8C100301, // 000E GETMET R4 R1 K1 + 0x58180007, // 000F LDCONST R6 K7 + 0x7C100400, // 0010 CALL R4 2 + 0xB8161000, // 0011 GETNGBL R5 K8 + 0x88140B09, // 0012 GETMBR R5 R5 K9 + 0x7C080600, // 0013 CALL R2 3 + 0x90020A02, // 0014 SETMBR R0 K5 R2 + 0x80040000, // 0015 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_InvokeRequestMessage_to_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[14]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_TLV), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(BOOL), + /* K6 */ be_nested_str_weak(suppress_response), + /* K7 */ be_const_int(1), + /* K8 */ be_nested_str_weak(timed_request), + /* K9 */ be_nested_str_weak(to_TLV_array), + /* K10 */ be_const_int(2), + /* K11 */ be_nested_str_weak(invoke_requests), + /* K12 */ be_nested_str_weak(U1), + /* K13 */ be_nested_str_weak(InteractionModelRevision), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[25]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180305, // 0006 GETMBR R6 R1 K5 + 0x881C0106, // 0007 GETMBR R7 R0 K6 + 0x7C0C0800, // 0008 CALL R3 4 + 0x8C0C0503, // 0009 GETMET R3 R2 K3 + 0x58140007, // 000A LDCONST R5 K7 + 0x88180305, // 000B GETMBR R6 R1 K5 + 0x881C0108, // 000C GETMBR R7 R0 K8 + 0x7C0C0800, // 000D CALL R3 4 + 0x8C0C0109, // 000E GETMET R3 R0 K9 + 0x5C140400, // 000F MOVE R5 R2 + 0x5818000A, // 0010 LDCONST R6 K10 + 0x881C010B, // 0011 GETMBR R7 R0 K11 + 0x7C0C0800, // 0012 CALL R3 4 + 0x8C0C0503, // 0013 GETMET R3 R2 K3 + 0x541600FE, // 0014 LDINT R5 255 + 0x8818030C, // 0015 GETMBR R6 R1 K12 + 0x881C010D, // 0016 GETMBR R7 R0 K13 + 0x7C0C0800, // 0017 CALL R3 4 + 0x80040400, // 0018 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_InvokeRequestMessage +********************************************************************/ +extern const bclass be_class_Matter_IM_Message_base; +be_local_class(Matter_InvokeRequestMessage, + 3, + &be_class_Matter_IM_Message_base, + be_nested_map(5, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(invoke_requests, -1), be_const_var(2) }, + { be_const_key_weak(suppress_response, 2), be_const_var(0) }, + { be_const_key_weak(timed_request, -1), be_const_var(1) }, + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_InvokeRequestMessage_from_TLV_closure) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_InvokeRequestMessage_to_TLV_closure) }, + })), + be_str_weak(Matter_InvokeRequestMessage) +); +/*******************************************************************/ + +void be_load_Matter_InvokeRequestMessage_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_InvokeRequestMessage); + be_setglobal(vm, "Matter_InvokeRequestMessage"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_InvokeResponseMessage; + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(Matter_InvokeResponseMessage_to_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[12]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(Matter_TLV_struct), + /* K3 */ be_nested_str_weak(add_TLV), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(BOOL), + /* K6 */ be_nested_str_weak(suppress_response), + /* K7 */ be_nested_str_weak(to_TLV_array), + /* K8 */ be_const_int(1), + /* K9 */ be_nested_str_weak(invoke_responses), + /* K10 */ be_nested_str_weak(U1), + /* K11 */ be_nested_str_weak(InteractionModelRevision), + }), + be_str_weak(to_TLV), + &be_const_str_solidified, + ( &(const binstruction[20]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x8C080302, // 0002 GETMET R2 R1 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x8C0C0503, // 0004 GETMET R3 R2 K3 + 0x58140004, // 0005 LDCONST R5 K4 + 0x88180305, // 0006 GETMBR R6 R1 K5 + 0x881C0106, // 0007 GETMBR R7 R0 K6 + 0x7C0C0800, // 0008 CALL R3 4 + 0x8C0C0107, // 0009 GETMET R3 R0 K7 + 0x5C140400, // 000A MOVE R5 R2 + 0x58180008, // 000B LDCONST R6 K8 + 0x881C0109, // 000C GETMBR R7 R0 K9 + 0x7C0C0800, // 000D CALL R3 4 + 0x8C0C0503, // 000E GETMET R3 R2 K3 + 0x541600FE, // 000F LDINT R5 255 + 0x8818030A, // 0010 GETMBR R6 R1 K10 + 0x881C010B, // 0011 GETMBR R7 R0 K11 + 0x7C0C0800, // 0012 CALL R3 4 + 0x80040400, // 0013 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: from_TLV +********************************************************************/ +be_local_closure(Matter_InvokeResponseMessage_from_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(suppress_response), + /* K1 */ be_nested_str_weak(findsubval), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(invoke_responses), + /* K4 */ be_nested_str_weak(from_TLV_array), + /* K5 */ be_const_int(1), + /* K6 */ be_nested_str_weak(matter), + /* K7 */ be_nested_str_weak(InvokeResponseIB), + }), + be_str_weak(from_TLV), + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0x8C080301, // 0005 GETMET R2 R1 K1 + 0x58100002, // 0006 LDCONST R4 K2 + 0x7C080400, // 0007 CALL R2 2 + 0x90020002, // 0008 SETMBR R0 K0 R2 + 0x8C080104, // 0009 GETMET R2 R0 K4 + 0x8C100301, // 000A GETMET R4 R1 K1 + 0x58180005, // 000B LDCONST R6 K5 + 0x7C100400, // 000C CALL R4 2 + 0xB8160C00, // 000D GETNGBL R5 K6 + 0x88140B07, // 000E GETMBR R5 R5 K7 + 0x7C080600, // 000F CALL R2 3 + 0x90020602, // 0010 SETMBR R0 K3 R2 + 0x80040000, // 0011 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_InvokeResponseMessage +********************************************************************/ +extern const bclass be_class_Matter_IM_Message_base; +be_local_class(Matter_InvokeResponseMessage, + 2, + &be_class_Matter_IM_Message_base, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(suppress_response, 3), be_const_var(0) }, + { be_const_key_weak(to_TLV, -1), be_const_closure(Matter_InvokeResponseMessage_to_TLV_closure) }, + { be_const_key_weak(invoke_responses, -1), be_const_var(1) }, + { be_const_key_weak(from_TLV, -1), be_const_closure(Matter_InvokeResponseMessage_from_TLV_closure) }, + })), + be_str_weak(Matter_InvokeResponseMessage) +); +/*******************************************************************/ + +void be_load_Matter_InvokeResponseMessage_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_InvokeResponseMessage); + be_setglobal(vm, "Matter_InvokeResponseMessage"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Message.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Message.h new file mode 100644 index 000000000..044e02159 --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Message.h @@ -0,0 +1,1227 @@ +/* Solidification of Matter_Message.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_Frame; + +/******************************************************************** +** Solidified function: decrypt +********************************************************************/ +be_local_closure(Matter_Frame_decrypt, /* name */ + be_nested_proto( + 16, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[30]) { /* constants */ + /* K0 */ be_nested_str_weak(crypto), + /* K1 */ be_nested_str_weak(session), + /* K2 */ be_nested_str_weak(raw), + /* K3 */ be_nested_str_weak(get_i2r), + /* K4 */ be_const_int(2147483647), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(payload_idx), + /* K7 */ be_const_int(1), + /* K8 */ be_nested_str_weak(add), + /* K9 */ be_nested_str_weak(flags), + /* K10 */ be_nested_str_weak(message_counter), + /* K11 */ be_nested_str_weak(source_node_id), + /* K12 */ be_nested_str_weak(peer_node_id), + /* K13 */ be_nested_str_weak(resize), + /* K14 */ be_nested_str_weak(tasmota), + /* K15 */ be_nested_str_weak(log), + /* K16 */ be_nested_str_weak(MTR_X3A_X20_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A), + /* K17 */ be_const_int(3), + /* K18 */ be_nested_str_weak(MTR_X3A_X20i2r_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D), + /* K19 */ be_nested_str_weak(tohex), + /* K20 */ be_nested_str_weak(MTR_X3A_X20p_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D), + /* K21 */ be_nested_str_weak(MTR_X3A_X20a_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D), + /* K22 */ be_nested_str_weak(MTR_X3A_X20n_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D), + /* K23 */ be_nested_str_weak(MTR_X3A_X20mic_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D), + /* K24 */ be_nested_str_weak(AES_CCM), + /* K25 */ be_nested_str_weak(decrypt), + /* K26 */ be_nested_str_weak(tag), + /* K27 */ be_nested_str_weak(MTR_X3A_X20cleartext_X20_X20_X20_X3D), + /* K28 */ be_nested_str_weak(MTR_X3A_X20tag_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D), + /* K29 */ be_nested_str_weak(MTR_X3A_X20rejected_X20packet_X20due_X20to_X20invalid_X20MIC), + }), + be_str_weak(decrypt), + &be_const_str_solidified, + ( &(const binstruction[125]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x88080101, // 0001 GETMBR R2 R0 K1 + 0x880C0102, // 0002 GETMBR R3 R0 K2 + 0x8C100503, // 0003 GETMET R4 R2 K3 + 0x7C100200, // 0004 CALL R4 1 + 0x5415FFEF, // 0005 LDINT R5 -16 + 0x40140B04, // 0006 CONNECT R5 R5 K4 + 0x94140605, // 0007 GETIDX R5 R3 R5 + 0x88180106, // 0008 GETMBR R6 R0 K6 + 0x04180D07, // 0009 SUB R6 R6 K7 + 0x401A0A06, // 000A CONNECT R6 K5 R6 + 0x94180606, // 000B GETIDX R6 R3 R6 + 0x881C0106, // 000C GETMBR R7 R0 K6 + 0x5421FFEE, // 000D LDINT R8 -17 + 0x401C0E08, // 000E CONNECT R7 R7 R8 + 0x941C0607, // 000F GETIDX R7 R3 R7 + 0x60200015, // 0010 GETGBL R8 G21 + 0x7C200000, // 0011 CALL R8 0 + 0x8C241108, // 0012 GETMET R9 R8 K8 + 0x882C0109, // 0013 GETMBR R11 R0 K9 + 0x58300007, // 0014 LDCONST R12 K7 + 0x7C240600, // 0015 CALL R9 3 + 0x8C241108, // 0016 GETMET R9 R8 K8 + 0x882C010A, // 0017 GETMBR R11 R0 K10 + 0x54320003, // 0018 LDINT R12 4 + 0x7C240600, // 0019 CALL R9 3 + 0x8824010B, // 001A GETMBR R9 R0 K11 + 0x78260001, // 001B JMPF R9 #001E + 0x40241104, // 001C CONNECT R9 R8 K4 + 0x70020006, // 001D JMP #0025 + 0x8824050C, // 001E GETMBR R9 R2 K12 + 0x78260001, // 001F JMPF R9 #0022 + 0x8824050C, // 0020 GETMBR R9 R2 K12 + 0x40241009, // 0021 CONNECT R9 R8 R9 + 0x8C24110D, // 0022 GETMET R9 R8 K13 + 0x542E000C, // 0023 LDINT R11 13 + 0x7C240400, // 0024 CALL R9 2 + 0xB8261C00, // 0025 GETNGBL R9 K14 + 0x8C24130F, // 0026 GETMET R9 R9 K15 + 0x582C0010, // 0027 LDCONST R11 K16 + 0x58300011, // 0028 LDCONST R12 K17 + 0x7C240600, // 0029 CALL R9 3 + 0xB8261C00, // 002A GETNGBL R9 K14 + 0x8C24130F, // 002B GETMET R9 R9 K15 + 0x8C2C0913, // 002C GETMET R11 R4 K19 + 0x7C2C0200, // 002D CALL R11 1 + 0x002E240B, // 002E ADD R11 K18 R11 + 0x58300011, // 002F LDCONST R12 K17 + 0x7C240600, // 0030 CALL R9 3 + 0xB8261C00, // 0031 GETNGBL R9 K14 + 0x8C24130F, // 0032 GETMET R9 R9 K15 + 0x8C2C0F13, // 0033 GETMET R11 R7 K19 + 0x7C2C0200, // 0034 CALL R11 1 + 0x002E280B, // 0035 ADD R11 K20 R11 + 0x58300011, // 0036 LDCONST R12 K17 + 0x7C240600, // 0037 CALL R9 3 + 0xB8261C00, // 0038 GETNGBL R9 K14 + 0x8C24130F, // 0039 GETMET R9 R9 K15 + 0x8C2C0D13, // 003A GETMET R11 R6 K19 + 0x7C2C0200, // 003B CALL R11 1 + 0x002E2A0B, // 003C ADD R11 K21 R11 + 0x58300011, // 003D LDCONST R12 K17 + 0x7C240600, // 003E CALL R9 3 + 0xB8261C00, // 003F GETNGBL R9 K14 + 0x8C24130F, // 0040 GETMET R9 R9 K15 + 0x8C2C1113, // 0041 GETMET R11 R8 K19 + 0x7C2C0200, // 0042 CALL R11 1 + 0x002E2C0B, // 0043 ADD R11 K22 R11 + 0x58300011, // 0044 LDCONST R12 K17 + 0x7C240600, // 0045 CALL R9 3 + 0xB8261C00, // 0046 GETNGBL R9 K14 + 0x8C24130F, // 0047 GETMET R9 R9 K15 + 0x8C2C0B13, // 0048 GETMET R11 R5 K19 + 0x7C2C0200, // 0049 CALL R11 1 + 0x002E2E0B, // 004A ADD R11 K23 R11 + 0x58300011, // 004B LDCONST R12 K17 + 0x7C240600, // 004C CALL R9 3 + 0x8C240318, // 004D GETMET R9 R1 K24 + 0x5C2C0800, // 004E MOVE R11 R4 + 0x5C301000, // 004F MOVE R12 R8 + 0x5C340C00, // 0050 MOVE R13 R6 + 0x6038000C, // 0051 GETGBL R14 G12 + 0x5C3C0E00, // 0052 MOVE R15 R7 + 0x7C380200, // 0053 CALL R14 1 + 0x543E000F, // 0054 LDINT R15 16 + 0x7C240C00, // 0055 CALL R9 6 + 0x8C281319, // 0056 GETMET R10 R9 K25 + 0x5C300E00, // 0057 MOVE R12 R7 + 0x7C280400, // 0058 CALL R10 2 + 0x8C2C131A, // 0059 GETMET R11 R9 K26 + 0x7C2C0200, // 005A CALL R11 1 + 0xB8321C00, // 005B GETNGBL R12 K14 + 0x8C30190F, // 005C GETMET R12 R12 K15 + 0x58380010, // 005D LDCONST R14 K16 + 0x583C0011, // 005E LDCONST R15 K17 + 0x7C300600, // 005F CALL R12 3 + 0xB8321C00, // 0060 GETNGBL R12 K14 + 0x8C30190F, // 0061 GETMET R12 R12 K15 + 0x8C381513, // 0062 GETMET R14 R10 K19 + 0x7C380200, // 0063 CALL R14 1 + 0x003A360E, // 0064 ADD R14 K27 R14 + 0x583C0011, // 0065 LDCONST R15 K17 + 0x7C300600, // 0066 CALL R12 3 + 0xB8321C00, // 0067 GETNGBL R12 K14 + 0x8C30190F, // 0068 GETMET R12 R12 K15 + 0x8C381713, // 0069 GETMET R14 R11 K19 + 0x7C380200, // 006A CALL R14 1 + 0x003A380E, // 006B ADD R14 K28 R14 + 0x583C0011, // 006C LDCONST R15 K17 + 0x7C300600, // 006D CALL R12 3 + 0xB8321C00, // 006E GETNGBL R12 K14 + 0x8C30190F, // 006F GETMET R12 R12 K15 + 0x58380010, // 0070 LDCONST R14 K16 + 0x583C0011, // 0071 LDCONST R15 K17 + 0x7C300600, // 0072 CALL R12 3 + 0x20301605, // 0073 NE R12 R11 R5 + 0x78320006, // 0074 JMPF R12 #007C + 0xB8321C00, // 0075 GETNGBL R12 K14 + 0x8C30190F, // 0076 GETMET R12 R12 K15 + 0x5838001D, // 0077 LDCONST R14 K29 + 0x583C0011, // 0078 LDCONST R15 K17 + 0x7C300600, // 0079 CALL R12 3 + 0x4C300000, // 007A LDNIL R12 + 0x80041800, // 007B RET 1 R12 + 0x80041400, // 007C RET 1 R10 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_Frame_init, /* name */ + be_nested_proto( + 3, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(message_handler), + /* K1 */ be_nested_str_weak(raw), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x90020202, // 0001 SETMBR R0 K1 R2 + 0x80000000, // 0002 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: decode_payload +********************************************************************/ +be_local_closure(Matter_Frame_decode_payload, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[19]) { /* constants */ + /* K0 */ be_nested_str_weak(payload_idx), + /* K1 */ be_nested_str_weak(raw), + /* K2 */ be_nested_str_weak(x_flags), + /* K3 */ be_nested_str_weak(get), + /* K4 */ be_const_int(1), + /* K5 */ be_nested_str_weak(x_flag_v), + /* K6 */ be_nested_str_weak(getbits), + /* K7 */ be_nested_str_weak(x_flag_sx), + /* K8 */ be_const_int(3), + /* K9 */ be_nested_str_weak(x_flag_r), + /* K10 */ be_const_int(2), + /* K11 */ be_nested_str_weak(x_flag_a), + /* K12 */ be_nested_str_weak(x_flag_i), + /* K13 */ be_nested_str_weak(opcode), + /* K14 */ be_nested_str_weak(exchange_id), + /* K15 */ be_nested_str_weak(protocol_id), + /* K16 */ be_nested_str_weak(vendor_id), + /* K17 */ be_nested_str_weak(ack_message_counter), + /* K18 */ be_nested_str_weak(app_payload_idx), + }), + be_str_weak(decode_payload), + &be_const_str_solidified, + ( &(const binstruction[87]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x88080101, // 0001 GETMBR R2 R0 K1 + 0x8C0C0503, // 0002 GETMET R3 R2 K3 + 0x5C140200, // 0003 MOVE R5 R1 + 0x58180004, // 0004 LDCONST R6 K4 + 0x7C0C0600, // 0005 CALL R3 3 + 0x90020403, // 0006 SETMBR R0 K2 R3 + 0x8C0C0506, // 0007 GETMET R3 R2 K6 + 0x54160007, // 0008 LDINT R5 8 + 0x08140205, // 0009 MUL R5 R1 R5 + 0x541A0003, // 000A LDINT R6 4 + 0x00140A06, // 000B ADD R5 R5 R6 + 0x58180004, // 000C LDCONST R6 K4 + 0x7C0C0600, // 000D CALL R3 3 + 0x90020A03, // 000E SETMBR R0 K5 R3 + 0x8C0C0506, // 000F GETMET R3 R2 K6 + 0x54160007, // 0010 LDINT R5 8 + 0x08140205, // 0011 MUL R5 R1 R5 + 0x00140B08, // 0012 ADD R5 R5 K8 + 0x58180004, // 0013 LDCONST R6 K4 + 0x7C0C0600, // 0014 CALL R3 3 + 0x90020E03, // 0015 SETMBR R0 K7 R3 + 0x8C0C0506, // 0016 GETMET R3 R2 K6 + 0x54160007, // 0017 LDINT R5 8 + 0x08140205, // 0018 MUL R5 R1 R5 + 0x00140B0A, // 0019 ADD R5 R5 K10 + 0x58180004, // 001A LDCONST R6 K4 + 0x7C0C0600, // 001B CALL R3 3 + 0x90021203, // 001C SETMBR R0 K9 R3 + 0x8C0C0506, // 001D GETMET R3 R2 K6 + 0x54160007, // 001E LDINT R5 8 + 0x08140205, // 001F MUL R5 R1 R5 + 0x00140B04, // 0020 ADD R5 R5 K4 + 0x58180004, // 0021 LDCONST R6 K4 + 0x7C0C0600, // 0022 CALL R3 3 + 0x90021603, // 0023 SETMBR R0 K11 R3 + 0x8C0C0506, // 0024 GETMET R3 R2 K6 + 0x54160007, // 0025 LDINT R5 8 + 0x08140205, // 0026 MUL R5 R1 R5 + 0x58180004, // 0027 LDCONST R6 K4 + 0x7C0C0600, // 0028 CALL R3 3 + 0x90021803, // 0029 SETMBR R0 K12 R3 + 0x8C0C0503, // 002A GETMET R3 R2 K3 + 0x00140304, // 002B ADD R5 R1 K4 + 0x58180004, // 002C LDCONST R6 K4 + 0x7C0C0600, // 002D CALL R3 3 + 0x90021A03, // 002E SETMBR R0 K13 R3 + 0x8C0C0503, // 002F GETMET R3 R2 K3 + 0x0014030A, // 0030 ADD R5 R1 K10 + 0x5818000A, // 0031 LDCONST R6 K10 + 0x7C0C0600, // 0032 CALL R3 3 + 0x90021C03, // 0033 SETMBR R0 K14 R3 + 0x8C0C0503, // 0034 GETMET R3 R2 K3 + 0x54160003, // 0035 LDINT R5 4 + 0x00140205, // 0036 ADD R5 R1 R5 + 0x5818000A, // 0037 LDCONST R6 K10 + 0x7C0C0600, // 0038 CALL R3 3 + 0x90021E03, // 0039 SETMBR R0 K15 R3 + 0x540E0005, // 003A LDINT R3 6 + 0x00040203, // 003B ADD R1 R1 R3 + 0x880C0105, // 003C GETMBR R3 R0 K5 + 0x780E0005, // 003D JMPF R3 #0044 + 0x8C0C0503, // 003E GETMET R3 R2 K3 + 0x5C140200, // 003F MOVE R5 R1 + 0x5818000A, // 0040 LDCONST R6 K10 + 0x7C0C0600, // 0041 CALL R3 3 + 0x90022003, // 0042 SETMBR R0 K16 R3 + 0x0004030A, // 0043 ADD R1 R1 K10 + 0x880C010B, // 0044 GETMBR R3 R0 K11 + 0x780E0006, // 0045 JMPF R3 #004D + 0x8C0C0503, // 0046 GETMET R3 R2 K3 + 0x5C140200, // 0047 MOVE R5 R1 + 0x541A0003, // 0048 LDINT R6 4 + 0x7C0C0600, // 0049 CALL R3 3 + 0x90022203, // 004A SETMBR R0 K17 R3 + 0x540E0003, // 004B LDINT R3 4 + 0x00040203, // 004C ADD R1 R1 R3 + 0x880C0107, // 004D GETMBR R3 R0 K7 + 0x780E0005, // 004E JMPF R3 #0055 + 0x8C0C0503, // 004F GETMET R3 R2 K3 + 0x5C140200, // 0050 MOVE R5 R1 + 0x5818000A, // 0051 LDCONST R6 K10 + 0x7C0C0600, // 0052 CALL R3 3 + 0x0010070A, // 0053 ADD R4 R3 K10 + 0x00040204, // 0054 ADD R1 R1 R4 + 0x90022401, // 0055 SETMBR R0 K18 R1 + 0x80040000, // 0056 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: encrypt +********************************************************************/ +be_local_closure(Matter_Frame_encrypt, /* name */ + be_nested_proto( + 15, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[30]) { /* constants */ + /* K0 */ be_nested_str_weak(crypto), + /* K1 */ be_nested_str_weak(raw), + /* K2 */ be_nested_str_weak(session), + /* K3 */ be_nested_str_weak(get_r2i), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(payload_idx), + /* K6 */ be_const_int(1), + /* K7 */ be_const_int(2147483647), + /* K8 */ be_nested_str_weak(add), + /* K9 */ be_nested_str_weak(flags), + /* K10 */ be_nested_str_weak(message_counter), + /* K11 */ be_nested_str_weak(get_mode), + /* K12 */ be_nested_str_weak(__CASE), + /* K13 */ be_nested_str_weak(deviceid), + /* K14 */ be_nested_str_weak(resize), + /* K15 */ be_nested_str_weak(tasmota), + /* K16 */ be_nested_str_weak(log), + /* K17 */ be_nested_str_weak(MTR_X3A_X20cleartext_X3A_X20), + /* K18 */ be_nested_str_weak(tohex), + /* K19 */ be_const_int(3), + /* K20 */ be_nested_str_weak(MTR_X3A_X20_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A_X2A), + /* K21 */ be_nested_str_weak(MTR_X3A_X20r2i_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D), + /* K22 */ be_nested_str_weak(MTR_X3A_X20p_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D), + /* K23 */ be_nested_str_weak(MTR_X3A_X20a_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D), + /* K24 */ be_nested_str_weak(MTR_X3A_X20n_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D), + /* K25 */ be_nested_str_weak(AES_CCM), + /* K26 */ be_nested_str_weak(encrypt), + /* K27 */ be_nested_str_weak(tag), + /* K28 */ be_nested_str_weak(MTR_X3A_X20ciphertext_X20_X20_X3D), + /* K29 */ be_nested_str_weak(MTR_X3A_X20tag_X20_X20_X20_X20_X20_X20_X20_X20_X20_X3D), + }), + be_str_weak(encrypt), + &be_const_str_solidified, + ( &(const binstruction[122]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x88080101, // 0001 GETMBR R2 R0 K1 + 0x880C0102, // 0002 GETMBR R3 R0 K2 + 0x8C100703, // 0003 GETMET R4 R3 K3 + 0x7C100200, // 0004 CALL R4 1 + 0x88140105, // 0005 GETMBR R5 R0 K5 + 0x04140B06, // 0006 SUB R5 R5 K6 + 0x40160805, // 0007 CONNECT R5 K4 R5 + 0x94140405, // 0008 GETIDX R5 R2 R5 + 0x88180105, // 0009 GETMBR R6 R0 K5 + 0x40180D07, // 000A CONNECT R6 R6 K7 + 0x94180406, // 000B GETIDX R6 R2 R6 + 0x601C0015, // 000C GETGBL R7 G21 + 0x7C1C0000, // 000D CALL R7 0 + 0x8C200F08, // 000E GETMET R8 R7 K8 + 0x88280109, // 000F GETMBR R10 R0 K9 + 0x582C0006, // 0010 LDCONST R11 K6 + 0x7C200600, // 0011 CALL R8 3 + 0x8C200F08, // 0012 GETMET R8 R7 K8 + 0x8828010A, // 0013 GETMBR R10 R0 K10 + 0x542E0003, // 0014 LDINT R11 4 + 0x7C200600, // 0015 CALL R8 3 + 0x8C20070B, // 0016 GETMET R8 R3 K11 + 0x7C200200, // 0017 CALL R8 1 + 0x8824070C, // 0018 GETMBR R9 R3 K12 + 0x1C201009, // 0019 EQ R8 R8 R9 + 0x78220003, // 001A JMPF R8 #001F + 0x8820070D, // 001B GETMBR R8 R3 K13 + 0x78220001, // 001C JMPF R8 #001F + 0x8820070D, // 001D GETMBR R8 R3 K13 + 0x40200E08, // 001E CONNECT R8 R7 R8 + 0x8C200F0E, // 001F GETMET R8 R7 K14 + 0x542A000C, // 0020 LDINT R10 13 + 0x7C200400, // 0021 CALL R8 2 + 0xB8221E00, // 0022 GETNGBL R8 K15 + 0x8C201110, // 0023 GETMET R8 R8 K16 + 0x88280101, // 0024 GETMBR R10 R0 K1 + 0x8C281512, // 0025 GETMET R10 R10 K18 + 0x7C280200, // 0026 CALL R10 1 + 0x002A220A, // 0027 ADD R10 K17 R10 + 0x582C0013, // 0028 LDCONST R11 K19 + 0x7C200600, // 0029 CALL R8 3 + 0xB8221E00, // 002A GETNGBL R8 K15 + 0x8C201110, // 002B GETMET R8 R8 K16 + 0x58280014, // 002C LDCONST R10 K20 + 0x582C0013, // 002D LDCONST R11 K19 + 0x7C200600, // 002E CALL R8 3 + 0xB8221E00, // 002F GETNGBL R8 K15 + 0x8C201110, // 0030 GETMET R8 R8 K16 + 0x8C280912, // 0031 GETMET R10 R4 K18 + 0x7C280200, // 0032 CALL R10 1 + 0x002A2A0A, // 0033 ADD R10 K21 R10 + 0x582C0013, // 0034 LDCONST R11 K19 + 0x7C200600, // 0035 CALL R8 3 + 0xB8221E00, // 0036 GETNGBL R8 K15 + 0x8C201110, // 0037 GETMET R8 R8 K16 + 0x8C280D12, // 0038 GETMET R10 R6 K18 + 0x7C280200, // 0039 CALL R10 1 + 0x002A2C0A, // 003A ADD R10 K22 R10 + 0x582C0013, // 003B LDCONST R11 K19 + 0x7C200600, // 003C CALL R8 3 + 0xB8221E00, // 003D GETNGBL R8 K15 + 0x8C201110, // 003E GETMET R8 R8 K16 + 0x8C280B12, // 003F GETMET R10 R5 K18 + 0x7C280200, // 0040 CALL R10 1 + 0x002A2E0A, // 0041 ADD R10 K23 R10 + 0x582C0013, // 0042 LDCONST R11 K19 + 0x7C200600, // 0043 CALL R8 3 + 0xB8221E00, // 0044 GETNGBL R8 K15 + 0x8C201110, // 0045 GETMET R8 R8 K16 + 0x8C280F12, // 0046 GETMET R10 R7 K18 + 0x7C280200, // 0047 CALL R10 1 + 0x002A300A, // 0048 ADD R10 K24 R10 + 0x582C0013, // 0049 LDCONST R11 K19 + 0x7C200600, // 004A CALL R8 3 + 0x8C200319, // 004B GETMET R8 R1 K25 + 0x5C280800, // 004C MOVE R10 R4 + 0x5C2C0E00, // 004D MOVE R11 R7 + 0x5C300A00, // 004E MOVE R12 R5 + 0x6034000C, // 004F GETGBL R13 G12 + 0x5C380C00, // 0050 MOVE R14 R6 + 0x7C340200, // 0051 CALL R13 1 + 0x543A000F, // 0052 LDINT R14 16 + 0x7C200C00, // 0053 CALL R8 6 + 0x8C24111A, // 0054 GETMET R9 R8 K26 + 0x5C2C0C00, // 0055 MOVE R11 R6 + 0x7C240400, // 0056 CALL R9 2 + 0x8C28111B, // 0057 GETMET R10 R8 K27 + 0x7C280200, // 0058 CALL R10 1 + 0xB82E1E00, // 0059 GETNGBL R11 K15 + 0x8C2C1710, // 005A GETMET R11 R11 K16 + 0x58340014, // 005B LDCONST R13 K20 + 0x58380013, // 005C LDCONST R14 K19 + 0x7C2C0600, // 005D CALL R11 3 + 0xB82E1E00, // 005E GETNGBL R11 K15 + 0x8C2C1710, // 005F GETMET R11 R11 K16 + 0x8C341312, // 0060 GETMET R13 R9 K18 + 0x7C340200, // 0061 CALL R13 1 + 0x0036380D, // 0062 ADD R13 K28 R13 + 0x58380013, // 0063 LDCONST R14 K19 + 0x7C2C0600, // 0064 CALL R11 3 + 0xB82E1E00, // 0065 GETNGBL R11 K15 + 0x8C2C1710, // 0066 GETMET R11 R11 K16 + 0x8C341512, // 0067 GETMET R13 R10 K18 + 0x7C340200, // 0068 CALL R13 1 + 0x00363A0D, // 0069 ADD R13 K29 R13 + 0x58380013, // 006A LDCONST R14 K19 + 0x7C2C0600, // 006B CALL R11 3 + 0xB82E1E00, // 006C GETNGBL R11 K15 + 0x8C2C1710, // 006D GETMET R11 R11 K16 + 0x58340014, // 006E LDCONST R13 K20 + 0x58380013, // 006F LDCONST R14 K19 + 0x7C2C0600, // 0070 CALL R11 3 + 0x882C0101, // 0071 GETMBR R11 R0 K1 + 0x8C2C170E, // 0072 GETMET R11 R11 K14 + 0x88340105, // 0073 GETMBR R13 R0 K5 + 0x7C2C0400, // 0074 CALL R11 2 + 0x882C0101, // 0075 GETMBR R11 R0 K1 + 0x402C1609, // 0076 CONNECT R11 R11 R9 + 0x882C0101, // 0077 GETMBR R11 R0 K1 + 0x402C160A, // 0078 CONNECT R11 R11 R10 + 0x80000000, // 0079 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: build_standalone_ack +********************************************************************/ +be_local_closure(Matter_Frame_build_standalone_ack, /* name */ + be_nested_proto( + 11, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[28]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(message_handler), + /* K2 */ be_nested_str_weak(flag_s), + /* K3 */ be_nested_str_weak(flag_dsiz), + /* K4 */ be_const_int(1), + /* K5 */ be_nested_str_weak(dest_node_id_8), + /* K6 */ be_nested_str_weak(source_node_id), + /* K7 */ be_const_int(0), + /* K8 */ be_nested_str_weak(session), + /* K9 */ be_nested_str_weak(message_counter), + /* K10 */ be_nested_str_weak(counter_snd), + /* K11 */ be_nested_str_weak(next), + /* K12 */ be_nested_str_weak(local_session_id), + /* K13 */ be_nested_str_weak(initiator_session_id), + /* K14 */ be_nested_str_weak(x_flag_i), + /* K15 */ be_nested_str_weak(opcode), + /* K16 */ be_nested_str_weak(exchange_id), + /* K17 */ be_nested_str_weak(protocol_id), + /* K18 */ be_nested_str_weak(x_flag_a), + /* K19 */ be_nested_str_weak(ack_message_counter), + /* K20 */ be_nested_str_weak(x_flag_r), + /* K21 */ be_nested_str_weak(tasmota), + /* K22 */ be_nested_str_weak(log), + /* K23 */ be_nested_str_weak(format), + /* K24 */ be_nested_str_weak(MTR_X3A_X20_X3CReplied_X20_X20_X20_X20_X20_X20_X20_X25s), + /* K25 */ be_nested_str_weak(matter), + /* K26 */ be_nested_str_weak(get_opcode_name), + /* K27 */ be_const_int(2), + }), + be_str_weak(build_standalone_ack), + &be_const_str_solidified, + ( &(const binstruction[45]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x60080006, // 0001 GETGBL R2 G6 + 0x5C0C0000, // 0002 MOVE R3 R0 + 0x7C080200, // 0003 CALL R2 1 + 0x880C0101, // 0004 GETMBR R3 R0 K1 + 0x7C080200, // 0005 CALL R2 1 + 0x880C0102, // 0006 GETMBR R3 R0 K2 + 0x780E0003, // 0007 JMPF R3 #000C + 0x900A0704, // 0008 SETMBR R2 K3 K4 + 0x880C0106, // 0009 GETMBR R3 R0 K6 + 0x900A0A03, // 000A SETMBR R2 K5 R3 + 0x70020000, // 000B JMP #000D + 0x900A0707, // 000C SETMBR R2 K3 K7 + 0x880C0108, // 000D GETMBR R3 R0 K8 + 0x900A1003, // 000E SETMBR R2 K8 R3 + 0x880C0108, // 000F GETMBR R3 R0 K8 + 0x880C070A, // 0010 GETMBR R3 R3 K10 + 0x8C0C070B, // 0011 GETMET R3 R3 K11 + 0x7C0C0200, // 0012 CALL R3 1 + 0x900A1203, // 0013 SETMBR R2 K9 R3 + 0x880C0108, // 0014 GETMBR R3 R0 K8 + 0x880C070D, // 0015 GETMBR R3 R3 K13 + 0x900A1803, // 0016 SETMBR R2 K12 R3 + 0x900A1D07, // 0017 SETMBR R2 K14 K7 + 0x540E000F, // 0018 LDINT R3 16 + 0x900A1E03, // 0019 SETMBR R2 K15 R3 + 0x880C0110, // 001A GETMBR R3 R0 K16 + 0x900A2003, // 001B SETMBR R2 K16 R3 + 0x900A2307, // 001C SETMBR R2 K17 K7 + 0x900A2504, // 001D SETMBR R2 K18 K4 + 0x880C0109, // 001E GETMBR R3 R0 K9 + 0x900A2603, // 001F SETMBR R2 K19 R3 + 0x900A2907, // 0020 SETMBR R2 K20 K7 + 0xB80E2A00, // 0021 GETNGBL R3 K21 + 0x8C0C0716, // 0022 GETMET R3 R3 K22 + 0x8C140317, // 0023 GETMET R5 R1 K23 + 0x581C0018, // 0024 LDCONST R7 K24 + 0xB8223200, // 0025 GETNGBL R8 K25 + 0x8C20111A, // 0026 GETMET R8 R8 K26 + 0x8828050F, // 0027 GETMBR R10 R2 K15 + 0x7C200400, // 0028 CALL R8 2 + 0x7C140600, // 0029 CALL R5 3 + 0x5818001B, // 002A LDCONST R6 K27 + 0x7C0C0600, // 002B CALL R3 3 + 0x80040400, // 002C RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: debug +********************************************************************/ +be_local_closure(Matter_Frame_debug, /* name */ + be_nested_proto( + 8, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(Frame), + /* K2 */ be_nested_str_weak(message_handler), + /* K3 */ be_nested_str_weak(decode_header), + /* K4 */ be_nested_str_weak(decode_payload), + /* K5 */ be_nested_str_weak(tasmota), + /* K6 */ be_nested_str_weak(log), + /* K7 */ be_nested_str_weak(MTR_X3A_X20sending_X20decode_X3A_X20), + /* K8 */ be_nested_str_weak(inspect), + /* K9 */ be_const_int(3), + }), + be_str_weak(debug), + &be_const_str_solidified, + ( &(const binstruction[19]) { /* code */ + 0xB80A0000, // 0000 GETNGBL R2 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x88100102, // 0002 GETMBR R4 R0 K2 + 0x5C140200, // 0003 MOVE R5 R1 + 0x7C080600, // 0004 CALL R2 3 + 0x8C0C0503, // 0005 GETMET R3 R2 K3 + 0x7C0C0200, // 0006 CALL R3 1 + 0x8C0C0504, // 0007 GETMET R3 R2 K4 + 0x7C0C0200, // 0008 CALL R3 1 + 0xB80E0A00, // 0009 GETNGBL R3 K5 + 0x8C0C0706, // 000A GETMET R3 R3 K6 + 0xB8160000, // 000B GETNGBL R5 K0 + 0x8C140B08, // 000C GETMET R5 R5 K8 + 0x5C1C0400, // 000D MOVE R7 R2 + 0x7C140400, // 000E CALL R5 2 + 0x00160E05, // 000F ADD R5 K7 R5 + 0x58180009, // 0010 LDCONST R6 K9 + 0x7C0C0600, // 0011 CALL R3 3 + 0x80000000, // 0012 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: encode +********************************************************************/ +be_local_closure(Matter_Frame_encode, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[30]) { /* constants */ + /* K0 */ be_nested_str_weak(flags), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str_weak(flag_s), + /* K3 */ be_nested_str_weak(flag_dsiz), + /* K4 */ be_const_int(3), + /* K5 */ be_nested_str_weak(add), + /* K6 */ be_const_int(1), + /* K7 */ be_nested_str_weak(local_session_id), + /* K8 */ be_const_int(2), + /* K9 */ be_nested_str_weak(sec_flags), + /* K10 */ be_nested_str_weak(sec_p), + /* K11 */ be_nested_str_weak(sec_c), + /* K12 */ be_nested_str_weak(sec_sesstype), + /* K13 */ be_nested_str_weak(message_counter), + /* K14 */ be_nested_str_weak(source_node_id), + /* K15 */ be_nested_str_weak(dest_node_id_8), + /* K16 */ be_nested_str_weak(dest_node_id_2), + /* K17 */ be_nested_str_weak(payload_idx), + /* K18 */ be_nested_str_weak(x_flags), + /* K19 */ be_nested_str_weak(x_flag_v), + /* K20 */ be_nested_str_weak(x_flag_r), + /* K21 */ be_nested_str_weak(x_flag_a), + /* K22 */ be_nested_str_weak(x_flag_i), + /* K23 */ be_nested_str_weak(opcode), + /* K24 */ be_nested_str_weak(exchange_id), + /* K25 */ be_nested_str_weak(protocol_id), + /* K26 */ be_nested_str_weak(ack_message_counter), + /* K27 */ be_nested_str_weak(app_payload_idx), + /* K28 */ be_nested_str_weak(debug), + /* K29 */ be_nested_str_weak(raw), + }), + be_str_weak(encode), + &be_const_str_solidified, + ( &(const binstruction[144]) { /* code */ + 0x60080015, // 0000 GETGBL R2 G21 + 0x7C080000, // 0001 CALL R2 0 + 0x880C0100, // 0002 GETMBR R3 R0 K0 + 0x4C100000, // 0003 LDNIL R4 + 0x1C0C0604, // 0004 EQ R3 R3 R4 + 0x780E000D, // 0005 JMPF R3 #0014 + 0x90020101, // 0006 SETMBR R0 K0 K1 + 0x880C0102, // 0007 GETMBR R3 R0 K2 + 0x780E0003, // 0008 JMPF R3 #000D + 0x880C0100, // 0009 GETMBR R3 R0 K0 + 0x54120003, // 000A LDINT R4 4 + 0x300C0604, // 000B OR R3 R3 R4 + 0x90020003, // 000C SETMBR R0 K0 R3 + 0x880C0103, // 000D GETMBR R3 R0 K3 + 0x780E0004, // 000E JMPF R3 #0014 + 0x880C0100, // 000F GETMBR R3 R0 K0 + 0x88100103, // 0010 GETMBR R4 R0 K3 + 0x2C100904, // 0011 AND R4 R4 K4 + 0x300C0604, // 0012 OR R3 R3 R4 + 0x90020003, // 0013 SETMBR R0 K0 R3 + 0x8C0C0505, // 0014 GETMET R3 R2 K5 + 0x88140100, // 0015 GETMBR R5 R0 K0 + 0x58180006, // 0016 LDCONST R6 K6 + 0x7C0C0600, // 0017 CALL R3 3 + 0x8C0C0505, // 0018 GETMET R3 R2 K5 + 0x88140107, // 0019 GETMBR R5 R0 K7 + 0x78160001, // 001A JMPF R5 #001D + 0x88140107, // 001B GETMBR R5 R0 K7 + 0x70020000, // 001C JMP #001E + 0x58140001, // 001D LDCONST R5 K1 + 0x58180008, // 001E LDCONST R6 K8 + 0x7C0C0600, // 001F CALL R3 3 + 0x880C0109, // 0020 GETMBR R3 R0 K9 + 0x4C100000, // 0021 LDNIL R4 + 0x1C0C0604, // 0022 EQ R3 R3 R4 + 0x780E0013, // 0023 JMPF R3 #0038 + 0x90021301, // 0024 SETMBR R0 K9 K1 + 0x880C010A, // 0025 GETMBR R3 R0 K10 + 0x780E0003, // 0026 JMPF R3 #002B + 0x880C0109, // 0027 GETMBR R3 R0 K9 + 0x5412007F, // 0028 LDINT R4 128 + 0x300C0604, // 0029 OR R3 R3 R4 + 0x90021203, // 002A SETMBR R0 K9 R3 + 0x880C010B, // 002B GETMBR R3 R0 K11 + 0x780E0003, // 002C JMPF R3 #0031 + 0x880C0109, // 002D GETMBR R3 R0 K9 + 0x5412003F, // 002E LDINT R4 64 + 0x300C0604, // 002F OR R3 R3 R4 + 0x90021203, // 0030 SETMBR R0 K9 R3 + 0x880C010C, // 0031 GETMBR R3 R0 K12 + 0x780E0004, // 0032 JMPF R3 #0038 + 0x880C0109, // 0033 GETMBR R3 R0 K9 + 0x8810010C, // 0034 GETMBR R4 R0 K12 + 0x2C100904, // 0035 AND R4 R4 K4 + 0x300C0604, // 0036 OR R3 R3 R4 + 0x90021203, // 0037 SETMBR R0 K9 R3 + 0x8C0C0505, // 0038 GETMET R3 R2 K5 + 0x88140109, // 0039 GETMBR R5 R0 K9 + 0x58180006, // 003A LDCONST R6 K6 + 0x7C0C0600, // 003B CALL R3 3 + 0x8C0C0505, // 003C GETMET R3 R2 K5 + 0x8814010D, // 003D GETMBR R5 R0 K13 + 0x541A0003, // 003E LDINT R6 4 + 0x7C0C0600, // 003F CALL R3 3 + 0x880C0102, // 0040 GETMBR R3 R0 K2 + 0x780E0001, // 0041 JMPF R3 #0044 + 0x880C010E, // 0042 GETMBR R3 R0 K14 + 0x400C0403, // 0043 CONNECT R3 R2 R3 + 0x880C0103, // 0044 GETMBR R3 R0 K3 + 0x1C0C0706, // 0045 EQ R3 R3 K6 + 0x780E0001, // 0046 JMPF R3 #0049 + 0x880C010F, // 0047 GETMBR R3 R0 K15 + 0x400C0403, // 0048 CONNECT R3 R2 R3 + 0x880C0103, // 0049 GETMBR R3 R0 K3 + 0x1C0C0708, // 004A EQ R3 R3 K8 + 0x780E0003, // 004B JMPF R3 #0050 + 0x8C0C0505, // 004C GETMET R3 R2 K5 + 0x88140110, // 004D GETMBR R5 R0 K16 + 0x58180008, // 004E LDCONST R6 K8 + 0x7C0C0600, // 004F CALL R3 3 + 0x600C000C, // 0050 GETGBL R3 G12 + 0x5C100400, // 0051 MOVE R4 R2 + 0x7C0C0200, // 0052 CALL R3 1 + 0x90022203, // 0053 SETMBR R0 K17 R3 + 0x880C0112, // 0054 GETMBR R3 R0 K18 + 0x4C100000, // 0055 LDNIL R4 + 0x1C0C0604, // 0056 EQ R3 R3 R4 + 0x780E0016, // 0057 JMPF R3 #006F + 0x90022501, // 0058 SETMBR R0 K18 K1 + 0x880C0113, // 0059 GETMBR R3 R0 K19 + 0x780E0003, // 005A JMPF R3 #005F + 0x880C0112, // 005B GETMBR R3 R0 K18 + 0x5412000F, // 005C LDINT R4 16 + 0x300C0604, // 005D OR R3 R3 R4 + 0x90022403, // 005E SETMBR R0 K18 R3 + 0x880C0114, // 005F GETMBR R3 R0 K20 + 0x780E0003, // 0060 JMPF R3 #0065 + 0x880C0112, // 0061 GETMBR R3 R0 K18 + 0x54120003, // 0062 LDINT R4 4 + 0x300C0604, // 0063 OR R3 R3 R4 + 0x90022403, // 0064 SETMBR R0 K18 R3 + 0x880C0115, // 0065 GETMBR R3 R0 K21 + 0x780E0002, // 0066 JMPF R3 #006A + 0x880C0112, // 0067 GETMBR R3 R0 K18 + 0x300C0708, // 0068 OR R3 R3 K8 + 0x90022403, // 0069 SETMBR R0 K18 R3 + 0x880C0116, // 006A GETMBR R3 R0 K22 + 0x780E0002, // 006B JMPF R3 #006F + 0x880C0112, // 006C GETMBR R3 R0 K18 + 0x300C0706, // 006D OR R3 R3 K6 + 0x90022403, // 006E SETMBR R0 K18 R3 + 0x8C0C0505, // 006F GETMET R3 R2 K5 + 0x88140112, // 0070 GETMBR R5 R0 K18 + 0x58180006, // 0071 LDCONST R6 K6 + 0x7C0C0600, // 0072 CALL R3 3 + 0x8C0C0505, // 0073 GETMET R3 R2 K5 + 0x88140117, // 0074 GETMBR R5 R0 K23 + 0x58180006, // 0075 LDCONST R6 K6 + 0x7C0C0600, // 0076 CALL R3 3 + 0x8C0C0505, // 0077 GETMET R3 R2 K5 + 0x88140118, // 0078 GETMBR R5 R0 K24 + 0x58180008, // 0079 LDCONST R6 K8 + 0x7C0C0600, // 007A CALL R3 3 + 0x8C0C0505, // 007B GETMET R3 R2 K5 + 0x88140119, // 007C GETMBR R5 R0 K25 + 0x58180008, // 007D LDCONST R6 K8 + 0x7C0C0600, // 007E CALL R3 3 + 0x880C0115, // 007F GETMBR R3 R0 K21 + 0x780E0003, // 0080 JMPF R3 #0085 + 0x8C0C0505, // 0081 GETMET R3 R2 K5 + 0x8814011A, // 0082 GETMBR R5 R0 K26 + 0x541A0003, // 0083 LDINT R6 4 + 0x7C0C0600, // 0084 CALL R3 3 + 0x600C000C, // 0085 GETGBL R3 G12 + 0x5C100400, // 0086 MOVE R4 R2 + 0x7C0C0200, // 0087 CALL R3 1 + 0x90023603, // 0088 SETMBR R0 K27 R3 + 0x78060000, // 0089 JMPF R1 #008B + 0x400C0401, // 008A CONNECT R3 R2 R1 + 0x8C0C011C, // 008B GETMET R3 R0 K28 + 0x5C140400, // 008C MOVE R5 R2 + 0x7C0C0400, // 008D CALL R3 2 + 0x90023A02, // 008E SETMBR R0 K29 R2 + 0x80040400, // 008F RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: build_response +********************************************************************/ +be_local_closure(Matter_Frame_build_response, /* name */ + be_nested_proto( + 12, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[30]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(message_handler), + /* K2 */ be_nested_str_weak(flag_s), + /* K3 */ be_nested_str_weak(flag_dsiz), + /* K4 */ be_const_int(1), + /* K5 */ be_nested_str_weak(dest_node_id_8), + /* K6 */ be_nested_str_weak(source_node_id), + /* K7 */ be_const_int(0), + /* K8 */ be_nested_str_weak(session), + /* K9 */ be_nested_str_weak(local_session_id), + /* K10 */ be_nested_str_weak(initiator_session_id), + /* K11 */ be_nested_str_weak(message_counter), + /* K12 */ be_nested_str_weak(counter_snd), + /* K13 */ be_nested_str_weak(next), + /* K14 */ be_nested_str_weak(_counter_insecure_snd), + /* K15 */ be_nested_str_weak(x_flag_i), + /* K16 */ be_nested_str_weak(opcode), + /* K17 */ be_nested_str_weak(exchange_id), + /* K18 */ be_nested_str_weak(protocol_id), + /* K19 */ be_nested_str_weak(x_flag_r), + /* K20 */ be_nested_str_weak(x_flag_a), + /* K21 */ be_nested_str_weak(ack_message_counter), + /* K22 */ be_nested_str_weak(matter), + /* K23 */ be_nested_str_weak(get_opcode_name), + /* K24 */ be_nested_str_weak(format), + /* K25 */ be_nested_str_weak(0x_X2502X), + /* K26 */ be_nested_str_weak(tasmota), + /* K27 */ be_nested_str_weak(log), + /* K28 */ be_nested_str_weak(MTR_X3A_X20_X3CReplied_X20_X20_X20_X20_X20_X20_X20_X25s), + /* K29 */ be_const_int(2), + }), + be_str_weak(build_response), + &be_const_str_solidified, + ( &(const binstruction[78]) { /* code */ + 0xA40E0000, // 0000 IMPORT R3 K0 + 0x60100006, // 0001 GETGBL R4 G6 + 0x5C140000, // 0002 MOVE R5 R0 + 0x7C100200, // 0003 CALL R4 1 + 0x88140101, // 0004 GETMBR R5 R0 K1 + 0x7C100200, // 0005 CALL R4 1 + 0x88140102, // 0006 GETMBR R5 R0 K2 + 0x78160003, // 0007 JMPF R5 #000C + 0x90120704, // 0008 SETMBR R4 K3 K4 + 0x88140106, // 0009 GETMBR R5 R0 K6 + 0x90120A05, // 000A SETMBR R4 K5 R5 + 0x70020000, // 000B JMP #000D + 0x90120707, // 000C SETMBR R4 K3 K7 + 0x88140108, // 000D GETMBR R5 R0 K8 + 0x90121005, // 000E SETMBR R4 K8 R5 + 0x88140109, // 000F GETMBR R5 R0 K9 + 0x20140B07, // 0010 NE R5 R5 K7 + 0x7816000E, // 0011 JMPF R5 #0021 + 0x88140108, // 0012 GETMBR R5 R0 K8 + 0x7816000C, // 0013 JMPF R5 #0021 + 0x88140108, // 0014 GETMBR R5 R0 K8 + 0x88140B0A, // 0015 GETMBR R5 R5 K10 + 0x20140B07, // 0016 NE R5 R5 K7 + 0x78160008, // 0017 JMPF R5 #0021 + 0x88140108, // 0018 GETMBR R5 R0 K8 + 0x88140B0C, // 0019 GETMBR R5 R5 K12 + 0x8C140B0D, // 001A GETMET R5 R5 K13 + 0x7C140200, // 001B CALL R5 1 + 0x90121605, // 001C SETMBR R4 K11 R5 + 0x88140108, // 001D GETMBR R5 R0 K8 + 0x88140B0A, // 001E GETMBR R5 R5 K10 + 0x90121205, // 001F SETMBR R4 K9 R5 + 0x70020005, // 0020 JMP #0027 + 0x88140108, // 0021 GETMBR R5 R0 K8 + 0x88140B0E, // 0022 GETMBR R5 R5 K14 + 0x8C140B0D, // 0023 GETMET R5 R5 K13 + 0x7C140200, // 0024 CALL R5 1 + 0x90121605, // 0025 SETMBR R4 K11 R5 + 0x90121307, // 0026 SETMBR R4 K9 K7 + 0x90121F07, // 0027 SETMBR R4 K15 K7 + 0x90122001, // 0028 SETMBR R4 K16 R1 + 0x88140111, // 0029 GETMBR R5 R0 K17 + 0x90122205, // 002A SETMBR R4 K17 R5 + 0x88140112, // 002B GETMBR R5 R0 K18 + 0x90122405, // 002C SETMBR R4 K18 R5 + 0x88140113, // 002D GETMBR R5 R0 K19 + 0x78160002, // 002E JMPF R5 #0032 + 0x90122904, // 002F SETMBR R4 K20 K4 + 0x8814010B, // 0030 GETMBR R5 R0 K11 + 0x90122A05, // 0031 SETMBR R4 K21 R5 + 0x780A0001, // 0032 JMPF R2 #0035 + 0x58140004, // 0033 LDCONST R5 K4 + 0x70020000, // 0034 JMP #0036 + 0x58140007, // 0035 LDCONST R5 K7 + 0x90122605, // 0036 SETMBR R4 K19 R5 + 0x88140909, // 0037 GETMBR R5 R4 K9 + 0x1C140B07, // 0038 EQ R5 R5 K7 + 0x78160012, // 0039 JMPF R5 #004D + 0xB8162C00, // 003A GETNGBL R5 K22 + 0x8C140B17, // 003B GETMET R5 R5 K23 + 0x881C0910, // 003C GETMBR R7 R4 K16 + 0x7C140400, // 003D CALL R5 2 + 0x5C180A00, // 003E MOVE R6 R5 + 0x741A0004, // 003F JMPT R6 #0045 + 0x8C180718, // 0040 GETMET R6 R3 K24 + 0x58200019, // 0041 LDCONST R8 K25 + 0x88240910, // 0042 GETMBR R9 R4 K16 + 0x7C180600, // 0043 CALL R6 3 + 0x5C140C00, // 0044 MOVE R5 R6 + 0xB81A3400, // 0045 GETNGBL R6 K26 + 0x8C180D1B, // 0046 GETMET R6 R6 K27 + 0x8C200718, // 0047 GETMET R8 R3 K24 + 0x5828001C, // 0048 LDCONST R10 K28 + 0x5C2C0A00, // 0049 MOVE R11 R5 + 0x7C200600, // 004A CALL R8 3 + 0x5824001D, // 004B LDCONST R9 K29 + 0x7C180600, // 004C CALL R6 3 + 0x80040800, // 004D RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: decode_header +********************************************************************/ +be_local_closure(Matter_Frame_decode_header, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[21]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str_weak(raw), + /* K2 */ be_nested_str_weak(flags), + /* K3 */ be_nested_str_weak(get), + /* K4 */ be_const_int(1), + /* K5 */ be_nested_str_weak(flag_s), + /* K6 */ be_nested_str_weak(getbits), + /* K7 */ be_const_int(2), + /* K8 */ be_nested_str_weak(flag_dsiz), + /* K9 */ be_const_int(3), + /* K10 */ be_nested_str_weak(sec_flags), + /* K11 */ be_nested_str_weak(sec_p), + /* K12 */ be_nested_str_weak(sec_c), + /* K13 */ be_nested_str_weak(sec_mx), + /* K14 */ be_nested_str_weak(sec_sesstype), + /* K15 */ be_nested_str_weak(local_session_id), + /* K16 */ be_nested_str_weak(message_counter), + /* K17 */ be_nested_str_weak(source_node_id), + /* K18 */ be_nested_str_weak(dest_node_id_8), + /* K19 */ be_nested_str_weak(dest_node_id_2), + /* K20 */ be_nested_str_weak(payload_idx), + }), + be_str_weak(decode_header), + &be_const_str_solidified, + ( &(const binstruction[121]) { /* code */ + 0x58040000, // 0000 LDCONST R1 K0 + 0x88080101, // 0001 GETMBR R2 R0 K1 + 0x8C0C0503, // 0002 GETMET R3 R2 K3 + 0x58140000, // 0003 LDCONST R5 K0 + 0x58180004, // 0004 LDCONST R6 K4 + 0x7C0C0600, // 0005 CALL R3 3 + 0x90020403, // 0006 SETMBR R0 K2 R3 + 0x880C0102, // 0007 GETMBR R3 R0 K2 + 0x541200F7, // 0008 LDINT R4 248 + 0x2C0C0604, // 0009 AND R3 R3 R4 + 0x200C0700, // 000A NE R3 R3 K0 + 0x780E0001, // 000B JMPF R3 #000E + 0x500C0000, // 000C LDBOOL R3 0 0 + 0x80040600, // 000D RET 1 R3 + 0x8C0C0506, // 000E GETMET R3 R2 K6 + 0x58140007, // 000F LDCONST R5 K7 + 0x58180004, // 0010 LDCONST R6 K4 + 0x7C0C0600, // 0011 CALL R3 3 + 0x90020A03, // 0012 SETMBR R0 K5 R3 + 0x8C0C0506, // 0013 GETMET R3 R2 K6 + 0x58140000, // 0014 LDCONST R5 K0 + 0x58180007, // 0015 LDCONST R6 K7 + 0x7C0C0600, // 0016 CALL R3 3 + 0x90021003, // 0017 SETMBR R0 K8 R3 + 0x880C0108, // 0018 GETMBR R3 R0 K8 + 0x1C0C0709, // 0019 EQ R3 R3 K9 + 0x780E0001, // 001A JMPF R3 #001D + 0x500C0000, // 001B LDBOOL R3 0 0 + 0x80040600, // 001C RET 1 R3 + 0x8C0C0503, // 001D GETMET R3 R2 K3 + 0x58140009, // 001E LDCONST R5 K9 + 0x58180004, // 001F LDCONST R6 K4 + 0x7C0C0600, // 0020 CALL R3 3 + 0x90021403, // 0021 SETMBR R0 K10 R3 + 0x8C0C0506, // 0022 GETMET R3 R2 K6 + 0x54160007, // 0023 LDINT R5 8 + 0x08161205, // 0024 MUL R5 K9 R5 + 0x541A0006, // 0025 LDINT R6 7 + 0x00140A06, // 0026 ADD R5 R5 R6 + 0x58180004, // 0027 LDCONST R6 K4 + 0x7C0C0600, // 0028 CALL R3 3 + 0x90021603, // 0029 SETMBR R0 K11 R3 + 0x8C0C0506, // 002A GETMET R3 R2 K6 + 0x54160007, // 002B LDINT R5 8 + 0x08161205, // 002C MUL R5 K9 R5 + 0x541A0005, // 002D LDINT R6 6 + 0x00140A06, // 002E ADD R5 R5 R6 + 0x58180004, // 002F LDCONST R6 K4 + 0x7C0C0600, // 0030 CALL R3 3 + 0x90021803, // 0031 SETMBR R0 K12 R3 + 0x8C0C0506, // 0032 GETMET R3 R2 K6 + 0x54160007, // 0033 LDINT R5 8 + 0x08161205, // 0034 MUL R5 K9 R5 + 0x541A0004, // 0035 LDINT R6 5 + 0x00140A06, // 0036 ADD R5 R5 R6 + 0x58180004, // 0037 LDCONST R6 K4 + 0x7C0C0600, // 0038 CALL R3 3 + 0x90021A03, // 0039 SETMBR R0 K13 R3 + 0x8C0C0506, // 003A GETMET R3 R2 K6 + 0x54160007, // 003B LDINT R5 8 + 0x08161205, // 003C MUL R5 K9 R5 + 0x58180007, // 003D LDCONST R6 K7 + 0x7C0C0600, // 003E CALL R3 3 + 0x90021C03, // 003F SETMBR R0 K14 R3 + 0x880C010E, // 0040 GETMBR R3 R0 K14 + 0x240C0704, // 0041 GT R3 R3 K4 + 0x780E0001, // 0042 JMPF R3 #0045 + 0x500C0000, // 0043 LDBOOL R3 0 0 + 0x80040600, // 0044 RET 1 R3 + 0x8C0C0503, // 0045 GETMET R3 R2 K3 + 0x58140004, // 0046 LDCONST R5 K4 + 0x58180007, // 0047 LDCONST R6 K7 + 0x7C0C0600, // 0048 CALL R3 3 + 0x90021E03, // 0049 SETMBR R0 K15 R3 + 0x8C0C0503, // 004A GETMET R3 R2 K3 + 0x54160003, // 004B LDINT R5 4 + 0x541A0003, // 004C LDINT R6 4 + 0x7C0C0600, // 004D CALL R3 3 + 0x90022003, // 004E SETMBR R0 K16 R3 + 0x540E0007, // 004F LDINT R3 8 + 0x00040203, // 0050 ADD R1 R1 R3 + 0x880C0105, // 0051 GETMBR R3 R0 K5 + 0x780E0006, // 0052 JMPF R3 #005A + 0x540E0006, // 0053 LDINT R3 7 + 0x000C0203, // 0054 ADD R3 R1 R3 + 0x400C0203, // 0055 CONNECT R3 R1 R3 + 0x940C0403, // 0056 GETIDX R3 R2 R3 + 0x90022203, // 0057 SETMBR R0 K17 R3 + 0x540E0007, // 0058 LDINT R3 8 + 0x00040203, // 0059 ADD R1 R1 R3 + 0x880C0108, // 005A GETMBR R3 R0 K8 + 0x1C0C0704, // 005B EQ R3 R3 K4 + 0x780E0007, // 005C JMPF R3 #0065 + 0x540E0006, // 005D LDINT R3 7 + 0x000C0203, // 005E ADD R3 R1 R3 + 0x400C0203, // 005F CONNECT R3 R1 R3 + 0x940C0403, // 0060 GETIDX R3 R2 R3 + 0x90022403, // 0061 SETMBR R0 K18 R3 + 0x540E0007, // 0062 LDINT R3 8 + 0x00040203, // 0063 ADD R1 R1 R3 + 0x70020008, // 0064 JMP #006E + 0x880C0108, // 0065 GETMBR R3 R0 K8 + 0x1C0C0707, // 0066 EQ R3 R3 K7 + 0x780E0005, // 0067 JMPF R3 #006E + 0x8C0C0503, // 0068 GETMET R3 R2 K3 + 0x5C140200, // 0069 MOVE R5 R1 + 0x58180007, // 006A LDCONST R6 K7 + 0x7C0C0600, // 006B CALL R3 3 + 0x90022603, // 006C SETMBR R0 K19 R3 + 0x00040307, // 006D ADD R1 R1 K7 + 0x880C010D, // 006E GETMBR R3 R0 K13 + 0x780E0005, // 006F JMPF R3 #0076 + 0x8C0C0503, // 0070 GETMET R3 R2 K3 + 0x5C140200, // 0071 MOVE R5 R1 + 0x58180007, // 0072 LDCONST R6 K7 + 0x7C0C0600, // 0073 CALL R3 3 + 0x00100707, // 0074 ADD R4 R3 K7 + 0x00040204, // 0075 ADD R1 R1 R4 + 0x90022801, // 0076 SETMBR R0 K20 R1 + 0x500C0200, // 0077 LDBOOL R3 1 0 + 0x80040600, // 0078 RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_Frame +********************************************************************/ +be_local_class(Matter_Frame, + 30, + NULL, + be_nested_map(39, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(ack_message_counter, -1), be_const_var(27) }, + { be_const_key_weak(x_flag_r, -1), be_const_var(20) }, + { be_const_key_weak(dest_node_id_2, -1), be_const_var(15) }, + { be_const_key_weak(message_counter, -1), be_const_var(13) }, + { be_const_key_weak(sec_p, 15), be_const_var(9) }, + { be_const_key_weak(init, -1), be_const_closure(Matter_Frame_init_closure) }, + { be_const_key_weak(protocol_id, 31), be_const_var(25) }, + { be_const_key_weak(session, -1), be_const_var(1) }, + { be_const_key_weak(sec_flags, 13), be_const_var(8) }, + { be_const_key_weak(x_flag_sx, 20), be_const_var(19) }, + { be_const_key_weak(sec_mx, -1), be_const_var(11) }, + { be_const_key_weak(encode, -1), be_const_closure(Matter_Frame_encode_closure) }, + { be_const_key_weak(local_session_id, -1), be_const_var(7) }, + { be_const_key_weak(flags, 38), be_const_var(4) }, + { be_const_key_weak(exchange_id, -1), be_const_var(24) }, + { be_const_key_weak(payload_idx, 10), be_const_var(3) }, + { be_const_key_weak(dest_node_id_8, -1), be_const_var(16) }, + { be_const_key_weak(x_flag_i, -1), be_const_var(22) }, + { be_const_key_weak(flag_s, -1), be_const_var(5) }, + { be_const_key_weak(app_payload_idx, 14), be_const_var(29) }, + { be_const_key_weak(flag_dsiz, 12), be_const_var(6) }, + { be_const_key_weak(encrypt, -1), be_const_closure(Matter_Frame_encrypt_closure) }, + { be_const_key_weak(x_flags, -1), be_const_var(17) }, + { be_const_key_weak(x_flag_v, 22), be_const_var(18) }, + { be_const_key_weak(sec_sesstype, -1), be_const_var(12) }, + { be_const_key_weak(x_flag_a, -1), be_const_var(21) }, + { be_const_key_weak(message_handler, 28), be_const_var(0) }, + { be_const_key_weak(sec_extensions, 24), be_const_var(28) }, + { be_const_key_weak(raw, -1), be_const_var(2) }, + { be_const_key_weak(opcode, -1), be_const_var(23) }, + { be_const_key_weak(sec_c, 17), be_const_var(10) }, + { be_const_key_weak(decode_payload, 5), be_const_closure(Matter_Frame_decode_payload_closure) }, + { be_const_key_weak(build_standalone_ack, 2), be_const_closure(Matter_Frame_build_standalone_ack_closure) }, + { be_const_key_weak(vendor_id, -1), be_const_var(26) }, + { be_const_key_weak(debug, -1), be_const_closure(Matter_Frame_debug_closure) }, + { be_const_key_weak(source_node_id, 11), be_const_var(14) }, + { be_const_key_weak(build_response, -1), be_const_closure(Matter_Frame_build_response_closure) }, + { be_const_key_weak(decode_header, -1), be_const_closure(Matter_Frame_decode_header_closure) }, + { be_const_key_weak(decrypt, -1), be_const_closure(Matter_Frame_decrypt_closure) }, + })), + be_str_weak(Matter_Frame) +); +/*******************************************************************/ + +void be_load_Matter_Frame_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_Frame); + be_setglobal(vm, "Matter_Frame"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_MessageHandler.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_MessageHandler.h new file mode 100644 index 000000000..d5e22cd1b --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_MessageHandler.h @@ -0,0 +1,582 @@ +/* Solidification of Matter_MessageHandler.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_MessageHandler; + +/******************************************************************** +** Solidified function: send_response +********************************************************************/ +be_local_closure(Matter_MessageHandler_send_response, /* name */ + be_nested_proto( + 11, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(device), + /* K1 */ be_nested_str_weak(msg_send), + }), + be_str_weak(send_response), + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0x88140100, // 0000 GETMBR R5 R0 K0 + 0x8C140B01, // 0001 GETMET R5 R5 K1 + 0x5C1C0200, // 0002 MOVE R7 R1 + 0x5C200400, // 0003 MOVE R8 R2 + 0x5C240600, // 0004 MOVE R9 R3 + 0x5C280800, // 0005 MOVE R10 R4 + 0x7C140A00, // 0006 CALL R5 5 + 0x80000000, // 0007 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: msg_received +********************************************************************/ +be_local_closure(Matter_MessageHandler_msg_received, /* name */ + be_nested_proto( + 17, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[59]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(tasmota), + /* K2 */ be_nested_str_weak(log), + /* K3 */ be_nested_str_weak(MTR_X3A_X20MessageHandler_X3A_X3Amsg_received_X20raw_X3D), + /* K4 */ be_nested_str_weak(tohex), + /* K5 */ be_nested_str_weak(matter), + /* K6 */ be_nested_str_weak(Frame), + /* K7 */ be_nested_str_weak(decode_header), + /* K8 */ be_nested_str_weak(local_session_id), + /* K9 */ be_const_int(0), + /* K10 */ be_nested_str_weak(sec_sesstype), + /* K11 */ be_nested_str_weak(device), + /* K12 */ be_nested_str_weak(sessions), + /* K13 */ be_nested_str_weak(find_session_source_id_unsecure), + /* K14 */ be_nested_str_weak(source_node_id), + /* K15 */ be_nested_str_weak(MTR_X3A_X20find_X20session_X20by_X20source_node_id_X20_X3D_X20), + /* K16 */ be_nested_str_weak(session_id_X20_X3D_X20), + /* K17 */ be_const_int(3), + /* K18 */ be_nested_str_weak(session), + /* K19 */ be_nested_str_weak(counter_rcv), + /* K20 */ be_nested_str_weak(validate), + /* K21 */ be_nested_str_weak(message_counter), + /* K22 */ be_nested_str_weak(format), + /* K23 */ be_nested_str_weak(MTR_X3A_X20rejected_X20duplicate_X20unencrypted_X20message_X20_X3D_X20_X25i_X20ref_X20_X3D_X20_X25i), + /* K24 */ be_nested_str_weak(val), + /* K25 */ be_nested_str_weak(decode_payload), + /* K26 */ be_nested_str_weak(packet_ack), + /* K27 */ be_nested_str_weak(ack_message_counter), + /* K28 */ be_nested_str_weak(opcode), + /* K29 */ be_nested_str_weak(get_opcode_name), + /* K30 */ be_nested_str_weak(0x_X2502X), + /* K31 */ be_nested_str_weak(MTR_X3A_X20_X3EReceived_X20_X20_X20_X20_X20_X20_X25s_X20from_X20_X5B_X25s_X5D_X3A_X25i), + /* K32 */ be_const_int(2), + /* K33 */ be_nested_str_weak(commissioning), + /* K34 */ be_nested_str_weak(process_incoming), + /* K35 */ be_nested_str_weak(MTR_X3A_X20decode_X20header_X3A_X20local_session_id_X3D_X25i_X20message_counter_X3D_X25i), + /* K36 */ be_nested_str_weak(get_session_by_local_session_id), + /* K37 */ be_nested_str_weak(MTR_X3A_X20unknown_X20local_session_id_X20), + /* K38 */ be_nested_str_weak(MTR_X3A_X20frame_X3D), + /* K39 */ be_nested_str_weak(inspect), + /* K40 */ be_nested_str_weak(MTR_X3A_X20rejected_X20duplicate_X20encrypted_X20message_X20_X3D_X20), + /* K41 */ be_nested_str_weak(_X20counter_X3D), + /* K42 */ be_nested_str_weak(decrypt), + /* K43 */ be_nested_str_weak(raw), + /* K44 */ be_nested_str_weak(payload_idx), + /* K45 */ be_const_int(1), + /* K46 */ be_nested_str_weak(MTR_X3A_X20idx_X3D_X25i_X20clear_X3D_X25s), + /* K47 */ be_nested_str_weak(MTR_X3A_X20decrypted_X20message_X3A_X20protocol_id_X3A), + /* K48 */ be_nested_str_weak(protocol_id), + /* K49 */ be_nested_str_weak(_X20opcode_X3D), + /* K50 */ be_nested_str_weak(_X20exchange_id), + /* K51 */ be_nested_str_weak(exchange_id), + /* K52 */ be_nested_str_weak(MTR_X3A_X20PROTOCOL_ID_SECURE_CHANNEL_X20), + /* K53 */ be_nested_str_weak(im), + /* K54 */ be_nested_str_weak(MTR_X3A_X20ignoring_X20unhandled_X20protocol_id_X3A), + /* K55 */ be_nested_str_weak(MTR_X3A_X20MessageHandler_X3A_X3Amsg_received_X20exception_X3A_X20), + /* K56 */ be_nested_str_weak(_X3B), + /* K57 */ be_nested_str_weak(debug), + /* K58 */ be_nested_str_weak(traceback), + }), + be_str_weak(msg_received), + &be_const_str_solidified, + ( &(const binstruction[289]) { /* code */ + 0xA4120000, // 0000 IMPORT R4 K0 + 0xA8020108, // 0001 EXBLK 0 #010B + 0xB8160200, // 0002 GETNGBL R5 K1 + 0x8C140B02, // 0003 GETMET R5 R5 K2 + 0x8C1C0304, // 0004 GETMET R7 R1 K4 + 0x7C1C0200, // 0005 CALL R7 1 + 0x001E0607, // 0006 ADD R7 K3 R7 + 0x54220003, // 0007 LDINT R8 4 + 0x7C140600, // 0008 CALL R5 3 + 0xB8160A00, // 0009 GETNGBL R5 K5 + 0x8C140B06, // 000A GETMET R5 R5 K6 + 0x5C1C0000, // 000B MOVE R7 R0 + 0x5C200200, // 000C MOVE R8 R1 + 0x7C140600, // 000D CALL R5 3 + 0x8C180B07, // 000E GETMET R6 R5 K7 + 0x7C180200, // 000F CALL R6 1 + 0x5C1C0C00, // 0010 MOVE R7 R6 + 0x741E0002, // 0011 JMPT R7 #0015 + 0x501C0000, // 0012 LDBOOL R7 0 0 + 0xA8040001, // 0013 EXBLK 1 1 + 0x80040E00, // 0014 RET 1 R7 + 0x881C0B08, // 0015 GETMBR R7 R5 K8 + 0x1C1C0F09, // 0016 EQ R7 R7 K9 + 0x781E0057, // 0017 JMPF R7 #0070 + 0x881C0B0A, // 0018 GETMBR R7 R5 K10 + 0x1C1C0F09, // 0019 EQ R7 R7 K9 + 0x781E0054, // 001A JMPF R7 #0070 + 0x881C010B, // 001B GETMBR R7 R0 K11 + 0x881C0F0C, // 001C GETMBR R7 R7 K12 + 0x8C1C0F0D, // 001D GETMET R7 R7 K13 + 0x88240B0E, // 001E GETMBR R9 R5 K14 + 0x542A0059, // 001F LDINT R10 90 + 0x7C1C0600, // 0020 CALL R7 3 + 0xB8220200, // 0021 GETNGBL R8 K1 + 0x8C201102, // 0022 GETMET R8 R8 K2 + 0x60280008, // 0023 GETGBL R10 G8 + 0x882C0B0E, // 0024 GETMBR R11 R5 K14 + 0x7C280200, // 0025 CALL R10 1 + 0x002A1E0A, // 0026 ADD R10 K15 R10 + 0x00281510, // 0027 ADD R10 R10 K16 + 0x602C0008, // 0028 GETGBL R11 G8 + 0x88300F08, // 0029 GETMBR R12 R7 K8 + 0x7C2C0200, // 002A CALL R11 1 + 0x0028140B, // 002B ADD R10 R10 R11 + 0x582C0011, // 002C LDCONST R11 K17 + 0x7C200600, // 002D CALL R8 3 + 0x90162407, // 002E SETMBR R5 K18 R7 + 0x88200113, // 002F GETMBR R8 R0 K19 + 0x8C201114, // 0030 GETMET R8 R8 K20 + 0x88280B15, // 0031 GETMBR R10 R5 K21 + 0x502C0000, // 0032 LDBOOL R11 0 0 + 0x7C200600, // 0033 CALL R8 3 + 0x7422000D, // 0034 JMPT R8 #0043 + 0xB8220200, // 0035 GETNGBL R8 K1 + 0x8C201102, // 0036 GETMET R8 R8 K2 + 0x8C280916, // 0037 GETMET R10 R4 K22 + 0x58300017, // 0038 LDCONST R12 K23 + 0x88340B15, // 0039 GETMBR R13 R5 K21 + 0x88380113, // 003A GETMBR R14 R0 K19 + 0x8C381D18, // 003B GETMET R14 R14 K24 + 0x7C380200, // 003C CALL R14 1 + 0x7C280800, // 003D CALL R10 4 + 0x582C0011, // 003E LDCONST R11 K17 + 0x7C200600, // 003F CALL R8 3 + 0x50200000, // 0040 LDBOOL R8 0 0 + 0xA8040001, // 0041 EXBLK 1 1 + 0x80041000, // 0042 RET 1 R8 + 0x8C200B19, // 0043 GETMET R8 R5 K25 + 0x7C200200, // 0044 CALL R8 1 + 0x74220002, // 0045 JMPT R8 #0049 + 0x50200000, // 0046 LDBOOL R8 0 0 + 0xA8040001, // 0047 EXBLK 1 1 + 0x80041000, // 0048 RET 1 R8 + 0x8820010B, // 0049 GETMBR R8 R0 K11 + 0x8C20111A, // 004A GETMET R8 R8 K26 + 0x88280B1B, // 004B GETMBR R10 R5 K27 + 0x7C200400, // 004C CALL R8 2 + 0x88200B1C, // 004D GETMBR R8 R5 K28 + 0x5426000F, // 004E LDINT R9 16 + 0x20201009, // 004F NE R8 R8 R9 + 0x78220014, // 0050 JMPF R8 #0066 + 0xB8220A00, // 0051 GETNGBL R8 K5 + 0x8C20111D, // 0052 GETMET R8 R8 K29 + 0x88280B1C, // 0053 GETMBR R10 R5 K28 + 0x7C200400, // 0054 CALL R8 2 + 0x5C241000, // 0055 MOVE R9 R8 + 0x74260004, // 0056 JMPT R9 #005C + 0x8C240916, // 0057 GETMET R9 R4 K22 + 0x582C001E, // 0058 LDCONST R11 K30 + 0x88300B1C, // 0059 GETMBR R12 R5 K28 + 0x7C240600, // 005A CALL R9 3 + 0x5C201200, // 005B MOVE R8 R9 + 0xB8260200, // 005C GETNGBL R9 K1 + 0x8C241302, // 005D GETMET R9 R9 K2 + 0x8C2C0916, // 005E GETMET R11 R4 K22 + 0x5834001F, // 005F LDCONST R13 K31 + 0x5C381000, // 0060 MOVE R14 R8 + 0x5C3C0400, // 0061 MOVE R15 R2 + 0x5C400600, // 0062 MOVE R16 R3 + 0x7C2C0A00, // 0063 CALL R11 5 + 0x58300020, // 0064 LDCONST R12 K32 + 0x7C240600, // 0065 CALL R9 3 + 0x88200121, // 0066 GETMBR R8 R0 K33 + 0x8C201122, // 0067 GETMET R8 R8 K34 + 0x5C280A00, // 0068 MOVE R10 R5 + 0x5C2C0400, // 0069 MOVE R11 R2 + 0x5C300600, // 006A MOVE R12 R3 + 0x7C200800, // 006B CALL R8 4 + 0x50200200, // 006C LDBOOL R8 1 0 + 0xA8040001, // 006D EXBLK 1 1 + 0x80041000, // 006E RET 1 R8 + 0x70020095, // 006F JMP #0106 + 0xB81E0200, // 0070 GETNGBL R7 K1 + 0x8C1C0F02, // 0071 GETMET R7 R7 K2 + 0x8C240916, // 0072 GETMET R9 R4 K22 + 0x582C0023, // 0073 LDCONST R11 K35 + 0x88300B08, // 0074 GETMBR R12 R5 K8 + 0x88340B15, // 0075 GETMBR R13 R5 K21 + 0x7C240800, // 0076 CALL R9 4 + 0x58280011, // 0077 LDCONST R10 K17 + 0x7C1C0600, // 0078 CALL R7 3 + 0x881C010B, // 0079 GETMBR R7 R0 K11 + 0x881C0F0C, // 007A GETMBR R7 R7 K12 + 0x8C1C0F24, // 007B GETMET R7 R7 K36 + 0x88240B08, // 007C GETMBR R9 R5 K8 + 0x7C1C0400, // 007D CALL R7 2 + 0x4C200000, // 007E LDNIL R8 + 0x1C200E08, // 007F EQ R8 R7 R8 + 0x78220013, // 0080 JMPF R8 #0095 + 0xB8220200, // 0081 GETNGBL R8 K1 + 0x8C201102, // 0082 GETMET R8 R8 K2 + 0x60280008, // 0083 GETGBL R10 G8 + 0x882C0B08, // 0084 GETMBR R11 R5 K8 + 0x7C280200, // 0085 CALL R10 1 + 0x002A4A0A, // 0086 ADD R10 K37 R10 + 0x582C0011, // 0087 LDCONST R11 K17 + 0x7C200600, // 0088 CALL R8 3 + 0xB8220200, // 0089 GETNGBL R8 K1 + 0x8C201102, // 008A GETMET R8 R8 K2 + 0xB82A0A00, // 008B GETNGBL R10 K5 + 0x8C281527, // 008C GETMET R10 R10 K39 + 0x5C300A00, // 008D MOVE R12 R5 + 0x7C280400, // 008E CALL R10 2 + 0x002A4C0A, // 008F ADD R10 K38 R10 + 0x582C0011, // 0090 LDCONST R11 K17 + 0x7C200600, // 0091 CALL R8 3 + 0x50200000, // 0092 LDBOOL R8 0 0 + 0xA8040001, // 0093 EXBLK 1 1 + 0x80041000, // 0094 RET 1 R8 + 0x90162407, // 0095 SETMBR R5 K18 R7 + 0x88200F13, // 0096 GETMBR R8 R7 K19 + 0x8C201114, // 0097 GETMET R8 R8 K20 + 0x88280B15, // 0098 GETMBR R10 R5 K21 + 0x502C0200, // 0099 LDBOOL R11 1 0 + 0x7C200600, // 009A CALL R8 3 + 0x74220011, // 009B JMPT R8 #00AE + 0xB8220200, // 009C GETNGBL R8 K1 + 0x8C201102, // 009D GETMET R8 R8 K2 + 0x60280008, // 009E GETGBL R10 G8 + 0x882C0B15, // 009F GETMBR R11 R5 K21 + 0x7C280200, // 00A0 CALL R10 1 + 0x002A500A, // 00A1 ADD R10 K40 R10 + 0x00281529, // 00A2 ADD R10 R10 K41 + 0x602C0008, // 00A3 GETGBL R11 G8 + 0x88300F13, // 00A4 GETMBR R12 R7 K19 + 0x8C301918, // 00A5 GETMET R12 R12 K24 + 0x7C300200, // 00A6 CALL R12 1 + 0x7C2C0200, // 00A7 CALL R11 1 + 0x0028140B, // 00A8 ADD R10 R10 R11 + 0x582C0011, // 00A9 LDCONST R11 K17 + 0x7C200600, // 00AA CALL R8 3 + 0x50200000, // 00AB LDBOOL R8 0 0 + 0xA8040001, // 00AC EXBLK 1 1 + 0x80041000, // 00AD RET 1 R8 + 0x8C200B2A, // 00AE GETMET R8 R5 K42 + 0x7C200200, // 00AF CALL R8 1 + 0x5C241000, // 00B0 MOVE R9 R8 + 0x74260002, // 00B1 JMPT R9 #00B5 + 0x50240000, // 00B2 LDBOOL R9 0 0 + 0xA8040001, // 00B3 EXBLK 1 1 + 0x80041200, // 00B4 RET 1 R9 + 0x88240B2C, // 00B5 GETMBR R9 R5 K44 + 0x0424132D, // 00B6 SUB R9 R9 K45 + 0x40261209, // 00B7 CONNECT R9 K9 R9 + 0x88280B2B, // 00B8 GETMBR R10 R5 K43 + 0x94241409, // 00B9 GETIDX R9 R10 R9 + 0x90165609, // 00BA SETMBR R5 K43 R9 + 0x88240B2B, // 00BB GETMBR R9 R5 K43 + 0x40241208, // 00BC CONNECT R9 R9 R8 + 0xB8260200, // 00BD GETNGBL R9 K1 + 0x8C241302, // 00BE GETMET R9 R9 K2 + 0x8C2C0916, // 00BF GETMET R11 R4 K22 + 0x5834002E, // 00C0 LDCONST R13 K46 + 0x88380B2C, // 00C1 GETMBR R14 R5 K44 + 0x883C0B2B, // 00C2 GETMBR R15 R5 K43 + 0x8C3C1F04, // 00C3 GETMET R15 R15 K4 + 0x7C3C0200, // 00C4 CALL R15 1 + 0x7C2C0800, // 00C5 CALL R11 4 + 0x58300011, // 00C6 LDCONST R12 K17 + 0x7C240600, // 00C7 CALL R9 3 + 0x8C240B19, // 00C8 GETMET R9 R5 K25 + 0x7C240200, // 00C9 CALL R9 1 + 0xB8260200, // 00CA GETNGBL R9 K1 + 0x8C241302, // 00CB GETMET R9 R9 K2 + 0x602C0008, // 00CC GETGBL R11 G8 + 0x88300B30, // 00CD GETMBR R12 R5 K48 + 0x7C2C0200, // 00CE CALL R11 1 + 0x002E5E0B, // 00CF ADD R11 K47 R11 + 0x002C1731, // 00D0 ADD R11 R11 K49 + 0x60300008, // 00D1 GETGBL R12 G8 + 0x88340B1C, // 00D2 GETMBR R13 R5 K28 + 0x7C300200, // 00D3 CALL R12 1 + 0x002C160C, // 00D4 ADD R11 R11 R12 + 0x002C1732, // 00D5 ADD R11 R11 K50 + 0x60300008, // 00D6 GETGBL R12 G8 + 0x88340B33, // 00D7 GETMBR R13 R5 K51 + 0x7C300200, // 00D8 CALL R12 1 + 0x002C160C, // 00D9 ADD R11 R11 R12 + 0x58300011, // 00DA LDCONST R12 K17 + 0x7C240600, // 00DB CALL R9 3 + 0x8824010B, // 00DC GETMBR R9 R0 K11 + 0x8C24131A, // 00DD GETMET R9 R9 K26 + 0x882C0B1B, // 00DE GETMBR R11 R5 K27 + 0x7C240400, // 00DF CALL R9 2 + 0x88240B30, // 00E0 GETMBR R9 R5 K48 + 0x1C281309, // 00E1 EQ R10 R9 K9 + 0x782A000C, // 00E2 JMPF R10 #00F0 + 0xB82A0200, // 00E3 GETNGBL R10 K1 + 0x8C281502, // 00E4 GETMET R10 R10 K2 + 0xB8320A00, // 00E5 GETNGBL R12 K5 + 0x8C301927, // 00E6 GETMET R12 R12 K39 + 0x5C380A00, // 00E7 MOVE R14 R5 + 0x7C300400, // 00E8 CALL R12 2 + 0x0032680C, // 00E9 ADD R12 K52 R12 + 0x58340011, // 00EA LDCONST R13 K17 + 0x7C280600, // 00EB CALL R10 3 + 0x50280200, // 00EC LDBOOL R10 1 0 + 0xA8040001, // 00ED EXBLK 1 1 + 0x80041400, // 00EE RET 1 R10 + 0x70020015, // 00EF JMP #0106 + 0x1C28132D, // 00F0 EQ R10 R9 K45 + 0x782A0008, // 00F1 JMPF R10 #00FB + 0x88280135, // 00F2 GETMBR R10 R0 K53 + 0x8C281522, // 00F3 GETMET R10 R10 K34 + 0x5C300A00, // 00F4 MOVE R12 R5 + 0x5C340400, // 00F5 MOVE R13 R2 + 0x5C380600, // 00F6 MOVE R14 R3 + 0x7C280800, // 00F7 CALL R10 4 + 0xA8040001, // 00F8 EXBLK 1 1 + 0x80041400, // 00F9 RET 1 R10 + 0x7002000A, // 00FA JMP #0106 + 0xB82A0200, // 00FB GETNGBL R10 K1 + 0x8C281502, // 00FC GETMET R10 R10 K2 + 0x60300008, // 00FD GETGBL R12 G8 + 0x5C341200, // 00FE MOVE R13 R9 + 0x7C300200, // 00FF CALL R12 1 + 0x00326C0C, // 0100 ADD R12 K54 R12 + 0x58340011, // 0101 LDCONST R13 K17 + 0x7C280600, // 0102 CALL R10 3 + 0x50280000, // 0103 LDBOOL R10 0 0 + 0xA8040001, // 0104 EXBLK 1 1 + 0x80041400, // 0105 RET 1 R10 + 0x501C0200, // 0106 LDBOOL R7 1 0 + 0xA8040001, // 0107 EXBLK 1 1 + 0x80040E00, // 0108 RET 1 R7 + 0xA8040001, // 0109 EXBLK 1 1 + 0x70020014, // 010A JMP #0120 + 0xAC140002, // 010B CATCH R5 0 2 + 0x70020011, // 010C JMP #011F + 0xB81E0200, // 010D GETNGBL R7 K1 + 0x8C1C0F02, // 010E GETMET R7 R7 K2 + 0x60240008, // 010F GETGBL R9 G8 + 0x5C280A00, // 0110 MOVE R10 R5 + 0x7C240200, // 0111 CALL R9 1 + 0x00266E09, // 0112 ADD R9 K55 R9 + 0x00241338, // 0113 ADD R9 R9 K56 + 0x60280008, // 0114 GETGBL R10 G8 + 0x5C2C0C00, // 0115 MOVE R11 R6 + 0x7C280200, // 0116 CALL R10 1 + 0x0024120A, // 0117 ADD R9 R9 R10 + 0x7C1C0400, // 0118 CALL R7 2 + 0xA41E7200, // 0119 IMPORT R7 K57 + 0x8C200F3A, // 011A GETMET R8 R7 K58 + 0x7C200200, // 011B CALL R8 1 + 0x50200000, // 011C LDBOOL R8 0 0 + 0x80041000, // 011D RET 1 R8 + 0x70020000, // 011E JMP #0120 + 0xB0080000, // 011F RAISE 2 R0 R0 + 0x80000000, // 0120 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_session +********************************************************************/ +be_local_closure(Matter_MessageHandler_add_session, /* name */ + be_nested_proto( + 15, /* nstack */ + 7, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(tasmota), + /* K2 */ be_nested_str_weak(log), + /* K3 */ be_nested_str_weak(format), + /* K4 */ be_nested_str_weak(MTR_X3A_X20add_session_X20local_session_id_X3D_X25i_X20initiator_session_id_X3D_X25i), + /* K5 */ be_const_int(3), + /* K6 */ be_nested_str_weak(device), + /* K7 */ be_nested_str_weak(sessions), + /* K8 */ be_nested_str_weak(create_session), + /* K9 */ be_nested_str_weak(set_keys), + }), + be_str_weak(add_session), + &be_const_str_solidified, + ( &(const binstruction[23]) { /* code */ + 0xA41E0000, // 0000 IMPORT R7 K0 + 0xB8220200, // 0001 GETNGBL R8 K1 + 0x8C201102, // 0002 GETMET R8 R8 K2 + 0x8C280F03, // 0003 GETMET R10 R7 K3 + 0x58300004, // 0004 LDCONST R12 K4 + 0x5C340200, // 0005 MOVE R13 R1 + 0x5C380400, // 0006 MOVE R14 R2 + 0x7C280800, // 0007 CALL R10 4 + 0x582C0005, // 0008 LDCONST R11 K5 + 0x7C200600, // 0009 CALL R8 3 + 0x88200106, // 000A GETMBR R8 R0 K6 + 0x88201107, // 000B GETMBR R8 R8 K7 + 0x8C201108, // 000C GETMET R8 R8 K8 + 0x5C280200, // 000D MOVE R10 R1 + 0x5C2C0400, // 000E MOVE R11 R2 + 0x7C200600, // 000F CALL R8 3 + 0x8C241109, // 0010 GETMET R9 R8 K9 + 0x5C2C0600, // 0011 MOVE R11 R3 + 0x5C300800, // 0012 MOVE R12 R4 + 0x5C340A00, // 0013 MOVE R13 R5 + 0x5C380C00, // 0014 MOVE R14 R6 + 0x7C240A00, // 0015 CALL R9 5 + 0x80000000, // 0016 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_MessageHandler_init, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(device), + /* K1 */ be_nested_str_weak(commissioning), + /* K2 */ be_nested_str_weak(matter), + /* K3 */ be_nested_str_weak(Commisioning_Context), + /* K4 */ be_nested_str_weak(im), + /* K5 */ be_nested_str_weak(IM), + /* K6 */ be_nested_str_weak(counter_rcv), + /* K7 */ be_nested_str_weak(Counter), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[16]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0xB80A0400, // 0001 GETNGBL R2 K2 + 0x8C080503, // 0002 GETMET R2 R2 K3 + 0x5C100000, // 0003 MOVE R4 R0 + 0x7C080400, // 0004 CALL R2 2 + 0x90020202, // 0005 SETMBR R0 K1 R2 + 0xB80A0400, // 0006 GETNGBL R2 K2 + 0x8C080505, // 0007 GETMET R2 R2 K5 + 0x5C100000, // 0008 MOVE R4 R0 + 0x7C080400, // 0009 CALL R2 2 + 0x90020802, // 000A SETMBR R0 K4 R2 + 0xB80A0400, // 000B GETNGBL R2 K2 + 0x8C080507, // 000C GETMET R2 R2 K7 + 0x7C080200, // 000D CALL R2 1 + 0x90020C02, // 000E SETMBR R0 K6 R2 + 0x80000000, // 000F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: every_second +********************************************************************/ +be_local_closure(Matter_MessageHandler_every_second, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(commissioning), + /* K1 */ be_nested_str_weak(every_second), + /* K2 */ be_nested_str_weak(im), + }), + be_str_weak(every_second), + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x88040102, // 0003 GETMBR R1 R0 K2 + 0x8C040301, // 0004 GETMET R1 R1 K1 + 0x7C040200, // 0005 CALL R1 1 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_MessageHandler +********************************************************************/ +be_local_class(Matter_MessageHandler, + 4, + NULL, + be_nested_map(9, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(every_second, -1), be_const_closure(Matter_MessageHandler_every_second_closure) }, + { be_const_key_weak(msg_received, -1), be_const_closure(Matter_MessageHandler_msg_received_closure) }, + { be_const_key_weak(counter_rcv, -1), be_const_var(3) }, + { be_const_key_weak(commissioning, 0), be_const_var(1) }, + { be_const_key_weak(device, 5), be_const_var(0) }, + { be_const_key_weak(init, 8), be_const_closure(Matter_MessageHandler_init_closure) }, + { be_const_key_weak(send_response, 4), be_const_closure(Matter_MessageHandler_send_response_closure) }, + { be_const_key_weak(add_session, 2), be_const_closure(Matter_MessageHandler_add_session_closure) }, + { be_const_key_weak(im, -1), be_const_var(2) }, + })), + be_str_weak(Matter_MessageHandler) +); +/*******************************************************************/ + +void be_load_Matter_MessageHandler_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_MessageHandler); + be_setglobal(vm, "Matter_MessageHandler"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Module.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Module.h new file mode 100644 index 000000000..727ae6d36 --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Module.h @@ -0,0 +1,90 @@ +/* Solidification of Matter_Module.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: setmember +********************************************************************/ +be_local_closure(matter_setmember, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(global), + /* K1 */ be_nested_str_weak(contains), + /* K2 */ be_nested_str_weak(_X2Ematter), + }), + be_str_weak(setmember), + &be_const_str_solidified, + ( &(const binstruction[11]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x8C0C0501, // 0001 GETMET R3 R2 K1 + 0x58140002, // 0002 LDCONST R5 K2 + 0x7C0C0400, // 0003 CALL R3 2 + 0x740E0002, // 0004 JMPT R3 #0008 + 0x600C0013, // 0005 GETGBL R3 G19 + 0x7C0C0000, // 0006 CALL R3 0 + 0x900A0403, // 0007 SETMBR R2 K2 R3 + 0x880C0502, // 0008 GETMBR R3 R2 K2 + 0x980C0001, // 0009 SETIDX R3 R0 R1 + 0x80000000, // 000A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: member +********************************************************************/ +be_local_closure(matter_member, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(global), + /* K1 */ be_nested_str_weak(undefined), + /* K2 */ be_nested_str_weak(contains), + /* K3 */ be_nested_str_weak(_X2Ematter), + }), + be_str_weak(member), + &be_const_str_solidified, + ( &(const binstruction[17]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0x8C0C0302, // 0002 GETMET R3 R1 K2 + 0x58140003, // 0003 LDCONST R5 K3 + 0x7C0C0400, // 0004 CALL R3 2 + 0x780E0008, // 0005 JMPF R3 #000F + 0x880C0303, // 0006 GETMBR R3 R1 K3 + 0x8C0C0702, // 0007 GETMET R3 R3 K2 + 0x5C140000, // 0008 MOVE R5 R0 + 0x7C0C0400, // 0009 CALL R3 2 + 0x780E0003, // 000A JMPF R3 #000F + 0x880C0303, // 000B GETMBR R3 R1 K3 + 0x940C0600, // 000C GETIDX R3 R3 R0 + 0x80040600, // 000D RET 1 R3 + 0x70020000, // 000E JMP #0010 + 0x80040400, // 000F RET 1 R2 + 0x80000000, // 0010 RET 0 + }) + ) +); +/*******************************************************************/ + +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin.h new file mode 100644 index 000000000..5ba1f7814 --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin.h @@ -0,0 +1,272 @@ +/* Solidification of Matter_Plugin.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_Plugin; + +/******************************************************************** +** Solidified function: get_endpoints +********************************************************************/ +be_local_closure(Matter_Plugin_get_endpoints, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(endpoints), + }), + be_str_weak(get_endpoints), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: invoke_request +********************************************************************/ +be_local_closure(Matter_Plugin_invoke_request, /* name */ + be_nested_proto( + 5, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(invoke_request), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x4C100000, // 0000 LDNIL R4 + 0x80040800, // 0001 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_Plugin_init, /* name */ + be_nested_proto( + 3, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(device), + /* K1 */ be_nested_str_weak(endpoints), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x60080012, // 0001 GETGBL R2 G18 + 0x7C080000, // 0002 CALL R2 0 + 0x90020202, // 0003 SETMBR R0 K1 R2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: read_attribute +********************************************************************/ +be_local_closure(Matter_Plugin_read_attribute, /* name */ + be_nested_proto( + 6, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(read_attribute), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x4C140000, // 0000 LDNIL R5 + 0x80040A00, // 0001 RET 1 R5 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: read_event +********************************************************************/ +be_local_closure(Matter_Plugin_read_event, /* name */ + be_nested_proto( + 6, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(read_event), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x4C140000, // 0000 LDNIL R5 + 0x80040A00, // 0001 RET 1 R5 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: subscribe_attribute +********************************************************************/ +be_local_closure(Matter_Plugin_subscribe_attribute, /* name */ + be_nested_proto( + 6, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(subscribe_attribute), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x4C140000, // 0000 LDNIL R5 + 0x80040A00, // 0001 RET 1 R5 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: subscribe_event +********************************************************************/ +be_local_closure(Matter_Plugin_subscribe_event, /* name */ + be_nested_proto( + 6, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(subscribe_event), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x4C140000, // 0000 LDNIL R5 + 0x80040A00, // 0001 RET 1 R5 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: write_attribute +********************************************************************/ +be_local_closure(Matter_Plugin_write_attribute, /* name */ + be_nested_proto( + 6, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(write_attribute), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x4C140000, // 0000 LDNIL R5 + 0x80040A00, // 0001 RET 1 R5 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: timed_request +********************************************************************/ +be_local_closure(Matter_Plugin_timed_request, /* name */ + be_nested_proto( + 5, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(timed_request), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x4C100000, // 0000 LDNIL R4 + 0x80040800, // 0001 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_Plugin +********************************************************************/ +be_local_class(Matter_Plugin, + 2, + NULL, + be_nested_map(11, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(get_endpoints, -1), be_const_closure(Matter_Plugin_get_endpoints_closure) }, + { be_const_key_weak(endpoints, 7), be_const_var(1) }, + { be_const_key_weak(timed_request, 8), be_const_closure(Matter_Plugin_timed_request_closure) }, + { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_read_attribute_closure) }, + { be_const_key_weak(read_event, -1), be_const_closure(Matter_Plugin_read_event_closure) }, + { be_const_key_weak(device, -1), be_const_var(0) }, + { be_const_key_weak(subscribe_attribute, -1), be_const_closure(Matter_Plugin_subscribe_attribute_closure) }, + { be_const_key_weak(write_attribute, -1), be_const_closure(Matter_Plugin_write_attribute_closure) }, + { be_const_key_weak(subscribe_event, -1), be_const_closure(Matter_Plugin_subscribe_event_closure) }, + { be_const_key_weak(init, 2), be_const_closure(Matter_Plugin_init_closure) }, + { be_const_key_weak(invoke_request, 1), be_const_closure(Matter_Plugin_invoke_request_closure) }, + })), + be_str_weak(Matter_Plugin) +); +/*******************************************************************/ + +void be_load_Matter_Plugin_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_Plugin); + be_setglobal(vm, "Matter_Plugin"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Relay.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Relay.h new file mode 100644 index 000000000..f03a26eb5 --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Relay.h @@ -0,0 +1,118 @@ +/* Solidification of Matter_Plugin_Relay.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_Plugin_Relay; + +/******************************************************************** +** Solidified function: read_attribute +********************************************************************/ +be_local_closure(Matter_Plugin_Relay_read_attribute, /* name */ + be_nested_proto( + 5, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(read_attribute), + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_Plugin_Relay_init, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(init), + /* K1 */ be_nested_str_weak(endpoints), + /* K2 */ be_const_int(1), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[11]) { /* code */ + 0x60080003, // 0000 GETGBL R2 G3 + 0x5C0C0000, // 0001 MOVE R3 R0 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080500, // 0003 GETMET R2 R2 K0 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x60080012, // 0006 GETGBL R2 G18 + 0x7C080000, // 0007 CALL R2 0 + 0x400C0502, // 0008 CONNECT R3 R2 K2 + 0x90020202, // 0009 SETMBR R0 K1 R2 + 0x80000000, // 000A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: invoke_request +********************************************************************/ +be_local_closure(Matter_Plugin_Relay_invoke_request, /* name */ + be_nested_proto( + 4, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(invoke_request), + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_Plugin_Relay +********************************************************************/ +extern const bclass be_class_Matter_Plugin; +be_local_class(Matter_Plugin_Relay, + 0, + &be_class_Matter_Plugin, + be_nested_map(3, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(read_attribute, 1), be_const_closure(Matter_Plugin_Relay_read_attribute_closure) }, + { be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Relay_init_closure) }, + { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Relay_invoke_request_closure) }, + })), + be_str_weak(Matter_Plugin_Relay) +); +/*******************************************************************/ + +void be_load_Matter_Plugin_Relay_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_Plugin_Relay); + be_setglobal(vm, "Matter_Plugin_Relay"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_core.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_core.h new file mode 100644 index 000000000..da9b01a97 --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_core.h @@ -0,0 +1,1053 @@ +/* Solidification of Matter_Plugin_core.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_Plugin_core; + +/******************************************************************** +** Solidified function: read_attribute +********************************************************************/ +be_local_closure(Matter_Plugin_core_read_attribute, /* name */ + be_nested_proto( + 14, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[43]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(create_TLV), + /* K4 */ be_nested_str_weak(U8), + /* K5 */ be_nested_str_weak(session), + /* K6 */ be_nested_str_weak(breadcrumb), + /* K7 */ be_const_int(1), + /* K8 */ be_nested_str_weak(Matter_TLV_struct), + /* K9 */ be_nested_str_weak(add_TLV), + /* K10 */ be_nested_str_weak(U2), + /* K11 */ be_const_int(2), + /* K12 */ be_nested_str_weak(U1), + /* K13 */ be_const_int(3), + /* K14 */ be_nested_str_weak(BOOL), + /* K15 */ be_nested_str_weak(Matter_TLV_list), + /* K16 */ be_nested_str_weak(tasmota), + /* K17 */ be_nested_str_weak(cmd), + /* K18 */ be_nested_str_weak(Status_X201), + /* K19 */ be_nested_str_weak(StatusPRM), + /* K20 */ be_nested_str_weak(BootCount), + /* K21 */ be_nested_str_weak(U4), + /* K22 */ be_nested_str_weak(Status_X2011), + /* K23 */ be_nested_str_weak(StatusSTS), + /* K24 */ be_nested_str_weak(UptimeSec), + /* K25 */ be_nested_str_weak(int64), + /* K26 */ be_nested_str_weak(rtc), + /* K27 */ be_nested_str_weak(utc), + /* K28 */ be_const_int(1000000), + /* K29 */ be_nested_str_weak(local), + /* K30 */ be_nested_str_weak(UTF1), + /* K31 */ be_nested_str_weak(Tasmota), + /* K32 */ be_nested_str_weak(device), + /* K33 */ be_nested_str_weak(vendorid), + /* K34 */ be_nested_str_weak(DeviceName), + /* K35 */ be_nested_str_weak(FriendlyName), + /* K36 */ be_nested_str_weak(FriendlyName1), + /* K37 */ be_nested_str_weak(XX), + /* K38 */ be_nested_str_weak(Status_X202), + /* K39 */ be_nested_str_weak(StatusFWR), + /* K40 */ be_nested_str_weak(Hardware), + /* K41 */ be_nested_str_weak(Version), + /* K42 */ be_nested_str_weak(locale), + }), + be_str_weak(read_attribute), + &be_const_str_solidified, + ( &(const binstruction[391]) { /* code */ + 0xB8160000, // 0000 GETNGBL R5 K0 + 0x88140B01, // 0001 GETMBR R5 R5 K1 + 0x541A002F, // 0002 LDINT R6 48 + 0x1C180606, // 0003 EQ R6 R3 R6 + 0x781A0031, // 0004 JMPF R6 #0037 + 0x1C180902, // 0005 EQ R6 R4 K2 + 0x781A0006, // 0006 JMPF R6 #000E + 0x8C180B03, // 0007 GETMET R6 R5 K3 + 0x88200B04, // 0008 GETMBR R8 R5 K4 + 0x88240305, // 0009 GETMBR R9 R1 K5 + 0x88241306, // 000A GETMBR R9 R9 K6 + 0x7C180600, // 000B CALL R6 3 + 0x80040C00, // 000C RET 1 R6 + 0x70020027, // 000D JMP #0036 + 0x1C180907, // 000E EQ R6 R4 K7 + 0x781A000D, // 000F JMPF R6 #001E + 0x8C180B08, // 0010 GETMET R6 R5 K8 + 0x7C180200, // 0011 CALL R6 1 + 0x8C1C0D09, // 0012 GETMET R7 R6 K9 + 0x58240002, // 0013 LDCONST R9 K2 + 0x88280B0A, // 0014 GETMBR R10 R5 K10 + 0x542E003B, // 0015 LDINT R11 60 + 0x7C1C0800, // 0016 CALL R7 4 + 0x8C1C0D09, // 0017 GETMET R7 R6 K9 + 0x58240007, // 0018 LDCONST R9 K7 + 0x88280B0A, // 0019 GETMBR R10 R5 K10 + 0x542E0383, // 001A LDINT R11 900 + 0x7C1C0800, // 001B CALL R7 4 + 0x80040C00, // 001C RET 1 R6 + 0x70020017, // 001D JMP #0036 + 0x1C18090B, // 001E EQ R6 R4 K11 + 0x781A0005, // 001F JMPF R6 #0026 + 0x8C180B03, // 0020 GETMET R6 R5 K3 + 0x88200B0C, // 0021 GETMBR R8 R5 K12 + 0x5824000B, // 0022 LDCONST R9 K11 + 0x7C180600, // 0023 CALL R6 3 + 0x80040C00, // 0024 RET 1 R6 + 0x7002000F, // 0025 JMP #0036 + 0x1C18090D, // 0026 EQ R6 R4 K13 + 0x781A0005, // 0027 JMPF R6 #002E + 0x8C180B03, // 0028 GETMET R6 R5 K3 + 0x88200B0C, // 0029 GETMBR R8 R5 K12 + 0x5824000B, // 002A LDCONST R9 K11 + 0x7C180600, // 002B CALL R6 3 + 0x80040C00, // 002C RET 1 R6 + 0x70020007, // 002D JMP #0036 + 0x541A0003, // 002E LDINT R6 4 + 0x1C180806, // 002F EQ R6 R4 R6 + 0x781A0004, // 0030 JMPF R6 #0036 + 0x8C180B03, // 0031 GETMET R6 R5 K3 + 0x88200B0E, // 0032 GETMBR R8 R5 K14 + 0x50240000, // 0033 LDBOOL R9 0 0 + 0x7C180600, // 0034 CALL R6 3 + 0x80040C00, // 0035 RET 1 R6 + 0x7002014E, // 0036 JMP #0186 + 0x541A0031, // 0037 LDINT R6 50 + 0x1C180606, // 0038 EQ R6 R3 R6 + 0x781A0000, // 0039 JMPF R6 #003B + 0x7002014A, // 003A JMP #0186 + 0x541A0032, // 003B LDINT R6 51 + 0x1C180606, // 003C EQ R6 R3 R6 + 0x781A0028, // 003D JMPF R6 #0067 + 0x1C180902, // 003E EQ R6 R4 K2 + 0x781A0003, // 003F JMPF R6 #0044 + 0x8C180B0F, // 0040 GETMET R6 R5 K15 + 0x7C180200, // 0041 CALL R6 1 + 0x80040C00, // 0042 RET 1 R6 + 0x70020021, // 0043 JMP #0066 + 0x1C180907, // 0044 EQ R6 R4 K7 + 0x781A000A, // 0045 JMPF R6 #0051 + 0x8C180B03, // 0046 GETMET R6 R5 K3 + 0x88200B0A, // 0047 GETMBR R8 R5 K10 + 0xB8262000, // 0048 GETNGBL R9 K16 + 0x8C241311, // 0049 GETMET R9 R9 K17 + 0x582C0012, // 004A LDCONST R11 K18 + 0x7C240400, // 004B CALL R9 2 + 0x94241313, // 004C GETIDX R9 R9 K19 + 0x94241314, // 004D GETIDX R9 R9 K20 + 0x7C180600, // 004E CALL R6 3 + 0x80040C00, // 004F RET 1 R6 + 0x70020014, // 0050 JMP #0066 + 0x1C18090B, // 0051 EQ R6 R4 K11 + 0x781A000A, // 0052 JMPF R6 #005E + 0x8C180B03, // 0053 GETMET R6 R5 K3 + 0x88200B15, // 0054 GETMBR R8 R5 K21 + 0xB8262000, // 0055 GETNGBL R9 K16 + 0x8C241311, // 0056 GETMET R9 R9 K17 + 0x582C0016, // 0057 LDCONST R11 K22 + 0x7C240400, // 0058 CALL R9 2 + 0x94241317, // 0059 GETIDX R9 R9 K23 + 0x94241318, // 005A GETIDX R9 R9 K24 + 0x7C180600, // 005B CALL R6 3 + 0x80040C00, // 005C RET 1 R6 + 0x70020007, // 005D JMP #0066 + 0x541A0007, // 005E LDINT R6 8 + 0x1C180806, // 005F EQ R6 R4 R6 + 0x781A0004, // 0060 JMPF R6 #0066 + 0x8C180B03, // 0061 GETMET R6 R5 K3 + 0x88200B0E, // 0062 GETMBR R8 R5 K14 + 0x50240000, // 0063 LDBOOL R9 0 0 + 0x7C180600, // 0064 CALL R6 3 + 0x80040C00, // 0065 RET 1 R6 + 0x7002011E, // 0066 JMP #0186 + 0x541A0033, // 0067 LDINT R6 52 + 0x1C180606, // 0068 EQ R6 R3 R6 + 0x781A0000, // 0069 JMPF R6 #006B + 0x7002011A, // 006A JMP #0186 + 0x541A0037, // 006B LDINT R6 56 + 0x1C180606, // 006C EQ R6 R3 R6 + 0x781A002C, // 006D JMPF R6 #009B + 0x1C180902, // 006E EQ R6 R4 K2 + 0x781A000F, // 006F JMPF R6 #0080 + 0xB81A3200, // 0070 GETNGBL R6 K25 + 0xB81E2000, // 0071 GETNGBL R7 K16 + 0x8C1C0F1A, // 0072 GETMET R7 R7 K26 + 0x7C1C0200, // 0073 CALL R7 1 + 0x941C0F1B, // 0074 GETIDX R7 R7 K27 + 0x7C180200, // 0075 CALL R6 1 + 0xB81E3200, // 0076 GETNGBL R7 K25 + 0x5820001C, // 0077 LDCONST R8 K28 + 0x7C1C0200, // 0078 CALL R7 1 + 0x08180C07, // 0079 MUL R6 R6 R7 + 0x8C1C0B03, // 007A GETMET R7 R5 K3 + 0x88240B04, // 007B GETMBR R9 R5 K4 + 0x5C280C00, // 007C MOVE R10 R6 + 0x7C1C0600, // 007D CALL R7 3 + 0x80040E00, // 007E RET 1 R7 + 0x70020019, // 007F JMP #009A + 0x1C180907, // 0080 EQ R6 R4 K7 + 0x781A0005, // 0081 JMPF R6 #0088 + 0x8C180B03, // 0082 GETMET R6 R5 K3 + 0x88200B0C, // 0083 GETMBR R8 R5 K12 + 0x5824000D, // 0084 LDCONST R9 K13 + 0x7C180600, // 0085 CALL R6 3 + 0x80040C00, // 0086 RET 1 R6 + 0x70020011, // 0087 JMP #009A + 0x541A0006, // 0088 LDINT R6 7 + 0x1C180806, // 0089 EQ R6 R4 R6 + 0x781A000E, // 008A JMPF R6 #009A + 0xB81A3200, // 008B GETNGBL R6 K25 + 0xB81E2000, // 008C GETNGBL R7 K16 + 0x8C1C0F1A, // 008D GETMET R7 R7 K26 + 0x7C1C0200, // 008E CALL R7 1 + 0x941C0F1D, // 008F GETIDX R7 R7 K29 + 0x7C180200, // 0090 CALL R6 1 + 0xB81E3200, // 0091 GETNGBL R7 K25 + 0x5820001C, // 0092 LDCONST R8 K28 + 0x7C1C0200, // 0093 CALL R7 1 + 0x08180C07, // 0094 MUL R6 R6 R7 + 0x8C1C0B03, // 0095 GETMET R7 R5 K3 + 0x88240B04, // 0096 GETMBR R9 R5 K4 + 0x5C280C00, // 0097 MOVE R10 R6 + 0x7C1C0600, // 0098 CALL R7 3 + 0x80040E00, // 0099 RET 1 R7 + 0x700200EA, // 009A JMP #0186 + 0x541A003D, // 009B LDINT R6 62 + 0x1C180606, // 009C EQ R6 R3 R6 + 0x781A001D, // 009D JMPF R6 #00BC + 0x1C180902, // 009E EQ R6 R4 K2 + 0x781A0000, // 009F JMPF R6 #00A1 + 0x70020019, // 00A0 JMP #00BB + 0x1C180907, // 00A1 EQ R6 R4 K7 + 0x781A0000, // 00A2 JMPF R6 #00A4 + 0x70020016, // 00A3 JMP #00BB + 0x1C18090B, // 00A4 EQ R6 R4 K11 + 0x781A0005, // 00A5 JMPF R6 #00AC + 0x8C180B03, // 00A6 GETMET R6 R5 K3 + 0x88200B0C, // 00A7 GETMBR R8 R5 K12 + 0x54260004, // 00A8 LDINT R9 5 + 0x7C180600, // 00A9 CALL R6 3 + 0x80040C00, // 00AA RET 1 R6 + 0x7002000E, // 00AB JMP #00BB + 0x1C18090D, // 00AC EQ R6 R4 K13 + 0x781A0005, // 00AD JMPF R6 #00B4 + 0x8C180B03, // 00AE GETMET R6 R5 K3 + 0x88200B0C, // 00AF GETMBR R8 R5 K12 + 0x58240007, // 00B0 LDCONST R9 K7 + 0x7C180600, // 00B1 CALL R6 3 + 0x80040C00, // 00B2 RET 1 R6 + 0x70020006, // 00B3 JMP #00BB + 0x541A0003, // 00B4 LDINT R6 4 + 0x1C180806, // 00B5 EQ R6 R4 R6 + 0x781A0000, // 00B6 JMPF R6 #00B8 + 0x70020002, // 00B7 JMP #00BB + 0x541A0004, // 00B8 LDINT R6 5 + 0x1C180806, // 00B9 EQ R6 R4 R6 + 0x7819FFFF, // 00BA JMPF R6 #00BB + 0x700200C9, // 00BB JMP #0186 + 0x541A003B, // 00BC LDINT R6 60 + 0x1C180606, // 00BD EQ R6 R3 R6 + 0x781A0000, // 00BE JMPF R6 #00C0 + 0x700200C5, // 00BF JMP #0186 + 0x541A0027, // 00C0 LDINT R6 40 + 0x1C180606, // 00C1 EQ R6 R3 R6 + 0x781A0071, // 00C2 JMPF R6 #0135 + 0x1C180902, // 00C3 EQ R6 R4 K2 + 0x781A0005, // 00C4 JMPF R6 #00CB + 0x8C180B03, // 00C5 GETMET R6 R5 K3 + 0x88200B0A, // 00C6 GETMBR R8 R5 K10 + 0x58240002, // 00C7 LDCONST R9 K2 + 0x7C180600, // 00C8 CALL R6 3 + 0x80040C00, // 00C9 RET 1 R6 + 0x70020068, // 00CA JMP #0134 + 0x1C180907, // 00CB EQ R6 R4 K7 + 0x781A0005, // 00CC JMPF R6 #00D3 + 0x8C180B03, // 00CD GETMET R6 R5 K3 + 0x88200B1E, // 00CE GETMBR R8 R5 K30 + 0x5824001F, // 00CF LDCONST R9 K31 + 0x7C180600, // 00D0 CALL R6 3 + 0x80040C00, // 00D1 RET 1 R6 + 0x70020060, // 00D2 JMP #0134 + 0x1C18090B, // 00D3 EQ R6 R4 K11 + 0x781A0006, // 00D4 JMPF R6 #00DC + 0x8C180B03, // 00D5 GETMET R6 R5 K3 + 0x88200B0A, // 00D6 GETMBR R8 R5 K10 + 0x88240120, // 00D7 GETMBR R9 R0 K32 + 0x88241321, // 00D8 GETMBR R9 R9 K33 + 0x7C180600, // 00D9 CALL R6 3 + 0x80040C00, // 00DA RET 1 R6 + 0x70020057, // 00DB JMP #0134 + 0x1C18090D, // 00DC EQ R6 R4 K13 + 0x781A0009, // 00DD JMPF R6 #00E8 + 0x8C180B03, // 00DE GETMET R6 R5 K3 + 0x88200B1E, // 00DF GETMBR R8 R5 K30 + 0xB8262000, // 00E0 GETNGBL R9 K16 + 0x8C241311, // 00E1 GETMET R9 R9 K17 + 0x582C0022, // 00E2 LDCONST R11 K34 + 0x7C240400, // 00E3 CALL R9 2 + 0x94241322, // 00E4 GETIDX R9 R9 K34 + 0x7C180600, // 00E5 CALL R6 3 + 0x80040C00, // 00E6 RET 1 R6 + 0x7002004B, // 00E7 JMP #0134 + 0x541A0003, // 00E8 LDINT R6 4 + 0x1C180806, // 00E9 EQ R6 R4 R6 + 0x781A0005, // 00EA JMPF R6 #00F1 + 0x8C180B03, // 00EB GETMET R6 R5 K3 + 0x88200B0A, // 00EC GETMBR R8 R5 K10 + 0x54267FFF, // 00ED LDINT R9 32768 + 0x7C180600, // 00EE CALL R6 3 + 0x80040C00, // 00EF RET 1 R6 + 0x70020042, // 00F0 JMP #0134 + 0x541A0004, // 00F1 LDINT R6 5 + 0x1C180806, // 00F2 EQ R6 R4 R6 + 0x781A0009, // 00F3 JMPF R6 #00FE + 0x8C180B03, // 00F4 GETMET R6 R5 K3 + 0x88200B1E, // 00F5 GETMBR R8 R5 K30 + 0xB8262000, // 00F6 GETNGBL R9 K16 + 0x8C241311, // 00F7 GETMET R9 R9 K17 + 0x582C0023, // 00F8 LDCONST R11 K35 + 0x7C240400, // 00F9 CALL R9 2 + 0x94241324, // 00FA GETIDX R9 R9 K36 + 0x7C180600, // 00FB CALL R6 3 + 0x80040C00, // 00FC RET 1 R6 + 0x70020035, // 00FD JMP #0134 + 0x541A0005, // 00FE LDINT R6 6 + 0x1C180806, // 00FF EQ R6 R4 R6 + 0x781A0005, // 0100 JMPF R6 #0107 + 0x8C180B03, // 0101 GETMET R6 R5 K3 + 0x88200B1E, // 0102 GETMBR R8 R5 K30 + 0x58240025, // 0103 LDCONST R9 K37 + 0x7C180600, // 0104 CALL R6 3 + 0x80040C00, // 0105 RET 1 R6 + 0x7002002C, // 0106 JMP #0134 + 0x541A0006, // 0107 LDINT R6 7 + 0x1C180806, // 0108 EQ R6 R4 R6 + 0x781A0005, // 0109 JMPF R6 #0110 + 0x8C180B03, // 010A GETMET R6 R5 K3 + 0x88200B0A, // 010B GETMBR R8 R5 K10 + 0x58240002, // 010C LDCONST R9 K2 + 0x7C180600, // 010D CALL R6 3 + 0x80040C00, // 010E RET 1 R6 + 0x70020023, // 010F JMP #0134 + 0x541A0007, // 0110 LDINT R6 8 + 0x1C180806, // 0111 EQ R6 R4 R6 + 0x781A000A, // 0112 JMPF R6 #011E + 0x8C180B03, // 0113 GETMET R6 R5 K3 + 0x88200B1E, // 0114 GETMBR R8 R5 K30 + 0xB8262000, // 0115 GETNGBL R9 K16 + 0x8C241311, // 0116 GETMET R9 R9 K17 + 0x582C0026, // 0117 LDCONST R11 K38 + 0x7C240400, // 0118 CALL R9 2 + 0x94241327, // 0119 GETIDX R9 R9 K39 + 0x94241328, // 011A GETIDX R9 R9 K40 + 0x7C180600, // 011B CALL R6 3 + 0x80040C00, // 011C RET 1 R6 + 0x70020015, // 011D JMP #0134 + 0x541A0008, // 011E LDINT R6 9 + 0x1C180806, // 011F EQ R6 R4 R6 + 0x781A0005, // 0120 JMPF R6 #0127 + 0x8C180B03, // 0121 GETMET R6 R5 K3 + 0x88200B0A, // 0122 GETMBR R8 R5 K10 + 0x58240002, // 0123 LDCONST R9 K2 + 0x7C180600, // 0124 CALL R6 3 + 0x80040C00, // 0125 RET 1 R6 + 0x7002000C, // 0126 JMP #0134 + 0x541A0009, // 0127 LDINT R6 10 + 0x1C180806, // 0128 EQ R6 R4 R6 + 0x781A0009, // 0129 JMPF R6 #0134 + 0x8C180B03, // 012A GETMET R6 R5 K3 + 0x88200B1E, // 012B GETMBR R8 R5 K30 + 0xB8262000, // 012C GETNGBL R9 K16 + 0x8C241311, // 012D GETMET R9 R9 K17 + 0x582C0026, // 012E LDCONST R11 K38 + 0x7C240400, // 012F CALL R9 2 + 0x94241327, // 0130 GETIDX R9 R9 K39 + 0x94241329, // 0131 GETIDX R9 R9 K41 + 0x7C180600, // 0132 CALL R6 3 + 0x80040C00, // 0133 RET 1 R6 + 0x70020050, // 0134 JMP #0186 + 0x541A003E, // 0135 LDINT R6 63 + 0x1C180606, // 0136 EQ R6 R3 R6 + 0x781A0000, // 0137 JMPF R6 #0139 + 0x7002004C, // 0138 JMP #0186 + 0x541A002A, // 0139 LDINT R6 43 + 0x1C180606, // 013A EQ R6 R3 R6 + 0x781A0016, // 013B JMPF R6 #0153 + 0x1C180902, // 013C EQ R6 R4 K2 + 0x781A0007, // 013D JMPF R6 #0146 + 0x8C180B03, // 013E GETMET R6 R5 K3 + 0x88200B1E, // 013F GETMBR R8 R5 K30 + 0xB8262000, // 0140 GETNGBL R9 K16 + 0x8C24132A, // 0141 GETMET R9 R9 K42 + 0x7C240200, // 0142 CALL R9 1 + 0x7C180600, // 0143 CALL R6 3 + 0x80040C00, // 0144 RET 1 R6 + 0x7002000B, // 0145 JMP #0152 + 0x1C180907, // 0146 EQ R6 R4 K7 + 0x781A0009, // 0147 JMPF R6 #0152 + 0x8C180B0F, // 0148 GETMET R6 R5 K15 + 0x7C180200, // 0149 CALL R6 1 + 0x8C1C0D09, // 014A GETMET R7 R6 K9 + 0x4C240000, // 014B LDNIL R9 + 0x88280B1E, // 014C GETMBR R10 R5 K30 + 0xB82E2000, // 014D GETNGBL R11 K16 + 0x8C2C172A, // 014E GETMET R11 R11 K42 + 0x7C2C0200, // 014F CALL R11 1 + 0x7C1C0800, // 0150 CALL R7 4 + 0x80040C00, // 0151 RET 1 R6 + 0x70020032, // 0152 JMP #0186 + 0x541A002B, // 0153 LDINT R6 44 + 0x1C180606, // 0154 EQ R6 R3 R6 + 0x781A001C, // 0155 JMPF R6 #0173 + 0x1C180902, // 0156 EQ R6 R4 K2 + 0x781A0005, // 0157 JMPF R6 #015E + 0x8C180B03, // 0158 GETMET R6 R5 K3 + 0x88200B0C, // 0159 GETMBR R8 R5 K12 + 0x58240007, // 015A LDCONST R9 K7 + 0x7C180600, // 015B CALL R6 3 + 0x80040C00, // 015C RET 1 R6 + 0x70020013, // 015D JMP #0172 + 0x1C180907, // 015E EQ R6 R4 K7 + 0x781A0005, // 015F JMPF R6 #0166 + 0x8C180B03, // 0160 GETMET R6 R5 K3 + 0x88200B0C, // 0161 GETMBR R8 R5 K12 + 0x54260003, // 0162 LDINT R9 4 + 0x7C180600, // 0163 CALL R6 3 + 0x80040C00, // 0164 RET 1 R6 + 0x7002000B, // 0165 JMP #0172 + 0x1C18090B, // 0166 EQ R6 R4 K11 + 0x781A0009, // 0167 JMPF R6 #0172 + 0x8C180B0F, // 0168 GETMET R6 R5 K15 + 0x7C180200, // 0169 CALL R6 1 + 0x8C1C0D09, // 016A GETMET R7 R6 K9 + 0x4C240000, // 016B LDNIL R9 + 0x8C280B03, // 016C GETMET R10 R5 K3 + 0x88300B0C, // 016D GETMBR R12 R5 K12 + 0x54360003, // 016E LDINT R13 4 + 0x7C280600, // 016F CALL R10 3 + 0x7C1C0600, // 0170 CALL R7 3 + 0x80040C00, // 0171 RET 1 R6 + 0x70020012, // 0172 JMP #0186 + 0x541A0030, // 0173 LDINT R6 49 + 0x1C180606, // 0174 EQ R6 R3 R6 + 0x781A000F, // 0175 JMPF R6 #0186 + 0x1C18090D, // 0176 EQ R6 R4 K13 + 0x781A0005, // 0177 JMPF R6 #017E + 0x8C180B03, // 0178 GETMET R6 R5 K3 + 0x88200B0C, // 0179 GETMBR R8 R5 K12 + 0x5426001D, // 017A LDINT R9 30 + 0x7C180600, // 017B CALL R6 3 + 0x80040C00, // 017C RET 1 R6 + 0x70020007, // 017D JMP #0186 + 0x541AFFFB, // 017E LDINT R6 65532 + 0x1C180806, // 017F EQ R6 R4 R6 + 0x781A0004, // 0180 JMPF R6 #0186 + 0x8C180B03, // 0181 GETMET R6 R5 K3 + 0x88200B15, // 0182 GETMBR R8 R5 K21 + 0x58240002, // 0183 LDCONST R9 K2 + 0x7C180600, // 0184 CALL R6 3 + 0x80040C00, // 0185 RET 1 R6 + 0x80000000, // 0186 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_Plugin_core_init, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(init), + /* K1 */ be_nested_str_weak(endpoints), + /* K2 */ be_const_int(0), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[11]) { /* code */ + 0x60080003, // 0000 GETGBL R2 G3 + 0x5C0C0000, // 0001 MOVE R3 R0 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080500, // 0003 GETMET R2 R2 K0 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x60080012, // 0006 GETGBL R2 G18 + 0x7C080000, // 0007 CALL R2 0 + 0x400C0502, // 0008 CONNECT R3 R2 K2 + 0x90020202, // 0009 SETMBR R0 K1 R2 + 0x80000000, // 000A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: invoke_request +********************************************************************/ +be_local_closure(Matter_Plugin_core_invoke_request, /* name */ + be_nested_proto( + 29, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[66]) { /* constants */ + /* K0 */ be_nested_str_weak(crypto), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(TLV), + /* K3 */ be_nested_str_weak(cluster), + /* K4 */ be_nested_str_weak(command), + /* K5 */ be_nested_str_weak(session), + /* K6 */ be_const_int(0), + /* K7 */ be_nested_str_weak(findsubval), + /* K8 */ be_const_int(1), + /* K9 */ be_nested_str_weak(breadcrumb), + /* K10 */ be_nested_str_weak(Matter_TLV_struct), + /* K11 */ be_nested_str_weak(add_TLV), + /* K12 */ be_nested_str_weak(U1), + /* K13 */ be_nested_str_weak(UTF1), + /* K14 */ be_nested_str_weak(), + /* K15 */ be_const_int(2), + /* K16 */ be_nested_str_weak(XX), + /* K17 */ be_const_int(3), + /* K18 */ be_nested_str_weak(set_no_expiration), + /* K19 */ be_nested_str_weak(device), + /* K20 */ be_nested_str_weak(start_commissioning_complete_deferred), + /* K21 */ be_nested_str_weak(status), + /* K22 */ be_nested_str_weak(UNSUPPORTED_COMMAND), + /* K23 */ be_nested_str_weak(B2), + /* K24 */ be_nested_str_weak(DAC_Cert_FFF1_8000), + /* K25 */ be_nested_str_weak(PAI_Cert_FFF1), + /* K26 */ be_nested_str_weak(CD_FFF1_8000), + /* K27 */ be_nested_str_weak(B1), + /* K28 */ be_nested_str_weak(U4), + /* K29 */ be_nested_str_weak(tasmota), + /* K30 */ be_nested_str_weak(rtc), + /* K31 */ be_nested_str_weak(utc), + /* K32 */ be_nested_str_weak(encode), + /* K33 */ be_nested_str_weak(get_ac), + /* K34 */ be_nested_str_weak(log), + /* K35 */ be_nested_str_weak(MTR_X3A_X20attestation_tbs_X3D), + /* K36 */ be_nested_str_weak(tohex), + /* K37 */ be_nested_str_weak(EC_P256), + /* K38 */ be_nested_str_weak(ecdsa_sign_sha256), + /* K39 */ be_nested_str_weak(DAC_Priv_FFF1_8000), + /* K40 */ be_nested_str_weak(gen_CSR), + /* K41 */ be_nested_str_weak(MTR_X3A_X20nocsr_tbs_X3D), + /* K42 */ be_nested_str_weak(set_ca), + /* K43 */ be_nested_str_weak(MTR_X3A_X20received_X20ca_root_X3D), + /* K44 */ be_nested_str_weak(SUCCESS), + /* K45 */ be_nested_str_weak(get_ca), + /* K46 */ be_nested_str_weak(MTR_X3A_X20Error_X3A_X20AdNOC_X20without_X20CA), + /* K47 */ be_nested_str_weak(set_noc), + /* K48 */ be_nested_str_weak(set_ipk_epoch_key), + /* K49 */ be_nested_str_weak(admin_subject), + /* K50 */ be_nested_str_weak(admin_vendor), + /* K51 */ be_nested_str_weak(parse), + /* K52 */ be_nested_str_weak(findsub), + /* K53 */ be_nested_str_weak(MTR_X3A_X20Error_X3A_X20no_X20fabricid_X20nor_X20deviceid_X20in_X20NOC_X20certificate), + /* K54 */ be_nested_str_weak(int), + /* K55 */ be_nested_str_weak(int64), + /* K56 */ be_nested_str_weak(tobytes), + /* K57 */ be_const_int(2147483647), + /* K58 */ be_nested_str_weak(fromstring), + /* K59 */ be_nested_str_weak(CompressedFabric), + /* K60 */ be_nested_str_weak(HKDF_SHA256), + /* K61 */ be_nested_str_weak(copy), + /* K62 */ be_nested_str_weak(reverse), + /* K63 */ be_nested_str_weak(derive), + /* K64 */ be_nested_str_weak(set_fabric_device), + /* K65 */ be_nested_str_weak(start_operational_dicovery_deferred), + }), + be_str_weak(invoke_request), + &be_const_str_solidified, + ( &(const binstruction[435]) { /* code */ + 0xA4120000, // 0000 IMPORT R4 K0 + 0xB8160200, // 0001 GETNGBL R5 K1 + 0x88140B02, // 0002 GETMBR R5 R5 K2 + 0x88180703, // 0003 GETMBR R6 R3 K3 + 0x881C0704, // 0004 GETMBR R7 R3 K4 + 0x88200305, // 0005 GETMBR R8 R1 K5 + 0x5426002F, // 0006 LDINT R9 48 + 0x1C240C09, // 0007 EQ R9 R6 R9 + 0x78260050, // 0008 JMPF R9 #005A + 0x1C240F06, // 0009 EQ R9 R7 K6 + 0x78260017, // 000A JMPF R9 #0023 + 0x8C240507, // 000B GETMET R9 R2 K7 + 0x582C0006, // 000C LDCONST R11 K6 + 0x54320383, // 000D LDINT R12 900 + 0x7C240600, // 000E CALL R9 3 + 0x8C280507, // 000F GETMET R10 R2 K7 + 0x58300008, // 0010 LDCONST R12 K8 + 0x58340006, // 0011 LDCONST R13 K6 + 0x7C280600, // 0012 CALL R10 3 + 0x9022120A, // 0013 SETMBR R8 K9 R10 + 0x8C2C0B0A, // 0014 GETMET R11 R5 K10 + 0x7C2C0200, // 0015 CALL R11 1 + 0x8C30170B, // 0016 GETMET R12 R11 K11 + 0x58380006, // 0017 LDCONST R14 K6 + 0x883C0B0C, // 0018 GETMBR R15 R5 K12 + 0x58400006, // 0019 LDCONST R16 K6 + 0x7C300800, // 001A CALL R12 4 + 0x8C30170B, // 001B GETMET R12 R11 K11 + 0x58380008, // 001C LDCONST R14 K8 + 0x883C0B0D, // 001D GETMBR R15 R5 K13 + 0x5840000E, // 001E LDCONST R16 K14 + 0x7C300800, // 001F CALL R12 4 + 0x900E0908, // 0020 SETMBR R3 K4 K8 + 0x80041600, // 0021 RET 1 R11 + 0x70020035, // 0022 JMP #0059 + 0x1C240F0F, // 0023 EQ R9 R7 K15 + 0x7826001A, // 0024 JMPF R9 #0040 + 0x8C240507, // 0025 GETMET R9 R2 K7 + 0x582C0006, // 0026 LDCONST R11 K6 + 0x7C240400, // 0027 CALL R9 2 + 0x8C280507, // 0028 GETMET R10 R2 K7 + 0x58300008, // 0029 LDCONST R12 K8 + 0x58340010, // 002A LDCONST R13 K16 + 0x7C280600, // 002B CALL R10 3 + 0x8C2C0507, // 002C GETMET R11 R2 K7 + 0x5834000F, // 002D LDCONST R13 K15 + 0x58380006, // 002E LDCONST R14 K6 + 0x7C2C0600, // 002F CALL R11 3 + 0x9022120B, // 0030 SETMBR R8 K9 R11 + 0x8C300B0A, // 0031 GETMET R12 R5 K10 + 0x7C300200, // 0032 CALL R12 1 + 0x8C34190B, // 0033 GETMET R13 R12 K11 + 0x583C0006, // 0034 LDCONST R15 K6 + 0x88400B0C, // 0035 GETMBR R16 R5 K12 + 0x58440006, // 0036 LDCONST R17 K6 + 0x7C340800, // 0037 CALL R13 4 + 0x8C34190B, // 0038 GETMET R13 R12 K11 + 0x583C0008, // 0039 LDCONST R15 K8 + 0x88400B0D, // 003A GETMBR R16 R5 K13 + 0x5844000E, // 003B LDCONST R17 K14 + 0x7C340800, // 003C CALL R13 4 + 0x900E0911, // 003D SETMBR R3 K4 K17 + 0x80041800, // 003E RET 1 R12 + 0x70020018, // 003F JMP #0059 + 0x54260003, // 0040 LDINT R9 4 + 0x1C240E09, // 0041 EQ R9 R7 R9 + 0x78260015, // 0042 JMPF R9 #0059 + 0x90221306, // 0043 SETMBR R8 K9 K6 + 0x8C241112, // 0044 GETMET R9 R8 K18 + 0x7C240200, // 0045 CALL R9 1 + 0x8C240B0A, // 0046 GETMET R9 R5 K10 + 0x7C240200, // 0047 CALL R9 1 + 0x8C28130B, // 0048 GETMET R10 R9 K11 + 0x58300006, // 0049 LDCONST R12 K6 + 0x88340B0C, // 004A GETMBR R13 R5 K12 + 0x58380006, // 004B LDCONST R14 K6 + 0x7C280800, // 004C CALL R10 4 + 0x8C28130B, // 004D GETMET R10 R9 K11 + 0x58300008, // 004E LDCONST R12 K8 + 0x88340B0D, // 004F GETMBR R13 R5 K13 + 0x5838000E, // 0050 LDCONST R14 K14 + 0x7C280800, // 0051 CALL R10 4 + 0x542A0004, // 0052 LDINT R10 5 + 0x900E080A, // 0053 SETMBR R3 K4 R10 + 0x88280113, // 0054 GETMBR R10 R0 K19 + 0x8C281514, // 0055 GETMET R10 R10 K20 + 0x5C301000, // 0056 MOVE R12 R8 + 0x7C280400, // 0057 CALL R10 2 + 0x80041200, // 0058 RET 1 R9 + 0x70020157, // 0059 JMP #01B2 + 0x5426003D, // 005A LDINT R9 62 + 0x1C240C09, // 005B EQ R9 R6 R9 + 0x78260154, // 005C JMPF R9 #01B2 + 0x1C240F0F, // 005D EQ R9 R7 K15 + 0x7826001D, // 005E JMPF R9 #007D + 0x8C240507, // 005F GETMET R9 R2 K7 + 0x582C0006, // 0060 LDCONST R11 K6 + 0x7C240400, // 0061 CALL R9 2 + 0x20281308, // 0062 NE R10 R9 K8 + 0x782A0006, // 0063 JMPF R10 #006B + 0x2028130F, // 0064 NE R10 R9 K15 + 0x782A0004, // 0065 JMPF R10 #006B + 0xB82A0200, // 0066 GETNGBL R10 K1 + 0x88281516, // 0067 GETMBR R10 R10 K22 + 0x900E2A0A, // 0068 SETMBR R3 K21 R10 + 0x4C280000, // 0069 LDNIL R10 + 0x80041400, // 006A RET 1 R10 + 0x8C280B0A, // 006B GETMET R10 R5 K10 + 0x7C280200, // 006C CALL R10 1 + 0x8C2C150B, // 006D GETMET R11 R10 K11 + 0x58340006, // 006E LDCONST R13 K6 + 0x88380B17, // 006F GETMBR R14 R5 K23 + 0x1C3C1308, // 0070 EQ R15 R9 K8 + 0x783E0003, // 0071 JMPF R15 #0076 + 0xB83E0200, // 0072 GETNGBL R15 K1 + 0x8C3C1F18, // 0073 GETMET R15 R15 K24 + 0x7C3C0200, // 0074 CALL R15 1 + 0x70020002, // 0075 JMP #0079 + 0xB83E0200, // 0076 GETNGBL R15 K1 + 0x8C3C1F19, // 0077 GETMET R15 R15 K25 + 0x7C3C0200, // 0078 CALL R15 1 + 0x7C2C0800, // 0079 CALL R11 4 + 0x900E0911, // 007A SETMBR R3 K4 K17 + 0x80041400, // 007B RET 1 R10 + 0x70020134, // 007C JMP #01B2 + 0x1C240F06, // 007D EQ R9 R7 K6 + 0x78260044, // 007E JMPF R9 #00C4 + 0x8C240507, // 007F GETMET R9 R2 K7 + 0x582C0006, // 0080 LDCONST R11 K6 + 0x7C240400, // 0081 CALL R9 2 + 0x6028000C, // 0082 GETGBL R10 G12 + 0x5C2C1200, // 0083 MOVE R11 R9 + 0x7C280200, // 0084 CALL R10 1 + 0x542E001F, // 0085 LDINT R11 32 + 0x2028140B, // 0086 NE R10 R10 R11 + 0x782A0001, // 0087 JMPF R10 #008A + 0x4C280000, // 0088 LDNIL R10 + 0x80041400, // 0089 RET 1 R10 + 0x900E0908, // 008A SETMBR R3 K4 K8 + 0x8C280B0A, // 008B GETMET R10 R5 K10 + 0x7C280200, // 008C CALL R10 1 + 0x8C2C150B, // 008D GETMET R11 R10 K11 + 0x58340008, // 008E LDCONST R13 K8 + 0x88380B17, // 008F GETMBR R14 R5 K23 + 0xB83E0200, // 0090 GETNGBL R15 K1 + 0x8C3C1F1A, // 0091 GETMET R15 R15 K26 + 0x7C3C0200, // 0092 CALL R15 1 + 0x7C2C0800, // 0093 CALL R11 4 + 0x8C2C150B, // 0094 GETMET R11 R10 K11 + 0x5834000F, // 0095 LDCONST R13 K15 + 0x88380B1B, // 0096 GETMBR R14 R5 K27 + 0x5C3C1200, // 0097 MOVE R15 R9 + 0x7C2C0800, // 0098 CALL R11 4 + 0x8C2C150B, // 0099 GETMET R11 R10 K11 + 0x58340011, // 009A LDCONST R13 K17 + 0x88380B1C, // 009B GETMBR R14 R5 K28 + 0xB83E3A00, // 009C GETNGBL R15 K29 + 0x8C3C1F1E, // 009D GETMET R15 R15 K30 + 0x7C3C0200, // 009E CALL R15 1 + 0x943C1F1F, // 009F GETIDX R15 R15 K31 + 0x7C2C0800, // 00A0 CALL R11 4 + 0x8C2C1520, // 00A1 GETMET R11 R10 K32 + 0x7C2C0200, // 00A2 CALL R11 1 + 0x8C301121, // 00A3 GETMET R12 R8 K33 + 0x7C300200, // 00A4 CALL R12 1 + 0x0034160C, // 00A5 ADD R13 R11 R12 + 0xB83A3A00, // 00A6 GETNGBL R14 K29 + 0x8C381D22, // 00A7 GETMET R14 R14 K34 + 0x8C401B24, // 00A8 GETMET R16 R13 K36 + 0x7C400200, // 00A9 CALL R16 1 + 0x00424610, // 00AA ADD R16 K35 R16 + 0x58440011, // 00AB LDCONST R17 K17 + 0x7C380600, // 00AC CALL R14 3 + 0x8C380925, // 00AD GETMET R14 R4 K37 + 0x7C380200, // 00AE CALL R14 1 + 0x8C381D26, // 00AF GETMET R14 R14 K38 + 0xB8420200, // 00B0 GETNGBL R16 K1 + 0x8C402127, // 00B1 GETMET R16 R16 K39 + 0x7C400200, // 00B2 CALL R16 1 + 0x5C441A00, // 00B3 MOVE R17 R13 + 0x7C380600, // 00B4 CALL R14 3 + 0x8C3C0B0A, // 00B5 GETMET R15 R5 K10 + 0x7C3C0200, // 00B6 CALL R15 1 + 0x8C401F0B, // 00B7 GETMET R16 R15 K11 + 0x58480006, // 00B8 LDCONST R18 K6 + 0x884C0B17, // 00B9 GETMBR R19 R5 K23 + 0x5C501600, // 00BA MOVE R20 R11 + 0x7C400800, // 00BB CALL R16 4 + 0x8C401F0B, // 00BC GETMET R16 R15 K11 + 0x58480008, // 00BD LDCONST R18 K8 + 0x884C0B1B, // 00BE GETMBR R19 R5 K27 + 0x5C501C00, // 00BF MOVE R20 R14 + 0x7C400800, // 00C0 CALL R16 4 + 0x900E0908, // 00C1 SETMBR R3 K4 K8 + 0x80041E00, // 00C2 RET 1 R15 + 0x700200ED, // 00C3 JMP #01B2 + 0x54260003, // 00C4 LDINT R9 4 + 0x1C240E09, // 00C5 EQ R9 R7 R9 + 0x78260040, // 00C6 JMPF R9 #0108 + 0x8C240507, // 00C7 GETMET R9 R2 K7 + 0x582C0006, // 00C8 LDCONST R11 K6 + 0x7C240400, // 00C9 CALL R9 2 + 0x6028000C, // 00CA GETGBL R10 G12 + 0x5C2C1200, // 00CB MOVE R11 R9 + 0x7C280200, // 00CC CALL R10 1 + 0x542E001F, // 00CD LDINT R11 32 + 0x2028140B, // 00CE NE R10 R10 R11 + 0x782A0001, // 00CF JMPF R10 #00D2 + 0x4C280000, // 00D0 LDNIL R10 + 0x80041400, // 00D1 RET 1 R10 + 0x8C280507, // 00D2 GETMET R10 R2 K7 + 0x58300008, // 00D3 LDCONST R12 K8 + 0x50340000, // 00D4 LDBOOL R13 0 0 + 0x7C280600, // 00D5 CALL R10 3 + 0x8C2C1128, // 00D6 GETMET R11 R8 K40 + 0x7C2C0200, // 00D7 CALL R11 1 + 0x8C300B0A, // 00D8 GETMET R12 R5 K10 + 0x7C300200, // 00D9 CALL R12 1 + 0x8C34190B, // 00DA GETMET R13 R12 K11 + 0x583C0008, // 00DB LDCONST R15 K8 + 0x88400B17, // 00DC GETMBR R16 R5 K23 + 0x5C441600, // 00DD MOVE R17 R11 + 0x7C340800, // 00DE CALL R13 4 + 0x8C34190B, // 00DF GETMET R13 R12 K11 + 0x583C000F, // 00E0 LDCONST R15 K15 + 0x88400B1B, // 00E1 GETMBR R16 R5 K27 + 0x5C441200, // 00E2 MOVE R17 R9 + 0x7C340800, // 00E3 CALL R13 4 + 0x8C341920, // 00E4 GETMET R13 R12 K32 + 0x7C340200, // 00E5 CALL R13 1 + 0x8C381121, // 00E6 GETMET R14 R8 K33 + 0x7C380200, // 00E7 CALL R14 1 + 0x00381A0E, // 00E8 ADD R14 R13 R14 + 0xB83E3A00, // 00E9 GETNGBL R15 K29 + 0x8C3C1F22, // 00EA GETMET R15 R15 K34 + 0x8C441D24, // 00EB GETMET R17 R14 K36 + 0x7C440200, // 00EC CALL R17 1 + 0x00465211, // 00ED ADD R17 K41 R17 + 0x58480011, // 00EE LDCONST R18 K17 + 0x7C3C0600, // 00EF CALL R15 3 + 0x8C3C0925, // 00F0 GETMET R15 R4 K37 + 0x7C3C0200, // 00F1 CALL R15 1 + 0x8C3C1F26, // 00F2 GETMET R15 R15 K38 + 0xB8460200, // 00F3 GETNGBL R17 K1 + 0x8C442327, // 00F4 GETMET R17 R17 K39 + 0x7C440200, // 00F5 CALL R17 1 + 0x5C481C00, // 00F6 MOVE R18 R14 + 0x7C3C0600, // 00F7 CALL R15 3 + 0x8C400B0A, // 00F8 GETMET R16 R5 K10 + 0x7C400200, // 00F9 CALL R16 1 + 0x8C44210B, // 00FA GETMET R17 R16 K11 + 0x584C0006, // 00FB LDCONST R19 K6 + 0x88500B17, // 00FC GETMBR R20 R5 K23 + 0x5C541A00, // 00FD MOVE R21 R13 + 0x7C440800, // 00FE CALL R17 4 + 0x8C44210B, // 00FF GETMET R17 R16 K11 + 0x584C0008, // 0100 LDCONST R19 K8 + 0x88500B1B, // 0101 GETMBR R20 R5 K27 + 0x5C541E00, // 0102 MOVE R21 R15 + 0x7C440800, // 0103 CALL R17 4 + 0x54460004, // 0104 LDINT R17 5 + 0x900E0811, // 0105 SETMBR R3 K4 R17 + 0x80042000, // 0106 RET 1 R16 + 0x700200A9, // 0107 JMP #01B2 + 0x5426000A, // 0108 LDINT R9 11 + 0x1C240E09, // 0109 EQ R9 R7 R9 + 0x78260012, // 010A JMPF R9 #011E + 0x8C240507, // 010B GETMET R9 R2 K7 + 0x582C0006, // 010C LDCONST R11 K6 + 0x7C240400, // 010D CALL R9 2 + 0x8C28112A, // 010E GETMET R10 R8 K42 + 0x5C301200, // 010F MOVE R12 R9 + 0x7C280400, // 0110 CALL R10 2 + 0xB82A3A00, // 0111 GETNGBL R10 K29 + 0x8C281522, // 0112 GETMET R10 R10 K34 + 0x8C301324, // 0113 GETMET R12 R9 K36 + 0x7C300200, // 0114 CALL R12 1 + 0x0032560C, // 0115 ADD R12 K43 R12 + 0x58340011, // 0116 LDCONST R13 K17 + 0x7C280600, // 0117 CALL R10 3 + 0xB82A0200, // 0118 GETNGBL R10 K1 + 0x8828152C, // 0119 GETMBR R10 R10 K44 + 0x900E2A0A, // 011A SETMBR R3 K21 R10 + 0x4C280000, // 011B LDNIL R10 + 0x80041400, // 011C RET 1 R10 + 0x70020093, // 011D JMP #01B2 + 0x54260005, // 011E LDINT R9 6 + 0x1C240E09, // 011F EQ R9 R7 R9 + 0x78260090, // 0120 JMPF R9 #01B2 + 0x8C240507, // 0121 GETMET R9 R2 K7 + 0x582C0006, // 0122 LDCONST R11 K6 + 0x7C240400, // 0123 CALL R9 2 + 0x8C280507, // 0124 GETMET R10 R2 K7 + 0x58300008, // 0125 LDCONST R12 K8 + 0x7C280400, // 0126 CALL R10 2 + 0x8C2C0507, // 0127 GETMET R11 R2 K7 + 0x5834000F, // 0128 LDCONST R13 K15 + 0x7C2C0400, // 0129 CALL R11 2 + 0x8C300507, // 012A GETMET R12 R2 K7 + 0x58380011, // 012B LDCONST R14 K17 + 0x7C300400, // 012C CALL R12 2 + 0x8C340507, // 012D GETMET R13 R2 K7 + 0x543E0003, // 012E LDINT R15 4 + 0x7C340400, // 012F CALL R13 2 + 0x8C38112D, // 0130 GETMET R14 R8 K45 + 0x7C380200, // 0131 CALL R14 1 + 0x4C3C0000, // 0132 LDNIL R15 + 0x1C381C0F, // 0133 EQ R14 R14 R15 + 0x783A0006, // 0134 JMPF R14 #013C + 0xB83A3A00, // 0135 GETNGBL R14 K29 + 0x8C381D22, // 0136 GETMET R14 R14 K34 + 0x5840002E, // 0137 LDCONST R16 K46 + 0x5844000F, // 0138 LDCONST R17 K15 + 0x7C380600, // 0139 CALL R14 3 + 0x4C380000, // 013A LDNIL R14 + 0x80041C00, // 013B RET 1 R14 + 0x8C38112F, // 013C GETMET R14 R8 K47 + 0x5C401200, // 013D MOVE R16 R9 + 0x5C441400, // 013E MOVE R17 R10 + 0x7C380600, // 013F CALL R14 3 + 0x8C381130, // 0140 GETMET R14 R8 K48 + 0x5C401600, // 0141 MOVE R16 R11 + 0x7C380400, // 0142 CALL R14 2 + 0x9022620C, // 0143 SETMBR R8 K49 R12 + 0x9022640D, // 0144 SETMBR R8 K50 R13 + 0xB83A0200, // 0145 GETNGBL R14 K1 + 0x88381D02, // 0146 GETMBR R14 R14 K2 + 0x8C381D33, // 0147 GETMET R14 R14 K51 + 0x5C401200, // 0148 MOVE R16 R9 + 0x7C380400, // 0149 CALL R14 2 + 0x8C3C1D34, // 014A GETMET R15 R14 K52 + 0x54460005, // 014B LDINT R17 6 + 0x7C3C0400, // 014C CALL R15 2 + 0x8C401F07, // 014D GETMET R16 R15 K7 + 0x544A0014, // 014E LDINT R18 21 + 0x7C400400, // 014F CALL R16 2 + 0x8C441F07, // 0150 GETMET R17 R15 K7 + 0x544E0010, // 0151 LDINT R19 17 + 0x7C440400, // 0152 CALL R17 2 + 0x5C482000, // 0153 MOVE R18 R16 + 0x784A0001, // 0154 JMPF R18 #0157 + 0x5C482200, // 0155 MOVE R18 R17 + 0x744A0006, // 0156 JMPT R18 #015E + 0xB84A3A00, // 0157 GETNGBL R18 K29 + 0x8C482522, // 0158 GETMET R18 R18 K34 + 0x58500035, // 0159 LDCONST R20 K53 + 0x5854000F, // 015A LDCONST R21 K15 + 0x7C480600, // 015B CALL R18 3 + 0x50480000, // 015C LDBOOL R18 0 0 + 0x80042400, // 015D RET 1 R18 + 0x60480004, // 015E GETGBL R18 G4 + 0x5C4C2000, // 015F MOVE R19 R16 + 0x7C480200, // 0160 CALL R18 1 + 0x1C482536, // 0161 EQ R18 R18 K54 + 0x784A0006, // 0162 JMPF R18 #016A + 0xB84A6E00, // 0163 GETNGBL R18 K55 + 0x5C4C2000, // 0164 MOVE R19 R16 + 0x7C480200, // 0165 CALL R18 1 + 0x8C482538, // 0166 GETMET R18 R18 K56 + 0x7C480200, // 0167 CALL R18 1 + 0x5C402400, // 0168 MOVE R16 R18 + 0x70020002, // 0169 JMP #016D + 0x8C482138, // 016A GETMET R18 R16 K56 + 0x7C480200, // 016B CALL R18 1 + 0x5C402400, // 016C MOVE R16 R18 + 0x60480004, // 016D GETGBL R18 G4 + 0x5C4C2200, // 016E MOVE R19 R17 + 0x7C480200, // 016F CALL R18 1 + 0x1C482536, // 0170 EQ R18 R18 K54 + 0x784A0006, // 0171 JMPF R18 #0179 + 0xB84A6E00, // 0172 GETNGBL R18 K55 + 0x5C4C2200, // 0173 MOVE R19 R17 + 0x7C480200, // 0174 CALL R18 1 + 0x8C482538, // 0175 GETMET R18 R18 K56 + 0x7C480200, // 0176 CALL R18 1 + 0x5C442400, // 0177 MOVE R17 R18 + 0x70020002, // 0178 JMP #017C + 0x8C482338, // 0179 GETMET R18 R17 K56 + 0x7C480200, // 017A CALL R18 1 + 0x5C442400, // 017B MOVE R17 R18 + 0xB84A0200, // 017C GETNGBL R18 K1 + 0x88482502, // 017D GETMBR R18 R18 K2 + 0x8C482533, // 017E GETMET R18 R18 K51 + 0x8C50112D, // 017F GETMET R20 R8 K45 + 0x7C500200, // 0180 CALL R20 1 + 0x7C480400, // 0181 CALL R18 2 + 0x8C482507, // 0182 GETMET R18 R18 K7 + 0x54520008, // 0183 LDINT R20 9 + 0x7C480400, // 0184 CALL R18 2 + 0x404E1139, // 0185 CONNECT R19 K8 K57 + 0x94482413, // 0186 GETIDX R18 R18 R19 + 0x60500015, // 0187 GETGBL R20 G21 + 0x7C500000, // 0188 CALL R20 0 + 0x8C50293A, // 0189 GETMET R20 R20 K58 + 0x5858003B, // 018A LDCONST R22 K59 + 0x7C500400, // 018B CALL R20 2 + 0x5C4C2800, // 018C MOVE R19 R20 + 0x8C50093C, // 018D GETMET R20 R4 K60 + 0x7C500200, // 018E CALL R20 1 + 0x8C54213D, // 018F GETMET R21 R16 K61 + 0x7C540200, // 0190 CALL R21 1 + 0x8C542B3E, // 0191 GETMET R21 R21 K62 + 0x7C540200, // 0192 CALL R21 1 + 0x8C58293F, // 0193 GETMET R22 R20 K63 + 0x5C602400, // 0194 MOVE R24 R18 + 0x5C642A00, // 0195 MOVE R25 R21 + 0x5C682600, // 0196 MOVE R26 R19 + 0x546E0007, // 0197 LDINT R27 8 + 0x7C580A00, // 0198 CALL R22 5 + 0x8C5C1140, // 0199 GETMET R23 R8 K64 + 0x5C642000, // 019A MOVE R25 R16 + 0x5C682200, // 019B MOVE R26 R17 + 0x5C6C2C00, // 019C MOVE R27 R22 + 0x7C5C0800, // 019D CALL R23 4 + 0x885C0113, // 019E GETMBR R23 R0 K19 + 0x8C5C2F41, // 019F GETMET R23 R23 K65 + 0x5C641000, // 01A0 MOVE R25 R8 + 0x7C5C0400, // 01A1 CALL R23 2 + 0x8C5C0B0A, // 01A2 GETMET R23 R5 K10 + 0x7C5C0200, // 01A3 CALL R23 1 + 0x8C602F0B, // 01A4 GETMET R24 R23 K11 + 0x58680006, // 01A5 LDCONST R26 K6 + 0x886C0B0C, // 01A6 GETMBR R27 R5 K12 + 0xB8720200, // 01A7 GETNGBL R28 K1 + 0x8870392C, // 01A8 GETMBR R28 R28 K44 + 0x7C600800, // 01A9 CALL R24 4 + 0x8C602F0B, // 01AA GETMET R24 R23 K11 + 0x58680008, // 01AB LDCONST R26 K8 + 0x886C0B0C, // 01AC GETMBR R27 R5 K12 + 0x58700008, // 01AD LDCONST R28 K8 + 0x7C600800, // 01AE CALL R24 4 + 0x54620007, // 01AF LDINT R24 8 + 0x900E0818, // 01B0 SETMBR R3 K4 R24 + 0x80042E00, // 01B1 RET 1 R23 + 0x80000000, // 01B2 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_Plugin_core +********************************************************************/ +extern const bclass be_class_Matter_Plugin; +be_local_class(Matter_Plugin_core, + 0, + &be_class_Matter_Plugin, + be_nested_map(3, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(read_attribute, 1), be_const_closure(Matter_Plugin_core_read_attribute_closure) }, + { be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_core_init_closure) }, + { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_core_invoke_request_closure) }, + })), + be_str_weak(Matter_Plugin_core) +); +/*******************************************************************/ + +void be_load_Matter_Plugin_core_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_Plugin_core); + be_setglobal(vm, "Matter_Plugin_core"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Session.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Session.h new file mode 100644 index 000000000..30d718e06 --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Session.h @@ -0,0 +1,2239 @@ +/* Solidification of Matter_Session.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_Session; + +/******************************************************************** +** Solidified function: get_pk +********************************************************************/ +be_local_closure(Matter_Session_get_pk, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(no_private_key), + /* K1 */ be_nested_str_weak(crypto), + /* K2 */ be_nested_str_weak(random), + }), + be_str_weak(get_pk), + &be_const_str_solidified, + ( &(const binstruction[ 9]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x74060004, // 0001 JMPT R1 #0007 + 0xA4060200, // 0002 IMPORT R1 K1 + 0x8C080302, // 0003 GETMET R2 R1 K2 + 0x5412001F, // 0004 LDINT R4 32 + 0x7C080400, // 0005 CALL R2 2 + 0x90020002, // 0006 SETMBR R0 K0 R2 + 0x88040100, // 0007 GETMBR R1 R0 K0 + 0x80040200, // 0008 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_ac +********************************************************************/ +be_local_closure(Matter_Session_get_ac, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(attestation_challenge), + }), + be_str_weak(get_ac), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_ipk_group_key +********************************************************************/ +be_local_closure(Matter_Session_get_ipk_group_key, /* name */ + be_nested_proto( + 10, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str_weak(ipk_epoch_key), + /* K1 */ be_nested_str_weak(fabric_compressed), + /* K2 */ be_nested_str_weak(crypto), + /* K3 */ be_nested_str_weak(HKDF_SHA256), + /* K4 */ be_nested_str_weak(fromstring), + /* K5 */ be_nested_str_weak(__GROUP_KEY), + /* K6 */ be_nested_str_weak(derive), + }), + be_str_weak(get_ipk_group_key), + &be_const_str_solidified, + ( &(const binstruction[25]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x4C080000, // 0001 LDNIL R2 + 0x1C040202, // 0002 EQ R1 R1 R2 + 0x74060003, // 0003 JMPT R1 #0008 + 0x88040101, // 0004 GETMBR R1 R0 K1 + 0x4C080000, // 0005 LDNIL R2 + 0x1C040202, // 0006 EQ R1 R1 R2 + 0x78060001, // 0007 JMPF R1 #000A + 0x4C040000, // 0008 LDNIL R1 + 0x80040200, // 0009 RET 1 R1 + 0xA4060400, // 000A IMPORT R1 K2 + 0x8C080303, // 000B GETMET R2 R1 K3 + 0x7C080200, // 000C CALL R2 1 + 0x600C0015, // 000D GETGBL R3 G21 + 0x7C0C0000, // 000E CALL R3 0 + 0x8C0C0704, // 000F GETMET R3 R3 K4 + 0x88140105, // 0010 GETMBR R5 R0 K5 + 0x7C0C0400, // 0011 CALL R3 2 + 0x8C100506, // 0012 GETMET R4 R2 K6 + 0x88180100, // 0013 GETMBR R6 R0 K0 + 0x881C0101, // 0014 GETMBR R7 R0 K1 + 0x5C200600, // 0015 MOVE R8 R3 + 0x5426000F, // 0016 LDINT R9 16 + 0x7C100A00, // 0017 CALL R4 5 + 0x80040800, // 0018 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_ca +********************************************************************/ +be_local_closure(Matter_Session_set_ca, /* name */ + be_nested_proto( + 2, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(root_ca_certificate), + }), + be_str_weak(set_ca), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x80000000, // 0001 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: save +********************************************************************/ +be_local_closure(Matter_Session_save, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(__store), + /* K1 */ be_nested_str_weak(save), + }), + be_str_weak(save), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x80000000, // 0003 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_ipk_epoch_key +********************************************************************/ +be_local_closure(Matter_Session_set_ipk_epoch_key, /* name */ + be_nested_proto( + 2, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(ipk_epoch_key), + }), + be_str_weak(set_ipk_epoch_key), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x80000000, // 0001 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_expire_time +********************************************************************/ +be_local_closure(Matter_Session_set_expire_time, /* name */ + be_nested_proto( + 4, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(expiration), + }), + be_str_weak(set_expire_time), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x60080009, // 0000 GETGBL R2 G9 + 0x5C0C0200, // 0001 MOVE R3 R1 + 0x7C080200, // 0002 CALL R2 1 + 0x90020002, // 0003 SETMBR R0 K0 R2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_expire_in_seconds +********************************************************************/ +be_local_closure(Matter_Session_set_expire_in_seconds, /* name */ + be_nested_proto( + 6, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(tasmota), + /* K1 */ be_nested_str_weak(rtc), + /* K2 */ be_nested_str_weak(utc), + /* K3 */ be_nested_str_weak(set_expire_time), + }), + be_str_weak(set_expire_in_seconds), + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0x4C0C0000, // 0000 LDNIL R3 + 0x1C0C0203, // 0001 EQ R3 R1 R3 + 0x780E0000, // 0002 JMPF R3 #0004 + 0x80000600, // 0003 RET 0 + 0x4C0C0000, // 0004 LDNIL R3 + 0x1C0C0403, // 0005 EQ R3 R2 R3 + 0x780E0003, // 0006 JMPF R3 #000B + 0xB80E0000, // 0007 GETNGBL R3 K0 + 0x8C0C0701, // 0008 GETMET R3 R3 K1 + 0x7C0C0200, // 0009 CALL R3 1 + 0x94080702, // 000A GETIDX R2 R3 K2 + 0x8C0C0103, // 000B GETMET R3 R0 K3 + 0x00140401, // 000C ADD R5 R2 R1 + 0x7C0C0400, // 000D CALL R3 2 + 0x80000000, // 000E RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: tojson +********************************************************************/ +be_local_closure(Matter_Session_tojson, /* name */ + be_nested_proto( + 18, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[24]) { /* constants */ + /* K0 */ be_nested_str_weak(json), + /* K1 */ be_nested_str_weak(string), + /* K2 */ be_nested_str_weak(introspect), + /* K3 */ be_nested_str_weak(members), + /* K4 */ be_nested_str_weak(get), + /* K5 */ be_nested_str_weak(function), + /* K6 */ be_const_int(0), + /* K7 */ be_nested_str_weak(_), + /* K8 */ be_nested_str_weak(push), + /* K9 */ be_nested_str_weak(stop_iteration), + /* K10 */ be_nested_str_weak(matter), + /* K11 */ be_nested_str_weak(sort), + /* K12 */ be_nested_str_weak(counter_rcv), + /* K13 */ be_nested_str_weak(val), + /* K14 */ be_nested_str_weak(counter_snd), + /* K15 */ be_nested_str_weak(_X24_X24), + /* K16 */ be_nested_str_weak(tob64), + /* K17 */ be_nested_str_weak(format), + /* K18 */ be_nested_str_weak(_X25s_X3A_X25s), + /* K19 */ be_nested_str_weak(dump), + /* K20 */ be_nested_str_weak(_X7B), + /* K21 */ be_nested_str_weak(concat), + /* K22 */ be_nested_str_weak(_X2C), + /* K23 */ be_nested_str_weak(_X7D), + }), + be_str_weak(tojson), + &be_const_str_solidified, + ( &(const binstruction[98]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0xA40E0400, // 0002 IMPORT R3 K2 + 0x60100012, // 0003 GETGBL R4 G18 + 0x7C100000, // 0004 CALL R4 0 + 0x60140010, // 0005 GETGBL R5 G16 + 0x8C180703, // 0006 GETMET R6 R3 K3 + 0x5C200000, // 0007 MOVE R8 R0 + 0x7C180400, // 0008 CALL R6 2 + 0x7C140200, // 0009 CALL R5 1 + 0xA8020011, // 000A EXBLK 0 #001D + 0x5C180A00, // 000B MOVE R6 R5 + 0x7C180000, // 000C CALL R6 0 + 0x8C1C0704, // 000D GETMET R7 R3 K4 + 0x5C240000, // 000E MOVE R9 R0 + 0x5C280C00, // 000F MOVE R10 R6 + 0x7C1C0600, // 0010 CALL R7 3 + 0x60200004, // 0011 GETGBL R8 G4 + 0x5C240E00, // 0012 MOVE R9 R7 + 0x7C200200, // 0013 CALL R8 1 + 0x20201105, // 0014 NE R8 R8 K5 + 0x78220005, // 0015 JMPF R8 #001C + 0x94200D06, // 0016 GETIDX R8 R6 K6 + 0x20201107, // 0017 NE R8 R8 K7 + 0x78220002, // 0018 JMPF R8 #001C + 0x8C200908, // 0019 GETMET R8 R4 K8 + 0x5C280C00, // 001A MOVE R10 R6 + 0x7C200400, // 001B CALL R8 2 + 0x7001FFED, // 001C JMP #000B + 0x58140009, // 001D LDCONST R5 K9 + 0xAC140200, // 001E CATCH R5 1 0 + 0xB0080000, // 001F RAISE 2 R0 R0 + 0xB8161400, // 0020 GETNGBL R5 K10 + 0x8C140B0B, // 0021 GETMET R5 R5 K11 + 0x5C1C0800, // 0022 MOVE R7 R4 + 0x7C140400, // 0023 CALL R5 2 + 0x5C100A00, // 0024 MOVE R4 R5 + 0x60140012, // 0025 GETGBL R5 G18 + 0x7C140000, // 0026 CALL R5 0 + 0x60180010, // 0027 GETGBL R6 G16 + 0x5C1C0800, // 0028 MOVE R7 R4 + 0x7C180200, // 0029 CALL R6 1 + 0xA802002D, // 002A EXBLK 0 #0059 + 0x5C1C0C00, // 002B MOVE R7 R6 + 0x7C1C0000, // 002C CALL R7 0 + 0x8C200704, // 002D GETMET R8 R3 K4 + 0x5C280000, // 002E MOVE R10 R0 + 0x5C2C0E00, // 002F MOVE R11 R7 + 0x7C200600, // 0030 CALL R8 3 + 0x4C240000, // 0031 LDNIL R9 + 0x1C241009, // 0032 EQ R9 R8 R9 + 0x78260000, // 0033 JMPF R9 #0035 + 0x7001FFF5, // 0034 JMP #002B + 0x1C240F0C, // 0035 EQ R9 R7 K12 + 0x78260003, // 0036 JMPF R9 #003B + 0x8C24110D, // 0037 GETMET R9 R8 K13 + 0x7C240200, // 0038 CALL R9 1 + 0x5C201200, // 0039 MOVE R8 R9 + 0x70020006, // 003A JMP #0042 + 0x1C240F0E, // 003B EQ R9 R7 K14 + 0x78260004, // 003C JMPF R9 #0042 + 0x8C24110D, // 003D GETMET R9 R8 K13 + 0x7C240200, // 003E CALL R9 1 + 0x542A00FF, // 003F LDINT R10 256 + 0x0024120A, // 0040 ADD R9 R9 R10 + 0x5C201200, // 0041 MOVE R8 R9 + 0x6024000F, // 0042 GETGBL R9 G15 + 0x5C281000, // 0043 MOVE R10 R8 + 0x602C0015, // 0044 GETGBL R11 G21 + 0x7C240400, // 0045 CALL R9 2 + 0x78260003, // 0046 JMPF R9 #004B + 0x8C241110, // 0047 GETMET R9 R8 K16 + 0x7C240200, // 0048 CALL R9 1 + 0x00261E09, // 0049 ADD R9 K15 R9 + 0x5C201200, // 004A MOVE R8 R9 + 0x8C240B08, // 004B GETMET R9 R5 K8 + 0x8C2C0511, // 004C GETMET R11 R2 K17 + 0x58340012, // 004D LDCONST R13 K18 + 0x8C380313, // 004E GETMET R14 R1 K19 + 0x60400008, // 004F GETGBL R16 G8 + 0x5C440E00, // 0050 MOVE R17 R7 + 0x7C400200, // 0051 CALL R16 1 + 0x7C380400, // 0052 CALL R14 2 + 0x8C3C0313, // 0053 GETMET R15 R1 K19 + 0x5C441000, // 0054 MOVE R17 R8 + 0x7C3C0400, // 0055 CALL R15 2 + 0x7C2C0800, // 0056 CALL R11 4 + 0x7C240400, // 0057 CALL R9 2 + 0x7001FFD1, // 0058 JMP #002B + 0x58180009, // 0059 LDCONST R6 K9 + 0xAC180200, // 005A CATCH R6 1 0 + 0xB0080000, // 005B RAISE 2 R0 R0 + 0x8C180B15, // 005C GETMET R6 R5 K21 + 0x58200016, // 005D LDCONST R8 K22 + 0x7C180400, // 005E CALL R6 2 + 0x001A2806, // 005F ADD R6 K20 R6 + 0x00180D17, // 0060 ADD R6 R6 K23 + 0x80040C00, // 0061 RET 1 R6 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_noc +********************************************************************/ +be_local_closure(Matter_Session_get_noc, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(noc), + }), + be_str_weak(get_noc), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_fabric +********************************************************************/ +be_local_closure(Matter_Session_get_fabric, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(fabric), + }), + be_str_weak(get_fabric), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: has_expired +********************************************************************/ +be_local_closure(Matter_Session_has_expired, /* name */ + be_nested_proto( + 4, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(tasmota), + /* K1 */ be_nested_str_weak(rtc), + /* K2 */ be_nested_str_weak(utc), + /* K3 */ be_nested_str_weak(expiration), + }), + be_str_weak(has_expired), + &be_const_str_solidified, + ( &(const binstruction[16]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0003, // 0002 JMPF R2 #0007 + 0xB80A0000, // 0003 GETNGBL R2 K0 + 0x8C080501, // 0004 GETMET R2 R2 K1 + 0x7C080200, // 0005 CALL R2 1 + 0x94040502, // 0006 GETIDX R1 R2 K2 + 0x88080103, // 0007 GETMBR R2 R0 K3 + 0x4C0C0000, // 0008 LDNIL R3 + 0x20080403, // 0009 NE R2 R2 R3 + 0x780A0002, // 000A JMPF R2 #000E + 0x88080103, // 000B GETMBR R2 R0 K3 + 0x28080202, // 000C GE R2 R1 R2 + 0x80040400, // 000D RET 1 R2 + 0x50080000, // 000E LDBOOL R2 0 0 + 0x80040400, // 000F RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: fromjson +********************************************************************/ +be_local_closure(Matter_Session_fromjson, /* name */ + be_nested_proto( + 16, /* nstack */ + 2, /* argc */ + 4, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[19]) { /* constants */ + /* K0 */ be_const_class(be_class_Matter_Session), + /* K1 */ be_nested_str_weak(string), + /* K2 */ be_nested_str_weak(introspect), + /* K3 */ be_nested_str_weak(matter), + /* K4 */ be_nested_str_weak(Session), + /* K5 */ be_nested_str_weak(keys), + /* K6 */ be_nested_str_weak(counter_rcv), + /* K7 */ be_nested_str_weak(reset), + /* K8 */ be_nested_str_weak(counter_snd), + /* K9 */ be_nested_str_weak(find), + /* K10 */ be_nested_str_weak(0x), + /* K11 */ be_const_int(0), + /* K12 */ be_nested_str_weak(set), + /* K13 */ be_nested_str_weak(fromhex), + /* K14 */ be_const_int(2), + /* K15 */ be_const_int(2147483647), + /* K16 */ be_nested_str_weak(_X24_X24), + /* K17 */ be_nested_str_weak(fromb64), + /* K18 */ be_nested_str_weak(stop_iteration), + }), + be_str_weak(fromjson), + &be_const_str_solidified, + ( &(const binstruction[88]) { /* code */ + 0x58080000, // 0000 LDCONST R2 K0 + 0xA40E0200, // 0001 IMPORT R3 K1 + 0xA4120400, // 0002 IMPORT R4 K2 + 0xB8160600, // 0003 GETNGBL R5 K3 + 0x8C140B04, // 0004 GETMET R5 R5 K4 + 0x5C1C0000, // 0005 MOVE R7 R0 + 0x7C140400, // 0006 CALL R5 2 + 0x60180010, // 0007 GETGBL R6 G16 + 0x8C1C0305, // 0008 GETMET R7 R1 K5 + 0x7C1C0200, // 0009 CALL R7 1 + 0x7C180200, // 000A CALL R6 1 + 0xA8020047, // 000B EXBLK 0 #0054 + 0x5C1C0C00, // 000C MOVE R7 R6 + 0x7C1C0000, // 000D CALL R7 0 + 0x94200207, // 000E GETIDX R8 R1 R7 + 0x1C240F06, // 000F EQ R9 R7 K6 + 0x78260006, // 0010 JMPF R9 #0018 + 0x88240B06, // 0011 GETMBR R9 R5 K6 + 0x8C241307, // 0012 GETMET R9 R9 K7 + 0x602C0009, // 0013 GETGBL R11 G9 + 0x5C301000, // 0014 MOVE R12 R8 + 0x7C2C0200, // 0015 CALL R11 1 + 0x7C240400, // 0016 CALL R9 2 + 0x7002003A, // 0017 JMP #0053 + 0x1C240F08, // 0018 EQ R9 R7 K8 + 0x78260006, // 0019 JMPF R9 #0021 + 0x88240B08, // 001A GETMBR R9 R5 K8 + 0x8C241307, // 001B GETMET R9 R9 K7 + 0x602C0009, // 001C GETGBL R11 G9 + 0x5C301000, // 001D MOVE R12 R8 + 0x7C2C0200, // 001E CALL R11 1 + 0x7C240400, // 001F CALL R9 2 + 0x70020031, // 0020 JMP #0053 + 0x60240004, // 0021 GETGBL R9 G4 + 0x5C281000, // 0022 MOVE R10 R8 + 0x7C240200, // 0023 CALL R9 1 + 0x1C241301, // 0024 EQ R9 R9 K1 + 0x78260027, // 0025 JMPF R9 #004E + 0x8C240709, // 0026 GETMET R9 R3 K9 + 0x5C2C1000, // 0027 MOVE R11 R8 + 0x5830000A, // 0028 LDCONST R12 K10 + 0x7C240600, // 0029 CALL R9 3 + 0x1C24130B, // 002A EQ R9 R9 K11 + 0x7826000A, // 002B JMPF R9 #0037 + 0x8C24090C, // 002C GETMET R9 R4 K12 + 0x5C2C0A00, // 002D MOVE R11 R5 + 0x5C300E00, // 002E MOVE R12 R7 + 0x60340015, // 002F GETGBL R13 G21 + 0x7C340000, // 0030 CALL R13 0 + 0x8C341B0D, // 0031 GETMET R13 R13 K13 + 0x403E1D0F, // 0032 CONNECT R15 K14 K15 + 0x943C100F, // 0033 GETIDX R15 R8 R15 + 0x7C340400, // 0034 CALL R13 2 + 0x7C240800, // 0035 CALL R9 4 + 0x70020015, // 0036 JMP #004D + 0x8C240709, // 0037 GETMET R9 R3 K9 + 0x5C2C1000, // 0038 MOVE R11 R8 + 0x58300010, // 0039 LDCONST R12 K16 + 0x7C240600, // 003A CALL R9 3 + 0x1C24130B, // 003B EQ R9 R9 K11 + 0x7826000A, // 003C JMPF R9 #0048 + 0x8C24090C, // 003D GETMET R9 R4 K12 + 0x5C2C0A00, // 003E MOVE R11 R5 + 0x5C300E00, // 003F MOVE R12 R7 + 0x60340015, // 0040 GETGBL R13 G21 + 0x7C340000, // 0041 CALL R13 0 + 0x8C341B11, // 0042 GETMET R13 R13 K17 + 0x403E1D0F, // 0043 CONNECT R15 K14 K15 + 0x943C100F, // 0044 GETIDX R15 R8 R15 + 0x7C340400, // 0045 CALL R13 2 + 0x7C240800, // 0046 CALL R9 4 + 0x70020004, // 0047 JMP #004D + 0x8C24090C, // 0048 GETMET R9 R4 K12 + 0x5C2C0A00, // 0049 MOVE R11 R5 + 0x5C300E00, // 004A MOVE R12 R7 + 0x5C341000, // 004B MOVE R13 R8 + 0x7C240800, // 004C CALL R9 4 + 0x70020004, // 004D JMP #0053 + 0x8C24090C, // 004E GETMET R9 R4 K12 + 0x5C2C0A00, // 004F MOVE R11 R5 + 0x5C300E00, // 0050 MOVE R12 R7 + 0x5C341000, // 0051 MOVE R13 R8 + 0x7C240800, // 0052 CALL R9 4 + 0x7001FFB7, // 0053 JMP #000C + 0x58180012, // 0054 LDCONST R6 K18 + 0xAC180200, // 0055 CATCH R6 1 0 + 0xB0080000, // 0056 RAISE 2 R0 R0 + 0x80040A00, // 0057 RET 1 R5 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_no_expiration +********************************************************************/ +be_local_closure(Matter_Session_set_no_expiration, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(expiration), + }), + be_str_weak(set_no_expiration), + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x4C040000, // 0000 LDNIL R1 + 0x90020001, // 0001 SETMBR R0 K0 R1 + 0x80000000, // 0002 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: gen_CSR +********************************************************************/ +be_local_closure(Matter_Session_gen_CSR, /* name */ + be_nested_proto( + 15, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[12]) { /* constants */ + /* K0 */ be_nested_str_weak(get_pk), + /* K1 */ be_nested_str_weak(crypto), + /* K2 */ be_nested_str_weak(EC_P256), + /* K3 */ be_nested_str_weak(public_key), + /* K4 */ be_nested_str_weak(3070020100300E310C300A060355040A0C034353523059301306072A8648CE3D020106082A8648CE3D030107034200), + /* K5 */ be_nested_str_weak(A000), + /* K6 */ be_nested_str_weak(300C06082A8648CE3D0403020500), + /* K7 */ be_nested_str_weak(ecdsa_sign_sha256_asn1), + /* K8 */ be_nested_str_weak(add), + /* K9 */ be_const_int(3), + /* K10 */ be_const_int(1), + /* K11 */ be_const_int(0), + }), + be_str_weak(gen_CSR), + &be_const_str_solidified, + ( &(const binstruction[73]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x7C040200, // 0001 CALL R1 1 + 0xA40A0200, // 0002 IMPORT R2 K1 + 0x8C0C0502, // 0003 GETMET R3 R2 K2 + 0x7C0C0200, // 0004 CALL R3 1 + 0x8C100703, // 0005 GETMET R4 R3 K3 + 0x5C180200, // 0006 MOVE R6 R1 + 0x7C100400, // 0007 CALL R4 2 + 0x60140015, // 0008 GETGBL R5 G21 + 0x58180004, // 0009 LDCONST R6 K4 + 0x7C140200, // 000A CALL R5 1 + 0x40180A04, // 000B CONNECT R6 R5 R4 + 0x60180015, // 000C GETGBL R6 G21 + 0x581C0005, // 000D LDCONST R7 K5 + 0x7C180200, // 000E CALL R6 1 + 0x40180A06, // 000F CONNECT R6 R5 R6 + 0x60180015, // 0010 GETGBL R6 G21 + 0x581C0006, // 0011 LDCONST R7 K6 + 0x7C180200, // 0012 CALL R6 1 + 0x8C1C0707, // 0013 GETMET R7 R3 K7 + 0x5C240200, // 0014 MOVE R9 R1 + 0x5C280A00, // 0015 MOVE R10 R5 + 0x7C1C0600, // 0016 CALL R7 3 + 0x60200015, // 0017 GETGBL R8 G21 + 0x5426007F, // 0018 LDINT R9 128 + 0x7C200200, // 0019 CALL R8 1 + 0x8C241108, // 001A GETMET R9 R8 K8 + 0x582C0009, // 001B LDCONST R11 K9 + 0x5830000A, // 001C LDCONST R12 K10 + 0x7C240600, // 001D CALL R9 3 + 0x8C241108, // 001E GETMET R9 R8 K8 + 0x602C000C, // 001F GETGBL R11 G12 + 0x5C300E00, // 0020 MOVE R12 R7 + 0x7C2C0200, // 0021 CALL R11 1 + 0x002C170A, // 0022 ADD R11 R11 K10 + 0x5830000A, // 0023 LDCONST R12 K10 + 0x7C240600, // 0024 CALL R9 3 + 0x8C241108, // 0025 GETMET R9 R8 K8 + 0x582C000B, // 0026 LDCONST R11 K11 + 0x5830000A, // 0027 LDCONST R12 K10 + 0x7C240600, // 0028 CALL R9 3 + 0x40241007, // 0029 CONNECT R9 R8 R7 + 0x6024000C, // 002A GETGBL R9 G12 + 0x5C280A00, // 002B MOVE R10 R5 + 0x7C240200, // 002C CALL R9 1 + 0x6028000C, // 002D GETGBL R10 G12 + 0x5C2C0C00, // 002E MOVE R11 R6 + 0x7C280200, // 002F CALL R10 1 + 0x0024120A, // 0030 ADD R9 R9 R10 + 0x6028000C, // 0031 GETGBL R10 G12 + 0x5C2C1000, // 0032 MOVE R11 R8 + 0x7C280200, // 0033 CALL R10 1 + 0x0024120A, // 0034 ADD R9 R9 R10 + 0x60280015, // 0035 GETGBL R10 G21 + 0x542E00CF, // 0036 LDINT R11 208 + 0x7C280200, // 0037 CALL R10 1 + 0x8C2C1508, // 0038 GETMET R11 R10 K8 + 0x5436002F, // 0039 LDINT R13 48 + 0x5838000A, // 003A LDCONST R14 K10 + 0x7C2C0600, // 003B CALL R11 3 + 0x8C2C1508, // 003C GETMET R11 R10 K8 + 0x54360080, // 003D LDINT R13 129 + 0x5838000A, // 003E LDCONST R14 K10 + 0x7C2C0600, // 003F CALL R11 3 + 0x8C2C1508, // 0040 GETMET R11 R10 K8 + 0x543600FE, // 0041 LDINT R13 255 + 0x2C34120D, // 0042 AND R13 R9 R13 + 0x5838000A, // 0043 LDCONST R14 K10 + 0x7C2C0600, // 0044 CALL R11 3 + 0x402C1405, // 0045 CONNECT R11 R10 R5 + 0x402C1406, // 0046 CONNECT R11 R10 R6 + 0x402C1408, // 0047 CONNECT R11 R10 R8 + 0x80041400, // 0048 RET 1 R10 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_r2i +********************************************************************/ +be_local_closure(Matter_Session_get_r2i, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(r2ikey), + }), + be_str_weak(get_r2i), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_keys +********************************************************************/ +be_local_closure(Matter_Session_set_keys, /* name */ + be_nested_proto( + 5, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(i2rkey), + /* K1 */ be_nested_str_weak(r2ikey), + /* K2 */ be_nested_str_weak(attestation_challenge), + /* K3 */ be_nested_str_weak(session_timestamp), + }), + be_str_weak(set_keys), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x90020202, // 0001 SETMBR R0 K1 R2 + 0x90020403, // 0002 SETMBR R0 K2 R3 + 0x90020604, // 0003 SETMBR R0 K3 R4 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_noc +********************************************************************/ +be_local_closure(Matter_Session_set_noc, /* name */ + be_nested_proto( + 3, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(noc), + /* K1 */ be_nested_str_weak(icac), + }), + be_str_weak(set_noc), + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x90020202, // 0001 SETMBR R0 K1 R2 + 0x80000000, // 0002 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_fabric_device +********************************************************************/ +be_local_closure(Matter_Session_set_fabric_device, /* name */ + be_nested_proto( + 7, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(fabric), + /* K1 */ be_nested_str_weak(deviceid), + /* K2 */ be_nested_str_weak(fabric_compressed), + /* K3 */ be_nested_str_weak(__store), + /* K4 */ be_nested_str_weak(remove_redundant_session), + }), + be_str_weak(set_fabric_device), + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x90020202, // 0001 SETMBR R0 K1 R2 + 0x90020403, // 0002 SETMBR R0 K2 R3 + 0x88100103, // 0003 GETMBR R4 R0 K3 + 0x8C100904, // 0004 GETMET R4 R4 K4 + 0x5C180000, // 0005 MOVE R6 R0 + 0x7C100400, // 0006 CALL R4 2 + 0x80000000, // 0007 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_ipk_epoch_key +********************************************************************/ +be_local_closure(Matter_Session_get_ipk_epoch_key, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(ipk_epoch_key), + }), + be_str_weak(get_ipk_epoch_key), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_mode +********************************************************************/ +be_local_closure(Matter_Session_get_mode, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(mode), + }), + be_str_weak(get_mode), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_fabric_compressed +********************************************************************/ +be_local_closure(Matter_Session_get_fabric_compressed, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(fabric_compressed), + }), + be_str_weak(get_fabric_compressed), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_mode +********************************************************************/ +be_local_closure(Matter_Session_set_mode, /* name */ + be_nested_proto( + 2, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(mode), + }), + be_str_weak(set_mode), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x80000000, // 0001 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_persist +********************************************************************/ +be_local_closure(Matter_Session_set_persist, /* name */ + be_nested_proto( + 4, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(_persist), + }), + be_str_weak(set_persist), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x60080017, // 0000 GETGBL R2 G23 + 0x5C0C0200, // 0001 MOVE R3 R1 + 0x7C080200, // 0002 CALL R2 1 + 0x90020002, // 0003 SETMBR R0 K0 R2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_ca_pub +********************************************************************/ +be_local_closure(Matter_Session_get_ca_pub, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(root_ca_certificate), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(TLV), + /* K3 */ be_nested_str_weak(parse), + /* K4 */ be_nested_str_weak(findsubval), + }), + be_str_weak(get_ca_pub), + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x78060008, // 0001 JMPF R1 #000B + 0xB8060200, // 0002 GETNGBL R1 K1 + 0x88040302, // 0003 GETMBR R1 R1 K2 + 0x8C040303, // 0004 GETMET R1 R1 K3 + 0x880C0100, // 0005 GETMBR R3 R0 K0 + 0x7C040400, // 0006 CALL R1 2 + 0x8C080304, // 0007 GETMET R2 R1 K4 + 0x54120008, // 0008 LDINT R4 9 + 0x7C080400, // 0009 CALL R2 2 + 0x80040400, // 000A RET 1 R2 + 0x80000000, // 000B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_icac +********************************************************************/ +be_local_closure(Matter_Session_get_icac, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(icac), + }), + be_str_weak(get_icac), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: close +********************************************************************/ +be_local_closure(Matter_Session_close, /* name */ + be_nested_proto( + 9, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[21]) { /* constants */ + /* K0 */ be_nested_str_weak(_persist), + /* K1 */ be_nested_str_weak(local_session_id), + /* K2 */ be_nested_str_weak(_future_local_session_id), + /* K3 */ be_nested_str_weak(initiator_session_id), + /* K4 */ be_nested_str_weak(_future_initiator_session_id), + /* K5 */ be_nested_str_weak(source_node_id), + /* K6 */ be_nested_str_weak(counter_rcv), + /* K7 */ be_nested_str_weak(reset), + /* K8 */ be_nested_str_weak(counter_snd), + /* K9 */ be_nested_str_weak(i2rkey), + /* K10 */ be_nested_str_weak(r2ikey), + /* K11 */ be_nested_str_weak(attestation_challenge), + /* K12 */ be_nested_str_weak(introspect), + /* K13 */ be_nested_str_weak(members), + /* K14 */ be_nested_str_weak(get), + /* K15 */ be_nested_str_weak(function), + /* K16 */ be_nested_str_weak(instance), + /* K17 */ be_const_int(0), + /* K18 */ be_nested_str_weak(_), + /* K19 */ be_const_int(1), + /* K20 */ be_nested_str_weak(stop_iteration), + }), + be_str_weak(close), + &be_const_str_solidified, + ( &(const binstruction[56]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x88080102, // 0001 GETMBR R2 R0 K2 + 0x90020202, // 0002 SETMBR R0 K1 R2 + 0x88080104, // 0003 GETMBR R2 R0 K4 + 0x90020602, // 0004 SETMBR R0 K3 R2 + 0x4C080000, // 0005 LDNIL R2 + 0x90020A02, // 0006 SETMBR R0 K5 R2 + 0x88080106, // 0007 GETMBR R2 R0 K6 + 0x8C080507, // 0008 GETMET R2 R2 K7 + 0x7C080200, // 0009 CALL R2 1 + 0x88080108, // 000A GETMBR R2 R0 K8 + 0x8C080507, // 000B GETMET R2 R2 K7 + 0x7C080200, // 000C CALL R2 1 + 0x4C080000, // 000D LDNIL R2 + 0x90021202, // 000E SETMBR R0 K9 R2 + 0x4C080000, // 000F LDNIL R2 + 0x90021402, // 0010 SETMBR R0 K10 R2 + 0x4C080000, // 0011 LDNIL R2 + 0x90021602, // 0012 SETMBR R0 K11 R2 + 0xA40A1800, // 0013 IMPORT R2 K12 + 0x600C0010, // 0014 GETGBL R3 G16 + 0x8C10050D, // 0015 GETMET R4 R2 K13 + 0x5C180000, // 0016 MOVE R6 R0 + 0x7C100400, // 0017 CALL R4 2 + 0x7C0C0200, // 0018 CALL R3 1 + 0xA8020018, // 0019 EXBLK 0 #0033 + 0x5C100600, // 001A MOVE R4 R3 + 0x7C100000, // 001B CALL R4 0 + 0x8C14050E, // 001C GETMET R5 R2 K14 + 0x5C1C0000, // 001D MOVE R7 R0 + 0x5C200800, // 001E MOVE R8 R4 + 0x7C140600, // 001F CALL R5 3 + 0x60180004, // 0020 GETGBL R6 G4 + 0x5C1C0A00, // 0021 MOVE R7 R5 + 0x7C180200, // 0022 CALL R6 1 + 0x20180D0F, // 0023 NE R6 R6 K15 + 0x781A000C, // 0024 JMPF R6 #0032 + 0x60180004, // 0025 GETGBL R6 G4 + 0x5C1C0A00, // 0026 MOVE R7 R5 + 0x7C180200, // 0027 CALL R6 1 + 0x20180D10, // 0028 NE R6 R6 K16 + 0x781A0007, // 0029 JMPF R6 #0032 + 0x94180911, // 002A GETIDX R6 R4 K17 + 0x1C180D12, // 002B EQ R6 R6 K18 + 0x781A0004, // 002C JMPF R6 #0032 + 0x94180913, // 002D GETIDX R6 R4 K19 + 0x20180D12, // 002E NE R6 R6 K18 + 0x781A0001, // 002F JMPF R6 #0032 + 0x4C180000, // 0030 LDNIL R6 + 0x90000806, // 0031 SETMBR R0 R4 R6 + 0x7001FFE6, // 0032 JMP #001A + 0x580C0014, // 0033 LDCONST R3 K20 + 0xAC0C0200, // 0034 CATCH R3 1 0 + 0xB0080000, // 0035 RAISE 2 R0 R0 + 0x90020001, // 0036 SETMBR R0 K0 R1 + 0x80000000, // 0037 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_Session_init, /* name */ + be_nested_proto( + 6, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[13]) { /* constants */ + /* K0 */ be_nested_str_weak(__store), + /* K1 */ be_nested_str_weak(mode), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(local_session_id), + /* K4 */ be_nested_str_weak(initiator_session_id), + /* K5 */ be_nested_str_weak(counter_rcv), + /* K6 */ be_nested_str_weak(matter), + /* K7 */ be_nested_str_weak(Counter), + /* K8 */ be_nested_str_weak(counter_snd), + /* K9 */ be_nested_str_weak(_counter_insecure_rcv), + /* K10 */ be_nested_str_weak(_counter_insecure_snd), + /* K11 */ be_nested_str_weak(breadcrumb), + /* K12 */ be_nested_str_weak(int64), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[24]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x90020302, // 0001 SETMBR R0 K1 K2 + 0x90020602, // 0002 SETMBR R0 K3 R2 + 0x90020803, // 0003 SETMBR R0 K4 R3 + 0xB8120C00, // 0004 GETNGBL R4 K6 + 0x8C100907, // 0005 GETMET R4 R4 K7 + 0x7C100200, // 0006 CALL R4 1 + 0x90020A04, // 0007 SETMBR R0 K5 R4 + 0xB8120C00, // 0008 GETNGBL R4 K6 + 0x8C100907, // 0009 GETMET R4 R4 K7 + 0x7C100200, // 000A CALL R4 1 + 0x90021004, // 000B SETMBR R0 K8 R4 + 0xB8120C00, // 000C GETNGBL R4 K6 + 0x8C100907, // 000D GETMET R4 R4 K7 + 0x7C100200, // 000E CALL R4 1 + 0x90021204, // 000F SETMBR R0 K9 R4 + 0xB8120C00, // 0010 GETNGBL R4 K6 + 0x8C100907, // 0011 GETMET R4 R4 K7 + 0x7C100200, // 0012 CALL R4 1 + 0x90021404, // 0013 SETMBR R0 K10 R4 + 0xB8121800, // 0014 GETNGBL R4 K12 + 0x7C100000, // 0015 CALL R4 0 + 0x90021604, // 0016 SETMBR R0 K11 R4 + 0x80000000, // 0017 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_ca +********************************************************************/ +be_local_closure(Matter_Session_get_ca, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(root_ca_certificate), + }), + be_str_weak(get_ca), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_deviceid +********************************************************************/ +be_local_closure(Matter_Session_get_deviceid, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(deviceid), + }), + be_str_weak(get_deviceid), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_i2r +********************************************************************/ +be_local_closure(Matter_Session_get_i2r, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(i2rkey), + }), + be_str_weak(get_i2r), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_Session +********************************************************************/ +be_local_class(Matter_Session, + 33, + NULL, + be_nested_map(67, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(root_ca_certificate, -1), be_const_var(18) }, + { be_const_key_weak(ipk_epoch_key, -1), be_const_var(21) }, + { be_const_key_weak(get_deviceid, -1), be_const_closure(Matter_Session_get_deviceid_closure) }, + { be_const_key_weak(get_ca, -1), be_const_closure(Matter_Session_get_ca_closure) }, + { be_const_key_weak(resumption_id, 11), be_const_var(22) }, + { be_const_key_weak(expiration, -1), be_const_var(32) }, + { be_const_key_weak(get_pk, 41), be_const_closure(Matter_Session_get_pk_closure) }, + { be_const_key_weak(_Msg2, -1), be_const_var(30) }, + { be_const_key_weak(init, -1), be_const_closure(Matter_Session_init_closure) }, + { be_const_key_weak(get_ac, 29), be_const_closure(Matter_Session_get_ac_closure) }, + { be_const_key_weak(get_ipk_group_key, -1), be_const_closure(Matter_Session_get_ipk_group_key_closure) }, + { be_const_key_weak(session_timestamp, -1), be_const_var(4) }, + { be_const_key_weak(close, -1), be_const_closure(Matter_Session_close_closure) }, + { be_const_key_weak(save, 47), be_const_closure(Matter_Session_save_closure) }, + { be_const_key_weak(_persist, 61), be_const_var(31) }, + { be_const_key_weak(no_private_key, -1), be_const_var(17) }, + { be_const_key_weak(__CASE, -1), be_const_int(2) }, + { be_const_key_weak(_future_initiator_session_id, -1), be_const_var(6) }, + { be_const_key_weak(set_expire_time, -1), be_const_closure(Matter_Session_set_expire_time_closure) }, + { be_const_key_weak(set_ipk_epoch_key, 64), be_const_closure(Matter_Session_set_ipk_epoch_key_closure) }, + { be_const_key_weak(tojson, -1), be_const_closure(Matter_Session_tojson_closure) }, + { be_const_key_weak(mode, -1), be_const_var(1) }, + { be_const_key_weak(_Msg1, 28), be_const_var(29) }, + { be_const_key_weak(__store, 15), be_const_var(0) }, + { be_const_key_weak(fabric, -1), be_const_var(24) }, + { be_const_key_weak(get_noc, 54), be_const_closure(Matter_Session_get_noc_closure) }, + { be_const_key_weak(get_icac, -1), be_const_closure(Matter_Session_get_icac_closure) }, + { be_const_key_weak(has_expired, 12), be_const_closure(Matter_Session_has_expired_closure) }, + { be_const_key_weak(get_ca_pub, -1), be_const_closure(Matter_Session_get_ca_pub_closure) }, + { be_const_key_weak(__PASE, -1), be_const_int(1) }, + { be_const_key_weak(initiator_session_id, -1), be_const_var(3) }, + { be_const_key_weak(breadcrumb, -1), be_const_var(16) }, + { be_const_key_weak(_counter_insecure_snd, -1), be_const_var(11) }, + { be_const_key_weak(peer_node_id, -1), be_const_var(15) }, + { be_const_key_weak(set_persist, -1), be_const_closure(Matter_Session_set_persist_closure) }, + { be_const_key_weak(source_node_id, -1), be_const_var(5) }, + { be_const_key_weak(gen_CSR, -1), be_const_closure(Matter_Session_gen_CSR_closure) }, + { be_const_key_weak(get_r2i, -1), be_const_closure(Matter_Session_get_r2i_closure) }, + { be_const_key_weak(noc, -1), be_const_var(19) }, + { be_const_key_weak(counter_snd, 53), be_const_var(9) }, + { be_const_key_weak(_counter_insecure_rcv, -1), be_const_var(10) }, + { be_const_key_weak(set_mode, 60), be_const_closure(Matter_Session_set_mode_closure) }, + { be_const_key_weak(set_noc, -1), be_const_closure(Matter_Session_set_noc_closure) }, + { be_const_key_weak(set_ca, 57), be_const_closure(Matter_Session_set_ca_closure) }, + { be_const_key_weak(__GROUP_KEY, 3), be_nested_str_weak(GroupKey_X20v1_X2E0) }, + { be_const_key_weak(icac, 56), be_const_var(20) }, + { be_const_key_weak(get_ipk_epoch_key, -1), be_const_closure(Matter_Session_get_ipk_epoch_key_closure) }, + { be_const_key_weak(local_session_id, -1), be_const_var(2) }, + { be_const_key_weak(counter_rcv, -1), be_const_var(8) }, + { be_const_key_weak(r2ikey, -1), be_const_var(13) }, + { be_const_key_weak(shared_secret, -1), be_const_var(23) }, + { be_const_key_weak(deviceid, 49), be_const_var(26) }, + { be_const_key_weak(get_fabric_compressed, -1), be_const_closure(Matter_Session_get_fabric_compressed_closure) }, + { be_const_key_weak(set_keys, -1), be_const_closure(Matter_Session_set_keys_closure) }, + { be_const_key_weak(admin_subject, -1), be_const_var(27) }, + { be_const_key_weak(get_fabric, 34), be_const_closure(Matter_Session_get_fabric_closure) }, + { be_const_key_weak(attestation_challenge, 0), be_const_var(14) }, + { be_const_key_weak(set_fabric_device, -1), be_const_closure(Matter_Session_set_fabric_device_closure) }, + { be_const_key_weak(fabric_compressed, 26), be_const_var(25) }, + { be_const_key_weak(get_mode, 21), be_const_closure(Matter_Session_get_mode_closure) }, + { be_const_key_weak(set_no_expiration, -1), be_const_closure(Matter_Session_set_no_expiration_closure) }, + { be_const_key_weak(fromjson, -1), be_const_static_closure(Matter_Session_fromjson_closure) }, + { be_const_key_weak(admin_vendor, -1), be_const_var(28) }, + { be_const_key_weak(_future_local_session_id, 8), be_const_var(7) }, + { be_const_key_weak(set_expire_in_seconds, -1), be_const_closure(Matter_Session_set_expire_in_seconds_closure) }, + { be_const_key_weak(i2rkey, 2), be_const_var(12) }, + { be_const_key_weak(get_i2r, -1), be_const_closure(Matter_Session_get_i2r_closure) }, + })), + be_str_weak(Matter_Session) +); +/*******************************************************************/ + +void be_load_Matter_Session_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_Session); + be_setglobal(vm, "Matter_Session"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_Session_Store; + +/******************************************************************** +** Solidified function: every_second +********************************************************************/ +be_local_closure(Matter_Session_Store_every_second, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(remove_expired), + }), + be_str_weak(every_second), + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x7C040200, // 0001 CALL R1 1 + 0x80000000, // 0002 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_redundant_session +********************************************************************/ +be_local_closure(Matter_Session_Store_remove_redundant_session, /* name */ + be_nested_proto( + 8, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str_weak(sessions), + /* K2 */ be_nested_str_weak(fabric), + /* K3 */ be_nested_str_weak(deviceid), + /* K4 */ be_nested_str_weak(remove), + /* K5 */ be_const_int(1), + }), + be_str_weak(remove_redundant_session), + &be_const_str_solidified, + ( &(const binstruction[25]) { /* code */ + 0x58080000, // 0000 LDCONST R2 K0 + 0x880C0101, // 0001 GETMBR R3 R0 K1 + 0x6010000C, // 0002 GETGBL R4 G12 + 0x88140101, // 0003 GETMBR R5 R0 K1 + 0x7C100200, // 0004 CALL R4 1 + 0x14100404, // 0005 LT R4 R2 R4 + 0x78120010, // 0006 JMPF R4 #0018 + 0x94100602, // 0007 GETIDX R4 R3 R2 + 0x20140801, // 0008 NE R5 R4 R1 + 0x7816000B, // 0009 JMPF R5 #0016 + 0x88140902, // 000A GETMBR R5 R4 K2 + 0x88180302, // 000B GETMBR R6 R1 K2 + 0x1C140A06, // 000C EQ R5 R5 R6 + 0x78160007, // 000D JMPF R5 #0016 + 0x88140903, // 000E GETMBR R5 R4 K3 + 0x88180303, // 000F GETMBR R6 R1 K3 + 0x1C140A06, // 0010 EQ R5 R5 R6 + 0x78160003, // 0011 JMPF R5 #0016 + 0x8C140704, // 0012 GETMET R5 R3 K4 + 0x5C1C0400, // 0013 MOVE R7 R2 + 0x7C140400, // 0014 CALL R5 2 + 0x70020000, // 0015 JMP #0017 + 0x00080505, // 0016 ADD R2 R2 K5 + 0x7001FFE9, // 0017 JMP #0002 + 0x80000000, // 0018 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_session_by_source_node_id +********************************************************************/ +be_local_closure(Matter_Session_Store_get_session_by_source_node_id, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(sessions), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str_weak(source_node_id), + /* K3 */ be_const_int(1), + }), + be_str_weak(get_session_by_source_node_id), + &be_const_str_solidified, + ( &(const binstruction[21]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0x6008000C, // 0005 GETGBL R2 G12 + 0x880C0100, // 0006 GETMBR R3 R0 K0 + 0x7C080200, // 0007 CALL R2 1 + 0x580C0001, // 0008 LDCONST R3 K1 + 0x88100100, // 0009 GETMBR R4 R0 K0 + 0x14140602, // 000A LT R5 R3 R2 + 0x78160007, // 000B JMPF R5 #0014 + 0x94140803, // 000C GETIDX R5 R4 R3 + 0x88140B02, // 000D GETMBR R5 R5 K2 + 0x1C140A01, // 000E EQ R5 R5 R1 + 0x78160001, // 000F JMPF R5 #0012 + 0x94140803, // 0010 GETIDX R5 R4 R3 + 0x80040A00, // 0011 RET 1 R5 + 0x000C0703, // 0012 ADD R3 R3 K3 + 0x7001FFF5, // 0013 JMP #000A + 0x80000000, // 0014 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_expired +********************************************************************/ +be_local_closure(Matter_Session_Store_remove_expired, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str_weak(sessions), + /* K2 */ be_nested_str_weak(has_expired), + /* K3 */ be_nested_str_weak(_persist), + /* K4 */ be_nested_str_weak(remove), + /* K5 */ be_const_int(1), + /* K6 */ be_nested_str_weak(save), + }), + be_str_weak(remove_expired), + &be_const_str_solidified, + ( &(const binstruction[26]) { /* code */ + 0x50040000, // 0000 LDBOOL R1 0 0 + 0x58080000, // 0001 LDCONST R2 K0 + 0x880C0101, // 0002 GETMBR R3 R0 K1 + 0x6010000C, // 0003 GETGBL R4 G12 + 0x88140101, // 0004 GETMBR R5 R0 K1 + 0x7C100200, // 0005 CALL R4 1 + 0x14100404, // 0006 LT R4 R2 R4 + 0x7812000D, // 0007 JMPF R4 #0016 + 0x94100602, // 0008 GETIDX R4 R3 R2 + 0x8C100902, // 0009 GETMET R4 R4 K2 + 0x7C100200, // 000A CALL R4 1 + 0x78120007, // 000B JMPF R4 #0014 + 0x94100602, // 000C GETIDX R4 R3 R2 + 0x88100903, // 000D GETMBR R4 R4 K3 + 0x78120000, // 000E JMPF R4 #0010 + 0x50040200, // 000F LDBOOL R1 1 0 + 0x8C100704, // 0010 GETMET R4 R3 K4 + 0x5C180400, // 0011 MOVE R6 R2 + 0x7C100400, // 0012 CALL R4 2 + 0x70020000, // 0013 JMP #0015 + 0x00080505, // 0014 ADD R2 R2 K5 + 0x7001FFEC, // 0015 JMP #0003 + 0x78060001, // 0016 JMPF R1 #0019 + 0x8C100106, // 0017 GETMET R4 R0 K6 + 0x7C100200, // 0018 CALL R4 1 + 0x80000000, // 0019 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: load +********************************************************************/ +be_local_closure(Matter_Session_Store_load, /* name */ + be_nested_proto( + 13, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[22]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(sessions), + /* K2 */ be_nested_str_weak(FILENAME), + /* K3 */ be_nested_str_weak(read), + /* K4 */ be_nested_str_weak(close), + /* K5 */ be_nested_str_weak(json), + /* K6 */ be_nested_str_weak(load), + /* K7 */ be_nested_str_weak(tasmota), + /* K8 */ be_nested_str_weak(gc), + /* K9 */ be_nested_str_weak(matter), + /* K10 */ be_nested_str_weak(Session), + /* K11 */ be_nested_str_weak(fromjson), + /* K12 */ be_nested_str_weak(add_session), + /* K13 */ be_nested_str_weak(stop_iteration), + /* K14 */ be_nested_str_weak(log), + /* K15 */ be_nested_str_weak(format), + /* K16 */ be_nested_str_weak(MTR_X3A_X20Loaded_X20_X25i_X20session_X28s_X29), + /* K17 */ be_const_int(2), + /* K18 */ be_nested_str_weak(io_error), + /* K19 */ be_nested_str_weak(MTR_X3A_X20Session_Store_X3A_X3Aload_X20Exception_X3A), + /* K20 */ be_nested_str_weak(_X7C), + /* K21 */ be_nested_str_weak(remove_expired), + }), + be_str_weak(load), + &be_const_str_solidified, + ( &(const binstruction[76]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA8020033, // 0001 EXBLK 0 #0036 + 0x60080012, // 0002 GETGBL R2 G18 + 0x7C080000, // 0003 CALL R2 0 + 0x90020202, // 0004 SETMBR R0 K1 R2 + 0x60080011, // 0005 GETGBL R2 G17 + 0x880C0102, // 0006 GETMBR R3 R0 K2 + 0x7C080200, // 0007 CALL R2 1 + 0x8C0C0503, // 0008 GETMET R3 R2 K3 + 0x7C0C0200, // 0009 CALL R3 1 + 0x8C100504, // 000A GETMET R4 R2 K4 + 0x7C100200, // 000B CALL R4 1 + 0xA4120A00, // 000C IMPORT R4 K5 + 0x8C140906, // 000D GETMET R5 R4 K6 + 0x5C1C0600, // 000E MOVE R7 R3 + 0x7C140400, // 000F CALL R5 2 + 0x4C0C0000, // 0010 LDNIL R3 + 0xB81A0E00, // 0011 GETNGBL R6 K7 + 0x8C180D08, // 0012 GETMET R6 R6 K8 + 0x7C180200, // 0013 CALL R6 1 + 0x60180010, // 0014 GETGBL R6 G16 + 0x5C1C0A00, // 0015 MOVE R7 R5 + 0x7C180200, // 0016 CALL R6 1 + 0xA802000E, // 0017 EXBLK 0 #0027 + 0x5C1C0C00, // 0018 MOVE R7 R6 + 0x7C1C0000, // 0019 CALL R7 0 + 0xB8221200, // 001A GETNGBL R8 K9 + 0x8820110A, // 001B GETMBR R8 R8 K10 + 0x8C20110B, // 001C GETMET R8 R8 K11 + 0x5C280000, // 001D MOVE R10 R0 + 0x5C2C0E00, // 001E MOVE R11 R7 + 0x7C200600, // 001F CALL R8 3 + 0x4C240000, // 0020 LDNIL R9 + 0x20241009, // 0021 NE R9 R8 R9 + 0x78260002, // 0022 JMPF R9 #0026 + 0x8C24010C, // 0023 GETMET R9 R0 K12 + 0x5C2C1000, // 0024 MOVE R11 R8 + 0x7C240400, // 0025 CALL R9 2 + 0x7001FFF0, // 0026 JMP #0018 + 0x5818000D, // 0027 LDCONST R6 K13 + 0xAC180200, // 0028 CATCH R6 1 0 + 0xB0080000, // 0029 RAISE 2 R0 R0 + 0xB81A0E00, // 002A GETNGBL R6 K7 + 0x8C180D0E, // 002B GETMET R6 R6 K14 + 0x8C20030F, // 002C GETMET R8 R1 K15 + 0x58280010, // 002D LDCONST R10 K16 + 0x602C000C, // 002E GETGBL R11 G12 + 0x88300101, // 002F GETMBR R12 R0 K1 + 0x7C2C0200, // 0030 CALL R11 1 + 0x7C200600, // 0031 CALL R8 3 + 0x58240011, // 0032 LDCONST R9 K17 + 0x7C180600, // 0033 CALL R6 3 + 0xA8040001, // 0034 EXBLK 1 1 + 0x70020012, // 0035 JMP #0049 + 0xAC080002, // 0036 CATCH R2 0 2 + 0x7002000F, // 0037 JMP #0048 + 0x20100512, // 0038 NE R4 R2 K18 + 0x7812000C, // 0039 JMPF R4 #0047 + 0xB8120E00, // 003A GETNGBL R4 K7 + 0x8C10090E, // 003B GETMET R4 R4 K14 + 0x60180008, // 003C GETGBL R6 G8 + 0x5C1C0400, // 003D MOVE R7 R2 + 0x7C180200, // 003E CALL R6 1 + 0x001A2606, // 003F ADD R6 K19 R6 + 0x00180D14, // 0040 ADD R6 R6 K20 + 0x601C0008, // 0041 GETGBL R7 G8 + 0x5C200600, // 0042 MOVE R8 R3 + 0x7C1C0200, // 0043 CALL R7 1 + 0x00180C07, // 0044 ADD R6 R6 R7 + 0x581C0011, // 0045 LDCONST R7 K17 + 0x7C100600, // 0046 CALL R4 3 + 0x70020000, // 0047 JMP #0049 + 0xB0080000, // 0048 RAISE 2 R0 R0 + 0x8C080115, // 0049 GETMET R2 R0 K21 + 0x7C080200, // 004A CALL R2 1 + 0x80000000, // 004B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_Session_Store_init, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(sessions), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x60040012, // 0000 GETGBL R1 G18 + 0x7C040000, // 0001 CALL R1 0 + 0x90020001, // 0002 SETMBR R0 K0 R1 + 0x80000000, // 0003 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_session +********************************************************************/ +be_local_closure(Matter_Session_Store_remove_session, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str_weak(sessions), + /* K2 */ be_nested_str_weak(remove), + /* K3 */ be_const_int(1), + }), + be_str_weak(remove_session), + &be_const_str_solidified, + ( &(const binstruction[17]) { /* code */ + 0x58080000, // 0000 LDCONST R2 K0 + 0x880C0101, // 0001 GETMBR R3 R0 K1 + 0x6010000C, // 0002 GETGBL R4 G12 + 0x88140101, // 0003 GETMBR R5 R0 K1 + 0x7C100200, // 0004 CALL R4 1 + 0x14100404, // 0005 LT R4 R2 R4 + 0x78120008, // 0006 JMPF R4 #0010 + 0x94100602, // 0007 GETIDX R4 R3 R2 + 0x1C100801, // 0008 EQ R4 R4 R1 + 0x78120003, // 0009 JMPF R4 #000E + 0x8C100702, // 000A GETMET R4 R3 K2 + 0x5C180400, // 000B MOVE R6 R2 + 0x7C100400, // 000C CALL R4 2 + 0x70020000, // 000D JMP #000F + 0x00080503, // 000E ADD R2 R2 K3 + 0x7001FFF1, // 000F JMP #0002 + 0x80000000, // 0010 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_session +********************************************************************/ +be_local_closure(Matter_Session_Store_add_session, /* name */ + be_nested_proto( + 6, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(set_expire_in_seconds), + /* K1 */ be_nested_str_weak(sessions), + /* K2 */ be_nested_str_weak(push), + }), + be_str_weak(add_session), + &be_const_str_solidified, + ( &(const binstruction[11]) { /* code */ + 0x4C0C0000, // 0000 LDNIL R3 + 0x200C0403, // 0001 NE R3 R2 R3 + 0x780E0002, // 0002 JMPF R3 #0006 + 0x8C0C0300, // 0003 GETMET R3 R1 K0 + 0x5C140400, // 0004 MOVE R5 R2 + 0x7C0C0400, // 0005 CALL R3 2 + 0x880C0101, // 0006 GETMBR R3 R0 K1 + 0x8C0C0702, // 0007 GETMET R3 R3 K2 + 0x5C140200, // 0008 MOVE R5 R1 + 0x7C0C0400, // 0009 CALL R3 2 + 0x80000000, // 000A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_session_by_local_session_id +********************************************************************/ +be_local_closure(Matter_Session_Store_get_session_by_local_session_id, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(sessions), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str_weak(local_session_id), + /* K3 */ be_const_int(1), + }), + be_str_weak(get_session_by_local_session_id), + &be_const_str_solidified, + ( &(const binstruction[21]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0001, // 0002 JMPF R2 #0005 + 0x4C080000, // 0003 LDNIL R2 + 0x80040400, // 0004 RET 1 R2 + 0x6008000C, // 0005 GETGBL R2 G12 + 0x880C0100, // 0006 GETMBR R3 R0 K0 + 0x7C080200, // 0007 CALL R2 1 + 0x580C0001, // 0008 LDCONST R3 K1 + 0x88100100, // 0009 GETMBR R4 R0 K0 + 0x14140602, // 000A LT R5 R3 R2 + 0x78160007, // 000B JMPF R5 #0014 + 0x94140803, // 000C GETIDX R5 R4 R3 + 0x88140B02, // 000D GETMBR R5 R5 K2 + 0x1C140A01, // 000E EQ R5 R5 R1 + 0x78160001, // 000F JMPF R5 #0012 + 0x94140803, // 0010 GETIDX R5 R4 R3 + 0x80040A00, // 0011 RET 1 R5 + 0x000C0703, // 0012 ADD R3 R3 K3 + 0x7001FFF5, // 0013 JMP #000A + 0x80000000, // 0014 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: find_session_source_id_unsecure +********************************************************************/ +be_local_closure(Matter_Session_Store_find_session_source_id_unsecure, /* name */ + be_nested_proto( + 9, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(get_session_by_source_node_id), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(Session), + /* K3 */ be_const_int(0), + /* K4 */ be_nested_str_weak(source_node_id), + /* K5 */ be_nested_str_weak(sessions), + /* K6 */ be_nested_str_weak(push), + /* K7 */ be_nested_str_weak(set_expire_in_seconds), + }), + be_str_weak(find_session_source_id_unsecure), + &be_const_str_solidified, + ( &(const binstruction[22]) { /* code */ + 0x8C0C0100, // 0000 GETMET R3 R0 K0 + 0x5C140200, // 0001 MOVE R5 R1 + 0x7C0C0400, // 0002 CALL R3 2 + 0x4C100000, // 0003 LDNIL R4 + 0x1C100604, // 0004 EQ R4 R3 R4 + 0x7812000B, // 0005 JMPF R4 #0012 + 0xB8120200, // 0006 GETNGBL R4 K1 + 0x8C100902, // 0007 GETMET R4 R4 K2 + 0x5C180000, // 0008 MOVE R6 R0 + 0x581C0003, // 0009 LDCONST R7 K3 + 0x58200003, // 000A LDCONST R8 K3 + 0x7C100800, // 000B CALL R4 4 + 0x5C0C0800, // 000C MOVE R3 R4 + 0x900E0801, // 000D SETMBR R3 K4 R1 + 0x88100105, // 000E GETMBR R4 R0 K5 + 0x8C100906, // 000F GETMET R4 R4 K6 + 0x5C180600, // 0010 MOVE R6 R3 + 0x7C100400, // 0011 CALL R4 2 + 0x8C100707, // 0012 GETMET R4 R3 K7 + 0x5C180400, // 0013 MOVE R6 R2 + 0x7C100400, // 0014 CALL R4 2 + 0x80040600, // 0015 RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: save +********************************************************************/ +be_local_closure(Matter_Session_Store_save, /* name */ + be_nested_proto( + 12, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[23]) { /* constants */ + /* K0 */ be_nested_str_weak(json), + /* K1 */ be_nested_str_weak(remove_expired), + /* K2 */ be_nested_str_weak(sessions), + /* K3 */ be_nested_str_weak(_persist), + /* K4 */ be_nested_str_weak(push), + /* K5 */ be_nested_str_weak(tojson), + /* K6 */ be_nested_str_weak(stop_iteration), + /* K7 */ be_nested_str_weak(_X5B), + /* K8 */ be_nested_str_weak(concat), + /* K9 */ be_nested_str_weak(_X2C), + /* K10 */ be_nested_str_weak(_X5D), + /* K11 */ be_nested_str_weak(string), + /* K12 */ be_nested_str_weak(FILENAME), + /* K13 */ be_nested_str_weak(w), + /* K14 */ be_nested_str_weak(write), + /* K15 */ be_nested_str_weak(close), + /* K16 */ be_nested_str_weak(tasmota), + /* K17 */ be_nested_str_weak(log), + /* K18 */ be_nested_str_weak(format), + /* K19 */ be_nested_str_weak(MTR_X3A_X20Saved_X20_X25i_X20session_X28s_X29), + /* K20 */ be_const_int(2), + /* K21 */ be_nested_str_weak(MTR_X3A_X20Session_Store_X3A_X3Asave_X20Exception_X3A), + /* K22 */ be_nested_str_weak(_X7C), + }), + be_str_weak(save), + &be_const_str_solidified, + ( &(const binstruction[72]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080101, // 0001 GETMET R2 R0 K1 + 0x7C080200, // 0002 CALL R2 1 + 0x60080012, // 0003 GETGBL R2 G18 + 0x7C080000, // 0004 CALL R2 0 + 0x600C0010, // 0005 GETGBL R3 G16 + 0x88100102, // 0006 GETMBR R4 R0 K2 + 0x7C0C0200, // 0007 CALL R3 1 + 0xA8020008, // 0008 EXBLK 0 #0012 + 0x5C100600, // 0009 MOVE R4 R3 + 0x7C100000, // 000A CALL R4 0 + 0x88140903, // 000B GETMBR R5 R4 K3 + 0x78160003, // 000C JMPF R5 #0011 + 0x8C140504, // 000D GETMET R5 R2 K4 + 0x8C1C0905, // 000E GETMET R7 R4 K5 + 0x7C1C0200, // 000F CALL R7 1 + 0x7C140400, // 0010 CALL R5 2 + 0x7001FFF6, // 0011 JMP #0009 + 0x580C0006, // 0012 LDCONST R3 K6 + 0xAC0C0200, // 0013 CATCH R3 1 0 + 0xB0080000, // 0014 RAISE 2 R0 R0 + 0x600C000C, // 0015 GETGBL R3 G12 + 0x5C100400, // 0016 MOVE R4 R2 + 0x7C0C0200, // 0017 CALL R3 1 + 0x8C100508, // 0018 GETMET R4 R2 K8 + 0x58180009, // 0019 LDCONST R6 K9 + 0x7C100400, // 001A CALL R4 2 + 0x00120E04, // 001B ADD R4 K7 R4 + 0x0010090A, // 001C ADD R4 R4 K10 + 0x5C080800, // 001D MOVE R2 R4 + 0xA8020015, // 001E EXBLK 0 #0035 + 0xA4121600, // 001F IMPORT R4 K11 + 0x60140011, // 0020 GETGBL R5 G17 + 0x8818010C, // 0021 GETMBR R6 R0 K12 + 0x581C000D, // 0022 LDCONST R7 K13 + 0x7C140400, // 0023 CALL R5 2 + 0x8C180B0E, // 0024 GETMET R6 R5 K14 + 0x5C200400, // 0025 MOVE R8 R2 + 0x7C180400, // 0026 CALL R6 2 + 0x8C180B0F, // 0027 GETMET R6 R5 K15 + 0x7C180200, // 0028 CALL R6 1 + 0xB81A2000, // 0029 GETNGBL R6 K16 + 0x8C180D11, // 002A GETMET R6 R6 K17 + 0x8C200912, // 002B GETMET R8 R4 K18 + 0x58280013, // 002C LDCONST R10 K19 + 0x5C2C0600, // 002D MOVE R11 R3 + 0x7C200600, // 002E CALL R8 3 + 0x58240014, // 002F LDCONST R9 K20 + 0x7C180600, // 0030 CALL R6 3 + 0xA8040001, // 0031 EXBLK 1 1 + 0x80040400, // 0032 RET 1 R2 + 0xA8040001, // 0033 EXBLK 1 1 + 0x70020011, // 0034 JMP #0047 + 0xAC100002, // 0035 CATCH R4 0 2 + 0x7002000E, // 0036 JMP #0046 + 0xB81A2000, // 0037 GETNGBL R6 K16 + 0x8C180D11, // 0038 GETMET R6 R6 K17 + 0x60200008, // 0039 GETGBL R8 G8 + 0x5C240800, // 003A MOVE R9 R4 + 0x7C200200, // 003B CALL R8 1 + 0x00222A08, // 003C ADD R8 K21 R8 + 0x00201116, // 003D ADD R8 R8 K22 + 0x60240008, // 003E GETGBL R9 G8 + 0x5C280A00, // 003F MOVE R10 R5 + 0x7C240200, // 0040 CALL R9 1 + 0x00201009, // 0041 ADD R8 R8 R9 + 0x58240014, // 0042 LDCONST R9 K20 + 0x7C180600, // 0043 CALL R6 3 + 0x80040400, // 0044 RET 1 R2 + 0x70020000, // 0045 JMP #0047 + 0xB0080000, // 0046 RAISE 2 R0 R0 + 0x80000000, // 0047 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: gen_local_session_id +********************************************************************/ +be_local_closure(Matter_Session_Store_gen_local_session_id, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str_weak(crypto), + /* K1 */ be_nested_str_weak(random), + /* K2 */ be_const_int(2), + /* K3 */ be_nested_str_weak(get), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(get_session_by_local_session_id), + }), + be_str_weak(gen_local_session_id), + &be_const_str_solidified, + ( &(const binstruction[19]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x50080200, // 0001 LDBOOL R2 1 0 + 0x780A000E, // 0002 JMPF R2 #0012 + 0x8C080301, // 0003 GETMET R2 R1 K1 + 0x58100002, // 0004 LDCONST R4 K2 + 0x7C080400, // 0005 CALL R2 2 + 0x8C080503, // 0006 GETMET R2 R2 K3 + 0x58100004, // 0007 LDCONST R4 K4 + 0x58140002, // 0008 LDCONST R5 K2 + 0x7C080600, // 0009 CALL R2 3 + 0x8C0C0105, // 000A GETMET R3 R0 K5 + 0x5C140400, // 000B MOVE R5 R2 + 0x7C0C0400, // 000C CALL R3 2 + 0x4C100000, // 000D LDNIL R4 + 0x1C0C0604, // 000E EQ R3 R3 R4 + 0x780E0000, // 000F JMPF R3 #0011 + 0x80040400, // 0010 RET 1 R2 + 0x7001FFEE, // 0011 JMP #0001 + 0x80000000, // 0012 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: create_session +********************************************************************/ +be_local_closure(Matter_Session_Store_create_session, /* name */ + be_nested_proto( + 9, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str_weak(get_session_by_local_session_id), + /* K1 */ be_nested_str_weak(remove_session), + /* K2 */ be_nested_str_weak(matter), + /* K3 */ be_nested_str_weak(Session), + /* K4 */ be_nested_str_weak(sessions), + /* K5 */ be_nested_str_weak(push), + }), + be_str_weak(create_session), + &be_const_str_solidified, + ( &(const binstruction[21]) { /* code */ + 0x8C0C0100, // 0000 GETMET R3 R0 K0 + 0x5C140200, // 0001 MOVE R5 R1 + 0x7C0C0400, // 0002 CALL R3 2 + 0x4C100000, // 0003 LDNIL R4 + 0x20100604, // 0004 NE R4 R3 R4 + 0x78120002, // 0005 JMPF R4 #0009 + 0x8C100101, // 0006 GETMET R4 R0 K1 + 0x5C180600, // 0007 MOVE R6 R3 + 0x7C100400, // 0008 CALL R4 2 + 0xB8120400, // 0009 GETNGBL R4 K2 + 0x8C100903, // 000A GETMET R4 R4 K3 + 0x5C180000, // 000B MOVE R6 R0 + 0x5C1C0200, // 000C MOVE R7 R1 + 0x5C200400, // 000D MOVE R8 R2 + 0x7C100800, // 000E CALL R4 4 + 0x5C0C0800, // 000F MOVE R3 R4 + 0x88100104, // 0010 GETMBR R4 R0 K4 + 0x8C100905, // 0011 GETMET R4 R4 K5 + 0x5C180600, // 0012 MOVE R6 R3 + 0x7C100400, // 0013 CALL R4 2 + 0x80040600, // 0014 RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_Session_Store +********************************************************************/ +be_local_class(Matter_Session_Store, + 1, + NULL, + be_nested_map(15, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(every_second, 14), be_const_closure(Matter_Session_Store_every_second_closure) }, + { be_const_key_weak(remove_redundant_session, 9), be_const_closure(Matter_Session_Store_remove_redundant_session_closure) }, + { be_const_key_weak(get_session_by_source_node_id, 5), be_const_closure(Matter_Session_Store_get_session_by_source_node_id_closure) }, + { be_const_key_weak(remove_expired, -1), be_const_closure(Matter_Session_Store_remove_expired_closure) }, + { be_const_key_weak(load, -1), be_const_closure(Matter_Session_Store_load_closure) }, + { be_const_key_weak(FILENAME, 11), be_nested_str_weak(_matter_sessions_X2Ejson) }, + { be_const_key_weak(remove_session, -1), be_const_closure(Matter_Session_Store_remove_session_closure) }, + { be_const_key_weak(add_session, -1), be_const_closure(Matter_Session_Store_add_session_closure) }, + { be_const_key_weak(get_session_by_local_session_id, -1), be_const_closure(Matter_Session_Store_get_session_by_local_session_id_closure) }, + { be_const_key_weak(find_session_source_id_unsecure, -1), be_const_closure(Matter_Session_Store_find_session_source_id_unsecure_closure) }, + { be_const_key_weak(create_session, -1), be_const_closure(Matter_Session_Store_create_session_closure) }, + { be_const_key_weak(gen_local_session_id, -1), be_const_closure(Matter_Session_Store_gen_local_session_id_closure) }, + { be_const_key_weak(save, 10), be_const_closure(Matter_Session_Store_save_closure) }, + { be_const_key_weak(sessions, -1), be_const_var(0) }, + { be_const_key_weak(init, -1), be_const_closure(Matter_Session_Store_init_closure) }, + })), + be_str_weak(Matter_Session_Store) +); +/*******************************************************************/ + +void be_load_Matter_Session_Store_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_Session_Store); + be_setglobal(vm, "Matter_Session_Store"); + be_pop(vm, 1); +} +/********************************************************************/ +/* 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 new file mode 100644 index 000000000..f27d81def --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_TLV.h @@ -0,0 +1,2909 @@ +/* Solidification of Matter_TLV.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_TLV_item; + +/******************************************************************** +** Solidified function: set_commonprofile +********************************************************************/ +be_local_closure(Matter_TLV_item_set_commonprofile, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(set_fulltag), + }), + be_str_weak(set_commonprofile), + &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 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: encode +********************************************************************/ +be_local_closure(Matter_TLV_item_encode, /* name */ + be_nested_proto( + 9, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[39]) { /* constants */ + /* K0 */ be_nested_str_weak(TLV), + /* K1 */ be_nested_str_weak(typ), + /* K2 */ be_nested_str_weak(BFALSE), + /* K3 */ be_nested_str_weak(BTRUE), + /* K4 */ be_nested_str_weak(val), + /* K5 */ be_nested_str_weak(I2), + /* K6 */ be_nested_str_weak(I4), + /* K7 */ be_nested_str_weak(I1), + /* K8 */ be_nested_str_weak(U2), + /* K9 */ be_nested_str_weak(U4), + /* K10 */ be_const_int(0), + /* K11 */ be_nested_str_weak(U1), + /* K12 */ be_nested_str_weak(B1), + /* K13 */ be_nested_str_weak(B8), + /* K14 */ be_nested_str_weak(B2), + /* K15 */ be_nested_str_weak(B4), + /* K16 */ be_nested_str_weak(UTF1), + /* K17 */ be_nested_str_weak(UTF8), + /* K18 */ be_nested_str_weak(UTF2), + /* K19 */ be_nested_str_weak(UTF4), + /* K20 */ be_nested_str_weak(_encode_tag), + /* K21 */ be_nested_str_weak(add), + /* 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(int64), + /* K27 */ be_nested_str_weak(tobytes), + /* K28 */ be_nested_str_weak(FLOAT), + /* K29 */ be_nested_str_weak(setfloat), + /* K30 */ be_nested_str_weak(DOUBLE), + /* K31 */ be_nested_str_weak(value_error), + /* K32 */ be_nested_str_weak(Unsupported_X20type_X20TLV_X2EDOUBLE), + /* K33 */ be_nested_str_weak(string_X20too_X20big), + /* K34 */ be_nested_str_weak(fromstring), + /* K35 */ be_nested_str_weak(frostring), + /* K36 */ be_nested_str_weak(bytes_X20too_X20big), + /* K37 */ be_nested_str_weak(NULL), + /* K38 */ be_nested_str_weak(unsupported_X20type_X20), + }), + be_str_weak(encode), + &be_const_str_solidified, + ( &(const binstruction[345]) { /* 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 + 0x740E0003, // 000A JMPT R3 #000F + 0x880C0101, // 000B GETMBR R3 R0 K1 + 0x88100503, // 000C GETMBR R4 R2 K3 + 0x1C0C0604, // 000D EQ R3 R3 R4 + 0x780E0008, // 000E JMPF R3 #0018 + 0x600C0017, // 000F GETGBL R3 G23 + 0x88100104, // 0010 GETMBR R4 R0 K4 + 0x7C0C0200, // 0011 CALL R3 1 + 0x780E0001, // 0012 JMPF R3 #0015 + 0x880C0503, // 0013 GETMBR R3 R2 K3 + 0x70020000, // 0014 JMP #0016 + 0x880C0502, // 0015 GETMBR R3 R2 K2 + 0x90020203, // 0016 SETMBR R0 K1 R3 + 0x70020070, // 0017 JMP #0089 + 0x880C0101, // 0018 GETMBR R3 R0 K1 + 0x88100505, // 0019 GETMBR R4 R2 K5 + 0x280C0604, // 001A GE R3 R3 R4 + 0x780E0018, // 001B JMPF R3 #0035 + 0x880C0101, // 001C GETMBR R3 R0 K1 + 0x88100506, // 001D GETMBR R4 R2 K6 + 0x180C0604, // 001E LE R3 R3 R4 + 0x780E0014, // 001F JMPF R3 #0035 + 0x600C0009, // 0020 GETGBL R3 G9 + 0x88100104, // 0021 GETMBR R4 R0 K4 + 0x7C0C0200, // 0022 CALL R3 1 + 0x5412007E, // 0023 LDINT R4 127 + 0x18100604, // 0024 LE R4 R3 R4 + 0x78120005, // 0025 JMPF R4 #002C + 0x5411FF7F, // 0026 LDINT R4 -128 + 0x28100604, // 0027 GE R4 R3 R4 + 0x78120002, // 0028 JMPF R4 #002C + 0x88100507, // 0029 GETMBR R4 R2 K7 + 0x90020204, // 002A SETMBR R0 K1 R4 + 0x70020007, // 002B JMP #0034 + 0x54127FFE, // 002C LDINT R4 32767 + 0x18100604, // 002D LE R4 R3 R4 + 0x78120004, // 002E JMPF R4 #0034 + 0x54117FFF, // 002F LDINT R4 -32768 + 0x28100604, // 0030 GE R4 R3 R4 + 0x78120001, // 0031 JMPF R4 #0034 + 0x88100505, // 0032 GETMBR R4 R2 K5 + 0x90020204, // 0033 SETMBR R0 K1 R4 + 0x70020053, // 0034 JMP #0089 + 0x880C0101, // 0035 GETMBR R3 R0 K1 + 0x88100508, // 0036 GETMBR R4 R2 K8 + 0x280C0604, // 0037 GE R3 R3 R4 + 0x780E0016, // 0038 JMPF R3 #0050 + 0x880C0101, // 0039 GETMBR R3 R0 K1 + 0x88100509, // 003A GETMBR R4 R2 K9 + 0x180C0604, // 003B LE R3 R3 R4 + 0x780E0012, // 003C JMPF R3 #0050 + 0x600C0009, // 003D GETGBL R3 G9 + 0x88100104, // 003E GETMBR R4 R0 K4 + 0x7C0C0200, // 003F CALL R3 1 + 0x541200FE, // 0040 LDINT R4 255 + 0x18100604, // 0041 LE R4 R3 R4 + 0x78120004, // 0042 JMPF R4 #0048 + 0x2810070A, // 0043 GE R4 R3 K10 + 0x78120002, // 0044 JMPF R4 #0048 + 0x8810050B, // 0045 GETMBR R4 R2 K11 + 0x90020204, // 0046 SETMBR R0 K1 R4 + 0x70020006, // 0047 JMP #004F + 0x5412FFFE, // 0048 LDINT R4 65535 + 0x18100604, // 0049 LE R4 R3 R4 + 0x78120003, // 004A JMPF R4 #004F + 0x2810070A, // 004B GE R4 R3 K10 + 0x78120001, // 004C JMPF R4 #004F + 0x88100508, // 004D GETMBR R4 R2 K8 + 0x90020204, // 004E SETMBR R0 K1 R4 + 0x70020038, // 004F JMP #0089 + 0x880C0101, // 0050 GETMBR R3 R0 K1 + 0x8810050C, // 0051 GETMBR R4 R2 K12 + 0x280C0604, // 0052 GE R3 R3 R4 + 0x780E0018, // 0053 JMPF R3 #006D + 0x880C0101, // 0054 GETMBR R3 R0 K1 + 0x8810050D, // 0055 GETMBR R4 R2 K13 + 0x180C0604, // 0056 LE R3 R3 R4 + 0x780E0014, // 0057 JMPF R3 #006D + 0x600C000C, // 0058 GETGBL R3 G12 + 0x88100104, // 0059 GETMBR R4 R0 K4 + 0x7C0C0200, // 005A CALL R3 1 + 0x541200FE, // 005B LDINT R4 255 + 0x180C0604, // 005C LE R3 R3 R4 + 0x780E0002, // 005D JMPF R3 #0061 + 0x880C050C, // 005E GETMBR R3 R2 K12 + 0x90020203, // 005F SETMBR R0 K1 R3 + 0x7002000A, // 0060 JMP #006C + 0x600C000C, // 0061 GETGBL R3 G12 + 0x88100104, // 0062 GETMBR R4 R0 K4 + 0x7C0C0200, // 0063 CALL R3 1 + 0x5412FFFE, // 0064 LDINT R4 65535 + 0x180C0604, // 0065 LE R3 R3 R4 + 0x780E0002, // 0066 JMPF R3 #006A + 0x880C050E, // 0067 GETMBR R3 R2 K14 + 0x90020203, // 0068 SETMBR R0 K1 R3 + 0x70020001, // 0069 JMP #006C + 0x880C050F, // 006A GETMBR R3 R2 K15 + 0x90020203, // 006B SETMBR R0 K1 R3 + 0x7002001B, // 006C JMP #0089 + 0x880C0101, // 006D GETMBR R3 R0 K1 + 0x88100510, // 006E GETMBR R4 R2 K16 + 0x280C0604, // 006F GE R3 R3 R4 + 0x780E0017, // 0070 JMPF R3 #0089 + 0x880C0101, // 0071 GETMBR R3 R0 K1 + 0x88100511, // 0072 GETMBR R4 R2 K17 + 0x180C0604, // 0073 LE R3 R3 R4 + 0x780E0013, // 0074 JMPF R3 #0089 + 0x600C000C, // 0075 GETGBL R3 G12 + 0x88100104, // 0076 GETMBR R4 R0 K4 + 0x7C0C0200, // 0077 CALL R3 1 + 0x541200FE, // 0078 LDINT R4 255 + 0x180C0604, // 0079 LE R3 R3 R4 + 0x780E0002, // 007A JMPF R3 #007E + 0x880C0510, // 007B GETMBR R3 R2 K16 + 0x90020203, // 007C SETMBR R0 K1 R3 + 0x7002000A, // 007D JMP #0089 + 0x600C000C, // 007E GETGBL R3 G12 + 0x88100104, // 007F GETMBR R4 R0 K4 + 0x7C0C0200, // 0080 CALL R3 1 + 0x5412FFFE, // 0081 LDINT R4 65535 + 0x180C0604, // 0082 LE R3 R3 R4 + 0x780E0002, // 0083 JMPF R3 #0087 + 0x880C0512, // 0084 GETMBR R3 R2 K18 + 0x90020203, // 0085 SETMBR R0 K1 R3 + 0x70020001, // 0086 JMP #0089 + 0x880C0513, // 0087 GETMBR R3 R2 K19 + 0x90020203, // 0088 SETMBR R0 K1 R3 + 0x8C0C0114, // 0089 GETMET R3 R0 K20 + 0x5C140200, // 008A MOVE R5 R1 + 0x7C0C0400, // 008B CALL R3 2 + 0x880C0101, // 008C GETMBR R3 R0 K1 + 0x88100507, // 008D GETMBR R4 R2 K7 + 0x1C0C0604, // 008E EQ R3 R3 R4 + 0x740E0003, // 008F JMPT R3 #0094 + 0x880C0101, // 0090 GETMBR R3 R0 K1 + 0x8810050B, // 0091 GETMBR R4 R2 K11 + 0x1C0C0604, // 0092 EQ R3 R3 R4 + 0x780E0006, // 0093 JMPF R3 #009B + 0x8C0C0315, // 0094 GETMET R3 R1 K21 + 0x60140009, // 0095 GETGBL R5 G9 + 0x88180104, // 0096 GETMBR R6 R0 K4 + 0x7C140200, // 0097 CALL R5 1 + 0x58180016, // 0098 LDCONST R6 K22 + 0x7C0C0600, // 0099 CALL R3 3 + 0x700200BC, // 009A JMP #0158 + 0x880C0101, // 009B GETMBR R3 R0 K1 + 0x88100505, // 009C GETMBR R4 R2 K5 + 0x1C0C0604, // 009D EQ R3 R3 R4 + 0x740E0003, // 009E JMPT R3 #00A3 + 0x880C0101, // 009F GETMBR R3 R0 K1 + 0x88100508, // 00A0 GETMBR R4 R2 K8 + 0x1C0C0604, // 00A1 EQ R3 R3 R4 + 0x780E0006, // 00A2 JMPF R3 #00AA + 0x8C0C0315, // 00A3 GETMET R3 R1 K21 + 0x60140009, // 00A4 GETGBL R5 G9 + 0x88180104, // 00A5 GETMBR R6 R0 K4 + 0x7C140200, // 00A6 CALL R5 1 + 0x58180017, // 00A7 LDCONST R6 K23 + 0x7C0C0600, // 00A8 CALL R3 3 + 0x700200AD, // 00A9 JMP #0158 + 0x880C0101, // 00AA GETMBR R3 R0 K1 + 0x88100506, // 00AB GETMBR R4 R2 K6 + 0x1C0C0604, // 00AC EQ R3 R3 R4 + 0x740E0003, // 00AD JMPT R3 #00B2 + 0x880C0101, // 00AE GETMBR R3 R0 K1 + 0x88100509, // 00AF GETMBR R4 R2 K9 + 0x1C0C0604, // 00B0 EQ R3 R3 R4 + 0x780E0006, // 00B1 JMPF R3 #00B9 + 0x8C0C0315, // 00B2 GETMET R3 R1 K21 + 0x60140009, // 00B3 GETGBL R5 G9 + 0x88180104, // 00B4 GETMBR R6 R0 K4 + 0x7C140200, // 00B5 CALL R5 1 + 0x541A0003, // 00B6 LDINT R6 4 + 0x7C0C0600, // 00B7 CALL R3 3 + 0x7002009E, // 00B8 JMP #0158 + 0x880C0101, // 00B9 GETMBR R3 R0 K1 + 0x88100518, // 00BA GETMBR R4 R2 K24 + 0x1C0C0604, // 00BB EQ R3 R3 R4 + 0x740E0003, // 00BC JMPT R3 #00C1 + 0x880C0101, // 00BD GETMBR R3 R0 K1 + 0x88100519, // 00BE GETMBR R4 R2 K25 + 0x1C0C0604, // 00BF EQ R3 R3 R4 + 0x780E000F, // 00C0 JMPF R3 #00D1 + 0x880C0104, // 00C1 GETMBR R3 R0 K4 + 0x6010000F, // 00C2 GETGBL R4 G15 + 0x5C140600, // 00C3 MOVE R5 R3 + 0xB81A3400, // 00C4 GETNGBL R6 K26 + 0x7C100400, // 00C5 CALL R4 2 + 0x74120005, // 00C6 JMPT R4 #00CD + 0xB8123400, // 00C7 GETNGBL R4 K26 + 0x60140009, // 00C8 GETGBL R5 G9 + 0x88180104, // 00C9 GETMBR R6 R0 K4 + 0x7C140200, // 00CA CALL R5 1 + 0x7C100200, // 00CB CALL R4 1 + 0x5C0C0800, // 00CC MOVE R3 R4 + 0x8C10071B, // 00CD GETMET R4 R3 K27 + 0x7C100200, // 00CE CALL R4 1 + 0x40100204, // 00CF CONNECT R4 R1 R4 + 0x70020086, // 00D0 JMP #0158 + 0x880C0101, // 00D1 GETMBR R3 R0 K1 + 0x88100502, // 00D2 GETMBR R4 R2 K2 + 0x1C0C0604, // 00D3 EQ R3 R3 R4 + 0x740E0003, // 00D4 JMPT R3 #00D9 + 0x880C0101, // 00D5 GETMBR R3 R0 K1 + 0x88100503, // 00D6 GETMBR R4 R2 K3 + 0x1C0C0604, // 00D7 EQ R3 R3 R4 + 0x780E0000, // 00D8 JMPF R3 #00DA + 0x7002007D, // 00D9 JMP #0158 + 0x880C0101, // 00DA GETMBR R3 R0 K1 + 0x8810051C, // 00DB GETMBR R4 R2 K28 + 0x1C0C0604, // 00DC EQ R3 R3 R4 + 0x780E000D, // 00DD JMPF R3 #00EC + 0x600C000C, // 00DE GETGBL R3 G12 + 0x5C100200, // 00DF MOVE R4 R1 + 0x7C0C0200, // 00E0 CALL R3 1 + 0x8C100315, // 00E1 GETMET R4 R1 K21 + 0x5818000A, // 00E2 LDCONST R6 K10 + 0x541E0003, // 00E3 LDINT R7 4 + 0x7C100600, // 00E4 CALL R4 3 + 0x8C10031D, // 00E5 GETMET R4 R1 K29 + 0x5C180600, // 00E6 MOVE R6 R3 + 0x601C000A, // 00E7 GETGBL R7 G10 + 0x88200104, // 00E8 GETMBR R8 R0 K4 + 0x7C1C0200, // 00E9 CALL R7 1 + 0x7C100600, // 00EA CALL R4 3 + 0x7002006B, // 00EB JMP #0158 + 0x880C0101, // 00EC GETMBR R3 R0 K1 + 0x8810051E, // 00ED GETMBR R4 R2 K30 + 0x1C0C0604, // 00EE EQ R3 R3 R4 + 0x780E0001, // 00EF JMPF R3 #00F2 + 0xB0063F20, // 00F0 RAISE 1 K31 K32 + 0x70020065, // 00F1 JMP #0158 + 0x880C0101, // 00F2 GETMBR R3 R0 K1 + 0x88100510, // 00F3 GETMBR R4 R2 K16 + 0x1C0C0604, // 00F4 EQ R3 R3 R4 + 0x780E0015, // 00F5 JMPF R3 #010C + 0x600C000C, // 00F6 GETGBL R3 G12 + 0x88100104, // 00F7 GETMBR R4 R0 K4 + 0x7C0C0200, // 00F8 CALL R3 1 + 0x541200FE, // 00F9 LDINT R4 255 + 0x240C0604, // 00FA GT R3 R3 R4 + 0x780E0000, // 00FB JMPF R3 #00FD + 0xB0063F21, // 00FC RAISE 1 K31 K33 + 0x8C0C0315, // 00FD GETMET R3 R1 K21 + 0x6014000C, // 00FE GETGBL R5 G12 + 0x88180104, // 00FF GETMBR R6 R0 K4 + 0x7C140200, // 0100 CALL R5 1 + 0x58180016, // 0101 LDCONST R6 K22 + 0x7C0C0600, // 0102 CALL R3 3 + 0x600C0015, // 0103 GETGBL R3 G21 + 0x7C0C0000, // 0104 CALL R3 0 + 0x8C0C0722, // 0105 GETMET R3 R3 K34 + 0x60140008, // 0106 GETGBL R5 G8 + 0x88180104, // 0107 GETMBR R6 R0 K4 + 0x7C140200, // 0108 CALL R5 1 + 0x7C0C0400, // 0109 CALL R3 2 + 0x400C0203, // 010A CONNECT R3 R1 R3 + 0x7002004B, // 010B JMP #0158 + 0x880C0101, // 010C GETMBR R3 R0 K1 + 0x88100512, // 010D GETMBR R4 R2 K18 + 0x1C0C0604, // 010E EQ R3 R3 R4 + 0x780E0015, // 010F JMPF R3 #0126 + 0x600C000C, // 0110 GETGBL R3 G12 + 0x88100104, // 0111 GETMBR R4 R0 K4 + 0x7C0C0200, // 0112 CALL R3 1 + 0x5412FFFE, // 0113 LDINT R4 65535 + 0x240C0604, // 0114 GT R3 R3 R4 + 0x780E0000, // 0115 JMPF R3 #0117 + 0xB0063F21, // 0116 RAISE 1 K31 K33 + 0x8C0C0315, // 0117 GETMET R3 R1 K21 + 0x6014000C, // 0118 GETGBL R5 G12 + 0x88180104, // 0119 GETMBR R6 R0 K4 + 0x7C140200, // 011A CALL R5 1 + 0x58180017, // 011B LDCONST R6 K23 + 0x7C0C0600, // 011C CALL R3 3 + 0x600C0015, // 011D GETGBL R3 G21 + 0x7C0C0000, // 011E CALL R3 0 + 0x8C0C0723, // 011F GETMET R3 R3 K35 + 0x60140008, // 0120 GETGBL R5 G8 + 0x88180104, // 0121 GETMBR R6 R0 K4 + 0x7C140200, // 0122 CALL R5 1 + 0x7C0C0400, // 0123 CALL R3 2 + 0x400C0203, // 0124 CONNECT R3 R1 R3 + 0x70020031, // 0125 JMP #0158 + 0x880C0101, // 0126 GETMBR R3 R0 K1 + 0x8810050C, // 0127 GETMBR R4 R2 K12 + 0x1C0C0604, // 0128 EQ R3 R3 R4 + 0x780E000F, // 0129 JMPF R3 #013A + 0x600C000C, // 012A GETGBL R3 G12 + 0x88100104, // 012B GETMBR R4 R0 K4 + 0x7C0C0200, // 012C CALL R3 1 + 0x541200FE, // 012D LDINT R4 255 + 0x240C0604, // 012E GT R3 R3 R4 + 0x780E0000, // 012F JMPF R3 #0131 + 0xB0063F24, // 0130 RAISE 1 K31 K36 + 0x8C0C0315, // 0131 GETMET R3 R1 K21 + 0x6014000C, // 0132 GETGBL R5 G12 + 0x88180104, // 0133 GETMBR R6 R0 K4 + 0x7C140200, // 0134 CALL R5 1 + 0x58180016, // 0135 LDCONST R6 K22 + 0x7C0C0600, // 0136 CALL R3 3 + 0x880C0104, // 0137 GETMBR R3 R0 K4 + 0x400C0203, // 0138 CONNECT R3 R1 R3 + 0x7002001D, // 0139 JMP #0158 + 0x880C0101, // 013A GETMBR R3 R0 K1 + 0x8810050E, // 013B GETMBR R4 R2 K14 + 0x1C0C0604, // 013C EQ R3 R3 R4 + 0x780E000F, // 013D JMPF R3 #014E + 0x600C000C, // 013E GETGBL R3 G12 + 0x88100104, // 013F GETMBR R4 R0 K4 + 0x7C0C0200, // 0140 CALL R3 1 + 0x5412FFFE, // 0141 LDINT R4 65535 + 0x240C0604, // 0142 GT R3 R3 R4 + 0x780E0000, // 0143 JMPF R3 #0145 + 0xB0063F24, // 0144 RAISE 1 K31 K36 + 0x8C0C0315, // 0145 GETMET R3 R1 K21 + 0x6014000C, // 0146 GETGBL R5 G12 + 0x88180104, // 0147 GETMBR R6 R0 K4 + 0x7C140200, // 0148 CALL R5 1 + 0x58180017, // 0149 LDCONST R6 K23 + 0x7C0C0600, // 014A CALL R3 3 + 0x880C0104, // 014B GETMBR R3 R0 K4 + 0x400C0203, // 014C CONNECT R3 R1 R3 + 0x70020009, // 014D JMP #0158 + 0x880C0101, // 014E GETMBR R3 R0 K1 + 0x88100525, // 014F GETMBR R4 R2 K37 + 0x1C0C0604, // 0150 EQ R3 R3 R4 + 0x780E0000, // 0151 JMPF R3 #0153 + 0x70020004, // 0152 JMP #0158 + 0x600C0008, // 0153 GETGBL R3 G8 + 0x88100101, // 0154 GETMBR R4 R0 K1 + 0x7C0C0200, // 0155 CALL R3 1 + 0x000E4C03, // 0156 ADD R3 K38 R3 + 0xB0063E03, // 0157 RAISE 1 K31 R3 + 0x80040200, // 0158 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: create_TLV +********************************************************************/ +be_local_closure(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 */ + NULL, /* no sub protos */ + 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[10]) { /* code */ + 0x58080000, // 0000 LDCONST R2 K0 + 0x4C0C0000, // 0001 LDNIL R3 + 0x200C0203, // 0002 NE R3 R1 R3 + 0x780E0004, // 0003 JMPF R3 #0009 + 0x5C0C0400, // 0004 MOVE R3 R2 + 0x7C0C0000, // 0005 CALL R3 0 + 0x900E0200, // 0006 SETMBR R3 K1 R0 + 0x900E0401, // 0007 SETMBR R3 K2 R1 + 0x80040600, // 0008 RET 1 R3 + 0x80000000, // 0009 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: _encode_tag +********************************************************************/ +be_local_closure(Matter_TLV_item__encode_tag, /* name */ + be_nested_proto( + 9, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(tag_number), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str_weak(tag_vendor), + /* K3 */ be_nested_str_weak(add), + /* K4 */ be_nested_str_weak(typ), + /* K5 */ be_const_int(1), + /* K6 */ be_const_int(2), + /* K7 */ be_nested_str_weak(tag_profile), + /* K8 */ be_nested_str_weak(tag_sub), + }), + be_str_weak(_encode_tag), + &be_const_str_solidified, + ( &(const binstruction[133]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x4C0C0000, // 0001 LDNIL R3 + 0x20080403, // 0002 NE R2 R2 R3 + 0x780A0001, // 0003 JMPF R2 #0006 + 0x88080100, // 0004 GETMBR R2 R0 K0 + 0x70020000, // 0005 JMP #0007 + 0x58080001, // 0006 LDCONST R2 K1 + 0x540EFFFF, // 0007 LDINT R3 65536 + 0x280C0403, // 0008 GE R3 R2 R3 + 0x740E0002, // 0009 JMPT R3 #000D + 0x140C0501, // 000A LT R3 R2 K1 + 0x740E0000, // 000B JMPT R3 #000D + 0x500C0001, // 000C LDBOOL R3 0 1 + 0x500C0200, // 000D LDBOOL R3 1 0 + 0x58100001, // 000E LDCONST R4 K1 + 0x88140102, // 000F GETMBR R5 R0 K2 + 0x4C180000, // 0010 LDNIL R6 + 0x20140A06, // 0011 NE R5 R5 R6 + 0x78160026, // 0012 JMPF R5 #003A + 0x780E0012, // 0013 JMPF R3 #0027 + 0x8C140303, // 0014 GETMET R5 R1 K3 + 0x541E00DF, // 0015 LDINT R7 224 + 0x88200104, // 0016 GETMBR R8 R0 K4 + 0x001C0E08, // 0017 ADD R7 R7 R8 + 0x58200005, // 0018 LDCONST R8 K5 + 0x7C140600, // 0019 CALL R5 3 + 0x8C140303, // 001A GETMET R5 R1 K3 + 0x881C0102, // 001B GETMBR R7 R0 K2 + 0x58200006, // 001C LDCONST R8 K6 + 0x7C140600, // 001D CALL R5 3 + 0x8C140303, // 001E GETMET R5 R1 K3 + 0x881C0107, // 001F GETMBR R7 R0 K7 + 0x58200006, // 0020 LDCONST R8 K6 + 0x7C140600, // 0021 CALL R5 3 + 0x8C140303, // 0022 GETMET R5 R1 K3 + 0x881C0100, // 0023 GETMBR R7 R0 K0 + 0x54220003, // 0024 LDINT R8 4 + 0x7C140600, // 0025 CALL R5 3 + 0x70020011, // 0026 JMP #0039 + 0x8C140303, // 0027 GETMET R5 R1 K3 + 0x541E00BF, // 0028 LDINT R7 192 + 0x88200104, // 0029 GETMBR R8 R0 K4 + 0x001C0E08, // 002A ADD R7 R7 R8 + 0x58200005, // 002B LDCONST R8 K5 + 0x7C140600, // 002C CALL R5 3 + 0x8C140303, // 002D GETMET R5 R1 K3 + 0x881C0102, // 002E GETMBR R7 R0 K2 + 0x58200006, // 002F LDCONST R8 K6 + 0x7C140600, // 0030 CALL R5 3 + 0x8C140303, // 0031 GETMET R5 R1 K3 + 0x881C0107, // 0032 GETMBR R7 R0 K7 + 0x58200006, // 0033 LDCONST R8 K6 + 0x7C140600, // 0034 CALL R5 3 + 0x8C140303, // 0035 GETMET R5 R1 K3 + 0x881C0100, // 0036 GETMBR R7 R0 K0 + 0x58200006, // 0037 LDCONST R8 K6 + 0x7C140600, // 0038 CALL R5 3 + 0x70020049, // 0039 JMP #0084 + 0x88140107, // 003A GETMBR R5 R0 K7 + 0x5419FFFE, // 003B LDINT R6 -1 + 0x1C140A06, // 003C EQ R5 R5 R6 + 0x78160016, // 003D JMPF R5 #0055 + 0x780E000A, // 003E JMPF R3 #004A + 0x8C140303, // 003F GETMET R5 R1 K3 + 0x541E005F, // 0040 LDINT R7 96 + 0x88200104, // 0041 GETMBR R8 R0 K4 + 0x001C0E08, // 0042 ADD R7 R7 R8 + 0x58200005, // 0043 LDCONST R8 K5 + 0x7C140600, // 0044 CALL R5 3 + 0x8C140303, // 0045 GETMET R5 R1 K3 + 0x881C0100, // 0046 GETMBR R7 R0 K0 + 0x54220003, // 0047 LDINT R8 4 + 0x7C140600, // 0048 CALL R5 3 + 0x70020009, // 0049 JMP #0054 + 0x8C140303, // 004A GETMET R5 R1 K3 + 0x541E003F, // 004B LDINT R7 64 + 0x88200104, // 004C GETMBR R8 R0 K4 + 0x001C0E08, // 004D ADD R7 R7 R8 + 0x58200005, // 004E LDCONST R8 K5 + 0x7C140600, // 004F CALL R5 3 + 0x8C140303, // 0050 GETMET R5 R1 K3 + 0x881C0100, // 0051 GETMBR R7 R0 K0 + 0x58200006, // 0052 LDCONST R8 K6 + 0x7C140600, // 0053 CALL R5 3 + 0x7002002E, // 0054 JMP #0084 + 0x88140107, // 0055 GETMBR R5 R0 K7 + 0x4C180000, // 0056 LDNIL R6 + 0x20140A06, // 0057 NE R5 R5 R6 + 0x78160016, // 0058 JMPF R5 #0070 + 0x780E000A, // 0059 JMPF R3 #0065 + 0x8C140303, // 005A GETMET R5 R1 K3 + 0x541E009F, // 005B LDINT R7 160 + 0x88200104, // 005C GETMBR R8 R0 K4 + 0x001C0E08, // 005D ADD R7 R7 R8 + 0x58200005, // 005E LDCONST R8 K5 + 0x7C140600, // 005F CALL R5 3 + 0x8C140303, // 0060 GETMET R5 R1 K3 + 0x881C0100, // 0061 GETMBR R7 R0 K0 + 0x54220003, // 0062 LDINT R8 4 + 0x7C140600, // 0063 CALL R5 3 + 0x70020009, // 0064 JMP #006F + 0x8C140303, // 0065 GETMET R5 R1 K3 + 0x541E007F, // 0066 LDINT R7 128 + 0x88200104, // 0067 GETMBR R8 R0 K4 + 0x001C0E08, // 0068 ADD R7 R7 R8 + 0x58200005, // 0069 LDCONST R8 K5 + 0x7C140600, // 006A CALL R5 3 + 0x8C140303, // 006B GETMET R5 R1 K3 + 0x881C0100, // 006C GETMBR R7 R0 K0 + 0x58200006, // 006D LDCONST R8 K6 + 0x7C140600, // 006E CALL R5 3 + 0x70020013, // 006F JMP #0084 + 0x88140108, // 0070 GETMBR R5 R0 K8 + 0x4C180000, // 0071 LDNIL R6 + 0x20140A06, // 0072 NE R5 R5 R6 + 0x7816000A, // 0073 JMPF R5 #007F + 0x8C140303, // 0074 GETMET R5 R1 K3 + 0x541E001F, // 0075 LDINT R7 32 + 0x88200104, // 0076 GETMBR R8 R0 K4 + 0x001C0E08, // 0077 ADD R7 R7 R8 + 0x58200005, // 0078 LDCONST R8 K5 + 0x7C140600, // 0079 CALL R5 3 + 0x8C140303, // 007A GETMET R5 R1 K3 + 0x881C0108, // 007B GETMBR R7 R0 K8 + 0x58200005, // 007C LDCONST R8 K5 + 0x7C140600, // 007D CALL R5 3 + 0x70020004, // 007E JMP #0084 + 0x8C140303, // 007F GETMET R5 R1 K3 + 0x881C0104, // 0080 GETMBR R7 R0 K4 + 0x001E0207, // 0081 ADD R7 K1 R7 + 0x58200005, // 0082 LDCONST R8 K5 + 0x7C140600, // 0083 CALL R5 3 + 0x80000000, // 0084 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_parent +********************************************************************/ +be_local_closure(Matter_TLV_item_set_parent, /* name */ + be_nested_proto( + 2, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(parent), + }), + 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 +********************************************************************/ +be_local_closure(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 */ + NULL, /* no sub protos */ + 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 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: to_TLV +********************************************************************/ +be_local_closure(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 */ + NULL, /* no sub protos */ + 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: tostring +********************************************************************/ +be_local_closure(Matter_TLV_item_tostring, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[35]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(), + /* K2 */ be_nested_str_weak(tag_profile), + /* K3 */ be_nested_str_weak(Matter_X3A_X3A), + /* K4 */ be_nested_str_weak(tag_number), + /* K5 */ be_nested_str_weak(format), + /* K6 */ be_nested_str_weak(0x_X2508X_X20), + /* K7 */ be_nested_str_weak(tag_vendor), + /* K8 */ be_nested_str_weak(0x_X2504X_X3A_X3A), + /* K9 */ be_nested_str_weak(0x_X2504X_X3A), + /* K10 */ be_nested_str_weak(tag_sub), + /* K11 */ be_nested_str_weak(_X25i_X20), + /* K12 */ be_const_int(0), + /* K13 */ be_nested_str_weak(_X3D_X20), + /* K14 */ be_nested_str_weak(val), + /* K15 */ be_nested_str_weak(int), + /* K16 */ be_nested_str_weak(_X25i), + /* K17 */ be_nested_str_weak(typ), + /* K18 */ be_nested_str_weak(TLV), + /* K19 */ be_nested_str_weak(U1), + /* K20 */ be_nested_str_weak(U8), + /* K21 */ be_nested_str_weak(U), + /* K22 */ be_nested_str_weak(bool), + /* K23 */ be_nested_str_weak(true), + /* K24 */ be_nested_str_weak(false), + /* K25 */ be_nested_str_weak(null), + /* K26 */ be_nested_str_weak(real), + /* K27 */ be_nested_str_weak(_X25g), + /* K28 */ be_nested_str_weak(_X22_X25s_X22), + /* K29 */ be_nested_str_weak(int64), + /* K30 */ be_nested_str_weak(tostring), + /* K31 */ be_nested_str_weak(instance), + /* K32 */ be_nested_str_weak(_X25s), + /* K33 */ be_nested_str_weak(tohex), + /* K34 */ be_nested_str_weak(_X20), + }), + be_str_weak(tostring), + &be_const_str_solidified, + ( &(const binstruction[165]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x58080001, // 0001 LDCONST R2 K1 + 0xA8020099, // 0002 EXBLK 0 #009D + 0x880C0102, // 0003 GETMBR R3 R0 K2 + 0x5411FFFE, // 0004 LDINT R4 -1 + 0x1C0C0604, // 0005 EQ R3 R3 R4 + 0x780E000A, // 0006 JMPF R3 #0012 + 0x00080503, // 0007 ADD R2 R2 K3 + 0x880C0104, // 0008 GETMBR R3 R0 K4 + 0x4C100000, // 0009 LDNIL R4 + 0x200C0604, // 000A NE R3 R3 R4 + 0x780E0004, // 000B JMPF R3 #0011 + 0x8C0C0305, // 000C GETMET R3 R1 K5 + 0x58140006, // 000D LDCONST R5 K6 + 0x88180104, // 000E GETMBR R6 R0 K4 + 0x7C0C0600, // 000F CALL R3 3 + 0x00080403, // 0010 ADD R2 R2 R3 + 0x70020023, // 0011 JMP #0036 + 0x880C0107, // 0012 GETMBR R3 R0 K7 + 0x4C100000, // 0013 LDNIL R4 + 0x200C0604, // 0014 NE R3 R3 R4 + 0x780E0004, // 0015 JMPF R3 #001B + 0x8C0C0305, // 0016 GETMET R3 R1 K5 + 0x58140008, // 0017 LDCONST R5 K8 + 0x88180107, // 0018 GETMBR R6 R0 K7 + 0x7C0C0600, // 0019 CALL R3 3 + 0x00080403, // 001A ADD R2 R2 R3 + 0x880C0102, // 001B GETMBR R3 R0 K2 + 0x4C100000, // 001C LDNIL R4 + 0x200C0604, // 001D NE R3 R3 R4 + 0x780E0004, // 001E JMPF R3 #0024 + 0x8C0C0305, // 001F GETMET R3 R1 K5 + 0x58140009, // 0020 LDCONST R5 K9 + 0x88180102, // 0021 GETMBR R6 R0 K2 + 0x7C0C0600, // 0022 CALL R3 3 + 0x00080403, // 0023 ADD R2 R2 R3 + 0x880C0104, // 0024 GETMBR R3 R0 K4 + 0x4C100000, // 0025 LDNIL R4 + 0x200C0604, // 0026 NE R3 R3 R4 + 0x780E0004, // 0027 JMPF R3 #002D + 0x8C0C0305, // 0028 GETMET R3 R1 K5 + 0x58140006, // 0029 LDCONST R5 K6 + 0x88180104, // 002A GETMBR R6 R0 K4 + 0x7C0C0600, // 002B CALL R3 3 + 0x00080403, // 002C ADD R2 R2 R3 + 0x880C010A, // 002D GETMBR R3 R0 K10 + 0x4C100000, // 002E LDNIL R4 + 0x200C0604, // 002F NE R3 R3 R4 + 0x780E0004, // 0030 JMPF R3 #0036 + 0x8C0C0305, // 0031 GETMET R3 R1 K5 + 0x5814000B, // 0032 LDCONST R5 K11 + 0x8818010A, // 0033 GETMBR R6 R0 K10 + 0x7C0C0600, // 0034 CALL R3 3 + 0x00080403, // 0035 ADD R2 R2 R3 + 0x600C000C, // 0036 GETGBL R3 G12 + 0x5C100400, // 0037 MOVE R4 R2 + 0x7C0C0200, // 0038 CALL R3 1 + 0x240C070C, // 0039 GT R3 R3 K12 + 0x780E0000, // 003A JMPF R3 #003C + 0x0008050D, // 003B ADD R2 R2 K13 + 0x600C0004, // 003C GETGBL R3 G4 + 0x8810010E, // 003D GETMBR R4 R0 K14 + 0x7C0C0200, // 003E CALL R3 1 + 0x1C0C070F, // 003F EQ R3 R3 K15 + 0x780E0010, // 0040 JMPF R3 #0052 + 0x8C0C0305, // 0041 GETMET R3 R1 K5 + 0x58140010, // 0042 LDCONST R5 K16 + 0x8818010E, // 0043 GETMBR R6 R0 K14 + 0x7C0C0600, // 0044 CALL R3 3 + 0x00080403, // 0045 ADD R2 R2 R3 + 0x880C0111, // 0046 GETMBR R3 R0 K17 + 0x88100112, // 0047 GETMBR R4 R0 K18 + 0x88100913, // 0048 GETMBR R4 R4 K19 + 0x280C0604, // 0049 GE R3 R3 R4 + 0x780E0005, // 004A JMPF R3 #0051 + 0x880C0111, // 004B GETMBR R3 R0 K17 + 0x88100112, // 004C GETMBR R4 R0 K18 + 0x88100914, // 004D GETMBR R4 R4 K20 + 0x180C0604, // 004E LE R3 R3 R4 + 0x780E0000, // 004F JMPF R3 #0051 + 0x00080515, // 0050 ADD R2 R2 K21 + 0x70020048, // 0051 JMP #009B + 0x600C0004, // 0052 GETGBL R3 G4 + 0x8810010E, // 0053 GETMBR R4 R0 K14 + 0x7C0C0200, // 0054 CALL R3 1 + 0x1C0C0716, // 0055 EQ R3 R3 K22 + 0x780E0006, // 0056 JMPF R3 #005E + 0x880C010E, // 0057 GETMBR R3 R0 K14 + 0x780E0001, // 0058 JMPF R3 #005B + 0x580C0017, // 0059 LDCONST R3 K23 + 0x70020000, // 005A JMP #005C + 0x580C0018, // 005B LDCONST R3 K24 + 0x00080403, // 005C ADD R2 R2 R3 + 0x7002003C, // 005D JMP #009B + 0x880C010E, // 005E GETMBR R3 R0 K14 + 0x4C100000, // 005F LDNIL R4 + 0x1C0C0604, // 0060 EQ R3 R3 R4 + 0x780E0001, // 0061 JMPF R3 #0064 + 0x00080519, // 0062 ADD R2 R2 K25 + 0x70020036, // 0063 JMP #009B + 0x600C0004, // 0064 GETGBL R3 G4 + 0x8810010E, // 0065 GETMBR R4 R0 K14 + 0x7C0C0200, // 0066 CALL R3 1 + 0x1C0C071A, // 0067 EQ R3 R3 K26 + 0x780E0005, // 0068 JMPF R3 #006F + 0x8C0C0305, // 0069 GETMET R3 R1 K5 + 0x5814001B, // 006A LDCONST R5 K27 + 0x8818010E, // 006B GETMBR R6 R0 K14 + 0x7C0C0600, // 006C CALL R3 3 + 0x00080403, // 006D ADD R2 R2 R3 + 0x7002002B, // 006E JMP #009B + 0x600C0004, // 006F GETGBL R3 G4 + 0x8810010E, // 0070 GETMBR R4 R0 K14 + 0x7C0C0200, // 0071 CALL R3 1 + 0x1C0C0700, // 0072 EQ R3 R3 K0 + 0x780E0005, // 0073 JMPF R3 #007A + 0x8C0C0305, // 0074 GETMET R3 R1 K5 + 0x5814001C, // 0075 LDCONST R5 K28 + 0x8818010E, // 0076 GETMBR R6 R0 K14 + 0x7C0C0600, // 0077 CALL R3 3 + 0x00080403, // 0078 ADD R2 R2 R3 + 0x70020020, // 0079 JMP #009B + 0x600C000F, // 007A GETGBL R3 G15 + 0x8810010E, // 007B GETMBR R4 R0 K14 + 0xB8163A00, // 007C GETNGBL R5 K29 + 0x7C0C0400, // 007D CALL R3 2 + 0x780E000F, // 007E JMPF R3 #008F + 0x880C010E, // 007F GETMBR R3 R0 K14 + 0x8C0C071E, // 0080 GETMET R3 R3 K30 + 0x7C0C0200, // 0081 CALL R3 1 + 0x00080403, // 0082 ADD R2 R2 R3 + 0x880C0111, // 0083 GETMBR R3 R0 K17 + 0x88100112, // 0084 GETMBR R4 R0 K18 + 0x88100913, // 0085 GETMBR R4 R4 K19 + 0x280C0604, // 0086 GE R3 R3 R4 + 0x780E0005, // 0087 JMPF R3 #008E + 0x880C0111, // 0088 GETMBR R3 R0 K17 + 0x88100112, // 0089 GETMBR R4 R0 K18 + 0x88100914, // 008A GETMBR R4 R4 K20 + 0x180C0604, // 008B LE R3 R3 R4 + 0x780E0000, // 008C JMPF R3 #008E + 0x00080515, // 008D ADD R2 R2 K21 + 0x7002000B, // 008E JMP #009B + 0x600C0004, // 008F GETGBL R3 G4 + 0x8810010E, // 0090 GETMBR R4 R0 K14 + 0x7C0C0200, // 0091 CALL R3 1 + 0x1C0C071F, // 0092 EQ R3 R3 K31 + 0x780E0006, // 0093 JMPF R3 #009B + 0x8C0C0305, // 0094 GETMET R3 R1 K5 + 0x58140020, // 0095 LDCONST R5 K32 + 0x8818010E, // 0096 GETMBR R6 R0 K14 + 0x8C180D21, // 0097 GETMET R6 R6 K33 + 0x7C180200, // 0098 CALL R6 1 + 0x7C0C0600, // 0099 CALL R3 3 + 0x00080403, // 009A ADD R2 R2 R3 + 0xA8040001, // 009B EXBLK 1 1 + 0x70020006, // 009C JMP #00A4 + 0xAC0C0002, // 009D CATCH R3 0 2 + 0x70020003, // 009E JMP #00A3 + 0x00140722, // 009F ADD R5 R3 K34 + 0x00140A04, // 00A0 ADD R5 R5 R4 + 0x80040A00, // 00A1 RET 1 R5 + 0x70020000, // 00A2 JMP #00A4 + 0xB0080000, // 00A3 RAISE 2 R0 R0 + 0x80040400, // 00A4 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: parse +********************************************************************/ +be_local_closure(Matter_TLV_item_parse, /* name */ + be_nested_proto( + 10, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[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[105]) { /* 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 + 0x781A000A, // 0006 JMPF R6 #0012 + 0xB81A0800, // 0007 GETNGBL R6 K4 + 0x7C180000, // 0008 CALL R6 0 + 0x90020606, // 0009 SETMBR R0 K3 R6 + 0x88180103, // 000A GETMBR R6 R0 K3 + 0x8C180D05, // 000B GETMET R6 R6 K5 + 0x5C200200, // 000C MOVE R8 R1 + 0x5C240400, // 000D MOVE R9 R2 + 0x7C180600, // 000E CALL R6 3 + 0x541A0007, // 000F LDINT R6 8 + 0x00080406, // 0010 ADD R2 R2 R6 + 0x70020054, // 0011 JMP #0067 + 0x88180906, // 0012 GETMBR R6 R4 K6 + 0x1C180606, // 0013 EQ R6 R3 R6 + 0x741A0002, // 0014 JMPT R6 #0018 + 0x88180907, // 0015 GETMBR R6 R4 K7 + 0x1C180606, // 0016 EQ R6 R3 R6 + 0x781A0003, // 0017 JMPF R6 #001C + 0x88180907, // 0018 GETMBR R6 R4 K7 + 0x1C180606, // 0019 EQ R6 R3 R6 + 0x90020606, // 001A SETMBR R0 K3 R6 + 0x7002004A, // 001B JMP #0067 + 0x88180908, // 001C GETMBR R6 R4 K8 + 0x14180606, // 001D LT R6 R3 R6 + 0x781A000E, // 001E JMPF R6 #002E + 0x88180909, // 001F GETMBR R6 R4 K9 + 0x18180606, // 0020 LE R6 R3 R6 + 0x781A0004, // 0021 JMPF R6 #0027 + 0x8C18030A, // 0022 GETMET R6 R1 K10 + 0x5C200400, // 0023 MOVE R8 R2 + 0x5C240A00, // 0024 MOVE R9 R5 + 0x7C180600, // 0025 CALL R6 3 + 0x70020003, // 0026 JMP #002B + 0x8C18030B, // 0027 GETMET R6 R1 K11 + 0x5C200400, // 0028 MOVE R8 R2 + 0x5C240A00, // 0029 MOVE R9 R5 + 0x7C180600, // 002A CALL R6 3 + 0x90020606, // 002B SETMBR R0 K3 R6 + 0x00080405, // 002C ADD R2 R2 R5 + 0x70020038, // 002D JMP #0067 + 0x8818090C, // 002E GETMBR R6 R4 K12 + 0x1C180606, // 002F EQ R6 R3 R6 + 0x781A0006, // 0030 JMPF R6 #0038 + 0x8C18030D, // 0031 GETMET R6 R1 K13 + 0x5C200400, // 0032 MOVE R8 R2 + 0x7C180400, // 0033 CALL R6 2 + 0x90020606, // 0034 SETMBR R0 K3 R6 + 0x541A0003, // 0035 LDINT R6 4 + 0x00080406, // 0036 ADD R2 R2 R6 + 0x7002002E, // 0037 JMP #0067 + 0x5419FFF7, // 0038 LDINT R6 -8 + 0x28180A06, // 0039 GE R6 R5 R6 + 0x781A0016, // 003A JMPF R6 #0052 + 0x5419FFFE, // 003B LDINT R6 -1 + 0x18180A06, // 003C LE R6 R5 R6 + 0x781A0013, // 003D JMPF R6 #0052 + 0x8C18030B, // 003E GETMET R6 R1 K11 + 0x5C200400, // 003F MOVE R8 R2 + 0x44240A00, // 0040 NEG R9 R5 + 0x7C180600, // 0041 CALL R6 3 + 0x441C0A00, // 0042 NEG R7 R5 + 0x00080407, // 0043 ADD R2 R2 R7 + 0x001C0406, // 0044 ADD R7 R2 R6 + 0x041C0F0E, // 0045 SUB R7 R7 K14 + 0x401C0407, // 0046 CONNECT R7 R2 R7 + 0x941C0207, // 0047 GETIDX R7 R1 R7 + 0x90020607, // 0048 SETMBR R0 K3 R7 + 0x00080406, // 0049 ADD R2 R2 R6 + 0x881C090F, // 004A GETMBR R7 R4 K15 + 0x181C0607, // 004B LE R7 R3 R7 + 0x781E0003, // 004C JMPF R7 #0051 + 0x881C0103, // 004D GETMBR R7 R0 K3 + 0x8C1C0F10, // 004E GETMET R7 R7 K16 + 0x7C1C0200, // 004F CALL R7 1 + 0x90020607, // 0050 SETMBR R0 K3 R7 + 0x70020014, // 0051 JMP #0067 + 0x88180911, // 0052 GETMBR R6 R4 K17 + 0x1C180606, // 0053 EQ R6 R3 R6 + 0x781A0000, // 0054 JMPF R6 #0056 + 0x70020010, // 0055 JMP #0067 + 0x88180912, // 0056 GETMBR R6 R4 K18 + 0x1C180606, // 0057 EQ R6 R3 R6 + 0x781A0005, // 0058 JMPF R6 #005F + 0xB81A2600, // 0059 GETNGBL R6 K19 + 0x8C180D14, // 005A GETMET R6 R6 K20 + 0x58200015, // 005B LDCONST R8 K21 + 0x58240016, // 005C LDCONST R9 K22 + 0x7C180600, // 005D CALL R6 3 + 0x70020007, // 005E JMP #0067 + 0xB81A2600, // 005F GETNGBL R6 K19 + 0x8C180D14, // 0060 GETMET R6 R6 K20 + 0x60200008, // 0061 GETGBL R8 G8 + 0x5C240600, // 0062 MOVE R9 R3 + 0x7C200200, // 0063 CALL R8 1 + 0x00222E08, // 0064 ADD R8 K23 R8 + 0x58240016, // 0065 LDCONST R9 K22 + 0x7C180600, // 0066 CALL R6 3 + 0x90023002, // 0067 SETMBR R0 K24 R2 + 0x80040400, // 0068 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_TLV_item_init, /* name */ + be_nested_proto( + 2, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(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 +********************************************************************/ +be_local_closure(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 */ + NULL, /* no sub protos */ + 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: sort +********************************************************************/ +be_local_closure(Matter_TLV_item_sort, /* name */ + be_nested_proto( + 9, /* nstack */ + 1, /* argc */ + 4, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 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: set_anonymoustag +********************************************************************/ +be_local_closure(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 */ + NULL, /* no sub protos */ + 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 function: set_contextspecific +********************************************************************/ +be_local_closure(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 */ + NULL, /* no sub protos */ + 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 class: Matter_TLV_item +********************************************************************/ +be_local_class(Matter_TLV_item, + 8, + NULL, + be_nested_map(23, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(set_commonprofile, -1), be_const_closure(Matter_TLV_item_set_commonprofile_closure) }, + { be_const_key_weak(set_parent, -1), be_const_closure(Matter_TLV_item_set_parent_closure) }, + { be_const_key_weak(tag_profile, 3), be_const_var(3) }, + { be_const_key_weak(set_anonymoustag, 8), be_const_closure(Matter_TLV_item_set_anonymoustag_closure) }, + { be_const_key_weak(create_TLV, -1), be_const_static_closure(Matter_TLV_item_create_TLV_closure) }, + { be_const_key_weak(_encode_tag, -1), be_const_closure(Matter_TLV_item__encode_tag_closure) }, + { be_const_key_weak(val, -1), be_const_var(7) }, + { be_const_key_weak(TLV, 20), be_const_class(be_class_Matter_TLV) }, + { be_const_key_weak(tag_vendor, 1), be_const_var(2) }, + { be_const_key_weak(tostring, -1), be_const_closure(Matter_TLV_item_tostring_closure) }, + { be_const_key_weak(parse, -1), be_const_closure(Matter_TLV_item_parse_closure) }, + { be_const_key_weak(tag_number, -1), be_const_var(4) }, + { be_const_key_weak(sort, -1), be_const_static_closure(Matter_TLV_item_sort_closure) }, + { be_const_key_weak(next_idx, -1), be_const_var(1) }, + { be_const_key_weak(init, -1), be_const_closure(Matter_TLV_item_init_closure) }, + { be_const_key_weak(_cmp_gt, -1), be_const_closure(Matter_TLV_item__cmp_gt_closure) }, + { be_const_key_weak(encode, 12), be_const_closure(Matter_TLV_item_encode_closure) }, + { be_const_key_weak(typ, -1), be_const_var(6) }, + { be_const_key_weak(parent, -1), be_const_var(0) }, + { be_const_key_weak(to_TLV, 6), be_const_closure(Matter_TLV_item_to_TLV_closure) }, + { be_const_key_weak(set_fulltag, -1), be_const_closure(Matter_TLV_item_set_fulltag_closure) }, + { be_const_key_weak(tag_sub, 2), be_const_var(5) }, + { be_const_key_weak(set_contextspecific, -1), be_const_closure(Matter_TLV_item_set_contextspecific_closure) }, + })), + be_str_weak(Matter_TLV_item) +); +/*******************************************************************/ + +void be_load_Matter_TLV_item_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_TLV_item); + be_setglobal(vm, "Matter_TLV_item"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_TLV_list; + +/******************************************************************** +** Solidified function: add_struct +********************************************************************/ +be_local_closure(Matter_TLV_list_add_struct, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(TLV), + /* K1 */ be_nested_str_weak(Matter_TLV_struct), + /* K2 */ be_nested_str_weak(tag_sub), + /* K3 */ be_nested_str_weak(val), + /* K4 */ be_nested_str_weak(push), + }), + be_str_weak(add_struct), + &be_const_str_solidified, + ( &(const binstruction[10]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x5C100000, // 0002 MOVE R4 R0 + 0x7C080400, // 0003 CALL R2 2 + 0x900A0401, // 0004 SETMBR R2 K2 R1 + 0x880C0103, // 0005 GETMBR R3 R0 K3 + 0x8C0C0704, // 0006 GETMET R3 R3 K4 + 0x5C140400, // 0007 MOVE R5 R2 + 0x7C0C0400, // 0008 CALL R3 2 + 0x80040400, // 0009 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: _encode_inner +********************************************************************/ +be_local_closure(Matter_TLV_list__encode_inner, /* name */ + be_nested_proto( + 9, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str_weak(_encode_tag), + /* K1 */ be_nested_str_weak(val), + /* K2 */ be_nested_str_weak(copy), + /* K3 */ be_nested_str_weak(sort), + /* K4 */ be_nested_str_weak(encode), + /* K5 */ be_nested_str_weak(stop_iteration), + /* K6 */ be_nested_str_weak(add), + /* K7 */ be_nested_str_weak(TLV), + /* K8 */ be_nested_str_weak(EOC), + /* K9 */ be_const_int(1), + }), + be_str_weak(_encode_inner), + &be_const_str_solidified, + ( &(const binstruction[35]) { /* code */ + 0x4C0C0000, // 0000 LDNIL R3 + 0x1C0C0203, // 0001 EQ R3 R1 R3 + 0x780E0002, // 0002 JMPF R3 #0006 + 0x600C0015, // 0003 GETGBL R3 G21 + 0x7C0C0000, // 0004 CALL R3 0 + 0x5C040600, // 0005 MOVE R1 R3 + 0x8C0C0100, // 0006 GETMET R3 R0 K0 + 0x5C140200, // 0007 MOVE R5 R1 + 0x7C0C0400, // 0008 CALL R3 2 + 0x880C0101, // 0009 GETMBR R3 R0 K1 + 0x8C0C0702, // 000A GETMET R3 R3 K2 + 0x7C0C0200, // 000B CALL R3 1 + 0x780A0002, // 000C JMPF R2 #0010 + 0x8C100103, // 000D GETMET R4 R0 K3 + 0x5C180600, // 000E MOVE R6 R3 + 0x7C100400, // 000F CALL R4 2 + 0x60100010, // 0010 GETGBL R4 G16 + 0x5C140600, // 0011 MOVE R5 R3 + 0x7C100200, // 0012 CALL R4 1 + 0xA8020005, // 0013 EXBLK 0 #001A + 0x5C140800, // 0014 MOVE R5 R4 + 0x7C140000, // 0015 CALL R5 0 + 0x8C180B04, // 0016 GETMET R6 R5 K4 + 0x5C200200, // 0017 MOVE R8 R1 + 0x7C180400, // 0018 CALL R6 2 + 0x7001FFF9, // 0019 JMP #0014 + 0x58100005, // 001A LDCONST R4 K5 + 0xAC100200, // 001B CATCH R4 1 0 + 0xB0080000, // 001C RAISE 2 R0 R0 + 0x8C100306, // 001D GETMET R4 R1 K6 + 0x88180107, // 001E GETMBR R6 R0 K7 + 0x88180D08, // 001F GETMBR R6 R6 K8 + 0x581C0009, // 0020 LDCONST R7 K9 + 0x7C100600, // 0021 CALL R4 3 + 0x80040200, // 0022 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_array +********************************************************************/ +be_local_closure(Matter_TLV_list_add_array, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(TLV), + /* K1 */ be_nested_str_weak(Matter_TLV_array), + /* K2 */ be_nested_str_weak(tag_sub), + /* K3 */ be_nested_str_weak(val), + /* K4 */ be_nested_str_weak(push), + }), + be_str_weak(add_array), + &be_const_str_solidified, + ( &(const binstruction[10]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x5C100000, // 0002 MOVE R4 R0 + 0x7C080400, // 0003 CALL R2 2 + 0x900A0401, // 0004 SETMBR R2 K2 R1 + 0x880C0103, // 0005 GETMBR R3 R0 K3 + 0x8C0C0704, // 0006 GETMET R3 R3 K4 + 0x5C140400, // 0007 MOVE R5 R2 + 0x7C0C0400, // 0008 CALL R3 2 + 0x80040400, // 0009 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_TLV_list_init, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(init), + /* K1 */ be_nested_str_weak(typ), + /* K2 */ be_nested_str_weak(TLV), + /* K3 */ be_nested_str_weak(LIST), + /* K4 */ be_nested_str_weak(val), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0x60080003, // 0000 GETGBL R2 G3 + 0x5C0C0000, // 0001 MOVE R3 R0 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080500, // 0003 GETMET R2 R2 K0 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x88080102, // 0006 GETMBR R2 R0 K2 + 0x88080503, // 0007 GETMBR R2 R2 K3 + 0x90020202, // 0008 SETMBR R0 K1 R2 + 0x60080012, // 0009 GETGBL R2 G18 + 0x7C080000, // 000A CALL R2 0 + 0x90020802, // 000B SETMBR R0 K4 R2 + 0x80000000, // 000C RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: size +********************************************************************/ +be_local_closure(Matter_TLV_list_size, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(val), + }), + be_str_weak(size), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x6004000C, // 0000 GETGBL R1 G12 + 0x88080100, // 0001 GETMBR R2 R0 K0 + 0x7C040200, // 0002 CALL R1 1 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_list +********************************************************************/ +be_local_closure(Matter_TLV_list_add_list, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(TLV), + /* K1 */ be_nested_str_weak(Matter_TLV_list), + /* K2 */ be_nested_str_weak(tag_sub), + /* K3 */ be_nested_str_weak(val), + /* K4 */ be_nested_str_weak(push), + }), + be_str_weak(add_list), + &be_const_str_solidified, + ( &(const binstruction[10]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x5C100000, // 0002 MOVE R4 R0 + 0x7C080400, // 0003 CALL R2 2 + 0x900A0401, // 0004 SETMBR R2 K2 R1 + 0x880C0103, // 0005 GETMBR R3 R0 K3 + 0x8C0C0704, // 0006 GETMET R3 R3 K4 + 0x5C140400, // 0007 MOVE R5 R2 + 0x7C0C0400, // 0008 CALL R3 2 + 0x80040400, // 0009 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: item +********************************************************************/ +be_local_closure(Matter_TLV_list_item, /* name */ + be_nested_proto( + 3, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(val), + }), + be_str_weak(item), + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x94080401, // 0001 GETIDX R2 R2 R1 + 0x80040400, // 0002 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: tostring +********************************************************************/ +be_local_closure(Matter_TLV_list_tostring, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(tostring_inner), + /* K1 */ be_nested_str_weak(_X5B_X5B), + /* K2 */ be_nested_str_weak(_X5D_X5D), + }), + be_str_weak(tostring), + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x500C0000, // 0001 LDBOOL R3 0 0 + 0x58100001, // 0002 LDCONST R4 K1 + 0x58140002, // 0003 LDCONST R5 K2 + 0x7C040800, // 0004 CALL R1 4 + 0x80040200, // 0005 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: findsub +********************************************************************/ +be_local_closure(Matter_TLV_list_findsub, /* name */ + be_nested_proto( + 6, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(val), + /* K1 */ be_nested_str_weak(tag_sub), + /* K2 */ be_nested_str_weak(stop_iteration), + }), + be_str_weak(findsub), + &be_const_str_solidified, + ( &(const binstruction[16]) { /* code */ + 0x600C0010, // 0000 GETGBL R3 G16 + 0x88100100, // 0001 GETMBR R4 R0 K0 + 0x7C0C0200, // 0002 CALL R3 1 + 0xA8020007, // 0003 EXBLK 0 #000C + 0x5C100600, // 0004 MOVE R4 R3 + 0x7C100000, // 0005 CALL R4 0 + 0x88140901, // 0006 GETMBR R5 R4 K1 + 0x1C140A01, // 0007 EQ R5 R5 R1 + 0x78160001, // 0008 JMPF R5 #000B + 0xA8040001, // 0009 EXBLK 1 1 + 0x80040800, // 000A RET 1 R4 + 0x7001FFF7, // 000B JMP #0004 + 0x580C0002, // 000C LDCONST R3 K2 + 0xAC0C0200, // 000D CATCH R3 1 0 + 0xB0080000, // 000E RAISE 2 R0 R0 + 0x80040400, // 000F RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: findsubtyp +********************************************************************/ +be_local_closure(Matter_TLV_list_findsubtyp, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(findsub), + /* K1 */ be_nested_str_weak(typ), + }), + be_str_weak(findsubtyp), + &be_const_str_solidified, + ( &(const binstruction[10]) { /* code */ + 0x8C080100, // 0000 GETMET R2 R0 K0 + 0x5C100200, // 0001 MOVE R4 R1 + 0x7C080400, // 0002 CALL R2 2 + 0x4C0C0000, // 0003 LDNIL R3 + 0x200C0403, // 0004 NE R3 R2 R3 + 0x780E0001, // 0005 JMPF R3 #0008 + 0x880C0501, // 0006 GETMBR R3 R2 K1 + 0x80040600, // 0007 RET 1 R3 + 0x4C0C0000, // 0008 LDNIL R3 + 0x80040600, // 0009 RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: tostring_inner +********************************************************************/ +be_local_closure(Matter_TLV_list_tostring_inner, /* name */ + be_nested_proto( + 10, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[20]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(), + /* K2 */ be_nested_str_weak(tag_profile), + /* K3 */ be_nested_str_weak(Matter_X3A_X3A), + /* K4 */ be_nested_str_weak(tag_number), + /* K5 */ be_nested_str_weak(format), + /* K6 */ be_nested_str_weak(0x_X2508X_X20), + /* K7 */ be_nested_str_weak(tag_vendor), + /* K8 */ be_nested_str_weak(0x_X2504X_X3A_X3A), + /* K9 */ be_nested_str_weak(0x_X2504X_X3A), + /* K10 */ be_nested_str_weak(tag_sub), + /* K11 */ be_nested_str_weak(_X25i_X20), + /* K12 */ be_const_int(0), + /* K13 */ be_nested_str_weak(_X3D_X20), + /* K14 */ be_nested_str_weak(val), + /* K15 */ be_nested_str_weak(copy), + /* K16 */ be_nested_str_weak(sort), + /* K17 */ be_nested_str_weak(concat), + /* K18 */ be_nested_str_weak(_X2C_X20), + /* K19 */ be_nested_str_weak(_X20), + }), + be_str_weak(tostring_inner), + &be_const_str_solidified, + ( &(const binstruction[83]) { /* code */ + 0xA4120000, // 0000 IMPORT R4 K0 + 0x58140001, // 0001 LDCONST R5 K1 + 0xA8020047, // 0002 EXBLK 0 #004B + 0x88180102, // 0003 GETMBR R6 R0 K2 + 0x541DFFFE, // 0004 LDINT R7 -1 + 0x1C180C07, // 0005 EQ R6 R6 R7 + 0x781A000A, // 0006 JMPF R6 #0012 + 0x00140B03, // 0007 ADD R5 R5 K3 + 0x88180104, // 0008 GETMBR R6 R0 K4 + 0x4C1C0000, // 0009 LDNIL R7 + 0x20180C07, // 000A NE R6 R6 R7 + 0x781A0004, // 000B JMPF R6 #0011 + 0x8C180905, // 000C GETMET R6 R4 K5 + 0x58200006, // 000D LDCONST R8 K6 + 0x88240104, // 000E GETMBR R9 R0 K4 + 0x7C180600, // 000F CALL R6 3 + 0x00140A06, // 0010 ADD R5 R5 R6 + 0x70020023, // 0011 JMP #0036 + 0x88180107, // 0012 GETMBR R6 R0 K7 + 0x4C1C0000, // 0013 LDNIL R7 + 0x20180C07, // 0014 NE R6 R6 R7 + 0x781A0004, // 0015 JMPF R6 #001B + 0x8C180905, // 0016 GETMET R6 R4 K5 + 0x58200008, // 0017 LDCONST R8 K8 + 0x88240107, // 0018 GETMBR R9 R0 K7 + 0x7C180600, // 0019 CALL R6 3 + 0x00140A06, // 001A ADD R5 R5 R6 + 0x88180102, // 001B GETMBR R6 R0 K2 + 0x4C1C0000, // 001C LDNIL R7 + 0x20180C07, // 001D NE R6 R6 R7 + 0x781A0004, // 001E JMPF R6 #0024 + 0x8C180905, // 001F GETMET R6 R4 K5 + 0x58200009, // 0020 LDCONST R8 K9 + 0x88240102, // 0021 GETMBR R9 R0 K2 + 0x7C180600, // 0022 CALL R6 3 + 0x00140A06, // 0023 ADD R5 R5 R6 + 0x88180104, // 0024 GETMBR R6 R0 K4 + 0x4C1C0000, // 0025 LDNIL R7 + 0x20180C07, // 0026 NE R6 R6 R7 + 0x781A0004, // 0027 JMPF R6 #002D + 0x8C180905, // 0028 GETMET R6 R4 K5 + 0x58200006, // 0029 LDCONST R8 K6 + 0x88240104, // 002A GETMBR R9 R0 K4 + 0x7C180600, // 002B CALL R6 3 + 0x00140A06, // 002C ADD R5 R5 R6 + 0x8818010A, // 002D GETMBR R6 R0 K10 + 0x4C1C0000, // 002E LDNIL R7 + 0x20180C07, // 002F NE R6 R6 R7 + 0x781A0004, // 0030 JMPF R6 #0036 + 0x8C180905, // 0031 GETMET R6 R4 K5 + 0x5820000B, // 0032 LDCONST R8 K11 + 0x8824010A, // 0033 GETMBR R9 R0 K10 + 0x7C180600, // 0034 CALL R6 3 + 0x00140A06, // 0035 ADD R5 R5 R6 + 0x6018000C, // 0036 GETGBL R6 G12 + 0x5C1C0A00, // 0037 MOVE R7 R5 + 0x7C180200, // 0038 CALL R6 1 + 0x24180D0C, // 0039 GT R6 R6 K12 + 0x781A0000, // 003A JMPF R6 #003C + 0x00140B0D, // 003B ADD R5 R5 K13 + 0x00140A02, // 003C ADD R5 R5 R2 + 0x8818010E, // 003D GETMBR R6 R0 K14 + 0x8C180D0F, // 003E GETMET R6 R6 K15 + 0x7C180200, // 003F CALL R6 1 + 0x78060002, // 0040 JMPF R1 #0044 + 0x8C1C0110, // 0041 GETMET R7 R0 K16 + 0x5C240C00, // 0042 MOVE R9 R6 + 0x7C1C0400, // 0043 CALL R7 2 + 0x8C1C0D11, // 0044 GETMET R7 R6 K17 + 0x58240012, // 0045 LDCONST R9 K18 + 0x7C1C0400, // 0046 CALL R7 2 + 0x00140A07, // 0047 ADD R5 R5 R7 + 0x00140A03, // 0048 ADD R5 R5 R3 + 0xA8040001, // 0049 EXBLK 1 1 + 0x70020006, // 004A JMP #0052 + 0xAC180002, // 004B CATCH R6 0 2 + 0x70020003, // 004C JMP #0051 + 0x00200D13, // 004D ADD R8 R6 K19 + 0x00201007, // 004E ADD R8 R8 R7 + 0x80041000, // 004F RET 1 R8 + 0x70020000, // 0050 JMP #0052 + 0xB0080000, // 0051 RAISE 2 R0 R0 + 0x80040A00, // 0052 RET 1 R5 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: findsubval +********************************************************************/ +be_local_closure(Matter_TLV_list_findsubval, /* name */ + be_nested_proto( + 6, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(findsub), + /* K1 */ be_nested_str_weak(val), + }), + be_str_weak(findsubval), + &be_const_str_solidified, + ( &(const binstruction[ 9]) { /* code */ + 0x8C0C0100, // 0000 GETMET R3 R0 K0 + 0x5C140200, // 0001 MOVE R5 R1 + 0x7C0C0400, // 0002 CALL R3 2 + 0x4C100000, // 0003 LDNIL R4 + 0x20100604, // 0004 NE R4 R3 R4 + 0x78120001, // 0005 JMPF R4 #0008 + 0x88100701, // 0006 GETMBR R4 R3 K1 + 0x80040800, // 0007 RET 1 R4 + 0x80040400, // 0008 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: parse +********************************************************************/ +be_local_closure(Matter_TLV_list_parse, /* name */ + be_nested_proto( + 8, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str_weak(TLV), + /* K1 */ be_nested_str_weak(EOC), + /* K2 */ be_nested_str_weak(parse), + /* K3 */ be_nested_str_weak(next_idx), + /* K4 */ be_nested_str_weak(val), + /* K5 */ be_nested_str_weak(push), + /* K6 */ be_const_int(1), + }), + be_str_weak(parse), + &be_const_str_solidified, + ( &(const binstruction[20]) { /* code */ + 0x940C0202, // 0000 GETIDX R3 R1 R2 + 0x88100100, // 0001 GETMBR R4 R0 K0 + 0x88100901, // 0002 GETMBR R4 R4 K1 + 0x200C0604, // 0003 NE R3 R3 R4 + 0x780E000B, // 0004 JMPF R3 #0011 + 0x880C0100, // 0005 GETMBR R3 R0 K0 + 0x8C0C0702, // 0006 GETMET R3 R3 K2 + 0x5C140200, // 0007 MOVE R5 R1 + 0x5C180400, // 0008 MOVE R6 R2 + 0x5C1C0000, // 0009 MOVE R7 R0 + 0x7C0C0800, // 000A CALL R3 4 + 0x88080703, // 000B GETMBR R2 R3 K3 + 0x88100104, // 000C GETMBR R4 R0 K4 + 0x8C100905, // 000D GETMET R4 R4 K5 + 0x5C180600, // 000E MOVE R6 R3 + 0x7C100400, // 000F CALL R4 2 + 0x7001FFEE, // 0010 JMP #0000 + 0x00080506, // 0011 ADD R2 R2 K6 + 0x90020602, // 0012 SETMBR R0 K3 R2 + 0x80040400, // 0013 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: getsubval +********************************************************************/ +be_local_closure(Matter_TLV_list_getsubval, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(getsub), + /* K1 */ be_nested_str_weak(val), + }), + be_str_weak(getsubval), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x8C080100, // 0000 GETMET R2 R0 K0 + 0x5C100200, // 0001 MOVE R4 R1 + 0x7C080400, // 0002 CALL R2 2 + 0x88080501, // 0003 GETMBR R2 R2 K1 + 0x80040400, // 0004 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_obj +********************************************************************/ +be_local_closure(Matter_TLV_list_add_obj, /* name */ + be_nested_proto( + 7, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(to_TLV), + /* K1 */ be_nested_str_weak(tag_sub), + /* K2 */ be_nested_str_weak(val), + /* K3 */ be_nested_str_weak(push), + }), + be_str_weak(add_obj), + &be_const_str_solidified, + ( &(const binstruction[11]) { /* code */ + 0x4C0C0000, // 0000 LDNIL R3 + 0x200C0403, // 0001 NE R3 R2 R3 + 0x780E0006, // 0002 JMPF R3 #000A + 0x8C0C0500, // 0003 GETMET R3 R2 K0 + 0x7C0C0200, // 0004 CALL R3 1 + 0x900E0201, // 0005 SETMBR R3 K1 R1 + 0x88100102, // 0006 GETMBR R4 R0 K2 + 0x8C100903, // 0007 GETMET R4 R4 K3 + 0x5C180600, // 0008 MOVE R6 R3 + 0x7C100400, // 0009 CALL R4 2 + 0x80040000, // 000A RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: encode +********************************************************************/ +be_local_closure(Matter_TLV_list_encode, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(_encode_inner), + }), + be_str_weak(encode), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x8C080100, // 0000 GETMET R2 R0 K0 + 0x5C100200, // 0001 MOVE R4 R1 + 0x50140000, // 0002 LDBOOL R5 0 0 + 0x7C080600, // 0003 CALL R2 3 + 0x80040400, // 0004 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: setitem +********************************************************************/ +be_local_closure(Matter_TLV_list_setitem, /* name */ + be_nested_proto( + 4, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(val), + }), + be_str_weak(setitem), + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x880C0100, // 0000 GETMBR R3 R0 K0 + 0x980C0202, // 0001 SETIDX R3 R1 R2 + 0x80000000, // 0002 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: push +********************************************************************/ +be_local_closure(Matter_TLV_list_push, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(val), + /* K1 */ be_nested_str_weak(push), + }), + be_str_weak(push), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x5C100200, // 0002 MOVE R4 R1 + 0x7C080400, // 0003 CALL R2 2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_TLV +********************************************************************/ +be_local_closure(Matter_TLV_list_add_TLV, /* name */ + be_nested_proto( + 8, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str_weak(TLV), + /* K1 */ be_nested_str_weak(Matter_TLV_item), + /* K2 */ be_nested_str_weak(tag_sub), + /* K3 */ be_nested_str_weak(typ), + /* K4 */ be_nested_str_weak(val), + /* K5 */ be_nested_str_weak(push), + }), + be_str_weak(add_TLV), + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0x4C100000, // 0000 LDNIL R4 + 0x20100604, // 0001 NE R4 R3 R4 + 0x7812000A, // 0002 JMPF R4 #000E + 0x88100100, // 0003 GETMBR R4 R0 K0 + 0x8C100901, // 0004 GETMET R4 R4 K1 + 0x5C180000, // 0005 MOVE R6 R0 + 0x7C100400, // 0006 CALL R4 2 + 0x90120401, // 0007 SETMBR R4 K2 R1 + 0x90120602, // 0008 SETMBR R4 K3 R2 + 0x90120803, // 0009 SETMBR R4 K4 R3 + 0x88140104, // 000A GETMBR R5 R0 K4 + 0x8C140B05, // 000B GETMET R5 R5 K5 + 0x5C1C0800, // 000C MOVE R7 R4 + 0x7C140400, // 000D CALL R5 2 + 0x80040000, // 000E RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: getsub +********************************************************************/ +be_local_closure(Matter_TLV_list_getsub, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(findsub), + /* K1 */ be_nested_str_weak(value_error), + /* K2 */ be_nested_str_weak(sub_X20not_X20found), + }), + be_str_weak(getsub), + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0x8C080100, // 0000 GETMET R2 R0 K0 + 0x5C100200, // 0001 MOVE R4 R1 + 0x7C080400, // 0002 CALL R2 2 + 0x4C0C0000, // 0003 LDNIL R3 + 0x1C0C0403, // 0004 EQ R3 R2 R3 + 0x780E0000, // 0005 JMPF R3 #0007 + 0xB0060302, // 0006 RAISE 1 K1 K2 + 0x80040400, // 0007 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_TLV_list +********************************************************************/ +extern const bclass be_class_Matter_TLV_item; +be_local_class(Matter_TLV_list, + 0, + &be_class_Matter_TLV_item, + be_nested_map(20, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(add_struct, -1), be_const_closure(Matter_TLV_list_add_struct_closure) }, + { be_const_key_weak(getsub, -1), be_const_closure(Matter_TLV_list_getsub_closure) }, + { be_const_key_weak(add_array, -1), be_const_closure(Matter_TLV_list_add_array_closure) }, + { be_const_key_weak(add_TLV, -1), be_const_closure(Matter_TLV_list_add_TLV_closure) }, + { be_const_key_weak(size, -1), be_const_closure(Matter_TLV_list_size_closure) }, + { be_const_key_weak(add_list, 18), be_const_closure(Matter_TLV_list_add_list_closure) }, + { be_const_key_weak(item, 13), be_const_closure(Matter_TLV_list_item_closure) }, + { be_const_key_weak(findsubval, -1), be_const_closure(Matter_TLV_list_findsubval_closure) }, + { be_const_key_weak(parse, -1), be_const_closure(Matter_TLV_list_parse_closure) }, + { be_const_key_weak(findsubtyp, 3), be_const_closure(Matter_TLV_list_findsubtyp_closure) }, + { be_const_key_weak(tostring_inner, -1), be_const_closure(Matter_TLV_list_tostring_inner_closure) }, + { be_const_key_weak(encode, 7), be_const_closure(Matter_TLV_list_encode_closure) }, + { be_const_key_weak(findsub, 8), be_const_closure(Matter_TLV_list_findsub_closure) }, + { be_const_key_weak(getsubval, -1), be_const_closure(Matter_TLV_list_getsubval_closure) }, + { be_const_key_weak(add_obj, -1), be_const_closure(Matter_TLV_list_add_obj_closure) }, + { be_const_key_weak(init, 11), be_const_closure(Matter_TLV_list_init_closure) }, + { be_const_key_weak(setitem, -1), be_const_closure(Matter_TLV_list_setitem_closure) }, + { be_const_key_weak(push, -1), be_const_closure(Matter_TLV_list_push_closure) }, + { be_const_key_weak(tostring, -1), be_const_closure(Matter_TLV_list_tostring_closure) }, + { be_const_key_weak(_encode_inner, 1), be_const_closure(Matter_TLV_list__encode_inner_closure) }, + })), + be_str_weak(Matter_TLV_list) +); +/*******************************************************************/ + +void be_load_Matter_TLV_list_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_TLV_list); + be_setglobal(vm, "Matter_TLV_list"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_TLV_struct; + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_TLV_struct_init, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(init), + /* K1 */ be_nested_str_weak(typ), + /* K2 */ be_nested_str_weak(TLV), + /* K3 */ be_nested_str_weak(STRUCT), + /* K4 */ be_nested_str_weak(val), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0x60080003, // 0000 GETGBL R2 G3 + 0x5C0C0000, // 0001 MOVE R3 R0 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080500, // 0003 GETMET R2 R2 K0 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x88080102, // 0006 GETMBR R2 R0 K2 + 0x88080503, // 0007 GETMBR R2 R2 K3 + 0x90020202, // 0008 SETMBR R0 K1 R2 + 0x60080012, // 0009 GETGBL R2 G18 + 0x7C080000, // 000A CALL R2 0 + 0x90020802, // 000B SETMBR R0 K4 R2 + 0x80000000, // 000C RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: tostring +********************************************************************/ +be_local_closure(Matter_TLV_struct_tostring, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(tostring_inner), + /* K1 */ be_nested_str_weak(_X7B), + /* K2 */ be_nested_str_weak(_X7D), + }), + be_str_weak(tostring), + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x500C0200, // 0001 LDBOOL R3 1 0 + 0x58100001, // 0002 LDCONST R4 K1 + 0x58140002, // 0003 LDCONST R5 K2 + 0x7C040800, // 0004 CALL R1 4 + 0x80040200, // 0005 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: encode +********************************************************************/ +be_local_closure(Matter_TLV_struct_encode, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(_encode_inner), + }), + be_str_weak(encode), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x8C080100, // 0000 GETMET R2 R0 K0 + 0x5C100200, // 0001 MOVE R4 R1 + 0x50140200, // 0002 LDBOOL R5 1 0 + 0x7C080600, // 0003 CALL R2 3 + 0x80040400, // 0004 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_TLV_struct +********************************************************************/ +extern const bclass be_class_Matter_TLV_list; +be_local_class(Matter_TLV_struct, + 0, + &be_class_Matter_TLV_list, + be_nested_map(3, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(init, -1), be_const_closure(Matter_TLV_struct_init_closure) }, + { be_const_key_weak(tostring, -1), be_const_closure(Matter_TLV_struct_tostring_closure) }, + { be_const_key_weak(encode, -1), be_const_closure(Matter_TLV_struct_encode_closure) }, + })), + be_str_weak(Matter_TLV_struct) +); +/*******************************************************************/ + +void be_load_Matter_TLV_struct_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_TLV_struct); + be_setglobal(vm, "Matter_TLV_struct"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_TLV_array; + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_TLV_array_init, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(init), + /* K1 */ be_nested_str_weak(typ), + /* K2 */ be_nested_str_weak(TLV), + /* K3 */ be_nested_str_weak(ARRAY), + /* K4 */ be_nested_str_weak(val), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0x60080003, // 0000 GETGBL R2 G3 + 0x5C0C0000, // 0001 MOVE R3 R0 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080500, // 0003 GETMET R2 R2 K0 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x88080102, // 0006 GETMBR R2 R0 K2 + 0x88080503, // 0007 GETMBR R2 R2 K3 + 0x90020202, // 0008 SETMBR R0 K1 R2 + 0x60080012, // 0009 GETGBL R2 G18 + 0x7C080000, // 000A CALL R2 0 + 0x90020802, // 000B SETMBR R0 K4 R2 + 0x80000000, // 000C RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: parse +********************************************************************/ +be_local_closure(Matter_TLV_array_parse, /* name */ + be_nested_proto( + 8, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[11]) { /* constants */ + /* K0 */ be_nested_str_weak(TLV), + /* K1 */ be_nested_str_weak(EOC), + /* K2 */ be_nested_str_weak(parse), + /* K3 */ be_nested_str_weak(next_idx), + /* K4 */ be_nested_str_weak(tag_vendor), + /* K5 */ be_nested_str_weak(tag_profile), + /* K6 */ be_nested_str_weak(tag_number), + /* K7 */ be_nested_str_weak(tag_sub), + /* K8 */ be_nested_str_weak(val), + /* K9 */ be_nested_str_weak(push), + /* K10 */ be_const_int(1), + }), + be_str_weak(parse), + &be_const_str_solidified, + ( &(const binstruction[28]) { /* code */ + 0x940C0202, // 0000 GETIDX R3 R1 R2 + 0x88100100, // 0001 GETMBR R4 R0 K0 + 0x88100901, // 0002 GETMBR R4 R4 K1 + 0x200C0604, // 0003 NE R3 R3 R4 + 0x780E0013, // 0004 JMPF R3 #0019 + 0x880C0100, // 0005 GETMBR R3 R0 K0 + 0x8C0C0702, // 0006 GETMET R3 R3 K2 + 0x5C140200, // 0007 MOVE R5 R1 + 0x5C180400, // 0008 MOVE R6 R2 + 0x5C1C0000, // 0009 MOVE R7 R0 + 0x7C0C0800, // 000A CALL R3 4 + 0x88080703, // 000B GETMBR R2 R3 K3 + 0x4C100000, // 000C LDNIL R4 + 0x900E0804, // 000D SETMBR R3 K4 R4 + 0x4C100000, // 000E LDNIL R4 + 0x900E0A04, // 000F SETMBR R3 K5 R4 + 0x4C100000, // 0010 LDNIL R4 + 0x900E0C04, // 0011 SETMBR R3 K6 R4 + 0x4C100000, // 0012 LDNIL R4 + 0x900E0E04, // 0013 SETMBR R3 K7 R4 + 0x88100108, // 0014 GETMBR R4 R0 K8 + 0x8C100909, // 0015 GETMET R4 R4 K9 + 0x5C180600, // 0016 MOVE R6 R3 + 0x7C100400, // 0017 CALL R4 2 + 0x7001FFE6, // 0018 JMP #0000 + 0x0008050A, // 0019 ADD R2 R2 K10 + 0x90020602, // 001A SETMBR R0 K3 R2 + 0x80040400, // 001B RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: tostring +********************************************************************/ +be_local_closure(Matter_TLV_array_tostring, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(tostring_inner), + /* K1 */ be_nested_str_weak(_X5B), + /* K2 */ be_nested_str_weak(_X5D), + }), + be_str_weak(tostring), + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x500C0000, // 0001 LDBOOL R3 0 0 + 0x58100001, // 0002 LDCONST R4 K1 + 0x58140002, // 0003 LDCONST R5 K2 + 0x7C040800, // 0004 CALL R1 4 + 0x80040200, // 0005 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_TLV_array +********************************************************************/ +extern const bclass be_class_Matter_TLV_list; +be_local_class(Matter_TLV_array, + 0, + &be_class_Matter_TLV_list, + be_nested_map(3, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(init, -1), be_const_closure(Matter_TLV_array_init_closure) }, + { be_const_key_weak(parse, 2), be_const_closure(Matter_TLV_array_parse_closure) }, + { be_const_key_weak(tostring, -1), be_const_closure(Matter_TLV_array_tostring_closure) }, + })), + be_str_weak(Matter_TLV_array) +); +/*******************************************************************/ + +void be_load_Matter_TLV_array_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_TLV_array); + be_setglobal(vm, "Matter_TLV_array"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_TLV; + +/******************************************************************** +** Solidified function: create_TLV +********************************************************************/ +be_local_closure(Matter_TLV_create_TLV, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 4, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_const_class(be_class_Matter_TLV), + /* K1 */ be_nested_str_weak(Matter_TLV_item), + /* K2 */ be_nested_str_weak(create_TLV), + }), + be_str_weak(create_TLV), + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x58080000, // 0000 LDCONST R2 K0 + 0x880C0501, // 0001 GETMBR R3 R2 K1 + 0x8C0C0702, // 0002 GETMET R3 R3 K2 + 0x5C140000, // 0003 MOVE R5 R0 + 0x5C180200, // 0004 MOVE R6 R1 + 0x7C0C0600, // 0005 CALL R3 3 + 0x80040600, // 0006 RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: parse +********************************************************************/ +be_local_closure(Matter_TLV_parse, /* name */ + be_nested_proto( + 12, /* nstack */ + 3, /* argc */ + 4, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[21]) { /* constants */ + /* K0 */ be_const_class(be_class_Matter_TLV), + /* K1 */ be_const_int(0), + /* K2 */ be_const_int(1), + /* K3 */ be_nested_str_weak(EOC), + /* K4 */ be_nested_str_weak(invalid_X20TLV_X20type_X20), + /* K5 */ be_nested_str_weak(TLV_error), + /* K6 */ be_nested_str_weak(STRUCT), + /* K7 */ be_nested_str_weak(Matter_TLV_struct), + /* K8 */ be_nested_str_weak(ARRAY), + /* K9 */ be_nested_str_weak(Matter_TLV_array), + /* K10 */ be_nested_str_weak(LIST), + /* K11 */ be_nested_str_weak(Matter_TLV_list), + /* K12 */ be_nested_str_weak(Matter_TLV_item), + /* K13 */ be_nested_str_weak(typ), + /* K14 */ be_nested_str_weak(tag_vendor), + /* K15 */ be_nested_str_weak(get), + /* K16 */ be_const_int(2), + /* K17 */ be_nested_str_weak(tag_profile), + /* K18 */ be_nested_str_weak(tag_sub), + /* K19 */ be_nested_str_weak(tag_number), + /* K20 */ be_nested_str_weak(parse), + }), + be_str_weak(parse), + &be_const_str_solidified, + ( &(const binstruction[118]) { /* code */ + 0x580C0000, // 0000 LDCONST R3 K0 + 0x5C100600, // 0001 MOVE R4 R3 + 0x4C140000, // 0002 LDNIL R5 + 0x1C140205, // 0003 EQ R5 R1 R5 + 0x78160000, // 0004 JMPF R5 #0006 + 0x58040001, // 0005 LDCONST R1 K1 + 0x94140001, // 0006 GETIDX R5 R0 R1 + 0x541A001E, // 0007 LDINT R6 31 + 0x2C140A06, // 0008 AND R5 R5 R6 + 0x94180001, // 0009 GETIDX R6 R0 R1 + 0x541E00DF, // 000A LDINT R7 224 + 0x2C180C07, // 000B AND R6 R6 R7 + 0x00040302, // 000C ADD R1 R1 K2 + 0x881C0903, // 000D GETMBR R7 R4 K3 + 0x241C0A07, // 000E GT R7 R5 R7 + 0x781E0004, // 000F JMPF R7 #0015 + 0x601C0008, // 0010 GETGBL R7 G8 + 0x5C200A00, // 0011 MOVE R8 R5 + 0x7C1C0200, // 0012 CALL R7 1 + 0x001E0807, // 0013 ADD R7 K4 R7 + 0xB0060A07, // 0014 RAISE 1 K5 R7 + 0x4C1C0000, // 0015 LDNIL R7 + 0x88200906, // 0016 GETMBR R8 R4 K6 + 0x1C200A08, // 0017 EQ R8 R5 R8 + 0x78220004, // 0018 JMPF R8 #001E + 0x8C200707, // 0019 GETMET R8 R3 K7 + 0x5C280400, // 001A MOVE R10 R2 + 0x7C200400, // 001B CALL R8 2 + 0x5C1C1000, // 001C MOVE R7 R8 + 0x70020013, // 001D JMP #0032 + 0x88200908, // 001E GETMBR R8 R4 K8 + 0x1C200A08, // 001F EQ R8 R5 R8 + 0x78220004, // 0020 JMPF R8 #0026 + 0x8C200709, // 0021 GETMET R8 R3 K9 + 0x5C280400, // 0022 MOVE R10 R2 + 0x7C200400, // 0023 CALL R8 2 + 0x5C1C1000, // 0024 MOVE R7 R8 + 0x7002000B, // 0025 JMP #0032 + 0x8820090A, // 0026 GETMBR R8 R4 K10 + 0x1C200A08, // 0027 EQ R8 R5 R8 + 0x78220004, // 0028 JMPF R8 #002E + 0x8C20070B, // 0029 GETMET R8 R3 K11 + 0x5C280400, // 002A MOVE R10 R2 + 0x7C200400, // 002B CALL R8 2 + 0x5C1C1000, // 002C MOVE R7 R8 + 0x70020003, // 002D JMP #0032 + 0x8C20070C, // 002E GETMET R8 R3 K12 + 0x5C280400, // 002F MOVE R10 R2 + 0x7C200400, // 0030 CALL R8 2 + 0x5C1C1000, // 0031 MOVE R7 R8 + 0x901E1A05, // 0032 SETMBR R7 K13 R5 + 0x542200BF, // 0033 LDINT R8 192 + 0x1C200C08, // 0034 EQ R8 R6 R8 + 0x74220002, // 0035 JMPT R8 #0039 + 0x542200DF, // 0036 LDINT R8 224 + 0x1C200C08, // 0037 EQ R8 R6 R8 + 0x7822000B, // 0038 JMPF R8 #0045 + 0x8C20010F, // 0039 GETMET R8 R0 K15 + 0x5C280200, // 003A MOVE R10 R1 + 0x582C0010, // 003B LDCONST R11 K16 + 0x7C200600, // 003C CALL R8 3 + 0x901E1C08, // 003D SETMBR R7 K14 R8 + 0x8C20010F, // 003E GETMET R8 R0 K15 + 0x00280310, // 003F ADD R10 R1 K16 + 0x582C0010, // 0040 LDCONST R11 K16 + 0x7C200600, // 0041 CALL R8 3 + 0x901E2208, // 0042 SETMBR R7 K17 R8 + 0x54220003, // 0043 LDINT R8 4 + 0x00040208, // 0044 ADD R1 R1 R8 + 0x5422003F, // 0045 LDINT R8 64 + 0x1C200C08, // 0046 EQ R8 R6 R8 + 0x74220002, // 0047 JMPT R8 #004B + 0x5422005F, // 0048 LDINT R8 96 + 0x1C200C08, // 0049 EQ R8 R6 R8 + 0x78220003, // 004A JMPF R8 #004F + 0x4C200000, // 004B LDNIL R8 + 0x901E1C08, // 004C SETMBR R7 K14 R8 + 0x5421FFFE, // 004D LDINT R8 -1 + 0x901E2208, // 004E SETMBR R7 K17 R8 + 0x1C200D01, // 004F EQ R8 R6 K1 + 0x78220000, // 0050 JMPF R8 #0052 + 0x7002001D, // 0051 JMP #0070 + 0x5422001F, // 0052 LDINT R8 32 + 0x1C200C08, // 0053 EQ R8 R6 R8 + 0x78220003, // 0054 JMPF R8 #0059 + 0x94200001, // 0055 GETIDX R8 R0 R1 + 0x901E2408, // 0056 SETMBR R7 K18 R8 + 0x00040302, // 0057 ADD R1 R1 K2 + 0x70020016, // 0058 JMP #0070 + 0x542200BF, // 0059 LDINT R8 192 + 0x1C200C08, // 005A EQ R8 R6 R8 + 0x74220005, // 005B JMPT R8 #0062 + 0x5422007F, // 005C LDINT R8 128 + 0x1C200C08, // 005D EQ R8 R6 R8 + 0x74220002, // 005E JMPT R8 #0062 + 0x5422003F, // 005F LDINT R8 64 + 0x1C200C08, // 0060 EQ R8 R6 R8 + 0x78220006, // 0061 JMPF R8 #0069 + 0x8C20010F, // 0062 GETMET R8 R0 K15 + 0x5C280200, // 0063 MOVE R10 R1 + 0x582C0010, // 0064 LDCONST R11 K16 + 0x7C200600, // 0065 CALL R8 3 + 0x901E2608, // 0066 SETMBR R7 K19 R8 + 0x00040310, // 0067 ADD R1 R1 K16 + 0x70020006, // 0068 JMP #0070 + 0x8C20010F, // 0069 GETMET R8 R0 K15 + 0x5C280200, // 006A MOVE R10 R1 + 0x542E0003, // 006B LDINT R11 4 + 0x7C200600, // 006C CALL R8 3 + 0x901E2608, // 006D SETMBR R7 K19 R8 + 0x54220003, // 006E LDINT R8 4 + 0x00040208, // 006F ADD R1 R1 R8 + 0x8C200F14, // 0070 GETMET R8 R7 K20 + 0x5C280000, // 0071 MOVE R10 R0 + 0x5C2C0200, // 0072 MOVE R11 R1 + 0x7C200600, // 0073 CALL R8 3 + 0x5C041000, // 0074 MOVE R1 R8 + 0x80040E00, // 0075 RET 1 R7 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_TLV +********************************************************************/ +be_local_class(Matter_TLV, + 0, + NULL, + be_nested_map(34, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(Matter_TLV_array, -1), be_const_class(be_class_Matter_TLV_array) }, + { be_const_key_weak(BTRUE, -1), be_const_int(9) }, + { be_const_key_weak(create_TLV, 11), be_const_static_closure(Matter_TLV_create_TLV_closure) }, + { be_const_key_weak(UTF1, -1), be_const_int(12) }, + { be_const_key_weak(STRUCT, 23), be_const_int(21) }, + { be_const_key_weak(Matter_TLV_item, 24), be_const_class(be_class_Matter_TLV_item) }, + { be_const_key_weak(UTF4, 20), be_const_int(14) }, + { be_const_key_weak(FLOAT, -1), be_const_int(10) }, + { be_const_key_weak(I2, -1), be_const_int(1) }, + { be_const_key_weak(BOOL, 16), be_const_int(8) }, + { be_const_key_weak(B1, -1), be_const_int(16) }, + { be_const_key_weak(Matter_TLV_list, 28), be_const_class(be_class_Matter_TLV_list) }, + { be_const_key_weak(I8, -1), be_const_int(3) }, + { be_const_key_weak(_len, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(25, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(1), + be_const_int(2), + be_const_int(4), + be_const_int(8), + be_const_int(1), + be_const_int(2), + be_const_int(4), + be_const_int(8), + be_const_int(0), + be_const_int(0), + be_const_int(4), + be_const_int(8), + be_const_int(4294967295), + be_const_int(4294967294), + be_const_int(4294967292), + be_const_int(4294967288), + be_const_int(4294967295), + be_const_int(4294967294), + be_const_int(4294967292), + be_const_int(4294967288), + be_const_int(0), + be_const_int(4294967197), + be_const_int(4294967197), + be_const_int(4294967197), + be_const_int(0), + })) ) } )) }, + { be_const_key_weak(_type, 19), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(25, + ( (struct bvalue*) &(const bvalue[]) { + be_nested_str_weak(i1), + be_nested_str_weak(i2), + be_nested_str_weak(i4), + be_nested_str_weak(i8), + be_nested_str_weak(u1), + be_nested_str_weak(u2), + be_nested_str_weak(u4), + be_nested_str_weak(u8), + be_nested_str_weak(bool), + be_nested_str_weak(bool), + be_nested_str_weak(float), + be_nested_str_weak(double), + be_nested_str_weak(UTF1), + be_nested_str_weak(UTF2), + be_nested_str_weak(UTF4), + be_nested_str_weak(UTF8), + be_nested_str_weak(b1), + be_nested_str_weak(b2), + be_nested_str_weak(b4), + be_nested_str_weak(b8), + be_nested_str_weak(null), + be_nested_str_weak(struct), + be_nested_str_weak(array), + be_nested_str_weak(list), + be_nested_str_weak(end), + })) ) } )) }, + { be_const_key_weak(B2, -1), be_const_int(17) }, + { be_const_key_weak(LIST, -1), be_const_int(23) }, + { be_const_key_weak(U1, -1), be_const_int(4) }, + { be_const_key_weak(NULL, 12), be_const_int(20) }, + { be_const_key_weak(EOC, 27), be_const_int(24) }, + { be_const_key_weak(U8, -1), be_const_int(7) }, + { be_const_key_weak(U4, -1), be_const_int(6) }, + { be_const_key_weak(UTF8, 21), be_const_int(15) }, + { be_const_key_weak(UTF2, -1), be_const_int(13) }, + { be_const_key_weak(B4, -1), be_const_int(18) }, + { be_const_key_weak(B8, -1), be_const_int(19) }, + { be_const_key_weak(DOUBLE, -1), be_const_int(11) }, + { be_const_key_weak(ARRAY, 31), be_const_int(22) }, + { be_const_key_weak(parse, -1), be_const_static_closure(Matter_TLV_parse_closure) }, + { be_const_key_weak(I1, -1), be_const_int(0) }, + { be_const_key_weak(U2, -1), be_const_int(5) }, + { be_const_key_weak(BFALSE, -1), be_const_int(8) }, + { be_const_key_weak(I4, 4), be_const_int(2) }, + { be_const_key_weak(Matter_TLV_struct, 0), be_const_class(be_class_Matter_TLV_struct) }, + })), + be_str_weak(Matter_TLV) +); +/*******************************************************************/ + +void be_load_Matter_TLV_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_TLV); + be_setglobal(vm, "Matter_TLV"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_UDPServer.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_UDPServer.h new file mode 100644 index 000000000..9cf11d294 --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_UDPServer.h @@ -0,0 +1,626 @@ +/* Solidification of Matter_UDPServer.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_UDPPacket_sent; + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_UDPPacket_sent_init, /* name */ + be_nested_proto( + 7, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str_weak(raw), + /* K1 */ be_nested_str_weak(addr), + /* K2 */ be_nested_str_weak(port), + /* K3 */ be_nested_str_weak(msg_id), + /* K4 */ be_nested_str_weak(retries), + /* K5 */ be_nested_str_weak(RETRIES), + /* K6 */ be_nested_str_weak(next_try), + /* K7 */ be_nested_str_weak(tasmota), + /* K8 */ be_nested_str_weak(millis), + /* K9 */ be_nested_str_weak(RETRY_MS), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x90020202, // 0001 SETMBR R0 K1 R2 + 0x90020403, // 0002 SETMBR R0 K2 R3 + 0x90020604, // 0003 SETMBR R0 K3 R4 + 0x88140105, // 0004 GETMBR R5 R0 K5 + 0x90020805, // 0005 SETMBR R0 K4 R5 + 0xB8160E00, // 0006 GETNGBL R5 K7 + 0x8C140B08, // 0007 GETMET R5 R5 K8 + 0x7C140200, // 0008 CALL R5 1 + 0x88180109, // 0009 GETMBR R6 R0 K9 + 0x00140A06, // 000A ADD R5 R5 R6 + 0x90020C05, // 000B SETMBR R0 K6 R5 + 0x80000000, // 000C RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: send +********************************************************************/ +be_local_closure(Matter_UDPPacket_sent_send, /* name */ + be_nested_proto( + 11, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[14]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(send), + /* K2 */ be_nested_str_weak(addr), + /* K3 */ be_nested_str_weak(remote_ip), + /* K4 */ be_nested_str_weak(port), + /* K5 */ be_nested_str_weak(remote_port), + /* K6 */ be_nested_str_weak(raw), + /* K7 */ be_nested_str_weak(tasmota), + /* K8 */ be_nested_str_weak(log), + /* K9 */ be_nested_str_weak(format), + /* K10 */ be_nested_str_weak(MTR_X3A_X20sending_X20packet_X20to_X20_X27_X5B_X25s_X5D_X3A_X25i_X27), + /* K11 */ be_const_int(3), + /* K12 */ be_nested_str_weak(MTR_X3A_X20failed_X20to_X20send_X20packet_X20to_X20_X27_X5B_X25s_X5D_X3A_X25i_X27), + /* K13 */ be_const_int(2), + }), + be_str_weak(send), + &be_const_str_solidified, + ( &(const binstruction[35]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x8C0C0301, // 0001 GETMET R3 R1 K1 + 0x88140102, // 0002 GETMBR R5 R0 K2 + 0x78160001, // 0003 JMPF R5 #0006 + 0x88140102, // 0004 GETMBR R5 R0 K2 + 0x70020000, // 0005 JMP #0007 + 0x88140303, // 0006 GETMBR R5 R1 K3 + 0x88180104, // 0007 GETMBR R6 R0 K4 + 0x781A0001, // 0008 JMPF R6 #000B + 0x88180104, // 0009 GETMBR R6 R0 K4 + 0x70020000, // 000A JMP #000C + 0x88180305, // 000B GETMBR R6 R1 K5 + 0x881C0106, // 000C GETMBR R7 R0 K6 + 0x7C0C0800, // 000D CALL R3 4 + 0x780E0009, // 000E JMPF R3 #0019 + 0xB8120E00, // 000F GETNGBL R4 K7 + 0x8C100908, // 0010 GETMET R4 R4 K8 + 0x8C180509, // 0011 GETMET R6 R2 K9 + 0x5820000A, // 0012 LDCONST R8 K10 + 0x88240102, // 0013 GETMBR R9 R0 K2 + 0x88280104, // 0014 GETMBR R10 R0 K4 + 0x7C180800, // 0015 CALL R6 4 + 0x581C000B, // 0016 LDCONST R7 K11 + 0x7C100600, // 0017 CALL R4 3 + 0x70020008, // 0018 JMP #0022 + 0xB8120E00, // 0019 GETNGBL R4 K7 + 0x8C100908, // 001A GETMET R4 R4 K8 + 0x8C180509, // 001B GETMET R6 R2 K9 + 0x5820000C, // 001C LDCONST R8 K12 + 0x88240102, // 001D GETMBR R9 R0 K2 + 0x88280104, // 001E GETMBR R10 R0 K4 + 0x7C180800, // 001F CALL R6 4 + 0x581C000D, // 0020 LDCONST R7 K13 + 0x7C100600, // 0021 CALL R4 3 + 0x80000000, // 0022 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_UDPPacket_sent +********************************************************************/ +be_local_class(Matter_UDPPacket_sent, + 6, + NULL, + be_nested_map(10, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(RETRY_MS, 7), be_const_int(500) }, + { be_const_key_weak(raw, 4), be_const_var(0) }, + { be_const_key_weak(next_try, 9), be_const_var(5) }, + { be_const_key_weak(retries, -1), be_const_var(4) }, + { be_const_key_weak(send, 6), be_const_closure(Matter_UDPPacket_sent_send_closure) }, + { be_const_key_weak(init, -1), be_const_closure(Matter_UDPPacket_sent_init_closure) }, + { be_const_key_weak(RETRIES, -1), be_const_int(4) }, + { be_const_key_weak(port, -1), be_const_var(2) }, + { be_const_key_weak(addr, -1), be_const_var(1) }, + { be_const_key_weak(msg_id, -1), be_const_var(3) }, + })), + be_str_weak(Matter_UDPPacket_sent) +); +/*******************************************************************/ + +void be_load_Matter_UDPPacket_sent_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_UDPPacket_sent); + be_setglobal(vm, "Matter_UDPPacket_sent"); + be_pop(vm, 1); +} + +extern const bclass be_class_Matter_UDPServer; + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_UDPServer_init, /* name */ + be_nested_proto( + 4, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(address), + /* K1 */ be_nested_str_weak(), + /* K2 */ be_nested_str_weak(port), + /* K3 */ be_nested_str_weak(listening), + /* K4 */ be_nested_str_weak(packets_sent), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[16]) { /* code */ + 0x78060001, // 0000 JMPF R1 #0003 + 0x5C0C0200, // 0001 MOVE R3 R1 + 0x70020000, // 0002 JMP #0004 + 0x580C0001, // 0003 LDCONST R3 K1 + 0x90020003, // 0004 SETMBR R0 K0 R3 + 0x780A0001, // 0005 JMPF R2 #0008 + 0x5C0C0400, // 0006 MOVE R3 R2 + 0x70020000, // 0007 JMP #0009 + 0x540E15A3, // 0008 LDINT R3 5540 + 0x90020403, // 0009 SETMBR R0 K2 R3 + 0x500C0000, // 000A LDBOOL R3 0 0 + 0x90020603, // 000B SETMBR R0 K3 R3 + 0x600C0013, // 000C GETGBL R3 G19 + 0x7C0C0000, // 000D CALL R3 0 + 0x90020803, // 000E SETMBR R0 K4 R3 + 0x80000000, // 000F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: every_second +********************************************************************/ +be_local_closure(Matter_UDPServer_every_second, /* name */ + be_nested_proto( + 1, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(every_second), + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: stop +********************************************************************/ +be_local_closure(Matter_UDPServer_stop, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(listening), + /* K1 */ be_nested_str_weak(udp_socket), + /* K2 */ be_nested_str_weak(stop), + /* K3 */ be_nested_str_weak(tasmota), + /* K4 */ be_nested_str_weak(remove_driver), + }), + be_str_weak(stop), + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x78060008, // 0001 JMPF R1 #000B + 0x88040101, // 0002 GETMBR R1 R0 K1 + 0x8C040302, // 0003 GETMET R1 R1 K2 + 0x7C040200, // 0004 CALL R1 1 + 0x50040000, // 0005 LDBOOL R1 0 0 + 0x90020001, // 0006 SETMBR R0 K0 R1 + 0xB8060600, // 0007 GETNGBL R1 K3 + 0x8C040304, // 0008 GETMET R1 R1 K4 + 0x5C0C0000, // 0009 MOVE R3 R0 + 0x7C040400, // 000A CALL R1 2 + 0x80000000, // 000B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: every_50ms +********************************************************************/ +be_local_closure(Matter_UDPServer_every_50ms, /* name */ + be_nested_proto( + 13, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[14]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str_weak(udp_socket), + /* K3 */ be_nested_str_weak(read), + /* K4 */ be_const_int(1), + /* K5 */ be_nested_str_weak(remote_ip), + /* K6 */ be_nested_str_weak(remote_port), + /* K7 */ be_nested_str_weak(tasmota), + /* K8 */ be_nested_str_weak(log), + /* K9 */ be_nested_str_weak(format), + /* K10 */ be_nested_str_weak(MTR_X3A_X20UDP_X20received_X20from_X20_X5B_X25s_X5D_X3A_X25i), + /* K11 */ be_nested_str_weak(dispatch_cb), + /* K12 */ be_nested_str_weak(MAX_PACKETS_READ), + /* K13 */ be_nested_str_weak(resend_packets), + }), + be_str_weak(every_50ms), + &be_const_str_solidified, + ( &(const binstruction[47]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x58080001, // 0001 LDCONST R2 K1 + 0x880C0102, // 0002 GETMBR R3 R0 K2 + 0x4C100000, // 0003 LDNIL R4 + 0x1C0C0604, // 0004 EQ R3 R3 R4 + 0x780E0000, // 0005 JMPF R3 #0007 + 0x80000600, // 0006 RET 0 + 0x880C0102, // 0007 GETMBR R3 R0 K2 + 0x8C0C0703, // 0008 GETMET R3 R3 K3 + 0x7C0C0200, // 0009 CALL R3 1 + 0x4C100000, // 000A LDNIL R4 + 0x20100604, // 000B NE R4 R3 R4 + 0x7812001E, // 000C JMPF R4 #002C + 0x00080504, // 000D ADD R2 R2 K4 + 0x88100102, // 000E GETMBR R4 R0 K2 + 0x88100905, // 000F GETMBR R4 R4 K5 + 0x88140102, // 0010 GETMBR R5 R0 K2 + 0x88140B06, // 0011 GETMBR R5 R5 K6 + 0xB81A0E00, // 0012 GETNGBL R6 K7 + 0x8C180D08, // 0013 GETMET R6 R6 K8 + 0x8C200309, // 0014 GETMET R8 R1 K9 + 0x5828000A, // 0015 LDCONST R10 K10 + 0x5C2C0800, // 0016 MOVE R11 R4 + 0x5C300A00, // 0017 MOVE R12 R5 + 0x7C200800, // 0018 CALL R8 4 + 0x54260003, // 0019 LDINT R9 4 + 0x7C180600, // 001A CALL R6 3 + 0x8818010B, // 001B GETMBR R6 R0 K11 + 0x781A0004, // 001C JMPF R6 #0022 + 0x8C18010B, // 001D GETMET R6 R0 K11 + 0x5C200600, // 001E MOVE R8 R3 + 0x5C240800, // 001F MOVE R9 R4 + 0x5C280A00, // 0020 MOVE R10 R5 + 0x7C180800, // 0021 CALL R6 4 + 0x8818010C, // 0022 GETMBR R6 R0 K12 + 0x14180406, // 0023 LT R6 R2 R6 + 0x781A0004, // 0024 JMPF R6 #002A + 0x88180102, // 0025 GETMBR R6 R0 K2 + 0x8C180D03, // 0026 GETMET R6 R6 K3 + 0x7C180200, // 0027 CALL R6 1 + 0x5C0C0C00, // 0028 MOVE R3 R6 + 0x70020000, // 0029 JMP #002B + 0x4C0C0000, // 002A LDNIL R3 + 0x7001FFDD, // 002B JMP #000A + 0x8C10010D, // 002C GETMET R4 R0 K13 + 0x7C100200, // 002D CALL R4 1 + 0x80000000, // 002E RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: resend_packets +********************************************************************/ +be_local_closure(Matter_UDPServer_resend_packets, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[17]) { /* constants */ + /* K0 */ be_nested_str_weak(packets_sent), + /* K1 */ be_nested_str_weak(tasmota), + /* K2 */ be_nested_str_weak(time_reached), + /* K3 */ be_nested_str_weak(next_try), + /* K4 */ be_nested_str_weak(log), + /* K5 */ be_nested_str_weak(MTR_X3A_X20resending_X20packet_X20id_X3D), + /* K6 */ be_nested_str_weak(msg_id), + /* K7 */ be_const_int(3), + /* K8 */ be_nested_str_weak(send), + /* K9 */ be_nested_str_weak(udp_socket), + /* K10 */ be_nested_str_weak(retries), + /* K11 */ be_const_int(1), + /* K12 */ be_const_int(0), + /* K13 */ be_nested_str_weak(remove), + /* K14 */ be_nested_str_weak(millis), + /* K15 */ be_nested_str_weak(RETRY_MS), + /* K16 */ be_nested_str_weak(stop_iteration), + }), + be_str_weak(resend_packets), + &be_const_str_solidified, + ( &(const binstruction[44]) { /* code */ + 0x60040010, // 0000 GETGBL R1 G16 + 0x88080100, // 0001 GETMBR R2 R0 K0 + 0x7C040200, // 0002 CALL R1 1 + 0xA8020023, // 0003 EXBLK 0 #0028 + 0x5C080200, // 0004 MOVE R2 R1 + 0x7C080000, // 0005 CALL R2 0 + 0xB80E0200, // 0006 GETNGBL R3 K1 + 0x8C0C0702, // 0007 GETMET R3 R3 K2 + 0x88140503, // 0008 GETMBR R5 R2 K3 + 0x7C0C0400, // 0009 CALL R3 2 + 0x780E001B, // 000A JMPF R3 #0027 + 0xB80E0200, // 000B GETNGBL R3 K1 + 0x8C0C0704, // 000C GETMET R3 R3 K4 + 0x60140008, // 000D GETGBL R5 G8 + 0x88180506, // 000E GETMBR R6 R2 K6 + 0x7C140200, // 000F CALL R5 1 + 0x00160A05, // 0010 ADD R5 K5 R5 + 0x58180007, // 0011 LDCONST R6 K7 + 0x7C0C0600, // 0012 CALL R3 3 + 0x8C0C0508, // 0013 GETMET R3 R2 K8 + 0x88140109, // 0014 GETMBR R5 R0 K9 + 0x7C0C0400, // 0015 CALL R3 2 + 0x880C050A, // 0016 GETMBR R3 R2 K10 + 0x040C070B, // 0017 SUB R3 R3 K11 + 0x900A1403, // 0018 SETMBR R2 K10 R3 + 0x880C050A, // 0019 GETMBR R3 R2 K10 + 0x180C070C, // 001A LE R3 R3 K12 + 0x780E0004, // 001B JMPF R3 #0021 + 0x880C0100, // 001C GETMBR R3 R0 K0 + 0x8C0C070D, // 001D GETMET R3 R3 K13 + 0x88140506, // 001E GETMBR R5 R2 K6 + 0x7C0C0400, // 001F CALL R3 2 + 0x70020005, // 0020 JMP #0027 + 0xB80E0200, // 0021 GETNGBL R3 K1 + 0x8C0C070E, // 0022 GETMET R3 R3 K14 + 0x7C0C0200, // 0023 CALL R3 1 + 0x8810050F, // 0024 GETMBR R4 R2 K15 + 0x000C0604, // 0025 ADD R3 R3 R4 + 0x900A0603, // 0026 SETMBR R2 K3 R3 + 0x7001FFDB, // 0027 JMP #0004 + 0x58040010, // 0028 LDCONST R1 K16 + 0xAC040200, // 0029 CATCH R1 1 0 + 0xB0080000, // 002A RAISE 2 R0 R0 + 0x80000000, // 002B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: start +********************************************************************/ +be_local_closure(Matter_UDPServer_start, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[11]) { /* constants */ + /* K0 */ be_nested_str_weak(listening), + /* K1 */ be_nested_str_weak(udp_socket), + /* K2 */ be_nested_str_weak(udp), + /* K3 */ be_nested_str_weak(begin), + /* K4 */ be_nested_str_weak(address), + /* K5 */ be_nested_str_weak(port), + /* K6 */ be_nested_str_weak(network_error), + /* K7 */ be_nested_str_weak(could_X20not_X20open_X20UDP_X20server), + /* K8 */ be_nested_str_weak(dispatch_cb), + /* K9 */ be_nested_str_weak(tasmota), + /* K10 */ be_nested_str_weak(add_driver), + }), + be_str_weak(start), + &be_const_str_solidified, + ( &(const binstruction[21]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x740A0011, // 0001 JMPT R2 #0014 + 0xB80A0400, // 0002 GETNGBL R2 K2 + 0x7C080000, // 0003 CALL R2 0 + 0x90020202, // 0004 SETMBR R0 K1 R2 + 0x88080101, // 0005 GETMBR R2 R0 K1 + 0x8C080503, // 0006 GETMET R2 R2 K3 + 0x88100104, // 0007 GETMBR R4 R0 K4 + 0x88140105, // 0008 GETMBR R5 R0 K5 + 0x7C080600, // 0009 CALL R2 3 + 0x5C0C0400, // 000A MOVE R3 R2 + 0x740E0000, // 000B JMPT R3 #000D + 0xB0060D07, // 000C RAISE 1 K6 K7 + 0x500C0200, // 000D LDBOOL R3 1 0 + 0x90020003, // 000E SETMBR R0 K0 R3 + 0x90021001, // 000F SETMBR R0 K8 R1 + 0xB80E1200, // 0010 GETNGBL R3 K9 + 0x8C0C070A, // 0011 GETMET R3 R3 K10 + 0x5C140000, // 0012 MOVE R5 R0 + 0x7C0C0400, // 0013 CALL R3 2 + 0x80000000, // 0014 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: send_response +********************************************************************/ +be_local_closure(Matter_UDPServer_send_response, /* name */ + be_nested_proto( + 11, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(UDPPacket_sent), + /* K2 */ be_nested_str_weak(send), + /* K3 */ be_nested_str_weak(udp_socket), + /* K4 */ be_nested_str_weak(packets_sent), + }), + be_str_weak(send_response), + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0xB8160000, // 0000 GETNGBL R5 K0 + 0x8C140B01, // 0001 GETMET R5 R5 K1 + 0x5C1C0200, // 0002 MOVE R7 R1 + 0x5C200400, // 0003 MOVE R8 R2 + 0x5C240600, // 0004 MOVE R9 R3 + 0x5C280800, // 0005 MOVE R10 R4 + 0x7C140A00, // 0006 CALL R5 5 + 0x8C180B02, // 0007 GETMET R6 R5 K2 + 0x88200103, // 0008 GETMBR R8 R0 K3 + 0x7C180400, // 0009 CALL R6 2 + 0x78120001, // 000A JMPF R4 #000D + 0x88180104, // 000B GETMBR R6 R0 K4 + 0x98180805, // 000C SETIDX R6 R4 R5 + 0x80000000, // 000D RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: packet_ack +********************************************************************/ +be_local_closure(Matter_UDPServer_packet_ack, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str_weak(packets_sent), + /* K1 */ be_nested_str_weak(contains), + /* K2 */ be_nested_str_weak(remove), + /* K3 */ be_nested_str_weak(tasmota), + /* K4 */ be_nested_str_weak(log), + /* K5 */ be_nested_str_weak(MTR_X3A_X20removed_X20packet_X20from_X20sending_X20list_X20id_X3D), + /* K6 */ be_const_int(3), + }), + be_str_weak(packet_ack), + &be_const_str_solidified, + ( &(const binstruction[22]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0000, // 0002 JMPF R2 #0004 + 0x80000400, // 0003 RET 0 + 0x88080100, // 0004 GETMBR R2 R0 K0 + 0x8C080501, // 0005 GETMET R2 R2 K1 + 0x5C100200, // 0006 MOVE R4 R1 + 0x7C080400, // 0007 CALL R2 2 + 0x780A000B, // 0008 JMPF R2 #0015 + 0x88080100, // 0009 GETMBR R2 R0 K0 + 0x8C080502, // 000A GETMET R2 R2 K2 + 0x5C100200, // 000B MOVE R4 R1 + 0x7C080400, // 000C CALL R2 2 + 0xB80A0600, // 000D GETNGBL R2 K3 + 0x8C080504, // 000E GETMET R2 R2 K4 + 0x60100008, // 000F GETGBL R4 G8 + 0x5C140200, // 0010 MOVE R5 R1 + 0x7C100200, // 0011 CALL R4 1 + 0x00120A04, // 0012 ADD R4 K5 R4 + 0x58140006, // 0013 LDCONST R5 K6 + 0x7C080600, // 0014 CALL R2 3 + 0x80000000, // 0015 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_UDPServer +********************************************************************/ +be_local_class(Matter_UDPServer, + 6, + NULL, + be_nested_map(15, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(init, 1), be_const_closure(Matter_UDPServer_init_closure) }, + { be_const_key_weak(every_second, -1), be_const_closure(Matter_UDPServer_every_second_closure) }, + { be_const_key_weak(stop, -1), be_const_closure(Matter_UDPServer_stop_closure) }, + { be_const_key_weak(udp_socket, -1), be_const_var(3) }, + { be_const_key_weak(address, -1), be_const_var(0) }, + { be_const_key_weak(dispatch_cb, -1), be_const_var(4) }, + { be_const_key_weak(packet_ack, 7), be_const_closure(Matter_UDPServer_packet_ack_closure) }, + { be_const_key_weak(MAX_PACKETS_READ, 13), be_const_int(4) }, + { be_const_key_weak(every_50ms, 6), be_const_closure(Matter_UDPServer_every_50ms_closure) }, + { be_const_key_weak(listening, -1), be_const_var(2) }, + { be_const_key_weak(port, -1), be_const_var(1) }, + { be_const_key_weak(start, -1), be_const_closure(Matter_UDPServer_start_closure) }, + { be_const_key_weak(send_response, -1), be_const_closure(Matter_UDPServer_send_response_closure) }, + { be_const_key_weak(resend_packets, -1), be_const_closure(Matter_UDPServer_resend_packets_closure) }, + { be_const_key_weak(packets_sent, -1), be_const_var(5) }, + })), + be_str_weak(Matter_UDPServer) +); +/*******************************************************************/ + +void be_load_Matter_UDPServer_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_UDPServer); + be_setglobal(vm, "Matter_UDPServer"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_UI.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_UI.h new file mode 100644 index 000000000..0eaee343f --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_UI.h @@ -0,0 +1,893 @@ +/* Solidification of Matter_UI.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_UI; + +/******************************************************************** +** Solidified function: show_commissioning_info +********************************************************************/ +be_local_closure(Matter_UI_show_commissioning_info, /* name */ + be_nested_proto( + 12, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[24]) { /* constants */ + /* K0 */ be_nested_str_weak(webserver), + /* K1 */ be_nested_str_weak(string), + /* K2 */ be_nested_str_weak(content_send), + /* K3 */ be_nested_str_weak(_X3Cfieldset_X3E_X3Clegend_X3E_X3Cb_X3E_X26nbsp_X3BMatter_X20Passcode_X26nbsp_X3B_X3C_X2Fb_X3E_X3C_X2Flegend_X3E_X3Cp_X3E_X3C_X2Fp_X3E), + /* K4 */ be_nested_str_weak(device), + /* K5 */ be_nested_str_weak(compute_manual_pairing_code), + /* K6 */ be_nested_str_weak(format), + /* K7 */ be_nested_str_weak(_X3Cp_X3EManual_X20pairing_X20code_X3A_X3Cbr_X3E_X3Cb_X3E_X25s_X2D_X25s_X2D_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E_X3Chr_X3E), + /* K8 */ be_const_int(0), + /* K9 */ be_const_int(3), + /* K10 */ be_const_int(2147483647), + /* K11 */ be_nested_str_weak(compute_qrcode_content), + /* K12 */ be_nested_str_weak(_X3Cdiv_X20id_X3D_X22qrcode_X22_X3E_X3C_X2Fdiv_X3E), + /* K13 */ be_nested_str_weak(_X3Cscript_X20type_X3D_X22text_X2Fjavascript_X22_X3E_X20new_X20QRCode_X28document_X2EgetElementById_X28_X22qrcode_X22_X29_X2C_X20_X22_X25s_X22_X29_X3B_X3C_X2Fscript_X3E), + /* K14 */ be_nested_str_weak(_X3Cp_X3E_X25s_X3C_X2Fp_X3E_X3Chr_X3E), + /* K15 */ be_nested_str_weak(_X3Cform_X20action_X3D_X27_X2Fmatterc_X27_X20method_X3D_X27post_X27_X20_X3E), + /* K16 */ be_nested_str_weak(_X3Cp_X3EPasscode_X3A_X3C_X2Fp_X3E), + /* K17 */ be_nested_str_weak(_X3Cinput_X20type_X3D_X27number_X27_X20min_X3D_X271_X27_X20max_X3D_X2799999998_X27_X20name_X3D_X27passcode_X27_X20value_X3D_X27_X25i_X27_X3E), + /* K18 */ be_nested_str_weak(passcode), + /* K19 */ be_nested_str_weak(_X3Cp_X3EDistinguish_X20id_X3A_X3C_X2Fp_X3E), + /* K20 */ be_nested_str_weak(_X3Cinput_X20type_X3D_X27number_X27_X20min_X3D_X270_X27_X20max_X3D_X272047_X27_X20name_X3D_X27discriminator_X27_X20value_X3D_X27_X25i_X27_X3E), + /* K21 */ be_nested_str_weak(discriminator), + /* K22 */ be_nested_str_weak(_X3Cp_X3E_X3C_X2Fp_X3E_X3Cbutton_X20name_X3D_X27passcode_X27_X20class_X3D_X27button_X20bgrn_X27_X3EChange_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E), + /* K23 */ be_nested_str_weak(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E), + }), + be_str_weak(show_commissioning_info), + &be_const_str_solidified, + ( &(const binstruction[70]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0x8C0C0302, // 0002 GETMET R3 R1 K2 + 0x58140003, // 0003 LDCONST R5 K3 + 0x7C0C0400, // 0004 CALL R3 2 + 0x880C0104, // 0005 GETMBR R3 R0 K4 + 0x8C0C0705, // 0006 GETMET R3 R3 K5 + 0x7C0C0200, // 0007 CALL R3 1 + 0x8C100302, // 0008 GETMET R4 R1 K2 + 0x8C180506, // 0009 GETMET R6 R2 K6 + 0x58200007, // 000A LDCONST R8 K7 + 0x40261109, // 000B CONNECT R9 K8 K9 + 0x94240609, // 000C GETIDX R9 R3 R9 + 0x542A0003, // 000D LDINT R10 4 + 0x542E0005, // 000E LDINT R11 6 + 0x4028140B, // 000F CONNECT R10 R10 R11 + 0x9428060A, // 0010 GETIDX R10 R3 R10 + 0x542E0006, // 0011 LDINT R11 7 + 0x402C170A, // 0012 CONNECT R11 R11 K10 + 0x942C060B, // 0013 GETIDX R11 R3 R11 + 0x7C180A00, // 0014 CALL R6 5 + 0x7C100400, // 0015 CALL R4 2 + 0x88100104, // 0016 GETMBR R4 R0 K4 + 0x8C10090B, // 0017 GETMET R4 R4 K11 + 0x7C100200, // 0018 CALL R4 1 + 0x8C140302, // 0019 GETMET R5 R1 K2 + 0x581C000C, // 001A LDCONST R7 K12 + 0x7C140400, // 001B CALL R5 2 + 0x8C140302, // 001C GETMET R5 R1 K2 + 0x8C1C0506, // 001D GETMET R7 R2 K6 + 0x5824000D, // 001E LDCONST R9 K13 + 0x5C280800, // 001F MOVE R10 R4 + 0x7C1C0600, // 0020 CALL R7 3 + 0x7C140400, // 0021 CALL R5 2 + 0x8C140302, // 0022 GETMET R5 R1 K2 + 0x8C1C0506, // 0023 GETMET R7 R2 K6 + 0x5824000E, // 0024 LDCONST R9 K14 + 0x5C280800, // 0025 MOVE R10 R4 + 0x7C1C0600, // 0026 CALL R7 3 + 0x7C140400, // 0027 CALL R5 2 + 0x8C140302, // 0028 GETMET R5 R1 K2 + 0x581C000F, // 0029 LDCONST R7 K15 + 0x7C140400, // 002A CALL R5 2 + 0x8C140302, // 002B GETMET R5 R1 K2 + 0x581C0010, // 002C LDCONST R7 K16 + 0x7C140400, // 002D CALL R5 2 + 0x8C140302, // 002E GETMET R5 R1 K2 + 0x8C1C0506, // 002F GETMET R7 R2 K6 + 0x58240011, // 0030 LDCONST R9 K17 + 0x88280104, // 0031 GETMBR R10 R0 K4 + 0x88281512, // 0032 GETMBR R10 R10 K18 + 0x7C1C0600, // 0033 CALL R7 3 + 0x7C140400, // 0034 CALL R5 2 + 0x8C140302, // 0035 GETMET R5 R1 K2 + 0x581C0013, // 0036 LDCONST R7 K19 + 0x7C140400, // 0037 CALL R5 2 + 0x8C140302, // 0038 GETMET R5 R1 K2 + 0x8C1C0506, // 0039 GETMET R7 R2 K6 + 0x58240014, // 003A LDCONST R9 K20 + 0x88280104, // 003B GETMBR R10 R0 K4 + 0x88281515, // 003C GETMBR R10 R10 K21 + 0x7C1C0600, // 003D CALL R7 3 + 0x7C140400, // 003E CALL R5 2 + 0x8C140302, // 003F GETMET R5 R1 K2 + 0x581C0016, // 0040 LDCONST R7 K22 + 0x7C140400, // 0041 CALL R5 2 + 0x8C140302, // 0042 GETMET R5 R1 K2 + 0x581C0017, // 0043 LDCONST R7 K23 + 0x7C140400, // 0044 CALL R5 2 + 0x80000000, // 0045 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: web_add_handler +********************************************************************/ +be_local_closure(Matter_UI_web_add_handler, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 3]) { + be_nested_proto( + 2, /* nstack */ + 0, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 1]) { /* upvals */ + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(page_part_mgr), + }), + be_str_weak(_X3Clambda_X3E), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x68000000, // 0000 GETUPV R0 U0 + 0x8C000100, // 0001 GETMET R0 R0 K0 + 0x7C000200, // 0002 CALL R0 1 + 0x80040000, // 0003 RET 1 R0 + }) + ), + be_nested_proto( + 2, /* nstack */ + 0, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 1]) { /* upvals */ + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(page_part_ctl), + }), + be_str_weak(_X3Clambda_X3E), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x68000000, // 0000 GETUPV R0 U0 + 0x8C000100, // 0001 GETMET R0 R0 K0 + 0x7C000200, // 0002 CALL R0 1 + 0x80040000, // 0003 RET 1 R0 + }) + ), + be_nested_proto( + 2, /* nstack */ + 0, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 1]) { /* upvals */ + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(page_qrcode_min_js), + }), + be_str_weak(_X3Clambda_X3E), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x68000000, // 0000 GETUPV R0 U0 + 0x8C000100, // 0001 GETMET R0 R0 K0 + 0x7C000200, // 0002 CALL R0 1 + 0x80040000, // 0003 RET 1 R0 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str_weak(webserver), + /* K1 */ be_nested_str_weak(on), + /* K2 */ be_nested_str_weak(_X2Fmatterc), + /* K3 */ be_nested_str_weak(HTTP_GET), + /* K4 */ be_nested_str_weak(HTTP_POST), + /* K5 */ be_nested_str_weak(_X2Fqrcode_X2Emin_X2Ejs), + }), + be_str_weak(web_add_handler), + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080301, // 0001 GETMET R2 R1 K1 + 0x58100002, // 0002 LDCONST R4 K2 + 0x84140000, // 0003 CLOSURE R5 P0 + 0x88180303, // 0004 GETMBR R6 R1 K3 + 0x7C080800, // 0005 CALL R2 4 + 0x8C080301, // 0006 GETMET R2 R1 K1 + 0x58100002, // 0007 LDCONST R4 K2 + 0x84140001, // 0008 CLOSURE R5 P1 + 0x88180304, // 0009 GETMBR R6 R1 K4 + 0x7C080800, // 000A CALL R2 4 + 0x8C080301, // 000B GETMET R2 R1 K1 + 0x58100005, // 000C LDCONST R4 K5 + 0x84140002, // 000D CLOSURE R5 P2 + 0x88180303, // 000E GETMBR R6 R1 K3 + 0x7C080800, // 000F CALL R2 4 + 0xA0000000, // 0010 CLOSE R0 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: show_session_info +********************************************************************/ +be_local_closure(Matter_UI_show_session_info, /* name */ + be_nested_proto( + 16, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[26]) { /* constants */ + /* K0 */ be_nested_str_weak(webserver), + /* K1 */ be_nested_str_weak(string), + /* K2 */ be_nested_str_weak(content_send), + /* K3 */ be_nested_str_weak(_X3Cfieldset_X3E_X3Clegend_X3E_X3Cb_X3E_X26nbsp_X3BSessions_X26nbsp_X3B_X3C_X2Fb_X3E_X3C_X2Flegend_X3E_X3Cp_X3E_X3C_X2Fp_X3E), + /* K4 */ be_nested_str_weak(_X3Cp_X3EExisting_X20sessions_X3A_X3C_X2Fp_X3E), + /* K5 */ be_nested_str_weak(device), + /* K6 */ be_nested_str_weak(sessions), + /* K7 */ be_const_int(0), + /* K8 */ be_nested_str_weak(_X3Cp_X3E_X3Cb_X3ENone_X3C_X2Fb_X3E_X3C_X2Fp_X3E), + /* K9 */ be_nested_str_weak(fabric), + /* K10 */ be_nested_str_weak(format), + /* K11 */ be_nested_str_weak(_X3Cfieldset_X3E_X3Clegend_X3E_X3Cb_X3E_X26nbsp_X3BSession_X20_X25i_X26nbsp_X3B_X3C_X2Fb_X3E_X3C_X2Flegend_X3E_X3Cp_X3E_X3C_X2Fp_X3E), + /* K12 */ be_nested_str_weak(local_session_id), + /* K13 */ be_nested_str_weak(_X3Chr_X3E), + /* K14 */ be_nested_str_weak(copy), + /* K15 */ be_nested_str_weak(reverse), + /* K16 */ be_nested_str_weak(deviceid), + /* K17 */ be_nested_str_weak(Fabric_X3A_X20_X25s_X3Cbr_X3E), + /* K18 */ be_nested_str_weak(tohex), + /* K19 */ be_nested_str_weak(Device_X3A_X20_X25s_X3Cbr_X3E_X26nbsp_X3B), + /* K20 */ be_nested_str_weak(_X3Cform_X20action_X3D_X27_X2Fmatterc_X27_X20method_X3D_X27post_X27_X20), + /* K21 */ be_nested_str_weak(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E), + /* K22 */ be_nested_str_weak(_X3Cinput_X20name_X3D_X27del_session_X27_X20type_X3D_X27hidden_X27_X20value_X3D_X27_X25d_X27_X3E), + /* K23 */ be_nested_str_weak(_X3Cbutton_X20name_X3D_X27del_X27_X20class_X3D_X27button_X20bgrn_X27_X3EDelete_X20Session_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E), + /* K24 */ be_nested_str_weak(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E), + /* K25 */ be_const_int(1), + }), + be_str_weak(show_session_info), + &be_const_str_solidified, + ( &(const binstruction[92]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0xA40E0200, // 0001 IMPORT R3 K1 + 0x8C100502, // 0002 GETMET R4 R2 K2 + 0x58180003, // 0003 LDCONST R6 K3 + 0x7C100400, // 0004 CALL R4 2 + 0x8C100502, // 0005 GETMET R4 R2 K2 + 0x58180004, // 0006 LDCONST R6 K4 + 0x7C100400, // 0007 CALL R4 2 + 0x6010000C, // 0008 GETGBL R4 G12 + 0x88140105, // 0009 GETMBR R5 R0 K5 + 0x88140B06, // 000A GETMBR R5 R5 K6 + 0x88140B06, // 000B GETMBR R5 R5 K6 + 0x7C100200, // 000C CALL R4 1 + 0x1C100907, // 000D EQ R4 R4 K7 + 0x78120003, // 000E JMPF R4 #0013 + 0x8C100502, // 000F GETMET R4 R2 K2 + 0x58180008, // 0010 LDCONST R6 K8 + 0x7C100400, // 0011 CALL R4 2 + 0x70020044, // 0012 JMP #0058 + 0x58100007, // 0013 LDCONST R4 K7 + 0x6014000C, // 0014 GETGBL R5 G12 + 0x88180105, // 0015 GETMBR R6 R0 K5 + 0x88180D06, // 0016 GETMBR R6 R6 K6 + 0x88180D06, // 0017 GETMBR R6 R6 K6 + 0x7C140200, // 0018 CALL R5 1 + 0x14180805, // 0019 LT R6 R4 R5 + 0x781A003C, // 001A JMPF R6 #0058 + 0x88180105, // 001B GETMBR R6 R0 K5 + 0x88180D06, // 001C GETMBR R6 R6 K6 + 0x88180D06, // 001D GETMBR R6 R6 K6 + 0x94180C04, // 001E GETIDX R6 R6 R4 + 0x881C0D09, // 001F GETMBR R7 R6 K9 + 0x781E0034, // 0020 JMPF R7 #0056 + 0x8C1C0502, // 0021 GETMET R7 R2 K2 + 0x8C24070A, // 0022 GETMET R9 R3 K10 + 0x582C000B, // 0023 LDCONST R11 K11 + 0x88300D0C, // 0024 GETMBR R12 R6 K12 + 0x7C240600, // 0025 CALL R9 3 + 0x7C1C0400, // 0026 CALL R7 2 + 0x201C0907, // 0027 NE R7 R4 K7 + 0x781E0002, // 0028 JMPF R7 #002C + 0x8C1C0502, // 0029 GETMET R7 R2 K2 + 0x5824000D, // 002A LDCONST R9 K13 + 0x7C1C0400, // 002B CALL R7 2 + 0x881C0D09, // 002C GETMBR R7 R6 K9 + 0x8C1C0F0E, // 002D GETMET R7 R7 K14 + 0x7C1C0200, // 002E CALL R7 1 + 0x8C1C0F0F, // 002F GETMET R7 R7 K15 + 0x7C1C0200, // 0030 CALL R7 1 + 0x88200D10, // 0031 GETMBR R8 R6 K16 + 0x8C20110E, // 0032 GETMET R8 R8 K14 + 0x7C200200, // 0033 CALL R8 1 + 0x8C20110F, // 0034 GETMET R8 R8 K15 + 0x7C200200, // 0035 CALL R8 1 + 0x8C240502, // 0036 GETMET R9 R2 K2 + 0x8C2C070A, // 0037 GETMET R11 R3 K10 + 0x58340011, // 0038 LDCONST R13 K17 + 0x8C380F12, // 0039 GETMET R14 R7 K18 + 0x7C380200, // 003A CALL R14 1 + 0x7C2C0600, // 003B CALL R11 3 + 0x7C240400, // 003C CALL R9 2 + 0x8C240502, // 003D GETMET R9 R2 K2 + 0x8C2C070A, // 003E GETMET R11 R3 K10 + 0x58340013, // 003F LDCONST R13 K19 + 0x8C381112, // 0040 GETMET R14 R8 K18 + 0x7C380200, // 0041 CALL R14 1 + 0x7C2C0600, // 0042 CALL R11 3 + 0x7C240400, // 0043 CALL R9 2 + 0x8C240502, // 0044 GETMET R9 R2 K2 + 0x582C0014, // 0045 LDCONST R11 K20 + 0x7C240400, // 0046 CALL R9 2 + 0x8C240502, // 0047 GETMET R9 R2 K2 + 0x582C0015, // 0048 LDCONST R11 K21 + 0x7C240400, // 0049 CALL R9 2 + 0x8C240502, // 004A GETMET R9 R2 K2 + 0x8C2C070A, // 004B GETMET R11 R3 K10 + 0x58340016, // 004C LDCONST R13 K22 + 0x88380D0C, // 004D GETMBR R14 R6 K12 + 0x7C2C0600, // 004E CALL R11 3 + 0x7C240400, // 004F CALL R9 2 + 0x8C240502, // 0050 GETMET R9 R2 K2 + 0x582C0017, // 0051 LDCONST R11 K23 + 0x7C240400, // 0052 CALL R9 2 + 0x8C240502, // 0053 GETMET R9 R2 K2 + 0x582C0018, // 0054 LDCONST R11 K24 + 0x7C240400, // 0055 CALL R9 2 + 0x00100919, // 0056 ADD R4 R4 K25 + 0x7001FFC0, // 0057 JMP #0019 + 0x8C100502, // 0058 GETMET R4 R2 K2 + 0x58180018, // 0059 LDCONST R6 K24 + 0x7C100400, // 005A CALL R4 2 + 0x80000000, // 005B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: show_enable +********************************************************************/ +be_local_closure(Matter_UI_show_enable, /* name */ + be_nested_proto( + 11, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[20]) { /* constants */ + /* K0 */ be_nested_str_weak(webserver), + /* K1 */ be_nested_str_weak(string), + /* K2 */ be_nested_str_weak(tasmota), + /* K3 */ be_nested_str_weak(get_option), + /* K4 */ be_nested_str_weak(matter), + /* K5 */ be_nested_str_weak(MATTER_OPTION), + /* K6 */ be_nested_str_weak(content_send), + /* K7 */ be_nested_str_weak(format), + /* K8 */ be_nested_str_weak(_X3Cfieldset_X3E_X3Clegend_X3E_X3Cb_X3E_X26nbsp_X3BMatter_X20_X25s_X26nbsp_X3B_X3C_X2Fb_X3E_X3C_X2Flegend_X3E_X3Cp_X3E_X3C_X2Fp_X3E), + /* K9 */ be_nested_str_weak(Enabled), + /* K10 */ be_nested_str_weak(Disabled), + /* K11 */ be_nested_str_weak(_X3Cp_X20style_X3D_X27width_X3A320px_X3B_X27_X3EMatter_X20support_X20is_X20experimental_X2E_X3C_X2Fp_X3E), + /* K12 */ be_nested_str_weak(_X3Cform_X20action_X3D_X27_X2Fmatterc_X27_X20method_X3D_X27post_X27_X20onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E), + /* K13 */ be_nested_str_weak(_X3Cp_X3E_X3C_X2Fp_X3E_X3Cbutton_X20name_X3D_X27_X25s_X27_X20class_X3D_X27button_X20bgrn_X27_X3E), + /* K14 */ be_nested_str_weak(disable), + /* K15 */ be_nested_str_weak(enable), + /* K16 */ be_nested_str_weak(Disable), + /* K17 */ be_nested_str_weak(Enable), + /* K18 */ be_nested_str_weak(_X20Matter_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E), + /* K19 */ be_nested_str_weak(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E), + }), + be_str_weak(show_enable), + &be_const_str_solidified, + ( &(const binstruction[44]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0xA40E0200, // 0001 IMPORT R3 K1 + 0xB8120400, // 0002 GETNGBL R4 K2 + 0x8C100903, // 0003 GETMET R4 R4 K3 + 0xB81A0800, // 0004 GETNGBL R6 K4 + 0x88180D05, // 0005 GETMBR R6 R6 K5 + 0x7C100400, // 0006 CALL R4 2 + 0x8C140506, // 0007 GETMET R5 R2 K6 + 0x8C1C0707, // 0008 GETMET R7 R3 K7 + 0x58240008, // 0009 LDCONST R9 K8 + 0x78120001, // 000A JMPF R4 #000D + 0x58280009, // 000B LDCONST R10 K9 + 0x70020000, // 000C JMP #000E + 0x5828000A, // 000D LDCONST R10 K10 + 0x7C1C0600, // 000E CALL R7 3 + 0x7C140400, // 000F CALL R5 2 + 0x8C140506, // 0010 GETMET R5 R2 K6 + 0x581C000B, // 0011 LDCONST R7 K11 + 0x7C140400, // 0012 CALL R5 2 + 0x8C140506, // 0013 GETMET R5 R2 K6 + 0x581C000C, // 0014 LDCONST R7 K12 + 0x7C140400, // 0015 CALL R5 2 + 0x8C140506, // 0016 GETMET R5 R2 K6 + 0x8C1C0707, // 0017 GETMET R7 R3 K7 + 0x5824000D, // 0018 LDCONST R9 K13 + 0x78120001, // 0019 JMPF R4 #001C + 0x5828000E, // 001A LDCONST R10 K14 + 0x70020000, // 001B JMP #001D + 0x5828000F, // 001C LDCONST R10 K15 + 0x7C1C0600, // 001D CALL R7 3 + 0x7C140400, // 001E CALL R5 2 + 0x8C140506, // 001F GETMET R5 R2 K6 + 0x78120001, // 0020 JMPF R4 #0023 + 0x581C0010, // 0021 LDCONST R7 K16 + 0x70020000, // 0022 JMP #0024 + 0x581C0011, // 0023 LDCONST R7 K17 + 0x7C140400, // 0024 CALL R5 2 + 0x8C140506, // 0025 GETMET R5 R2 K6 + 0x581C0012, // 0026 LDCONST R7 K18 + 0x7C140400, // 0027 CALL R5 2 + 0x8C140506, // 0028 GETMET R5 R2 K6 + 0x581C0013, // 0029 LDCONST R7 K19 + 0x7C140400, // 002A CALL R5 2 + 0x80040800, // 002B RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_UI_init, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(device), + /* K1 */ be_nested_str_weak(tasmota), + /* K2 */ be_nested_str_weak(add_driver), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0xB80A0200, // 0001 GETNGBL R2 K1 + 0x8C080502, // 0002 GETMET R2 R2 K2 + 0x5C100000, // 0003 MOVE R4 R0 + 0x7C080400, // 0004 CALL R2 2 + 0x80000000, // 0005 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: page_part_ctl +********************************************************************/ +be_local_closure(Matter_UI_page_part_ctl, /* name */ + be_nested_proto( + 15, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[40]) { /* constants */ + /* K0 */ be_nested_str_weak(webserver), + /* K1 */ be_nested_str_weak(check_privileged_access), + /* K2 */ be_nested_str_weak(string), + /* K3 */ be_nested_str_weak(partition_core), + /* K4 */ be_nested_str_weak(persist), + /* K5 */ be_nested_str_weak(Partition), + /* K6 */ be_nested_str_weak(has_arg), + /* K7 */ be_nested_str_weak(passcode), + /* K8 */ be_nested_str_weak(discriminator), + /* K9 */ be_nested_str_weak(device), + /* K10 */ be_nested_str_weak(arg), + /* K11 */ be_nested_str_weak(save_param), + /* K12 */ be_nested_str_weak(redirect), + /* K13 */ be_nested_str_weak(_X2F_X3Frst_X3D), + /* K14 */ be_nested_str_weak(enable), + /* K15 */ be_nested_str_weak(tasmota), + /* K16 */ be_nested_str_weak(cmd), + /* K17 */ be_nested_str_weak(SetOption), + /* K18 */ be_nested_str_weak(matter), + /* K19 */ be_nested_str_weak(MATTER_OPTION), + /* K20 */ be_nested_str_weak(_X201), + /* K21 */ be_nested_str_weak(disable), + /* K22 */ be_nested_str_weak(_X200), + /* K23 */ be_nested_str_weak(del_session), + /* K24 */ be_nested_str_weak(sessions), + /* K25 */ be_nested_str_weak(get_session_by_local_session_id), + /* K26 */ be_nested_str_weak(remove_session), + /* K27 */ be_nested_str_weak(save), + /* K28 */ be_nested_str_weak(log), + /* K29 */ be_nested_str_weak(format), + /* K30 */ be_nested_str_weak(BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s), + /* K31 */ be_const_int(2), + /* K32 */ be_nested_str_weak(content_start), + /* K33 */ be_nested_str_weak(Parameter_X20error), + /* K34 */ be_nested_str_weak(content_send_style), + /* K35 */ be_nested_str_weak(content_send), + /* K36 */ be_nested_str_weak(_X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E), + /* K37 */ be_nested_str_weak(content_button), + /* K38 */ be_nested_str_weak(BUTTON_MANAGEMENT), + /* K39 */ be_nested_str_weak(content_stop), + }), + be_str_weak(page_part_ctl), + &be_const_str_solidified, + ( &(const binstruction[144]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080301, // 0001 GETMET R2 R1 K1 + 0x7C080200, // 0002 CALL R2 1 + 0x740A0001, // 0003 JMPT R2 #0006 + 0x4C080000, // 0004 LDNIL R2 + 0x80040400, // 0005 RET 1 R2 + 0xA40A0400, // 0006 IMPORT R2 K2 + 0xA40E0600, // 0007 IMPORT R3 K3 + 0xA4120800, // 0008 IMPORT R4 K4 + 0x8C140705, // 0009 GETMET R5 R3 K5 + 0x7C140200, // 000A CALL R5 1 + 0xA8020064, // 000B EXBLK 0 #0071 + 0x8C180306, // 000C GETMET R6 R1 K6 + 0x58200007, // 000D LDCONST R8 K7 + 0x7C180400, // 000E CALL R6 2 + 0x741A0003, // 000F JMPT R6 #0014 + 0x8C180306, // 0010 GETMET R6 R1 K6 + 0x58200008, // 0011 LDCONST R8 K8 + 0x7C180400, // 0012 CALL R6 2 + 0x781A001C, // 0013 JMPF R6 #0031 + 0x8C180306, // 0014 GETMET R6 R1 K6 + 0x58200007, // 0015 LDCONST R8 K7 + 0x7C180400, // 0016 CALL R6 2 + 0x781A0006, // 0017 JMPF R6 #001F + 0x88180109, // 0018 GETMBR R6 R0 K9 + 0x601C0009, // 0019 GETGBL R7 G9 + 0x8C20030A, // 001A GETMET R8 R1 K10 + 0x58280007, // 001B LDCONST R10 K7 + 0x7C200400, // 001C CALL R8 2 + 0x7C1C0200, // 001D CALL R7 1 + 0x901A0E07, // 001E SETMBR R6 K7 R7 + 0x8C180306, // 001F GETMET R6 R1 K6 + 0x58200008, // 0020 LDCONST R8 K8 + 0x7C180400, // 0021 CALL R6 2 + 0x781A0006, // 0022 JMPF R6 #002A + 0x88180109, // 0023 GETMBR R6 R0 K9 + 0x601C0009, // 0024 GETGBL R7 G9 + 0x8C20030A, // 0025 GETMET R8 R1 K10 + 0x58280008, // 0026 LDCONST R10 K8 + 0x7C200400, // 0027 CALL R8 2 + 0x7C1C0200, // 0028 CALL R7 1 + 0x901A1007, // 0029 SETMBR R6 K8 R7 + 0x88180109, // 002A GETMBR R6 R0 K9 + 0x8C180D0B, // 002B GETMET R6 R6 K11 + 0x7C180200, // 002C CALL R6 1 + 0x8C18030C, // 002D GETMET R6 R1 K12 + 0x5820000D, // 002E LDCONST R8 K13 + 0x7C180400, // 002F CALL R6 2 + 0x7002003D, // 0030 JMP #006F + 0x8C180306, // 0031 GETMET R6 R1 K6 + 0x5820000E, // 0032 LDCONST R8 K14 + 0x7C180400, // 0033 CALL R6 2 + 0x781A000C, // 0034 JMPF R6 #0042 + 0xB81A1E00, // 0035 GETNGBL R6 K15 + 0x8C180D10, // 0036 GETMET R6 R6 K16 + 0x60200008, // 0037 GETGBL R8 G8 + 0xB8262400, // 0038 GETNGBL R9 K18 + 0x88241313, // 0039 GETMBR R9 R9 K19 + 0x7C200200, // 003A CALL R8 1 + 0x00222208, // 003B ADD R8 K17 R8 + 0x00201114, // 003C ADD R8 R8 K20 + 0x7C180400, // 003D CALL R6 2 + 0x8C18030C, // 003E GETMET R6 R1 K12 + 0x5820000D, // 003F LDCONST R8 K13 + 0x7C180400, // 0040 CALL R6 2 + 0x7002002C, // 0041 JMP #006F + 0x8C180306, // 0042 GETMET R6 R1 K6 + 0x58200015, // 0043 LDCONST R8 K21 + 0x7C180400, // 0044 CALL R6 2 + 0x781A000C, // 0045 JMPF R6 #0053 + 0xB81A1E00, // 0046 GETNGBL R6 K15 + 0x8C180D10, // 0047 GETMET R6 R6 K16 + 0x60200008, // 0048 GETGBL R8 G8 + 0xB8262400, // 0049 GETNGBL R9 K18 + 0x88241313, // 004A GETMBR R9 R9 K19 + 0x7C200200, // 004B CALL R8 1 + 0x00222208, // 004C ADD R8 K17 R8 + 0x00201116, // 004D ADD R8 R8 K22 + 0x7C180400, // 004E CALL R6 2 + 0x8C18030C, // 004F GETMET R6 R1 K12 + 0x5820000D, // 0050 LDCONST R8 K13 + 0x7C180400, // 0051 CALL R6 2 + 0x7002001B, // 0052 JMP #006F + 0x8C180306, // 0053 GETMET R6 R1 K6 + 0x58200017, // 0054 LDCONST R8 K23 + 0x7C180400, // 0055 CALL R6 2 + 0x781A0017, // 0056 JMPF R6 #006F + 0x88180109, // 0057 GETMBR R6 R0 K9 + 0x88180D18, // 0058 GETMBR R6 R6 K24 + 0x8C180D19, // 0059 GETMET R6 R6 K25 + 0x60200009, // 005A GETGBL R8 G9 + 0x8C24030A, // 005B GETMET R9 R1 K10 + 0x582C0017, // 005C LDCONST R11 K23 + 0x7C240400, // 005D CALL R9 2 + 0x7C200200, // 005E CALL R8 1 + 0x7C180400, // 005F CALL R6 2 + 0x4C1C0000, // 0060 LDNIL R7 + 0x201C0C07, // 0061 NE R7 R6 R7 + 0x781E0008, // 0062 JMPF R7 #006C + 0x881C0109, // 0063 GETMBR R7 R0 K9 + 0x881C0F18, // 0064 GETMBR R7 R7 K24 + 0x8C1C0F1A, // 0065 GETMET R7 R7 K26 + 0x5C240C00, // 0066 MOVE R9 R6 + 0x7C1C0400, // 0067 CALL R7 2 + 0x881C0109, // 0068 GETMBR R7 R0 K9 + 0x881C0F18, // 0069 GETMBR R7 R7 K24 + 0x8C1C0F1B, // 006A GETMET R7 R7 K27 + 0x7C1C0200, // 006B CALL R7 1 + 0x8C1C030C, // 006C GETMET R7 R1 K12 + 0x5824000D, // 006D LDCONST R9 K13 + 0x7C1C0400, // 006E CALL R7 2 + 0xA8040001, // 006F EXBLK 1 1 + 0x7002001D, // 0070 JMP #008F + 0xAC180002, // 0071 CATCH R6 0 2 + 0x7002001A, // 0072 JMP #008E + 0xB8221E00, // 0073 GETNGBL R8 K15 + 0x8C20111C, // 0074 GETMET R8 R8 K28 + 0x8C28051D, // 0075 GETMET R10 R2 K29 + 0x5830001E, // 0076 LDCONST R12 K30 + 0x5C340C00, // 0077 MOVE R13 R6 + 0x5C380E00, // 0078 MOVE R14 R7 + 0x7C280800, // 0079 CALL R10 4 + 0x582C001F, // 007A LDCONST R11 K31 + 0x7C200600, // 007B CALL R8 3 + 0x8C200320, // 007C GETMET R8 R1 K32 + 0x58280021, // 007D LDCONST R10 K33 + 0x7C200400, // 007E CALL R8 2 + 0x8C200322, // 007F GETMET R8 R1 K34 + 0x7C200200, // 0080 CALL R8 1 + 0x8C200323, // 0081 GETMET R8 R1 K35 + 0x8C28051D, // 0082 GETMET R10 R2 K29 + 0x58300024, // 0083 LDCONST R12 K36 + 0x5C340C00, // 0084 MOVE R13 R6 + 0x5C380E00, // 0085 MOVE R14 R7 + 0x7C280800, // 0086 CALL R10 4 + 0x7C200400, // 0087 CALL R8 2 + 0x8C200325, // 0088 GETMET R8 R1 K37 + 0x88280326, // 0089 GETMBR R10 R1 K38 + 0x7C200400, // 008A CALL R8 2 + 0x8C200327, // 008B GETMET R8 R1 K39 + 0x7C200200, // 008C CALL R8 1 + 0x70020000, // 008D JMP #008F + 0xB0080000, // 008E RAISE 2 R0 R0 + 0x80000000, // 008F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: web_add_config_button +********************************************************************/ +be_local_closure(Matter_UI_web_add_config_button, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str_weak(webserver), + /* K1 */ be_nested_str_weak(content_send), + /* K2 */ be_nested_str_weak(_X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27matterc_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E), + /* K3 */ be_nested_str_weak(matter), + /* K4 */ be_nested_str_weak(_LOGO), + /* K5 */ be_nested_str_weak(_X20Configure_X20Matter_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E), + }), + be_str_weak(web_add_config_button), + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080301, // 0001 GETMET R2 R1 K1 + 0x58100002, // 0002 LDCONST R4 K2 + 0x7C080400, // 0003 CALL R2 2 + 0x8C080301, // 0004 GETMET R2 R1 K1 + 0xB8120600, // 0005 GETNGBL R4 K3 + 0x88100904, // 0006 GETMBR R4 R4 K4 + 0x7C080400, // 0007 CALL R2 2 + 0x8C080301, // 0008 GETMET R2 R1 K1 + 0x58100005, // 0009 LDCONST R4 K5 + 0x7C080400, // 000A CALL R2 2 + 0x80000000, // 000B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: page_qrcode_min_js +********************************************************************/ +be_local_closure(Matter_UI_page_qrcode_min_js, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str_weak(webserver), + /* K1 */ be_nested_str_weak(content_open), + /* K2 */ be_nested_str_weak(text_X2Fjavascript), + /* K3 */ be_nested_str_weak(content_send), + /* K4 */ be_nested_str_weak(matter), + /* K5 */ be_nested_str_weak(_QRCODE_MINJS), + }), + be_str_weak(page_qrcode_min_js), + &be_const_str_solidified, + ( &(const binstruction[10]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080301, // 0001 GETMET R2 R1 K1 + 0x541200C7, // 0002 LDINT R4 200 + 0x58140002, // 0003 LDCONST R5 K2 + 0x7C080600, // 0004 CALL R2 3 + 0x8C080303, // 0005 GETMET R2 R1 K3 + 0xB8120800, // 0006 GETNGBL R4 K4 + 0x88100905, // 0007 GETMBR R4 R4 K5 + 0x7C080400, // 0008 CALL R2 2 + 0x80000000, // 0009 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: page_part_mgr +********************************************************************/ +be_local_closure(Matter_UI_page_part_mgr, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[14]) { /* constants */ + /* K0 */ be_nested_str_weak(webserver), + /* K1 */ be_nested_str_weak(string), + /* K2 */ be_nested_str_weak(check_privileged_access), + /* K3 */ be_nested_str_weak(content_start), + /* K4 */ be_nested_str_weak(Matter), + /* K5 */ be_nested_str_weak(content_send_style), + /* K6 */ be_nested_str_weak(content_send), + /* K7 */ be_nested_str_weak(_X3Cscript_X20type_X3D_X22text_X2Fjavascript_X22_X20src_X3D_X22qrcode_X2Emin_X2Ejs_X22_X3E_X3C_X2Fscript_X3E), + /* K8 */ be_nested_str_weak(show_enable), + /* K9 */ be_nested_str_weak(show_commissioning_info), + /* K10 */ be_nested_str_weak(show_session_info), + /* K11 */ be_nested_str_weak(content_button), + /* K12 */ be_nested_str_weak(BUTTON_CONFIGURATION), + /* K13 */ be_nested_str_weak(content_stop), + }), + be_str_weak(page_part_mgr), + &be_const_str_solidified, + ( &(const binstruction[28]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0x8C0C0302, // 0002 GETMET R3 R1 K2 + 0x7C0C0200, // 0003 CALL R3 1 + 0x740E0001, // 0004 JMPT R3 #0007 + 0x4C0C0000, // 0005 LDNIL R3 + 0x80040600, // 0006 RET 1 R3 + 0x8C0C0303, // 0007 GETMET R3 R1 K3 + 0x58140004, // 0008 LDCONST R5 K4 + 0x7C0C0400, // 0009 CALL R3 2 + 0x8C0C0305, // 000A GETMET R3 R1 K5 + 0x7C0C0200, // 000B CALL R3 1 + 0x8C0C0306, // 000C GETMET R3 R1 K6 + 0x58140007, // 000D LDCONST R5 K7 + 0x7C0C0400, // 000E CALL R3 2 + 0x8C0C0108, // 000F GETMET R3 R0 K8 + 0x7C0C0200, // 0010 CALL R3 1 + 0x780E0003, // 0011 JMPF R3 #0016 + 0x8C0C0109, // 0012 GETMET R3 R0 K9 + 0x7C0C0200, // 0013 CALL R3 1 + 0x8C0C010A, // 0014 GETMET R3 R0 K10 + 0x7C0C0200, // 0015 CALL R3 1 + 0x8C0C030B, // 0016 GETMET R3 R1 K11 + 0x8814030C, // 0017 GETMBR R5 R1 K12 + 0x7C0C0400, // 0018 CALL R3 2 + 0x8C0C030D, // 0019 GETMET R3 R1 K13 + 0x7C0C0200, // 001A CALL R3 1 + 0x80000000, // 001B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_UI +********************************************************************/ +be_local_class(Matter_UI, + 1, + NULL, + be_nested_map(10, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(init, -1), be_const_closure(Matter_UI_init_closure) }, + { be_const_key_weak(device, -1), be_const_var(0) }, + { be_const_key_weak(web_add_handler, -1), be_const_closure(Matter_UI_web_add_handler_closure) }, + { be_const_key_weak(page_part_ctl, -1), be_const_closure(Matter_UI_page_part_ctl_closure) }, + { be_const_key_weak(show_enable, -1), be_const_closure(Matter_UI_show_enable_closure) }, + { be_const_key_weak(show_commissioning_info, 7), be_const_closure(Matter_UI_show_commissioning_info_closure) }, + { be_const_key_weak(show_session_info, 3), be_const_closure(Matter_UI_show_session_info_closure) }, + { be_const_key_weak(web_add_config_button, 0), be_const_closure(Matter_UI_web_add_config_button_closure) }, + { be_const_key_weak(page_qrcode_min_js, -1), be_const_closure(Matter_UI_page_qrcode_min_js_closure) }, + { be_const_key_weak(page_part_mgr, -1), be_const_closure(Matter_UI_page_part_mgr_closure) }, + })), + be_str_weak(Matter_UI) +); +/*******************************************************************/ + +void be_load_Matter_UI_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Matter_UI); + be_setglobal(vm, "Matter_UI"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_inspect.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_inspect.h new file mode 100644 index 000000000..3c038fc3a --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_inspect.h @@ -0,0 +1,189 @@ +/* Solidification of Matter_inspect.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: sort +********************************************************************/ +be_local_closure(matter_sort, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_const_int(1), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str_weak(stop_iteration), + }), + be_str_weak(sort), + &be_const_str_solidified, + ( &(const binstruction[29]) { /* code */ + 0x60040010, // 0000 GETGBL R1 G16 + 0x6008000C, // 0001 GETGBL R2 G12 + 0x5C0C0000, // 0002 MOVE R3 R0 + 0x7C080200, // 0003 CALL R2 1 + 0x04080500, // 0004 SUB R2 R2 K0 + 0x400A0002, // 0005 CONNECT R2 K0 R2 + 0x7C040200, // 0006 CALL R1 1 + 0xA8020010, // 0007 EXBLK 0 #0019 + 0x5C080200, // 0008 MOVE R2 R1 + 0x7C080000, // 0009 CALL R2 0 + 0x940C0002, // 000A GETIDX R3 R0 R2 + 0x5C100400, // 000B MOVE R4 R2 + 0x24140901, // 000C GT R5 R4 K1 + 0x78160008, // 000D JMPF R5 #0017 + 0x04140900, // 000E SUB R5 R4 K0 + 0x94140005, // 000F GETIDX R5 R0 R5 + 0x24140A03, // 0010 GT R5 R5 R3 + 0x78160004, // 0011 JMPF R5 #0017 + 0x04140900, // 0012 SUB R5 R4 K0 + 0x94140005, // 0013 GETIDX R5 R0 R5 + 0x98000805, // 0014 SETIDX R0 R4 R5 + 0x04100900, // 0015 SUB R4 R4 K0 + 0x7001FFF4, // 0016 JMP #000C + 0x98000803, // 0017 SETIDX R0 R4 R3 + 0x7001FFEE, // 0018 JMP #0008 + 0x58040002, // 0019 LDCONST R1 K2 + 0xAC040200, // 001A CATCH R1 1 0 + 0xB0080000, // 001B RAISE 2 R0 R0 + 0x80040000, // 001C RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: inspect +********************************************************************/ +be_local_closure(matter_inspect, /* name */ + be_nested_proto( + 16, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[17]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(introspect), + /* K2 */ be_nested_str_weak(members), + /* K3 */ be_nested_str_weak(get), + /* K4 */ be_nested_str_weak(function), + /* K5 */ be_nested_str_weak(push), + /* K6 */ be_nested_str_weak(stop_iteration), + /* K7 */ be_nested_str_weak(matter), + /* K8 */ be_nested_str_weak(sort), + /* K9 */ be_nested_str_weak(format), + /* K10 */ be_nested_str_weak(_X27_X25s_X27_X3A_X20_X25s), + /* K11 */ be_nested_str_weak(_X7B), + /* K12 */ be_nested_str_weak(concat), + /* K13 */ be_nested_str_weak(_X2C_X20), + /* K14 */ be_nested_str_weak(_X7D), + /* K15 */ be_nested_str_weak(Exception_X3A), + /* K16 */ be_nested_str_weak(_X7C), + }), + be_str_weak(inspect), + &be_const_str_solidified, + ( &(const binstruction[85]) { /* code */ + 0xA8020044, // 0000 EXBLK 0 #0046 + 0xA4060000, // 0001 IMPORT R1 K0 + 0xA40A0200, // 0002 IMPORT R2 K1 + 0x600C0012, // 0003 GETGBL R3 G18 + 0x7C0C0000, // 0004 CALL R3 0 + 0x60100010, // 0005 GETGBL R4 G16 + 0x8C140502, // 0006 GETMET R5 R2 K2 + 0x5C1C0000, // 0007 MOVE R7 R0 + 0x7C140400, // 0008 CALL R5 2 + 0x7C100200, // 0009 CALL R4 1 + 0xA802000E, // 000A EXBLK 0 #001A + 0x5C140800, // 000B MOVE R5 R4 + 0x7C140000, // 000C CALL R5 0 + 0x8C180503, // 000D GETMET R6 R2 K3 + 0x5C200000, // 000E MOVE R8 R0 + 0x5C240A00, // 000F MOVE R9 R5 + 0x7C180600, // 0010 CALL R6 3 + 0x601C0004, // 0011 GETGBL R7 G4 + 0x5C200C00, // 0012 MOVE R8 R6 + 0x7C1C0200, // 0013 CALL R7 1 + 0x201C0F04, // 0014 NE R7 R7 K4 + 0x781E0002, // 0015 JMPF R7 #0019 + 0x8C1C0705, // 0016 GETMET R7 R3 K5 + 0x5C240A00, // 0017 MOVE R9 R5 + 0x7C1C0400, // 0018 CALL R7 2 + 0x7001FFF0, // 0019 JMP #000B + 0x58100006, // 001A LDCONST R4 K6 + 0xAC100200, // 001B CATCH R4 1 0 + 0xB0080000, // 001C RAISE 2 R0 R0 + 0xB8120E00, // 001D GETNGBL R4 K7 + 0x8C100908, // 001E GETMET R4 R4 K8 + 0x5C180600, // 001F MOVE R6 R3 + 0x7C100400, // 0020 CALL R4 2 + 0x5C0C0800, // 0021 MOVE R3 R4 + 0x60100012, // 0022 GETGBL R4 G18 + 0x7C100000, // 0023 CALL R4 0 + 0x60140010, // 0024 GETGBL R5 G16 + 0x5C180600, // 0025 MOVE R6 R3 + 0x7C140200, // 0026 CALL R5 1 + 0xA8020011, // 0027 EXBLK 0 #003A + 0x5C180A00, // 0028 MOVE R6 R5 + 0x7C180000, // 0029 CALL R6 0 + 0x8C1C0503, // 002A GETMET R7 R2 K3 + 0x5C240000, // 002B MOVE R9 R0 + 0x5C280C00, // 002C MOVE R10 R6 + 0x7C1C0600, // 002D CALL R7 3 + 0x8C200905, // 002E GETMET R8 R4 K5 + 0x8C280309, // 002F GETMET R10 R1 K9 + 0x5830000A, // 0030 LDCONST R12 K10 + 0x60340008, // 0031 GETGBL R13 G8 + 0x5C380C00, // 0032 MOVE R14 R6 + 0x7C340200, // 0033 CALL R13 1 + 0x60380008, // 0034 GETGBL R14 G8 + 0x5C3C0E00, // 0035 MOVE R15 R7 + 0x7C380200, // 0036 CALL R14 1 + 0x7C280800, // 0037 CALL R10 4 + 0x7C200400, // 0038 CALL R8 2 + 0x7001FFED, // 0039 JMP #0028 + 0x58140006, // 003A LDCONST R5 K6 + 0xAC140200, // 003B CATCH R5 1 0 + 0xB0080000, // 003C RAISE 2 R0 R0 + 0x8C14090C, // 003D GETMET R5 R4 K12 + 0x581C000D, // 003E LDCONST R7 K13 + 0x7C140400, // 003F CALL R5 2 + 0x00161605, // 0040 ADD R5 K11 R5 + 0x00140B0E, // 0041 ADD R5 R5 K14 + 0xA8040001, // 0042 EXBLK 1 1 + 0x80040A00, // 0043 RET 1 R5 + 0xA8040001, // 0044 EXBLK 1 1 + 0x7002000D, // 0045 JMP #0054 + 0xAC040002, // 0046 CATCH R1 0 2 + 0x7002000A, // 0047 JMP #0053 + 0x600C0008, // 0048 GETGBL R3 G8 + 0x5C100200, // 0049 MOVE R4 R1 + 0x7C0C0200, // 004A CALL R3 1 + 0x000E1E03, // 004B ADD R3 K15 R3 + 0x000C0710, // 004C ADD R3 R3 K16 + 0x60100008, // 004D GETGBL R4 G8 + 0x5C140400, // 004E MOVE R5 R2 + 0x7C100200, // 004F CALL R4 1 + 0x000C0604, // 0050 ADD R3 R3 R4 + 0x80040600, // 0051 RET 1 R3 + 0x70020000, // 0052 JMP #0054 + 0xB0080000, // 0053 RAISE 2 R0 R0 + 0x80000000, // 0054 RET 0 + }) + ) +); +/*******************************************************************/ + +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_matter.h b/lib/libesp32/berry_matter/src/solidify/solidified_matter.h new file mode 100644 index 000000000..e0e4862f0 --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_matter.h @@ -0,0 +1,7 @@ +/* Solidification of matter.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/solidify_all.be b/lib/libesp32/berry_tasmota/solidify_all.be index 7bfeae9dd..81f392870 100755 --- a/lib/libesp32/berry_tasmota/solidify_all.be +++ b/lib/libesp32/berry_tasmota/solidify_all.be @@ -14,10 +14,11 @@ import sys sys.path().push('src/embedded') # allow to import from src/embedded # globals that need to exist to make compilation succeed -var globs = "path,ctypes_bytes_dyn,tasmota,ccronexpr,gpio,light,webclient,load,MD5,lv,light_state," +var globs = "path,ctypes_bytes_dyn,tasmota,ccronexpr,gpio,light,webclient,load,MD5,lv,light_state,udp," "lv_clock,lv_clock_icon,lv_signal_arcs,lv_signal_bars,lv_wifi_arcs_icon,lv_wifi_arcs," "lv_wifi_bars_icon,lv_wifi_bars," - "_lvgl" + "_lvgl," + "int64" for g:string.split(globs, ",") global.(g) = nil diff --git a/lib/libesp32/berry_tasmota/src/embedded/autoconf_module.be b/lib/libesp32/berry_tasmota/src/embedded/autoconf_module.be index 80c3579ba..d285ee533 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/autoconf_module.be +++ b/lib/libesp32/berry_tasmota/src/embedded/autoconf_module.be @@ -138,7 +138,7 @@ autoconf_module.init = def (m) # #################################################################################################### # Init web handlers # #################################################################################################### - # Displays a "Autocong" button on the configuration page + # Displays a "Autoconf" button on the configuration page def web_add_config_button() import webserver webserver.content_send("

") diff --git a/pio-tools/gen-berry-structures.py b/pio-tools/gen-berry-structures.py index de975a8e5..923ff723b 100644 --- a/pio-tools/gen-berry-structures.py +++ b/pio-tools/gen-berry-structures.py @@ -16,6 +16,6 @@ for filePath in fileList: # print("Deleting file : ", filePath) except: print("Error while deleting file : ", filePath) -cmd = (env["PYTHONEXE"],join("tools","coc","coc"),"-o","generate","src","default",join("..","berry_tasmota","src"),join("..","berry_tasmota","src","solidify"),join("..","berry_mapping","src"),join("..","berry_int64","src"),join("..","..","libesp32_lvgl","lv_binding_berry","src"),join("..","..","libesp32_lvgl","lv_binding_berry","src","solidify"),join("..","..","libesp32_lvgl","lv_binding_berry","generate"),"-c",join("default","berry_conf.h")) +cmd = (env["PYTHONEXE"],join("tools","coc","coc"),"-o","generate","src","default",join("..","berry_tasmota","src"),join("..","berry_matter","src","solidify"),join("..","berry_matter","src"),join("..","berry_tasmota","src","solidify"),join("..","berry_mapping","src"),join("..","berry_int64","src"),join("..","..","libesp32_lvgl","lv_binding_berry","src"),join("..","..","libesp32_lvgl","lv_binding_berry","src","solidify"),join("..","..","libesp32_lvgl","lv_binding_berry","generate"),"-c",join("default","berry_conf.h")) returncode = subprocess.call(cmd, shell=False) os.chdir(CURRENT_DIR) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_7_berry_embedded.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_7_berry_embedded.ino index 33c7692a6..f9e8a3db9 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_7_berry_embedded.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_7_berry_embedded.ino @@ -88,6 +88,11 @@ const char berry_prog[] = "import debug " "import solidify " #endif + +#ifdef USE_MATTER_DEVICE + "import matter " + "global.matter_device = matter.Device() " +#endif ; #endif // USE_BERRY diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino index 7bb20821c..d6e9fabf5 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino @@ -24,6 +24,9 @@ #include #include "berry_tasmota.h" +#ifdef USE_MATTER + #include "berry_matter.h" +#endif #include "be_vm.h" #include "ZipReadFS.h" #include "ccronexpr.h"