update_units
For adding units into the session, use the events/update_units request.
svc=events/update_units¶ms={"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:
svc=events/update_units¶ms={"mode":"remove",
"units":[<long>]}
To remove all units from the session, use the following signature:
svc=events/update_units¶ms={"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:
"detect":{"*":0}
Example 1
To add all ignition sensors and other sensors, use:
"detect":{"ignition":0,"sensors":0}
or
"detect":{"ignition,sensors":0}
Example 2
To add all fuel level sensors with ID 2 and other sensor with ID 6:
"detect":{"lls":2,"sensors":6}
Response
If the request is completed successfully, the following response is returned:
{
units:<uint> /* number of units added into session */
}
Otherwise, an error code is returned.
Error codes
Code | Description |
---|---|
1 | Invalid or obsolete request SID. |
4 | Parameter validation error. |
7 | Failed to load the adf_avl_events library. |