2001-03-02 18:30:45 +00:00
|
|
|
/*
|
2001-07-13 19:08:15 +00:00
|
|
|
* Hamlib PCR backend - main header
|
2010-07-31 23:22:48 +00:00
|
|
|
* Copyright (c) 2001-2010 by Stephane Fillod
|
2001-03-02 18:30:45 +00:00
|
|
|
*
|
|
|
|
*
|
2011-08-21 23:06:28 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2001-03-02 18:30:45 +00:00
|
|
|
*
|
2011-08-21 23:06:28 +00:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
2001-07-13 19:08:15 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2011-08-21 23:06:28 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2001-03-02 18:30:45 +00:00
|
|
|
*
|
2011-08-21 23:06:28 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2001-07-13 19:08:15 +00:00
|
|
|
* License along with this library; if not, write to the Free Software
|
2011-08-21 23:06:28 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2001-03-02 18:30:45 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PCR_H
|
|
|
|
#define _PCR_H 1
|
|
|
|
|
2009-02-06 17:31:33 +00:00
|
|
|
#include "hamlib/rig.h"
|
|
|
|
#include "token.h"
|
|
|
|
|
|
|
|
/* ext_level's tokens */
|
|
|
|
#define TOK_EL_ANL TOKEN_BACKEND(1)
|
2010-07-31 23:22:48 +00:00
|
|
|
#define TOK_EL_DIVERSITY TOKEN_BACKEND(2)
|
2009-02-06 17:31:33 +00:00
|
|
|
|
2010-07-31 23:22:48 +00:00
|
|
|
#define BACKEND_VER "0.8"
|
2009-01-27 19:05:59 +00:00
|
|
|
#define PCR_MAX_CMD_LEN 32
|
2001-03-02 18:30:45 +00:00
|
|
|
|
2009-12-04 17:42:09 +00:00
|
|
|
struct pcr_priv_data
|
|
|
|
{
|
2010-07-31 23:22:48 +00:00
|
|
|
struct pcr_rcvr {
|
2009-01-27 19:05:59 +00:00
|
|
|
|
2010-07-31 23:22:48 +00:00
|
|
|
freq_t last_freq;
|
2011-07-19 22:06:39 +00:00
|
|
|
int last_mode;
|
2009-01-27 19:05:59 +00:00
|
|
|
|
2010-07-31 23:22:48 +00:00
|
|
|
int last_filter;
|
|
|
|
int last_shift;
|
|
|
|
int last_att;
|
|
|
|
int last_agc;
|
|
|
|
tone_t last_ctcss_sql;
|
|
|
|
tone_t last_dcs_sql;
|
|
|
|
|
|
|
|
float volume;
|
|
|
|
float squelch;
|
|
|
|
|
|
|
|
int raw_level;
|
|
|
|
int squelch_status;
|
|
|
|
|
|
|
|
} main_rcvr, sub_rcvr;
|
|
|
|
|
|
|
|
vfo_t current_vfo;
|
2009-01-27 19:05:59 +00:00
|
|
|
|
|
|
|
int auto_update;
|
|
|
|
|
|
|
|
char info[100];
|
|
|
|
char cmd_buf[PCR_MAX_CMD_LEN];
|
2009-12-04 17:42:09 +00:00
|
|
|
char reply_buf[PCR_MAX_CMD_LEN];
|
2009-01-27 19:05:59 +00:00
|
|
|
|
|
|
|
int protocol;
|
|
|
|
int firmware;
|
|
|
|
int country;
|
|
|
|
int options;
|
|
|
|
|
|
|
|
int sync;
|
2009-01-29 19:50:33 +00:00
|
|
|
|
|
|
|
powerstat_t power;
|
2001-03-02 18:30:45 +00:00
|
|
|
};
|
|
|
|
|
2009-12-04 17:42:09 +00:00
|
|
|
struct pcr_priv_caps
|
|
|
|
{
|
|
|
|
unsigned int reply_size;
|
|
|
|
unsigned int reply_offset;
|
|
|
|
unsigned int always_sync;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define pcr_caps(rig) ((struct pcr_priv_caps *)(rig)->caps->priv)
|
|
|
|
|
2009-01-27 19:05:59 +00:00
|
|
|
extern const tone_t pcr_ctcss_list[];
|
2010-07-31 23:22:48 +00:00
|
|
|
extern const tone_t pcr_dcs_list[];
|
2001-03-02 18:30:45 +00:00
|
|
|
|
|
|
|
int pcr_init(RIG *rig);
|
|
|
|
int pcr_cleanup(RIG *rig);
|
2002-03-07 22:48:50 +00:00
|
|
|
int pcr_open(RIG *rig);
|
|
|
|
int pcr_close(RIG *rig);
|
2010-07-31 23:22:48 +00:00
|
|
|
int pcr_set_vfo(RIG * rig, vfo_t vfo);
|
|
|
|
int pcr_get_vfo(RIG * rig, vfo_t *vfo);
|
2001-03-02 18:30:45 +00:00
|
|
|
int pcr_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
|
|
|
int pcr_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
|
|
|
int pcr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
|
|
|
int pcr_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
2001-06-02 17:52:55 +00:00
|
|
|
const char *pcr_get_info(RIG *rig);
|
2001-03-02 18:30:45 +00:00
|
|
|
|
|
|
|
|
2009-01-27 19:05:59 +00:00
|
|
|
/* Added - G0WCW */
|
2002-08-26 22:33:52 +00:00
|
|
|
|
|
|
|
int pcr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
|
|
|
|
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);
|
2009-02-06 17:31:33 +00:00
|
|
|
int pcr_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val);
|
2002-08-26 22:33:52 +00:00
|
|
|
|
2009-01-27 19:05:59 +00:00
|
|
|
int pcr_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone);
|
|
|
|
int pcr_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone);
|
2010-07-31 23:22:48 +00:00
|
|
|
int pcr_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *tone);
|
|
|
|
int pcr_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t tone);
|
2009-01-27 19:05:59 +00:00
|
|
|
int pcr_set_trn(RIG * rig, int trn);
|
|
|
|
int pcr_decode_event(RIG *rig);
|
2009-01-29 19:50:33 +00:00
|
|
|
int pcr_set_powerstat(RIG * rig, powerstat_t status);
|
|
|
|
int pcr_get_powerstat(RIG * rig, powerstat_t *status);
|
2010-07-31 23:22:48 +00:00
|
|
|
int pcr_get_dcd(RIG * rig, vfo_t vfo, dcd_t *dcd);
|
2009-01-27 19:05:59 +00:00
|
|
|
|
2002-08-26 22:33:52 +00:00
|
|
|
/* ------------------------------------------------------------------ */
|
|
|
|
|
|
|
|
// int pcr_get_param(RIG *rig, setting_t parm, value_t *val);
|
|
|
|
// int pcr_set_param(RIG *rig, setting_t parm, value_t *val);
|
|
|
|
|
2001-03-02 18:30:45 +00:00
|
|
|
extern const struct rig_caps pcr1000_caps;
|
2001-06-02 17:52:55 +00:00
|
|
|
extern const struct rig_caps pcr100_caps;
|
2009-08-02 16:15:59 +00:00
|
|
|
extern const struct rig_caps pcr1500_caps;
|
2010-07-31 23:22:48 +00:00
|
|
|
extern const struct rig_caps pcr2500_caps;
|
2001-03-02 18:30:45 +00:00
|
|
|
|
|
|
|
#endif /* _PCR_H */
|