| | |
| | | import com.hdl.photovoltaic.utils.PermissionUtils; |
| | | import com.hdl.sdk.link.HDLLinkLocalSdk; |
| | | import com.hdl.sdk.link.common.event.EventListener; |
| | | import com.hdl.sdk.link.core.bean.LinkResponse; |
| | | import com.hdl.sdk.link.core.bean.ModbusResponse; |
| | | import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus; |
| | | import com.hdl.sdk.link.core.bean.eventbus.EventNotifyRefreshGatewayAesKeyInfo; |
| | | import com.hdl.sdk.link.core.bean.gateway.GatewayBean; |
| | | import com.hdl.sdk.link.core.config.HDLLinkConfig; |
| | | import com.hdl.sdk.link.core.utils.mqtt.MqttRecvClient; |
| | |
| | | @Override |
| | | public void onMessage(Object msg) { |
| | | |
| | | if (msg == null) { |
| | | return; |
| | | } |
| | | if (msg instanceof ModbusResponse) { |
| | | ModbusResponse response = (ModbusResponse) msg; |
| | | if (response.getTopic() == null) { |
| | |
| | | HdlUniLogic.getInstance().sendUni(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_MODEL, uniCallBackBaseBean); |
| | | // } |
| | | |
| | | } else if (msg instanceof LinkResponse) { |
| | | LinkResponse linkResponse = (LinkResponse) msg; |
| | | if (linkResponse.getTopic() == null) { |
| | | return; |
| | | } |
| | | if (linkResponse.getTopic().endsWith("/ota/device/progress/up")) { |
| | | HDLUniMP.UniCallBackBaseBean uniCallBackBaseBean = new HDLUniMP.UniCallBackBaseBean(); |
| | | uniCallBackBaseBean.setType(linkResponse.getTopic()); |
| | | uniCallBackBaseBean.setData(linkResponse.getData()); |
| | | HdlUniLogic.getInstance().sendUni(HDLUniMP.UNI_EVENT_REPLY_OTA_MODEL, uniCallBackBaseBean); |
| | | } |
| | | } |
| | | } |
| | | }; |