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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Tormod Volden
From: Tormod Volden <[hidden email]>

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 <[hidden email]>
---

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


_______________________________________________
devel mailing list
[hidden email]
https://lists.openmoko.org/mailman/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

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

Tormod Volden
From: Tormod Volden <[hidden email]>

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 <[hidden email]>
---

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");
  exit(1);
  }
 
@@ -965,6 +965,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.0.4


_______________________________________________
devel mailing list
[hidden email]
https://lists.openmoko.org/mailman/listinfo/devel