From de46b77e923d3412d74dbf745933bd62acaeca77 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 15 Nov 2015 17:22:29 +1300 Subject: Store correct MCC and MNC values --- src/org/traccar/protocol/T800xProtocolDecoder.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/org/traccar/protocol/T800xProtocolDecoder.java') 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 -- cgit v1.2.3