hxb
2023-12-15 3b47201d878ba8ff973b84baf15942475688e964
HDLLinkLocalSdk/src/main/java/com/hdl/sdk/link/core/connect/HDLConnectHelper.java
@@ -114,7 +114,7 @@
                        /**
                         * 可能返回code属性可能没有   没有的话直接成功  有的话只有200才会成功
                         */
                        if (code == null || code == 200 || code == 0) {
                        if (code == null || code.intValue() == 200 || code.intValue() == 0) {
                            notifySucceed(msg);
                        } else {
                            notifyFailure(ErrorUtils.getByCode(code));
@@ -325,8 +325,10 @@
                                    String requestTopic = linkRequest.getCloudTopic();
                                    byte[] encryBytes = null;
                                    GatewayBean gatewayBean = HDLLinkLocalGateway.getInstance().getLocalGateway(mac);
                                    if (gatewayBean != null && getGatewayTypeList().contains(gatewayBean.getGatewayType())) {
                                        //逆变器远程mqtt秘钥不一样
                                    if (gatewayBean != null && getMillimeterTypeList().contains(gatewayBean.getGatewayType())) {
                                        /**
                                         * 毫米波这边获取数据的时候  已经设置了主从密钥进去了 这边不作处理
                                         */
                                        encryBytes = EncryptUtil.encryBytes(linkRequest.getCloudSendBytes(), gatewayBean.getAesKey());
                                    } else {
                                        encryBytes = EncryptUtil.encryBytes(linkRequest.getCloudSendBytes(), HDLLinkConfig.getInstance().getAesKey());
@@ -334,20 +336,12 @@
                                    if (MqttRecvClient.getInstance() != null) {
                                        MqttRecvClient.getInstance().send(requestTopic, encryBytes);
                                    }
                                    if (HDLConnectHelper.isInverterTopic(linkRequest.getCloudTopic())) {
                                        LogUtils.i("远程发送数据:" + linkRequest.getCloudTopic() + "\r\n" + Arrays.toString(byteArrayConvertIntArray(linkRequest.getCloudSendBytes())));
                                    } else {
                                        LogUtils.i("远程发送数据:" + linkRequest.getCloudTopic() + "\r\n" + new String(linkRequest.getCloudSendBytes()));
                                    }
                                    LogUtils.i("远程发送数据:" + linkRequest.getCloudTopic() + "\r\n" + new String(linkRequest.getCloudSendBytes()));
                                }
                                //本地TCP
                                else {
                                    if (!linkRequest.getTopic().endsWith("heartbeat")) {//心跳主题数据过多,过滤下
                                        if (HDLConnectHelper.isInverterTopic(linkRequest.getTopic())) {
                                            LogUtils.i("本地发送数据:\r\n" + Arrays.toString(byteArrayConvertIntArray(linkRequest.getSendBytes())));
                                        } else {
                                            LogUtils.i("本地发送数据:\r\n" + new String(linkRequest.getSendBytes()));
                                        }
                                        LogUtils.i("本地发送数据:\r\n" + new String(linkRequest.getSendBytes()));
                                    }
                                    HDLTcpConnect.getTcpSocketBoot(ipAddress).sendMsg(EncryptUtil.getEncryBytes(linkRequest));
                                }
@@ -419,6 +413,7 @@
    }
    /**
     * 支持毫米类型
     *
@@ -429,6 +424,24 @@
//        typeList.add("sensor.mmv_sleep");//睡眠毫米波spk
//        typeList.add("sensor.mmv_pose");//姿态毫米波spk
        typeList.add("energy.hdl_inverter");//逆变器spk
        typeList.add("sensor.mmv_sleep");//睡眠毫米波spk
        typeList.add("sensor.mmv_pose");//姿态毫米波spk
        typeList.add("sensor.hdl_mmw_pose");//Wi-Fi毫米波ZT版本
        return typeList;
    }
    public static List<String> getMillimeterTypeList() {
        List<String> typeList = new ArrayList<>();
//        typeList.add("AGATEWAY");//网关
        typeList.add("sensor.mmv_sleep");//睡眠毫米波spk
        typeList.add("sensor.mmv_pose");//姿态毫米波spk
        typeList.add("sensor.hdl_mmw_pose");//Wi-Fi毫米波ZT版本
        return typeList;
    }
    public static List<String> getNewMillimeterTypeList() {
        List<String> typeList = new ArrayList<>();
        typeList.add("sensor.hdl_mmw_pose");//Wi-Fi毫米波ZT版本
        return typeList;
    }
@@ -446,6 +459,7 @@
    }
    public static boolean isInverterTopic(String topic) {
        if (TextUtils.isEmpty(topic)) {
            return false;