kopia lustrzana https://github.com/Hamlib/Hamlib
* abstract 64bit int format type to cope with portability issues.
introduce PRIll (printf format) and SCNll (scanf) in misc.h. This needs to have config.h included beforehand. * do likewise with freq_t type (double) in rig.h FREQFMT is deprecated. git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1903 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.2.4
rodzic
f66acc1bb4
commit
23369a0c25
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* Hamlib Alinco backend - main file
|
* Hamlib Alinco backend - main file
|
||||||
* Copyright (c) 2001-2004 by Stephane Fillod
|
* Copyright (c) 2001-2005 by Stephane Fillod
|
||||||
*
|
*
|
||||||
* $Id: alinco.c,v 1.24 2004-09-26 08:34:53 fillods Exp $
|
* $Id: alinco.c,v 1.25 2005-01-24 23:03:25 fillods Exp $
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Library General Public License as
|
* it under the terms of the GNU Library General Public License as
|
||||||
|
@ -254,7 +254,7 @@ int alinco_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||||
|
|
||||||
/* extract RX freq */
|
/* extract RX freq */
|
||||||
freqbuf[16] = '\0';
|
freqbuf[16] = '\0';
|
||||||
sscanf(freqbuf+6, "%"FREQFMT, freq);
|
sscanf(freqbuf+6, "%"SCNfreq, freq);
|
||||||
|
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
@ -431,7 +431,7 @@ int alinco_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
|
||||||
|
|
||||||
/* extract TX freq first, as RX kills freqbuf[16] */
|
/* extract TX freq first, as RX kills freqbuf[16] */
|
||||||
freqbuf[26] = '\0';
|
freqbuf[26] = '\0';
|
||||||
sscanf(freqbuf+16, "%"FREQFMT, tx_freq);
|
sscanf(freqbuf+16, "%"SCNfreq, tx_freq);
|
||||||
|
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
|
10
aor/aor.c
10
aor/aor.c
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* Hamlib AOR backend - main file
|
* Hamlib AOR backend - main file
|
||||||
* Copyright (c) 2000-2004 by Stephane Fillod
|
* Copyright (c) 2000-2005 by Stephane Fillod
|
||||||
*
|
*
|
||||||
* $Id: aor.c,v 1.29 2004-09-07 20:40:20 fillods Exp $
|
* $Id: aor.c,v 1.30 2005-01-24 23:03:51 fillods Exp $
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Library General Public License as
|
* it under the terms of the GNU Library General Public License as
|
||||||
|
@ -128,7 +128,7 @@ int aor_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||||
lowhz = 100;
|
lowhz = 100;
|
||||||
f = f*100 + lowhz;
|
f = f*100 + lowhz;
|
||||||
|
|
||||||
freq_len = sprintf(freqbuf,"RF%010lld" EOM, f);
|
freq_len = sprintf(freqbuf,"RF%010"PRIll EOM, f);
|
||||||
|
|
||||||
retval = aor_transaction (rig, freqbuf, freq_len, ackbuf, &ack_len);
|
retval = aor_transaction (rig, freqbuf, freq_len, ackbuf, &ack_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
|
@ -146,7 +146,6 @@ int aor_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||||
char *rfp;
|
char *rfp;
|
||||||
int freq_len, retval;
|
int freq_len, retval;
|
||||||
unsigned char freqbuf[BUFSZ];
|
unsigned char freqbuf[BUFSZ];
|
||||||
long long f;
|
|
||||||
|
|
||||||
retval = aor_transaction (rig, "RX" EOM, 3, freqbuf, &freq_len);
|
retval = aor_transaction (rig, "RX" EOM, 3, freqbuf, &freq_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
|
@ -159,8 +158,7 @@ int aor_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||||
return -RIG_EPROTO;
|
return -RIG_EPROTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
sscanf(rfp+2,"%lld", &f);
|
sscanf(rfp+2,"%"SCNfreq, &freq);
|
||||||
*freq = f;
|
|
||||||
|
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* Hamlib AOR backend - AR3000 description
|
* Hamlib AOR backend - AR3000 description
|
||||||
* Copyright (c) 2000-2004 by Stephane Fillod
|
* Copyright (c) 2000-2005 by Stephane Fillod
|
||||||
*
|
*
|
||||||
* $Id: ar3000.c,v 1.5 2004-09-07 20:37:41 fillods Exp $
|
* $Id: ar3000.c,v 1.6 2005-01-24 23:03:52 fillods Exp $
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Library General Public License as
|
* it under the terms of the GNU Library General Public License as
|
||||||
|
@ -264,7 +264,7 @@ int ar3k_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||||
rfp = strchr(freqbuf, 'Y');
|
rfp = strchr(freqbuf, 'Y');
|
||||||
if (!rfp)
|
if (!rfp)
|
||||||
return -RIG_EPROTO;
|
return -RIG_EPROTO;
|
||||||
sscanf(rfp+1,"%"FREQFMT, freq);
|
sscanf(rfp+1,"%"SCNfreq, freq);
|
||||||
*freq *= 10;
|
*freq *= 10;
|
||||||
|
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* Hamlib AOR backend - AR3030 description
|
* Hamlib AOR backend - AR3030 description
|
||||||
* Copyright (c) 2000-2004 by Stephane Fillod
|
* Copyright (c) 2000-2005 by Stephane Fillod
|
||||||
*
|
*
|
||||||
* $Id: ar3030.c,v 1.6 2004-09-07 20:37:41 fillods Exp $
|
* $Id: ar3030.c,v 1.7 2005-01-24 23:03:52 fillods Exp $
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Library General Public License as
|
* it under the terms of the GNU Library General Public License as
|
||||||
|
@ -347,7 +347,7 @@ int ar3030_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||||
rfp = strchr(freqbuf, 'F');
|
rfp = strchr(freqbuf, 'F');
|
||||||
if (!rfp)
|
if (!rfp)
|
||||||
return -RIG_EPROTO;
|
return -RIG_EPROTO;
|
||||||
sscanf(rfp+1,"%"FREQFMT, freq);
|
sscanf(rfp+1,"%"SCNfreq, freq);
|
||||||
|
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
@ -585,7 +585,7 @@ int ar3030_get_channel(RIG *rig, channel_t *chan)
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
sscanf(infobuf+14,"%"FREQFMT, &chan->freq);
|
sscanf(infobuf+14,"%"SCNfreq, &chan->freq);
|
||||||
chan->freq *= 10;
|
chan->freq *= 10;
|
||||||
|
|
||||||
switch (infobuf[22]) {
|
switch (infobuf[22]) {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* Hamlib Rotator backend - SDR-1000
|
* Hamlib Rotator backend - SDR-1000
|
||||||
* Copyright (c) 2003-2004 by Stephane Fillod
|
* Copyright (c) 2003-2005 by Stephane Fillod
|
||||||
*
|
*
|
||||||
* $Id: sdr1k.c,v 1.7 2004-10-02 20:37:24 fillods Exp $
|
* $Id: sdr1k.c,v 1.8 2005-01-24 23:03:53 fillods Exp $
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Library General Public License as
|
* it under the terms of the GNU Library General Public License as
|
||||||
|
@ -122,7 +122,7 @@ const struct rig_caps sdr1k_rig_caps = {
|
||||||
.rig_model = RIG_MODEL_SDR1000,
|
.rig_model = RIG_MODEL_SDR1000,
|
||||||
.model_name = "SDR-1000",
|
.model_name = "SDR-1000",
|
||||||
.mfg_name = "Flex-radio",
|
.mfg_name = "Flex-radio",
|
||||||
.version = "0.1.2",
|
.version = "0.2",
|
||||||
.copyright = "LGPL",
|
.copyright = "LGPL",
|
||||||
.status = RIG_STATUS_NEW,
|
.status = RIG_STATUS_NEW,
|
||||||
.rig_type = RIG_TYPE_TUNER,
|
.rig_type = RIG_TYPE_TUNER,
|
||||||
|
@ -275,7 +275,7 @@ static int set_band(RIG *rig, freq_t freq)
|
||||||
|
|
||||||
ret = write_latch (rig, L_BAND, 1 << band, 0x3f);
|
ret = write_latch (rig, L_BAND, 1 << band, 0x3f);
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s %lld band %d\n", __FUNCTION__, (long long)freq, band);
|
rig_debug(RIG_DEBUG_VERBOSE, "%s %"PRIll" band %d\n", __FUNCTION__, (long long)freq, band);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -309,7 +309,7 @@ int sdr1k_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||||
else
|
else
|
||||||
frqval = freq;
|
frqval = freq;
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s curr %lld frqval %lld\n", __FUNCTION__, (long long)freq, (long long)frqval);
|
rig_debug(RIG_DEBUG_VERBOSE, "%s curr %"PRIll" frqval %"PRIll"\n", __FUNCTION__, (long long)freq, (long long)frqval);
|
||||||
|
|
||||||
if (priv->dds_freq == frqval) {
|
if (priv->dds_freq == frqval) {
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
|
@ -346,7 +346,7 @@ int sdr1k_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||||
struct sdr1k_priv_data *priv = (struct sdr1k_priv_data *)rig->state.priv;
|
struct sdr1k_priv_data *priv = (struct sdr1k_priv_data *)rig->state.priv;
|
||||||
|
|
||||||
*freq = priv->dds_freq;
|
*freq = priv->dds_freq;
|
||||||
rig_debug(RIG_DEBUG_TRACE,"%s: %lld\n", __FUNCTION__, (long long)priv->dds_freq);
|
rig_debug(RIG_DEBUG_TRACE,"%s: %"PRIll"\n", __FUNCTION__, (long long)priv->dds_freq);
|
||||||
|
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Hamlib Interface - API header
|
* Hamlib Interface - API header
|
||||||
* Copyright (c) 2000-2004 by Stephane Fillod and Frank Singleton
|
* Copyright (c) 2000-2004 by Stephane Fillod and Frank Singleton
|
||||||
*
|
*
|
||||||
* $Id: rig.h,v 1.100 2004-09-25 14:31:38 fillods Exp $
|
* $Id: rig.h,v 1.101 2005-01-24 23:03:22 fillods Exp $
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Library General Public License as
|
* it under the terms of the GNU Library General Public License as
|
||||||
|
@ -252,7 +252,11 @@ typedef enum {
|
||||||
* Frequency type unit in Hz, able to hold SHF frequencies.
|
* Frequency type unit in Hz, able to hold SHF frequencies.
|
||||||
*/
|
*/
|
||||||
typedef double freq_t;
|
typedef double freq_t;
|
||||||
#define FREQFMT "lf"
|
/** \brief printf(3) format to be used for freq_t type */
|
||||||
|
#define PRIfreq "f"
|
||||||
|
/** \brief scanf(3) format to be used for freq_t type */
|
||||||
|
#define SCNfreq "lf"
|
||||||
|
#define FREQFMT SCNfreq
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Short frequency type
|
* \brief Short frequency type
|
||||||
|
@ -579,7 +583,7 @@ enum rig_level_e {
|
||||||
/*!< These ones are not settable */
|
/*!< These ones are not settable */
|
||||||
RIG_LEVEL_RAWSTR = (1<<26),/*!< Raw (A/D) value for signal strength, specific to each rig, arg int */
|
RIG_LEVEL_RAWSTR = (1<<26),/*!< Raw (A/D) value for signal strength, specific to each rig, arg int */
|
||||||
RIG_LEVEL_SQLSTAT = (1<<27),/*!< SQL status, arg int (open=1/closed=0). Deprecated, use get_dcd instead */
|
RIG_LEVEL_SQLSTAT = (1<<27),/*!< SQL status, arg int (open=1/closed=0). Deprecated, use get_dcd instead */
|
||||||
RIG_LEVEL_SWR = (1<<28),/*!< SWR, arg float */
|
RIG_LEVEL_SWR = (1<<28),/*!< SWR, arg float [0.0..infinite] */
|
||||||
RIG_LEVEL_ALC = (1<<29),/*!< ALC, arg float */
|
RIG_LEVEL_ALC = (1<<29),/*!< ALC, arg float */
|
||||||
RIG_LEVEL_STRENGTH = (1<<30) /*!< Effective (calibrated) signal strength relative to S9, arg int (dB) */
|
RIG_LEVEL_STRENGTH = (1<<30) /*!< Effective (calibrated) signal strength relative to S9, arg int (dB) */
|
||||||
/*RIG_LEVEL_BWC = (1<<31)*/ /*!< Bandwidth Control, arg int (Hz) */
|
/*RIG_LEVEL_BWC = (1<<31)*/ /*!< Bandwidth Control, arg int (Hz) */
|
||||||
|
|
12
jrc/jrc.c
12
jrc/jrc.c
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* Hamlib JRC backend - main file
|
* Hamlib JRC backend - main file
|
||||||
* Copyright (c) 2001-2004 by Stephane Fillod
|
* Copyright (c) 2001-2005 by Stephane Fillod
|
||||||
*
|
*
|
||||||
* $Id: jrc.c,v 1.19 2004-09-26 08:35:03 fillods Exp $
|
* $Id: jrc.c,v 1.20 2005-01-24 23:03:58 fillods Exp $
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Library General Public License as
|
* it under the terms of the GNU Library General Public License as
|
||||||
|
@ -139,7 +139,6 @@ int jrc_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||||
struct jrc_priv_caps *priv = (struct jrc_priv_caps*)rig->caps->priv;
|
struct jrc_priv_caps *priv = (struct jrc_priv_caps*)rig->caps->priv;
|
||||||
int freq_len, retval;
|
int freq_len, retval;
|
||||||
char freqbuf[BUFSZ];
|
char freqbuf[BUFSZ];
|
||||||
long long f;
|
|
||||||
|
|
||||||
//note: JRCs use "I" to get information
|
//note: JRCs use "I" to get information
|
||||||
retval = jrc_transaction (rig, "I" EOM, 2, freqbuf, &freq_len);
|
retval = jrc_transaction (rig, "I" EOM, 2, freqbuf, &freq_len);
|
||||||
|
@ -155,8 +154,7 @@ int jrc_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||||
freqbuf[4+priv->max_freq_len] = '\0';
|
freqbuf[4+priv->max_freq_len] = '\0';
|
||||||
|
|
||||||
/* extract freq */
|
/* extract freq */
|
||||||
sscanf(freqbuf+4, "%llu", &f);
|
sscanf(freqbuf+4, "%"SCNfreq, freq);
|
||||||
*freq = f;
|
|
||||||
|
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
@ -1347,12 +1345,10 @@ int jrc_decode_event(RIG *rig)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (rig->callbacks.freq_event) {
|
if (rig->callbacks.freq_event) {
|
||||||
long long f;
|
|
||||||
|
|
||||||
//buf[14] = '\0'; /* side-effect: destroy AGC first digit! */
|
//buf[14] = '\0'; /* side-effect: destroy AGC first digit! */
|
||||||
buf[4+priv->max_freq_len] = '\0'; /* side-effect: destroy AGC first digit! */
|
buf[4+priv->max_freq_len] = '\0'; /* side-effect: destroy AGC first digit! */
|
||||||
sscanf(buf+4, "%lld", &f);
|
sscanf(buf+4, "%"SCNfreq, &freq);
|
||||||
freq = f;
|
|
||||||
return rig->callbacks.freq_event(rig, RIG_VFO_CURR, freq,
|
return rig->callbacks.freq_event(rig, RIG_VFO_CURR, freq,
|
||||||
rig->callbacks.freq_arg);
|
rig->callbacks.freq_arg);
|
||||||
}
|
}
|
||||||
|
|
10
kenwood/th.c
10
kenwood/th.c
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* Hamlib Kenwood backend - TH handheld primitives
|
* Hamlib Kenwood backend - TH handheld primitives
|
||||||
* Copyright (c) 2001-2003 by Stephane Fillod
|
* Copyright (c) 2001-2005 by Stephane Fillod
|
||||||
*
|
*
|
||||||
* $Id: th.c,v 1.25 2004-12-28 12:58:51 f4dwv Exp $
|
* $Id: th.c,v 1.26 2005-01-24 23:04:03 fillods Exp $
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Library General Public License as
|
* it under the terms of the GNU Library General Public License as
|
||||||
|
@ -81,7 +81,7 @@ th_decode_event (RIG *rig)
|
||||||
rmode_t mode;
|
rmode_t mode;
|
||||||
int step, shift, rev, tone, ctcss, tonefq, ctcssfq;
|
int step, shift, rev, tone, ctcss, tonefq, ctcssfq;
|
||||||
|
|
||||||
retval = sscanf(asyncbuf, "BUF %d,%"FREQFMT",%d,%d,%d,%d,%d,,%d,,%d,%"FREQFMT",%d",
|
retval = sscanf(asyncbuf, "BUF %d,%"SCNfreq",%d,%d,%d,%d,%d,,%d,,%d,%"SCNfreq",%d",
|
||||||
&vfo, &freq, &step, &shift, &rev, &tone,
|
&vfo, &freq, &step, &shift, &rev, &tone,
|
||||||
&ctcss, &tonefq, &ctcssfq, &offset, &mode);
|
&ctcss, &tonefq, &ctcssfq, &offset, &mode);
|
||||||
|
|
||||||
|
@ -1162,7 +1162,7 @@ int th_get_channel(RIG *rig, channel_t *chan)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
strcpy(scf,req);
|
strcpy(scf,req);
|
||||||
strcat(scf,",%"FREQFMT",%d,%d,%d,%d,%d,,%d,,%d,%"FREQFMT);
|
strcat(scf,",%"SCNfreq",%d,%d,%d,%d,%d,,%d,,%d,%"SCNfreq);
|
||||||
retval = sscanf(ackbuf, scf,
|
retval = sscanf(ackbuf, scf,
|
||||||
&freq, &step, &shift, &rev, &tone,
|
&freq, &step, &shift, &rev, &tone,
|
||||||
&ctcss, &tonefq, &ctcssfq, &offset);
|
&ctcss, &tonefq, &ctcssfq, &offset);
|
||||||
|
@ -1207,7 +1207,7 @@ int th_get_channel(RIG *rig, channel_t *chan)
|
||||||
retval = kenwood_transaction(rig, membuf, strlen(membuf), ackbuf, &ack_len);
|
retval = kenwood_transaction(rig, membuf, strlen(membuf), ackbuf, &ack_len);
|
||||||
if (retval == RIG_OK) {
|
if (retval == RIG_OK) {
|
||||||
strcpy(scf,req);
|
strcpy(scf,req);
|
||||||
strcat(scf,",%"FREQFMT",%d");
|
strcat(scf,",%"SCNfreq",%d");
|
||||||
retval = sscanf(ackbuf, scf, &freq, &step);
|
retval = sscanf(ackbuf, scf, &freq, &step);
|
||||||
chan->tx_freq=freq;
|
chan->tx_freq=freq;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* Hamlib Kenwood backend - TH-G71 description
|
* Hamlib Kenwood backend - TH-G71 description
|
||||||
* Copyright (c) 2003-2004 by Stephane Fillod
|
* Copyright (c) 2003-2005 by Stephane Fillod
|
||||||
*
|
*
|
||||||
* $Id: thg71.c,v 1.14 2004-12-06 22:16:55 f4dwv Exp $
|
* $Id: thg71.c,v 1.15 2005-01-24 23:04:16 fillods Exp $
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Library General Public License as
|
* it under the terms of the GNU Library General Public License as
|
||||||
|
@ -199,7 +199,7 @@ int thg71_decode_event (RIG *rig)
|
||||||
freq_t freq, offset;
|
freq_t freq, offset;
|
||||||
int step, shift, rev, tone, ctcss, tonefq, ctcssfq;
|
int step, shift, rev, tone, ctcss, tonefq, ctcssfq;
|
||||||
|
|
||||||
retval = sscanf(asyncbuf, "BUF 0,%"FREQFMT",%d,%d,%d,%d,%d,,%d,,%d,%"FREQFMT,
|
retval = sscanf(asyncbuf, "BUF 0,%"SCNfreq",%d,%d,%d,%d,%d,,%d,,%d,%"SCNfreq,
|
||||||
&freq, &step, &shift, &rev, &tone,
|
&freq, &step, &shift, &rev, &tone,
|
||||||
&ctcss, &tonefq, &ctcssfq, &offset);
|
&ctcss, &tonefq, &ctcssfq, &offset);
|
||||||
if (retval != 11) {
|
if (retval != 11) {
|
||||||
|
@ -207,7 +207,7 @@ int thg71_decode_event (RIG *rig)
|
||||||
return -RIG_ERJCTED;
|
return -RIG_ERJCTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: Buffer (freq %"FREQFMT" Hz, mode %d)\n", __FUNCTION__, freq);
|
rig_debug(RIG_DEBUG_TRACE, "%s: Buffer (freq %"PRIfreq" Hz, mode %d)\n", __FUNCTION__, freq);
|
||||||
|
|
||||||
/* Callback execution */
|
/* Callback execution */
|
||||||
if (rig->callbacks.vfo_event) {
|
if (rig->callbacks.vfo_event) {
|
||||||
|
@ -311,7 +311,7 @@ int thg71_get_mode (RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
sscanf(ackbuf,"FQ %"FREQFMT",%d",&freq,&step);
|
sscanf(ackbuf,"FQ %"SCNfreq",%d",&freq,&step);
|
||||||
|
|
||||||
if(freq <MHz(136) ) {
|
if(freq <MHz(136) ) {
|
||||||
*mode=RIG_MODE_AM;
|
*mode=RIG_MODE_AM;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* Hamlib Kenwood backend - TM-V7 description
|
* Hamlib Kenwood backend - TM-V7 description
|
||||||
* Copyright (c) 2004 by Stephane Fillod
|
* Copyright (c) 2004-2005 by Stephane Fillod
|
||||||
*
|
*
|
||||||
* $Id: tmv7.c,v 1.7 2004-12-28 12:59:41 f4dwv Exp $
|
* $Id: tmv7.c,v 1.8 2005-01-24 23:04:16 fillods Exp $
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Library General Public License as
|
* it under the terms of the GNU Library General Public License as
|
||||||
|
@ -229,7 +229,7 @@ int tmv7_decode_event (RIG *rig)
|
||||||
freq_t freq, offset;
|
freq_t freq, offset;
|
||||||
int step, shift, rev, tone, ctcss, tonefq, ctcssfq;
|
int step, shift, rev, tone, ctcss, tonefq, ctcssfq;
|
||||||
|
|
||||||
retval = sscanf(asyncbuf, "BUF 0,%"FREQFMT",%d,%d,%d,%d,%d,,%d,,%d,%"FREQFMT,
|
retval = sscanf(asyncbuf, "BUF 0,%"SCNfreq",%d,%d,%d,%d,%d,,%d,,%d,%"SCNfreq,
|
||||||
&freq, &step, &shift, &rev, &tone,
|
&freq, &step, &shift, &rev, &tone,
|
||||||
&ctcss, &tonefq, &ctcssfq, &offset);
|
&ctcss, &tonefq, &ctcssfq, &offset);
|
||||||
if (retval != 11) {
|
if (retval != 11) {
|
||||||
|
@ -237,7 +237,7 @@ int tmv7_decode_event (RIG *rig)
|
||||||
return -RIG_ERJCTED;
|
return -RIG_ERJCTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: Buffer (freq %"FREQFMT" Hz, mode %d)\n", __FUNCTION__, freq);
|
rig_debug(RIG_DEBUG_TRACE, "%s: Buffer (freq %"PRIfreq" Hz, mode %d)\n", __FUNCTION__, freq);
|
||||||
|
|
||||||
/* Callback execution */
|
/* Callback execution */
|
||||||
if (rig->callbacks.vfo_event) {
|
if (rig->callbacks.vfo_event) {
|
||||||
|
@ -401,7 +401,7 @@ int tmv7_get_mode (RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
sscanf(ackbuf,"FQ %"FREQFMT",%d",&freq,&step);
|
sscanf(ackbuf,"FQ %"SCNfreq",%d",&freq,&step);
|
||||||
|
|
||||||
if(freq <MHz(137) ) {
|
if(freq <MHz(137) ) {
|
||||||
*mode=RIG_MODE_AM;
|
*mode=RIG_MODE_AM;
|
||||||
|
@ -473,7 +473,7 @@ int tmv7_get_channel(RIG *rig, channel_t *chan)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
strcpy(scf,req);
|
strcpy(scf,req);
|
||||||
strcat(scf,",%"FREQFMT",%d,%d,%d,%d,0,%d,%d,000,%d,,0");
|
strcat(scf,",%"SCNfreq",%d,%d,%d,%d,0,%d,%d,000,%d,,0");
|
||||||
retval = sscanf(ackbuf, scf,
|
retval = sscanf(ackbuf, scf,
|
||||||
&freq, &step, &shift, &rev, &tone,
|
&freq, &step, &shift, &rev, &tone,
|
||||||
&ctcss, &tonefq, &ctcssfq);
|
&ctcss, &tonefq, &ctcssfq);
|
||||||
|
@ -515,7 +515,7 @@ int tmv7_get_channel(RIG *rig, channel_t *chan)
|
||||||
retval = kenwood_transaction(rig, membuf, strlen(membuf), ackbuf, &ack_len);
|
retval = kenwood_transaction(rig, membuf, strlen(membuf), ackbuf, &ack_len);
|
||||||
if (retval == RIG_OK) {
|
if (retval == RIG_OK) {
|
||||||
strcpy(scf,req);
|
strcpy(scf,req);
|
||||||
strcat(scf,",%"FREQFMT",%d");
|
strcat(scf,",%"SCNfreq",%d");
|
||||||
retval = sscanf(ackbuf, scf, &freq, &step);
|
retval = sscanf(ackbuf, scf, &freq, &step);
|
||||||
chan->tx_freq=freq;
|
chan->tx_freq=freq;
|
||||||
}
|
}
|
||||||
|
|
12
kit/drt1.c
12
kit/drt1.c
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* Hamlib KIT backend - Sat-Schneider DRT1/SAD1 DRM receiver description
|
* Hamlib KIT backend - Sat-Schneider DRT1/SAD1 DRM receiver description
|
||||||
* Copyright (c) 2004 by Stephane Fillod
|
* Copyright (c) 2004-2005 by Stephane Fillod
|
||||||
*
|
*
|
||||||
* $Id: drt1.c,v 1.2 2004-11-27 13:40:58 fillods Exp $
|
* $Id: drt1.c,v 1.3 2005-01-24 23:04:16 fillods Exp $
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as
|
* it under the terms of the GNU General Public License as
|
||||||
|
@ -206,13 +206,13 @@ int drt1_set_conf(RIG *rig, token_t token, const char *val)
|
||||||
|
|
||||||
switch(token) {
|
switch(token) {
|
||||||
case TOK_OSCFREQ:
|
case TOK_OSCFREQ:
|
||||||
sscanf(val, "%"FREQFMT, &priv->osc_freq);
|
sscanf(val, "%"SCNfreq, &priv->osc_freq);
|
||||||
break;
|
break;
|
||||||
case TOK_REFMULT:
|
case TOK_REFMULT:
|
||||||
sscanf(val, "%d", &priv->ref_mult);
|
sscanf(val, "%d", &priv->ref_mult);
|
||||||
break;
|
break;
|
||||||
case TOK_IFMIXFREQ:
|
case TOK_IFMIXFREQ:
|
||||||
sscanf(val, "%"FREQFMT, &priv->if_mix_freq);
|
sscanf(val, "%"SCNfreq, &priv->if_mix_freq);
|
||||||
break;
|
break;
|
||||||
case TOK_PUMPCRNT:
|
case TOK_PUMPCRNT:
|
||||||
sscanf(val, "%d", &priv->pump_crrnt);
|
sscanf(val, "%d", &priv->pump_crrnt);
|
||||||
|
@ -236,13 +236,13 @@ int drt1_get_conf(RIG *rig, token_t token, char *val)
|
||||||
|
|
||||||
switch(token) {
|
switch(token) {
|
||||||
case TOK_OSCFREQ:
|
case TOK_OSCFREQ:
|
||||||
sprintf(val, "%"FREQFMT, priv->osc_freq);
|
sprintf(val, "%"PRIfreq, priv->osc_freq);
|
||||||
break;
|
break;
|
||||||
case TOK_REFMULT:
|
case TOK_REFMULT:
|
||||||
sprintf(val, "%d", priv->ref_mult);
|
sprintf(val, "%d", priv->ref_mult);
|
||||||
break;
|
break;
|
||||||
case TOK_IFMIXFREQ:
|
case TOK_IFMIXFREQ:
|
||||||
sprintf(val, "%"FREQFMT, priv->if_mix_freq);
|
sprintf(val, "%"PRIfreq, priv->if_mix_freq);
|
||||||
break;
|
break;
|
||||||
case TOK_PUMPCRNT:
|
case TOK_PUMPCRNT:
|
||||||
sprintf(val, "%d", priv->pump_crrnt);
|
sprintf(val, "%d", priv->pump_crrnt);
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* Hamlib KIT backend - Elektor DRM receiver description
|
* Hamlib KIT backend - Elektor DRM receiver description
|
||||||
* Copyright (c) 2004 by Stephane Fillod
|
* Copyright (c) 2004-2005 by Stephane Fillod
|
||||||
*
|
*
|
||||||
* $Id: elektor304.c,v 1.4 2004-08-23 20:31:35 fillods Exp $
|
* $Id: elektor304.c,v 1.5 2005-01-24 23:04:21 fillods Exp $
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as
|
* it under the terms of the GNU General Public License as
|
||||||
|
@ -196,10 +196,10 @@ int elektor304_set_conf(RIG *rig, token_t token, const char *val)
|
||||||
|
|
||||||
switch(token) {
|
switch(token) {
|
||||||
case TOK_OSCFREQ:
|
case TOK_OSCFREQ:
|
||||||
sscanf(val, "%"FREQFMT, &priv->osc_freq);
|
sscanf(val, "%"SCNfreq, &priv->osc_freq);
|
||||||
break;
|
break;
|
||||||
case TOK_IFMIXFREQ:
|
case TOK_IFMIXFREQ:
|
||||||
sscanf(val, "%"FREQFMT, &priv->if_mix_freq);
|
sscanf(val, "%"SCNfreq, &priv->if_mix_freq);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return -RIG_EINVAL;
|
return -RIG_EINVAL;
|
||||||
|
@ -220,10 +220,10 @@ int elektor304_get_conf(RIG *rig, token_t token, char *val)
|
||||||
|
|
||||||
switch(token) {
|
switch(token) {
|
||||||
case TOK_OSCFREQ:
|
case TOK_OSCFREQ:
|
||||||
sprintf(val, "%"FREQFMT, priv->osc_freq);
|
sprintf(val, "%"PRIfreq, priv->osc_freq);
|
||||||
break;
|
break;
|
||||||
case TOK_IFMIXFREQ:
|
case TOK_IFMIXFREQ:
|
||||||
sprintf(val, "%"FREQFMT, priv->if_mix_freq);
|
sprintf(val, "%"PRIfreq, priv->if_mix_freq);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return -RIG_EINVAL;
|
return -RIG_EINVAL;
|
||||||
|
|
33
src/misc.h
33
src/misc.h
|
@ -2,7 +2,7 @@
|
||||||
* Hamlib Interface - toolbox header
|
* Hamlib Interface - toolbox header
|
||||||
* Copyright (c) 2000-2004 by Stephane Fillod
|
* Copyright (c) 2000-2004 by Stephane Fillod
|
||||||
*
|
*
|
||||||
* $Id: misc.h,v 1.17 2004-05-17 21:09:44 fillods Exp $
|
* $Id: misc.h,v 1.18 2005-01-24 23:03:25 fillods Exp $
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Library General Public License as
|
* it under the terms of the GNU Library General Public License as
|
||||||
|
@ -66,7 +66,36 @@ extern HAMLIB_EXPORT(int) sprintf_freq(char *str, freq_t);
|
||||||
/* check if it's any of CR or LF */
|
/* check if it's any of CR or LF */
|
||||||
#define isreturn(c) ((c) == 10 || (c) == 13)
|
#define isreturn(c) ((c) == 10 || (c) == 13)
|
||||||
|
|
||||||
|
|
||||||
|
/* needs config.h included beforehand in .c file */
|
||||||
|
#ifdef HAVE_INTTYPES_H
|
||||||
|
#include <inttypes.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PRId64
|
||||||
|
/** \brief printf(3) format to be used for long long (64bits) type */
|
||||||
|
#define PRIll PRId64
|
||||||
|
#else
|
||||||
|
#ifdef FBSD4
|
||||||
|
#define PRIll "qd"
|
||||||
|
#else
|
||||||
|
#define PRIll "lld"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SCNd64
|
||||||
|
/** \brief scanf(3) format to be used for long long (64bits) type */
|
||||||
|
#define SCNll SCNd64
|
||||||
|
#else
|
||||||
|
#ifdef FBSD4
|
||||||
|
#define SCNll "qd"
|
||||||
|
#else
|
||||||
|
#define SCNll "lld"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
#endif /* _MISC_H */
|
#endif /* _MISC_H */
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* memcsv.c - (C) Stephane Fillod 2003-2004
|
* memcsv.c - (C) Stephane Fillod 2003-2005
|
||||||
*
|
*
|
||||||
* This program exercises the backup and restore of a radio
|
* This program exercises the backup and restore of a radio
|
||||||
* using Hamlib. CSV primitives
|
* using Hamlib. CSV primitives
|
||||||
*
|
*
|
||||||
* $Id: memcsv.c,v 1.5 2004-12-27 12:53:02 f4dwv Exp $
|
* $Id: memcsv.c,v 1.6 2005-01-24 23:04:21 fillods Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -291,7 +291,7 @@ void dump_csv_chan(const channel_cap_t *mem_caps, const channel_t *chan, FILE *f
|
||||||
fprintf(f,"%d;",chan->ant);
|
fprintf(f,"%d;",chan->ant);
|
||||||
}
|
}
|
||||||
if (mem_caps->freq) {
|
if (mem_caps->freq) {
|
||||||
fprintf(f,"%"FREQFMT";",chan->freq);
|
fprintf(f,"%"PRIfreq";",chan->freq);
|
||||||
}
|
}
|
||||||
if (mem_caps->mode) {
|
if (mem_caps->mode) {
|
||||||
fprintf(f, "%s;", rig_strrmode(chan->mode));
|
fprintf(f, "%s;", rig_strrmode(chan->mode));
|
||||||
|
@ -300,7 +300,7 @@ void dump_csv_chan(const channel_cap_t *mem_caps, const channel_t *chan, FILE *f
|
||||||
fprintf(f,"%d;",(int)chan->width);
|
fprintf(f,"%d;",(int)chan->width);
|
||||||
}
|
}
|
||||||
if (mem_caps->tx_freq) {
|
if (mem_caps->tx_freq) {
|
||||||
fprintf(f,"%"FREQFMT";",chan->tx_freq);
|
fprintf(f,"%"PRIfreq";",chan->tx_freq);
|
||||||
}
|
}
|
||||||
if (mem_caps->tx_mode) {
|
if (mem_caps->tx_mode) {
|
||||||
fprintf(f, "%s;", rig_strrmode(chan->tx_mode));
|
fprintf(f, "%s;", rig_strrmode(chan->tx_mode));
|
||||||
|
@ -330,7 +330,7 @@ void dump_csv_chan(const channel_cap_t *mem_caps, const channel_t *chan, FILE *f
|
||||||
fprintf(f,"%d;",(int)chan->xit);
|
fprintf(f,"%d;",(int)chan->xit);
|
||||||
}
|
}
|
||||||
if (mem_caps->funcs) {
|
if (mem_caps->funcs) {
|
||||||
fprintf(f,"%llx;",(long long)chan->funcs);
|
fprintf(f,"%lx;",chan->funcs);
|
||||||
}
|
}
|
||||||
if (mem_caps->ctcss_tone) {
|
if (mem_caps->ctcss_tone) {
|
||||||
fprintf(f,"%d;",chan->ctcss_tone);
|
fprintf(f,"%d;",chan->ctcss_tone);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* memload.c - Copyright (C) 2003 Thierry Leconte
|
* memload.c - Copyright (C) 2003 Thierry Leconte
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* $Id: memload.c,v 1.4 2004-05-17 21:09:45 fillods Exp $
|
* $Id: memload.c,v 1.5 2005-01-24 23:04:24 fillods Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -147,7 +147,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
|
||||||
if (rig->state.chan_list[i].mem_caps.freq) {
|
if (rig->state.chan_list[i].mem_caps.freq) {
|
||||||
prop=xmlGetProp(node, "freq");
|
prop=xmlGetProp(node, "freq");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
sscanf(prop,"%"FREQFMT,&chan->freq);
|
sscanf(prop,"%"SCNfreq,&chan->freq);
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.mode) {
|
if (rig->state.chan_list[i].mem_caps.mode) {
|
||||||
prop=xmlGetProp(node, "mode");
|
prop=xmlGetProp(node, "mode");
|
||||||
|
@ -162,7 +162,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
|
||||||
if (rig->state.chan_list[i].mem_caps.tx_freq) {
|
if (rig->state.chan_list[i].mem_caps.tx_freq) {
|
||||||
prop=xmlGetProp(node, "tx_freq");
|
prop=xmlGetProp(node, "tx_freq");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
sscanf(prop,"%"FREQFMT,&chan->tx_freq);
|
sscanf(prop,"%"SCNfreq,&chan->tx_freq);
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.tx_mode) {
|
if (rig->state.chan_list[i].mem_caps.tx_mode) {
|
||||||
prop=xmlGetProp(node, "tx_mode");
|
prop=xmlGetProp(node, "tx_mode");
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
/*
|
/*
|
||||||
* rigctl.c - (C) Stephane Fillod 2000-2004
|
* rigctl.c - (C) Stephane Fillod 2000-2005
|
||||||
*
|
*
|
||||||
* This program test/control a radio using Hamlib.
|
* This program test/control a radio using Hamlib.
|
||||||
* It takes commands in interactive mode as well as
|
* It takes commands in interactive mode as well as
|
||||||
* from command line options.
|
* from command line options.
|
||||||
*
|
*
|
||||||
* $Id: rigctl.c,v 1.52 2004-10-02 10:33:21 fillods Exp $
|
* $Id: rigctl.c,v 1.53 2005-01-24 23:04:26 fillods Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -801,7 +801,7 @@ declare_proto_rig(set_freq)
|
||||||
{
|
{
|
||||||
freq_t freq;
|
freq_t freq;
|
||||||
|
|
||||||
sscanf(arg1, "%"FREQFMT, &freq);
|
sscanf(arg1, "%"SCNfreq, &freq);
|
||||||
return rig_set_freq(rig, vfo, freq);
|
return rig_set_freq(rig, vfo, freq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1038,7 +1038,7 @@ declare_proto_rig(set_split_freq)
|
||||||
{
|
{
|
||||||
freq_t txfreq;
|
freq_t txfreq;
|
||||||
|
|
||||||
sscanf(arg1, "%"FREQFMT, &txfreq);
|
sscanf(arg1, "%"SCNfreq, &txfreq);
|
||||||
return rig_set_split_freq(rig, vfo, txfreq);
|
return rig_set_split_freq(rig, vfo, txfreq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1149,7 +1149,7 @@ declare_proto_rig(power2mW)
|
||||||
printf("Power [0.0 .. 1.0]: ");
|
printf("Power [0.0 .. 1.0]: ");
|
||||||
scanf("%f", &power);
|
scanf("%f", &power);
|
||||||
printf("Frequency: ");
|
printf("Frequency: ");
|
||||||
scanf("%"FREQFMT, &freq);
|
scanf("%"SCNfreq, &freq);
|
||||||
printf("Mode: ");
|
printf("Mode: ");
|
||||||
scanf("%d", &mode);
|
scanf("%d", &mode);
|
||||||
status = rig_power2mW(rig, &mwp, power, freq, mode);
|
status = rig_power2mW(rig, &mwp, power, freq, mode);
|
||||||
|
|
|
@ -31,7 +31,7 @@ int main (int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Little Endian mode\n");
|
printf("Little Endian mode\n");
|
||||||
printf("Frequency: %"FREQFMT"\n",f);
|
printf("Frequency: %"PRIfreq"\n",f);
|
||||||
to_bcd(b, f, digits);
|
to_bcd(b, f, digits);
|
||||||
printf("BCD: %2.2x",b[0]);
|
printf("BCD: %2.2x",b[0]);
|
||||||
for (i = 1; i < (digits+1)/2; i++)
|
for (i = 1; i < (digits+1)/2; i++)
|
||||||
|
@ -39,7 +39,7 @@ int main (int argc, char *argv[])
|
||||||
printf("\nResult after recoding: %llu\n", from_bcd(b, digits));
|
printf("\nResult after recoding: %llu\n", from_bcd(b, digits));
|
||||||
|
|
||||||
printf("\nBig Endian mode\n");
|
printf("\nBig Endian mode\n");
|
||||||
printf("Frequency: %"FREQFMT"\n",f);
|
printf("Frequency: %"PRIfreq"\n",f);
|
||||||
to_bcd_be(b, f, digits);
|
to_bcd_be(b, f, digits);
|
||||||
printf("BCD: %2.2x",b[0]);
|
printf("BCD: %2.2x",b[0]);
|
||||||
for (i = 1; i < (digits+1)/2; i++)
|
for (i = 1; i < (digits+1)/2; i++)
|
||||||
|
|
|
@ -194,7 +194,7 @@ int main (int argc, char *argv[])
|
||||||
retcode = rig_get_freq(my_rig, RIG_VFO_CURR, &freq);
|
retcode = rig_get_freq(my_rig, RIG_VFO_CURR, &freq);
|
||||||
|
|
||||||
if (retcode == RIG_OK ) {
|
if (retcode == RIG_OK ) {
|
||||||
printf("rig_get_freq: freq = %"FREQFMT"\n", freq);
|
printf("rig_get_freq: freq = %"PRIfreq"\n", freq);
|
||||||
} else {
|
} else {
|
||||||
printf("rig_get_freq: error = %s \n", rigerror(retcode));
|
printf("rig_get_freq: error = %s \n", rigerror(retcode));
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ int myfreq_event(RIG *rig, vfo_t vfo, freq_t freq, rig_ptr_t arg)
|
||||||
{
|
{
|
||||||
int *count_ptr = (int *) arg;
|
int *count_ptr = (int *) arg;
|
||||||
|
|
||||||
printf("Rig changed freq to %"FREQFMT"Hz\n", freq);
|
printf("Rig changed freq to %"PRIfreq"Hz\n", freq);
|
||||||
*count_ptr += 1;
|
*count_ptr += 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* The starting point for this code was Frank's ft847 implementation.
|
* The starting point for this code was Frank's ft847 implementation.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* $Id: ft100.c,v 1.14 2004-02-01 22:29:23 fillods Exp $
|
* $Id: ft100.c,v 1.15 2005-01-24 23:04:29 fillods Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
|
@ -399,7 +399,7 @@ int ft100_set_freq(RIG *rig, vfo_t vfo, freq_t freq) {
|
||||||
|
|
||||||
rig_s = &rig->state;
|
rig_s = &rig->state;
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_VERBOSE,"ft100: requested freq = %"FREQFMT" Hz \n", freq);
|
rig_debug(RIG_DEBUG_VERBOSE,"ft100: requested freq = %"PRIfreq" Hz \n", freq);
|
||||||
rig_debug(RIG_DEBUG_VERBOSE,"ft100: vfo =%i \n", vfo);
|
rig_debug(RIG_DEBUG_VERBOSE,"ft100: vfo =%i \n", vfo);
|
||||||
|
|
||||||
if( ( vfo != RIG_VFO_CURR ) &&
|
if( ( vfo != RIG_VFO_CURR ) &&
|
||||||
|
@ -423,7 +423,7 @@ int ft100_set_freq(RIG *rig, vfo_t vfo, freq_t freq) {
|
||||||
to_bcd(p->p_cmd,freq,8); /* store bcd format in in p_cmd */
|
to_bcd(p->p_cmd,freq,8); /* store bcd format in in p_cmd */
|
||||||
/* TODO -- fix 10Hz resolution -- FS */
|
/* TODO -- fix 10Hz resolution -- FS */
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_VERBOSE,"ft100: requested freq after conversion = %"FREQFMT" Hz \n", from_bcd_be(p->p_cmd,8)* 10 );
|
rig_debug(RIG_DEBUG_VERBOSE,"ft100: requested freq after conversion = %"PRIfreq" Hz \n", from_bcd_be(p->p_cmd,8)* 10 );
|
||||||
|
|
||||||
cmd = p->p_cmd; /* get native sequence */
|
cmd = p->p_cmd; /* get native sequence */
|
||||||
write_block(&rig_s->rigport, cmd, YAESU_CMD_LENGTH);
|
write_block(&rig_s->rigport, cmd, YAESU_CMD_LENGTH);
|
||||||
|
@ -465,7 +465,7 @@ int ft100_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) {
|
||||||
d1=strtol(freq_str,NULL,16);
|
d1=strtol(freq_str,NULL,16);
|
||||||
d2=(d1*1.25); /* fixed 10Hz bug by OH2MMY */
|
d2=(d1*1.25); /* fixed 10Hz bug by OH2MMY */
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_VERBOSE,"ft100: d1=%"FREQFMT" d2=%"FREQFMT"\n",d1,d2);
|
rig_debug(RIG_DEBUG_VERBOSE,"ft100: d1=%"PRIfreq" d2=%"PRIfreq"\n",d1,d2);
|
||||||
|
|
||||||
sprintf(sfreq,"%8lli",(long long)d2);
|
sprintf(sfreq,"%8lli",(long long)d2);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* via serial interface to an FT-990 using the "CAT" interface
|
* via serial interface to an FT-990 using the "CAT" interface
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* $Id: ft990.c,v 1.13 2004-09-26 17:36:42 fillods Exp $
|
* $Id: ft990.c,v 1.14 2005-01-24 23:04:35 fillods Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
|
@ -403,7 +403,7 @@ int ft990_set_freq(RIG *rig, vfo_t vfo, freq_t freq) {
|
||||||
return -RIG_EINVAL;
|
return -RIG_EINVAL;
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: passed vfo = 0x%02x\n", __func__, vfo);
|
rig_debug(RIG_DEBUG_TRACE, "%s: passed vfo = 0x%02x\n", __func__, vfo);
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: passed freq = %"FREQFMT" Hz\n", __func__, freq);
|
rig_debug(RIG_DEBUG_TRACE, "%s: passed freq = %"PRIfreq" Hz\n", __func__, freq);
|
||||||
|
|
||||||
// Frequency range sanity check
|
// Frequency range sanity check
|
||||||
if (freq < 100000 || freq > 30000000)
|
if (freq < 100000 || freq > 30000000)
|
||||||
|
@ -503,7 +503,7 @@ int ft990_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) {
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: p0=0x%02x p1=0x%02x p2=0x%02x\n",
|
rig_debug(RIG_DEBUG_TRACE, "%s: p0=0x%02x p1=0x%02x p2=0x%02x\n",
|
||||||
__func__, p[0], p[1], p[2]);
|
__func__, p[0], p[1], p[2]);
|
||||||
rig_debug(RIG_DEBUG_TRACE,
|
rig_debug(RIG_DEBUG_TRACE,
|
||||||
"%s: freq = %"FREQFMT" Hz for vfo 0x%02x\n", __func__, f, vfo);
|
"%s: freq = %"PRIfreq" Hz for vfo 0x%02x\n", __func__, f, vfo);
|
||||||
|
|
||||||
// Frequency sanity check
|
// Frequency sanity check
|
||||||
if (f<100000 || f>30000000)
|
if (f<100000 || f>30000000)
|
||||||
|
@ -2620,7 +2620,7 @@ int ft990_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq) {
|
||||||
return -RIG_EINVAL;
|
return -RIG_EINVAL;
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: passed ci = 0x%02x\n", __func__, ci);
|
rig_debug(RIG_DEBUG_TRACE, "%s: passed ci = 0x%02x\n", __func__, ci);
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: passed freq = %"FREQFMT" Hz\n", __func__, freq);
|
rig_debug(RIG_DEBUG_TRACE, "%s: passed freq = %"PRIfreq" Hz\n", __func__, freq);
|
||||||
|
|
||||||
priv = (struct ft990_priv_data *)rig->state.priv;
|
priv = (struct ft990_priv_data *)rig->state.priv;
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue