kopia lustrzana https://github.com/Hamlib/Hamlib
Fix icom_set_func so that it can also turn off DUAL_WATCH
In ic756.c remove ic756_set_func and use icom_set_func insteadpull/788/head
rodzic
b6837801a6
commit
9162127e9c
|
@ -88,8 +88,6 @@ struct cmdparams ic756pro_cmdparms[] =
|
|||
{ 247 ,60 } \
|
||||
} }
|
||||
|
||||
int ic756_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
|
||||
/*
|
||||
* This function deals with the older type radios with only 2 filter widths
|
||||
* (0 - normal, 1 - narrow)
|
||||
|
@ -144,7 +142,7 @@ const struct rig_caps ic756_caps =
|
|||
RIG_MODEL(RIG_MODEL_IC756),
|
||||
.model_name = "IC-756",
|
||||
.mfg_name = "Icom",
|
||||
.version = BACKEND_VER ".0",
|
||||
.version = BACKEND_VER ".1",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -260,7 +258,7 @@ const struct rig_caps ic756_caps =
|
|||
.decode_event = icom_decode_event,
|
||||
.set_level = icom_set_level,
|
||||
.get_level = icom_get_level,
|
||||
.set_func = ic756_set_func,
|
||||
.set_func = icom_set_func,
|
||||
.get_func = icom_get_func,
|
||||
.set_mem = icom_set_mem,
|
||||
.vfo_op = icom_vfo_op,
|
||||
|
@ -307,7 +305,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_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -422,7 +420,7 @@ const struct rig_caps ic756pro_caps =
|
|||
.decode_event = icom_decode_event,
|
||||
.set_level = icom_set_level,
|
||||
.get_level = icom_get_level,
|
||||
.set_func = ic756_set_func,
|
||||
.set_func = icom_set_func,
|
||||
.get_func = icom_get_func,
|
||||
.set_mem = icom_set_mem,
|
||||
.vfo_op = icom_vfo_op,
|
||||
|
@ -544,7 +542,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_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -662,7 +660,7 @@ const struct rig_caps ic756pro2_caps =
|
|||
.get_parm = icom_get_parm,
|
||||
.set_level = icom_set_level,
|
||||
.get_level = icom_get_level,
|
||||
.set_func = ic756_set_func,
|
||||
.set_func = icom_set_func,
|
||||
.get_func = icom_get_func,
|
||||
.set_mem = icom_set_mem,
|
||||
.vfo_op = icom_vfo_op,
|
||||
|
@ -1105,7 +1103,7 @@ const struct rig_caps ic756pro3_caps =
|
|||
.get_parm = icom_get_parm,
|
||||
.set_level = icom_set_level,
|
||||
.get_level = icom_get_level,
|
||||
.set_func = ic756_set_func,
|
||||
.set_func = icom_set_func,
|
||||
.get_func = icom_get_func,
|
||||
.set_mem = icom_set_mem,
|
||||
.vfo_op = icom_vfo_op,
|
||||
|
@ -1130,37 +1128,3 @@ const struct rig_caps ic756pro3_caps =
|
|||
.set_ext_parm = ic756pro2_set_ext_parm,
|
||||
.get_ext_parm = ic756pro2_get_ext_parm,
|
||||
};
|
||||
|
||||
int ic756_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
||||
{
|
||||
unsigned char fctbuf[MAXFRAMELEN], ackbuf[MAXFRAMELEN];
|
||||
int fct_len = 0, acklen, retval;
|
||||
int fct_cn, fct_sc; /* Command Number, Subcommand */
|
||||
|
||||
switch (func)
|
||||
{
|
||||
case RIG_FUNC_DUAL_WATCH:
|
||||
fct_cn = C_SET_VFO;
|
||||
fct_sc = status ? S_DUAL_ON : S_DUAL_OFF;
|
||||
break;
|
||||
|
||||
default:
|
||||
return icom_set_func(rig, vfo, func, status);
|
||||
}
|
||||
|
||||
retval = icom_transaction(rig, fct_cn, fct_sc, fctbuf, fct_len, ackbuf,
|
||||
&acklen);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
if (acklen != 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: wrong frame len=%d\n", __func__, acklen);
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND_VER "20210828"
|
||||
#define BACKEND_VER "20210901"
|
||||
|
||||
#define ICOM_IS_SECONDARY_VFO(vfo) ((vfo) & (RIG_VFO_B | RIG_VFO_SUB | RIG_VFO_SUB_B | RIG_VFO_MAIN_B))
|
||||
#define ICOM_GET_VFO_NUMBER(vfo) (ICOM_IS_SECONDARY_VFO(vfo) ? 0x01 : 0x00)
|
||||
|
|
Ładowanie…
Reference in New Issue