WM-MEGA, WM-M2, WM-MINI2 >= 2.1000
Register a call back to a system event
This function will register a callback which will be called when a system event occurs.</html>
$callback_type:
Name | Description |
---|---|
DATA_RX | Data is received |
DATA_TX | Data is sent |
RS232_RX | Data is received on RS-232 |
RS232_TX | Data is sent on RS-232 |
CONNECTED | Internet is connected via dongle |
DISCONNECTED | Internet is disconnected |
MQTT_CONNECTED | MQTT connection is established |
MQTT_DISCONNECTED | MQTT connection is lost |
MQTT_ERROR | MQTT has an error connecting |
$script_name: Optional name of script to execute, or leave blank ('') in order to specify a function name in the currently executing script.
$function_name: Optional name of function to execute, leave blank if executing a script. This only works if the event occurs while the current script is still running and the hook will be automatically removed once the script terminates.
Integer: 1 on success or 0 on failure
<? register_callback("CONNECTED","/scripts/internet_connected.cgi",""); ?>
unregister_callback() - Remove a callback