From 99bc815e07e39354f51421b77f4012ffd35594d8 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期三, 28 六月 2023 18:03:00 +0800
Subject: [PATCH] 2023年06月28日18:02:58
---
HDLLinkLocalSdk/src/main/java/com/hdl/sdk/link/core/bean/FileRequest.java | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/HDLLinkLocalSdk/src/main/java/com/hdl/sdk/link/core/bean/FileRequest.java b/HDLLinkLocalSdk/src/main/java/com/hdl/sdk/link/core/bean/FileRequest.java
new file mode 100644
index 0000000..03e7995
--- /dev/null
+++ b/HDLLinkLocalSdk/src/main/java/com/hdl/sdk/link/core/bean/FileRequest.java
@@ -0,0 +1,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;
+ }
+
+}
--
Gitblit v1.8.0