#
whycq
2024-08-19 a5519c76cb177d22ed5d001410132e430664c877
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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;
    }
 
 
}