mac
2023-11-23 5e080d063f213f2b2c2ed34e1d54b9fd7df1c6b0
app/src/main/java/com/hdl/photovoltaic/ui/MyPowerStationActivity.java
@@ -83,7 +83,7 @@
        //初始化mqtt客户端
        initMqttClient();
//        dddd();
    }
@@ -354,7 +354,76 @@
    }
    private void dddd() {
//        String drivePathFileName = HdlFileLogic.getInstance().getDrivePathFileName("036F6C1B", "V01.01.02");
//        String data = HdlFileLogic.getInstance().readFile(drivePathFileName);
//        String md5 = HDLMD5Utils.encodeMD5(data);//网关驱动需要
//        Log.e("", md5);
//        HdlOtaLogic.getInstance().getDeviceDriverDownloadFile("http://192.168.16.135:49152/storage/emulated/0/Android/data/com.hdl.photovoltaic/files/Documents/upgrade/drive/036F6C1B_V01.01.02.zip", new CloudCallBeak<ResponseBody>() {
//            @Override
//            public void onSuccess(ResponseBody responseBody) {
//
//                HdlOtaLogic.getInstance().disposeDownLoadFile(drivePathFileName, responseBody, md5);
//
////                //本地升级驱动文件路径
////
////                String data = HdlFileLogic.getInstance().readFile(drivePathFileName);
////                String md5 = HDLMD5Utils.encodeMD5(data);//网关驱动需要
//            }
//
//            @Override
//            public void onFailure(HDLException e) {
//
//            }
//        });
//        HdlOtaLogic.getInstance().getNewGatewayDrivers("036F6C1B", "A000", new CloudCallBeak<CloudGatewayDriversBean>() {
//            @Override
//            public void onSuccess(CloudGatewayDriversBean obj) {
//
//            }
//
//            @Override
//            public void onFailure(HDLException e) {
//
//            }
//        });
//        dowlao();
        HdlOtaLogic.getInstance().startLocalService(new ServiceConnection() {
            @Override
            public void onServiceConnected(ComponentName name, IBinder service) {
            }
            @Override
            public void onServiceDisconnected(ComponentName name) {
            }
        });
    }
    void dowlao() {
        HdlOtaLogic.getInstance().getDeviceDriverDownloadFile("http://hdl-hz-test.oss-cn-hangzhou.aliyuncs.com/20/2023/11/1834a1d0-d2a7-4b6f-9877-6f2722e9b7bc.hdlipk_sec", new CloudCallBeak<ResponseBody>() {
            @Override
            public void onSuccess(ResponseBody responseBody) {
                String drivePathFileName = HdlFileLogic.getInstance().getDrivePathFileName("036F6C1B", "V01.01.02");
                HdlOtaLogic.getInstance().disposeDownLoadFile(drivePathFileName, responseBody, "84cd8e62d4311c90508313f0e5965dbb", HdlOtaLogic.driver_type);
//                HdlFileLogic.getInstance().writeFile(drivePathFileName, bytes);//写入新文件
                HdlLogLogic.print("写入新驱动文件到内存成功.", false);
            }
            @Override
            public void onFailure(HDLException e) {
                HdlLogLogic.print("下载驱动文件到内存失败.", false);
            }
        });
    }
}