mirror of https://github.com/arendst/Tasmota.git
Matter Border Router for ESP8266 (experimental) (#18734)
This commit is contained in:
parent
7b55e1aca2
commit
fe570a1b26
|
@ -8,8 +8,10 @@ All notable changes to this project will be documented in this file.
|
|||
- Command ``WifiPower 0`` to enable dynamic wifi power based on RSSI by @TD-er (#15443)
|
||||
- Command ``WifiPower 1`` to restore default wifi power
|
||||
- HASPmota `meta` attribute and improved `berry_run`
|
||||
- Matter Border Router for ESP8266 (experimental)
|
||||
|
||||
### Breaking Changed
|
||||
- Matter relay number starts at 1 instead of 0 to match Tasmota numbering
|
||||
|
||||
### Changed
|
||||
- InfluxDb resolves DNS name before request (#18015)
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include "be_constobj.h"
|
||||
#include "be_mapping.h"
|
||||
#include <stdio.h>
|
||||
|
||||
// Matter logo
|
||||
static const uint8_t MATTER_LOGO[] =
|
||||
|
@ -36,6 +37,38 @@ static const uint8_t MATTER_LOGO[] =
|
|||
"118.06a96.93,96.93,0,0,0-68.16,118.06l23.27-13.44a71.1,71.1,0,0,1,3.29-35.17L309.46,300l12.78-"
|
||||
"7.38V277.89l-54.39-31.4a71.13,71.13,0,0,1,28.82-20.43Z'/></svg>";
|
||||
|
||||
// Matter stylesheet
|
||||
static const uint8_t MATTER_STYLESHEET[] =
|
||||
"<style>"
|
||||
".bxm{height:14px;width:14px;display:inline-block;border:1px solid currentColor;background-color:var(--cl,#fff)}"
|
||||
".ztdm td:not(:first-child){width:20px;font-size:70%}"
|
||||
".ztdm td:last-child{width:45px}"
|
||||
".ztdm .bt{margin-right:10px;}"
|
||||
".htrm{line-height:20px}"
|
||||
"</style>";
|
||||
|
||||
extern uint32_t matter_convert_seconds_to_dhm(uint32_t seconds, char *unit, uint32_t *color, bbool days);
|
||||
|
||||
char* matter_seconds_to_dhm(int32_t seconds) {
|
||||
static const char empty_resp[] = "<td> </td>";
|
||||
static char res[64]; // static to allow returning to Berry
|
||||
char unit;
|
||||
uint32_t color; // color of text
|
||||
|
||||
if (seconds < 0) { return empty_resp; } // no value
|
||||
|
||||
uint32_t val = matter_convert_seconds_to_dhm(seconds, &unit, &color, bfalse);
|
||||
if (val < 100) {
|
||||
snprintf(res, sizeof(res), "<td style=\"color:#%02x%02x%02x\">🕗%02d%c</td>",
|
||||
(color & 0xFF0000) >> 16, (color & 0x00FF00) >> 8, (color & 0x0000FF),
|
||||
val, unit);
|
||||
} else {
|
||||
return empty_resp;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
BE_FUNC_CTYPE_DECLARE(matter_seconds_to_dhm, "s", "i")
|
||||
|
||||
extern const bclass be_class_Matter_Counter;
|
||||
extern const bclass be_class_Matter_Verhoeff;
|
||||
extern const bclass be_class_Matter_QRCode;
|
||||
|
@ -171,6 +204,15 @@ extern const bclass be_class_Matter_TLV; // need to declare it upfront because
|
|||
#include "solidify/solidified_Matter_Plugin_Sensor_Humidity.h"
|
||||
#include "solidify/solidified_Matter_Plugin_Bridge_HTTP.h"
|
||||
#include "solidify/solidified_Matter_Plugin_Bridge_OnOff.h"
|
||||
#include "solidify/solidified_Matter_Plugin_Bridge_Light0.h"
|
||||
#include "solidify/solidified_Matter_Plugin_Bridge_Light1.h"
|
||||
#include "solidify/solidified_Matter_Plugin_Bridge_Light2.h"
|
||||
#include "solidify/solidified_Matter_Plugin_Bridge_Light3.h"
|
||||
#include "solidify/solidified_Matter_Plugin_Bridge_Sensor.h"
|
||||
#include "solidify/solidified_Matter_Plugin_Bridge_Sensor_Pressure.h"
|
||||
#include "solidify/solidified_Matter_Plugin_Bridge_Sensor_Temp.h"
|
||||
#include "solidify/solidified_Matter_Plugin_Bridge_Sensor_Illuminance.h"
|
||||
#include "solidify/solidified_Matter_Plugin_Bridge_Sensor_Humidity.h"
|
||||
|
||||
/*********************************************************************************************\
|
||||
* Get a bytes() object of the certificate DAC/PAI_Cert
|
||||
|
@ -198,7 +240,9 @@ static int matter_CD_FFF1_8000(bvm *vm) { return matter_return_static_bytes(vm,
|
|||
|
||||
module matter (scope: global, strings: weak) {
|
||||
_LOGO, comptr(MATTER_LOGO)
|
||||
_STYLESHEET, comptr(MATTER_STYLESHEET)
|
||||
MATTER_OPTION, int(151) // SetOption151 enables Matter
|
||||
seconds_to_dhm, ctype_func(matter_seconds_to_dhm)
|
||||
|
||||
Verhoeff, class(be_class_Matter_Verhoeff)
|
||||
Counter, class(be_class_Matter_Counter)
|
||||
|
@ -214,6 +258,7 @@ module matter (scope: global, strings: weak) {
|
|||
get_opcode_name, ctype_func(matter_get_opcode_name)
|
||||
TLV, class(be_class_Matter_TLV)
|
||||
sort, closure(matter_sort_closure)
|
||||
jitter, closure(matter_jitter_closure)
|
||||
inspect, closure(matter_inspect_closure)
|
||||
|
||||
// Status codes
|
||||
|
@ -356,6 +401,15 @@ module matter (scope: global, strings: weak) {
|
|||
Plugin_Sensor_Humidity, class(be_class_Matter_Plugin_Sensor_Humidity) // Humidity Sensor
|
||||
Plugin_Bridge_HTTP, class(be_class_Matter_Plugin_Bridge_HTTP) // HTTP bridge superclass
|
||||
Plugin_Bridge_OnOff, class(be_class_Matter_Plugin_Bridge_OnOff) // HTTP Relay/Light behavior (OnOff)
|
||||
Plugin_Bridge_Light0, class(be_class_Matter_Plugin_Bridge_Light0) // HTTP OnOff Light
|
||||
Plugin_Bridge_Light1, class(be_class_Matter_Plugin_Bridge_Light1) // HTTP Dimmer Light
|
||||
Plugin_Bridge_Light2, class(be_class_Matter_Plugin_Bridge_Light2) // HTTP CT Light
|
||||
Plugin_Bridge_Light3, class(be_class_Matter_Plugin_Bridge_Light3) // HTTP RGB Light
|
||||
Plugin_Bridge_Sensor, class(be_class_Matter_Plugin_Bridge_Sensor) // HTTP generic sensor
|
||||
Plugin_Bridge_Sensor_Pressure, class(be_class_Matter_Plugin_Bridge_Sensor_Pressure) // HTTP Pressure sensor
|
||||
Plugin_Bridge_Sensor_Temp, class(be_class_Matter_Plugin_Bridge_Sensor_Temp) // HTTP Temperature sensor
|
||||
Plugin_Bridge_Sensor_Illuminance, class(be_class_Matter_Plugin_Bridge_Sensor_Illuminance) // HTTP Illuminance sensor
|
||||
Plugin_Bridge_Sensor_Humidity, class(be_class_Matter_Plugin_Bridge_Sensor_Humidity) // HTTP Humidity sensor
|
||||
}
|
||||
|
||||
@const_object_info_end */
|
||||
|
|
|
@ -59,7 +59,7 @@ class Matter_Commisioning_Context
|
|||
return false
|
||||
end
|
||||
|
||||
tasmota.log("MTR: received message " + matter.inspect(msg), 3)
|
||||
tasmota.log("MTR: received message " + matter.inspect(msg), 4)
|
||||
if msg.opcode == 0x10
|
||||
# don't need to do anything, the message is acked already before this call
|
||||
elif msg.opcode == 0x20
|
||||
|
|
|
@ -54,6 +54,8 @@ class Matter_Device
|
|||
# mDNS active announces
|
||||
var mdns_pase_eth # do we have an active PASE mDNS announce for eth
|
||||
var mdns_pase_wifi # do we have an active PASE mDNS announce for wifi
|
||||
# for brige mode, list of HTTP_remote objects (only one instance per remote object)
|
||||
var http_remotes # map of 'domain:port' or `nil` if no bridge
|
||||
# saved in parameters
|
||||
var root_discriminator # as `int`
|
||||
var root_passcode # as `int`
|
||||
|
@ -1212,6 +1214,28 @@ class Matter_Device
|
|||
end
|
||||
end
|
||||
|
||||
#####################################################################
|
||||
# Manager HTTP remotes
|
||||
#####################################################################
|
||||
# register new http remote
|
||||
#
|
||||
# If already registered, return current instance and check timeout
|
||||
def register_http_remote(addr, timeout)
|
||||
if self.http_remotes == nil self.http_remotes = {} end # lazy initialization
|
||||
var http_remote
|
||||
|
||||
if self.http_remotes.contains(addr)
|
||||
http_remote = self.http_remotes[addr]
|
||||
if timeout < http_remote.get_timeout()
|
||||
http_remote.set_timeout(timeout) # reduce timeout if new value is shorter
|
||||
end
|
||||
else
|
||||
http_remote = matter.HTTP_remote(addr, timeout)
|
||||
self.http_remotes[addr] = http_remote
|
||||
end
|
||||
return http_remote
|
||||
end
|
||||
|
||||
#####################################################################
|
||||
# Commands `Mtr___`
|
||||
#####################################################################
|
||||
|
|
|
@ -42,7 +42,7 @@ class Matter_HTTP_async : Matter_TCP_async
|
|||
var chunk_size # nil or int, size of the current chunk
|
||||
static var HTTP_GET = "GET %s HTTP/1.1\r\nHost %s:%s\r\nConnection: close\r\n\r\n" # see https://stackoverflow.com/questions/6686261/what-at-the-bare-minimum-is-required-for-an-http-request
|
||||
|
||||
static var HTTP_STATUS_REGEX = "HTTP/1\\.[1-2] (\\d+) .*?\r\n" # extract stattus code from first line
|
||||
static var HTTP_STATUS_REGEX = "HTTP/1\\.[0-1] (\\d+) .*?\r\n" # extract stattus code from first line
|
||||
static var HTTP_HEADER_REGEX = "([A-Za-z0-9-]+): (.*?)\r\n" # extract a header with its 2 parts
|
||||
static var HTTP_BODY_REGEX = "\r\n" # end of headers
|
||||
static var HTTP_CHUNK_REGEX = "\r\n([A-Fa-f0-9]+)[ \t]*.*?\r\n" # extract the length of a chunk
|
||||
|
@ -250,7 +250,6 @@ class Matter_HTTP_async : Matter_TCP_async
|
|||
end
|
||||
|
||||
var req = string.format(self.HTTP_GET, self.cmd, addr, self.port)
|
||||
#print("sending ", req)
|
||||
var ret = self.write(req)
|
||||
if ret != size(req)
|
||||
# print("Could not send","size=",size(req),"ret=",ret)
|
||||
|
|
|
@ -22,29 +22,107 @@
|
|||
# dummy declaration for solidification
|
||||
class Matter_HTTP_async end
|
||||
|
||||
#############################################################
|
||||
# This class has the following purposes:
|
||||
#
|
||||
# 1. Have multiple classes registered for async requests
|
||||
# and dispatch to all instances results calling `cb(status, payload, index)`
|
||||
# Async requests are currently only `Status <x>` requests
|
||||
# and are dispatched with the `<x>` index
|
||||
#
|
||||
# 2. Implement rate limiting when sending async `Status <x>`
|
||||
# requests to align with the lowest cycle time.
|
||||
# I.e. if plugin sends every 2 seconds and another every 3 seconds
|
||||
# we only send every 2 seconds and dispatch results to all plugins.
|
||||
|
||||
class Matter_HTTP_remote : Matter_HTTP_async
|
||||
var cb # call cb(http_status, payload)
|
||||
var probe_update_time_map # number of milliseconds to wait for each async command (map)
|
||||
var probe_next_timestamp_map # timestamp for last probe (in millis()) for each `Status <x>`
|
||||
# if timestamp is `0`, this should be scheduled in priority
|
||||
var async_cb_map # list of callbacks to call with `cb(http_status, payload)`
|
||||
|
||||
# information about current async command in-flight
|
||||
var current_cmd # current async command
|
||||
# `nil` if current request is synchronous
|
||||
var reachable # is the device reachable
|
||||
var reachable_utc # last tick when the reachability was seen (avoids sending superfluous ping commands)
|
||||
|
||||
|
||||
#############################################################
|
||||
# init
|
||||
def init(addr, port, timeout, fastloop)
|
||||
super(self).init(addr, port, timeout, fastloop)
|
||||
end
|
||||
|
||||
def set_cb(cb)
|
||||
self.cb = cb
|
||||
def init(addr, timeout, fastloop)
|
||||
self.probe_update_time_map = {}
|
||||
self.probe_next_timestamp_map = {}
|
||||
self.async_cb_map = {}
|
||||
self.current_cmd = nil
|
||||
self.reachable = false # force a valid bool value
|
||||
super(self).init(addr, 80, timeout, fastloop)
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# begin
|
||||
# device is alive, update reachable_utc
|
||||
def device_is_alive(alive)
|
||||
if alive
|
||||
# device is known to be reachable
|
||||
self.reachable = true
|
||||
self.reachable_utc = tasmota.rtc()['utc']
|
||||
else
|
||||
self.reachable = false
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Add an async command to scheduler
|
||||
#
|
||||
# returns true if everything is ok, and connection started
|
||||
# returns false if DNS failed
|
||||
# returns nil if no network
|
||||
def begin(cmd)
|
||||
# cmd: the Tasmota command as string
|
||||
# update_time: recurrence in ms (min time of all updates)
|
||||
# cb: callback to this command (optional)
|
||||
def add_schedule(cmd, update_time, cb)
|
||||
if !self.probe_update_time_map.contains(cmd) || update_time < self.probe_update_time_map[cmd]
|
||||
# if cmd is not already registered, or if the update_time needs to be reduced
|
||||
self.probe_update_time_map[cmd] = update_time
|
||||
self.probe_next_timestamp_map[cmd] = matter.jitter(update_time)
|
||||
end
|
||||
|
||||
# do we add a cb?
|
||||
if cb != nil
|
||||
self.add_async_cb(cb, cmd)
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Add a callback to be called for a specific `cmd` or `nil` for all commands
|
||||
def add_async_cb(cb, cmd)
|
||||
self.async_cb_map[cb] = cmd
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Send event to all registered cb
|
||||
#
|
||||
def dispatch_cb(status, payload)
|
||||
var idx = 0
|
||||
for cb: self.async_cb_map.keys()
|
||||
var cmd_filter = self.async_cb_map[cb]
|
||||
if cmd_filter == self.current_cmd || cmd_filter == nil # match command or match any
|
||||
cb(status, payload, self.current_cmd) # call cb
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# probe_async
|
||||
#
|
||||
# Sends a command like `Status <x>` asynchronously to get device status.
|
||||
# Implement rate limiting for devices with multiple sub-devices
|
||||
def probe_async(cmd)
|
||||
import string
|
||||
tasmota.log(string.format("MTR: HTTP async request 'http://%s:%i%s'", self.addr, self.port, cmd), 3)
|
||||
return super(self).begin(cmd)
|
||||
import webserver
|
||||
if !tasmota.wifi()['up'] && !tasmota.eth()['up'] return nil end # no network
|
||||
|
||||
self.current_cmd = cmd
|
||||
var cmd_url = "/cm?cmnd=" + string.tr(cmd, ' ', '+')
|
||||
tasmota.log(string.format("MTR: HTTP async request 'http://%s:%i%s'", self.addr, self.port, cmd_url), 3)
|
||||
var ret = self.begin(cmd_url)
|
||||
end
|
||||
|
||||
#############################################################
|
||||
|
@ -54,34 +132,91 @@ class Matter_HTTP_remote : Matter_HTTP_async
|
|||
#
|
||||
# returns nil if something went wrong
|
||||
# returns the payload as string
|
||||
def begin_sync(cmd, timeout)
|
||||
# Note: sync request aborts any ongoing async request
|
||||
def call_sync(cmd, timeout)
|
||||
import string
|
||||
tasmota.log(string.format("MTR: HTTP sync request 'http://%s:%i%s'", self.addr, self.port, cmd), 3)
|
||||
return super(self).begin_sync(cmd, timeout)
|
||||
import webserver
|
||||
if !tasmota.wifi()['up'] && !tasmota.eth()['up'] return nil end # no network
|
||||
|
||||
self.current_cmd = nil
|
||||
var cmd_url = "/cm?cmnd=" + string.tr(cmd, ' ', '+')
|
||||
tasmota.log(string.format("MTR: HTTP sync request 'http://%s:%i%s'", self.addr, self.port, cmd_url), 2)
|
||||
var ret = super(self).begin_sync(cmd_url, timeout)
|
||||
var payload_short = (ret) ? ret : 'nil'
|
||||
if size(payload_short) > 30 payload_short = payload_short[0..29] + '...' end
|
||||
tasmota.log(string.format("MTR: HTTP sync-resp in %i ms from %s: [%i] '%s'", tasmota.millis() - self.time_start, self.addr, size(self.payload), payload_short), 2)
|
||||
return ret
|
||||
end
|
||||
|
||||
def event_http_finished()
|
||||
if self.current_cmd == nil return end # do nothing if sync request
|
||||
import string
|
||||
var payload_short = (self.payload != nil) ? self.payload : 'nil'
|
||||
if size(payload_short) > 30 payload_short = payload_short[0..29] + '...' end
|
||||
tasmota.log(string.format("MTR: HTTP response in %i ms: '%s'", tasmota.millis() - self.time_start, payload_short), 3)
|
||||
|
||||
if self.cb
|
||||
self.cb(self.http_status, self.payload)
|
||||
end
|
||||
tasmota.log(string.format("MTR: HTTP async-resp in %i ms from %s: [%i] '%s'", tasmota.millis() - self.time_start, self.addr, size(self.payload), payload_short), 2)
|
||||
self.dispatch_cb(self.http_status, self.payload)
|
||||
end
|
||||
def event_http_failed()
|
||||
if self.current_cmd == nil return end # do nothing if sync request
|
||||
tasmota.log("MTR: HTTP failed", 3)
|
||||
if self.cb
|
||||
self.cb(self.http_status, nil)
|
||||
end
|
||||
self.dispatch_cb(self.http_status, nil)
|
||||
end
|
||||
def event_http_timeout()
|
||||
tasmota.log("MTR: HTTP timeout", 3)
|
||||
if self.cb
|
||||
self.cb(self.http_status, nil)
|
||||
import string
|
||||
if self.current_cmd == nil return end # do nothing if sync request
|
||||
tasmota.log(string.format("MTR: HTTP timeout http_status=%i phase=%i tcp_status=%i size_payload=%i", self.http_status, self.phase, self.status, size(self.payload)), 2)
|
||||
self.dispatch_cb(self.http_status, nil)
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# scheduler
|
||||
#
|
||||
# check if the timer expired and update_shadow() needs to be called
|
||||
def scheduler()
|
||||
var cmd = nil # keep trakck of command
|
||||
for k: self.probe_next_timestamp_map.keys()
|
||||
if self.probe_next_timestamp_map[k] == 0
|
||||
cmd = k # schedule in priority
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if cmd == nil # if no priotity, find first eligible
|
||||
for k: self.probe_next_timestamp_map.keys()
|
||||
if tasmota.time_reached(self.probe_next_timestamp_map[k])
|
||||
cmd = k
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if cmd == nil return end # nothing to do
|
||||
|
||||
if self.tcp_connected # we have already an async request in-flight
|
||||
self.probe_next_timestamp_map[cmd] = 0 # mark as priority scheduling for near future
|
||||
return
|
||||
end
|
||||
|
||||
# set new next timestamp
|
||||
self.probe_next_timestamp_map[cmd] = tasmota.millis(self.probe_update_time_map[cmd]) # add update_time for command
|
||||
|
||||
# trigger the command
|
||||
self.probe_async(cmd)
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# web_last_seen
|
||||
#
|
||||
# Show when the device was last seen
|
||||
def web_last_seen()
|
||||
import webserver
|
||||
import string
|
||||
|
||||
var seconds = -1 # default if no known value
|
||||
if self.reachable_utc != nil
|
||||
seconds = tasmota.rtc()['utc'] - self.reachable_utc
|
||||
end
|
||||
return matter.seconds_to_dhm(seconds)
|
||||
end
|
||||
end
|
||||
matter.HTTP_remote = Matter_HTTP_remote
|
||||
|
|
|
@ -58,20 +58,6 @@ class Matter_Plugin
|
|||
self.clusters = self.consolidate_clusters()
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# return the map of all types
|
||||
def get_types()
|
||||
return self.TYPES
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Stub for updating shadow values (local copies of what we published to the Matter gateway)
|
||||
#
|
||||
# TO BE OVERRIDDEN
|
||||
# This call is synnchronous and blocking.
|
||||
def parse_update(data)
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Stub for updating shadow values (local copies of what we published to the Matter gateway)
|
||||
#
|
||||
|
@ -82,7 +68,6 @@ class Matter_Plugin
|
|||
# This call is synnchronous and blocking.
|
||||
def update_shadow()
|
||||
self.tick = self.device.tick
|
||||
self.parse_update(nil)
|
||||
end
|
||||
|
||||
#############################################################
|
||||
|
@ -96,16 +81,6 @@ class Matter_Plugin
|
|||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# probe_shadow_async
|
||||
#
|
||||
# TO BE OVERRIDDEN - DON'T CALL SUPER - default is just calling `update_shadow()`
|
||||
# This is called on a regular basis, depending on the type of plugin.
|
||||
# Whenever the data is returned, call `parse_update(<data>)` to update values
|
||||
def probe_shadow_async()
|
||||
self.update_shadow()
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# signal that an attribute has been changed
|
||||
#
|
||||
|
@ -178,7 +153,7 @@ class Matter_Plugin
|
|||
|
||||
if attribute == 0x0000 # ---------- DeviceTypeList / list[DeviceTypeStruct] ----------
|
||||
var dtl = TLV.Matter_TLV_array()
|
||||
var types = self.get_types()
|
||||
var types = self.TYPES
|
||||
for dt: types.keys()
|
||||
var d1 = dtl.add_struct()
|
||||
d1.add_TLV(0, TLV.U2, dt) # DeviceType
|
||||
|
@ -272,14 +247,11 @@ class Matter_Plugin
|
|||
# check if the timer expired and update_shadow() needs to be called
|
||||
def every_250ms()
|
||||
if self.update_next == nil
|
||||
# initialization to a random value within range
|
||||
import crypto
|
||||
var rand31 = crypto.random(4).get(0,4) & 0x7FFFFFFF # random int over 31 bits
|
||||
self.update_next = tasmota.millis(rand31 % self.UPDATE_TIME)
|
||||
self.update_next = matter.jitter(self.UPDATE_TIME)
|
||||
else
|
||||
if tasmota.time_reached(self.update_next)
|
||||
if self.tick != self.device.tick
|
||||
self.probe_shadow_async() # call update_shadow if not already called
|
||||
self.update_shadow() # call update_shadow if not already called
|
||||
end
|
||||
self.update_next = tasmota.millis(self.UPDATE_TIME) # rearm timer
|
||||
end
|
||||
|
|
|
@ -30,7 +30,8 @@ class Matter_Plugin_Bridge_HTTP : Matter_Plugin_Device
|
|||
static var ARG = "" # additional argument name (or empty if none)
|
||||
static var ARG_HTTP = "url" # domain name
|
||||
static var UPDATE_TIME = 3000 # update every 3s
|
||||
static var PROBE_TIMEOUT = 700 # timeout of 700 ms for probing
|
||||
static var UPDATE_CMD = "Status 11" # command to send for updates
|
||||
static var PROBE_TIMEOUT = 1700 # timeout of 1800 ms for probing, which gives at least 1s for TCP recovery
|
||||
static var SYNC_TIMEOUT = 500 # timeout of 700 ms for probing
|
||||
static var CLUSTERS = {
|
||||
# 0x001D: inherited # Descriptor Cluster 9.5 p.453
|
||||
|
@ -45,14 +46,7 @@ class Matter_Plugin_Bridge_HTTP : Matter_Plugin_Device
|
|||
}
|
||||
# static var TYPES = { 0x010A: 2 } # On/Off Light
|
||||
|
||||
var reachable # is the device reachable
|
||||
var reachable_tick # last tick when the reachability was seen (avoids sending superfluous ping commands)
|
||||
|
||||
var http_shadow_map # map of shadows
|
||||
# <x>: map from json - memorize the result from `Status <x>``
|
||||
# each contain a `_tick` attribute to known when they were last loaded
|
||||
var http_remote # instance of Matter_HTTP_remote
|
||||
var next_probe_timestamp # timestamp for next probe (in millis())
|
||||
|
||||
#############################################################
|
||||
# Constructor
|
||||
|
@ -61,60 +55,63 @@ class Matter_Plugin_Bridge_HTTP : Matter_Plugin_Device
|
|||
super(self).init(device, endpoint, arguments)
|
||||
|
||||
var addr = arguments.find(self.ARG_HTTP)
|
||||
self.http_shadow_map = {}
|
||||
self.reachable = false # force a valid bool value
|
||||
self.next_probe_timestamp = nil
|
||||
self.http_remote = matter.HTTP_remote(addr, 80, self.PROBE_TIMEOUT)
|
||||
self.http_remote.set_cb(/s,p-> self.parse_http_response(s, p))
|
||||
self.http_remote = self.device.register_http_remote(addr, self.PROBE_TIMEOUT)
|
||||
self.register_cmd_cb()
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# return the map of all types, add the bridged type
|
||||
def get_types()
|
||||
var types = {}
|
||||
for k: self.TYPES.keys()
|
||||
types[k] = self.TYPES[k]
|
||||
end
|
||||
# Add Bridged Node
|
||||
types[0x0013] = 1 # Bridged Node, v1
|
||||
return types
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# call_remote_async
|
||||
# register_cmd_cb
|
||||
#
|
||||
# Call a remote Tasmota device, returns nothing, callback is called when data arrives
|
||||
def call_remote_async(cmd, arg)
|
||||
import string
|
||||
if !tasmota.wifi()['up'] && !tasmota.eth()['up'] return nil end # no network
|
||||
# Register recurrent command and callback
|
||||
# Defined as a separate method to allow override
|
||||
def register_cmd_cb()
|
||||
self.http_remote.add_schedule(self.UPDATE_CMD, self.UPDATE_TIME,
|
||||
/ status,payload,cmd -> self.parse_http_response(status,payload,cmd))
|
||||
end
|
||||
|
||||
var url = string.format("/cm?cmnd=%s%%20%s", cmd, arg ? arg : '')
|
||||
var ret = self.http_remote.begin(url, self.PROBE_TIMEOUT)
|
||||
#############################################################
|
||||
# Stub for updating shadow values (local copies of what we published to the Matter gateway)
|
||||
#
|
||||
# This method should collect the data from the local or remote device
|
||||
# and call `parse_update(<data>)` when data is available.
|
||||
def update_shadow()
|
||||
self.tick = self.device.tick
|
||||
var ret = self.call_remote_sync(self.UPDATE_CMD)
|
||||
if ret
|
||||
self.parse_http_response(1, ret, self.UPDATE_CMD)
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Stub for updating shadow values (local copies of what we published to the Matter gateway)
|
||||
#
|
||||
# TO BE OVERRIDDEN
|
||||
def parse_update(data, index)
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# call_remote_sync
|
||||
#
|
||||
# Call a remote Tasmota device, returns Berry native map or nil
|
||||
# arg can be nil, in this case `cmd` has it all
|
||||
def call_remote_sync(cmd, arg)
|
||||
# if !self.http_remote return nil end
|
||||
import string
|
||||
if !tasmota.wifi()['up'] && !tasmota.eth()['up'] return nil end # no network
|
||||
import json
|
||||
|
||||
var retry = 2 # try 2 times if first failed
|
||||
var url = string.format("/cm?cmnd=%s%%20%s", cmd, arg ? arg : '')
|
||||
if arg != nil cmd = cmd + ' ' + str(arg) end
|
||||
while retry > 0
|
||||
var ret = self.http_remote.begin_sync(url, self.SYNC_TIMEOUT)
|
||||
var ret = self.http_remote.call_sync(cmd, self.SYNC_TIMEOUT)
|
||||
if ret != nil
|
||||
# device is known to be reachable
|
||||
self.reachable = true
|
||||
self.reachable_tick = self.device.tick
|
||||
return ret
|
||||
self.http_remote.device_is_alive(true)
|
||||
var j = json.load(ret)
|
||||
return j
|
||||
end
|
||||
retry -= 1
|
||||
tasmota.log("MTR: HTTP GET retrying", 3)
|
||||
end
|
||||
self.reachable = false
|
||||
self.http_remote.device_is_alive(false)
|
||||
return nil
|
||||
end
|
||||
|
||||
|
@ -126,12 +123,11 @@ class Matter_Plugin_Bridge_HTTP : Matter_Plugin_Device
|
|||
# `Status 8`: {"StatusSNS":{ [...] }}
|
||||
# `Status 11`: {"StatusSTS":{ [...] }}
|
||||
# `Status 13`: {"StatusSHT":{ [...] }}
|
||||
def parse_http_response(status, payload)
|
||||
def parse_http_response(status, payload, cmd)
|
||||
if status > 0
|
||||
# device is known to be reachable
|
||||
self.reachable = true
|
||||
self.http_remote.device_is_alive(true)
|
||||
var tick = self.device.tick
|
||||
self.reachable_tick = tick
|
||||
|
||||
import json
|
||||
var j = json.load(payload)
|
||||
|
@ -148,54 +144,24 @@ class Matter_Plugin_Bridge_HTTP : Matter_Plugin_Device
|
|||
j = j["StatusSTS"]
|
||||
code = 13
|
||||
end
|
||||
|
||||
if code != nil
|
||||
j['_tick'] = tick
|
||||
self.http_shadow_map[code] = j
|
||||
end
|
||||
# convert to shadow values
|
||||
self.parse_update(j, code) # call parser
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# is_reachable()
|
||||
#
|
||||
# Pings the device and checks if it's reachable
|
||||
def is_reachable_sync()
|
||||
if self.device.tick != self.reachable_tick
|
||||
var ret = self.call_remote_sync("", "") # empty command works as a ping
|
||||
self.reachable = (ret != nil)
|
||||
# self.reachable_tick = cur_tick # done by caller
|
||||
end
|
||||
return self.reachable
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# get_remote_status_sync()
|
||||
#
|
||||
# Get remote `Status <x>` values of sensors, sync and blocking
|
||||
def get_remote_status_lazy(x, sync)
|
||||
var cur_tick = self.device.tick
|
||||
var shadow_x = self.http_shadow_map.find(x)
|
||||
if shadow_x
|
||||
if shadow_x.find('_tick') == cur_tick
|
||||
return shadow_x # we have already updated in this tick
|
||||
end
|
||||
end
|
||||
return self.call_remote_sync("Status", str(x))
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# probe_shadow_async
|
||||
#
|
||||
# ### TO BE OVERRIDDEN - DON'T CALL SUPER - default is just calling `update_shadow()`
|
||||
# This is called on a regular basis, depending on the type of plugin.
|
||||
# Whenever the data is returned, call `update_shadow(<data>)` to update values
|
||||
def probe_shadow_async()
|
||||
# self.call_remote_async(<cmd>, <data>)
|
||||
end
|
||||
# #############################################################
|
||||
# # is_reachable()
|
||||
# #
|
||||
# # Pings the device and checks if it's reachable
|
||||
# def is_reachable_lazy_sync()
|
||||
# var cur_tick = self.device.tick
|
||||
# if cur_tick != self.tick
|
||||
# var ret = self.call_remote_sync("", "") # empty command works as a ping
|
||||
# self.http_remote.device_is_alive(ret != nil)
|
||||
# end
|
||||
# return self.http_remote.reachable
|
||||
# end
|
||||
|
||||
#############################################################
|
||||
# read attribute
|
||||
|
@ -211,7 +177,8 @@ class Matter_Plugin_Bridge_HTTP : Matter_Plugin_Device
|
|||
if attribute == 0x0000 # ---------- DataModelRevision / CommissioningWindowStatus ----------
|
||||
# return TLV.create_TLV(TLV.U2, 1)
|
||||
elif attribute == 0x0011 # ---------- Reachable / bool ----------
|
||||
return TLV.create_TLV(TLV.BOOL, self.reachable) # TODO find a way to do a ping
|
||||
# self.is_reachable_lazy_sync() # Not needed anymore
|
||||
return TLV.create_TLV(TLV.BOOL, self.http_remote.reachable) # TODO find a way to do a ping
|
||||
end
|
||||
|
||||
else
|
||||
|
@ -219,6 +186,15 @@ class Matter_Plugin_Bridge_HTTP : Matter_Plugin_Device
|
|||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# every_250ms
|
||||
#
|
||||
# check if the timer expired and update_shadow() needs to be called
|
||||
def every_250ms()
|
||||
self.http_remote.scheduler() # defer to HTTP scheduler
|
||||
# avoid calling update_shadow() since it's not applicable for HTTP remote
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# UI Methods
|
||||
#############################################################
|
||||
|
@ -247,5 +223,14 @@ class Matter_Plugin_Bridge_HTTP : Matter_Plugin_Device
|
|||
return conf
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# web_values
|
||||
#
|
||||
# Show values of the remote device as HTML
|
||||
def web_values()
|
||||
import webserver
|
||||
webserver.content_send("| <-- (" + self.NAME + ") -->")
|
||||
end
|
||||
|
||||
end
|
||||
matter.Plugin_Bridge_HTTP = Matter_Plugin_Bridge_HTTP
|
||||
|
|
|
@ -0,0 +1,155 @@
|
|||
#
|
||||
# Matter_Plugin_Bridge_Light0.be - implements the behavior for a remote generic Lighting (OnOff only) via HTTP
|
||||
#
|
||||
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# Matter plug-in for core behavior
|
||||
|
||||
# dummy declaration for solidification
|
||||
class Matter_Plugin_Bridge_HTTP end
|
||||
|
||||
#@ solidify:Matter_Plugin_Bridge_Light0,weak
|
||||
|
||||
class Matter_Plugin_Bridge_Light0 : Matter_Plugin_Bridge_HTTP
|
||||
static var TYPE = "http_light0" # name of the plug-in in json
|
||||
static var NAME = "🔗 Light 0 On" # display name of the plug-in
|
||||
static var ARG = "relay" # additional argument name (or empty if none)
|
||||
static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type
|
||||
# static var UPDATE_TIME = 3000 # update every 3s
|
||||
# static var UPDATE_CMD = "Status 11" # command to send for updates
|
||||
static var CLUSTERS = {
|
||||
# 0x001D: inherited # Descriptor Cluster 9.5 p.453
|
||||
# 0x0003: inherited # Identify 1.2 p.16
|
||||
# 0x0004: inherited # Groups 1.3 p.21
|
||||
# 0x0005: inherited # Scenes 1.4 p.30 - no writable
|
||||
0x0006: [0,0xFFFC,0xFFFD], # On/Off 1.5 p.48
|
||||
}
|
||||
static var TYPES = { 0x0100: 2, 0x0013: 1 } # OnOff Light, but not actually used because Relay is managed by OnOff
|
||||
|
||||
var tasmota_relay_index # Relay number in Tasmota (one based)
|
||||
var shadow_onoff # fake status for now # TODO
|
||||
|
||||
#############################################################
|
||||
# Constructor
|
||||
def init(device, endpoint, arguments)
|
||||
super(self).init(device, endpoint, arguments)
|
||||
self.shadow_onoff = false
|
||||
self.tasmota_relay_index = int(arguments.find(self.ARG #-'relay'-#, 1))
|
||||
if self.tasmota_relay_index <= 0 self.tasmota_relay_index = 1 end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Stub for updating shadow values (local copies of what we published to the Matter gateway)
|
||||
#
|
||||
# This call is synnchronous and blocking.
|
||||
def parse_update(data, index)
|
||||
if index == 11 # Status 11
|
||||
var state = false
|
||||
|
||||
if self.tasmota_relay_index == 1 && data.contains("POWER") # special case, can be `POWER` or `POWER1`
|
||||
state = (data.find("POWER") == "ON")
|
||||
else
|
||||
state = (data.find("POWER" + str(self.tasmota_relay_index)) == "ON")
|
||||
end
|
||||
|
||||
if self.shadow_onoff != nil && self.shadow_onoff != bool(state)
|
||||
self.attribute_updated(0x0006, 0x0000)
|
||||
end
|
||||
self.shadow_onoff = state
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Model
|
||||
#
|
||||
def set_onoff(v)
|
||||
var ret = self.call_remote_sync("Power" + str(self.tasmota_relay_index), v ? "1" : "0")
|
||||
if ret != nil
|
||||
self.parse_update(ret, 11) # update shadow from return value
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# read an attribute
|
||||
#
|
||||
def read_attribute(session, ctx)
|
||||
import string
|
||||
var TLV = matter.TLV
|
||||
var cluster = ctx.cluster
|
||||
var attribute = ctx.attribute
|
||||
|
||||
# ====================================================================================================
|
||||
if cluster == 0x0006 # ========== On/Off 1.5 p.48 ==========
|
||||
self.update_shadow_lazy()
|
||||
if attribute == 0x0000 # ---------- OnOff / bool ----------
|
||||
return TLV.create_TLV(TLV.BOOL, self.shadow_onoff)
|
||||
elif attribute == 0xFFFC # ---------- FeatureMap / map32 ----------
|
||||
return TLV.create_TLV(TLV.U4, 0) # 0 = no Level Control for Lighting
|
||||
elif attribute == 0xFFFD # ---------- ClusterRevision / u2 ----------
|
||||
return TLV.create_TLV(TLV.U4, 4) # 0 = no Level Control for Lighting
|
||||
end
|
||||
|
||||
else
|
||||
return super(self).read_attribute(session, ctx)
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Invoke a command
|
||||
#
|
||||
# returns a TLV object if successful, contains the response
|
||||
# or an `int` to indicate a status
|
||||
def invoke_request(session, val, ctx)
|
||||
var TLV = matter.TLV
|
||||
var cluster = ctx.cluster
|
||||
var command = ctx.command
|
||||
|
||||
# ====================================================================================================
|
||||
if cluster == 0x0006 # ========== On/Off 1.5 p.48 ==========
|
||||
self.update_shadow_lazy()
|
||||
if command == 0x0000 # ---------- Off ----------
|
||||
self.set_onoff(false)
|
||||
return true
|
||||
elif command == 0x0001 # ---------- On ----------
|
||||
self.set_onoff(true)
|
||||
return true
|
||||
elif command == 0x0002 # ---------- Toggle ----------
|
||||
self.set_onoff(!self.shadow_onoff)
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# web_values
|
||||
#
|
||||
# Show values of the remote device as HTML
|
||||
def web_values()
|
||||
import webserver
|
||||
import string
|
||||
webserver.content_send(string.format("| Light %s", self.web_value_onoff()))
|
||||
end
|
||||
|
||||
# Show on/off value as html
|
||||
def web_value_onoff()
|
||||
var onoff_html = (self.shadow_onoff != nil ? (self.shadow_onoff ? "<b>On</b>" : "Off") : "")
|
||||
return onoff_html
|
||||
end
|
||||
|
||||
end
|
||||
matter.Plugin_Bridge_Light0 = Matter_Plugin_Bridge_Light0
|
|
@ -0,0 +1,188 @@
|
|||
#
|
||||
# Matter_Plugin_Bridge_Light1.be - implements the behavior for a remote generic Lighting (Dimmer) via HTTP
|
||||
#
|
||||
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# Matter plug-in for core behavior
|
||||
|
||||
# dummy declaration for solidification
|
||||
class Matter_Plugin_Bridge_Light0 end
|
||||
|
||||
#@ solidify:Matter_Plugin_Bridge_Light1,weak
|
||||
|
||||
class Matter_Plugin_Bridge_Light1 : Matter_Plugin_Bridge_Light0
|
||||
static var TYPE = "http_light1" # name of the plug-in in json
|
||||
static var NAME = "🔗 Light 1 Dimmer" # display name of the plug-in
|
||||
# static var ARG = "relay" # additional argument name (or empty if none)
|
||||
# static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type
|
||||
static var CLUSTERS = {
|
||||
# 0x001D: inherited # Descriptor Cluster 9.5 p.453
|
||||
# 0x0003: inherited # Identify 1.2 p.16
|
||||
# 0x0004: inherited # Groups 1.3 p.21
|
||||
# 0x0005: inherited # Scenes 1.4 p.30 - no writable
|
||||
# 0x0006: inherited # On/Off 1.5 p.48
|
||||
0x0008: [0,2,3,0x0F,0x11,0xFFFC,0xFFFD], # Level Control 1.6 p.57
|
||||
}
|
||||
static var TYPES = { 0x0101: 2, 0x0013: 1 } # Dimmable Light
|
||||
|
||||
var shadow_bri
|
||||
# var tasmota_relay_index # ingerited
|
||||
# var shadow_onoff # inherited
|
||||
|
||||
#############################################################
|
||||
# Stub for updating shadow values (local copies of what we published to the Matter gateway)
|
||||
#
|
||||
# This call is synnchronous and blocking.
|
||||
def parse_update(data, index)
|
||||
super(self).parse_update(data, index)
|
||||
|
||||
if index == 11 # Status 11
|
||||
var dimmer = int(data.find("Dimmer")) # 0..100
|
||||
if dimmer != nil
|
||||
var bri = tasmota.scale_uint(dimmer, 0, 100, 0, 254)
|
||||
if bri != self.shadow_bri
|
||||
self.attribute_updated(0x0008, 0x0000)
|
||||
self.shadow_bri = bri
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Model
|
||||
#
|
||||
def set_bri(v)
|
||||
var dimmer = tasmota.scale_uint(v, 0, 254, 0, 100)
|
||||
var ret = self.call_remote_sync("Dimmer", str(dimmer))
|
||||
if ret != nil
|
||||
self.parse_update(ret, 11) # update shadow from return value
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# read an attribute
|
||||
#
|
||||
def read_attribute(session, ctx)
|
||||
import string
|
||||
var TLV = matter.TLV
|
||||
var cluster = ctx.cluster
|
||||
var attribute = ctx.attribute
|
||||
|
||||
# ====================================================================================================
|
||||
if cluster == 0x0008 # ========== Level Control 1.6 p.57 ==========
|
||||
self.update_shadow_lazy()
|
||||
if attribute == 0x0000 # ---------- CurrentLevel / u1 ----------
|
||||
if self.shadow_bri != nil
|
||||
return TLV.create_TLV(TLV.U1, self.shadow_bri)
|
||||
else
|
||||
return TLV.create_TLV(TLV.NULL, nil)
|
||||
end
|
||||
elif attribute == 0x0002 # ---------- MinLevel / u1 ----------
|
||||
return TLV.create_TLV(TLV.U1, 0)
|
||||
elif attribute == 0x0003 # ---------- MaxLevel / u1 ----------
|
||||
return TLV.create_TLV(TLV.U1, 254)
|
||||
elif attribute == 0x000F # ---------- Options / map8 ----------
|
||||
return TLV.create_TLV(TLV.U1, 0) #
|
||||
elif attribute == 0x0011 # ---------- OnLevel / u1 ----------
|
||||
if self.shadow_bri != nil
|
||||
return TLV.create_TLV(TLV.U1, self.shadow_bri)
|
||||
else
|
||||
return TLV.create_TLV(TLV.NULL, nil)
|
||||
end
|
||||
elif attribute == 0xFFFC # ---------- FeatureMap / map32 ----------
|
||||
return TLV.create_TLV(TLV.U4, 0X01) # OnOff
|
||||
elif attribute == 0xFFFD # ---------- ClusterRevision / u2 ----------
|
||||
return TLV.create_TLV(TLV.U4, 5) # "new data model format and notation"
|
||||
end
|
||||
|
||||
else
|
||||
return super(self).read_attribute(session, ctx)
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Invoke a command
|
||||
#
|
||||
# returns a TLV object if successful, contains the response
|
||||
# or an `int` to indicate a status
|
||||
def invoke_request(session, val, ctx)
|
||||
var TLV = matter.TLV
|
||||
var cluster = ctx.cluster
|
||||
var command = ctx.command
|
||||
|
||||
# ====================================================================================================
|
||||
if cluster == 0x0008 # ========== Level Control 1.6 p.57 ==========
|
||||
self.update_shadow_lazy()
|
||||
if command == 0x0000 # ---------- MoveToLevel ----------
|
||||
var bri_in = val.findsubval(0) # Hue 0..254
|
||||
self.set_bri(bri_in)
|
||||
ctx.log = "bri:"+str(bri_in)
|
||||
return true
|
||||
elif command == 0x0001 # ---------- Move ----------
|
||||
# TODO, we don't really support it
|
||||
return true
|
||||
elif command == 0x0002 # ---------- Step ----------
|
||||
# TODO, we don't really support it
|
||||
return true
|
||||
elif command == 0x0003 # ---------- Stop ----------
|
||||
# TODO, we don't really support it
|
||||
return true
|
||||
elif command == 0x0004 # ---------- MoveToLevelWithOnOff ----------
|
||||
var bri_in = val.findsubval(0) # Hue 0..254
|
||||
self.set_bri(bri_in)
|
||||
var onoff = bri_in > 0
|
||||
self.set_onoff(onoff)
|
||||
ctx.log = "bri:"+str(bri_in)
|
||||
return true
|
||||
elif command == 0x0005 # ---------- MoveWithOnOff ----------
|
||||
# TODO, we don't really support it
|
||||
return true
|
||||
elif command == 0x0006 # ---------- StepWithOnOff ----------
|
||||
# TODO, we don't really support it
|
||||
return true
|
||||
elif command == 0x0007 # ---------- StopWithOnOff ----------
|
||||
# TODO, we don't really support it
|
||||
return true
|
||||
end
|
||||
|
||||
else
|
||||
return super(self).invoke_request(session, val, ctx)
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# web_values
|
||||
#
|
||||
# Show values of the remote device as HTML
|
||||
def web_values()
|
||||
import webserver
|
||||
import string
|
||||
webserver.content_send(string.format("| Light %s %s", self.web_value_onoff(), self.web_value_dimmer()))
|
||||
end
|
||||
|
||||
# Show on/off value as html
|
||||
def web_value_dimmer()
|
||||
import string
|
||||
var bri_html = ""
|
||||
if self.shadow_bri != nil
|
||||
var bri = tasmota.scale_uint(self.shadow_bri, 0, 254, 0, 100)
|
||||
bri_html = string.format("%i%%", bri)
|
||||
end
|
||||
return "🔅 " + bri_html;
|
||||
end
|
||||
end
|
||||
matter.Plugin_Bridge_Light1 = Matter_Plugin_Bridge_Light1
|
|
@ -0,0 +1,190 @@
|
|||
#
|
||||
# Matter_Plugin_Bridge_Light2.be - implements the behavior for a remote generic Lighting (CT) via HTTP
|
||||
#
|
||||
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# Matter plug-in for core behavior
|
||||
|
||||
# dummy declaration for solidification
|
||||
class Matter_Plugin_Bridge_Light1 end
|
||||
|
||||
#@ solidify:Matter_Plugin_Bridge_Light2,weak
|
||||
|
||||
class Matter_Plugin_Bridge_Light2 : Matter_Plugin_Bridge_Light1
|
||||
static var TYPE = "http_light2" # name of the plug-in in json
|
||||
static var NAME = "🔗 Light 2 CT" # display name of the plug-in
|
||||
# static var ARG = "relay" # additional argument name (or empty if none)
|
||||
# static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type
|
||||
static var CLUSTERS = {
|
||||
# 0x001D: inherited # Descriptor Cluster 9.5 p.453
|
||||
# 0x0003: inherited # Identify 1.2 p.16
|
||||
# 0x0004: inherited # Groups 1.3 p.21
|
||||
# 0x0005: inherited # Scenes 1.4 p.30 - no writable
|
||||
# 0x0006: inherited # On/Off 1.5 p.48
|
||||
# 0x0008: inherited # Level Control 1.6 p.57
|
||||
0x0300: [7,8,0xF,0x400B,0x400C,0xFFFC,0xFFFD], # Color Control 3.2 p.111
|
||||
}
|
||||
static var TYPES = { 0x010C: 2, 0x0013: 1 } # Dimmable Light
|
||||
|
||||
var shadow_ct
|
||||
var ct_min, ct_max
|
||||
|
||||
#############################################################
|
||||
# Constructor
|
||||
def init(device, endpoint, arguments)
|
||||
super(self).init(device, endpoint, arguments)
|
||||
self.update_ct_minmax()
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Stub for updating shadow values (local copies of what we published to the Matter gateway)
|
||||
#
|
||||
# TO BE OVERRIDDEN
|
||||
# This call is synnchronous and blocking.
|
||||
def parse_update(data, index)
|
||||
super(self).parse_update(data, index)
|
||||
|
||||
if index == 11 # Status 11
|
||||
var ct = int(data.find("CT")) # 153..500
|
||||
if ct != nil
|
||||
if ct != self.shadow_ct
|
||||
if ct < self.ct_min ct = self.ct_min end
|
||||
if ct > self.ct_max ct = self.ct_max end
|
||||
self.attribute_updated(0x0300, 0x0007)
|
||||
self.shadow_ct = ct
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Update ct_min/max
|
||||
#
|
||||
def update_ct_minmax()
|
||||
var ct_alexa_mode = tasmota.get_option(82) # if set, range is 200..380 instead of 153...500
|
||||
self.ct_min = ct_alexa_mode ? 200 : 153
|
||||
self.ct_max = ct_alexa_mode ? 380 : 500
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Model
|
||||
#
|
||||
def set_ct(v)
|
||||
var ret = self.call_remote_sync("CT", str(v))
|
||||
if ret != nil
|
||||
self.parse_update(ret, 11) # update shadow from return value
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# read an attribute
|
||||
#
|
||||
def read_attribute(session, ctx)
|
||||
import string
|
||||
var TLV = matter.TLV
|
||||
var cluster = ctx.cluster
|
||||
var attribute = ctx.attribute
|
||||
|
||||
# ====================================================================================================
|
||||
if cluster == 0x0300 # ========== Color Control 3.2 p.111 ==========
|
||||
self.update_shadow_lazy()
|
||||
if attribute == 0x0007 # ---------- ColorTemperatureMireds / u2 ----------
|
||||
if self.shadow_ct != nil
|
||||
return TLV.create_TLV(TLV.U1, self.shadow_ct)
|
||||
else
|
||||
return TLV.create_TLV(TLV.NULL, nil)
|
||||
end
|
||||
elif attribute == 0x0008 # ---------- ColorMode / u1 ----------
|
||||
return TLV.create_TLV(TLV.U1, 2)# 2 = ColorTemperatureMireds
|
||||
elif attribute == 0x000F # ---------- Options / u1 ----------
|
||||
return TLV.create_TLV(TLV.U1, 0)
|
||||
elif attribute == 0x400B # ---------- ColorTempPhysicalMinMireds / u2 ----------
|
||||
return TLV.create_TLV(TLV.U1, self.ct_min)
|
||||
elif attribute == 0x400C # ---------- ColorTempPhysicalMaxMireds / u2 ----------
|
||||
return TLV.create_TLV(TLV.U1, self.ct_max)
|
||||
|
||||
elif attribute == 0xFFFC # ---------- FeatureMap / map32 ----------
|
||||
return TLV.create_TLV(TLV.U4, 0x10) # CT
|
||||
elif attribute == 0xFFFD # ---------- ClusterRevision / u2 ----------
|
||||
return TLV.create_TLV(TLV.U4, 5) # "new data model format and notation, FeatureMap support"
|
||||
end
|
||||
|
||||
else
|
||||
return super(self).read_attribute(session, ctx)
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Invoke a command
|
||||
#
|
||||
# returns a TLV object if successful, contains the response
|
||||
# or an `int` to indicate a status
|
||||
def invoke_request(session, val, ctx)
|
||||
var TLV = matter.TLV
|
||||
var cluster = ctx.cluster
|
||||
var command = ctx.command
|
||||
|
||||
# ====================================================================================================
|
||||
if cluster == 0x0300 # ========== Color Control 3.2 p.111 ==========
|
||||
self.update_shadow_lazy()
|
||||
if command == 0x000A # ---------- MoveToColorTemperature ----------
|
||||
var ct_in = val.findsubval(0) # CT
|
||||
if ct_in < self.ct_min ct_in = self.ct_min end
|
||||
if ct_in > self.ct_max ct_in = self.ct_max end
|
||||
self.set_ct(ct_in)
|
||||
ctx.log = "ct:"+str(ct_in)
|
||||
return true
|
||||
elif command == 0x0047 # ---------- StopMoveStep ----------
|
||||
# TODO, we don't really support it
|
||||
return true
|
||||
elif command == 0x004B # ---------- MoveColorTemperature ----------
|
||||
# TODO, we don't really support it
|
||||
return true
|
||||
elif command == 0x004C # ---------- StepColorTemperature ----------
|
||||
# TODO, we don't really support it
|
||||
return true
|
||||
end
|
||||
|
||||
else
|
||||
return super(self).invoke_request(session, val, ctx)
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# web_values
|
||||
#
|
||||
# Show values of the remote device as HTML
|
||||
def web_values()
|
||||
import webserver
|
||||
import string
|
||||
webserver.content_send(string.format("| Light %s %s %s",
|
||||
self.web_value_onoff(), self.web_value_dimmer(),
|
||||
self.web_value_ct()))
|
||||
end
|
||||
|
||||
# Show on/off value as html
|
||||
def web_value_ct()
|
||||
import string
|
||||
var ct_html = ""
|
||||
if self.shadow_ct != nil
|
||||
var ct_k = (((1000000 / self.shadow_ct) + 25) / 50) * 50 # convert in Kelvin
|
||||
ct_html = string.format("%iK", ct_k)
|
||||
end
|
||||
return "⚪ " + ct_html;
|
||||
end
|
||||
end
|
||||
matter.Plugin_Bridge_Light2 = Matter_Plugin_Bridge_Light2
|
|
@ -0,0 +1,221 @@
|
|||
#
|
||||
# Matter_Plugin_Bridge_Light3.be - implements the behavior for a remote generic Lighting (RGB) via HTTP
|
||||
#
|
||||
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# Matter plug-in for core behavior
|
||||
|
||||
# dummy declaration for solidification
|
||||
class Matter_Plugin_Bridge_Light1 end
|
||||
|
||||
#@ solidify:Matter_Plugin_Bridge_Light3,weak
|
||||
|
||||
class Matter_Plugin_Bridge_Light3 : Matter_Plugin_Bridge_Light1
|
||||
static var TYPE = "http_light3" # name of the plug-in in json
|
||||
static var NAME = "🔗 Light 3 RGB" # display name of the plug-in
|
||||
# static var ARG = "relay" # additional argument name (or empty if none)
|
||||
# static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type
|
||||
static var CLUSTERS = {
|
||||
# 0x001D: inherited # Descriptor Cluster 9.5 p.453
|
||||
# 0x0003: inherited # Identify 1.2 p.16
|
||||
# 0x0004: inherited # Groups 1.3 p.21
|
||||
# 0x0005: inherited # Scenes 1.4 p.30 - no writable
|
||||
# 0x0006: inherited # On/Off 1.5 p.48
|
||||
# 0x0008: inherited # Level Control 1.6 p.57
|
||||
0x0300: [0,1,7,8,0xF,0x4001,0x400A,0xFFFC,0xFFFD],# Color Control 3.2 p.111
|
||||
}
|
||||
static var TYPES = { 0x010D: 2, 0x0013: 1 } # Extended Color Light
|
||||
|
||||
var shadow_hue, shadow_sat # 0..254
|
||||
|
||||
#############################################################
|
||||
# Constructor
|
||||
def init(device, endpoint, arguments)
|
||||
super(self).init(device, endpoint, arguments)
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Stub for updating shadow values (local copies of what we published to the Matter gateway)
|
||||
#
|
||||
# This call is synnchronous and blocking.
|
||||
def parse_update(data, index)
|
||||
super(self).parse_update(data, index)
|
||||
|
||||
if index == 11 # Status 11
|
||||
var hsb = data.find("HSBColor")
|
||||
if hsb
|
||||
import string
|
||||
var hsb_list = string.split(hsb, ",")
|
||||
var hue = int(hsb_list[0])
|
||||
var sat = int(hsb_list[1])
|
||||
# dimmer is already available
|
||||
|
||||
if hue != nil hue = tasmota.scale_uint(hue, 0, 360, 0, 254) else hue = self.shadow_hue end
|
||||
if sat != nil sat = tasmota.scale_uint(sat, 0, 100, 0, 254) else sat = self.shadow_sat end
|
||||
if hue != self.shadow_hue self.attribute_updated(0x0300, 0x0000) self.shadow_hue = hue end
|
||||
if sat != self.shadow_sat self.attribute_updated(0x0300, 0x0001) self.shadow_sat = sat end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Model
|
||||
#
|
||||
def set_hue(v)
|
||||
var hue_360 = tasmota.scale_uint(v, 0, 254, 0, 360)
|
||||
var ret = self.call_remote_sync("HSBColor1", hue_360)
|
||||
if ret != nil
|
||||
self.parse_update(ret, 11) # update shadow from return value
|
||||
end
|
||||
end
|
||||
def set_sat(v)
|
||||
var sat_100 = tasmota.scale_uint(v, 0, 254, 0, 100)
|
||||
var ret = self.call_remote_sync("HSBColor2", sat_100)
|
||||
if ret != nil
|
||||
self.parse_update(ret, 11) # update shadow from return value
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# read an attribute
|
||||
#
|
||||
def read_attribute(session, ctx)
|
||||
import string
|
||||
var TLV = matter.TLV
|
||||
var cluster = ctx.cluster
|
||||
var attribute = ctx.attribute
|
||||
|
||||
# ====================================================================================================
|
||||
if cluster == 0x0300 # ========== Color Control 3.2 p.111 ==========
|
||||
self.update_shadow_lazy()
|
||||
if attribute == 0x0000 # ---------- CurrentHue / u1 ----------
|
||||
if self.shadow_hue != nil
|
||||
return TLV.create_TLV(TLV.U1, self.shadow_hue)
|
||||
else
|
||||
return TLV.create_TLV(TLV.NULL, nil)
|
||||
end
|
||||
elif attribute == 0x0001 # ---------- CurrentSaturation / u2 ----------
|
||||
if self.shadow_sat != nil
|
||||
return TLV.create_TLV(TLV.U1, self.shadow_sat)
|
||||
else
|
||||
return TLV.create_TLV(TLV.NULL, nil)
|
||||
end
|
||||
elif attribute == 0x0007 # ---------- ColorTemperatureMireds / u2 ----------
|
||||
return TLV.create_TLV(TLV.U1, 0)
|
||||
elif attribute == 0x0008 # ---------- ColorMode / u1 ----------
|
||||
return TLV.create_TLV(TLV.U1, 0)# 0 = CurrentHue and CurrentSaturation
|
||||
elif attribute == 0x000F # ---------- Options / u1 ----------
|
||||
return TLV.create_TLV(TLV.U1, 0)
|
||||
elif attribute == 0x4001 # ---------- EnhancedColorMode / u1 ----------
|
||||
return TLV.create_TLV(TLV.U1, 0)
|
||||
elif attribute == 0x400A # ---------- ColorCapabilities / map2 ----------
|
||||
return TLV.create_TLV(TLV.U1, 0)
|
||||
|
||||
# Defined Primaries Information Attribute Set
|
||||
elif attribute == 0x0010 # ---------- NumberOfPrimaries / u1 ----------
|
||||
return TLV.create_TLV(TLV.U1, 0)
|
||||
|
||||
elif attribute == 0xFFFC # ---------- FeatureMap / map32 ----------
|
||||
return TLV.create_TLV(TLV.U4, 0x01) # HS
|
||||
elif attribute == 0xFFFD # ---------- ClusterRevision / u2 ----------
|
||||
return TLV.create_TLV(TLV.U4, 5) # "new data model format and notation, FeatureMap support"
|
||||
end
|
||||
|
||||
else
|
||||
return super(self).read_attribute(session, ctx)
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Invoke a command
|
||||
#
|
||||
# returns a TLV object if successful, contains the response
|
||||
# or an `int` to indicate a status
|
||||
def invoke_request(session, val, ctx)
|
||||
var TLV = matter.TLV
|
||||
var cluster = ctx.cluster
|
||||
var command = ctx.command
|
||||
|
||||
# ====================================================================================================
|
||||
if cluster == 0x0300 # ========== Color Control 3.2 p.111 ==========
|
||||
self.update_shadow_lazy()
|
||||
if command == 0x0000 # ---------- MoveToHue ----------
|
||||
var hue_in = val.findsubval(0) # Hue 0..254
|
||||
self.set_hue(hue_in)
|
||||
ctx.log = "hue:"+str(hue_in)
|
||||
return true
|
||||
elif command == 0x0001 # ---------- MoveHue ----------
|
||||
# TODO, we don't really support it
|
||||
return true
|
||||
elif command == 0x0002 # ---------- StepHue ----------
|
||||
# TODO, we don't really support it
|
||||
return true
|
||||
elif command == 0x0003 # ---------- MoveToSaturation ----------
|
||||
var sat_in = val.findsubval(0) # Sat 0..254
|
||||
self.set_sat(sat_in)
|
||||
ctx.log = "sat:"+str(sat_in)
|
||||
return true
|
||||
elif command == 0x0004 # ---------- MoveSaturation ----------
|
||||
# TODO, we don't really support it
|
||||
return true
|
||||
elif command == 0x0005 # ---------- StepSaturation ----------
|
||||
# TODO, we don't really support it
|
||||
return true
|
||||
elif command == 0x0006 # ---------- MoveToHueAndSaturation ----------
|
||||
var hue_in = val.findsubval(0) # Hue 0..254
|
||||
var sat_in = val.findsubval(1) # Sat 0..254
|
||||
self.set_hue(hue_in)
|
||||
self.set_sat(sat_in)
|
||||
ctx.log = "hue:"+str(hue_in)+" sat:"+str(sat_in)
|
||||
return true
|
||||
elif command == 0x0047 # ---------- StopMoveStep ----------
|
||||
# TODO, we don't really support it
|
||||
return true
|
||||
end
|
||||
|
||||
else
|
||||
return super(self).invoke_request(session, val, ctx)
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# web_values
|
||||
#
|
||||
# Show values of the remote device as HTML
|
||||
def web_values()
|
||||
import webserver
|
||||
import string
|
||||
webserver.content_send(string.format("| Light %s %s %s",
|
||||
self.web_value_onoff(), self.web_value_dimmer(),
|
||||
self.web_value_RGB()))
|
||||
end
|
||||
|
||||
# Show on/off value as html
|
||||
def web_value_RGB()
|
||||
import string
|
||||
if self.shadow_hue != nil && self.shadow_sat != nil
|
||||
var l = light_state(3) # RGB virtual light state object
|
||||
l.set_bri(255) # set full brightness to get full range RGB
|
||||
l.set_huesat(tasmota.scale_uint(self.shadow_hue, 0, 254, 0, 360), tasmota.scale_uint(self.shadow_sat, 0, 254, 0, 255))
|
||||
var rgb_hex = string.format("#%02X%02X%02X", l.r, l.g, l.b)
|
||||
var rgb_html = string.format('<i class="bxm" style="--cl:%s"></i>%s', rgb_hex, rgb_hex)
|
||||
return rgb_html
|
||||
end
|
||||
return ""
|
||||
end
|
||||
end
|
||||
matter.Plugin_Bridge_Light3 = Matter_Plugin_Bridge_Light3
|
|
@ -20,131 +20,23 @@
|
|||
# Matter plug-in for core behavior
|
||||
|
||||
# dummy declaration for solidification
|
||||
class Matter_Plugin_Bridge_HTTP end
|
||||
class Matter_Plugin_Bridge_Light0 end
|
||||
|
||||
#@ solidify:Matter_Plugin_Bridge_OnOff,weak
|
||||
|
||||
class Matter_Plugin_Bridge_OnOff : Matter_Plugin_Bridge_HTTP
|
||||
class Matter_Plugin_Bridge_OnOff : Matter_Plugin_Bridge_Light0
|
||||
static var TYPE = "http_relay" # name of the plug-in in json
|
||||
static var NAME = "🔗 Relay" # display name of the plug-in
|
||||
static var ARG = "relay" # additional argument name (or empty if none)
|
||||
static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type
|
||||
static var CLUSTERS = {
|
||||
# 0x001D: inherited # Descriptor Cluster 9.5 p.453
|
||||
# 0x0003: inherited # Identify 1.2 p.16
|
||||
# 0x0004: inherited # Groups 1.3 p.21
|
||||
# 0x0005: inherited # Scenes 1.4 p.30 - no writable
|
||||
0x0006: [0,0xFFFC,0xFFFD], # On/Off 1.5 p.48
|
||||
}
|
||||
static var TYPES = { 0x010A: 2 } # On/Off Light
|
||||
|
||||
var tasmota_relay_index # Relay number in Tasmota (zero based)
|
||||
var shadow_onoff # fake status for now # TODO
|
||||
static var TYPES = { 0x010A: 2, 0x0013: 1 } # On/Off Plug-in Unit
|
||||
|
||||
#############################################################
|
||||
# Constructor
|
||||
def init(device, endpoint, arguments)
|
||||
# web_values
|
||||
#
|
||||
# Show values of the remote device as HTML
|
||||
def web_values()
|
||||
import webserver
|
||||
import string
|
||||
super(self).init(device, endpoint, arguments)
|
||||
self.shadow_onoff = false
|
||||
self.tasmota_relay_index = arguments.find(self.ARG #-'relay'-#)
|
||||
if self.tasmota_relay_index == nil self.tasmota_relay_index = 0 end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Update shadow
|
||||
#
|
||||
def update_shadow()
|
||||
var ret = self.call_remote_sync("Status", "11")
|
||||
super(self).update_shadow()
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Stub for updating shadow values (local copies of what we published to the Matter gateway)
|
||||
#
|
||||
# TO BE OVERRIDDEN
|
||||
# This call is synnchronous and blocking.
|
||||
def parse_update(data, index)
|
||||
if index == 11 # Status 11
|
||||
var state = (data.find("POWER") == "ON")
|
||||
if self.shadow_onoff != nil && self.shadow_onoff != bool(state)
|
||||
self.attribute_updated(0x0006, 0x0000)
|
||||
end
|
||||
self.shadow_onoff = state
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# probe_shadow_async
|
||||
#
|
||||
# ### TO BE OVERRIDDEN - DON'T CALL SUPER - default is just calling `update_shadow()`
|
||||
# This is called on a regular basis, depending on the type of plugin.
|
||||
# Whenever the data is returned, call `update_shadow(<data>)` to update values
|
||||
def probe_shadow_async()
|
||||
self.call_remote_async("Status", "11")
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Model
|
||||
#
|
||||
def set_onoff(v)
|
||||
self.call_remote_sync("Power", v ? "1" : "0")
|
||||
self.update_shadow()
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# read an attribute
|
||||
#
|
||||
def read_attribute(session, ctx)
|
||||
import string
|
||||
var TLV = matter.TLV
|
||||
var cluster = ctx.cluster
|
||||
var attribute = ctx.attribute
|
||||
|
||||
# ====================================================================================================
|
||||
if cluster == 0x0006 # ========== On/Off 1.5 p.48 ==========
|
||||
self.update_shadow_lazy()
|
||||
if attribute == 0x0000 # ---------- OnOff / bool ----------
|
||||
return TLV.create_TLV(TLV.BOOL, self.shadow_onoff)
|
||||
elif attribute == 0xFFFC # ---------- FeatureMap / map32 ----------
|
||||
return TLV.create_TLV(TLV.U4, 0) # 0 = no Level Control for Lighting
|
||||
elif attribute == 0xFFFD # ---------- ClusterRevision / u2 ----------
|
||||
return TLV.create_TLV(TLV.U4, 4) # 0 = no Level Control for Lighting
|
||||
end
|
||||
|
||||
else
|
||||
return super(self).read_attribute(session, ctx)
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Invoke a command
|
||||
#
|
||||
# returns a TLV object if successful, contains the response
|
||||
# or an `int` to indicate a status
|
||||
def invoke_request(session, val, ctx)
|
||||
var TLV = matter.TLV
|
||||
var cluster = ctx.cluster
|
||||
var command = ctx.command
|
||||
|
||||
# ====================================================================================================
|
||||
if cluster == 0x0006 # ========== On/Off 1.5 p.48 ==========
|
||||
self.update_shadow_lazy()
|
||||
if command == 0x0000 # ---------- Off ----------
|
||||
self.set_onoff(false)
|
||||
self.update_shadow()
|
||||
return true
|
||||
elif command == 0x0001 # ---------- On ----------
|
||||
self.set_onoff(true)
|
||||
self.update_shadow()
|
||||
return true
|
||||
elif command == 0x0002 # ---------- Toggle ----------
|
||||
self.set_onoff(!self.shadow_onoff)
|
||||
self.update_shadow()
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
webserver.content_send(string.format("| Relay %i %s", self.tasmota_relay_index, self.web_value_onoff()))
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
#
|
||||
# Matter_Plugin_Bridge_Sensor.be - implements base class for a Sensor via HTTP to Tasmota
|
||||
#
|
||||
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# Matter plug-in for core behavior
|
||||
|
||||
# dummy declaration for solidification
|
||||
class Matter_Plugin_Bridge_HTTP end
|
||||
|
||||
#@ solidify:Matter_Plugin_Bridge_Sensor,weak
|
||||
|
||||
class Matter_Plugin_Bridge_Sensor : Matter_Plugin_Bridge_HTTP
|
||||
# static var TYPE = "" # name of the plug-in in json
|
||||
# static var NAME = "" # display name of the plug-in
|
||||
static var ARG = "filter" # additional argument name (or empty if none)
|
||||
static var ARG_HTTP = "url" # domain name
|
||||
static var UPDATE_TIME = 5000 # update every 5s
|
||||
static var UPDATE_CMD = "Status 8" # command to send for updates
|
||||
static var PROBE_TIMEOUT = 1700 # timeout of 1700 ms for probing, which gives at least 1s for TCP recovery
|
||||
# static var SYNC_TIMEOUT = 500 # timeout of 700 ms for probing
|
||||
var tasmota_sensor_filter # Rule-type filter to the value, like "ESP32#Temperature"
|
||||
var tasmota_sensor_matcher # Actual matcher object
|
||||
var shadow_value # Last known value
|
||||
|
||||
#############################################################
|
||||
# Constructor
|
||||
def init(device, endpoint, arguments)
|
||||
super(self).init(device, endpoint, arguments)
|
||||
self.tasmota_sensor_filter = arguments.find(self.ARG#-'filter'-#)
|
||||
if self.tasmota_sensor_filter
|
||||
self.tasmota_sensor_matcher = tasmota.Rule_Matcher.parse(self.tasmota_sensor_filter)
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Stub for updating shadow values (local copies of what we published to the Matter gateway)
|
||||
#
|
||||
# TO BE OVERRIDDEN
|
||||
def parse_update(data, index)
|
||||
if index == 8 # Status 8
|
||||
if self.tasmota_sensor_matcher
|
||||
var val = self.pre_value(real(self.tasmota_sensor_matcher.match(data)))
|
||||
if val != nil
|
||||
if val != self.shadow_value
|
||||
self.value_changed(val)
|
||||
end
|
||||
self.shadow_value = val
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Called when the value changed compared to shadow value
|
||||
#
|
||||
# This must be overriden.
|
||||
# This is where you call `self.attribute_updated(<cluster>, <attribute>)`
|
||||
def value_changed(val)
|
||||
# self.attribute_updated(0x0402, 0x0000)
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Pre-process value
|
||||
#
|
||||
# This must be overriden.
|
||||
# This allows to convert the raw sensor value to the target one, typically int
|
||||
def pre_value(val)
|
||||
return val
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Return the first item in the filter
|
||||
def filter_name_html()
|
||||
if self.tasmota_sensor_filter
|
||||
import string
|
||||
import webserver
|
||||
return webserver.html_escape(string.split(self.tasmota_sensor_filter, '#')[0])
|
||||
end
|
||||
return ""
|
||||
end
|
||||
|
||||
end
|
||||
matter.Plugin_Bridge_Sensor = Matter_Plugin_Bridge_Sensor
|
|
@ -0,0 +1,99 @@
|
|||
#
|
||||
# Matter_Plugin_Bridge_Sensor_Humidity.be - implements base class for a Humidity Sensor via HTTP to Tasmota
|
||||
#
|
||||
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# Matter plug-in for core behavior
|
||||
|
||||
# dummy declaration for solidification
|
||||
class Matter_Plugin_Bridge_Sensor end
|
||||
|
||||
#@ solidify:Matter_Plugin_Bridge_Sensor_Humidity,weak
|
||||
|
||||
class Matter_Plugin_Bridge_Sensor_Humidity : Matter_Plugin_Bridge_Sensor
|
||||
static var TYPE = "http_humidity" # name of the plug-in in json
|
||||
static var NAME = "🔗 Humidity" # display name of the plug-in
|
||||
|
||||
static var CLUSTERS = {
|
||||
0x0405: [0,1,2,0xFFFC,0xFFFD], # Humidity Measurement p.102 - no writable
|
||||
}
|
||||
static var TYPES = { 0x0307: 2, 0x0013: 1 } # Humidity Sensor, rev 2
|
||||
|
||||
#############################################################
|
||||
# Called when the value changed compared to shadow value
|
||||
#
|
||||
# This must be overriden.
|
||||
# This is where you call `self.attribute_updated(<cluster>, <attribute>)`
|
||||
def value_changed(val)
|
||||
self.attribute_updated(0x0405, 0x0000)
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Pre-process value
|
||||
#
|
||||
# This must be overriden.
|
||||
# This allows to convert the raw sensor value to the target one, typically int
|
||||
def pre_value(val)
|
||||
return val != nil ? int(val * 100) : nil # 1/100th of percentage
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# read an attribute
|
||||
#
|
||||
def read_attribute(session, ctx)
|
||||
import string
|
||||
var TLV = matter.TLV
|
||||
var cluster = ctx.cluster
|
||||
var attribute = ctx.attribute
|
||||
|
||||
# ====================================================================================================
|
||||
if cluster == 0x0405 # ========== Humidity Measurement 2.4 p.98 ==========
|
||||
if attribute == 0x0000 # ---------- Humidity / u16 ----------
|
||||
if self.shadow_value != nil
|
||||
return TLV.create_TLV(TLV.U2, int(self.shadow_value))
|
||||
else
|
||||
return TLV.create_TLV(TLV.NULL, nil)
|
||||
end
|
||||
elif attribute == 0x0001 # ---------- MinMeasuredValue / u16 ----------
|
||||
return TLV.create_TLV(TLV.U2, 500) # 0%
|
||||
elif attribute == 0x0002 # ---------- MaxMeasuredValue / u16 ----------
|
||||
return TLV.create_TLV(TLV.U2, 10000) # 100%
|
||||
elif attribute == 0xFFFC # ---------- FeatureMap / map32 ----------
|
||||
return TLV.create_TLV(TLV.U4, 0) # 0 = no Extended Range
|
||||
elif attribute == 0xFFFD # ---------- ClusterRevision / u2 ----------
|
||||
return TLV.create_TLV(TLV.U4, 3) # 3 = New data model format and notation
|
||||
end
|
||||
|
||||
else
|
||||
return super(self).read_attribute(session, ctx)
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# web_values
|
||||
#
|
||||
# Show values of the remote device as HTML
|
||||
def web_values()
|
||||
import webserver
|
||||
import string
|
||||
webserver.content_send(string.format("| %s 💧 %2.0f%%",
|
||||
self.filter_name_html(),
|
||||
self.shadow_value != nil ? real(self.shadow_value) / 100 : nil))
|
||||
end
|
||||
|
||||
end
|
||||
matter.Plugin_Bridge_Sensor_Humidity = Matter_Plugin_Bridge_Sensor_Humidity
|
|
@ -0,0 +1,99 @@
|
|||
#
|
||||
# Matter_Plugin_Bridge_Sensor_Illuminance.be - implements base class for a Light/Illuminance Sensor via HTTP to Tasmota
|
||||
#
|
||||
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# Matter plug-in for core behavior
|
||||
|
||||
# dummy declaration for solidification
|
||||
class Matter_Plugin_Bridge_Sensor end
|
||||
|
||||
#@ solidify:Matter_Plugin_Bridge_Sensor_Illuminance,weak
|
||||
|
||||
class Matter_Plugin_Bridge_Sensor_Illuminance : Matter_Plugin_Bridge_Sensor
|
||||
static var TYPE = "http_illuminance" # name of the plug-in in json
|
||||
static var NAME = "🔗 Illuminance" # display name of the plug-in
|
||||
|
||||
static var CLUSTERS = {
|
||||
0x0400: [0,1,2,0xFFFC,0xFFFD], # Illuminance Measurement p.95 - no writable
|
||||
}
|
||||
static var TYPES = { 0x0106: 2, 0x0013: 1 } # Illuminance Sensor, rev 2
|
||||
|
||||
#############################################################
|
||||
# Called when the value changed compared to shadow value
|
||||
#
|
||||
# This must be overriden.
|
||||
# This is where you call `self.attribute_updated(<cluster>, <attribute>)`
|
||||
def value_changed(val)
|
||||
self.attribute_updated(0x0400, 0x0000)
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Pre-process value
|
||||
#
|
||||
# This must be overriden.
|
||||
# This allows to convert the raw sensor value to the target one, typically int
|
||||
def pre_value(val)
|
||||
return val != nil ? int(val) : nil # value in lux
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# read an attribute
|
||||
#
|
||||
def read_attribute(session, ctx)
|
||||
import string
|
||||
var TLV = matter.TLV
|
||||
var cluster = ctx.cluster
|
||||
var attribute = ctx.attribute
|
||||
|
||||
# ====================================================================================================
|
||||
if cluster == 0x0400 # ========== Illuminance Measurement 2.2 p.95 ==========
|
||||
if attribute == 0x0000 # ---------- MeasuredValue / i16 ----------
|
||||
if self.shadow_value != nil
|
||||
return TLV.create_TLV(TLV.I2, int(self.shadow_value))
|
||||
else
|
||||
return TLV.create_TLV(TLV.NULL, nil)
|
||||
end
|
||||
elif attribute == 0x0001 # ---------- MinMeasuredValue / i16 ----------
|
||||
return TLV.create_TLV(TLV.I2, 0) # 0 lux
|
||||
elif attribute == 0x0002 # ---------- MaxMeasuredValue / i16 ----------
|
||||
return TLV.create_TLV(TLV.I2, 10000) # 10000 lux
|
||||
elif attribute == 0xFFFC # ---------- FeatureMap / map32 ----------
|
||||
return TLV.create_TLV(TLV.U4, 0)
|
||||
elif attribute == 0xFFFD # ---------- ClusterRevision / u2 ----------
|
||||
return TLV.create_TLV(TLV.U4, 3) # 3 = New data model format and notation
|
||||
end
|
||||
|
||||
else
|
||||
return super(self).read_attribute(session, ctx)
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# web_values
|
||||
#
|
||||
# Show values of the remote device as HTML
|
||||
def web_values()
|
||||
import webserver
|
||||
import string
|
||||
webserver.content_send(string.format("| %s 🔅 %ilux",
|
||||
self.filter_name_html(),
|
||||
int(self.shadow_value)))
|
||||
end
|
||||
|
||||
end
|
||||
matter.Plugin_Bridge_Sensor_Illuminance = Matter_Plugin_Bridge_Sensor_Illuminance
|
|
@ -0,0 +1,99 @@
|
|||
#
|
||||
# Matter_Plugin_Bridge_Sensor_Temp.be - implements base class for a Pressure Sensor via HTTP to Tasmota
|
||||
#
|
||||
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# Matter plug-in for core behavior
|
||||
|
||||
# dummy declaration for solidification
|
||||
class Matter_Plugin_Bridge_Sensor end
|
||||
|
||||
#@ solidify:Matter_Plugin_Bridge_Sensor_Pressure,weak
|
||||
|
||||
class Matter_Plugin_Bridge_Sensor_Pressure : Matter_Plugin_Bridge_Sensor
|
||||
static var TYPE = "http_pressure" # name of the plug-in in json
|
||||
static var NAME = "🔗 Pressure" # display name of the plug-in
|
||||
|
||||
static var CLUSTERS = {
|
||||
0x0403: [0,1,2,0xFFFC,0xFFFD], # Pressure Measurement
|
||||
}
|
||||
static var TYPES = { 0x0305: 2, 0x0013: 1 } # Temperature Sensor, rev 2
|
||||
|
||||
#############################################################
|
||||
# Called when the value changed compared to shadow value
|
||||
#
|
||||
# This must be overriden.
|
||||
# This is where you call `self.attribute_updated(<cluster>, <attribute>)`
|
||||
def value_changed(val)
|
||||
self.attribute_updated(0x0403, 0x0000)
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Pre-process value
|
||||
#
|
||||
# This must be overriden.
|
||||
# This allows to convert the raw sensor value to the target one, typically int
|
||||
def pre_value(val)
|
||||
return val != nil ? int(val) : nil
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# read an attribute
|
||||
#
|
||||
def read_attribute(session, ctx)
|
||||
import string
|
||||
var TLV = matter.TLV
|
||||
var cluster = ctx.cluster
|
||||
var attribute = ctx.attribute
|
||||
|
||||
# ====================================================================================================
|
||||
if cluster == 0x0403 # ========== Pressure Measurement 2.4 p.98 ==========
|
||||
if attribute == 0x0000 # ---------- MeasuredValue / i16 ----------
|
||||
if self.shadow_value != nil
|
||||
return TLV.create_TLV(TLV.I2, int(self.shadow_value))
|
||||
else
|
||||
return TLV.create_TLV(TLV.NULL, nil)
|
||||
end
|
||||
elif attribute == 0x0001 # ---------- MinMeasuredValue / i16 ----------
|
||||
return TLV.create_TLV(TLV.I2, 500) # 500 hPA
|
||||
elif attribute == 0x0002 # ---------- MaxMeasuredValue / i16 ----------
|
||||
return TLV.create_TLV(TLV.I2, 1500) # 1500 hPA
|
||||
elif attribute == 0xFFFC # ---------- FeatureMap / map32 ----------
|
||||
return TLV.create_TLV(TLV.U4, 0) # 0 = no Extended Range
|
||||
elif attribute == 0xFFFD # ---------- ClusterRevision / u2 ----------
|
||||
return TLV.create_TLV(TLV.U4, 3) # 3 = New data model format and notation
|
||||
end
|
||||
|
||||
else
|
||||
return super(self).read_attribute(session, ctx)
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# web_values
|
||||
#
|
||||
# Show values of the remote device as HTML
|
||||
def web_values()
|
||||
import webserver
|
||||
import string
|
||||
webserver.content_send(string.format("| %s ⛅ %i hPa",
|
||||
self.filter_name_html(),
|
||||
int(self.shadow_value)))
|
||||
end
|
||||
|
||||
end
|
||||
matter.Plugin_Bridge_Sensor_Pressure = Matter_Plugin_Bridge_Sensor_Pressure
|
|
@ -0,0 +1,99 @@
|
|||
#
|
||||
# Matter_Plugin_Bridge_Sensor_Temp.be - implements base class for a Temperature Sensor via HTTP to Tasmota
|
||||
#
|
||||
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# Matter plug-in for core behavior
|
||||
|
||||
# dummy declaration for solidification
|
||||
class Matter_Plugin_Bridge_Sensor end
|
||||
|
||||
#@ solidify:Matter_Plugin_Bridge_Sensor_Temp,weak
|
||||
|
||||
class Matter_Plugin_Bridge_Sensor_Temp : Matter_Plugin_Bridge_Sensor
|
||||
static var TYPE = "http_temperature" # name of the plug-in in json
|
||||
static var NAME = "🔗 Temperature" # display name of the plug-in
|
||||
|
||||
static var CLUSTERS = {
|
||||
0x0402: [0,1,2,0xFFFC,0xFFFD], # Temperature Measurement p.97 - no writable
|
||||
}
|
||||
static var TYPES = { 0x0302: 2, 0x0013: 1 } # Temperature Sensor, rev 2
|
||||
|
||||
#############################################################
|
||||
# Called when the value changed compared to shadow value
|
||||
#
|
||||
# This must be overriden.
|
||||
# This is where you call `self.attribute_updated(<cluster>, <attribute>)`
|
||||
def value_changed(val)
|
||||
self.attribute_updated(0x0402, 0x0000)
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Pre-process value
|
||||
#
|
||||
# This must be overriden.
|
||||
# This allows to convert the raw sensor value to the target one, typically int
|
||||
def pre_value(val)
|
||||
return val != nil ? int(val * 100) : nil
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# read an attribute
|
||||
#
|
||||
def read_attribute(session, ctx)
|
||||
import string
|
||||
var TLV = matter.TLV
|
||||
var cluster = ctx.cluster
|
||||
var attribute = ctx.attribute
|
||||
|
||||
# ====================================================================================================
|
||||
if cluster == 0x0402 # ========== Temperature Measurement 2.3 p.97 ==========
|
||||
if attribute == 0x0000 # ---------- MeasuredValue / i16 (*100) ----------
|
||||
if self.shadow_value != nil
|
||||
return TLV.create_TLV(TLV.I2, self.shadow_value)
|
||||
else
|
||||
return TLV.create_TLV(TLV.NULL, nil)
|
||||
end
|
||||
elif attribute == 0x0001 # ---------- MinMeasuredValue / i16 (*100) ----------
|
||||
return TLV.create_TLV(TLV.I2, -5000) # -50 °C
|
||||
elif attribute == 0x0002 # ---------- MaxMeasuredValue / i16 (*100) ----------
|
||||
return TLV.create_TLV(TLV.I2, 15000) # 150 °C
|
||||
elif attribute == 0xFFFC # ---------- FeatureMap / map32 ----------
|
||||
return TLV.create_TLV(TLV.U4, 0)
|
||||
elif attribute == 0xFFFD # ---------- ClusterRevision / u2 ----------
|
||||
return TLV.create_TLV(TLV.U4, 4) # 4 = New data model format and notation
|
||||
end
|
||||
|
||||
else
|
||||
return super(self).read_attribute(session, ctx)
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# web_values
|
||||
#
|
||||
# Show values of the remote device as HTML
|
||||
def web_values()
|
||||
import webserver
|
||||
import string
|
||||
webserver.content_send(string.format("| %s ☀️ %.1f °C",
|
||||
self.filter_name_html(),
|
||||
self.shadow_value != nil ? real(self.shadow_value) / 100 : nil))
|
||||
end
|
||||
|
||||
end
|
||||
matter.Plugin_Bridge_Sensor_Temp = Matter_Plugin_Bridge_Sensor_Temp
|
|
@ -52,8 +52,10 @@ class Matter_Plugin_Light0 : Matter_Plugin_Device
|
|||
def update_shadow()
|
||||
import light
|
||||
var light_status = light.get()
|
||||
if light_status != nil
|
||||
var pow = light_status.find('power', nil)
|
||||
if pow != self.shadow_onoff self.attribute_updated(0x0006, 0x0000) self.shadow_onoff = pow end
|
||||
end
|
||||
super(self).update_shadow()
|
||||
end
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@ class Matter_Plugin_Light1 : Matter_Plugin_Light0
|
|||
def update_shadow()
|
||||
import light
|
||||
var light_status = light.get()
|
||||
if light_status != nil
|
||||
var bri = light_status.find('bri', nil)
|
||||
if bri != nil
|
||||
bri = tasmota.scale_uint(bri, 0, 255, 0, 254)
|
||||
|
@ -61,6 +62,7 @@ class Matter_Plugin_Light1 : Matter_Plugin_Light0
|
|||
self.shadow_bri = bri
|
||||
end
|
||||
end
|
||||
end
|
||||
super(self).update_shadow() # superclass manages 'power'
|
||||
end
|
||||
|
||||
|
|
|
@ -57,10 +57,12 @@ class Matter_Plugin_Light2 : Matter_Plugin_Light1
|
|||
self.update_ct_minmax()
|
||||
super(self).update_shadow()
|
||||
var light_status = light.get()
|
||||
if light_status != nil
|
||||
var ct = light_status.find('ct', nil)
|
||||
if ct == nil ct = self.shadow_ct end
|
||||
if ct != self.shadow_ct self.attribute_updated(0x0300, 0x0007) self.shadow_ct = ct end
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Update ct_min/max
|
||||
|
|
|
@ -55,6 +55,7 @@ class Matter_Plugin_Light3 : Matter_Plugin_Light1
|
|||
import light
|
||||
super(self).update_shadow()
|
||||
var light_status = light.get()
|
||||
if light_status != nil
|
||||
var hue = light_status.find('hue', nil)
|
||||
var sat = light_status.find('sat', nil)
|
||||
if hue != nil hue = tasmota.scale_uint(hue, 0, 360, 0, 254) else hue = self.shadow_hue end
|
||||
|
@ -62,6 +63,7 @@ class Matter_Plugin_Light3 : Matter_Plugin_Light1
|
|||
if hue != self.shadow_hue self.attribute_updated(0x0300, 0x0000) self.shadow_hue = hue end
|
||||
if sat != self.shadow_sat self.attribute_updated(0x0300, 0x0001) self.shadow_sat = sat end
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# read an attribute
|
||||
|
|
|
@ -37,7 +37,7 @@ class Matter_Plugin_OnOff : Matter_Plugin_Device
|
|||
# 0x0005: inherited # Scenes 1.4 p.30 - no writable
|
||||
0x0006: [0,0xFFFC,0xFFFD], # On/Off 1.5 p.48
|
||||
}
|
||||
static var TYPES = { 0x010A: 2 } # On/Off Light
|
||||
static var TYPES = { 0x010A: 2 } # On/Off Plug-in Unit
|
||||
|
||||
var tasmota_relay_index # Relay number in Tasmota (zero based)
|
||||
var shadow_onoff # fake status for now # TODO
|
||||
|
@ -47,15 +47,15 @@ class Matter_Plugin_OnOff : Matter_Plugin_Device
|
|||
def init(device, endpoint, arguments)
|
||||
super(self).init(device, endpoint, arguments)
|
||||
self.shadow_onoff = false
|
||||
self.tasmota_relay_index = arguments.find(self.ARG #-'relay'-#)
|
||||
if self.tasmota_relay_index == nil self.tasmota_relay_index = 0 end
|
||||
self.tasmota_relay_index = int(arguments.find(self.ARG #-'relay'-#, 1))
|
||||
if self.tasmota_relay_index <= 0 self.tasmota_relay_index = 1 end
|
||||
end
|
||||
|
||||
#############################################################
|
||||
# Update shadow
|
||||
#
|
||||
def update_shadow()
|
||||
var state = tasmota.get_power(self.tasmota_relay_index)
|
||||
var state = tasmota.get_power(self.tasmota_relay_index - 1)
|
||||
if state != nil
|
||||
if self.shadow_onoff != nil && self.shadow_onoff != bool(state)
|
||||
self.attribute_updated(0x0006, 0x0000)
|
||||
|
@ -69,7 +69,7 @@ class Matter_Plugin_OnOff : Matter_Plugin_Device
|
|||
# Model
|
||||
#
|
||||
def set_onoff(v)
|
||||
tasmota.set_power(self.tasmota_relay_index, bool(v))
|
||||
tasmota.set_power(self.tasmota_relay_index - 1, bool(v))
|
||||
self.update_shadow()
|
||||
end
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ class Matter_Plugin_Sensor_Illuminance : Matter_Plugin_Sensor
|
|||
static var CLUSTERS = {
|
||||
0x0400: [0,1,2,0xFFFC,0xFFFD], # Illuminance Measurement p.95 - no writable
|
||||
}
|
||||
static var TYPES = { 0x0106: 2 } # Temperature Sensor, rev 2
|
||||
static var TYPES = { 0x0106: 2 } # Illuminance Sensor, rev 2
|
||||
|
||||
#############################################################
|
||||
# Pre-process value
|
||||
|
|
|
@ -28,9 +28,9 @@ class Matter_Plugin_Sensor_Pressure : Matter_Plugin_Sensor
|
|||
static var TYPE = "pressure" # name of the plug-in in json
|
||||
static var NAME = "Pressure" # display name of the plug-in
|
||||
static var CLUSTERS = {
|
||||
0x0403: [0,1,2,0xFFFC,0xFFFD], # Temperature Measurement p.97 - no writable
|
||||
0x0403: [0,1,2,0xFFFC,0xFFFD], # Pressure Measurement
|
||||
}
|
||||
static var TYPES = { 0x0305: 2 } # Temperature Sensor, rev 2
|
||||
static var TYPES = { 0x0305: 2 } # Pressure Sensor, rev 2
|
||||
|
||||
#############################################################
|
||||
# Pre-process value
|
||||
|
|
|
@ -95,6 +95,7 @@ class Matter_TCP_async
|
|||
if timeout == nil timeout = self.TIMEOUT end
|
||||
self.timeout = timeout
|
||||
end
|
||||
def get_timeout() return self.timeout end
|
||||
|
||||
#############################################################
|
||||
# Reset the instance to send a open a new connection
|
||||
|
|
|
@ -35,7 +35,8 @@ class Matter_UI
|
|||
static var _ROOT_TYPES = "root"
|
||||
static var _CLASSES_TYPES = "|relay|light0|light1|light2|light3|shutter|shutter+tilt"
|
||||
"|temperature|pressure|illuminance|humidity"
|
||||
"|-http|http_relay"
|
||||
static var _CLASSES_TYPES2= "-http|http_relay|http_light0|http_light1|http_light2|http_light3"
|
||||
"|http_temperature|http_pressure|http_illuminance|http_humidity"
|
||||
var device
|
||||
|
||||
def init(device)
|
||||
|
@ -268,7 +269,7 @@ class Matter_UI
|
|||
webserver.content_send(string.format("<tr><td><input type='text' name='ep%03i' maxlength='4' size='3' pattern='[0-9]{1,4}' value='%i'></td>", i, ep))
|
||||
|
||||
webserver.content_send(string.format("<td><select name='pi%03i'>", i))
|
||||
self.plugin_option(conf.find('type', ''), self._CLASSES_TYPES)
|
||||
self.plugin_option(conf.find('type', ''), self._CLASSES_TYPES, self._CLASSES_TYPES2)
|
||||
webserver.content_send(string.format("</select></td>"))
|
||||
webserver.content_send(string.format("<td><font size='-1'><input type='text' name='arg%03i' minlength='0' size='8' value='%s'></font></td>",
|
||||
i, webserver.html_escape(arg)))
|
||||
|
@ -279,7 +280,7 @@ class Matter_UI
|
|||
# add an empty line for adding a configuration
|
||||
webserver.content_send(string.format("<tr><td><input type='text' name='ep%03i' maxlength='4' size='3' pattern='[0-9]{1,4}' value=''></td>", i))
|
||||
webserver.content_send(string.format("<td><select name='pi%03i'>", i))
|
||||
self.plugin_option('', self._CLASSES_TYPES)
|
||||
self.plugin_option('', self._CLASSES_TYPES, self._CLASSES_TYPES2)
|
||||
webserver.content_send(string.format("</select></td>"))
|
||||
webserver.content_send(string.format("<td><font size='-1'><input type='text' name='arg%03i' minlength='0' size='8' value=''></font></td>", i))
|
||||
|
||||
|
@ -293,10 +294,13 @@ class Matter_UI
|
|||
#- ---------------------------------------------------------------------- -#
|
||||
#- Show all possible classes for plugin
|
||||
#- ---------------------------------------------------------------------- -#
|
||||
def plugin_option(cur, class_list)
|
||||
def plugin_option(cur, *class_list)
|
||||
import webserver
|
||||
import string
|
||||
var class_types = class_list ? string.split(class_list, '|') : []
|
||||
var class_types = []
|
||||
for cl: class_list
|
||||
class_types += string.split(cl, '|')
|
||||
end
|
||||
|
||||
var i = 0
|
||||
while i < size(class_types)
|
||||
|
@ -495,6 +499,53 @@ class Matter_UI
|
|||
end
|
||||
end
|
||||
|
||||
#######################################################################
|
||||
# Show bridge status
|
||||
#######################################################################
|
||||
def show_bridge_status()
|
||||
import webserver
|
||||
import string
|
||||
var bridge_plugin_by_host
|
||||
|
||||
var idx = 0
|
||||
while idx < size(self.device.plugins)
|
||||
var plg = self.device.plugins[idx]
|
||||
|
||||
if isinstance(plg, matter.Plugin_Bridge_HTTP)
|
||||
if bridge_plugin_by_host == nil bridge_plugin_by_host = {} end
|
||||
var host = plg.http_remote.addr
|
||||
|
||||
if !bridge_plugin_by_host.contains(host) bridge_plugin_by_host[host] = [] end
|
||||
bridge_plugin_by_host[host].push(plg)
|
||||
|
||||
end
|
||||
idx += 1
|
||||
end
|
||||
|
||||
if bridge_plugin_by_host == nil return end # no remote device, abort
|
||||
|
||||
# set specific styles
|
||||
webserver.content_send("<hr>")
|
||||
webserver.content_send("<table style='width:100%'>")
|
||||
webserver.content_send(matter._STYLESHEET)
|
||||
|
||||
for host: bridge_plugin_by_host.keys()
|
||||
webserver.content_send(string.format("<tr class='ztdm htrm'><td><b>%s</b></td>", webserver.html_escape(host)))
|
||||
var http_remote = bridge_plugin_by_host[host][0].http_remote # get the http_remote object from the first in list
|
||||
webserver.content_send(http_remote.web_last_seen())
|
||||
|
||||
for plg: bridge_plugin_by_host[host]
|
||||
webserver.content_send("<tr class='htrm'><td colspan='2'>")
|
||||
plg.web_values() # show values
|
||||
webserver.content_send("</td></tr>")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
webserver.content_send("</table><hr>")
|
||||
|
||||
end
|
||||
|
||||
#- display sensor value in the web UI -#
|
||||
def web_sensor()
|
||||
import webserver
|
||||
|
@ -503,19 +554,24 @@ class Matter_UI
|
|||
var matter_enabled = tasmota.get_option(matter.MATTER_OPTION)
|
||||
|
||||
if matter_enabled
|
||||
if self.device.is_root_commissioning_open()
|
||||
self.show_commissioning_info()
|
||||
end
|
||||
|
||||
# mtc0 = close, mtc1 = open commissioning
|
||||
var fabrics_count = self.device.sessions.count_active_fabrics()
|
||||
if fabrics_count == 0
|
||||
webserver.content_send(string.format("<div style='text-align:right;font-size:11px;color:#aaa;'>%s</div>", "No active association"))
|
||||
webserver.content_send(string.format("<div style='text-align:right;font-size:11px;color:#aaa;padding:0px;'>%s</div>", "Matter: No active association"))
|
||||
else
|
||||
var plural = fabrics_count > 1
|
||||
webserver.content_send(string.format("<div style='text-align:right;font-size:11px;color:#aaa;'>%s</div>", str(fabrics_count) + " active association" + (plural ? "s" : "")))
|
||||
webserver.content_send(string.format("<div style='text-align:right;font-size:11px;color:#aaa;padding:0px;'>%s</div>", "Matter: " + str(fabrics_count) + " active association" + (plural ? "s" : "")))
|
||||
end
|
||||
|
||||
self.show_bridge_status()
|
||||
|
||||
if self.device.is_root_commissioning_open()
|
||||
self.show_commissioning_info()
|
||||
end
|
||||
|
||||
# display the open/close commissioning button only if there is no active session
|
||||
if fabrics_count == 0
|
||||
webserver.content_send(string.format("<button onclick='la(\"&mtc%i=1\");'>", self.device.commissioning_open == nil ? 1 : 0))
|
||||
webserver.content_send(matter._LOGO)
|
||||
if self.device.commissioning_open == nil
|
||||
|
@ -525,6 +581,7 @@ class Matter_UI
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def web_get_arg()
|
||||
import webserver
|
||||
|
|
|
@ -35,6 +35,19 @@ def sort(l)
|
|||
end
|
||||
matter.sort = sort
|
||||
|
||||
#@ solidify:matter.jitter,weak
|
||||
#############################################################
|
||||
# jitter
|
||||
#
|
||||
# compute a random jitter time for an update_time value
|
||||
def jitter(update_time)
|
||||
# initialization to a random value within range
|
||||
import crypto
|
||||
var rand31 = crypto.random(4).get(0,4) & 0x7FFFFFFF # random int over 31 bits
|
||||
return tasmota.millis(rand31 % update_time)
|
||||
end
|
||||
matter.jitter = jitter
|
||||
|
||||
#@ solidify:matter.inspect,weak
|
||||
# debug function
|
||||
def inspect(p)
|
||||
|
|
|
@ -1281,7 +1281,7 @@ be_local_closure(Matter_Commisioning_Context_process_incoming, /* name */
|
|||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[20]) { /* constants */
|
||||
( &(const bvalue[19]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(device),
|
||||
/* K1 */ be_nested_str_weak(is_commissioning_open),
|
||||
/* K2 */ be_nested_str_weak(opcode),
|
||||
|
@ -1292,16 +1292,15 @@ be_local_closure(Matter_Commisioning_Context_process_incoming, /* name */
|
|||
/* K7 */ be_nested_str_weak(MTR_X3A_X20received_X20message_X20),
|
||||
/* K8 */ be_nested_str_weak(matter),
|
||||
/* K9 */ be_nested_str_weak(inspect),
|
||||
/* K10 */ be_const_int(3),
|
||||
/* K11 */ be_nested_str_weak(parse_PBKDFParamRequest),
|
||||
/* K12 */ be_nested_str_weak(parse_Pake1),
|
||||
/* K13 */ be_nested_str_weak(parse_Pake3),
|
||||
/* K14 */ be_nested_str_weak(parse_Sigma1),
|
||||
/* K15 */ be_nested_str_weak(parse_Sigma3),
|
||||
/* K16 */ be_nested_str_weak(parse_StatusReport),
|
||||
/* K17 */ be_nested_str_weak(string),
|
||||
/* K18 */ be_nested_str_weak(format),
|
||||
/* K19 */ be_nested_str_weak(MTR_X3A_X20_X3E_X3F_X3F_X3F_X3F_X3F_X3F_X3F_X3F_X3F_X20Unknown_X20OpCode_X20_X28secure_X20channel_X29_X20_X2502X),
|
||||
/* K10 */ be_nested_str_weak(parse_PBKDFParamRequest),
|
||||
/* K11 */ be_nested_str_weak(parse_Pake1),
|
||||
/* K12 */ be_nested_str_weak(parse_Pake3),
|
||||
/* K13 */ be_nested_str_weak(parse_Sigma1),
|
||||
/* K14 */ be_nested_str_weak(parse_Sigma3),
|
||||
/* K15 */ be_nested_str_weak(parse_StatusReport),
|
||||
/* K16 */ be_nested_str_weak(string),
|
||||
/* K17 */ be_nested_str_weak(format),
|
||||
/* K18 */ be_nested_str_weak(MTR_X3A_X20_X3E_X3F_X3F_X3F_X3F_X3F_X3F_X3F_X3F_X3F_X20Unknown_X20OpCode_X20_X28secure_X20channel_X29_X20_X2502X),
|
||||
}),
|
||||
be_str_weak(process_incoming),
|
||||
&be_const_str_solidified,
|
||||
|
@ -1332,7 +1331,7 @@ be_local_closure(Matter_Commisioning_Context_process_incoming, /* name */
|
|||
0x5C180200, // 0017 MOVE R6 R1
|
||||
0x7C100400, // 0018 CALL R4 2
|
||||
0x00120E04, // 0019 ADD R4 K7 R4
|
||||
0x5814000A, // 001A LDCONST R5 K10
|
||||
0x54160003, // 001A LDINT R5 4
|
||||
0x7C080600, // 001B CALL R2 3
|
||||
0x88080302, // 001C GETMBR R2 R1 K2
|
||||
0x540E000F, // 001D LDINT R3 16
|
||||
|
@ -1343,7 +1342,7 @@ be_local_closure(Matter_Commisioning_Context_process_incoming, /* name */
|
|||
0x540E001F, // 0022 LDINT R3 32
|
||||
0x1C080403, // 0023 EQ R2 R2 R3
|
||||
0x780A0004, // 0024 JMPF R2 #002A
|
||||
0x8C08010B, // 0025 GETMET R2 R0 K11
|
||||
0x8C08010A, // 0025 GETMET R2 R0 K10
|
||||
0x5C100200, // 0026 MOVE R4 R1
|
||||
0x7C080400, // 0027 CALL R2 2
|
||||
0x80040400, // 0028 RET 1 R2
|
||||
|
@ -1352,7 +1351,7 @@ be_local_closure(Matter_Commisioning_Context_process_incoming, /* name */
|
|||
0x540E0021, // 002B LDINT R3 34
|
||||
0x1C080403, // 002C EQ R2 R2 R3
|
||||
0x780A0004, // 002D JMPF R2 #0033
|
||||
0x8C08010C, // 002E GETMET R2 R0 K12
|
||||
0x8C08010B, // 002E GETMET R2 R0 K11
|
||||
0x5C100200, // 002F MOVE R4 R1
|
||||
0x7C080400, // 0030 CALL R2 2
|
||||
0x80040400, // 0031 RET 1 R2
|
||||
|
@ -1361,7 +1360,7 @@ be_local_closure(Matter_Commisioning_Context_process_incoming, /* name */
|
|||
0x540E0023, // 0034 LDINT R3 36
|
||||
0x1C080403, // 0035 EQ R2 R2 R3
|
||||
0x780A0004, // 0036 JMPF R2 #003C
|
||||
0x8C08010D, // 0037 GETMET R2 R0 K13
|
||||
0x8C08010C, // 0037 GETMET R2 R0 K12
|
||||
0x5C100200, // 0038 MOVE R4 R1
|
||||
0x7C080400, // 0039 CALL R2 2
|
||||
0x80040400, // 003A RET 1 R2
|
||||
|
@ -1370,7 +1369,7 @@ be_local_closure(Matter_Commisioning_Context_process_incoming, /* name */
|
|||
0x540E002F, // 003D LDINT R3 48
|
||||
0x1C080403, // 003E EQ R2 R2 R3
|
||||
0x780A0004, // 003F JMPF R2 #0045
|
||||
0x8C08010E, // 0040 GETMET R2 R0 K14
|
||||
0x8C08010D, // 0040 GETMET R2 R0 K13
|
||||
0x5C100200, // 0041 MOVE R4 R1
|
||||
0x7C080400, // 0042 CALL R2 2
|
||||
0x80040400, // 0043 RET 1 R2
|
||||
|
@ -1379,7 +1378,7 @@ be_local_closure(Matter_Commisioning_Context_process_incoming, /* name */
|
|||
0x540E0031, // 0046 LDINT R3 50
|
||||
0x1C080403, // 0047 EQ R2 R2 R3
|
||||
0x780A0004, // 0048 JMPF R2 #004E
|
||||
0x8C08010F, // 0049 GETMET R2 R0 K15
|
||||
0x8C08010E, // 0049 GETMET R2 R0 K14
|
||||
0x5C100200, // 004A MOVE R4 R1
|
||||
0x7C080400, // 004B CALL R2 2
|
||||
0x80040400, // 004C RET 1 R2
|
||||
|
@ -1388,16 +1387,16 @@ be_local_closure(Matter_Commisioning_Context_process_incoming, /* name */
|
|||
0x540E003F, // 004F LDINT R3 64
|
||||
0x1C080403, // 0050 EQ R2 R2 R3
|
||||
0x780A0004, // 0051 JMPF R2 #0057
|
||||
0x8C080110, // 0052 GETMET R2 R0 K16
|
||||
0x8C08010F, // 0052 GETMET R2 R0 K15
|
||||
0x5C100200, // 0053 MOVE R4 R1
|
||||
0x7C080400, // 0054 CALL R2 2
|
||||
0x80040400, // 0055 RET 1 R2
|
||||
0x7002000A, // 0056 JMP #0062
|
||||
0xA40A2200, // 0057 IMPORT R2 K17
|
||||
0xA40A2000, // 0057 IMPORT R2 K16
|
||||
0xB80E0600, // 0058 GETNGBL R3 K3
|
||||
0x8C0C0704, // 0059 GETMET R3 R3 K4
|
||||
0x8C140512, // 005A GETMET R5 R2 K18
|
||||
0x581C0013, // 005B LDCONST R7 K19
|
||||
0x8C140511, // 005A GETMET R5 R2 K17
|
||||
0x581C0012, // 005B LDCONST R7 K18
|
||||
0x88200302, // 005C GETMBR R8 R1 K2
|
||||
0x7C140600, // 005D CALL R5 3
|
||||
0x58180006, // 005E LDCONST R6 K6
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1097,7 +1097,7 @@ be_local_class(Matter_HTTP_async,
|
|||
{ be_const_key_weak(is_chunked, 13), be_const_var(7) },
|
||||
{ be_const_key_weak(SPINLOCK, -1), be_const_int(5) },
|
||||
{ be_const_key_weak(response_offset, 10), be_const_var(2) },
|
||||
{ be_const_key_weak(HTTP_STATUS_REGEX, -1), be_nested_str_weak(HTTP_X2F1_X5C_X2E_X5B1_X2D2_X5D_X20_X28_X5Cd_X2B_X29_X20_X2E_X2A_X3F_X0D_X0A) },
|
||||
{ be_const_key_weak(HTTP_STATUS_REGEX, -1), be_nested_str_weak(HTTP_X2F1_X5C_X2E_X5B0_X2D1_X5D_X20_X28_X5Cd_X2B_X29_X20_X2E_X2A_X3F_X0D_X0A) },
|
||||
{ be_const_key_weak(event_established, -1), be_const_closure(Matter_HTTP_async_event_established_closure) },
|
||||
{ be_const_key_weak(event_available, 1), be_const_closure(Matter_HTTP_async_event_available_closure) },
|
||||
})),
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -6,6 +6,194 @@
|
|||
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_HTTP;
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: read_attribute
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_HTTP_read_attribute, /* name */
|
||||
be_nested_proto(
|
||||
10, /* 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(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(create_TLV),
|
||||
/* K6 */ be_nested_str_weak(BOOL),
|
||||
/* K7 */ be_nested_str_weak(http_remote),
|
||||
/* K8 */ be_nested_str_weak(reachable),
|
||||
/* K9 */ be_nested_str_weak(read_attribute),
|
||||
}),
|
||||
be_str_weak(read_attribute),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[29]) { /* code */
|
||||
0xB80E0000, // 0000 GETNGBL R3 K0
|
||||
0x880C0701, // 0001 GETMBR R3 R3 K1
|
||||
0x88100502, // 0002 GETMBR R4 R2 K2
|
||||
0x88140503, // 0003 GETMBR R5 R2 K3
|
||||
0x541A0038, // 0004 LDINT R6 57
|
||||
0x1C180806, // 0005 EQ R6 R4 R6
|
||||
0x781A000C, // 0006 JMPF R6 #0014
|
||||
0x1C180B04, // 0007 EQ R6 R5 K4
|
||||
0x781A0000, // 0008 JMPF R6 #000A
|
||||
0x70020008, // 0009 JMP #0013
|
||||
0x541A0010, // 000A LDINT R6 17
|
||||
0x1C180A06, // 000B EQ R6 R5 R6
|
||||
0x781A0005, // 000C JMPF R6 #0013
|
||||
0x8C180705, // 000D GETMET R6 R3 K5
|
||||
0x88200706, // 000E GETMBR R8 R3 K6
|
||||
0x88240107, // 000F GETMBR R9 R0 K7
|
||||
0x88241308, // 0010 GETMBR R9 R9 K8
|
||||
0x7C180600, // 0011 CALL R6 3
|
||||
0x80040C00, // 0012 RET 1 R6
|
||||
0x70020007, // 0013 JMP #001C
|
||||
0x60180003, // 0014 GETGBL R6 G3
|
||||
0x5C1C0000, // 0015 MOVE R7 R0
|
||||
0x7C180200, // 0016 CALL R6 1
|
||||
0x8C180D09, // 0017 GETMET R6 R6 K9
|
||||
0x5C200200, // 0018 MOVE R8 R1
|
||||
0x5C240400, // 0019 MOVE R9 R2
|
||||
0x7C180600, // 001A CALL R6 3
|
||||
0x80040C00, // 001B RET 1 R6
|
||||
0x80000000, // 001C RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: call_remote_sync
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_HTTP_call_remote_sync, /* name */
|
||||
be_nested_proto(
|
||||
11, /* nstack */
|
||||
3, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[15]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(string),
|
||||
/* K1 */ be_nested_str_weak(json),
|
||||
/* K2 */ be_const_int(2),
|
||||
/* K3 */ be_nested_str_weak(_X20),
|
||||
/* K4 */ be_const_int(0),
|
||||
/* K5 */ be_nested_str_weak(http_remote),
|
||||
/* K6 */ be_nested_str_weak(call_sync),
|
||||
/* K7 */ be_nested_str_weak(SYNC_TIMEOUT),
|
||||
/* K8 */ be_nested_str_weak(device_is_alive),
|
||||
/* K9 */ be_nested_str_weak(load),
|
||||
/* K10 */ be_const_int(1),
|
||||
/* K11 */ be_nested_str_weak(tasmota),
|
||||
/* K12 */ be_nested_str_weak(log),
|
||||
/* K13 */ be_nested_str_weak(MTR_X3A_X20HTTP_X20GET_X20retrying),
|
||||
/* K14 */ be_const_int(3),
|
||||
}),
|
||||
be_str_weak(call_remote_sync),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[43]) { /* code */
|
||||
0xA40E0000, // 0000 IMPORT R3 K0
|
||||
0xA4120200, // 0001 IMPORT R4 K1
|
||||
0x58140002, // 0002 LDCONST R5 K2
|
||||
0x4C180000, // 0003 LDNIL R6
|
||||
0x20180406, // 0004 NE R6 R2 R6
|
||||
0x781A0005, // 0005 JMPF R6 #000C
|
||||
0x00180303, // 0006 ADD R6 R1 K3
|
||||
0x601C0008, // 0007 GETGBL R7 G8
|
||||
0x5C200400, // 0008 MOVE R8 R2
|
||||
0x7C1C0200, // 0009 CALL R7 1
|
||||
0x00180C07, // 000A ADD R6 R6 R7
|
||||
0x5C040C00, // 000B MOVE R1 R6
|
||||
0x24180B04, // 000C GT R6 R5 K4
|
||||
0x781A0016, // 000D JMPF R6 #0025
|
||||
0x88180105, // 000E GETMBR R6 R0 K5
|
||||
0x8C180D06, // 000F GETMET R6 R6 K6
|
||||
0x5C200200, // 0010 MOVE R8 R1
|
||||
0x88240107, // 0011 GETMBR R9 R0 K7
|
||||
0x7C180600, // 0012 CALL R6 3
|
||||
0x4C1C0000, // 0013 LDNIL R7
|
||||
0x201C0C07, // 0014 NE R7 R6 R7
|
||||
0x781E0007, // 0015 JMPF R7 #001E
|
||||
0x881C0105, // 0016 GETMBR R7 R0 K5
|
||||
0x8C1C0F08, // 0017 GETMET R7 R7 K8
|
||||
0x50240200, // 0018 LDBOOL R9 1 0
|
||||
0x7C1C0400, // 0019 CALL R7 2
|
||||
0x8C1C0909, // 001A GETMET R7 R4 K9
|
||||
0x5C240C00, // 001B MOVE R9 R6
|
||||
0x7C1C0400, // 001C CALL R7 2
|
||||
0x80040E00, // 001D RET 1 R7
|
||||
0x04140B0A, // 001E SUB R5 R5 K10
|
||||
0xB81E1600, // 001F GETNGBL R7 K11
|
||||
0x8C1C0F0C, // 0020 GETMET R7 R7 K12
|
||||
0x5824000D, // 0021 LDCONST R9 K13
|
||||
0x5828000E, // 0022 LDCONST R10 K14
|
||||
0x7C1C0600, // 0023 CALL R7 3
|
||||
0x7001FFE6, // 0024 JMP #000C
|
||||
0x88180105, // 0025 GETMBR R6 R0 K5
|
||||
0x8C180D08, // 0026 GETMET R6 R6 K8
|
||||
0x50200000, // 0027 LDBOOL R8 0 0
|
||||
0x7C180400, // 0028 CALL R6 2
|
||||
0x4C180000, // 0029 LDNIL R6
|
||||
0x80040C00, // 002A RET 1 R6
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: update_shadow
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_HTTP_update_shadow, /* name */
|
||||
be_nested_proto(
|
||||
7, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 6]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(tick),
|
||||
/* K1 */ be_nested_str_weak(device),
|
||||
/* K2 */ be_nested_str_weak(call_remote_sync),
|
||||
/* K3 */ be_nested_str_weak(UPDATE_CMD),
|
||||
/* K4 */ be_nested_str_weak(parse_http_response),
|
||||
/* K5 */ be_const_int(1),
|
||||
}),
|
||||
be_str_weak(update_shadow),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[13]) { /* code */
|
||||
0x88040101, // 0000 GETMBR R1 R0 K1
|
||||
0x88040300, // 0001 GETMBR R1 R1 K0
|
||||
0x90020001, // 0002 SETMBR R0 K0 R1
|
||||
0x8C040102, // 0003 GETMET R1 R0 K2
|
||||
0x880C0103, // 0004 GETMBR R3 R0 K3
|
||||
0x7C040400, // 0005 CALL R1 2
|
||||
0x78060004, // 0006 JMPF R1 #000C
|
||||
0x8C080104, // 0007 GETMET R2 R0 K4
|
||||
0x58100005, // 0008 LDCONST R4 K5
|
||||
0x5C140200, // 0009 MOVE R5 R1
|
||||
0x88180103, // 000A GETMBR R6 R0 K3
|
||||
0x7C080800, // 000B CALL R2 4
|
||||
0x80000000, // 000C RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: ui_conf_to_string
|
||||
********************************************************************/
|
||||
|
@ -53,227 +241,75 @@ be_local_closure(Matter_Plugin_Bridge_HTTP_ui_conf_to_string, /* name */
|
|||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: init
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_HTTP_init, /* name */
|
||||
be_nested_proto(
|
||||
11, /* nstack */
|
||||
4, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
1, /* has sup protos */
|
||||
( &(const struct bproto*[ 1]) {
|
||||
be_nested_proto(
|
||||
6, /* nstack */
|
||||
2, /* argc */
|
||||
0, /* varg */
|
||||
1, /* has upvals */
|
||||
( &(const bupvaldesc[ 1]) { /* upvals */
|
||||
be_local_const_upval(1, 0),
|
||||
}),
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 1]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(parse_http_response),
|
||||
}),
|
||||
be_str_weak(_X3Clambda_X3E),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[ 6]) { /* code */
|
||||
0x68080000, // 0000 GETUPV R2 U0
|
||||
0x8C080500, // 0001 GETMET R2 R2 K0
|
||||
0x5C100000, // 0002 MOVE R4 R0
|
||||
0x5C140200, // 0003 MOVE R5 R1
|
||||
0x7C080600, // 0004 CALL R2 3
|
||||
0x80040400, // 0005 RET 1 R2
|
||||
})
|
||||
),
|
||||
}),
|
||||
1, /* has constants */
|
||||
( &(const bvalue[12]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(string),
|
||||
/* K1 */ be_nested_str_weak(init),
|
||||
/* K2 */ be_nested_str_weak(find),
|
||||
/* K3 */ be_nested_str_weak(ARG_HTTP),
|
||||
/* K4 */ be_nested_str_weak(http_shadow_map),
|
||||
/* K5 */ be_nested_str_weak(reachable),
|
||||
/* K6 */ be_nested_str_weak(next_probe_timestamp),
|
||||
/* K7 */ be_nested_str_weak(http_remote),
|
||||
/* K8 */ be_nested_str_weak(matter),
|
||||
/* K9 */ be_nested_str_weak(HTTP_remote),
|
||||
/* K10 */ be_nested_str_weak(PROBE_TIMEOUT),
|
||||
/* K11 */ be_nested_str_weak(set_cb),
|
||||
}),
|
||||
be_str_weak(init),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[32]) { /* code */
|
||||
0xA4120000, // 0000 IMPORT R4 K0
|
||||
0x60140003, // 0001 GETGBL R5 G3
|
||||
0x5C180000, // 0002 MOVE R6 R0
|
||||
0x7C140200, // 0003 CALL R5 1
|
||||
0x8C140B01, // 0004 GETMET R5 R5 K1
|
||||
0x5C1C0200, // 0005 MOVE R7 R1
|
||||
0x5C200400, // 0006 MOVE R8 R2
|
||||
0x5C240600, // 0007 MOVE R9 R3
|
||||
0x7C140800, // 0008 CALL R5 4
|
||||
0x8C140702, // 0009 GETMET R5 R3 K2
|
||||
0x881C0103, // 000A GETMBR R7 R0 K3
|
||||
0x7C140400, // 000B CALL R5 2
|
||||
0x60180013, // 000C GETGBL R6 G19
|
||||
0x7C180000, // 000D CALL R6 0
|
||||
0x90020806, // 000E SETMBR R0 K4 R6
|
||||
0x50180000, // 000F LDBOOL R6 0 0
|
||||
0x90020A06, // 0010 SETMBR R0 K5 R6
|
||||
0x4C180000, // 0011 LDNIL R6
|
||||
0x90020C06, // 0012 SETMBR R0 K6 R6
|
||||
0xB81A1000, // 0013 GETNGBL R6 K8
|
||||
0x8C180D09, // 0014 GETMET R6 R6 K9
|
||||
0x5C200A00, // 0015 MOVE R8 R5
|
||||
0x5426004F, // 0016 LDINT R9 80
|
||||
0x8828010A, // 0017 GETMBR R10 R0 K10
|
||||
0x7C180800, // 0018 CALL R6 4
|
||||
0x90020E06, // 0019 SETMBR R0 K7 R6
|
||||
0x88180107, // 001A GETMBR R6 R0 K7
|
||||
0x8C180D0B, // 001B GETMET R6 R6 K11
|
||||
0x84200000, // 001C CLOSURE R8 P0
|
||||
0x7C180400, // 001D CALL R6 2
|
||||
0xA0000000, // 001E CLOSE R0
|
||||
0x80000000, // 001F RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: get_remote_status_lazy
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_HTTP_get_remote_status_lazy, /* name */
|
||||
be_nested_proto(
|
||||
10, /* 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(device),
|
||||
/* K1 */ be_nested_str_weak(tick),
|
||||
/* K2 */ be_nested_str_weak(http_shadow_map),
|
||||
/* K3 */ be_nested_str_weak(find),
|
||||
/* K4 */ be_nested_str_weak(_tick),
|
||||
/* K5 */ be_nested_str_weak(call_remote_sync),
|
||||
/* K6 */ be_nested_str_weak(Status),
|
||||
}),
|
||||
be_str_weak(get_remote_status_lazy),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[20]) { /* code */
|
||||
0x880C0100, // 0000 GETMBR R3 R0 K0
|
||||
0x880C0701, // 0001 GETMBR R3 R3 K1
|
||||
0x88100102, // 0002 GETMBR R4 R0 K2
|
||||
0x8C100903, // 0003 GETMET R4 R4 K3
|
||||
0x5C180200, // 0004 MOVE R6 R1
|
||||
0x7C100400, // 0005 CALL R4 2
|
||||
0x78120005, // 0006 JMPF R4 #000D
|
||||
0x8C140903, // 0007 GETMET R5 R4 K3
|
||||
0x581C0004, // 0008 LDCONST R7 K4
|
||||
0x7C140400, // 0009 CALL R5 2
|
||||
0x1C140A03, // 000A EQ R5 R5 R3
|
||||
0x78160000, // 000B JMPF R5 #000D
|
||||
0x80040800, // 000C RET 1 R4
|
||||
0x8C140105, // 000D GETMET R5 R0 K5
|
||||
0x581C0006, // 000E LDCONST R7 K6
|
||||
0x60200008, // 000F GETGBL R8 G8
|
||||
0x5C240200, // 0010 MOVE R9 R1
|
||||
0x7C200200, // 0011 CALL R8 1
|
||||
0x7C140600, // 0012 CALL R5 3
|
||||
0x80040A00, // 0013 RET 1 R5
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: parse_http_response
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_HTTP_parse_http_response, /* name */
|
||||
be_nested_proto(
|
||||
11, /* nstack */
|
||||
3, /* argc */
|
||||
12, /* nstack */
|
||||
4, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[14]) { /* constants */
|
||||
( &(const bvalue[12]) { /* constants */
|
||||
/* K0 */ be_const_int(0),
|
||||
/* K1 */ be_nested_str_weak(reachable),
|
||||
/* K2 */ be_nested_str_weak(device),
|
||||
/* K3 */ be_nested_str_weak(tick),
|
||||
/* K4 */ be_nested_str_weak(reachable_tick),
|
||||
/* K1 */ be_nested_str_weak(http_remote),
|
||||
/* K2 */ be_nested_str_weak(device_is_alive),
|
||||
/* K3 */ be_nested_str_weak(device),
|
||||
/* K4 */ be_nested_str_weak(tick),
|
||||
/* K5 */ be_nested_str_weak(json),
|
||||
/* K6 */ be_nested_str_weak(load),
|
||||
/* K7 */ be_nested_str_weak(contains),
|
||||
/* K8 */ be_nested_str_weak(StatusSNS),
|
||||
/* K9 */ be_nested_str_weak(StatusSTS),
|
||||
/* K10 */ be_nested_str_weak(StatusSHT),
|
||||
/* K11 */ be_nested_str_weak(_tick),
|
||||
/* K12 */ be_nested_str_weak(http_shadow_map),
|
||||
/* K13 */ be_nested_str_weak(parse_update),
|
||||
/* K11 */ be_nested_str_weak(parse_update),
|
||||
}),
|
||||
be_str_weak(parse_http_response),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[44]) { /* code */
|
||||
0x240C0300, // 0000 GT R3 R1 K0
|
||||
0x780E0028, // 0001 JMPF R3 #002B
|
||||
0x500C0200, // 0002 LDBOOL R3 1 0
|
||||
0x90020203, // 0003 SETMBR R0 K1 R3
|
||||
0x880C0102, // 0004 GETMBR R3 R0 K2
|
||||
0x880C0703, // 0005 GETMBR R3 R3 K3
|
||||
0x90020803, // 0006 SETMBR R0 K4 R3
|
||||
0xA4120A00, // 0007 IMPORT R4 K5
|
||||
0x8C140906, // 0008 GETMET R5 R4 K6
|
||||
0x5C1C0400, // 0009 MOVE R7 R2
|
||||
0x7C140400, // 000A CALL R5 2
|
||||
0x4C180000, // 000B LDNIL R6
|
||||
0x7816001D, // 000C JMPF R5 #002B
|
||||
0x8C1C0B07, // 000D GETMET R7 R5 K7
|
||||
0x58240008, // 000E LDCONST R9 K8
|
||||
0x7C1C0400, // 000F CALL R7 2
|
||||
0x781E0002, // 0010 JMPF R7 #0014
|
||||
0x94140B08, // 0011 GETIDX R5 R5 K8
|
||||
0x541A0007, // 0012 LDINT R6 8
|
||||
0x7002000C, // 0013 JMP #0021
|
||||
0x8C1C0B07, // 0014 GETMET R7 R5 K7
|
||||
0x58240009, // 0015 LDCONST R9 K9
|
||||
0x7C1C0400, // 0016 CALL R7 2
|
||||
0x781E0002, // 0017 JMPF R7 #001B
|
||||
0x94140B09, // 0018 GETIDX R5 R5 K9
|
||||
0x541A000A, // 0019 LDINT R6 11
|
||||
0x70020005, // 001A JMP #0021
|
||||
0x8C1C0B07, // 001B GETMET R7 R5 K7
|
||||
0x5824000A, // 001C LDCONST R9 K10
|
||||
0x7C1C0400, // 001D CALL R7 2
|
||||
0x781E0001, // 001E JMPF R7 #0021
|
||||
0x94140B09, // 001F GETIDX R5 R5 K9
|
||||
0x541A000C, // 0020 LDINT R6 13
|
||||
0x4C1C0000, // 0021 LDNIL R7
|
||||
0x201C0C07, // 0022 NE R7 R6 R7
|
||||
0x781E0002, // 0023 JMPF R7 #0027
|
||||
0x98161603, // 0024 SETIDX R5 K11 R3
|
||||
0x881C010C, // 0025 GETMBR R7 R0 K12
|
||||
0x981C0C05, // 0026 SETIDX R7 R6 R5
|
||||
0x8C1C010D, // 0027 GETMET R7 R0 K13
|
||||
0x5C240A00, // 0028 MOVE R9 R5
|
||||
0x5C280C00, // 0029 MOVE R10 R6
|
||||
0x7C1C0600, // 002A CALL R7 3
|
||||
0x80000000, // 002B RET 0
|
||||
( &(const binstruction[39]) { /* code */
|
||||
0x24100300, // 0000 GT R4 R1 K0
|
||||
0x78120023, // 0001 JMPF R4 #0026
|
||||
0x88100101, // 0002 GETMBR R4 R0 K1
|
||||
0x8C100902, // 0003 GETMET R4 R4 K2
|
||||
0x50180200, // 0004 LDBOOL R6 1 0
|
||||
0x7C100400, // 0005 CALL R4 2
|
||||
0x88100103, // 0006 GETMBR R4 R0 K3
|
||||
0x88100904, // 0007 GETMBR R4 R4 K4
|
||||
0xA4160A00, // 0008 IMPORT R5 K5
|
||||
0x8C180B06, // 0009 GETMET R6 R5 K6
|
||||
0x5C200400, // 000A MOVE R8 R2
|
||||
0x7C180400, // 000B CALL R6 2
|
||||
0x4C1C0000, // 000C LDNIL R7
|
||||
0x781A0017, // 000D JMPF R6 #0026
|
||||
0x8C200D07, // 000E GETMET R8 R6 K7
|
||||
0x58280008, // 000F LDCONST R10 K8
|
||||
0x7C200400, // 0010 CALL R8 2
|
||||
0x78220002, // 0011 JMPF R8 #0015
|
||||
0x94180D08, // 0012 GETIDX R6 R6 K8
|
||||
0x541E0007, // 0013 LDINT R7 8
|
||||
0x7002000C, // 0014 JMP #0022
|
||||
0x8C200D07, // 0015 GETMET R8 R6 K7
|
||||
0x58280009, // 0016 LDCONST R10 K9
|
||||
0x7C200400, // 0017 CALL R8 2
|
||||
0x78220002, // 0018 JMPF R8 #001C
|
||||
0x94180D09, // 0019 GETIDX R6 R6 K9
|
||||
0x541E000A, // 001A LDINT R7 11
|
||||
0x70020005, // 001B JMP #0022
|
||||
0x8C200D07, // 001C GETMET R8 R6 K7
|
||||
0x5828000A, // 001D LDCONST R10 K10
|
||||
0x7C200400, // 001E CALL R8 2
|
||||
0x78220001, // 001F JMPF R8 #0022
|
||||
0x94180D09, // 0020 GETIDX R6 R6 K9
|
||||
0x541E000C, // 0021 LDINT R7 13
|
||||
0x8C20010B, // 0022 GETMET R8 R0 K11
|
||||
0x5C280C00, // 0023 MOVE R10 R6
|
||||
0x5C2C0E00, // 0024 MOVE R11 R7
|
||||
0x7C200600, // 0025 CALL R8 3
|
||||
0x80000000, // 0026 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
|
@ -281,9 +317,39 @@ be_local_closure(Matter_Plugin_Bridge_HTTP_parse_http_response, /* name */
|
|||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: get_types
|
||||
** Solidified function: every_250ms
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_HTTP_get_types, /* name */
|
||||
be_local_closure(Matter_Plugin_Bridge_HTTP_every_250ms, /* name */
|
||||
be_nested_proto(
|
||||
3, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 2]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(http_remote),
|
||||
/* K1 */ be_nested_str_weak(scheduler),
|
||||
}),
|
||||
be_str_weak(every_250ms),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[ 4]) { /* code */
|
||||
0x88040100, // 0000 GETMBR R1 R0 K0
|
||||
0x8C040301, // 0001 GETMET R1 R1 K1
|
||||
0x7C040200, // 0002 CALL R1 1
|
||||
0x80000000, // 0003 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: web_values
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_HTTP_web_values, /* name */
|
||||
be_nested_proto(
|
||||
5, /* nstack */
|
||||
1, /* argc */
|
||||
|
@ -293,35 +359,23 @@ be_local_closure(Matter_Plugin_Bridge_HTTP_get_types, /* name */
|
|||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 4]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(TYPES),
|
||||
/* K1 */ be_nested_str_weak(keys),
|
||||
/* K2 */ be_nested_str_weak(stop_iteration),
|
||||
/* K3 */ be_const_int(1),
|
||||
( &(const bvalue[ 5]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(webserver),
|
||||
/* K1 */ be_nested_str_weak(content_send),
|
||||
/* K2 */ be_nested_str_weak(_X7C_X20_X26lt_X3B_X2D_X2D_X20_X28),
|
||||
/* K3 */ be_nested_str_weak(NAME),
|
||||
/* K4 */ be_nested_str_weak(_X29_X20_X2D_X2D_X26gt_X3B),
|
||||
}),
|
||||
be_str_weak(get_types),
|
||||
be_str_weak(web_values),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[20]) { /* code */
|
||||
0x60040013, // 0000 GETGBL R1 G19
|
||||
0x7C040000, // 0001 CALL R1 0
|
||||
0x60080010, // 0002 GETGBL R2 G16
|
||||
0x880C0100, // 0003 GETMBR R3 R0 K0
|
||||
0x8C0C0701, // 0004 GETMET R3 R3 K1
|
||||
0x7C0C0200, // 0005 CALL R3 1
|
||||
0x7C080200, // 0006 CALL R2 1
|
||||
0xA8020005, // 0007 EXBLK 0 #000E
|
||||
0x5C0C0400, // 0008 MOVE R3 R2
|
||||
0x7C0C0000, // 0009 CALL R3 0
|
||||
0x88100100, // 000A GETMBR R4 R0 K0
|
||||
0x94100803, // 000B GETIDX R4 R4 R3
|
||||
0x98040604, // 000C SETIDX R1 R3 R4
|
||||
0x7001FFF9, // 000D JMP #0008
|
||||
0x58080002, // 000E LDCONST R2 K2
|
||||
0xAC080200, // 000F CATCH R2 1 0
|
||||
0xB0080000, // 0010 RAISE 2 R0 R0
|
||||
0x540A0012, // 0011 LDINT R2 19
|
||||
0x98040503, // 0012 SETIDX R1 R2 K3
|
||||
0x80040200, // 0013 RET 1 R1
|
||||
( &(const binstruction[ 7]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0x8C080301, // 0001 GETMET R2 R1 K1
|
||||
0x88100103, // 0002 GETMBR R4 R0 K3
|
||||
0x00120404, // 0003 ADD R4 K2 R4
|
||||
0x00100904, // 0004 ADD R4 R4 K4
|
||||
0x7C080400, // 0005 CALL R2 2
|
||||
0x80000000, // 0006 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
|
@ -381,12 +435,12 @@ be_local_closure(Matter_Plugin_Bridge_HTTP_ui_string_to_conf, /* name */
|
|||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: probe_shadow_async
|
||||
** Solidified function: parse_update
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_HTTP_probe_shadow_async, /* name */
|
||||
be_local_closure(Matter_Plugin_Bridge_HTTP_parse_update, /* name */
|
||||
be_nested_proto(
|
||||
1, /* nstack */
|
||||
1, /* argc */
|
||||
3, /* nstack */
|
||||
3, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
|
@ -394,7 +448,7 @@ be_local_closure(Matter_Plugin_Bridge_HTTP_probe_shadow_async, /* name */
|
|||
NULL, /* no sub protos */
|
||||
0, /* has constants */
|
||||
NULL, /* no const */
|
||||
be_str_weak(probe_shadow_async),
|
||||
be_str_weak(parse_update),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[ 1]) { /* code */
|
||||
0x80000000, // 0000 RET 0
|
||||
|
@ -405,12 +459,12 @@ be_local_closure(Matter_Plugin_Bridge_HTTP_probe_shadow_async, /* name */
|
|||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: read_attribute
|
||||
** Solidified function: init
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_HTTP_read_attribute, /* name */
|
||||
be_local_closure(Matter_Plugin_Bridge_HTTP_init, /* name */
|
||||
be_nested_proto(
|
||||
10, /* nstack */
|
||||
3, /* argc */
|
||||
4, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
|
@ -418,47 +472,40 @@ be_local_closure(Matter_Plugin_Bridge_HTTP_read_attribute, /* name */
|
|||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 9]) { /* 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(create_TLV),
|
||||
/* K6 */ be_nested_str_weak(BOOL),
|
||||
/* K7 */ be_nested_str_weak(reachable),
|
||||
/* K8 */ be_nested_str_weak(read_attribute),
|
||||
/* K0 */ be_nested_str_weak(string),
|
||||
/* K1 */ be_nested_str_weak(init),
|
||||
/* K2 */ be_nested_str_weak(find),
|
||||
/* K3 */ be_nested_str_weak(ARG_HTTP),
|
||||
/* K4 */ be_nested_str_weak(http_remote),
|
||||
/* K5 */ be_nested_str_weak(device),
|
||||
/* K6 */ be_nested_str_weak(register_http_remote),
|
||||
/* K7 */ be_nested_str_weak(PROBE_TIMEOUT),
|
||||
/* K8 */ be_nested_str_weak(register_cmd_cb),
|
||||
}),
|
||||
be_str_weak(read_attribute),
|
||||
be_str_weak(init),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[28]) { /* code */
|
||||
0xB80E0000, // 0000 GETNGBL R3 K0
|
||||
0x880C0701, // 0001 GETMBR R3 R3 K1
|
||||
0x88100502, // 0002 GETMBR R4 R2 K2
|
||||
0x88140503, // 0003 GETMBR R5 R2 K3
|
||||
0x541A0038, // 0004 LDINT R6 57
|
||||
0x1C180806, // 0005 EQ R6 R4 R6
|
||||
0x781A000B, // 0006 JMPF R6 #0013
|
||||
0x1C180B04, // 0007 EQ R6 R5 K4
|
||||
0x781A0000, // 0008 JMPF R6 #000A
|
||||
0x70020007, // 0009 JMP #0012
|
||||
0x541A0010, // 000A LDINT R6 17
|
||||
0x1C180A06, // 000B EQ R6 R5 R6
|
||||
0x781A0004, // 000C JMPF R6 #0012
|
||||
0x8C180705, // 000D GETMET R6 R3 K5
|
||||
0x88200706, // 000E GETMBR R8 R3 K6
|
||||
( &(const binstruction[21]) { /* code */
|
||||
0xA4120000, // 0000 IMPORT R4 K0
|
||||
0x60140003, // 0001 GETGBL R5 G3
|
||||
0x5C180000, // 0002 MOVE R6 R0
|
||||
0x7C140200, // 0003 CALL R5 1
|
||||
0x8C140B01, // 0004 GETMET R5 R5 K1
|
||||
0x5C1C0200, // 0005 MOVE R7 R1
|
||||
0x5C200400, // 0006 MOVE R8 R2
|
||||
0x5C240600, // 0007 MOVE R9 R3
|
||||
0x7C140800, // 0008 CALL R5 4
|
||||
0x8C140702, // 0009 GETMET R5 R3 K2
|
||||
0x881C0103, // 000A GETMBR R7 R0 K3
|
||||
0x7C140400, // 000B CALL R5 2
|
||||
0x88180105, // 000C GETMBR R6 R0 K5
|
||||
0x8C180D06, // 000D GETMET R6 R6 K6
|
||||
0x5C200A00, // 000E MOVE R8 R5
|
||||
0x88240107, // 000F GETMBR R9 R0 K7
|
||||
0x7C180600, // 0010 CALL R6 3
|
||||
0x80040C00, // 0011 RET 1 R6
|
||||
0x70020007, // 0012 JMP #001B
|
||||
0x60180003, // 0013 GETGBL R6 G3
|
||||
0x5C1C0000, // 0014 MOVE R7 R0
|
||||
0x7C180200, // 0015 CALL R6 1
|
||||
0x8C180D08, // 0016 GETMET R6 R6 K8
|
||||
0x5C200200, // 0017 MOVE R8 R1
|
||||
0x5C240400, // 0018 MOVE R9 R2
|
||||
0x7C180600, // 0019 CALL R6 3
|
||||
0x80040C00, // 001A RET 1 R6
|
||||
0x80000000, // 001B RET 0
|
||||
0x90020806, // 0011 SETMBR R0 K4 R6
|
||||
0x8C180108, // 0012 GETMET R6 R0 K8
|
||||
0x7C180200, // 0013 CALL R6 1
|
||||
0x80000000, // 0014 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
|
@ -466,199 +513,62 @@ be_local_closure(Matter_Plugin_Bridge_HTTP_read_attribute, /* name */
|
|||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: is_reachable_sync
|
||||
** Solidified function: register_cmd_cb
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_HTTP_is_reachable_sync, /* name */
|
||||
be_local_closure(Matter_Plugin_Bridge_HTTP_register_cmd_cb, /* name */
|
||||
be_nested_proto(
|
||||
5, /* nstack */
|
||||
6, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
1, /* has sup protos */
|
||||
( &(const struct bproto*[ 1]) {
|
||||
be_nested_proto(
|
||||
8, /* nstack */
|
||||
3, /* argc */
|
||||
0, /* varg */
|
||||
1, /* has upvals */
|
||||
( &(const bupvaldesc[ 1]) { /* upvals */
|
||||
be_local_const_upval(1, 0),
|
||||
}),
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 6]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(device),
|
||||
/* K1 */ be_nested_str_weak(tick),
|
||||
/* K2 */ be_nested_str_weak(reachable_tick),
|
||||
/* K3 */ be_nested_str_weak(call_remote_sync),
|
||||
/* K4 */ be_nested_str_weak(),
|
||||
/* K5 */ be_nested_str_weak(reachable),
|
||||
( &(const bvalue[ 1]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(parse_http_response),
|
||||
}),
|
||||
be_str_weak(is_reachable_sync),
|
||||
be_str_weak(_X3Clambda_X3E),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[14]) { /* code */
|
||||
( &(const binstruction[ 7]) { /* code */
|
||||
0x680C0000, // 0000 GETUPV R3 U0
|
||||
0x8C0C0700, // 0001 GETMET R3 R3 K0
|
||||
0x5C140000, // 0002 MOVE R5 R0
|
||||
0x5C180200, // 0003 MOVE R6 R1
|
||||
0x5C1C0400, // 0004 MOVE R7 R2
|
||||
0x7C0C0800, // 0005 CALL R3 4
|
||||
0x80040600, // 0006 RET 1 R3
|
||||
})
|
||||
),
|
||||
}),
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 4]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(http_remote),
|
||||
/* K1 */ be_nested_str_weak(add_schedule),
|
||||
/* K2 */ be_nested_str_weak(UPDATE_CMD),
|
||||
/* K3 */ be_nested_str_weak(UPDATE_TIME),
|
||||
}),
|
||||
be_str_weak(register_cmd_cb),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[ 8]) { /* code */
|
||||
0x88040100, // 0000 GETMBR R1 R0 K0
|
||||
0x88040301, // 0001 GETMBR R1 R1 K1
|
||||
0x88080102, // 0002 GETMBR R2 R0 K2
|
||||
0x20040202, // 0003 NE R1 R1 R2
|
||||
0x78060006, // 0004 JMPF R1 #000C
|
||||
0x8C040103, // 0005 GETMET R1 R0 K3
|
||||
0x580C0004, // 0006 LDCONST R3 K4
|
||||
0x58100004, // 0007 LDCONST R4 K4
|
||||
0x7C040600, // 0008 CALL R1 3
|
||||
0x4C080000, // 0009 LDNIL R2
|
||||
0x20080202, // 000A NE R2 R1 R2
|
||||
0x90020A02, // 000B SETMBR R0 K5 R2
|
||||
0x88040105, // 000C GETMBR R1 R0 K5
|
||||
0x80040200, // 000D RET 1 R1
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: call_remote_sync
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_HTTP_call_remote_sync, /* name */
|
||||
be_nested_proto(
|
||||
11, /* nstack */
|
||||
3, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[21]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(string),
|
||||
/* K1 */ be_nested_str_weak(tasmota),
|
||||
/* K2 */ be_nested_str_weak(wifi),
|
||||
/* K3 */ be_nested_str_weak(up),
|
||||
/* K4 */ be_nested_str_weak(eth),
|
||||
/* K5 */ be_const_int(2),
|
||||
/* K6 */ be_nested_str_weak(format),
|
||||
/* K7 */ be_nested_str_weak(_X2Fcm_X3Fcmnd_X3D_X25s_X25_X2520_X25s),
|
||||
/* K8 */ be_nested_str_weak(),
|
||||
/* K9 */ be_const_int(0),
|
||||
/* K10 */ be_nested_str_weak(http_remote),
|
||||
/* K11 */ be_nested_str_weak(begin_sync),
|
||||
/* K12 */ be_nested_str_weak(SYNC_TIMEOUT),
|
||||
/* K13 */ be_nested_str_weak(reachable),
|
||||
/* K14 */ be_nested_str_weak(reachable_tick),
|
||||
/* K15 */ be_nested_str_weak(device),
|
||||
/* K16 */ be_nested_str_weak(tick),
|
||||
/* K17 */ be_const_int(1),
|
||||
/* K18 */ be_nested_str_weak(log),
|
||||
/* K19 */ be_nested_str_weak(MTR_X3A_X20HTTP_X20GET_X20retrying),
|
||||
/* K20 */ be_const_int(3),
|
||||
}),
|
||||
be_str_weak(call_remote_sync),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[49]) { /* code */
|
||||
0xA40E0000, // 0000 IMPORT R3 K0
|
||||
0xB8120200, // 0001 GETNGBL R4 K1
|
||||
0x8C100902, // 0002 GETMET R4 R4 K2
|
||||
0x7C100200, // 0003 CALL R4 1
|
||||
0x94100903, // 0004 GETIDX R4 R4 K3
|
||||
0x74120006, // 0005 JMPT R4 #000D
|
||||
0xB8120200, // 0006 GETNGBL R4 K1
|
||||
0x8C100904, // 0007 GETMET R4 R4 K4
|
||||
0x7C100200, // 0008 CALL R4 1
|
||||
0x94100903, // 0009 GETIDX R4 R4 K3
|
||||
0x74120001, // 000A JMPT R4 #000D
|
||||
0x4C100000, // 000B LDNIL R4
|
||||
0x80040800, // 000C RET 1 R4
|
||||
0x58100005, // 000D LDCONST R4 K5
|
||||
0x8C140706, // 000E GETMET R5 R3 K6
|
||||
0x581C0007, // 000F LDCONST R7 K7
|
||||
0x5C200200, // 0010 MOVE R8 R1
|
||||
0x780A0001, // 0011 JMPF R2 #0014
|
||||
0x5C240400, // 0012 MOVE R9 R2
|
||||
0x70020000, // 0013 JMP #0015
|
||||
0x58240008, // 0014 LDCONST R9 K8
|
||||
0x7C140800, // 0015 CALL R5 4
|
||||
0x24180909, // 0016 GT R6 R4 K9
|
||||
0x781A0014, // 0017 JMPF R6 #002D
|
||||
0x8818010A, // 0018 GETMBR R6 R0 K10
|
||||
0x8C180D0B, // 0019 GETMET R6 R6 K11
|
||||
0x5C200A00, // 001A MOVE R8 R5
|
||||
0x8824010C, // 001B GETMBR R9 R0 K12
|
||||
0x7C180600, // 001C CALL R6 3
|
||||
0x4C1C0000, // 001D LDNIL R7
|
||||
0x201C0C07, // 001E NE R7 R6 R7
|
||||
0x781E0005, // 001F JMPF R7 #0026
|
||||
0x501C0200, // 0020 LDBOOL R7 1 0
|
||||
0x90021A07, // 0021 SETMBR R0 K13 R7
|
||||
0x881C010F, // 0022 GETMBR R7 R0 K15
|
||||
0x881C0F10, // 0023 GETMBR R7 R7 K16
|
||||
0x90021C07, // 0024 SETMBR R0 K14 R7
|
||||
0x80040C00, // 0025 RET 1 R6
|
||||
0x04100911, // 0026 SUB R4 R4 K17
|
||||
0xB81E0200, // 0027 GETNGBL R7 K1
|
||||
0x8C1C0F12, // 0028 GETMET R7 R7 K18
|
||||
0x58240013, // 0029 LDCONST R9 K19
|
||||
0x58280014, // 002A LDCONST R10 K20
|
||||
0x7C1C0600, // 002B CALL R7 3
|
||||
0x7001FFE8, // 002C JMP #0016
|
||||
0x50180000, // 002D LDBOOL R6 0 0
|
||||
0x90021A06, // 002E SETMBR R0 K13 R6
|
||||
0x4C180000, // 002F LDNIL R6
|
||||
0x80040C00, // 0030 RET 1 R6
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: call_remote_async
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_HTTP_call_remote_async, /* 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[11]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(string),
|
||||
/* K1 */ be_nested_str_weak(tasmota),
|
||||
/* K2 */ be_nested_str_weak(wifi),
|
||||
/* K3 */ be_nested_str_weak(up),
|
||||
/* K4 */ be_nested_str_weak(eth),
|
||||
/* K5 */ be_nested_str_weak(format),
|
||||
/* K6 */ be_nested_str_weak(_X2Fcm_X3Fcmnd_X3D_X25s_X25_X2520_X25s),
|
||||
/* K7 */ be_nested_str_weak(),
|
||||
/* K8 */ be_nested_str_weak(http_remote),
|
||||
/* K9 */ be_nested_str_weak(begin),
|
||||
/* K10 */ be_nested_str_weak(PROBE_TIMEOUT),
|
||||
}),
|
||||
be_str_weak(call_remote_async),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[27]) { /* code */
|
||||
0xA40E0000, // 0000 IMPORT R3 K0
|
||||
0xB8120200, // 0001 GETNGBL R4 K1
|
||||
0x8C100902, // 0002 GETMET R4 R4 K2
|
||||
0x7C100200, // 0003 CALL R4 1
|
||||
0x94100903, // 0004 GETIDX R4 R4 K3
|
||||
0x74120006, // 0005 JMPT R4 #000D
|
||||
0xB8120200, // 0006 GETNGBL R4 K1
|
||||
0x8C100904, // 0007 GETMET R4 R4 K4
|
||||
0x7C100200, // 0008 CALL R4 1
|
||||
0x94100903, // 0009 GETIDX R4 R4 K3
|
||||
0x74120001, // 000A JMPT R4 #000D
|
||||
0x4C100000, // 000B LDNIL R4
|
||||
0x80040800, // 000C RET 1 R4
|
||||
0x8C100705, // 000D GETMET R4 R3 K5
|
||||
0x58180006, // 000E LDCONST R6 K6
|
||||
0x5C1C0200, // 000F MOVE R7 R1
|
||||
0x780A0001, // 0010 JMPF R2 #0013
|
||||
0x5C200400, // 0011 MOVE R8 R2
|
||||
0x70020000, // 0012 JMP #0014
|
||||
0x58200007, // 0013 LDCONST R8 K7
|
||||
0x7C100800, // 0014 CALL R4 4
|
||||
0x88140108, // 0015 GETMBR R5 R0 K8
|
||||
0x8C140B09, // 0016 GETMET R5 R5 K9
|
||||
0x5C1C0800, // 0017 MOVE R7 R4
|
||||
0x8820010A, // 0018 GETMBR R8 R0 K10
|
||||
0x7C140600, // 0019 CALL R5 3
|
||||
0x80000000, // 001A RET 0
|
||||
0x8C040301, // 0001 GETMET R1 R1 K1
|
||||
0x880C0102, // 0002 GETMBR R3 R0 K2
|
||||
0x88100103, // 0003 GETMBR R4 R0 K3
|
||||
0x84140000, // 0004 CLOSURE R5 P0
|
||||
0x7C040800, // 0005 CALL R1 4
|
||||
0xA0000000, // 0006 CLOSE R0
|
||||
0x80000000, // 0007 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
|
@ -670,27 +580,12 @@ be_local_closure(Matter_Plugin_Bridge_HTTP_call_remote_async, /* name */
|
|||
********************************************************************/
|
||||
extern const bclass be_class_Matter_Plugin_Device;
|
||||
be_local_class(Matter_Plugin_Bridge_HTTP,
|
||||
5,
|
||||
1,
|
||||
&be_class_Matter_Plugin_Device,
|
||||
be_nested_map(24,
|
||||
be_nested_map(21,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_weak(ARG_HTTP, 1), be_nested_str_weak(url) },
|
||||
{ be_const_key_weak(UPDATE_TIME, -1), be_const_int(3000) },
|
||||
{ be_const_key_weak(SYNC_TIMEOUT, -1), be_const_int(500) },
|
||||
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_init_closure) },
|
||||
{ be_const_key_weak(get_remote_status_lazy, 19), be_const_closure(Matter_Plugin_Bridge_HTTP_get_remote_status_lazy_closure) },
|
||||
{ be_const_key_weak(parse_http_response, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_parse_http_response_closure) },
|
||||
{ be_const_key_weak(NAME, -1), be_nested_str_weak() },
|
||||
{ be_const_key_weak(call_remote_sync, 16), be_const_closure(Matter_Plugin_Bridge_HTTP_call_remote_sync_closure) },
|
||||
{ be_const_key_weak(reachable, -1), be_const_var(0) },
|
||||
{ be_const_key_weak(get_types, 12), be_const_closure(Matter_Plugin_Bridge_HTTP_get_types_closure) },
|
||||
{ be_const_key_weak(ui_conf_to_string, 7), be_const_static_closure(Matter_Plugin_Bridge_HTTP_ui_conf_to_string_closure) },
|
||||
{ be_const_key_weak(http_shadow_map, -1), be_const_var(2) },
|
||||
{ be_const_key_weak(probe_shadow_async, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_probe_shadow_async_closure) },
|
||||
{ be_const_key_weak(TYPE, 14), be_nested_str_weak() },
|
||||
{ be_const_key_weak(PROBE_TIMEOUT, -1), be_const_int(700) },
|
||||
{ be_const_key_weak(ARG, -1), be_nested_str_weak() },
|
||||
{ be_const_key_weak(CLUSTERS, 22), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
|
||||
{ be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_read_attribute_closure) },
|
||||
{ be_const_key_weak(CLUSTERS, -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(57, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
|
||||
|
@ -699,13 +594,25 @@ be_local_class(Matter_Plugin_Bridge_HTTP,
|
|||
be_const_int(17),
|
||||
})) ) } )) },
|
||||
})) ) } )) },
|
||||
{ be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_read_attribute_closure) },
|
||||
{ be_const_key_weak(next_probe_timestamp, 17), be_const_var(4) },
|
||||
{ be_const_key_weak(http_remote, -1), be_const_var(3) },
|
||||
{ be_const_key_weak(reachable_tick, -1), be_const_var(1) },
|
||||
{ be_const_key_weak(is_reachable_sync, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_is_reachable_sync_closure) },
|
||||
{ be_const_key_weak(SYNC_TIMEOUT, -1), be_const_int(500) },
|
||||
{ be_const_key_weak(http_remote, -1), be_const_var(0) },
|
||||
{ be_const_key_weak(init, 17), be_const_closure(Matter_Plugin_Bridge_HTTP_init_closure) },
|
||||
{ be_const_key_weak(parse_http_response, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_parse_http_response_closure) },
|
||||
{ be_const_key_weak(ARG, -1), be_nested_str_weak() },
|
||||
{ be_const_key_weak(update_shadow, 1), be_const_closure(Matter_Plugin_Bridge_HTTP_update_shadow_closure) },
|
||||
{ be_const_key_weak(every_250ms, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_every_250ms_closure) },
|
||||
{ be_const_key_weak(UPDATE_TIME, -1), be_const_int(3000) },
|
||||
{ be_const_key_weak(TYPE, -1), be_nested_str_weak() },
|
||||
{ be_const_key_weak(web_values, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_web_values_closure) },
|
||||
{ be_const_key_weak(ARG_HTTP, 4), be_nested_str_weak(url) },
|
||||
{ be_const_key_weak(PROBE_TIMEOUT, 18), be_const_int(1700) },
|
||||
{ be_const_key_weak(parse_update, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_parse_update_closure) },
|
||||
{ be_const_key_weak(NAME, 6), be_nested_str_weak() },
|
||||
{ be_const_key_weak(call_remote_sync, 14), be_const_closure(Matter_Plugin_Bridge_HTTP_call_remote_sync_closure) },
|
||||
{ be_const_key_weak(UPDATE_CMD, -1), be_nested_str_weak(Status_X2011) },
|
||||
{ be_const_key_weak(ui_string_to_conf, -1), be_const_static_closure(Matter_Plugin_Bridge_HTTP_ui_string_to_conf_closure) },
|
||||
{ be_const_key_weak(call_remote_async, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_call_remote_async_closure) },
|
||||
{ be_const_key_weak(ui_conf_to_string, 3), be_const_static_closure(Matter_Plugin_Bridge_HTTP_ui_conf_to_string_closure) },
|
||||
{ be_const_key_weak(register_cmd_cb, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_register_cmd_cb_closure) },
|
||||
})),
|
||||
be_str_weak(Matter_Plugin_Bridge_HTTP)
|
||||
);
|
||||
|
|
|
@ -0,0 +1,492 @@
|
|||
/* Solidification of Matter_Plugin_Bridge_Light0.h */
|
||||
/********************************************************************\
|
||||
* Generated code, don't edit *
|
||||
\********************************************************************/
|
||||
#include "be_constobj.h"
|
||||
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_Light0;
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: init
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light0_init, /* name */
|
||||
be_nested_proto(
|
||||
9, /* nstack */
|
||||
4, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 7]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(init),
|
||||
/* K1 */ be_nested_str_weak(shadow_onoff),
|
||||
/* K2 */ be_nested_str_weak(tasmota_relay_index),
|
||||
/* K3 */ be_nested_str_weak(find),
|
||||
/* K4 */ be_nested_str_weak(ARG),
|
||||
/* K5 */ be_const_int(1),
|
||||
/* K6 */ be_const_int(0),
|
||||
}),
|
||||
be_str_weak(init),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[22]) { /* 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
|
||||
0x50100000, // 0008 LDBOOL R4 0 0
|
||||
0x90020204, // 0009 SETMBR R0 K1 R4
|
||||
0x60100009, // 000A GETGBL R4 G9
|
||||
0x8C140703, // 000B GETMET R5 R3 K3
|
||||
0x881C0104, // 000C GETMBR R7 R0 K4
|
||||
0x58200005, // 000D LDCONST R8 K5
|
||||
0x7C140600, // 000E CALL R5 3
|
||||
0x7C100200, // 000F CALL R4 1
|
||||
0x90020404, // 0010 SETMBR R0 K2 R4
|
||||
0x88100102, // 0011 GETMBR R4 R0 K2
|
||||
0x18100906, // 0012 LE R4 R4 K6
|
||||
0x78120000, // 0013 JMPF R4 #0015
|
||||
0x90020505, // 0014 SETMBR R0 K2 K5
|
||||
0x80000000, // 0015 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: parse_update
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light0_parse_update, /* 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[ 9]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(tasmota_relay_index),
|
||||
/* K1 */ be_const_int(1),
|
||||
/* K2 */ be_nested_str_weak(contains),
|
||||
/* K3 */ be_nested_str_weak(POWER),
|
||||
/* K4 */ be_nested_str_weak(find),
|
||||
/* K5 */ be_nested_str_weak(ON),
|
||||
/* K6 */ be_nested_str_weak(shadow_onoff),
|
||||
/* K7 */ be_nested_str_weak(attribute_updated),
|
||||
/* K8 */ be_const_int(0),
|
||||
}),
|
||||
be_str_weak(parse_update),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[41]) { /* code */
|
||||
0x540E000A, // 0000 LDINT R3 11
|
||||
0x1C0C0403, // 0001 EQ R3 R2 R3
|
||||
0x780E0024, // 0002 JMPF R3 #0028
|
||||
0x500C0000, // 0003 LDBOOL R3 0 0
|
||||
0x88100100, // 0004 GETMBR R4 R0 K0
|
||||
0x1C100901, // 0005 EQ R4 R4 K1
|
||||
0x78120009, // 0006 JMPF R4 #0011
|
||||
0x8C100302, // 0007 GETMET R4 R1 K2
|
||||
0x58180003, // 0008 LDCONST R6 K3
|
||||
0x7C100400, // 0009 CALL R4 2
|
||||
0x78120005, // 000A JMPF R4 #0011
|
||||
0x8C100304, // 000B GETMET R4 R1 K4
|
||||
0x58180003, // 000C LDCONST R6 K3
|
||||
0x7C100400, // 000D CALL R4 2
|
||||
0x1C100905, // 000E EQ R4 R4 K5
|
||||
0x5C0C0800, // 000F MOVE R3 R4
|
||||
0x70020007, // 0010 JMP #0019
|
||||
0x8C100304, // 0011 GETMET R4 R1 K4
|
||||
0x60180008, // 0012 GETGBL R6 G8
|
||||
0x881C0100, // 0013 GETMBR R7 R0 K0
|
||||
0x7C180200, // 0014 CALL R6 1
|
||||
0x001A0606, // 0015 ADD R6 K3 R6
|
||||
0x7C100400, // 0016 CALL R4 2
|
||||
0x1C100905, // 0017 EQ R4 R4 K5
|
||||
0x5C0C0800, // 0018 MOVE R3 R4
|
||||
0x88100106, // 0019 GETMBR R4 R0 K6
|
||||
0x4C140000, // 001A LDNIL R5
|
||||
0x20100805, // 001B NE R4 R4 R5
|
||||
0x78120009, // 001C JMPF R4 #0027
|
||||
0x88100106, // 001D GETMBR R4 R0 K6
|
||||
0x60140017, // 001E GETGBL R5 G23
|
||||
0x5C180600, // 001F MOVE R6 R3
|
||||
0x7C140200, // 0020 CALL R5 1
|
||||
0x20100805, // 0021 NE R4 R4 R5
|
||||
0x78120003, // 0022 JMPF R4 #0027
|
||||
0x8C100107, // 0023 GETMET R4 R0 K7
|
||||
0x541A0005, // 0024 LDINT R6 6
|
||||
0x581C0008, // 0025 LDCONST R7 K8
|
||||
0x7C100600, // 0026 CALL R4 3
|
||||
0x90020C03, // 0027 SETMBR R0 K6 R3
|
||||
0x80000000, // 0028 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: invoke_request
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light0_invoke_request, /* name */
|
||||
be_nested_proto(
|
||||
10, /* nstack */
|
||||
4, /* 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(matter),
|
||||
/* K1 */ be_nested_str_weak(TLV),
|
||||
/* K2 */ be_nested_str_weak(cluster),
|
||||
/* K3 */ be_nested_str_weak(command),
|
||||
/* K4 */ be_nested_str_weak(update_shadow_lazy),
|
||||
/* K5 */ be_const_int(0),
|
||||
/* K6 */ be_nested_str_weak(set_onoff),
|
||||
/* K7 */ be_const_int(1),
|
||||
/* K8 */ be_const_int(2),
|
||||
/* K9 */ be_nested_str_weak(shadow_onoff),
|
||||
}),
|
||||
be_str_weak(invoke_request),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[36]) { /* code */
|
||||
0xB8120000, // 0000 GETNGBL R4 K0
|
||||
0x88100901, // 0001 GETMBR R4 R4 K1
|
||||
0x88140702, // 0002 GETMBR R5 R3 K2
|
||||
0x88180703, // 0003 GETMBR R6 R3 K3
|
||||
0x541E0005, // 0004 LDINT R7 6
|
||||
0x1C1C0A07, // 0005 EQ R7 R5 R7
|
||||
0x781E001B, // 0006 JMPF R7 #0023
|
||||
0x8C1C0104, // 0007 GETMET R7 R0 K4
|
||||
0x7C1C0200, // 0008 CALL R7 1
|
||||
0x1C1C0D05, // 0009 EQ R7 R6 K5
|
||||
0x781E0005, // 000A JMPF R7 #0011
|
||||
0x8C1C0106, // 000B GETMET R7 R0 K6
|
||||
0x50240000, // 000C LDBOOL R9 0 0
|
||||
0x7C1C0400, // 000D CALL R7 2
|
||||
0x501C0200, // 000E LDBOOL R7 1 0
|
||||
0x80040E00, // 000F RET 1 R7
|
||||
0x70020011, // 0010 JMP #0023
|
||||
0x1C1C0D07, // 0011 EQ R7 R6 K7
|
||||
0x781E0005, // 0012 JMPF R7 #0019
|
||||
0x8C1C0106, // 0013 GETMET R7 R0 K6
|
||||
0x50240200, // 0014 LDBOOL R9 1 0
|
||||
0x7C1C0400, // 0015 CALL R7 2
|
||||
0x501C0200, // 0016 LDBOOL R7 1 0
|
||||
0x80040E00, // 0017 RET 1 R7
|
||||
0x70020009, // 0018 JMP #0023
|
||||
0x1C1C0D08, // 0019 EQ R7 R6 K8
|
||||
0x781E0007, // 001A JMPF R7 #0023
|
||||
0x8C1C0106, // 001B GETMET R7 R0 K6
|
||||
0x88240109, // 001C GETMBR R9 R0 K9
|
||||
0x78260000, // 001D JMPF R9 #001F
|
||||
0x50240001, // 001E LDBOOL R9 0 1
|
||||
0x50240200, // 001F LDBOOL R9 1 0
|
||||
0x7C1C0400, // 0020 CALL R7 2
|
||||
0x501C0200, // 0021 LDBOOL R7 1 0
|
||||
0x80040E00, // 0022 RET 1 R7
|
||||
0x80000000, // 0023 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: set_onoff
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light0_set_onoff, /* name */
|
||||
be_nested_proto(
|
||||
7, /* nstack */
|
||||
2, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 6]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(call_remote_sync),
|
||||
/* K1 */ be_nested_str_weak(Power),
|
||||
/* K2 */ be_nested_str_weak(tasmota_relay_index),
|
||||
/* K3 */ be_nested_str_weak(1),
|
||||
/* K4 */ be_nested_str_weak(0),
|
||||
/* K5 */ be_nested_str_weak(parse_update),
|
||||
}),
|
||||
be_str_weak(set_onoff),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[18]) { /* code */
|
||||
0x8C080100, // 0000 GETMET R2 R0 K0
|
||||
0x60100008, // 0001 GETGBL R4 G8
|
||||
0x88140102, // 0002 GETMBR R5 R0 K2
|
||||
0x7C100200, // 0003 CALL R4 1
|
||||
0x00120204, // 0004 ADD R4 K1 R4
|
||||
0x78060001, // 0005 JMPF R1 #0008
|
||||
0x58140003, // 0006 LDCONST R5 K3
|
||||
0x70020000, // 0007 JMP #0009
|
||||
0x58140004, // 0008 LDCONST R5 K4
|
||||
0x7C080600, // 0009 CALL R2 3
|
||||
0x4C0C0000, // 000A LDNIL R3
|
||||
0x200C0403, // 000B NE R3 R2 R3
|
||||
0x780E0003, // 000C JMPF R3 #0011
|
||||
0x8C0C0105, // 000D GETMET R3 R0 K5
|
||||
0x5C140400, // 000E MOVE R5 R2
|
||||
0x541A000A, // 000F LDINT R6 11
|
||||
0x7C0C0600, // 0010 CALL R3 3
|
||||
0x80000000, // 0011 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: <lambda>
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light0__X3Clambda_X3E, /* name */
|
||||
be_nested_proto(
|
||||
3, /* nstack */
|
||||
1, /* argc */
|
||||
0, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
0, /* has constants */
|
||||
NULL, /* no const */
|
||||
be_str_weak(_X3Clambda_X3E),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[ 4]) { /* code */
|
||||
0x60040009, // 0000 GETGBL R1 G9
|
||||
0x5C080000, // 0001 MOVE R2 R0
|
||||
0x7C040200, // 0002 CALL R1 1
|
||||
0x80040200, // 0003 RET 1 R1
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: web_values
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light0_web_values, /* name */
|
||||
be_nested_proto(
|
||||
10, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 6]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(webserver),
|
||||
/* K1 */ be_nested_str_weak(string),
|
||||
/* K2 */ be_nested_str_weak(content_send),
|
||||
/* K3 */ be_nested_str_weak(format),
|
||||
/* K4 */ be_nested_str_weak(_X7C_X20Light_X20_X25s),
|
||||
/* K5 */ be_nested_str_weak(web_value_onoff),
|
||||
}),
|
||||
be_str_weak(web_values),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[10]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0xA40A0200, // 0001 IMPORT R2 K1
|
||||
0x8C0C0302, // 0002 GETMET R3 R1 K2
|
||||
0x8C140503, // 0003 GETMET R5 R2 K3
|
||||
0x581C0004, // 0004 LDCONST R7 K4
|
||||
0x8C200105, // 0005 GETMET R8 R0 K5
|
||||
0x7C200200, // 0006 CALL R8 1
|
||||
0x7C140600, // 0007 CALL R5 3
|
||||
0x7C0C0400, // 0008 CALL R3 2
|
||||
0x80000000, // 0009 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: web_value_onoff
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light0_web_value_onoff, /* name */
|
||||
be_nested_proto(
|
||||
3, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 4]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(shadow_onoff),
|
||||
/* K1 */ be_nested_str_weak(_X3Cb_X3EOn_X3C_X2Fb_X3E),
|
||||
/* K2 */ be_nested_str_weak(Off),
|
||||
/* K3 */ be_nested_str_weak(),
|
||||
}),
|
||||
be_str_weak(web_value_onoff),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[12]) { /* code */
|
||||
0x88040100, // 0000 GETMBR R1 R0 K0
|
||||
0x4C080000, // 0001 LDNIL R2
|
||||
0x20040202, // 0002 NE R1 R1 R2
|
||||
0x78060005, // 0003 JMPF R1 #000A
|
||||
0x88040100, // 0004 GETMBR R1 R0 K0
|
||||
0x78060001, // 0005 JMPF R1 #0008
|
||||
0x58040001, // 0006 LDCONST R1 K1
|
||||
0x70020000, // 0007 JMP #0009
|
||||
0x58040002, // 0008 LDCONST R1 K2
|
||||
0x70020000, // 0009 JMP #000B
|
||||
0x58040003, // 000A LDCONST R1 K3
|
||||
0x80040200, // 000B RET 1 R1
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: read_attribute
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light0_read_attribute, /* name */
|
||||
be_nested_proto(
|
||||
11, /* nstack */
|
||||
3, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[12]) { /* 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_nested_str_weak(update_shadow_lazy),
|
||||
/* K6 */ be_const_int(0),
|
||||
/* K7 */ be_nested_str_weak(create_TLV),
|
||||
/* K8 */ be_nested_str_weak(BOOL),
|
||||
/* K9 */ be_nested_str_weak(shadow_onoff),
|
||||
/* K10 */ be_nested_str_weak(U4),
|
||||
/* K11 */ be_nested_str_weak(read_attribute),
|
||||
}),
|
||||
be_str_weak(read_attribute),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[45]) { /* 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
|
||||
0x541E0005, // 0005 LDINT R7 6
|
||||
0x1C1C0A07, // 0006 EQ R7 R5 R7
|
||||
0x781E001B, // 0007 JMPF R7 #0024
|
||||
0x8C1C0105, // 0008 GETMET R7 R0 K5
|
||||
0x7C1C0200, // 0009 CALL R7 1
|
||||
0x1C1C0D06, // 000A EQ R7 R6 K6
|
||||
0x781E0005, // 000B JMPF R7 #0012
|
||||
0x8C1C0907, // 000C GETMET R7 R4 K7
|
||||
0x88240908, // 000D GETMBR R9 R4 K8
|
||||
0x88280109, // 000E GETMBR R10 R0 K9
|
||||
0x7C1C0600, // 000F CALL R7 3
|
||||
0x80040E00, // 0010 RET 1 R7
|
||||
0x70020010, // 0011 JMP #0023
|
||||
0x541EFFFB, // 0012 LDINT R7 65532
|
||||
0x1C1C0C07, // 0013 EQ R7 R6 R7
|
||||
0x781E0005, // 0014 JMPF R7 #001B
|
||||
0x8C1C0907, // 0015 GETMET R7 R4 K7
|
||||
0x8824090A, // 0016 GETMBR R9 R4 K10
|
||||
0x58280006, // 0017 LDCONST R10 K6
|
||||
0x7C1C0600, // 0018 CALL R7 3
|
||||
0x80040E00, // 0019 RET 1 R7
|
||||
0x70020007, // 001A JMP #0023
|
||||
0x541EFFFC, // 001B LDINT R7 65533
|
||||
0x1C1C0C07, // 001C EQ R7 R6 R7
|
||||
0x781E0004, // 001D JMPF R7 #0023
|
||||
0x8C1C0907, // 001E GETMET R7 R4 K7
|
||||
0x8824090A, // 001F GETMBR R9 R4 K10
|
||||
0x542A0003, // 0020 LDINT R10 4
|
||||
0x7C1C0600, // 0021 CALL R7 3
|
||||
0x80040E00, // 0022 RET 1 R7
|
||||
0x70020007, // 0023 JMP #002C
|
||||
0x601C0003, // 0024 GETGBL R7 G3
|
||||
0x5C200000, // 0025 MOVE R8 R0
|
||||
0x7C1C0200, // 0026 CALL R7 1
|
||||
0x8C1C0F0B, // 0027 GETMET R7 R7 K11
|
||||
0x5C240200, // 0028 MOVE R9 R1
|
||||
0x5C280400, // 0029 MOVE R10 R2
|
||||
0x7C1C0600, // 002A CALL R7 3
|
||||
0x80040E00, // 002B RET 1 R7
|
||||
0x80000000, // 002C RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified class: Matter_Plugin_Bridge_Light0
|
||||
********************************************************************/
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_HTTP;
|
||||
be_local_class(Matter_Plugin_Bridge_Light0,
|
||||
2,
|
||||
&be_class_Matter_Plugin_Bridge_HTTP,
|
||||
be_nested_map(15,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Bridge_Light0_init_closure) },
|
||||
{ be_const_key_weak(parse_update, -1), be_const_closure(Matter_Plugin_Bridge_Light0_parse_update_closure) },
|
||||
{ be_const_key_weak(invoke_request, 14), be_const_closure(Matter_Plugin_Bridge_Light0_invoke_request_closure) },
|
||||
{ be_const_key_weak(set_onoff, -1), be_const_closure(Matter_Plugin_Bridge_Light0_set_onoff_closure) },
|
||||
{ be_const_key_weak(ARG_TYPE, 11), be_const_static_closure(Matter_Plugin_Bridge_Light0__X3Clambda_X3E_closure) },
|
||||
{ be_const_key_weak(tasmota_relay_index, 7), be_const_var(0) },
|
||||
{ be_const_key_weak(ARG, -1), be_nested_str_weak(relay) },
|
||||
{ be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
|
||||
be_const_map( * be_nested_map(2,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_int(256, -1), be_const_int(2) },
|
||||
{ be_const_key_int(19, -1), be_const_int(1) },
|
||||
})) ) } )) },
|
||||
{ be_const_key_weak(TYPE, -1), be_nested_str_weak(http_light0) },
|
||||
{ be_const_key_weak(NAME, 6), be_nested_str_weak(_X26_X23x1F517_X3B_X20Light_X200_X20On) },
|
||||
{ be_const_key_weak(web_value_onoff, -1), be_const_closure(Matter_Plugin_Bridge_Light0_web_value_onoff_closure) },
|
||||
{ be_const_key_weak(CLUSTERS, 8), 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(6, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
|
||||
be_const_list( * be_nested_list(3,
|
||||
( (struct bvalue*) &(const bvalue[]) {
|
||||
be_const_int(0),
|
||||
be_const_int(65532),
|
||||
be_const_int(65533),
|
||||
})) ) } )) },
|
||||
})) ) } )) },
|
||||
{ be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Bridge_Light0_read_attribute_closure) },
|
||||
{ be_const_key_weak(shadow_onoff, -1), be_const_var(1) },
|
||||
{ be_const_key_weak(web_values, -1), be_const_closure(Matter_Plugin_Bridge_Light0_web_values_closure) },
|
||||
})),
|
||||
be_str_weak(Matter_Plugin_Bridge_Light0)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
void be_load_Matter_Plugin_Bridge_Light0_class(bvm *vm) {
|
||||
be_pushntvclass(vm, &be_class_Matter_Plugin_Bridge_Light0);
|
||||
be_setglobal(vm, "Matter_Plugin_Bridge_Light0");
|
||||
be_pop(vm, 1);
|
||||
}
|
||||
/********************************************************************/
|
||||
/* End of solidification */
|
|
@ -0,0 +1,542 @@
|
|||
/* Solidification of Matter_Plugin_Bridge_Light1.h */
|
||||
/********************************************************************\
|
||||
* Generated code, don't edit *
|
||||
\********************************************************************/
|
||||
#include "be_constobj.h"
|
||||
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_Light1;
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: invoke_request
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light1_invoke_request, /* name */
|
||||
be_nested_proto(
|
||||
12, /* nstack */
|
||||
4, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[15]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(matter),
|
||||
/* K1 */ be_nested_str_weak(TLV),
|
||||
/* K2 */ be_nested_str_weak(cluster),
|
||||
/* K3 */ be_nested_str_weak(command),
|
||||
/* K4 */ be_nested_str_weak(update_shadow_lazy),
|
||||
/* K5 */ be_const_int(0),
|
||||
/* K6 */ be_nested_str_weak(findsubval),
|
||||
/* K7 */ be_nested_str_weak(set_bri),
|
||||
/* K8 */ be_nested_str_weak(log),
|
||||
/* K9 */ be_nested_str_weak(bri_X3A),
|
||||
/* K10 */ be_const_int(1),
|
||||
/* K11 */ be_const_int(2),
|
||||
/* K12 */ be_const_int(3),
|
||||
/* K13 */ be_nested_str_weak(set_onoff),
|
||||
/* K14 */ be_nested_str_weak(invoke_request),
|
||||
}),
|
||||
be_str_weak(invoke_request),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[89]) { /* code */
|
||||
0xB8120000, // 0000 GETNGBL R4 K0
|
||||
0x88100901, // 0001 GETMBR R4 R4 K1
|
||||
0x88140702, // 0002 GETMBR R5 R3 K2
|
||||
0x88180703, // 0003 GETMBR R6 R3 K3
|
||||
0x541E0007, // 0004 LDINT R7 8
|
||||
0x1C1C0A07, // 0005 EQ R7 R5 R7
|
||||
0x781E0047, // 0006 JMPF R7 #004F
|
||||
0x8C1C0104, // 0007 GETMET R7 R0 K4
|
||||
0x7C1C0200, // 0008 CALL R7 1
|
||||
0x1C1C0D05, // 0009 EQ R7 R6 K5
|
||||
0x781E000D, // 000A JMPF R7 #0019
|
||||
0x8C1C0506, // 000B GETMET R7 R2 K6
|
||||
0x58240005, // 000C LDCONST R9 K5
|
||||
0x7C1C0400, // 000D CALL R7 2
|
||||
0x8C200107, // 000E GETMET R8 R0 K7
|
||||
0x5C280E00, // 000F MOVE R10 R7
|
||||
0x7C200400, // 0010 CALL R8 2
|
||||
0x60200008, // 0011 GETGBL R8 G8
|
||||
0x5C240E00, // 0012 MOVE R9 R7
|
||||
0x7C200200, // 0013 CALL R8 1
|
||||
0x00221208, // 0014 ADD R8 K9 R8
|
||||
0x900E1008, // 0015 SETMBR R3 K8 R8
|
||||
0x50200200, // 0016 LDBOOL R8 1 0
|
||||
0x80041000, // 0017 RET 1 R8
|
||||
0x70020034, // 0018 JMP #004E
|
||||
0x1C1C0D0A, // 0019 EQ R7 R6 K10
|
||||
0x781E0002, // 001A JMPF R7 #001E
|
||||
0x501C0200, // 001B LDBOOL R7 1 0
|
||||
0x80040E00, // 001C RET 1 R7
|
||||
0x7002002F, // 001D JMP #004E
|
||||
0x1C1C0D0B, // 001E EQ R7 R6 K11
|
||||
0x781E0002, // 001F JMPF R7 #0023
|
||||
0x501C0200, // 0020 LDBOOL R7 1 0
|
||||
0x80040E00, // 0021 RET 1 R7
|
||||
0x7002002A, // 0022 JMP #004E
|
||||
0x1C1C0D0C, // 0023 EQ R7 R6 K12
|
||||
0x781E0002, // 0024 JMPF R7 #0028
|
||||
0x501C0200, // 0025 LDBOOL R7 1 0
|
||||
0x80040E00, // 0026 RET 1 R7
|
||||
0x70020025, // 0027 JMP #004E
|
||||
0x541E0003, // 0028 LDINT R7 4
|
||||
0x1C1C0C07, // 0029 EQ R7 R6 R7
|
||||
0x781E0011, // 002A JMPF R7 #003D
|
||||
0x8C1C0506, // 002B GETMET R7 R2 K6
|
||||
0x58240005, // 002C LDCONST R9 K5
|
||||
0x7C1C0400, // 002D CALL R7 2
|
||||
0x8C200107, // 002E GETMET R8 R0 K7
|
||||
0x5C280E00, // 002F MOVE R10 R7
|
||||
0x7C200400, // 0030 CALL R8 2
|
||||
0x24200F05, // 0031 GT R8 R7 K5
|
||||
0x8C24010D, // 0032 GETMET R9 R0 K13
|
||||
0x5C2C1000, // 0033 MOVE R11 R8
|
||||
0x7C240400, // 0034 CALL R9 2
|
||||
0x60240008, // 0035 GETGBL R9 G8
|
||||
0x5C280E00, // 0036 MOVE R10 R7
|
||||
0x7C240200, // 0037 CALL R9 1
|
||||
0x00261209, // 0038 ADD R9 K9 R9
|
||||
0x900E1009, // 0039 SETMBR R3 K8 R9
|
||||
0x50240200, // 003A LDBOOL R9 1 0
|
||||
0x80041200, // 003B RET 1 R9
|
||||
0x70020010, // 003C JMP #004E
|
||||
0x541E0004, // 003D LDINT R7 5
|
||||
0x1C1C0C07, // 003E EQ R7 R6 R7
|
||||
0x781E0002, // 003F JMPF R7 #0043
|
||||
0x501C0200, // 0040 LDBOOL R7 1 0
|
||||
0x80040E00, // 0041 RET 1 R7
|
||||
0x7002000A, // 0042 JMP #004E
|
||||
0x541E0005, // 0043 LDINT R7 6
|
||||
0x1C1C0C07, // 0044 EQ R7 R6 R7
|
||||
0x781E0002, // 0045 JMPF R7 #0049
|
||||
0x501C0200, // 0046 LDBOOL R7 1 0
|
||||
0x80040E00, // 0047 RET 1 R7
|
||||
0x70020004, // 0048 JMP #004E
|
||||
0x541E0006, // 0049 LDINT R7 7
|
||||
0x1C1C0C07, // 004A EQ R7 R6 R7
|
||||
0x781E0001, // 004B JMPF R7 #004E
|
||||
0x501C0200, // 004C LDBOOL R7 1 0
|
||||
0x80040E00, // 004D RET 1 R7
|
||||
0x70020008, // 004E JMP #0058
|
||||
0x601C0003, // 004F GETGBL R7 G3
|
||||
0x5C200000, // 0050 MOVE R8 R0
|
||||
0x7C1C0200, // 0051 CALL R7 1
|
||||
0x8C1C0F0E, // 0052 GETMET R7 R7 K14
|
||||
0x5C240200, // 0053 MOVE R9 R1
|
||||
0x5C280400, // 0054 MOVE R10 R2
|
||||
0x5C2C0600, // 0055 MOVE R11 R3
|
||||
0x7C1C0800, // 0056 CALL R7 4
|
||||
0x80040E00, // 0057 RET 1 R7
|
||||
0x80000000, // 0058 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: read_attribute
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light1_read_attribute, /* name */
|
||||
be_nested_proto(
|
||||
11, /* nstack */
|
||||
3, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[16]) { /* 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_nested_str_weak(update_shadow_lazy),
|
||||
/* K6 */ be_const_int(0),
|
||||
/* K7 */ be_nested_str_weak(shadow_bri),
|
||||
/* K8 */ be_nested_str_weak(create_TLV),
|
||||
/* K9 */ be_nested_str_weak(U1),
|
||||
/* K10 */ be_nested_str_weak(NULL),
|
||||
/* K11 */ be_const_int(2),
|
||||
/* K12 */ be_const_int(3),
|
||||
/* K13 */ be_nested_str_weak(U4),
|
||||
/* K14 */ be_const_int(1),
|
||||
/* K15 */ be_nested_str_weak(read_attribute),
|
||||
}),
|
||||
be_str_weak(read_attribute),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[99]) { /* 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
|
||||
0x541E0007, // 0005 LDINT R7 8
|
||||
0x1C1C0A07, // 0006 EQ R7 R5 R7
|
||||
0x781E0051, // 0007 JMPF R7 #005A
|
||||
0x8C1C0105, // 0008 GETMET R7 R0 K5
|
||||
0x7C1C0200, // 0009 CALL R7 1
|
||||
0x1C1C0D06, // 000A EQ R7 R6 K6
|
||||
0x781E000F, // 000B JMPF R7 #001C
|
||||
0x881C0107, // 000C GETMBR R7 R0 K7
|
||||
0x4C200000, // 000D LDNIL R8
|
||||
0x201C0E08, // 000E NE R7 R7 R8
|
||||
0x781E0005, // 000F JMPF R7 #0016
|
||||
0x8C1C0908, // 0010 GETMET R7 R4 K8
|
||||
0x88240909, // 0011 GETMBR R9 R4 K9
|
||||
0x88280107, // 0012 GETMBR R10 R0 K7
|
||||
0x7C1C0600, // 0013 CALL R7 3
|
||||
0x80040E00, // 0014 RET 1 R7
|
||||
0x70020004, // 0015 JMP #001B
|
||||
0x8C1C0908, // 0016 GETMET R7 R4 K8
|
||||
0x8824090A, // 0017 GETMBR R9 R4 K10
|
||||
0x4C280000, // 0018 LDNIL R10
|
||||
0x7C1C0600, // 0019 CALL R7 3
|
||||
0x80040E00, // 001A RET 1 R7
|
||||
0x7002003C, // 001B JMP #0059
|
||||
0x1C1C0D0B, // 001C EQ R7 R6 K11
|
||||
0x781E0005, // 001D JMPF R7 #0024
|
||||
0x8C1C0908, // 001E GETMET R7 R4 K8
|
||||
0x88240909, // 001F GETMBR R9 R4 K9
|
||||
0x58280006, // 0020 LDCONST R10 K6
|
||||
0x7C1C0600, // 0021 CALL R7 3
|
||||
0x80040E00, // 0022 RET 1 R7
|
||||
0x70020034, // 0023 JMP #0059
|
||||
0x1C1C0D0C, // 0024 EQ R7 R6 K12
|
||||
0x781E0005, // 0025 JMPF R7 #002C
|
||||
0x8C1C0908, // 0026 GETMET R7 R4 K8
|
||||
0x88240909, // 0027 GETMBR R9 R4 K9
|
||||
0x542A00FD, // 0028 LDINT R10 254
|
||||
0x7C1C0600, // 0029 CALL R7 3
|
||||
0x80040E00, // 002A RET 1 R7
|
||||
0x7002002C, // 002B JMP #0059
|
||||
0x541E000E, // 002C LDINT R7 15
|
||||
0x1C1C0C07, // 002D EQ R7 R6 R7
|
||||
0x781E0005, // 002E JMPF R7 #0035
|
||||
0x8C1C0908, // 002F GETMET R7 R4 K8
|
||||
0x88240909, // 0030 GETMBR R9 R4 K9
|
||||
0x58280006, // 0031 LDCONST R10 K6
|
||||
0x7C1C0600, // 0032 CALL R7 3
|
||||
0x80040E00, // 0033 RET 1 R7
|
||||
0x70020023, // 0034 JMP #0059
|
||||
0x541E0010, // 0035 LDINT R7 17
|
||||
0x1C1C0C07, // 0036 EQ R7 R6 R7
|
||||
0x781E000F, // 0037 JMPF R7 #0048
|
||||
0x881C0107, // 0038 GETMBR R7 R0 K7
|
||||
0x4C200000, // 0039 LDNIL R8
|
||||
0x201C0E08, // 003A NE R7 R7 R8
|
||||
0x781E0005, // 003B JMPF R7 #0042
|
||||
0x8C1C0908, // 003C GETMET R7 R4 K8
|
||||
0x88240909, // 003D GETMBR R9 R4 K9
|
||||
0x88280107, // 003E GETMBR R10 R0 K7
|
||||
0x7C1C0600, // 003F CALL R7 3
|
||||
0x80040E00, // 0040 RET 1 R7
|
||||
0x70020004, // 0041 JMP #0047
|
||||
0x8C1C0908, // 0042 GETMET R7 R4 K8
|
||||
0x8824090A, // 0043 GETMBR R9 R4 K10
|
||||
0x4C280000, // 0044 LDNIL R10
|
||||
0x7C1C0600, // 0045 CALL R7 3
|
||||
0x80040E00, // 0046 RET 1 R7
|
||||
0x70020010, // 0047 JMP #0059
|
||||
0x541EFFFB, // 0048 LDINT R7 65532
|
||||
0x1C1C0C07, // 0049 EQ R7 R6 R7
|
||||
0x781E0005, // 004A JMPF R7 #0051
|
||||
0x8C1C0908, // 004B GETMET R7 R4 K8
|
||||
0x8824090D, // 004C GETMBR R9 R4 K13
|
||||
0x5828000E, // 004D LDCONST R10 K14
|
||||
0x7C1C0600, // 004E CALL R7 3
|
||||
0x80040E00, // 004F RET 1 R7
|
||||
0x70020007, // 0050 JMP #0059
|
||||
0x541EFFFC, // 0051 LDINT R7 65533
|
||||
0x1C1C0C07, // 0052 EQ R7 R6 R7
|
||||
0x781E0004, // 0053 JMPF R7 #0059
|
||||
0x8C1C0908, // 0054 GETMET R7 R4 K8
|
||||
0x8824090D, // 0055 GETMBR R9 R4 K13
|
||||
0x542A0004, // 0056 LDINT R10 5
|
||||
0x7C1C0600, // 0057 CALL R7 3
|
||||
0x80040E00, // 0058 RET 1 R7
|
||||
0x70020007, // 0059 JMP #0062
|
||||
0x601C0003, // 005A GETGBL R7 G3
|
||||
0x5C200000, // 005B MOVE R8 R0
|
||||
0x7C1C0200, // 005C CALL R7 1
|
||||
0x8C1C0F0F, // 005D GETMET R7 R7 K15
|
||||
0x5C240200, // 005E MOVE R9 R1
|
||||
0x5C280400, // 005F MOVE R10 R2
|
||||
0x7C1C0600, // 0060 CALL R7 3
|
||||
0x80040E00, // 0061 RET 1 R7
|
||||
0x80000000, // 0062 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: web_values
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light1_web_values, /* name */
|
||||
be_nested_proto(
|
||||
11, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 7]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(webserver),
|
||||
/* K1 */ be_nested_str_weak(string),
|
||||
/* K2 */ be_nested_str_weak(content_send),
|
||||
/* K3 */ be_nested_str_weak(format),
|
||||
/* K4 */ be_nested_str_weak(_X7C_X20Light_X20_X25s_X20_X25s),
|
||||
/* K5 */ be_nested_str_weak(web_value_onoff),
|
||||
/* K6 */ be_nested_str_weak(web_value_dimmer),
|
||||
}),
|
||||
be_str_weak(web_values),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[12]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0xA40A0200, // 0001 IMPORT R2 K1
|
||||
0x8C0C0302, // 0002 GETMET R3 R1 K2
|
||||
0x8C140503, // 0003 GETMET R5 R2 K3
|
||||
0x581C0004, // 0004 LDCONST R7 K4
|
||||
0x8C200105, // 0005 GETMET R8 R0 K5
|
||||
0x7C200200, // 0006 CALL R8 1
|
||||
0x8C240106, // 0007 GETMET R9 R0 K6
|
||||
0x7C240200, // 0008 CALL R9 1
|
||||
0x7C140800, // 0009 CALL R5 4
|
||||
0x7C0C0400, // 000A CALL R3 2
|
||||
0x80000000, // 000B RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: set_bri
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light1_set_bri, /* name */
|
||||
be_nested_proto(
|
||||
9, /* nstack */
|
||||
2, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 6]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(tasmota),
|
||||
/* K1 */ be_nested_str_weak(scale_uint),
|
||||
/* K2 */ be_const_int(0),
|
||||
/* K3 */ be_nested_str_weak(call_remote_sync),
|
||||
/* K4 */ be_nested_str_weak(Dimmer),
|
||||
/* K5 */ be_nested_str_weak(parse_update),
|
||||
}),
|
||||
be_str_weak(set_bri),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[22]) { /* code */
|
||||
0xB80A0000, // 0000 GETNGBL R2 K0
|
||||
0x8C080501, // 0001 GETMET R2 R2 K1
|
||||
0x5C100200, // 0002 MOVE R4 R1
|
||||
0x58140002, // 0003 LDCONST R5 K2
|
||||
0x541A00FD, // 0004 LDINT R6 254
|
||||
0x581C0002, // 0005 LDCONST R7 K2
|
||||
0x54220063, // 0006 LDINT R8 100
|
||||
0x7C080C00, // 0007 CALL R2 6
|
||||
0x8C0C0103, // 0008 GETMET R3 R0 K3
|
||||
0x58140004, // 0009 LDCONST R5 K4
|
||||
0x60180008, // 000A GETGBL R6 G8
|
||||
0x5C1C0400, // 000B MOVE R7 R2
|
||||
0x7C180200, // 000C CALL R6 1
|
||||
0x7C0C0600, // 000D CALL R3 3
|
||||
0x4C100000, // 000E LDNIL R4
|
||||
0x20100604, // 000F NE R4 R3 R4
|
||||
0x78120003, // 0010 JMPF R4 #0015
|
||||
0x8C100105, // 0011 GETMET R4 R0 K5
|
||||
0x5C180600, // 0012 MOVE R6 R3
|
||||
0x541E000A, // 0013 LDINT R7 11
|
||||
0x7C100600, // 0014 CALL R4 3
|
||||
0x80000000, // 0015 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: parse_update
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light1_parse_update, /* name */
|
||||
be_nested_proto(
|
||||
11, /* nstack */
|
||||
3, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 8]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(parse_update),
|
||||
/* K1 */ be_nested_str_weak(find),
|
||||
/* K2 */ be_nested_str_weak(Dimmer),
|
||||
/* K3 */ be_nested_str_weak(tasmota),
|
||||
/* K4 */ be_nested_str_weak(scale_uint),
|
||||
/* K5 */ be_const_int(0),
|
||||
/* K6 */ be_nested_str_weak(shadow_bri),
|
||||
/* K7 */ be_nested_str_weak(attribute_updated),
|
||||
}),
|
||||
be_str_weak(parse_update),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[35]) { /* code */
|
||||
0x600C0003, // 0000 GETGBL R3 G3
|
||||
0x5C100000, // 0001 MOVE R4 R0
|
||||
0x7C0C0200, // 0002 CALL R3 1
|
||||
0x8C0C0700, // 0003 GETMET R3 R3 K0
|
||||
0x5C140200, // 0004 MOVE R5 R1
|
||||
0x5C180400, // 0005 MOVE R6 R2
|
||||
0x7C0C0600, // 0006 CALL R3 3
|
||||
0x540E000A, // 0007 LDINT R3 11
|
||||
0x1C0C0403, // 0008 EQ R3 R2 R3
|
||||
0x780E0017, // 0009 JMPF R3 #0022
|
||||
0x600C0009, // 000A GETGBL R3 G9
|
||||
0x8C100301, // 000B GETMET R4 R1 K1
|
||||
0x58180002, // 000C LDCONST R6 K2
|
||||
0x7C100400, // 000D CALL R4 2
|
||||
0x7C0C0200, // 000E CALL R3 1
|
||||
0x4C100000, // 000F LDNIL R4
|
||||
0x20100604, // 0010 NE R4 R3 R4
|
||||
0x7812000F, // 0011 JMPF R4 #0022
|
||||
0xB8120600, // 0012 GETNGBL R4 K3
|
||||
0x8C100904, // 0013 GETMET R4 R4 K4
|
||||
0x5C180600, // 0014 MOVE R6 R3
|
||||
0x581C0005, // 0015 LDCONST R7 K5
|
||||
0x54220063, // 0016 LDINT R8 100
|
||||
0x58240005, // 0017 LDCONST R9 K5
|
||||
0x542A00FD, // 0018 LDINT R10 254
|
||||
0x7C100C00, // 0019 CALL R4 6
|
||||
0x88140106, // 001A GETMBR R5 R0 K6
|
||||
0x20140805, // 001B NE R5 R4 R5
|
||||
0x78160004, // 001C JMPF R5 #0022
|
||||
0x8C140107, // 001D GETMET R5 R0 K7
|
||||
0x541E0007, // 001E LDINT R7 8
|
||||
0x58200005, // 001F LDCONST R8 K5
|
||||
0x7C140600, // 0020 CALL R5 3
|
||||
0x90020C04, // 0021 SETMBR R0 K6 R4
|
||||
0x80000000, // 0022 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: web_value_dimmer
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light1_web_value_dimmer, /* name */
|
||||
be_nested_proto(
|
||||
10, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 9]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(string),
|
||||
/* K1 */ be_nested_str_weak(),
|
||||
/* K2 */ be_nested_str_weak(shadow_bri),
|
||||
/* K3 */ be_nested_str_weak(tasmota),
|
||||
/* K4 */ be_nested_str_weak(scale_uint),
|
||||
/* K5 */ be_const_int(0),
|
||||
/* K6 */ be_nested_str_weak(format),
|
||||
/* K7 */ be_nested_str_weak(_X25i_X25_X25),
|
||||
/* K8 */ be_nested_str_weak(_X26_X23128261_X3B_X20),
|
||||
}),
|
||||
be_str_weak(web_value_dimmer),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[21]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0x58080001, // 0001 LDCONST R2 K1
|
||||
0x880C0102, // 0002 GETMBR R3 R0 K2
|
||||
0x4C100000, // 0003 LDNIL R4
|
||||
0x200C0604, // 0004 NE R3 R3 R4
|
||||
0x780E000C, // 0005 JMPF R3 #0013
|
||||
0xB80E0600, // 0006 GETNGBL R3 K3
|
||||
0x8C0C0704, // 0007 GETMET R3 R3 K4
|
||||
0x88140102, // 0008 GETMBR R5 R0 K2
|
||||
0x58180005, // 0009 LDCONST R6 K5
|
||||
0x541E00FD, // 000A LDINT R7 254
|
||||
0x58200005, // 000B LDCONST R8 K5
|
||||
0x54260063, // 000C LDINT R9 100
|
||||
0x7C0C0C00, // 000D CALL R3 6
|
||||
0x8C100306, // 000E GETMET R4 R1 K6
|
||||
0x58180007, // 000F LDCONST R6 K7
|
||||
0x5C1C0600, // 0010 MOVE R7 R3
|
||||
0x7C100600, // 0011 CALL R4 3
|
||||
0x5C080800, // 0012 MOVE R2 R4
|
||||
0x000E1002, // 0013 ADD R3 K8 R2
|
||||
0x80040600, // 0014 RET 1 R3
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified class: Matter_Plugin_Bridge_Light1
|
||||
********************************************************************/
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_Light0;
|
||||
be_local_class(Matter_Plugin_Bridge_Light1,
|
||||
1,
|
||||
&be_class_Matter_Plugin_Bridge_Light0,
|
||||
be_nested_map(11,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_weak(web_value_dimmer, -1), be_const_closure(Matter_Plugin_Bridge_Light1_web_value_dimmer_closure) },
|
||||
{ be_const_key_weak(parse_update, -1), be_const_closure(Matter_Plugin_Bridge_Light1_parse_update_closure) },
|
||||
{ be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
|
||||
be_const_map( * be_nested_map(2,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_int(257, -1), be_const_int(2) },
|
||||
{ be_const_key_int(19, 0), be_const_int(1) },
|
||||
})) ) } )) },
|
||||
{ be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Bridge_Light1_read_attribute_closure) },
|
||||
{ be_const_key_weak(TYPE, 2), be_nested_str_weak(http_light1) },
|
||||
{ be_const_key_weak(shadow_bri, 8), be_const_var(0) },
|
||||
{ be_const_key_weak(CLUSTERS, 5), 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(8, -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(2),
|
||||
be_const_int(3),
|
||||
be_const_int(15),
|
||||
be_const_int(17),
|
||||
be_const_int(65532),
|
||||
be_const_int(65533),
|
||||
})) ) } )) },
|
||||
})) ) } )) },
|
||||
{ be_const_key_weak(set_bri, -1), be_const_closure(Matter_Plugin_Bridge_Light1_set_bri_closure) },
|
||||
{ be_const_key_weak(NAME, -1), be_nested_str_weak(_X26_X23x1F517_X3B_X20Light_X201_X20Dimmer) },
|
||||
{ be_const_key_weak(web_values, 1), be_const_closure(Matter_Plugin_Bridge_Light1_web_values_closure) },
|
||||
{ be_const_key_weak(invoke_request, 0), be_const_closure(Matter_Plugin_Bridge_Light1_invoke_request_closure) },
|
||||
})),
|
||||
be_str_weak(Matter_Plugin_Bridge_Light1)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
void be_load_Matter_Plugin_Bridge_Light1_class(bvm *vm) {
|
||||
be_pushntvclass(vm, &be_class_Matter_Plugin_Bridge_Light1);
|
||||
be_setglobal(vm, "Matter_Plugin_Bridge_Light1");
|
||||
be_pop(vm, 1);
|
||||
}
|
||||
/********************************************************************/
|
||||
/* End of solidification */
|
|
@ -0,0 +1,579 @@
|
|||
/* Solidification of Matter_Plugin_Bridge_Light2.h */
|
||||
/********************************************************************\
|
||||
* Generated code, don't edit *
|
||||
\********************************************************************/
|
||||
#include "be_constobj.h"
|
||||
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_Light2;
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: init
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light2_init, /* name */
|
||||
be_nested_proto(
|
||||
9, /* nstack */
|
||||
4, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 2]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(init),
|
||||
/* K1 */ be_nested_str_weak(update_ct_minmax),
|
||||
}),
|
||||
be_str_weak(init),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[11]) { /* code */
|
||||
0x60100003, // 0000 GETGBL R4 G3
|
||||
0x5C140000, // 0001 MOVE R5 R0
|
||||
0x7C100200, // 0002 CALL R4 1
|
||||
0x8C100900, // 0003 GETMET R4 R4 K0
|
||||
0x5C180200, // 0004 MOVE R6 R1
|
||||
0x5C1C0400, // 0005 MOVE R7 R2
|
||||
0x5C200600, // 0006 MOVE R8 R3
|
||||
0x7C100800, // 0007 CALL R4 4
|
||||
0x8C100101, // 0008 GETMET R4 R0 K1
|
||||
0x7C100200, // 0009 CALL R4 1
|
||||
0x80000000, // 000A RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: parse_update
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light2_parse_update, /* 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(parse_update),
|
||||
/* K1 */ be_nested_str_weak(find),
|
||||
/* K2 */ be_nested_str_weak(CT),
|
||||
/* K3 */ be_nested_str_weak(shadow_ct),
|
||||
/* K4 */ be_nested_str_weak(ct_min),
|
||||
/* K5 */ be_nested_str_weak(ct_max),
|
||||
/* K6 */ be_nested_str_weak(attribute_updated),
|
||||
}),
|
||||
be_str_weak(parse_update),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[35]) { /* code */
|
||||
0x600C0003, // 0000 GETGBL R3 G3
|
||||
0x5C100000, // 0001 MOVE R4 R0
|
||||
0x7C0C0200, // 0002 CALL R3 1
|
||||
0x8C0C0700, // 0003 GETMET R3 R3 K0
|
||||
0x5C140200, // 0004 MOVE R5 R1
|
||||
0x5C180400, // 0005 MOVE R6 R2
|
||||
0x7C0C0600, // 0006 CALL R3 3
|
||||
0x540E000A, // 0007 LDINT R3 11
|
||||
0x1C0C0403, // 0008 EQ R3 R2 R3
|
||||
0x780E0017, // 0009 JMPF R3 #0022
|
||||
0x600C0009, // 000A GETGBL R3 G9
|
||||
0x8C100301, // 000B GETMET R4 R1 K1
|
||||
0x58180002, // 000C LDCONST R6 K2
|
||||
0x7C100400, // 000D CALL R4 2
|
||||
0x7C0C0200, // 000E CALL R3 1
|
||||
0x4C100000, // 000F LDNIL R4
|
||||
0x20100604, // 0010 NE R4 R3 R4
|
||||
0x7812000F, // 0011 JMPF R4 #0022
|
||||
0x88100103, // 0012 GETMBR R4 R0 K3
|
||||
0x20100604, // 0013 NE R4 R3 R4
|
||||
0x7812000C, // 0014 JMPF R4 #0022
|
||||
0x88100104, // 0015 GETMBR R4 R0 K4
|
||||
0x14100604, // 0016 LT R4 R3 R4
|
||||
0x78120000, // 0017 JMPF R4 #0019
|
||||
0x880C0104, // 0018 GETMBR R3 R0 K4
|
||||
0x88100105, // 0019 GETMBR R4 R0 K5
|
||||
0x24100604, // 001A GT R4 R3 R4
|
||||
0x78120000, // 001B JMPF R4 #001D
|
||||
0x880C0105, // 001C GETMBR R3 R0 K5
|
||||
0x8C100106, // 001D GETMET R4 R0 K6
|
||||
0x541A02FF, // 001E LDINT R6 768
|
||||
0x541E0006, // 001F LDINT R7 7
|
||||
0x7C100600, // 0020 CALL R4 3
|
||||
0x90020603, // 0021 SETMBR R0 K3 R3
|
||||
0x80000000, // 0022 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: web_values
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light2_web_values, /* name */
|
||||
be_nested_proto(
|
||||
12, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 8]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(webserver),
|
||||
/* K1 */ be_nested_str_weak(string),
|
||||
/* K2 */ be_nested_str_weak(content_send),
|
||||
/* K3 */ be_nested_str_weak(format),
|
||||
/* K4 */ be_nested_str_weak(_X7C_X20Light_X20_X25s_X20_X25s_X20_X25s),
|
||||
/* K5 */ be_nested_str_weak(web_value_onoff),
|
||||
/* K6 */ be_nested_str_weak(web_value_dimmer),
|
||||
/* K7 */ be_nested_str_weak(web_value_ct),
|
||||
}),
|
||||
be_str_weak(web_values),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[14]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0xA40A0200, // 0001 IMPORT R2 K1
|
||||
0x8C0C0302, // 0002 GETMET R3 R1 K2
|
||||
0x8C140503, // 0003 GETMET R5 R2 K3
|
||||
0x581C0004, // 0004 LDCONST R7 K4
|
||||
0x8C200105, // 0005 GETMET R8 R0 K5
|
||||
0x7C200200, // 0006 CALL R8 1
|
||||
0x8C240106, // 0007 GETMET R9 R0 K6
|
||||
0x7C240200, // 0008 CALL R9 1
|
||||
0x8C280107, // 0009 GETMET R10 R0 K7
|
||||
0x7C280200, // 000A CALL R10 1
|
||||
0x7C140A00, // 000B CALL R5 5
|
||||
0x7C0C0400, // 000C CALL R3 2
|
||||
0x80000000, // 000D RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: web_value_ct
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light2_web_value_ct, /* name */
|
||||
be_nested_proto(
|
||||
8, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 7]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(string),
|
||||
/* K1 */ be_nested_str_weak(),
|
||||
/* K2 */ be_nested_str_weak(shadow_ct),
|
||||
/* K3 */ be_const_int(1000000),
|
||||
/* K4 */ be_nested_str_weak(format),
|
||||
/* K5 */ be_nested_str_weak(_X25iK),
|
||||
/* K6 */ be_nested_str_weak(_X26_X239898_X3B_X20),
|
||||
}),
|
||||
be_str_weak(web_value_ct),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[21]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0x58080001, // 0001 LDCONST R2 K1
|
||||
0x880C0102, // 0002 GETMBR R3 R0 K2
|
||||
0x4C100000, // 0003 LDNIL R4
|
||||
0x200C0604, // 0004 NE R3 R3 R4
|
||||
0x780E000C, // 0005 JMPF R3 #0013
|
||||
0x880C0102, // 0006 GETMBR R3 R0 K2
|
||||
0x0C0E0603, // 0007 DIV R3 K3 R3
|
||||
0x54120018, // 0008 LDINT R4 25
|
||||
0x000C0604, // 0009 ADD R3 R3 R4
|
||||
0x54120031, // 000A LDINT R4 50
|
||||
0x0C0C0604, // 000B DIV R3 R3 R4
|
||||
0x54120031, // 000C LDINT R4 50
|
||||
0x080C0604, // 000D MUL R3 R3 R4
|
||||
0x8C100304, // 000E GETMET R4 R1 K4
|
||||
0x58180005, // 000F LDCONST R6 K5
|
||||
0x5C1C0600, // 0010 MOVE R7 R3
|
||||
0x7C100600, // 0011 CALL R4 3
|
||||
0x5C080800, // 0012 MOVE R2 R4
|
||||
0x000E0C02, // 0013 ADD R3 K6 R2
|
||||
0x80040600, // 0014 RET 1 R3
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: set_ct
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light2_set_ct, /* name */
|
||||
be_nested_proto(
|
||||
7, /* nstack */
|
||||
2, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 3]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(call_remote_sync),
|
||||
/* K1 */ be_nested_str_weak(CT),
|
||||
/* K2 */ be_nested_str_weak(parse_update),
|
||||
}),
|
||||
be_str_weak(set_ct),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[14]) { /* code */
|
||||
0x8C080100, // 0000 GETMET R2 R0 K0
|
||||
0x58100001, // 0001 LDCONST R4 K1
|
||||
0x60140008, // 0002 GETGBL R5 G8
|
||||
0x5C180200, // 0003 MOVE R6 R1
|
||||
0x7C140200, // 0004 CALL R5 1
|
||||
0x7C080600, // 0005 CALL R2 3
|
||||
0x4C0C0000, // 0006 LDNIL R3
|
||||
0x200C0403, // 0007 NE R3 R2 R3
|
||||
0x780E0003, // 0008 JMPF R3 #000D
|
||||
0x8C0C0102, // 0009 GETMET R3 R0 K2
|
||||
0x5C140400, // 000A MOVE R5 R2
|
||||
0x541A000A, // 000B LDINT R6 11
|
||||
0x7C0C0600, // 000C CALL R3 3
|
||||
0x80000000, // 000D RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: invoke_request
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light2_invoke_request, /* name */
|
||||
be_nested_proto(
|
||||
12, /* nstack */
|
||||
4, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[13]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(matter),
|
||||
/* K1 */ be_nested_str_weak(TLV),
|
||||
/* K2 */ be_nested_str_weak(cluster),
|
||||
/* K3 */ be_nested_str_weak(command),
|
||||
/* K4 */ be_nested_str_weak(update_shadow_lazy),
|
||||
/* K5 */ be_nested_str_weak(findsubval),
|
||||
/* K6 */ be_const_int(0),
|
||||
/* K7 */ be_nested_str_weak(ct_min),
|
||||
/* K8 */ be_nested_str_weak(ct_max),
|
||||
/* K9 */ be_nested_str_weak(set_ct),
|
||||
/* K10 */ be_nested_str_weak(log),
|
||||
/* K11 */ be_nested_str_weak(ct_X3A),
|
||||
/* K12 */ be_nested_str_weak(invoke_request),
|
||||
}),
|
||||
be_str_weak(invoke_request),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[62]) { /* code */
|
||||
0xB8120000, // 0000 GETNGBL R4 K0
|
||||
0x88100901, // 0001 GETMBR R4 R4 K1
|
||||
0x88140702, // 0002 GETMBR R5 R3 K2
|
||||
0x88180703, // 0003 GETMBR R6 R3 K3
|
||||
0x541E02FF, // 0004 LDINT R7 768
|
||||
0x1C1C0A07, // 0005 EQ R7 R5 R7
|
||||
0x781E002C, // 0006 JMPF R7 #0034
|
||||
0x8C1C0104, // 0007 GETMET R7 R0 K4
|
||||
0x7C1C0200, // 0008 CALL R7 1
|
||||
0x541E0009, // 0009 LDINT R7 10
|
||||
0x1C1C0C07, // 000A EQ R7 R6 R7
|
||||
0x781E0015, // 000B JMPF R7 #0022
|
||||
0x8C1C0505, // 000C GETMET R7 R2 K5
|
||||
0x58240006, // 000D LDCONST R9 K6
|
||||
0x7C1C0400, // 000E CALL R7 2
|
||||
0x88200107, // 000F GETMBR R8 R0 K7
|
||||
0x14200E08, // 0010 LT R8 R7 R8
|
||||
0x78220000, // 0011 JMPF R8 #0013
|
||||
0x881C0107, // 0012 GETMBR R7 R0 K7
|
||||
0x88200108, // 0013 GETMBR R8 R0 K8
|
||||
0x24200E08, // 0014 GT R8 R7 R8
|
||||
0x78220000, // 0015 JMPF R8 #0017
|
||||
0x881C0108, // 0016 GETMBR R7 R0 K8
|
||||
0x8C200109, // 0017 GETMET R8 R0 K9
|
||||
0x5C280E00, // 0018 MOVE R10 R7
|
||||
0x7C200400, // 0019 CALL R8 2
|
||||
0x60200008, // 001A GETGBL R8 G8
|
||||
0x5C240E00, // 001B MOVE R9 R7
|
||||
0x7C200200, // 001C CALL R8 1
|
||||
0x00221608, // 001D ADD R8 K11 R8
|
||||
0x900E1408, // 001E SETMBR R3 K10 R8
|
||||
0x50200200, // 001F LDBOOL R8 1 0
|
||||
0x80041000, // 0020 RET 1 R8
|
||||
0x70020010, // 0021 JMP #0033
|
||||
0x541E0046, // 0022 LDINT R7 71
|
||||
0x1C1C0C07, // 0023 EQ R7 R6 R7
|
||||
0x781E0002, // 0024 JMPF R7 #0028
|
||||
0x501C0200, // 0025 LDBOOL R7 1 0
|
||||
0x80040E00, // 0026 RET 1 R7
|
||||
0x7002000A, // 0027 JMP #0033
|
||||
0x541E004A, // 0028 LDINT R7 75
|
||||
0x1C1C0C07, // 0029 EQ R7 R6 R7
|
||||
0x781E0002, // 002A JMPF R7 #002E
|
||||
0x501C0200, // 002B LDBOOL R7 1 0
|
||||
0x80040E00, // 002C RET 1 R7
|
||||
0x70020004, // 002D JMP #0033
|
||||
0x541E004B, // 002E LDINT R7 76
|
||||
0x1C1C0C07, // 002F EQ R7 R6 R7
|
||||
0x781E0001, // 0030 JMPF R7 #0033
|
||||
0x501C0200, // 0031 LDBOOL R7 1 0
|
||||
0x80040E00, // 0032 RET 1 R7
|
||||
0x70020008, // 0033 JMP #003D
|
||||
0x601C0003, // 0034 GETGBL R7 G3
|
||||
0x5C200000, // 0035 MOVE R8 R0
|
||||
0x7C1C0200, // 0036 CALL R7 1
|
||||
0x8C1C0F0C, // 0037 GETMET R7 R7 K12
|
||||
0x5C240200, // 0038 MOVE R9 R1
|
||||
0x5C280400, // 0039 MOVE R10 R2
|
||||
0x5C2C0600, // 003A MOVE R11 R3
|
||||
0x7C1C0800, // 003B CALL R7 4
|
||||
0x80040E00, // 003C RET 1 R7
|
||||
0x80000000, // 003D RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: update_ct_minmax
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light2_update_ct_minmax, /* name */
|
||||
be_nested_proto(
|
||||
4, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 4]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(tasmota),
|
||||
/* K1 */ be_nested_str_weak(get_option),
|
||||
/* K2 */ be_nested_str_weak(ct_min),
|
||||
/* K3 */ be_nested_str_weak(ct_max),
|
||||
}),
|
||||
be_str_weak(update_ct_minmax),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[15]) { /* code */
|
||||
0xB8060000, // 0000 GETNGBL R1 K0
|
||||
0x8C040301, // 0001 GETMET R1 R1 K1
|
||||
0x540E0051, // 0002 LDINT R3 82
|
||||
0x7C040400, // 0003 CALL R1 2
|
||||
0x78060001, // 0004 JMPF R1 #0007
|
||||
0x540A00C7, // 0005 LDINT R2 200
|
||||
0x70020000, // 0006 JMP #0008
|
||||
0x540A0098, // 0007 LDINT R2 153
|
||||
0x90020402, // 0008 SETMBR R0 K2 R2
|
||||
0x78060001, // 0009 JMPF R1 #000C
|
||||
0x540A017B, // 000A LDINT R2 380
|
||||
0x70020000, // 000B JMP #000D
|
||||
0x540A01F3, // 000C LDINT R2 500
|
||||
0x90020602, // 000D SETMBR R0 K3 R2
|
||||
0x80000000, // 000E RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: read_attribute
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light2_read_attribute, /* name */
|
||||
be_nested_proto(
|
||||
11, /* nstack */
|
||||
3, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[16]) { /* 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_nested_str_weak(update_shadow_lazy),
|
||||
/* K6 */ be_nested_str_weak(shadow_ct),
|
||||
/* K7 */ be_nested_str_weak(create_TLV),
|
||||
/* K8 */ be_nested_str_weak(U1),
|
||||
/* K9 */ be_nested_str_weak(NULL),
|
||||
/* K10 */ be_const_int(2),
|
||||
/* K11 */ be_const_int(0),
|
||||
/* K12 */ be_nested_str_weak(ct_min),
|
||||
/* K13 */ be_nested_str_weak(ct_max),
|
||||
/* K14 */ be_nested_str_weak(U4),
|
||||
/* K15 */ be_nested_str_weak(read_attribute),
|
||||
}),
|
||||
be_str_weak(read_attribute),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[92]) { /* 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
|
||||
0x541E02FF, // 0005 LDINT R7 768
|
||||
0x1C1C0A07, // 0006 EQ R7 R5 R7
|
||||
0x781E004A, // 0007 JMPF R7 #0053
|
||||
0x8C1C0105, // 0008 GETMET R7 R0 K5
|
||||
0x7C1C0200, // 0009 CALL R7 1
|
||||
0x541E0006, // 000A LDINT R7 7
|
||||
0x1C1C0C07, // 000B EQ R7 R6 R7
|
||||
0x781E000F, // 000C JMPF R7 #001D
|
||||
0x881C0106, // 000D GETMBR R7 R0 K6
|
||||
0x4C200000, // 000E LDNIL R8
|
||||
0x201C0E08, // 000F NE R7 R7 R8
|
||||
0x781E0005, // 0010 JMPF R7 #0017
|
||||
0x8C1C0907, // 0011 GETMET R7 R4 K7
|
||||
0x88240908, // 0012 GETMBR R9 R4 K8
|
||||
0x88280106, // 0013 GETMBR R10 R0 K6
|
||||
0x7C1C0600, // 0014 CALL R7 3
|
||||
0x80040E00, // 0015 RET 1 R7
|
||||
0x70020004, // 0016 JMP #001C
|
||||
0x8C1C0907, // 0017 GETMET R7 R4 K7
|
||||
0x88240909, // 0018 GETMBR R9 R4 K9
|
||||
0x4C280000, // 0019 LDNIL R10
|
||||
0x7C1C0600, // 001A CALL R7 3
|
||||
0x80040E00, // 001B RET 1 R7
|
||||
0x70020034, // 001C JMP #0052
|
||||
0x541E0007, // 001D LDINT R7 8
|
||||
0x1C1C0C07, // 001E EQ R7 R6 R7
|
||||
0x781E0005, // 001F JMPF R7 #0026
|
||||
0x8C1C0907, // 0020 GETMET R7 R4 K7
|
||||
0x88240908, // 0021 GETMBR R9 R4 K8
|
||||
0x5828000A, // 0022 LDCONST R10 K10
|
||||
0x7C1C0600, // 0023 CALL R7 3
|
||||
0x80040E00, // 0024 RET 1 R7
|
||||
0x7002002B, // 0025 JMP #0052
|
||||
0x541E000E, // 0026 LDINT R7 15
|
||||
0x1C1C0C07, // 0027 EQ R7 R6 R7
|
||||
0x781E0005, // 0028 JMPF R7 #002F
|
||||
0x8C1C0907, // 0029 GETMET R7 R4 K7
|
||||
0x88240908, // 002A GETMBR R9 R4 K8
|
||||
0x5828000B, // 002B LDCONST R10 K11
|
||||
0x7C1C0600, // 002C CALL R7 3
|
||||
0x80040E00, // 002D RET 1 R7
|
||||
0x70020022, // 002E JMP #0052
|
||||
0x541E400A, // 002F LDINT R7 16395
|
||||
0x1C1C0C07, // 0030 EQ R7 R6 R7
|
||||
0x781E0005, // 0031 JMPF R7 #0038
|
||||
0x8C1C0907, // 0032 GETMET R7 R4 K7
|
||||
0x88240908, // 0033 GETMBR R9 R4 K8
|
||||
0x8828010C, // 0034 GETMBR R10 R0 K12
|
||||
0x7C1C0600, // 0035 CALL R7 3
|
||||
0x80040E00, // 0036 RET 1 R7
|
||||
0x70020019, // 0037 JMP #0052
|
||||
0x541E400B, // 0038 LDINT R7 16396
|
||||
0x1C1C0C07, // 0039 EQ R7 R6 R7
|
||||
0x781E0005, // 003A JMPF R7 #0041
|
||||
0x8C1C0907, // 003B GETMET R7 R4 K7
|
||||
0x88240908, // 003C GETMBR R9 R4 K8
|
||||
0x8828010D, // 003D GETMBR R10 R0 K13
|
||||
0x7C1C0600, // 003E CALL R7 3
|
||||
0x80040E00, // 003F RET 1 R7
|
||||
0x70020010, // 0040 JMP #0052
|
||||
0x541EFFFB, // 0041 LDINT R7 65532
|
||||
0x1C1C0C07, // 0042 EQ R7 R6 R7
|
||||
0x781E0005, // 0043 JMPF R7 #004A
|
||||
0x8C1C0907, // 0044 GETMET R7 R4 K7
|
||||
0x8824090E, // 0045 GETMBR R9 R4 K14
|
||||
0x542A000F, // 0046 LDINT R10 16
|
||||
0x7C1C0600, // 0047 CALL R7 3
|
||||
0x80040E00, // 0048 RET 1 R7
|
||||
0x70020007, // 0049 JMP #0052
|
||||
0x541EFFFC, // 004A LDINT R7 65533
|
||||
0x1C1C0C07, // 004B EQ R7 R6 R7
|
||||
0x781E0004, // 004C JMPF R7 #0052
|
||||
0x8C1C0907, // 004D GETMET R7 R4 K7
|
||||
0x8824090E, // 004E GETMBR R9 R4 K14
|
||||
0x542A0004, // 004F LDINT R10 5
|
||||
0x7C1C0600, // 0050 CALL R7 3
|
||||
0x80040E00, // 0051 RET 1 R7
|
||||
0x70020007, // 0052 JMP #005B
|
||||
0x601C0003, // 0053 GETGBL R7 G3
|
||||
0x5C200000, // 0054 MOVE R8 R0
|
||||
0x7C1C0200, // 0055 CALL R7 1
|
||||
0x8C1C0F0F, // 0056 GETMET R7 R7 K15
|
||||
0x5C240200, // 0057 MOVE R9 R1
|
||||
0x5C280400, // 0058 MOVE R10 R2
|
||||
0x7C1C0600, // 0059 CALL R7 3
|
||||
0x80040E00, // 005A RET 1 R7
|
||||
0x80000000, // 005B RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified class: Matter_Plugin_Bridge_Light2
|
||||
********************************************************************/
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_Light1;
|
||||
be_local_class(Matter_Plugin_Bridge_Light2,
|
||||
3,
|
||||
&be_class_Matter_Plugin_Bridge_Light1,
|
||||
be_nested_map(15,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Bridge_Light2_init_closure) },
|
||||
{ be_const_key_weak(parse_update, 10), be_const_closure(Matter_Plugin_Bridge_Light2_parse_update_closure) },
|
||||
{ be_const_key_weak(web_values, 11), be_const_closure(Matter_Plugin_Bridge_Light2_web_values_closure) },
|
||||
{ be_const_key_weak(ct_max, -1), be_const_var(2) },
|
||||
{ be_const_key_weak(CLUSTERS, 14), 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(768, -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(7),
|
||||
be_const_int(8),
|
||||
be_const_int(15),
|
||||
be_const_int(16395),
|
||||
be_const_int(16396),
|
||||
be_const_int(65532),
|
||||
be_const_int(65533),
|
||||
})) ) } )) },
|
||||
})) ) } )) },
|
||||
{ be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
|
||||
be_const_map( * be_nested_map(2,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_int(268, -1), be_const_int(2) },
|
||||
{ be_const_key_int(19, -1), be_const_int(1) },
|
||||
})) ) } )) },
|
||||
{ be_const_key_weak(web_value_ct, -1), be_const_closure(Matter_Plugin_Bridge_Light2_web_value_ct_closure) },
|
||||
{ be_const_key_weak(set_ct, -1), be_const_closure(Matter_Plugin_Bridge_Light2_set_ct_closure) },
|
||||
{ be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Bridge_Light2_read_attribute_closure) },
|
||||
{ be_const_key_weak(NAME, -1), be_nested_str_weak(_X26_X23x1F517_X3B_X20Light_X202_X20CT) },
|
||||
{ be_const_key_weak(shadow_ct, -1), be_const_var(0) },
|
||||
{ be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Bridge_Light2_invoke_request_closure) },
|
||||
{ be_const_key_weak(update_ct_minmax, 8), be_const_closure(Matter_Plugin_Bridge_Light2_update_ct_minmax_closure) },
|
||||
{ be_const_key_weak(ct_min, -1), be_const_var(1) },
|
||||
{ be_const_key_weak(TYPE, -1), be_nested_str_weak(http_light2) },
|
||||
})),
|
||||
be_str_weak(Matter_Plugin_Bridge_Light2)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
void be_load_Matter_Plugin_Bridge_Light2_class(bvm *vm) {
|
||||
be_pushntvclass(vm, &be_class_Matter_Plugin_Bridge_Light2);
|
||||
be_setglobal(vm, "Matter_Plugin_Bridge_Light2");
|
||||
be_pop(vm, 1);
|
||||
}
|
||||
/********************************************************************/
|
||||
/* End of solidification */
|
|
@ -0,0 +1,752 @@
|
|||
/* Solidification of Matter_Plugin_Bridge_Light3.h */
|
||||
/********************************************************************\
|
||||
* Generated code, don't edit *
|
||||
\********************************************************************/
|
||||
#include "be_constobj.h"
|
||||
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_Light3;
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: set_sat
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light3_set_sat, /* name */
|
||||
be_nested_proto(
|
||||
9, /* nstack */
|
||||
2, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 6]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(tasmota),
|
||||
/* K1 */ be_nested_str_weak(scale_uint),
|
||||
/* K2 */ be_const_int(0),
|
||||
/* K3 */ be_nested_str_weak(call_remote_sync),
|
||||
/* K4 */ be_nested_str_weak(HSBColor2),
|
||||
/* K5 */ be_nested_str_weak(parse_update),
|
||||
}),
|
||||
be_str_weak(set_sat),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[20]) { /* code */
|
||||
0xB80A0000, // 0000 GETNGBL R2 K0
|
||||
0x8C080501, // 0001 GETMET R2 R2 K1
|
||||
0x5C100200, // 0002 MOVE R4 R1
|
||||
0x58140002, // 0003 LDCONST R5 K2
|
||||
0x541A00FD, // 0004 LDINT R6 254
|
||||
0x581C0002, // 0005 LDCONST R7 K2
|
||||
0x54220063, // 0006 LDINT R8 100
|
||||
0x7C080C00, // 0007 CALL R2 6
|
||||
0x8C0C0103, // 0008 GETMET R3 R0 K3
|
||||
0x58140004, // 0009 LDCONST R5 K4
|
||||
0x5C180400, // 000A MOVE R6 R2
|
||||
0x7C0C0600, // 000B CALL R3 3
|
||||
0x4C100000, // 000C LDNIL R4
|
||||
0x20100604, // 000D NE R4 R3 R4
|
||||
0x78120003, // 000E JMPF R4 #0013
|
||||
0x8C100105, // 000F GETMET R4 R0 K5
|
||||
0x5C180600, // 0010 MOVE R6 R3
|
||||
0x541E000A, // 0011 LDINT R7 11
|
||||
0x7C100600, // 0012 CALL R4 3
|
||||
0x80000000, // 0013 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: parse_update
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light3_parse_update, /* name */
|
||||
be_nested_proto(
|
||||
15, /* nstack */
|
||||
3, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[13]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(parse_update),
|
||||
/* K1 */ be_nested_str_weak(find),
|
||||
/* K2 */ be_nested_str_weak(HSBColor),
|
||||
/* K3 */ be_nested_str_weak(string),
|
||||
/* K4 */ be_nested_str_weak(split),
|
||||
/* K5 */ be_nested_str_weak(_X2C),
|
||||
/* K6 */ be_const_int(0),
|
||||
/* K7 */ be_const_int(1),
|
||||
/* K8 */ be_nested_str_weak(tasmota),
|
||||
/* K9 */ be_nested_str_weak(scale_uint),
|
||||
/* K10 */ be_nested_str_weak(shadow_hue),
|
||||
/* K11 */ be_nested_str_weak(shadow_sat),
|
||||
/* K12 */ be_nested_str_weak(attribute_updated),
|
||||
}),
|
||||
be_str_weak(parse_update),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[70]) { /* code */
|
||||
0x600C0003, // 0000 GETGBL R3 G3
|
||||
0x5C100000, // 0001 MOVE R4 R0
|
||||
0x7C0C0200, // 0002 CALL R3 1
|
||||
0x8C0C0700, // 0003 GETMET R3 R3 K0
|
||||
0x5C140200, // 0004 MOVE R5 R1
|
||||
0x5C180400, // 0005 MOVE R6 R2
|
||||
0x7C0C0600, // 0006 CALL R3 3
|
||||
0x540E000A, // 0007 LDINT R3 11
|
||||
0x1C0C0403, // 0008 EQ R3 R2 R3
|
||||
0x780E003A, // 0009 JMPF R3 #0045
|
||||
0x8C0C0301, // 000A GETMET R3 R1 K1
|
||||
0x58140002, // 000B LDCONST R5 K2
|
||||
0x7C0C0400, // 000C CALL R3 2
|
||||
0x780E0036, // 000D JMPF R3 #0045
|
||||
0xA4120600, // 000E IMPORT R4 K3
|
||||
0x8C140904, // 000F GETMET R5 R4 K4
|
||||
0x5C1C0600, // 0010 MOVE R7 R3
|
||||
0x58200005, // 0011 LDCONST R8 K5
|
||||
0x7C140600, // 0012 CALL R5 3
|
||||
0x60180009, // 0013 GETGBL R6 G9
|
||||
0x941C0B06, // 0014 GETIDX R7 R5 K6
|
||||
0x7C180200, // 0015 CALL R6 1
|
||||
0x601C0009, // 0016 GETGBL R7 G9
|
||||
0x94200B07, // 0017 GETIDX R8 R5 K7
|
||||
0x7C1C0200, // 0018 CALL R7 1
|
||||
0x4C200000, // 0019 LDNIL R8
|
||||
0x20200C08, // 001A NE R8 R6 R8
|
||||
0x78220009, // 001B JMPF R8 #0026
|
||||
0xB8221000, // 001C GETNGBL R8 K8
|
||||
0x8C201109, // 001D GETMET R8 R8 K9
|
||||
0x5C280C00, // 001E MOVE R10 R6
|
||||
0x582C0006, // 001F LDCONST R11 K6
|
||||
0x54320167, // 0020 LDINT R12 360
|
||||
0x58340006, // 0021 LDCONST R13 K6
|
||||
0x543A00FD, // 0022 LDINT R14 254
|
||||
0x7C200C00, // 0023 CALL R8 6
|
||||
0x5C181000, // 0024 MOVE R6 R8
|
||||
0x70020000, // 0025 JMP #0027
|
||||
0x8818010A, // 0026 GETMBR R6 R0 K10
|
||||
0x4C200000, // 0027 LDNIL R8
|
||||
0x20200E08, // 0028 NE R8 R7 R8
|
||||
0x78220009, // 0029 JMPF R8 #0034
|
||||
0xB8221000, // 002A GETNGBL R8 K8
|
||||
0x8C201109, // 002B GETMET R8 R8 K9
|
||||
0x5C280E00, // 002C MOVE R10 R7
|
||||
0x582C0006, // 002D LDCONST R11 K6
|
||||
0x54320063, // 002E LDINT R12 100
|
||||
0x58340006, // 002F LDCONST R13 K6
|
||||
0x543A00FD, // 0030 LDINT R14 254
|
||||
0x7C200C00, // 0031 CALL R8 6
|
||||
0x5C1C1000, // 0032 MOVE R7 R8
|
||||
0x70020000, // 0033 JMP #0035
|
||||
0x881C010B, // 0034 GETMBR R7 R0 K11
|
||||
0x8820010A, // 0035 GETMBR R8 R0 K10
|
||||
0x20200C08, // 0036 NE R8 R6 R8
|
||||
0x78220004, // 0037 JMPF R8 #003D
|
||||
0x8C20010C, // 0038 GETMET R8 R0 K12
|
||||
0x542A02FF, // 0039 LDINT R10 768
|
||||
0x582C0006, // 003A LDCONST R11 K6
|
||||
0x7C200600, // 003B CALL R8 3
|
||||
0x90021406, // 003C SETMBR R0 K10 R6
|
||||
0x8820010B, // 003D GETMBR R8 R0 K11
|
||||
0x20200E08, // 003E NE R8 R7 R8
|
||||
0x78220004, // 003F JMPF R8 #0045
|
||||
0x8C20010C, // 0040 GETMET R8 R0 K12
|
||||
0x542A02FF, // 0041 LDINT R10 768
|
||||
0x582C0007, // 0042 LDCONST R11 K7
|
||||
0x7C200600, // 0043 CALL R8 3
|
||||
0x90021607, // 0044 SETMBR R0 K11 R7
|
||||
0x80000000, // 0045 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: web_values
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light3_web_values, /* name */
|
||||
be_nested_proto(
|
||||
12, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 8]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(webserver),
|
||||
/* K1 */ be_nested_str_weak(string),
|
||||
/* K2 */ be_nested_str_weak(content_send),
|
||||
/* K3 */ be_nested_str_weak(format),
|
||||
/* K4 */ be_nested_str_weak(_X7C_X20Light_X20_X25s_X20_X25s_X20_X25s),
|
||||
/* K5 */ be_nested_str_weak(web_value_onoff),
|
||||
/* K6 */ be_nested_str_weak(web_value_dimmer),
|
||||
/* K7 */ be_nested_str_weak(web_value_RGB),
|
||||
}),
|
||||
be_str_weak(web_values),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[14]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0xA40A0200, // 0001 IMPORT R2 K1
|
||||
0x8C0C0302, // 0002 GETMET R3 R1 K2
|
||||
0x8C140503, // 0003 GETMET R5 R2 K3
|
||||
0x581C0004, // 0004 LDCONST R7 K4
|
||||
0x8C200105, // 0005 GETMET R8 R0 K5
|
||||
0x7C200200, // 0006 CALL R8 1
|
||||
0x8C240106, // 0007 GETMET R9 R0 K6
|
||||
0x7C240200, // 0008 CALL R9 1
|
||||
0x8C280107, // 0009 GETMET R10 R0 K7
|
||||
0x7C280200, // 000A CALL R10 1
|
||||
0x7C140A00, // 000B CALL R5 5
|
||||
0x7C0C0400, // 000C CALL R3 2
|
||||
0x80000000, // 000D RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: web_value_RGB
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light3_web_value_RGB, /* name */
|
||||
be_nested_proto(
|
||||
13, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[17]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(string),
|
||||
/* K1 */ be_nested_str_weak(shadow_hue),
|
||||
/* K2 */ be_nested_str_weak(shadow_sat),
|
||||
/* K3 */ be_nested_str_weak(light_state),
|
||||
/* K4 */ be_const_int(3),
|
||||
/* K5 */ be_nested_str_weak(set_bri),
|
||||
/* K6 */ be_nested_str_weak(set_huesat),
|
||||
/* K7 */ be_nested_str_weak(tasmota),
|
||||
/* K8 */ be_nested_str_weak(scale_uint),
|
||||
/* K9 */ be_const_int(0),
|
||||
/* K10 */ be_nested_str_weak(format),
|
||||
/* K11 */ be_nested_str_weak(_X23_X2502X_X2502X_X2502X),
|
||||
/* K12 */ be_nested_str_weak(r),
|
||||
/* K13 */ be_nested_str_weak(g),
|
||||
/* K14 */ be_nested_str_weak(b),
|
||||
/* K15 */ be_nested_str_weak(_X3Ci_X20class_X3D_X22bxm_X22_X20style_X3D_X22_X2D_X2Dcl_X3A_X25s_X22_X3E_X3C_X2Fi_X3E_X25s),
|
||||
/* K16 */ be_nested_str_weak(),
|
||||
}),
|
||||
be_str_weak(web_value_RGB),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[46]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0x88080101, // 0001 GETMBR R2 R0 K1
|
||||
0x4C0C0000, // 0002 LDNIL R3
|
||||
0x20080403, // 0003 NE R2 R2 R3
|
||||
0x780A0027, // 0004 JMPF R2 #002D
|
||||
0x88080102, // 0005 GETMBR R2 R0 K2
|
||||
0x4C0C0000, // 0006 LDNIL R3
|
||||
0x20080403, // 0007 NE R2 R2 R3
|
||||
0x780A0023, // 0008 JMPF R2 #002D
|
||||
0xB80A0600, // 0009 GETNGBL R2 K3
|
||||
0x580C0004, // 000A LDCONST R3 K4
|
||||
0x7C080200, // 000B CALL R2 1
|
||||
0x8C0C0505, // 000C GETMET R3 R2 K5
|
||||
0x541600FE, // 000D LDINT R5 255
|
||||
0x7C0C0400, // 000E CALL R3 2
|
||||
0x8C0C0506, // 000F GETMET R3 R2 K6
|
||||
0xB8160E00, // 0010 GETNGBL R5 K7
|
||||
0x8C140B08, // 0011 GETMET R5 R5 K8
|
||||
0x881C0101, // 0012 GETMBR R7 R0 K1
|
||||
0x58200009, // 0013 LDCONST R8 K9
|
||||
0x542600FD, // 0014 LDINT R9 254
|
||||
0x58280009, // 0015 LDCONST R10 K9
|
||||
0x542E0167, // 0016 LDINT R11 360
|
||||
0x7C140C00, // 0017 CALL R5 6
|
||||
0xB81A0E00, // 0018 GETNGBL R6 K7
|
||||
0x8C180D08, // 0019 GETMET R6 R6 K8
|
||||
0x88200102, // 001A GETMBR R8 R0 K2
|
||||
0x58240009, // 001B LDCONST R9 K9
|
||||
0x542A00FD, // 001C LDINT R10 254
|
||||
0x582C0009, // 001D LDCONST R11 K9
|
||||
0x543200FE, // 001E LDINT R12 255
|
||||
0x7C180C00, // 001F CALL R6 6
|
||||
0x7C0C0600, // 0020 CALL R3 3
|
||||
0x8C0C030A, // 0021 GETMET R3 R1 K10
|
||||
0x5814000B, // 0022 LDCONST R5 K11
|
||||
0x8818050C, // 0023 GETMBR R6 R2 K12
|
||||
0x881C050D, // 0024 GETMBR R7 R2 K13
|
||||
0x8820050E, // 0025 GETMBR R8 R2 K14
|
||||
0x7C0C0A00, // 0026 CALL R3 5
|
||||
0x8C10030A, // 0027 GETMET R4 R1 K10
|
||||
0x5818000F, // 0028 LDCONST R6 K15
|
||||
0x5C1C0600, // 0029 MOVE R7 R3
|
||||
0x5C200600, // 002A MOVE R8 R3
|
||||
0x7C100800, // 002B CALL R4 4
|
||||
0x80040800, // 002C RET 1 R4
|
||||
0x80062000, // 002D RET 1 K16
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: invoke_request
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light3_invoke_request, /* name */
|
||||
be_nested_proto(
|
||||
12, /* nstack */
|
||||
4, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[17]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(matter),
|
||||
/* K1 */ be_nested_str_weak(TLV),
|
||||
/* K2 */ be_nested_str_weak(cluster),
|
||||
/* K3 */ be_nested_str_weak(command),
|
||||
/* K4 */ be_nested_str_weak(update_shadow_lazy),
|
||||
/* K5 */ be_const_int(0),
|
||||
/* K6 */ be_nested_str_weak(findsubval),
|
||||
/* K7 */ be_nested_str_weak(set_hue),
|
||||
/* K8 */ be_nested_str_weak(log),
|
||||
/* K9 */ be_nested_str_weak(hue_X3A),
|
||||
/* K10 */ be_const_int(1),
|
||||
/* K11 */ be_const_int(2),
|
||||
/* K12 */ be_const_int(3),
|
||||
/* K13 */ be_nested_str_weak(set_sat),
|
||||
/* K14 */ be_nested_str_weak(sat_X3A),
|
||||
/* K15 */ be_nested_str_weak(_X20sat_X3A),
|
||||
/* K16 */ be_nested_str_weak(invoke_request),
|
||||
}),
|
||||
be_str_weak(invoke_request),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[107]) { /* code */
|
||||
0xB8120000, // 0000 GETNGBL R4 K0
|
||||
0x88100901, // 0001 GETMBR R4 R4 K1
|
||||
0x88140702, // 0002 GETMBR R5 R3 K2
|
||||
0x88180703, // 0003 GETMBR R6 R3 K3
|
||||
0x541E02FF, // 0004 LDINT R7 768
|
||||
0x1C1C0A07, // 0005 EQ R7 R5 R7
|
||||
0x781E0059, // 0006 JMPF R7 #0061
|
||||
0x8C1C0104, // 0007 GETMET R7 R0 K4
|
||||
0x7C1C0200, // 0008 CALL R7 1
|
||||
0x1C1C0D05, // 0009 EQ R7 R6 K5
|
||||
0x781E000D, // 000A JMPF R7 #0019
|
||||
0x8C1C0506, // 000B GETMET R7 R2 K6
|
||||
0x58240005, // 000C LDCONST R9 K5
|
||||
0x7C1C0400, // 000D CALL R7 2
|
||||
0x8C200107, // 000E GETMET R8 R0 K7
|
||||
0x5C280E00, // 000F MOVE R10 R7
|
||||
0x7C200400, // 0010 CALL R8 2
|
||||
0x60200008, // 0011 GETGBL R8 G8
|
||||
0x5C240E00, // 0012 MOVE R9 R7
|
||||
0x7C200200, // 0013 CALL R8 1
|
||||
0x00221208, // 0014 ADD R8 K9 R8
|
||||
0x900E1008, // 0015 SETMBR R3 K8 R8
|
||||
0x50200200, // 0016 LDBOOL R8 1 0
|
||||
0x80041000, // 0017 RET 1 R8
|
||||
0x70020046, // 0018 JMP #0060
|
||||
0x1C1C0D0A, // 0019 EQ R7 R6 K10
|
||||
0x781E0002, // 001A JMPF R7 #001E
|
||||
0x501C0200, // 001B LDBOOL R7 1 0
|
||||
0x80040E00, // 001C RET 1 R7
|
||||
0x70020041, // 001D JMP #0060
|
||||
0x1C1C0D0B, // 001E EQ R7 R6 K11
|
||||
0x781E0002, // 001F JMPF R7 #0023
|
||||
0x501C0200, // 0020 LDBOOL R7 1 0
|
||||
0x80040E00, // 0021 RET 1 R7
|
||||
0x7002003C, // 0022 JMP #0060
|
||||
0x1C1C0D0C, // 0023 EQ R7 R6 K12
|
||||
0x781E000D, // 0024 JMPF R7 #0033
|
||||
0x8C1C0506, // 0025 GETMET R7 R2 K6
|
||||
0x58240005, // 0026 LDCONST R9 K5
|
||||
0x7C1C0400, // 0027 CALL R7 2
|
||||
0x8C20010D, // 0028 GETMET R8 R0 K13
|
||||
0x5C280E00, // 0029 MOVE R10 R7
|
||||
0x7C200400, // 002A CALL R8 2
|
||||
0x60200008, // 002B GETGBL R8 G8
|
||||
0x5C240E00, // 002C MOVE R9 R7
|
||||
0x7C200200, // 002D CALL R8 1
|
||||
0x00221C08, // 002E ADD R8 K14 R8
|
||||
0x900E1008, // 002F SETMBR R3 K8 R8
|
||||
0x50200200, // 0030 LDBOOL R8 1 0
|
||||
0x80041000, // 0031 RET 1 R8
|
||||
0x7002002C, // 0032 JMP #0060
|
||||
0x541E0003, // 0033 LDINT R7 4
|
||||
0x1C1C0C07, // 0034 EQ R7 R6 R7
|
||||
0x781E0002, // 0035 JMPF R7 #0039
|
||||
0x501C0200, // 0036 LDBOOL R7 1 0
|
||||
0x80040E00, // 0037 RET 1 R7
|
||||
0x70020026, // 0038 JMP #0060
|
||||
0x541E0004, // 0039 LDINT R7 5
|
||||
0x1C1C0C07, // 003A EQ R7 R6 R7
|
||||
0x781E0002, // 003B JMPF R7 #003F
|
||||
0x501C0200, // 003C LDBOOL R7 1 0
|
||||
0x80040E00, // 003D RET 1 R7
|
||||
0x70020020, // 003E JMP #0060
|
||||
0x541E0005, // 003F LDINT R7 6
|
||||
0x1C1C0C07, // 0040 EQ R7 R6 R7
|
||||
0x781E0018, // 0041 JMPF R7 #005B
|
||||
0x8C1C0506, // 0042 GETMET R7 R2 K6
|
||||
0x58240005, // 0043 LDCONST R9 K5
|
||||
0x7C1C0400, // 0044 CALL R7 2
|
||||
0x8C200506, // 0045 GETMET R8 R2 K6
|
||||
0x5828000A, // 0046 LDCONST R10 K10
|
||||
0x7C200400, // 0047 CALL R8 2
|
||||
0x8C240107, // 0048 GETMET R9 R0 K7
|
||||
0x5C2C0E00, // 0049 MOVE R11 R7
|
||||
0x7C240400, // 004A CALL R9 2
|
||||
0x8C24010D, // 004B GETMET R9 R0 K13
|
||||
0x5C2C1000, // 004C MOVE R11 R8
|
||||
0x7C240400, // 004D CALL R9 2
|
||||
0x60240008, // 004E GETGBL R9 G8
|
||||
0x5C280E00, // 004F MOVE R10 R7
|
||||
0x7C240200, // 0050 CALL R9 1
|
||||
0x00261209, // 0051 ADD R9 K9 R9
|
||||
0x0024130F, // 0052 ADD R9 R9 K15
|
||||
0x60280008, // 0053 GETGBL R10 G8
|
||||
0x5C2C1000, // 0054 MOVE R11 R8
|
||||
0x7C280200, // 0055 CALL R10 1
|
||||
0x0024120A, // 0056 ADD R9 R9 R10
|
||||
0x900E1009, // 0057 SETMBR R3 K8 R9
|
||||
0x50240200, // 0058 LDBOOL R9 1 0
|
||||
0x80041200, // 0059 RET 1 R9
|
||||
0x70020004, // 005A JMP #0060
|
||||
0x541E0046, // 005B LDINT R7 71
|
||||
0x1C1C0C07, // 005C EQ R7 R6 R7
|
||||
0x781E0001, // 005D JMPF R7 #0060
|
||||
0x501C0200, // 005E LDBOOL R7 1 0
|
||||
0x80040E00, // 005F RET 1 R7
|
||||
0x70020008, // 0060 JMP #006A
|
||||
0x601C0003, // 0061 GETGBL R7 G3
|
||||
0x5C200000, // 0062 MOVE R8 R0
|
||||
0x7C1C0200, // 0063 CALL R7 1
|
||||
0x8C1C0F10, // 0064 GETMET R7 R7 K16
|
||||
0x5C240200, // 0065 MOVE R9 R1
|
||||
0x5C280400, // 0066 MOVE R10 R2
|
||||
0x5C2C0600, // 0067 MOVE R11 R3
|
||||
0x7C1C0800, // 0068 CALL R7 4
|
||||
0x80040E00, // 0069 RET 1 R7
|
||||
0x80000000, // 006A RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: read_attribute
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light3_read_attribute, /* name */
|
||||
be_nested_proto(
|
||||
11, /* nstack */
|
||||
3, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[15]) { /* 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_nested_str_weak(update_shadow_lazy),
|
||||
/* K6 */ be_const_int(0),
|
||||
/* K7 */ be_nested_str_weak(shadow_hue),
|
||||
/* K8 */ be_nested_str_weak(create_TLV),
|
||||
/* K9 */ be_nested_str_weak(U1),
|
||||
/* K10 */ be_nested_str_weak(NULL),
|
||||
/* K11 */ be_const_int(1),
|
||||
/* K12 */ be_nested_str_weak(shadow_sat),
|
||||
/* K13 */ be_nested_str_weak(U4),
|
||||
/* K14 */ be_nested_str_weak(read_attribute),
|
||||
}),
|
||||
be_str_weak(read_attribute),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[127]) { /* 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
|
||||
0x541E02FF, // 0005 LDINT R7 768
|
||||
0x1C1C0A07, // 0006 EQ R7 R5 R7
|
||||
0x781E006D, // 0007 JMPF R7 #0076
|
||||
0x8C1C0105, // 0008 GETMET R7 R0 K5
|
||||
0x7C1C0200, // 0009 CALL R7 1
|
||||
0x1C1C0D06, // 000A EQ R7 R6 K6
|
||||
0x781E000F, // 000B JMPF R7 #001C
|
||||
0x881C0107, // 000C GETMBR R7 R0 K7
|
||||
0x4C200000, // 000D LDNIL R8
|
||||
0x201C0E08, // 000E NE R7 R7 R8
|
||||
0x781E0005, // 000F JMPF R7 #0016
|
||||
0x8C1C0908, // 0010 GETMET R7 R4 K8
|
||||
0x88240909, // 0011 GETMBR R9 R4 K9
|
||||
0x88280107, // 0012 GETMBR R10 R0 K7
|
||||
0x7C1C0600, // 0013 CALL R7 3
|
||||
0x80040E00, // 0014 RET 1 R7
|
||||
0x70020004, // 0015 JMP #001B
|
||||
0x8C1C0908, // 0016 GETMET R7 R4 K8
|
||||
0x8824090A, // 0017 GETMBR R9 R4 K10
|
||||
0x4C280000, // 0018 LDNIL R10
|
||||
0x7C1C0600, // 0019 CALL R7 3
|
||||
0x80040E00, // 001A RET 1 R7
|
||||
0x70020058, // 001B JMP #0075
|
||||
0x1C1C0D0B, // 001C EQ R7 R6 K11
|
||||
0x781E000F, // 001D JMPF R7 #002E
|
||||
0x881C010C, // 001E GETMBR R7 R0 K12
|
||||
0x4C200000, // 001F LDNIL R8
|
||||
0x201C0E08, // 0020 NE R7 R7 R8
|
||||
0x781E0005, // 0021 JMPF R7 #0028
|
||||
0x8C1C0908, // 0022 GETMET R7 R4 K8
|
||||
0x88240909, // 0023 GETMBR R9 R4 K9
|
||||
0x8828010C, // 0024 GETMBR R10 R0 K12
|
||||
0x7C1C0600, // 0025 CALL R7 3
|
||||
0x80040E00, // 0026 RET 1 R7
|
||||
0x70020004, // 0027 JMP #002D
|
||||
0x8C1C0908, // 0028 GETMET R7 R4 K8
|
||||
0x8824090A, // 0029 GETMBR R9 R4 K10
|
||||
0x4C280000, // 002A LDNIL R10
|
||||
0x7C1C0600, // 002B CALL R7 3
|
||||
0x80040E00, // 002C RET 1 R7
|
||||
0x70020046, // 002D JMP #0075
|
||||
0x541E0006, // 002E LDINT R7 7
|
||||
0x1C1C0C07, // 002F EQ R7 R6 R7
|
||||
0x781E0005, // 0030 JMPF R7 #0037
|
||||
0x8C1C0908, // 0031 GETMET R7 R4 K8
|
||||
0x88240909, // 0032 GETMBR R9 R4 K9
|
||||
0x58280006, // 0033 LDCONST R10 K6
|
||||
0x7C1C0600, // 0034 CALL R7 3
|
||||
0x80040E00, // 0035 RET 1 R7
|
||||
0x7002003D, // 0036 JMP #0075
|
||||
0x541E0007, // 0037 LDINT R7 8
|
||||
0x1C1C0C07, // 0038 EQ R7 R6 R7
|
||||
0x781E0005, // 0039 JMPF R7 #0040
|
||||
0x8C1C0908, // 003A GETMET R7 R4 K8
|
||||
0x88240909, // 003B GETMBR R9 R4 K9
|
||||
0x58280006, // 003C LDCONST R10 K6
|
||||
0x7C1C0600, // 003D CALL R7 3
|
||||
0x80040E00, // 003E RET 1 R7
|
||||
0x70020034, // 003F JMP #0075
|
||||
0x541E000E, // 0040 LDINT R7 15
|
||||
0x1C1C0C07, // 0041 EQ R7 R6 R7
|
||||
0x781E0005, // 0042 JMPF R7 #0049
|
||||
0x8C1C0908, // 0043 GETMET R7 R4 K8
|
||||
0x88240909, // 0044 GETMBR R9 R4 K9
|
||||
0x58280006, // 0045 LDCONST R10 K6
|
||||
0x7C1C0600, // 0046 CALL R7 3
|
||||
0x80040E00, // 0047 RET 1 R7
|
||||
0x7002002B, // 0048 JMP #0075
|
||||
0x541E4000, // 0049 LDINT R7 16385
|
||||
0x1C1C0C07, // 004A EQ R7 R6 R7
|
||||
0x781E0005, // 004B JMPF R7 #0052
|
||||
0x8C1C0908, // 004C GETMET R7 R4 K8
|
||||
0x88240909, // 004D GETMBR R9 R4 K9
|
||||
0x58280006, // 004E LDCONST R10 K6
|
||||
0x7C1C0600, // 004F CALL R7 3
|
||||
0x80040E00, // 0050 RET 1 R7
|
||||
0x70020022, // 0051 JMP #0075
|
||||
0x541E4009, // 0052 LDINT R7 16394
|
||||
0x1C1C0C07, // 0053 EQ R7 R6 R7
|
||||
0x781E0005, // 0054 JMPF R7 #005B
|
||||
0x8C1C0908, // 0055 GETMET R7 R4 K8
|
||||
0x88240909, // 0056 GETMBR R9 R4 K9
|
||||
0x58280006, // 0057 LDCONST R10 K6
|
||||
0x7C1C0600, // 0058 CALL R7 3
|
||||
0x80040E00, // 0059 RET 1 R7
|
||||
0x70020019, // 005A JMP #0075
|
||||
0x541E000F, // 005B LDINT R7 16
|
||||
0x1C1C0C07, // 005C EQ R7 R6 R7
|
||||
0x781E0005, // 005D JMPF R7 #0064
|
||||
0x8C1C0908, // 005E GETMET R7 R4 K8
|
||||
0x88240909, // 005F GETMBR R9 R4 K9
|
||||
0x58280006, // 0060 LDCONST R10 K6
|
||||
0x7C1C0600, // 0061 CALL R7 3
|
||||
0x80040E00, // 0062 RET 1 R7
|
||||
0x70020010, // 0063 JMP #0075
|
||||
0x541EFFFB, // 0064 LDINT R7 65532
|
||||
0x1C1C0C07, // 0065 EQ R7 R6 R7
|
||||
0x781E0005, // 0066 JMPF R7 #006D
|
||||
0x8C1C0908, // 0067 GETMET R7 R4 K8
|
||||
0x8824090D, // 0068 GETMBR R9 R4 K13
|
||||
0x5828000B, // 0069 LDCONST R10 K11
|
||||
0x7C1C0600, // 006A CALL R7 3
|
||||
0x80040E00, // 006B RET 1 R7
|
||||
0x70020007, // 006C JMP #0075
|
||||
0x541EFFFC, // 006D LDINT R7 65533
|
||||
0x1C1C0C07, // 006E EQ R7 R6 R7
|
||||
0x781E0004, // 006F JMPF R7 #0075
|
||||
0x8C1C0908, // 0070 GETMET R7 R4 K8
|
||||
0x8824090D, // 0071 GETMBR R9 R4 K13
|
||||
0x542A0004, // 0072 LDINT R10 5
|
||||
0x7C1C0600, // 0073 CALL R7 3
|
||||
0x80040E00, // 0074 RET 1 R7
|
||||
0x70020007, // 0075 JMP #007E
|
||||
0x601C0003, // 0076 GETGBL R7 G3
|
||||
0x5C200000, // 0077 MOVE R8 R0
|
||||
0x7C1C0200, // 0078 CALL R7 1
|
||||
0x8C1C0F0E, // 0079 GETMET R7 R7 K14
|
||||
0x5C240200, // 007A MOVE R9 R1
|
||||
0x5C280400, // 007B MOVE R10 R2
|
||||
0x7C1C0600, // 007C CALL R7 3
|
||||
0x80040E00, // 007D RET 1 R7
|
||||
0x80000000, // 007E RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: set_hue
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light3_set_hue, /* name */
|
||||
be_nested_proto(
|
||||
9, /* nstack */
|
||||
2, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 6]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(tasmota),
|
||||
/* K1 */ be_nested_str_weak(scale_uint),
|
||||
/* K2 */ be_const_int(0),
|
||||
/* K3 */ be_nested_str_weak(call_remote_sync),
|
||||
/* K4 */ be_nested_str_weak(HSBColor1),
|
||||
/* K5 */ be_nested_str_weak(parse_update),
|
||||
}),
|
||||
be_str_weak(set_hue),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[20]) { /* code */
|
||||
0xB80A0000, // 0000 GETNGBL R2 K0
|
||||
0x8C080501, // 0001 GETMET R2 R2 K1
|
||||
0x5C100200, // 0002 MOVE R4 R1
|
||||
0x58140002, // 0003 LDCONST R5 K2
|
||||
0x541A00FD, // 0004 LDINT R6 254
|
||||
0x581C0002, // 0005 LDCONST R7 K2
|
||||
0x54220167, // 0006 LDINT R8 360
|
||||
0x7C080C00, // 0007 CALL R2 6
|
||||
0x8C0C0103, // 0008 GETMET R3 R0 K3
|
||||
0x58140004, // 0009 LDCONST R5 K4
|
||||
0x5C180400, // 000A MOVE R6 R2
|
||||
0x7C0C0600, // 000B CALL R3 3
|
||||
0x4C100000, // 000C LDNIL R4
|
||||
0x20100604, // 000D NE R4 R3 R4
|
||||
0x78120003, // 000E JMPF R4 #0013
|
||||
0x8C100105, // 000F GETMET R4 R0 K5
|
||||
0x5C180600, // 0010 MOVE R6 R3
|
||||
0x541E000A, // 0011 LDINT R7 11
|
||||
0x7C100600, // 0012 CALL R4 3
|
||||
0x80000000, // 0013 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: init
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Light3_init, /* name */
|
||||
be_nested_proto(
|
||||
9, /* nstack */
|
||||
4, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 1]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(init),
|
||||
}),
|
||||
be_str_weak(init),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[ 9]) { /* 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
|
||||
0x80000000, // 0008 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified class: Matter_Plugin_Bridge_Light3
|
||||
********************************************************************/
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_Light1;
|
||||
be_local_class(Matter_Plugin_Bridge_Light3,
|
||||
2,
|
||||
&be_class_Matter_Plugin_Bridge_Light1,
|
||||
be_nested_map(14,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_weak(set_sat, 12), be_const_closure(Matter_Plugin_Bridge_Light3_set_sat_closure) },
|
||||
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Bridge_Light3_init_closure) },
|
||||
{ be_const_key_weak(parse_update, -1), be_const_closure(Matter_Plugin_Bridge_Light3_parse_update_closure) },
|
||||
{ be_const_key_weak(TYPE, -1), be_nested_str_weak(http_light3) },
|
||||
{ be_const_key_weak(web_values, -1), be_const_closure(Matter_Plugin_Bridge_Light3_web_values_closure) },
|
||||
{ be_const_key_weak(web_value_RGB, 1), be_const_closure(Matter_Plugin_Bridge_Light3_web_value_RGB_closure) },
|
||||
{ be_const_key_weak(shadow_sat, 9), be_const_var(1) },
|
||||
{ be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Bridge_Light3_invoke_request_closure) },
|
||||
{ be_const_key_weak(NAME, -1), be_nested_str_weak(_X26_X23x1F517_X3B_X20Light_X203_X20RGB) },
|
||||
{ be_const_key_weak(TYPES, 11), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
|
||||
be_const_map( * be_nested_map(2,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_int(269, -1), be_const_int(2) },
|
||||
{ be_const_key_int(19, 0), be_const_int(1) },
|
||||
})) ) } )) },
|
||||
{ be_const_key_weak(shadow_hue, 6), be_const_var(0) },
|
||||
{ be_const_key_weak(set_hue, -1), be_const_closure(Matter_Plugin_Bridge_Light3_set_hue_closure) },
|
||||
{ be_const_key_weak(read_attribute, 13), be_const_closure(Matter_Plugin_Bridge_Light3_read_attribute_closure) },
|
||||
{ be_const_key_weak(CLUSTERS, -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(768, -1), 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(7),
|
||||
be_const_int(8),
|
||||
be_const_int(15),
|
||||
be_const_int(16385),
|
||||
be_const_int(16394),
|
||||
be_const_int(65532),
|
||||
be_const_int(65533),
|
||||
})) ) } )) },
|
||||
})) ) } )) },
|
||||
})),
|
||||
be_str_weak(Matter_Plugin_Bridge_Light3)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
void be_load_Matter_Plugin_Bridge_Light3_class(bvm *vm) {
|
||||
be_pushntvclass(vm, &be_class_Matter_Plugin_Bridge_Light3);
|
||||
be_setglobal(vm, "Matter_Plugin_Bridge_Light3");
|
||||
be_pop(vm, 1);
|
||||
}
|
||||
/********************************************************************/
|
||||
/* End of solidification */
|
|
@ -7,12 +7,12 @@
|
|||
extern const bclass be_class_Matter_Plugin_Bridge_OnOff;
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: init
|
||||
** Solidified function: web_values
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_OnOff_init, /* name */
|
||||
be_local_closure(Matter_Plugin_Bridge_OnOff_web_values, /* name */
|
||||
be_nested_proto(
|
||||
10, /* nstack */
|
||||
4, /* argc */
|
||||
11, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
|
@ -20,385 +20,28 @@ be_local_closure(Matter_Plugin_Bridge_OnOff_init, /* name */
|
|||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 7]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(string),
|
||||
/* K1 */ be_nested_str_weak(init),
|
||||
/* K2 */ be_nested_str_weak(shadow_onoff),
|
||||
/* K3 */ be_nested_str_weak(tasmota_relay_index),
|
||||
/* K4 */ be_nested_str_weak(find),
|
||||
/* K5 */ be_nested_str_weak(ARG),
|
||||
/* K6 */ be_const_int(0),
|
||||
/* K0 */ be_nested_str_weak(webserver),
|
||||
/* K1 */ be_nested_str_weak(string),
|
||||
/* K2 */ be_nested_str_weak(content_send),
|
||||
/* K3 */ be_nested_str_weak(format),
|
||||
/* K4 */ be_nested_str_weak(_X7C_X20Relay_X20_X25i_X20_X25s),
|
||||
/* K5 */ be_nested_str_weak(tasmota_relay_index),
|
||||
/* K6 */ be_nested_str_weak(web_value_onoff),
|
||||
}),
|
||||
be_str_weak(init),
|
||||
be_str_weak(web_values),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[21]) { /* code */
|
||||
0xA4120000, // 0000 IMPORT R4 K0
|
||||
0x60140003, // 0001 GETGBL R5 G3
|
||||
0x5C180000, // 0002 MOVE R6 R0
|
||||
0x7C140200, // 0003 CALL R5 1
|
||||
0x8C140B01, // 0004 GETMET R5 R5 K1
|
||||
0x5C1C0200, // 0005 MOVE R7 R1
|
||||
0x5C200400, // 0006 MOVE R8 R2
|
||||
0x5C240600, // 0007 MOVE R9 R3
|
||||
( &(const binstruction[11]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0xA40A0200, // 0001 IMPORT R2 K1
|
||||
0x8C0C0302, // 0002 GETMET R3 R1 K2
|
||||
0x8C140503, // 0003 GETMET R5 R2 K3
|
||||
0x581C0004, // 0004 LDCONST R7 K4
|
||||
0x88200105, // 0005 GETMBR R8 R0 K5
|
||||
0x8C240106, // 0006 GETMET R9 R0 K6
|
||||
0x7C240200, // 0007 CALL R9 1
|
||||
0x7C140800, // 0008 CALL R5 4
|
||||
0x50140000, // 0009 LDBOOL R5 0 0
|
||||
0x90020405, // 000A SETMBR R0 K2 R5
|
||||
0x8C140704, // 000B GETMET R5 R3 K4
|
||||
0x881C0105, // 000C GETMBR R7 R0 K5
|
||||
0x7C140400, // 000D CALL R5 2
|
||||
0x90020605, // 000E SETMBR R0 K3 R5
|
||||
0x88140103, // 000F GETMBR R5 R0 K3
|
||||
0x4C180000, // 0010 LDNIL R6
|
||||
0x1C140A06, // 0011 EQ R5 R5 R6
|
||||
0x78160000, // 0012 JMPF R5 #0014
|
||||
0x90020706, // 0013 SETMBR R0 K3 K6
|
||||
0x80000000, // 0014 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: parse_update
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_OnOff_parse_update, /* 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[ 6]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(find),
|
||||
/* K1 */ be_nested_str_weak(POWER),
|
||||
/* K2 */ be_nested_str_weak(ON),
|
||||
/* K3 */ be_nested_str_weak(shadow_onoff),
|
||||
/* K4 */ be_nested_str_weak(attribute_updated),
|
||||
/* K5 */ be_const_int(0),
|
||||
}),
|
||||
be_str_weak(parse_update),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[23]) { /* code */
|
||||
0x540E000A, // 0000 LDINT R3 11
|
||||
0x1C0C0403, // 0001 EQ R3 R2 R3
|
||||
0x780E0012, // 0002 JMPF R3 #0016
|
||||
0x8C0C0300, // 0003 GETMET R3 R1 K0
|
||||
0x58140001, // 0004 LDCONST R5 K1
|
||||
0x7C0C0400, // 0005 CALL R3 2
|
||||
0x1C0C0702, // 0006 EQ R3 R3 K2
|
||||
0x88100103, // 0007 GETMBR R4 R0 K3
|
||||
0x4C140000, // 0008 LDNIL R5
|
||||
0x20100805, // 0009 NE R4 R4 R5
|
||||
0x78120009, // 000A JMPF R4 #0015
|
||||
0x88100103, // 000B GETMBR R4 R0 K3
|
||||
0x60140017, // 000C GETGBL R5 G23
|
||||
0x5C180600, // 000D MOVE R6 R3
|
||||
0x7C140200, // 000E CALL R5 1
|
||||
0x20100805, // 000F NE R4 R4 R5
|
||||
0x78120003, // 0010 JMPF R4 #0015
|
||||
0x8C100104, // 0011 GETMET R4 R0 K4
|
||||
0x541A0005, // 0012 LDINT R6 6
|
||||
0x581C0005, // 0013 LDCONST R7 K5
|
||||
0x7C100600, // 0014 CALL R4 3
|
||||
0x90020603, // 0015 SETMBR R0 K3 R3
|
||||
0x80000000, // 0016 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: invoke_request
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_OnOff_invoke_request, /* name */
|
||||
be_nested_proto(
|
||||
10, /* nstack */
|
||||
4, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[11]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(matter),
|
||||
/* K1 */ be_nested_str_weak(TLV),
|
||||
/* K2 */ be_nested_str_weak(cluster),
|
||||
/* K3 */ be_nested_str_weak(command),
|
||||
/* K4 */ be_nested_str_weak(update_shadow_lazy),
|
||||
/* K5 */ be_const_int(0),
|
||||
/* K6 */ be_nested_str_weak(set_onoff),
|
||||
/* K7 */ be_nested_str_weak(update_shadow),
|
||||
/* K8 */ be_const_int(1),
|
||||
/* K9 */ be_const_int(2),
|
||||
/* K10 */ be_nested_str_weak(shadow_onoff),
|
||||
}),
|
||||
be_str_weak(invoke_request),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[42]) { /* code */
|
||||
0xB8120000, // 0000 GETNGBL R4 K0
|
||||
0x88100901, // 0001 GETMBR R4 R4 K1
|
||||
0x88140702, // 0002 GETMBR R5 R3 K2
|
||||
0x88180703, // 0003 GETMBR R6 R3 K3
|
||||
0x541E0005, // 0004 LDINT R7 6
|
||||
0x1C1C0A07, // 0005 EQ R7 R5 R7
|
||||
0x781E0021, // 0006 JMPF R7 #0029
|
||||
0x8C1C0104, // 0007 GETMET R7 R0 K4
|
||||
0x7C1C0200, // 0008 CALL R7 1
|
||||
0x1C1C0D05, // 0009 EQ R7 R6 K5
|
||||
0x781E0007, // 000A JMPF R7 #0013
|
||||
0x8C1C0106, // 000B GETMET R7 R0 K6
|
||||
0x50240000, // 000C LDBOOL R9 0 0
|
||||
0x7C1C0400, // 000D CALL R7 2
|
||||
0x8C1C0107, // 000E GETMET R7 R0 K7
|
||||
0x7C1C0200, // 000F CALL R7 1
|
||||
0x501C0200, // 0010 LDBOOL R7 1 0
|
||||
0x80040E00, // 0011 RET 1 R7
|
||||
0x70020015, // 0012 JMP #0029
|
||||
0x1C1C0D08, // 0013 EQ R7 R6 K8
|
||||
0x781E0007, // 0014 JMPF R7 #001D
|
||||
0x8C1C0106, // 0015 GETMET R7 R0 K6
|
||||
0x50240200, // 0016 LDBOOL R9 1 0
|
||||
0x7C1C0400, // 0017 CALL R7 2
|
||||
0x8C1C0107, // 0018 GETMET R7 R0 K7
|
||||
0x7C1C0200, // 0019 CALL R7 1
|
||||
0x501C0200, // 001A LDBOOL R7 1 0
|
||||
0x80040E00, // 001B RET 1 R7
|
||||
0x7002000B, // 001C JMP #0029
|
||||
0x1C1C0D09, // 001D EQ R7 R6 K9
|
||||
0x781E0009, // 001E JMPF R7 #0029
|
||||
0x8C1C0106, // 001F GETMET R7 R0 K6
|
||||
0x8824010A, // 0020 GETMBR R9 R0 K10
|
||||
0x78260000, // 0021 JMPF R9 #0023
|
||||
0x50240001, // 0022 LDBOOL R9 0 1
|
||||
0x50240200, // 0023 LDBOOL R9 1 0
|
||||
0x7C1C0400, // 0024 CALL R7 2
|
||||
0x8C1C0107, // 0025 GETMET R7 R0 K7
|
||||
0x7C1C0200, // 0026 CALL R7 1
|
||||
0x501C0200, // 0027 LDBOOL R7 1 0
|
||||
0x80040E00, // 0028 RET 1 R7
|
||||
0x80000000, // 0029 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: set_onoff
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_OnOff_set_onoff, /* name */
|
||||
be_nested_proto(
|
||||
6, /* nstack */
|
||||
2, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 5]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(call_remote_sync),
|
||||
/* K1 */ be_nested_str_weak(Power),
|
||||
/* K2 */ be_nested_str_weak(1),
|
||||
/* K3 */ be_nested_str_weak(0),
|
||||
/* K4 */ be_nested_str_weak(update_shadow),
|
||||
}),
|
||||
be_str_weak(set_onoff),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[10]) { /* code */
|
||||
0x8C080100, // 0000 GETMET R2 R0 K0
|
||||
0x58100001, // 0001 LDCONST R4 K1
|
||||
0x78060001, // 0002 JMPF R1 #0005
|
||||
0x58140002, // 0003 LDCONST R5 K2
|
||||
0x70020000, // 0004 JMP #0006
|
||||
0x58140003, // 0005 LDCONST R5 K3
|
||||
0x7C080600, // 0006 CALL R2 3
|
||||
0x8C080104, // 0007 GETMET R2 R0 K4
|
||||
0x7C080200, // 0008 CALL R2 1
|
||||
0x80000000, // 0009 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: <lambda>
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_OnOff__X3Clambda_X3E, /* name */
|
||||
be_nested_proto(
|
||||
3, /* nstack */
|
||||
1, /* argc */
|
||||
0, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
0, /* has constants */
|
||||
NULL, /* no const */
|
||||
be_str_weak(_X3Clambda_X3E),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[ 4]) { /* code */
|
||||
0x60040009, // 0000 GETGBL R1 G9
|
||||
0x5C080000, // 0001 MOVE R2 R0
|
||||
0x7C040200, // 0002 CALL R1 1
|
||||
0x80040200, // 0003 RET 1 R1
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: probe_shadow_async
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_OnOff_probe_shadow_async, /* name */
|
||||
be_nested_proto(
|
||||
5, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 3]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(call_remote_async),
|
||||
/* K1 */ be_nested_str_weak(Status),
|
||||
/* K2 */ be_nested_str_weak(11),
|
||||
}),
|
||||
be_str_weak(probe_shadow_async),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[ 5]) { /* code */
|
||||
0x8C040100, // 0000 GETMET R1 R0 K0
|
||||
0x580C0001, // 0001 LDCONST R3 K1
|
||||
0x58100002, // 0002 LDCONST R4 K2
|
||||
0x7C040600, // 0003 CALL R1 3
|
||||
0x80000000, // 0004 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: read_attribute
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_OnOff_read_attribute, /* name */
|
||||
be_nested_proto(
|
||||
11, /* nstack */
|
||||
3, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[12]) { /* 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_nested_str_weak(update_shadow_lazy),
|
||||
/* K6 */ be_const_int(0),
|
||||
/* K7 */ be_nested_str_weak(create_TLV),
|
||||
/* K8 */ be_nested_str_weak(BOOL),
|
||||
/* K9 */ be_nested_str_weak(shadow_onoff),
|
||||
/* K10 */ be_nested_str_weak(U4),
|
||||
/* K11 */ be_nested_str_weak(read_attribute),
|
||||
}),
|
||||
be_str_weak(read_attribute),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[45]) { /* 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
|
||||
0x541E0005, // 0005 LDINT R7 6
|
||||
0x1C1C0A07, // 0006 EQ R7 R5 R7
|
||||
0x781E001B, // 0007 JMPF R7 #0024
|
||||
0x8C1C0105, // 0008 GETMET R7 R0 K5
|
||||
0x7C1C0200, // 0009 CALL R7 1
|
||||
0x1C1C0D06, // 000A EQ R7 R6 K6
|
||||
0x781E0005, // 000B JMPF R7 #0012
|
||||
0x8C1C0907, // 000C GETMET R7 R4 K7
|
||||
0x88240908, // 000D GETMBR R9 R4 K8
|
||||
0x88280109, // 000E GETMBR R10 R0 K9
|
||||
0x7C1C0600, // 000F CALL R7 3
|
||||
0x80040E00, // 0010 RET 1 R7
|
||||
0x70020010, // 0011 JMP #0023
|
||||
0x541EFFFB, // 0012 LDINT R7 65532
|
||||
0x1C1C0C07, // 0013 EQ R7 R6 R7
|
||||
0x781E0005, // 0014 JMPF R7 #001B
|
||||
0x8C1C0907, // 0015 GETMET R7 R4 K7
|
||||
0x8824090A, // 0016 GETMBR R9 R4 K10
|
||||
0x58280006, // 0017 LDCONST R10 K6
|
||||
0x7C1C0600, // 0018 CALL R7 3
|
||||
0x80040E00, // 0019 RET 1 R7
|
||||
0x70020007, // 001A JMP #0023
|
||||
0x541EFFFC, // 001B LDINT R7 65533
|
||||
0x1C1C0C07, // 001C EQ R7 R6 R7
|
||||
0x781E0004, // 001D JMPF R7 #0023
|
||||
0x8C1C0907, // 001E GETMET R7 R4 K7
|
||||
0x8824090A, // 001F GETMBR R9 R4 K10
|
||||
0x542A0003, // 0020 LDINT R10 4
|
||||
0x7C1C0600, // 0021 CALL R7 3
|
||||
0x80040E00, // 0022 RET 1 R7
|
||||
0x70020007, // 0023 JMP #002C
|
||||
0x601C0003, // 0024 GETGBL R7 G3
|
||||
0x5C200000, // 0025 MOVE R8 R0
|
||||
0x7C1C0200, // 0026 CALL R7 1
|
||||
0x8C1C0F0B, // 0027 GETMET R7 R7 K11
|
||||
0x5C240200, // 0028 MOVE R9 R1
|
||||
0x5C280400, // 0029 MOVE R10 R2
|
||||
0x7C1C0600, // 002A CALL R7 3
|
||||
0x80040E00, // 002B RET 1 R7
|
||||
0x80000000, // 002C RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: update_shadow
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_OnOff_update_shadow, /* name */
|
||||
be_nested_proto(
|
||||
5, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 4]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(call_remote_sync),
|
||||
/* K1 */ be_nested_str_weak(Status),
|
||||
/* K2 */ be_nested_str_weak(11),
|
||||
/* K3 */ be_nested_str_weak(update_shadow),
|
||||
}),
|
||||
be_str_weak(update_shadow),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[10]) { /* code */
|
||||
0x8C040100, // 0000 GETMET R1 R0 K0
|
||||
0x580C0001, // 0001 LDCONST R3 K1
|
||||
0x58100002, // 0002 LDCONST R4 K2
|
||||
0x7C040600, // 0003 CALL R1 3
|
||||
0x60080003, // 0004 GETGBL R2 G3
|
||||
0x5C0C0000, // 0005 MOVE R3 R0
|
||||
0x7C080200, // 0006 CALL R2 1
|
||||
0x8C080503, // 0007 GETMET R2 R2 K3
|
||||
0x7C080200, // 0008 CALL R2 1
|
||||
0x80000000, // 0009 RET 0
|
||||
0x7C0C0400, // 0009 CALL R3 2
|
||||
0x80000000, // 000A RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
|
@ -408,40 +51,20 @@ be_local_closure(Matter_Plugin_Bridge_OnOff_update_shadow, /* name */
|
|||
/********************************************************************
|
||||
** Solidified class: Matter_Plugin_Bridge_OnOff
|
||||
********************************************************************/
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_HTTP;
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_Light0;
|
||||
be_local_class(Matter_Plugin_Bridge_OnOff,
|
||||
2,
|
||||
&be_class_Matter_Plugin_Bridge_HTTP,
|
||||
be_nested_map(15,
|
||||
0,
|
||||
&be_class_Matter_Plugin_Bridge_Light0,
|
||||
be_nested_map(4,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Bridge_OnOff_init_closure) },
|
||||
{ be_const_key_weak(parse_update, -1), be_const_closure(Matter_Plugin_Bridge_OnOff_parse_update_closure) },
|
||||
{ be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Bridge_OnOff_invoke_request_closure) },
|
||||
{ be_const_key_weak(set_onoff, -1), be_const_closure(Matter_Plugin_Bridge_OnOff_set_onoff_closure) },
|
||||
{ be_const_key_weak(ARG_TYPE, 7), be_const_static_closure(Matter_Plugin_Bridge_OnOff__X3Clambda_X3E_closure) },
|
||||
{ be_const_key_weak(tasmota_relay_index, 11), be_const_var(0) },
|
||||
{ be_const_key_weak(probe_shadow_async, -1), be_const_closure(Matter_Plugin_Bridge_OnOff_probe_shadow_async_closure) },
|
||||
{ be_const_key_weak(update_shadow, 10), be_const_closure(Matter_Plugin_Bridge_OnOff_update_shadow_closure) },
|
||||
{ be_const_key_weak(NAME, -1), be_nested_str_weak(_X26_X23x1F517_X3B_X20Relay) },
|
||||
{ be_const_key_weak(ARG, 8), be_nested_str_weak(relay) },
|
||||
{ be_const_key_weak(TYPE, 14), be_nested_str_weak(http_relay) },
|
||||
{ be_const_key_weak(web_values, -1), be_const_closure(Matter_Plugin_Bridge_OnOff_web_values_closure) },
|
||||
{ be_const_key_weak(TYPE, -1), be_nested_str_weak(http_relay) },
|
||||
{ be_const_key_weak(NAME, 3), be_nested_str_weak(_X26_X23x1F517_X3B_X20Relay) },
|
||||
{ be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
|
||||
be_const_map( * be_nested_map(1,
|
||||
be_const_map( * be_nested_map(2,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_int(266, -1), be_const_int(2) },
|
||||
})) ) } )) },
|
||||
{ be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Bridge_OnOff_read_attribute_closure) },
|
||||
{ be_const_key_weak(shadow_onoff, -1), be_const_var(1) },
|
||||
{ be_const_key_weak(CLUSTERS, -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(6, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
|
||||
be_const_list( * be_nested_list(3,
|
||||
( (struct bvalue*) &(const bvalue[]) {
|
||||
be_const_int(0),
|
||||
be_const_int(65532),
|
||||
be_const_int(65533),
|
||||
})) ) } )) },
|
||||
{ be_const_key_int(19, -1), be_const_int(1) },
|
||||
})) ) } )) },
|
||||
})),
|
||||
be_str_weak(Matter_Plugin_Bridge_OnOff)
|
||||
|
|
|
@ -0,0 +1,241 @@
|
|||
/* Solidification of Matter_Plugin_Bridge_Sensor.h */
|
||||
/********************************************************************\
|
||||
* Generated code, don't edit *
|
||||
\********************************************************************/
|
||||
#include "be_constobj.h"
|
||||
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_Sensor;
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: filter_name_html
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_filter_name_html, /* name */
|
||||
be_nested_proto(
|
||||
9, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 8]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(tasmota_sensor_filter),
|
||||
/* K1 */ be_nested_str_weak(string),
|
||||
/* K2 */ be_nested_str_weak(webserver),
|
||||
/* K3 */ be_nested_str_weak(html_escape),
|
||||
/* K4 */ be_nested_str_weak(split),
|
||||
/* K5 */ be_nested_str_weak(_X23),
|
||||
/* K6 */ be_const_int(0),
|
||||
/* K7 */ be_nested_str_weak(),
|
||||
}),
|
||||
be_str_weak(filter_name_html),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[13]) { /* code */
|
||||
0x88040100, // 0000 GETMBR R1 R0 K0
|
||||
0x78060009, // 0001 JMPF R1 #000C
|
||||
0xA4060200, // 0002 IMPORT R1 K1
|
||||
0xA40A0400, // 0003 IMPORT R2 K2
|
||||
0x8C0C0503, // 0004 GETMET R3 R2 K3
|
||||
0x8C140304, // 0005 GETMET R5 R1 K4
|
||||
0x881C0100, // 0006 GETMBR R7 R0 K0
|
||||
0x58200005, // 0007 LDCONST R8 K5
|
||||
0x7C140600, // 0008 CALL R5 3
|
||||
0x94140B06, // 0009 GETIDX R5 R5 K6
|
||||
0x7C0C0400, // 000A CALL R3 2
|
||||
0x80040600, // 000B RET 1 R3
|
||||
0x80060E00, // 000C RET 1 K7
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: init
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_init, /* name */
|
||||
be_nested_proto(
|
||||
9, /* nstack */
|
||||
4, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 8]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(init),
|
||||
/* K1 */ be_nested_str_weak(tasmota_sensor_filter),
|
||||
/* K2 */ be_nested_str_weak(find),
|
||||
/* K3 */ be_nested_str_weak(ARG),
|
||||
/* K4 */ be_nested_str_weak(tasmota_sensor_matcher),
|
||||
/* K5 */ be_nested_str_weak(tasmota),
|
||||
/* K6 */ be_nested_str_weak(Rule_Matcher),
|
||||
/* K7 */ be_nested_str_weak(parse),
|
||||
}),
|
||||
be_str_weak(init),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[21]) { /* 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
|
||||
0x8C100702, // 0008 GETMET R4 R3 K2
|
||||
0x88180103, // 0009 GETMBR R6 R0 K3
|
||||
0x7C100400, // 000A CALL R4 2
|
||||
0x90020204, // 000B SETMBR R0 K1 R4
|
||||
0x88100101, // 000C GETMBR R4 R0 K1
|
||||
0x78120005, // 000D JMPF R4 #0014
|
||||
0xB8120A00, // 000E GETNGBL R4 K5
|
||||
0x88100906, // 000F GETMBR R4 R4 K6
|
||||
0x8C100907, // 0010 GETMET R4 R4 K7
|
||||
0x88180101, // 0011 GETMBR R6 R0 K1
|
||||
0x7C100400, // 0012 CALL R4 2
|
||||
0x90020804, // 0013 SETMBR R0 K4 R4
|
||||
0x80000000, // 0014 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: pre_value
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_pre_value, /* name */
|
||||
be_nested_proto(
|
||||
2, /* nstack */
|
||||
2, /* 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(pre_value),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[ 1]) { /* code */
|
||||
0x80040200, // 0000 RET 1 R1
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: parse_update
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_parse_update, /* 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[ 5]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(tasmota_sensor_matcher),
|
||||
/* K1 */ be_nested_str_weak(pre_value),
|
||||
/* K2 */ be_nested_str_weak(match),
|
||||
/* K3 */ be_nested_str_weak(shadow_value),
|
||||
/* K4 */ be_nested_str_weak(value_changed),
|
||||
}),
|
||||
be_str_weak(parse_update),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[24]) { /* code */
|
||||
0x540E0007, // 0000 LDINT R3 8
|
||||
0x1C0C0403, // 0001 EQ R3 R2 R3
|
||||
0x780E0013, // 0002 JMPF R3 #0017
|
||||
0x880C0100, // 0003 GETMBR R3 R0 K0
|
||||
0x780E0011, // 0004 JMPF R3 #0017
|
||||
0x8C0C0101, // 0005 GETMET R3 R0 K1
|
||||
0x6014000A, // 0006 GETGBL R5 G10
|
||||
0x88180100, // 0007 GETMBR R6 R0 K0
|
||||
0x8C180D02, // 0008 GETMET R6 R6 K2
|
||||
0x5C200200, // 0009 MOVE R8 R1
|
||||
0x7C180400, // 000A CALL R6 2
|
||||
0x7C140200, // 000B CALL R5 1
|
||||
0x7C0C0400, // 000C CALL R3 2
|
||||
0x4C100000, // 000D LDNIL R4
|
||||
0x20100604, // 000E NE R4 R3 R4
|
||||
0x78120006, // 000F JMPF R4 #0017
|
||||
0x88100103, // 0010 GETMBR R4 R0 K3
|
||||
0x20100604, // 0011 NE R4 R3 R4
|
||||
0x78120002, // 0012 JMPF R4 #0016
|
||||
0x8C100104, // 0013 GETMET R4 R0 K4
|
||||
0x5C180600, // 0014 MOVE R6 R3
|
||||
0x7C100400, // 0015 CALL R4 2
|
||||
0x90020603, // 0016 SETMBR R0 K3 R3
|
||||
0x80000000, // 0017 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: value_changed
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_value_changed, /* name */
|
||||
be_nested_proto(
|
||||
2, /* nstack */
|
||||
2, /* 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(value_changed),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[ 1]) { /* code */
|
||||
0x80000000, // 0000 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified class: Matter_Plugin_Bridge_Sensor
|
||||
********************************************************************/
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_HTTP;
|
||||
be_local_class(Matter_Plugin_Bridge_Sensor,
|
||||
3,
|
||||
&be_class_Matter_Plugin_Bridge_HTTP,
|
||||
be_nested_map(13,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_weak(ARG, 1), be_nested_str_weak(filter) },
|
||||
{ be_const_key_weak(value_changed, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_value_changed_closure) },
|
||||
{ be_const_key_weak(UPDATE_TIME, -1), be_const_int(5000) },
|
||||
{ be_const_key_weak(tasmota_sensor_filter, 8), be_const_var(0) },
|
||||
{ be_const_key_weak(tasmota_sensor_matcher, -1), be_const_var(1) },
|
||||
{ be_const_key_weak(PROBE_TIMEOUT, -1), be_const_int(1700) },
|
||||
{ be_const_key_weak(filter_name_html, 12), be_const_closure(Matter_Plugin_Bridge_Sensor_filter_name_html_closure) },
|
||||
{ be_const_key_weak(UPDATE_CMD, -1), be_nested_str_weak(Status_X208) },
|
||||
{ be_const_key_weak(pre_value, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_pre_value_closure) },
|
||||
{ be_const_key_weak(parse_update, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_parse_update_closure) },
|
||||
{ be_const_key_weak(shadow_value, 7), be_const_var(2) },
|
||||
{ be_const_key_weak(ARG_HTTP, 2), be_nested_str_weak(url) },
|
||||
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_init_closure) },
|
||||
})),
|
||||
be_str_weak(Matter_Plugin_Bridge_Sensor)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
void be_load_Matter_Plugin_Bridge_Sensor_class(bvm *vm) {
|
||||
be_pushntvclass(vm, &be_class_Matter_Plugin_Bridge_Sensor);
|
||||
be_setglobal(vm, "Matter_Plugin_Bridge_Sensor");
|
||||
be_pop(vm, 1);
|
||||
}
|
||||
/********************************************************************/
|
||||
/* End of solidification */
|
|
@ -0,0 +1,280 @@
|
|||
/* Solidification of Matter_Plugin_Bridge_Sensor_Humidity.h */
|
||||
/********************************************************************\
|
||||
* Generated code, don't edit *
|
||||
\********************************************************************/
|
||||
#include "be_constobj.h"
|
||||
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_Sensor_Humidity;
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: pre_value
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_Humidity_pre_value, /* name */
|
||||
be_nested_proto(
|
||||
4, /* nstack */
|
||||
2, /* 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(pre_value),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[10]) { /* code */
|
||||
0x4C080000, // 0000 LDNIL R2
|
||||
0x20080202, // 0001 NE R2 R1 R2
|
||||
0x780A0004, // 0002 JMPF R2 #0008
|
||||
0x60080009, // 0003 GETGBL R2 G9
|
||||
0x540E0063, // 0004 LDINT R3 100
|
||||
0x080C0203, // 0005 MUL R3 R1 R3
|
||||
0x7C080200, // 0006 CALL R2 1
|
||||
0x70020000, // 0007 JMP #0009
|
||||
0x4C080000, // 0008 LDNIL R2
|
||||
0x80040400, // 0009 RET 1 R2
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: read_attribute
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_Humidity_read_attribute, /* name */
|
||||
be_nested_proto(
|
||||
12, /* nstack */
|
||||
3, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[15]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(string),
|
||||
/* K1 */ be_nested_str_weak(matter),
|
||||
/* K2 */ be_nested_str_weak(TLV),
|
||||
/* K3 */ be_nested_str_weak(cluster),
|
||||
/* K4 */ be_nested_str_weak(attribute),
|
||||
/* K5 */ be_const_int(0),
|
||||
/* K6 */ be_nested_str_weak(shadow_value),
|
||||
/* K7 */ be_nested_str_weak(create_TLV),
|
||||
/* K8 */ be_nested_str_weak(U2),
|
||||
/* K9 */ be_nested_str_weak(NULL),
|
||||
/* K10 */ be_const_int(1),
|
||||
/* K11 */ be_const_int(2),
|
||||
/* K12 */ be_nested_str_weak(U4),
|
||||
/* K13 */ be_const_int(3),
|
||||
/* K14 */ be_nested_str_weak(read_attribute),
|
||||
}),
|
||||
be_str_weak(read_attribute),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[71]) { /* 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
|
||||
0x541E0404, // 0005 LDINT R7 1029
|
||||
0x1C1C0A07, // 0006 EQ R7 R5 R7
|
||||
0x781E0035, // 0007 JMPF R7 #003E
|
||||
0x1C1C0D05, // 0008 EQ R7 R6 K5
|
||||
0x781E0011, // 0009 JMPF R7 #001C
|
||||
0x881C0106, // 000A GETMBR R7 R0 K6
|
||||
0x4C200000, // 000B LDNIL R8
|
||||
0x201C0E08, // 000C NE R7 R7 R8
|
||||
0x781E0007, // 000D JMPF R7 #0016
|
||||
0x8C1C0907, // 000E GETMET R7 R4 K7
|
||||
0x88240908, // 000F GETMBR R9 R4 K8
|
||||
0x60280009, // 0010 GETGBL R10 G9
|
||||
0x882C0106, // 0011 GETMBR R11 R0 K6
|
||||
0x7C280200, // 0012 CALL R10 1
|
||||
0x7C1C0600, // 0013 CALL R7 3
|
||||
0x80040E00, // 0014 RET 1 R7
|
||||
0x70020004, // 0015 JMP #001B
|
||||
0x8C1C0907, // 0016 GETMET R7 R4 K7
|
||||
0x88240909, // 0017 GETMBR R9 R4 K9
|
||||
0x4C280000, // 0018 LDNIL R10
|
||||
0x7C1C0600, // 0019 CALL R7 3
|
||||
0x80040E00, // 001A RET 1 R7
|
||||
0x70020020, // 001B JMP #003D
|
||||
0x1C1C0D0A, // 001C EQ R7 R6 K10
|
||||
0x781E0005, // 001D JMPF R7 #0024
|
||||
0x8C1C0907, // 001E GETMET R7 R4 K7
|
||||
0x88240908, // 001F GETMBR R9 R4 K8
|
||||
0x542A01F3, // 0020 LDINT R10 500
|
||||
0x7C1C0600, // 0021 CALL R7 3
|
||||
0x80040E00, // 0022 RET 1 R7
|
||||
0x70020018, // 0023 JMP #003D
|
||||
0x1C1C0D0B, // 0024 EQ R7 R6 K11
|
||||
0x781E0005, // 0025 JMPF R7 #002C
|
||||
0x8C1C0907, // 0026 GETMET R7 R4 K7
|
||||
0x88240908, // 0027 GETMBR R9 R4 K8
|
||||
0x542A270F, // 0028 LDINT R10 10000
|
||||
0x7C1C0600, // 0029 CALL R7 3
|
||||
0x80040E00, // 002A RET 1 R7
|
||||
0x70020010, // 002B JMP #003D
|
||||
0x541EFFFB, // 002C LDINT R7 65532
|
||||
0x1C1C0C07, // 002D EQ R7 R6 R7
|
||||
0x781E0005, // 002E JMPF R7 #0035
|
||||
0x8C1C0907, // 002F GETMET R7 R4 K7
|
||||
0x8824090C, // 0030 GETMBR R9 R4 K12
|
||||
0x58280005, // 0031 LDCONST R10 K5
|
||||
0x7C1C0600, // 0032 CALL R7 3
|
||||
0x80040E00, // 0033 RET 1 R7
|
||||
0x70020007, // 0034 JMP #003D
|
||||
0x541EFFFC, // 0035 LDINT R7 65533
|
||||
0x1C1C0C07, // 0036 EQ R7 R6 R7
|
||||
0x781E0004, // 0037 JMPF R7 #003D
|
||||
0x8C1C0907, // 0038 GETMET R7 R4 K7
|
||||
0x8824090C, // 0039 GETMBR R9 R4 K12
|
||||
0x5828000D, // 003A LDCONST R10 K13
|
||||
0x7C1C0600, // 003B CALL R7 3
|
||||
0x80040E00, // 003C RET 1 R7
|
||||
0x70020007, // 003D JMP #0046
|
||||
0x601C0003, // 003E GETGBL R7 G3
|
||||
0x5C200000, // 003F MOVE R8 R0
|
||||
0x7C1C0200, // 0040 CALL R7 1
|
||||
0x8C1C0F0E, // 0041 GETMET R7 R7 K14
|
||||
0x5C240200, // 0042 MOVE R9 R1
|
||||
0x5C280400, // 0043 MOVE R10 R2
|
||||
0x7C1C0600, // 0044 CALL R7 3
|
||||
0x80040E00, // 0045 RET 1 R7
|
||||
0x80000000, // 0046 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: value_changed
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_Humidity_value_changed, /* 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(attribute_updated),
|
||||
/* K1 */ be_const_int(0),
|
||||
}),
|
||||
be_str_weak(value_changed),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[ 5]) { /* code */
|
||||
0x8C080100, // 0000 GETMET R2 R0 K0
|
||||
0x54120404, // 0001 LDINT R4 1029
|
||||
0x58140001, // 0002 LDCONST R5 K1
|
||||
0x7C080600, // 0003 CALL R2 3
|
||||
0x80000000, // 0004 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: web_values
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_Humidity_web_values, /* name */
|
||||
be_nested_proto(
|
||||
11, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 7]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(webserver),
|
||||
/* K1 */ be_nested_str_weak(string),
|
||||
/* K2 */ be_nested_str_weak(content_send),
|
||||
/* K3 */ be_nested_str_weak(format),
|
||||
/* K4 */ be_nested_str_weak(_X7C_X20_X25s_X20_X26_X23x1F4A7_X3B_X20_X252_X2E0f_X25_X25),
|
||||
/* K5 */ be_nested_str_weak(filter_name_html),
|
||||
/* K6 */ be_nested_str_weak(shadow_value),
|
||||
}),
|
||||
be_str_weak(web_values),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[21]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0xA40A0200, // 0001 IMPORT R2 K1
|
||||
0x8C0C0302, // 0002 GETMET R3 R1 K2
|
||||
0x8C140503, // 0003 GETMET R5 R2 K3
|
||||
0x581C0004, // 0004 LDCONST R7 K4
|
||||
0x8C200105, // 0005 GETMET R8 R0 K5
|
||||
0x7C200200, // 0006 CALL R8 1
|
||||
0x88240106, // 0007 GETMBR R9 R0 K6
|
||||
0x4C280000, // 0008 LDNIL R10
|
||||
0x2024120A, // 0009 NE R9 R9 R10
|
||||
0x78260005, // 000A JMPF R9 #0011
|
||||
0x6024000A, // 000B GETGBL R9 G10
|
||||
0x88280106, // 000C GETMBR R10 R0 K6
|
||||
0x7C240200, // 000D CALL R9 1
|
||||
0x542A0063, // 000E LDINT R10 100
|
||||
0x0C24120A, // 000F DIV R9 R9 R10
|
||||
0x70020000, // 0010 JMP #0012
|
||||
0x4C240000, // 0011 LDNIL R9
|
||||
0x7C140800, // 0012 CALL R5 4
|
||||
0x7C0C0400, // 0013 CALL R3 2
|
||||
0x80000000, // 0014 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified class: Matter_Plugin_Bridge_Sensor_Humidity
|
||||
********************************************************************/
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_Sensor;
|
||||
be_local_class(Matter_Plugin_Bridge_Sensor_Humidity,
|
||||
0,
|
||||
&be_class_Matter_Plugin_Bridge_Sensor,
|
||||
be_nested_map(8,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_weak(pre_value, 1), be_const_closure(Matter_Plugin_Bridge_Sensor_Humidity_pre_value_closure) },
|
||||
{ be_const_key_weak(web_values, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_Humidity_web_values_closure) },
|
||||
{ be_const_key_weak(CLUSTERS, 3), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
|
||||
be_const_map( * be_nested_map(1,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_int(1029, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
|
||||
be_const_list( * be_nested_list(5,
|
||||
( (struct bvalue*) &(const bvalue[]) {
|
||||
be_const_int(0),
|
||||
be_const_int(1),
|
||||
be_const_int(2),
|
||||
be_const_int(65532),
|
||||
be_const_int(65533),
|
||||
})) ) } )) },
|
||||
})) ) } )) },
|
||||
{ be_const_key_weak(read_attribute, 7), be_const_closure(Matter_Plugin_Bridge_Sensor_Humidity_read_attribute_closure) },
|
||||
{ be_const_key_weak(value_changed, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_Humidity_value_changed_closure) },
|
||||
{ be_const_key_weak(TYPE, 4), be_nested_str_weak(http_humidity) },
|
||||
{ be_const_key_weak(NAME, -1), be_nested_str_weak(_X26_X23x1F517_X3B_X20Humidity) },
|
||||
{ be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
|
||||
be_const_map( * be_nested_map(2,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_int(775, -1), be_const_int(2) },
|
||||
{ be_const_key_int(19, 0), be_const_int(1) },
|
||||
})) ) } )) },
|
||||
})),
|
||||
be_str_weak(Matter_Plugin_Bridge_Sensor_Humidity)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
void be_load_Matter_Plugin_Bridge_Sensor_Humidity_class(bvm *vm) {
|
||||
be_pushntvclass(vm, &be_class_Matter_Plugin_Bridge_Sensor_Humidity);
|
||||
be_setglobal(vm, "Matter_Plugin_Bridge_Sensor_Humidity");
|
||||
be_pop(vm, 1);
|
||||
}
|
||||
/********************************************************************/
|
||||
/* End of solidification */
|
|
@ -0,0 +1,271 @@
|
|||
/* Solidification of Matter_Plugin_Bridge_Sensor_Illuminance.h */
|
||||
/********************************************************************\
|
||||
* Generated code, don't edit *
|
||||
\********************************************************************/
|
||||
#include "be_constobj.h"
|
||||
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_Sensor_Illuminance;
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: pre_value
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_Illuminance_pre_value, /* name */
|
||||
be_nested_proto(
|
||||
4, /* nstack */
|
||||
2, /* 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(pre_value),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[ 9]) { /* code */
|
||||
0x4C080000, // 0000 LDNIL R2
|
||||
0x20080202, // 0001 NE R2 R1 R2
|
||||
0x780A0003, // 0002 JMPF R2 #0007
|
||||
0x60080009, // 0003 GETGBL R2 G9
|
||||
0x5C0C0200, // 0004 MOVE R3 R1
|
||||
0x7C080200, // 0005 CALL R2 1
|
||||
0x70020000, // 0006 JMP #0008
|
||||
0x4C080000, // 0007 LDNIL R2
|
||||
0x80040400, // 0008 RET 1 R2
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: read_attribute
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_Illuminance_read_attribute, /* name */
|
||||
be_nested_proto(
|
||||
12, /* nstack */
|
||||
3, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[15]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(string),
|
||||
/* K1 */ be_nested_str_weak(matter),
|
||||
/* K2 */ be_nested_str_weak(TLV),
|
||||
/* K3 */ be_nested_str_weak(cluster),
|
||||
/* K4 */ be_nested_str_weak(attribute),
|
||||
/* K5 */ be_const_int(0),
|
||||
/* K6 */ be_nested_str_weak(shadow_value),
|
||||
/* K7 */ be_nested_str_weak(create_TLV),
|
||||
/* K8 */ be_nested_str_weak(I2),
|
||||
/* K9 */ be_nested_str_weak(NULL),
|
||||
/* K10 */ be_const_int(1),
|
||||
/* K11 */ be_const_int(2),
|
||||
/* K12 */ be_nested_str_weak(U4),
|
||||
/* K13 */ be_const_int(3),
|
||||
/* K14 */ be_nested_str_weak(read_attribute),
|
||||
}),
|
||||
be_str_weak(read_attribute),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[71]) { /* 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
|
||||
0x541E03FF, // 0005 LDINT R7 1024
|
||||
0x1C1C0A07, // 0006 EQ R7 R5 R7
|
||||
0x781E0035, // 0007 JMPF R7 #003E
|
||||
0x1C1C0D05, // 0008 EQ R7 R6 K5
|
||||
0x781E0011, // 0009 JMPF R7 #001C
|
||||
0x881C0106, // 000A GETMBR R7 R0 K6
|
||||
0x4C200000, // 000B LDNIL R8
|
||||
0x201C0E08, // 000C NE R7 R7 R8
|
||||
0x781E0007, // 000D JMPF R7 #0016
|
||||
0x8C1C0907, // 000E GETMET R7 R4 K7
|
||||
0x88240908, // 000F GETMBR R9 R4 K8
|
||||
0x60280009, // 0010 GETGBL R10 G9
|
||||
0x882C0106, // 0011 GETMBR R11 R0 K6
|
||||
0x7C280200, // 0012 CALL R10 1
|
||||
0x7C1C0600, // 0013 CALL R7 3
|
||||
0x80040E00, // 0014 RET 1 R7
|
||||
0x70020004, // 0015 JMP #001B
|
||||
0x8C1C0907, // 0016 GETMET R7 R4 K7
|
||||
0x88240909, // 0017 GETMBR R9 R4 K9
|
||||
0x4C280000, // 0018 LDNIL R10
|
||||
0x7C1C0600, // 0019 CALL R7 3
|
||||
0x80040E00, // 001A RET 1 R7
|
||||
0x70020020, // 001B JMP #003D
|
||||
0x1C1C0D0A, // 001C EQ R7 R6 K10
|
||||
0x781E0005, // 001D JMPF R7 #0024
|
||||
0x8C1C0907, // 001E GETMET R7 R4 K7
|
||||
0x88240908, // 001F GETMBR R9 R4 K8
|
||||
0x58280005, // 0020 LDCONST R10 K5
|
||||
0x7C1C0600, // 0021 CALL R7 3
|
||||
0x80040E00, // 0022 RET 1 R7
|
||||
0x70020018, // 0023 JMP #003D
|
||||
0x1C1C0D0B, // 0024 EQ R7 R6 K11
|
||||
0x781E0005, // 0025 JMPF R7 #002C
|
||||
0x8C1C0907, // 0026 GETMET R7 R4 K7
|
||||
0x88240908, // 0027 GETMBR R9 R4 K8
|
||||
0x542A270F, // 0028 LDINT R10 10000
|
||||
0x7C1C0600, // 0029 CALL R7 3
|
||||
0x80040E00, // 002A RET 1 R7
|
||||
0x70020010, // 002B JMP #003D
|
||||
0x541EFFFB, // 002C LDINT R7 65532
|
||||
0x1C1C0C07, // 002D EQ R7 R6 R7
|
||||
0x781E0005, // 002E JMPF R7 #0035
|
||||
0x8C1C0907, // 002F GETMET R7 R4 K7
|
||||
0x8824090C, // 0030 GETMBR R9 R4 K12
|
||||
0x58280005, // 0031 LDCONST R10 K5
|
||||
0x7C1C0600, // 0032 CALL R7 3
|
||||
0x80040E00, // 0033 RET 1 R7
|
||||
0x70020007, // 0034 JMP #003D
|
||||
0x541EFFFC, // 0035 LDINT R7 65533
|
||||
0x1C1C0C07, // 0036 EQ R7 R6 R7
|
||||
0x781E0004, // 0037 JMPF R7 #003D
|
||||
0x8C1C0907, // 0038 GETMET R7 R4 K7
|
||||
0x8824090C, // 0039 GETMBR R9 R4 K12
|
||||
0x5828000D, // 003A LDCONST R10 K13
|
||||
0x7C1C0600, // 003B CALL R7 3
|
||||
0x80040E00, // 003C RET 1 R7
|
||||
0x70020007, // 003D JMP #0046
|
||||
0x601C0003, // 003E GETGBL R7 G3
|
||||
0x5C200000, // 003F MOVE R8 R0
|
||||
0x7C1C0200, // 0040 CALL R7 1
|
||||
0x8C1C0F0E, // 0041 GETMET R7 R7 K14
|
||||
0x5C240200, // 0042 MOVE R9 R1
|
||||
0x5C280400, // 0043 MOVE R10 R2
|
||||
0x7C1C0600, // 0044 CALL R7 3
|
||||
0x80040E00, // 0045 RET 1 R7
|
||||
0x80000000, // 0046 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: value_changed
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_Illuminance_value_changed, /* 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(attribute_updated),
|
||||
/* K1 */ be_const_int(0),
|
||||
}),
|
||||
be_str_weak(value_changed),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[ 5]) { /* code */
|
||||
0x8C080100, // 0000 GETMET R2 R0 K0
|
||||
0x541203FF, // 0001 LDINT R4 1024
|
||||
0x58140001, // 0002 LDCONST R5 K1
|
||||
0x7C080600, // 0003 CALL R2 3
|
||||
0x80000000, // 0004 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: web_values
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_Illuminance_web_values, /* name */
|
||||
be_nested_proto(
|
||||
11, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 7]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(webserver),
|
||||
/* K1 */ be_nested_str_weak(string),
|
||||
/* K2 */ be_nested_str_weak(content_send),
|
||||
/* K3 */ be_nested_str_weak(format),
|
||||
/* K4 */ be_nested_str_weak(_X7C_X20_X25s_X20_X26_X23128261_X3B_X20_X25ilux),
|
||||
/* K5 */ be_nested_str_weak(filter_name_html),
|
||||
/* K6 */ be_nested_str_weak(shadow_value),
|
||||
}),
|
||||
be_str_weak(web_values),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[13]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0xA40A0200, // 0001 IMPORT R2 K1
|
||||
0x8C0C0302, // 0002 GETMET R3 R1 K2
|
||||
0x8C140503, // 0003 GETMET R5 R2 K3
|
||||
0x581C0004, // 0004 LDCONST R7 K4
|
||||
0x8C200105, // 0005 GETMET R8 R0 K5
|
||||
0x7C200200, // 0006 CALL R8 1
|
||||
0x60240009, // 0007 GETGBL R9 G9
|
||||
0x88280106, // 0008 GETMBR R10 R0 K6
|
||||
0x7C240200, // 0009 CALL R9 1
|
||||
0x7C140800, // 000A CALL R5 4
|
||||
0x7C0C0400, // 000B CALL R3 2
|
||||
0x80000000, // 000C RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified class: Matter_Plugin_Bridge_Sensor_Illuminance
|
||||
********************************************************************/
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_Sensor;
|
||||
be_local_class(Matter_Plugin_Bridge_Sensor_Illuminance,
|
||||
0,
|
||||
&be_class_Matter_Plugin_Bridge_Sensor,
|
||||
be_nested_map(8,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_weak(pre_value, 1), be_const_closure(Matter_Plugin_Bridge_Sensor_Illuminance_pre_value_closure) },
|
||||
{ be_const_key_weak(web_values, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_Illuminance_web_values_closure) },
|
||||
{ be_const_key_weak(CLUSTERS, 3), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
|
||||
be_const_map( * be_nested_map(1,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_int(1024, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
|
||||
be_const_list( * be_nested_list(5,
|
||||
( (struct bvalue*) &(const bvalue[]) {
|
||||
be_const_int(0),
|
||||
be_const_int(1),
|
||||
be_const_int(2),
|
||||
be_const_int(65532),
|
||||
be_const_int(65533),
|
||||
})) ) } )) },
|
||||
})) ) } )) },
|
||||
{ be_const_key_weak(read_attribute, 7), be_const_closure(Matter_Plugin_Bridge_Sensor_Illuminance_read_attribute_closure) },
|
||||
{ be_const_key_weak(value_changed, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_Illuminance_value_changed_closure) },
|
||||
{ be_const_key_weak(TYPE, 4), be_nested_str_weak(http_illuminance) },
|
||||
{ be_const_key_weak(NAME, -1), be_nested_str_weak(_X26_X23x1F517_X3B_X20Illuminance) },
|
||||
{ be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
|
||||
be_const_map( * be_nested_map(2,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_int(262, -1), be_const_int(2) },
|
||||
{ be_const_key_int(19, -1), be_const_int(1) },
|
||||
})) ) } )) },
|
||||
})),
|
||||
be_str_weak(Matter_Plugin_Bridge_Sensor_Illuminance)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
void be_load_Matter_Plugin_Bridge_Sensor_Illuminance_class(bvm *vm) {
|
||||
be_pushntvclass(vm, &be_class_Matter_Plugin_Bridge_Sensor_Illuminance);
|
||||
be_setglobal(vm, "Matter_Plugin_Bridge_Sensor_Illuminance");
|
||||
be_pop(vm, 1);
|
||||
}
|
||||
/********************************************************************/
|
||||
/* End of solidification */
|
|
@ -0,0 +1,271 @@
|
|||
/* Solidification of Matter_Plugin_Bridge_Sensor_Pressure.h */
|
||||
/********************************************************************\
|
||||
* Generated code, don't edit *
|
||||
\********************************************************************/
|
||||
#include "be_constobj.h"
|
||||
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_Sensor_Pressure;
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: pre_value
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_Pressure_pre_value, /* name */
|
||||
be_nested_proto(
|
||||
4, /* nstack */
|
||||
2, /* 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(pre_value),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[ 9]) { /* code */
|
||||
0x4C080000, // 0000 LDNIL R2
|
||||
0x20080202, // 0001 NE R2 R1 R2
|
||||
0x780A0003, // 0002 JMPF R2 #0007
|
||||
0x60080009, // 0003 GETGBL R2 G9
|
||||
0x5C0C0200, // 0004 MOVE R3 R1
|
||||
0x7C080200, // 0005 CALL R2 1
|
||||
0x70020000, // 0006 JMP #0008
|
||||
0x4C080000, // 0007 LDNIL R2
|
||||
0x80040400, // 0008 RET 1 R2
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: read_attribute
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_Pressure_read_attribute, /* name */
|
||||
be_nested_proto(
|
||||
12, /* nstack */
|
||||
3, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[15]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(string),
|
||||
/* K1 */ be_nested_str_weak(matter),
|
||||
/* K2 */ be_nested_str_weak(TLV),
|
||||
/* K3 */ be_nested_str_weak(cluster),
|
||||
/* K4 */ be_nested_str_weak(attribute),
|
||||
/* K5 */ be_const_int(0),
|
||||
/* K6 */ be_nested_str_weak(shadow_value),
|
||||
/* K7 */ be_nested_str_weak(create_TLV),
|
||||
/* K8 */ be_nested_str_weak(I2),
|
||||
/* K9 */ be_nested_str_weak(NULL),
|
||||
/* K10 */ be_const_int(1),
|
||||
/* K11 */ be_const_int(2),
|
||||
/* K12 */ be_nested_str_weak(U4),
|
||||
/* K13 */ be_const_int(3),
|
||||
/* K14 */ be_nested_str_weak(read_attribute),
|
||||
}),
|
||||
be_str_weak(read_attribute),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[71]) { /* 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
|
||||
0x541E0402, // 0005 LDINT R7 1027
|
||||
0x1C1C0A07, // 0006 EQ R7 R5 R7
|
||||
0x781E0035, // 0007 JMPF R7 #003E
|
||||
0x1C1C0D05, // 0008 EQ R7 R6 K5
|
||||
0x781E0011, // 0009 JMPF R7 #001C
|
||||
0x881C0106, // 000A GETMBR R7 R0 K6
|
||||
0x4C200000, // 000B LDNIL R8
|
||||
0x201C0E08, // 000C NE R7 R7 R8
|
||||
0x781E0007, // 000D JMPF R7 #0016
|
||||
0x8C1C0907, // 000E GETMET R7 R4 K7
|
||||
0x88240908, // 000F GETMBR R9 R4 K8
|
||||
0x60280009, // 0010 GETGBL R10 G9
|
||||
0x882C0106, // 0011 GETMBR R11 R0 K6
|
||||
0x7C280200, // 0012 CALL R10 1
|
||||
0x7C1C0600, // 0013 CALL R7 3
|
||||
0x80040E00, // 0014 RET 1 R7
|
||||
0x70020004, // 0015 JMP #001B
|
||||
0x8C1C0907, // 0016 GETMET R7 R4 K7
|
||||
0x88240909, // 0017 GETMBR R9 R4 K9
|
||||
0x4C280000, // 0018 LDNIL R10
|
||||
0x7C1C0600, // 0019 CALL R7 3
|
||||
0x80040E00, // 001A RET 1 R7
|
||||
0x70020020, // 001B JMP #003D
|
||||
0x1C1C0D0A, // 001C EQ R7 R6 K10
|
||||
0x781E0005, // 001D JMPF R7 #0024
|
||||
0x8C1C0907, // 001E GETMET R7 R4 K7
|
||||
0x88240908, // 001F GETMBR R9 R4 K8
|
||||
0x542A01F3, // 0020 LDINT R10 500
|
||||
0x7C1C0600, // 0021 CALL R7 3
|
||||
0x80040E00, // 0022 RET 1 R7
|
||||
0x70020018, // 0023 JMP #003D
|
||||
0x1C1C0D0B, // 0024 EQ R7 R6 K11
|
||||
0x781E0005, // 0025 JMPF R7 #002C
|
||||
0x8C1C0907, // 0026 GETMET R7 R4 K7
|
||||
0x88240908, // 0027 GETMBR R9 R4 K8
|
||||
0x542A05DB, // 0028 LDINT R10 1500
|
||||
0x7C1C0600, // 0029 CALL R7 3
|
||||
0x80040E00, // 002A RET 1 R7
|
||||
0x70020010, // 002B JMP #003D
|
||||
0x541EFFFB, // 002C LDINT R7 65532
|
||||
0x1C1C0C07, // 002D EQ R7 R6 R7
|
||||
0x781E0005, // 002E JMPF R7 #0035
|
||||
0x8C1C0907, // 002F GETMET R7 R4 K7
|
||||
0x8824090C, // 0030 GETMBR R9 R4 K12
|
||||
0x58280005, // 0031 LDCONST R10 K5
|
||||
0x7C1C0600, // 0032 CALL R7 3
|
||||
0x80040E00, // 0033 RET 1 R7
|
||||
0x70020007, // 0034 JMP #003D
|
||||
0x541EFFFC, // 0035 LDINT R7 65533
|
||||
0x1C1C0C07, // 0036 EQ R7 R6 R7
|
||||
0x781E0004, // 0037 JMPF R7 #003D
|
||||
0x8C1C0907, // 0038 GETMET R7 R4 K7
|
||||
0x8824090C, // 0039 GETMBR R9 R4 K12
|
||||
0x5828000D, // 003A LDCONST R10 K13
|
||||
0x7C1C0600, // 003B CALL R7 3
|
||||
0x80040E00, // 003C RET 1 R7
|
||||
0x70020007, // 003D JMP #0046
|
||||
0x601C0003, // 003E GETGBL R7 G3
|
||||
0x5C200000, // 003F MOVE R8 R0
|
||||
0x7C1C0200, // 0040 CALL R7 1
|
||||
0x8C1C0F0E, // 0041 GETMET R7 R7 K14
|
||||
0x5C240200, // 0042 MOVE R9 R1
|
||||
0x5C280400, // 0043 MOVE R10 R2
|
||||
0x7C1C0600, // 0044 CALL R7 3
|
||||
0x80040E00, // 0045 RET 1 R7
|
||||
0x80000000, // 0046 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: value_changed
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_Pressure_value_changed, /* 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(attribute_updated),
|
||||
/* K1 */ be_const_int(0),
|
||||
}),
|
||||
be_str_weak(value_changed),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[ 5]) { /* code */
|
||||
0x8C080100, // 0000 GETMET R2 R0 K0
|
||||
0x54120402, // 0001 LDINT R4 1027
|
||||
0x58140001, // 0002 LDCONST R5 K1
|
||||
0x7C080600, // 0003 CALL R2 3
|
||||
0x80000000, // 0004 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: web_values
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_Pressure_web_values, /* name */
|
||||
be_nested_proto(
|
||||
11, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 7]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(webserver),
|
||||
/* K1 */ be_nested_str_weak(string),
|
||||
/* K2 */ be_nested_str_weak(content_send),
|
||||
/* K3 */ be_nested_str_weak(format),
|
||||
/* K4 */ be_nested_str_weak(_X7C_X20_X25s_X20_X26_X23x26C5_X3B_X20_X25i_X20hPa),
|
||||
/* K5 */ be_nested_str_weak(filter_name_html),
|
||||
/* K6 */ be_nested_str_weak(shadow_value),
|
||||
}),
|
||||
be_str_weak(web_values),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[13]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0xA40A0200, // 0001 IMPORT R2 K1
|
||||
0x8C0C0302, // 0002 GETMET R3 R1 K2
|
||||
0x8C140503, // 0003 GETMET R5 R2 K3
|
||||
0x581C0004, // 0004 LDCONST R7 K4
|
||||
0x8C200105, // 0005 GETMET R8 R0 K5
|
||||
0x7C200200, // 0006 CALL R8 1
|
||||
0x60240009, // 0007 GETGBL R9 G9
|
||||
0x88280106, // 0008 GETMBR R10 R0 K6
|
||||
0x7C240200, // 0009 CALL R9 1
|
||||
0x7C140800, // 000A CALL R5 4
|
||||
0x7C0C0400, // 000B CALL R3 2
|
||||
0x80000000, // 000C RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified class: Matter_Plugin_Bridge_Sensor_Pressure
|
||||
********************************************************************/
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_Sensor;
|
||||
be_local_class(Matter_Plugin_Bridge_Sensor_Pressure,
|
||||
0,
|
||||
&be_class_Matter_Plugin_Bridge_Sensor,
|
||||
be_nested_map(8,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_weak(pre_value, 1), be_const_closure(Matter_Plugin_Bridge_Sensor_Pressure_pre_value_closure) },
|
||||
{ be_const_key_weak(web_values, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_Pressure_web_values_closure) },
|
||||
{ be_const_key_weak(CLUSTERS, 3), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
|
||||
be_const_map( * be_nested_map(1,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_int(1027, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
|
||||
be_const_list( * be_nested_list(5,
|
||||
( (struct bvalue*) &(const bvalue[]) {
|
||||
be_const_int(0),
|
||||
be_const_int(1),
|
||||
be_const_int(2),
|
||||
be_const_int(65532),
|
||||
be_const_int(65533),
|
||||
})) ) } )) },
|
||||
})) ) } )) },
|
||||
{ be_const_key_weak(read_attribute, 7), be_const_closure(Matter_Plugin_Bridge_Sensor_Pressure_read_attribute_closure) },
|
||||
{ be_const_key_weak(value_changed, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_Pressure_value_changed_closure) },
|
||||
{ be_const_key_weak(TYPE, 4), be_nested_str_weak(http_pressure) },
|
||||
{ be_const_key_weak(NAME, -1), be_nested_str_weak(_X26_X23x1F517_X3B_X20Pressure) },
|
||||
{ be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
|
||||
be_const_map( * be_nested_map(2,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_int(773, -1), be_const_int(2) },
|
||||
{ be_const_key_int(19, 0), be_const_int(1) },
|
||||
})) ) } )) },
|
||||
})),
|
||||
be_str_weak(Matter_Plugin_Bridge_Sensor_Pressure)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
void be_load_Matter_Plugin_Bridge_Sensor_Pressure_class(bvm *vm) {
|
||||
be_pushntvclass(vm, &be_class_Matter_Plugin_Bridge_Sensor_Pressure);
|
||||
be_setglobal(vm, "Matter_Plugin_Bridge_Sensor_Pressure");
|
||||
be_pop(vm, 1);
|
||||
}
|
||||
/********************************************************************/
|
||||
/* End of solidification */
|
|
@ -0,0 +1,277 @@
|
|||
/* Solidification of Matter_Plugin_Bridge_Sensor_Temp.h */
|
||||
/********************************************************************\
|
||||
* Generated code, don't edit *
|
||||
\********************************************************************/
|
||||
#include "be_constobj.h"
|
||||
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_Sensor_Temp;
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: pre_value
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_Temp_pre_value, /* name */
|
||||
be_nested_proto(
|
||||
4, /* nstack */
|
||||
2, /* 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(pre_value),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[10]) { /* code */
|
||||
0x4C080000, // 0000 LDNIL R2
|
||||
0x20080202, // 0001 NE R2 R1 R2
|
||||
0x780A0004, // 0002 JMPF R2 #0008
|
||||
0x60080009, // 0003 GETGBL R2 G9
|
||||
0x540E0063, // 0004 LDINT R3 100
|
||||
0x080C0203, // 0005 MUL R3 R1 R3
|
||||
0x7C080200, // 0006 CALL R2 1
|
||||
0x70020000, // 0007 JMP #0009
|
||||
0x4C080000, // 0008 LDNIL R2
|
||||
0x80040400, // 0009 RET 1 R2
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: read_attribute
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_Temp_read_attribute, /* name */
|
||||
be_nested_proto(
|
||||
11, /* nstack */
|
||||
3, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[14]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(string),
|
||||
/* K1 */ be_nested_str_weak(matter),
|
||||
/* K2 */ be_nested_str_weak(TLV),
|
||||
/* K3 */ be_nested_str_weak(cluster),
|
||||
/* K4 */ be_nested_str_weak(attribute),
|
||||
/* K5 */ be_const_int(0),
|
||||
/* K6 */ be_nested_str_weak(shadow_value),
|
||||
/* K7 */ be_nested_str_weak(create_TLV),
|
||||
/* K8 */ be_nested_str_weak(I2),
|
||||
/* K9 */ be_nested_str_weak(NULL),
|
||||
/* K10 */ be_const_int(1),
|
||||
/* K11 */ be_const_int(2),
|
||||
/* K12 */ be_nested_str_weak(U4),
|
||||
/* K13 */ be_nested_str_weak(read_attribute),
|
||||
}),
|
||||
be_str_weak(read_attribute),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[69]) { /* code */
|
||||
0xA40E0000, // 0000 IMPORT R3 K0
|
||||
0xB8120200, // 0001 GETNGBL R4 K1
|
||||
0x88100902, // 0002 GETMBR R4 R4 K2
|
||||
0x88140503, // 0003 GETMBR R5 R2 K3
|
||||
0x88180504, // 0004 GETMBR R6 R2 K4
|
||||
0x541E0401, // 0005 LDINT R7 1026
|
||||
0x1C1C0A07, // 0006 EQ R7 R5 R7
|
||||
0x781E0033, // 0007 JMPF R7 #003C
|
||||
0x1C1C0D05, // 0008 EQ R7 R6 K5
|
||||
0x781E000F, // 0009 JMPF R7 #001A
|
||||
0x881C0106, // 000A GETMBR R7 R0 K6
|
||||
0x4C200000, // 000B LDNIL R8
|
||||
0x201C0E08, // 000C NE R7 R7 R8
|
||||
0x781E0005, // 000D JMPF R7 #0014
|
||||
0x8C1C0907, // 000E GETMET R7 R4 K7
|
||||
0x88240908, // 000F GETMBR R9 R4 K8
|
||||
0x88280106, // 0010 GETMBR R10 R0 K6
|
||||
0x7C1C0600, // 0011 CALL R7 3
|
||||
0x80040E00, // 0012 RET 1 R7
|
||||
0x70020004, // 0013 JMP #0019
|
||||
0x8C1C0907, // 0014 GETMET R7 R4 K7
|
||||
0x88240909, // 0015 GETMBR R9 R4 K9
|
||||
0x4C280000, // 0016 LDNIL R10
|
||||
0x7C1C0600, // 0017 CALL R7 3
|
||||
0x80040E00, // 0018 RET 1 R7
|
||||
0x70020020, // 0019 JMP #003B
|
||||
0x1C1C0D0A, // 001A EQ R7 R6 K10
|
||||
0x781E0005, // 001B JMPF R7 #0022
|
||||
0x8C1C0907, // 001C GETMET R7 R4 K7
|
||||
0x88240908, // 001D GETMBR R9 R4 K8
|
||||
0x5429EC77, // 001E LDINT R10 -5000
|
||||
0x7C1C0600, // 001F CALL R7 3
|
||||
0x80040E00, // 0020 RET 1 R7
|
||||
0x70020018, // 0021 JMP #003B
|
||||
0x1C1C0D0B, // 0022 EQ R7 R6 K11
|
||||
0x781E0005, // 0023 JMPF R7 #002A
|
||||
0x8C1C0907, // 0024 GETMET R7 R4 K7
|
||||
0x88240908, // 0025 GETMBR R9 R4 K8
|
||||
0x542A3A97, // 0026 LDINT R10 15000
|
||||
0x7C1C0600, // 0027 CALL R7 3
|
||||
0x80040E00, // 0028 RET 1 R7
|
||||
0x70020010, // 0029 JMP #003B
|
||||
0x541EFFFB, // 002A LDINT R7 65532
|
||||
0x1C1C0C07, // 002B EQ R7 R6 R7
|
||||
0x781E0005, // 002C JMPF R7 #0033
|
||||
0x8C1C0907, // 002D GETMET R7 R4 K7
|
||||
0x8824090C, // 002E GETMBR R9 R4 K12
|
||||
0x58280005, // 002F LDCONST R10 K5
|
||||
0x7C1C0600, // 0030 CALL R7 3
|
||||
0x80040E00, // 0031 RET 1 R7
|
||||
0x70020007, // 0032 JMP #003B
|
||||
0x541EFFFC, // 0033 LDINT R7 65533
|
||||
0x1C1C0C07, // 0034 EQ R7 R6 R7
|
||||
0x781E0004, // 0035 JMPF R7 #003B
|
||||
0x8C1C0907, // 0036 GETMET R7 R4 K7
|
||||
0x8824090C, // 0037 GETMBR R9 R4 K12
|
||||
0x542A0003, // 0038 LDINT R10 4
|
||||
0x7C1C0600, // 0039 CALL R7 3
|
||||
0x80040E00, // 003A RET 1 R7
|
||||
0x70020007, // 003B JMP #0044
|
||||
0x601C0003, // 003C GETGBL R7 G3
|
||||
0x5C200000, // 003D MOVE R8 R0
|
||||
0x7C1C0200, // 003E CALL R7 1
|
||||
0x8C1C0F0D, // 003F GETMET R7 R7 K13
|
||||
0x5C240200, // 0040 MOVE R9 R1
|
||||
0x5C280400, // 0041 MOVE R10 R2
|
||||
0x7C1C0600, // 0042 CALL R7 3
|
||||
0x80040E00, // 0043 RET 1 R7
|
||||
0x80000000, // 0044 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: value_changed
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_Temp_value_changed, /* 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(attribute_updated),
|
||||
/* K1 */ be_const_int(0),
|
||||
}),
|
||||
be_str_weak(value_changed),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[ 5]) { /* code */
|
||||
0x8C080100, // 0000 GETMET R2 R0 K0
|
||||
0x54120401, // 0001 LDINT R4 1026
|
||||
0x58140001, // 0002 LDCONST R5 K1
|
||||
0x7C080600, // 0003 CALL R2 3
|
||||
0x80000000, // 0004 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: web_values
|
||||
********************************************************************/
|
||||
be_local_closure(Matter_Plugin_Bridge_Sensor_Temp_web_values, /* name */
|
||||
be_nested_proto(
|
||||
11, /* nstack */
|
||||
1, /* argc */
|
||||
2, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 7]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(webserver),
|
||||
/* K1 */ be_nested_str_weak(string),
|
||||
/* K2 */ be_nested_str_weak(content_send),
|
||||
/* K3 */ be_nested_str_weak(format),
|
||||
/* K4 */ be_nested_str_weak(_X7C_X20_X25s_X20_X26_X23x2600_X3B_X26_X23xFE0F_X3B_X20_X25_X2E1f_X20_XC2_XB0C),
|
||||
/* K5 */ be_nested_str_weak(filter_name_html),
|
||||
/* K6 */ be_nested_str_weak(shadow_value),
|
||||
}),
|
||||
be_str_weak(web_values),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[21]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0xA40A0200, // 0001 IMPORT R2 K1
|
||||
0x8C0C0302, // 0002 GETMET R3 R1 K2
|
||||
0x8C140503, // 0003 GETMET R5 R2 K3
|
||||
0x581C0004, // 0004 LDCONST R7 K4
|
||||
0x8C200105, // 0005 GETMET R8 R0 K5
|
||||
0x7C200200, // 0006 CALL R8 1
|
||||
0x88240106, // 0007 GETMBR R9 R0 K6
|
||||
0x4C280000, // 0008 LDNIL R10
|
||||
0x2024120A, // 0009 NE R9 R9 R10
|
||||
0x78260005, // 000A JMPF R9 #0011
|
||||
0x6024000A, // 000B GETGBL R9 G10
|
||||
0x88280106, // 000C GETMBR R10 R0 K6
|
||||
0x7C240200, // 000D CALL R9 1
|
||||
0x542A0063, // 000E LDINT R10 100
|
||||
0x0C24120A, // 000F DIV R9 R9 R10
|
||||
0x70020000, // 0010 JMP #0012
|
||||
0x4C240000, // 0011 LDNIL R9
|
||||
0x7C140800, // 0012 CALL R5 4
|
||||
0x7C0C0400, // 0013 CALL R3 2
|
||||
0x80000000, // 0014 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified class: Matter_Plugin_Bridge_Sensor_Temp
|
||||
********************************************************************/
|
||||
extern const bclass be_class_Matter_Plugin_Bridge_Sensor;
|
||||
be_local_class(Matter_Plugin_Bridge_Sensor_Temp,
|
||||
0,
|
||||
&be_class_Matter_Plugin_Bridge_Sensor,
|
||||
be_nested_map(8,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_weak(pre_value, 1), be_const_closure(Matter_Plugin_Bridge_Sensor_Temp_pre_value_closure) },
|
||||
{ be_const_key_weak(web_values, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_Temp_web_values_closure) },
|
||||
{ be_const_key_weak(CLUSTERS, 3), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
|
||||
be_const_map( * be_nested_map(1,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_int(1026, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
|
||||
be_const_list( * be_nested_list(5,
|
||||
( (struct bvalue*) &(const bvalue[]) {
|
||||
be_const_int(0),
|
||||
be_const_int(1),
|
||||
be_const_int(2),
|
||||
be_const_int(65532),
|
||||
be_const_int(65533),
|
||||
})) ) } )) },
|
||||
})) ) } )) },
|
||||
{ be_const_key_weak(read_attribute, 7), be_const_closure(Matter_Plugin_Bridge_Sensor_Temp_read_attribute_closure) },
|
||||
{ be_const_key_weak(value_changed, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_Temp_value_changed_closure) },
|
||||
{ be_const_key_weak(TYPE, 4), be_nested_str_weak(http_temperature) },
|
||||
{ be_const_key_weak(NAME, -1), be_nested_str_weak(_X26_X23x1F517_X3B_X20Temperature) },
|
||||
{ be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
|
||||
be_const_map( * be_nested_map(2,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_const_key_int(770, -1), be_const_int(2) },
|
||||
{ be_const_key_int(19, -1), be_const_int(1) },
|
||||
})) ) } )) },
|
||||
})),
|
||||
be_str_weak(Matter_Plugin_Bridge_Sensor_Temp)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
void be_load_Matter_Plugin_Bridge_Sensor_Temp_class(bvm *vm) {
|
||||
be_pushntvclass(vm, &be_class_Matter_Plugin_Bridge_Sensor_Temp);
|
||||
be_setglobal(vm, "Matter_Plugin_Bridge_Sensor_Temp");
|
||||
be_pop(vm, 1);
|
||||
}
|
||||
/********************************************************************/
|
||||
/* End of solidification */
|
|
@ -31,28 +31,31 @@ be_local_closure(Matter_Plugin_Light0_update_shadow, /* name */
|
|||
}),
|
||||
be_str_weak(update_shadow),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[21]) { /* code */
|
||||
( &(const binstruction[24]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0x8C080301, // 0001 GETMET R2 R1 K1
|
||||
0x7C080200, // 0002 CALL R2 1
|
||||
0x8C0C0502, // 0003 GETMET R3 R2 K2
|
||||
0x58140003, // 0004 LDCONST R5 K3
|
||||
0x4C180000, // 0005 LDNIL R6
|
||||
0x7C0C0600, // 0006 CALL R3 3
|
||||
0x88100104, // 0007 GETMBR R4 R0 K4
|
||||
0x20100604, // 0008 NE R4 R3 R4
|
||||
0x78120004, // 0009 JMPF R4 #000F
|
||||
0x8C100105, // 000A GETMET R4 R0 K5
|
||||
0x541A0005, // 000B LDINT R6 6
|
||||
0x581C0006, // 000C LDCONST R7 K6
|
||||
0x7C100600, // 000D CALL R4 3
|
||||
0x90020803, // 000E SETMBR R0 K4 R3
|
||||
0x60100003, // 000F GETGBL R4 G3
|
||||
0x5C140000, // 0010 MOVE R5 R0
|
||||
0x7C100200, // 0011 CALL R4 1
|
||||
0x8C100907, // 0012 GETMET R4 R4 K7
|
||||
0x7C100200, // 0013 CALL R4 1
|
||||
0x80000000, // 0014 RET 0
|
||||
0x4C0C0000, // 0003 LDNIL R3
|
||||
0x200C0403, // 0004 NE R3 R2 R3
|
||||
0x780E000B, // 0005 JMPF R3 #0012
|
||||
0x8C0C0502, // 0006 GETMET R3 R2 K2
|
||||
0x58140003, // 0007 LDCONST R5 K3
|
||||
0x4C180000, // 0008 LDNIL R6
|
||||
0x7C0C0600, // 0009 CALL R3 3
|
||||
0x88100104, // 000A GETMBR R4 R0 K4
|
||||
0x20100604, // 000B NE R4 R3 R4
|
||||
0x78120004, // 000C JMPF R4 #0012
|
||||
0x8C100105, // 000D GETMET R4 R0 K5
|
||||
0x541A0005, // 000E LDINT R6 6
|
||||
0x581C0006, // 000F LDCONST R7 K6
|
||||
0x7C100600, // 0010 CALL R4 3
|
||||
0x90020803, // 0011 SETMBR R0 K4 R3
|
||||
0x600C0003, // 0012 GETGBL R3 G3
|
||||
0x5C100000, // 0013 MOVE R4 R0
|
||||
0x7C0C0200, // 0014 CALL R3 1
|
||||
0x8C0C0707, // 0015 GETMET R3 R3 K7
|
||||
0x7C0C0200, // 0016 CALL R3 1
|
||||
0x80000000, // 0017 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
|
|
|
@ -33,40 +33,43 @@ be_local_closure(Matter_Plugin_Light1_update_shadow, /* name */
|
|||
}),
|
||||
be_str_weak(update_shadow),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[33]) { /* code */
|
||||
( &(const binstruction[36]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0x8C080301, // 0001 GETMET R2 R1 K1
|
||||
0x7C080200, // 0002 CALL R2 1
|
||||
0x8C0C0502, // 0003 GETMET R3 R2 K2
|
||||
0x58140003, // 0004 LDCONST R5 K3
|
||||
0x4C180000, // 0005 LDNIL R6
|
||||
0x7C0C0600, // 0006 CALL R3 3
|
||||
0x4C100000, // 0007 LDNIL R4
|
||||
0x20100604, // 0008 NE R4 R3 R4
|
||||
0x78120010, // 0009 JMPF R4 #001B
|
||||
0xB8120800, // 000A GETNGBL R4 K4
|
||||
0x8C100905, // 000B GETMET R4 R4 K5
|
||||
0x5C180600, // 000C MOVE R6 R3
|
||||
0x581C0006, // 000D LDCONST R7 K6
|
||||
0x542200FE, // 000E LDINT R8 255
|
||||
0x58240006, // 000F LDCONST R9 K6
|
||||
0x542A00FD, // 0010 LDINT R10 254
|
||||
0x7C100C00, // 0011 CALL R4 6
|
||||
0x5C0C0800, // 0012 MOVE R3 R4
|
||||
0x88100107, // 0013 GETMBR R4 R0 K7
|
||||
0x20100604, // 0014 NE R4 R3 R4
|
||||
0x78120004, // 0015 JMPF R4 #001B
|
||||
0x8C100108, // 0016 GETMET R4 R0 K8
|
||||
0x541A0007, // 0017 LDINT R6 8
|
||||
0x581C0006, // 0018 LDCONST R7 K6
|
||||
0x7C100600, // 0019 CALL R4 3
|
||||
0x90020E03, // 001A SETMBR R0 K7 R3
|
||||
0x60100003, // 001B GETGBL R4 G3
|
||||
0x5C140000, // 001C MOVE R5 R0
|
||||
0x7C100200, // 001D CALL R4 1
|
||||
0x8C100909, // 001E GETMET R4 R4 K9
|
||||
0x7C100200, // 001F CALL R4 1
|
||||
0x80000000, // 0020 RET 0
|
||||
0x4C0C0000, // 0003 LDNIL R3
|
||||
0x200C0403, // 0004 NE R3 R2 R3
|
||||
0x780E0017, // 0005 JMPF R3 #001E
|
||||
0x8C0C0502, // 0006 GETMET R3 R2 K2
|
||||
0x58140003, // 0007 LDCONST R5 K3
|
||||
0x4C180000, // 0008 LDNIL R6
|
||||
0x7C0C0600, // 0009 CALL R3 3
|
||||
0x4C100000, // 000A LDNIL R4
|
||||
0x20100604, // 000B NE R4 R3 R4
|
||||
0x78120010, // 000C JMPF R4 #001E
|
||||
0xB8120800, // 000D GETNGBL R4 K4
|
||||
0x8C100905, // 000E GETMET R4 R4 K5
|
||||
0x5C180600, // 000F MOVE R6 R3
|
||||
0x581C0006, // 0010 LDCONST R7 K6
|
||||
0x542200FE, // 0011 LDINT R8 255
|
||||
0x58240006, // 0012 LDCONST R9 K6
|
||||
0x542A00FD, // 0013 LDINT R10 254
|
||||
0x7C100C00, // 0014 CALL R4 6
|
||||
0x5C0C0800, // 0015 MOVE R3 R4
|
||||
0x88100107, // 0016 GETMBR R4 R0 K7
|
||||
0x20100604, // 0017 NE R4 R3 R4
|
||||
0x78120004, // 0018 JMPF R4 #001E
|
||||
0x8C100108, // 0019 GETMET R4 R0 K8
|
||||
0x541A0007, // 001A LDINT R6 8
|
||||
0x581C0006, // 001B LDCONST R7 K6
|
||||
0x7C100600, // 001C CALL R4 3
|
||||
0x90020E03, // 001D SETMBR R0 K7 R3
|
||||
0x600C0003, // 001E GETGBL R3 G3
|
||||
0x5C100000, // 001F MOVE R4 R0
|
||||
0x7C0C0200, // 0020 CALL R3 1
|
||||
0x8C0C0709, // 0021 GETMET R3 R3 K9
|
||||
0x7C0C0200, // 0022 CALL R3 1
|
||||
0x80000000, // 0023 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
|
|
|
@ -152,7 +152,7 @@ be_local_closure(Matter_Plugin_Light2_update_shadow, /* name */
|
|||
}),
|
||||
be_str_weak(update_shadow),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[27]) { /* code */
|
||||
( &(const binstruction[30]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0x8C080101, // 0001 GETMET R2 R0 K1
|
||||
0x7C080200, // 0002 CALL R2 1
|
||||
|
@ -163,23 +163,26 @@ be_local_closure(Matter_Plugin_Light2_update_shadow, /* name */
|
|||
0x7C080200, // 0007 CALL R2 1
|
||||
0x8C080303, // 0008 GETMET R2 R1 K3
|
||||
0x7C080200, // 0009 CALL R2 1
|
||||
0x8C0C0504, // 000A GETMET R3 R2 K4
|
||||
0x58140005, // 000B LDCONST R5 K5
|
||||
0x4C180000, // 000C LDNIL R6
|
||||
0x7C0C0600, // 000D CALL R3 3
|
||||
0x4C100000, // 000E LDNIL R4
|
||||
0x1C100604, // 000F EQ R4 R3 R4
|
||||
0x78120000, // 0010 JMPF R4 #0012
|
||||
0x880C0106, // 0011 GETMBR R3 R0 K6
|
||||
0x88100106, // 0012 GETMBR R4 R0 K6
|
||||
0x20100604, // 0013 NE R4 R3 R4
|
||||
0x78120004, // 0014 JMPF R4 #001A
|
||||
0x8C100107, // 0015 GETMET R4 R0 K7
|
||||
0x541A02FF, // 0016 LDINT R6 768
|
||||
0x541E0006, // 0017 LDINT R7 7
|
||||
0x7C100600, // 0018 CALL R4 3
|
||||
0x90020C03, // 0019 SETMBR R0 K6 R3
|
||||
0x80000000, // 001A RET 0
|
||||
0x4C0C0000, // 000A LDNIL R3
|
||||
0x200C0403, // 000B NE R3 R2 R3
|
||||
0x780E000F, // 000C JMPF R3 #001D
|
||||
0x8C0C0504, // 000D GETMET R3 R2 K4
|
||||
0x58140005, // 000E LDCONST R5 K5
|
||||
0x4C180000, // 000F LDNIL R6
|
||||
0x7C0C0600, // 0010 CALL R3 3
|
||||
0x4C100000, // 0011 LDNIL R4
|
||||
0x1C100604, // 0012 EQ R4 R3 R4
|
||||
0x78120000, // 0013 JMPF R4 #0015
|
||||
0x880C0106, // 0014 GETMBR R3 R0 K6
|
||||
0x88100106, // 0015 GETMBR R4 R0 K6
|
||||
0x20100604, // 0016 NE R4 R3 R4
|
||||
0x78120004, // 0017 JMPF R4 #001D
|
||||
0x8C100107, // 0018 GETMET R4 R0 K7
|
||||
0x541A02FF, // 0019 LDINT R6 768
|
||||
0x541E0006, // 001A LDINT R7 7
|
||||
0x7C100600, // 001B CALL R4 3
|
||||
0x90020C03, // 001C SETMBR R0 K6 R3
|
||||
0x80000000, // 001D RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
|
|
|
@ -36,7 +36,7 @@ be_local_closure(Matter_Plugin_Light3_update_shadow, /* name */
|
|||
}),
|
||||
be_str_weak(update_shadow),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[61]) { /* code */
|
||||
( &(const binstruction[64]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0x60080003, // 0001 GETGBL R2 G3
|
||||
0x5C0C0000, // 0002 MOVE R3 R0
|
||||
|
@ -45,59 +45,62 @@ be_local_closure(Matter_Plugin_Light3_update_shadow, /* name */
|
|||
0x7C080200, // 0005 CALL R2 1
|
||||
0x8C080302, // 0006 GETMET R2 R1 K2
|
||||
0x7C080200, // 0007 CALL R2 1
|
||||
0x8C0C0503, // 0008 GETMET R3 R2 K3
|
||||
0x58140004, // 0009 LDCONST R5 K4
|
||||
0x4C180000, // 000A LDNIL R6
|
||||
0x7C0C0600, // 000B CALL R3 3
|
||||
0x8C100503, // 000C GETMET R4 R2 K3
|
||||
0x58180005, // 000D LDCONST R6 K5
|
||||
0x4C1C0000, // 000E LDNIL R7
|
||||
0x7C100600, // 000F CALL R4 3
|
||||
0x4C140000, // 0010 LDNIL R5
|
||||
0x20140605, // 0011 NE R5 R3 R5
|
||||
0x78160009, // 0012 JMPF R5 #001D
|
||||
0xB8160C00, // 0013 GETNGBL R5 K6
|
||||
0x8C140B07, // 0014 GETMET R5 R5 K7
|
||||
0x5C1C0600, // 0015 MOVE R7 R3
|
||||
0x58200008, // 0016 LDCONST R8 K8
|
||||
0x54260167, // 0017 LDINT R9 360
|
||||
0x58280008, // 0018 LDCONST R10 K8
|
||||
0x542E00FD, // 0019 LDINT R11 254
|
||||
0x7C140C00, // 001A CALL R5 6
|
||||
0x5C0C0A00, // 001B MOVE R3 R5
|
||||
0x70020000, // 001C JMP #001E
|
||||
0x880C0109, // 001D GETMBR R3 R0 K9
|
||||
0x4C140000, // 001E LDNIL R5
|
||||
0x20140805, // 001F NE R5 R4 R5
|
||||
0x78160009, // 0020 JMPF R5 #002B
|
||||
0xB8160C00, // 0021 GETNGBL R5 K6
|
||||
0x8C140B07, // 0022 GETMET R5 R5 K7
|
||||
0x5C1C0800, // 0023 MOVE R7 R4
|
||||
0x58200008, // 0024 LDCONST R8 K8
|
||||
0x542600FE, // 0025 LDINT R9 255
|
||||
0x58280008, // 0026 LDCONST R10 K8
|
||||
0x542E00FD, // 0027 LDINT R11 254
|
||||
0x7C140C00, // 0028 CALL R5 6
|
||||
0x5C100A00, // 0029 MOVE R4 R5
|
||||
0x70020000, // 002A JMP #002C
|
||||
0x8810010A, // 002B GETMBR R4 R0 K10
|
||||
0x88140109, // 002C GETMBR R5 R0 K9
|
||||
0x20140605, // 002D NE R5 R3 R5
|
||||
0x78160004, // 002E JMPF R5 #0034
|
||||
0x8C14010B, // 002F GETMET R5 R0 K11
|
||||
0x541E02FF, // 0030 LDINT R7 768
|
||||
0x58200008, // 0031 LDCONST R8 K8
|
||||
0x7C140600, // 0032 CALL R5 3
|
||||
0x90021203, // 0033 SETMBR R0 K9 R3
|
||||
0x8814010A, // 0034 GETMBR R5 R0 K10
|
||||
0x20140805, // 0035 NE R5 R4 R5
|
||||
0x78160004, // 0036 JMPF R5 #003C
|
||||
0x8C14010B, // 0037 GETMET R5 R0 K11
|
||||
0x541E02FF, // 0038 LDINT R7 768
|
||||
0x5820000C, // 0039 LDCONST R8 K12
|
||||
0x7C140600, // 003A CALL R5 3
|
||||
0x90021404, // 003B SETMBR R0 K10 R4
|
||||
0x80000000, // 003C RET 0
|
||||
0x4C0C0000, // 0008 LDNIL R3
|
||||
0x200C0403, // 0009 NE R3 R2 R3
|
||||
0x780E0033, // 000A JMPF R3 #003F
|
||||
0x8C0C0503, // 000B GETMET R3 R2 K3
|
||||
0x58140004, // 000C LDCONST R5 K4
|
||||
0x4C180000, // 000D LDNIL R6
|
||||
0x7C0C0600, // 000E CALL R3 3
|
||||
0x8C100503, // 000F GETMET R4 R2 K3
|
||||
0x58180005, // 0010 LDCONST R6 K5
|
||||
0x4C1C0000, // 0011 LDNIL R7
|
||||
0x7C100600, // 0012 CALL R4 3
|
||||
0x4C140000, // 0013 LDNIL R5
|
||||
0x20140605, // 0014 NE R5 R3 R5
|
||||
0x78160009, // 0015 JMPF R5 #0020
|
||||
0xB8160C00, // 0016 GETNGBL R5 K6
|
||||
0x8C140B07, // 0017 GETMET R5 R5 K7
|
||||
0x5C1C0600, // 0018 MOVE R7 R3
|
||||
0x58200008, // 0019 LDCONST R8 K8
|
||||
0x54260167, // 001A LDINT R9 360
|
||||
0x58280008, // 001B LDCONST R10 K8
|
||||
0x542E00FD, // 001C LDINT R11 254
|
||||
0x7C140C00, // 001D CALL R5 6
|
||||
0x5C0C0A00, // 001E MOVE R3 R5
|
||||
0x70020000, // 001F JMP #0021
|
||||
0x880C0109, // 0020 GETMBR R3 R0 K9
|
||||
0x4C140000, // 0021 LDNIL R5
|
||||
0x20140805, // 0022 NE R5 R4 R5
|
||||
0x78160009, // 0023 JMPF R5 #002E
|
||||
0xB8160C00, // 0024 GETNGBL R5 K6
|
||||
0x8C140B07, // 0025 GETMET R5 R5 K7
|
||||
0x5C1C0800, // 0026 MOVE R7 R4
|
||||
0x58200008, // 0027 LDCONST R8 K8
|
||||
0x542600FE, // 0028 LDINT R9 255
|
||||
0x58280008, // 0029 LDCONST R10 K8
|
||||
0x542E00FD, // 002A LDINT R11 254
|
||||
0x7C140C00, // 002B CALL R5 6
|
||||
0x5C100A00, // 002C MOVE R4 R5
|
||||
0x70020000, // 002D JMP #002F
|
||||
0x8810010A, // 002E GETMBR R4 R0 K10
|
||||
0x88140109, // 002F GETMBR R5 R0 K9
|
||||
0x20140605, // 0030 NE R5 R3 R5
|
||||
0x78160004, // 0031 JMPF R5 #0037
|
||||
0x8C14010B, // 0032 GETMET R5 R0 K11
|
||||
0x541E02FF, // 0033 LDINT R7 768
|
||||
0x58200008, // 0034 LDCONST R8 K8
|
||||
0x7C140600, // 0035 CALL R5 3
|
||||
0x90021203, // 0036 SETMBR R0 K9 R3
|
||||
0x8814010A, // 0037 GETMBR R5 R0 K10
|
||||
0x20140805, // 0038 NE R5 R4 R5
|
||||
0x78160004, // 0039 JMPF R5 #003F
|
||||
0x8C14010B, // 003A GETMET R5 R0 K11
|
||||
0x541E02FF, // 003B LDINT R7 768
|
||||
0x5820000C, // 003C LDCONST R8 K12
|
||||
0x7C140600, // 003D CALL R5 3
|
||||
0x90021404, // 003E SETMBR R0 K10 R4
|
||||
0x80000000, // 003F RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
|
|
|
@ -46,17 +46,18 @@ be_local_closure(Matter_Plugin_OnOff_init, /* name */
|
|||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 6]) { /* constants */
|
||||
( &(const bvalue[ 7]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(init),
|
||||
/* K1 */ be_nested_str_weak(shadow_onoff),
|
||||
/* K2 */ be_nested_str_weak(tasmota_relay_index),
|
||||
/* K3 */ be_nested_str_weak(find),
|
||||
/* K4 */ be_nested_str_weak(ARG),
|
||||
/* K5 */ be_const_int(0),
|
||||
/* K5 */ be_const_int(1),
|
||||
/* K6 */ be_const_int(0),
|
||||
}),
|
||||
be_str_weak(init),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[20]) { /* code */
|
||||
( &(const binstruction[22]) { /* code */
|
||||
0x60100003, // 0000 GETGBL R4 G3
|
||||
0x5C140000, // 0001 MOVE R5 R0
|
||||
0x7C100200, // 0002 CALL R4 1
|
||||
|
@ -67,16 +68,18 @@ be_local_closure(Matter_Plugin_OnOff_init, /* name */
|
|||
0x7C100800, // 0007 CALL R4 4
|
||||
0x50100000, // 0008 LDBOOL R4 0 0
|
||||
0x90020204, // 0009 SETMBR R0 K1 R4
|
||||
0x8C100703, // 000A GETMET R4 R3 K3
|
||||
0x88180104, // 000B GETMBR R6 R0 K4
|
||||
0x7C100400, // 000C CALL R4 2
|
||||
0x90020404, // 000D SETMBR R0 K2 R4
|
||||
0x88100102, // 000E GETMBR R4 R0 K2
|
||||
0x4C140000, // 000F LDNIL R5
|
||||
0x1C100805, // 0010 EQ R4 R4 R5
|
||||
0x78120000, // 0011 JMPF R4 #0013
|
||||
0x90020505, // 0012 SETMBR R0 K2 K5
|
||||
0x80000000, // 0013 RET 0
|
||||
0x60100009, // 000A GETGBL R4 G9
|
||||
0x8C140703, // 000B GETMET R5 R3 K3
|
||||
0x881C0104, // 000C GETMBR R7 R0 K4
|
||||
0x58200005, // 000D LDCONST R8 K5
|
||||
0x7C140600, // 000E CALL R5 3
|
||||
0x7C100200, // 000F CALL R4 1
|
||||
0x90020404, // 0010 SETMBR R0 K2 R4
|
||||
0x88100102, // 0011 GETMBR R4 R0 K2
|
||||
0x18100906, // 0012 LE R4 R4 K6
|
||||
0x78120000, // 0013 JMPF R4 #0015
|
||||
0x90020505, // 0014 SETMBR R0 K2 K5
|
||||
0x80000000, // 0015 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
|
@ -96,25 +99,27 @@ be_local_closure(Matter_Plugin_OnOff_set_onoff, /* name */
|
|||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 4]) { /* constants */
|
||||
( &(const bvalue[ 5]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(tasmota),
|
||||
/* K1 */ be_nested_str_weak(set_power),
|
||||
/* K2 */ be_nested_str_weak(tasmota_relay_index),
|
||||
/* K3 */ be_nested_str_weak(update_shadow),
|
||||
/* K3 */ be_const_int(1),
|
||||
/* K4 */ be_nested_str_weak(update_shadow),
|
||||
}),
|
||||
be_str_weak(set_onoff),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[10]) { /* code */
|
||||
( &(const binstruction[11]) { /* code */
|
||||
0xB80A0000, // 0000 GETNGBL R2 K0
|
||||
0x8C080501, // 0001 GETMET R2 R2 K1
|
||||
0x88100102, // 0002 GETMBR R4 R0 K2
|
||||
0x60140017, // 0003 GETGBL R5 G23
|
||||
0x5C180200, // 0004 MOVE R6 R1
|
||||
0x7C140200, // 0005 CALL R5 1
|
||||
0x7C080600, // 0006 CALL R2 3
|
||||
0x8C080103, // 0007 GETMET R2 R0 K3
|
||||
0x7C080200, // 0008 CALL R2 1
|
||||
0x80000000, // 0009 RET 0
|
||||
0x04100903, // 0003 SUB R4 R4 K3
|
||||
0x60140017, // 0004 GETGBL R5 G23
|
||||
0x5C180200, // 0005 MOVE R6 R1
|
||||
0x7C140200, // 0006 CALL R5 1
|
||||
0x7C080600, // 0007 CALL R2 3
|
||||
0x8C080104, // 0008 GETMET R2 R0 K4
|
||||
0x7C080200, // 0009 CALL R2 1
|
||||
0x80000000, // 000A RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
|
@ -292,46 +297,48 @@ be_local_closure(Matter_Plugin_OnOff_update_shadow, /* name */
|
|||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 7]) { /* constants */
|
||||
( &(const bvalue[ 8]) { /* constants */
|
||||
/* K0 */ be_nested_str_weak(tasmota),
|
||||
/* K1 */ be_nested_str_weak(get_power),
|
||||
/* K2 */ be_nested_str_weak(tasmota_relay_index),
|
||||
/* K3 */ be_nested_str_weak(shadow_onoff),
|
||||
/* K4 */ be_nested_str_weak(attribute_updated),
|
||||
/* K5 */ be_const_int(0),
|
||||
/* K6 */ be_nested_str_weak(update_shadow),
|
||||
/* K3 */ be_const_int(1),
|
||||
/* K4 */ be_nested_str_weak(shadow_onoff),
|
||||
/* K5 */ be_nested_str_weak(attribute_updated),
|
||||
/* K6 */ be_const_int(0),
|
||||
/* K7 */ be_nested_str_weak(update_shadow),
|
||||
}),
|
||||
be_str_weak(update_shadow),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[28]) { /* code */
|
||||
( &(const binstruction[29]) { /* code */
|
||||
0xB8060000, // 0000 GETNGBL R1 K0
|
||||
0x8C040301, // 0001 GETMET R1 R1 K1
|
||||
0x880C0102, // 0002 GETMBR R3 R0 K2
|
||||
0x7C040400, // 0003 CALL R1 2
|
||||
0x4C080000, // 0004 LDNIL R2
|
||||
0x20080202, // 0005 NE R2 R1 R2
|
||||
0x780A000E, // 0006 JMPF R2 #0016
|
||||
0x88080103, // 0007 GETMBR R2 R0 K3
|
||||
0x4C0C0000, // 0008 LDNIL R3
|
||||
0x20080403, // 0009 NE R2 R2 R3
|
||||
0x780A0009, // 000A JMPF R2 #0015
|
||||
0x88080103, // 000B GETMBR R2 R0 K3
|
||||
0x600C0017, // 000C GETGBL R3 G23
|
||||
0x5C100200, // 000D MOVE R4 R1
|
||||
0x7C0C0200, // 000E CALL R3 1
|
||||
0x20080403, // 000F NE R2 R2 R3
|
||||
0x780A0003, // 0010 JMPF R2 #0015
|
||||
0x8C080104, // 0011 GETMET R2 R0 K4
|
||||
0x54120005, // 0012 LDINT R4 6
|
||||
0x58140005, // 0013 LDCONST R5 K5
|
||||
0x7C080600, // 0014 CALL R2 3
|
||||
0x90020601, // 0015 SETMBR R0 K3 R1
|
||||
0x60080003, // 0016 GETGBL R2 G3
|
||||
0x5C0C0000, // 0017 MOVE R3 R0
|
||||
0x7C080200, // 0018 CALL R2 1
|
||||
0x8C080506, // 0019 GETMET R2 R2 K6
|
||||
0x7C080200, // 001A CALL R2 1
|
||||
0x80000000, // 001B RET 0
|
||||
0x040C0703, // 0003 SUB R3 R3 K3
|
||||
0x7C040400, // 0004 CALL R1 2
|
||||
0x4C080000, // 0005 LDNIL R2
|
||||
0x20080202, // 0006 NE R2 R1 R2
|
||||
0x780A000E, // 0007 JMPF R2 #0017
|
||||
0x88080104, // 0008 GETMBR R2 R0 K4
|
||||
0x4C0C0000, // 0009 LDNIL R3
|
||||
0x20080403, // 000A NE R2 R2 R3
|
||||
0x780A0009, // 000B JMPF R2 #0016
|
||||
0x88080104, // 000C GETMBR R2 R0 K4
|
||||
0x600C0017, // 000D GETGBL R3 G23
|
||||
0x5C100200, // 000E MOVE R4 R1
|
||||
0x7C0C0200, // 000F CALL R3 1
|
||||
0x20080403, // 0010 NE R2 R2 R3
|
||||
0x780A0003, // 0011 JMPF R2 #0016
|
||||
0x8C080105, // 0012 GETMET R2 R0 K5
|
||||
0x54120005, // 0013 LDINT R4 6
|
||||
0x58140006, // 0014 LDCONST R5 K6
|
||||
0x7C080600, // 0015 CALL R2 3
|
||||
0x90020801, // 0016 SETMBR R0 K4 R1
|
||||
0x60080003, // 0017 GETGBL R2 G3
|
||||
0x5C0C0000, // 0018 MOVE R3 R0
|
||||
0x7C080200, // 0019 CALL R2 1
|
||||
0x8C080507, // 001A GETMET R2 R2 K7
|
||||
0x7C080200, // 001B CALL R2 1
|
||||
0x80000000, // 001C RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -60,6 +60,51 @@ be_local_closure(matter_sort, /* name */
|
|||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: jitter
|
||||
********************************************************************/
|
||||
be_local_closure(matter_jitter, /* name */
|
||||
be_nested_proto(
|
||||
6, /* nstack */
|
||||
1, /* argc */
|
||||
0, /* 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(crypto),
|
||||
/* K1 */ be_nested_str_weak(random),
|
||||
/* K2 */ be_nested_str_weak(get),
|
||||
/* K3 */ be_const_int(0),
|
||||
/* K4 */ be_const_int(2147483647),
|
||||
/* K5 */ be_nested_str_weak(tasmota),
|
||||
/* K6 */ be_nested_str_weak(millis),
|
||||
}),
|
||||
be_str_weak(jitter),
|
||||
&be_const_str_solidified,
|
||||
( &(const binstruction[14]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0x8C080301, // 0001 GETMET R2 R1 K1
|
||||
0x54120003, // 0002 LDINT R4 4
|
||||
0x7C080400, // 0003 CALL R2 2
|
||||
0x8C080502, // 0004 GETMET R2 R2 K2
|
||||
0x58100003, // 0005 LDCONST R4 K3
|
||||
0x54160003, // 0006 LDINT R5 4
|
||||
0x7C080600, // 0007 CALL R2 3
|
||||
0x2C080504, // 0008 AND R2 R2 K4
|
||||
0xB80E0A00, // 0009 GETNGBL R3 K5
|
||||
0x8C0C0706, // 000A GETMET R3 R3 K6
|
||||
0x10140400, // 000B MOD R5 R2 R0
|
||||
0x7C0C0400, // 000C CALL R3 2
|
||||
0x80040600, // 000D RET 1 R3
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: inspect
|
||||
********************************************************************/
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
xdrv_52_3_berry_matter.ino - Berry support for Matter UI
|
||||
|
||||
Copyright (C) 2021 Stephan Hadinger, Berry language by Guan Wenliang https://github.com/Skiars/berry
|
||||
|
||||
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/>.
|
||||
*/
|
||||
|
||||
// Mappgin from internal light and a generic `light_state` Berry class
|
||||
|
||||
#ifdef USE_BERRY
|
||||
|
||||
// Convert seconds to a string representing days, hours or minutes present in the n-value.
|
||||
// The string will contain the most coarse time only, rounded down (61m == 01h, 01h37m == 01h).
|
||||
// Inputs:
|
||||
// - seconds: uint32_t representing some number of seconds
|
||||
// Outputs:
|
||||
// - char for unit (d for day, h for hour, m for minute)
|
||||
// - the hex color to be used to display the text
|
||||
//
|
||||
extern "C" uint32_t matter_convert_seconds_to_dhm(uint32_t seconds, char *unit, uint32_t *color, bbool days) {
|
||||
*color = WebColor(COL_TEXT);
|
||||
static const uint32_t conversions[3] = {24 * 3600, 3600, 60};
|
||||
static const char units[3] = { 'd', 'h', 'm'}; // day, hour, minute
|
||||
static const uint32_t color_threshold_hours[2] = {24 * 3600, 3600}; // 0 - 1 hour - 1 day
|
||||
static const uint32_t color_threshold_days[2] = {7 * 24 * 3600, 2 * 24 * 3600}; // 0 - 2 days - 7 days
|
||||
|
||||
uint32_t color_text_8 = WebColor(COL_TEXT); // color of text on 8 bits
|
||||
uint8_t color_text_8_r = (color_text_8 & 0xFF0000) >> 16;
|
||||
uint8_t color_text_8_g = (color_text_8 & 0x00FF00) >> 8;
|
||||
uint8_t color_text_8_b = (color_text_8 & 0x0000FF);
|
||||
|
||||
uint32_t color_back_8 = WebColor(COL_BACKGROUND); // color of background on 8 bits
|
||||
uint8_t color_back_8_r = (color_back_8 & 0xFF0000) >> 16;
|
||||
uint8_t color_back_8_g = (color_back_8 & 0x00FF00) >> 8;
|
||||
uint8_t color_back_8_b = (color_back_8 & 0x0000FF);
|
||||
|
||||
int32_t colors[3] = {
|
||||
((changeUIntScale( 6, 0, 16, color_back_8_r, color_text_8_r) & 0xFF) << 16U) | // 6/16 of text
|
||||
((changeUIntScale( 6, 0, 16, color_back_8_g, color_text_8_g) & 0xFF) << 8U) | // 6/16 of text
|
||||
( changeUIntScale( 6, 0, 16, color_back_8_b, color_text_8_r) & 0xFF), // 6/16 of text
|
||||
|
||||
((changeUIntScale(10, 0, 16, color_back_8_r, color_text_8_r) & 0xFF) << 16U) | // 10/16 of text
|
||||
((changeUIntScale(10, 0, 16, color_back_8_g, color_text_8_g) & 0xFF) << 8U) | // 10/16 of text
|
||||
( changeUIntScale(10, 0, 16, color_back_8_b, color_text_8_r) & 0xFF), // 10/16 of text
|
||||
|
||||
(color_text_8_r << 16U) |
|
||||
(color_text_8_g << 8U) |
|
||||
(color_text_8_b)
|
||||
};
|
||||
|
||||
*color = (uint32_t)colors[2];
|
||||
for (uint32_t i = 0; i < 2; i++) {
|
||||
if (seconds > (days ? color_threshold_days[i] : color_threshold_hours[i])) {
|
||||
*color = (uint32_t)colors[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
for(uint32_t i = 0; i < 3; ++i) {
|
||||
*unit = units[i];
|
||||
if (seconds > conversions[i]) { // always pass even if 00m
|
||||
return seconds / conversions[i];
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // USE_BERRY
|
Loading…
Reference in New Issue