Skip to content

Commit

Permalink
Cellocator CANiQ 3G iButton
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Dec 7, 2024
1 parent f207007 commit dda5966
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.traccar.protocol;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
Expand Down Expand Up @@ -141,8 +142,8 @@ private Position decodeStatus(ByteBuf buf, DeviceSession deviceSession, boolean
}

position.set(Position.KEY_ODOMETER, buf.readUnsignedMediumLE());
position.set(Position.KEY_DRIVER_UNIQUE_ID, ByteBufUtil.hexDump(buf.readSlice(6)));

buf.skipBytes(6); // multi-purpose data
buf.readUnsignedShortLE(); // fix time
buf.readUnsignedByte(); // location status
buf.readUnsignedByte(); // mode 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ public void testDecode() throws Exception {

var decoder = inject(new CellocatorProtocolDecoder(null));

verifyAttribute(decoder, binary(
"4d4347500003310f004018331424641a1d002000638000002a00b67ff6000000b8a5c7010000402d00040210af1ba9f88fb383fc10080100000000000000190015050ce80714"),
Position.KEY_DRIVER_UNIQUE_ID, "b8a5c7010000");

verifyAttribute(decoder, binary(
"4d4347500098ab31000856b12b2c041016002c0023b3000021f3f5ffb04c8f0100000000000078dd0004020f716445f75f3b0701126e0200b303000036002538151b0ce607ab"),
Position.KEY_IGNITION, true);
Expand Down

0 comments on commit dda5966

Please sign in to comment.