86. {
87. stringBuilder.append("Index_"+new Integer(i + 1).toString() + ":");
88. //将ScanResult信息转换成一个字符串包
89. //其中把包括:BSSID、SSID、capabilities、frequency、level
90. stringBuilder.append((mWifiList.get(i)).toString());
91. stringBuilder.append("\n");
92. }
93. return stringBuilder;
94. }
95. //得到MAC地址
96. public String GetMacAddress()
97. {
98. return (mWifiInfo == null) ? "NULL" : mWifiInfo.getMacAddress();
99. }
100. //得到接入点的BSSID
101. public String GetBSSID()
102. {
103. return (mWifiInfo == null) ? "NULL" : mWifiInfo.getBSSID();
104. }
105. //得到IP地址
106. public int GetIPAddress()
107. {
108. return (mWifiInfo == null) ? 0 : mWifiInfo.getIpAddress();
109. }
110. //得到连接的ID
111. public int GetNetworkId()
112. {
113. return (mWifiInfo == null) ? 0 : mWifiInfo.getNetworkId();
114. }
115. //得到WifiInfo的所有信息包
116. public String GetWifiInfo()
117. {
118. return (mWifiInfo == null) ? "NULL" : mWifiInfo.toString();
119. }
120. //添加一个网络并连接
121. public void AddNetwork(WifiConfiguration wcg)