Matter fix subscriptions (#18247)

This commit is contained in:
s-hadinger 2023-03-23 22:52:34 +01:00 committed by GitHub
parent d7370e7211
commit 7abff936cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 7763 additions and 6113 deletions

View File

@ -149,7 +149,9 @@ extern const bclass be_class_Matter_TLV; // need to declare it upfront because
#include "../generate/be_matter_certs.h" #include "../generate/be_matter_certs.h"
#include "solidify/solidified_Matter_Plugin_Root.h" #include "solidify/solidified_Matter_Plugin_Root.h"
#include "solidify/solidified_Matter_Plugin_Device.h"
#include "solidify/solidified_Matter_Plugin_OnOff.h" #include "solidify/solidified_Matter_Plugin_OnOff.h"
#include "solidify/solidified_Matter_Plugin_Temp_Sensor.h"
/*********************************************************************************************\ /*********************************************************************************************\
* Get a bytes() object of the certificate DAC/PAI_Cert * Get a bytes() object of the certificate DAC/PAI_Cert
@ -315,7 +317,9 @@ module matter (scope: global, strings: weak) {
// Plugins // Plugins
Plugin_Root, class(be_class_Matter_Plugin_Root) // Generic behavior common to all devices Plugin_Root, class(be_class_Matter_Plugin_Root) // Generic behavior common to all devices
Plugin_Device, class(be_class_Matter_Plugin_Device) // Generic device (abstract)
Plugin_OnOff, class(be_class_Matter_Plugin_OnOff) // Relay/Light behavior (OnOff) Plugin_OnOff, class(be_class_Matter_Plugin_OnOff) // Relay/Light behavior (OnOff)
Plugin_Temp_Sensor, class(be_class_Matter_Plugin_Temp_Sensor) // Temperature Sensor
} }
@const_object_info_end */ @const_object_info_end */

View File

@ -84,11 +84,37 @@ class Matter_Commisioning_Context
return false return false
end end
#################################################################################
# send_status_report
#
# send a StatusReport message (unencrypted)
#
# Usage:
# # StatusReport(GeneralCode: SUCCESS, ProtocolId: SECURE_CHANNEL, ProtocolCode: SESSION_ESTABLISHMENT_SUCCESS)
# var raw = send_status_report(0x00, 0x0000, 0x0000)
# self.responder.send_response(raw, msg.remote_ip, msg.remote_port, nil)
def send_status_report(msg, general_code, protocol_id, protocol_code, reliable)
# now package the response message
var resp = msg.build_response(0x40 #-StatusReport-#, reliable)
var status_raw = bytes()
status_raw.add(general_code, 2)
status_raw.add(protocol_id, 4)
status_raw.add(protocol_code, 4)
var raw = resp.encode_frame(status_raw)
self.responder.send_response(raw, msg.remote_ip, msg.remote_port, resp.message_counter)
end
def parse_PBKDFParamRequest(msg) def parse_PBKDFParamRequest(msg)
import crypto import crypto
# sanity checks # sanity checks
if msg.opcode != 0x20 || msg.local_session_id != 0 || msg.protocol_id != 0 if msg.opcode != 0x20 || msg.local_session_id != 0 || msg.protocol_id != 0
raise "protocol_error", "invalid PBKDFParamRequest message" tasmota.log("MTR: invalid PBKDFParamRequest message", 2)
tasmota.log("MTR: StatusReport(General Code: FAILURE, ProtocolId: SECURE_CHANNEL, ProtocolCode: INVALID_PARAMETER)", 2)
var raw = self.send_status_report(msg, 0x01, 0x0000, 0x0002, false)
return false
end end
var pbkdfparamreq = matter.PBKDFParamRequest().parse(msg.raw, msg.app_payload_idx) var pbkdfparamreq = matter.PBKDFParamRequest().parse(msg.raw, msg.app_payload_idx)
msg.session.set_mode_PASE() msg.session.set_mode_PASE()
@ -96,7 +122,12 @@ class Matter_Commisioning_Context
self.PBKDFParamRequest = msg.raw[msg.app_payload_idx..] self.PBKDFParamRequest = msg.raw[msg.app_payload_idx..]
# sanity check for PBKDFParamRequest # sanity check for PBKDFParamRequest
if pbkdfparamreq.passcodeId != 0 raise "protocol_error", "non-zero passcode id" end if pbkdfparamreq.passcodeId != 0
tasmota.log("MTR: non-zero passcode id", 2)
tasmota.log("MTR: StatusReport(General Code: FAILURE, ProtocolId: SECURE_CHANNEL, ProtocolCode: INVALID_PARAMETER)", 2)
var raw = self.send_status_report(msg, 0x01, 0x0000, 0x0002, false)
return false
end
# record the initiator_session_id # record the initiator_session_id
self.future_initiator_session_id = pbkdfparamreq.initiator_session_id self.future_initiator_session_id = pbkdfparamreq.initiator_session_id
@ -119,7 +150,7 @@ class Matter_Commisioning_Context
self.PBKDFParamResponse = pbkdfparamresp_raw self.PBKDFParamResponse = pbkdfparamresp_raw
var resp = msg.build_response(0x21 #-PBKDR Response-#, true) var resp = msg.build_response(0x21 #-PBKDR Response-#, true)
var raw = resp.encode(pbkdfparamresp_raw) var raw = resp.encode_frame(pbkdfparamresp_raw)
self.responder.send_response(raw, msg.remote_ip, msg.remote_port, resp.message_counter) self.responder.send_response(raw, msg.remote_ip, msg.remote_port, resp.message_counter)
end end
@ -128,7 +159,10 @@ class Matter_Commisioning_Context
import crypto import crypto
# sanity checks # sanity checks
if msg.opcode != 0x22 || msg.local_session_id != 0 || msg.protocol_id != 0 if msg.opcode != 0x22 || msg.local_session_id != 0 || msg.protocol_id != 0
raise "protocol_error", "invalid Pake1 message" tasmota.log("MTR: invalid Pake1 message", 2)
tasmota.log("MTR: StatusReport(General Code: FAILURE, ProtocolId: SECURE_CHANNEL, ProtocolCode: INVALID_PARAMETER)", 2)
var raw = self.send_status_report(msg, 0x01, 0x0000, 0x0002, false)
return false
end end
var pake1 = matter.Pake1().parse(msg.raw, msg.app_payload_idx) var pake1 = matter.Pake1().parse(msg.raw, msg.app_payload_idx)
@ -196,7 +230,7 @@ class Matter_Commisioning_Context
# now package the response message # now package the response message
var resp = msg.build_response(0x23 #-pake-2-#, true) # no reliable flag var resp = msg.build_response(0x23 #-pake-2-#, true) # no reliable flag
var raw = resp.encode(pake2_raw) var raw = resp.encode_frame(pake2_raw)
self.responder.send_response(raw, msg.remote_ip, msg.remote_port, resp.message_counter) self.responder.send_response(raw, msg.remote_ip, msg.remote_port, resp.message_counter)
end end
@ -205,7 +239,10 @@ class Matter_Commisioning_Context
import crypto import crypto
# sanity checks # sanity checks
if msg.opcode != 0x24 || msg.local_session_id != 0 || msg.protocol_id != 0 if msg.opcode != 0x24 || msg.local_session_id != 0 || msg.protocol_id != 0
raise "protocol_error", "invalid Pake3 message" tasmota.log("MTR: invalid Pake3 message", 2)
tasmota.log("MTR: StatusReport(General Code: FAILURE, ProtocolId: SECURE_CHANNEL, ProtocolCode: INVALID_PARAMETER)", 2)
var raw = self.send_status_report(msg, 0x01, 0x0000, 0x0002, false)
return false
end end
var pake3 = matter.Pake3().parse(msg.raw, msg.app_payload_idx) var pake3 = matter.Pake3().parse(msg.raw, msg.app_payload_idx)
@ -213,7 +250,12 @@ class Matter_Commisioning_Context
tasmota.log("MTR: received cA=" + self.cA.tohex(), 4) tasmota.log("MTR: received cA=" + self.cA.tohex(), 4)
# check the value against computed # check the value against computed
if self.cA != self.spake.cA raise "protocol_error", "invalid cA received" end if self.cA != self.spake.cA
tasmota.log("MTR: invalid cA received", 2)
tasmota.log("MTR: StatusReport(General Code: FAILURE, ProtocolId: SECURE_CHANNEL, ProtocolCode: INVALID_PARAMETER)", 2)
var raw = self.send_status_report(msg, 0x01, 0x0000, 0x0002, false)
return false
end
# send PakeFinished and compute session key # send PakeFinished and compute session key
self.created = tasmota.rtc()['utc'] self.created = tasmota.rtc()['utc']
@ -229,17 +271,9 @@ class Matter_Commisioning_Context
tasmota.log("MTR: AC =" + self.AttestationChallenge.tohex(), 4) tasmota.log("MTR: AC =" + self.AttestationChallenge.tohex(), 4)
tasmota.log("MTR: ******************************", 4) tasmota.log("MTR: ******************************", 4)
# now package the response message # StatusReport(GeneralCode: SUCCESS, ProtocolId: SECURE_CHANNEL, ProtocolCode: SESSION_ESTABLISHMENT_SUCCESS)
var resp = msg.build_response(0x40 #-StatusReport-#, false) # no reliable flag var raw = self.send_status_report(msg, 0x00, 0x0000, 0x0000, false)
var status_raw = bytes()
status_raw.add(0x00, 2) # GeneralCode = SUCCESS
status_raw.add(0x0000, 4) # ProtocolID = 0 (PROTOCOL_ID_SECURE_CHANNEL)
status_raw.add(0x0000, 4) # ProtocolCode = 0 (SESSION_ESTABLISHMENT_SUCCESS)
var raw = resp.encode(status_raw)
self.responder.send_response(raw, msg.remote_ip, msg.remote_port, nil)
self.responder.add_session(self.future_local_session_id, self.future_initiator_session_id, self.I2RKey, self.R2IKey, self.AttestationChallenge, self.created) self.responder.add_session(self.future_local_session_id, self.future_initiator_session_id, self.I2RKey, self.R2IKey, self.AttestationChallenge, self.created)
end end
@ -270,7 +304,10 @@ class Matter_Commisioning_Context
import crypto import crypto
# sanity checks # sanity checks
if msg.opcode != 0x30 || msg.local_session_id != 0 || msg.protocol_id != 0 if msg.opcode != 0x30 || msg.local_session_id != 0 || msg.protocol_id != 0
raise "protocol_error", "invalid Pake1 message" tasmota.log("MTR: invalid Sigma1 message", 2)
tasmota.log("MTR: StatusReport(General Code: FAILURE, ProtocolId: SECURE_CHANNEL, ProtocolCode: INVALID_PARAMETER)", 2)
var raw = self.send_status_report(msg, 0x01, 0x0000, 0x0002, false)
return false
end end
var sigma1 = matter.Sigma1().parse(msg.raw, msg.app_payload_idx) var sigma1 = matter.Sigma1().parse(msg.raw, msg.app_payload_idx)
@ -288,7 +325,11 @@ class Matter_Commisioning_Context
var fabric = self.find_fabric_by_destination_id(sigma1.destinationId, sigma1.initiatorRandom) var fabric = self.find_fabric_by_destination_id(sigma1.destinationId, sigma1.initiatorRandom)
session._fabric = fabric session._fabric = fabric
end end
if session == nil || session._fabric == nil raise "valuer_error", "StatusReport(GeneralCode: FAILURE, ProtocolId: SECURE_CHANNEL, ProtocolCode: NO_SHARED_TRUST_ROOTS)" end if session == nil || session._fabric == nil
tasmota.log("MTR: StatusReport(GeneralCode: FAILURE, ProtocolId: SECURE_CHANNEL, ProtocolCode: NO_SHARED_TRUST_ROOTS)", 2)
var raw = self.send_status_report(msg, 0x01, 0x0000, 0x0001, false)
return false
end
session._source_node_id = msg.source_node_id session._source_node_id = msg.source_node_id
session.set_mode_CASE() session.set_mode_CASE()
@ -361,7 +402,7 @@ class Matter_Commisioning_Context
# now package the response message # now package the response message
var resp = msg.build_response(0x33 #-sigma-2-resume-#, true) var resp = msg.build_response(0x33 #-sigma-2-resume-#, true)
var raw = resp.encode(sigma2resume_raw) var raw = resp.encode_frame(sigma2resume_raw)
self.responder.send_response(raw, msg.remote_ip, msg.remote_port, resp.message_counter) self.responder.send_response(raw, msg.remote_ip, msg.remote_port, resp.message_counter)
@ -440,7 +481,7 @@ class Matter_Commisioning_Context
# now package the response message # now package the response message
var resp = msg.build_response(0x31 #-sigma-2-#, true) # no reliable flag var resp = msg.build_response(0x31 #-sigma-2-#, true) # no reliable flag
var raw = resp.encode(sigma2_raw) var raw = resp.encode_frame(sigma2_raw)
self.responder.send_response(raw, msg.remote_ip, msg.remote_port, resp.message_counter) self.responder.send_response(raw, msg.remote_ip, msg.remote_port, resp.message_counter)
return true return true
@ -453,7 +494,9 @@ class Matter_Commisioning_Context
import crypto import crypto
# sanity checks # sanity checks
if msg.opcode != 0x32 || msg.local_session_id != 0 || msg.protocol_id != 0 if msg.opcode != 0x32 || msg.local_session_id != 0 || msg.protocol_id != 0
raise "protocol_error", "invalid Pake1 message" tasmota.log("MTR: StatusReport(General Code: FAILURE, ProtocolId: SECURE_CHANNEL, ProtocolCode: INVALID_PARAMETER)", 2)
var raw = self.send_status_report(msg, 0x01, 0x0000, 0x0002, false)
return false
end end
var session = msg.session var session = msg.session
var sigma3 = matter.Sigma3().parse(msg.raw, msg.app_payload_idx) var sigma3 = matter.Sigma3().parse(msg.raw, msg.app_payload_idx)
@ -486,7 +529,12 @@ class Matter_Commisioning_Context
tasmota.log("MTR: * tag_sent = " + tag.tohex(), 4) tasmota.log("MTR: * tag_sent = " + tag.tohex(), 4)
tasmota.log("****************************************", 4) tasmota.log("****************************************", 4)
if TBETag3 != tag raise "value_error", "tag do not match" end if TBETag3 != tag
tasmota.log("MTR: Tag don't match", 2)
tasmota.log("MTR: StatusReport(General Code: FAILURE, ProtocolId: SECURE_CHANNEL, ProtocolCode: INVALID_PARAMETER)", 2)
var raw = self.send_status_report(msg, 0x01, 0x0000, 0x0002, false)
return false
end
var TBEData3TLV = matter.TLV.parse(TBEData3) var TBEData3TLV = matter.TLV.parse(TBEData3)
var initiatorNOC = TBEData3TLV.findsubval(1) var initiatorNOC = TBEData3TLV.findsubval(1)
@ -517,7 +565,12 @@ class Matter_Commisioning_Context
# `crypto.EC_P256().ecdsa_verify_sha256(public_key:bytes(65), message:bytes(), hash:bytes()) -> bool` # `crypto.EC_P256().ecdsa_verify_sha256(public_key:bytes(65), message:bytes(), hash:bytes()) -> bool`
var sigma3_tbs_valid = crypto.EC_P256().ecdsa_verify_sha256(initiatorNOCPubKey, sigma3_tbs_raw, ec_signature) var sigma3_tbs_valid = crypto.EC_P256().ecdsa_verify_sha256(initiatorNOCPubKey, sigma3_tbs_raw, ec_signature)
if !sigma3_tbs_valid raise "value_error", "sigma3_tbs does not have a valid signature" end if !sigma3_tbs_valid
tasmota.log("MTR: sigma3_tbs does not have a valid signature", 2)
tasmota.log("MTR: StatusReport(General Code: FAILURE, ProtocolId: SECURE_CHANNEL, ProtocolCode: INVALID_PARAMETER)", 2)
var raw = self.send_status_report(msg, 0x01, 0x0000, 0x0002, false)
return false
end
# All good, compute new keys # All good, compute new keys
tasmota.log("MTR: Sigma3 verified, computing new keys", 3) tasmota.log("MTR: Sigma3 verified, computing new keys", 3)
@ -546,17 +599,8 @@ class Matter_Commisioning_Context
tasmota.log("MTR: AC =" + ac.tohex(), 4) tasmota.log("MTR: AC =" + ac.tohex(), 4)
tasmota.log("MTR: ******************************", 4) tasmota.log("MTR: ******************************", 4)
# Send success status report # StatusReport(GeneralCode: SUCCESS, ProtocolId: SECURE_CHANNEL, ProtocolCode: SESSION_ESTABLISHMENT_SUCCESS)
var resp = msg.build_response(0x40 #-StatusReport-#, true) # reliable flag var raw = self.send_status_report(msg, 0x00, 0x0000, 0x0000, true)
var status_raw = bytes()
status_raw.add(0x00, 2) # GeneralCode = SUCCESS
status_raw.add(0x0000, 4) # ProtocolID = 0 (PROTOCOL_ID_SECURE_CHANNEL)
status_raw.add(0x0000, 4) # ProtocolCode = 0 (SESSION_ESTABLISHMENT_SUCCESS)
var raw = resp.encode(status_raw)
self.responder.send_response(raw, msg.remote_ip, msg.remote_port, resp.message_counter)
session.close() session.close()
session.set_keys(i2r, r2i, ac, created) session.set_keys(i2r, r2i, ac, created)

View File

@ -84,7 +84,7 @@ class Matter_PBKDFParamResponse
s2.add_TLV(1, matter.TLV.U4, self.SLEEPY_IDLE_INTERVAL) s2.add_TLV(1, matter.TLV.U4, self.SLEEPY_IDLE_INTERVAL)
s2.add_TLV(2, matter.TLV.U4, self.SLEEPY_ACTIVE_INTERVAL) s2.add_TLV(2, matter.TLV.U4, self.SLEEPY_ACTIVE_INTERVAL)
end end
return s.encode() return s.encode(b)
end end
end end
matter.PBKDFParamResponse = Matter_PBKDFParamResponse matter.PBKDFParamResponse = Matter_PBKDFParamResponse
@ -118,7 +118,7 @@ class Matter_Pake2
# #
s.add_TLV(1, matter.TLV.B1, self.pB) s.add_TLV(1, matter.TLV.B1, self.pB)
s.add_TLV(2, matter.TLV.B1, self.cB) s.add_TLV(2, matter.TLV.B1, self.cB)
return s.encode() return s.encode(b)
end end
end end
matter.Pake2 = Matter_Pake2 matter.Pake2 = Matter_Pake2
@ -198,7 +198,7 @@ class Matter_Sigma2
s2.add_TLV(1, matter.TLV.U4, self.SLEEPY_IDLE_INTERVAL) s2.add_TLV(1, matter.TLV.U4, self.SLEEPY_IDLE_INTERVAL)
s2.add_TLV(2, matter.TLV.U4, self.SLEEPY_ACTIVE_INTERVAL) s2.add_TLV(2, matter.TLV.U4, self.SLEEPY_ACTIVE_INTERVAL)
end end
return s.encode() return s.encode(b)
end end
end end
matter.Sigma2 = Matter_Sigma2 matter.Sigma2 = Matter_Sigma2
@ -224,7 +224,7 @@ class Matter_Sigma2Resume
s2.add_TLV(1, matter.TLV.U4, self.SLEEPY_IDLE_INTERVAL) s2.add_TLV(1, matter.TLV.U4, self.SLEEPY_IDLE_INTERVAL)
s2.add_TLV(2, matter.TLV.U4, self.SLEEPY_ACTIVE_INTERVAL) s2.add_TLV(2, matter.TLV.U4, self.SLEEPY_ACTIVE_INTERVAL)
end end
return s.encode() return s.encode(b)
end end
end end
matter.Sigma2Resume = Matter_Sigma2Resume matter.Sigma2Resume = Matter_Sigma2Resume

View File

@ -48,9 +48,9 @@ class Matter_Device
var hostname_eth # MAC-derived hostname for commissioning var hostname_eth # MAC-derived hostname for commissioning
var vendorid var vendorid
var productid var productid
# MDNS active announces # mDNS active announces
var mdns_pase_eth # do we have an active PASE mdns announce for eth var mdns_pase_eth # do we have an active PASE mDNS announce for eth
var mdns_pase_wifi # do we have an active PASE mdns announce for wifi var mdns_pase_wifi # do we have an active PASE mDNS announce for wifi
# saved in parameters # saved in parameters
var root_discriminator var root_discriminator
var root_passcode var root_passcode
@ -80,17 +80,18 @@ class Matter_Device
self.ipv4only = false self.ipv4only = false
self.load_param() self.load_param()
self.commissioning_instance_wifi = crypto.random(8).tohex() # 16 characters random hostname
self.commissioning_instance_eth = crypto.random(8).tohex() # 16 characters random hostname
self.sessions = matter.Session_Store() self.sessions = matter.Session_Store()
self.sessions.load_fabrics() self.sessions.load_fabrics()
self.message_handler = matter.MessageHandler(self) self.message_handler = matter.MessageHandler(self)
self.ui = matter.UI(self) self.ui = matter.UI(self)
# add the default plugin # add the default plugin
self.plugins.push(matter.Plugin_Root(self), 0) self.plugins.push(matter.Plugin_Root(self, 0))
self.plugins.push(matter.Plugin_OnOff(self), 1, 0 #-tasmota relay 1-#) self.plugins.push(matter.Plugin_OnOff(self, 1, 0#-tasmota relay 1-#))
# self.plugins.push(matter.Plugin_Temp_Sensor(self, 2, "ESP32#Temperature"))
# for now read sensors every 5 seconds
tasmota.add_cron("*/5 * * * * *", def () self.trigger_read_sensors() end, "matter_sensors_5s")
self.start_mdns_announce_hostnames() self.start_mdns_announce_hostnames()
@ -135,12 +136,12 @@ class Matter_Device
end end
##################################################################### #####################################################################
# Remove a fabric and clean all corresponding values and MDNS entries # Remove a fabric and clean all corresponding values and mDNS entries
def remove_fabric(fabric) def remove_fabric(fabric)
self.message_handler.im.subs.remove_by_fabric(fabric) self.message_handler.im.subs.remove_by_fabric(fabric)
self.sessions.remove_fabric(fabric) self.sessions.remove_fabric(fabric)
self.sessions.save_fabrics() self.sessions.save_fabrics()
# TODO remove MDNS entries # TODO remove mDNS entries
end end
############################################################# #############################################################
@ -269,6 +270,27 @@ class Matter_Device
end end
end end
#############################################################
# trigger a read_sensors and dispatch to plugins
def trigger_read_sensors()
import json
var rs_json = tasmota.read_sensors()
var rs = json.load(rs_json)
if rs != nil
# call all plugins
var idx = 0
while idx < size(self.plugins)
self.plugins[idx].parse_sensors(rs)
idx += 1
end
else
tasmota.log("MTR: unable to parse read_sensors: "+rs_json, 3)
end
end
############################################################# #############################################################
# dispatch every 250ms click to sub-objects that need it # dispatch every 250ms click to sub-objects that need it
def every_250ms() def every_250ms()
@ -437,34 +459,32 @@ class Matter_Device
var all = {} # map of {endpoint: {cluster: {attributes:[pi]}} var all = {} # map of {endpoint: {cluster: {attributes:[pi]}}
tasmota.log(string.format("MTR: endpoint=%s cluster=%s attribute=%s", endpoint, cluster, attribute), 4) tasmota.log(string.format("MTR: endpoint=%s cluster=%s attribute=%s", endpoint, cluster, attribute), 4)
for pi: self.plugins for pi: self.plugins
var ep_list = pi.get_endpoints() # get supported endpoints for this plugin var ep = pi.get_endpoint() # get supported endpoints for this plugin
tasmota.log(string.format("MTR: pi=%s ep_list=%s", str(pi), str(ep_list)), 4)
for ep: ep_list
if endpoint != nil && ep != endpoint continue end # skip if specific endpoint and no match
# from now on, 'ep' is a good candidate
if !all.contains(ep) all[ep] = {} end # create empty structure if not already in the list
endpoint_found = true
# now explore the cluster list for 'ep' if endpoint != nil && ep != endpoint continue end # skip if specific endpoint and no match
var cluster_list = pi.get_cluster_list(ep) # cluster_list is the actual list of candidate cluster for this pluging and endpoint # from now on, 'ep' is a good candidate
tasmota.log(string.format("MTR: pi=%s ep=%s cl_list=%s", str(pi), str(ep), str(cluster_list)), 4) if !all.contains(ep) all[ep] = {} end # create empty structure if not already in the list
for cl: cluster_list endpoint_found = true
if cluster != nil && cl != cluster continue end # skip if specific cluster and no match
# from now on, 'cl' is a good candidate
if !all[ep].contains(cl) all[ep][cl] = {} end
cluster_found = true
# now filter on attributes # now explore the cluster list for 'ep'
var attr_list = pi.get_attribute_list(ep, cl) var cluster_list = pi.get_cluster_list(ep) # cluster_list is the actual list of candidate cluster for this pluging and endpoint
tasmota.log(string.format("MTR: pi=%s ep=%s cl=%s at_list=%s", str(pi), str(ep), str(cl), str(attr_list)), 4) tasmota.log(string.format("MTR: pi=%s ep=%s cl_list=%s", str(pi), str(ep), str(cluster_list)), 4)
for at: attr_list for cl: cluster_list
if attribute != nil && at != attribute continue end # skip if specific attribute and no match if cluster != nil && cl != cluster continue end # skip if specific cluster and no match
# from now on, 'at' is a good candidate # from now on, 'cl' is a good candidate
if !all[ep][cl].contains(at) all[ep][cl][at] = [] end if !all[ep].contains(cl) all[ep][cl] = {} end
attribute_found = true cluster_found = true
all[ep][cl][at].push(pi) # add plugin to the list # now filter on attributes
end var attr_list = pi.get_attribute_list(ep, cl)
tasmota.log(string.format("MTR: pi=%s ep=%s cl=%s at_list=%s", str(pi), str(ep), str(cl), str(attr_list)), 4)
for at: attr_list
if attribute != nil && at != attribute continue end # skip if specific attribute and no match
# from now on, 'at' is a good candidate
if !all[ep][cl].contains(at) all[ep][cl][at] = [] end
attribute_found = true
all[ep][cl][at].push(pi) # add plugin to the list
end end
end end
end end
@ -507,12 +527,10 @@ class Matter_Device
def get_active_endpoints(exclude_zero) def get_active_endpoints(exclude_zero)
var ret = [] var ret = []
for p:self.plugins for p:self.plugins
var e = p.get_endpoints() var ep = p.get_endpoint()
for elt:e if exclude_zero && ep == 0 continue end
if exclude_zero && elt == 0 continue end if ret.find(ep) == nil
if ret.find(elt) == nil ret.push(ep)
ret.push(elt)
end
end end
end end
return ret return ret
@ -594,9 +612,9 @@ class Matter_Device
end end
############################################################# #############################################################
# MDNS Configuration # mDNS Configuration
############################################################# #############################################################
# Start MDNS and announce hostnames for Wifi and ETH from MAC # Start mDNS and announce hostnames for Wifi and ETH from MAC
# #
# When the announce is active, `hostname_wifi` and `hostname_eth` # When the announce is active, `hostname_wifi` and `hostname_eth`
# are defined # are defined
@ -669,6 +687,7 @@ class Matter_Device
def mdns_announce_PASE() def mdns_announce_PASE()
import mdns import mdns
import string import string
import crypto
var services = { var services = {
"VP":str(self.vendorid) + "+" + str(self.productid), "VP":str(self.vendorid) + "+" + str(self.productid),
@ -678,6 +697,9 @@ class Matter_Device
"SII":5000, "SAI":300 "SII":5000, "SAI":300
} }
self.commissioning_instance_wifi = crypto.random(8).tohex() # 16 characters random hostname
self.commissioning_instance_eth = crypto.random(8).tohex() # 16 characters random hostname
try try
if self.hostname_eth if self.hostname_eth
# Add Matter `_matterc._udp` service # Add Matter `_matterc._udp` service
@ -740,13 +762,13 @@ class Matter_Device
try try
if self.mdns_pase_eth if self.mdns_pase_eth
tasmota.log(string.format("MTR: calling mdns.remove_service(%s, %s, %s, %s)", "_matterc", "_udp", self.commissioning_instance_eth, self.hostname_eth), 3) tasmota.log(string.format("MTR: calling mdns.remove_service(%s, %s, %s, %s)", "_matterc", "_udp", self.commissioning_instance_eth, self.hostname_eth), 3)
tasmota.log(string.format("MTR: remove mdns on %s '%s'", "eth", self.commissioning_instance_eth), 2) tasmota.log(string.format("MTR: remove mDNS on %s '%s'", "eth", self.commissioning_instance_eth), 2)
self.mdns_pase_eth = false self.mdns_pase_eth = false
mdns.remove_service("_matterc", "_udp", self.commissioning_instance_eth, self.hostname_eth) mdns.remove_service("_matterc", "_udp", self.commissioning_instance_eth, self.hostname_eth)
end end
if self.mdns_pase_wifi if self.mdns_pase_wifi
tasmota.log(string.format("MTR: calling mdns.remove_service(%s, %s, %s, %s)", "_matterc", "_udp", self.commissioning_instance_wifi, self.hostname_wifi), 3) tasmota.log(string.format("MTR: calling mdns.remove_service(%s, %s, %s, %s)", "_matterc", "_udp", self.commissioning_instance_wifi, self.hostname_wifi), 3)
tasmota.log(string.format("MTR: remove mdns on %s '%s'", "wifi", self.commissioning_instance_wifi), 2) tasmota.log(string.format("MTR: remove mDNS on %s '%s'", "wifi", self.commissioning_instance_wifi), 2)
self.mdns_pase_wifi = false self.mdns_pase_wifi = false
mdns.remove_service("_matterc", "_udp", self.commissioning_instance_wifi, self.hostname_wifi) mdns.remove_service("_matterc", "_udp", self.commissioning_instance_wifi, self.hostname_wifi)
end end
@ -795,6 +817,49 @@ class Matter_Device
tasmota.log("MTR: Exception" + str(e) + "|" + str(m), 2) tasmota.log("MTR: Exception" + str(e) + "|" + str(m), 2)
end end
end end
#############################################################
# Remove all mDNS announces
def mdns_remove_op_discovery_all_fabrics()
for fabric: self.sessions.active_fabrics()
if fabric.get_device_id() && fabric.get_fabric_id()
self.mdns_remove_op_discovery(fabric)
end
end
end
#############################################################
# Start UDP mDNS announcements for commissioning
def mdns_remove_op_discovery(fabric)
import mdns
import string
try
var device_id = fabric.get_device_id().copy().reverse()
var k_fabric = fabric.get_fabric_compressed()
var op_node = k_fabric.tohex() + "-" + device_id.tohex()
# mdns
if (tasmota.eth().find("up"))
tasmota.log(string.format("MTR: remove mDNS on %s '%s'", "eth", op_node), 2)
mdns.remove_service("_matter", "_tcp", op_node, self.hostname_eth)
end
if (tasmota.wifi().find("up"))
tasmota.log(string.format("MTR: remove mDNS on %s '%s'", "wifi", op_node), 2)
mdns.remove_service("_matter", "_tcp", op_node, self.hostname_wifi)
end
except .. as e, m
tasmota.log("MTR: Exception" + str(e) + "|" + str(m), 2)
end
end
#############################################################
# Try to clean MDNS entries before restart
#
def save_before_restart()
self.stop_basic_commissioning()
self.mdns_remove_op_discovery_all_fabrics()
end
end end
matter.Device = Matter_Device matter.Device = Matter_Device

View File

@ -64,7 +64,7 @@ matter.Path = Matter_Path
# Superclass for all IM responses # Superclass for all IM responses
################################################################################# #################################################################################
class Matter_IM_Message class Matter_IM_Message
static var MSG_TIMEOUT = 10000 # 10s static var MSG_TIMEOUT = 5000 # 5s
var expiration # expiration time for the reporting var expiration # expiration time for the reporting
var resp # response Frame object var resp # response Frame object
var ready # bool: ready to send (true) or wait (false) var ready # bool: ready to send (true) or wait (false)
@ -112,7 +112,7 @@ class Matter_IM_Message
# default responder for data # default responder for data
def send(responder) def send(responder)
var resp = self.resp var resp = self.resp
resp.encode(self.data.to_TLV().encode()) # payload in cleartext resp.encode_frame(self.data.to_TLV().encode()) # payload in cleartext
resp.encrypt() resp.encrypt()
responder.send_response(resp.raw, resp.remote_ip, resp.remote_port, resp.message_counter) responder.send_response(resp.raw, resp.remote_ip, resp.remote_port, resp.message_counter)
return true return true
@ -187,19 +187,19 @@ class Matter_IM_ReportData : Matter_IM_Message
# default responder for data # default responder for data
def send(responder) def send(responder)
import string import string
var resp = self.resp var resp = self.resp # response frame object
var ret = self.data var data = self.data # TLV data of the response (if any)
var was_chunked = ret.more_chunked_messages # is this following a chunked packet? var was_chunked = data.more_chunked_messages # is this following a chunked packet?
# compute the acceptable size # compute the acceptable size
var msg_sz = 0 var msg_sz = 0 # message size up to now
var elements = 0 var elements = 0 # number of elements added
if size(ret.attribute_reports) > 0 if size(data.attribute_reports) > 0
msg_sz = ret.attribute_reports[0].to_TLV().encode_len() msg_sz = data.attribute_reports[0].to_TLV().encode_len()
elements = 1 elements = 1
end end
while msg_sz < self.MAX_MESSAGE && elements < size(ret.attribute_reports) while msg_sz < self.MAX_MESSAGE && elements < size(data.attribute_reports)
var next_sz = ret.attribute_reports[elements].to_TLV().encode_len() var next_sz = data.attribute_reports[elements].to_TLV().encode_len()
if msg_sz + next_sz < self.MAX_MESSAGE if msg_sz + next_sz < self.MAX_MESSAGE
msg_sz += next_sz msg_sz += next_sz
elements += 1 elements += 1
@ -208,28 +208,36 @@ class Matter_IM_ReportData : Matter_IM_Message
end end
end end
tasmota.log(string.format("MTR: elements=%i msg_sz=%i total=%i", elements, msg_sz, size(ret.attribute_reports)), 4)
var next_elemnts = ret.attribute_reports[elements .. ] tasmota.log(string.format("MTR: elements=%i msg_sz=%i total=%i", elements, msg_sz, size(data.attribute_reports)), 3)
ret.attribute_reports = ret.attribute_reports[0 .. elements - 1] var next_elemnts = data.attribute_reports[elements .. ]
ret.more_chunked_messages = (size(next_elemnts) > 0) data.attribute_reports = data.attribute_reports[0 .. elements - 1]
data.more_chunked_messages = (size(next_elemnts) > 0)
if was_chunked if was_chunked
tasmota.log(string.format("MTR: Read_Attr next_chunk exch=%i", self.get_exchangeid()), 3) tasmota.log(string.format("MTR: Read_Attr next_chunk exch=%i", self.get_exchangeid()), 3)
end end
if ret.more_chunked_messages if data.more_chunked_messages
if !was_chunked if !was_chunked
tasmota.log(string.format("MTR: Read_Attr first_chunk exch=%i", self.get_exchangeid()), 3) tasmota.log(string.format("MTR: Read_Attr first_chunk exch=%i", self.get_exchangeid()), 3)
end end
tasmota.log("MTR: sending TLV" + str(ret), 3) # tasmota.log("MTR: sending TLV" + str(data), 4)
end end
resp.encode(self.data.to_TLV().encode()) # payload in cleartext # print(">>>>> send elements before encode")
var raw_tlv = self.data.to_TLV()
# print(">>>>> send elements before encode 2")
var encoded_tlv = raw_tlv.encode(bytes(self.MAX_MESSAGE)) # takes time
# print(">>>>> send elements before encode 3")
resp.encode_frame(encoded_tlv) # payload in cleartext, pre-allocate max buffer
# print(">>>>> send elements after encode")
resp.encrypt() resp.encrypt()
# print(">>>>> send elements after encrypt")
responder.send_response(resp.raw, resp.remote_ip, resp.remote_port, resp.message_counter) responder.send_response(resp.raw, resp.remote_ip, resp.remote_port, resp.message_counter)
if size(next_elemnts) > 0 if size(next_elemnts) > 0
ret.attribute_reports = next_elemnts data.attribute_reports = next_elemnts
tasmota.log("MTR: to_be_sent_later TLV" + str(ret), 3) # tasmota.log("MTR: to_be_sent_later TLV" + str(data), 3)
return false # keep alive return false # keep alive
else else
return true # finished, remove return true # finished, remove
@ -269,6 +277,7 @@ class Matter_IM_ReportDataSubscribed : Matter_IM_ReportData
if !self.report_data_phase if !self.report_data_phase
# if ack is received while all data is sent, means that it finished without error # if ack is received while all data is sent, means that it finished without error
self.ready = true self.ready = true
self.sub.re_arm() # signal that we can proceed to next sub report
return true # proceed to calling send() which removes the message return true # proceed to calling send() which removes the message
else else
return false # do nothing return false # do nothing
@ -304,7 +313,7 @@ class Matter_IM_ReportDataSubscribed : Matter_IM_ReportData
else else
# send a simple ACK # send a simple ACK
var resp = self.resp.build_standalone_ack() var resp = self.resp.build_standalone_ack()
resp.encode() resp.encode_frame()
resp.encrypt() resp.encrypt()
responder.send_response(resp.raw, resp.remote_ip, resp.remote_port, resp.message_counter) responder.send_response(resp.raw, resp.remote_ip, resp.remote_port, resp.message_counter)
return true # we received a ack(), just finish return true # we received a ack(), just finish
@ -357,12 +366,19 @@ class Matter_IM_SubscribeResponse : Matter_IM_ReportData
sr.max_interval = self.sub.max_interval sr.max_interval = self.sub.max_interval
self.resp.opcode = 0x04 #- Subscribe Response -# self.resp.opcode = 0x04 #- Subscribe Response -#
resp.encode(sr.to_TLV().encode()) # payload in cleartext resp.encode_frame(sr.to_TLV().encode()) # payload in cleartext
resp.encrypt() resp.encrypt()
responder.send_response(resp.raw, resp.remote_ip, resp.remote_port, resp.message_counter) responder.send_response(resp.raw, resp.remote_ip, resp.remote_port, resp.message_counter)
self.sub.re_arm()
return true return true
end end
end end
# Status ok received
def status_ok_received(msg)
# once we receive ack, open flow for subscriptions
return super(self).status_ok_received(msg)
end
end end
matter.IM_SubscribeResponse = Matter_IM_SubscribeResponse matter.IM_SubscribeResponse = Matter_IM_SubscribeResponse

View File

@ -40,6 +40,7 @@ class Matter_IM_Subscription
# manage time # manage time
var not_before # rate-limiting var not_before # rate-limiting
var expiration # expiration epoch, we need to respond before var expiration # expiration epoch, we need to respond before
var wait_status # if `true` wait for Status Response before sending anything new
# updates # updates
var updates var updates
@ -59,6 +60,7 @@ class Matter_IM_Subscription
if max_interval > 3600 max_interval = 3600 end if max_interval > 3600 max_interval = 3600 end
max_interval = 60 max_interval = 60
self.max_interval = max_interval self.max_interval = max_interval
self.wait_status = false
self.fabric_filtered = req.fabric_filtered self.fabric_filtered = req.fabric_filtered
@ -75,9 +77,9 @@ class Matter_IM_Subscription
# update next time interval # update next time interval
self.updates = [] self.updates = []
self.clear_and_arm() self.clear_before_arm()
tasmota.log("MTR: new subsctiption " + matter.inspect(self), 3) # tasmota.log("MTR: new subsctiption " + matter.inspect(self), 3)
end end
# remove self from subs list # remove self from subs list
@ -87,8 +89,14 @@ class Matter_IM_Subscription
end end
# clear log after it was sent, and re-arm next expiration # clear log after it was sent, and re-arm next expiration
def clear_and_arm() def clear_before_arm()
self.updates.clear() self.updates.clear()
self.wait_status = true
end
# we received a complete ack for previous message, rearm
def re_arm()
self.wait_status = false
var now = tasmota.millis() var now = tasmota.millis()
self.expiration = now + (self.max_interval - self.MAX_INTERVAL_MARGIN) * 1000 self.expiration = now + (self.max_interval - self.MAX_INTERVAL_MARGIN) * 1000
self.not_before = now + self.min_interval * 1000 - 1 self.not_before = now + self.min_interval * 1000 - 1
@ -206,9 +214,9 @@ class Matter_IM_Subscription_Shop
var idx = 0 var idx = 0
while idx < size(self.subs) while idx < size(self.subs)
var sub = self.subs[idx] var sub = self.subs[idx]
if size(sub.updates) > 0 && tasmota.time_reached(sub.not_before) if !sub.wait_status && size(sub.updates) > 0 && tasmota.time_reached(sub.not_before)
self.im.send_subscribe_update(sub) self.im.send_subscribe_update(sub)
sub.clear_and_arm() sub.clear_before_arm()
end end
idx += 1 idx += 1
end end
@ -217,9 +225,9 @@ class Matter_IM_Subscription_Shop
idx = 0 idx = 0
while idx < size(self.subs) while idx < size(self.subs)
var sub = self.subs[idx] var sub = self.subs[idx]
if tasmota.time_reached(sub.expiration) if !sub.wait_status && tasmota.time_reached(sub.expiration)
self.im.send_subscribe_update(sub) self.im.send_subscribe_update(sub)
sub.clear_and_arm() sub.clear_before_arm()
end end
idx += 1 idx += 1
end end

View File

@ -171,7 +171,7 @@ class Matter_Frame
# #
# Header is built from attributes # Header is built from attributes
# `payload` is a bytes() buffer for the app payload # `payload` is a bytes() buffer for the app payload
def encode(payload) def encode_frame(payload)
var raw = bytes() var raw = bytes()
# compute flags # compute flags
if self.flags == nil if self.flags == nil

View File

@ -136,7 +136,7 @@ class Matter_MessageHandler
elif frame.x_flag_r # nothing to respond, check if we need a standalone ack elif frame.x_flag_r # nothing to respond, check if we need a standalone ack
var resp = frame.build_standalone_ack() var resp = frame.build_standalone_ack()
resp.encode() resp.encode_frame()
resp.encrypt() resp.encrypt()
self.send_response(resp.raw, resp.remote_ip, resp.remote_port, resp.message_counter) self.send_response(resp.raw, resp.remote_ip, resp.remote_port, resp.message_counter)
end end

View File

@ -26,7 +26,6 @@ class Matter_Plugin
static var EMPTY_LIST = [] static var EMPTY_LIST = []
static var EMPTY_MAP = {} static var EMPTY_MAP = {}
var device # reference to the `device` global object var device # reference to the `device` global object
var endpoints # list of supported endpoints TODO refactor
var endpoint # current endpoint var endpoint # current endpoint
var clusters # map from cluster to list of attributes var clusters # map from cluster to list of attributes
@ -38,23 +37,26 @@ class Matter_Plugin
############################################################# #############################################################
# Constructor # Constructor
#
def init(device, endpoint) def init(device, endpoint)
self.device = device self.device = device
self.endpoint = endpoint self.endpoint = endpoint
self.endpoints = self.EMPTY_LIST
self.clusters = self.EMPTY_LIST self.clusters = self.EMPTY_LIST
end end
############################################################# #############################################################
# signal that an attribute has been changed # signal that an attribute has been changed
#
# If `endpoint` is `nil`, send to all endpoints
def attribute_updated(endpoint, cluster, attribute, fabric_specific) def attribute_updated(endpoint, cluster, attribute, fabric_specific)
if endpoint == nil endpoint = self.endpoint end
self.device.attribute_updated(endpoint, cluster, attribute, fabric_specific) self.device.attribute_updated(endpoint, cluster, attribute, fabric_specific)
end end
############################################################# #############################################################
# Which endpoints does it handle (list of numbers) # Which endpoints does it handle (list of numbers)
def get_endpoints() def get_endpoint()
return self.endpoints return self.endpoint
end end
def get_cluster_map() def get_cluster_map()
return self.clusters return self.clusters
@ -137,6 +139,14 @@ class Matter_Plugin
return nil return nil
end end
#############################################################
# parse sensor
#
# The device calls regularly `tasmota.read_sensors()` and converts
# it to json.
def parse_sensors(payload)
end
############################################################# #############################################################
# every_second # every_second
def every_second() def every_second()

View File

@ -0,0 +1,144 @@
#
# Matter_Plugin_Device.be - implements the behavior for a standard Device
#
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# dummy declaration for solidification
class Matter_Plugin end
#@ solidify:Matter_Plugin_Device,weak
class Matter_Plugin_Device : Matter_Plugin
static var CLUSTERS = {
0x001D: [0,1,2,3,0xFFFC,0xFFFD], # Descriptor Cluster 9.5 p.453
0x0003: [0,1,0xFFFC,0xFFFD], # Identify 1.2 p.16
0x0004: [0,0xFFFC,0xFFFD], # Groups 1.3 p.21
}
static var TYPES = { 0x0000: 0 } # fake type
#############################################################
# Constructor
def init(device, endpoint, tasmota_relay_index)
super(self).init(device, endpoint)
self.clusters = self.CLUSTERS
end
#############################################################
# read an attribute
#
def read_attribute(session, ctx)
import string
var TLV = matter.TLV
var cluster = ctx.cluster
var attribute = ctx.attribute
if cluster == 0x001D # ========== Descriptor Cluster 9.5 p.453 ==========
if attribute == 0x0000 # ---------- DeviceTypeList / list[DeviceTypeStruct] ----------
var dtl = TLV.Matter_TLV_array()
for dt: self.TYPES.keys()
var d1 = dtl.add_struct()
d1.add_TLV(0, TLV.U2, dt) # DeviceType
d1.add_TLV(1, TLV.U2, self.TYPES[dt]) # Revision
end
return dtl
elif attribute == 0x0001 # ---------- ServerList / list[cluster-id] ----------
var sl = TLV.Matter_TLV_array()
for cl: self.get_cluster_list()
sl.add_TLV(nil, TLV.U4, cl)
end
return sl
elif attribute == 0x0002 # ---------- ClientList / list[cluster-id] ----------
var cl = TLV.Matter_TLV_array()
cl.add_TLV(nil, TLV.U2, 0x0006)
return cl
elif attribute == 0x0003 # ---------- PartsList / list[endpoint-no]----------
var pl = TLV.Matter_TLV_array()
return pl
elif attribute == 0xFFFC # ---------- FeatureMap / map32 ----------
return TLV.create_TLV(TLV.U4, 0) #
elif attribute == 0xFFFD # ---------- ClusterRevision / u2 ----------
return TLV.create_TLV(TLV.U4, 1) # "Initial Release"
end
# ====================================================================================================
elif cluster == 0x0003 # ========== Identify 1.2 p.16 ==========
if attribute == 0x0000 # ---------- IdentifyTime / u2 ----------
return TLV.create_TLV(TLV.U2, 0) # no identification in progress
elif attribute == 0x0001 # ---------- IdentifyType / enum8 ----------
return TLV.create_TLV(TLV.U1, 0) # IdentifyType = 0x00 None
elif attribute == 0xFFFC # ---------- FeatureMap / map32 ----------
return TLV.create_TLV(TLV.U4, 0) # no features
elif attribute == 0xFFFD # ---------- ClusterRevision / u2 ----------
return TLV.create_TLV(TLV.U4, 4) # "new data model format and notation"
end
# ====================================================================================================
elif cluster == 0x0004 # ========== Groups 1.3 p.21 ==========
if attribute == 0x0000 # ---------- ----------
return nil # TODO
elif attribute == 0xFFFC # ---------- FeatureMap / map32 ----------
return TLV.create_TLV(TLV.U4, 0)#
elif attribute == 0xFFFD # ---------- ClusterRevision / u2 ----------
return TLV.create_TLV(TLV.U4, 4)# "new data model format and notation"
end
else
return super(self).read_attribute(session, ctx)
end
end
#############################################################
# Invoke a command
#
# returns a TLV object if successful, contains the response
# or an `int` to indicate a status
def invoke_request(session, val, ctx)
var TLV = matter.TLV
var cluster = ctx.cluster
var command = ctx.command
# ====================================================================================================
if cluster == 0x0003 # ========== Identify 1.2 p.16 ==========
if command == 0x0000 # ---------- Identify ----------
# ignore
return true
elif command == 0x0001 # ---------- IdentifyQuery ----------
# create IdentifyQueryResponse
# ID=1
# 0=Certificate (octstr)
var iqr = TLV.Matter_TLV_struct()
iqr.add_TLV(0, TLV.U2, 0) # Timeout
ctx.command = 0x00 # IdentifyQueryResponse
return iqr
elif command == 0x0040 # ---------- TriggerEffect ----------
# ignore
return true
end
# ====================================================================================================
elif cluster == 0x0004 # ========== Groups 1.3 p.21 ==========
# TODO
return true
else
return super(self).invoke_request(session, val, ctx)
end
end
end
matter.Plugin_Device = Matter_Plugin_Device

View File

@ -25,7 +25,6 @@ class Matter_Plugin end
#@ solidify:Matter_Plugin_OnOff,weak #@ solidify:Matter_Plugin_OnOff,weak
class Matter_Plugin_OnOff : Matter_Plugin class Matter_Plugin_OnOff : Matter_Plugin
static var ENDPOINTS = [ 1 ]
static var CLUSTERS = { static var CLUSTERS = {
0x001D: [0,1,2,3,0xFFFC,0xFFFD], # Descriptor Cluster 9.5 p.453 0x001D: [0,1,2,3,0xFFFC,0xFFFD], # Descriptor Cluster 9.5 p.453
0x0003: [0,1,0xFFFC,0xFFFD], # Identify 1.2 p.16 0x0003: [0,1,0xFFFC,0xFFFD], # Identify 1.2 p.16
@ -43,8 +42,6 @@ class Matter_Plugin_OnOff : Matter_Plugin
# Constructor # Constructor
def init(device, endpoint, tasmota_relay_index) def init(device, endpoint, tasmota_relay_index)
super(self).init(device, endpoint) super(self).init(device, endpoint)
self.endpoints = self.ENDPOINTS
self.endpoint = self.ENDPOINTS[0] # TODO refactor endpoint management
self.clusters = self.CLUSTERS self.clusters = self.CLUSTERS
self.get_onoff() # read actual value self.get_onoff() # read actual value
if tasmota_relay_index == nil tasmota_relay_index = 0 end if tasmota_relay_index == nil tasmota_relay_index = 0 end
@ -107,9 +104,9 @@ class Matter_Plugin_OnOff : Matter_Plugin
var pl = TLV.Matter_TLV_array() var pl = TLV.Matter_TLV_array()
return pl return pl
elif attribute == 0xFFFC # ---------- FeatureMap / map32 ---------- elif attribute == 0xFFFC # ---------- FeatureMap / map32 ----------
return TLV.create_TLV(TLV.U4, 0) # 0 = no Level Control for Lighting return TLV.create_TLV(TLV.U4, 0) #
elif attribute == 0xFFFD # ---------- ClusterRevision / u2 ---------- elif attribute == 0xFFFD # ---------- ClusterRevision / u2 ----------
return TLV.create_TLV(TLV.U4, 1) # 0 = no Level Control for Lighting return TLV.create_TLV(TLV.U4, 1) # "Initial Release"
end end
# ==================================================================================================== # ====================================================================================================
@ -119,9 +116,9 @@ class Matter_Plugin_OnOff : Matter_Plugin
elif attribute == 0x0001 # ---------- IdentifyType / enum8 ---------- elif attribute == 0x0001 # ---------- IdentifyType / enum8 ----------
return TLV.create_TLV(TLV.U1, 0) # IdentifyType = 0x00 None return TLV.create_TLV(TLV.U1, 0) # IdentifyType = 0x00 None
elif attribute == 0xFFFC # ---------- FeatureMap / map32 ---------- elif attribute == 0xFFFC # ---------- FeatureMap / map32 ----------
return TLV.create_TLV(TLV.U4, 0) # 0 = no Level Control for Lighting return TLV.create_TLV(TLV.U4, 0) # no features
elif attribute == 0xFFFD # ---------- ClusterRevision / u2 ---------- elif attribute == 0xFFFD # ---------- ClusterRevision / u2 ----------
return TLV.create_TLV(TLV.U4, 4) # 0 = no Level Control for Lighting return TLV.create_TLV(TLV.U4, 4) # "new data model format and notation"
end end
# ==================================================================================================== # ====================================================================================================
@ -129,9 +126,9 @@ class Matter_Plugin_OnOff : Matter_Plugin
if attribute == 0x0000 # ---------- ---------- if attribute == 0x0000 # ---------- ----------
return nil # TODO return nil # TODO
elif attribute == 0xFFFC # ---------- FeatureMap / map32 ---------- elif attribute == 0xFFFC # ---------- FeatureMap / map32 ----------
return TLV.create_TLV(TLV.U4, 0) # 0 = no Level Control for Lighting return TLV.create_TLV(TLV.U4, 0)#
elif attribute == 0xFFFD # ---------- ClusterRevision / u2 ---------- elif attribute == 0xFFFD # ---------- ClusterRevision / u2 ----------
return TLV.create_TLV(TLV.U4, 4) # 0 = no Level Control for Lighting return TLV.create_TLV(TLV.U4, 4)# "new data model format and notation"
end end
# ==================================================================================================== # ====================================================================================================
@ -243,7 +240,7 @@ class Matter_Plugin_OnOff : Matter_Plugin
############################################################# #############################################################
# Signal that onoff attribute changed # Signal that onoff attribute changed
def onoff_changed() def onoff_changed()
self.attribute_updated(self.endpoint, 0x0006, 0x0000) self.attribute_updated(nil, 0x0006, 0x0000) # send to all endpoints
end end
############################################################# #############################################################
@ -253,4 +250,3 @@ class Matter_Plugin_OnOff : Matter_Plugin
end end
end end
matter.Plugin_OnOff = Matter_Plugin_OnOff matter.Plugin_OnOff = Matter_Plugin_OnOff

View File

@ -25,11 +25,10 @@ class Matter_Plugin end
#@ solidify:Matter_Plugin_Root,weak #@ solidify:Matter_Plugin_Root,weak
class Matter_Plugin_Root : Matter_Plugin class Matter_Plugin_Root : Matter_Plugin
static var ENDPOINTS = [ 0 ]
static var CLUSTERS = { static var CLUSTERS = {
0x001D: [0,1,2,3], # Descriptor Cluster 9.5 p.453 0x001D: [0,1,2,3], # Descriptor Cluster 9.5 p.453
0x001F: [0,2,3,4], # Access Control Cluster, p.461 0x001F: [0,2,3,4], # Access Control Cluster, p.461
0x0028: [0,1,2,3,4,5,6,7,8,9,0x0F,0x12,0x13],# Basic Information Cluster cluster 11.1 p.565 0x0028: [0,1,2,3,4,5,6,7,8,9,0x0A,0x0F,0x12,0x13],# Basic Information Cluster cluster 11.1 p.565
# 0x002A: [0,1,2,3], # OTA Software Update Requestor Cluster Definition 11.19.7 p.762 # 0x002A: [0,1,2,3], # OTA Software Update Requestor Cluster Definition 11.19.7 p.762
0x002B: [0,1], # Localization Configuration Cluster 11.3 p.580 0x002B: [0,1], # Localization Configuration Cluster 11.3 p.580
0x002C: [0,1,2], # Time Format Localization Cluster 11.4 p.581 0x002C: [0,1,2], # Time Format Localization Cluster 11.4 p.581
@ -49,7 +48,6 @@ class Matter_Plugin_Root : Matter_Plugin
# Constructor # Constructor
def init(device, endpoint) def init(device, endpoint)
super(self).init(device, endpoint) super(self).init(device, endpoint)
self.endpoints = self.ENDPOINTS
self.clusters = self.CLUSTERS self.clusters = self.CLUSTERS
end end

View File

@ -0,0 +1,110 @@
#
# Matter_Plugin_Temp_Sensor.be - implements the behavior for a Temperature Sensor
#
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Matter plug-in for core behavior
# dummy declaration for solidification
class Matter_Plugin_Device end
#@ solidify:Matter_Plugin_Temp_Sensor,weak
class Matter_Plugin_Temp_Sensor : Matter_Plugin_Device
static var CLUSTERS = {
0x001D: [0,1,2,3,0xFFFC,0xFFFD], # Descriptor Cluster 9.5 p.453
0x0003: [0,1,0xFFFC,0xFFFD], # Identify 1.2 p.16
0x0004: [0,0xFFFC,0xFFFD], # Groups 1.3 p.21
0x0402: [0,1,2], # Temperature Measurement p.97 - no writable
}
static var TYPES = { 0x0302: 2 } # Temperature Sensor, rev 2
var tasmota_sensor_filter # Rule-type filter to the value, like "ESP32#Temperature"
var tasmota_sensor_matcher # Actual matcher object
var shadow_temperature # fake status for now # TODO
#############################################################
# Constructor
def init(device, endpoint, sensor_filter)
super(self).init(device, endpoint)
self.clusters = self.CLUSTERS
self.tasmota_sensor_filter = sensor_filter
self.tasmota_sensor_matcher = tasmota.Rule_Matcher.parse(sensor_filter)
end
#############################################################
# parse sensor
#
# The device calls regularly `tasmota.read_sensors()` and converts
# it to json.
def parse_sensors(payload)
if self.tasmota_sensor_matcher
var val = real(self.tasmota_sensor_matcher.match(payload))
if val != nil
# import string
# tasmota.log(string.format("MTR: update temperature for endpoint %i - %.1f C", self.endpoint,), 3)
if val != self.shadow_temperature
self.attribute_updated(nil, 0x0402, 0x0000)
end
self.shadow_temperature = val
end
end
end
#############################################################
# get_temperature
#
# Update shadow and signal any change
def get_temperature()
return self.shadow_temperature
end
#############################################################
# read an attribute
#
def read_attribute(session, ctx)
import string
var TLV = matter.TLV
var cluster = ctx.cluster
var attribute = ctx.attribute
# ====================================================================================================
if cluster == 0x0402 # ========== Temperature Measurement 2.3 p.97 ==========
if attribute == 0x0000 # ---------- MeasuredValue / i16 (*100) ----------
if self.shadow_temperature != nil
return TLV.create_TLV(TLV.I2, int(self.shadow_temperature * 100))
else
return TLV.create_TLV(TLV.NULL, nil)
end
elif attribute == 0x0001 # ---------- MinMeasuredValue / i16 (*100) ----------
return TLV.create_TLV(TLV.I2, -5000) # -50 °C
elif attribute == 0x0002 # ---------- MaxMeasuredValue / i16 (*100) ----------
return TLV.create_TLV(TLV.I2, 15000) # 150 °C
end
else
return super(self).read_attribute(session, ctx)
end
end
#############################################################
# every_second
def every_second()
self.get_temperature() # force reading value and sending subscriptions
end
end
matter.Plugin_Temp_Sensor = Matter_Plugin_Temp_Sensor

View File

@ -755,8 +755,8 @@ class Matter_Session_Store
session = matter.Session(self, 0, 0) session = matter.Session(self, 0, 0)
session._source_node_id = source_node_id session._source_node_id = source_node_id
self.sessions.push(session) self.sessions.push(session)
session.set_expire_in_seconds(expire)
end end
session.set_expire_in_seconds(expire)
session.update() session.update()
return session return session
end end

View File

@ -610,8 +610,9 @@ class Matter_TLV
# encode tag and type # encode tag and type
self._encode_tag(b) self._encode_tag(b)
# sort values # sort values
var val_list = self.val.copy() var val_list = self.val
if self.is_struct if self.is_struct
val_list = val_list.copy()
self.sort(val_list) self.sort(val_list)
end end

View File

@ -151,7 +151,7 @@ be_local_closure(Matter_PBKDFParamResponse_encode, /* name */
}), }),
be_str_weak(encode), be_str_weak(encode),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[70]) { /* code */ ( &(const binstruction[71]) { /* code */
0xB80A0000, // 0000 GETNGBL R2 K0 0xB80A0000, // 0000 GETNGBL R2 K0
0x88080501, // 0001 GETMBR R2 R2 K1 0x88080501, // 0001 GETMBR R2 R2 K1
0x8C080502, // 0002 GETMET R2 R2 K2 0x8C080502, // 0002 GETMET R2 R2 K2
@ -220,8 +220,9 @@ be_local_closure(Matter_PBKDFParamResponse_encode, /* name */
0x88240111, // 0041 GETMBR R9 R0 K17 0x88240111, // 0041 GETMBR R9 R0 K17
0x7C140800, // 0042 CALL R5 4 0x7C140800, // 0042 CALL R5 4
0x8C100512, // 0043 GETMET R4 R2 K18 0x8C100512, // 0043 GETMET R4 R2 K18
0x7C100200, // 0044 CALL R4 1 0x5C180200, // 0044 MOVE R6 R1
0x80040800, // 0045 RET 1 R4 0x7C100400, // 0045 CALL R4 2
0x80040800, // 0046 RET 1 R4
}) })
) )
); );
@ -364,7 +365,7 @@ be_local_closure(Matter_Pake2_encode, /* name */
}), }),
be_str_weak(encode), be_str_weak(encode),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[21]) { /* code */ ( &(const binstruction[22]) { /* code */
0xB80A0000, // 0000 GETNGBL R2 K0 0xB80A0000, // 0000 GETNGBL R2 K0
0x88080501, // 0001 GETMBR R2 R2 K1 0x88080501, // 0001 GETMBR R2 R2 K1
0x8C080502, // 0002 GETMET R2 R2 K2 0x8C080502, // 0002 GETMET R2 R2 K2
@ -384,8 +385,9 @@ be_local_closure(Matter_Pake2_encode, /* name */
0x881C0108, // 0010 GETMBR R7 R0 K8 0x881C0108, // 0010 GETMBR R7 R0 K8
0x7C0C0800, // 0011 CALL R3 4 0x7C0C0800, // 0011 CALL R3 4
0x8C0C0509, // 0012 GETMET R3 R2 K9 0x8C0C0509, // 0012 GETMET R3 R2 K9
0x7C0C0200, // 0013 CALL R3 1 0x5C140200, // 0013 MOVE R5 R1
0x80040600, // 0014 RET 1 R3 0x7C0C0400, // 0014 CALL R3 2
0x80040600, // 0015 RET 1 R3
}) })
) )
); );
@ -665,7 +667,7 @@ be_local_closure(Matter_Sigma2_encode, /* name */
}), }),
be_str_weak(encode), be_str_weak(encode),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[60]) { /* code */ ( &(const binstruction[61]) { /* code */
0xB80A0000, // 0000 GETNGBL R2 K0 0xB80A0000, // 0000 GETNGBL R2 K0
0x88080501, // 0001 GETMBR R2 R2 K1 0x88080501, // 0001 GETMBR R2 R2 K1
0x8C080502, // 0002 GETMET R2 R2 K2 0x8C080502, // 0002 GETMET R2 R2 K2
@ -724,8 +726,9 @@ be_local_closure(Matter_Sigma2_encode, /* name */
0x8820010E, // 0037 GETMBR R8 R0 K14 0x8820010E, // 0037 GETMBR R8 R0 K14
0x7C100800, // 0038 CALL R4 4 0x7C100800, // 0038 CALL R4 4
0x8C0C0511, // 0039 GETMET R3 R2 K17 0x8C0C0511, // 0039 GETMET R3 R2 K17
0x7C0C0200, // 003A CALL R3 1 0x5C140200, // 003A MOVE R5 R1
0x80040600, // 003B RET 1 R3 0x7C0C0400, // 003B CALL R3 2
0x80040600, // 003C RET 1 R3
}) })
) )
); );
@ -793,7 +796,7 @@ be_local_closure(Matter_Sigma2Resume_encode, /* name */
}), }),
be_str_weak(encode), be_str_weak(encode),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[53]) { /* code */ ( &(const binstruction[54]) { /* code */
0xB80A0000, // 0000 GETNGBL R2 K0 0xB80A0000, // 0000 GETNGBL R2 K0
0x88080501, // 0001 GETMBR R2 R2 K1 0x88080501, // 0001 GETMBR R2 R2 K1
0x8C080502, // 0002 GETMET R2 R2 K2 0x8C080502, // 0002 GETMET R2 R2 K2
@ -845,8 +848,9 @@ be_local_closure(Matter_Sigma2Resume_encode, /* name */
0x8820010C, // 0030 GETMBR R8 R0 K12 0x8820010C, // 0030 GETMBR R8 R0 K12
0x7C100800, // 0031 CALL R4 4 0x7C100800, // 0031 CALL R4 4
0x8C0C050F, // 0032 GETMET R3 R2 K15 0x8C0C050F, // 0032 GETMET R3 R2 K15
0x7C0C0200, // 0033 CALL R3 1 0x5C140200, // 0033 MOVE R5 R1
0x80040600, // 0034 RET 1 R3 0x7C0C0400, // 0034 CALL R3 2
0x80040600, // 0035 RET 1 R3
}) })
) )
); );

View File

@ -237,17 +237,18 @@ be_local_closure(Matter_IM_Message_send, /* name */
0, /* has sup protos */ 0, /* has sup protos */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
( &(const bvalue[10]) { /* constants */ ( &(const bvalue[11]) { /* constants */
/* K0 */ be_nested_str_weak(resp), /* K0 */ be_nested_str_weak(resp),
/* K1 */ be_nested_str_weak(encode), /* K1 */ be_nested_str_weak(encode_frame),
/* K2 */ be_nested_str_weak(data), /* K2 */ be_nested_str_weak(data),
/* K3 */ be_nested_str_weak(to_TLV), /* K3 */ be_nested_str_weak(to_TLV),
/* K4 */ be_nested_str_weak(encrypt), /* K4 */ be_nested_str_weak(encode),
/* K5 */ be_nested_str_weak(send_response), /* K5 */ be_nested_str_weak(encrypt),
/* K6 */ be_nested_str_weak(raw), /* K6 */ be_nested_str_weak(send_response),
/* K7 */ be_nested_str_weak(remote_ip), /* K7 */ be_nested_str_weak(raw),
/* K8 */ be_nested_str_weak(remote_port), /* K8 */ be_nested_str_weak(remote_ip),
/* K9 */ be_nested_str_weak(message_counter), /* K9 */ be_nested_str_weak(remote_port),
/* K10 */ be_nested_str_weak(message_counter),
}), }),
be_str_weak(send), be_str_weak(send),
&be_const_str_solidified, &be_const_str_solidified,
@ -257,16 +258,16 @@ be_local_closure(Matter_IM_Message_send, /* name */
0x88140102, // 0002 GETMBR R5 R0 K2 0x88140102, // 0002 GETMBR R5 R0 K2
0x8C140B03, // 0003 GETMET R5 R5 K3 0x8C140B03, // 0003 GETMET R5 R5 K3
0x7C140200, // 0004 CALL R5 1 0x7C140200, // 0004 CALL R5 1
0x8C140B01, // 0005 GETMET R5 R5 K1 0x8C140B04, // 0005 GETMET R5 R5 K4
0x7C140200, // 0006 CALL R5 1 0x7C140200, // 0006 CALL R5 1
0x7C0C0400, // 0007 CALL R3 2 0x7C0C0400, // 0007 CALL R3 2
0x8C0C0504, // 0008 GETMET R3 R2 K4 0x8C0C0505, // 0008 GETMET R3 R2 K5
0x7C0C0200, // 0009 CALL R3 1 0x7C0C0200, // 0009 CALL R3 1
0x8C0C0305, // 000A GETMET R3 R1 K5 0x8C0C0306, // 000A GETMET R3 R1 K6
0x88140506, // 000B GETMBR R5 R2 K6 0x88140507, // 000B GETMBR R5 R2 K7
0x88180507, // 000C GETMBR R6 R2 K7 0x88180508, // 000C GETMBR R6 R2 K8
0x881C0508, // 000D GETMBR R7 R2 K8 0x881C0509, // 000D GETMBR R7 R2 K9
0x88200509, // 000E GETMBR R8 R2 K9 0x8820050A, // 000E GETMBR R8 R2 K10
0x7C0C0A00, // 000F CALL R3 5 0x7C0C0A00, // 000F CALL R3 5
0x500C0200, // 0010 LDBOOL R3 1 0 0x500C0200, // 0010 LDBOOL R3 1 0
0x80040600, // 0011 RET 1 R3 0x80040600, // 0011 RET 1 R3
@ -427,7 +428,7 @@ be_local_class(Matter_IM_Message,
{ be_const_key_weak(send, -1), be_const_closure(Matter_IM_Message_send_closure) }, { be_const_key_weak(send, -1), be_const_closure(Matter_IM_Message_send_closure) },
{ be_const_key_weak(ack_received, -1), be_const_closure(Matter_IM_Message_ack_received_closure) }, { be_const_key_weak(ack_received, -1), be_const_closure(Matter_IM_Message_ack_received_closure) },
{ be_const_key_weak(status_ok_received, 11), be_const_closure(Matter_IM_Message_status_ok_received_closure) }, { be_const_key_weak(status_ok_received, 11), be_const_closure(Matter_IM_Message_status_ok_received_closure) },
{ be_const_key_weak(MSG_TIMEOUT, -1), be_const_int(10000) }, { be_const_key_weak(MSG_TIMEOUT, -1), be_const_int(5000) },
{ be_const_key_weak(ready, -1), be_const_var(2) }, { be_const_key_weak(ready, -1), be_const_var(2) },
})), })),
be_str_weak(Matter_IM_Message) be_str_weak(Matter_IM_Message)
@ -688,7 +689,7 @@ be_local_closure(Matter_IM_ReportData_send, /* name */
0, /* has sup protos */ 0, /* has sup protos */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
( &(const bvalue[28]) { /* constants */ ( &(const bvalue[27]) { /* constants */
/* K0 */ be_nested_str_weak(string), /* K0 */ be_nested_str_weak(string),
/* K1 */ be_nested_str_weak(resp), /* K1 */ be_nested_str_weak(resp),
/* K2 */ be_nested_str_weak(data), /* K2 */ be_nested_str_weak(data),
@ -703,24 +704,23 @@ be_local_closure(Matter_IM_ReportData_send, /* name */
/* K11 */ be_nested_str_weak(log), /* K11 */ be_nested_str_weak(log),
/* K12 */ be_nested_str_weak(format), /* K12 */ be_nested_str_weak(format),
/* K13 */ be_nested_str_weak(MTR_X3A_X20elements_X3D_X25i_X20msg_sz_X3D_X25i_X20total_X3D_X25i), /* K13 */ be_nested_str_weak(MTR_X3A_X20elements_X3D_X25i_X20msg_sz_X3D_X25i_X20total_X3D_X25i),
/* K14 */ be_const_int(2147483647), /* K14 */ be_const_int(3),
/* K15 */ be_nested_str_weak(MTR_X3A_X20Read_Attr_X20_X20next_chunk_X20exch_X3D_X25i), /* K15 */ be_const_int(2147483647),
/* K16 */ be_nested_str_weak(get_exchangeid), /* K16 */ be_nested_str_weak(MTR_X3A_X20Read_Attr_X20_X20next_chunk_X20exch_X3D_X25i),
/* K17 */ be_const_int(3), /* K17 */ be_nested_str_weak(get_exchangeid),
/* K18 */ be_nested_str_weak(MTR_X3A_X20Read_Attr_X20_X20first_chunk_X20exch_X3D_X25i), /* K18 */ be_nested_str_weak(MTR_X3A_X20Read_Attr_X20_X20first_chunk_X20exch_X3D_X25i),
/* K19 */ be_nested_str_weak(MTR_X3A_X20sending_X20TLV), /* K19 */ be_nested_str_weak(encode),
/* K20 */ be_nested_str_weak(encode), /* K20 */ be_nested_str_weak(encode_frame),
/* K21 */ be_nested_str_weak(encrypt), /* K21 */ be_nested_str_weak(encrypt),
/* K22 */ be_nested_str_weak(send_response), /* K22 */ be_nested_str_weak(send_response),
/* K23 */ be_nested_str_weak(raw), /* K23 */ be_nested_str_weak(raw),
/* K24 */ be_nested_str_weak(remote_ip), /* K24 */ be_nested_str_weak(remote_ip),
/* K25 */ be_nested_str_weak(remote_port), /* K25 */ be_nested_str_weak(remote_port),
/* K26 */ be_nested_str_weak(message_counter), /* K26 */ be_nested_str_weak(message_counter),
/* K27 */ be_nested_str_weak(MTR_X3A_X20to_be_sent_later_X20TLV),
}), }),
be_str_weak(send), be_str_weak(send),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[133]) { /* code */ ( &(const binstruction[121]) { /* code */
0xA40A0000, // 0000 IMPORT R2 K0 0xA40A0000, // 0000 IMPORT R2 K0
0x880C0101, // 0001 GETMBR R3 R0 K1 0x880C0101, // 0001 GETMBR R3 R0 K1
0x88100102, // 0002 GETMBR R4 R0 K2 0x88100102, // 0002 GETMBR R4 R0 K2
@ -773,9 +773,9 @@ be_local_closure(Matter_IM_ReportData_send, /* name */
0x88400905, // 0031 GETMBR R16 R4 K5 0x88400905, // 0031 GETMBR R16 R4 K5
0x7C3C0200, // 0032 CALL R15 1 0x7C3C0200, // 0032 CALL R15 1
0x7C280A00, // 0033 CALL R10 5 0x7C280A00, // 0033 CALL R10 5
0x542E0003, // 0034 LDINT R11 4 0x582C000E, // 0034 LDCONST R11 K14
0x7C200600, // 0035 CALL R8 3 0x7C200600, // 0035 CALL R8 3
0x40200F0E, // 0036 CONNECT R8 R7 K14 0x40200F0F, // 0036 CONNECT R8 R7 K15
0x88240905, // 0037 GETMBR R9 R4 K5 0x88240905, // 0037 GETMBR R9 R4 K5
0x94201208, // 0038 GETIDX R8 R9 R8 0x94201208, // 0038 GETIDX R8 R9 R8
0x04280F08, // 0039 SUB R10 R7 K8 0x04280F08, // 0039 SUB R10 R7 K8
@ -792,68 +792,56 @@ be_local_closure(Matter_IM_ReportData_send, /* name */
0xB82A1400, // 0044 GETNGBL R10 K10 0xB82A1400, // 0044 GETNGBL R10 K10
0x8C28150B, // 0045 GETMET R10 R10 K11 0x8C28150B, // 0045 GETMET R10 R10 K11
0x8C30050C, // 0046 GETMET R12 R2 K12 0x8C30050C, // 0046 GETMET R12 R2 K12
0x5838000F, // 0047 LDCONST R14 K15 0x58380010, // 0047 LDCONST R14 K16
0x8C3C0110, // 0048 GETMET R15 R0 K16 0x8C3C0111, // 0048 GETMET R15 R0 K17
0x7C3C0200, // 0049 CALL R15 1 0x7C3C0200, // 0049 CALL R15 1
0x7C300600, // 004A CALL R12 3 0x7C300600, // 004A CALL R12 3
0x58340011, // 004B LDCONST R13 K17 0x5834000E, // 004B LDCONST R13 K14
0x7C280600, // 004C CALL R10 3 0x7C280600, // 004C CALL R10 3
0x88240903, // 004D GETMBR R9 R4 K3 0x88240903, // 004D GETMBR R9 R4 K3
0x78260012, // 004E JMPF R9 #0062 0x7826000A, // 004E JMPF R9 #005A
0x5C240A00, // 004F MOVE R9 R5 0x5C240A00, // 004F MOVE R9 R5
0x74260008, // 0050 JMPT R9 #005A 0x74260008, // 0050 JMPT R9 #005A
0xB8261400, // 0051 GETNGBL R9 K10 0xB8261400, // 0051 GETNGBL R9 K10
0x8C24130B, // 0052 GETMET R9 R9 K11 0x8C24130B, // 0052 GETMET R9 R9 K11
0x8C2C050C, // 0053 GETMET R11 R2 K12 0x8C2C050C, // 0053 GETMET R11 R2 K12
0x58340012, // 0054 LDCONST R13 K18 0x58340012, // 0054 LDCONST R13 K18
0x8C380110, // 0055 GETMET R14 R0 K16 0x8C380111, // 0055 GETMET R14 R0 K17
0x7C380200, // 0056 CALL R14 1 0x7C380200, // 0056 CALL R14 1
0x7C2C0600, // 0057 CALL R11 3 0x7C2C0600, // 0057 CALL R11 3
0x58300011, // 0058 LDCONST R12 K17 0x5830000E, // 0058 LDCONST R12 K14
0x7C240600, // 0059 CALL R9 3 0x7C240600, // 0059 CALL R9 3
0xB8261400, // 005A GETNGBL R9 K10 0x88240102, // 005A GETMBR R9 R0 K2
0x8C24130B, // 005B GETMET R9 R9 K11 0x8C241306, // 005B GETMET R9 R9 K6
0x602C0008, // 005C GETGBL R11 G8 0x7C240200, // 005C CALL R9 1
0x5C300800, // 005D MOVE R12 R4 0x8C281313, // 005D GETMET R10 R9 K19
0x7C2C0200, // 005E CALL R11 1 0x60300015, // 005E GETGBL R12 G21
0x002E260B, // 005F ADD R11 K19 R11 0x88340109, // 005F GETMBR R13 R0 K9
0x58300011, // 0060 LDCONST R12 K17 0x7C300200, // 0060 CALL R12 1
0x7C240600, // 0061 CALL R9 3 0x7C280400, // 0061 CALL R10 2
0x8C240714, // 0062 GETMET R9 R3 K20 0x8C2C0714, // 0062 GETMET R11 R3 K20
0x882C0102, // 0063 GETMBR R11 R0 K2 0x5C341400, // 0063 MOVE R13 R10
0x8C2C1706, // 0064 GETMET R11 R11 K6 0x7C2C0400, // 0064 CALL R11 2
0x7C2C0200, // 0065 CALL R11 1 0x8C2C0715, // 0065 GETMET R11 R3 K21
0x8C2C1714, // 0066 GETMET R11 R11 K20 0x7C2C0200, // 0066 CALL R11 1
0x7C2C0200, // 0067 CALL R11 1 0x8C2C0316, // 0067 GETMET R11 R1 K22
0x7C240400, // 0068 CALL R9 2 0x88340717, // 0068 GETMBR R13 R3 K23
0x8C240715, // 0069 GETMET R9 R3 K21 0x88380718, // 0069 GETMBR R14 R3 K24
0x7C240200, // 006A CALL R9 1 0x883C0719, // 006A GETMBR R15 R3 K25
0x8C240316, // 006B GETMET R9 R1 K22 0x8840071A, // 006B GETMBR R16 R3 K26
0x882C0717, // 006C GETMBR R11 R3 K23 0x7C2C0A00, // 006C CALL R11 5
0x88300718, // 006D GETMBR R12 R3 K24 0x602C000C, // 006D GETGBL R11 G12
0x88340719, // 006E GETMBR R13 R3 K25 0x5C301000, // 006E MOVE R12 R8
0x8838071A, // 006F GETMBR R14 R3 K26 0x7C2C0200, // 006F CALL R11 1
0x7C240A00, // 0070 CALL R9 5 0x242C1704, // 0070 GT R11 R11 K4
0x6024000C, // 0071 GETGBL R9 G12 0x782E0003, // 0071 JMPF R11 #0076
0x5C281000, // 0072 MOVE R10 R8 0x90120A08, // 0072 SETMBR R4 K5 R8
0x7C240200, // 0073 CALL R9 1 0x502C0000, // 0073 LDBOOL R11 0 0
0x24241304, // 0074 GT R9 R9 K4 0x80041600, // 0074 RET 1 R11
0x7826000B, // 0075 JMPF R9 #0082 0x70020001, // 0075 JMP #0078
0x90120A08, // 0076 SETMBR R4 K5 R8 0x502C0200, // 0076 LDBOOL R11 1 0
0xB8261400, // 0077 GETNGBL R9 K10 0x80041600, // 0077 RET 1 R11
0x8C24130B, // 0078 GETMET R9 R9 K11 0x80000000, // 0078 RET 0
0x602C0008, // 0079 GETGBL R11 G8
0x5C300800, // 007A MOVE R12 R4
0x7C2C0200, // 007B CALL R11 1
0x002E360B, // 007C ADD R11 K27 R11
0x58300011, // 007D LDCONST R12 K17
0x7C240600, // 007E CALL R9 3
0x50240000, // 007F LDBOOL R9 0 0
0x80041200, // 0080 RET 1 R9
0x70020001, // 0081 JMP #0084
0x50240200, // 0082 LDBOOL R9 1 0
0x80041200, // 0083 RET 1 R9
0x80000000, // 0084 RET 0
}) })
) )
); );
@ -898,14 +886,16 @@ be_local_closure(Matter_IM_ReportDataSubscribed_ack_received, /* name */
0, /* has sup protos */ 0, /* has sup protos */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
( &(const bvalue[ 3]) { /* constants */ ( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_weak(ack_received), /* K0 */ be_nested_str_weak(ack_received),
/* K1 */ be_nested_str_weak(report_data_phase), /* K1 */ be_nested_str_weak(report_data_phase),
/* K2 */ be_nested_str_weak(ready), /* K2 */ be_nested_str_weak(ready),
/* K3 */ be_nested_str_weak(sub),
/* K4 */ be_nested_str_weak(re_arm),
}), }),
be_str_weak(ack_received), be_str_weak(ack_received),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[16]) { /* code */ ( &(const binstruction[19]) { /* code */
0x60080003, // 0000 GETGBL R2 G3 0x60080003, // 0000 GETGBL R2 G3
0x5C0C0000, // 0001 MOVE R3 R0 0x5C0C0000, // 0001 MOVE R3 R0
0x7C080200, // 0002 CALL R2 1 0x7C080200, // 0002 CALL R2 1
@ -913,15 +903,18 @@ be_local_closure(Matter_IM_ReportDataSubscribed_ack_received, /* name */
0x5C100200, // 0004 MOVE R4 R1 0x5C100200, // 0004 MOVE R4 R1
0x7C080400, // 0005 CALL R2 2 0x7C080400, // 0005 CALL R2 2
0x88080101, // 0006 GETMBR R2 R0 K1 0x88080101, // 0006 GETMBR R2 R0 K1
0x740A0004, // 0007 JMPT R2 #000D 0x740A0007, // 0007 JMPT R2 #0010
0x50080200, // 0008 LDBOOL R2 1 0 0x50080200, // 0008 LDBOOL R2 1 0
0x90020402, // 0009 SETMBR R0 K2 R2 0x90020402, // 0009 SETMBR R0 K2 R2
0x50080200, // 000A LDBOOL R2 1 0 0x88080103, // 000A GETMBR R2 R0 K3
0x80040400, // 000B RET 1 R2 0x8C080504, // 000B GETMET R2 R2 K4
0x70020001, // 000C JMP #000F 0x7C080200, // 000C CALL R2 1
0x50080000, // 000D LDBOOL R2 0 0 0x50080200, // 000D LDBOOL R2 1 0
0x80040400, // 000E RET 1 R2 0x80040400, // 000E RET 1 R2
0x80000000, // 000F RET 0 0x70020001, // 000F JMP #0012
0x50080000, // 0010 LDBOOL R2 0 0
0x80040400, // 0011 RET 1 R2
0x80000000, // 0012 RET 0
}) })
) )
); );
@ -1112,7 +1105,7 @@ be_local_closure(Matter_IM_ReportDataSubscribed_send, /* name */
/* K4 */ be_nested_str_weak(send), /* K4 */ be_nested_str_weak(send),
/* K5 */ be_nested_str_weak(resp), /* K5 */ be_nested_str_weak(resp),
/* K6 */ be_nested_str_weak(build_standalone_ack), /* K6 */ be_nested_str_weak(build_standalone_ack),
/* K7 */ be_nested_str_weak(encode), /* K7 */ be_nested_str_weak(encode_frame),
/* K8 */ be_nested_str_weak(encrypt), /* K8 */ be_nested_str_weak(encrypt),
/* K9 */ be_nested_str_weak(send_response), /* K9 */ be_nested_str_weak(send_response),
/* K10 */ be_nested_str_weak(raw), /* K10 */ be_nested_str_weak(raw),
@ -1252,6 +1245,38 @@ be_local_closure(Matter_IM_SubscribeResponse_init, /* name */
/*******************************************************************/ /*******************************************************************/
/********************************************************************
** Solidified function: status_ok_received
********************************************************************/
be_local_closure(Matter_IM_SubscribeResponse_status_ok_received, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(status_ok_received),
}),
be_str_weak(status_ok_received),
&be_const_str_solidified,
( &(const binstruction[ 7]) { /* code */
0x60080003, // 0000 GETGBL R2 G3
0x5C0C0000, // 0001 MOVE R3 R0
0x7C080200, // 0002 CALL R2 1
0x8C080500, // 0003 GETMET R2 R2 K0
0x5C100200, // 0004 MOVE R4 R1
0x7C080400, // 0005 CALL R2 2
0x80040400, // 0006 RET 1 R2
})
)
);
/*******************************************************************/
/******************************************************************** /********************************************************************
** Solidified function: send ** Solidified function: send
********************************************************************/ ********************************************************************/
@ -1265,7 +1290,7 @@ be_local_closure(Matter_IM_SubscribeResponse_send, /* name */
0, /* has sup protos */ 0, /* has sup protos */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
( &(const bvalue[17]) { /* constants */ ( &(const bvalue[19]) { /* constants */
/* K0 */ be_nested_str_weak(report_data_phase), /* K0 */ be_nested_str_weak(report_data_phase),
/* K1 */ be_nested_str_weak(send), /* K1 */ be_nested_str_weak(send),
/* K2 */ be_nested_str_weak(resp), /* K2 */ be_nested_str_weak(resp),
@ -1275,18 +1300,20 @@ be_local_closure(Matter_IM_SubscribeResponse_send, /* name */
/* K6 */ be_nested_str_weak(sub), /* K6 */ be_nested_str_weak(sub),
/* K7 */ be_nested_str_weak(max_interval), /* K7 */ be_nested_str_weak(max_interval),
/* K8 */ be_nested_str_weak(opcode), /* K8 */ be_nested_str_weak(opcode),
/* K9 */ be_nested_str_weak(encode), /* K9 */ be_nested_str_weak(encode_frame),
/* K10 */ be_nested_str_weak(to_TLV), /* K10 */ be_nested_str_weak(to_TLV),
/* K11 */ be_nested_str_weak(encrypt), /* K11 */ be_nested_str_weak(encode),
/* K12 */ be_nested_str_weak(send_response), /* K12 */ be_nested_str_weak(encrypt),
/* K13 */ be_nested_str_weak(raw), /* K13 */ be_nested_str_weak(send_response),
/* K14 */ be_nested_str_weak(remote_ip), /* K14 */ be_nested_str_weak(raw),
/* K15 */ be_nested_str_weak(remote_port), /* K15 */ be_nested_str_weak(remote_ip),
/* K16 */ be_nested_str_weak(message_counter), /* K16 */ be_nested_str_weak(remote_port),
/* K17 */ be_nested_str_weak(message_counter),
/* K18 */ be_nested_str_weak(re_arm),
}), }),
be_str_weak(send), be_str_weak(send),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[47]) { /* code */ ( &(const binstruction[50]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0 0x88080100, // 0000 GETMBR R2 R0 K0
0x780A000E, // 0001 JMPF R2 #0011 0x780A000E, // 0001 JMPF R2 #0011
0x60080003, // 0002 GETGBL R2 G3 0x60080003, // 0002 GETGBL R2 G3
@ -1303,7 +1330,7 @@ be_local_closure(Matter_IM_SubscribeResponse_send, /* name */
0x90020003, // 000D SETMBR R0 K0 R3 0x90020003, // 000D SETMBR R0 K0 R3
0x500C0000, // 000E LDBOOL R3 0 0 0x500C0000, // 000E LDBOOL R3 0 0
0x80040600, // 000F RET 1 R3 0x80040600, // 000F RET 1 R3
0x7002001C, // 0010 JMP #002E 0x7002001F, // 0010 JMP #0031
0x88080102, // 0011 GETMBR R2 R0 K2 0x88080102, // 0011 GETMBR R2 R0 K2
0xB80E0600, // 0012 GETNGBL R3 K3 0xB80E0600, // 0012 GETNGBL R3 K3
0x8C0C0704, // 0013 GETMET R3 R3 K4 0x8C0C0704, // 0013 GETMET R3 R3 K4
@ -1320,20 +1347,23 @@ be_local_closure(Matter_IM_SubscribeResponse_send, /* name */
0x8C100509, // 001E GETMET R4 R2 K9 0x8C100509, // 001E GETMET R4 R2 K9
0x8C18070A, // 001F GETMET R6 R3 K10 0x8C18070A, // 001F GETMET R6 R3 K10
0x7C180200, // 0020 CALL R6 1 0x7C180200, // 0020 CALL R6 1
0x8C180D09, // 0021 GETMET R6 R6 K9 0x8C180D0B, // 0021 GETMET R6 R6 K11
0x7C180200, // 0022 CALL R6 1 0x7C180200, // 0022 CALL R6 1
0x7C100400, // 0023 CALL R4 2 0x7C100400, // 0023 CALL R4 2
0x8C10050B, // 0024 GETMET R4 R2 K11 0x8C10050C, // 0024 GETMET R4 R2 K12
0x7C100200, // 0025 CALL R4 1 0x7C100200, // 0025 CALL R4 1
0x8C10030C, // 0026 GETMET R4 R1 K12 0x8C10030D, // 0026 GETMET R4 R1 K13
0x8818050D, // 0027 GETMBR R6 R2 K13 0x8818050E, // 0027 GETMBR R6 R2 K14
0x881C050E, // 0028 GETMBR R7 R2 K14 0x881C050F, // 0028 GETMBR R7 R2 K15
0x8820050F, // 0029 GETMBR R8 R2 K15 0x88200510, // 0029 GETMBR R8 R2 K16
0x88240510, // 002A GETMBR R9 R2 K16 0x88240511, // 002A GETMBR R9 R2 K17
0x7C100A00, // 002B CALL R4 5 0x7C100A00, // 002B CALL R4 5
0x50100200, // 002C LDBOOL R4 1 0 0x88100106, // 002C GETMBR R4 R0 K6
0x80040800, // 002D RET 1 R4 0x8C100912, // 002D GETMET R4 R4 K18
0x80000000, // 002E RET 0 0x7C100200, // 002E CALL R4 1
0x50100200, // 002F LDBOOL R4 1 0
0x80040800, // 0030 RET 1 R4
0x80000000, // 0031 RET 0
}) })
) )
); );
@ -1347,12 +1377,13 @@ extern const bclass be_class_Matter_IM_ReportData;
be_local_class(Matter_IM_SubscribeResponse, be_local_class(Matter_IM_SubscribeResponse,
2, 2,
&be_class_Matter_IM_ReportData, &be_class_Matter_IM_ReportData,
be_nested_map(4, be_nested_map(5,
( (struct bmapnode*) &(const bmapnode[]) { ( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(init, 3), be_const_closure(Matter_IM_SubscribeResponse_init_closure) },
{ be_const_key_weak(sub, 4), be_const_var(0) },
{ be_const_key_weak(status_ok_received, -1), be_const_closure(Matter_IM_SubscribeResponse_status_ok_received_closure) },
{ be_const_key_weak(report_data_phase, -1), be_const_var(1) }, { be_const_key_weak(report_data_phase, -1), be_const_var(1) },
{ be_const_key_weak(sub, -1), be_const_var(0) },
{ be_const_key_weak(send, -1), be_const_closure(Matter_IM_SubscribeResponse_send_closure) }, { be_const_key_weak(send, -1), be_const_closure(Matter_IM_SubscribeResponse_send_closure) },
{ be_const_key_weak(init, 2), be_const_closure(Matter_IM_SubscribeResponse_init_closure) },
})), })),
be_str_weak(Matter_IM_SubscribeResponse) be_str_weak(Matter_IM_SubscribeResponse)
); );

View File

@ -7,11 +7,11 @@
extern const bclass be_class_Matter_IM_Subscription; extern const bclass be_class_Matter_IM_Subscription;
/******************************************************************** /********************************************************************
** Solidified function: remove_self ** Solidified function: re_arm
********************************************************************/ ********************************************************************/
be_local_closure(Matter_IM_Subscription_remove_self, /* name */ be_local_closure(Matter_IM_Subscription_re_arm, /* name */
be_nested_proto( be_nested_proto(
5, /* nstack */ 4, /* nstack */
1, /* argc */ 1, /* argc */
2, /* varg */ 2, /* varg */
0, /* has upvals */ 0, /* has upvals */
@ -19,144 +19,39 @@ be_local_closure(Matter_IM_Subscription_remove_self, /* name */
0, /* has sup protos */ 0, /* has sup protos */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
( &(const bvalue[ 6]) { /* constants */ ( &(const bvalue[ 9]) { /* constants */
/* K0 */ be_nested_str_weak(tasmota), /* K0 */ be_nested_str_weak(wait_status),
/* K1 */ be_nested_str_weak(log), /* K1 */ be_nested_str_weak(tasmota),
/* K2 */ be_nested_str_weak(MTR_X3A_X20Remove_Sub_X20sub_id_X3D), /* K2 */ be_nested_str_weak(millis),
/* K3 */ be_nested_str_weak(subscription_id), /* K3 */ be_nested_str_weak(expiration),
/* K4 */ be_nested_str_weak(subs), /* K4 */ be_nested_str_weak(max_interval),
/* K5 */ be_nested_str_weak(remove_sub), /* K5 */ be_nested_str_weak(MAX_INTERVAL_MARGIN),
/* K6 */ be_nested_str_weak(not_before),
/* K7 */ be_nested_str_weak(min_interval),
/* K8 */ be_const_int(1),
}), }),
be_str_weak(remove_self), be_str_weak(re_arm),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[12]) { /* code */ ( &(const binstruction[19]) { /* code */
0xB8060000, // 0000 GETNGBL R1 K0 0x50040000, // 0000 LDBOOL R1 0 0
0x8C040301, // 0001 GETMET R1 R1 K1 0x90020001, // 0001 SETMBR R0 K0 R1
0x600C0008, // 0002 GETGBL R3 G8 0xB8060200, // 0002 GETNGBL R1 K1
0x88100103, // 0003 GETMBR R4 R0 K3 0x8C040302, // 0003 GETMET R1 R1 K2
0x7C0C0200, // 0004 CALL R3 1 0x7C040200, // 0004 CALL R1 1
0x000E0403, // 0005 ADD R3 K2 R3 0x88080104, // 0005 GETMBR R2 R0 K4
0x7C040400, // 0006 CALL R1 2 0x880C0105, // 0006 GETMBR R3 R0 K5
0x88040104, // 0007 GETMBR R1 R0 K4 0x04080403, // 0007 SUB R2 R2 R3
0x8C040305, // 0008 GETMET R1 R1 K5 0x540E03E7, // 0008 LDINT R3 1000
0x5C0C0000, // 0009 MOVE R3 R0 0x08080403, // 0009 MUL R2 R2 R3
0x7C040400, // 000A CALL R1 2 0x00080202, // 000A ADD R2 R1 R2
0x80000000, // 000B RET 0 0x90020602, // 000B SETMBR R0 K3 R2
}) 0x88080107, // 000C GETMBR R2 R0 K7
) 0x540E03E7, // 000D LDINT R3 1000
); 0x08080403, // 000E MUL R2 R2 R3
/*******************************************************************/ 0x00080202, // 000F ADD R2 R1 R2
0x04080508, // 0010 SUB R2 R2 K8
0x90020C02, // 0011 SETMBR R0 K6 R2
/******************************************************************** 0x80000000, // 0012 RET 0
** Solidified function: init
********************************************************************/
be_local_closure(Matter_IM_Subscription_init, /* name */
be_nested_proto(
13, /* nstack */
5, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[25]) { /* constants */
/* K0 */ be_nested_str_weak(subs),
/* K1 */ be_nested_str_weak(subscription_id),
/* K2 */ be_nested_str_weak(session),
/* K3 */ be_nested_str_weak(min_interval_floor),
/* K4 */ be_const_int(0),
/* K5 */ be_nested_str_weak(min_interval),
/* K6 */ be_nested_str_weak(max_interval_ceiling),
/* K7 */ be_nested_str_weak(max_interval),
/* K8 */ be_nested_str_weak(fabric_filtered),
/* K9 */ be_nested_str_weak(path_list),
/* K10 */ be_nested_str_weak(attributes_requests),
/* K11 */ be_nested_str_weak(matter),
/* K12 */ be_nested_str_weak(Path),
/* K13 */ be_nested_str_weak(endpoint),
/* K14 */ be_nested_str_weak(cluster),
/* K15 */ be_nested_str_weak(attribute),
/* K16 */ be_nested_str_weak(push),
/* K17 */ be_nested_str_weak(stop_iteration),
/* K18 */ be_nested_str_weak(updates),
/* K19 */ be_nested_str_weak(clear_and_arm),
/* K20 */ be_nested_str_weak(tasmota),
/* K21 */ be_nested_str_weak(log),
/* K22 */ be_nested_str_weak(MTR_X3A_X20new_X20subsctiption_X20),
/* K23 */ be_nested_str_weak(inspect),
/* K24 */ be_const_int(3),
}),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[66]) { /* code */
0x90020001, // 0000 SETMBR R0 K0 R1
0x90020202, // 0001 SETMBR R0 K1 R2
0x90020403, // 0002 SETMBR R0 K2 R3
0x88140903, // 0003 GETMBR R5 R4 K3
0x14180B04, // 0004 LT R6 R5 K4
0x781A0000, // 0005 JMPF R6 #0007
0x58140004, // 0006 LDCONST R5 K4
0x541A003B, // 0007 LDINT R6 60
0x24180A06, // 0008 GT R6 R5 R6
0x781A0000, // 0009 JMPF R6 #000B
0x5416003B, // 000A LDINT R5 60
0x90020A05, // 000B SETMBR R0 K5 R5
0x88180906, // 000C GETMBR R6 R4 K6
0x541E003B, // 000D LDINT R7 60
0x141C0C07, // 000E LT R7 R6 R7
0x781E0000, // 000F JMPF R7 #0011
0x541A003B, // 0010 LDINT R6 60
0x541E0E0F, // 0011 LDINT R7 3600
0x241C0C07, // 0012 GT R7 R6 R7
0x781E0000, // 0013 JMPF R7 #0015
0x541A0E0F, // 0014 LDINT R6 3600
0x541A003B, // 0015 LDINT R6 60
0x90020E06, // 0016 SETMBR R0 K7 R6
0x881C0908, // 0017 GETMBR R7 R4 K8
0x90021007, // 0018 SETMBR R0 K8 R7
0x601C0012, // 0019 GETGBL R7 G18
0x7C1C0000, // 001A CALL R7 0
0x90021207, // 001B SETMBR R0 K9 R7
0x601C0010, // 001C GETGBL R7 G16
0x8820090A, // 001D GETMBR R8 R4 K10
0x7C1C0200, // 001E CALL R7 1
0xA802000F, // 001F EXBLK 0 #0030
0x5C200E00, // 0020 MOVE R8 R7
0x7C200000, // 0021 CALL R8 0
0xB8261600, // 0022 GETNGBL R9 K11
0x8C24130C, // 0023 GETMET R9 R9 K12
0x7C240200, // 0024 CALL R9 1
0x8828110D, // 0025 GETMBR R10 R8 K13
0x90261A0A, // 0026 SETMBR R9 K13 R10
0x8828110E, // 0027 GETMBR R10 R8 K14
0x90261C0A, // 0028 SETMBR R9 K14 R10
0x8828110F, // 0029 GETMBR R10 R8 K15
0x90261E0A, // 002A SETMBR R9 K15 R10
0x88280109, // 002B GETMBR R10 R0 K9
0x8C281510, // 002C GETMET R10 R10 K16
0x5C301200, // 002D MOVE R12 R9
0x7C280400, // 002E CALL R10 2
0x7001FFEF, // 002F JMP #0020
0x581C0011, // 0030 LDCONST R7 K17
0xAC1C0200, // 0031 CATCH R7 1 0
0xB0080000, // 0032 RAISE 2 R0 R0
0x601C0012, // 0033 GETGBL R7 G18
0x7C1C0000, // 0034 CALL R7 0
0x90022407, // 0035 SETMBR R0 K18 R7
0x8C1C0113, // 0036 GETMET R7 R0 K19
0x7C1C0200, // 0037 CALL R7 1
0xB81E2800, // 0038 GETNGBL R7 K20
0x8C1C0F15, // 0039 GETMET R7 R7 K21
0xB8261600, // 003A GETNGBL R9 K11
0x8C241317, // 003B GETMET R9 R9 K23
0x5C2C0000, // 003C MOVE R11 R0
0x7C240400, // 003D CALL R9 2
0x00262C09, // 003E ADD R9 K22 R9
0x58280018, // 003F LDCONST R10 K24
0x7C1C0600, // 0040 CALL R7 3
0x80000000, // 0041 RET 0
}) })
) )
); );
@ -223,11 +118,11 @@ be_local_closure(Matter_IM_Subscription__add_attribute_unique_path, /* name */
/******************************************************************** /********************************************************************
** Solidified function: clear_and_arm ** Solidified function: remove_self
********************************************************************/ ********************************************************************/
be_local_closure(Matter_IM_Subscription_clear_and_arm, /* name */ be_local_closure(Matter_IM_Subscription_remove_self, /* name */
be_nested_proto( be_nested_proto(
4, /* nstack */ 5, /* nstack */
1, /* argc */ 1, /* argc */
2, /* varg */ 2, /* varg */
0, /* has upvals */ 0, /* has upvals */
@ -235,41 +130,166 @@ be_local_closure(Matter_IM_Subscription_clear_and_arm, /* name */
0, /* has sup protos */ 0, /* has sup protos */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
( &(const bvalue[10]) { /* constants */ ( &(const bvalue[ 6]) { /* constants */
/* K0 */ be_nested_str_weak(tasmota),
/* K1 */ be_nested_str_weak(log),
/* K2 */ be_nested_str_weak(MTR_X3A_X20Remove_Sub_X20sub_id_X3D),
/* K3 */ be_nested_str_weak(subscription_id),
/* K4 */ be_nested_str_weak(subs),
/* K5 */ be_nested_str_weak(remove_sub),
}),
be_str_weak(remove_self),
&be_const_str_solidified,
( &(const binstruction[12]) { /* code */
0xB8060000, // 0000 GETNGBL R1 K0
0x8C040301, // 0001 GETMET R1 R1 K1
0x600C0008, // 0002 GETGBL R3 G8
0x88100103, // 0003 GETMBR R4 R0 K3
0x7C0C0200, // 0004 CALL R3 1
0x000E0403, // 0005 ADD R3 K2 R3
0x7C040400, // 0006 CALL R1 2
0x88040104, // 0007 GETMBR R1 R0 K4
0x8C040305, // 0008 GETMET R1 R1 K5
0x5C0C0000, // 0009 MOVE R3 R0
0x7C040400, // 000A CALL R1 2
0x80000000, // 000B RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: clear_before_arm
********************************************************************/
be_local_closure(Matter_IM_Subscription_clear_before_arm, /* name */
be_nested_proto(
3, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 3]) { /* constants */
/* K0 */ be_nested_str_weak(updates), /* K0 */ be_nested_str_weak(updates),
/* K1 */ be_nested_str_weak(clear), /* K1 */ be_nested_str_weak(clear),
/* K2 */ be_nested_str_weak(tasmota), /* K2 */ be_nested_str_weak(wait_status),
/* K3 */ be_nested_str_weak(millis),
/* K4 */ be_nested_str_weak(expiration),
/* K5 */ be_nested_str_weak(max_interval),
/* K6 */ be_nested_str_weak(MAX_INTERVAL_MARGIN),
/* K7 */ be_nested_str_weak(not_before),
/* K8 */ be_nested_str_weak(min_interval),
/* K9 */ be_const_int(1),
}), }),
be_str_weak(clear_and_arm), be_str_weak(clear_before_arm),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[20]) { /* code */ ( &(const binstruction[ 6]) { /* code */
0x88040100, // 0000 GETMBR R1 R0 K0 0x88040100, // 0000 GETMBR R1 R0 K0
0x8C040301, // 0001 GETMET R1 R1 K1 0x8C040301, // 0001 GETMET R1 R1 K1
0x7C040200, // 0002 CALL R1 1 0x7C040200, // 0002 CALL R1 1
0xB8060400, // 0003 GETNGBL R1 K2 0x50040200, // 0003 LDBOOL R1 1 0
0x8C040303, // 0004 GETMET R1 R1 K3 0x90020401, // 0004 SETMBR R0 K2 R1
0x7C040200, // 0005 CALL R1 1 0x80000000, // 0005 RET 0
0x88080105, // 0006 GETMBR R2 R0 K5 })
0x880C0106, // 0007 GETMBR R3 R0 K6 )
0x04080403, // 0008 SUB R2 R2 R3 );
0x540E03E7, // 0009 LDINT R3 1000 /*******************************************************************/
0x08080403, // 000A MUL R2 R2 R3
0x00080202, // 000B ADD R2 R1 R2
0x90020802, // 000C SETMBR R0 K4 R2 /********************************************************************
0x88080108, // 000D GETMBR R2 R0 K8 ** Solidified function: init
0x540E03E7, // 000E LDINT R3 1000 ********************************************************************/
0x08080403, // 000F MUL R2 R2 R3 be_local_closure(Matter_IM_Subscription_init, /* name */
0x00080202, // 0010 ADD R2 R1 R2 be_nested_proto(
0x04080509, // 0011 SUB R2 R2 K9 13, /* nstack */
0x90020E02, // 0012 SETMBR R0 K7 R2 5, /* argc */
0x80000000, // 0013 RET 0 2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[21]) { /* constants */
/* K0 */ be_nested_str_weak(subs),
/* K1 */ be_nested_str_weak(subscription_id),
/* K2 */ be_nested_str_weak(session),
/* K3 */ be_nested_str_weak(min_interval_floor),
/* K4 */ be_const_int(0),
/* K5 */ be_nested_str_weak(min_interval),
/* K6 */ be_nested_str_weak(max_interval_ceiling),
/* K7 */ be_nested_str_weak(max_interval),
/* K8 */ be_nested_str_weak(wait_status),
/* K9 */ be_nested_str_weak(fabric_filtered),
/* K10 */ be_nested_str_weak(path_list),
/* K11 */ be_nested_str_weak(attributes_requests),
/* K12 */ be_nested_str_weak(matter),
/* K13 */ be_nested_str_weak(Path),
/* K14 */ be_nested_str_weak(endpoint),
/* K15 */ be_nested_str_weak(cluster),
/* K16 */ be_nested_str_weak(attribute),
/* K17 */ be_nested_str_weak(push),
/* K18 */ be_nested_str_weak(stop_iteration),
/* K19 */ be_nested_str_weak(updates),
/* K20 */ be_nested_str_weak(clear_before_arm),
}),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[59]) { /* code */
0x90020001, // 0000 SETMBR R0 K0 R1
0x90020202, // 0001 SETMBR R0 K1 R2
0x90020403, // 0002 SETMBR R0 K2 R3
0x88140903, // 0003 GETMBR R5 R4 K3
0x14180B04, // 0004 LT R6 R5 K4
0x781A0000, // 0005 JMPF R6 #0007
0x58140004, // 0006 LDCONST R5 K4
0x541A003B, // 0007 LDINT R6 60
0x24180A06, // 0008 GT R6 R5 R6
0x781A0000, // 0009 JMPF R6 #000B
0x5416003B, // 000A LDINT R5 60
0x90020A05, // 000B SETMBR R0 K5 R5
0x88180906, // 000C GETMBR R6 R4 K6
0x541E003B, // 000D LDINT R7 60
0x141C0C07, // 000E LT R7 R6 R7
0x781E0000, // 000F JMPF R7 #0011
0x541A003B, // 0010 LDINT R6 60
0x541E0E0F, // 0011 LDINT R7 3600
0x241C0C07, // 0012 GT R7 R6 R7
0x781E0000, // 0013 JMPF R7 #0015
0x541A0E0F, // 0014 LDINT R6 3600
0x541A003B, // 0015 LDINT R6 60
0x90020E06, // 0016 SETMBR R0 K7 R6
0x501C0000, // 0017 LDBOOL R7 0 0
0x90021007, // 0018 SETMBR R0 K8 R7
0x881C0909, // 0019 GETMBR R7 R4 K9
0x90021207, // 001A SETMBR R0 K9 R7
0x601C0012, // 001B GETGBL R7 G18
0x7C1C0000, // 001C CALL R7 0
0x90021407, // 001D SETMBR R0 K10 R7
0x601C0010, // 001E GETGBL R7 G16
0x8820090B, // 001F GETMBR R8 R4 K11
0x7C1C0200, // 0020 CALL R7 1
0xA802000F, // 0021 EXBLK 0 #0032
0x5C200E00, // 0022 MOVE R8 R7
0x7C200000, // 0023 CALL R8 0
0xB8261800, // 0024 GETNGBL R9 K12
0x8C24130D, // 0025 GETMET R9 R9 K13
0x7C240200, // 0026 CALL R9 1
0x8828110E, // 0027 GETMBR R10 R8 K14
0x90261C0A, // 0028 SETMBR R9 K14 R10
0x8828110F, // 0029 GETMBR R10 R8 K15
0x90261E0A, // 002A SETMBR R9 K15 R10
0x88281110, // 002B GETMBR R10 R8 K16
0x9026200A, // 002C SETMBR R9 K16 R10
0x8828010A, // 002D GETMBR R10 R0 K10
0x8C281511, // 002E GETMET R10 R10 K17
0x5C301200, // 002F MOVE R12 R9
0x7C280400, // 0030 CALL R10 2
0x7001FFEF, // 0031 JMP #0022
0x581C0012, // 0032 LDCONST R7 K18
0xAC1C0200, // 0033 CATCH R7 1 0
0xB0080000, // 0034 RAISE 2 R0 R0
0x601C0012, // 0035 GETGBL R7 G18
0x7C1C0000, // 0036 CALL R7 0
0x90022607, // 0037 SETMBR R0 K19 R7
0x8C1C0114, // 0038 GETMET R7 R0 K20
0x7C1C0200, // 0039 CALL R7 1
0x80000000, // 003A RET 0
}) })
) )
); );
@ -349,26 +369,28 @@ be_local_closure(Matter_IM_Subscription_attribute_updated_ctx, /* name */
** Solidified class: Matter_IM_Subscription ** Solidified class: Matter_IM_Subscription
********************************************************************/ ********************************************************************/
be_local_class(Matter_IM_Subscription, be_local_class(Matter_IM_Subscription,
10, 11,
NULL, NULL,
be_nested_map(16, be_nested_map(18,
( (struct bmapnode*) &(const bmapnode[]) { ( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(remove_self, -1), be_const_closure(Matter_IM_Subscription_remove_self_closure) }, { be_const_key_weak(subscription_id, 4), be_const_var(1) },
{ be_const_key_weak(min_interval, -1), be_const_var(4) }, { be_const_key_weak(wait_status, -1), be_const_var(9) },
{ be_const_key_weak(subs, -1), be_const_var(0) }, { be_const_key_weak(attribute_updated_ctx, 5), be_const_closure(Matter_IM_Subscription_attribute_updated_ctx_closure) },
{ be_const_key_weak(init, 15), be_const_closure(Matter_IM_Subscription_init_closure) }, { be_const_key_weak(init, -1), be_const_closure(Matter_IM_Subscription_init_closure) },
{ be_const_key_weak(subscription_id, -1), be_const_var(1) }, { be_const_key_weak(fabric_filtered, 17), be_const_var(6) },
{ be_const_key_weak(updates, -1), be_const_var(9) }, { be_const_key_weak(clear_before_arm, -1), be_const_closure(Matter_IM_Subscription_clear_before_arm_closure) },
{ be_const_key_weak(MAX_INTERVAL_MARGIN, -1), be_const_int(5) }, { be_const_key_weak(_add_attribute_unique_path, -1), be_const_closure(Matter_IM_Subscription__add_attribute_unique_path_closure) },
{ be_const_key_weak(session, 11), be_const_var(2) }, { be_const_key_weak(session, -1), be_const_var(2) },
{ be_const_key_weak(expiration, 14), be_const_var(8) }, { be_const_key_weak(expiration, 16), be_const_var(8) },
{ be_const_key_weak(fabric_filtered, -1), be_const_var(6) }, { be_const_key_weak(re_arm, 10), be_const_closure(Matter_IM_Subscription_re_arm_closure) },
{ be_const_key_weak(_add_attribute_unique_path, 9), be_const_closure(Matter_IM_Subscription__add_attribute_unique_path_closure) },
{ be_const_key_weak(max_interval, -1), be_const_var(5) }, { be_const_key_weak(max_interval, -1), be_const_var(5) },
{ be_const_key_weak(attribute_updated_ctx, -1), be_const_closure(Matter_IM_Subscription_attribute_updated_ctx_closure) }, { be_const_key_weak(min_interval, -1), be_const_var(4) },
{ be_const_key_weak(clear_and_arm, 12), be_const_closure(Matter_IM_Subscription_clear_and_arm_closure) }, { be_const_key_weak(MAX_INTERVAL_MARGIN, 8), be_const_int(5) },
{ be_const_key_weak(not_before, -1), be_const_var(7) }, { be_const_key_weak(updates, 2), be_const_var(10) },
{ be_const_key_weak(path_list, -1), be_const_var(3) }, { be_const_key_weak(not_before, 0), be_const_var(7) },
{ be_const_key_weak(path_list, 3), be_const_var(3) },
{ be_const_key_weak(remove_self, -1), be_const_closure(Matter_IM_Subscription_remove_self_closure) },
{ be_const_key_weak(subs, -1), be_const_var(0) },
})), })),
be_str_weak(Matter_IM_Subscription) be_str_weak(Matter_IM_Subscription)
); );
@ -395,70 +417,75 @@ be_local_closure(Matter_IM_Subscription_Shop_every_250ms, /* name */
0, /* has sup protos */ 0, /* has sup protos */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
( &(const bvalue[11]) { /* constants */ ( &(const bvalue[12]) { /* constants */
/* K0 */ be_const_int(0), /* K0 */ be_const_int(0),
/* K1 */ be_nested_str_weak(subs), /* K1 */ be_nested_str_weak(subs),
/* K2 */ be_nested_str_weak(updates), /* K2 */ be_nested_str_weak(wait_status),
/* K3 */ be_nested_str_weak(tasmota), /* K3 */ be_nested_str_weak(updates),
/* K4 */ be_nested_str_weak(time_reached), /* K4 */ be_nested_str_weak(tasmota),
/* K5 */ be_nested_str_weak(not_before), /* K5 */ be_nested_str_weak(time_reached),
/* K6 */ be_nested_str_weak(im), /* K6 */ be_nested_str_weak(not_before),
/* K7 */ be_nested_str_weak(send_subscribe_update), /* K7 */ be_nested_str_weak(im),
/* K8 */ be_nested_str_weak(clear_and_arm), /* K8 */ be_nested_str_weak(send_subscribe_update),
/* K9 */ be_const_int(1), /* K9 */ be_nested_str_weak(clear_before_arm),
/* K10 */ be_nested_str_weak(expiration), /* K10 */ be_const_int(1),
/* K11 */ be_nested_str_weak(expiration),
}), }),
be_str_weak(every_250ms), be_str_weak(every_250ms),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[48]) { /* code */ ( &(const binstruction[52]) { /* code */
0x58040000, // 0000 LDCONST R1 K0 0x58040000, // 0000 LDCONST R1 K0
0x6008000C, // 0001 GETGBL R2 G12 0x6008000C, // 0001 GETGBL R2 G12
0x880C0101, // 0002 GETMBR R3 R0 K1 0x880C0101, // 0002 GETMBR R3 R0 K1
0x7C080200, // 0003 CALL R2 1 0x7C080200, // 0003 CALL R2 1
0x14080202, // 0004 LT R2 R1 R2 0x14080202, // 0004 LT R2 R1 R2
0x780A0013, // 0005 JMPF R2 #001A 0x780A0015, // 0005 JMPF R2 #001C
0x88080101, // 0006 GETMBR R2 R0 K1 0x88080101, // 0006 GETMBR R2 R0 K1
0x94080401, // 0007 GETIDX R2 R2 R1 0x94080401, // 0007 GETIDX R2 R2 R1
0x600C000C, // 0008 GETGBL R3 G12 0x880C0502, // 0008 GETMBR R3 R2 K2
0x88100502, // 0009 GETMBR R4 R2 K2 0x740E000F, // 0009 JMPT R3 #001A
0x7C0C0200, // 000A CALL R3 1 0x600C000C, // 000A GETGBL R3 G12
0x240C0700, // 000B GT R3 R3 K0 0x88100503, // 000B GETMBR R4 R2 K3
0x780E000A, // 000C JMPF R3 #0018 0x7C0C0200, // 000C CALL R3 1
0xB80E0600, // 000D GETNGBL R3 K3 0x240C0700, // 000D GT R3 R3 K0
0x8C0C0704, // 000E GETMET R3 R3 K4 0x780E000A, // 000E JMPF R3 #001A
0x88140505, // 000F GETMBR R5 R2 K5 0xB80E0800, // 000F GETNGBL R3 K4
0x7C0C0400, // 0010 CALL R3 2 0x8C0C0705, // 0010 GETMET R3 R3 K5
0x780E0005, // 0011 JMPF R3 #0018 0x88140506, // 0011 GETMBR R5 R2 K6
0x880C0106, // 0012 GETMBR R3 R0 K6 0x7C0C0400, // 0012 CALL R3 2
0x8C0C0707, // 0013 GETMET R3 R3 K7 0x780E0005, // 0013 JMPF R3 #001A
0x5C140400, // 0014 MOVE R5 R2 0x880C0107, // 0014 GETMBR R3 R0 K7
0x7C0C0400, // 0015 CALL R3 2 0x8C0C0708, // 0015 GETMET R3 R3 K8
0x8C0C0508, // 0016 GETMET R3 R2 K8 0x5C140400, // 0016 MOVE R5 R2
0x7C0C0200, // 0017 CALL R3 1 0x7C0C0400, // 0017 CALL R3 2
0x00040309, // 0018 ADD R1 R1 K9 0x8C0C0509, // 0018 GETMET R3 R2 K9
0x7001FFE6, // 0019 JMP #0001 0x7C0C0200, // 0019 CALL R3 1
0x58040000, // 001A LDCONST R1 K0 0x0004030A, // 001A ADD R1 R1 K10
0x6008000C, // 001B GETGBL R2 G12 0x7001FFE4, // 001B JMP #0001
0x880C0101, // 001C GETMBR R3 R0 K1 0x58040000, // 001C LDCONST R1 K0
0x7C080200, // 001D CALL R2 1 0x6008000C, // 001D GETGBL R2 G12
0x14080202, // 001E LT R2 R1 R2 0x880C0101, // 001E GETMBR R3 R0 K1
0x780A000E, // 001F JMPF R2 #002F 0x7C080200, // 001F CALL R2 1
0x88080101, // 0020 GETMBR R2 R0 K1 0x14080202, // 0020 LT R2 R1 R2
0x94080401, // 0021 GETIDX R2 R2 R1 0x780A0010, // 0021 JMPF R2 #0033
0xB80E0600, // 0022 GETNGBL R3 K3 0x88080101, // 0022 GETMBR R2 R0 K1
0x8C0C0704, // 0023 GETMET R3 R3 K4 0x94080401, // 0023 GETIDX R2 R2 R1
0x8814050A, // 0024 GETMBR R5 R2 K10 0x880C0502, // 0024 GETMBR R3 R2 K2
0x7C0C0400, // 0025 CALL R3 2 0x740E000A, // 0025 JMPT R3 #0031
0x780E0005, // 0026 JMPF R3 #002D 0xB80E0800, // 0026 GETNGBL R3 K4
0x880C0106, // 0027 GETMBR R3 R0 K6 0x8C0C0705, // 0027 GETMET R3 R3 K5
0x8C0C0707, // 0028 GETMET R3 R3 K7 0x8814050B, // 0028 GETMBR R5 R2 K11
0x5C140400, // 0029 MOVE R5 R2 0x7C0C0400, // 0029 CALL R3 2
0x7C0C0400, // 002A CALL R3 2 0x780E0005, // 002A JMPF R3 #0031
0x8C0C0508, // 002B GETMET R3 R2 K8 0x880C0107, // 002B GETMBR R3 R0 K7
0x7C0C0200, // 002C CALL R3 1 0x8C0C0708, // 002C GETMET R3 R3 K8
0x00040309, // 002D ADD R1 R1 K9 0x5C140400, // 002D MOVE R5 R2
0x7001FFEB, // 002E JMP #001B 0x7C0C0400, // 002E CALL R3 2
0x80000000, // 002F RET 0 0x8C0C0509, // 002F GETMET R3 R2 K9
0x7C0C0200, // 0030 CALL R3 1
0x0004030A, // 0031 ADD R1 R1 K10
0x7001FFE9, // 0032 JMP #001D
0x80000000, // 0033 RET 0
}) })
) )
); );

View File

@ -7,32 +7,199 @@
extern const bclass be_class_Matter_Frame; extern const bclass be_class_Matter_Frame;
/******************************************************************** /********************************************************************
** Solidified function: init ** Solidified function: encode_frame
********************************************************************/ ********************************************************************/
be_local_closure(Matter_Frame_init, /* name */ be_local_closure(Matter_Frame_encode_frame, /* name */
be_nested_proto( be_nested_proto(
5, /* nstack */ 7, /* nstack */
5, /* argc */ 2, /* argc */
2, /* varg */ 2, /* varg */
0, /* has upvals */ 0, /* has upvals */
NULL, /* no upvals */ NULL, /* no upvals */
0, /* has sup protos */ 0, /* has sup protos */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
( &(const bvalue[ 4]) { /* constants */ ( &(const bvalue[30]) { /* constants */
/* K0 */ be_nested_str_weak(message_handler), /* K0 */ be_nested_str_weak(flags),
/* K1 */ be_nested_str_weak(raw), /* K1 */ be_const_int(0),
/* K2 */ be_nested_str_weak(remote_ip), /* K2 */ be_nested_str_weak(flag_s),
/* K3 */ be_nested_str_weak(remote_port), /* K3 */ be_nested_str_weak(flag_dsiz),
/* K4 */ be_const_int(3),
/* K5 */ be_nested_str_weak(add),
/* K6 */ be_const_int(1),
/* K7 */ be_nested_str_weak(local_session_id),
/* K8 */ be_const_int(2),
/* K9 */ be_nested_str_weak(sec_flags),
/* K10 */ be_nested_str_weak(sec_p),
/* K11 */ be_nested_str_weak(sec_c),
/* K12 */ be_nested_str_weak(sec_sesstype),
/* K13 */ be_nested_str_weak(message_counter),
/* K14 */ be_nested_str_weak(source_node_id),
/* K15 */ be_nested_str_weak(dest_node_id_8),
/* K16 */ be_nested_str_weak(dest_node_id_2),
/* K17 */ be_nested_str_weak(payload_idx),
/* K18 */ be_nested_str_weak(x_flags),
/* K19 */ be_nested_str_weak(x_flag_v),
/* K20 */ be_nested_str_weak(x_flag_r),
/* K21 */ be_nested_str_weak(x_flag_a),
/* K22 */ be_nested_str_weak(x_flag_i),
/* K23 */ be_nested_str_weak(opcode),
/* K24 */ be_nested_str_weak(exchange_id),
/* K25 */ be_nested_str_weak(protocol_id),
/* K26 */ be_nested_str_weak(ack_message_counter),
/* K27 */ be_nested_str_weak(app_payload_idx),
/* K28 */ be_nested_str_weak(debug),
/* K29 */ be_nested_str_weak(raw),
}), }),
be_str_weak(init), be_str_weak(encode_frame),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */ ( &(const binstruction[146]) { /* code */
0x90020001, // 0000 SETMBR R0 K0 R1 0x60080015, // 0000 GETGBL R2 G21
0x90020202, // 0001 SETMBR R0 K1 R2 0x7C080000, // 0001 CALL R2 0
0x90020403, // 0002 SETMBR R0 K2 R3 0x880C0100, // 0002 GETMBR R3 R0 K0
0x90020604, // 0003 SETMBR R0 K3 R4 0x4C100000, // 0003 LDNIL R4
0x80000000, // 0004 RET 0 0x1C0C0604, // 0004 EQ R3 R3 R4
0x780E000D, // 0005 JMPF R3 #0014
0x90020101, // 0006 SETMBR R0 K0 K1
0x880C0102, // 0007 GETMBR R3 R0 K2
0x780E0003, // 0008 JMPF R3 #000D
0x880C0100, // 0009 GETMBR R3 R0 K0
0x54120003, // 000A LDINT R4 4
0x300C0604, // 000B OR R3 R3 R4
0x90020003, // 000C SETMBR R0 K0 R3
0x880C0103, // 000D GETMBR R3 R0 K3
0x780E0004, // 000E JMPF R3 #0014
0x880C0100, // 000F GETMBR R3 R0 K0
0x88100103, // 0010 GETMBR R4 R0 K3
0x2C100904, // 0011 AND R4 R4 K4
0x300C0604, // 0012 OR R3 R3 R4
0x90020003, // 0013 SETMBR R0 K0 R3
0x8C0C0505, // 0014 GETMET R3 R2 K5
0x88140100, // 0015 GETMBR R5 R0 K0
0x58180006, // 0016 LDCONST R6 K6
0x7C0C0600, // 0017 CALL R3 3
0x8C0C0505, // 0018 GETMET R3 R2 K5
0x88140107, // 0019 GETMBR R5 R0 K7
0x78160001, // 001A JMPF R5 #001D
0x88140107, // 001B GETMBR R5 R0 K7
0x70020000, // 001C JMP #001E
0x58140001, // 001D LDCONST R5 K1
0x58180008, // 001E LDCONST R6 K8
0x7C0C0600, // 001F CALL R3 3
0x880C0109, // 0020 GETMBR R3 R0 K9
0x4C100000, // 0021 LDNIL R4
0x1C0C0604, // 0022 EQ R3 R3 R4
0x780E0013, // 0023 JMPF R3 #0038
0x90021301, // 0024 SETMBR R0 K9 K1
0x880C010A, // 0025 GETMBR R3 R0 K10
0x780E0003, // 0026 JMPF R3 #002B
0x880C0109, // 0027 GETMBR R3 R0 K9
0x5412007F, // 0028 LDINT R4 128
0x300C0604, // 0029 OR R3 R3 R4
0x90021203, // 002A SETMBR R0 K9 R3
0x880C010B, // 002B GETMBR R3 R0 K11
0x780E0003, // 002C JMPF R3 #0031
0x880C0109, // 002D GETMBR R3 R0 K9
0x5412003F, // 002E LDINT R4 64
0x300C0604, // 002F OR R3 R3 R4
0x90021203, // 0030 SETMBR R0 K9 R3
0x880C010C, // 0031 GETMBR R3 R0 K12
0x780E0004, // 0032 JMPF R3 #0038
0x880C0109, // 0033 GETMBR R3 R0 K9
0x8810010C, // 0034 GETMBR R4 R0 K12
0x2C100904, // 0035 AND R4 R4 K4
0x300C0604, // 0036 OR R3 R3 R4
0x90021203, // 0037 SETMBR R0 K9 R3
0x8C0C0505, // 0038 GETMET R3 R2 K5
0x88140109, // 0039 GETMBR R5 R0 K9
0x58180006, // 003A LDCONST R6 K6
0x7C0C0600, // 003B CALL R3 3
0x8C0C0505, // 003C GETMET R3 R2 K5
0x8814010D, // 003D GETMBR R5 R0 K13
0x541A0003, // 003E LDINT R6 4
0x7C0C0600, // 003F CALL R3 3
0x880C0102, // 0040 GETMBR R3 R0 K2
0x780E0001, // 0041 JMPF R3 #0044
0x880C010E, // 0042 GETMBR R3 R0 K14
0x400C0403, // 0043 CONNECT R3 R2 R3
0x880C0103, // 0044 GETMBR R3 R0 K3
0x1C0C0706, // 0045 EQ R3 R3 K6
0x780E0001, // 0046 JMPF R3 #0049
0x880C010F, // 0047 GETMBR R3 R0 K15
0x400C0403, // 0048 CONNECT R3 R2 R3
0x880C0103, // 0049 GETMBR R3 R0 K3
0x1C0C0708, // 004A EQ R3 R3 K8
0x780E0003, // 004B JMPF R3 #0050
0x8C0C0505, // 004C GETMET R3 R2 K5
0x88140110, // 004D GETMBR R5 R0 K16
0x58180008, // 004E LDCONST R6 K8
0x7C0C0600, // 004F CALL R3 3
0x600C000C, // 0050 GETGBL R3 G12
0x5C100400, // 0051 MOVE R4 R2
0x7C0C0200, // 0052 CALL R3 1
0x90022203, // 0053 SETMBR R0 K17 R3
0x880C0112, // 0054 GETMBR R3 R0 K18
0x4C100000, // 0055 LDNIL R4
0x1C0C0604, // 0056 EQ R3 R3 R4
0x780E0016, // 0057 JMPF R3 #006F
0x90022501, // 0058 SETMBR R0 K18 K1
0x880C0113, // 0059 GETMBR R3 R0 K19
0x780E0003, // 005A JMPF R3 #005F
0x880C0112, // 005B GETMBR R3 R0 K18
0x5412000F, // 005C LDINT R4 16
0x300C0604, // 005D OR R3 R3 R4
0x90022403, // 005E SETMBR R0 K18 R3
0x880C0114, // 005F GETMBR R3 R0 K20
0x780E0003, // 0060 JMPF R3 #0065
0x880C0112, // 0061 GETMBR R3 R0 K18
0x54120003, // 0062 LDINT R4 4
0x300C0604, // 0063 OR R3 R3 R4
0x90022403, // 0064 SETMBR R0 K18 R3
0x880C0115, // 0065 GETMBR R3 R0 K21
0x780E0002, // 0066 JMPF R3 #006A
0x880C0112, // 0067 GETMBR R3 R0 K18
0x300C0708, // 0068 OR R3 R3 K8
0x90022403, // 0069 SETMBR R0 K18 R3
0x880C0116, // 006A GETMBR R3 R0 K22
0x780E0002, // 006B JMPF R3 #006F
0x880C0112, // 006C GETMBR R3 R0 K18
0x300C0706, // 006D OR R3 R3 K6
0x90022403, // 006E SETMBR R0 K18 R3
0x8C0C0505, // 006F GETMET R3 R2 K5
0x88140112, // 0070 GETMBR R5 R0 K18
0x58180006, // 0071 LDCONST R6 K6
0x7C0C0600, // 0072 CALL R3 3
0x8C0C0505, // 0073 GETMET R3 R2 K5
0x88140117, // 0074 GETMBR R5 R0 K23
0x58180006, // 0075 LDCONST R6 K6
0x7C0C0600, // 0076 CALL R3 3
0x8C0C0505, // 0077 GETMET R3 R2 K5
0x88140118, // 0078 GETMBR R5 R0 K24
0x541AFFFE, // 0079 LDINT R6 65535
0x2C140A06, // 007A AND R5 R5 R6
0x58180008, // 007B LDCONST R6 K8
0x7C0C0600, // 007C CALL R3 3
0x8C0C0505, // 007D GETMET R3 R2 K5
0x88140119, // 007E GETMBR R5 R0 K25
0x58180008, // 007F LDCONST R6 K8
0x7C0C0600, // 0080 CALL R3 3
0x880C0115, // 0081 GETMBR R3 R0 K21
0x780E0003, // 0082 JMPF R3 #0087
0x8C0C0505, // 0083 GETMET R3 R2 K5
0x8814011A, // 0084 GETMBR R5 R0 K26
0x541A0003, // 0085 LDINT R6 4
0x7C0C0600, // 0086 CALL R3 3
0x600C000C, // 0087 GETGBL R3 G12
0x5C100400, // 0088 MOVE R4 R2
0x7C0C0200, // 0089 CALL R3 1
0x90023603, // 008A SETMBR R0 K27 R3
0x78060000, // 008B JMPF R1 #008D
0x400C0401, // 008C CONNECT R3 R2 R1
0x8C0C011C, // 008D GETMET R3 R0 K28
0x5C140400, // 008E MOVE R5 R2
0x7C0C0400, // 008F CALL R3 2
0x90023A02, // 0090 SETMBR R0 K29 R2
0x80040400, // 0091 RET 1 R2
}) })
) )
); );
@ -784,199 +951,32 @@ be_local_closure(Matter_Frame_decode_header, /* name */
/******************************************************************** /********************************************************************
** Solidified function: encode ** Solidified function: init
********************************************************************/ ********************************************************************/
be_local_closure(Matter_Frame_encode, /* name */ be_local_closure(Matter_Frame_init, /* name */
be_nested_proto( be_nested_proto(
7, /* nstack */ 5, /* nstack */
2, /* argc */ 5, /* argc */
2, /* varg */ 2, /* varg */
0, /* has upvals */ 0, /* has upvals */
NULL, /* no upvals */ NULL, /* no upvals */
0, /* has sup protos */ 0, /* has sup protos */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
( &(const bvalue[30]) { /* constants */ ( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str_weak(flags), /* K0 */ be_nested_str_weak(message_handler),
/* K1 */ be_const_int(0), /* K1 */ be_nested_str_weak(raw),
/* K2 */ be_nested_str_weak(flag_s), /* K2 */ be_nested_str_weak(remote_ip),
/* K3 */ be_nested_str_weak(flag_dsiz), /* K3 */ be_nested_str_weak(remote_port),
/* K4 */ be_const_int(3),
/* K5 */ be_nested_str_weak(add),
/* K6 */ be_const_int(1),
/* K7 */ be_nested_str_weak(local_session_id),
/* K8 */ be_const_int(2),
/* K9 */ be_nested_str_weak(sec_flags),
/* K10 */ be_nested_str_weak(sec_p),
/* K11 */ be_nested_str_weak(sec_c),
/* K12 */ be_nested_str_weak(sec_sesstype),
/* K13 */ be_nested_str_weak(message_counter),
/* K14 */ be_nested_str_weak(source_node_id),
/* K15 */ be_nested_str_weak(dest_node_id_8),
/* K16 */ be_nested_str_weak(dest_node_id_2),
/* K17 */ be_nested_str_weak(payload_idx),
/* K18 */ be_nested_str_weak(x_flags),
/* K19 */ be_nested_str_weak(x_flag_v),
/* K20 */ be_nested_str_weak(x_flag_r),
/* K21 */ be_nested_str_weak(x_flag_a),
/* K22 */ be_nested_str_weak(x_flag_i),
/* K23 */ be_nested_str_weak(opcode),
/* K24 */ be_nested_str_weak(exchange_id),
/* K25 */ be_nested_str_weak(protocol_id),
/* K26 */ be_nested_str_weak(ack_message_counter),
/* K27 */ be_nested_str_weak(app_payload_idx),
/* K28 */ be_nested_str_weak(debug),
/* K29 */ be_nested_str_weak(raw),
}), }),
be_str_weak(encode), be_str_weak(init),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[146]) { /* code */ ( &(const binstruction[ 5]) { /* code */
0x60080015, // 0000 GETGBL R2 G21 0x90020001, // 0000 SETMBR R0 K0 R1
0x7C080000, // 0001 CALL R2 0 0x90020202, // 0001 SETMBR R0 K1 R2
0x880C0100, // 0002 GETMBR R3 R0 K0 0x90020403, // 0002 SETMBR R0 K2 R3
0x4C100000, // 0003 LDNIL R4 0x90020604, // 0003 SETMBR R0 K3 R4
0x1C0C0604, // 0004 EQ R3 R3 R4 0x80000000, // 0004 RET 0
0x780E000D, // 0005 JMPF R3 #0014
0x90020101, // 0006 SETMBR R0 K0 K1
0x880C0102, // 0007 GETMBR R3 R0 K2
0x780E0003, // 0008 JMPF R3 #000D
0x880C0100, // 0009 GETMBR R3 R0 K0
0x54120003, // 000A LDINT R4 4
0x300C0604, // 000B OR R3 R3 R4
0x90020003, // 000C SETMBR R0 K0 R3
0x880C0103, // 000D GETMBR R3 R0 K3
0x780E0004, // 000E JMPF R3 #0014
0x880C0100, // 000F GETMBR R3 R0 K0
0x88100103, // 0010 GETMBR R4 R0 K3
0x2C100904, // 0011 AND R4 R4 K4
0x300C0604, // 0012 OR R3 R3 R4
0x90020003, // 0013 SETMBR R0 K0 R3
0x8C0C0505, // 0014 GETMET R3 R2 K5
0x88140100, // 0015 GETMBR R5 R0 K0
0x58180006, // 0016 LDCONST R6 K6
0x7C0C0600, // 0017 CALL R3 3
0x8C0C0505, // 0018 GETMET R3 R2 K5
0x88140107, // 0019 GETMBR R5 R0 K7
0x78160001, // 001A JMPF R5 #001D
0x88140107, // 001B GETMBR R5 R0 K7
0x70020000, // 001C JMP #001E
0x58140001, // 001D LDCONST R5 K1
0x58180008, // 001E LDCONST R6 K8
0x7C0C0600, // 001F CALL R3 3
0x880C0109, // 0020 GETMBR R3 R0 K9
0x4C100000, // 0021 LDNIL R4
0x1C0C0604, // 0022 EQ R3 R3 R4
0x780E0013, // 0023 JMPF R3 #0038
0x90021301, // 0024 SETMBR R0 K9 K1
0x880C010A, // 0025 GETMBR R3 R0 K10
0x780E0003, // 0026 JMPF R3 #002B
0x880C0109, // 0027 GETMBR R3 R0 K9
0x5412007F, // 0028 LDINT R4 128
0x300C0604, // 0029 OR R3 R3 R4
0x90021203, // 002A SETMBR R0 K9 R3
0x880C010B, // 002B GETMBR R3 R0 K11
0x780E0003, // 002C JMPF R3 #0031
0x880C0109, // 002D GETMBR R3 R0 K9
0x5412003F, // 002E LDINT R4 64
0x300C0604, // 002F OR R3 R3 R4
0x90021203, // 0030 SETMBR R0 K9 R3
0x880C010C, // 0031 GETMBR R3 R0 K12
0x780E0004, // 0032 JMPF R3 #0038
0x880C0109, // 0033 GETMBR R3 R0 K9
0x8810010C, // 0034 GETMBR R4 R0 K12
0x2C100904, // 0035 AND R4 R4 K4
0x300C0604, // 0036 OR R3 R3 R4
0x90021203, // 0037 SETMBR R0 K9 R3
0x8C0C0505, // 0038 GETMET R3 R2 K5
0x88140109, // 0039 GETMBR R5 R0 K9
0x58180006, // 003A LDCONST R6 K6
0x7C0C0600, // 003B CALL R3 3
0x8C0C0505, // 003C GETMET R3 R2 K5
0x8814010D, // 003D GETMBR R5 R0 K13
0x541A0003, // 003E LDINT R6 4
0x7C0C0600, // 003F CALL R3 3
0x880C0102, // 0040 GETMBR R3 R0 K2
0x780E0001, // 0041 JMPF R3 #0044
0x880C010E, // 0042 GETMBR R3 R0 K14
0x400C0403, // 0043 CONNECT R3 R2 R3
0x880C0103, // 0044 GETMBR R3 R0 K3
0x1C0C0706, // 0045 EQ R3 R3 K6
0x780E0001, // 0046 JMPF R3 #0049
0x880C010F, // 0047 GETMBR R3 R0 K15
0x400C0403, // 0048 CONNECT R3 R2 R3
0x880C0103, // 0049 GETMBR R3 R0 K3
0x1C0C0708, // 004A EQ R3 R3 K8
0x780E0003, // 004B JMPF R3 #0050
0x8C0C0505, // 004C GETMET R3 R2 K5
0x88140110, // 004D GETMBR R5 R0 K16
0x58180008, // 004E LDCONST R6 K8
0x7C0C0600, // 004F CALL R3 3
0x600C000C, // 0050 GETGBL R3 G12
0x5C100400, // 0051 MOVE R4 R2
0x7C0C0200, // 0052 CALL R3 1
0x90022203, // 0053 SETMBR R0 K17 R3
0x880C0112, // 0054 GETMBR R3 R0 K18
0x4C100000, // 0055 LDNIL R4
0x1C0C0604, // 0056 EQ R3 R3 R4
0x780E0016, // 0057 JMPF R3 #006F
0x90022501, // 0058 SETMBR R0 K18 K1
0x880C0113, // 0059 GETMBR R3 R0 K19
0x780E0003, // 005A JMPF R3 #005F
0x880C0112, // 005B GETMBR R3 R0 K18
0x5412000F, // 005C LDINT R4 16
0x300C0604, // 005D OR R3 R3 R4
0x90022403, // 005E SETMBR R0 K18 R3
0x880C0114, // 005F GETMBR R3 R0 K20
0x780E0003, // 0060 JMPF R3 #0065
0x880C0112, // 0061 GETMBR R3 R0 K18
0x54120003, // 0062 LDINT R4 4
0x300C0604, // 0063 OR R3 R3 R4
0x90022403, // 0064 SETMBR R0 K18 R3
0x880C0115, // 0065 GETMBR R3 R0 K21
0x780E0002, // 0066 JMPF R3 #006A
0x880C0112, // 0067 GETMBR R3 R0 K18
0x300C0708, // 0068 OR R3 R3 K8
0x90022403, // 0069 SETMBR R0 K18 R3
0x880C0116, // 006A GETMBR R3 R0 K22
0x780E0002, // 006B JMPF R3 #006F
0x880C0112, // 006C GETMBR R3 R0 K18
0x300C0706, // 006D OR R3 R3 K6
0x90022403, // 006E SETMBR R0 K18 R3
0x8C0C0505, // 006F GETMET R3 R2 K5
0x88140112, // 0070 GETMBR R5 R0 K18
0x58180006, // 0071 LDCONST R6 K6
0x7C0C0600, // 0072 CALL R3 3
0x8C0C0505, // 0073 GETMET R3 R2 K5
0x88140117, // 0074 GETMBR R5 R0 K23
0x58180006, // 0075 LDCONST R6 K6
0x7C0C0600, // 0076 CALL R3 3
0x8C0C0505, // 0077 GETMET R3 R2 K5
0x88140118, // 0078 GETMBR R5 R0 K24
0x541AFFFE, // 0079 LDINT R6 65535
0x2C140A06, // 007A AND R5 R5 R6
0x58180008, // 007B LDCONST R6 K8
0x7C0C0600, // 007C CALL R3 3
0x8C0C0505, // 007D GETMET R3 R2 K5
0x88140119, // 007E GETMBR R5 R0 K25
0x58180008, // 007F LDCONST R6 K8
0x7C0C0600, // 0080 CALL R3 3
0x880C0115, // 0081 GETMBR R3 R0 K21
0x780E0003, // 0082 JMPF R3 #0087
0x8C0C0505, // 0083 GETMET R3 R2 K5
0x8814011A, // 0084 GETMBR R5 R0 K26
0x541A0003, // 0085 LDINT R6 4
0x7C0C0600, // 0086 CALL R3 3
0x600C000C, // 0087 GETGBL R3 G12
0x5C100400, // 0088 MOVE R4 R2
0x7C0C0200, // 0089 CALL R3 1
0x90023603, // 008A SETMBR R0 K27 R3
0x78060000, // 008B JMPF R1 #008D
0x400C0401, // 008C CONNECT R3 R2 R1
0x8C0C011C, // 008D GETMET R3 R0 K28
0x5C140400, // 008E MOVE R5 R2
0x7C0C0400, // 008F CALL R3 2
0x90023A02, // 0090 SETMBR R0 K29 R2
0x80040400, // 0091 RET 1 R2
}) })
) )
); );
@ -1354,46 +1354,46 @@ be_local_class(Matter_Frame,
( (struct bmapnode*) &(const bmapnode[]) { ( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(x_flag_i, -1), be_const_var(22) }, { be_const_key_weak(x_flag_i, -1), be_const_var(22) },
{ be_const_key_weak(dest_node_id_8, 7), be_const_var(16) }, { be_const_key_weak(dest_node_id_8, 7), be_const_var(16) },
{ be_const_key_weak(remote_ip, -1), be_const_var(30) }, { be_const_key_weak(x_flags, -1), be_const_var(17) },
{ be_const_key_weak(x_flag_a, -1), be_const_var(21) }, { be_const_key_weak(x_flag_a, -1), be_const_var(21) },
{ be_const_key_weak(exchange_id, -1), be_const_var(24) }, { be_const_key_weak(exchange_id, -1), be_const_var(24) },
{ be_const_key_weak(opcode, -1), be_const_var(23) }, { be_const_key_weak(opcode, -1), be_const_var(23) },
{ be_const_key_weak(sec_sesstype, -1), be_const_var(12) }, { be_const_key_weak(encode_frame, -1), be_const_closure(Matter_Frame_encode_frame_closure) },
{ be_const_key_weak(app_payload_idx, -1), be_const_var(29) }, { be_const_key_weak(app_payload_idx, -1), be_const_var(29) },
{ be_const_key_weak(payload_idx, -1), be_const_var(3) }, { be_const_key_weak(payload_idx, -1), be_const_var(3) },
{ be_const_key_weak(ack_message_counter, 6), be_const_var(27) }, { be_const_key_weak(ack_message_counter, 24), be_const_var(27) },
{ be_const_key_weak(build_standalone_ack, -1), be_const_closure(Matter_Frame_build_standalone_ack_closure) },
{ be_const_key_weak(x_flag_v, 6), be_const_var(18) },
{ be_const_key_weak(sec_c, -1), be_const_var(10) }, { be_const_key_weak(sec_c, -1), be_const_var(10) },
{ be_const_key_weak(x_flag_v, -1), be_const_var(18) }, { be_const_key_weak(vendor_id, 32), be_const_var(26) },
{ be_const_key_weak(x_flag_sx, 10), be_const_var(19) },
{ be_const_key_weak(encode, 28), be_const_closure(Matter_Frame_encode_closure) },
{ be_const_key_weak(local_session_id, -1), be_const_var(7) }, { be_const_key_weak(local_session_id, -1), be_const_var(7) },
{ be_const_key_weak(flag_s, -1), be_const_var(5) }, { be_const_key_weak(flag_s, -1), be_const_var(5) },
{ be_const_key_weak(debug, -1), be_const_closure(Matter_Frame_debug_closure) }, { be_const_key_weak(debug, -1), be_const_closure(Matter_Frame_debug_closure) },
{ be_const_key_weak(build_standalone_ack, 34), be_const_closure(Matter_Frame_build_standalone_ack_closure) }, { be_const_key_weak(message_handler, 10), be_const_var(0) },
{ be_const_key_weak(encrypt, 12), be_const_closure(Matter_Frame_encrypt_closure) }, { be_const_key_weak(encrypt, 34), be_const_closure(Matter_Frame_encrypt_closure) },
{ be_const_key_weak(session, -1), be_const_var(1) }, { be_const_key_weak(session, -1), be_const_var(1) },
{ be_const_key_weak(sec_flags, -1), be_const_var(8) }, { be_const_key_weak(sec_flags, -1), be_const_var(8) },
{ be_const_key_weak(build_response, -1), be_const_closure(Matter_Frame_build_response_closure) }, { be_const_key_weak(build_response, -1), be_const_closure(Matter_Frame_build_response_closure) },
{ be_const_key_weak(initiate_response, -1), be_const_static_closure(Matter_Frame_initiate_response_closure) }, { be_const_key_weak(initiate_response, -1), be_const_static_closure(Matter_Frame_initiate_response_closure) },
{ be_const_key_weak(vendor_id, 32), be_const_var(26) }, { be_const_key_weak(remote_port, -1), be_const_var(31) },
{ be_const_key_weak(decode_header, -1), be_const_closure(Matter_Frame_decode_header_closure) }, { be_const_key_weak(sec_sesstype, -1), be_const_var(12) },
{ be_const_key_weak(remote_port, 24), be_const_var(31) }, { be_const_key_weak(decode_header, 23), be_const_closure(Matter_Frame_decode_header_closure) },
{ be_const_key_weak(flags, -1), be_const_var(4) }, { be_const_key_weak(flags, -1), be_const_var(4) },
{ be_const_key_weak(protocol_id, 23), be_const_var(25) }, { be_const_key_weak(protocol_id, 13), be_const_var(25) },
{ be_const_key_weak(raw, -1), be_const_var(2) }, { be_const_key_weak(raw, -1), be_const_var(2) },
{ be_const_key_weak(source_node_id, 13), be_const_var(14) }, { be_const_key_weak(source_node_id, 28), be_const_var(14) },
{ be_const_key_weak(flag_dsiz, -1), be_const_var(6) }, { be_const_key_weak(flag_dsiz, -1), be_const_var(6) },
{ be_const_key_weak(x_flag_r, -1), be_const_var(20) }, { be_const_key_weak(x_flag_r, -1), be_const_var(20) },
{ be_const_key_weak(message_counter, -1), be_const_var(13) }, { be_const_key_weak(message_counter, -1), be_const_var(13) },
{ be_const_key_weak(init, 14), be_const_closure(Matter_Frame_init_closure) }, { be_const_key_weak(init, 14), be_const_closure(Matter_Frame_init_closure) },
{ be_const_key_weak(message_handler, -1), be_const_var(0) }, { be_const_key_weak(x_flag_sx, 12), be_const_var(19) },
{ be_const_key_weak(dest_node_id_2, -1), be_const_var(15) }, { be_const_key_weak(dest_node_id_2, -1), be_const_var(15) },
{ be_const_key_weak(decode_payload, -1), be_const_closure(Matter_Frame_decode_payload_closure) }, { be_const_key_weak(decode_payload, -1), be_const_closure(Matter_Frame_decode_payload_closure) },
{ be_const_key_weak(sec_p, 8), be_const_var(9) }, { be_const_key_weak(sec_p, 8), be_const_var(9) },
{ be_const_key_weak(decrypt, -1), be_const_closure(Matter_Frame_decrypt_closure) }, { be_const_key_weak(decrypt, -1), be_const_closure(Matter_Frame_decrypt_closure) },
{ be_const_key_weak(sec_extensions, -1), be_const_var(28) }, { be_const_key_weak(sec_extensions, -1), be_const_var(28) },
{ be_const_key_weak(sec_mx, 3), be_const_var(11) }, { be_const_key_weak(sec_mx, 3), be_const_var(11) },
{ be_const_key_weak(x_flags, 2), be_const_var(17) }, { be_const_key_weak(remote_ip, 2), be_const_var(30) },
})), })),
be_str_weak(Matter_Frame) be_str_weak(Matter_Frame)
); );

View File

@ -82,7 +82,7 @@ be_local_closure(Matter_MessageHandler_msg_received, /* name */
/* K59 */ be_nested_str_weak(send_enqueued), /* K59 */ be_nested_str_weak(send_enqueued),
/* K60 */ be_nested_str_weak(x_flag_r), /* K60 */ be_nested_str_weak(x_flag_r),
/* K61 */ be_nested_str_weak(build_standalone_ack), /* K61 */ be_nested_str_weak(build_standalone_ack),
/* K62 */ be_nested_str_weak(encode), /* K62 */ be_nested_str_weak(encode_frame),
/* K63 */ be_nested_str_weak(encrypt), /* K63 */ be_nested_str_weak(encrypt),
/* K64 */ be_nested_str_weak(send_response), /* K64 */ be_nested_str_weak(send_response),
/* K65 */ be_nested_str_weak(remote_ip), /* K65 */ be_nested_str_weak(remote_ip),

View File

@ -31,6 +31,31 @@ be_local_closure(Matter_Plugin_read_attribute, /* name */
/*******************************************************************/ /*******************************************************************/
/********************************************************************
** Solidified function: write_attribute
********************************************************************/
be_local_closure(Matter_Plugin_write_attribute, /* name */
be_nested_proto(
5, /* nstack */
4, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
0, /* has constants */
NULL, /* no const */
be_str_weak(write_attribute),
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x4C100000, // 0000 LDNIL R4
0x80040800, // 0001 RET 1 R4
})
)
);
/*******************************************************************/
/******************************************************************** /********************************************************************
** Solidified function: invoke_request ** Solidified function: invoke_request
********************************************************************/ ********************************************************************/
@ -155,6 +180,66 @@ be_local_closure(Matter_Plugin_read_event, /* name */
/*******************************************************************/ /*******************************************************************/
/********************************************************************
** Solidified function: get_endpoint
********************************************************************/
be_local_closure(Matter_Plugin_get_endpoint, /* name */
be_nested_proto(
2, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(endpoint),
}),
be_str_weak(get_endpoint),
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x88040100, // 0000 GETMBR R1 R0 K0
0x80040200, // 0001 RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(Matter_Plugin_init, /* name */
be_nested_proto(
4, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str_weak(device),
/* K1 */ be_nested_str_weak(endpoint),
/* K2 */ be_nested_str_weak(clusters),
/* K3 */ be_nested_str_weak(EMPTY_LIST),
}),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x90020001, // 0000 SETMBR R0 K0 R1
0x90020202, // 0001 SETMBR R0 K1 R2
0x880C0103, // 0002 GETMBR R3 R0 K3
0x90020403, // 0003 SETMBR R0 K2 R3
0x80000000, // 0004 RET 0
})
)
);
/*******************************************************************/
/******************************************************************** /********************************************************************
** Solidified function: has ** Solidified function: has
********************************************************************/ ********************************************************************/
@ -198,67 +283,6 @@ be_local_closure(Matter_Plugin_has, /* name */
/*******************************************************************/ /*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(Matter_Plugin_init, /* name */
be_nested_proto(
4, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_weak(device),
/* K1 */ be_nested_str_weak(endpoint),
/* K2 */ be_nested_str_weak(endpoints),
/* K3 */ be_nested_str_weak(EMPTY_LIST),
/* K4 */ be_nested_str_weak(clusters),
}),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[ 7]) { /* code */
0x90020001, // 0000 SETMBR R0 K0 R1
0x90020202, // 0001 SETMBR R0 K1 R2
0x880C0103, // 0002 GETMBR R3 R0 K3
0x90020403, // 0003 SETMBR R0 K2 R3
0x880C0103, // 0004 GETMBR R3 R0 K3
0x90020803, // 0005 SETMBR R0 K4 R3
0x80000000, // 0006 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: write_attribute
********************************************************************/
be_local_closure(Matter_Plugin_write_attribute, /* name */
be_nested_proto(
5, /* nstack */
4, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
0, /* has constants */
NULL, /* no const */
be_str_weak(write_attribute),
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x4C100000, // 0000 LDNIL R4
0x80040800, // 0001 RET 1 R4
})
)
);
/*******************************************************************/
/******************************************************************** /********************************************************************
** Solidified function: timed_request ** Solidified function: timed_request
********************************************************************/ ********************************************************************/
@ -285,26 +309,32 @@ be_local_closure(Matter_Plugin_timed_request, /* name */
/******************************************************************** /********************************************************************
** Solidified function: get_endpoints ** Solidified function: get_attribute_list
********************************************************************/ ********************************************************************/
be_local_closure(Matter_Plugin_get_endpoints, /* name */ be_local_closure(Matter_Plugin_get_attribute_list, /* name */
be_nested_proto( be_nested_proto(
2, /* nstack */ 7, /* nstack */
1, /* argc */ 3, /* argc */
2, /* varg */ 2, /* varg */
0, /* has upvals */ 0, /* has upvals */
NULL, /* no upvals */ NULL, /* no upvals */
0, /* has sup protos */ 0, /* has sup protos */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
( &(const bvalue[ 1]) { /* constants */ ( &(const bvalue[ 3]) { /* constants */
/* K0 */ be_nested_str_weak(endpoints), /* K0 */ be_nested_str_weak(clusters),
/* K1 */ be_nested_str_weak(find),
/* K2 */ be_nested_str_weak(EMPTY_LIST),
}), }),
be_str_weak(get_endpoints), be_str_weak(get_attribute_list),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */ ( &(const binstruction[ 6]) { /* code */
0x88040100, // 0000 GETMBR R1 R0 K0 0x880C0100, // 0000 GETMBR R3 R0 K0
0x80040200, // 0001 RET 1 R1 0x8C0C0701, // 0001 GETMET R3 R3 K1
0x5C140400, // 0002 MOVE R5 R2
0x88180102, // 0003 GETMBR R6 R0 K2
0x7C0C0600, // 0004 CALL R3 3
0x80040600, // 0005 RET 1 R3
}) })
) )
); );
@ -397,21 +427,26 @@ be_local_closure(Matter_Plugin_attribute_updated, /* name */
0, /* has sup protos */ 0, /* has sup protos */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
( &(const bvalue[ 2]) { /* constants */ ( &(const bvalue[ 3]) { /* constants */
/* K0 */ be_nested_str_weak(device), /* K0 */ be_nested_str_weak(endpoint),
/* K1 */ be_nested_str_weak(attribute_updated), /* K1 */ be_nested_str_weak(device),
/* K2 */ be_nested_str_weak(attribute_updated),
}), }),
be_str_weak(attribute_updated), be_str_weak(attribute_updated),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[ 8]) { /* code */ ( &(const binstruction[12]) { /* code */
0x88140100, // 0000 GETMBR R5 R0 K0 0x4C140000, // 0000 LDNIL R5
0x8C140B01, // 0001 GETMET R5 R5 K1 0x1C140205, // 0001 EQ R5 R1 R5
0x5C1C0200, // 0002 MOVE R7 R1 0x78160000, // 0002 JMPF R5 #0004
0x5C200400, // 0003 MOVE R8 R2 0x88040100, // 0003 GETMBR R1 R0 K0
0x5C240600, // 0004 MOVE R9 R3 0x88140101, // 0004 GETMBR R5 R0 K1
0x5C280800, // 0005 MOVE R10 R4 0x8C140B02, // 0005 GETMET R5 R5 K2
0x7C140A00, // 0006 CALL R5 5 0x5C1C0200, // 0006 MOVE R7 R1
0x80000000, // 0007 RET 0 0x5C200400, // 0007 MOVE R8 R2
0x5C240600, // 0008 MOVE R9 R3
0x5C280800, // 0009 MOVE R10 R4
0x7C140A00, // 000A CALL R5 5
0x80000000, // 000B RET 0
}) })
) )
); );
@ -419,32 +454,23 @@ be_local_closure(Matter_Plugin_attribute_updated, /* name */
/******************************************************************** /********************************************************************
** Solidified function: get_attribute_list ** Solidified function: parse_sensors
********************************************************************/ ********************************************************************/
be_local_closure(Matter_Plugin_get_attribute_list, /* name */ be_local_closure(Matter_Plugin_parse_sensors, /* name */
be_nested_proto( be_nested_proto(
7, /* nstack */ 2, /* nstack */
3, /* argc */ 2, /* argc */
2, /* varg */ 2, /* varg */
0, /* has upvals */ 0, /* has upvals */
NULL, /* no upvals */ NULL, /* no upvals */
0, /* has sup protos */ 0, /* has sup protos */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 0, /* has constants */
( &(const bvalue[ 3]) { /* constants */ NULL, /* no const */
/* K0 */ be_nested_str_weak(clusters), be_str_weak(parse_sensors),
/* K1 */ be_nested_str_weak(find),
/* K2 */ be_nested_str_weak(EMPTY_LIST),
}),
be_str_weak(get_attribute_list),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[ 6]) { /* code */ ( &(const binstruction[ 1]) { /* code */
0x880C0100, // 0000 GETMBR R3 R0 K0 0x80000000, // 0000 RET 0
0x8C0C0701, // 0001 GETMET R3 R3 K1
0x5C140400, // 0002 MOVE R5 R2
0x88180102, // 0003 GETMBR R6 R0 K2
0x7C0C0600, // 0004 CALL R3 3
0x80040600, // 0005 RET 1 R3
}) })
) )
); );
@ -455,24 +481,24 @@ be_local_closure(Matter_Plugin_get_attribute_list, /* name */
** Solidified class: Matter_Plugin ** Solidified class: Matter_Plugin
********************************************************************/ ********************************************************************/
be_local_class(Matter_Plugin, be_local_class(Matter_Plugin,
4, 3,
NULL, NULL,
be_nested_map(21, be_nested_map(21,
( (struct bmapnode*) &(const bmapnode[]) { ( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_read_attribute_closure) }, { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_read_attribute_closure) },
{ be_const_key_weak(get_attribute_list, 13), be_const_closure(Matter_Plugin_get_attribute_list_closure) }, { be_const_key_weak(parse_sensors, 13), be_const_closure(Matter_Plugin_parse_sensors_closure) },
{ be_const_key_weak(write_attribute, -1), be_const_closure(Matter_Plugin_write_attribute_closure) }, { be_const_key_weak(has, -1), be_const_closure(Matter_Plugin_has_closure) },
{ be_const_key_weak(every_second, -1), be_const_closure(Matter_Plugin_every_second_closure) }, { be_const_key_weak(every_second, -1), be_const_closure(Matter_Plugin_every_second_closure) },
{ be_const_key_weak(subscribe_attribute, 9), be_const_closure(Matter_Plugin_subscribe_attribute_closure) }, { be_const_key_weak(write_attribute, 9), be_const_closure(Matter_Plugin_write_attribute_closure) },
{ be_const_key_weak(subscribe_event, -1), be_const_closure(Matter_Plugin_subscribe_event_closure) }, { be_const_key_weak(subscribe_event, -1), be_const_closure(Matter_Plugin_subscribe_event_closure) },
{ be_const_key_weak(device, -1), be_const_var(0) }, { be_const_key_weak(device, -1), be_const_var(0) },
{ be_const_key_weak(endpoint, 20), be_const_var(2) }, { be_const_key_weak(endpoint, -1), be_const_var(1) },
{ be_const_key_weak(EMPTY_LIST, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { { be_const_key_weak(EMPTY_LIST, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(0, be_const_list( * be_nested_list(0,
( (struct bvalue*) &(const bvalue[]) { ( (struct bvalue*) &(const bvalue[]) {
})) ) } )) }, })) ) } )) },
{ be_const_key_weak(attribute_updated, 2), be_const_closure(Matter_Plugin_attribute_updated_closure) }, { be_const_key_weak(attribute_updated, 20), be_const_closure(Matter_Plugin_attribute_updated_closure) },
{ be_const_key_weak(has, -1), be_const_closure(Matter_Plugin_has_closure) }, { be_const_key_weak(get_endpoint, 2), be_const_closure(Matter_Plugin_get_endpoint_closure) },
{ be_const_key_weak(EMPTY_MAP, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { { be_const_key_weak(EMPTY_MAP, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(0, be_const_map( * be_nested_map(0,
( (struct bmapnode*) &(const bmapnode[]) { ( (struct bmapnode*) &(const bmapnode[]) {
@ -482,10 +508,10 @@ be_local_class(Matter_Plugin,
{ be_const_key_weak(invoke_request, 18), be_const_closure(Matter_Plugin_invoke_request_closure) }, { be_const_key_weak(invoke_request, 18), be_const_closure(Matter_Plugin_invoke_request_closure) },
{ be_const_key_weak(read_event, 1), be_const_closure(Matter_Plugin_read_event_closure) }, { be_const_key_weak(read_event, 1), be_const_closure(Matter_Plugin_read_event_closure) },
{ be_const_key_weak(get_cluster_list, -1), be_const_closure(Matter_Plugin_get_cluster_list_closure) }, { be_const_key_weak(get_cluster_list, -1), be_const_closure(Matter_Plugin_get_cluster_list_closure) },
{ be_const_key_weak(get_endpoints, -1), be_const_closure(Matter_Plugin_get_endpoints_closure) }, { be_const_key_weak(get_attribute_list, -1), be_const_closure(Matter_Plugin_get_attribute_list_closure) },
{ be_const_key_weak(timed_request, -1), be_const_closure(Matter_Plugin_timed_request_closure) }, { be_const_key_weak(timed_request, -1), be_const_closure(Matter_Plugin_timed_request_closure) },
{ be_const_key_weak(clusters, -1), be_const_var(3) }, { be_const_key_weak(clusters, -1), be_const_var(2) },
{ be_const_key_weak(endpoints, -1), be_const_var(1) }, { be_const_key_weak(subscribe_attribute, -1), be_const_closure(Matter_Plugin_subscribe_attribute_closure) },
})), })),
be_str_weak(Matter_Plugin) be_str_weak(Matter_Plugin)
); );

View File

@ -0,0 +1,395 @@
/* Solidification of Matter_Plugin_Device.h */
/********************************************************************\
* Generated code, don't edit *
\********************************************************************/
#include "be_constobj.h"
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[45]) { /* 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
0x7002000E, // 001C JMP #002C
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
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: read_attribute
********************************************************************/
be_local_closure(Matter_Plugin_Device_read_attribute, /* name */
be_nested_proto(
16, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[21]) { /* constants */
/* K0 */ be_nested_str_weak(string),
/* K1 */ be_nested_str_weak(matter),
/* K2 */ be_nested_str_weak(TLV),
/* K3 */ be_nested_str_weak(cluster),
/* K4 */ be_nested_str_weak(attribute),
/* K5 */ be_const_int(0),
/* K6 */ be_nested_str_weak(Matter_TLV_array),
/* K7 */ be_nested_str_weak(TYPES),
/* K8 */ be_nested_str_weak(keys),
/* K9 */ be_nested_str_weak(add_struct),
/* K10 */ be_nested_str_weak(add_TLV),
/* K11 */ be_nested_str_weak(U2),
/* K12 */ be_const_int(1),
/* K13 */ be_nested_str_weak(stop_iteration),
/* K14 */ be_nested_str_weak(get_cluster_list),
/* K15 */ be_nested_str_weak(U4),
/* K16 */ be_const_int(2),
/* K17 */ be_const_int(3),
/* K18 */ be_nested_str_weak(create_TLV),
/* K19 */ be_nested_str_weak(U1),
/* K20 */ be_nested_str_weak(read_attribute),
}),
be_str_weak(read_attribute),
&be_const_str_solidified,
( &(const binstruction[167]) { /* code */
0xA40E0000, // 0000 IMPORT R3 K0
0xB8120200, // 0001 GETNGBL R4 K1
0x88100902, // 0002 GETMBR R4 R4 K2
0x88140503, // 0003 GETMBR R5 R2 K3
0x88180504, // 0004 GETMBR R6 R2 K4
0x541E001C, // 0005 LDINT R7 29
0x1C1C0A07, // 0006 EQ R7 R5 R7
0x781E0057, // 0007 JMPF R7 #0060
0x1C1C0D05, // 0008 EQ R7 R6 K5
0x781E001C, // 0009 JMPF R7 #0027
0x8C1C0906, // 000A GETMET R7 R4 K6
0x7C1C0200, // 000B CALL R7 1
0x60200010, // 000C GETGBL R8 G16
0x88240107, // 000D GETMBR R9 R0 K7
0x8C241308, // 000E GETMET R9 R9 K8
0x7C240200, // 000F CALL R9 1
0x7C200200, // 0010 CALL R8 1
0xA802000F, // 0011 EXBLK 0 #0022
0x5C241000, // 0012 MOVE R9 R8
0x7C240000, // 0013 CALL R9 0
0x8C280F09, // 0014 GETMET R10 R7 K9
0x7C280200, // 0015 CALL R10 1
0x8C2C150A, // 0016 GETMET R11 R10 K10
0x58340005, // 0017 LDCONST R13 K5
0x8838090B, // 0018 GETMBR R14 R4 K11
0x5C3C1200, // 0019 MOVE R15 R9
0x7C2C0800, // 001A CALL R11 4
0x8C2C150A, // 001B GETMET R11 R10 K10
0x5834000C, // 001C LDCONST R13 K12
0x8838090B, // 001D GETMBR R14 R4 K11
0x883C0107, // 001E GETMBR R15 R0 K7
0x943C1E09, // 001F GETIDX R15 R15 R9
0x7C2C0800, // 0020 CALL R11 4
0x7001FFEF, // 0021 JMP #0012
0x5820000D, // 0022 LDCONST R8 K13
0xAC200200, // 0023 CATCH R8 1 0
0xB0080000, // 0024 RAISE 2 R0 R0
0x80040E00, // 0025 RET 1 R7
0x70020037, // 0026 JMP #005F
0x1C1C0D0C, // 0027 EQ R7 R6 K12
0x781E0013, // 0028 JMPF R7 #003D
0x8C1C0906, // 0029 GETMET R7 R4 K6
0x7C1C0200, // 002A CALL R7 1
0x60200010, // 002B GETGBL R8 G16
0x8C24010E, // 002C GETMET R9 R0 K14
0x7C240200, // 002D CALL R9 1
0x7C200200, // 002E CALL R8 1
0xA8020007, // 002F EXBLK 0 #0038
0x5C241000, // 0030 MOVE R9 R8
0x7C240000, // 0031 CALL R9 0
0x8C280F0A, // 0032 GETMET R10 R7 K10
0x4C300000, // 0033 LDNIL R12
0x8834090F, // 0034 GETMBR R13 R4 K15
0x5C381200, // 0035 MOVE R14 R9
0x7C280800, // 0036 CALL R10 4
0x7001FFF7, // 0037 JMP #0030
0x5820000D, // 0038 LDCONST R8 K13
0xAC200200, // 0039 CATCH R8 1 0
0xB0080000, // 003A RAISE 2 R0 R0
0x80040E00, // 003B RET 1 R7
0x70020021, // 003C JMP #005F
0x1C1C0D10, // 003D EQ R7 R6 K16
0x781E0008, // 003E JMPF R7 #0048
0x8C1C0906, // 003F GETMET R7 R4 K6
0x7C1C0200, // 0040 CALL R7 1
0x8C200F0A, // 0041 GETMET R8 R7 K10
0x4C280000, // 0042 LDNIL R10
0x882C090B, // 0043 GETMBR R11 R4 K11
0x54320005, // 0044 LDINT R12 6
0x7C200800, // 0045 CALL R8 4
0x80040E00, // 0046 RET 1 R7
0x70020016, // 0047 JMP #005F
0x1C1C0D11, // 0048 EQ R7 R6 K17
0x781E0003, // 0049 JMPF R7 #004E
0x8C1C0906, // 004A GETMET R7 R4 K6
0x7C1C0200, // 004B CALL R7 1
0x80040E00, // 004C RET 1 R7
0x70020010, // 004D JMP #005F
0x541EFFFB, // 004E LDINT R7 65532
0x1C1C0C07, // 004F EQ R7 R6 R7
0x781E0005, // 0050 JMPF R7 #0057
0x8C1C0912, // 0051 GETMET R7 R4 K18
0x8824090F, // 0052 GETMBR R9 R4 K15
0x58280005, // 0053 LDCONST R10 K5
0x7C1C0600, // 0054 CALL R7 3
0x80040E00, // 0055 RET 1 R7
0x70020007, // 0056 JMP #005F
0x541EFFFC, // 0057 LDINT R7 65533
0x1C1C0C07, // 0058 EQ R7 R6 R7
0x781E0004, // 0059 JMPF R7 #005F
0x8C1C0912, // 005A GETMET R7 R4 K18
0x8824090F, // 005B GETMBR R9 R4 K15
0x5828000C, // 005C LDCONST R10 K12
0x7C1C0600, // 005D CALL R7 3
0x80040E00, // 005E RET 1 R7
0x70020045, // 005F JMP #00A6
0x1C1C0B11, // 0060 EQ R7 R5 K17
0x781E0021, // 0061 JMPF R7 #0084
0x1C1C0D05, // 0062 EQ R7 R6 K5
0x781E0005, // 0063 JMPF R7 #006A
0x8C1C0912, // 0064 GETMET R7 R4 K18
0x8824090B, // 0065 GETMBR R9 R4 K11
0x58280005, // 0066 LDCONST R10 K5
0x7C1C0600, // 0067 CALL R7 3
0x80040E00, // 0068 RET 1 R7
0x70020018, // 0069 JMP #0083
0x1C1C0D0C, // 006A EQ R7 R6 K12
0x781E0005, // 006B JMPF R7 #0072
0x8C1C0912, // 006C GETMET R7 R4 K18
0x88240913, // 006D GETMBR R9 R4 K19
0x58280005, // 006E LDCONST R10 K5
0x7C1C0600, // 006F CALL R7 3
0x80040E00, // 0070 RET 1 R7
0x70020010, // 0071 JMP #0083
0x541EFFFB, // 0072 LDINT R7 65532
0x1C1C0C07, // 0073 EQ R7 R6 R7
0x781E0005, // 0074 JMPF R7 #007B
0x8C1C0912, // 0075 GETMET R7 R4 K18
0x8824090F, // 0076 GETMBR R9 R4 K15
0x58280005, // 0077 LDCONST R10 K5
0x7C1C0600, // 0078 CALL R7 3
0x80040E00, // 0079 RET 1 R7
0x70020007, // 007A JMP #0083
0x541EFFFC, // 007B LDINT R7 65533
0x1C1C0C07, // 007C EQ R7 R6 R7
0x781E0004, // 007D JMPF R7 #0083
0x8C1C0912, // 007E GETMET R7 R4 K18
0x8824090F, // 007F GETMBR R9 R4 K15
0x542A0003, // 0080 LDINT R10 4
0x7C1C0600, // 0081 CALL R7 3
0x80040E00, // 0082 RET 1 R7
0x70020021, // 0083 JMP #00A6
0x541E0003, // 0084 LDINT R7 4
0x1C1C0A07, // 0085 EQ R7 R5 R7
0x781E0016, // 0086 JMPF R7 #009E
0x1C1C0D05, // 0087 EQ R7 R6 K5
0x781E0002, // 0088 JMPF R7 #008C
0x4C1C0000, // 0089 LDNIL R7
0x80040E00, // 008A RET 1 R7
0x70020010, // 008B JMP #009D
0x541EFFFB, // 008C LDINT R7 65532
0x1C1C0C07, // 008D EQ R7 R6 R7
0x781E0005, // 008E JMPF R7 #0095
0x8C1C0912, // 008F GETMET R7 R4 K18
0x8824090F, // 0090 GETMBR R9 R4 K15
0x58280005, // 0091 LDCONST R10 K5
0x7C1C0600, // 0092 CALL R7 3
0x80040E00, // 0093 RET 1 R7
0x70020007, // 0094 JMP #009D
0x541EFFFC, // 0095 LDINT R7 65533
0x1C1C0C07, // 0096 EQ R7 R6 R7
0x781E0004, // 0097 JMPF R7 #009D
0x8C1C0912, // 0098 GETMET R7 R4 K18
0x8824090F, // 0099 GETMBR R9 R4 K15
0x542A0003, // 009A LDINT R10 4
0x7C1C0600, // 009B CALL R7 3
0x80040E00, // 009C RET 1 R7
0x70020007, // 009D JMP #00A6
0x601C0003, // 009E GETGBL R7 G3
0x5C200000, // 009F MOVE R8 R0
0x7C1C0200, // 00A0 CALL R7 1
0x8C1C0F14, // 00A1 GETMET R7 R7 K20
0x5C240200, // 00A2 MOVE R9 R1
0x5C280400, // 00A3 MOVE R10 R2
0x7C1C0600, // 00A4 CALL R7 3
0x80040E00, // 00A5 RET 1 R7
0x80000000, // 00A6 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(Matter_Plugin_Device_init, /* name */
be_nested_proto(
8, /* nstack */
4, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 3]) { /* constants */
/* K0 */ be_nested_str_weak(init),
/* K1 */ be_nested_str_weak(clusters),
/* K2 */ be_nested_str_weak(CLUSTERS),
}),
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
0x7C100600, // 0006 CALL R4 3
0x88100102, // 0007 GETMBR R4 R0 K2
0x90020204, // 0008 SETMBR R0 K1 R4
0x80000000, // 0009 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: Matter_Plugin_Device
********************************************************************/
extern const bclass be_class_Matter_Plugin;
be_local_class(Matter_Plugin_Device,
0,
&be_class_Matter_Plugin,
be_nested_map(5,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(TYPES, 3), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_int(0, -1), be_const_int(0) },
})) ) } )) },
{ 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(init, -1), be_const_closure(Matter_Plugin_Device_init_closure) },
{ be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(3,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_int(3, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(4,
( (struct bvalue*) &(const bvalue[]) {
be_const_int(0),
be_const_int(1),
be_const_int(65532),
be_const_int(65533),
})) ) } )) },
{ be_const_key_int(4, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(3,
( (struct bvalue*) &(const bvalue[]) {
be_const_int(0),
be_const_int(65532),
be_const_int(65533),
})) ) } )) },
{ be_const_key_int(29, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(6,
( (struct bvalue*) &(const bvalue[]) {
be_const_int(0),
be_const_int(1),
be_const_int(2),
be_const_int(3),
be_const_int(65532),
be_const_int(65533),
})) ) } )) },
})) ) } )) },
})),
be_str_weak(Matter_Plugin_Device)
);
/*******************************************************************/
void be_load_Matter_Plugin_Device_class(bvm *vm) {
be_pushntvclass(vm, &be_class_Matter_Plugin_Device);
be_setglobal(vm, "Matter_Plugin_Device");
be_pop(vm, 1);
}
/********************************************************************/
/* End of solidification */

View File

@ -7,44 +7,11 @@
extern const bclass be_class_Matter_Plugin_OnOff; extern const bclass be_class_Matter_Plugin_OnOff;
/******************************************************************** /********************************************************************
** Solidified function: onoff_changed ** Solidified function: invoke_request
********************************************************************/ ********************************************************************/
be_local_closure(Matter_Plugin_OnOff_onoff_changed, /* name */ be_local_closure(Matter_Plugin_OnOff_invoke_request, /* name */
be_nested_proto( be_nested_proto(
6, /* nstack */ 13, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 3]) { /* constants */
/* K0 */ be_nested_str_weak(attribute_updated),
/* K1 */ be_nested_str_weak(endpoint),
/* K2 */ be_const_int(0),
}),
be_str_weak(onoff_changed),
&be_const_str_solidified,
( &(const binstruction[ 6]) { /* code */
0x8C040100, // 0000 GETMET R1 R0 K0
0x880C0101, // 0001 GETMBR R3 R0 K1
0x54120005, // 0002 LDINT R4 6
0x58140002, // 0003 LDCONST R5 K2
0x7C040800, // 0004 CALL R1 4
0x80000000, // 0005 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(Matter_Plugin_OnOff_init, /* name */
be_nested_proto(
8, /* nstack */
4, /* argc */ 4, /* argc */
2, /* varg */ 2, /* varg */
0, /* has upvals */ 0, /* has upvals */
@ -52,80 +19,143 @@ be_local_closure(Matter_Plugin_OnOff_init, /* name */
0, /* has sup protos */ 0, /* has sup protos */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
( &(const bvalue[ 9]) { /* constants */ ( &(const bvalue[13]) { /* constants */
/* K0 */ be_nested_str_weak(init), /* K0 */ be_nested_str_weak(matter),
/* K1 */ be_nested_str_weak(endpoints), /* K1 */ be_nested_str_weak(TLV),
/* K2 */ be_nested_str_weak(ENDPOINTS), /* K2 */ be_nested_str_weak(cluster),
/* K3 */ be_nested_str_weak(endpoint), /* K3 */ be_nested_str_weak(command),
/* K4 */ be_const_int(0), /* K4 */ be_const_int(3),
/* K5 */ be_nested_str_weak(clusters), /* K5 */ be_const_int(0),
/* K6 */ be_nested_str_weak(CLUSTERS), /* K6 */ be_const_int(1),
/* K7 */ be_nested_str_weak(get_onoff), /* K7 */ be_nested_str_weak(Matter_TLV_struct),
/* K8 */ be_nested_str_weak(tasmota_relay_index), /* K8 */ be_nested_str_weak(add_TLV),
/* K9 */ be_nested_str_weak(U2),
/* K10 */ be_nested_str_weak(set_onoff),
/* K11 */ be_const_int(2),
/* K12 */ be_nested_str_weak(get_onoff),
}), }),
be_str_weak(init), be_str_weak(invoke_request),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[22]) { /* code */ ( &(const binstruction[119]) { /* code */
0x60100003, // 0000 GETGBL R4 G3 0xB8120000, // 0000 GETNGBL R4 K0
0x5C140000, // 0001 MOVE R5 R0 0x88100901, // 0001 GETMBR R4 R4 K1
0x7C100200, // 0002 CALL R4 1 0x88140702, // 0002 GETMBR R5 R3 K2
0x8C100900, // 0003 GETMET R4 R4 K0 0x88180703, // 0003 GETMBR R6 R3 K3
0x5C180200, // 0004 MOVE R6 R1 0x1C1C0B04, // 0004 EQ R7 R5 K4
0x5C1C0400, // 0005 MOVE R7 R2 0x781E0016, // 0005 JMPF R7 #001D
0x7C100600, // 0006 CALL R4 3 0x1C1C0D05, // 0006 EQ R7 R6 K5
0x88100102, // 0007 GETMBR R4 R0 K2 0x781E0002, // 0007 JMPF R7 #000B
0x90020204, // 0008 SETMBR R0 K1 R4 0x501C0200, // 0008 LDBOOL R7 1 0
0x88100102, // 0009 GETMBR R4 R0 K2 0x80040E00, // 0009 RET 1 R7
0x94100904, // 000A GETIDX R4 R4 K4 0x70020010, // 000A JMP #001C
0x90020604, // 000B SETMBR R0 K3 R4 0x1C1C0D06, // 000B EQ R7 R6 K6
0x88100106, // 000C GETMBR R4 R0 K6 0x781E0009, // 000C JMPF R7 #0017
0x90020A04, // 000D SETMBR R0 K5 R4 0x8C1C0907, // 000D GETMET R7 R4 K7
0x8C100107, // 000E GETMET R4 R0 K7 0x7C1C0200, // 000E CALL R7 1
0x7C100200, // 000F CALL R4 1 0x8C200F08, // 000F GETMET R8 R7 K8
0x4C100000, // 0010 LDNIL R4 0x58280005, // 0010 LDCONST R10 K5
0x1C100604, // 0011 EQ R4 R3 R4 0x882C0909, // 0011 GETMBR R11 R4 K9
0x78120000, // 0012 JMPF R4 #0014 0x58300005, // 0012 LDCONST R12 K5
0x580C0004, // 0013 LDCONST R3 K4 0x7C200800, // 0013 CALL R8 4
0x90021003, // 0014 SETMBR R0 K8 R3 0x900E0705, // 0014 SETMBR R3 K3 K5
0x80000000, // 0015 RET 0 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
/******************************************************************** 0x70020058, // 001C JMP #0076
** Solidified function: set_onoff 0x541E0003, // 001D LDINT R7 4
********************************************************************/ 0x1C1C0A07, // 001E EQ R7 R5 R7
be_local_closure(Matter_Plugin_OnOff_set_onoff, /* name */ 0x781E0002, // 001F JMPF R7 #0023
be_nested_proto( 0x501C0200, // 0020 LDBOOL R7 1 0
7, /* nstack */ 0x80040E00, // 0021 RET 1 R7
2, /* argc */ 0x70020052, // 0022 JMP #0076
2, /* varg */ 0x541E0004, // 0023 LDINT R7 5
0, /* has upvals */ 0x1C1C0A07, // 0024 EQ R7 R5 R7
NULL, /* no upvals */ 0x781E0002, // 0025 JMPF R7 #0029
0, /* has sup protos */ 0x501C0200, // 0026 LDBOOL R7 1 0
NULL, /* no sub protos */ 0x80040E00, // 0027 RET 1 R7
1, /* has constants */ 0x7002004C, // 0028 JMP #0076
( &(const bvalue[ 4]) { /* constants */ 0x541E0005, // 0029 LDINT R7 6
/* K0 */ be_nested_str_weak(tasmota), 0x1C1C0A07, // 002A EQ R7 R5 R7
/* K1 */ be_nested_str_weak(set_power), 0x781E001B, // 002B JMPF R7 #0048
/* K2 */ be_nested_str_weak(tasmota_relay_index), 0x1C1C0D05, // 002C EQ R7 R6 K5
/* K3 */ be_nested_str_weak(get_onoff), 0x781E0005, // 002D JMPF R7 #0034
}), 0x8C1C010A, // 002E GETMET R7 R0 K10
be_str_weak(set_onoff), 0x50240000, // 002F LDBOOL R9 0 0
&be_const_str_solidified, 0x7C1C0400, // 0030 CALL R7 2
( &(const binstruction[10]) { /* code */ 0x501C0200, // 0031 LDBOOL R7 1 0
0xB80A0000, // 0000 GETNGBL R2 K0 0x80040E00, // 0032 RET 1 R7
0x8C080501, // 0001 GETMET R2 R2 K1 0x70020012, // 0033 JMP #0047
0x88100102, // 0002 GETMBR R4 R0 K2 0x1C1C0D06, // 0034 EQ R7 R6 K6
0x60140017, // 0003 GETGBL R5 G23 0x781E0005, // 0035 JMPF R7 #003C
0x5C180200, // 0004 MOVE R6 R1 0x8C1C010A, // 0036 GETMET R7 R0 K10
0x7C140200, // 0005 CALL R5 1 0x50240200, // 0037 LDBOOL R9 1 0
0x7C080600, // 0006 CALL R2 3 0x7C1C0400, // 0038 CALL R7 2
0x8C080103, // 0007 GETMET R2 R0 K3 0x501C0200, // 0039 LDBOOL R7 1 0
0x7C080200, // 0008 CALL R2 1 0x80040E00, // 003A RET 1 R7
0x80000000, // 0009 RET 0 0x7002000A, // 003B JMP #0047
0x1C1C0D0B, // 003C EQ R7 R6 K11
0x781E0008, // 003D JMPF R7 #0047
0x8C1C010A, // 003E GETMET R7 R0 K10
0x8C24010C, // 003F GETMET R9 R0 K12
0x7C240200, // 0040 CALL R9 1
0x78260000, // 0041 JMPF R9 #0043
0x50240001, // 0042 LDBOOL R9 0 1
0x50240200, // 0043 LDBOOL R9 1 0
0x7C1C0400, // 0044 CALL R7 2
0x501C0200, // 0045 LDBOOL R7 1 0
0x80040E00, // 0046 RET 1 R7
0x7002002D, // 0047 JMP #0076
0x541E0007, // 0048 LDINT R7 8
0x1C1C0A07, // 0049 EQ R7 R5 R7
0x781E002A, // 004A JMPF R7 #0076
0x1C1C0D05, // 004B EQ R7 R6 K5
0x781E0002, // 004C JMPF R7 #0050
0x501C0200, // 004D LDBOOL R7 1 0
0x80040E00, // 004E RET 1 R7
0x70020025, // 004F JMP #0076
0x1C1C0D06, // 0050 EQ R7 R6 K6
0x781E0002, // 0051 JMPF R7 #0055
0x501C0200, // 0052 LDBOOL R7 1 0
0x80040E00, // 0053 RET 1 R7
0x70020020, // 0054 JMP #0076
0x1C1C0D0B, // 0055 EQ R7 R6 K11
0x781E0002, // 0056 JMPF R7 #005A
0x501C0200, // 0057 LDBOOL R7 1 0
0x80040E00, // 0058 RET 1 R7
0x7002001B, // 0059 JMP #0076
0x1C1C0D04, // 005A EQ R7 R6 K4
0x781E0002, // 005B JMPF R7 #005F
0x501C0200, // 005C LDBOOL R7 1 0
0x80040E00, // 005D RET 1 R7
0x70020016, // 005E JMP #0076
0x541E0003, // 005F LDINT R7 4
0x1C1C0C07, // 0060 EQ R7 R6 R7
0x781E0002, // 0061 JMPF R7 #0065
0x501C0200, // 0062 LDBOOL R7 1 0
0x80040E00, // 0063 RET 1 R7
0x70020010, // 0064 JMP #0076
0x541E0004, // 0065 LDINT R7 5
0x1C1C0C07, // 0066 EQ R7 R6 R7
0x781E0002, // 0067 JMPF R7 #006B
0x501C0200, // 0068 LDBOOL R7 1 0
0x80040E00, // 0069 RET 1 R7
0x7002000A, // 006A JMP #0076
0x541E0005, // 006B LDINT R7 6
0x1C1C0C07, // 006C EQ R7 R6 R7
0x781E0002, // 006D JMPF R7 #0071
0x501C0200, // 006E LDBOOL R7 1 0
0x80040E00, // 006F RET 1 R7
0x70020004, // 0070 JMP #0076
0x541E0006, // 0071 LDINT R7 7
0x1C1C0C07, // 0072 EQ R7 R6 R7
0x781E0001, // 0073 JMPF R7 #0076
0x501C0200, // 0074 LDBOOL R7 1 0
0x80040E00, // 0075 RET 1 R7
0x80000000, // 0076 RET 0
}) })
) )
); );
@ -189,6 +219,76 @@ be_local_closure(Matter_Plugin_OnOff_get_onoff, /* name */
/*******************************************************************/ /*******************************************************************/
/********************************************************************
** Solidified function: onoff_changed
********************************************************************/
be_local_closure(Matter_Plugin_OnOff_onoff_changed, /* 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[ 2]) { /* constants */
/* K0 */ be_nested_str_weak(attribute_updated),
/* K1 */ be_const_int(0),
}),
be_str_weak(onoff_changed),
&be_const_str_solidified,
( &(const binstruction[ 6]) { /* code */
0x8C040100, // 0000 GETMET R1 R0 K0
0x4C0C0000, // 0001 LDNIL R3
0x54120005, // 0002 LDINT R4 6
0x58140001, // 0003 LDCONST R5 K1
0x7C040800, // 0004 CALL R1 4
0x80000000, // 0005 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: set_onoff
********************************************************************/
be_local_closure(Matter_Plugin_OnOff_set_onoff, /* 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(tasmota),
/* K1 */ be_nested_str_weak(set_power),
/* K2 */ be_nested_str_weak(tasmota_relay_index),
/* K3 */ be_nested_str_weak(get_onoff),
}),
be_str_weak(set_onoff),
&be_const_str_solidified,
( &(const binstruction[10]) { /* code */
0xB80A0000, // 0000 GETNGBL R2 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x88100102, // 0002 GETMBR R4 R0 K2
0x60140017, // 0003 GETGBL R5 G23
0x5C180200, // 0004 MOVE R6 R1
0x7C140200, // 0005 CALL R5 1
0x7C080600, // 0006 CALL R2 3
0x8C080103, // 0007 GETMET R2 R0 K3
0x7C080200, // 0008 CALL R2 1
0x80000000, // 0009 RET 0
})
)
);
/*******************************************************************/
/******************************************************************** /********************************************************************
** Solidified function: read_attribute ** Solidified function: read_attribute
********************************************************************/ ********************************************************************/
@ -491,6 +591,53 @@ be_local_closure(Matter_Plugin_OnOff_read_attribute, /* name */
/*******************************************************************/ /*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(Matter_Plugin_OnOff_init, /* name */
be_nested_proto(
8, /* nstack */
4, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 6]) { /* constants */
/* K0 */ be_nested_str_weak(init),
/* K1 */ be_nested_str_weak(clusters),
/* K2 */ be_nested_str_weak(CLUSTERS),
/* K3 */ be_nested_str_weak(get_onoff),
/* K4 */ be_const_int(0),
/* K5 */ be_nested_str_weak(tasmota_relay_index),
}),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[17]) { /* 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
0x7C100600, // 0006 CALL R4 3
0x88100102, // 0007 GETMBR R4 R0 K2
0x90020204, // 0008 SETMBR R0 K1 R4
0x8C100103, // 0009 GETMET R4 R0 K3
0x7C100200, // 000A CALL R4 1
0x4C100000, // 000B LDNIL R4
0x1C100604, // 000C EQ R4 R3 R4
0x78120000, // 000D JMPF R4 #000F
0x580C0004, // 000E LDCONST R3 K4
0x90020A03, // 000F SETMBR R0 K5 R3
0x80000000, // 0010 RET 0
})
)
);
/*******************************************************************/
/******************************************************************** /********************************************************************
** Solidified function: every_second ** Solidified function: every_second
********************************************************************/ ********************************************************************/
@ -519,162 +666,6 @@ be_local_closure(Matter_Plugin_OnOff_every_second, /* name */
/*******************************************************************/ /*******************************************************************/
/********************************************************************
** Solidified function: invoke_request
********************************************************************/
be_local_closure(Matter_Plugin_OnOff_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[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(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(set_onoff),
/* K11 */ be_const_int(2),
/* K12 */ be_nested_str_weak(get_onoff),
}),
be_str_weak(invoke_request),
&be_const_str_solidified,
( &(const binstruction[119]) { /* code */
0xB8120000, // 0000 GETNGBL R4 K0
0x88100901, // 0001 GETMBR R4 R4 K1
0x88140702, // 0002 GETMBR R5 R3 K2
0x88180703, // 0003 GETMBR R6 R3 K3
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
0x70020058, // 001C JMP #0076
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
0x70020052, // 0022 JMP #0076
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
0x7002004C, // 0028 JMP #0076
0x541E0005, // 0029 LDINT R7 6
0x1C1C0A07, // 002A EQ R7 R5 R7
0x781E001B, // 002B JMPF R7 #0048
0x1C1C0D05, // 002C EQ R7 R6 K5
0x781E0005, // 002D JMPF R7 #0034
0x8C1C010A, // 002E GETMET R7 R0 K10
0x50240000, // 002F LDBOOL R9 0 0
0x7C1C0400, // 0030 CALL R7 2
0x501C0200, // 0031 LDBOOL R7 1 0
0x80040E00, // 0032 RET 1 R7
0x70020012, // 0033 JMP #0047
0x1C1C0D06, // 0034 EQ R7 R6 K6
0x781E0005, // 0035 JMPF R7 #003C
0x8C1C010A, // 0036 GETMET R7 R0 K10
0x50240200, // 0037 LDBOOL R9 1 0
0x7C1C0400, // 0038 CALL R7 2
0x501C0200, // 0039 LDBOOL R7 1 0
0x80040E00, // 003A RET 1 R7
0x7002000A, // 003B JMP #0047
0x1C1C0D0B, // 003C EQ R7 R6 K11
0x781E0008, // 003D JMPF R7 #0047
0x8C1C010A, // 003E GETMET R7 R0 K10
0x8C24010C, // 003F GETMET R9 R0 K12
0x7C240200, // 0040 CALL R9 1
0x78260000, // 0041 JMPF R9 #0043
0x50240001, // 0042 LDBOOL R9 0 1
0x50240200, // 0043 LDBOOL R9 1 0
0x7C1C0400, // 0044 CALL R7 2
0x501C0200, // 0045 LDBOOL R7 1 0
0x80040E00, // 0046 RET 1 R7
0x7002002D, // 0047 JMP #0076
0x541E0007, // 0048 LDINT R7 8
0x1C1C0A07, // 0049 EQ R7 R5 R7
0x781E002A, // 004A JMPF R7 #0076
0x1C1C0D05, // 004B EQ R7 R6 K5
0x781E0002, // 004C JMPF R7 #0050
0x501C0200, // 004D LDBOOL R7 1 0
0x80040E00, // 004E RET 1 R7
0x70020025, // 004F JMP #0076
0x1C1C0D06, // 0050 EQ R7 R6 K6
0x781E0002, // 0051 JMPF R7 #0055
0x501C0200, // 0052 LDBOOL R7 1 0
0x80040E00, // 0053 RET 1 R7
0x70020020, // 0054 JMP #0076
0x1C1C0D0B, // 0055 EQ R7 R6 K11
0x781E0002, // 0056 JMPF R7 #005A
0x501C0200, // 0057 LDBOOL R7 1 0
0x80040E00, // 0058 RET 1 R7
0x7002001B, // 0059 JMP #0076
0x1C1C0D04, // 005A EQ R7 R6 K4
0x781E0002, // 005B JMPF R7 #005F
0x501C0200, // 005C LDBOOL R7 1 0
0x80040E00, // 005D RET 1 R7
0x70020016, // 005E JMP #0076
0x541E0003, // 005F LDINT R7 4
0x1C1C0C07, // 0060 EQ R7 R6 R7
0x781E0002, // 0061 JMPF R7 #0065
0x501C0200, // 0062 LDBOOL R7 1 0
0x80040E00, // 0063 RET 1 R7
0x70020010, // 0064 JMP #0076
0x541E0004, // 0065 LDINT R7 5
0x1C1C0C07, // 0066 EQ R7 R6 R7
0x781E0002, // 0067 JMPF R7 #006B
0x501C0200, // 0068 LDBOOL R7 1 0
0x80040E00, // 0069 RET 1 R7
0x7002000A, // 006A JMP #0076
0x541E0005, // 006B LDINT R7 6
0x1C1C0C07, // 006C EQ R7 R6 R7
0x781E0002, // 006D JMPF R7 #0071
0x501C0200, // 006E LDBOOL R7 1 0
0x80040E00, // 006F RET 1 R7
0x70020004, // 0070 JMP #0076
0x541E0006, // 0071 LDINT R7 7
0x1C1C0C07, // 0072 EQ R7 R6 R7
0x781E0001, // 0073 JMPF R7 #0076
0x501C0200, // 0074 LDBOOL R7 1 0
0x80040E00, // 0075 RET 1 R7
0x80000000, // 0076 RET 0
})
)
);
/*******************************************************************/
/******************************************************************** /********************************************************************
** Solidified class: Matter_Plugin_OnOff ** Solidified class: Matter_Plugin_OnOff
********************************************************************/ ********************************************************************/
@ -682,23 +673,18 @@ extern const bclass be_class_Matter_Plugin;
be_local_class(Matter_Plugin_OnOff, be_local_class(Matter_Plugin_OnOff,
2, 2,
&be_class_Matter_Plugin, &be_class_Matter_Plugin,
be_nested_map(12, be_nested_map(11,
( (struct bmapnode*) &(const bmapnode[]) { ( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { { be_const_key_weak(every_second, -1), be_const_closure(Matter_Plugin_OnOff_every_second_closure) },
{ be_const_key_weak(get_onoff, 8), be_const_closure(Matter_Plugin_OnOff_get_onoff_closure) },
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_OnOff_init_closure) },
{ be_const_key_weak(shadow_onoff, 5), be_const_var(1) },
{ be_const_key_weak(TYPES, 7), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(1, be_const_map( * be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) { ( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_int(266, -1), be_const_int(2) }, { be_const_key_int(266, -1), be_const_int(2) },
})) ) } )) }, })) ) } )) },
{ be_const_key_weak(ENDPOINTS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_OnOff_read_attribute_closure) },
be_const_list( * be_nested_list(1,
( (struct bvalue*) &(const bvalue[]) {
be_const_int(1),
})) ) } )) },
{ be_const_key_weak(onoff_changed, 0), be_const_closure(Matter_Plugin_OnOff_onoff_changed_closure) },
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_OnOff_init_closure) },
{ be_const_key_weak(shadow_onoff, -1), be_const_var(1) },
{ be_const_key_weak(tasmota_relay_index, -1), be_const_var(0) },
{ be_const_key_weak(set_onoff, 8), be_const_closure(Matter_Plugin_OnOff_set_onoff_closure) },
{ be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { { be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(5, be_const_map( * be_nested_map(5,
( (struct bmapnode*) &(const bmapnode[]) { ( (struct bmapnode*) &(const bmapnode[]) {
@ -747,10 +733,10 @@ be_local_class(Matter_Plugin_OnOff,
be_const_int(65533), be_const_int(65533),
})) ) } )) }, })) ) } )) },
})) ) } )) }, })) ) } )) },
{ be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_OnOff_read_attribute_closure) }, { be_const_key_weak(set_onoff, -1), be_const_closure(Matter_Plugin_OnOff_set_onoff_closure) },
{ be_const_key_weak(every_second, -1), be_const_closure(Matter_Plugin_OnOff_every_second_closure) }, { be_const_key_weak(onoff_changed, -1), be_const_closure(Matter_Plugin_OnOff_onoff_changed_closure) },
{ be_const_key_weak(get_onoff, 7), be_const_closure(Matter_Plugin_OnOff_get_onoff_closure) }, { be_const_key_weak(tasmota_relay_index, 2), be_const_var(0) },
{ be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_OnOff_invoke_request_closure) }, { be_const_key_weak(invoke_request, 0), be_const_closure(Matter_Plugin_OnOff_invoke_request_closure) },
})), })),
be_str_weak(Matter_Plugin_OnOff) be_str_weak(Matter_Plugin_OnOff)
); );

View File

@ -1192,16 +1192,14 @@ be_local_closure(Matter_Plugin_Root_init, /* name */
0, /* has sup protos */ 0, /* has sup protos */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
( &(const bvalue[ 5]) { /* constants */ ( &(const bvalue[ 3]) { /* constants */
/* K0 */ be_nested_str_weak(init), /* K0 */ be_nested_str_weak(init),
/* K1 */ be_nested_str_weak(endpoints), /* K1 */ be_nested_str_weak(clusters),
/* K2 */ be_nested_str_weak(ENDPOINTS), /* K2 */ be_nested_str_weak(CLUSTERS),
/* K3 */ be_nested_str_weak(clusters),
/* K4 */ be_nested_str_weak(CLUSTERS),
}), }),
be_str_weak(init), be_str_weak(init),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[12]) { /* code */ ( &(const binstruction[10]) { /* code */
0x600C0003, // 0000 GETGBL R3 G3 0x600C0003, // 0000 GETGBL R3 G3
0x5C100000, // 0001 MOVE R4 R0 0x5C100000, // 0001 MOVE R4 R0
0x7C0C0200, // 0002 CALL R3 1 0x7C0C0200, // 0002 CALL R3 1
@ -1211,9 +1209,7 @@ be_local_closure(Matter_Plugin_Root_init, /* name */
0x7C0C0600, // 0006 CALL R3 3 0x7C0C0600, // 0006 CALL R3 3
0x880C0102, // 0007 GETMBR R3 R0 K2 0x880C0102, // 0007 GETMBR R3 R0 K2
0x90020203, // 0008 SETMBR R0 K1 R3 0x90020203, // 0008 SETMBR R0 K1 R3
0x880C0104, // 0009 GETMBR R3 R0 K4 0x80000000, // 0009 RET 0
0x90020603, // 000A SETMBR R0 K3 R3
0x80000000, // 000B RET 0
}) })
) )
); );
@ -2029,11 +2025,17 @@ extern const bclass be_class_Matter_Plugin;
be_local_class(Matter_Plugin_Root, be_local_class(Matter_Plugin_Root,
0, 0,
&be_class_Matter_Plugin, &be_class_Matter_Plugin,
be_nested_map(7, be_nested_map(6,
( (struct bmapnode*) &(const bmapnode[]) { ( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(read_attribute, 1), be_const_closure(Matter_Plugin_Root_read_attribute_closure) }, { be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Root_read_attribute_closure) },
{ be_const_key_weak(invoke_request, 2), be_const_closure(Matter_Plugin_Root_invoke_request_closure) }, { be_const_key_weak(write_attribute, -1), be_const_closure(Matter_Plugin_Root_write_attribute_closure) },
{ be_const_key_weak(CLUSTERS, 6), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { { 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(22, -1), be_const_int(1) },
})) ) } )) },
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Root_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(14, be_const_map( * be_nested_map(14,
( (struct bmapnode*) &(const bmapnode[]) { ( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_int(56, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { { be_const_key_int(56, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
@ -2119,7 +2121,7 @@ be_local_class(Matter_Plugin_Root,
be_const_int(5), be_const_int(5),
})) ) } )) }, })) ) } )) },
{ be_const_key_int(40, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { { be_const_key_int(40, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(13, be_const_list( * be_nested_list(14,
( (struct bvalue*) &(const bvalue[]) { ( (struct bvalue*) &(const bvalue[]) {
be_const_int(0), be_const_int(0),
be_const_int(1), be_const_int(1),
@ -2131,6 +2133,7 @@ be_local_class(Matter_Plugin_Root,
be_const_int(7), be_const_int(7),
be_const_int(8), be_const_int(8),
be_const_int(9), be_const_int(9),
be_const_int(10),
be_const_int(15), be_const_int(15),
be_const_int(18), be_const_int(18),
be_const_int(19), be_const_int(19),
@ -2143,18 +2146,7 @@ be_local_class(Matter_Plugin_Root,
be_const_int(65532), be_const_int(65532),
})) ) } )) }, })) ) } )) },
})) ) } )) }, })) ) } )) },
{ be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { { be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Root_invoke_request_closure) },
be_const_map( * be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_int(22, -1), be_const_int(1) },
})) ) } )) },
{ be_const_key_weak(write_attribute, -1), be_const_closure(Matter_Plugin_Root_write_attribute_closure) },
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Root_init_closure) },
{ be_const_key_weak(ENDPOINTS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(1,
( (struct bvalue*) &(const bvalue[]) {
be_const_int(0),
})) ) } )) },
})), })),
be_str_weak(Matter_Plugin_Root) be_str_weak(Matter_Plugin_Root)
); );

View File

@ -0,0 +1,324 @@
/* Solidification of Matter_Plugin_Temp_Sensor.h */
/********************************************************************\
* Generated code, don't edit *
\********************************************************************/
#include "be_constobj.h"
extern const bclass be_class_Matter_Plugin_Temp_Sensor;
/********************************************************************
** Solidified function: get_temperature
********************************************************************/
be_local_closure(Matter_Plugin_Temp_Sensor_get_temperature, /* name */
be_nested_proto(
2, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(shadow_temperature),
}),
be_str_weak(get_temperature),
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x88040100, // 0000 GETMBR R1 R0 K0
0x80040200, // 0001 RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: every_second
********************************************************************/
be_local_closure(Matter_Plugin_Temp_Sensor_every_second, /* name */
be_nested_proto(
3, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(get_temperature),
}),
be_str_weak(every_second),
&be_const_str_solidified,
( &(const binstruction[ 3]) { /* code */
0x8C040100, // 0000 GETMET R1 R0 K0
0x7C040200, // 0001 CALL R1 1
0x80000000, // 0002 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: parse_sensors
********************************************************************/
be_local_closure(Matter_Plugin_Temp_Sensor_parse_sensors, /* name */
be_nested_proto(
8, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_weak(tasmota_sensor_matcher),
/* K1 */ be_nested_str_weak(match),
/* K2 */ be_nested_str_weak(shadow_temperature),
/* K3 */ be_nested_str_weak(attribute_updated),
/* K4 */ be_const_int(0),
}),
be_str_weak(parse_sensors),
&be_const_str_solidified,
( &(const binstruction[21]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x780A0011, // 0001 JMPF R2 #0014
0x6008000A, // 0002 GETGBL R2 G10
0x880C0100, // 0003 GETMBR R3 R0 K0
0x8C0C0701, // 0004 GETMET R3 R3 K1
0x5C140200, // 0005 MOVE R5 R1
0x7C0C0400, // 0006 CALL R3 2
0x7C080200, // 0007 CALL R2 1
0x4C0C0000, // 0008 LDNIL R3
0x200C0403, // 0009 NE R3 R2 R3
0x780E0008, // 000A JMPF R3 #0014
0x880C0102, // 000B GETMBR R3 R0 K2
0x200C0403, // 000C NE R3 R2 R3
0x780E0004, // 000D JMPF R3 #0013
0x8C0C0103, // 000E GETMET R3 R0 K3
0x4C140000, // 000F LDNIL R5
0x541A0401, // 0010 LDINT R6 1026
0x581C0004, // 0011 LDCONST R7 K4
0x7C0C0800, // 0012 CALL R3 4
0x90020402, // 0013 SETMBR R0 K2 R2
0x80000000, // 0014 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(Matter_Plugin_Temp_Sensor_init, /* name */
be_nested_proto(
8, /* nstack */
4, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 8]) { /* constants */
/* K0 */ be_nested_str_weak(init),
/* K1 */ be_nested_str_weak(clusters),
/* K2 */ be_nested_str_weak(CLUSTERS),
/* K3 */ be_nested_str_weak(tasmota_sensor_filter),
/* K4 */ be_nested_str_weak(tasmota_sensor_matcher),
/* K5 */ be_nested_str_weak(tasmota),
/* K6 */ be_nested_str_weak(Rule_Matcher),
/* K7 */ be_nested_str_weak(parse),
}),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[17]) { /* 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
0x7C100600, // 0006 CALL R4 3
0x88100102, // 0007 GETMBR R4 R0 K2
0x90020204, // 0008 SETMBR R0 K1 R4
0x90020603, // 0009 SETMBR R0 K3 R3
0xB8120A00, // 000A GETNGBL R4 K5
0x88100906, // 000B GETMBR R4 R4 K6
0x8C100907, // 000C GETMET R4 R4 K7
0x5C180600, // 000D MOVE R6 R3
0x7C100400, // 000E CALL R4 2
0x90020804, // 000F SETMBR R0 K4 R4
0x80000000, // 0010 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: read_attribute
********************************************************************/
be_local_closure(Matter_Plugin_Temp_Sensor_read_attribute, /* name */
be_nested_proto(
13, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[13]) { /* constants */
/* K0 */ be_nested_str_weak(string),
/* K1 */ be_nested_str_weak(matter),
/* K2 */ be_nested_str_weak(TLV),
/* K3 */ be_nested_str_weak(cluster),
/* K4 */ be_nested_str_weak(attribute),
/* K5 */ be_const_int(0),
/* K6 */ be_nested_str_weak(shadow_temperature),
/* K7 */ be_nested_str_weak(create_TLV),
/* K8 */ be_nested_str_weak(I2),
/* K9 */ be_nested_str_weak(NULL),
/* K10 */ be_const_int(1),
/* K11 */ be_const_int(2),
/* K12 */ be_nested_str_weak(read_attribute),
}),
be_str_weak(read_attribute),
&be_const_str_solidified,
( &(const binstruction[55]) { /* code */
0xA40E0000, // 0000 IMPORT R3 K0
0xB8120200, // 0001 GETNGBL R4 K1
0x88100902, // 0002 GETMBR R4 R4 K2
0x88140503, // 0003 GETMBR R5 R2 K3
0x88180504, // 0004 GETMBR R6 R2 K4
0x541E0401, // 0005 LDINT R7 1026
0x1C1C0A07, // 0006 EQ R7 R5 R7
0x781E0025, // 0007 JMPF R7 #002E
0x1C1C0D05, // 0008 EQ R7 R6 K5
0x781E0013, // 0009 JMPF R7 #001E
0x881C0106, // 000A GETMBR R7 R0 K6
0x4C200000, // 000B LDNIL R8
0x201C0E08, // 000C NE R7 R7 R8
0x781E0009, // 000D JMPF R7 #0018
0x8C1C0907, // 000E GETMET R7 R4 K7
0x88240908, // 000F GETMBR R9 R4 K8
0x60280009, // 0010 GETGBL R10 G9
0x882C0106, // 0011 GETMBR R11 R0 K6
0x54320063, // 0012 LDINT R12 100
0x082C160C, // 0013 MUL R11 R11 R12
0x7C280200, // 0014 CALL R10 1
0x7C1C0600, // 0015 CALL R7 3
0x80040E00, // 0016 RET 1 R7
0x70020004, // 0017 JMP #001D
0x8C1C0907, // 0018 GETMET R7 R4 K7
0x88240909, // 0019 GETMBR R9 R4 K9
0x4C280000, // 001A LDNIL R10
0x7C1C0600, // 001B CALL R7 3
0x80040E00, // 001C RET 1 R7
0x7002000E, // 001D JMP #002D
0x1C1C0D0A, // 001E EQ R7 R6 K10
0x781E0005, // 001F JMPF R7 #0026
0x8C1C0907, // 0020 GETMET R7 R4 K7
0x88240908, // 0021 GETMBR R9 R4 K8
0x5429EC77, // 0022 LDINT R10 -5000
0x7C1C0600, // 0023 CALL R7 3
0x80040E00, // 0024 RET 1 R7
0x70020006, // 0025 JMP #002D
0x1C1C0D0B, // 0026 EQ R7 R6 K11
0x781E0004, // 0027 JMPF R7 #002D
0x8C1C0907, // 0028 GETMET R7 R4 K7
0x88240908, // 0029 GETMBR R9 R4 K8
0x542A3A97, // 002A LDINT R10 15000
0x7C1C0600, // 002B CALL R7 3
0x80040E00, // 002C RET 1 R7
0x70020007, // 002D JMP #0036
0x601C0003, // 002E GETGBL R7 G3
0x5C200000, // 002F MOVE R8 R0
0x7C1C0200, // 0030 CALL R7 1
0x8C1C0F0C, // 0031 GETMET R7 R7 K12
0x5C240200, // 0032 MOVE R9 R1
0x5C280400, // 0033 MOVE R10 R2
0x7C1C0600, // 0034 CALL R7 3
0x80040E00, // 0035 RET 1 R7
0x80000000, // 0036 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: Matter_Plugin_Temp_Sensor
********************************************************************/
extern const bclass be_class_Matter_Plugin_Device;
be_local_class(Matter_Plugin_Temp_Sensor,
3,
&be_class_Matter_Plugin_Device,
be_nested_map(10,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(TYPES, 7), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_int(770, -1), be_const_int(2) },
})) ) } )) },
{ be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Temp_Sensor_read_attribute_closure) },
{ be_const_key_weak(get_temperature, 1), be_const_closure(Matter_Plugin_Temp_Sensor_get_temperature_closure) },
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Temp_Sensor_init_closure) },
{ be_const_key_weak(CLUSTERS, 9), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(4,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_int(4, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(3,
( (struct bvalue*) &(const bvalue[]) {
be_const_int(0),
be_const_int(65532),
be_const_int(65533),
})) ) } )) },
{ be_const_key_int(29, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(6,
( (struct bvalue*) &(const bvalue[]) {
be_const_int(0),
be_const_int(1),
be_const_int(2),
be_const_int(3),
be_const_int(65532),
be_const_int(65533),
})) ) } )) },
{ be_const_key_int(1026, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(3,
( (struct bvalue*) &(const bvalue[]) {
be_const_int(0),
be_const_int(1),
be_const_int(2),
})) ) } )) },
{ be_const_key_int(3, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(4,
( (struct bvalue*) &(const bvalue[]) {
be_const_int(0),
be_const_int(1),
be_const_int(65532),
be_const_int(65533),
})) ) } )) },
})) ) } )) },
{ be_const_key_weak(every_second, 3), be_const_closure(Matter_Plugin_Temp_Sensor_every_second_closure) },
{ be_const_key_weak(tasmota_sensor_filter, 8), be_const_var(0) },
{ be_const_key_weak(tasmota_sensor_matcher, -1), be_const_var(1) },
{ be_const_key_weak(parse_sensors, -1), be_const_closure(Matter_Plugin_Temp_Sensor_parse_sensors_closure) },
{ be_const_key_weak(shadow_temperature, -1), be_const_var(2) },
})),
be_str_weak(Matter_Plugin_Temp_Sensor)
);
/*******************************************************************/
void be_load_Matter_Plugin_Temp_Sensor_class(bvm *vm) {
be_pushntvclass(vm, &be_class_Matter_Plugin_Temp_Sensor);
be_setglobal(vm, "Matter_Plugin_Temp_Sensor");
be_pop(vm, 1);
}
/********************************************************************/
/* End of solidification */

View File

@ -3495,7 +3495,7 @@ be_local_closure(Matter_Session_Store_find_session_source_id_unsecure, /* name
0x7C0C0400, // 0002 CALL R3 2 0x7C0C0400, // 0002 CALL R3 2
0x4C100000, // 0003 LDNIL R4 0x4C100000, // 0003 LDNIL R4
0x1C100604, // 0004 EQ R4 R3 R4 0x1C100604, // 0004 EQ R4 R3 R4
0x7812000B, // 0005 JMPF R4 #0012 0x7812000E, // 0005 JMPF R4 #0015
0xB8120200, // 0006 GETNGBL R4 K1 0xB8120200, // 0006 GETNGBL R4 K1
0x8C100902, // 0007 GETMET R4 R4 K2 0x8C100902, // 0007 GETMET R4 R4 K2
0x5C180000, // 0008 MOVE R6 R0 0x5C180000, // 0008 MOVE R6 R0

View File

@ -2118,8 +2118,8 @@ be_local_closure(Matter_TLV_list_encode, /* name */
( &(const bvalue[11]) { /* constants */ ( &(const bvalue[11]) { /* constants */
/* K0 */ be_nested_str_weak(_encode_tag), /* K0 */ be_nested_str_weak(_encode_tag),
/* K1 */ be_nested_str_weak(val), /* K1 */ be_nested_str_weak(val),
/* K2 */ be_nested_str_weak(copy), /* K2 */ be_nested_str_weak(is_struct),
/* K3 */ be_nested_str_weak(is_struct), /* K3 */ be_nested_str_weak(copy),
/* K4 */ be_nested_str_weak(sort), /* K4 */ be_nested_str_weak(sort),
/* K5 */ be_nested_str_weak(encode), /* K5 */ be_nested_str_weak(encode),
/* K6 */ be_nested_str_weak(stop_iteration), /* K6 */ be_nested_str_weak(stop_iteration),
@ -2130,7 +2130,7 @@ be_local_closure(Matter_TLV_list_encode, /* name */
}), }),
be_str_weak(encode), be_str_weak(encode),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[36]) { /* code */ ( &(const binstruction[37]) { /* code */
0x4C080000, // 0000 LDNIL R2 0x4C080000, // 0000 LDNIL R2
0x1C080202, // 0001 EQ R2 R1 R2 0x1C080202, // 0001 EQ R2 R1 R2
0x780A0002, // 0002 JMPF R2 #0006 0x780A0002, // 0002 JMPF R2 #0006
@ -2141,32 +2141,33 @@ be_local_closure(Matter_TLV_list_encode, /* name */
0x5C100200, // 0007 MOVE R4 R1 0x5C100200, // 0007 MOVE R4 R1
0x7C080400, // 0008 CALL R2 2 0x7C080400, // 0008 CALL R2 2
0x88080101, // 0009 GETMBR R2 R0 K1 0x88080101, // 0009 GETMBR R2 R0 K1
0x8C080502, // 000A GETMET R2 R2 K2 0x880C0102, // 000A GETMBR R3 R0 K2
0x7C080200, // 000B CALL R2 1 0x780E0005, // 000B JMPF R3 #0012
0x880C0103, // 000C GETMBR R3 R0 K3 0x8C0C0503, // 000C GETMET R3 R2 K3
0x780E0002, // 000D JMPF R3 #0011 0x7C0C0200, // 000D CALL R3 1
0x8C0C0104, // 000E GETMET R3 R0 K4 0x5C080600, // 000E MOVE R2 R3
0x5C140400, // 000F MOVE R5 R2 0x8C0C0104, // 000F GETMET R3 R0 K4
0x7C0C0400, // 0010 CALL R3 2 0x5C140400, // 0010 MOVE R5 R2
0x600C0010, // 0011 GETGBL R3 G16 0x7C0C0400, // 0011 CALL R3 2
0x5C100400, // 0012 MOVE R4 R2 0x600C0010, // 0012 GETGBL R3 G16
0x7C0C0200, // 0013 CALL R3 1 0x5C100400, // 0013 MOVE R4 R2
0xA8020005, // 0014 EXBLK 0 #001B 0x7C0C0200, // 0014 CALL R3 1
0x5C100600, // 0015 MOVE R4 R3 0xA8020005, // 0015 EXBLK 0 #001C
0x7C100000, // 0016 CALL R4 0 0x5C100600, // 0016 MOVE R4 R3
0x8C140905, // 0017 GETMET R5 R4 K5 0x7C100000, // 0017 CALL R4 0
0x5C1C0200, // 0018 MOVE R7 R1 0x8C140905, // 0018 GETMET R5 R4 K5
0x7C140400, // 0019 CALL R5 2 0x5C1C0200, // 0019 MOVE R7 R1
0x7001FFF9, // 001A JMP #0015 0x7C140400, // 001A CALL R5 2
0x580C0006, // 001B LDCONST R3 K6 0x7001FFF9, // 001B JMP #0016
0xAC0C0200, // 001C CATCH R3 1 0 0x580C0006, // 001C LDCONST R3 K6
0xB0080000, // 001D RAISE 2 R0 R0 0xAC0C0200, // 001D CATCH R3 1 0
0x8C0C0307, // 001E GETMET R3 R1 K7 0xB0080000, // 001E RAISE 2 R0 R0
0x88140108, // 001F GETMBR R5 R0 K8 0x8C0C0307, // 001F GETMET R3 R1 K7
0x88140B09, // 0020 GETMBR R5 R5 K9 0x88140108, // 0020 GETMBR R5 R0 K8
0x5818000A, // 0021 LDCONST R6 K10 0x88140B09, // 0021 GETMBR R5 R5 K9
0x7C0C0600, // 0022 CALL R3 3 0x5818000A, // 0022 LDCONST R6 K10
0x80040200, // 0023 RET 1 R1 0x7C0C0600, // 0023 CALL R3 3
0x80040200, // 0024 RET 1 R1
}) })
) )
); );