kopia lustrzana https://github.com/Hamlib/Hamlib
- Cast unsigned char to char in order to avoid compiler warnings.
- Ensure that all variables have a value before they are used (tentec.c). git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2123 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.2.6rc1
rodzic
471c50351b
commit
eba1db1658
|
@ -2,7 +2,7 @@
|
||||||
* Hamlib TenTenc backend - TT-538 description
|
* Hamlib TenTenc backend - TT-538 description
|
||||||
* Copyright (c) 2003-2005 by Stephane Fillod
|
* Copyright (c) 2003-2005 by Stephane Fillod
|
||||||
*
|
*
|
||||||
* $Id: jupiter.c,v 1.3 2005-02-26 22:29:52 fillods Exp $
|
* $Id: jupiter.c,v 1.4 2006-10-07 17:38:05 csete 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
|
||||||
|
@ -98,7 +98,7 @@ const struct rig_caps tt538_caps = {
|
||||||
.rig_model = RIG_MODEL_TT538,
|
.rig_model = RIG_MODEL_TT538,
|
||||||
.model_name = "TT-538 Jupiter",
|
.model_name = "TT-538 Jupiter",
|
||||||
.mfg_name = "Ten-Tec",
|
.mfg_name = "Ten-Tec",
|
||||||
.version = "0.2",
|
.version = "0.3",
|
||||||
.copyright = "LGPL",
|
.copyright = "LGPL",
|
||||||
.status = RIG_STATUS_ALPHA,
|
.status = RIG_STATUS_ALPHA,
|
||||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||||
|
@ -331,9 +331,9 @@ int tt538_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) {
|
||||||
int cmd_len, resp_len, retval;
|
int cmd_len, resp_len, retval;
|
||||||
unsigned char cmdbuf[16], respbuf[32];
|
unsigned char cmdbuf[16], respbuf[32];
|
||||||
|
|
||||||
cmd_len = sprintf(cmdbuf, "?%c" EOM, which_vfo(rig, vfo));
|
cmd_len = sprintf((char *) cmdbuf, "?%c" EOM, which_vfo(rig, vfo));
|
||||||
resp_len = 32;
|
resp_len = 32;
|
||||||
retval = tt538_transaction (rig, cmdbuf, cmd_len, respbuf, &resp_len);
|
retval = tt538_transaction (rig, (char *) cmdbuf, cmd_len, (char *) respbuf, &resp_len);
|
||||||
|
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -376,11 +376,11 @@ int tt538_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||||
bytes[1] = ((int) freq >> 8) & 0xff;
|
bytes[1] = ((int) freq >> 8) & 0xff;
|
||||||
bytes[0] = (int) freq & 0xff;
|
bytes[0] = (int) freq & 0xff;
|
||||||
|
|
||||||
cmd_len = sprintf(cmdbuf, "*%c%c%c%c%c" EOM,
|
cmd_len = sprintf((char *) cmdbuf, "*%c%c%c%c%c" EOM,
|
||||||
which_vfo(rig, vfo),
|
which_vfo(rig, vfo),
|
||||||
bytes[3], bytes[2], bytes[1], bytes[0]);
|
bytes[3], bytes[2], bytes[1], bytes[0]);
|
||||||
|
|
||||||
return tt538_transaction(rig, cmdbuf, cmd_len, NULL, NULL);
|
return tt538_transaction(rig, (char *) cmdbuf, cmd_len, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -394,9 +394,9 @@ int tt538_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||||
char ttmode;
|
char ttmode;
|
||||||
|
|
||||||
/* Query mode */
|
/* Query mode */
|
||||||
cmd_len = sprintf(cmdbuf, "?M" EOM);
|
cmd_len = sprintf((char *) cmdbuf, "?M" EOM);
|
||||||
resp_len = 32;
|
resp_len = 32;
|
||||||
retval = tt538_transaction (rig, cmdbuf, cmd_len, respbuf, &resp_len);
|
retval = tt538_transaction (rig, (char *) cmdbuf, cmd_len, (char *) respbuf, &resp_len);
|
||||||
|
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -434,9 +434,9 @@ int tt538_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Query passband width (filter) */
|
/* Query passband width (filter) */
|
||||||
cmd_len = sprintf(cmdbuf, "?W" EOM);
|
cmd_len = sprintf((char *) cmdbuf, "?W" EOM);
|
||||||
resp_len = 32;
|
resp_len = 32;
|
||||||
retval = tt538_transaction (rig, cmdbuf, cmd_len, respbuf, &resp_len);
|
retval = tt538_transaction (rig, (char *) cmdbuf, cmd_len, (char *) respbuf, &resp_len);
|
||||||
|
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -515,9 +515,9 @@ int tt538_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||||
struct tt538_priv_data *priv = (struct tt538_priv_data *) rig->state.priv;
|
struct tt538_priv_data *priv = (struct tt538_priv_data *) rig->state.priv;
|
||||||
|
|
||||||
/* Query mode for both VFOs. */
|
/* Query mode for both VFOs. */
|
||||||
cmd_len = sprintf(cmdbuf, "?M" EOM);
|
cmd_len = sprintf((char *) cmdbuf, "?M" EOM);
|
||||||
resp_len = 32;
|
resp_len = 32;
|
||||||
retval = tt538_transaction (rig, cmdbuf, cmd_len, respbuf, &resp_len);
|
retval = tt538_transaction (rig, (char *) cmdbuf, cmd_len, (char *) respbuf, &resp_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
if (respbuf[0] != 'M' || resp_len != 4) {
|
if (respbuf[0] != 'M' || resp_len != 4) {
|
||||||
|
@ -543,10 +543,10 @@ int tt538_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||||
vfo = priv->vfo_curr;
|
vfo = priv->vfo_curr;
|
||||||
switch (vfo) {
|
switch (vfo) {
|
||||||
case RIG_VFO_A:
|
case RIG_VFO_A:
|
||||||
cmd_len = sprintf(cmdbuf, "*M%c%c" EOM, ttmode, respbuf[2]);
|
cmd_len = sprintf((char *) cmdbuf, "*M%c%c" EOM, ttmode, respbuf[2]);
|
||||||
break;
|
break;
|
||||||
case RIG_VFO_B:
|
case RIG_VFO_B:
|
||||||
cmd_len = sprintf(cmdbuf, "*M%c%c" EOM, respbuf[1], ttmode);
|
cmd_len = sprintf((char *) cmdbuf, "*M%c%c" EOM, respbuf[1], ttmode);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
rig_debug(RIG_DEBUG_ERR,"%s: unsupported VFO %s\n",
|
rig_debug(RIG_DEBUG_ERR,"%s: unsupported VFO %s\n",
|
||||||
|
@ -554,7 +554,7 @@ int tt538_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||||
return -RIG_EINVAL;
|
return -RIG_EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = tt538_transaction (rig, cmdbuf, cmd_len, NULL, NULL);
|
retval = tt538_transaction (rig, (char *) cmdbuf, cmd_len, NULL, NULL);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
@ -565,8 +565,8 @@ int tt538_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||||
else
|
else
|
||||||
width = tt538_filter_number((int) width);
|
width = tt538_filter_number((int) width);
|
||||||
|
|
||||||
cmd_len = sprintf(cmdbuf, "*W%c" EOM, (unsigned char) width);
|
cmd_len = sprintf((char *) cmdbuf, "*W%c" EOM, (unsigned char) width);
|
||||||
return tt538_transaction (rig, cmdbuf, cmd_len, NULL, NULL);
|
return tt538_transaction (rig, (char *) cmdbuf, cmd_len, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -588,7 +588,7 @@ int tt538_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||||
case RIG_LEVEL_SWR:
|
case RIG_LEVEL_SWR:
|
||||||
/* Get forward power. */
|
/* Get forward power. */
|
||||||
lvl_len = 32;
|
lvl_len = 32;
|
||||||
retval = tt538_transaction (rig, "?F" EOM, 3, lvlbuf, &lvl_len);
|
retval = tt538_transaction (rig, "?F" EOM, 3, (char *) lvlbuf, &lvl_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
if (lvlbuf[0] != 'F' || lvl_len != 3) {
|
if (lvlbuf[0] != 'F' || lvl_len != 3) {
|
||||||
|
@ -600,7 +600,7 @@ int tt538_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||||
|
|
||||||
/* Get reflected power. */
|
/* Get reflected power. */
|
||||||
lvl_len = 32;
|
lvl_len = 32;
|
||||||
retval = tt538_transaction (rig, "?R" EOM, 3, lvlbuf, &lvl_len);
|
retval = tt538_transaction (rig, "?R" EOM, 3, (char *) lvlbuf, &lvl_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
if (lvlbuf[0] != 'R' || lvl_len != 3) {
|
if (lvlbuf[0] != 'R' || lvl_len != 3) {
|
||||||
|
@ -614,7 +614,7 @@ int tt538_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RIG_LEVEL_RAWSTR:
|
case RIG_LEVEL_RAWSTR:
|
||||||
retval = tt538_transaction (rig, "?S" EOM, 3, lvlbuf, &lvl_len);
|
retval = tt538_transaction (rig, "?S" EOM, 3, (char *) lvlbuf, &lvl_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
@ -625,7 +625,7 @@ int tt538_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
sprintf(sunits, "%c%c.%c%c",
|
sprintf((char *) sunits, "%c%c.%c%c",
|
||||||
lvlbuf[1], lvlbuf[2], lvlbuf[3], lvlbuf[4]);
|
lvlbuf[1], lvlbuf[2], lvlbuf[3], lvlbuf[4]);
|
||||||
sscanf(sunits, "%f", &sstr);
|
sscanf(sunits, "%f", &sstr);
|
||||||
val->f = sstr;
|
val->f = sstr;
|
||||||
|
@ -643,7 +643,7 @@ printf("%f\n", val->f);
|
||||||
|
|
||||||
/* Get forward power in volts. */
|
/* Get forward power in volts. */
|
||||||
lvl_len = 32;
|
lvl_len = 32;
|
||||||
retval = tt538_transaction (rig, "?P" EOM, 3, lvlbuf, &lvl_len);
|
retval = tt538_transaction (rig, "?P" EOM, 3, (char *) lvlbuf, &lvl_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
if (lvlbuf[0] != 'P' || lvl_len != 4) {
|
if (lvlbuf[0] != 'P' || lvl_len != 4) {
|
||||||
|
@ -658,9 +658,9 @@ printf("%f\n", val->f);
|
||||||
case RIG_LEVEL_AGC:
|
case RIG_LEVEL_AGC:
|
||||||
|
|
||||||
/* Read rig's AGC level setting. */
|
/* Read rig's AGC level setting. */
|
||||||
cmd_len = sprintf(cmdbuf, "?G" EOM);
|
cmd_len = sprintf((char *) cmdbuf, "?G" EOM);
|
||||||
lvl_len = 32;
|
lvl_len = 32;
|
||||||
retval = tt538_transaction (rig, cmdbuf, cmd_len, lvlbuf, &lvl_len);
|
retval = tt538_transaction (rig, (char *) cmdbuf, cmd_len, (char *) lvlbuf, &lvl_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
if (lvlbuf[0] != 'G' || lvl_len != 3) {
|
if (lvlbuf[0] != 'G' || lvl_len != 3) {
|
||||||
|
@ -680,9 +680,9 @@ printf("%f\n", val->f);
|
||||||
case RIG_LEVEL_AF:
|
case RIG_LEVEL_AF:
|
||||||
|
|
||||||
/* Volume returned as single byte. */
|
/* Volume returned as single byte. */
|
||||||
cmd_len = sprintf(cmdbuf, "?U" EOM);
|
cmd_len = sprintf((char *) cmdbuf, "?U" EOM);
|
||||||
lvl_len = 32;
|
lvl_len = 32;
|
||||||
retval = tt538_transaction (rig, cmdbuf, cmd_len, lvlbuf, &lvl_len);
|
retval = tt538_transaction (rig, (char *) cmdbuf, cmd_len, (char *) lvlbuf, &lvl_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
@ -698,10 +698,10 @@ printf("%f\n", val->f);
|
||||||
case RIG_LEVEL_IF:
|
case RIG_LEVEL_IF:
|
||||||
#if 0
|
#if 0
|
||||||
NO IF MONITOR??
|
NO IF MONITOR??
|
||||||
cmd_len = sprintf(cmdbuf, "?R%cP" EOM,
|
cmd_len = sprintf((char *) cmdbuf, "?R%cP" EOM,
|
||||||
which_receiver(rig, vfo));
|
which_receiver(rig, vfo));
|
||||||
|
|
||||||
retval = tt538_transaction (rig, cmdbuf, cmd_len, lvlbuf, &lvl_len);
|
retval = tt538_transaction (rig, (char *) cmdbuf, cmd_len, (char *) lvlbuf, &lvl_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
@ -718,9 +718,9 @@ NO IF MONITOR??
|
||||||
|
|
||||||
case RIG_LEVEL_RF:
|
case RIG_LEVEL_RF:
|
||||||
|
|
||||||
cmd_len = sprintf(cmdbuf, "?I" EOM);
|
cmd_len = sprintf((char *) cmdbuf, "?I" EOM);
|
||||||
lvl_len = 32;
|
lvl_len = 32;
|
||||||
retval = tt538_transaction (rig, cmdbuf, cmd_len, lvlbuf, &lvl_len);
|
retval = tt538_transaction (rig, (char *) cmdbuf, cmd_len, (char *) lvlbuf, &lvl_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
@ -735,9 +735,9 @@ NO IF MONITOR??
|
||||||
|
|
||||||
case RIG_LEVEL_ATT:
|
case RIG_LEVEL_ATT:
|
||||||
|
|
||||||
cmd_len = sprintf(cmdbuf, "?J" EOM);
|
cmd_len = sprintf((char *) cmdbuf, "?J" EOM);
|
||||||
lvl_len = 32;
|
lvl_len = 32;
|
||||||
retval = tt538_transaction (rig, cmdbuf, cmd_len, lvlbuf, &lvl_len);
|
retval = tt538_transaction (rig, (char *) cmdbuf, cmd_len, (char *) lvlbuf, &lvl_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
if (lvlbuf[0] != 'J' || lvl_len != 3) {
|
if (lvlbuf[0] != 'J' || lvl_len != 3) {
|
||||||
|
@ -755,9 +755,9 @@ NO IF MONITOR??
|
||||||
|
|
||||||
case RIG_LEVEL_SQL:
|
case RIG_LEVEL_SQL:
|
||||||
|
|
||||||
cmd_len = sprintf(cmdbuf, "?H" EOM);
|
cmd_len = sprintf((char *) cmdbuf, "?H" EOM);
|
||||||
lvl_len = 32;
|
lvl_len = 32;
|
||||||
retval = tt538_transaction (rig, cmdbuf, cmd_len, lvlbuf, &lvl_len);
|
retval = tt538_transaction (rig, (char *) cmdbuf, cmd_len, (char *) lvlbuf, &lvl_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
if (lvlbuf[0] != 'H' || lvl_len != 3) {
|
if (lvlbuf[0] != 'H' || lvl_len != 3) {
|
||||||
|
@ -771,7 +771,7 @@ NO IF MONITOR??
|
||||||
case RIG_LEVEL_MICGAIN:
|
case RIG_LEVEL_MICGAIN:
|
||||||
|
|
||||||
lvl_len = 3;
|
lvl_len = 3;
|
||||||
retval = tt538_transaction (rig, "?O" EOM, 3, lvlbuf, &lvl_len);
|
retval = tt538_transaction (rig, "?O" EOM, 3, (char *) lvlbuf, &lvl_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
@ -787,7 +787,7 @@ NO IF MONITOR??
|
||||||
case RIG_LEVEL_COMP:
|
case RIG_LEVEL_COMP:
|
||||||
/* Query S units signal level. */
|
/* Query S units signal level. */
|
||||||
lvl_len = 32;
|
lvl_len = 32;
|
||||||
retval = tt538_transaction (rig, "?S" EOM, 3, lvlbuf, &lvl_len);
|
retval = tt538_transaction (rig, "?S" EOM, 3, (char *) lvlbuf, &lvl_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
@ -797,7 +797,7 @@ NO IF MONITOR??
|
||||||
return -RIG_EPROTO;
|
return -RIG_EPROTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(sunits, "%c%c.%c%c",
|
sprintf((char *) sunits, "%c%c.%c%c",
|
||||||
lvlbuf[1], lvlbuf[2], lvlbuf[3], lvlbuf[4]);
|
lvlbuf[1], lvlbuf[2], lvlbuf[3], lvlbuf[4]);
|
||||||
sscanf(sunits, "%f", &sstr);
|
sscanf(sunits, "%f", &sstr);
|
||||||
printf("%f\n", sstr);
|
printf("%f\n", sstr);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Hamlib Tentec backend - main file
|
* Hamlib Tentec backend - main file
|
||||||
* Copyright (c) 2001-2005 by Stephane Fillod
|
* Copyright (c) 2001-2005 by Stephane Fillod
|
||||||
*
|
*
|
||||||
* $Id: tentec.c,v 1.16 2006-01-09 21:14:40 fillods Exp $
|
* $Id: tentec.c,v 1.17 2006-10-07 17:38:05 csete 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
|
||||||
|
@ -339,7 +339,7 @@ int tentec_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||||
{
|
{
|
||||||
struct tentec_priv_data *priv = (struct tentec_priv_data *)rig->state.priv;
|
struct tentec_priv_data *priv = (struct tentec_priv_data *)rig->state.priv;
|
||||||
struct rig_state *rs = &rig->state;
|
struct rig_state *rs = &rig->state;
|
||||||
int cmd_len, retval;
|
int cmd_len, retval=RIG_OK;
|
||||||
char cmdbuf[32];
|
char cmdbuf[32];
|
||||||
|
|
||||||
/* Optimize:
|
/* Optimize:
|
||||||
|
@ -405,7 +405,7 @@ int tentec_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||||
case RIG_LEVEL_RAWSTR:
|
case RIG_LEVEL_RAWSTR:
|
||||||
/* read A/D converted value */
|
/* read A/D converted value */
|
||||||
lvl_len = 4;
|
lvl_len = 4;
|
||||||
retval = tentec_transaction (rig, "X" EOM, 2, lvlbuf, &lvl_len);
|
retval = tentec_transaction (rig, "X" EOM, 2, (char *) lvlbuf, &lvl_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Hamlib Tentec backend - Argonaut, Jupiter, RX-350
|
* Hamlib Tentec backend - Argonaut, Jupiter, RX-350
|
||||||
* Copyright (c) 2001-2004 by Stephane Fillod
|
* Copyright (c) 2001-2004 by Stephane Fillod
|
||||||
*
|
*
|
||||||
* $Id: tentec2.c,v 1.5 2006-09-22 18:27:18 n0nb Exp $
|
* $Id: tentec2.c,v 1.6 2006-10-07 17:38:05 csete 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
|
||||||
|
@ -226,7 +226,7 @@ int tentec2_get_vfo(RIG *rig, vfo_t *vfo)
|
||||||
unsigned char vfobuf[16] = "?E\r";
|
unsigned char vfobuf[16] = "?E\r";
|
||||||
|
|
||||||
ret_len = 7;
|
ret_len = 7;
|
||||||
retval = tentec_transaction (rig, vfobuf, 3, vfobuf, &ret_len);
|
retval = tentec_transaction (rig, (char *) vfobuf, 3, (char *) vfobuf, &ret_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
@ -334,10 +334,10 @@ int tentec2_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||||
|
|
||||||
ttmode_a = ttmode_b = ttmode;
|
ttmode_a = ttmode_b = ttmode;
|
||||||
|
|
||||||
strcpy(mdbuf, "*M00\r" );
|
strcpy((char *) mdbuf, "*M00\r" );
|
||||||
ret_len = 3;
|
ret_len = 3;
|
||||||
mdbuf[2] = ttmode_a; mdbuf[3] = ttmode_b;
|
mdbuf[2] = ttmode_a; mdbuf[3] = ttmode_b;
|
||||||
retval = tentec_transaction (rig, mdbuf, 5, mdbuf, &ret_len);
|
retval = tentec_transaction (rig, (char *) mdbuf, 5, (char *) mdbuf, &ret_len);
|
||||||
|
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -359,10 +359,10 @@ int tentec2_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||||
else
|
else
|
||||||
ttfilter = (width / 100) + 6;
|
ttfilter = (width / 100) + 6;
|
||||||
|
|
||||||
strcpy (mdbuf, "*Wn\r");
|
strcpy ((char *) mdbuf, "*Wn\r");
|
||||||
mdbuf[2] = ttfilter;
|
mdbuf[2] = ttfilter;
|
||||||
ret_len = 3;
|
ret_len = 3;
|
||||||
retval = tentec_transaction (rig, mdbuf, 5, mdbuf, &ret_len);
|
retval = tentec_transaction (rig, (char *) mdbuf, 5, (char *) mdbuf, &ret_len);
|
||||||
|
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
|
@ -1305,23 +1305,23 @@ tt550_set_func (RIG * rig, vfo_t vfo, setting_t func, int status)
|
||||||
{
|
{
|
||||||
case RIG_FUNC_VOX:
|
case RIG_FUNC_VOX:
|
||||||
fct_len =
|
fct_len =
|
||||||
sprintf (fctbuf, "U%c" EOM, status == 0 ? '0' : '1');
|
sprintf ((char *) fctbuf, "U%c" EOM, status == 0 ? '0' : '1');
|
||||||
priv->vox = status;
|
priv->vox = status;
|
||||||
return write_block (&rs->rigport, fctbuf, fct_len);
|
return write_block (&rs->rigport, (char *) fctbuf, fct_len);
|
||||||
|
|
||||||
case RIG_FUNC_NR:
|
case RIG_FUNC_NR:
|
||||||
fct_len =
|
fct_len =
|
||||||
sprintf (fctbuf, "K%c%c" EOM, status == 0 ? '0' : '1',
|
sprintf ((char *) fctbuf, "K%c%c" EOM, status == 0 ? '0' : '1',
|
||||||
priv->anf == 0 ? '0' : '1');
|
priv->anf == 0 ? '0' : '1');
|
||||||
priv->en_nr = status;
|
priv->en_nr = status;
|
||||||
return write_block (&rs->rigport, fctbuf, fct_len);
|
return write_block (&rs->rigport, (char *) fctbuf, fct_len);
|
||||||
|
|
||||||
case RIG_FUNC_ANF:
|
case RIG_FUNC_ANF:
|
||||||
fct_len =
|
fct_len =
|
||||||
sprintf (fctbuf, "K%c%c" EOM, priv->en_nr == 0 ? '0' : '1',
|
sprintf ((char *) fctbuf, "K%c%c" EOM, priv->en_nr == 0 ? '0' : '1',
|
||||||
status == 0 ? '0' : '1');
|
status == 0 ? '0' : '1');
|
||||||
priv->anf = status;
|
priv->anf = status;
|
||||||
return write_block (&rs->rigport, fctbuf, fct_len);
|
return write_block (&rs->rigport, (char *) fctbuf, fct_len);
|
||||||
|
|
||||||
|
|
||||||
case RIG_FUNC_TUNER:
|
case RIG_FUNC_TUNER:
|
||||||
|
@ -1531,7 +1531,7 @@ tt550_decode_event (RIG * rig)
|
||||||
priv = (struct tt550_priv_data *) rs->priv;
|
priv = (struct tt550_priv_data *) rs->priv;
|
||||||
|
|
||||||
|
|
||||||
data_len = read_string (&rs->rigport, buf, MAXFRAMELEN, "\n\r", 2);
|
data_len = read_string (&rs->rigport, (char *) buf, MAXFRAMELEN, "\n\r", 2);
|
||||||
|
|
||||||
|
|
||||||
if (data_len == -RIG_ETIMEOUT) {
|
if (data_len == -RIG_ETIMEOUT) {
|
||||||
|
|
Ładowanie…
Reference in New Issue