hxb
2021-12-21 93f13e7b2e046c6d86d10e7abc2ecaa4c4adabc3
HDLSDK/app/src/main/java/com/hdl/hdlsdk/MainActivity.java
@@ -82,7 +82,7 @@
        rv.setLayoutManager(new LinearLayoutManager(this));
        checkIfCertified();
        initDeviceInfo();
        registerAllTopicsListener();
        ActivityResultLauncher<String[]> launcher = registerForActivityResult(new ActivityResultContracts.RequestMultiplePermissions(), new ActivityResultCallback<Map<String, Boolean>>() {
@@ -202,6 +202,7 @@
            @Override
            public void onMessage(Object msg) {
                LinkResponse response = (LinkResponse) msg;
                handleLinkResponse(response);
            }
        };
        HDLLink.getInstance().registerAllTopicsListener(allTopicsListener);
@@ -250,6 +251,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);
    }
    /**
     * 入网认证
     */