BlackKite, Vehicle Tracking System User Manual
Rev. 1.4.0
Zilogic Systems
Page 44
* Returns IMEI from tag value corresponding to tag type 0x03.
*/
public static String getIMEI(byte[] bytes) {
try {
return new String(bytes, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("Unable to decode IMEI", e);
}
}
public static void main(String[] args) {
byte bk_imei[] = new byte[] { 0x33, 0x35, 0x37,
0x38, 0x30, 0x34,
0x30, 0x34, 0x33,
0x33, 0x39, 0x39,
0x39, 0x31, 0x38 };
String imei = getIMEI(bk_imei);
assert imei.equals("357804043399918");
}
}
Timestamp
• Tag Type:
0x20
• Length: 4 bytes
• Format:
– Number of seconds since 1st Jan 1970, as unsigned integer
• Example: 18th Jan 2014, 16:46:28 UTC, which is 1390063588 seconds, since 1st Jan 1970 UTC,
is represented as
E4 AF DA 52
Coordinates and Satellites
• Tag Type:
0x30
• Length: 9 bytes
• Format:
– Byte 0, LSB 4 bits - Number of satellites being tracked.
– Byte 0, MSB 4 bits - Coordinate correctness (0 - Correct, 1 - Incorrect)
– Bytes 1:4 - Latitude in micro-degrees, as a signed integer
• Positive indicates North
• Negative indicates South
– Bytes 5:8 - Longitude in micro-degrees, as a signed integer
• Positive indicates West
• Negative indicates East
• Example: An example set of values, and their corresponding representation is shown in the
following table.
Sub-field
Value
Representation
Co-ordinate Correctness
0
0
No. of satellites
10
A