示例#1
0
        private void joinTestChannel(int interfaceType)
        {
            /// <summary>
            /// 5. Join my channel
            /// </summary>
            addLogView(interfaceType, "    joinChannel()");

            SchordChannel channel        = null;
            SchordManager currentManager = null;

            currentManager = getSchordManager(interfaceType);

            switch (interfaceType)
            {
            case SchordManager.INTERFACE_TYPE_WIFI:
                channel = currentManager.joinChannel(CHORD_HELLO_TEST_CHANNEL, mWifi_ChannelListener);
                break;

            case SchordManager.INTERFACE_TYPE_WIFI_P2P:
                channel = currentManager.joinChannel(CHORD_HELLO_TEST_CHANNEL, mWifiDirect_ChannelListener);
                break;

            case SchordManager.INTERFACE_TYPE_WIFI_AP:
                channel = currentManager.joinChannel(CHORD_HELLO_TEST_CHANNEL, mMobileAP_ChannelListener);
                break;
            }

            if (channel == null)
            {
                addLogView(interfaceType, "    Fail to joinChannel");
            }
        }