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

Function main

simulators/simic7000.c:525–569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

523}
524
525int main(int argc, char **argv)
526{
527 unsigned char buf[BUFSIZE];
528 int fd = openPort(argv[1]);
529
530 printf("%s: %s\n", argv[0], rig_version());
531 printf("x25/x26 command rejected\n");
532#if defined(WIN32) || defined(_WIN32)
533
534 if (argc != 2)
535 {
536 printf("Missing comport argument\n");
537 printf("%s [comport]\n", argv[0]);
538 exit(1);
539 }
540
541#endif
542
543 while (1)
544 {
545 int len = frameGet(fd, buf);
546
547 if (len <= 0)
548 {
549 close(fd);
550 fd = openPort(argv[1]);
551 }
552
553 if (powerstat)
554 {
555 unsigned char tmp = buf[2];
556 buf[2] = buf[3];
557 buf[3] = tmp;
558 frameParse(fd, buf, len);
559 }
560 else
561 {
562 hl_usleep(1000 * 1000);
563 }
564
565 rigStatus();
566 }
567
568 return 0;
569}

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