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

Function frameGet

simulators/simic7610.c:44–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42int dualwatch = 0;
43
44int
45frameGet(int fd, unsigned char *buf)
46{
47 int i = 0;
48 memset(buf, 0, BUFSIZE);
49 unsigned char c;
50
51 while (read(fd, &c, 1) > 0)
52 {
53 buf[i++] = c;
54 //printf("i=%d, c=0x%02x\n",i,c);
55
56 if (c == 0xfd)
57 {
58 dumphex(buf, i);
59 return i;
60 }
61
62 if (i > 2 && c == 0xfe)
63 {
64 printf("Turning power on due to 0xfe string\n");
65 powerstat = 1;
66 int j;
67
68 for (j = i; j < 175; ++j)
69 {
70 if (read(fd, &c, 1) < 0) { break; }
71 }
72
73 i = 0;
74 continue;
75 }
76 }
77
78 printf("Error %s\n", strerror(errno));
79
80 return 0;
81}
82
83void frameParse(int fd, unsigned char *frame, int len)
84{

Callers 1

mainFunction · 0.70

Calls 1

dumphexFunction · 0.85

Tested by

no test coverage detected