Fix communication failure when pressing the "Auto" button" when using LAN connection.

merge-requests/1/merge
Teuniz 2021-05-29 11:12:53 +02:00
rodzic fdc8319f62
commit 045f749eb5
3 zmienionych plików z 11 dodań i 3 usunięć

Wyświetl plik

@ -35,7 +35,7 @@
#define PROGRAM_NAME "DSRemote" #define PROGRAM_NAME "DSRemote"
#define PROGRAM_VERSION "0.37_2105291013" #define PROGRAM_VERSION "0.37_2105291112"
#define MAX_PATHLEN 1024 #define MAX_PATHLEN 1024

Wyświetl plik

@ -79,6 +79,8 @@ void read_settings_thread::run()
char str[512]=""; char str[512]="";
struct timespec rqtp;
err_num = -1; err_num = -1;
if(device == NULL) return; if(device == NULL) return;
@ -89,7 +91,10 @@ void read_settings_thread::run()
if(delay > 0) if(delay > 0)
{ {
sleep(delay); rqtp.tv_nsec = 0;
rqtp.tv_sec = delay;
while(nanosleep(&rqtp, &rqtp)) {};
} }
for(chn=0; chn<devparms->channel_cnt; chn++) for(chn=0; chn<devparms->channel_cnt; chn++)

Wyświetl plik

@ -306,7 +306,10 @@ int tmclan_write(struct tmcdev *tmc_device __attribute__ ((unused)), const char
printf("tmc_lan write: %s", buf); printf("tmc_lan write: %s", buf);
} }
if(!strncmp(buf, "*RST", 4)) qry = 1; if((!strncmp(buf, "*RST", 4)) || (!strncmp(buf, ":AUT", 4)))
{
qry = 1;
}
n = tmclan_send(buf); n = tmclan_send(buf);