mac
2023-12-06 d830fef6a2bc2ab061e6ac2b423c4a49dda3cf21
app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
@@ -412,12 +412,16 @@
            String hardwareModel = getKeyValue("hardwareModel", getKeyValue("data", data));//硬件型号
            String osImageId = getKeyValue("osImageId", getKeyValue("data", data));//系统镜像id
            String firmwareVersionId = getKeyValue("firmwareVersionId", getKeyValue("data", data));//固件版本id
//            String oid = getKeyValue("oid", getKeyValue("data", data));//固件oid
            List<DeviceFirmwareBean> list = new ArrayList<>();
            String driverFileList = HdlFileLogic.getInstance().getFirmwareRootPath();
            File file = new File(driverFileList);
            if (file.list() != null) {
                for (int i = 0; i < Objects.requireNonNull(file.list()).length; i++) {
                    String path = Objects.requireNonNull(file.list())[i];
//                    if (!path.contains(oid)) {
//                        continue;
//                    }
                    String[] ary = path.split("/");
                    String[] driverInfoAry = ary[ary.length - 1].split("_");
                    DeviceFirmwareBean deviceFirmwareBean = new DeviceFirmwareBean();
@@ -439,7 +443,7 @@
     */
    private void uniDeviceFirmwareDownload(Object data, DCUniMPJSCallback callback) {
        String deviceOidId = getKeyValue("deviceOidId", getKeyValue("data", data));//云端上设备id
        String oid = getKeyValue("oid", getKeyValue("data", data));//固件的oid
        String oid = getKeyValue("oid", getKeyValue("data", data));//该固件的oid
        String imageId = getKeyValue("imageId", getKeyValue("data", data));//固件镜像id
        String version = getKeyValue("version", getKeyValue("data", data));//固件版本
        String localUrl = getKeyValue("localUrl", getKeyValue("data", data));//储存在本地固件文件路径
@@ -996,11 +1000,18 @@
            public void onSuccess(List<GatewayBean> list) {
                if (callback != null) {
                    uniCallbackData(list, callback);
                    //EventBus事件分发
                    //EventBus事件分发,进入住宅开始订阅主题
                    BaseEventBus baseEventBus = new BaseEventBus();
                    baseEventBus.setType(HDLUniMP.UNI_EVENT_REPLY_DEVICE_LIST);
                    baseEventBus.setData(list);
                    EventBus.getDefault().post(baseEventBus);
                    GatewayBean gatewayBean = HdlDeviceLogic.getInstance().queryCurrentHomeMainGateway(list);
                    if (gatewayBean != null) {
                        //进来住宅详情都要上传一次oid列表到云端;
                        HdlDeviceLogic.getInstance().uploadDataToCloud(gatewayBean.getDevice_mac(), null);
                    }
                }
            }