Wykres commitów

1502 Commity (master)

Autor SHA1 Wiadomość Data
Daniele Forsi IU5HKX 901682ba30 [rigctl] Use "fout" for consistency
This makes no difference in the current code, but other usages
of dumpconf_list() are different:
$ grep dumpconf_list *parse.c
rigctl_parse.c:        dumpconf_list(rig, stdout);
rigctl_parse.c:        dumpconf_list(rig, fout);
rotctl_parse.c:        dumpconf_list(rot, fout);
rotctl_parse.c:        dumpconf_list(rot, fout);
rotctl_parse.c:    dumpconf_list(rot, fout);
2025-09-03 20:32:09 +02:00
Nate Bargmann f15537f2e6
Merge GitHub PR #1875 2025-09-02 15:38:54 -05:00
Daniele Forsi IU5HKX e4c43821d0 Always print error messages to stderr
Do not depend on the debug level set with --verbose
2025-09-02 21:54:18 +02:00
Nate Bargmann 4c520571df
Merge GitHub PR #1876 2025-08-31 20:11:12 -05:00
George Baltz N3GB 1c0de2107c Remove conditionals based on HAVE_PTHREAD 2025-08-30 11:29:45 -04:00
Daniele Forsi IU5HKX 632746cf91 Use rig_debug() instead of sending error messages to stdout 2025-08-30 16:20:32 +02:00
Daniele Forsi IU5HKX 39e155efe7 Fix include config.h
It should be included, with its path, before any hamlib include
and before any #ifdef that uses the symbols that it defines.
2025-08-30 11:18:51 +02:00
George Baltz N3GB 002677e48c Still more pthread conditional code cleanup 2025-08-27 15:24:50 -04:00
Nate Bargmann 0a06af1dde
Merge GitHub PR #1867 2025-08-24 17:22:57 -05:00
Daniele Forsi IU5HKX bc8dbca1f3 Remove duplicated rig_type[] lines 2025-08-24 20:18:30 +02:00
Daniele Forsi IU5HKX 06a2a25cb7 Remove misleading duplicated error message
The correct error message has been printed by getopt_long()
before returning.

Test cases:
$ rigmem -Q
rigmem: invalid option -- 'Q'
Unknown option '?'
Usage: rigmem [OPTION]... COMMAND... FILE
...

$ rigmem --foo
rigmem: unrecognized option '--foo'
Unknown option '?'
Usage: rigmem [OPTION]... COMMAND... FILE
...
2025-08-24 18:55:56 +02:00
Daniele Forsi IU5HKX 5ba906c9aa Document building testsecurity
At some time, the commented out line check_PROGRAMS removed by this commit was
identical to the line following it, plus testsecurity appended, then they went
out of sync.
The commented out line check_PROGRAMS added by this commit appends testsecurity
in an explicit way.
2025-08-21 09:03:59 +02:00
Daniele Forsi IU5HKX 844bd8eba8 Remove unneeded dependencies
make knows how to build an executable from a single C source file
2025-08-21 09:03:59 +02:00
Daniele Forsi IU5HKX b5db8e3200 Add conditionally generated file to .gitignore and CLEANFILES
No need to add it *conditionally* to CLEANFILES because for make
it isn't an error trying to delete a file that doesn't exist.
2025-08-21 09:03:59 +02:00
Daniele Forsi IU5HKX 1194125b3d Remove unused code, apparently copied from rotctl_parse.c and modified 2025-08-21 09:03:59 +02:00
Daniele Forsi IU5HKX 0317e64dc8 Remove double call to rig_token_lookup() and rot_token_lookup()
The needed value is already in the variable.

Test case /to check that the changes don't break the code):
tests/rigctl --set-conf=rig_pathname=test,write_delay=1,timeout=2 --show-conf Q | grep --no-group-separator -A1 -E "(rig_pathname|^write_delay|^timeout):"
tests/rotctl --set-conf=rot_pathname=test,write_delay=1,timeout=2 --show-conf Q | grep --no-group-separator -A1 -E "(rot_pathname|^write_delay|^timeout):"

The output before and after this patch is:
rig_pathname: "Path name to the device file of the rig"
        Default: /dev/rig, Value: test
write_delay: "Delay in ms between each byte sent out"
        Default: 0, Value: 1
timeout: "Timeout in ms"
        Default: 0, Value: 2
Command 'Q' not found!
rot_pathname: "Path name to the device file of the rotator"
        Default: /dev/rotator, Value: test
write_delay: "Delay in ms between each byte sent out"
        Default: 0, Value: 1
timeout: "Timeout in ms"
        Default: 0, Value: 2
2025-08-20 23:07:48 +02:00
Daniele Forsi IU5HKX cbefd0835f Do not show any debug trace messages unless requested with -vvvvv
This fixes the following commands that always printed debug messages
at the trace level:
 tests/ampctld -l >/dev/null
 tests/ampctl -h >/dev/null
 tests/rigctld -l >/dev/null
 tests/rigctltcp -l >/dev/null
 tests/rotctld -l >/dev/null
It doesn't affect other software which worked around this issue,
but changes all software to avoid regressions in future.

Test case (should print nothing in bash):
{
tests/ampctl -l -h
tests/ampctld -l -h
tests/rigctl -l -h
tests/rigctlcom -l -h
tests/rigctld -l -h
tests/rigctlsync -l -h
tests/rigctltcp -l -h
tests/rotctl -l -h
tests/rotctld -l -h
} >/dev/null
2025-08-20 17:03:32 +02:00
Daniele Forsi IU5HKX 5a001ab3aa Explicitely initialize static int verbose 2025-08-20 12:17:29 +02:00
Daniele Forsi IU5HKX ead67ec170 Replace magic number with define 2025-08-20 12:17:29 +02:00
Nate Bargmann db7219b731
Merge GitHub PR #1858 2025-08-19 20:05:20 -05:00
Nate Bargmann 285b44add6
Merge GitHub PR #1857 2025-08-19 19:50:45 -05:00
Nate Bargmann ab311ac97b
Merge GitHub PR #1852 2025-08-19 13:06:34 -05:00
Daniele Forsi IU5HKX a0fa2def82 Refactor to remove code duplication in rotctl*.c 2025-08-19 16:51:31 +02:00
Daniele Forsi IU5HKX 90ffcadfa5 Refactor to remove code duplication in ampctl*.c 2025-08-19 16:51:31 +02:00
Daniele Forsi IU5HKX 67038154db Refactor to remove code duplication in rigctl*.c 2025-08-19 16:51:31 +02:00
Daniele Forsi IU5HKX 7fce140970 Make help texts more similar 2025-08-19 16:51:19 +02:00
Nate Bargmann c15fecb865
Merge GitHub PR #1849 2025-08-19 08:16:22 -05:00
Daniele Forsi IU5HKX 6049d020a5 Fix compiler errors
Adds the needed const qualifier.

Fixes:
rigmatrix.c:699:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
rigmatrix.c:706:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
rigmatrix.c:728:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
rigmatrix.c:762:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
rigmatrix.c:771:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
rigmatrix.c:805:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
rigmatrix.c:814:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
rigmatrix.c:848:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
rigmatrix.c:857:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
rigmatrix.c:891:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
2025-08-19 10:36:25 +02:00
Nate Bargmann 3fa91c8771
Document fixing MinGW warnings and linker error
This commit has been left as documentation should these files be moved
to /doc or some such.  However, never of these files are built or
distributed.

----------------

From example.c the following warning was generated by MinGW:

  CC       example.o
example.c: In function ‘main’:
example.c:93:32: warning: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘rmode_t’ {aka ‘long long unsigned int’} [-Wformat=]
   93 |     printf("Current mode = 0x%lX = %s, width = %ld\n", mode, rig_strrmode(mode),
      |                              ~~^                       ~~~~
      |                                |                       |
      |                                long unsigned int       rmode_t {aka long long unsigned int}
      |                              %llX

The 'l' was added as suggested to the format specifier but that resulted
in the following warning from Linux:

  CC       example.o
../../hamlib/tests/example.c:93:57: warning: format specifies type 'unsigned long long' but the argument has type 'rmode_t' (aka 'unsigned long') [-Wformat]
    printf("Current mode = 0x%llX = %s, width = %ld\n", mode, rig_strrmode(mode),
                             ~~~~                       ^~~~
                             %lX
  CC       rigctl-dumpcaps.o
1 warning generated.

So casting `mode` to `unsigned long long` quelled both warnings!

From testsecurity.c came this warning:

  CC       testsecurity-testsecurity.o
In file included from ../include/hamlib/rig.h:49,
                 from ../src/misc.h:26,
                 from testsecurity.c:29:
/usr/share/mingw-w64/include/winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h [-Wcpp]
   15 | #warning Please include winsock2.h before windows.h
      |  ^~~~~~~

Apparently winsock2.h being included through misc.h didn't work.

Finally, the Mingw linker gave the following error:

 CCLD     testsecurity.exe
/usr/bin/x86_64-w64-mingw32-ld: testsecurity-testsecurity.o: in function `main':
/home/nate/builds/hamlib-4.7~git/tests/testsecurity.c:97:(.text.startup+0x87): undefined reference to `AESStringCrypt'
/usr/bin/x86_64-w64-mingw32-ld: /home/nate/builds/hamlib-4.7~git/tests/testsecurity.c:116:(.text.startup+0x128): undefined reference to `AESStringDecrypt'
collect2: error: ld returned 1 exit status

Specifcally add the libsecurity.la file path as a specific library.
Even though the libhamlib.la seems to have the AESStringCrypt symbol
already.
2025-08-18 17:24:08 -05:00
Daniele Forsi IU5HKX 73a967e569
Remove the remaining files of the DejaGnu tests
The tests were disabled in commit cb1732fc2a.
2025-08-18 17:17:32 -05:00
Daniele Forsi IU5HKX c91c3feac0
[tests] Make testnet.c build 2025-08-18 09:02:09 -05:00
Daniele Forsi IU5HKX edda52b40e
[tests] Fix search path for includes 2025-08-18 09:02:08 -05:00
Daniele Forsi IU5HKX dadd6e1495
[tests] Set return codes in case of success/failure of the tests 2025-08-18 09:02:08 -05:00
Daniele Forsi IU5HKX 014b34e674
[tests] Convert line endings from CR LF to LF 2025-08-18 09:02:08 -05:00
Daniele Forsi IU5HKX 8dc20bb270
[tests] Remove non-working duplicated code
It is almost an exact copy of testrigopen 1 line different and
without includes so it's not compiling.
2025-08-18 09:02:07 -05:00
Daniele Forsi IU5HKX 26412650a6
[tests] Add other existing test scripts
Adds: amptest.sh and testcaps.sh
Doesn't add cachetest.sh because it needs 2 instances of rigctld running.
2025-08-18 09:02:07 -05:00
Daniele Forsi IU5HKX d4eee93c85
[tests] Add missing files to EXTRA_DIST 2025-08-18 09:02:07 -05:00
Daniele Forsi IU5HKX 53e27d6e88
[tests] Split and sort the list of EXTRA_DIST files 2025-08-18 09:02:07 -05:00
Daniele Forsi IU5HKX 3c7b3dafcf
Read the frequency just set and fix typos
Since ampctl is using the dummy driver, the status is reset at
every run and it can't read the value set during the previous run.
2025-08-18 07:47:14 -05:00
Daniele Forsi IU5HKX d4444d2247
Modifiy amptest.sh to run ampctl from the build directory 2025-08-18 07:47:13 -05:00
Daniele Forsi IU5HKX 3c214ed676
Make it easier to see what tests are missing
Sorts the list of tests.
2025-08-18 07:47:13 -05:00
Daniele Forsi IU5HKX d8b02a73e1
Add more files to tests/.gitignore 2025-08-18 07:47:13 -05:00
Daniele Forsi IU5HKX 3e43b513d6
Move list of ignored file to tests/ directory
Makes the tests/ directory more self-contained and the top-level
.gitgnore shorter.
2025-08-18 07:47:12 -05:00
Daniele Forsi IU5HKX 55f575565c Handle missing enums 2025-08-18 10:51:23 +02:00
Daniele Forsi IU5HKX 512f5f94d0 Put the switch cases in the same order as the enum
To see what is missing.
2025-08-18 10:49:53 +02:00
Daniele Forsi IU5HKX fd7d69d24c Fix output of dump_state
Fixes references to levels and properly handles strings.

Steps to reproduce:
tests/rigctl chk_vfo dump_state
2025-08-17 18:49:52 +02:00
Daniele Forsi IU5HKX caf7346fc0 Fix typos 2025-08-16 11:52:55 +02:00
Nate Bargmann ee03370cdf
Merge GitHub PR #1846 2025-08-14 08:11:27 -05:00
Daniele Forsi IU5HKX 2f2b703ccf Handle the question mark as second argument of set_parm KEYERTYPE in rigctl
Test case:
tests/rigctl -m 1 \
set_parm KEYERTYPE '?' \
set_parm BANDSELECT '?'
STRAIGHT BUG PADDLE
BANDUNUSED BAND70CM BAND33CM BAND23CM
2025-08-13 22:04:15 +02:00
Daniele Forsi IU5HKX b5b9e136a1 Do not use strcmp() when we are going to get a RIG_PARM_* define anyway 2025-08-13 20:24:22 +02:00