mac
2024-04-02 05581cb7328000de65c5e8c1ef12b366b44b11b1
app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
@@ -43,6 +43,7 @@
import com.hdl.photovoltaic.ui.bean.CloudInverterDeviceBean;
import com.hdl.photovoltaic.ui.bean.DeviceTimeBean;
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.me.AsRegardsActivity;
import com.hdl.photovoltaic.ui.me.PersonalDataActivity;
@@ -58,10 +59,12 @@
import com.hdl.sdk.link.common.exception.HDLLinkException;
import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus;
import com.hdl.sdk.link.core.bean.gateway.GatewayBean;
import com.hdl.sdk.link.core.bean.response.BaseLocalResponse;
import com.hdl.sdk.link.core.callback.GatewayCallBack;
import com.hdl.sdk.link.core.callback.HDLLinkCallBack;
import com.hdl.sdk.link.core.callback.ModbusCallBack;
import com.hdl.sdk.link.core.connect.HDLModBusConnect;
import com.hdl.sdk.link.core.connect.HDLUdpConnect;
import com.hdl.sdk.link.gateway.HDLLinkLocalGateway;
import org.greenrobot.eventbus.EventBus;
@@ -389,6 +392,13 @@
                    //获取位置信息
                    case HDLUniMP.UNI_EVENT_REPLY_OTHER_LOCATION_INFO: {
                        this.uniGetLocationInfo(mode_type, data, callback);
                    }
                    break;
                    //应用冲突
                    case HDLUniMP.UNI_EVENT_REPLY_OTHER_APPLICATION_CONFLICT: {
                        if (callback != null) {
                            uniCallbackData(type, HDLUdpConnect.getInstance().isBindSuccess(), callback);
                        }
                    }
                    break;
                    //专门收集uni日志
@@ -1587,7 +1597,6 @@
        String mac = getKeyValue("mac", getKeyValue("data", data));
        String attribute_data = getKeyValue("attribute_data", getKeyValue("data", data));
        JsonArray jay = new JsonArray();
//{"id":"c2d8b26b-3371-4fed-a190-78da31b454cf","time_stamp":"1711531144489","objects":[{"sid":"010126005C000251333036333237"}]}
        if (!TextUtils.isEmpty(attribute_data)) {
            try {
                Gson gson = new Gson();
@@ -1601,7 +1610,15 @@
        TcpClient.getInstance().sendDataToLinkGateway(mac, TopicApi.PROPERTY_READ, jay, "", new HDLLinkCallBack() {
            @Override
            public void onSuccess(String msg) {
                uniCallbackData(type, msg, callback);
                try {
                    Gson gson = new Gson();
                    Type typeOfT = new TypeToken<BaseLocalResponse<List<LinkBean>>>() {
                    }.getType();
                    BaseLocalResponse<List<LinkBean>> baseLocalResponse = gson.fromJson(msg, typeOfT);
                    uniCallbackData(type, baseLocalResponse, callback);
                } catch (Exception e) {
                    uniCallbackData(type, msg, -2, "", callback);
                }
            }
            @Override
@@ -1682,7 +1699,7 @@
                data = new JSONObject();
            }
            if (isTokenAndRefreshToken) {
                //小程序那里有自己的请求方法,需要这些数据
                //小程序那里有自己的请求方法,但需要原生提供这些数据
                data.put("token", UserConfigManage.getInstance().getToken());
                data.put("refreshToken", UserConfigManage.getInstance().getRefreshToken());
                if (TextUtils.isEmpty(AppConfigManage.getUserRegionUrl())) {