kopia lustrzana https://github.com/Hamlib/Hamlib
Added memory switching function in set_vfo
Added set memory channel# in radio in set_mem git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1829 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.2.3
rodzic
0045e775a3
commit
c8a25879d0
|
@ -2,7 +2,7 @@
|
||||||
* Hamlib Drake backend - main file
|
* Hamlib Drake backend - main file
|
||||||
* Copyright (c) 2001-2004 by Stephane Fillod
|
* Copyright (c) 2001-2004 by Stephane Fillod
|
||||||
*
|
*
|
||||||
* $Id: drake.c,v 1.12 2004-08-17 20:41:04 fillods Exp $
|
* $Id: drake.c,v 1.13 2004-08-31 03:45:34 fineware Exp $
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Library General Public License as
|
* it under the terms of the GNU Library General Public License as
|
||||||
|
@ -173,16 +173,21 @@ int drake_set_vfo(RIG *rig, vfo_t vfo)
|
||||||
char vfo_function;
|
char vfo_function;
|
||||||
|
|
||||||
switch (vfo) {
|
switch (vfo) {
|
||||||
case RIG_VFO_VFO:
|
|
||||||
case RIG_VFO_A : vfo_function = 'A'; break;
|
case RIG_VFO_A : vfo_function = 'A'; break;
|
||||||
case RIG_VFO_B : vfo_function = 'B'; break;
|
case RIG_VFO_B : vfo_function = 'B'; break;
|
||||||
|
case RIG_VFO_VFO: vfo_function = 'F'; break;
|
||||||
|
case RIG_VFO_MEM: vfo_function = 'C'; break;
|
||||||
default:
|
default:
|
||||||
rig_debug(RIG_DEBUG_ERR,"drake_set_vfo: unsupported VFO %d\n",
|
rig_debug(RIG_DEBUG_ERR,"drake_set_vfo: unsupported VFO %d\n",
|
||||||
vfo);
|
vfo);
|
||||||
return -RIG_EINVAL;
|
return -RIG_EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmd_len = 0;
|
||||||
|
if ((vfo_function=='A')||(vfo_function=='B'))
|
||||||
cmd_len = sprintf(cmdbuf, "V%c" EOM, vfo_function);
|
cmd_len = sprintf(cmdbuf, "V%c" EOM, vfo_function);
|
||||||
|
if ((vfo_function=='F')||(vfo_function=='C'))
|
||||||
|
cmd_len = sprintf(cmdbuf, "%c" EOM, vfo_function);
|
||||||
|
|
||||||
retval = drake_transaction (rig, cmdbuf, cmd_len, ackbuf, &ack_len);
|
retval = drake_transaction (rig, cmdbuf, cmd_len, ackbuf, &ack_len);
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -465,11 +470,20 @@ int drake_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
|
||||||
*/
|
*/
|
||||||
int drake_set_mem(RIG *rig, vfo_t vfo, int ch)
|
int drake_set_mem(RIG *rig, vfo_t vfo, int ch)
|
||||||
{
|
{
|
||||||
|
int len, ack_len, retval;
|
||||||
|
char buf[16], ackbuf[16];
|
||||||
struct drake_priv_data *priv = rig->state.priv;
|
struct drake_priv_data *priv = rig->state.priv;
|
||||||
|
|
||||||
priv->curr_ch = ch;
|
priv->curr_ch = ch;
|
||||||
|
|
||||||
return RIG_OK;
|
len = sprintf(buf, "C%03d" EOM, ch);
|
||||||
|
|
||||||
|
retval = drake_transaction (rig, buf, len, ackbuf, &ack_len);
|
||||||
|
|
||||||
|
if (ack_len != 2)
|
||||||
|
rig_debug(RIG_DEBUG_ERR,"drake_set_mem: could not set channel %03d.\n", ch);
|
||||||
|
|
||||||
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -478,6 +492,7 @@ int drake_set_mem(RIG *rig, vfo_t vfo, int ch)
|
||||||
*/
|
*/
|
||||||
int drake_get_mem(RIG *rig, vfo_t vfo, int *ch)
|
int drake_get_mem(RIG *rig, vfo_t vfo, int *ch)
|
||||||
{
|
{
|
||||||
|
struct drake_priv_data *priv = rig->state.priv;
|
||||||
int mdbuf_len, retval;
|
int mdbuf_len, retval;
|
||||||
char mdbuf[BUFSZ];
|
char mdbuf[BUFSZ];
|
||||||
int chan;
|
int chan;
|
||||||
|
@ -498,6 +513,8 @@ int drake_get_mem(RIG *rig, vfo_t vfo, int *ch)
|
||||||
sscanf(mdbuf+1, "%03d", &chan);
|
sscanf(mdbuf+1, "%03d", &chan);
|
||||||
*ch = chan;
|
*ch = chan;
|
||||||
|
|
||||||
|
priv->curr_ch = chan;
|
||||||
|
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -522,7 +539,8 @@ int drake_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
|
||||||
len = sprintf(buf,"A E B" EOM);
|
len = sprintf(buf,"A E B" EOM);
|
||||||
break;
|
break;
|
||||||
case RIG_OP_TO_VFO:
|
case RIG_OP_TO_VFO:
|
||||||
len = sprintf(buf,"C%03d" EOM, priv->curr_ch);
|
/* len = sprintf(buf,"C%03d" EOM, priv->curr_ch); */
|
||||||
|
len = sprintf(buf,"F" EOM);
|
||||||
break;
|
break;
|
||||||
case RIG_OP_MCL:
|
case RIG_OP_MCL:
|
||||||
len = sprintf(buf,"EC%03d" EOM, priv->curr_ch);
|
len = sprintf(buf,"EC%03d" EOM, priv->curr_ch);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Hamlib Drake backend - R-8A description
|
* Hamlib Drake backend - R-8A description
|
||||||
* Copyright (c) 2001-2004 by Stephane Fillod
|
* Copyright (c) 2001-2004 by Stephane Fillod
|
||||||
*
|
*
|
||||||
* $Id: r8a.c,v 1.4 2004-08-12 02:05:28 fineware Exp $
|
* $Id: r8a.c,v 1.5 2004-08-31 03:45:34 fineware Exp $
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Library General Public License as
|
* it under the terms of the GNU Library General Public License as
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
#define R8A_PARM_ALL (RIG_PARM_TIME)
|
#define R8A_PARM_ALL (RIG_PARM_TIME)
|
||||||
|
|
||||||
#define R8A_VFO (RIG_VFO_A|RIG_VFO_B)
|
#define R8A_VFO (RIG_VFO_A|RIG_VFO_B|RIG_VFO_VFO|RIG_VFO_MEM)
|
||||||
|
|
||||||
#define R8A_VFO_OPS (RIG_OP_UP|RIG_OP_DOWN|RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_MCL|RIG_OP_CPY)
|
#define R8A_VFO_OPS (RIG_OP_UP|RIG_OP_DOWN|RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_MCL|RIG_OP_CPY)
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Hamlib Drake backend - R-8B description
|
* Hamlib Drake backend - R-8B description
|
||||||
* Copyright (c) 2001-2004 by Stephane Fillod
|
* Copyright (c) 2001-2004 by Stephane Fillod
|
||||||
*
|
*
|
||||||
* $Id: r8b.c,v 1.8 2004-08-12 02:05:02 fineware Exp $
|
* $Id: r8b.c,v 1.9 2004-08-31 03:45:34 fineware Exp $
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Library General Public License as
|
* it under the terms of the GNU Library General Public License as
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
#define R8B_PARM_ALL (RIG_PARM_TIME)
|
#define R8B_PARM_ALL (RIG_PARM_TIME)
|
||||||
|
|
||||||
#define R8B_VFO (RIG_VFO_A|RIG_VFO_B)
|
#define R8B_VFO (RIG_VFO_A|RIG_VFO_B|RIG_VFO_VFO|RIG_VFO_MEM)
|
||||||
|
|
||||||
#define R8B_VFO_OPS (RIG_OP_UP|RIG_OP_DOWN|RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_MCL|RIG_OP_CPY)
|
#define R8B_VFO_OPS (RIG_OP_UP|RIG_OP_DOWN|RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_MCL|RIG_OP_CPY)
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue