Matter prepare events (#21647)

This commit is contained in:
s-hadinger 2024-06-16 18:42:23 +02:00 committed by GitHub
parent 2ce513f50c
commit 0d267a546a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 10068 additions and 8365 deletions

View File

@ -216,6 +216,7 @@ extern const bclass be_class_Matter_TLV; // need to declare it upfront because
#include "solidify/solidified_Matter_IM_Message.h"
#include "solidify/solidified_Matter_IM_Subscription.h"
#include "solidify/solidified_Matter_IM.h"
#include "solidify/solidified_Matter_EventHandler.h"
#include "solidify/solidified_Matter_Control_Message.h"
#include "solidify/solidified_Matter_Plugin_0.h"
#include "solidify/solidified_Matter_Base38.h"
@ -259,6 +260,7 @@ extern const bclass be_class_Matter_TLV; // need to declare it upfront because
#include "solidify/solidified_Matter_Plugin_3_Sensor_Rain.h"
#include "solidify/solidified_Matter_Plugin_3_Sensor_Waterleak.h"
#include "solidify/solidified_Matter_Plugin_2_Fan.h"
#include "solidify/solidified_Matter_Plugin_2_Sensor_GenericSwitch.h"
#include "solidify/solidified_Matter_Plugin_9_Virt_Fan.h"
#include "solidify/solidified_Matter_Plugin_9_Virt_Sensor_Contact.h"
#include "solidify/solidified_Matter_Plugin_9_Virt_Sensor_Occupancy.h"
@ -337,6 +339,11 @@ module matter (scope: global, strings: weak) {
UC_LIST, closure(module_matter_UC_LIST_closure)
Profiler, class(be_class_Matter_Profiler)
// EVents priority levels
EVENT_DEBUG, int(0)
EVENT_INFO, int(1)
EVENT_CRITICAL, int(2)
// Status codes
SUCCESS, int(0x00)
FAILURE, int(0x01)
@ -429,6 +436,10 @@ module matter (scope: global, strings: weak) {
Frame, class(be_class_Matter_Frame)
MessageHandler, class(be_class_Matter_MessageHandler)
// Event Handler
EventHandler, class(be_class_Matter_EventHandler)
EventQueued, class(be_class_Matter_EventQueued)
// Interation Model
Path, class(be_class_Matter_Path)
PathGenerator, class(be_class_Matter_PathGenerator)

View File

@ -0,0 +1,220 @@
#
# Matter_EventHandler.be - suppport for Matter Events
#
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import matter
#@ solidify:Matter_EventHandler,weak
#@ solidify:Matter_EventQueued,weak
#################################################################################
# Matter_Event_Queued class
#
# This class encapsulates any element within teh event queue
# Takes a `Matter_EventDataIB`
#
# Invariants:
# `priority` is guaranteed to be in range 0..2
#################################################################################
class Matter_EventQueued
# common elements
var endpoint
var cluster
var event_id
var is_urgent
var priority
var event_no
var raw_tlv # content encoded as full TLV
def init(event_ib)
self.endpoint = event_ib.path.endpoint
self.cluster = event_ib.path.cluster
self.event_id = event_ib.path.event
self.is_urgent = event_ib.path.is_urgent
self.priority = event_ib.priority
if (self.priority < 0) self.priority = 0 end
if (self.priority > matter.EVENT_CRITICAL) self.priority = matter.EVENT_CRITICAL end
self.event_no = int64.toint64(event_ib.event_number) # int64
self.raw_tlv = event_ib.to_TLV().tlv2raw() # bytes()
end
end
matter.EventQueued = Matter_EventQueued
# elements are made of `Matter_EventDataIB`
# var path #
# var node # u64 as bytes
# var endpoint # u16
# var cluster # u32
# var event # u32
# var is_urgent # bool
# var event_number # u64 as bytes
# var priority # u8
# # one of
# var epoch_timestamp # u64
# var system_timestamp # u64
# var delta_epoch_timestamp # u64
# var delta_system_timestamp # u64
# # data
# var data # any TLV
# EVENT_DEBUG=0
# EVENT_INFO=1
# EVENT_CRITICAL=2
#################################################################################
# Matter_IM class
#################################################################################
class Matter_EventHandler
static var EVENT_NO_INCR = 1000 # counter increased when persisting
static var EVENT_NO_FILENAME = "_matter_event_no"
static var EVENT_QUEUE_SIZE_MAX = 10 # each queue is 10 elements depth
# circular buffers
var queue_debug # queue of events for level DEBUG
var queue_info # queue of events for level INFO
var queue_critical # queue of events for level CRITICAL
var device # link back to matter_device top object
# Events
var counter_event_no # event number, monotonically increasing even after restarts
var counter_event_no_persisted # the nest number persisted for after the restart
def init(device)
self.device = device
self.queue_debug = []
self.queue_info = []
self.queue_critical = []
self.load_event_no_persisted() # initializes self.counter_event_no and self.counter_event_no_persisted
end
#####################################################################
# load_event_no_persisted
#
# Load the next acceptable event_no from `persist` and persist it
# with a predefined gap `self.EVENT_NO_INCR` (default 1000)
def load_event_no_persisted()
import persist
var event_no_str = str(persist.find(self.EVENT_NO_FILENAME, "0"))
self.counter_event_no = int64.fromstring(event_no_str)
self.counter_event_no_persisted = self.counter_event_no.add(self.EVENT_NO_INCR)
# save back next slot
persist.setmember(self.EVENT_NO_FILENAME, self.counter_event_no_persisted.tostring())
persist.save()
end
#####################################################################
# Enqueue event
#
# Takes `Matter_EventDataIB`
#####################################################################
def queue_event(ev_ib)
var ev_queued = matter.EventQueued(ev_ib)
var cur_prio = ev_queued.priority
# we reuse the same logic as connectedhomeip
# https://github.com/project-chip/connectedhomeip/blob/master/src/app/EventManagement.h
#
# Here is a copy of the original comment:
#---------------------------------------------------------------------------------
* A newly generated event will be placed in the lowest-priority (in practice
* DEBUG) buffer, the one associated with the first LogStorageResource. If
* there is no space in that buffer, space will be created by evicting the
* oldest event currently in that buffer, until enough space is available.
*
* When an event is evicted from a buffer, there are two possibilities:
*
* 1) If the next LogStorageResource has a priority that is no higher than the
* event's priority, the event will be moved to that LogStorageResource's
* buffer. This may in turn require events to be evicted from that buffer.
* 2) If the next LogStorageResource has a priority that is higher than the
* event's priority, then the event is just dropped.
*
* This means that LogStorageResources at a given priority level are reserved
* for events of that priority level or higher priority.
*
* As a simple example, assume there are only two priority levels, DEBUG and
* CRITICAL, and two LogStorageResources with those priorities. In that case,
* old CRITICAL events will not start getting dropped until both buffers are
* full, while old DEBUG events will start getting dropped once the DEBUG
* LogStorageResource buffer is full.
---------------------------------------------------------------------------------#
# first step, always add to DEBUG queue
self.queue_debug.push(ev_queued)
# if DEBUG queue is full
if size(self.queue_debug) > self.EVENT_QUEUE_SIZE_MAX
# remove first (oldest element)
var ev_debug_removed = self.queue_debug.pop(0)
if ev_debug_removed.priority > matter.EVENT_DEBUG
# if removed item is higher than DEBUG, push to INFO queue
self.queue_info.push(ev_debug_removed)
# if INFO queue is full
if size(self.queue_info) > self.EVENT_QUEUE_SIZE_MAX
# remove first (oldest element)
var ev_info_removed = self.queue_info.pop(0)
if ev_info_removed.priority > matter.EVENT_INFO
# if removed item is higher than INFO, push to CRITICAL queue
self.queue_critical.push(ev_info_removed)
# if CRITICAL queue is full
if size(self.queue_critical) > self.EVENT_QUEUE_SIZE_MAX
# remove first (oldest element)
var ev_critical_removed = self.queue_critical.pop(0)
end
end
end
end
end
end
#####################################################################
# Events handling
#####################################################################
# Get next event number
def get_next_event_no()
self.counter_event_no = self.counter_event_no.add(1)
if self.counter_event_no >= self.counter_event_no_persisted
self.load_event_no_persisted() # force an increment like done during boot
end
return self.counter_event_no
end
#####################################################################
# Dump events for debugging
#####################################################################
def dump()
tasmota.log(f"MTR: Events queues sizes: critical {size(self.queue_critical)}, info {size(self.queue_info)}, debug {size(self.queue_debug)}", 2)
var cnt = [0, 0, 0] # counters
for ev: self.queue_debug cnt[ev.priority] += 1 end
for ev: self.queue_info cnt[ev.priority] += 1 end
for ev: self.queue_critical cnt[ev.priority] += 1 end
tasmota.log(f"MTR: Events by types: critical {cnt[2]}, info {cnt[1]}, debug {cnt[0]}", 2)
end
end
matter.EventHandler = Matter_EventHandler
#-
# Unit tests
-#

View File

@ -237,8 +237,11 @@ class Matter_IM
# should return true if answered, false if passing to next handler
def read_single_attribute(ret, pi, ctx, direct)
var TLV = matter.TLV
var attr_name = matter.get_attribute_name(ctx.cluster, ctx.attribute)
var attr_name
if tasmota.loglevel(3)
attr_name = matter.get_attribute_name(ctx.cluster, ctx.attribute)
attr_name = attr_name ? " (" + attr_name + ")" : ""
end
# Special case to report unsupported item, if pi==nil
ctx.status = nil # reset status, just in case
@ -277,7 +280,7 @@ class Matter_IM
self.attributedata2raw(a1_raw_or_list, ctx, res)
end
if !no_log
if tasmota.loglevel(3) && !no_log
log(f"MTR: >Read_Attr ({session.local_session_id:6i}) {ctx}{attr_name} - {res_str}", 3)
end
elif ctx.status != nil
@ -291,7 +294,7 @@ class Matter_IM
end
end
else
if !no_log
if tasmota.loglevel(3) && !no_log
log(format("MTR: >Read_Attr (%6i) %s%s - IGNORED", session.local_session_id, str(ctx), attr_name), 3)
end
# ignore if content is nil and status is undefined
@ -349,6 +352,7 @@ class Matter_IM
# structure is `ReadRequestMessage` 10.6.2 p.558
var ctx = matter.Path()
ctx.msg = msg
var node_id = (msg != nil) ? msg.get_node_id() : nil
# prepare the response
var ret = matter.ReportDataMessage()
@ -366,12 +370,14 @@ class Matter_IM
# expand endpoint
if ctx.endpoint == nil || ctx.cluster == nil || ctx.attribute == nil
# we need expansion, log first
if tasmota.loglevel(3)
if ctx.cluster != nil && ctx.attribute != nil
var attr_name = matter.get_attribute_name(ctx.cluster, ctx.attribute)
log(format("MTR: >Read_Attr (%6i) %s", session.local_session_id, str(ctx) + (attr_name ? " (" + attr_name + ")" : "")), 3)
else
log(format("MTR: >Read_Attr (%6i) %s", session.local_session_id, str(ctx)), 3)
end
end
end
@ -381,8 +387,43 @@ class Matter_IM
)
end
# log("MTR: ReportDataMessage=" + str(ret), 3)
# log("MTR: ReportDataMessageTLV=" + str(ret.to_TLV()), 3)
# tasmota.log(f">>>: event_1")
var event_requests = query.event_requests
var event_filters = query.event_filters
var event_no_min = nil # do we have a filter for minimum event_no (int64 or nil)
if event_requests # if not `nil` and not empty list
# read event minimum
if event_filters
for filter: event_filters # filter is an instance of `EventFilterIB`
tasmota.log(f"MTR: EventFilter {filter=} {node_id=}", 3)
var filter_node = int64.toint64(filter.node) # nil or int64
if filter_node # there is a filter on node-id
if filter.node.tobytes() != node_id # the node id doesn't match
tasmota.log(f"MTR: node_id filter {filter_node.tobytes().tohex()} doesn't match {node_id.tohex()}")
continue
end
# specified minimum value
var new_event_no_min = int64.toint64(filter.event_min)
if (event_no_min != nil) || (event_no_min < new_event_no_min)
event_no_min = new_event_no_min
end
end
end
end
# event_no_min is either `nil` or has an `int64` value
ret.event_reports = []
for q: event_requests
# need to do expansion here
ctx.endpoint = q.endpoint
ctx.cluster = q.cluster
ctx.attribute = q.event
#TODO
tasmota.log(f"MTR: >Read_Event({session.local_session_id:%6i}) {ctx}", 3)
end
end
# tasmota.log("MTR: ReportDataMessage=" + str(ret), 3)
# tasmota.log("MTR: ReportDataMessageTLV=" + str(ret.to_TLV()), 3)
return ret
end
@ -675,25 +716,24 @@ class Matter_IM
# process IM 0x02 Read Request
#
# val is the TLV structure
#
# returns `true` if processed, `false` if silently ignored,
# or raises an exception
def process_read_request(msg, val)
matter.profiler.log("read_request_start")
# matter.profiler.log(str(val))
var query = matter.ReadRequestMessage().from_TLV(val)
# matter.profiler.log(str(query))
if query.attributes_requests != nil
var ret = self._inner_process_read_request(msg.session, query, msg)
self.send_report_data(msg, ret)
end
return true
return true # always consider succesful even if empty
end
#############################################################
# process IM 0x02 Read Request
# process IM 0x02 Read Request - solo attribute
#
# ctx is the decoded context (cluster/attribute)
#
# val is the TLV structure
# returns `true` if processed, `false` if silently ignored,
# or raises an exception
def process_read_request_solo(msg, ctx)
@ -702,10 +742,8 @@ class Matter_IM
ctx.msg = msg
# find pi for this endpoint/cluster/attribute
var pi = self.device.process_attribute_read_solo(ctx)
var pi = self.device.resolve_attribute_read_solo(ctx)
var res = nil
# matter.profiler.log("read_request_solo pi ok")
# log(f"MTR: process_read_request_solo {pi=}")
var raw # this is the bytes() block we need to add to response (or nil)
if pi != nil
@ -717,7 +755,7 @@ class Matter_IM
if res != nil
# check if the payload is a complex structure and too long to fit in a single response packet
if (res.is_list || res.is_array) && res.encode_len() > matter.IM_ReportData.MAX_MESSAGE
if (res.is_list || res.is_array) && (res.encode_len() > matter.IM_ReportData.MAX_MESSAGE)
# revert to standard
# the attribute will be read again, but it's hard to avoid it
res = nil # indicated to GC that we don't need it again
@ -773,8 +811,11 @@ class Matter_IM
# postpone lengthy operations after sending back response
matter.profiler.log("RESPONSE SENT")
var attr_name = matter.get_attribute_name(ctx.cluster, ctx.attribute)
var attr_name
if tasmota.loglevel(3)
attr_name = matter.get_attribute_name(ctx.cluster, ctx.attribute)
attr_name = attr_name ? " (" + attr_name + ")" : ""
end
if res != nil
if tasmota.loglevel(3)
@ -799,8 +840,7 @@ class Matter_IM
end
end
# matter.profiler.log("read_request_solo end")
return true
return true # always consider succesful even if empty
end
#############################################################
@ -827,11 +867,11 @@ class Matter_IM
ctx.attribute = q.attribute
attr_req.push(str(ctx))
end
log(format("MTR: >Subscribe (%6i) %s (min=%i, max=%i, keep=%i) sub=%i fabric_filtered=%s",
msg.session.local_session_id, attr_req.concat(" "), sub.min_interval, sub.max_interval, query.keep_subscriptions ? 1 : 0, sub.subscription_id, query.fabric_filtered), 3)
if query.event_requests != nil && size(query.event_requests) > 0
log(f"MTR: >Subscribe ({msg.session.local_session_id:6i}) event_requests_size={size(query.event_requests)}", 3)
end
log(format("MTR: >Subscribe (%6i) %s (min=%i, max=%i, keep=%i) sub=%i fabric_filtered=%s attr_req=%s event_req=%s",
msg.session.local_session_id, attr_req.concat(" "), sub.min_interval, sub.max_interval, query.keep_subscriptions ? 1 : 0,
sub.subscription_id, query.fabric_filtered,
query.attributes_requests != nil ? size(query.attributes_requests) : "-",
query.event_requests != nil ? size(query.event_requests) : "-"), 3)
var ret = self._inner_process_read_request(msg.session, query, msg, !self.device.debug #-log only if debug enabled-#)
# ret is of type `Matter_ReportDataMessage`
@ -1084,7 +1124,7 @@ class Matter_IM
end
# expand endpoint
if ctx.endpoint == nil
if tasmota.loglevel(3) && (ctx.endpoint == nil)
# we need expansion, log first
var attr_name = matter.get_attribute_name(ctx.cluster, ctx.attribute)
log("MTR: Write_Attr " + str(ctx) + (attr_name ? " (" + attr_name + ")" : ""), 3)

View File

@ -444,6 +444,14 @@ class Matter_Frame
end
#############################################################
# compute the node_id for this message, via session and fabric
#
# returns bytes(8)
def get_node_id()
return self.session ? self.session.get_node_id() : nil
end
#############################################################
# Decode a message we are about to send, to ease debug
def debug(raw)

View File

@ -69,6 +69,7 @@ class Matter_Plugin
# 0x0033: 1, # Initial Release
# 0x0034: 1, # Initial Release
0x0038: 2, #
# 0x003B: 1, # Initial Release
# 0x003C: 1, # Initial Release
# 0x003E: 1, # Initial Release
0x003F: 2, # Clarify KeySetWrite validation and behavior on invalid epoch key lengths
@ -180,7 +181,59 @@ class Matter_Plugin
end
#############################################################
# get_clusters
# generate a new event
#
def publish_event(cluster, event, priority, data)
var event_ib = matter.EventDataIB()
var event_path = matter.EventPathIB()
event_path.endpoint = self.endpoint
event_path.cluster = cluster
event_path.event = event
event_ib.path = event_path
event_ib.priority = priority
event_ib.event_number = self.device.events.get_next_event_no()
event_ib.epoch_timestamp = tasmota.rtc('utc')
if (event_ib.epoch_timestamp < 1700000000) event_ib.epoch_timestamp = nil end # no valid time
event_ib.data = data
var priority_str = (priority == 2) ? "CRIT " : (priority == 1) ? "INFO " : "DEBUG "
log(f"MTR: +Add_Event ({priority_str}) [{event_path.endpoint:02X}]{event_path.cluster:04X}/{event_path.event:04X} ({event_ib.event_number:5i}) - {event_ib.data}", 2)
log(f"MTR: Publishing event {event_ib}", 4)
self.device.events.queue_event(event_ib)
end
#- testing
var root = matter_device.plugins[0]
var tlv_solo = matter.TLV.Matter_TLV_item()
tlv_solo.set(matter.TLV.U4, 42)
root.publish_event(0x001D, 0, matter.EVENT_CRITICAL, tlv_solo)
matter_device.events.dump()
-#
# elements are made of `Matter_EventDataIB`
# var path #
# var node # u64 as bytes
# var endpoint # u16
# var cluster # u32
# var event # u32
# var is_urgent # bool
# var event_number # u64 as bytes
# var priority # u8
# # one of
# var epoch_timestamp # u64
# var system_timestamp # u64
# var delta_epoch_timestamp # u64
# var delta_system_timestamp # u64
# # data
# var data # any TLV
# EVENT_DEBUG=0
# EVENT_INFO=1
# EVENT_CRITICAL=2
#############################################################
# consolidate_clusters
#
# Build a consolidated map of all the `CLUSTERS` static vars
# from the inheritance hierarchy

View File

@ -47,9 +47,12 @@ class Matter_Plugin_Root : Matter_Plugin
#############################################################
# Constructor
# def init(device, endpoint, config)
# super(self).init(device, endpoint, config)
# end
def init(device, endpoint, config)
super(self).init(device, endpoint, config)
self.publish_event(0x0028, 0x00, matter.EVENT_CRITICAL, matter.TLV.Matter_TLV_item().set(matter.TLV.U4, tasmota.version())) # Event StartUp - Software Version
self.publish_event(0x0033, 0x03, matter.EVENT_CRITICAL, matter.TLV.Matter_TLV_item().set(matter.TLV.U1, 1)) # Event BootReason - PowerOnReboot - TODO if we need to refine
end
#############################################################
# read an attribute
@ -233,7 +236,7 @@ class Matter_Plugin_Root : Matter_Plugin
elif attribute == 0x0008 # ---------- HardwareVersionString / string ----------
return tlv_solo.set(TLV.UTF1, tasmota.cmd("Status 2", true)['StatusFWR']['Hardware'])
elif attribute == 0x0009 # ---------- SoftwareVersion / u32 ----------
return tlv_solo.set(TLV.U2, 1)
return tlv_solo.set(TLV.U4, tasmota.version())
elif attribute == 0x000A # ---------- SoftwareVersionString / string ----------
var version_full = tasmota.cmd("Status 2", true)['StatusFWR']['Version']
var version_end = string.find(version_full, '(')

View File

@ -0,0 +1,100 @@
#
# Matter_Plugin_Sensor_GenericSwitch.be - implements the behavior for a Generic Switch
#
# Copyright (C) 2023-2024 Stephan Hadinger & Theo Arends
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Matter plug-in for core behavior
#@ solidify:Matter_Plugin_Sensor_GenericSwitch,weak
class Matter_Plugin_Sensor_GenericSwitch : Matter_Plugin_Device
static var TYPE = "gensw" # name of the plug-in in json
static var DISPLAY_NAME = "Generic Switch" # display name of the plug-in
static var ARG = "switch" # additional argument name (or empty if none)
static var ARG_HINT = "Switch<x> number"
static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type
static var UPDATE_TIME = 750 # update every 750ms - TODO still necessary?
static var CLUSTERS = matter.consolidate_clusters(_class, {
# 0x001D: inherited # Descriptor Cluster 9.5 p.453
# 0x0039: [3,5,0x0A,0x0F,0x11,0x12], # Bridged Device Basic Information 9.13 p.485
# 0x0003: [0,1], # Identify 1.2 p.16
# 0x0004: [0], # Groups 1.3 p.21
# 0x0005: [0,1,2,3,4,5], # Scenes 1.4 p.30 - no writable
0x003B: [0, 1, 2], # Switch 1.12
})
static var TYPES = { 0x000F: 2 } # Generic Switch, rev 2
var tasmota_switch_index # Switch number in Tasmota (one based)
var shadow_value
#############################################################
# parse_configuration
#
# Parse configuration map
def parse_configuration(config)
self.tasmota_switch_index = int(config.find(self.ARG #-'relay'-#, 1))
if self.tasmota_switch_index <= 0 self.tasmota_switch_index = 1 end
end
#############################################################
# Update shadow
#
def update_shadow()
super(self).update_shadow()
self.shadow_value = false
# TODO
end
#############################################################
# read an attribute
#
def read_attribute(session, ctx, tlv_solo)
var TLV = matter.TLV
var cluster = ctx.cluster
var attribute = ctx.attribute
# ====================================================================================================
if cluster == 0x003B # ========== Generic Switch, 1.12 ==========
# self.update_shadow_lazy()
if attribute == 0x0000 # ---------- NumberOfPositions / uint8 ----------
return tlv_solo.set(TLV.U1, 2) # default to 2 positions
elif attribute == 0x0001 # ---------- CurrentPosition / uint8 ----------
return tlv_solo.set(TLV.U1, 0) # TODO read value
elif attribute == 0x0002 # ---------- MultiPressMax / uint8 ----------
return tlv_solo.set(TLV.U1, 2) # up to double press
elif attribute == 0xFFFC # ---------- FeatureMap / map32 ----------
return tlv_solo.set(TLV.U4, 0x02 + 0x04 + 0x08) # MomentarySwitch + MomentarySwitchRelease + MomentarySwitchLongPress
end
end
return super(self).read_attribute(session, ctx, tlv_solo)
end
#############################################################
# append_state_json
#
# Output the current state in JSON
# New values need to be appended with `,"key":value` (including prefix comma)
#
# Override the default behavior to use the key `OnOff` instead of `Power`
def append_state_json()
return f',"Switch":{int(self.shadow_onoff)}'
end
end
matter.Plugin_Sensor_GenericSwitch = Matter_Plugin_Sensor_GenericSwitch

View File

@ -260,6 +260,7 @@ class Matter_Session : Matter_Expirable
def get_fabric_label() return self._fabric ? self._fabric.fabric_label : nil end
def get_admin_subject() return self._fabric ? self._fabric.admin_subject : nil end
def get_admin_vendor() return self._fabric ? self._fabric.admin_vendor : nil end
def get_node_id() return self._fabric ? self._fabric.device_id : nil end
#############################################################
# Get operational key pair (private key)

View File

@ -40,6 +40,8 @@ class Matter_Device
var sessions # `matter.Session_Store()` objet
var ui
var tick # increment at each tick, avoids to repeat too frequently some actions
# Events
var events # Event handler
# Commissioning open
var commissioning_open # timestamp for timeout of commissioning (millis()) or `nil` if closed
var commissioning_iterations # current PBKDF number of iterations
@ -105,6 +107,7 @@ class Matter_Device
self.sessions = matter.Session_Store(self)
self.sessions.load_fabrics()
self.message_handler = matter.MessageHandler(self)
self.events = matter.EventHandler(self)
self.ui = matter.UI(self)
if tasmota.wifi()['up'] || tasmota.eth()['up']
@ -561,7 +564,7 @@ class Matter_Device
# Optimized version for a single endpoint/cluster/attribute
#
# Retrieve the plugin for a read
def process_attribute_read_solo(ctx)
def resolve_attribute_read_solo(ctx)
var endpoint = ctx.endpoint
# var endpoint_found = false # did any endpoint match
var cluster = ctx.cluster
@ -768,11 +771,10 @@ class Matter_Device
# {'32': {'filter': 'AXP192#Temperature', 'type': 'temperature'}, '40': {'filter': 'BMP280#Pressure', 'type': 'pressure'}, '34': {'filter': 'SHT3X#Temperature', 'type': 'temperature'}, '33': {'filter': 'BMP280#Temperature', 'type': 'temperature'}, '1': {'relay': 0, 'type': 'relay'}, '56': {'filter': 'SHT3X#Humidity', 'type': 'humidity'}, '0': {'type': 'root'}}
def _instantiate_plugins_from_config(config)
var endpoints = self.k2l_num(config)
# log("MTR: endpoints to be configured "+str(endpoints), 4)
log("MTR: Configuring endpoints", 2)
# start with mandatory endpoint 0 for root node
self.plugins.push(matter.Plugin_Root(self, 0, {}))
log("MTR: Configuring endpoints", 2)
log(format("MTR: endpoint = %5i type:%s%s", 0, 'root', ''), 2)
# always include an aggregator for dynamic endpoints

View File

@ -0,0 +1,492 @@
/* Solidification of Matter_EventHandler.h */
/********************************************************************\
* Generated code, don't edit *
\********************************************************************/
#include "be_constobj.h"
extern const bclass be_class_Matter_EventHandler;
/********************************************************************
** Solidified function: queue_event
********************************************************************/
extern const bclass be_class_Matter_EventHandler;
be_local_closure(class_Matter_EventHandler_queue_event, /* name */
be_nested_proto(
9, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
&be_class_Matter_EventHandler,
1, /* has constants */
( &(const bvalue[12]) { /* constants */
/* K0 */ be_nested_str_weak(matter),
/* K1 */ be_nested_str_weak(EventQueued),
/* K2 */ be_nested_str_weak(priority),
/* K3 */ be_nested_str_weak(queue_debug),
/* K4 */ be_nested_str_weak(push),
/* K5 */ be_nested_str_weak(EVENT_QUEUE_SIZE_MAX),
/* K6 */ be_nested_str_weak(pop),
/* K7 */ be_const_int(0),
/* K8 */ be_nested_str_weak(EVENT_DEBUG),
/* K9 */ be_nested_str_weak(queue_info),
/* K10 */ be_nested_str_weak(EVENT_INFO),
/* K11 */ be_nested_str_weak(queue_critical),
}),
be_str_weak(queue_event),
&be_const_str_solidified,
( &(const binstruction[58]) { /* code */
0xB80A0000, // 0000 GETNGBL R2 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x5C100200, // 0002 MOVE R4 R1
0x7C080400, // 0003 CALL R2 2
0x880C0502, // 0004 GETMBR R3 R2 K2
0x88100103, // 0005 GETMBR R4 R0 K3
0x8C100904, // 0006 GETMET R4 R4 K4
0x5C180400, // 0007 MOVE R6 R2
0x7C100400, // 0008 CALL R4 2
0x6010000C, // 0009 GETGBL R4 G12
0x88140103, // 000A GETMBR R5 R0 K3
0x7C100200, // 000B CALL R4 1
0x88140105, // 000C GETMBR R5 R0 K5
0x24100805, // 000D GT R4 R4 R5
0x78120029, // 000E JMPF R4 #0039
0x88100103, // 000F GETMBR R4 R0 K3
0x8C100906, // 0010 GETMET R4 R4 K6
0x58180007, // 0011 LDCONST R6 K7
0x7C100400, // 0012 CALL R4 2
0x88140902, // 0013 GETMBR R5 R4 K2
0xB81A0000, // 0014 GETNGBL R6 K0
0x88180D08, // 0015 GETMBR R6 R6 K8
0x24140A06, // 0016 GT R5 R5 R6
0x78160020, // 0017 JMPF R5 #0039
0x88140109, // 0018 GETMBR R5 R0 K9
0x8C140B04, // 0019 GETMET R5 R5 K4
0x5C1C0800, // 001A MOVE R7 R4
0x7C140400, // 001B CALL R5 2
0x6014000C, // 001C GETGBL R5 G12
0x88180109, // 001D GETMBR R6 R0 K9
0x7C140200, // 001E CALL R5 1
0x88180105, // 001F GETMBR R6 R0 K5
0x24140A06, // 0020 GT R5 R5 R6
0x78160016, // 0021 JMPF R5 #0039
0x88140109, // 0022 GETMBR R5 R0 K9
0x8C140B06, // 0023 GETMET R5 R5 K6
0x581C0007, // 0024 LDCONST R7 K7
0x7C140400, // 0025 CALL R5 2
0x88180B02, // 0026 GETMBR R6 R5 K2
0xB81E0000, // 0027 GETNGBL R7 K0
0x881C0F0A, // 0028 GETMBR R7 R7 K10
0x24180C07, // 0029 GT R6 R6 R7
0x781A000D, // 002A JMPF R6 #0039
0x8818010B, // 002B GETMBR R6 R0 K11
0x8C180D04, // 002C GETMET R6 R6 K4
0x5C200A00, // 002D MOVE R8 R5
0x7C180400, // 002E CALL R6 2
0x6018000C, // 002F GETGBL R6 G12
0x881C010B, // 0030 GETMBR R7 R0 K11
0x7C180200, // 0031 CALL R6 1
0x881C0105, // 0032 GETMBR R7 R0 K5
0x24180C07, // 0033 GT R6 R6 R7
0x781A0003, // 0034 JMPF R6 #0039
0x8818010B, // 0035 GETMBR R6 R0 K11
0x8C180D06, // 0036 GETMET R6 R6 K6
0x58200007, // 0037 LDCONST R8 K7
0x7C180400, // 0038 CALL R6 2
0x80000000, // 0039 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
extern const bclass be_class_Matter_EventHandler;
be_local_closure(class_Matter_EventHandler_init, /* name */
be_nested_proto(
4, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
&be_class_Matter_EventHandler,
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_weak(device),
/* K1 */ be_nested_str_weak(queue_debug),
/* K2 */ be_nested_str_weak(queue_info),
/* K3 */ be_nested_str_weak(queue_critical),
/* K4 */ be_nested_str_weak(load_event_no_persisted),
}),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[13]) { /* code */
0x90020001, // 0000 SETMBR R0 K0 R1
0x60080012, // 0001 GETGBL R2 G18
0x7C080000, // 0002 CALL R2 0
0x90020202, // 0003 SETMBR R0 K1 R2
0x60080012, // 0004 GETGBL R2 G18
0x7C080000, // 0005 CALL R2 0
0x90020402, // 0006 SETMBR R0 K2 R2
0x60080012, // 0007 GETGBL R2 G18
0x7C080000, // 0008 CALL R2 0
0x90020602, // 0009 SETMBR R0 K3 R2
0x8C080104, // 000A GETMET R2 R0 K4
0x7C080200, // 000B CALL R2 1
0x80000000, // 000C RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: get_next_event_no
********************************************************************/
extern const bclass be_class_Matter_EventHandler;
be_local_closure(class_Matter_EventHandler_get_next_event_no, /* name */
be_nested_proto(
4, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
&be_class_Matter_EventHandler,
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_weak(counter_event_no),
/* K1 */ be_nested_str_weak(add),
/* K2 */ be_const_int(1),
/* K3 */ be_nested_str_weak(counter_event_no_persisted),
/* K4 */ be_nested_str_weak(load_event_no_persisted),
}),
be_str_weak(get_next_event_no),
&be_const_str_solidified,
( &(const binstruction[13]) { /* code */
0x88040100, // 0000 GETMBR R1 R0 K0
0x8C040301, // 0001 GETMET R1 R1 K1
0x580C0002, // 0002 LDCONST R3 K2
0x7C040400, // 0003 CALL R1 2
0x90020001, // 0004 SETMBR R0 K0 R1
0x88040100, // 0005 GETMBR R1 R0 K0
0x88080103, // 0006 GETMBR R2 R0 K3
0x28040202, // 0007 GE R1 R1 R2
0x78060001, // 0008 JMPF R1 #000B
0x8C040104, // 0009 GETMET R1 R0 K4
0x7C040200, // 000A CALL R1 1
0x88040100, // 000B GETMBR R1 R0 K0
0x80040200, // 000C RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: dump
********************************************************************/
extern const bclass be_class_Matter_EventHandler;
be_local_closure(class_Matter_EventHandler_dump, /* name */
be_nested_proto(
9, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
&be_class_Matter_EventHandler,
1, /* has constants */
( &(const bvalue[12]) { /* constants */
/* K0 */ be_nested_str_weak(tasmota),
/* K1 */ be_nested_str_weak(log),
/* K2 */ be_nested_str_weak(MTR_X3A_X20Events_X20queues_X20sizes_X3A_X20critical_X20_X25s_X2C_X20info_X20_X25s_X2C_X20debug_X20_X25s),
/* K3 */ be_nested_str_weak(queue_critical),
/* K4 */ be_nested_str_weak(queue_info),
/* K5 */ be_nested_str_weak(queue_debug),
/* K6 */ be_const_int(2),
/* K7 */ be_const_int(0),
/* K8 */ be_nested_str_weak(priority),
/* K9 */ be_const_int(1),
/* K10 */ be_nested_str_weak(stop_iteration),
/* K11 */ be_nested_str_weak(MTR_X3A_X20Events_X20by_X20types_X3A_X20critical_X20_X25s_X2C_X20info_X20_X25s_X2C_X20debug_X20_X25s),
}),
be_str_weak(dump),
&be_const_str_solidified,
( &(const binstruction[74]) { /* code */
0xB8060000, // 0000 GETNGBL R1 K0
0x8C040301, // 0001 GETMET R1 R1 K1
0x600C0018, // 0002 GETGBL R3 G24
0x58100002, // 0003 LDCONST R4 K2
0x6014000C, // 0004 GETGBL R5 G12
0x88180103, // 0005 GETMBR R6 R0 K3
0x7C140200, // 0006 CALL R5 1
0x6018000C, // 0007 GETGBL R6 G12
0x881C0104, // 0008 GETMBR R7 R0 K4
0x7C180200, // 0009 CALL R6 1
0x601C000C, // 000A GETGBL R7 G12
0x88200105, // 000B GETMBR R8 R0 K5
0x7C1C0200, // 000C CALL R7 1
0x7C0C0800, // 000D CALL R3 4
0x58100006, // 000E LDCONST R4 K6
0x7C040600, // 000F CALL R1 3
0x60040012, // 0010 GETGBL R1 G18
0x7C040000, // 0011 CALL R1 0
0x40080307, // 0012 CONNECT R2 R1 K7
0x40080307, // 0013 CONNECT R2 R1 K7
0x40080307, // 0014 CONNECT R2 R1 K7
0x60080010, // 0015 GETGBL R2 G16
0x880C0105, // 0016 GETMBR R3 R0 K5
0x7C080200, // 0017 CALL R2 1
0xA8020006, // 0018 EXBLK 0 #0020
0x5C0C0400, // 0019 MOVE R3 R2
0x7C0C0000, // 001A CALL R3 0
0x88100708, // 001B GETMBR R4 R3 K8
0x94140204, // 001C GETIDX R5 R1 R4
0x00140B09, // 001D ADD R5 R5 K9
0x98040805, // 001E SETIDX R1 R4 R5
0x7001FFF8, // 001F JMP #0019
0x5808000A, // 0020 LDCONST R2 K10
0xAC080200, // 0021 CATCH R2 1 0
0xB0080000, // 0022 RAISE 2 R0 R0
0x60080010, // 0023 GETGBL R2 G16
0x880C0104, // 0024 GETMBR R3 R0 K4
0x7C080200, // 0025 CALL R2 1
0xA8020006, // 0026 EXBLK 0 #002E
0x5C0C0400, // 0027 MOVE R3 R2
0x7C0C0000, // 0028 CALL R3 0
0x88100708, // 0029 GETMBR R4 R3 K8
0x94140204, // 002A GETIDX R5 R1 R4
0x00140B09, // 002B ADD R5 R5 K9
0x98040805, // 002C SETIDX R1 R4 R5
0x7001FFF8, // 002D JMP #0027
0x5808000A, // 002E LDCONST R2 K10
0xAC080200, // 002F CATCH R2 1 0
0xB0080000, // 0030 RAISE 2 R0 R0
0x60080010, // 0031 GETGBL R2 G16
0x880C0103, // 0032 GETMBR R3 R0 K3
0x7C080200, // 0033 CALL R2 1
0xA8020006, // 0034 EXBLK 0 #003C
0x5C0C0400, // 0035 MOVE R3 R2
0x7C0C0000, // 0036 CALL R3 0
0x88100708, // 0037 GETMBR R4 R3 K8
0x94140204, // 0038 GETIDX R5 R1 R4
0x00140B09, // 0039 ADD R5 R5 K9
0x98040805, // 003A SETIDX R1 R4 R5
0x7001FFF8, // 003B JMP #0035
0x5808000A, // 003C LDCONST R2 K10
0xAC080200, // 003D CATCH R2 1 0
0xB0080000, // 003E RAISE 2 R0 R0
0xB80A0000, // 003F GETNGBL R2 K0
0x8C080501, // 0040 GETMET R2 R2 K1
0x60100018, // 0041 GETGBL R4 G24
0x5814000B, // 0042 LDCONST R5 K11
0x94180306, // 0043 GETIDX R6 R1 K6
0x941C0309, // 0044 GETIDX R7 R1 K9
0x94200307, // 0045 GETIDX R8 R1 K7
0x7C100800, // 0046 CALL R4 4
0x58140006, // 0047 LDCONST R5 K6
0x7C080600, // 0048 CALL R2 3
0x80000000, // 0049 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: load_event_no_persisted
********************************************************************/
extern const bclass be_class_Matter_EventHandler;
be_local_closure(class_Matter_EventHandler_load_event_no_persisted, /* name */
be_nested_proto(
8, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
&be_class_Matter_EventHandler,
1, /* has constants */
( &(const bvalue[13]) { /* constants */
/* K0 */ be_nested_str_weak(persist),
/* K1 */ be_nested_str_weak(find),
/* K2 */ be_nested_str_weak(EVENT_NO_FILENAME),
/* K3 */ be_nested_str_weak(0),
/* K4 */ be_nested_str_weak(counter_event_no),
/* K5 */ be_nested_str_weak(int64),
/* K6 */ be_nested_str_weak(fromstring),
/* K7 */ be_nested_str_weak(counter_event_no_persisted),
/* K8 */ be_nested_str_weak(add),
/* K9 */ be_nested_str_weak(EVENT_NO_INCR),
/* K10 */ be_nested_str_weak(setmember),
/* K11 */ be_nested_str_weak(tostring),
/* K12 */ be_nested_str_weak(save),
}),
be_str_weak(load_event_no_persisted),
&be_const_str_solidified,
( &(const binstruction[26]) { /* code */
0xA4060000, // 0000 IMPORT R1 K0
0x60080008, // 0001 GETGBL R2 G8
0x8C0C0301, // 0002 GETMET R3 R1 K1
0x88140102, // 0003 GETMBR R5 R0 K2
0x58180003, // 0004 LDCONST R6 K3
0x7C0C0600, // 0005 CALL R3 3
0x7C080200, // 0006 CALL R2 1
0xB80E0A00, // 0007 GETNGBL R3 K5
0x8C0C0706, // 0008 GETMET R3 R3 K6
0x5C140400, // 0009 MOVE R5 R2
0x7C0C0400, // 000A CALL R3 2
0x90020803, // 000B SETMBR R0 K4 R3
0x880C0104, // 000C GETMBR R3 R0 K4
0x8C0C0708, // 000D GETMET R3 R3 K8
0x88140109, // 000E GETMBR R5 R0 K9
0x7C0C0400, // 000F CALL R3 2
0x90020E03, // 0010 SETMBR R0 K7 R3
0x8C0C030A, // 0011 GETMET R3 R1 K10
0x88140102, // 0012 GETMBR R5 R0 K2
0x88180107, // 0013 GETMBR R6 R0 K7
0x8C180D0B, // 0014 GETMET R6 R6 K11
0x7C180200, // 0015 CALL R6 1
0x7C0C0600, // 0016 CALL R3 3
0x8C0C030C, // 0017 GETMET R3 R1 K12
0x7C0C0200, // 0018 CALL R3 1
0x80000000, // 0019 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: Matter_EventHandler
********************************************************************/
be_local_class(Matter_EventHandler,
6,
NULL,
be_nested_map(14,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(EVENT_NO_INCR, -1), be_const_int(1000) },
{ be_const_key_weak(queue_info, -1), be_const_var(1) },
{ be_const_key_weak(queue_critical, 11), be_const_var(2) },
{ be_const_key_weak(queue_event, -1), be_const_closure(class_Matter_EventHandler_queue_event_closure) },
{ be_const_key_weak(counter_event_no_persisted, 6), be_const_var(5) },
{ be_const_key_weak(init, -1), be_const_closure(class_Matter_EventHandler_init_closure) },
{ be_const_key_weak(get_next_event_no, -1), be_const_closure(class_Matter_EventHandler_get_next_event_no_closure) },
{ be_const_key_weak(dump, -1), be_const_closure(class_Matter_EventHandler_dump_closure) },
{ be_const_key_weak(queue_debug, 10), be_const_var(0) },
{ be_const_key_weak(EVENT_NO_FILENAME, -1), be_nested_str_weak(_matter_event_no) },
{ be_const_key_weak(counter_event_no, -1), be_const_var(4) },
{ be_const_key_weak(EVENT_QUEUE_SIZE_MAX, -1), be_const_int(10) },
{ be_const_key_weak(load_event_no_persisted, -1), be_const_closure(class_Matter_EventHandler_load_event_no_persisted_closure) },
{ be_const_key_weak(device, -1), be_const_var(3) },
})),
be_str_weak(Matter_EventHandler)
);
extern const bclass be_class_Matter_EventQueued;
/********************************************************************
** Solidified function: init
********************************************************************/
extern const bclass be_class_Matter_EventQueued;
be_local_closure(class_Matter_EventQueued_init, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
&be_class_Matter_EventQueued,
1, /* has constants */
( &(const bvalue[17]) { /* constants */
/* K0 */ be_nested_str_weak(endpoint),
/* K1 */ be_nested_str_weak(path),
/* K2 */ be_nested_str_weak(cluster),
/* K3 */ be_nested_str_weak(event_id),
/* K4 */ be_nested_str_weak(event),
/* K5 */ be_nested_str_weak(is_urgent),
/* K6 */ be_nested_str_weak(priority),
/* K7 */ be_const_int(0),
/* K8 */ be_nested_str_weak(matter),
/* K9 */ be_nested_str_weak(EVENT_CRITICAL),
/* K10 */ be_nested_str_weak(event_no),
/* K11 */ be_nested_str_weak(int64),
/* K12 */ be_nested_str_weak(toint64),
/* K13 */ be_nested_str_weak(event_number),
/* K14 */ be_nested_str_weak(raw_tlv),
/* K15 */ be_nested_str_weak(to_TLV),
/* K16 */ be_nested_str_weak(tlv2raw),
}),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[37]) { /* code */
0x88080301, // 0000 GETMBR R2 R1 K1
0x88080500, // 0001 GETMBR R2 R2 K0
0x90020002, // 0002 SETMBR R0 K0 R2
0x88080301, // 0003 GETMBR R2 R1 K1
0x88080502, // 0004 GETMBR R2 R2 K2
0x90020402, // 0005 SETMBR R0 K2 R2
0x88080301, // 0006 GETMBR R2 R1 K1
0x88080504, // 0007 GETMBR R2 R2 K4
0x90020602, // 0008 SETMBR R0 K3 R2
0x88080301, // 0009 GETMBR R2 R1 K1
0x88080505, // 000A GETMBR R2 R2 K5
0x90020A02, // 000B SETMBR R0 K5 R2
0x88080306, // 000C GETMBR R2 R1 K6
0x90020C02, // 000D SETMBR R0 K6 R2
0x88080106, // 000E GETMBR R2 R0 K6
0x14080507, // 000F LT R2 R2 K7
0x780A0000, // 0010 JMPF R2 #0012
0x90020D07, // 0011 SETMBR R0 K6 K7
0x88080106, // 0012 GETMBR R2 R0 K6
0xB80E1000, // 0013 GETNGBL R3 K8
0x880C0709, // 0014 GETMBR R3 R3 K9
0x24080403, // 0015 GT R2 R2 R3
0x780A0002, // 0016 JMPF R2 #001A
0xB80A1000, // 0017 GETNGBL R2 K8
0x88080509, // 0018 GETMBR R2 R2 K9
0x90020C02, // 0019 SETMBR R0 K6 R2
0xB80A1600, // 001A GETNGBL R2 K11
0x8C08050C, // 001B GETMET R2 R2 K12
0x8810030D, // 001C GETMBR R4 R1 K13
0x7C080400, // 001D CALL R2 2
0x90021402, // 001E SETMBR R0 K10 R2
0x8C08030F, // 001F GETMET R2 R1 K15
0x7C080200, // 0020 CALL R2 1
0x8C080510, // 0021 GETMET R2 R2 K16
0x7C080200, // 0022 CALL R2 1
0x90021C02, // 0023 SETMBR R0 K14 R2
0x80000000, // 0024 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: Matter_EventQueued
********************************************************************/
be_local_class(Matter_EventQueued,
7,
NULL,
be_nested_map(8,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(is_urgent, -1), be_const_var(3) },
{ be_const_key_weak(priority, -1), be_const_var(4) },
{ be_const_key_weak(endpoint, -1), be_const_var(0) },
{ be_const_key_weak(init, -1), be_const_closure(class_Matter_EventQueued_init_closure) },
{ be_const_key_weak(raw_tlv, 2), be_const_var(6) },
{ be_const_key_weak(event_id, 6), be_const_var(2) },
{ be_const_key_weak(cluster, -1), be_const_var(1) },
{ be_const_key_weak(event_no, 0), be_const_var(5) },
})),
be_str_weak(Matter_EventQueued)
);
/********************************************************************/
/* End of solidification */

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@ be_local_closure(class_Matter_Plugin_Root_read_attribute, /* name */
0, /* has sup protos */
&be_class_Matter_Plugin_Root,
1, /* has constants */
( &(const bvalue[95]) { /* constants */
( &(const bvalue[96]) { /* constants */
/* K0 */ be_nested_str_weak(string),
/* K1 */ be_nested_str_weak(matter),
/* K2 */ be_nested_str_weak(TLV),
@ -108,18 +108,19 @@ be_local_closure(class_Matter_Plugin_Root_read_attribute, /* name */
/* K84 */ be_nested_str_weak(Status_X202),
/* K85 */ be_nested_str_weak(StatusFWR),
/* K86 */ be_nested_str_weak(Hardware),
/* K87 */ be_nested_str_weak(Version),
/* K88 */ be_nested_str_weak(_X28),
/* K89 */ be_nested_str_weak(locale),
/* K90 */ be_nested_str_weak(create_TLV),
/* K91 */ be_nested_str_weak(get_active_endpoints),
/* K92 */ be_nested_str_weak(disable_bridge_mode),
/* K93 */ be_nested_str_weak(AGGREGATOR_ENDPOINT),
/* K94 */ be_nested_str_weak(read_attribute),
/* K87 */ be_nested_str_weak(version),
/* K88 */ be_nested_str_weak(Version),
/* K89 */ be_nested_str_weak(_X28),
/* K90 */ be_nested_str_weak(locale),
/* K91 */ be_nested_str_weak(create_TLV),
/* K92 */ be_nested_str_weak(get_active_endpoints),
/* K93 */ be_nested_str_weak(disable_bridge_mode),
/* K94 */ be_nested_str_weak(AGGREGATOR_ENDPOINT),
/* K95 */ be_nested_str_weak(read_attribute),
}),
be_str_weak(read_attribute),
&be_const_str_solidified,
( &(const binstruction[924]) { /* code */
( &(const binstruction[926]) { /* code */
0xA4120000, // 0000 IMPORT R4 K0
0xB8160200, // 0001 GETNGBL R5 K1
0x88140B02, // 0002 GETMBR R5 R5 K2
@ -176,11 +177,11 @@ be_local_closure(class_Matter_Plugin_Root_read_attribute, /* name */
0x502C0000, // 0035 LDBOOL R11 0 0
0x7C200600, // 0036 CALL R8 3
0x80041000, // 0037 RET 1 R8
0x70020359, // 0038 JMP #0393
0x7002035B, // 0038 JMP #0395
0x54220031, // 0039 LDINT R8 50
0x1C200C08, // 003A EQ R8 R6 R8
0x78220000, // 003B JMPF R8 #003D
0x70020355, // 003C JMP #0393
0x70020357, // 003C JMP #0395
0x54220032, // 003D LDINT R8 51
0x1C200C08, // 003E EQ R8 R6 R8
0x782200DC, // 003F JMPF R8 #011D
@ -404,11 +405,11 @@ be_local_closure(class_Matter_Plugin_Root_read_attribute, /* name */
0x502C0000, // 0119 LDBOOL R11 0 0
0x7C200600, // 011A CALL R8 3
0x80041000, // 011B RET 1 R8
0x70020275, // 011C JMP #0393
0x70020277, // 011C JMP #0395
0x54220033, // 011D LDINT R8 52
0x1C200C08, // 011E EQ R8 R6 R8
0x78220000, // 011F JMPF R8 #0121
0x70020271, // 0120 JMP #0393
0x70020273, // 0120 JMP #0395
0x54220037, // 0121 LDINT R8 56
0x1C200C08, // 0122 EQ R8 R6 R8
0x7822002B, // 0123 JMPF R8 #0150
@ -455,7 +456,7 @@ be_local_closure(class_Matter_Plugin_Root_read_attribute, /* name */
0x5C301000, // 014C MOVE R12 R8
0x7C240600, // 014D CALL R9 3
0x80041200, // 014E RET 1 R9
0x70020242, // 014F JMP #0393
0x70020244, // 014F JMP #0395
0x5422003D, // 0150 LDINT R8 62
0x1C200C08, // 0151 EQ R8 R6 R8
0x782200B5, // 0152 JMPF R8 #0209
@ -640,7 +641,7 @@ be_local_closure(class_Matter_Plugin_Root_read_attribute, /* name */
0x5C301000, // 0205 MOVE R12 R8
0x7C240600, // 0206 CALL R9 3
0x80041200, // 0207 RET 1 R9
0x70020189, // 0208 JMP #0393
0x7002018B, // 0208 JMP #0395
0x5422003B, // 0209 LDINT R8 60
0x1C200C08, // 020A EQ R8 R6 R8
0x78220030, // 020B JMPF R8 #023D
@ -692,10 +693,10 @@ be_local_closure(class_Matter_Plugin_Root_read_attribute, /* name */
0x7C300200, // 0239 CALL R12 1
0x7C240600, // 023A CALL R9 3
0x80041200, // 023B RET 1 R9
0x70020155, // 023C JMP #0393
0x70020157, // 023C JMP #0395
0x54220027, // 023D LDINT R8 40
0x1C200C08, // 023E EQ R8 R6 R8
0x782200BA, // 023F JMPF R8 #02FB
0x782200BC, // 023F JMPF R8 #02FD
0x8C200133, // 0240 GETMET R8 R0 K51
0x5C280400, // 0241 MOVE R10 R2
0x7C200400, // 0242 CALL R8 2
@ -706,7 +707,7 @@ be_local_closure(class_Matter_Plugin_Root_read_attribute, /* name */
0x582C0009, // 0247 LDCONST R11 K9
0x7C200600, // 0248 CALL R8 3
0x80041000, // 0249 RET 1 R8
0x700200AE, // 024A JMP #02FA
0x700200B0, // 024A JMP #02FC
0x1C200F09, // 024B EQ R8 R7 K9
0x78220005, // 024C JMPF R8 #0253
0x8C200706, // 024D GETMET R8 R3 K6
@ -714,7 +715,7 @@ be_local_closure(class_Matter_Plugin_Root_read_attribute, /* name */
0x582C004E, // 024F LDCONST R11 K78
0x7C200600, // 0250 CALL R8 3
0x80041000, // 0251 RET 1 R8
0x700200A6, // 0252 JMP #02FA
0x700200A8, // 0252 JMP #02FC
0x1C200F0D, // 0253 EQ R8 R7 K13
0x78220006, // 0254 JMPF R8 #025C
0x8C200706, // 0255 GETMET R8 R3 K6
@ -723,7 +724,7 @@ be_local_closure(class_Matter_Plugin_Root_read_attribute, /* name */
0x882C174F, // 0258 GETMBR R11 R11 K79
0x7C200600, // 0259 CALL R8 3
0x80041000, // 025A RET 1 R8
0x7002009D, // 025B JMP #02FA
0x7002009F, // 025B JMP #02FC
0x1C200F0F, // 025C EQ R8 R7 K15
0x7822000A, // 025D JMPF R8 #0269
0x8C200706, // 025E GETMET R8 R3 K6
@ -736,7 +737,7 @@ be_local_closure(class_Matter_Plugin_Root_read_attribute, /* name */
0x942C1750, // 0265 GETIDX R11 R11 K80
0x7C200600, // 0266 CALL R8 3
0x80041000, // 0267 RET 1 R8
0x70020090, // 0268 JMP #02FA
0x70020092, // 0268 JMP #02FC
0x54220003, // 0269 LDINT R8 4
0x1C200E08, // 026A EQ R8 R7 R8
0x78220005, // 026B JMPF R8 #0272
@ -745,7 +746,7 @@ be_local_closure(class_Matter_Plugin_Root_read_attribute, /* name */
0x542E7FFF, // 026E LDINT R11 32768
0x7C200600, // 026F CALL R8 3
0x80041000, // 0270 RET 1 R8
0x70020087, // 0271 JMP #02FA
0x70020089, // 0271 JMP #02FC
0x54220004, // 0272 LDINT R8 5
0x1C200E08, // 0273 EQ R8 R7 R8
0x7822000A, // 0274 JMPF R8 #0280
@ -759,7 +760,7 @@ be_local_closure(class_Matter_Plugin_Root_read_attribute, /* name */
0x942C1752, // 027C GETIDX R11 R11 K82
0x7C200600, // 027D CALL R8 3
0x80041000, // 027E RET 1 R8
0x70020079, // 027F JMP #02FA
0x7002007B, // 027F JMP #02FC
0x54220005, // 0280 LDINT R8 6
0x1C200E08, // 0281 EQ R8 R7 R8
0x78220005, // 0282 JMPF R8 #0289
@ -768,7 +769,7 @@ be_local_closure(class_Matter_Plugin_Root_read_attribute, /* name */
0x582C0053, // 0285 LDCONST R11 K83
0x7C200600, // 0286 CALL R8 3
0x80041000, // 0287 RET 1 R8
0x70020070, // 0288 JMP #02FA
0x70020072, // 0288 JMP #02FC
0x54220006, // 0289 LDINT R8 7
0x1C200E08, // 028A EQ R8 R7 R8
0x78220005, // 028B JMPF R8 #0292
@ -777,7 +778,7 @@ be_local_closure(class_Matter_Plugin_Root_read_attribute, /* name */
0x582C0005, // 028E LDCONST R11 K5
0x7C200600, // 028F CALL R8 3
0x80041000, // 0290 RET 1 R8
0x70020067, // 0291 JMP #02FA
0x70020069, // 0291 JMP #02FC
0x54220007, // 0292 LDINT R8 8
0x1C200E08, // 0293 EQ R8 R7 R8
0x7822000B, // 0294 JMPF R8 #02A1
@ -792,258 +793,260 @@ be_local_closure(class_Matter_Plugin_Root_read_attribute, /* name */
0x942C1756, // 029D GETIDX R11 R11 K86
0x7C200600, // 029E CALL R8 3
0x80041000, // 029F RET 1 R8
0x70020058, // 02A0 JMP #02FA
0x7002005A, // 02A0 JMP #02FC
0x54220008, // 02A1 LDINT R8 9
0x1C200E08, // 02A2 EQ R8 R7 R8
0x78220005, // 02A3 JMPF R8 #02AA
0x78220007, // 02A3 JMPF R8 #02AC
0x8C200706, // 02A4 GETMET R8 R3 K6
0x88280B0C, // 02A5 GETMBR R10 R5 K12
0x582C0009, // 02A6 LDCONST R11 K9
0x7C200600, // 02A7 CALL R8 3
0x80041000, // 02A8 RET 1 R8
0x7002004F, // 02A9 JMP #02FA
0x54220009, // 02AA LDINT R8 10
0x1C200E08, // 02AB EQ R8 R7 R8
0x78220015, // 02AC JMPF R8 #02C3
0xB8222400, // 02AD GETNGBL R8 K18
0x8C201126, // 02AE GETMET R8 R8 K38
0x58280054, // 02AF LDCONST R10 K84
0x502C0200, // 02B0 LDBOOL R11 1 0
0x7C200600, // 02B1 CALL R8 3
0x94201155, // 02B2 GETIDX R8 R8 K85
0x94201157, // 02B3 GETIDX R8 R8 K87
0x8C24091B, // 02B4 GETMET R9 R4 K27
0x5C2C1000, // 02B5 MOVE R11 R8
0x58300058, // 02B6 LDCONST R12 K88
0x7C240600, // 02B7 CALL R9 3
0x24281305, // 02B8 GT R10 R9 K5
0x782A0002, // 02B9 JMPF R10 #02BD
0x04281309, // 02BA SUB R10 R9 K9
0x402A0A0A, // 02BB CONNECT R10 K5 R10
0x9420100A, // 02BC GETIDX R8 R8 R10
0x8C280706, // 02BD GETMET R10 R3 K6
0x88300B16, // 02BE GETMBR R12 R5 K22
0x5C341000, // 02BF MOVE R13 R8
0x7C280600, // 02C0 CALL R10 3
0x80041400, // 02C1 RET 1 R10
0x70020036, // 02C2 JMP #02FA
0x5422000E, // 02C3 LDINT R8 15
0x1C200E08, // 02C4 EQ R8 R7 R8
0x7822000B, // 02C5 JMPF R8 #02D2
0x8C200706, // 02C6 GETMET R8 R3 K6
0x88280B16, // 02C7 GETMBR R10 R5 K22
0xB82E2400, // 02C8 GETNGBL R11 K18
0x8C2C1725, // 02C9 GETMET R11 R11 K37
0x7C2C0200, // 02CA CALL R11 1
0x8C2C171B, // 02CB GETMET R11 R11 K27
0x5834001C, // 02CC LDCONST R13 K28
0x5838001D, // 02CD LDCONST R14 K29
0x7C2C0600, // 02CE CALL R11 3
0x7C200600, // 02CF CALL R8 3
0x80041000, // 02D0 RET 1 R8
0x70020027, // 02D1 JMP #02FA
0x54220010, // 02D2 LDINT R8 17
0x1C200E08, // 02D3 EQ R8 R7 R8
0x78220005, // 02D4 JMPF R8 #02DB
0x8C200706, // 02D5 GETMET R8 R3 K6
0x88280B10, // 02D6 GETMBR R10 R5 K16
0x582C0009, // 02D7 LDCONST R11 K9
0x7C200600, // 02D8 CALL R8 3
0x80041000, // 02D9 RET 1 R8
0x7002001E, // 02DA JMP #02FA
0x54220011, // 02DB LDINT R8 18
0x1C200E08, // 02DC EQ R8 R7 R8
0x7822000B, // 02DD JMPF R8 #02EA
0x8C200706, // 02DE GETMET R8 R3 K6
0x88280B16, // 02DF GETMBR R10 R5 K22
0xB82E2400, // 02E0 GETNGBL R11 K18
0x8C2C1725, // 02E1 GETMET R11 R11 K37
0x7C2C0200, // 02E2 CALL R11 1
0x8C2C171B, // 02E3 GETMET R11 R11 K27
0x5834001C, // 02E4 LDCONST R13 K28
0x5838001D, // 02E5 LDCONST R14 K29
0x7C2C0600, // 02E6 CALL R11 3
0x7C200600, // 02E7 CALL R8 3
0x80041000, // 02E8 RET 1 R8
0x7002000F, // 02E9 JMP #02FA
0x54220012, // 02EA LDINT R8 19
0x1C200E08, // 02EB EQ R8 R7 R8
0x7822000C, // 02EC JMPF R8 #02FA
0x8C200B0A, // 02ED GETMET R8 R5 K10
0x7C200200, // 02EE CALL R8 1
0x8C24110B, // 02EF GETMET R9 R8 K11
0x582C0005, // 02F0 LDCONST R11 K5
0x88300B0C, // 02F1 GETMBR R12 R5 K12
0x5834000F, // 02F2 LDCONST R13 K15
0x7C240800, // 02F3 CALL R9 4
0x8C24110B, // 02F4 GETMET R9 R8 K11
0x582C0009, // 02F5 LDCONST R11 K9
0x88300B0C, // 02F6 GETMBR R12 R5 K12
0x5834000F, // 02F7 LDCONST R13 K15
0x7C240800, // 02F8 CALL R9 4
0x80041000, // 02F9 RET 1 R8
0x70020097, // 02FA JMP #0393
0x5422003E, // 02FB LDINT R8 63
0x1C200C08, // 02FC EQ R8 R6 R8
0x78220000, // 02FD JMPF R8 #02FF
0x70020093, // 02FE JMP #0393
0x54220029, // 02FF LDINT R8 42
0x1C200C08, // 0300 EQ R8 R6 R8
0x7822001D, // 0301 JMPF R8 #0320
0x1C200F05, // 0302 EQ R8 R7 K5
0x78220003, // 0303 JMPF R8 #0308
0x8C200B11, // 0304 GETMET R8 R5 K17
0x7C200200, // 0305 CALL R8 1
0x80041000, // 0306 RET 1 R8
0x70020016, // 0307 JMP #031F
0x1C200F09, // 0308 EQ R8 R7 K9
0x78220005, // 0309 JMPF R8 #0310
0x8C200706, // 030A GETMET R8 R3 K6
0x88280B10, // 030B GETMBR R10 R5 K16
0x582C0005, // 030C LDCONST R11 K5
0x7C200600, // 030D CALL R8 3
0x80041000, // 030E RET 1 R8
0x7002000E, // 030F JMP #031F
0x1C200F0D, // 0310 EQ R8 R7 K13
0x78220005, // 0311 JMPF R8 #0318
0x8C200706, // 0312 GETMET R8 R3 K6
0x88280B0E, // 0313 GETMBR R10 R5 K14
0x582C0009, // 0314 LDCONST R11 K9
0x7C200600, // 0315 CALL R8 3
0x80041000, // 0316 RET 1 R8
0x70020006, // 0317 JMP #031F
0x1C200F0F, // 0318 EQ R8 R7 K15
0x78220004, // 0319 JMPF R8 #031F
0x8C200706, // 031A GETMET R8 R3 K6
0x88280B18, // 031B GETMBR R10 R5 K24
0x4C2C0000, // 031C LDNIL R11
0x7C200600, // 031D CALL R8 3
0x80041000, // 031E RET 1 R8
0x70020072, // 031F JMP #0393
0x5422002A, // 0320 LDINT R8 43
0x1C200C08, // 0321 EQ R8 R6 R8
0x78220016, // 0322 JMPF R8 #033A
0x1C200F05, // 0323 EQ R8 R7 K5
0x78220007, // 0324 JMPF R8 #032D
0x8C200706, // 0325 GETMET R8 R3 K6
0x88280B16, // 0326 GETMBR R10 R5 K22
0xB82E2400, // 0327 GETNGBL R11 K18
0x8C2C1759, // 0328 GETMET R11 R11 K89
0x7C2C0200, // 0329 CALL R11 1
0x7C200600, // 032A CALL R8 3
0x80041000, // 032B RET 1 R8
0x7002000B, // 032C JMP #0339
0x1C200F09, // 032D EQ R8 R7 K9
0x78220009, // 032E JMPF R8 #0339
0x8C200B11, // 032F GETMET R8 R5 K17
0x7C200200, // 0330 CALL R8 1
0x8C24110B, // 0331 GETMET R9 R8 K11
0x4C2C0000, // 0332 LDNIL R11
0x88300B16, // 0333 GETMBR R12 R5 K22
0xB8362400, // 0334 GETNGBL R13 K18
0x8C341B59, // 0335 GETMET R13 R13 K89
0x7C340200, // 0336 CALL R13 1
0x7C240800, // 0337 CALL R9 4
0x80041000, // 0338 RET 1 R8
0x70020058, // 0339 JMP #0393
0x5422002B, // 033A LDINT R8 44
0x1C200C08, // 033B EQ R8 R6 R8
0x7822001C, // 033C JMPF R8 #035A
0x1C200F05, // 033D EQ R8 R7 K5
0x78220005, // 033E JMPF R8 #0345
0x8C200706, // 033F GETMET R8 R3 K6
0x88280B0E, // 0340 GETMBR R10 R5 K14
0x582C0009, // 0341 LDCONST R11 K9
0x7C200600, // 0342 CALL R8 3
0x80041000, // 0343 RET 1 R8
0x70020013, // 0344 JMP #0359
0x1C200F09, // 0345 EQ R8 R7 K9
0x78220005, // 0346 JMPF R8 #034D
0x8C200706, // 0347 GETMET R8 R3 K6
0x88280B0E, // 0348 GETMBR R10 R5 K14
0x542E0003, // 0349 LDINT R11 4
0x7C200600, // 034A CALL R8 3
0x80041000, // 034B RET 1 R8
0x7002000B, // 034C JMP #0359
0x1C200F0D, // 034D EQ R8 R7 K13
0x78220009, // 034E JMPF R8 #0359
0x8C200B11, // 034F GETMET R8 R5 K17
0x7C200200, // 0350 CALL R8 1
0x8C24110B, // 0351 GETMET R9 R8 K11
0x4C2C0000, // 0352 LDNIL R11
0x8C300B5A, // 0353 GETMET R12 R5 K90
0x88380B0E, // 0354 GETMBR R14 R5 K14
0x543E0003, // 0355 LDINT R15 4
0x7C300600, // 0356 CALL R12 3
0x7C240600, // 0357 CALL R9 3
0x80041000, // 0358 RET 1 R8
0x70020038, // 0359 JMP #0393
0x54220030, // 035A LDINT R8 49
0x1C200C08, // 035B EQ R8 R6 R8
0x78220007, // 035C JMPF R8 #0365
0x1C200F0F, // 035D EQ R8 R7 K15
0x78220004, // 035E JMPF R8 #0364
0x8C200706, // 035F GETMET R8 R3 K6
0x88280B0E, // 0360 GETMBR R10 R5 K14
0x542E001D, // 0361 LDINT R11 30
0x7C200600, // 0362 CALL R8 3
0x80041000, // 0363 RET 1 R8
0x7002002D, // 0364 JMP #0393
0x5422001C, // 0365 LDINT R8 29
0x1C200C08, // 0366 EQ R8 R6 R8
0x7822002A, // 0367 JMPF R8 #0393
0x1C200F0D, // 0368 EQ R8 R7 K13
0x78220008, // 0369 JMPF R8 #0373
0x8C200B11, // 036A GETMET R8 R5 K17
0x7C200200, // 036B CALL R8 1
0x8C24110B, // 036C GETMET R9 R8 K11
0x4C2C0000, // 036D LDNIL R11
0x88300B0C, // 036E GETMBR R12 R5 K12
0x5436001E, // 036F LDINT R13 31
0x7C240800, // 0370 CALL R9 4
0x80041000, // 0371 RET 1 R8
0x7002001F, // 0372 JMP #0393
0x1C200F0F, // 0373 EQ R8 R7 K15
0x7822001D, // 0374 JMPF R8 #0393
0x8C200B11, // 0375 GETMET R8 R5 K17
0x7C200200, // 0376 CALL R8 1
0x88240136, // 0377 GETMBR R9 R0 K54
0x8C24135B, // 0378 GETMET R9 R9 K91
0x502C0200, // 0379 LDBOOL R11 1 0
0x7C240400, // 037A CALL R9 2
0x88280136, // 037B GETMBR R10 R0 K54
0x8828155C, // 037C GETMBR R10 R10 K92
0x602C0010, // 037D GETGBL R11 G16
0x5C301200, // 037E MOVE R12 R9
0x7C2C0200, // 037F CALL R11 1
0xA802000D, // 0380 EXBLK 0 #038F
0x5C301600, // 0381 MOVE R12 R11
0x7C300000, // 0382 CALL R12 0
0x5C341400, // 0383 MOVE R13 R10
0x78360003, // 0384 JMPF R13 #0389
0xB8360200, // 0385 GETNGBL R13 K1
0x88341B5D, // 0386 GETMBR R13 R13 K93
0x2034180D, // 0387 NE R13 R12 R13
0x78360004, // 0388 JMPF R13 #038E
0x8C34110B, // 0389 GETMET R13 R8 K11
0x4C3C0000, // 038A LDNIL R15
0x88400B0C, // 038B GETMBR R16 R5 K12
0x5C441800, // 038C MOVE R17 R12
0x7C340800, // 038D CALL R13 4
0x7001FFF1, // 038E JMP #0381
0x582C003E, // 038F LDCONST R11 K62
0xAC2C0200, // 0390 CATCH R11 1 0
0xB0080000, // 0391 RAISE 2 R0 R0
0x80041000, // 0392 RET 1 R8
0x60200003, // 0393 GETGBL R8 G3
0x5C240000, // 0394 MOVE R9 R0
0x7C200200, // 0395 CALL R8 1
0x8C20115E, // 0396 GETMET R8 R8 K94
0x5C280200, // 0397 MOVE R10 R1
0x5C2C0400, // 0398 MOVE R11 R2
0x5C300600, // 0399 MOVE R12 R3
0x7C200800, // 039A CALL R8 4
0x80041000, // 039B RET 1 R8
0x88280B2A, // 02A5 GETMBR R10 R5 K42
0xB82E2400, // 02A6 GETNGBL R11 K18
0x8C2C1757, // 02A7 GETMET R11 R11 K87
0x7C2C0200, // 02A8 CALL R11 1
0x7C200600, // 02A9 CALL R8 3
0x80041000, // 02AA RET 1 R8
0x7002004F, // 02AB JMP #02FC
0x54220009, // 02AC LDINT R8 10
0x1C200E08, // 02AD EQ R8 R7 R8
0x78220015, // 02AE JMPF R8 #02C5
0xB8222400, // 02AF GETNGBL R8 K18
0x8C201126, // 02B0 GETMET R8 R8 K38
0x58280054, // 02B1 LDCONST R10 K84
0x502C0200, // 02B2 LDBOOL R11 1 0
0x7C200600, // 02B3 CALL R8 3
0x94201155, // 02B4 GETIDX R8 R8 K85
0x94201158, // 02B5 GETIDX R8 R8 K88
0x8C24091B, // 02B6 GETMET R9 R4 K27
0x5C2C1000, // 02B7 MOVE R11 R8
0x58300059, // 02B8 LDCONST R12 K89
0x7C240600, // 02B9 CALL R9 3
0x24281305, // 02BA GT R10 R9 K5
0x782A0002, // 02BB JMPF R10 #02BF
0x04281309, // 02BC SUB R10 R9 K9
0x402A0A0A, // 02BD CONNECT R10 K5 R10
0x9420100A, // 02BE GETIDX R8 R8 R10
0x8C280706, // 02BF GETMET R10 R3 K6
0x88300B16, // 02C0 GETMBR R12 R5 K22
0x5C341000, // 02C1 MOVE R13 R8
0x7C280600, // 02C2 CALL R10 3
0x80041400, // 02C3 RET 1 R10
0x70020036, // 02C4 JMP #02FC
0x5422000E, // 02C5 LDINT R8 15
0x1C200E08, // 02C6 EQ R8 R7 R8
0x7822000B, // 02C7 JMPF R8 #02D4
0x8C200706, // 02C8 GETMET R8 R3 K6
0x88280B16, // 02C9 GETMBR R10 R5 K22
0xB82E2400, // 02CA GETNGBL R11 K18
0x8C2C1725, // 02CB GETMET R11 R11 K37
0x7C2C0200, // 02CC CALL R11 1
0x8C2C171B, // 02CD GETMET R11 R11 K27
0x5834001C, // 02CE LDCONST R13 K28
0x5838001D, // 02CF LDCONST R14 K29
0x7C2C0600, // 02D0 CALL R11 3
0x7C200600, // 02D1 CALL R8 3
0x80041000, // 02D2 RET 1 R8
0x70020027, // 02D3 JMP #02FC
0x54220010, // 02D4 LDINT R8 17
0x1C200E08, // 02D5 EQ R8 R7 R8
0x78220005, // 02D6 JMPF R8 #02DD
0x8C200706, // 02D7 GETMET R8 R3 K6
0x88280B10, // 02D8 GETMBR R10 R5 K16
0x582C0009, // 02D9 LDCONST R11 K9
0x7C200600, // 02DA CALL R8 3
0x80041000, // 02DB RET 1 R8
0x7002001E, // 02DC JMP #02FC
0x54220011, // 02DD LDINT R8 18
0x1C200E08, // 02DE EQ R8 R7 R8
0x7822000B, // 02DF JMPF R8 #02EC
0x8C200706, // 02E0 GETMET R8 R3 K6
0x88280B16, // 02E1 GETMBR R10 R5 K22
0xB82E2400, // 02E2 GETNGBL R11 K18
0x8C2C1725, // 02E3 GETMET R11 R11 K37
0x7C2C0200, // 02E4 CALL R11 1
0x8C2C171B, // 02E5 GETMET R11 R11 K27
0x5834001C, // 02E6 LDCONST R13 K28
0x5838001D, // 02E7 LDCONST R14 K29
0x7C2C0600, // 02E8 CALL R11 3
0x7C200600, // 02E9 CALL R8 3
0x80041000, // 02EA RET 1 R8
0x7002000F, // 02EB JMP #02FC
0x54220012, // 02EC LDINT R8 19
0x1C200E08, // 02ED EQ R8 R7 R8
0x7822000C, // 02EE JMPF R8 #02FC
0x8C200B0A, // 02EF GETMET R8 R5 K10
0x7C200200, // 02F0 CALL R8 1
0x8C24110B, // 02F1 GETMET R9 R8 K11
0x582C0005, // 02F2 LDCONST R11 K5
0x88300B0C, // 02F3 GETMBR R12 R5 K12
0x5834000F, // 02F4 LDCONST R13 K15
0x7C240800, // 02F5 CALL R9 4
0x8C24110B, // 02F6 GETMET R9 R8 K11
0x582C0009, // 02F7 LDCONST R11 K9
0x88300B0C, // 02F8 GETMBR R12 R5 K12
0x5834000F, // 02F9 LDCONST R13 K15
0x7C240800, // 02FA CALL R9 4
0x80041000, // 02FB RET 1 R8
0x70020097, // 02FC JMP #0395
0x5422003E, // 02FD LDINT R8 63
0x1C200C08, // 02FE EQ R8 R6 R8
0x78220000, // 02FF JMPF R8 #0301
0x70020093, // 0300 JMP #0395
0x54220029, // 0301 LDINT R8 42
0x1C200C08, // 0302 EQ R8 R6 R8
0x7822001D, // 0303 JMPF R8 #0322
0x1C200F05, // 0304 EQ R8 R7 K5
0x78220003, // 0305 JMPF R8 #030A
0x8C200B11, // 0306 GETMET R8 R5 K17
0x7C200200, // 0307 CALL R8 1
0x80041000, // 0308 RET 1 R8
0x70020016, // 0309 JMP #0321
0x1C200F09, // 030A EQ R8 R7 K9
0x78220005, // 030B JMPF R8 #0312
0x8C200706, // 030C GETMET R8 R3 K6
0x88280B10, // 030D GETMBR R10 R5 K16
0x582C0005, // 030E LDCONST R11 K5
0x7C200600, // 030F CALL R8 3
0x80041000, // 0310 RET 1 R8
0x7002000E, // 0311 JMP #0321
0x1C200F0D, // 0312 EQ R8 R7 K13
0x78220005, // 0313 JMPF R8 #031A
0x8C200706, // 0314 GETMET R8 R3 K6
0x88280B0E, // 0315 GETMBR R10 R5 K14
0x582C0009, // 0316 LDCONST R11 K9
0x7C200600, // 0317 CALL R8 3
0x80041000, // 0318 RET 1 R8
0x70020006, // 0319 JMP #0321
0x1C200F0F, // 031A EQ R8 R7 K15
0x78220004, // 031B JMPF R8 #0321
0x8C200706, // 031C GETMET R8 R3 K6
0x88280B18, // 031D GETMBR R10 R5 K24
0x4C2C0000, // 031E LDNIL R11
0x7C200600, // 031F CALL R8 3
0x80041000, // 0320 RET 1 R8
0x70020072, // 0321 JMP #0395
0x5422002A, // 0322 LDINT R8 43
0x1C200C08, // 0323 EQ R8 R6 R8
0x78220016, // 0324 JMPF R8 #033C
0x1C200F05, // 0325 EQ R8 R7 K5
0x78220007, // 0326 JMPF R8 #032F
0x8C200706, // 0327 GETMET R8 R3 K6
0x88280B16, // 0328 GETMBR R10 R5 K22
0xB82E2400, // 0329 GETNGBL R11 K18
0x8C2C175A, // 032A GETMET R11 R11 K90
0x7C2C0200, // 032B CALL R11 1
0x7C200600, // 032C CALL R8 3
0x80041000, // 032D RET 1 R8
0x7002000B, // 032E JMP #033B
0x1C200F09, // 032F EQ R8 R7 K9
0x78220009, // 0330 JMPF R8 #033B
0x8C200B11, // 0331 GETMET R8 R5 K17
0x7C200200, // 0332 CALL R8 1
0x8C24110B, // 0333 GETMET R9 R8 K11
0x4C2C0000, // 0334 LDNIL R11
0x88300B16, // 0335 GETMBR R12 R5 K22
0xB8362400, // 0336 GETNGBL R13 K18
0x8C341B5A, // 0337 GETMET R13 R13 K90
0x7C340200, // 0338 CALL R13 1
0x7C240800, // 0339 CALL R9 4
0x80041000, // 033A RET 1 R8
0x70020058, // 033B JMP #0395
0x5422002B, // 033C LDINT R8 44
0x1C200C08, // 033D EQ R8 R6 R8
0x7822001C, // 033E JMPF R8 #035C
0x1C200F05, // 033F EQ R8 R7 K5
0x78220005, // 0340 JMPF R8 #0347
0x8C200706, // 0341 GETMET R8 R3 K6
0x88280B0E, // 0342 GETMBR R10 R5 K14
0x582C0009, // 0343 LDCONST R11 K9
0x7C200600, // 0344 CALL R8 3
0x80041000, // 0345 RET 1 R8
0x70020013, // 0346 JMP #035B
0x1C200F09, // 0347 EQ R8 R7 K9
0x78220005, // 0348 JMPF R8 #034F
0x8C200706, // 0349 GETMET R8 R3 K6
0x88280B0E, // 034A GETMBR R10 R5 K14
0x542E0003, // 034B LDINT R11 4
0x7C200600, // 034C CALL R8 3
0x80041000, // 034D RET 1 R8
0x7002000B, // 034E JMP #035B
0x1C200F0D, // 034F EQ R8 R7 K13
0x78220009, // 0350 JMPF R8 #035B
0x8C200B11, // 0351 GETMET R8 R5 K17
0x7C200200, // 0352 CALL R8 1
0x8C24110B, // 0353 GETMET R9 R8 K11
0x4C2C0000, // 0354 LDNIL R11
0x8C300B5B, // 0355 GETMET R12 R5 K91
0x88380B0E, // 0356 GETMBR R14 R5 K14
0x543E0003, // 0357 LDINT R15 4
0x7C300600, // 0358 CALL R12 3
0x7C240600, // 0359 CALL R9 3
0x80041000, // 035A RET 1 R8
0x70020038, // 035B JMP #0395
0x54220030, // 035C LDINT R8 49
0x1C200C08, // 035D EQ R8 R6 R8
0x78220007, // 035E JMPF R8 #0367
0x1C200F0F, // 035F EQ R8 R7 K15
0x78220004, // 0360 JMPF R8 #0366
0x8C200706, // 0361 GETMET R8 R3 K6
0x88280B0E, // 0362 GETMBR R10 R5 K14
0x542E001D, // 0363 LDINT R11 30
0x7C200600, // 0364 CALL R8 3
0x80041000, // 0365 RET 1 R8
0x7002002D, // 0366 JMP #0395
0x5422001C, // 0367 LDINT R8 29
0x1C200C08, // 0368 EQ R8 R6 R8
0x7822002A, // 0369 JMPF R8 #0395
0x1C200F0D, // 036A EQ R8 R7 K13
0x78220008, // 036B JMPF R8 #0375
0x8C200B11, // 036C GETMET R8 R5 K17
0x7C200200, // 036D CALL R8 1
0x8C24110B, // 036E GETMET R9 R8 K11
0x4C2C0000, // 036F LDNIL R11
0x88300B0C, // 0370 GETMBR R12 R5 K12
0x5436001E, // 0371 LDINT R13 31
0x7C240800, // 0372 CALL R9 4
0x80041000, // 0373 RET 1 R8
0x7002001F, // 0374 JMP #0395
0x1C200F0F, // 0375 EQ R8 R7 K15
0x7822001D, // 0376 JMPF R8 #0395
0x8C200B11, // 0377 GETMET R8 R5 K17
0x7C200200, // 0378 CALL R8 1
0x88240136, // 0379 GETMBR R9 R0 K54
0x8C24135C, // 037A GETMET R9 R9 K92
0x502C0200, // 037B LDBOOL R11 1 0
0x7C240400, // 037C CALL R9 2
0x88280136, // 037D GETMBR R10 R0 K54
0x8828155D, // 037E GETMBR R10 R10 K93
0x602C0010, // 037F GETGBL R11 G16
0x5C301200, // 0380 MOVE R12 R9
0x7C2C0200, // 0381 CALL R11 1
0xA802000D, // 0382 EXBLK 0 #0391
0x5C301600, // 0383 MOVE R12 R11
0x7C300000, // 0384 CALL R12 0
0x5C341400, // 0385 MOVE R13 R10
0x78360003, // 0386 JMPF R13 #038B
0xB8360200, // 0387 GETNGBL R13 K1
0x88341B5E, // 0388 GETMBR R13 R13 K94
0x2034180D, // 0389 NE R13 R12 R13
0x78360004, // 038A JMPF R13 #0390
0x8C34110B, // 038B GETMET R13 R8 K11
0x4C3C0000, // 038C LDNIL R15
0x88400B0C, // 038D GETMBR R16 R5 K12
0x5C441800, // 038E MOVE R17 R12
0x7C340800, // 038F CALL R13 4
0x7001FFF1, // 0390 JMP #0383
0x582C003E, // 0391 LDCONST R11 K62
0xAC2C0200, // 0392 CATCH R11 1 0
0xB0080000, // 0393 RAISE 2 R0 R0
0x80041000, // 0394 RET 1 R8
0x60200003, // 0395 GETGBL R8 G3
0x5C240000, // 0396 MOVE R9 R0
0x7C200200, // 0397 CALL R8 1
0x8C20115F, // 0398 GETMET R8 R8 K95
0x5C280200, // 0399 MOVE R10 R1
0x5C2C0400, // 039A MOVE R11 R2
0x5C300600, // 039B MOVE R12 R3
0x7C200800, // 039C CALL R8 4
0x80041000, // 039D RET 1 R8
})
)
);
@ -1188,6 +1191,88 @@ be_local_closure(class_Matter_Plugin_Root_write_attribute, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
extern const bclass be_class_Matter_Plugin_Root;
be_local_closure(class_Matter_Plugin_Root_init, /* name */
be_nested_proto(
14, /* nstack */
4, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
&be_class_Matter_Plugin_Root,
1, /* has constants */
( &(const bvalue[14]) { /* constants */
/* K0 */ be_nested_str_weak(init),
/* K1 */ be_nested_str_weak(publish_event),
/* K2 */ be_const_int(0),
/* K3 */ be_nested_str_weak(matter),
/* K4 */ be_nested_str_weak(EVENT_CRITICAL),
/* K5 */ be_nested_str_weak(TLV),
/* K6 */ be_nested_str_weak(Matter_TLV_item),
/* K7 */ be_nested_str_weak(set),
/* K8 */ be_nested_str_weak(U4),
/* K9 */ be_nested_str_weak(tasmota),
/* K10 */ be_nested_str_weak(version),
/* K11 */ be_const_int(3),
/* K12 */ be_nested_str_weak(U1),
/* K13 */ be_const_int(1),
}),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[43]) { /* code */
0x60100003, // 0000 GETGBL R4 G3
0x5C140000, // 0001 MOVE R5 R0
0x7C100200, // 0002 CALL R4 1
0x8C100900, // 0003 GETMET R4 R4 K0
0x5C180200, // 0004 MOVE R6 R1
0x5C1C0400, // 0005 MOVE R7 R2
0x5C200600, // 0006 MOVE R8 R3
0x7C100800, // 0007 CALL R4 4
0x8C100101, // 0008 GETMET R4 R0 K1
0x541A0027, // 0009 LDINT R6 40
0x581C0002, // 000A LDCONST R7 K2
0xB8220600, // 000B GETNGBL R8 K3
0x88201104, // 000C GETMBR R8 R8 K4
0xB8260600, // 000D GETNGBL R9 K3
0x88241305, // 000E GETMBR R9 R9 K5
0x8C241306, // 000F GETMET R9 R9 K6
0x7C240200, // 0010 CALL R9 1
0x8C241307, // 0011 GETMET R9 R9 K7
0xB82E0600, // 0012 GETNGBL R11 K3
0x882C1705, // 0013 GETMBR R11 R11 K5
0x882C1708, // 0014 GETMBR R11 R11 K8
0xB8321200, // 0015 GETNGBL R12 K9
0x8C30190A, // 0016 GETMET R12 R12 K10
0x7C300200, // 0017 CALL R12 1
0x7C240600, // 0018 CALL R9 3
0x7C100A00, // 0019 CALL R4 5
0x8C100101, // 001A GETMET R4 R0 K1
0x541A0032, // 001B LDINT R6 51
0x581C000B, // 001C LDCONST R7 K11
0xB8220600, // 001D GETNGBL R8 K3
0x88201104, // 001E GETMBR R8 R8 K4
0xB8260600, // 001F GETNGBL R9 K3
0x88241305, // 0020 GETMBR R9 R9 K5
0x8C241306, // 0021 GETMET R9 R9 K6
0x7C240200, // 0022 CALL R9 1
0x8C241307, // 0023 GETMET R9 R9 K7
0xB82E0600, // 0024 GETNGBL R11 K3
0x882C1705, // 0025 GETMBR R11 R11 K5
0x882C170C, // 0026 GETMBR R11 R11 K12
0x5830000D, // 0027 LDCONST R12 K13
0x7C240600, // 0028 CALL R9 3
0x7C100A00, // 0029 CALL R4 5
0x80000000, // 002A RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: invoke_request
********************************************************************/
@ -2088,19 +2173,19 @@ extern const bclass be_class_Matter_Plugin;
be_local_class(Matter_Plugin_Root,
0,
&be_class_Matter_Plugin,
be_nested_map(7,
be_nested_map(8,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(read_attribute, 1), be_const_closure(class_Matter_Plugin_Root_read_attribute_closure) },
{ be_const_key_weak(invoke_request, 6), be_const_closure(class_Matter_Plugin_Root_invoke_request_closure) },
{ be_const_key_weak(TYPE, -1), be_nested_str_weak(root) },
{ be_const_key_weak(TYPES, 2), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
{ be_const_key_weak(invoke_request, 1), be_const_closure(class_Matter_Plugin_Root_invoke_request_closure) },
{ be_const_key_weak(init, -1), be_const_closure(class_Matter_Plugin_Root_init_closure) },
{ be_const_key_weak(TYPES, 6), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_int(22, -1), be_const_int(1) },
})) ) } )) },
{ be_const_key_weak(write_attribute, -1), be_const_closure(class_Matter_Plugin_Root_write_attribute_closure) },
{ be_const_key_weak(DISPLAY_NAME, -1), be_nested_str_weak(Root_X20node) },
{ be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
{ be_const_key_weak(write_attribute, 0), be_const_closure(class_Matter_Plugin_Root_write_attribute_closure) },
{ be_const_key_weak(TYPE, -1), be_nested_str_weak(root) },
{ be_const_key_weak(DISPLAY_NAME, 4), be_nested_str_weak(Root_X20node) },
{ be_const_key_weak(CLUSTERS, 7), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(14,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_int(56, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
@ -2295,6 +2380,7 @@ be_local_class(Matter_Plugin_Root,
be_const_int(65533),
})) ) } )) },
})) ) } )) },
{ be_const_key_weak(read_attribute, -1), be_const_closure(class_Matter_Plugin_Root_read_attribute_closure) },
})),
be_str_weak(Matter_Plugin_Root)
);

View File

@ -0,0 +1,350 @@
/* Solidification of Matter_Plugin_2_Sensor_GenericSwitch.h */
/********************************************************************\
* Generated code, don't edit *
\********************************************************************/
#include "be_constobj.h"
extern const bclass be_class_Matter_Plugin_Sensor_GenericSwitch;
/********************************************************************
** Solidified function: <lambda>
********************************************************************/
be_local_closure(class_Matter_Plugin_Sensor_GenericSwitch__X3Clambda_X3E, /* name */
be_nested_proto(
3, /* nstack */
1, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL,
0, /* has constants */
NULL, /* no const */
be_str_weak(_X3Clambda_X3E),
&be_const_str_solidified,
( &(const binstruction[ 4]) { /* code */
0x60040009, // 0000 GETGBL R1 G9
0x5C080000, // 0001 MOVE R2 R0
0x7C040200, // 0002 CALL R1 1
0x80040200, // 0003 RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: parse_configuration
********************************************************************/
extern const bclass be_class_Matter_Plugin_Sensor_GenericSwitch;
be_local_closure(class_Matter_Plugin_Sensor_GenericSwitch_parse_configuration, /* name */
be_nested_proto(
7, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
&be_class_Matter_Plugin_Sensor_GenericSwitch,
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_weak(tasmota_switch_index),
/* K1 */ be_nested_str_weak(find),
/* K2 */ be_nested_str_weak(ARG),
/* K3 */ be_const_int(1),
/* K4 */ be_const_int(0),
}),
be_str_weak(parse_configuration),
&be_const_str_solidified,
( &(const binstruction[12]) { /* code */
0x60080009, // 0000 GETGBL R2 G9
0x8C0C0301, // 0001 GETMET R3 R1 K1
0x88140102, // 0002 GETMBR R5 R0 K2
0x58180003, // 0003 LDCONST R6 K3
0x7C0C0600, // 0004 CALL R3 3
0x7C080200, // 0005 CALL R2 1
0x90020002, // 0006 SETMBR R0 K0 R2
0x88080100, // 0007 GETMBR R2 R0 K0
0x18080504, // 0008 LE R2 R2 K4
0x780A0000, // 0009 JMPF R2 #000B
0x90020103, // 000A SETMBR R0 K0 K3
0x80000000, // 000B RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: update_shadow
********************************************************************/
extern const bclass be_class_Matter_Plugin_Sensor_GenericSwitch;
be_local_closure(class_Matter_Plugin_Sensor_GenericSwitch_update_shadow, /* name */
be_nested_proto(
3, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
&be_class_Matter_Plugin_Sensor_GenericSwitch,
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str_weak(update_shadow),
/* K1 */ be_nested_str_weak(shadow_value),
}),
be_str_weak(update_shadow),
&be_const_str_solidified,
( &(const binstruction[ 8]) { /* code */
0x60040003, // 0000 GETGBL R1 G3
0x5C080000, // 0001 MOVE R2 R0
0x7C040200, // 0002 CALL R1 1
0x8C040300, // 0003 GETMET R1 R1 K0
0x7C040200, // 0004 CALL R1 1
0x50040000, // 0005 LDBOOL R1 0 0
0x90020201, // 0006 SETMBR R0 K1 R1
0x80000000, // 0007 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: read_attribute
********************************************************************/
extern const bclass be_class_Matter_Plugin_Sensor_GenericSwitch;
be_local_closure(class_Matter_Plugin_Sensor_GenericSwitch_read_attribute, /* name */
be_nested_proto(
12, /* nstack */
4, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
&be_class_Matter_Plugin_Sensor_GenericSwitch,
1, /* has constants */
( &(const bvalue[11]) { /* constants */
/* K0 */ be_nested_str_weak(matter),
/* K1 */ be_nested_str_weak(TLV),
/* K2 */ be_nested_str_weak(cluster),
/* K3 */ be_nested_str_weak(attribute),
/* K4 */ be_const_int(0),
/* K5 */ be_nested_str_weak(set),
/* K6 */ be_nested_str_weak(U1),
/* K7 */ be_const_int(2),
/* K8 */ be_const_int(1),
/* K9 */ be_nested_str_weak(U4),
/* K10 */ be_nested_str_weak(read_attribute),
}),
be_str_weak(read_attribute),
&be_const_str_solidified,
( &(const binstruction[51]) { /* code */
0xB8120000, // 0000 GETNGBL R4 K0
0x88100901, // 0001 GETMBR R4 R4 K1
0x88140502, // 0002 GETMBR R5 R2 K2
0x88180503, // 0003 GETMBR R6 R2 K3
0x541E003A, // 0004 LDINT R7 59
0x1C1C0A07, // 0005 EQ R7 R5 R7
0x781E0022, // 0006 JMPF R7 #002A
0x1C1C0D04, // 0007 EQ R7 R6 K4
0x781E0005, // 0008 JMPF R7 #000F
0x8C1C0705, // 0009 GETMET R7 R3 K5
0x88240906, // 000A GETMBR R9 R4 K6
0x58280007, // 000B LDCONST R10 K7
0x7C1C0600, // 000C CALL R7 3
0x80040E00, // 000D RET 1 R7
0x7002001A, // 000E JMP #002A
0x1C1C0D08, // 000F EQ R7 R6 K8
0x781E0005, // 0010 JMPF R7 #0017
0x8C1C0705, // 0011 GETMET R7 R3 K5
0x88240906, // 0012 GETMBR R9 R4 K6
0x58280004, // 0013 LDCONST R10 K4
0x7C1C0600, // 0014 CALL R7 3
0x80040E00, // 0015 RET 1 R7
0x70020012, // 0016 JMP #002A
0x1C1C0D07, // 0017 EQ R7 R6 K7
0x781E0005, // 0018 JMPF R7 #001F
0x8C1C0705, // 0019 GETMET R7 R3 K5
0x88240906, // 001A GETMBR R9 R4 K6
0x58280007, // 001B LDCONST R10 K7
0x7C1C0600, // 001C CALL R7 3
0x80040E00, // 001D RET 1 R7
0x7002000A, // 001E JMP #002A
0x541EFFFB, // 001F LDINT R7 65532
0x1C1C0C07, // 0020 EQ R7 R6 R7
0x781E0007, // 0021 JMPF R7 #002A
0x8C1C0705, // 0022 GETMET R7 R3 K5
0x88240909, // 0023 GETMBR R9 R4 K9
0x542A0003, // 0024 LDINT R10 4
0x002A0E0A, // 0025 ADD R10 K7 R10
0x542E0007, // 0026 LDINT R11 8
0x0028140B, // 0027 ADD R10 R10 R11
0x7C1C0600, // 0028 CALL R7 3
0x80040E00, // 0029 RET 1 R7
0x601C0003, // 002A GETGBL R7 G3
0x5C200000, // 002B MOVE R8 R0
0x7C1C0200, // 002C CALL R7 1
0x8C1C0F0A, // 002D GETMET R7 R7 K10
0x5C240200, // 002E MOVE R9 R1
0x5C280400, // 002F MOVE R10 R2
0x5C2C0600, // 0030 MOVE R11 R3
0x7C1C0800, // 0031 CALL R7 4
0x80040E00, // 0032 RET 1 R7
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: append_state_json
********************************************************************/
extern const bclass be_class_Matter_Plugin_Sensor_GenericSwitch;
be_local_closure(class_Matter_Plugin_Sensor_GenericSwitch_append_state_json, /* name */
be_nested_proto(
5, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
&be_class_Matter_Plugin_Sensor_GenericSwitch,
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str_weak(_X2C_X22Switch_X22_X3A_X25s),
/* K1 */ be_nested_str_weak(shadow_onoff),
}),
be_str_weak(append_state_json),
&be_const_str_solidified,
( &(const binstruction[ 7]) { /* code */
0x60040018, // 0000 GETGBL R1 G24
0x58080000, // 0001 LDCONST R2 K0
0x600C0009, // 0002 GETGBL R3 G9
0x88100101, // 0003 GETMBR R4 R0 K1
0x7C0C0200, // 0004 CALL R3 1
0x7C040400, // 0005 CALL R1 2
0x80040200, // 0006 RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: Matter_Plugin_Sensor_GenericSwitch
********************************************************************/
extern const bclass be_class_Matter_Plugin_Device;
be_local_class(Matter_Plugin_Sensor_GenericSwitch,
2,
&be_class_Matter_Plugin_Device,
be_nested_map(14,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(CLUSTERS, 6), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(6,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_int(5, 1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(12,
( (struct bvalue*) &(const bvalue[]) {
be_const_int(0),
be_const_int(1),
be_const_int(2),
be_const_int(3),
be_const_int(4),
be_const_int(5),
be_const_int(65528),
be_const_int(65529),
be_const_int(65530),
be_const_int(65531),
be_const_int(65532),
be_const_int(65533),
})) ) } )) },
{ be_const_key_int(29, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(10,
( (struct bvalue*) &(const bvalue[]) {
be_const_int(0),
be_const_int(1),
be_const_int(2),
be_const_int(3),
be_const_int(65528),
be_const_int(65529),
be_const_int(65530),
be_const_int(65531),
be_const_int(65532),
be_const_int(65533),
})) ) } )) },
{ be_const_key_int(57, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(12,
( (struct bvalue*) &(const bvalue[]) {
be_const_int(3),
be_const_int(5),
be_const_int(10),
be_const_int(15),
be_const_int(17),
be_const_int(18),
be_const_int(65528),
be_const_int(65529),
be_const_int(65530),
be_const_int(65531),
be_const_int(65532),
be_const_int(65533),
})) ) } )) },
{ be_const_key_int(3, 2), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(8,
( (struct bvalue*) &(const bvalue[]) {
be_const_int(0),
be_const_int(1),
be_const_int(65528),
be_const_int(65529),
be_const_int(65530),
be_const_int(65531),
be_const_int(65532),
be_const_int(65533),
})) ) } )) },
{ be_const_key_int(4, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(7,
( (struct bvalue*) &(const bvalue[]) {
be_const_int(0),
be_const_int(65528),
be_const_int(65529),
be_const_int(65530),
be_const_int(65531),
be_const_int(65532),
be_const_int(65533),
})) ) } )) },
{ be_const_key_int(59, 0), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(9,
( (struct bvalue*) &(const bvalue[]) {
be_const_int(0),
be_const_int(1),
be_const_int(2),
be_const_int(65528),
be_const_int(65529),
be_const_int(65530),
be_const_int(65531),
be_const_int(65532),
be_const_int(65533),
})) ) } )) },
})) ) } )) },
{ be_const_key_weak(ARG, -1), be_nested_str_weak(switch) },
{ be_const_key_weak(UPDATE_TIME, 4), be_const_int(750) },
{ be_const_key_weak(TYPE, -1), be_nested_str_weak(gensw) },
{ be_const_key_weak(append_state_json, 9), be_const_closure(class_Matter_Plugin_Sensor_GenericSwitch_append_state_json_closure) },
{ be_const_key_weak(DISPLAY_NAME, -1), be_nested_str_weak(Generic_X20Switch) },
{ be_const_key_weak(read_attribute, -1), be_const_closure(class_Matter_Plugin_Sensor_GenericSwitch_read_attribute_closure) },
{ be_const_key_weak(update_shadow, -1), be_const_closure(class_Matter_Plugin_Sensor_GenericSwitch_update_shadow_closure) },
{ be_const_key_weak(ARG_HINT, 12), be_nested_str_weak(Switch_X3Cx_X3E_X20number) },
{ be_const_key_weak(tasmota_switch_index, 13), be_const_var(0) },
{ be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_int(15, -1), be_const_int(2) },
})) ) } )) },
{ be_const_key_weak(parse_configuration, 8), be_const_closure(class_Matter_Plugin_Sensor_GenericSwitch_parse_configuration_closure) },
{ be_const_key_weak(shadow_value, -1), be_const_var(1) },
{ be_const_key_weak(ARG_TYPE, -1), be_const_static_closure(class_Matter_Plugin_Sensor_GenericSwitch__X3Clambda_X3E_closure) },
})),
be_str_weak(Matter_Plugin_Sensor_GenericSwitch)
);
/********************************************************************/
/* End of solidification */