User Tools

Site Tools


uphp:functions

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 [2021/11/12 11:22]
admin
uphp:functions [2024/07/16 03:55] (current)
admin
Line 29: Line 29:
 |[[.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_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: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:disk_type]]|<html><span style="color:green">int<span style="color:blue"> drive</html>|<html><span style="color:green">int<span style="color:black"> type</html>|Return disk type|
 |[[.functions:download]]|<html><span style="color:green">string<span style="color:blue"> url</html>|<html><span style="color:green">int<span style="color:black"> res</html>|Download a file in the background| |[[.functions:download]]|<html><span style="color:green">string<span style="color:blue"> url</html>|<html><span style="color:green">int<span style="color:black"> res</html>|Download a file in the background|
 |[[.functions:download_info]]||<html><span style="color:green">array<span style="color:black"> info</html>|Get info about ongoing download| |[[.functions:download_info]]||<html><span style="color:green">array<span style="color:black"> info</html>|Get info about ongoing download|
Line 42: Line 43:
 |[[.functions:fgets]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">,<span style="color:green"> int<span style="color:blue"> size</html>|<html><span style="color:green">string<span style="color:black"> or <span style="color:green">int<span style="color:black"> -1</html>|<html>Return a single line from a file, stream or socket, with optional <span style="color:blue">size<span style="color:black"> limit</html>| |[[.functions:fgets]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">,<span style="color:green"> int<span style="color:blue"> size</html>|<html><span style="color:green">string<span style="color:black"> or <span style="color:green">int<span style="color:black"> -1</html>|<html>Return a single line from a file, stream or socket, with optional <span style="color:blue">size<span style="color:black"> limit</html>|
 |[[.functions:file_exists]]|<html><span style="color:green">string<span style="color:blue"> filename</html>|<html><span style="color:green">int<span style="color:black"> 1 or 0</html>|Check if a file exists| |[[.functions:file_exists]]|<html><span style="color:green">string<span style="color:blue"> filename</html>|<html><span style="color:green">int<span style="color:black"> 1 or 0</html>|Check if a file exists|
 +|[[.functions:filemtime]]|<html><span style="color:green">string<span style="color:blue"> filename</html>|<html><span style="color:green">int<span style="color:black"> bytes</html>|Return the last modified timestamp for a file|
 |[[.functions:filesize]]|<html><span style="color:green">string<span style="color:blue"> filename<span style="color:black"> or<span style="color:green"> int<span style="color:blue"> handle</html>|<html><span style="color:green">int<span style="color:black"> bytes</html>|Return the size of a file, or the number of unread bytes in a stream or socket| |[[.functions:filesize]]|<html><span style="color:green">string<span style="color:blue"> filename<span style="color:black"> or<span style="color:green"> int<span style="color:blue"> handle</html>|<html><span style="color:green">int<span style="color:black"> bytes</html>|Return the size of a file, or the number of unread bytes in a stream or socket|
 |[[.functions:findfirst]]|<html><span style="color:green">string<span style="color:blue"> pattern<span style="color:black">,<span style="color:green"> int<span style="color:blue"> attributes</html>|<html><span style="color:green">array<span style="color:black"> first file found</html>|<html>Start searching the current folder for files matching a <span style="color:blue">pattern<span style="color:black"> and <span style="color:blue">attributes</html>| |[[.functions:findfirst]]|<html><span style="color:green">string<span style="color:blue"> pattern<span style="color:black">,<span style="color:green"> int<span style="color:blue"> attributes</html>|<html><span style="color:green">array<span style="color:black"> first file found</html>|<html>Start searching the current folder for files matching a <span style="color:blue">pattern<span style="color:black"> and <span style="color:blue">attributes</html>|
 |[[.functions:findnext]]||<html><span style="color:green">array<span style="color:black"> next file found</html>|Return next matching file information (after a findfirst)| |[[.functions:findnext]]||<html><span style="color:green">array<span style="color:black"> next file found</html>|Return next matching file information (after a findfirst)|
 |[[.functions:firmwareupdate]]|||Initiate a firmware update sequence and reboot the device| |[[.functions:firmwareupdate]]|||Initiate a firmware update sequence and reboot the device|
 +|[[.functions:flash_status]]|<html><span style="color:green">array<span style="color:blue"> status</html>|<html><span style="color:green">int <span style="color:black">get_full<span style="color:black"></html>|<html>Return an array of flash status information</html>|
 |[[.functions: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>| |[[.functions: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>|
 |[[.functions:flush]]|<html><span style="color:green">socket<span style="color:black"> socket to flush</html>||Flush current output or socket to the browser| |[[.functions:flush]]|<html><span style="color:green">socket<span style="color:black"> socket to flush</html>||Flush current output or socket to the browser|
Line 72: Line 75:
 |[[.functions: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>| |[[.functions: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>|
 |[[.functions:fwrite_pack]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">,<html><span style="color:green">array<span style="color:blue"> data<span style="color:black">, <span style="color:green">int <span style="color:blue"> length<span style="color:black"></html> |<html><span style="color:green">number</html>|<html>Write contents of an indexed array to a file in binary<span style="color:black"></html>| |[[.functions:fwrite_pack]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">,<html><span style="color:green">array<span style="color:blue"> data<span style="color:black">, <span style="color:green">int <span style="color:blue"> length<span style="color:black"></html> |<html><span style="color:green">number</html>|<html>Write contents of an indexed array to a file in binary<span style="color:black"></html>|
 +|[[.functions:get_csv_data]]|<html><span style="color:green">string<span style="color:blue"> filename<span style="color:black">,<html><span style="color:green">string<span style="color:blue"> columns<span style="color:black">, <span style="color:green">int <span style="color:blue"> interval<span style="color:black">, <span style="color:green">int <span style="color:blue"> json<span style="color:black"></html> |<html><span style="color:green">string</html>|<html>Extract partial CSV data from a CSV file<span style="color:black"></html>|
 |[[.functions:get3gstat]]||<html><span style="color:green">array</html>|Get cellular data connection status information| |[[.functions:get3gstat]]||<html><span style="color:green">array</html>|Get cellular data connection status information|
 |[[.functions:getcwd]]||<html><span style="color:green">string<span style="color:black"> path</html>|Get the current directory| |[[.functions:getcwd]]||<html><span style="color:green">string<span style="color:black"> path</html>|Get the current directory|
Line 99: Line 103:
 |[[.functions:is_string]]|<html><span style="color:green">mixed<span style="color:blue"> variable</html>|<html><span style="color:green">int<span style="color:black"> 1 or 0</html>|<html>Check if a <span style="color:blue">variable<span style="color:black"> is a <span style="color:green">string</html>| |[[.functions:is_string]]|<html><span style="color:green">mixed<span style="color:blue"> variable</html>|<html><span style="color:green">int<span style="color:black"> 1 or 0</html>|<html>Check if a <span style="color:blue">variable<span style="color:black"> is a <span style="color:green">string</html>|
 |[[.functions:isset]]|<html><span style="color:green">mixed<span style="color:blue"> variable</html>|<html><span style="color:green">int<span style="color:black"> 1 or 0</html>|<html>Check if a <span style="color:blue">variable<span style="color:black"> exists</html>| |[[.functions:isset]]|<html><span style="color:green">mixed<span style="color:blue"> variable</html>|<html><span style="color:green">int<span style="color:black"> 1 or 0</html>|<html>Check if a <span style="color:blue">variable<span style="color:black"> exists</html>|
 +|[[.functions:json_decode]]|<html><span style="color:green">string<span style="color:black"></html>|<html><span style="color:green">array</html>|<html>JSON decode a <span style="color:green">string<span style="color:black"> into an <span style="color:green">array<span style="color:black"></html>|
 |[[.functions:json_encode]]|<html><span style="color:green">array<span style="color:black">,<span style="color:green"> int<span style="color:blue"> method</html>|<html><span style="color:green">string</html>|<html>JSON encode an <span style="color:green">array<span style="color:black"> into a <span style="color:green">string<span style="color:black">, with optional <span style="color:blue">method</html>| |[[.functions:json_encode]]|<html><span style="color:green">array<span style="color:black">,<span style="color:green"> int<span style="color:blue"> method</html>|<html><span style="color:green">string</html>|<html>JSON encode an <span style="color:green">array<span style="color:black"> into a <span style="color:green">string<span style="color:black">, with optional <span style="color:blue">method</html>|
 |[[.functions:ln]]|<html><span style="color:green">number<span style="color:blue"> number</html>|<html><span style="color:green">float<span style="color:black"> log<sub>e</sub></html>|Return the natural logarithm of a <html><span style="color:blue">number</html>| |[[.functions:ln]]|<html><span style="color:green">number<span style="color:blue"> number</html>|<html><span style="color:green">float<span style="color:black"> log<sub>e</sub></html>|Return the natural logarithm of a <html><span style="color:blue">number</html>|
Line 167: Line 172:
 |[[.functions:reboot]]|||Reboot the processor| |[[.functions:reboot]]|||Reboot the processor|
 |[[.functions:register_callback]]|<html><span style="color:green">string<span style="color:blue"> callback_type<span style="color:black">, <span style="color:green">string<span style="color:blue"> filename, <span style="color:green">string<span style="color:blue"> functionname</html>|<html><span style="color:green">int<span style="color:black"> 0 or error code</html>|<html>Register a callback function for system events </html>| |[[.functions:register_callback]]|<html><span style="color:green">string<span style="color:blue"> callback_type<span style="color:black">, <span style="color:green">string<span style="color:blue"> filename, <span style="color:green">string<span style="color:blue"> functionname</html>|<html><span style="color:green">int<span style="color:black"> 0 or error code</html>|<html>Register a callback function for system events </html>|
- 
 |[[.functions:rename]]|<html><span style="color:green">string<span style="color:blue"> source<span style="color:black">, <span style="color:green">string<span style="color:blue"> destination</html>|<html><span style="color:green">int<span style="color:black"> 0 or error code</html>|<html>Rename or move a file or directory from <span style="color:blue">source<span style="color:black"> to <span style="color:blue">destination</html>| |[[.functions:rename]]|<html><span style="color:green">string<span style="color:blue"> source<span style="color:black">, <span style="color:green">string<span style="color:blue"> destination</html>|<html><span style="color:green">int<span style="color:black"> 0 or error code</html>|<html>Rename or move a file or directory from <span style="color:blue">source<span style="color:black"> to <span style="color:blue">destination</html>|
 |[[.functions:reset]]|||Reset the processor| |[[.functions:reset]]|||Reset the processor|
Line 203: Line 207:
 |[[.functions: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>| |[[.functions: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>|
 |[[.functions: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>| |[[.functions: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>|
-|[[.functions: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|+|[[.functions:sys_get]]|<html><span style="color:green">string<span style="color:blue"> parameter<span style="color:black">|<html><span style="color:green">int<span style="color:black"> value</html>|Get a system parameter| 
 +|[[.functions:sys_set]]|<html><span style="color:green">string<span style="color:blue"> parameter<span style="color:black">,[<span style="color:green"> int<span style="color:blue"> value<span style="color:black">]|<html><span style="color:green">int<span style="color:black"> result</html>|Set a system parameter| 
 +|[[.functions:tar_finish]]|<html><span style="color:green">int<span style="color:blue"> handle| 
 +<html><span style="color:green">int<span style="color:black"> 1=OK</html>|Add the ending header to a TAR file</html>|
 |[[.functions: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| |[[.functions: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|
 |[[.functions:time]]||<html><span style="color:green">int<span style="color:black"> seconds</html>|Return the current system timestamp| |[[.functions:time]]||<html><span style="color:green">int<span style="color:black"> seconds</html>|Return the current system timestamp|
uphp/functions.1636716141.txt.gz · Last modified: 2021/11/12 11:22 by admin