diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/NoranProtocolDecoder.java | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/NoranProtocolDecoder.java b/src/org/traccar/protocol/NoranProtocolDecoder.java index 161d07a50..b6fa93607 100644 --- a/src/org/traccar/protocol/NoranProtocolDecoder.java +++ b/src/org/traccar/protocol/NoranProtocolDecoder.java @@ -110,12 +110,7 @@ public class NoranProtocolDecoder extends BaseProtocolDecoder { position.setTime(time.getTime()); // Identification - ChannelBuffer rawId = buf.readBytes(11); - int index = 0; - while (rawId.readable() && rawId.readByte() != 0) { - index += 1; - } - String id = rawId.toString(0, index, Charset.defaultCharset()); + String id = buf.readBytes(11).toString(Charset.defaultCharset()).replaceAll("[^\\p{Print}]", ""); try { position.setDeviceId(getDataManager().getDeviceByImei(id).getId()); } catch(Exception error) { |