[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 028d750249ab00c8c3625
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: n0nb <n0...@us...> - 2024-12-30 12:15:11
|
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 028d750249ab00c8c362598c838b15e8aa6a2951 (commit) via ac8a8b2027983f6710f29abc170555607b4796c9 (commit) via 728d0a543290d23c4f19023f15845e1ca0e7fc3f (commit) via 601dd1361cbc897b41c989a10dca2e2bb191a112 (commit) via f2a9f091d08667db9d3fc2e842a427af7cfb990e (commit) via 028e8f38cdcbeb1165688ed75fadac5dec603245 (commit) via 1211da41d05c62797069caa63181687040db66c9 (commit) via bf7d5c322b59683ddb3cc865abf6df31bb2b5061 (commit) via 5d8593dd733253ddea9d15aacebdfb216f3b8f4a (commit) via eb7a828f5e00c42cef4b9989a44e3a8d70c5ff11 (commit) via 0ad5924050247f4a8fc4f79ed9881614c2e72817 (commit) via f173673695fe6fd535beba0d9690c936c95447d5 (commit) via 70708fdf7f388b1c80da10edc17daf53996e9ed2 (commit) via 57c145d5d15e0aab7d62e5bbcba871c9a55d05ec (commit) via f00e4f4708e3fa8f6a6976367a6264b58a1365e9 (commit) via 8edf99fc187b7b462fa297d885cda89b172bb5d3 (commit) via 9ac7f92d1ef1574bfb463d1a79ee90d0f5752312 (commit) via e0a805ebc3283eb7bd878addc4479d7f0c37e722 (commit) via 15d7242d5ad3df90088cc7e1cc49b0484db6a1a0 (commit) via 8589d5c6bc24809cae1c8cfbdab589b92641d9db (commit) via f9185d1d2469fad84aa925396606c6b752b17e49 (commit) via e262fb82c262f1b6e279e337f1642a6689256f94 (commit) via e56f8187614b2702fb584117a006a2e789ceea3f (commit) via d5dd12d50d824d4655f4c3a0e8b3cffdc464df56 (commit) via 45cc53a5265677f572f4526d750ee546bb4390c4 (commit) via 750adb40b53f89889b802bc64100ce095f114dc2 (commit) via b763761d9e307b4023e8a28d1dcbdc0116a5ff12 (commit) via d302b8fabd713cfbebd53679ad5fb685122903cc (commit) via fe45fa2dfc15f2152d6294e7457ae218df972a0f (commit) via 86518546db30c22a42c5ddc12e68434c4ed3f8ee (commit) via 13f7b01d279a14078b485b9af4e999d3d4f8f5c7 (commit) via 62b0a25a3ddab25c65de373dd6a83d812af5a9f1 (commit) via 57c5047c3ec662cd102961346ed1d4957ea88b5b (commit) via 89383a553a5e6b05779479edac2af0134cb10335 (commit) via ec3978e5210f6142f33504523168f55b4a4032ac (commit) via 2b23051c6ddb266c359ce57008d44deeab3f5bc6 (commit) via 032e530def273825892a6bfe8e4b5eef137ec529 (commit) via a7dbebffa9297d3e9afa5c356ab74bfdb2c0243d (commit) via 33293112744fc08f70811af4add9c7dd6f6533fa (commit) via 6bb5c404994308c06bdfd853642b60adb662b78f (commit) via ec7103582297545948602bc833cf1883fd94e8d8 (commit) via 8842ae7c2920799442bfda812fa56c241dfdeebd (commit) via 4b4b1b0d517403f0f460f1a255358b4f1b426e0b (commit) via e6be427c519ae3228787c728a1bdc5cc5dc31d0c (commit) via 72424ac144904dc9c70161fe70c64f8657e89758 (commit) via 12c453ccd3cbf4455d346f7d4f42fa7061bee0cb (commit) via 6cf93934a71a2ed143125a9f3b005ad38a542423 (commit) via 9624f06be96bafaafaf12fe8188d7390cf5821a2 (commit) via 0690fbc0c532f71d02ed74106191686d31cf13ea (commit) via 3d8dbbcc1ada57a8660ccc919c98f40674df4b02 (commit) via db00197e6adcddd18a810f619d38ac04c87fbd69 (commit) via 5f621c9f5327be25432d0d761204faa434afaee2 (commit) via a81c7d90c41ba6911b75d1806343b318141e6e0b (commit) via a72aa0cb4171f0039f51c2112b1f523310b66ca7 (commit) via a2af87068ea6771dc6e298b21e56ec769d6b31b0 (commit) via bef2d13e4a8443ce32bba28116398a3edf156a45 (commit) via 50e10f758223e456e1304e7b8ae8d2092d89a914 (commit) via 5028a0c440e7643c25ae459f6150c8313b223a7d (commit) via 74876c73ae45ed02b4f0ff45f317e59abb6212a1 (commit) via 27c4eb19ee32b46e4740f781d9f2470638e9f459 (commit) from 1364996bd298643a288d79edde45f7fd53cf0816 (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 028d750249ab00c8c362598c838b15e8aa6a2951 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 29 10:43:39 2024 -0600 Fix rig_list_foreach in testmW2power.c diff --git a/tests/testmW2power.c b/tests/testmW2power.c index 88c38b6ed..9e910e95c 100644 --- a/tests/testmW2power.c +++ b/tests/testmW2power.c @@ -13,7 +13,7 @@ int nrigs = 0; -int callback(struct rig_caps *caps, rig_ptr_t rigp) +int callback(const struct rig_caps *caps, rig_ptr_t rigp) { RIG *rig = (RIG *) rigp; commit ac8a8b2027983f6710f29abc170555607b4796c9 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 29 10:33:33 2024 -0600 Fix rig_list_foreach in hamlibmodels.c https://github.com/Hamlib/Hamlib/issues/1647 diff --git a/tests/hamlibmodels.c b/tests/hamlibmodels.c index 0a5e21596..a7cfac7f0 100644 --- a/tests/hamlibmodels.c +++ b/tests/hamlibmodels.c @@ -7,7 +7,7 @@ char *list[1000]; // as of 2023-01-17 we have 275 rigs so this should cover us f int nmodels = 0; -static int hash_model_list(struct rig_caps *caps, void *data) +static int hash_model_list(const struct rig_caps *caps, void *data) { char s[256]; sprintf(s, "%s %s", caps->mfg_name, caps->model_name); commit 728d0a543290d23c4f19023f15845e1ca0e7fc3f Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 29 08:56:53 2024 -0600 Fix listrigs.s rig_list_foreach https://github.com/Hamlib/Hamlib/issues/1647 diff --git a/tests/listrigs.c b/tests/listrigs.c index 65300d25f..230b1c413 100644 --- a/tests/listrigs.c +++ b/tests/listrigs.c @@ -27,7 +27,7 @@ #include <hamlib/rig.h> -int print_caps_sum(struct rig_caps *caps, void *data) +int print_caps_sum(const struct rig_caps *caps, void *data) { const char *fmt1 = "%-13s"; printf("%6u \t%-22s \t%-23s\t%-8s \t", commit 601dd1361cbc897b41c989a10dca2e2bb191a112 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 29 08:51:47 2024 -0600 Fix testrigopen.c rig_list_foreach https://github.com/Hamlib/Hamlib/issues/1647 diff --git a/tests/testrigopen.c b/tests/testrigopen.c index b98064a1e..74886e8d7 100644 --- a/tests/testrigopen.c +++ b/tests/testrigopen.c @@ -16,7 +16,7 @@ #define SERIAL_PORT "/dev/ttyUSB0" -int callback(struct rig_caps *caps, rig_ptr_t rigp) +int callback(const struct rig_caps *caps, rig_ptr_t rigp) { RIG *rig = (RIG *) rigp; commit f2a9f091d08667db9d3fc2e842a427af7cfb990e Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 29 08:42:24 2024 -0600 Change rig_list_foreach back to using const argument -- was breaking many C++ application builds https://github.com/Hamlib/Hamlib/issues/1647 diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index c15c706c9..bba2f8133 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -3791,7 +3791,7 @@ extern HAMLIB_EXPORT(int) rig_unregister HAMLIB_PARAMS((rig_model_t rig_model)); extern HAMLIB_EXPORT(int) -rig_list_foreach HAMLIB_PARAMS((int (*cfunc)(struct rig_caps *, rig_ptr_t), +rig_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rig_caps *, rig_ptr_t), rig_ptr_t data)); extern HAMLIB_EXPORT(int) diff --git a/src/register.c b/src/register.c index fcf62b03e..ef0c1f9fd 100644 --- a/src/register.c +++ b/src/register.c @@ -393,7 +393,7 @@ int HAMLIB_API rig_unregister(rig_model_t rig_model) * executes cfunc on all the elements stored in the rig hash list */ //! @cond Doxygen_Suppress -int HAMLIB_API rig_list_foreach(int (*cfunc)(struct rig_caps *, +int HAMLIB_API rig_list_foreach(int (*cfunc)(const struct rig_caps *, rig_ptr_t), rig_ptr_t data) { diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 263a7bad8..bcb10af96 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -2088,7 +2088,7 @@ int print_conf_list2(const struct confparams *cfp, rig_ptr_t data) return 1; /* !=0, we want them all ! */ } -static int hash_model_list(struct rig_caps *caps, void *data) +static int hash_model_list(const struct rig_caps *caps, void *data) { hash_add_model(caps->rig_model, caps->mfg_name, commit 028e8f38cdcbeb1165688ed75fadac5dec603245 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 28 15:59:43 2024 -0600 Improve error message when windows serial port is already in use diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index c43d15bad..c15c706c9 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -208,6 +208,7 @@ enum rig_errcode_e { RIG_ESECURITY, /*!< 19 Security error */ RIG_EPOWER, /*!< 20 Rig not powered on */ RIG_ELIMIT, /*!< 21 Limit exceeded */ + RIG_EACCESS, /*!< 22 Access denied -- e.g. port already in use */ RIG_EEND // MUST BE LAST ITEM IN LAST }; /** diff --git a/src/iofunc.c b/src/iofunc.c index 28633aec8..956d56c25 100644 --- a/src/iofunc.c +++ b/src/iofunc.c @@ -252,8 +252,13 @@ int HAMLIB_API port_open(hamlib_port_t *p) if (status < 0) { +#if defined(WIN32) +// rig_debug(RIG_DEBUG_ERR, "%s: serial_open(%s) status=%d, err=%s\n", __func__, +// p->pathname, status, rigerror(status)); +#else rig_debug(RIG_DEBUG_ERR, "%s: serial_open(%s) status=%d, err=%s\n", __func__, p->pathname, status, strerror(errno)); +#endif close_sync_data_pipe(p); return (status); } diff --git a/src/rig.c b/src/rig.c index a73a9df7e..813513293 100644 --- a/src/rig.c +++ b/src/rig.c @@ -233,7 +233,8 @@ static const char *const rigerror_table[] = "Function deprecated", "Security error password not provided or crypto failure", "Rig is not powered on", - "Limit exceeded" + "Limit exceeded", + "Access denied" }; @@ -996,7 +997,7 @@ int HAMLIB_API rig_open(RIG *rig) } else { - rig_debug(RIG_DEBUG_VERBOSE, "%s: cwd=%s\n", __func__, cwd); + //rig_debug(RIG_DEBUG_VERBOSE, "%s: cwd=%s\n", __func__, cwd); char *path = calloc(1, 8192); extern char settings_file[4096]; const char *xdgpath = getenv("XDG_CONFIG_HOME"); @@ -1016,7 +1017,7 @@ int HAMLIB_API rig_open(RIG *rig) if (fp == NULL) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: %s %s\n", __func__, path, strerror(errno)); + //rig_debug(RIG_DEBUG_VERBOSE, "%s: %s %s\n", __func__, path, strerror(errno)); } else { @@ -1169,8 +1170,7 @@ int HAMLIB_API rig_open(RIG *rig) if (status < 0) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: rs->comm_state==0?=%d\n", __func__, - rs->comm_state); + //rig_debug(RIG_DEBUG_VERBOSE, "%s: rs->comm_state==0?=%d\n", __func__, rs->comm_state); rs->comm_state = 0; rs->comm_status = RIG_COMM_STATUS_ERROR; RETURNFUNC2(status); diff --git a/src/serial.c b/src/serial.c index b580bacf9..2d6fd5a7c 100644 --- a/src/serial.c +++ b/src/serial.c @@ -126,6 +126,89 @@ int is_uh_radio_fd(int fd) } //! @endcond +#if defined(WIN32) +#include <windows.h> +#include <strsafe.h> + +void WinErrorShow(LPCTSTR lpszFunction, DWORD dw) +{ + // Retrieve the system error message for the last-error code + + LPVOID lpMsgBuf; + LPVOID lpDisplayBuf; +// DWORD dw = GetLastError(); + + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + dw, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) &lpMsgBuf, + 0, NULL); + + // Display the error message and exit the process + + lpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZEROINIT, + (lstrlen((LPCTSTR)lpMsgBuf) + lstrlen((LPCTSTR)lpszFunction) + 40) * sizeof( + TCHAR)); + StringCchPrintf((LPTSTR)lpDisplayBuf, + LocalSize(lpDisplayBuf) / sizeof(TCHAR), + TEXT("%s failed with error %d: %s"), + lpszFunction, dw, lpMsgBuf); + //MessageBox(NULL, (LPCTSTR)lpDisplayBuf, TEXT("Error"), MB_OK); + rig_debug(RIG_DEBUG_ERR, "%s: %s", __func__, (char *)lpDisplayBuf); + + LocalFree(lpMsgBuf); + LocalFree(lpDisplayBuf); +} + +enum serial_status +{ + SER_NO_EXIST, + SER_IN_USE, + SER_UNKNOWN_ERR, + SER_AVAILABLE +}; + +int check_com_port_in_use(const char *port) +{ + char device[1024]; + snprintf(device, sizeof(device), "\\\\.\\%s", port); + HANDLE hCom = CreateFileA( + device, + GENERIC_READ | GENERIC_WRITE, + 0, // No sharing + NULL, // Default security + OPEN_EXISTING, + 0, // Non-overlapped mode + NULL // No template file + ); + + if (hCom == INVALID_HANDLE_VALUE) + { + DWORD error = GetLastError(); + + if (error == ERROR_FILE_NOT_FOUND) + { + return SER_NO_EXIST; + } + else if (error == ERROR_ACCESS_DENIED) + { + return SER_IN_USE; + } + else + { + WinErrorShow("serial error on CreateFileA: ", error); + return SER_IN_USE; + } + } + CloseHandle(hCom); + + return SER_AVAILABLE; +} +#endif /** * \brief Open serial port using STATE(rig) data @@ -143,6 +226,28 @@ int HAMLIB_API serial_open(hamlib_port_t *rp) return (-RIG_EINVAL); } +#if defined(WIN32) + int retcode = check_com_port_in_use(rp->pathname); + + switch (retcode) + { + case SER_IN_USE: + rig_debug(RIG_DEBUG_ERR, "%s: serial port %s is already open\n", __func__, + rp->pathname); + return -RIG_EACCESS; + + case SER_NO_EXIST: + rig_debug(RIG_DEBUG_ERR, "%s: serial port %s does not exist\n", __func__, + rp->pathname); + return -RIG_EIO; + + case SER_AVAILABLE: + rig_debug(RIG_DEBUG_ERR, "%s: serial port %s is OK\n", __func__, rp->pathname); + break; + } + +#endif + rig_debug(RIG_DEBUG_VERBOSE, "%s: %s\n", __func__, rp->pathname); commit 1211da41d05c62797069caa63181687040db66c9 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 27 16:28:06 2024 -0600 Remove csharp for now diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 9f24dcb65..3cb9dcdd4 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -32,7 +32,7 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'cpp', 'python', 'csharp' ] + language: [ 'cpp', 'python' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] # Learn more: # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed commit bf7d5c322b59683ddb3cc865abf6df31bb2b5061 Merge: 5d8593dd7 0ad592405 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Dec 26 15:34:37 2024 -0600 Merge branch 'master' of github.com:Hamlib/Hamlib commit 5d8593dd733253ddea9d15aacebdfb216f3b8f4a Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Dec 26 15:33:20 2024 -0600 Update simic7300 and simic7000 diff --git a/simulators/simic7000.c b/simulators/simic7000.c index aa44ab0e7..ef14d0298 100644 --- a/simulators/simic7000.c +++ b/simulators/simic7000.c @@ -72,18 +72,17 @@ again: while (read(fd, &c, 1) > 0) { buf[i++] = c; - //printf("i=%d, c=0x%02x\n",i,c); + printf("i=%d, c=0x%02x\n", i, c); if (c == 0xfd) { char mytime[256]; date_strget(mytime, sizeof(mytime), 1); printf("%s:", mytime); dumphex(buf, i); + printf("\n"); // echo - n = write(fd, buf, i); - - if (n != i) { printf("%s: error on write: %s\n", __func__, strerror(errno)); } - + //n = write(fd, buf, i); + //if (n != i) { printf("%s: error on write: %s\n", __func__, strerror(errno)); } return i; } @@ -132,7 +131,7 @@ void frameParse(int fd, unsigned char *frame, int len) { case 0x03: - if (frame[5] != 0xfd) + if (frame[5] == 0xfd) { //from_bcd(frameackbuf[2], (civ_731_mode ? 4 : 5) * 2); if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) @@ -153,21 +152,21 @@ void frameParse(int fd, unsigned char *frame, int len) n = write(fd, frame, 11); dump_hex(frame, 11); } + } + else + { + if (current_vfo == RIG_VFO_A) + { + freqA = from_bcd(&frame[5], (civ_731_mode ? 4 : 5) * 2); + } else { - if (current_vfo == RIG_VFO_A) - { - freqA = from_bcd(&frame[5], (civ_731_mode ? 4 : 5) * 2); - } - else - { - freqB = from_bcd(&frame[5], (civ_731_mode ? 4 : 5) * 2); - } - - frame[4] = 0xfb; - frame[5] = 0xfd; - n = write(fd, frame, 6); + freqB = from_bcd(&frame[5], (civ_731_mode ? 4 : 5) * 2); } + + frame[4] = 0xfb; + frame[5] = 0xfd; + n = write(fd, frame, 6); } break; @@ -614,6 +613,9 @@ int main(int argc, char **argv) if (powerstat) { + unsigned char tmp = buf[2]; + buf[2] = buf[3]; + buf[3] = tmp; frameParse(fd, buf, len); } else diff --git a/simulators/simic7300.c b/simulators/simic7300.c index 797259dba..551b2108e 100644 --- a/simulators/simic7300.c +++ b/simulators/simic7300.c @@ -76,7 +76,13 @@ again: if (c == 0xfd) { - dumphex(buf, i); + char mytime[256]; + date_strget(mytime, sizeof(mytime), 1); + printf("%s:", mytime); dumphex(buf, i); + printf("\n"); + // echo + //n = write(fd, buf, i); + //if (n != i) { printf("%s: error on write: %s\n", __func__, strerror(errno)); } return i; } @@ -125,28 +131,47 @@ void frameParse(int fd, unsigned char *frame, int len) { case 0x03: - //from_bcd(frameackbuf[2], (civ_731_mode ? 4 : 5) * 2); - if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) - { - printf("get_freqA\n"); - to_bcd(&frame[5], (long long)freqA, (civ_731_mode ? 4 : 5) * 2); - } - else + if (frame[5] == 0xfd) { - printf("get_freqB\n"); - to_bcd(&frame[5], (long long)freqB, (civ_731_mode ? 4 : 5) * 2); - } + //from_bcd(frameackbuf[2], (civ_731_mode ? 4 : 5) * 2); + if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) + { + printf("get_freqA\n"); + to_bcd(&frame[5], (long long)freqA, (civ_731_mode ? 4 : 5) * 2); + } + else + { + printf("get_freqB\n"); + to_bcd(&frame[5], (long long)freqB, (civ_731_mode ? 4 : 5) * 2); + } - frame[10] = 0xfd; + frame[10] = 0xfd; + + if (powerstat) + { + dump_hex(frame, 11); + n = write(fd, frame, 11); - if (powerstat) + if (n <= 0) { fprintf(stderr, "%s(%d) write error %s\n", __func__, __LINE__, strerror(errno)); } + } + } + else { - dump_hex(frame, 11); - n = write(fd, frame, 11); + if (current_vfo == RIG_VFO_A) + { + freqA = from_bcd(&frame[5], (civ_731_mode ? 4 : 5) * 2); + } + else + { + freqB = from_bcd(&frame[5], (civ_731_mode ? 4 : 5) * 2); + } - if (n <= 0) { fprintf(stderr, "%s(%d) write error %s\n", __func__, __LINE__, strerror(errno)); } + frame[4] = 0xfb; + frame[5] = 0xfd; + n = write(fd, frame, 6); } + break; case 0x04: commit eb7a828f5e00c42cef4b9989a44e3a8d70c5ff11 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Dec 26 07:56:06 2024 -0600 Add stdarg.c as va_list requires https://github.com/Hamlib/Hamlib/issues/1644 diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 82b18e0ff..c43d15bad 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -37,6 +37,7 @@ #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) #include <stdio.h> +#include <stdarg.h> #include <string.h> #include <inttypes.h> #include <time.h> commit 0ad5924050247f4a8fc4f79ed9881614c2e72817 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Dec 26 07:56:06 2024 -0600 Add stdarg.c as va_list requires diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 82b18e0ff..c43d15bad 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -37,6 +37,7 @@ #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) #include <stdio.h> +#include <stdarg.h> #include <string.h> #include <inttypes.h> #include <time.h> commit f173673695fe6fd535beba0d9690c936c95447d5 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 25 22:59:50 2024 -0600 Update rigctl.1 man page diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index 7c0dadc8e..e8ce4e31a 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -335,7 +335,7 @@ Sets the cookie to be used for remote access security . .TP .BR \-# ", " \-\-skip_init -Skips most startup intialization. This is now automatically done when any commands are on the line. +Skips most startup intialization. . .TP .B \- commit 70708fdf7f388b1c80da10edc17daf53996e9ed2 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 25 22:53:34 2024 -0600 Update multicast.csproj to use .net 8 diff --git a/bindings/csharp/multicast/multicast.csproj b/bindings/csharp/multicast/multicast.csproj index d08b4c72a..21e08b007 100644 --- a/bindings/csharp/multicast/multicast.csproj +++ b/bindings/csharp/multicast/multicast.csproj @@ -2,7 +2,7 @@ <PropertyGroup> <OutputType>Exe</OutputType> - <TargetFramework>net7.0</TargetFramework> + <TargetFramework>net8.0</TargetFramework> </PropertyGroup> <ItemGroup> commit 57c145d5d15e0aab7d62e5bbcba871c9a55d05ec Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 25 22:43:20 2024 -0600 Remove skip_init default Was causing segfault on rigctl -m 2041 -r /dev/pts/4 M CW 250 b 73 diff --git a/tests/rigctl.c b/tests/rigctl.c index 5a40b3e11..9affbab35 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -547,7 +547,8 @@ int main(int argc, char *argv[]) if (optind < argc) { interactive = 0; - skip_init = 1; + // skip_init here caused segfault on rigctl -m 2041 -r /dev/pts/4 M CW 250 b 73 + //skip_init = 1; } else { commit f00e4f4708e3fa8f6a6976367a6264b58a1365e9 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 25 17:12:29 2024 -0600 Add csharp codeql check diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 3cb9dcdd4..9f24dcb65 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -32,7 +32,7 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'cpp', 'python' ] + language: [ 'cpp', 'python', 'csharp' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] # Learn more: # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed commit 8edf99fc187b7b462fa297d885cda89b172bb5d3 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 25 16:36:37 2024 -0600 Change skipinit so skip-init for consistency And now ignores the skip-init on the non-interactive rigctl diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index b318f3fc3..7c0dadc8e 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -334,7 +334,7 @@ and exit. Sets the cookie to be used for remote access security . .TP -.BR \-# ", " \-\-skipinit +.BR \-# ", " \-\-skip_init Skips most startup intialization. This is now automatically done when any commands are on the line. . .TP diff --git a/tests/rigctl.c b/tests/rigctl.c index 75b41a14d..5a40b3e11 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -110,7 +110,7 @@ static struct option long_options[] = {"help", 0, 0, 'h'}, {"version", 0, 0, 'V'}, {"cookie", 0, 0, '!'}, - {"skipinit", 0, 0, '#'}, + {"skip-init", 0, 0, '#'}, {0, 0, 0, 0} }; @@ -956,7 +956,7 @@ void usage(void) " -h, --help display this help and exit\n" " -V, --version output version information and exit\n" " -!, --cookie use cookie control\n" - " -#, --skipinit skips rig initialization\n\n" + " -#, --skip-init skips rig initialization\n\n" ); usage_rig(stdout); diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index ebe9df723..263a7bad8 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -915,11 +915,21 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, } } + if (strcmp(command,"skip-init")==0) + { + // no-op now since it's automatic in non-interactive mode + return(RIG_OK); + } + cmd_entry = find_cmd_entry(cmd); if (!cmd_entry) { - if (cmd != ' ') + if (cmd == 0) + { + fprintf(stderr, "Command '%s' not found!\n", command); + } + else if (cmd != ' ') { fprintf(stderr, "Command '%c' not found!\n", cmd); } commit 9ac7f92d1ef1574bfb463d1a79ee90d0f5752312 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 25 15:59:40 2024 -0600 Update some documentation diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index 9a1b6d44e..b318f3fc3 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -330,6 +330,14 @@ Show version of and exit. . .TP +.BR \-! ", " \-\-cookie +Sets the cookie to be used for remote access security +. +.TP +.BR \-# ", " \-\-skipinit +Skips most startup intialization. This is now automatically done when any commands are on the line. +. +.TP .B \- Stop option processing and read commands from standard input. .IP diff --git a/tests/rigctl.c b/tests/rigctl.c index 9d17fba44..75b41a14d 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -955,8 +955,8 @@ void usage(void) " -Z, --debug-time-stamps enable time stamps for debug messages\n" " -h, --help display this help and exit\n" " -V, --version output version information and exit\n" - " -!, --cookie use cookie control\n\n" - " -#, --skipinit skips rig initialization\n" + " -!, --cookie use cookie control\n" + " -#, --skipinit skips rig initialization\n\n" ); usage_rig(stdout); commit e0a805ebc3283eb7bd878addc4479d7f0c37e722 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Dec 24 23:19:02 2024 -0600 Make skip_init automatic when rigctl has commands on the line diff --git a/tests/rigctl.c b/tests/rigctl.c index 383c7185b..9d17fba44 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -547,6 +547,7 @@ int main(int argc, char *argv[]) if (optind < argc) { interactive = 0; + skip_init = 1; } else { ----------------------------------------------------------------------- Summary of changes: amplifiers/gemini/gemini.h | 2 +- bindings/csharp/multicast/multicast.csproj | 2 +- doc/man1/rigctl.1 | 8 + docker-build/Dockerfile | 29 +-- docker-build/README.Docker.md | 71 ++++++++ docker-build/README.docker | 13 -- include/hamlib/rig.h | 4 +- rigs/dummy/aclog.c | 4 +- rigs/dummy/flrig.c | 10 +- rigs/dummy/netrigctl.c | 2 +- rigs/dummy/tci1x.c | 2 +- rigs/dummy/trxmanager.c | 2 +- rigs/flexradio/smartsdr.c | 2 +- rigs/icom/frame.c | 11 +- rigs/icom/icom.c | 4 +- rigs/kenwood/kenwood.c | 11 +- rigs/kenwood/ts590.c | 18 +- rigs/yaesu/ft1000mp.c | 4 +- rigs/yaesu/ft991.c | 2 +- rigs/yaesu/newcat.c | 6 +- rotators/gs232a/gs232b.c | 2 +- simulators/simic7000.c | 38 ++-- simulators/simic7300.c | 57 ++++-- src/iofunc.c | 5 + src/register.c | 2 +- src/rig.c | 24 ++- src/serial.c | 105 +++++++++++ src/sprintflst.c | 278 ++++++++++++++++++++--------- tests/ampctl.c | 2 +- tests/ampctl_parse.c | 3 +- tests/ampctld.c | 2 +- tests/hamlibmodels.c | 2 +- tests/listrigs.c | 2 +- tests/rigctl.c | 10 +- tests/rigctl_parse.c | 34 ++-- tests/rigctlcom.c | 2 +- tests/rigctld.c | 2 +- tests/rigctlsync.c | 2 +- tests/rigctltcp.c | 2 +- tests/rigmem.c | 2 +- tests/rigsmtr.c | 4 +- tests/rigswr.c | 2 +- tests/rotctl.c | 2 +- tests/rotctl_parse.c | 3 +- tests/rotctld.c | 2 +- tests/testmW2power.c | 2 +- tests/testrigopen.c | 2 +- 47 files changed, 564 insertions(+), 236 deletions(-) create mode 100644 docker-build/README.Docker.md delete mode 100644 docker-build/README.docker hooks/post-receive -- Hamlib -- Ham radio control libraries |