diff options
author | Thomas Bechtold <thomasbechtold@jpberlin.de> | 2013-03-26 15:00:34 +0100 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2013-03-26 09:10:50 -0500 |
commit | 8016f32f04ac329f81ed04f9d1a0515546a70ba5 (patch) | |
tree | 28a64cea7ca189e538151c67f86ce32cc4e2e25b | |
parent | 294a91d9f6390d532399be35ddbf6a2b8d136576 (diff) |
core: show simple connect state as string for debugging
-rw-r--r-- | src/mm-generic-gsm.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/mm-generic-gsm.c b/src/mm-generic-gsm.c index 0e7c30b3..e728a03d 100644 --- a/src/mm-generic-gsm.c +++ b/src/mm-generic-gsm.c @@ -6031,6 +6031,29 @@ typedef enum { SIMPLE_STATE_DONE } SimpleState; +static const gchar* +simple_state_to_str (SimpleState state) +{ + switch (state) { + case SIMPLE_STATE_CHECK_PIN: + return "Check PIN"; + case SIMPLE_STATE_ENABLE: + return "Enable"; + case SIMPLE_STATE_ALLOWED_MODE: + return "Allowed Mode"; + case SIMPLE_STATE_REGISTER: + return "Register"; + case SIMPLE_STATE_SET_APN: + return "Set APN"; + case SIMPLE_STATE_CONNECT: + return "Connect"; + case SIMPLE_STATE_DONE: + return "Done"; + default: + return "Unknown state"; + } +} + /* Looks a value up in the simple connect properties dictionary. If the * requested key is not present in the dict, NULL is returned. If the * requested key is present but is not a string, an error is returned. @@ -6166,7 +6189,7 @@ simple_state_machine (MMModem *modem, GError *error, gpointer user_data) priv = MM_GENERIC_GSM_GET_PRIVATE (modem); g_object_get (G_OBJECT (modem), MM_MODEM_DATA_DEVICE, &data_device, NULL); - mm_dbg ("(%s): simple connect state %d", data_device, state); + mm_dbg ("(%s): simple connect state %d (%s)", data_device, state, simple_state_to_str (state)); g_free (data_device); switch (state) { |