summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-07-02 14:25:43 -0400
committerDan Winship <danw@gnome.org>2014-09-04 09:21:04 -0400
commitad6c25b3c26b536d81b9fbf6f6b9feaefbc62332 (patch)
tree963c8c14cec3d9a4307f1d5e65bc80e8e27d3863 /examples
parent064595806c381704e1050a4160da69e9715361e8 (diff)
libnm: drop NM_TYPE_SSID, use G_TYPE_BYTES
Make NMAccessPoint:ssid be G_TYPE_BYTES and update the corresponding APIs accordingly.
Diffstat (limited to 'examples')
-rw-r--r--examples/C/glib/get-ap-info-libnm.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/C/glib/get-ap-info-libnm.c b/examples/C/glib/get-ap-info-libnm.c
index acd93f9ba..c5e9b5b23 100644
--- a/examples/C/glib/get-ap-info-libnm.c
+++ b/examples/C/glib/get-ap-info-libnm.c
@@ -79,7 +79,7 @@ show_access_point_info (NMAccessPoint *ap)
{
guint32 flags, wpa_flags, rsn_flags, freq, bitrate;
guint8 strength;
- const GByteArray *ssid;
+ GBytes *ssid;
const char *hwaddr;
NM80211Mode mode;
char *freq_str, *ssid_str, *bitrate_str, *strength_str, *wpa_flags_str, *rsn_flags_str;
@@ -97,7 +97,7 @@ show_access_point_info (NMAccessPoint *ap)
strength = nm_access_point_get_strength (ap);
/* Convert to strings */
- ssid_str = nm_utils_ssid_to_utf8 (ssid->data, ssid->len);
+ ssid_str = nm_utils_ssid_to_utf8 (g_bytes_get_data (ssid, NULL), g_bytes_get_size (ssid));
freq_str = g_strdup_printf ("%u MHz", freq);
bitrate_str = g_strdup_printf ("%u Mbit/s", bitrate/1000);
strength_str = g_strdup_printf ("%u", strength);
@@ -155,7 +155,7 @@ show_wifi_device_info (NMDevice *device)
const char *iface;
const char *driver;
guint32 speed;
- const GByteArray *active_ssid;
+ GBytes *active_ssid;
char *active_ssid_str = NULL;
int i;
@@ -163,7 +163,8 @@ show_wifi_device_info (NMDevice *device)
if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) {
if ((active_ap = nm_device_wifi_get_active_access_point (NM_DEVICE_WIFI (device)))) {
active_ssid = nm_access_point_get_ssid (active_ap);
- active_ssid_str = nm_utils_ssid_to_utf8 (active_ssid->data, active_ssid->len);
+ active_ssid_str = nm_utils_ssid_to_utf8 (g_bytes_get_data (active_ssid, NULL),
+ g_bytes_get_size (active_ssid));
}
}