gpt4 book ai didi

android.net.wifi.p2p.WifiP2pGroup.getPassphrase()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 03:27:05 35 4
gpt4 key购买 nike

本文整理了Java中android.net.wifi.p2p.WifiP2pGroup.getPassphrase()方法的一些代码示例,展示了WifiP2pGroup.getPassphrase()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WifiP2pGroup.getPassphrase()方法的具体详情如下:
包路径:android.net.wifi.p2p.WifiP2pGroup
类名称:WifiP2pGroup
方法名:getPassphrase

WifiP2pGroup.getPassphrase介绍

暂无

代码示例

代码示例来源:origin: robolectric/robolectric

@Test
public void requestGroupInfo() {
 TestGroupInfoListener listener = new TestGroupInfoListener();
 WifiP2pGroup wifiP2pGroup = new WifiP2pGroup();
 shadowOf(wifiP2pGroup).setInterface("ssid");
 shadowOf(wifiP2pGroup).setPassphrase("passphrase");
 shadowOf(wifiP2pGroup).setNetworkName("networkname");
 shadowManager.setGroupInfo(channel, wifiP2pGroup);
 manager.requestGroupInfo(channel, listener);
 assertThat(listener.group.getNetworkName()).isEqualTo(wifiP2pGroup.getNetworkName());
 assertThat(listener.group.getInterface()).isEqualTo(wifiP2pGroup.getInterface());
 assertThat(listener.group.getPassphrase()).isEqualTo(wifiP2pGroup.getPassphrase());
}

代码示例来源:origin: stackoverflow.com

...

if (WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION.equals(action)) {
  NetworkInfo networkInfo = intent.getParcelableExtra(WifiP2pManager.EXTRA_NETWORK_INFO);
  WifiP2pInfo wifiP2pInfo = intent.getParcelableExtra(WifiP2pManager.EXTRA_WIFI_P2P_INFO);
  if (networkInfo.isConnected() && wifiP2pInfo.groupFormed) {
      if (wifiP2pInfo.isGroupOwner) {
        wifiP2pManager.requestGroupInfo(channel, new WifiP2pManager.GroupInfoListener() {
          @Override
          public void onGroupInfoAvailable(final WifiP2pGroup wifiP2pGroup) {
            if (wifiP2pGroup != null) {
              // clients require these
              String ssid = wifiP2pGroup.getNetworkName();
              String passphrase = wifiP2pGroup.getPassphrase();
              ...
            }
          }
        }
      }
    }
  }
}
...

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com