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(encrypt);
|
// 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;
|
}
|
|
}
|