From 6d908915d558ec457db8a50b03ed8746f4e73a48 Mon Sep 17 00:00:00 2001
From: 562935844@qq.com <562935844@qq.com>
Date: 星期五, 28 六月 2024 14:53:35 +0800
Subject: [PATCH] 代码优化
---
HDLSDK/app/src/main/java/com/hdl/hdlsdk/MainActivity.java | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/HDLSDK/app/src/main/java/com/hdl/hdlsdk/MainActivity.java b/HDLSDK/app/src/main/java/com/hdl/hdlsdk/MainActivity.java
index 16d97f1..a8e0116 100644
--- a/HDLSDK/app/src/main/java/com/hdl/hdlsdk/MainActivity.java
+++ b/HDLSDK/app/src/main/java/com/hdl/hdlsdk/MainActivity.java
@@ -330,8 +330,10 @@
@Override
public void onMessage(Object msg) {
LinkResponse response = (LinkResponse) msg;
+ Log.i("onMessage", "response.getTopic():" + response.getTopic());
if ("/user/all/custom/gateway/broadcast_reply".equals(response.getTopic())) {
localSecret.setText("瀵嗛挜锛�" + HDLLinkConfig.getInstance().getLocalSecret());
+
}
}
};
@@ -381,8 +383,7 @@
HDLLink.getInstance().removeAllTopicsListener(allTopicsListener);
}
- void initDeviceInfo()
- {
+ void initDeviceInfo() {
AuthenticateRequest.AuthenticateDeviceInfoBean infoBean = new AuthenticateRequest.AuthenticateDeviceInfoBean();
infoBean.setDeviceMAC("f2c5d8bad48f");
infoBean.setIPMAC("f2c5d8bad48f");
@@ -390,7 +391,7 @@
infoBean.setDeviceModel("HDLSDK");//璁惧鍨嬪彿
infoBean.setAccessMode("WIFI");
infoBean.setIPGateway("192.168.1.1");
- infoBean.setIPAddress("192.168.1.116");
+ infoBean.setIPAddress("192.168.1.103");
infoBean.setGateway_type("screen.touch");
infoBean.setHw_version("HW2.0");
infoBean.setFw_version("Fw1.0");
@@ -580,6 +581,7 @@
statusBeanList.add(bean);
request.setStatus(statusBeanList);
requestList.add(request);
+
HDLLink.getInstance().propertyDown(requestList, new HDLLinkCallBack() {
@Override
public void onSuccess(String data) {
@@ -830,7 +832,7 @@
AttributesRequest attributes = new AttributesRequest();
attributes.setKey("on_off");
attributes.setData_type("string");
- List<Object> valueList=new ArrayList<>();
+ List<Object> valueList = new ArrayList<>();
valueList.add("on");
valueList.add("off");
attributes.setValue(valueList);
--
Gitblit v1.8.0