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

Function frameGet

simulators/simic9100.c:40–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.70

Calls 1

dumphexFunction · 0.85

Tested by

no test coverage detected