From e5d41b6ef7818b287fb4f4882e841438a186f063 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期四, 21 三月 2024 16:09:58 +0800
Subject: [PATCH] 2024年03月21日16:09:50
---
app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java
index 72f142e..90a3a1e 100644
--- a/app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java
+++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java
@@ -568,7 +568,7 @@
public void editGatewayParam(String mac, LinkCallBack<Boolean> linkCallBack) {
String requestUrl = TopicApi.SET_GATEWAY_EDIT;
JsonObject json = new JsonObject();
- json.addProperty("master", GatewayMasterType.MasterFalse);
+ json.addProperty("master", GatewayMasterType.MasterTrue);
TcpClient.getInstance().sendDataToLinkGateway(mac, requestUrl, json, "", new HDLLinkCallBack() {
@Override
public void onSuccess(String msg) {
@@ -628,17 +628,16 @@
*/
public void initializeGateway(String mac, LinkCallBack<Boolean> linkCallBack) {
String requestUrl = TopicApi.GATEWAY_INITIALIZE_REMOTE;
- JsonObject sendJsonObj = new JsonObject();
JsonObject jObject = new JsonObject();
jObject.addProperty("device_mac", mac);
-// jObject.addProperty("reset_factory", "true");//涓篺alse鎴栨棤姝ゅ瓧娈碉紝鍒欎负"娓呴櫎鏁版嵁"
- sendJsonObj.add("objects", jObject);
- TcpClient.getInstance().sendDataToLinkGateway(mac, requestUrl, sendJsonObj, "", new HDLLinkCallBack() {
+ jObject.addProperty("reset_factory", "true");//涓篺alse鎴栨棤姝ゅ瓧娈碉紝鍒欎负"娓呴櫎鏁版嵁"
+ TcpClient.getInstance().sendDataToLinkGateway(mac, requestUrl, jObject, "", new HDLLinkCallBack() {
@Override
public void onSuccess(String json) {
if (linkCallBack != null) {
linkCallBack.onSuccess(true);
}
+ HdlLogLogic.print("鍒濆鍖栭�嗗彉鍣ㄦ垚鍔�-->mac:" + mac, true);
}
@Override
@@ -646,6 +645,7 @@
if (linkCallBack != null) {
linkCallBack.onError(e);
}
+ HdlLogLogic.print("鍒濆鍖栭�嗗彉鍣ㄥけ璐�-->mac:" + mac + "--->" + e.getMsg() + "(" + e.getCode() + ")", true);
}
});
--
Gitblit v1.8.0