From d870c371762c1784e97696ddca007b89329d98ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Fillod=2C=20F8CFE?= Date: Wed, 7 Nov 2007 19:06:44 +0000 Subject: [PATCH] move backend declaration into flexradio.c git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2231 7ae35d74-ebe9-4afe-98af-79ac388436b8 --- flexradio/flexradio.c | 46 +++++++++++++++++++++++++++++++++++++++++++ flexradio/flexradio.h | 32 ++++++++++++++++++++++++++++++ flexradio/sdr1k.c | 19 ++++-------------- 3 files changed, 82 insertions(+), 15 deletions(-) create mode 100644 flexradio/flexradio.c create mode 100644 flexradio/flexradio.h diff --git a/flexradio/flexradio.c b/flexradio/flexradio.c new file mode 100644 index 000000000..7b73c1b91 --- /dev/null +++ b/flexradio/flexradio.c @@ -0,0 +1,46 @@ +/* + * Hamlib Flexradio backend + * Copyright (c) 2003-2007 by Stephane Fillod + * + * $Id: flexradio.c,v 1.1 2007-11-07 19:06:44 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 /* String function definitions */ +#include /* UNIX standard function definitions */ +#include + +#include "hamlib/rig.h" +#include "flexradio.h" +#include "register.h" + +DECLARE_INITRIG_BACKEND(flexradio) +{ + rig_debug(RIG_DEBUG_TRACE, "%s called\n", __FUNCTION__); + + rig_register(&sdr1k_rig_caps); + //rig_register(&sdr1krfe_rig_caps); + rig_register(&dttsp_rig_caps); + + return RIG_OK; +} + diff --git a/flexradio/flexradio.h b/flexradio/flexradio.h new file mode 100644 index 000000000..7d8175068 --- /dev/null +++ b/flexradio/flexradio.h @@ -0,0 +1,32 @@ +/* + * Hamlib FLEXRADIO backend - main header + * Copyright (c) 2004-2007 by Stephane Fillod + * + * $Id: flexradio.h,v 1.1 2007-11-07 19:06:44 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 _FLEXRADIO_H +#define _FLEXRADIO_H 1 + +#include "hamlib/rig.h" + +extern const struct rig_caps sdr1k_rig_caps; +extern const struct rig_caps sdr1krfe_rig_caps; +extern const struct rig_caps dttsp_rig_caps; + +#endif /* _FLEXRADIO_H */ diff --git a/flexradio/sdr1k.c b/flexradio/sdr1k.c index d471ef707..edbeb2512 100644 --- a/flexradio/sdr1k.c +++ b/flexradio/sdr1k.c @@ -1,8 +1,8 @@ /* - * Hamlib Rotator backend - SDR-1000 - * Copyright (c) 2003-2005 by Stephane Fillod + * Hamlib backend - SDR-1000 + * Copyright (c) 2003-2007 by Stephane Fillod * - * $Id: sdr1k.c,v 1.9 2005-04-03 12:27:14 fillods Exp $ + * $Id: sdr1k.c,v 1.10 2007-11-07 19:05:18 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 @@ -35,7 +35,7 @@ #include "bandplan.h" #include "register.h" -#include "sdr1k.h" +#include "flexradio.h" static int sdr1k_set_freq(RIG *rig, vfo_t vfo, freq_t freq); static int sdr1k_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); @@ -184,17 +184,6 @@ const struct rig_caps sdr1k_rig_caps = { }; -/* ************************************************************************* */ - -DECLARE_INITRIG_BACKEND(flexradio) -{ - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__); - - rig_register(&sdr1k_rig_caps); - - return RIG_OK; -} - /* ************************************************************************* */ int sdr1k_init(RIG *rig)