[Hamlib-developer] Problems with Icom R7000 modes
Library to control radio transceivers and receivers
Brought to you by:
n0nb
|
From: Chuck H. <n2...@am...> - 2002-03-07 00:58:39
|
I did some checking of the setting and getting of modes on the Icom R7000 and
I noticed a few problems.
---
With setting of modes:
In the r7000 part of rig2icom_mode:
if (rig->caps->rig_model == RIG_MODEL_ICR7000) {
if (mode == RIG_MODE_USB || mode == RIG_MODE_LSB) {
icmode = S_AM;
icmode_ext = 0x00;
} else if (mode == RIG_MODE_AM && icmode_ext == 0x00) {
icmode_ext = 0x01; /* default to Wide */
}
}
First, SSB mode is 05 00, or S_FM 00, not S_AM 00.
After changing all the S_AM's to S_FM's, I ran across one other problem:
icom_set_mode strips on the '00' of the '05 00'. And just sends the 05 which
puts it in FM mode.
retval = icom_transaction (rig, C_SET_MODE, icmode & 0xff, icmode_ext,
icmode_ext[0]?1:0, ackbuf, &ack_len);
Don't know how you want to fix this.
---
With the getting of modes:
In icom_get_mode, if the radio only sent one mode char, not two, icom2rig_mode
gets called with an uninitialized modebuf[2].
1. This occasionally causes errors if the initialized width is an Unsupported
Icom mode width. I reproduced this by doing a bunch of things with rigctl,
trying to get an AM mode, getting an error, restarting and having it work
fine. (I guess it happens to be 0 most of the time)
2. I didn't know how you wanted to handle the difference between:
FM: 05
SSB: 05 00
Either icom2rig_mode needs to be passed the length, or the second character
needs to be set to something. And that something can't be 0 because of #2.
---
Feel free to ask if you need traces and/or any other help in doing this. I'll
also be happy to come up with a patch if you want, but there are several ways
to fix this and I'm not sure which one you want to use.
|