Remove dependency on misc.h from sim.h

Include string.h to declare strerror
Remove rig.h from simic705.c

From first principles, none of the simulators should use *ANY* of the
code from Hamlib.  Using the same code on both sides of a simulation gives
the equivalent of a math "X = X" proof; guaranteed to work, but useless
for proving anything else.
pull/1914/head
George Baltz N3GB 2025-09-15 14:58:38 -04:00
rodzic 5f845e92cb
commit 00fb4bba71
2 zmienionych plików z 8 dodań i 8 usunięć

Wyświetl plik

@ -2,8 +2,7 @@
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include "../src/misc.h"
#include <string.h>
/* ID 0310 == 310, Must drop leading zero */
typedef enum nc_rigid_e
@ -44,7 +43,7 @@ int write_sim(int fd, const unsigned char *buf, int buflen, const char *func,
int linenum)
{
int n;
dump_hex(buf, buflen);
dumphex(buf, buflen);
n = write(fd, buf, buflen);
if (n <= 0)
@ -111,7 +110,7 @@ getmyline(int fd, char *buf)
if (c == ';') { return i; }
}
if (i == 0) { hl_usleep(10 * 1000); }
if (i == 0) { sleep(1); }
return i;
}
@ -128,13 +127,16 @@ getmyline5(int fd, unsigned char *buf)
buf[i++] = c;
}
#if 0
if (i > 0) {
printf("n=%d %02x %02x %02x %02x %02x\n", i,
buf[0], buf[1], buf[2], buf[3], buf[4]);
}
#endif
if (i == 0) {
hl_usleep(10 * 1000);
//hl_usleep(10 * 1000);
sleep(1);
}
return i;

Wyświetl plik

@ -8,7 +8,6 @@
#include <unistd.h>
#include <errno.h>
#include "hamlib/rig.h"
#include "misc.h"
#include "sim.h"
/* Simulators really shouldn't be using ANY of the definitions
@ -585,7 +584,6 @@ int main(int argc, char **argv)
unsigned char buf[BUFSIZE];
int fd = openPort(argv[1]);
printf("%s: %s\n", argv[0], rig_version());
#ifdef X25
printf("x25/x26 command recognized\n");
#else
@ -622,7 +620,7 @@ int main(int argc, char **argv)
}
else
{
hl_usleep(1000 * 1000);
sleep(1);
}
rigStatus();