| | |
| | | this.uniUpgradeGatewayDriver(data, callback); |
| | | } |
| | | break; |
| | | //设备取消下载升级文件 |
| | | case HDLUniMP.UNI_EVENT_REPLY_OTA_DRIVER_CANCEL_DOWNLOAD: { |
| | | this.uniCancelDownloadingUpgradeFile(data, callback); |
| | | } |
| | | break; |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 向云端发起【设备驱动】下载指令 |
| | | * 向云端发起【设备驱动下载】指令 |
| | | */ |
| | | private void uniGatewayDriverDownload(Object data, DCUniMPJSCallback callback) { |
| | | String deviceOid = getKeyValue("oid", getKeyValue("data", data));//网关设备oid |
| | |
| | | } |
| | | }); |
| | | } else { |
| | | //远程升级需要检测在逆变器有没有连接上云 |
| | | //远程升级需要【检测】在逆变器有没有连接上云 |
| | | HdlDeviceLogic.getInstance().checkInverterConnectedCloud(deviceMac, new CloudCallBeak<CloudInverterDeviceBean>() { |
| | | @Override |
| | | public void onSuccess(CloudInverterDeviceBean cloudInverterDeviceBean) { |
| | | //1:待机,2:连接中,3:故障,4:运行,5:离线,6:逆变器连不上云(自定义) |
| | | //1:连接中,2:故障,3:运行,4:离线,6:逆变器连不上云(自定义) |
| | | if (cloudInverterDeviceBean == null) { |
| | | uniCallbackData(null, 6, HDLApp.getInstance().getString(R.string.ota_not_cloud_upgrade_fails), callback); |
| | | uniCallbackData(null, 6, HDLApp.getInstance().getString(R.string.ota_binding_cloud_upgrade_fails), callback); |
| | | return; |
| | | } |
| | | if (cloudInverterDeviceBean.getDeviceStatus() != 4) { |
| | | uniCallbackData(null, cloudInverterDeviceBean.getDeviceStatus(), getDeviceStatusString(cloudInverterDeviceBean.getDeviceStatus()), callback); |
| | | if (cloudInverterDeviceBean.getDeviceStatus() != 3) { |
| | | uniCallbackData(null, cloudInverterDeviceBean.getDeviceStatus(), HDLApp.getInstance().getString(R.string.ota_not_cloud_upgrade_fails), callback); |
| | | return; |
| | | } |
| | | //4:运行 |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 取消下载升级文件 |
| | | */ |
| | | private void uniCancelDownloadingUpgradeFile(Object data, DCUniMPJSCallback callback) { |
| | | HdlOtaLogic.getInstance().setStopDriversDownload(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @param deviceStatus 逆变器连接云端状态值( 1:待机,2:连接中,3:故障,4:运行,5:离线) |