Skip to content

Commit

Permalink
increase timeout for SMS
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kress committed Aug 26, 2021
1 parent a435eea commit 935e6cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions m3_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void safefree(void **pp)
/* generic read from the cli socket
fd is needed
answer if given, the answer is written into the buffer (careful, allocated)
prompt if given, the reading of the answer stops on receipt of the prompt (and the prompt is trimmed from the ansawer)
prompt if given, the reading of the answer stops on receipt of the prompt (and the prompt is trimmed from the answer)
waittime_ms maximum amount of time (in milliseconds) to wait for an answer (use 0 to simply read and discard present data on the socket) */
bool m3_cli_read_socket(int fd, char **answer, char *prompt, int waittime_ms)
{
Expand All @@ -37,8 +37,8 @@ bool m3_cli_read_socket(int fd, char **answer, char *prompt, int waittime_ms)
tv.tv_usec = waittime_ms * 1000;
}
else {
tv.tv_sec = 0;
tv.tv_usec = 0;
tv.tv_sec = 0;
tv.tv_usec = 0;
}
ret = select(fd + 1, &read_fds, NULL, NULL, &tv);
/* on timeout always return */
Expand Down Expand Up @@ -78,7 +78,7 @@ bool m3_cli_read_socket(int fd, char **answer, char *prompt, int waittime_ms)
}
}

/* if the answer is queried, sotre it in the given buffer */
/* if the answer is queried, store it in the given buffer */
if (answer != NULL) {
*answer = calloc(1, current_size + 1);
memcpy(*answer, cli_reply, current_size);
Expand Down
2 changes: 1 addition & 1 deletion mcip-tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static bool send_sms(char *number, char *text, char *modem)
}

/* send the submit command */
if (m3_cli_query(cli, "help.debug.sms.submit=1", &cli_answer, 6000) == false) {
if (m3_cli_query(cli, "help.debug.sms.submit=1", &cli_answer, 60000) == false) {
printf("Failed to set the SMS (%d): %s\n", errno, strerror(errno));
return false;
}
Expand Down

0 comments on commit 935e6cc

Please sign in to comment.