A few notes on the comms protocol implementation - these are just observations and may be proved to be false. Any comments welcome:
-
With no tags in either of the I_xxxx file or the D_xxxx file, then the Vera 3 default protocol is crlf - as determined by WireShark.
-
Vera 3 sets the file /etc/sysctl.conf to contain:
net.ipv4.tcp_keepalive_time=120
The usual defaults are:
tcp_keepalive_time = 7200 (seconds)
tcp_keepalive_intvl = 75 (seconds)
tcp_keepalive_probes = 9 (number of probes)
It would seem that Vera 3 starts using keepalives very soon in the piece: 2 minutes vs 2 hours. This may affect keepalive compatibility depending on the OS defaults, connected devices in use, routers, etc. It would seem that some slave devices source their own keepalives. eg GC100 produces one every 10 seconds.
- luup.io.intercept()
Testing suggests the following:
a) Of note: luup.io.intercept() returns a boolean
b) on entry to any function, an initial call to luup.io.intercept() returns true
c) a call to luup.io.write() in that function results in a subsequent call to luup.io.intercept() returning false
d) any number of subsequent calls to luup.io.read() after that initial luup.io.write() in that function makes no difference in what luup.io.intercept() returns. It will continue to return false in all cases.
e) on exit of the function the luup.io.intercept() “appears” to be always (re)set to true, ready for any new function that may call luup.io.intercept()
f) may be passed a device ID parameter but without one, defaults to the current device.
How would that be implememted?