gadget: Print functions in gadget show command
authorPawel Szewczyk <p.szewczyk@samsung.com>
Tue, 14 Jul 2015 12:01:57 +0000 (14:01 +0200)
committerKrzysztof Opasiak <k.opasiak@samsung.com>
Tue, 28 Jul 2015 16:07:11 +0000 (18:07 +0200)
When --recursive flag is used, functions are also printed.

Change-Id: I3d58c53111cd1db2e934b46cb4cc89a852b74451
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
source/gadget/CMakeLists.txt
source/gadget/src/gadget_libusbg.c

index ed550e5..5120fa6 100644 (file)
@@ -1,5 +1,6 @@
 
-INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/include )
+INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/include
+                       ${CMAKE_SOURCE_DIR}/function/include )
 
 SET( GADGET_SRC
        ${CMAKE_CURRENT_SOURCE_DIR}/src/gadget.c
index 5b81275..1930ac2 100644 (file)
@@ -23,6 +23,7 @@
 #include "backend.h"
 #include "common.h"
 #include "settings.h"
+#include "function.h"
 
 /**
  * @brief Get implicite gadget
@@ -288,6 +289,7 @@ static int print_gadget(usbg_gadget *g, int opts)
 {
        usbg_gadget_attrs g_attrs;
        usbg_udc *u;
+       usbg_function *f;
        int usbg_ret;
        const char *name;
 
@@ -321,7 +323,13 @@ static int print_gadget(usbg_gadget *g, int opts)
        if (opts & GT_VERBOSE)
                print_gadget_attrs(&g_attrs, NULL);
 
-       /* TODO --recursive*/
+       if (opts & GT_RECURSIVE) {
+               usbg_for_each_function(f, g) {
+                       gt_print_function_libusbg(f, opts);
+               }
+
+               /* TODO print config */
+       }
 
        return 0;
 }