Try S168 protocl.
String content = values[4];
String[] fragments = content.split(";");
for (String fragment : fragments) {
int dataIndex = fragment.indexOf(':');
String type = fragment.substring(0, dataIndex);
values = fragment.substring(dataIndex + 1).split(",");
int index = 0;
switch (type) {
case "GDATA":
position.setValid(values[index++].equals("A"));
position.set(Position.KEY_SATELLITES, Integer.parseInt(values[index++]));
DateFormat dateFormat = new SimpleDateFormat("yyMMddHHmmss");
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
position.setTime(dateFormat.parse(values[index++]));
position.setLatitude(Double.parseDouble(values[index++]));
position.setLongitude(Double.parseDouble(values[index++]));
position.setSpeed(UnitsConverter.knotsFromKph(Double.parseDouble(values[index++])));
position.setCourse(Integer.parseInt(values[index++]));
position.setAltitude(Integer.parseInt(values[index++]));
break;
default:
break;
}
}
return position.getAttributes().containsKey(Position.KEY_SATELLITES) ? position : null;
}
I think the code above is suitable with the protocol documentation. I will try it. Thanks Anton.
Can anyone help to add this protocol to Traccar?
Uniguard - https://filebin.net/kob1jgsubcsfgmz9/GPRS_communication_protocol_for_clients__1_.pdf.pdf?t=8zvrpset
https://filebin.net/kob1jgsubcsfgmz9/Screen_Shot_2020-07-01_at_10.25.23_PM.png?t=42rgzaos