Update simkenwood.c

pull/1130/head
Mike Black W9MDB 2022-09-26 23:50:26 -05:00
rodzic 0b68de7b65
commit e7647de001
1 zmienionych plików z 18 dodań i 16 usunięć

Wyświetl plik

@ -10,6 +10,8 @@
#define BUFSIZE 256 #define BUFSIZE 256
int mysleep = 20;
float freqA = 14074000; float freqA = 14074000;
float freqB = 14074500; float freqB = 14074500;
int filternum = 7; int filternum = 7;
@ -114,7 +116,7 @@ int main(int argc, char *argv[])
if (strcmp(buf, "RM5;") == 0) if (strcmp(buf, "RM5;") == 0)
{ {
printf("%s\n", buf); printf("%s\n", buf);
usleep(50 * 1000); usleep(mysleep * 1000);
pbuf = "RM5100000;"; pbuf = "RM5100000;";
n = write(fd, pbuf, strlen(pbuf)); n = write(fd, pbuf, strlen(pbuf));
// printf("n=%d\n", n); // printf("n=%d\n", n);
@ -125,7 +127,7 @@ int main(int argc, char *argv[])
else if (strcmp(buf, "AN0;") == 0) else if (strcmp(buf, "AN0;") == 0)
{ {
printf("%s\n", buf); printf("%s\n", buf);
usleep(50 * 1000); usleep(mysleep * 1000);
pbuf = "AN030;"; pbuf = "AN030;";
n = write(fd, pbuf, strlen(pbuf)); n = write(fd, pbuf, strlen(pbuf));
// printf("n=%d\n", n); // printf("n=%d\n", n);
@ -136,7 +138,7 @@ int main(int argc, char *argv[])
{ {
char ifbuf[256]; char ifbuf[256];
printf("%s\n", buf); printf("%s\n", buf);
usleep(50 * 1000); usleep(mysleep * 1000);
pbuf = "IF000503130001000+0000000000030000000;"; pbuf = "IF000503130001000+0000000000030000000;";
sprintf(ifbuf, "IF%011d0001000+0000000000030000000;", freqa); sprintf(ifbuf, "IF%011d0001000+0000000000030000000;", freqa);
//pbuf = "IF00010138698 +00000000002000000 ; //pbuf = "IF00010138698 +00000000002000000 ;
@ -149,42 +151,42 @@ int main(int argc, char *argv[])
} }
else if (strcmp(buf, "NB;") == 0) else if (strcmp(buf, "NB;") == 0)
{ {
usleep(50 * 1000); usleep(mysleep * 1000);
pbuf = "NB0;"; pbuf = "NB0;";
n = write(fd, pbuf, strlen(pbuf)); n = write(fd, pbuf, strlen(pbuf));
continue; continue;
} }
else if (strcmp(buf, "RA;") == 0) else if (strcmp(buf, "RA;") == 0)
{ {
usleep(50 * 1000); usleep(mysleep * 1000);
pbuf = "RA0;"; pbuf = "RA01;";
n = write(fd, pbuf, strlen(pbuf)); n = write(fd, pbuf, strlen(pbuf));
continue; continue;
} }
else if (strcmp(buf, "RG;") == 0) else if (strcmp(buf, "RG;") == 0)
{ {
usleep(50 * 1000); usleep(mysleep * 1000);
pbuf = "RG055;"; pbuf = "RG055;";
n = write(fd, pbuf, strlen(pbuf)); n = write(fd, pbuf, strlen(pbuf));
continue; continue;
} }
else if (strcmp(buf, "MG;") == 0) else if (strcmp(buf, "MG;") == 0)
{ {
usleep(50 * 1000); usleep(mysleep * 1000);
pbuf = "MG050;"; pbuf = "MG050;";
n = write(fd, pbuf, strlen(pbuf)); n = write(fd, pbuf, strlen(pbuf));
continue; continue;
} }
else if (strcmp(buf, "AG;") == 0) else if (strcmp(buf, "AG;") == 0)
{ {
usleep(50 * 1000); usleep(mysleep * 1000);
pbuf = "AG100;"; pbuf = "AG100;";
n = write(fd, pbuf, strlen(pbuf)); n = write(fd, pbuf, strlen(pbuf));
continue; continue;
} }
else if (strcmp(buf, "FV;") == 0) else if (strcmp(buf, "FV;") == 0)
{ {
usleep(50 * 1000); usleep(mysleep * 1000);
pbuf = "FV1.2;"; pbuf = "FV1.2;";
n = write(fd, pbuf, strlen(pbuf)); n = write(fd, pbuf, strlen(pbuf));
continue; continue;
@ -216,10 +218,10 @@ int main(int argc, char *argv[])
} }
else if (strcmp(buf, "FW;") == 0) else if (strcmp(buf, "FW;") == 0)
{ {
//usleep(50 * 1000); //usleep(mysleep * 1000);
pbuf = "FW240"; pbuf = "FW240";
n = write(fd, pbuf, strlen(pbuf)); n = write(fd, pbuf, strlen(pbuf));
usleep(30*1000); usleep(20*1000);
pbuf = "0;"; pbuf = "0;";
n = write(fd, pbuf, strlen(pbuf)); n = write(fd, pbuf, strlen(pbuf));
continue; continue;
@ -231,7 +233,7 @@ int main(int argc, char *argv[])
else if (strcmp(buf, "ID;") == 0) else if (strcmp(buf, "ID;") == 0)
{ {
printf("%s\n", buf); printf("%s\n", buf);
usleep(50 * 1000); usleep(mysleep * 1000);
int id = 24; int id = 24;
SNPRINTF(buf, sizeof(buf), "ID%03d;", id); SNPRINTF(buf, sizeof(buf), "ID%03d;", id);
n = write(fd, buf, strlen(buf)); n = write(fd, buf, strlen(buf));
@ -248,7 +250,7 @@ int main(int argc, char *argv[])
if (strcmp(buf, "AI;")) if (strcmp(buf, "AI;"))
{ {
printf("%s\n", buf); printf("%s\n", buf);
usleep(50 * 1000); usleep(mysleep * 1000);
n = fprintf(fp, "%s", "AI0;"); n = fprintf(fp, "%s", "AI0;");
printf("n=%d\n", n); printf("n=%d\n", n);
@ -260,7 +262,7 @@ int main(int argc, char *argv[])
else if (strcmp(buf, "VS;") == 0) else if (strcmp(buf, "VS;") == 0)
{ {
printf("%s\n", buf); printf("%s\n", buf);
usleep(50 * 1000); usleep(mysleep * 1000);
pbuf = "VS0;"; pbuf = "VS0;";
n = write(fd, pbuf, strlen(pbuf)); n = write(fd, pbuf, strlen(pbuf));
// printf("n=%d\n", n); // printf("n=%d\n", n);
@ -274,7 +276,7 @@ int main(int argc, char *argv[])
static int ant = 0; static int ant = 0;
ant = (ant + 1) % 3; ant = (ant + 1) % 3;
printf("%s\n", buf); printf("%s\n", buf);
usleep(50 * 1000); usleep(mysleep * 1000);
SNPRINTF(buf, sizeof(buf), "EX032%1d;", ant); SNPRINTF(buf, sizeof(buf), "EX032%1d;", ant);
n = write(fd, buf, strlen(buf)); n = write(fd, buf, strlen(buf));
// printf("n=%d\n", n); // printf("n=%d\n", n);