[PATCH dfu-util] main: List alternate interfaces in DFU mode

Tormod Volden lists.tormod at gmail.com
Sun Nov 13 23:03:45 CET 2011


From: Tormod Volden <debian.tormod at gmail.com>

in the case there are several and the user did not specify one.

This can be useful if the device does not expose its alternate
interfaces in run-time mode, but only in DFU mode.

Also adjusted a warning message to clarify that we do not set
the alternate interface in run-time mode, only in DFU mode.

Signed-off-by: Tormod Volden <debian.tormod at gmail.com>
---

After looking a bit at this, it seem also that we might need
to clarify the documentation and behaviour on the --configuration,
--interface and --alternate options. In fact we do not support the
--configuration option, however this can be fixed. The --interface
option should not be needed since a DFU device only has one DFU
interface whether in run-time or DFU mode. None of our supported
devices needs this option.

 src/main.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/main.c b/src/main.c
index 3624069..ea666da 100644
--- a/src/main.c
+++ b/src/main.c
@@ -819,7 +819,7 @@ int main(int argc, char **argv)
 		}
 
 		if (libusb_set_interface_alt_setting(_rt_dif.dev_handle, _rt_dif.interface, 0) < 0) {
-			fprintf(stderr, "Cannot set alt interface\n");
+			fprintf(stderr, "Cannot set alt interface zero\n");
 			exit(1);
 		}
 
@@ -946,6 +946,8 @@ dfustate:
 		fprintf(stderr, "No matching DFU Interface after RESET?!?\n");
 		exit(1);
 	} else if (num_ifs > 1 ) {
+		printf("Detected interfaces after DFU transition\n");
+		list_dfu_interfaces(ctx);
 		fprintf(stderr, "We have %u DFU Interfaces/Altsettings,"
 			" you have to specify one via --intf / --alt"
 			" options\n", num_ifs);
-- 
1.7.5.4




More information about the devel mailing list