|
@@ -6,7 +6,6 @@ import com.its.vds.xnettcp.vds.codec.VdsTcpClientDecoder;
|
|
|
import com.its.vds.xnettcp.vds.codec.VdsTcpClientEncoder;
|
|
|
import com.its.vds.xnettcp.vds.handler.VdsTcpClientIdleHandler;
|
|
|
import com.its.vds.xnettcp.vds.handler.VdsTcpClientInboundHandler;
|
|
|
-import com.its.vds.xnettcp.vds.protocol.VdsProtocol;
|
|
|
import io.netty.bootstrap.Bootstrap;
|
|
|
import io.netty.channel.*;
|
|
|
import io.netty.channel.socket.SocketChannel;
|
|
@@ -109,32 +108,14 @@ public class VdsTcpClient implements Callable<Object> {
|
|
|
// 온도정보 요청
|
|
|
ByteBuffer sendBuff;
|
|
|
sendBuff = obj.getReqSynchronize().getByteBuffer();
|
|
|
- ChannelFuture f = obj.getChannel().writeAndFlush(sendBuff);
|
|
|
- f.awaitUninterruptibly();
|
|
|
- if (f.isDone() || f.isSuccess()) {
|
|
|
- log.info("SEND_0: [{}], vds_Synchronization: {} sendBytes. [{}]", obj.getVDS_CTLR_IP(), sendBuff.array().length, obj.getVDS_CTLR_ID());
|
|
|
- } else {
|
|
|
- log.error("SEND_0: [{}], vds_Synchronization: {} sendBytes, Failed. [{}]", obj.getVDS_CTLR_IP(), sendBuff.array().length, obj.getVDS_CTLR_ID());
|
|
|
- }
|
|
|
- VdsProtocol.sleep(500);
|
|
|
-
|
|
|
- ByteBuffer sendBuff_ = obj.getReqData().getByteBuffer();
|
|
|
- ChannelFuture f_ = obj.getChannel().writeAndFlush(sendBuff_);
|
|
|
- f_.awaitUninterruptibly();
|
|
|
- if (f_.isDone() || f_.isSuccess()) {
|
|
|
- log.info("SEND_0: [{}], vds_Data: {} sendBytes. [{}]", obj.getVDS_CTLR_IP(), sendBuff_.array().length, obj.getVDS_CTLR_ID());
|
|
|
- } else {
|
|
|
- log.error("SEND_0: [{}], vds_Data: {} sendBytes, Failed. [{}]", obj.getVDS_CTLR_IP(), sendBuff_.array().length, obj.getVDS_CTLR_ID());
|
|
|
- }
|
|
|
- VdsProtocol.sleep(500);
|
|
|
-
|
|
|
- ByteBuffer sendBuff__ = obj.getReqTemperature().getByteBuffer();
|
|
|
- ChannelFuture f__ = obj.getChannel().writeAndFlush(sendBuff__);
|
|
|
- f__.awaitUninterruptibly();
|
|
|
- if (f__.isDone() || f__.isSuccess()) {
|
|
|
- log.info("SEND_0: [{}], vds_Temperature: {} sendBytes. [{}]", obj.getVDS_CTLR_IP(), sendBuff__.array().length, obj.getVDS_CTLR_ID());
|
|
|
- } else {
|
|
|
- log.error("SEND_0: [{}], vds_Temperature: {} sendBytes, Failed. [{}]", obj.getVDS_CTLR_IP(), sendBuff__.array().length, obj.getVDS_CTLR_ID());
|
|
|
+ boolean result = obj.sendData(sendBuff, 500, "vds_Synchronization");
|
|
|
+ if (result) {
|
|
|
+ ByteBuffer sendBuff_ = obj.getReqData().getByteBuffer();
|
|
|
+ result = obj.sendData(sendBuff_, 500, "vds_Data");
|
|
|
+ if (result) {
|
|
|
+ ByteBuffer sendBuff__ = obj.getReqTemperature().getByteBuffer();
|
|
|
+ result = obj.sendData(sendBuff__, 500, "vds_Temperature");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|