| | |
| | | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.JsonArray; |
| | | import com.google.gson.JsonObject; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.hdl.linkpm.sdk.core.exception.HDLException; |
| | |
| | | /** |
| | | * 服务是否开启 true=开启 |
| | | */ |
| | | public boolean mServiceStart = false; |
| | | public boolean mServiceStart= false; |
| | | |
| | | /** |
| | | * true表示终止下载升级文件(用户行为) |
| | |
| | | public void stopDownloadUpgradeFile() { |
| | | this.stopDownload = true; |
| | | } |
| | | |
| | | /** |
| | | * 向云端获取【设备升级文件(驱动,固件)下载】升级文件 |
| | | * |
| | |
| | | */ |
| | | public void pushUpgradePacketInfo(String mac, String oid, String module, String version, String size, String url, String sign_method, LinkCallBack<String> linkCallBack) { |
| | | String requestUrl = TopicApi.SET_GATEWAY_UPGRADE_INFO; |
| | | JsonArray jsonArray = new JsonArray(); |
| | | JsonObject json = new JsonObject(); |
| | | json.addProperty("oid", oid);// 物理设备oid |
| | | json.addProperty("module", module);//模块信息 |
| | |
| | | // json.addProperty("is_diff", is_diff);//true=增量包,false=全量包 |
| | | json.addProperty("size", size);//升级包大小 |
| | | json.addProperty("url", url);//升级包下载地址 |
| | | json.addProperty("sign_method", sign_method);//升级包签名类型:md5 |
| | | TcpClient.getInstance().sendDataToLinkGateway(mac, requestUrl, json, "", new HDLLinkCallBack() { |
| | | json.addProperty("sign", sign_method);//升级包签名类型:md5 |
| | | json.addProperty("sign_method", "md5");//升级包签名类型:md5 |
| | | jsonArray.add(json); |
| | | TcpClient.getInstance().sendDataToLinkGateway(mac, requestUrl, jsonArray, "", new HDLLinkCallBack() { |
| | | @Override |
| | | public void onSuccess(String msg) { |
| | | if (linkCallBack != null) { |