mac
2024-01-08 53cfbb7c949edc8e3d0b624e251afbad1a1c74ca
app/src/main/java/com/hdl/photovoltaic/other/HdlOtaLogic.java
@@ -27,8 +27,8 @@
import com.hdl.photovoltaic.listener.CloudCallBeak;
import com.hdl.photovoltaic.listener.LinkCallBack;
import com.hdl.photovoltaic.utils.AesUtils;
import com.hdl.photovoltaic.utils.AppManagerUtils;
import com.hdl.photovoltaic.utils.Md5Utils;
import com.hdl.photovoltaic.utils.NetworkUtils;
import com.hdl.sdk.link.common.exception.HDLLinkException;
import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus;
import com.hdl.sdk.link.core.callback.HDLLinkCallBack;
@@ -38,12 +38,10 @@
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import okhttp3.ResponseBody;
@@ -502,7 +500,7 @@
        //1,建立本地服务;
        //2,告诉网关手机ip和端口;
        //实例化 获取ip 地址
        MyNanoHttpServer.getInstance(AppManagerUtils.getAppManager().getIPAddress(HDLApp.getInstance()));
        MyNanoHttpServer.getInstance(NetworkUtils.getIPAddress(HDLApp.getInstance()));
        //MyNanoHttpServer.getInstance("127.0.0.1");
        intentServer = new Intent();
        intentServer.setClass(HDLApp.getInstance(), MyNanoHttpService.class);
@@ -627,12 +625,13 @@
        if (this.stopDownload) {
            HdlFileLogic.getInstance().deleteFile(fileFullPath);//删除下载不完整数据;
//            HdlFileLogic.getInstance().deleteFile(fileFullPath);//删除下载不完整数据;
            //取消下载广播一次
            BaseEventBus baseEventBus = new BaseEventBus();
            baseEventBus.setTopic(localDownloadProgress);
            Progress progress = new Progress();
            progress.step = -108;
            progress.describe = "用户取消下载.";
            progress.describe = describe;
            baseEventBus.setType(type);
            baseEventBus.setData(progress);
            EventBus.getDefault().post(baseEventBus);
@@ -660,6 +659,8 @@
    //自定义上报下载驱动或固件进度主题
    public static final String localDownloadProgress = "cloud/download/progress/up";
    public static final String driver_type = "driver";
    public static final String firmware_type = "firmware";