get_messages

To get messages from the message loader, use the command messages/get_messages:

Copied!
svc=messages/get_messages&params={"indexFrom":<uint>,
				  "indexTo":<uint>,
				  "timeFrom:"<uint>,
				  "timeTo":<uint>,
				  "filter":"<text>",
				  "flags":<uint>,
				  "flagsMask":<uint>,
				  "loadCount":<uint>}

Parameters

The parameters are optional.

Name

Description

indexFrom

Index of the first requested message.

indexTo

Index of the last requested message.

timeFrom

Interval beginning.

timeTo

Interval end.

filter

Filter, search in the pos and p parameters.

flags

Flags for loading messages. See below.

flagsMask

Mask. See below.

loadCount

Number of messages to return (0xffffffff means all the found ones).

The method logic is extended: you can use both the old indexFrom/indexTo logic and the new ones:

LogicDescription
timeFrom/timeToDetermine the start and end time of the messages.
timeFrom/loadCountDetermine the start time of the messages. It will display the loadCount number of the last messages.
timeTo/loadCountDetermine the end time of the messages. It will display the loadCount number of the last messages.

The filter option can be used for any logic. The search is available in the pos and p parameters. Even if there are no such parameters in the messages, all the messages contain basic information: t, f, tp. i. o.

Response example (no filtering):

Copied!
[
    {
	"t": 1426233861,
	"f": 7,
	"tp": "ud",
	"pos": {
		"y": 53.84541,
		"x": 27.4470783333,
		"z": 0,
		"s": 25,
		"c": 285,
		"sc": 255
		},
	"i": 0,
	"o": 0,
	"p": {
		"adc1": 0,
		"pre2": 123,
		"param": 24,
		"param5": 43
	}
    }
]

Filter example:

Copied!
"filter":"pos.x,p.pre*,p.param?"

Filtered response:

Copied!
[
       {
		"t": 1426233861,
		"f": 7,
		"tp": "ud",
		"pos": {
			"x": 27.4470783333
			},
		"i": 0,
		"o": 0,
		"p": {
			"pre2": 123,
			"param5": 43
		}
	}
]

After filtering we see the pos.x value, the values of the parameters in the pos object which begin with pre, the values of the parameters in the pos object which begin with param and have one more symbol at the end (for example, param1 is valid, but param is invalid for search).
The number of defined parameters separated by a comma is unlimited. The asterisk (*) is used as a wildcard for 0 or more symbols, and the question mark (?) as a wildcard for one symbol.

Response

Copied!
[	/* message array */
	{ ... },	/* message */
	{ ... }		/* message */
]

You can find message formats here.

Error codes

Error codeDescription
4Invalid input parameters or failed to fetch messages.
Download PDF file
Download Word document

See also