| | |
| | | package com.hdl.photovoltaic.ui; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | import androidx.appcompat.content.res.AppCompatResources; |
| | | |
| | | import android.Manifest; |
| | | import android.content.ComponentName; |
| | | import android.content.Intent; |
| | | import android.content.ServiceConnection; |
| | | import android.content.pm.PackageManager; |
| | | import android.os.Bundle; |
| | | import android.os.IBinder; |
| | | import android.os.Process; |
| | | import android.text.TextUtils; |
| | | import android.util.Log; |
| | | import android.view.View; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.hdl.linkpm.sdk.core.exception.HDLException; |
| | | import com.hdl.linkpm.sdk.home.type.HomeType; |
| | | import com.hdl.linkpm.sdk.ota.bean.CloudGatewayDriversBean; |
| | | import com.hdl.linkpm.sdk.utils.HDLMD5Utils; |
| | | import com.hdl.photovoltaic.R; |
| | | import com.hdl.photovoltaic.base.CustomBaseActivity; |
| | | import com.hdl.photovoltaic.bean.MqttInfo; |
| | |
| | | import com.hdl.photovoltaic.listener.CloudCallBeak; |
| | | import com.hdl.photovoltaic.other.HdlCommonLogic; |
| | | import com.hdl.photovoltaic.other.HdlDeviceLogic; |
| | | import com.hdl.photovoltaic.other.HdlFileLogic; |
| | | import com.hdl.photovoltaic.other.HdlLogLogic; |
| | | import com.hdl.photovoltaic.other.HdlMqttLogic; |
| | | import com.hdl.photovoltaic.other.HdlOtaLogic; |
| | |
| | | import org.greenrobot.eventbus.ThreadMode; |
| | | |
| | | import java.util.List; |
| | | |
| | | import okhttp3.ResponseBody; |
| | | |
| | | |
| | | /** |
| | |
| | | registerAllTopicsListener(); |
| | | //初始化mqtt客户端 |
| | | initMqttClient(); |
| | | |
| | | // HdlOtaLogic.getInstance().startLocalService(new ServiceConnection() { |
| | | // @Override |
| | | // public void onServiceConnected(ComponentName name, IBinder service) { |
| | | // |
| | | // } |
| | | // |
| | | // @Override |
| | | // public void onServiceDisconnected(ComponentName name) { |
| | | // |
| | | // } |
| | | // }); |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | private void initView() { |
| | | viewBinding.myPowerStationBottomIl1.titleTv.setText(R.string.power_station); |
| | | viewBinding.myPowerStationBottomIl1.titleTv.setText("首页");// |
| | | viewBinding.myMessageBottomIl2.titleTv.setText(R.string.message); |
| | | viewBinding.myMeBottomIl3.titleTv.setText(R.string.power_station_me); |
| | | this.bottomViewChangeOfStyle(); |
| | |
| | | uniCallBackBaseBean.setType(linkResponse.getTopic()); |
| | | uniCallBackBaseBean.setData(linkResponse.getData()); |
| | | HdlUniLogic.getInstance().sendUni(HDLUniMP.UNI_EVENT_REPLY_OTA_MODEL, uniCallBackBaseBean); |
| | | HdlLogLogic.print(linkResponse.getTopic() + new Gson().toJson(linkResponse.getData()), true); |
| | | } |
| | | } |
| | | } |
| | |
| | | uniCallBackBaseBean.setType(event.getType()); |
| | | uniCallBackBaseBean.setData(event.getData()); |
| | | HdlUniLogic.getInstance().sendUni(HDLUniMP.UNI_EVENT_REPLY_OTA_MODEL, uniCallBackBaseBean); |
| | | HdlLogLogic.print("进度:" + ((HdlOtaLogic.Progress) event.getData()).step + "", false); |
| | | HdlLogLogic.print(event.getTopic() + new Gson().toJson(event.getData()), true); |
| | | } |
| | | } |
| | | |