r2001 - trunk/src/target/OM-2007/openmoko-libs/libmokogsmd

mickey at sita.openmoko.org mickey at sita.openmoko.org
Thu May 17 20:46:38 CEST 2007


Author: mickey
Date: 2007-05-17 20:46:37 +0200 (Thu, 17 May 2007)
New Revision: 2001

Modified:
   trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-connection.c
   trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-connection.h
Log:
libmokogsmd: register signal "pin-requested"


Modified: trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-connection.c
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-connection.c	2007-05-17 11:47:04 UTC (rev 2000)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-connection.c	2007-05-17 18:46:37 UTC (rev 2001)
@@ -25,8 +25,8 @@
 #include <string.h>
 #include <errno.h>
 
+#define DEBUG_THIS_FILE
 #undef DEBUG_THIS_FILE
-#define DEBUG_THIS_FILE
 
 #ifdef DEBUG_THIS_FILE
 #define moko_debug(fmt,...) g_debug(fmt,##__VA_ARGS__)
@@ -177,7 +177,18 @@
         G_TYPE_INT,
         NULL);
 
-    //TODO add SIGNAL_GSMD_EVT_PIN
+    moko_gsmd_connection_signals[SIGNAL_GSMD_EVT_PIN] = g_signal_new
+        ("pin-requested",
+        G_TYPE_FROM_CLASS (klass),
+        G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,
+        NULL,
+        NULL,
+        NULL,
+        g_cclosure_marshal_VOID__INT,
+        G_TYPE_NONE,
+        1,
+        G_TYPE_INT,
+        NULL);
 
     moko_gsmd_connection_signals[SIGNAL_GSMD_EVT_OUT_STATUS] = g_signal_new
         ("call-progress",
@@ -279,6 +290,14 @@
     return 0;
 }
 
+/* this is the handler for receiving passthrough responses */
+static int
+pt_msghandler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh)
+{
+    char *payload = (char *)gmh + sizeof(*gmh);
+    g_debug("PASSTHROUGH RESPONSE = '%s'", payload);
+}
+
 static void
 moko_gsmd_connection_init(MokoGsmdConnection* self)
 {
@@ -321,6 +340,7 @@
         moko_debug( "-- registered for event %d, return code %d", i, rc );
     }
 
+    lgsm_register_handler( priv->handle, GSMD_MSG_PASSTHROUGH, &pt_msghandler);
 }
 
 /* public API */
@@ -370,3 +390,10 @@
     g_return_if_fail( priv->handle );
     lgsm_voice_dtmf( priv->handle, number );
 }
+
+void moko_gsmd_connection_trigger_signal_strength_event(MokoGsmdConnection* self)
+{
+    MokoGsmdConnectionPrivate* priv = GSMD_CONNECTION_GET_PRIVATE(self);
+    g_return_if_fail( priv->handle );
+    lgsm_signal_quality( priv->handle );
+}

Modified: trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-connection.h
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-connection.h	2007-05-17 11:47:04 UTC (rev 2000)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-connection.h	2007-05-17 18:46:37 UTC (rev 2001)
@@ -72,6 +72,7 @@
 //gprs
 void moko_gsmd_connection_incoming_clip(MokoGsmdConnection* self, const char* number);
 void moko_gsmd_connection_network_registration(MokoGsmdConnection* self, int type, int lac, int cell);
+void moko_gsmd_connection_trigger_signal_strength_event(MokoGsmdConnection* self);
 void moko_gsmd_connection_signal_strength_changed(MokoGsmdConnection* self, int strength);
 //voice
 void moko_gsmd_connection_voice_accept(MokoGsmdConnection* self);





More information about the commitlog mailing list