@@ -35,6 +35,7 @@
int return_code = -1;
int verbose;
+int msg_timeout_ms = 15 * 1000;
struct mbim_handler *current_handler;
static uint8_t uuid_context_type_internet[16] = { 0x7E, 0x5E, 0x2A, 0x7E, 0x4E, 0x6F, 0x72, 0x72, 0x73, 0x6B, 0x65, 0x6E, 0x7E, 0x5E, 0x2A, 0x7E };
@@ -533,7 +534,8 @@ usage(void)
#endif
" -d <device> the device (/dev/cdc-wdmX)\n"
" -t <transaction> the transaction id\n"
- " -n no close\n\n"
+ " -n no close\n"
+ " -T <seconds> MBIM message timeout in seconds [15]\n\n"
" -v verbose\n\n");
return 1;
}
@@ -548,7 +550,7 @@ main(int argc, char **argv)
int proxy = 0;
#endif
- while ((ch = getopt(argc, argv, "pnvd:t:")) != -1) {
+ while ((ch = getopt(argc, argv, "pnvd:t:T:")) != -1) {
switch (ch) {
case 'v':
verbose = 1;
@@ -563,6 +565,9 @@ main(int argc, char **argv)
no_open = 1;
transaction_id = atoi(optarg);
break;
+ case 'T':
+ msg_timeout_ms = atoi(optarg) * 1000;
+ break;
#ifdef LIBQMI_MBIM_PROXY
case 'p':
proxy = 1;
@@ -78,7 +78,7 @@ mbim_send(void)
perror("writing data failed: ");
} else {
expected = le32toh(hdr->type) | 0x80000000;
- uloop_timeout_set(&tout, 15000);
+ uloop_timeout_set(&tout, msg_timeout_ms);
}
return ret;
}
@@ -20,6 +20,7 @@
extern int return_code;
extern int verbose;
+extern int msg_timeout_ms;
#include "mbim-type.h"
#include "mbim-enum.h"
Some modems, depending on their state and connection quality can take longer than 15 seconds to answer mbim message requests. This commit adds the -T option, allowing the user to specifiy a custom message timeout in seconds. Default is still 15. Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com> --- cli.c | 9 +++++++-- mbim-dev.c | 2 +- mbim.h | 1 + 3 files changed, 9 insertions(+), 3 deletions(-)