From 11cea3249fd58d59d7c1d644b1cfff6a547921c2 Mon Sep 17 00:00:00 2001 From: hxb <hxb@hdlchina.com.cn> Date: 星期三, 16 二月 2022 13:07:10 +0800 Subject: [PATCH] Merge branch 'dev-hxb' --- HDLSDK/app/src/main/java/com/hdl/hdlsdk/MainActivity.java | 37 ++++++++++++++++++++++++++++++------- 1 files changed, 30 insertions(+), 7 deletions(-) diff --git a/HDLSDK/app/src/main/java/com/hdl/hdlsdk/MainActivity.java b/HDLSDK/app/src/main/java/com/hdl/hdlsdk/MainActivity.java index 2033551..aed7414 100644 --- a/HDLSDK/app/src/main/java/com/hdl/hdlsdk/MainActivity.java +++ b/HDLSDK/app/src/main/java/com/hdl/hdlsdk/MainActivity.java @@ -71,7 +71,10 @@ super.onDestroy(); removeAllTopicsListener(); } - +void init(){ + HDLLinkConfig.getInstance().setLocalSecret("7d04c4e3c2b7d600"); + HDLLinkConfig.getInstance().setGatewayId("1473119283609321473"); +} @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -80,9 +83,9 @@ tv = findViewById(R.id.state_tv); rv = findViewById(R.id.rv); rv.setLayoutManager(new LinearLayoutManager(this)); - + init(); checkIfCertified(); - + initDeviceInfo(); registerAllTopicsListener(); ActivityResultLauncher<String[]> launcher = registerForActivityResult(new ActivityResultContracts.RequestMultiplePermissions(), new ActivityResultCallback<Map<String, Boolean>>() { @@ -202,6 +205,7 @@ @Override public void onMessage(Object msg) { LinkResponse response = (LinkResponse) msg; + handleLinkResponse(response); } }; HDLLink.getInstance().registerAllTopicsListener(allTopicsListener); @@ -250,6 +254,24 @@ HDLLink.getInstance().removeAllTopicsListener(allTopicsListener); } + void initDeviceInfo() + { + AuthenticateRequest.AuthenticateDeviceInfoBean infoBean = new AuthenticateRequest.AuthenticateDeviceInfoBean(); + infoBean.setDeviceMAC("123456789"); + infoBean.setIPMAC("12345678900"); + infoBean.setDeviceName("闊充箰鎾斁鍣�");//璁惧鍚嶅瓧 + infoBean.setDeviceModel("MCLog.431");//璁惧鍨嬪彿 + infoBean.setAccessMode("WIFI"); + infoBean.setIPGateway("192.168.88.1"); + infoBean.setIPAddress("192.168.88.100"); + infoBean.setGateway_type("music.standard"); + infoBean.setHw_version("HW2.0"); + infoBean.setFw_version("Fw1.0"); + infoBean.setOID("010105000000FE08"); + infoBean.setSid("010105000000FE08110100000000"); + HDLLinkConfig.getInstance().setDeviceInfoBean(infoBean); + } + /** * 鍏ョ綉璁よ瘉 */ @@ -262,7 +284,7 @@ String macStr = "AA000000000000BB";//璁惧鍞竴MAC鍦板潃 String secret = "87ae414b7a853f65";//閫氳繃spk鍜宮ac鎻愪氦浜戠璁よ瘉鍚庡垎閰嶇殑secret - //姝e紡鏈嶅姟鍣� +// //姝e紡鏈嶅姟鍣� // String spkStr = "screen.mirror";//浜у搧spk // String macStr = "AA000000000000AC";//璁惧鍞竴MAC鍦板潃 // String secret = "ee62124c151b737c";//閫氳繃spk鍜宮ac鎻愪氦浜戠璁よ瘉鍚庡垎閰嶇殑secret @@ -290,13 +312,14 @@ infoBean.setDeviceModel("HDL");// infoBean.setAccessMode("WIFI"); infoBean.setIPGateway("192.168.88.1"); - infoBean.setIPAddress(IpUtils.getIP(this)); + infoBean.setIPAddress(IpUtils.getIP(this));//鏍规嵁鐪熷疄鐨処P鍦板潃濉啓 infoBean.setOID("010105000000FE08"); infoBean.setSid("010105000000FE08110100000000"); + infoBean.setHw_version("1.0"); + infoBean.setFw_version("1.0"); // infoBean.set - AuthenticateRequest.VersionBean[] versionBeans = new AuthenticateRequest.VersionBean[]{new AuthenticateRequest.VersionBean("FW", versionString), new AuthenticateRequest.VersionBean("HW", "1956F")}; - infoBean.setVersions(versionBeans); + AuthenticateRequest request = new AuthenticateRequest(IdUtils.getUUId(), time, infoBean, authbean); HDLLink.getInstance().startAuthenticateRequest(request, new HDLLinkCallBack() { @Override -- Gitblit v1.8.0