Improve Yaesu send_morse

Can now send message 1-5 or up to 50 char msg
e.g. rigctl -m 1035 -r /dev/ttyUSB0 b 1
or
rigctl -m 1035 -r /dev/ttyUSB0 b "CQ CQ DE W9MDB"
pull/1392/head
Mike Black W9MDB 2023-09-30 16:07:07 -05:00
rodzic aeb03fda62
commit 2423fb237c
5 zmienionych plików z 68 dodań i 22 usunięć

1
NEWS
Wyświetl plik

@ -13,6 +13,7 @@ Version 5.x -- future
* Change FT1000MP Mark V model names to align with FT1000MP * Change FT1000MP Mark V model names to align with FT1000MP
Version 4.6 Version 4.6
* Yaesu rigs can now use send_morse to send keyer message 1-5 or a CW message up to 50 chars (which will use memory 1)
* rig set level METER can now take SWR,COMP,ALC,IC/ID,DB,PO,VDD,TEMP arguments to set which meter to display * rig set level METER can now take SWR,COMP,ALC,IC/ID,DB,PO,VDD,TEMP arguments to set which meter to display
* reg get level displays meter number=name now * reg get level displays meter number=name now
* Added parm BANDSELECT for Yaesu rigs * Added parm BANDSELECT for Yaesu rigs

Wyświetl plik

@ -725,9 +725,10 @@ Option returned depends on rig..for Icom is likely the RX only flag.
.BR b ", " send_morse " \(aq" \fIMorse\fP \(aq .BR b ", " send_morse " \(aq" \fIMorse\fP \(aq
Send Send
.RI \(aq Morse \(aq .RI \(aq Morse \(aq
symbols. For Yaesu rigs use memory#. symbols. For Yaesu rigs use memory#1-5 or up to 50 char msg
.EX .EX
Example from command line: rigctl -m 3073 -r /dev/ttyUSB0 b "CQ CQ DE ME" Example from command line: rigctl -m 3073 -r /dev/ttyUSB0 b "CQ CQ DE ME"
Yaesu example to send message#1: rigctl -m 1035 -r /dev/ttyUSB0 b 1
. .
.TP .TP
.BR 0xbb ", " stop_morse " .BR 0xbb ", " stop_morse "

Wyświetl plik

@ -725,9 +725,10 @@ number (\(oq0\(cq, \(oq1\(cq, \(oq2\(cq, ...).
.BR b ", " send_morse " \(aq" \fIMorse\fP \(aq .BR b ", " send_morse " \(aq" \fIMorse\fP \(aq
Send Send
.RI \(aq Morse \(aq .RI \(aq Morse \(aq
ymbols. For Yaesu rigs use memory#. symbols. For Yaesu rigs use memory# (1-5 for most rigs) or up to 50 char message (which will use memory#1)
.EX .EX
Example from rigctld socket: b CQ CQ DE ME Example from rigctld socket: b CQ CQ DE ME
Yaesu example to send message#1 frm rigctld socket: b 1
. .
.TP .TP
.BR 0xbb ", " stop_morse " .BR 0xbb ", " stop_morse "

Wyświetl plik

@ -6938,34 +6938,69 @@ int newcat_send_morse(RIG *rig, vfo_t vfo, const char *msg)
ENTERFUNC; ENTERFUNC;
int chan = 0; char chan = '1';
if (strlen(msg)==1)
if (newcat_is_rig(rig, RIG_MODEL_FT450) && strlen(msg)==1 && msg[0] > '4')
{ {
switch(*msg) // 450 manual says 1/2/3 playback needs P1=6/7/8
rig_debug(RIG_DEBUG_ERR, "%s: only messages 1-3 accepted\n", __func__);
RETURNFUNC(-RIG_EINVAL);
}
else
{
// 5-chan playback 6-A: FT-1200, FT-2000, FT-3000, FTDX-5000, FT-891, FT-9000, FT-950, FT-991, FTDX-101MP/D
// 5-chan but 1-5 playback: FT-710
if (strlen(msg)==1 && (msg[0] < '1' || msg[0] > '5'))
{ {
case 1: rig_debug(RIG_DEBUG_ERR, "%s: only messages 1-5 accepted\n", __func__);
case 2: RETURNFUNC(-RIG_EINVAL);
case 3: }
case 4: if (!newcat_is_rig(rig, RIG_MODEL_FT710))
case 5: {
chan = atoi(msg); chan += 5; // 6,7,8 needed for playback
}
}
char *msg2 = strdup(msg); // copy so we can modify it if needed
if (strlen(msg2)==1)
{
switch(*msg2)
{
// do all Yaeus rigs play back with chan+5?
case '1': msg2[0] = '6';break;
case '2': msg2[0] = '7';break;
case '3': msg2[0] = '8';break;
case '4': msg2[0] = '9';break;
case '5': msg2[0] = 'A';break;
case '6': // we'll let these pass
case '7':
case '8':
case '9':
case 'A':
case 'a':
break;
default: default:
RETURNFUNC(-RIG_EINVAL); RETURNFUNC(-RIG_EINVAL);
} }
} }
else else
{ {
RETURNFUNC(-RIG_EINVAL); if (strlen(msg2)>50) {
} msg2[50]=0; // truncate if too long
if (newcat_is_rig(rig, RIG_MODEL_FT450) && chan < 4) rig_debug(RIG_DEBUG_ERR, "%s: msg length of %d truncated to 50\n", __func__, (int)strlen(msg));
{ }
// 450 manual says 1/2/3 playback needs P1=6/7/8 chan = '1';
chan += 5; SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "KM1%s;",msg2);
} rc = newcat_set_cmd(rig);
else if (rc != RIG_OK)
{ {
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "KY%d%c", chan, cat_term); free(msg2);
RETURNFUNC(-RIG_EINVAL);
}
chan = '6'; // the channel we use to key msg 1
} }
free(msg2);
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "KY%c%c", chan, cat_term);
rc = newcat_set_cmd(rig); rc = newcat_set_cmd(rig);
RETURNFUNC(rc); RETURNFUNC(rc);
@ -10983,6 +11018,14 @@ int newcat_set_cmd_validate(RIG *rig)
{ {
strcpy(valcmd, ";"); strcpy(valcmd, ";");
} }
else if (strncmp(priv->cmd_str, "KM", 2) == 0)
{
strcpy(valcmd, "");
}
else if (strncmp(priv->cmd_str, "KY", 2) == 0)
{
strcpy(valcmd, "");
}
else else
{ {
rig_debug(RIG_DEBUG_TRACE, "%s: %s not implemented\n", __func__, priv->cmd_str); rig_debug(RIG_DEBUG_TRACE, "%s: %s not implemented\n", __func__, priv->cmd_str);

Wyświetl plik

@ -50,7 +50,7 @@
typedef char ncboolean; typedef char ncboolean;
/* shared function version */ /* shared function version */
#define NEWCAT_VER "20230927" #define NEWCAT_VER "20230930"
/* Hopefully large enough for future use, 128 chars plus '\0' */ /* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129 #define NEWCAT_DATA_LEN 129