MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / main

Function main

simulators/simic705.c:582–630  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

580}
581
582int main(int argc, char **argv)
583{
584 unsigned char buf[BUFSIZE];
585 int fd = openPort(argv[1]);
586
587#ifdef X25
588 printf("x25/x26 command recognized\n");
589#else
590 printf("x25/x26 command rejected\n");
591#endif
592#if defined(WIN32) || defined(_WIN32)
593
594 if (argc != 2)
595 {
596 printf("Missing comport argument\n");
597 printf("%s [comport]\n", argv[0]);
598 exit(1);
599 }
600
601#endif
602
603 while (1)
604 {
605 int len = frameGet(fd, buf);
606
607 if (len <= 0)
608 {
609 close(fd);
610 fd = openPort(argv[1]);
611 }
612
613 if (powerstat)
614 {
615 unsigned char tmp = buf[2];
616 buf[2] = buf[3];
617 buf[3] = tmp;
618
619 frameParse(fd, buf, len);
620 }
621 else
622 {
623 sleep(1);
624 }
625
626 rigStatus();
627 }
628
629 return 0;
630}

Callers

nothing calls this directly

Calls 5

openPortFunction · 0.85
sleepFunction · 0.85
frameGetFunction · 0.70
frameParseFunction · 0.70
rigStatusFunction · 0.70

Tested by

no test coverage detected