kopia lustrzana https://github.com/Hamlib/Hamlib
Merge branch 'master' of github.com:Hamlib/Hamlib into Hamlib-4.6
commit
d66b176d1b
|
@ -47,7 +47,7 @@ struct gemini_priv_data
|
|||
double vswr;
|
||||
int current; // Amps
|
||||
int temperature; // Centigrade
|
||||
char state[5];
|
||||
char state[8];
|
||||
int ptt;
|
||||
char trip[256];
|
||||
};
|
||||
|
|
|
@ -1,21 +1,26 @@
|
|||
# Idea from https://github.com/ok2cqr/cqrlog
|
||||
# Base Image
|
||||
FROM ubuntu:latest AS hamlib-base-image
|
||||
|
||||
FROM ubuntu:latest
|
||||
ENV DEBIAN_FRONTEND="noninteractive" TZ="Etc/UTC"
|
||||
|
||||
RUN apt-get update && apt-get -y upgrade
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y git build-essential automake libtool python-is-python3 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/London"
|
||||
# Builder Image
|
||||
|
||||
RUN apt-get install -y git build-essential automake libtool
|
||||
FROM hamlib-base-image AS hamlib-builder
|
||||
|
||||
RUN mkdir -p /usr/local/hamlib-alpha /home/hamlib/build
|
||||
COPY . /wip
|
||||
|
||||
# Mount point for the git repository:
|
||||
VOLUME ["/home/hamlib/build"]
|
||||
WORKDIR /wip
|
||||
|
||||
# Mount point for the result of the build:
|
||||
VOLUME ["/usr/local/hamlib-alpha"]
|
||||
RUN ./bootstrap && ./configure --prefix=/usr/local \
|
||||
&& make clean && make -j${nproc} && make install
|
||||
|
||||
WORKDIR /home/hamlib/build
|
||||
# Runtime Image
|
||||
FROM ubuntu:latest AS hamlib-runtime
|
||||
|
||||
ENTRYPOINT rm -rf build && mkdir -p build && cd build && ../bootstrap && ../configure --prefix=/usr/local/hamlib-alpha && make clean && make && make install
|
||||
COPY --from=hamlib-builder /usr/local /usr/local
|
||||
|
||||
ENV LD_LIBRARY_PATH="/usr/local/lib"
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
|
||||
# Build the hamlib-runtime from the repository root
|
||||
|
||||
```
|
||||
docker buildx build \
|
||||
--platform linux/amd64,linux/arm64 \
|
||||
--target hamlib-runtime \
|
||||
-t hamlib-runtime \
|
||||
-f docker-build/Dockerfile \
|
||||
.
|
||||
```
|
||||
|
||||
# Interactively, develop with the hamlib-base-image
|
||||
|
||||
|
||||
## Support the linux/amd64 and linux/arm64 platforms
|
||||
```
|
||||
docker buildx build \
|
||||
--platform linux/amd64,linux/arm64 \
|
||||
--target hamlib-base-image \
|
||||
-t hamlib-base-image \
|
||||
-f docker-build/Dockerfile \
|
||||
.
|
||||
```
|
||||
|
||||
## Develop on the linux/amd64 hamlib-base-image
|
||||
|
||||
```
|
||||
docker run \
|
||||
-it \
|
||||
--rm \
|
||||
--platform linux/amd64 \
|
||||
-v $(pwd):/wip \
|
||||
-w /wip \
|
||||
-u $(id -u):$(id -g) \
|
||||
hamlib-base-image bash
|
||||
```
|
||||
|
||||
...or the linux/arm64 hamlib-base-image
|
||||
|
||||
```
|
||||
docker run \
|
||||
-it \
|
||||
--rm \
|
||||
--platform linux/arm64 \
|
||||
-v $(pwd):/wip \
|
||||
-w /wip \
|
||||
-u $(id -u):$(id -g) \
|
||||
hamlib-base-image bash
|
||||
```
|
||||
|
||||
# Run the linux/amd64 hamlib-runtime
|
||||
|
||||
```
|
||||
docker run \
|
||||
-it \
|
||||
--rm \
|
||||
--platform linux/amd64 \
|
||||
hamlib-runtime bash
|
||||
```
|
||||
|
||||
...or the linux/arm64 hamlib-runtime
|
||||
|
||||
```
|
||||
docker run \
|
||||
-it \
|
||||
--rm \
|
||||
--platform linux/arm64 \
|
||||
hamlib-runtime bash
|
||||
```
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
This is all about building hamlib inside docker container - so that you do not need to install dependencies on your local machine.
|
||||
|
||||
1. Build docker container
|
||||
|
||||
(cd docker-build && docker build --no-cache -t this.registry.is.invalid/hamlib-build .)
|
||||
|
||||
2. Build hamlib
|
||||
|
||||
docker run -ti -u root -v $(pwd):/home/hamlib/build -v /usr/local/hamlib-alpha:/usr/local/hamlib-alpha this.registry.is.invalid/hamlib-build
|
||||
|
||||
3. Execute hamlib
|
||||
|
||||
/usr/local/hamlib-alpha/bin/rigctl <your options here>
|
|
@ -530,7 +530,7 @@ static int aclog_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
*mode = RIG_MODE_NONE;
|
||||
int n = sscanf(p, "<MODE>%31[^<]", modetmp);
|
||||
|
||||
if (n) { *mode = modeMapGetHamlib(modetmp); }
|
||||
if (n == 1) { *mode = modeMapGetHamlib(modetmp); }
|
||||
else
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Unable to parse <MODE> from '%s'\n", __func__,
|
||||
|
@ -834,7 +834,7 @@ static int aclog_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: return modeA=%s, widthA=%d\n,modeB=%s, widthB=%d\n", __func__,
|
||||
"%s: Return modeA=%s, widthA=%d\n,modeB=%s, widthB=%d\n", __func__,
|
||||
rig_strrmode(priv->curr_modeA), (int)priv->curr_widthA,
|
||||
rig_strrmode(priv->curr_modeB), (int)priv->curr_widthB);
|
||||
RETURNFUNC(RIG_OK);
|
||||
|
|
|
@ -910,7 +910,7 @@ static int flrig_open(RIG *rig)
|
|||
int dummy;
|
||||
|
||||
if (retval == RIG_ENAVAIL || value[0] == 0
|
||||
|| sscanf(value, "%d", &dummy) == 0) // must not have it
|
||||
|| sscanf(value, "%d", &dummy) <= 0) // must not have it
|
||||
{
|
||||
priv->has_get_bwA = 0;
|
||||
priv->has_get_bwB = 0; // if we don't have A then surely we don't have B either
|
||||
|
@ -943,7 +943,7 @@ static int flrig_open(RIG *rig)
|
|||
|
||||
if (priv->has_get_bwA)
|
||||
{
|
||||
/* see if get_bwB is available FLRig can return empty value too */
|
||||
// see if get_bwB is available FLRig can return empty value too
|
||||
retval = flrig_transaction(rig, "rig.get_bwB", NULL, value, sizeof(value));
|
||||
|
||||
if (retval == RIG_ENAVAIL || strlen(value) == 0) // must not have it
|
||||
|
@ -1667,7 +1667,7 @@ static int flrig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: return modeA=%s, widthA=%d\n,modeB=%s, widthB=%d\n", __func__,
|
||||
"%s: Return modeA=%s, widthA=%d\n,modeB=%s, widthB=%d\n", __func__,
|
||||
rig_strrmode(priv->curr_modeA), (int)priv->curr_widthA,
|
||||
rig_strrmode(priv->curr_modeB), (int)priv->curr_widthB);
|
||||
RETURNFUNC(RIG_OK);
|
||||
|
@ -1792,7 +1792,7 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
if (strlen(value) ==
|
||||
0) // sometimes we get a null reply here -- OK...deal with it
|
||||
{
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: empty value return cached bandwidth\n",
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: empty value, returning cached bandwidth\n",
|
||||
__func__);
|
||||
*width = CACHE(rig)->widthMainA;
|
||||
RETURNFUNC(RIG_OK);
|
||||
|
@ -1819,7 +1819,7 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
|
||||
if (strlen(value) == 0)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: empty value return cached bandwidth\n",
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: empty value, returning cached bandwidth\n",
|
||||
__func__);
|
||||
*width = CACHE(rig)->widthMainA;
|
||||
RETURNFUNC(RIG_OK);
|
||||
|
|
|
@ -280,7 +280,7 @@ static int netrigctl_open(RIG *rig)
|
|||
}
|
||||
else
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unknown return from netrigctl_transaction=%d\n",
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unknown value returned from netrigctl_transaction=%d\n",
|
||||
__func__, ret);
|
||||
}
|
||||
|
||||
|
|
|
@ -1281,7 +1281,7 @@ static int tci1x_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: return modeA=%s, widthA=%d\n,modeB=%s, widthB=%d\n", __func__,
|
||||
"%s: Return modeA=%s, widthA=%d\n,modeB=%s, widthB=%d\n", __func__,
|
||||
rig_strrmode(priv->curr_modeA), (int)priv->curr_widthA,
|
||||
rig_strrmode(priv->curr_modeB), (int)priv->curr_widthB);
|
||||
RETURNFUNC(RIG_OK);
|
||||
|
|
|
@ -1114,7 +1114,7 @@ static int trxmanager_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split,
|
|||
*tx_vfo = RIG_VFO_B;
|
||||
n = sscanf(response, "SP%d", &tsplit);
|
||||
|
||||
if (n == 0)
|
||||
if (n == 0 || n == EOF)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s error getting split from '%s'\n", __func__,
|
||||
response);
|
||||
|
|
|
@ -462,7 +462,7 @@ static int smartsdr_parse_S(RIG *rig, char *s)
|
|||
rig_debug(RIG_DEBUG_VERBOSE, "%s: PTT state=%s, ptt=%d\n", __func__, state,
|
||||
priv->ptt);
|
||||
}
|
||||
else if (sscanf(p, "tx=%d\n", &priv->tx))
|
||||
else if (sscanf(p, "tx=%d\n", &priv->tx) == 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: tx=%d\n", __func__, priv->tx);
|
||||
}
|
||||
|
|
|
@ -150,9 +150,8 @@ int icom_one_transaction(RIG *rig, unsigned char cmd, int subcmd,
|
|||
|
||||
ctrl_id = priv_caps->serial_full_duplex == 0 ? CTRLID : 0x80;
|
||||
|
||||
/*
|
||||
* should check return code and that write wrote cmd_len chars!
|
||||
*/
|
||||
// Should check return code and that write wrote cmd_len chars!
|
||||
|
||||
set_transaction_active(rig);
|
||||
|
||||
collision_retry:
|
||||
|
@ -204,7 +203,7 @@ again1:
|
|||
if (retval < 0)
|
||||
{
|
||||
set_transaction_inactive(rig);
|
||||
/* Other error, return it */
|
||||
// Other error, return it
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
|
@ -390,8 +389,8 @@ again2:
|
|||
__func__, priv_caps->re_civ_addr, priv->re_civ_addr);
|
||||
}
|
||||
|
||||
/* RIG_TIMEOUT: timeout getting response, return timeout */
|
||||
/* other error: return it */
|
||||
// RIG_TIMEOUT: timeout getting response, return timeout
|
||||
// other error: return it
|
||||
RETURNFUNC(frm_len);
|
||||
}
|
||||
|
||||
|
|
|
@ -1190,7 +1190,7 @@ retry_open:
|
|||
rig_debug(RIG_DEBUG_ERR,
|
||||
"%s: Unable to determine Icom echo status -- is rig on and connected?\n",
|
||||
__func__);
|
||||
return retval_echo;
|
||||
RETURNFUNC(retval_echo);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2687,7 +2687,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
if (width <= 3)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: setting filter=%d\n", __func__, (int)width);
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
if (((width != RIG_PASSBAND_NOCHANGE) && (width != current_width))
|
||||
|
|
|
@ -5518,12 +5518,11 @@ int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg)
|
|||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
/*
|
||||
* If answer is "KY0;", there is space in buffer and we can proceed.
|
||||
* If answer is "KY1;", we have to wait a while
|
||||
* If answer is "KY2;", there is space in buffer and we aren't sending so we can proceed.
|
||||
* If answer is something else, return with error to prevent infinite loops
|
||||
*/
|
||||
// If answer is "KY0;", there is space in buffer and we can proceed.
|
||||
// If answer is "KY1;", we have to wait a while
|
||||
// If answer is "KY2;", there is space in buffer and we aren't sending so we can proceed.
|
||||
// If answer is something else, return with error to prevent infinite loops
|
||||
|
||||
if (!strncmp(m2, "KY0", 3)) { break; }
|
||||
|
||||
if (!strncmp(m2, "KY2", 3)) { break; }
|
||||
|
|
|
@ -1714,7 +1714,7 @@ struct rig_caps ts590_caps =
|
|||
RIG_MODEL(RIG_MODEL_TS590S),
|
||||
.model_name = "TS-590S",
|
||||
.mfg_name = "Kenwood",
|
||||
.version = BACKEND_VER ".17",
|
||||
.version = BACKEND_VER ".18",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -1736,7 +1736,9 @@ struct rig_caps ts590_caps =
|
|||
.max_rit = kHz(9.99),
|
||||
.max_xit = kHz(9.99),
|
||||
.max_ifshift = Hz(0),
|
||||
.targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
|
||||
// .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
|
||||
// mode command is not vfo targetable
|
||||
.targetable_vfo = RIG_TARGETABLE_FREQ,
|
||||
.transceive = RIG_TRN_RIG,
|
||||
.agc_level_count = 6,
|
||||
.agc_levels = { RIG_AGC_OFF, RIG_AGC_SLOW, RIG_AGC_MEDIUM, RIG_AGC_FAST, RIG_AGC_SUPERFAST, RIG_AGC_ON },
|
||||
|
@ -1932,7 +1934,7 @@ struct rig_caps fx4_caps =
|
|||
RIG_MODEL(RIG_MODEL_FX4),
|
||||
.model_name = "FX4/C/CR/L",
|
||||
.mfg_name = "BG2FX",
|
||||
.version = BACKEND_VER ".10",
|
||||
.version = BACKEND_VER ".11",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -1954,7 +1956,9 @@ struct rig_caps fx4_caps =
|
|||
.max_rit = kHz(9.99),
|
||||
.max_xit = kHz(9.99),
|
||||
.max_ifshift = Hz(0),
|
||||
.targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
|
||||
// .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
|
||||
// mode command is not vfo targetable
|
||||
.targetable_vfo = RIG_TARGETABLE_FREQ,
|
||||
.transceive = RIG_TRN_RIG,
|
||||
.agc_level_count = 6,
|
||||
.agc_levels = { RIG_AGC_OFF, RIG_AGC_SLOW, RIG_AGC_MEDIUM, RIG_AGC_FAST, RIG_AGC_SUPERFAST, RIG_AGC_ON },
|
||||
|
@ -2140,7 +2144,7 @@ struct rig_caps ts590sg_caps =
|
|||
RIG_MODEL(RIG_MODEL_TS590SG),
|
||||
.model_name = "TS-590SG",
|
||||
.mfg_name = "Kenwood",
|
||||
.version = BACKEND_VER ".11",
|
||||
.version = BACKEND_VER ".12",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -2162,7 +2166,9 @@ struct rig_caps ts590sg_caps =
|
|||
.max_rit = kHz(9.99),
|
||||
.max_xit = kHz(9.99),
|
||||
.max_ifshift = Hz(0),
|
||||
.targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
|
||||
// .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
|
||||
// mode command is not vfo targetable
|
||||
.targetable_vfo = RIG_TARGETABLE_FREQ,
|
||||
.transceive = RIG_TRN_RIG,
|
||||
.agc_level_count = 6,
|
||||
.agc_levels = { RIG_AGC_OFF, RIG_AGC_SLOW, RIG_AGC_MEDIUM, RIG_AGC_FAST, RIG_AGC_SUPERFAST, RIG_AGC_ON },
|
||||
|
|
|
@ -963,7 +963,7 @@ static int ft1000mp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
f,
|
||||
vfo);
|
||||
|
||||
*freq = f; /* return displayed frequency */
|
||||
*freq = f; // return displayed frequency
|
||||
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
@ -1542,7 +1542,7 @@ static int ft1000mp_get_rxit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
|
|||
rig_debug(RIG_DEBUG_TRACE, "%s: freq = %d Hz for VFO [%s]\n", __func__, (int)f,
|
||||
rig_strvfo(vfo));
|
||||
|
||||
*rit = f; /* return displayed frequency */
|
||||
*rit = f; // return displayed frequency
|
||||
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
|
|
@ -702,7 +702,7 @@ static int ft991_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
|
|||
}
|
||||
|
||||
strncat(restore_commands, priv->ret_data,
|
||||
NEWCAT_DATA_LEN - strlen(restore_commands));
|
||||
NEWCAT_DATA_LEN - strlen(restore_commands) - 1);
|
||||
|
||||
/* Change mode on VFOA */
|
||||
if (RIG_OK != (err = newcat_set_mode(rig, RIG_VFO_A, tx_mode,
|
||||
|
|
|
@ -8096,7 +8096,7 @@ int newcat_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
|
|||
if (priv->ret_data[28] != ';') // must have TAG data?
|
||||
{
|
||||
// get the TAG data
|
||||
sscanf(&priv->ret_data[28], "%32s", chan->tag);
|
||||
sscanf(&priv->ret_data[28], "%31s", chan->tag);
|
||||
char *p = strchr(chan->tag, ';');
|
||||
|
||||
if (p) { *p = 0; }
|
||||
|
@ -11342,7 +11342,7 @@ int newcat_get_cmd(RIG *rig)
|
|||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
|
||||
case 'O':
|
||||
/* Too many characters sent without a carriage return */
|
||||
// Too many characters sent without a carriage return
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: Overflow for '%s'\n", __func__,
|
||||
priv->cmd_str);
|
||||
rc = -RIG_EPROTO;
|
||||
|
@ -11776,7 +11776,7 @@ int newcat_set_cmd(RIG *rig)
|
|||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
|
||||
case 'O':
|
||||
/* Too many characters sent without a carriage return */
|
||||
// Too many characters sent without a carriage return
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: Overflow for '%s'\n", __func__,
|
||||
priv->cmd_str);
|
||||
rc = -RIG_EPROTO;
|
||||
|
|
|
@ -226,7 +226,7 @@ gs232b_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
|
|||
* directives, any amount of space is matched, including none in the input.
|
||||
*/
|
||||
// There's a 12PR1A rotor that only returns AZ so we may only get AZ=xxx
|
||||
if (sscanf(posbuf, "AZ=%d EL=%d", &int_az, &int_el) == 0)
|
||||
if (sscanf(posbuf, "AZ=%d EL=%d", &int_az, &int_el) <= 0)
|
||||
{
|
||||
// only give error if we didn't parse anything
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: wrong reply '%s', expected AZ=xxx EL=xxx\n",
|
||||
|
|
14
src/rig.c
14
src/rig.c
|
@ -1697,10 +1697,8 @@ int HAMLIB_API rig_close(RIG *rig)
|
|||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Let the backend say 73s to the rig.
|
||||
* and ignore the return code.
|
||||
*/
|
||||
// Let the backend say 73 to the rig.
|
||||
// and ignore the return code.
|
||||
if (caps->rig_close)
|
||||
{
|
||||
caps->rig_close(rig);
|
||||
|
@ -3145,14 +3143,14 @@ pbwidth_t HAMLIB_API rig_passband_normal(RIG *rig, rmode_t mode)
|
|||
{
|
||||
if (rs->filters[i].modes & mode)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: return filter#%d, width=%d\n", __func__, i,
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: Return filter#%d, width=%d\n", __func__, i,
|
||||
(int)rs->filters[i].width);
|
||||
RETURNFUNC(rs->filters[i].width);
|
||||
}
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE,
|
||||
"%s: filter not found...return %d\n", __func__,
|
||||
"%s: filter not found...returning %d\n", __func__,
|
||||
0);
|
||||
RETURNFUNC(0);
|
||||
}
|
||||
|
@ -3407,7 +3405,7 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo)
|
|||
rig_set_cache_freq(rig, RIG_VFO_ALL, 0);
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: return %d, vfo=%s, curr_vfo=%s\n", __func__,
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: returning %d, vfo=%s, curr_vfo=%s\n", __func__,
|
||||
retcode,
|
||||
rig_strvfo(vfo), rig_strvfo(rs->current_vfo));
|
||||
ELAPSED2;
|
||||
|
@ -3838,7 +3836,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
|||
cachep->ptt = ptt;
|
||||
elapsed_ms(&cachep->time_ptt, HAMLIB_ELAPSED_SET);
|
||||
|
||||
if (retcode != RIG_OK) { rig_debug(RIG_DEBUG_ERR, "%s: return code=%d\n", __func__, retcode); }
|
||||
if (retcode != RIG_OK) { rig_debug(RIG_DEBUG_ERR, "%s: Return code=%d\n", __func__, retcode); }
|
||||
|
||||
memcpy(&rs->pttport_deprecated, pttp,
|
||||
sizeof(rs->pttport_deprecated));
|
||||
|
|
278
src/sprintflst.c
278
src/sprintflst.c
|
@ -52,10 +52,10 @@ int check_buffer_overflow(char *str, int len, int nlen)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
||||
int rig_sprintf_vfo(char *str, int nlen, vfo_t vfo)
|
||||
{
|
||||
unsigned int i, len = 0;
|
||||
unsigned int i;
|
||||
int len = 0;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__, rig_strvfo(vfo));
|
||||
*str = '\0';
|
||||
|
@ -67,20 +67,36 @@ int rig_sprintf_vfo(char *str, int nlen, vfo_t vfo)
|
|||
|
||||
for (i = 0; i < HAMLIB_MAX_VFOS; i++)
|
||||
{
|
||||
const char *sv;
|
||||
sv = rig_strvfo(vfo & RIG_VFO_N(i));
|
||||
const char *sv = rig_strvfo(vfo & RIG_VFO_N(i));
|
||||
|
||||
if (sv && sv[0] && (strstr(sv, "None") == 0))
|
||||
{
|
||||
len += snprintf(str + len, nlen - len, "%s ", sv);
|
||||
check_buffer_overflow(str, len, nlen);
|
||||
int written = snprintf(str + len, nlen - len, "%s ", sv);
|
||||
|
||||
if (written < 0 || written >= nlen - len)
|
||||
{
|
||||
// Truncate and break if there's no space left
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
|
||||
len = nlen - 1;
|
||||
str[len] = '\0';
|
||||
break;
|
||||
}
|
||||
|
||||
len += written;
|
||||
}
|
||||
|
||||
if (len >= nlen)
|
||||
{
|
||||
// Ensure null-termination and avoid overflow
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
|
||||
str[nlen - 1] = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
int rig_sprintf_mode(char *str, int nlen, rmode_t mode)
|
||||
{
|
||||
unsigned int i, len = 0;
|
||||
|
@ -111,18 +127,17 @@ int rig_sprintf_mode(char *str, int nlen, rmode_t mode)
|
|||
return len;
|
||||
}
|
||||
|
||||
|
||||
int rig_sprintf_ant(char *str, int str_len, ant_t ant)
|
||||
{
|
||||
int i, len = 0;
|
||||
char *ant_name;
|
||||
const char *ant_name;
|
||||
|
||||
*str = '\0';
|
||||
|
||||
if (ant == RIG_ANT_NONE)
|
||||
{
|
||||
SNPRINTF(str, str_len, "ANT_NONE");
|
||||
return 0;
|
||||
snprintf(str, str_len, "ANT_NONE");
|
||||
return (int)strlen(str); // Return length of "ANT_NONE"
|
||||
}
|
||||
|
||||
for (i = 0; i < RIG_ANT_MAX; i++)
|
||||
|
@ -151,15 +166,32 @@ int rig_sprintf_ant(char *str, int str_len, ant_t ant)
|
|||
break;
|
||||
}
|
||||
|
||||
len += snprintf(str + len, str_len - len, "%s ", ant_name);
|
||||
check_buffer_overflow(str, len, str_len);
|
||||
int written = snprintf(str + len, str_len - len, "%s ", ant_name);
|
||||
|
||||
if (written < 0 || written >= str_len - len)
|
||||
{
|
||||
// Truncate if buffer is full
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
|
||||
len = str_len - 1;
|
||||
str[len] = '\0';
|
||||
break;
|
||||
}
|
||||
|
||||
len += written;
|
||||
}
|
||||
|
||||
if (len >= str_len)
|
||||
{
|
||||
// Ensure null-termination
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
|
||||
str[str_len - 1] = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
int rig_sprintf_func(char *str, int nlen, setting_t func)
|
||||
{
|
||||
unsigned int i, len = 0;
|
||||
|
@ -353,7 +385,6 @@ int sprintf_level_ext(char *str, int nlen, const struct confparams *extlevels)
|
|||
return len;
|
||||
}
|
||||
|
||||
|
||||
int rig_sprintf_level_gran(char *str, int nlen, setting_t level,
|
||||
const gran_t *gran)
|
||||
{
|
||||
|
@ -387,32 +418,42 @@ int rig_sprintf_level_gran(char *str, int nlen, setting_t level,
|
|||
continue;
|
||||
}
|
||||
|
||||
int written;
|
||||
|
||||
if (RIG_LEVEL_IS_FLOAT(rig_idx2setting(i)))
|
||||
{
|
||||
len += snprintf(str + len, nlen - len,
|
||||
"%s(%f..%f/%f) ",
|
||||
ms,
|
||||
gran[i].min.f,
|
||||
gran[i].max.f,
|
||||
gran[i].step.f);
|
||||
written = snprintf(str + len, nlen - len, "%s(%f..%f/%f) ", ms, gran[i].min.f,
|
||||
gran[i].max.f, gran[i].step.f);
|
||||
}
|
||||
else
|
||||
{
|
||||
len += snprintf(str + len, nlen - len,
|
||||
"%s(%d..%d/%d) ",
|
||||
ms,
|
||||
gran[i].min.i,
|
||||
gran[i].max.i,
|
||||
gran[i].step.i);
|
||||
written = snprintf(str + len, nlen - len, "%s(%d..%d/%d) ", ms, gran[i].min.i,
|
||||
gran[i].max.i, gran[i].step.i);
|
||||
}
|
||||
|
||||
check_buffer_overflow(str, len, nlen);
|
||||
if (written < 0 || written >= nlen - len)
|
||||
{
|
||||
// Truncate and stop further processing if the buffer is full
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
|
||||
len = nlen - 1;
|
||||
str[len] = '\0';
|
||||
break;
|
||||
}
|
||||
|
||||
len += written;
|
||||
|
||||
if (len >= nlen)
|
||||
{
|
||||
// Ensure null-termination and avoid overflow
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
|
||||
str[nlen - 1] = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
int rot_sprintf_level_gran(char *str, int nlen, setting_t level,
|
||||
const gran_t *gran)
|
||||
{
|
||||
|
@ -446,32 +487,42 @@ int rot_sprintf_level_gran(char *str, int nlen, setting_t level,
|
|||
continue;
|
||||
}
|
||||
|
||||
int written;
|
||||
|
||||
if (ROT_LEVEL_IS_FLOAT(rig_idx2setting(i)))
|
||||
{
|
||||
len += snprintf(str + len, nlen - len,
|
||||
"%s(%f..%f/%f) ",
|
||||
ms,
|
||||
gran[i].min.f,
|
||||
gran[i].max.f,
|
||||
gran[i].step.f);
|
||||
written = snprintf(str + len, nlen - len, "%s(%f..%f/%f) ", ms, gran[i].min.f,
|
||||
gran[i].max.f, gran[i].step.f);
|
||||
}
|
||||
else
|
||||
{
|
||||
len += snprintf(str + len, nlen - len,
|
||||
"%s(%d..%d/%d) ",
|
||||
ms,
|
||||
gran[i].min.i,
|
||||
gran[i].max.i,
|
||||
gran[i].step.i);
|
||||
written = snprintf(str + len, nlen - len, "%s(%d..%d/%d) ", ms, gran[i].min.i,
|
||||
gran[i].max.i, gran[i].step.i);
|
||||
}
|
||||
|
||||
check_buffer_overflow(str, len, nlen);
|
||||
if (written < 0 || written >= nlen - len)
|
||||
{
|
||||
// Truncate and stop further processing if the buffer is full
|
||||
len = nlen - 1;
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
|
||||
str[len] = '\0';
|
||||
break;
|
||||
}
|
||||
|
||||
len += written;
|
||||
|
||||
if (len >= nlen)
|
||||
{
|
||||
// Ensure null-termination and avoid overflow
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
|
||||
str[nlen - 1] = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
int rig_sprintf_parm(char *str, int nlen, setting_t parm)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
@ -501,7 +552,6 @@ int rig_sprintf_parm(char *str, int nlen, setting_t parm)
|
|||
return len;
|
||||
}
|
||||
|
||||
|
||||
int rot_sprintf_parm(char *str, int nlen, setting_t parm)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
@ -519,24 +569,38 @@ int rot_sprintf_parm(char *str, int nlen, setting_t parm)
|
|||
|
||||
if (!ms || !ms[0])
|
||||
{
|
||||
continue; /* unknown, FIXME! */
|
||||
continue; /* unknown, FIXME! */
|
||||
}
|
||||
|
||||
strcat(str, ms);
|
||||
strcat(str, " ");
|
||||
len += strlen(ms) + 1;
|
||||
check_buffer_overflow(str, len, nlen);
|
||||
int written = snprintf(str + len, nlen - len, "%s ", ms);
|
||||
|
||||
if (written < 0 || written >= nlen - len)
|
||||
{
|
||||
// Truncate and stop further processing if the buffer is full
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
|
||||
len = nlen - 1;
|
||||
str[len] = '\0';
|
||||
break;
|
||||
}
|
||||
|
||||
len += written;
|
||||
|
||||
if (len >= nlen)
|
||||
{
|
||||
// Ensure null-termination and avoid overflow
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
|
||||
str[nlen - 1] = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
int rig_sprintf_parm_gran(char *str, int nlen, setting_t parm,
|
||||
const gran_t *gran)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
||||
*str = '\0';
|
||||
|
||||
if (parm == RIG_PARM_NONE)
|
||||
|
@ -565,47 +629,57 @@ int rig_sprintf_parm_gran(char *str, int nlen, setting_t parm,
|
|||
continue;
|
||||
}
|
||||
|
||||
int written;
|
||||
|
||||
if (RIG_PARM_IS_FLOAT(rig_idx2setting(i)))
|
||||
{
|
||||
len += snprintf(str + len, nlen - len,
|
||||
"%s(%.g..%.g/%.g) ",
|
||||
ms,
|
||||
gran[i].min.f,
|
||||
gran[i].max.f,
|
||||
gran[i].step.f);
|
||||
written = snprintf(str + len, nlen - len, "%s(%.g..%.g/%.g) ", ms,
|
||||
gran[i].min.f, gran[i].max.f, gran[i].step.f);
|
||||
}
|
||||
else if (RIG_PARM_IS_STRING(rig_idx2setting(i)))
|
||||
{
|
||||
if (gran[i].step.s)
|
||||
{
|
||||
len += snprintf(str + len, nlen - len,
|
||||
"%s(%s) ",
|
||||
ms,
|
||||
gran[i].step.s);
|
||||
written = snprintf(str + len, nlen - len, "%s(%s) ", ms, gran[i].step.s);
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
len += snprintf(str + len, nlen - len,
|
||||
"%s(%d..%d/%d) ",
|
||||
ms,
|
||||
gran[i].min.i,
|
||||
gran[i].max.i,
|
||||
gran[i].step.i);
|
||||
written = snprintf(str + len, nlen - len, "%s(%d..%d/%d) ", ms, gran[i].min.i,
|
||||
gran[i].max.i, gran[i].step.i);
|
||||
}
|
||||
|
||||
check_buffer_overflow(str, len, nlen);
|
||||
if (written < 0 || written >= nlen - len)
|
||||
{
|
||||
// Truncate and stop further processing if the buffer is full
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
|
||||
len = nlen - 1;
|
||||
str[len] = '\0';
|
||||
break;
|
||||
}
|
||||
|
||||
len += written;
|
||||
|
||||
if (len >= nlen)
|
||||
{
|
||||
// Ensure null-termination and avoid overflow
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
|
||||
str[nlen - 1] = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
int rot_sprintf_parm_gran(char *str, int nlen, setting_t parm,
|
||||
const gran_t *gran)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
||||
*str = '\0';
|
||||
|
||||
if (parm == ROT_PARM_NONE)
|
||||
|
@ -634,32 +708,42 @@ int rot_sprintf_parm_gran(char *str, int nlen, setting_t parm,
|
|||
continue;
|
||||
}
|
||||
|
||||
int written;
|
||||
|
||||
if (ROT_PARM_IS_FLOAT(rig_idx2setting(i)))
|
||||
{
|
||||
len += snprintf(str + len, nlen - len,
|
||||
"%s(%f..%f/%f) ",
|
||||
ms,
|
||||
gran[i].min.f,
|
||||
gran[i].max.f,
|
||||
gran[i].step.f);
|
||||
written = snprintf(str + len, nlen - len, "%s(%f..%f/%f) ", ms, gran[i].min.f,
|
||||
gran[i].max.f, gran[i].step.f);
|
||||
}
|
||||
else
|
||||
{
|
||||
len += snprintf(str + len, nlen - len,
|
||||
"%s(%d..%d/%d) ",
|
||||
ms,
|
||||
gran[i].min.i,
|
||||
gran[i].max.i,
|
||||
gran[i].step.i);
|
||||
written = snprintf(str + len, nlen - len, "%s(%d..%d/%d) ", ms, gran[i].min.i,
|
||||
gran[i].max.i, gran[i].step.i);
|
||||
}
|
||||
|
||||
check_buffer_overflow(str, len, nlen);
|
||||
if (written < 0 || written >= nlen - len)
|
||||
{
|
||||
// Truncate and stop further processing if the buffer is full
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
|
||||
len = nlen - 1;
|
||||
str[len] = '\0';
|
||||
break;
|
||||
}
|
||||
|
||||
len += written;
|
||||
|
||||
if (len >= nlen)
|
||||
{
|
||||
// Ensure null-termination and avoid overflow
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
|
||||
str[nlen - 1] = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
int rig_sprintf_vfop(char *str, int nlen, vfo_op_t op)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
@ -719,7 +803,6 @@ int rig_sprintf_scan(char *str, int nlen, scan_t rscan)
|
|||
return len;
|
||||
}
|
||||
|
||||
|
||||
int rot_sprintf_status(char *str, int nlen, rot_status_t status)
|
||||
{
|
||||
int len = 0;
|
||||
|
@ -735,20 +818,37 @@ int rot_sprintf_status(char *str, int nlen, rot_status_t status)
|
|||
|
||||
for (i = 0; i < HAMLIB_MAX_ROTORS; i++)
|
||||
{
|
||||
const char *sv;
|
||||
sv = rot_strstatus(status & ROT_STATUS_N(i));
|
||||
const char *sv = rot_strstatus(status & ROT_STATUS_N(i));
|
||||
|
||||
if (sv && sv[0] && (strstr(sv, "None") == 0))
|
||||
{
|
||||
len += snprintf(str + len, nlen - len, "%s ", sv);
|
||||
int written = snprintf(str + len, nlen - len, "%s ", sv);
|
||||
|
||||
if (written < 0 || written >= nlen - len)
|
||||
{
|
||||
// Truncate and break if there's no space left
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
|
||||
len = nlen - 1;
|
||||
str[len] = '\0';
|
||||
break;
|
||||
}
|
||||
|
||||
len += written;
|
||||
}
|
||||
|
||||
check_buffer_overflow(str, len, nlen);
|
||||
if (len >= nlen)
|
||||
{
|
||||
// Ensure null-termination and avoid overflow
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
|
||||
str[nlen - 1] = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
int rig_sprintf_spectrum_modes(char *str, int nlen,
|
||||
const enum rig_spectrum_mode_e *modes)
|
||||
{
|
||||
|
|
|
@ -213,7 +213,7 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms));
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms) - 1);
|
||||
break;
|
||||
|
||||
case 't':
|
||||
|
|
|
@ -1406,7 +1406,8 @@ int ampctl_parse(AMP *my_amp, FILE *fin, FILE *fout, char *argv[], int argc)
|
|||
}
|
||||
else
|
||||
{
|
||||
fprintf(fout, "%s: error = %s\n", cmd_entry->name, rigerror(retcode));
|
||||
fprintf(fout, "error = %s\n", rigerror(retcode));
|
||||
//fprintf(fout, "%s: error = %s\n", cmd_entry->name, rigerror(retcode));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -256,7 +256,7 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms));
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms) - 1);
|
||||
break;
|
||||
|
||||
case 't':
|
||||
|
|
|
@ -475,7 +475,7 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms));
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms) - 1);
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
|
|
|
@ -825,7 +825,7 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc,
|
|||
|
||||
retcode = fscanf(fin, "%s", ++pcmd);
|
||||
|
||||
if (retcode == 0) { rig_debug(RIG_DEBUG_WARN, "%s: unable to scan %c\n", __func__, *(pcmd - 1)); }
|
||||
if (retcode == 0 || retcode == EOF) { rig_debug(RIG_DEBUG_WARN, "%s: unable to scan %c\n", __func__, *(pcmd - 1)); }
|
||||
|
||||
while (*++pcmd);
|
||||
|
||||
|
@ -1879,8 +1879,9 @@ readline_repeat:
|
|||
else
|
||||
{
|
||||
fprintf(fout,
|
||||
"%s: error = %s\n",
|
||||
cmd_entry->name,
|
||||
//"%s: error = %s\n",
|
||||
//cmd_entry->name,
|
||||
"error = %s\n",
|
||||
rigerror(retcode));
|
||||
}
|
||||
}
|
||||
|
@ -3398,7 +3399,7 @@ declare_proto_rig(set_level)
|
|||
|
||||
int dummy;
|
||||
|
||||
if (level == RIG_LEVEL_METER && sscanf(arg2, "%d", &dummy) == 0)
|
||||
if (level == RIG_LEVEL_METER && sscanf(arg2, "%d", &dummy) <= 0)
|
||||
{
|
||||
if (strcmp(arg2, "COMP") == 0) { arg2 = "2"; }
|
||||
else if (strcmp(arg2, "ALC") == 0) { arg2 = "4"; }
|
||||
|
@ -5478,7 +5479,7 @@ int rigctld_password_check(RIG *rig, const char *md5)
|
|||
{
|
||||
int retval = -RIG_EINVAL;
|
||||
//fprintf(fout, "password %s\n", password);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: %s == %s\n", __func__, md5, rigctld_password);
|
||||
//rig_debug(RIG_DEBUG_TRACE, "%s: %s == %s\n", __func__, md5, rigctld_password);
|
||||
is_passwordOK = 0;
|
||||
|
||||
char *mymd5 = rig_make_md5(rigctld_password);
|
||||
|
@ -5517,8 +5518,9 @@ declare_proto_rig(password)
|
|||
}
|
||||
else
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: password error, '%s'!='%s'\n", __func__,
|
||||
key, rigctld_password);
|
||||
//rig_debug(RIG_DEBUG_ERR, "%s: password error, '%s'!='%s'\n", __func__,
|
||||
// key, rigctld_password);
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: password error\n", __func__);
|
||||
}
|
||||
|
||||
RETURNFUNC2(retval);
|
||||
|
@ -5932,7 +5934,7 @@ declare_proto_rig(cm108_get_bit)
|
|||
// try GPIO format first
|
||||
int n = sscanf(arg1, "GPIO%d", &gpio);
|
||||
|
||||
if (n == 0)
|
||||
if (n == 0 || n == EOF)
|
||||
{
|
||||
n = sscanf(arg1, "%d", &gpio);
|
||||
}
|
||||
|
@ -5967,7 +5969,7 @@ declare_proto_rig(cm108_set_bit)
|
|||
// try GPIO format first
|
||||
int n = sscanf(arg1, "GPIO%d", &gpio);
|
||||
|
||||
if (n == 0)
|
||||
if (n == 0 || n == EOF)
|
||||
{
|
||||
n = sscanf(arg1, "%d", &gpio);
|
||||
}
|
||||
|
|
|
@ -439,7 +439,7 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms));
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms) - 1);
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
|
|
|
@ -534,7 +534,7 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms));
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms) - 1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
@ -455,7 +455,7 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms));
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms) - 1);
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
|
|
|
@ -523,7 +523,7 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms));
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms) - 1);
|
||||
break;
|
||||
|
||||
case 't':
|
||||
|
|
|
@ -191,7 +191,7 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms));
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms) - 1);
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
|
|
|
@ -176,7 +176,7 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
strncat(rig_conf_parms, optarg, MAXCONFLEN - strlen(rig_conf_parms));
|
||||
strncat(rig_conf_parms, optarg, MAXCONFLEN - strlen(rig_conf_parms) - 1);
|
||||
break;
|
||||
|
||||
case 'M':
|
||||
|
@ -221,7 +221,7 @@ int main(int argc, char *argv[])
|
|||
strcat(rot_conf_parms, ",");
|
||||
}
|
||||
|
||||
strncat(rot_conf_parms, optarg, MAXCONFLEN - strlen(rot_conf_parms));
|
||||
strncat(rot_conf_parms, optarg, MAXCONFLEN - strlen(rot_conf_parms) - 1);
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
|
|
|
@ -166,7 +166,7 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms));
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms) - 1);
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
|
|
|
@ -231,7 +231,7 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms));
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms) - 1);
|
||||
break;
|
||||
|
||||
case 't':
|
||||
|
|
|
@ -1489,7 +1489,8 @@ int rotctl_parse(ROT *my_rot, FILE *fin, FILE *fout, const char *argv[],
|
|||
{
|
||||
if (cmd_entry->name != NULL)
|
||||
{
|
||||
fprintf(fout, "%s: error = %s\n", cmd_entry->name, rigerror(retcode));
|
||||
//fprintf(fout, "%s: error = %s\n", cmd_entry->name, rigerror(retcode));
|
||||
fprintf(fout, "error = %s\n", rigerror(retcode));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -259,7 +259,7 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms));
|
||||
strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms) - 1);
|
||||
break;
|
||||
|
||||
case 't':
|
||||
|
|
Ładowanie…
Reference in New Issue