[maemo-commits] [maemo-commits] r16803 - projects/haf/trunk/ke-recv/src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Nov 28 17:07:10 EET 2008
Author: kihamala
Date: 2008-11-28 17:07:09 +0200 (Fri, 28 Nov 2008)
New Revision: 16803

Modified:
   projects/haf/trunk/ke-recv/src/ke-recv-test.c
   projects/haf/trunk/ke-recv/src/ke-recv.c
Log:
add support to ke-recv-test for the two new messages


Modified: projects/haf/trunk/ke-recv/src/ke-recv-test.c
===================================================================
--- projects/haf/trunk/ke-recv/src/ke-recv-test.c	2008-11-28 14:50:48 UTC (rev 16802)
+++ projects/haf/trunk/ke-recv/src/ke-recv-test.c	2008-11-28 15:07:09 UTC (rev 16803)
@@ -181,6 +181,46 @@
     	ULOG_DEBUG_F("leaving");
 }
 
+static void send_enable_pcsuite()
+{
+	DBusMessage* m = NULL, *reply = NULL;
+	DBusError err;
+    	ULOG_DEBUG_F("entering");
+	assert(sys_conn != NULL);
+	dbus_error_init(&err);
+	  m = dbus_message_new_method_call("com.nokia.ke_recv",
+			"/com/nokia/ke_recv/enable_pcsuite",
+			"com.nokia.ke_recv",
+			"dummy");
+	reply = dbus_connection_send_with_reply_and_block(sys_conn, m,
+			20000, &err);
+    	if (reply == NULL) {
+       	   ULOG_CRIT_F("dbus_connection_send failed: %s", err.message);
+           exit(1);
+        }
+    	ULOG_DEBUG_F("leaving");
+}
+
+static void send_enable_mass_storage()
+{
+	DBusMessage* m = NULL, *reply = NULL;
+	DBusError err;
+    	ULOG_DEBUG_F("entering");
+	assert(sys_conn != NULL);
+	dbus_error_init(&err);
+	  m = dbus_message_new_method_call("com.nokia.ke_recv",
+			"/com/nokia/ke_recv/enable_mass_storage",
+			"com.nokia.ke_recv",
+			"dummy");
+	reply = dbus_connection_send_with_reply_and_block(sys_conn, m,
+			20000, &err);
+    	if (reply == NULL) {
+       	   ULOG_CRIT_F("dbus_connection_send failed: %s", err.message);
+           exit(1);
+        }
+    	ULOG_DEBUG_F("leaving");
+}
+
 static void send_swap_off(int mode)
 {
 	DBusMessage* m = NULL, *reply = NULL;
@@ -348,7 +388,9 @@
                    "e - repair (ext-)MMC (" EXT_DEV ")\n"
                    "ei - repair (int-)MMC (" INT_DEV ")\n"
                    "ej - eject USB\n"
-                   "ec - cancel eject USB\n");
+                   "ec - cancel eject USB\n"
+                   "p - enable PC Suite\n"
+                   "m - enable USB mass storage\n");
             exit(1);
     }
     ULOG_OPEN("ke_recv_test");
@@ -382,6 +424,12 @@
             case 't':
                 send_swap_off(argv[1][1]);
                 break;
+            case 'p':
+                send_enable_pcsuite();
+                break;
+            case 'm':
+                send_enable_mass_storage();
+                break;
             case 'a':
                 if (argv[1][1] == 't') {
                         attach_usb();

Modified: projects/haf/trunk/ke-recv/src/ke-recv.c
===================================================================
--- projects/haf/trunk/ke-recv/src/ke-recv.c	2008-11-28 14:50:48 UTC (rev 16802)
+++ projects/haf/trunk/ke-recv/src/ke-recv.c	2008-11-28 15:07:09 UTC (rev 16803)
@@ -568,6 +568,7 @@
         the_connection = c;
         the_message = m;
         handle_usb_event(E_EJECT);
+        send_reply();
         /* invalidate */
         the_connection = NULL;
         the_message = NULL;
@@ -582,6 +583,7 @@
         the_connection = c;
         the_message = m;
         handle_usb_event(E_EJECT_CANCELLED);
+        send_reply();
         /* invalidate */
         the_connection = NULL;
         the_message = NULL;
@@ -596,6 +598,7 @@
         the_connection = c;
         the_message = m;
         handle_usb_event(E_ENTER_PCSUITE_MODE);
+        send_reply();
         /* invalidate */
         the_connection = NULL;
         the_message = NULL;
@@ -610,6 +613,7 @@
         the_connection = c;
         the_message = m;
         handle_usb_event(E_ENTER_MASS_STORAGE_MODE);
+        send_reply();
         /* invalidate */
         the_connection = NULL;
         the_message = NULL;


More information about the maemo-commits mailing list