diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-06-05 23:16:21 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-06-05 23:16:21 +1200 |
commit | 9c99076dc2416c4e0725007af0e5f2f2f444c05c (patch) | |
tree | 55068f2ab5dbe99fcd60acc01c1bb05fc365aa43 /src/org/traccar/protocol/AstraProtocolDecoder.java | |
parent | b8f4fc8888aaad7fe384c1dc2b80f44c1683bb03 (diff) | |
download | traccar-server-9c99076dc2416c4e0725007af0e5f2f2f444c05c.tar.gz traccar-server-9c99076dc2416c4e0725007af0e5f2f2f444c05c.tar.bz2 traccar-server-9c99076dc2416c4e0725007af0e5f2f2f444c05c.zip |
Migrate more protocols
Diffstat (limited to 'src/org/traccar/protocol/AstraProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/AstraProtocolDecoder.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/AstraProtocolDecoder.java b/src/org/traccar/protocol/AstraProtocolDecoder.java index 7f247251d..7a4e1ee85 100644 --- a/src/org/traccar/protocol/AstraProtocolDecoder.java +++ b/src/org/traccar/protocol/AstraProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 - 2018 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,11 +15,12 @@ */ package org.traccar.protocol; -import org.jboss.netty.buffer.ChannelBuffer; -import org.jboss.netty.buffer.ChannelBuffers; -import org.jboss.netty.channel.Channel; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; import org.traccar.DeviceSession; +import org.traccar.NetworkMessage; import org.traccar.helper.BitUtil; import org.traccar.helper.DateBuilder; import org.traccar.helper.Log; @@ -44,10 +45,10 @@ public class AstraProtocolDecoder extends BaseProtocolDecoder { protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { - ChannelBuffer buf = (ChannelBuffer) msg; + ByteBuf buf = (ByteBuf) msg; if (channel != null) { - channel.write(ChannelBuffers.wrappedBuffer(new byte[] {0x06}), remoteAddress); + channel.writeAndFlush(new NetworkMessage(Unpooled.wrappedBuffer(new byte[] {0x06}), remoteAddress)); } buf.readUnsignedByte(); // protocol |