diff options
Diffstat (limited to 'src/org/traccar/protocol/MeiligaoProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/MeiligaoProtocolDecoder.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java index e5c2a9845..a3e065f2d 100644 --- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java +++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java @@ -29,6 +29,8 @@ import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; import org.traccar.helper.Crc; import org.traccar.helper.Log; +import org.traccar.model.DataManager; +import org.traccar.model.Device; import org.traccar.model.Position; /** @@ -46,6 +48,7 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { /** * Regular expressions pattern */ + //"191020.000,A,2438.1016,S,02553.3551,E,0.00,,150113,,,A*69|1.7|1009|" //"020600.930,A,2309.2051,N,11318.8449,E,0.00,0.00,090710,,,A*6A|2.6|96.7|0000|0000,3FFF|000000000" //"155422.000,V,2230.7623,N,11403.4218,E,0.00,0,060211,,*1A|0.0|26|0000|0000,0000|0000000000000000|63|00000000" static private Pattern pattern = Pattern.compile( @@ -60,7 +63,7 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { "(\\d{2})(\\d{2})(\\d{2})," + // Date (DDMMYY) "[^\\|]+\\|(\\d+\\.\\d)\\|" + // Dilution of precision "(\\d+\\.?\\d*)\\|" + // Altitude - "([0-9a-fA-F]+)" + // State + "([0-9a-fA-F]+)?" + // State ".*"); // TODO: parse ADC /** @@ -137,7 +140,10 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { // TODO: change imei to unique id String id = getId(buf); try { - position.setDeviceId(getDataManager().getDeviceByImei(id).getId()); + DataManager dm = getDataManager(); + Device d = dm.getDeviceByImei(id); + d.getId(); + //position.setDeviceId(getDataManager().getDeviceByImei(id).getId()); } catch(Exception error) { Log.warning("Unknown device - " + id); return null; |