Matter partial fix for Apple Homekit (#18313)

This commit is contained in:
s-hadinger 2023-04-01 11:51:34 +02:00 committed by GitHub
parent 3dd154ab31
commit 788208f131
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 11214 additions and 10979 deletions

View File

@ -1,5 +1,5 @@
#
# Matter_Commissioning.be - suppport for Matter Commissioning process
# Matter_Commissioning.be - suppport for Matter Commissioning process PASE and CASE
#
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
#
@ -109,6 +109,7 @@ class Matter_Commisioning_Context
def parse_PBKDFParamRequest(msg)
import crypto
import string
# sanity checks
if msg.opcode != 0x20 || msg.local_session_id != 0 || msg.protocol_id != 0
tasmota.log("MTR: invalid PBKDFParamRequest message", 2)
@ -132,7 +133,7 @@ class Matter_Commisioning_Context
# record the initiator_session_id
self.future_initiator_session_id = pbkdfparamreq.initiator_session_id
self.future_local_session_id = self.device.sessions.gen_local_session_id()
tasmota.log("MTR: Loc_session=" + str(self.future_local_session_id))
tasmota.log(string.format("MTR: +Session (%6i) from '[%s]:%i'", self.future_local_session_id, msg.remote_ip, msg.remote_port), 2)
# prepare response
var pbkdfparamresp = matter.PBKDFParamResponse()
@ -144,7 +145,7 @@ class Matter_Commisioning_Context
pbkdfparamresp.pbkdf_parameters_salt = self.device.commissioning_salt
pbkdfparamresp.pbkdf_parameters_iterations = self.device.commissioning_iterations
tasmota.log("MTR: pbkdfparamresp: " + str(matter.inspect(pbkdfparamresp)), 4)
var pbkdfparamresp_raw = pbkdfparamresp.encode()
var pbkdfparamresp_raw = pbkdfparamresp.tlv2raw()
tasmota.log("MTR: pbkdfparamresp_raw: " + pbkdfparamresp_raw.tohex(), 4)
self.PBKDFParamResponse = pbkdfparamresp_raw
@ -167,23 +168,23 @@ class Matter_Commisioning_Context
var pake1 = matter.Pake1().parse(msg.raw, msg.app_payload_idx)
self.pA = pake1.pA
tasmota.log("MTR: received pA=" + self.pA.tohex(), 4)
# tasmota.log("MTR: received pA=" + self.pA.tohex(), 4)
tasmota.log("MTR: spake: " + matter.inspect(self.spake), 4)
# tasmota.log("MTR: spake: " + matter.inspect(self.spake), 4)
# instanciate SPAKE
# for testing purpose, we don't send `w1` to make sure
self.spake = crypto.SPAKE2P_Matter(self.device.commissioning_w0, nil, self.device.commissioning_L)
# compute pB
self.spake.compute_pB(self.y)
self.pB = self.spake.pB
tasmota.log("MTR: y=" + self.y.tohex(), 4)
tasmota.log("MTR: pb=" + self.pB.tohex(), 4)
# tasmota.log("MTR: y=" + self.y.tohex(), 4)
# tasmota.log("MTR: pb=" + self.pB.tohex(), 4)
# compute ZV
self.spake.compute_ZV_verifier(self.pA)
tasmota.log("MTR: Z=" + self.spake.Z.tohex(), 4)
tasmota.log("MTR: V=" + self.spake.V.tohex(), 4)
# tasmota.log("MTR: Z=" + self.spake.Z.tohex(), 4)
# tasmota.log("MTR: V=" + self.spake.V.tohex(), 4)
var context = crypto.SHA256()
context.update(bytes().fromstring(self.Matter_Context_Prefix))
@ -191,7 +192,7 @@ class Matter_Commisioning_Context
context.update(self.PBKDFParamResponse)
var context_hash = context.out()
tasmota.log("MTR: Context=" + context_hash.tohex(), 4)
# tasmota.log("MTR: Context=" + context_hash.tohex(), 4)
# add pA
self.spake.pA = self.pA
@ -199,33 +200,33 @@ class Matter_Commisioning_Context
self.spake.set_context(context_hash)
self.spake.compute_TT_hash(true) # `true` to indicate it's Matter variant to SPAKE2+
tasmota.log("MTR: ------------------------------", 4)
tasmota.log("MTR: Context = " + self.spake.Context.tohex(), 4)
tasmota.log("MTR: M = " + self.spake.M.tohex(), 4)
tasmota.log("MTR: N = " + self.spake.N.tohex(), 4)
tasmota.log("MTR: pA = " + self.spake.pA.tohex(), 4)
tasmota.log("MTR: pB = " + self.spake.pB.tohex(), 4)
tasmota.log("MTR: Z = " + self.spake.Z.tohex(), 4)
tasmota.log("MTR: V = " + self.spake.V.tohex(), 4)
tasmota.log("MTR: w0 = " + self.spake.w0.tohex(), 4)
tasmota.log("MTR: ------------------------------", 4)
# tasmota.log("MTR: ------------------------------", 4)
# tasmota.log("MTR: Context = " + self.spake.Context.tohex(), 4)
# tasmota.log("MTR: M = " + self.spake.M.tohex(), 4)
# tasmota.log("MTR: N = " + self.spake.N.tohex(), 4)
# tasmota.log("MTR: pA = " + self.spake.pA.tohex(), 4)
# tasmota.log("MTR: pB = " + self.spake.pB.tohex(), 4)
# tasmota.log("MTR: Z = " + self.spake.Z.tohex(), 4)
# tasmota.log("MTR: V = " + self.spake.V.tohex(), 4)
# tasmota.log("MTR: w0 = " + self.spake.w0.tohex(), 4)
# tasmota.log("MTR: ------------------------------", 4)
tasmota.log("MTR: Kmain =" + self.spake.Kmain.tohex(), 4)
# tasmota.log("MTR: Kmain =" + self.spake.Kmain.tohex(), 4)
tasmota.log("MTR: KcA =" + self.spake.KcA.tohex(), 4)
tasmota.log("MTR: KcB =" + self.spake.KcB.tohex(), 4)
tasmota.log("MTR: K_shared=" + self.spake.K_shared.tohex(), 4)
tasmota.log("MTR: Ke =" + self.spake.Ke.tohex(), 4)
# tasmota.log("MTR: KcA =" + self.spake.KcA.tohex(), 4)
# tasmota.log("MTR: KcB =" + self.spake.KcB.tohex(), 4)
# tasmota.log("MTR: K_shared=" + self.spake.K_shared.tohex(), 4)
# tasmota.log("MTR: Ke =" + self.spake.Ke.tohex(), 4)
self.cB = self.spake.cB
self.Ke = self.spake.Ke
tasmota.log("MTR: cB=" + self.cB.tohex(), 4)
# tasmota.log("MTR: cB=" + self.cB.tohex(), 4)
var pake2 = matter.Pake2()
pake2.pB = self.pB
pake2.cB = self.cB
tasmota.log("MTR: pake2: " + matter.inspect(pake2), 4)
var pake2_raw = pake2.encode()
tasmota.log("MTR: pake2_raw: " + pake2_raw.tohex(), 4)
# tasmota.log("MTR: pake2: " + matter.inspect(pake2), 4)
var pake2_raw = pake2.tlv2raw()
# tasmota.log("MTR: pake2_raw: " + pake2_raw.tohex(), 4)
# now package the response message
@ -247,7 +248,7 @@ class Matter_Commisioning_Context
var pake3 = matter.Pake3().parse(msg.raw, msg.app_payload_idx)
self.cA = pake3.cA
tasmota.log("MTR: received cA=" + self.cA.tohex(), 4)
# tasmota.log("MTR: received cA=" + self.cA.tohex(), 4)
# check the value against computed
if self.cA != self.spake.cA
@ -264,12 +265,12 @@ class Matter_Commisioning_Context
self.R2IKey = session_keys[16..31]
self.AttestationChallenge = session_keys[32..47]
tasmota.log("MTR: ******************************", 4)
tasmota.log("MTR: session_keys=" + session_keys.tohex(), 4)
tasmota.log("MTR: I2RKey =" + self.I2RKey.tohex(), 4)
tasmota.log("MTR: R2IKey =" + self.R2IKey.tohex(), 4)
tasmota.log("MTR: AC =" + self.AttestationChallenge.tohex(), 4)
tasmota.log("MTR: ******************************", 4)
# tasmota.log("MTR: ******************************", 4)
# tasmota.log("MTR: session_keys=" + session_keys.tohex(), 4)
# tasmota.log("MTR: I2RKey =" + self.I2RKey.tohex(), 4)
# tasmota.log("MTR: R2IKey =" + self.R2IKey.tohex(), 4)
# tasmota.log("MTR: AC =" + self.AttestationChallenge.tohex(), 4)
# tasmota.log("MTR: ******************************", 4)
# StatusReport(GeneralCode: SUCCESS, ProtocolId: SECURE_CHANNEL, ProtocolCode: SESSION_ESTABLISHMENT_SUCCESS)
var raw = self.send_status_report(msg, 0x00, 0x0000, 0x0000, false)
@ -302,6 +303,7 @@ class Matter_Commisioning_Context
def parse_Sigma1(msg)
import crypto
import string
# sanity checks
if msg.opcode != 0x30 || msg.local_session_id != 0 || msg.protocol_id != 0
tasmota.log("MTR: invalid Sigma1 message", 2)
@ -340,7 +342,7 @@ class Matter_Commisioning_Context
session.__future_initiator_session_id = sigma1.initiator_session_id # update initiator_session_id
session.__future_local_session_id = self.device.sessions.gen_local_session_id()
self.future_local_session_id = session.__future_local_session_id
tasmota.log("MTR: Loc_session=" + str(self.future_local_session_id))
tasmota.log(string.format("MTR: +Session (%6i) from '[%s]:%i'", self.future_local_session_id, msg.remote_ip, msg.remote_port), 2)
# Check that it's a resumption
if is_resumption
@ -356,12 +358,12 @@ class Matter_Commisioning_Context
var Resume1MICPayload = ec.decrypt(encrypted)
var decrypted_tag = ec.tag()
tasmota.log("****************************************", 4)
tasmota.log("MTR: * s1rk = " + s1rk.tohex(), 4)
tasmota.log("MTR: * tag = " + tag.tohex(), 4)
tasmota.log("MTR: * Resume1MICPayload = " + Resume1MICPayload.tohex(), 4)
tasmota.log("MTR: * decrypted_tag = " + decrypted_tag.tohex(), 4)
tasmota.log("****************************************", 4)
# tasmota.log("****************************************", 4)
# tasmota.log("MTR: * s1rk = " + s1rk.tohex(), 4)
# tasmota.log("MTR: * tag = " + tag.tohex(), 4)
# tasmota.log("MTR: * Resume1MICPayload = " + Resume1MICPayload.tohex(), 4)
# tasmota.log("MTR: * decrypted_tag = " + decrypted_tag.tohex(), 4)
# tasmota.log("****************************************", 4)
if tag == decrypted_tag
# Generate and Send Sigma2_Resume
session.resumption_id = crypto.random(16) # generate a new resumption id
@ -390,15 +392,15 @@ class Matter_Commisioning_Context
var ac = session_keys[32..47]
var created = tasmota.rtc()['utc']
tasmota.log("MTR: ******************************", 4)
tasmota.log("MTR: I2RKey =" + i2r.tohex(), 4)
tasmota.log("MTR: R2IKey =" + r2i.tohex(), 4)
tasmota.log("MTR: AC =" + ac.tohex(), 4)
tasmota.log("MTR: ******************************", 4)
# tasmota.log("MTR: ******************************", 4)
# tasmota.log("MTR: I2RKey =" + i2r.tohex(), 4)
# tasmota.log("MTR: R2IKey =" + r2i.tohex(), 4)
# tasmota.log("MTR: AC =" + ac.tohex(), 4)
# tasmota.log("MTR: ******************************", 4)
var sigma2resume_raw = sigma2resume.encode()
var sigma2resume_raw = sigma2resume.tlv2raw()
session.__Msg1 = nil
tasmota.log("MTR: sigma2resume_raw: " + sigma2resume_raw.tohex(), 4)
# tasmota.log("MTR: sigma2resume_raw: " + sigma2resume_raw.tohex(), 4)
# now package the response message
var resp = msg.build_response(0x33 #-sigma-2-resume-#, true)
@ -437,7 +439,7 @@ class Matter_Commisioning_Context
sigma2_tbsdata.add_TLV(3, matter.TLV.B2, self.ResponderEph_pub)
sigma2_tbsdata.add_TLV(4, matter.TLV.B2, sigma1.initiatorEphPubKey)
var TBSData2Signature = crypto.EC_P256().ecdsa_sign_sha256(session.get_pk(), sigma2_tbsdata.encode())
var TBSData2Signature = crypto.EC_P256().ecdsa_sign_sha256(session.get_pk(), sigma2_tbsdata.tlv2raw())
var sigma2_tbedata = matter.TLV.Matter_TLV_struct()
sigma2_tbedata.add_TLV(1, matter.TLV.B2, session.get_noc())
@ -446,9 +448,9 @@ class Matter_Commisioning_Context
sigma2_tbedata.add_TLV(4, matter.TLV.B2, session.resumption_id)
# compute TranscriptHash = Crypto_Hash(message = Msg1)
tasmota.log("****************************************", 4)
# tasmota.log("****************************************", 4)
session.__Msg1 = sigma1.Msg1
tasmota.log("MTR: * MSG1 = " + session.__Msg1.tohex(), 4)
# tasmota.log("MTR: * MSG1 = " + session.__Msg1.tohex(), 4)
var TranscriptHash = crypto.SHA256().update(session.__Msg1).out()
# tasmota.log("MTR: TranscriptHash =" + TranscriptHash.tohex(), 4)
@ -457,27 +459,27 @@ class Matter_Commisioning_Context
var s2k_salt = session.get_ipk_group_key() + responderRandom + self.ResponderEph_pub + TranscriptHash
var s2k = crypto.HKDF_SHA256().derive(session.shared_secret, s2k_salt, s2k_info, 16)
tasmota.log("MTR: * SharedSecret = " + session.shared_secret.tohex(), 4)
tasmota.log("MTR: * s2k_salt = " + s2k_salt.tohex(), 4)
tasmota.log("MTR: * s2k = " + s2k.tohex(), 4)
# tasmota.log("MTR: * SharedSecret = " + session.shared_secret.tohex(), 4)
# tasmota.log("MTR: * s2k_salt = " + s2k_salt.tohex(), 4)
# tasmota.log("MTR: * s2k = " + s2k.tohex(), 4)
var sigma2_tbedata_raw = sigma2_tbedata.encode()
var sigma2_tbedata_raw = sigma2_tbedata.tlv2raw()
# // `AES_CCM.init(secret_key:bytes(16 or 32), iv:bytes(7..13), aad:bytes(), data_len:int, tag_len:int) -> instance`
var aes = crypto.AES_CCM(s2k, bytes().fromstring(self.TBEData2_Nonce), bytes(), size(sigma2_tbedata_raw), 16)
var TBEData2Encrypted = aes.encrypt(sigma2_tbedata_raw) + aes.tag()
tasmota.log("MTR: * TBEData2Enc = " + TBEData2Encrypted.tohex(), 4)
tasmota.log("****************************************", 4)
# tasmota.log("MTR: * TBEData2Enc = " + TBEData2Encrypted.tohex(), 4)
# tasmota.log("****************************************", 4)
var sigma2 = matter.Sigma2()
sigma2.responderRandom = responderRandom
sigma2.responderSessionId = self.future_local_session_id
sigma2.responderEphPubKey = self.ResponderEph_pub
sigma2.encrypted2 = TBEData2Encrypted
tasmota.log("MTR: sigma2: " + matter.inspect(sigma2), 4)
var sigma2_raw = sigma2.encode()
# tasmota.log("MTR: sigma2: " + matter.inspect(sigma2), 4)
var sigma2_raw = sigma2.tlv2raw()
session.__Msg2 = sigma2_raw
tasmota.log("MTR: sigma2_raw: " + sigma2_raw.tohex(), 4)
# tasmota.log("MTR: sigma2_raw: " + sigma2_raw.tohex(), 4)
# now package the response message
var resp = msg.build_response(0x31 #-sigma-2-#, true) # no reliable flag
@ -501,22 +503,22 @@ class Matter_Commisioning_Context
var session = msg.session
var sigma3 = matter.Sigma3().parse(msg.raw, msg.app_payload_idx)
tasmota.log("****************************************", 4)
# tasmota.log("****************************************", 4)
# compute TranscriptHash = Crypto_Hash(message = Msg1 || Msg2)
var TranscriptHash = crypto.SHA256().update(session.__Msg1).update(session.__Msg2).out()
tasmota.log("MTR: * session = " + str(session), 4)
tasmota.log("MTR: session.ipk_epoch_key " + str(session.get_ipk_epoch_key()), 4)
tasmota.log("MTR: session.fabric_compressed " + str(session.get_fabric_compressed()), 4)
tasmota.log("MTR: * ipk_group_key = " + session.get_ipk_group_key().tohex(), 4)
tasmota.log("MTR: * TranscriptHash= " + TranscriptHash.tohex(), 4)
# tasmota.log("MTR: * session = " + str(session), 4)
# tasmota.log("MTR: session.ipk_epoch_key " + str(session.get_ipk_epoch_key()), 4)
# tasmota.log("MTR: session.fabric_compressed " + str(session.get_fabric_compressed()), 4)
# tasmota.log("MTR: * ipk_group_key = " + session.get_ipk_group_key().tohex(), 4)
# tasmota.log("MTR: * TranscriptHash= " + TranscriptHash.tohex(), 4)
var s3k_info = bytes().fromstring(self.S3K_Info)
var s3k = crypto.HKDF_SHA256().derive(session.shared_secret, session.get_ipk_group_key() + TranscriptHash, s3k_info, 16)
tasmota.log("****************************************", 4)
tasmota.log("MTR: * s3k_salt = " + (session.get_ipk_group_key() + TranscriptHash).tohex(), 4)
tasmota.log("MTR: * s3k = " + s3k.tohex(), 4)
tasmota.log("****************************************", 4)
# tasmota.log("****************************************", 4)
# tasmota.log("MTR: * s3k_salt = " + (session.get_ipk_group_key() + TranscriptHash).tohex(), 4)
# tasmota.log("MTR: * s3k = " + s3k.tohex(), 4)
# tasmota.log("****************************************", 4)
# decrypt
var encrypted = sigma3.TBEData3Encrypted[0..-17]
@ -524,10 +526,10 @@ class Matter_Commisioning_Context
var ec = crypto.AES_CCM(s3k, bytes().fromstring(self.TBEData3_Nonce), bytes(), size(encrypted), 16)
var TBEData3 = ec.decrypt(encrypted)
var TBETag3 = ec.tag()
tasmota.log("MTR: * TBEData3 = " + TBEData3.tohex(), 4)
tasmota.log("MTR: * TBETag3 = " + TBETag3.tohex(), 4)
tasmota.log("MTR: * tag_sent = " + tag.tohex(), 4)
tasmota.log("****************************************", 4)
# tasmota.log("MTR: * TBEData3 = " + TBEData3.tohex(), 4)
# tasmota.log("MTR: * TBETag3 = " + TBETag3.tohex(), 4)
# tasmota.log("MTR: * tag_sent = " + tag.tohex(), 4)
# tasmota.log("****************************************", 4)
if TBETag3 != tag
tasmota.log("MTR: Tag don't match", 2)
@ -543,24 +545,24 @@ class Matter_Commisioning_Context
# Success = Crypto_VerifyChain(certificates = [TBEData3.initiatorNOC, TBEData3.initiatorICAC, TrustedRCAC]), when TBEData3.initiatorICAC is present
# TODO
var initiatorNOCTLV = matter.TLV.parse(initiatorNOC)
tasmota.log("MTR: initiatorNOCTLV = " + str(initiatorNOCTLV), 3)
# tasmota.log("MTR: initiatorNOCTLV = " + str(initiatorNOCTLV), 3)
var initiatorNOCPubKey = initiatorNOCTLV.findsubval(9)
var initiatorNOCListDN = initiatorNOCTLV.findsub(6)
var initiatorFabricId = initiatorNOCListDN.findsubval(17)
if type(initiatorFabricId) == 'int' initiatorFabricId = int64(initiatorFabricId) end
session.peer_node_id = initiatorFabricId.tobytes()
tasmota.log("MTR: initiatorFabricId="+str(session.peer_node_id), 3)
# tasmota.log("MTR: initiatorFabricId="+str(session.peer_node_id), 3)
var sigma3_tbs = matter.TLV.Matter_TLV_struct()
sigma3_tbs.add_TLV(1, matter.TLV.B1, initiatorNOC)
sigma3_tbs.add_TLV(2, matter.TLV.B1, initiatorICAC)
sigma3_tbs.add_TLV(3, matter.TLV.B1, self.initiatorEph_pub)
sigma3_tbs.add_TLV(4, matter.TLV.B1, self.ResponderEph_pub)
var sigma3_tbs_raw = sigma3_tbs.encode()
var sigma3_tbs_raw = sigma3_tbs.tlv2raw()
tasmota.log("MTR: * initiatorNOCPubKey = " + initiatorNOCPubKey.tohex(), 4)
tasmota.log("MTR: * ec_signature = " + ec_signature.tohex(), 4)
tasmota.log("****************************************", 4)
# tasmota.log("MTR: * initiatorNOCPubKey = " + initiatorNOCPubKey.tohex(), 4)
# tasmota.log("MTR: * ec_signature = " + ec_signature.tohex(), 4)
# tasmota.log("****************************************", 4)
# `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)
@ -580,9 +582,9 @@ class Matter_Commisioning_Context
session.__Msg1 = nil
session.__Msg2 = nil
tasmota.log("MTR: ******************************", 4)
tasmota.log("MTR: shared_secret =" + session.shared_secret.tohex(), 4)
tasmota.log("MTR: ipk + hash =" + (session.get_ipk_group_key() + TranscriptHash).tohex(), 4)
# tasmota.log("MTR: ******************************", 4)
# tasmota.log("MTR: shared_secret =" + session.shared_secret.tohex(), 4)
# tasmota.log("MTR: ipk + hash =" + (session.get_ipk_group_key() + TranscriptHash).tohex(), 4)
# compute session key
var session_keys = crypto.HKDF_SHA256().derive(session.shared_secret #- input key -#,
session.get_ipk_group_key() + TranscriptHash #- salt -#,
@ -593,11 +595,11 @@ class Matter_Commisioning_Context
var ac = session_keys[32..47]
var created = tasmota.rtc()['utc']
tasmota.log("MTR: ******************************", 4)
tasmota.log("MTR: I2RKey =" + i2r.tohex(), 4)
tasmota.log("MTR: R2IKey =" + r2i.tohex(), 4)
tasmota.log("MTR: AC =" + ac.tohex(), 4)
tasmota.log("MTR: ******************************", 4)
# tasmota.log("MTR: ******************************", 4)
# tasmota.log("MTR: I2RKey =" + i2r.tohex(), 4)
# tasmota.log("MTR: R2IKey =" + r2i.tohex(), 4)
# tasmota.log("MTR: AC =" + ac.tohex(), 4)
# tasmota.log("MTR: ******************************", 4)
# StatusReport(GeneralCode: SUCCESS, ProtocolId: SECURE_CHANNEL, ProtocolCode: SESSION_ESTABLISHMENT_SUCCESS)
var raw = self.send_status_report(msg, 0x00, 0x0000, 0x0000, true)
@ -607,6 +609,7 @@ class Matter_Commisioning_Context
# CASE Session completed, persist it
session._breadcrumb = 0 # clear breadcrumb
session.counter_snd_next() # force a first counter. It's important it's used before set_persist(true) to not have a double save
session.set_persist(true) # keep session on flash
session.set_no_expiration() # never expire
session.persist_to_fabric()
@ -617,7 +620,7 @@ class Matter_Commisioning_Context
def parse_StatusReport(msg)
var session = msg.session
tasmota.log("MTR: StatusReport = "+msg.raw[msg.app_payload_idx..].tohex())
tasmota.log("MTR: StatusReport = "+msg.raw[msg.app_payload_idx..].tohex(), 2)
return true
end

View File

@ -70,7 +70,7 @@ class Matter_PBKDFParamResponse
var SLEEPY_IDLE_INTERVAL
var SLEEPY_ACTIVE_INTERVAL
def encode(b)
def tlv2raw(b)
var s = matter.TLV.Matter_TLV_struct()
# initiatorRandom
s.add_TLV(1, matter.TLV.B1, self.initiatorRandom)
@ -84,7 +84,7 @@ class Matter_PBKDFParamResponse
s2.add_TLV(1, matter.TLV.U4, self.SLEEPY_IDLE_INTERVAL)
s2.add_TLV(2, matter.TLV.U4, self.SLEEPY_ACTIVE_INTERVAL)
end
return s.encode(b)
return s.tlv2raw(b)
end
end
matter.PBKDFParamResponse = Matter_PBKDFParamResponse
@ -113,12 +113,12 @@ class Matter_Pake2
var pB # 65 bytes
var cB # 32 bytes
def encode(b)
def tlv2raw(b)
var s = matter.TLV.Matter_TLV_struct()
#
s.add_TLV(1, matter.TLV.B1, self.pB)
s.add_TLV(2, matter.TLV.B1, self.cB)
return s.encode(b)
return s.tlv2raw(b)
end
end
matter.Pake2 = Matter_Pake2
@ -186,7 +186,7 @@ class Matter_Sigma2
var SLEEPY_IDLE_INTERVAL
var SLEEPY_ACTIVE_INTERVAL
def encode(b)
def tlv2raw(b)
var s = matter.TLV.Matter_TLV_struct()
# initiatorRandom
s.add_TLV(1, matter.TLV.B1, self.responderRandom)
@ -198,7 +198,7 @@ class Matter_Sigma2
s2.add_TLV(1, matter.TLV.U4, self.SLEEPY_IDLE_INTERVAL)
s2.add_TLV(2, matter.TLV.U4, self.SLEEPY_ACTIVE_INTERVAL)
end
return s.encode(b)
return s.tlv2raw(b)
end
end
matter.Sigma2 = Matter_Sigma2
@ -213,7 +213,7 @@ class Matter_Sigma2Resume
var SLEEPY_IDLE_INTERVAL
var SLEEPY_ACTIVE_INTERVAL
def encode(b)
def tlv2raw(b)
var s = matter.TLV.Matter_TLV_struct()
# initiatorRandom
s.add_TLV(1, matter.TLV.B1, self.resumptionID)
@ -224,7 +224,7 @@ class Matter_Sigma2Resume
s2.add_TLV(1, matter.TLV.U4, self.SLEEPY_IDLE_INTERVAL)
s2.add_TLV(2, matter.TLV.U4, self.SLEEPY_ACTIVE_INTERVAL)
end
return s.encode(b)
return s.tlv2raw(b)
end
end
matter.Sigma2Resume = Matter_Sigma2Resume

View File

@ -35,15 +35,14 @@ class Matter_Device
# Commissioning open
var commissioning_open # timestamp for timeout of commissioning (millis()) or `nil` if closed
var commissioning_iterations # current PBKDF number of iterations
var commissioning_discriminator # current discriminator
var commissioning_discriminator # commissioning_discriminator
var commissioning_salt # current salt
var commissioning_w0 # current w0
# var commissioning_w1 # current w1
var commissioning_L # current L
var commissioning_w0 # current w0 (SPAKE2+)
var commissioning_L # current L (SPAKE2+)
var commissioning_admin_fabric # the fabric that opened the currint commissioning window, or `nil` for default
# information about the device
var commissioning_instance_wifi # random instance name for commissioning
var commissioning_instance_eth # random instance name for commissioning
var commissioning_instance_wifi # random instance name for commissioning (mDNS)
var commissioning_instance_eth # random instance name for commissioning (mDNS)
var hostname_wifi # MAC-derived hostname for commissioning
var hostname_eth # MAC-derived hostname for commissioning
var vendorid
@ -52,15 +51,14 @@ class Matter_Device
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
# saved in parameters
var root_discriminator
var root_passcode
var root_discriminator # as `int`
var root_passcode # as `int`
var ipv4only # advertize only IPv4 addresses (no IPv6)
# context for PBKDF
var root_iterations
var root_iterations # PBKDF number of iterations
# PBKDF information used only during PASE (freed afterwards)
var root_salt
var root_w0
# var root_w1
var root_L
#############################################################
@ -93,68 +91,71 @@ class Matter_Device
# self.plugins.push(matter.Plugin_Temp_Sensor(self, 10, "ESP32#Temperature"))
# for now read sensors every 5 seconds
tasmota.add_cron("*/5 * * * * *", def () self.trigger_read_sensors() end, "matter_sensors_5s")
tasmota.add_cron("*/5 * * * * *", def () self._trigger_read_sensors() end, "matter_sensors_5s")
self.start_mdns_announce_hostnames()
if tasmota.wifi()['up']
self.start_udp(self.UDP_PORT)
self._start_udp(self.UDP_PORT)
else
tasmota.add_rule("Wifi#Connected", def ()
self.start_udp(self.UDP_PORT)
self._start_udp(self.UDP_PORT)
tasmota.remove_rule("Wifi#Connected", "matter_device_udp")
end, "matter_device_udp")
end
if tasmota.eth()['up']
self.start_udp(self.UDP_PORT)
self._start_udp(self.UDP_PORT)
else
tasmota.add_rule("Eth#Connected", def ()
self.start_udp(self.UDP_PORT)
self._start_udp(self.UDP_PORT)
tasmota.remove_rule("Eth#Connected", "matter_device_udp")
end, "matter_device_udp")
end
self.init_basic_commissioning()
self._init_basic_commissioning()
tasmota.add_driver(self)
end
#############################################################
# Start Basic Commissioning Window
def init_basic_commissioning()
# Start Basic Commissioning Window if needed at startup
def _init_basic_commissioning()
# if no fabric is configured, automatically open commissioning at restart
if self.sessions.count_active_fabrics() == 0
self.start_root_basic_commissioning()
end
end
#############################################################
# Start Basic Commissioning with root parameters
#
# Open window for `timeout_s` (default 10 minutes)
def start_root_basic_commissioning(timeout_s)
if timeout_s == nil timeout_s = self.PASE_TIMEOUT end
# compute PBKDF
self.compute_pbkdf(self.root_passcode, self.root_iterations, self.root_salt)
self._compute_pbkdf(self.root_passcode, self.root_iterations, self.root_salt)
self.start_basic_commissioning(timeout_s, self.root_iterations, self.root_discriminator, self.root_salt, self.root_w0, #-self.root_w1,-# self.root_L, nil)
end
#####################################################################
# Remove a fabric and clean all corresponding values and mDNS entries
def remove_fabric(fabric)
self.message_handler.im.subs.remove_by_fabric(fabric)
self.message_handler.im.subs_shop.remove_by_fabric(fabric)
self.mdns_remove_op_discovery(fabric)
self.sessions.remove_fabric(fabric)
self.sessions.save_fabrics()
end
#############################################################
# Start Basic Commissioning Window
def start_basic_commissioning(timeout_s, iterations, discriminator, salt, w0, #-w1,-# L, admin_fabric)
# Start Basic Commissioning Window with custom parameters
def start_basic_commissioning(timeout_s, iterations, discriminator, salt, w0, L, admin_fabric)
self.commissioning_open = tasmota.millis() + timeout_s * 1000
self.commissioning_iterations = iterations
self.commissioning_discriminator = discriminator
self.commissioning_salt = salt
self.commissioning_w0 = w0
# self.commissioning_w1 = w1
self.commissioning_L = L
self.commissioning_admin_fabric = admin_fabric
@ -172,10 +173,14 @@ class Matter_Device
end
end
#############################################################
# Is root commissioning currently open. Mostly for UI to know if QRCode needs to be shown.
def is_root_commissioning_open()
return self.commissioning_open != nil && self.commissioning_admin_fabric == nil
end
#############################################################
# Stop PASE commissioning, mostly called when CASE is about to start
def stop_basic_commissioning()
self.commissioning_open = nil
@ -193,13 +198,11 @@ class Matter_Device
def is_commissioning_open()
return self.commissioning_open != nil
end
def finish_commissioning()
end
#############################################################
# Compute the PBKDF parameters for SPAKE2+
# (internal) Compute the PBKDF parameters for SPAKE2+ from root parameters
#
def compute_pbkdf(passcode_int, iterations, salt)
def _compute_pbkdf(passcode_int, iterations, salt)
import crypto
import string
var passcode = bytes().add(passcode_int, 4)
@ -227,7 +230,7 @@ class Matter_Device
end
#############################################################
# compute QR Code content - can be done only for root PASE
# Compute QR Code content - can be done only for root PASE
def compute_qrcode_content()
var raw = bytes().resize(11) # we don't use TLV Data so it's only 88 bits or 11 bytes
# version is `000` dont touch
@ -243,7 +246,8 @@ class Matter_Device
#############################################################
# compute the 11 digits manual pairing code (wihout vendorid nor productid) p.223
# Compute the 11 digits manual pairing code (wihout vendorid nor productid) p.223
# <BR>
# can be done only for root PASE (we need the passcode, but we don't get it with OpenCommissioningWindow command)
def compute_manual_pairing_code()
import string
@ -274,7 +278,8 @@ class Matter_Device
#############################################################
# trigger a read_sensors and dispatch to plugins
def trigger_read_sensors()
# Internally used by cron
def _trigger_read_sensors()
import json
var rs_json = tasmota.read_sensors()
if rs_json == nil return end
@ -302,26 +307,34 @@ class Matter_Device
#############################################################
def stop()
tasmota.remove_driver(self)
if self.udp_server self.udp_server.stop() end
end
#############################################################
# callback when message is received
# Callback when message is received.
# Send to `message_handler`
def msg_received(raw, addr, port)
return self.message_handler.msg_received(raw, addr, port)
end
#############################################################
# Global entry point for sending a message.
# Delegates to `udp_server`
def msg_send(raw, addr, port, id)
return self.udp_server.send_response(raw, addr, port, id)
end
def packet_ack(id)
return self.udp_server.packet_ack(id)
#############################################################
# Signals that a ack was received.
# Delegates to `udp_server` to remove from resending list.
def received_ack(id)
return self.udp_server.received_ack(id)
end
#############################################################
# Start UDP Server
def start_udp(port)
# (internal) Start UDP Server
def _start_udp(port)
if self.udp_server return end # already started
if port == nil port = 5540 end
tasmota.log("MTR: starting UDP server on port: " + str(port), 2)
@ -330,22 +343,28 @@ class Matter_Device
end
#############################################################
# start_operational_discovery
# Start Operational Discovery for this session
#
# Pass control to `device`
# Deferred until next tick.
def start_operational_discovery_deferred(session)
# defer to next click
tasmota.set_timer(0, /-> self.start_operational_discovery(session))
end
#############################################################
# Start Commissioning Complete for this session
#
# Deferred until next tick.
def start_commissioning_complete_deferred(session)
# defer to next click
tasmota.set_timer(0, /-> self.start_commissioning_complete(session))
end
#############################################################
# Start Operational Discovery
# Start Operational Discovery for this session
#
# Stop Basic Commissioning and clean PASE specific values (to save memory).
# Announce fabric entry in mDNS.
def start_operational_discovery(session)
import crypto
import mdns
@ -366,6 +385,7 @@ class Matter_Device
#############################################################
# Commissioning Complete
#
# Stop basic commissioning.
def start_commissioning_complete(session)
tasmota.log("MTR: *** Commissioning complete ***", 2)
self.stop_basic_commissioning() # by default close commissioning when it's complete
@ -403,22 +423,30 @@ class Matter_Device
end
#############################################################
# signal that an attribute has been changed
# Signal that an attribute has been changed and propagate
# to any active subscription.
#
# Delegates to `message_handler`
def attribute_updated(endpoint, cluster, attribute, fabric_specific)
if fabric_specific == nil fabric_specific = false end
var ctx = matter.Path()
ctx.endpoint = endpoint
ctx.cluster = cluster
ctx.attribute = attribute
self.message_handler.im.subs.attribute_updated_ctx(ctx, fabric_specific)
self.message_handler.im.subs_shop.attribute_updated_ctx(ctx, fabric_specific)
end
#############################################################
# expand attribute list based
# Proceed to attribute expansion (used for Attribute Read/Write/Subscribe)
#
# called only when expansion is needed,
# so we don't need to report any error since they are ignored
# Called only when expansion is needed, so we don't need to report any error since they are ignored
#
# calls `cb(pi, ctx, direct)` for each attribute expanded.
# `pi`: plugin instance targeted by the attribute (via endpoint). Note: nothing is sent if the attribute is not declared in supported attributes in plugin.
# `ctx`: context object with `endpoint`, `cluster`, `attribute` (no `command`)
# `direct`: `true` if the attribute is directly targeted, `false` if listed as part of a wildcard
# returns: `true` if processed succesfully, `false` if error occured. If `direct`, the error is returned to caller, but if expanded the error is silently ignored and the attribute skipped.
# In case of `direct` but the endpoint/cluster/attribute is not suppported, it calls `cb(nil, ctx, true)` so you have a chance to encode the exact error (UNSUPPORTED_ENDPOINT/UNSUPPORTED_CLUSTER/UNSUPPORTED_ATTRIBUTE/UNREPORTABLE_ATTRIBUTE)
def process_attribute_expansion(ctx, cb)
#################################################################################
# Returns the keys of a map as a sorted list
@ -524,9 +552,7 @@ class Matter_Device
end
#############################################################
# get active endpoints
#
# return the list of endpoints from all plugins (distinct)
# Return the list of endpoints from all plugins (distinct), exclud endpoint zero if `exclude_zero` is `true`
def get_active_endpoints(exclude_zero)
var ret = []
for p:self.plugins
@ -560,6 +586,7 @@ class Matter_Device
end
#############################################################
# Load Matter Device parameters
def load_param()
import string
import crypto
@ -686,8 +713,6 @@ class Matter_Device
#############################################################
# Announce MDNS for PASE commissioning
#
# eth is `true` if ethernet turned up, `false` is wifi turned up
def mdns_announce_PASE()
import mdns
import string
@ -757,8 +782,6 @@ class Matter_Device
#############################################################
# MDNS remove any PASE announce
#
# eth is `true` if ethernet turned up, `false` is wifi turned up
def mdns_remove_PASE()
import mdns
import string
@ -823,7 +846,7 @@ class Matter_Device
end
#############################################################
# Remove all mDNS announces
# Remove all mDNS announces for all fabrics
def mdns_remove_op_discovery_all_fabrics()
for fabric: self.sessions.active_fabrics()
if fabric.get_device_id() && fabric.get_fabric_id()
@ -833,7 +856,7 @@ class Matter_Device
end
#############################################################
# Start UDP mDNS announcements for commissioning
# Remove mDNS announce for fabric
def mdns_remove_op_discovery(fabric)
import mdns
import string
@ -857,8 +880,9 @@ class Matter_Device
end
#############################################################
# Try to clean MDNS entries before restart
# Try to clean MDNS entries before restart.
#
# Called by Tasmota loop as a Tasmota driver.
def save_before_restart()
self.stop_basic_commissioning()
self.mdns_remove_op_discovery_all_fabrics()

View File

@ -73,6 +73,13 @@ class Matter_Expirable
def hydrate_post()
end
#############################################################
# before_remove
#
# called right before the element is removed
def before_remove()
end
#############################################################
# set absolute time for expiration
def set_no_expiration()
@ -131,6 +138,13 @@ class Matter_Expirable_list : list
return super(self).setitem(i, o)
end
#############################################################
# remove - override
#
def remove(i)
if i >= 0 && i < size(self) self[i].before_remove() end
return super(self).remove(i)
end
#############################################################
# remove_expired

View File

@ -26,14 +26,14 @@ import matter
#################################################################################
class Matter_IM
var device
var subs # subscriptions shop
var subs_shop # subscriptions shop
var send_queue # list of IM_Message queued for sending as part of exchange-id
def init(device)
self.device = device
self.send_queue = []
self.subs = matter.IM_Subscription_Shop(self)
self.subs_shop = matter.IM_Subscription_Shop(self)
end
def process_incoming(msg)
@ -42,27 +42,31 @@ class Matter_IM
var val = matter.TLV.parse(msg.raw, msg.app_payload_idx)
tasmota.log("MTR: IM TLV: " + str(val), 3)
# tasmota.log("MTR: IM TLV: " + str(val), 3)
var InteractionModelRevision = val.findsubval(0xFF)
tasmota.log("MTR: InteractionModelRevision=" + (InteractionModelRevision != nil ? str(InteractionModelRevision) : "nil"), 4)
# tasmota.log("MTR: InteractionModelRevision=" + (InteractionModelRevision != nil ? str(InteractionModelRevision) : "nil"), 4)
var opcode = msg.opcode
if opcode == 0x01 # Status Response
return self.process_status_response(msg, val)
elif opcode == 0x02 # Read Request
self.send_ack_now(msg)
return self.process_read_request(msg, val)
elif opcode == 0x03 # Subscribe Request
self.send_ack_now(msg)
return self.subscribe_request(msg, val)
elif opcode == 0x04 # Subscribe Response
return self.subscribe_response(msg, val)
elif opcode == 0x05 # Report Data
return self.report_data(msg, val)
elif opcode == 0x06 # Write Request
self.send_ack_now(msg)
return self.process_write_request(msg, val)
elif opcode == 0x07 # Write Response
return self.process_write_response(msg, val)
elif opcode == 0x08 # Invoke Request
self.send_ack_now(msg)
return self.process_invoke_request(msg, val)
elif opcode == 0x09 # Invoke Response
return self.process_invoke_response(msg, val)
@ -87,22 +91,39 @@ class Matter_IM
return false
end
#############################################################
# send Ack response now and don't enqueue it
#
# returns `true` if packet could be sent
def send_ack_now(msg)
if msg.x_flag_r # send Ack only if requester asks for it
var resp = msg.build_standalone_ack(false #-not reliable-#)
resp.encode_frame()
resp.encrypt()
import string
tasmota.log(string.format("MTR: <Ack_now (%6i) rack=%i id=%i [%s]:%i", resp.session.local_session_id, resp.ack_message_counter, resp.message_counter, resp.remote_ip, resp.remote_port), 3)
msg.session._message_handler.send_response(resp.raw, resp.remote_ip, resp.remote_port, nil)
# self.send_response(resp.raw, resp.remote_ip, resp.remote_port, resp.message_counter)
# return msg.send_im(msg.session._message_handler) # send message now
else
return true
end
end
#############################################################
# send enqueued responses
#
# self.send_queue is a list of <Matter_IM_Message>
#
def send_enqueued(responder)
var idx = 0
while idx < size(self.send_queue)
var message = self.send_queue[idx]
if message.ready
var finish = message.send(responder) # send message
if finish
self.send_queue.remove(idx)
idx -= 1
else
message.ready = false # needs more to proceed
end
var finish = message.send_im(responder) # send message
if finish
self.send_queue.remove(idx)
idx -= 1
end
idx += 1
@ -171,7 +192,7 @@ class Matter_IM
if message
return message.status_ok_received(msg) # re-arm the sending of next packets for the same exchange
else
tasmota.log("MTR: >Status_OK", 2) # don't show 'SUCCESS' to not overflow logs with non-information
tasmota.log(string.format("MTR: >OK (%6i) exch=%i not found", msg.session.local_session_id, msg.exchange_id), 3) # don't show 'SUCCESS' to not overflow logs with non-information
end
else
# error
@ -188,7 +209,8 @@ class Matter_IM
# Inner code shared between read_attributes and subscribe_request
#
# query: `ReadRequestMessage` or `SubscribeRequestMessage`
def _inner_process_read_request(session, query)
def _inner_process_read_request(session, query, no_log)
import string
### Inner function to be iterated upon
# ret is the ReportDataMessage list to send back
@ -216,7 +238,9 @@ class Matter_IM
a1.attribute_data.data = res
ret.attribute_reports.push(a1)
tasmota.log(string.format("MTR: Read_Attr %s%s - %s", str(ctx), attr_name, str(res)), 2)
if !no_log
tasmota.log(string.format("MTR: >Read_Attr (%6i) %s%s - %s", session.local_session_id, str(ctx), attr_name, str(res)), 2)
end
return true # stop expansion since we have a value
elif ctx.status != nil
if direct
@ -230,11 +254,11 @@ class Matter_IM
a1.attribute_status.status.status = ctx.status
ret.attribute_reports.push(a1)
tasmota.log(string.format("MTR: Read_Attr %s%s - STATUS: 0x%02X %s", str(ctx), attr_name, ctx.status, ctx.status == matter.UNSUPPORTED_ATTRIBUTE ? "UNSUPPORTED_ATTRIBUTE" : ""), 2)
tasmota.log(string.format("MTR: >Read_Attr (%6i) %s%s - STATUS: 0x%02X %s", session.local_session_id, str(ctx), attr_name, ctx.status, ctx.status == matter.UNSUPPORTED_ATTRIBUTE ? "UNSUPPORTED_ATTRIBUTE" : ""), 2)
return true
end
else
tasmota.log(string.format("MTR: Read_Attr %s%s - IGNORED", str(ctx), attr_name), 2)
tasmota.log(string.format("MTR: >Read_Attr (%6i) %s%s - IGNORED", session.local_session_id, str(ctx), attr_name), 2)
# ignore if content is nil and status is undefined
return false
end
@ -261,9 +285,9 @@ class Matter_IM
# we need expansion, log first
if ctx.cluster != nil && ctx.attribute != nil
var attr_name = matter.get_attribute_name(ctx.cluster, ctx.attribute)
tasmota.log("MTR: Read_Attr " + str(ctx) + (attr_name ? " (" + attr_name + ")" : ""), 2)
tasmota.log(string.format("MTR: >Read_Attr (%6i) %s", session.local_session_id, str(ctx) + (attr_name ? " (" + attr_name + ")" : "")), 2)
else
tasmota.log("MTR: Read_Attr " + str(ctx), 2)
tasmota.log(string.format("MTR: >Read_Attr (%6i) %s", session.local_session_id, str(ctx)), 2)
end
end
@ -304,12 +328,12 @@ class Matter_IM
var query = matter.SubscribeRequestMessage().from_TLV(val)
if !query.keep_subscriptions
self.subs.remove_by_session(msg.session) # if `keep_subscriptions`, kill all subscriptions from current session
self.subs_shop.remove_by_session(msg.session) # if `keep_subscriptions`, kill all subscriptions from current session
end
tasmota.log("MTR: received SubscribeRequestMessage=" + str(query), 3)
var sub = self.subs.new_subscription(msg.session, query)
var sub = self.subs_shop.new_subscription(msg.session, query)
# expand a string with all attributes requested
var attr_req = []
@ -320,10 +344,10 @@ class Matter_IM
ctx.attribute = q.attribute
attr_req.push(str(ctx))
end
tasmota.log(string.format("MTR: >Subscribe %s (min=%i, max=%i) sub_id=%i",
attr_req.concat(" "), sub.min_interval, sub.max_interval, sub.subscription_id), 2)
tasmota.log(string.format("MTR: >Subscribe (%6i) %s (min=%i, max=%i, keep=%i) sub=%i",
msg.session.local_session_id, attr_req.concat(" "), sub.min_interval, sub.max_interval, query.keep_subscriptions ? 1 : 0, sub.subscription_id), 2)
var ret = self._inner_process_read_request(msg.session, query)
var ret = self._inner_process_read_request(msg.session, query, true #-no_log-#)
# ret is of type `Matter_ReportDataMessage`
ret.subscription_id = sub.subscription_id # enrich with subscription id TODO
self.send_subscribe_response(msg, ret, sub)
@ -356,7 +380,7 @@ class Matter_IM
ctx.status = matter.UNSUPPORTED_COMMAND #default error if returned `nil`
var cmd_name = matter.get_command_name(ctx.cluster, ctx.command)
tasmota.log(string.format("MTR: >Received %s %s from [%s]:%i", str(ctx), cmd_name ? cmd_name : "", msg.remote_ip, msg.remote_port), 2)
tasmota.log(string.format("MTR: >Command (%6i) %s %s from [%s]:%i", msg.session.local_session_id, str(ctx), cmd_name ? cmd_name : "", msg.remote_ip, msg.remote_port), 2)
var res = self.device.invoke_request(msg.session, q.command_fields, ctx)
var a1 = matter.InvokeResponseIB()
if res == true || ctx.status == matter.SUCCESS # special case, just respond ok
@ -368,7 +392,7 @@ class Matter_IM
a1.status.status = matter.StatusIB()
a1.status.status.status = matter.SUCCESS
ret.invoke_responses.push(a1)
tasmota.log("MTR: <Replied OK", 2)
tasmota.log(string.format("MTR: <Replied (%6i) OK exch=%i", msg.session.local_session_id, msg.exchange_id), 2)
elif res != nil
a1.command = matter.CommandDataIB()
a1.command.command_path = matter.CommandPathIB()
@ -379,7 +403,7 @@ class Matter_IM
ret.invoke_responses.push(a1)
cmd_name = matter.get_command_name(ctx.cluster, ctx.command)
tasmota.log(string.format("MTR: <Replied %s %s", str(ctx), cmd_name ? cmd_name : ""), 2)
tasmota.log(string.format("MTR: <Replied (%6i) %s %s", msg.session.local_session_id, str(ctx), cmd_name ? cmd_name : ""), 2)
elif ctx.status != nil
a1.status = matter.CommandStatusIB()
a1.status.command_path = matter.CommandPathIB()
@ -389,9 +413,9 @@ class Matter_IM
a1.status.status = matter.StatusIB()
a1.status.status.status = ctx.status
ret.invoke_responses.push(a1)
tasmota.log(string.format("MTR: <Replied Status=0x%02X", ctx.status), 2)
tasmota.log(string.format("MTR: <Replied (%6i) Status=0x%02X exch=%i", msg.session.local_session_id, ctx.status, msg.exchange_id), 2)
else
tasmota.log("MTR: _Ignore", 2)
tasmota.log(string.format("MTR: _Ignore (%6i) exch=%i", msg.session.local_session_id, msg.exchange_id), 2)
# ignore if content is nil and status is undefined
end
end
@ -560,7 +584,7 @@ class Matter_IM
var query = matter.TimedRequestMessage().from_TLV(val)
tasmota.log("MTR: received TimedRequestMessage=" + str(query), 3)
tasmota.log(string.format("MTR: >Received TimedRequest=%i from [%s]:%i", query.timeout, msg.remote_ip, msg.remote_port), 2)
tasmota.log(string.format("MTR: >Command (%6i) TimedRequest=%i from [%s]:%i", msg.session.local_session_id, query.timeout, msg.remote_ip, msg.remote_port), 2)
# Send success status report
self.send_status(msg, matter.SUCCESS)
@ -589,16 +613,20 @@ class Matter_IM
end
if size(fake_read.attributes_requests) > 0
tasmota.log("MTR: <Sub_data sub_id=" + str(sub.subscription_id), 2)
tasmota.log(string.format("MTR: <Sub_Data (%6i) sub=%i", session.local_session_id, sub.subscription_id), 2)
sub.is_keep_alive = false # sending an actual data update
else
tasmota.log("MTR: <Sub_alive sub_id=" + str(sub.subscription_id), 2)
tasmota.log(string.format("MTR: <Sub_Alive (%6i) sub=%i", session.local_session_id, sub.subscription_id), 2)
sub.is_keep_alive = true # sending keep-alive
end
var ret = self._inner_process_read_request(session, fake_read)
ret.suppress_response = (size(fake_read.attributes_requests) == 0) # ret is of class `ReportDataMessage`
ret.subscription_id = sub.subscription_id
self.send_queue.push(matter.IM_ReportDataSubscribed(session._message_handler, session, ret, sub))
self.send_enqueued(session._message_handler)
var report_data_msg = matter.IM_ReportDataSubscribed(session._message_handler, session, ret, sub)
self.send_queue.push(report_data_msg) # push message to queue
self.send_enqueued(session._message_handler) # and send queued messages now
end
#############################################################
@ -645,7 +673,7 @@ class Matter_IM
#############################################################
# dispatch every 250ms click to sub-objects that need it
def every_250ms()
self.subs.every_250ms()
self.subs_shop.every_250ms()
end
end

View File

@ -880,7 +880,7 @@ a = matter.AttributePathIB().from_TLV(m)
assert(str(a) == "[00]0030/0000")
m = a.to_TLV()
assert(m.tostring() == "[[2 = 0U, 3 = 48U, 4 = 0U]]")
assert(m.encode() == bytes("1724020024033024040018"))
assert(m.tlv2raw() == bytes("1724020024033024040018"))
# create DataVersionFilterIB from scratch
@ -894,7 +894,7 @@ d = matter.DataVersionFilterIB()
d.path = c
d.data_version = 10
assert(str(d.to_TLV()) == '{0 = [[1 = 1U, 2 = 32U]], 1 = 10U}')
assert(d.to_TLV().encode() == bytes('1537002401012402201824010A18'))
assert(d.to_TLV().tlv2raw() == bytes('1537002401012402201824010A18'))
# decode DataVersionFilterIB from scratch
m = matter.TLV.parse(bytes("1537002401012402201824010A18"))
@ -932,7 +932,7 @@ a1.attribute_data.data = matter.TLV.create_TLV(matter.TLV.UTF1, "Tasmota")
assert(str(a1.to_TLV()) == '{0 = {0 = [[2 = 0U, 3 = 48U, 4 = 0U]], 1 = [[0 = 0U, 1 = 0U]]}, 1 = {0 = 1U, 1 = [[2 = 0U, 3 = 48U, 4 = 0U]], 2 = "Tasmota"}}')
r.attribute_reports.push(a1)
#{0 = 1U, 1 = [{0 = {0 = [[2 = 0U, 3 = 48U, 4 = 0U]], 1 = [[0 = 0U, 1 = 0U]]}, 1 = {0 = 1U, 1 = [[2 = 0U, 3 = 48U, 4 = 0U]], 2 = "Tasmota"}}]}
assert(r.to_TLV().encode() == bytes('1524000136011535003700240200240330240400183701240000240100181835012400013701240200240330240400182C02075461736D6F746118181818'))
assert(r.to_TLV().tlv2raw() == bytes('1524000136011535003700240200240330240400183701240000240100181835012400013701240200240330240400182C02075461736D6F746118181818'))
# <Matter_AttributeReportIB:{

View File

@ -69,12 +69,14 @@ class Matter_IM_Message
var resp # response Frame object
var ready # bool: ready to send (true) or wait (false)
var data # TLV data of the response (if any)
var last_counter # counter value of last sent packet (to match ack)
# build a response message stub
def init(msg, opcode, reliable)
self.resp = msg.build_response(opcode, reliable)
self.ready = true
self.ready = true # by default send immediately
self.expiration = tasmota.millis() + self.MSG_TIMEOUT
self.last_counter = 0 # avoid `nil` value
end
# the message is being removed due to expiration
@ -91,6 +93,8 @@ class Matter_IM_Message
# Status Report OK received for previous message, proceed to next (if any)
# return true if we manage the ack ourselves, false if it needs to be done upper
def status_ok_received(msg)
import string
tasmota.log(string.format("MTR: IM_Message status_ok_received exch=%i", self.resp.exchange_id), 3)
self.expiration = tasmota.millis() + self.MSG_TIMEOUT # give more time
if msg
self.resp = msg.build_response(self.resp.opcode, self.resp.x_flag_r, self.resp) # update packet
@ -110,11 +114,16 @@ class Matter_IM_Message
# return true if transaction is complete (remove object from queue)
# default responder for data
def send(responder)
def send_im(responder)
import string
tasmota.log(string.format("MTR: IM_Message send_im exch=%i ready=%i", self.resp.exchange_id, self.ready ? 1 : 0), 3)
if !self.ready return false end
var resp = self.resp
resp.encode_frame(self.data.to_TLV().encode()) # payload in cleartext
resp.encode_frame(self.data.to_TLV().tlv2raw()) # payload in cleartext
resp.encrypt()
tasmota.log(string.format("MTR: <snd (%6i) id=%i exch=%i rack=%s", resp.session.local_session_id, resp.message_counter, resp.exchange_id, resp.ack_message_counter),3)
responder.send_response(resp.raw, resp.remote_ip, resp.remote_port, resp.message_counter)
self.last_counter = resp.message_counter
return true
end
@ -133,7 +142,6 @@ class Matter_IM_Status : Matter_IM_Message
var sr = matter.StatusResponseMessage()
sr.status = status
self.data = sr
self.ready = true # send immediately
end
end
matter.IM_Status = Matter_IM_Status
@ -148,7 +156,6 @@ class Matter_IM_InvokeResponse : Matter_IM_Message
def init(msg, data)
super(self).init(msg, 0x09 #-Invoke Response-#, true)
self.data = data
self.ready = true # send immediately
end
end
matter.IM_InvokeResponse = Matter_IM_InvokeResponse
@ -163,7 +170,6 @@ class Matter_IM_WriteResponse : Matter_IM_Message
def init(msg, data)
super(self).init(msg, 0x07 #-Write Response-#, true)
self.data = data
self.ready = true # send immediately
end
end
@ -175,18 +181,19 @@ matter.IM_WriteResponse = Matter_IM_WriteResponse
# Report Data for a Read Request
#################################################################################
class Matter_IM_ReportData : Matter_IM_Message
static var MAX_MESSAGE = 1200 # max bytes size for a single TLV worklaod
static var MAX_MESSAGE = 1000 # max bytes size for a single TLV worklaod
def init(msg, data)
super(self).init(msg, 0x05 #-Report Data-#, true)
self.data = data
self.ready = true # send immediately
end
# return true if transaction is complete (remove object from queue)
# default responder for data
def send(responder)
def send_im(responder)
import string
tasmota.log(string.format("MTR: IM_ReportData send_im exch=%i ready=%i", self.resp.exchange_id, self.ready ? 1 : 0), 3)
if !self.ready return false end
var resp = self.resp # response frame object
var data = self.data # TLV data of the response (if any)
var was_chunked = data.more_chunked_messages # is this following a chunked packet?
@ -209,17 +216,17 @@ class Matter_IM_ReportData : Matter_IM_Message
end
tasmota.log(string.format("MTR: elements=%i msg_sz=%i total=%i", elements, msg_sz, size(data.attribute_reports)), 3)
tasmota.log(string.format("MTR: exch=%i elements=%i msg_sz=%i total=%i", self.get_exchangeid(), elements, msg_sz, size(data.attribute_reports)), 3)
var next_elemnts = data.attribute_reports[elements .. ]
data.attribute_reports = data.attribute_reports[0 .. elements - 1]
data.more_chunked_messages = (size(next_elemnts) > 0)
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
if data.more_chunked_messages
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
# tasmota.log("MTR: sending TLV" + str(data), 4)
end
@ -227,17 +234,20 @@ class Matter_IM_ReportData : Matter_IM_Message
# 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
var encoded_tlv = raw_tlv.tlv2raw(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()
# print(">>>>> send elements after encrypt")
tasmota.log(string.format("MTR: <snd (%6i) id=%i exch=%i rack=%s", resp.session.local_session_id, resp.message_counter, resp.exchange_id, resp.ack_message_counter),3)
responder.send_response(resp.raw, resp.remote_ip, resp.remote_port, resp.message_counter)
self.last_counter = resp.message_counter
if size(next_elemnts) > 0
data.attribute_reports = next_elemnts
# tasmota.log("MTR: to_be_sent_later TLV" + str(data), 3)
tasmota.log(string.format("MTR: to_be_sent_later size=%i exch=%i", size(data.attribute_reports), resp.exchange_id), 3)
self.ready = false # wait for Status Report before continuing sending
return false # keep alive
else
return true # finished, remove
@ -260,7 +270,7 @@ class Matter_IM_ReportDataSubscribed : Matter_IM_ReportData
def init(message_handler, session, data, sub)
self.resp = matter.Frame.initiate_response(message_handler, session, 0x05 #-Report Data-#, true)
self.data = data
self.ready = true # send immediately
self.ready = true # by default send immediately
self.expiration = tasmota.millis() + self.MSG_TIMEOUT
#
self.sub = sub
@ -273,11 +283,14 @@ class Matter_IM_ReportDataSubscribed : Matter_IM_ReportData
# ack received, confirm the heartbeat
def ack_received(msg)
import string
tasmota.log(string.format("MTR: IM_ReportDataSubscribed ack_received sub=%i", self.sub.subscription_id), 3)
super(self).ack_received(msg)
if !self.report_data_phase
# if ack is received while all data is sent, means that it finished without error
self.ready = true
self.sub.re_arm() # signal that we can proceed to next sub report
if self.sub.is_keep_alive # only if keep-alive, for normal reports, re_arm is called at last StatusReport
self.sub.re_arm() # signal that we can proceed to next sub report
end
return true # proceed to calling send() which removes the message
else
return false # do nothing
@ -286,6 +299,8 @@ class Matter_IM_ReportDataSubscribed : Matter_IM_ReportData
# we received an ACK error, remove subscription
def status_error_received(msg)
import string
tasmota.log(string.format("MTR: IM_ReportDataSubscribed status_error_received sub=%i exch=%i", self.sub.subscription_id, self.resp.exchange_id), 3)
self.sub.remove_self()
end
@ -293,10 +308,11 @@ class Matter_IM_ReportDataSubscribed : Matter_IM_ReportData
# return true if we manage the ack ourselves, false if it needs to be done upper
def status_ok_received(msg)
import string
# tasmota.log(string.format("MTR: >Sub_OK sub_id="+str(self.sub.subscription_id)), 2)
tasmota.log(string.format("MTR: IM_ReportDataSubscribed status_ok_received sub=%i exch=%i", self.sub.subscription_id, self.resp.exchange_id), 3)
if self.report_data_phase
return super(self).status_ok_received(msg)
else
self.sub.re_arm() # always re_arm at last StatusReport. The only case where it does not happen is during keep-alive, hence we need to lookg for Ack (see above)
super(self).status_ok_received(nil)
return false # let the caller to the ack
end
@ -304,27 +320,32 @@ class Matter_IM_ReportDataSubscribed : Matter_IM_ReportData
# returns true if transaction is complete (remove object from queue)
# default responder for data
def send(responder)
def send_im(responder)
import string
tasmota.log(string.format("MTR: IM_ReportDataSubscribed send sub=%i exch=%i ready=%i", self.sub.subscription_id, self.resp.exchange_id, self.ready ? 1 : 0), 3)
if !self.ready return false end
if size(self.data.attribute_reports) > 0
if self.report_data_phase
var ret = super(self).send(responder)
var ret = super(self).send_im(responder)
if !ret return false end # ReportData needs to continue
# ReportData is finished
self.report_data_phase = false
return false
else
# send a simple ACK
var resp = self.resp.build_standalone_ack()
var resp = self.resp.build_standalone_ack(false)
resp.encode_frame()
resp.encrypt()
responder.send_response(resp.raw, resp.remote_ip, resp.remote_port, resp.message_counter)
tasmota.log(string.format("MTR: <Ack (%6i) ack=%i id=%i", resp.session.local_session_id, resp.ack_message_counter, resp.message_counter), 3)
responder.send_response(resp.raw, resp.remote_ip, resp.remote_port, nil #-not reliable-#)
self.last_counter = resp.message_counter
return true # we received a ack(), just finish
end
else
# simple heartbeat ReportData
if self.report_data_phase
super(self).send(responder)
super(self).send_im(responder)
self.report_data_phase = false
return false # don't expect any response
else
@ -352,12 +373,17 @@ class Matter_IM_SubscribeResponse : Matter_IM_ReportData
# return true if transaction is complete (remove object from queue)
# default responder for data
def send(responder)
def send_im(responder)
import string
tasmota.log(string.format("MTR: Matter_IM_SubscribeResponse send sub=%i ready=%i", self.sub.subscription_id, self.ready ? 1 : 0), 3)
if !self.ready return false end
if self.report_data_phase
var ret = super(self).send(responder)
if !ret return false end # ReportData needs to continue
# ReportData is finished
self.report_data_phase = false
var ret = super(self).send_im(responder)
if ret
# finished reporting of data, we still need to send SubscribeResponseMessage after next StatusReport
self.report_data_phase = false
end
self.ready = false # wait for Status Report before continuing sending
return false
else
@ -368,9 +394,11 @@ class Matter_IM_SubscribeResponse : Matter_IM_ReportData
sr.max_interval = self.sub.max_interval
self.resp.opcode = 0x04 #- Subscribe Response -#
resp.encode_frame(sr.to_TLV().encode()) # payload in cleartext
resp.encode_frame(sr.to_TLV().tlv2raw()) # payload in cleartext
resp.encrypt()
responder.send_response(resp.raw, resp.remote_ip, resp.remote_port, resp.message_counter)
self.last_counter = resp.message_counter
tasmota.log(string.format("MTR: Send SubscribeResponseMessage sub=%i id=%i", self.sub.subscription_id, resp.message_counter), 3)
self.sub.re_arm()
return true
end
@ -379,8 +407,9 @@ class Matter_IM_SubscribeResponse : Matter_IM_ReportData
# Status ok received
def status_ok_received(msg)
import string
tasmota.log(string.format("MTR: IM_SubscribeResponse status_ok_received sub=%i exch=%i ack=%i last_counter=%i", self.sub.subscription_id, self.resp.exchange_id, msg.ack_message_counter ? msg.ack_message_counter : 0 , self.last_counter), 3)
# once we receive ack, open flow for subscriptions
tasmota.log(string.format("MTR: >Sub_OK sub_id="+str(self.sub.subscription_id)), 2)
tasmota.log(string.format("MTR: >Sub_OK (%6i) sub=%i", msg.session.local_session_id, self.sub.subscription_id), 2)
return super(self).status_ok_received(msg)
end

View File

@ -29,7 +29,7 @@ import matter
#################################################################################
class Matter_IM_Subscription
static var MAX_INTERVAL_MARGIN = 5 # we always keep 5s margin
var subs # pointer to sub shop
var subs_shop # pointer to sub shop
# parameters of the subscription
var subscription_id # id of the subcription as known by requester
var session # the session it belongs to
@ -41,12 +41,13 @@ class Matter_IM_Subscription
var not_before # rate-limiting
var expiration # expiration epoch, we need to respond before
var wait_status # if `true` wait for Status Response before sending anything new
var is_keep_alive # was the last message sent an empty keep-alive
# updates
var updates
# req: SubscribeRequestMessage
def init(subs, id, session, req)
self.subs = subs
def init(subs_shop, id, session, req)
self.subs_shop = subs_shop
self.subscription_id = id
self.session = session
# check values for min_interval
@ -78,14 +79,15 @@ class Matter_IM_Subscription
# update next time interval
self.updates = []
self.clear_before_arm()
self.is_keep_alive = false
# tasmota.log("MTR: new subsctiption " + matter.inspect(self), 3)
end
# remove self from subs list
# remove self from subs_shop list
def remove_self()
tasmota.log("MTR: Remove_Sub sub_id=" + str(self.subscription_id))
self.subs.remove_sub(self)
tasmota.log("MTR: -Sub_Del ( ) sub=" + str(self.subscription_id), 2)
self.subs_shop.remove_sub(self)
end
# clear log after it was sent, and re-arm next expiration
@ -101,7 +103,9 @@ class Matter_IM_Subscription
var now = tasmota.millis()
self.expiration = now + (self.max_interval - self.MAX_INTERVAL_MARGIN) * 1000
self.not_before = now + self.min_interval * 1000 - 1
tasmota.log(string.format("MTR: >Sub_Done sub_id="+str(self.subscription_id)), 2)
if !self.is_keep_alive
tasmota.log(string.format("MTR: .Sub_Done ( ) sub=%i", self.subscription_id), 2)
end
end
# signal that an attribute was updated, to add to the list of reportable

View File

@ -228,7 +228,7 @@ class Matter_Frame
#############################################################
# Generate a Standalone Acknowledgment
# Uses `PROTOCOL_ID_SECURE_CHANNEL` no ecnryption required
def build_standalone_ack()
def build_standalone_ack(reliable)
import string
# send back response
var resp = classof(self)(self.message_handler)
@ -253,9 +253,7 @@ class Matter_Frame
resp.protocol_id = 0 # PROTOCOL_ID_SECURE_CHANNEL
resp.x_flag_a = 1 # ACK of previous message
resp.ack_message_counter = self.message_counter
resp.x_flag_r = 1
tasmota.log(string.format("MTR: <Replied %s", matter.get_opcode_name(resp.opcode)), 3)
resp.x_flag_r = reliable ? 1 : 0
return resp
end
@ -304,7 +302,7 @@ class Matter_Frame
if resp.local_session_id == 0
var op_name = matter.get_opcode_name(resp.opcode)
if !op_name op_name = string.format("0x%02X", resp.opcode) end
tasmota.log(string.format("MTR: <Replied %s", op_name), 2)
tasmota.log(string.format("MTR: <Replied (%6i) %s", resp.session.local_session_id, op_name), 2)
end
return resp
end

View File

@ -66,16 +66,18 @@ class Matter_MessageHandler
# check if it's a duplicate
if !session._counter_insecure_rcv.validate(frame.message_counter, false)
tasmota.log(string.format("MTR: rejected duplicate unencrypted message = %i ref = %i", frame.message_counter, session._counter_insecure_rcv.val()), 3)
tasmota.log(string.format("MTR: . Rejected duplicate unencrypted message = %i ref = %i", frame.message_counter, session._counter_insecure_rcv.val()), 3)
return false
end
if !frame.decode_payload() return false end
self.device.packet_ack(frame.ack_message_counter) # acknowledge packet
self.device.received_ack(frame.ack_message_counter) # remove acknowledge packet from sending list
if frame.opcode != 0x10 # don't show `MRP_Standalone_Acknowledgement`
var op_name = matter.get_opcode_name(frame.opcode)
if !op_name op_name = string.format("0x%02X", frame.opcode) end
tasmota.log(string.format("MTR: >Received %s from [%s]:%i", op_name, addr, port), 2)
tasmota.log(string.format("MTR: >Received (%6i) %s rid=%i exch=%i from [%s]:%i", session.local_session_id, op_name, frame.message_counter, frame.exchange_id, addr, port), 2)
else
tasmota.log(string.format("MTR: >rcv Ack (%6i) rid=%i exch=%i ack=%s %sfrom [%s]:%i", session.local_session_id, frame.message_counter, frame.x_flag_r ? "{reliable} " : "", frame.exchange_id, str(frame.ack_message_counter), addr, port), 3)
end
self.commissioning.process_incoming(frame)
return true
@ -87,7 +89,7 @@ class Matter_MessageHandler
var session = self.device.sessions.get_session_by_local_session_id(frame.local_session_id)
if session == nil
tasmota.log("MTR: unknown local_session_id="+str(frame.local_session_id), 2)
tasmota.log("MTR: frame="+matter.inspect(frame), 3)
# tasmota.log("MTR: frame="+matter.inspect(frame), 3)
return false
end
if addr session._ip = addr end
@ -97,7 +99,7 @@ class Matter_MessageHandler
# check if it's a duplicate
if !session.counter_rcv_validate(frame.message_counter, true)
tasmota.log("MTR: rejected duplicate encrypted message = " + str(frame.message_counter) + " counter=" + str(session.counter_rcv), 3)
tasmota.log("MTR: . Rejected duplicate encrypted message = " + str(frame.message_counter) + " counter=" + str(session.counter_rcv), 3)
return false
end
@ -111,9 +113,11 @@ class Matter_MessageHandler
# continue decoding
tasmota.log(string.format("MTR: idx=%i clear=%s", frame.payload_idx, frame.raw.tohex()), 4)
frame.decode_payload()
tasmota.log("MTR: decrypted message: protocol_id:"+str(frame.protocol_id)+" opcode="+str(frame.opcode)+" exchange_id="+str(frame.exchange_id & 0xFFFF), 3)
tasmota.log("MTR: > Decrypted message: protocol_id:"+str(frame.protocol_id)+" opcode="+str(frame.opcode)+" exchange_id="+str(frame.exchange_id & 0xFFFF), 3)
self.device.packet_ack(frame.ack_message_counter) # acknowledge packet
tasmota.log(string.format("MTR: >rcv (%6i) [%02X/%02X] rid=%i exch=%i ack=%s %sfrom [%s]:%i", session.local_session_id, frame.protocol_id, frame.opcode, frame.message_counter, frame.exchange_id, str(frame.ack_message_counter), frame.x_flag_r ? "{reliable} " : "", addr, port), 3)
self.device.received_ack(frame.ack_message_counter) # remove acknowledge packet from sending list
# dispatch according to protocol_id
var protocol_id = frame.protocol_id
@ -135,9 +139,10 @@ class Matter_MessageHandler
self.im.send_enqueued(self)
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(true)
resp.encode_frame()
resp.encrypt()
tasmota.log(string.format("MTR: <Ack (%6i) ack=%i id=%i {reliable}", resp.session.local_session_id, resp.ack_message_counter, resp.message_counter), 3)
self.send_response(resp.raw, resp.remote_ip, resp.remote_port, resp.message_counter)
end
ret = true

View File

@ -370,7 +370,7 @@ class Matter_Plugin_Root : Matter_Plugin
ctx.command = 0x05 # CommissioningCompleteResponse
self.device.start_commissioning_complete_deferred(session)
return ccr # trigger a standalone ack
return ccr
end
elif cluster == 0x003E # ========== Node Operational Credentials Cluster 11.17 p.704 ==========
@ -399,7 +399,7 @@ class Matter_Plugin_Root : Matter_Plugin
att_elts.add_TLV(1, TLV.B2, matter.CD_FFF1_8000()) # certification_declaration
att_elts.add_TLV(2, TLV.B1, AttestationNonce) # attestation_nonce
att_elts.add_TLV(3, TLV.U4, tasmota.rtc()['utc']) # timestamp in epoch-s
var attestation_message = att_elts.encode()
var attestation_message = att_elts.tlv2raw()
var ac = session.get_ac()
var attestation_tbs = attestation_message + ac
@ -426,7 +426,7 @@ class Matter_Plugin_Root : Matter_Plugin
var nocsr_elements = TLV.Matter_TLV_struct()
nocsr_elements.add_TLV(1, TLV.B2, csr)
nocsr_elements.add_TLV(2, TLV.B1, CSRNonce)
var nocsr_elements_message = nocsr_elements.encode()
var nocsr_elements_message = nocsr_elements.tlv2raw()
# sign with attestation challenge
var nocsr_tbs = nocsr_elements_message + session.get_ac()
tasmota.log("MTR: nocsr_tbs=" + nocsr_tbs.tohex(), 3)
@ -497,6 +497,7 @@ class Matter_Plugin_Root : Matter_Plugin
tasmota.log("MTR: ------------------------------------------", 3)
tasmota.log("MTR: fabric=" + matter.inspect(session._fabric), 3)
tasmota.log("MTR: ------------------------------------------", 3)
session._fabric.log_new_fabric() # log that we registered a new fabric
# create NOCResponse
# 0=StatusCode
# 1=FabricIndex (1-254) (opt)
@ -510,6 +511,7 @@ class Matter_Plugin_Root : Matter_Plugin
elif command == 0x0009 # ---------- UpdateFabricLabel ----------
var label = val.findsubval(0) # Label string max 32
session.set_fabric_label(label)
tasmota.log(string.format("MTR: . Update fabric '%s' label='%s'", session._fabric.get_fabric_id().copy().reverse().tohex(), str(label)), 2)
ctx.status = matter.SUCCESS # OK
return nil # trigger a standalone ack

View File

@ -88,6 +88,20 @@ class Matter_Fabric : Matter_Expirable
def set_fabric_index(v) self.fabric_index = v end
#############################################################
# Called before removal
def log_new_fabric()
import string
tasmota.log(string.format("MTR: +Fabric fab='%s'", self.get_fabric_id().copy().reverse().tohex()), 2)
end
#############################################################
# Called before removal
def before_remove()
import string
tasmota.log(string.format("MTR: -Fabric fab='%s' (removed)", self.get_fabric_id().copy().reverse().tohex()), 2)
end
#############################################################
# Operational Group Key Derivation, 4.15.2, p.182
def get_ipk_group_key()
@ -299,21 +313,28 @@ class Matter_Session : Matter_Expirable
self.update()
end
#############################################################
# Called before removal
def before_remove()
import string
tasmota.log(string.format("MTR: -Session (%6i) (removed)", self.local_session_id), 3)
end
#############################################################
# Management of security counters
#############################################################
# Provide the next counter value, and update the last know persisted if needed
#
def counter_snd_next()
import string
var next = self._counter_snd_impl.next()
# print(">>> NEXT counter_snd=", self.counter_snd, "_impl=", self._counter_snd_impl.val())
tasmota.log(string.format("MTR: . Counter_snd=%i", next), 3)
# print(">>> NEXT counter_snd=", self.counter_snd, "_impl=", self._counter_snd_impl.val(), 4)
if matter.Counter.is_greater(next, self.counter_snd)
self.counter_snd = next + self._COUNTER_SND_INCR
if self.does_persist()
# the persisted counter is behind the actual counter
self.counter_snd = next + self._COUNTER_SND_INCR
self.save()
else
self.counter_snd = next # if no persistance, just keep track
end
end
return next
@ -869,7 +890,7 @@ class Matter_Session_Store
var f = open(self._FABRICS, "w")
f.write(fabs)
f.close()
tasmota.log(string.format("MTR: Saved %i fabric(s) and %i session(s)", fabs_size, sessions_saved), 2)
tasmota.log(string.format("MTR: =Saved %i fabric(s) and %i session(s)", fabs_size, sessions_saved), 2)
except .. as e, m
tasmota.log("MTR: Session_Store::save Exception:" + str(e) + "|" + str(m), 2)
end

View File

@ -46,6 +46,20 @@ class Matter_TLV
]
# type values (enum like)
#
# Type|Description
# :----|:---
# I1 I2 I4|Signed integer of at most (1/2/4) bytes (as 32 bits signed Berry type)
# U1 U2 U4|Unsiged integer of at motst (1/2/4) bytes (as 32 bits signed Berry type, be careful when comparing. Use `matter.Counter.is_greater(a,b)`)
# I8 U8|Signed/insigned 8 bytes. You can pass `bytes(8)`, `int64()` or `int`. Type is collapsed to a lower type if possible when encoding.
# BOOL|boolean, takes `true` and `false`. Abstracts the internal `BTRUE` and `BFALSE` that you don't need to use
# FLOAT|32 bites float
# UTF1 UTF2|String as UTF, size is encoded as 1 or 2 bytes automatically
# B1 B2|raw `bytes()`, size is encoded as 1 or 2 bytes automatically
# NULL|takes only `nil` value
# STRUCT<BR>ARRAY<BR>LIST<BR>EOC|(internal) Use through abstractions
# DOUBLE<BR>UTF4 UTF8<BR>B4 B8|Unsuppored in Tasmota
static var I1 = 0x00
static var I2 = 0x01
static var I4 = 0x02
@ -206,7 +220,7 @@ class Matter_TLV
# encode TLV
#
# appends to the bytes() object
def encode(b)
def tlv2raw(b)
var TLV = self.TLV
if b == nil b = bytes() end # start new buffer if none passed
@ -605,7 +619,7 @@ class Matter_TLV
#############################################################
# encode to bytes
def encode(b)
def tlv2raw(b)
if b == nil b = bytes() end
# encode tag and type
self._encode_tag(b)
@ -618,7 +632,7 @@ class Matter_TLV
# output each one after the other
for v : val_list
v.encode(b)
v.tlv2raw(b)
end
# add 'end of container'
@ -885,7 +899,7 @@ import matter
def test_TLV(b, s)
var m = matter.TLV.parse(b)
assert(m.tostring() == s)
assert(m.encode() == b)
assert(m.tlv2raw() == b)
assert(m.encode_len() == size(b))
end

View File

@ -46,9 +46,13 @@ class Matter_UDPPacket_sent
self.port = port
self.msg_id = id
self.retries = 0
self.next_try = tasmota.millis() + self.backoff_time(self.retries)
self.next_try = tasmota.millis() + matter.UDPServer._backoff_time(self.retries)
end
#############################################################
# Send packet now.
#
# Returns `true` if packet was successfully sent.
def send(udp_socket)
import string
var ok = udp_socket.send(self.addr ? self.addr : udp_socket.remote_ip, self.port ? self.port : udp_socket.remote_port, self.raw)
@ -57,27 +61,9 @@ class Matter_UDPPacket_sent
else
tasmota.log(string.format("MTR: error sending packet to '[%s]:%i'", self.addr, self.port), 3)
end
return ok
end
#############################################################
# Compute exponential backoff as per 4.11.2.1 p.137
def backoff_time(n)
def power_int(v, n)
var r = 1
while n > 0
r *= v
n -= 1
end
return r
end
import math
var i = 300 # SLEEPY_ACTIVE_INTERVAL
var rand = real(math.rand() & 0xFF) / 255 # 0..1 with reasonable granularity
var n_power = n > 0 ? n - 1 : 0
var mrpBackoffTime = i * power_int(1.6, n_power) * (1.0 + rand * 0.25 )
return int(mrpBackoffTime)
end
end
matter.UDPPacket_sent = Matter_UDPPacket_sent
@ -88,30 +74,33 @@ matter.UDPPacket_sent = Matter_UDPPacket_sent
class Matter_UDPServer
static var RETRIES = 4 # 5 transmissions max (4 retries) `MRP_MAX_TRANSMISSIONS` 4.11.8 p.146
static var MAX_PACKETS_READ = 4 # read at most 4 packets per tick
var address, port # local address and port
var addr, port # local addr and port
var listening # true if active
var udp_socket
var dispatch_cb # callback to call when a message is received
var packets_sent # list map of packets sent to be acknowledged
#############################################################
def init(address, port)
self.address = address ? address : ""
# Init UDP Server listening to `addr` and `port` (opt).
#
# By default, the server listens to `""` (all addresses) and port `5540`
def init(addr, port)
self.addr = addr ? addr : ""
self.port = port ? port : 5540
self.listening = false
self.packets_sent = []
end
#############################################################
# start the server
# raises an exception if something is wrong
# registers as device handle
# Starts the server.
# Registers as device handler to Tasmota
#
# `cb`: callback to call when a message is received
# `cb(packet, from_addr, from_port)`: callback to call when a message is received.
# Raises an exception if something is wrong.
def start(cb)
if !self.listening
self.udp_socket = udp()
var ok = self.udp_socket.begin(self.address, self.port)
var ok = self.udp_socket.begin(self.addr, self.port)
if !ok raise "network_error", "could not open UDP server" end
self.listening = true
self.dispatch_cb = cb
@ -120,8 +109,7 @@ class Matter_UDPServer
end
#############################################################
# stop the server
# remove driver
# Stops the server and remove driver
def stop()
if self.listening
self.udp_socket.stop()
@ -131,6 +119,11 @@ class Matter_UDPServer
end
#############################################################
# At every tick:
# Check if a packet has arrived, and dispatch to `cb`.
# Read at most `MAX_PACKETS_READ (4) packets at each tick to
# avoid any starvation.
# Then resend queued outgoing packets.
def every_50ms()
import string
var packet_read = 0
@ -152,25 +145,33 @@ class Matter_UDPServer
packet = nil
end
end
self.resend_packets() # resend any packet
self._resend_packets() # resend any packet
end
#############################################################
def resend_packets()
# Resend packets if they have not been acknowledged by receiver
# either with direct Ack packet or ack embedded in another packet.
# Packets with `id`=`nil` are not resent.
# <BR>
# Packets are re-sent at most `RETRIES` (4) times, i.e. sent maximum 5 times.
# Exponential backoff is added after each resending.
# <BR>
# If all retries expired, remove packet and log.
def _resend_packets()
var idx = 0
while idx < size(self.packets_sent)
var packet = self.packets_sent[idx]
if tasmota.time_reached(packet.next_try)
if packet.retries <= self.RETRIES
tasmota.log("MTR: resending packet id=" + str(packet.msg_id), 3)
tasmota.log("MTR: . Resending packet id=" + str(packet.msg_id), 3)
packet.send(self.udp_socket) # resend
packet.next_try = tasmota.millis() + packet.backoff_time(packet.retries)
packet.next_try = tasmota.millis() + self._backoff_time(packet.retries)
packet.retries += 1
idx += 1
else
import string
self.packets_sent.remove(idx)
tasmota.log(string.format("MTR: target unreachable '[%s]:%i' msg_id=%i", packet.addr, packet.port, packet.msg_id), 2)
tasmota.log(string.format("MTR: . Unacked packet '[%s]:%i' msg_id=%i", packet.addr, packet.port, packet.msg_id), 2)
end
else
idx += 1
@ -179,14 +180,15 @@ class Matter_UDPServer
end
#############################################################
# just received acknowledgment, remove packet from sender
def packet_ack(id)
# Just received acknowledgment, remove packet from sender
def received_ack(id)
if id == nil return end
tasmota.log("MTR: receveived ACK id="+str(id), 3)
var idx = 0
while idx < size(self.packets_sent)
if self.packets_sent[idx].msg_id == id
self.packets_sent.remove(idx)
tasmota.log("MTR: removed packet from sending list id=" + str(id), 4)
tasmota.log("MTR: . Removed packet from sending list id=" + str(id), 3)
else
idx += 1
end
@ -194,10 +196,12 @@ class Matter_UDPServer
end
#############################################################
# Send a packet, enqueue it if `id` is not `nil`
def send_response(raw, addr, port, id)
var packet = matter.UDPPacket_sent(raw, addr, port, id)
packet.send(self.udp_socket) # send
if id
# tasmota.log("MTR: <<< enqueue id="+str(id))
self.packets_sent.push(packet)
end
end
@ -206,13 +210,25 @@ class Matter_UDPServer
# placeholder, nothing to run for now
def every_second()
end
#############################################################
# Compute exponential backoff as per 4.11.2.1 p.137
static def _backoff_time(n)
def power_int(v, n)
var r = 1
while n > 0
r *= v
n -= 1
end
return r
end
import math
var i = 300 # SLEEPY_ACTIVE_INTERVAL
var rand = real(math.rand() & 0xFF) / 255 # 0..1 with reasonable granularity
var n_power = n > 0 ? n - 1 : 0
var mrpBackoffTime = i * power_int(1.6, n_power) * (1.0 + rand * 0.25 )
return int(mrpBackoffTime)
end
end
matter.UDPServer = Matter_UDPServer
#-
import matter
var udps = matter.UDPServer()
udps.listen()
-#

View File

@ -185,7 +185,9 @@ class Matter_UI
if !first webserver.content_send("<hr>") end
first = false
webserver.content_send(string.format("<fieldset><legend><b>&nbsp;#%i %s&nbsp;</b></legend><p></p>", f.get_fabric_index(), "&lt;No label&gt;"))
var label = f.fabric_label
if !label label = "&lt;No label&gt;" end
webserver.content_send(string.format("<fieldset><legend><b>&nbsp;#%i %s&nbsp;</b></legend><p></p>", f.get_fabric_index(), label))
var fabric_rev = f.get_fabric_id().copy().reverse()
var deviceid_rev = f.get_device_id().copy().reverse()

View File

@ -116,9 +116,9 @@ void be_load_Matter_PBKDFParamRequest_class(bvm *vm) {
extern const bclass be_class_Matter_PBKDFParamResponse;
/********************************************************************
** Solidified function: encode
** Solidified function: tlv2raw
********************************************************************/
be_local_closure(Matter_PBKDFParamResponse_encode, /* name */
be_local_closure(Matter_PBKDFParamResponse_tlv2raw, /* name */
be_nested_proto(
10, /* nstack */
2, /* argc */
@ -147,9 +147,9 @@ be_local_closure(Matter_PBKDFParamResponse_encode, /* name */
/* K15 */ be_nested_str_weak(pbkdf_parameters_salt),
/* K16 */ be_nested_str_weak(SLEEPY_IDLE_INTERVAL),
/* K17 */ be_nested_str_weak(SLEEPY_ACTIVE_INTERVAL),
/* K18 */ be_nested_str_weak(encode),
/* K18 */ be_nested_str_weak(tlv2raw),
}),
be_str_weak(encode),
be_str_weak(tlv2raw),
&be_const_str_solidified,
( &(const binstruction[71]) { /* code */
0xB80A0000, // 0000 GETNGBL R2 K0
@ -238,13 +238,13 @@ be_local_class(Matter_PBKDFParamResponse,
be_nested_map(8,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(pbkdf_parameters_salt, -1), be_const_var(4) },
{ be_const_key_weak(SLEEPY_IDLE_INTERVAL, -1), be_const_var(5) },
{ be_const_key_weak(SLEEPY_ACTIVE_INTERVAL, 1), be_const_var(6) },
{ be_const_key_weak(responderRandom, -1), be_const_var(1) },
{ be_const_key_weak(SLEEPY_ACTIVE_INTERVAL, -1), be_const_var(6) },
{ be_const_key_weak(SLEEPY_IDLE_INTERVAL, 1), be_const_var(5) },
{ be_const_key_weak(responderSessionId, -1), be_const_var(2) },
{ be_const_key_weak(pbkdf_parameters_iterations, -1), be_const_var(3) },
{ be_const_key_weak(initiatorRandom, -1), be_const_var(0) },
{ be_const_key_weak(responderSessionId, 3), be_const_var(2) },
{ be_const_key_weak(encode, -1), be_const_closure(Matter_PBKDFParamResponse_encode_closure) },
{ be_const_key_weak(initiatorRandom, 7), be_const_var(0) },
{ be_const_key_weak(responderRandom, 3), be_const_var(1) },
{ be_const_key_weak(tlv2raw, -1), be_const_closure(Matter_PBKDFParamResponse_tlv2raw_closure) },
})),
be_str_weak(Matter_PBKDFParamResponse)
);
@ -339,9 +339,9 @@ void be_load_Matter_Pake1_class(bvm *vm) {
extern const bclass be_class_Matter_Pake2;
/********************************************************************
** Solidified function: encode
** Solidified function: tlv2raw
********************************************************************/
be_local_closure(Matter_Pake2_encode, /* name */
be_local_closure(Matter_Pake2_tlv2raw, /* name */
be_nested_proto(
8, /* nstack */
2, /* argc */
@ -361,9 +361,9 @@ be_local_closure(Matter_Pake2_encode, /* name */
/* K6 */ be_nested_str_weak(pB),
/* K7 */ be_const_int(2),
/* K8 */ be_nested_str_weak(cB),
/* K9 */ be_nested_str_weak(encode),
/* K9 */ be_nested_str_weak(tlv2raw),
}),
be_str_weak(encode),
be_str_weak(tlv2raw),
&be_const_str_solidified,
( &(const binstruction[22]) { /* code */
0xB80A0000, // 0000 GETNGBL R2 K0
@ -402,7 +402,7 @@ be_local_class(Matter_Pake2,
NULL,
be_nested_map(3,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(encode, -1), be_const_closure(Matter_Pake2_encode_closure) },
{ be_const_key_weak(tlv2raw, -1), be_const_closure(Matter_Pake2_tlv2raw_closure) },
{ be_const_key_weak(cB, -1), be_const_var(1) },
{ be_const_key_weak(pB, 0), be_const_var(0) },
})),
@ -633,9 +633,9 @@ void be_load_Matter_Sigma1_class(bvm *vm) {
extern const bclass be_class_Matter_Sigma2;
/********************************************************************
** Solidified function: encode
** Solidified function: tlv2raw
********************************************************************/
be_local_closure(Matter_Sigma2_encode, /* name */
be_local_closure(Matter_Sigma2_tlv2raw, /* name */
be_nested_proto(
9, /* nstack */
2, /* argc */
@ -663,9 +663,9 @@ be_local_closure(Matter_Sigma2_encode, /* name */
/* K14 */ be_nested_str_weak(SLEEPY_ACTIVE_INTERVAL),
/* K15 */ be_nested_str_weak(add_struct),
/* K16 */ be_nested_str_weak(U4),
/* K17 */ be_nested_str_weak(encode),
/* K17 */ be_nested_str_weak(tlv2raw),
}),
be_str_weak(encode),
be_str_weak(tlv2raw),
&be_const_str_solidified,
( &(const binstruction[61]) { /* code */
0xB80A0000, // 0000 GETNGBL R2 K0
@ -743,13 +743,13 @@ be_local_class(Matter_Sigma2,
NULL,
be_nested_map(7,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(encrypted2, -1), be_const_var(3) },
{ be_const_key_weak(encode, -1), be_const_closure(Matter_Sigma2_encode_closure) },
{ be_const_key_weak(tlv2raw, -1), be_const_closure(Matter_Sigma2_tlv2raw_closure) },
{ be_const_key_weak(responderEphPubKey, 3), be_const_var(2) },
{ be_const_key_weak(responderSessionId, -1), be_const_var(1) },
{ be_const_key_weak(SLEEPY_IDLE_INTERVAL, 6), be_const_var(4) },
{ be_const_key_weak(SLEEPY_ACTIVE_INTERVAL, 0), be_const_var(5) },
{ be_const_key_weak(responderRandom, 3), be_const_var(0) },
{ be_const_key_weak(responderEphPubKey, -1), be_const_var(2) },
{ be_const_key_weak(SLEEPY_IDLE_INTERVAL, -1), be_const_var(4) },
{ be_const_key_weak(SLEEPY_ACTIVE_INTERVAL, 6), be_const_var(5) },
{ be_const_key_weak(responderRandom, 1), be_const_var(0) },
{ be_const_key_weak(encrypted2, -1), be_const_var(3) },
})),
be_str_weak(Matter_Sigma2)
);
@ -764,9 +764,9 @@ void be_load_Matter_Sigma2_class(bvm *vm) {
extern const bclass be_class_Matter_Sigma2Resume;
/********************************************************************
** Solidified function: encode
** Solidified function: tlv2raw
********************************************************************/
be_local_closure(Matter_Sigma2Resume_encode, /* name */
be_local_closure(Matter_Sigma2Resume_tlv2raw, /* name */
be_nested_proto(
9, /* nstack */
2, /* argc */
@ -792,9 +792,9 @@ be_local_closure(Matter_Sigma2Resume_encode, /* name */
/* K12 */ be_nested_str_weak(SLEEPY_ACTIVE_INTERVAL),
/* K13 */ be_nested_str_weak(add_struct),
/* K14 */ be_nested_str_weak(U4),
/* K15 */ be_nested_str_weak(encode),
/* K15 */ be_nested_str_weak(tlv2raw),
}),
be_str_weak(encode),
be_str_weak(tlv2raw),
&be_const_str_solidified,
( &(const binstruction[54]) { /* code */
0xB80A0000, // 0000 GETNGBL R2 K0
@ -870,7 +870,7 @@ be_local_class(Matter_Sigma2Resume,
{ be_const_key_weak(sigma2ResumeMIC, -1), be_const_var(1) },
{ be_const_key_weak(responderSessionID, 1), be_const_var(2) },
{ be_const_key_weak(SLEEPY_ACTIVE_INTERVAL, -1), be_const_var(4) },
{ be_const_key_weak(encode, -1), be_const_closure(Matter_Sigma2Resume_encode_closure) },
{ be_const_key_weak(tlv2raw, -1), be_const_closure(Matter_Sigma2Resume_tlv2raw_closure) },
})),
be_str_weak(Matter_Sigma2Resume)
);

View File

@ -6,6 +6,58 @@
extern const bclass be_class_Matter_Expirable;
/********************************************************************
** Solidified function: before_remove
********************************************************************/
be_local_closure(Matter_Expirable_before_remove, /* name */
be_nested_proto(
1, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
0, /* has constants */
NULL, /* no const */
be_str_weak(before_remove),
&be_const_str_solidified,
( &(const binstruction[ 1]) { /* code */
0x80000000, // 0000 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: set_no_expiration
********************************************************************/
be_local_closure(Matter_Expirable_set_no_expiration, /* name */
be_nested_proto(
2, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(_expiration),
}),
be_str_weak(set_no_expiration),
&be_const_str_solidified,
( &(const binstruction[ 3]) { /* code */
0x4C040000, // 0000 LDNIL R1
0x90020001, // 0001 SETMBR R0 K0 R1
0x80000000, // 0002 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
@ -35,9 +87,9 @@ be_local_closure(Matter_Expirable_init, /* name */
/********************************************************************
** Solidified function: set_persist
** Solidified function: set_expire_time
********************************************************************/
be_local_closure(Matter_Expirable_set_persist, /* name */
be_local_closure(Matter_Expirable_set_expire_time, /* name */
be_nested_proto(
4, /* nstack */
2, /* argc */
@ -48,12 +100,12 @@ be_local_closure(Matter_Expirable_set_persist, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(_persist),
/* K0 */ be_nested_str_weak(_expiration),
}),
be_str_weak(set_persist),
be_str_weak(set_expire_time),
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x60080017, // 0000 GETGBL R2 G23
0x60080009, // 0000 GETGBL R2 G9
0x5C0C0200, // 0001 MOVE R3 R1
0x7C080200, // 0002 CALL R2 1
0x90020002, // 0003 SETMBR R0 K0 R2
@ -109,12 +161,12 @@ be_local_closure(Matter_Expirable_has_expired, /* name */
/********************************************************************
** Solidified function: get_parent_list
** Solidified function: set_parent_list
********************************************************************/
be_local_closure(Matter_Expirable_get_parent_list, /* name */
be_local_closure(Matter_Expirable_set_parent_list, /* name */
be_nested_proto(
2, /* nstack */
1, /* argc */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
@ -124,89 +176,11 @@ be_local_closure(Matter_Expirable_get_parent_list, /* name */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(_list),
}),
be_str_weak(get_parent_list),
be_str_weak(set_parent_list),
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x88040100, // 0000 GETMBR R1 R0 K0
0x80040200, // 0001 RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: persist_post
********************************************************************/
be_local_closure(Matter_Expirable_persist_post, /* name */
be_nested_proto(
1, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
0, /* has constants */
NULL, /* no const */
be_str_weak(persist_post),
&be_const_str_solidified,
( &(const binstruction[ 1]) { /* code */
0x80000000, // 0000 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: set_expire_time
********************************************************************/
be_local_closure(Matter_Expirable_set_expire_time, /* name */
be_nested_proto(
4, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(_expiration),
}),
be_str_weak(set_expire_time),
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x60080009, // 0000 GETGBL R2 G9
0x5C0C0200, // 0001 MOVE R3 R1
0x7C080200, // 0002 CALL R2 1
0x90020002, // 0003 SETMBR R0 K0 R2
0x80000000, // 0004 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: persist_pre
********************************************************************/
be_local_closure(Matter_Expirable_persist_pre, /* name */
be_nested_proto(
1, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
0, /* has constants */
NULL, /* no const */
be_str_weak(persist_pre),
&be_const_str_solidified,
( &(const binstruction[ 1]) { /* code */
0x80000000, // 0000 RET 0
0x90020001, // 0000 SETMBR R0 K0 R1
0x80000000, // 0001 RET 0
})
)
);
@ -237,33 +211,6 @@ be_local_closure(Matter_Expirable_hydrate_post, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: does_persist
********************************************************************/
be_local_closure(Matter_Expirable_does_persist, /* 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(_persist),
}),
be_str_weak(does_persist),
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x88040100, // 0000 GETMBR R1 R0 K0
0x80040200, // 0001 RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: set_expire_in_seconds
********************************************************************/
@ -308,36 +255,9 @@ be_local_closure(Matter_Expirable_set_expire_in_seconds, /* name */
/********************************************************************
** Solidified function: set_parent_list
** Solidified function: get_parent_list
********************************************************************/
be_local_closure(Matter_Expirable_set_parent_list, /* name */
be_nested_proto(
2, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(_list),
}),
be_str_weak(set_parent_list),
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x90020001, // 0000 SETMBR R0 K0 R1
0x80000000, // 0001 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: set_no_expiration
********************************************************************/
be_local_closure(Matter_Expirable_set_no_expiration, /* name */
be_local_closure(Matter_Expirable_get_parent_list, /* name */
be_nested_proto(
2, /* nstack */
1, /* argc */
@ -348,14 +268,118 @@ be_local_closure(Matter_Expirable_set_no_expiration, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(_expiration),
/* K0 */ be_nested_str_weak(_list),
}),
be_str_weak(set_no_expiration),
be_str_weak(get_parent_list),
&be_const_str_solidified,
( &(const binstruction[ 3]) { /* code */
0x4C040000, // 0000 LDNIL R1
0x90020001, // 0001 SETMBR R0 K0 R1
0x80000000, // 0002 RET 0
( &(const binstruction[ 2]) { /* code */
0x88040100, // 0000 GETMBR R1 R0 K0
0x80040200, // 0001 RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: does_persist
********************************************************************/
be_local_closure(Matter_Expirable_does_persist, /* 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(_persist),
}),
be_str_weak(does_persist),
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x88040100, // 0000 GETMBR R1 R0 K0
0x80040200, // 0001 RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: set_persist
********************************************************************/
be_local_closure(Matter_Expirable_set_persist, /* name */
be_nested_proto(
4, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(_persist),
}),
be_str_weak(set_persist),
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x60080017, // 0000 GETGBL R2 G23
0x5C0C0200, // 0001 MOVE R3 R1
0x7C080200, // 0002 CALL R2 1
0x90020002, // 0003 SETMBR R0 K0 R2
0x80000000, // 0004 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: persist_pre
********************************************************************/
be_local_closure(Matter_Expirable_persist_pre, /* name */
be_nested_proto(
1, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
0, /* has constants */
NULL, /* no const */
be_str_weak(persist_pre),
&be_const_str_solidified,
( &(const binstruction[ 1]) { /* code */
0x80000000, // 0000 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: persist_post
********************************************************************/
be_local_closure(Matter_Expirable_persist_post, /* name */
be_nested_proto(
1, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
0, /* has constants */
NULL, /* no const */
be_str_weak(persist_post),
&be_const_str_solidified,
( &(const binstruction[ 1]) { /* code */
0x80000000, // 0000 RET 0
})
)
);
@ -368,23 +392,24 @@ be_local_closure(Matter_Expirable_set_no_expiration, /* name */
be_local_class(Matter_Expirable,
3,
NULL,
be_nested_map(15,
be_nested_map(16,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(init, -1), be_const_closure(Matter_Expirable_init_closure) },
{ be_const_key_weak(set_persist, -1), be_const_closure(Matter_Expirable_set_persist_closure) },
{ be_const_key_weak(has_expired, 7), be_const_closure(Matter_Expirable_has_expired_closure) },
{ be_const_key_weak(_persist, -1), be_const_var(1) },
{ be_const_key_weak(get_parent_list, 13), be_const_closure(Matter_Expirable_get_parent_list_closure) },
{ be_const_key_weak(_expiration, -1), be_const_var(2) },
{ be_const_key_weak(set_no_expiration, 9), be_const_closure(Matter_Expirable_set_no_expiration_closure) },
{ be_const_key_weak(persist_post, -1), be_const_closure(Matter_Expirable_persist_post_closure) },
{ be_const_key_weak(set_expire_time, -1), be_const_closure(Matter_Expirable_set_expire_time_closure) },
{ be_const_key_weak(init, -1), be_const_closure(Matter_Expirable_init_closure) },
{ be_const_key_weak(has_expired, -1), be_const_closure(Matter_Expirable_has_expired_closure) },
{ be_const_key_weak(set_expire_time, 6), be_const_closure(Matter_Expirable_set_expire_time_closure) },
{ be_const_key_weak(set_parent_list, 4), be_const_closure(Matter_Expirable_set_parent_list_closure) },
{ be_const_key_weak(hydrate_post, -1), be_const_closure(Matter_Expirable_hydrate_post_closure) },
{ be_const_key_weak(set_expire_in_seconds, -1), be_const_closure(Matter_Expirable_set_expire_in_seconds_closure) },
{ be_const_key_weak(get_parent_list, 8), be_const_closure(Matter_Expirable_get_parent_list_closure) },
{ be_const_key_weak(_list, -1), be_const_var(0) },
{ be_const_key_weak(does_persist, -1), be_const_closure(Matter_Expirable_does_persist_closure) },
{ be_const_key_weak(hydrate_post, 8), be_const_closure(Matter_Expirable_hydrate_post_closure) },
{ be_const_key_weak(set_expire_in_seconds, 3), be_const_closure(Matter_Expirable_set_expire_in_seconds_closure) },
{ be_const_key_weak(_expiration, 10), be_const_var(2) },
{ be_const_key_weak(set_parent_list, -1), be_const_closure(Matter_Expirable_set_parent_list_closure) },
{ be_const_key_weak(set_persist, -1), be_const_closure(Matter_Expirable_set_persist_closure) },
{ be_const_key_weak(persist_pre, -1), be_const_closure(Matter_Expirable_persist_pre_closure) },
{ be_const_key_weak(set_no_expiration, -1), be_const_closure(Matter_Expirable_set_no_expiration_closure) },
{ be_const_key_weak(_persist, 2), be_const_var(1) },
{ be_const_key_weak(before_remove, 0), be_const_closure(Matter_Expirable_before_remove_closure) },
})),
be_str_weak(Matter_Expirable)
);
@ -439,6 +464,125 @@ be_local_closure(Matter_Expirable_list_count_persistables, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: remove
********************************************************************/
be_local_closure(Matter_Expirable_list_remove, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 3]) { /* constants */
/* K0 */ be_const_int(0),
/* K1 */ be_nested_str_weak(before_remove),
/* K2 */ be_nested_str_weak(remove),
}),
be_str_weak(remove),
&be_const_str_solidified,
( &(const binstruction[17]) { /* code */
0x28080300, // 0000 GE R2 R1 K0
0x780A0007, // 0001 JMPF R2 #000A
0x6008000C, // 0002 GETGBL R2 G12
0x5C0C0000, // 0003 MOVE R3 R0
0x7C080200, // 0004 CALL R2 1
0x14080202, // 0005 LT R2 R1 R2
0x780A0002, // 0006 JMPF R2 #000A
0x94080001, // 0007 GETIDX R2 R0 R1
0x8C080501, // 0008 GETMET R2 R2 K1
0x7C080200, // 0009 CALL R2 1
0x60080003, // 000A GETGBL R2 G3
0x5C0C0000, // 000B MOVE R3 R0
0x7C080200, // 000C CALL R2 1
0x8C080502, // 000D GETMET R2 R2 K2
0x5C100200, // 000E MOVE R4 R1
0x7C080400, // 000F CALL R2 2
0x80040400, // 0010 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: push
********************************************************************/
be_local_closure(Matter_Expirable_list_push, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 6]) { /* constants */
/* K0 */ be_nested_str_weak(matter),
/* K1 */ be_nested_str_weak(Expirable),
/* K2 */ be_nested_str_weak(type_error),
/* K3 */ be_nested_str_weak(argument_X20must_X20be_X20of_X20class_X20_X27Expirable_X27),
/* K4 */ be_nested_str_weak(set_parent_list),
/* K5 */ be_nested_str_weak(push),
}),
be_str_weak(push),
&be_const_str_solidified,
( &(const binstruction[17]) { /* code */
0x6008000F, // 0000 GETGBL R2 G15
0x5C0C0200, // 0001 MOVE R3 R1
0xB8120000, // 0002 GETNGBL R4 K0
0x88100901, // 0003 GETMBR R4 R4 K1
0x7C080400, // 0004 CALL R2 2
0x740A0000, // 0005 JMPT R2 #0007
0xB0060503, // 0006 RAISE 1 K2 K3
0x8C080304, // 0007 GETMET R2 R1 K4
0x5C100000, // 0008 MOVE R4 R0
0x7C080400, // 0009 CALL R2 2
0x60080003, // 000A GETGBL R2 G3
0x5C0C0000, // 000B MOVE R3 R0
0x7C080200, // 000C CALL R2 1
0x8C080505, // 000D GETMET R2 R2 K5
0x5C100200, // 000E MOVE R4 R1
0x7C080400, // 000F CALL R2 2
0x80040400, // 0010 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: every_second
********************************************************************/
be_local_closure(Matter_Expirable_list_every_second, /* name */
be_nested_proto(
3, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(remove_expired),
}),
be_str_weak(every_second),
&be_const_str_solidified,
( &(const binstruction[ 3]) { /* code */
0x8C040100, // 0000 GETMET R1 R0 K0
0x7C040200, // 0001 CALL R1 1
0x80000000, // 0002 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: remove_expired
********************************************************************/
@ -490,82 +634,6 @@ be_local_closure(Matter_Expirable_list_remove_expired, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: setitem
********************************************************************/
be_local_closure(Matter_Expirable_list_setitem, /* name */
be_nested_proto(
7, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 6]) { /* constants */
/* K0 */ be_nested_str_weak(matter),
/* K1 */ be_nested_str_weak(Expirable),
/* K2 */ be_nested_str_weak(type_error),
/* K3 */ be_nested_str_weak(argument_X20must_X20be_X20of_X20class_X20_X27Expirable_X27),
/* K4 */ be_nested_str_weak(set_parent_list),
/* K5 */ be_nested_str_weak(setitem),
}),
be_str_weak(setitem),
&be_const_str_solidified,
( &(const binstruction[18]) { /* code */
0x600C000F, // 0000 GETGBL R3 G15
0x5C100400, // 0001 MOVE R4 R2
0xB8160000, // 0002 GETNGBL R5 K0
0x88140B01, // 0003 GETMBR R5 R5 K1
0x7C0C0400, // 0004 CALL R3 2
0x740E0000, // 0005 JMPT R3 #0007
0xB0060503, // 0006 RAISE 1 K2 K3
0x8C0C0504, // 0007 GETMET R3 R2 K4
0x5C140000, // 0008 MOVE R5 R0
0x7C0C0400, // 0009 CALL R3 2
0x600C0003, // 000A GETGBL R3 G3
0x5C100000, // 000B MOVE R4 R0
0x7C0C0200, // 000C CALL R3 1
0x8C0C0705, // 000D GETMET R3 R3 K5
0x5C140200, // 000E MOVE R5 R1
0x5C180400, // 000F MOVE R6 R2
0x7C0C0600, // 0010 CALL R3 3
0x80040600, // 0011 RET 1 R3
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: every_second
********************************************************************/
be_local_closure(Matter_Expirable_list_every_second, /* name */
be_nested_proto(
3, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(remove_expired),
}),
be_str_weak(every_second),
&be_const_str_solidified,
( &(const binstruction[ 3]) { /* code */
0x8C040100, // 0000 GETMET R1 R0 K0
0x7C040200, // 0001 CALL R1 1
0x80000000, // 0002 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: persistables
********************************************************************/
@ -626,12 +694,12 @@ be_local_closure(Matter_Expirable_list_persistables, /* name */
/********************************************************************
** Solidified function: push
** Solidified function: setitem
********************************************************************/
be_local_closure(Matter_Expirable_list_push, /* name */
be_local_closure(Matter_Expirable_list_setitem, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
7, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
@ -644,28 +712,29 @@ be_local_closure(Matter_Expirable_list_push, /* name */
/* K2 */ be_nested_str_weak(type_error),
/* K3 */ be_nested_str_weak(argument_X20must_X20be_X20of_X20class_X20_X27Expirable_X27),
/* K4 */ be_nested_str_weak(set_parent_list),
/* K5 */ be_nested_str_weak(push),
/* K5 */ be_nested_str_weak(setitem),
}),
be_str_weak(push),
be_str_weak(setitem),
&be_const_str_solidified,
( &(const binstruction[17]) { /* code */
0x6008000F, // 0000 GETGBL R2 G15
0x5C0C0200, // 0001 MOVE R3 R1
0xB8120000, // 0002 GETNGBL R4 K0
0x88100901, // 0003 GETMBR R4 R4 K1
0x7C080400, // 0004 CALL R2 2
0x740A0000, // 0005 JMPT R2 #0007
( &(const binstruction[18]) { /* code */
0x600C000F, // 0000 GETGBL R3 G15
0x5C100400, // 0001 MOVE R4 R2
0xB8160000, // 0002 GETNGBL R5 K0
0x88140B01, // 0003 GETMBR R5 R5 K1
0x7C0C0400, // 0004 CALL R3 2
0x740E0000, // 0005 JMPT R3 #0007
0xB0060503, // 0006 RAISE 1 K2 K3
0x8C080304, // 0007 GETMET R2 R1 K4
0x5C100000, // 0008 MOVE R4 R0
0x7C080400, // 0009 CALL R2 2
0x60080003, // 000A GETGBL R2 G3
0x5C0C0000, // 000B MOVE R3 R0
0x7C080200, // 000C CALL R2 1
0x8C080505, // 000D GETMET R2 R2 K5
0x5C100200, // 000E MOVE R4 R1
0x7C080400, // 000F CALL R2 2
0x80040400, // 0010 RET 1 R2
0x8C0C0504, // 0007 GETMET R3 R2 K4
0x5C140000, // 0008 MOVE R5 R0
0x7C0C0400, // 0009 CALL R3 2
0x600C0003, // 000A GETGBL R3 G3
0x5C100000, // 000B MOVE R4 R0
0x7C0C0200, // 000C CALL R3 1
0x8C0C0705, // 000D GETMET R3 R3 K5
0x5C140200, // 000E MOVE R5 R1
0x5C180400, // 000F MOVE R6 R2
0x7C0C0600, // 0010 CALL R3 3
0x80040600, // 0011 RET 1 R3
})
)
);
@ -679,14 +748,15 @@ extern const bclass be_class_list;
be_local_class(Matter_Expirable_list,
0,
&be_class_list,
be_nested_map(6,
be_nested_map(7,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(count_persistables, -1), be_const_closure(Matter_Expirable_list_count_persistables_closure) },
{ be_const_key_weak(count_persistables, 4), be_const_closure(Matter_Expirable_list_count_persistables_closure) },
{ be_const_key_weak(remove, -1), be_const_closure(Matter_Expirable_list_remove_closure) },
{ be_const_key_weak(push, 5), be_const_closure(Matter_Expirable_list_push_closure) },
{ be_const_key_weak(every_second, -1), be_const_closure(Matter_Expirable_list_every_second_closure) },
{ be_const_key_weak(setitem, -1), be_const_closure(Matter_Expirable_list_setitem_closure) },
{ be_const_key_weak(remove_expired, 1), be_const_closure(Matter_Expirable_list_remove_expired_closure) },
{ be_const_key_weak(setitem, 6), be_const_closure(Matter_Expirable_list_setitem_closure) },
{ be_const_key_weak(persistables, -1), be_const_closure(Matter_Expirable_list_persistables_closure) },
{ be_const_key_weak(push, -1), be_const_closure(Matter_Expirable_list_push_closure) },
{ be_const_key_weak(remove_expired, -1), be_const_closure(Matter_Expirable_list_remove_expired_closure) },
})),
be_str_weak(Matter_Expirable_list)
);

File diff suppressed because it is too large Load Diff

View File

@ -7,68 +7,106 @@
extern const bclass be_class_Matter_IM_Subscription;
/********************************************************************
** Solidified function: re_arm
** Solidified function: init
********************************************************************/
be_local_closure(Matter_IM_Subscription_re_arm, /* name */
be_local_closure(Matter_IM_Subscription_init, /* name */
be_nested_proto(
9, /* nstack */
1, /* argc */
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[15]) { /* constants */
/* K0 */ be_nested_str_weak(string),
/* K1 */ be_nested_str_weak(wait_status),
/* K2 */ be_nested_str_weak(tasmota),
/* 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),
/* K10 */ be_nested_str_weak(log),
/* K11 */ be_nested_str_weak(format),
/* K12 */ be_nested_str_weak(MTR_X3A_X20_X3ESub_Done_X20_X20sub_id_X3D),
/* K13 */ be_nested_str_weak(subscription_id),
/* K14 */ be_const_int(2),
( &(const bvalue[22]) { /* constants */
/* K0 */ be_nested_str_weak(subs_shop),
/* 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),
/* K21 */ be_nested_str_weak(is_keep_alive),
}),
be_str_weak(re_arm),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[30]) { /* code */
0xA4060000, // 0000 IMPORT R1 K0
0x50080000, // 0001 LDBOOL R2 0 0
0x90020202, // 0002 SETMBR R0 K1 R2
0xB80A0400, // 0003 GETNGBL R2 K2
0x8C080503, // 0004 GETMET R2 R2 K3
0x7C080200, // 0005 CALL R2 1
0x880C0105, // 0006 GETMBR R3 R0 K5
0x88100106, // 0007 GETMBR R4 R0 K6
0x040C0604, // 0008 SUB R3 R3 R4
0x541203E7, // 0009 LDINT R4 1000
0x080C0604, // 000A MUL R3 R3 R4
0x000C0403, // 000B ADD R3 R2 R3
0x90020803, // 000C SETMBR R0 K4 R3
0x880C0108, // 000D GETMBR R3 R0 K8
0x541203E7, // 000E LDINT R4 1000
0x080C0604, // 000F MUL R3 R3 R4
0x000C0403, // 0010 ADD R3 R2 R3
0x040C0709, // 0011 SUB R3 R3 K9
0x90020E03, // 0012 SETMBR R0 K7 R3
0xB80E0400, // 0013 GETNGBL R3 K2
0x8C0C070A, // 0014 GETMET R3 R3 K10
0x8C14030B, // 0015 GETMET R5 R1 K11
0x601C0008, // 0016 GETGBL R7 G8
0x8820010D, // 0017 GETMBR R8 R0 K13
0x7C1C0200, // 0018 CALL R7 1
0x001E1807, // 0019 ADD R7 K12 R7
0x7C140400, // 001A CALL R5 2
0x5818000E, // 001B LDCONST R6 K14
0x7C0C0600, // 001C CALL R3 3
0x80000000, // 001D RET 0
( &(const binstruction[61]) { /* 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
0x501C0000, // 003A LDBOOL R7 0 0
0x90022A07, // 003B SETMBR R0 K21 R7
0x80000000, // 003C RET 0
})
)
);
@ -147,29 +185,31 @@ be_local_closure(Matter_IM_Subscription_remove_self, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 6]) { /* constants */
( &(const bvalue[ 7]) { /* 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),
/* K2 */ be_nested_str_weak(MTR_X3A_X20_X2DSub_Del_X20_X20_X20_X28_X20_X20_X20_X20_X20_X20_X29_X20sub_X3D),
/* K3 */ be_nested_str_weak(subscription_id),
/* K4 */ be_nested_str_weak(subs),
/* K5 */ be_nested_str_weak(remove_sub),
/* K4 */ be_const_int(2),
/* K5 */ be_nested_str_weak(subs_shop),
/* K6 */ be_nested_str_weak(remove_sub),
}),
be_str_weak(remove_self),
&be_const_str_solidified,
( &(const binstruction[12]) { /* code */
( &(const binstruction[13]) { /* 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
0x58100004, // 0006 LDCONST R4 K4
0x7C040600, // 0007 CALL R1 3
0x88040105, // 0008 GETMBR R1 R0 K5
0x8C040306, // 0009 GETMET R1 R1 K6
0x5C0C0000, // 000A MOVE R3 R0
0x7C040400, // 000B CALL R1 2
0x80000000, // 000C RET 0
})
)
);
@ -209,110 +249,6 @@ be_local_closure(Matter_IM_Subscription_clear_before_arm, /* name */
/*******************************************************************/
/********************************************************************
** 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[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
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: attribute_updated_ctx
********************************************************************/
@ -382,32 +318,103 @@ be_local_closure(Matter_IM_Subscription_attribute_updated_ctx, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: re_arm
********************************************************************/
be_local_closure(Matter_IM_Subscription_re_arm, /* name */
be_nested_proto(
9, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[16]) { /* constants */
/* K0 */ be_nested_str_weak(string),
/* K1 */ be_nested_str_weak(wait_status),
/* K2 */ be_nested_str_weak(tasmota),
/* 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),
/* K10 */ be_nested_str_weak(is_keep_alive),
/* K11 */ be_nested_str_weak(log),
/* K12 */ be_nested_str_weak(format),
/* K13 */ be_nested_str_weak(MTR_X3A_X20_X2ESub_Done_X20_X20_X28_X20_X20_X20_X20_X20_X20_X29_X20sub_X3D_X25i),
/* K14 */ be_nested_str_weak(subscription_id),
/* K15 */ be_const_int(2),
}),
be_str_weak(re_arm),
&be_const_str_solidified,
( &(const binstruction[30]) { /* code */
0xA4060000, // 0000 IMPORT R1 K0
0x50080000, // 0001 LDBOOL R2 0 0
0x90020202, // 0002 SETMBR R0 K1 R2
0xB80A0400, // 0003 GETNGBL R2 K2
0x8C080503, // 0004 GETMET R2 R2 K3
0x7C080200, // 0005 CALL R2 1
0x880C0105, // 0006 GETMBR R3 R0 K5
0x88100106, // 0007 GETMBR R4 R0 K6
0x040C0604, // 0008 SUB R3 R3 R4
0x541203E7, // 0009 LDINT R4 1000
0x080C0604, // 000A MUL R3 R3 R4
0x000C0403, // 000B ADD R3 R2 R3
0x90020803, // 000C SETMBR R0 K4 R3
0x880C0108, // 000D GETMBR R3 R0 K8
0x541203E7, // 000E LDINT R4 1000
0x080C0604, // 000F MUL R3 R3 R4
0x000C0403, // 0010 ADD R3 R2 R3
0x040C0709, // 0011 SUB R3 R3 K9
0x90020E03, // 0012 SETMBR R0 K7 R3
0x880C010A, // 0013 GETMBR R3 R0 K10
0x740E0007, // 0014 JMPT R3 #001D
0xB80E0400, // 0015 GETNGBL R3 K2
0x8C0C070B, // 0016 GETMET R3 R3 K11
0x8C14030C, // 0017 GETMET R5 R1 K12
0x581C000D, // 0018 LDCONST R7 K13
0x8820010E, // 0019 GETMBR R8 R0 K14
0x7C140600, // 001A CALL R5 3
0x5818000F, // 001B LDCONST R6 K15
0x7C0C0600, // 001C CALL R3 3
0x80000000, // 001D RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: Matter_IM_Subscription
********************************************************************/
be_local_class(Matter_IM_Subscription,
11,
12,
NULL,
be_nested_map(18,
be_nested_map(19,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(subscription_id, 4), be_const_var(1) },
{ be_const_key_weak(wait_status, -1), be_const_var(9) },
{ be_const_key_weak(attribute_updated_ctx, 5), be_const_closure(Matter_IM_Subscription_attribute_updated_ctx_closure) },
{ be_const_key_weak(not_before, -1), be_const_var(7) },
{ be_const_key_weak(init, -1), be_const_closure(Matter_IM_Subscription_init_closure) },
{ be_const_key_weak(fabric_filtered, 17), be_const_var(6) },
{ be_const_key_weak(clear_before_arm, -1), be_const_closure(Matter_IM_Subscription_clear_before_arm_closure) },
{ 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, -1), be_const_var(2) },
{ be_const_key_weak(expiration, 16), be_const_var(8) },
{ be_const_key_weak(re_arm, 10), be_const_closure(Matter_IM_Subscription_re_arm_closure) },
{ 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(updates, -1), be_const_var(11) },
{ be_const_key_weak(min_interval, -1), be_const_var(4) },
{ be_const_key_weak(MAX_INTERVAL_MARGIN, 8), be_const_int(5) },
{ be_const_key_weak(updates, 2), be_const_var(10) },
{ 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_const_key_weak(expiration, -1), be_const_var(8) },
{ be_const_key_weak(subscription_id, 3), be_const_var(1) },
{ be_const_key_weak(subs_shop, -1), be_const_var(0) },
{ be_const_key_weak(max_interval, -1), be_const_var(5) },
{ be_const_key_weak(remove_self, 1), be_const_closure(Matter_IM_Subscription_remove_self_closure) },
{ be_const_key_weak(MAX_INTERVAL_MARGIN, -1), be_const_int(5) },
{ be_const_key_weak(fabric_filtered, 7), be_const_var(6) },
{ be_const_key_weak(_add_attribute_unique_path, 11), be_const_closure(Matter_IM_Subscription__add_attribute_unique_path_closure) },
{ be_const_key_weak(path_list, 9), be_const_var(3) },
{ be_const_key_weak(is_keep_alive, -1), be_const_var(10) },
{ be_const_key_weak(clear_before_arm, -1), be_const_closure(Matter_IM_Subscription_clear_before_arm_closure) },
{ be_const_key_weak(session, 2), be_const_var(2) },
{ be_const_key_weak(re_arm, -1), be_const_closure(Matter_IM_Subscription_re_arm_closure) },
{ be_const_key_weak(wait_status, 0), be_const_var(9) },
})),
be_str_weak(Matter_IM_Subscription)
);

View File

@ -438,15 +438,15 @@ be_local_closure(Matter_Frame_debug, /* name */
********************************************************************/
be_local_closure(Matter_Frame_build_standalone_ack, /* name */
be_nested_proto(
11, /* nstack */
1, /* argc */
6, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[29]) { /* constants */
( &(const bvalue[22]) { /* constants */
/* K0 */ be_nested_str_weak(string),
/* K1 */ be_nested_str_weak(message_handler),
/* K2 */ be_nested_str_weak(remote_ip),
@ -469,70 +469,56 @@ be_local_closure(Matter_Frame_build_standalone_ack, /* name */
/* K19 */ be_nested_str_weak(x_flag_a),
/* K20 */ be_nested_str_weak(ack_message_counter),
/* K21 */ be_nested_str_weak(x_flag_r),
/* K22 */ be_nested_str_weak(tasmota),
/* K23 */ be_nested_str_weak(log),
/* K24 */ be_nested_str_weak(format),
/* K25 */ be_nested_str_weak(MTR_X3A_X20_X3CReplied_X20_X20_X20_X25s),
/* K26 */ be_nested_str_weak(matter),
/* K27 */ be_nested_str_weak(get_opcode_name),
/* K28 */ be_const_int(3),
}),
be_str_weak(build_standalone_ack),
&be_const_str_solidified,
( &(const binstruction[53]) { /* code */
0xA4060000, // 0000 IMPORT R1 K0
0x60080006, // 0001 GETGBL R2 G6
0x5C0C0000, // 0002 MOVE R3 R0
0x7C080200, // 0003 CALL R2 1
0x880C0101, // 0004 GETMBR R3 R0 K1
0x7C080200, // 0005 CALL R2 1
0x880C0102, // 0006 GETMBR R3 R0 K2
0x900A0403, // 0007 SETMBR R2 K2 R3
0x880C0103, // 0008 GETMBR R3 R0 K3
0x900A0603, // 0009 SETMBR R2 K3 R3
0x880C0104, // 000A GETMBR R3 R0 K4
0x780E0003, // 000B JMPF R3 #0010
0x900A0B06, // 000C SETMBR R2 K5 K6
0x880C0108, // 000D GETMBR R3 R0 K8
0x900A0E03, // 000E SETMBR R2 K7 R3
( &(const binstruction[46]) { /* code */
0xA40A0000, // 0000 IMPORT R2 K0
0x600C0006, // 0001 GETGBL R3 G6
0x5C100000, // 0002 MOVE R4 R0
0x7C0C0200, // 0003 CALL R3 1
0x88100101, // 0004 GETMBR R4 R0 K1
0x7C0C0200, // 0005 CALL R3 1
0x88100102, // 0006 GETMBR R4 R0 K2
0x900E0404, // 0007 SETMBR R3 K2 R4
0x88100103, // 0008 GETMBR R4 R0 K3
0x900E0604, // 0009 SETMBR R3 K3 R4
0x88100104, // 000A GETMBR R4 R0 K4
0x78120003, // 000B JMPF R4 #0010
0x900E0B06, // 000C SETMBR R3 K5 K6
0x88100108, // 000D GETMBR R4 R0 K8
0x900E0E04, // 000E SETMBR R3 K7 R4
0x70020000, // 000F JMP #0011
0x900A0B09, // 0010 SETMBR R2 K5 K9
0x880C010A, // 0011 GETMBR R3 R0 K10
0x900A1403, // 0012 SETMBR R2 K10 R3
0x880C010A, // 0013 GETMBR R3 R0 K10
0x8C0C070C, // 0014 GETMET R3 R3 K12
0x7C0C0200, // 0015 CALL R3 1
0x900A1603, // 0016 SETMBR R2 K11 R3
0x880C010A, // 0017 GETMBR R3 R0 K10
0x880C070E, // 0018 GETMBR R3 R3 K14
0x900A1A03, // 0019 SETMBR R2 K13 R3
0x880C010F, // 001A GETMBR R3 R0 K15
0x780E0001, // 001B JMPF R3 #001E
0x580C0009, // 001C LDCONST R3 K9
0x900E0B09, // 0010 SETMBR R3 K5 K9
0x8810010A, // 0011 GETMBR R4 R0 K10
0x900E1404, // 0012 SETMBR R3 K10 R4
0x8810010A, // 0013 GETMBR R4 R0 K10
0x8C10090C, // 0014 GETMET R4 R4 K12
0x7C100200, // 0015 CALL R4 1
0x900E1604, // 0016 SETMBR R3 K11 R4
0x8810010A, // 0017 GETMBR R4 R0 K10
0x8810090E, // 0018 GETMBR R4 R4 K14
0x900E1A04, // 0019 SETMBR R3 K13 R4
0x8810010F, // 001A GETMBR R4 R0 K15
0x78120001, // 001B JMPF R4 #001E
0x58100009, // 001C LDCONST R4 K9
0x70020000, // 001D JMP #001F
0x580C0006, // 001E LDCONST R3 K6
0x900A1E03, // 001F SETMBR R2 K15 R3
0x540E000F, // 0020 LDINT R3 16
0x900A2003, // 0021 SETMBR R2 K16 R3
0x880C0111, // 0022 GETMBR R3 R0 K17
0x900A2203, // 0023 SETMBR R2 K17 R3
0x900A2509, // 0024 SETMBR R2 K18 K9
0x900A2706, // 0025 SETMBR R2 K19 K6
0x880C010B, // 0026 GETMBR R3 R0 K11
0x900A2803, // 0027 SETMBR R2 K20 R3
0x900A2B06, // 0028 SETMBR R2 K21 K6
0xB80E2C00, // 0029 GETNGBL R3 K22
0x8C0C0717, // 002A GETMET R3 R3 K23
0x8C140318, // 002B GETMET R5 R1 K24
0x581C0019, // 002C LDCONST R7 K25
0xB8223400, // 002D GETNGBL R8 K26
0x8C20111B, // 002E GETMET R8 R8 K27
0x88280510, // 002F GETMBR R10 R2 K16
0x7C200400, // 0030 CALL R8 2
0x7C140600, // 0031 CALL R5 3
0x5818001C, // 0032 LDCONST R6 K28
0x7C0C0600, // 0033 CALL R3 3
0x80040400, // 0034 RET 1 R2
0x58100006, // 001E LDCONST R4 K6
0x900E1E04, // 001F SETMBR R3 K15 R4
0x5412000F, // 0020 LDINT R4 16
0x900E2004, // 0021 SETMBR R3 K16 R4
0x88100111, // 0022 GETMBR R4 R0 K17
0x900E2204, // 0023 SETMBR R3 K17 R4
0x900E2509, // 0024 SETMBR R3 K18 K9
0x900E2706, // 0025 SETMBR R3 K19 K6
0x8810010B, // 0026 GETMBR R4 R0 K11
0x900E2804, // 0027 SETMBR R3 K20 R4
0x78060001, // 0028 JMPF R1 #002B
0x58100006, // 0029 LDCONST R4 K6
0x70020000, // 002A JMP #002C
0x58100009, // 002B LDCONST R4 K9
0x900E2A04, // 002C SETMBR R3 K21 R4
0x80040600, // 002D RET 1 R3
})
)
);
@ -544,7 +530,7 @@ be_local_closure(Matter_Frame_build_standalone_ack, /* name */
********************************************************************/
be_local_closure(Matter_Frame_build_response, /* name */
be_nested_proto(
12, /* nstack */
13, /* nstack */
4, /* argc */
2, /* varg */
0, /* has upvals */
@ -583,12 +569,12 @@ be_local_closure(Matter_Frame_build_response, /* name */
/* K27 */ be_nested_str_weak(0x_X2502X),
/* K28 */ be_nested_str_weak(tasmota),
/* K29 */ be_nested_str_weak(log),
/* K30 */ be_nested_str_weak(MTR_X3A_X20_X3CReplied_X20_X20_X20_X25s),
/* K30 */ be_nested_str_weak(MTR_X3A_X20_X3CReplied_X20_X20_X20_X28_X256i_X29_X20_X25s),
/* K31 */ be_const_int(2),
}),
be_str_weak(build_response),
&be_const_str_solidified,
( &(const binstruction[90]) { /* code */
( &(const binstruction[92]) { /* code */
0xA4120000, // 0000 IMPORT R4 K0
0x4C140000, // 0001 LDNIL R5
0x1C140605, // 0002 EQ R5 R3 R5
@ -658,7 +644,7 @@ be_local_closure(Matter_Frame_build_response, /* name */
0x900E2A05, // 0042 SETMBR R3 K21 R5
0x8814070B, // 0043 GETMBR R5 R3 K11
0x1C140B09, // 0044 EQ R5 R5 K9
0x78160012, // 0045 JMPF R5 #0059
0x78160014, // 0045 JMPF R5 #005B
0xB8163000, // 0046 GETNGBL R5 K24
0x8C140B19, // 0047 GETMET R5 R5 K25
0x881C0712, // 0048 GETMBR R7 R3 K18
@ -674,11 +660,13 @@ be_local_closure(Matter_Frame_build_response, /* name */
0x8C180D1D, // 0052 GETMET R6 R6 K29
0x8C20091A, // 0053 GETMET R8 R4 K26
0x5828001E, // 0054 LDCONST R10 K30
0x5C2C0A00, // 0055 MOVE R11 R5
0x7C200600, // 0056 CALL R8 3
0x5824001F, // 0057 LDCONST R9 K31
0x7C180600, // 0058 CALL R6 3
0x80040600, // 0059 RET 1 R3
0x882C070A, // 0055 GETMBR R11 R3 K10
0x882C170B, // 0056 GETMBR R11 R11 K11
0x5C300A00, // 0057 MOVE R12 R5
0x7C200800, // 0058 CALL R8 4
0x5824001F, // 0059 LDCONST R9 K31
0x7C180600, // 005A CALL R6 3
0x80040600, // 005B RET 1 R3
})
)
);

View File

@ -11,7 +11,7 @@ extern const bclass be_class_Matter_MessageHandler;
********************************************************************/
be_local_closure(Matter_MessageHandler_msg_received, /* name */
be_nested_proto(
18, /* nstack */
24, /* nstack */
4, /* argc */
2, /* varg */
0, /* has upvals */
@ -19,7 +19,7 @@ be_local_closure(Matter_MessageHandler_msg_received, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[73]) { /* constants */
( &(const bvalue[77]) { /* constants */
/* K0 */ be_nested_str_weak(string),
/* K1 */ be_nested_str_weak(tasmota),
/* K2 */ be_nested_str_weak(log),
@ -46,60 +46,64 @@ be_local_closure(Matter_MessageHandler_msg_received, /* name */
/* K23 */ be_nested_str_weak(validate),
/* K24 */ be_nested_str_weak(message_counter),
/* K25 */ be_nested_str_weak(format),
/* K26 */ be_nested_str_weak(MTR_X3A_X20rejected_X20duplicate_X20unencrypted_X20message_X20_X3D_X20_X25i_X20ref_X20_X3D_X20_X25i),
/* K26 */ be_nested_str_weak(MTR_X3A_X20_X2E_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20Rejected_X20duplicate_X20unencrypted_X20message_X20_X3D_X20_X25i_X20ref_X20_X3D_X20_X25i),
/* K27 */ be_nested_str_weak(val),
/* K28 */ be_nested_str_weak(decode_payload),
/* K29 */ be_nested_str_weak(packet_ack),
/* K29 */ be_nested_str_weak(received_ack),
/* K30 */ be_nested_str_weak(ack_message_counter),
/* K31 */ be_nested_str_weak(opcode),
/* K32 */ be_nested_str_weak(get_opcode_name),
/* K33 */ be_nested_str_weak(0x_X2502X),
/* K34 */ be_nested_str_weak(MTR_X3A_X20_X3EReceived_X20_X20_X25s_X20from_X20_X5B_X25s_X5D_X3A_X25i),
/* K35 */ be_const_int(2),
/* K36 */ be_nested_str_weak(commissioning),
/* K37 */ be_nested_str_weak(process_incoming),
/* K38 */ be_nested_str_weak(MTR_X3A_X20decode_X20header_X3A_X20local_session_id_X3D_X25i_X20message_counter_X3D_X25i),
/* K39 */ be_nested_str_weak(get_session_by_local_session_id),
/* K40 */ be_nested_str_weak(MTR_X3A_X20unknown_X20local_session_id_X3D),
/* K41 */ be_nested_str_weak(MTR_X3A_X20frame_X3D),
/* K42 */ be_nested_str_weak(inspect),
/* K43 */ be_nested_str_weak(counter_rcv_validate),
/* K44 */ be_nested_str_weak(MTR_X3A_X20rejected_X20duplicate_X20encrypted_X20message_X20_X3D_X20),
/* K45 */ be_nested_str_weak(_X20counter_X3D),
/* K46 */ be_nested_str_weak(counter_rcv),
/* K47 */ be_nested_str_weak(decrypt),
/* K48 */ be_nested_str_weak(raw),
/* K49 */ be_nested_str_weak(payload_idx),
/* K50 */ be_const_int(1),
/* K51 */ be_nested_str_weak(MTR_X3A_X20idx_X3D_X25i_X20clear_X3D_X25s),
/* K52 */ be_nested_str_weak(MTR_X3A_X20decrypted_X20message_X3A_X20protocol_id_X3A),
/* K53 */ be_nested_str_weak(protocol_id),
/* K54 */ be_nested_str_weak(_X20opcode_X3D),
/* K55 */ be_nested_str_weak(_X20exchange_id_X3D),
/* K56 */ be_nested_str_weak(exchange_id),
/* K57 */ be_nested_str_weak(MTR_X3A_X20PROTOCOL_ID_SECURE_CHANNEL_X20),
/* K58 */ be_nested_str_weak(im),
/* K59 */ be_nested_str_weak(process_incoming_ack),
/* K60 */ be_nested_str_weak(send_enqueued),
/* K61 */ be_nested_str_weak(x_flag_r),
/* K62 */ be_nested_str_weak(build_standalone_ack),
/* K63 */ be_nested_str_weak(encode_frame),
/* K64 */ be_nested_str_weak(encrypt),
/* K65 */ be_nested_str_weak(send_response),
/* K66 */ be_nested_str_weak(remote_ip),
/* K67 */ be_nested_str_weak(remote_port),
/* K68 */ be_nested_str_weak(MTR_X3A_X20ignoring_X20unhandled_X20protocol_id_X3A),
/* K69 */ be_nested_str_weak(MTR_X3A_X20MessageHandler_X3A_X3Amsg_received_X20exception_X3A_X20),
/* K70 */ be_nested_str_weak(_X3B),
/* K71 */ be_nested_str_weak(debug),
/* K72 */ be_nested_str_weak(traceback),
/* K34 */ be_nested_str_weak(MTR_X3A_X20_X3EReceived_X20_X20_X28_X256i_X29_X20_X25s_X20rid_X3D_X25i_X20exch_X3D_X25i_X20from_X20_X5B_X25s_X5D_X3A_X25i),
/* K35 */ be_nested_str_weak(exchange_id),
/* K36 */ be_const_int(2),
/* K37 */ be_nested_str_weak(MTR_X3A_X20_X3Ercv_X20Ack_X20_X20_X20_X28_X256i_X29_X20rid_X3D_X25i_X20exch_X3D_X25i_X20ack_X3D_X25s_X20_X25sfrom_X20_X5B_X25s_X5D_X3A_X25i),
/* K38 */ be_nested_str_weak(x_flag_r),
/* K39 */ be_nested_str_weak(_X7Breliable_X7D_X20),
/* K40 */ be_nested_str_weak(),
/* K41 */ be_nested_str_weak(commissioning),
/* K42 */ be_nested_str_weak(process_incoming),
/* K43 */ be_nested_str_weak(MTR_X3A_X20decode_X20header_X3A_X20local_session_id_X3D_X25i_X20message_counter_X3D_X25i),
/* K44 */ be_nested_str_weak(get_session_by_local_session_id),
/* K45 */ be_nested_str_weak(MTR_X3A_X20unknown_X20local_session_id_X3D),
/* K46 */ be_nested_str_weak(counter_rcv_validate),
/* K47 */ be_nested_str_weak(MTR_X3A_X20_X2E_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20Rejected_X20duplicate_X20encrypted_X20message_X20_X3D_X20),
/* K48 */ be_nested_str_weak(_X20counter_X3D),
/* K49 */ be_nested_str_weak(counter_rcv),
/* K50 */ be_nested_str_weak(decrypt),
/* K51 */ be_nested_str_weak(raw),
/* K52 */ be_nested_str_weak(payload_idx),
/* K53 */ be_const_int(1),
/* K54 */ be_nested_str_weak(MTR_X3A_X20idx_X3D_X25i_X20clear_X3D_X25s),
/* K55 */ be_nested_str_weak(MTR_X3A_X20_X3E_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20Decrypted_X20message_X3A_X20protocol_id_X3A),
/* K56 */ be_nested_str_weak(protocol_id),
/* K57 */ be_nested_str_weak(_X20opcode_X3D),
/* K58 */ be_nested_str_weak(_X20exchange_id_X3D),
/* K59 */ be_nested_str_weak(MTR_X3A_X20_X3Ercv_X20_X20_X20_X20_X20_X20_X20_X28_X256i_X29_X20_X5B_X2502X_X2F_X2502X_X5D_X20rid_X3D_X25i_X20exch_X3D_X25i_X20ack_X3D_X25s_X20_X25sfrom_X20_X5B_X25s_X5D_X3A_X25i),
/* K60 */ be_nested_str_weak(MTR_X3A_X20PROTOCOL_ID_SECURE_CHANNEL_X20),
/* K61 */ be_nested_str_weak(inspect),
/* K62 */ be_nested_str_weak(im),
/* K63 */ be_nested_str_weak(process_incoming_ack),
/* K64 */ be_nested_str_weak(send_enqueued),
/* K65 */ be_nested_str_weak(build_standalone_ack),
/* K66 */ be_nested_str_weak(encode_frame),
/* K67 */ be_nested_str_weak(encrypt),
/* K68 */ be_nested_str_weak(MTR_X3A_X20_X3CAck_X20_X20_X20_X20_X20_X20_X20_X28_X256i_X29_X20ack_X3D_X25i_X20id_X3D_X25i_X20_X7Breliable_X7D),
/* K69 */ be_nested_str_weak(send_response),
/* K70 */ be_nested_str_weak(remote_ip),
/* K71 */ be_nested_str_weak(remote_port),
/* K72 */ be_nested_str_weak(MTR_X3A_X20ignoring_X20unhandled_X20protocol_id_X3A),
/* K73 */ be_nested_str_weak(MTR_X3A_X20MessageHandler_X3A_X3Amsg_received_X20exception_X3A_X20),
/* K74 */ be_nested_str_weak(_X3B),
/* K75 */ be_nested_str_weak(debug),
/* K76 */ be_nested_str_weak(traceback),
}),
be_str_weak(msg_received),
&be_const_str_solidified,
( &(const binstruction[325]) { /* code */
( &(const binstruction[374]) { /* code */
0xA4120000, // 0000 IMPORT R4 K0
0x50140000, // 0001 LDBOOL R5 0 0
0xA802012B, // 0002 EXBLK 0 #012F
0xA802015C, // 0002 EXBLK 0 #0160
0xB81A0200, // 0003 GETNGBL R6 K1
0x8C180D02, // 0004 GETMET R6 R6 K2
0x8C200304, // 0005 GETMET R8 R1 K4
@ -123,10 +127,10 @@ be_local_closure(Matter_MessageHandler_msg_received, /* name */
0x80041000, // 0017 RET 1 R8
0x88200D08, // 0018 GETMBR R8 R6 K8
0x1C201109, // 0019 EQ R8 R8 K9
0x7822005A, // 001A JMPF R8 #0076
0x78220072, // 001A JMPF R8 #008E
0x88200D0A, // 001B GETMBR R8 R6 K10
0x1C201109, // 001C EQ R8 R8 K9
0x78220057, // 001D JMPF R8 #0076
0x7822006F, // 001D JMPF R8 #008E
0x8820010B, // 001E GETMBR R8 R0 K11
0x8820110C, // 001F GETMBR R8 R8 K12
0x8C20110D, // 0020 GETMET R8 R8 K13
@ -185,7 +189,7 @@ be_local_closure(Matter_MessageHandler_msg_received, /* name */
0x88240D1F, // 0055 GETMBR R9 R6 K31
0x542A000F, // 0056 LDINT R10 16
0x2024120A, // 0057 NE R9 R9 R10
0x78260014, // 0058 JMPF R9 #006E
0x78260018, // 0058 JMPF R9 #0072
0xB8260A00, // 0059 GETNGBL R9 K5
0x8C241320, // 005A GETMET R9 R9 K32
0x882C0D1F, // 005B GETMBR R11 R6 K31
@ -201,227 +205,276 @@ be_local_closure(Matter_MessageHandler_msg_received, /* name */
0x8C281502, // 0065 GETMET R10 R10 K2
0x8C300919, // 0066 GETMET R12 R4 K25
0x58380022, // 0067 LDCONST R14 K34
0x5C3C1200, // 0068 MOVE R15 R9
0x5C400400, // 0069 MOVE R16 R2
0x5C440600, // 006A MOVE R17 R3
0x7C300A00, // 006B CALL R12 5
0x58340023, // 006C LDCONST R13 K35
0x7C280600, // 006D CALL R10 3
0x88240124, // 006E GETMBR R9 R0 K36
0x8C241325, // 006F GETMET R9 R9 K37
0x5C2C0C00, // 0070 MOVE R11 R6
0x7C240400, // 0071 CALL R9 2
0x50240200, // 0072 LDBOOL R9 1 0
0xA8040001, // 0073 EXBLK 1 1
0x80041200, // 0074 RET 1 R9
0x700200B4, // 0075 JMP #012B
0xB8220200, // 0076 GETNGBL R8 K1
0x8C201102, // 0077 GETMET R8 R8 K2
0x8C280919, // 0078 GETMET R10 R4 K25
0x58300026, // 0079 LDCONST R12 K38
0x88340D08, // 007A GETMBR R13 R6 K8
0x88380D18, // 007B GETMBR R14 R6 K24
0x7C280800, // 007C CALL R10 4
0x582C0011, // 007D LDCONST R11 K17
0x7C200600, // 007E CALL R8 3
0x8820010B, // 007F GETMBR R8 R0 K11
0x8820110C, // 0080 GETMBR R8 R8 K12
0x8C201127, // 0081 GETMET R8 R8 K39
0x88280D08, // 0082 GETMBR R10 R6 K8
0x7C200400, // 0083 CALL R8 2
0x4C240000, // 0084 LDNIL R9
0x1C241009, // 0085 EQ R9 R8 R9
0x78260013, // 0086 JMPF R9 #009B
0xB8260200, // 0087 GETNGBL R9 K1
0x8C241302, // 0088 GETMET R9 R9 K2
0x602C0008, // 0089 GETGBL R11 G8
0x88300D08, // 008A GETMBR R12 R6 K8
0x7C2C0200, // 008B CALL R11 1
0x002E500B, // 008C ADD R11 K40 R11
0x58300023, // 008D LDCONST R12 K35
0x7C240600, // 008E CALL R9 3
0xB8260200, // 008F GETNGBL R9 K1
0x8C241302, // 0090 GETMET R9 R9 K2
0xB82E0A00, // 0091 GETNGBL R11 K5
0x8C2C172A, // 0092 GETMET R11 R11 K42
0x5C340C00, // 0093 MOVE R13 R6
0x7C2C0400, // 0094 CALL R11 2
0x002E520B, // 0095 ADD R11 K41 R11
0x58300011, // 0096 LDCONST R12 K17
0x7C240600, // 0097 CALL R9 3
0x50240000, // 0098 LDBOOL R9 0 0
0xA8040001, // 0099 EXBLK 1 1
0x80041200, // 009A RET 1 R9
0x780A0000, // 009B JMPF R2 #009D
0x90222402, // 009C SETMBR R8 K18 R2
0x780E0000, // 009D JMPF R3 #009F
0x90222603, // 009E SETMBR R8 K19 R3
0x90222800, // 009F SETMBR R8 K20 R0
0x901A2A08, // 00A0 SETMBR R6 K21 R8
0x8C24112B, // 00A1 GETMET R9 R8 K43
0x882C0D18, // 00A2 GETMBR R11 R6 K24
0x50300200, // 00A3 LDBOOL R12 1 0
0x7C240600, // 00A4 CALL R9 3
0x7426000F, // 00A5 JMPT R9 #00B6
0xB8260200, // 00A6 GETNGBL R9 K1
0x8C241302, // 00A7 GETMET R9 R9 K2
0x602C0008, // 00A8 GETGBL R11 G8
0x88300D18, // 00A9 GETMBR R12 R6 K24
0x7C2C0200, // 00AA CALL R11 1
0x002E580B, // 00AB ADD R11 K44 R11
0x002C172D, // 00AC ADD R11 R11 K45
0x60300008, // 00AD GETGBL R12 G8
0x8834112E, // 00AE GETMBR R13 R8 K46
0x7C300200, // 00AF CALL R12 1
0x002C160C, // 00B0 ADD R11 R11 R12
0x58300011, // 00B1 LDCONST R12 K17
0x7C240600, // 00B2 CALL R9 3
0x50240000, // 00B3 LDBOOL R9 0 0
0xA8040001, // 00B4 EXBLK 1 1
0x80041200, // 00B5 RET 1 R9
0x8C240D2F, // 00B6 GETMET R9 R6 K47
0x7C240200, // 00B7 CALL R9 1
0x5C281200, // 00B8 MOVE R10 R9
0x742A0002, // 00B9 JMPT R10 #00BD
0x50280000, // 00BA LDBOOL R10 0 0
0xA8040001, // 00BB EXBLK 1 1
0x80041400, // 00BC RET 1 R10
0x88280D31, // 00BD GETMBR R10 R6 K49
0x04281532, // 00BE SUB R10 R10 K50
0x402A120A, // 00BF CONNECT R10 K9 R10
0x882C0D30, // 00C0 GETMBR R11 R6 K48
0x9428160A, // 00C1 GETIDX R10 R11 R10
0x901A600A, // 00C2 SETMBR R6 K48 R10
0x88280D30, // 00C3 GETMBR R10 R6 K48
0x40281409, // 00C4 CONNECT R10 R10 R9
0xB82A0200, // 00C5 GETNGBL R10 K1
0x8C281502, // 00C6 GETMET R10 R10 K2
0x8C300919, // 00C7 GETMET R12 R4 K25
0x58380033, // 00C8 LDCONST R14 K51
0x883C0D31, // 00C9 GETMBR R15 R6 K49
0x88400D30, // 00CA GETMBR R16 R6 K48
0x8C402104, // 00CB GETMET R16 R16 K4
0x7C400200, // 00CC CALL R16 1
0x7C300800, // 00CD CALL R12 4
0x54360003, // 00CE LDINT R13 4
0x7C280600, // 00CF CALL R10 3
0x8C280D1C, // 00D0 GETMET R10 R6 K28
0x7C280200, // 00D1 CALL R10 1
0xB82A0200, // 00D2 GETNGBL R10 K1
0x8C281502, // 00D3 GETMET R10 R10 K2
0x60300008, // 00D4 GETGBL R12 G8
0x88340D35, // 00D5 GETMBR R13 R6 K53
0x7C300200, // 00D6 CALL R12 1
0x0032680C, // 00D7 ADD R12 K52 R12
0x00301936, // 00D8 ADD R12 R12 K54
0x60340008, // 00D9 GETGBL R13 G8
0x88380D1F, // 00DA GETMBR R14 R6 K31
0x7C340200, // 00DB CALL R13 1
0x0030180D, // 00DC ADD R12 R12 R13
0x00301937, // 00DD ADD R12 R12 K55
0x60340008, // 00DE GETGBL R13 G8
0x88380D38, // 00DF GETMBR R14 R6 K56
0x543EFFFE, // 00E0 LDINT R15 65535
0x2C381C0F, // 00E1 AND R14 R14 R15
0x7C340200, // 00E2 CALL R13 1
0x0030180D, // 00E3 ADD R12 R12 R13
0x58340011, // 00E4 LDCONST R13 K17
0x7C280600, // 00E5 CALL R10 3
0x8828010B, // 00E6 GETMBR R10 R0 K11
0x8C28151D, // 00E7 GETMET R10 R10 K29
0x88300D1E, // 00E8 GETMBR R12 R6 K30
0x7C280400, // 00E9 CALL R10 2
0x88280D35, // 00EA GETMBR R10 R6 K53
0x1C2C1509, // 00EB EQ R11 R10 K9
0x782E0018, // 00EC JMPF R11 #0106
0xB82E0200, // 00ED GETNGBL R11 K1
0x8C2C1702, // 00EE GETMET R11 R11 K2
0xB8360A00, // 00EF GETNGBL R13 K5
0x8C341B2A, // 00F0 GETMET R13 R13 K42
0x5C3C0C00, // 00F1 MOVE R15 R6
0x7C340400, // 00F2 CALL R13 2
0x0036720D, // 00F3 ADD R13 K57 R13
0x58380011, // 00F4 LDCONST R14 K17
0x7C2C0600, // 00F5 CALL R11 3
0x882C0D1F, // 00F6 GETMBR R11 R6 K31
0x5432000F, // 00F7 LDINT R12 16
0x1C2C160C, // 00F8 EQ R11 R11 R12
0x782E0009, // 00F9 JMPF R11 #0104
0x882C013A, // 00FA GETMBR R11 R0 K58
0x8C2C173B, // 00FB GETMET R11 R11 K59
0x5C340C00, // 00FC MOVE R13 R6
0x7C2C0400, // 00FD CALL R11 2
0x5C141600, // 00FE MOVE R5 R11
0x78160003, // 00FF JMPF R5 #0104
0x882C013A, // 0100 GETMBR R11 R0 K58
0x8C2C173C, // 0101 GETMET R11 R11 K60
0x5C340000, // 0102 MOVE R13 R0
0x7C2C0400, // 0103 CALL R11 2
0x50140200, // 0104 LDBOOL R5 1 0
0x70020024, // 0105 JMP #012B
0x1C2C1532, // 0106 EQ R11 R10 K50
0x782E001A, // 0107 JMPF R11 #0123
0x882C013A, // 0108 GETMBR R11 R0 K58
0x8C2C1725, // 0109 GETMET R11 R11 K37
0x5C340C00, // 010A MOVE R13 R6
0x7C2C0400, // 010B CALL R11 2
0x5C141600, // 010C MOVE R5 R11
0x78160004, // 010D JMPF R5 #0113
0x882C013A, // 010E GETMBR R11 R0 K58
0x8C2C173C, // 010F GETMET R11 R11 K60
0x5C340000, // 0110 MOVE R13 R0
0x7C2C0400, // 0111 CALL R11 2
0x7002000D, // 0112 JMP #0121
0x882C0D3D, // 0113 GETMBR R11 R6 K61
0x782E000B, // 0114 JMPF R11 #0121
0x8C2C0D3E, // 0115 GETMET R11 R6 K62
0x7C2C0200, // 0116 CALL R11 1
0x8C30173F, // 0117 GETMET R12 R11 K63
0x7C300200, // 0118 CALL R12 1
0x8C301740, // 0119 GETMET R12 R11 K64
0x7C300200, // 011A CALL R12 1
0x8C300141, // 011B GETMET R12 R0 K65
0x88381730, // 011C GETMBR R14 R11 K48
0x883C1742, // 011D GETMBR R15 R11 K66
0x88401743, // 011E GETMBR R16 R11 K67
0x88441718, // 011F GETMBR R17 R11 K24
0x7C300A00, // 0120 CALL R12 5
0x50140200, // 0121 LDBOOL R5 1 0
0x70020007, // 0122 JMP #012B
0xB82E0200, // 0123 GETNGBL R11 K1
0x8C2C1702, // 0124 GETMET R11 R11 K2
0x60340008, // 0125 GETGBL R13 G8
0x5C381400, // 0126 MOVE R14 R10
0x7C340200, // 0127 CALL R13 1
0x0036880D, // 0128 ADD R13 K68 R13
0x58380011, // 0129 LDCONST R14 K17
0x7C2C0600, // 012A CALL R11 3
0xA8040001, // 012B EXBLK 1 1
0x80040A00, // 012C RET 1 R5
0xA8040001, // 012D EXBLK 1 1
0x70020014, // 012E JMP #0144
0xAC180002, // 012F CATCH R6 0 2
0x70020011, // 0130 JMP #0143
0xB8220200, // 0131 GETNGBL R8 K1
0x8C201102, // 0132 GETMET R8 R8 K2
0x60280008, // 0133 GETGBL R10 G8
0x5C2C0C00, // 0134 MOVE R11 R6
0x7C280200, // 0135 CALL R10 1
0x002A8A0A, // 0136 ADD R10 K69 R10
0x00281546, // 0137 ADD R10 R10 K70
0x602C0008, // 0138 GETGBL R11 G8
0x5C300E00, // 0139 MOVE R12 R7
0x7C2C0200, // 013A CALL R11 1
0x0028140B, // 013B ADD R10 R10 R11
0x7C200400, // 013C CALL R8 2
0xA4228E00, // 013D IMPORT R8 K71
0x8C241148, // 013E GETMET R9 R8 K72
0x7C240200, // 013F CALL R9 1
0x50240000, // 0140 LDBOOL R9 0 0
0x80041200, // 0141 RET 1 R9
0x70020000, // 0142 JMP #0144
0xB0080000, // 0143 RAISE 2 R0 R0
0x80000000, // 0144 RET 0
0x883C1108, // 0068 GETMBR R15 R8 K8
0x5C401200, // 0069 MOVE R16 R9
0x88440D18, // 006A GETMBR R17 R6 K24
0x88480D23, // 006B GETMBR R18 R6 K35
0x5C4C0400, // 006C MOVE R19 R2
0x5C500600, // 006D MOVE R20 R3
0x7C301000, // 006E CALL R12 8
0x58340024, // 006F LDCONST R13 K36
0x7C280600, // 0070 CALL R10 3
0x70020013, // 0071 JMP #0086
0xB8260200, // 0072 GETNGBL R9 K1
0x8C241302, // 0073 GETMET R9 R9 K2
0x8C2C0919, // 0074 GETMET R11 R4 K25
0x58340025, // 0075 LDCONST R13 K37
0x88381108, // 0076 GETMBR R14 R8 K8
0x883C0D18, // 0077 GETMBR R15 R6 K24
0x88400D26, // 0078 GETMBR R16 R6 K38
0x78420001, // 0079 JMPF R16 #007C
0x58400027, // 007A LDCONST R16 K39
0x70020000, // 007B JMP #007D
0x58400028, // 007C LDCONST R16 K40
0x88440D23, // 007D GETMBR R17 R6 K35
0x60480008, // 007E GETGBL R18 G8
0x884C0D1E, // 007F GETMBR R19 R6 K30
0x7C480200, // 0080 CALL R18 1
0x5C4C0400, // 0081 MOVE R19 R2
0x5C500600, // 0082 MOVE R20 R3
0x7C2C1200, // 0083 CALL R11 9
0x58300011, // 0084 LDCONST R12 K17
0x7C240600, // 0085 CALL R9 3
0x88240129, // 0086 GETMBR R9 R0 K41
0x8C24132A, // 0087 GETMET R9 R9 K42
0x5C2C0C00, // 0088 MOVE R11 R6
0x7C240400, // 0089 CALL R9 2
0x50240200, // 008A LDBOOL R9 1 0
0xA8040001, // 008B EXBLK 1 1
0x80041200, // 008C RET 1 R9
0x700200CD, // 008D JMP #015C
0xB8220200, // 008E GETNGBL R8 K1
0x8C201102, // 008F GETMET R8 R8 K2
0x8C280919, // 0090 GETMET R10 R4 K25
0x5830002B, // 0091 LDCONST R12 K43
0x88340D08, // 0092 GETMBR R13 R6 K8
0x88380D18, // 0093 GETMBR R14 R6 K24
0x7C280800, // 0094 CALL R10 4
0x582C0011, // 0095 LDCONST R11 K17
0x7C200600, // 0096 CALL R8 3
0x8820010B, // 0097 GETMBR R8 R0 K11
0x8820110C, // 0098 GETMBR R8 R8 K12
0x8C20112C, // 0099 GETMET R8 R8 K44
0x88280D08, // 009A GETMBR R10 R6 K8
0x7C200400, // 009B CALL R8 2
0x4C240000, // 009C LDNIL R9
0x1C241009, // 009D EQ R9 R8 R9
0x7826000A, // 009E JMPF R9 #00AA
0xB8260200, // 009F GETNGBL R9 K1
0x8C241302, // 00A0 GETMET R9 R9 K2
0x602C0008, // 00A1 GETGBL R11 G8
0x88300D08, // 00A2 GETMBR R12 R6 K8
0x7C2C0200, // 00A3 CALL R11 1
0x002E5A0B, // 00A4 ADD R11 K45 R11
0x58300024, // 00A5 LDCONST R12 K36
0x7C240600, // 00A6 CALL R9 3
0x50240000, // 00A7 LDBOOL R9 0 0
0xA8040001, // 00A8 EXBLK 1 1
0x80041200, // 00A9 RET 1 R9
0x780A0000, // 00AA JMPF R2 #00AC
0x90222402, // 00AB SETMBR R8 K18 R2
0x780E0000, // 00AC JMPF R3 #00AE
0x90222603, // 00AD SETMBR R8 K19 R3
0x90222800, // 00AE SETMBR R8 K20 R0
0x901A2A08, // 00AF SETMBR R6 K21 R8
0x8C24112E, // 00B0 GETMET R9 R8 K46
0x882C0D18, // 00B1 GETMBR R11 R6 K24
0x50300200, // 00B2 LDBOOL R12 1 0
0x7C240600, // 00B3 CALL R9 3
0x7426000F, // 00B4 JMPT R9 #00C5
0xB8260200, // 00B5 GETNGBL R9 K1
0x8C241302, // 00B6 GETMET R9 R9 K2
0x602C0008, // 00B7 GETGBL R11 G8
0x88300D18, // 00B8 GETMBR R12 R6 K24
0x7C2C0200, // 00B9 CALL R11 1
0x002E5E0B, // 00BA ADD R11 K47 R11
0x002C1730, // 00BB ADD R11 R11 K48
0x60300008, // 00BC GETGBL R12 G8
0x88341131, // 00BD GETMBR R13 R8 K49
0x7C300200, // 00BE CALL R12 1
0x002C160C, // 00BF ADD R11 R11 R12
0x58300011, // 00C0 LDCONST R12 K17
0x7C240600, // 00C1 CALL R9 3
0x50240000, // 00C2 LDBOOL R9 0 0
0xA8040001, // 00C3 EXBLK 1 1
0x80041200, // 00C4 RET 1 R9
0x8C240D32, // 00C5 GETMET R9 R6 K50
0x7C240200, // 00C6 CALL R9 1
0x5C281200, // 00C7 MOVE R10 R9
0x742A0002, // 00C8 JMPT R10 #00CC
0x50280000, // 00C9 LDBOOL R10 0 0
0xA8040001, // 00CA EXBLK 1 1
0x80041400, // 00CB RET 1 R10
0x88280D34, // 00CC GETMBR R10 R6 K52
0x04281535, // 00CD SUB R10 R10 K53
0x402A120A, // 00CE CONNECT R10 K9 R10
0x882C0D33, // 00CF GETMBR R11 R6 K51
0x9428160A, // 00D0 GETIDX R10 R11 R10
0x901A660A, // 00D1 SETMBR R6 K51 R10
0x88280D33, // 00D2 GETMBR R10 R6 K51
0x40281409, // 00D3 CONNECT R10 R10 R9
0xB82A0200, // 00D4 GETNGBL R10 K1
0x8C281502, // 00D5 GETMET R10 R10 K2
0x8C300919, // 00D6 GETMET R12 R4 K25
0x58380036, // 00D7 LDCONST R14 K54
0x883C0D34, // 00D8 GETMBR R15 R6 K52
0x88400D33, // 00D9 GETMBR R16 R6 K51
0x8C402104, // 00DA GETMET R16 R16 K4
0x7C400200, // 00DB CALL R16 1
0x7C300800, // 00DC CALL R12 4
0x54360003, // 00DD LDINT R13 4
0x7C280600, // 00DE CALL R10 3
0x8C280D1C, // 00DF GETMET R10 R6 K28
0x7C280200, // 00E0 CALL R10 1
0xB82A0200, // 00E1 GETNGBL R10 K1
0x8C281502, // 00E2 GETMET R10 R10 K2
0x60300008, // 00E3 GETGBL R12 G8
0x88340D38, // 00E4 GETMBR R13 R6 K56
0x7C300200, // 00E5 CALL R12 1
0x00326E0C, // 00E6 ADD R12 K55 R12
0x00301939, // 00E7 ADD R12 R12 K57
0x60340008, // 00E8 GETGBL R13 G8
0x88380D1F, // 00E9 GETMBR R14 R6 K31
0x7C340200, // 00EA CALL R13 1
0x0030180D, // 00EB ADD R12 R12 R13
0x0030193A, // 00EC ADD R12 R12 K58
0x60340008, // 00ED GETGBL R13 G8
0x88380D23, // 00EE GETMBR R14 R6 K35
0x543EFFFE, // 00EF LDINT R15 65535
0x2C381C0F, // 00F0 AND R14 R14 R15
0x7C340200, // 00F1 CALL R13 1
0x0030180D, // 00F2 ADD R12 R12 R13
0x58340011, // 00F3 LDCONST R13 K17
0x7C280600, // 00F4 CALL R10 3
0xB82A0200, // 00F5 GETNGBL R10 K1
0x8C281502, // 00F6 GETMET R10 R10 K2
0x8C300919, // 00F7 GETMET R12 R4 K25
0x5838003B, // 00F8 LDCONST R14 K59
0x883C1108, // 00F9 GETMBR R15 R8 K8
0x88400D38, // 00FA GETMBR R16 R6 K56
0x88440D1F, // 00FB GETMBR R17 R6 K31
0x88480D18, // 00FC GETMBR R18 R6 K24
0x884C0D23, // 00FD GETMBR R19 R6 K35
0x60500008, // 00FE GETGBL R20 G8
0x88540D1E, // 00FF GETMBR R21 R6 K30
0x7C500200, // 0100 CALL R20 1
0x88540D26, // 0101 GETMBR R21 R6 K38
0x78560001, // 0102 JMPF R21 #0105
0x58540027, // 0103 LDCONST R21 K39
0x70020000, // 0104 JMP #0106
0x58540028, // 0105 LDCONST R21 K40
0x5C580400, // 0106 MOVE R22 R2
0x5C5C0600, // 0107 MOVE R23 R3
0x7C301600, // 0108 CALL R12 11
0x58340011, // 0109 LDCONST R13 K17
0x7C280600, // 010A CALL R10 3
0x8828010B, // 010B GETMBR R10 R0 K11
0x8C28151D, // 010C GETMET R10 R10 K29
0x88300D1E, // 010D GETMBR R12 R6 K30
0x7C280400, // 010E CALL R10 2
0x88280D38, // 010F GETMBR R10 R6 K56
0x1C2C1509, // 0110 EQ R11 R10 K9
0x782E0018, // 0111 JMPF R11 #012B
0xB82E0200, // 0112 GETNGBL R11 K1
0x8C2C1702, // 0113 GETMET R11 R11 K2
0xB8360A00, // 0114 GETNGBL R13 K5
0x8C341B3D, // 0115 GETMET R13 R13 K61
0x5C3C0C00, // 0116 MOVE R15 R6
0x7C340400, // 0117 CALL R13 2
0x0036780D, // 0118 ADD R13 K60 R13
0x58380011, // 0119 LDCONST R14 K17
0x7C2C0600, // 011A CALL R11 3
0x882C0D1F, // 011B GETMBR R11 R6 K31
0x5432000F, // 011C LDINT R12 16
0x1C2C160C, // 011D EQ R11 R11 R12
0x782E0009, // 011E JMPF R11 #0129
0x882C013E, // 011F GETMBR R11 R0 K62
0x8C2C173F, // 0120 GETMET R11 R11 K63
0x5C340C00, // 0121 MOVE R13 R6
0x7C2C0400, // 0122 CALL R11 2
0x5C141600, // 0123 MOVE R5 R11
0x78160003, // 0124 JMPF R5 #0129
0x882C013E, // 0125 GETMBR R11 R0 K62
0x8C2C1740, // 0126 GETMET R11 R11 K64
0x5C340000, // 0127 MOVE R13 R0
0x7C2C0400, // 0128 CALL R11 2
0x50140200, // 0129 LDBOOL R5 1 0
0x70020030, // 012A JMP #015C
0x1C2C1535, // 012B EQ R11 R10 K53
0x782E0026, // 012C JMPF R11 #0154
0x882C013E, // 012D GETMBR R11 R0 K62
0x8C2C172A, // 012E GETMET R11 R11 K42
0x5C340C00, // 012F MOVE R13 R6
0x7C2C0400, // 0130 CALL R11 2
0x5C141600, // 0131 MOVE R5 R11
0x78160004, // 0132 JMPF R5 #0138
0x882C013E, // 0133 GETMBR R11 R0 K62
0x8C2C1740, // 0134 GETMET R11 R11 K64
0x5C340000, // 0135 MOVE R13 R0
0x7C2C0400, // 0136 CALL R11 2
0x70020019, // 0137 JMP #0152
0x882C0D26, // 0138 GETMBR R11 R6 K38
0x782E0017, // 0139 JMPF R11 #0152
0x8C2C0D41, // 013A GETMET R11 R6 K65
0x50340200, // 013B LDBOOL R13 1 0
0x7C2C0400, // 013C CALL R11 2
0x8C301742, // 013D GETMET R12 R11 K66
0x7C300200, // 013E CALL R12 1
0x8C301743, // 013F GETMET R12 R11 K67
0x7C300200, // 0140 CALL R12 1
0xB8320200, // 0141 GETNGBL R12 K1
0x8C301902, // 0142 GETMET R12 R12 K2
0x8C380919, // 0143 GETMET R14 R4 K25
0x58400044, // 0144 LDCONST R16 K68
0x88441715, // 0145 GETMBR R17 R11 K21
0x88442308, // 0146 GETMBR R17 R17 K8
0x8848171E, // 0147 GETMBR R18 R11 K30
0x884C1718, // 0148 GETMBR R19 R11 K24
0x7C380A00, // 0149 CALL R14 5
0x583C0011, // 014A LDCONST R15 K17
0x7C300600, // 014B CALL R12 3
0x8C300145, // 014C GETMET R12 R0 K69
0x88381733, // 014D GETMBR R14 R11 K51
0x883C1746, // 014E GETMBR R15 R11 K70
0x88401747, // 014F GETMBR R16 R11 K71
0x88441718, // 0150 GETMBR R17 R11 K24
0x7C300A00, // 0151 CALL R12 5
0x50140200, // 0152 LDBOOL R5 1 0
0x70020007, // 0153 JMP #015C
0xB82E0200, // 0154 GETNGBL R11 K1
0x8C2C1702, // 0155 GETMET R11 R11 K2
0x60340008, // 0156 GETGBL R13 G8
0x5C381400, // 0157 MOVE R14 R10
0x7C340200, // 0158 CALL R13 1
0x0036900D, // 0159 ADD R13 K72 R13
0x58380011, // 015A LDCONST R14 K17
0x7C2C0600, // 015B CALL R11 3
0xA8040001, // 015C EXBLK 1 1
0x80040A00, // 015D RET 1 R5
0xA8040001, // 015E EXBLK 1 1
0x70020014, // 015F JMP #0175
0xAC180002, // 0160 CATCH R6 0 2
0x70020011, // 0161 JMP #0174
0xB8220200, // 0162 GETNGBL R8 K1
0x8C201102, // 0163 GETMET R8 R8 K2
0x60280008, // 0164 GETGBL R10 G8
0x5C2C0C00, // 0165 MOVE R11 R6
0x7C280200, // 0166 CALL R10 1
0x002A920A, // 0167 ADD R10 K73 R10
0x0028154A, // 0168 ADD R10 R10 K74
0x602C0008, // 0169 GETGBL R11 G8
0x5C300E00, // 016A MOVE R12 R7
0x7C2C0200, // 016B CALL R11 1
0x0028140B, // 016C ADD R10 R10 R11
0x7C200400, // 016D CALL R8 2
0xA4229600, // 016E IMPORT R8 K75
0x8C24114C, // 016F GETMET R9 R8 K76
0x7C240200, // 0170 CALL R9 1
0x50240000, // 0171 LDBOOL R9 0 0
0x80041200, // 0172 RET 1 R9
0x70020000, // 0173 JMP #0175
0xB0080000, // 0174 RAISE 2 R0 R0
0x80000000, // 0175 RET 0
})
)
);

View File

@ -1204,7 +1204,7 @@ be_local_closure(Matter_Plugin_Root_invoke_request, /* name */
),
}),
1, /* has constants */
( &(const bvalue[96]) { /* constants */
( &(const bvalue[98]) { /* constants */
/* K0 */ be_nested_str_weak(crypto),
/* K1 */ be_nested_str_weak(string),
/* K2 */ be_nested_str_weak(matter),
@ -1239,7 +1239,7 @@ be_local_closure(Matter_Plugin_Root_invoke_request, /* name */
/* K31 */ be_nested_str_weak(tasmota),
/* K32 */ be_nested_str_weak(rtc),
/* K33 */ be_nested_str_weak(utc),
/* K34 */ be_nested_str_weak(encode),
/* K34 */ be_nested_str_weak(tlv2raw),
/* K35 */ be_nested_str_weak(get_ac),
/* K36 */ be_nested_str_weak(log),
/* K37 */ be_nested_str_weak(MTR_X3A_X20attestation_tbs_X3D),
@ -1279,32 +1279,34 @@ be_local_closure(Matter_Plugin_Root_invoke_request, /* name */
/* K71 */ be_nested_str_weak(MTR_X3A_X20fabric_X3D),
/* K72 */ be_nested_str_weak(inspect),
/* K73 */ be_nested_str_weak(_fabric),
/* K74 */ be_nested_str_weak(set_fabric_label),
/* K75 */ be_nested_str_weak(sessions),
/* K76 */ be_nested_str_weak(active_fabrics),
/* K77 */ be_nested_str_weak(get_fabric_index),
/* K78 */ be_nested_str_weak(MTR_X3A_X20removing_X20fabric_X20),
/* K79 */ be_nested_str_weak(get_fabric_id),
/* K80 */ be_nested_str_weak(set_timer),
/* K81 */ be_nested_str_weak(stop_iteration),
/* K82 */ be_nested_str_weak(MTR_X3A_X20RemoveFabric_X20fabric_X28),
/* K83 */ be_nested_str_weak(_X29_X20not_X20found),
/* K84 */ be_nested_str_weak(INVALID_ACTION),
/* K85 */ be_nested_str_weak(format),
/* K86 */ be_nested_str_weak(MTR_X3A_X20OpenCommissioningWindow_X28timeout_X3D_X25i_X2C_X20passcode_X3D_X25s_X2C_X20discriminator_X3D_X25i_X2C_X20iterations_X3D_X25i_X2C_X20salt_X3D_X25s_X29),
/* K87 */ be_nested_str_weak(INVALID_DATA_TYPE),
/* K88 */ be_nested_str_weak(MTR_X3A_X20wrong_X20size_X20for_X20PAKE_X20parameters),
/* K89 */ be_nested_str_weak(CONSTRAINT_ERROR),
/* K90 */ be_nested_str_weak(start_basic_commissioning),
/* K91 */ be_nested_str_weak(get_fabric),
/* K92 */ be_nested_str_weak(MTR_X3A_X20OpenBasicCommissioningWindow_X20commissioning_timeout_X3D),
/* K93 */ be_nested_str_weak(start_root_basic_commissioning),
/* K94 */ be_nested_str_weak(stop_basic_commissioning),
/* K95 */ be_nested_str_weak(invoke_request),
/* K74 */ be_nested_str_weak(log_new_fabric),
/* K75 */ be_nested_str_weak(set_fabric_label),
/* K76 */ be_nested_str_weak(format),
/* K77 */ be_nested_str_weak(MTR_X3A_X20_X2E_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20Update_X20fabric_X20_X27_X25s_X27_X20label_X3D_X27_X25s_X27),
/* K78 */ be_nested_str_weak(get_fabric_id),
/* K79 */ be_nested_str_weak(sessions),
/* K80 */ be_nested_str_weak(active_fabrics),
/* K81 */ be_nested_str_weak(get_fabric_index),
/* K82 */ be_nested_str_weak(MTR_X3A_X20removing_X20fabric_X20),
/* K83 */ be_nested_str_weak(set_timer),
/* K84 */ be_nested_str_weak(stop_iteration),
/* K85 */ be_nested_str_weak(MTR_X3A_X20RemoveFabric_X20fabric_X28),
/* K86 */ be_nested_str_weak(_X29_X20not_X20found),
/* K87 */ be_nested_str_weak(INVALID_ACTION),
/* K88 */ be_nested_str_weak(MTR_X3A_X20OpenCommissioningWindow_X28timeout_X3D_X25i_X2C_X20passcode_X3D_X25s_X2C_X20discriminator_X3D_X25i_X2C_X20iterations_X3D_X25i_X2C_X20salt_X3D_X25s_X29),
/* K89 */ be_nested_str_weak(INVALID_DATA_TYPE),
/* K90 */ be_nested_str_weak(MTR_X3A_X20wrong_X20size_X20for_X20PAKE_X20parameters),
/* K91 */ be_nested_str_weak(CONSTRAINT_ERROR),
/* K92 */ be_nested_str_weak(start_basic_commissioning),
/* K93 */ be_nested_str_weak(get_fabric),
/* K94 */ be_nested_str_weak(MTR_X3A_X20OpenBasicCommissioningWindow_X20commissioning_timeout_X3D),
/* K95 */ be_nested_str_weak(start_root_basic_commissioning),
/* K96 */ be_nested_str_weak(stop_basic_commissioning),
/* K97 */ be_nested_str_weak(invoke_request),
}),
be_str_weak(invoke_request),
&be_const_str_solidified,
( &(const binstruction[706]) { /* code */
( &(const binstruction[728]) { /* code */
0xA4120000, // 0000 IMPORT R4 K0
0xA4160200, // 0001 IMPORT R5 K1
0xB81A0400, // 0002 GETNGBL R6 K2
@ -1398,10 +1400,10 @@ be_local_closure(Matter_Plugin_Root_invoke_request, /* name */
0x5C300200, // 005A MOVE R12 R1
0x7C280400, // 005B CALL R10 2
0x80041200, // 005C RET 1 R9
0x70020261, // 005D JMP #02C0
0x70020277, // 005D JMP #02D6
0x5426003D, // 005E LDINT R9 62
0x1C240E09, // 005F EQ R9 R7 R9
0x782601C3, // 0060 JMPF R9 #0225
0x782601D9, // 0060 JMPF R9 #023B
0x1C24110F, // 0061 EQ R9 R8 K15
0x7826001D, // 0062 JMPF R9 #0081
0x8C240507, // 0063 GETMET R9 R2 K7
@ -1433,7 +1435,7 @@ be_local_closure(Matter_Plugin_Root_invoke_request, /* name */
0x7C2C0800, // 007D CALL R11 4
0x900E0B11, // 007E SETMBR R3 K5 K17
0x80041400, // 007F RET 1 R10
0x700201A2, // 0080 JMP #0224
0x700201B8, // 0080 JMP #023A
0x1C241106, // 0081 EQ R9 R8 K6
0x78260044, // 0082 JMPF R9 #00C8
0x8C240507, // 0083 GETMET R9 R2 K7
@ -1504,7 +1506,7 @@ be_local_closure(Matter_Plugin_Root_invoke_request, /* name */
0x7C400800, // 00C4 CALL R16 4
0x900E0B08, // 00C5 SETMBR R3 K5 K8
0x80041E00, // 00C6 RET 1 R15
0x7002015B, // 00C7 JMP #0224
0x70020171, // 00C7 JMP #023A
0x54260003, // 00C8 LDINT R9 4
0x1C241009, // 00C9 EQ R9 R8 R9
0x78260040, // 00CA JMPF R9 #010C
@ -1572,7 +1574,7 @@ be_local_closure(Matter_Plugin_Root_invoke_request, /* name */
0x54460004, // 0108 LDINT R17 5
0x900E0A11, // 0109 SETMBR R3 K5 R17
0x80042000, // 010A RET 1 R16
0x70020117, // 010B JMP #0224
0x7002012D, // 010B JMP #023A
0x5426000A, // 010C LDINT R9 11
0x1C241009, // 010D EQ R9 R8 R9
0x78260012, // 010E JMPF R9 #0122
@ -1594,10 +1596,10 @@ be_local_closure(Matter_Plugin_Root_invoke_request, /* name */
0x900E2E0A, // 011E SETMBR R3 K23 R10
0x4C280000, // 011F LDNIL R10
0x80041400, // 0120 RET 1 R10
0x70020101, // 0121 JMP #0224
0x70020117, // 0121 JMP #023A
0x54260005, // 0122 LDINT R9 6
0x1C241009, // 0123 EQ R9 R8 R9
0x782600B2, // 0124 JMPF R9 #01D8
0x782600B5, // 0124 JMPF R9 #01DB
0x8C240507, // 0125 GETMET R9 R2 K7
0x582C0006, // 0126 LDCONST R11 K6
0x7C240400, // 0127 CALL R9 2
@ -1760,257 +1762,279 @@ be_local_closure(Matter_Plugin_Root_invoke_request, /* name */
0x58640046, // 01C4 LDCONST R25 K70
0x58680011, // 01C5 LDCONST R26 K17
0x7C5C0600, // 01C6 CALL R23 3
0x8C5C0D0A, // 01C7 GETMET R23 R6 K10
0x7C5C0200, // 01C8 CALL R23 1
0x8C602F0B, // 01C9 GETMET R24 R23 K11
0x58680006, // 01CA LDCONST R26 K6
0x886C0D0C, // 01CB GETMBR R27 R6 K12
0xB8720400, // 01CC GETNGBL R28 K2
0x8870392E, // 01CD GETMBR R28 R28 K46
0x7C600800, // 01CE CALL R24 4
0x8C602F0B, // 01CF GETMET R24 R23 K11
0x58680008, // 01D0 LDCONST R26 K8
0x886C0D0C, // 01D1 GETMBR R27 R6 K12
0x58700008, // 01D2 LDCONST R28 K8
0x7C600800, // 01D3 CALL R24 4
0x54620007, // 01D4 LDINT R24 8
0x900E0A18, // 01D5 SETMBR R3 K5 R24
0x80042E00, // 01D6 RET 1 R23
0x7002004B, // 01D7 JMP #0224
0x54260008, // 01D8 LDINT R9 9
0x1C241009, // 01D9 EQ R9 R8 R9
0x7826000B, // 01DA JMPF R9 #01E7
0x8C240507, // 01DB GETMET R9 R2 K7
0x582C0006, // 01DC LDCONST R11 K6
0x7C240400, // 01DD CALL R9 2
0x8C28034A, // 01DE GETMET R10 R1 K74
0x5C301200, // 01DF MOVE R12 R9
0x7C280400, // 01E0 CALL R10 2
0xB82A0400, // 01E1 GETNGBL R10 K2
0x8828152E, // 01E2 GETMBR R10 R10 K46
0x900E2E0A, // 01E3 SETMBR R3 K23 R10
0x4C280000, // 01E4 LDNIL R10
0x80041400, // 01E5 RET 1 R10
0x7002003C, // 01E6 JMP #0224
0x54260009, // 01E7 LDINT R9 10
0x1C241009, // 01E8 EQ R9 R8 R9
0x78260039, // 01E9 JMPF R9 #0224
0x8C240507, // 01EA GETMET R9 R2 K7
0x582C0006, // 01EB LDCONST R11 K6
0x7C240400, // 01EC CALL R9 2
0x60280010, // 01ED GETGBL R10 G16
0x882C0115, // 01EE GETMBR R11 R0 K21
0x882C174B, // 01EF GETMBR R11 R11 K75
0x8C2C174C, // 01F0 GETMET R11 R11 K76
0x7C2C0200, // 01F1 CALL R11 1
0x7C280200, // 01F2 CALL R10 1
0xA802001D, // 01F3 EXBLK 0 #0212
0x5C2C1400, // 01F4 MOVE R11 R10
0x7C2C0000, // 01F5 CALL R11 0
0x8C30174D, // 01F6 GETMET R12 R11 K77
0x7C300200, // 01F7 CALL R12 1
0x1C301809, // 01F8 EQ R12 R12 R9
0x78320015, // 01F9 JMPF R12 #0210
0xB8323E00, // 01FA GETNGBL R12 K31
0x8C301924, // 01FB GETMET R12 R12 K36
0x8C38174F, // 01FC GETMET R14 R11 K79
0x7C380200, // 01FD CALL R14 1
0x8C381D3F, // 01FE GETMET R14 R14 K63
0x7C380200, // 01FF CALL R14 1
0x8C381D40, // 0200 GETMET R14 R14 K64
0x7C380200, // 0201 CALL R14 1
0x8C381D26, // 0202 GETMET R14 R14 K38
0x7C380200, // 0203 CALL R14 1
0x003A9C0E, // 0204 ADD R14 K78 R14
0x583C000F, // 0205 LDCONST R15 K15
0x7C300600, // 0206 CALL R12 3
0xB8323E00, // 0207 GETNGBL R12 K31
0x8C301950, // 0208 GETMET R12 R12 K80
0x543A07CF, // 0209 LDINT R14 2000
0x843C0000, // 020A CLOSURE R15 P0
0x7C300600, // 020B CALL R12 3
0x50300200, // 020C LDBOOL R12 1 0
0xA0000000, // 020D CLOSE R0
0xA8040001, // 020E EXBLK 1 1
0x80041800, // 020F RET 1 R12
0xA0280000, // 0210 CLOSE R10
0x7001FFE1, // 0211 JMP #01F4
0x58280051, // 0212 LDCONST R10 K81
0xAC280200, // 0213 CATCH R10 1 0
0xB0080000, // 0214 RAISE 2 R0 R0
0xB82A3E00, // 0215 GETNGBL R10 K31
0x8C281524, // 0216 GETMET R10 R10 K36
0x60300008, // 0217 GETGBL R12 G8
0x5C341200, // 0218 MOVE R13 R9
0x7C300200, // 0219 CALL R12 1
0x0032A40C, // 021A ADD R12 K82 R12
0x00301953, // 021B ADD R12 R12 K83
0x5834000F, // 021C LDCONST R13 K15
0x7C280600, // 021D CALL R10 3
0xB82A0400, // 021E GETNGBL R10 K2
0x88281554, // 021F GETMBR R10 R10 K84
0x900E2E0A, // 0220 SETMBR R3 K23 R10
0x4C280000, // 0221 LDNIL R10
0xA0000000, // 0222 CLOSE R0
0x80041400, // 0223 RET 1 R10
0x7002009A, // 0224 JMP #02C0
0x5426003B, // 0225 LDINT R9 60
0x1C240E09, // 0226 EQ R9 R7 R9
0x78260084, // 0227 JMPF R9 #02AD
0x1C241106, // 0228 EQ R9 R8 K6
0x78260064, // 0229 JMPF R9 #028F
0x8C240507, // 022A GETMET R9 R2 K7
0x582C0006, // 022B LDCONST R11 K6
0x7C240400, // 022C CALL R9 2
0x8C280507, // 022D GETMET R10 R2 K7
0x58300008, // 022E LDCONST R12 K8
0x7C280400, // 022F CALL R10 2
0x8C2C0507, // 0230 GETMET R11 R2 K7
0x5834000F, // 0231 LDCONST R13 K15
0x7C2C0400, // 0232 CALL R11 2
0x8C300507, // 0233 GETMET R12 R2 K7
0x58380011, // 0234 LDCONST R14 K17
0x7C300400, // 0235 CALL R12 2
0x8C340507, // 0236 GETMET R13 R2 K7
0x543E0003, // 0237 LDINT R15 4
0x7C340400, // 0238 CALL R13 2
0xB83A3E00, // 0239 GETNGBL R14 K31
0x8C381D24, // 023A GETMET R14 R14 K36
0x8C400B55, // 023B GETMET R16 R5 K85
0x58480056, // 023C LDCONST R18 K86
0x5C4C1200, // 023D MOVE R19 R9
0x8C501526, // 023E GETMET R20 R10 K38
0x7C500200, // 023F CALL R20 1
0x5C541600, // 0240 MOVE R21 R11
0x5C581800, // 0241 MOVE R22 R12
0x8C5C1B26, // 0242 GETMET R23 R13 K38
0x7C5C0200, // 0243 CALL R23 1
0x7C400E00, // 0244 CALL R16 7
0x5844000F, // 0245 LDCONST R17 K15
0x7C380600, // 0246 CALL R14 3
0x4C380000, // 0247 LDNIL R14
0x1C38120E, // 0248 EQ R14 R9 R14
0x743A000B, // 0249 JMPT R14 #0256
0x4C380000, // 024A LDNIL R14
0x1C38140E, // 024B EQ R14 R10 R14
0x743A0008, // 024C JMPT R14 #0256
0x4C380000, // 024D LDNIL R14
0x1C38160E, // 024E EQ R14 R11 R14
0x743A0005, // 024F JMPT R14 #0256
0x4C380000, // 0250 LDNIL R14
0x1C38180E, // 0251 EQ R14 R12 R14
0x743A0002, // 0252 JMPT R14 #0256
0x4C380000, // 0253 LDNIL R14
0x1C381A0E, // 0254 EQ R14 R13 R14
0x783A0005, // 0255 JMPF R14 #025C
0xB83A0400, // 0256 GETNGBL R14 K2
0x88381D57, // 0257 GETMBR R14 R14 K87
0x900E2E0E, // 0258 SETMBR R3 K23 R14
0x4C380000, // 0259 LDNIL R14
0xA0000000, // 025A CLOSE R0
0x80041C00, // 025B RET 1 R14
0x6038000C, // 025C GETGBL R14 G12
0x5C3C1400, // 025D MOVE R15 R10
0x7C380200, // 025E CALL R14 1
0x543E001F, // 025F LDINT R15 32
0x54420040, // 0260 LDINT R16 65
0x003C1E10, // 0261 ADD R15 R15 R16
0x20381C0F, // 0262 NE R14 R14 R15
0x743A000B, // 0263 JMPT R14 #0270
0x6038000C, // 0264 GETGBL R14 G12
0x5C3C1A00, // 0265 MOVE R15 R13
0x7C380200, // 0266 CALL R14 1
0x543E000F, // 0267 LDINT R15 16
0x14381C0F, // 0268 LT R14 R14 R15
0x743A0005, // 0269 JMPT R14 #0270
0x6038000C, // 026A GETGBL R14 G12
0x5C3C1A00, // 026B MOVE R15 R13
0x7C380200, // 026C CALL R14 1
0x543E001F, // 026D LDINT R15 32
0x24381C0F, // 026E GT R14 R14 R15
0x783A0009, // 026F JMPF R14 #027A
0xB83A3E00, // 0270 GETNGBL R14 K31
0x8C381D24, // 0271 GETMET R14 R14 K36
0x58400058, // 0272 LDCONST R16 K88
0x7C380400, // 0273 CALL R14 2
0xB83A0400, // 0274 GETNGBL R14 K2
0x88381D59, // 0275 GETMBR R14 R14 K89
0x900E2E0E, // 0276 SETMBR R3 K23 R14
0x4C380000, // 0277 LDNIL R14
0xA0000000, // 0278 CLOSE R0
0x80041C00, // 0279 RET 1 R14
0x543A001E, // 027A LDINT R14 31
0x403A0C0E, // 027B CONNECT R14 K6 R14
0x9438140E, // 027C GETIDX R14 R10 R14
0x543E001F, // 027D LDINT R15 32
0x403C1F3B, // 027E CONNECT R15 R15 K59
0x943C140F, // 027F GETIDX R15 R10 R15
0x88400115, // 0280 GETMBR R16 R0 K21
0x8C40215A, // 0281 GETMET R16 R16 K90
0x5C481200, // 0282 MOVE R18 R9
0x5C4C1800, // 0283 MOVE R19 R12
0x5C501600, // 0284 MOVE R20 R11
0x5C541A00, // 0285 MOVE R21 R13
0x5C581C00, // 0286 MOVE R22 R14
0x5C5C1E00, // 0287 MOVE R23 R15
0x8C60035B, // 0288 GETMET R24 R1 K91
0x7C600200, // 0289 CALL R24 1
0x7C401000, // 028A CALL R16 8
0x50400200, // 028B LDBOOL R16 1 0
0xA0000000, // 028C CLOSE R0
0x80042000, // 028D RET 1 R16
0x7002001C, // 028E JMP #02AC
0x1C241108, // 028F EQ R9 R8 K8
0x78260012, // 0290 JMPF R9 #02A4
0x8C240507, // 0291 GETMET R9 R2 K7
0x582C0006, // 0292 LDCONST R11 K6
0x7C240400, // 0293 CALL R9 2
0xB82A3E00, // 0294 GETNGBL R10 K31
0x8C281524, // 0295 GETMET R10 R10 K36
0x60300008, // 0296 GETGBL R12 G8
0x5C341200, // 0297 MOVE R13 R9
0x7C300200, // 0298 CALL R12 1
0x0032B80C, // 0299 ADD R12 K92 R12
0x5834000F, // 029A LDCONST R13 K15
0x7C280600, // 029B CALL R10 3
0x88280115, // 029C GETMBR R10 R0 K21
0x8C28155D, // 029D GETMET R10 R10 K93
0x5C301200, // 029E MOVE R12 R9
0x7C280400, // 029F CALL R10 2
0x50280200, // 02A0 LDBOOL R10 1 0
0xA0000000, // 02A1 CLOSE R0
0x80041400, // 02A2 RET 1 R10
0x70020007, // 02A3 JMP #02AC
0x1C24110F, // 02A4 EQ R9 R8 K15
0x78260005, // 02A5 JMPF R9 #02AC
0x88240115, // 02A6 GETMBR R9 R0 K21
0x8C24135E, // 02A7 GETMET R9 R9 K94
0x7C240200, // 02A8 CALL R9 1
0x50240200, // 02A9 LDBOOL R9 1 0
0xA0000000, // 02AA CLOSE R0
0x80041200, // 02AB RET 1 R9
0x70020012, // 02AC JMP #02C0
0x54260029, // 02AD LDINT R9 42
0x1C240E09, // 02AE EQ R9 R7 R9
0x78260005, // 02AF JMPF R9 #02B6
0x1C241106, // 02B0 EQ R9 R8 K6
0x78260002, // 02B1 JMPF R9 #02B5
0x50240200, // 02B2 LDBOOL R9 1 0
0xA0000000, // 02B3 CLOSE R0
0x80041200, // 02B4 RET 1 R9
0x70020009, // 02B5 JMP #02C0
0x60240003, // 02B6 GETGBL R9 G3
0x5C280000, // 02B7 MOVE R10 R0
0x7C240200, // 02B8 CALL R9 1
0x8C24135F, // 02B9 GETMET R9 R9 K95
0x5C2C0200, // 02BA MOVE R11 R1
0x5C300400, // 02BB MOVE R12 R2
0x5C340600, // 02BC MOVE R13 R3
0x7C240800, // 02BD CALL R9 4
0xA0000000, // 02BE CLOSE R0
0x80041200, // 02BF RET 1 R9
0x885C0349, // 01C7 GETMBR R23 R1 K73
0x8C5C2F4A, // 01C8 GETMET R23 R23 K74
0x7C5C0200, // 01C9 CALL R23 1
0x8C5C0D0A, // 01CA GETMET R23 R6 K10
0x7C5C0200, // 01CB CALL R23 1
0x8C602F0B, // 01CC GETMET R24 R23 K11
0x58680006, // 01CD LDCONST R26 K6
0x886C0D0C, // 01CE GETMBR R27 R6 K12
0xB8720400, // 01CF GETNGBL R28 K2
0x8870392E, // 01D0 GETMBR R28 R28 K46
0x7C600800, // 01D1 CALL R24 4
0x8C602F0B, // 01D2 GETMET R24 R23 K11
0x58680008, // 01D3 LDCONST R26 K8
0x886C0D0C, // 01D4 GETMBR R27 R6 K12
0x58700008, // 01D5 LDCONST R28 K8
0x7C600800, // 01D6 CALL R24 4
0x54620007, // 01D7 LDINT R24 8
0x900E0A18, // 01D8 SETMBR R3 K5 R24
0x80042E00, // 01D9 RET 1 R23
0x7002005E, // 01DA JMP #023A
0x54260008, // 01DB LDINT R9 9
0x1C241009, // 01DC EQ R9 R8 R9
0x7826001E, // 01DD JMPF R9 #01FD
0x8C240507, // 01DE GETMET R9 R2 K7
0x582C0006, // 01DF LDCONST R11 K6
0x7C240400, // 01E0 CALL R9 2
0x8C28034B, // 01E1 GETMET R10 R1 K75
0x5C301200, // 01E2 MOVE R12 R9
0x7C280400, // 01E3 CALL R10 2
0xB82A3E00, // 01E4 GETNGBL R10 K31
0x8C281524, // 01E5 GETMET R10 R10 K36
0x8C300B4C, // 01E6 GETMET R12 R5 K76
0x5838004D, // 01E7 LDCONST R14 K77
0x883C0349, // 01E8 GETMBR R15 R1 K73
0x8C3C1F4E, // 01E9 GETMET R15 R15 K78
0x7C3C0200, // 01EA CALL R15 1
0x8C3C1F3F, // 01EB GETMET R15 R15 K63
0x7C3C0200, // 01EC CALL R15 1
0x8C3C1F40, // 01ED GETMET R15 R15 K64
0x7C3C0200, // 01EE CALL R15 1
0x8C3C1F26, // 01EF GETMET R15 R15 K38
0x7C3C0200, // 01F0 CALL R15 1
0x60400008, // 01F1 GETGBL R16 G8
0x5C441200, // 01F2 MOVE R17 R9
0x7C400200, // 01F3 CALL R16 1
0x7C300800, // 01F4 CALL R12 4
0x5834000F, // 01F5 LDCONST R13 K15
0x7C280600, // 01F6 CALL R10 3
0xB82A0400, // 01F7 GETNGBL R10 K2
0x8828152E, // 01F8 GETMBR R10 R10 K46
0x900E2E0A, // 01F9 SETMBR R3 K23 R10
0x4C280000, // 01FA LDNIL R10
0x80041400, // 01FB RET 1 R10
0x7002003C, // 01FC JMP #023A
0x54260009, // 01FD LDINT R9 10
0x1C241009, // 01FE EQ R9 R8 R9
0x78260039, // 01FF JMPF R9 #023A
0x8C240507, // 0200 GETMET R9 R2 K7
0x582C0006, // 0201 LDCONST R11 K6
0x7C240400, // 0202 CALL R9 2
0x60280010, // 0203 GETGBL R10 G16
0x882C0115, // 0204 GETMBR R11 R0 K21
0x882C174F, // 0205 GETMBR R11 R11 K79
0x8C2C1750, // 0206 GETMET R11 R11 K80
0x7C2C0200, // 0207 CALL R11 1
0x7C280200, // 0208 CALL R10 1
0xA802001D, // 0209 EXBLK 0 #0228
0x5C2C1400, // 020A MOVE R11 R10
0x7C2C0000, // 020B CALL R11 0
0x8C301751, // 020C GETMET R12 R11 K81
0x7C300200, // 020D CALL R12 1
0x1C301809, // 020E EQ R12 R12 R9
0x78320015, // 020F JMPF R12 #0226
0xB8323E00, // 0210 GETNGBL R12 K31
0x8C301924, // 0211 GETMET R12 R12 K36
0x8C38174E, // 0212 GETMET R14 R11 K78
0x7C380200, // 0213 CALL R14 1
0x8C381D3F, // 0214 GETMET R14 R14 K63
0x7C380200, // 0215 CALL R14 1
0x8C381D40, // 0216 GETMET R14 R14 K64
0x7C380200, // 0217 CALL R14 1
0x8C381D26, // 0218 GETMET R14 R14 K38
0x7C380200, // 0219 CALL R14 1
0x003AA40E, // 021A ADD R14 K82 R14
0x583C000F, // 021B LDCONST R15 K15
0x7C300600, // 021C CALL R12 3
0xB8323E00, // 021D GETNGBL R12 K31
0x8C301953, // 021E GETMET R12 R12 K83
0x543A07CF, // 021F LDINT R14 2000
0x843C0000, // 0220 CLOSURE R15 P0
0x7C300600, // 0221 CALL R12 3
0x50300200, // 0222 LDBOOL R12 1 0
0xA0000000, // 0223 CLOSE R0
0xA8040001, // 0224 EXBLK 1 1
0x80041800, // 0225 RET 1 R12
0xA0280000, // 0226 CLOSE R10
0x7001FFE1, // 0227 JMP #020A
0x58280054, // 0228 LDCONST R10 K84
0xAC280200, // 0229 CATCH R10 1 0
0xB0080000, // 022A RAISE 2 R0 R0
0xB82A3E00, // 022B GETNGBL R10 K31
0x8C281524, // 022C GETMET R10 R10 K36
0x60300008, // 022D GETGBL R12 G8
0x5C341200, // 022E MOVE R13 R9
0x7C300200, // 022F CALL R12 1
0x0032AA0C, // 0230 ADD R12 K85 R12
0x00301956, // 0231 ADD R12 R12 K86
0x5834000F, // 0232 LDCONST R13 K15
0x7C280600, // 0233 CALL R10 3
0xB82A0400, // 0234 GETNGBL R10 K2
0x88281557, // 0235 GETMBR R10 R10 K87
0x900E2E0A, // 0236 SETMBR R3 K23 R10
0x4C280000, // 0237 LDNIL R10
0xA0000000, // 0238 CLOSE R0
0x80041400, // 0239 RET 1 R10
0x7002009A, // 023A JMP #02D6
0x5426003B, // 023B LDINT R9 60
0x1C240E09, // 023C EQ R9 R7 R9
0x78260084, // 023D JMPF R9 #02C3
0x1C241106, // 023E EQ R9 R8 K6
0x78260064, // 023F JMPF R9 #02A5
0x8C240507, // 0240 GETMET R9 R2 K7
0x582C0006, // 0241 LDCONST R11 K6
0x7C240400, // 0242 CALL R9 2
0x8C280507, // 0243 GETMET R10 R2 K7
0x58300008, // 0244 LDCONST R12 K8
0x7C280400, // 0245 CALL R10 2
0x8C2C0507, // 0246 GETMET R11 R2 K7
0x5834000F, // 0247 LDCONST R13 K15
0x7C2C0400, // 0248 CALL R11 2
0x8C300507, // 0249 GETMET R12 R2 K7
0x58380011, // 024A LDCONST R14 K17
0x7C300400, // 024B CALL R12 2
0x8C340507, // 024C GETMET R13 R2 K7
0x543E0003, // 024D LDINT R15 4
0x7C340400, // 024E CALL R13 2
0xB83A3E00, // 024F GETNGBL R14 K31
0x8C381D24, // 0250 GETMET R14 R14 K36
0x8C400B4C, // 0251 GETMET R16 R5 K76
0x58480058, // 0252 LDCONST R18 K88
0x5C4C1200, // 0253 MOVE R19 R9
0x8C501526, // 0254 GETMET R20 R10 K38
0x7C500200, // 0255 CALL R20 1
0x5C541600, // 0256 MOVE R21 R11
0x5C581800, // 0257 MOVE R22 R12
0x8C5C1B26, // 0258 GETMET R23 R13 K38
0x7C5C0200, // 0259 CALL R23 1
0x7C400E00, // 025A CALL R16 7
0x5844000F, // 025B LDCONST R17 K15
0x7C380600, // 025C CALL R14 3
0x4C380000, // 025D LDNIL R14
0x1C38120E, // 025E EQ R14 R9 R14
0x743A000B, // 025F JMPT R14 #026C
0x4C380000, // 0260 LDNIL R14
0x1C38140E, // 0261 EQ R14 R10 R14
0x743A0008, // 0262 JMPT R14 #026C
0x4C380000, // 0263 LDNIL R14
0x1C38160E, // 0264 EQ R14 R11 R14
0x743A0005, // 0265 JMPT R14 #026C
0x4C380000, // 0266 LDNIL R14
0x1C38180E, // 0267 EQ R14 R12 R14
0x743A0002, // 0268 JMPT R14 #026C
0x4C380000, // 0269 LDNIL R14
0x1C381A0E, // 026A EQ R14 R13 R14
0x783A0005, // 026B JMPF R14 #0272
0xB83A0400, // 026C GETNGBL R14 K2
0x88381D59, // 026D GETMBR R14 R14 K89
0x900E2E0E, // 026E SETMBR R3 K23 R14
0x4C380000, // 026F LDNIL R14
0xA0000000, // 0270 CLOSE R0
0x80041C00, // 0271 RET 1 R14
0x6038000C, // 0272 GETGBL R14 G12
0x5C3C1400, // 0273 MOVE R15 R10
0x7C380200, // 0274 CALL R14 1
0x543E001F, // 0275 LDINT R15 32
0x54420040, // 0276 LDINT R16 65
0x003C1E10, // 0277 ADD R15 R15 R16
0x20381C0F, // 0278 NE R14 R14 R15
0x743A000B, // 0279 JMPT R14 #0286
0x6038000C, // 027A GETGBL R14 G12
0x5C3C1A00, // 027B MOVE R15 R13
0x7C380200, // 027C CALL R14 1
0x543E000F, // 027D LDINT R15 16
0x14381C0F, // 027E LT R14 R14 R15
0x743A0005, // 027F JMPT R14 #0286
0x6038000C, // 0280 GETGBL R14 G12
0x5C3C1A00, // 0281 MOVE R15 R13
0x7C380200, // 0282 CALL R14 1
0x543E001F, // 0283 LDINT R15 32
0x24381C0F, // 0284 GT R14 R14 R15
0x783A0009, // 0285 JMPF R14 #0290
0xB83A3E00, // 0286 GETNGBL R14 K31
0x8C381D24, // 0287 GETMET R14 R14 K36
0x5840005A, // 0288 LDCONST R16 K90
0x7C380400, // 0289 CALL R14 2
0xB83A0400, // 028A GETNGBL R14 K2
0x88381D5B, // 028B GETMBR R14 R14 K91
0x900E2E0E, // 028C SETMBR R3 K23 R14
0x4C380000, // 028D LDNIL R14
0xA0000000, // 028E CLOSE R0
0x80041C00, // 028F RET 1 R14
0x543A001E, // 0290 LDINT R14 31
0x403A0C0E, // 0291 CONNECT R14 K6 R14
0x9438140E, // 0292 GETIDX R14 R10 R14
0x543E001F, // 0293 LDINT R15 32
0x403C1F3B, // 0294 CONNECT R15 R15 K59
0x943C140F, // 0295 GETIDX R15 R10 R15
0x88400115, // 0296 GETMBR R16 R0 K21
0x8C40215C, // 0297 GETMET R16 R16 K92
0x5C481200, // 0298 MOVE R18 R9
0x5C4C1800, // 0299 MOVE R19 R12
0x5C501600, // 029A MOVE R20 R11
0x5C541A00, // 029B MOVE R21 R13
0x5C581C00, // 029C MOVE R22 R14
0x5C5C1E00, // 029D MOVE R23 R15
0x8C60035D, // 029E GETMET R24 R1 K93
0x7C600200, // 029F CALL R24 1
0x7C401000, // 02A0 CALL R16 8
0x50400200, // 02A1 LDBOOL R16 1 0
0xA0000000, // 02A2 CLOSE R0
0x80042000, // 02A3 RET 1 R16
0x7002001C, // 02A4 JMP #02C2
0x1C241108, // 02A5 EQ R9 R8 K8
0x78260012, // 02A6 JMPF R9 #02BA
0x8C240507, // 02A7 GETMET R9 R2 K7
0x582C0006, // 02A8 LDCONST R11 K6
0x7C240400, // 02A9 CALL R9 2
0xB82A3E00, // 02AA GETNGBL R10 K31
0x8C281524, // 02AB GETMET R10 R10 K36
0x60300008, // 02AC GETGBL R12 G8
0x5C341200, // 02AD MOVE R13 R9
0x7C300200, // 02AE CALL R12 1
0x0032BC0C, // 02AF ADD R12 K94 R12
0x5834000F, // 02B0 LDCONST R13 K15
0x7C280600, // 02B1 CALL R10 3
0x88280115, // 02B2 GETMBR R10 R0 K21
0x8C28155F, // 02B3 GETMET R10 R10 K95
0x5C301200, // 02B4 MOVE R12 R9
0x7C280400, // 02B5 CALL R10 2
0x50280200, // 02B6 LDBOOL R10 1 0
0xA0000000, // 02B7 CLOSE R0
0x80041400, // 02B8 RET 1 R10
0x70020007, // 02B9 JMP #02C2
0x1C24110F, // 02BA EQ R9 R8 K15
0x78260005, // 02BB JMPF R9 #02C2
0x88240115, // 02BC GETMBR R9 R0 K21
0x8C241360, // 02BD GETMET R9 R9 K96
0x7C240200, // 02BE CALL R9 1
0x50240200, // 02BF LDBOOL R9 1 0
0xA0000000, // 02C0 CLOSE R0
0x80000000, // 02C1 RET 0
0x80041200, // 02C1 RET 1 R9
0x70020012, // 02C2 JMP #02D6
0x54260029, // 02C3 LDINT R9 42
0x1C240E09, // 02C4 EQ R9 R7 R9
0x78260005, // 02C5 JMPF R9 #02CC
0x1C241106, // 02C6 EQ R9 R8 K6
0x78260002, // 02C7 JMPF R9 #02CB
0x50240200, // 02C8 LDBOOL R9 1 0
0xA0000000, // 02C9 CLOSE R0
0x80041200, // 02CA RET 1 R9
0x70020009, // 02CB JMP #02D6
0x60240003, // 02CC GETGBL R9 G3
0x5C280000, // 02CD MOVE R10 R0
0x7C240200, // 02CE CALL R9 1
0x8C241361, // 02CF GETMET R9 R9 K97
0x5C2C0200, // 02D0 MOVE R11 R1
0x5C300400, // 02D1 MOVE R12 R2
0x5C340600, // 02D2 MOVE R13 R3
0x7C240800, // 02D3 CALL R9 4
0xA0000000, // 02D4 CLOSE R0
0x80041200, // 02D5 RET 1 R9
0xA0000000, // 02D6 CLOSE R0
0x80000000, // 02D7 RET 0
})
)
);

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@ be_local_closure(Matter_UDPPacket_sent_init, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[10]) { /* constants */
( &(const bvalue[12]) { /* constants */
/* K0 */ be_nested_str_weak(raw),
/* K1 */ be_nested_str_weak(addr),
/* K2 */ be_nested_str_weak(port),
@ -29,11 +29,13 @@ be_local_closure(Matter_UDPPacket_sent_init, /* name */
/* K6 */ be_nested_str_weak(next_try),
/* K7 */ be_nested_str_weak(tasmota),
/* K8 */ be_nested_str_weak(millis),
/* K9 */ be_nested_str_weak(backoff_time),
/* K9 */ be_nested_str_weak(matter),
/* K10 */ be_nested_str_weak(UDPServer),
/* K11 */ be_nested_str_weak(_backoff_time),
}),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[14]) { /* code */
( &(const binstruction[16]) { /* code */
0x90020001, // 0000 SETMBR R0 K0 R1
0x90020202, // 0001 SETMBR R0 K1 R2
0x90020403, // 0002 SETMBR R0 K2 R3
@ -42,97 +44,14 @@ be_local_closure(Matter_UDPPacket_sent_init, /* name */
0xB8160E00, // 0005 GETNGBL R5 K7
0x8C140B08, // 0006 GETMET R5 R5 K8
0x7C140200, // 0007 CALL R5 1
0x8C180109, // 0008 GETMET R6 R0 K9
0x88200104, // 0009 GETMBR R8 R0 K4
0x7C180400, // 000A CALL R6 2
0x00140A06, // 000B ADD R5 R5 R6
0x90020C05, // 000C SETMBR R0 K6 R5
0x80000000, // 000D RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: backoff_time
********************************************************************/
be_local_closure(Matter_UDPPacket_sent_backoff_time, /* name */
be_nested_proto(
10, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
1, /* has sup protos */
( &(const struct bproto*[ 1]) {
be_nested_proto(
4, /* nstack */
2, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_const_int(1),
/* K1 */ be_const_int(0),
}),
be_str_weak(power_int),
&be_const_str_solidified,
( &(const binstruction[ 7]) { /* code */
0x58080000, // 0000 LDCONST R2 K0
0x240C0301, // 0001 GT R3 R1 K1
0x780E0002, // 0002 JMPF R3 #0006
0x08080400, // 0003 MUL R2 R2 R0
0x04040300, // 0004 SUB R1 R1 K0
0x7001FFFA, // 0005 JMP #0001
0x80040400, // 0006 RET 1 R2
})
),
}),
1, /* has constants */
( &(const bvalue[ 7]) { /* constants */
/* K0 */ be_nested_str_weak(math),
/* K1 */ be_nested_str_weak(rand),
/* K2 */ be_const_int(0),
/* K3 */ be_const_int(1),
/* K4 */ be_const_real_hex(0x3FCCCCCD),
/* K5 */ be_const_real_hex(0x3F800000),
/* K6 */ be_const_real_hex(0x3E800000),
}),
be_str_weak(backoff_time),
&be_const_str_solidified,
( &(const binstruction[28]) { /* code */
0x84080000, // 0000 CLOSURE R2 P0
0xA40E0000, // 0001 IMPORT R3 K0
0x5412012B, // 0002 LDINT R4 300
0x6014000A, // 0003 GETGBL R5 G10
0x8C180701, // 0004 GETMET R6 R3 K1
0x7C180200, // 0005 CALL R6 1
0x541E00FE, // 0006 LDINT R7 255
0x2C180C07, // 0007 AND R6 R6 R7
0x7C140200, // 0008 CALL R5 1
0x541A00FE, // 0009 LDINT R6 255
0x0C140A06, // 000A DIV R5 R5 R6
0x24180302, // 000B GT R6 R1 K2
0x781A0001, // 000C JMPF R6 #000F
0x04180303, // 000D SUB R6 R1 K3
0x70020000, // 000E JMP #0010
0x58180002, // 000F LDCONST R6 K2
0x5C1C0400, // 0010 MOVE R7 R2
0x58200004, // 0011 LDCONST R8 K4
0x5C240C00, // 0012 MOVE R9 R6
0x7C1C0400, // 0013 CALL R7 2
0x081C0807, // 0014 MUL R7 R4 R7
0x08200B06, // 0015 MUL R8 R5 K6
0x00220A08, // 0016 ADD R8 K5 R8
0x081C0E08, // 0017 MUL R7 R7 R8
0x60200009, // 0018 GETGBL R8 G9
0x5C240E00, // 0019 MOVE R9 R7
0x7C200200, // 001A CALL R8 1
0x80041000, // 001B RET 1 R8
0xB81A1200, // 0008 GETNGBL R6 K9
0x88180D0A, // 0009 GETMBR R6 R6 K10
0x8C180D0B, // 000A GETMET R6 R6 K11
0x88200104, // 000B GETMBR R8 R0 K4
0x7C180400, // 000C CALL R6 2
0x00140A06, // 000D ADD R5 R5 R6
0x90020C05, // 000E SETMBR R0 K6 R5
0x80000000, // 000F RET 0
})
)
);
@ -204,7 +123,7 @@ be_local_closure(Matter_UDPPacket_sent_send, /* name */
0x7C180800, // 001F CALL R6 4
0x581C000C, // 0020 LDCONST R7 K12
0x7C100600, // 0021 CALL R4 3
0x80000000, // 0022 RET 0
0x80040600, // 0022 RET 1 R3
})
)
);
@ -217,17 +136,16 @@ be_local_closure(Matter_UDPPacket_sent_send, /* name */
be_local_class(Matter_UDPPacket_sent,
6,
NULL,
be_nested_map(9,
be_nested_map(8,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(send, 7), be_const_closure(Matter_UDPPacket_sent_send_closure) },
{ be_const_key_weak(msg_id, -1), be_const_var(3) },
{ be_const_key_weak(retries, 8), be_const_var(4) },
{ be_const_key_weak(backoff_time, -1), be_const_closure(Matter_UDPPacket_sent_backoff_time_closure) },
{ be_const_key_weak(next_try, 0), be_const_var(5) },
{ be_const_key_weak(raw, 3), be_const_var(0) },
{ be_const_key_weak(addr, -1), be_const_var(1) },
{ be_const_key_weak(raw, -1), be_const_var(0) },
{ be_const_key_weak(msg_id, 0), be_const_var(3) },
{ be_const_key_weak(init, -1), be_const_closure(Matter_UDPPacket_sent_init_closure) },
{ be_const_key_weak(port, -1), be_const_var(2) },
{ be_const_key_weak(addr, -1), be_const_var(1) },
{ be_const_key_weak(retries, -1), be_const_var(4) },
{ be_const_key_weak(next_try, 4), be_const_var(5) },
{ be_const_key_weak(send, -1), be_const_closure(Matter_UDPPacket_sent_send_closure) },
})),
be_str_weak(Matter_UDPPacket_sent)
);
@ -242,270 +160,132 @@ void be_load_Matter_UDPPacket_sent_class(bvm *vm) {
extern const bclass be_class_Matter_UDPServer;
/********************************************************************
** Solidified function: start
** Solidified function: _backoff_time
********************************************************************/
be_local_closure(Matter_UDPServer_start, /* name */
be_local_closure(Matter_UDPServer__backoff_time, /* name */
be_nested_proto(
6, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[11]) { /* constants */
/* K0 */ be_nested_str_weak(listening),
/* K1 */ be_nested_str_weak(udp_socket),
/* K2 */ be_nested_str_weak(udp),
/* K3 */ be_nested_str_weak(begin),
/* K4 */ be_nested_str_weak(address),
/* K5 */ be_nested_str_weak(port),
/* K6 */ be_nested_str_weak(network_error),
/* K7 */ be_nested_str_weak(could_X20not_X20open_X20UDP_X20server),
/* K8 */ be_nested_str_weak(dispatch_cb),
/* K9 */ be_nested_str_weak(tasmota),
/* K10 */ be_nested_str_weak(add_driver),
}),
be_str_weak(start),
&be_const_str_solidified,
( &(const binstruction[21]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x740A0011, // 0001 JMPT R2 #0014
0xB80A0400, // 0002 GETNGBL R2 K2
0x7C080000, // 0003 CALL R2 0
0x90020202, // 0004 SETMBR R0 K1 R2
0x88080101, // 0005 GETMBR R2 R0 K1
0x8C080503, // 0006 GETMET R2 R2 K3
0x88100104, // 0007 GETMBR R4 R0 K4
0x88140105, // 0008 GETMBR R5 R0 K5
0x7C080600, // 0009 CALL R2 3
0x5C0C0400, // 000A MOVE R3 R2
0x740E0000, // 000B JMPT R3 #000D
0xB0060D07, // 000C RAISE 1 K6 K7
0x500C0200, // 000D LDBOOL R3 1 0
0x90020003, // 000E SETMBR R0 K0 R3
0x90021001, // 000F SETMBR R0 K8 R1
0xB80E1200, // 0010 GETNGBL R3 K9
0x8C0C070A, // 0011 GETMET R3 R3 K10
0x5C140000, // 0012 MOVE R5 R0
0x7C0C0400, // 0013 CALL R3 2
0x80000000, // 0014 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(Matter_UDPServer_init, /* name */
be_nested_proto(
4, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_weak(address),
/* K1 */ be_nested_str_weak(),
/* K2 */ be_nested_str_weak(port),
/* K3 */ be_nested_str_weak(listening),
/* K4 */ be_nested_str_weak(packets_sent),
}),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[16]) { /* code */
0x78060001, // 0000 JMPF R1 #0003
0x5C0C0200, // 0001 MOVE R3 R1
0x70020000, // 0002 JMP #0004
0x580C0001, // 0003 LDCONST R3 K1
0x90020003, // 0004 SETMBR R0 K0 R3
0x780A0001, // 0005 JMPF R2 #0008
0x5C0C0400, // 0006 MOVE R3 R2
0x70020000, // 0007 JMP #0009
0x540E15A3, // 0008 LDINT R3 5540
0x90020403, // 0009 SETMBR R0 K2 R3
0x500C0000, // 000A LDBOOL R3 0 0
0x90020603, // 000B SETMBR R0 K3 R3
0x600C0012, // 000C GETGBL R3 G18
0x7C0C0000, // 000D CALL R3 0
0x90020803, // 000E SETMBR R0 K4 R3
0x80000000, // 000F RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: resend_packets
********************************************************************/
be_local_closure(Matter_UDPServer_resend_packets, /* name */
be_nested_proto(
12, /* nstack */
10, /* nstack */
1, /* argc */
2, /* varg */
4, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[23]) { /* constants */
/* K0 */ be_const_int(0),
/* K1 */ be_nested_str_weak(packets_sent),
/* K2 */ be_nested_str_weak(tasmota),
/* K3 */ be_nested_str_weak(time_reached),
/* K4 */ be_nested_str_weak(next_try),
/* K5 */ be_nested_str_weak(retries),
/* K6 */ be_nested_str_weak(RETRIES),
/* K7 */ be_nested_str_weak(log),
/* K8 */ be_nested_str_weak(MTR_X3A_X20resending_X20packet_X20id_X3D),
/* K9 */ be_nested_str_weak(msg_id),
/* K10 */ be_const_int(3),
/* K11 */ be_nested_str_weak(send),
/* K12 */ be_nested_str_weak(udp_socket),
/* K13 */ be_nested_str_weak(millis),
/* K14 */ be_nested_str_weak(backoff_time),
/* K15 */ be_const_int(1),
/* K16 */ be_nested_str_weak(string),
/* K17 */ be_nested_str_weak(remove),
/* K18 */ be_nested_str_weak(format),
/* K19 */ be_nested_str_weak(MTR_X3A_X20target_X20unreachable_X20_X27_X5B_X25s_X5D_X3A_X25i_X27_X20msg_id_X3D_X25i),
/* K20 */ be_nested_str_weak(addr),
/* K21 */ be_nested_str_weak(port),
/* K22 */ be_const_int(2),
1, /* has sup protos */
( &(const struct bproto*[ 1]) {
be_nested_proto(
4, /* nstack */
2, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_const_int(1),
/* K1 */ be_const_int(0),
}),
be_str_weak(power_int),
&be_const_str_solidified,
( &(const binstruction[ 7]) { /* code */
0x58080000, // 0000 LDCONST R2 K0
0x240C0301, // 0001 GT R3 R1 K1
0x780E0002, // 0002 JMPF R3 #0006
0x08080400, // 0003 MUL R2 R2 R0
0x04040300, // 0004 SUB R1 R1 K0
0x7001FFFA, // 0005 JMP #0001
0x80040400, // 0006 RET 1 R2
})
),
}),
be_str_weak(resend_packets),
&be_const_str_solidified,
( &(const binstruction[60]) { /* code */
0x58040000, // 0000 LDCONST R1 K0
0x6008000C, // 0001 GETGBL R2 G12
0x880C0101, // 0002 GETMBR R3 R0 K1
0x7C080200, // 0003 CALL R2 1
0x14080202, // 0004 LT R2 R1 R2
0x780A0034, // 0005 JMPF R2 #003B
0x88080101, // 0006 GETMBR R2 R0 K1
0x94080401, // 0007 GETIDX R2 R2 R1
0xB80E0400, // 0008 GETNGBL R3 K2
0x8C0C0703, // 0009 GETMET R3 R3 K3
0x88140504, // 000A GETMBR R5 R2 K4
0x7C0C0400, // 000B CALL R3 2
0x780E002B, // 000C JMPF R3 #0039
0x880C0505, // 000D GETMBR R3 R2 K5
0x88100106, // 000E GETMBR R4 R0 K6
0x180C0604, // 000F LE R3 R3 R4
0x780E0017, // 0010 JMPF R3 #0029
0xB80E0400, // 0011 GETNGBL R3 K2
0x8C0C0707, // 0012 GETMET R3 R3 K7
0x60140008, // 0013 GETGBL R5 G8
0x88180509, // 0014 GETMBR R6 R2 K9
0x7C140200, // 0015 CALL R5 1
0x00161005, // 0016 ADD R5 K8 R5
0x5818000A, // 0017 LDCONST R6 K10
0x7C0C0600, // 0018 CALL R3 3
0x8C0C050B, // 0019 GETMET R3 R2 K11
0x8814010C, // 001A GETMBR R5 R0 K12
0x7C0C0400, // 001B CALL R3 2
0xB80E0400, // 001C GETNGBL R3 K2
0x8C0C070D, // 001D GETMET R3 R3 K13
0x7C0C0200, // 001E CALL R3 1
0x8C10050E, // 001F GETMET R4 R2 K14
0x88180505, // 0020 GETMBR R6 R2 K5
0x7C100400, // 0021 CALL R4 2
0x000C0604, // 0022 ADD R3 R3 R4
0x900A0803, // 0023 SETMBR R2 K4 R3
0x880C0505, // 0024 GETMBR R3 R2 K5
0x000C070F, // 0025 ADD R3 R3 K15
0x900A0A03, // 0026 SETMBR R2 K5 R3
0x0004030F, // 0027 ADD R1 R1 K15
0x7002000E, // 0028 JMP #0038
0xA40E2000, // 0029 IMPORT R3 K16
0x88100101, // 002A GETMBR R4 R0 K1
0x8C100911, // 002B GETMET R4 R4 K17
0x5C180200, // 002C MOVE R6 R1
0x7C100400, // 002D CALL R4 2
0xB8120400, // 002E GETNGBL R4 K2
0x8C100907, // 002F GETMET R4 R4 K7
0x8C180712, // 0030 GETMET R6 R3 K18
0x58200013, // 0031 LDCONST R8 K19
0x88240514, // 0032 GETMBR R9 R2 K20
0x88280515, // 0033 GETMBR R10 R2 K21
0x882C0509, // 0034 GETMBR R11 R2 K9
0x7C180A00, // 0035 CALL R6 5
0x581C0016, // 0036 LDCONST R7 K22
0x7C100600, // 0037 CALL R4 3
0x70020000, // 0038 JMP #003A
0x0004030F, // 0039 ADD R1 R1 K15
0x7001FFC5, // 003A JMP #0001
0x80000000, // 003B RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: packet_ack
********************************************************************/
be_local_closure(Matter_UDPServer_packet_ack, /* name */
be_nested_proto(
7, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 8]) { /* constants */
/* K0 */ be_const_int(0),
/* K1 */ be_nested_str_weak(packets_sent),
/* K2 */ be_nested_str_weak(msg_id),
/* K3 */ be_nested_str_weak(remove),
/* K4 */ be_nested_str_weak(tasmota),
/* K5 */ be_nested_str_weak(log),
/* K6 */ be_nested_str_weak(MTR_X3A_X20removed_X20packet_X20from_X20sending_X20list_X20id_X3D),
/* K7 */ be_const_int(1),
/* K0 */ be_const_class(be_class_Matter_UDPServer),
/* K1 */ be_nested_str_weak(math),
/* K2 */ be_nested_str_weak(rand),
/* K3 */ be_const_int(0),
/* K4 */ be_const_int(1),
/* K5 */ be_const_real_hex(0x3FCCCCCD),
/* K6 */ be_const_real_hex(0x3F800000),
/* K7 */ be_const_real_hex(0x3E800000),
}),
be_str_weak(packet_ack),
be_str_weak(_backoff_time),
&be_const_str_solidified,
( &(const binstruction[31]) { /* code */
0x4C080000, // 0000 LDNIL R2
0x1C080202, // 0001 EQ R2 R1 R2
0x780A0000, // 0002 JMPF R2 #0004
0x80000400, // 0003 RET 0
0x58080000, // 0004 LDCONST R2 K0
0x600C000C, // 0005 GETGBL R3 G12
0x88100101, // 0006 GETMBR R4 R0 K1
0x7C0C0200, // 0007 CALL R3 1
0x140C0403, // 0008 LT R3 R2 R3
0x780E0013, // 0009 JMPF R3 #001E
0x880C0101, // 000A GETMBR R3 R0 K1
0x940C0602, // 000B GETIDX R3 R3 R2
0x880C0702, // 000C GETMBR R3 R3 K2
0x1C0C0601, // 000D EQ R3 R3 R1
0x780E000C, // 000E JMPF R3 #001C
0x880C0101, // 000F GETMBR R3 R0 K1
0x8C0C0703, // 0010 GETMET R3 R3 K3
0x5C140400, // 0011 MOVE R5 R2
0x7C0C0400, // 0012 CALL R3 2
0xB80E0800, // 0013 GETNGBL R3 K4
0x8C0C0705, // 0014 GETMET R3 R3 K5
0x60140008, // 0015 GETGBL R5 G8
0x5C180200, // 0016 MOVE R6 R1
0x7C140200, // 0017 CALL R5 1
0x00160C05, // 0018 ADD R5 K6 R5
0x541A0003, // 0019 LDINT R6 4
0x7C0C0600, // 001A CALL R3 3
0x70020000, // 001B JMP #001D
0x00080507, // 001C ADD R2 R2 K7
0x7001FFE6, // 001D JMP #0005
0x80000000, // 001E RET 0
( &(const binstruction[29]) { /* code */
0x58040000, // 0000 LDCONST R1 K0
0x84080000, // 0001 CLOSURE R2 P0
0xA40E0200, // 0002 IMPORT R3 K1
0x5412012B, // 0003 LDINT R4 300
0x6014000A, // 0004 GETGBL R5 G10
0x8C180702, // 0005 GETMET R6 R3 K2
0x7C180200, // 0006 CALL R6 1
0x541E00FE, // 0007 LDINT R7 255
0x2C180C07, // 0008 AND R6 R6 R7
0x7C140200, // 0009 CALL R5 1
0x541A00FE, // 000A LDINT R6 255
0x0C140A06, // 000B DIV R5 R5 R6
0x24180103, // 000C GT R6 R0 K3
0x781A0001, // 000D JMPF R6 #0010
0x04180104, // 000E SUB R6 R0 K4
0x70020000, // 000F JMP #0011
0x58180003, // 0010 LDCONST R6 K3
0x5C1C0400, // 0011 MOVE R7 R2
0x58200005, // 0012 LDCONST R8 K5
0x5C240C00, // 0013 MOVE R9 R6
0x7C1C0400, // 0014 CALL R7 2
0x081C0807, // 0015 MUL R7 R4 R7
0x08200B07, // 0016 MUL R8 R5 K7
0x00220C08, // 0017 ADD R8 K6 R8
0x081C0E08, // 0018 MUL R7 R7 R8
0x60200009, // 0019 GETGBL R8 G9
0x5C240E00, // 001A MOVE R9 R7
0x7C200200, // 001B CALL R8 1
0x80041000, // 001C RET 1 R8
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: send_response
********************************************************************/
be_local_closure(Matter_UDPServer_send_response, /* name */
be_nested_proto(
11, /* nstack */
5, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 6]) { /* constants */
/* K0 */ be_nested_str_weak(matter),
/* K1 */ be_nested_str_weak(UDPPacket_sent),
/* K2 */ be_nested_str_weak(send),
/* K3 */ be_nested_str_weak(udp_socket),
/* K4 */ be_nested_str_weak(packets_sent),
/* K5 */ be_nested_str_weak(push),
}),
be_str_weak(send_response),
&be_const_str_solidified,
( &(const binstruction[16]) { /* code */
0xB8160000, // 0000 GETNGBL R5 K0
0x8C140B01, // 0001 GETMET R5 R5 K1
0x5C1C0200, // 0002 MOVE R7 R1
0x5C200400, // 0003 MOVE R8 R2
0x5C240600, // 0004 MOVE R9 R3
0x5C280800, // 0005 MOVE R10 R4
0x7C140A00, // 0006 CALL R5 5
0x8C180B02, // 0007 GETMET R6 R5 K2
0x88200103, // 0008 GETMBR R8 R0 K3
0x7C180400, // 0009 CALL R6 2
0x78120003, // 000A JMPF R4 #000F
0x88180104, // 000B GETMBR R6 R0 K4
0x8C180D05, // 000C GETMET R6 R6 K5
0x5C200A00, // 000D MOVE R8 R5
0x7C180400, // 000E CALL R6 2
0x80000000, // 000F RET 0
})
)
);
@ -540,7 +320,7 @@ be_local_closure(Matter_UDPServer_every_50ms, /* name */
/* K11 */ be_const_int(3),
/* K12 */ be_nested_str_weak(dispatch_cb),
/* K13 */ be_nested_str_weak(MAX_PACKETS_READ),
/* K14 */ be_nested_str_weak(resend_packets),
/* K14 */ be_nested_str_weak(_resend_packets),
}),
be_str_weak(every_50ms),
&be_const_str_solidified,
@ -664,44 +444,43 @@ be_local_closure(Matter_UDPServer_stop, /* name */
/********************************************************************
** Solidified function: send_response
** Solidified function: init
********************************************************************/
be_local_closure(Matter_UDPServer_send_response, /* name */
be_local_closure(Matter_UDPServer_init, /* name */
be_nested_proto(
11, /* nstack */
5, /* argc */
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[ 6]) { /* constants */
/* K0 */ be_nested_str_weak(matter),
/* K1 */ be_nested_str_weak(UDPPacket_sent),
/* K2 */ be_nested_str_weak(send),
/* K3 */ be_nested_str_weak(udp_socket),
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_weak(addr),
/* K1 */ be_nested_str_weak(),
/* K2 */ be_nested_str_weak(port),
/* K3 */ be_nested_str_weak(listening),
/* K4 */ be_nested_str_weak(packets_sent),
/* K5 */ be_nested_str_weak(push),
}),
be_str_weak(send_response),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[16]) { /* code */
0xB8160000, // 0000 GETNGBL R5 K0
0x8C140B01, // 0001 GETMET R5 R5 K1
0x5C1C0200, // 0002 MOVE R7 R1
0x5C200400, // 0003 MOVE R8 R2
0x5C240600, // 0004 MOVE R9 R3
0x5C280800, // 0005 MOVE R10 R4
0x7C140A00, // 0006 CALL R5 5
0x8C180B02, // 0007 GETMET R6 R5 K2
0x88200103, // 0008 GETMBR R8 R0 K3
0x7C180400, // 0009 CALL R6 2
0x78120003, // 000A JMPF R4 #000F
0x88180104, // 000B GETMBR R6 R0 K4
0x8C180D05, // 000C GETMET R6 R6 K5
0x5C200A00, // 000D MOVE R8 R5
0x7C180400, // 000E CALL R6 2
0x78060001, // 0000 JMPF R1 #0003
0x5C0C0200, // 0001 MOVE R3 R1
0x70020000, // 0002 JMP #0004
0x580C0001, // 0003 LDCONST R3 K1
0x90020003, // 0004 SETMBR R0 K0 R3
0x780A0001, // 0005 JMPF R2 #0008
0x5C0C0400, // 0006 MOVE R3 R2
0x70020000, // 0007 JMP #0009
0x540E15A3, // 0008 LDINT R3 5540
0x90020403, // 0009 SETMBR R0 K2 R3
0x500C0000, // 000A LDBOOL R3 0 0
0x90020603, // 000B SETMBR R0 K3 R3
0x600C0012, // 000C GETGBL R3 G18
0x7C0C0000, // 000D CALL R3 0
0x90020803, // 000E SETMBR R0 K4 R3
0x80000000, // 000F RET 0
})
)
@ -709,30 +488,267 @@ be_local_closure(Matter_UDPServer_send_response, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: _resend_packets
********************************************************************/
be_local_closure(Matter_UDPServer__resend_packets, /* name */
be_nested_proto(
12, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[23]) { /* constants */
/* K0 */ be_const_int(0),
/* K1 */ be_nested_str_weak(packets_sent),
/* K2 */ be_nested_str_weak(tasmota),
/* K3 */ be_nested_str_weak(time_reached),
/* K4 */ be_nested_str_weak(next_try),
/* K5 */ be_nested_str_weak(retries),
/* K6 */ be_nested_str_weak(RETRIES),
/* K7 */ be_nested_str_weak(log),
/* K8 */ be_nested_str_weak(MTR_X3A_X20_X2E_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20Resending_X20packet_X20id_X3D),
/* K9 */ be_nested_str_weak(msg_id),
/* K10 */ be_const_int(3),
/* K11 */ be_nested_str_weak(send),
/* K12 */ be_nested_str_weak(udp_socket),
/* K13 */ be_nested_str_weak(millis),
/* K14 */ be_nested_str_weak(_backoff_time),
/* K15 */ be_const_int(1),
/* K16 */ be_nested_str_weak(string),
/* K17 */ be_nested_str_weak(remove),
/* K18 */ be_nested_str_weak(format),
/* K19 */ be_nested_str_weak(MTR_X3A_X20_X2E_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20Unacked_X20packet_X20_X27_X5B_X25s_X5D_X3A_X25i_X27_X20msg_id_X3D_X25i),
/* K20 */ be_nested_str_weak(addr),
/* K21 */ be_nested_str_weak(port),
/* K22 */ be_const_int(2),
}),
be_str_weak(_resend_packets),
&be_const_str_solidified,
( &(const binstruction[60]) { /* code */
0x58040000, // 0000 LDCONST R1 K0
0x6008000C, // 0001 GETGBL R2 G12
0x880C0101, // 0002 GETMBR R3 R0 K1
0x7C080200, // 0003 CALL R2 1
0x14080202, // 0004 LT R2 R1 R2
0x780A0034, // 0005 JMPF R2 #003B
0x88080101, // 0006 GETMBR R2 R0 K1
0x94080401, // 0007 GETIDX R2 R2 R1
0xB80E0400, // 0008 GETNGBL R3 K2
0x8C0C0703, // 0009 GETMET R3 R3 K3
0x88140504, // 000A GETMBR R5 R2 K4
0x7C0C0400, // 000B CALL R3 2
0x780E002B, // 000C JMPF R3 #0039
0x880C0505, // 000D GETMBR R3 R2 K5
0x88100106, // 000E GETMBR R4 R0 K6
0x180C0604, // 000F LE R3 R3 R4
0x780E0017, // 0010 JMPF R3 #0029
0xB80E0400, // 0011 GETNGBL R3 K2
0x8C0C0707, // 0012 GETMET R3 R3 K7
0x60140008, // 0013 GETGBL R5 G8
0x88180509, // 0014 GETMBR R6 R2 K9
0x7C140200, // 0015 CALL R5 1
0x00161005, // 0016 ADD R5 K8 R5
0x5818000A, // 0017 LDCONST R6 K10
0x7C0C0600, // 0018 CALL R3 3
0x8C0C050B, // 0019 GETMET R3 R2 K11
0x8814010C, // 001A GETMBR R5 R0 K12
0x7C0C0400, // 001B CALL R3 2
0xB80E0400, // 001C GETNGBL R3 K2
0x8C0C070D, // 001D GETMET R3 R3 K13
0x7C0C0200, // 001E CALL R3 1
0x8C10010E, // 001F GETMET R4 R0 K14
0x88180505, // 0020 GETMBR R6 R2 K5
0x7C100400, // 0021 CALL R4 2
0x000C0604, // 0022 ADD R3 R3 R4
0x900A0803, // 0023 SETMBR R2 K4 R3
0x880C0505, // 0024 GETMBR R3 R2 K5
0x000C070F, // 0025 ADD R3 R3 K15
0x900A0A03, // 0026 SETMBR R2 K5 R3
0x0004030F, // 0027 ADD R1 R1 K15
0x7002000E, // 0028 JMP #0038
0xA40E2000, // 0029 IMPORT R3 K16
0x88100101, // 002A GETMBR R4 R0 K1
0x8C100911, // 002B GETMET R4 R4 K17
0x5C180200, // 002C MOVE R6 R1
0x7C100400, // 002D CALL R4 2
0xB8120400, // 002E GETNGBL R4 K2
0x8C100907, // 002F GETMET R4 R4 K7
0x8C180712, // 0030 GETMET R6 R3 K18
0x58200013, // 0031 LDCONST R8 K19
0x88240514, // 0032 GETMBR R9 R2 K20
0x88280515, // 0033 GETMBR R10 R2 K21
0x882C0509, // 0034 GETMBR R11 R2 K9
0x7C180A00, // 0035 CALL R6 5
0x581C0016, // 0036 LDCONST R7 K22
0x7C100600, // 0037 CALL R4 3
0x70020000, // 0038 JMP #003A
0x0004030F, // 0039 ADD R1 R1 K15
0x7001FFC5, // 003A JMP #0001
0x80000000, // 003B RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: start
********************************************************************/
be_local_closure(Matter_UDPServer_start, /* name */
be_nested_proto(
6, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[11]) { /* constants */
/* K0 */ be_nested_str_weak(listening),
/* K1 */ be_nested_str_weak(udp_socket),
/* K2 */ be_nested_str_weak(udp),
/* K3 */ be_nested_str_weak(begin),
/* K4 */ be_nested_str_weak(addr),
/* K5 */ be_nested_str_weak(port),
/* K6 */ be_nested_str_weak(network_error),
/* K7 */ be_nested_str_weak(could_X20not_X20open_X20UDP_X20server),
/* K8 */ be_nested_str_weak(dispatch_cb),
/* K9 */ be_nested_str_weak(tasmota),
/* K10 */ be_nested_str_weak(add_driver),
}),
be_str_weak(start),
&be_const_str_solidified,
( &(const binstruction[21]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x740A0011, // 0001 JMPT R2 #0014
0xB80A0400, // 0002 GETNGBL R2 K2
0x7C080000, // 0003 CALL R2 0
0x90020202, // 0004 SETMBR R0 K1 R2
0x88080101, // 0005 GETMBR R2 R0 K1
0x8C080503, // 0006 GETMET R2 R2 K3
0x88100104, // 0007 GETMBR R4 R0 K4
0x88140105, // 0008 GETMBR R5 R0 K5
0x7C080600, // 0009 CALL R2 3
0x5C0C0400, // 000A MOVE R3 R2
0x740E0000, // 000B JMPT R3 #000D
0xB0060D07, // 000C RAISE 1 K6 K7
0x500C0200, // 000D LDBOOL R3 1 0
0x90020003, // 000E SETMBR R0 K0 R3
0x90021001, // 000F SETMBR R0 K8 R1
0xB80E1200, // 0010 GETNGBL R3 K9
0x8C0C070A, // 0011 GETMET R3 R3 K10
0x5C140000, // 0012 MOVE R5 R0
0x7C0C0400, // 0013 CALL R3 2
0x80000000, // 0014 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: received_ack
********************************************************************/
be_local_closure(Matter_UDPServer_received_ack, /* name */
be_nested_proto(
7, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[10]) { /* constants */
/* K0 */ be_nested_str_weak(tasmota),
/* K1 */ be_nested_str_weak(log),
/* K2 */ be_nested_str_weak(MTR_X3A_X20receveived_X20ACK_X20id_X3D),
/* K3 */ be_const_int(3),
/* K4 */ be_const_int(0),
/* K5 */ be_nested_str_weak(packets_sent),
/* K6 */ be_nested_str_weak(msg_id),
/* K7 */ be_nested_str_weak(remove),
/* K8 */ be_nested_str_weak(MTR_X3A_X20_X2E_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20Removed_X20packet_X20from_X20sending_X20list_X20id_X3D),
/* K9 */ be_const_int(1),
}),
be_str_weak(received_ack),
&be_const_str_solidified,
( &(const binstruction[39]) { /* code */
0x4C080000, // 0000 LDNIL R2
0x1C080202, // 0001 EQ R2 R1 R2
0x780A0000, // 0002 JMPF R2 #0004
0x80000400, // 0003 RET 0
0xB80A0000, // 0004 GETNGBL R2 K0
0x8C080501, // 0005 GETMET R2 R2 K1
0x60100008, // 0006 GETGBL R4 G8
0x5C140200, // 0007 MOVE R5 R1
0x7C100200, // 0008 CALL R4 1
0x00120404, // 0009 ADD R4 K2 R4
0x58140003, // 000A LDCONST R5 K3
0x7C080600, // 000B CALL R2 3
0x58080004, // 000C LDCONST R2 K4
0x600C000C, // 000D GETGBL R3 G12
0x88100105, // 000E GETMBR R4 R0 K5
0x7C0C0200, // 000F CALL R3 1
0x140C0403, // 0010 LT R3 R2 R3
0x780E0013, // 0011 JMPF R3 #0026
0x880C0105, // 0012 GETMBR R3 R0 K5
0x940C0602, // 0013 GETIDX R3 R3 R2
0x880C0706, // 0014 GETMBR R3 R3 K6
0x1C0C0601, // 0015 EQ R3 R3 R1
0x780E000C, // 0016 JMPF R3 #0024
0x880C0105, // 0017 GETMBR R3 R0 K5
0x8C0C0707, // 0018 GETMET R3 R3 K7
0x5C140400, // 0019 MOVE R5 R2
0x7C0C0400, // 001A CALL R3 2
0xB80E0000, // 001B GETNGBL R3 K0
0x8C0C0701, // 001C GETMET R3 R3 K1
0x60140008, // 001D GETGBL R5 G8
0x5C180200, // 001E MOVE R6 R1
0x7C140200, // 001F CALL R5 1
0x00161005, // 0020 ADD R5 K8 R5
0x58180003, // 0021 LDCONST R6 K3
0x7C0C0600, // 0022 CALL R3 3
0x70020000, // 0023 JMP #0025
0x00080509, // 0024 ADD R2 R2 K9
0x7001FFE6, // 0025 JMP #000D
0x80000000, // 0026 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: Matter_UDPServer
********************************************************************/
be_local_class(Matter_UDPServer,
6,
NULL,
be_nested_map(16,
be_nested_map(17,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(MAX_PACKETS_READ, 14), be_const_int(4) },
{ be_const_key_weak(send_response, -1), be_const_closure(Matter_UDPServer_send_response_closure) },
{ be_const_key_weak(stop, -1), be_const_closure(Matter_UDPServer_stop_closure) },
{ be_const_key_weak(init, 12), be_const_closure(Matter_UDPServer_init_closure) },
{ be_const_key_weak(resend_packets, -1), be_const_closure(Matter_UDPServer_resend_packets_closure) },
{ be_const_key_weak(RETRIES, 2), be_const_int(4) },
{ be_const_key_weak(port, -1), be_const_var(1) },
{ be_const_key_weak(packet_ack, -1), be_const_closure(Matter_UDPServer_packet_ack_closure) },
{ be_const_key_weak(every_50ms, -1), be_const_closure(Matter_UDPServer_every_50ms_closure) },
{ be_const_key_weak(every_second, -1), be_const_closure(Matter_UDPServer_every_second_closure) },
{ be_const_key_weak(RETRIES, -1), be_const_int(4) },
{ be_const_key_weak(_backoff_time, 6), be_const_static_closure(Matter_UDPServer__backoff_time_closure) },
{ be_const_key_weak(listening, -1), be_const_var(2) },
{ be_const_key_weak(dispatch_cb, -1), be_const_var(4) },
{ be_const_key_weak(address, -1), be_const_var(0) },
{ be_const_key_weak(packets_sent, 11), be_const_var(5) },
{ be_const_key_weak(send_response, -1), be_const_closure(Matter_UDPServer_send_response_closure) },
{ be_const_key_weak(received_ack, -1), be_const_closure(Matter_UDPServer_received_ack_closure) },
{ be_const_key_weak(every_second, -1), be_const_closure(Matter_UDPServer_every_second_closure) },
{ be_const_key_weak(every_50ms, -1), be_const_closure(Matter_UDPServer_every_50ms_closure) },
{ be_const_key_weak(packets_sent, -1), be_const_var(5) },
{ be_const_key_weak(port, -1), be_const_var(1) },
{ be_const_key_weak(udp_socket, -1), be_const_var(3) },
{ be_const_key_weak(start, 1), be_const_closure(Matter_UDPServer_start_closure) },
{ be_const_key_weak(_resend_packets, 11), be_const_closure(Matter_UDPServer__resend_packets_closure) },
{ be_const_key_weak(stop, -1), be_const_closure(Matter_UDPServer_stop_closure) },
{ be_const_key_weak(addr, -1), be_const_var(0) },
{ be_const_key_weak(MAX_PACKETS_READ, 10), be_const_int(4) },
{ be_const_key_weak(start, -1), be_const_closure(Matter_UDPServer_start_closure) },
{ be_const_key_weak(init, 4), be_const_closure(Matter_UDPServer_init_closure) },
{ be_const_key_weak(dispatch_cb, 0), be_const_var(4) },
})),
be_str_weak(Matter_UDPServer)
);

View File

@ -11,7 +11,7 @@ extern const bclass be_class_Matter_UI;
********************************************************************/
be_local_closure(Matter_UI_show_fabric_info, /* name */
be_nested_proto(
16, /* nstack */
17, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
@ -19,7 +19,7 @@ be_local_closure(Matter_UI_show_fabric_info, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[29]) { /* constants */
( &(const bvalue[30]) { /* constants */
/* K0 */ be_nested_str_weak(webserver),
/* K1 */ be_nested_str_weak(string),
/* K2 */ be_nested_str_weak(content_send),
@ -32,27 +32,28 @@ be_local_closure(Matter_UI_show_fabric_info, /* name */
/* K9 */ be_nested_str_weak(fabrics),
/* K10 */ be_nested_str_weak(persistables),
/* K11 */ be_nested_str_weak(_X3Chr_X3E),
/* K12 */ be_nested_str_weak(format),
/* K13 */ be_nested_str_weak(_X3Cfieldset_X3E_X3Clegend_X3E_X3Cb_X3E_X26nbsp_X3B_X23_X25i_X20_X25s_X26nbsp_X3B_X3C_X2Fb_X3E_X3C_X2Flegend_X3E_X3Cp_X3E_X3C_X2Fp_X3E),
/* K14 */ be_nested_str_weak(get_fabric_index),
/* K15 */ be_nested_str_weak(_X26lt_X3BNo_X20label_X26gt_X3B),
/* K16 */ be_nested_str_weak(get_fabric_id),
/* K17 */ be_nested_str_weak(copy),
/* K18 */ be_nested_str_weak(reverse),
/* K19 */ be_nested_str_weak(get_device_id),
/* K20 */ be_nested_str_weak(Fabric_X3A_X20_X25s_X3Cbr_X3E),
/* K21 */ be_nested_str_weak(tohex),
/* K22 */ be_nested_str_weak(Device_X3A_X20_X25s_X3Cbr_X3E_X26nbsp_X3B),
/* K23 */ be_nested_str_weak(_X3Cform_X20action_X3D_X27_X2Fmatterc_X27_X20method_X3D_X27post_X27_X20),
/* K24 */ be_nested_str_weak(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E),
/* K25 */ be_nested_str_weak(_X3Cinput_X20name_X3D_X27del_fabric_X27_X20type_X3D_X27hidden_X27_X20value_X3D_X27_X25s_X27_X3E),
/* K26 */ be_nested_str_weak(_X3Cbutton_X20name_X3D_X27del_X27_X20class_X3D_X27button_X20bgrn_X27_X3EDelete_X20Fabric_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E),
/* K27 */ be_nested_str_weak(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E),
/* K28 */ be_nested_str_weak(stop_iteration),
/* K12 */ be_nested_str_weak(fabric_label),
/* K13 */ be_nested_str_weak(_X26lt_X3BNo_X20label_X26gt_X3B),
/* K14 */ be_nested_str_weak(format),
/* K15 */ be_nested_str_weak(_X3Cfieldset_X3E_X3Clegend_X3E_X3Cb_X3E_X26nbsp_X3B_X23_X25i_X20_X25s_X26nbsp_X3B_X3C_X2Fb_X3E_X3C_X2Flegend_X3E_X3Cp_X3E_X3C_X2Fp_X3E),
/* K16 */ be_nested_str_weak(get_fabric_index),
/* K17 */ be_nested_str_weak(get_fabric_id),
/* K18 */ be_nested_str_weak(copy),
/* K19 */ be_nested_str_weak(reverse),
/* K20 */ be_nested_str_weak(get_device_id),
/* K21 */ be_nested_str_weak(Fabric_X3A_X20_X25s_X3Cbr_X3E),
/* K22 */ be_nested_str_weak(tohex),
/* K23 */ be_nested_str_weak(Device_X3A_X20_X25s_X3Cbr_X3E_X26nbsp_X3B),
/* K24 */ be_nested_str_weak(_X3Cform_X20action_X3D_X27_X2Fmatterc_X27_X20method_X3D_X27post_X27_X20),
/* K25 */ be_nested_str_weak(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E),
/* K26 */ be_nested_str_weak(_X3Cinput_X20name_X3D_X27del_fabric_X27_X20type_X3D_X27hidden_X27_X20value_X3D_X27_X25s_X27_X3E),
/* K27 */ be_nested_str_weak(_X3Cbutton_X20name_X3D_X27del_X27_X20class_X3D_X27button_X20bgrn_X27_X3EDelete_X20Fabric_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E),
/* K28 */ be_nested_str_weak(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E),
/* K29 */ be_nested_str_weak(stop_iteration),
}),
be_str_weak(show_fabric_info),
&be_const_str_solidified,
( &(const binstruction[97]) { /* code */
( &(const binstruction[101]) { /* code */
0xA40A0000, // 0000 IMPORT R2 K0
0xA40E0200, // 0001 IMPORT R3 K1
0x8C100502, // 0002 GETMET R4 R2 K2
@ -71,7 +72,7 @@ be_local_closure(Matter_UI_show_fabric_info, /* name */
0x8C100502, // 000F GETMET R4 R2 K2
0x58180008, // 0010 LDCONST R6 K8
0x7C100400, // 0011 CALL R4 2
0x70020049, // 0012 JMP #005D
0x7002004D, // 0012 JMP #0061
0x50100200, // 0013 LDBOOL R4 1 0
0x60140010, // 0014 GETGBL R5 G16
0x88180105, // 0015 GETMBR R6 R0 K5
@ -80,7 +81,7 @@ be_local_closure(Matter_UI_show_fabric_info, /* name */
0x8C180D0A, // 0018 GETMET R6 R6 K10
0x7C180200, // 0019 CALL R6 1
0x7C140200, // 001A CALL R5 1
0xA802003D, // 001B EXBLK 0 #005A
0xA8020041, // 001B EXBLK 0 #005E
0x5C180A00, // 001C MOVE R6 R5
0x7C180000, // 001D CALL R6 0
0x5C1C0800, // 001E MOVE R7 R4
@ -89,67 +90,71 @@ be_local_closure(Matter_UI_show_fabric_info, /* name */
0x5824000B, // 0021 LDCONST R9 K11
0x7C1C0400, // 0022 CALL R7 2
0x50100000, // 0023 LDBOOL R4 0 0
0x8C1C0502, // 0024 GETMET R7 R2 K2
0x8C24070C, // 0025 GETMET R9 R3 K12
0x582C000D, // 0026 LDCONST R11 K13
0x8C300D0E, // 0027 GETMET R12 R6 K14
0x7C300200, // 0028 CALL R12 1
0x5834000F, // 0029 LDCONST R13 K15
0x7C240800, // 002A CALL R9 4
0x7C1C0400, // 002B CALL R7 2
0x8C1C0D10, // 002C GETMET R7 R6 K16
0x7C1C0200, // 002D CALL R7 1
0x8C1C0F11, // 002E GETMET R7 R7 K17
0x7C1C0200, // 002F CALL R7 1
0x8C1C0F12, // 0030 GETMET R7 R7 K18
0x7C1C0200, // 0031 CALL R7 1
0x8C200D13, // 0032 GETMET R8 R6 K19
0x881C0D0C, // 0024 GETMBR R7 R6 K12
0x5C200E00, // 0025 MOVE R8 R7
0x74220000, // 0026 JMPT R8 #0028
0x581C000D, // 0027 LDCONST R7 K13
0x8C200502, // 0028 GETMET R8 R2 K2
0x8C28070E, // 0029 GETMET R10 R3 K14
0x5830000F, // 002A LDCONST R12 K15
0x8C340D10, // 002B GETMET R13 R6 K16
0x7C340200, // 002C CALL R13 1
0x5C380E00, // 002D MOVE R14 R7
0x7C280800, // 002E CALL R10 4
0x7C200400, // 002F CALL R8 2
0x8C200D11, // 0030 GETMET R8 R6 K17
0x7C200200, // 0031 CALL R8 1
0x8C201112, // 0032 GETMET R8 R8 K18
0x7C200200, // 0033 CALL R8 1
0x8C201111, // 0034 GETMET R8 R8 K17
0x8C201113, // 0034 GETMET R8 R8 K19
0x7C200200, // 0035 CALL R8 1
0x8C201112, // 0036 GETMET R8 R8 K18
0x7C200200, // 0037 CALL R8 1
0x8C240502, // 0038 GETMET R9 R2 K2
0x8C2C070C, // 0039 GETMET R11 R3 K12
0x58340014, // 003A LDCONST R13 K20
0x8C380F15, // 003B GETMET R14 R7 K21
0x7C380200, // 003C CALL R14 1
0x7C2C0600, // 003D CALL R11 3
0x7C240400, // 003E CALL R9 2
0x8C240502, // 003F GETMET R9 R2 K2
0x8C2C070C, // 0040 GETMET R11 R3 K12
0x58340016, // 0041 LDCONST R13 K22
0x8C381115, // 0042 GETMET R14 R8 K21
0x7C380200, // 0043 CALL R14 1
0x7C2C0600, // 0044 CALL R11 3
0x7C240400, // 0045 CALL R9 2
0x8C240502, // 0046 GETMET R9 R2 K2
0x582C0017, // 0047 LDCONST R11 K23
0x7C240400, // 0048 CALL R9 2
0x8C240502, // 0049 GETMET R9 R2 K2
0x582C0018, // 004A LDCONST R11 K24
0x7C240400, // 004B CALL R9 2
0x8C240502, // 004C GETMET R9 R2 K2
0x8C2C070C, // 004D GETMET R11 R3 K12
0x58340019, // 004E LDCONST R13 K25
0x8C380F15, // 004F GETMET R14 R7 K21
0x7C380200, // 0050 CALL R14 1
0x7C2C0600, // 0051 CALL R11 3
0x7C240400, // 0052 CALL R9 2
0x8C240502, // 0053 GETMET R9 R2 K2
0x582C001A, // 0054 LDCONST R11 K26
0x7C240400, // 0055 CALL R9 2
0x8C240502, // 0056 GETMET R9 R2 K2
0x582C001B, // 0057 LDCONST R11 K27
0x7C240400, // 0058 CALL R9 2
0x7001FFC1, // 0059 JMP #001C
0x5814001C, // 005A LDCONST R5 K28
0xAC140200, // 005B CATCH R5 1 0
0xB0080000, // 005C RAISE 2 R0 R0
0x8C100502, // 005D GETMET R4 R2 K2
0x5818001B, // 005E LDCONST R6 K27
0x7C100400, // 005F CALL R4 2
0x80000000, // 0060 RET 0
0x8C240D14, // 0036 GETMET R9 R6 K20
0x7C240200, // 0037 CALL R9 1
0x8C241312, // 0038 GETMET R9 R9 K18
0x7C240200, // 0039 CALL R9 1
0x8C241313, // 003A GETMET R9 R9 K19
0x7C240200, // 003B CALL R9 1
0x8C280502, // 003C GETMET R10 R2 K2
0x8C30070E, // 003D GETMET R12 R3 K14
0x58380015, // 003E LDCONST R14 K21
0x8C3C1116, // 003F GETMET R15 R8 K22
0x7C3C0200, // 0040 CALL R15 1
0x7C300600, // 0041 CALL R12 3
0x7C280400, // 0042 CALL R10 2
0x8C280502, // 0043 GETMET R10 R2 K2
0x8C30070E, // 0044 GETMET R12 R3 K14
0x58380017, // 0045 LDCONST R14 K23
0x8C3C1316, // 0046 GETMET R15 R9 K22
0x7C3C0200, // 0047 CALL R15 1
0x7C300600, // 0048 CALL R12 3
0x7C280400, // 0049 CALL R10 2
0x8C280502, // 004A GETMET R10 R2 K2
0x58300018, // 004B LDCONST R12 K24
0x7C280400, // 004C CALL R10 2
0x8C280502, // 004D GETMET R10 R2 K2
0x58300019, // 004E LDCONST R12 K25
0x7C280400, // 004F CALL R10 2
0x8C280502, // 0050 GETMET R10 R2 K2
0x8C30070E, // 0051 GETMET R12 R3 K14
0x5838001A, // 0052 LDCONST R14 K26
0x8C3C1116, // 0053 GETMET R15 R8 K22
0x7C3C0200, // 0054 CALL R15 1
0x7C300600, // 0055 CALL R12 3
0x7C280400, // 0056 CALL R10 2
0x8C280502, // 0057 GETMET R10 R2 K2
0x5830001B, // 0058 LDCONST R12 K27
0x7C280400, // 0059 CALL R10 2
0x8C280502, // 005A GETMET R10 R2 K2
0x5830001C, // 005B LDCONST R12 K28
0x7C280400, // 005C CALL R10 2
0x7001FFBD, // 005D JMP #001C
0x5814001D, // 005E LDCONST R5 K29
0xAC140200, // 005F CATCH R5 1 0
0xB0080000, // 0060 RAISE 2 R0 R0
0x8C100502, // 0061 GETMET R4 R2 K2
0x5818001C, // 0062 LDCONST R6 K28
0x7C100400, // 0063 CALL R4 2
0x80000000, // 0064 RET 0
})
)
);