Wykres commitów

12580 Commity (master)

Autor SHA1 Wiadomość Data
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
Daniele Forsi IU5HKX 7746d59438 Implement get_agc for flrig 2.0.06+
Test case:
run: flrig configured for the rig in use
run: tests/rigctl -m 4 get_level AGC
expected: should print an enum agc_level_e (an integer in range 0..10)

Part of issue #1376.
2025-08-19 09:08:28 +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 6e3b8b223d
Remove the perl/ subdirectory
It breaks "make dist", it was deprecated in favor of SWIG in
commit 59b81dfa18 and if only
the contained some Makefiles.
2025-08-18 17:17:32 -05:00
Daniele Forsi IU5HKX e3d1ed00b7
Split and sort the list of DIST_SUBDIRS 2025-08-18 17:17:32 -05:00
Daniele Forsi IU5HKX 8f0c94dc77
[simulators] Fix compiler warning
Adds the same code used in other simulators.

Fixes:
simft897.c:26:9: warning: variable ‘n’ set but not used [-Wunused-but-set-variable]
2025-08-18 17:17:32 -05:00
Daniele Forsi IU5HKX 1aafbb3f24
[simulators] Add missing files to check_PROGRAMS 2025-08-18 17:17:31 -05:00
Daniele Forsi IU5HKX 271129705a
[simulators] Split and sort the list of check_PROGRAMS 2025-08-18 17:17:31 -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 8805748e74
[simulators] Add missing files to EXTRA_DIST 2025-08-18 09:02:06 -05:00
Daniele Forsi IU5HKX 69a9f15e3e
[security] Add missing files to EXTRA_DIST 2025-08-18 09:02:06 -05:00
Daniele Forsi IU5HKX 250d661a2a
[rigs] Remove uneeded EXTRA_DIST files 2025-08-18 09:01:36 -05:00
Daniele Forsi IU5HKX 6a83b0d054
[doc] Split and sort the list of EXTRA_DIST files 2025-08-18 08:07:16 -05:00
Daniele Forsi IU5HKX 201b4544b7
Split and sort the list of EXTRA_DIST files 2025-08-18 08:07:16 -05:00
Daniele Forsi IU5HKX 897e59ef0e
Fix comment to be relevant to the parm 2025-08-18 08:03:44 -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 b2828881b6
Make output of the TCL test less verbose
Uses the function that gets only the error message corresponding to
the argument passed.
2025-08-18 07:47:12 -05:00
Daniele Forsi IU5HKX a8a53124df freq_skip is a configuration parameter, not a command 2025-08-18 12:21:11 +02:00
Daniele Forsi IU5HKX c5668bf75a Add value 0/1 to description of set_gpio 2025-08-18 12:11:13 +02: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 b57f092236 Remove the executable bit from source files and documents 2025-08-17 22:38:25 +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 afda578d45 Fix typos
Founda by duck.ai.
2025-08-16 11:52:55 +02:00
Daniele Forsi IU5HKX 3c391a696d Fix misleading order in comment and add UNKNOWN 2025-08-16 11:52:55 +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
Nate Bargmann 98f6da8ae3
Merge GitHub PR #1845 2025-08-13 20:43:09 -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
Daniele Forsi IU5HKX fb4d2c6455 Fix segfault when using the dummy driver
Steps to reproduce:
tests/rigctl -m 1 \
get_parm KEYERTYPE

Fixes:
 Thread 1 "rigctl" received signal SIGSEGV, Segmentation fault.
 0x0000556aff4f890d in rigctl_get_parm (rig=<optimized out>, fout=0x7f87517f25c0 <_IO_2_1_stdout_>, fin=<optimized out>, interactive=1, prompt=1, vfo_opt=<optimized out>, send_cmd_term=13 '\r', ext_resp=0, resp_sep=10 '\n',
     cmd=0x556aff516050 <test_list+1520>, vfo=536870912, arg1=0x7ffc5985b5c0 "KEYERTYPE", arg2=0x556aff50cce8 "", arg3=0x556aff50cce8 "") at rigctl_parse.c:3947
 3947            if (strcmp(val.s, "0") == 0) {s = "STRAIGHT";}
 (gdb) bt
 #0  0x0000556aff4f890d in rigctl_get_parm (rig=<optimized out>, fout=0x7f87517f25c0 <_IO_2_1_stdout_>, fin=<optimized out>, interactive=1, prompt=1, vfo_opt=<optimized out>, send_cmd_term=13 '\r', ext_resp=0, resp_sep=10 '\n',
     cmd=0x556aff516050 <test_list+1520>, vfo=536870912, arg1=0x7ffc5985b5c0 "KEYERTYPE", arg2=0x556aff50cce8 "", arg3=0x556aff50cce8 "") at rigctl_parse.c:3947
 #1  0x0000556aff5007f6 in rigctl_parse (my_rig=<optimized out>, fin=<optimized out>, fout=<optimized out>, argv=argv@entry=0x7ffc5985d788, argc=argc@entry=3, sync_cb=sync_cb@entry=0x0, interactive=<optimized out>, prompt=<optimized out>,
     vfo_opt=<optimized out>, send_cmd_term=<optimized out>, ext_resp_ptr=<optimized out>, resp_sep_ptr=<optimized out>, use_password=<optimized out>) at rigctl_parse.c:1847
 #2  0x0000556aff4eaadc in main (argc=<optimized out>, argv=0x7ffc5985d788) at rigctl.c:801
2025-08-13 20:23:57 +02:00
Daniele Forsi IU5HKX 3013912111 Make get_param read back the value passed to set_param
Test case:
tests/rigctl -m 1 \
set_parm KEYERTYPE BUG get_parm KEYERTYPE \
set_parm KEYERTYPE PADDLE get_parm KEYERTYPE \
set_parm KEYERTYPE STRAIGHT get_parm KEYERTYPE
BUG
PADDLE
STRAIGHT
2025-08-13 20:17:56 +02:00
George Baltz N3GB 7549f66aa1 Replace uthash.h(1.9.4) with latest release(2.3.0)
From https://troydhanson.github.io/uthash/
Fixes diagnostics from cppcheck and -fanalyzer
2025-08-13 13:21:40 -04:00
George Baltz N3GB 053178ccbd Fix nits in serial.c
Squelch uninitialized variable from cppckeck
Remove duplicate close()s from -fanalyzer and unreachable breaks.
2025-08-13 13:03:25 -04:00
Daniele Forsi IU5HKX 12ba558343 Fix segfault with set_parm KEYERTYPE
Steps to reproduce:
tests/rigctl -m 1 \
set_parm KEYERTYPE BUG

Fixes:
 Thread 1 "rigctl" received signal SIGSEGV, Segmentation fault.
 __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-sse2.S:142
 warning: 142    ../sysdeps/x86_64/multiarch/strlen-sse2.S: File o directory non esistente
 (gdb) bt
 #0  __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-sse2.S:142
 #1  0x00007ffac346e300 in __printf_buffer (buf=buf@entry=0x7ffc3bcf40d0, format=0x7ffac38aef17 "%s", ap=0x7ffc3bcf4190, mode_flags=0) at ./stdio-common/vfprintf-process-arg.c:435
 #2  0x00007ffac3491daf in __vsnprintf_internal (string=<optimized out>, maxlen=<optimized out>, format=<optimized out>, args=args@entry=0x7ffc3bcf4190, mode_flags=mode_flags@entry=0) at ./libio/vsnprintf.c:96
 #3  0x00007ffac3469642 in __GI___snprintf (s=s@entry=0x7ffc3bcf4290 "", maxlen=maxlen@entry=32, format=format@entry=0x7ffac38aef17 "%s") at ./stdio-common/snprintf.c:31
 #4  0x00007ffac370b7b9 in dummy_set_parm (rig=0x558fe1991b20, parm=2048, val=...) at dummy.c:1704
 #5  0x0000558fb536afbe in rigctl_set_parm (rig=0x558fe1991b20, fout=0x7ffac35f25c0 <_IO_2_1_stdout_>, fin=<optimized out>, interactive=<optimized out>, prompt=<optimized out>, vfo_opt=<optimized out>, send_cmd_term=13 '\r', ext_resp=0,
     resp_sep=10 '\n', cmd=0x558fb5388000 <test_list+1440>, vfo=536870912, arg1=0x7ffc3bcf4e10 "KEYERTYPE", arg2=0x558fb537fdb1 "1", arg3=0x558fb537ece8 "") at rigctl_parse.c:3829
 #6  0x0000558fb53727d6 in rigctl_parse (my_rig=<optimized out>, fin=<optimized out>, fout=<optimized out>, argv=argv@entry=0x7ffc3bcf6fd8, argc=argc@entry=3, sync_cb=sync_cb@entry=0x0, interactive=<optimized out>, prompt=<optimized out>,
     vfo_opt=<optimized out>, send_cmd_term=<optimized out>, ext_resp_ptr=<optimized out>, resp_sep_ptr=<optimized out>, use_password=<optimized out>) at rigctl_parse.c:1847
 #7  0x0000558fb535cadc in main (argc=<optimized out>, argv=0x7ffc3bcf6fd8) at rigctl.c:801
2025-08-13 17:07:55 +02:00
Daniele Forsi IU5HKX a81aab6e11 Return an error if the keyer type is unknown
Instead of quietly doing nothing.
2025-08-13 16:58:46 +02:00
Daniele Forsi IU5HKX 762caa85c0 Remove stray char after printing value of KEYERTYPE
Steps to reproduce:
tests/rigctl -m 1 get_parm KEYERTYPE
STRAIGHT
v <-- this 'v' shouldn't be there
2025-08-13 16:58:46 +02:00