mac
2024-05-14 f7c38847b8e00c84c30e51a92c03071d3e9a9da8
app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
@@ -43,6 +43,7 @@
import com.hdl.photovoltaic.ui.bean.Geolocation;
import com.hdl.photovoltaic.ui.bean.LinkBean;
import com.hdl.photovoltaic.ui.bean.OidBean;
import com.hdl.photovoltaic.ui.bean.UnCountBean;
import com.hdl.photovoltaic.ui.me.AsRegardsActivity;
import com.hdl.photovoltaic.ui.me.PersonalDataActivity;
import com.hdl.photovoltaic.ui.me.SetActivity;
@@ -236,7 +237,6 @@
                    case HDLUniMP.UNI_EVENT_REPLY_DEVICE_TIME: {
                        this.uniGetInverterTime(mode_type, data, callback);
                    }
                    break;
                    //逆变器时间编辑
                    case HDLUniMP.UNI_EVENT_REPLY_DEVICE_TIME_EDIT: {
@@ -266,6 +266,11 @@
                    //获取未处理/未读消息数量
                    case HDLUniMP.UNI_EVENT_REPLY_DEVICE_MESSAGE_NUMBER: {
                        this.uniGetMessageNumber(mode_type, data, callback);
                    }
                    break;
                    //初始化逆变器
                    case HDLUniMP.UNI_EVENT_REPLY_DEVICE_INITIALIZEINVERTER: {
                        this.setInitializeGateway(mode_type, data, callback);
                    }
                    break;
@@ -302,6 +307,7 @@
                    //打开手机Wifi设置界面
                    case HDLUniMP.UNI_EVENT_REPLY_OPEN_WIFI_SETTINGS: {
                        Intent intent = new Intent(Settings.ACTION_WIFI_SETTINGS);
                        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        HDLApp.getInstance().startActivity(intent);
                    }
                    break;
@@ -427,6 +433,7 @@
                        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        intent.setClass(HDLApp.getInstance(), SetActivity.class);
                        HDLApp.getInstance().startActivity(intent);
                    }
                    break;
@@ -1265,9 +1272,9 @@
     */
    private void uniGetMessageNumber(String type, Object data, DCUniMPJSCallback callback) {
        String homeId = getKeyValue("homeId", getKeyValue("data", data));
        HdlMessageLogic.getInstance().getMessageUntreatedCount(homeId, new CloudCallBeak<String>() {
        HdlMessageLogic.getInstance().getMessageUntreatedCount(homeId, new CloudCallBeak<UnCountBean>() {
            @Override
            public void onSuccess(String data) {
            public void onSuccess(UnCountBean data) {
                uniCallbackData(type, data, callback);
            }
@@ -1720,6 +1727,28 @@
        ).start();
    }
    /**
     * 初始化你逆变器
     *
     * @param type     账号
     * @param data     uni请求数据
     * @param callback uni回调
     */
    public void setInitializeGateway(String type, Object data, DCUniMPJSCallback callback) {
        String mac = getKeyValue("mac", getKeyValue("data", data));
        HdlDeviceLogic.getInstance().initializeInverter(mac, new LinkCallBack<Boolean>() {
            @Override
            public void onSuccess(Boolean obj) {
                uniCallbackData(type, obj, callback);
            }
            @Override
            public void onError(HDLLinkException e) {
                uniCallbackData(type, null, e.getCode(), e.getMsg(), callback);
            }
        });
    }
    /**
     * 发送modbus协议数据