aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-12-29 13:53:20 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2014-12-29 13:53:20 +1300
commit2d7a970cc4b49f68b3fbb56d5903bb91b38f3798 (patch)
treef6f602e3d541df3ef6e93bfebcf0576ef5ea2029 /src/org
parent7dbd8dd192b1d48a8b26168763ecf29d97433319 (diff)
downloadtraccar-server-2d7a970cc4b49f68b3fbb56d5903bb91b38f3798.tar.gz
traccar-server-2d7a970cc4b49f68b3fbb56d5903bb91b38f3798.tar.bz2
traccar-server-2d7a970cc4b49f68b3fbb56d5903bb91b38f3798.zip
Correctly decode Noran ids (fix #915)
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/NoranProtocolDecoder.java7
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) {