10000 2020-02-05 Patches by mdblack98 · Pull Request #193 · Hamlib/Hamlib · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

2020-02-05 Patches #193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Feb 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
bece609
Remove noisy debug from misc.c -- showed up rigctld -l for some odd r…
mdblack98 Jan 24, 2020
493f527
Remove unneeded close in rigctld, rotctld, ampctld
mdblack98 Jan 26, 2020
2e50bb2
Add GPIO to rigctld.c
mdblack98 Jan 26, 2020
f926868
Add GPION to rigctld.c
mdblack98 Jan 26, 2020
89d4bf3
Add CM108 and GPIO DCD types to rigctld.c
mdblack98 Jan 26, 2020
18c27fc
Revert "Add CM108 and GPIO DCD types to rigctld.c"
mdblack98 Jan 27, 2020
b19ebaa
Revert "Add GPION to rigctld.c"
mdblack98 Jan 27, 2020
174c26a
Revert "Add GPIO to rigctld.c"
mdblack98 Jan 27, 2020
2b95b6b
Revert "Remove unneeded close in rigctld, rotctld, ampctld"
mdblack98 Jan 27, 2020
87ff07d
Merge branch 'master' of https://github.com/Hamlib/Hamlib
mdblack98 Jan 27, 2020
203c94f
Fix get_ant/set_ant commands to work with 1 or 2 byte responses in ic…
mdblack98 Jan 27, 2020
6edc9e0
Change port for ampctl to 4531 to match other code
mdblack98 Jan 28, 2020
2e41b8e
Change ic785x priv_caps to non-const as we are putting in some dynami…
mdblack98 Jan 28, 2020
d0ebb52
Removed some debug
mdblack98 Jan 28, 2020
c2820e4
Remove const from priv_caps in icom rig backends
mdblack98 Jan 28, 2020
42108f9
Change icom_get_usb_echo_off to use 0x03 instead of 0x19 since not al…
mdblack98 Jan 28, 2020
6021578
Changes to get antenna calls working in rigctld
mdblack98 Jan 30, 2020
fd965de
Add ant_count to icom.h
mdblack98 Jan 31, 2020
12e93dd
Fix antenna count in icom.c
mdblack98 Jan 31, 2020
7e8938a
Changed y command to now use mandatory antenna argument
mdblack98 Feb 2, 2020
28dad4f
Bump up priv_cap->ant_count before calling rig_get_ant
mdblack98 Feb 2, 2020
8e63c6a
Remove get_anant_count as 7851 does not have ability to determine # o…
mdblack98 Feb 3, 2020
bf5180d
Add antack_len and ant_count to all Icom rigs that have get/set_ant
mdblack98 Feb 3, 2020
6d53f7d
Standardize Icom version numbers
mdblack98 Feb 3, 2020
de63700
Removed debug
mdblack98 Feb 3, 2020
2ff37e4
Add some antenna info to Icom README
mdblack98 Feb 3, 2020
6066b66
remove ant_count from icom_rig_init..causes segfault
mdblack98 Feb 4, 2020
864fe6f
Update icom priv_data entries to standardize them
mdblack98 Feb 4, 2020
f9d4755
Fix rig_get_ant to use bit settings
mdblack98 Feb 4, 2020
8958e14
Fix Icom get_ant to use 0x12 without option to ask for specific antenna
mdblack98 Feb 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions c++/rigclass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -540,9 +540,9 @@ void Rig::setAnt(value_t option, ant_t ant, vfo_t vfo)
CHECK_RIG(rig_set_ant(theRig, vfo, ant, option));
}

ant_t Rig::getAnt(value_t &option, ant_t &ant, vfo_t vfo)
ant_t Rig::getAnt(value_t &option, ant_t ant, ant_t &ant_curr, vfo_t vfo)
{
CHECK_RIG( rig_get_ant(theRig, vfo, &ant, &option) );
CHECK_RIG( rig_get_ant(theRig, vfo, ant, &ant_curr, &option) );

return ant;
}
Expand Down
6 changes: 3 additions & 3 deletions dummy/dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1346,13 +1346,13 @@ static int dummy_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
}


static int dummy_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
static int dummy_get_ant(RIG *rig, vfo_t vfo, ant_t ant, ant_t *ant_curr, value_t *option)
{
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
channel_t *curr = priv->curr;

rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
*ant = curr->ant;
rig_debug(RIG_DEBUG_VERBOSE, "%s called, ant=0x%02x\n", __func__, ant);
*ant_curr = curr->ant;
option->i = priv->ant_option;

return RIG_OK;
Expand Down
35 changes: 30 additions & 5 deletions dummy/netrigctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1736,14 +1736,24 @@ static int netrigctl_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
char cmd[CMD_MAX];
char buf[BUF_MAX];
char vfostr[6] = "";
int i_ant = 0;

rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
rig_debug(RIG_DEBUG_VERBOSE, "%s called, ant=0x%02x, option=%d\n", __func__, ant, option.i);

switch(ant) {
case RIG_ANT_1: i_ant = 0; break;
case RIG_ANT_2: i_ant = 1; break;
case RIG_ANT_3: i_ant = 2; break;
case RIG_ANT_4: i_ant = 3; break;
default:
rig_debug(RIG_DEBUG_ERR,"%s: more than 4 antennas? ant=0x%02x\n", __func__, ant);
}

ret = netrigctl_vfostr(rig, vfostr, sizeof(vfostr), vfo);

if (ret != RIG_OK) { return ret; }

len = sprintf(cmd, "Y%s %d %d\n", vfostr, ant, option.i);
len = sprintf(cmd, "Y%s %d %d\n", vfostr, i_ant, option.i);

ret = netrigctl_transaction(rig, cmd, len, buf);

Expand All @@ -1758,7 +1768,7 @@ static int netrigctl_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
}


static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t ant, ant_t *ant_curr, value_t *option)
{
int ret, len;
char cmd[CMD_MAX];
Expand All @@ -1771,7 +1781,12 @@ static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)

if (ret != RIG_OK) { return ret; }

len = sprintf(cmd, "y%s\n", vfostr);
if (ant == RIG_ANT_CURR) {
len = sprintf(cmd, "y%s\n", vfostr);
}
else {
len = sprintf(cmd, "y%s %d\n", vfostr, ant);
}

ret = netrigctl_transaction(rig, cmd, len, buf);

Expand All @@ -1781,14 +1796,24 @@ static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
}

rig_debug(RIG_DEBUG_TRACE, "%s: buf='%s'\n", __func__, buf);
ret = sscanf(buf, "%d\n", ant);
ret = sscanf(buf, "%d\n", ant_curr);

if (ret != 1)
{
rig_debug(RIG_DEBUG_ERR, "%s: expected 1 ant integer in '%s', got %d\n", __func__, buf,
ret);
}

if (ant != RIG_ANT_CURR) {
ret = sscanf(buf, "%d\n", &option->i);
}

if (ret != 1)
{
rig_debug(RIG_DEBUG_ERR, "%s: expected 1 option integer in '%s', got %d\n", __func__, buf,
ret);
}

ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);

if (ret <= 0)
Expand Down
11 changes: 7 additions & 4 deletions include/hamlib/rig.h
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ typedef enum {
/**
* \brief Antenna number
*/
typedef int ant_t;
typedef unsigned int ant_t;

#define RIG_ANT_NONE 0
#define RIG_ANT_N(n) ((ant_t)1<<(n))
Expand All @@ -670,6 +670,8 @@ typedef int ant_t;
#define RIG_ANT_4 RIG_ANT_N(3)
#define RIG_ANT_5 RIG_ANT_N(4)

#define RIG_ANT_CURR RIG_ANT_N(31)

#define RIG_ANT_MAX 32


Expand Down Expand Up @@ -1147,7 +1149,7 @@ struct channel {
int channel_num; /*!< Channel number */
int bank_num; /*!< Bank number */
vfo_t vfo; /*!< VFO */
int ant; /*!< Selected antenna */
ant_t ant; /*!< Selected antenna */
freq_t freq; /*!< Receive frequency */
rmode_t mode; /*!< Receive mode */
pbwidth_t width; /*!< Receive passband width associated with mode */
Expand Down Expand Up @@ -1569,7 +1571,7 @@ struct rig_caps {
int (*reset)(RIG *rig, reset_t reset);

int (*set_ant)(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
int (*get_ant)(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option);
int (*get_ant)(RIG *rig, vfo_t vfo, ant_t ant, ant_t *ant_curr, value_t *option);

int (*set_level)(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int (*get_level)(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
Expand Down Expand Up @@ -2156,7 +2158,8 @@ rig_set_ant HAMLIB_PARAMS((RIG *rig,
extern HAMLIB_EXPORT(int)
rig_get_ant HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
ant_t *ant,
ant_t ant,
ant_t *ant_curr,
value_t *option));

extern HAMLIB_EXPORT(setting_t)
Expand Down
2 changes: 1 addition & 1 deletion include/hamlib/rigclass.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class BACKEND_IMPEXP Rig
shortfreq_t getXit(vfo_t vfo = RIG_VFO_CURR);

void setAnt(value_t option, ant_t ant, vfo_t vfo = RIG_VFO_CURR);
ant_t getAnt(value_t &option, ant_t &ant, vfo_t vfo = RIG_VFO_CURR);
ant_t getAnt(value_t &option, ant_t ant, ant_t &ant_curr, vfo_t vfo = RIG_VFO_CURR);

void sendDtmf(const char *digits, vfo_t vfo = RIG_VFO_CURR);
int recvDtmf(char *digits, vfo_t vfo = RIG_VFO_CURR);
Expand Down
2 changes: 1 addition & 1 deletion rigs/drake/drake.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ int drake_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
* drake_get_ant
* Assumes rig!=NULL
*/
int drake_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
int drake_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option)
{
int mdbuf_len, retval;
char mdbuf[BUFSZ];
Expand Down
2 changes: 1 addition & 1 deletion rigs/drake/drake.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int drake_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
int drake_init(RIG *rig);
int drake_cleanup(RIG *rig);
int drake_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
int drake_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option);
int drake_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option);
int drake_set_mem(RIG *rig, vfo_t vfo, int ch);
int drake_get_mem(RIG *rig, vfo_t vfo, int *ch);
int drake_set_chan(RIG *rig, const channel_t *chan);
Expand Down
2 changes: 1 addition & 1 deletion rigs/elad/elad.c
Original file line number Diff line number Diff line change
Expand Up @@ -2875,7 +2875,7 @@ int elad_set_ant_no_ack(RIG *rig, vfo_t vfo, ant_t ant)
/*
* get the aerial/antenna in use
*/
int elad_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
int elad_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option)
{
char ackbuf[8];
int offs;
Expand Down
2 changes: 1 addition & 1 deletion rigs/elad/elad.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ int elad_reset(RIG *rig, reset_t reset);
int elad_send_morse(RIG *rig, vfo_t vfo, const char *msg);
int elad_set_ant (RIG * rig, vfo_t vfo, ant_t ant, value_t option);
int elad_set_ant_no_ack(RIG * rig, vfo_t vfo, ant_t ant);
int elad_get_ant (RIG * rig, vfo_t vfo, ant_t * ant, value_t *option);
int elad_get_ant (RIG * rig, vfo_t vfo, ant_t dummy, ant_t * ant, value_t *option);
int elad_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
int elad_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
int elad_set_ptt_safe(RIG *rig, vfo_t vfo, ptt_t ptt);
Expand Down
24 changes: 24 additions & 0 deletions rigs/icom/README.icom
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,27 @@ Notes on Icom backends
as expected in most cases. Only problem: Bandwidth in Get_Mode is reported always as 0.
Besides this backend seems to be stable -> Changing State to RIG_STATUS_BETA.

2020-02, W9MDB: Antenna count and ack length for existing Icom's with antenna settings
Model #Ant ack length
7100 2 2
737 2 2
7410 2 2
746 2 2
746 2 2
756 2 2
756 2 2
756 2 2
756 2 2
7600 2 3
7610 2 3
7700 4 3
7800 4 3
785x 4 3
9100 2 2
icr30 2 2
icr6 2 2
icr75 2 2
icr8600 3 2
icr9000 2 2
icr9500 3 2

2 changes: 1 addition & 1 deletion rigs/icom/delta2.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const struct rig_caps delta2_caps =
.rig_model = RIG_MODEL_DELTAII,
.model_name = "Delta II",
.mfg_name = "Ten-Tec",
.version = "0.1",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
Expand Down
4 changes: 3 additions & 1 deletion rigs/icom/ic7100.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ static const struct icom_priv_caps ic7100_priv_caps =
},
.rigparms = ic7100_rigparms,
.riglevels = ic7100_riglevels,
.extcmds = ic7100_extcmds
.extcmds = ic7100_extcmds,
.antack_len = 2,
.ant_count = 2
};

const struct rig_caps ic7100_caps =
Expand Down
6 changes: 4 additions & 2 deletions rigs/icom/ic737.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,17 @@ static const struct icom_priv_caps ic737_priv_caps =
0x3c, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
ic737_ts_sc_list,
.antack_len = 2,
.ant_count = 2
};

const struct rig_caps ic737_caps =
{
.rig_model = RIG_MODEL_IC737,
.model_name = "IC-737",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
Expand Down
4 changes: 3 additions & 1 deletion rigs/icom/ic7410.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ static const struct icom_priv_caps ic7410_priv_caps =
0, /* 731 mode */
0, /* no XCHG */
ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_OFF, .icom_level = 0 },
Expand All @@ -113,7 +115,7 @@ const struct rig_caps ic7410_caps =
.rig_model = RIG_MODEL_IC7410,
.model_name = "IC-7410",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
Expand Down
8 changes: 6 additions & 2 deletions rigs/icom/ic746.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ static const struct icom_priv_caps ic746_priv_caps =
0, /* 731 mode */
0, /* no XCHG */
ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_OFF, .icom_level = 0 },
Expand All @@ -182,7 +184,7 @@ const struct rig_caps ic746_caps =
.rig_model = RIG_MODEL_IC746,
.model_name = "IC-746",
.mfg_name = "Icom",
.version = BACKEND_VER ".2",
.version = BACKEND_VER ".4",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
Expand Down Expand Up @@ -392,6 +394,8 @@ static const struct icom_priv_caps ic746pro_priv_caps =
0, /* 731 mode */
0, /* no XCHG */
ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_OFF, .icom_level = 0 },
Expand All @@ -407,7 +411,7 @@ const struct rig_caps ic746pro_caps =
.rig_model = RIG_MODEL_IC746PRO,
.model_name = "IC-746PRO",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE 10000 _TRANSCEIVER,
Expand Down
16 changes: 12 additions & 4 deletions rigs/icom/ic756.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ static const struct icom_priv_caps ic756_priv_caps =
0, /* 731 mode */
0, /* no XCHG */
ic756_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.r2i_mode = r2i_mode,
.agc_levels_present = 1,
.agc_levels = {
Expand All @@ -148,7 +150,7 @@ const struct rig_caps ic756_caps =
.rig_model = RIG_MODEL_IC756,
.model_name = "IC-756",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_ALPHA,
.rig_type = RIG_TYPE_TRANSCEIVER,
Expand Down Expand Up @@ -290,6 +292,8 @@ static const struct icom_priv_caps ic756pro_priv_caps =
0, /* 731 mode */
0, /* no XCHG */
ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_FAST, .icom_level = 1 },
Expand All @@ -304,7 +308,7 @@ const struct rig_caps ic756pro_caps =
.rig_model = RIG_MODEL_IC756PRO,
.model_name = "IC-756PRO",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
Expand Down Expand Up @@ -455,6 +459,8 @@ static const struct icom_priv_caps ic756pro2_priv_caps =
0, /* 731 mode */
0, /* no XCHG */
ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_FAST, .icom_level = 1 },
Expand Down Expand Up @@ -537,7 +543,7 @@ const struct rig_caps ic756pro2_caps =
.rig_model = RIG_MODEL_IC756PROII,
.model_name = "IC-756PROII",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_ALPHA,
.rig_type = RIG_TYPE_TRANSCEIVER,
Expand Down Expand Up @@ -881,6 +887,8 @@ static const struct icom_priv_caps ic756pro3_priv_caps =
0, /* 731 mode */
0, /* no XCHG */
ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_FAST, .icom_level = 1 },
Expand Down Expand Up @@ -955,7 +963,7 @@ const struct rig_caps ic756pro3_caps =
.rig_model = RIG_MODEL_IC756PROIII,
.model_name = "IC-756PROIII",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_TRANSCEIVER,
Expand Down
Loading
0