diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-15 17:22:29 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-15 17:22:29 +1300 |
commit | de46b77e923d3412d74dbf745933bd62acaeca77 (patch) | |
tree | b4869aaddeb80cb6145806d7dc7f1788739d4f52 /src/org/traccar/protocol/T800xProtocolDecoder.java | |
parent | 8ac74d53d687641b7af79e6ca3a84d8851b46236 (diff) | |
download | trackermap-server-de46b77e923d3412d74dbf745933bd62acaeca77.tar.gz trackermap-server-de46b77e923d3412d74dbf745933bd62acaeca77.tar.bz2 trackermap-server-de46b77e923d3412d74dbf745933bd62acaeca77.zip |
Store correct MCC and MNC values
Diffstat (limited to 'src/org/traccar/protocol/T800xProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/T800xProtocolDecoder.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/T800xProtocolDecoder.java b/src/org/traccar/protocol/T800xProtocolDecoder.java index 2127be331..83d815e0f 100644 --- a/src/org/traccar/protocol/T800xProtocolDecoder.java +++ b/src/org/traccar/protocol/T800xProtocolDecoder.java @@ -143,10 +143,14 @@ public class T800xProtocolDecoder extends BaseProtocolDecoder { getLastLocation(position, dateBuilder.getDate()); - position.set(Event.KEY_MCC, buf.readUnsignedShort()); - position.set(Event.KEY_MNC, buf.readUnsignedShort()); - position.set(Event.KEY_LAC, buf.readUnsignedShort()); - position.set(Event.KEY_CID, buf.readUnsignedShort()); + byte[] array = new byte[16]; + buf.readBytes(array); + ChannelBuffer swapped = ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, array); + + position.set(Event.KEY_MCC, swapped.readUnsignedShort()); + position.set(Event.KEY_MNC, swapped.readUnsignedShort()); + position.set(Event.KEY_LAC, swapped.readUnsignedShort()); + position.set(Event.KEY_CID, swapped.readUnsignedShort()); // two more cell towers |