I'm implementing several changes to support some functionality for the
IC7300. In order to minimize the review process I'm submitting this
small one separately (still working on finish the IC7300 but it's some
fairly extensive changes since ICOM has changed the protocol for several
things).
For the IC7300 turning power on requires ~150 0xfe's be sent to wake up
the rig. This causes a buffer overflow condition in icom/frame.c. This
patch increases the buffer size and ensures no overflow.
73
Mike W9MDB
This change allows the set_mode functions to leave the rig passband
unchanged if required. For the few rigs that do not have explcit
passband width control either current state is read and rewritten or a
"normal" width is chosen e.g. select a normal width when there is a
choice like CW and CW-NARROW.
Do the minimum swapping and other manipulation to determine the Tx and
VFO status when setting the split frequency and mode.
TODO - other funcitons.
The strategy to determine the current VFO at the start of a set or
query sequence of the split transmit VFO should not switch back to the
Rx VFO unless it is certain that it was current at the start of the
sequence.
This implementation reduces the number of VFO excahnges or sets to a
minimum when setting the TX VFO frequency and mode together.
This also includes a much smarter implementation of the logic used
when the new config option 'no_xchg' is enabled. Now it is able to
accurately determine the original VFO selected and leaves the
sequences with the same VFO selected. There is one corner case when
both VFOs are identical (frequency, mode and width) at the start where
it has to take a guess as to the selected originally VFO (Icom CAT
protocol has no command to elicit this information). In that case it
guesses as the last VFO selected using Hamlib. Applications can gain
absolute certainty by setting the VFO themselves prior to using the
rig_{set,get}_{split,}_{freq,mode,freq_mode}() function series. This
now gives seamless TX VFO configuration without any relay clattering
or TX/RX audio glitches.
clang warned that lvl_len could be used unitialized in a call to
rig_debug. Initialze lvl_len to 0 as its assignement is inside an if
conditional.
Also reported by Greg Troxel.
Only ask Icom rigs once then desist if bandwidth request returns
command rejected. This avoids sending the request with every mode
query and possibly retrying 'retries' times for rigs that do not
suport the '1a 03' command which wastes much time at slow baud rates.
Icom users, who use the K9JM CI-V router to protect their PW-1
amplifiers from damage due to Icom's broken CI-V protocol handling,
require a 1s delay after opening the serial port. This is due to the
router using an Arduino & Arduino USB adapter that employs a
bootloader which holds the RS-232 interface for 1s after reset (DTR
releases reset). Hamlib already has a retry and timeout mechanism
which was set to 3 and 200ms respectively for most Icom rigs. This
change increses that timeout to 1s. The increaased timeout will have
little or no impact on clients as it only comes into play if there is
a problem.
The Icom IC-7100 back end added this enum instead of using the extant
RIG_PTT_RIG enum. Also the rig_get_ptt() implementation didn't handle
it and errored out.
Note: RIG_PTT_SERIAL_CAT was added in commit
e9ee671149 - N0NB
With Icom rigs that use MAIN?SUB VFOs there is a trade off when
setting the mode or frequency of the "other" VFO. Untill now Hamlib
uses the XCHG VFO command to address the "other" VFO. This has some
advantages, particularly it preserves the selected VFO and it
preserves memory mode of either VFO. The disadvantage is that any
split command causes the Rx to glitch when the VFO/MEMs are exchanged.
I have added a config parameter for Icom rigs called "no_xchg" which
forces the direct addressing of VFOs to set split mode/frequency. It
is a boolean option with a default of "0" (false) which equates to
prior behaviour. Setting it to "1" (true) will make the backend use
change VFO commands to set the "other" VFO. This means that TX on
"SUB" in split is assumed, that both are in VFO mode (not MEM), and
set/get split functions will leave the MAIN VFO selected.
The "1A 06" command to get the data mode returns 2 bytes rather than
the one byte documented in the user manual.
Fix indexing error, collect data mode from correct reply byte.
From Martin, CT1IQI:
"Several programs under Linux rely on Hamlib for control. I wanted to
try WSJT-X (digital modes like JT65) and found that my new IC-7100 was
not yet supported, also after having compiled the current git version of
Hamlib and having compiled WSJT-X against that.
So I added a IC-7100 by taking the ic-7200 and 7420 rig files as
example, be it without going (yet) through all of the very many commands
the ic-7100 supports.
This produced the situation where there was communication, e.g. setting
and reading frequencies, but the PTT control did not work. I debugged
that to actually the lack of a PTT mode in Hamlib that uses serial and
CAT at the same time; currently PTT per 'serial' seems equivalent to
toggling certain RS232 pins but not to any serial command level. So I
added a RIG_PTT_SERIAL_CAT mode for PTT control. Now the wsjt-x program
works nicely with the ic-7100 and controls both frequency and PTT via
the single USB cable."
Signed-off-by: Nate Bargmann <n0nb@n0nb.us>
The IC-726 doesn't accept passband width sub commands with the mode
command. Well it does for CW, but not for other modes. I have disabled
the sending passband width sub commands for this rig to at least get
the mode setting commands accepted by the rig.
Fix IC-475A/E mode set command.
As with IC-726 very limited passband width sub commands with mode set
command so disabled all for now.
The Icom IC-7x6Pro models support AFSK data modes with Tx audio
delivered via the back ACC socket. This mode is enabled and queried
via a separate "0x1A06" command and applies to USB, LSB, FM and, AM as
USB-D, LSB-D, FM-D and, AM-D respectively on the radio. I have added
all but AM because hamlib has no mode enumeration for AM Data mode.
Most of the IC-7xxx rigs have an extended version of this special
command which also involves width. This needs further work to
implement.
Signed-off-by: Nate Bargmann <n0nb@n0nb.us>
The IC-756 only has two filters per mode unlike the later IC-756
variants that have three. The code was sending invalid commands
due to trying to select the third filter for certain bandwidths.
Also the default filter bandwidths were incorrect for this model.
Signed-off-by: Nate Bargmann <n0nb@n0nb.us>
Moved all backend *.h files into the SOURCES primary as Automake
documentation states all source file types should be listed. This
causes Automake to include *.h files in rebuild rules for the targets.
Removed the '-DIN_HAMLIB' assignment from the CFLAGS primary in each
backend and assigned it to AM_CPPFLAGS in configure.ac. The effect is
the same and it simplifies the backend Makefile.am files.
Removed all commented lines.