kopia lustrzana https://github.com/Hamlib/Hamlib
new models: BCD396T/BCD996T
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2409 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.2.8
rodzic
be6627f410
commit
317f98453f
|
@ -1,8 +1,9 @@
|
|||
UNIDENSRC = bc895.c bc245.c pro2052.c bc780.c bc250.c
|
||||
UNIDENSRC = bc895.c bc245.c pro2052.c bc780.c bc250.c \
|
||||
bcd396t.c bcd996t.c
|
||||
|
||||
lib_LTLIBRARIES = hamlib-uniden.la
|
||||
hamlib_uniden_la_SOURCES = $(UNIDENSRC) uniden.c
|
||||
hamlib_uniden_la_SOURCES = $(UNIDENSRC) uniden.c uniden_digital.c
|
||||
hamlib_uniden_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
hamlib_uniden_la_LIBADD = $(top_builddir)/src/libhamlib.la
|
||||
|
||||
noinst_HEADERS = uniden.h
|
||||
noinst_HEADERS = uniden.h uniden_digital.h
|
||||
|
|
|
@ -0,0 +1,134 @@
|
|||
/*
|
||||
* Hamlib Uniden backend - BCD396T description
|
||||
* Copyright (c) 2001-2008 by Stephane Fillod
|
||||
*
|
||||
* $Id: bcd396t.c,v 1.1 2008-10-07 18:58:08 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
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "hamlib/rig.h"
|
||||
#include "uniden.h"
|
||||
#include "uniden_digital.h"
|
||||
|
||||
|
||||
/* TODO: All these defines have to be filled in properly */
|
||||
|
||||
#define BCD396T_MODES (RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_WFM)
|
||||
|
||||
#define BCD396T_FUNC (RIG_FUNC_MUTE)
|
||||
|
||||
#define BCD396T_LEVEL_ALL (RIG_LEVEL_ATT)
|
||||
|
||||
#define BCD396T_PARM_ALL (RIG_PARM_BEEP|RIG_PARM_BACKLIGHT)
|
||||
|
||||
#define BCD396T_VFO (RIG_VFO_A|RIG_VFO_B)
|
||||
|
||||
#define BCD396T_CHANNEL_CAPS \
|
||||
.freq=1,\
|
||||
.flags=1, /* L/O */
|
||||
|
||||
/*
|
||||
* bcd396t rig capabilities.
|
||||
*
|
||||
* TODO: check this with manual or web site.
|
||||
*/
|
||||
const struct rig_caps bcd396t_caps = {
|
||||
.rig_model = RIG_MODEL_BCD396T,
|
||||
.model_name = "BCD-396T",
|
||||
.mfg_name = "Uniden",
|
||||
.version = BACKEND_DIGITAL_VER,
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_ALPHA,
|
||||
.rig_type = RIG_TYPE_TRUNKSCANNER,
|
||||
.ptt_type = RIG_PTT_NONE,
|
||||
.dcd_type = RIG_DCD_RIG,
|
||||
.port_type = RIG_PORT_SERIAL,
|
||||
.serial_rate_min = 9600,
|
||||
.serial_rate_max = 115200,
|
||||
.serial_data_bits = 8,
|
||||
.serial_stop_bits = 1,
|
||||
.serial_parity = RIG_PARITY_NONE,
|
||||
.serial_handshake = RIG_HANDSHAKE_NONE,
|
||||
.write_delay = 0,
|
||||
.post_write_delay = 1,
|
||||
.timeout = 2000,
|
||||
.retry = 3,
|
||||
|
||||
.has_get_func = BCD396T_FUNC,
|
||||
.has_set_func = BCD396T_FUNC,
|
||||
.has_get_level = BCD396T_LEVEL_ALL,
|
||||
.has_set_level = RIG_LEVEL_SET(BCD396T_LEVEL_ALL),
|
||||
.has_get_parm = BCD396T_PARM_ALL,
|
||||
.has_set_parm = RIG_PARM_SET(BCD396T_PARM_ALL),
|
||||
.level_gran = {}, /* FIXME: granularity */
|
||||
.parm_gran = {},
|
||||
.ctcss_list = NULL, /* FIXME: CTCSS list? */
|
||||
.dcs_list = NULL,
|
||||
.preamp = { RIG_DBLST_END },
|
||||
.attenuator = { RIG_DBLST_END },
|
||||
.max_rit = Hz(0),
|
||||
.max_xit = Hz(0),
|
||||
.max_ifshift = Hz(0),
|
||||
.targetable_vfo = 0,
|
||||
.transceive = RIG_TRN_OFF,
|
||||
.bank_qty = 0,
|
||||
.chan_desc_sz = 0,
|
||||
|
||||
.chan_list = {
|
||||
{ 0, 5999, RIG_MTYPE_MEM, {BCD396T_CHANNEL_CAPS} }, /* Really 6000 channels? */
|
||||
RIG_CHAN_END,
|
||||
},
|
||||
|
||||
.rx_range_list1 = { RIG_FRNG_END, }, /* FIXME: enter region 1 setting */
|
||||
.tx_range_list1 = { RIG_FRNG_END, },
|
||||
.rx_range_list2 = {
|
||||
{MHz(25),MHz(512),BCD396T_MODES,-1,-1,BCD396T_VFO},
|
||||
{MHz(764),MHz(775.9875),BCD396T_MODES,-1,-1,BCD396T_VFO},
|
||||
{MHz(794),MHz(823.9875),BCD396T_MODES,-1,-1,BCD396T_VFO},
|
||||
{MHz(849.0125),MHz(868.9875),BCD396T_MODES,-1,-1,BCD396T_VFO},
|
||||
{MHz(894.0125),MHz(956),BCD396T_MODES,-1,-1,BCD396T_VFO},
|
||||
{MHz(1240),MHz(1300),BCD396T_MODES,-1,-1,BCD396T_VFO},
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
.tx_range_list2 = { RIG_FRNG_END, },
|
||||
.tuning_steps = {
|
||||
{BCD396T_MODES,10}, /* FIXME: add other ts */
|
||||
RIG_TS_END,
|
||||
},
|
||||
/* mode/filter list, remember: order matters! */
|
||||
.filters = {
|
||||
{RIG_MODE_AM|RIG_MODE_FM, kHz(8)},
|
||||
{RIG_MODE_WFM, kHz(230)},
|
||||
RIG_FLT_END,
|
||||
},
|
||||
|
||||
.get_info = uniden_get_info,
|
||||
.set_freq = uniden_digital_set_freq,
|
||||
.get_freq = uniden_digital_get_freq,
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
* Function definitions below
|
||||
*/
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
/*
|
||||
* Hamlib Uniden backend - BCD996T description
|
||||
* Copyright (c) 2001-2008 by Stephane Fillod
|
||||
*
|
||||
* $Id: bcd996t.c,v 1.1 2008-10-07 18:58:08 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
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "hamlib/rig.h"
|
||||
#include "uniden.h"
|
||||
#include "uniden_digital.h"
|
||||
|
||||
|
||||
/* TODO: All these defines have to be filled in properly */
|
||||
|
||||
#define BCD996T_MODES (RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_WFM)
|
||||
|
||||
#define BCD996T_FUNC (RIG_FUNC_MUTE)
|
||||
|
||||
#define BCD996T_LEVEL_ALL (RIG_LEVEL_ATT)
|
||||
|
||||
#define BCD996T_PARM_ALL (RIG_PARM_BEEP|RIG_PARM_BACKLIGHT)
|
||||
|
||||
#define BCD996T_VFO (RIG_VFO_A|RIG_VFO_B)
|
||||
|
||||
#define BCD996T_CHANNEL_CAPS \
|
||||
.freq=1,\
|
||||
.flags=1, /* L/O */
|
||||
|
||||
/*
|
||||
* bcd996t rig capabilities.
|
||||
*
|
||||
* TODO: check this with manual or web site.
|
||||
*/
|
||||
const struct rig_caps bcd996t_caps = {
|
||||
.rig_model = RIG_MODEL_BCD996T,
|
||||
.model_name = "BCD-996T",
|
||||
.mfg_name = "Uniden",
|
||||
.version = BACKEND_DIGITAL_VER,
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_ALPHA,
|
||||
.rig_type = RIG_TYPE_TRUNKSCANNER,
|
||||
.ptt_type = RIG_PTT_NONE,
|
||||
.dcd_type = RIG_DCD_RIG,
|
||||
.port_type = RIG_PORT_SERIAL,
|
||||
.serial_rate_min = 9600,
|
||||
.serial_rate_max = 115200,
|
||||
.serial_data_bits = 8,
|
||||
.serial_stop_bits = 1,
|
||||
.serial_parity = RIG_PARITY_NONE,
|
||||
.serial_handshake = RIG_HANDSHAKE_NONE,
|
||||
.write_delay = 0,
|
||||
.post_write_delay = 1,
|
||||
.timeout = 2000,
|
||||
.retry = 3,
|
||||
|
||||
.has_get_func = BCD996T_FUNC,
|
||||
.has_set_func = BCD996T_FUNC,
|
||||
.has_get_level = BCD996T_LEVEL_ALL,
|
||||
.has_set_level = RIG_LEVEL_SET(BCD996T_LEVEL_ALL),
|
||||
.has_get_parm = BCD996T_PARM_ALL,
|
||||
.has_set_parm = RIG_PARM_SET(BCD996T_PARM_ALL),
|
||||
.level_gran = {}, /* FIXME: granularity */
|
||||
.parm_gran = {},
|
||||
.ctcss_list = NULL, /* FIXME: CTCSS list? */
|
||||
.dcs_list = NULL,
|
||||
.preamp = { RIG_DBLST_END },
|
||||
.attenuator = { RIG_DBLST_END },
|
||||
.max_rit = Hz(0),
|
||||
.max_xit = Hz(0),
|
||||
.max_ifshift = Hz(0),
|
||||
.targetable_vfo = 0,
|
||||
.transceive = RIG_TRN_OFF,
|
||||
.bank_qty = 0,
|
||||
.chan_desc_sz = 0,
|
||||
|
||||
.chan_list = {
|
||||
{ 0, 5999, RIG_MTYPE_MEM, {BCD996T_CHANNEL_CAPS} }, /* Really 6000 channels? */
|
||||
RIG_CHAN_END,
|
||||
},
|
||||
|
||||
.rx_range_list1 = { RIG_FRNG_END, }, /* FIXME: enter region 1 setting */
|
||||
.tx_range_list1 = { RIG_FRNG_END, },
|
||||
.rx_range_list2 = {
|
||||
{MHz(25),MHz(512),BCD996T_MODES,-1,-1,BCD996T_VFO},
|
||||
{MHz(764),MHz(776),BCD996T_MODES,-1,-1,BCD996T_VFO},
|
||||
{MHz(794),MHz(956),BCD996T_MODES,-1,-1,BCD996T_VFO},
|
||||
{MHz(1240),MHz(1300),BCD996T_MODES,-1,-1,BCD996T_VFO}, /* TBC */
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
.tx_range_list2 = { RIG_FRNG_END, },
|
||||
.tuning_steps = {
|
||||
{BCD996T_MODES,10}, /* FIXME: add other ts */
|
||||
RIG_TS_END,
|
||||
},
|
||||
/* mode/filter list, remember: order matters! */
|
||||
.filters = {
|
||||
{RIG_MODE_AM|RIG_MODE_FM, kHz(8)},
|
||||
{RIG_MODE_WFM, kHz(230)},
|
||||
RIG_FLT_END,
|
||||
},
|
||||
|
||||
.get_info = uniden_get_info,
|
||||
.set_freq = uniden_digital_set_freq,
|
||||
.get_freq = uniden_digital_get_freq,
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
* Function definitions below
|
||||
*/
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
* Hamlib Uniden backend - main file
|
||||
* Copyright (c) 2001-2008 by Stephane Fillod
|
||||
*
|
||||
* $Id: uniden.c,v 1.14 2008-10-07 17:55:48 fillods Exp $
|
||||
* $Id: uniden.c,v 1.15 2008-10-07 18:58:08 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
|
||||
|
@ -704,6 +704,9 @@ DECLARE_INITRIG_BACKEND(uniden)
|
|||
|
||||
rig_register(&pro2052_caps);
|
||||
|
||||
rig_register(&bcd396t_caps);
|
||||
rig_register(&bcd996t_caps);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Hamlib Uniden backend - main header
|
||||
* Copyright (c) 2001-2008 by Stephane Fillod
|
||||
*
|
||||
* $Id: uniden.h,v 1.8 2008-05-04 15:33:26 fillods Exp $
|
||||
* $Id: uniden.h,v 1.9 2008-10-07 18:58:08 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
|
||||
|
@ -76,4 +76,7 @@ extern const struct rig_caps bc780_caps;
|
|||
extern const struct rig_caps bc250_caps;
|
||||
extern const struct rig_caps pro2052_caps;
|
||||
|
||||
extern const struct rig_caps bcd396t_caps;
|
||||
extern const struct rig_caps bcd996t_caps;
|
||||
|
||||
#endif /* _UNIDEN_H */
|
||||
|
|
|
@ -0,0 +1,88 @@
|
|||
/*
|
||||
* Hamlib Uniden backend - uniden_digital backend
|
||||
* Copyright (c) 2001-2008 by Stephane Fillod
|
||||
*
|
||||
* $Id: uniden_digital.c,v 1.1 2008-10-07 18:58:08 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
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h> /* String function definitions */
|
||||
#include <unistd.h> /* UNIX standard function definitions */
|
||||
#include <math.h>
|
||||
|
||||
#include "hamlib/rig.h"
|
||||
#include "serial.h"
|
||||
#include "misc.h"
|
||||
|
||||
#include "uniden_digital.h"
|
||||
|
||||
|
||||
/*
|
||||
* skeleton
|
||||
*/
|
||||
int uniden_digital_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
#if 0
|
||||
char freqbuf[BUFSZ];
|
||||
size_t freq_len=BUFSZ;
|
||||
|
||||
/* freq in hundreds of Hz */
|
||||
freq /= 100;
|
||||
|
||||
/* exactly 8 digits */
|
||||
freq_len = sprintf(freqbuf, "RF%08u" EOM, (unsigned)freq);
|
||||
|
||||
return uniden_transaction (rig, freqbuf, freq_len, NULL, NULL, NULL);
|
||||
#else
|
||||
return -RIG_ENIMPL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* skeleton
|
||||
*/
|
||||
int uniden_digital_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
#if 0
|
||||
char freqbuf[BUFSZ];
|
||||
size_t freq_len=BUFSZ;
|
||||
int ret;
|
||||
|
||||
ret = uniden_transaction (rig, "RF" EOM, 3, NULL, freqbuf, &freq_len);
|
||||
if (ret != RIG_OK)
|
||||
return ret;
|
||||
|
||||
if (freq_len < 10)
|
||||
return -RIG_EPROTO;
|
||||
|
||||
sscanf(freqbuf+2, "%"SCNfreq, freq);
|
||||
/* returned freq in hundreds of Hz */
|
||||
*freq *= 100;
|
||||
|
||||
return RIG_OK;
|
||||
#else
|
||||
return -RIG_ENIMPL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Hamlib Uniden backend - uniden_digital header
|
||||
* Copyright (c) 2001-2008 by Stephane Fillod
|
||||
*
|
||||
* $Id: uniden_digital.h,v 1.1 2008-10-07 18:58:08 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
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _UNIDEN_DIGITAL_H
|
||||
#define _UNIDEN_DIGITAL_H 1
|
||||
|
||||
#include "hamlib/rig.h"
|
||||
|
||||
#define BACKEND_DIGITAL_VER "0.3"
|
||||
|
||||
int uniden_digital_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
int uniden_digital_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
|
||||
#endif /* _UNIDEN_DIGITAL_H */
|
Ładowanie…
Reference in New Issue