package com.example.agvcontroller.action;
|
|
import com.example.agvcontroller.protocol.AgvPackage;
|
import com.example.agvcontroller.protocol.ProtocolType;
|
import com.example.agvcontroller.protocol.ProtocolUtils;
|
|
import java.util.logging.Logger;
|
|
import io.netty.buffer.ByteBuf;
|
|
/**
|
* 应答报文建造者
|
* Created by vincent on 2019-04-04
|
*/
|
public class AckMsgBuilder {
|
|
// private static final Logger log = LoggerFactory.getLogger(AckMsgBuilder.class);
|
|
/**
|
* 成功应答
|
* @return ByteBuf
|
*/
|
public static AgvPackage ofSuccess(AgvPackage original, ProtocolType ackType) {
|
|
|
return ProtocolUtils.installDownProtocol(
|
|
original.getHeader().getUniqueNo()
|
|
, ackType
|
);
|
|
}
|
|
/**
|
* 失败应答
|
* @return ByteBuf
|
*/
|
public static ByteBuf ofFail(ByteBuf sourceBuff) {
|
return sourceBuff;
|
}
|
|
|
}
|