kopia lustrzana https://github.com/Hamlib/Hamlib
Add LGPL boilerplate to adat source files.
Frank had originally released the files to us under "Creative Commons License." After contacting him, he agreed to allow it to be changed to LGPL: Date: Tue, 10 Jan 2012 09:16:07 +0100 From: Frank Goenninger <frgo@me.com> To: Nate Bargmann <n0nb@n0nb.us> Subject: Re: Hamlib Backend for the ADAT ADT-200A Hi Nate, sure - change it to LGPL. Do you do this or should I do and resend the files? Tnx! 73 Frank ----------------8<------------------ I have now done so. Only other change is stripping of trailing white space.Hamlib-1.2.15
rodzic
39fe57864f
commit
86caab9466
1731
adat/adat.c
1731
adat/adat.c
Plik diff jest za duży
Load Diff
121
adat/adat.h
121
adat/adat.h
|
@ -3,11 +3,24 @@
|
|||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// adat.h
|
||||
//
|
||||
// Created by Frank Goenninger DG1SBG.
|
||||
// Copyright © 2011, 2012 Frank Goenninger. Creative Commons License.
|
||||
//
|
||||
// $Header$
|
||||
// Created by Frank Goenninger DG1SBG.
|
||||
// Copyright © 2011, 2012 Frank Goenninger.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// This library 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
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
#if !defined( __ADAT_INCLUDED__ )
|
||||
#define __ADAT_INCLUDED__
|
||||
|
@ -18,13 +31,13 @@
|
|||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// HAMLIB INCLUDES
|
||||
// HAMLIB INCLUDES
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#include "hamlib/rig.h"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// GLOBAL DEFINITIONS
|
||||
// GLOBAL DEFINITIONS
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#define ADAT_BUFSZ 256
|
||||
|
@ -92,7 +105,7 @@
|
|||
// ADAT_MODE_RNR_... -> The Hamlib number of the mode: RIG_MODE_...
|
||||
// ADAT_MODE_ANR_... -> The ADAT Nr representing the mode when setting it
|
||||
|
||||
#define ADAT_MODE_STR_CW_R "CW-R"
|
||||
#define ADAT_MODE_STR_CW_R "CW-R"
|
||||
#define ADAT_MODE_RNR_CW_R RIG_MODE_CWR
|
||||
#define ADAT_MODE_ANR_CW_R 0
|
||||
|
||||
|
@ -138,10 +151,10 @@
|
|||
#define ADAT_PWR_LVL_RNR_00 100 // 100 mW
|
||||
|
||||
#define ADAT_PWR_LVL_ANR_01 1
|
||||
#define ADAT_PWR_LVL_RNR_01 300 // 300 mW
|
||||
#define ADAT_PWR_LVL_RNR_01 300 // 300 mW
|
||||
|
||||
#define ADAT_PWR_LVL_ANR_02 2
|
||||
#define ADAT_PWR_LVL_RNR_02 1000 // ...
|
||||
#define ADAT_PWR_LVL_RNR_02 1000 // ...
|
||||
|
||||
#define ADAT_PWR_LVL_ANR_03 3
|
||||
#define ADAT_PWR_LVL_RNR_03 2000
|
||||
|
@ -313,66 +326,66 @@
|
|||
// -- ADAT SPECIAL: RECOVER FROM ERROR --
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ADAT PRIVATE DATA
|
||||
// ADAT PRIVATE DATA
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
typedef struct _adat_priv_data
|
||||
typedef struct _adat_priv_data
|
||||
{
|
||||
int nOpCode;
|
||||
|
||||
|
||||
char *pcProductName; // Future use (USB direct I/O)
|
||||
|
||||
|
||||
// ADAT device info
|
||||
|
||||
|
||||
char *pcSerialNr;
|
||||
char *pcIDCode;
|
||||
char *pcOptions;
|
||||
char *pcFWVersion;
|
||||
char *pcHWVersion;
|
||||
char *pcGUIFWVersion;
|
||||
|
||||
|
||||
char *pcCallsign;
|
||||
|
||||
|
||||
// ADAT Operational Settings: will change during TRX use
|
||||
|
||||
|
||||
int nCurrentVFO;
|
||||
vfo_t nRIGVFONr;
|
||||
|
||||
|
||||
freq_t nFreq;
|
||||
char acRXFreq[ ADAT_BUFSZ ];
|
||||
char acTXFreq[ ADAT_BUFSZ ];
|
||||
|
||||
|
||||
rmode_t nRIGMode;
|
||||
char acADATMode[ ADAT_MODE_LENGTH + 1 ];
|
||||
int nADATMode;
|
||||
|
||||
|
||||
pbwidth_t nWidth;
|
||||
|
||||
|
||||
int nADATPTTStatus;
|
||||
ptt_t nRIGPTTStatus;
|
||||
|
||||
|
||||
|
||||
|
||||
value_t mNB1;
|
||||
value_t mNB2;
|
||||
|
||||
|
||||
value_t mAGC;
|
||||
value_t mRFGain;
|
||||
value_t mIFShift;
|
||||
value_t mRawStr;
|
||||
|
||||
// ADAT Command-related Values
|
||||
|
||||
|
||||
// ADAT Command-related Values
|
||||
|
||||
char *pcCmd;
|
||||
int nCmdKind;
|
||||
|
||||
|
||||
char *pcResult;
|
||||
int nRC;
|
||||
|
||||
} adat_priv_data_t,
|
||||
|
||||
} adat_priv_data_t,
|
||||
* adat_priv_data_ptr;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ADAT CAT COMMAND DATA TYPE DECLARATIONS
|
||||
// ADAT CAT COMMAND DATA TYPE DECLARATIONS
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
typedef unsigned long long adat_cmd_id_t; // Bit mask for commands. Each command
|
||||
|
@ -380,38 +393,38 @@ typedef unsigned long long adat_cmd_id_t; // Bit mask for commands. Each command
|
|||
|
||||
// adat_cmd_def : ADAT COMMAND DEFINITION.
|
||||
// Basic idea: Each command can be made of several strings to be sent
|
||||
// to the ADAT device. Therefore it is possible to build aggregated
|
||||
// commands which will be executed as a set of individual commands
|
||||
// to the ADAT device. Therefore it is possible to build aggregated
|
||||
// commands which will be executed as a set of individual commands
|
||||
// executed by adat_transaction(). The last value as returned by the
|
||||
// commands will be set as overall command result.
|
||||
|
||||
typedef enum
|
||||
typedef enum
|
||||
{
|
||||
ADAT_CMD_KIND_WITH_RESULT = 0, // After sending a command to the ADAT,
|
||||
// a result has to be read.
|
||||
ADAT_CMD_KIND_WITHOUT_RESULT = 1
|
||||
|
||||
ADAT_CMD_KIND_WITHOUT_RESULT = 1
|
||||
|
||||
} adat_cmd_kind_t;
|
||||
|
||||
typedef struct _adat_cmd_def_t
|
||||
{
|
||||
adat_cmd_id_t nCmdId; // Bit indicating this cmd
|
||||
adat_cmd_kind_t nCmdKind; // Defines if result expected
|
||||
|
||||
|
||||
int (*pfCmdFn)( RIG *pRig ); // Fn to be called to execute this cmd
|
||||
|
||||
int nNrCmdStrs; // Oh my, C as a language ... I'd love to
|
||||
|
||||
int nNrCmdStrs; // Oh my, C as a language ... I'd love to
|
||||
// switch to Common Lisp ... What a hack here ...
|
||||
char *pacCmdStrs[]; // Commands to be executed if no CmdFn given
|
||||
|
||||
} adat_cmd_def_t,
|
||||
|
||||
} adat_cmd_def_t,
|
||||
* adat_cmd_def_ptr;
|
||||
|
||||
typedef struct _adat_cmd_table_t
|
||||
{
|
||||
int nNrCmds;
|
||||
adat_cmd_def_ptr adat_cmds[];
|
||||
|
||||
|
||||
} adat_cmd_table_t,
|
||||
* adat_cmd_table_ptr;
|
||||
|
||||
|
@ -419,19 +432,19 @@ typedef struct _adat_cmd_list_t
|
|||
{
|
||||
int nNrCmds;
|
||||
adat_cmd_def_ptr adat_cmds[];
|
||||
|
||||
|
||||
} adat_cmd_list_t,
|
||||
* adat_cmd_list_ptr;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// OTHER ADAT DATA TYPES
|
||||
// OTHER ADAT DATA TYPES
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ADAT_FREQ_PARSE_MODE_WITH_VFO = 0,
|
||||
ADAT_FREQ_PARSE_MODE_WITHOUT_VFO = 1
|
||||
|
||||
|
||||
} adat_freq_parse_mode_t;
|
||||
|
||||
// ADAT MODE DEFINITION
|
||||
|
@ -441,16 +454,16 @@ typedef struct _adat_mode_def
|
|||
char *pcADATModeStr;
|
||||
rmode_t nRIGMode;
|
||||
int nADATMode;
|
||||
|
||||
|
||||
} adat_mode_def_t,
|
||||
* adat_mode_def_ptr;
|
||||
|
||||
typedef struct _adat_mode_list
|
||||
{
|
||||
int nNrModes;
|
||||
|
||||
|
||||
adat_mode_def_t adat_modes[ ADAT_NR_MODES ];
|
||||
|
||||
|
||||
} adat_mode_list_t,
|
||||
* adat_mode_list_ptr;
|
||||
|
||||
|
@ -461,21 +474,21 @@ typedef struct _adat_vfo_def
|
|||
char *pcADATVFOStr;
|
||||
vfo_t nRIGVFONr;
|
||||
int nADATVFONr;
|
||||
|
||||
|
||||
} adat_vfo_def_t,
|
||||
* adat_vfo_def_ptr;
|
||||
|
||||
typedef struct _adat_vfo_list
|
||||
{
|
||||
int nNrVFOs;
|
||||
|
||||
|
||||
adat_vfo_def_t adat_vfos[ ADAT_NR_VFOS ];
|
||||
|
||||
|
||||
} adat_vfo_list_t,
|
||||
* adat_vfo_list_ptr;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ADAT INTERNAL FUNCTION DECLARATIONS
|
||||
// ADAT INTERNAL FUNCTION DECLARATIONS
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// Helper functions
|
||||
|
@ -539,7 +552,7 @@ int adat_cmd_fn_get_ptt( RIG * );
|
|||
int adat_cmd_fn_set_ptt( RIG * );
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ADAT FUNCTION DECLARATIONS
|
||||
// ADAT FUNCTION DECLARATIONS
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
int adat_init( RIG * );
|
||||
|
@ -580,7 +593,7 @@ int adat_get_powerstat( RIG *, powerstat_t * );
|
|||
extern const struct rig_caps adt_200a_caps;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// END OF FILE
|
||||
// END OF FILE
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,13 +1,25 @@
|
|||
// ---------------------------------------------------------------------------
|
||||
// ADT-200A HAMLIB BACKEND
|
||||
// ADT-200A HAMLIB BACKEND
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// adt_200a.c
|
||||
//
|
||||
// Created by Frank Goenninger DG1SBG.
|
||||
// Copyright © 2011, 2012 Frank Goenninger. Creative Commons License.
|
||||
//
|
||||
// $Header$
|
||||
// Copyright © 2011, 2012 Frank Goenninger.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// This library 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
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -15,25 +27,25 @@
|
|||
#endif
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ADT-200A INCLUDES
|
||||
// ADT-200A INCLUDES
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#include "adt_200a.h"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// GLOBAL DEFINITIONS
|
||||
// GLOBAL DEFINITIONS
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// GLOBAL VARS
|
||||
|
||||
// static const struct confparams adt_200a_cfg_params[] =
|
||||
// static const struct confparams adt_200a_cfg_params[] =
|
||||
// {
|
||||
// { TOKEN_PRODUCT_NAME, "usb_product_name", "USB Product Name", "USB Product Name (DSP Bo
|
||||
// Model + ' Serial '+ ID Code, e.g. 'TRX3C Serial C945D5B' )",
|
||||
// ADT_200A_PRODUCT_NAME, RIG_CONF_STRING, { .n = { 0,0,0 } }
|
||||
// },
|
||||
//
|
||||
// { RIG_CONF_END, NULL, }
|
||||
//
|
||||
// { RIG_CONF_END, NULL, }
|
||||
//};
|
||||
|
||||
|
||||
|
@ -41,7 +53,7 @@
|
|||
// ADT-200A HAMLIB CAPS / DESCRIPTION
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
const struct rig_caps adt_200a_caps =
|
||||
const struct rig_caps adt_200a_caps =
|
||||
{
|
||||
.rig_model = RIG_MODEL_ADT_200A,
|
||||
.model_name = "ADT-200A",
|
||||
|
@ -63,7 +75,7 @@ const struct rig_caps adt_200a_caps =
|
|||
.post_write_delay = 20,
|
||||
.timeout = 250,
|
||||
.retry = 3,
|
||||
|
||||
|
||||
.has_get_func = ADT_200A_FUNCS,
|
||||
.has_set_func = ADT_200A_FUNCS,
|
||||
.has_get_level = ADT_200A_GET_LEVEL,
|
||||
|
@ -82,45 +94,45 @@ const struct rig_caps adt_200a_caps =
|
|||
.targetable_vfo = RIG_TARGETABLE_NONE,
|
||||
.transceive = 0,
|
||||
.bank_qty = 1,
|
||||
|
||||
|
||||
.chan_desc_sz = ADAT_MEM_DESC_SIZE,
|
||||
.chan_list =
|
||||
{
|
||||
.chan_list =
|
||||
{
|
||||
{ 0, 99, RIG_MTYPE_MEM, ADAT_MEM_CAPS },
|
||||
RIG_CHAN_END,
|
||||
RIG_CHAN_END,
|
||||
},
|
||||
|
||||
.rx_range_list1 =
|
||||
|
||||
.rx_range_list1 =
|
||||
{
|
||||
{ kHz(10), MHz(30), ADT_200A_MODES, -1, -1, ADT_200A_VFO },
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
.tx_range_list1 =
|
||||
.tx_range_list1 =
|
||||
{
|
||||
{ kHz(10), MHz(30), ADT_200A_MODES, mW(100), W(50), ADT_200A_VFO },
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
.rx_range_list2 =
|
||||
.rx_range_list2 =
|
||||
{
|
||||
{ kHz(10), MHz(30), ADT_200A_MODES, -1, -1, ADT_200A_VFO },
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
.tx_range_list2 =
|
||||
|
||||
.tx_range_list2 =
|
||||
{
|
||||
{ kHz(10), MHz(30), ADT_200A_MODES, mW(100), W(50), ADT_200A_VFO },
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
.tuning_steps =
|
||||
.tuning_steps =
|
||||
{
|
||||
{ ADT_200A_MODES, RIG_TS_ANY }, // TODO: get actual list here
|
||||
RIG_TS_END,
|
||||
},
|
||||
|
||||
.filters =
|
||||
|
||||
.filters =
|
||||
{
|
||||
{ RIG_MODE_CW|RIG_MODE_CWR, Hz(50) },
|
||||
{ RIG_MODE_CW|RIG_MODE_CWR, Hz(75) },
|
||||
|
@ -160,42 +172,42 @@ const struct rig_caps adt_200a_caps =
|
|||
{ RIG_MODE_FM, Hz(12000) },
|
||||
RIG_FLT_END,
|
||||
},
|
||||
|
||||
|
||||
// .cfgparams = adt_200a_cfg_params,
|
||||
|
||||
|
||||
.rig_init = adat_init,
|
||||
.rig_cleanup = adat_cleanup,
|
||||
.rig_open = adat_open,
|
||||
.reset = adat_reset,
|
||||
|
||||
|
||||
.set_conf = adat_set_conf,
|
||||
.get_conf = adat_get_conf,
|
||||
|
||||
|
||||
.set_freq = adat_set_freq,
|
||||
.get_freq = adat_get_freq,
|
||||
|
||||
|
||||
.get_level = adat_get_level,
|
||||
.set_level = adat_set_level,
|
||||
|
||||
|
||||
.set_mode = adat_set_mode,
|
||||
.get_mode = adat_get_mode,
|
||||
|
||||
|
||||
.get_vfo = adat_get_vfo,
|
||||
.set_vfo = adat_set_vfo,
|
||||
|
||||
|
||||
.get_ptt = adat_get_ptt,
|
||||
.set_ptt = adat_set_ptt,
|
||||
|
||||
|
||||
.decode_event = adat_handle_event,
|
||||
|
||||
|
||||
.get_info = adat_get_info,
|
||||
|
||||
|
||||
.power2mW = adat_power2mW,
|
||||
.mW2power = adat_mW2power,
|
||||
|
||||
|
||||
.get_powerstat = adat_get_powerstat
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// END OF FILE
|
||||
// END OF FILE
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
|
@ -1,25 +1,38 @@
|
|||
// ---------------------------------------------------------------------------
|
||||
// ADT-200A
|
||||
// ADT-200A
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// adt_200a.h
|
||||
//
|
||||
// Created by Frank Goenninger DG1SBG.
|
||||
// Copyright © 2011, 2012 Frank Goenninger. Creative Commons License.
|
||||
// Copyright © 2011, 2012 Frank Goenninger.
|
||||
//
|
||||
// $Header$
|
||||
// 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.
|
||||
//
|
||||
// This library 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
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
#if !defined( __ADT_200A_INCLUDED__ )
|
||||
#define __ADT_200A_INCLUDED__
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ADAT INCLUDES
|
||||
// ADAT INCLUDES
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#include "adat.h"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ADT-200A USB DEFINITIONS
|
||||
// ADT-200A USB DEFINITIONS
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#define ADT_200A_VENDOR_ID 0x0403
|
||||
|
@ -39,7 +52,7 @@
|
|||
#define ADT_200A_USB_OUTPUT_MAX_PACKET_SIZE 64
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ADT-200A CAPS DEFINITIONS
|
||||
// ADT-200A CAPS DEFINITIONS
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#define ADT_200A_GET_LEVEL \
|
||||
|
@ -99,7 +112,7 @@
|
|||
#define ADT_200A_FUNCS (RIG_FUNC_VOX|RIG_FUNC_NB|RIG_FUNC_NR)
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// END OF FILE
|
||||
// END OF FILE
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#endif
|
||||
|
|
Ładowanie…
Reference in New Issue