kopia lustrzana https://github.com/Hamlib/Hamlib
Merge branch 'master' of https://github.com/malcolmh/Hamlib into malcolmh-master
commit
9e88710f0b
|
@ -600,6 +600,7 @@ typedef long token_t;
|
|||
* COMBO: val.i, starting from 0. Points to a table of strings or asci stored values.
|
||||
* STRING: val.s or val.cs
|
||||
* CHECKBUTTON: val.i 0/1
|
||||
* BINARY: val.b
|
||||
*/
|
||||
|
||||
/* strongly inspired from soundmodem. Thanks Thomas! */
|
||||
|
@ -608,11 +609,12 @@ enum rig_conf_e {
|
|||
RIG_CONF_COMBO, /*!< Combo type */
|
||||
RIG_CONF_NUMERIC, /*!< Numeric type integer or real */
|
||||
RIG_CONF_CHECKBUTTON, /*!< on/off type */
|
||||
RIG_CONF_BUTTON /*!< Button type */
|
||||
RIG_CONF_BUTTON, /*!< Button type */
|
||||
RIG_CONF_BINARY /*!< Binary buffer type */
|
||||
};
|
||||
|
||||
|
||||
#define RIG_COMBO_MAX 16
|
||||
#define RIG_BIN_MAX 80
|
||||
|
||||
/**
|
||||
* \brief Configuration parameter structure.
|
||||
|
@ -706,10 +708,14 @@ enum meter_level_e {
|
|||
* \sa rig_set_level(), rig_get_level(), rig_set_parm(), rig_get_parm()
|
||||
*/
|
||||
typedef union {
|
||||
signed int i; /*!< Signed integer */
|
||||
float f; /*!< Single precision float */
|
||||
char *s; /*!< Pointer to char string */
|
||||
const char *cs; /*!< Pointer to constant char string */
|
||||
signed int i; /*!< Signed integer */
|
||||
float f; /*!< Single precision float */
|
||||
char *s; /*!< Pointer to char string */
|
||||
const char *cs; /*!< Pointer to constant char string */
|
||||
struct {
|
||||
int l; /*!< Length of data */
|
||||
unsigned char *d; /* Pointer to data buffer */
|
||||
} b;
|
||||
} value_t;
|
||||
|
||||
|
||||
|
@ -1414,6 +1420,7 @@ struct rig_caps {
|
|||
|
||||
const struct confparams *extparms; /*!< Extension parm list, \sa ext.c */
|
||||
const struct confparams *extlevels; /*!< Extension level list, \sa ext.c */
|
||||
int *ext_tokens; /*!< Extension token list */
|
||||
|
||||
const tone_t *ctcss_list; /*!< CTCSS tones list, zero ended */
|
||||
const tone_t *dcs_list; /*!< DCS code list, zero ended */
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#ifndef _FRAME_H
|
||||
#define _FRAME_H 1
|
||||
|
||||
#define MAXFRAMELEN 56
|
||||
#define MAXFRAMELEN 80
|
||||
|
||||
/*
|
||||
* helper functions
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "frame.h"
|
||||
#include "idx_builtin.h"
|
||||
#include "bandplan.h"
|
||||
#include "token.h"
|
||||
|
||||
|
||||
#define IC7100_MODES (RIG_MODE_SSB|RIG_MODE_CW|RIG_MODE_CWR|\
|
||||
|
@ -98,7 +99,32 @@
|
|||
RIG_LEVEL_MONITOR_GAIN| \
|
||||
RIG_LEVEL_NB)
|
||||
|
||||
#define IC7100_PARM_ALL (RIG_PARM_ANN|RIG_PARM_BACKLIGHT)
|
||||
#define IC7100_PARM_ALL (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_KEYLIGHT|RIG_PARM_BEEP|RIG_PARM_TIME)
|
||||
|
||||
struct cmdparams ic7100_rigparms[] = {
|
||||
{ {.s=RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x03}, CMD_DAT_BOL, 1 },
|
||||
{ {.s=RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x04}, CMD_DAT_LVL, 2 },
|
||||
{ {.s=RIG_PARM_KEYLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x05}, CMD_DAT_LVL, 2 },
|
||||
{ {.s=RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x21}, CMD_DAT_TIM, 2 },
|
||||
{ {.s=RIG_PARM_NONE} }
|
||||
};
|
||||
|
||||
struct cmdparams ic7100_riglevels[] = {
|
||||
{ {.s=RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x65}, CMD_DAT_INT, 1 },
|
||||
{ {.s=RIG_LEVEL_NONE} }
|
||||
};
|
||||
|
||||
int ic7100_tokens[] = { TOK_DSTAR_CODE, TOK_DSTAR_DSQL, TOK_DSTAR_CALL_SIGN, TOK_DSTAR_MESSAGE,
|
||||
TOK_DSTAR_STATUS, TOK_DSTAR_MY_CS, TOK_DSTAR_TX_CS, TOK_DSTAR_TX_MESS,
|
||||
TOK_BACKEND_NONE };
|
||||
|
||||
struct confparams ic7100_ext[] = {
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
struct cmdparams ic7100_extcmds[] = {
|
||||
{ {0} }
|
||||
};
|
||||
|
||||
// IC-7100 S-meter calibration data based on manual
|
||||
#define IC7100_STR_CAL { 14, \
|
||||
|
@ -154,9 +180,6 @@
|
|||
|
||||
#define IC7100_HF_ANTS (RIG_ANT_1|RIG_ANT_2)
|
||||
|
||||
int ic7100_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
|
||||
int ic7100_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
|
||||
/*
|
||||
* IC-7100 rig capabilities.
|
||||
*/
|
||||
|
@ -173,6 +196,9 @@ static const struct icom_priv_caps ic7100_priv_caps =
|
|||
{ .level = RIG_AGC_SLOW, .icom_level = 3 },
|
||||
{ .level = -1, .icom_level = 0 },
|
||||
},
|
||||
.rigparms = ic7100_rigparms,
|
||||
.riglevels = ic7100_riglevels,
|
||||
.extcmds = ic7100_extcmds
|
||||
};
|
||||
|
||||
const struct rig_caps ic7100_caps =
|
||||
|
@ -182,7 +208,7 @@ const struct rig_caps ic7100_caps =
|
|||
.mfg_name = "Icom",
|
||||
.version = BACKEND_VER ".0",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_UNTESTED,
|
||||
.status = RIG_STATUS_ALPHA,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
.ptt_type = RIG_PTT_RIG,
|
||||
.dcd_type = RIG_DCD_RIG,
|
||||
|
@ -209,6 +235,9 @@ const struct rig_caps ic7100_caps =
|
|||
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },
|
||||
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } },
|
||||
},
|
||||
.ext_tokens = ic7100_tokens,
|
||||
.extlevels = ic7100_ext,
|
||||
.extparms = icom_ext_parms,
|
||||
.parm_gran = {},
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = common_dcs_list,
|
||||
|
@ -334,8 +363,8 @@ const struct rig_caps ic7100_caps =
|
|||
.set_ts = icom_set_ts,
|
||||
.get_func = icom_get_func,
|
||||
.set_func = icom_set_func,
|
||||
.get_level = ic7100_get_level,
|
||||
.set_level = ic7100_set_level,
|
||||
.get_level = icom_get_level,
|
||||
.set_level = icom_set_level,
|
||||
|
||||
.set_ptt = icom_set_ptt,
|
||||
.get_ptt = icom_get_ptt,
|
||||
|
@ -355,7 +384,8 @@ const struct rig_caps ic7100_caps =
|
|||
|
||||
.set_parm = icom_set_parm,
|
||||
.get_parm = icom_get_parm,
|
||||
|
||||
.set_ext_parm = icom_set_ext_parm,
|
||||
.get_ext_parm = icom_get_ext_parm,
|
||||
.set_mem = icom_set_mem,
|
||||
.vfo_op = icom_vfo_op,
|
||||
.scan = icom_scan,
|
||||
|
@ -371,39 +401,3 @@ const struct rig_caps ic7100_caps =
|
|||
.get_powerstat = icom_get_powerstat,
|
||||
.send_morse = icom_send_morse
|
||||
};
|
||||
|
||||
int ic7100_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
{
|
||||
unsigned char cmdbuf[MAXFRAMELEN];
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
switch (level)
|
||||
{
|
||||
case RIG_LEVEL_VOXDELAY:
|
||||
cmdbuf[0] = 0x01;
|
||||
cmdbuf[1] = 0x65;
|
||||
return icom_set_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, 1, val);
|
||||
|
||||
default:
|
||||
return icom_set_level(rig, vfo, level, val);
|
||||
}
|
||||
}
|
||||
|
||||
int ic7100_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
{
|
||||
unsigned char cmdbuf[MAXFRAMELEN];
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
switch (level)
|
||||
{
|
||||
case RIG_LEVEL_VOXDELAY:
|
||||
cmdbuf[0] = 0x01;
|
||||
cmdbuf[1] = 0x65;
|
||||
return icom_get_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, val);
|
||||
|
||||
default:
|
||||
return icom_get_level(rig, vfo, level, val);
|
||||
}
|
||||
}
|
||||
|
|
351
rigs/icom/icom.c
351
rigs/icom/icom.c
|
@ -401,6 +401,80 @@ const struct confparams icom_cfg_params[] =
|
|||
{RIG_CONF_END, NULL,}
|
||||
};
|
||||
|
||||
/*
|
||||
* Lookup table for icom_get_ext_parm
|
||||
*/
|
||||
|
||||
const struct confparams icom_ext_parms[] =
|
||||
{
|
||||
{ TOK_DSTAR_DSQL, "dsdsql", "D-STAR CSQL Status", "", "", RIG_CONF_CHECKBUTTON, {} },
|
||||
{ TOK_DSTAR_CALL_SIGN, "dscals", "D-STAR Call sign", "", "", RIG_CONF_BINARY, {} },
|
||||
{ TOK_DSTAR_MESSAGE, "dsrmes", "D-STAR Rx Message", "", "", RIG_CONF_STRING, {} },
|
||||
{ TOK_DSTAR_STATUS, "dsstat", "D-STAR Rx Status", "", "", RIG_CONF_BINARY, {} },
|
||||
{ TOK_DSTAR_GPS_DATA, "dsgpsd", "D-STAR GPS Data", "", "", RIG_CONF_BINARY, {} },
|
||||
{ TOK_DSTAR_GPS_MESS, "dsgpsm", "D-STAR GPS Message", "", "", RIG_CONF_STRING, {} },
|
||||
{ TOK_DSTAR_CODE, "dscode", "D-STAR CSQL Code", "", "", RIG_CONF_NUMERIC, {} },
|
||||
{ TOK_DSTAR_TX_DATA, "dstdat", "D-STAR Tx Data", "", "", RIG_CONF_BINARY, {} },
|
||||
{ TOK_DSTAR_MY_CS, "dsmycs", "D-STAR MY Call Sign", "", "", RIG_CONF_STRING, {} },
|
||||
{ TOK_DSTAR_TX_CS, "dstxcs", "D-STAR Tx Call Sign", "", "", RIG_CONF_BINARY, {} },
|
||||
{ TOK_DSTAR_TX_MESS, "dstmes", "D-STAR Tx Message", "", "", RIG_CONF_STRING, {} },
|
||||
{ TOK_DRIVE_GAIN, "drive_gain", "Drive gain", "", "", RIG_CONF_NUMERIC, {} },
|
||||
{ TOK_DIGI_SEL_FUNC, "digi_sel", "DIGI-SEL enable", "", "", RIG_CONF_CHECKBUTTON, {} },
|
||||
{ TOK_DIGI_SEL_LEVEL, "digi_sel_level", "DIGI-SEL level", "", "", RIG_CONF_NUMERIC, {} },
|
||||
{ TOK_SCOPE_DAT, "scpdat", "Scope data", "", "", RIG_CONF_BINARY, {} },
|
||||
{ TOK_SCOPE_STS, "scpsts", "Scope status", "", "", RIG_CONF_CHECKBUTTON, {} },
|
||||
{ TOK_SCOPE_DOP, "scpdop", "Scope data output", "", "", RIG_CONF_CHECKBUTTON, {} },
|
||||
{ TOK_SCOPE_MSS, "scpmss", "Scope main/sub", "", "", RIG_CONF_CHECKBUTTON, {} },
|
||||
{ TOK_SCOPE_MOD, "scpmod", "Scope mode", "", "", RIG_CONF_BINARY, {} },
|
||||
{ TOK_SCOPE_SPN, "scpspn", "Scope span", "", "", RIG_CONF_BINARY, {} },
|
||||
{ TOK_SCOPE_EDG, "scpedg", "Scope edge", "", "", RIG_CONF_BINARY, {} },
|
||||
{ TOK_SCOPE_HLD, "scphld", "Scope hold", "", "", RIG_CONF_BINARY, {} },
|
||||
{ TOK_SCOPE_REF, "scpref", "Scope reference", "", "", RIG_CONF_BINARY, {} },
|
||||
{ TOK_SCOPE_SWP, "scpswp", "Scope sweep", "", "", RIG_CONF_BINARY, {} },
|
||||
{ TOK_SCOPE_STX, "scpstx", "Scope Tx o/p", "", "", RIG_CONF_CHECKBUTTON, {} },
|
||||
{ TOK_SCOPE_TYP, "scptyp", "Scope type", "", "", RIG_CONF_NUMERIC, {} },
|
||||
{ TOK_SCOPE_VBW, "scpvbw", "Scope vbw", "", "", RIG_CONF_BINARY, {} },
|
||||
{ TOK_SCOPE_FEF, "scpfef", "Scope edge", "", "", RIG_CONF_BINARY, {} },
|
||||
{ RIG_CONF_END, NULL, }
|
||||
};
|
||||
|
||||
/*
|
||||
* Lookup table for icom_get_ext_* & icom_set_ext_* functions
|
||||
*/
|
||||
|
||||
const struct cmdparams icom_ext_cmd[] =
|
||||
{
|
||||
{ {.t=TOK_DSTAR_CALL_SIGN}, C_CTL_DIG, S_DIG_DSCALS, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 38 },
|
||||
{ {.t=TOK_DSTAR_MESSAGE}, C_CTL_DIG, S_DIG_DSMESS, SC_MOD_RW12, 2, {0}, CMD_DAT_STR, 32 },
|
||||
{ {.t=TOK_DSTAR_STATUS}, C_CTL_DIG, S_DIG_DSRSTS, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 1 },
|
||||
{ {.t=TOK_DSTAR_GPS_DATA}, C_CTL_DIG, S_DIG_DSGPSD, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 52 },
|
||||
{ {.t=TOK_DSTAR_GPS_MESS}, C_CTL_DIG, S_DIG_DSGPSM, SC_MOD_RW12, 2, {0}, CMD_DAT_STR, 52 },
|
||||
{ {.t=TOK_DSTAR_DSQL}, C_CTL_DIG, S_DIG_DSCSQL, SC_MOD_RW, 1, {0}, CMD_DAT_BOL, 1 },
|
||||
{ {.t=TOK_DSTAR_CODE}, C_CTL_DIG, S_DIG_DSCSQL, SC_MOD_RW12, 2, {0}, CMD_DAT_FLT, 1 },
|
||||
{ {.t=TOK_DSTAR_TX_DATA}, C_CTL_DSD, S_DSD_DSTXDT, SC_MOD_RW, 1, {0}, CMD_DAT_BUF, 30 },
|
||||
{ {.t=TOK_DSTAR_MY_CS}, C_CTL_DVT, S_DVT_DSMYCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 12 },
|
||||
{ {.t=TOK_DSTAR_TX_CS}, C_CTL_DVT, S_DVT_DSTXCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 24 },
|
||||
{ {.t=TOK_DSTAR_TX_MESS}, C_CTL_DVT, S_DVT_DSTXMS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 20 },
|
||||
{ {.t=TOK_DRIVE_GAIN}, C_CTL_LVL, S_LVL_DRIVE, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 },
|
||||
{ {.t=TOK_DIGI_SEL_FUNC}, C_CTL_FUNC, S_FUNC_DIGISEL, SC_MOD_RW, 1, {0}, CMD_DAT_BOL, 1 },
|
||||
{ {.t=TOK_DIGI_SEL_LEVEL}, C_CTL_LVL, S_LVL_DIGI, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 },
|
||||
{ {.t=TOK_SCOPE_DAT}, C_CTL_SCP, S_SCP_DAT, SC_MOD_RD, 0, {0}, CMD_DAT_BUF, 481 },
|
||||
{ {.t=TOK_SCOPE_STS}, C_CTL_SCP, S_SCP_STS, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 },
|
||||
{ {.t=TOK_SCOPE_DOP}, C_CTL_SCP, S_SCP_DOP, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 },
|
||||
{ {.t=TOK_SCOPE_MSS}, C_CTL_SCP, S_SCP_MSS, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 },
|
||||
{ {.t=TOK_SCOPE_MOD}, C_CTL_SCP, S_SCP_MOD, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 },
|
||||
{ {.t=TOK_SCOPE_SPN}, C_CTL_SCP, S_SCP_SPN, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 6 },
|
||||
{ {.t=TOK_SCOPE_EDG}, C_CTL_SCP, S_SCP_EDG, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 },
|
||||
{ {.t=TOK_SCOPE_HLD}, C_CTL_SCP, S_SCP_HLD, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 },
|
||||
{ {.t=TOK_SCOPE_REF}, C_CTL_SCP, S_SCP_REF, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 4 },
|
||||
{ {.t=TOK_SCOPE_SWP}, C_CTL_SCP, S_SCP_SWP, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 },
|
||||
{ {.t=TOK_SCOPE_STX}, C_CTL_SCP, S_SCP_STX, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 },
|
||||
{ {.t=TOK_SCOPE_TYP}, C_CTL_SCP, S_SCP_TYP, SC_MOD_RW, 0, {0}, CMD_DAT_INT, 1 },
|
||||
{ {.t=TOK_SCOPE_VBW}, C_CTL_SCP, S_SCP_VBW, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 },
|
||||
{ {.t=TOK_SCOPE_FEF}, C_CTL_SCP, S_SCP_FEF, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 12 },
|
||||
{ {0} }
|
||||
};
|
||||
|
||||
/*
|
||||
* Please, if the default CI-V address of your rig is listed as UNKNOWN_ADDR,
|
||||
* send the value to <fillods@users.sourceforge.net> for inclusion. Thanks --SF
|
||||
|
@ -1616,6 +1690,7 @@ int icom_set_vfo(RIG *rig, vfo_t vfo)
|
|||
return -RIG_ERJCTED;
|
||||
}
|
||||
|
||||
priv->curr_vfo = vfo;
|
||||
return RIG_OK;
|
||||
|
||||
case RIG_VFO_MEM:
|
||||
|
@ -1634,6 +1709,7 @@ int icom_set_vfo(RIG *rig, vfo_t vfo)
|
|||
return -RIG_ERJCTED;
|
||||
}
|
||||
|
||||
priv->curr_vfo = vfo;
|
||||
return RIG_OK;
|
||||
|
||||
case RIG_VFO_MAIN_A: // we need to select Main before setting VFO
|
||||
|
@ -1653,6 +1729,7 @@ int icom_set_vfo(RIG *rig, vfo_t vfo)
|
|||
return -RIG_ERJCTED;
|
||||
}
|
||||
|
||||
priv->curr_vfo = vfo;
|
||||
return RIG_OK;
|
||||
|
||||
break;
|
||||
|
@ -1674,6 +1751,7 @@ int icom_set_vfo(RIG *rig, vfo_t vfo)
|
|||
return -RIG_ERJCTED;
|
||||
}
|
||||
|
||||
priv->curr_vfo = vfo;
|
||||
return RIG_OK;
|
||||
|
||||
break;
|
||||
|
@ -1703,6 +1781,121 @@ int icom_set_vfo(RIG *rig, vfo_t vfo)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
int icom_set_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t val)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
unsigned char cmdbuf[MAXFRAMELEN];
|
||||
int cmdlen = 0;
|
||||
unsigned char ackbuf[MAXFRAMELEN];
|
||||
int acklen = 0;
|
||||
|
||||
if (!(par->submod & SC_MOD_WR)) return -RIG_EINVAL;
|
||||
if ((par->submod & SC_MOD_RW12) == SC_MOD_RW12) {
|
||||
cmdbuf[0] = 0x01;
|
||||
cmdlen = 1;
|
||||
} else {
|
||||
cmdlen = par->sublen;
|
||||
memcpy(cmdbuf, par->subext, cmdlen);
|
||||
}
|
||||
int wrd = val.i;
|
||||
int i;
|
||||
switch (par->dattyp) {
|
||||
case CMD_DAT_WRD:
|
||||
for (i = 1; i <= par->datlen; i++) {
|
||||
cmdbuf[cmdlen + par->datlen - i] = wrd & 0xff;
|
||||
wrd >>= 8;
|
||||
}
|
||||
break;
|
||||
case CMD_DAT_BUF:
|
||||
memcpy(&cmdbuf[cmdlen], val.b.d, par->datlen);
|
||||
break;
|
||||
case CMD_DAT_INT:
|
||||
case CMD_DAT_BOL:
|
||||
to_bcd_be(&cmdbuf[cmdlen], val.i, (par->datlen * 2));
|
||||
break;
|
||||
case CMD_DAT_FLT:
|
||||
to_bcd_be(&cmdbuf[cmdlen], (int) val.f, (cmdlen * 2));
|
||||
break;
|
||||
case CMD_DAT_LVL:
|
||||
to_bcd_be(&cmdbuf[cmdlen], (int)(val.f * 255.0), (cmdlen * 2));
|
||||
break;
|
||||
case CMD_DAT_TIM:
|
||||
to_bcd_be(&cmdbuf[cmdlen], ((((int)val.f / 3600) * 100) + (((int)val.f / 60) % 60)), (par->datlen * 2));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
cmdlen += par->datlen;
|
||||
return icom_transaction(rig, par->command, par->subcmd, cmdbuf, cmdlen, ackbuf, &acklen);
|
||||
}
|
||||
|
||||
int icom_get_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t *val)
|
||||
{
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
unsigned char ssc = 0x02;
|
||||
unsigned char resbuf[MAXFRAMELEN];
|
||||
int reslen = sizeof(resbuf);
|
||||
int retval;
|
||||
|
||||
if (!(par->submod & SC_MOD_RD)) return -RIG_EINVAL;
|
||||
if ((par->submod & SC_MOD_RW12) == SC_MOD_RW12) {
|
||||
retval = icom_get_raw_buf(rig, par->command, par->subcmd, 1, &ssc, &reslen, resbuf);
|
||||
} else {
|
||||
retval = icom_get_raw_buf(rig, par->command, par->subcmd,
|
||||
par->sublen, (unsigned char *)par->subext, &reslen, resbuf);
|
||||
}
|
||||
if (retval != RIG_OK) {
|
||||
return retval;
|
||||
}
|
||||
switch (par->dattyp) {
|
||||
case CMD_DAT_WRD: {
|
||||
int wrd = 0;
|
||||
int i;
|
||||
for (i = 0; i < par->datlen; i++) {
|
||||
wrd = (wrd << 8) + resbuf[i];
|
||||
}
|
||||
val->i = wrd;
|
||||
}
|
||||
break;
|
||||
case CMD_DAT_STR:
|
||||
if (strlen(val->s) < reslen) {
|
||||
return -RIG_EINTERNAL;
|
||||
}
|
||||
memcpy(val->s, resbuf, reslen);
|
||||
val->s[reslen] = 0;
|
||||
break;
|
||||
case CMD_DAT_BUF:
|
||||
if (reslen > val->b.l) {
|
||||
return -RIG_EINTERNAL;
|
||||
}
|
||||
memcpy(val->b.d, resbuf, reslen);
|
||||
val->b.l = reslen;
|
||||
break;
|
||||
case CMD_DAT_INT:
|
||||
val->i = from_bcd_be(resbuf, (reslen * 2));
|
||||
break;
|
||||
case CMD_DAT_FLT:
|
||||
val->f = (float) from_bcd_be(resbuf, (reslen * 2));
|
||||
break;
|
||||
case CMD_DAT_LVL:
|
||||
val->f = (float) from_bcd_be(resbuf, (reslen * 2)) / 255.0;
|
||||
break;
|
||||
case CMD_DAT_BOL:
|
||||
val->i = (from_bcd_be(resbuf, (reslen * 2)) == 0) ? 0 : 1;
|
||||
break;
|
||||
case CMD_DAT_TIM:
|
||||
val->i = (from_bcd_be(resbuf, 2) * 3600) + (from_bcd_be(&resbuf[1], 2) * 60);
|
||||
break;
|
||||
default:
|
||||
val->i = 0;
|
||||
break;
|
||||
}
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* icom_set_level
|
||||
* Assumes rig!=NULL, rig->state.priv!=NULL
|
||||
|
@ -1719,6 +1912,14 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
(const struct icom_priv_caps *) rig->caps->priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
const struct cmdparams *cmd = priv_caps->riglevels;
|
||||
for (i = 0; cmd && cmd[i].id.s != 0; i++) {
|
||||
if (cmd[i].id.s == level) {
|
||||
return icom_set_cmd(rig,vfo, (struct cmdparams *)&cmd[i], val);
|
||||
}
|
||||
}
|
||||
|
||||
rs = &rig->state;
|
||||
|
||||
/*
|
||||
|
@ -2064,6 +2265,16 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
(const struct icom_priv_caps *) rig->caps->priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
const struct icom_priv_caps *priv = rig->caps->priv;
|
||||
const struct cmdparams *cmd = priv->riglevels;
|
||||
int i;
|
||||
for (i = 0; cmd && cmd[i].id.s != 0; i++) {
|
||||
if (cmd[i].id.s == level) {
|
||||
return icom_get_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val);
|
||||
}
|
||||
}
|
||||
|
||||
rs = &rig->state;
|
||||
|
||||
lvl2_len = 0;
|
||||
|
@ -2501,85 +2712,78 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* icom_set_ext_level
|
||||
* Assumes rig!=NULL, rig->state.priv!=NULL
|
||||
*/
|
||||
int icom_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
switch (token)
|
||||
{
|
||||
case TOK_DRIVE_GAIN:
|
||||
return icom_set_raw(rig, C_CTL_LVL, S_LVL_DRIVE, 0, NULL, 2,
|
||||
(int) val.f);
|
||||
|
||||
case TOK_DIGI_SEL_FUNC:
|
||||
return icom_set_raw(rig, C_CTL_FUNC, S_FUNC_DIGISEL, 0, NULL, 1,
|
||||
val.i ? 1 : 0);
|
||||
|
||||
case TOK_DIGI_SEL_LEVEL:
|
||||
return icom_set_raw(rig, C_CTL_LVL, S_LVL_DIGI, 0, NULL, 2,
|
||||
(int) val.f);
|
||||
|
||||
default:
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
return icom_set_ext_cmd(rig, vfo, token, val);
|
||||
}
|
||||
|
||||
/*
|
||||
* icom_get_ext_level
|
||||
* Assumes rig!=NULL, rig->state.priv!=NULL, val!=NULL
|
||||
*/
|
||||
int icom_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val)
|
||||
{
|
||||
int icom_val;
|
||||
int retval;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
return icom_get_ext_cmd(rig, vfo, token, val);
|
||||
}
|
||||
|
||||
int icom_set_ext_parm(RIG *rig, token_t token, value_t val)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
return icom_set_ext_cmd(rig, RIG_VFO_NONE, token, val);
|
||||
}
|
||||
|
||||
int icom_get_ext_parm(RIG *rig, token_t token, value_t *val)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
return icom_get_ext_cmd(rig, RIG_VFO_NONE, token, val);
|
||||
}
|
||||
|
||||
int icom_get_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t *val)
|
||||
{
|
||||
int i;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
switch (token)
|
||||
{
|
||||
case TOK_DRIVE_GAIN:
|
||||
retval = icom_get_raw(rig, C_CTL_LVL, S_LVL_DRIVE, 0, NULL, &icom_val);
|
||||
for (i = 0; rig->caps->ext_tokens && rig->caps->ext_tokens[i] != TOK_BACKEND_NONE; i++) {
|
||||
if (rig->caps->ext_tokens[i] == token) {
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
const struct icom_priv_caps *priv = rig->caps->priv;
|
||||
const struct cmdparams *cmd = priv->extcmds ? priv->extcmds : icom_ext_cmd;
|
||||
for (i = 0; (cmd[i].id.t != 0) || (cmd != icom_ext_cmd); ) {
|
||||
if (cmd[i].id.t == 0) {
|
||||
cmd = icom_ext_cmd;
|
||||
i = 0;
|
||||
} else if (cmd[i].id.t == token) {
|
||||
return icom_get_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val);
|
||||
} else i++;
|
||||
}
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
val->f = (float) icom_val;
|
||||
break;
|
||||
|
||||
case TOK_DIGI_SEL_FUNC:
|
||||
retval =
|
||||
icom_get_raw(rig, C_CTL_FUNC, S_FUNC_DIGISEL, 0, NULL, &icom_val);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
val->i = icom_val ? 1 : 0;
|
||||
break;
|
||||
|
||||
case TOK_DIGI_SEL_LEVEL:
|
||||
retval = icom_get_raw(rig, C_CTL_LVL, S_LVL_DIGI, 0, NULL, &icom_val);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
val->f = (float) icom_val;
|
||||
break;
|
||||
|
||||
default:
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
int icom_set_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t val)
|
||||
{
|
||||
int i;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
for (i = 0; rig->caps->ext_tokens && rig->caps->ext_tokens[i] != TOK_BACKEND_NONE; i++) {
|
||||
if (rig->caps->ext_tokens[i] == token) {
|
||||
|
||||
const struct icom_priv_caps *priv = rig->caps->priv;
|
||||
const struct cmdparams *cmd = priv->extcmds ? priv->extcmds : icom_ext_cmd;
|
||||
for (i = 0; (cmd[i].id.t != 0) || (cmd != icom_ext_cmd); ) {
|
||||
if (cmd[i].id.t == 0) {
|
||||
cmd = icom_ext_cmd;
|
||||
i = 0;
|
||||
} else if (cmd[i].id.t == token) {
|
||||
return icom_set_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val);
|
||||
} else i++;
|
||||
}
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
}
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -4302,6 +4506,14 @@ int icom_set_parm(RIG *rig, setting_t parm, value_t val)
|
|||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
int i;
|
||||
const struct icom_priv_caps *priv = rig->caps->priv;
|
||||
const struct cmdparams *cmd = priv->rigparms;
|
||||
for (i = 0; cmd && cmd[i].id.s != 0; i++) {
|
||||
if (cmd[i].id.s == parm) {
|
||||
return icom_set_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&cmd[i], val);
|
||||
}
|
||||
}
|
||||
switch (parm)
|
||||
{
|
||||
case RIG_PARM_ANN:
|
||||
|
@ -4353,6 +4565,15 @@ int icom_get_parm(RIG *rig, setting_t parm, value_t *val)
|
|||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
const struct icom_priv_caps *priv = rig->caps->priv;
|
||||
const struct cmdparams *cmd = priv->rigparms;
|
||||
int i;
|
||||
for (i = 0; cmd && cmd[i].id.s != 0; i++) {
|
||||
if (cmd[i].id.s == parm) {
|
||||
return icom_get_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&cmd[i], val);
|
||||
}
|
||||
}
|
||||
|
||||
switch (parm)
|
||||
{
|
||||
default:
|
||||
|
|
|
@ -105,6 +105,20 @@ struct icom_agc_level
|
|||
icom_level; /* Icom AGC level for C_CTL_FUNC (0x16), S_FUNC_AGC (0x12) command */
|
||||
};
|
||||
|
||||
struct cmdparams { /* Lookup table item for levels & parms */
|
||||
union {
|
||||
setting_t s; /* Level or parm */
|
||||
token_t t; /* TOKEN_BACKEND */
|
||||
} id;
|
||||
int command; /* CI-V command */
|
||||
int subcmd; /* CI-V Subcommand */
|
||||
int submod; /* Subcommand modifier */
|
||||
int sublen; /* Number of bytes for subcommand extension */
|
||||
unsigned char subext[4]; /* Subcommand extension bytes */
|
||||
int dattyp; /* Data type conversion */
|
||||
int datlen; /* Number of data bytes in frame */
|
||||
};
|
||||
|
||||
struct icom_priv_caps
|
||||
{
|
||||
unsigned char re_civ_addr; /* the remote dlft equipment's CI-V address*/
|
||||
|
@ -121,12 +135,14 @@ struct icom_priv_caps
|
|||
to convert response
|
||||
tokens to bandwidth and
|
||||
mode */
|
||||
int serial_full_duplex; /*!< Whether RXD&TXD are not tied together */
|
||||
int offs_len; /* Number of bytes in offset frequency field. 0 defaults to 3 */
|
||||
int serial_USB_echo_check; /* Flag to test USB echo state */
|
||||
int agc_levels_present; /* Flag to indicate that agc_levels array is populated */
|
||||
struct icom_agc_level agc_levels[RIG_AGC_LAST +
|
||||
1]; /* Icom rig-specific AGC levels, the last entry should have level -1 */
|
||||
int serial_full_duplex; /*!< Whether RXD&TXD are not tied together */
|
||||
int offs_len; /* Number of bytes in offset frequency field. 0 defaults to 3 */
|
||||
int serial_USB_echo_check; /* Flag to test USB echo state */
|
||||
int agc_levels_present; /* Flag to indicate that agc_levels array is populated */
|
||||
struct icom_agc_level agc_levels[RIG_AGC_LAST + 1]; /* Icom rig-specific AGC levels, the last entry should have level -1 */
|
||||
struct cmdparams *rigparms; /* Pointer to rig custom parameters array */
|
||||
struct cmdparams *riglevels;/* Pointer to rig custom levels array */
|
||||
struct cmdparams *extcmds; /* Pointer to extended operations array */
|
||||
};
|
||||
|
||||
|
||||
|
@ -228,6 +244,10 @@ int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
|||
int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
|
||||
int icom_set_parm(RIG *rig, setting_t parm, value_t val);
|
||||
int icom_get_parm(RIG *rig, setting_t parm, value_t *val);
|
||||
int icom_set_ext_parm(RIG *rig, token_t token, value_t val);
|
||||
int icom_get_ext_parm(RIG *rig, token_t token, value_t *val);
|
||||
int icom_set_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t val);
|
||||
int icom_get_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t *val);
|
||||
int icom_set_conf(RIG *rig, token_t token, const char *val);
|
||||
int icom_get_conf(RIG *rig, token_t token, char *val);
|
||||
int icom_set_powerstat(RIG *rig, powerstat_t status);
|
||||
|
@ -262,6 +282,9 @@ int icom_get_custom_parm_time(RIG *rig, int parmbuflen, unsigned char *parmbuf,
|
|||
int *seconds);
|
||||
|
||||
extern const struct confparams icom_cfg_params[];
|
||||
extern const struct confparams icom_ext_parms[];
|
||||
extern const struct cmdparams icom_rig_cmds[];
|
||||
extern const struct cmdparams icom_ext_cmds[];
|
||||
|
||||
extern const struct rig_caps ic703_caps;
|
||||
extern const struct rig_caps ic706_caps;
|
||||
|
|
|
@ -92,9 +92,12 @@
|
|||
#define C_CTL_MEM 0x1a /* Misc memory/bank/rig control functions, Sc */
|
||||
#define C_SET_TONE 0x1b /* Set tone frequency */
|
||||
#define C_CTL_PTT 0x1c /* Control Transmit On/Off, Sc */
|
||||
#define C_CTL_DVT 0x1f /* Digital modes calsigns & messages */
|
||||
#define C_CTL_DIG 0x20 /* Digital modes settings & status */
|
||||
#define C_CTL_RIT 0x21 /* RIT/XIT control */
|
||||
#define C_CTL_DSD 0x22 /* D-STAR Data */
|
||||
#define C_SEND_SEL_FREQ 0x25 /* Send/Recv sel/unsel VFO frequency */
|
||||
#define C_CTL_SCP 0x27 /* Scope control & data */
|
||||
#define C_CTL_MTEXT 0x70 /* Microtelecom Extension */
|
||||
#define C_CTL_MISC 0x7f /* Miscellaneous control, Sc */
|
||||
|
||||
|
@ -411,6 +414,8 @@
|
|||
|
||||
/* IC-R30 */
|
||||
#define S_MEM_ANL 0x00 /* ANL Off/On */
|
||||
#define S_MEM_EAR 0x01 /* Earphone mode Off/On */
|
||||
#define S_MEM_REC 0x09 /* Recorder Off/On */
|
||||
|
||||
/*
|
||||
* Tone control (C_SET_TONE) subcommands
|
||||
|
@ -442,14 +447,35 @@
|
|||
#define S_DIG_DSGPSD 0x03 /* D-STAR GPS data */
|
||||
#define S_DIG_DSGPSM 0x04 /* D-STAR GPS message */
|
||||
#define S_DIG_DSCSQL 0x05 /* D-STAR CSQL */
|
||||
#define S_DIG_P25ID 0x06 /* P25 ID */
|
||||
#define S_DIG_P25ID 0x06 /* P25 ID */
|
||||
#define S_DIG_P25STS 0x07 /* P25 Rx status */
|
||||
#define S_DIG_DPRXID 0x08 /* dPMR Rx ID */
|
||||
#define S_DIG_DPRSTS 0x09 /* dPMR Rx status */
|
||||
#define S_DIG_NXRXID 0x0A /* NXDN Rx ID */
|
||||
#define S_DIG_NXRSTS 0x0B /* NXDN Rx status */
|
||||
#define S_DIG_DCRXID 0x0C /* DCR Rx ID */
|
||||
#define S_DIG_DCRSTS 0x0D /* DCR Rx status */
|
||||
#define S_DVT_DSMYCS 0x00 /* D-STAR My CS */
|
||||
#define S_DVT_DSTXCS 0x01 /* D-STAR Tx CS */
|
||||
#define S_DVT_DSTXMS 0x02 /* D-STAR Tx Mess */
|
||||
#define S_DSD_DSTXDT 0x00 /* D-STAR Tx Data */
|
||||
|
||||
/*
|
||||
* S_CTL_SCP Scope control & data subcommands
|
||||
*/
|
||||
#define S_SCP_DAT 0x00 /* Read data */
|
||||
#define S_SCP_STS 0x10 /* On/Off status */
|
||||
#define S_SCP_DOP 0x11 /* Data O/P Control */
|
||||
#define S_SCP_MSS 0x12 /* Main/Sub setting */
|
||||
#define S_SCP_MOD 0x14 /* Centre/Fixed mode */
|
||||
#define S_SCP_SPN 0x15 /* Span setting */
|
||||
#define S_SCP_EDG 0x16 /* Edge setting */
|
||||
#define S_SCP_HLD 0x17 /* Hold On/Off */
|
||||
#define S_SCP_REF 0x19 /* Reference level */
|
||||
#define S_SCP_SWP 0x1a /* Sweep speed */
|
||||
#define S_SCP_STX 0x1b /* Scope during Tx */
|
||||
#define S_SCP_TYP 0x1c /* Display type */
|
||||
#define S_SCP_VBW 0x1d /* VBW setting */
|
||||
#define S_SCP_FEF 0x1e /* Fixed edge freqs */
|
||||
|
||||
/*
|
||||
* C_CTL_MISC OptoScan extension
|
||||
|
@ -502,5 +528,52 @@
|
|||
#define TOK_DRIVE_GAIN TOKEN_BACKEND(103)
|
||||
#define TOK_DIGI_SEL_FUNC TOKEN_BACKEND(104)
|
||||
#define TOK_DIGI_SEL_LEVEL TOKEN_BACKEND(105)
|
||||
#define TOK_DSTAR_CALL_SIGN TOKEN_BACKEND(120)
|
||||
#define TOK_DSTAR_MESSAGE TOKEN_BACKEND(121)
|
||||
#define TOK_DSTAR_STATUS TOKEN_BACKEND(122)
|
||||
#define TOK_DSTAR_GPS_DATA TOKEN_BACKEND(123)
|
||||
#define TOK_DSTAR_GPS_MESS TOKEN_BACKEND(124)
|
||||
#define TOK_DSTAR_DSQL TOKEN_BACKEND(125)
|
||||
#define TOK_DSTAR_MY_CS TOKEN_BACKEND(126)
|
||||
#define TOK_DSTAR_TX_CS TOKEN_BACKEND(127)
|
||||
#define TOK_DSTAR_TX_MESS TOKEN_BACKEND(128)
|
||||
#define TOK_DSTAR_TX_DATA TOKEN_BACKEND(129)
|
||||
#define TOK_DSTAR_CODE TOKEN_BACKEND(130)
|
||||
#define TOK_SCOPE_DAT TOKEN_BACKEND(131)
|
||||
#define TOK_SCOPE_STS TOKEN_BACKEND(132)
|
||||
#define TOK_SCOPE_DOP TOKEN_BACKEND(133)
|
||||
#define TOK_SCOPE_MSS TOKEN_BACKEND(134)
|
||||
#define TOK_SCOPE_MOD TOKEN_BACKEND(135)
|
||||
#define TOK_SCOPE_SPN TOKEN_BACKEND(136)
|
||||
#define TOK_SCOPE_EDG TOKEN_BACKEND(137)
|
||||
#define TOK_SCOPE_HLD TOKEN_BACKEND(138)
|
||||
#define TOK_SCOPE_REF TOKEN_BACKEND(139)
|
||||
#define TOK_SCOPE_SWP TOKEN_BACKEND(140)
|
||||
#define TOK_SCOPE_STX TOKEN_BACKEND(141)
|
||||
#define TOK_SCOPE_TYP TOKEN_BACKEND(142)
|
||||
#define TOK_SCOPE_VBW TOKEN_BACKEND(143)
|
||||
#define TOK_SCOPE_FEF TOKEN_BACKEND(144)
|
||||
|
||||
/*
|
||||
* icom_ext_parm table subcommand modifiers
|
||||
*/
|
||||
|
||||
#define SC_MOD_RD 0x01 /* Readable */
|
||||
#define SC_MOD_WR 0x02 /* Writeable */
|
||||
#define SC_MOD_RW 0x03 /* Read-write */
|
||||
#define SC_MOD_RW12 0x07 /* Write +0x01, Read +0x02 */
|
||||
|
||||
/*
|
||||
* icom_ext_parm table data types
|
||||
*/
|
||||
|
||||
#define CMD_DAT_WRD 0x00 /* literal single word type */
|
||||
#define CMD_DAT_INT 0x01 /* bcd int type */
|
||||
#define CMD_DAT_FLT 0x02 /* bcd float type */
|
||||
#define CMD_DAT_LVL 0x03 /* bcd level type */
|
||||
#define CMD_DAT_BOL 0x04 /* bcd boolean type */
|
||||
#define CMD_DAT_STR 0x05 /* string type */
|
||||
#define CMD_DAT_BUF 0x06 /* literal byte buffer type */
|
||||
#define CMD_DAT_TIM 0x07 /* Time type HHMM<>seconds */
|
||||
|
||||
#endif /* _ICOM_DEFS_H */
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#include "hamlib/rig.h"
|
||||
#include "token.h"
|
||||
#include "icom.h"
|
||||
#include "idx_builtin.h"
|
||||
#include "icom_defs.h"
|
||||
|
@ -42,11 +43,34 @@
|
|||
#define ICR30_LEVEL_ALL (RIG_LEVEL_ATT|RIG_LEVEL_AF|RIG_LEVEL_RF|\
|
||||
RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH)
|
||||
|
||||
#define ICR30_VFO_ALL (RIG_VFO_A)
|
||||
#define ICR30_VFO_ALL (RIG_VFO_MAIN|RIG_VFO_SUB)
|
||||
|
||||
#define ICR30_VFO_OPS (RIG_VFO_MAIN|RIG_VFO_SUB)
|
||||
#define ICR30_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL)
|
||||
#define ICR30_SCAN_OPS (RIG_SCAN_NONE)
|
||||
|
||||
#define TOK_ANL TOKEN_BACKEND(001)
|
||||
#define TOK_EAR TOKEN_BACKEND(002)
|
||||
#define TOK_REC TOKEN_BACKEND(003)
|
||||
|
||||
int icr30_tokens[] = { TOK_ANL, TOK_EAR, TOK_REC,
|
||||
TOK_DSTAR_DSQL, TOK_DSTAR_CALL_SIGN, TOK_DSTAR_MESSAGE, TOK_DSTAR_STATUS,
|
||||
TOK_DSTAR_GPS_DATA, TOK_DSTAR_GPS_MESS, TOK_DSTAR_CODE, TOK_DSTAR_TX_DATA,
|
||||
TOK_BACKEND_NONE };
|
||||
|
||||
struct confparams icr30_ext[] = {
|
||||
{ TOK_ANL, "anl", "Auto noise limiter", "", "", RIG_CONF_CHECKBUTTON, {} },
|
||||
{ TOK_EAR, "ear", "Earphone mode", "", "", RIG_CONF_CHECKBUTTON, {} },
|
||||
{ TOK_REC, "record", "Recorder on/off", "", "", RIG_CONF_CHECKBUTTON, {} },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
struct cmdparams icr30_extcmds[] = {
|
||||
{ {.t=TOK_ANL}, C_CTL_MEM, S_MEM_ANL, SC_MOD_RW, 0, {}, CMD_DAT_BOL, 1 },
|
||||
{ {.t=TOK_EAR}, C_CTL_MEM, S_MEM_EAR, SC_MOD_RW, 0, {}, CMD_DAT_BOL, 1 },
|
||||
{ {.t=TOK_REC}, C_CTL_MEM, S_MEM_REC, SC_MOD_WR, 0, {}, CMD_DAT_BOL, 1 },
|
||||
{ {0} }
|
||||
};
|
||||
|
||||
#define ICR30_STR_CAL { 2, \
|
||||
{ \
|
||||
{ 0, -60 }, /* S0 */ \
|
||||
|
@ -96,7 +120,8 @@ static const struct icom_priv_caps icr30_priv_caps =
|
|||
0, /* no XCHG */
|
||||
r8500_ts_sc_list, /* wrong, but don't have set_ts anyway */
|
||||
.r2i_mode = icr30_r2i_mode,
|
||||
.offs_len = 4
|
||||
.offs_len = 4,
|
||||
.extcmds = icr30_extcmds /* Custom ext_parm parameters */
|
||||
};
|
||||
|
||||
const struct rig_caps icr30_caps =
|
||||
|
@ -126,11 +151,14 @@ const struct rig_caps icr30_caps =
|
|||
.has_get_level = ICR30_LEVEL_ALL,
|
||||
.has_set_level = RIG_LEVEL_SET(ICR30_LEVEL_ALL),
|
||||
.has_get_parm = RIG_PARM_NONE,
|
||||
.has_set_parm = RIG_PARM_NONE, /* FIXME: parms */
|
||||
.has_set_parm = RIG_PARM_NONE,
|
||||
.level_gran = {
|
||||
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
|
||||
},
|
||||
.parm_gran = {},
|
||||
.ext_tokens = icr30_tokens,
|
||||
.extlevels = icr30_ext,
|
||||
.extparms = icom_ext_parms,
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = common_dcs_list,
|
||||
.preamp = { RIG_DBLST_END, },
|
||||
|
@ -197,9 +225,10 @@ const struct rig_caps icr30_caps =
|
|||
},
|
||||
.str_cal = ICR30_STR_CAL,
|
||||
|
||||
.cfgparams = icom_cfg_params,
|
||||
.set_conf = icom_set_conf,
|
||||
.get_conf = icom_get_conf,
|
||||
.cfgparams = icom_cfg_params,
|
||||
.set_conf = icom_set_conf,
|
||||
.get_conf = icom_get_conf,
|
||||
.set_powerstat = icom_set_powerstat,
|
||||
|
||||
.priv = (void *)& icr30_priv_caps,
|
||||
.rig_init = icom_init,
|
||||
|
@ -217,20 +246,26 @@ const struct rig_caps icr30_caps =
|
|||
.get_rptr_offs = icom_get_rptr_offs,
|
||||
.set_rptr_shift = icom_set_rptr_shift,
|
||||
.get_rptr_shift = icom_get_rptr_shift,
|
||||
.set_ts = icom_set_ts,
|
||||
.get_ts = icom_get_ts,
|
||||
.set_ant = icom_set_ant,
|
||||
.get_ant = icom_get_ant,
|
||||
.set_ts = icom_set_ts,
|
||||
.get_ts = icom_get_ts,
|
||||
.set_ant = icom_set_ant,
|
||||
.get_ant = icom_get_ant,
|
||||
.set_bank = icom_set_bank,
|
||||
.set_mem = icom_set_mem,
|
||||
.decode_event = icom_decode_event,
|
||||
.set_level = icom_set_level,
|
||||
.get_level = icom_get_level,
|
||||
.set_func = icom_set_func,
|
||||
.get_func = icom_get_func,
|
||||
.get_dcd = icom_get_dcd,
|
||||
.set_ctcss_sql = icom_set_ctcss_sql,
|
||||
.get_ctcss_sql = icom_get_ctcss_sql,
|
||||
.set_dcs_sql = icom_set_dcs_sql,
|
||||
.get_dcs_sql = icom_get_dcs_sql,
|
||||
.set_level = icom_set_level,
|
||||
.get_level = icom_get_level,
|
||||
.set_func = icom_set_func,
|
||||
.get_func = icom_get_func,
|
||||
.set_parm = icom_set_parm,
|
||||
.get_parm = icom_get_parm,
|
||||
.set_ext_parm = icom_set_ext_parm,
|
||||
.get_ext_parm = icom_get_ext_parm,
|
||||
.set_ext_level = icom_set_ext_level,
|
||||
.get_ext_level = icom_get_ext_level,
|
||||
.get_dcd = icom_get_dcd,
|
||||
.set_ctcss_sql = icom_set_ctcss_sql,
|
||||
.get_ctcss_sql = icom_get_ctcss_sql,
|
||||
.set_dcs_sql = icom_set_dcs_sql,
|
||||
.get_dcs_sql = icom_get_dcs_sql,
|
||||
};
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "hamlib/rig.h"
|
||||
#include "misc.h"
|
||||
#include "idx_builtin.h"
|
||||
#include "token.h"
|
||||
|
||||
#include "icom.h"
|
||||
#include "icom_defs.h"
|
||||
|
@ -49,12 +50,12 @@
|
|||
RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_PREAMP|\
|
||||
RIG_LEVEL_AGC|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH)
|
||||
|
||||
#define ICR8600_PARM_ALL (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|\
|
||||
RIG_PARM_BEEP|RIG_PARM_TIME|RIG_PARM_KEYLIGHT)
|
||||
#define ICR8600_PARM_ALL (RIG_PARM_BACKLIGHT|RIG_PARM_BEEP|RIG_PARM_TIME|RIG_PARM_KEYLIGHT)
|
||||
|
||||
#define ICR8600_VFO_ALL (RIG_VFO_VFO|RIG_VFO_MEM)
|
||||
|
||||
#define ICR8600_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL)
|
||||
|
||||
#define ICR8600_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_VFO|RIG_SCAN_SLCT|\
|
||||
RIG_SCAN_PRIO|RIG_SCAN_PRIO|RIG_SCAN_DELTA|RIG_SCAN_STOP)
|
||||
|
||||
|
@ -66,6 +67,28 @@
|
|||
{ 255, 60 }, \
|
||||
} }
|
||||
|
||||
struct cmdparams icr8600_rigparms[] = {
|
||||
{ {.s=RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x38}, CMD_DAT_BOL, 1 },
|
||||
{ {.s=RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x15}, CMD_DAT_LVL, 2 },
|
||||
{ {.s=RIG_PARM_KEYLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x16}, CMD_DAT_LVL, 2 },
|
||||
{ {.s=RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x32}, CMD_DAT_TIM, 2 },
|
||||
{ {.s=RIG_PARM_NONE} }
|
||||
};
|
||||
|
||||
int icr8600_tokens[] = { TOK_DSTAR_DSQL, TOK_DSTAR_CALL_SIGN, TOK_DSTAR_MESSAGE, TOK_DSTAR_STATUS,
|
||||
TOK_DSTAR_GPS_DATA, TOK_DSTAR_GPS_MESS, TOK_DSTAR_CODE, TOK_DSTAR_TX_DATA,
|
||||
TOK_SCOPE_DAT, TOK_SCOPE_STS, TOK_SCOPE_DOP, TOK_SCOPE_MSS, TOK_SCOPE_MOD, TOK_SCOPE_SPN,
|
||||
TOK_SCOPE_HLD, TOK_SCOPE_REF, TOK_SCOPE_SWP, TOK_SCOPE_TYP, TOK_SCOPE_VBW, TOK_SCOPE_FEF,
|
||||
TOK_BACKEND_NONE };
|
||||
|
||||
struct confparams icr8600_ext[] = {
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
struct cmdparams icr8600_extcmds[] = {
|
||||
{ {0} }
|
||||
};
|
||||
|
||||
/*
|
||||
* channel caps.
|
||||
*/
|
||||
|
@ -79,17 +102,16 @@
|
|||
.flags = 1, \
|
||||
}
|
||||
|
||||
int icr8600_set_parm(RIG *rig, setting_t parm, value_t val);
|
||||
int icr8600_get_parm(RIG *rig, setting_t parm, value_t *val);
|
||||
|
||||
static const struct icom_priv_caps icr8600_priv_caps =
|
||||
{
|
||||
0x96, /* default address */
|
||||
0, /* 731 mode */
|
||||
0, /* no XCHG */
|
||||
r8600_ts_sc_list, /* list of tuning steps */
|
||||
.offs_len = 4, /* Repeater offset is 4 bytes */
|
||||
.serial_USB_echo_check = 1 /* USB CI-V may not echo */
|
||||
0x96, /* default address */
|
||||
0, /* 731 mode */
|
||||
0, /* no XCHG */
|
||||
r8600_ts_sc_list, /* list of tuning steps */
|
||||
.offs_len = 4, /* Repeater offset is 4 bytes */
|
||||
.serial_USB_echo_check = 1, /* USB CI-V may not echo */
|
||||
.rigparms = icr8600_rigparms, /* Custom parm parameters */
|
||||
.extcmds = icr8600_extcmds /* Custom ext_parm parameters */
|
||||
};
|
||||
|
||||
const struct rig_caps icr8600_caps =
|
||||
|
@ -105,7 +127,7 @@ const struct rig_caps icr8600_caps =
|
|||
.dcd_type = RIG_DCD_RIG,
|
||||
.port_type = RIG_PORT_SERIAL,
|
||||
.serial_rate_min = 300,
|
||||
.serial_rate_max = 19200, // USB can do up to 115000
|
||||
.serial_rate_max = 115200,
|
||||
.serial_data_bits = 8,
|
||||
.serial_stop_bits = 1,
|
||||
.serial_parity = RIG_PARITY_NONE,
|
||||
|
@ -122,6 +144,9 @@ const struct rig_caps icr8600_caps =
|
|||
.has_set_parm = RIG_PARM_SET(ICR8600_PARM_ALL),
|
||||
.level_gran = { [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } } },
|
||||
.parm_gran = { [PARM_TIME] = { .min = { .i = 0 }, .max = { .i = 86399} } },
|
||||
.ext_tokens = icr8600_tokens,
|
||||
.extlevels = icr8600_ext,
|
||||
.extparms = icom_ext_parms,
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = common_dcs_list,
|
||||
.preamp = { 20, RIG_DBLST_END, }, /* 20 on HF, 14 on VHF, UHF, same setting */
|
||||
|
@ -195,6 +220,7 @@ const struct rig_caps icr8600_caps =
|
|||
|
||||
.set_conf = icom_set_conf,
|
||||
.get_conf = icom_get_conf,
|
||||
// .set_powerstat = icom_set_powerstat,
|
||||
|
||||
.priv = (void *)& icr8600_priv_caps,
|
||||
.rig_init = icom_init,
|
||||
|
@ -220,8 +246,10 @@ const struct rig_caps icr8600_caps =
|
|||
.get_func = icom_get_func,
|
||||
.set_level = icom_set_level,
|
||||
.get_level = icom_get_level,
|
||||
.set_parm = icr8600_set_parm,
|
||||
.get_parm = icr8600_get_parm,
|
||||
.set_parm = icom_set_parm,
|
||||
.get_parm = icom_get_parm,
|
||||
.set_ext_parm = icom_set_ext_parm,
|
||||
.get_ext_parm = icom_get_ext_parm,
|
||||
.get_dcd = icom_get_dcd,
|
||||
.set_mem = icom_set_mem,
|
||||
.vfo_op = icom_vfo_op,
|
||||
|
@ -234,96 +262,3 @@ const struct rig_caps icr8600_caps =
|
|||
.get_dcs_sql = icom_get_dcs_sql,
|
||||
|
||||
};
|
||||
|
||||
int icr8600_set_parm(RIG *rig, setting_t parm, value_t val)
|
||||
{
|
||||
unsigned char parmbuf[MAXFRAMELEN];
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
switch (parm)
|
||||
{
|
||||
case RIG_PARM_BEEP:
|
||||
parmbuf[0] = 0x00;
|
||||
parmbuf[1] = 0x38;
|
||||
return icom_set_custom_parm(rig, 2, parmbuf, 1, val.i ? 1 : 0);
|
||||
|
||||
case RIG_PARM_BACKLIGHT:
|
||||
parmbuf[0] = 0x01;
|
||||
parmbuf[1] = 0x15;
|
||||
return icom_set_custom_parm(rig, 2, parmbuf, 2, (int)(val.f * 255.0f));
|
||||
|
||||
case RIG_PARM_KEYLIGHT:
|
||||
parmbuf[0] = 0x01;
|
||||
parmbuf[1] = 0x16;
|
||||
return icom_set_custom_parm(rig, 2, parmbuf, 2, val.f != 0 ? 255 : 0);
|
||||
|
||||
case RIG_PARM_TIME:
|
||||
parmbuf[0] = 0x01;
|
||||
parmbuf[1] = 0x32;
|
||||
return icom_set_custom_parm_time(rig, 2, parmbuf, val.i);
|
||||
|
||||
default:
|
||||
return icom_set_parm(rig, parm, val);
|
||||
}
|
||||
}
|
||||
|
||||
int icr8600_get_parm(RIG *rig, setting_t parm, value_t *val)
|
||||
{
|
||||
unsigned char parmbuf[MAXFRAMELEN];
|
||||
int retval;
|
||||
int icom_val;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
switch (parm)
|
||||
{
|
||||
case RIG_PARM_BEEP:
|
||||
parmbuf[0] = 0x00;
|
||||
parmbuf[1] = 0x38;
|
||||
retval = icom_get_custom_parm(rig, 2, parmbuf, &icom_val);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
val->i = icom_val ? 1 : 0;
|
||||
break;
|
||||
|
||||
case RIG_PARM_BACKLIGHT:
|
||||
parmbuf[0] = 0x01;
|
||||
parmbuf[1] = 0x15;
|
||||
retval = icom_get_custom_parm(rig, 2, parmbuf, &icom_val);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
val->f = (float) icom_val / 255.0f;
|
||||
break;
|
||||
|
||||
case RIG_PARM_KEYLIGHT:
|
||||
parmbuf[0] = 0x01;
|
||||
parmbuf[1] = 0x16;
|
||||
retval = icom_get_custom_parm(rig, 2, parmbuf, &icom_val);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
val->f = icom_val != 0;
|
||||
break;
|
||||
|
||||
case RIG_PARM_TIME:
|
||||
parmbuf[0] = 0x01;
|
||||
parmbuf[1] = 0x32;
|
||||
return icom_get_custom_parm_time(rig, 2, parmbuf, &val->i);
|
||||
|
||||
default:
|
||||
return icom_get_parm(rig, parm, val);
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ const struct rig_caps id31_caps =
|
|||
.version = BACKEND_VER ".0",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_UNTESTED,
|
||||
.rig_type = RIG_TYPE_MOBILE,
|
||||
.rig_type = RIG_TYPE_HANDHELD,
|
||||
.ptt_type = RIG_PTT_RIG,
|
||||
.dcd_type = RIG_DCD_RIG,
|
||||
.port_type = RIG_PORT_SERIAL,
|
||||
|
@ -111,6 +111,7 @@ const struct rig_caps id31_caps =
|
|||
.level_gran = {
|
||||
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
|
||||
},
|
||||
.extparms = icom_ext_parms,
|
||||
.parm_gran = {},
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = full_dcs_list,
|
||||
|
@ -185,7 +186,10 @@ const struct rig_caps id31_caps =
|
|||
.get_func = icom_get_func,
|
||||
.set_level = icom_set_level,
|
||||
.get_level = icom_get_level,
|
||||
|
||||
.set_parm = icom_set_parm,
|
||||
.get_parm = icom_get_parm,
|
||||
.set_ext_parm = icom_set_ext_parm,
|
||||
.get_ext_parm = icom_get_ext_parm,
|
||||
.set_ptt = icom_set_ptt,
|
||||
.get_ptt = icom_get_ptt,
|
||||
.get_dcd = icom_get_dcd,
|
||||
|
|
|
@ -115,6 +115,7 @@ const struct rig_caps id4100_caps =
|
|||
.level_gran = {
|
||||
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
|
||||
},
|
||||
.extparms = icom_ext_parms,
|
||||
.parm_gran = {},
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = full_dcs_list,
|
||||
|
@ -194,6 +195,10 @@ const struct rig_caps id4100_caps =
|
|||
.get_func = icom_get_func,
|
||||
.set_level = icom_set_level,
|
||||
.get_level = icom_get_level,
|
||||
.set_parm = icom_set_parm,
|
||||
.get_parm = icom_get_parm,
|
||||
.set_ext_parm = icom_set_ext_parm,
|
||||
.get_ext_parm = icom_get_ext_parm,
|
||||
|
||||
.set_ptt = icom_set_ptt,
|
||||
.get_ptt = icom_get_ptt,
|
||||
|
|
|
@ -27,8 +27,11 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#include "hamlib/rig.h"
|
||||
#include "idx_builtin.h"
|
||||
#include "token.h"
|
||||
#include "icom.h"
|
||||
#include "idx_builtin.h"
|
||||
#include "icom_defs.h"
|
||||
#include "frame.h"
|
||||
|
||||
/*
|
||||
* Specs and protocol details comes from the chapter 17 of ID-51A_E_PLUS2_CD_0.pdf
|
||||
|
@ -63,6 +66,10 @@
|
|||
|
||||
#define ID51_PARM_ALL RIG_PARM_NONE
|
||||
|
||||
int id51_tokens[] = { TOK_DSTAR_DSQL, TOK_DSTAR_CALL_SIGN, TOK_DSTAR_MESSAGE, TOK_DSTAR_STATUS,
|
||||
TOK_DSTAR_GPS_DATA, TOK_DSTAR_GPS_MESS, TOK_DSTAR_CODE, TOK_DSTAR_TX_DATA,
|
||||
TOK_DSTAR_MY_CS, TOK_DSTAR_TX_CS, TOK_DSTAR_TX_MESS,
|
||||
TOK_BACKEND_NONE };
|
||||
|
||||
/*
|
||||
* FIXME: real measurement
|
||||
|
@ -88,7 +95,7 @@ const struct rig_caps id51_caps =
|
|||
.version = BACKEND_VER ".0",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_UNTESTED,
|
||||
.rig_type = RIG_TYPE_MOBILE,
|
||||
.rig_type = RIG_TYPE_HANDHELD,
|
||||
.ptt_type = RIG_PTT_RIG,
|
||||
.dcd_type = RIG_DCD_RIG,
|
||||
.port_type = RIG_PORT_SERIAL,
|
||||
|
@ -111,6 +118,8 @@ const struct rig_caps id51_caps =
|
|||
.level_gran = {
|
||||
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
|
||||
},
|
||||
.ext_tokens = id51_tokens,
|
||||
.extparms = icom_ext_parms,
|
||||
.parm_gran = {},
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = full_dcs_list,
|
||||
|
@ -169,6 +178,7 @@ const struct rig_caps id51_caps =
|
|||
.cfgparams = icom_cfg_params,
|
||||
.set_conf = icom_set_conf,
|
||||
.get_conf = icom_get_conf,
|
||||
.set_powerstat = icom_set_powerstat,
|
||||
|
||||
.priv = (void *)& id51_priv_caps,
|
||||
.rig_init = icom_init,
|
||||
|
@ -190,6 +200,10 @@ const struct rig_caps id51_caps =
|
|||
.get_func = icom_get_func,
|
||||
.set_level = icom_set_level,
|
||||
.get_level = icom_get_level,
|
||||
.set_parm = icom_set_parm,
|
||||
.get_parm = icom_get_parm,
|
||||
.set_ext_parm = icom_set_ext_parm,
|
||||
.get_ext_parm = icom_get_ext_parm,
|
||||
|
||||
.set_ptt = icom_set_ptt,
|
||||
.get_ptt = icom_get_ptt,
|
||||
|
|
|
@ -115,6 +115,7 @@ const struct rig_caps id5100_caps =
|
|||
.level_gran = {
|
||||
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
|
||||
},
|
||||
.extparms = icom_ext_parms,
|
||||
.parm_gran = {},
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = full_dcs_list,
|
||||
|
@ -194,7 +195,11 @@ const struct rig_caps id5100_caps =
|
|||
.get_func = icom_get_func,
|
||||
.set_level = icom_set_level,
|
||||
.get_level = icom_get_level,
|
||||
|
||||
.set_parm = icom_set_parm,
|
||||
.get_parm = icom_get_parm,
|
||||
.set_ext_parm = icom_set_ext_parm,
|
||||
.get_ext_parm = icom_get_ext_parm,
|
||||
|
||||
.set_ptt = icom_set_ptt,
|
||||
.get_ptt = icom_get_ptt,
|
||||
.get_dcd = icom_get_dcd,
|
||||
|
|
|
@ -2945,6 +2945,10 @@ declare_proto_rig(set_parm)
|
|||
val.cs = arg2;
|
||||
break;
|
||||
|
||||
case RIG_CONF_BINARY:
|
||||
val.b.d = (unsigned char *)arg2;
|
||||
break;
|
||||
|
||||
default:
|
||||
return -RIG_ECONF;
|
||||
}
|
||||
|
@ -2971,6 +2975,7 @@ declare_proto_rig(get_parm)
|
|||
int status;
|
||||
setting_t parm;
|
||||
value_t val;
|
||||
char buffer[RIG_BIN_MAX];
|
||||
|
||||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
|
@ -2993,6 +2998,22 @@ declare_proto_rig(get_parm)
|
|||
return -RIG_EINVAL; /* no such parameter */
|
||||
}
|
||||
|
||||
switch (cfp->type)
|
||||
{
|
||||
case RIG_CONF_STRING:
|
||||
memset(buffer, '0', sizeof(buffer));
|
||||
buffer[sizeof(buffer)-1] = 0;
|
||||
val.s = buffer;
|
||||
break;
|
||||
case RIG_CONF_BINARY:
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
val.b.d = (unsigned char *)buffer;
|
||||
val.b.l = RIG_BIN_MAX;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
status = rig_get_ext_parm(rig, cfp->token, &val);
|
||||
|
||||
if (status != RIG_OK)
|
||||
|
@ -3024,6 +3045,10 @@ declare_proto_rig(get_parm)
|
|||
fprintf(fout, "%s\n", val.s);
|
||||
break;
|
||||
|
||||
case RIG_CONF_BINARY:
|
||||
dump_hex((unsigned char *)buffer, val.b.l);
|
||||
break;
|
||||
|
||||
default:
|
||||
return -RIG_ECONF;
|
||||
}
|
||||
|
|
|
@ -229,6 +229,7 @@ int sprintf_level_ext(char *str, const struct confparams *extlevels)
|
|||
case RIG_CONF_COMBO:
|
||||
case RIG_CONF_NUMERIC:
|
||||
case RIG_CONF_STRING:
|
||||
case RIG_CONF_BINARY:
|
||||
strcat(str, extlevels->name);
|
||||
strcat(str, " ");
|
||||
len += strlen(extlevels->name) + 1;
|
||||
|
@ -460,6 +461,9 @@ char *get_rig_conf_type(enum rig_conf_e type)
|
|||
|
||||
case RIG_CONF_BUTTON:
|
||||
return "BUTTON";
|
||||
|
||||
case RIG_CONF_BINARY:
|
||||
return "BINARY";
|
||||
}
|
||||
|
||||
return "UNKNOWN";
|
||||
|
|
Ładowanie…
Reference in New Issue