summaryrefslogtreecommitdiffstats
path: root/sahara.c
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-07-21 20:58:35 +0200
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-07-21 20:58:48 +0200
commit06cf4fe68ad096961b4b9c653ba2bc31d270f009 (patch)
tree303e7679fbf695b4058d2de74a4bf8a2b958a39a /sahara.c
parentc9326e5fd46bb1ba986f0bcecebea6c044616656 (diff)
downloadqmi-ril-06cf4fe68ad096961b4b9c653ba2bc31d270f009.tar.gz
qmi-ril-06cf4fe68ad096961b4b9c653ba2bc31d270f009.tar.bz2
qmi-ril-06cf4fe68ad096961b4b9c653ba2bc31d270f009.zip
use static counter for hello requests
Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
Diffstat (limited to 'sahara.c')
-rw-r--r--sahara.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sahara.c b/sahara.c
index 939b58c..5862f45 100644
--- a/sahara.c
+++ b/sahara.c
@@ -399,10 +399,11 @@ int efs_sync(int tty_fd)
return 0;
}
-int handle_memory_debug(int tty_fd, int *hellos)
+int handle_memory_debug(int tty_fd)
{
struct sah_header header;
struct sah_hello_req hello_req;
+ static int i = 0;
int rc;
rc = read(tty_fd, &header, sizeof(header));
@@ -416,7 +417,7 @@ int handle_memory_debug(int tty_fd, int *hellos)
printf("received hello\n");
// Modem doesn't like it if the second hello is
// answered, so only read data and keep quiet.
- if (++(*hellos) == 2) {
+ if (++i == 2) {
rc = read_hello_data(tty_fd,
SAH_MODE_MEMORY_DEBUG,
&hello_req);