|
Lines 226-248
nm_get_device_info (NetworkStatusAgent *
Link Here
|
| 226 |
|
226 |
|
| 227 |
if (NM_IS_DEVICE_802_11_WIRELESS(device)) |
227 |
if (NM_IS_DEVICE_802_11_WIRELESS(device)) |
| 228 |
{ |
228 |
{ |
| 229 |
const GPtrArray *aps; |
229 |
NMAccessPoint * activeap = NULL; |
| 230 |
gint i; |
230 |
const GByteArray * ssid; |
| 231 |
info->type = DEVICE_TYPE_802_11_WIRELESS; |
|
|
| 232 |
|
231 |
|
|
|
232 |
info->type = DEVICE_TYPE_802_11_WIRELESS; |
| 233 |
info->speed_mbs = nm_device_802_11_wireless_get_bitrate (NM_DEVICE_802_11_WIRELESS(device)); |
233 |
info->speed_mbs = nm_device_802_11_wireless_get_bitrate (NM_DEVICE_802_11_WIRELESS(device)); |
| 234 |
info->hw_addr = g_strdup (nm_device_802_11_wireless_get_hw_address (NM_DEVICE_802_11_WIRELESS(device))); |
234 |
info->hw_addr = g_strdup (nm_device_802_11_wireless_get_hw_address (NM_DEVICE_802_11_WIRELESS(device))); |
| 235 |
aps = nm_device_802_11_wireless_get_access_points (NM_DEVICE_802_11_WIRELESS(device)); |
235 |
|
| 236 |
for (i = 0; aps && i < aps->len; i++) |
236 |
activeap = nm_device_802_11_wireless_get_active_access_point (NM_DEVICE_802_11_WIRELESS(device)); |
|
|
237 |
if (activeap) |
| 237 |
{ |
238 |
{ |
| 238 |
const GByteArray * ssid; |
239 |
ssid = nm_access_point_get_ssid (NM_ACCESS_POINT (activeap)); |
| 239 |
ssid = nm_access_point_get_ssid (NM_ACCESS_POINT (g_ptr_array_index (aps, i))); |
|
|
| 240 |
if (ssid) |
240 |
if (ssid) |
| 241 |
info->essid = g_strdup (nm_utils_escape_ssid (ssid->data, ssid->len)); |
241 |
info->essid = g_strdup (nm_utils_escape_ssid (ssid->data, ssid->len)); |
| 242 |
else |
|
|
| 243 |
info->essid = g_strdup ("(none)"); |
| 244 |
break; //fixme - we only show one for now |
| 245 |
} |
242 |
} |
|
|
243 |
|
| 244 |
if (! info->essid) |
| 245 |
info->essid = g_strdup ("(none)"); |
| 246 |
} |
246 |
} |
| 247 |
else if (NM_IS_DEVICE_802_3_ETHERNET (device)) |
247 |
else if (NM_IS_DEVICE_802_3_ETHERNET (device)) |
| 248 |
{ |
248 |
{ |