34
CONTENTS
•
autoping.items[N].script
: the name of the scripting function run by the Nth AutoPing item when
it's triggered (
""
to cycle the controlled outlets);
•
autoping.items[N].status
: the run-time status of the Nth AutoPing item;
•
autoping.ping_interval
: ping interval;
•
autoping.ping_timeout
: ping timeout;
•
autoping.post_reboot_delay
: post-reboot delay;
•
autoping.max_reboot_count
: maximum reboot count;
•
autoping.pings_before_enabling
: pings before enabling.
7.6.2.12
Network state access
The global
network
table has two similarly-structured members,
network.wired
and
network.
←
-
wireless
, which represent partial read-only views on state and configuration of the respective networks (all
fields are strings unless indicated otherwise):
•
network.(wired
|
wireless).online
: boolean value indicating if the interface is online;
•
network.(wired
|
wireless).protocol
: method for obtaining the IP address (static/dhcp);
•
network.(wired
|
wireless).ip_address
: IP address;
•
network.(wired
|
wireless).netmask
: network mask;
•
network.(wired
|
wireless).gateway
: default gateway;
•
network.(wired
|
wireless).mac_address
: MAC address;
•
network.wireless.enabled
: boolean value indicating if the wireless interface is enabled;
•
network.wireless.mode
: wireless module mode;
•
network.wireless.ssid
: wireless network name;
•
network.wireless.channel
: wireless channel (channel number as string, e.g. "11", or "auto");
•
network.wireless.encryption
: wireless encryption (none/psk/psk-mixed/psk2).
7.6.2.13
Event APIs
The global
event
table allows limited integration of user scripts with the
The
event.send
function can be used to send a
dli.script.script_event
event with custom message
and data. It takes the event properties
script_message
and
script_data
as arguments.
script_
←
-
message
must be a string that will be included in the event message.
script_data
, if supplied, must be a table
with string keys and scalar (boolean, number or string) values, and can be analyzed by the
and/or
used by
. Non-string keys or non-scalar values are ignored; if the
script_data
argument is not a
table, an empty table is sent. All script-generated events have a (possibly empty) table as
script_data
, and
only they have it, so its existence is a distinctive feature of script-generated events.
For example, the following code
event.send("coil 1 energized",{coil_index=1,coil_state=true})
will send an event that can be matched by, among others, the following notification rules:
DLI LPC9 User’s Guide: 1.7.24.0
Summary of Contents for LPC9
Page 1: ...DLI LPC9 User s Guide 1 7 24 0 ...
Page 81: ......