update_units

For adding units into the session, use the events/update_units request.

Copied!
svc=events/update_units&params={"mode":"add",
                "units":[
                        {
                        "id":<long>,
                        "detect":
                            {
                                "trips":<uint>,
                                "lls":<uint>,
                                "sensors":<uint>,
                                "ignition":<uint>,
                                "counters":<uint>
                            }
                        },
                        ...
                ]}

To remove units from the session, use the following signature:

Copied!
svc=events/update_units&params={"mode":"remove",
                "units":[<long>]}

To remove all units from the session, use the following signature:

Copied!
svc=events/update_units&params={"mode":"clear"}

Parameters

Parameter Description
mode Mode: add, remove, clear.
id Unit ID.
detect Sensor types (what to monitor).
trips Trips (see below).
lls Fuel level sensor (see below).
ignition Ignition sensor (see below).
sensors Other sensors not mentioned above (see below).
counters Counters.
evt_flags Event flags.

To work with the “detect” elements (trips, lls, sensors, ignition) use a specific sensor ID or indicate 0 to add all the sensors of a certain type. For trips, always use 0 as there is no trip sensor.

To add all unit sensors, use:

Copied!
"detect":{"*":0}

Example 1

To add all ignition sensors and other sensors, use:

Copied!
"detect":{"ignition":0,"sensors":0}

or

Copied!
"detect":{"ignition,sensors":0}

Example 2

To add all fuel level sensors with ID 2 and other sensor with ID 6:

Copied!
"detect":{"lls":2,"sensors":6}

Response

If the request is completed successfully, the following response is returned:

Copied!
{
    units:<uint>        /* number of units added into session */
}

Otherwise, an error code is returned.

Error codes

CodeDescription
1Invalid or obsolete request SID.
4Parameter validation error.
7Failed to load the adf_avl_events library.
Download PDF file
Download Word document

See also