mac
2023-10-11 907f9314657fd0554fecda06e919b98768b0aeea
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.hdl.sdk.link.core.bean;
 
 
/**
 * Created by Tong on 2021/9/29.
 */
public class FileRequest extends LinkRequest {
 
    private String fileId;
    private Integer command;
    private byte []fileData;
 
//    private static int info_number;
    public FileRequest(String topic, String data, boolean encrypt) {
        super(topic, data, encrypt);
    }
 
 
    public FileRequest(String fileId, Integer command, byte []fileData,boolean encrypt) {
        this.fileId = fileId;
        this.command = command;
        this.fileData = fileData;
//        super.setEncrypt(encrypt);
        super.setEncrypt(false);
//        info_number++;
//        byte[] headBytes = ("hex" + info_number).getBytes();
//        byte[] sendDataBytes = ByteUtils.concatBytes(headBytes, fileData);
        super.setData(fileData);
    }
 
    @Override
    public byte [] getSendBytes() {
        return getData();
    }
 
    public String getTopic() {
        return fileId + "_" + command;
    }
 
    public String getAckTopic() {
        return fileId + "_" + ++command;
    }
 
}