diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2016-08-02 13:26:49 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2016-10-12 11:29:51 +0200 |
commit | eade066d8a1f4ac94a1176a19002d244f63ad7dd (patch) | |
tree | 6e55157ffc79e9aabadcdc1870ab4bf12f918b13 /plugins/ublox | |
parent | 3b0ceabc5d87a30fc1da5c96174dc4616f06e066 (diff) |
ublox: generate enum types for usb profile and networking mode
Diffstat (limited to 'plugins/ublox')
-rw-r--r-- | plugins/ublox/mm-broadband-modem-ublox.c | 28 | ||||
-rw-r--r-- | plugins/ublox/mm-modem-helpers-ublox.h | 4 |
2 files changed, 7 insertions, 25 deletions
diff --git a/plugins/ublox/mm-broadband-modem-ublox.c b/plugins/ublox/mm-broadband-modem-ublox.c index f907c504..c71daa7d 100644 --- a/plugins/ublox/mm-broadband-modem-ublox.c +++ b/plugins/ublox/mm-broadband-modem-ublox.c @@ -28,6 +28,7 @@ #include "mm-broadband-bearer.h" #include "mm-broadband-modem-ublox.h" #include "mm-modem-helpers-ublox.h" +#include "mm-ublox-enums-types.h" static void iface_modem_init (MMIfaceModem *iface); @@ -123,16 +124,8 @@ mode_check_ready (MMBaseModem *self, mm_dbg ("u-blox: couldn't parse current networking mode response '%s': %s", response, error->message); g_error_free (error); } else { - switch (ctx->self->priv->mode) { - case MM_UBLOX_NETWORKING_MODE_ROUTER: - mm_dbg ("u-blox: networking mode loaded: router"); - break; - case MM_UBLOX_NETWORKING_MODE_BRIDGE: - mm_dbg ("u-blox: networking mode loaded: bridge"); - break; - default: - g_assert_not_reached (); - } + g_assert (ctx->self->priv->mode != MM_UBLOX_NETWORKING_MODE_UNKNOWN); + mm_dbg ("u-blox: networking mode loaded: %s", mm_ublox_networking_mode_get_string (ctx->self->priv->mode)); } /* Assume the operation has been performed, even if it may have failed */ @@ -161,19 +154,8 @@ profile_check_ready (MMBaseModem *self, mm_dbg ("u-blox: couldn't parse current usb profile response '%s': %s", response, error->message); g_error_free (error); } else { - switch (ctx->self->priv->profile) { - case MM_UBLOX_USB_PROFILE_RNDIS: - mm_dbg ("u-blox: usb profile loaded: high throughput"); - break; - case MM_UBLOX_USB_PROFILE_ECM: - mm_dbg ("u-blox: usb profile loaded: medium/low throughput"); - break; - case MM_UBLOX_USB_PROFILE_BACK_COMPATIBLE: - mm_dbg ("u-blox: usb profile loaded: back-compatible"); - break; - default: - g_assert_not_reached (); - } + g_assert (ctx->self->priv->profile != MM_UBLOX_USB_PROFILE_UNKNOWN); + mm_dbg ("u-blox: usb profile loaded: %s", mm_ublox_usb_profile_get_string (ctx->self->priv->profile)); } /* Assume the operation has been performed, even if it may have failed */ diff --git a/plugins/ublox/mm-modem-helpers-ublox.h b/plugins/ublox/mm-modem-helpers-ublox.h index b67e0e77..e8b9f22b 100644 --- a/plugins/ublox/mm-modem-helpers-ublox.h +++ b/plugins/ublox/mm-modem-helpers-ublox.h @@ -21,7 +21,7 @@ /*****************************************************************************/ /* UUSBCONF? response parser */ -typedef enum { +typedef enum { /*< underscore_name=mm_ublox_usb_profile >*/ MM_UBLOX_USB_PROFILE_UNKNOWN, MM_UBLOX_USB_PROFILE_RNDIS, MM_UBLOX_USB_PROFILE_ECM, @@ -35,7 +35,7 @@ gboolean mm_ublox_parse_uusbconf_response (const gchar *response, /*****************************************************************************/ /* UBMCONF? response parser */ -typedef enum { +typedef enum { /*< underscore_name=mm_ublox_networking_mode >*/ MM_UBLOX_NETWORKING_MODE_UNKNOWN, MM_UBLOX_NETWORKING_MODE_ROUTER, MM_UBLOX_NETWORKING_MODE_BRIDGE, |