|
|
|
@ -152,22 +152,18 @@ public class EdgeImitator { |
|
|
|
Futures.addCallback(future, new FutureCallback<>() { |
|
|
|
@Override |
|
|
|
public void onSuccess(@Nullable List<Void> result) { |
|
|
|
if (connected) { |
|
|
|
DownlinkResponseMsg downlinkResponseMsg = DownlinkResponseMsg.newBuilder() |
|
|
|
.setDownlinkMsgId(downlinkMsg.getDownlinkMsgId()) |
|
|
|
.setSuccess(true).build(); |
|
|
|
edgeRpcClient.sendDownlinkResponseMsg(downlinkResponseMsg); |
|
|
|
} |
|
|
|
DownlinkResponseMsg downlinkResponseMsg = DownlinkResponseMsg.newBuilder() |
|
|
|
.setDownlinkMsgId(downlinkMsg.getDownlinkMsgId()) |
|
|
|
.setSuccess(true).build(); |
|
|
|
edgeRpcClient.sendDownlinkResponseMsg(downlinkResponseMsg); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onFailure(Throwable t) { |
|
|
|
if (connected) { |
|
|
|
DownlinkResponseMsg downlinkResponseMsg = DownlinkResponseMsg.newBuilder() |
|
|
|
.setDownlinkMsgId(downlinkMsg.getDownlinkMsgId()) |
|
|
|
.setSuccess(false).setErrorMsg(t.getMessage()).build(); |
|
|
|
edgeRpcClient.sendDownlinkResponseMsg(downlinkResponseMsg); |
|
|
|
} |
|
|
|
DownlinkResponseMsg downlinkResponseMsg = DownlinkResponseMsg.newBuilder() |
|
|
|
.setDownlinkMsgId(downlinkMsg.getDownlinkMsgId()) |
|
|
|
.setSuccess(false).setErrorMsg(t.getMessage()).build(); |
|
|
|
edgeRpcClient.sendDownlinkResponseMsg(downlinkResponseMsg); |
|
|
|
} |
|
|
|
}, MoreExecutors.directExecutor()); |
|
|
|
} |
|
|
|
|