From b3dc2f471390b6ed6ed369155273853a33a04f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Fillod=2C=20F8CFE?= Date: Sun, 4 May 2008 15:33:26 +0000 Subject: [PATCH] Added BC780xlt and BC250D git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2342 7ae35d74-ebe9-4afe-98af-79ac388436b8 --- uniden/Makefile.am | 2 +- uniden/bc250.c | 149 +++++++++++++++++++++++++++++++++++++++++++++ uniden/bc780.c | 149 +++++++++++++++++++++++++++++++++++++++++++++ uniden/uniden.c | 4 +- uniden/uniden.h | 4 +- 5 files changed, 305 insertions(+), 3 deletions(-) create mode 100644 uniden/bc250.c create mode 100644 uniden/bc780.c diff --git a/uniden/Makefile.am b/uniden/Makefile.am index ced11b21e..0a09b938a 100644 --- a/uniden/Makefile.am +++ b/uniden/Makefile.am @@ -1,4 +1,4 @@ -UNIDENSRC = bc895.c bc245.c pro2052.c +UNIDENSRC = bc895.c bc245.c pro2052.c bc780.c bc250.c lib_LTLIBRARIES = hamlib-uniden.la hamlib_uniden_la_SOURCES = $(UNIDENSRC) uniden.c diff --git a/uniden/bc250.c b/uniden/bc250.c new file mode 100644 index 000000000..0869bf994 --- /dev/null +++ b/uniden/bc250.c @@ -0,0 +1,149 @@ +/* + * Hamlib Uniden backend - BC250 description + * Copyright (c) 2001-2008 by Stephane Fillod + * + * $Id: bc250.c,v 1.1 2008-05-04 15:33:26 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 + +#include +#include "uniden.h" + + +#define BC250_MODES (RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_WFM) + +#define BC250_FUNC (RIG_FUNC_MUTE) + +#define BC250_LEVEL_ALL (RIG_LEVEL_ATT|RIG_LEVEL_RAWSTR) + +#define BC250_PARM_ALL (RIG_PARM_NONE) + +#define BC250_VFO RIG_VFO_A + +#define BC250_CHANNEL_CAPS \ + UNIDEN_CHANNEL_CAPS \ + .channel_desc=1, \ + .ctcss_sql=1, \ + .dcs_sql=1 + +#define BC250_STR_CAL UNIDEN_STR_CAL + + +/* + * bc250 rig capabilities. + * + * TODO: check this with manual or web site. + */ +const struct rig_caps bc250_caps = { +.rig_model = RIG_MODEL_BC250, +.model_name = "BC250D", +.mfg_name = "Uniden", +.version = BACKEND_VER, +.copyright = "LGPL", +.status = RIG_STATUS_UNTESTED, +.rig_type = RIG_TYPE_TRUNKSCANNER, +.ptt_type = RIG_PTT_NONE, +.dcd_type = RIG_DCD_RIG, +.port_type = RIG_PORT_SERIAL, +.serial_rate_min = 2400, +.serial_rate_max = 19200, +.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 = 200, +.retry = 3, + +.has_get_func = BC250_FUNC, +.has_set_func = BC250_FUNC, +.has_get_level = BC250_LEVEL_ALL, +.has_set_level = RIG_LEVEL_SET(BC250_LEVEL_ALL), +.has_get_parm = BC250_PARM_ALL, +.has_set_parm = RIG_PARM_SET(BC250_PARM_ALL), +.level_gran = {}, /* FIXME: granularity */ +.parm_gran = {}, +.ctcss_list = uniden_ctcss_list, +.dcs_list = uniden_dcs_list, +.preamp = { RIG_DBLST_END }, +.attenuator = { 20, RIG_DBLST_END }, /* TBC */ +.max_rit = Hz(0), +.max_xit = Hz(0), +.max_ifshift = Hz(0), +.targetable_vfo = 0, +.transceive = RIG_TRN_OFF, +.bank_qty = 10, /* A..J */ +.chan_desc_sz = 16, +.str_cal = BC250_STR_CAL, + +.chan_list = { + { 0, 999, RIG_MTYPE_MEM, {BC250_CHANNEL_CAPS} }, + 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),BC250_MODES,-1,-1,BC250_VFO}, + {MHz(806),MHz(956),BC250_MODES,-1,-1,BC250_VFO}, /* (minus Cellular frequencies) */ + {MHz(1240),MHz(1300),BC250_MODES,-1,-1,BC250_VFO}, + RIG_FRNG_END, + }, +.tx_range_list2 = { RIG_FRNG_END, }, +.tuning_steps = { + {BC250_MODES,kHz(5)}, + {BC250_MODES,kHz(7.5)}, + {BC250_MODES,kHz(10)}, + {BC250_MODES,kHz(12.5)}, + {BC250_MODES,kHz(50)}, + RIG_TS_END, + 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, + }, +.priv = NULL, + +.set_freq = uniden_set_freq, +.get_freq = uniden_get_freq, +.set_mode = uniden_set_mode, +.get_mode = uniden_get_mode, +.set_mem = uniden_set_mem, +.get_mem = uniden_get_mem, +.get_dcd = uniden_get_dcd, +.get_info = uniden_get_info, +.get_level = uniden_get_level, +.set_level = uniden_set_level, +.get_channel = uniden_get_channel, +.set_channel = uniden_set_channel, + +}; + +/* + * Function definitions below + */ + diff --git a/uniden/bc780.c b/uniden/bc780.c new file mode 100644 index 000000000..73d165b78 --- /dev/null +++ b/uniden/bc780.c @@ -0,0 +1,149 @@ +/* + * Hamlib Uniden backend - BC780 description + * Copyright (c) 2001-2008 by Stephane Fillod + * + * $Id: bc780.c,v 1.1 2008-05-04 15:33:25 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 + +#include +#include "uniden.h" + + +#define BC780_MODES (RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_WFM) + +#define BC780_FUNC (RIG_FUNC_MUTE) + +#define BC780_LEVEL_ALL (RIG_LEVEL_ATT|RIG_LEVEL_RAWSTR) + +#define BC780_PARM_ALL (RIG_PARM_NONE) + +#define BC780_VFO RIG_VFO_A + +#define BC780_CHANNEL_CAPS \ + UNIDEN_CHANNEL_CAPS \ + .channel_desc=1, \ + .ctcss_sql=1, \ + .dcs_sql=1 + +#define BC780_STR_CAL UNIDEN_STR_CAL + + +/* + * bc780 rig capabilities. + * + * TODO: check this with manual or web site. + */ +const struct rig_caps bc780_caps = { +.rig_model = RIG_MODEL_BC780, +.model_name = "BC780xlt", +.mfg_name = "Uniden", +.version = BACKEND_VER, +.copyright = "LGPL", +.status = RIG_STATUS_UNTESTED, +.rig_type = RIG_TYPE_TRUNKSCANNER, +.ptt_type = RIG_PTT_NONE, +.dcd_type = RIG_DCD_RIG, +.port_type = RIG_PORT_SERIAL, +.serial_rate_min = 2400, +.serial_rate_max = 19200, +.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 = 200, +.retry = 3, + +.has_get_func = BC780_FUNC, +.has_set_func = BC780_FUNC, +.has_get_level = BC780_LEVEL_ALL, +.has_set_level = RIG_LEVEL_SET(BC780_LEVEL_ALL), +.has_get_parm = BC780_PARM_ALL, +.has_set_parm = RIG_PARM_SET(BC780_PARM_ALL), +.level_gran = {}, /* FIXME: granularity */ +.parm_gran = {}, +.ctcss_list = uniden_ctcss_list, +.dcs_list = uniden_dcs_list, +.preamp = { RIG_DBLST_END }, +.attenuator = { 20, RIG_DBLST_END }, /* TBC */ +.max_rit = Hz(0), +.max_xit = Hz(0), +.max_ifshift = Hz(0), +.targetable_vfo = 0, +.transceive = RIG_TRN_OFF, +.bank_qty = 10, /* A..J */ +.chan_desc_sz = 16, +.str_cal = BC780_STR_CAL, + +.chan_list = { + { 0, 499, RIG_MTYPE_MEM, {BC780_CHANNEL_CAPS} }, + 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),BC780_MODES,-1,-1,BC780_VFO}, + {MHz(806),MHz(956),BC780_MODES,-1,-1,BC780_VFO}, /* (minus Cellular frequencies) */ + {MHz(1240),MHz(1300),BC780_MODES,-1,-1,BC780_VFO}, + RIG_FRNG_END, + }, +.tx_range_list2 = { RIG_FRNG_END, }, +.tuning_steps = { + {BC780_MODES,kHz(5)}, + {BC780_MODES,kHz(7.5)}, + {BC780_MODES,kHz(10)}, + {BC780_MODES,kHz(12.5)}, + {BC780_MODES,kHz(50)}, + RIG_TS_END, + 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, + }, +.priv = NULL, + +.set_freq = uniden_set_freq, +.get_freq = uniden_get_freq, +.set_mode = uniden_set_mode, +.get_mode = uniden_get_mode, +.set_mem = uniden_set_mem, +.get_mem = uniden_get_mem, +.get_dcd = uniden_get_dcd, +.get_info = uniden_get_info, +.get_level = uniden_get_level, +.set_level = uniden_set_level, +.get_channel = uniden_get_channel, +.set_channel = uniden_set_channel, + +}; + +/* + * Function definitions below + */ + diff --git a/uniden/uniden.c b/uniden/uniden.c index e4984ae4a..934f7a074 100644 --- a/uniden/uniden.c +++ b/uniden/uniden.c @@ -2,7 +2,7 @@ * Hamlib Uniden backend - main file * Copyright (c) 2001-2008 by Stephane Fillod * - * $Id: uniden.c,v 1.12 2008-05-04 14:23:54 fillods Exp $ + * $Id: uniden.c,v 1.13 2008-05-04 15:33:26 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 @@ -698,6 +698,8 @@ DECLARE_INITRIG_BACKEND(uniden) rig_register(&bc895_caps); rig_register(&bc245_caps); + rig_register(&bc780_caps); + rig_register(&bc250_caps); rig_register(&pro2052_caps); diff --git a/uniden/uniden.h b/uniden/uniden.h index 5604231f7..92d7839f4 100644 --- a/uniden/uniden.h +++ b/uniden/uniden.h @@ -2,7 +2,7 @@ * Hamlib Uniden backend - main header * Copyright (c) 2001-2008 by Stephane Fillod * - * $Id: uniden.h,v 1.7 2008-05-04 14:23:54 fillods Exp $ + * $Id: uniden.h,v 1.8 2008-05-04 15:33:26 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 @@ -72,6 +72,8 @@ const char* uniden_get_info(RIG *rig); extern const struct rig_caps bc895_caps; extern const struct rig_caps bc245_caps; +extern const struct rig_caps bc780_caps; +extern const struct rig_caps bc250_caps; extern const struct rig_caps pro2052_caps; #endif /* _UNIDEN_H */