Many matter improvements (#17935)

This commit is contained in:
s-hadinger 2023-02-12 20:45:28 +01:00 committed by GitHub
parent b72cf69d2c
commit 3ea69f7d7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 9137 additions and 7480 deletions

View File

@ -63,7 +63,7 @@ class Matter_Commisioning_Context
self.window_open = true # auto-commissioning for now
end
def process_incoming(msg, remote_ip, remote_port)
def process_incoming(msg)
#
if !self.window_open
tasmota.log("MTR: commissioning not open", 2)
@ -72,21 +72,21 @@ class Matter_Commisioning_Context
tasmota.log("MTR: received message " + matter.inspect(msg), 3)
if msg.opcode == 0x20
return self.parse_PBKDFParamRequest(msg, remote_ip, remote_port)
return self.parse_PBKDFParamRequest(msg)
elif msg.opcode == 0x22
return self.parse_Pake1(msg, remote_ip, remote_port)
return self.parse_Pake1(msg)
elif msg.opcode == 0x24
return self.parse_Pake3(msg, remote_ip, remote_port)
return self.parse_Pake3(msg)
elif msg.opcode == 0x30
return self.parse_Sigma1(msg, remote_ip, remote_port)
return self.parse_Sigma1(msg)
elif msg.opcode == 0x32
return self.parse_Sigma3(msg, remote_ip, remote_port)
return self.parse_Sigma3(msg)
end
return false
end
def parse_PBKDFParamRequest(msg, addr, port)
def parse_PBKDFParamRequest(msg)
import crypto
# sanity checks
if msg.opcode != 0x20 || msg.local_session_id != 0 || msg.protocol_id != 0
@ -122,10 +122,10 @@ class Matter_Commisioning_Context
var resp = msg.build_response(0x21 #-PBKDR Response-#, true)
var raw = resp.encode(pbkdfparamresp_raw)
self.responder.send_response(raw, addr, port, resp.message_counter)
self.responder.send_response(raw, msg.remote_ip, msg.remote_port, resp.message_counter)
end
def parse_Pake1(msg, addr, port)
def parse_Pake1(msg)
import crypto
# sanity checks
if msg.opcode != 0x22 || msg.local_session_id != 0 || msg.protocol_id != 0
@ -200,10 +200,10 @@ class Matter_Commisioning_Context
var resp = msg.build_response(0x23 #-pake-2-#, true) # no reliable flag
var raw = resp.encode(pake2_raw)
self.responder.send_response(raw, addr, port, resp.message_counter)
self.responder.send_response(raw, msg.remote_ip, msg.remote_port, resp.message_counter)
end
def parse_Pake3(msg, addr, port)
def parse_Pake3(msg)
import crypto
# sanity checks
if msg.opcode != 0x24 || msg.local_session_id != 0 || msg.protocol_id != 0
@ -241,7 +241,7 @@ class Matter_Commisioning_Context
var raw = resp.encode(status_raw)
self.responder.send_response(raw, addr, port, nil)
self.responder.send_response(raw, msg.remote_ip, msg.remote_port, nil)
self.responder.add_session(self.future_local_session_id, self.future_initiator_session_id, self.I2RKey, self.R2IKey, self.AttestationChallenge, self.session_timestamp)
end
@ -268,7 +268,7 @@ class Matter_Commisioning_Context
return nil
end
def parse_Sigma1(msg, addr, port)
def parse_Sigma1(msg)
import crypto
# sanity checks
if msg.opcode != 0x30 || msg.local_session_id != 0 || msg.protocol_id != 0
@ -279,7 +279,15 @@ class Matter_Commisioning_Context
self.initiatorEph_pub = sigma1.initiatorEphPubKey
# find session
var session = self.find_session_by_destination_id(sigma1.destinationId, sigma1.initiatorRandom)
var is_resumption = (sigma1.resumptionID != nil && sigma1.initiatorResumeMIC != nil)
# Check that it's a resumption
var session
if is_resumption
session = self.device.sessions.find_session_by_resumption_id(sigma1.resumptionID)
else
session = self.find_session_by_destination_id(sigma1.destinationId, sigma1.initiatorRandom)
end
if session == nil raise "valuer_error", "StatusReport(GeneralCode: FAILURE, ProtocolId: SECURE_CHANNEL, ProtocolCode: NO_SHARED_TRUST_ROOTS)" end
session.source_node_id = msg.source_node_id
session.set_mode(matter.Session.__CASE)
@ -294,8 +302,7 @@ class Matter_Commisioning_Context
# Check that it's a resumption
if sigma1.resumptionID != nil && sigma1.initiatorResumeMIC != nil &&
session.shared_secret != nil
if is_resumption && session.shared_secret != nil
# Resumption p.169
var s1rk_salt = sigma1.initiatorRandom + sigma1.resumptionID
var s1rk_info = bytes().fromstring("Sigma1_Resume")
@ -356,7 +363,7 @@ class Matter_Commisioning_Context
var resp = msg.build_response(0x33 #-sigma-2-resume-#, true)
var raw = resp.encode(sigma2resume_raw)
self.responder.send_response(raw, addr, port, resp.message_counter)
self.responder.send_response(raw, msg.remote_ip, msg.remote_port, resp.message_counter)
session.close()
session.set_keys(i2r, r2i, ac, session_timestamp)
@ -431,14 +438,14 @@ class Matter_Commisioning_Context
var resp = msg.build_response(0x31 #-sigma-2-#, true) # no reliable flag
var raw = resp.encode(sigma2_raw)
self.responder.send_response(raw, addr, port, resp.message_counter)
self.responder.send_response(raw, msg.remote_ip, msg.remote_port, resp.message_counter)
return true
end
return true
end
def parse_Sigma3(msg, addr, port)
def parse_Sigma3(msg)
import crypto
# sanity checks
if msg.opcode != 0x32 || msg.local_session_id != 0 || msg.protocol_id != 0
@ -546,7 +553,7 @@ class Matter_Commisioning_Context
var raw = resp.encode(status_raw)
self.responder.send_response(raw, addr, port, resp.message_counter)
self.responder.send_response(raw, msg.remote_ip, msg.remote_port, resp.message_counter)
session.close()
session.set_keys(i2r, r2i, ac, session_timestamp)

View File

@ -70,6 +70,7 @@ class Matter_Device
# add the default plugin
self.plugins.push(matter.Plugin_core(self))
self.plugins.push(matter.Plugin_Relay(self))
self.start_mdns_announce_hostnames()
@ -267,22 +268,135 @@ class Matter_Device
#############################################################
# read an attribute
#
def read_attribute(msg, endpoint, cluster, attribute)
var idx = 0
while idx < size(self.plugins)
var plugin = self.plugins[idx]
# def read_attribute(msg, ctx)
# # dispatch only to plugins that support this endpoint and cluster
# var endpoint = ctx.endpoint
# var cluster = ctx.cluster
var ret = plugin.read_attribute(msg, endpoint, cluster, attribute)
if ret != nil
# var idx = 0
# while idx < size(self.plugins)
# var plugin = self.plugins[idx]
# if plugin.has(cluster, endpoint)
# var ret = plugin.read_attribute(msg, ctx)
# if ret != nil
# return ret
# end
# end
# idx += 1
# end
# end
#############################################################
# expand attribute list based
#
# called only when expansion is needed,
# so we don't need to report any error since they are ignored
def process_attribute_expansion(ctx, cb)
import string
var endpoint = ctx.endpoint
var endpoint_mono = [ endpoint ]
var endpoint_found = false # did any endpoint match
var cluster = ctx.cluster
var cluster_mono = [ cluster ]
var cluster_found = false
var attribute = ctx.attribute
var attribute_mono = [ attribute ]
var attribute_found = false
var direct = (ctx.endpoint != nil) && (ctx.cluster != nil) && (ctx.attribute != nil) # true if the target is a precise attribute, false if it results from an expansion and error are ignored
tasmota.log(string.format("MTR: process_attribute_expansion %s", str(ctx)), 3)
for pi: self.plugins
var ep_list = pi.get_endpoints() # get supported endpoints for this plugin
tasmota.log(string.format("MTR: ep_list %s %s", str(pi), str(ep_list)), 3)
if endpoint != nil
# we have a specific endpoint, make sure it's in the list
if ep_list.find(endpoint) != nil
ep_list = endpoint_mono
endpoint_found = true
else
continue
end
end
# ep_list is the actual list of candidate endpoints for this plugin
# iterate on endpoints
for ep: ep_list
# now filter on clusters
var cluster_list = pi.get_cluster_list(ep)
tasmota.log(string.format("MTR: cluster_list %s %s", str(ep), str(cluster_list)), 3)
if cluster != nil
# we have a specific cluster, make sure it's in the list
if cluster_list.find(cluster) != nil
cluster_list = cluster_mono
cluster_found = true
else
continue
end
end
# cluster_list is the actual list of candidate cluster for this pluging and endpoint
for cl: cluster_list
# now filter on attribute
var attr_list = pi.get_attribute_list(ep, cluster)
tasmota.log(string.format("MTR: attr_list %s %s", str(cl), str(attr_list)), 3)
if attribute != nil
# we have a specific attribute, make sure it's in the list
if attr_list.find(attribute) != nil
attr_list = attribute_mono
attribute_found = true
else
continue
end
for at: attr_list
# we now have the complete candidate: ep/cl/at
tasmota.log(string.format("MTR: expansion [%02X]%04X/%04X", ep, cl, at), 3)
ctx.endpoint = ep
ctx.cluster = cl
ctx.attribute = at
var finished = cb(pi, ctx, direct) # call the callback with the plugin and the context
if finished return end
end
end
end
end
end
# we didn't have any successful match, report an error if direct (non-expansion request)
if direct
# since it's a direct request, ctx has already the correct endpoint/cluster/attribute
if !endpoint_found ctx.status = matter.UNSUPPORTED_ENDPOINT
elif !cluster_found ctx.status = matter.UNSUPPORTED_CLUSTER
elif !attribute_found ctx.status = matter.UNSUPPORTED_ATTRIBUTE
else ctx.status = matter.UNREPORTABLE_ATTRIBUTE
end
cb(nil, ctx, true)
end
end
# def process_read_attribute(ctx)
# self.process_attribute_expansion(ctx,
# / pi, ctx, direct -> pi.read_attribute(ctx))
# end
#############################################################
# get active endpoints
#
# return the list of endpoints from all plugins (distinct)
def get_active_endpoints(exclude_zero)
var ret = []
for p:self.plugins
var e = p.get_endpoints()
for elt:e
if exclude_zero && elt == 0 continue end
if ret.find(elt) == nil
ret.push(elt)
end
end
end
return ret
end
idx += 1
end
end
#############################################################
# Persistance of Matter Device parameters
#

View File

@ -33,6 +33,21 @@ class Matter_Response_container
var attribute
var command
var status
def tostring()
try
import string
var s = ""
s += (self.endpoint != nil ? string.format("[%02X]", self.endpoint) : "[**]")
s += (self.cluster != nil ? string.format("%04X/", self.cluster) : "****/")
s += (self.attribute != nil ? string.format("%04X", self.attribute) : "")
s += (self.command != nil ? string.format("%04X", self.attribute) : "")
return s
except .. as e, m
return "Exception> " + str(e) + ", " + str(m)
end
end
end
matter.Response_container = Matter_Response_container
@ -40,13 +55,17 @@ matter.Response_container = Matter_Response_container
# Matter_IM class
#################################################################################
class Matter_IM
static var MAX_MESSAGE = 1200
static var MSG_TIMEOUT = 10000 # 10s
var responder
var device
def init(responder)
def init(responder, device)
self.responder = responder
self.device = device
end
def process_incoming(msg, remote_ip, remote_port)
def process_incoming(msg)
# messages are always TLV, decode payload
tasmota.log("MTR: received IM message " + matter.inspect(msg), 3)
@ -59,25 +78,25 @@ class Matter_IM
var opcode = msg.opcode
if opcode == 0x01 # Status Response
return self.process_status_response(msg, val, remote_ip, remote_port)
return self.process_status_response(msg, val)
elif opcode == 0x02 # Read Request
return self.process_read_request(msg, val, remote_ip, remote_port)
return self.process_read_request(msg, val)
elif opcode == 0x03 # Subscribe Request
return self.subscribe_request(msg, val, remote_ip, remote_port)
return self.subscribe_request(msg, val)
elif opcode == 0x04 # Subscribe Response
return self.subscribe_response(msg, val, remote_ip, remote_port)
return self.subscribe_response(msg, val)
elif opcode == 0x05 # Report Data
return self.report_data(msg, val, remote_ip, remote_port)
return self.report_data(msg, val)
elif opcode == 0x06 # Write Request
return self.process_write_request(msg, val, remote_ip, remote_port)
return self.process_write_request(msg, val)
elif opcode == 0x07 # Write Response
return self.process_write_response(msg, val, remote_ip, remote_port)
return self.process_write_response(msg, val)
elif opcode == 0x08 # Invoke Request
return self.process_invoke_request(msg, val, remote_ip, remote_port)
return self.process_invoke_request(msg, val)
elif opcode == 0x09 # Invoke Response
return self.process_invoke_response(msg, val, remote_ip, remote_port)
return self.process_invoke_response(msg, val)
elif opcode == 0x0A # Timed Request
return self.process_timed_request(msg, val, remote_ip, remote_port)
return self.process_timed_request(msg, val)
end
return false
@ -89,7 +108,7 @@ class Matter_IM
# val is the TLV structure
# returns `true` if processed, `false` if silently ignored,
# or raises an exception
def process_status_response(msg, val, remote_ip, remote_port)
def process_status_response(msg, val)
import string
var status = val.findsubval(0, 0xFF)
tasmota.log(string.format("MTR: Status Response = 0x%02X", status), 3)
@ -102,64 +121,157 @@ class Matter_IM
# val is the TLV structure
# returns `true` if processed, `false` if silently ignored,
# or raises an exception
def process_read_request(msg, val, remote_ip, remote_port)
def process_read_request(msg, val)
var endpoints = self.device.get_active_endpoints()
### Inner function to be iterated upon
# ret is the ReportDataMessage list to send back
# ctx is the context with endpoint/cluster/attribute
# direct is true if error is reported, false if error is silently ignored
#
# if `pi` is nil, just report the status for ctx.status
#
# should return true if answered, false if passing to next handler
def read_single_attribute(ret, pi, ctx, direct)
import string
var attr_name = matter.get_attribute_name(ctx.cluster, ctx.attribute)
attr_name = attr_name ? " (" + attr_name + ")" : ""
# tasmota.log(string.format("MTR: Read Attribute " + str(ctx) + (attr_name ? " (" + attr_name + ")" : ""), 2)
# Special case to report unsupported item, if pi==nil
var res = (pi != nil) ? pi.read_attribute(msg, ctx) : nil
if res != nil
var a1 = matter.AttributeReportIB()
a1.attribute_data = matter.AttributeDataIB()
a1.attribute_data.data_version = 1
a1.attribute_data.path = matter.AttributePathIB()
a1.attribute_data.path.endpoint = ctx.endpoint
a1.attribute_data.path.cluster = ctx.cluster
a1.attribute_data.path.attribute = ctx.attribute
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)
return true # stop expansion since we have a value
elif ctx.status != nil
if direct
var a1 = matter.AttributeReportIB()
a1.attribute_status = matter.AttributeStatusIB()
a1.attribute_status.path = matter.AttributePathIB()
a1.attribute_status.status = matter.StatusIB()
a1.attribute_status.path.endpoint = ctx.endpoint
a1.attribute_status.path.cluster = ctx.cluster
a1.attribute_status.path.attribute = ctx.attribute
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)
return true
end
else
tasmota.log(string.format("MTR: Read_Attr %s%s - IGNORED", str(ctx), attr_name), 2)
# ignore if content is nil and status is undefined
end
end
# structure is `ReadRequestMessage` 10.6.2 p.558
tasmota.log("MTR: IM:read_request processing start", 3)
var ctx = matter.Response_container()
var query = matter.ReadRequestMessage().from_TLV(val)
if query.attributes_requests != nil
# prepare the response
var ret = matter.ReportDataMessage()
ret.suppress_response = true
# ret.suppress_response = true
ret.attribute_reports = []
# TODO - we need to implement Concrete path expansion here
for q:query.attributes_requests
var attr_name = matter.get_attribute_name(q.cluster, q.attribute)
tasmota.log("MTR: Read Attribute " + str(q) + (attr_name ? " (" + attr_name + ")" : ""), 2)
var res = self.responder.device.read_attribute(msg, q.endpoint, q.cluster, q.attribute)
if res != nil
var a1 = matter.AttributeReportIB()
# a1.attribute_status = matter.AttributeStatusIB()
# a1.attribute_status.path = matter.AttributePathIB()
# a1.attribute_status.status = matter.StatusIB()
# a1.attribute_status.path.endpoint = 0
# a1.attribute_status.path.cluster = q.cluster
# a1.attribute_status.path.attribute = q.attribute
# a1.attribute_status.status.status = matter.SUCCESS
a1.attribute_data = matter.AttributeDataIB()
a1.attribute_data.data_version = 1
a1.attribute_data.path = matter.AttributePathIB()
a1.attribute_data.path.endpoint = 0
a1.attribute_data.path.cluster = q.cluster
a1.attribute_data.path.attribute = q.attribute
a1.attribute_data.data = res
# need to do expansion here
ctx.endpoint = q.endpoint
ctx.cluster = q.cluster
ctx.attribute = q.attribute
ctx.status = matter.UNSUPPORTED_ATTRIBUTE #default error if returned `nil`
ret.attribute_reports.push(a1)
# expand endpoint
if ctx.endpoint == nil || ctx.cluster == nil || ctx.attribute == nil
# 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)
else
tasmota.log("MTR: Read_Attr " + str(ctx), 2)
end
end
# implement concrete expansion
self.device.process_attribute_expansion(ctx,
/ pi, ctx, direct -> read_single_attribute(ret, pi, ctx, direct)
)
end
tasmota.log("MTR: ReportDataMessage=" + str(ret), 3)
tasmota.log("MTR: ReportDataMessageTLV=" + str(ret.to_TLV()), 3)
var resp = msg.build_response(0x05 #-Report Data-#, true)
resp.encode(ret.to_TLV().encode()) # payload in cleartext
resp.encrypt()
self.responder.send_response(resp.raw, remote_ip, remote_port, resp.message_counter)
# send the reponse that may need to be chunked if too large to fit in a single UDP message
self.send_attr_report(msg, ret)
end
return true
end
def send_attr_report(msg, ret)
# class to keep the current chunked reponse
class Matter_Attr_Report
var ret # return structure as ReportDataMessage TLV structure
var resp # response Frame (to keep all fields like session or remote_ip/port)
var expiration
end
# compute the acceptable size
var msg_sz = 0
var elements = 0
if size(ret.attribute_reports) > 0
msg_sz = size(ret.attribute_reports[0].to_TLV().encode())
elements = 1
end
while msg_sz < self.MAX_MESSAGE && elements < size(ret.attribute_reports)
var next_sz = size(ret.attribute_reports[elements].to_TLV().encode())
if msg_sz + next_sz < self.MAX_MESSAGE
msg_sz += next_sz
elements += 1
end
end
var next_elemnts = ret.attribute_reports[elements .. ]
ret.attribute_reports = ret.attribute_reports[0 .. elements - 1]
if size(next_elemnts) > 0
ret.more_chunked_messages = true
end
var resp = msg.build_response(0x05 #-Report Data-#, true)
resp.encode(ret.to_TLV().encode()) # payload in cleartext
resp.encrypt()
self.responder.send_response(resp.raw, msg.remote_ip, msg.remote_port, resp.message_counter)
if size(next_elemnts) > 0
ret.attribute_reports = next_elemnts
var chunked_next = Matter_Attr_Report()
chunked_next.ret = ret
chunked_next.resp = resp
chunked_next.expiration = tasmota.millis() + self.MSG_TIMEOUT
end
end
#############################################################
# process IM 0x08 Invoke Request
#
# val is the TLV structure
# returns `true` if processed, `false` if silently ignored,
# or raises an exception
def process_invoke_request(msg, val, remote_ip, remote_port)
def process_invoke_request(msg, val)
import string
# structure is `ReadRequestMessage` 10.6.2 p.558
tasmota.log("MTR: IM:invoke_request processing start", 3)
@ -180,7 +292,7 @@ class Matter_IM
var cmd_name = matter.get_command_name(ctx.cluster, ctx.command)
if cmd_name == nil cmd_name = string.format("0x%04X/0x02X", ctx.cluster, ctx.command) end
tasmota.log(string.format("MTR: >Received_cmd %s from [%s]:%i", cmd_name, remote_ip, remote_port), 2)
tasmota.log(string.format("MTR: >Received_cmd %s from [%s]:%i", cmd_name, msg.remote_ip, msg.remote_port), 2)
var res = self.responder.device.invoke_request(msg, q.command_fields, ctx)
var a1 = matter.InvokeResponseIB()
if res != nil
@ -218,13 +330,13 @@ class Matter_IM
resp.encode(ret.to_TLV().encode()) # payload in cleartext
resp.encrypt()
self.responder.send_response(resp.raw, remote_ip, remote_port, resp.message_counter)
self.responder.send_response(resp.raw, msg.remote_ip, msg.remote_port, resp.message_counter)
elif msg.x_flag_r # nothing to respond, check if we need a standalone ack
var resp = msg.build_standalone_ack()
resp.encode()
resp.encrypt()
# no ecnryption required for ACK
self.responder.send_response(resp.raw, remote_ip, remote_port, resp.message_counter)
self.responder.send_response(resp.raw, msg.remote_ip, msg.remote_port, resp.message_counter)
end
end
end
@ -232,7 +344,7 @@ class Matter_IM
#############################################################
# process IM 0x03 Subscribe Request
#
def subscribe_request(msg, val, remote_ip, remote_port)
def subscribe_request(msg, val)
import string
var query = matter.SubscribeRequestMessage().from_TLV(val)
tasmota.log("MTR: received SubscribeRequestMessage=" + str(query), 3)
@ -242,7 +354,7 @@ class Matter_IM
#############################################################
# process IM 0x04 Subscribe Response
#
def subscribe_response(msg, val, remote_ip, remote_port)
def subscribe_response(msg, val)
import string
var query = matter.SubscribeResponseMessage().from_TLV(val)
tasmota.log("MTR: received SubscribeResponsetMessage=" + str(query), 3)
@ -252,7 +364,7 @@ class Matter_IM
#############################################################
# process IM 0x05 ReportData
#
def report_data(msg, val, remote_ip, remote_port)
def report_data(msg, val)
import string
var query = matter.ReportDataMessage().from_TLV(val)
tasmota.log("MTR: received ReportDataMessage=" + str(query), 3)
@ -262,7 +374,7 @@ class Matter_IM
#############################################################
# process IM 0x06 Write Request
#
def process_write_request(msg, val, remote_ip, remote_port)
def process_write_request(msg, val)
import string
var query = matter.WriteRequestMessage().from_TLV(val)
tasmota.log("MTR: received WriteRequestMessage=" + str(query), 3)
@ -272,7 +384,7 @@ class Matter_IM
#############################################################
# process IM 0x07 Write Response
#
def process_write_response(msg, val, remote_ip, remote_port)
def process_write_response(msg, val)
import string
var query = matter.WriteResponseMessage().from_TLV(val)
tasmota.log("MTR: received WriteResponseMessage=" + str(query), 3)
@ -282,7 +394,7 @@ class Matter_IM
#############################################################
# process IM 0x09 Invoke Response
#
def process_invoke_response(msg, val, remote_ip, remote_port)
def process_invoke_response(msg, val)
import string
var query = matter.InvokeResponseMessage().from_TLV(val)
tasmota.log("MTR: received InvokeResponseMessage=" + str(query), 3)
@ -292,12 +404,12 @@ class Matter_IM
#############################################################
# process IM 0x0A Timed Request
#
def process_timed_request(msg, val, remote_ip, remote_port)
def process_timed_request(msg, val)
import string
var query = matter.TimedRequestMessage().from_TLV(val)
tasmota.log("MTR: received TimedRequestMessage=" + str(query), 3)
tasmota.log(string.format("MTR: >Received_IM TimedRequest=%i from [%s]:%i", query.timeout, remote_ip, remote_port), 2)
tasmota.log(string.format("MTR: >Received_IM TimedRequest=%i from [%s]:%i", query.timeout, msg.remote_ip, msg.remote_port), 2)
# Send success status report
var sr = matter.StatusResponseMessage()
@ -305,7 +417,7 @@ class Matter_IM
var resp = msg.build_response(0x01 #-Status Response-#, true #-reliable-#)
resp.encode(sr.to_TLV().encode()) # payload in cleartext
resp.encrypt()
self.responder.send_response(resp.raw, remote_ip, remote_port, resp.message_counter)
self.responder.send_response(resp.raw, msg.remote_ip, msg.remote_port, resp.message_counter)
return true
end

View File

@ -546,7 +546,7 @@ class Matter_StatusIB : Matter_IM_base
def to_TLV()
var TLV = matter.TLV
var s = TLV.Matter_TLV_list()
var s = TLV.Matter_TLV_struct()
s.add_TLV(0, TLV.U2, self.status)
s.add_TLV(1, TLV.U2, self.cluster_status)
return s

View File

@ -59,13 +59,17 @@ class Matter_Frame
var sec_extensions
# var
var app_payload_idx # index where the application payload starts
# for UDP, remote_ip and remote_port to send back to
var remote_ip, remote_port
#############################################################
# keep track of the message_handler object
#
def init(message_handler, raw)
def init(message_handler, raw, addr, port)
self.message_handler = message_handler
self.raw = raw
self.remote_ip = addr
self.remote_port = port
end
#############################################################
@ -259,6 +263,9 @@ class Matter_Frame
# send back response
var resp = classof(self)(self.message_handler)
resp.remote_ip = self.remote_ip
resp.remote_port = self.remote_port
if self.flag_s
resp.flag_dsiz = 0x01
resp.dest_node_id_8 = self.source_node_id

View File

@ -35,7 +35,7 @@ class Matter_MessageHandler
def init(device)
self.device = device
self.commissioning = matter.Commisioning_Context(self)
self.im = matter.IM(self)
self.im = matter.IM(self, device)
self.counter_rcv = matter.Counter()
end
@ -49,7 +49,7 @@ class Matter_MessageHandler
import string
try
tasmota.log("MTR: MessageHandler::msg_received raw="+raw.tohex(), 4)
var frame = matter.Frame(self, raw)
var frame = matter.Frame(self, raw, addr, port)
var ok = frame.decode_header()
if !ok return false end

View File

@ -23,14 +23,18 @@
#@ solidify:Matter_Plugin,weak
class Matter_Plugin
var device
var endpoints
static var EMPTY_LIST = []
static var EMPTY_MAP = {}
var device # reference to the `device` global object
var endpoints # list of supported endpoints
var clusters # map from cluster to list of attributes
#############################################################
# Constructor
def init(device)
self.device = device
self.endpoints = []
self.endpoints = self.EMPTY_LIST
self.clusters = self.EMPTY_LIST
end
#############################################################
@ -38,10 +42,29 @@ class Matter_Plugin
def get_endpoints()
return self.endpoints
end
def get_cluster_map()
return self.clusters
end
def get_cluster_list(ep)
var ret = []
for k: self.clusters.keys()
ret.push(k)
end
return ret
end
def get_attribute_list(ep, cluster)
return self.clusters.find(cluster, self.EMPTY_LIST)
end
#############################################################
# Does it handle this endpoint and this cluster
def has(cluster, endpoint)
return self.clusters.contains(cluster) && self.endpoints.find(endpoint) != nil
end
#############################################################
# read attribute
def read_attribute(msg, endpoint, cluster, attribute)
def read_attribute(msg, ctx)
return nil
end

View File

@ -25,18 +25,59 @@ class Matter_Plugin end
#@ solidify:Matter_Plugin_Relay,weak
class Matter_Plugin_Relay : Matter_Plugin
static var ENDPOINTS = [ 1 ]
static var CLUSTERS = {
0x001D: [0,1,2,3],
0x0003: [],
0x0004: [],
0x0005: [],
0x0006: [0],
0x0008: [],
# 0x0406: []
}
static var TYPES = [ 0x0100 ] # On/Off Light
#############################################################
# Constructor
def init(device)
super(self).init(device)
self.endpoints = [ 1 ]
self.endpoints = self.ENDPOINTS
self.clusters = self.CLUSTERS
end
#############################################################
# read an attribute
#
def read_attribute(msg, endpoint, cluster, attribute)
# no match found, return that the attribute is unsupported
def read_attribute(msg, ctx)
import string
var TLV = matter.TLV
var cluster = ctx.cluster
var attribute = ctx.attribute
if cluster == 0x001D # ========== Descriptor Cluster 9.5 p.453 ==========
if attribute == 0x0000 # ---------- DeviceTypeList / list[DeviceTypeStruct] ----------
var dtl = TLV.Matter_TLV_array()
var d1 = dtl.add_struct()
d1.add_TLV(0, TLV.U2, self.TYPES[0]) # DeviceType
d1.add_TLV(1, TLV.U2, 1) # Revision
return dtl
elif attribute == 0x0001 # ---------- ServerList / list[cluster-id] ----------
var sl = TLV.Matter_TLV_array()
for cl: self.get_cluster_list()
sl.add_TLV(nil, TLV.U4, cl)
end
return sl
elif attribute == 0x0002 # ---------- ClientList / list[cluster-id] ----------
var cl = TLV.Matter_TLV_array()
cl.add_TLV(nil, TLV.U2, 0x0006)
return cl
elif attribute == 0x0003 # ---------- PartsList / list[endpoint-no]----------
var pl = TLV.Matter_TLV_array()
return pl
end
end
# no match found, return that the attribute is unsupported end
end
#############################################################

View File

@ -25,19 +25,39 @@ class Matter_Plugin end
#@ solidify:Matter_Plugin_core,weak
class Matter_Plugin_core : Matter_Plugin
static var ENDPOINTS = [ 0 ]
static var CLUSTERS = {
0x001D: [0,1,2,3],
0x0028: [0,1,2,3,4,5,6,7,8,9],
0x002B: [0,1],
0x002C: [0,1,2],
0x0030: [0,1,2,3,4],
0x0031: [3,0xFFFC],
0x0032: [],
0x0033: [0,1,2,8],
0x0034: [],
0x0038: [0,1,7],
0x003E: [0,1,2,3,4,5],
0x003C: [],
0x003F: []
}
#############################################################
# Constructor
def init(device)
super(self).init(device)
self.endpoints = [ 0 ]
self.endpoints = self.ENDPOINTS
self.clusters = self.CLUSTERS
end
#############################################################
# read an attribute
#
def read_attribute(msg, endpoint, cluster, attribute)
def read_attribute(msg, ctx)
import string
var TLV = matter.TLV
var cluster = ctx.cluster
var attribute = ctx.attribute
if cluster == 0x0030 # ========== GeneralCommissioning cluster 11.9 p.627 ==========
@ -151,11 +171,15 @@ class Matter_Plugin_core : Matter_Plugin
elif attribute == 0x0002 # ---------- SupportedFabrics / u1 ----------
return TLV.create_TLV(TLV.U1, 5) # Max 5 fabrics
elif attribute == 0x0003 # ---------- CommissionedFabrics / u1 ----------
return TLV.create_TLV(TLV.U1, 1) # TODO
var sessions_active = self.device.sessions.sessions_active()
return TLV.create_TLV(TLV.U1, size(sessions_active)) # number of active sessions
elif attribute == 0x0004 # ---------- TrustedRootCertificates / list[octstr] ----------
# TODO
elif attribute == 0x0005 # ---------- Current­ FabricIndex / u1 ----------
# TODO
var sessions_active = self.device.sessions.sessions_active()
var fabric_index = sessions_active.find(msg.session)
if fabric_index == nil fabric_index = 0 end
return TLV.create_TLV(TLV.U1, fabric_index) # number of active sessions
end
# ====================================================================================================
@ -224,6 +248,31 @@ class Matter_Plugin_core : Matter_Plugin
elif attribute == 0xFFFC # ---------- FeatureMap / map32 ----------
return TLV.create_TLV(TLV.U4, 0) # 15s ??? TOOD what should we put here?
end
# ====================================================================================================
elif cluster == 0x001D # ========== Descriptor Cluster 9.5 p.453 ==========
if attribute == 0x0000 # ---------- DeviceTypeList / list[DeviceTypeStruct] ----------
elif attribute == 0x0001 # ---------- ServerList / list[cluster-id] ----------
var sl = TLV.Matter_TLV_array()
for cl: self.get_cluster_list()
sl.add_TLV(nil, TLV.U4, cl)
end
return sl
elif attribute == 0x0002 # ---------- ClientList / list[cluster-id] ----------
var cl = TLV.Matter_TLV_array()
return cl
elif attribute == 0x0003 # ---------- PartsList / list[endpoint-no]----------
var eps = self.device.get_active_endpoints(true)
var pl = TLV.Matter_TLV_array()
for ep: eps
pl.add_TLV(nil, TLV.U2, ep) # add each endpoint
end
return pl
end
else
ctx.status = matter.UNSUPPORTED_CLUSTER
end
# no match found, return that the attribute is unsupported
end

View File

@ -82,6 +82,9 @@ class Matter_Session
var _persist # do we persist this sessions or is it remporary
var expiration # if not `nil` the entry is removed after this timestamp
# below are placeholders for ongoing transactions or chunked responses
var _chunked_attr_reports # if not `nil` holds a container for the current _chuked_attr_reports
# Group Key Derivation
static var __GROUP_KEY = "GroupKey v1.0" # starting with double `_` means it's not writable
@ -512,6 +515,20 @@ class Matter_Session_Store
return session
end
#############################################################
# find session by resumption id
def find_session_by_resumption_id(resumption_id)
if !resumption_id return nil end
var i = 0
var sessions = self.sessions
while i < size(sessions)
if sessions[i].resumption_id == resumption_id
return sessions[i]
end
i += 1
end
end
#############################################################
# list of sessions that are active, i.e. have been
# successfully commissioned

View File

@ -428,6 +428,8 @@ class Matter_TLV
# class Matter_TLV_struct var _ end
static class Matter_TLV_list : Matter_TLV_item
static var is_struct = false
#################################################################################
def init(parent)
super(self).init(parent)
@ -517,8 +519,9 @@ class Matter_TLV
end
#############################################################
# encode to bytes
def encode(b)
return self._encode_inner(b, false)
return self._encode_inner(b, self.is_struct)
end
#############################################################
@ -618,6 +621,8 @@ class Matter_TLV
# Matter_TLV_struct class
#################################################################################
static class Matter_TLV_struct : Matter_TLV_list
static var is_struct = true
def init(parent)
super(self).init(parent)
self.typ = self.TLV.STRUCT
@ -628,14 +633,6 @@ class Matter_TLV
def tostring()
return self.tostring_inner(true, "{", "}")
end
#############################################################
# encode TLV
#
# appends to the bytes() object
def encode(b)
return self._encode_inner(b, true)
end
end
#################################################################################

File diff suppressed because it is too large Load Diff

View File

@ -2429,7 +2429,7 @@ be_local_closure(Matter_StatusIB_to_TLV, /* name */
( &(const bvalue[ 9]) { /* constants */
/* K0 */ be_nested_str_weak(matter),
/* K1 */ be_nested_str_weak(TLV),
/* K2 */ be_nested_str_weak(Matter_TLV_list),
/* K2 */ be_nested_str_weak(Matter_TLV_struct),
/* K3 */ be_nested_str_weak(add_TLV),
/* K4 */ be_const_int(0),
/* K5 */ be_nested_str_weak(U2),

View File

@ -116,9 +116,9 @@ be_local_closure(Matter_MessageHandler_msg_received, /* name */
}),
be_str_weak(msg_received),
&be_const_str_solidified,
( &(const binstruction[289]) { /* code */
( &(const binstruction[291]) { /* code */
0xA4120000, // 0000 IMPORT R4 K0
0xA8020108, // 0001 EXBLK 0 #010B
0xA802010A, // 0001 EXBLK 0 #010D
0xB8160200, // 0002 GETNGBL R5 K1
0x8C140B02, // 0003 GETMET R5 R5 K2
0x8C1C0304, // 0004 GETMET R7 R1 K4
@ -130,282 +130,284 @@ be_local_closure(Matter_MessageHandler_msg_received, /* name */
0x8C140B06, // 000A GETMET R5 R5 K6
0x5C1C0000, // 000B MOVE R7 R0
0x5C200200, // 000C MOVE R8 R1
0x7C140600, // 000D CALL R5 3
0x8C180B07, // 000E GETMET R6 R5 K7
0x7C180200, // 000F CALL R6 1
0x5C1C0C00, // 0010 MOVE R7 R6
0x741E0002, // 0011 JMPT R7 #0015
0x501C0000, // 0012 LDBOOL R7 0 0
0xA8040001, // 0013 EXBLK 1 1
0x80040E00, // 0014 RET 1 R7
0x881C0B08, // 0015 GETMBR R7 R5 K8
0x1C1C0F09, // 0016 EQ R7 R7 K9
0x781E0057, // 0017 JMPF R7 #0070
0x881C0B0A, // 0018 GETMBR R7 R5 K10
0x1C1C0F09, // 0019 EQ R7 R7 K9
0x781E0054, // 001A JMPF R7 #0070
0x881C010B, // 001B GETMBR R7 R0 K11
0x881C0F0C, // 001C GETMBR R7 R7 K12
0x8C1C0F0D, // 001D GETMET R7 R7 K13
0x88240B0E, // 001E GETMBR R9 R5 K14
0x542A0059, // 001F LDINT R10 90
0x7C1C0600, // 0020 CALL R7 3
0xB8220200, // 0021 GETNGBL R8 K1
0x8C201102, // 0022 GETMET R8 R8 K2
0x60280008, // 0023 GETGBL R10 G8
0x882C0B0E, // 0024 GETMBR R11 R5 K14
0x7C280200, // 0025 CALL R10 1
0x002A1E0A, // 0026 ADD R10 K15 R10
0x00281510, // 0027 ADD R10 R10 K16
0x602C0008, // 0028 GETGBL R11 G8
0x88300F08, // 0029 GETMBR R12 R7 K8
0x7C2C0200, // 002A CALL R11 1
0x0028140B, // 002B ADD R10 R10 R11
0x582C0011, // 002C LDCONST R11 K17
0x7C200600, // 002D CALL R8 3
0x90162407, // 002E SETMBR R5 K18 R7
0x88200113, // 002F GETMBR R8 R0 K19
0x8C201114, // 0030 GETMET R8 R8 K20
0x88280B15, // 0031 GETMBR R10 R5 K21
0x502C0000, // 0032 LDBOOL R11 0 0
0x7C200600, // 0033 CALL R8 3
0x7422000D, // 0034 JMPT R8 #0043
0xB8220200, // 0035 GETNGBL R8 K1
0x8C201102, // 0036 GETMET R8 R8 K2
0x8C280916, // 0037 GETMET R10 R4 K22
0x58300017, // 0038 LDCONST R12 K23
0x88340B15, // 0039 GETMBR R13 R5 K21
0x88380113, // 003A GETMBR R14 R0 K19
0x8C381D18, // 003B GETMET R14 R14 K24
0x7C380200, // 003C CALL R14 1
0x7C280800, // 003D CALL R10 4
0x582C0011, // 003E LDCONST R11 K17
0x7C200600, // 003F CALL R8 3
0x50200000, // 0040 LDBOOL R8 0 0
0xA8040001, // 0041 EXBLK 1 1
0x80041000, // 0042 RET 1 R8
0x8C200B19, // 0043 GETMET R8 R5 K25
0x7C200200, // 0044 CALL R8 1
0x74220002, // 0045 JMPT R8 #0049
0x50200000, // 0046 LDBOOL R8 0 0
0xA8040001, // 0047 EXBLK 1 1
0x80041000, // 0048 RET 1 R8
0x8820010B, // 0049 GETMBR R8 R0 K11
0x8C20111A, // 004A GETMET R8 R8 K26
0x88280B1B, // 004B GETMBR R10 R5 K27
0x7C200400, // 004C CALL R8 2
0x88200B1C, // 004D GETMBR R8 R5 K28
0x5426000F, // 004E LDINT R9 16
0x20201009, // 004F NE R8 R8 R9
0x78220014, // 0050 JMPF R8 #0066
0xB8220A00, // 0051 GETNGBL R8 K5
0x8C20111D, // 0052 GETMET R8 R8 K29
0x88280B1C, // 0053 GETMBR R10 R5 K28
0x7C200400, // 0054 CALL R8 2
0x5C241000, // 0055 MOVE R9 R8
0x74260004, // 0056 JMPT R9 #005C
0x8C240916, // 0057 GETMET R9 R4 K22
0x582C001E, // 0058 LDCONST R11 K30
0x88300B1C, // 0059 GETMBR R12 R5 K28
0x7C240600, // 005A CALL R9 3
0x5C201200, // 005B MOVE R8 R9
0xB8260200, // 005C GETNGBL R9 K1
0x8C241302, // 005D GETMET R9 R9 K2
0x8C2C0916, // 005E GETMET R11 R4 K22
0x5834001F, // 005F LDCONST R13 K31
0x5C381000, // 0060 MOVE R14 R8
0x5C3C0400, // 0061 MOVE R15 R2
0x5C400600, // 0062 MOVE R16 R3
0x7C2C0A00, // 0063 CALL R11 5
0x58300020, // 0064 LDCONST R12 K32
0x7C240600, // 0065 CALL R9 3
0x88200121, // 0066 GETMBR R8 R0 K33
0x8C201122, // 0067 GETMET R8 R8 K34
0x5C280A00, // 0068 MOVE R10 R5
0x5C2C0400, // 0069 MOVE R11 R2
0x5C300600, // 006A MOVE R12 R3
0x7C200800, // 006B CALL R8 4
0x50200200, // 006C LDBOOL R8 1 0
0xA8040001, // 006D EXBLK 1 1
0x80041000, // 006E RET 1 R8
0x70020095, // 006F JMP #0106
0xB81E0200, // 0070 GETNGBL R7 K1
0x8C1C0F02, // 0071 GETMET R7 R7 K2
0x8C240916, // 0072 GETMET R9 R4 K22
0x582C0023, // 0073 LDCONST R11 K35
0x88300B08, // 0074 GETMBR R12 R5 K8
0x88340B15, // 0075 GETMBR R13 R5 K21
0x7C240800, // 0076 CALL R9 4
0x58280011, // 0077 LDCONST R10 K17
0x7C1C0600, // 0078 CALL R7 3
0x881C010B, // 0079 GETMBR R7 R0 K11
0x881C0F0C, // 007A GETMBR R7 R7 K12
0x8C1C0F24, // 007B GETMET R7 R7 K36
0x88240B08, // 007C GETMBR R9 R5 K8
0x7C1C0400, // 007D CALL R7 2
0x4C200000, // 007E LDNIL R8
0x1C200E08, // 007F EQ R8 R7 R8
0x78220013, // 0080 JMPF R8 #0095
0xB8220200, // 0081 GETNGBL R8 K1
0x8C201102, // 0082 GETMET R8 R8 K2
0x60280008, // 0083 GETGBL R10 G8
0x882C0B08, // 0084 GETMBR R11 R5 K8
0x7C280200, // 0085 CALL R10 1
0x002A4A0A, // 0086 ADD R10 K37 R10
0x582C0011, // 0087 LDCONST R11 K17
0x7C200600, // 0088 CALL R8 3
0xB8220200, // 0089 GETNGBL R8 K1
0x8C201102, // 008A GETMET R8 R8 K2
0xB82A0A00, // 008B GETNGBL R10 K5
0x8C281527, // 008C GETMET R10 R10 K39
0x5C300A00, // 008D MOVE R12 R5
0x7C280400, // 008E CALL R10 2
0x002A4C0A, // 008F ADD R10 K38 R10
0x582C0011, // 0090 LDCONST R11 K17
0x7C200600, // 0091 CALL R8 3
0x50200000, // 0092 LDBOOL R8 0 0
0xA8040001, // 0093 EXBLK 1 1
0x80041000, // 0094 RET 1 R8
0x90162407, // 0095 SETMBR R5 K18 R7
0x88200F13, // 0096 GETMBR R8 R7 K19
0x8C201114, // 0097 GETMET R8 R8 K20
0x88280B15, // 0098 GETMBR R10 R5 K21
0x502C0200, // 0099 LDBOOL R11 1 0
0x7C200600, // 009A CALL R8 3
0x74220011, // 009B JMPT R8 #00AE
0xB8220200, // 009C GETNGBL R8 K1
0x8C201102, // 009D GETMET R8 R8 K2
0x60280008, // 009E GETGBL R10 G8
0x882C0B15, // 009F GETMBR R11 R5 K21
0x7C280200, // 00A0 CALL R10 1
0x002A500A, // 00A1 ADD R10 K40 R10
0x00281529, // 00A2 ADD R10 R10 K41
0x602C0008, // 00A3 GETGBL R11 G8
0x88300F13, // 00A4 GETMBR R12 R7 K19
0x8C301918, // 00A5 GETMET R12 R12 K24
0x7C300200, // 00A6 CALL R12 1
0x7C2C0200, // 00A7 CALL R11 1
0x0028140B, // 00A8 ADD R10 R10 R11
0x582C0011, // 00A9 LDCONST R11 K17
0x7C200600, // 00AA CALL R8 3
0x50200000, // 00AB LDBOOL R8 0 0
0xA8040001, // 00AC EXBLK 1 1
0x80041000, // 00AD RET 1 R8
0x8C200B2A, // 00AE GETMET R8 R5 K42
0x7C200200, // 00AF CALL R8 1
0x5C241000, // 00B0 MOVE R9 R8
0x74260002, // 00B1 JMPT R9 #00B5
0x50240000, // 00B2 LDBOOL R9 0 0
0xA8040001, // 00B3 EXBLK 1 1
0x80041200, // 00B4 RET 1 R9
0x88240B2C, // 00B5 GETMBR R9 R5 K44
0x0424132D, // 00B6 SUB R9 R9 K45
0x40261209, // 00B7 CONNECT R9 K9 R9
0x88280B2B, // 00B8 GETMBR R10 R5 K43
0x94241409, // 00B9 GETIDX R9 R10 R9
0x90165609, // 00BA SETMBR R5 K43 R9
0x88240B2B, // 00BB GETMBR R9 R5 K43
0x40241208, // 00BC CONNECT R9 R9 R8
0xB8260200, // 00BD GETNGBL R9 K1
0x8C241302, // 00BE GETMET R9 R9 K2
0x8C2C0916, // 00BF GETMET R11 R4 K22
0x5834002E, // 00C0 LDCONST R13 K46
0x88380B2C, // 00C1 GETMBR R14 R5 K44
0x883C0B2B, // 00C2 GETMBR R15 R5 K43
0x8C3C1F04, // 00C3 GETMET R15 R15 K4
0x7C3C0200, // 00C4 CALL R15 1
0x7C2C0800, // 00C5 CALL R11 4
0x58300011, // 00C6 LDCONST R12 K17
0x7C240600, // 00C7 CALL R9 3
0x8C240B19, // 00C8 GETMET R9 R5 K25
0x7C240200, // 00C9 CALL R9 1
0xB8260200, // 00CA GETNGBL R9 K1
0x8C241302, // 00CB GETMET R9 R9 K2
0x602C0008, // 00CC GETGBL R11 G8
0x88300B30, // 00CD GETMBR R12 R5 K48
0x7C2C0200, // 00CE CALL R11 1
0x002E5E0B, // 00CF ADD R11 K47 R11
0x002C1731, // 00D0 ADD R11 R11 K49
0x60300008, // 00D1 GETGBL R12 G8
0x88340B1C, // 00D2 GETMBR R13 R5 K28
0x7C300200, // 00D3 CALL R12 1
0x002C160C, // 00D4 ADD R11 R11 R12
0x002C1732, // 00D5 ADD R11 R11 K50
0x60300008, // 00D6 GETGBL R12 G8
0x88340B33, // 00D7 GETMBR R13 R5 K51
0x7C300200, // 00D8 CALL R12 1
0x002C160C, // 00D9 ADD R11 R11 R12
0x58300011, // 00DA LDCONST R12 K17
0x7C240600, // 00DB CALL R9 3
0x8824010B, // 00DC GETMBR R9 R0 K11
0x8C24131A, // 00DD GETMET R9 R9 K26
0x882C0B1B, // 00DE GETMBR R11 R5 K27
0x7C240400, // 00DF CALL R9 2
0x88240B30, // 00E0 GETMBR R9 R5 K48
0x1C281309, // 00E1 EQ R10 R9 K9
0x782A000C, // 00E2 JMPF R10 #00F0
0xB82A0200, // 00E3 GETNGBL R10 K1
0x8C281502, // 00E4 GETMET R10 R10 K2
0xB8320A00, // 00E5 GETNGBL R12 K5
0x8C301927, // 00E6 GETMET R12 R12 K39
0x5C380A00, // 00E7 MOVE R14 R5
0x7C300400, // 00E8 CALL R12 2
0x0032680C, // 00E9 ADD R12 K52 R12
0x58340011, // 00EA LDCONST R13 K17
0x7C280600, // 00EB CALL R10 3
0x50280200, // 00EC LDBOOL R10 1 0
0xA8040001, // 00ED EXBLK 1 1
0x80041400, // 00EE RET 1 R10
0x70020015, // 00EF JMP #0106
0x1C28132D, // 00F0 EQ R10 R9 K45
0x782A0008, // 00F1 JMPF R10 #00FB
0x88280135, // 00F2 GETMBR R10 R0 K53
0x8C281522, // 00F3 GETMET R10 R10 K34
0x5C300A00, // 00F4 MOVE R12 R5
0x5C340400, // 00F5 MOVE R13 R2
0x5C380600, // 00F6 MOVE R14 R3
0x7C280800, // 00F7 CALL R10 4
0xA8040001, // 00F8 EXBLK 1 1
0x80041400, // 00F9 RET 1 R10
0x7002000A, // 00FA JMP #0106
0xB82A0200, // 00FB GETNGBL R10 K1
0x8C281502, // 00FC GETMET R10 R10 K2
0x60300008, // 00FD GETGBL R12 G8
0x5C341200, // 00FE MOVE R13 R9
0x7C300200, // 00FF CALL R12 1
0x00326C0C, // 0100 ADD R12 K54 R12
0x58340011, // 0101 LDCONST R13 K17
0x7C280600, // 0102 CALL R10 3
0x50280000, // 0103 LDBOOL R10 0 0
0xA8040001, // 0104 EXBLK 1 1
0x80041400, // 0105 RET 1 R10
0x501C0200, // 0106 LDBOOL R7 1 0
0xA8040001, // 0107 EXBLK 1 1
0x80040E00, // 0108 RET 1 R7
0x5C240400, // 000D MOVE R9 R2
0x5C280600, // 000E MOVE R10 R3
0x7C140A00, // 000F CALL R5 5
0x8C180B07, // 0010 GETMET R6 R5 K7
0x7C180200, // 0011 CALL R6 1
0x5C1C0C00, // 0012 MOVE R7 R6
0x741E0002, // 0013 JMPT R7 #0017
0x501C0000, // 0014 LDBOOL R7 0 0
0xA8040001, // 0015 EXBLK 1 1
0x80040E00, // 0016 RET 1 R7
0x881C0B08, // 0017 GETMBR R7 R5 K8
0x1C1C0F09, // 0018 EQ R7 R7 K9
0x781E0057, // 0019 JMPF R7 #0072
0x881C0B0A, // 001A GETMBR R7 R5 K10
0x1C1C0F09, // 001B EQ R7 R7 K9
0x781E0054, // 001C JMPF R7 #0072
0x881C010B, // 001D GETMBR R7 R0 K11
0x881C0F0C, // 001E GETMBR R7 R7 K12
0x8C1C0F0D, // 001F GETMET R7 R7 K13
0x88240B0E, // 0020 GETMBR R9 R5 K14
0x542A0059, // 0021 LDINT R10 90
0x7C1C0600, // 0022 CALL R7 3
0xB8220200, // 0023 GETNGBL R8 K1
0x8C201102, // 0024 GETMET R8 R8 K2
0x60280008, // 0025 GETGBL R10 G8
0x882C0B0E, // 0026 GETMBR R11 R5 K14
0x7C280200, // 0027 CALL R10 1
0x002A1E0A, // 0028 ADD R10 K15 R10
0x00281510, // 0029 ADD R10 R10 K16
0x602C0008, // 002A GETGBL R11 G8
0x88300F08, // 002B GETMBR R12 R7 K8
0x7C2C0200, // 002C CALL R11 1
0x0028140B, // 002D ADD R10 R10 R11
0x582C0011, // 002E LDCONST R11 K17
0x7C200600, // 002F CALL R8 3
0x90162407, // 0030 SETMBR R5 K18 R7
0x88200113, // 0031 GETMBR R8 R0 K19
0x8C201114, // 0032 GETMET R8 R8 K20
0x88280B15, // 0033 GETMBR R10 R5 K21
0x502C0000, // 0034 LDBOOL R11 0 0
0x7C200600, // 0035 CALL R8 3
0x7422000D, // 0036 JMPT R8 #0045
0xB8220200, // 0037 GETNGBL R8 K1
0x8C201102, // 0038 GETMET R8 R8 K2
0x8C280916, // 0039 GETMET R10 R4 K22
0x58300017, // 003A LDCONST R12 K23
0x88340B15, // 003B GETMBR R13 R5 K21
0x88380113, // 003C GETMBR R14 R0 K19
0x8C381D18, // 003D GETMET R14 R14 K24
0x7C380200, // 003E CALL R14 1
0x7C280800, // 003F CALL R10 4
0x582C0011, // 0040 LDCONST R11 K17
0x7C200600, // 0041 CALL R8 3
0x50200000, // 0042 LDBOOL R8 0 0
0xA8040001, // 0043 EXBLK 1 1
0x80041000, // 0044 RET 1 R8
0x8C200B19, // 0045 GETMET R8 R5 K25
0x7C200200, // 0046 CALL R8 1
0x74220002, // 0047 JMPT R8 #004B
0x50200000, // 0048 LDBOOL R8 0 0
0xA8040001, // 0049 EXBLK 1 1
0x80041000, // 004A RET 1 R8
0x8820010B, // 004B GETMBR R8 R0 K11
0x8C20111A, // 004C GETMET R8 R8 K26
0x88280B1B, // 004D GETMBR R10 R5 K27
0x7C200400, // 004E CALL R8 2
0x88200B1C, // 004F GETMBR R8 R5 K28
0x5426000F, // 0050 LDINT R9 16
0x20201009, // 0051 NE R8 R8 R9
0x78220014, // 0052 JMPF R8 #0068
0xB8220A00, // 0053 GETNGBL R8 K5
0x8C20111D, // 0054 GETMET R8 R8 K29
0x88280B1C, // 0055 GETMBR R10 R5 K28
0x7C200400, // 0056 CALL R8 2
0x5C241000, // 0057 MOVE R9 R8
0x74260004, // 0058 JMPT R9 #005E
0x8C240916, // 0059 GETMET R9 R4 K22
0x582C001E, // 005A LDCONST R11 K30
0x88300B1C, // 005B GETMBR R12 R5 K28
0x7C240600, // 005C CALL R9 3
0x5C201200, // 005D MOVE R8 R9
0xB8260200, // 005E GETNGBL R9 K1
0x8C241302, // 005F GETMET R9 R9 K2
0x8C2C0916, // 0060 GETMET R11 R4 K22
0x5834001F, // 0061 LDCONST R13 K31
0x5C381000, // 0062 MOVE R14 R8
0x5C3C0400, // 0063 MOVE R15 R2
0x5C400600, // 0064 MOVE R16 R3
0x7C2C0A00, // 0065 CALL R11 5
0x58300020, // 0066 LDCONST R12 K32
0x7C240600, // 0067 CALL R9 3
0x88200121, // 0068 GETMBR R8 R0 K33
0x8C201122, // 0069 GETMET R8 R8 K34
0x5C280A00, // 006A MOVE R10 R5
0x5C2C0400, // 006B MOVE R11 R2
0x5C300600, // 006C MOVE R12 R3
0x7C200800, // 006D CALL R8 4
0x50200200, // 006E LDBOOL R8 1 0
0xA8040001, // 006F EXBLK 1 1
0x80041000, // 0070 RET 1 R8
0x70020095, // 0071 JMP #0108
0xB81E0200, // 0072 GETNGBL R7 K1
0x8C1C0F02, // 0073 GETMET R7 R7 K2
0x8C240916, // 0074 GETMET R9 R4 K22
0x582C0023, // 0075 LDCONST R11 K35
0x88300B08, // 0076 GETMBR R12 R5 K8
0x88340B15, // 0077 GETMBR R13 R5 K21
0x7C240800, // 0078 CALL R9 4
0x58280011, // 0079 LDCONST R10 K17
0x7C1C0600, // 007A CALL R7 3
0x881C010B, // 007B GETMBR R7 R0 K11
0x881C0F0C, // 007C GETMBR R7 R7 K12
0x8C1C0F24, // 007D GETMET R7 R7 K36
0x88240B08, // 007E GETMBR R9 R5 K8
0x7C1C0400, // 007F CALL R7 2
0x4C200000, // 0080 LDNIL R8
0x1C200E08, // 0081 EQ R8 R7 R8
0x78220013, // 0082 JMPF R8 #0097
0xB8220200, // 0083 GETNGBL R8 K1
0x8C201102, // 0084 GETMET R8 R8 K2
0x60280008, // 0085 GETGBL R10 G8
0x882C0B08, // 0086 GETMBR R11 R5 K8
0x7C280200, // 0087 CALL R10 1
0x002A4A0A, // 0088 ADD R10 K37 R10
0x582C0011, // 0089 LDCONST R11 K17
0x7C200600, // 008A CALL R8 3
0xB8220200, // 008B GETNGBL R8 K1
0x8C201102, // 008C GETMET R8 R8 K2
0xB82A0A00, // 008D GETNGBL R10 K5
0x8C281527, // 008E GETMET R10 R10 K39
0x5C300A00, // 008F MOVE R12 R5
0x7C280400, // 0090 CALL R10 2
0x002A4C0A, // 0091 ADD R10 K38 R10
0x582C0011, // 0092 LDCONST R11 K17
0x7C200600, // 0093 CALL R8 3
0x50200000, // 0094 LDBOOL R8 0 0
0xA8040001, // 0095 EXBLK 1 1
0x80041000, // 0096 RET 1 R8
0x90162407, // 0097 SETMBR R5 K18 R7
0x88200F13, // 0098 GETMBR R8 R7 K19
0x8C201114, // 0099 GETMET R8 R8 K20
0x88280B15, // 009A GETMBR R10 R5 K21
0x502C0200, // 009B LDBOOL R11 1 0
0x7C200600, // 009C CALL R8 3
0x74220011, // 009D JMPT R8 #00B0
0xB8220200, // 009E GETNGBL R8 K1
0x8C201102, // 009F GETMET R8 R8 K2
0x60280008, // 00A0 GETGBL R10 G8
0x882C0B15, // 00A1 GETMBR R11 R5 K21
0x7C280200, // 00A2 CALL R10 1
0x002A500A, // 00A3 ADD R10 K40 R10
0x00281529, // 00A4 ADD R10 R10 K41
0x602C0008, // 00A5 GETGBL R11 G8
0x88300F13, // 00A6 GETMBR R12 R7 K19
0x8C301918, // 00A7 GETMET R12 R12 K24
0x7C300200, // 00A8 CALL R12 1
0x7C2C0200, // 00A9 CALL R11 1
0x0028140B, // 00AA ADD R10 R10 R11
0x582C0011, // 00AB LDCONST R11 K17
0x7C200600, // 00AC CALL R8 3
0x50200000, // 00AD LDBOOL R8 0 0
0xA8040001, // 00AE EXBLK 1 1
0x80041000, // 00AF RET 1 R8
0x8C200B2A, // 00B0 GETMET R8 R5 K42
0x7C200200, // 00B1 CALL R8 1
0x5C241000, // 00B2 MOVE R9 R8
0x74260002, // 00B3 JMPT R9 #00B7
0x50240000, // 00B4 LDBOOL R9 0 0
0xA8040001, // 00B5 EXBLK 1 1
0x80041200, // 00B6 RET 1 R9
0x88240B2C, // 00B7 GETMBR R9 R5 K44
0x0424132D, // 00B8 SUB R9 R9 K45
0x40261209, // 00B9 CONNECT R9 K9 R9
0x88280B2B, // 00BA GETMBR R10 R5 K43
0x94241409, // 00BB GETIDX R9 R10 R9
0x90165609, // 00BC SETMBR R5 K43 R9
0x88240B2B, // 00BD GETMBR R9 R5 K43
0x40241208, // 00BE CONNECT R9 R9 R8
0xB8260200, // 00BF GETNGBL R9 K1
0x8C241302, // 00C0 GETMET R9 R9 K2
0x8C2C0916, // 00C1 GETMET R11 R4 K22
0x5834002E, // 00C2 LDCONST R13 K46
0x88380B2C, // 00C3 GETMBR R14 R5 K44
0x883C0B2B, // 00C4 GETMBR R15 R5 K43
0x8C3C1F04, // 00C5 GETMET R15 R15 K4
0x7C3C0200, // 00C6 CALL R15 1
0x7C2C0800, // 00C7 CALL R11 4
0x58300011, // 00C8 LDCONST R12 K17
0x7C240600, // 00C9 CALL R9 3
0x8C240B19, // 00CA GETMET R9 R5 K25
0x7C240200, // 00CB CALL R9 1
0xB8260200, // 00CC GETNGBL R9 K1
0x8C241302, // 00CD GETMET R9 R9 K2
0x602C0008, // 00CE GETGBL R11 G8
0x88300B30, // 00CF GETMBR R12 R5 K48
0x7C2C0200, // 00D0 CALL R11 1
0x002E5E0B, // 00D1 ADD R11 K47 R11
0x002C1731, // 00D2 ADD R11 R11 K49
0x60300008, // 00D3 GETGBL R12 G8
0x88340B1C, // 00D4 GETMBR R13 R5 K28
0x7C300200, // 00D5 CALL R12 1
0x002C160C, // 00D6 ADD R11 R11 R12
0x002C1732, // 00D7 ADD R11 R11 K50
0x60300008, // 00D8 GETGBL R12 G8
0x88340B33, // 00D9 GETMBR R13 R5 K51
0x7C300200, // 00DA CALL R12 1
0x002C160C, // 00DB ADD R11 R11 R12
0x58300011, // 00DC LDCONST R12 K17
0x7C240600, // 00DD CALL R9 3
0x8824010B, // 00DE GETMBR R9 R0 K11
0x8C24131A, // 00DF GETMET R9 R9 K26
0x882C0B1B, // 00E0 GETMBR R11 R5 K27
0x7C240400, // 00E1 CALL R9 2
0x88240B30, // 00E2 GETMBR R9 R5 K48
0x1C281309, // 00E3 EQ R10 R9 K9
0x782A000C, // 00E4 JMPF R10 #00F2
0xB82A0200, // 00E5 GETNGBL R10 K1
0x8C281502, // 00E6 GETMET R10 R10 K2
0xB8320A00, // 00E7 GETNGBL R12 K5
0x8C301927, // 00E8 GETMET R12 R12 K39
0x5C380A00, // 00E9 MOVE R14 R5
0x7C300400, // 00EA CALL R12 2
0x0032680C, // 00EB ADD R12 K52 R12
0x58340011, // 00EC LDCONST R13 K17
0x7C280600, // 00ED CALL R10 3
0x50280200, // 00EE LDBOOL R10 1 0
0xA8040001, // 00EF EXBLK 1 1
0x80041400, // 00F0 RET 1 R10
0x70020015, // 00F1 JMP #0108
0x1C28132D, // 00F2 EQ R10 R9 K45
0x782A0008, // 00F3 JMPF R10 #00FD
0x88280135, // 00F4 GETMBR R10 R0 K53
0x8C281522, // 00F5 GETMET R10 R10 K34
0x5C300A00, // 00F6 MOVE R12 R5
0x5C340400, // 00F7 MOVE R13 R2
0x5C380600, // 00F8 MOVE R14 R3
0x7C280800, // 00F9 CALL R10 4
0xA8040001, // 00FA EXBLK 1 1
0x80041400, // 00FB RET 1 R10
0x7002000A, // 00FC JMP #0108
0xB82A0200, // 00FD GETNGBL R10 K1
0x8C281502, // 00FE GETMET R10 R10 K2
0x60300008, // 00FF GETGBL R12 G8
0x5C341200, // 0100 MOVE R13 R9
0x7C300200, // 0101 CALL R12 1
0x00326C0C, // 0102 ADD R12 K54 R12
0x58340011, // 0103 LDCONST R13 K17
0x7C280600, // 0104 CALL R10 3
0x50280000, // 0105 LDBOOL R10 0 0
0xA8040001, // 0106 EXBLK 1 1
0x80041400, // 0107 RET 1 R10
0x501C0200, // 0108 LDBOOL R7 1 0
0xA8040001, // 0109 EXBLK 1 1
0x70020014, // 010A JMP #0120
0xAC140002, // 010B CATCH R5 0 2
0x70020011, // 010C JMP #011F
0xB81E0200, // 010D GETNGBL R7 K1
0x8C1C0F02, // 010E GETMET R7 R7 K2
0x60240008, // 010F GETGBL R9 G8
0x5C280A00, // 0110 MOVE R10 R5
0x7C240200, // 0111 CALL R9 1
0x00266E09, // 0112 ADD R9 K55 R9
0x00241338, // 0113 ADD R9 R9 K56
0x60280008, // 0114 GETGBL R10 G8
0x5C2C0C00, // 0115 MOVE R11 R6
0x7C280200, // 0116 CALL R10 1
0x0024120A, // 0117 ADD R9 R9 R10
0x7C1C0400, // 0118 CALL R7 2
0xA41E7200, // 0119 IMPORT R7 K57
0x8C200F3A, // 011A GETMET R8 R7 K58
0x7C200200, // 011B CALL R8 1
0x50200000, // 011C LDBOOL R8 0 0
0x80041000, // 011D RET 1 R8
0x70020000, // 011E JMP #0120
0xB0080000, // 011F RAISE 2 R0 R0
0x80000000, // 0120 RET 0
0x80040E00, // 010A RET 1 R7
0xA8040001, // 010B EXBLK 1 1
0x70020014, // 010C JMP #0122
0xAC140002, // 010D CATCH R5 0 2
0x70020011, // 010E JMP #0121
0xB81E0200, // 010F GETNGBL R7 K1
0x8C1C0F02, // 0110 GETMET R7 R7 K2
0x60240008, // 0111 GETGBL R9 G8
0x5C280A00, // 0112 MOVE R10 R5
0x7C240200, // 0113 CALL R9 1
0x00266E09, // 0114 ADD R9 K55 R9
0x00241338, // 0115 ADD R9 R9 K56
0x60280008, // 0116 GETGBL R10 G8
0x5C2C0C00, // 0117 MOVE R11 R6
0x7C280200, // 0118 CALL R10 1
0x0024120A, // 0119 ADD R9 R9 R10
0x7C1C0400, // 011A CALL R7 2
0xA41E7200, // 011B IMPORT R7 K57
0x8C200F3A, // 011C GETMET R8 R7 K58
0x7C200200, // 011D CALL R8 1
0x50200000, // 011E LDBOOL R8 0 0
0x80041000, // 011F RET 1 R8
0x70020000, // 0120 JMP #0122
0xB0080000, // 0121 RAISE 2 R0 R0
0x80000000, // 0122 RET 0
})
)
);
@ -474,7 +476,7 @@ be_local_closure(Matter_MessageHandler_add_session, /* name */
********************************************************************/
be_local_closure(Matter_MessageHandler_init, /* name */
be_nested_proto(
5, /* nstack */
6, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
@ -494,7 +496,7 @@ be_local_closure(Matter_MessageHandler_init, /* name */
}),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[16]) { /* code */
( &(const binstruction[17]) { /* code */
0x90020001, // 0000 SETMBR R0 K0 R1
0xB80A0400, // 0001 GETNGBL R2 K2
0x8C080503, // 0002 GETMET R2 R2 K3
@ -504,13 +506,14 @@ be_local_closure(Matter_MessageHandler_init, /* name */
0xB80A0400, // 0006 GETNGBL R2 K2
0x8C080505, // 0007 GETMET R2 R2 K5
0x5C100000, // 0008 MOVE R4 R0
0x7C080400, // 0009 CALL R2 2
0x90020802, // 000A SETMBR R0 K4 R2
0xB80A0400, // 000B GETNGBL R2 K2
0x8C080507, // 000C GETMET R2 R2 K7
0x7C080200, // 000D CALL R2 1
0x90020C02, // 000E SETMBR R0 K6 R2
0x80000000, // 000F RET 0
0x5C140200, // 0009 MOVE R5 R1
0x7C080600, // 000A CALL R2 3
0x90020802, // 000B SETMBR R0 K4 R2
0xB80A0400, // 000C GETNGBL R2 K2
0x8C080507, // 000D GETMET R2 R2 K7
0x7C080200, // 000E CALL R2 1
0x90020C02, // 000F SETMBR R0 K6 R2
0x80000000, // 0010 RET 0
})
)
);

View File

@ -7,26 +7,180 @@
extern const bclass be_class_Matter_Plugin;
/********************************************************************
** Solidified function: get_endpoints
** Solidified function: read_event
********************************************************************/
be_local_closure(Matter_Plugin_get_endpoints, /* name */
be_local_closure(Matter_Plugin_read_event, /* name */
be_nested_proto(
2, /* nstack */
1, /* argc */
6, /* nstack */
5, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
0, /* has constants */
NULL, /* no const */
be_str_weak(read_event),
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x4C140000, // 0000 LDNIL R5
0x80040A00, // 0001 RET 1 R5
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(Matter_Plugin_init, /* name */
be_nested_proto(
3, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(endpoints),
( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str_weak(device),
/* K1 */ be_nested_str_weak(endpoints),
/* K2 */ be_nested_str_weak(EMPTY_LIST),
/* K3 */ be_nested_str_weak(clusters),
}),
be_str_weak(get_endpoints),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x88040100, // 0000 GETMBR R1 R0 K0
0x80040200, // 0001 RET 1 R1
( &(const binstruction[ 6]) { /* code */
0x90020001, // 0000 SETMBR R0 K0 R1
0x88080102, // 0001 GETMBR R2 R0 K2
0x90020202, // 0002 SETMBR R0 K1 R2
0x88080102, // 0003 GETMBR R2 R0 K2
0x90020602, // 0004 SETMBR R0 K3 R2
0x80000000, // 0005 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: has
********************************************************************/
be_local_closure(Matter_Plugin_has, /* name */
be_nested_proto(
6, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str_weak(clusters),
/* K1 */ be_nested_str_weak(contains),
/* K2 */ be_nested_str_weak(endpoints),
/* K3 */ be_nested_str_weak(find),
}),
be_str_weak(has),
&be_const_str_solidified,
( &(const binstruction[15]) { /* code */
0x880C0100, // 0000 GETMBR R3 R0 K0
0x8C0C0701, // 0001 GETMET R3 R3 K1
0x5C140200, // 0002 MOVE R5 R1
0x7C0C0400, // 0003 CALL R3 2
0x780E0006, // 0004 JMPF R3 #000C
0x880C0102, // 0005 GETMBR R3 R0 K2
0x8C0C0703, // 0006 GETMET R3 R3 K3
0x5C140400, // 0007 MOVE R5 R2
0x7C0C0400, // 0008 CALL R3 2
0x4C100000, // 0009 LDNIL R4
0x200C0604, // 000A NE R3 R3 R4
0x740E0000, // 000B JMPT R3 #000D
0x500C0001, // 000C LDBOOL R3 0 1
0x500C0200, // 000D LDBOOL R3 1 0
0x80040600, // 000E RET 1 R3
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: get_attribute_list
********************************************************************/
be_local_closure(Matter_Plugin_get_attribute_list, /* 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[ 3]) { /* constants */
/* K0 */ be_nested_str_weak(clusters),
/* K1 */ be_nested_str_weak(find),
/* K2 */ be_nested_str_weak(EMPTY_LIST),
}),
be_str_weak(get_attribute_list),
&be_const_str_solidified,
( &(const binstruction[ 6]) { /* code */
0x880C0100, // 0000 GETMBR R3 R0 K0
0x8C0C0701, // 0001 GETMET R3 R3 K1
0x5C140400, // 0002 MOVE R5 R2
0x88180102, // 0003 GETMBR R6 R0 K2
0x7C0C0600, // 0004 CALL R3 3
0x80040600, // 0005 RET 1 R3
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: get_cluster_list
********************************************************************/
be_local_closure(Matter_Plugin_get_cluster_list, /* name */
be_nested_proto(
8, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str_weak(clusters),
/* K1 */ be_nested_str_weak(keys),
/* K2 */ be_nested_str_weak(push),
/* K3 */ be_nested_str_weak(stop_iteration),
}),
be_str_weak(get_cluster_list),
&be_const_str_solidified,
( &(const binstruction[18]) { /* code */
0x60080012, // 0000 GETGBL R2 G18
0x7C080000, // 0001 CALL R2 0
0x600C0010, // 0002 GETGBL R3 G16
0x88100100, // 0003 GETMBR R4 R0 K0
0x8C100901, // 0004 GETMET R4 R4 K1
0x7C100200, // 0005 CALL R4 1
0x7C0C0200, // 0006 CALL R3 1
0xA8020005, // 0007 EXBLK 0 #000E
0x5C100600, // 0008 MOVE R4 R3
0x7C100000, // 0009 CALL R4 0
0x8C140502, // 000A GETMET R5 R2 K2
0x5C1C0800, // 000B MOVE R7 R4
0x7C140400, // 000C CALL R5 2
0x7001FFF9, // 000D JMP #0008
0x580C0003, // 000E LDCONST R3 K3
0xAC0C0200, // 000F CATCH R3 1 0
0xB0080000, // 0010 RAISE 2 R0 R0
0x80040400, // 0011 RET 1 R2
})
)
);
@ -58,44 +212,13 @@ be_local_closure(Matter_Plugin_invoke_request, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(Matter_Plugin_init, /* name */
be_nested_proto(
3, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str_weak(device),
/* K1 */ be_nested_str_weak(endpoints),
}),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x90020001, // 0000 SETMBR R0 K0 R1
0x60080012, // 0001 GETGBL R2 G18
0x7C080000, // 0002 CALL R2 0
0x90020202, // 0003 SETMBR R0 K1 R2
0x80000000, // 0004 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: read_attribute
********************************************************************/
be_local_closure(Matter_Plugin_read_attribute, /* name */
be_nested_proto(
6, /* nstack */
5, /* argc */
4, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
@ -106,58 +229,8 @@ be_local_closure(Matter_Plugin_read_attribute, /* name */
be_str_weak(read_attribute),
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x4C140000, // 0000 LDNIL R5
0x80040A00, // 0001 RET 1 R5
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: read_event
********************************************************************/
be_local_closure(Matter_Plugin_read_event, /* name */
be_nested_proto(
6, /* nstack */
5, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
0, /* has constants */
NULL, /* no const */
be_str_weak(read_event),
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x4C140000, // 0000 LDNIL R5
0x80040A00, // 0001 RET 1 R5
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: subscribe_attribute
********************************************************************/
be_local_closure(Matter_Plugin_subscribe_attribute, /* name */
be_nested_proto(
6, /* nstack */
5, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
0, /* has constants */
NULL, /* no const */
be_str_weak(subscribe_attribute),
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x4C140000, // 0000 LDNIL R5
0x80040A00, // 0001 RET 1 R5
0x4C0C0000, // 0000 LDNIL R3
0x80040600, // 0001 RET 1 R3
})
)
);
@ -189,6 +262,60 @@ be_local_closure(Matter_Plugin_subscribe_event, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: get_cluster_map
********************************************************************/
be_local_closure(Matter_Plugin_get_cluster_map, /* 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(clusters),
}),
be_str_weak(get_cluster_map),
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x88040100, // 0000 GETMBR R1 R0 K0
0x80040200, // 0001 RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: get_endpoints
********************************************************************/
be_local_closure(Matter_Plugin_get_endpoints, /* name */
be_nested_proto(
2, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(endpoints),
}),
be_str_weak(get_endpoints),
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x88040100, // 0000 GETMBR R1 R0 K0
0x80040200, // 0001 RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: write_attribute
********************************************************************/
@ -239,25 +366,63 @@ be_local_closure(Matter_Plugin_timed_request, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: subscribe_attribute
********************************************************************/
be_local_closure(Matter_Plugin_subscribe_attribute, /* name */
be_nested_proto(
6, /* nstack */
5, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
0, /* has constants */
NULL, /* no const */
be_str_weak(subscribe_attribute),
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x4C140000, // 0000 LDNIL R5
0x80040A00, // 0001 RET 1 R5
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: Matter_Plugin
********************************************************************/
be_local_class(Matter_Plugin,
2,
3,
NULL,
be_nested_map(11,
be_nested_map(18,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(get_endpoints, -1), be_const_closure(Matter_Plugin_get_endpoints_closure) },
{ be_const_key_weak(endpoints, 7), be_const_var(1) },
{ be_const_key_weak(timed_request, 8), be_const_closure(Matter_Plugin_timed_request_closure) },
{ be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_read_attribute_closure) },
{ be_const_key_weak(read_event, -1), be_const_closure(Matter_Plugin_read_event_closure) },
{ be_const_key_weak(get_cluster_list, -1), be_const_closure(Matter_Plugin_get_cluster_list_closure) },
{ be_const_key_weak(endpoints, 1), be_const_var(1) },
{ be_const_key_weak(get_attribute_list, 9), be_const_closure(Matter_Plugin_get_attribute_list_closure) },
{ be_const_key_weak(device, -1), be_const_var(0) },
{ be_const_key_weak(subscribe_attribute, -1), be_const_closure(Matter_Plugin_subscribe_attribute_closure) },
{ be_const_key_weak(write_attribute, -1), be_const_closure(Matter_Plugin_write_attribute_closure) },
{ be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_invoke_request_closure) },
{ be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_read_attribute_closure) },
{ be_const_key_weak(has, 13), be_const_closure(Matter_Plugin_has_closure) },
{ be_const_key_weak(subscribe_event, -1), be_const_closure(Matter_Plugin_subscribe_event_closure) },
{ be_const_key_weak(init, 2), be_const_closure(Matter_Plugin_init_closure) },
{ be_const_key_weak(invoke_request, 1), be_const_closure(Matter_Plugin_invoke_request_closure) },
{ be_const_key_weak(get_cluster_map, -1), be_const_closure(Matter_Plugin_get_cluster_map_closure) },
{ be_const_key_weak(clusters, -1), be_const_var(2) },
{ be_const_key_weak(EMPTY_MAP, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(0,
( (struct bmapnode*) &(const bmapnode[]) {
})) ) } )) },
{ be_const_key_weak(get_endpoints, -1), be_const_closure(Matter_Plugin_get_endpoints_closure) },
{ be_const_key_weak(write_attribute, 2), be_const_closure(Matter_Plugin_write_attribute_closure) },
{ be_const_key_weak(timed_request, -1), be_const_closure(Matter_Plugin_timed_request_closure) },
{ be_const_key_weak(init, 4), be_const_closure(Matter_Plugin_init_closure) },
{ be_const_key_weak(subscribe_attribute, -1), be_const_closure(Matter_Plugin_subscribe_attribute_closure) },
{ be_const_key_weak(EMPTY_LIST, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(0,
( (struct bvalue*) &(const bvalue[]) {
})) ) } )) },
})),
be_str_weak(Matter_Plugin)
);

View File

@ -11,19 +11,102 @@ extern const bclass be_class_Matter_Plugin_Relay;
********************************************************************/
be_local_closure(Matter_Plugin_Relay_read_attribute, /* name */
be_nested_proto(
5, /* nstack */
5, /* argc */
15, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
0, /* has constants */
NULL, /* no const */
1, /* has constants */
( &(const bvalue[17]) { /* constants */
/* K0 */ be_nested_str_weak(string),
/* K1 */ be_nested_str_weak(matter),
/* K2 */ be_nested_str_weak(TLV),
/* K3 */ be_nested_str_weak(cluster),
/* K4 */ be_nested_str_weak(attribute),
/* K5 */ be_const_int(0),
/* K6 */ be_nested_str_weak(Matter_TLV_array),
/* K7 */ be_nested_str_weak(add_struct),
/* K8 */ be_nested_str_weak(add_TLV),
/* K9 */ be_nested_str_weak(U2),
/* K10 */ be_nested_str_weak(TYPES),
/* K11 */ be_const_int(1),
/* K12 */ be_nested_str_weak(get_cluster_list),
/* K13 */ be_nested_str_weak(U4),
/* K14 */ be_nested_str_weak(stop_iteration),
/* K15 */ be_const_int(2),
/* K16 */ be_const_int(3),
}),
be_str_weak(read_attribute),
&be_const_str_solidified,
( &(const binstruction[ 1]) { /* code */
0x80000000, // 0000 RET 0
( &(const binstruction[66]) { /* code */
0xA40E0000, // 0000 IMPORT R3 K0
0xB8120200, // 0001 GETNGBL R4 K1
0x88100902, // 0002 GETMBR R4 R4 K2
0x88140503, // 0003 GETMBR R5 R2 K3
0x88180504, // 0004 GETMBR R6 R2 K4
0x541E001C, // 0005 LDINT R7 29
0x1C1C0A07, // 0006 EQ R7 R5 R7
0x781E0038, // 0007 JMPF R7 #0041
0x1C1C0D05, // 0008 EQ R7 R6 K5
0x781E0010, // 0009 JMPF R7 #001B
0x8C1C0906, // 000A GETMET R7 R4 K6
0x7C1C0200, // 000B CALL R7 1
0x8C200F07, // 000C GETMET R8 R7 K7
0x7C200200, // 000D CALL R8 1
0x8C241108, // 000E GETMET R9 R8 K8
0x582C0005, // 000F LDCONST R11 K5
0x88300909, // 0010 GETMBR R12 R4 K9
0x8834010A, // 0011 GETMBR R13 R0 K10
0x94341B05, // 0012 GETIDX R13 R13 K5
0x7C240800, // 0013 CALL R9 4
0x8C241108, // 0014 GETMET R9 R8 K8
0x582C000B, // 0015 LDCONST R11 K11
0x88300909, // 0016 GETMBR R12 R4 K9
0x5834000B, // 0017 LDCONST R13 K11
0x7C240800, // 0018 CALL R9 4
0x80040E00, // 0019 RET 1 R7
0x70020025, // 001A JMP #0041
0x1C1C0D0B, // 001B EQ R7 R6 K11
0x781E0013, // 001C JMPF R7 #0031
0x8C1C0906, // 001D GETMET R7 R4 K6
0x7C1C0200, // 001E CALL R7 1
0x60200010, // 001F GETGBL R8 G16
0x8C24010C, // 0020 GETMET R9 R0 K12
0x7C240200, // 0021 CALL R9 1
0x7C200200, // 0022 CALL R8 1
0xA8020007, // 0023 EXBLK 0 #002C
0x5C241000, // 0024 MOVE R9 R8
0x7C240000, // 0025 CALL R9 0
0x8C280F08, // 0026 GETMET R10 R7 K8
0x4C300000, // 0027 LDNIL R12
0x8834090D, // 0028 GETMBR R13 R4 K13
0x5C381200, // 0029 MOVE R14 R9
0x7C280800, // 002A CALL R10 4
0x7001FFF7, // 002B JMP #0024
0x5820000E, // 002C LDCONST R8 K14
0xAC200200, // 002D CATCH R8 1 0
0xB0080000, // 002E RAISE 2 R0 R0
0x80040E00, // 002F RET 1 R7
0x7002000F, // 0030 JMP #0041
0x1C1C0D0F, // 0031 EQ R7 R6 K15
0x781E0008, // 0032 JMPF R7 #003C
0x8C1C0906, // 0033 GETMET R7 R4 K6
0x7C1C0200, // 0034 CALL R7 1
0x8C200F08, // 0035 GETMET R8 R7 K8
0x4C280000, // 0036 LDNIL R10
0x882C0909, // 0037 GETMBR R11 R4 K9
0x54320005, // 0038 LDINT R12 6
0x7C200800, // 0039 CALL R8 4
0x80040E00, // 003A RET 1 R7
0x70020004, // 003B JMP #0041
0x1C1C0D10, // 003C EQ R7 R6 K16
0x781E0002, // 003D JMPF R7 #0041
0x8C1C0906, // 003E GETMET R7 R4 K6
0x7C1C0200, // 003F CALL R7 1
0x80040E00, // 0040 RET 1 R7
0x80000000, // 0041 RET 0
})
)
);
@ -43,10 +126,12 @@ be_local_closure(Matter_Plugin_Relay_init, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 3]) { /* constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_weak(init),
/* K1 */ be_nested_str_weak(endpoints),
/* K2 */ be_const_int(1),
/* K2 */ be_nested_str_weak(ENDPOINTS),
/* K3 */ be_nested_str_weak(clusters),
/* K4 */ be_nested_str_weak(CLUSTERS),
}),
be_str_weak(init),
&be_const_str_solidified,
@ -57,10 +142,10 @@ be_local_closure(Matter_Plugin_Relay_init, /* name */
0x8C080500, // 0003 GETMET R2 R2 K0
0x5C100200, // 0004 MOVE R4 R1
0x7C080400, // 0005 CALL R2 2
0x60080012, // 0006 GETGBL R2 G18
0x7C080000, // 0007 CALL R2 0
0x400C0502, // 0008 CONNECT R3 R2 K2
0x90020202, // 0009 SETMBR R0 K1 R2
0x88080102, // 0006 GETMBR R2 R0 K2
0x90020202, // 0007 SETMBR R0 K1 R2
0x88080104, // 0008 GETMBR R2 R0 K4
0x90020602, // 0009 SETMBR R0 K3 R2
0x80000000, // 000A RET 0
})
)
@ -99,10 +184,53 @@ extern const bclass be_class_Matter_Plugin;
be_local_class(Matter_Plugin_Relay,
0,
&be_class_Matter_Plugin,
be_nested_map(3,
be_nested_map(6,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(read_attribute, 1), be_const_closure(Matter_Plugin_Relay_read_attribute_closure) },
{ be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Relay_read_attribute_closure) },
{ be_const_key_weak(ENDPOINTS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(1,
( (struct bvalue*) &(const bvalue[]) {
be_const_int(1),
})) ) } )) },
{ be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(1,
( (struct bvalue*) &(const bvalue[]) {
be_const_int(256),
})) ) } )) },
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Relay_init_closure) },
{ be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(6,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_int(6, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(1,
( (struct bvalue*) &(const bvalue[]) {
be_const_int(0),
})) ) } )) },
{ be_const_key_int(29, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(4,
( (struct bvalue*) &(const bvalue[]) {
be_const_int(0),
be_const_int(1),
be_const_int(2),
be_const_int(3),
})) ) } )) },
{ be_const_key_int(8, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(0,
( (struct bvalue*) &(const bvalue[]) {
})) ) } )) },
{ be_const_key_int(3, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(0,
( (struct bvalue*) &(const bvalue[]) {
})) ) } )) },
{ be_const_key_int(4, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(0,
( (struct bvalue*) &(const bvalue[]) {
})) ) } )) },
{ be_const_key_int(5, 1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(0,
( (struct bvalue*) &(const bvalue[]) {
})) ) } )) },
})) ) } )) },
{ be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Relay_invoke_request_closure) },
})),
be_str_weak(Matter_Plugin_Relay)

View File

@ -1434,6 +1434,45 @@ void be_load_Matter_TLV_item_class(bvm *vm) {
extern const bclass be_class_Matter_TLV_list;
/********************************************************************
** Solidified function: add_obj
********************************************************************/
be_local_closure(Matter_TLV_list_add_obj, /* name */
be_nested_proto(
7, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str_weak(to_TLV),
/* K1 */ be_nested_str_weak(tag_sub),
/* K2 */ be_nested_str_weak(val),
/* K3 */ be_nested_str_weak(push),
}),
be_str_weak(add_obj),
&be_const_str_solidified,
( &(const binstruction[11]) { /* code */
0x4C0C0000, // 0000 LDNIL R3
0x200C0403, // 0001 NE R3 R2 R3
0x780E0006, // 0002 JMPF R3 #000A
0x8C0C0500, // 0003 GETMET R3 R2 K0
0x7C0C0200, // 0004 CALL R3 1
0x900E0201, // 0005 SETMBR R3 K1 R1
0x88100102, // 0006 GETMBR R4 R0 K2
0x8C100903, // 0007 GETMET R4 R4 K3
0x5C180600, // 0008 MOVE R6 R3
0x7C100400, // 0009 CALL R4 2
0x80040000, // 000A RET 1 R0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: add_struct
********************************************************************/
@ -1474,117 +1513,9 @@ be_local_closure(Matter_TLV_list_add_struct, /* name */
/********************************************************************
** Solidified function: _encode_inner
** Solidified function: push
********************************************************************/
be_local_closure(Matter_TLV_list__encode_inner, /* name */
be_nested_proto(
9, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[10]) { /* constants */
/* K0 */ be_nested_str_weak(_encode_tag),
/* K1 */ be_nested_str_weak(val),
/* K2 */ be_nested_str_weak(copy),
/* K3 */ be_nested_str_weak(sort),
/* K4 */ be_nested_str_weak(encode),
/* K5 */ be_nested_str_weak(stop_iteration),
/* K6 */ be_nested_str_weak(add),
/* K7 */ be_nested_str_weak(TLV),
/* K8 */ be_nested_str_weak(EOC),
/* K9 */ be_const_int(1),
}),
be_str_weak(_encode_inner),
&be_const_str_solidified,
( &(const binstruction[35]) { /* code */
0x4C0C0000, // 0000 LDNIL R3
0x1C0C0203, // 0001 EQ R3 R1 R3
0x780E0002, // 0002 JMPF R3 #0006
0x600C0015, // 0003 GETGBL R3 G21
0x7C0C0000, // 0004 CALL R3 0
0x5C040600, // 0005 MOVE R1 R3
0x8C0C0100, // 0006 GETMET R3 R0 K0
0x5C140200, // 0007 MOVE R5 R1
0x7C0C0400, // 0008 CALL R3 2
0x880C0101, // 0009 GETMBR R3 R0 K1
0x8C0C0702, // 000A GETMET R3 R3 K2
0x7C0C0200, // 000B CALL R3 1
0x780A0002, // 000C JMPF R2 #0010
0x8C100103, // 000D GETMET R4 R0 K3
0x5C180600, // 000E MOVE R6 R3
0x7C100400, // 000F CALL R4 2
0x60100010, // 0010 GETGBL R4 G16
0x5C140600, // 0011 MOVE R5 R3
0x7C100200, // 0012 CALL R4 1
0xA8020005, // 0013 EXBLK 0 #001A
0x5C140800, // 0014 MOVE R5 R4
0x7C140000, // 0015 CALL R5 0
0x8C180B04, // 0016 GETMET R6 R5 K4
0x5C200200, // 0017 MOVE R8 R1
0x7C180400, // 0018 CALL R6 2
0x7001FFF9, // 0019 JMP #0014
0x58100005, // 001A LDCONST R4 K5
0xAC100200, // 001B CATCH R4 1 0
0xB0080000, // 001C RAISE 2 R0 R0
0x8C100306, // 001D GETMET R4 R1 K6
0x88180107, // 001E GETMBR R6 R0 K7
0x88180D08, // 001F GETMBR R6 R6 K8
0x581C0009, // 0020 LDCONST R7 K9
0x7C100600, // 0021 CALL R4 3
0x80040200, // 0022 RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: add_array
********************************************************************/
be_local_closure(Matter_TLV_list_add_array, /* name */
be_nested_proto(
6, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_weak(TLV),
/* K1 */ be_nested_str_weak(Matter_TLV_array),
/* K2 */ be_nested_str_weak(tag_sub),
/* K3 */ be_nested_str_weak(val),
/* K4 */ be_nested_str_weak(push),
}),
be_str_weak(add_array),
&be_const_str_solidified,
( &(const binstruction[10]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x5C100000, // 0002 MOVE R4 R0
0x7C080400, // 0003 CALL R2 2
0x900A0401, // 0004 SETMBR R2 K2 R1
0x880C0103, // 0005 GETMBR R3 R0 K3
0x8C0C0704, // 0006 GETMET R3 R3 K4
0x5C140400, // 0007 MOVE R5 R2
0x7C0C0400, // 0008 CALL R3 2
0x80040400, // 0009 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(Matter_TLV_list_init, /* name */
be_local_closure(Matter_TLV_list_push, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
@ -1594,29 +1525,18 @@ be_local_closure(Matter_TLV_list_init, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_weak(init),
/* K1 */ be_nested_str_weak(typ),
/* K2 */ be_nested_str_weak(TLV),
/* K3 */ be_nested_str_weak(LIST),
/* K4 */ be_nested_str_weak(val),
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str_weak(val),
/* K1 */ be_nested_str_weak(push),
}),
be_str_weak(init),
be_str_weak(push),
&be_const_str_solidified,
( &(const binstruction[13]) { /* code */
0x60080003, // 0000 GETGBL R2 G3
0x5C0C0000, // 0001 MOVE R3 R0
0x7C080200, // 0002 CALL R2 1
0x8C080500, // 0003 GETMET R2 R2 K0
0x5C100200, // 0004 MOVE R4 R1
0x7C080400, // 0005 CALL R2 2
0x88080102, // 0006 GETMBR R2 R0 K2
0x88080503, // 0007 GETMBR R2 R2 K3
0x90020202, // 0008 SETMBR R0 K1 R2
0x60080012, // 0009 GETGBL R2 G18
0x7C080000, // 000A CALL R2 0
0x90020802, // 000B SETMBR R0 K4 R2
0x80000000, // 000C RET 0
( &(const binstruction[ 5]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x5C100200, // 0002 MOVE R4 R1
0x7C080400, // 0003 CALL R2 2
0x80000000, // 0004 RET 0
})
)
);
@ -1624,28 +1544,30 @@ be_local_closure(Matter_TLV_list_init, /* name */
/********************************************************************
** Solidified function: size
** Solidified function: getsubval
********************************************************************/
be_local_closure(Matter_TLV_list_size, /* name */
be_local_closure(Matter_TLV_list_getsubval, /* name */
be_nested_proto(
3, /* nstack */
1, /* argc */
5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(val),
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str_weak(getsub),
/* K1 */ be_nested_str_weak(val),
}),
be_str_weak(size),
be_str_weak(getsubval),
&be_const_str_solidified,
( &(const binstruction[ 4]) { /* code */
0x6004000C, // 0000 GETGBL R1 G12
0x88080100, // 0001 GETMBR R2 R0 K0
0x7C040200, // 0002 CALL R1 1
0x80040200, // 0003 RET 1 R1
( &(const binstruction[ 5]) { /* code */
0x8C080100, // 0000 GETMET R2 R0 K0
0x5C100200, // 0001 MOVE R4 R1
0x7C080400, // 0002 CALL R2 2
0x88080501, // 0003 GETMBR R2 R2 K1
0x80040400, // 0004 RET 1 R2
})
)
);
@ -1720,11 +1642,11 @@ be_local_closure(Matter_TLV_list_item, /* name */
/********************************************************************
** Solidified function: tostring
** Solidified function: size
********************************************************************/
be_local_closure(Matter_TLV_list_tostring, /* name */
be_local_closure(Matter_TLV_list_size, /* name */
be_nested_proto(
6, /* nstack */
3, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
@ -1732,63 +1654,16 @@ be_local_closure(Matter_TLV_list_tostring, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 3]) { /* constants */
/* K0 */ be_nested_str_weak(tostring_inner),
/* K1 */ be_nested_str_weak(_X5B_X5B),
/* K2 */ be_nested_str_weak(_X5D_X5D),
}),
be_str_weak(tostring),
&be_const_str_solidified,
( &(const binstruction[ 6]) { /* code */
0x8C040100, // 0000 GETMET R1 R0 K0
0x500C0000, // 0001 LDBOOL R3 0 0
0x58100001, // 0002 LDCONST R4 K1
0x58140002, // 0003 LDCONST R5 K2
0x7C040800, // 0004 CALL R1 4
0x80040200, // 0005 RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: findsub
********************************************************************/
be_local_closure(Matter_TLV_list_findsub, /* name */
be_nested_proto(
6, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 3]) { /* constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(val),
/* K1 */ be_nested_str_weak(tag_sub),
/* K2 */ be_nested_str_weak(stop_iteration),
}),
be_str_weak(findsub),
be_str_weak(size),
&be_const_str_solidified,
( &(const binstruction[16]) { /* code */
0x600C0010, // 0000 GETGBL R3 G16
0x88100100, // 0001 GETMBR R4 R0 K0
0x7C0C0200, // 0002 CALL R3 1
0xA8020007, // 0003 EXBLK 0 #000C
0x5C100600, // 0004 MOVE R4 R3
0x7C100000, // 0005 CALL R4 0
0x88140901, // 0006 GETMBR R5 R4 K1
0x1C140A01, // 0007 EQ R5 R5 R1
0x78160001, // 0008 JMPF R5 #000B
0xA8040001, // 0009 EXBLK 1 1
0x80040800, // 000A RET 1 R4
0x7001FFF7, // 000B JMP #0004
0x580C0002, // 000C LDCONST R3 K2
0xAC0C0200, // 000D CATCH R3 1 0
0xB0080000, // 000E RAISE 2 R0 R0
0x80040400, // 000F RET 1 R2
( &(const binstruction[ 4]) { /* code */
0x6004000C, // 0000 GETGBL R1 G12
0x88080100, // 0001 GETMBR R2 R0 K0
0x7C040200, // 0002 CALL R1 1
0x80040200, // 0003 RET 1 R1
})
)
);
@ -1831,6 +1706,37 @@ be_local_closure(Matter_TLV_list_findsubtyp, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: encode
********************************************************************/
be_local_closure(Matter_TLV_list_encode, /* name */
be_nested_proto(
6, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str_weak(_encode_inner),
/* K1 */ be_nested_str_weak(is_struct),
}),
be_str_weak(encode),
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x8C080100, // 0000 GETMET R2 R0 K0
0x5C100200, // 0001 MOVE R4 R1
0x88140101, // 0002 GETMBR R5 R0 K1
0x7C080600, // 0003 CALL R2 3
0x80040400, // 0004 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: tostring_inner
********************************************************************/
@ -1958,6 +1864,39 @@ be_local_closure(Matter_TLV_list_tostring_inner, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: tostring
********************************************************************/
be_local_closure(Matter_TLV_list_tostring, /* name */
be_nested_proto(
6, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 3]) { /* constants */
/* K0 */ be_nested_str_weak(tostring_inner),
/* K1 */ be_nested_str_weak(_X5B_X5B),
/* K2 */ be_nested_str_weak(_X5D_X5D),
}),
be_str_weak(tostring),
&be_const_str_solidified,
( &(const binstruction[ 6]) { /* code */
0x8C040100, // 0000 GETMET R1 R0 K0
0x500C0000, // 0001 LDBOOL R3 0 0
0x58100001, // 0002 LDCONST R4 K1
0x58140002, // 0003 LDCONST R5 K2
0x7C040800, // 0004 CALL R1 4
0x80040200, // 0005 RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: findsubval
********************************************************************/
@ -1994,60 +1933,9 @@ be_local_closure(Matter_TLV_list_findsubval, /* name */
/********************************************************************
** Solidified function: parse
** Solidified function: init
********************************************************************/
be_local_closure(Matter_TLV_list_parse, /* name */
be_nested_proto(
8, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 7]) { /* constants */
/* K0 */ be_nested_str_weak(TLV),
/* K1 */ be_nested_str_weak(EOC),
/* K2 */ be_nested_str_weak(parse),
/* K3 */ be_nested_str_weak(next_idx),
/* K4 */ be_nested_str_weak(val),
/* K5 */ be_nested_str_weak(push),
/* K6 */ be_const_int(1),
}),
be_str_weak(parse),
&be_const_str_solidified,
( &(const binstruction[20]) { /* code */
0x940C0202, // 0000 GETIDX R3 R1 R2
0x88100100, // 0001 GETMBR R4 R0 K0
0x88100901, // 0002 GETMBR R4 R4 K1
0x200C0604, // 0003 NE R3 R3 R4
0x780E000B, // 0004 JMPF R3 #0011
0x880C0100, // 0005 GETMBR R3 R0 K0
0x8C0C0702, // 0006 GETMET R3 R3 K2
0x5C140200, // 0007 MOVE R5 R1
0x5C180400, // 0008 MOVE R6 R2
0x5C1C0000, // 0009 MOVE R7 R0
0x7C0C0800, // 000A CALL R3 4
0x88080703, // 000B GETMBR R2 R3 K3
0x88100104, // 000C GETMBR R4 R0 K4
0x8C100905, // 000D GETMET R4 R4 K5
0x5C180600, // 000E MOVE R6 R3
0x7C100400, // 000F CALL R4 2
0x7001FFEE, // 0010 JMP #0000
0x00080506, // 0011 ADD R2 R2 K6
0x90020602, // 0012 SETMBR R0 K3 R2
0x80040400, // 0013 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: getsubval
********************************************************************/
be_local_closure(Matter_TLV_list_getsubval, /* name */
be_local_closure(Matter_TLV_list_init, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
@ -2057,18 +1945,29 @@ be_local_closure(Matter_TLV_list_getsubval, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str_weak(getsub),
/* K1 */ be_nested_str_weak(val),
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_weak(init),
/* K1 */ be_nested_str_weak(typ),
/* K2 */ be_nested_str_weak(TLV),
/* K3 */ be_nested_str_weak(LIST),
/* K4 */ be_nested_str_weak(val),
}),
be_str_weak(getsubval),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x8C080100, // 0000 GETMET R2 R0 K0
0x5C100200, // 0001 MOVE R4 R1
0x7C080400, // 0002 CALL R2 2
0x88080501, // 0003 GETMBR R2 R2 K1
0x80040400, // 0004 RET 1 R2
( &(const binstruction[13]) { /* code */
0x60080003, // 0000 GETGBL R2 G3
0x5C0C0000, // 0001 MOVE R3 R0
0x7C080200, // 0002 CALL R2 1
0x8C080500, // 0003 GETMET R2 R2 K0
0x5C100200, // 0004 MOVE R4 R1
0x7C080400, // 0005 CALL R2 2
0x88080102, // 0006 GETMBR R2 R0 K2
0x88080503, // 0007 GETMBR R2 R2 K3
0x90020202, // 0008 SETMBR R0 K1 R2
0x60080012, // 0009 GETGBL R2 G18
0x7C080000, // 000A CALL R2 0
0x90020802, // 000B SETMBR R0 K4 R2
0x80000000, // 000C RET 0
})
)
);
@ -2076,48 +1975,9 @@ be_local_closure(Matter_TLV_list_getsubval, /* name */
/********************************************************************
** Solidified function: add_obj
** Solidified function: add_array
********************************************************************/
be_local_closure(Matter_TLV_list_add_obj, /* name */
be_nested_proto(
7, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str_weak(to_TLV),
/* K1 */ be_nested_str_weak(tag_sub),
/* K2 */ be_nested_str_weak(val),
/* K3 */ be_nested_str_weak(push),
}),
be_str_weak(add_obj),
&be_const_str_solidified,
( &(const binstruction[11]) { /* code */
0x4C0C0000, // 0000 LDNIL R3
0x200C0403, // 0001 NE R3 R2 R3
0x780E0006, // 0002 JMPF R3 #000A
0x8C0C0500, // 0003 GETMET R3 R2 K0
0x7C0C0200, // 0004 CALL R3 1
0x900E0201, // 0005 SETMBR R3 K1 R1
0x88100102, // 0006 GETMBR R4 R0 K2
0x8C100903, // 0007 GETMET R4 R4 K3
0x5C180600, // 0008 MOVE R6 R3
0x7C100400, // 0009 CALL R4 2
0x80040000, // 000A RET 1 R0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: encode
********************************************************************/
be_local_closure(Matter_TLV_list_encode, /* name */
be_local_closure(Matter_TLV_list_add_array, /* name */
be_nested_proto(
6, /* nstack */
2, /* argc */
@ -2127,76 +1987,26 @@ be_local_closure(Matter_TLV_list_encode, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(_encode_inner),
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_weak(TLV),
/* K1 */ be_nested_str_weak(Matter_TLV_array),
/* K2 */ be_nested_str_weak(tag_sub),
/* K3 */ be_nested_str_weak(val),
/* K4 */ be_nested_str_weak(push),
}),
be_str_weak(encode),
be_str_weak(add_array),
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x8C080100, // 0000 GETMET R2 R0 K0
0x5C100200, // 0001 MOVE R4 R1
0x50140000, // 0002 LDBOOL R5 0 0
0x7C080600, // 0003 CALL R2 3
0x80040400, // 0004 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: setitem
********************************************************************/
be_local_closure(Matter_TLV_list_setitem, /* name */
be_nested_proto(
4, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(val),
}),
be_str_weak(setitem),
&be_const_str_solidified,
( &(const binstruction[ 3]) { /* code */
0x880C0100, // 0000 GETMBR R3 R0 K0
0x980C0202, // 0001 SETIDX R3 R1 R2
0x80000000, // 0002 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: push
********************************************************************/
be_local_closure(Matter_TLV_list_push, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str_weak(val),
/* K1 */ be_nested_str_weak(push),
}),
be_str_weak(push),
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
( &(const binstruction[10]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x5C100200, // 0002 MOVE R4 R1
0x5C100000, // 0002 MOVE R4 R0
0x7C080400, // 0003 CALL R2 2
0x80000000, // 0004 RET 0
0x900A0401, // 0004 SETMBR R2 K2 R1
0x880C0103, // 0005 GETMBR R3 R0 K3
0x8C0C0704, // 0006 GETMET R3 R3 K4
0x5C140400, // 0007 MOVE R5 R2
0x7C0C0400, // 0008 CALL R3 2
0x80040400, // 0009 RET 1 R2
})
)
);
@ -2255,6 +2065,197 @@ be_local_closure(Matter_TLV_list_add_TLV, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: setitem
********************************************************************/
be_local_closure(Matter_TLV_list_setitem, /* name */
be_nested_proto(
4, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(val),
}),
be_str_weak(setitem),
&be_const_str_solidified,
( &(const binstruction[ 3]) { /* code */
0x880C0100, // 0000 GETMBR R3 R0 K0
0x980C0202, // 0001 SETIDX R3 R1 R2
0x80000000, // 0002 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: _encode_inner
********************************************************************/
be_local_closure(Matter_TLV_list__encode_inner, /* name */
be_nested_proto(
9, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[10]) { /* constants */
/* K0 */ be_nested_str_weak(_encode_tag),
/* K1 */ be_nested_str_weak(val),
/* K2 */ be_nested_str_weak(copy),
/* K3 */ be_nested_str_weak(sort),
/* K4 */ be_nested_str_weak(encode),
/* K5 */ be_nested_str_weak(stop_iteration),
/* K6 */ be_nested_str_weak(add),
/* K7 */ be_nested_str_weak(TLV),
/* K8 */ be_nested_str_weak(EOC),
/* K9 */ be_const_int(1),
}),
be_str_weak(_encode_inner),
&be_const_str_solidified,
( &(const binstruction[35]) { /* code */
0x4C0C0000, // 0000 LDNIL R3
0x1C0C0203, // 0001 EQ R3 R1 R3
0x780E0002, // 0002 JMPF R3 #0006
0x600C0015, // 0003 GETGBL R3 G21
0x7C0C0000, // 0004 CALL R3 0
0x5C040600, // 0005 MOVE R1 R3
0x8C0C0100, // 0006 GETMET R3 R0 K0
0x5C140200, // 0007 MOVE R5 R1
0x7C0C0400, // 0008 CALL R3 2
0x880C0101, // 0009 GETMBR R3 R0 K1
0x8C0C0702, // 000A GETMET R3 R3 K2
0x7C0C0200, // 000B CALL R3 1
0x780A0002, // 000C JMPF R2 #0010
0x8C100103, // 000D GETMET R4 R0 K3
0x5C180600, // 000E MOVE R6 R3
0x7C100400, // 000F CALL R4 2
0x60100010, // 0010 GETGBL R4 G16
0x5C140600, // 0011 MOVE R5 R3
0x7C100200, // 0012 CALL R4 1
0xA8020005, // 0013 EXBLK 0 #001A
0x5C140800, // 0014 MOVE R5 R4
0x7C140000, // 0015 CALL R5 0
0x8C180B04, // 0016 GETMET R6 R5 K4
0x5C200200, // 0017 MOVE R8 R1
0x7C180400, // 0018 CALL R6 2
0x7001FFF9, // 0019 JMP #0014
0x58100005, // 001A LDCONST R4 K5
0xAC100200, // 001B CATCH R4 1 0
0xB0080000, // 001C RAISE 2 R0 R0
0x8C100306, // 001D GETMET R4 R1 K6
0x88180107, // 001E GETMBR R6 R0 K7
0x88180D08, // 001F GETMBR R6 R6 K8
0x581C0009, // 0020 LDCONST R7 K9
0x7C100600, // 0021 CALL R4 3
0x80040200, // 0022 RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: findsub
********************************************************************/
be_local_closure(Matter_TLV_list_findsub, /* name */
be_nested_proto(
6, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 3]) { /* constants */
/* K0 */ be_nested_str_weak(val),
/* K1 */ be_nested_str_weak(tag_sub),
/* K2 */ be_nested_str_weak(stop_iteration),
}),
be_str_weak(findsub),
&be_const_str_solidified,
( &(const binstruction[16]) { /* code */
0x600C0010, // 0000 GETGBL R3 G16
0x88100100, // 0001 GETMBR R4 R0 K0
0x7C0C0200, // 0002 CALL R3 1
0xA8020007, // 0003 EXBLK 0 #000C
0x5C100600, // 0004 MOVE R4 R3
0x7C100000, // 0005 CALL R4 0
0x88140901, // 0006 GETMBR R5 R4 K1
0x1C140A01, // 0007 EQ R5 R5 R1
0x78160001, // 0008 JMPF R5 #000B
0xA8040001, // 0009 EXBLK 1 1
0x80040800, // 000A RET 1 R4
0x7001FFF7, // 000B JMP #0004
0x580C0002, // 000C LDCONST R3 K2
0xAC0C0200, // 000D CATCH R3 1 0
0xB0080000, // 000E RAISE 2 R0 R0
0x80040400, // 000F RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: parse
********************************************************************/
be_local_closure(Matter_TLV_list_parse, /* name */
be_nested_proto(
8, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 7]) { /* constants */
/* K0 */ be_nested_str_weak(TLV),
/* K1 */ be_nested_str_weak(EOC),
/* K2 */ be_nested_str_weak(parse),
/* K3 */ be_nested_str_weak(next_idx),
/* K4 */ be_nested_str_weak(val),
/* K5 */ be_nested_str_weak(push),
/* K6 */ be_const_int(1),
}),
be_str_weak(parse),
&be_const_str_solidified,
( &(const binstruction[20]) { /* code */
0x940C0202, // 0000 GETIDX R3 R1 R2
0x88100100, // 0001 GETMBR R4 R0 K0
0x88100901, // 0002 GETMBR R4 R4 K1
0x200C0604, // 0003 NE R3 R3 R4
0x780E000B, // 0004 JMPF R3 #0011
0x880C0100, // 0005 GETMBR R3 R0 K0
0x8C0C0702, // 0006 GETMET R3 R3 K2
0x5C140200, // 0007 MOVE R5 R1
0x5C180400, // 0008 MOVE R6 R2
0x5C1C0000, // 0009 MOVE R7 R0
0x7C0C0800, // 000A CALL R3 4
0x88080703, // 000B GETMBR R2 R3 K3
0x88100104, // 000C GETMBR R4 R0 K4
0x8C100905, // 000D GETMET R4 R4 K5
0x5C180600, // 000E MOVE R6 R3
0x7C100400, // 000F CALL R4 2
0x7001FFEE, // 0010 JMP #0000
0x00080506, // 0011 ADD R2 R2 K6
0x90020602, // 0012 SETMBR R0 K3 R2
0x80040400, // 0013 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: getsub
********************************************************************/
@ -2297,28 +2298,29 @@ extern const bclass be_class_Matter_TLV_item;
be_local_class(Matter_TLV_list,
0,
&be_class_Matter_TLV_item,
be_nested_map(20,
be_nested_map(21,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(add_struct, -1), be_const_closure(Matter_TLV_list_add_struct_closure) },
{ be_const_key_weak(getsub, -1), be_const_closure(Matter_TLV_list_getsub_closure) },
{ be_const_key_weak(add_array, -1), be_const_closure(Matter_TLV_list_add_array_closure) },
{ be_const_key_weak(add_TLV, -1), be_const_closure(Matter_TLV_list_add_TLV_closure) },
{ be_const_key_weak(size, -1), be_const_closure(Matter_TLV_list_size_closure) },
{ be_const_key_weak(add_list, 18), be_const_closure(Matter_TLV_list_add_list_closure) },
{ be_const_key_weak(item, 13), be_const_closure(Matter_TLV_list_item_closure) },
{ be_const_key_weak(findsubval, -1), be_const_closure(Matter_TLV_list_findsubval_closure) },
{ be_const_key_weak(parse, -1), be_const_closure(Matter_TLV_list_parse_closure) },
{ be_const_key_weak(findsubtyp, 3), be_const_closure(Matter_TLV_list_findsubtyp_closure) },
{ be_const_key_weak(tostring_inner, -1), be_const_closure(Matter_TLV_list_tostring_inner_closure) },
{ be_const_key_weak(encode, 7), be_const_closure(Matter_TLV_list_encode_closure) },
{ be_const_key_weak(findsub, 8), be_const_closure(Matter_TLV_list_findsub_closure) },
{ be_const_key_weak(getsubval, -1), be_const_closure(Matter_TLV_list_getsubval_closure) },
{ be_const_key_weak(add_obj, -1), be_const_closure(Matter_TLV_list_add_obj_closure) },
{ be_const_key_weak(init, 11), be_const_closure(Matter_TLV_list_init_closure) },
{ be_const_key_weak(setitem, -1), be_const_closure(Matter_TLV_list_setitem_closure) },
{ be_const_key_weak(add_struct, -1), be_const_closure(Matter_TLV_list_add_struct_closure) },
{ be_const_key_weak(push, -1), be_const_closure(Matter_TLV_list_push_closure) },
{ be_const_key_weak(tostring, -1), be_const_closure(Matter_TLV_list_tostring_closure) },
{ be_const_key_weak(_encode_inner, 1), be_const_closure(Matter_TLV_list__encode_inner_closure) },
{ be_const_key_weak(getsubval, 20), be_const_closure(Matter_TLV_list_getsubval_closure) },
{ be_const_key_weak(getsub, -1), be_const_closure(Matter_TLV_list_getsub_closure) },
{ be_const_key_weak(parse, -1), be_const_closure(Matter_TLV_list_parse_closure) },
{ be_const_key_weak(size, -1), be_const_closure(Matter_TLV_list_size_closure) },
{ be_const_key_weak(findsubtyp, -1), be_const_closure(Matter_TLV_list_findsubtyp_closure) },
{ be_const_key_weak(encode, -1), be_const_closure(Matter_TLV_list_encode_closure) },
{ be_const_key_weak(tostring_inner, 4), be_const_closure(Matter_TLV_list_tostring_inner_closure) },
{ be_const_key_weak(tostring, 16), be_const_closure(Matter_TLV_list_tostring_closure) },
{ be_const_key_weak(findsubval, -1), be_const_closure(Matter_TLV_list_findsubval_closure) },
{ be_const_key_weak(init, -1), be_const_closure(Matter_TLV_list_init_closure) },
{ be_const_key_weak(add_array, 15), be_const_closure(Matter_TLV_list_add_array_closure) },
{ be_const_key_weak(add_TLV, 18), be_const_closure(Matter_TLV_list_add_TLV_closure) },
{ be_const_key_weak(findsub, -1), be_const_closure(Matter_TLV_list_findsub_closure) },
{ be_const_key_weak(_encode_inner, -1), be_const_closure(Matter_TLV_list__encode_inner_closure) },
{ be_const_key_weak(is_struct, -1), be_const_bool(0) },
{ be_const_key_weak(setitem, -1), be_const_closure(Matter_TLV_list_setitem_closure) },
{ be_const_key_weak(item, 5), be_const_closure(Matter_TLV_list_item_closure) },
{ be_const_key_weak(add_list, -1), be_const_closure(Matter_TLV_list_add_list_closure) },
})),
be_str_weak(Matter_TLV_list)
);
@ -2407,36 +2409,6 @@ be_local_closure(Matter_TLV_struct_tostring, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: encode
********************************************************************/
be_local_closure(Matter_TLV_struct_encode, /* name */
be_nested_proto(
6, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(_encode_inner),
}),
be_str_weak(encode),
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x8C080100, // 0000 GETMET R2 R0 K0
0x5C100200, // 0001 MOVE R4 R1
0x50140200, // 0002 LDBOOL R5 1 0
0x7C080600, // 0003 CALL R2 3
0x80040400, // 0004 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: Matter_TLV_struct
********************************************************************/
@ -2448,7 +2420,7 @@ be_local_class(Matter_TLV_struct,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(init, -1), be_const_closure(Matter_TLV_struct_init_closure) },
{ be_const_key_weak(tostring, -1), be_const_closure(Matter_TLV_struct_tostring_closure) },
{ be_const_key_weak(encode, -1), be_const_closure(Matter_TLV_struct_encode_closure) },
{ be_const_key_weak(is_struct, -1), be_const_bool(1) },
})),
be_str_weak(Matter_TLV_struct)
);