aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-02-14 15:31:05 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:15:07 +0100
commit35f0b773ef4ba251cdba0b1a7e7245253ca44828 (patch)
treed84e6e17d06cc3d3e22e55fdd3e0a9e982b0b968
parent1bcecc9e1d9f990a881c339e34c0f06c39378c8a (diff)
iridium: implement specific operator name and code retrieval
-rw-r--r--plugins/mm-broadband-modem-iridium.c52
1 files changed, 51 insertions, 1 deletions
diff --git a/plugins/mm-broadband-modem-iridium.c b/plugins/mm-broadband-modem-iridium.c
index 4b3f3cf4..112abb66 100644
--- a/plugins/mm-broadband-modem-iridium.c
+++ b/plugins/mm-broadband-modem-iridium.c
@@ -27,15 +27,55 @@
#include "mm-errors-types.h"
#include "mm-base-modem-at.h"
#include "mm-iface-modem.h"
+#include "mm-iface-modem-3gpp.h"
#include "mm-iface-modem-messaging.h"
#include "mm-broadband-modem-iridium.h"
#include "mm-sim-iridium.h"
#include "mm-modem-helpers.h"
static void iface_modem_init (MMIfaceModem *iface);
+static void iface_modem_3gpp_init (MMIfaceModem3gpp *iface);
G_DEFINE_TYPE_EXTENDED (MMBroadbandModemIridium, mm_broadband_modem_iridium, MM_TYPE_BROADBAND_MODEM, 0,
- G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM, iface_modem_init));
+ G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM, iface_modem_init)
+ G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_3GPP, iface_modem_3gpp_init));
+
+/*****************************************************************************/
+/* Operator Code and Name loading (3GPP interface) */
+
+static gchar *
+load_operator_code_finish (MMIfaceModem3gpp *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ /* Only "90103" operator code is assumed */
+ return g_strdup ("90103");
+}
+
+static gchar *
+load_operator_name_finish (MMIfaceModem3gpp *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ /* Only "IRIDIUM" operator name is assumed */
+ return g_strdup ("IRIDIUM");
+}
+
+static void
+load_operator_name_or_code (MMIfaceModem3gpp *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GSimpleAsyncResult *result;
+
+ result = g_simple_async_result_new (G_OBJECT (self),
+ callback,
+ user_data,
+ load_operator_name_or_code);
+ g_simple_async_result_set_op_res_gboolean (result, TRUE);
+ g_simple_async_result_complete_in_idle (result);
+ g_object_unref (result);
+}
/*****************************************************************************/
/* Signal quality (Modem interface) */
@@ -216,6 +256,16 @@ iface_modem_init (MMIfaceModem *iface)
}
static void
+iface_modem_3gpp_init (MMIfaceModem3gpp *iface)
+{
+ /* Fixed operator code and name to be reported */
+ iface->load_operator_name = load_operator_name_or_code;
+ iface->load_operator_name_finish = load_operator_name_finish;
+ iface->load_operator_code = load_operator_name_or_code;
+ iface->load_operator_code_finish = load_operator_code_finish;
+}
+
+static void
mm_broadband_modem_iridium_class_init (MMBroadbandModemIridiumClass *klass)
{
}