| | |
| | | package com.zy.core.netty.handle; |
| | | |
| | | import com.core.common.Cools; |
| | | import com.zy.common.utils.News; |
| | | import com.zy.core.Slave; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.SlaveType; |
| | |
| | | |
| | | @Override |
| | | protected boolean channelRead0(ChannelHandlerContext ctx, ChPackage pac) { |
| | | // log.info("读码器【IP:{}】 上行数据 ===>> {}", pac.getIp(), pac.getAscii()); |
| | | // News.info("读码器【IP:{}】 上行数据 ===>> {}", pac.getIp(), pac.getAscii()); |
| | | // //扫码上传数据格式必须2个#开头,如:##12345678 |
| | | // String msg = pac.getAscii().replaceAll("#", ""); |
| | | // if(!Cools.isEmpty(msg) && msg.length()>=tcpProperties.getBarcodeLen()){ |
| | |
| | | String uuid = chPackage.getUuid(); |
| | | Channel channel = ChannelCache.getChannel(uuid); |
| | | if (null == channel){ |
| | | log.warn("通道uuid={} 不在线", uuid); |
| | | News.warn("通道uuid={} 不在线", uuid); |
| | | return; |
| | | } |
| | | channel.writeAndFlush(chPackage); |