diff --git a/CHANGELOG.md b/CHANGELOG.md index 327fecc2e..f4e80e822 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ All notable changes to this project will be documented in this file. ### Added - Support for HDMI CEC protocol (#19434) - Support different baudrates on BL0942 +- Matter support for Virtual Devices controllable via Rules or Berry ### Changed - Berry fast_loop is now called every 5ms whatever the Sleep value (#19436) diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Device.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Device.be index 3091d416b..4edba45e0 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Device.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Device.be @@ -172,5 +172,48 @@ class Matter_Plugin_Device : Matter_Plugin end end + ############################################################# + # append_state_json + # + # Output the current state in JSON. + # The JSON is build via introspection to see what attributes + # exist and need to be output + # New values need to be appended with `,"key":value` (including prefix comma) + def append_state_json() + import introspect + var ret = "" + + # ret: string + # attribute: attrbute name + # key: in json + def _stats_json_inner(attribute, key) + import introspect + import json + var val + if (val := introspect.get(self, attribute)) != nil + if type(val) == 'boot' val = int(val) end # transform bool into 1/0 + ret += f',"{key}":{json.dump(val)}' + end + end + + # lights + # print(f'{self=} {type(self)} {introspect.members(self)=}') + _stats_json_inner("shadow_onoff", "Power") + _stats_json_inner("shadow_bri", "Bri") + _stats_json_inner("shadow_ct", "CT") + _stats_json_inner("shadow_hue", "Hue") + _stats_json_inner("shadow_sat", "Sat") + # shutters + _stats_json_inner("shadow_shutter_pos", "ShutterPos") + _stats_json_inner("shadow_shutter_target", "ShutterTarget") + _stats_json_inner("shadow_shutter_tilt", "ShutterTilt") + + # sensors + _stats_json_inner("shadow_contact", "Contact") + _stats_json_inner("shadow_occupancy", "Occupancy") + # print(ret) + return ret + end + end matter.Plugin_Device = Matter_Plugin_Device diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Light0.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Light0.be index c696d33e5..daf07dbbe 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Light0.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Light0.be @@ -146,15 +146,6 @@ class Matter_Plugin_Light0 : Matter_Plugin_Device return m.find(key_i) end - ############################################################# - # append_state_json - # - # Output the current state in JSON - # New values need to be appended with `,"key":value` (including prefix comma) - def append_state_json() - return f',"Power":{int(self.shadow_onoff)}' - end - ############################################################# # update_virtual # diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_OnOff.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_OnOff.be index 7071fb29b..6ef80c0b7 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_OnOff.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_OnOff.be @@ -150,16 +150,6 @@ class Matter_Plugin_OnOff : Matter_Plugin_Device end - ############################################################# - # append_state_json - # - # Output the current state in JSON - # Takes the JSON string prefix - # New values need to be appended with `,"key":value` (including prefix comma) - def append_state_json() - return f',"Power":{int(self.shadow_onoff)}' - end - ############################################################# # update_virtual # diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Shutter.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Shutter.be index 2e9cca3af..3455a34e6 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Shutter.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Shutter.be @@ -41,7 +41,6 @@ class Matter_Plugin_Shutter : Matter_Plugin_Device var tasmota_shutter_index # Shutter number in Tasmota (zero based) var shadow_shutter_pos var shadow_shutter_target - var shadow_shutter_tilt var shadow_shutter_direction # 1=opening -1=closing 0=not moving TODO var shadow_shutter_inverted # 1=same as matter 0=matter must invert @@ -225,14 +224,5 @@ class Matter_Plugin_Shutter : Matter_Plugin_Device end end - ############################################################# - # append_state_json - # - # Output the current state in JSON - # New values need to be appended with `,"key":value` (including prefix comma) - def append_state_json(payload_str) - return f',"ShutterPos":{self.shadow_shutter_pos},"ShutterTarget":{self.shadow_shutter_target}' - end - end matter.Plugin_Shutter = Matter_Plugin_Shutter diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Light1.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Light1.be index d19e11d25..c2be8e5ac 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Light1.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Light1.be @@ -189,16 +189,6 @@ class Matter_Plugin_Light1 : Matter_Plugin_Light0 end end - ############################################################# - # append_state_json - # - # Output the current state in JSON - # Takes the JSON string prefix - # New values need to be appended with `,"key":value` (including prefix comma) - def append_state_json() - return f',"Power":{int(self.shadow_onoff)},"Bri":{self.shadow_bri}' - end - ############################################################# # update_virtual # diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Sensor_Contact.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Sensor_Contact.be index d7d11f449..bce20c0a2 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Sensor_Contact.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Sensor_Contact.be @@ -96,14 +96,5 @@ class Matter_Plugin_Sensor_Contact : Matter_Plugin_Device end end - ############################################################# - # append_state_json - # - # Output the current state in JSON - # New values need to be appended with `,"key":value` (including prefix comma) - def append_state_json() - return f',"Contact":{int(self.shadow_contact)}' - end - end matter.Plugin_Sensor_Contact = Matter_Plugin_Sensor_Contact diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Sensor_Occupancy.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Sensor_Occupancy.be index 956771717..25951762b 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Sensor_Occupancy.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Sensor_Occupancy.be @@ -97,14 +97,5 @@ class Matter_Plugin_Sensor_Occupancy : Matter_Plugin_Device end end - ############################################################# - # append_state_json - # - # Output the current state in JSON - # New values need to be appended with `,"key":value` (including prefix comma) - def append_state_json() - return f',"Occupancy":{int(self.shadow_occupancy)}' - end - end matter.Plugin_Sensor_Occupancy = Matter_Plugin_Sensor_Occupancy diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_ShutterTilt.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_ShutterTilt.be index ca027e1e0..133e20010 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_ShutterTilt.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_ShutterTilt.be @@ -43,6 +43,7 @@ class Matter_Plugin_ShutterTilt : Matter_Plugin_Shutter # var shadow_shutter_target # var shadow_shutter_tilt # var shadow_shutter_direction # 1=opening -1=closing 0=not moving TODO + var shadow_shutter_tilt var tilt_min, tilt_max ############################################################# @@ -164,14 +165,5 @@ class Matter_Plugin_ShutterTilt : Matter_Plugin_Shutter end - ############################################################# - # append_state_json - # - # Output the current state in JSON - # New values need to be appended with `,"key":value` (including prefix comma) - def append_state_json(payload_str) - return f',"ShutterPos":{self.shadow_shutter_pos},"ShutterTarget":{self.shadow_shutter_target},"ShutterTilt":{self.shadow_shutter_tilt}' - end - end matter.Plugin_ShutterTilt = Matter_Plugin_ShutterTilt diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Light2.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Light2.be index 569296515..861949e28 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Light2.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Light2.be @@ -175,15 +175,6 @@ class Matter_Plugin_Light2 : Matter_Plugin_Light1 end - ############################################################# - # append_state_json - # - # Output the current state in JSON - # New values need to be appended with `,"key":value` (including prefix comma) - def append_state_json(payload_str) - return f',"Power":{int(self.shadow_onoff)},"Bri":{self.shadow_bri},"CT":{self.shadow_ct}' - end - ############################################################# # update_virtual # diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Light3.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Light3.be index cd8577483..ac5cb78d8 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Light3.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_4_Light3.be @@ -212,16 +212,6 @@ class Matter_Plugin_Light3 : Matter_Plugin_Light1 end - ############################################################# - # append_state_json - # - # Output the current state in JSON - # Takes the JSON string prefix - # New values need to be appended with `,"key":value` (including prefix comma) - def append_state_json(payload_str) - return f',"Power":{int(self.shadow_onoff)},"Bri":{self.shadow_bri},"Hue":{self.shadow_hue},"Sat":{self.shadow_sat}' - end - ############################################################# # update_virtual # diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_1_Device.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_1_Device.h index e654a4d9a..0f9beda9e 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_1_Device.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_1_Device.h @@ -6,92 +6,6 @@ extern const bclass be_class_Matter_Plugin_Device; -/******************************************************************** -** Solidified function: invoke_request -********************************************************************/ -be_local_closure(Matter_Plugin_Device_invoke_request, /* name */ - be_nested_proto( - 13, /* nstack */ - 4, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[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(3), - /* K5 */ be_const_int(0), - /* K6 */ be_const_int(1), - /* K7 */ be_nested_str_weak(Matter_TLV_struct), - /* K8 */ be_nested_str_weak(add_TLV), - /* K9 */ be_nested_str_weak(U2), - /* K10 */ be_nested_str_weak(invoke_request), - }), - be_str_weak(invoke_request), - &be_const_str_solidified, - ( &(const binstruction[51]) { /* code */ - 0xB8120000, // 0000 GETNGBL R4 K0 - 0x88100901, // 0001 GETMBR R4 R4 K1 - 0x88140702, // 0002 GETMBR R5 R3 K2 - 0x88180703, // 0003 GETMBR R6 R3 K3 - 0x1C1C0B04, // 0004 EQ R7 R5 K4 - 0x781E0016, // 0005 JMPF R7 #001D - 0x1C1C0D05, // 0006 EQ R7 R6 K5 - 0x781E0002, // 0007 JMPF R7 #000B - 0x501C0200, // 0008 LDBOOL R7 1 0 - 0x80040E00, // 0009 RET 1 R7 - 0x70020010, // 000A JMP #001C - 0x1C1C0D06, // 000B EQ R7 R6 K6 - 0x781E0009, // 000C JMPF R7 #0017 - 0x8C1C0907, // 000D GETMET R7 R4 K7 - 0x7C1C0200, // 000E CALL R7 1 - 0x8C200F08, // 000F GETMET R8 R7 K8 - 0x58280005, // 0010 LDCONST R10 K5 - 0x882C0909, // 0011 GETMBR R11 R4 K9 - 0x58300005, // 0012 LDCONST R12 K5 - 0x7C200800, // 0013 CALL R8 4 - 0x900E0705, // 0014 SETMBR R3 K3 K5 - 0x80040E00, // 0015 RET 1 R7 - 0x70020004, // 0016 JMP #001C - 0x541E003F, // 0017 LDINT R7 64 - 0x1C1C0C07, // 0018 EQ R7 R6 R7 - 0x781E0001, // 0019 JMPF R7 #001C - 0x501C0200, // 001A LDBOOL R7 1 0 - 0x80040E00, // 001B RET 1 R7 - 0x70020014, // 001C JMP #0032 - 0x541E0003, // 001D LDINT R7 4 - 0x1C1C0A07, // 001E EQ R7 R5 R7 - 0x781E0002, // 001F JMPF R7 #0023 - 0x501C0200, // 0020 LDBOOL R7 1 0 - 0x80040E00, // 0021 RET 1 R7 - 0x7002000E, // 0022 JMP #0032 - 0x541E0004, // 0023 LDINT R7 5 - 0x1C1C0A07, // 0024 EQ R7 R5 R7 - 0x781E0002, // 0025 JMPF R7 #0029 - 0x501C0200, // 0026 LDBOOL R7 1 0 - 0x80040E00, // 0027 RET 1 R7 - 0x70020008, // 0028 JMP #0032 - 0x601C0003, // 0029 GETGBL R7 G3 - 0x5C200000, // 002A MOVE R8 R0 - 0x7C1C0200, // 002B CALL R7 1 - 0x8C1C0F0A, // 002C GETMET R7 R7 K10 - 0x5C240200, // 002D MOVE R9 R1 - 0x5C280400, // 002E MOVE R10 R2 - 0x5C2C0600, // 002F MOVE R11 R3 - 0x7C1C0800, // 0030 CALL R7 4 - 0x80040E00, // 0031 RET 1 R7 - 0x80000000, // 0032 RET 0 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: read_attribute ********************************************************************/ @@ -417,6 +331,240 @@ be_local_closure(Matter_Plugin_Device_read_attribute, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: append_state_json +********************************************************************/ +be_local_closure(Matter_Plugin_Device_append_state_json, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + be_nested_proto( + 12, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 2]) { /* upvals */ + be_local_const_upval(1, 0), + be_local_const_upval(1, 2), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str_weak(introspect), + /* K1 */ be_nested_str_weak(json), + /* K2 */ be_nested_str_weak(get), + /* K3 */ be_nested_str_weak(boot), + /* K4 */ be_nested_str_weak(_X2C_X22_X25s_X22_X3A_X25s), + /* K5 */ be_nested_str_weak(dump), + }), + be_str_weak(_stats_json_inner), + &be_const_str_solidified, + ( &(const binstruction[31]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0xA40E0200, // 0001 IMPORT R3 K1 + 0x4C100000, // 0002 LDNIL R4 + 0x8C140502, // 0003 GETMET R5 R2 K2 + 0x681C0000, // 0004 GETUPV R7 U0 + 0x5C200000, // 0005 MOVE R8 R0 + 0x7C140600, // 0006 CALL R5 3 + 0x5C100A00, // 0007 MOVE R4 R5 + 0x4C180000, // 0008 LDNIL R6 + 0x20140A06, // 0009 NE R5 R5 R6 + 0x78160012, // 000A JMPF R5 #001E + 0x60140004, // 000B GETGBL R5 G4 + 0x5C180800, // 000C MOVE R6 R4 + 0x7C140200, // 000D CALL R5 1 + 0x1C140B03, // 000E EQ R5 R5 K3 + 0x78160003, // 000F JMPF R5 #0014 + 0x60140009, // 0010 GETGBL R5 G9 + 0x5C180800, // 0011 MOVE R6 R4 + 0x7C140200, // 0012 CALL R5 1 + 0x5C100A00, // 0013 MOVE R4 R5 + 0x60180018, // 0014 GETGBL R6 G24 + 0x581C0004, // 0015 LDCONST R7 K4 + 0x5C200200, // 0016 MOVE R8 R1 + 0x8C240705, // 0017 GETMET R9 R3 K5 + 0x5C2C0800, // 0018 MOVE R11 R4 + 0x7C240400, // 0019 CALL R9 2 + 0x7C180600, // 001A CALL R6 3 + 0x68140001, // 001B GETUPV R5 U1 + 0x00140A06, // 001C ADD R5 R5 R6 + 0x6C140001, // 001D SETUPV R5 U1 + 0x80000000, // 001E RET 0 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[22]) { /* constants */ + /* K0 */ be_nested_str_weak(introspect), + /* K1 */ be_nested_str_weak(), + /* K2 */ be_nested_str_weak(shadow_onoff), + /* K3 */ be_nested_str_weak(Power), + /* K4 */ be_nested_str_weak(shadow_bri), + /* K5 */ be_nested_str_weak(Bri), + /* K6 */ be_nested_str_weak(shadow_ct), + /* K7 */ be_nested_str_weak(CT), + /* K8 */ be_nested_str_weak(shadow_hue), + /* K9 */ be_nested_str_weak(Hue), + /* K10 */ be_nested_str_weak(shadow_sat), + /* K11 */ be_nested_str_weak(Sat), + /* K12 */ be_nested_str_weak(shadow_shutter_pos), + /* K13 */ be_nested_str_weak(ShutterPos), + /* K14 */ be_nested_str_weak(shadow_shutter_target), + /* K15 */ be_nested_str_weak(ShutterTarget), + /* K16 */ be_nested_str_weak(shadow_shutter_tilt), + /* K17 */ be_nested_str_weak(ShutterTilt), + /* K18 */ be_nested_str_weak(shadow_contact), + /* K19 */ be_nested_str_weak(Contact), + /* K20 */ be_nested_str_weak(shadow_occupancy), + /* K21 */ be_nested_str_weak(Occupancy), + }), + be_str_weak(append_state_json), + &be_const_str_solidified, + ( &(const binstruction[45]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x58080001, // 0001 LDCONST R2 K1 + 0x840C0000, // 0002 CLOSURE R3 P0 + 0x5C100600, // 0003 MOVE R4 R3 + 0x58140002, // 0004 LDCONST R5 K2 + 0x58180003, // 0005 LDCONST R6 K3 + 0x7C100400, // 0006 CALL R4 2 + 0x5C100600, // 0007 MOVE R4 R3 + 0x58140004, // 0008 LDCONST R5 K4 + 0x58180005, // 0009 LDCONST R6 K5 + 0x7C100400, // 000A CALL R4 2 + 0x5C100600, // 000B MOVE R4 R3 + 0x58140006, // 000C LDCONST R5 K6 + 0x58180007, // 000D LDCONST R6 K7 + 0x7C100400, // 000E CALL R4 2 + 0x5C100600, // 000F MOVE R4 R3 + 0x58140008, // 0010 LDCONST R5 K8 + 0x58180009, // 0011 LDCONST R6 K9 + 0x7C100400, // 0012 CALL R4 2 + 0x5C100600, // 0013 MOVE R4 R3 + 0x5814000A, // 0014 LDCONST R5 K10 + 0x5818000B, // 0015 LDCONST R6 K11 + 0x7C100400, // 0016 CALL R4 2 + 0x5C100600, // 0017 MOVE R4 R3 + 0x5814000C, // 0018 LDCONST R5 K12 + 0x5818000D, // 0019 LDCONST R6 K13 + 0x7C100400, // 001A CALL R4 2 + 0x5C100600, // 001B MOVE R4 R3 + 0x5814000E, // 001C LDCONST R5 K14 + 0x5818000F, // 001D LDCONST R6 K15 + 0x7C100400, // 001E CALL R4 2 + 0x5C100600, // 001F MOVE R4 R3 + 0x58140010, // 0020 LDCONST R5 K16 + 0x58180011, // 0021 LDCONST R6 K17 + 0x7C100400, // 0022 CALL R4 2 + 0x5C100600, // 0023 MOVE R4 R3 + 0x58140012, // 0024 LDCONST R5 K18 + 0x58180013, // 0025 LDCONST R6 K19 + 0x7C100400, // 0026 CALL R4 2 + 0x5C100600, // 0027 MOVE R4 R3 + 0x58140014, // 0028 LDCONST R5 K20 + 0x58180015, // 0029 LDCONST R6 K21 + 0x7C100400, // 002A CALL R4 2 + 0xA0000000, // 002B CLOSE R0 + 0x80040400, // 002C RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: invoke_request +********************************************************************/ +be_local_closure(Matter_Plugin_Device_invoke_request, /* name */ + be_nested_proto( + 13, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[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(3), + /* K5 */ be_const_int(0), + /* K6 */ be_const_int(1), + /* K7 */ be_nested_str_weak(Matter_TLV_struct), + /* K8 */ be_nested_str_weak(add_TLV), + /* K9 */ be_nested_str_weak(U2), + /* K10 */ be_nested_str_weak(invoke_request), + }), + be_str_weak(invoke_request), + &be_const_str_solidified, + ( &(const binstruction[51]) { /* code */ + 0xB8120000, // 0000 GETNGBL R4 K0 + 0x88100901, // 0001 GETMBR R4 R4 K1 + 0x88140702, // 0002 GETMBR R5 R3 K2 + 0x88180703, // 0003 GETMBR R6 R3 K3 + 0x1C1C0B04, // 0004 EQ R7 R5 K4 + 0x781E0016, // 0005 JMPF R7 #001D + 0x1C1C0D05, // 0006 EQ R7 R6 K5 + 0x781E0002, // 0007 JMPF R7 #000B + 0x501C0200, // 0008 LDBOOL R7 1 0 + 0x80040E00, // 0009 RET 1 R7 + 0x70020010, // 000A JMP #001C + 0x1C1C0D06, // 000B EQ R7 R6 K6 + 0x781E0009, // 000C JMPF R7 #0017 + 0x8C1C0907, // 000D GETMET R7 R4 K7 + 0x7C1C0200, // 000E CALL R7 1 + 0x8C200F08, // 000F GETMET R8 R7 K8 + 0x58280005, // 0010 LDCONST R10 K5 + 0x882C0909, // 0011 GETMBR R11 R4 K9 + 0x58300005, // 0012 LDCONST R12 K5 + 0x7C200800, // 0013 CALL R8 4 + 0x900E0705, // 0014 SETMBR R3 K3 K5 + 0x80040E00, // 0015 RET 1 R7 + 0x70020004, // 0016 JMP #001C + 0x541E003F, // 0017 LDINT R7 64 + 0x1C1C0C07, // 0018 EQ R7 R6 R7 + 0x781E0001, // 0019 JMPF R7 #001C + 0x501C0200, // 001A LDBOOL R7 1 0 + 0x80040E00, // 001B RET 1 R7 + 0x70020014, // 001C JMP #0032 + 0x541E0003, // 001D LDINT R7 4 + 0x1C1C0A07, // 001E EQ R7 R5 R7 + 0x781E0002, // 001F JMPF R7 #0023 + 0x501C0200, // 0020 LDBOOL R7 1 0 + 0x80040E00, // 0021 RET 1 R7 + 0x7002000E, // 0022 JMP #0032 + 0x541E0004, // 0023 LDINT R7 5 + 0x1C1C0A07, // 0024 EQ R7 R5 R7 + 0x781E0002, // 0025 JMPF R7 #0029 + 0x501C0200, // 0026 LDBOOL R7 1 0 + 0x80040E00, // 0027 RET 1 R7 + 0x70020008, // 0028 JMP #0032 + 0x601C0003, // 0029 GETGBL R7 G3 + 0x5C200000, // 002A MOVE R8 R0 + 0x7C1C0200, // 002B CALL R7 1 + 0x8C1C0F0A, // 002C GETMET R7 R7 K10 + 0x5C240200, // 002D MOVE R9 R1 + 0x5C280400, // 002E MOVE R10 R2 + 0x5C2C0600, // 002F MOVE R11 R3 + 0x7C1C0800, // 0030 CALL R7 4 + 0x80040E00, // 0031 RET 1 R7 + 0x80000000, // 0032 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified class: Matter_Plugin_Device ********************************************************************/ @@ -424,22 +572,17 @@ extern const bclass be_class_Matter_Plugin; be_local_class(Matter_Plugin_Device, 0, &be_class_Matter_Plugin, - be_nested_map(5, + be_nested_map(6, ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Device_read_attribute_closure) }, + { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Device_invoke_request_closure) }, { be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(1, ( (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(invoke_request, 1), be_const_closure(Matter_Plugin_Device_invoke_request_closure) }, - { be_const_key_weak(NON_BRIDGE_VENDOR, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { - be_const_list( * be_nested_list(2, - ( (struct bvalue*) &(const bvalue[]) { - be_const_int(4631), - be_const_int(4993), - })) ) } )) }, - { be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + { be_const_key_weak(append_state_json, -1), be_const_closure(Matter_Plugin_Device_append_state_json_closure) }, + { be_const_key_weak(CLUSTERS, 3), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(5, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(5, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { @@ -490,6 +633,12 @@ be_local_class(Matter_Plugin_Device, be_const_int(65532), be_const_int(65533), })) ) } )) }, + })) ) } )) }, + { be_const_key_weak(NON_BRIDGE_VENDOR, 1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(2, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(4631), + be_const_int(4993), })) ) } )) }, })), be_str_weak(Matter_Plugin_Device) diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Light0.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Light0.h index b9a61a7ce..45b4ba56d 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Light0.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Light0.h @@ -6,6 +6,184 @@ extern const bclass be_class_Matter_Plugin_Light0; +/******************************************************************** +** Solidified function: read_attribute +********************************************************************/ +be_local_closure(Matter_Plugin_Light0_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[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(attribute), + /* K4 */ be_nested_str_weak(update_shadow_lazy), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(set), + /* K7 */ be_nested_str_weak(BOOL), + /* K8 */ be_nested_str_weak(shadow_onoff), + /* K9 */ be_nested_str_weak(U4), + /* K10 */ be_nested_str_weak(read_attribute), + }), + be_str_weak(read_attribute), + &be_const_str_solidified, + ( &(const binstruction[45]) { /* code */ + 0xB8120000, // 0000 GETNGBL R4 K0 + 0x88100901, // 0001 GETMBR R4 R4 K1 + 0x88140502, // 0002 GETMBR R5 R2 K2 + 0x88180503, // 0003 GETMBR R6 R2 K3 + 0x541E0005, // 0004 LDINT R7 6 + 0x1C1C0A07, // 0005 EQ R7 R5 R7 + 0x781E001B, // 0006 JMPF R7 #0023 + 0x8C1C0104, // 0007 GETMET R7 R0 K4 + 0x7C1C0200, // 0008 CALL R7 1 + 0x1C1C0D05, // 0009 EQ R7 R6 K5 + 0x781E0005, // 000A JMPF R7 #0011 + 0x8C1C0706, // 000B GETMET R7 R3 K6 + 0x88240907, // 000C GETMBR R9 R4 K7 + 0x88280108, // 000D GETMBR R10 R0 K8 + 0x7C1C0600, // 000E CALL R7 3 + 0x80040E00, // 000F RET 1 R7 + 0x70020010, // 0010 JMP #0022 + 0x541EFFFB, // 0011 LDINT R7 65532 + 0x1C1C0C07, // 0012 EQ R7 R6 R7 + 0x781E0005, // 0013 JMPF R7 #001A + 0x8C1C0706, // 0014 GETMET R7 R3 K6 + 0x88240909, // 0015 GETMBR R9 R4 K9 + 0x58280005, // 0016 LDCONST R10 K5 + 0x7C1C0600, // 0017 CALL R7 3 + 0x80040E00, // 0018 RET 1 R7 + 0x70020007, // 0019 JMP #0022 + 0x541EFFFC, // 001A LDINT R7 65533 + 0x1C1C0C07, // 001B EQ R7 R6 R7 + 0x781E0004, // 001C JMPF R7 #0022 + 0x8C1C0706, // 001D GETMET R7 R3 K6 + 0x88240909, // 001E GETMBR R9 R4 K9 + 0x542A0003, // 001F LDINT R10 4 + 0x7C1C0600, // 0020 CALL R7 3 + 0x80040E00, // 0021 RET 1 R7 + 0x70020008, // 0022 JMP #002C + 0x601C0003, // 0023 GETGBL R7 G3 + 0x5C200000, // 0024 MOVE R8 R0 + 0x7C1C0200, // 0025 CALL R7 1 + 0x8C1C0F0A, // 0026 GETMET R7 R7 K10 + 0x5C240200, // 0027 MOVE R9 R1 + 0x5C280400, // 0028 MOVE R10 R2 + 0x5C2C0600, // 0029 MOVE R11 R3 + 0x7C1C0800, // 002A CALL R7 4 + 0x80040E00, // 002B RET 1 R7 + 0x80000000, // 002C 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: update_virtual +********************************************************************/ +be_local_closure(Matter_Plugin_Light0_update_virtual, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(find), + /* K1 */ be_nested_str_weak(Power), + /* K2 */ be_nested_str_weak(set_onoff), + /* K3 */ be_nested_str_weak(update_virtual), + }), + be_str_weak(update_virtual), + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x8C080300, // 0000 GETMET R2 R1 K0 + 0x58100001, // 0001 LDCONST R4 K1 + 0x7C080400, // 0002 CALL R2 2 + 0x4C0C0000, // 0003 LDNIL R3 + 0x200C0403, // 0004 NE R3 R2 R3 + 0x780E0004, // 0005 JMPF R3 #000B + 0x8C0C0102, // 0006 GETMET R3 R0 K2 + 0x60140017, // 0007 GETGBL R5 G23 + 0x5C180400, // 0008 MOVE R6 R2 + 0x7C140200, // 0009 CALL R5 1 + 0x7C0C0400, // 000A CALL R3 2 + 0x600C0003, // 000B GETGBL R3 G3 + 0x5C100000, // 000C MOVE R4 R0 + 0x7C0C0200, // 000D CALL R3 1 + 0x8C0C0703, // 000E GETMET R3 R3 K3 + 0x5C140200, // 000F MOVE R5 R1 + 0x7C0C0400, // 0010 CALL R3 2 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: init ********************************************************************/ @@ -44,11 +222,11 @@ be_local_closure(Matter_Plugin_Light0_init, /* name */ /******************************************************************** -** Solidified function: append_state_json +** Solidified function: update_shadow ********************************************************************/ -be_local_closure(Matter_Plugin_Light0_append_state_json, /* name */ +be_local_closure(Matter_Plugin_Light0_update_shadow, /* name */ be_nested_proto( - 5, /* nstack */ + 8, /* nstack */ 1, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -56,20 +234,46 @@ be_local_closure(Matter_Plugin_Light0_append_state_json, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(_X2C_X22Power_X22_X3A_X25s), - /* K1 */ be_nested_str_weak(shadow_onoff), + ( &(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(append_state_json), + be_str_weak(update_shadow), &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0x60040018, // 0000 GETGBL R1 G24 - 0x58080000, // 0001 LDCONST R2 K0 - 0x600C0009, // 0002 GETGBL R3 G9 - 0x88100101, // 0003 GETMBR R4 R0 K1 - 0x7C0C0200, // 0004 CALL R3 1 - 0x7C040400, // 0005 CALL R1 2 - 0x80040200, // 0006 RET 1 R1 + ( &(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 }) ) ); @@ -166,243 +370,6 @@ be_local_closure(Matter_Plugin_Light0_invoke_request, /* name */ /*******************************************************************/ -/******************************************************************** -** 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: 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: update_virtual -********************************************************************/ -be_local_closure(Matter_Plugin_Light0_update_virtual, /* name */ - be_nested_proto( - 7, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_str_weak(find), - /* K1 */ be_nested_str_weak(Power), - /* K2 */ be_nested_str_weak(set_onoff), - /* K3 */ be_nested_str_weak(update_virtual), - }), - be_str_weak(update_virtual), - &be_const_str_solidified, - ( &(const binstruction[18]) { /* code */ - 0x8C080300, // 0000 GETMET R2 R1 K0 - 0x58100001, // 0001 LDCONST R4 K1 - 0x7C080400, // 0002 CALL R2 2 - 0x4C0C0000, // 0003 LDNIL R3 - 0x200C0403, // 0004 NE R3 R2 R3 - 0x780E0004, // 0005 JMPF R3 #000B - 0x8C0C0102, // 0006 GETMET R3 R0 K2 - 0x60140017, // 0007 GETGBL R5 G23 - 0x5C180400, // 0008 MOVE R6 R2 - 0x7C140200, // 0009 CALL R5 1 - 0x7C0C0400, // 000A CALL R3 2 - 0x600C0003, // 000B GETGBL R3 G3 - 0x5C100000, // 000C MOVE R4 R0 - 0x7C0C0200, // 000D CALL R3 1 - 0x8C0C0703, // 000E GETMET R3 R3 K3 - 0x5C140200, // 000F MOVE R5 R1 - 0x7C0C0400, // 0010 CALL R3 2 - 0x80000000, // 0011 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: read_attribute -********************************************************************/ -be_local_closure(Matter_Plugin_Light0_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[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(attribute), - /* K4 */ be_nested_str_weak(update_shadow_lazy), - /* K5 */ be_const_int(0), - /* K6 */ be_nested_str_weak(set), - /* K7 */ be_nested_str_weak(BOOL), - /* K8 */ be_nested_str_weak(shadow_onoff), - /* K9 */ be_nested_str_weak(U4), - /* K10 */ be_nested_str_weak(read_attribute), - }), - be_str_weak(read_attribute), - &be_const_str_solidified, - ( &(const binstruction[45]) { /* code */ - 0xB8120000, // 0000 GETNGBL R4 K0 - 0x88100901, // 0001 GETMBR R4 R4 K1 - 0x88140502, // 0002 GETMBR R5 R2 K2 - 0x88180503, // 0003 GETMBR R6 R2 K3 - 0x541E0005, // 0004 LDINT R7 6 - 0x1C1C0A07, // 0005 EQ R7 R5 R7 - 0x781E001B, // 0006 JMPF R7 #0023 - 0x8C1C0104, // 0007 GETMET R7 R0 K4 - 0x7C1C0200, // 0008 CALL R7 1 - 0x1C1C0D05, // 0009 EQ R7 R6 K5 - 0x781E0005, // 000A JMPF R7 #0011 - 0x8C1C0706, // 000B GETMET R7 R3 K6 - 0x88240907, // 000C GETMBR R9 R4 K7 - 0x88280108, // 000D GETMBR R10 R0 K8 - 0x7C1C0600, // 000E CALL R7 3 - 0x80040E00, // 000F RET 1 R7 - 0x70020010, // 0010 JMP #0022 - 0x541EFFFB, // 0011 LDINT R7 65532 - 0x1C1C0C07, // 0012 EQ R7 R6 R7 - 0x781E0005, // 0013 JMPF R7 #001A - 0x8C1C0706, // 0014 GETMET R7 R3 K6 - 0x88240909, // 0015 GETMBR R9 R4 K9 - 0x58280005, // 0016 LDCONST R10 K5 - 0x7C1C0600, // 0017 CALL R7 3 - 0x80040E00, // 0018 RET 1 R7 - 0x70020007, // 0019 JMP #0022 - 0x541EFFFC, // 001A LDINT R7 65533 - 0x1C1C0C07, // 001B EQ R7 R6 R7 - 0x781E0004, // 001C JMPF R7 #0022 - 0x8C1C0706, // 001D GETMET R7 R3 K6 - 0x88240909, // 001E GETMBR R9 R4 K9 - 0x542A0003, // 001F LDINT R10 4 - 0x7C1C0600, // 0020 CALL R7 3 - 0x80040E00, // 0021 RET 1 R7 - 0x70020008, // 0022 JMP #002C - 0x601C0003, // 0023 GETGBL R7 G3 - 0x5C200000, // 0024 MOVE R8 R0 - 0x7C1C0200, // 0025 CALL R7 1 - 0x8C1C0F0A, // 0026 GETMET R7 R7 K10 - 0x5C240200, // 0027 MOVE R9 R1 - 0x5C280400, // 0028 MOVE R10 R2 - 0x5C2C0600, // 0029 MOVE R11 R3 - 0x7C1C0800, // 002A CALL R7 4 - 0x80040E00, // 002B RET 1 R7 - 0x80000000, // 002C RET 0 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: find_val_i ********************************************************************/ @@ -448,28 +415,28 @@ extern const bclass be_class_Matter_Plugin_Device; be_local_class(Matter_Plugin_Light0, 1, &be_class_Matter_Plugin_Device, - be_nested_map(15, + be_nested_map(14, ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(read_attribute, 11), be_const_closure(Matter_Plugin_Light0_read_attribute_closure) }, + { be_const_key_weak(UPDATE_TIME, 4), be_const_int(250) }, + { be_const_key_weak(update_virtual, 1), be_const_closure(Matter_Plugin_Light0_update_virtual_closure) }, + { be_const_key_weak(UPDATE_COMMANDS, 13), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(1, + ( (struct bvalue*) &(const bvalue[]) { + be_nested_str_weak(Power), + })) ) } )) }, + { be_const_key_weak(find_val_i, -1), be_const_static_closure(Matter_Plugin_Light0_find_val_i_closure) }, { be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Light0_init_closure) }, - { be_const_key_weak(append_state_json, -1), be_const_closure(Matter_Plugin_Light0_append_state_json_closure) }, + { be_const_key_weak(set_onoff, 12), be_const_closure(Matter_Plugin_Light0_set_onoff_closure) }, + { be_const_key_weak(update_shadow, 9), be_const_closure(Matter_Plugin_Light0_update_shadow_closure) }, + { be_const_key_weak(NAME, -1), be_nested_str_weak(Light_X200_X20On) }, { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Light0_invoke_request_closure) }, - { be_const_key_weak(set_onoff, -1), be_const_closure(Matter_Plugin_Light0_set_onoff_closure) }, - { be_const_key_weak(update_shadow, 11), be_const_closure(Matter_Plugin_Light0_update_shadow_closure) }, - { be_const_key_weak(update_virtual, 7), be_const_closure(Matter_Plugin_Light0_update_virtual_closure) }, - { be_const_key_weak(UPDATE_TIME, -1), be_const_int(250) }, { 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(256, -1), be_const_int(2) }, })) ) } )) }, - { be_const_key_weak(UPDATE_COMMANDS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { - be_const_list( * be_nested_list(1, - ( (struct bvalue*) &(const bvalue[]) { - be_nested_str_weak(Power), - })) ) } )) }, - { be_const_key_weak(NAME, 8), be_nested_str_weak(Light_X200_X20On) }, - { be_const_key_weak(TYPE, -1), be_nested_str_weak(light0) }, - { be_const_key_weak(CLUSTERS, 10), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + { be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(6, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(6, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { @@ -528,9 +495,8 @@ be_local_class(Matter_Plugin_Light0, be_const_int(65533), })) ) } )) }, })) ) } )) }, - { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Light0_read_attribute_closure) }, { be_const_key_weak(shadow_onoff, -1), be_const_var(0) }, - { be_const_key_weak(find_val_i, -1), be_const_static_closure(Matter_Plugin_Light0_find_val_i_closure) }, + { be_const_key_weak(TYPE, -1), be_nested_str_weak(light0) }, })), be_str_weak(Matter_Plugin_Light0) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_OnOff.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_OnOff.h index 9cbe1473f..35caea4dd 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_OnOff.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_OnOff.h @@ -6,307 +6,6 @@ extern const bclass be_class_Matter_Plugin_OnOff; -/******************************************************************** -** Solidified function: invoke_request -********************************************************************/ -be_local_closure(Matter_Plugin_OnOff_invoke_request, /* name */ - be_nested_proto( - 11, /* nstack */ - 4, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[12]) { /* constants */ - /* K0 */ be_nested_str_weak(matter), - /* K1 */ be_nested_str_weak(TLV), - /* K2 */ be_nested_str_weak(cluster), - /* K3 */ be_nested_str_weak(command), - /* K4 */ be_nested_str_weak(update_shadow_lazy), - /* K5 */ be_const_int(0), - /* K6 */ be_nested_str_weak(set_onoff), - /* K7 */ be_nested_str_weak(publish_command), - /* K8 */ be_nested_str_weak(Power), - /* K9 */ be_const_int(1), - /* K10 */ be_const_int(2), - /* K11 */ be_nested_str_weak(shadow_onoff), - }), - be_str_weak(invoke_request), - &be_const_str_solidified, - ( &(const binstruction[52]) { /* 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 - 0x781E002B, // 0006 JMPF R7 #0033 - 0x8C1C0104, // 0007 GETMET R7 R0 K4 - 0x7C1C0200, // 0008 CALL R7 1 - 0x1C1C0D05, // 0009 EQ R7 R6 K5 - 0x781E0009, // 000A JMPF R7 #0015 - 0x8C1C0106, // 000B GETMET R7 R0 K6 - 0x50240000, // 000C LDBOOL R9 0 0 - 0x7C1C0400, // 000D CALL R7 2 - 0x8C1C0107, // 000E GETMET R7 R0 K7 - 0x58240008, // 000F LDCONST R9 K8 - 0x58280005, // 0010 LDCONST R10 K5 - 0x7C1C0600, // 0011 CALL R7 3 - 0x501C0200, // 0012 LDBOOL R7 1 0 - 0x80040E00, // 0013 RET 1 R7 - 0x7002001D, // 0014 JMP #0033 - 0x1C1C0D09, // 0015 EQ R7 R6 K9 - 0x781E0009, // 0016 JMPF R7 #0021 - 0x8C1C0106, // 0017 GETMET R7 R0 K6 - 0x50240200, // 0018 LDBOOL R9 1 0 - 0x7C1C0400, // 0019 CALL R7 2 - 0x8C1C0107, // 001A GETMET R7 R0 K7 - 0x58240008, // 001B LDCONST R9 K8 - 0x58280009, // 001C LDCONST R10 K9 - 0x7C1C0600, // 001D CALL R7 3 - 0x501C0200, // 001E LDBOOL R7 1 0 - 0x80040E00, // 001F RET 1 R7 - 0x70020011, // 0020 JMP #0033 - 0x1C1C0D0A, // 0021 EQ R7 R6 K10 - 0x781E000F, // 0022 JMPF R7 #0033 - 0x8C1C0106, // 0023 GETMET R7 R0 K6 - 0x8824010B, // 0024 GETMBR R9 R0 K11 - 0x78260000, // 0025 JMPF R9 #0027 - 0x50240001, // 0026 LDBOOL R9 0 1 - 0x50240200, // 0027 LDBOOL R9 1 0 - 0x7C1C0400, // 0028 CALL R7 2 - 0x8C1C0107, // 0029 GETMET R7 R0 K7 - 0x58240008, // 002A LDCONST R9 K8 - 0x8828010B, // 002B GETMBR R10 R0 K11 - 0x782A0001, // 002C JMPF R10 #002F - 0x58280009, // 002D LDCONST R10 K9 - 0x70020000, // 002E JMP #0030 - 0x58280005, // 002F LDCONST R10 K5 - 0x7C1C0600, // 0030 CALL R7 3 - 0x501C0200, // 0031 LDBOOL R7 1 0 - 0x80040E00, // 0032 RET 1 R7 - 0x80000000, // 0033 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: read_attribute -********************************************************************/ -be_local_closure(Matter_Plugin_OnOff_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[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(attribute), - /* K4 */ be_nested_str_weak(update_shadow_lazy), - /* K5 */ be_const_int(0), - /* K6 */ be_nested_str_weak(set), - /* K7 */ be_nested_str_weak(BOOL), - /* K8 */ be_nested_str_weak(shadow_onoff), - /* K9 */ be_nested_str_weak(U4), - /* K10 */ be_nested_str_weak(read_attribute), - }), - be_str_weak(read_attribute), - &be_const_str_solidified, - ( &(const binstruction[45]) { /* code */ - 0xB8120000, // 0000 GETNGBL R4 K0 - 0x88100901, // 0001 GETMBR R4 R4 K1 - 0x88140502, // 0002 GETMBR R5 R2 K2 - 0x88180503, // 0003 GETMBR R6 R2 K3 - 0x541E0005, // 0004 LDINT R7 6 - 0x1C1C0A07, // 0005 EQ R7 R5 R7 - 0x781E001B, // 0006 JMPF R7 #0023 - 0x8C1C0104, // 0007 GETMET R7 R0 K4 - 0x7C1C0200, // 0008 CALL R7 1 - 0x1C1C0D05, // 0009 EQ R7 R6 K5 - 0x781E0005, // 000A JMPF R7 #0011 - 0x8C1C0706, // 000B GETMET R7 R3 K6 - 0x88240907, // 000C GETMBR R9 R4 K7 - 0x88280108, // 000D GETMBR R10 R0 K8 - 0x7C1C0600, // 000E CALL R7 3 - 0x80040E00, // 000F RET 1 R7 - 0x70020010, // 0010 JMP #0022 - 0x541EFFFB, // 0011 LDINT R7 65532 - 0x1C1C0C07, // 0012 EQ R7 R6 R7 - 0x781E0005, // 0013 JMPF R7 #001A - 0x8C1C0706, // 0014 GETMET R7 R3 K6 - 0x88240909, // 0015 GETMBR R9 R4 K9 - 0x58280005, // 0016 LDCONST R10 K5 - 0x7C1C0600, // 0017 CALL R7 3 - 0x80040E00, // 0018 RET 1 R7 - 0x70020007, // 0019 JMP #0022 - 0x541EFFFC, // 001A LDINT R7 65533 - 0x1C1C0C07, // 001B EQ R7 R6 R7 - 0x781E0004, // 001C JMPF R7 #0022 - 0x8C1C0706, // 001D GETMET R7 R3 K6 - 0x88240909, // 001E GETMBR R9 R4 K9 - 0x542A0003, // 001F LDINT R10 4 - 0x7C1C0600, // 0020 CALL R7 3 - 0x80040E00, // 0021 RET 1 R7 - 0x70020008, // 0022 JMP #002C - 0x601C0003, // 0023 GETGBL R7 G3 - 0x5C200000, // 0024 MOVE R8 R0 - 0x7C1C0200, // 0025 CALL R7 1 - 0x8C1C0F0A, // 0026 GETMET R7 R7 K10 - 0x5C240200, // 0027 MOVE R9 R1 - 0x5C280400, // 0028 MOVE R10 R2 - 0x5C2C0600, // 0029 MOVE R11 R3 - 0x7C1C0800, // 002A CALL R7 4 - 0x80040E00, // 002B RET 1 R7 - 0x80000000, // 002C RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: update_shadow -********************************************************************/ -be_local_closure(Matter_Plugin_OnOff_update_shadow, /* name */ - be_nested_proto( - 6, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 9]) { /* constants */ - /* K0 */ be_nested_str_weak(virtual), - /* K1 */ be_nested_str_weak(tasmota), - /* K2 */ be_nested_str_weak(get_power), - /* K3 */ be_nested_str_weak(tasmota_relay_index), - /* K4 */ be_const_int(1), - /* 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[27]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x74060012, // 0001 JMPT R1 #0015 - 0xB8060200, // 0002 GETNGBL R1 K1 - 0x8C040302, // 0003 GETMET R1 R1 K2 - 0x880C0103, // 0004 GETMBR R3 R0 K3 - 0x040C0704, // 0005 SUB R3 R3 K4 - 0x7C040400, // 0006 CALL R1 2 - 0x4C080000, // 0007 LDNIL R2 - 0x20080202, // 0008 NE R2 R1 R2 - 0x780A000A, // 0009 JMPF R2 #0015 - 0x88080105, // 000A GETMBR R2 R0 K5 - 0x600C0017, // 000B GETGBL R3 G23 - 0x5C100200, // 000C MOVE R4 R1 - 0x7C0C0200, // 000D CALL R3 1 - 0x20080403, // 000E NE R2 R2 R3 - 0x780A0003, // 000F JMPF R2 #0014 - 0x8C080106, // 0010 GETMET R2 R0 K6 - 0x54120005, // 0011 LDINT R4 6 - 0x58140007, // 0012 LDCONST R5 K7 - 0x7C080600, // 0013 CALL R2 3 - 0x90020A01, // 0014 SETMBR R0 K5 R1 - 0x60040003, // 0015 GETGBL R1 G3 - 0x5C080000, // 0016 MOVE R2 R0 - 0x7C040200, // 0017 CALL R1 1 - 0x8C040308, // 0018 GETMET R1 R1 K8 - 0x7C040200, // 0019 CALL R1 1 - 0x80000000, // 001A RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: update_virtual -********************************************************************/ -be_local_closure(Matter_Plugin_OnOff_update_virtual, /* name */ - be_nested_proto( - 7, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_str_weak(find), - /* K1 */ be_nested_str_weak(Power), - /* K2 */ be_nested_str_weak(set_onoff), - /* K3 */ be_nested_str_weak(update_virtual), - }), - be_str_weak(update_virtual), - &be_const_str_solidified, - ( &(const binstruction[18]) { /* code */ - 0x8C080300, // 0000 GETMET R2 R1 K0 - 0x58100001, // 0001 LDCONST R4 K1 - 0x7C080400, // 0002 CALL R2 2 - 0x4C0C0000, // 0003 LDNIL R3 - 0x200C0403, // 0004 NE R3 R2 R3 - 0x780E0004, // 0005 JMPF R3 #000B - 0x8C0C0102, // 0006 GETMET R3 R0 K2 - 0x60140017, // 0007 GETGBL R5 G23 - 0x5C180400, // 0008 MOVE R6 R2 - 0x7C140200, // 0009 CALL R5 1 - 0x7C0C0400, // 000A CALL R3 2 - 0x600C0003, // 000B GETGBL R3 G3 - 0x5C100000, // 000C MOVE R4 R0 - 0x7C0C0200, // 000D CALL R3 1 - 0x8C0C0703, // 000E GETMET R3 R3 K3 - 0x5C140200, // 000F MOVE R5 R1 - 0x7C0C0400, // 0010 CALL R3 2 - 0x80000000, // 0011 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: -********************************************************************/ -be_local_closure(Matter_Plugin_OnOff__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 */ - 0x60040009, // 0000 GETGBL R1 G9 - 0x5C080000, // 0001 MOVE R2 R0 - 0x7C040200, // 0002 CALL R1 1 - 0x80040200, // 0003 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: set_onoff ********************************************************************/ @@ -403,6 +102,280 @@ be_local_closure(Matter_Plugin_OnOff_parse_configuration, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: update_shadow +********************************************************************/ +be_local_closure(Matter_Plugin_OnOff_update_shadow, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(virtual), + /* K1 */ be_nested_str_weak(tasmota), + /* K2 */ be_nested_str_weak(get_power), + /* K3 */ be_nested_str_weak(tasmota_relay_index), + /* K4 */ be_const_int(1), + /* 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[27]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x74060012, // 0001 JMPT R1 #0015 + 0xB8060200, // 0002 GETNGBL R1 K1 + 0x8C040302, // 0003 GETMET R1 R1 K2 + 0x880C0103, // 0004 GETMBR R3 R0 K3 + 0x040C0704, // 0005 SUB R3 R3 K4 + 0x7C040400, // 0006 CALL R1 2 + 0x4C080000, // 0007 LDNIL R2 + 0x20080202, // 0008 NE R2 R1 R2 + 0x780A000A, // 0009 JMPF R2 #0015 + 0x88080105, // 000A GETMBR R2 R0 K5 + 0x600C0017, // 000B GETGBL R3 G23 + 0x5C100200, // 000C MOVE R4 R1 + 0x7C0C0200, // 000D CALL R3 1 + 0x20080403, // 000E NE R2 R2 R3 + 0x780A0003, // 000F JMPF R2 #0014 + 0x8C080106, // 0010 GETMET R2 R0 K6 + 0x54120005, // 0011 LDINT R4 6 + 0x58140007, // 0012 LDCONST R5 K7 + 0x7C080600, // 0013 CALL R2 3 + 0x90020A01, // 0014 SETMBR R0 K5 R1 + 0x60040003, // 0015 GETGBL R1 G3 + 0x5C080000, // 0016 MOVE R2 R0 + 0x7C040200, // 0017 CALL R1 1 + 0x8C040308, // 0018 GETMET R1 R1 K8 + 0x7C040200, // 0019 CALL R1 1 + 0x80000000, // 001A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: invoke_request +********************************************************************/ +be_local_closure(Matter_Plugin_OnOff_invoke_request, /* name */ + be_nested_proto( + 11, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[12]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(cluster), + /* K3 */ be_nested_str_weak(command), + /* K4 */ be_nested_str_weak(update_shadow_lazy), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(set_onoff), + /* K7 */ be_nested_str_weak(publish_command), + /* K8 */ be_nested_str_weak(Power), + /* K9 */ be_const_int(1), + /* K10 */ be_const_int(2), + /* K11 */ be_nested_str_weak(shadow_onoff), + }), + be_str_weak(invoke_request), + &be_const_str_solidified, + ( &(const binstruction[52]) { /* 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 + 0x781E002B, // 0006 JMPF R7 #0033 + 0x8C1C0104, // 0007 GETMET R7 R0 K4 + 0x7C1C0200, // 0008 CALL R7 1 + 0x1C1C0D05, // 0009 EQ R7 R6 K5 + 0x781E0009, // 000A JMPF R7 #0015 + 0x8C1C0106, // 000B GETMET R7 R0 K6 + 0x50240000, // 000C LDBOOL R9 0 0 + 0x7C1C0400, // 000D CALL R7 2 + 0x8C1C0107, // 000E GETMET R7 R0 K7 + 0x58240008, // 000F LDCONST R9 K8 + 0x58280005, // 0010 LDCONST R10 K5 + 0x7C1C0600, // 0011 CALL R7 3 + 0x501C0200, // 0012 LDBOOL R7 1 0 + 0x80040E00, // 0013 RET 1 R7 + 0x7002001D, // 0014 JMP #0033 + 0x1C1C0D09, // 0015 EQ R7 R6 K9 + 0x781E0009, // 0016 JMPF R7 #0021 + 0x8C1C0106, // 0017 GETMET R7 R0 K6 + 0x50240200, // 0018 LDBOOL R9 1 0 + 0x7C1C0400, // 0019 CALL R7 2 + 0x8C1C0107, // 001A GETMET R7 R0 K7 + 0x58240008, // 001B LDCONST R9 K8 + 0x58280009, // 001C LDCONST R10 K9 + 0x7C1C0600, // 001D CALL R7 3 + 0x501C0200, // 001E LDBOOL R7 1 0 + 0x80040E00, // 001F RET 1 R7 + 0x70020011, // 0020 JMP #0033 + 0x1C1C0D0A, // 0021 EQ R7 R6 K10 + 0x781E000F, // 0022 JMPF R7 #0033 + 0x8C1C0106, // 0023 GETMET R7 R0 K6 + 0x8824010B, // 0024 GETMBR R9 R0 K11 + 0x78260000, // 0025 JMPF R9 #0027 + 0x50240001, // 0026 LDBOOL R9 0 1 + 0x50240200, // 0027 LDBOOL R9 1 0 + 0x7C1C0400, // 0028 CALL R7 2 + 0x8C1C0107, // 0029 GETMET R7 R0 K7 + 0x58240008, // 002A LDCONST R9 K8 + 0x8828010B, // 002B GETMBR R10 R0 K11 + 0x782A0001, // 002C JMPF R10 #002F + 0x58280009, // 002D LDCONST R10 K9 + 0x70020000, // 002E JMP #0030 + 0x58280005, // 002F LDCONST R10 K5 + 0x7C1C0600, // 0030 CALL R7 3 + 0x501C0200, // 0031 LDBOOL R7 1 0 + 0x80040E00, // 0032 RET 1 R7 + 0x80000000, // 0033 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: update_virtual +********************************************************************/ +be_local_closure(Matter_Plugin_OnOff_update_virtual, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(find), + /* K1 */ be_nested_str_weak(Power), + /* K2 */ be_nested_str_weak(set_onoff), + /* K3 */ be_nested_str_weak(update_virtual), + }), + be_str_weak(update_virtual), + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x8C080300, // 0000 GETMET R2 R1 K0 + 0x58100001, // 0001 LDCONST R4 K1 + 0x7C080400, // 0002 CALL R2 2 + 0x4C0C0000, // 0003 LDNIL R3 + 0x200C0403, // 0004 NE R3 R2 R3 + 0x780E0004, // 0005 JMPF R3 #000B + 0x8C0C0102, // 0006 GETMET R3 R0 K2 + 0x60140017, // 0007 GETGBL R5 G23 + 0x5C180400, // 0008 MOVE R6 R2 + 0x7C140200, // 0009 CALL R5 1 + 0x7C0C0400, // 000A CALL R3 2 + 0x600C0003, // 000B GETGBL R3 G3 + 0x5C100000, // 000C MOVE R4 R0 + 0x7C0C0200, // 000D CALL R3 1 + 0x8C0C0703, // 000E GETMET R3 R3 K3 + 0x5C140200, // 000F MOVE R5 R1 + 0x7C0C0400, // 0010 CALL R3 2 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: read_attribute +********************************************************************/ +be_local_closure(Matter_Plugin_OnOff_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[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(attribute), + /* K4 */ be_nested_str_weak(update_shadow_lazy), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(set), + /* K7 */ be_nested_str_weak(BOOL), + /* K8 */ be_nested_str_weak(shadow_onoff), + /* K9 */ be_nested_str_weak(U4), + /* K10 */ be_nested_str_weak(read_attribute), + }), + be_str_weak(read_attribute), + &be_const_str_solidified, + ( &(const binstruction[45]) { /* code */ + 0xB8120000, // 0000 GETNGBL R4 K0 + 0x88100901, // 0001 GETMBR R4 R4 K1 + 0x88140502, // 0002 GETMBR R5 R2 K2 + 0x88180503, // 0003 GETMBR R6 R2 K3 + 0x541E0005, // 0004 LDINT R7 6 + 0x1C1C0A07, // 0005 EQ R7 R5 R7 + 0x781E001B, // 0006 JMPF R7 #0023 + 0x8C1C0104, // 0007 GETMET R7 R0 K4 + 0x7C1C0200, // 0008 CALL R7 1 + 0x1C1C0D05, // 0009 EQ R7 R6 K5 + 0x781E0005, // 000A JMPF R7 #0011 + 0x8C1C0706, // 000B GETMET R7 R3 K6 + 0x88240907, // 000C GETMBR R9 R4 K7 + 0x88280108, // 000D GETMBR R10 R0 K8 + 0x7C1C0600, // 000E CALL R7 3 + 0x80040E00, // 000F RET 1 R7 + 0x70020010, // 0010 JMP #0022 + 0x541EFFFB, // 0011 LDINT R7 65532 + 0x1C1C0C07, // 0012 EQ R7 R6 R7 + 0x781E0005, // 0013 JMPF R7 #001A + 0x8C1C0706, // 0014 GETMET R7 R3 K6 + 0x88240909, // 0015 GETMBR R9 R4 K9 + 0x58280005, // 0016 LDCONST R10 K5 + 0x7C1C0600, // 0017 CALL R7 3 + 0x80040E00, // 0018 RET 1 R7 + 0x70020007, // 0019 JMP #0022 + 0x541EFFFC, // 001A LDINT R7 65533 + 0x1C1C0C07, // 001B EQ R7 R6 R7 + 0x781E0004, // 001C JMPF R7 #0022 + 0x8C1C0706, // 001D GETMET R7 R3 K6 + 0x88240909, // 001E GETMBR R9 R4 K9 + 0x542A0003, // 001F LDINT R10 4 + 0x7C1C0600, // 0020 CALL R7 3 + 0x80040E00, // 0021 RET 1 R7 + 0x70020008, // 0022 JMP #002C + 0x601C0003, // 0023 GETGBL R7 G3 + 0x5C200000, // 0024 MOVE R8 R0 + 0x7C1C0200, // 0025 CALL R7 1 + 0x8C1C0F0A, // 0026 GETMET R7 R7 K10 + 0x5C240200, // 0027 MOVE R9 R1 + 0x5C280400, // 0028 MOVE R10 R2 + 0x5C2C0600, // 0029 MOVE R11 R3 + 0x7C1C0800, // 002A CALL R7 4 + 0x80040E00, // 002B RET 1 R7 + 0x80000000, // 002C RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: init ********************************************************************/ @@ -441,32 +414,26 @@ be_local_closure(Matter_Plugin_OnOff_init, /* name */ /******************************************************************** -** Solidified function: append_state_json +** Solidified function: ********************************************************************/ -be_local_closure(Matter_Plugin_OnOff_append_state_json, /* name */ +be_local_closure(Matter_Plugin_OnOff__X3Clambda_X3E, /* name */ be_nested_proto( - 5, /* nstack */ + 3, /* nstack */ 1, /* argc */ - 2, /* varg */ + 0, /* 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(_X2C_X22Power_X22_X3A_X25s), - /* K1 */ be_nested_str_weak(shadow_onoff), - }), - be_str_weak(append_state_json), + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(_X3Clambda_X3E), &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0x60040018, // 0000 GETGBL R1 G24 - 0x58080000, // 0001 LDCONST R2 K0 - 0x600C0009, // 0002 GETGBL R3 G9 - 0x88100101, // 0003 GETMBR R4 R0 K1 - 0x7C0C0200, // 0004 CALL R3 1 - 0x7C040400, // 0005 CALL R1 2 - 0x80040200, // 0006 RET 1 R1 + ( &(const binstruction[ 4]) { /* code */ + 0x60040009, // 0000 GETGBL R1 G9 + 0x5C080000, // 0001 MOVE R2 R0 + 0x7C040200, // 0002 CALL R1 1 + 0x80040200, // 0003 RET 1 R1 }) ) ); @@ -480,20 +447,25 @@ extern const bclass be_class_Matter_Plugin_Device; be_local_class(Matter_Plugin_OnOff, 1, &be_class_Matter_Plugin_Device, - be_nested_map(18, + be_nested_map(17, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(UPDATE_TIME, -1), be_const_int(250) }, - { be_const_key_weak(TYPE, -1), be_nested_str_weak(relay) }, - { 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(266, -1), be_const_int(2) }, - })) ) } )) }, + { be_const_key_weak(NAME, -1), be_nested_str_weak(Relay) }, { be_const_key_weak(UPDATE_COMMANDS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { be_const_list( * be_nested_list(1, ( (struct bvalue*) &(const bvalue[]) { be_nested_str_weak(Power), })) ) } )) }, + { be_const_key_weak(ARG_HINT, 0), be_nested_str_weak(Relay_X3Cx_X3E_X20number) }, + { be_const_key_weak(set_onoff, -1), be_const_closure(Matter_Plugin_OnOff_set_onoff_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(266, -1), be_const_int(2) }, + })) ) } )) }, + { be_const_key_weak(parse_configuration, -1), be_const_closure(Matter_Plugin_OnOff_parse_configuration_closure) }, + { be_const_key_weak(update_shadow, -1), be_const_closure(Matter_Plugin_OnOff_update_shadow_closure) }, + { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_OnOff_invoke_request_closure) }, + { be_const_key_weak(ARG, 13), be_nested_str_weak(relay) }, { be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(6, ( (struct bmapnode*) &(const bmapnode[]) { @@ -553,18 +525,12 @@ be_local_class(Matter_Plugin_OnOff, be_const_int(65533), })) ) } )) }, })) ) } )) }, - { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_OnOff_invoke_request_closure) }, - { be_const_key_weak(read_attribute, 16), be_const_closure(Matter_Plugin_OnOff_read_attribute_closure) }, - { be_const_key_weak(update_shadow, 14), be_const_closure(Matter_Plugin_OnOff_update_shadow_closure) }, + { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_OnOff_read_attribute_closure) }, + { be_const_key_weak(UPDATE_TIME, 12), be_const_int(250) }, + { be_const_key_weak(ARG_TYPE, 10), be_const_static_closure(Matter_Plugin_OnOff__X3Clambda_X3E_closure) }, { be_const_key_weak(update_virtual, -1), be_const_closure(Matter_Plugin_OnOff_update_virtual_closure) }, - { be_const_key_weak(ARG_HINT, 11), be_nested_str_weak(Relay_X3Cx_X3E_X20number) }, - { be_const_key_weak(ARG_TYPE, 13), be_const_static_closure(Matter_Plugin_OnOff__X3Clambda_X3E_closure) }, - { be_const_key_weak(ARG, -1), be_nested_str_weak(relay) }, - { be_const_key_weak(NAME, -1), be_nested_str_weak(Relay) }, - { be_const_key_weak(append_state_json, -1), be_const_closure(Matter_Plugin_OnOff_append_state_json_closure) }, - { be_const_key_weak(parse_configuration, -1), be_const_closure(Matter_Plugin_OnOff_parse_configuration_closure) }, - { be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_OnOff_init_closure) }, - { be_const_key_weak(set_onoff, -1), be_const_closure(Matter_Plugin_OnOff_set_onoff_closure) }, + { be_const_key_weak(TYPE, -1), be_nested_str_weak(relay) }, + { be_const_key_weak(init, 1), be_const_closure(Matter_Plugin_OnOff_init_closure) }, { be_const_key_weak(tasmota_relay_index, -1), be_const_var(0) }, })), be_str_weak(Matter_Plugin_OnOff) diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Shutter.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Shutter.h index 5ef865a76..7929e6498 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Shutter.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Shutter.h @@ -269,11 +269,83 @@ be_local_closure(Matter_Plugin_Shutter__X3Clambda_X3E, /* name */ /******************************************************************** -** Solidified function: append_state_json +** Solidified function: update_inverted ********************************************************************/ -be_local_closure(Matter_Plugin_Shutter_append_state_json, /* name */ +be_local_closure(Matter_Plugin_Shutter_update_inverted, /* name */ be_nested_proto( 6, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[11]) { /* constants */ + /* K0 */ be_nested_str_weak(shadow_shutter_inverted), + /* K1 */ be_nested_str_weak(tasmota), + /* K2 */ be_nested_str_weak(cmd), + /* K3 */ be_nested_str_weak(Status_X2013), + /* K4 */ be_nested_str_weak(contains), + /* K5 */ be_nested_str_weak(StatusSHT), + /* K6 */ be_nested_str_weak(find), + /* K7 */ be_nested_str_weak(SHT), + /* K8 */ be_nested_str_weak(tasmota_shutter_index), + /* K9 */ be_nested_str_weak(Opt), + /* K10 */ be_const_int(1), + }), + be_str_weak(update_inverted), + &be_const_str_solidified, + ( &(const binstruction[37]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x5409FFFE, // 0001 LDINT R2 -1 + 0x1C040202, // 0002 EQ R1 R1 R2 + 0x7806001F, // 0003 JMPF R1 #0024 + 0xB8060200, // 0004 GETNGBL R1 K1 + 0x8C040302, // 0005 GETMET R1 R1 K2 + 0x580C0003, // 0006 LDCONST R3 K3 + 0x50100200, // 0007 LDBOOL R4 1 0 + 0x7C040600, // 0008 CALL R1 3 + 0x8C080304, // 0009 GETMET R2 R1 K4 + 0x58100005, // 000A LDCONST R4 K5 + 0x7C080400, // 000B CALL R2 2 + 0x780A0016, // 000C JMPF R2 #0024 + 0x94040305, // 000D GETIDX R1 R1 K5 + 0x8C080306, // 000E GETMET R2 R1 K6 + 0x60100008, // 000F GETGBL R4 G8 + 0x88140108, // 0010 GETMBR R5 R0 K8 + 0x7C100200, // 0011 CALL R4 1 + 0x00120E04, // 0012 ADD R4 K7 R4 + 0x60140013, // 0013 GETGBL R5 G19 + 0x7C140000, // 0014 CALL R5 0 + 0x7C080600, // 0015 CALL R2 3 + 0x8C080506, // 0016 GETMET R2 R2 K6 + 0x58100009, // 0017 LDCONST R4 K9 + 0x7C080400, // 0018 CALL R2 2 + 0x4C0C0000, // 0019 LDNIL R3 + 0x200C0403, // 001A NE R3 R2 R3 + 0x780E0007, // 001B JMPF R3 #0024 + 0x600C0009, // 001C GETGBL R3 G9 + 0x6010000C, // 001D GETGBL R4 G12 + 0x5C140400, // 001E MOVE R5 R2 + 0x7C100200, // 001F CALL R4 1 + 0x0410090A, // 0020 SUB R4 R4 K10 + 0x94100404, // 0021 GETIDX R4 R2 R4 + 0x7C0C0200, // 0022 CALL R3 1 + 0x90020003, // 0023 SETMBR R0 K0 R3 + 0x80000000, // 0024 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: parse_sensors +********************************************************************/ +be_local_closure(Matter_Plugin_Shutter_parse_sensors, /* name */ + be_nested_proto( + 11, /* nstack */ 2, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -281,20 +353,129 @@ be_local_closure(Matter_Plugin_Shutter_append_state_json, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_weak(_X2C_X22ShutterPos_X22_X3A_X25s_X2C_X22ShutterTarget_X22_X3A_X25s), - /* K1 */ be_nested_str_weak(shadow_shutter_pos), - /* K2 */ be_nested_str_weak(shadow_shutter_target), + ( &(const bvalue[12]) { /* constants */ + /* K0 */ be_nested_str_weak(Shutter), + /* K1 */ be_nested_str_weak(tasmota_shutter_index), + /* K2 */ be_const_int(1), + /* K3 */ be_nested_str_weak(contains), + /* K4 */ be_nested_str_weak(find), + /* K5 */ be_nested_str_weak(Position), + /* K6 */ be_nested_str_weak(shadow_shutter_pos), + /* K7 */ be_nested_str_weak(attribute_updated), + /* K8 */ be_nested_str_weak(Direction), + /* K9 */ be_nested_str_weak(shadow_shutter_direction), + /* K10 */ be_nested_str_weak(Target), + /* K11 */ be_nested_str_weak(shadow_shutter_target), }), - be_str_weak(append_state_json), + be_str_weak(parse_sensors), &be_const_str_solidified, - ( &(const binstruction[ 6]) { /* code */ - 0x60080018, // 0000 GETGBL R2 G24 - 0x580C0000, // 0001 LDCONST R3 K0 - 0x88100101, // 0002 GETMBR R4 R0 K1 - 0x88140102, // 0003 GETMBR R5 R0 K2 - 0x7C080600, // 0004 CALL R2 3 - 0x80040400, // 0005 RET 1 R2 + ( &(const binstruction[53]) { /* code */ + 0x60080008, // 0000 GETGBL R2 G8 + 0x880C0101, // 0001 GETMBR R3 R0 K1 + 0x000C0702, // 0002 ADD R3 R3 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x000A0002, // 0004 ADD R2 K0 R2 + 0x8C0C0303, // 0005 GETMET R3 R1 K3 + 0x5C140400, // 0006 MOVE R5 R2 + 0x7C0C0400, // 0007 CALL R3 2 + 0x780E002A, // 0008 JMPF R3 #0034 + 0x940C0202, // 0009 GETIDX R3 R1 R2 + 0x8C100704, // 000A GETMET R4 R3 K4 + 0x58180005, // 000B LDCONST R6 K5 + 0x7C100400, // 000C CALL R4 2 + 0x4C140000, // 000D LDNIL R5 + 0x20140805, // 000E NE R5 R4 R5 + 0x78160007, // 000F JMPF R5 #0018 + 0x88140106, // 0010 GETMBR R5 R0 K6 + 0x20140805, // 0011 NE R5 R4 R5 + 0x78160003, // 0012 JMPF R5 #0017 + 0x8C140107, // 0013 GETMET R5 R0 K7 + 0x541E0101, // 0014 LDINT R7 258 + 0x5422000D, // 0015 LDINT R8 14 + 0x7C140600, // 0016 CALL R5 3 + 0x90020C04, // 0017 SETMBR R0 K6 R4 + 0x8C140704, // 0018 GETMET R5 R3 K4 + 0x581C0008, // 0019 LDCONST R7 K8 + 0x7C140400, // 001A CALL R5 2 + 0x4C180000, // 001B LDNIL R6 + 0x20180A06, // 001C NE R6 R5 R6 + 0x781A0007, // 001D JMPF R6 #0026 + 0x88180109, // 001E GETMBR R6 R0 K9 + 0x20180A06, // 001F NE R6 R5 R6 + 0x781A0003, // 0020 JMPF R6 #0025 + 0x8C180107, // 0021 GETMET R6 R0 K7 + 0x54220101, // 0022 LDINT R8 258 + 0x54260009, // 0023 LDINT R9 10 + 0x7C180600, // 0024 CALL R6 3 + 0x90021205, // 0025 SETMBR R0 K9 R5 + 0x8C180704, // 0026 GETMET R6 R3 K4 + 0x5820000A, // 0027 LDCONST R8 K10 + 0x7C180400, // 0028 CALL R6 2 + 0x4C1C0000, // 0029 LDNIL R7 + 0x201C0C07, // 002A NE R7 R6 R7 + 0x781E0007, // 002B JMPF R7 #0034 + 0x881C010B, // 002C GETMBR R7 R0 K11 + 0x201C0C07, // 002D NE R7 R6 R7 + 0x781E0003, // 002E JMPF R7 #0033 + 0x8C1C0107, // 002F GETMET R7 R0 K7 + 0x54260101, // 0030 LDINT R9 258 + 0x542A000A, // 0031 LDINT R10 11 + 0x7C1C0600, // 0032 CALL R7 3 + 0x90021606, // 0033 SETMBR R0 K11 R6 + 0x80000000, // 0034 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: update_shadow +********************************************************************/ +be_local_closure(Matter_Plugin_Shutter_update_shadow, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(update_inverted), + /* K1 */ be_nested_str_weak(tasmota), + /* K2 */ be_nested_str_weak(cmd), + /* K3 */ be_nested_str_weak(ShutterPosition), + /* K4 */ be_nested_str_weak(tasmota_shutter_index), + /* K5 */ be_const_int(1), + /* K6 */ be_nested_str_weak(parse_sensors), + /* K7 */ be_nested_str_weak(update_shadow), + }), + be_str_weak(update_shadow), + &be_const_str_solidified, + ( &(const binstruction[21]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x7C040200, // 0001 CALL R1 1 + 0xB8060200, // 0002 GETNGBL R1 K1 + 0x8C040302, // 0003 GETMET R1 R1 K2 + 0x600C0008, // 0004 GETGBL R3 G8 + 0x88100104, // 0005 GETMBR R4 R0 K4 + 0x00100905, // 0006 ADD R4 R4 K5 + 0x7C0C0200, // 0007 CALL R3 1 + 0x000E0603, // 0008 ADD R3 K3 R3 + 0x50100200, // 0009 LDBOOL R4 1 0 + 0x7C040600, // 000A CALL R1 3 + 0x78060002, // 000B JMPF R1 #000F + 0x8C080106, // 000C GETMET R2 R0 K6 + 0x5C100200, // 000D MOVE R4 R1 + 0x7C080400, // 000E CALL R2 2 + 0x60080003, // 000F GETGBL R2 G3 + 0x5C0C0000, // 0010 MOVE R3 R0 + 0x7C080200, // 0011 CALL R2 1 + 0x8C080507, // 0012 GETMET R2 R2 K7 + 0x7C080200, // 0013 CALL R2 1 + 0x80000000, // 0014 RET 0 }) ) ); @@ -465,245 +646,23 @@ be_local_closure(Matter_Plugin_Shutter_invoke_request, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: update_inverted -********************************************************************/ -be_local_closure(Matter_Plugin_Shutter_update_inverted, /* name */ - be_nested_proto( - 6, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[11]) { /* constants */ - /* K0 */ be_nested_str_weak(shadow_shutter_inverted), - /* K1 */ be_nested_str_weak(tasmota), - /* K2 */ be_nested_str_weak(cmd), - /* K3 */ be_nested_str_weak(Status_X2013), - /* K4 */ be_nested_str_weak(contains), - /* K5 */ be_nested_str_weak(StatusSHT), - /* K6 */ be_nested_str_weak(find), - /* K7 */ be_nested_str_weak(SHT), - /* K8 */ be_nested_str_weak(tasmota_shutter_index), - /* K9 */ be_nested_str_weak(Opt), - /* K10 */ be_const_int(1), - }), - be_str_weak(update_inverted), - &be_const_str_solidified, - ( &(const binstruction[37]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x5409FFFE, // 0001 LDINT R2 -1 - 0x1C040202, // 0002 EQ R1 R1 R2 - 0x7806001F, // 0003 JMPF R1 #0024 - 0xB8060200, // 0004 GETNGBL R1 K1 - 0x8C040302, // 0005 GETMET R1 R1 K2 - 0x580C0003, // 0006 LDCONST R3 K3 - 0x50100200, // 0007 LDBOOL R4 1 0 - 0x7C040600, // 0008 CALL R1 3 - 0x8C080304, // 0009 GETMET R2 R1 K4 - 0x58100005, // 000A LDCONST R4 K5 - 0x7C080400, // 000B CALL R2 2 - 0x780A0016, // 000C JMPF R2 #0024 - 0x94040305, // 000D GETIDX R1 R1 K5 - 0x8C080306, // 000E GETMET R2 R1 K6 - 0x60100008, // 000F GETGBL R4 G8 - 0x88140108, // 0010 GETMBR R5 R0 K8 - 0x7C100200, // 0011 CALL R4 1 - 0x00120E04, // 0012 ADD R4 K7 R4 - 0x60140013, // 0013 GETGBL R5 G19 - 0x7C140000, // 0014 CALL R5 0 - 0x7C080600, // 0015 CALL R2 3 - 0x8C080506, // 0016 GETMET R2 R2 K6 - 0x58100009, // 0017 LDCONST R4 K9 - 0x7C080400, // 0018 CALL R2 2 - 0x4C0C0000, // 0019 LDNIL R3 - 0x200C0403, // 001A NE R3 R2 R3 - 0x780E0007, // 001B JMPF R3 #0024 - 0x600C0009, // 001C GETGBL R3 G9 - 0x6010000C, // 001D GETGBL R4 G12 - 0x5C140400, // 001E MOVE R5 R2 - 0x7C100200, // 001F CALL R4 1 - 0x0410090A, // 0020 SUB R4 R4 K10 - 0x94100404, // 0021 GETIDX R4 R2 R4 - 0x7C0C0200, // 0022 CALL R3 1 - 0x90020003, // 0023 SETMBR R0 K0 R3 - 0x80000000, // 0024 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: update_shadow -********************************************************************/ -be_local_closure(Matter_Plugin_Shutter_update_shadow, /* name */ - be_nested_proto( - 5, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 8]) { /* constants */ - /* K0 */ be_nested_str_weak(update_inverted), - /* K1 */ be_nested_str_weak(tasmota), - /* K2 */ be_nested_str_weak(cmd), - /* K3 */ be_nested_str_weak(ShutterPosition), - /* K4 */ be_nested_str_weak(tasmota_shutter_index), - /* K5 */ be_const_int(1), - /* K6 */ be_nested_str_weak(parse_sensors), - /* K7 */ be_nested_str_weak(update_shadow), - }), - be_str_weak(update_shadow), - &be_const_str_solidified, - ( &(const binstruction[21]) { /* code */ - 0x8C040100, // 0000 GETMET R1 R0 K0 - 0x7C040200, // 0001 CALL R1 1 - 0xB8060200, // 0002 GETNGBL R1 K1 - 0x8C040302, // 0003 GETMET R1 R1 K2 - 0x600C0008, // 0004 GETGBL R3 G8 - 0x88100104, // 0005 GETMBR R4 R0 K4 - 0x00100905, // 0006 ADD R4 R4 K5 - 0x7C0C0200, // 0007 CALL R3 1 - 0x000E0603, // 0008 ADD R3 K3 R3 - 0x50100200, // 0009 LDBOOL R4 1 0 - 0x7C040600, // 000A CALL R1 3 - 0x78060002, // 000B JMPF R1 #000F - 0x8C080106, // 000C GETMET R2 R0 K6 - 0x5C100200, // 000D MOVE R4 R1 - 0x7C080400, // 000E CALL R2 2 - 0x60080003, // 000F GETGBL R2 G3 - 0x5C0C0000, // 0010 MOVE R3 R0 - 0x7C080200, // 0011 CALL R2 1 - 0x8C080507, // 0012 GETMET R2 R2 K7 - 0x7C080200, // 0013 CALL R2 1 - 0x80000000, // 0014 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: parse_sensors -********************************************************************/ -be_local_closure(Matter_Plugin_Shutter_parse_sensors, /* name */ - be_nested_proto( - 11, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[12]) { /* constants */ - /* K0 */ be_nested_str_weak(Shutter), - /* K1 */ be_nested_str_weak(tasmota_shutter_index), - /* K2 */ be_const_int(1), - /* K3 */ be_nested_str_weak(contains), - /* K4 */ be_nested_str_weak(find), - /* K5 */ be_nested_str_weak(Position), - /* K6 */ be_nested_str_weak(shadow_shutter_pos), - /* K7 */ be_nested_str_weak(attribute_updated), - /* K8 */ be_nested_str_weak(Direction), - /* K9 */ be_nested_str_weak(shadow_shutter_direction), - /* K10 */ be_nested_str_weak(Target), - /* K11 */ be_nested_str_weak(shadow_shutter_target), - }), - be_str_weak(parse_sensors), - &be_const_str_solidified, - ( &(const binstruction[53]) { /* code */ - 0x60080008, // 0000 GETGBL R2 G8 - 0x880C0101, // 0001 GETMBR R3 R0 K1 - 0x000C0702, // 0002 ADD R3 R3 K2 - 0x7C080200, // 0003 CALL R2 1 - 0x000A0002, // 0004 ADD R2 K0 R2 - 0x8C0C0303, // 0005 GETMET R3 R1 K3 - 0x5C140400, // 0006 MOVE R5 R2 - 0x7C0C0400, // 0007 CALL R3 2 - 0x780E002A, // 0008 JMPF R3 #0034 - 0x940C0202, // 0009 GETIDX R3 R1 R2 - 0x8C100704, // 000A GETMET R4 R3 K4 - 0x58180005, // 000B LDCONST R6 K5 - 0x7C100400, // 000C CALL R4 2 - 0x4C140000, // 000D LDNIL R5 - 0x20140805, // 000E NE R5 R4 R5 - 0x78160007, // 000F JMPF R5 #0018 - 0x88140106, // 0010 GETMBR R5 R0 K6 - 0x20140805, // 0011 NE R5 R4 R5 - 0x78160003, // 0012 JMPF R5 #0017 - 0x8C140107, // 0013 GETMET R5 R0 K7 - 0x541E0101, // 0014 LDINT R7 258 - 0x5422000D, // 0015 LDINT R8 14 - 0x7C140600, // 0016 CALL R5 3 - 0x90020C04, // 0017 SETMBR R0 K6 R4 - 0x8C140704, // 0018 GETMET R5 R3 K4 - 0x581C0008, // 0019 LDCONST R7 K8 - 0x7C140400, // 001A CALL R5 2 - 0x4C180000, // 001B LDNIL R6 - 0x20180A06, // 001C NE R6 R5 R6 - 0x781A0007, // 001D JMPF R6 #0026 - 0x88180109, // 001E GETMBR R6 R0 K9 - 0x20180A06, // 001F NE R6 R5 R6 - 0x781A0003, // 0020 JMPF R6 #0025 - 0x8C180107, // 0021 GETMET R6 R0 K7 - 0x54220101, // 0022 LDINT R8 258 - 0x54260009, // 0023 LDINT R9 10 - 0x7C180600, // 0024 CALL R6 3 - 0x90021205, // 0025 SETMBR R0 K9 R5 - 0x8C180704, // 0026 GETMET R6 R3 K4 - 0x5820000A, // 0027 LDCONST R8 K10 - 0x7C180400, // 0028 CALL R6 2 - 0x4C1C0000, // 0029 LDNIL R7 - 0x201C0C07, // 002A NE R7 R6 R7 - 0x781E0007, // 002B JMPF R7 #0034 - 0x881C010B, // 002C GETMBR R7 R0 K11 - 0x201C0C07, // 002D NE R7 R6 R7 - 0x781E0003, // 002E JMPF R7 #0033 - 0x8C1C0107, // 002F GETMET R7 R0 K7 - 0x54260101, // 0030 LDINT R9 258 - 0x542A000A, // 0031 LDINT R10 11 - 0x7C1C0600, // 0032 CALL R7 3 - 0x90021606, // 0033 SETMBR R0 K11 R6 - 0x80000000, // 0034 RET 0 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified class: Matter_Plugin_Shutter ********************************************************************/ extern const bclass be_class_Matter_Plugin_Device; be_local_class(Matter_Plugin_Shutter, - 6, + 5, &be_class_Matter_Plugin_Device, - be_nested_map(20, + be_nested_map(18, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Shutter_read_attribute_closure) }, - { be_const_key_weak(shadow_shutter_direction, 3), be_const_var(4) }, - { be_const_key_weak(shadow_shutter_pos, 0), be_const_var(1) }, - { be_const_key_weak(ARG_HINT, -1), be_nested_str_weak(Relay_X3Cx_X3E_X20number) }, - { be_const_key_weak(ARG_TYPE, -1), be_const_static_closure(Matter_Plugin_Shutter__X3Clambda_X3E_closure) }, - { be_const_key_weak(shadow_shutter_inverted, 1), be_const_var(5) }, - { be_const_key_weak(append_state_json, -1), be_const_closure(Matter_Plugin_Shutter_append_state_json_closure) }, - { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Shutter_invoke_request_closure) }, - { be_const_key_weak(parse_sensors, -1), be_const_closure(Matter_Plugin_Shutter_parse_sensors_closure) }, - { be_const_key_weak(parse_configuration, 17), be_const_closure(Matter_Plugin_Shutter_parse_configuration_closure) }, + { be_const_key_weak(shadow_shutter_inverted, -1), be_const_var(4) }, + { be_const_key_weak(TYPE, -1), be_nested_str_weak(shutter) }, { 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(514, -1), be_const_int(2) }, })) ) } )) }, - { be_const_key_weak(shadow_shutter_target, -1), be_const_var(2) }, + { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Shutter_invoke_request_closure) }, { be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(6, ( (struct bmapnode*) &(const bmapnode[]) { @@ -770,13 +729,19 @@ be_local_class(Matter_Plugin_Shutter, be_const_int(65533), })) ) } )) }, })) ) } )) }, - { be_const_key_weak(tasmota_shutter_index, 11), be_const_var(0) }, - { be_const_key_weak(NAME, 12), be_nested_str_weak(Shutter) }, - { be_const_key_weak(shadow_shutter_tilt, -1), be_const_var(3) }, - { be_const_key_weak(update_inverted, 8), be_const_closure(Matter_Plugin_Shutter_update_inverted_closure) }, - { be_const_key_weak(update_shadow, 18), be_const_closure(Matter_Plugin_Shutter_update_shadow_closure) }, - { be_const_key_weak(TYPE, -1), be_nested_str_weak(shutter) }, - { be_const_key_weak(ARG, -1), be_nested_str_weak(shutter) }, + { be_const_key_weak(shadow_shutter_target, 3), be_const_var(2) }, + { be_const_key_weak(read_attribute, 14), be_const_closure(Matter_Plugin_Shutter_read_attribute_closure) }, + { be_const_key_weak(parse_configuration, 13), be_const_closure(Matter_Plugin_Shutter_parse_configuration_closure) }, + { be_const_key_weak(shadow_shutter_pos, -1), be_const_var(1) }, + { be_const_key_weak(ARG, 16), be_nested_str_weak(shutter) }, + { be_const_key_weak(ARG_TYPE, -1), be_const_static_closure(Matter_Plugin_Shutter__X3Clambda_X3E_closure) }, + { be_const_key_weak(NAME, -1), be_nested_str_weak(Shutter) }, + { be_const_key_weak(update_inverted, 11), be_const_closure(Matter_Plugin_Shutter_update_inverted_closure) }, + { be_const_key_weak(update_shadow, 0), be_const_closure(Matter_Plugin_Shutter_update_shadow_closure) }, + { be_const_key_weak(parse_sensors, -1), be_const_closure(Matter_Plugin_Shutter_parse_sensors_closure) }, + { be_const_key_weak(tasmota_shutter_index, -1), be_const_var(0) }, + { be_const_key_weak(ARG_HINT, -1), be_nested_str_weak(Relay_X3Cx_X3E_X20number) }, + { be_const_key_weak(shadow_shutter_direction, -1), be_const_var(3) }, })), be_str_weak(Matter_Plugin_Shutter) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Light1.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Light1.h index 3b38cdf61..9a906a894 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Light1.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Light1.h @@ -107,6 +107,116 @@ be_local_closure(Matter_Plugin_Light1_set_bri, /* 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 +********************************************************************/ +be_local_closure(Matter_Plugin_Light1_init, /* name */ + be_nested_proto( + 9, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(init), + /* K1 */ be_nested_str_weak(shadow_bri), + /* K2 */ be_const_int(0), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[10]) { /* code */ + 0x60100003, // 0000 GETGBL R4 G3 + 0x5C140000, // 0001 MOVE R5 R0 + 0x7C100200, // 0002 CALL R4 1 + 0x8C100900, // 0003 GETMET R4 R4 K0 + 0x5C180200, // 0004 MOVE R6 R1 + 0x5C1C0400, // 0005 MOVE R7 R2 + 0x5C200600, // 0006 MOVE R8 R3 + 0x7C100800, // 0007 CALL R4 4 + 0x90020302, // 0008 SETMBR R0 K1 K2 + 0x80000000, // 0009 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: update_virtual ********************************************************************/ @@ -159,6 +269,123 @@ be_local_closure(Matter_Plugin_Light1_update_virtual, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: read_attribute +********************************************************************/ +be_local_closure(Matter_Plugin_Light1_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_const_int(0), + /* K6 */ be_nested_str_weak(set), + /* K7 */ be_nested_str_weak(U1), + /* K8 */ be_nested_str_weak(shadow_bri), + /* K9 */ be_const_int(2), + /* K10 */ be_const_int(3), + /* K11 */ be_nested_str_weak(U4), + /* K12 */ be_const_int(1), + /* K13 */ be_nested_str_weak(read_attribute), + }), + be_str_weak(read_attribute), + &be_const_str_solidified, + ( &(const binstruction[79]) { /* code */ + 0xB8120000, // 0000 GETNGBL R4 K0 + 0x88100901, // 0001 GETMBR R4 R4 K1 + 0x88140502, // 0002 GETMBR R5 R2 K2 + 0x88180503, // 0003 GETMBR R6 R2 K3 + 0x541E0007, // 0004 LDINT R7 8 + 0x1C1C0A07, // 0005 EQ R7 R5 R7 + 0x781E003D, // 0006 JMPF R7 #0045 + 0x8C1C0104, // 0007 GETMET R7 R0 K4 + 0x7C1C0200, // 0008 CALL R7 1 + 0x1C1C0D05, // 0009 EQ R7 R6 K5 + 0x781E0005, // 000A JMPF R7 #0011 + 0x8C1C0706, // 000B GETMET R7 R3 K6 + 0x88240907, // 000C GETMBR R9 R4 K7 + 0x88280108, // 000D GETMBR R10 R0 K8 + 0x7C1C0600, // 000E CALL R7 3 + 0x80040E00, // 000F RET 1 R7 + 0x70020032, // 0010 JMP #0044 + 0x1C1C0D09, // 0011 EQ R7 R6 K9 + 0x781E0005, // 0012 JMPF R7 #0019 + 0x8C1C0706, // 0013 GETMET R7 R3 K6 + 0x88240907, // 0014 GETMBR R9 R4 K7 + 0x58280005, // 0015 LDCONST R10 K5 + 0x7C1C0600, // 0016 CALL R7 3 + 0x80040E00, // 0017 RET 1 R7 + 0x7002002A, // 0018 JMP #0044 + 0x1C1C0D0A, // 0019 EQ R7 R6 K10 + 0x781E0005, // 001A JMPF R7 #0021 + 0x8C1C0706, // 001B GETMET R7 R3 K6 + 0x88240907, // 001C GETMBR R9 R4 K7 + 0x542A00FD, // 001D LDINT R10 254 + 0x7C1C0600, // 001E CALL R7 3 + 0x80040E00, // 001F RET 1 R7 + 0x70020022, // 0020 JMP #0044 + 0x541E000E, // 0021 LDINT R7 15 + 0x1C1C0C07, // 0022 EQ R7 R6 R7 + 0x781E0005, // 0023 JMPF R7 #002A + 0x8C1C0706, // 0024 GETMET R7 R3 K6 + 0x88240907, // 0025 GETMBR R9 R4 K7 + 0x58280005, // 0026 LDCONST R10 K5 + 0x7C1C0600, // 0027 CALL R7 3 + 0x80040E00, // 0028 RET 1 R7 + 0x70020019, // 0029 JMP #0044 + 0x541E0010, // 002A LDINT R7 17 + 0x1C1C0C07, // 002B EQ R7 R6 R7 + 0x781E0005, // 002C JMPF R7 #0033 + 0x8C1C0706, // 002D GETMET R7 R3 K6 + 0x88240907, // 002E GETMBR R9 R4 K7 + 0x88280108, // 002F GETMBR R10 R0 K8 + 0x7C1C0600, // 0030 CALL R7 3 + 0x80040E00, // 0031 RET 1 R7 + 0x70020010, // 0032 JMP #0044 + 0x541EFFFB, // 0033 LDINT R7 65532 + 0x1C1C0C07, // 0034 EQ R7 R6 R7 + 0x781E0005, // 0035 JMPF R7 #003C + 0x8C1C0706, // 0036 GETMET R7 R3 K6 + 0x8824090B, // 0037 GETMBR R9 R4 K11 + 0x5828000C, // 0038 LDCONST R10 K12 + 0x7C1C0600, // 0039 CALL R7 3 + 0x80040E00, // 003A RET 1 R7 + 0x70020007, // 003B JMP #0044 + 0x541EFFFC, // 003C LDINT R7 65533 + 0x1C1C0C07, // 003D EQ R7 R6 R7 + 0x781E0004, // 003E JMPF R7 #0044 + 0x8C1C0706, // 003F GETMET R7 R3 K6 + 0x8824090B, // 0040 GETMBR R9 R4 K11 + 0x542A0004, // 0041 LDINT R10 5 + 0x7C1C0600, // 0042 CALL R7 3 + 0x80040E00, // 0043 RET 1 R7 + 0x70020008, // 0044 JMP #004E + 0x601C0003, // 0045 GETGBL R7 G3 + 0x5C200000, // 0046 MOVE R8 R0 + 0x7C1C0200, // 0047 CALL R7 1 + 0x8C1C0F0D, // 0048 GETMET R7 R7 K13 + 0x5C240200, // 0049 MOVE R9 R1 + 0x5C280400, // 004A MOVE R10 R2 + 0x5C2C0600, // 004B MOVE R11 R3 + 0x7C1C0800, // 004C CALL R7 4 + 0x80040E00, // 004D RET 1 R7 + 0x80000000, // 004E RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: invoke_request ********************************************************************/ @@ -323,268 +550,6 @@ be_local_closure(Matter_Plugin_Light1_invoke_request, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(Matter_Plugin_Light1_init, /* name */ - be_nested_proto( - 9, /* nstack */ - 4, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_weak(init), - /* K1 */ be_nested_str_weak(shadow_bri), - /* K2 */ be_const_int(0), - }), - be_str_weak(init), - &be_const_str_solidified, - ( &(const binstruction[10]) { /* code */ - 0x60100003, // 0000 GETGBL R4 G3 - 0x5C140000, // 0001 MOVE R5 R0 - 0x7C100200, // 0002 CALL R4 1 - 0x8C100900, // 0003 GETMET R4 R4 K0 - 0x5C180200, // 0004 MOVE R6 R1 - 0x5C1C0400, // 0005 MOVE R7 R2 - 0x5C200600, // 0006 MOVE R8 R3 - 0x7C100800, // 0007 CALL R4 4 - 0x90020302, // 0008 SETMBR R0 K1 K2 - 0x80000000, // 0009 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** 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: append_state_json -********************************************************************/ -be_local_closure(Matter_Plugin_Light1_append_state_json, /* name */ - be_nested_proto( - 5, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_weak(_X2C_X22Power_X22_X3A_X25s_X2C_X22Bri_X22_X3A_X25s), - /* K1 */ be_nested_str_weak(shadow_onoff), - /* K2 */ be_nested_str_weak(shadow_bri), - }), - be_str_weak(append_state_json), - &be_const_str_solidified, - ( &(const binstruction[ 8]) { /* code */ - 0x60040018, // 0000 GETGBL R1 G24 - 0x58080000, // 0001 LDCONST R2 K0 - 0x600C0009, // 0002 GETGBL R3 G9 - 0x88100101, // 0003 GETMBR R4 R0 K1 - 0x7C0C0200, // 0004 CALL R3 1 - 0x88100102, // 0005 GETMBR R4 R0 K2 - 0x7C040600, // 0006 CALL R1 3 - 0x80040200, // 0007 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: read_attribute -********************************************************************/ -be_local_closure(Matter_Plugin_Light1_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_const_int(0), - /* K6 */ be_nested_str_weak(set), - /* K7 */ be_nested_str_weak(U1), - /* K8 */ be_nested_str_weak(shadow_bri), - /* K9 */ be_const_int(2), - /* K10 */ be_const_int(3), - /* K11 */ be_nested_str_weak(U4), - /* K12 */ be_const_int(1), - /* K13 */ be_nested_str_weak(read_attribute), - }), - be_str_weak(read_attribute), - &be_const_str_solidified, - ( &(const binstruction[79]) { /* code */ - 0xB8120000, // 0000 GETNGBL R4 K0 - 0x88100901, // 0001 GETMBR R4 R4 K1 - 0x88140502, // 0002 GETMBR R5 R2 K2 - 0x88180503, // 0003 GETMBR R6 R2 K3 - 0x541E0007, // 0004 LDINT R7 8 - 0x1C1C0A07, // 0005 EQ R7 R5 R7 - 0x781E003D, // 0006 JMPF R7 #0045 - 0x8C1C0104, // 0007 GETMET R7 R0 K4 - 0x7C1C0200, // 0008 CALL R7 1 - 0x1C1C0D05, // 0009 EQ R7 R6 K5 - 0x781E0005, // 000A JMPF R7 #0011 - 0x8C1C0706, // 000B GETMET R7 R3 K6 - 0x88240907, // 000C GETMBR R9 R4 K7 - 0x88280108, // 000D GETMBR R10 R0 K8 - 0x7C1C0600, // 000E CALL R7 3 - 0x80040E00, // 000F RET 1 R7 - 0x70020032, // 0010 JMP #0044 - 0x1C1C0D09, // 0011 EQ R7 R6 K9 - 0x781E0005, // 0012 JMPF R7 #0019 - 0x8C1C0706, // 0013 GETMET R7 R3 K6 - 0x88240907, // 0014 GETMBR R9 R4 K7 - 0x58280005, // 0015 LDCONST R10 K5 - 0x7C1C0600, // 0016 CALL R7 3 - 0x80040E00, // 0017 RET 1 R7 - 0x7002002A, // 0018 JMP #0044 - 0x1C1C0D0A, // 0019 EQ R7 R6 K10 - 0x781E0005, // 001A JMPF R7 #0021 - 0x8C1C0706, // 001B GETMET R7 R3 K6 - 0x88240907, // 001C GETMBR R9 R4 K7 - 0x542A00FD, // 001D LDINT R10 254 - 0x7C1C0600, // 001E CALL R7 3 - 0x80040E00, // 001F RET 1 R7 - 0x70020022, // 0020 JMP #0044 - 0x541E000E, // 0021 LDINT R7 15 - 0x1C1C0C07, // 0022 EQ R7 R6 R7 - 0x781E0005, // 0023 JMPF R7 #002A - 0x8C1C0706, // 0024 GETMET R7 R3 K6 - 0x88240907, // 0025 GETMBR R9 R4 K7 - 0x58280005, // 0026 LDCONST R10 K5 - 0x7C1C0600, // 0027 CALL R7 3 - 0x80040E00, // 0028 RET 1 R7 - 0x70020019, // 0029 JMP #0044 - 0x541E0010, // 002A LDINT R7 17 - 0x1C1C0C07, // 002B EQ R7 R6 R7 - 0x781E0005, // 002C JMPF R7 #0033 - 0x8C1C0706, // 002D GETMET R7 R3 K6 - 0x88240907, // 002E GETMBR R9 R4 K7 - 0x88280108, // 002F GETMBR R10 R0 K8 - 0x7C1C0600, // 0030 CALL R7 3 - 0x80040E00, // 0031 RET 1 R7 - 0x70020010, // 0032 JMP #0044 - 0x541EFFFB, // 0033 LDINT R7 65532 - 0x1C1C0C07, // 0034 EQ R7 R6 R7 - 0x781E0005, // 0035 JMPF R7 #003C - 0x8C1C0706, // 0036 GETMET R7 R3 K6 - 0x8824090B, // 0037 GETMBR R9 R4 K11 - 0x5828000C, // 0038 LDCONST R10 K12 - 0x7C1C0600, // 0039 CALL R7 3 - 0x80040E00, // 003A RET 1 R7 - 0x70020007, // 003B JMP #0044 - 0x541EFFFC, // 003C LDINT R7 65533 - 0x1C1C0C07, // 003D EQ R7 R6 R7 - 0x781E0004, // 003E JMPF R7 #0044 - 0x8C1C0706, // 003F GETMET R7 R3 K6 - 0x8824090B, // 0040 GETMBR R9 R4 K11 - 0x542A0004, // 0041 LDINT R10 5 - 0x7C1C0600, // 0042 CALL R7 3 - 0x80040E00, // 0043 RET 1 R7 - 0x70020008, // 0044 JMP #004E - 0x601C0003, // 0045 GETGBL R7 G3 - 0x5C200000, // 0046 MOVE R8 R0 - 0x7C1C0200, // 0047 CALL R7 1 - 0x8C1C0F0D, // 0048 GETMET R7 R7 K13 - 0x5C240200, // 0049 MOVE R9 R1 - 0x5C280400, // 004A MOVE R10 R2 - 0x5C2C0600, // 004B MOVE R11 R3 - 0x7C1C0800, // 004C CALL R7 4 - 0x80040E00, // 004D RET 1 R7 - 0x80000000, // 004E RET 0 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified class: Matter_Plugin_Light1 ********************************************************************/ @@ -592,19 +557,28 @@ extern const bclass be_class_Matter_Plugin_Light0; be_local_class(Matter_Plugin_Light1, 1, &be_class_Matter_Plugin_Light0, - be_nested_map(13, + be_nested_map(12, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(update_virtual, -1), be_const_closure(Matter_Plugin_Light1_update_virtual_closure) }, - { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Light1_read_attribute_closure) }, - { be_const_key_weak(TYPE, 0), be_nested_str_weak(light1) }, - { be_const_key_weak(append_state_json, -1), be_const_closure(Matter_Plugin_Light1_append_state_json_closure) }, { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Light1_invoke_request_closure) }, - { be_const_key_weak(set_bri, 4), be_const_closure(Matter_Plugin_Light1_set_bri_closure) }, - { be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Light1_init_closure) }, + { be_const_key_weak(TYPE, 7), 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(UPDATE_COMMANDS, 9), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(2, + ( (struct bvalue*) &(const bvalue[]) { + be_nested_str_weak(Power), + be_nested_str_weak(Bri), + })) ) } )) }, { be_const_key_weak(update_shadow, -1), be_const_closure(Matter_Plugin_Light1_update_shadow_closure) }, - { be_const_key_weak(shadow_bri, -1), be_const_var(0) }, - { be_const_key_weak(NAME, -1), be_nested_str_weak(Light_X201_X20Dimmer) }, - { be_const_key_weak(CLUSTERS, 3), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Light1_read_attribute_closure) }, + { be_const_key_weak(NAME, 5), be_nested_str_weak(Light_X201_X20Dimmer) }, + { be_const_key_weak(shadow_bri, 4), be_const_var(0) }, + { be_const_key_weak(update_virtual, -1), be_const_closure(Matter_Plugin_Light1_update_virtual_closure) }, + { be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Light1_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(7, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(29, 2), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { @@ -674,17 +648,7 @@ be_local_class(Matter_Plugin_Light1, be_const_int(65533), })) ) } )) }, })) ) } )) }, - { be_const_key_weak(UPDATE_COMMANDS, 1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { - be_const_list( * be_nested_list(2, - ( (struct bvalue*) &(const bvalue[]) { - be_nested_str_weak(Power), - be_nested_str_weak(Bri), - })) ) } )) }, - { 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(set_bri, 0), 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_3_Sensor_Contact.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Sensor_Contact.h index d9fa04481..326036f23 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Sensor_Contact.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Sensor_Contact.h @@ -33,88 +33,6 @@ be_local_closure(Matter_Plugin_Sensor_Contact__X3Clambda_X3E, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: update_shadow -********************************************************************/ -be_local_closure(Matter_Plugin_Sensor_Contact_update_shadow, /* name */ - be_nested_proto( - 9, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[13]) { /* constants */ - /* K0 */ be_nested_str_weak(update_shadow), - /* K1 */ be_nested_str_weak(json), - /* K2 */ be_nested_str_weak(tasmota), - /* K3 */ be_nested_str_weak(cmd), - /* K4 */ be_nested_str_weak(Status_X208), - /* K5 */ be_nested_str_weak(load), - /* K6 */ be_nested_str_weak(find), - /* K7 */ be_nested_str_weak(Switch), - /* K8 */ be_nested_str_weak(tasmota_switch_index), - /* K9 */ be_nested_str_weak(ON), - /* K10 */ be_nested_str_weak(shadow_contact), - /* K11 */ be_nested_str_weak(attribute_updated), - /* K12 */ be_const_int(0), - }), - be_str_weak(update_shadow), - &be_const_str_solidified, - ( &(const binstruction[45]) { /* 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 - 0xA4060200, // 0005 IMPORT R1 K1 - 0xB80A0400, // 0006 GETNGBL R2 K2 - 0x8C080503, // 0007 GETMET R2 R2 K3 - 0x58100004, // 0008 LDCONST R4 K4 - 0x50140200, // 0009 LDBOOL R5 1 0 - 0x7C080600, // 000A CALL R2 3 - 0x4C0C0000, // 000B LDNIL R3 - 0x200C0403, // 000C NE R3 R2 R3 - 0x780E001D, // 000D JMPF R3 #002C - 0x8C0C0305, // 000E GETMET R3 R1 K5 - 0x5C140400, // 000F MOVE R5 R2 - 0x7C0C0400, // 0010 CALL R3 2 - 0x4C100000, // 0011 LDNIL R4 - 0x20100604, // 0012 NE R4 R3 R4 - 0x78120017, // 0013 JMPF R4 #002C - 0x50100000, // 0014 LDBOOL R4 0 0 - 0x8C140706, // 0015 GETMET R5 R3 K6 - 0x601C0008, // 0016 GETGBL R7 G8 - 0x88200108, // 0017 GETMBR R8 R0 K8 - 0x7C1C0200, // 0018 CALL R7 1 - 0x001E0E07, // 0019 ADD R7 K7 R7 - 0x7C140400, // 001A CALL R5 2 - 0x1C140B09, // 001B EQ R5 R5 K9 - 0x5C100A00, // 001C MOVE R4 R5 - 0x8814010A, // 001D GETMBR R5 R0 K10 - 0x4C180000, // 001E LDNIL R6 - 0x20140A06, // 001F NE R5 R5 R6 - 0x78160009, // 0020 JMPF R5 #002B - 0x8814010A, // 0021 GETMBR R5 R0 K10 - 0x60180017, // 0022 GETGBL R6 G23 - 0x5C1C0800, // 0023 MOVE R7 R4 - 0x7C180200, // 0024 CALL R6 1 - 0x20140A06, // 0025 NE R5 R5 R6 - 0x78160003, // 0026 JMPF R5 #002B - 0x8C14010B, // 0027 GETMET R5 R0 K11 - 0x541E0044, // 0028 LDINT R7 69 - 0x5820000C, // 0029 LDCONST R8 K12 - 0x7C140600, // 002A CALL R5 3 - 0x90021404, // 002B SETMBR R0 K10 R4 - 0x80000000, // 002C RET 0 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: parse_configuration ********************************************************************/ @@ -246,11 +164,11 @@ be_local_closure(Matter_Plugin_Sensor_Contact_read_attribute, /* name */ /******************************************************************** -** Solidified function: append_state_json +** Solidified function: update_shadow ********************************************************************/ -be_local_closure(Matter_Plugin_Sensor_Contact_append_state_json, /* name */ +be_local_closure(Matter_Plugin_Sensor_Contact_update_shadow, /* name */ be_nested_proto( - 5, /* nstack */ + 9, /* nstack */ 1, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -258,20 +176,69 @@ be_local_closure(Matter_Plugin_Sensor_Contact_append_state_json, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(_X2C_X22Contact_X22_X3A_X25s), - /* K1 */ be_nested_str_weak(shadow_contact), + ( &(const bvalue[13]) { /* constants */ + /* K0 */ be_nested_str_weak(update_shadow), + /* K1 */ be_nested_str_weak(json), + /* K2 */ be_nested_str_weak(tasmota), + /* K3 */ be_nested_str_weak(cmd), + /* K4 */ be_nested_str_weak(Status_X208), + /* K5 */ be_nested_str_weak(load), + /* K6 */ be_nested_str_weak(find), + /* K7 */ be_nested_str_weak(Switch), + /* K8 */ be_nested_str_weak(tasmota_switch_index), + /* K9 */ be_nested_str_weak(ON), + /* K10 */ be_nested_str_weak(shadow_contact), + /* K11 */ be_nested_str_weak(attribute_updated), + /* K12 */ be_const_int(0), }), - be_str_weak(append_state_json), + be_str_weak(update_shadow), &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0x60040018, // 0000 GETGBL R1 G24 - 0x58080000, // 0001 LDCONST R2 K0 - 0x600C0009, // 0002 GETGBL R3 G9 - 0x88100101, // 0003 GETMBR R4 R0 K1 - 0x7C0C0200, // 0004 CALL R3 1 - 0x7C040400, // 0005 CALL R1 2 - 0x80040200, // 0006 RET 1 R1 + ( &(const binstruction[45]) { /* 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 + 0xA4060200, // 0005 IMPORT R1 K1 + 0xB80A0400, // 0006 GETNGBL R2 K2 + 0x8C080503, // 0007 GETMET R2 R2 K3 + 0x58100004, // 0008 LDCONST R4 K4 + 0x50140200, // 0009 LDBOOL R5 1 0 + 0x7C080600, // 000A CALL R2 3 + 0x4C0C0000, // 000B LDNIL R3 + 0x200C0403, // 000C NE R3 R2 R3 + 0x780E001D, // 000D JMPF R3 #002C + 0x8C0C0305, // 000E GETMET R3 R1 K5 + 0x5C140400, // 000F MOVE R5 R2 + 0x7C0C0400, // 0010 CALL R3 2 + 0x4C100000, // 0011 LDNIL R4 + 0x20100604, // 0012 NE R4 R3 R4 + 0x78120017, // 0013 JMPF R4 #002C + 0x50100000, // 0014 LDBOOL R4 0 0 + 0x8C140706, // 0015 GETMET R5 R3 K6 + 0x601C0008, // 0016 GETGBL R7 G8 + 0x88200108, // 0017 GETMBR R8 R0 K8 + 0x7C1C0200, // 0018 CALL R7 1 + 0x001E0E07, // 0019 ADD R7 K7 R7 + 0x7C140400, // 001A CALL R5 2 + 0x1C140B09, // 001B EQ R5 R5 K9 + 0x5C100A00, // 001C MOVE R4 R5 + 0x8814010A, // 001D GETMBR R5 R0 K10 + 0x4C180000, // 001E LDNIL R6 + 0x20140A06, // 001F NE R5 R5 R6 + 0x78160009, // 0020 JMPF R5 #002B + 0x8814010A, // 0021 GETMBR R5 R0 K10 + 0x60180017, // 0022 GETGBL R6 G23 + 0x5C1C0800, // 0023 MOVE R7 R4 + 0x7C180200, // 0024 CALL R6 1 + 0x20140A06, // 0025 NE R5 R5 R6 + 0x78160003, // 0026 JMPF R5 #002B + 0x8C14010B, // 0027 GETMET R5 R0 K11 + 0x541E0044, // 0028 LDINT R7 69 + 0x5820000C, // 0029 LDCONST R8 K12 + 0x7C140600, // 002A CALL R5 3 + 0x90021404, // 002B SETMBR R0 K10 R4 + 0x80000000, // 002C RET 0 }) ) ); @@ -285,24 +252,18 @@ extern const bclass be_class_Matter_Plugin_Device; be_local_class(Matter_Plugin_Sensor_Contact, 2, &be_class_Matter_Plugin_Device, - be_nested_map(14, + be_nested_map(13, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(shadow_contact, 5), be_const_var(1) }, { be_const_key_weak(ARG, -1), be_nested_str_weak(switch) }, - { be_const_key_weak(UPDATE_TIME, 4), be_const_int(750) }, + { be_const_key_weak(shadow_contact, -1), be_const_var(1) }, { be_const_key_weak(TYPE, -1), be_nested_str_weak(contact) }, - { be_const_key_weak(append_state_json, 9), be_const_closure(Matter_Plugin_Sensor_Contact_append_state_json_closure) }, - { be_const_key_weak(read_attribute, 12), be_const_closure(Matter_Plugin_Sensor_Contact_read_attribute_closure) }, - { be_const_key_weak(parse_configuration, -1), be_const_closure(Matter_Plugin_Sensor_Contact_parse_configuration_closure) }, - { be_const_key_weak(update_shadow, -1), be_const_closure(Matter_Plugin_Sensor_Contact_update_shadow_closure) }, + { be_const_key_weak(ARG_TYPE, 5), be_const_static_closure(Matter_Plugin_Sensor_Contact__X3Clambda_X3E_closure) }, + { be_const_key_weak(UPDATE_TIME, -1), be_const_int(750) }, + { be_const_key_weak(ARG_HINT, 1), be_nested_str_weak(Switch_X3Cx_X3E_X20number) }, { be_const_key_weak(NAME, -1), be_nested_str_weak(Contact) }, - { be_const_key_weak(tasmota_switch_index, 13), be_const_var(0) }, - { be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { - be_const_map( * be_nested_map(1, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_int(21, -1), be_const_int(1) }, - })) ) } )) }, - { be_const_key_weak(ARG_HINT, 6), be_nested_str_weak(Switch_X3Cx_X3E_X20number) }, + { be_const_key_weak(parse_configuration, 8), be_const_closure(Matter_Plugin_Sensor_Contact_parse_configuration_closure) }, + { be_const_key_weak(update_shadow, -1), be_const_closure(Matter_Plugin_Sensor_Contact_update_shadow_closure) }, + { be_const_key_weak(tasmota_switch_index, 6), be_const_var(0) }, { be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(6, ( (struct bmapnode*) &(const bmapnode[]) { @@ -362,7 +323,12 @@ be_local_class(Matter_Plugin_Sensor_Contact, be_const_int(65533), })) ) } )) }, })) ) } )) }, - { be_const_key_weak(ARG_TYPE, -1), be_const_static_closure(Matter_Plugin_Sensor_Contact__X3Clambda_X3E_closure) }, + { be_const_key_weak(read_attribute, 4), be_const_closure(Matter_Plugin_Sensor_Contact_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(21, -1), be_const_int(1) }, + })) ) } )) }, })), be_str_weak(Matter_Plugin_Sensor_Contact) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Sensor_Occupancy.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Sensor_Occupancy.h index bb58ae60a..3c387918b 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Sensor_Occupancy.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_Sensor_Occupancy.h @@ -6,39 +6,6 @@ extern const bclass be_class_Matter_Plugin_Sensor_Occupancy; -/******************************************************************** -** Solidified function: append_state_json -********************************************************************/ -be_local_closure(Matter_Plugin_Sensor_Occupancy_append_state_json, /* name */ - be_nested_proto( - 5, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(_X2C_X22Occupancy_X22_X3A_X25s), - /* K1 */ be_nested_str_weak(shadow_occupancy), - }), - be_str_weak(append_state_json), - &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0x60040018, // 0000 GETGBL R1 G24 - 0x58080000, // 0001 LDCONST R2 K0 - 0x600C0009, // 0002 GETGBL R3 G9 - 0x88100101, // 0003 GETMBR R4 R0 K1 - 0x7C0C0200, // 0004 CALL R3 1 - 0x7C040400, // 0005 CALL R1 2 - 0x80040200, // 0006 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: ********************************************************************/ @@ -107,84 +74,6 @@ be_local_closure(Matter_Plugin_Sensor_Occupancy_parse_configuration, /* name * /*******************************************************************/ -/******************************************************************** -** Solidified function: update_shadow -********************************************************************/ -be_local_closure(Matter_Plugin_Sensor_Occupancy_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[13]) { /* constants */ - /* K0 */ be_nested_str_weak(update_shadow), - /* K1 */ be_nested_str_weak(Switch), - /* K2 */ be_nested_str_weak(tasmota_switch_index), - /* K3 */ be_nested_str_weak(tasmota), - /* K4 */ be_nested_str_weak(cmd), - /* K5 */ be_nested_str_weak(Status_X208), - /* K6 */ be_nested_str_weak(find), - /* K7 */ be_nested_str_weak(StatusSNS), - /* K8 */ be_nested_str_weak(contains), - /* K9 */ be_nested_str_weak(ON), - /* K10 */ be_nested_str_weak(shadow_occupancy), - /* K11 */ be_nested_str_weak(attribute_updated), - /* K12 */ be_const_int(0), - }), - be_str_weak(update_shadow), - &be_const_str_solidified, - ( &(const binstruction[41]) { /* 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 - 0x60040008, // 0005 GETGBL R1 G8 - 0x88080102, // 0006 GETMBR R2 R0 K2 - 0x7C040200, // 0007 CALL R1 1 - 0x00060201, // 0008 ADD R1 K1 R1 - 0xB80A0600, // 0009 GETNGBL R2 K3 - 0x8C080504, // 000A GETMET R2 R2 K4 - 0x58100005, // 000B LDCONST R4 K5 - 0x50140200, // 000C LDBOOL R5 1 0 - 0x7C080600, // 000D CALL R2 3 - 0x4C0C0000, // 000E LDNIL R3 - 0x200C0403, // 000F NE R3 R2 R3 - 0x780E0003, // 0010 JMPF R3 #0015 - 0x8C0C0506, // 0011 GETMET R3 R2 K6 - 0x58140007, // 0012 LDCONST R5 K7 - 0x7C0C0400, // 0013 CALL R3 2 - 0x5C080600, // 0014 MOVE R2 R3 - 0x4C0C0000, // 0015 LDNIL R3 - 0x200C0403, // 0016 NE R3 R2 R3 - 0x780E000F, // 0017 JMPF R3 #0028 - 0x8C0C0508, // 0018 GETMET R3 R2 K8 - 0x5C140200, // 0019 MOVE R5 R1 - 0x7C0C0400, // 001A CALL R3 2 - 0x780E000B, // 001B JMPF R3 #0028 - 0x8C0C0506, // 001C GETMET R3 R2 K6 - 0x5C140200, // 001D MOVE R5 R1 - 0x7C0C0400, // 001E CALL R3 2 - 0x1C0C0709, // 001F EQ R3 R3 K9 - 0x8810010A, // 0020 GETMBR R4 R0 K10 - 0x20100803, // 0021 NE R4 R4 R3 - 0x78120003, // 0022 JMPF R4 #0027 - 0x8C10010B, // 0023 GETMET R4 R0 K11 - 0x541A0405, // 0024 LDINT R6 1030 - 0x581C000C, // 0025 LDCONST R7 K12 - 0x7C100600, // 0026 CALL R4 3 - 0x90021403, // 0027 SETMBR R0 K10 R3 - 0x80000000, // 0028 RET 0 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: read_attribute ********************************************************************/ @@ -292,6 +181,84 @@ be_local_closure(Matter_Plugin_Sensor_Occupancy_read_attribute, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: update_shadow +********************************************************************/ +be_local_closure(Matter_Plugin_Sensor_Occupancy_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[13]) { /* constants */ + /* K0 */ be_nested_str_weak(update_shadow), + /* K1 */ be_nested_str_weak(Switch), + /* K2 */ be_nested_str_weak(tasmota_switch_index), + /* K3 */ be_nested_str_weak(tasmota), + /* K4 */ be_nested_str_weak(cmd), + /* K5 */ be_nested_str_weak(Status_X208), + /* K6 */ be_nested_str_weak(find), + /* K7 */ be_nested_str_weak(StatusSNS), + /* K8 */ be_nested_str_weak(contains), + /* K9 */ be_nested_str_weak(ON), + /* K10 */ be_nested_str_weak(shadow_occupancy), + /* K11 */ be_nested_str_weak(attribute_updated), + /* K12 */ be_const_int(0), + }), + be_str_weak(update_shadow), + &be_const_str_solidified, + ( &(const binstruction[41]) { /* 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 + 0x60040008, // 0005 GETGBL R1 G8 + 0x88080102, // 0006 GETMBR R2 R0 K2 + 0x7C040200, // 0007 CALL R1 1 + 0x00060201, // 0008 ADD R1 K1 R1 + 0xB80A0600, // 0009 GETNGBL R2 K3 + 0x8C080504, // 000A GETMET R2 R2 K4 + 0x58100005, // 000B LDCONST R4 K5 + 0x50140200, // 000C LDBOOL R5 1 0 + 0x7C080600, // 000D CALL R2 3 + 0x4C0C0000, // 000E LDNIL R3 + 0x200C0403, // 000F NE R3 R2 R3 + 0x780E0003, // 0010 JMPF R3 #0015 + 0x8C0C0506, // 0011 GETMET R3 R2 K6 + 0x58140007, // 0012 LDCONST R5 K7 + 0x7C0C0400, // 0013 CALL R3 2 + 0x5C080600, // 0014 MOVE R2 R3 + 0x4C0C0000, // 0015 LDNIL R3 + 0x200C0403, // 0016 NE R3 R2 R3 + 0x780E000F, // 0017 JMPF R3 #0028 + 0x8C0C0508, // 0018 GETMET R3 R2 K8 + 0x5C140200, // 0019 MOVE R5 R1 + 0x7C0C0400, // 001A CALL R3 2 + 0x780E000B, // 001B JMPF R3 #0028 + 0x8C0C0506, // 001C GETMET R3 R2 K6 + 0x5C140200, // 001D MOVE R5 R1 + 0x7C0C0400, // 001E CALL R3 2 + 0x1C0C0709, // 001F EQ R3 R3 K9 + 0x8810010A, // 0020 GETMBR R4 R0 K10 + 0x20100803, // 0021 NE R4 R4 R3 + 0x78120003, // 0022 JMPF R4 #0027 + 0x8C10010B, // 0023 GETMET R4 R0 K11 + 0x541A0405, // 0024 LDINT R6 1030 + 0x581C000C, // 0025 LDCONST R7 K12 + 0x7C100600, // 0026 CALL R4 3 + 0x90021403, // 0027 SETMBR R0 K10 R3 + 0x80000000, // 0028 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified class: Matter_Plugin_Sensor_Occupancy ********************************************************************/ @@ -299,9 +266,19 @@ extern const bclass be_class_Matter_Plugin_Device; be_local_class(Matter_Plugin_Sensor_Occupancy, 2, &be_class_Matter_Plugin_Device, - be_nested_map(14, + be_nested_map(13, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(CLUSTERS, 5), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + { be_const_key_weak(ARG, -1), be_nested_str_weak(switch) }, + { be_const_key_weak(ARG_TYPE, -1), be_const_static_closure(Matter_Plugin_Sensor_Occupancy__X3Clambda_X3E_closure) }, + { be_const_key_weak(TYPE, -1), be_nested_str_weak(occupancy) }, + { be_const_key_weak(ARG_HINT, 1), be_nested_str_weak(Switch_X3Cx_X3E_X20number) }, + { be_const_key_weak(UPDATE_TIME, -1), be_const_int(750) }, + { be_const_key_weak(parse_configuration, -1), be_const_closure(Matter_Plugin_Sensor_Occupancy_parse_configuration_closure) }, + { be_const_key_weak(tasmota_switch_index, -1), be_const_var(0) }, + { be_const_key_weak(shadow_occupancy, 8), be_const_var(1) }, + { be_const_key_weak(update_shadow, 5), be_const_closure(Matter_Plugin_Sensor_Occupancy_update_shadow_closure) }, + { be_const_key_weak(NAME, 6), be_nested_str_weak(Occupancy) }, + { be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(6, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(5, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { @@ -362,23 +339,12 @@ be_local_class(Matter_Plugin_Sensor_Occupancy, be_const_int(65533), })) ) } )) }, })) ) } )) }, - { be_const_key_weak(ARG, -1), be_nested_str_weak(switch) }, - { be_const_key_weak(UPDATE_TIME, 9), be_const_int(750) }, - { be_const_key_weak(TYPE, -1), be_nested_str_weak(occupancy) }, - { be_const_key_weak(append_state_json, -1), be_const_closure(Matter_Plugin_Sensor_Occupancy_append_state_json_closure) }, - { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Sensor_Occupancy_read_attribute_closure) }, - { be_const_key_weak(ARG_HINT, -1), be_nested_str_weak(Switch_X3Cx_X3E_X20number) }, - { be_const_key_weak(update_shadow, -1), be_const_closure(Matter_Plugin_Sensor_Occupancy_update_shadow_closure) }, - { be_const_key_weak(NAME, -1), be_nested_str_weak(Occupancy) }, - { be_const_key_weak(tasmota_switch_index, 12), be_const_var(0) }, + { be_const_key_weak(read_attribute, 4), be_const_closure(Matter_Plugin_Sensor_Occupancy_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(263, -1), be_const_int(2) }, })) ) } )) }, - { be_const_key_weak(parse_configuration, 6), be_const_closure(Matter_Plugin_Sensor_Occupancy_parse_configuration_closure) }, - { be_const_key_weak(ARG_TYPE, 4), be_const_static_closure(Matter_Plugin_Sensor_Occupancy__X3Clambda_X3E_closure) }, - { be_const_key_weak(shadow_occupancy, -1), be_const_var(1) }, })), be_str_weak(Matter_Plugin_Sensor_Occupancy) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_ShutterTilt.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_ShutterTilt.h index 1e0fa451a..c2392034a 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_ShutterTilt.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_3_ShutterTilt.h @@ -234,11 +234,11 @@ be_local_closure(Matter_Plugin_ShutterTilt_read_attribute, /* name */ /******************************************************************** -** Solidified function: append_state_json +** Solidified function: parse_sensors ********************************************************************/ -be_local_closure(Matter_Plugin_ShutterTilt_append_state_json, /* name */ +be_local_closure(Matter_Plugin_ShutterTilt_parse_sensors, /* name */ be_nested_proto( - 7, /* nstack */ + 9, /* nstack */ 2, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -246,22 +246,51 @@ be_local_closure(Matter_Plugin_ShutterTilt_append_state_json, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_str_weak(_X2C_X22ShutterPos_X22_X3A_X25s_X2C_X22ShutterTarget_X22_X3A_X25s_X2C_X22ShutterTilt_X22_X3A_X25s), - /* K1 */ be_nested_str_weak(shadow_shutter_pos), - /* K2 */ be_nested_str_weak(shadow_shutter_target), - /* K3 */ be_nested_str_weak(shadow_shutter_tilt), + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(Shutter), + /* K1 */ be_nested_str_weak(tasmota_shutter_index), + /* K2 */ be_const_int(1), + /* K3 */ be_nested_str_weak(contains), + /* K4 */ be_nested_str_weak(find), + /* K5 */ be_nested_str_weak(Tilt), + /* K6 */ be_nested_str_weak(shadow_shutter_tilt), + /* K7 */ be_nested_str_weak(attribute_updated), + /* K8 */ be_nested_str_weak(parse_sensors), }), - be_str_weak(append_state_json), + be_str_weak(parse_sensors), &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0x60080018, // 0000 GETGBL R2 G24 - 0x580C0000, // 0001 LDCONST R3 K0 - 0x88100101, // 0002 GETMBR R4 R0 K1 - 0x88140102, // 0003 GETMBR R5 R0 K2 - 0x88180103, // 0004 GETMBR R6 R0 K3 - 0x7C080800, // 0005 CALL R2 4 - 0x80040400, // 0006 RET 1 R2 + ( &(const binstruction[31]) { /* code */ + 0x60080008, // 0000 GETGBL R2 G8 + 0x880C0101, // 0001 GETMBR R3 R0 K1 + 0x000C0702, // 0002 ADD R3 R3 K2 + 0x7C080200, // 0003 CALL R2 1 + 0x000A0002, // 0004 ADD R2 K0 R2 + 0x8C0C0303, // 0005 GETMET R3 R1 K3 + 0x5C140400, // 0006 MOVE R5 R2 + 0x7C0C0400, // 0007 CALL R3 2 + 0x780E000E, // 0008 JMPF R3 #0018 + 0x940C0202, // 0009 GETIDX R3 R1 R2 + 0x8C100704, // 000A GETMET R4 R3 K4 + 0x58180005, // 000B LDCONST R6 K5 + 0x7C100400, // 000C CALL R4 2 + 0x4C140000, // 000D LDNIL R5 + 0x20140805, // 000E NE R5 R4 R5 + 0x78160007, // 000F JMPF R5 #0018 + 0x88140106, // 0010 GETMBR R5 R0 K6 + 0x20140805, // 0011 NE R5 R4 R5 + 0x78160003, // 0012 JMPF R5 #0017 + 0x8C140107, // 0013 GETMET R5 R0 K7 + 0x541E0101, // 0014 LDINT R7 258 + 0x5422000E, // 0015 LDINT R8 15 + 0x7C140600, // 0016 CALL R5 3 + 0x90020C04, // 0017 SETMBR R0 K6 R4 + 0x600C0003, // 0018 GETGBL R3 G3 + 0x5C100000, // 0019 MOVE R4 R0 + 0x7C0C0200, // 001A CALL R3 1 + 0x8C0C0708, // 001B GETMET R3 R3 K8 + 0x5C140200, // 001C MOVE R5 R1 + 0x7C0C0400, // 001D CALL R3 2 + 0x80000000, // 001E RET 0 }) ) ); @@ -394,83 +423,19 @@ be_local_closure(Matter_Plugin_ShutterTilt_invoke_request, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: parse_sensors -********************************************************************/ -be_local_closure(Matter_Plugin_ShutterTilt_parse_sensors, /* name */ - be_nested_proto( - 9, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 9]) { /* constants */ - /* K0 */ be_nested_str_weak(Shutter), - /* K1 */ be_nested_str_weak(tasmota_shutter_index), - /* K2 */ be_const_int(1), - /* K3 */ be_nested_str_weak(contains), - /* K4 */ be_nested_str_weak(find), - /* K5 */ be_nested_str_weak(Tilt), - /* K6 */ be_nested_str_weak(shadow_shutter_tilt), - /* K7 */ be_nested_str_weak(attribute_updated), - /* K8 */ be_nested_str_weak(parse_sensors), - }), - be_str_weak(parse_sensors), - &be_const_str_solidified, - ( &(const binstruction[31]) { /* code */ - 0x60080008, // 0000 GETGBL R2 G8 - 0x880C0101, // 0001 GETMBR R3 R0 K1 - 0x000C0702, // 0002 ADD R3 R3 K2 - 0x7C080200, // 0003 CALL R2 1 - 0x000A0002, // 0004 ADD R2 K0 R2 - 0x8C0C0303, // 0005 GETMET R3 R1 K3 - 0x5C140400, // 0006 MOVE R5 R2 - 0x7C0C0400, // 0007 CALL R3 2 - 0x780E000E, // 0008 JMPF R3 #0018 - 0x940C0202, // 0009 GETIDX R3 R1 R2 - 0x8C100704, // 000A GETMET R4 R3 K4 - 0x58180005, // 000B LDCONST R6 K5 - 0x7C100400, // 000C CALL R4 2 - 0x4C140000, // 000D LDNIL R5 - 0x20140805, // 000E NE R5 R4 R5 - 0x78160007, // 000F JMPF R5 #0018 - 0x88140106, // 0010 GETMBR R5 R0 K6 - 0x20140805, // 0011 NE R5 R4 R5 - 0x78160003, // 0012 JMPF R5 #0017 - 0x8C140107, // 0013 GETMET R5 R0 K7 - 0x541E0101, // 0014 LDINT R7 258 - 0x5422000E, // 0015 LDINT R8 15 - 0x7C140600, // 0016 CALL R5 3 - 0x90020C04, // 0017 SETMBR R0 K6 R4 - 0x600C0003, // 0018 GETGBL R3 G3 - 0x5C100000, // 0019 MOVE R4 R0 - 0x7C0C0200, // 001A CALL R3 1 - 0x8C0C0708, // 001B GETMET R3 R3 K8 - 0x5C140200, // 001C MOVE R5 R1 - 0x7C0C0400, // 001D CALL R3 2 - 0x80000000, // 001E RET 0 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified class: Matter_Plugin_ShutterTilt ********************************************************************/ extern const bclass be_class_Matter_Plugin_Shutter; be_local_class(Matter_Plugin_ShutterTilt, - 2, + 3, &be_class_Matter_Plugin_Shutter, be_nested_map(10, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_weak(update_tilt_min_max, -1), be_const_closure(Matter_Plugin_ShutterTilt_update_tilt_min_max_closure) }, { be_const_key_weak(TYPE, -1), be_nested_str_weak(shutter_X2Btilt) }, { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_ShutterTilt_read_attribute_closure) }, - { be_const_key_weak(parse_sensors, -1), be_const_closure(Matter_Plugin_ShutterTilt_parse_sensors_closure) }, + { be_const_key_weak(shadow_shutter_tilt, -1), be_const_var(0) }, { be_const_key_weak(CLUSTERS, 8), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(6, ( (struct bmapnode*) &(const bmapnode[]) { @@ -541,11 +506,11 @@ be_local_class(Matter_Plugin_ShutterTilt, be_const_int(65533), })) ) } )) }, })) ) } )) }, - { be_const_key_weak(tilt_min, -1), be_const_var(0) }, - { be_const_key_weak(append_state_json, 3), be_const_closure(Matter_Plugin_ShutterTilt_append_state_json_closure) }, + { be_const_key_weak(tilt_min, 3), be_const_var(1) }, + { be_const_key_weak(parse_sensors, -1), be_const_closure(Matter_Plugin_ShutterTilt_parse_sensors_closure) }, { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_ShutterTilt_invoke_request_closure) }, { be_const_key_weak(NAME, -1), be_nested_str_weak(Shutter_X20_X2B_X20Tilt) }, - { be_const_key_weak(tilt_max, 1), be_const_var(1) }, + { be_const_key_weak(tilt_max, 1), be_const_var(2) }, })), be_str_weak(Matter_Plugin_ShutterTilt) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Light2.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Light2.h index 46843184b..e1760a33b 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Light2.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Light2.h @@ -6,89 +6,6 @@ extern const bclass be_class_Matter_Plugin_Light2; -/******************************************************************** -** Solidified function: update_virtual -********************************************************************/ -be_local_closure(Matter_Plugin_Light2_update_virtual, /* name */ - be_nested_proto( - 6, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_str_weak(find), - /* K1 */ be_nested_str_weak(CT), - /* K2 */ be_nested_str_weak(set_ct), - /* K3 */ be_nested_str_weak(update_virtual), - }), - be_str_weak(update_virtual), - &be_const_str_solidified, - ( &(const binstruction[18]) { /* code */ - 0x60080009, // 0000 GETGBL R2 G9 - 0x8C0C0300, // 0001 GETMET R3 R1 K0 - 0x58140001, // 0002 LDCONST R5 K1 - 0x7C0C0400, // 0003 CALL R3 2 - 0x7C080200, // 0004 CALL R2 1 - 0x4C0C0000, // 0005 LDNIL R3 - 0x200C0403, // 0006 NE R3 R2 R3 - 0x780E0002, // 0007 JMPF R3 #000B - 0x8C0C0102, // 0008 GETMET R3 R0 K2 - 0x5C140400, // 0009 MOVE R5 R2 - 0x7C0C0400, // 000A CALL R3 2 - 0x600C0003, // 000B GETGBL R3 G3 - 0x5C100000, // 000C MOVE R4 R0 - 0x7C0C0200, // 000D CALL R3 1 - 0x8C0C0703, // 000E GETMET R3 R3 K3 - 0x5C140200, // 000F MOVE R5 R1 - 0x7C0C0400, // 0010 CALL R3 2 - 0x80000000, // 0011 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: append_state_json -********************************************************************/ -be_local_closure(Matter_Plugin_Light2_append_state_json, /* name */ - be_nested_proto( - 7, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_str_weak(_X2C_X22Power_X22_X3A_X25s_X2C_X22Bri_X22_X3A_X25s_X2C_X22CT_X22_X3A_X25s), - /* K1 */ be_nested_str_weak(shadow_onoff), - /* K2 */ be_nested_str_weak(shadow_bri), - /* K3 */ be_nested_str_weak(shadow_ct), - }), - be_str_weak(append_state_json), - &be_const_str_solidified, - ( &(const binstruction[ 9]) { /* code */ - 0x60080018, // 0000 GETGBL R2 G24 - 0x580C0000, // 0001 LDCONST R3 K0 - 0x60100009, // 0002 GETGBL R4 G9 - 0x88140101, // 0003 GETMBR R5 R0 K1 - 0x7C100200, // 0004 CALL R4 1 - 0x88140102, // 0005 GETMBR R5 R0 K2 - 0x88180103, // 0006 GETMBR R6 R0 K3 - 0x7C080800, // 0007 CALL R2 4 - 0x80040400, // 0008 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: init ********************************************************************/ @@ -130,60 +47,96 @@ be_local_closure(Matter_Plugin_Light2_init, /* name */ /******************************************************************** -** Solidified function: set_ct +** Solidified function: invoke_request ********************************************************************/ -be_local_closure(Matter_Plugin_Light2_set_ct, /* name */ +be_local_closure(Matter_Plugin_Light2_invoke_request, /* name */ be_nested_proto( - 6, /* nstack */ - 2, /* argc */ + 13, /* nstack */ + 4, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 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), + ( &(const bvalue[14]) { /* 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_nested_str_weak(findsubval), + /* K7 */ be_const_int(0), + /* 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(set_ct), + be_str_weak(invoke_request), &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 + ( &(const binstruction[59]) { /* 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 + 0x542202FF, // 0005 LDINT R8 768 + 0x1C200C08, // 0006 EQ R8 R6 R8 + 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 + 0x78220011, // 000C JMPF R8 #001F + 0x8C200506, // 000D GETMET R8 R2 K6 + 0x58280007, // 000E LDCONST R10 K7 + 0x7C200400, // 000F CALL R8 2 + 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 }) ) ); @@ -252,6 +205,52 @@ be_local_closure(Matter_Plugin_Light2_update_shadow, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: update_virtual +********************************************************************/ +be_local_closure(Matter_Plugin_Light2_update_virtual, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(find), + /* K1 */ be_nested_str_weak(CT), + /* K2 */ be_nested_str_weak(set_ct), + /* K3 */ be_nested_str_weak(update_virtual), + }), + be_str_weak(update_virtual), + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x60080009, // 0000 GETGBL R2 G9 + 0x8C0C0300, // 0001 GETMET R3 R1 K0 + 0x58140001, // 0002 LDCONST R5 K1 + 0x7C0C0400, // 0003 CALL R3 2 + 0x7C080200, // 0004 CALL R2 1 + 0x4C0C0000, // 0005 LDNIL R3 + 0x200C0403, // 0006 NE R3 R2 R3 + 0x780E0002, // 0007 JMPF R3 #000B + 0x8C0C0102, // 0008 GETMET R3 R0 K2 + 0x5C140400, // 0009 MOVE R5 R2 + 0x7C0C0400, // 000A CALL R3 2 + 0x600C0003, // 000B GETGBL R3 G3 + 0x5C100000, // 000C MOVE R4 R0 + 0x7C0C0200, // 000D CALL R3 1 + 0x8C0C0703, // 000E GETMET R3 R3 K3 + 0x5C140200, // 000F MOVE R5 R1 + 0x7C0C0400, // 0010 CALL R3 2 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: read_attribute ********************************************************************/ @@ -373,96 +372,60 @@ be_local_closure(Matter_Plugin_Light2_read_attribute, /* name */ /******************************************************************** -** Solidified function: invoke_request +** Solidified function: set_ct ********************************************************************/ -be_local_closure(Matter_Plugin_Light2_invoke_request, /* name */ +be_local_closure(Matter_Plugin_Light2_set_ct, /* name */ be_nested_proto( - 13, /* nstack */ - 4, /* 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[14]) { /* 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_nested_str_weak(findsubval), - /* K7 */ be_const_int(0), - /* 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), + ( &(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(invoke_request), + be_str_weak(set_ct), &be_const_str_solidified, - ( &(const binstruction[59]) { /* 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 - 0x542202FF, // 0005 LDINT R8 768 - 0x1C200C08, // 0006 EQ R8 R6 R8 - 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 - 0x78220011, // 000C JMPF R8 #001F - 0x8C200506, // 000D GETMET R8 R2 K6 - 0x58280007, // 000E LDCONST R10 K7 - 0x7C200400, // 000F CALL R8 2 - 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 + ( &(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 }) ) ); @@ -519,15 +482,14 @@ extern const bclass be_class_Matter_Plugin_Light1; be_local_class(Matter_Plugin_Light2, 3, &be_class_Matter_Plugin_Light1, - be_nested_map(16, + be_nested_map(15, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(update_virtual, -1), be_const_closure(Matter_Plugin_Light2_update_virtual_closure) }, - { be_const_key_weak(ct_min, 8), be_const_var(1) }, - { be_const_key_weak(append_state_json, -1), be_const_closure(Matter_Plugin_Light2_append_state_json_closure) }, - { be_const_key_weak(init, 4), be_const_closure(Matter_Plugin_Light2_init_closure) }, - { be_const_key_weak(set_ct, -1), be_const_closure(Matter_Plugin_Light2_set_ct_closure) }, - { be_const_key_weak(update_shadow, -1), be_const_closure(Matter_Plugin_Light2_update_shadow_closure) }, - { be_const_key_weak(NAME, -1), 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(shadow_ct, -1), be_const_var(0) }, + { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Light2_invoke_request_closure) }, + { be_const_key_weak(ct_max, -1), be_const_var(2) }, + { be_const_key_weak(update_shadow, 8), be_const_closure(Matter_Plugin_Light2_update_shadow_closure) }, + { be_const_key_weak(update_virtual, 11), be_const_closure(Matter_Plugin_Light2_update_virtual_closure) }, { be_const_key_weak(UPDATE_COMMANDS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { be_const_list( * be_nested_list(3, ( (struct bvalue*) &(const bvalue[]) { @@ -535,10 +497,7 @@ be_local_class(Matter_Plugin_Light2, be_nested_str_weak(Bri), be_nested_str_weak(CT), })) ) } )) }, - { be_const_key_weak(update_ct_minmax, -1), be_const_closure(Matter_Plugin_Light2_update_ct_minmax_closure) }, - { be_const_key_weak(TYPE, -1), be_nested_str_weak(light2) }, - { be_const_key_weak(read_attribute, 12), be_const_closure(Matter_Plugin_Light2_read_attribute_closure) }, - { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Light2_invoke_request_closure) }, + { be_const_key_weak(set_ct, -1), be_const_closure(Matter_Plugin_Light2_set_ct_closure) }, { be_const_key_weak(CLUSTERS, 14), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(8, ( (struct bmapnode*) &(const bmapnode[]) { @@ -620,13 +579,16 @@ be_local_class(Matter_Plugin_Light2, be_const_int(65533), })) ) } )) }, })) ) } )) }, - { be_const_key_weak(shadow_ct, 9), be_const_var(0) }, + { be_const_key_weak(NAME, 6), be_nested_str_weak(Light_X202_X20CT) }, + { be_const_key_weak(update_ct_minmax, -1), be_const_closure(Matter_Plugin_Light2_update_ct_minmax_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_const_key_weak(ct_max, -1), be_const_var(2) }, + { be_const_key_weak(read_attribute, 10), be_const_closure(Matter_Plugin_Light2_read_attribute_closure) }, + { be_const_key_weak(ct_min, -1), be_const_var(1) }, + { be_const_key_weak(TYPE, -1), be_nested_str_weak(light2) }, })), be_str_weak(Matter_Plugin_Light2) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Light3.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Light3.h index 736028422..6646451fa 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Light3.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_4_Light3.h @@ -6,189 +6,6 @@ extern const bclass be_class_Matter_Plugin_Light3; -/******************************************************************** -** Solidified function: read_attribute -********************************************************************/ -be_local_closure(Matter_Plugin_Light3_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[13]) { /* constants */ - /* K0 */ be_nested_str_weak(matter), - /* K1 */ be_nested_str_weak(TLV), - /* K2 */ be_nested_str_weak(cluster), - /* K3 */ be_nested_str_weak(attribute), - /* K4 */ be_nested_str_weak(update_shadow_lazy), - /* K5 */ be_const_int(0), - /* K6 */ be_nested_str_weak(set), - /* K7 */ be_nested_str_weak(U1), - /* K8 */ be_nested_str_weak(shadow_hue), - /* K9 */ be_const_int(1), - /* K10 */ be_nested_str_weak(shadow_sat), - /* K11 */ be_nested_str_weak(U4), - /* K12 */ be_nested_str_weak(read_attribute), - }), - be_str_weak(read_attribute), - &be_const_str_solidified, - ( &(const binstruction[107]) { /* code */ - 0xB8120000, // 0000 GETNGBL R4 K0 - 0x88100901, // 0001 GETMBR R4 R4 K1 - 0x88140502, // 0002 GETMBR R5 R2 K2 - 0x88180503, // 0003 GETMBR R6 R2 K3 - 0x541E02FF, // 0004 LDINT R7 768 - 0x1C1C0A07, // 0005 EQ R7 R5 R7 - 0x781E0059, // 0006 JMPF R7 #0061 - 0x8C1C0104, // 0007 GETMET R7 R0 K4 - 0x7C1C0200, // 0008 CALL R7 1 - 0x1C1C0D05, // 0009 EQ R7 R6 K5 - 0x781E0005, // 000A JMPF R7 #0011 - 0x8C1C0706, // 000B GETMET R7 R3 K6 - 0x88240907, // 000C GETMBR R9 R4 K7 - 0x88280108, // 000D GETMBR R10 R0 K8 - 0x7C1C0600, // 000E CALL R7 3 - 0x80040E00, // 000F RET 1 R7 - 0x7002004E, // 0010 JMP #0060 - 0x1C1C0D09, // 0011 EQ R7 R6 K9 - 0x781E0005, // 0012 JMPF R7 #0019 - 0x8C1C0706, // 0013 GETMET R7 R3 K6 - 0x88240907, // 0014 GETMBR R9 R4 K7 - 0x8828010A, // 0015 GETMBR R10 R0 K10 - 0x7C1C0600, // 0016 CALL R7 3 - 0x80040E00, // 0017 RET 1 R7 - 0x70020046, // 0018 JMP #0060 - 0x541E0006, // 0019 LDINT R7 7 - 0x1C1C0C07, // 001A EQ R7 R6 R7 - 0x781E0005, // 001B JMPF R7 #0022 - 0x8C1C0706, // 001C GETMET R7 R3 K6 - 0x88240907, // 001D GETMBR R9 R4 K7 - 0x58280005, // 001E LDCONST R10 K5 - 0x7C1C0600, // 001F CALL R7 3 - 0x80040E00, // 0020 RET 1 R7 - 0x7002003D, // 0021 JMP #0060 - 0x541E0007, // 0022 LDINT R7 8 - 0x1C1C0C07, // 0023 EQ R7 R6 R7 - 0x781E0005, // 0024 JMPF R7 #002B - 0x8C1C0706, // 0025 GETMET R7 R3 K6 - 0x88240907, // 0026 GETMBR R9 R4 K7 - 0x58280005, // 0027 LDCONST R10 K5 - 0x7C1C0600, // 0028 CALL R7 3 - 0x80040E00, // 0029 RET 1 R7 - 0x70020034, // 002A JMP #0060 - 0x541E000E, // 002B LDINT R7 15 - 0x1C1C0C07, // 002C EQ R7 R6 R7 - 0x781E0005, // 002D JMPF R7 #0034 - 0x8C1C0706, // 002E GETMET R7 R3 K6 - 0x88240907, // 002F GETMBR R9 R4 K7 - 0x58280005, // 0030 LDCONST R10 K5 - 0x7C1C0600, // 0031 CALL R7 3 - 0x80040E00, // 0032 RET 1 R7 - 0x7002002B, // 0033 JMP #0060 - 0x541E4000, // 0034 LDINT R7 16385 - 0x1C1C0C07, // 0035 EQ R7 R6 R7 - 0x781E0005, // 0036 JMPF R7 #003D - 0x8C1C0706, // 0037 GETMET R7 R3 K6 - 0x88240907, // 0038 GETMBR R9 R4 K7 - 0x58280005, // 0039 LDCONST R10 K5 - 0x7C1C0600, // 003A CALL R7 3 - 0x80040E00, // 003B RET 1 R7 - 0x70020022, // 003C JMP #0060 - 0x541E4009, // 003D LDINT R7 16394 - 0x1C1C0C07, // 003E EQ R7 R6 R7 - 0x781E0005, // 003F JMPF R7 #0046 - 0x8C1C0706, // 0040 GETMET R7 R3 K6 - 0x88240907, // 0041 GETMBR R9 R4 K7 - 0x58280009, // 0042 LDCONST R10 K9 - 0x7C1C0600, // 0043 CALL R7 3 - 0x80040E00, // 0044 RET 1 R7 - 0x70020019, // 0045 JMP #0060 - 0x541E000F, // 0046 LDINT R7 16 - 0x1C1C0C07, // 0047 EQ R7 R6 R7 - 0x781E0005, // 0048 JMPF R7 #004F - 0x8C1C0706, // 0049 GETMET R7 R3 K6 - 0x88240907, // 004A GETMBR R9 R4 K7 - 0x58280005, // 004B LDCONST R10 K5 - 0x7C1C0600, // 004C CALL R7 3 - 0x80040E00, // 004D RET 1 R7 - 0x70020010, // 004E JMP #0060 - 0x541EFFFB, // 004F LDINT R7 65532 - 0x1C1C0C07, // 0050 EQ R7 R6 R7 - 0x781E0005, // 0051 JMPF R7 #0058 - 0x8C1C0706, // 0052 GETMET R7 R3 K6 - 0x8824090B, // 0053 GETMBR R9 R4 K11 - 0x58280009, // 0054 LDCONST R10 K9 - 0x7C1C0600, // 0055 CALL R7 3 - 0x80040E00, // 0056 RET 1 R7 - 0x70020007, // 0057 JMP #0060 - 0x541EFFFC, // 0058 LDINT R7 65533 - 0x1C1C0C07, // 0059 EQ R7 R6 R7 - 0x781E0004, // 005A JMPF R7 #0060 - 0x8C1C0706, // 005B GETMET R7 R3 K6 - 0x8824090B, // 005C GETMBR R9 R4 K11 - 0x542A0004, // 005D LDINT R10 5 - 0x7C1C0600, // 005E CALL R7 3 - 0x80040E00, // 005F RET 1 R7 - 0x70020008, // 0060 JMP #006A - 0x601C0003, // 0061 GETGBL R7 G3 - 0x5C200000, // 0062 MOVE R8 R0 - 0x7C1C0200, // 0063 CALL R7 1 - 0x8C1C0F0C, // 0064 GETMET R7 R7 K12 - 0x5C240200, // 0065 MOVE R9 R1 - 0x5C280400, // 0066 MOVE R10 R2 - 0x5C2C0600, // 0067 MOVE R11 R3 - 0x7C1C0800, // 0068 CALL R7 4 - 0x80040E00, // 0069 RET 1 R7 - 0x80000000, // 006A RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: append_state_json -********************************************************************/ -be_local_closure(Matter_Plugin_Light3_append_state_json, /* name */ - be_nested_proto( - 8, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_str_weak(_X2C_X22Power_X22_X3A_X25s_X2C_X22Bri_X22_X3A_X25s_X2C_X22Hue_X22_X3A_X25s_X2C_X22Sat_X22_X3A_X25s), - /* K1 */ be_nested_str_weak(shadow_onoff), - /* K2 */ be_nested_str_weak(shadow_bri), - /* K3 */ be_nested_str_weak(shadow_hue), - /* K4 */ be_nested_str_weak(shadow_sat), - }), - be_str_weak(append_state_json), - &be_const_str_solidified, - ( &(const binstruction[10]) { /* code */ - 0x60080018, // 0000 GETGBL R2 G24 - 0x580C0000, // 0001 LDCONST R3 K0 - 0x60100009, // 0002 GETGBL R4 G9 - 0x88140101, // 0003 GETMBR R5 R0 K1 - 0x7C100200, // 0004 CALL R4 1 - 0x88140102, // 0005 GETMBR R5 R0 K2 - 0x88180103, // 0006 GETMBR R6 R0 K3 - 0x881C0104, // 0007 GETMBR R7 R0 K4 - 0x7C080A00, // 0008 CALL R2 5 - 0x80040400, // 0009 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: update_virtual ********************************************************************/ @@ -246,38 +63,140 @@ be_local_closure(Matter_Plugin_Light3_update_virtual, /* name */ /******************************************************************** -** Solidified function: init +** Solidified function: set_hue_sat ********************************************************************/ -be_local_closure(Matter_Plugin_Light3_init, /* name */ +be_local_closure(Matter_Plugin_Light3_set_hue_sat, /* name */ be_nested_proto( - 9, /* nstack */ - 4, /* argc */ + 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[ 4]) { /* constants */ - /* K0 */ be_nested_str_weak(init), - /* K1 */ be_nested_str_weak(shadow_hue), - /* K2 */ be_const_int(0), - /* K3 */ be_nested_str_weak(shadow_sat), + ( &(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(init), + be_str_weak(set_hue_sat), &be_const_str_solidified, - ( &(const binstruction[11]) { /* code */ - 0x60100003, // 0000 GETGBL R4 G3 - 0x5C140000, // 0001 MOVE R5 R0 - 0x7C100200, // 0002 CALL R4 1 - 0x8C100900, // 0003 GETMET R4 R4 K0 - 0x5C180200, // 0004 MOVE R6 R1 - 0x5C1C0400, // 0005 MOVE R7 R2 - 0x5C200600, // 0006 MOVE R8 R3 - 0x7C100800, // 0007 CALL R4 4 - 0x90020302, // 0008 SETMBR R0 K1 K2 - 0x90020702, // 0009 SETMBR R0 K3 K2 - 0x80000000, // 000A RET 0 + ( &(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 }) ) ); @@ -450,6 +369,45 @@ be_local_closure(Matter_Plugin_Light3_invoke_request, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_Plugin_Light3_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[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(init), + /* K1 */ be_nested_str_weak(shadow_hue), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(shadow_sat), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[11]) { /* code */ + 0x60100003, // 0000 GETGBL R4 G3 + 0x5C140000, // 0001 MOVE R5 R0 + 0x7C100200, // 0002 CALL R4 1 + 0x8C100900, // 0003 GETMET R4 R4 K0 + 0x5C180200, // 0004 MOVE R6 R1 + 0x5C1C0400, // 0005 MOVE R7 R2 + 0x5C200600, // 0006 MOVE R8 R3 + 0x7C100800, // 0007 CALL R4 4 + 0x90020302, // 0008 SETMBR R0 K1 K2 + 0x90020702, // 0009 SETMBR R0 K3 K2 + 0x80000000, // 000A RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: update_shadow ********************************************************************/ @@ -555,12 +513,12 @@ be_local_closure(Matter_Plugin_Light3_update_shadow, /* name */ /******************************************************************** -** Solidified function: set_hue_sat +** Solidified function: read_attribute ********************************************************************/ -be_local_closure(Matter_Plugin_Light3_set_hue_sat, /* name */ +be_local_closure(Matter_Plugin_Light3_read_attribute, /* name */ be_nested_proto( - 11, /* nstack */ - 3, /* argc */ + 12, /* nstack */ + 4, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -568,127 +526,130 @@ be_local_closure(Matter_Plugin_Light3_set_hue_sat, /* name */ 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), + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(cluster), + /* K3 */ be_nested_str_weak(attribute), + /* K4 */ be_nested_str_weak(update_shadow_lazy), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(set), + /* K7 */ be_nested_str_weak(U1), + /* K8 */ be_nested_str_weak(shadow_hue), + /* K9 */ be_const_int(1), + /* K10 */ be_nested_str_weak(shadow_sat), + /* K11 */ be_nested_str_weak(U4), + /* K12 */ be_nested_str_weak(read_attribute), }), - be_str_weak(set_hue_sat), + be_str_weak(read_attribute), &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 + ( &(const binstruction[107]) { /* code */ + 0xB8120000, // 0000 GETNGBL R4 K0 + 0x88100901, // 0001 GETMBR R4 R4 K1 + 0x88140502, // 0002 GETMBR R5 R2 K2 + 0x88180503, // 0003 GETMBR R6 R2 K3 + 0x541E02FF, // 0004 LDINT R7 768 + 0x1C1C0A07, // 0005 EQ R7 R5 R7 + 0x781E0059, // 0006 JMPF R7 #0061 + 0x8C1C0104, // 0007 GETMET R7 R0 K4 + 0x7C1C0200, // 0008 CALL R7 1 + 0x1C1C0D05, // 0009 EQ R7 R6 K5 + 0x781E0005, // 000A JMPF R7 #0011 + 0x8C1C0706, // 000B GETMET R7 R3 K6 + 0x88240907, // 000C GETMBR R9 R4 K7 + 0x88280108, // 000D GETMBR R10 R0 K8 + 0x7C1C0600, // 000E CALL R7 3 + 0x80040E00, // 000F RET 1 R7 + 0x7002004E, // 0010 JMP #0060 + 0x1C1C0D09, // 0011 EQ R7 R6 K9 + 0x781E0005, // 0012 JMPF R7 #0019 + 0x8C1C0706, // 0013 GETMET R7 R3 K6 + 0x88240907, // 0014 GETMBR R9 R4 K7 + 0x8828010A, // 0015 GETMBR R10 R0 K10 + 0x7C1C0600, // 0016 CALL R7 3 + 0x80040E00, // 0017 RET 1 R7 + 0x70020046, // 0018 JMP #0060 + 0x541E0006, // 0019 LDINT R7 7 + 0x1C1C0C07, // 001A EQ R7 R6 R7 + 0x781E0005, // 001B JMPF R7 #0022 + 0x8C1C0706, // 001C GETMET R7 R3 K6 + 0x88240907, // 001D GETMBR R9 R4 K7 + 0x58280005, // 001E LDCONST R10 K5 + 0x7C1C0600, // 001F CALL R7 3 + 0x80040E00, // 0020 RET 1 R7 + 0x7002003D, // 0021 JMP #0060 + 0x541E0007, // 0022 LDINT R7 8 + 0x1C1C0C07, // 0023 EQ R7 R6 R7 + 0x781E0005, // 0024 JMPF R7 #002B + 0x8C1C0706, // 0025 GETMET R7 R3 K6 + 0x88240907, // 0026 GETMBR R9 R4 K7 + 0x58280005, // 0027 LDCONST R10 K5 + 0x7C1C0600, // 0028 CALL R7 3 + 0x80040E00, // 0029 RET 1 R7 + 0x70020034, // 002A JMP #0060 + 0x541E000E, // 002B LDINT R7 15 + 0x1C1C0C07, // 002C EQ R7 R6 R7 + 0x781E0005, // 002D JMPF R7 #0034 + 0x8C1C0706, // 002E GETMET R7 R3 K6 + 0x88240907, // 002F GETMBR R9 R4 K7 + 0x58280005, // 0030 LDCONST R10 K5 + 0x7C1C0600, // 0031 CALL R7 3 + 0x80040E00, // 0032 RET 1 R7 + 0x7002002B, // 0033 JMP #0060 + 0x541E4000, // 0034 LDINT R7 16385 + 0x1C1C0C07, // 0035 EQ R7 R6 R7 + 0x781E0005, // 0036 JMPF R7 #003D + 0x8C1C0706, // 0037 GETMET R7 R3 K6 + 0x88240907, // 0038 GETMBR R9 R4 K7 + 0x58280005, // 0039 LDCONST R10 K5 + 0x7C1C0600, // 003A CALL R7 3 + 0x80040E00, // 003B RET 1 R7 + 0x70020022, // 003C JMP #0060 + 0x541E4009, // 003D LDINT R7 16394 + 0x1C1C0C07, // 003E EQ R7 R6 R7 + 0x781E0005, // 003F JMPF R7 #0046 + 0x8C1C0706, // 0040 GETMET R7 R3 K6 + 0x88240907, // 0041 GETMBR R9 R4 K7 + 0x58280009, // 0042 LDCONST R10 K9 + 0x7C1C0600, // 0043 CALL R7 3 + 0x80040E00, // 0044 RET 1 R7 + 0x70020019, // 0045 JMP #0060 + 0x541E000F, // 0046 LDINT R7 16 + 0x1C1C0C07, // 0047 EQ R7 R6 R7 + 0x781E0005, // 0048 JMPF R7 #004F + 0x8C1C0706, // 0049 GETMET R7 R3 K6 + 0x88240907, // 004A GETMBR R9 R4 K7 + 0x58280005, // 004B LDCONST R10 K5 + 0x7C1C0600, // 004C CALL R7 3 + 0x80040E00, // 004D RET 1 R7 + 0x70020010, // 004E JMP #0060 + 0x541EFFFB, // 004F LDINT R7 65532 + 0x1C1C0C07, // 0050 EQ R7 R6 R7 + 0x781E0005, // 0051 JMPF R7 #0058 + 0x8C1C0706, // 0052 GETMET R7 R3 K6 + 0x8824090B, // 0053 GETMBR R9 R4 K11 + 0x58280009, // 0054 LDCONST R10 K9 + 0x7C1C0600, // 0055 CALL R7 3 + 0x80040E00, // 0056 RET 1 R7 + 0x70020007, // 0057 JMP #0060 + 0x541EFFFC, // 0058 LDINT R7 65533 + 0x1C1C0C07, // 0059 EQ R7 R6 R7 + 0x781E0004, // 005A JMPF R7 #0060 + 0x8C1C0706, // 005B GETMET R7 R3 K6 + 0x8824090B, // 005C GETMBR R9 R4 K11 + 0x542A0004, // 005D LDINT R10 5 + 0x7C1C0600, // 005E CALL R7 3 + 0x80040E00, // 005F RET 1 R7 + 0x70020008, // 0060 JMP #006A + 0x601C0003, // 0061 GETGBL R7 G3 + 0x5C200000, // 0062 MOVE R8 R0 + 0x7C1C0200, // 0063 CALL R7 1 + 0x8C1C0F0C, // 0064 GETMET R7 R7 K12 + 0x5C240200, // 0065 MOVE R9 R1 + 0x5C280400, // 0066 MOVE R10 R2 + 0x5C2C0600, // 0067 MOVE R11 R3 + 0x7C1C0800, // 0068 CALL R7 4 + 0x80040E00, // 0069 RET 1 R7 + 0x80000000, // 006A RET 0 }) ) ); @@ -702,19 +663,18 @@ extern const bclass be_class_Matter_Plugin_Light1; be_local_class(Matter_Plugin_Light3, 2, &be_class_Matter_Plugin_Light1, - be_nested_map(14, + be_nested_map(13, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(read_attribute, 4), be_const_closure(Matter_Plugin_Light3_read_attribute_closure) }, - { be_const_key_weak(update_virtual, -1), be_const_closure(Matter_Plugin_Light3_update_virtual_closure) }, - { be_const_key_weak(append_state_json, 1), be_const_closure(Matter_Plugin_Light3_append_state_json_closure) }, - { be_const_key_weak(UPDATE_COMMANDS, 12), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { - be_const_list( * be_nested_list(4, - ( (struct bvalue*) &(const bvalue[]) { - be_nested_str_weak(Power), - be_nested_str_weak(Bri), - be_nested_str_weak(Hue), - be_nested_str_weak(Sat), - })) ) } )) }, + { be_const_key_weak(shadow_hue, -1), be_const_var(0) }, + { be_const_key_weak(shadow_sat, -1), be_const_var(1) }, + { be_const_key_weak(update_virtual, 3), be_const_closure(Matter_Plugin_Light3_update_virtual_closure) }, + { be_const_key_weak(TYPE, -1), be_nested_str_weak(light3) }, + { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Light3_read_attribute_closure) }, + { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Light3_invoke_request_closure) }, + { be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Light3_init_closure) }, + { be_const_key_weak(set_hue_sat, 8), be_const_closure(Matter_Plugin_Light3_set_hue_sat_closure) }, + { be_const_key_weak(update_shadow, -1), 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(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(8, ( (struct bmapnode*) &(const bmapnode[]) { @@ -798,19 +758,19 @@ be_local_class(Matter_Plugin_Light3, be_const_int(65533), })) ) } )) }, })) ) } )) }, - { be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Light3_init_closure) }, - { be_const_key_weak(update_shadow, -1), be_const_closure(Matter_Plugin_Light3_update_shadow_closure) }, - { be_const_key_weak(invoke_request, 6), be_const_closure(Matter_Plugin_Light3_invoke_request_closure) }, - { be_const_key_weak(NAME, -1), be_nested_str_weak(Light_X203_X20RGB) }, - { be_const_key_weak(shadow_hue, 11), be_const_var(0) }, - { be_const_key_weak(shadow_sat, 9), be_const_var(1) }, + { be_const_key_weak(UPDATE_COMMANDS, 4), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(4, + ( (struct bvalue*) &(const bvalue[]) { + be_nested_str_weak(Power), + be_nested_str_weak(Bri), + be_nested_str_weak(Hue), + be_nested_str_weak(Sat), + })) ) } )) }, { 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(269, -1), be_const_int(2) }, })) ) } )) }, - { be_const_key_weak(TYPE, -1), be_nested_str_weak(light3) }, - { be_const_key_weak(set_hue_sat, -1), be_const_closure(Matter_Plugin_Light3_set_hue_sat_closure) }, })), be_str_weak(Matter_Plugin_Light3) );