forked from traccar/traccar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
12 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright 2012 Anton Tananaev ([email protected]) | ||
* Copyright 2015 Anton Tananaev ([email protected]) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
|
@@ -16,7 +16,6 @@ | |
package org.traccar.protocol; | ||
|
||
import org.jboss.netty.buffer.ChannelBuffer; | ||
import org.jboss.netty.buffer.ChannelBuffers; | ||
import org.jboss.netty.channel.Channel; | ||
import org.jboss.netty.channel.ChannelHandlerContext; | ||
import org.traccar.BaseProtocolDecoder; | ||
|
@@ -26,29 +25,15 @@ | |
import org.traccar.model.ExtendedInfoFormatter; | ||
import org.traccar.model.Position; | ||
|
||
import java.util.Calendar; | ||
import java.util.Date; | ||
import java.util.Properties; | ||
import java.util.TimeZone; | ||
|
||
public class UlbotechProtocolDecoder extends BaseProtocolDecoder { | ||
|
||
public UlbotechProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { | ||
super(dataManager, protocol, properties); | ||
} | ||
|
||
private String readImei(ChannelBuffer buf) { | ||
int b = buf.readUnsignedByte(); | ||
StringBuilder imei = new StringBuilder(); | ||
imei.append(b & 0x0F); | ||
for (int i = 0; i < 7; i++) { | ||
b = buf.readUnsignedByte(); | ||
imei.append((b & 0xF0) >> 4); | ||
imei.append(b & 0x0F); | ||
} | ||
return imei.toString(); | ||
} | ||
|
||
private static final short DATA_GPS = 0x01; | ||
private static final short DATA_LBS = 0x02; | ||
private static final short DATA_STATUS = 0x03; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters