增加进制转换
parent
f756cd50e3
commit
0fd1d87f4f
|
@ -72,7 +72,7 @@ public class VehicleOperateController {
|
|||
vehicleData.setLongitude(split[0]);
|
||||
vehicleData.setLatitude(split[1]);
|
||||
|
||||
NettyClientMsg.sendMsg(Config.VEHICLE_MSG_SUF + "7E " + ConversionUtil.strToSixteen(vehicleData.getMsg()) + "7E " + "7E") ;
|
||||
NettyClientMsg.sendMsg(Config.VEHICLE_MSG_SUF + vehicleData.getMsg()) ;
|
||||
NettyClientLogQueue.add(vehicleData.getVehicleMsgLog());
|
||||
return Response.success();
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.netty.operate;
|
|||
|
||||
|
||||
import com.muyu.common.Config;
|
||||
import com.muyu.utils.ConversionUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -22,7 +23,7 @@ public class NettyClientMsg {
|
|||
*/
|
||||
public static void sendMsg(String msg){
|
||||
log.info("客户端发送消息:{}",msg);
|
||||
Config.ctx.writeAndFlush(msg + Config.DATA_PACK_SEPARATOR);
|
||||
Config.ctx.writeAndFlush(ConversionUtil.strToSixteen(msg) + Config.DATA_PACK_SEPARATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -30,7 +31,7 @@ public class NettyClientMsg {
|
|||
*/
|
||||
public static void destroy(){
|
||||
log.info("发送断开连接消息:"+Config.NETTY_CLOSE);
|
||||
Config.ctx.writeAndFlush(Config.NETTY_WILL_CLOSE+ Config.VIN + Config.DATA_PACK_SEPARATOR);
|
||||
sendMsg(Config.NETTY_WILL_CLOSE + Config.VIN);
|
||||
Config.ctx = null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue