check_updates

To get all event updates of all units added into the session, use the events/check_updates request.

Copied!
svc=events/check_updates&params={
    "lang": <text>,
    "measure": <uint>,
    "detalization": <uint>
}

Parameters

All parameters are optional.

ParameterDescriptionDefault value

lang

Language (2-symbol code).

en

measure

Measurement system:

  • 0 for SI;
  • 1 for US;
  • 2 for imperial.

0

detalization

Output flags (see below). Must be specified in decimal format.

0x7

Output flags

FlagDescription

0x1

Basic JSON: event start - event end.

0x2

Specified detector data.

0x4

User parameters (which user specified for this event)

0x10

Full JSON. Every detector treats it in its own way.

0x20

Formatted value.

Sensor type

Type valueDescriptionEvent registration
1Switcher sensors:
  • engine operation;
  • digital;
  • engine efficiency;
  • private mode;
  • alarm trigger;
  • counter (switch to ON/OFF).
Events are registered from the ON state
to the OFF state.
2Instant sensors:
  • odometer;
  • relative engine hours;
  • instant fuel consumption;
  • counter (instant).
Events are registered from the first non-
zero value to the last non-zero one.
3

Differential sensors: 

  • mileage;
  • engine hours;
  • impulse fuel consumption;
  • absolute fuel consumption;
  • counter (differential, differential with overflow);
  • fuel level impulse sensor.
Events are registered from the start of value increasing to the end of it.
4

Analog sensors: 

  • temperature;
  • engine revolutions;
  • voltage;
  • weight;
  • accelerometer;
  • temperature coefficient;
  • custom sensor.
Events are not registered.

Response

The response depends on the flag.

0x1 flag

Returns basic JSON (for all sensor groups).

Copied!
"<type_name>": {
"<sensor_id>": {
"from": {
"t": <uint>, /* time (UNIX time) */
"y": <double>, /* latitude */
"x": <double> /* longitude */
},
"to": {
"t": <uint>, /* time (UNIX time) */
"y": <double>, /* latitude */
"x": <double> /* longitude */
},
"m": <uint>, /* last message time */
"f": <uint> /* service flag */
}
}

0x2 flag

Returns specified detector data.

Copied!
"ignition": {
"<sensor_id>": {
"state": <uint>, /* state: 0 for off, 1 for on */
"type": 1, /* sensor type: switcher sensor */
"hours": <uint>, /* engine hours for all history, in seconds */
"switches": <uint>, /* number of switches for all history */
"value": <bool> /* current value */
}
...
}

All sensor types for sensors:

Copied!
"sensors": {
"<sensor_id1>":
{
"state":<uint>, /* state: 0 for off, 1 for on */
"type": 1, /* sensor type: switcher sensor */
"hours":<uint>, /* engine hours for all history, s */
"switches":<uint>, /* number of switches for all history */
"value":<bool> /* current value */
},
"<sensor_id2>":
{
"type": 2, /* sensor type: instant sensor */
"counter":<uint>, /* message sequence counter in the event */
"summary":<uint>, /* sum of values in the event */
"total_counter":<uint>, /* number of messages in the history */
"total_summary"<uint>, /* sum of values in the history */
"value":<double> /* last value; if it's -348201.3876, the value is unknown */
},
"<sensor_id3>":
{
"type": 3, /* sensor type: differential sensor */
"counter":<uint>, /* value sum in the event */
"total_counter":<uint>, /* value sum in the history */
"value":<double> /* last value; if it's -348201.3876, the value is unknown */
},
"<sensor_id4>":
{
"type": 4, /* sensor type: analog sensor */
"value":<double> /* last value; if it's -348201.3876, the value is unknown */
}
}

Copied!
"lls": {
    "<sensor_id>":
            {
                "value":<double>,         /* last message value with the calculated "level" */
                "level":<double>,         /* average median value (FLS filtering value is used) */
                "filled":<double>         /* fuel filled */
            }
}
Copied!
"trips": {
        "state":<bool>,       /* state: 0 for a parking interval, 1 for a trip, 2 for a stop */
        "max_speed":<uint>,   /* maximum speed in the trip */
        "curr_speed":<uint>,  /* current speed */
        "avg_speed":<uint>,   /* average speed according to "distance" */
        "distance":<uint>,    /* GPS mileage in trip */
        "odometer":<uint>,    /* distance for all trips */
        "course":<uint>,  /* movement direction*/
        "altitude":<uint> /* altitude */
}
Copied!
"counters": {
    "engine_hours": <uint>,   /* engine hours counter */
    "mileage": <uint>,        /* mileage counter */
    "bytes": <uint>           /* GPRS traffic counter */
}

0x4 flag

Returns user parameters. The response depends on user definitions for the current event.

Copied!
"<type_name>": {
    "<sensor_id>": {
        "p":{   /* user-defined object content */
            "test":2,
            "foo":"bar",
            "trips":1
        }
    }
}

0x10 flag

Returns the full JSON.

For sensors with both ‘‘type=2’’ and ‘‘type=3’’ (except fuel level sensors), the following response is returned:

Copied!
"sensors": {
"<sensor_id>":
{
"msgs": [
{
"tm":<uint>, /* message time, UNIX-time */
"v":<double> /* value */
},
...
]
},
...
}

For fuel level sensors, the following response is returned:

Copied!
"lls": {
    "<sensor_id>": {
        "msgs": [
                {
                "tm":<uint>,  /* message time, UNIX-time */
                "v":<double>, /* value */
                "l":<double>  /* average median value  (FLS filtration value is used) */
                },
                ...
            ]
        }
    },
    ...
}

0x20 flag

Returns formatted values

Copied!
"ignition": {
    "sensor_id": {
        "format": {
                "value":<text>    /* formatted value  (usually "On"/"Off") */
        }
    }
}
Copied!
"sensors": {
    "sensor_id": {
        "format": {
                "value":<text>    /* formatted value, depends on the sensor type and format */
        }
    }
}
Copied!
"trips": {
    "format": {
        "distance":<text>,        /* distance according to the previous message */
        "avg_speed":<text>        /* average speed according to "distance"  */
    }
}
Copied!
"lls": {
    "sensor_id": {
        "format": {
                "value":<text>,   /* formatted value, depends on the sensor type and format */
                "filled":<text>   /* fuel filled */
        }
    }
}
Copied!
"counters": {
	"format": {
	"engine_hours":<uint>,   /* formatted value of the engine hours counter */
	"mileage":<text>,        /* formatted value of the mileage counter */
	"bytes":<uint>           /* formatted value of the GPRS traffic counter */ 
	}
}

Error codes

If the request is not completed, an error code is returned.

Error codeDescription
1Invalid or obsolete request SID.
4Parameter validation error.
7The adf_avl_events library wasn't loaded, or failed to fetch the JSON writer.
Download PDF file
Download Word document

See also