Standard Library

Status Last Update API Version
Active 2019-11-16 V1.00.00

Description

The meter supports tailored lua standard library, this lists tailor conditions. Notice that the support conditions could change for further firmware releases. Except for very critical development problems, the supported library would only expand, but it is not guaranteed.

Additional Information

The standard lua library didn’t provide a way to create a directory, this is provided by sys.mkdir() function.

OverView

The following gives you a rough view of the tailor conditions:

Library Condition
os Partially Tailored
string Available
io Partially Tailored
package Partially Tailored
table Available
math Partially Tailored
debug Partially Tailored
coroutine Available

os

Function Condition Additional Information
clock() Available This returns the milisecond count since startup on this platform
date() Available
difftime() Use carefully *Note1
execute() Tailored No use on such platform
exit() Available
getenv() Tailored No use on such platform
remove() Available This is able to remove a directory or a file on this platform
rename() Available This is able to remove a directory or a file on this platform
setlocale() Available
time() Use carefully *Note1
tmpname() Tailored

Notes:

  1. To minimize RAM usage, on this platform we use single precision float as the lua number type, the valid precision of float is lower than uint32. Due to this reason, the return values from difftime(), time(), which actually uses POSIX timestamp, lose quite a lot of resolution. The return value is in a resolution of 128 seconds instead of 1 second. It’s recommended to use os.date() to prevent POSIX return value.

string

Function Condition Additional Information
byte() Available
char() Available
dump() Available
find() Available
format() Available
gfind() Available
gmatch() Available
gsub() Available
len() Available
lower() Available
rep() Available
reverse() Available
sub() Available
upper() Available

io

Function Condition Additional Information
close() Available
flush() Available
input() Available
lines() Available
open() Available
output() Available
popen() Tailored No use on such platform
read() Available
type() Available
write() Available
file:close() Available
file:flush() Available
file:lines() Available
file:read() Available
file:seek() Available
file:setvbuf() Tailored No use on such platform
file:write() Available
The file access is redirected to the internal storage.

package

Function Condition Additional Information
loadlib() Tailored
seeall() Available

table

Function Condition Additional Information
concat() Available
insert() Available
move() Available
pack() Available
remove() Available
sort() Available
unpack() Available

math

Function Condition Additional Information
abs() Available
acos() Tailored *Note1
asin() Tailored *Note1
atan() Tailored *Note1
ceil() Available
cosh() Tailored *Note1
cos() Tailored *Note1
deg() Tailored *Note1
exp() Tailored *Note1
floor() Available
fmod() Available
mod() Available
frexp() Tailored *Note1
ldexp() Tailored *Note1
log10() Tailored *Note1
log() Tailored *Note1
max() Available
min() Available
modf() Available
pow() Available
rad() Tailored *Note1
random() Available
randomseed() Available
sinh() Tailored *Note1
sin() Tailored *Note1
sqrt() Available
tanh() Tailored *Note1
tan() Tailored *Note1
Notes:
1. Trig, log, and exp functions are tailored as they are rarely used on applications of this meter, and they come with a large footprint.

debug

Function Condition Additional Information
debug() Tailored No such interactive interface available
gethook() Available
getinfo() Available
getlocal() Available
getmetatable() Available
getregistry() Available
getupvalue() Available
getuservalue() Available
sethook() Available
setlocal() Available
setmetatable() Available
setupvalue() Available
setuservalue() Available
traceback() Available

coroutine

| Function | Condition | Additional Information | | —— | —— | —— | | create() | Available | | | resume() | Available | | | running() | Available | | | status() | Available | | | wrap() | Available | | | yield() | Available | |