Set device GPS Position - 0x0107
Table of Contents
Before you start
Ensure you have reviewed:
A full list of API calls can be found at: https://api.oemserver.com/swagger/index.html.
Description
Available on the Dart3-4G.
- This call sends a GPS position to the device.
- This should be used if the device is unable to get its own position (e.g. device is underground), and a position is required for the data records.
- E.g. To stop the end platform discarding records without a position (Telematics Guru does this)
- The GPS time will be set to the time when the async message is received by the device.
- The device will use this position as it's ‘last known position’ - and otherwise continue normal operation. Should a fresh fix be obtained, operation continues as normal. This message does not fix the lat/long.
Request Example
https://api.oemserver.com/v1.0/asyncmessaging/send/[device serial]
Payload:
Offset | Length | Data Type | Description |
0 | 4 | INT32 | Latitude (Degrees * 1E7) |
4 | 4 | INT32 | Longitude (Degrees * 1E7) |
{
"MessageType":263, // 0x0107 – Set GPS Position
"CANAddress":4294967295, //0xFFFFFFFF,//HOST_ADDRESS
"Data":[210, 35, 245, 236, 114, 154, 8, 69], //Lat Long sent as bytes, See below
"ExpiryDateUTC":"2024-09-12T18:25:43.511Z" //message expiry
}
The Lat/long will need to be converted from decimal to hex, then convert each byte back to decimal.
E.g., position = (-319478830, 1158191730)
→ in hex = (0xECF523D2, 0x45089A72)
→ flip from big to little endian (0xD223F5EC, 0x729A0845)
→ convert each byte to decimal, this is the data payload needed for postman (210, 35, 245, 236, 114, 154, 8, 69)
Below is a converter to simplify the process: when inputting the position, please make sure to include the decimal in the lat/long. example: -31.9478830, 115.8191730