...
Blok kódu | ||
---|---|---|
| ||
- request for reading values of specific parameters:
{
"param": [ // request for reading values of specific parameters
"sntp_enable",
"sntp_server",
"sntp_timeout",
"sntp_period",
"def_fw_version",
"test_wr_only_param",
"device_restart"
]
}
//OR
{ // request for reading values for all existing parameters (empty array):
"param": []
} |
...
Blok kódu | ||
---|---|---|
| ||
{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "setprop - response", "type": "object", "properties": { "status": { "type": "object", "additionalProperties": { "type": "string", "minLength": 1, "pattern": "^[a-z_][a-z0-9_]*$" } }, "prop": { "type": "object", "additionalProperties": { "type": "object", "pattern": "^[a-z_][a-z0-9_]*$", "properties": { "type": { "type": "string" }, "size": { "type": "number" }, "access": { "type": "string" }, "enum": { "type": "array", "minItems": 2, "items": { "type": "object", "properties": { "ident": { "type": "string" }, "value": { "type": "number" } }, "required": [ "ident", "value" ] } } }, "restartRequired": { "type": "boolean" }, "required": [ "type", "access" ] } } }, "required": [ "prop" ], "additionalProperties": false } |
Meaning of json items:
- $.status:
List of unsaved parameter valuesunread configuration parameters.
Is present only for response with response code 400 – Bad request.
Type: object
Optional.- Format of list items: "<parameter_name>": "<error_status>"
<parameter_name> – name of reported parameter
<error_status> – type of error. - Possible values:
"undefined" – parameter not exists
"bad valueno memory" – parameter value is out of rangenot enough memory
"bad type" – wrong type of parameter value
"access denied" – parameter is not accessible for write
"no memory" – not enough memory
"error" – general internal error
"busy" – device is in busy state (e.g. during the factory init process or upgrade process)error" – general internal error
- Format of list items: "<parameter_name>": "<error_status>"
- $.prop
List of configuration parameter descriptions. - $.prop.*.type
Specifies the type of parameter.
Type: string
Mandatory.- Values:
"char" char parameter ('a', '8', '#', …)
"short" 16 bit signed number, range from -32768 to 32767
"int" 32 bit signed number (from -2147483648 to 2147483647)
"long" 32 bit signed number (from -2147483648 to 2147483647)
"float" float number (from 1.2E-38 to 3.4E+38)
"double" double number (from 2.3E-308 to 1.7E+308)
"string" string parameter (size additional param is required)
"action" parameter for action definition (trigger, event)
"file" parameter for file transfer definition
- Values:
- $.prop.*.access
Parameter permission state.
Type: string
Mandatory.- Values:
"rw" full accessible parameter
"r" read only parameter
"w" write only parameter
"" parameter with no access
- Values:
$.prop.*.size
Parameter size.
Type: number
Mandatory only for string parameter, not relevant for other types.$.prop.*.minValue
Parameter minimum value.
Type: number
Optional.
Used for short, int and long type of parameter.$.prop.*.maxValue
Parameter maximum value.
Type: number
Optional
Used for short, int and long type of parameter.$.prop.*.enum
Parameter enumeration definition.
Type: array
OptionalFormat of list items: "<parameter_name>":"<error_status>"
$.prop.*.regex
Regular expression for parameter value validation.
Type: string
Optional$.prop.*.restartRequired
Information about require restart after change value of this parameter.
Type: boolean
Optional (default value is false).
Blok kódu | ||
---|---|---|
| ||
{ "status": { "sntp_timeout": "undefined", }, "prop":{ "sntp_periodenable":{ "type": "short", "access": "rw", "enum": [ { "ident": "no"bad, "value": 0 }, { "ident": "yes", "sntp_enable": "bad type", value": 1 } ] "restartRequired": true }, "sntp_server":{ "type": "string", "size": 254, "access": "rw", "restartRequired": true, "regex": "^((?!-)[0-9A-Za-z-]{1,63}(?<!-)\\.)+[A-Za-z]{2,6}$" }, "sntp_period":{ "type": "integer", "access": "rw", "minValue": 1, "maxValue": 24 }, "dev_sn": "access denied"_fw_version":{ "type": "string", "access": "r" }, "test_wr_only_param":{ "type": "integer", "access": "w" }, "do_adm_restart":{ "type": "action", "access": "" }, "firmware":{ "type": "file", "access": "w" }, "configuration":{ "type": "file", "access": "rw" } } } |