kopia lustrzana https://github.com/Hamlib/Hamlib
Merge remote-tracking branch 'Hamlib/master'
commit
86ac360e92
|
@ -333,6 +333,11 @@ Additionally, you may want to add the '--with-perl-binding' or
|
|||
'--with-python-binding' or '--with-tcl-binding' or '--with-lua-binding' if you are
|
||||
interested in SWIG binding support for those scripting languages.
|
||||
|
||||
For LUA bindinds if you run "lua luatest.lua" and see this error message:
|
||||
luatest.lua:44: Error in Rig::set_mode (arg 2), expected 'rmode_t' got 'string'
|
||||
This means you need to upgrade both swig and lua for 64-bit lua support
|
||||
This is known to work on swig 4.0.1 and lua 5.3.5
|
||||
|
||||
NOTE: The bootstrap script has only to be run the first time after a fresh
|
||||
checkout or when a Makefile.am or other build file is modified or added.
|
||||
|
||||
|
|
|
@ -112,6 +112,9 @@ function doStartup()
|
|||
|
||||
if sw2 > 0 then D = 'S' else D = 'N' end
|
||||
print(string.format("Latitude:\t%4.4f, %4.0f° %.0f' %2.0f\" %1s\trecoded: %9.4f", lat1, deg2, mins2, sec2, D, lat3))
|
||||
print(string.format("The next two lines should show 0x8000000000000000"));
|
||||
print(string.format("RIG_MODE_TESTS_MAX: 0x%08x", Hamlib.RIG_MODE_TESTS_MAX));
|
||||
print(string.format("RIG_FUNC_BIT63: 0x%08x", Hamlib.RIG_FUNC_BIT63));
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -85,11 +85,13 @@
|
|||
double-precision floating point type internally for number
|
||||
representations (max 53 bits of precision) so makes a string
|
||||
constant from a constant number literal using ull */
|
||||
/* #define CONSTANT_64BIT_FLAG(BIT) (1 << (BIT)) */
|
||||
// #define CONSTANT_64BIT_FLAG(BIT) (1 << (BIT))
|
||||
// #define SWIGLUAHIDE
|
||||
/* But this appears to have been fixed so we'll use the correct one now
|
||||
If you have the older version of SWIG comment out this line and use
|
||||
the one above */
|
||||
#define CONSTANT_64BIT_FLAG(BIT) (1ull << (BIT))
|
||||
the two above */
|
||||
// This 1ul definition works on swig 4.0.1 and lua 5.3.5
|
||||
#define CONSTANT_64BIT_FLAG(BIT) (1ul << (BIT))
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
@ -878,8 +880,8 @@ typedef uint64_t setting_t;
|
|||
#define RIG_FUNC_TBURST CONSTANT_64BIT_FLAG (29) /*!< \c TBURST -- 1750 Hz tone burst */
|
||||
#define RIG_FUNC_TUNER CONSTANT_64BIT_FLAG (30) /*!< \c TUNER -- Enable automatic tuner */
|
||||
#define RIG_FUNC_XIT CONSTANT_64BIT_FLAG (31) /*!< \c XIT -- Transmitter Incremental Tuning */
|
||||
#ifndef SWIGLUA
|
||||
/* Hide the top 32 bits from the Lua binding as they can't be represented */
|
||||
#ifndef SWIGLUAHIDE
|
||||
/* Hide the top 32 bits from the old Lua binding as they can't be represented */
|
||||
#define RIG_FUNC_NB2 CONSTANT_64BIT_FLAG (32) /*!< \c NB2 -- 2nd Noise Blanker */
|
||||
#define RIG_FUNC_CSQL CONSTANT_64BIT_FLAG (33) /*!< \c CSQL -- DCS Squelch setting */
|
||||
#define RIG_FUNC_AFLT CONSTANT_64BIT_FLAG (34) /*!< \c AFLT -- AF Filter setting */
|
||||
|
@ -970,7 +972,7 @@ typedef uint64_t rmode_t;
|
|||
#define RIG_MODE_AMN CONSTANT_64BIT_FLAG (29) /*!< \c AM-N -- Narrow band AM mode IC-R30 */
|
||||
#define RIG_MODE_PSK CONSTANT_64BIT_FLAG (30) /*!< \c PSK - Kenwood PSK and others */
|
||||
#define RIG_MODE_PSKR CONSTANT_64BIT_FLAG (31) /*!< \c PSKR - Kenwood PSKR and others */
|
||||
#ifndef SWIGLUA
|
||||
#ifndef SWIGLUAHIDE
|
||||
/* hide the top 32 bits from the Lua binding as they will not work */
|
||||
#define RIG_MODE_DD CONSTANT_64BIT_FLAG (32) /*!< \c DD Mode IC-9700 */
|
||||
#define RIG_MODE_C4FM CONSTANT_64BIT_FLAG (33) /*!< \c Yaesu C4FM mode */
|
||||
|
|
|
@ -184,9 +184,9 @@ const struct rig_caps ic746_caps =
|
|||
.rig_model = RIG_MODEL_IC746,
|
||||
.model_name = "IC-746",
|
||||
.mfg_name = "Icom",
|
||||
.version = BACKEND_VER ".1",
|
||||
.version = BACKEND_VER ".2",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_BETA,
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
.ptt_type = RIG_PTT_RIG,
|
||||
.dcd_type = RIG_DCD_NONE,
|
||||
|
@ -905,7 +905,7 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan)
|
|||
{
|
||||
struct icom_priv_data *priv;
|
||||
struct rig_state *rs;
|
||||
unsigned char chanbuf[46];
|
||||
unsigned char chanbuf[50];
|
||||
mem_buf_t *membuf;
|
||||
int chan_len, freq_len, retval, data_len;
|
||||
|
||||
|
@ -961,13 +961,20 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan)
|
|||
/*
|
||||
* chanbuf should contain Cn,Sc, Chan #, Data area
|
||||
*/
|
||||
// Do we get chan_len==1 || chan_len==5 on empty memory?
|
||||
// The IC746Pro returns 1a 00 00 01 ff on a blank channel
|
||||
// So this logic should apply to any Icom with chan_len==5 hopefully
|
||||
if (chan_len == 5 && chanbuf[4]==0xff) {
|
||||
rig_debug(RIG_DEBUG_TRACE,"%s: chan %d is empty\n", __func__, chan->channel_num);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
if ((chan_len != freq_len * 2 + 40) && (chan_len != 1))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "ic746pro_get_channel: wrong frame len=%d\n",
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: wrong frame len=%d\n", __func__,
|
||||
chan_len);
|
||||
return -RIG_ERJCTED;
|
||||
}
|
||||
|
||||
/* do this only if not a blank channel */
|
||||
if (chan_len != 1)
|
||||
{
|
||||
|
@ -978,19 +985,22 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan)
|
|||
membuf = (mem_buf_t *)(chanbuf + 4);
|
||||
|
||||
chan->flags = membuf->chan_flag && 0x01 ? RIG_CHFLAG_SKIP : RIG_CHFLAG_NONE;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->flags=0x%02x\n", __func__, chan->flags);
|
||||
/* data mode on */
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: membuf->rx.data=0x%02x\n", __func__, membuf->rx.data);
|
||||
if (membuf->rx.data) { chan->flags |= RIG_CHFLAG_DATA; }
|
||||
|
||||
/*
|
||||
* from_bcd requires nibble len
|
||||
*/
|
||||
chan->freq = from_bcd(membuf->rx.freq, freq_len * 2);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->freq=%f\n", __func__, chan->freq);
|
||||
|
||||
icom2rig_mode(rig, membuf->rx.mode, membuf->rx.pb,
|
||||
&chan->mode, &chan->width);
|
||||
|
||||
chan->rptr_shift = (rptr_shift_t)(membuf->rx.dup >> 8);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->rptr_shift=%d\n", __func__, chan->rptr_shift);
|
||||
|
||||
/* offset is default for the band & is not stored in channel memory.
|
||||
The following retrieves the system default for the band */
|
||||
|
@ -1009,18 +1019,24 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan)
|
|||
}
|
||||
|
||||
chan->rptr_offs = from_bcd(databuf + 3, 6) * 100;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->rptr_offs=%d\n", __func__, (int)chan->rptr_offs);
|
||||
|
||||
chan->ctcss_tone = from_bcd_be(membuf->rx.tone, 6);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->ctcss_tone=%d\n", __func__, chan->ctcss_tone);
|
||||
chan->ctcss_sql = from_bcd_be(membuf->rx.tone_sql, 6);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->ctcss_sql=%d\n", __func__, chan->ctcss_sql);
|
||||
chan->dcs_code = from_bcd_be(membuf->rx.dcs.code, 4);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->dcs_code=%d\n", __func__, chan->dcs_code);
|
||||
/* The dcs information include in the channel includes polarity information
|
||||
for both tx and receive. Both directions are enabled when in dcs mode */
|
||||
|
||||
chan->tx_freq = from_bcd(membuf->tx.freq, freq_len * 2);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->tx_freq=%f\n", __func__, chan->tx_freq);
|
||||
icom2rig_mode(rig, membuf->tx.mode, membuf->tx.pb,
|
||||
&chan->tx_mode, &chan->tx_width);
|
||||
strncpy(chan->channel_desc, membuf->name, 9);
|
||||
chan->channel_desc[9] = '\0'; /* add null terminator */
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->channel_desc=%s\n", __func__, chan->channel_desc);
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
|
|
|
@ -178,7 +178,6 @@ 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,
|
||||
|
|
|
@ -158,7 +158,7 @@ const struct rig_caps ft900_caps =
|
|||
.rig_model = RIG_MODEL_FT900,
|
||||
.model_name = "FT-900",
|
||||
.mfg_name = "Yaesu",
|
||||
.version = "0.2",
|
||||
.version = "0.3",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
|
|
@ -76,8 +76,7 @@
|
|||
|
||||
/* Delay sequential fast writes */
|
||||
|
||||
#define FT900_POST_WRITE_DELAY 5
|
||||
|
||||
#define FT900_POST_WRITE_DELAY 50
|
||||
|
||||
/* Rough safe value for default timeout */
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ static rig_ptr_t rig_vprintf_arg;
|
|||
* \param size Number of chars to words to dump
|
||||
* \brief Do a hex dump of the unsigned char array.
|
||||
*/
|
||||
void dump_hex(const unsigned char ptr[], size_t size)
|
||||
HAMLIB_EXPORT(void) dump_hex(const unsigned char ptr[], size_t size)
|
||||
{
|
||||
/* example
|
||||
* 0000 4b 30 30 31 34 35 30 30 30 30 30 30 30 35 30 32 K001450000000502
|
||||
|
|
|
@ -261,6 +261,7 @@ static int generic_retr_extl(RIG *rig,
|
|||
else
|
||||
{
|
||||
unsigned el_size = 0;
|
||||
|
||||
for (p = chan->ext_levels; !RIG_IS_EXT_END(*p); p++)
|
||||
{
|
||||
el_size += sizeof(struct ext_list);
|
||||
|
@ -1625,7 +1626,6 @@ const chan_t *HAMLIB_API rig_lookup_mem_caps(RIG *rig, int ch)
|
|||
}
|
||||
|
||||
|
||||
#ifdef XXREMOVEDXX
|
||||
// Not referenced anywhere
|
||||
/**
|
||||
* \brief get memory channel count
|
||||
|
@ -1657,6 +1657,5 @@ int HAMLIB_API rig_mem_count(RIG *rig)
|
|||
|
||||
return count;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*! @} */
|
||||
|
|
242
src/neverused.c
242
src/neverused.c
|
@ -5,133 +5,133 @@
|
|||
|
||||
void used_externally()
|
||||
{
|
||||
uh_close_wkey(); // used by external programs
|
||||
uh_open_wkey(); // used by external programs
|
||||
uh_close_wkey(); // used by external programs
|
||||
uh_open_wkey(); // used by external programs
|
||||
rig_mem_count(); // referenced by rig.swg and tcl
|
||||
}
|
||||
|
||||
void never_used()
|
||||
{
|
||||
adat_mode_anr2rnr();
|
||||
adat_parse_vfo();
|
||||
adat_ptt_rnr2anr();
|
||||
amp_ext_level_foreach();
|
||||
amp_ext_lookup_tok();
|
||||
amp_ext_parm_foreach();
|
||||
amp_ext_token_lookup();
|
||||
amp_probe_all();
|
||||
amp_set_powerstat();
|
||||
amp_token_foreach();
|
||||
amp_unregister();
|
||||
cm108_dcd_get();
|
||||
elad_close();
|
||||
elad_get_channel();
|
||||
elad_get_ctcss_sql();
|
||||
elad_get_ctcss_tone();
|
||||
elad_get_ext_parm();
|
||||
elad_get_info();
|
||||
elad_get_level();
|
||||
elad_get_mem();
|
||||
elad_get_mem_if();
|
||||
elad_get_mode_if();
|
||||
elad_open();
|
||||
elad_send_morse();
|
||||
elad_set_ant_no_ack();
|
||||
elad_set_channel();
|
||||
elad_set_ctcss_sql();
|
||||
elad_set_ctcss_tone();
|
||||
elad_set_ctcss_tone_tn();
|
||||
elad_set_ext_parm();
|
||||
elad_set_level();
|
||||
elad_set_mem();
|
||||
elad_set_ptt_safe();
|
||||
elad_set_split();
|
||||
elad_vfo_op();
|
||||
flushBuffer();
|
||||
foreach_opened_amp();
|
||||
foreach_opened_rot();
|
||||
get_output_freq();
|
||||
getopt_long_only();
|
||||
gp2000_get_func();
|
||||
gp2000_set_func();
|
||||
hzToPBS();
|
||||
i2c_read();
|
||||
ic10_set_ptt();
|
||||
ic9100_get_level();
|
||||
ic9100_set_level();
|
||||
icmarine_open();
|
||||
icom_get_vfo();
|
||||
icom_set_dsp_flt();
|
||||
int2BCD();
|
||||
is_uh_radio_fd();
|
||||
lt_dladdsearchdir();
|
||||
lt_dlclose();
|
||||
lt_dlerror();
|
||||
lt_dlexit();
|
||||
lt_dlinit();
|
||||
lt_dlopen();
|
||||
lt_dlopenext();
|
||||
lt_dlsym();
|
||||
miniVNA_get_info();
|
||||
newcat_decode_event();
|
||||
newcat_get_dcd();
|
||||
newcat_get_dcs_code();
|
||||
newcat_get_dcs_sql();
|
||||
newcat_get_ext_level();
|
||||
newcat_get_ext_parm();
|
||||
newcat_get_parm();
|
||||
newcat_get_rptr_offs();
|
||||
newcat_get_split_freq();
|
||||
newcat_get_split_mode();
|
||||
newcat_get_tone();
|
||||
newcat_get_tone_sql();
|
||||
newcat_recv_dtmf();
|
||||
newcat_reset();
|
||||
newcat_scan();
|
||||
newcat_send_dtmf();
|
||||
newcat_send_morse();
|
||||
newcat_set_bank();
|
||||
newcat_set_dcs_code();
|
||||
newcat_set_dcs_sql();
|
||||
newcat_set_ext_level();
|
||||
newcat_set_ext_parm();
|
||||
newcat_set_parm();
|
||||
newcat_set_rptr_offs();
|
||||
newcat_set_split_freq();
|
||||
newcat_set_split_mode();
|
||||
newcat_set_tone();
|
||||
newcat_set_tone_sql();
|
||||
pll_locked_p();
|
||||
readInt();
|
||||
read_info();
|
||||
rig_copy_channel();
|
||||
rig_copyright();
|
||||
rig_ext_token_lookup();
|
||||
rig_get_mem_all();
|
||||
rig_get_mem_all_cb();
|
||||
rig_license();
|
||||
rig_mem_count();
|
||||
rig_parse_mtype();
|
||||
rig_probe_all();
|
||||
rig_set_bank();
|
||||
rig_set_debug_callback();
|
||||
rig_set_debug_file();
|
||||
rig_set_mem_all();
|
||||
rig_set_mem_all_cb();
|
||||
rig_set_pltune_callback();
|
||||
rig_unregister();
|
||||
rig_version();
|
||||
rot_probe_all();
|
||||
rot_unregister();
|
||||
set_parm_all_cb_generic();
|
||||
tentec_trx_open();
|
||||
thd72_get_chan_all_cb();
|
||||
thd74_get_chan_all_cb();
|
||||
writeInt();
|
||||
write_both_dacs();
|
||||
adat_mode_anr2rnr();
|
||||
adat_parse_vfo();
|
||||
adat_ptt_rnr2anr();
|
||||
amp_ext_level_foreach();
|
||||
amp_ext_lookup_tok();
|
||||
amp_ext_parm_foreach();
|
||||
amp_ext_token_lookup();
|
||||
amp_probe_all();
|
||||
amp_set_powerstat();
|
||||
amp_token_foreach();
|
||||
amp_unregister();
|
||||
cm108_dcd_get();
|
||||
elad_close();
|
||||
elad_get_channel();
|
||||
elad_get_ctcss_sql();
|
||||
elad_get_ctcss_tone();
|
||||
elad_get_ext_parm();
|
||||
elad_get_info();
|
||||
elad_get_level();
|
||||
elad_get_mem();
|
||||
elad_get_mem_if();
|
||||
elad_get_mode_if();
|
||||
elad_open();
|
||||
elad_send_morse();
|
||||
elad_set_ant_no_ack();
|
||||
elad_set_channel();
|
||||
elad_set_ctcss_sql();
|
||||
elad_set_ctcss_tone();
|
||||
elad_set_ctcss_tone_tn();
|
||||
elad_set_ext_parm();
|
||||
elad_set_level();
|
||||
elad_set_mem();
|
||||
elad_set_ptt_safe();
|
||||
elad_set_split();
|
||||
elad_vfo_op();
|
||||
flushBuffer();
|
||||
foreach_opened_amp();
|
||||
foreach_opened_rot();
|
||||
get_output_freq();
|
||||
getopt_long_only();
|
||||
gp2000_get_func();
|
||||
gp2000_set_func();
|
||||
hzToPBS();
|
||||
i2c_read();
|
||||
ic10_set_ptt();
|
||||
ic9100_get_level();
|
||||
ic9100_set_level();
|
||||
icmarine_open();
|
||||
icom_get_vfo();
|
||||
icom_set_dsp_flt();
|
||||
int2BCD();
|
||||
is_uh_radio_fd();
|
||||
lt_dladdsearchdir();
|
||||
lt_dlclose();
|
||||
lt_dlerror();
|
||||
lt_dlexit();
|
||||
lt_dlinit();
|
||||
lt_dlopen();
|
||||
lt_dlopenext();
|
||||
lt_dlsym();
|
||||
miniVNA_get_info();
|
||||
newcat_decode_event();
|
||||
newcat_get_dcd();
|
||||
newcat_get_dcs_code();
|
||||
newcat_get_dcs_sql();
|
||||
newcat_get_ext_level();
|
||||
newcat_get_ext_parm();
|
||||
newcat_get_parm();
|
||||
newcat_get_rptr_offs();
|
||||
newcat_get_split_freq();
|
||||
newcat_get_split_mode();
|
||||
newcat_get_tone();
|
||||
newcat_get_tone_sql();
|
||||
newcat_recv_dtmf();
|
||||
newcat_reset();
|
||||
newcat_scan();
|
||||
newcat_send_dtmf();
|
||||
newcat_send_morse();
|
||||
newcat_set_bank();
|
||||
newcat_set_dcs_code();
|
||||
newcat_set_dcs_sql();
|
||||
newcat_set_ext_level();
|
||||
newcat_set_ext_parm();
|
||||
newcat_set_parm();
|
||||
newcat_set_rptr_offs();
|
||||
newcat_set_split_freq();
|
||||
newcat_set_split_mode();
|
||||
newcat_set_tone();
|
||||
newcat_set_tone_sql();
|
||||
pll_locked_p();
|
||||
readInt();
|
||||
read_info();
|
||||
rig_copy_channel();
|
||||
rig_copyright();
|
||||
rig_ext_token_lookup();
|
||||
rig_get_mem_all();
|
||||
rig_get_mem_all_cb();
|
||||
rig_license();
|
||||
rig_parse_mtype();
|
||||
rig_probe_all();
|
||||
rig_set_bank();
|
||||
rig_set_debug_callback();
|
||||
rig_set_debug_file();
|
||||
rig_set_mem_all();
|
||||
rig_set_mem_all_cb();
|
||||
rig_set_pltune_callback();
|
||||
rig_unregister();
|
||||
rig_version();
|
||||
rot_probe_all();
|
||||
rot_unregister();
|
||||
set_parm_all_cb_generic();
|
||||
tentec_trx_open();
|
||||
thd72_get_chan_all_cb();
|
||||
thd74_get_chan_all_cb();
|
||||
writeInt();
|
||||
write_both_dacs();
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
used_externally();
|
||||
never_used();
|
||||
used_externally();
|
||||
never_used();
|
||||
}
|
||||
|
|
|
@ -548,6 +548,11 @@ void dump_csv_name(const channel_cap_t *mem_caps, FILE *f)
|
|||
fprintf(f, "flags%c", csv_sep);
|
||||
}
|
||||
|
||||
if (mem_caps->channel_desc)
|
||||
{
|
||||
fprintf(f, "channel_desc%c", csv_sep);
|
||||
}
|
||||
|
||||
fprintf(f, "\n");
|
||||
}
|
||||
|
||||
|
@ -703,6 +708,11 @@ int dump_csv_chan(RIG *rig,
|
|||
fprintf(f, "%x%c", chan.flags, csv_sep);
|
||||
}
|
||||
|
||||
if (mem_caps->channel_desc)
|
||||
{
|
||||
fprintf(f, "%s", chan.channel_desc);
|
||||
}
|
||||
|
||||
fprintf(f, "\n");
|
||||
|
||||
/*
|
||||
|
|
|
@ -285,6 +285,12 @@ int dump_xml_chan(RIG *rig,
|
|||
xmlNewProp(node, (unsigned char *) "flags", (unsigned char *) attrbuf);
|
||||
}
|
||||
|
||||
if (mem_caps->channel_desc)
|
||||
{
|
||||
sprintf(attrbuf, "%s", chan.channel_desc);
|
||||
xmlNewProp(node, (unsigned char *) "channel_desc", (unsigned char *) attrbuf);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
Ładowanie…
Reference in New Issue