[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. a6e280ca2ea3b49ada7d5
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: n0nb <n0...@us...> - 2025-02-11 21:16:25
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via a6e280ca2ea3b49ada7d52bfd0fabf9633a18fb2 (commit) via 88fce980df31ddf9f8b772c4584f453843841dcb (commit) via f3a932bf50b5e9edaf0ad26d8658fd2bd056a187 (commit) via eb9bf6fb841aac0575fee73c1bf97ec4b7d5b950 (commit) from c939f1a83ac1b7ad1bb903120da13f19b468e4be (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a6e280ca2ea3b49ada7d52bfd0fabf9633a18fb2 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Feb 11 10:53:21 2025 -0600 Update NEWS diff --git a/NEWS b/NEWS index d30dfad21..14d02f805 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,9 @@ Version 5.x -- future * rot_get_conf deprecated and replaced by rot_get_conf2 * Change FT1000MP Mark V model names to align with FT1000MP +Version 4.6.3 + * Fix rigctl showing hamlib_verson when connecting to rigctld + Version 4.6.2 * Add missing levels for IC746/PRO RIG_LEVEL_RFPOWER_METER,RIG_LEVEL_RFPOWER_METER_WATTS,RIG_LEVEL_SWR,RIG_LEVEL_ALC * Fix IC905 for gpredict commit 88fce980df31ddf9f8b772c4584f453843841dcb Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Feb 11 10:48:48 2025 -0600 Fix rigctld hamib_version print to suppress it Add simeasycomm.c diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 69241b448..382f5f039 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -892,7 +892,7 @@ static int netrigctl_open(RIG *rig) } else if (strcmp(setting, "hamlib_version") == 0) { - printf("rigctld: %s\n", value); + //printf("rigctld: %s\n", value); } @@ -2823,7 +2823,7 @@ struct rig_caps netrigctl_caps = RIG_MODEL(RIG_MODEL_NETRIGCTL), .model_name = "NET rigctl", .mfg_name = "Hamlib", - .version = "20240418.0", + .version = "20250211.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, diff --git a/simulators/Makefile.am b/simulators/Makefile.am index 72a556395..489484799 100644 --- a/simulators/Makefile.am +++ b/simulators/Makefile.am @@ -8,7 +8,7 @@ DISTCLEANFILES = bin_PROGRAMS = -check_PROGRAMS = simelecraft simicgeneric simkenwood simyaesu simic9100 simic9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid simft817 simts590 simft847 simic7300 simic7000 simic7100 simic7200 simatd578 simic905 simts450 simic7600 simic7610 simic705 simts950 simts990 simic7851 simftdx101 simxiegug90 simqrplabs simft818 simic275 simtrusdx simft1000 simtmd710 simts890 simxiegux108g simxiegux6100 simic910 simft450 simelecraftk4 simmicom simflex simft710 simic2730 simorion simpmr171 simic7700 simft990 simpstrotator +check_PROGRAMS = simelecraft simicgeneric simkenwood simyaesu simic9100 simic9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid simft817 simts590 simft847 simic7300 simic7000 simic7100 simic7200 simatd578 simic905 simts450 simic7600 simic7610 simic705 simts950 simts990 simic7851 simftdx101 simxiegug90 simqrplabs simft818 simic275 simtrusdx simft1000 simtmd710 simts890 simxiegux108g simxiegux6100 simic910 simft450 simelecraftk4 simmicom simflex simft710 simic2730 simorion simpmr171 simic7700 simft990 simpstrotator simeasycomm simelecraft_SOURCES = simelecraft.c simkenwood_SOURCES = simkenwood.c diff --git a/simulators/simeasycomm.c b/simulators/simeasycomm.c new file mode 100644 index 000000000..34a1430e9 --- /dev/null +++ b/simulators/simeasycomm.c @@ -0,0 +1,209 @@ +// can run this using rigctl/rigctld and socat pty devices +// gcc -o simspid simspid.c +#define _XOPEN_SOURCE 700 +// since we are POSIX here we need this +#if 0 +struct ip_mreq +{ + int dummy; +}; +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <fcntl.h> +#include <string.h> +#include <unistd.h> +#include "../include/hamlib/rig.h" + +#define BUFSIZE 256 + +static void *rotorez_thread(void *arg); + +int +getmyline(int fd, char *buf) +{ + unsigned char c = 0; + int i = 0; + int n = 0; + memset(buf, 0, BUFSIZE); + + //printf("fd=%d\n", fd); + + while (read(fd, &c, 1) > 0 && c != 0xa) + { + buf[i++] = c; + n++; + + for (int j = 0; j < strlen(buf); ++j) { printf("%02x ", buf[j]); } + + printf("\n"); + } + + if (strlen(buf) == 0) { hl_usleep(10 * 1000); } + + return n; +} + +#if defined(WIN32) || defined(_WIN32) +int openPort(char *comport) // doesn't matter for using pts devices +{ + int fd; + fd = open(comport, O_RDWR); + + if (fd < 0) + { + perror(comport); + } + + return fd; +} + +#else +int openPort(char *comport) // doesn't matter for using pts devices +{ + int fd = posix_openpt(O_RDWR); + char *name = ptsname(fd); + + if (name == NULL) + { + perror("pstname"); + return -1; + } + + printf("name=%s\n", name); + + if (fd == -1 || grantpt(fd) == -1 || unlockpt(fd) == -1) + { + perror("posix_openpt"); + return -1; + } + + return fd; +} +#endif + +int thread_args[2]; + + +int main(int argc, char *argv[]) +{ + int fd = openPort(argv[1]); + //int fd2 = openPort(argv[2]); + pthread_t threads[2]; + thread_args[0] = fd; + //thread_args[1] = fd2; + pthread_create(&threads[0], NULL, rotorez_thread, (void *)&thread_args[0]); + //pthread_create(&threads[1], NULL, rotorez_thread, (void *)&thread_args[1]); + pthread_exit(NULL); + return 0; + /* + again: + int flag = 0; + + while (1) + { + int bytes; + if (!flag) bytes = getmyline(fd, buf); + else bytes = getmyline(fd2, buf); + flag = !flag; + + if (bytes == 0) + { + //close(fd); + printf("again\n"); + goto again; + } + printf("line=%s\n", buf); + + if (strncmp(buf,"BI1",3) == 0) + { + sprintf(buf,"%3.1f;", az); + n = write(flag?fd:fd2, buf, strlen(buf)); + printf("n=%d\n", n); + } + else if (strncmp(buf,"AP1",3) == 0) + { + sscanf(buf,"AP1%f", &az); + } + else + { + printf("Unknown cmd=%s\n", buf); + } + + #if 0 + switch (buf[0]) + { + case '?': printf("Query %c\n", buf[1]); break; + + case '*': printf("Set %c\n", buf[1]); break; + + default: printf("Unknown cmd=%02x\n", buf[4]); + } + #endif + } + + return 0; + */ +} + +static void *rotorez_thread(void *arg) +{ + int n = 0; + char buf[256]; + int fd = *(int *)arg; + float az = 123; + float el = 45; +again: + + while (1) + { + int bytes; + bytes = getmyline(fd, buf); + + if (bytes == 0) + { + //close(fd); + hl_usleep(100 * 1000); + //printf("again\n"); + goto again; + } + + printf("line[%d]=%s\n", fd, buf); + + if (sscanf(buf, "AZ%g EL%g", &az, &el) == 2) + { + //n = write(fd, buf, strlen(buf)); + printf("n=%d fd=%d\n", n, fd); + } + else if (strcmp(buf,"AZ")==0) + { + sprintf(buf,"AZ%.1f\n", az); + n = write(fd, buf, strlen(buf)); + } + else if (strcmp(buf,"EL")==0) + { + sprintf(buf,"EL%.1f\n", el); + n = write(fd, buf, strlen(buf)); + } + else + { + printf("Unknown cmd=%s\n", buf); + } + +#if 0 + + switch (buf[0]) + { + case '?': printf("Query %c\n", buf[1]); break; + + case '*': printf("Set %c\n", buf[1]); break; + + default: printf("Unknown cmd=%02x\n", buf[4]); + } + +#endif + } + + pthread_exit(NULL); +} commit f3a932bf50b5e9edaf0ad26d8658fd2bd056a187 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Feb 6 22:33:54 2025 -0600 Revert "Remove setting debug in rotctl.c" This reverts commit eb9bf6fb841aac0575fee73c1bf97ec4b7d5b950. diff --git a/tests/rotctl.c b/tests/rotctl.c index 2199cede5..873c9b96e 100644 --- a/tests/rotctl.c +++ b/tests/rotctl.c @@ -310,6 +310,8 @@ int main(int argc, char *argv[]) } } + rig_set_debug(verbose); + rig_debug(RIG_DEBUG_VERBOSE, "rotctl %s\n", hamlib_version2); rig_debug(RIG_DEBUG_VERBOSE, "%s", "Report bugs to <ham...@li...>\n\n"); commit eb9bf6fb841aac0575fee73c1bf97ec4b7d5b950 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Feb 6 22:27:46 2025 -0600 Remove setting debug in rotctl.c diff --git a/tests/rotctl.c b/tests/rotctl.c index 873c9b96e..2199cede5 100644 --- a/tests/rotctl.c +++ b/tests/rotctl.c @@ -310,8 +310,6 @@ int main(int argc, char *argv[]) } } - rig_set_debug(verbose); - rig_debug(RIG_DEBUG_VERBOSE, "rotctl %s\n", hamlib_version2); rig_debug(RIG_DEBUG_VERBOSE, "%s", "Report bugs to <ham...@li...>\n\n"); ----------------------------------------------------------------------- Summary of changes: NEWS | 3 +++ rigs/dummy/netrigctl.c | 4 +-- simulators/Makefile.am | 2 +- simulators/{simrotorez.c => simeasycomm.c} | 40 +++++++++++------------------- 4 files changed, 20 insertions(+), 29 deletions(-) copy simulators/{simrotorez.c => simeasycomm.c} (82%) hooks/post-receive -- Hamlib -- Ham radio control libraries |