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

Function main

simulators/simic7610.c:729–778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

727}
728
729int main(int argc, char **argv)
730{
731 unsigned char buf[BUFSIZE];
732 int fd = openPort(argv[1]);
733
734 printf("%s: %s\n", argv[0], rig_version());
735#ifdef X25
736 printf("x25/x26 command recognized\n");
737#else
738 printf("x25/x26 command rejected\n");
739#endif
740#if defined(WIN32) || defined(_WIN32)
741
742 if (argc != 2)
743 {
744 printf("Missing comport argument\n");
745 printf("%s [comport]\n", argv[0]);
746 exit(1);
747 }
748
749#endif
750
751 while (1)
752 {
753 int len = frameGet(fd, buf);
754 printf("#1 ========================================\n");
755
756 if (len <= 0)
757 {
758 printf("#2 ========================================");
759 close(fd);
760 fd = openPort(argv[1]);
761 }
762
763 if (powerstat)
764 {
765 frameParse(fd, buf, len);
766 }
767 else
768 {
769 hl_usleep(100 * 1000);
770 }
771
772 printf("#3 ========================================");
773 rigStatus();
774 printf("#3 ========================================");
775 }
776
777 return 0;
778}

Callers

nothing calls this directly

Calls 6

openPortFunction · 0.85
rig_versionFunction · 0.85
hl_usleepFunction · 0.85
frameGetFunction · 0.70
frameParseFunction · 0.70
rigStatusFunction · 0.70

Tested by

no test coverage detected