[PATCH 5/5] mbimcli: new '--ms-host-shut-down' action

Ben Chan benchan at chromium.org
Tue Feb 25 12:48:18 PST 2014


---
 src/mbimcli/Makefile.am |  3 ++-
 src/mbimcli/mbimcli.c   |  8 ++++++++
 src/mbimcli/mbimcli.h   | 28 ++++++++++++++++------------
 3 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/src/mbimcli/Makefile.am b/src/mbimcli/Makefile.am
index 186347b..29ecf9e 100644
--- a/src/mbimcli/Makefile.am
+++ b/src/mbimcli/Makefile.am
@@ -14,7 +14,8 @@ mbimcli_SOURCES = \
 	mbimcli.c \
 	mbimcli-basic-connect.c \
 	mbimcli-phonebook.c \
-	mbimcli-ms-fwid.c
+	mbimcli-ms-fwid.c \
+	mbimcli-ms-hostshutdown.c
 
 mbimcli_LDADD = \
 	$(MBIMCLI_LIBS) \
diff --git a/src/mbimcli/mbimcli.c b/src/mbimcli/mbimcli.c
index c2a795e..eae2dcb 100644
--- a/src/mbimcli/mbimcli.c
+++ b/src/mbimcli/mbimcli.c
@@ -260,6 +260,9 @@ device_open_ready (MbimDevice   *dev,
     case MBIM_SERVICE_MS_FWID:
         mbimcli_ms_fwid_run (dev, cancellable);
         return;
+    case MBIM_SERVICE_MS_HOSTSHUTDOWN:
+        mbimcli_ms_hostshutdown_run (dev, cancellable);
+        return;
     default:
         g_assert_not_reached ();
     }
@@ -341,6 +344,9 @@ parse_actions (void)
     } else if (mbimcli_ms_fwid_options_enabled ()) {
         service = MBIM_SERVICE_MS_FWID;
         actions_enabled++;
+    } else if (mbimcli_ms_hostshutdown_options_enabled ()) {
+        service = MBIM_SERVICE_MS_HOSTSHUTDOWN;
+        actions_enabled++;
     }
 
     /* Noop */
@@ -380,6 +386,8 @@ int main (int argc, char **argv)
 	                            mbimcli_phonebook_get_option_group ());
     g_option_context_add_group (context,
                                 mbimcli_ms_fwid_get_option_group ());
+    g_option_context_add_group (context,
+                                mbimcli_ms_hostshutdown_get_option_group ());
     g_option_context_add_main_entries (context, main_entries, NULL);
     if (!g_option_context_parse (context, &argc, &argv, &error)) {
         g_printerr ("error: %s\n",
diff --git a/src/mbimcli/mbimcli.h b/src/mbimcli/mbimcli.h
index 9daad07..fae1eab 100644
--- a/src/mbimcli/mbimcli.h
+++ b/src/mbimcli/mbimcli.h
@@ -29,17 +29,21 @@
 void mbimcli_async_operation_done (gboolean operation_status);
 
 /* Basic Connect group */
-GOptionGroup *mbimcli_basic_connect_get_option_group (void);
-GOptionGroup *mbimcli_phonebook_get_option_group     (void);
-GOptionGroup *mbimcli_ms_fwid_get_option_group       (void);
-gboolean      mbimcli_basic_connect_options_enabled  (void);
-gboolean      mbimcli_phonebook_options_enabled      (void);
-gboolean      mbimcli_ms_fwid_options_enabled        (void);
-void          mbimcli_basic_connect_run              (MbimDevice *device,
-                                                      GCancellable *cancellable);
-void          mbimcli_phonebook_run                  (MbimDevice *device,
-                                                      GCancellable *cancellable);
-void          mbimcli_ms_fwid_run                    (MbimDevice *device,
-                                                      GCancellable *cancellable);
+GOptionGroup *mbimcli_basic_connect_get_option_group   (void);
+GOptionGroup *mbimcli_phonebook_get_option_group       (void);
+GOptionGroup *mbimcli_ms_fwid_get_option_group         (void);
+GOptionGroup *mbimcli_ms_hostshutdown_get_option_group (void);
+gboolean      mbimcli_basic_connect_options_enabled    (void);
+gboolean      mbimcli_phonebook_options_enabled        (void);
+gboolean      mbimcli_ms_fwid_options_enabled          (void);
+gboolean      mbimcli_ms_hostshutdown_options_enabled  (void);
+void          mbimcli_basic_connect_run                (MbimDevice *device,
+                                                        GCancellable *cancellable);
+void          mbimcli_phonebook_run                    (MbimDevice *device,
+                                                        GCancellable *cancellable);
+void          mbimcli_ms_fwid_run                      (MbimDevice *device,
+                                                        GCancellable *cancellable);
+void          mbimcli_ms_hostshutdown_run              (MbimDevice *device,
+                                                        GCancellable *cancellable);
 
 #endif /* __MBIMCLI_H__ */
-- 
1.9.0.rc1.175.g0b1dcb5



More information about the libmbim-devel mailing list