User Tools

Site Tools


uphp:functions:uphp_function_reference

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uphp:functions:uphp_function_reference [2017/05/26 19:46]
jeff
uphp:functions:uphp_function_reference [2018/08/07 10:43]
jeff DELETED: uphp:functions:uphp_function_reference was moved to uphp:functions
Line 16: Line 16:
 |[[chdir]]|<html><span style="color:green">string<span style="color:blue"> directory</html>|<html><span style="color:green">int<span style="color:black"> 0=OK</html>|Change the current directory| |[[chdir]]|<html><span style="color:green">string<span style="color:blue"> directory</html>|<html><span style="color:green">int<span style="color:black"> 0=OK</html>|Change the current directory|
 |[[chr]]|<html><span style="color:green">int<span style="color:blue"> code</html>|<html><span style="color:green">string<span style="color:black"> 1 character</html>|<html>Return the character for an ASCII <span style="color:blue">code</html>| |[[chr]]|<html><span style="color:green">int<span style="color:blue"> code</html>|<html><span style="color:green">string<span style="color:black"> 1 character</html>|<html>Return the character for an ASCII <span style="color:blue">code</html>|
 +|[[clear_watchdog]]|||Clear the software watchdog timer|
 |[[cos]]|<html><span style="color:green">number<span style="color:blue"> radian_angle</html>|<html><span style="color:green">float<span style="color:black"> cosine</html>|<html>Return cosine of a <span style="color:blue">radian_angle</html>| |[[cos]]|<html><span style="color:green">number<span style="color:blue"> radian_angle</html>|<html><span style="color:green">float<span style="color:black"> cosine</html>|<html>Return cosine of a <span style="color:blue">radian_angle</html>|
 |[[debug]]|<html><span style="color:green">string<span style="color:blue"> output</html>||Print to debug output| |[[debug]]|<html><span style="color:green">string<span style="color:blue"> output</html>||Print to debug output|
Line 36: Line 37:
 |[[firmwareupdate]]|||Initiate a firmware update sequence and reboot the device| |[[firmwareupdate]]|||Initiate a firmware update sequence and reboot the device|
 |[[floatval]]|<html><span style="color:green">mixed<span style="color:blue"> value</html>|<html><span style="color:green">float<span style="color:black"> value or <span style="color:green">int<span style="color:black"> 0/1</html>|<html>Return the <span style="color:green">float<span style="color:black"> value of a <span style="color:green">number<span style="color:black"> or <span style="color:green">string</html>| |[[floatval]]|<html><span style="color:green">mixed<span style="color:blue"> value</html>|<html><span style="color:green">float<span style="color:black"> value or <span style="color:green">int<span style="color:black"> 0/1</html>|<html>Return the <span style="color:green">float<span style="color:black"> value of a <span style="color:green">number<span style="color:black"> or <span style="color:green">string</html>|
-|[[flush]]|||Flush current output to the browser|+|[[flush]]|<html><span style="color:green">socket<span style="color:black"> socket to flush</html>||Flush current output or socket to the browser|
 |[[fopen]]|<html><span style="color:green">string<span style="color:blue"> filename<span style="color:black">,<span style="color:green"> string<span style="color:blue"> mode</html>|<html><span style="color:green">int<span style="color:black"> handle or 0</html>|Open a file for reading or writing| |[[fopen]]|<html><span style="color:green">string<span style="color:blue"> filename<span style="color:black">,<span style="color:green"> string<span style="color:blue"> mode</html>|<html><span style="color:green">int<span style="color:black"> handle or 0</html>|Open a file for reading or writing|
 |[[fread]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">,<span style="color:green"> int<span style="color:blue"> bytes</html>|<html><span style="color:green">string<span style="color:black"> or <span style="color:green">int<span style="color:black"> 0</html>|<html>Read <span style="color:blue">bytes<span style="color:black"> from a file, stream or socket</html>| |[[fread]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">,<span style="color:green"> int<span style="color:blue"> bytes</html>|<html><span style="color:green">string<span style="color:black"> or <span style="color:green">int<span style="color:black"> 0</html>|<html>Read <span style="color:blue">bytes<span style="color:black"> from a file, stream or socket</html>|
Line 46: Line 47:
 |[[ftell]]|<html><span style="color:green">int<span style="color:blue"> handle</html>|<html><span style="color:green">int<span style="color:black"> position</html>|Return the current position of a file read/write pointer| |[[ftell]]|<html><span style="color:green">int<span style="color:blue"> handle</html>|<html><span style="color:green">int<span style="color:black"> position</html>|Return the current position of a file read/write pointer|
 |[[function_exists]]|<html><span style="color:green">string<span style="color:blue"> function_name</html>|<html><span style="color:green">int<span style="color:black"> 1 or 0</html>|Check if a function exists (custom or native)| |[[function_exists]]|<html><span style="color:green">string<span style="color:blue"> function_name</html>|<html><span style="color:green">int<span style="color:black"> 1 or 0</html>|Check if a function exists (custom or native)|
-|[[fwrite]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">, <span style="color:green">mixed <span style="color:blue">data</html>|<html><span style="color:green">int<span style="color:black"> bytes written or -1</html>|<html>Write <span style="color:blue">data<span style="color:black"> to a file, stream or socket</html>|+|[[fwrite]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">, <span style="color:green">mixed <span style="color:blue">data<span style="color:black">, <span style="color:green">int <span style="color:blue">length</html>|<html><span style="color:green">int<span style="color:black"> bytes written or -1</html>|<html>Write <span style="color:blue">data<span style="color:black"> to a file, stream or socket</html>|
 |[[get3gstat]]||<html><span style="color:green">array</html>|Get cellular data connection status information| |[[get3gstat]]||<html><span style="color:green">array</html>|Get cellular data connection status information|
 |[[getcwd]]||<html><span style="color:green">string<span style="color:black"> path</html>|Get the current directory| |[[getcwd]]||<html><span style="color:green">string<span style="color:black"> path</html>|Get the current directory|
Line 62: Line 63:
 |[[ini_put_array]]|<html><span style="color:green">string<span style="color:blue"> filename<span style="color:black">,<span style="color:green"> array<span style="color:blue"> data<span style="color:black">,<span style="color:green"> string<span style="color:blue"> section</html>||Write a group of parameters to an INI file from an <html><span style="color:green">array<span style="color:black"></html>| |[[ini_put_array]]|<html><span style="color:green">string<span style="color:blue"> filename<span style="color:black">,<span style="color:green"> array<span style="color:blue"> data<span style="color:black">,<span style="color:green"> string<span style="color:blue"> section</html>||Write a group of parameters to an INI file from an <html><span style="color:green">array<span style="color:black"></html>|
 |[[ini_set]]|<html><span style="color:green">string<span style="color:blue"> filename<span style="color:black">,<span style="color:green"> string<span style="color:blue"> section<span style="color:black">,<span style="color:green"> string<span style="color:blue"> key<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">value<span style="color:black"></html> in an INI file| |[[ini_set]]|<html><span style="color:green">string<span style="color:blue"> filename<span style="color:black">,<span style="color:green"> string<span style="color:blue"> section<span style="color:black">,<span style="color:green"> string<span style="color:blue"> key<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">value<span style="color:black"></html> in an INI file|
 +|[[init_watchdog]]|<html><span style="color:green">int <span style="color:blue">interval</html>||<html>Initialize the software watchdog timer</html>|
 |[[inttoieee754]]|<html><span style="color:green">int <span style="color:blue">representation</html>|<html><span style="color:green">float<span style="color:black"> value</html>|<html>Convert an IEEE-754 encoded <span style="color:green">integer <span style="color:blue">representation<span style="color:black"> (32 bit) to a <span style="color:green">float</html>| |[[inttoieee754]]|<html><span style="color:green">int <span style="color:blue">representation</html>|<html><span style="color:green">float<span style="color:black"> value</html>|<html>Convert an IEEE-754 encoded <span style="color:green">integer <span style="color:blue">representation<span style="color:black"> (32 bit) to a <span style="color:green">float</html>|
 |[[intval]]|<html><span style="color:green">mixed<span style="color:blue"> value</html>|<html><span style="color:green">int<span style="color:black"> value</html>|<html>Return the <span style="color:green">integer<span style="color:black"> value of a <span style="color:green">number<span style="color:black"> or <span style="color:green">string</html>| |[[intval]]|<html><span style="color:green">mixed<span style="color:blue"> value</html>|<html><span style="color:green">int<span style="color:black"> value</html>|<html>Return the <span style="color:green">integer<span style="color:black"> value of a <span style="color:green">number<span style="color:black"> or <span style="color:green">string</html>|
Line 74: Line 76:
 |[[log]]|<html><span style="color:green">string<span style="color:blue"> output<span style="color:black">,<span style="color:green"> string<span style="color:blue"> file</html>||<html>Print to the System Log (or optional <span style="color:blue">file<span style="color:black">)</html>| |[[log]]|<html><span style="color:green">string<span style="color:blue"> output<span style="color:black">,<span style="color:green"> string<span style="color:blue"> file</html>||<html>Print to the System Log (or optional <span style="color:blue">file<span style="color:black">)</html>|
 |[[log10]]|<html><span style="color:green">number<span style="color:blue"> number</html>|<html><span style="color:green">float<span style="color:black"> log<sub>10</sub></html>|Return the base 10 logarithm of a <html><span style="color:blue">number</html>| |[[log10]]|<html><span style="color:green">number<span style="color:blue"> number</html>|<html><span style="color:green">float<span style="color:black"> log<sub>10</sub></html>|Return the base 10 logarithm of a <html><span style="color:blue">number</html>|
-|[[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|+|[[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]|
 |[[max_execution_time]]|<html><span style="color:green">int<span style="color:blue"> seconds</html>||Set the maximum execution time for the current script| |[[max_execution_time]]|<html><span style="color:green">int<span style="color:blue"> seconds</html>||Set the maximum execution time for the current script|
 |[[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| |[[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|
Line 100: Line 102:
 |[[mkdir]]|<html><span style="color:green">string<span style="color:blue"> pathname</html>|<html><span style="color:green">int<span style="color:black"> 0 or error code</html>|Make a directory| |[[mkdir]]|<html><span style="color:green">string<span style="color:blue"> pathname</html>|<html><span style="color:green">int<span style="color:black"> 0 or error code</html>|Make a directory|
 |[[mktime]]|<html><span style="color:green">int<span style="color:blue"> hour<span style="color:black">,<span style="color:green"> int<span style="color:blue"> minute<span style="color:black">,<span style="color:green"> int<span style="color:blue"> second<span style="color:black">,<span style="color:green"> int<span style="color:blue"> month<span style="color:black">,<span style="color:green"> int<span style="color:blue"> day<span style="color:black">,<span style="color:green"> int<span style="color:blue"> year</html>|<html><span style="color:green">int<span style="color:black"> seconds</html>|Return the Linux Timestamp for a given date and time| |[[mktime]]|<html><span style="color:green">int<span style="color:blue"> hour<span style="color:black">,<span style="color:green"> int<span style="color:blue"> minute<span style="color:black">,<span style="color:green"> int<span style="color:blue"> second<span style="color:black">,<span style="color:green"> int<span style="color:blue"> month<span style="color:black">,<span style="color:green"> int<span style="color:blue"> day<span style="color:black">,<span style="color:green"> int<span style="color:blue"> year</html>|<html><span style="color:green">int<span style="color:black"> seconds</html>|Return the Linux Timestamp for a given date and time|
 +|[[mqtt_publish]]|<html><span style="color:green">string<span style="color:blue"> channel</html>, <html><span style="color:green">string<span style="color:blue"> content</html>|<html><span style="color:green">int<span style="color:black"> 1 for success or 0 for error</html>|Publish a message to an MQTT server|
 +|[[mqtt_subscribe]]|<html><span style="color:green">string<span style="color:blue"> channel</html>, <html><span style="color:green">string<span style="color:blue"> callback</html>|<html><span style="color:green">int<span style="color:black"> 1 for success or 0 for error</html>|Subscribe to a channel on an MQTT server|
 |[[net_disable3g]]|||Disable 3G support for the dongle| |[[net_disable3g]]|||Disable 3G support for the dongle|
 |[[net_enable3g]]|||Enable 3G support for the dongle| |[[net_enable3g]]|||Enable 3G support for the dongle|
Line 135: Line 139:
 |[[reset]]|||Reset the processor| |[[reset]]|||Reset the processor|
 |[[rmdir]]|<html><span style="color:green">string<span style="color:blue"> pathname<span style="color:black">,<span style="color:green"> int<span style="color:blue"> delete_contents</html>|<html><span style="color:green">int<span style="color:black"> 0=OK</html>|Remove a directory, with optional deletion of contents| |[[rmdir]]|<html><span style="color:green">string<span style="color:blue"> pathname<span style="color:black">,<span style="color:green"> int<span style="color:blue"> delete_contents</html>|<html><span style="color:green">int<span style="color:black"> 0=OK</html>|Remove a directory, with optional deletion of contents|
 +|[[send_sms]]|<html><span style="color:green">string<span style="color:blue"> phone_number, <span style="color:green"> string<span style="color:blue"> message</html>|<html><span style="color:green">int<span style="color:black"> result</html>|<html>sends an sms through a cellular dongle<span style="color:black"></html>|
 |[[session_destroy]]|||Clear the current session's data| |[[session_destroy]]|||Clear the current session's data|
 |[[session_is_new]]||<html><span style="color:green">int</html>|Check if a session was just initiated| |[[session_is_new]]||<html><span style="color:green">int</html>|Check if a session was just initiated|
Line 163: Line 168:
 |[[strval]]|<html><span style="color:green">mixed<span style="color:blue"> value</html>|<html><span style="color:green">string</html>|<html>Return the <span style="color:green">string<span style="color:black"> equivalent of a <span style="color:green">number</html>| |[[strval]]|<html><span style="color:green">mixed<span style="color:blue"> value</html>|<html><span style="color:green">string</html>|<html>Return the <span style="color:green">string<span style="color:black"> equivalent of a <span style="color:green">number</html>|
 |[[substr]]|<html><span style="color:green">string<span style="color:blue"> input<span style="color:black">,<span style="color:green"> int<span style="color:blue"> start<span style="color:black">,<span style="color:green"> int<span style="color:blue"> length</html>|<html><span style="color:green">string<span style="color:black"> substring</html>|Return part of a <html><span style="color:green">string</html>| |[[substr]]|<html><span style="color:green">string<span style="color:blue"> input<span style="color:black">,<span style="color:green"> int<span style="color:blue"> start<span style="color:black">,<span style="color:green"> int<span style="color:blue"> length</html>|<html><span style="color:green">string<span style="color:black"> substring</html>|Return part of a <html><span style="color:green">string</html>|
-|[[tar_finish]]|number handle||Add the ending header to a TAR file| +|[[tar_finish]]|<html><span style="color:green">int<span style="color:blue"> handle</html>|<html><span style="color:green">int<span style="color:black"> 1=OK</html>|Add the ending header to a TAR file| 
-|[[tar_put]]|number handle, string filename|number (1=OK)|Add a file to an open file in TAR format|+|[[tar_put]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">,<span style="color:green"> string<span style="color:blue"> src_pathname<span style="color:black">,<span style="color:green"> string<span style="color:blue"> tar_pathname</html>|<html><span style="color:green">int<span style="color:black"> 1=OK</html>|Add a file to an open file in TAR format|
 |[[time]]||<html><span style="color:green">int<span style="color:black"> seconds</html>|Return the current system timestamp| |[[time]]||<html><span style="color:green">int<span style="color:black"> seconds</html>|Return the current system timestamp|
 |[[timefromfat]]|<html><span style="color:green">int<span style="color:blue"> filetime</html>|<html><span style="color:green">int<span style="color:black"> seconds</html>|Convert a FAT <html><span style="color:blue">filetime<span style="color:black"></html> to a Linux Timestamp| |[[timefromfat]]|<html><span style="color:green">int<span style="color:blue"> filetime</html>|<html><span style="color:green">int<span style="color:black"> seconds</html>|Convert a FAT <html><span style="color:blue">filetime<span style="color:black"></html> to a Linux Timestamp|
 |[[ucfirst]]|<html><span style="color:green">string<span style="color:blue"> input</html>|<html><span style="color:green">string<span style="color:black"> Lowercase</html>|Convert a <html><span style="color:green">string<span style="color:black"></html> to Lowercase except for the first character| |[[ucfirst]]|<html><span style="color:green">string<span style="color:blue"> input</html>|<html><span style="color:green">string<span style="color:black"> Lowercase</html>|Convert a <html><span style="color:green">string<span style="color:black"></html> to Lowercase except for the first character|
-|[[unlink]]|string filename|Number (0=OK)|Remove a file (delete it)| +|[[unlink]]|<html><span style="color:green">string <span style="color:blue">filename</html>|<html><span style="color:green">int<span style="color:black"> 0 or error code</html>|Remove a file (delete it)| 
-|[[untar]]|string filename, number verbose||Expand a file into the current folder, optionally verbose|+|[[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|
 |[[uptime]]||<html><span style="color:green">int<span style="color:black"> ms</html>|Return the uptime in milliseconds| |[[uptime]]||<html><span style="color:green">int<span style="color:black"> ms</html>|Return the uptime in milliseconds|
-|[[usbinfo]]||array|Get information about the USB state|