From d167061fe5903dd3f53be8fedea2e111763a5a3a Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Mon, 30 Nov 2020 14:53:55 -0600 Subject: [PATCH] astyle files (cherry picked from commit 5fc36df24987133730f0458982846c4c30d26ed3) --- rigs/aor/ar3030.c | 3 +- rigs/aor/ar7030p.c | 3 +- rigs/dummy/dummy.c | 7 ++- rigs/dummy/netrigctl.c | 3 +- rigs/icom/frame.c | 5 +- rigs/icom/ic746.c | 3 +- rigs/icom/icr75.c | 3 +- rigs/kenwood/pihpsdr.c | 3 +- rigs/kenwood/thd72.c | 3 +- rigs/kenwood/thd74.c | 3 +- rigs/kenwood/tmd710.c | 3 +- rigs/kenwood/tmv7.c | 3 +- rigs/kenwood/ts2000.c | 3 +- rigs/yaesu/ft1200.c | 34 ++++++----- rigs/yaesu/ft2000.c | 34 ++++++----- rigs/yaesu/ft3000.c | 42 +++++++------ rigs/yaesu/ft5000.c | 42 +++++++------ rigs/yaesu/ft950.c | 34 ++++++----- rigs/yaesu/newcat.c | 134 ++++++++++++++++++++++++++++++++++------- rotators/m2/rc2800.c | 28 +++++---- src/mem.c | 25 +++++--- src/serial.c | 5 +- 22 files changed, 280 insertions(+), 143 deletions(-) diff --git a/rigs/aor/ar3030.c b/rigs/aor/ar3030.c index 5e40e49e4..8dbc47cdc 100644 --- a/rigs/aor/ar3030.c +++ b/rigs/aor/ar3030.c @@ -45,7 +45,8 @@ static int ar3030_set_mem(RIG *rig, vfo_t vfo, int ch); static int ar3030_get_mem(RIG *rig, vfo_t vfo, int *ch); static int ar3030_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); static int ar3030_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); -static int ar3030_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only); +static int ar3030_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only); static int ar3030_init(RIG *rig); static int ar3030_cleanup(RIG *rig); static int ar3030_close(RIG *rig); diff --git a/rigs/aor/ar7030p.c b/rigs/aor/ar7030p.c index d614c1062..8ae78cf9e 100644 --- a/rigs/aor/ar7030p.c +++ b/rigs/aor/ar7030p.c @@ -1638,7 +1638,8 @@ static int ar7030p_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan) return (-RIG_ENIMPL); } -static int ar7030p_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) +static int ar7030p_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only) { int rc = RIG_OK; unsigned char v; diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index f3c26ceb7..a274fcdc9 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -1888,7 +1888,8 @@ static int dummy_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan) } -static int dummy_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) +static int dummy_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only) { struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv; @@ -2078,7 +2079,7 @@ struct rig_caps dummy_caps = .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, - .targetable_vfo = RIG_TARGETABLE_PTT|RIG_TARGETABLE_RITXIT, + .targetable_vfo = RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, .port_type = RIG_PORT_NONE, @@ -2243,7 +2244,7 @@ struct rig_caps dummy_no_vfo_caps = .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, - .targetable_vfo = RIG_TARGETABLE_PTT|RIG_TARGETABLE_RITXIT, + .targetable_vfo = RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, .port_type = RIG_PORT_NONE, diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 8d0743aa2..981991650 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -2106,7 +2106,8 @@ static int netrigctl_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan) } -static int netrigctl_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) +static int netrigctl_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only) { return -RIG_ENIMPL; } diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 6ca3664f8..ca718a8d5 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -395,9 +395,12 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, { rmode_t tmode; int ret = rig_get_mode(rig, vfo, &tmode, &width); + if (ret != RIG_OK) { - rig_debug(RIG_DEBUG_WARN, "%s: Failed to get width for passband nochange err=%s\n", __func__, rigerror(ret)); + rig_debug(RIG_DEBUG_WARN, + "%s: Failed to get width for passband nochange err=%s\n", __func__, + rigerror(ret)); } } diff --git a/rigs/icom/ic746.c b/rigs/icom/ic746.c index 6fcada2fc..7a0f87fff 100644 --- a/rigs/icom/ic746.c +++ b/rigs/icom/ic746.c @@ -153,7 +153,8 @@ typedef channel_str_t band_stack_reg_t; static int ic746_set_parm(RIG *rig, setting_t parm, value_t val); static int ic746_get_parm(RIG *rig, setting_t parm, value_t *val); -static int ic746pro_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only); +static int ic746pro_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only); static int ic746pro_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan); static int ic746pro_set_ext_parm(RIG *rig, token_t token, value_t val); static int ic746pro_get_ext_parm(RIG *rig, token_t token, value_t *val); diff --git a/rigs/icom/icr75.c b/rigs/icom/icr75.c index 18291cd8a..4bc8c3a64 100644 --- a/rigs/icom/icr75.c +++ b/rigs/icom/icr75.c @@ -92,7 +92,8 @@ } static int icr75_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan); -static int icr75_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only); +static int icr75_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only); static int icr75_set_parm(RIG *rig, setting_t parm, value_t val); static int icr75_get_parm(RIG *rig, setting_t parm, value_t *val); diff --git a/rigs/kenwood/pihpsdr.c b/rigs/kenwood/pihpsdr.c index 4e5f9ab91..1c00de3da 100644 --- a/rigs/kenwood/pihpsdr.c +++ b/rigs/kenwood/pihpsdr.c @@ -64,7 +64,8 @@ static int pihpsdr_open(RIG *rig); static int pihpsdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); static int pihpsdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); -static int pihspdr_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only); +static int pihspdr_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only); static int pihspdr_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan); diff --git a/rigs/kenwood/thd72.c b/rigs/kenwood/thd72.c index 0ad208a73..39f8b0659 100644 --- a/rigs/kenwood/thd72.c +++ b/rigs/kenwood/thd72.c @@ -1358,7 +1358,8 @@ static int thd72_parse_channel(int kind, const char *buf, channel_t *chan) return RIG_OK; } -static int thd72_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) +static int thd72_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only) { int retval; char buf[72]; diff --git a/rigs/kenwood/thd74.c b/rigs/kenwood/thd74.c index b19d8bd6d..e35c1e7a0 100644 --- a/rigs/kenwood/thd74.c +++ b/rigs/kenwood/thd74.c @@ -1275,7 +1275,8 @@ static int thd74_parse_channel(int kind, const char *buf, channel_t *chan) return RIG_OK; } -static int thd74_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) +static int thd74_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only) { int retval; char buf[72]; diff --git a/rigs/kenwood/tmd710.c b/rigs/kenwood/tmd710.c index 70106d7b2..223184545 100644 --- a/rigs/kenwood/tmd710.c +++ b/rigs/kenwood/tmd710.c @@ -71,7 +71,8 @@ static int tmd710_set_mem(RIG *rig, vfo_t vfo, int ch); static int tmd710_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code); static int tmd710_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *code); static int tmd710_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan); -static int tmd710_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only); +static int tmd710_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only); static int tmd710_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt); static int tmd710_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd); static int tmd710_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op); diff --git a/rigs/kenwood/tmv7.c b/rigs/kenwood/tmv7.c index 0aebff5ec..373d6ad5f 100644 --- a/rigs/kenwood/tmv7.c +++ b/rigs/kenwood/tmv7.c @@ -87,7 +87,8 @@ static int tmv7_decode_event(RIG *rig); static int tmv7_set_vfo(RIG *rig, vfo_t vfo); static int tmv7_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); static int tmv7_get_powerstat(RIG *rig, powerstat_t *status); -static int tmv7_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only); +static int tmv7_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only); static int tmv7_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan); /* diff --git a/rigs/kenwood/ts2000.c b/rigs/kenwood/ts2000.c index 2b17788fb..606153661 100644 --- a/rigs/kenwood/ts2000.c +++ b/rigs/kenwood/ts2000.c @@ -58,7 +58,8 @@ /* prototypes */ static int ts2000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); -static int ts2000_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only); +static int ts2000_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only); static int ts2000_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan); /* diff --git a/rigs/yaesu/ft1200.c b/rigs/yaesu/ft1200.c index f6af9d52d..9aa8928a2 100644 --- a/rigs/yaesu/ft1200.c +++ b/rigs/yaesu/ft1200.c @@ -42,16 +42,16 @@ const struct newcat_priv_caps ftdx1200_priv_caps = { .roofing_filter_count = 7, .roofing_filters = - { - // The index must match ext level combo index - { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, - { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, - { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, - { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, - { .index = 4, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, - { .index = 5, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, - { .index = 6, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, - } + { + // The index must match ext level combo index + { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, + { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, + { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, + { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, + { .index = 4, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, + { .index = 5, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, + { .index = 6, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, + } }; const struct confparams ftdx1200_ext_levels[] = @@ -63,11 +63,15 @@ const struct confparams ftdx1200_ext_levels[] = "Roofing filter", NULL, RIG_CONF_COMBO, - { .c = { .combostr = { - "AUTO", "15 kHz", "6 kHz", "3 kHz", - "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", - NULL } - } } + { + .c = { + .combostr = { + "AUTO", "15 kHz", "6 kHz", "3 kHz", + "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", + NULL + } + } + } }, { RIG_CONF_END, NULL, } }; diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index c33bcdfd3..d486ab020 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -44,16 +44,16 @@ const struct newcat_priv_caps ft2000_priv_caps = { .roofing_filter_count = 7, .roofing_filters = - { - // The index must match ext level combo index - { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, - { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, - { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, - { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, - { .index = 4, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, - { .index = 5, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, - { .index = 6, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, - } + { + // The index must match ext level combo index + { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, + { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, + { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, + { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, + { .index = 4, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, + { .index = 5, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, + { .index = 6, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, + } }; const struct confparams ft2000_ext_levels[] = @@ -65,11 +65,15 @@ const struct confparams ft2000_ext_levels[] = "Roofing filter", NULL, RIG_CONF_COMBO, - { .c = { .combostr = { - "AUTO", "15 kHz", "6 kHz", "3 kHz", - "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", - NULL } - } } + { + .c = { + .combostr = { + "AUTO", "15 kHz", "6 kHz", "3 kHz", + "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", + NULL + } + } + } }, { RIG_CONF_END, NULL, } }; diff --git a/rigs/yaesu/ft3000.c b/rigs/yaesu/ft3000.c index dc416780b..6a7e20a32 100644 --- a/rigs/yaesu/ft3000.c +++ b/rigs/yaesu/ft3000.c @@ -40,20 +40,20 @@ const struct newcat_priv_caps ftdx3000_priv_caps = { .roofing_filter_count = 11, .roofing_filters = - { - // The index must match ext level combo index - { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, - { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, - { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, - { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, - { .index = 4, .set_value = '4', .get_value = '7', .width = 600, .optional = 0 }, - { .index = 5, .set_value = '5', .get_value = '8', .width = 300, .optional = 0 }, - { .index = 6, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, - { .index = 7, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, - { .index = 8, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, - { .index = 9, .set_value = 0, .get_value = '9', .width = 600, .optional = 0 }, - { .index = 10, .set_value = 0, .get_value = 'A', .width = 300, .optional = 0 }, - } + { + // The index must match ext level combo index + { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, + { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, + { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, + { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, + { .index = 4, .set_value = '4', .get_value = '7', .width = 600, .optional = 0 }, + { .index = 5, .set_value = '5', .get_value = '8', .width = 300, .optional = 0 }, + { .index = 6, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, + { .index = 7, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, + { .index = 8, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, + { .index = 9, .set_value = 0, .get_value = '9', .width = 600, .optional = 0 }, + { .index = 10, .set_value = 0, .get_value = 'A', .width = 300, .optional = 0 }, + } }; const struct confparams ftdx3000_ext_levels[] = @@ -65,11 +65,15 @@ const struct confparams ftdx3000_ext_levels[] = "Roofing filter", NULL, RIG_CONF_COMBO, - { .c = { .combostr = { - "AUTO", "15 kHz", "6 kHz", "3 kHz", "600 Hz", "300 Hz", - "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", "AUTO - 600 Hz", "AUTO - 300 Hz", - NULL } - } } + { + .c = { + .combostr = { + "AUTO", "15 kHz", "6 kHz", "3 kHz", "600 Hz", "300 Hz", + "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", "AUTO - 600 Hz", "AUTO - 300 Hz", + NULL + } + } + } }, { RIG_CONF_END, NULL, } }; diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index 7928da033..df68029d1 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -40,20 +40,20 @@ const struct newcat_priv_caps ftdx5000_priv_caps = { .roofing_filter_count = 11, .roofing_filters = - { - // The index must match ext level combo index - { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, - { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, - { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, - { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, - { .index = 4, .set_value = '4', .get_value = '7', .width = 600, .optional = 0 }, - { .index = 5, .set_value = '5', .get_value = '8', .width = 300, .optional = 0 }, - { .index = 6, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, - { .index = 7, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, - { .index = 8, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, - { .index = 9, .set_value = 0, .get_value = '9', .width = 600, .optional = 0 }, - { .index = 10, .set_value = 0, .get_value = 'A', .width = 300, .optional = 0 }, - } + { + // The index must match ext level combo index + { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, + { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, + { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, + { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, + { .index = 4, .set_value = '4', .get_value = '7', .width = 600, .optional = 0 }, + { .index = 5, .set_value = '5', .get_value = '8', .width = 300, .optional = 0 }, + { .index = 6, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, + { .index = 7, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, + { .index = 8, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, + { .index = 9, .set_value = 0, .get_value = '9', .width = 600, .optional = 0 }, + { .index = 10, .set_value = 0, .get_value = 'A', .width = 300, .optional = 0 }, + } }; const struct confparams ftdx5000_ext_levels[] = @@ -65,11 +65,15 @@ const struct confparams ftdx5000_ext_levels[] = "Roofing filter", NULL, RIG_CONF_COMBO, - { .c = { .combostr = { - "AUTO", "15 kHz", "6 kHz", "3 kHz", "600 Hz (Main)", "300 Hz (Main)", - "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", "AUTO - 600 Hz (Main)", "AUTO - 300 Hz (Main)", - NULL } - } } + { + .c = { + .combostr = { + "AUTO", "15 kHz", "6 kHz", "3 kHz", "600 Hz (Main)", "300 Hz (Main)", + "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", "AUTO - 600 Hz (Main)", "AUTO - 300 Hz (Main)", + NULL + } + } + } }, { RIG_CONF_END, NULL, } }; diff --git a/rigs/yaesu/ft950.c b/rigs/yaesu/ft950.c index bf30d4359..1141eba2c 100644 --- a/rigs/yaesu/ft950.c +++ b/rigs/yaesu/ft950.c @@ -42,16 +42,16 @@ const struct newcat_priv_caps ft950_priv_caps = { .roofing_filter_count = 7, .roofing_filters = - { - // The index must match ext level combo index - { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, - { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, - { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, - { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, - { .index = 4, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, - { .index = 5, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, - { .index = 6, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, - } + { + // The index must match ext level combo index + { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, + { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, + { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, + { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, + { .index = 4, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, + { .index = 5, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, + { .index = 6, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, + } }; const struct confparams ft950_ext_levels[] = @@ -63,11 +63,15 @@ const struct confparams ft950_ext_levels[] = "Roofing filter", NULL, RIG_CONF_COMBO, - { .c = { .combostr = { - "AUTO", "15 kHz", "6 kHz", "3 kHz", - "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", - NULL } - } } + { + .c = { + .combostr = { + "AUTO", "15 kHz", "6 kHz", "3 kHz", + "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", + NULL + } + } + } }, { RIG_CONF_END, NULL, } }; diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 3df1a439e..27ac0fea5 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1498,6 +1498,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band + if (err < 0) { return err; @@ -1510,7 +1511,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) // Step size is 100 kHz offs /= 100000; - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%03li%c", command, offs, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%03li%c", command, offs, + cat_term); } else if (is_ft2000) { @@ -1531,7 +1533,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) // Step size is 1 kHz offs /= 1000; - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, + cat_term); } else if (is_ft950) { @@ -1552,7 +1555,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) // Step size is 1 kHz offs /= 1000; - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, + cat_term); } else if (is_ft891) { @@ -1573,7 +1577,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) // Step size is 1 kHz offs /= 1000; - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, + cat_term); } else if (is_ft991) { @@ -1602,7 +1607,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) // Step size is 1 kHz offs /= 1000; - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, + cat_term); } else if (is_ftdx1200) { @@ -1623,7 +1629,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) // Step size is 1 kHz offs /= 1000; - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, + cat_term); } else if (is_ftdx3000) { @@ -1644,7 +1651,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) // Step size is 1 kHz offs /= 1000; - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, + cat_term); } else if (is_ftdx5000) { @@ -1665,7 +1673,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) // Step size is 1 kHz offs /= 1000; - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, + cat_term); } else if (is_ftdx101) { @@ -1686,7 +1695,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) // Step size is 1 kHz offs /= 1000; - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, + cat_term); } else { @@ -1709,6 +1719,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band + if (err < 0) { return err; @@ -1895,6 +1906,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) } err = newcat_get_cmd(rig); + if (err != RIG_OK) { return err; @@ -3188,6 +3200,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { priv->cmd_str[2] = main_sub_vfo; } + break; case RIG_LEVEL_IF: @@ -3217,7 +3230,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } else if (is_ft891) { - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "IS0%d%+.4d%c", val.i == 0 ? 0 : 1, + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "IS0%d%+.4d%c", + val.i == 0 ? 0 : 1, val.i, cat_term); } else @@ -3235,8 +3249,10 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) priv->question_mark_response_means_rejected = 1; break; - case RIG_LEVEL_CWPITCH: { + case RIG_LEVEL_CWPITCH: + { int kp; + if (!newcat_valid_command(rig, "KP")) { return -RIG_ENAVAIL; @@ -3526,7 +3542,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PL%03d%c", fpf, cat_term); break; - case RIG_LEVEL_BKINDL: { + case RIG_LEVEL_BKINDL: + { int millis; value_t keyspd; @@ -3537,6 +3554,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) // Convert 10/ths of dots to milliseconds using the current key speed err = newcat_get_level(rig, vfo, RIG_LEVEL_KEYSPD, &keyspd); + if (err != RIG_OK) { return err; @@ -3556,7 +3574,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) else { // This covers 300-2900 06-32 - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%02d;", 6 + ((millis - 300) / 100)); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%02d;", + 6 + ((millis - 300) / 100)); } } else if (is_ftdx5000) @@ -3565,6 +3584,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { millis = 20; } + if (millis > 5000) { millis = 5000; @@ -3572,12 +3592,14 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%04d%c", millis, cat_term); } - else if (is_ft950 || is_ft450 || is_ft891 || is_ft991 || is_ftdx1200 || is_ftdx3000) + else if (is_ft950 || is_ft450 || is_ft891 || is_ft991 || is_ftdx1200 + || is_ftdx3000) { if (millis < 30) { millis = 30; } + if (millis > 3000) { millis = 3000; @@ -3591,6 +3613,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { millis = 0; } + if (millis > 5000) { millis = 5000; @@ -3604,6 +3627,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { millis = 1; } + if (millis > 5000) { millis = 5000; @@ -3787,6 +3811,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) val.i = 320; } } + if (is_ft950 || is_ftdx9000) { if (val.i > 300) @@ -3838,6 +3863,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "ML1%03d%c", fpf, cat_term); } + break; default: @@ -3939,6 +3965,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { priv->cmd_str[2] = main_sub_vfo; } + break; case RIG_LEVEL_CWPITCH: @@ -4206,6 +4233,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "ML1%c", cat_term); } + break; default: @@ -4416,7 +4444,8 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f = (float)atoi(retlvl) / scale; break; - case RIG_LEVEL_BKINDL: { + case RIG_LEVEL_BKINDL: + { int raw_value = atoi(retlvl); int millis; value_t keyspd; @@ -4426,12 +4455,19 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (raw_value) { case 0: millis = 30; break; + case 1: millis = 50; break; + case 2: millis = 100; break; + case 3: millis = 150; break; + case 4: millis = 200; break; + case 5: millis = 250; break; + case 6: millis = 300; break; + default: millis = (raw_value - 6) * 100 + 300; } @@ -4444,6 +4480,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) // Convert milliseconds to 10/ths of dots using the current key speed err = newcat_get_level(rig, vfo, RIG_LEVEL_KEYSPD, &keyspd); + if (err != RIG_OK) { return err; @@ -4452,6 +4489,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->i = millis_to_dot10ths(millis, keyspd.i); break; } + case RIG_LEVEL_STRENGTH: if (rig->caps->str_cal.size > 0) { @@ -4551,7 +4589,8 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; - case RIG_LEVEL_PREAMP: { + case RIG_LEVEL_PREAMP: + { int preamp; if (retlvl[0] < '0' || retlvl[0] > '9') @@ -4574,10 +4613,12 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } } } + break; } - case RIG_LEVEL_ATT: { + case RIG_LEVEL_ATT: + { int att; if (retlvl[0] < '0' || retlvl[0] > '9') @@ -4600,6 +4641,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } } } + break; } @@ -4609,15 +4651,19 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case '0': val->i = RIG_AGC_OFF; break; + case '1': val->i = RIG_AGC_FAST; break; + case '2': val->i = RIG_AGC_MEDIUM; break; + case '3': val->i = RIG_AGC_SLOW; break; + case '4': case '5': case '6': @@ -4639,6 +4685,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) // Most Yaesu rigs seem to use range of 0-75 to represent pitch of 300..1050 Hz in 10 Hz steps val->i = (atoi(retlvl) * 10) + 300; } + break; case RIG_LEVEL_METER: @@ -4777,7 +4824,8 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return -RIG_ENAVAIL; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status ? 1 : 0 , cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status ? 1 : 0, + cat_term); if (rig->caps->targetable_vfo & RIG_TARGETABLE_TONE) { @@ -4859,11 +4907,13 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) if (is_ft891 || is_ft991 || is_ftdx1200 || is_ftdx3000 || is_ftdx101) { // There seems to be an error in the manuals for some of these rigs stating that values should be 1 = OFF and 2 = ON, but they are 0 = OFF and 1 = ON instead - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PR0%d%c", status ? 1 : 0, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PR0%d%c", status ? 1 : 0, + cat_term); } else { - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PR%d%c", status ? 1 : 0, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PR%d%c", status ? 1 : 0, + cat_term); } break; @@ -6013,7 +6063,7 @@ ncboolean newcat_valid_command(RIG *rig, char const *const command) is_ftdx101 = newcat_is_rig(rig, RIG_MODEL_FTDX101D); if (!is_ft450 && !is_ft950 && !is_ft891 && !is_ft991 && !is_ft2000 - && !is_ftdx5000 && !is_ftdx9000 && !is_ftdx1200 && !is_ftdx3000 && !is_ftdx101) + && !is_ftdx5000 && !is_ftdx9000 && !is_ftdx1200 && !is_ftdx3000 && !is_ftdx101) { rig_debug(RIG_DEBUG_ERR, "%s: '%s' is unknown\n", __func__, caps->model_name); return FALSE; @@ -6513,6 +6563,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_CWR: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6530,12 +6581,14 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 1700) { w = 11; } else if (width <= 2000) { w = 12; } else { w = 13; } // 2400 Hz + break; case RIG_MODE_LSB: case RIG_MODE_USB: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6562,6 +6615,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 2800) { w = 18; } else if (width <= 2900) { w = 19; } else { w = 20; } // 3000 Hz + break; case RIG_MODE_AM: @@ -6593,6 +6647,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, FALSE); } + return err; case RIG_MODE_FMN: @@ -6611,6 +6666,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_CWR: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6634,12 +6690,14 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 2000) { w = 15; } else if (width <= 2400) { w = 16; } else { w = 17; } // 3000 Hz + break; case RIG_MODE_LSB: case RIG_MODE_USB: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6667,6 +6725,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 2900) { w = 19; } else if (width <= 3000) { w = 20; } else { w = 21; } // 3000 Hz + break; case RIG_MODE_AM: @@ -6680,6 +6739,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, FALSE); } + return err; case RIG_MODE_FMN: @@ -6701,6 +6761,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_CWR: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6724,12 +6785,14 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 2000) { w = 15; } else if (width <= 2400) { w = 16; } else { w = 17; } // 3000 Hz + break; case RIG_MODE_LSB: case RIG_MODE_USB: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6757,6 +6820,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 2900) { w = 19; } else if (width <= 3000) { w = 20; } else { w = 21; } // 3200 Hz + break; case RIG_MODE_AM: // Only 1 passband each for AM or AMN @@ -6764,6 +6828,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, FALSE); } + return err; case RIG_MODE_AMN: @@ -6771,6 +6836,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, TRUE); } + return err; case RIG_MODE_FM: // Only 1 passband each for FM or FMN @@ -6778,6 +6844,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, FALSE); } + return err; case RIG_MODE_FMN: @@ -6785,6 +6852,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, TRUE); } + return err; case RIG_MODE_C4FM: @@ -6800,6 +6868,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { return -RIG_EINVAL; } + return err; case RIG_MODE_PKTFM: @@ -6811,6 +6880,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, FALSE); } + return err; default: @@ -6830,6 +6900,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_CWR: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6852,12 +6923,14 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 1700) { w = 14; } else if (width <= 2000) { w = 15; } else { w = 16; } // 2400 Hz + break; case RIG_MODE_LSB: case RIG_MODE_USB: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6889,6 +6962,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 3600) { w = 23; } else if (width <= 3800) { w = 24; } else { w = 25; } // 4000 Hz + break; case RIG_MODE_AM: @@ -6923,6 +6997,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, FALSE); } + return err; } } // end is_ftdx1200 and is_ftdx3000 @@ -6938,6 +7013,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_CWR: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6960,12 +7036,14 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 1700) { w = 14; } else if (width <= 2000) { w = 15; } else { w = 16; } // 2400 Hz + break; case RIG_MODE_LSB: case RIG_MODE_USB: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6996,6 +7074,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 3600) { w = 23; } else if (width <= 3800) { w = 24; } else { w = 25; } // 4000 Hz + break; case RIG_MODE_AM: @@ -7030,6 +7109,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, FALSE); } + return err; } } // end is_ftdx5000 @@ -7062,6 +7142,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 2000) { w = 16; } else if (width <= 2400) { w = 17; } else { w = 18; } + break; case RIG_MODE_LSB: @@ -7090,6 +7171,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 3200) { w = 21; } else if (width <= 3500) { w = 22; } else { w = 23; } // 4000Hz + break; case RIG_MODE_AM: @@ -7122,6 +7204,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, FALSE); } + return err; case RIG_MODE_AMN: @@ -7144,6 +7227,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (width <= 500) { w = 6; } else if (width <= 1800) { w = 16; } else { w = 24; } + break; case RIG_MODE_LSB: @@ -7151,6 +7235,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (width <= 1800) { w = 8; } else if (width <= 2400) { w = 16; } else { w = 25; } // 3000 + break; case RIG_MODE_AM: @@ -7164,6 +7249,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, FALSE); } + return err; case RIG_MODE_FMN: @@ -7407,6 +7493,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) cat_term); err = newcat_get_cmd(rig); + if (err != RIG_OK) { return err; @@ -7547,6 +7634,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) default: return -RIG_EINVAL; } + break; case RIG_MODE_AM: @@ -7593,6 +7681,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { *width = narrow ? 300 : 500; } + break; case 1: *width = 50; break; @@ -7732,6 +7821,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { *width = narrow ? 300 : 500; } + break; case 1: *width = 50; break; @@ -8308,6 +8398,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { *width = rig_passband_normal(rig, mode); } + break; case RIG_MODE_AM: @@ -8823,6 +8914,7 @@ int newcat_set_cmd(RIG *rig) break; /* retry */ case '?': + /* The ? response is ambiguous and undocumented by Yaesu. For set commands it seems to indicate: * 1) either that the rig is busy and the command needs to be retried * 2) or that the rig rejected the command because the state of the rig is not valid for the command diff --git a/rotators/m2/rc2800.c b/rotators/m2/rc2800.c index 80b405121..a839c8df2 100644 --- a/rotators/m2/rc2800.c +++ b/rotators/m2/rc2800.c @@ -53,7 +53,7 @@ /* - c2800_parse + rc2800_parse Parse output from the rotator controller @@ -249,17 +249,18 @@ rc2800_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) if (rot->caps->rot_model == ROT_MODEL_RC2800_EARLY_AZ) { - // we only do azimuth and this is the old protocol - // we have to switch modes and then send azimuth - // an extra CR gives us a response to expect - num_sprintf(cmdstr, "A\r%.0f\r\r", az); + // we only do azimuth and this is the old protocol + // we have to switch modes and then send azimuth + // an extra CR gives us a response to expect + num_sprintf(cmdstr, "A\r%.0f\r\r", az); } - else + else { // does the new protocol use decimal points? - // we'll assume no for now - num_sprintf(cmdstr, "A%0f"CR, az); + // we'll assume no for now + num_sprintf(cmdstr, "A%0f"CR, az); } + retval1 = rc2800_transaction(rot, cmdstr, NULL, 0); if (rot->caps->rot_type == ROT_TYPE_AZIMUTH) @@ -272,15 +273,16 @@ rc2800_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) if (rot->caps->rot_model == ROT_MODEL_RC2800_EARLY_AZEL) { - // this is the old protocol - // we have to switch modes and then send azimuth - // an extra CR gives us a response to expect - num_sprintf(cmdstr, "E\r%.0f\r\r", el); + // this is the old protocol + // we have to switch modes and then send azimuth + // an extra CR gives us a response to expect + num_sprintf(cmdstr, "E\r%.0f\r\r", el); } - else + else { num_sprintf(cmdstr, "E%.0f"CR, el); } + retval2 = rc2800_transaction(rot, cmdstr, NULL, 0); if (retval1 == retval2) diff --git a/src/mem.c b/src/mem.c index 769dda6f5..128d677f0 100644 --- a/src/mem.c +++ b/src/mem.c @@ -829,12 +829,13 @@ int HAMLIB_API rig_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan) * * \sa rig_set_channel() */ -int HAMLIB_API rig_get_channel(RIG *rig, vfo_t vfox, channel_t *chan, int read_only) +int HAMLIB_API rig_get_channel(RIG *rig, vfo_t vfox, channel_t *chan, + int read_only) { struct rig_caps *rc; int curr_chan_num, get_mem_status = RIG_OK; vfo_t curr_vfo; - vfo_t vfotmp=RIG_VFO_NONE; /* requested vfo */ + vfo_t vfotmp = RIG_VFO_NONE; /* requested vfo */ int retcode = RIG_OK; int can_emulate_by_vfo_mem, can_emulate_by_vfo_op; @@ -939,7 +940,8 @@ int HAMLIB_API rig_get_channel(RIG *rig, vfo_t vfox, channel_t *chan, int read_o #ifndef DOC_HIDDEN -int get_chan_all_cb_generic(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t arg) +int get_chan_all_cb_generic(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, + rig_ptr_t arg) { int i, j; chan_t *chan_list = rig->state.chan_list; @@ -1004,7 +1006,8 @@ int get_chan_all_cb_generic(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t ar } -int set_chan_all_cb_generic(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t arg) +int set_chan_all_cb_generic(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, + rig_ptr_t arg) { int i, j, retval; chan_t *chan_list = rig->state.chan_list; @@ -1076,7 +1079,8 @@ static int map_chan(RIG *rig, * * \sa rig_set_chan_all(), rig_get_chan_all_cb() */ -int HAMLIB_API rig_set_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t arg) +int HAMLIB_API rig_set_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, + rig_ptr_t arg) { struct rig_caps *rc; int retval; @@ -1122,7 +1126,8 @@ int HAMLIB_API rig_set_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_p * * \sa rig_get_chan_all(), rig_set_chan_all_cb() */ -int HAMLIB_API rig_get_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t arg) +int HAMLIB_API rig_get_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, + rig_ptr_t arg) { struct rig_caps *rc; int retval; @@ -1283,14 +1288,16 @@ static int map_parm(RIG *rig, const struct confparams *cfgps, value_t *value, } -int get_parm_all_cb_generic(RIG *rig, vfo_t vfo, confval_cb_t parm_cb, rig_ptr_t cfgps, +int get_parm_all_cb_generic(RIG *rig, vfo_t vfo, confval_cb_t parm_cb, + rig_ptr_t cfgps, rig_ptr_t vals) { return -RIG_ENIMPL; } -int set_parm_all_cb_generic(RIG *rig, vfo_t vfo, confval_cb_t parm_cb, rig_ptr_t cfgps, +int set_parm_all_cb_generic(RIG *rig, vfo_t vfo, confval_cb_t parm_cb, + rig_ptr_t cfgps, rig_ptr_t vals) { return -RIG_ENIMPL; @@ -1557,7 +1564,7 @@ int HAMLIB_API rig_get_mem_all(RIG *rig, return retval; } - retval = get_parm_all_cb_generic(rig, vfo, map_parm, + retval = get_parm_all_cb_generic(rig, vfo, map_parm, (rig_ptr_t)cfgps, (rig_ptr_t)vals); diff --git a/src/serial.c b/src/serial.c index ef25e1d8a..08c811a02 100644 --- a/src/serial.c +++ b/src/serial.c @@ -208,7 +208,7 @@ int HAMLIB_API serial_open(hamlib_port_t *rp) * (or equivalent for other manufacturers) within its timeout period. * 2) The results of router's polling are not passed to the Host/apps. * 3) Router only polls when there is no activity from the applications. - * 4) Router is designed to be transparent as far as the applications + * 4) Router is designed to be transparent as far as the applications * are concerned. The only exception is when the user chooses to * run two applications (CAT and 2nd CAT) at the same time and has * "auto-information" or CI-V enabled. In that case asynchronous data @@ -633,7 +633,7 @@ int HAMLIB_API serial_flush(hamlib_port_t *p) * if fd corresponds to a microHam device drain the line * (which is a socket) by reading until it is empty. */ - int n, nbytes=0; + int n, nbytes = 0; rig_debug(RIG_DEBUG_TRACE, "%s: flushing\n", __func__); @@ -646,6 +646,7 @@ int HAMLIB_API serial_flush(hamlib_port_t *p) /* do nothing */ } + rig_debug(RIG_DEBUG_TRACE, "read flushed %d bytes\n", nbytes);