aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-07-01 16:36:27 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-07-01 16:36:27 +0200
commitc743e951a950b4da7f2929ebaace54cc1f7e80c0 (patch)
treed90221126010a9b5d5a385c268c4c04079864d9b
parent952668828a2bd73557672e5bc0a2177d7df04c63 (diff)
parentfda029b80d389a15328c789e17047da7e4089fdb (diff)
downloadbbs-c743e951a950b4da7f2929ebaace54cc1f7e80c0.tar.gz
Merge branch 'master' of github.com:kompetenzbolzen/bbs
-rw-r--r--src/modem.c8
-rw-r--r--src/modem.h4
2 files changed, 8 insertions, 4 deletions
diff --git a/src/modem.c b/src/modem.c
index f499c13..a5644a7 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -24,17 +24,19 @@ int modem_accept_wait(int fd)
modem_command(fd, _AT_MUTE, 1000);
modem_command(fd, _AT_RESET_ON_DTR, 1000);
-/* //DONT wait for ring
+#ifdef _MODEM_WAIT_RING //DONT wait for ring
while ( 1 ) { //wait for RING
ret = poll(&fds, 1, 2000); //poll in 2s interval
usleep(5000);
if(ret) {
cnt = read ( fd, buff, 128 );
if(strstr(buff, "RING"))
- break;
+ break;
}
}
-*/
+#else
+#warning "Wait for RING disabled"
+#endif
printf("Modem RINGING\n");
int ok = 5;
int timeout = 60000;
diff --git a/src/modem.h b/src/modem.h
index cf6e9d4..246018d 100644
--- a/src/modem.h
+++ b/src/modem.h
@@ -20,9 +20,11 @@
#define _AT_MUTE "ATM0\r\n"
#define _AT_RESET_ON_DTR "AT&D3\r\n"
+#define _MODEM_WAIT_RING
+
int modem_accept_wait(int fd);
/*
- * Waits for RING, accepts incoming calls. Return is non-zero when cennection fails.
+ * Waits for RING (ifdef _MODEM_WAIT_RING), accepts incoming calls. Return is non-zero when cennection fails.
* */
int modem_command(int fd, char* cmd, int timeout_ms);