diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 2370ff947..ccdb2957e 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -7462,7 +7462,8 @@ int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) case RIG_FUNC_DUAL_WATCH: if ((RIG_IS_IC9100) || - (RIG_IS_IC9700)) + (RIG_IS_IC9700) || + (RIG_IS_ID5100)) { fct_cn = C_CTL_FUNC; fct_sc = S_MEM_DUALMODE; diff --git a/rigs/icom/id5100.c b/rigs/icom/id5100.c index 613ebcf9a..637fe7afc 100644 --- a/rigs/icom/id5100.c +++ b/rigs/icom/id5100.c @@ -154,7 +154,7 @@ int id5100_set_vfo(RIG *rig, vfo_t vfo) if (vfo == RIG_VFO_A || vfo == RIG_VFO_B) { // and 0x25 works in this mode - priv->x25cmdfails = 0; + priv->x25cmdfails = 1; if (priv->dual_watch) { @@ -222,6 +222,24 @@ int id5100_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) return retval; } +int id5100_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) +{ + unsigned char ackbuf[MAXFRAMELEN]; + int ack_len = sizeof(ackbuf), retval; + int fct_cn, fct_sc; /* Command Number, Subcommand */ + unsigned char fctbuf[MAXFRAMELEN]; + int fct_len = 0; + + const struct icom_priv_caps *priv_caps = rig->caps->priv; + const struct cmdparams *extcmds = priv_caps->extcmds; + int i; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; + + value_t value; + RETURNFUNC(icom_get_func(rig, vfo, func, status)); +} /* */ static struct icom_priv_caps id5100_priv_caps = @@ -237,7 +255,7 @@ const struct rig_caps id5100_caps = RIG_MODEL(RIG_MODEL_ID5100), .model_name = "ID-5100", .mfg_name = "Icom", - .version = BACKEND_VER ".6", + .version = BACKEND_VER ".7", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_MOBILE, @@ -344,7 +362,7 @@ const struct rig_caps id5100_caps = .decode_event = icom_decode_event, .set_func = icom_set_func, - .get_func = icom_get_func, + .get_func = id5100_get_func, .set_level = icom_set_level, .get_level = icom_get_level, .set_parm = icom_set_parm, diff --git a/simulators/sim.h b/simulators/sim.h new file mode 100644 index 000000000..fda16b2e7 --- /dev/null +++ b/simulators/sim.h @@ -0,0 +1,20 @@ +#include "../src/misc.h" +#include + +#define WRITE(f,b,l) write_sim(f,(const unsigned char*)b,l,__func__,__LINE__) + +int write_sim(int fd, const unsigned char *buf, int buflen, const char *func, + int linenum) +{ + int n; + dump_hex(buf, buflen); + n = write(fd, buf, buflen); + + if (n <= 0) + { + fprintf(stderr, "%s(%d) buf='%s' write error %d: %s\n", func, linenum, buf, n, + strerror(errno)); + } + + return n; +}