kopia lustrzana https://github.com/Hamlib/Hamlib
Added set_vfo command for vfo/mem switching
Corrected handling of "vacant" memory channels git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1830 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.2.3
rodzic
c8a25879d0
commit
395d62ead0
32
jrc/jrc.c
32
jrc/jrc.c
|
@ -2,7 +2,7 @@
|
|||
* Hamlib JRC backend - main file
|
||||
* Copyright (c) 2001-2004 by Stephane Fillod
|
||||
*
|
||||
* $Id: jrc.c,v 1.15 2004-08-17 20:41:05 fillods Exp $
|
||||
* $Id: jrc.c,v 1.16 2004-08-31 03:47:52 fineware Exp $
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
|
@ -161,6 +161,33 @@ int jrc_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* jrc_set_vfo
|
||||
* Assumes rig!=NULL
|
||||
*/
|
||||
int jrc_set_vfo(RIG *rig, vfo_t vfo)
|
||||
{
|
||||
unsigned char cmdbuf[16];
|
||||
int cmd_len, retval;
|
||||
char vfo_function;
|
||||
|
||||
switch (vfo) {
|
||||
case RIG_VFO_VFO: vfo_function = 'F'; break;
|
||||
case RIG_VFO_MEM: vfo_function = 'C'; break;
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR,"jrc_set_vfo: unsupported VFO %d\n",
|
||||
vfo);
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
cmd_len = sprintf(cmdbuf, "%c" EOM, vfo_function);
|
||||
|
||||
retval = jrc_transaction (rig, cmdbuf, cmd_len, NULL, NULL);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* jrc_set_mode
|
||||
* Assumes rig!=NULL
|
||||
|
@ -945,7 +972,8 @@ int jrc_get_mem(RIG *rig, vfo_t vfo, int *ch)
|
|||
if (retval != RIG_OK)
|
||||
return retval;
|
||||
|
||||
if (mem_len != priv->mem_len) {
|
||||
/* need to handle vacant memories LmmmV<cr>, len = 6 */
|
||||
if ((mem_len != priv->mem_len) && (mem_len != 6)) {
|
||||
rig_debug(RIG_DEBUG_ERR,"jrc_get_mem: wrong answer %s, "
|
||||
"len=%d\n", membuf, mem_len);
|
||||
return -RIG_ERJCTED;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Hamlib JRC backend - main header
|
||||
* Copyright (c) 2001-2004 by Stephane Fillod
|
||||
*
|
||||
* $Id: jrc.h,v 1.8 2004-06-04 21:48:05 fillods Exp $
|
||||
* $Id: jrc.h,v 1.9 2004-08-31 03:47:52 fineware Exp $
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
|
@ -42,6 +42,7 @@ int jrc_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
|||
int jrc_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
int jrc_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
int jrc_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
int jrc_set_vfo(RIG *rig, vfo_t vfo);
|
||||
int jrc_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
int jrc_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
|
||||
int jrc_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Hamlib JRC backend - NRD-535 DSP description
|
||||
* Copyright (c) 2001-2004 by Stephane Fillod
|
||||
*
|
||||
* $Id: nrd535.c,v 1.8 2004-08-12 02:06:10 fineware Exp $
|
||||
* $Id: nrd535.c,v 1.9 2004-08-31 03:47:52 fineware Exp $
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
|
@ -40,7 +40,7 @@
|
|||
/* FIXME: add more from "U" command */
|
||||
#define NRD535_PARM (RIG_PARM_TIME|RIG_PARM_BEEP)
|
||||
|
||||
#define NRD535_VFO (RIG_VFO_A)
|
||||
#define NRD535_VFO (RIG_VFO_VFO|RIG_VFO_MEM)
|
||||
|
||||
/*
|
||||
* NRD-535, specs from http://mods.dk
|
||||
|
@ -187,6 +187,7 @@ const struct rig_caps nrd535_caps = {
|
|||
.get_freq = jrc_get_freq,
|
||||
.set_mode = jrc_set_mode,
|
||||
.get_mode = jrc_get_mode,
|
||||
.set_vfo = jrc_set_vfo,
|
||||
.set_func = jrc_set_func,
|
||||
.get_func = jrc_get_func,
|
||||
.set_level = jrc_set_level,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Hamlib JRC backend - NRD-545 DSP description
|
||||
* Copyright (c) 2001-2004 by Stephane Fillod
|
||||
*
|
||||
* $Id: nrd545.c,v 1.12 2004-08-12 02:05:50 fineware Exp $
|
||||
* $Id: nrd545.c,v 1.13 2004-08-31 03:47:52 fineware Exp $
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
|
@ -40,7 +40,7 @@
|
|||
/* FIXME: add more from "U" command */
|
||||
#define NRD545_PARM (RIG_PARM_TIME|RIG_PARM_BACKLIGHT|RIG_PARM_BEEP)
|
||||
|
||||
#define NRD545_VFO (RIG_VFO_A)
|
||||
#define NRD545_VFO (RIG_VFO_VFO|RIG_VFO_MEM)
|
||||
|
||||
/*
|
||||
* FIXME: measure S-meter levels
|
||||
|
@ -186,6 +186,7 @@ const struct rig_caps nrd545_caps = {
|
|||
.get_freq = jrc_get_freq,
|
||||
.set_mode = jrc_set_mode,
|
||||
.get_mode = jrc_get_mode,
|
||||
.set_vfo = jrc_set_vfo,
|
||||
.set_func = jrc_set_func,
|
||||
.get_func = jrc_get_func,
|
||||
.set_level = jrc_set_level,
|
||||
|
|
Ładowanie…
Reference in New Issue