wjc
2023-08-21 0a18a8180bc6040c941b07df1be1f7b726b4c155
HDLLinkLocalSdk/src/main/java/com/hdl/sdk/link/core/connect/HDLModBusConnect.java
@@ -79,11 +79,13 @@
                try {
                    if (msg instanceof LinkResponse) {
                        LinkResponse linkResponse = (LinkResponse) msg;
                        if (linkResponse.getTopic() == null || !linkResponse.getTopic().contains("custom/native/inverter/")) {
                        if (linkResponse.getTopic() == null || !linkResponse.getTopic().contains("custom/native/inverter/up")) {
                            return;
                        }
                        byte[] data = linkResponse.getByteData();
                        ModbusResponse modbusResponse = new ModbusResponse();
                        int a=data[0]&0xff;
                        int b=data[1]&0xff;
                        String topic = "Modbus" + data[0] + data[1];
                        modbusResponse.setTopic(topic);
                        modbusResponse.setData(data);
@@ -102,6 +104,7 @@
                                break;
                            }
                        }
                        EventDispatcher.getInstance().post(topic, modbusResponse);
                        //发布Zigbee原生主题及数据
//                        EventDispatcher.getInstance().post(allTopic, modbusResponse);
@@ -149,9 +152,9 @@
        new HDLConnectHelper(timeout, 1, gatewayBean.getIp_address(), 8586, request, new HDLConnectHelper.HdlSocketListener() {
            @Override
            public void onSucceed(Object msg) {
                if (msg instanceof byte[]) {
                if (msg instanceof int[]) {
                    if (null != baseCallBack) {
                        baseCallBack.onSuccess((byte[]) msg);
                        baseCallBack.onSuccess((int[]) msg);
                    }
                } else {
                    LogUtils.e("发送Modbus回调对象类型非数组类型,类型是" + msg.getClass());