kopia lustrzana https://github.com/Hamlib/Hamlib
Merge pull request #1636 from GeoBaltz/fix24
Change Kenwood _send_morse() for TS-890/990pull/1649/head
commit
d1d4964a19
|
@ -375,6 +375,7 @@ transaction_write:
|
||||||
skip |= strncmp(cmdstr, "RD", 2) == 0;
|
skip |= strncmp(cmdstr, "RD", 2) == 0;
|
||||||
skip |= strncmp(cmdstr, "KYW", 3) == 0;
|
skip |= strncmp(cmdstr, "KYW", 3) == 0;
|
||||||
skip |= strncmp(cmdstr, "KY ", 3) == 0;
|
skip |= strncmp(cmdstr, "KY ", 3) == 0;
|
||||||
|
skip |= strncmp(cmdstr, "KY2", 3) == 0;
|
||||||
skip |= strncmp(cmdstr, "PS1", 3) == 0;
|
skip |= strncmp(cmdstr, "PS1", 3) == 0;
|
||||||
skip |= strncmp(cmdstr, "PS0", 3) == 0;
|
skip |= strncmp(cmdstr, "PS0", 3) == 0;
|
||||||
skip |= strncmp(cmdstr, "K22", 3) == 0;
|
skip |= strncmp(cmdstr, "K22", 3) == 0;
|
||||||
|
@ -382,7 +383,7 @@ transaction_write:
|
||||||
if (skip)
|
if (skip)
|
||||||
{
|
{
|
||||||
// most command we give them a little time -- but not KY
|
// most command we give them a little time -- but not KY
|
||||||
if (strncmp(cmdstr, "KY ", 3) != 0)
|
if (strncmp(cmdstr, "KY ", 3) != 0 && strncmp(cmdstr, "KY2", 3) != 0)
|
||||||
{
|
{
|
||||||
hl_usleep(200 * 1000); // give little settle time for these commands
|
hl_usleep(200 * 1000); // give little settle time for these commands
|
||||||
}
|
}
|
||||||
|
@ -958,7 +959,7 @@ int kenwood_open(RIG *rig)
|
||||||
priv->has_rit2 = 1;
|
priv->has_rit2 = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RIG_IS_TS590S)
|
if (RIG_IS_TS590S || RIG_IS_TS990S)
|
||||||
{
|
{
|
||||||
/* we need the firmware version for these rigs to deal with f/w defects */
|
/* we need the firmware version for these rigs to deal with f/w defects */
|
||||||
static char fw_version[7];
|
static char fw_version[7];
|
||||||
|
@ -992,7 +993,7 @@ int kenwood_open(RIG *rig)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: found f/w version %.1f\n", __func__,
|
rig_debug(RIG_DEBUG_TRACE, "%s: found f/w version %.2f\n", __func__,
|
||||||
priv->fw_rev_uint / 100.0);
|
priv->fw_rev_uint / 100.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5486,8 +5487,9 @@ int kenwood_reset(RIG *rig, reset_t reset)
|
||||||
int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg)
|
int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg)
|
||||||
{
|
{
|
||||||
char morsebuf[40], m2[30];
|
char morsebuf[40], m2[30];
|
||||||
int msg_len, retval, i;
|
int msg_len, retval;
|
||||||
const char *p;
|
const char *p;
|
||||||
|
struct kenwood_priv_data *priv;
|
||||||
|
|
||||||
ENTERFUNC;
|
ENTERFUNC;
|
||||||
|
|
||||||
|
@ -5551,19 +5553,29 @@ int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg)
|
||||||
SNPRINTF(morsebuf, sizeof(morsebuf), "KY %s", m2);
|
SNPRINTF(morsebuf, sizeof(morsebuf), "KY %s", m2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RIG_MODEL_TS590S:
|
case RIG_MODEL_TS890S:
|
||||||
|
SNPRINTF(morsebuf, sizeof morsebuf, "KY2%s", m2);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RIG_MODEL_TS990S:
|
||||||
|
// Variable message length only on newer firmware
|
||||||
|
priv = STATE(rig)->priv;
|
||||||
|
if (priv->fw_rev_uint >= 110)
|
||||||
|
{
|
||||||
|
SNPRINTF(morsebuf, sizeof morsebuf, "KY2%s", m2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* FALL THROUGH */
|
||||||
|
|
||||||
|
case RIG_MODEL_TS590S:
|
||||||
/* the command must consist of 28 bytes right aligned */
|
/* the command must consist of 28 bytes right aligned */
|
||||||
SNPRINTF(morsebuf, sizeof(morsebuf), "KY %24s", m2);
|
SNPRINTF(morsebuf, sizeof(morsebuf), "KY %24s", m2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/* the command must consist of 28 bytes 0x20 padded */
|
/* the command must consist of 28 bytes 0x20 padded */
|
||||||
SNPRINTF(morsebuf, sizeof(morsebuf), "KY %-24s", m2);
|
SNPRINTF(morsebuf, sizeof(morsebuf), "KY %-24s", m2);
|
||||||
|
|
||||||
for (i = strlen(morsebuf) - 1; i > 0 && morsebuf[i] == ' '; --i)
|
|
||||||
{
|
|
||||||
morsebuf[i] = 0x20;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = kenwood_transaction(rig, morsebuf, NULL, 0);
|
retval = kenwood_transaction(rig, morsebuf, NULL, 0);
|
||||||
|
|
|
@ -927,6 +927,24 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
sscanf(buf, "KS%03d", &keyspd);
|
sscanf(buf, "KS%03d", &keyspd);
|
||||||
}
|
}
|
||||||
|
else if (strncmp(buf, "KY", 2) == 0)
|
||||||
|
{ // CW Keying
|
||||||
|
if (buf[2] == ';')
|
||||||
|
{
|
||||||
|
// Checking status - we always have room
|
||||||
|
OUTPUT("KY0;");
|
||||||
|
}
|
||||||
|
else if (buf[3] == ';')
|
||||||
|
{
|
||||||
|
// Stop sending(?)
|
||||||
|
if (buf[2] != '0') {cmd_err = 1; }
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Send the message
|
||||||
|
//printf("CW mesg: %s\n", buf + 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (strncmp(buf, "OM", 2) == 0)
|
else if (strncmp(buf, "OM", 2) == 0)
|
||||||
{
|
{
|
||||||
// Operating Mode
|
// Operating Mode
|
||||||
|
|
Ładowanie…
Reference in New Issue