diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2011-11-23 10:37:03 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-15 14:14:24 +0100 |
commit | 912318b5d9bb78ce69b3753543122e5ca9ea67ee (patch) | |
tree | ee9dee356e28c1213024fff8fb5630fde889ebbe /src | |
parent | 43d09e63e1fb5a3ff0f7beb4fb4fe35fcb2a8345 (diff) |
broadband-modem: implement EquipmentIdentifier loading
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-broadband-modem.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index efe51516..05274eed 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -388,6 +388,50 @@ load_revision (MMIfaceModem *self, } /*****************************************************************************/ +/* EQUIPMENT ID */ + +static gchar * +load_equipment_identifier_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + GVariant *result; + gchar *equipment_identifier; + + result = mm_at_sequence_finish (G_OBJECT (self), res, error); + if (!result) + return NULL; + + equipment_identifier = g_variant_dup_string (result, NULL); + mm_dbg ("loaded equipment identifier: %s", equipment_identifier); + g_variant_unref (result); + return equipment_identifier; +} + +static const MMAtCommand equipment_identifiers[] = { + { "+CGSN", 3, (MMAtResponseProcessor)common_parse_string_reply }, + { "+GSN", 3, (MMAtResponseProcessor)common_parse_string_reply }, + { NULL } +}; + +static void +load_equipment_identifier (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + mm_dbg ("loading equipment identifier..."); + mm_at_sequence (G_OBJECT (self), + mm_base_modem_get_port_primary (MM_BASE_MODEM (self)), + (MMAtCommand *)equipment_identifiers, + NULL, /* response_processor_context */ + FALSE, + "s", + NULL, /* TODO: cancellable */ + callback, + user_data); +} + +/*****************************************************************************/ static void enable (MMBaseModem *self, @@ -609,6 +653,8 @@ iface_modem_init (MMIfaceModem *iface) iface->load_model_finish = load_model_finish; iface->load_revision = load_revision; iface->load_revision_finish = load_revision_finish; + iface->load_equipment_identifier = load_equipment_identifier; + iface->load_equipment_identifier_finish = load_equipment_identifier_finish; } static void |