Repository navigation
v0.5.0
Scenario API and interface-process behaviours modelled on
hm-simulator by Sebastian
Raff (MIT) — thanks for documenting what rfd and hmipserver actually
answer. Every behaviour below that concerns the CCU comes from that
documentation and was not measured for godevccu; DOCUMENTATION.md
lists the source of each.
Added
- Fault injection:
VirtualCCU.InjectFault(iface, FaultRule)makes
the next calls of a method answer a fault, answer late, never answer,
or close the connection — on XML-RPC, its TLS twin and BIN-RPC alike;
ClearFaultsdrops the rules and releases held calls. - Interface restarts:
DropConnection,StopInterface,
StartInterface(iface, forgetClients)andRestartInterfacestop an
interface process (its port refuses connections) and bring it back on
the same port, forgetting its clients or calling them back
(system.listMethodson BidCos, thenlistDevices). - Introspection:
WriteLog(every clientsetValue/putParamset
over XML-RPC, BIN-RPC and JSON-RPC, with rejected parameters and the
fault) andCallbackLog(every call to a client with sent/answered
time),ConfigPending,PoisonedChannels,Ports. - Control port:
VirtualCCU.ControlHandler()serves the scenario
API asPOST /scenario/<call>; the CLI exposes it with
-control-port.-ports-json <file|->writes the bound ports once
every server listens; port0now lets the system pick;-realism
and-interfaces Name=port,…reach the realism preset and the
separate interface listeners from the command line. - Realism fields:
InitSemantics(init keyed by exact url,
deleteDevicesbeforenewDevices, VERSION diff, HmIP resend),
MasterModel(rfd's and hmipserver's MASTER write models with sticky
and queuedCONFIG_PENDINGand poisoned channels),InterfaceQuirks
(no PONG from hmipserver, derivedgetServiceMessageswith rfd's
"",SENDER_BROKENon rfd's unfilteredgetLinks, rfd's metadata
faults) — all three part ofRealismCCU()— and
ServiceMessagesFault, which stays out of the preset.
Fixed
- Re-registering or removing a client now stops its batched-event
dispatcher; before, a client re-registered under the same interface id
with a new url kept receiving batched events at the old url.
Changed
- Persisted init registrations (
PersistInit) are written as a list of
{interface_id, url}; the earlier map format is still read. - The
Realism.FaultCodesdoc comment listed codes that did not match
internal/ccu/faults.go; it now names −2/−3/−5 as implemented.