- Use unified error handling mechanism in send_cmd2 functions
- Always return RIG_OK to prevent WSJT-X errors
- Update cache with requested values even when communication fails
- Use English comments and debug messages
- Ensure graceful degradation with cached values on protocol/timeout errors
- Remove duplicate function declarations in pmr171_send
- Remove duplicate code blocks in pmr171_set_mode
- Remove duplicate pmr171_send calls in pmr171_set_ptt
- Add missing from_be function implementation
- Fix syntax errors that were causing CI failures
- Add graceful degradation for communication errors
- Return cached values instead of error codes on failures
- Implement unified response validation functions
- Add cache return macros for consistent error handling
- Maintain backward compatibility while improving stability
This change ensures WSJT-X and similar applications continue working
even when temporary communication issues occur with GUOHETEC radios.
Fixes: WSJT-X compatibility issues with PMR-171 and Q900 drivers
As reported by Steve, VK3SIR on the mailing list:
On compilation, through a fully up-to-date MinGW64/MSYS2 environment, we receive the following warnings:
....
make[3]: Entering directory '/home/sir/src/hamlib/build/src'
CC rig.lo
../../src/src/rig.c: In function 'rig_init':
../../src/src/rig.c:624:45: warning: unknown conversion type character 'z' in format [-Wformat=]
624 | rig_debug(RIG_DEBUG_TRACE, "Requesting %zd bytes for rig_struct\n", needed);
| ^
../../src/src/rig.c:624:32: warning: too many arguments for format [-Wformat-extra-args]
624 | rig_debug(RIG_DEBUG_TRACE, "Requesting %zd bytes for rig_struct\n", needed);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/src/rig.c:657:45: warning: unknown conversion type character 'z' in format [-Wformat=]
657 | rig_debug(RIG_DEBUG_TRACE, "Requesting %zd bytes for rig_cache\n", needed);
| ^
../../src/src/rig.c:657:32: warning: too many arguments for format [-Wformat-extra-args]
657 | rig_debug(RIG_DEBUG_TRACE, "Requesting %zd bytes for rig_cache\n", needed);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC serial.lo
....
The '%z' modifier is also found in rigs/icom/icom.c but with a 'u'
conversion specifier. Turns out that since 'needed' in this function is
of type 'size_t' which is an unsigned integer so the 'u' is required.
Icom has two confusing ways to set/get CW Pitch. The first way is to read/write the knob setting using CI-V command 14 subcommand 9. The second way is just to set/get the actual value via mode command 10.
At some point the commands in hamlib changed from the former to the latter, but never adjusted the interpolation code of the former.
This commit fixes the set and get routines appropriately.
Ref issue#1775 (part 1)
Corrected mapping of D_AGC values to currently enumerated AGC set. Will separately provide alternate mapping, if required, in backends that require it.