kopia lustrzana https://github.com/Hamlib/Hamlib
support ANL through ext_level
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2624 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.2.9
rodzic
303b617827
commit
e9a87eda55
37
pcr/pcr.c
37
pcr/pcr.c
|
@ -3,7 +3,7 @@
|
|||
* Copyright (c) 2001-2005 by Stephane Fillod and Darren Hatcher
|
||||
* Copyright (C) 2007-09 by Alessandro Zummo <a.zummo@towertech.it>
|
||||
*
|
||||
* $Id: pcr.c,v 1.25 2009-01-29 19:50:33 azummo Exp $
|
||||
* $Id: pcr.c,v 1.26 2009-02-06 17:31:33 fillods 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
|
||||
|
@ -783,8 +783,6 @@ pcr_set_level(RIG * rig, vfo_t vfo, setting_t level, value_t val)
|
|||
{
|
||||
int err = -RIG_ENIMPL;
|
||||
|
||||
struct pcr_priv_data *priv = (struct pcr_priv_data *) rig->state.priv;
|
||||
|
||||
if (RIG_LEVEL_IS_FLOAT(level))
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: level = %d, val = %f\n",
|
||||
__func__, level, val.f);
|
||||
|
@ -947,16 +945,6 @@ pcr_set_func(RIG * rig, vfo_t vfo, setting_t func, int status)
|
|||
|
||||
break;
|
||||
|
||||
#if 0
|
||||
case RIG_FUNC_ANL: /* automatic noise limiter */
|
||||
if (status == 0)
|
||||
return pcr_set_anl(rig, 0);
|
||||
else
|
||||
return pcr_set_anl(rig, 1);
|
||||
|
||||
break;
|
||||
#endif
|
||||
|
||||
case RIG_FUNC_TSQL:
|
||||
if (priv->last_mode != MD_FM)
|
||||
return -RIG_ERJCTED;
|
||||
|
@ -967,7 +955,7 @@ pcr_set_func(RIG * rig, vfo_t vfo, setting_t func, int status)
|
|||
return pcr_set_ctcss_sql(rig, vfo, priv->last_ctcss_sql);
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: default\n");
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: default\n", __func__);
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
}
|
||||
|
@ -986,6 +974,27 @@ pcr_get_func(RIG * rig, vfo_t vfo, setting_t func, int *status)
|
|||
return -RIG_ENIMPL;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
pcr_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: tok = %s\n", __func__, token);
|
||||
|
||||
switch (token) {
|
||||
|
||||
case TOK_EL_ANL: /* automatic noise limiter */
|
||||
|
||||
return pcr_set_anl(rig, (0 == val.i) ? 0 : 1);
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: default\n", __func__);
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
||||
/* --------------------------------------------------------------------------------------- */
|
||||
/* The next functions are all "helper types". These are called by the base functions above */
|
||||
/* --------------------------------------------------------------------------------------- */
|
||||
|
|
12
pcr/pcr.h
12
pcr/pcr.h
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* Hamlib PCR backend - main header
|
||||
* Copyright (c) 2001-2003 by Stephane Fillod
|
||||
* Copyright (c) 2001-2009 by Stephane Fillod
|
||||
*
|
||||
* $Id: pcr.h,v 1.14 2009-01-29 19:50:33 azummo Exp $
|
||||
* $Id: pcr.h,v 1.15 2009-02-06 17:31:33 fillods 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
|
||||
|
@ -23,6 +23,13 @@
|
|||
#ifndef _PCR_H
|
||||
#define _PCR_H 1
|
||||
|
||||
#include "hamlib/rig.h"
|
||||
#include "token.h"
|
||||
|
||||
/* ext_level's tokens */
|
||||
#define TOK_EL_ANL TOKEN_BACKEND(1)
|
||||
|
||||
|
||||
#define BACKEND_VER "0.5"
|
||||
|
||||
#define PCR_MAX_CMD_LEN 32
|
||||
|
@ -76,6 +83,7 @@ int pcr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
|||
|
||||
int pcr_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
|
||||
int pcr_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
int pcr_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val);
|
||||
|
||||
int pcr_set_comm_rate(RIG *rig, int baud_rate);
|
||||
|
||||
|
|
17
pcr/pcr100.c
17
pcr/pcr100.c
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* Hamlib PCR backend - PCR-100 description
|
||||
* Copyright (c) 2001-2004 by Stephane Fillod
|
||||
* Copyright (c) 2001-2009 by Stephane Fillod
|
||||
*
|
||||
* $Id: pcr100.c,v 1.9 2009-01-29 19:50:33 azummo Exp $
|
||||
* $Id: pcr100.c,v 1.10 2009-02-06 17:31:33 fillods 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
|
||||
|
@ -33,12 +33,19 @@
|
|||
|
||||
#define PCR100_MODES ( RIG_MODE_AM | RIG_MODE_FM | RIG_MODE_WFM )
|
||||
|
||||
#define PCR100_FUNC ( /* RIG_FUNC_ANL | */ RIG_FUNC_TSQL )
|
||||
#define PCR100_FUNC ( RIG_FUNC_TSQL )
|
||||
|
||||
#define PCR100_LEVEL ( \
|
||||
RIG_LEVEL_ATT | RIG_LEVEL_AF | RIG_LEVEL_SQL | RIG_LEVEL_IF | \
|
||||
RIG_LEVEL_AGC | RIG_LEVEL_STRENGTH | RIG_LEVEL_RAWSTR )
|
||||
|
||||
static const struct confparams pcr_ext_levels[] = {
|
||||
{ TOK_EL_ANL, "ANL", "Auto Noise Limiter", "Auto Noise Limiter",
|
||||
NULL, RIG_CONF_CHECKBUTTON
|
||||
},
|
||||
{ RIG_CONF_END, NULL, }
|
||||
};
|
||||
|
||||
/*
|
||||
* IC PCR100 rigs capabilities.
|
||||
*/
|
||||
|
@ -144,6 +151,8 @@ const struct rig_caps pcr100_caps = {
|
|||
}
|
||||
},
|
||||
|
||||
.extlevels = pcr_ext_levels,
|
||||
|
||||
.rig_init = pcr_init,
|
||||
.rig_cleanup = pcr_cleanup,
|
||||
.rig_open = pcr_open,
|
||||
|
@ -162,6 +171,8 @@ const struct rig_caps pcr100_caps = {
|
|||
.set_func = pcr_set_func,
|
||||
.get_func = pcr_get_func,
|
||||
|
||||
.set_ext_level = pcr_set_ext_level,
|
||||
|
||||
.set_ctcss_sql = pcr_set_ctcss_sql,
|
||||
.get_ctcss_sql = pcr_get_ctcss_sql,
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue