Class: uCentral

uCentral

The uCentral namespace is not an actual class but merely a virtual namespace for documentation purposes.

From the perspective of a template author, the uCentral namespace is the global root level scope available to embedded code, so methods like uCentral.b() or uCentral.info() or utlity classes like uCentral.files or uCentral.wiphy are available to templates as b(), info(), files and wiphy respectively.

Classes

dhcp_relay
ethernet
files
ipcalc
local_profile
routing_table
services
shell
wiphy

Methods

Formats a given input value as uci boolean value.

Name Type Description
val *

The value to format

Returns:
Type Description
string Returns '1' if the given value is truish (not false, null, 0, 0.0 or an empty string), or 0 in all other cases.

Emit an informational message.

Name Type Description
fmt string

The information message format string

args * repeatable

Optional format arguments

Formats a given input value as single quoted string, honouring uci specific escaping semantics.

Name Type Description
str *

The string to format

Returns:
Type Description
string Returns an empty string if the given input value is null or an empty string. Returns the escaped and quoted string in all other cases.

Attempt to include a file, catching potential exceptions.

Try to include the given file path in a safe manner. The path is resolved relative to the path of the currently executed template and may only contain the character A-Z, a-z, 0-9, _, / and - as must contain a final .uc file extension.

Exception occuring while including the file are catched and a warning is emitted instead.

Name Type Description
path string

Path of the file to include

scope object

The scope to pass to the include file

Emit a warning message.

Name Type Description
fmt string

The warning message format string

args * repeatable

Optional format arguments