| | |
| | | * 前提条件:设备自动上报oid信息给云端 |
| | | * |
| | | * @param deviceOidId oid云端id |
| | | * @param oid 设备oid |
| | | * @param homeId 电站id |
| | | * @param callBack - |
| | | */ |
| | | public void getCurrentDeviceFirmwares(String deviceOidId, CloudCallBeak<List<DeviceFirmwareBean>> callBack) { |
| | | public void getCurrentDeviceFirmwares(String deviceOidId, String oid, String homeId, CloudCallBeak<List<DeviceFirmwareBean>> callBack) { |
| | | String requestUrl = HttpApi.POST_OTA_GET_DeviceFirmwares; |
| | | JsonObject json = new JsonObject(); |
| | | json.addProperty("deviceOidId", deviceOidId); |
| | | json.addProperty("homeId", UserConfigManage.getInstance().getHomeId()); |
| | | if (!TextUtils.isEmpty(deviceOidId)) { |
| | | json.addProperty("deviceOidId", deviceOidId); |
| | | } else { |
| | | json.addProperty("oid", oid); |
| | | } |
| | | json.addProperty("homeId", homeId); |
| | | HttpClient.getInstance().requestHttp(requestUrl, json.toString(), new CloudCallBeak<String>() { |
| | | @Override |
| | | public void onSuccess(String json) { |
| | |
| | | * 前提条件:设备自动上报oid信息给云端 |
| | | * |
| | | * @param oid 网关设备oid |
| | | * @param homeId 电站id |
| | | * @param callBack - |
| | | */ |
| | | public void getCurrentGatewayDrivers(String oid, CloudCallBeak<List<GatewayDriverBean>> callBack) { |
| | | public void getCurrentGatewayDrivers(String oid, String homeId, CloudCallBeak<List<GatewayDriverBean>> callBack) { |
| | | String requestUrl = HttpApi.POST_OTA_GET_GatewayDrivers; |
| | | JsonObject json = new JsonObject(); |
| | | json.addProperty("homeId", UserConfigManage.getInstance().getHomeId()); |
| | | json.addProperty("homeId", homeId); |
| | | json.addProperty("oid", oid); |
| | | |
| | | HttpClient.getInstance().requestHttp(requestUrl, json.toString(), new CloudCallBeak<String>() { |
| | |
| | | int progress = (int) (100 * sum * 1.0f / total); |
| | | if (sum != total) { |
| | | //不等于100都要报,等于100处理整块逻辑完之后再报100; |
| | | this.eventBusPost(fileFullPath, driver, progress, "正常上报进度值--->" + progress); |
| | | this.eventBusPost(fileFullPath, driver, progress, "正常上报进度值---" + progress); |
| | | } |
| | | } |
| | | fos.flush(); |