diff options
author | jcardus <joaquim.cardeira@gmail.com> | 2020-03-25 17:25:19 +0000 |
---|---|---|
committer | jcardus <joaquim.cardeira@gmail.com> | 2020-03-25 17:25:19 +0000 |
commit | feac85bad4004fb3e316a88285626e12840398d2 (patch) | |
tree | d268a79d63b9d1f27b6e433fedc90de7b427b172 /src/main/java/org/traccar/database/ActiveDevice.java | |
parent | 7b669e3181f637f06b31b55bd930584c7b08e897 (diff) | |
parent | f3d465abe7f255ec44e976caade642e4c2fd7598 (diff) | |
download | trackermap-server-feac85bad4004fb3e316a88285626e12840398d2.tar.gz trackermap-server-feac85bad4004fb3e316a88285626e12840398d2.tar.bz2 trackermap-server-feac85bad4004fb3e316a88285626e12840398d2.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src/main/java/org/traccar/database/ActiveDevice.java')
-rw-r--r-- | src/main/java/org/traccar/database/ActiveDevice.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/org/traccar/database/ActiveDevice.java b/src/main/java/org/traccar/database/ActiveDevice.java index 207fc454b..e3ece6ad9 100644 --- a/src/main/java/org/traccar/database/ActiveDevice.java +++ b/src/main/java/org/traccar/database/ActiveDevice.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2020 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. @@ -16,7 +16,8 @@ package org.traccar.database; import io.netty.channel.Channel; -import org.traccar.NetworkMessage; +import io.netty.handler.codec.http.HttpRequestDecoder; +import org.traccar.BasePipelineFactory; import org.traccar.Protocol; import org.traccar.model.Command; @@ -44,12 +45,12 @@ public class ActiveDevice { return deviceId; } - public void sendCommand(Command command) { - protocol.sendDataCommand(this, command); + public boolean supportsLiveCommands() { + return BasePipelineFactory.getHandler(channel.pipeline(), HttpRequestDecoder.class) == null; } - public void write(Object message) { - channel.writeAndFlush(new NetworkMessage(message, remoteAddress)); + public void sendCommand(Command command) { + protocol.sendDataCommand(channel, remoteAddress, command); } } |