Needed to adjust one of the timeouts. Was causing issues on Windows. Also made some changes due to IF command response size being 30, it was erroring out. And last band mapping was a little different on this rig for 2m, 70cm, 4m and Air Band.
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
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
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]
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.
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.