mac
2024-01-08 e621d580011682941a79c107f46fe7aeb5b0e7de
app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
@@ -28,7 +28,6 @@
import com.hdl.photovoltaic.ui.bean.OidBean;
import com.hdl.photovoltaic.uni.HDLUniMP;
import com.hdl.photovoltaic.uni.HDLUniMPSDKManager;
import com.hdl.photovoltaic.utils.AppManagerUtils;
import com.hdl.photovoltaic.utils.NetworkUtils;
import com.hdl.photovoltaic.utils.WifiUtils;
import com.hdl.sdk.link.common.exception.HDLLinkCode;
@@ -321,7 +320,7 @@
                    break;
                }
            }
            HdlLogLogic.print("uni发来的数据--->大类-->" + topic + "\r\n" + data, true);
            HdlLogLogic.print("uni发来的数据--->大类--->" + topic + "\r\n" + data, true);
        } catch (Exception e) {
            HdlLogLogic.print("uni发来的数据--->" + e.getMessage(), true);
        }
@@ -518,7 +517,7 @@
        String version = getKeyValue("version", getKeyValue("data", data));//固件版本
        String hardwareModel = getKeyValue("hardwareModel", getKeyValue("data", data));//云端上文件MD5
        String imageId = getKeyValue("imageId", getKeyValue("data", data));//固件镜像id
        String module = "FW#" + imageId;
        String module = "FW#" + imageId;//模块信息(HW:硬件)
        //升级本地优先->云端升级
        HdlDeviceLogic.getInstance().isLocalConnect(deviceMac, new CloudCallBeak<Boolean>() {
@@ -542,7 +541,7 @@
                            }
                            String md5 = HDLMD5Utils.encodeMD5(data);//网关固件需要
                            //升级固件文件地址
                            String upgradeFileLocalPathUrl = "http://" + NetworkUtils.getInstance().getIPAddress(HDLApp.getInstance()) + ":" + MyNanoHttpServer.HTTP_PORT + firmwarePathFileName;
                            String upgradeFileLocalPathUrl = "http://" + NetworkUtils.getIPAddress(HDLApp.getInstance()) + ":" + MyNanoHttpServer.HTTP_PORT + firmwarePathFileName;
                            //通知给网关升级固件文件地址等信息
                            HdlOtaLogic.getInstance().pushUpgradePacketInfo(deviceMac, oid, module, version, data.length + "", upgradeFileLocalPathUrl, md5, new LinkCallBack<String>() {
                                @Override
@@ -798,7 +797,7 @@
                            }
                            String md5 = HDLMD5Utils.encodeMD5(data);//网关驱动需要
                            //升级驱动文件地址
                            String upgradeFileLocalPathUrl = "http://" + NetworkUtils.getInstance().getIPAddress(HDLApp.getInstance()) + ":" + MyNanoHttpServer.HTTP_PORT + drivePathFileName;
                            String upgradeFileLocalPathUrl = "http://" + NetworkUtils.getIPAddress(HDLApp.getInstance()) + ":" + MyNanoHttpServer.HTTP_PORT + drivePathFileName;
                            //通知给网关升级驱动文件地址等信息
                            HdlOtaLogic.getInstance().pushUpgradePacketInfo(deviceMac, deviceOid, module, version, data.length + "", upgradeFileLocalPathUrl, md5, new LinkCallBack<String>() {
                                @Override
@@ -1087,7 +1086,7 @@
                    public void onSuccess(Boolean obj) {
                        GatewayBean gatewayBean = HDLLinkLocalGateway.getInstance().getLocalGateway(mac);
                        if (gatewayBean == null) {
                            uniCallbackData(null, -100, "本地找不到网关", callback);
                            uniCallbackData(null, -100, HDLApp.getInstance().getString(R.string.The_gateway_cannot_be_found_locally), callback);
                            return;
                        }
@@ -1218,7 +1217,7 @@
    private void sendModBus(Object data, DCUniMPJSCallback callback) {
        String tempData = getKeyValue("data", data);
        if (TextUtils.isEmpty(tempData)) {
            HdlLogLogic.print("data内容为空", false);
            HdlLogLogic.print("data内容为空--->", false);
            return;
        }
        ModBusBean modBusBean = new Gson().fromJson(tempData, ModBusBean.class);
@@ -1229,7 +1228,7 @@
//            modBusBean.setOid("0101050217BBC400");
//        }
        if (modBusBean.getMac() == null || modBusBean.getData() == null) {
            HdlLogLogic.print("内容为空===oid=" + modBusBean.getMac() + " data=" + Arrays.toString(modBusBean.getData()), false);
            HdlLogLogic.print("内容为空--->oid--->" + modBusBean.getMac() + " data--->" + Arrays.toString(modBusBean.getData()), false);
            return;
        }
@@ -1305,7 +1304,7 @@
            }
        } catch (Exception e) {
            HdlLogLogic.print("uni===组装uni发送数据格式===" + e.getMessage(), false);
            HdlLogLogic.print("uni--->组装uni发送数据格式--->" + e.getMessage(), false);
        }