3 @@ -76,10 +76,11 @@ int tty_modem(char* send, char *receive) {
5 int l=0, in=0, out=0, timeout=10;
7 + struct timespec h = {0, 100 * 1000 * 1000};
10 while ((timeout--) > 0) {
12 + nanosleep(&h, NULL);
13 ioctl(fd_modem,TIOCMGET,&out);
14 if (out & TIOCM_CTS) {
15 l=write(fd_modem,send,strlen(send));
16 @@ -97,7 +98,7 @@ int tty_modem(char* send, char *receive) {
17 strncat(receive,tmp,in);
18 if (strchr(receive,'\r')) { break; }
20 - else { usleep(100000); }
21 + else { nanosleep(&h, NULL); }
23 if (strlen(receive) > 0 && debug > 3) { fprintf(stderr, "%s\n", receive); }