aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/T800xProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/T800xProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/T800xProtocolDecoder.java12
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