get_messages
To get messages from the message loader, use the command messages/get_messages:
svc=messages/get_messages¶ms={"indexFrom":<uint>,
"indexTo":<uint>,
"timeFrom:"<uint>,
"timeTo":<uint>,
"filter":"<text>",
"flags":<uint>,
"flagsMask":<uint>,
"loadCount":<uint>}
You can find an example of this request in the sample messages.
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:
Logic | Description |
---|---|
timeFrom/timeTo | Determine the start and end time of the messages. |
timeFrom/loadCount | Determine the start time of the messages. It will display the loadCount number of the last messages. |
timeTo/loadCount | Determine 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.
ImportantTo use this method, the request should contain at least one of the parameter pairs from above.
Response example (no filtering):
[
{
"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:
"filter":"pos.x,p.pre*,p.param?"
Filtered response:
[
{
"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
[ /* message array */
{ ... }, /* message */
{ ... } /* message */
]
You can find message formats here.
Error codes
Error code | Description |
---|---|
4 | Invalid input parameters or failed to fetch messages. |