kopia lustrzana https://github.com/Hamlib/Hamlib
Astyle files
rodzic
b4150fce19
commit
c34f719337
|
@ -1071,9 +1071,11 @@ static int netrigctl_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
||||||
char buf[BUF_MAX];
|
char buf[BUF_MAX];
|
||||||
char vfostr[16] = "";
|
char vfostr[16] = "";
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s, ptt=%d, ptt_type=%d\n", __func__,
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s, ptt=%d, ptt_type=%d\n",
|
||||||
|
__func__,
|
||||||
rig_strvfo(vfo), ptt, rig->state.pttport.type.ptt);
|
rig_strvfo(vfo), ptt, rig->state.pttport.type.ptt);
|
||||||
if(rig->state.pttport.type.ptt == RIG_PTT_NONE) return RIG_OK;
|
|
||||||
|
if (rig->state.pttport.type.ptt == RIG_PTT_NONE) { return RIG_OK; }
|
||||||
|
|
||||||
ret = netrigctl_vfostr(rig, vfostr, sizeof(vfostr), RIG_VFO_A);
|
ret = netrigctl_vfostr(rig, vfostr, sizeof(vfostr), RIG_VFO_A);
|
||||||
|
|
||||||
|
|
|
@ -682,28 +682,28 @@ int icom_init(RIG *rig)
|
||||||
// we can add rigs here that will never use the 0x25 cmd
|
// we can add rigs here that will never use the 0x25 cmd
|
||||||
// some like the 751 don't even reject the command and have to time out
|
// some like the 751 don't even reject the command and have to time out
|
||||||
if (
|
if (
|
||||||
rig->caps->rig_model == RIG_MODEL_IC275
|
rig->caps->rig_model == RIG_MODEL_IC275
|
||||||
|| rig->caps->rig_model == RIG_MODEL_IC375
|
|| rig->caps->rig_model == RIG_MODEL_IC375
|
||||||
|| rig->caps->rig_model == RIG_MODEL_IC706
|
|| rig->caps->rig_model == RIG_MODEL_IC706
|
||||||
|| rig->caps->rig_model == RIG_MODEL_IC706MKII
|
|| rig->caps->rig_model == RIG_MODEL_IC706MKII
|
||||||
|| rig->caps->rig_model == RIG_MODEL_IC706MKIIG
|
|| rig->caps->rig_model == RIG_MODEL_IC706MKIIG
|
||||||
|| rig->caps->rig_model == RIG_MODEL_IC751
|
|| rig->caps->rig_model == RIG_MODEL_IC751
|
||||||
|| rig->caps->rig_model == RIG_MODEL_X5105
|
|| rig->caps->rig_model == RIG_MODEL_X5105
|
||||||
|| rig->caps->rig_model == RIG_MODEL_IC1275
|
|| rig->caps->rig_model == RIG_MODEL_IC1275
|
||||||
|| rig->caps->rig_model == RIG_MODEL_IC746
|
|| rig->caps->rig_model == RIG_MODEL_IC746
|
||||||
|| rig->caps->rig_model == RIG_MODEL_IC756
|
|| rig->caps->rig_model == RIG_MODEL_IC756
|
||||||
|| rig->caps->rig_model == RIG_MODEL_IC756PRO
|
|| rig->caps->rig_model == RIG_MODEL_IC756PRO
|
||||||
|| rig->caps->rig_model == RIG_MODEL_IC756PROII
|
|| rig->caps->rig_model == RIG_MODEL_IC756PROII
|
||||||
|| rig->caps->rig_model == RIG_MODEL_IC756PROIII
|
|| rig->caps->rig_model == RIG_MODEL_IC756PROIII
|
||||||
|| rig->caps->rig_model == RIG_MODEL_IC746PRO
|
|| rig->caps->rig_model == RIG_MODEL_IC746PRO
|
||||||
|| rig->caps->rig_model == RIG_MODEL_IC756
|
|| rig->caps->rig_model == RIG_MODEL_IC756
|
||||||
|| rig->caps->rig_model == RIG_MODEL_IC7000
|
|| rig->caps->rig_model == RIG_MODEL_IC7000
|
||||||
|| rig->caps->rig_model == RIG_MODEL_IC7100
|
|| rig->caps->rig_model == RIG_MODEL_IC7100
|
||||||
|| rig->caps->rig_model == RIG_MODEL_IC7200
|
|| rig->caps->rig_model == RIG_MODEL_IC7200
|
||||||
|| rig->caps->rig_model == RIG_MODEL_IC821H
|
|| rig->caps->rig_model == RIG_MODEL_IC821H
|
||||||
|| rig->caps->rig_model == RIG_MODEL_IC910
|
|| rig->caps->rig_model == RIG_MODEL_IC910
|
||||||
|| rig->caps->rig_model == RIG_MODEL_IC2730
|
|| rig->caps->rig_model == RIG_MODEL_IC2730
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
priv->x25cmdfails = 1;
|
priv->x25cmdfails = 1;
|
||||||
}
|
}
|
||||||
|
@ -814,7 +814,8 @@ static vfo_t icom_current_vfo_x25(RIG *rig)
|
||||||
{
|
{
|
||||||
// we can't change freqs unless rig is idle and we don't know that
|
// we can't change freqs unless rig is idle and we don't know that
|
||||||
// so we only check vfo once when freqs are equal
|
// so we only check vfo once when freqs are equal
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: vfo already determined...returning current_vfo\n",
|
rig_debug(RIG_DEBUG_TRACE,
|
||||||
|
"%s: vfo already determined...returning current_vfo\n",
|
||||||
__func__);
|
__func__);
|
||||||
return rig->state.current_vfo;
|
return rig->state.current_vfo;
|
||||||
}
|
}
|
||||||
|
@ -1882,7 +1883,8 @@ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RIG_MODEL_X108G == rig->caps->rig_model || RIG_MODEL_X5105 == rig->caps->rig_model)
|
if (RIG_MODEL_X108G == rig->caps->rig_model
|
||||||
|
|| RIG_MODEL_X5105 == rig->caps->rig_model)
|
||||||
{
|
{
|
||||||
priv->no_1a_03_cmd = ENUM_1A_03_NO;
|
priv->no_1a_03_cmd = ENUM_1A_03_NO;
|
||||||
}
|
}
|
||||||
|
@ -3455,7 +3457,8 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||||
int found = 0;
|
int found = 0;
|
||||||
|
|
||||||
for (i = 0;
|
for (i = 0;
|
||||||
i <= RIG_AGC_LAST && priv_caps->agc_levels[i].level != RIG_AGC_LAST && priv_caps->agc_levels[i].icom_level >= 0; i++)
|
i <= RIG_AGC_LAST && priv_caps->agc_levels[i].level != RIG_AGC_LAST
|
||||||
|
&& priv_caps->agc_levels[i].icom_level >= 0; i++)
|
||||||
{
|
{
|
||||||
if (priv_caps->agc_levels[i].level == val.i)
|
if (priv_caps->agc_levels[i].level == val.i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4941,6 +4941,7 @@ int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg)
|
||||||
* If answer is something else, return with error to prevent infinite loops
|
* If answer is something else, return with error to prevent infinite loops
|
||||||
*/
|
*/
|
||||||
if (!strncmp(m2, "KY0", 3)) { break; }
|
if (!strncmp(m2, "KY0", 3)) { break; }
|
||||||
|
|
||||||
if (!strncmp(m2, "KY2", 3)) { break; }
|
if (!strncmp(m2, "KY2", 3)) { break; }
|
||||||
|
|
||||||
if (!strncmp(m2, "KY1", 3)) { hl_usleep(500000); }
|
if (!strncmp(m2, "KY1", 3)) { hl_usleep(500000); }
|
||||||
|
|
|
@ -547,7 +547,8 @@ int ft747_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||||
|
|
||||||
p = (struct ft747_priv_data *)rig->state.priv;
|
p = (struct ft747_priv_data *)rig->state.priv;
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "ft747: requested freq = %"PRIfreq" Hz vfo = %s \n", freq, rig_strvfo(vfo));
|
rig_debug(RIG_DEBUG_VERBOSE,
|
||||||
|
"ft747: requested freq = %"PRIfreq" Hz vfo = %s \n", freq, rig_strvfo(vfo));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copy native cmd freq_set to private cmd storage area
|
* Copy native cmd freq_set to private cmd storage area
|
||||||
|
@ -579,12 +580,15 @@ int ft747_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||||
freq_t f;
|
freq_t f;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: called vfo=%s, freqMainA=%.0f, freqMainB=%.0f\n", __func__, rig_strvfo(vfo), rig->state.cache.freqMainA, rig->state.cache.freqMainB);
|
rig_debug(RIG_DEBUG_VERBOSE,
|
||||||
|
"%s: called vfo=%s, freqMainA=%.0f, freqMainB=%.0f\n", __func__,
|
||||||
|
rig_strvfo(vfo), rig->state.cache.freqMainA, rig->state.cache.freqMainB);
|
||||||
|
|
||||||
if (vfo == RIG_VFO_CURR) vfo = rig->state.cache.vfo;
|
if (vfo == RIG_VFO_CURR) { vfo = rig->state.cache.vfo; }
|
||||||
if (rig->state.cache.ptt == RIG_PTT_ON)
|
|
||||||
|
if (rig->state.cache.ptt == RIG_PTT_ON)
|
||||||
{
|
{
|
||||||
*freq = RIG_VFO_B? rig->state.cache.freqMainB : rig->state.cache.freqMainA;
|
*freq = RIG_VFO_B ? rig->state.cache.freqMainB : rig->state.cache.freqMainA;
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -999,7 +1003,8 @@ static int ft747_get_update_data(RIG *rig)
|
||||||
p = (struct ft747_priv_data *)rig->state.priv;
|
p = (struct ft747_priv_data *)rig->state.priv;
|
||||||
rigport = &rig->state.rigport;
|
rigport = &rig->state.rigport;
|
||||||
|
|
||||||
if (rig->state.cache.ptt == RIG_PTT_ON || !rig_check_cache_timeout(&p->status_tv, FT747_CACHE_TIMEOUT))
|
if (rig->state.cache.ptt == RIG_PTT_ON
|
||||||
|
|| !rig_check_cache_timeout(&p->status_tv, FT747_CACHE_TIMEOUT))
|
||||||
{
|
{
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -771,14 +771,15 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||||
|
|
||||||
ENTERFUNC;
|
ENTERFUNC;
|
||||||
|
|
||||||
if (newcat_60m_exception(rig, freq))
|
if (newcat_60m_exception(rig, freq))
|
||||||
{
|
{
|
||||||
// we don't try to set freq on 60m for some rigs since we must be in memory mode
|
// we don't try to set freq on 60m for some rigs since we must be in memory mode
|
||||||
// and we can't run split mode on 60M memory mode either
|
// and we can't run split mode on 60M memory mode either
|
||||||
if (rig->state.cache.split == RIG_SPLIT_ON)
|
if (rig->state.cache.split == RIG_SPLIT_ON)
|
||||||
{
|
{
|
||||||
rig_set_split_vfo(rig, RIG_VFO_A, RIG_VFO_A, RIG_SPLIT_OFF);
|
rig_set_split_vfo(rig, RIG_VFO_A, RIG_VFO_A, RIG_SPLIT_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURNFUNC(RIG_OK);
|
RETURNFUNC(RIG_OK);
|
||||||
} // we don't set freq in this case
|
} // we don't set freq in this case
|
||||||
|
|
||||||
|
@ -10382,7 +10383,7 @@ int newcat_get_cmd(RIG *rig)
|
||||||
rig_debug(RIG_DEBUG_WARN, "%s: Rig busy - retrying %d of %d: '%s'\n", __func__,
|
rig_debug(RIG_DEBUG_WARN, "%s: Rig busy - retrying %d of %d: '%s'\n", __func__,
|
||||||
retry_count, state->rigport.retry, priv->cmd_str);
|
retry_count, state->rigport.retry, priv->cmd_str);
|
||||||
// DX3000 was taking 1.6 seconds in certain command sequences
|
// DX3000 was taking 1.6 seconds in certain command sequences
|
||||||
hl_usleep(600*1000); // 600ms wait should cover most cases hopefully
|
hl_usleep(600 * 1000); // 600ms wait should cover most cases hopefully
|
||||||
|
|
||||||
rc = -RIG_ERJCTED; /* retry */
|
rc = -RIG_ERJCTED; /* retry */
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -312,7 +312,7 @@ const struct rot_caps yrc1_rot_caps =
|
||||||
ROT_MODEL(ROT_MODEL_YRC1),
|
ROT_MODEL(ROT_MODEL_YRC1),
|
||||||
.model_name = "DCU2/DCU3/YRC-1",
|
.model_name = "DCU2/DCU3/YRC-1",
|
||||||
.mfg_name = "Hy-Gain",
|
.mfg_name = "Hy-Gain",
|
||||||
.version = "20100823.2",
|
.version = "20100823.2",
|
||||||
.copyright = "LGPL",
|
.copyright = "LGPL",
|
||||||
.status = RIG_STATUS_STABLE,
|
.status = RIG_STATUS_STABLE,
|
||||||
.rot_type = ROT_TYPE_OTHER,
|
.rot_type = ROT_TYPE_OTHER,
|
||||||
|
|
|
@ -142,13 +142,14 @@ again:
|
||||||
|
|
||||||
case 0xF7: printf("READ TX STATUS\n"); break;
|
case 0xF7: printf("READ TX STATUS\n"); break;
|
||||||
|
|
||||||
case 0x03:
|
case 0x03:
|
||||||
printf("READ RX STATUS\n");
|
printf("READ RX STATUS\n");
|
||||||
buf[0] = buf[1] = buf[2] = buf[3] = 0;
|
buf[0] = buf[1] = buf[2] = buf[3] = 0;
|
||||||
buf[4] = 0x03; n = write(fd, buf, 5);
|
buf[4] = 0x03; n = write(fd, buf, 5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0xbb: buf[0] = buf[1] = 0;printf("READ EPROM\n"); n = write(fd, buf, 2);break;
|
case 0xbb: buf[0] = buf[1] = 0; printf("READ EPROM\n"); n = write(fd, buf, 2);
|
||||||
|
break;
|
||||||
|
|
||||||
default: printf("Unknown cmd=%02x\n", buf[4]);
|
default: printf("Unknown cmd=%02x\n", buf[4]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -296,13 +296,13 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
SNPRINTF(buf, sizeof(buf), "DA%d;", datamode);
|
SNPRINTF(buf, sizeof(buf), "DA%d;", datamode);
|
||||||
n = write(fd, buf, strlen(buf));
|
n = write(fd, buf, strlen(buf));
|
||||||
printf("%s\n",buf);
|
printf("%s\n", buf);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (strncmp(buf, "DA", 2) == 0)
|
else if (strncmp(buf, "DA", 2) == 0)
|
||||||
{
|
{
|
||||||
sscanf(buf, "DA%d", &datamode);
|
sscanf(buf, "DA%d", &datamode);
|
||||||
printf("%s\n",buf);
|
printf("%s\n", buf);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (strncmp(buf, "BD;", 3) == 0)
|
else if (strncmp(buf, "BD;", 3) == 0)
|
||||||
|
|
|
@ -296,7 +296,8 @@ int dumpcaps(RIG *rig, FILE *fout)
|
||||||
const struct icom_priv_caps *priv_caps =
|
const struct icom_priv_caps *priv_caps =
|
||||||
(const struct icom_priv_caps *) rig->caps->priv;
|
(const struct icom_priv_caps *) rig->caps->priv;
|
||||||
|
|
||||||
if (priv_caps && RIG_BACKEND_NUM(rig->caps->rig_model) == RIG_ICOM && priv_caps->agc_levels_present)
|
if (priv_caps && RIG_BACKEND_NUM(rig->caps->rig_model) == RIG_ICOM
|
||||||
|
&& priv_caps->agc_levels_present)
|
||||||
{
|
{
|
||||||
for (i = 0; i <= RIG_AGC_LAST && priv_caps->agc_levels[i].level != RIG_AGC_LAST
|
for (i = 0; i <= RIG_AGC_LAST && priv_caps->agc_levels[i].level != RIG_AGC_LAST
|
||||||
&& priv_caps->agc_levels[i].icom_level >= 0; i++)
|
&& priv_caps->agc_levels[i].icom_level >= 0; i++)
|
||||||
|
|
|
@ -736,7 +736,8 @@ void usage(void)
|
||||||
usage_rig(stdout);
|
usage_rig(stdout);
|
||||||
|
|
||||||
printf("\nError codes and messages\n");
|
printf("\nError codes and messages\n");
|
||||||
for(enum rig_errcode_e e = 0; e<RIG_EEND; ++e)
|
|
||||||
|
for (enum rig_errcode_e e = 0; e < RIG_EEND; ++e)
|
||||||
{
|
{
|
||||||
printf("-%d - %s", e, rigerror2(e));
|
printf("-%d - %s", e, rigerror2(e));
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue