| | |
| | | |
| | | private Context context; |
| | | |
| | | private String version = "1.2.1"; |
| | | private String version = "1.2.2"; |
| | | |
| | | private int bindPort = 8585;//绑定的端口 |
| | | |
| | | /** |
| | | * 获取当前版本 |
| | |
| | | }); |
| | | } |
| | | |
| | | 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; |