kopia lustrzana https://github.com/Hamlib/Hamlib
SM6PPS mods for AOR 5000a
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2155 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.2.6rc1
rodzic
3056681ec4
commit
c830f57da2
|
@ -0,0 +1,27 @@
|
|||
hamlib-1.2.5 aor.c ar5000.c
|
||||
|
||||
2006-10-29
|
||||
|
||||
The previous AR5000 could:
|
||||
- get and set frequency.
|
||||
- read mode if radio were not set to SAH, SAL or SAM.
|
||||
- not set mode. Radio did not accept two commands to be sent at once.
|
||||
- not return VFO-name if rig were set to VFO D or VFO E.
|
||||
- not set VFO D or VFO E.
|
||||
- vfo_op Up and Down works, but radio returns a "?", resulting in "Protocol error".
|
||||
- get_info does not work.
|
||||
- not read AGC-level.
|
||||
|
||||
|
||||
Now, it:
|
||||
- can get and set frequency.
|
||||
- can read and set (all) modes.
|
||||
- still does not support VFO D & E. I probably have not understood how VFO_N(3) and VFO_N(4) are ment to be used :-(
|
||||
- can read AGC-level.
|
||||
|
||||
|
||||
- corrected channel description size from 12 to 8.
|
||||
- filter-list mode/bw rearranged.
|
||||
- list of tuning steps corrected.
|
||||
|
||||
Göran Sandin, SM6PPS
|
64
aor/aor.c
64
aor/aor.c
|
@ -2,7 +2,7 @@
|
|||
* Hamlib AOR backend - main file
|
||||
* Copyright (c) 2000-2005 by Stephane Fillod
|
||||
*
|
||||
* $Id: aor.c,v 1.41 2006-10-15 13:12:54 aa6e Exp $
|
||||
* $Id: aor.c,v 1.42 2006-11-02 15:19:58 aa6e 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
|
||||
|
@ -307,15 +307,34 @@ int aor_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
{
|
||||
struct aor_priv_caps *priv = (struct aor_priv_caps*)rig->caps->priv;
|
||||
char mdbuf[BUFSZ];
|
||||
int mdbuf_len, retval;
|
||||
char mdbuf2[BUFSZ] = "";
|
||||
int mdbuf_len, mdbuf2_len, retval;
|
||||
|
||||
mdbuf_len = priv->format_mode(rig, mdbuf, mode, width);
|
||||
|
||||
strcpy(mdbuf+mdbuf_len, EOM);
|
||||
mdbuf_len += strlen(EOM);
|
||||
|
||||
retval = aor_transaction (rig, mdbuf, mdbuf_len, NULL, NULL);
|
||||
switch (rig->caps->rig_model) {
|
||||
case RIG_MODEL_AR5000:
|
||||
case RIG_MODEL_AR5000A:
|
||||
strncpy(mdbuf2, mdbuf, 3); /* Extract first 'MD' part */
|
||||
mdbuf2_len = strlen(mdbuf2);
|
||||
strcpy(mdbuf2+mdbuf2_len, EOM); /* Add delimiter */
|
||||
mdbuf2_len = strlen(mdbuf2);
|
||||
|
||||
retval = aor_transaction (rig, mdbuf2, mdbuf2_len, NULL, NULL);
|
||||
|
||||
strncpy(mdbuf2, mdbuf + 4, 3); /* Extract first 'BW' part */
|
||||
mdbuf2_len = strlen(mdbuf2);
|
||||
|
||||
retval = aor_transaction (rig, mdbuf2, mdbuf2_len, NULL, NULL);
|
||||
break;
|
||||
|
||||
default:
|
||||
retval = aor_transaction (rig, mdbuf, mdbuf_len, NULL, NULL);
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -384,7 +403,8 @@ int aor_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_AR5000) {
|
||||
if (rig->caps->rig_model == RIG_MODEL_AR5000 ||
|
||||
rig->caps->rig_model == RIG_MODEL_AR5000A) {
|
||||
retval = aor_transaction (rig, "BW" EOM, 3, ackbuf2, &ack2_len);
|
||||
if (retval != RIG_OK)
|
||||
return retval;
|
||||
|
@ -449,7 +469,7 @@ int aor_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
lvl_len = sprintf(lvlbuf, "AT%u" EOM, att);
|
||||
break;
|
||||
}
|
||||
case RIG_LEVEL_AGC: /* AR5000 */
|
||||
case RIG_LEVEL_AGC: /* AR5000 & AR5000A */
|
||||
switch(val.i) {
|
||||
case RIG_AGC_FAST: agc = '0'; break;
|
||||
case RIG_AGC_MEDIUM: agc = '1'; break;
|
||||
|
@ -487,7 +507,7 @@ int aor_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
case RIG_LEVEL_ATT:
|
||||
lvl_len = sprintf(lvlbuf, "AT" EOM);
|
||||
break;
|
||||
case RIG_LEVEL_AGC: /* AR5000 */
|
||||
case RIG_LEVEL_AGC: /* AR5000 & AR5000A */
|
||||
lvl_len = sprintf(lvlbuf, "AC" EOM);
|
||||
break;
|
||||
default:
|
||||
|
@ -528,13 +548,32 @@ int aor_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
case RIG_LEVEL_AGC:
|
||||
if (ack_len < 3 || ackbuf[0] != 'A' || ackbuf[1] != 'C')
|
||||
return -RIG_EPROTO;
|
||||
switch(ackbuf[3]) {
|
||||
case '0': val->i = RIG_AGC_FAST; break;
|
||||
case '1': val->i = RIG_AGC_MEDIUM; break;
|
||||
case '2': val->i = RIG_AGC_SLOW; break;
|
||||
case 'F':
|
||||
default: val->i = RIG_AGC_OFF;
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_AR5000 ||
|
||||
rig->caps->rig_model == RIG_MODEL_AR5000A) {
|
||||
/* AR5000A requires switching to be made on
|
||||
3rd returned character. SM6PPS */
|
||||
|
||||
switch(ackbuf[2]) {
|
||||
case '0': val->i = RIG_AGC_FAST; break;
|
||||
case '1': val->i = RIG_AGC_MEDIUM; break;
|
||||
case '2': val->i = RIG_AGC_SLOW; break;
|
||||
case 'F':
|
||||
default: val->i = RIG_AGC_OFF;
|
||||
}
|
||||
} else {
|
||||
/* Left the switching on 4th position in case
|
||||
models other than AR5000(A) use this. SM6PPS */
|
||||
|
||||
switch(ackbuf[3]) {
|
||||
case '0': val->i = RIG_AGC_FAST; break;
|
||||
case '1': val->i = RIG_AGC_MEDIUM; break;
|
||||
case '2': val->i = RIG_AGC_SLOW; break;
|
||||
case 'F':
|
||||
default: val->i = RIG_AGC_OFF;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1049,6 +1088,7 @@ DECLARE_INITRIG_BACKEND(aor)
|
|||
rig_register(&ar3000a_caps);
|
||||
rig_register(&ar7030_caps);
|
||||
rig_register(&ar3030_caps);
|
||||
rig_register(&ar5000a_caps);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Hamlib AOR backend - main header
|
||||
* Copyright (c) 2000-2005 by Stephane Fillod
|
||||
*
|
||||
* $Id: aor.h,v 1.22 2005-04-20 14:48:49 fillods Exp $
|
||||
* $Id: aor.h,v 1.23 2006-11-02 15:19:58 aa6e 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,5 +72,6 @@ extern const struct rig_caps ar5000_caps;
|
|||
extern const struct rig_caps ar3000a_caps;
|
||||
extern const struct rig_caps ar7030_caps;
|
||||
extern const struct rig_caps ar3030_caps;
|
||||
extern const struct rig_caps ar5000a_caps;
|
||||
|
||||
#endif /* _AOR_H */
|
||||
|
|
561
aor/ar5000.c
561
aor/ar5000.c
|
@ -1,8 +1,9 @@
|
|||
/*
|
||||
* Hamlib AOR backend - AR5000 description
|
||||
*
|
||||
* Copyright (c) 2000-2004 by Stephane Fillod
|
||||
*
|
||||
* $Id: ar5000.c,v 1.10 2006-10-15 19:51:02 aa6e Exp $
|
||||
* $Id: ar5000.c,v 1.11 2006-11-02 15:19:58 aa6e 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
|
||||
|
@ -30,58 +31,43 @@
|
|||
#include "aor.h"
|
||||
|
||||
|
||||
#define AR5000_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_WFM)
|
||||
#define AR5000_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM| \
|
||||
RIG_MODE_WFM|RIG_MODE_SAM|RIG_MODE_SAL|RIG_MODE_SAH)
|
||||
|
||||
#define AR5000_FUNC_ALL (RIG_FUNC_TSQL|RIG_FUNC_ABM|RIG_FUNC_AFC)
|
||||
#define AR5000_FUNC_ALL (RIG_FUNC_TSQL | RIG_FUNC_ABM)
|
||||
|
||||
#define AR5000_LEVEL (RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_RAWSTR)
|
||||
#define AR5000_LEVEL (RIG_LEVEL_ATT | RIG_LEVEL_AGC | RIG_LEVEL_RAWSTR)
|
||||
|
||||
#define AR5000_PARM (RIG_PARM_APO|RIG_PARM_BACKLIGHT|RIG_PARM_BEEP)
|
||||
#define AR5000_PARM (RIG_PARM_NONE)
|
||||
|
||||
#define AR5000_VFO_OPS (RIG_OP_MCL|RIG_OP_UP|RIG_OP_DOWN|RIG_OP_LEFT|RIG_OP_RIGHT)
|
||||
#define AR5000_VFO_OPS (RIG_OP_MCL | RIG_OP_UP | RIG_OP_DOWN)
|
||||
|
||||
#define AR5000_VFO (RIG_VFO_A|RIG_VFO_B)
|
||||
#define AR5000_VFO (RIG_VFO_A | RIG_VFO_B | RIG_VFO_C | RIG_VFO_N(3) | RIG_VFO_N(4))
|
||||
|
||||
/*
|
||||
* Data was obtained from AR5000 pdf on http://www.aoruk.com
|
||||
*/
|
||||
#define dBm2S9(x) ((x)+73)
|
||||
/* As reported with rigctl 'l RAWSTR' for AR5000A S/n: 171218
|
||||
on 7040kHz / CW / 3kHz Bw.
|
||||
|
||||
#define AR5000_REAL_STR_CAL { 33, \
|
||||
{ \
|
||||
{ 0x02, dBm2S9(-120) }, \
|
||||
{ 0x06, dBm2S9(-111) }, \
|
||||
{ 0x0b, dBm2S9(-110) }, \
|
||||
{ 0x14, dBm2S9(-109) }, \
|
||||
{ 0x1d, dBm2S9(-108) }, \
|
||||
{ 0x25, dBm2S9(-107) }, \
|
||||
{ 0x2b, dBm2S9(-106) }, \
|
||||
{ 0x32, dBm2S9(-105) }, \
|
||||
{ 0x38, dBm2S9(-104) }, \
|
||||
{ 0x3d, dBm2S9(-103) }, \
|
||||
{ 0x43, dBm2S9(-102) }, \
|
||||
{ 0x49, dBm2S9(-101) }, \
|
||||
{ 0x4e, dBm2S9(-100) }, \
|
||||
{ 0x63, dBm2S9(-95) }, \
|
||||
{ 0x71, dBm2S9(-90) }, \
|
||||
{ 0x7f, dBm2S9(-85) }, \
|
||||
{ 0x8b, dBm2S9(-80) }, \
|
||||
{ 0x96, dBm2S9(-75) }, \
|
||||
{ 0xa0, dBm2S9(-70) }, \
|
||||
{ 0xaa, dBm2S9(-65) }, \
|
||||
{ 0xb3, dBm2S9(-60) }, \
|
||||
{ 0xbd, dBm2S9(-55) }, \
|
||||
{ 0xc6, dBm2S9(-50) }, \
|
||||
{ 0xce, dBm2S9(-45) }, \
|
||||
{ 0xd7, dBm2S9(-40) }, \
|
||||
{ 0xe0, dBm2S9(-35) }, \
|
||||
{ 0xe8, dBm2S9(-30) }, \
|
||||
{ 0xf1, dBm2S9(-25) }, \
|
||||
{ 0xf8, dBm2S9(-20) }, \
|
||||
{ 0xfa, dBm2S9(-15) }, \
|
||||
{ 0xfd, dBm2S9(0) } \
|
||||
The data available on http://www.aoruk.com did not match very well on HF */
|
||||
#define AR5000_STR_CAL { 16, { \
|
||||
{ 0, -60 }, \
|
||||
{ 3, -48 }, \
|
||||
{ 14, -42 }, \
|
||||
{ 26, -36 }, \
|
||||
{ 34, -30 }, \
|
||||
{ 42, -24 }, \
|
||||
{ 52, -18 }, \
|
||||
{ 62, -12 }, \
|
||||
{ 74, -6 }, \
|
||||
{ 87, 0 }, \
|
||||
{ 101, 10 }, \
|
||||
{ 117, 20 }, \
|
||||
{ 135, 30 }, \
|
||||
{ 152, 40 }, \
|
||||
{ 202, 50 }, \
|
||||
{ 255, 60 }, \
|
||||
} }
|
||||
|
||||
|
||||
#define AR5000_MEM_CAP { \
|
||||
.freq = 1, \
|
||||
.mode = 1, \
|
||||
|
@ -90,7 +76,7 @@
|
|||
.tuning_step = 1, \
|
||||
.channel_desc = 1, \
|
||||
.flags = 1, \
|
||||
.levels = RIG_LEVEL_ATT|RIG_LEVEL_AGC, \
|
||||
.levels = RIG_LEVEL_ATT | RIG_LEVEL_AGC, \
|
||||
.funcs = RIG_FUNC_ABM, \
|
||||
}
|
||||
|
||||
|
@ -99,10 +85,10 @@ static int format5k_mode(RIG *rig, char *buf, rmode_t mode, pbwidth_t width);
|
|||
static int parse5k_aor_mode(RIG *rig, char aormode, char aorwidth, rmode_t *mode, pbwidth_t *width);
|
||||
|
||||
static const struct aor_priv_caps ar5k_priv_caps = {
|
||||
.format_mode = format5k_mode,
|
||||
.parse_aor_mode = parse5k_aor_mode,
|
||||
.bank_base1 = '0',
|
||||
.bank_base2 = '0',
|
||||
.format_mode = format5k_mode,
|
||||
.parse_aor_mode = parse5k_aor_mode,
|
||||
.bank_base1 = '0',
|
||||
.bank_base2 = '0',
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -115,134 +101,275 @@ static const struct aor_priv_caps ar5k_priv_caps = {
|
|||
* TODO: retrieve BW info, and rest of commands
|
||||
*/
|
||||
const struct rig_caps ar5000_caps = {
|
||||
.rig_model = RIG_MODEL_AR5000,
|
||||
.model_name = "AR5000",
|
||||
.mfg_name = "AOR",
|
||||
.version = BACKEND_VER,
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_BETA,
|
||||
.rig_type = RIG_TYPE_SCANNER,
|
||||
.ptt_type = RIG_PTT_NONE,
|
||||
.dcd_type = RIG_DCD_RIG,
|
||||
.port_type = RIG_PORT_SERIAL,
|
||||
.serial_rate_min = 4800,
|
||||
.serial_rate_max = 19200,
|
||||
.serial_data_bits = 8,
|
||||
.serial_stop_bits = 2,
|
||||
.serial_parity = RIG_PARITY_NONE,
|
||||
.serial_handshake = RIG_HANDSHAKE_XONXOFF,
|
||||
.write_delay = 0,
|
||||
.post_write_delay = 0,
|
||||
.timeout = 200,
|
||||
.retry = 3,
|
||||
.has_get_func = RIG_FUNC_NONE,
|
||||
.has_set_func = AR5000_FUNC_ALL,
|
||||
.has_get_level = AR5000_LEVEL,
|
||||
.has_set_level = RIG_LEVEL_SET(AR5000_LEVEL),
|
||||
.has_get_parm = RIG_PARM_NONE,
|
||||
.has_set_parm = RIG_PARM_NONE, /* FIXME: parms */
|
||||
.level_gran = {}, /* FIXME: granularity */
|
||||
.parm_gran = {},
|
||||
.ctcss_list = NULL, /* FIXME: CTCSS list */
|
||||
.dcs_list = NULL,
|
||||
.preamp = { RIG_DBLST_END, },
|
||||
.attenuator = { 10, 20, RIG_DBLST_END, },
|
||||
.max_rit = Hz(0),
|
||||
.max_xit = Hz(0),
|
||||
.max_ifshift = Hz(0),
|
||||
.targetable_vfo = 0,
|
||||
.transceive = RIG_TRN_RIG,
|
||||
.bank_qty = 10,
|
||||
.chan_desc_sz = 12,
|
||||
.vfo_ops = AR5000_VFO_OPS,
|
||||
.str_cal = AR5000_REAL_STR_CAL,
|
||||
.rig_model = RIG_MODEL_AR5000,
|
||||
.model_name = "AR5000",
|
||||
.mfg_name = "AOR",
|
||||
.version = BACKEND_VER,
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_BETA,
|
||||
.rig_type = RIG_TYPE_SCANNER,
|
||||
.ptt_type = RIG_PTT_NONE,
|
||||
.dcd_type = RIG_DCD_RIG,
|
||||
.port_type = RIG_PORT_SERIAL,
|
||||
.serial_rate_min = 4800,
|
||||
.serial_rate_max = 19200,
|
||||
.serial_data_bits = 8,
|
||||
.serial_stop_bits = 2,
|
||||
.serial_parity = RIG_PARITY_NONE,
|
||||
.serial_handshake = RIG_HANDSHAKE_XONXOFF,
|
||||
.write_delay = 0,
|
||||
.post_write_delay = 0,
|
||||
.timeout = 200,
|
||||
.retry = 3,
|
||||
.has_get_func = RIG_FUNC_NONE,
|
||||
.has_set_func = AR5000_FUNC_ALL,
|
||||
.has_get_level = AR5000_LEVEL,
|
||||
.has_set_level = RIG_LEVEL_SET(AR5000_LEVEL),
|
||||
.has_get_parm = RIG_PARM_NONE,
|
||||
.has_set_parm = RIG_PARM_NONE, /* FIXME: parms */
|
||||
.level_gran = {}, /* FIXME: granularity */
|
||||
.parm_gran = {},
|
||||
.ctcss_list = NULL, /* FIXME: CTCSS list */
|
||||
.dcs_list = NULL,
|
||||
.preamp = { RIG_DBLST_END, },
|
||||
.attenuator = { 10, 20, RIG_DBLST_END, },
|
||||
.max_rit = Hz(0),
|
||||
.max_xit = Hz(0),
|
||||
.max_ifshift = Hz(0),
|
||||
.targetable_vfo = 0,
|
||||
.transceive = RIG_TRN_RIG,
|
||||
.bank_qty = 10,
|
||||
.chan_desc_sz = 8,
|
||||
.vfo_ops = AR5000_VFO_OPS,
|
||||
.str_cal = AR5000_STR_CAL,
|
||||
|
||||
.chan_list = {
|
||||
.chan_list = {
|
||||
{ 0, 999, RIG_MTYPE_MEM, AR5000_MEM_CAP },
|
||||
RIG_CHAN_END, },
|
||||
|
||||
.rx_range_list1 = {
|
||||
{kHz(10),MHz(2600),AR5000_MODES,-1,-1,AR5000_VFO},
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
.tx_range_list1 = { RIG_FRNG_END, },
|
||||
|
||||
.rx_range_list2 = {
|
||||
{kHz(10),MHz(2600),AR5000_MODES,-1,-1,AR5000_VFO},
|
||||
RIG_FRNG_END,
|
||||
}, /* rx range */
|
||||
|
||||
.tx_range_list2 = { RIG_FRNG_END, }, /* no tx range, this is a scanner! */
|
||||
|
||||
.tuning_steps = {
|
||||
{AR5000_MODES,1},
|
||||
{AR5000_MODES,10},
|
||||
{AR5000_MODES,50},
|
||||
{AR5000_MODES,100},
|
||||
{AR5000_MODES,500},
|
||||
{AR5000_MODES,kHz(1)},
|
||||
{AR5000_MODES,kHz(5)},
|
||||
{AR5000_MODES,kHz(6.25)},
|
||||
{AR5000_MODES,kHz(9)},
|
||||
{AR5000_MODES,kHz(10)},
|
||||
{AR5000_MODES,kHz(12.5)},
|
||||
{AR5000_MODES,kHz(20)},
|
||||
{AR5000_MODES,kHz(25)},
|
||||
{AR5000_MODES,kHz(30)},
|
||||
{AR5000_MODES,kHz(50)},
|
||||
{AR5000_MODES,kHz(100)},
|
||||
{AR5000_MODES,kHz(500)},
|
||||
#if 0
|
||||
{AR5000_MODES,0}, /* any tuning step */
|
||||
#endif
|
||||
RIG_TS_END,
|
||||
},
|
||||
/* mode/filter list, .remember = order matters! */
|
||||
.filters = {
|
||||
{RIG_MODE_SSB|RIG_MODE_SAL|RIG_MODE_SAH|RIG_MODE_CW, kHz(3)},
|
||||
{RIG_MODE_CW, Hz(500)}, /* narrow */
|
||||
{RIG_MODE_AM|RIG_MODE_SAM, kHz(6)},
|
||||
{RIG_MODE_AM|RIG_MODE_SAM, kHz(3)}, /* narrow */
|
||||
{RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_SAM, kHz(15)},
|
||||
{RIG_MODE_FM, kHz(6)}, /* narrow */
|
||||
{RIG_MODE_FM, kHz(30)}, /* wide */
|
||||
{RIG_MODE_WFM, kHz(110)},
|
||||
{RIG_MODE_WFM, kHz(30)}, /* narrow */
|
||||
{RIG_MODE_WFM, kHz(220)}, /* wide */
|
||||
RIG_FLT_END,
|
||||
},
|
||||
|
||||
.priv = (void*)&ar5k_priv_caps,
|
||||
|
||||
.rig_init = NULL,
|
||||
.rig_cleanup = NULL,
|
||||
.rig_open = NULL,
|
||||
.rig_close = aor_close,
|
||||
|
||||
.set_freq = aor_set_freq,
|
||||
.get_freq = aor_get_freq,
|
||||
.set_mode = aor_set_mode,
|
||||
.get_mode = aor_get_mode,
|
||||
.set_vfo = aor_set_vfo,
|
||||
.get_vfo = aor_get_vfo,
|
||||
|
||||
.set_level = aor_set_level,
|
||||
.get_level = aor_get_level,
|
||||
.get_dcd = aor_get_dcd,
|
||||
|
||||
.set_ts = aor_set_ts,
|
||||
.set_powerstat = aor_set_powerstat,
|
||||
.vfo_op = aor_vfo_op,
|
||||
.get_info = aor_get_info,
|
||||
|
||||
.set_mem = aor_set_mem,
|
||||
.get_mem = aor_get_mem,
|
||||
.set_bank = aor_set_bank,
|
||||
|
||||
.set_channel = aor_set_channel,
|
||||
.get_channel = aor_get_channel,
|
||||
|
||||
.get_chan_all_cb = aor_get_chan_all_cb,
|
||||
};
|
||||
|
||||
/*
|
||||
* ar5000a rig capabilities.
|
||||
* Notice that some rigs share the same functions.
|
||||
* Also this struct is READONLY!
|
||||
*
|
||||
* part of info from http://www.aoruk.com/5000.htm
|
||||
*
|
||||
* TODO: retrieve BW info, and rest of commands
|
||||
*/
|
||||
const struct rig_caps ar5000a_caps = {
|
||||
.rig_model = RIG_MODEL_AR5000A,
|
||||
.model_name = "AR5000A",
|
||||
.mfg_name = "AOR",
|
||||
.version = BACKEND_VER,
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_ALPHA,
|
||||
.rig_type = RIG_TYPE_SCANNER,
|
||||
.ptt_type = RIG_PTT_NONE,
|
||||
.dcd_type = RIG_DCD_RIG,
|
||||
.port_type = RIG_PORT_SERIAL,
|
||||
.serial_rate_min = 4800,
|
||||
.serial_rate_max = 19200,
|
||||
.serial_data_bits = 8,
|
||||
.serial_stop_bits = 2,
|
||||
.serial_parity = RIG_PARITY_NONE,
|
||||
.serial_handshake = RIG_HANDSHAKE_XONXOFF,
|
||||
.write_delay = 0,
|
||||
.post_write_delay = 0,
|
||||
.timeout = 200,
|
||||
.retry = 3,
|
||||
.has_get_func = RIG_FUNC_NONE,
|
||||
.has_set_func = AR5000_FUNC_ALL,
|
||||
.has_get_level = AR5000_LEVEL,
|
||||
.has_set_level = RIG_LEVEL_SET(AR5000_LEVEL),
|
||||
.has_get_parm = RIG_PARM_NONE,
|
||||
.has_set_parm = RIG_PARM_NONE, /* FIXME: parms */
|
||||
.level_gran = {}, /* FIXME: granularity */
|
||||
.parm_gran = {},
|
||||
.ctcss_list = NULL, /* FIXME: CTCSS list */
|
||||
.dcs_list = NULL,
|
||||
.preamp = { RIG_DBLST_END, },
|
||||
.attenuator = { 10, 20, RIG_DBLST_END, },
|
||||
.max_rit = Hz(0),
|
||||
.max_xit = Hz(0),
|
||||
.max_ifshift = Hz(0),
|
||||
.targetable_vfo = 0,
|
||||
.transceive = RIG_TRN_RIG,
|
||||
.bank_qty = 10,
|
||||
.chan_desc_sz = 8,
|
||||
.vfo_ops = AR5000_VFO_OPS,
|
||||
.str_cal = AR5000_STR_CAL,
|
||||
|
||||
.chan_list = {
|
||||
{ 0, 999, RIG_MTYPE_MEM, AR5000_MEM_CAP },
|
||||
RIG_CHAN_END, },
|
||||
|
||||
|
||||
.rx_range_list1 = {
|
||||
{kHz(10),MHz(2600),AR5000_MODES,-1,-1,AR5000_VFO},
|
||||
.rx_range_list1 = {
|
||||
{kHz(10),MHz(3000),AR5000_MODES,-1,-1,AR5000_VFO},
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
.tx_range_list1 = { RIG_FRNG_END, },
|
||||
.tx_range_list1 = { RIG_FRNG_END, },
|
||||
|
||||
.rx_range_list2 = {
|
||||
{kHz(10),MHz(2600),AR5000_MODES,-1,-1,AR5000_VFO},
|
||||
.rx_range_list2 = {
|
||||
{kHz(10),MHz(3000),AR5000_MODES,-1,-1,AR5000_VFO},
|
||||
RIG_FRNG_END,
|
||||
}, /* rx range */
|
||||
.tx_range_list2 = { RIG_FRNG_END, }, /* no tx range, this is a scanner! */
|
||||
}, /* rx range */
|
||||
.tx_range_list2 = { RIG_FRNG_END, }, /* no tx range, this is a scanner! */
|
||||
|
||||
.tuning_steps = {
|
||||
{AR5000_MODES,50},
|
||||
{AR5000_MODES,100},
|
||||
{AR5000_MODES,200},
|
||||
{AR5000_MODES,500},
|
||||
{AR5000_MODES,kHz(1)},
|
||||
{AR5000_MODES,kHz(2)},
|
||||
{AR5000_MODES,kHz(5)},
|
||||
{AR5000_MODES,kHz(6.25)},
|
||||
{AR5000_MODES,kHz(9)},
|
||||
{AR5000_MODES,kHz(10)},
|
||||
{AR5000_MODES,12500},
|
||||
{AR5000_MODES,kHz(20)},
|
||||
{AR5000_MODES,kHz(25)},
|
||||
{AR5000_MODES,kHz(30)},
|
||||
{AR5000_MODES,kHz(50)},
|
||||
{AR5000_MODES,kHz(100)},
|
||||
{AR5000_MODES,kHz(200)},
|
||||
{AR5000_MODES,kHz(250)},
|
||||
{AR5000_MODES,kHz(500)},
|
||||
.tuning_steps = {
|
||||
{AR5000_MODES,1},
|
||||
{AR5000_MODES,10},
|
||||
{AR5000_MODES,50},
|
||||
{AR5000_MODES,100},
|
||||
{AR5000_MODES,500},
|
||||
{AR5000_MODES,kHz(1)},
|
||||
{AR5000_MODES,kHz(5)},
|
||||
{AR5000_MODES,kHz(6.25)},
|
||||
{AR5000_MODES,kHz(9)},
|
||||
{AR5000_MODES,kHz(10)},
|
||||
{AR5000_MODES,kHz(12.5)},
|
||||
{AR5000_MODES,kHz(20)},
|
||||
{AR5000_MODES,kHz(25)},
|
||||
{AR5000_MODES,kHz(30)},
|
||||
{AR5000_MODES,kHz(50)},
|
||||
{AR5000_MODES,kHz(100)},
|
||||
{AR5000_MODES,kHz(500)},
|
||||
#if 0
|
||||
{AR5000_MODES,0}, /* any tuning step */
|
||||
{AR5000_MODES,0}, /* any tuning step */
|
||||
#endif
|
||||
RIG_TS_END,
|
||||
},
|
||||
RIG_TS_END,
|
||||
},
|
||||
/* mode/filter list, .remember = order matters! */
|
||||
.filters = {
|
||||
/* mode/filter list, .remember = order matters! */
|
||||
{RIG_MODE_SSB|RIG_MODE_CW, kHz(3)},
|
||||
{RIG_MODE_CW, Hz(500)},
|
||||
{RIG_MODE_FM|RIG_MODE_AM, kHz(15)},
|
||||
{RIG_MODE_FM|RIG_MODE_AM, kHz(6)}, /* narrow */
|
||||
{RIG_MODE_FM|RIG_MODE_AM, kHz(40)}, /* wide */
|
||||
{RIG_MODE_WFM, kHz(220)},
|
||||
{RIG_MODE_WFM, kHz(120)},
|
||||
RIG_FLT_END,
|
||||
},
|
||||
.filters = {
|
||||
{RIG_MODE_SSB|RIG_MODE_SAL|RIG_MODE_SAH|RIG_MODE_CW, kHz(3)},
|
||||
{RIG_MODE_CW, Hz(500)}, /* narrow */
|
||||
{RIG_MODE_AM|RIG_MODE_SAM, kHz(6)},
|
||||
{RIG_MODE_AM|RIG_MODE_SAM, kHz(3)}, /* narrow */
|
||||
{RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_SAM, kHz(15)},
|
||||
{RIG_MODE_FM, kHz(6)}, /* narrow */
|
||||
{RIG_MODE_FM, kHz(30)}, /* wide */
|
||||
{RIG_MODE_WFM, kHz(110)},
|
||||
{RIG_MODE_WFM, kHz(30)}, /* narrow */
|
||||
{RIG_MODE_WFM, kHz(220)}, /* wide */
|
||||
RIG_FLT_END,
|
||||
},
|
||||
|
||||
.priv = (void*)&ar5k_priv_caps,
|
||||
.priv = (void*)&ar5k_priv_caps,
|
||||
|
||||
.rig_init = NULL,
|
||||
.rig_cleanup = NULL,
|
||||
.rig_open = NULL,
|
||||
.rig_close = aor_close,
|
||||
.rig_init = NULL,
|
||||
.rig_cleanup = NULL,
|
||||
.rig_open = NULL,
|
||||
.rig_close = aor_close,
|
||||
|
||||
.set_freq = aor_set_freq,
|
||||
.get_freq = aor_get_freq,
|
||||
.set_mode = aor_set_mode,
|
||||
.get_mode = aor_get_mode,
|
||||
.set_vfo = aor_set_vfo,
|
||||
.get_vfo = aor_get_vfo,
|
||||
.set_freq = aor_set_freq,
|
||||
.get_freq = aor_get_freq,
|
||||
.set_mode = aor_set_mode,
|
||||
.get_mode = aor_get_mode,
|
||||
.set_vfo = aor_set_vfo,
|
||||
.get_vfo = aor_get_vfo,
|
||||
|
||||
.set_level = aor_set_level,
|
||||
.get_level = aor_get_level,
|
||||
.get_dcd = aor_get_dcd,
|
||||
.set_level = aor_set_level,
|
||||
.get_level = aor_get_level,
|
||||
.get_dcd = aor_get_dcd,
|
||||
|
||||
.set_ts = aor_set_ts,
|
||||
.set_powerstat = aor_set_powerstat,
|
||||
.vfo_op = aor_vfo_op,
|
||||
.get_info = aor_get_info,
|
||||
.set_ts = aor_set_ts,
|
||||
.set_powerstat = aor_set_powerstat,
|
||||
.vfo_op = aor_vfo_op,
|
||||
.get_info = aor_get_info,
|
||||
|
||||
.set_mem = aor_set_mem,
|
||||
.get_mem = aor_get_mem,
|
||||
.set_bank = aor_set_bank,
|
||||
.set_mem = aor_set_mem,
|
||||
.get_mem = aor_get_mem,
|
||||
.set_bank = aor_set_bank,
|
||||
|
||||
.set_channel = aor_set_channel,
|
||||
.get_channel = aor_get_channel,
|
||||
.set_channel = aor_set_channel,
|
||||
.get_channel = aor_get_channel,
|
||||
|
||||
.get_chan_all_cb = aor_get_chan_all_cb,
|
||||
.get_chan_all_cb = aor_get_chan_all_cb,
|
||||
|
||||
};
|
||||
|
||||
|
@ -254,79 +381,89 @@ const struct rig_caps ar5000_caps = {
|
|||
/*
|
||||
* modes in use by the "MD" command of AR5000
|
||||
*/
|
||||
#define AR5K_FM '0'
|
||||
#define AR5K_AM '1'
|
||||
#define AR5K_LSB '2'
|
||||
#define AR5K_USB '3'
|
||||
#define AR5K_CW '4'
|
||||
#define AR5K_FM '0'
|
||||
#define AR5K_AM '1'
|
||||
#define AR5K_LSB '2'
|
||||
#define AR5K_USB '3'
|
||||
#define AR5K_CW '4'
|
||||
#define AR5K_SAM '5'
|
||||
#define AR5K_SAL '6'
|
||||
#define AR5K_SAH '7'
|
||||
|
||||
int format5k_mode(RIG *rig, char *buf, rmode_t mode, pbwidth_t width)
|
||||
{
|
||||
int aormode, aorwidth;
|
||||
int aormode, aorwidth;
|
||||
|
||||
switch (mode) {
|
||||
case RIG_MODE_AM: aormode = AR5K_AM; break;
|
||||
switch (mode) {
|
||||
case RIG_MODE_AM: aormode = AR5K_AM; break;
|
||||
case RIG_MODE_WFM:
|
||||
case RIG_MODE_FM: aormode = AR5K_FM; break;
|
||||
case RIG_MODE_LSB: aormode = AR5K_LSB; break;
|
||||
case RIG_MODE_USB: aormode = AR5K_USB; break;
|
||||
case RIG_MODE_CW: aormode = AR5K_CW; break;
|
||||
case RIG_MODE_FM: aormode = AR5K_FM; break;
|
||||
case RIG_MODE_LSB: aormode = AR5K_LSB; break;
|
||||
case RIG_MODE_SSB:
|
||||
case RIG_MODE_USB: aormode = AR5K_USB; break;
|
||||
case RIG_MODE_CW: aormode = AR5K_CW; break;
|
||||
case RIG_MODE_SAM: aormode = AR5K_SAM; break;
|
||||
case RIG_MODE_SAL: aormode = AR5K_SAL; break;
|
||||
case RIG_MODE_SAH: aormode = AR5K_SAH; break;
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR,"%s: unsupported mode %d\n",
|
||||
__FUNCTION__, mode);
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
rig_debug(RIG_DEBUG_ERR,"%s: unsupported mode %d\n",
|
||||
__FUNCTION__, mode);
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = rig_passband_normal(rig, mode);
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = rig_passband_normal(rig, mode);
|
||||
|
||||
switch (width) {
|
||||
case 500: aorwidth = '0'; break;
|
||||
case s_kHz(3): aorwidth = '1'; break;
|
||||
case s_kHz(6): aorwidth = '2'; break;
|
||||
case s_kHz(15): aorwidth = '3'; break;
|
||||
case s_kHz(40): aorwidth = '4'; break;
|
||||
case s_kHz(110): aorwidth = '5'; break;
|
||||
case s_kHz(220): aorwidth = '6'; break;
|
||||
switch (width) {
|
||||
case 500: aorwidth = '0'; break;
|
||||
case s_kHz(3): aorwidth = '1'; break;
|
||||
case s_kHz(6): aorwidth = '2'; break;
|
||||
case s_kHz(15): aorwidth = '3'; break;
|
||||
case s_kHz(30): aorwidth = '4'; break;
|
||||
case s_kHz(110): aorwidth = '5'; break;
|
||||
case s_kHz(220): aorwidth = '6'; break;
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR,"%s: unsupported width %d\n",
|
||||
__FUNCTION__, width);
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
rig_debug(RIG_DEBUG_ERR,"%s: unsupported width %d\n",
|
||||
__FUNCTION__, width);
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
return sprintf(buf, "MD%c BW%c", aormode, aorwidth);
|
||||
return sprintf(buf, "MD%c BW%c", aormode, aorwidth);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int parse5k_aor_mode(RIG *rig, char aormode, char aorwidth, rmode_t *mode, pbwidth_t *width)
|
||||
{
|
||||
switch (aormode) {
|
||||
case AR5K_FM: *mode = RIG_MODE_FM; break;
|
||||
case AR5K_AM: *mode = RIG_MODE_AM; break;
|
||||
case AR5K_LSB: *mode = RIG_MODE_LSB; break;
|
||||
case AR5K_USB: *mode = RIG_MODE_USB; break;
|
||||
case AR5K_CW: *mode = RIG_MODE_CW; break;
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR,"%s: unsupported mode '%c'\n",
|
||||
__FUNCTION__, aormode);
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
switch (aorwidth) {
|
||||
case '0': *width = 500; break;
|
||||
case '1': *width = s_kHz(3); break;
|
||||
case '2': *width = s_kHz(6); break;
|
||||
case '3': *width = s_kHz(15); break;
|
||||
case '4': *width = s_kHz(40); break;
|
||||
case '5': *width = s_kHz(110); break;
|
||||
case '6': *width = s_kHz(220); break;
|
||||
switch (aormode) {
|
||||
case AR5K_FM: *mode = RIG_MODE_FM; break;
|
||||
case AR5K_AM: *mode = RIG_MODE_AM; break;
|
||||
case AR5K_LSB: *mode = RIG_MODE_LSB; break;
|
||||
case AR5K_USB: *mode = RIG_MODE_USB; break;
|
||||
case AR5K_CW: *mode = RIG_MODE_CW; break;
|
||||
case AR5K_SAM: *mode = RIG_MODE_SAM; break;
|
||||
case AR5K_SAL: *mode = RIG_MODE_SAL; break;
|
||||
case AR5K_SAH: *mode = RIG_MODE_SAH; break;
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR,"%s: unsupported width %d\n",
|
||||
__FUNCTION__, aorwidth);
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
rig_debug(RIG_DEBUG_ERR,"%s: unsupported mode '%c'\n",
|
||||
__FUNCTION__, aormode);
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
switch (aorwidth) {
|
||||
case '0': *width = 500; break;
|
||||
case '1': *width = s_kHz(3); break;
|
||||
case '2': *width = s_kHz(6); break;
|
||||
case '3': *width = s_kHz(15); break;
|
||||
case '4': *width = s_kHz(30); break;
|
||||
case '5': *width = s_kHz(110); break;
|
||||
case '6': *width = s_kHz(220); break;
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR,"%s: unsupported width %d\n",
|
||||
__FUNCTION__, aorwidth);
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Hamlib Interface - API header
|
||||
* Copyright (c) 2000-2005 by Stephane Fillod and Frank Singleton
|
||||
*
|
||||
* $Id: rig.h,v 1.118 2006-10-28 03:49:05 aa6e Exp $
|
||||
* $Id: rig.h,v 1.119 2006-11-02 15:19:58 aa6e 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
|
||||
|
@ -720,7 +720,10 @@ typedef enum {
|
|||
RIG_MODE_PKTFM = (1<<12),/*!< Packet/Digital FM mode (dedicated port) */
|
||||
RIG_MODE_ECSSUSB = (1<<13),/*!< Exalted Carrier Single Sideband USB */
|
||||
RIG_MODE_ECSSLSB = (1<<14),/*!< Exalted Carrier Single Sideband LSB */
|
||||
RIG_MODE_FAX = (1<<15) /*!< Facsimile Mode */
|
||||
RIG_MODE_FAX = (1<<15),/*!< Facsimile Mode */
|
||||
RIG_MODE_SAM = (1<<16),/*!< Synchronous AM double sideband */
|
||||
RIG_MODE_SAL = (1<<17),/*!< Synchronous AM lower sideband */
|
||||
RIG_MODE_SAH = (1<<18) /*!< Synchronous AM upper (higher) sideband */
|
||||
|
||||
} rmode_t;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Hamlib Interface - list of known rigs
|
||||
* Copyright (c) 2000-2005 by Stephane Fillod and Frank Singleton
|
||||
*
|
||||
* $Id: riglist.h,v 1.58 2005-11-17 22:17:38 fillods Exp $
|
||||
* $Id: riglist.h,v 1.59 2006-11-02 15:19:58 aa6e 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
|
||||
|
@ -222,6 +222,7 @@
|
|||
#define RIG_MODEL_SDU5500 RIG_MAKE_MODEL(RIG_AOR, 11)
|
||||
#define RIG_MODEL_SDU5000 RIG_MAKE_MODEL(RIG_AOR, 12)
|
||||
#define RIG_MODEL_AR8600 RIG_MAKE_MODEL(RIG_AOR, 13)
|
||||
#define RIG_MODEL_AR5000A RIG_MAKE_MODEL(RIG_AOR, 14)
|
||||
|
||||
/*
|
||||
* JRC
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Hamlib Interface - toolbox
|
||||
* Copyright (c) 2000-2005 by Stephane Fillod
|
||||
*
|
||||
* $Id: misc.c,v 1.40 2006-10-15 00:27:51 aa6e Exp $
|
||||
* $Id: misc.c,v 1.41 2006-11-02 15:19:58 aa6e 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
|
||||
|
@ -258,6 +258,9 @@ static struct {
|
|||
{ RIG_MODE_ECSSLSB, "ECSSLSB" },
|
||||
{ RIG_MODE_FAX, "FAX" },
|
||||
{ RIG_MODE_NONE, "" },
|
||||
{ RIG_MODE_SAM, "SAM" },
|
||||
{ RIG_MODE_SAL, "SAL" },
|
||||
{ RIG_MODE_SAH, "SAH" },
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Ładowanie…
Reference in New Issue