From f1bd9446d594f561796fd9b394e22a4e15466fb2 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Sat, 9 Sep 2023 14:50:40 +0200 Subject: [PATCH] Matter events phase 1 (#19484) --- .../berry_matter/src/be_matter_module.c | 2 + .../berry_matter/src/embedded/Matter_IM.be | 7 +- .../src/embedded/Matter_Plugin.be | 26 + .../embedded/Matter_Plugin_Bridge_Light0.be | 3 + .../embedded/Matter_Plugin_Bridge_Light1.be | 5 + .../embedded/Matter_Plugin_Bridge_Light2.be | 1 + .../embedded/Matter_Plugin_Bridge_Light3.be | 3 + .../src/embedded/Matter_Plugin_Device.be | 19 +- .../src/embedded/Matter_Plugin_Light0.be | 49 +- .../src/embedded/Matter_Plugin_Light1.be | 80 +- .../src/embedded/Matter_Plugin_Light2.be | 46 +- .../src/embedded/Matter_Plugin_Light3.be | 86 +- .../src/embedded/Matter_Plugin_OnOff.be | 3 + .../src/solidify/solidified_Matter_IM.h | 723 ++++++----- .../src/solidify/solidified_Matter_Plugin.h | 1126 ++++++++++------- .../solidified_Matter_Plugin_Bridge_Light0.h | 78 +- .../solidified_Matter_Plugin_Bridge_Light1.h | 205 +-- .../solidified_Matter_Plugin_Bridge_Light2.h | 78 +- .../solidified_Matter_Plugin_Bridge_Light3.h | 209 +-- .../solidified_Matter_Plugin_Device.h | 170 +-- .../solidified_Matter_Plugin_Light0.h | 281 ++-- .../solidified_Matter_Plugin_Light1.h | 534 ++++---- .../solidified_Matter_Plugin_Light2.h | 572 +++++---- .../solidified_Matter_Plugin_Light3.h | 643 ++++++---- .../solidify/solidified_Matter_Plugin_OnOff.h | 86 +- .../berry_tasmota/src/be_cron_class.cpp | 2 +- ...attributes.c => be_zigbee_zcl_attribute.c} | 0 .../xdrv_52_3_berry_matter.ino | 94 ++ 28 files changed, 2956 insertions(+), 2175 deletions(-) rename lib/libesp32/berry_tasmota/src/{be_zigbee_zcl_attributes.c => be_zigbee_zcl_attribute.c} (100%) diff --git a/lib/libesp32/berry_matter/src/be_matter_module.c b/lib/libesp32/berry_matter/src/be_matter_module.c index 9c28d4014e65..372c5d79f26b 100644 --- a/lib/libesp32/berry_matter/src/be_matter_module.c +++ b/lib/libesp32/berry_matter/src/be_matter_module.c @@ -177,6 +177,7 @@ BE_FUNC_CTYPE_DECLARE(matter_get_command_name, "s", "ii") extern const void* matter_get_ip_bytes(const char* ip_str, size_t* ret_len); BE_FUNC_CTYPE_DECLARE(matter_get_ip_bytes, "&", "s") +extern int matter_publish_command(bvm *vm); #include "solidify/solidified_Matter_inspect.h" @@ -276,6 +277,7 @@ module matter (scope: global, strings: weak) { setmember, closure(matter_setmember_closure) member, closure(matter_member_closure) get_ip_bytes, ctype_func(matter_get_ip_bytes) + publish_command, func(matter_publish_command) get_vendor_name, ctype_func(matter_get_vendor_name) get_cluster_name, ctype_func(matter_get_cluster_name) diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_IM.be b/lib/libesp32/berry_matter/src/embedded/Matter_IM.be index 016115fc81bb..9f4c8613dced 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_IM.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_IM.be @@ -866,7 +866,7 @@ class Matter_IM var res = self.device.invoke_request(msg.session, q.command_fields, ctx) matter.profiler.log("COMMAND DONE") var params_log = (ctx.log != nil) ? "(" + str(ctx.log) + ") " : "" - tasmota.log(format("MTR: >Command (%6i) %s %s %s", msg.session.local_session_id, ctx_str, cmd_name ? cmd_name : "", params_log), ctx.endpoint != 0 ? 2 : 3 #- don't log for endpoint 0 -# ) + tasmota.log(format("MTR: >Command (%6i) %s %s %s", msg.session.local_session_id, ctx_str, cmd_name ? cmd_name : "", params_log), 3) # tasmota.log("MTR: Perf/Command = " + str(debug.counters()), 4) ctx.log = nil var raw = bytes(32) @@ -927,9 +927,8 @@ class Matter_IM var res = self.device.invoke_request(msg.session, ctx.command_fields, ctx) matter.profiler.log("COMMAND DONE") var params_log = (ctx.log != nil) ? "(" + str(ctx.log) + ") " : "" - var cmd_log_level = ctx.endpoint != 0 ? 2 : 3 #- don't log for endpoint 0 -# - if tasmota.loglevel(cmd_log_level) - tasmota.log(format("MTR: >Command1 (%6i) %s %s %s", msg.session.local_session_id, ctx_str, cmd_name ? cmd_name : "", params_log), cmd_log_level) + if tasmota.loglevel(3) + tasmota.log(format("MTR: >Command1 (%6i) %s %s %s", msg.session.local_session_id, ctx_str, cmd_name ? cmd_name : "", params_log), 3) end # tasmota.log("MTR: Perf/Command = " + str(debug.counters()), 4) ctx.log = nil diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin.be index 9a52fa6ccb61..355ad2725ce2 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin.be @@ -43,6 +43,7 @@ class Matter_Plugin var endpoint # current endpoint var clusters # map from cluster to list of attributes, typically constructed from CLUSTERS hierachy var tick # tick value when it was last updated + var node_label # name of the endpoint, used only in bridge mode, "" if none ############################################################# # MVC Model @@ -61,6 +62,7 @@ class Matter_Plugin self.endpoint = endpoint self.clusters = self.consolidate_clusters() self.parse_configuration(config) + self.node_label = config.find("name", "") end # proxy for the same method in IM @@ -146,6 +148,22 @@ class Matter_Plugin return ret end + ############################################################# + # Publish to MQTT a command received from controller + # + # we limit to 3 commands (to we need more?) + def publish_command(key1, value1, key2, value2, key3, value3) + import json + var payload = f"{json.dump(key1)}:{json.dump(value1)}" + if key2 != nil + payload = f"{payload},{json.dump(key2)}:{json.dump(value2)}" + end + if key3 != nil + payload = f"{payload},{json.dump(key3)}:{json.dump(value3)}" + end + matter.publish_command('MtrReceived', self.endpoint, self.node_label, payload) + end + ############################################################# # Which endpoints does it handle (list of numbers) def get_endpoint() @@ -184,6 +202,14 @@ class Matter_Plugin return self.clusters.contains(cluster) && self.endpoints.find(endpoint) != nil end + def set_name(n) + if n != self.node_label + self.attribute_updated(0x0039, 0x0005) + end + self.node_label = n + end + def get_name() return self.node_label end + ############################################################# # MVC Model # diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Light0.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Light0.be index c92eff4db9fe..b5c856a69881 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Light0.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Light0.be @@ -125,12 +125,15 @@ class Matter_Plugin_Bridge_Light0 : Matter_Plugin_Bridge_HTTP if cluster == 0x0006 # ========== On/Off 1.5 p.48 ========== if command == 0x0000 # ---------- Off ---------- self.set_onoff(false) + self.publish_command('Power', 0) return true elif command == 0x0001 # ---------- On ---------- self.set_onoff(true) + self.publish_command('Power', 1) return true elif command == 0x0002 # ---------- Toggle ---------- self.set_onoff(!self.shadow_onoff) + self.publish_command('Power', self.shadow_onoff ? 1 : 0) return true end end diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Light1.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Light1.be index da53e225ec99..d868dec4402a 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Light1.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Light1.be @@ -131,6 +131,8 @@ class Matter_Plugin_Bridge_Light1 : Matter_Plugin_Bridge_Light0 var bri_in = val.findsubval(0) # Hue 0..254 self.set_bri(bri_in) ctx.log = "bri:"+str(bri_in) + self.publish_command('Bri', tasmota.scale_uint(bri_in, 0, 254, 0, 255), + 'Dimmer', tasmota.scale_uint(bri_in, 0, 254, 0, 100)) return true elif command == 0x0001 # ---------- Move ---------- # TODO, we don't really support it @@ -147,6 +149,9 @@ class Matter_Plugin_Bridge_Light1 : Matter_Plugin_Bridge_Light0 var onoff = bri_in > 0 self.set_onoff(onoff) ctx.log = "bri:"+str(bri_in) + self.publish_command('Bri', tasmota.scale_uint(bri_in, 0, 254, 0, 255), + 'Dimmer', tasmota.scale_uint(bri_in, 0, 254, 0, 100), + 'Power', onoff ? 1 : 0) return true elif command == 0x0005 # ---------- MoveWithOnOff ---------- # TODO, we don't really support it diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Light2.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Light2.be index 596790042e1d..336a9037598c 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Light2.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Light2.be @@ -149,6 +149,7 @@ class Matter_Plugin_Bridge_Light2 : Matter_Plugin_Bridge_Light1 if ct_in > self.ct_max ct_in = self.ct_max end self.set_ct(ct_in) ctx.log = "ct:"+str(ct_in) + self.publish_command('CT', ct_in) return true elif command == 0x0047 # ---------- StopMoveStep ---------- # TODO, we don't really support it diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Light3.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Light3.be index 9898cfbb4dff..6d738f68dae9 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Light3.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Light3.be @@ -157,6 +157,7 @@ class Matter_Plugin_Bridge_Light3 : Matter_Plugin_Bridge_Light1 var hue_in = val.findsubval(0) # Hue 0..254 self.set_hue(hue_in) ctx.log = "hue:"+str(hue_in) + self.publish_command('Hue', hue_in) return true elif command == 0x0001 # ---------- MoveHue ---------- # TODO, we don't really support it @@ -168,6 +169,7 @@ class Matter_Plugin_Bridge_Light3 : Matter_Plugin_Bridge_Light1 var sat_in = val.findsubval(0) # Sat 0..254 self.set_sat(sat_in) ctx.log = "sat:"+str(sat_in) + self.publish_command('Sat', sat_in) return true elif command == 0x0004 # ---------- MoveSaturation ---------- # TODO, we don't really support it @@ -181,6 +183,7 @@ class Matter_Plugin_Bridge_Light3 : Matter_Plugin_Bridge_Light1 self.set_hue(hue_in) self.set_sat(sat_in) ctx.log = "hue:"+str(hue_in)+" sat:"+str(sat_in) + self.publish_command('Hue', hue_in, 'Sat', sat_in) return true elif command == 0x0047 # ---------- StopMoveStep ---------- # TODO, we don't really support it diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Device.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Device.be index 654dbd347876..bdad2e3a341e 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Device.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Device.be @@ -34,21 +34,18 @@ class Matter_Plugin_Device : Matter_Plugin } static var TYPES = { 0x0013: 1 } # fake type static var NON_BRIDGE_VENDOR = [ 0x1217, 0x1381 ] # Fabric VendorID not supporting Bridge mode - - var node_label # name of the endpoint, used only in bridge mode, "" if none - - def set_name(n) - if n != self.node_label - self.attribute_updated(0x0039, 0x0005) - end - self.node_label = n - end - def get_name() return self.node_label end + # Inherited + # var device # reference to the `device` global object + # var endpoint # current endpoint + # var clusters # map from cluster to list of attributes, typically constructed from CLUSTERS hierachy + # var tick # tick value when it was last updated + # var node_label # name of the endpoint, used only in bridge mode, "" if none + var virtual # (bool) is the device pure virtual (i.e. not related to a device implementation by Tasmota) ############################################################# # Constructor def init(device, endpoint, config) - self.node_label = config.find("name", "") + self.virtual = config.find("virtual", false) super(self).init(device, endpoint, config) end diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Light0.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Light0.be index ee6550cf0128..37a9b2e13355 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Light0.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Light0.be @@ -39,7 +39,14 @@ class Matter_Plugin_Light0 : Matter_Plugin_Device } static var TYPES = { 0x0100: 2 } # OnOff Light, but not actually used because Relay is managed by OnOff - var shadow_onoff + # Inherited + # var device # reference to the `device` global object + # var endpoint # current endpoint + # var clusters # map from cluster to list of attributes, typically constructed from CLUSTERS hierachy + # var tick # tick value when it was last updated + # var node_label # name of the endpoint, used only in bridge mode, "" if none + # var virtual # (bool) is the device pure virtual (i.e. not related to a device implementation by Tasmota) + var shadow_onoff # (bool) status of the light power on/off ############################################################# # Constructor @@ -52,15 +59,33 @@ class Matter_Plugin_Light0 : Matter_Plugin_Device # Update shadow # def update_shadow() - import light - var light_status = light.get() - if light_status != nil - var pow = light_status.find('power', nil) - if pow != self.shadow_onoff self.attribute_updated(0x0006, 0x0000) self.shadow_onoff = pow end + if !self.virtual + import light + var light_status = light.get() + if light_status != nil + var pow = light_status.find('power', nil) + if pow != self.shadow_onoff + self.attribute_updated(0x0006, 0x0000) + self.shadow_onoff = pow + end + end end super(self).update_shadow() end + def set_onoff(pow) + if !self.virtual + import light + light.set({'power':pow}) + self.update_shadow() + else + if pow != self.shadow_onoff + self.attribute_updated(0x0006, 0x0000) + self.shadow_onoff = pow + end + end + end + ############################################################# # read an attribute # @@ -100,16 +125,16 @@ class Matter_Plugin_Light0 : Matter_Plugin_Device if cluster == 0x0006 # ========== On/Off 1.5 p.48 ========== self.update_shadow_lazy() if command == 0x0000 # ---------- Off ---------- - light.set({'power':false}) - self.update_shadow() + self.set_onoff(false) + self.publish_command('Power', 0) return true elif command == 0x0001 # ---------- On ---------- - light.set({'power':true}) - self.update_shadow() + self.set_onoff(true) + self.publish_command('Power', 1) return true elif command == 0x0002 # ---------- Toggle ---------- - light.set({'power':!self.shadow_onoff}) - self.update_shadow() + self.set_onoff(!self.shadow_onoff) + self.publish_command('Power', self.shadow_onoff ? 1 : 0) return true end end diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Light1.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Light1.be index d488f00fdce7..13326447f293 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Light1.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Light1.be @@ -39,8 +39,15 @@ class Matter_Plugin_Light1 : Matter_Plugin_Light0 } static var TYPES = { 0x0101: 2 } # Dimmable Light - var shadow_bri - # var shadow_onoff # inherited + # Inherited + # var device # reference to the `device` global object + # var endpoint # current endpoint + # var clusters # map from cluster to list of attributes, typically constructed from CLUSTERS hierachy + # var tick # tick value when it was last updated + # var node_label # name of the endpoint, used only in bridge mode, "" if none + # var virtual # (bool) is the device pure virtual (i.e. not related to a device implementation by Tasmota) + # var shadow_onoff # (bool) status of the light power on/off + var shadow_bri # (int 0..254) brightness before Gamma correction - as per Matter 255 is not allowed ############################################################# # Constructor @@ -53,21 +60,52 @@ class Matter_Plugin_Light1 : Matter_Plugin_Light0 # Update shadow # def update_shadow() - import light - var light_status = light.get() - if light_status != nil - var bri = light_status.find('bri', nil) - if bri != nil - bri = tasmota.scale_uint(bri, 0, 255, 0, 254) - if bri != self.shadow_bri - self.attribute_updated(0x0008, 0x0000) - self.shadow_bri = bri + if !self.virtual + import light + var light_status = light.get() + if light_status != nil + var bri = light_status.find('bri', nil) + if bri != nil + bri = tasmota.scale_uint(bri, 0, 255, 0, 254) + if bri != self.shadow_bri + self.attribute_updated(0x0008, 0x0000) + self.shadow_bri = bri + end end end end super(self).update_shadow() # superclass manages 'power' end + ############################################################# + # Set Bri + # + # `bri` is in range 0.255 and not 0..254 like in Matter + # `pow` can be bool on `nil` if no change + def set_bri(bri_254, pow) + if (bri_254 < 0) bri_254 = 0 end + if (bri_254 > 254) bri_254 = 254 end + if !self.virtual + import light + var bri_255 = tasmota.scale_uint(bri_254, 0, 254, 0, 255) + if pow == nil + light.set({'bri': bri_255}) + else + light.set({'bri': bri_255, 'power': pow}) + end + self.update_shadow() + else + if (pow != nil) && (pow != self.shadow_onoff) + self.attribute_updated(0x0006, 0x0000) + self.shadow_onoff = pow + end + if bri_254 != self.shadow_bri + self.attribute_updated(0x0008, 0x0000) + self.shadow_bri = bri_254 + end + end + end + ############################################################# # read an attribute # @@ -115,11 +153,10 @@ class Matter_Plugin_Light1 : Matter_Plugin_Light0 if cluster == 0x0008 # ========== Level Control 1.6 p.57 ========== self.update_shadow_lazy() if command == 0x0000 # ---------- MoveToLevel ---------- - var bri_in = val.findsubval(0) # Hue 0..254 - var bri = tasmota.scale_uint(bri_in, 0, 254, 0, 255) - light.set({'bri': bri}) - self.update_shadow() - ctx.log = "bri:"+str(bri_in) + var bri_254 = val.findsubval(0) # Hue 0..254 + self.set_bri(bri_254) + ctx.log = "bri:"+str(bri_254) + self.publish_command('Bri', bri_254, 'Dimmer', tasmota.scale_uint(bri_254, 0, 254, 0, 100)) return true elif command == 0x0001 # ---------- Move ---------- # TODO, we don't really support it @@ -131,12 +168,11 @@ class Matter_Plugin_Light1 : Matter_Plugin_Light0 # TODO, we don't really support it return true elif command == 0x0004 # ---------- MoveToLevelWithOnOff ---------- - var bri_in = val.findsubval(0) # Hue 0..254 - var bri = tasmota.scale_uint(bri_in, 0, 254, 0, 255) - var onoff = bri > 0 - light.set({'bri': bri, 'power': onoff}) - self.update_shadow() - ctx.log = "bri:"+str(bri_in) + var bri_254 = val.findsubval(0) # Hue 0..254 + var onoff = bri_254 > 0 + self.set_bri(bri_254, onoff) + ctx.log = "bri:"+str(bri_254) + self.publish_command('Bri', bri_254, 'Dimmer', tasmota.scale_uint(bri_254, 0, 254, 0, 100), 'Power', onoff ? 1 : 0) return true elif command == 0x0005 # ---------- MoveWithOnOff ---------- # TODO, we don't really support it diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Light2.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Light2.be index 27d9657d47a6..f8dfffee5d1d 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Light2.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Light2.be @@ -40,15 +40,24 @@ class Matter_Plugin_Light2 : Matter_Plugin_Light1 } static var TYPES = { 0x010C: 2 } # Color Temperature Light - var shadow_ct - var ct_min, ct_max + # Inherited + # var device # reference to the `device` global object + # var endpoint # current endpoint + # var clusters # map from cluster to list of attributes, typically constructed from CLUSTERS hierachy + # var tick # tick value when it was last updated + # var node_label # name of the endpoint, used only in bridge mode, "" if none + # var virtual # (bool) is the device pure virtual (i.e. not related to a device implementation by Tasmota) + # var shadow_onoff # (bool) status of the light power on/off + # var shadow_bri # (int 0..254) brightness before Gamma correction - as per Matter 255 is not allowed + var shadow_ct # (int 153..500, default 325) Color Temperatur in mireds + var ct_min, ct_max # min and max value allowed for CT, Alexa emulation requires to have a narrower range 200..380 ############################################################# # Constructor def init(device, endpoint, arguments) super(self).init(device, endpoint, arguments) self.shadow_ct = 325 - self.update_ct_minmax() + self.update_ct_minmax() # read SetOption to adjust ct min/max end ############################################################# @@ -62,19 +71,42 @@ class Matter_Plugin_Light2 : Matter_Plugin_Light1 if light_status != nil var ct = light_status.find('ct', nil) if ct == nil ct = self.shadow_ct end - if ct != self.shadow_ct self.attribute_updated(0x0300, 0x0007) self.shadow_ct = ct end + if ct != self.shadow_ct + self.attribute_updated(0x0300, 0x0007) + self.shadow_ct = ct + end end end ############################################################# # Update ct_min/max # + # Standard range is 153..500 but Alexa emulation reduces range to 200..380 + # Depending on `SetOption82` def update_ct_minmax() var ct_alexa_mode = tasmota.get_option(82) # if set, range is 200..380 instead of 153...500 self.ct_min = ct_alexa_mode ? 200 : 153 self.ct_max = ct_alexa_mode ? 380 : 500 end + ############################################################# + # set_ct + # + def set_ct(ct) + if ct < self.ct_min ct = self.ct_min end + if ct > self.ct_max ct = self.ct_max end + if !self.virtual + import light + light.set({'ct': ct}) + self.update_shadow() + else + if ct != self.shadow_ct + self.attribute_updated(0x0300, 0x0007) + self.shadow_ct = ct + end + end + end + ############################################################# # read an attribute # @@ -124,11 +156,9 @@ class Matter_Plugin_Light2 : Matter_Plugin_Light1 self.update_shadow_lazy() if command == 0x000A # ---------- MoveToColorTemperature ---------- var ct_in = val.findsubval(0) # CT - if ct_in < self.ct_min ct_in = self.ct_min end - if ct_in > self.ct_max ct_in = self.ct_max end - light.set({'ct': ct_in}) - self.update_shadow() + self.set_ct(ct_in) ctx.log = "ct:"+str(ct_in) + self.publish_command('CT', ct_in) return true elif command == 0x0047 # ---------- StopMoveStep ---------- # TODO, we don't really support it diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Light3.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Light3.be index 41981fcbd7f2..4761162483c2 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Light3.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Light3.be @@ -40,7 +40,17 @@ class Matter_Plugin_Light3 : Matter_Plugin_Light1 } static var TYPES = { 0x010D: 2 } # Extended Color Light - var shadow_hue, shadow_sat + # Inherited + # var device # reference to the `device` global object + # var endpoint # current endpoint + # var clusters # map from cluster to list of attributes, typically constructed from CLUSTERS hierachy + # var tick # tick value when it was last updated + # var node_label # name of the endpoint, used only in bridge mode, "" if none + # var virtual # (bool) is the device pure virtual (i.e. not related to a device implementation by Tasmota) + # var shadow_onoff # (bool) status of the light power on/off + # var shadow_bri # (int 0..254) brightness before Gamma correction - as per Matter 255 is not allowed + var shadow_hue # (int 0..254) hue of color, may need to be extended to 0..360 for value in degrees + var shadow_sat # (int 0..254) saturation of color ############################################################# # Constructor @@ -54,16 +64,56 @@ class Matter_Plugin_Light3 : Matter_Plugin_Light1 # Update shadow # def update_shadow() - import light super(self).update_shadow() - var light_status = light.get() - if light_status != nil - var hue = light_status.find('hue', nil) - var sat = light_status.find('sat', nil) - if hue != nil hue = tasmota.scale_uint(hue, 0, 360, 0, 254) else hue = self.shadow_hue end - if sat != nil sat = tasmota.scale_uint(sat, 0, 255, 0, 254) else sat = self.shadow_sat end - if hue != self.shadow_hue self.attribute_updated(0x0300, 0x0000) self.shadow_hue = hue end - if sat != self.shadow_sat self.attribute_updated(0x0300, 0x0001) self.shadow_sat = sat end + if !self.virtual + import light + var light_status = light.get() + if light_status != nil + var hue = light_status.find('hue', nil) + var sat = light_status.find('sat', nil) + if hue != nil hue = tasmota.scale_uint(hue, 0, 360, 0, 254) else hue = self.shadow_hue end + if sat != nil sat = tasmota.scale_uint(sat, 0, 255, 0, 254) else sat = self.shadow_sat end + if hue != self.shadow_hue self.attribute_updated(0x0300, 0x0000) self.shadow_hue = hue end + if sat != self.shadow_sat self.attribute_updated(0x0300, 0x0001) self.shadow_sat = sat end + end + end + end + + ############################################################# + # set_hue_sat + # + # `hue` 0..254 or `nil` + # `sat` 0..255 or `nil` + def set_hue_sat(hue_254, sat_254) + # sanity checks on values + if hue_254 != nil + if hue_254 < 0 hue_254 = 0 end + if hue_254 > 254 hue_254 = 254 end + end + if sat_254 != nil + if sat_254 < 0 sat_254 = 0 end + if sat_254 > 254 sat_254 = 254 end + end + + if !self.virtual + var hue_360 = (hue_254 != nil) ? tasmota.scale_uint(hue_254, 0, 254, 0, 360) : nil + var sat_255 = (sat_254 != nil) ? tasmota.scale_uint(sat_254, 0, 254, 0, 255) : nil + + if (hue_360 != nil) && (sat_255 != nil) + light.set({'hue': hue_360, 'sat': sat_255}) + elif (hue_360 != nil) + light.set({'hue': hue_360}) + else + light.set({'sat': sat_255}) + end + self.update_shadow() + else + if hue_254 != nil + if hue_254 != self.shadow_hue self.attribute_updated(0x0300, 0x0000) self.shadow_hue = hue_254 end + end + if sat_254 != nil + if sat_254 != self.shadow_sat self.attribute_updated(0x0300, 0x0001) self.shadow_sat = sat_254 end + end end end @@ -124,10 +174,9 @@ class Matter_Plugin_Light3 : Matter_Plugin_Light1 self.update_shadow_lazy() if command == 0x0000 # ---------- MoveToHue ---------- var hue_in = val.findsubval(0) # Hue 0..254 - var hue = tasmota.scale_uint(hue_in, 0, 254, 0, 360) - light.set({'hue': hue}) - self.update_shadow() + self.set_hue_sat(hue_in, nil) ctx.log = "hue:"+str(hue_in) + self.publish_command('Hue', hue_in) return true elif command == 0x0001 # ---------- MoveHue ---------- # TODO, we don't really support it @@ -137,10 +186,9 @@ class Matter_Plugin_Light3 : Matter_Plugin_Light1 return true elif command == 0x0003 # ---------- MoveToSaturation ---------- var sat_in = val.findsubval(0) # Sat 0..254 - var sat = tasmota.scale_uint(sat_in, 0, 254, 0, 255) - light.set({'sat': sat}) - self.update_shadow() + self.set_hue_sat(nil, sat_in) ctx.log = "sat:"+str(sat_in) + self.publish_command('Sat', sat_in) return true elif command == 0x0004 # ---------- MoveSaturation ---------- # TODO, we don't really support it @@ -150,12 +198,10 @@ class Matter_Plugin_Light3 : Matter_Plugin_Light1 return true elif command == 0x0006 # ---------- MoveToHueAndSaturation ---------- var hue_in = val.findsubval(0) # Hue 0..254 - var hue = tasmota.scale_uint(hue_in, 0, 254, 0, 360) var sat_in = val.findsubval(1) # Sat 0..254 - var sat = tasmota.scale_uint(sat_in, 0, 254, 0, 255) - light.set({'hue': hue, 'sat': sat}) - self.update_shadow() + self.set_hue_sat(hue_in, sat_in) ctx.log = "hue:"+str(hue_in)+" sat:"+str(sat_in) + self.publish_command('Hue', hue_in, 'Sat', sat_in) return true elif command == 0x0047 # ---------- StopMoveStep ---------- # TODO, we don't really support it diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_OnOff.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_OnOff.be index 7fad806cad30..a65f9b6473a1 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_OnOff.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_OnOff.be @@ -123,14 +123,17 @@ class Matter_Plugin_OnOff : Matter_Plugin_Device if command == 0x0000 # ---------- Off ---------- self.set_onoff(false) self.update_shadow() + self.publish_command('Power', 0) return true elif command == 0x0001 # ---------- On ---------- self.set_onoff(true) self.update_shadow() + self.publish_command('Power', 1) return true elif command == 0x0002 # ---------- Toggle ---------- self.set_onoff(!self.shadow_onoff) self.update_shadow() + self.publish_command('Power', self.shadow_onoff ? 1 : 0) return true end end diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_IM.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_IM.h index e9a29ad821f2..54294c9d1144 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_IM.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_IM.h @@ -346,7 +346,7 @@ be_local_closure(Matter_IM_attributedata2raw, /* name */ ********************************************************************/ be_local_closure(Matter_IM_process_invoke_request_solo, /* name */ be_nested_proto( - 16, /* nstack */ + 15, /* nstack */ 3, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -354,7 +354,7 @@ be_local_closure(Matter_IM_process_invoke_request_solo, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[45]) { /* constants */ + ( &(const bvalue[42]) { /* constants */ /* K0 */ be_nested_str_weak(matter), /* K1 */ be_nested_str_weak(profiler), /* K2 */ be_nested_str_weak(log), @@ -373,37 +373,34 @@ be_local_closure(Matter_IM_process_invoke_request_solo, /* name */ /* K15 */ be_nested_str_weak(_X28), /* K16 */ be_nested_str_weak(_X29_X20), /* K17 */ be_nested_str_weak(), - /* K18 */ be_nested_str_weak(endpoint), - /* K19 */ be_const_int(0), - /* K20 */ be_const_int(2), - /* K21 */ be_const_int(3), - /* K22 */ be_nested_str_weak(tasmota), - /* K23 */ be_nested_str_weak(loglevel), - /* K24 */ be_nested_str_weak(MTR_X3A_X20_X3ECommand1_X20_X20_X28_X256i_X29_X20_X25s_X20_X25s_X20_X25s), - /* K25 */ be_nested_str_weak(local_session_id), - /* K26 */ be_nested_str_weak(add), - /* K27 */ be_const_int(354943030), - /* K28 */ be_const_int(1), - /* K29 */ be_nested_str_weak(SUCCESS), - /* K30 */ be_nested_str_weak(invokeresponse2raw), - /* K31 */ be_nested_str_weak(MTR_X3A_X20_X3CReplied_X20_X20_X20_X28_X256i_X29_X20OK_X20exch_X3D_X25i), - /* K32 */ be_nested_str_weak(exchange_id), - /* K33 */ be_nested_str_weak(MTR_X3A_X20_X3CReplied_X20_X20_X20_X28_X256i_X29_X20_X25s_X20_X25s), - /* K34 */ be_nested_str_weak(MTR_X3A_X20_X3CReplied_X20_X20_X20_X28_X256i_X29_X20Status_X3D0x_X2502X_X20exch_X3D_X25i), - /* K35 */ be_nested_str_weak(MTR_X3A_X20_Ignore_X20_X20_X20_X20_X28_X256i_X29_X20exch_X3D_X25i), - /* K36 */ be_const_int(405077761), - /* K37 */ be_nested_str_weak(build_response), - /* K38 */ be_nested_str_weak(message_handler), - /* K39 */ be_nested_str_weak(raw), - /* K40 */ be_nested_str_weak(clear), - /* K41 */ be_nested_str_weak(encode_frame), - /* K42 */ be_nested_str_weak(encrypt), - /* K43 */ be_nested_str_weak(send_response_frame), - /* K44 */ be_nested_str_weak(RESPONSE_X20SENT), + /* K18 */ be_nested_str_weak(tasmota), + /* K19 */ be_nested_str_weak(loglevel), + /* K20 */ be_const_int(3), + /* K21 */ be_nested_str_weak(MTR_X3A_X20_X3ECommand1_X20_X20_X28_X256i_X29_X20_X25s_X20_X25s_X20_X25s), + /* K22 */ be_nested_str_weak(local_session_id), + /* K23 */ be_nested_str_weak(add), + /* K24 */ be_const_int(354943030), + /* K25 */ be_const_int(1), + /* K26 */ be_nested_str_weak(SUCCESS), + /* K27 */ be_nested_str_weak(invokeresponse2raw), + /* K28 */ be_nested_str_weak(MTR_X3A_X20_X3CReplied_X20_X20_X20_X28_X256i_X29_X20OK_X20exch_X3D_X25i), + /* K29 */ be_nested_str_weak(exchange_id), + /* K30 */ be_nested_str_weak(MTR_X3A_X20_X3CReplied_X20_X20_X20_X28_X256i_X29_X20_X25s_X20_X25s), + /* K31 */ be_nested_str_weak(MTR_X3A_X20_X3CReplied_X20_X20_X20_X28_X256i_X29_X20Status_X3D0x_X2502X_X20exch_X3D_X25i), + /* K32 */ be_nested_str_weak(MTR_X3A_X20_Ignore_X20_X20_X20_X20_X28_X256i_X29_X20exch_X3D_X25i), + /* K33 */ be_const_int(405077761), + /* K34 */ be_nested_str_weak(build_response), + /* K35 */ be_nested_str_weak(message_handler), + /* K36 */ be_nested_str_weak(raw), + /* K37 */ be_nested_str_weak(clear), + /* K38 */ be_nested_str_weak(encode_frame), + /* K39 */ be_nested_str_weak(encrypt), + /* K40 */ be_nested_str_weak(send_response_frame), + /* K41 */ be_nested_str_weak(RESPONSE_X20SENT), }), be_str_weak(process_invoke_request_solo), &be_const_str_solidified, - ( &(const binstruction[214]) { /* code */ + ( &(const binstruction[208]) { /* code */ 0xB80E0000, // 0000 GETNGBL R3 K0 0x880C0701, // 0001 GETMBR R3 R3 K1 0x8C0C0702, // 0002 GETMET R3 R3 K2 @@ -443,181 +440,175 @@ be_local_closure(Matter_IM_process_invoke_request_solo, /* name */ 0x00180D10, // 0024 ADD R6 R6 K16 0x70020000, // 0025 JMP #0027 0x58180011, // 0026 LDCONST R6 K17 - 0x881C0512, // 0027 GETMBR R7 R2 K18 - 0x201C0F13, // 0028 NE R7 R7 K19 - 0x781E0001, // 0029 JMPF R7 #002C - 0x581C0014, // 002A LDCONST R7 K20 - 0x70020000, // 002B JMP #002D - 0x581C0015, // 002C LDCONST R7 K21 - 0xB8222C00, // 002D GETNGBL R8 K22 - 0x8C201117, // 002E GETMET R8 R8 K23 - 0x5C280E00, // 002F MOVE R10 R7 - 0x7C200400, // 0030 CALL R8 2 - 0x7822000E, // 0031 JMPF R8 #0041 - 0xB8222C00, // 0032 GETNGBL R8 K22 - 0x8C201102, // 0033 GETMET R8 R8 K2 - 0x60280018, // 0034 GETGBL R10 G24 - 0x582C0018, // 0035 LDCONST R11 K24 - 0x8830030C, // 0036 GETMBR R12 R1 K12 - 0x88301919, // 0037 GETMBR R12 R12 K25 - 0x5C340800, // 0038 MOVE R13 R4 - 0x780E0001, // 0039 JMPF R3 #003C - 0x5C380600, // 003A MOVE R14 R3 - 0x70020000, // 003B JMP #003D - 0x58380011, // 003C LDCONST R14 K17 - 0x5C3C0C00, // 003D MOVE R15 R6 - 0x7C280A00, // 003E CALL R10 5 - 0x5C2C0E00, // 003F MOVE R11 R7 - 0x7C200600, // 0040 CALL R8 3 - 0x4C200000, // 0041 LDNIL R8 - 0x900A0408, // 0042 SETMBR R2 K2 R8 - 0x60200015, // 0043 GETGBL R8 G21 - 0x5426002F, // 0044 LDINT R9 48 - 0x7C200200, // 0045 CALL R8 1 - 0x8C24111A, // 0046 GETMET R9 R8 K26 - 0x582C001B, // 0047 LDCONST R11 K27 - 0x5431FFFB, // 0048 LDINT R12 -4 - 0x7C240600, // 0049 CALL R9 3 - 0x8C24111A, // 004A GETMET R9 R8 K26 - 0x582C001C, // 004B LDCONST R11 K28 - 0x5830001C, // 004C LDCONST R12 K28 - 0x7C240600, // 004D CALL R9 3 - 0x50240200, // 004E LDBOOL R9 1 0 - 0x1C240A09, // 004F EQ R9 R5 R9 - 0x74260004, // 0050 JMPT R9 #0056 - 0x88240505, // 0051 GETMBR R9 R2 K5 - 0xB82A0000, // 0052 GETNGBL R10 K0 - 0x8828151D, // 0053 GETMBR R10 R10 K29 - 0x1C24120A, // 0054 EQ R9 R9 R10 - 0x78260017, // 0055 JMPF R9 #006E - 0xB8260000, // 0056 GETNGBL R9 K0 - 0x8824131D, // 0057 GETMBR R9 R9 K29 - 0x900A0A09, // 0058 SETMBR R2 K5 R9 - 0x8C24011E, // 0059 GETMET R9 R0 K30 - 0x5C2C1000, // 005A MOVE R11 R8 - 0x5C300400, // 005B MOVE R12 R2 - 0x4C340000, // 005C LDNIL R13 - 0x7C240800, // 005D CALL R9 4 - 0xB8262C00, // 005E GETNGBL R9 K22 - 0x8C241317, // 005F GETMET R9 R9 K23 - 0x582C0015, // 0060 LDCONST R11 K21 - 0x7C240400, // 0061 CALL R9 2 - 0x78260009, // 0062 JMPF R9 #006D - 0xB8262C00, // 0063 GETNGBL R9 K22 - 0x8C241302, // 0064 GETMET R9 R9 K2 - 0x602C0018, // 0065 GETGBL R11 G24 - 0x5830001F, // 0066 LDCONST R12 K31 - 0x8834030C, // 0067 GETMBR R13 R1 K12 - 0x88341B19, // 0068 GETMBR R13 R13 K25 - 0x88380320, // 0069 GETMBR R14 R1 K32 - 0x7C2C0600, // 006A CALL R11 3 - 0x58300015, // 006B LDCONST R12 K21 - 0x7C240600, // 006C CALL R9 3 - 0x70020046, // 006D JMP #00B5 - 0x4C240000, // 006E LDNIL R9 - 0x20240A09, // 006F NE R9 R5 R9 - 0x78260018, // 0070 JMPF R9 #008A - 0x8C24011E, // 0071 GETMET R9 R0 K30 - 0x5C2C1000, // 0072 MOVE R11 R8 - 0x5C300400, // 0073 MOVE R12 R2 - 0x5C340A00, // 0074 MOVE R13 R5 - 0x7C240800, // 0075 CALL R9 4 - 0x5C240600, // 0076 MOVE R9 R3 - 0x74260000, // 0077 JMPT R9 #0079 - 0x580C0011, // 0078 LDCONST R3 K17 - 0xB8262C00, // 0079 GETNGBL R9 K22 - 0x8C241317, // 007A GETMET R9 R9 K23 - 0x582C0015, // 007B LDCONST R11 K21 - 0x7C240400, // 007C CALL R9 2 - 0x7826000A, // 007D JMPF R9 #0089 - 0xB8262C00, // 007E GETNGBL R9 K22 - 0x8C241302, // 007F GETMET R9 R9 K2 - 0x602C0018, // 0080 GETGBL R11 G24 - 0x58300021, // 0081 LDCONST R12 K33 - 0x8834030C, // 0082 GETMBR R13 R1 K12 - 0x88341B19, // 0083 GETMBR R13 R13 K25 - 0x5C380400, // 0084 MOVE R14 R2 - 0x5C3C0600, // 0085 MOVE R15 R3 - 0x7C2C0800, // 0086 CALL R11 4 - 0x58300015, // 0087 LDCONST R12 K21 - 0x7C240600, // 0088 CALL R9 3 - 0x7002002A, // 0089 JMP #00B5 - 0x88240505, // 008A GETMBR R9 R2 K5 - 0x4C280000, // 008B LDNIL R10 - 0x2024120A, // 008C NE R9 R9 R10 - 0x78260015, // 008D JMPF R9 #00A4 - 0x8C24011E, // 008E GETMET R9 R0 K30 - 0x5C2C1000, // 008F MOVE R11 R8 - 0x5C300400, // 0090 MOVE R12 R2 - 0x4C340000, // 0091 LDNIL R13 - 0x7C240800, // 0092 CALL R9 4 - 0xB8262C00, // 0093 GETNGBL R9 K22 - 0x8C241317, // 0094 GETMET R9 R9 K23 - 0x582C0015, // 0095 LDCONST R11 K21 - 0x7C240400, // 0096 CALL R9 2 - 0x7826000A, // 0097 JMPF R9 #00A3 - 0xB8262C00, // 0098 GETNGBL R9 K22 - 0x8C241302, // 0099 GETMET R9 R9 K2 - 0x602C0018, // 009A GETGBL R11 G24 - 0x58300022, // 009B LDCONST R12 K34 - 0x8834030C, // 009C GETMBR R13 R1 K12 - 0x88341B19, // 009D GETMBR R13 R13 K25 - 0x88380505, // 009E GETMBR R14 R2 K5 - 0x883C0320, // 009F GETMBR R15 R1 K32 - 0x7C2C0800, // 00A0 CALL R11 4 - 0x58300015, // 00A1 LDCONST R12 K21 - 0x7C240600, // 00A2 CALL R9 3 - 0x70020010, // 00A3 JMP #00B5 - 0xB8262C00, // 00A4 GETNGBL R9 K22 - 0x8C241317, // 00A5 GETMET R9 R9 K23 - 0x582C0015, // 00A6 LDCONST R11 K21 - 0x7C240400, // 00A7 CALL R9 2 - 0x78260009, // 00A8 JMPF R9 #00B3 - 0xB8262C00, // 00A9 GETNGBL R9 K22 - 0x8C241302, // 00AA GETMET R9 R9 K2 - 0x602C0018, // 00AB GETGBL R11 G24 - 0x58300023, // 00AC LDCONST R12 K35 - 0x8834030C, // 00AD GETMBR R13 R1 K12 - 0x88341B19, // 00AE GETMBR R13 R13 K25 - 0x88380320, // 00AF GETMBR R14 R1 K32 - 0x7C2C0600, // 00B0 CALL R11 3 - 0x58300015, // 00B1 LDCONST R12 K21 - 0x7C240600, // 00B2 CALL R9 3 - 0x50240000, // 00B3 LDBOOL R9 0 0 - 0x80041200, // 00B4 RET 1 R9 - 0x8C24111A, // 00B5 GETMET R9 R8 K26 - 0x582C0024, // 00B6 LDCONST R11 K36 - 0x5431FFFB, // 00B7 LDINT R12 -4 - 0x7C240600, // 00B8 CALL R9 3 - 0x8C24111A, // 00B9 GETMET R9 R8 K26 - 0x542E0017, // 00BA LDINT R11 24 - 0x5830001C, // 00BB LDCONST R12 K28 - 0x7C240600, // 00BC CALL R9 3 - 0x8C240325, // 00BD GETMET R9 R1 K37 - 0x542E0008, // 00BE LDINT R11 9 - 0x50300200, // 00BF LDBOOL R12 1 0 - 0x7C240600, // 00C0 CALL R9 3 - 0x8828010A, // 00C1 GETMBR R10 R0 K10 - 0x88281526, // 00C2 GETMBR R10 R10 K38 - 0x882C0327, // 00C3 GETMBR R11 R1 K39 - 0x8C301728, // 00C4 GETMET R12 R11 K40 - 0x7C300200, // 00C5 CALL R12 1 - 0x8C301329, // 00C6 GETMET R12 R9 K41 - 0x5C381000, // 00C7 MOVE R14 R8 - 0x5C3C1600, // 00C8 MOVE R15 R11 - 0x7C300600, // 00C9 CALL R12 3 - 0x8C30132A, // 00CA GETMET R12 R9 K42 - 0x7C300200, // 00CB CALL R12 1 - 0x8C30152B, // 00CC GETMET R12 R10 K43 - 0x5C381200, // 00CD MOVE R14 R9 - 0x7C300400, // 00CE CALL R12 2 - 0xB8320000, // 00CF GETNGBL R12 K0 - 0x88301901, // 00D0 GETMBR R12 R12 K1 - 0x8C301902, // 00D1 GETMET R12 R12 K2 - 0x5838002C, // 00D2 LDCONST R14 K44 - 0x7C300400, // 00D3 CALL R12 2 - 0x50300200, // 00D4 LDBOOL R12 1 0 - 0x80041800, // 00D5 RET 1 R12 + 0xB81E2400, // 0027 GETNGBL R7 K18 + 0x8C1C0F13, // 0028 GETMET R7 R7 K19 + 0x58240014, // 0029 LDCONST R9 K20 + 0x7C1C0400, // 002A CALL R7 2 + 0x781E000E, // 002B JMPF R7 #003B + 0xB81E2400, // 002C GETNGBL R7 K18 + 0x8C1C0F02, // 002D GETMET R7 R7 K2 + 0x60240018, // 002E GETGBL R9 G24 + 0x58280015, // 002F LDCONST R10 K21 + 0x882C030C, // 0030 GETMBR R11 R1 K12 + 0x882C1716, // 0031 GETMBR R11 R11 K22 + 0x5C300800, // 0032 MOVE R12 R4 + 0x780E0001, // 0033 JMPF R3 #0036 + 0x5C340600, // 0034 MOVE R13 R3 + 0x70020000, // 0035 JMP #0037 + 0x58340011, // 0036 LDCONST R13 K17 + 0x5C380C00, // 0037 MOVE R14 R6 + 0x7C240A00, // 0038 CALL R9 5 + 0x58280014, // 0039 LDCONST R10 K20 + 0x7C1C0600, // 003A CALL R7 3 + 0x4C1C0000, // 003B LDNIL R7 + 0x900A0407, // 003C SETMBR R2 K2 R7 + 0x601C0015, // 003D GETGBL R7 G21 + 0x5422002F, // 003E LDINT R8 48 + 0x7C1C0200, // 003F CALL R7 1 + 0x8C200F17, // 0040 GETMET R8 R7 K23 + 0x58280018, // 0041 LDCONST R10 K24 + 0x542DFFFB, // 0042 LDINT R11 -4 + 0x7C200600, // 0043 CALL R8 3 + 0x8C200F17, // 0044 GETMET R8 R7 K23 + 0x58280019, // 0045 LDCONST R10 K25 + 0x582C0019, // 0046 LDCONST R11 K25 + 0x7C200600, // 0047 CALL R8 3 + 0x50200200, // 0048 LDBOOL R8 1 0 + 0x1C200A08, // 0049 EQ R8 R5 R8 + 0x74220004, // 004A JMPT R8 #0050 + 0x88200505, // 004B GETMBR R8 R2 K5 + 0xB8260000, // 004C GETNGBL R9 K0 + 0x8824131A, // 004D GETMBR R9 R9 K26 + 0x1C201009, // 004E EQ R8 R8 R9 + 0x78220017, // 004F JMPF R8 #0068 + 0xB8220000, // 0050 GETNGBL R8 K0 + 0x8820111A, // 0051 GETMBR R8 R8 K26 + 0x900A0A08, // 0052 SETMBR R2 K5 R8 + 0x8C20011B, // 0053 GETMET R8 R0 K27 + 0x5C280E00, // 0054 MOVE R10 R7 + 0x5C2C0400, // 0055 MOVE R11 R2 + 0x4C300000, // 0056 LDNIL R12 + 0x7C200800, // 0057 CALL R8 4 + 0xB8222400, // 0058 GETNGBL R8 K18 + 0x8C201113, // 0059 GETMET R8 R8 K19 + 0x58280014, // 005A LDCONST R10 K20 + 0x7C200400, // 005B CALL R8 2 + 0x78220009, // 005C JMPF R8 #0067 + 0xB8222400, // 005D GETNGBL R8 K18 + 0x8C201102, // 005E GETMET R8 R8 K2 + 0x60280018, // 005F GETGBL R10 G24 + 0x582C001C, // 0060 LDCONST R11 K28 + 0x8830030C, // 0061 GETMBR R12 R1 K12 + 0x88301916, // 0062 GETMBR R12 R12 K22 + 0x8834031D, // 0063 GETMBR R13 R1 K29 + 0x7C280600, // 0064 CALL R10 3 + 0x582C0014, // 0065 LDCONST R11 K20 + 0x7C200600, // 0066 CALL R8 3 + 0x70020046, // 0067 JMP #00AF + 0x4C200000, // 0068 LDNIL R8 + 0x20200A08, // 0069 NE R8 R5 R8 + 0x78220018, // 006A JMPF R8 #0084 + 0x8C20011B, // 006B GETMET R8 R0 K27 + 0x5C280E00, // 006C MOVE R10 R7 + 0x5C2C0400, // 006D MOVE R11 R2 + 0x5C300A00, // 006E MOVE R12 R5 + 0x7C200800, // 006F CALL R8 4 + 0x5C200600, // 0070 MOVE R8 R3 + 0x74220000, // 0071 JMPT R8 #0073 + 0x580C0011, // 0072 LDCONST R3 K17 + 0xB8222400, // 0073 GETNGBL R8 K18 + 0x8C201113, // 0074 GETMET R8 R8 K19 + 0x58280014, // 0075 LDCONST R10 K20 + 0x7C200400, // 0076 CALL R8 2 + 0x7822000A, // 0077 JMPF R8 #0083 + 0xB8222400, // 0078 GETNGBL R8 K18 + 0x8C201102, // 0079 GETMET R8 R8 K2 + 0x60280018, // 007A GETGBL R10 G24 + 0x582C001E, // 007B LDCONST R11 K30 + 0x8830030C, // 007C GETMBR R12 R1 K12 + 0x88301916, // 007D GETMBR R12 R12 K22 + 0x5C340400, // 007E MOVE R13 R2 + 0x5C380600, // 007F MOVE R14 R3 + 0x7C280800, // 0080 CALL R10 4 + 0x582C0014, // 0081 LDCONST R11 K20 + 0x7C200600, // 0082 CALL R8 3 + 0x7002002A, // 0083 JMP #00AF + 0x88200505, // 0084 GETMBR R8 R2 K5 + 0x4C240000, // 0085 LDNIL R9 + 0x20201009, // 0086 NE R8 R8 R9 + 0x78220015, // 0087 JMPF R8 #009E + 0x8C20011B, // 0088 GETMET R8 R0 K27 + 0x5C280E00, // 0089 MOVE R10 R7 + 0x5C2C0400, // 008A MOVE R11 R2 + 0x4C300000, // 008B LDNIL R12 + 0x7C200800, // 008C CALL R8 4 + 0xB8222400, // 008D GETNGBL R8 K18 + 0x8C201113, // 008E GETMET R8 R8 K19 + 0x58280014, // 008F LDCONST R10 K20 + 0x7C200400, // 0090 CALL R8 2 + 0x7822000A, // 0091 JMPF R8 #009D + 0xB8222400, // 0092 GETNGBL R8 K18 + 0x8C201102, // 0093 GETMET R8 R8 K2 + 0x60280018, // 0094 GETGBL R10 G24 + 0x582C001F, // 0095 LDCONST R11 K31 + 0x8830030C, // 0096 GETMBR R12 R1 K12 + 0x88301916, // 0097 GETMBR R12 R12 K22 + 0x88340505, // 0098 GETMBR R13 R2 K5 + 0x8838031D, // 0099 GETMBR R14 R1 K29 + 0x7C280800, // 009A CALL R10 4 + 0x582C0014, // 009B LDCONST R11 K20 + 0x7C200600, // 009C CALL R8 3 + 0x70020010, // 009D JMP #00AF + 0xB8222400, // 009E GETNGBL R8 K18 + 0x8C201113, // 009F GETMET R8 R8 K19 + 0x58280014, // 00A0 LDCONST R10 K20 + 0x7C200400, // 00A1 CALL R8 2 + 0x78220009, // 00A2 JMPF R8 #00AD + 0xB8222400, // 00A3 GETNGBL R8 K18 + 0x8C201102, // 00A4 GETMET R8 R8 K2 + 0x60280018, // 00A5 GETGBL R10 G24 + 0x582C0020, // 00A6 LDCONST R11 K32 + 0x8830030C, // 00A7 GETMBR R12 R1 K12 + 0x88301916, // 00A8 GETMBR R12 R12 K22 + 0x8834031D, // 00A9 GETMBR R13 R1 K29 + 0x7C280600, // 00AA CALL R10 3 + 0x582C0014, // 00AB LDCONST R11 K20 + 0x7C200600, // 00AC CALL R8 3 + 0x50200000, // 00AD LDBOOL R8 0 0 + 0x80041000, // 00AE RET 1 R8 + 0x8C200F17, // 00AF GETMET R8 R7 K23 + 0x58280021, // 00B0 LDCONST R10 K33 + 0x542DFFFB, // 00B1 LDINT R11 -4 + 0x7C200600, // 00B2 CALL R8 3 + 0x8C200F17, // 00B3 GETMET R8 R7 K23 + 0x542A0017, // 00B4 LDINT R10 24 + 0x582C0019, // 00B5 LDCONST R11 K25 + 0x7C200600, // 00B6 CALL R8 3 + 0x8C200322, // 00B7 GETMET R8 R1 K34 + 0x542A0008, // 00B8 LDINT R10 9 + 0x502C0200, // 00B9 LDBOOL R11 1 0 + 0x7C200600, // 00BA CALL R8 3 + 0x8824010A, // 00BB GETMBR R9 R0 K10 + 0x88241323, // 00BC GETMBR R9 R9 K35 + 0x88280324, // 00BD GETMBR R10 R1 K36 + 0x8C2C1525, // 00BE GETMET R11 R10 K37 + 0x7C2C0200, // 00BF CALL R11 1 + 0x8C2C1126, // 00C0 GETMET R11 R8 K38 + 0x5C340E00, // 00C1 MOVE R13 R7 + 0x5C381400, // 00C2 MOVE R14 R10 + 0x7C2C0600, // 00C3 CALL R11 3 + 0x8C2C1127, // 00C4 GETMET R11 R8 K39 + 0x7C2C0200, // 00C5 CALL R11 1 + 0x8C2C1328, // 00C6 GETMET R11 R9 K40 + 0x5C341000, // 00C7 MOVE R13 R8 + 0x7C2C0400, // 00C8 CALL R11 2 + 0xB82E0000, // 00C9 GETNGBL R11 K0 + 0x882C1701, // 00CA GETMBR R11 R11 K1 + 0x8C2C1702, // 00CB GETMET R11 R11 K2 + 0x58340029, // 00CC LDCONST R13 K41 + 0x7C2C0400, // 00CD CALL R11 2 + 0x502C0200, // 00CE LDBOOL R11 1 0 + 0x80041600, // 00CF RET 1 R11 }) ) ); @@ -858,7 +849,7 @@ be_local_closure(Matter_IM_process_invoke_request, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[44]) { /* constants */ + ( &(const bvalue[43]) { /* constants */ /* K0 */ be_nested_str_weak(matter), /* K1 */ be_nested_str_weak(profiler), /* K2 */ be_nested_str_weak(log), @@ -889,24 +880,23 @@ be_local_closure(Matter_IM_process_invoke_request, /* name */ /* K27 */ be_nested_str_weak(tasmota), /* K28 */ be_nested_str_weak(MTR_X3A_X20_X3ECommand_X20_X20_X20_X28_X256i_X29_X20_X25s_X20_X25s_X20_X25s), /* K29 */ be_nested_str_weak(local_session_id), - /* K30 */ be_const_int(0), - /* K31 */ be_const_int(2), - /* K32 */ be_const_int(3), - /* K33 */ be_nested_str_weak(SUCCESS), - /* K34 */ be_nested_str_weak(invokeresponse2raw), - /* K35 */ be_nested_str_weak(push), - /* K36 */ be_nested_str_weak(loglevel), - /* K37 */ be_nested_str_weak(MTR_X3A_X20_X3CReplied_X20_X20_X20_X28_X256i_X29_X20OK_X20exch_X3D_X25i), - /* K38 */ be_nested_str_weak(exchange_id), - /* K39 */ be_nested_str_weak(MTR_X3A_X20_X3CReplied_X20_X20_X20_X28_X256i_X29_X20_X25s_X20_X25s), - /* K40 */ be_nested_str_weak(MTR_X3A_X20_X3CReplied_X20_X20_X20_X28_X256i_X29_X20Status_X3D0x_X2502X_X20exch_X3D_X25i), - /* K41 */ be_nested_str_weak(MTR_X3A_X20_Ignore_X20_X20_X20_X20_X28_X256i_X29_X20exch_X3D_X25i), - /* K42 */ be_nested_str_weak(stop_iteration), - /* K43 */ be_nested_str_weak(send_invoke_response), + /* K30 */ be_const_int(3), + /* K31 */ be_nested_str_weak(SUCCESS), + /* K32 */ be_nested_str_weak(invokeresponse2raw), + /* K33 */ be_nested_str_weak(push), + /* K34 */ be_nested_str_weak(loglevel), + /* K35 */ be_nested_str_weak(MTR_X3A_X20_X3CReplied_X20_X20_X20_X28_X256i_X29_X20OK_X20exch_X3D_X25i), + /* K36 */ be_nested_str_weak(exchange_id), + /* K37 */ be_nested_str_weak(MTR_X3A_X20_X3CReplied_X20_X20_X20_X28_X256i_X29_X20_X25s_X20_X25s), + /* K38 */ be_nested_str_weak(MTR_X3A_X20_X3CReplied_X20_X20_X20_X28_X256i_X29_X20Status_X3D0x_X2502X_X20exch_X3D_X25i), + /* K39 */ be_nested_str_weak(MTR_X3A_X20_Ignore_X20_X20_X20_X20_X28_X256i_X29_X20exch_X3D_X25i), + /* K40 */ be_nested_str_weak(stop_iteration), + /* K41 */ be_const_int(0), + /* K42 */ be_nested_str_weak(send_invoke_response), }), be_str_weak(process_invoke_request), &be_const_str_solidified, - ( &(const binstruction[238]) { /* code */ + ( &(const binstruction[233]) { /* code */ 0xB80E0000, // 0000 GETNGBL R3 K0 0x880C0701, // 0001 GETMBR R3 R3 K1 0x8C0C0702, // 0002 GETMET R3 R3 K2 @@ -925,7 +915,7 @@ be_local_closure(Matter_IM_process_invoke_request, /* name */ 0x88140908, // 000F GETMBR R5 R4 K8 0x4C180000, // 0010 LDNIL R6 0x20140A06, // 0011 NE R5 R5 R6 - 0x781600D9, // 0012 JMPF R5 #00ED + 0x781600D4, // 0012 JMPF R5 #00E8 0xB8160000, // 0013 GETNGBL R5 K0 0x8C140B09, // 0014 GETMET R5 R5 K9 0x7C140200, // 0015 CALL R5 1 @@ -937,7 +927,7 @@ be_local_closure(Matter_IM_process_invoke_request, /* name */ 0x60180010, // 001B GETGBL R6 G16 0x881C0908, // 001C GETMBR R7 R4 K8 0x7C180200, // 001D CALL R6 1 - 0xA80200BC, // 001E EXBLK 0 #00DC + 0xA80200B7, // 001E EXBLK 0 #00D7 0x5C1C0C00, // 001F MOVE R7 R6 0x7C1C0000, // 0020 CALL R7 0 0x88200F0D, // 0021 GETMBR R8 R7 K13 @@ -995,156 +985,151 @@ be_local_closure(Matter_IM_process_invoke_request, /* name */ 0x5848001A, // 0055 LDCONST R18 K26 0x5C4C1600, // 0056 MOVE R19 R11 0x7C380A00, // 0057 CALL R14 5 - 0x883C070C, // 0058 GETMBR R15 R3 K12 - 0x203C1F1E, // 0059 NE R15 R15 K30 - 0x783E0001, // 005A JMPF R15 #005D - 0x583C001F, // 005B LDCONST R15 K31 - 0x70020000, // 005C JMP #005E - 0x583C0020, // 005D LDCONST R15 K32 - 0x7C300600, // 005E CALL R12 3 - 0x4C300000, // 005F LDNIL R12 - 0x900E040C, // 0060 SETMBR R3 K2 R12 - 0x60300015, // 0061 GETGBL R12 G21 - 0x5436001F, // 0062 LDINT R13 32 - 0x7C300200, // 0063 CALL R12 1 - 0x50340200, // 0064 LDBOOL R13 1 0 - 0x1C34140D, // 0065 EQ R13 R10 R13 - 0x74360004, // 0066 JMPT R13 #006C - 0x88340710, // 0067 GETMBR R13 R3 K16 - 0xB83A0000, // 0068 GETNGBL R14 K0 - 0x88381D21, // 0069 GETMBR R14 R14 K33 - 0x1C341A0E, // 006A EQ R13 R13 R14 - 0x7836001B, // 006B JMPF R13 #0088 - 0xB8360000, // 006C GETNGBL R13 K0 - 0x88341B21, // 006D GETMBR R13 R13 K33 - 0x900E200D, // 006E SETMBR R3 K16 R13 - 0x8C340122, // 006F GETMET R13 R0 K34 - 0x5C3C1800, // 0070 MOVE R15 R12 - 0x5C400600, // 0071 MOVE R16 R3 - 0x4C440000, // 0072 LDNIL R17 - 0x7C340800, // 0073 CALL R13 4 - 0x88340B0B, // 0074 GETMBR R13 R5 K11 - 0x8C341B23, // 0075 GETMET R13 R13 K35 - 0x5C3C1800, // 0076 MOVE R15 R12 - 0x7C340400, // 0077 CALL R13 2 + 0x583C001E, // 0058 LDCONST R15 K30 + 0x7C300600, // 0059 CALL R12 3 + 0x4C300000, // 005A LDNIL R12 + 0x900E040C, // 005B SETMBR R3 K2 R12 + 0x60300015, // 005C GETGBL R12 G21 + 0x5436001F, // 005D LDINT R13 32 + 0x7C300200, // 005E CALL R12 1 + 0x50340200, // 005F LDBOOL R13 1 0 + 0x1C34140D, // 0060 EQ R13 R10 R13 + 0x74360004, // 0061 JMPT R13 #0067 + 0x88340710, // 0062 GETMBR R13 R3 K16 + 0xB83A0000, // 0063 GETNGBL R14 K0 + 0x88381D1F, // 0064 GETMBR R14 R14 K31 + 0x1C341A0E, // 0065 EQ R13 R13 R14 + 0x7836001B, // 0066 JMPF R13 #0083 + 0xB8360000, // 0067 GETNGBL R13 K0 + 0x88341B1F, // 0068 GETMBR R13 R13 K31 + 0x900E200D, // 0069 SETMBR R3 K16 R13 + 0x8C340120, // 006A GETMET R13 R0 K32 + 0x5C3C1800, // 006B MOVE R15 R12 + 0x5C400600, // 006C MOVE R16 R3 + 0x4C440000, // 006D LDNIL R17 + 0x7C340800, // 006E CALL R13 4 + 0x88340B0B, // 006F GETMBR R13 R5 K11 + 0x8C341B21, // 0070 GETMET R13 R13 K33 + 0x5C3C1800, // 0071 MOVE R15 R12 + 0x7C340400, // 0072 CALL R13 2 + 0xB8363600, // 0073 GETNGBL R13 K27 + 0x8C341B22, // 0074 GETMET R13 R13 K34 + 0x583C001E, // 0075 LDCONST R15 K30 + 0x7C340400, // 0076 CALL R13 2 + 0x78360009, // 0077 JMPF R13 #0082 0xB8363600, // 0078 GETNGBL R13 K27 - 0x8C341B24, // 0079 GETMET R13 R13 K36 - 0x583C0020, // 007A LDCONST R15 K32 - 0x7C340400, // 007B CALL R13 2 - 0x78360009, // 007C JMPF R13 #0087 - 0xB8363600, // 007D GETNGBL R13 K27 - 0x8C341B02, // 007E GETMET R13 R13 K2 - 0x603C0018, // 007F GETGBL R15 G24 - 0x58400025, // 0080 LDCONST R16 K37 - 0x88440315, // 0081 GETMBR R17 R1 K21 - 0x8844231D, // 0082 GETMBR R17 R17 K29 - 0x88480326, // 0083 GETMBR R18 R1 K38 - 0x7C3C0600, // 0084 CALL R15 3 - 0x58400020, // 0085 LDCONST R16 K32 - 0x7C340600, // 0086 CALL R13 3 - 0x70020052, // 0087 JMP #00DB - 0x4C340000, // 0088 LDNIL R13 - 0x2034140D, // 0089 NE R13 R10 R13 - 0x78360022, // 008A JMPF R13 #00AE - 0x8C340122, // 008B GETMET R13 R0 K34 - 0x5C3C1800, // 008C MOVE R15 R12 - 0x5C400600, // 008D MOVE R16 R3 - 0x5C441400, // 008E MOVE R17 R10 - 0x7C340800, // 008F CALL R13 4 - 0x88340B0B, // 0090 GETMBR R13 R5 K11 - 0x8C341B23, // 0091 GETMET R13 R13 K35 - 0x5C3C1800, // 0092 MOVE R15 R12 - 0x7C340400, // 0093 CALL R13 2 - 0xB8360000, // 0094 GETNGBL R13 K0 - 0x8C341B12, // 0095 GETMET R13 R13 K18 - 0x883C070E, // 0096 GETMBR R15 R3 K14 - 0x8840070F, // 0097 GETMBR R16 R3 K15 - 0x7C340600, // 0098 CALL R13 3 - 0x5C201A00, // 0099 MOVE R8 R13 - 0x5C341000, // 009A MOVE R13 R8 - 0x74360000, // 009B JMPT R13 #009D - 0x5820001A, // 009C LDCONST R8 K26 + 0x8C341B02, // 0079 GETMET R13 R13 K2 + 0x603C0018, // 007A GETGBL R15 G24 + 0x58400023, // 007B LDCONST R16 K35 + 0x88440315, // 007C GETMBR R17 R1 K21 + 0x8844231D, // 007D GETMBR R17 R17 K29 + 0x88480324, // 007E GETMBR R18 R1 K36 + 0x7C3C0600, // 007F CALL R15 3 + 0x5840001E, // 0080 LDCONST R16 K30 + 0x7C340600, // 0081 CALL R13 3 + 0x70020052, // 0082 JMP #00D6 + 0x4C340000, // 0083 LDNIL R13 + 0x2034140D, // 0084 NE R13 R10 R13 + 0x78360022, // 0085 JMPF R13 #00A9 + 0x8C340120, // 0086 GETMET R13 R0 K32 + 0x5C3C1800, // 0087 MOVE R15 R12 + 0x5C400600, // 0088 MOVE R16 R3 + 0x5C441400, // 0089 MOVE R17 R10 + 0x7C340800, // 008A CALL R13 4 + 0x88340B0B, // 008B GETMBR R13 R5 K11 + 0x8C341B21, // 008C GETMET R13 R13 K33 + 0x5C3C1800, // 008D MOVE R15 R12 + 0x7C340400, // 008E CALL R13 2 + 0xB8360000, // 008F GETNGBL R13 K0 + 0x8C341B12, // 0090 GETMET R13 R13 K18 + 0x883C070E, // 0091 GETMBR R15 R3 K14 + 0x8840070F, // 0092 GETMBR R16 R3 K15 + 0x7C340600, // 0093 CALL R13 3 + 0x5C201A00, // 0094 MOVE R8 R13 + 0x5C341000, // 0095 MOVE R13 R8 + 0x74360000, // 0096 JMPT R13 #0098 + 0x5820001A, // 0097 LDCONST R8 K26 + 0xB8363600, // 0098 GETNGBL R13 K27 + 0x8C341B22, // 0099 GETMET R13 R13 K34 + 0x583C001E, // 009A LDCONST R15 K30 + 0x7C340400, // 009B CALL R13 2 + 0x7836000A, // 009C JMPF R13 #00A8 0xB8363600, // 009D GETNGBL R13 K27 - 0x8C341B24, // 009E GETMET R13 R13 K36 - 0x583C0020, // 009F LDCONST R15 K32 - 0x7C340400, // 00A0 CALL R13 2 - 0x7836000A, // 00A1 JMPF R13 #00AD - 0xB8363600, // 00A2 GETNGBL R13 K27 - 0x8C341B02, // 00A3 GETMET R13 R13 K2 - 0x603C0018, // 00A4 GETGBL R15 G24 - 0x58400027, // 00A5 LDCONST R16 K39 - 0x88440315, // 00A6 GETMBR R17 R1 K21 - 0x8844231D, // 00A7 GETMBR R17 R17 K29 - 0x5C480600, // 00A8 MOVE R18 R3 - 0x5C4C1000, // 00A9 MOVE R19 R8 - 0x7C3C0800, // 00AA CALL R15 4 - 0x58400020, // 00AB LDCONST R16 K32 - 0x7C340600, // 00AC CALL R13 3 - 0x7002002C, // 00AD JMP #00DB - 0x88340710, // 00AE GETMBR R13 R3 K16 - 0x4C380000, // 00AF LDNIL R14 - 0x20341A0E, // 00B0 NE R13 R13 R14 - 0x78360019, // 00B1 JMPF R13 #00CC - 0x8C340122, // 00B2 GETMET R13 R0 K34 - 0x5C3C1800, // 00B3 MOVE R15 R12 - 0x5C400600, // 00B4 MOVE R16 R3 - 0x4C440000, // 00B5 LDNIL R17 - 0x7C340800, // 00B6 CALL R13 4 - 0x88340B0B, // 00B7 GETMBR R13 R5 K11 - 0x8C341B23, // 00B8 GETMET R13 R13 K35 - 0x5C3C1800, // 00B9 MOVE R15 R12 - 0x7C340400, // 00BA CALL R13 2 + 0x8C341B02, // 009E GETMET R13 R13 K2 + 0x603C0018, // 009F GETGBL R15 G24 + 0x58400025, // 00A0 LDCONST R16 K37 + 0x88440315, // 00A1 GETMBR R17 R1 K21 + 0x8844231D, // 00A2 GETMBR R17 R17 K29 + 0x5C480600, // 00A3 MOVE R18 R3 + 0x5C4C1000, // 00A4 MOVE R19 R8 + 0x7C3C0800, // 00A5 CALL R15 4 + 0x5840001E, // 00A6 LDCONST R16 K30 + 0x7C340600, // 00A7 CALL R13 3 + 0x7002002C, // 00A8 JMP #00D6 + 0x88340710, // 00A9 GETMBR R13 R3 K16 + 0x4C380000, // 00AA LDNIL R14 + 0x20341A0E, // 00AB NE R13 R13 R14 + 0x78360019, // 00AC JMPF R13 #00C7 + 0x8C340120, // 00AD GETMET R13 R0 K32 + 0x5C3C1800, // 00AE MOVE R15 R12 + 0x5C400600, // 00AF MOVE R16 R3 + 0x4C440000, // 00B0 LDNIL R17 + 0x7C340800, // 00B1 CALL R13 4 + 0x88340B0B, // 00B2 GETMBR R13 R5 K11 + 0x8C341B21, // 00B3 GETMET R13 R13 K33 + 0x5C3C1800, // 00B4 MOVE R15 R12 + 0x7C340400, // 00B5 CALL R13 2 + 0xB8363600, // 00B6 GETNGBL R13 K27 + 0x8C341B22, // 00B7 GETMET R13 R13 K34 + 0x583C001E, // 00B8 LDCONST R15 K30 + 0x7C340400, // 00B9 CALL R13 2 + 0x7836000A, // 00BA JMPF R13 #00C6 0xB8363600, // 00BB GETNGBL R13 K27 - 0x8C341B24, // 00BC GETMET R13 R13 K36 - 0x583C0020, // 00BD LDCONST R15 K32 - 0x7C340400, // 00BE CALL R13 2 - 0x7836000A, // 00BF JMPF R13 #00CB - 0xB8363600, // 00C0 GETNGBL R13 K27 - 0x8C341B02, // 00C1 GETMET R13 R13 K2 - 0x603C0018, // 00C2 GETGBL R15 G24 - 0x58400028, // 00C3 LDCONST R16 K40 - 0x88440315, // 00C4 GETMBR R17 R1 K21 - 0x8844231D, // 00C5 GETMBR R17 R17 K29 - 0x88480710, // 00C6 GETMBR R18 R3 K16 - 0x884C0326, // 00C7 GETMBR R19 R1 K38 - 0x7C3C0800, // 00C8 CALL R15 4 - 0x58400020, // 00C9 LDCONST R16 K32 - 0x7C340600, // 00CA CALL R13 3 - 0x7002000E, // 00CB JMP #00DB + 0x8C341B02, // 00BC GETMET R13 R13 K2 + 0x603C0018, // 00BD GETGBL R15 G24 + 0x58400026, // 00BE LDCONST R16 K38 + 0x88440315, // 00BF GETMBR R17 R1 K21 + 0x8844231D, // 00C0 GETMBR R17 R17 K29 + 0x88480710, // 00C1 GETMBR R18 R3 K16 + 0x884C0324, // 00C2 GETMBR R19 R1 K36 + 0x7C3C0800, // 00C3 CALL R15 4 + 0x5840001E, // 00C4 LDCONST R16 K30 + 0x7C340600, // 00C5 CALL R13 3 + 0x7002000E, // 00C6 JMP #00D6 + 0xB8363600, // 00C7 GETNGBL R13 K27 + 0x8C341B22, // 00C8 GETMET R13 R13 K34 + 0x583C001E, // 00C9 LDCONST R15 K30 + 0x7C340400, // 00CA CALL R13 2 + 0x78360009, // 00CB JMPF R13 #00D6 0xB8363600, // 00CC GETNGBL R13 K27 - 0x8C341B24, // 00CD GETMET R13 R13 K36 - 0x583C0020, // 00CE LDCONST R15 K32 - 0x7C340400, // 00CF CALL R13 2 - 0x78360009, // 00D0 JMPF R13 #00DB - 0xB8363600, // 00D1 GETNGBL R13 K27 - 0x8C341B02, // 00D2 GETMET R13 R13 K2 - 0x603C0018, // 00D3 GETGBL R15 G24 - 0x58400029, // 00D4 LDCONST R16 K41 - 0x88440315, // 00D5 GETMBR R17 R1 K21 - 0x8844231D, // 00D6 GETMBR R17 R17 K29 - 0x88480326, // 00D7 GETMBR R18 R1 K38 - 0x7C3C0600, // 00D8 CALL R15 3 - 0x58400020, // 00D9 LDCONST R16 K32 - 0x7C340600, // 00DA CALL R13 3 - 0x7001FF42, // 00DB JMP #001F - 0x5818002A, // 00DC LDCONST R6 K42 - 0xAC180200, // 00DD CATCH R6 1 0 - 0xB0080000, // 00DE RAISE 2 R0 R0 - 0x6018000C, // 00DF GETGBL R6 G12 - 0x881C0B0B, // 00E0 GETMBR R7 R5 K11 - 0x7C180200, // 00E1 CALL R6 1 - 0x24180D1E, // 00E2 GT R6 R6 K30 - 0x781A0004, // 00E3 JMPF R6 #00E9 - 0x8C18012B, // 00E4 GETMET R6 R0 K43 - 0x5C200200, // 00E5 MOVE R8 R1 - 0x5C240A00, // 00E6 MOVE R9 R5 - 0x7C180600, // 00E7 CALL R6 3 - 0x70020001, // 00E8 JMP #00EB - 0x50180000, // 00E9 LDBOOL R6 0 0 - 0x80040C00, // 00EA RET 1 R6 - 0x50180200, // 00EB LDBOOL R6 1 0 - 0x80040C00, // 00EC RET 1 R6 - 0x80000000, // 00ED RET 0 + 0x8C341B02, // 00CD GETMET R13 R13 K2 + 0x603C0018, // 00CE GETGBL R15 G24 + 0x58400027, // 00CF LDCONST R16 K39 + 0x88440315, // 00D0 GETMBR R17 R1 K21 + 0x8844231D, // 00D1 GETMBR R17 R17 K29 + 0x88480324, // 00D2 GETMBR R18 R1 K36 + 0x7C3C0600, // 00D3 CALL R15 3 + 0x5840001E, // 00D4 LDCONST R16 K30 + 0x7C340600, // 00D5 CALL R13 3 + 0x7001FF47, // 00D6 JMP #001F + 0x58180028, // 00D7 LDCONST R6 K40 + 0xAC180200, // 00D8 CATCH R6 1 0 + 0xB0080000, // 00D9 RAISE 2 R0 R0 + 0x6018000C, // 00DA GETGBL R6 G12 + 0x881C0B0B, // 00DB GETMBR R7 R5 K11 + 0x7C180200, // 00DC CALL R6 1 + 0x24180D29, // 00DD GT R6 R6 K41 + 0x781A0004, // 00DE JMPF R6 #00E4 + 0x8C18012A, // 00DF GETMET R6 R0 K42 + 0x5C200200, // 00E0 MOVE R8 R1 + 0x5C240A00, // 00E1 MOVE R9 R5 + 0x7C180600, // 00E2 CALL R6 3 + 0x70020001, // 00E3 JMP #00E6 + 0x50180000, // 00E4 LDBOOL R6 0 0 + 0x80040C00, // 00E5 RET 1 R6 + 0x50180200, // 00E6 LDBOOL R6 1 0 + 0x80040C00, // 00E7 RET 1 R6 + 0x80000000, // 00E8 RET 0 }) ) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin.h index 806c7361feec..59e6b0fcfcca 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin.h @@ -7,37 +7,61 @@ extern const bclass be_class_Matter_Plugin; /******************************************************************** -** Solidified function: init +** Solidified function: parse_sensors ********************************************************************/ -be_local_closure(Matter_Plugin_init, /* name */ +be_local_closure(Matter_Plugin_parse_sensors, /* name */ be_nested_proto( - 7, /* nstack */ - 4, /* argc */ + 2, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(parse_sensors), + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: update_shadow_lazy +********************************************************************/ +be_local_closure(Matter_Plugin_update_shadow_lazy, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_str_weak(device), - /* K1 */ be_nested_str_weak(endpoint), - /* K2 */ be_nested_str_weak(clusters), - /* K3 */ be_nested_str_weak(consolidate_clusters), - /* K4 */ be_nested_str_weak(parse_configuration), + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(tick), + /* K1 */ be_nested_str_weak(device), + /* K2 */ be_nested_str_weak(update_shadow), }), - be_str_weak(init), + be_str_weak(update_shadow_lazy), &be_const_str_solidified, - ( &(const binstruction[ 9]) { /* code */ - 0x90020001, // 0000 SETMBR R0 K0 R1 - 0x90020202, // 0001 SETMBR R0 K1 R2 - 0x8C100103, // 0002 GETMET R4 R0 K3 - 0x7C100200, // 0003 CALL R4 1 - 0x90020404, // 0004 SETMBR R0 K2 R4 - 0x8C100104, // 0005 GETMET R4 R0 K4 - 0x5C180600, // 0006 MOVE R6 R3 - 0x7C100400, // 0007 CALL R4 2 - 0x80000000, // 0008 RET 0 + ( &(const binstruction[11]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x88080101, // 0001 GETMBR R2 R0 K1 + 0x88080500, // 0002 GETMBR R2 R2 K0 + 0x20040202, // 0003 NE R1 R1 R2 + 0x78060004, // 0004 JMPF R1 #000A + 0x8C040102, // 0005 GETMET R1 R0 K2 + 0x7C040200, // 0006 CALL R1 1 + 0x88040101, // 0007 GETMBR R1 R0 K1 + 0x88040300, // 0008 GETMBR R1 R1 K0 + 0x90020001, // 0009 SETMBR R0 K0 R1 + 0x80000000, // 000A RET 0 }) ) ); @@ -70,12 +94,12 @@ be_local_closure(Matter_Plugin_read_event, /* name */ /******************************************************************** -** Solidified function: is_local_device +** Solidified function: invoke_request ********************************************************************/ -be_local_closure(Matter_Plugin_is_local_device, /* name */ +be_local_closure(Matter_Plugin_invoke_request, /* name */ be_nested_proto( - 2, /* nstack */ - 1, /* argc */ + 5, /* nstack */ + 4, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -83,11 +107,61 @@ be_local_closure(Matter_Plugin_is_local_device, /* name */ NULL, /* no sub protos */ 0, /* has constants */ NULL, /* no const */ - be_str_weak(is_local_device), + be_str_weak(invoke_request), &be_const_str_solidified, ( &(const binstruction[ 2]) { /* code */ - 0x50040200, // 0000 LDBOOL R1 1 0 - 0x80040200, // 0001 RET 1 R1 + 0x4C100000, // 0000 LDNIL R4 + 0x80040800, // 0001 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: contains_attribute +********************************************************************/ +be_local_closure(Matter_Plugin_contains_attribute, /* 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(clusters), + /* K1 */ be_nested_str_weak(find), + /* K2 */ be_const_int(0), + /* K3 */ be_const_int(1), + }), + be_str_weak(contains_attribute), + &be_const_str_solidified, + ( &(const binstruction[22]) { /* code */ + 0x880C0100, // 0000 GETMBR R3 R0 K0 + 0x8C0C0701, // 0001 GETMET R3 R3 K1 + 0x5C140200, // 0002 MOVE R5 R1 + 0x7C0C0400, // 0003 CALL R3 2 + 0x4C100000, // 0004 LDNIL R4 + 0x20100604, // 0005 NE R4 R3 R4 + 0x7812000C, // 0006 JMPF R4 #0014 + 0x58100002, // 0007 LDCONST R4 K2 + 0x6014000C, // 0008 GETGBL R5 G12 + 0x5C180600, // 0009 MOVE R6 R3 + 0x7C140200, // 000A CALL R5 1 + 0x14140805, // 000B LT R5 R4 R5 + 0x78160006, // 000C JMPF R5 #0014 + 0x94140604, // 000D GETIDX R5 R3 R4 + 0x1C140A02, // 000E EQ R5 R5 R2 + 0x78160001, // 000F JMPF R5 #0012 + 0x50140200, // 0010 LDBOOL R5 1 0 + 0x80040A00, // 0011 RET 1 R5 + 0x00100903, // 0012 ADD R4 R4 K3 + 0x7001FFF3, // 0013 JMP #0008 + 0x50100000, // 0014 LDBOOL R4 0 0 + 0x80040800, // 0015 RET 1 R4 }) ) ); @@ -120,39 +194,24 @@ be_local_closure(Matter_Plugin_write_attribute, /* name */ /******************************************************************** -** Solidified function: ui_conf_to_string +** Solidified function: subscribe_attribute ********************************************************************/ -be_local_closure(Matter_Plugin_ui_conf_to_string, /* name */ +be_local_closure(Matter_Plugin_subscribe_attribute, /* name */ be_nested_proto( - 9, /* nstack */ - 2, /* argc */ - 4, /* varg */ + 6, /* nstack */ + 5, /* argc */ + 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_const_class(be_class_Matter_Plugin), - /* K1 */ be_nested_str_weak(ARG), - /* K2 */ be_nested_str_weak(find), - /* K3 */ be_nested_str_weak(), - }), - be_str_weak(ui_conf_to_string), + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(subscribe_attribute), &be_const_str_solidified, - ( &(const binstruction[12]) { /* code */ - 0x58080000, // 0000 LDCONST R2 K0 - 0x880C0101, // 0001 GETMBR R3 R0 K1 - 0x780E0006, // 0002 JMPF R3 #000A - 0x60100008, // 0003 GETGBL R4 G8 - 0x8C140302, // 0004 GETMET R5 R1 K2 - 0x5C1C0600, // 0005 MOVE R7 R3 - 0x58200003, // 0006 LDCONST R8 K3 - 0x7C140600, // 0007 CALL R5 3 - 0x7C100200, // 0008 CALL R4 1 - 0x70020000, // 0009 JMP #000B - 0x58100003, // 000A LDCONST R4 K3 - 0x80040800, // 000B RET 1 R4 + ( &(const binstruction[ 2]) { /* code */ + 0x4C140000, // 0000 LDNIL R5 + 0x80040A00, // 0001 RET 1 R5 }) ) ); @@ -160,61 +219,78 @@ be_local_closure(Matter_Plugin_ui_conf_to_string, /* name */ /******************************************************************** -** Solidified function: every_250ms +** Solidified function: publish_command ********************************************************************/ -be_local_closure(Matter_Plugin_every_250ms, /* name */ +be_local_closure(Matter_Plugin_publish_command, /* name */ be_nested_proto( - 4, /* nstack */ - 1, /* argc */ + 16, /* 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(update_next), - /* K1 */ be_nested_str_weak(matter), - /* K2 */ be_nested_str_weak(jitter), - /* K3 */ be_nested_str_weak(UPDATE_TIME), - /* K4 */ be_nested_str_weak(tasmota), - /* K5 */ be_nested_str_weak(time_reached), - /* K6 */ be_nested_str_weak(tick), - /* K7 */ be_nested_str_weak(device), - /* K8 */ be_nested_str_weak(update_shadow), - /* K9 */ be_nested_str_weak(millis), + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(json), + /* K1 */ be_nested_str_weak(_X25s_X3A_X25s), + /* K2 */ be_nested_str_weak(dump), + /* K3 */ be_nested_str_weak(_X25s_X2C_X25s_X3A_X25s), + /* K4 */ be_nested_str_weak(matter), + /* K5 */ be_nested_str_weak(publish_command), + /* K6 */ be_nested_str_weak(MtrReceived), + /* K7 */ be_nested_str_weak(endpoint), + /* K8 */ be_nested_str_weak(node_label), }), - be_str_weak(every_250ms), + be_str_weak(publish_command), &be_const_str_solidified, - ( &(const binstruction[28]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x4C080000, // 0001 LDNIL R2 - 0x1C040202, // 0002 EQ R1 R1 R2 - 0x78060005, // 0003 JMPF R1 #000A - 0xB8060200, // 0004 GETNGBL R1 K1 - 0x8C040302, // 0005 GETMET R1 R1 K2 - 0x880C0103, // 0006 GETMBR R3 R0 K3 - 0x7C040400, // 0007 CALL R1 2 - 0x90020001, // 0008 SETMBR R0 K0 R1 - 0x70020010, // 0009 JMP #001B - 0xB8060800, // 000A GETNGBL R1 K4 - 0x8C040305, // 000B GETMET R1 R1 K5 - 0x880C0100, // 000C GETMBR R3 R0 K0 - 0x7C040400, // 000D CALL R1 2 - 0x7806000B, // 000E JMPF R1 #001B - 0x88040106, // 000F GETMBR R1 R0 K6 - 0x88080107, // 0010 GETMBR R2 R0 K7 - 0x88080506, // 0011 GETMBR R2 R2 K6 - 0x20040202, // 0012 NE R1 R1 R2 - 0x78060001, // 0013 JMPF R1 #0016 - 0x8C040108, // 0014 GETMET R1 R0 K8 - 0x7C040200, // 0015 CALL R1 1 - 0xB8060800, // 0016 GETNGBL R1 K4 - 0x8C040309, // 0017 GETMET R1 R1 K9 - 0x880C0103, // 0018 GETMBR R3 R0 K3 - 0x7C040400, // 0019 CALL R1 2 - 0x90020001, // 001A SETMBR R0 K0 R1 - 0x80000000, // 001B RET 0 + ( &(const binstruction[46]) { /* code */ + 0xA41E0000, // 0000 IMPORT R7 K0 + 0x60200018, // 0001 GETGBL R8 G24 + 0x58240001, // 0002 LDCONST R9 K1 + 0x8C280F02, // 0003 GETMET R10 R7 K2 + 0x5C300200, // 0004 MOVE R12 R1 + 0x7C280400, // 0005 CALL R10 2 + 0x8C2C0F02, // 0006 GETMET R11 R7 K2 + 0x5C340400, // 0007 MOVE R13 R2 + 0x7C2C0400, // 0008 CALL R11 2 + 0x7C200600, // 0009 CALL R8 3 + 0x4C240000, // 000A LDNIL R9 + 0x20240609, // 000B NE R9 R3 R9 + 0x7826000A, // 000C JMPF R9 #0018 + 0x60240018, // 000D GETGBL R9 G24 + 0x58280003, // 000E LDCONST R10 K3 + 0x5C2C1000, // 000F MOVE R11 R8 + 0x8C300F02, // 0010 GETMET R12 R7 K2 + 0x5C380600, // 0011 MOVE R14 R3 + 0x7C300400, // 0012 CALL R12 2 + 0x8C340F02, // 0013 GETMET R13 R7 K2 + 0x5C3C0800, // 0014 MOVE R15 R4 + 0x7C340400, // 0015 CALL R13 2 + 0x7C240800, // 0016 CALL R9 4 + 0x5C201200, // 0017 MOVE R8 R9 + 0x4C240000, // 0018 LDNIL R9 + 0x20240A09, // 0019 NE R9 R5 R9 + 0x7826000A, // 001A JMPF R9 #0026 + 0x60240018, // 001B GETGBL R9 G24 + 0x58280003, // 001C LDCONST R10 K3 + 0x5C2C1000, // 001D MOVE R11 R8 + 0x8C300F02, // 001E GETMET R12 R7 K2 + 0x5C380A00, // 001F MOVE R14 R5 + 0x7C300400, // 0020 CALL R12 2 + 0x8C340F02, // 0021 GETMET R13 R7 K2 + 0x5C3C0C00, // 0022 MOVE R15 R6 + 0x7C340400, // 0023 CALL R13 2 + 0x7C240800, // 0024 CALL R9 4 + 0x5C201200, // 0025 MOVE R8 R9 + 0xB8260800, // 0026 GETNGBL R9 K4 + 0x8C241305, // 0027 GETMET R9 R9 K5 + 0x582C0006, // 0028 LDCONST R11 K6 + 0x88300107, // 0029 GETMBR R12 R0 K7 + 0x88340108, // 002A GETMBR R13 R0 K8 + 0x5C381000, // 002B MOVE R14 R8 + 0x7C240A00, // 002C CALL R9 5 + 0x80000000, // 002D RET 0 }) ) ); @@ -222,49 +298,30 @@ be_local_closure(Matter_Plugin_every_250ms, /* name */ /******************************************************************** -** Solidified function: contains_attribute +** Solidified function: contains_cluster ********************************************************************/ -be_local_closure(Matter_Plugin_contains_attribute, /* name */ +be_local_closure(Matter_Plugin_contains_cluster, /* name */ be_nested_proto( - 7, /* nstack */ - 3, /* argc */ + 5, /* nstack */ + 2, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ + ( &(const bvalue[ 2]) { /* constants */ /* K0 */ be_nested_str_weak(clusters), - /* K1 */ be_nested_str_weak(find), - /* K2 */ be_const_int(0), - /* K3 */ be_const_int(1), + /* K1 */ be_nested_str_weak(contains), }), - be_str_weak(contains_attribute), + be_str_weak(contains_cluster), &be_const_str_solidified, - ( &(const binstruction[22]) { /* code */ - 0x880C0100, // 0000 GETMBR R3 R0 K0 - 0x8C0C0701, // 0001 GETMET R3 R3 K1 - 0x5C140200, // 0002 MOVE R5 R1 - 0x7C0C0400, // 0003 CALL R3 2 - 0x4C100000, // 0004 LDNIL R4 - 0x20100604, // 0005 NE R4 R3 R4 - 0x7812000C, // 0006 JMPF R4 #0014 - 0x58100002, // 0007 LDCONST R4 K2 - 0x6014000C, // 0008 GETGBL R5 G12 - 0x5C180600, // 0009 MOVE R6 R3 - 0x7C140200, // 000A CALL R5 1 - 0x14140805, // 000B LT R5 R4 R5 - 0x78160006, // 000C JMPF R5 #0014 - 0x94140604, // 000D GETIDX R5 R3 R4 - 0x1C140A02, // 000E EQ R5 R5 R2 - 0x78160001, // 000F JMPF R5 #0012 - 0x50140200, // 0010 LDBOOL R5 1 0 - 0x80040A00, // 0011 RET 1 R5 - 0x00100903, // 0012 ADD R4 R4 K3 - 0x7001FFF3, // 0013 JMP #0008 - 0x50100000, // 0014 LDBOOL R4 0 0 - 0x80040800, // 0015 RET 1 R4 + ( &(const binstruction[ 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 }) ) ); @@ -272,23 +329,41 @@ be_local_closure(Matter_Plugin_contains_attribute, /* name */ /******************************************************************** -** Solidified function: parse_sensors +** Solidified function: ack_request ********************************************************************/ -be_local_closure(Matter_Plugin_parse_sensors, /* name */ +be_local_closure(Matter_Plugin_ack_request, /* name */ be_nested_proto( - 2, /* nstack */ + 6, /* nstack */ 2, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ NULL, /* no sub protos */ - 0, /* has constants */ - NULL, /* no const */ - be_str_weak(parse_sensors), + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(msg), + /* K1 */ be_nested_str_weak(device), + /* K2 */ be_nested_str_weak(message_handler), + /* K3 */ be_nested_str_weak(im), + /* K4 */ be_nested_str_weak(send_ack_now), + }), + be_str_weak(ack_request), &be_const_str_solidified, - ( &(const binstruction[ 1]) { /* code */ - 0x80000000, // 0000 RET 0 + ( &(const binstruction[13]) { /* code */ + 0x88080300, // 0000 GETMBR R2 R1 K0 + 0x4C0C0000, // 0001 LDNIL R3 + 0x200C0403, // 0002 NE R3 R2 R3 + 0x780E0005, // 0003 JMPF R3 #000A + 0x880C0101, // 0004 GETMBR R3 R0 K1 + 0x880C0702, // 0005 GETMBR R3 R3 K2 + 0x880C0703, // 0006 GETMBR R3 R3 K3 + 0x8C0C0704, // 0007 GETMET R3 R3 K4 + 0x5C140400, // 0008 MOVE R5 R2 + 0x7C0C0400, // 0009 CALL R3 2 + 0x4C0C0000, // 000A LDNIL R3 + 0x90060003, // 000B SETMBR R1 K0 R3 + 0x80000000, // 000C RET 0 }) ) ); @@ -296,42 +371,26 @@ be_local_closure(Matter_Plugin_parse_sensors, /* name */ /******************************************************************** -** Solidified function: has +** Solidified function: get_name ********************************************************************/ -be_local_closure(Matter_Plugin_has, /* name */ +be_local_closure(Matter_Plugin_get_name, /* name */ be_nested_proto( - 6, /* nstack */ - 3, /* argc */ + 2, /* nstack */ + 1, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_str_weak(clusters), - /* K1 */ be_nested_str_weak(contains), - /* K2 */ be_nested_str_weak(endpoints), - /* K3 */ be_nested_str_weak(find), + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(node_label), }), - be_str_weak(has), + be_str_weak(get_name), &be_const_str_solidified, - ( &(const binstruction[15]) { /* code */ - 0x880C0100, // 0000 GETMBR R3 R0 K0 - 0x8C0C0701, // 0001 GETMET R3 R3 K1 - 0x5C140200, // 0002 MOVE R5 R1 - 0x7C0C0400, // 0003 CALL R3 2 - 0x780E0006, // 0004 JMPF R3 #000C - 0x880C0102, // 0005 GETMBR R3 R0 K2 - 0x8C0C0703, // 0006 GETMET R3 R3 K3 - 0x5C140400, // 0007 MOVE R5 R2 - 0x7C0C0400, // 0008 CALL R3 2 - 0x4C100000, // 0009 LDNIL R4 - 0x200C0604, // 000A NE R3 R3 R4 - 0x740E0000, // 000B JMPT R3 #000D - 0x500C0001, // 000C LDBOOL R3 0 1 - 0x500C0200, // 000D LDBOOL R3 1 0 - 0x80040600, // 000E RET 1 R3 + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 }) ) ); @@ -363,36 +422,94 @@ be_local_closure(Matter_Plugin_parse_configuration, /* name */ /******************************************************************** -** Solidified function: ui_string_to_conf +** Solidified function: subscribe_event ********************************************************************/ -be_local_closure(Matter_Plugin_ui_string_to_conf, /* name */ +be_local_closure(Matter_Plugin_subscribe_event, /* name */ be_nested_proto( - 8, /* nstack */ - 3, /* argc */ - 4, /* varg */ + 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: set_name +********************************************************************/ +be_local_closure(Matter_Plugin_set_name, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(node_label), + /* K1 */ be_nested_str_weak(attribute_updated), + }), + be_str_weak(set_name), + &be_const_str_solidified, + ( &(const binstruction[ 9]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x20080202, // 0001 NE R2 R1 R2 + 0x780A0003, // 0002 JMPF R2 #0007 + 0x8C080101, // 0003 GETMET R2 R0 K1 + 0x54120038, // 0004 LDINT R4 57 + 0x54160004, // 0005 LDINT R5 5 + 0x7C080600, // 0006 CALL R2 3 + 0x90020001, // 0007 SETMBR R0 K0 R1 + 0x80000000, // 0008 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: attribute_updated +********************************************************************/ +be_local_closure(Matter_Plugin_attribute_updated, /* 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[ 3]) { /* constants */ - /* K0 */ be_const_class(be_class_Matter_Plugin), - /* K1 */ be_nested_str_weak(ARG), - /* K2 */ be_nested_str_weak(ARG_TYPE), + /* K0 */ be_nested_str_weak(device), + /* K1 */ be_nested_str_weak(attribute_updated), + /* K2 */ be_nested_str_weak(endpoint), }), - be_str_weak(ui_string_to_conf), + be_str_weak(attribute_updated), &be_const_str_solidified, - ( &(const binstruction[10]) { /* code */ - 0x580C0000, // 0000 LDCONST R3 K0 - 0x88100101, // 0001 GETMBR R4 R0 K1 - 0x88140102, // 0002 GETMBR R5 R0 K2 - 0x780A0004, // 0003 JMPF R2 #0009 - 0x78120003, // 0004 JMPF R4 #0009 - 0x5C180A00, // 0005 MOVE R6 R5 - 0x5C1C0400, // 0006 MOVE R7 R2 - 0x7C180200, // 0007 CALL R6 1 - 0x98040806, // 0008 SETIDX R1 R4 R6 - 0x80040200, // 0009 RET 1 R1 + ( &(const binstruction[ 8]) { /* code */ + 0x88100100, // 0000 GETMBR R4 R0 K0 + 0x8C100901, // 0001 GETMET R4 R4 K1 + 0x88180102, // 0002 GETMBR R6 R0 K2 + 0x5C1C0200, // 0003 MOVE R7 R1 + 0x5C200400, // 0004 MOVE R8 R2 + 0x5C240600, // 0005 MOVE R9 R3 + 0x7C100A00, // 0006 CALL R4 5 + 0x80000000, // 0007 RET 0 }) ) ); @@ -400,12 +517,12 @@ be_local_closure(Matter_Plugin_ui_string_to_conf, /* name */ /******************************************************************** -** Solidified function: subscribe_attribute +** Solidified function: timed_request ********************************************************************/ -be_local_closure(Matter_Plugin_subscribe_attribute, /* name */ +be_local_closure(Matter_Plugin_timed_request, /* name */ be_nested_proto( - 6, /* nstack */ - 5, /* argc */ + 5, /* nstack */ + 4, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -413,11 +530,81 @@ be_local_closure(Matter_Plugin_subscribe_attribute, /* name */ NULL, /* no sub protos */ 0, /* has constants */ NULL, /* no const */ - be_str_weak(subscribe_attribute), + be_str_weak(timed_request), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x4C100000, // 0000 LDNIL R4 + 0x80040800, // 0001 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: +********************************************************************/ +be_local_closure(Matter_Plugin__X3Clambda_X3E, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(_X3Clambda_X3E), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x60040008, // 0000 GETGBL R1 G8 + 0x5C080000, // 0001 MOVE R2 R0 + 0x7C040200, // 0002 CALL R1 1 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: has +********************************************************************/ +be_local_closure(Matter_Plugin_has, /* 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(clusters), + /* K1 */ be_nested_str_weak(contains), + /* K2 */ be_nested_str_weak(endpoints), + /* K3 */ be_nested_str_weak(find), + }), + be_str_weak(has), &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x4C140000, // 0000 LDNIL R5 - 0x80040A00, // 0001 RET 1 R5 + ( &(const binstruction[15]) { /* code */ + 0x880C0100, // 0000 GETMBR R3 R0 K0 + 0x8C0C0701, // 0001 GETMET R3 R3 K1 + 0x5C140200, // 0002 MOVE R5 R1 + 0x7C0C0400, // 0003 CALL R3 2 + 0x780E0006, // 0004 JMPF R3 #000C + 0x880C0102, // 0005 GETMBR R3 R0 K2 + 0x8C0C0703, // 0006 GETMET R3 R3 K3 + 0x5C140400, // 0007 MOVE R5 R2 + 0x7C0C0400, // 0008 CALL R3 2 + 0x4C100000, // 0009 LDNIL R4 + 0x200C0604, // 000A NE R3 R3 R4 + 0x740E0000, // 000B JMPT R3 #000D + 0x500C0001, // 000C LDBOOL R3 0 1 + 0x500C0200, // 000D LDBOOL R3 1 0 + 0x80040600, // 000E RET 1 R3 }) ) ); @@ -425,41 +612,46 @@ be_local_closure(Matter_Plugin_subscribe_attribute, /* name */ /******************************************************************** -** Solidified function: ack_request +** Solidified function: init ********************************************************************/ -be_local_closure(Matter_Plugin_ack_request, /* name */ +be_local_closure(Matter_Plugin_init, /* name */ be_nested_proto( - 6, /* nstack */ - 2, /* argc */ + 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[ 5]) { /* constants */ - /* K0 */ be_nested_str_weak(msg), - /* K1 */ be_nested_str_weak(device), - /* K2 */ be_nested_str_weak(message_handler), - /* K3 */ be_nested_str_weak(im), - /* K4 */ be_nested_str_weak(send_ack_now), + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(device), + /* K1 */ be_nested_str_weak(endpoint), + /* K2 */ be_nested_str_weak(clusters), + /* K3 */ be_nested_str_weak(consolidate_clusters), + /* K4 */ be_nested_str_weak(parse_configuration), + /* K5 */ be_nested_str_weak(node_label), + /* K6 */ be_nested_str_weak(find), + /* K7 */ be_nested_str_weak(name), + /* K8 */ be_nested_str_weak(), }), - be_str_weak(ack_request), + be_str_weak(init), &be_const_str_solidified, - ( &(const binstruction[13]) { /* code */ - 0x88080300, // 0000 GETMBR R2 R1 K0 - 0x4C0C0000, // 0001 LDNIL R3 - 0x200C0403, // 0002 NE R3 R2 R3 - 0x780E0005, // 0003 JMPF R3 #000A - 0x880C0101, // 0004 GETMBR R3 R0 K1 - 0x880C0702, // 0005 GETMBR R3 R3 K2 - 0x880C0703, // 0006 GETMBR R3 R3 K3 - 0x8C0C0704, // 0007 GETMET R3 R3 K4 - 0x5C140400, // 0008 MOVE R5 R2 - 0x7C0C0400, // 0009 CALL R3 2 - 0x4C0C0000, // 000A LDNIL R3 - 0x90060003, // 000B SETMBR R1 K0 R3 - 0x80000000, // 000C RET 0 + ( &(const binstruction[14]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x90020202, // 0001 SETMBR R0 K1 R2 + 0x8C100103, // 0002 GETMET R4 R0 K3 + 0x7C100200, // 0003 CALL R4 1 + 0x90020404, // 0004 SETMBR R0 K2 R4 + 0x8C100104, // 0005 GETMET R4 R0 K4 + 0x5C180600, // 0006 MOVE R6 R3 + 0x7C100400, // 0007 CALL R4 2 + 0x8C100706, // 0008 GETMET R4 R3 K6 + 0x58180007, // 0009 LDCONST R6 K7 + 0x581C0008, // 000A LDCONST R7 K8 + 0x7C100600, // 000B CALL R4 3 + 0x90020A04, // 000C SETMBR R0 K5 R4 + 0x80000000, // 000D RET 0 }) ) ); @@ -512,6 +704,73 @@ be_local_closure(Matter_Plugin_get_cluster_list, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: ui_conf_to_string +********************************************************************/ +be_local_closure(Matter_Plugin_ui_conf_to_string, /* name */ + be_nested_proto( + 9, /* nstack */ + 2, /* argc */ + 4, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_const_class(be_class_Matter_Plugin), + /* K1 */ be_nested_str_weak(ARG), + /* K2 */ be_nested_str_weak(find), + /* K3 */ be_nested_str_weak(), + }), + be_str_weak(ui_conf_to_string), + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x58080000, // 0000 LDCONST R2 K0 + 0x880C0101, // 0001 GETMBR R3 R0 K1 + 0x780E0006, // 0002 JMPF R3 #000A + 0x60100008, // 0003 GETGBL R4 G8 + 0x8C140302, // 0004 GETMET R5 R1 K2 + 0x5C1C0600, // 0005 MOVE R7 R3 + 0x58200003, // 0006 LDCONST R8 K3 + 0x7C140600, // 0007 CALL R5 3 + 0x7C100200, // 0008 CALL R4 1 + 0x70020000, // 0009 JMP #000B + 0x58100003, // 000A LDCONST R4 K3 + 0x80040800, // 000B RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_endpoint +********************************************************************/ +be_local_closure(Matter_Plugin_get_endpoint, /* 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(endpoint), + }), + be_str_weak(get_endpoint), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: read_attribute ********************************************************************/ @@ -655,133 +914,15 @@ be_local_closure(Matter_Plugin_read_attribute, /* name */ 0x5C200000, // 0066 MOVE R8 R0 0x7C1C0200, // 0067 CALL R7 1 0x8C1C0F13, // 0068 GETMET R7 R7 K19 - 0x5C240200, // 0069 MOVE R9 R1 - 0x5C280400, // 006A MOVE R10 R2 - 0x5C2C0600, // 006B MOVE R11 R3 - 0x7C1C0800, // 006C CALL R7 4 - 0x80040E00, // 006D RET 1 R7 - 0x70020001, // 006E JMP #0071 - 0x4C1C0000, // 006F LDNIL R7 - 0x80040E00, // 0070 RET 1 R7 - 0x80000000, // 0071 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: contains_cluster -********************************************************************/ -be_local_closure(Matter_Plugin_contains_cluster, /* 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(clusters), - /* K1 */ be_nested_str_weak(contains), - }), - be_str_weak(contains_cluster), - &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: -********************************************************************/ -be_local_closure(Matter_Plugin__X3Clambda_X3E, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 0, /* has constants */ - NULL, /* no const */ - be_str_weak(_X3Clambda_X3E), - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x60040008, // 0000 GETGBL R1 G8 - 0x5C080000, // 0001 MOVE R2 R0 - 0x7C040200, // 0002 CALL R1 1 - 0x80040200, // 0003 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: attribute_updated -********************************************************************/ -be_local_closure(Matter_Plugin_attribute_updated, /* 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[ 3]) { /* constants */ - /* K0 */ be_nested_str_weak(device), - /* K1 */ be_nested_str_weak(attribute_updated), - /* K2 */ be_nested_str_weak(endpoint), - }), - be_str_weak(attribute_updated), - &be_const_str_solidified, - ( &(const binstruction[ 8]) { /* code */ - 0x88100100, // 0000 GETMBR R4 R0 K0 - 0x8C100901, // 0001 GETMET R4 R4 K1 - 0x88180102, // 0002 GETMBR R6 R0 K2 - 0x5C1C0200, // 0003 MOVE R7 R1 - 0x5C200400, // 0004 MOVE R8 R2 - 0x5C240600, // 0005 MOVE R9 R3 - 0x7C100A00, // 0006 CALL R4 5 - 0x80000000, // 0007 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** 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 + 0x5C240200, // 0069 MOVE R9 R1 + 0x5C280400, // 006A MOVE R10 R2 + 0x5C2C0600, // 006B MOVE R11 R3 + 0x7C1C0800, // 006C CALL R7 4 + 0x80040E00, // 006D RET 1 R7 + 0x70020001, // 006E JMP #0071 + 0x4C1C0000, // 006F LDNIL R7 + 0x80040E00, // 0070 RET 1 R7 + 0x80000000, // 0071 RET 0 }) ) ); @@ -789,11 +930,11 @@ be_local_closure(Matter_Plugin_invoke_request, /* name */ /******************************************************************** -** Solidified function: update_shadow_lazy +** Solidified function: update_shadow ********************************************************************/ -be_local_closure(Matter_Plugin_update_shadow_lazy, /* name */ +be_local_closure(Matter_Plugin_update_shadow, /* name */ be_nested_proto( - 3, /* nstack */ + 2, /* nstack */ 1, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -801,25 +942,17 @@ be_local_closure(Matter_Plugin_update_shadow_lazy, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ + ( &(const bvalue[ 2]) { /* constants */ /* K0 */ be_nested_str_weak(tick), /* K1 */ be_nested_str_weak(device), - /* K2 */ be_nested_str_weak(update_shadow), }), - be_str_weak(update_shadow_lazy), + be_str_weak(update_shadow), &be_const_str_solidified, - ( &(const binstruction[11]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x88080101, // 0001 GETMBR R2 R0 K1 - 0x88080500, // 0002 GETMBR R2 R2 K0 - 0x20040202, // 0003 NE R1 R1 R2 - 0x78060004, // 0004 JMPF R1 #000A - 0x8C040102, // 0005 GETMET R1 R0 K2 - 0x7C040200, // 0006 CALL R1 1 - 0x88040101, // 0007 GETMBR R1 R0 K1 - 0x88040300, // 0008 GETMBR R1 R1 K0 - 0x90020001, // 0009 SETMBR R0 K0 R1 - 0x80000000, // 000A RET 0 + ( &(const binstruction[ 4]) { /* code */ + 0x88040101, // 0000 GETMBR R1 R0 K1 + 0x88040300, // 0001 GETMBR R1 R1 K0 + 0x90020001, // 0002 SETMBR R0 K0 R1 + 0x80000000, // 0003 RET 0 }) ) ); @@ -827,76 +960,32 @@ be_local_closure(Matter_Plugin_update_shadow_lazy, /* name */ /******************************************************************** -** Solidified function: get_endpoint +** Solidified function: get_attribute_list ********************************************************************/ -be_local_closure(Matter_Plugin_get_endpoint, /* name */ +be_local_closure(Matter_Plugin_get_attribute_list, /* name */ be_nested_proto( - 2, /* nstack */ - 1, /* argc */ + 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(endpoint), + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(clusters), + /* K1 */ be_nested_str_weak(find), }), - be_str_weak(get_endpoint), - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x80040200, // 0001 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** 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 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_str_weak(get_attribute_list), &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x4C140000, // 0000 LDNIL R5 - 0x80040A00, // 0001 RET 1 R5 + ( &(const binstruction[ 7]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x5C100200, // 0002 MOVE R4 R1 + 0x60140012, // 0003 GETGBL R5 G18 + 0x7C140000, // 0004 CALL R5 0 + 0x7C080600, // 0005 CALL R2 3 + 0x80040400, // 0006 RET 1 R2 }) ) ); @@ -904,11 +993,11 @@ be_local_closure(Matter_Plugin_subscribe_event, /* name */ /******************************************************************** -** Solidified function: update_shadow +** Solidified function: every_250ms ********************************************************************/ -be_local_closure(Matter_Plugin_update_shadow, /* name */ +be_local_closure(Matter_Plugin_every_250ms, /* name */ be_nested_proto( - 2, /* nstack */ + 4, /* nstack */ 1, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -916,17 +1005,49 @@ be_local_closure(Matter_Plugin_update_shadow, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(tick), - /* K1 */ be_nested_str_weak(device), + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str_weak(update_next), + /* K1 */ be_nested_str_weak(matter), + /* K2 */ be_nested_str_weak(jitter), + /* K3 */ be_nested_str_weak(UPDATE_TIME), + /* K4 */ be_nested_str_weak(tasmota), + /* K5 */ be_nested_str_weak(time_reached), + /* K6 */ be_nested_str_weak(tick), + /* K7 */ be_nested_str_weak(device), + /* K8 */ be_nested_str_weak(update_shadow), + /* K9 */ be_nested_str_weak(millis), }), - be_str_weak(update_shadow), + be_str_weak(every_250ms), &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x88040101, // 0000 GETMBR R1 R0 K1 - 0x88040300, // 0001 GETMBR R1 R1 K0 - 0x90020001, // 0002 SETMBR R0 K0 R1 - 0x80000000, // 0003 RET 0 + ( &(const binstruction[28]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x4C080000, // 0001 LDNIL R2 + 0x1C040202, // 0002 EQ R1 R1 R2 + 0x78060005, // 0003 JMPF R1 #000A + 0xB8060200, // 0004 GETNGBL R1 K1 + 0x8C040302, // 0005 GETMET R1 R1 K2 + 0x880C0103, // 0006 GETMBR R3 R0 K3 + 0x7C040400, // 0007 CALL R1 2 + 0x90020001, // 0008 SETMBR R0 K0 R1 + 0x70020010, // 0009 JMP #001B + 0xB8060800, // 000A GETNGBL R1 K4 + 0x8C040305, // 000B GETMET R1 R1 K5 + 0x880C0100, // 000C GETMBR R3 R0 K0 + 0x7C040400, // 000D CALL R1 2 + 0x7806000B, // 000E JMPF R1 #001B + 0x88040106, // 000F GETMBR R1 R0 K6 + 0x88080107, // 0010 GETMBR R2 R0 K7 + 0x88080506, // 0011 GETMBR R2 R2 K6 + 0x20040202, // 0012 NE R1 R1 R2 + 0x78060001, // 0013 JMPF R1 #0016 + 0x8C040108, // 0014 GETMET R1 R0 K8 + 0x7C040200, // 0015 CALL R1 1 + 0xB8060800, // 0016 GETNGBL R1 K4 + 0x8C040309, // 0017 GETMET R1 R1 K9 + 0x880C0103, // 0018 GETMBR R3 R0 K3 + 0x7C040400, // 0019 CALL R1 2 + 0x90020001, // 001A SETMBR R0 K0 R1 + 0x80000000, // 001B RET 0 }) ) ); @@ -1037,32 +1158,61 @@ be_local_closure(Matter_Plugin_consolidate_clusters, /* name */ /******************************************************************** -** Solidified function: get_attribute_list +** Solidified function: is_local_device ********************************************************************/ -be_local_closure(Matter_Plugin_get_attribute_list, /* name */ +be_local_closure(Matter_Plugin_is_local_device, /* name */ be_nested_proto( - 6, /* nstack */ - 2, /* argc */ + 2, /* 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(is_local_device), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x50040200, // 0000 LDBOOL R1 1 0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: ui_string_to_conf +********************************************************************/ +be_local_closure(Matter_Plugin_ui_string_to_conf, /* name */ + be_nested_proto( + 8, /* nstack */ + 3, /* argc */ + 4, /* 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(clusters), - /* K1 */ be_nested_str_weak(find), + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_const_class(be_class_Matter_Plugin), + /* K1 */ be_nested_str_weak(ARG), + /* K2 */ be_nested_str_weak(ARG_TYPE), }), - be_str_weak(get_attribute_list), + be_str_weak(ui_string_to_conf), &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x8C080501, // 0001 GETMET R2 R2 K1 - 0x5C100200, // 0002 MOVE R4 R1 - 0x60140012, // 0003 GETGBL R5 G18 - 0x7C140000, // 0004 CALL R5 0 - 0x7C080600, // 0005 CALL R2 3 - 0x80040400, // 0006 RET 1 R2 + ( &(const binstruction[10]) { /* code */ + 0x580C0000, // 0000 LDCONST R3 K0 + 0x88100101, // 0001 GETMBR R4 R0 K1 + 0x88140102, // 0002 GETMBR R5 R0 K2 + 0x780A0004, // 0003 JMPF R2 #0009 + 0x78120003, // 0004 JMPF R4 #0009 + 0x5C180A00, // 0005 MOVE R6 R5 + 0x5C1C0400, // 0006 MOVE R7 R2 + 0x7C180200, // 0007 CALL R6 1 + 0x98040806, // 0008 SETIDX R1 R4 R6 + 0x80040200, // 0009 RET 1 R1 }) ) ); @@ -1073,22 +1223,29 @@ be_local_closure(Matter_Plugin_get_attribute_list, /* name */ ** Solidified class: Matter_Plugin ********************************************************************/ be_local_class(Matter_Plugin, - 5, + 6, NULL, - be_nested_map(37, + be_nested_map(41, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_init_closure) }, - { be_const_key_weak(read_event, 11), be_const_closure(Matter_Plugin_read_event_closure) }, - { be_const_key_weak(tick, -1), be_const_var(4) }, - { be_const_key_weak(is_local_device, 18), be_const_closure(Matter_Plugin_is_local_device_closure) }, - { be_const_key_weak(UPDATE_TIME, -1), be_const_int(5000) }, - { be_const_key_weak(get_attribute_list, -1), be_const_closure(Matter_Plugin_get_attribute_list_closure) }, - { be_const_key_weak(ui_conf_to_string, 26), be_const_static_closure(Matter_Plugin_ui_conf_to_string_closure) }, - { be_const_key_weak(every_250ms, -1), be_const_closure(Matter_Plugin_every_250ms_closure) }, - { be_const_key_weak(ack_request, -1), be_const_closure(Matter_Plugin_ack_request_closure) }, - { be_const_key_weak(NAME, -1), be_nested_str_weak() }, { be_const_key_weak(parse_sensors, -1), be_const_closure(Matter_Plugin_parse_sensors_closure) }, - { be_const_key_weak(CLUSTERS, 36), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + { be_const_key_weak(update_shadow_lazy, -1), be_const_closure(Matter_Plugin_update_shadow_lazy_closure) }, + { be_const_key_weak(read_event, 17), be_const_closure(Matter_Plugin_read_event_closure) }, + { be_const_key_weak(invoke_request, 12), be_const_closure(Matter_Plugin_invoke_request_closure) }, + { be_const_key_weak(tick, 18), be_const_var(4) }, + { be_const_key_weak(write_attribute, 37), be_const_closure(Matter_Plugin_write_attribute_closure) }, + { be_const_key_weak(subscribe_attribute, 33), be_const_closure(Matter_Plugin_subscribe_attribute_closure) }, + { be_const_key_weak(publish_command, -1), be_const_closure(Matter_Plugin_publish_command_closure) }, + { be_const_key_weak(contains_cluster, 20), be_const_closure(Matter_Plugin_contains_cluster_closure) }, + { be_const_key_weak(ack_request, 27), be_const_closure(Matter_Plugin_ack_request_closure) }, + { be_const_key_weak(NAME, -1), be_nested_str_weak() }, + { be_const_key_weak(get_name, -1), be_const_closure(Matter_Plugin_get_name_closure) }, + { be_const_key_weak(ui_string_to_conf, -1), be_const_static_closure(Matter_Plugin_ui_string_to_conf_closure) }, + { be_const_key_weak(parse_configuration, -1), be_const_closure(Matter_Plugin_parse_configuration_closure) }, + { be_const_key_weak(subscribe_event, -1), be_const_closure(Matter_Plugin_subscribe_event_closure) }, + { be_const_key_weak(update_next, -1), be_const_var(0) }, + { be_const_key_weak(set_name, 26), be_const_closure(Matter_Plugin_set_name_closure) }, + { be_const_key_weak(device, -1), be_const_var(1) }, + { be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(2, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(29, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { @@ -1107,31 +1264,28 @@ be_local_class(Matter_Plugin, be_const_int(17), })) ) } )) }, })) ) } )) }, - { be_const_key_weak(parse_configuration, -1), be_const_closure(Matter_Plugin_parse_configuration_closure) }, - { be_const_key_weak(ui_string_to_conf, -1), be_const_static_closure(Matter_Plugin_ui_string_to_conf_closure) }, - { be_const_key_weak(contains_cluster, -1), be_const_closure(Matter_Plugin_contains_cluster_closure) }, + { be_const_key_weak(UPDATE_TIME, -1), be_const_int(5000) }, + { be_const_key_weak(endpoint, -1), be_const_var(2) }, { be_const_key_weak(ARG_TYPE, -1), be_const_static_closure(Matter_Plugin__X3Clambda_X3E_closure) }, - { be_const_key_weak(has, 8), be_const_closure(Matter_Plugin_has_closure) }, - { be_const_key_weak(device, 4), be_const_var(1) }, - { be_const_key_weak(timed_request, -1), be_const_closure(Matter_Plugin_timed_request_closure) }, - { be_const_key_weak(get_cluster_list, -1), be_const_closure(Matter_Plugin_get_cluster_list_closure) }, - { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_read_attribute_closure) }, - { be_const_key_weak(ARG, 14), be_nested_str_weak() }, - { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_invoke_request_closure) }, - { be_const_key_weak(subscribe_attribute, 24), be_const_closure(Matter_Plugin_subscribe_attribute_closure) }, + { be_const_key_weak(has, -1), be_const_closure(Matter_Plugin_has_closure) }, + { be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_init_closure) }, + { be_const_key_weak(get_cluster_list, 32), be_const_closure(Matter_Plugin_get_cluster_list_closure) }, + { be_const_key_weak(ui_conf_to_string, -1), be_const_static_closure(Matter_Plugin_ui_conf_to_string_closure) }, + { be_const_key_weak(ARG, -1), be_nested_str_weak() }, + { be_const_key_weak(TYPE, -1), be_nested_str_weak() }, { be_const_key_weak(get_endpoint, 30), be_const_closure(Matter_Plugin_get_endpoint_closure) }, - { be_const_key_weak(write_attribute, 28), be_const_closure(Matter_Plugin_write_attribute_closure) }, - { be_const_key_weak(ARG_HINT, 22), be_nested_str_weak(_Not_X20used_) }, - { be_const_key_weak(update_shadow_lazy, -1), be_const_closure(Matter_Plugin_update_shadow_lazy_closure) }, - { be_const_key_weak(clusters, -1), be_const_var(3) }, - { be_const_key_weak(endpoint, -1), be_const_var(2) }, - { be_const_key_weak(attribute_updated, 15), be_const_closure(Matter_Plugin_attribute_updated_closure) }, - { be_const_key_weak(subscribe_event, -1), be_const_closure(Matter_Plugin_subscribe_event_closure) }, - { be_const_key_weak(update_shadow, -1), be_const_closure(Matter_Plugin_update_shadow_closure) }, + { be_const_key_weak(contains_attribute, 34), be_const_closure(Matter_Plugin_contains_attribute_closure) }, + { be_const_key_weak(every_250ms, -1), be_const_closure(Matter_Plugin_every_250ms_closure) }, + { be_const_key_weak(ARG_HINT, -1), be_nested_str_weak(_Not_X20used_) }, + { be_const_key_weak(get_attribute_list, -1), be_const_closure(Matter_Plugin_get_attribute_list_closure) }, + { be_const_key_weak(update_shadow, 39), be_const_closure(Matter_Plugin_update_shadow_closure) }, + { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_read_attribute_closure) }, { be_const_key_weak(consolidate_clusters, -1), be_const_closure(Matter_Plugin_consolidate_clusters_closure) }, - { be_const_key_weak(TYPE, -1), be_nested_str_weak() }, - { be_const_key_weak(update_next, 5), be_const_var(0) }, - { be_const_key_weak(contains_attribute, -1), be_const_closure(Matter_Plugin_contains_attribute_closure) }, + { be_const_key_weak(node_label, -1), be_const_var(5) }, + { be_const_key_weak(timed_request, -1), be_const_closure(Matter_Plugin_timed_request_closure) }, + { be_const_key_weak(is_local_device, -1), be_const_closure(Matter_Plugin_is_local_device_closure) }, + { be_const_key_weak(attribute_updated, -1), be_const_closure(Matter_Plugin_attribute_updated_closure) }, + { be_const_key_weak(clusters, 4), be_const_var(3) }, })), be_str_weak(Matter_Plugin) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Light0.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Light0.h index 635323adf6d9..e4b476a4c195 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Light0.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Light0.h @@ -293,7 +293,7 @@ be_local_closure(Matter_Plugin_Bridge_Light0_parse_update, /* name */ ********************************************************************/ be_local_closure(Matter_Plugin_Bridge_Light0_invoke_request, /* name */ be_nested_proto( - 10, /* nstack */ + 11, /* nstack */ 4, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -301,54 +301,72 @@ be_local_closure(Matter_Plugin_Bridge_Light0_invoke_request, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 9]) { /* constants */ + ( &(const bvalue[11]) { /* constants */ /* K0 */ be_nested_str_weak(matter), /* K1 */ be_nested_str_weak(TLV), /* K2 */ be_nested_str_weak(cluster), /* K3 */ be_nested_str_weak(command), /* K4 */ be_const_int(0), /* K5 */ be_nested_str_weak(set_onoff), - /* K6 */ be_const_int(1), - /* K7 */ be_const_int(2), - /* K8 */ be_nested_str_weak(shadow_onoff), + /* K6 */ be_nested_str_weak(publish_command), + /* K7 */ be_nested_str_weak(Power), + /* K8 */ be_const_int(1), + /* K9 */ be_const_int(2), + /* K10 */ be_nested_str_weak(shadow_onoff), }), be_str_weak(invoke_request), &be_const_str_solidified, - ( &(const binstruction[34]) { /* code */ + ( &(const binstruction[50]) { /* code */ 0xB8120000, // 0000 GETNGBL R4 K0 0x88100901, // 0001 GETMBR R4 R4 K1 0x88140702, // 0002 GETMBR R5 R3 K2 0x88180703, // 0003 GETMBR R6 R3 K3 0x541E0005, // 0004 LDINT R7 6 0x1C1C0A07, // 0005 EQ R7 R5 R7 - 0x781E0019, // 0006 JMPF R7 #0021 + 0x781E0029, // 0006 JMPF R7 #0031 0x1C1C0D04, // 0007 EQ R7 R6 K4 - 0x781E0005, // 0008 JMPF R7 #000F + 0x781E0009, // 0008 JMPF R7 #0013 0x8C1C0105, // 0009 GETMET R7 R0 K5 0x50240000, // 000A LDBOOL R9 0 0 0x7C1C0400, // 000B CALL R7 2 - 0x501C0200, // 000C LDBOOL R7 1 0 - 0x80040E00, // 000D RET 1 R7 - 0x70020011, // 000E JMP #0021 - 0x1C1C0D06, // 000F EQ R7 R6 K6 - 0x781E0005, // 0010 JMPF R7 #0017 - 0x8C1C0105, // 0011 GETMET R7 R0 K5 - 0x50240200, // 0012 LDBOOL R9 1 0 - 0x7C1C0400, // 0013 CALL R7 2 - 0x501C0200, // 0014 LDBOOL R7 1 0 - 0x80040E00, // 0015 RET 1 R7 - 0x70020009, // 0016 JMP #0021 - 0x1C1C0D07, // 0017 EQ R7 R6 K7 - 0x781E0007, // 0018 JMPF R7 #0021 - 0x8C1C0105, // 0019 GETMET R7 R0 K5 - 0x88240108, // 001A GETMBR R9 R0 K8 - 0x78260000, // 001B JMPF R9 #001D - 0x50240001, // 001C LDBOOL R9 0 1 - 0x50240200, // 001D LDBOOL R9 1 0 - 0x7C1C0400, // 001E CALL R7 2 - 0x501C0200, // 001F LDBOOL R7 1 0 - 0x80040E00, // 0020 RET 1 R7 - 0x80000000, // 0021 RET 0 + 0x8C1C0106, // 000C GETMET R7 R0 K6 + 0x58240007, // 000D LDCONST R9 K7 + 0x58280004, // 000E LDCONST R10 K4 + 0x7C1C0600, // 000F CALL R7 3 + 0x501C0200, // 0010 LDBOOL R7 1 0 + 0x80040E00, // 0011 RET 1 R7 + 0x7002001D, // 0012 JMP #0031 + 0x1C1C0D08, // 0013 EQ R7 R6 K8 + 0x781E0009, // 0014 JMPF R7 #001F + 0x8C1C0105, // 0015 GETMET R7 R0 K5 + 0x50240200, // 0016 LDBOOL R9 1 0 + 0x7C1C0400, // 0017 CALL R7 2 + 0x8C1C0106, // 0018 GETMET R7 R0 K6 + 0x58240007, // 0019 LDCONST R9 K7 + 0x58280008, // 001A LDCONST R10 K8 + 0x7C1C0600, // 001B CALL R7 3 + 0x501C0200, // 001C LDBOOL R7 1 0 + 0x80040E00, // 001D RET 1 R7 + 0x70020011, // 001E JMP #0031 + 0x1C1C0D09, // 001F EQ R7 R6 K9 + 0x781E000F, // 0020 JMPF R7 #0031 + 0x8C1C0105, // 0021 GETMET R7 R0 K5 + 0x8824010A, // 0022 GETMBR R9 R0 K10 + 0x78260000, // 0023 JMPF R9 #0025 + 0x50240001, // 0024 LDBOOL R9 0 1 + 0x50240200, // 0025 LDBOOL R9 1 0 + 0x7C1C0400, // 0026 CALL R7 2 + 0x8C1C0106, // 0027 GETMET R7 R0 K6 + 0x58240007, // 0028 LDCONST R9 K7 + 0x8828010A, // 0029 GETMBR R10 R0 K10 + 0x782A0001, // 002A JMPF R10 #002D + 0x58280008, // 002B LDCONST R10 K8 + 0x70020000, // 002C JMP #002E + 0x58280004, // 002D LDCONST R10 K4 + 0x7C1C0600, // 002E CALL R7 3 + 0x501C0200, // 002F LDBOOL R7 1 0 + 0x80040E00, // 0030 RET 1 R7 + 0x80000000, // 0031 RET 0 }) ) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Light1.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Light1.h index e14326c29626..e248197faeed 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Light1.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Light1.h @@ -11,7 +11,7 @@ extern const bclass be_class_Matter_Plugin_Bridge_Light1; ********************************************************************/ be_local_closure(Matter_Plugin_Bridge_Light1_invoke_request, /* name */ be_nested_proto( - 12, /* nstack */ + 21, /* nstack */ 4, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -19,7 +19,7 @@ be_local_closure(Matter_Plugin_Bridge_Light1_invoke_request, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[14]) { /* constants */ + ( &(const bvalue[20]) { /* constants */ /* K0 */ be_nested_str_weak(matter), /* K1 */ be_nested_str_weak(TLV), /* K2 */ be_nested_str_weak(cluster), @@ -29,24 +29,30 @@ be_local_closure(Matter_Plugin_Bridge_Light1_invoke_request, /* name */ /* K6 */ be_nested_str_weak(set_bri), /* K7 */ be_nested_str_weak(log), /* K8 */ be_nested_str_weak(bri_X3A), - /* K9 */ be_const_int(1), - /* K10 */ be_const_int(2), - /* K11 */ be_const_int(3), - /* K12 */ be_nested_str_weak(set_onoff), - /* K13 */ be_nested_str_weak(invoke_request), + /* K9 */ be_nested_str_weak(publish_command), + /* K10 */ be_nested_str_weak(Bri), + /* K11 */ be_nested_str_weak(tasmota), + /* K12 */ be_nested_str_weak(scale_uint), + /* K13 */ be_nested_str_weak(Dimmer), + /* K14 */ be_const_int(1), + /* K15 */ be_const_int(2), + /* K16 */ be_const_int(3), + /* K17 */ be_nested_str_weak(set_onoff), + /* K18 */ be_nested_str_weak(Power), + /* K19 */ be_nested_str_weak(invoke_request), }), be_str_weak(invoke_request), &be_const_str_solidified, - ( &(const binstruction[87]) { /* code */ + ( &(const binstruction[132]) { /* code */ 0xB8120000, // 0000 GETNGBL R4 K0 0x88100901, // 0001 GETMBR R4 R4 K1 0x88140702, // 0002 GETMBR R5 R3 K2 0x88180703, // 0003 GETMBR R6 R3 K3 0x541E0007, // 0004 LDINT R7 8 0x1C1C0A07, // 0005 EQ R7 R5 R7 - 0x781E0045, // 0006 JMPF R7 #004D + 0x781E0072, // 0006 JMPF R7 #007A 0x1C1C0D04, // 0007 EQ R7 R6 K4 - 0x781E000D, // 0008 JMPF R7 #0017 + 0x781E0021, // 0008 JMPF R7 #002B 0x8C1C0505, // 0009 GETMET R7 R2 K5 0x58240004, // 000A LDCONST R9 K4 0x7C1C0400, // 000B CALL R7 2 @@ -58,73 +64,118 @@ be_local_closure(Matter_Plugin_Bridge_Light1_invoke_request, /* name */ 0x7C200200, // 0011 CALL R8 1 0x00221008, // 0012 ADD R8 K8 R8 0x900E0E08, // 0013 SETMBR R3 K7 R8 - 0x50200200, // 0014 LDBOOL R8 1 0 - 0x80041000, // 0015 RET 1 R8 - 0x70020034, // 0016 JMP #004C - 0x1C1C0D09, // 0017 EQ R7 R6 K9 - 0x781E0002, // 0018 JMPF R7 #001C - 0x501C0200, // 0019 LDBOOL R7 1 0 - 0x80040E00, // 001A RET 1 R7 - 0x7002002F, // 001B JMP #004C - 0x1C1C0D0A, // 001C EQ R7 R6 K10 - 0x781E0002, // 001D JMPF R7 #0021 - 0x501C0200, // 001E LDBOOL R7 1 0 - 0x80040E00, // 001F RET 1 R7 - 0x7002002A, // 0020 JMP #004C - 0x1C1C0D0B, // 0021 EQ R7 R6 K11 - 0x781E0002, // 0022 JMPF R7 #0026 - 0x501C0200, // 0023 LDBOOL R7 1 0 - 0x80040E00, // 0024 RET 1 R7 - 0x70020025, // 0025 JMP #004C - 0x541E0003, // 0026 LDINT R7 4 - 0x1C1C0C07, // 0027 EQ R7 R6 R7 - 0x781E0011, // 0028 JMPF R7 #003B - 0x8C1C0505, // 0029 GETMET R7 R2 K5 - 0x58240004, // 002A LDCONST R9 K4 - 0x7C1C0400, // 002B CALL R7 2 - 0x8C200106, // 002C GETMET R8 R0 K6 - 0x5C280E00, // 002D MOVE R10 R7 - 0x7C200400, // 002E CALL R8 2 - 0x24200F04, // 002F GT R8 R7 K4 - 0x8C24010C, // 0030 GETMET R9 R0 K12 - 0x5C2C1000, // 0031 MOVE R11 R8 - 0x7C240400, // 0032 CALL R9 2 - 0x60240008, // 0033 GETGBL R9 G8 - 0x5C280E00, // 0034 MOVE R10 R7 - 0x7C240200, // 0035 CALL R9 1 - 0x00261009, // 0036 ADD R9 K8 R9 - 0x900E0E09, // 0037 SETMBR R3 K7 R9 - 0x50240200, // 0038 LDBOOL R9 1 0 - 0x80041200, // 0039 RET 1 R9 - 0x70020010, // 003A JMP #004C - 0x541E0004, // 003B LDINT R7 5 - 0x1C1C0C07, // 003C EQ R7 R6 R7 - 0x781E0002, // 003D JMPF R7 #0041 - 0x501C0200, // 003E LDBOOL R7 1 0 - 0x80040E00, // 003F RET 1 R7 - 0x7002000A, // 0040 JMP #004C - 0x541E0005, // 0041 LDINT R7 6 - 0x1C1C0C07, // 0042 EQ R7 R6 R7 - 0x781E0002, // 0043 JMPF R7 #0047 - 0x501C0200, // 0044 LDBOOL R7 1 0 - 0x80040E00, // 0045 RET 1 R7 - 0x70020004, // 0046 JMP #004C - 0x541E0006, // 0047 LDINT R7 7 - 0x1C1C0C07, // 0048 EQ R7 R6 R7 - 0x781E0001, // 0049 JMPF R7 #004C - 0x501C0200, // 004A LDBOOL R7 1 0 - 0x80040E00, // 004B RET 1 R7 - 0x70020008, // 004C JMP #0056 - 0x601C0003, // 004D GETGBL R7 G3 - 0x5C200000, // 004E MOVE R8 R0 - 0x7C1C0200, // 004F CALL R7 1 - 0x8C1C0F0D, // 0050 GETMET R7 R7 K13 - 0x5C240200, // 0051 MOVE R9 R1 - 0x5C280400, // 0052 MOVE R10 R2 - 0x5C2C0600, // 0053 MOVE R11 R3 - 0x7C1C0800, // 0054 CALL R7 4 - 0x80040E00, // 0055 RET 1 R7 - 0x80000000, // 0056 RET 0 + 0x8C200109, // 0014 GETMET R8 R0 K9 + 0x5828000A, // 0015 LDCONST R10 K10 + 0xB82E1600, // 0016 GETNGBL R11 K11 + 0x8C2C170C, // 0017 GETMET R11 R11 K12 + 0x5C340E00, // 0018 MOVE R13 R7 + 0x58380004, // 0019 LDCONST R14 K4 + 0x543E00FD, // 001A LDINT R15 254 + 0x58400004, // 001B LDCONST R16 K4 + 0x544600FE, // 001C LDINT R17 255 + 0x7C2C0C00, // 001D CALL R11 6 + 0x5830000D, // 001E LDCONST R12 K13 + 0xB8361600, // 001F GETNGBL R13 K11 + 0x8C341B0C, // 0020 GETMET R13 R13 K12 + 0x5C3C0E00, // 0021 MOVE R15 R7 + 0x58400004, // 0022 LDCONST R16 K4 + 0x544600FD, // 0023 LDINT R17 254 + 0x58480004, // 0024 LDCONST R18 K4 + 0x544E0063, // 0025 LDINT R19 100 + 0x7C340C00, // 0026 CALL R13 6 + 0x7C200A00, // 0027 CALL R8 5 + 0x50200200, // 0028 LDBOOL R8 1 0 + 0x80041000, // 0029 RET 1 R8 + 0x7002004D, // 002A JMP #0079 + 0x1C1C0D0E, // 002B EQ R7 R6 K14 + 0x781E0002, // 002C JMPF R7 #0030 + 0x501C0200, // 002D LDBOOL R7 1 0 + 0x80040E00, // 002E RET 1 R7 + 0x70020048, // 002F JMP #0079 + 0x1C1C0D0F, // 0030 EQ R7 R6 K15 + 0x781E0002, // 0031 JMPF R7 #0035 + 0x501C0200, // 0032 LDBOOL R7 1 0 + 0x80040E00, // 0033 RET 1 R7 + 0x70020043, // 0034 JMP #0079 + 0x1C1C0D10, // 0035 EQ R7 R6 K16 + 0x781E0002, // 0036 JMPF R7 #003A + 0x501C0200, // 0037 LDBOOL R7 1 0 + 0x80040E00, // 0038 RET 1 R7 + 0x7002003E, // 0039 JMP #0079 + 0x541E0003, // 003A LDINT R7 4 + 0x1C1C0C07, // 003B EQ R7 R6 R7 + 0x781E002A, // 003C JMPF R7 #0068 + 0x8C1C0505, // 003D GETMET R7 R2 K5 + 0x58240004, // 003E LDCONST R9 K4 + 0x7C1C0400, // 003F CALL R7 2 + 0x8C200106, // 0040 GETMET R8 R0 K6 + 0x5C280E00, // 0041 MOVE R10 R7 + 0x7C200400, // 0042 CALL R8 2 + 0x24200F04, // 0043 GT R8 R7 K4 + 0x8C240111, // 0044 GETMET R9 R0 K17 + 0x5C2C1000, // 0045 MOVE R11 R8 + 0x7C240400, // 0046 CALL R9 2 + 0x60240008, // 0047 GETGBL R9 G8 + 0x5C280E00, // 0048 MOVE R10 R7 + 0x7C240200, // 0049 CALL R9 1 + 0x00261009, // 004A ADD R9 K8 R9 + 0x900E0E09, // 004B SETMBR R3 K7 R9 + 0x8C240109, // 004C GETMET R9 R0 K9 + 0x582C000A, // 004D LDCONST R11 K10 + 0xB8321600, // 004E GETNGBL R12 K11 + 0x8C30190C, // 004F GETMET R12 R12 K12 + 0x5C380E00, // 0050 MOVE R14 R7 + 0x583C0004, // 0051 LDCONST R15 K4 + 0x544200FD, // 0052 LDINT R16 254 + 0x58440004, // 0053 LDCONST R17 K4 + 0x544A00FE, // 0054 LDINT R18 255 + 0x7C300C00, // 0055 CALL R12 6 + 0x5834000D, // 0056 LDCONST R13 K13 + 0xB83A1600, // 0057 GETNGBL R14 K11 + 0x8C381D0C, // 0058 GETMET R14 R14 K12 + 0x5C400E00, // 0059 MOVE R16 R7 + 0x58440004, // 005A LDCONST R17 K4 + 0x544A00FD, // 005B LDINT R18 254 + 0x584C0004, // 005C LDCONST R19 K4 + 0x54520063, // 005D LDINT R20 100 + 0x7C380C00, // 005E CALL R14 6 + 0x583C0012, // 005F LDCONST R15 K18 + 0x78220001, // 0060 JMPF R8 #0063 + 0x5840000E, // 0061 LDCONST R16 K14 + 0x70020000, // 0062 JMP #0064 + 0x58400004, // 0063 LDCONST R16 K4 + 0x7C240E00, // 0064 CALL R9 7 + 0x50240200, // 0065 LDBOOL R9 1 0 + 0x80041200, // 0066 RET 1 R9 + 0x70020010, // 0067 JMP #0079 + 0x541E0004, // 0068 LDINT R7 5 + 0x1C1C0C07, // 0069 EQ R7 R6 R7 + 0x781E0002, // 006A JMPF R7 #006E + 0x501C0200, // 006B LDBOOL R7 1 0 + 0x80040E00, // 006C RET 1 R7 + 0x7002000A, // 006D JMP #0079 + 0x541E0005, // 006E LDINT R7 6 + 0x1C1C0C07, // 006F EQ R7 R6 R7 + 0x781E0002, // 0070 JMPF R7 #0074 + 0x501C0200, // 0071 LDBOOL R7 1 0 + 0x80040E00, // 0072 RET 1 R7 + 0x70020004, // 0073 JMP #0079 + 0x541E0006, // 0074 LDINT R7 7 + 0x1C1C0C07, // 0075 EQ R7 R6 R7 + 0x781E0001, // 0076 JMPF R7 #0079 + 0x501C0200, // 0077 LDBOOL R7 1 0 + 0x80040E00, // 0078 RET 1 R7 + 0x70020008, // 0079 JMP #0083 + 0x601C0003, // 007A GETGBL R7 G3 + 0x5C200000, // 007B MOVE R8 R0 + 0x7C1C0200, // 007C CALL R7 1 + 0x8C1C0F13, // 007D GETMET R7 R7 K19 + 0x5C240200, // 007E MOVE R9 R1 + 0x5C280400, // 007F MOVE R10 R2 + 0x5C2C0600, // 0080 MOVE R11 R3 + 0x7C1C0800, // 0081 CALL R7 4 + 0x80040E00, // 0082 RET 1 R7 + 0x80000000, // 0083 RET 0 }) ) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Light2.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Light2.h index 1dc7e126f312..4dcbcf27ebac 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Light2.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Light2.h @@ -260,7 +260,7 @@ be_local_closure(Matter_Plugin_Bridge_Light2_invoke_request, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[12]) { /* constants */ + ( &(const bvalue[14]) { /* constants */ /* K0 */ be_nested_str_weak(matter), /* K1 */ be_nested_str_weak(TLV), /* K2 */ be_nested_str_weak(cluster), @@ -272,21 +272,23 @@ be_local_closure(Matter_Plugin_Bridge_Light2_invoke_request, /* name */ /* K8 */ be_nested_str_weak(set_ct), /* K9 */ be_nested_str_weak(log), /* K10 */ be_nested_str_weak(ct_X3A), - /* K11 */ be_nested_str_weak(invoke_request), + /* K11 */ be_nested_str_weak(publish_command), + /* K12 */ be_nested_str_weak(CT), + /* K13 */ be_nested_str_weak(invoke_request), }), be_str_weak(invoke_request), &be_const_str_solidified, - ( &(const binstruction[60]) { /* code */ + ( &(const binstruction[64]) { /* code */ 0xB8120000, // 0000 GETNGBL R4 K0 0x88100901, // 0001 GETMBR R4 R4 K1 0x88140702, // 0002 GETMBR R5 R3 K2 0x88180703, // 0003 GETMBR R6 R3 K3 0x541E02FF, // 0004 LDINT R7 768 0x1C1C0A07, // 0005 EQ R7 R5 R7 - 0x781E002A, // 0006 JMPF R7 #0032 + 0x781E002E, // 0006 JMPF R7 #0036 0x541E0009, // 0007 LDINT R7 10 0x1C1C0C07, // 0008 EQ R7 R6 R7 - 0x781E0015, // 0009 JMPF R7 #0020 + 0x781E0019, // 0009 JMPF R7 #0024 0x8C1C0504, // 000A GETMET R7 R2 K4 0x58240005, // 000B LDCONST R9 K5 0x7C1C0400, // 000C CALL R7 2 @@ -306,37 +308,41 @@ be_local_closure(Matter_Plugin_Bridge_Light2_invoke_request, /* name */ 0x7C200200, // 001A CALL R8 1 0x00221408, // 001B ADD R8 K10 R8 0x900E1208, // 001C SETMBR R3 K9 R8 - 0x50200200, // 001D LDBOOL R8 1 0 - 0x80041000, // 001E RET 1 R8 - 0x70020010, // 001F JMP #0031 - 0x541E0046, // 0020 LDINT R7 71 - 0x1C1C0C07, // 0021 EQ R7 R6 R7 - 0x781E0002, // 0022 JMPF R7 #0026 - 0x501C0200, // 0023 LDBOOL R7 1 0 - 0x80040E00, // 0024 RET 1 R7 - 0x7002000A, // 0025 JMP #0031 - 0x541E004A, // 0026 LDINT R7 75 - 0x1C1C0C07, // 0027 EQ R7 R6 R7 - 0x781E0002, // 0028 JMPF R7 #002C - 0x501C0200, // 0029 LDBOOL R7 1 0 - 0x80040E00, // 002A RET 1 R7 - 0x70020004, // 002B JMP #0031 - 0x541E004B, // 002C LDINT R7 76 - 0x1C1C0C07, // 002D EQ R7 R6 R7 - 0x781E0001, // 002E JMPF R7 #0031 - 0x501C0200, // 002F LDBOOL R7 1 0 - 0x80040E00, // 0030 RET 1 R7 - 0x70020008, // 0031 JMP #003B - 0x601C0003, // 0032 GETGBL R7 G3 - 0x5C200000, // 0033 MOVE R8 R0 - 0x7C1C0200, // 0034 CALL R7 1 - 0x8C1C0F0B, // 0035 GETMET R7 R7 K11 - 0x5C240200, // 0036 MOVE R9 R1 - 0x5C280400, // 0037 MOVE R10 R2 - 0x5C2C0600, // 0038 MOVE R11 R3 - 0x7C1C0800, // 0039 CALL R7 4 - 0x80040E00, // 003A RET 1 R7 - 0x80000000, // 003B RET 0 + 0x8C20010B, // 001D GETMET R8 R0 K11 + 0x5828000C, // 001E LDCONST R10 K12 + 0x5C2C0E00, // 001F MOVE R11 R7 + 0x7C200600, // 0020 CALL R8 3 + 0x50200200, // 0021 LDBOOL R8 1 0 + 0x80041000, // 0022 RET 1 R8 + 0x70020010, // 0023 JMP #0035 + 0x541E0046, // 0024 LDINT R7 71 + 0x1C1C0C07, // 0025 EQ R7 R6 R7 + 0x781E0002, // 0026 JMPF R7 #002A + 0x501C0200, // 0027 LDBOOL R7 1 0 + 0x80040E00, // 0028 RET 1 R7 + 0x7002000A, // 0029 JMP #0035 + 0x541E004A, // 002A LDINT R7 75 + 0x1C1C0C07, // 002B EQ R7 R6 R7 + 0x781E0002, // 002C JMPF R7 #0030 + 0x501C0200, // 002D LDBOOL R7 1 0 + 0x80040E00, // 002E RET 1 R7 + 0x70020004, // 002F JMP #0035 + 0x541E004B, // 0030 LDINT R7 76 + 0x1C1C0C07, // 0031 EQ R7 R6 R7 + 0x781E0001, // 0032 JMPF R7 #0035 + 0x501C0200, // 0033 LDBOOL R7 1 0 + 0x80040E00, // 0034 RET 1 R7 + 0x70020008, // 0035 JMP #003F + 0x601C0003, // 0036 GETGBL R7 G3 + 0x5C200000, // 0037 MOVE R8 R0 + 0x7C1C0200, // 0038 CALL R7 1 + 0x8C1C0F0D, // 0039 GETMET R7 R7 K13 + 0x5C240200, // 003A MOVE R9 R1 + 0x5C280400, // 003B MOVE R10 R2 + 0x5C2C0600, // 003C MOVE R11 R3 + 0x7C1C0800, // 003D CALL R7 4 + 0x80040E00, // 003E RET 1 R7 + 0x80000000, // 003F RET 0 }) ) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Light3.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Light3.h index f5cd9c4aeb96..4252ef80a4ac 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Light3.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Light3.h @@ -300,7 +300,7 @@ be_local_closure(Matter_Plugin_Bridge_Light3_web_value_RGB, /* name */ ********************************************************************/ be_local_closure(Matter_Plugin_Bridge_Light3_invoke_request, /* name */ be_nested_proto( - 12, /* nstack */ + 15, /* nstack */ 4, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -308,7 +308,7 @@ be_local_closure(Matter_Plugin_Bridge_Light3_invoke_request, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[16]) { /* constants */ + ( &(const bvalue[19]) { /* constants */ /* K0 */ be_nested_str_weak(matter), /* K1 */ be_nested_str_weak(TLV), /* K2 */ be_nested_str_weak(cluster), @@ -318,26 +318,29 @@ be_local_closure(Matter_Plugin_Bridge_Light3_invoke_request, /* name */ /* K6 */ be_nested_str_weak(set_hue), /* K7 */ be_nested_str_weak(log), /* K8 */ be_nested_str_weak(hue_X3A), - /* K9 */ be_const_int(1), - /* K10 */ be_const_int(2), - /* K11 */ be_const_int(3), - /* K12 */ be_nested_str_weak(set_sat), - /* K13 */ be_nested_str_weak(sat_X3A), - /* K14 */ be_nested_str_weak(_X20sat_X3A), - /* K15 */ be_nested_str_weak(invoke_request), + /* K9 */ be_nested_str_weak(publish_command), + /* K10 */ be_nested_str_weak(Hue), + /* K11 */ be_const_int(1), + /* K12 */ be_const_int(2), + /* K13 */ be_const_int(3), + /* K14 */ be_nested_str_weak(set_sat), + /* K15 */ be_nested_str_weak(sat_X3A), + /* K16 */ be_nested_str_weak(Sat), + /* K17 */ be_nested_str_weak(_X20sat_X3A), + /* K18 */ be_nested_str_weak(invoke_request), }), be_str_weak(invoke_request), &be_const_str_solidified, - ( &(const binstruction[105]) { /* code */ + ( &(const binstruction[119]) { /* code */ 0xB8120000, // 0000 GETNGBL R4 K0 0x88100901, // 0001 GETMBR R4 R4 K1 0x88140702, // 0002 GETMBR R5 R3 K2 0x88180703, // 0003 GETMBR R6 R3 K3 0x541E02FF, // 0004 LDINT R7 768 0x1C1C0A07, // 0005 EQ R7 R5 R7 - 0x781E0057, // 0006 JMPF R7 #005F + 0x781E0065, // 0006 JMPF R7 #006D 0x1C1C0D04, // 0007 EQ R7 R6 K4 - 0x781E000D, // 0008 JMPF R7 #0017 + 0x781E0011, // 0008 JMPF R7 #001B 0x8C1C0505, // 0009 GETMET R7 R2 K5 0x58240004, // 000A LDCONST R9 K4 0x7C1C0400, // 000B CALL R7 2 @@ -349,91 +352,105 @@ be_local_closure(Matter_Plugin_Bridge_Light3_invoke_request, /* name */ 0x7C200200, // 0011 CALL R8 1 0x00221008, // 0012 ADD R8 K8 R8 0x900E0E08, // 0013 SETMBR R3 K7 R8 - 0x50200200, // 0014 LDBOOL R8 1 0 - 0x80041000, // 0015 RET 1 R8 - 0x70020046, // 0016 JMP #005E - 0x1C1C0D09, // 0017 EQ R7 R6 K9 - 0x781E0002, // 0018 JMPF R7 #001C - 0x501C0200, // 0019 LDBOOL R7 1 0 - 0x80040E00, // 001A RET 1 R7 - 0x70020041, // 001B JMP #005E - 0x1C1C0D0A, // 001C EQ R7 R6 K10 - 0x781E0002, // 001D JMPF R7 #0021 - 0x501C0200, // 001E LDBOOL R7 1 0 - 0x80040E00, // 001F RET 1 R7 - 0x7002003C, // 0020 JMP #005E - 0x1C1C0D0B, // 0021 EQ R7 R6 K11 - 0x781E000D, // 0022 JMPF R7 #0031 - 0x8C1C0505, // 0023 GETMET R7 R2 K5 - 0x58240004, // 0024 LDCONST R9 K4 - 0x7C1C0400, // 0025 CALL R7 2 - 0x8C20010C, // 0026 GETMET R8 R0 K12 - 0x5C280E00, // 0027 MOVE R10 R7 - 0x7C200400, // 0028 CALL R8 2 - 0x60200008, // 0029 GETGBL R8 G8 - 0x5C240E00, // 002A MOVE R9 R7 - 0x7C200200, // 002B CALL R8 1 - 0x00221A08, // 002C ADD R8 K13 R8 - 0x900E0E08, // 002D SETMBR R3 K7 R8 - 0x50200200, // 002E LDBOOL R8 1 0 - 0x80041000, // 002F RET 1 R8 - 0x7002002C, // 0030 JMP #005E - 0x541E0003, // 0031 LDINT R7 4 - 0x1C1C0C07, // 0032 EQ R7 R6 R7 - 0x781E0002, // 0033 JMPF R7 #0037 - 0x501C0200, // 0034 LDBOOL R7 1 0 - 0x80040E00, // 0035 RET 1 R7 - 0x70020026, // 0036 JMP #005E - 0x541E0004, // 0037 LDINT R7 5 - 0x1C1C0C07, // 0038 EQ R7 R6 R7 - 0x781E0002, // 0039 JMPF R7 #003D - 0x501C0200, // 003A LDBOOL R7 1 0 - 0x80040E00, // 003B RET 1 R7 - 0x70020020, // 003C JMP #005E - 0x541E0005, // 003D LDINT R7 6 - 0x1C1C0C07, // 003E EQ R7 R6 R7 - 0x781E0018, // 003F JMPF R7 #0059 - 0x8C1C0505, // 0040 GETMET R7 R2 K5 - 0x58240004, // 0041 LDCONST R9 K4 - 0x7C1C0400, // 0042 CALL R7 2 - 0x8C200505, // 0043 GETMET R8 R2 K5 - 0x58280009, // 0044 LDCONST R10 K9 - 0x7C200400, // 0045 CALL R8 2 - 0x8C240106, // 0046 GETMET R9 R0 K6 - 0x5C2C0E00, // 0047 MOVE R11 R7 - 0x7C240400, // 0048 CALL R9 2 - 0x8C24010C, // 0049 GETMET R9 R0 K12 - 0x5C2C1000, // 004A MOVE R11 R8 - 0x7C240400, // 004B CALL R9 2 - 0x60240008, // 004C GETGBL R9 G8 - 0x5C280E00, // 004D MOVE R10 R7 - 0x7C240200, // 004E CALL R9 1 - 0x00261009, // 004F ADD R9 K8 R9 - 0x0024130E, // 0050 ADD R9 R9 K14 - 0x60280008, // 0051 GETGBL R10 G8 + 0x8C200109, // 0014 GETMET R8 R0 K9 + 0x5828000A, // 0015 LDCONST R10 K10 + 0x5C2C0E00, // 0016 MOVE R11 R7 + 0x7C200600, // 0017 CALL R8 3 + 0x50200200, // 0018 LDBOOL R8 1 0 + 0x80041000, // 0019 RET 1 R8 + 0x70020050, // 001A JMP #006C + 0x1C1C0D0B, // 001B EQ R7 R6 K11 + 0x781E0002, // 001C JMPF R7 #0020 + 0x501C0200, // 001D LDBOOL R7 1 0 + 0x80040E00, // 001E RET 1 R7 + 0x7002004B, // 001F JMP #006C + 0x1C1C0D0C, // 0020 EQ R7 R6 K12 + 0x781E0002, // 0021 JMPF R7 #0025 + 0x501C0200, // 0022 LDBOOL R7 1 0 + 0x80040E00, // 0023 RET 1 R7 + 0x70020046, // 0024 JMP #006C + 0x1C1C0D0D, // 0025 EQ R7 R6 K13 + 0x781E0011, // 0026 JMPF R7 #0039 + 0x8C1C0505, // 0027 GETMET R7 R2 K5 + 0x58240004, // 0028 LDCONST R9 K4 + 0x7C1C0400, // 0029 CALL R7 2 + 0x8C20010E, // 002A GETMET R8 R0 K14 + 0x5C280E00, // 002B MOVE R10 R7 + 0x7C200400, // 002C CALL R8 2 + 0x60200008, // 002D GETGBL R8 G8 + 0x5C240E00, // 002E MOVE R9 R7 + 0x7C200200, // 002F CALL R8 1 + 0x00221E08, // 0030 ADD R8 K15 R8 + 0x900E0E08, // 0031 SETMBR R3 K7 R8 + 0x8C200109, // 0032 GETMET R8 R0 K9 + 0x58280010, // 0033 LDCONST R10 K16 + 0x5C2C0E00, // 0034 MOVE R11 R7 + 0x7C200600, // 0035 CALL R8 3 + 0x50200200, // 0036 LDBOOL R8 1 0 + 0x80041000, // 0037 RET 1 R8 + 0x70020032, // 0038 JMP #006C + 0x541E0003, // 0039 LDINT R7 4 + 0x1C1C0C07, // 003A EQ R7 R6 R7 + 0x781E0002, // 003B JMPF R7 #003F + 0x501C0200, // 003C LDBOOL R7 1 0 + 0x80040E00, // 003D RET 1 R7 + 0x7002002C, // 003E JMP #006C + 0x541E0004, // 003F LDINT R7 5 + 0x1C1C0C07, // 0040 EQ R7 R6 R7 + 0x781E0002, // 0041 JMPF R7 #0045 + 0x501C0200, // 0042 LDBOOL R7 1 0 + 0x80040E00, // 0043 RET 1 R7 + 0x70020026, // 0044 JMP #006C + 0x541E0005, // 0045 LDINT R7 6 + 0x1C1C0C07, // 0046 EQ R7 R6 R7 + 0x781E001E, // 0047 JMPF R7 #0067 + 0x8C1C0505, // 0048 GETMET R7 R2 K5 + 0x58240004, // 0049 LDCONST R9 K4 + 0x7C1C0400, // 004A CALL R7 2 + 0x8C200505, // 004B GETMET R8 R2 K5 + 0x5828000B, // 004C LDCONST R10 K11 + 0x7C200400, // 004D CALL R8 2 + 0x8C240106, // 004E GETMET R9 R0 K6 + 0x5C2C0E00, // 004F MOVE R11 R7 + 0x7C240400, // 0050 CALL R9 2 + 0x8C24010E, // 0051 GETMET R9 R0 K14 0x5C2C1000, // 0052 MOVE R11 R8 - 0x7C280200, // 0053 CALL R10 1 - 0x0024120A, // 0054 ADD R9 R9 R10 - 0x900E0E09, // 0055 SETMBR R3 K7 R9 - 0x50240200, // 0056 LDBOOL R9 1 0 - 0x80041200, // 0057 RET 1 R9 - 0x70020004, // 0058 JMP #005E - 0x541E0046, // 0059 LDINT R7 71 - 0x1C1C0C07, // 005A EQ R7 R6 R7 - 0x781E0001, // 005B JMPF R7 #005E - 0x501C0200, // 005C LDBOOL R7 1 0 - 0x80040E00, // 005D RET 1 R7 - 0x70020008, // 005E JMP #0068 - 0x601C0003, // 005F GETGBL R7 G3 - 0x5C200000, // 0060 MOVE R8 R0 - 0x7C1C0200, // 0061 CALL R7 1 - 0x8C1C0F0F, // 0062 GETMET R7 R7 K15 - 0x5C240200, // 0063 MOVE R9 R1 - 0x5C280400, // 0064 MOVE R10 R2 - 0x5C2C0600, // 0065 MOVE R11 R3 - 0x7C1C0800, // 0066 CALL R7 4 - 0x80040E00, // 0067 RET 1 R7 - 0x80000000, // 0068 RET 0 + 0x7C240400, // 0053 CALL R9 2 + 0x60240008, // 0054 GETGBL R9 G8 + 0x5C280E00, // 0055 MOVE R10 R7 + 0x7C240200, // 0056 CALL R9 1 + 0x00261009, // 0057 ADD R9 K8 R9 + 0x00241311, // 0058 ADD R9 R9 K17 + 0x60280008, // 0059 GETGBL R10 G8 + 0x5C2C1000, // 005A MOVE R11 R8 + 0x7C280200, // 005B CALL R10 1 + 0x0024120A, // 005C ADD R9 R9 R10 + 0x900E0E09, // 005D SETMBR R3 K7 R9 + 0x8C240109, // 005E GETMET R9 R0 K9 + 0x582C000A, // 005F LDCONST R11 K10 + 0x5C300E00, // 0060 MOVE R12 R7 + 0x58340010, // 0061 LDCONST R13 K16 + 0x5C381000, // 0062 MOVE R14 R8 + 0x7C240A00, // 0063 CALL R9 5 + 0x50240200, // 0064 LDBOOL R9 1 0 + 0x80041200, // 0065 RET 1 R9 + 0x70020004, // 0066 JMP #006C + 0x541E0046, // 0067 LDINT R7 71 + 0x1C1C0C07, // 0068 EQ R7 R6 R7 + 0x781E0001, // 0069 JMPF R7 #006C + 0x501C0200, // 006A LDBOOL R7 1 0 + 0x80040E00, // 006B RET 1 R7 + 0x70020008, // 006C JMP #0076 + 0x601C0003, // 006D GETGBL R7 G3 + 0x5C200000, // 006E MOVE R8 R0 + 0x7C1C0200, // 006F CALL R7 1 + 0x8C1C0F12, // 0070 GETMET R7 R7 K18 + 0x5C240200, // 0071 MOVE R9 R1 + 0x5C280400, // 0072 MOVE R10 R2 + 0x5C2C0600, // 0073 MOVE R11 R3 + 0x7C1C0800, // 0074 CALL R7 4 + 0x80040E00, // 0075 RET 1 R7 + 0x80000000, // 0076 RET 0 }) ) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Device.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Device.h index af4eb7167570..dda52c48c287 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Device.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Device.h @@ -6,111 +6,6 @@ extern const bclass be_class_Matter_Plugin_Device; -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(Matter_Plugin_Device_init, /* name */ - be_nested_proto( - 9, /* nstack */ - 4, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_str_weak(node_label), - /* K1 */ be_nested_str_weak(find), - /* K2 */ be_nested_str_weak(name), - /* K3 */ be_nested_str_weak(), - /* K4 */ be_nested_str_weak(init), - }), - be_str_weak(init), - &be_const_str_solidified, - ( &(const binstruction[14]) { /* code */ - 0x8C100701, // 0000 GETMET R4 R3 K1 - 0x58180002, // 0001 LDCONST R6 K2 - 0x581C0003, // 0002 LDCONST R7 K3 - 0x7C100600, // 0003 CALL R4 3 - 0x90020004, // 0004 SETMBR R0 K0 R4 - 0x60100003, // 0005 GETGBL R4 G3 - 0x5C140000, // 0006 MOVE R5 R0 - 0x7C100200, // 0007 CALL R4 1 - 0x8C100904, // 0008 GETMET R4 R4 K4 - 0x5C180200, // 0009 MOVE R6 R1 - 0x5C1C0400, // 000A MOVE R7 R2 - 0x5C200600, // 000B MOVE R8 R3 - 0x7C100800, // 000C CALL R4 4 - 0x80000000, // 000D RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_name -********************************************************************/ -be_local_closure(Matter_Plugin_Device_set_name, /* name */ - be_nested_proto( - 6, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(node_label), - /* K1 */ be_nested_str_weak(attribute_updated), - }), - be_str_weak(set_name), - &be_const_str_solidified, - ( &(const binstruction[ 9]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x20080202, // 0001 NE R2 R1 R2 - 0x780A0003, // 0002 JMPF R2 #0007 - 0x8C080101, // 0003 GETMET R2 R0 K1 - 0x54120038, // 0004 LDINT R4 57 - 0x54160004, // 0005 LDINT R5 5 - 0x7C080600, // 0006 CALL R2 3 - 0x90020001, // 0007 SETMBR R0 K0 R1 - 0x80000000, // 0008 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_name -********************************************************************/ -be_local_closure(Matter_Plugin_Device_get_name, /* 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(node_label), - }), - be_str_weak(get_name), - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x80040200, // 0001 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: invoke_request ********************************************************************/ @@ -197,6 +92,47 @@ be_local_closure(Matter_Plugin_Device_invoke_request, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_Plugin_Device_init, /* name */ + be_nested_proto( + 9, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(virtual), + /* K1 */ be_nested_str_weak(find), + /* K2 */ be_nested_str_weak(init), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x8C100701, // 0000 GETMET R4 R3 K1 + 0x58180000, // 0001 LDCONST R6 K0 + 0x501C0000, // 0002 LDBOOL R7 0 0 + 0x7C100600, // 0003 CALL R4 3 + 0x90020004, // 0004 SETMBR R0 K0 R4 + 0x60100003, // 0005 GETGBL R4 G3 + 0x5C140000, // 0006 MOVE R5 R0 + 0x7C100200, // 0007 CALL R4 1 + 0x8C100902, // 0008 GETMET R4 R4 K2 + 0x5C180200, // 0009 MOVE R6 R1 + 0x5C1C0400, // 000A MOVE R7 R2 + 0x5C200600, // 000B MOVE R8 R3 + 0x7C100800, // 000C CALL R4 4 + 0x80000000, // 000D RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: read_attribute ********************************************************************/ @@ -529,25 +465,23 @@ extern const bclass be_class_Matter_Plugin; be_local_class(Matter_Plugin_Device, 1, &be_class_Matter_Plugin, - be_nested_map(9, + be_nested_map(7, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(invoke_request, 1), be_const_closure(Matter_Plugin_Device_invoke_request_closure) }, + { be_const_key_weak(read_attribute, 4), be_const_closure(Matter_Plugin_Device_read_attribute_closure) }, + { be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + be_const_map( * be_nested_map(1, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(NON_BRIDGE_VENDOR, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + { be_const_key_int(19, -1), be_const_int(1) }, + })) ) } )) }, + { be_const_key_weak(NON_BRIDGE_VENDOR, 2), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { be_const_list( * be_nested_list(2, ( (struct bvalue*) &(const bvalue[]) { be_const_int(4631), be_const_int(4993), })) ) } )) }, - { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Device_invoke_request_closure) }, - { be_const_key_weak(TYPES, 0), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { - be_const_map( * be_nested_map(1, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_int(19, -1), be_const_int(1) }, - })) ) } )) }, - { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Device_read_attribute_closure) }, - { be_const_key_weak(set_name, 8), be_const_closure(Matter_Plugin_Device_set_name_closure) }, - { be_const_key_weak(get_name, 1), be_const_closure(Matter_Plugin_Device_get_name_closure) }, - { be_const_key_weak(init, 3), be_const_closure(Matter_Plugin_Device_init_closure) }, - { be_const_key_weak(node_label, -1), be_const_var(0) }, + { be_const_key_weak(virtual, 6), be_const_var(0) }, + { be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Device_init_closure) }, { be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(4, ( (struct bmapnode*) &(const bmapnode[]) { diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Light0.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Light0.h index 28aa6cea3102..2ac9284b974f 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Light0.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Light0.h @@ -6,62 +6,6 @@ extern const bclass be_class_Matter_Plugin_Light0; -/******************************************************************** -** Solidified function: update_shadow -********************************************************************/ -be_local_closure(Matter_Plugin_Light0_update_shadow, /* 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[ 8]) { /* constants */ - /* K0 */ be_nested_str_weak(light), - /* K1 */ be_nested_str_weak(get), - /* K2 */ be_nested_str_weak(find), - /* K3 */ be_nested_str_weak(power), - /* K4 */ be_nested_str_weak(shadow_onoff), - /* K5 */ be_nested_str_weak(attribute_updated), - /* K6 */ be_const_int(0), - /* K7 */ be_nested_str_weak(update_shadow), - }), - be_str_weak(update_shadow), - &be_const_str_solidified, - ( &(const binstruction[24]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x8C080301, // 0001 GETMET R2 R1 K1 - 0x7C080200, // 0002 CALL R2 1 - 0x4C0C0000, // 0003 LDNIL R3 - 0x200C0403, // 0004 NE R3 R2 R3 - 0x780E000B, // 0005 JMPF R3 #0012 - 0x8C0C0502, // 0006 GETMET R3 R2 K2 - 0x58140003, // 0007 LDCONST R5 K3 - 0x4C180000, // 0008 LDNIL R6 - 0x7C0C0600, // 0009 CALL R3 3 - 0x88100104, // 000A GETMBR R4 R0 K4 - 0x20100604, // 000B NE R4 R3 R4 - 0x78120004, // 000C JMPF R4 #0012 - 0x8C100105, // 000D GETMET R4 R0 K5 - 0x541A0005, // 000E LDINT R6 6 - 0x581C0006, // 000F LDCONST R7 K6 - 0x7C100600, // 0010 CALL R4 3 - 0x90020803, // 0011 SETMBR R0 K4 R3 - 0x600C0003, // 0012 GETGBL R3 G3 - 0x5C100000, // 0013 MOVE R4 R0 - 0x7C0C0200, // 0014 CALL R3 1 - 0x8C0C0707, // 0015 GETMET R3 R3 K7 - 0x7C0C0200, // 0016 CALL R3 1 - 0x80000000, // 0017 RET 0 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: read_attribute ********************************************************************/ @@ -142,6 +86,117 @@ be_local_closure(Matter_Plugin_Light0_read_attribute, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: update_shadow +********************************************************************/ +be_local_closure(Matter_Plugin_Light0_update_shadow, /* 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(virtual), + /* K1 */ be_nested_str_weak(light), + /* K2 */ be_nested_str_weak(get), + /* K3 */ be_nested_str_weak(find), + /* K4 */ be_nested_str_weak(power), + /* K5 */ be_nested_str_weak(shadow_onoff), + /* K6 */ be_nested_str_weak(attribute_updated), + /* K7 */ be_const_int(0), + /* K8 */ be_nested_str_weak(update_shadow), + }), + be_str_weak(update_shadow), + &be_const_str_solidified, + ( &(const binstruction[26]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x74060011, // 0001 JMPT R1 #0014 + 0xA4060200, // 0002 IMPORT R1 K1 + 0x8C080302, // 0003 GETMET R2 R1 K2 + 0x7C080200, // 0004 CALL R2 1 + 0x4C0C0000, // 0005 LDNIL R3 + 0x200C0403, // 0006 NE R3 R2 R3 + 0x780E000B, // 0007 JMPF R3 #0014 + 0x8C0C0503, // 0008 GETMET R3 R2 K3 + 0x58140004, // 0009 LDCONST R5 K4 + 0x4C180000, // 000A LDNIL R6 + 0x7C0C0600, // 000B CALL R3 3 + 0x88100105, // 000C GETMBR R4 R0 K5 + 0x20100604, // 000D NE R4 R3 R4 + 0x78120004, // 000E JMPF R4 #0014 + 0x8C100106, // 000F GETMET R4 R0 K6 + 0x541A0005, // 0010 LDINT R6 6 + 0x581C0007, // 0011 LDCONST R7 K7 + 0x7C100600, // 0012 CALL R4 3 + 0x90020A03, // 0013 SETMBR R0 K5 R3 + 0x60040003, // 0014 GETGBL R1 G3 + 0x5C080000, // 0015 MOVE R2 R0 + 0x7C040200, // 0016 CALL R1 1 + 0x8C040308, // 0017 GETMET R1 R1 K8 + 0x7C040200, // 0018 CALL R1 1 + 0x80000000, // 0019 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_onoff +********************************************************************/ +be_local_closure(Matter_Plugin_Light0_set_onoff, /* 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[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(virtual), + /* K1 */ be_nested_str_weak(light), + /* K2 */ be_nested_str_weak(set), + /* K3 */ be_nested_str_weak(power), + /* K4 */ be_nested_str_weak(update_shadow), + /* K5 */ be_nested_str_weak(shadow_onoff), + /* K6 */ be_nested_str_weak(attribute_updated), + /* K7 */ be_const_int(0), + }), + be_str_weak(set_onoff), + &be_const_str_solidified, + ( &(const binstruction[20]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x740A0008, // 0001 JMPT R2 #000B + 0xA40A0200, // 0002 IMPORT R2 K1 + 0x8C0C0502, // 0003 GETMET R3 R2 K2 + 0x60140013, // 0004 GETGBL R5 G19 + 0x7C140000, // 0005 CALL R5 0 + 0x98160601, // 0006 SETIDX R5 K3 R1 + 0x7C0C0400, // 0007 CALL R3 2 + 0x8C0C0104, // 0008 GETMET R3 R0 K4 + 0x7C0C0200, // 0009 CALL R3 1 + 0x70020007, // 000A JMP #0013 + 0x88080105, // 000B GETMBR R2 R0 K5 + 0x20080202, // 000C NE R2 R1 R2 + 0x780A0004, // 000D JMPF R2 #0013 + 0x8C080106, // 000E GETMET R2 R0 K6 + 0x54120005, // 000F LDINT R4 6 + 0x58140007, // 0010 LDCONST R5 K7 + 0x7C080600, // 0011 CALL R2 3 + 0x90020A01, // 0012 SETMBR R0 K5 R1 + 0x80000000, // 0013 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: init ********************************************************************/ @@ -200,16 +255,16 @@ be_local_closure(Matter_Plugin_Light0_invoke_request, /* name */ /* K4 */ be_nested_str_weak(command), /* K5 */ be_nested_str_weak(update_shadow_lazy), /* K6 */ be_const_int(0), - /* K7 */ be_nested_str_weak(set), - /* K8 */ be_nested_str_weak(power), - /* K9 */ be_nested_str_weak(update_shadow), + /* K7 */ be_nested_str_weak(set_onoff), + /* K8 */ be_nested_str_weak(publish_command), + /* K9 */ be_nested_str_weak(Power), /* K10 */ be_const_int(1), /* K11 */ be_const_int(2), /* K12 */ be_nested_str_weak(shadow_onoff), }), be_str_weak(invoke_request), &be_const_str_solidified, - ( &(const binstruction[52]) { /* code */ + ( &(const binstruction[53]) { /* code */ 0xA4120000, // 0000 IMPORT R4 K0 0xB8160200, // 0001 GETNGBL R5 K1 0x88140B02, // 0002 GETMBR R5 R5 K2 @@ -217,51 +272,52 @@ be_local_closure(Matter_Plugin_Light0_invoke_request, /* name */ 0x881C0704, // 0004 GETMBR R7 R3 K4 0x54220005, // 0005 LDINT R8 6 0x1C200C08, // 0006 EQ R8 R6 R8 - 0x7822002A, // 0007 JMPF R8 #0033 + 0x7822002B, // 0007 JMPF R8 #0034 0x8C200105, // 0008 GETMET R8 R0 K5 0x7C200200, // 0009 CALL R8 1 0x1C200F06, // 000A EQ R8 R7 K6 - 0x7822000A, // 000B JMPF R8 #0017 - 0x8C200907, // 000C GETMET R8 R4 K7 - 0x60280013, // 000D GETGBL R10 G19 - 0x7C280000, // 000E CALL R10 0 - 0x502C0000, // 000F LDBOOL R11 0 0 - 0x982A100B, // 0010 SETIDX R10 K8 R11 - 0x7C200400, // 0011 CALL R8 2 - 0x8C200109, // 0012 GETMET R8 R0 K9 - 0x7C200200, // 0013 CALL R8 1 - 0x50200200, // 0014 LDBOOL R8 1 0 - 0x80041000, // 0015 RET 1 R8 - 0x7002001B, // 0016 JMP #0033 - 0x1C200F0A, // 0017 EQ R8 R7 K10 - 0x7822000A, // 0018 JMPF R8 #0024 - 0x8C200907, // 0019 GETMET R8 R4 K7 - 0x60280013, // 001A GETGBL R10 G19 - 0x7C280000, // 001B CALL R10 0 - 0x502C0200, // 001C LDBOOL R11 1 0 - 0x982A100B, // 001D SETIDX R10 K8 R11 - 0x7C200400, // 001E CALL R8 2 - 0x8C200109, // 001F GETMET R8 R0 K9 - 0x7C200200, // 0020 CALL R8 1 - 0x50200200, // 0021 LDBOOL R8 1 0 - 0x80041000, // 0022 RET 1 R8 - 0x7002000E, // 0023 JMP #0033 - 0x1C200F0B, // 0024 EQ R8 R7 K11 - 0x7822000C, // 0025 JMPF R8 #0033 - 0x8C200907, // 0026 GETMET R8 R4 K7 - 0x60280013, // 0027 GETGBL R10 G19 - 0x7C280000, // 0028 CALL R10 0 - 0x882C010C, // 0029 GETMBR R11 R0 K12 - 0x782E0000, // 002A JMPF R11 #002C - 0x502C0001, // 002B LDBOOL R11 0 1 - 0x502C0200, // 002C LDBOOL R11 1 0 - 0x982A100B, // 002D SETIDX R10 K8 R11 - 0x7C200400, // 002E CALL R8 2 - 0x8C200109, // 002F GETMET R8 R0 K9 - 0x7C200200, // 0030 CALL R8 1 - 0x50200200, // 0031 LDBOOL R8 1 0 - 0x80041000, // 0032 RET 1 R8 - 0x80000000, // 0033 RET 0 + 0x78220009, // 000B JMPF R8 #0016 + 0x8C200107, // 000C GETMET R8 R0 K7 + 0x50280000, // 000D LDBOOL R10 0 0 + 0x7C200400, // 000E CALL R8 2 + 0x8C200108, // 000F GETMET R8 R0 K8 + 0x58280009, // 0010 LDCONST R10 K9 + 0x582C0006, // 0011 LDCONST R11 K6 + 0x7C200600, // 0012 CALL R8 3 + 0x50200200, // 0013 LDBOOL R8 1 0 + 0x80041000, // 0014 RET 1 R8 + 0x7002001D, // 0015 JMP #0034 + 0x1C200F0A, // 0016 EQ R8 R7 K10 + 0x78220009, // 0017 JMPF R8 #0022 + 0x8C200107, // 0018 GETMET R8 R0 K7 + 0x50280200, // 0019 LDBOOL R10 1 0 + 0x7C200400, // 001A CALL R8 2 + 0x8C200108, // 001B GETMET R8 R0 K8 + 0x58280009, // 001C LDCONST R10 K9 + 0x582C000A, // 001D LDCONST R11 K10 + 0x7C200600, // 001E CALL R8 3 + 0x50200200, // 001F LDBOOL R8 1 0 + 0x80041000, // 0020 RET 1 R8 + 0x70020011, // 0021 JMP #0034 + 0x1C200F0B, // 0022 EQ R8 R7 K11 + 0x7822000F, // 0023 JMPF R8 #0034 + 0x8C200107, // 0024 GETMET R8 R0 K7 + 0x8828010C, // 0025 GETMBR R10 R0 K12 + 0x782A0000, // 0026 JMPF R10 #0028 + 0x50280001, // 0027 LDBOOL R10 0 1 + 0x50280200, // 0028 LDBOOL R10 1 0 + 0x7C200400, // 0029 CALL R8 2 + 0x8C200108, // 002A GETMET R8 R0 K8 + 0x58280009, // 002B LDCONST R10 K9 + 0x882C010C, // 002C GETMBR R11 R0 K12 + 0x782E0001, // 002D JMPF R11 #0030 + 0x582C000A, // 002E LDCONST R11 K10 + 0x70020000, // 002F JMP #0031 + 0x582C0006, // 0030 LDCONST R11 K6 + 0x7C200600, // 0031 CALL R8 3 + 0x50200200, // 0032 LDBOOL R8 1 0 + 0x80041000, // 0033 RET 1 R8 + 0x80000000, // 0034 RET 0 }) ) ); @@ -275,17 +331,19 @@ extern const bclass be_class_Matter_Plugin_Device; be_local_class(Matter_Plugin_Light0, 1, &be_class_Matter_Plugin_Device, - be_nested_map(10, + be_nested_map(11, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + { be_const_key_weak(NAME, -1), be_nested_str_weak(Light_X200_X20On) }, + { be_const_key_weak(UPDATE_TIME, -1), be_const_int(250) }, + { be_const_key_weak(TYPE, -1), be_nested_str_weak(light0) }, + { be_const_key_weak(shadow_onoff, 8), be_const_var(0) }, + { be_const_key_weak(TYPES, 5), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(1, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(256, -1), be_const_int(2) }, })) ) } )) }, - { be_const_key_weak(TYPE, -1), be_nested_str_weak(light0) }, - { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Light0_read_attribute_closure) }, - { be_const_key_weak(NAME, -1), be_nested_str_weak(Light_X200_X20On) }, - { be_const_key_weak(CLUSTERS, 3), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + { be_const_key_weak(set_onoff, 2), be_const_closure(Matter_Plugin_Light0_set_onoff_closure) }, + { be_const_key_weak(CLUSTERS, 7), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(1, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(6, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { @@ -296,11 +354,10 @@ be_local_class(Matter_Plugin_Light0, be_const_int(65533), })) ) } )) }, })) ) } )) }, - { be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Light0_init_closure) }, - { be_const_key_weak(UPDATE_TIME, -1), be_const_int(250) }, + { be_const_key_weak(update_shadow, 0), be_const_closure(Matter_Plugin_Light0_update_shadow_closure) }, + { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Light0_read_attribute_closure) }, + { be_const_key_weak(init, 1), be_const_closure(Matter_Plugin_Light0_init_closure) }, { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Light0_invoke_request_closure) }, - { be_const_key_weak(shadow_onoff, -1), be_const_var(0) }, - { be_const_key_weak(update_shadow, 1), be_const_closure(Matter_Plugin_Light0_update_shadow_closure) }, })), be_str_weak(Matter_Plugin_Light0) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Light1.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Light1.h index 119611183ccb..c7f9025dc365 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Light1.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Light1.h @@ -7,225 +7,91 @@ extern const bclass be_class_Matter_Plugin_Light1; /******************************************************************** -** Solidified function: update_shadow +** Solidified function: set_bri ********************************************************************/ -be_local_closure(Matter_Plugin_Light1_update_shadow, /* name */ +be_local_closure(Matter_Plugin_Light1_set_bri, /* name */ be_nested_proto( 11, /* nstack */ - 1, /* argc */ + 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(light), - /* K1 */ be_nested_str_weak(get), - /* K2 */ be_nested_str_weak(find), - /* K3 */ be_nested_str_weak(bri), - /* K4 */ be_nested_str_weak(tasmota), - /* K5 */ be_nested_str_weak(scale_uint), - /* K6 */ be_const_int(0), - /* K7 */ be_nested_str_weak(shadow_bri), - /* K8 */ be_nested_str_weak(attribute_updated), - /* K9 */ be_nested_str_weak(update_shadow), - }), - be_str_weak(update_shadow), - &be_const_str_solidified, - ( &(const binstruction[36]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x8C080301, // 0001 GETMET R2 R1 K1 - 0x7C080200, // 0002 CALL R2 1 - 0x4C0C0000, // 0003 LDNIL R3 - 0x200C0403, // 0004 NE R3 R2 R3 - 0x780E0017, // 0005 JMPF R3 #001E - 0x8C0C0502, // 0006 GETMET R3 R2 K2 - 0x58140003, // 0007 LDCONST R5 K3 - 0x4C180000, // 0008 LDNIL R6 - 0x7C0C0600, // 0009 CALL R3 3 - 0x4C100000, // 000A LDNIL R4 - 0x20100604, // 000B NE R4 R3 R4 - 0x78120010, // 000C JMPF R4 #001E - 0xB8120800, // 000D GETNGBL R4 K4 - 0x8C100905, // 000E GETMET R4 R4 K5 - 0x5C180600, // 000F MOVE R6 R3 - 0x581C0006, // 0010 LDCONST R7 K6 - 0x542200FE, // 0011 LDINT R8 255 - 0x58240006, // 0012 LDCONST R9 K6 - 0x542A00FD, // 0013 LDINT R10 254 - 0x7C100C00, // 0014 CALL R4 6 - 0x5C0C0800, // 0015 MOVE R3 R4 - 0x88100107, // 0016 GETMBR R4 R0 K7 - 0x20100604, // 0017 NE R4 R3 R4 - 0x78120004, // 0018 JMPF R4 #001E - 0x8C100108, // 0019 GETMET R4 R0 K8 - 0x541A0007, // 001A LDINT R6 8 - 0x581C0006, // 001B LDCONST R7 K6 - 0x7C100600, // 001C CALL R4 3 - 0x90020E03, // 001D SETMBR R0 K7 R3 - 0x600C0003, // 001E GETGBL R3 G3 - 0x5C100000, // 001F MOVE R4 R0 - 0x7C0C0200, // 0020 CALL R3 1 - 0x8C0C0709, // 0021 GETMET R3 R3 K9 - 0x7C0C0200, // 0022 CALL R3 1 - 0x80000000, // 0023 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: invoke_request -********************************************************************/ -be_local_closure(Matter_Plugin_Light1_invoke_request, /* 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[20]) { /* constants */ - /* K0 */ be_nested_str_weak(light), - /* 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(update_shadow_lazy), - /* K6 */ be_const_int(0), - /* K7 */ be_nested_str_weak(findsubval), - /* K8 */ be_nested_str_weak(tasmota), - /* K9 */ be_nested_str_weak(scale_uint), - /* K10 */ be_nested_str_weak(set), - /* K11 */ be_nested_str_weak(bri), - /* K12 */ be_nested_str_weak(update_shadow), - /* K13 */ be_nested_str_weak(log), - /* K14 */ be_nested_str_weak(bri_X3A), - /* K15 */ be_const_int(1), - /* K16 */ be_const_int(2), - /* K17 */ be_const_int(3), - /* K18 */ be_nested_str_weak(power), - /* K19 */ be_nested_str_weak(invoke_request), + ( &(const bvalue[12]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str_weak(virtual), + /* K2 */ be_nested_str_weak(light), + /* K3 */ be_nested_str_weak(tasmota), + /* K4 */ be_nested_str_weak(scale_uint), + /* K5 */ be_nested_str_weak(set), + /* K6 */ be_nested_str_weak(bri), + /* K7 */ be_nested_str_weak(power), + /* K8 */ be_nested_str_weak(update_shadow), + /* K9 */ be_nested_str_weak(shadow_onoff), + /* K10 */ be_nested_str_weak(attribute_updated), + /* K11 */ be_nested_str_weak(shadow_bri), }), - be_str_weak(invoke_request), + be_str_weak(set_bri), &be_const_str_solidified, - ( &(const binstruction[112]) { /* 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 - 0x54220007, // 0005 LDINT R8 8 - 0x1C200C08, // 0006 EQ R8 R6 R8 - 0x7822005D, // 0007 JMPF R8 #0066 - 0x8C200105, // 0008 GETMET R8 R0 K5 - 0x7C200200, // 0009 CALL R8 1 - 0x1C200F06, // 000A EQ R8 R7 K6 - 0x78220019, // 000B JMPF R8 #0026 - 0x8C200507, // 000C GETMET R8 R2 K7 - 0x58280006, // 000D LDCONST R10 K6 - 0x7C200400, // 000E CALL R8 2 - 0xB8261000, // 000F GETNGBL R9 K8 - 0x8C241309, // 0010 GETMET R9 R9 K9 - 0x5C2C1000, // 0011 MOVE R11 R8 - 0x58300006, // 0012 LDCONST R12 K6 - 0x543600FD, // 0013 LDINT R13 254 - 0x58380006, // 0014 LDCONST R14 K6 - 0x543E00FE, // 0015 LDINT R15 255 - 0x7C240C00, // 0016 CALL R9 6 - 0x8C28090A, // 0017 GETMET R10 R4 K10 - 0x60300013, // 0018 GETGBL R12 G19 - 0x7C300000, // 0019 CALL R12 0 - 0x98321609, // 001A SETIDX R12 K11 R9 - 0x7C280400, // 001B CALL R10 2 - 0x8C28010C, // 001C GETMET R10 R0 K12 - 0x7C280200, // 001D CALL R10 1 - 0x60280008, // 001E GETGBL R10 G8 - 0x5C2C1000, // 001F MOVE R11 R8 - 0x7C280200, // 0020 CALL R10 1 - 0x002A1C0A, // 0021 ADD R10 K14 R10 - 0x900E1A0A, // 0022 SETMBR R3 K13 R10 - 0x50280200, // 0023 LDBOOL R10 1 0 - 0x80041400, // 0024 RET 1 R10 - 0x7002003E, // 0025 JMP #0065 - 0x1C200F0F, // 0026 EQ R8 R7 K15 - 0x78220002, // 0027 JMPF R8 #002B - 0x50200200, // 0028 LDBOOL R8 1 0 - 0x80041000, // 0029 RET 1 R8 - 0x70020039, // 002A JMP #0065 - 0x1C200F10, // 002B EQ R8 R7 K16 - 0x78220002, // 002C JMPF R8 #0030 - 0x50200200, // 002D LDBOOL R8 1 0 - 0x80041000, // 002E RET 1 R8 - 0x70020034, // 002F JMP #0065 - 0x1C200F11, // 0030 EQ R8 R7 K17 - 0x78220002, // 0031 JMPF R8 #0035 - 0x50200200, // 0032 LDBOOL R8 1 0 - 0x80041000, // 0033 RET 1 R8 - 0x7002002F, // 0034 JMP #0065 - 0x54220003, // 0035 LDINT R8 4 - 0x1C200E08, // 0036 EQ R8 R7 R8 - 0x7822001B, // 0037 JMPF R8 #0054 - 0x8C200507, // 0038 GETMET R8 R2 K7 - 0x58280006, // 0039 LDCONST R10 K6 - 0x7C200400, // 003A CALL R8 2 - 0xB8261000, // 003B GETNGBL R9 K8 - 0x8C241309, // 003C GETMET R9 R9 K9 - 0x5C2C1000, // 003D MOVE R11 R8 - 0x58300006, // 003E LDCONST R12 K6 - 0x543600FD, // 003F LDINT R13 254 - 0x58380006, // 0040 LDCONST R14 K6 - 0x543E00FE, // 0041 LDINT R15 255 - 0x7C240C00, // 0042 CALL R9 6 - 0x24281306, // 0043 GT R10 R9 K6 - 0x8C2C090A, // 0044 GETMET R11 R4 K10 - 0x60340013, // 0045 GETGBL R13 G19 - 0x7C340000, // 0046 CALL R13 0 - 0x98361609, // 0047 SETIDX R13 K11 R9 - 0x9836240A, // 0048 SETIDX R13 K18 R10 - 0x7C2C0400, // 0049 CALL R11 2 - 0x8C2C010C, // 004A GETMET R11 R0 K12 - 0x7C2C0200, // 004B CALL R11 1 - 0x602C0008, // 004C GETGBL R11 G8 - 0x5C301000, // 004D MOVE R12 R8 - 0x7C2C0200, // 004E CALL R11 1 - 0x002E1C0B, // 004F ADD R11 K14 R11 - 0x900E1A0B, // 0050 SETMBR R3 K13 R11 - 0x502C0200, // 0051 LDBOOL R11 1 0 - 0x80041600, // 0052 RET 1 R11 - 0x70020010, // 0053 JMP #0065 - 0x54220004, // 0054 LDINT R8 5 - 0x1C200E08, // 0055 EQ R8 R7 R8 - 0x78220002, // 0056 JMPF R8 #005A - 0x50200200, // 0057 LDBOOL R8 1 0 - 0x80041000, // 0058 RET 1 R8 - 0x7002000A, // 0059 JMP #0065 - 0x54220005, // 005A LDINT R8 6 - 0x1C200E08, // 005B EQ R8 R7 R8 - 0x78220002, // 005C JMPF R8 #0060 - 0x50200200, // 005D LDBOOL R8 1 0 - 0x80041000, // 005E RET 1 R8 - 0x70020004, // 005F JMP #0065 - 0x54220006, // 0060 LDINT R8 7 - 0x1C200E08, // 0061 EQ R8 R7 R8 - 0x78220001, // 0062 JMPF R8 #0065 - 0x50200200, // 0063 LDBOOL R8 1 0 - 0x80041000, // 0064 RET 1 R8 - 0x70020008, // 0065 JMP #006F - 0x60200003, // 0066 GETGBL R8 G3 - 0x5C240000, // 0067 MOVE R9 R0 - 0x7C200200, // 0068 CALL R8 1 - 0x8C201113, // 0069 GETMET R8 R8 K19 - 0x5C280200, // 006A MOVE R10 R1 - 0x5C2C0400, // 006B MOVE R11 R2 - 0x5C300600, // 006C MOVE R12 R3 - 0x7C200800, // 006D CALL R8 4 - 0x80041000, // 006E RET 1 R8 - 0x80000000, // 006F RET 0 + ( &(const binstruction[56]) { /* code */ + 0x140C0300, // 0000 LT R3 R1 K0 + 0x780E0000, // 0001 JMPF R3 #0003 + 0x58040000, // 0002 LDCONST R1 K0 + 0x540E00FD, // 0003 LDINT R3 254 + 0x240C0203, // 0004 GT R3 R1 R3 + 0x780E0000, // 0005 JMPF R3 #0007 + 0x540600FD, // 0006 LDINT R1 254 + 0x880C0101, // 0007 GETMBR R3 R0 K1 + 0x740E001A, // 0008 JMPT R3 #0024 + 0xA40E0400, // 0009 IMPORT R3 K2 + 0xB8120600, // 000A GETNGBL R4 K3 + 0x8C100904, // 000B GETMET R4 R4 K4 + 0x5C180200, // 000C MOVE R6 R1 + 0x581C0000, // 000D LDCONST R7 K0 + 0x542200FD, // 000E LDINT R8 254 + 0x58240000, // 000F LDCONST R9 K0 + 0x542A00FE, // 0010 LDINT R10 255 + 0x7C100C00, // 0011 CALL R4 6 + 0x4C140000, // 0012 LDNIL R5 + 0x1C140405, // 0013 EQ R5 R2 R5 + 0x78160005, // 0014 JMPF R5 #001B + 0x8C140705, // 0015 GETMET R5 R3 K5 + 0x601C0013, // 0016 GETGBL R7 G19 + 0x7C1C0000, // 0017 CALL R7 0 + 0x981E0C04, // 0018 SETIDX R7 K6 R4 + 0x7C140400, // 0019 CALL R5 2 + 0x70020005, // 001A JMP #0021 + 0x8C140705, // 001B GETMET R5 R3 K5 + 0x601C0013, // 001C GETGBL R7 G19 + 0x7C1C0000, // 001D CALL R7 0 + 0x981E0C04, // 001E SETIDX R7 K6 R4 + 0x981E0E02, // 001F SETIDX R7 K7 R2 + 0x7C140400, // 0020 CALL R5 2 + 0x8C140108, // 0021 GETMET R5 R0 K8 + 0x7C140200, // 0022 CALL R5 1 + 0x70020012, // 0023 JMP #0037 + 0x4C0C0000, // 0024 LDNIL R3 + 0x200C0403, // 0025 NE R3 R2 R3 + 0x780E0007, // 0026 JMPF R3 #002F + 0x880C0109, // 0027 GETMBR R3 R0 K9 + 0x200C0403, // 0028 NE R3 R2 R3 + 0x780E0004, // 0029 JMPF R3 #002F + 0x8C0C010A, // 002A GETMET R3 R0 K10 + 0x54160005, // 002B LDINT R5 6 + 0x58180000, // 002C LDCONST R6 K0 + 0x7C0C0600, // 002D CALL R3 3 + 0x90021202, // 002E SETMBR R0 K9 R2 + 0x880C010B, // 002F GETMBR R3 R0 K11 + 0x200C0203, // 0030 NE R3 R1 R3 + 0x780E0004, // 0031 JMPF R3 #0037 + 0x8C0C010A, // 0032 GETMET R3 R0 K10 + 0x54160007, // 0033 LDINT R5 8 + 0x58180000, // 0034 LDCONST R6 K0 + 0x7C0C0600, // 0035 CALL R3 3 + 0x90021601, // 0036 SETMBR R0 K11 R1 + 0x80000000, // 0037 RET 0 }) ) ); @@ -349,6 +215,79 @@ be_local_closure(Matter_Plugin_Light1_read_attribute, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: update_shadow +********************************************************************/ +be_local_closure(Matter_Plugin_Light1_update_shadow, /* 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[11]) { /* constants */ + /* K0 */ be_nested_str_weak(virtual), + /* K1 */ be_nested_str_weak(light), + /* K2 */ be_nested_str_weak(get), + /* K3 */ be_nested_str_weak(find), + /* K4 */ be_nested_str_weak(bri), + /* K5 */ be_nested_str_weak(tasmota), + /* K6 */ be_nested_str_weak(scale_uint), + /* K7 */ be_const_int(0), + /* K8 */ be_nested_str_weak(shadow_bri), + /* K9 */ be_nested_str_weak(attribute_updated), + /* K10 */ be_nested_str_weak(update_shadow), + }), + be_str_weak(update_shadow), + &be_const_str_solidified, + ( &(const binstruction[38]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x7406001D, // 0001 JMPT R1 #0020 + 0xA4060200, // 0002 IMPORT R1 K1 + 0x8C080302, // 0003 GETMET R2 R1 K2 + 0x7C080200, // 0004 CALL R2 1 + 0x4C0C0000, // 0005 LDNIL R3 + 0x200C0403, // 0006 NE R3 R2 R3 + 0x780E0017, // 0007 JMPF R3 #0020 + 0x8C0C0503, // 0008 GETMET R3 R2 K3 + 0x58140004, // 0009 LDCONST R5 K4 + 0x4C180000, // 000A LDNIL R6 + 0x7C0C0600, // 000B CALL R3 3 + 0x4C100000, // 000C LDNIL R4 + 0x20100604, // 000D NE R4 R3 R4 + 0x78120010, // 000E JMPF R4 #0020 + 0xB8120A00, // 000F GETNGBL R4 K5 + 0x8C100906, // 0010 GETMET R4 R4 K6 + 0x5C180600, // 0011 MOVE R6 R3 + 0x581C0007, // 0012 LDCONST R7 K7 + 0x542200FE, // 0013 LDINT R8 255 + 0x58240007, // 0014 LDCONST R9 K7 + 0x542A00FD, // 0015 LDINT R10 254 + 0x7C100C00, // 0016 CALL R4 6 + 0x5C0C0800, // 0017 MOVE R3 R4 + 0x88100108, // 0018 GETMBR R4 R0 K8 + 0x20100604, // 0019 NE R4 R3 R4 + 0x78120004, // 001A JMPF R4 #0020 + 0x8C100109, // 001B GETMET R4 R0 K9 + 0x541A0007, // 001C LDINT R6 8 + 0x581C0007, // 001D LDCONST R7 K7 + 0x7C100600, // 001E CALL R4 3 + 0x90021003, // 001F SETMBR R0 K8 R3 + 0x60040003, // 0020 GETGBL R1 G3 + 0x5C080000, // 0021 MOVE R2 R0 + 0x7C040200, // 0022 CALL R1 1 + 0x8C04030A, // 0023 GETMET R1 R1 K10 + 0x7C040200, // 0024 CALL R1 1 + 0x80000000, // 0025 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: init ********************************************************************/ @@ -386,6 +325,170 @@ be_local_closure(Matter_Plugin_Light1_init, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: invoke_request +********************************************************************/ +be_local_closure(Matter_Plugin_Light1_invoke_request, /* name */ + be_nested_proto( + 22, /* nstack */ + 4, /* 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(light), + /* 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(update_shadow_lazy), + /* K6 */ be_const_int(0), + /* K7 */ be_nested_str_weak(findsubval), + /* K8 */ be_nested_str_weak(set_bri), + /* K9 */ be_nested_str_weak(log), + /* K10 */ be_nested_str_weak(bri_X3A), + /* K11 */ be_nested_str_weak(publish_command), + /* K12 */ be_nested_str_weak(Bri), + /* K13 */ be_nested_str_weak(Dimmer), + /* K14 */ be_nested_str_weak(tasmota), + /* K15 */ be_nested_str_weak(scale_uint), + /* K16 */ be_const_int(1), + /* K17 */ be_const_int(2), + /* K18 */ be_const_int(3), + /* K19 */ be_nested_str_weak(Power), + /* K20 */ be_nested_str_weak(invoke_request), + }), + be_str_weak(invoke_request), + &be_const_str_solidified, + ( &(const binstruction[119]) { /* 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 + 0x54220007, // 0005 LDINT R8 8 + 0x1C200C08, // 0006 EQ R8 R6 R8 + 0x78220064, // 0007 JMPF R8 #006D + 0x8C200105, // 0008 GETMET R8 R0 K5 + 0x7C200200, // 0009 CALL R8 1 + 0x1C200F06, // 000A EQ R8 R7 K6 + 0x7822001A, // 000B JMPF R8 #0027 + 0x8C200507, // 000C GETMET R8 R2 K7 + 0x58280006, // 000D LDCONST R10 K6 + 0x7C200400, // 000E CALL R8 2 + 0x8C240108, // 000F GETMET R9 R0 K8 + 0x5C2C1000, // 0010 MOVE R11 R8 + 0x7C240400, // 0011 CALL R9 2 + 0x60240008, // 0012 GETGBL R9 G8 + 0x5C281000, // 0013 MOVE R10 R8 + 0x7C240200, // 0014 CALL R9 1 + 0x00261409, // 0015 ADD R9 K10 R9 + 0x900E1209, // 0016 SETMBR R3 K9 R9 + 0x8C24010B, // 0017 GETMET R9 R0 K11 + 0x582C000C, // 0018 LDCONST R11 K12 + 0x5C301000, // 0019 MOVE R12 R8 + 0x5834000D, // 001A LDCONST R13 K13 + 0xB83A1C00, // 001B GETNGBL R14 K14 + 0x8C381D0F, // 001C GETMET R14 R14 K15 + 0x5C401000, // 001D MOVE R16 R8 + 0x58440006, // 001E LDCONST R17 K6 + 0x544A00FD, // 001F LDINT R18 254 + 0x584C0006, // 0020 LDCONST R19 K6 + 0x54520063, // 0021 LDINT R20 100 + 0x7C380C00, // 0022 CALL R14 6 + 0x7C240A00, // 0023 CALL R9 5 + 0x50240200, // 0024 LDBOOL R9 1 0 + 0x80041200, // 0025 RET 1 R9 + 0x70020044, // 0026 JMP #006C + 0x1C200F10, // 0027 EQ R8 R7 K16 + 0x78220002, // 0028 JMPF R8 #002C + 0x50200200, // 0029 LDBOOL R8 1 0 + 0x80041000, // 002A RET 1 R8 + 0x7002003F, // 002B JMP #006C + 0x1C200F11, // 002C EQ R8 R7 K17 + 0x78220002, // 002D JMPF R8 #0031 + 0x50200200, // 002E LDBOOL R8 1 0 + 0x80041000, // 002F RET 1 R8 + 0x7002003A, // 0030 JMP #006C + 0x1C200F12, // 0031 EQ R8 R7 K18 + 0x78220002, // 0032 JMPF R8 #0036 + 0x50200200, // 0033 LDBOOL R8 1 0 + 0x80041000, // 0034 RET 1 R8 + 0x70020035, // 0035 JMP #006C + 0x54220003, // 0036 LDINT R8 4 + 0x1C200E08, // 0037 EQ R8 R7 R8 + 0x78220021, // 0038 JMPF R8 #005B + 0x8C200507, // 0039 GETMET R8 R2 K7 + 0x58280006, // 003A LDCONST R10 K6 + 0x7C200400, // 003B CALL R8 2 + 0x24241106, // 003C GT R9 R8 K6 + 0x8C280108, // 003D GETMET R10 R0 K8 + 0x5C301000, // 003E MOVE R12 R8 + 0x5C341200, // 003F MOVE R13 R9 + 0x7C280600, // 0040 CALL R10 3 + 0x60280008, // 0041 GETGBL R10 G8 + 0x5C2C1000, // 0042 MOVE R11 R8 + 0x7C280200, // 0043 CALL R10 1 + 0x002A140A, // 0044 ADD R10 K10 R10 + 0x900E120A, // 0045 SETMBR R3 K9 R10 + 0x8C28010B, // 0046 GETMET R10 R0 K11 + 0x5830000C, // 0047 LDCONST R12 K12 + 0x5C341000, // 0048 MOVE R13 R8 + 0x5838000D, // 0049 LDCONST R14 K13 + 0xB83E1C00, // 004A GETNGBL R15 K14 + 0x8C3C1F0F, // 004B GETMET R15 R15 K15 + 0x5C441000, // 004C MOVE R17 R8 + 0x58480006, // 004D LDCONST R18 K6 + 0x544E00FD, // 004E LDINT R19 254 + 0x58500006, // 004F LDCONST R20 K6 + 0x54560063, // 0050 LDINT R21 100 + 0x7C3C0C00, // 0051 CALL R15 6 + 0x58400013, // 0052 LDCONST R16 K19 + 0x78260001, // 0053 JMPF R9 #0056 + 0x58440010, // 0054 LDCONST R17 K16 + 0x70020000, // 0055 JMP #0057 + 0x58440006, // 0056 LDCONST R17 K6 + 0x7C280E00, // 0057 CALL R10 7 + 0x50280200, // 0058 LDBOOL R10 1 0 + 0x80041400, // 0059 RET 1 R10 + 0x70020010, // 005A JMP #006C + 0x54220004, // 005B LDINT R8 5 + 0x1C200E08, // 005C EQ R8 R7 R8 + 0x78220002, // 005D JMPF R8 #0061 + 0x50200200, // 005E LDBOOL R8 1 0 + 0x80041000, // 005F RET 1 R8 + 0x7002000A, // 0060 JMP #006C + 0x54220005, // 0061 LDINT R8 6 + 0x1C200E08, // 0062 EQ R8 R7 R8 + 0x78220002, // 0063 JMPF R8 #0067 + 0x50200200, // 0064 LDBOOL R8 1 0 + 0x80041000, // 0065 RET 1 R8 + 0x70020004, // 0066 JMP #006C + 0x54220006, // 0067 LDINT R8 7 + 0x1C200E08, // 0068 EQ R8 R7 R8 + 0x78220001, // 0069 JMPF R8 #006C + 0x50200200, // 006A LDBOOL R8 1 0 + 0x80041000, // 006B RET 1 R8 + 0x70020008, // 006C JMP #0076 + 0x60200003, // 006D GETGBL R8 G3 + 0x5C240000, // 006E MOVE R9 R0 + 0x7C200200, // 006F CALL R8 1 + 0x8C201114, // 0070 GETMET R8 R8 K20 + 0x5C280200, // 0071 MOVE R10 R1 + 0x5C2C0400, // 0072 MOVE R11 R2 + 0x5C300600, // 0073 MOVE R12 R3 + 0x7C200800, // 0074 CALL R8 4 + 0x80041000, // 0075 RET 1 R8 + 0x80000000, // 0076 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified class: Matter_Plugin_Light1 ********************************************************************/ @@ -393,17 +496,17 @@ extern const bclass be_class_Matter_Plugin_Light0; be_local_class(Matter_Plugin_Light1, 1, &be_class_Matter_Plugin_Light0, - be_nested_map(9, + be_nested_map(10, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Light1_init_closure) }, - { be_const_key_weak(TYPE, -1), be_nested_str_weak(light1) }, { be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(1, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(257, -1), be_const_int(2) }, })) ) } )) }, + { be_const_key_weak(shadow_bri, 6), be_const_var(0) }, + { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Light1_read_attribute_closure) }, { be_const_key_weak(NAME, -1), be_nested_str_weak(Light_X201_X20Dimmer) }, - { be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + { be_const_key_weak(CLUSTERS, 3), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(1, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(8, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { @@ -418,10 +521,11 @@ be_local_class(Matter_Plugin_Light1, be_const_int(65533), })) ) } )) }, })) ) } )) }, + { be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Light1_init_closure) }, + { be_const_key_weak(TYPE, 8), be_nested_str_weak(light1) }, { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Light1_invoke_request_closure) }, - { be_const_key_weak(read_attribute, 0), be_const_closure(Matter_Plugin_Light1_read_attribute_closure) }, - { be_const_key_weak(update_shadow, 8), be_const_closure(Matter_Plugin_Light1_update_shadow_closure) }, - { be_const_key_weak(shadow_bri, -1), be_const_var(0) }, + { be_const_key_weak(update_shadow, -1), be_const_closure(Matter_Plugin_Light1_update_shadow_closure) }, + { be_const_key_weak(set_bri, 1), be_const_closure(Matter_Plugin_Light1_set_bri_closure) }, })), be_str_weak(Matter_Plugin_Light1) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Light2.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Light2.h index 8294b2afaee8..ad5fa32ac99d 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Light2.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Light2.h @@ -6,188 +6,6 @@ extern const bclass be_class_Matter_Plugin_Light2; -/******************************************************************** -** Solidified function: read_attribute -********************************************************************/ -be_local_closure(Matter_Plugin_Light2_read_attribute, /* name */ - be_nested_proto( - 12, /* nstack */ - 4, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[14]) { /* constants */ - /* K0 */ be_nested_str_weak(matter), - /* K1 */ be_nested_str_weak(TLV), - /* K2 */ be_nested_str_weak(cluster), - /* K3 */ be_nested_str_weak(attribute), - /* K4 */ be_nested_str_weak(update_shadow_lazy), - /* K5 */ be_nested_str_weak(set), - /* K6 */ be_nested_str_weak(U1), - /* K7 */ be_nested_str_weak(shadow_ct), - /* K8 */ be_const_int(2), - /* K9 */ be_const_int(0), - /* K10 */ be_nested_str_weak(ct_min), - /* K11 */ be_nested_str_weak(ct_max), - /* K12 */ be_nested_str_weak(U4), - /* K13 */ be_nested_str_weak(read_attribute), - }), - be_str_weak(read_attribute), - &be_const_str_solidified, - ( &(const binstruction[82]) { /* code */ - 0xB8120000, // 0000 GETNGBL R4 K0 - 0x88100901, // 0001 GETMBR R4 R4 K1 - 0x88140502, // 0002 GETMBR R5 R2 K2 - 0x88180503, // 0003 GETMBR R6 R2 K3 - 0x541E02FF, // 0004 LDINT R7 768 - 0x1C1C0A07, // 0005 EQ R7 R5 R7 - 0x781E0040, // 0006 JMPF R7 #0048 - 0x8C1C0104, // 0007 GETMET R7 R0 K4 - 0x7C1C0200, // 0008 CALL R7 1 - 0x541E0006, // 0009 LDINT R7 7 - 0x1C1C0C07, // 000A EQ R7 R6 R7 - 0x781E0005, // 000B JMPF R7 #0012 - 0x8C1C0705, // 000C GETMET R7 R3 K5 - 0x88240906, // 000D GETMBR R9 R4 K6 - 0x88280107, // 000E GETMBR R10 R0 K7 - 0x7C1C0600, // 000F CALL R7 3 - 0x80040E00, // 0010 RET 1 R7 - 0x70020034, // 0011 JMP #0047 - 0x541E0007, // 0012 LDINT R7 8 - 0x1C1C0C07, // 0013 EQ R7 R6 R7 - 0x781E0005, // 0014 JMPF R7 #001B - 0x8C1C0705, // 0015 GETMET R7 R3 K5 - 0x88240906, // 0016 GETMBR R9 R4 K6 - 0x58280008, // 0017 LDCONST R10 K8 - 0x7C1C0600, // 0018 CALL R7 3 - 0x80040E00, // 0019 RET 1 R7 - 0x7002002B, // 001A JMP #0047 - 0x541E000E, // 001B LDINT R7 15 - 0x1C1C0C07, // 001C EQ R7 R6 R7 - 0x781E0005, // 001D JMPF R7 #0024 - 0x8C1C0705, // 001E GETMET R7 R3 K5 - 0x88240906, // 001F GETMBR R9 R4 K6 - 0x58280009, // 0020 LDCONST R10 K9 - 0x7C1C0600, // 0021 CALL R7 3 - 0x80040E00, // 0022 RET 1 R7 - 0x70020022, // 0023 JMP #0047 - 0x541E400A, // 0024 LDINT R7 16395 - 0x1C1C0C07, // 0025 EQ R7 R6 R7 - 0x781E0005, // 0026 JMPF R7 #002D - 0x8C1C0705, // 0027 GETMET R7 R3 K5 - 0x88240906, // 0028 GETMBR R9 R4 K6 - 0x8828010A, // 0029 GETMBR R10 R0 K10 - 0x7C1C0600, // 002A CALL R7 3 - 0x80040E00, // 002B RET 1 R7 - 0x70020019, // 002C JMP #0047 - 0x541E400B, // 002D LDINT R7 16396 - 0x1C1C0C07, // 002E EQ R7 R6 R7 - 0x781E0005, // 002F JMPF R7 #0036 - 0x8C1C0705, // 0030 GETMET R7 R3 K5 - 0x88240906, // 0031 GETMBR R9 R4 K6 - 0x8828010B, // 0032 GETMBR R10 R0 K11 - 0x7C1C0600, // 0033 CALL R7 3 - 0x80040E00, // 0034 RET 1 R7 - 0x70020010, // 0035 JMP #0047 - 0x541EFFFB, // 0036 LDINT R7 65532 - 0x1C1C0C07, // 0037 EQ R7 R6 R7 - 0x781E0005, // 0038 JMPF R7 #003F - 0x8C1C0705, // 0039 GETMET R7 R3 K5 - 0x8824090C, // 003A GETMBR R9 R4 K12 - 0x542A000F, // 003B LDINT R10 16 - 0x7C1C0600, // 003C CALL R7 3 - 0x80040E00, // 003D RET 1 R7 - 0x70020007, // 003E JMP #0047 - 0x541EFFFC, // 003F LDINT R7 65533 - 0x1C1C0C07, // 0040 EQ R7 R6 R7 - 0x781E0004, // 0041 JMPF R7 #0047 - 0x8C1C0705, // 0042 GETMET R7 R3 K5 - 0x8824090C, // 0043 GETMBR R9 R4 K12 - 0x542A0004, // 0044 LDINT R10 5 - 0x7C1C0600, // 0045 CALL R7 3 - 0x80040E00, // 0046 RET 1 R7 - 0x70020008, // 0047 JMP #0051 - 0x601C0003, // 0048 GETGBL R7 G3 - 0x5C200000, // 0049 MOVE R8 R0 - 0x7C1C0200, // 004A CALL R7 1 - 0x8C1C0F0D, // 004B GETMET R7 R7 K13 - 0x5C240200, // 004C MOVE R9 R1 - 0x5C280400, // 004D MOVE R10 R2 - 0x5C2C0600, // 004E MOVE R11 R3 - 0x7C1C0800, // 004F CALL R7 4 - 0x80040E00, // 0050 RET 1 R7 - 0x80000000, // 0051 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: update_shadow -********************************************************************/ -be_local_closure(Matter_Plugin_Light2_update_shadow, /* 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[ 8]) { /* constants */ - /* K0 */ be_nested_str_weak(light), - /* K1 */ be_nested_str_weak(update_ct_minmax), - /* K2 */ be_nested_str_weak(update_shadow), - /* K3 */ be_nested_str_weak(get), - /* K4 */ be_nested_str_weak(find), - /* K5 */ be_nested_str_weak(ct), - /* K6 */ be_nested_str_weak(shadow_ct), - /* K7 */ be_nested_str_weak(attribute_updated), - }), - be_str_weak(update_shadow), - &be_const_str_solidified, - ( &(const binstruction[30]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x8C080101, // 0001 GETMET R2 R0 K1 - 0x7C080200, // 0002 CALL R2 1 - 0x60080003, // 0003 GETGBL R2 G3 - 0x5C0C0000, // 0004 MOVE R3 R0 - 0x7C080200, // 0005 CALL R2 1 - 0x8C080502, // 0006 GETMET R2 R2 K2 - 0x7C080200, // 0007 CALL R2 1 - 0x8C080303, // 0008 GETMET R2 R1 K3 - 0x7C080200, // 0009 CALL R2 1 - 0x4C0C0000, // 000A LDNIL R3 - 0x200C0403, // 000B NE R3 R2 R3 - 0x780E000F, // 000C JMPF R3 #001D - 0x8C0C0504, // 000D GETMET R3 R2 K4 - 0x58140005, // 000E LDCONST R5 K5 - 0x4C180000, // 000F LDNIL R6 - 0x7C0C0600, // 0010 CALL R3 3 - 0x4C100000, // 0011 LDNIL R4 - 0x1C100604, // 0012 EQ R4 R3 R4 - 0x78120000, // 0013 JMPF R4 #0015 - 0x880C0106, // 0014 GETMBR R3 R0 K6 - 0x88100106, // 0015 GETMBR R4 R0 K6 - 0x20100604, // 0016 NE R4 R3 R4 - 0x78120004, // 0017 JMPF R4 #001D - 0x8C100107, // 0018 GETMET R4 R0 K7 - 0x541A02FF, // 0019 LDINT R6 768 - 0x541E0006, // 001A LDINT R7 7 - 0x7C100600, // 001B CALL R4 3 - 0x90020C03, // 001C SETMBR R0 K6 R3 - 0x80000000, // 001D RET 0 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: init ********************************************************************/ @@ -228,6 +46,67 @@ be_local_closure(Matter_Plugin_Light2_init, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: set_ct +********************************************************************/ +be_local_closure(Matter_Plugin_Light2_set_ct, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(ct_min), + /* K1 */ be_nested_str_weak(ct_max), + /* K2 */ be_nested_str_weak(virtual), + /* K3 */ be_nested_str_weak(light), + /* K4 */ be_nested_str_weak(set), + /* K5 */ be_nested_str_weak(ct), + /* K6 */ be_nested_str_weak(update_shadow), + /* K7 */ be_nested_str_weak(shadow_ct), + /* K8 */ be_nested_str_weak(attribute_updated), + }), + be_str_weak(set_ct), + &be_const_str_solidified, + ( &(const binstruction[28]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x14080202, // 0001 LT R2 R1 R2 + 0x780A0000, // 0002 JMPF R2 #0004 + 0x88040100, // 0003 GETMBR R1 R0 K0 + 0x88080101, // 0004 GETMBR R2 R0 K1 + 0x24080202, // 0005 GT R2 R1 R2 + 0x780A0000, // 0006 JMPF R2 #0008 + 0x88040101, // 0007 GETMBR R1 R0 K1 + 0x88080102, // 0008 GETMBR R2 R0 K2 + 0x740A0008, // 0009 JMPT R2 #0013 + 0xA40A0600, // 000A IMPORT R2 K3 + 0x8C0C0504, // 000B GETMET R3 R2 K4 + 0x60140013, // 000C GETGBL R5 G19 + 0x7C140000, // 000D CALL R5 0 + 0x98160A01, // 000E SETIDX R5 K5 R1 + 0x7C0C0400, // 000F CALL R3 2 + 0x8C0C0106, // 0010 GETMET R3 R0 K6 + 0x7C0C0200, // 0011 CALL R3 1 + 0x70020007, // 0012 JMP #001B + 0x88080107, // 0013 GETMBR R2 R0 K7 + 0x20080202, // 0014 NE R2 R1 R2 + 0x780A0004, // 0015 JMPF R2 #001B + 0x8C080108, // 0016 GETMET R2 R0 K8 + 0x541202FF, // 0017 LDINT R4 768 + 0x54160006, // 0018 LDINT R5 7 + 0x7C080600, // 0019 CALL R2 3 + 0x90020E01, // 001A SETMBR R0 K7 R1 + 0x80000000, // 001B RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: update_ct_minmax ********************************************************************/ @@ -284,7 +163,7 @@ be_local_closure(Matter_Plugin_Light2_invoke_request, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[16]) { /* constants */ + ( &(const bvalue[14]) { /* constants */ /* K0 */ be_nested_str_weak(light), /* K1 */ be_nested_str_weak(matter), /* K2 */ be_nested_str_weak(TLV), @@ -293,18 +172,16 @@ be_local_closure(Matter_Plugin_Light2_invoke_request, /* name */ /* K5 */ be_nested_str_weak(update_shadow_lazy), /* K6 */ be_nested_str_weak(findsubval), /* K7 */ be_const_int(0), - /* K8 */ be_nested_str_weak(ct_min), - /* K9 */ be_nested_str_weak(ct_max), - /* K10 */ be_nested_str_weak(set), - /* K11 */ be_nested_str_weak(ct), - /* K12 */ be_nested_str_weak(update_shadow), - /* K13 */ be_nested_str_weak(log), - /* K14 */ be_nested_str_weak(ct_X3A), - /* K15 */ be_nested_str_weak(invoke_request), + /* K8 */ be_nested_str_weak(set_ct), + /* K9 */ be_nested_str_weak(log), + /* K10 */ be_nested_str_weak(ct_X3A), + /* K11 */ be_nested_str_weak(publish_command), + /* K12 */ be_nested_str_weak(CT), + /* K13 */ be_nested_str_weak(invoke_request), }), be_str_weak(invoke_request), &be_const_str_solidified, - ( &(const binstruction[67]) { /* code */ + ( &(const binstruction[59]) { /* code */ 0xA4120000, // 0000 IMPORT R4 K0 0xB8160200, // 0001 GETNGBL R5 K1 0x88140B02, // 0002 GETMBR R5 R5 K2 @@ -312,66 +189,240 @@ be_local_closure(Matter_Plugin_Light2_invoke_request, /* name */ 0x881C0704, // 0004 GETMBR R7 R3 K4 0x542202FF, // 0005 LDINT R8 768 0x1C200C08, // 0006 EQ R8 R6 R8 - 0x78220030, // 0007 JMPF R8 #0039 + 0x78220028, // 0007 JMPF R8 #0031 0x8C200105, // 0008 GETMET R8 R0 K5 0x7C200200, // 0009 CALL R8 1 0x54220009, // 000A LDINT R8 10 0x1C200E08, // 000B EQ R8 R7 R8 - 0x78220019, // 000C JMPF R8 #0027 + 0x78220011, // 000C JMPF R8 #001F 0x8C200506, // 000D GETMET R8 R2 K6 0x58280007, // 000E LDCONST R10 K7 0x7C200400, // 000F CALL R8 2 - 0x88240108, // 0010 GETMBR R9 R0 K8 - 0x14241009, // 0011 LT R9 R8 R9 - 0x78260000, // 0012 JMPF R9 #0014 - 0x88200108, // 0013 GETMBR R8 R0 K8 - 0x88240109, // 0014 GETMBR R9 R0 K9 - 0x24241009, // 0015 GT R9 R8 R9 - 0x78260000, // 0016 JMPF R9 #0018 - 0x88200109, // 0017 GETMBR R8 R0 K9 - 0x8C24090A, // 0018 GETMET R9 R4 K10 - 0x602C0013, // 0019 GETGBL R11 G19 - 0x7C2C0000, // 001A CALL R11 0 - 0x982E1608, // 001B SETIDX R11 K11 R8 - 0x7C240400, // 001C CALL R9 2 - 0x8C24010C, // 001D GETMET R9 R0 K12 - 0x7C240200, // 001E CALL R9 1 - 0x60240008, // 001F GETGBL R9 G8 - 0x5C281000, // 0020 MOVE R10 R8 - 0x7C240200, // 0021 CALL R9 1 - 0x00261C09, // 0022 ADD R9 K14 R9 - 0x900E1A09, // 0023 SETMBR R3 K13 R9 - 0x50240200, // 0024 LDBOOL R9 1 0 - 0x80041200, // 0025 RET 1 R9 - 0x70020010, // 0026 JMP #0038 - 0x54220046, // 0027 LDINT R8 71 - 0x1C200E08, // 0028 EQ R8 R7 R8 - 0x78220002, // 0029 JMPF R8 #002D - 0x50200200, // 002A LDBOOL R8 1 0 - 0x80041000, // 002B RET 1 R8 - 0x7002000A, // 002C JMP #0038 - 0x5422004A, // 002D LDINT R8 75 - 0x1C200E08, // 002E EQ R8 R7 R8 - 0x78220002, // 002F JMPF R8 #0033 - 0x50200200, // 0030 LDBOOL R8 1 0 - 0x80041000, // 0031 RET 1 R8 - 0x70020004, // 0032 JMP #0038 - 0x5422004B, // 0033 LDINT R8 76 - 0x1C200E08, // 0034 EQ R8 R7 R8 - 0x78220001, // 0035 JMPF R8 #0038 - 0x50200200, // 0036 LDBOOL R8 1 0 - 0x80041000, // 0037 RET 1 R8 - 0x70020008, // 0038 JMP #0042 - 0x60200003, // 0039 GETGBL R8 G3 - 0x5C240000, // 003A MOVE R9 R0 - 0x7C200200, // 003B CALL R8 1 - 0x8C20110F, // 003C GETMET R8 R8 K15 - 0x5C280200, // 003D MOVE R10 R1 - 0x5C2C0400, // 003E MOVE R11 R2 - 0x5C300600, // 003F MOVE R12 R3 - 0x7C200800, // 0040 CALL R8 4 - 0x80041000, // 0041 RET 1 R8 - 0x80000000, // 0042 RET 0 + 0x8C240108, // 0010 GETMET R9 R0 K8 + 0x5C2C1000, // 0011 MOVE R11 R8 + 0x7C240400, // 0012 CALL R9 2 + 0x60240008, // 0013 GETGBL R9 G8 + 0x5C281000, // 0014 MOVE R10 R8 + 0x7C240200, // 0015 CALL R9 1 + 0x00261409, // 0016 ADD R9 K10 R9 + 0x900E1209, // 0017 SETMBR R3 K9 R9 + 0x8C24010B, // 0018 GETMET R9 R0 K11 + 0x582C000C, // 0019 LDCONST R11 K12 + 0x5C301000, // 001A MOVE R12 R8 + 0x7C240600, // 001B CALL R9 3 + 0x50240200, // 001C LDBOOL R9 1 0 + 0x80041200, // 001D RET 1 R9 + 0x70020010, // 001E JMP #0030 + 0x54220046, // 001F LDINT R8 71 + 0x1C200E08, // 0020 EQ R8 R7 R8 + 0x78220002, // 0021 JMPF R8 #0025 + 0x50200200, // 0022 LDBOOL R8 1 0 + 0x80041000, // 0023 RET 1 R8 + 0x7002000A, // 0024 JMP #0030 + 0x5422004A, // 0025 LDINT R8 75 + 0x1C200E08, // 0026 EQ R8 R7 R8 + 0x78220002, // 0027 JMPF R8 #002B + 0x50200200, // 0028 LDBOOL R8 1 0 + 0x80041000, // 0029 RET 1 R8 + 0x70020004, // 002A JMP #0030 + 0x5422004B, // 002B LDINT R8 76 + 0x1C200E08, // 002C EQ R8 R7 R8 + 0x78220001, // 002D JMPF R8 #0030 + 0x50200200, // 002E LDBOOL R8 1 0 + 0x80041000, // 002F RET 1 R8 + 0x70020008, // 0030 JMP #003A + 0x60200003, // 0031 GETGBL R8 G3 + 0x5C240000, // 0032 MOVE R9 R0 + 0x7C200200, // 0033 CALL R8 1 + 0x8C20110D, // 0034 GETMET R8 R8 K13 + 0x5C280200, // 0035 MOVE R10 R1 + 0x5C2C0400, // 0036 MOVE R11 R2 + 0x5C300600, // 0037 MOVE R12 R3 + 0x7C200800, // 0038 CALL R8 4 + 0x80041000, // 0039 RET 1 R8 + 0x80000000, // 003A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: update_shadow +********************************************************************/ +be_local_closure(Matter_Plugin_Light2_update_shadow, /* 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[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(light), + /* K1 */ be_nested_str_weak(update_ct_minmax), + /* K2 */ be_nested_str_weak(update_shadow), + /* K3 */ be_nested_str_weak(get), + /* K4 */ be_nested_str_weak(find), + /* K5 */ be_nested_str_weak(ct), + /* K6 */ be_nested_str_weak(shadow_ct), + /* K7 */ be_nested_str_weak(attribute_updated), + }), + be_str_weak(update_shadow), + &be_const_str_solidified, + ( &(const binstruction[30]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080101, // 0001 GETMET R2 R0 K1 + 0x7C080200, // 0002 CALL R2 1 + 0x60080003, // 0003 GETGBL R2 G3 + 0x5C0C0000, // 0004 MOVE R3 R0 + 0x7C080200, // 0005 CALL R2 1 + 0x8C080502, // 0006 GETMET R2 R2 K2 + 0x7C080200, // 0007 CALL R2 1 + 0x8C080303, // 0008 GETMET R2 R1 K3 + 0x7C080200, // 0009 CALL R2 1 + 0x4C0C0000, // 000A LDNIL R3 + 0x200C0403, // 000B NE R3 R2 R3 + 0x780E000F, // 000C JMPF R3 #001D + 0x8C0C0504, // 000D GETMET R3 R2 K4 + 0x58140005, // 000E LDCONST R5 K5 + 0x4C180000, // 000F LDNIL R6 + 0x7C0C0600, // 0010 CALL R3 3 + 0x4C100000, // 0011 LDNIL R4 + 0x1C100604, // 0012 EQ R4 R3 R4 + 0x78120000, // 0013 JMPF R4 #0015 + 0x880C0106, // 0014 GETMBR R3 R0 K6 + 0x88100106, // 0015 GETMBR R4 R0 K6 + 0x20100604, // 0016 NE R4 R3 R4 + 0x78120004, // 0017 JMPF R4 #001D + 0x8C100107, // 0018 GETMET R4 R0 K7 + 0x541A02FF, // 0019 LDINT R6 768 + 0x541E0006, // 001A LDINT R7 7 + 0x7C100600, // 001B CALL R4 3 + 0x90020C03, // 001C SETMBR R0 K6 R3 + 0x80000000, // 001D RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: read_attribute +********************************************************************/ +be_local_closure(Matter_Plugin_Light2_read_attribute, /* name */ + be_nested_proto( + 12, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[14]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(cluster), + /* K3 */ be_nested_str_weak(attribute), + /* K4 */ be_nested_str_weak(update_shadow_lazy), + /* K5 */ be_nested_str_weak(set), + /* K6 */ be_nested_str_weak(U1), + /* K7 */ be_nested_str_weak(shadow_ct), + /* K8 */ be_const_int(2), + /* K9 */ be_const_int(0), + /* K10 */ be_nested_str_weak(ct_min), + /* K11 */ be_nested_str_weak(ct_max), + /* K12 */ be_nested_str_weak(U4), + /* K13 */ be_nested_str_weak(read_attribute), + }), + be_str_weak(read_attribute), + &be_const_str_solidified, + ( &(const binstruction[82]) { /* code */ + 0xB8120000, // 0000 GETNGBL R4 K0 + 0x88100901, // 0001 GETMBR R4 R4 K1 + 0x88140502, // 0002 GETMBR R5 R2 K2 + 0x88180503, // 0003 GETMBR R6 R2 K3 + 0x541E02FF, // 0004 LDINT R7 768 + 0x1C1C0A07, // 0005 EQ R7 R5 R7 + 0x781E0040, // 0006 JMPF R7 #0048 + 0x8C1C0104, // 0007 GETMET R7 R0 K4 + 0x7C1C0200, // 0008 CALL R7 1 + 0x541E0006, // 0009 LDINT R7 7 + 0x1C1C0C07, // 000A EQ R7 R6 R7 + 0x781E0005, // 000B JMPF R7 #0012 + 0x8C1C0705, // 000C GETMET R7 R3 K5 + 0x88240906, // 000D GETMBR R9 R4 K6 + 0x88280107, // 000E GETMBR R10 R0 K7 + 0x7C1C0600, // 000F CALL R7 3 + 0x80040E00, // 0010 RET 1 R7 + 0x70020034, // 0011 JMP #0047 + 0x541E0007, // 0012 LDINT R7 8 + 0x1C1C0C07, // 0013 EQ R7 R6 R7 + 0x781E0005, // 0014 JMPF R7 #001B + 0x8C1C0705, // 0015 GETMET R7 R3 K5 + 0x88240906, // 0016 GETMBR R9 R4 K6 + 0x58280008, // 0017 LDCONST R10 K8 + 0x7C1C0600, // 0018 CALL R7 3 + 0x80040E00, // 0019 RET 1 R7 + 0x7002002B, // 001A JMP #0047 + 0x541E000E, // 001B LDINT R7 15 + 0x1C1C0C07, // 001C EQ R7 R6 R7 + 0x781E0005, // 001D JMPF R7 #0024 + 0x8C1C0705, // 001E GETMET R7 R3 K5 + 0x88240906, // 001F GETMBR R9 R4 K6 + 0x58280009, // 0020 LDCONST R10 K9 + 0x7C1C0600, // 0021 CALL R7 3 + 0x80040E00, // 0022 RET 1 R7 + 0x70020022, // 0023 JMP #0047 + 0x541E400A, // 0024 LDINT R7 16395 + 0x1C1C0C07, // 0025 EQ R7 R6 R7 + 0x781E0005, // 0026 JMPF R7 #002D + 0x8C1C0705, // 0027 GETMET R7 R3 K5 + 0x88240906, // 0028 GETMBR R9 R4 K6 + 0x8828010A, // 0029 GETMBR R10 R0 K10 + 0x7C1C0600, // 002A CALL R7 3 + 0x80040E00, // 002B RET 1 R7 + 0x70020019, // 002C JMP #0047 + 0x541E400B, // 002D LDINT R7 16396 + 0x1C1C0C07, // 002E EQ R7 R6 R7 + 0x781E0005, // 002F JMPF R7 #0036 + 0x8C1C0705, // 0030 GETMET R7 R3 K5 + 0x88240906, // 0031 GETMBR R9 R4 K6 + 0x8828010B, // 0032 GETMBR R10 R0 K11 + 0x7C1C0600, // 0033 CALL R7 3 + 0x80040E00, // 0034 RET 1 R7 + 0x70020010, // 0035 JMP #0047 + 0x541EFFFB, // 0036 LDINT R7 65532 + 0x1C1C0C07, // 0037 EQ R7 R6 R7 + 0x781E0005, // 0038 JMPF R7 #003F + 0x8C1C0705, // 0039 GETMET R7 R3 K5 + 0x8824090C, // 003A GETMBR R9 R4 K12 + 0x542A000F, // 003B LDINT R10 16 + 0x7C1C0600, // 003C CALL R7 3 + 0x80040E00, // 003D RET 1 R7 + 0x70020007, // 003E JMP #0047 + 0x541EFFFC, // 003F LDINT R7 65533 + 0x1C1C0C07, // 0040 EQ R7 R6 R7 + 0x781E0004, // 0041 JMPF R7 #0047 + 0x8C1C0705, // 0042 GETMET R7 R3 K5 + 0x8824090C, // 0043 GETMBR R9 R4 K12 + 0x542A0004, // 0044 LDINT R10 5 + 0x7C1C0600, // 0045 CALL R7 3 + 0x80040E00, // 0046 RET 1 R7 + 0x70020008, // 0047 JMP #0051 + 0x601C0003, // 0048 GETGBL R7 G3 + 0x5C200000, // 0049 MOVE R8 R0 + 0x7C1C0200, // 004A CALL R7 1 + 0x8C1C0F0D, // 004B GETMET R7 R7 K13 + 0x5C240200, // 004C MOVE R9 R1 + 0x5C280400, // 004D MOVE R10 R2 + 0x5C2C0600, // 004E MOVE R11 R3 + 0x7C1C0800, // 004F CALL R7 4 + 0x80040E00, // 0050 RET 1 R7 + 0x80000000, // 0051 RET 0 }) ) ); @@ -385,22 +436,18 @@ extern const bclass be_class_Matter_Plugin_Light1; be_local_class(Matter_Plugin_Light2, 3, &be_class_Matter_Plugin_Light1, - be_nested_map(12, + be_nested_map(13, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_weak(ct_min, -1), be_const_var(1) }, - { be_const_key_weak(shadow_ct, 8), be_const_var(0) }, - { be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { - be_const_map( * be_nested_map(1, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_int(268, -1), be_const_int(2) }, - })) ) } )) }, - { be_const_key_weak(ct_max, 7), be_const_var(2) }, - { be_const_key_weak(TYPE, 0), be_nested_str_weak(light2) }, - { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Light2_read_attribute_closure) }, - { be_const_key_weak(NAME, 5), be_nested_str_weak(Light_X202_X20CT) }, - { be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Light2_init_closure) }, - { be_const_key_weak(update_shadow, 4), be_const_closure(Matter_Plugin_Light2_update_shadow_closure) }, - { be_const_key_weak(update_ct_minmax, -1), be_const_closure(Matter_Plugin_Light2_update_ct_minmax_closure) }, + { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Light2_invoke_request_closure) }, + { be_const_key_weak(TYPE, -1), be_nested_str_weak(light2) }, + { be_const_key_weak(set_ct, -1), be_const_closure(Matter_Plugin_Light2_set_ct_closure) }, + { be_const_key_weak(shadow_ct, -1), be_const_var(0) }, + { be_const_key_weak(update_ct_minmax, 8), be_const_closure(Matter_Plugin_Light2_update_ct_minmax_closure) }, + { be_const_key_weak(init, 4), be_const_closure(Matter_Plugin_Light2_init_closure) }, + { be_const_key_weak(update_shadow, -1), be_const_closure(Matter_Plugin_Light2_update_shadow_closure) }, + { be_const_key_weak(ct_max, 1), be_const_var(2) }, + { be_const_key_weak(NAME, -1), be_nested_str_weak(Light_X202_X20CT) }, { be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(1, ( (struct bmapnode*) &(const bmapnode[]) { @@ -416,7 +463,12 @@ be_local_class(Matter_Plugin_Light2, be_const_int(65533), })) ) } )) }, })) ) } )) }, - { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Light2_invoke_request_closure) }, + { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Light2_read_attribute_closure) }, + { be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + be_const_map( * be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_int(268, -1), be_const_int(2) }, + })) ) } )) }, })), be_str_weak(Matter_Plugin_Light2) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Light3.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Light3.h index 284eaf8e6f67..f1aa6a129d8f 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Light3.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Light3.h @@ -6,107 +6,6 @@ extern const bclass be_class_Matter_Plugin_Light3; -/******************************************************************** -** Solidified function: update_shadow -********************************************************************/ -be_local_closure(Matter_Plugin_Light3_update_shadow, /* 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[13]) { /* constants */ - /* K0 */ be_nested_str_weak(light), - /* K1 */ be_nested_str_weak(update_shadow), - /* K2 */ be_nested_str_weak(get), - /* K3 */ be_nested_str_weak(find), - /* K4 */ be_nested_str_weak(hue), - /* K5 */ be_nested_str_weak(sat), - /* K6 */ be_nested_str_weak(tasmota), - /* K7 */ be_nested_str_weak(scale_uint), - /* K8 */ be_const_int(0), - /* K9 */ be_nested_str_weak(shadow_hue), - /* K10 */ be_nested_str_weak(shadow_sat), - /* K11 */ be_nested_str_weak(attribute_updated), - /* K12 */ be_const_int(1), - }), - be_str_weak(update_shadow), - &be_const_str_solidified, - ( &(const binstruction[64]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x60080003, // 0001 GETGBL R2 G3 - 0x5C0C0000, // 0002 MOVE R3 R0 - 0x7C080200, // 0003 CALL R2 1 - 0x8C080501, // 0004 GETMET R2 R2 K1 - 0x7C080200, // 0005 CALL R2 1 - 0x8C080302, // 0006 GETMET R2 R1 K2 - 0x7C080200, // 0007 CALL R2 1 - 0x4C0C0000, // 0008 LDNIL R3 - 0x200C0403, // 0009 NE R3 R2 R3 - 0x780E0033, // 000A JMPF R3 #003F - 0x8C0C0503, // 000B GETMET R3 R2 K3 - 0x58140004, // 000C LDCONST R5 K4 - 0x4C180000, // 000D LDNIL R6 - 0x7C0C0600, // 000E CALL R3 3 - 0x8C100503, // 000F GETMET R4 R2 K3 - 0x58180005, // 0010 LDCONST R6 K5 - 0x4C1C0000, // 0011 LDNIL R7 - 0x7C100600, // 0012 CALL R4 3 - 0x4C140000, // 0013 LDNIL R5 - 0x20140605, // 0014 NE R5 R3 R5 - 0x78160009, // 0015 JMPF R5 #0020 - 0xB8160C00, // 0016 GETNGBL R5 K6 - 0x8C140B07, // 0017 GETMET R5 R5 K7 - 0x5C1C0600, // 0018 MOVE R7 R3 - 0x58200008, // 0019 LDCONST R8 K8 - 0x54260167, // 001A LDINT R9 360 - 0x58280008, // 001B LDCONST R10 K8 - 0x542E00FD, // 001C LDINT R11 254 - 0x7C140C00, // 001D CALL R5 6 - 0x5C0C0A00, // 001E MOVE R3 R5 - 0x70020000, // 001F JMP #0021 - 0x880C0109, // 0020 GETMBR R3 R0 K9 - 0x4C140000, // 0021 LDNIL R5 - 0x20140805, // 0022 NE R5 R4 R5 - 0x78160009, // 0023 JMPF R5 #002E - 0xB8160C00, // 0024 GETNGBL R5 K6 - 0x8C140B07, // 0025 GETMET R5 R5 K7 - 0x5C1C0800, // 0026 MOVE R7 R4 - 0x58200008, // 0027 LDCONST R8 K8 - 0x542600FE, // 0028 LDINT R9 255 - 0x58280008, // 0029 LDCONST R10 K8 - 0x542E00FD, // 002A LDINT R11 254 - 0x7C140C00, // 002B CALL R5 6 - 0x5C100A00, // 002C MOVE R4 R5 - 0x70020000, // 002D JMP #002F - 0x8810010A, // 002E GETMBR R4 R0 K10 - 0x88140109, // 002F GETMBR R5 R0 K9 - 0x20140605, // 0030 NE R5 R3 R5 - 0x78160004, // 0031 JMPF R5 #0037 - 0x8C14010B, // 0032 GETMET R5 R0 K11 - 0x541E02FF, // 0033 LDINT R7 768 - 0x58200008, // 0034 LDCONST R8 K8 - 0x7C140600, // 0035 CALL R5 3 - 0x90021203, // 0036 SETMBR R0 K9 R3 - 0x8814010A, // 0037 GETMBR R5 R0 K10 - 0x20140805, // 0038 NE R5 R4 R5 - 0x78160004, // 0039 JMPF R5 #003F - 0x8C14010B, // 003A GETMET R5 R0 K11 - 0x541E02FF, // 003B LDINT R7 768 - 0x5820000C, // 003C LDCONST R8 K12 - 0x7C140600, // 003D CALL R5 3 - 0x90021404, // 003E SETMBR R0 K10 R4 - 0x80000000, // 003F RET 0 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: read_attribute ********************************************************************/ @@ -251,6 +150,251 @@ be_local_closure(Matter_Plugin_Light3_read_attribute, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: set_hue_sat +********************************************************************/ +be_local_closure(Matter_Plugin_Light3_set_hue_sat, /* 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[13]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str_weak(virtual), + /* K2 */ be_nested_str_weak(tasmota), + /* K3 */ be_nested_str_weak(scale_uint), + /* K4 */ be_nested_str_weak(light), + /* K5 */ be_nested_str_weak(set), + /* K6 */ be_nested_str_weak(hue), + /* K7 */ be_nested_str_weak(sat), + /* K8 */ be_nested_str_weak(update_shadow), + /* K9 */ be_nested_str_weak(shadow_hue), + /* K10 */ be_nested_str_weak(attribute_updated), + /* K11 */ be_nested_str_weak(shadow_sat), + /* K12 */ be_const_int(1), + }), + be_str_weak(set_hue_sat), + &be_const_str_solidified, + ( &(const binstruction[104]) { /* code */ + 0x4C0C0000, // 0000 LDNIL R3 + 0x200C0203, // 0001 NE R3 R1 R3 + 0x780E0006, // 0002 JMPF R3 #000A + 0x140C0300, // 0003 LT R3 R1 K0 + 0x780E0000, // 0004 JMPF R3 #0006 + 0x58040000, // 0005 LDCONST R1 K0 + 0x540E00FD, // 0006 LDINT R3 254 + 0x240C0203, // 0007 GT R3 R1 R3 + 0x780E0000, // 0008 JMPF R3 #000A + 0x540600FD, // 0009 LDINT R1 254 + 0x4C0C0000, // 000A LDNIL R3 + 0x200C0403, // 000B NE R3 R2 R3 + 0x780E0006, // 000C JMPF R3 #0014 + 0x140C0500, // 000D LT R3 R2 K0 + 0x780E0000, // 000E JMPF R3 #0010 + 0x58080000, // 000F LDCONST R2 K0 + 0x540E00FD, // 0010 LDINT R3 254 + 0x240C0403, // 0011 GT R3 R2 R3 + 0x780E0000, // 0012 JMPF R3 #0014 + 0x540A00FD, // 0013 LDINT R2 254 + 0x880C0101, // 0014 GETMBR R3 R0 K1 + 0x740E003A, // 0015 JMPT R3 #0051 + 0x4C0C0000, // 0016 LDNIL R3 + 0x200C0203, // 0017 NE R3 R1 R3 + 0x780E0008, // 0018 JMPF R3 #0022 + 0xB80E0400, // 0019 GETNGBL R3 K2 + 0x8C0C0703, // 001A GETMET R3 R3 K3 + 0x5C140200, // 001B MOVE R5 R1 + 0x58180000, // 001C LDCONST R6 K0 + 0x541E00FD, // 001D LDINT R7 254 + 0x58200000, // 001E LDCONST R8 K0 + 0x54260167, // 001F LDINT R9 360 + 0x7C0C0C00, // 0020 CALL R3 6 + 0x70020000, // 0021 JMP #0023 + 0x4C0C0000, // 0022 LDNIL R3 + 0x4C100000, // 0023 LDNIL R4 + 0x20100404, // 0024 NE R4 R2 R4 + 0x78120008, // 0025 JMPF R4 #002F + 0xB8120400, // 0026 GETNGBL R4 K2 + 0x8C100903, // 0027 GETMET R4 R4 K3 + 0x5C180400, // 0028 MOVE R6 R2 + 0x581C0000, // 0029 LDCONST R7 K0 + 0x542200FD, // 002A LDINT R8 254 + 0x58240000, // 002B LDCONST R9 K0 + 0x542A00FE, // 002C LDINT R10 255 + 0x7C100C00, // 002D CALL R4 6 + 0x70020000, // 002E JMP #0030 + 0x4C100000, // 002F LDNIL R4 + 0x4C140000, // 0030 LDNIL R5 + 0x20140605, // 0031 NE R5 R3 R5 + 0x7816000A, // 0032 JMPF R5 #003E + 0x4C140000, // 0033 LDNIL R5 + 0x20140805, // 0034 NE R5 R4 R5 + 0x78160007, // 0035 JMPF R5 #003E + 0xB8160800, // 0036 GETNGBL R5 K4 + 0x8C140B05, // 0037 GETMET R5 R5 K5 + 0x601C0013, // 0038 GETGBL R7 G19 + 0x7C1C0000, // 0039 CALL R7 0 + 0x981E0C03, // 003A SETIDX R7 K6 R3 + 0x981E0E04, // 003B SETIDX R7 K7 R4 + 0x7C140400, // 003C CALL R5 2 + 0x7002000F, // 003D JMP #004E + 0x4C140000, // 003E LDNIL R5 + 0x20140605, // 003F NE R5 R3 R5 + 0x78160006, // 0040 JMPF R5 #0048 + 0xB8160800, // 0041 GETNGBL R5 K4 + 0x8C140B05, // 0042 GETMET R5 R5 K5 + 0x601C0013, // 0043 GETGBL R7 G19 + 0x7C1C0000, // 0044 CALL R7 0 + 0x981E0C03, // 0045 SETIDX R7 K6 R3 + 0x7C140400, // 0046 CALL R5 2 + 0x70020005, // 0047 JMP #004E + 0xB8160800, // 0048 GETNGBL R5 K4 + 0x8C140B05, // 0049 GETMET R5 R5 K5 + 0x601C0013, // 004A GETGBL R7 G19 + 0x7C1C0000, // 004B CALL R7 0 + 0x981E0E04, // 004C SETIDX R7 K7 R4 + 0x7C140400, // 004D CALL R5 2 + 0x8C140108, // 004E GETMET R5 R0 K8 + 0x7C140200, // 004F CALL R5 1 + 0x70020015, // 0050 JMP #0067 + 0x4C0C0000, // 0051 LDNIL R3 + 0x200C0203, // 0052 NE R3 R1 R3 + 0x780E0007, // 0053 JMPF R3 #005C + 0x880C0109, // 0054 GETMBR R3 R0 K9 + 0x200C0203, // 0055 NE R3 R1 R3 + 0x780E0004, // 0056 JMPF R3 #005C + 0x8C0C010A, // 0057 GETMET R3 R0 K10 + 0x541602FF, // 0058 LDINT R5 768 + 0x58180000, // 0059 LDCONST R6 K0 + 0x7C0C0600, // 005A CALL R3 3 + 0x90021201, // 005B SETMBR R0 K9 R1 + 0x4C0C0000, // 005C LDNIL R3 + 0x200C0403, // 005D NE R3 R2 R3 + 0x780E0007, // 005E JMPF R3 #0067 + 0x880C010B, // 005F GETMBR R3 R0 K11 + 0x200C0403, // 0060 NE R3 R2 R3 + 0x780E0004, // 0061 JMPF R3 #0067 + 0x8C0C010A, // 0062 GETMET R3 R0 K10 + 0x541602FF, // 0063 LDINT R5 768 + 0x5818000C, // 0064 LDCONST R6 K12 + 0x7C0C0600, // 0065 CALL R3 3 + 0x90021602, // 0066 SETMBR R0 K11 R2 + 0x80000000, // 0067 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: update_shadow +********************************************************************/ +be_local_closure(Matter_Plugin_Light3_update_shadow, /* 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[14]) { /* constants */ + /* K0 */ be_nested_str_weak(update_shadow), + /* K1 */ be_nested_str_weak(virtual), + /* K2 */ be_nested_str_weak(light), + /* K3 */ be_nested_str_weak(get), + /* K4 */ be_nested_str_weak(find), + /* K5 */ be_nested_str_weak(hue), + /* K6 */ be_nested_str_weak(sat), + /* K7 */ be_nested_str_weak(tasmota), + /* K8 */ be_nested_str_weak(scale_uint), + /* K9 */ be_const_int(0), + /* K10 */ be_nested_str_weak(shadow_hue), + /* K11 */ be_nested_str_weak(shadow_sat), + /* K12 */ be_nested_str_weak(attribute_updated), + /* K13 */ be_const_int(1), + }), + be_str_weak(update_shadow), + &be_const_str_solidified, + ( &(const binstruction[66]) { /* code */ + 0x60040003, // 0000 GETGBL R1 G3 + 0x5C080000, // 0001 MOVE R2 R0 + 0x7C040200, // 0002 CALL R1 1 + 0x8C040300, // 0003 GETMET R1 R1 K0 + 0x7C040200, // 0004 CALL R1 1 + 0x88040101, // 0005 GETMBR R1 R0 K1 + 0x74060039, // 0006 JMPT R1 #0041 + 0xA4060400, // 0007 IMPORT R1 K2 + 0x8C080303, // 0008 GETMET R2 R1 K3 + 0x7C080200, // 0009 CALL R2 1 + 0x4C0C0000, // 000A LDNIL R3 + 0x200C0403, // 000B NE R3 R2 R3 + 0x780E0033, // 000C JMPF R3 #0041 + 0x8C0C0504, // 000D GETMET R3 R2 K4 + 0x58140005, // 000E LDCONST R5 K5 + 0x4C180000, // 000F LDNIL R6 + 0x7C0C0600, // 0010 CALL R3 3 + 0x8C100504, // 0011 GETMET R4 R2 K4 + 0x58180006, // 0012 LDCONST R6 K6 + 0x4C1C0000, // 0013 LDNIL R7 + 0x7C100600, // 0014 CALL R4 3 + 0x4C140000, // 0015 LDNIL R5 + 0x20140605, // 0016 NE R5 R3 R5 + 0x78160009, // 0017 JMPF R5 #0022 + 0xB8160E00, // 0018 GETNGBL R5 K7 + 0x8C140B08, // 0019 GETMET R5 R5 K8 + 0x5C1C0600, // 001A MOVE R7 R3 + 0x58200009, // 001B LDCONST R8 K9 + 0x54260167, // 001C LDINT R9 360 + 0x58280009, // 001D LDCONST R10 K9 + 0x542E00FD, // 001E LDINT R11 254 + 0x7C140C00, // 001F CALL R5 6 + 0x5C0C0A00, // 0020 MOVE R3 R5 + 0x70020000, // 0021 JMP #0023 + 0x880C010A, // 0022 GETMBR R3 R0 K10 + 0x4C140000, // 0023 LDNIL R5 + 0x20140805, // 0024 NE R5 R4 R5 + 0x78160009, // 0025 JMPF R5 #0030 + 0xB8160E00, // 0026 GETNGBL R5 K7 + 0x8C140B08, // 0027 GETMET R5 R5 K8 + 0x5C1C0800, // 0028 MOVE R7 R4 + 0x58200009, // 0029 LDCONST R8 K9 + 0x542600FE, // 002A LDINT R9 255 + 0x58280009, // 002B LDCONST R10 K9 + 0x542E00FD, // 002C LDINT R11 254 + 0x7C140C00, // 002D CALL R5 6 + 0x5C100A00, // 002E MOVE R4 R5 + 0x70020000, // 002F JMP #0031 + 0x8810010B, // 0030 GETMBR R4 R0 K11 + 0x8814010A, // 0031 GETMBR R5 R0 K10 + 0x20140605, // 0032 NE R5 R3 R5 + 0x78160004, // 0033 JMPF R5 #0039 + 0x8C14010C, // 0034 GETMET R5 R0 K12 + 0x541E02FF, // 0035 LDINT R7 768 + 0x58200009, // 0036 LDCONST R8 K9 + 0x7C140600, // 0037 CALL R5 3 + 0x90021403, // 0038 SETMBR R0 K10 R3 + 0x8814010B, // 0039 GETMBR R5 R0 K11 + 0x20140805, // 003A NE R5 R4 R5 + 0x78160004, // 003B JMPF R5 #0041 + 0x8C14010C, // 003C GETMET R5 R0 K12 + 0x541E02FF, // 003D LDINT R7 768 + 0x5820000D, // 003E LDCONST R8 K13 + 0x7C140600, // 003F CALL R5 3 + 0x90021604, // 0040 SETMBR R0 K11 R4 + 0x80000000, // 0041 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: init ********************************************************************/ @@ -295,7 +439,7 @@ be_local_closure(Matter_Plugin_Light3_init, /* name */ ********************************************************************/ be_local_closure(Matter_Plugin_Light3_invoke_request, /* name */ be_nested_proto( - 18, /* nstack */ + 16, /* nstack */ 4, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -303,7 +447,7 @@ be_local_closure(Matter_Plugin_Light3_invoke_request, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[22]) { /* constants */ + ( &(const bvalue[20]) { /* constants */ /* K0 */ be_nested_str_weak(light), /* K1 */ be_nested_str_weak(matter), /* K2 */ be_nested_str_weak(TLV), @@ -312,24 +456,22 @@ be_local_closure(Matter_Plugin_Light3_invoke_request, /* name */ /* K5 */ be_nested_str_weak(update_shadow_lazy), /* K6 */ be_const_int(0), /* K7 */ be_nested_str_weak(findsubval), - /* K8 */ be_nested_str_weak(tasmota), - /* K9 */ be_nested_str_weak(scale_uint), - /* K10 */ be_nested_str_weak(set), - /* K11 */ be_nested_str_weak(hue), - /* K12 */ be_nested_str_weak(update_shadow), - /* K13 */ be_nested_str_weak(log), - /* K14 */ be_nested_str_weak(hue_X3A), - /* K15 */ be_const_int(1), - /* K16 */ be_const_int(2), - /* K17 */ be_const_int(3), - /* K18 */ be_nested_str_weak(sat), - /* K19 */ be_nested_str_weak(sat_X3A), - /* K20 */ be_nested_str_weak(_X20sat_X3A), - /* K21 */ be_nested_str_weak(invoke_request), + /* K8 */ be_nested_str_weak(set_hue_sat), + /* K9 */ be_nested_str_weak(log), + /* K10 */ be_nested_str_weak(hue_X3A), + /* K11 */ be_nested_str_weak(publish_command), + /* K12 */ be_nested_str_weak(Hue), + /* K13 */ be_const_int(1), + /* K14 */ be_const_int(2), + /* K15 */ be_const_int(3), + /* K16 */ be_nested_str_weak(sat_X3A), + /* K17 */ be_nested_str_weak(Sat), + /* K18 */ be_nested_str_weak(_X20sat_X3A), + /* K19 */ be_nested_str_weak(invoke_request), }), be_str_weak(invoke_request), &be_const_str_solidified, - ( &(const binstruction[150]) { /* code */ + ( &(const binstruction[122]) { /* code */ 0xA4120000, // 0000 IMPORT R4 K0 0xB8160200, // 0001 GETNGBL R5 K1 0x88140B02, // 0002 GETMBR R5 R5 K2 @@ -337,149 +479,121 @@ be_local_closure(Matter_Plugin_Light3_invoke_request, /* name */ 0x881C0704, // 0004 GETMBR R7 R3 K4 0x542202FF, // 0005 LDINT R8 768 0x1C200C08, // 0006 EQ R8 R6 R8 - 0x78220083, // 0007 JMPF R8 #008C + 0x78220067, // 0007 JMPF R8 #0070 0x8C200105, // 0008 GETMET R8 R0 K5 0x7C200200, // 0009 CALL R8 1 0x1C200F06, // 000A EQ R8 R7 K6 - 0x78220019, // 000B JMPF R8 #0026 + 0x78220012, // 000B JMPF R8 #001F 0x8C200507, // 000C GETMET R8 R2 K7 0x58280006, // 000D LDCONST R10 K6 0x7C200400, // 000E CALL R8 2 - 0xB8261000, // 000F GETNGBL R9 K8 - 0x8C241309, // 0010 GETMET R9 R9 K9 - 0x5C2C1000, // 0011 MOVE R11 R8 - 0x58300006, // 0012 LDCONST R12 K6 - 0x543600FD, // 0013 LDINT R13 254 - 0x58380006, // 0014 LDCONST R14 K6 - 0x543E0167, // 0015 LDINT R15 360 - 0x7C240C00, // 0016 CALL R9 6 - 0x8C28090A, // 0017 GETMET R10 R4 K10 - 0x60300013, // 0018 GETGBL R12 G19 - 0x7C300000, // 0019 CALL R12 0 - 0x98321609, // 001A SETIDX R12 K11 R9 - 0x7C280400, // 001B CALL R10 2 - 0x8C28010C, // 001C GETMET R10 R0 K12 - 0x7C280200, // 001D CALL R10 1 - 0x60280008, // 001E GETGBL R10 G8 - 0x5C2C1000, // 001F MOVE R11 R8 - 0x7C280200, // 0020 CALL R10 1 - 0x002A1C0A, // 0021 ADD R10 K14 R10 - 0x900E1A0A, // 0022 SETMBR R3 K13 R10 - 0x50280200, // 0023 LDBOOL R10 1 0 - 0x80041400, // 0024 RET 1 R10 - 0x70020064, // 0025 JMP #008B - 0x1C200F0F, // 0026 EQ R8 R7 K15 - 0x78220002, // 0027 JMPF R8 #002B - 0x50200200, // 0028 LDBOOL R8 1 0 - 0x80041000, // 0029 RET 1 R8 - 0x7002005F, // 002A JMP #008B - 0x1C200F10, // 002B EQ R8 R7 K16 - 0x78220002, // 002C JMPF R8 #0030 - 0x50200200, // 002D LDBOOL R8 1 0 - 0x80041000, // 002E RET 1 R8 - 0x7002005A, // 002F JMP #008B - 0x1C200F11, // 0030 EQ R8 R7 K17 - 0x78220019, // 0031 JMPF R8 #004C - 0x8C200507, // 0032 GETMET R8 R2 K7 - 0x58280006, // 0033 LDCONST R10 K6 - 0x7C200400, // 0034 CALL R8 2 - 0xB8261000, // 0035 GETNGBL R9 K8 - 0x8C241309, // 0036 GETMET R9 R9 K9 - 0x5C2C1000, // 0037 MOVE R11 R8 - 0x58300006, // 0038 LDCONST R12 K6 - 0x543600FD, // 0039 LDINT R13 254 - 0x58380006, // 003A LDCONST R14 K6 - 0x543E00FE, // 003B LDINT R15 255 - 0x7C240C00, // 003C CALL R9 6 - 0x8C28090A, // 003D GETMET R10 R4 K10 - 0x60300013, // 003E GETGBL R12 G19 - 0x7C300000, // 003F CALL R12 0 - 0x98322409, // 0040 SETIDX R12 K18 R9 - 0x7C280400, // 0041 CALL R10 2 - 0x8C28010C, // 0042 GETMET R10 R0 K12 - 0x7C280200, // 0043 CALL R10 1 - 0x60280008, // 0044 GETGBL R10 G8 - 0x5C2C1000, // 0045 MOVE R11 R8 - 0x7C280200, // 0046 CALL R10 1 - 0x002A260A, // 0047 ADD R10 K19 R10 - 0x900E1A0A, // 0048 SETMBR R3 K13 R10 - 0x50280200, // 0049 LDBOOL R10 1 0 - 0x80041400, // 004A RET 1 R10 - 0x7002003E, // 004B JMP #008B - 0x54220003, // 004C LDINT R8 4 - 0x1C200E08, // 004D EQ R8 R7 R8 - 0x78220002, // 004E JMPF R8 #0052 - 0x50200200, // 004F LDBOOL R8 1 0 - 0x80041000, // 0050 RET 1 R8 - 0x70020038, // 0051 JMP #008B - 0x54220004, // 0052 LDINT R8 5 - 0x1C200E08, // 0053 EQ R8 R7 R8 - 0x78220002, // 0054 JMPF R8 #0058 - 0x50200200, // 0055 LDBOOL R8 1 0 - 0x80041000, // 0056 RET 1 R8 - 0x70020032, // 0057 JMP #008B - 0x54220005, // 0058 LDINT R8 6 - 0x1C200E08, // 0059 EQ R8 R7 R8 - 0x7822002A, // 005A JMPF R8 #0086 - 0x8C200507, // 005B GETMET R8 R2 K7 - 0x58280006, // 005C LDCONST R10 K6 - 0x7C200400, // 005D CALL R8 2 - 0xB8261000, // 005E GETNGBL R9 K8 - 0x8C241309, // 005F GETMET R9 R9 K9 - 0x5C2C1000, // 0060 MOVE R11 R8 - 0x58300006, // 0061 LDCONST R12 K6 - 0x543600FD, // 0062 LDINT R13 254 - 0x58380006, // 0063 LDCONST R14 K6 - 0x543E0167, // 0064 LDINT R15 360 - 0x7C240C00, // 0065 CALL R9 6 - 0x8C280507, // 0066 GETMET R10 R2 K7 - 0x5830000F, // 0067 LDCONST R12 K15 - 0x7C280400, // 0068 CALL R10 2 - 0xB82E1000, // 0069 GETNGBL R11 K8 - 0x8C2C1709, // 006A GETMET R11 R11 K9 - 0x5C341400, // 006B MOVE R13 R10 - 0x58380006, // 006C LDCONST R14 K6 - 0x543E00FD, // 006D LDINT R15 254 - 0x58400006, // 006E LDCONST R16 K6 - 0x544600FE, // 006F LDINT R17 255 - 0x7C2C0C00, // 0070 CALL R11 6 - 0x8C30090A, // 0071 GETMET R12 R4 K10 - 0x60380013, // 0072 GETGBL R14 G19 - 0x7C380000, // 0073 CALL R14 0 - 0x983A1609, // 0074 SETIDX R14 K11 R9 - 0x983A240B, // 0075 SETIDX R14 K18 R11 - 0x7C300400, // 0076 CALL R12 2 - 0x8C30010C, // 0077 GETMET R12 R0 K12 - 0x7C300200, // 0078 CALL R12 1 - 0x60300008, // 0079 GETGBL R12 G8 - 0x5C341000, // 007A MOVE R13 R8 - 0x7C300200, // 007B CALL R12 1 - 0x00321C0C, // 007C ADD R12 K14 R12 - 0x00301914, // 007D ADD R12 R12 K20 - 0x60340008, // 007E GETGBL R13 G8 - 0x5C381400, // 007F MOVE R14 R10 - 0x7C340200, // 0080 CALL R13 1 - 0x0030180D, // 0081 ADD R12 R12 R13 - 0x900E1A0C, // 0082 SETMBR R3 K13 R12 - 0x50300200, // 0083 LDBOOL R12 1 0 - 0x80041800, // 0084 RET 1 R12 - 0x70020004, // 0085 JMP #008B - 0x54220046, // 0086 LDINT R8 71 - 0x1C200E08, // 0087 EQ R8 R7 R8 - 0x78220001, // 0088 JMPF R8 #008B - 0x50200200, // 0089 LDBOOL R8 1 0 - 0x80041000, // 008A RET 1 R8 - 0x70020008, // 008B JMP #0095 - 0x60200003, // 008C GETGBL R8 G3 - 0x5C240000, // 008D MOVE R9 R0 - 0x7C200200, // 008E CALL R8 1 - 0x8C201115, // 008F GETMET R8 R8 K21 - 0x5C280200, // 0090 MOVE R10 R1 - 0x5C2C0400, // 0091 MOVE R11 R2 - 0x5C300600, // 0092 MOVE R12 R3 - 0x7C200800, // 0093 CALL R8 4 - 0x80041000, // 0094 RET 1 R8 - 0x80000000, // 0095 RET 0 + 0x8C240108, // 000F GETMET R9 R0 K8 + 0x5C2C1000, // 0010 MOVE R11 R8 + 0x4C300000, // 0011 LDNIL R12 + 0x7C240600, // 0012 CALL R9 3 + 0x60240008, // 0013 GETGBL R9 G8 + 0x5C281000, // 0014 MOVE R10 R8 + 0x7C240200, // 0015 CALL R9 1 + 0x00261409, // 0016 ADD R9 K10 R9 + 0x900E1209, // 0017 SETMBR R3 K9 R9 + 0x8C24010B, // 0018 GETMET R9 R0 K11 + 0x582C000C, // 0019 LDCONST R11 K12 + 0x5C301000, // 001A MOVE R12 R8 + 0x7C240600, // 001B CALL R9 3 + 0x50240200, // 001C LDBOOL R9 1 0 + 0x80041200, // 001D RET 1 R9 + 0x7002004F, // 001E JMP #006F + 0x1C200F0D, // 001F EQ R8 R7 K13 + 0x78220002, // 0020 JMPF R8 #0024 + 0x50200200, // 0021 LDBOOL R8 1 0 + 0x80041000, // 0022 RET 1 R8 + 0x7002004A, // 0023 JMP #006F + 0x1C200F0E, // 0024 EQ R8 R7 K14 + 0x78220002, // 0025 JMPF R8 #0029 + 0x50200200, // 0026 LDBOOL R8 1 0 + 0x80041000, // 0027 RET 1 R8 + 0x70020045, // 0028 JMP #006F + 0x1C200F0F, // 0029 EQ R8 R7 K15 + 0x78220012, // 002A JMPF R8 #003E + 0x8C200507, // 002B GETMET R8 R2 K7 + 0x58280006, // 002C LDCONST R10 K6 + 0x7C200400, // 002D CALL R8 2 + 0x8C240108, // 002E GETMET R9 R0 K8 + 0x4C2C0000, // 002F LDNIL R11 + 0x5C301000, // 0030 MOVE R12 R8 + 0x7C240600, // 0031 CALL R9 3 + 0x60240008, // 0032 GETGBL R9 G8 + 0x5C281000, // 0033 MOVE R10 R8 + 0x7C240200, // 0034 CALL R9 1 + 0x00262009, // 0035 ADD R9 K16 R9 + 0x900E1209, // 0036 SETMBR R3 K9 R9 + 0x8C24010B, // 0037 GETMET R9 R0 K11 + 0x582C0011, // 0038 LDCONST R11 K17 + 0x5C301000, // 0039 MOVE R12 R8 + 0x7C240600, // 003A CALL R9 3 + 0x50240200, // 003B LDBOOL R9 1 0 + 0x80041200, // 003C RET 1 R9 + 0x70020030, // 003D JMP #006F + 0x54220003, // 003E LDINT R8 4 + 0x1C200E08, // 003F EQ R8 R7 R8 + 0x78220002, // 0040 JMPF R8 #0044 + 0x50200200, // 0041 LDBOOL R8 1 0 + 0x80041000, // 0042 RET 1 R8 + 0x7002002A, // 0043 JMP #006F + 0x54220004, // 0044 LDINT R8 5 + 0x1C200E08, // 0045 EQ R8 R7 R8 + 0x78220002, // 0046 JMPF R8 #004A + 0x50200200, // 0047 LDBOOL R8 1 0 + 0x80041000, // 0048 RET 1 R8 + 0x70020024, // 0049 JMP #006F + 0x54220005, // 004A LDINT R8 6 + 0x1C200E08, // 004B EQ R8 R7 R8 + 0x7822001C, // 004C JMPF R8 #006A + 0x8C200507, // 004D GETMET R8 R2 K7 + 0x58280006, // 004E LDCONST R10 K6 + 0x7C200400, // 004F CALL R8 2 + 0x8C240507, // 0050 GETMET R9 R2 K7 + 0x582C000D, // 0051 LDCONST R11 K13 + 0x7C240400, // 0052 CALL R9 2 + 0x8C280108, // 0053 GETMET R10 R0 K8 + 0x5C301000, // 0054 MOVE R12 R8 + 0x5C341200, // 0055 MOVE R13 R9 + 0x7C280600, // 0056 CALL R10 3 + 0x60280008, // 0057 GETGBL R10 G8 + 0x5C2C1000, // 0058 MOVE R11 R8 + 0x7C280200, // 0059 CALL R10 1 + 0x002A140A, // 005A ADD R10 K10 R10 + 0x00281512, // 005B ADD R10 R10 K18 + 0x602C0008, // 005C GETGBL R11 G8 + 0x5C301200, // 005D MOVE R12 R9 + 0x7C2C0200, // 005E CALL R11 1 + 0x0028140B, // 005F ADD R10 R10 R11 + 0x900E120A, // 0060 SETMBR R3 K9 R10 + 0x8C28010B, // 0061 GETMET R10 R0 K11 + 0x5830000C, // 0062 LDCONST R12 K12 + 0x5C341000, // 0063 MOVE R13 R8 + 0x58380011, // 0064 LDCONST R14 K17 + 0x5C3C1200, // 0065 MOVE R15 R9 + 0x7C280A00, // 0066 CALL R10 5 + 0x50280200, // 0067 LDBOOL R10 1 0 + 0x80041400, // 0068 RET 1 R10 + 0x70020004, // 0069 JMP #006F + 0x54220046, // 006A LDINT R8 71 + 0x1C200E08, // 006B EQ R8 R7 R8 + 0x78220001, // 006C JMPF R8 #006F + 0x50200200, // 006D LDBOOL R8 1 0 + 0x80041000, // 006E RET 1 R8 + 0x70020008, // 006F JMP #0079 + 0x60200003, // 0070 GETGBL R8 G3 + 0x5C240000, // 0071 MOVE R9 R0 + 0x7C200200, // 0072 CALL R8 1 + 0x8C201113, // 0073 GETMET R8 R8 K19 + 0x5C280200, // 0074 MOVE R10 R1 + 0x5C2C0400, // 0075 MOVE R11 R2 + 0x5C300600, // 0076 MOVE R12 R3 + 0x7C200800, // 0077 CALL R8 4 + 0x80041000, // 0078 RET 1 R8 + 0x80000000, // 0079 RET 0 }) ) ); @@ -493,16 +607,19 @@ extern const bclass be_class_Matter_Plugin_Light1; be_local_class(Matter_Plugin_Light3, 2, &be_class_Matter_Plugin_Light1, - be_nested_map(10, + be_nested_map(11, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + { be_const_key_weak(TYPE, -1), be_nested_str_weak(light3) }, + { be_const_key_weak(shadow_sat, -1), be_const_var(1) }, + { be_const_key_weak(set_hue_sat, 0), be_const_closure(Matter_Plugin_Light3_set_hue_sat_closure) }, + { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Light3_read_attribute_closure) }, + { be_const_key_weak(TYPES, 5), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(1, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(269, -1), be_const_int(2) }, })) ) } )) }, - { be_const_key_weak(TYPE, -1), be_nested_str_weak(light3) }, - { be_const_key_weak(shadow_hue, 8), be_const_var(0) }, - { be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + { be_const_key_weak(shadow_hue, 2), be_const_var(0) }, + { be_const_key_weak(CLUSTERS, 7), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(1, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(768, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { @@ -519,12 +636,10 @@ be_local_class(Matter_Plugin_Light3, be_const_int(65533), })) ) } )) }, })) ) } )) }, - { be_const_key_weak(NAME, 3), be_nested_str_weak(Light_X203_X20RGB) }, + { be_const_key_weak(update_shadow, 8), be_const_closure(Matter_Plugin_Light3_update_shadow_closure) }, + { be_const_key_weak(NAME, -1), be_nested_str_weak(Light_X203_X20RGB) }, { be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Light3_init_closure) }, - { be_const_key_weak(shadow_sat, -1), be_const_var(1) }, { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Light3_invoke_request_closure) }, - { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Light3_read_attribute_closure) }, - { be_const_key_weak(update_shadow, 1), be_const_closure(Matter_Plugin_Light3_update_shadow_closure) }, })), be_str_weak(Matter_Plugin_Light3) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_OnOff.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_OnOff.h index bf855e11951b..a6b534e483f7 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_OnOff.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_OnOff.h @@ -270,7 +270,7 @@ be_local_closure(Matter_Plugin_OnOff_read_attribute, /* name */ ********************************************************************/ be_local_closure(Matter_Plugin_OnOff_invoke_request, /* name */ be_nested_proto( - 10, /* nstack */ + 11, /* nstack */ 4, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -278,7 +278,7 @@ be_local_closure(Matter_Plugin_OnOff_invoke_request, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[11]) { /* constants */ + ( &(const bvalue[13]) { /* constants */ /* K0 */ be_nested_str_weak(matter), /* K1 */ be_nested_str_weak(TLV), /* K2 */ be_nested_str_weak(cluster), @@ -287,55 +287,73 @@ be_local_closure(Matter_Plugin_OnOff_invoke_request, /* name */ /* K5 */ be_const_int(0), /* K6 */ be_nested_str_weak(set_onoff), /* K7 */ be_nested_str_weak(update_shadow), - /* K8 */ be_const_int(1), - /* K9 */ be_const_int(2), - /* K10 */ be_nested_str_weak(shadow_onoff), + /* K8 */ be_nested_str_weak(publish_command), + /* K9 */ be_nested_str_weak(Power), + /* K10 */ be_const_int(1), + /* K11 */ be_const_int(2), + /* K12 */ be_nested_str_weak(shadow_onoff), }), be_str_weak(invoke_request), &be_const_str_solidified, - ( &(const binstruction[42]) { /* code */ + ( &(const binstruction[58]) { /* code */ 0xB8120000, // 0000 GETNGBL R4 K0 0x88100901, // 0001 GETMBR R4 R4 K1 0x88140702, // 0002 GETMBR R5 R3 K2 0x88180703, // 0003 GETMBR R6 R3 K3 0x541E0005, // 0004 LDINT R7 6 0x1C1C0A07, // 0005 EQ R7 R5 R7 - 0x781E0021, // 0006 JMPF R7 #0029 + 0x781E0031, // 0006 JMPF R7 #0039 0x8C1C0104, // 0007 GETMET R7 R0 K4 0x7C1C0200, // 0008 CALL R7 1 0x1C1C0D05, // 0009 EQ R7 R6 K5 - 0x781E0007, // 000A JMPF R7 #0013 + 0x781E000B, // 000A JMPF R7 #0017 0x8C1C0106, // 000B GETMET R7 R0 K6 0x50240000, // 000C LDBOOL R9 0 0 0x7C1C0400, // 000D CALL R7 2 0x8C1C0107, // 000E GETMET R7 R0 K7 0x7C1C0200, // 000F CALL R7 1 - 0x501C0200, // 0010 LDBOOL R7 1 0 - 0x80040E00, // 0011 RET 1 R7 - 0x70020015, // 0012 JMP #0029 - 0x1C1C0D08, // 0013 EQ R7 R6 K8 - 0x781E0007, // 0014 JMPF R7 #001D - 0x8C1C0106, // 0015 GETMET R7 R0 K6 - 0x50240200, // 0016 LDBOOL R9 1 0 - 0x7C1C0400, // 0017 CALL R7 2 - 0x8C1C0107, // 0018 GETMET R7 R0 K7 - 0x7C1C0200, // 0019 CALL R7 1 - 0x501C0200, // 001A LDBOOL R7 1 0 - 0x80040E00, // 001B RET 1 R7 - 0x7002000B, // 001C JMP #0029 - 0x1C1C0D09, // 001D EQ R7 R6 K9 - 0x781E0009, // 001E JMPF R7 #0029 - 0x8C1C0106, // 001F GETMET R7 R0 K6 - 0x8824010A, // 0020 GETMBR R9 R0 K10 - 0x78260000, // 0021 JMPF R9 #0023 - 0x50240001, // 0022 LDBOOL R9 0 1 - 0x50240200, // 0023 LDBOOL R9 1 0 - 0x7C1C0400, // 0024 CALL R7 2 - 0x8C1C0107, // 0025 GETMET R7 R0 K7 - 0x7C1C0200, // 0026 CALL R7 1 - 0x501C0200, // 0027 LDBOOL R7 1 0 - 0x80040E00, // 0028 RET 1 R7 - 0x80000000, // 0029 RET 0 + 0x8C1C0108, // 0010 GETMET R7 R0 K8 + 0x58240009, // 0011 LDCONST R9 K9 + 0x58280005, // 0012 LDCONST R10 K5 + 0x7C1C0600, // 0013 CALL R7 3 + 0x501C0200, // 0014 LDBOOL R7 1 0 + 0x80040E00, // 0015 RET 1 R7 + 0x70020021, // 0016 JMP #0039 + 0x1C1C0D0A, // 0017 EQ R7 R6 K10 + 0x781E000B, // 0018 JMPF R7 #0025 + 0x8C1C0106, // 0019 GETMET R7 R0 K6 + 0x50240200, // 001A LDBOOL R9 1 0 + 0x7C1C0400, // 001B CALL R7 2 + 0x8C1C0107, // 001C GETMET R7 R0 K7 + 0x7C1C0200, // 001D CALL R7 1 + 0x8C1C0108, // 001E GETMET R7 R0 K8 + 0x58240009, // 001F LDCONST R9 K9 + 0x5828000A, // 0020 LDCONST R10 K10 + 0x7C1C0600, // 0021 CALL R7 3 + 0x501C0200, // 0022 LDBOOL R7 1 0 + 0x80040E00, // 0023 RET 1 R7 + 0x70020013, // 0024 JMP #0039 + 0x1C1C0D0B, // 0025 EQ R7 R6 K11 + 0x781E0011, // 0026 JMPF R7 #0039 + 0x8C1C0106, // 0027 GETMET R7 R0 K6 + 0x8824010C, // 0028 GETMBR R9 R0 K12 + 0x78260000, // 0029 JMPF R9 #002B + 0x50240001, // 002A LDBOOL R9 0 1 + 0x50240200, // 002B LDBOOL R9 1 0 + 0x7C1C0400, // 002C CALL R7 2 + 0x8C1C0107, // 002D GETMET R7 R0 K7 + 0x7C1C0200, // 002E CALL R7 1 + 0x8C1C0108, // 002F GETMET R7 R0 K8 + 0x58240009, // 0030 LDCONST R9 K9 + 0x8828010C, // 0031 GETMBR R10 R0 K12 + 0x782A0001, // 0032 JMPF R10 #0035 + 0x5828000A, // 0033 LDCONST R10 K10 + 0x70020000, // 0034 JMP #0036 + 0x58280005, // 0035 LDCONST R10 K5 + 0x7C1C0600, // 0036 CALL R7 3 + 0x501C0200, // 0037 LDBOOL R7 1 0 + 0x80040E00, // 0038 RET 1 R7 + 0x80000000, // 0039 RET 0 }) ) ); diff --git a/lib/libesp32/berry_tasmota/src/be_cron_class.cpp b/lib/libesp32/berry_tasmota/src/be_cron_class.cpp index 033dc81e7102..d5daf03f17ee 100644 --- a/lib/libesp32/berry_tasmota/src/be_cron_class.cpp +++ b/lib/libesp32/berry_tasmota/src/be_cron_class.cpp @@ -21,7 +21,7 @@ static cron_expr* ccronexpr_init(struct bvm* vm, char* expr) { cron_parse_expr(expr, cron, &error); if (error) { - be_raise(vm, "value_error", error); // TODO any way to pass VM? + be_raise(vm, "value_error", error); } return cron; } diff --git a/lib/libesp32/berry_tasmota/src/be_zigbee_zcl_attributes.c b/lib/libesp32/berry_tasmota/src/be_zigbee_zcl_attribute.c similarity index 100% rename from lib/libesp32/berry_tasmota/src/be_zigbee_zcl_attributes.c rename to lib/libesp32/berry_tasmota/src/be_zigbee_zcl_attribute.c diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_matter.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_matter.ino index 4503500e84cc..665023e4d03a 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_matter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_matter.ino @@ -76,4 +76,98 @@ extern "C" uint32_t matter_convert_seconds_to_dhm(uint32_t seconds, char *unit, return 0; } + +// +// internal function to publish a command received from the Matter controller +// +// `matter.publish_command("MtrReceived", 2, "buld", '"Power":1')` +// matter_publish_command(const char * json_prefix, uint32_t ep, const char * friendly_name, const char * payload) { +extern "C" int matter_publish_command(bvm *vm) { + int32_t argc = be_top(vm); // Get the number of arguments + if (argc >= 4 && be_isstring(vm, 1) && be_isint(vm, 2) && be_isstring(vm, 3) && be_isstring(vm, 4)) { + const char * json_prefix = be_tostring(vm, 1); + uint32_t ep = be_toint(vm, 2); + const char * friendly_name = be_tostring(vm, 3); + const char * payload = be_tostring(vm, 4); + be_pop(vm, be_top(vm)); // avoid `Error be_top is non zero` + + bool use_fname = (Settings->flag4.zigbee_use_names) && (friendly_name && strlen(friendly_name)); // should we replace shortaddr with friendlyname? + + ResponseClear(); // clear string + + // Do we prefix with `ZbReceived`? + if (!Settings->flag4.remove_zbreceived && !Settings->flag5.zb_received_as_subtopic) { + if (Settings->flag5.zigbee_include_time && Rtc.utc_time >= START_VALID_TIME) { + // Add time if needed (and if time is valide) + ResponseAppendTimeFormat(Settings->flag2.time_format); + ResponseAppend_P(PSTR(",\"%s\":"), json_prefix); + } else { + ResponseAppend_P(PSTR("{\"%s\":"), json_prefix); + } + } + + // What key do we use, shortaddr or name? + if (!Settings->flag5.zb_omit_json_addr) { + if (use_fname) { + ResponseAppend_P(PSTR("{\"%s\":"), friendly_name); + } else { + ResponseAppend_P(PSTR("{\"ep%i\":"), ep); + } + } + ResponseAppend_P(PSTR("{")); + + // Add "Name":"xxx" if name is present + if (friendly_name && strlen(friendly_name)) { + ResponseAppend_P(PSTR("\"" "Name" "\":\"%s\","), EscapeJSONString(friendly_name).c_str()); + } + // Add all other attributes + ResponseAppend_P(PSTR("%s}"), payload); + + if (!Settings->flag5.zb_omit_json_addr) { + ResponseAppend_P(PSTR("}")); + } + + if (!Settings->flag4.remove_zbreceived && !Settings->flag5.zb_received_as_subtopic) { + ResponseAppend_P(PSTR("}")); + } + + #ifdef USE_INFLUXDB + InfluxDbProcess(1); // Use a copy of ResponseData + #endif + + if (Settings->flag4.zigbee_distinct_topics) { + char subtopic[TOPSZ]; + if (Settings->flag4.zb_topic_fname && friendly_name && strlen(friendly_name)) { + // Clean special characters + char stemp[TOPSZ]; + strlcpy(stemp, friendly_name, sizeof(stemp)); + MakeValidMqtt(0, stemp); + if (Settings->flag5.zigbee_hide_bridge_topic) { + snprintf_P(subtopic, sizeof(subtopic), PSTR("%s"), stemp); + } else { + snprintf_P(subtopic, sizeof(subtopic), PSTR("%s/%s"), TasmotaGlobal.mqtt_topic, stemp); + } + } else { + if (Settings->flag5.zigbee_hide_bridge_topic) { + snprintf_P(subtopic, sizeof(subtopic), PSTR("%i"), ep); + } else { + snprintf_P(subtopic, sizeof(subtopic), PSTR("%s/%i"), TasmotaGlobal.mqtt_topic, ep); + } + } + char stopic[TOPSZ]; + if (Settings->flag5.zb_received_as_subtopic) { + GetTopic_P(stopic, TELE, subtopic, json_prefix); + } else { + GetTopic_P(stopic, TELE, subtopic, PSTR(D_RSLT_SENSOR)); + } + MqttPublish(stopic, Settings->flag.mqtt_sensor_retain); + } else { + MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_SENSOR), Settings->flag.mqtt_sensor_retain); + } + XdrvRulesProcess(0); // apply rules + be_return_nil(vm); + } + be_raise(vm, kTypeError, nullptr); +} + #endif // USE_BERRY