update_calc_flags
To update calculation parameters for counters, use the unit/update_calc_flags method.
svc=unit/update_calc_flags¶ms={
"itemId": <long>,
"newValue": <uint>
}
Parameters
The request must contain the following parameters:
| Parameter | Description |
|---|---|
| itemId | Unit ID. |
| newValue | New counter calculation flags (see below). |
Calculation flags
Mileage counter method:
| Flag | Description |
|---|---|
| 0x000 | GPS |
| 0x001 | Mileage sensor (cumulative) |
| 0x001 + 0x1000 | Mileage sensor (latest value) |
| 0x002 | Relative odometer |
| 0x003 | GPS + engine ignition sensor |
Use the flag
0x1000only together with0x001. In this case, the counter shows the latest value of the mileage sensor instead of adding up the differences between the sensor values in consecutive messages. For details, see Counters.
Engine hours counter method:
| Flag | Description |
|---|---|
| 0x010 | Engine ignition sensor |
| 0x020 | Absolute engine hours sensor |
| 0x040 | Relative engine hours sensor |
Automatic calculation:
| Flag | Description |
|---|---|
| 0x100 | Automatic calculation of mileage based on new messages |
| 0x200 | Automatic calculation of engine hours based on new messages |
| 0x400 | Automatic calculation of GPRS traffic |
Response
If the request is completed successfully, a response in the following format is returned:
{
"cfl": <uint> // Calculation flags currently stored in the unit.
}
Otherwise, an error code is returned.
Error codes
| Error code | Description |
|---|---|
| 4 | Invalid input parameters (missing or wrong type of itemId or newValue). |
| 6 | Error updating the flags. |
| 7 | The user doesn’t have the required access rights to the unit (ADF_ACL_AVL_UNIT_EDIT_COUNTERS). |