panlili2024
2025-03-19 7c8ce9b9a7d3fc1aaa4a621e86415b25ad10a34f
HDLSDK/hdl-connect/src/main/java/com/hdl/sdk/common/HDLSdk.java
@@ -18,7 +18,9 @@
    private Context context;
    private String version = "1.2.1";
    private String version = "1.2.2";
    private int bindPort = 8585;//绑定的端口
    /**
     * 获取当前版本
@@ -69,6 +71,35 @@
        });
    }
    public void init(Context context, int bindPort) {
        if (this.context != null) {
            return;
        }
        this.context = context.getApplicationContext();
        this.bindPort = bindPort;
        HDLAuthSocket.getInstance().init();
        HDLSocket.getInstance().broadcastRequest();
        LogUtils.i("HDLSdk Version:" + getVersion());
        //订阅所有的主题
        HDLLink.getInstance().registerAllTopicsListener(new EventListener() {
            @Override
            public void onMessage(Object msg) {
                if (msg == null || !(msg instanceof LinkResponse)) {
                    return;
                }
                AllTopicManagerUtils.manager((LinkResponse) msg);
            }
        });
    }
    public int getBindPort() {
        return bindPort;
    }
    public void setBindPort(int bindPort) {
        this.bindPort = bindPort;
    }
    public Context getContext() {
        return context;