User Tools

Site Tools


uphp:functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
uphp:functions [2018/08/07 10:23]
jeff created, content moved from uphp:functions:uphp_function_reference and links edited
uphp:functions [2019/03/05 09:30]
admin
Line 21: Line 21:
 |[[.functions:debugout]]|<html><span style="color:green">int<span style="color:blue"> 0 or 1</html>||Enable or disable debug messages| |[[.functions:debugout]]|<html><span style="color:green">int<span style="color:blue"> 0 or 1</html>||Enable or disable debug messages|
 |[[.functions:die]]|||Kill the script| |[[.functions:die]]|||Kill the script|
-|[[.functions:disk_free_space]]||<html><span style="color:green">int<span style="color:black"> KiloBytes</html>|Return free space on microSD card+|[[.functions:disk_free_space]]|<html><span style="color:green">int<span style="color:blue"> drive</html>|<html><span style="color:green">int<span style="color:black"> KiloBytes</html>|Return free space on drive| 
-|[[.functions:disk_total_space]]||<html><span style="color:green">int<span style="color:black"> KiloBytes</html>|Return total space on microSD card|+|[[.functions:disk_status]]|<html><span style="color:green">int<span style="color:blue"> drive</html>|<html><span style="color:green">int<span style="color:black"> Status</html>|Return mount status of drive
 +|[[.functions:disk_total_space]]|<html><span style="color:green">int<span style="color:blue"> drive</html>|<html><span style="color:green">int<span style="color:black"> KiloBytes</html>|Return total space on drive|
 |[[.functions:error_reporting]]|<html><span style="color:green">int<span style="color:blue"> verbosity</html>||Set the debug output level| |[[.functions:error_reporting]]|<html><span style="color:green">int<span style="color:blue"> verbosity</html>||Set the debug output level|
 |[[.functions:exec]]|<html><span style="color:green">string<span style="color:blue"> script<span style="color:black">,<span style="color:green"> int<span style="color:blue"> delay</html>||<html>Run a <span style="color:blue">script<span style="color:black"> with an optional <span style="color:blue">delay</html>| |[[.functions:exec]]|<html><span style="color:green">string<span style="color:blue"> script<span style="color:black">,<span style="color:green"> int<span style="color:blue"> delay</html>||<html>Run a <span style="color:blue">script<span style="color:black"> with an optional <span style="color:blue">delay</html>|
Line 53: Line 54:
 |[[.functions:getmac]]||<html><span style="color:green">string<span style="color:black"> MAC</html>|Get the Wattmon's MAC address| |[[.functions:getmac]]||<html><span style="color:green">string<span style="color:black"> MAC</html>|Get the Wattmon's MAC address|
 |[[.functions:getusbstat]]||<html><span style="color:green">array</html>|Get USB host status information| |[[.functions:getusbstat]]||<html><span style="color:green">array</html>|Get USB host status information|
 +|[[.functions:getwifistat]]||<html><span style="color:green">array</html>|Get WIFI status information|
 |[[.functions:header]]|<html><span style="color:green">string<span style="color:blue"> header_data</html>||Add to HTTP header| |[[.functions:header]]|<html><span style="color:green">string<span style="color:blue"> header_data</html>||Add to HTTP header|
 |[[.functions:htmlspecialchars]]|<html><span style="color:green">string<span style="color:blue"> data</html>|<html><span style="color:green">string<span style="color:black"> converted</html>|Convert special characters for display in HTML| |[[.functions:htmlspecialchars]]|<html><span style="color:green">string<span style="color:blue"> data</html>|<html><span style="color:green">string<span style="color:black"> converted</html>|Convert special characters for display in HTML|
Line 78: Line 80:
 |[[.functions:mail]]|<html><span style="color:green">string<span style="color:blue"> recipient<span style="color:black">,<span style="color:green"> string<span style="color:blue"> subject<span style="color:black">,<span style="color:green"> string<span style="color:blue"> body</html>|<html><span style="color:green">int<span style="color:black"> 0 or SMTP error code</html>|Send an email [deprecated]| |[[.functions:mail]]|<html><span style="color:green">string<span style="color:blue"> recipient<span style="color:black">,<span style="color:green"> string<span style="color:blue"> subject<span style="color:black">,<span style="color:green"> string<span style="color:blue"> body</html>|<html><span style="color:green">int<span style="color:black"> 0 or SMTP error code</html>|Send an email [deprecated]|
 |[[.functions:max_execution_time]]|<html><span style="color:green">int<span style="color:blue"> seconds</html>||Set the maximum execution time for the current script| |[[.functions:max_execution_time]]|<html><span style="color:green">int<span style="color:blue"> seconds</html>||Set the maximum execution time for the current script|
-|[[.functions:mb_add_dev]]|<html><span style="color:green">int<span style="color:blue"> id<span style="color:black">,<span style="color:green"> int<span style="color:blue"> type<span style="color:black">,<span style="color:green"> string<span style="color:blue"> name<span style="color:black">,<span style="color:green"> int<span style="color:blue"> poll_interval<span style="color:black">,<span style="color:green"> int<span style="color:blue"> status</html>|<html><span style="color:green">int<span style="color:black"> 0=OK</html>|Add a device to the list of polled devices|+|[[.functions:mb_add_dev]]|<html><span style="color:green">int<span style="color:blue"> id<span style="color:black">,<span style="color:green"> int<span style="color:blue"> type<span style="color:black">,<span style="color:green"> string<span style="color:blue"> name<span style="color:black">,<span style="color:green"> int<span style="color:blue"> poll_interval<span style="color:black">,<span style="color:green"> int<span style="color:blue"> status<span style="color:black">,<span style="color:green"> int<span style="color:blue"> bus</html>|<html><span style="color:green">int<span style="color:black"> 0=OK</html>|Add a device to the list of polled devices|
 |[[.functions:mb_delete_device]]|<html><span style="color:green">int<span style="color:blue"> id</html>|<html><span style="color:green">int<span style="color:black"> 1=OK</html>|Delete a device from the list of active devices| |[[.functions:mb_delete_device]]|<html><span style="color:green">int<span style="color:blue"> id</html>|<html><span style="color:green">int<span style="color:black"> 1=OK</html>|Delete a device from the list of active devices|
 |[[.functions:mb_get_dev_by_id]]|<html><span style="color:green">int<span style="color:blue"> id</html>|<html><span style="color:green">array</html>|Return modbus device details by <html><span style="color:blue">id</html>| |[[.functions:mb_get_dev_by_id]]|<html><span style="color:green">int<span style="color:blue"> id</html>|<html><span style="color:green">array</html>|Return modbus device details by <html><span style="color:blue">id</html>|
Line 88: Line 90:
 |[[.functions:mb_get_val_by_role]]|<html><span style="color:green">int<span style="color:blue"> role</html>|<html><span style="color:green">number</html>|Return value of the <html><span style="color:blue">role</html>| |[[.functions:mb_get_val_by_role]]|<html><span style="color:green">int<span style="color:blue"> role</html>|<html><span style="color:green">number</html>|Return value of the <html><span style="color:blue">role</html>|
 |[[.functions:mb_num_devices]]||<html><span style="color:green">int</html>|Return number of devices on the modbus| |[[.functions:mb_num_devices]]||<html><span style="color:green">int</html>|Return number of devices on the modbus|
-|[[.functions:mb_queue_command]]|<html><span style="color:green">mixed<span style="color:blue"> values<span style="color:black"> ...</html>|<html><span style="color:green">array<span style="color:black"> of numbers</html>|Queue a sequence of characters to the rs485 bus and get but ignore the reply|+|[[.functions:mb_queue_command]]|<html><span style="color:green">mixed<span style="color:blue"> values<span style="color:black"> ...</html>|<html><span style="color:green">array<span style="color:black"> of numbers</html>|Queue a sequence of characters to the RS-485 bus and get but ignore the reply|
 |[[.functions:mb_scan_complete]]||<html><span style="color:green">int<span style="color:black"> 1=complete, 0=ongoing</html>|Check to see if a modbus scan has completed| |[[.functions:mb_scan_complete]]||<html><span style="color:green">int<span style="color:black"> 1=complete, 0=ongoing</html>|Check to see if a modbus scan has completed|
 |[[.functions:mb_scan_percent]]||<html><span style="color:green">number<span style="color:black"> percent completed</html>|Return scan percentage completed| |[[.functions:mb_scan_percent]]||<html><span style="color:green">number<span style="color:black"> percent completed</html>|Return scan percentage completed|
-|[[.functions:mb_send_command]]|<html><span style="color:green">mixed<span style="color:blue"> values<span style="color:black"> ...</html>|<html><span style="color:green">array<span style="color:black"> of numbers</html>|Send a sequence of characters to the rs485 bus and get a reply|+|[[.functions:mb_send_command]]|<html><span style="color:green">mixed<span style="color:blue"> values<span style="color:black"> ...</html>|<html><span style="color:green">array<span style="color:black"> of numbers</html>|Send a sequence of characters to the RS-485 bus and get a reply|
 |[[.functions:mb_set_dev_var]]|<html><span style="color:green">string<span style="color:blue"> name<span style="color:black"> or<span style="color:green"> int<span style="color:blue"> id<span style="color:black">,<span style="color:green"> string<span style="color:blue"> variable<span style="color:black">,<span style="color:green"> mixed<span style="color:blue"> value</html>|<html><span style="color:green">int<span style="color:black"> 1=OK</html>|Set a <html><span style="color:blue">variable<span style="color:black"></html> on a modbus device| |[[.functions:mb_set_dev_var]]|<html><span style="color:green">string<span style="color:blue"> name<span style="color:black"> or<span style="color:green"> int<span style="color:blue"> id<span style="color:black">,<span style="color:green"> string<span style="color:blue"> variable<span style="color:black">,<span style="color:green"> mixed<span style="color:blue"> value</html>|<html><span style="color:green">int<span style="color:black"> 1=OK</html>|Set a <html><span style="color:blue">variable<span style="color:black"></html> on a modbus device|
 |[[.functions:mb_set_val_by_role]]|<html><span style="color:green">int<span style="color:blue"> role<span style="color:black">,<span style="color:green"> number<span style="color:blue"> value</html>|<html><span style="color:green">int<span style="color:black"> 1=OK</html>|Set a <html><span style="color:blue">role value<span style="color:black"></html> on a modbus device| |[[.functions:mb_set_val_by_role]]|<html><span style="color:green">int<span style="color:blue"> role<span style="color:black">,<span style="color:green"> number<span style="color:blue"> value</html>|<html><span style="color:green">int<span style="color:black"> 1=OK</html>|Set a <html><span style="color:blue">role value<span style="color:black"></html> on a modbus device|
Line 124: Line 126:
 |[[.functions:ow_write]]|<html><span style="color:green">int<span style="color:blue"> value</html>||Write a byte to the OneWire bus| |[[.functions:ow_write]]|<html><span style="color:green">int<span style="color:blue"> value</html>||Write a byte to the OneWire bus|
 |[[.functions:phpinfo]]||<html><span style="color:green">string</html>|Return information about the system| |[[.functions:phpinfo]]||<html><span style="color:green">string</html>|Return information about the system|
-|[[.functions:pin_configure]]|<html><span style="color:green">int<span style="color:blue"> pin_index<span style="color:black">,<span style="color:green"> int<span style="color:blue"> pin_type<span style="color:black">,<span style="color:green"> int<span style="color:blue"> counter_type</html>||Configure an <tooltip title="Input/Output">IO</tooltip> pin as a digital input, output, or analog input| +|[[.functions:pin_configure]]|<html><span style="color:green">int<span style="color:blue"> pin_index<span style="color:black">,<span style="color:green"> int<span style="color:blue"> pin_type<span style="color:black">,<span style="color:green"> int<span style="color:blue"> counter_type</html>||Configure an <tooltip title="Input/Output">I/O</tooltip> pin as a digital input, output, or analog input| 
-|[[.functions:pin_get]]|<html><span style="color:green">int<span style="color:blue"> pin_index<span style="color:black">,<span style="color:green"> int<span style="color:blue"> pin_type</html>|<html><span style="color:green">int<span style="color:black"> value</html>|Return the value of an <tooltip title="Input/Output">IO</tooltip> pin|+|[[.functions:pin_get]]|<html><span style="color:green">int<span style="color:blue"> pin_index<span style="color:black">,<span style="color:green"> int<span style="color:blue"> pin_type</html>|<html><span style="color:green">int<span style="color:black"> value</html>|Return the value of an <tooltip title="Input/Output">I/O</tooltip> pin|
 |[[.functions:pin_set]]|<html><span style="color:green">int<span style="color:blue"> pin_index<span style="color:black">,<span style="color:green"> int<span style="color:blue"> value</html>||Set a digital output to <html><span style="color:blue">value<span style="color:black"></html> 1 or 0| |[[.functions:pin_set]]|<html><span style="color:green">int<span style="color:blue"> pin_index<span style="color:black">,<span style="color:green"> int<span style="color:blue"> value</html>||Set a digital output to <html><span style="color:blue">value<span style="color:black"></html> 1 or 0|
 |[[.functions:ping]]|<html><span style="color:green">string<span style="color:blue"> host</html>|<html><span style="color:green">array</html>|Send an ICMP ping and place the result in an <html><span style="color:green">array<span style="color:black"></html>| |[[.functions:ping]]|<html><span style="color:green">string<span style="color:blue"> host</html>|<html><span style="color:green">array</html>|Send an ICMP ping and place the result in an <html><span style="color:green">array<span style="color:black"></html>|
Line 176: Line 178:
 |[[.functions:untar]]|<html><span style="color:green">string<span style="color:blue"> filename<span style="color:black">,<span style="color:green"> int<span style="color:blue"> verbosity</html>|<html><span style="color:green">int<span style="color:black"> 1=OK</html>|Expand a TAR file into the current folder, optionally verbose| |[[.functions:untar]]|<html><span style="color:green">string<span style="color:blue"> filename<span style="color:black">,<span style="color:green"> int<span style="color:blue"> verbosity</html>|<html><span style="color:green">int<span style="color:black"> 1=OK</html>|Expand a TAR file into the current folder, optionally verbose|
 |[[.functions:uptime]]||<html><span style="color:green">int<span style="color:black"> ms</html>|Return the uptime in milliseconds| |[[.functions:uptime]]||<html><span style="color:green">int<span style="color:black"> ms</html>|Return the uptime in milliseconds|
 +|[[.functions:wifi_disable]]|||Disable Wifi module|
 +|[[.functions:wifi_enable]]|||Enable Wifi module|
  
uphp/functions.txt · Last modified: 2022/09/23 04:53 by admin