kopia lustrzana https://github.com/Hamlib/Hamlib
Should fix icom power on
A little more cleanup to come https://github.com/Hamlib/Hamlib/issues/583pull/588/head
rodzic
1473793f14
commit
247c90d4b0
|
@ -115,7 +115,8 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd,
|
||||||
int frm_len, retval;
|
int frm_len, retval;
|
||||||
int ctrl_id;
|
int ctrl_id;
|
||||||
|
|
||||||
sendbuf[0] = buf[0] = 0;
|
memset(buf, 0, 200);
|
||||||
|
memset(sendbuf, 0, MAXFRAMELEN);
|
||||||
rs = &rig->state;
|
rs = &rig->state;
|
||||||
priv = (struct icom_priv_data *)rs->priv;
|
priv = (struct icom_priv_data *)rs->priv;
|
||||||
priv_caps = (struct icom_priv_caps *)rig->caps->priv;
|
priv_caps = (struct icom_priv_caps *)rig->caps->priv;
|
||||||
|
@ -132,6 +133,8 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd,
|
||||||
|
|
||||||
rig_flush(&rs->rigport);
|
rig_flush(&rs->rigport);
|
||||||
|
|
||||||
|
if (data_len) { *data_len = 0; }
|
||||||
|
|
||||||
retval = write_block(&rs->rigport, (char *) sendbuf, frm_len);
|
retval = write_block(&rs->rigport, (char *) sendbuf, frm_len);
|
||||||
|
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
|
|
|
@ -723,6 +723,9 @@ int icom_get_usb_echo_off(RIG *rig)
|
||||||
|
|
||||||
retval = icom_transaction(rig, C_RD_FREQ, -1, NULL, 0, ackbuf, &ack_len);
|
retval = icom_transaction(rig, C_RD_FREQ, -1, NULL, 0, ackbuf, &ack_len);
|
||||||
|
|
||||||
|
// if rig is not powered on we get no data and TIMEOUT
|
||||||
|
if (ack_len == 0 && retval == -RIG_ETIMEOUT) { RETURNFUNC(retval); }
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: ack_len=%d\n", __func__, ack_len);
|
rig_debug(RIG_DEBUG_VERBOSE, "%s: ack_len=%d\n", __func__, ack_len);
|
||||||
|
|
||||||
if (ack_len == 1) // then we got an echo of the cmd
|
if (ack_len == 1) // then we got an echo of the cmd
|
||||||
|
@ -736,7 +739,7 @@ int icom_get_usb_echo_off(RIG *rig)
|
||||||
}
|
}
|
||||||
|
|
||||||
rs->rigport.retry = retry_save;
|
rs->rigport.retry = retry_save;
|
||||||
RETURNFUNC(retval);
|
RETURNFUNC(priv->serial_USB_echo_off);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -646,6 +646,7 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc,
|
||||||
if (!(interactive && prompt && have_rl))
|
if (!(interactive && prompt && have_rl))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
printf("***Here1***\n");
|
||||||
if (interactive)
|
if (interactive)
|
||||||
{
|
{
|
||||||
static int last_was_ret = 1;
|
static int last_was_ret = 1;
|
||||||
|
@ -1077,12 +1078,14 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
printf("***Here2***\n");
|
||||||
|
|
||||||
#ifdef HAVE_LIBREADLINE
|
#ifdef HAVE_LIBREADLINE
|
||||||
|
|
||||||
if (interactive && prompt && have_rl)
|
if (interactive && prompt && have_rl)
|
||||||
{
|
{
|
||||||
int j, x;
|
int j, x;
|
||||||
|
printf("***Here3***\n");
|
||||||
|
|
||||||
#ifdef HAVE_READLINE_HISTORY
|
#ifdef HAVE_READLINE_HISTORY
|
||||||
/* Minimum space for 32+1+32+1+128+1+128+1+128+1 = 453 chars, so
|
/* Minimum space for 32+1+32+1+128+1+128+1+128+1 = 453 chars, so
|
||||||
|
@ -1611,6 +1614,7 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc,
|
||||||
|
|
||||||
if (!prompt)
|
if (!prompt)
|
||||||
{
|
{
|
||||||
|
printf("***Here4***\n");
|
||||||
rig_debug(RIG_DEBUG_TRACE,
|
rig_debug(RIG_DEBUG_TRACE,
|
||||||
"rigctl(d): %c '%s' '%s' '%s' '%s'\n",
|
"rigctl(d): %c '%s' '%s' '%s' '%s'\n",
|
||||||
cmd,
|
cmd,
|
||||||
|
@ -1630,6 +1634,7 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc,
|
||||||
char a2[MAXARGSZ + 2];
|
char a2[MAXARGSZ + 2];
|
||||||
char a3[MAXARGSZ + 2];
|
char a3[MAXARGSZ + 2];
|
||||||
char vfo_str[MAXARGSZ + 2];
|
char vfo_str[MAXARGSZ + 2];
|
||||||
|
printf("***Here5***\n");
|
||||||
|
|
||||||
*vfo_opt == 0 ? vfo_str[0] = '\0' : snprintf(vfo_str,
|
*vfo_opt == 0 ? vfo_str[0] = '\0' : snprintf(vfo_str,
|
||||||
sizeof(vfo_str),
|
sizeof(vfo_str),
|
||||||
|
|
Ładowanie…
Reference in New Issue