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

Tormod Volden lists.tormod at gmail.com
Thu Nov 17 20:13:40 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>

v2: Added a colon to the message before the interface list.

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

diff --git a/src/main.c b/src/main.c
index eebce1e..74d0900 100644
--- a/src/main.c
+++ b/src/main.c
@@ -843,7 +843,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");
@@ -965,6 +965,8 @@ dfustate:
 		fprintf(stderr, "No matching DFU Interface after RESET?!?\n");
 	} 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);

More information about the devel mailing list