Fix build warnings caused by changes to I/O function signatures

pull/892/head
Mikael Nousiainen 2021-12-18 23:49:45 +02:00
rodzic 1d067d6a43
commit c764336e73
106 zmienionych plików z 613 dodań i 626 usunięć

Wyświetl plik

@ -122,25 +122,25 @@ int kpa_transaction(AMP *amp, const char *cmd, char *response, int response_len)
{
char c = ';';
rig_debug(RIG_DEBUG_VERBOSE, "%s waiting for ;\n", __func__);
err = write_block(&rs->ampport, &c, 1);
err = write_block(&rs->ampport, (unsigned char *) &c, 1);
if (err != RIG_OK) { return err; }
len = read_string(&rs->ampport, response, response_len, ";", 1, 0, 1);
len = read_string(&rs->ampport, (unsigned char *) response, response_len, ";", 1, 0, 1);
if (len < 0) { return len; }
}
while (--loop > 0 && (len != 1 || response[0] != ';'));
// Now send our command
err = write_block(&rs->ampport, cmd, strlen(cmd));
err = write_block(&rs->ampport, (unsigned char *) cmd, strlen(cmd));
if (err != RIG_OK) { return err; }
if (response) // if response expected get it
{
response[0] = 0;
len = read_string(&rs->ampport, response, response_len, ";", 1, 0, 1);
len = read_string(&rs->ampport, (unsigned char *) response, response_len, ";", 1, 0, 1);
if (len < 0)
{
@ -162,11 +162,11 @@ int kpa_transaction(AMP *amp, const char *cmd, char *response, int response_len)
{
char c = ';';
rig_debug(RIG_DEBUG_VERBOSE, "%s waiting for ;\n", __func__);
err = write_block(&rs->ampport, &c, 1);
err = write_block(&rs->ampport, (unsigned char *) &c, 1);
if (err != RIG_OK) { return err; }
len = read_string(&rs->ampport, responsebuf, KPABUFSZ, ";", 1, 0, 1);
len = read_string(&rs->ampport, (unsigned char *) responsebuf, KPABUFSZ, ";", 1, 0, 1);
if (len < 0) { return len; }
}
@ -369,7 +369,7 @@ int kpa_get_level(AMP *amp, setting_t level, value_t *val)
//
do
{
retval = read_string(&rs->ampport, responsebuf, sizeof(responsebuf), ";", 1, 0,
retval = read_string(&rs->ampport, (unsigned char *) responsebuf, sizeof(responsebuf), ";", 1, 0,
1);
if (retval != RIG_OK) { return retval; }

Wyświetl plik

@ -1266,7 +1266,7 @@ int adat_send(RIG *pRig,
rig_flush(&pRigState->rigport);
nRC = write_block(&pRigState->rigport, pcData, strlen(pcData));
nRC = write_block(&pRigState->rigport, (unsigned char *) pcData, strlen(pcData));
rig_debug(RIG_DEBUG_TRACE,
"*** ADAT: %d %s (%s:%d): EXIT. Return Code = %d\n",
@ -1294,7 +1294,8 @@ int adat_receive(RIG *pRig,
"*** ADAT: %d %s (%s:%d): ENTRY. Params: pRig = %p\n",
gFnLevel, __func__, __FILE__, __LINE__, pRig);
nRC = read_string(&pRigState->rigport, pcData, ADAT_RESPSZ, ADAT_EOL, 1, 0, 1);
nRC = read_string(&pRigState->rigport, (unsigned char *) pcData, ADAT_RESPSZ,
ADAT_EOL, 1, 0, 1);
if (nRC > 0)
{
@ -3724,9 +3725,10 @@ DECLARE_PROBERIG_BACKEND(adat)
memset(acBuf, 0, ADAT_RESPSZ + 1);
nRC = write_block(port,
ADAT_CMD_DEF_STRING_GET_ID_CODE,
(unsigned char *)ADAT_CMD_DEF_STRING_GET_ID_CODE,
strlen(ADAT_CMD_DEF_STRING_GET_ID_CODE));
nRead = read_string(port, acBuf, ADAT_RESPSZ, ADAT_EOM, 1, 0, 1);
nRead = read_string(port, (unsigned char *) acBuf, ADAT_RESPSZ,
ADAT_EOM, 1, 0, 1);
close(port->fd);
if ((nRC != RIG_OK || nRead < 0))

Wyświetl plik

@ -310,7 +310,7 @@ int dx77_transaction(RIG *rig,
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -321,7 +321,8 @@ int dx77_transaction(RIG *rig,
* Transceiver sends an echo of cmd followed by a CR/LF
* TODO: check whether cmd and echobuf match (optional)
*/
retval = read_string(&rs->rigport, echobuf, BUFSZ, LF, strlen(LF), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) echobuf, BUFSZ,
LF, strlen(LF), 0, 1);
if (retval < 0)
{
@ -337,7 +338,8 @@ int dx77_transaction(RIG *rig,
/* no data expected, check for OK returned */
if (data == NULL)
{
retval = read_string(&rs->rigport, echobuf, BUFSZ, LF, strlen(LF), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) echobuf, BUFSZ,
LF, strlen(LF), 0, 1);
if (retval < 0)
{
@ -358,7 +360,8 @@ int dx77_transaction(RIG *rig,
}
}
retval = read_string(&rs->rigport, data, BUFSZ, LF, strlen(LF), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, BUFSZ,
LF, strlen(LF), 0, 1);
if (retval < 0)
{

Wyświetl plik

@ -253,7 +253,7 @@ int dxsr8_transaction(RIG *rig,
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -264,7 +264,8 @@ int dxsr8_transaction(RIG *rig,
* Transceiver sends an echo of cmd followed by a CR/LF
* TODO: check whether cmd and echobuf match (optional)
*/
retval = read_string(&rs->rigport, replybuf, BUFSZ, LF, strlen(LF), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) replybuf, BUFSZ,
LF, strlen(LF), 0, 1);
if (retval < 0)
{
@ -272,7 +273,8 @@ int dxsr8_transaction(RIG *rig,
}
retval = read_string(&rs->rigport, replybuf, BUFSZ, LF, strlen(LF), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) replybuf, BUFSZ,
LF, strlen(LF), 0, 1);
if (retval < 0)
{

Wyświetl plik

@ -82,7 +82,7 @@ static int aor_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -102,7 +102,8 @@ static int aor_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
/*
* Do wait for a reply
*/
retval = read_string(&rs->rigport, data, BUFSZ, EOM, strlen(EOM), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, BUFSZ, EOM,
strlen(EOM), 0, 1);
if (retval < 0)
{
@ -130,7 +131,7 @@ static int aor_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
if (retval >= 1 && data[0] == '?')
{
/* command failed? resync with radio */
write_block(&rs->rigport, EOM, 1);
write_block(&rs->rigport, (unsigned char *) EOM, 1);
return -RIG_EPROTO;
}
@ -150,7 +151,7 @@ int aor_close(RIG *rig)
* since no reply is to be expected.
*/
return write_block(&rig->state.rigport, "EX" EOM, 3);
return write_block(&rig->state.rigport, (unsigned char *) "EX" EOM, 3);
}
static int format_freq(char *buf, freq_t freq)
@ -1428,8 +1429,8 @@ int aor_get_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t arg)
/*
* get next line
*/
retval = read_string(&rig->state.rigport, chanbuf, BUFSZ, EOM, strlen(EOM), 0,
1);
retval = read_string(&rig->state.rigport, (unsigned char *) chanbuf, BUFSZ,
EOM, strlen(EOM), 0,1);
if (retval < 0)
{

Wyświetl plik

@ -198,7 +198,7 @@ static int ar3k_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -211,7 +211,8 @@ static int ar3k_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
return RIG_OK;
}
retval = read_string(&rs->rigport, data, BUFSZ, EOM, strlen(EOM), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, BUFSZ,
EOM, strlen(EOM), 0, 1);
if (retval == -RIG_ETIMEOUT)
{

Wyświetl plik

@ -236,7 +236,7 @@ static int ar3030_transaction(RIG *rig, const char *cmd, int cmd_len,
do
{
retval = write_block(&rs->rigport, cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -247,7 +247,8 @@ static int ar3030_transaction(RIG *rig, const char *cmd, int cmd_len,
if (data)
{
/* expecting 0x0d0x0a on all commands so wait for the 0x0a */
retval = read_string(&rs->rigport, data, BUFSZ, "\x0a", 1, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, BUFSZ,
"\x0a", 1, 0, 1);
if (retval == -RIG_ETIMEOUT)
{

Wyświetl plik

@ -73,7 +73,7 @@
static int rxr_writeByte(RIG *rig, unsigned char c)
{
return write_block(&rig->state.rigport, (char *) &c, 1);
return write_block(&rig->state.rigport, &c, 1);
}
@ -82,14 +82,14 @@ static int rxr_readByte(RIG *rig)
unsigned char response[1];
unsigned char buf[] = {0x71}; // Read command
int retval;
retval = write_block(&rig->state.rigport, (char *) buf, 1);
retval = write_block(&rig->state.rigport, buf, 1);
if (retval != RIG_OK)
{
return retval;
}
retval = read_block(&rig->state.rigport, (char *) response, 1);
retval = read_block(&rig->state.rigport, response, 1);
if (retval != RIG_OK)
{
@ -278,14 +278,14 @@ static int Execute_Routine_14(RIG *rig)
unsigned char response[1];
unsigned char buf[] = {0x2e}; // Read command
int retval;
retval = write_block(&rig->state.rigport, (char *) buf, 1);
retval = write_block(&rig->state.rigport, buf, 1);
if (retval != RIG_OK)
{
return retval;
}
retval = read_block(&rig->state.rigport, (char *) response, 1);
retval = read_block(&rig->state.rigport, response, 1);
if (retval != RIG_OK)
{

Wyświetl plik

@ -404,7 +404,7 @@ int execRoutine(RIG *rig, enum ROUTINE_e rtn)
assert(NULL != rig);
if (0 == write_block(&rig->state.rigport, (char *) &v, 1))
if (0 == write_block(&rig->state.rigport, &v, 1))
{
rc = RIG_OK;
@ -441,7 +441,7 @@ static int setAddr(RIG *rig, enum PAGE_e page, unsigned int addr)
{
v = PGE(page);
if (0 == write_block(&rig->state.rigport, (char *) &v, 1))
if (0 == write_block(&rig->state.rigport, &v, 1))
{
curPage = page;
rc = RIG_OK;
@ -458,7 +458,7 @@ static int setAddr(RIG *rig, enum PAGE_e page, unsigned int addr)
{
v = SRH((0x0f0 & addr) >> 4);
rc = write_block(&rig->state.rigport, (char *) &v, 1);
rc = write_block(&rig->state.rigport, &v, 1);
if (rc != RIG_OK)
{
@ -467,13 +467,13 @@ static int setAddr(RIG *rig, enum PAGE_e page, unsigned int addr)
v = ADR((0x00f & addr));
if (0 == write_block(&rig->state.rigport, (char *) &v, 1))
if (0 == write_block(&rig->state.rigport, &v, 1))
{
if (0xff < addr)
{
v = ADH((0xf00 & addr) >> 8);
if (0 == write_block(&rig->state.rigport, (char *) &v, 1))
if (0 == write_block(&rig->state.rigport, &v, 1))
{
curAddr = addr;
rc = RIG_OK;
@ -537,9 +537,9 @@ int writeByte(RIG *rig, enum PAGE_e page, unsigned int addr, unsigned char x)
{
rc = -RIG_EIO;
if (0 == write_block(&rig->state.rigport, (char *) &hi, 1))
if (0 == write_block(&rig->state.rigport, &hi, 1))
{
if (0 == write_block(&rig->state.rigport, (char *) &lo, 1))
if (0 == write_block(&rig->state.rigport, &lo, 1))
{
rc = RIG_OK;
curAddr++;
@ -679,9 +679,9 @@ int readByte(RIG *rig, enum PAGE_e page, unsigned int addr, unsigned char *x)
{
rc = -RIG_EIO;
if (0 == write_block(&rig->state.rigport, (char *) &v, 1))
if (0 == write_block(&rig->state.rigport, &v, 1))
{
if (1 == read_block(&rig->state.rigport, (char *) x, 1))
if (1 == read_block(&rig->state.rigport, x, 1))
{
curAddr++;
rc = RIG_OK;
@ -842,7 +842,7 @@ int readSignal(RIG *rig, unsigned char *x)
if (RIG_OK == rc)
{
if (1 == read_block(&rig->state.rigport, (char *) x, 1))
if (1 == read_block(&rig->state.rigport, x, 1))
{
rc = RIG_OK;
@ -897,7 +897,7 @@ int lockRx(RIG *rig, enum LOCK_LVL_e level)
{
v = LOC(level);
if (0 == write_block(&rig->state.rigport, (char *) &v, 1))
if (0 == write_block(&rig->state.rigport, &v, 1))
{
rc = RIG_OK;

Wyświetl plik

@ -287,7 +287,7 @@ static int sr2200_transaction(RIG *rig, const char *cmd, int cmd_len,
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -307,7 +307,7 @@ static int sr2200_transaction(RIG *rig, const char *cmd, int cmd_len,
/*
* Do wait for a reply
*/
retval = read_string(&rs->rigport, data, BUFSZ, EOM, strlen(EOM), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, BUFSZ, EOM, strlen(EOM), 0, 1);
if (retval < 0)
{
@ -328,7 +328,7 @@ static int sr2200_transaction(RIG *rig, const char *cmd, int cmd_len,
if (data[0] == '?')
{
/* command failed? resync with radio */
write_block(&rs->rigport, EOM, 1);
write_block(&rs->rigport, (unsigned char *) EOM, 1);
return -RIG_EPROTO;
}

Wyświetl plik

@ -233,7 +233,7 @@ int barrett_transaction(RIG *rig, char *cmd, int expected, char **result)
cmd_len = snprintf(cmd_buf, sizeof(cmd_buf), "%s%s", cmd, EOM);
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmd_buf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd_buf, cmd_len);
if (retval < 0)
{
@ -243,7 +243,7 @@ int barrett_transaction(RIG *rig, char *cmd, int expected, char **result)
if (expected == 0)
{
// response format is 0x11,data...,0x0d,0x0a,0x13
retval = read_string(&rs->rigport, priv->ret_data, sizeof(priv->ret_data),
retval = read_string(&rs->rigport, (unsigned char *) priv->ret_data, sizeof(priv->ret_data),
"\x11", 1, 0, 1);
rig_debug(RIG_DEBUG_VERBOSE, "%s: resultlen=%d\n", __func__,
(int)strlen(priv->ret_data));
@ -255,7 +255,7 @@ int barrett_transaction(RIG *rig, char *cmd, int expected, char **result)
}
else
{
retval = read_block(&rs->rigport, priv->ret_data, expected);
retval = read_block(&rs->rigport, (unsigned char *) priv->ret_data, expected);
if (retval < 0)
{

Wyświetl plik

@ -60,15 +60,15 @@ struct dra818_priv
static int dra818_response(RIG *rig, const char *expected)
{
char response[80];
int r = read_string(&rig->state.rigport, response, sizeof(response), "\n", 1, 0,
1);
int r = read_string(&rig->state.rigport, (unsigned char *) response, sizeof(response),
"\n", 1, 0,1);
if (r != strlen(expected))
{
return -RIG_EIO;
}
if (strcmp(expected, response))
if (strcmp(expected, response) != 0)
{
rig_debug(RIG_DEBUG_VERBOSE, "dra818: response: %s\n", response);
return -RIG_ERJCTED;
@ -119,7 +119,7 @@ static int dra818_setgroup(RIG *rig)
(int)(priv->tx_freq / 1000000), (int)((priv->tx_freq % 1000000) / 100),
(int)(priv->rx_freq / 1000000), (int)((priv->rx_freq % 1000000) / 100),
subtx, priv->sql, subrx);
write_block(&rig->state.rigport, cmd, strlen(cmd));
write_block(&rig->state.rigport, (unsigned char *) cmd, strlen(cmd));
return dra818_response(rig, dra818_setgroup_res);
}
@ -129,9 +129,8 @@ static int dra818_setvolume(RIG *rig)
struct dra818_priv *priv = rig->state.priv;
char cmd[80];
sprintf(cmd, "AT+DMOSETVOLUME=%1d\r\n",
priv->vol);
write_block(&rig->state.rigport, cmd, strlen(cmd));
sprintf(cmd, "AT+DMOSETVOLUME=%1d\r\n", priv->vol);
write_block(&rig->state.rigport, (unsigned char *) cmd, strlen(cmd));
return dra818_response(rig, dra818_setvolume_res);
}
@ -192,7 +191,7 @@ int dra818_open(RIG *rig)
for (i = 0; i < 3; i++)
{
write_block(&rig->state.rigport, dra818_handshake_cmd,
write_block(&rig->state.rigport, (unsigned char *) dra818_handshake_cmd,
strlen(dra818_handshake_cmd));
r = dra818_response(rig, dra818_handshake_res);
@ -293,9 +292,10 @@ int dra818_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
sprintf(cmd, "S+%03d.%04d\r\n",
(int)(priv->rx_freq / 1000000), (int)((priv->rx_freq % 1000000) / 100));
write_block(&rig->state.rigport, cmd, strlen(cmd));
write_block(&rig->state.rigport, (unsigned char *) cmd, strlen(cmd));
r = read_string(&rig->state.rigport, response, sizeof(response), "\n", 1, 0, 1);
r = read_string(&rig->state.rigport, (unsigned char *) response, sizeof(response),
"\n", 1, 0, 1);
if (r != 5)
{

Wyświetl plik

@ -71,7 +71,7 @@ int drake_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -84,7 +84,8 @@ int drake_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
return 0;
}
retval = read_string(&rs->rigport, data, BUFSZ, LF, 1, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, BUFSZ,
LF, 1, 0, 1);
if (retval == -RIG_ETIMEOUT)
{
@ -1251,8 +1252,8 @@ DECLARE_PROBERIG_BACKEND(drake)
return RIG_MODEL_NONE;
}
retval = write_block(port, "ID" EOM, 3);
id_len = read_string(port, idbuf, BUFSZ, LF, 1, 0, 1);
retval = write_block(port, (unsigned char *) "ID" EOM, 3);
id_len = read_string(port, (unsigned char *) idbuf, BUFSZ, LF, 1, 0, 1);
close(port->fd);

Wyświetl plik

@ -455,7 +455,7 @@ static int read_transaction(RIG *rig, char *xml, int xml_len)
rig_debug(RIG_DEBUG_WARN, "%s: retry needed? retry=%d\n", __func__, retry);
}
int len = read_string(&rs->rigport, tmp_buf, sizeof(tmp_buf), delims,
int len = read_string(&rs->rigport, (unsigned char *) tmp_buf, sizeof(tmp_buf), delims,
strlen(delims), 0, 1);
rig_debug(RIG_DEBUG_TRACE, "%s: string='%s'\n", __func__, tmp_buf);
@ -540,7 +540,7 @@ static int write_transaction(RIG *rig, char *xml, int xml_len)
while (try-- >= 0 && retval != RIG_OK)
{
retval = write_block(&rs->rigport, xml, strlen(xml));
retval = write_block(&rs->rigport, (unsigned char *) xml, strlen(xml));
if (retval < 0)
{

Wyświetl plik

@ -45,14 +45,14 @@ static int netampctl_transaction(AMP *amp, char *cmd, int len, char *buf)
{
int ret;
ret = write_block(&amp->state.ampport, cmd, len);
ret = write_block(&amp->state.ampport, (unsigned char *) cmd, len);
if (ret != RIG_OK)
{
return ret;
}
ret = read_string(&amp->state.ampport, buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
ret = read_string(&amp->state.ampport, (unsigned char *) buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
if (ret < 0)
{
@ -95,7 +95,7 @@ static int netampctl_open(AMP *amp)
return -RIG_EPROTO;
}
ret = read_string(&amp->state.ampport, buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
ret = read_string(&amp->state.ampport, (unsigned char *) buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
if (ret <= 0)
{
@ -104,7 +104,7 @@ static int netampctl_open(AMP *amp)
do
{
ret = read_string(&amp->state.ampport, buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
ret = read_string(&amp->state.ampport, (unsigned char *) buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
if (ret > 0)
{
@ -127,7 +127,7 @@ static int netampctl_close(AMP *amp)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
/* clean signoff, no read back */
write_block(&amp->state.ampport, "q\n", 2);
write_block(&amp->state.ampport, (unsigned char *) "q\n", 2);
return RIG_OK;
}

Wyświetl plik

@ -72,14 +72,14 @@ static int netrigctl_transaction(RIG *rig, char *cmd, int len, char *buf)
/* flush anything in the read buffer before command is sent */
rig_flush(&rig->state.rigport);
ret = write_block(&rig->state.rigport, cmd, len);
ret = write_block(&rig->state.rigport, (unsigned char *) cmd, len);
if (ret != RIG_OK)
{
return ret;
}
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret < 0)
{
@ -312,14 +312,14 @@ static int netrigctl_open(RIG *rig)
return -RIG_EPROTO;
}
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
return (ret < 0) ? ret : -RIG_EPROTO;
}
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -330,7 +330,7 @@ static int netrigctl_open(RIG *rig)
for (i = 0; i < HAMLIB_FRQRANGESIZ; i++)
{
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -360,7 +360,7 @@ static int netrigctl_open(RIG *rig)
for (i = 0; i < HAMLIB_FRQRANGESIZ; i++)
{
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -402,7 +402,7 @@ static int netrigctl_open(RIG *rig)
for (i = 0; i < HAMLIB_TSLSTSIZ; i++)
{
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -426,7 +426,7 @@ static int netrigctl_open(RIG *rig)
for (i = 0; i < HAMLIB_FLTLSTSIZ; i++)
{
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -453,7 +453,7 @@ static int netrigctl_open(RIG *rig)
chan_t chan_list[HAMLIB_CHANLSTSIZ]; /*!< Channel list, zero ended */
#endif
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -462,7 +462,7 @@ static int netrigctl_open(RIG *rig)
rig->caps->max_rit = rs->max_rit = atol(buf);
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -471,7 +471,7 @@ static int netrigctl_open(RIG *rig)
rig->caps->max_xit = rs->max_xit = atol(buf);
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -480,7 +480,7 @@ static int netrigctl_open(RIG *rig)
rig->caps->max_ifshift = rs->max_ifshift = atol(buf);
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -489,7 +489,7 @@ static int netrigctl_open(RIG *rig)
rs->announces = atoi(buf);
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -516,7 +516,7 @@ static int netrigctl_open(RIG *rig)
rig->caps->preamp[ret] = rs->preamp[ret] = RIG_DBLST_END;
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -543,7 +543,7 @@ static int netrigctl_open(RIG *rig)
rig->caps->attenuator[ret] = rs->attenuator[ret] = RIG_DBLST_END;
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -552,7 +552,7 @@ static int netrigctl_open(RIG *rig)
rig->caps->has_get_func = rs->has_get_func = strtoll(buf, NULL, 0);
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -561,7 +561,7 @@ static int netrigctl_open(RIG *rig)
rig->caps->has_set_func = rs->has_set_func = strtoll(buf, NULL, 0);
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -583,7 +583,7 @@ static int netrigctl_open(RIG *rig)
#endif
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -592,7 +592,7 @@ static int netrigctl_open(RIG *rig)
rig->caps->has_set_level = rs->has_set_level = strtoll(buf, NULL, 0);
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -601,7 +601,7 @@ static int netrigctl_open(RIG *rig)
rs->has_get_parm = strtoll(buf, NULL, 0);
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -644,7 +644,7 @@ static int netrigctl_open(RIG *rig)
do
{
char setting[32], value[1024];
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
strtok(buf, "\r\n"); // chop the EOL
if (ret <= 0)
@ -974,7 +974,7 @@ static int netrigctl_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode,
*mode = rig_parse_mode(buf);
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -1587,7 +1587,7 @@ static int netrigctl_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
*tx_mode = rig_parse_mode(buf);
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -1654,7 +1654,7 @@ static int netrigctl_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split,
*split = atoi(buf);
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{
@ -2176,7 +2176,7 @@ static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option,
ret);
}
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1);
if (ret <= 0)
{

Wyświetl plik

@ -50,14 +50,14 @@ static int netrotctl_transaction(ROT *rot, char *cmd, int len, char *buf)
/* flush anything in the read buffer before command is sent */
rig_flush(&rot->state.rotport);
ret = write_block(&rot->state.rotport, cmd, len);
ret = write_block(&rot->state.rotport, (unsigned char *) cmd, len);
if (ret != RIG_OK)
{
return ret;
}
ret = read_string(&rot->state.rotport, buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
ret = read_string(&rot->state.rotport, (unsigned char *) buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
if (ret < 0)
{
@ -100,14 +100,14 @@ static int netrotctl_open(ROT *rot)
return -RIG_EPROTO;
}
ret = read_string(&rot->state.rotport, buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
ret = read_string(&rot->state.rotport, (unsigned char *) buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
if (ret <= 0)
{
return (ret < 0) ? ret : -RIG_EPROTO;
}
ret = read_string(&rot->state.rotport, buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
ret = read_string(&rot->state.rotport, (unsigned char *) buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
if (ret <= 0)
{
@ -116,7 +116,7 @@ static int netrotctl_open(ROT *rot)
rs->min_az = atof(buf);
ret = read_string(&rot->state.rotport, buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
ret = read_string(&rot->state.rotport, (unsigned char *) buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
if (ret <= 0)
{
@ -125,7 +125,7 @@ static int netrotctl_open(ROT *rot)
rs->max_az = atof(buf);
ret = read_string(&rot->state.rotport, buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
ret = read_string(&rot->state.rotport, (unsigned char *) buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
if (ret <= 0)
{
@ -134,7 +134,7 @@ static int netrotctl_open(ROT *rot)
rs->min_el = atof(buf);
ret = read_string(&rot->state.rotport, buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
ret = read_string(&rot->state.rotport, (unsigned char *) buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
if (ret <= 0)
{
@ -151,7 +151,7 @@ static int netrotctl_close(ROT *rot)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
/* clean signoff, no read back */
write_block(&rot->state.rotport, "q\n", 2);
write_block(&rot->state.rotport, (unsigned char *) "q\n", 2);
return RIG_OK;
}
@ -198,7 +198,7 @@ static int netrotctl_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
*az = atof(buf);
ret = read_string(&rot->state.rotport, buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
ret = read_string(&rot->state.rotport, (unsigned char *) buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
if (ret <= 0)
{

Wyświetl plik

@ -273,7 +273,7 @@ static int check_vfo(vfo_t vfo)
* read_transaction
* Assumes rig!=NULL, buf!=NULL, buf_len big enough to hold response
*/
static int read_transaction(RIG *rig, char *buf, int buf_len)
static int read_transaction(RIG *rig, unsigned char *buf, int buf_len)
{
int retry;
struct rig_state *rs = &rig->state;
@ -301,7 +301,7 @@ static int read_transaction(RIG *rig, char *buf, int buf_len)
}
}
while (retry-- > 0 && strlen(buf) == 0);
while (retry-- > 0 && strlen((char *) buf) == 0);
if (retry == 0)
{
@ -316,7 +316,7 @@ static int read_transaction(RIG *rig, char *buf, int buf_len)
* write_transaction
* Assumes rig!=NULL, xml!=NULL, xml_len=total size of xml for response
*/
static int write_transaction(RIG *rig, char *buf, int buf_len)
static int write_transaction(RIG *rig, unsigned char *buf, int buf_len)
{
int try = rig->caps->retry;
@ -356,7 +356,7 @@ static int tci1x_transaction(RIG *rig, char *cmd, char *cmd_arg, char *value,
int value_len)
{
int retry = 0;
char frame[1024];
unsigned char frame[1024];
ENTERFUNC;
@ -379,7 +379,7 @@ static int tci1x_transaction(RIG *rig, char *cmd, char *cmd_arg, char *value,
frame[9] = 0x00;
frame[10] = 0x00;
frame[11] = 0x00;
strcat(&frame[12], cmd);
strcat((char *) &frame[12], cmd);
do
{
@ -403,7 +403,7 @@ static int tci1x_transaction(RIG *rig, char *cmd, char *cmd_arg, char *value,
hl_usleep(50 * 1000); // 50ms sleep if error
}
read_transaction(rig, value, value_len);
read_transaction(rig, (unsigned char *) value, value_len);
rig_debug(RIG_DEBUG_VERBOSE, "%s: value=%s\n", __func__, value);
@ -607,11 +607,11 @@ static int tci1x_open(RIG *rig)
char *websocket =
"GET / HTTP/1.1\r\nHost: localhost:50001\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Key: TnwnvtFT6akIBYQC7nh3vA==\r\nSec-WebSocket-Version: 13\r\n\r\n";
write_transaction(rig, websocket, strlen(websocket));
write_transaction(rig, (unsigned char *) websocket, strlen(websocket));
do
{
retval = read_transaction(rig, value, sizeof(value));
retval = read_transaction(rig, (unsigned char *) value, sizeof(value));
rig_debug(RIG_DEBUG_VERBOSE, "%s: value=%s\n", __func__, value);
}
while (retval == RIG_OK && strlen(value) > 0);

Wyświetl plik

@ -242,7 +242,7 @@ static int read_transaction(RIG *rig, char *response, int response_len)
rig_debug(RIG_DEBUG_TRACE, "%s\n", __func__);
len = read_string(&rs->rigport, response, response_len, delims,
len = read_string(&rs->rigport, (unsigned char *) response, response_len, delims,
strlen(delims), 0, 1);
if (len <= 0)
@ -330,7 +330,7 @@ static int trxmanager_open(RIG *rig)
// Turn off active messages
cmd = "AI0;";
retval = write_block(&rs->rigport, cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -353,7 +353,7 @@ static int trxmanager_open(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%s AI response=%s\n", __func__, response);
cmd = "FN;";
retval = write_block(&rs->rigport, cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval != RIG_OK)
{
@ -441,7 +441,7 @@ static int trxmanager_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
vfoab = vfo == RIG_VFO_A ? 'R' : 'T';
snprintf(cmd, sizeof(cmd), "X%c;", vfoab);
retval = write_block(&rs->rigport, cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -511,7 +511,7 @@ static int trxmanager_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
vfoab = vfo == RIG_VFO_A ? 'A' : 'B';
snprintf(cmd, sizeof(cmd), "F%c%011lu;", vfoab, (unsigned long)freq);
retval = write_block(&rs->rigport, cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -550,7 +550,7 @@ static int trxmanager_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
}
snprintf(cmd, sizeof(cmd), "%s;", ptt == 1 ? "TX" : "RX");
retval = write_block(&rs->rigport, cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -589,7 +589,7 @@ static int trxmanager_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
rig_strvfo(vfo));
snprintf(cmd, sizeof(cmd), "IF;");
retval = write_block(&rs->rigport, cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -714,7 +714,7 @@ static int trxmanager_set_mode(RIG *rig, vfo_t vfo, rmode_t mode,
}
snprintf(cmd, sizeof(cmd), "MD%c;", ttmode);
retval = write_block(&rs->rigport, cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -777,7 +777,7 @@ static int trxmanager_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode,
rig_strvfo(vfo));
snprintf(cmd, sizeof(cmd), "MD;");
retval = write_block(&rs->rigport, cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -850,7 +850,7 @@ static int trxmanager_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode,
// now get the bandwidth
snprintf(cmd, sizeof(cmd), "BW;");
retval = write_block(&rs->rigport, cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -917,7 +917,7 @@ static int trxmanager_set_vfo(RIG *rig, vfo_t vfo)
}
snprintf(cmd, sizeof(cmd), "FN%d;", vfo == RIG_VFO_A ? 0 : 1);
retval = write_block(&rs->rigport, cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -1002,7 +1002,7 @@ static int trxmanager_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
}
snprintf(cmd, sizeof(cmd), "XT%011lu;", (unsigned long) tx_freq);
retval = write_block(&rs->rigport, cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -1070,7 +1070,7 @@ static int trxmanager_set_split_vfo(RIG *rig, vfo_t vfo, split_t split,
if (tsplit == split) { return RIG_OK; } // don't need to change it
snprintf(cmd, sizeof(cmd), "SP%c;", split ? '1' : '0');
retval = write_block(&rs->rigport, cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -1112,7 +1112,7 @@ static int trxmanager_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split,
rig_debug(RIG_DEBUG_TRACE, "%s\n", __func__);
snprintf(cmd, sizeof(cmd), "SP;");
retval = write_block(&rs->rigport, cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -1165,7 +1165,7 @@ static int trxmanager_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t freq,
// assume split is on B
//
snprintf(cmd, sizeof(cmd), "XT%011lu;", (unsigned long)freq);
retval = write_block(&rs->rigport, cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{

Wyświetl plik

@ -173,7 +173,7 @@ int elad_transaction(RIG *rig, const char *cmdstr, char *data, size_t datasize)
int retval;
char cmdtrm[2]; /* Default Command/Reply termination char */
char *cmd;
int len;
size_t len;
int retry_read = 0;
char buffer[ELAD_MAX_BUF_LEN]; /* use our own buffer since
@ -225,7 +225,7 @@ transaction_write:
/* flush anything in the read buffer before command is sent */
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmd, len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, len);
free(cmd);
@ -242,8 +242,8 @@ transaction_write:
/* no reply expected so we need to write a command that always
gives a reply so we can read any error replies from the actual
command being sent without blocking */
if (RIG_OK != (retval = write_block(&rs->rigport, priv->verify_cmd
, strlen(priv->verify_cmd))))
if (RIG_OK != (retval = write_block(&rs->rigport,
(unsigned char *) priv->verify_cmd, strlen(priv->verify_cmd))))
{
goto transaction_quit;
}
@ -253,7 +253,8 @@ transaction_read:
/* allow one extra byte for terminator we don't return */
len = min(datasize ? datasize + 1 : strlen(priv->verify_cmd) + 13,
ELAD_MAX_BUF_LEN);
retval = read_string(&rs->rigport, buffer, len, cmdtrm, strlen(cmdtrm), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) buffer, len,
cmdtrm, strlen(cmdtrm), 0, 1);
if (retval < 0)
{
@ -3738,8 +3739,8 @@ DECLARE_PROBERIG_BACKEND(elad)
return RIG_MODEL_NONE;
}
retval = write_block(port, "ID;", 3);
id_len = read_string(port, idbuf, IDBUFSZ, ";\r", 2, 0, 1);
retval = write_block(port, (unsigned char *) "ID;", 3);
id_len = read_string(port, (unsigned char *) idbuf, IDBUFSZ, ";\r", 2, 0, 1);
close(port->fd);
if (retval != RIG_OK || id_len < 0)
@ -3799,8 +3800,8 @@ DECLARE_PROBERIG_BACKEND(elad)
return RIG_MODEL_NONE;
}
retval = write_block(port, "K2;", 3);
id_len = read_string(port, idbuf, IDBUFSZ, ";\r", 2, 0, 1);
retval = write_block(port, (unsigned char *) "K2;", 3);
id_len = read_string(port, (unsigned char *) idbuf, IDBUFSZ, ";\r", 2, 0, 1);
close(port->fd);
if (retval != RIG_OK)

Wyświetl plik

@ -334,7 +334,7 @@ static int send_command(RIG *rig, const char *cmdstr, size_t buflen)
{
int ret;
ret = write_block(&rig->state.rigport, cmdstr, buflen);
ret = write_block(&rig->state.rigport, (unsigned char *) cmdstr, buflen);
return ret;
}
@ -349,7 +349,7 @@ static int fetch_meter(RIG *rig, int *label, float *data, int npts)
char buf[sizeof(float)*MAXMETERPTS * MAXRX];
buf_len = sizeof(buf);
ret = read_block(&priv->meter_port, buf, buf_len);
ret = read_block(&priv->meter_port, (unsigned char *) buf, buf_len);
if (ret != buf_len)
{
@ -365,7 +365,7 @@ static int fetch_meter(RIG *rig, int *label, float *data, int npts)
{
/* IPC */
buf_len = sizeof(int);
ret = read_block(&priv->meter_port, (char *)label, buf_len);
ret = read_block(&priv->meter_port, (unsigned char *) label, buf_len);
if (ret != buf_len)
{
@ -377,7 +377,7 @@ static int fetch_meter(RIG *rig, int *label, float *data, int npts)
return ret;
}
buf_len = sizeof(float) * npts;
buf_len = (int) sizeof(float) * npts;
if (sizeof(float) != 4)
{
@ -386,7 +386,7 @@ static int fetch_meter(RIG *rig, int *label, float *data, int npts)
return -RIG_EINTERNAL;
}
ret = read_block(&priv->meter_port, (char *)(void *)data, buf_len);
ret = read_block(&priv->meter_port, (unsigned char *) data, buf_len);
if (ret != buf_len)
{

Wyświetl plik

@ -278,7 +278,7 @@ int icmarine_transaction(RIG *rig, const char *cmd, const char *param,
cmd_len += snprintf(cmdbuf + cmd_len, BUFSZ - cmd_len, "*%02X" EOM, csum);
/* I/O */
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval != RIG_OK)
{
@ -288,7 +288,7 @@ int icmarine_transaction(RIG *rig, const char *cmd, const char *param,
/*
* Transceiver sends an echo of cmd followed by a CR/LF
*/
retval = read_string(&rs->rigport, respbuf, BUFSZ, LF, strlen(LF), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) respbuf, BUFSZ, LF, strlen(LF), 0, 1);
if (retval < 0)
{
@ -302,7 +302,7 @@ int icmarine_transaction(RIG *rig, const char *cmd, const char *param,
}
/* check response */
if (memcmp(respbuf, "$PICOA,", strlen("$PICOA,")))
if (memcmp(respbuf, "$PICOA,", strlen("$PICOA,")) != 0)
{
return -RIG_EPROTO;
}

Wyświetl plik

@ -79,7 +79,7 @@ static int jrc_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
set_transaction_active(rig);
retval = write_block(&rs->rigport, cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -93,7 +93,7 @@ static int jrc_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
return 0;
}
retval = read_string(&rs->rigport, data, BUFSZ, EOM, strlen(EOM), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, BUFSZ, EOM, strlen(EOM), 0, 1);
set_transaction_inactive(rig);
@ -1632,7 +1632,7 @@ int jrc_decode_event(RIG *rig)
//#define SETUP_STATUS_LEN 17
//count = read_string(&rs->rigport, buf, SETUP_STATUS_LEN, "", 0);
count = read_string(&rs->rigport, buf, priv->info_len, "", 0, 0, 1);
count = read_string(&rs->rigport, (unsigned char *) buf, priv->info_len, "", 0, 0, 1);
if (count < 0)
{

Wyświetl plik

@ -155,12 +155,12 @@ const struct rig_caps nrd525_caps =
static int nrd525_open(RIG *rig)
{
return write_block(&rig->state.rigport, "H1", 2);
return write_block(&rig->state.rigport, (unsigned char *) "H1", 2);
}
static int nrd525_close(RIG *rig)
{
return write_block(&rig->state.rigport, "H0", 2);
return write_block(&rig->state.rigport, (unsigned char *) "H0", 2);
}
static int nrd525_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
@ -169,7 +169,7 @@ static int nrd525_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
sprintf(freqbuf, "F%08u", (unsigned)(freq / 10));
return write_block(&rig->state.rigport, freqbuf, strlen(freqbuf));
return write_block(&rig->state.rigport, (unsigned char *) freqbuf, strlen(freqbuf));
}
static int nrd525_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
@ -197,7 +197,7 @@ static int nrd525_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
return -RIG_EINVAL;
}
retval = write_block(&rig->state.rigport, modestr, strlen(modestr));
retval = write_block(&rig->state.rigport, (unsigned char *) modestr, strlen(modestr));
if (retval != RIG_OK)
{
@ -221,18 +221,16 @@ static int nrd525_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
switch (level)
{
case RIG_LEVEL_ATT:
return write_block(&rig->state.rigport, val.i != 0 ? "A1" : "A0", 2);
return write_block(&rig->state.rigport, (unsigned char *) (val.i != 0 ? "A1" : "A0"), 2);
case RIG_LEVEL_AGC:
return write_block(&rig->state.rigport,
val.i == RIG_AGC_SLOW ? "G0" :
(val.i == RIG_AGC_FAST ? "G1" : "G2"), 2);
(unsigned char *) (val.i == RIG_AGC_SLOW ? "G0" :
(val.i == RIG_AGC_FAST ? "G1" : "G2")), 2);
default:
return -RIG_EINVAL;
}
return -RIG_EINVAL;
}
static int nrd525_set_mem(RIG *rig, vfo_t vfo, int ch)
@ -241,7 +239,7 @@ static int nrd525_set_mem(RIG *rig, vfo_t vfo, int ch)
sprintf(membuf, "C%03d", ch);
return write_block(&rig->state.rigport, membuf, strlen(membuf));
return write_block(&rig->state.rigport, (unsigned char *) membuf, strlen(membuf));
}
static int nrd525_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
@ -249,12 +247,10 @@ static int nrd525_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
switch (op)
{
case RIG_OP_FROM_VFO:
return write_block(&rig->state.rigport, "E1", 2);
return write_block(&rig->state.rigport, (unsigned char *) "E1", 2);
default:
return -RIG_EINVAL;
}
return -RIG_EINVAL;
}

Wyświetl plik

@ -86,14 +86,14 @@ static int kachina_transaction(RIG *rig, unsigned char cmd1, unsigned char cmd2)
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, (char *) buf4, 4);
retval = write_block(&rs->rigport, buf4, 4);
if (retval != RIG_OK)
{
return retval;
}
count = read_string(&rs->rigport, (char *) buf4, 1, "", 0, 0, 1);
count = read_string(&rs->rigport, buf4, 1, "", 0, 0, 1);
if (count != 1)
{
@ -121,14 +121,14 @@ static int kachina_trans_n(RIG *rig, unsigned char cmd1, const char *data,
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, (char *) buf, cmd_len);
retval = write_block(&rs->rigport, buf, cmd_len);
if (retval != RIG_OK)
{
return retval;
}
count = read_string(&rs->rigport, (char *) buf, 1, "", 0, 0, 1);
count = read_string(&rs->rigport, buf, 1, "", 0, 0, 1);
if (count != 1)
{
@ -272,7 +272,7 @@ int kachina_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
rig_flush(&rig->state.rigport);
count = read_string(&rig->state.rigport, (char *) buf, 31, rcv_signal_range,
count = read_string(&rig->state.rigport, buf, 31, rcv_signal_range,
128, 0, 1);
if (count < 1)

Wyświetl plik

@ -127,7 +127,7 @@ int elecraft_open(RIG *rig)
strcpy(data, "EMPTY");
// Not going to get carried away with retries and such
err = write_block(&rs->rigport, cmd, strlen(cmd));
err = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (err != RIG_OK)
{
@ -135,7 +135,8 @@ int elecraft_open(RIG *rig)
return err;
}
err = read_string(&rs->rigport, buf, sizeof(buf), ";", 1, 0, 1);
err = read_string(&rs->rigport, (unsigned char *) buf, sizeof(buf),
";", 1, 0, 1);
if (err < 0)
{

Wyświetl plik

@ -91,7 +91,7 @@ int ic10_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
transaction:
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -103,14 +103,13 @@ transaction:
char buffer[50];
struct kenwood_priv_data *priv = rig->state.priv;
if (RIG_OK != (retval = write_block(&rs->rigport, priv->verify_cmd
, strlen(priv->verify_cmd))))
if (RIG_OK != (retval = write_block(&rs->rigport, (unsigned char *) priv->verify_cmd, strlen(priv->verify_cmd))))
{
return retval;
}
// this should be the ID response
retval = read_string(&rs->rigport, buffer, sizeof(buffer), ";", 1, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) buffer, sizeof(buffer), ";", 1, 0, 1);
// might be ?; too
if (buffer[0] == '?' && retry_cmd++ < rs->rigport.retry)
@ -119,7 +118,7 @@ transaction:
goto transaction;
}
if (strncmp("ID", buffer, 2))
if (strncmp("ID", buffer, 2) != 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: expected ID response and got %s\n", __func__,
buffer);
@ -129,7 +128,7 @@ transaction:
return RIG_OK;
}
retval = read_string(&rs->rigport, data, 50, ";", 1, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, 50, ";", 1, 0, 1);
if (retval == -RIG_ETIMEOUT)
{

Wyświetl plik

@ -318,7 +318,7 @@ transaction_write:
/* flush anything in the read buffer before command is sent */
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmd, len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, len);
free(cmd);
@ -359,8 +359,7 @@ transaction_write:
/* no reply expected so we need to write a command that always
gives a reply so we can read any error replies from the actual
command being sent without blocking */
if (RIG_OK != (retval = write_block(&rs->rigport, priv->verify_cmd
, strlen(priv->verify_cmd))))
if (RIG_OK != (retval = write_block(&rs->rigport, (unsigned char *) priv->verify_cmd, strlen(priv->verify_cmd))))
{
goto transaction_quit;
}
@ -370,8 +369,8 @@ transaction_read:
/* allow room for most any response */
len = min(datasize ? datasize + 1 : strlen(priv->verify_cmd) + 48,
KENWOOD_MAX_BUF_LEN);
retval = read_string(&rs->rigport, buffer, len, cmdtrm_str, strlen(cmdtrm_str),
0, 1);
retval = read_string(&rs->rigport, (unsigned char *) buffer, len,
cmdtrm_str, strlen(cmdtrm_str), 0, 1);
rig_debug(RIG_DEBUG_TRACE, "%s: read_string(len=%d)='%s'\n", __func__,
(int)strlen(buffer), buffer);
@ -2686,11 +2685,11 @@ static int kenwood_get_micgain_minmax(RIG *rig, int *micgain_now,
struct rig_state *rs = &rig->state;
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
retval = write_block(&rs->rigport, cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval != RIG_OK) { RETURNFUNC(retval); }
retval = read_string(&rs->rigport, levelbuf, sizeof(levelbuf), NULL, 0, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) levelbuf, sizeof(levelbuf), NULL, 0, 0, 1);
rig_debug(RIG_DEBUG_TRACE, "%s: retval=%d\n", __func__, retval);
@ -2785,11 +2784,11 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min,
RETURNFUNC(RIG_OK);
}
retval = write_block(&rs->rigport, cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval != RIG_OK) { RETURNFUNC(retval); }
retval = read_string(&rs->rigport, levelbuf, sizeof(levelbuf), NULL, 0, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) levelbuf, sizeof(levelbuf), NULL, 0, 0, 1);
rig_debug(RIG_DEBUG_TRACE, "%s: retval=%d\n", __func__, retval);
@ -5417,7 +5416,7 @@ DECLARE_PROBERIG_BACKEND(kenwood)
int rates[] = { 115200, 57600, 38400, 19200, 9600, 4800, 1200, 0 }; /* possible baud rates */
int rates_idx;
int write_delay = port->write_delay;
int retry = port->retry;
short retry = port->retry;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@ -5452,8 +5451,8 @@ DECLARE_PROBERIG_BACKEND(kenwood)
RETURNFUNC(RIG_MODEL_NONE);
}
retval = write_block(port, "ID;", 3);
id_len = read_string(port, idbuf, IDBUFSZ, ";\r", 2, 0, 1);
retval = write_block(port, (unsigned char *) "ID;", 3);
id_len = read_string(port, (unsigned char *) idbuf, IDBUFSZ, ";\r", 2, 0, 1);
close(port->fd);
if (retval != RIG_OK || id_len < 0)
@ -5519,8 +5518,8 @@ DECLARE_PROBERIG_BACKEND(kenwood)
RETURNFUNC(RIG_MODEL_NONE);
}
retval = write_block(port, "K2;", 3);
id_len = read_string(port, idbuf, IDBUFSZ, ";\r", 2, 0, 1);
retval = write_block(port, (unsigned char *) "K2;", 3);
id_len = read_string(port, (unsigned char *) idbuf, IDBUFSZ, ";\r", 2, 0, 1);
close(port->fd);
if (retval != RIG_OK)

Wyświetl plik

@ -431,7 +431,7 @@ static int ts480_read_meters(RIG *rig, int *swr, int *comp, int *alc)
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
retval = write_block(&rs->rigport, cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
rig_debug(RIG_DEBUG_TRACE, "%s: write_block retval=%d\n", __func__, retval);
@ -442,7 +442,7 @@ static int ts480_read_meters(RIG *rig, int *swr, int *comp, int *alc)
// TS-480 returns values for all meters at the same time, for example: RM10000;RM20000;RM30000;
retval = read_string(&rs->rigport, ackbuf, expected_len + 1, NULL, 0, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) ackbuf, expected_len + 1, NULL, 0, 0, 1);
rig_debug(RIG_DEBUG_TRACE, "%s: read_string retval=%d\n", __func__, retval);

Wyświetl plik

@ -276,7 +276,7 @@ int xg3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
case RIG_LEVEL_RFPOWER:
sprintf(cmdbuf, "L;");
retval = write_block(&rs->rigport, cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval != RIG_OK)
{
@ -285,7 +285,8 @@ int xg3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
return retval;
}
retval = read_string(&rs->rigport, replybuf, replysize, ";", 1, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) replybuf, replysize,
";", 1, 0, 1);
if (retval < 0)
{
@ -454,7 +455,7 @@ int xg3_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
sprintf(cmdbuf, "F;");
}
retval = write_block(&rs->rigport, cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval != RIG_OK)
{
@ -462,7 +463,8 @@ int xg3_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
return retval;
}
retval = read_string(&rs->rigport, freqbuf, freqsize, ";", 1, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) freqbuf, freqsize,
";", 1, 0, 1);
if (retval < 0)
{
@ -514,7 +516,8 @@ int xg3_get_powerstat(RIG *rig, powerstat_t *status)
if (retval == RIG_OK)
{
char reply[32];
retval = read_string(&rs->rigport, reply, sizeof(reply), ";", 1, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) reply, sizeof(reply),
";", 1, 0, 1);
*status = RIG_POWER_ON;
priv->powerstat = RIG_POWER_ON;
}
@ -578,7 +581,8 @@ int xg3_get_mem(RIG *rig, vfo_t vfo, int *ch)
return retval;
}
retval = read_string(&rs->rigport, reply, sizeof(reply), ";", 1, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) reply, sizeof(reply),
";", 1, 0, 1);
if (retval < 0)
{
@ -688,7 +692,7 @@ int xg3_get_parm(RIG *rig, setting_t parm, value_t *val)
if (retval == RIG_OK)
{
sscanf(&replybuf[3], "%d", &ival);
(*val).f = (3 - ival) / 3.0;
val->f = (3.0f - (float) ival) / 3.0f;
}
break;

Wyświetl plik

@ -198,17 +198,14 @@ static int send_command(RIG *rig)
struct hiqsdr_priv_data *priv = (struct hiqsdr_priv_data *)rig->state.priv;
int ret;
ret = write_block(&rig->state.rigport, (const char *)priv->control_frame,
CTRL_FRAME_LEN);
ret = write_block(&rig->state.rigport, (unsigned char *) priv->control_frame, CTRL_FRAME_LEN);
#if 0
ret = read_block(&rig->state.rigport, (char *)priv->control_frame,
CTRL_FRAME_LEN);
ret = read_block(&rig->state.rigport, (unsigned char *) priv->control_frame, CTRL_FRAME_LEN);
if (ret != CTRL_FRAME_LEN)
{
ret = ret < 0 ? ret : -RIG_EPROTO;
}
#endif
return ret;

Wyświetl plik

@ -50,7 +50,7 @@ static int miniVNA_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
sprintf(cmdstr, "0\r%lu\r1\r0\r", (unsigned long int)(freq * DDS_RATIO));
retval = write_block(&rig->state.rigport, cmdstr, strlen(cmdstr));
retval = write_block(&rig->state.rigport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{

Wyświetl plik

@ -95,14 +95,15 @@ static int rshfiq_open(RIG *rig)
rig_flush(&rig->state.rigport);
snprintf(versionstr, sizeof(versionstr), "*w\r");
rig_debug(RIG_DEBUG_TRACE, "%s: cmdstr = %s\n", __func__, versionstr);
retval = write_block(&rig->state.rigport, versionstr, strlen(versionstr));
retval = write_block(&rig->state.rigport, (unsigned char *) versionstr, strlen(versionstr));
if (retval != RIG_OK)
{
return retval;
}
retval = read_string(&rig->state.rigport, versionstr, 20, stopset, 2, 0, 1);
retval = read_string(&rig->state.rigport, (unsigned char *) versionstr, 20,
stopset, 2, 0, 1);
}
if (retval <= 0)
@ -161,7 +162,7 @@ static int rshfiq_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
snprintf(cmdstr, sizeof(cmdstr), "*f%lu\r", (unsigned long int)(freq));
retval = write_block(&rig->state.rigport, cmdstr, strlen(cmdstr));
retval = write_block(&rig->state.rigport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
@ -184,14 +185,15 @@ static int rshfiq_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
rig_debug(RIG_DEBUG_TRACE, "%s: cmdstr = %s\n", __func__, cmdstr);
retval = write_block(&rig->state.rigport, cmdstr, strlen(cmdstr));
retval = write_block(&rig->state.rigport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
return retval;
}
retval = read_string(&rig->state.rigport, cmdstr, 9, stopset, 2, 0, 1);
retval = read_string(&rig->state.rigport, (unsigned char *) cmdstr, 9,
stopset, 2, 0, 1);
if (retval <= 0)
{
@ -232,7 +234,7 @@ static int rshfiq_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
rig_debug(RIG_DEBUG_TRACE, "%s: cmdstr = %s\n", __func__, cmdstr);
retval = write_block(&rig->state.rigport, cmdstr, strlen(cmdstr));
retval = write_block(&rig->state.rigport, (unsigned char *) cmdstr, strlen(cmdstr));
return retval;
}
@ -266,7 +268,7 @@ static int rshfiq_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
rig_debug(RIG_DEBUG_TRACE, "RIG_LEVEL_RFPOWER_METER command=%s\n", cmdstr);
retval = write_block(&rig->state.rigport, cmdstr, strlen(cmdstr));
retval = write_block(&rig->state.rigport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
@ -276,7 +278,8 @@ static int rshfiq_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
stopset[0] = '\r';
stopset[1] = '\n';
retval = read_string(&rig->state.rigport, cmdstr, 9, stopset, 2, 0, 1);
retval = read_string(&rig->state.rigport, (unsigned char *) cmdstr, 9,
stopset, 2, 0, 1);
rig_debug(RIG_DEBUG_TRACE, "RIG_LEVEL_RFPOWER_METER reply=%s\n", cmdstr);
@ -304,7 +307,7 @@ static int rshfiq_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
rig_debug(RIG_DEBUG_TRACE, "RIG_LEVEL_TEMP_METER command=%s\n", cmdstr);
retval = write_block(&rig->state.rigport, cmdstr, strlen(cmdstr));
retval = write_block(&rig->state.rigport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
@ -314,7 +317,8 @@ static int rshfiq_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
stopset[0] = '\r';
stopset[1] = '\n';
retval = read_string(&rig->state.rigport, cmdstr, 9, stopset, 2, 0, 1);
retval = read_string(&rig->state.rigport, (unsigned char *) cmdstr, 9,
stopset, 2, 0, 1);
rig_debug(RIG_DEBUG_TRACE, "RIG_LEVEL_TEMP_METER reply=%s\n", cmdstr);

Wyświetl plik

@ -65,7 +65,7 @@ int lowe_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -79,7 +79,7 @@ int lowe_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
return 0;
}
retval = read_string(&rs->rigport, data, BUFSZ, CR, 1, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, BUFSZ, CR, 1, 0, 1);
if (retval == -RIG_ETIMEOUT)
{
@ -341,8 +341,8 @@ DECLARE_PROBERIG_BACKEND(lowe)
return RIG_MODEL_NONE;
}
retval = write_block(port, "TYP?" EOM, 4);
id_len = read_string(port, idbuf, BUFSZ, CR, 2, 0, 1);
retval = write_block(port, (unsigned char *) "TYP?" EOM, 4);
id_len = read_string(port, (unsigned char *) idbuf, BUFSZ, CR, 2, 0, 1);
close(port->fd);

Wyświetl plik

@ -177,7 +177,7 @@ pcr_read_block(RIG *rig, char *rxbuffer, size_t count)
/* already in sync? */
if (priv->sync && !caps->always_sync)
{
return read_block(&rs->rigport, rxbuffer, count);
return read_block(&rs->rigport, (unsigned char *) rxbuffer, count);
}
/* read first char */
@ -186,7 +186,7 @@ pcr_read_block(RIG *rig, char *rxbuffer, size_t count)
char *p = &rxbuffer[0];
/* read first char */
int err = read_block(&rs->rigport, p, 1);
int err = read_block(&rs->rigport, (unsigned char *) p, 1);
if (err < 0)
{
@ -209,7 +209,7 @@ pcr_read_block(RIG *rig, char *rxbuffer, size_t count)
count--;
p++;
err = read_block(&rs->rigport, p, count);
err = read_block(&rs->rigport, (unsigned char *) p, count);
if (err < 0)
{
@ -363,7 +363,7 @@ pcr_send(RIG *rig, const char *cmd)
rs->transaction_active = 1;
err = write_block(&rs->rigport, priv->cmd_buf, len + 1);
err = write_block(&rs->rigport, (unsigned char *) priv->cmd_buf, len + 1);
rs->transaction_active = 0;

Wyświetl plik

@ -170,7 +170,7 @@ static int read_prompt_and_send(hamlib_port_t *rigport,
buflen = (data_len == NULL) ? sizeof(buf) : *data_len;
retval = read_string(rigport, data, buflen, delimiter, 1, 0, 1);
retval = read_string(rigport, (unsigned char *) data, buflen, delimiter, 1, 0, 1);
if (retval < 0)
{
@ -188,7 +188,7 @@ static int read_prompt_and_send(hamlib_port_t *rigport,
// Read one (dummy) space character after the colon
if (space_after_delim)
{
retval = read_block(rigport, spacebuf, 1);
retval = read_block(rigport, (unsigned char *) spacebuf, 1);
if (retval < 0 && retval != -RIG_ETIMEOUT)
{
@ -197,7 +197,7 @@ static int read_prompt_and_send(hamlib_port_t *rigport,
}
// Here is the answer to the prompt
retval = write_block(rigport, s, strlen(s));
retval = write_block(rigport, (unsigned char *) s, strlen(s));
return retval;
}
@ -230,7 +230,7 @@ static int prm80_wait_for_prompt(hamlib_port_t *rigport)
int retval;
// Read up to the '>' prompt and discard content.
retval = read_string(rigport, buf, sizeof(buf), ">", 1, 0, 1);
retval = read_string(rigport, (unsigned char *) buf, sizeof(buf), ">", 1, 0, 1);
if (retval < 0)
{
@ -256,7 +256,7 @@ static int prm80_transaction(RIG *rig, const char *cmd,
rig_flush(&rs->rigport);
// Start with the command
retval = write_block(&rs->rigport, cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval != RIG_OK)
{
@ -642,7 +642,7 @@ static int prm80_do_read_system_state(hamlib_port_t *rigport, char *statebuf)
rig_flush(rigport);
/* [E] = Show system state */
ret = write_block(rigport, "E", 1);
ret = write_block(rigport, (unsigned char *) "E", 1);
if (ret < 0)
{
@ -650,7 +650,7 @@ static int prm80_do_read_system_state(hamlib_port_t *rigport, char *statebuf)
}
// The response length is fixed
ret = read_block(rigport, statebuf, CMD_E_RSP_LEN);
ret = read_block(rigport, (unsigned char *) statebuf, CMD_E_RSP_LEN);
if (ret < 0)
{
@ -675,7 +675,7 @@ static int prm80_do_read_system_state(hamlib_port_t *rigport, char *statebuf)
{
int left_to_read = (p - statebuf) + 1;
memmove(statebuf, p + 1, CMD_E_RSP_LEN - left_to_read);
ret = read_block(rigport, statebuf + CMD_E_RSP_LEN - left_to_read,
ret = read_block(rigport, (unsigned char *) statebuf + CMD_E_RSP_LEN - left_to_read,
left_to_read);
if (ret < 0)
@ -900,7 +900,7 @@ int prm80_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
// Determine if prompt came back (CRLF'>') or have to
// handle the possible query from the rig:
// "This channel number doesn't exist. Add new channel (Y/N) ? "
ret = read_block(&rs->rigport, buf, 3);
ret = read_block(&rs->rigport, (unsigned char *) buf, 3);
if (ret < 0)
{
@ -910,7 +910,7 @@ int prm80_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
if (ret == 3 && buf[2] == 'T')
{
// Read the question
ret = read_string(&rs->rigport, buf, sizeof(buf), "?", 1, 0, 1);
ret = read_string(&rs->rigport, (unsigned char *) buf, sizeof(buf), "?", 1, 0, 1);
if (ret < 0)
{
@ -918,7 +918,7 @@ int prm80_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
}
// Read extra space
ret = read_block(&rs->rigport, buf, 1);
ret = read_block(&rs->rigport, (unsigned char *) buf, 1);
if (ret < 0)
{
@ -926,7 +926,7 @@ int prm80_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
}
// Send confirmation
ret = write_block(&rs->rigport, "Y", 1);
ret = write_block(&rs->rigport, (unsigned char *) "Y", 1);
if (ret < 0)
{
@ -1274,14 +1274,14 @@ const char *prm80_get_info(RIG *rig)
rig_flush(&rs->rigport);
/* [V] = Print firmware version. */
ret = write_block(&rs->rigport, "V", 1);
ret = write_block(&rs->rigport, (unsigned char *) "V", 1);
if (ret < 0)
{
return NULL;
}
ret = read_string(&rs->rigport, s_buf, BUFSZ, ">", 1, 0, 1);
ret = read_string(&rs->rigport, (unsigned char *) s_buf, BUFSZ, ">", 1, 0, 1);
if (ret < 0)
{

Wyświetl plik

@ -106,7 +106,7 @@ static int ra37xx_one_transaction(RIG *rig, const char *cmd, char *data,
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval != RIG_OK)
{
@ -122,7 +122,7 @@ static int ra37xx_one_transaction(RIG *rig, const char *cmd, char *data,
do
{
retval = read_string(&rs->rigport, respbuf, BUFSZ, EOM, strlen(EOM), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) respbuf, BUFSZ, EOM, strlen(EOM), 0, 1);
if (retval < 0)
{

Wyświetl plik

@ -86,7 +86,7 @@ static int racal_transaction(RIG *rig, const char *cmd, char *data,
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval != RIG_OK)
{
@ -100,7 +100,7 @@ static int racal_transaction(RIG *rig, const char *cmd, char *data,
return retval;
}
retval = read_string(&rs->rigport, data, BUFSZ, EOM, strlen(EOM), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, BUFSZ, EOM, strlen(EOM), 0, 1);
if (retval <= 0)
{

Wyświetl plik

@ -57,7 +57,7 @@ int rft_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -71,7 +71,7 @@ int rft_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
return 0;
}
retval = read_string(&rs->rigport, data, BUFSZ, CR, 1, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, BUFSZ, CR, 1, 0, 1);
if (retval == -RIG_ETIMEOUT)
{

Wyświetl plik

@ -75,7 +75,7 @@ gp2000_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rig_debug(RIG_DEBUG_VERBOSE, "gp2000_transaction: len=%d,cmd=%s\n",
cmd_len, cmd);
retval = write_block(&rs->rigport, cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -89,7 +89,8 @@ gp2000_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
return RIG_OK;
}
retval = read_string(&rs->rigport, data, RESPSZ, CR, 1, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, RESPSZ,
CR, 1, 0, 1);
if (retval < 0)
{

Wyświetl plik

@ -66,7 +66,7 @@ int rs_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -80,7 +80,7 @@ int rs_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
return RIG_OK;
}
retval = read_string(&rs->rigport, data, BUFSZ, CR, 1, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, BUFSZ, CR, 1, 0, 1);
if (retval < 0)
{

Wyświetl plik

@ -73,7 +73,7 @@ static int skanti_transaction(RIG *rig, const char *cmd, int cmd_len,
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -88,7 +88,7 @@ static int skanti_transaction(RIG *rig, const char *cmd, int cmd_len,
* Transceiver sends back ">"
*/
char retbuf[BUFSZ + 1];
retval = read_string(&rs->rigport, retbuf, BUFSZ, PROMPT, strlen(PROMPT), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) retbuf, BUFSZ, PROMPT, strlen(PROMPT), 0, 1);
if (retval < 0)
{
@ -107,7 +107,7 @@ static int skanti_transaction(RIG *rig, const char *cmd, int cmd_len,
}
}
retval = read_string(&rs->rigport, data, BUFSZ, LF, strlen(LF), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, BUFSZ, LF, strlen(LF), 0, 1);
if (retval == -RIG_ETIMEOUT)
{

Wyświetl plik

@ -189,14 +189,14 @@ static int cu_transaction(RIG *rig, const char *cmd, int cmd_len)
for (i = 0; i < cmd_len; i++)
{
int ret = write_block(&rig->state.rigport, &cmd[i], 1);
int ret = write_block(&rig->state.rigport, (unsigned char *) &cmd[i], 1);
if (ret != RIG_OK)
{
return ret;
}
ret = read_block(&rig->state.rigport, &retchar, 1);
ret = read_block(&rig->state.rigport, (unsigned char *) &retchar, 1);
switch (retchar)
{

Wyświetl plik

@ -67,7 +67,7 @@ static int tapr_cmd(RIG *rig, unsigned char cmd, unsigned char c1,
cmdbuf[4] = c3;
cmdbuf[5] = c4;
retval = write_block(&rs->rigport, (char *) cmdbuf, 6);
retval = write_block(&rs->rigport, cmdbuf, 6);
if (retval != RIG_OK)
{

Wyświetl plik

@ -273,7 +273,7 @@ static int tt588_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
// We add 1 to data_len here for the null byte inserted by read_string eventually
// That way all the callers can use the expected response length for the cmd_len parameter here
// Callers all need to ensure they have enough room in data for this
retval = write_block(&rs->rigport, cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval == RIG_OK)
{
@ -288,7 +288,7 @@ static int tt588_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
if (data)
{
retval = read_string(&rs->rigport, data, (*data_len) + 1, term, strlen(term), 0,
retval = read_string(&rs->rigport, (unsigned char *) data, (*data_len) + 1, term, strlen(term), 0,
1);
if (retval != -RIG_ETIMEOUT)
@ -308,9 +308,9 @@ static int tt588_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rig_debug(RIG_DEBUG_ERR, "%s: write_block failed, try#%d\n", __func__, i + 1);
}
write_block(&rs->rigport, "XX" EOM,
write_block(&rs->rigport, (unsigned char *) "XX" EOM,
3); // we wont' worry about the response here
retval = read_string(&rs->rigport, xxbuf, sizeof(xxbuf), "",
retval = read_string(&rs->rigport, (unsigned char *) xxbuf, sizeof(xxbuf), "",
0, 0, 1); // this should timeout
if (retval != RIG_OK)

Wyświetl plik

@ -131,7 +131,7 @@ static int tt565_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
int retval;
rs = &rig->state;
rig_flush(&rs->rigport); /* discard pending i/p */
retval = write_block(&rs->rigport, cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -155,7 +155,7 @@ static int tt565_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
ft1 = tt565_timenow();
#endif
*data_len = data_len_init; /* restore orig. buffer length */
*data_len = read_string(&rs->rigport, data, *data_len,
*data_len = read_string(&rs->rigport, (unsigned char *) data, *data_len,
EOM, strlen(EOM), 0, 1);
if (!strncmp(data, "Z!", 2)) // command unrecognized??
@ -196,7 +196,7 @@ static int tt565_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
"** retry after delay (io=%d, retry=%d) **\n",
passcount, itry);
*data_len = data_len_init; /* restore orig. buffer length */
read_string(&rs->rigport, data, *data_len,
read_string(&rs->rigport, (unsigned char *) data, *data_len,
EOM, strlen(EOM), 0, 1); // purge the input stream...
continue; // now go retry the full command
}
@ -667,7 +667,7 @@ int tt565_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
(int)width
);
retval = write_block(&rs->rigport, mdbuf, mdbuf_len);
retval = write_block(&rs->rigport, (unsigned char *) mdbuf, mdbuf_len);
return retval;
}
@ -939,7 +939,7 @@ int tt565_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
struct rig_state *rs = &rig->state;
return write_block(&rs->rigport,
ptt == RIG_PTT_ON ? "*TK" EOM : "*TU" EOM, 4);
(unsigned char *) (ptt == RIG_PTT_ON ? "*TK" EOM : "*TU" EOM), 4);
}
/**

Wyświetl plik

@ -280,7 +280,7 @@ int tt585_set_vfo(RIG *rig, vfo_t vfo)
}
/* toggle VFOs */
return write_block(&rig->state.rigport, "F", 1);
return write_block(&rig->state.rigport, (unsigned char *) "F", 1);
}
int tt585_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
@ -302,7 +302,7 @@ int tt585_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
}
/* toggle split mode */
return write_block(&rig->state.rigport, "J", 1);
return write_block(&rig->state.rigport, (unsigned char *) "J", 1);
}
int tt585_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *txvfo)
@ -376,7 +376,7 @@ int tt585_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
rig_force_cache_timeout(&priv->status_tv);
return write_block(&rig->state.rigport, buf, ret);
return write_block(&rig->state.rigport, (unsigned char *) buf, ret);
}
/*
@ -482,7 +482,7 @@ int tt585_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
rig_force_cache_timeout(&priv->status_tv);
ret = write_block(&rig->state.rigport, mcmd, strlen(mcmd));
ret = write_block(&rig->state.rigport, (unsigned char *) mcmd, strlen(mcmd));
if (ret < 0)
{
@ -517,7 +517,7 @@ int tt585_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
wcmd = "R";
}
return write_block(&rig->state.rigport, wcmd, strlen(mcmd));
return write_block(&rig->state.rigport, (unsigned char *) wcmd, strlen(mcmd));
}
int tt585_set_mem(RIG *rig, vfo_t vfo, int ch)
@ -536,7 +536,7 @@ int tt585_set_mem(RIG *rig, vfo_t vfo, int ch)
/* does it work without a command after the channel number? */
ret = sprintf(buf, ":%02d", ch);
return write_block(&rig->state.rigport, buf, ret);
return write_block(&rig->state.rigport, (unsigned char *) buf, ret);
}
int tt585_get_mem(RIG *rig, vfo_t vfo, int *ch)
@ -586,14 +586,14 @@ int tt585_get_status_data(RIG *rig)
/* send STATUS command to fetch data*/
ret = write_block(rigport, "\\", 1);
ret = write_block(rigport, (unsigned char *) "\\", 1);
if (ret < 0)
{
return ret;
}
ret = read_block(rigport, (char *) priv->status_data,
ret = read_block(rigport, (unsigned char *) (char *) priv->status_data,
sizeof(priv->status_data));
if (ret < 0)
@ -615,7 +615,7 @@ int tt585_set_parm(RIG *rig, setting_t parm, value_t val)
{
case RIG_PARM_ANN:
/* FIXME: > is a toggle command only */
ret = write_block(&rig->state.rigport, ">", 1);
ret = write_block(&rig->state.rigport, (unsigned char *) ">", 1);
if (ret < 0)
{
@ -685,5 +685,5 @@ int tt585_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
rig_force_cache_timeout(&priv->status_tv);
return write_block(&rig->state.rigport, cmd, strlen(cmd));
return write_block(&rig->state.rigport, (unsigned char *) cmd, strlen(cmd));
}

Wyświetl plik

@ -256,7 +256,7 @@ static int rx331_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rig_flush(&rs->rigport);
num_snprintf(str, BUFSZ, "$%u%s", priv->receiver_id, cmd);
retval = write_block(&rs->rigport, str, strlen(str));
retval = write_block(&rs->rigport, (unsigned char *) str, strlen(str));
if (retval != RIG_OK)
{
@ -269,7 +269,7 @@ static int rx331_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
return RIG_OK;
}
retval = read_string(&rs->rigport, data, BUFSZ, EOM, 1, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, BUFSZ, EOM, 1, 0, 1);
if (retval < 0)
{
@ -401,7 +401,7 @@ int rx331_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
freq_len = num_sprintf(freqbuf, "$%uF%.6f" EOM,
priv->receiver_id, freq / 1e6);
retval = write_block(&rs->rigport, freqbuf, freq_len);
retval = write_block(&rs->rigport, (unsigned char *) freqbuf, freq_len);
return retval;
}
@ -491,7 +491,7 @@ int rx331_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
mdbuf_len = num_sprintf(mdbuf, "$%uD%c" EOM, priv->receiver_id, dmode);
}
retval = write_block(&rs->rigport, mdbuf, mdbuf_len);
retval = write_block(&rs->rigport, (unsigned char *) mdbuf, mdbuf_len);
return retval;
}
@ -634,7 +634,7 @@ int rx331_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
return -RIG_EINVAL;
}
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
return retval;
}

Wyświetl plik

@ -206,7 +206,7 @@ static int rx340_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -219,7 +219,7 @@ static int rx340_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
return RIG_OK;
}
retval = read_string(&rs->rigport, data, BUFSZ, EOM, 1, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, BUFSZ, EOM, 1, 0, 1);
if (retval < 0)
{
@ -282,7 +282,7 @@ int rx340_open(RIG *rig)
struct rig_state *rs = &rig->state;
#define REMOTE_CMD "*R1"EOM
return write_block(&rs->rigport, REMOTE_CMD, strlen(REMOTE_CMD));
return write_block(&rs->rigport, (unsigned char *) REMOTE_CMD, strlen(REMOTE_CMD));
}
int rx340_close(RIG *rig)
@ -290,7 +290,7 @@ int rx340_close(RIG *rig)
struct rig_state *rs = &rig->state;
#define LOCAL_CMD "*R0"EOM
return write_block(&rs->rigport, LOCAL_CMD, strlen(LOCAL_CMD));
return write_block(&rs->rigport, (unsigned char *) LOCAL_CMD, strlen(LOCAL_CMD));
}
/*
@ -304,7 +304,7 @@ int rx340_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
freq_len = num_sprintf(freqbuf, "F%.6f" EOM, freq / 1e6);
retval = write_block(&rs->rigport, freqbuf, freq_len);
retval = write_block(&rs->rigport, (unsigned char *) freqbuf, freq_len);
return retval;
}
@ -394,7 +394,7 @@ int rx340_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
mdbuf_len = num_sprintf(mdbuf, "D%c" EOM, dmode);
}
retval = write_block(&rs->rigport, mdbuf, mdbuf_len);
retval = write_block(&rs->rigport, (unsigned char *) mdbuf, mdbuf_len);
return retval;
}
@ -514,7 +514,7 @@ int rx340_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
return -RIG_EINVAL;
}
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
return retval;
}

Wyświetl plik

@ -72,7 +72,7 @@ int tentec_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -85,7 +85,7 @@ int tentec_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
return 0;
}
retval = read_string(&rs->rigport, data, *data_len, NULL, 0, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, *data_len, NULL, 0, 0, 1);
if (retval == -RIG_ETIMEOUT)
{
@ -251,7 +251,7 @@ int tentec_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
priv->ftf >> 8, priv->ftf & 0xff,
priv->btf >> 8, priv->btf & 0xff);
retval = write_block(&rs->rigport, freqbuf, freq_len);
retval = write_block(&rs->rigport, (unsigned char *) freqbuf, freq_len);
if (retval != RIG_OK)
{
@ -352,7 +352,7 @@ int tentec_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
priv->ftf >> 8, priv->ftf & 0xff,
priv->btf >> 8, priv->btf & 0xff,
ttmode);
retval = write_block(&rs->rigport, mdbuf, mdbuf_len);
retval = write_block(&rs->rigport, (unsigned char *) mdbuf, mdbuf_len);
if (retval != RIG_OK)
{
@ -370,7 +370,7 @@ int tentec_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
priv->ftf >> 8, priv->ftf & 0xff,
priv->btf >> 8, priv->btf & 0xff,
ttmode);
retval = write_block(&rs->rigport, mdbuf, mdbuf_len);
retval = write_block(&rs->rigport, (unsigned char *) mdbuf, mdbuf_len);
if (retval != RIG_OK)
{
@ -419,7 +419,7 @@ int tentec_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
cmd_len = sprintf(cmdbuf, "G%c" EOM,
val.i == RIG_AGC_SLOW ? '1' : (
val.i == RIG_AGC_FAST ? '3' : '2'));
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval == RIG_OK)
{
@ -433,7 +433,7 @@ int tentec_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
* -> need to create RIG_LEVEL_LINEOUT ?
*/
cmd_len = sprintf(cmdbuf, "C\x7f%c" EOM, (int)((1.0 - val.f) * 63.0));
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval == RIG_OK)
{

Wyświetl plik

@ -86,7 +86,7 @@ tt550_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -103,7 +103,7 @@ tt550_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
return 0;
}
retval = read_string(&rs->rigport, data, *data_len, NULL, 0, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, *data_len, NULL, 0, 0, 1);
if (retval == -RIG_ETIMEOUT)
{
@ -138,7 +138,7 @@ tt550_tx_control(RIG *rig, char oper)
char cmdbuf[4];
cmd_len = sprintf(cmdbuf, "#%c" EOM, oper);
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
/*
* if (retval == RIG_OK) not currently saving the state of these operations I'm
* not sure we need to, but if so, this is where it would go.
@ -624,7 +624,7 @@ tt550_set_rx_freq(RIG *rig, vfo_t vfo, freq_t freq)
priv->ctf >> 8, priv->ctf & 0xff, priv->ftf >> 8,
priv->ftf & 0xff, priv->btf >> 8, priv->btf & 0xff);
retval = write_block(&rs->rigport, freqbuf, freq_len);
retval = write_block(&rs->rigport, (unsigned char *) freqbuf, freq_len);
if (retval != RIG_OK)
{
@ -658,7 +658,7 @@ tt550_set_tx_freq(RIG *rig, vfo_t vfo, freq_t freq)
priv->ctf >> 8, priv->ctf & 0xff, priv->ftf >> 8,
priv->ftf & 0xff, priv->btf >> 8, priv->btf & 0xff);
retval = write_block(&rs->rigport, freqbuf, freq_len);
retval = write_block(&rs->rigport, (unsigned char *) freqbuf, freq_len);
if (retval != RIG_OK)
{
@ -768,7 +768,7 @@ tt550_set_rx_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
tt550_tuning_factor_calc(rig, RECEIVE);
mdbuf_len = sprintf(mdbuf, "M%c%c" EOM, ttmode, ttmode);
retval = write_block(&rs->rigport, mdbuf, mdbuf_len);
retval = write_block(&rs->rigport, (unsigned char *) mdbuf, mdbuf_len);
if (retval != RIG_OK)
{
@ -784,7 +784,7 @@ tt550_set_rx_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
ttfilter,
priv->ctf >> 8, priv->ctf & 0xff, priv->ftf >> 8,
priv->ftf & 0xff, priv->btf >> 8, priv->btf & 0xff);
retval = write_block(&rs->rigport, mdbuf, mdbuf_len);
retval = write_block(&rs->rigport, (unsigned char *) mdbuf, mdbuf_len);
if (retval != RIG_OK)
{
@ -901,7 +901,7 @@ tt550_set_tx_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
tt550_tuning_factor_calc(rig, TRANSMIT);
mdbuf_len = sprintf(mdbuf, "M%c%c" EOM, ttmode, ttmode);
retval = write_block(&rs->rigport, mdbuf, mdbuf_len);
retval = write_block(&rs->rigport, (unsigned char *) mdbuf, mdbuf_len);
if (retval != RIG_OK)
{
@ -917,7 +917,7 @@ tt550_set_tx_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
ttfilter,
priv->ctf >> 8, priv->ctf & 0xff, priv->ftf >> 8,
priv->ftf & 0xff, priv->btf >> 8, priv->btf & 0xff);
retval = write_block(&rs->rigport, mdbuf, mdbuf_len);
retval = write_block(&rs->rigport, (unsigned char *) mdbuf, mdbuf_len);
if (retval != RIG_OK)
{
@ -1016,7 +1016,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
cmd_len =
sprintf(cmdbuf, "G%c" EOM,
val.i >= 3 ? '3' : (val.i < 2 ? '1' : '2'));
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval == RIG_OK)
{
@ -1027,7 +1027,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_AF:
cmd_len = sprintf(cmdbuf, "V%c" EOM, (int)(val.f * 255));
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval == RIG_OK)
{
@ -1051,7 +1051,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_RF:
cmd_len = sprintf(cmdbuf, "A%c" EOM, (int)(val.f * 255));
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval == RIG_OK)
{
@ -1062,7 +1062,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_SQL:
cmd_len = sprintf(cmdbuf, "S%c" EOM, (int)(val.f * 19));
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval == RIG_OK)
{
@ -1073,7 +1073,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_NR:
cmd_len = sprintf(cmdbuf, "D%c" EOM, (int)(val.f * 7));
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval == RIG_OK)
{
@ -1087,7 +1087,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
* attenuator is either on or off
*/
cmd_len = sprintf(cmdbuf, "B%c" EOM, val.i < 15 ? '0' : '1');
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval == RIG_OK)
{
@ -1106,7 +1106,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
ditfactor >> 8, ditfactor & 0xff, dahfactor >> 8,
dahfactor & 0xff, spcfactor >> 8,
spcfactor & 0xff);
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval == RIG_OK)
{
@ -1117,7 +1117,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_RFPOWER:
cmd_len = sprintf(cmdbuf, "P%c" EOM, (int)(val.f * 255));
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval == RIG_OK)
{
@ -1128,7 +1128,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_VOXGAIN:
cmd_len = sprintf(cmdbuf, "UG%c" EOM, (int)(val.f * 255));
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval == RIG_OK)
{
@ -1139,7 +1139,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_VOXDELAY:
cmd_len = sprintf(cmdbuf, "UH%c" EOM, (int)(val.f * 255));
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval == RIG_OK)
{
@ -1150,7 +1150,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_ANTIVOX:
cmd_len = sprintf(cmdbuf, "UA%c" EOM, (int)(val.f * 255));
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval == RIG_OK)
{
@ -1161,7 +1161,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_COMP:
cmd_len = sprintf(cmdbuf, "Y%c" EOM, (int)(val.f * 127));
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval == RIG_OK)
{
@ -1172,7 +1172,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_MICGAIN:
cmd_len = sprintf(cmdbuf, "O1%c%c" EOM, 0, (int)(val.f * 15));
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval == RIG_OK)
{
@ -1183,7 +1183,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_BKINDL:
cmd_len = sprintf(cmdbuf, "UQ%c" EOM, (int)(val.f * 255));
retval = write_block(&rs->rigport, cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval == RIG_OK)
{
@ -1386,7 +1386,7 @@ tt550_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
char cmdbuf[16];
cmd_len = sprintf(cmdbuf, "Q%c" EOM, ptt == 0 ? '0' : '1');
return (write_block(&rs->rigport, cmdbuf, cmd_len));
return (write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len));
}
@ -1468,21 +1468,21 @@ tt550_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
fct_len =
sprintf((char *) fctbuf, "U%c" EOM, status == 0 ? '0' : '1');
priv->vox = status;
return write_block(&rs->rigport, (char *) fctbuf, fct_len);
return write_block(&rs->rigport, fctbuf, fct_len);
case RIG_FUNC_NR:
fct_len =
sprintf((char *) fctbuf, "K%c%c" EOM, status == 0 ? '0' : '1',
priv->anf == 0 ? '0' : '1');
priv->en_nr = status;
return write_block(&rs->rigport, (char *) fctbuf, fct_len);
return write_block(&rs->rigport, fctbuf, fct_len);
case RIG_FUNC_ANF:
fct_len =
sprintf((char *) fctbuf, "K%c%c" EOM, priv->en_nr == 0 ? '0' : '1',
status == 0 ? '0' : '1');
priv->anf = status;
return write_block(&rs->rigport, (char *) fctbuf, fct_len);
return write_block(&rs->rigport, fctbuf, fct_len);
case RIG_FUNC_TUNER:
@ -1699,7 +1699,7 @@ tt550_decode_event(RIG *rig)
priv = (struct tt550_priv_data *) rs->priv;
data_len = read_string(&rs->rigport, (char *) buf, MAXFRAMELEN, "\n\r", 2, 0,
data_len = read_string(&rs->rigport, buf, MAXFRAMELEN, "\n\r", 2, 0,
1);

Wyświetl plik

@ -136,7 +136,7 @@ transaction_write:
if (cmdstr)
{
retval = write_block(&rs->rigport, cmdstr, strlen(cmdstr));
retval = write_block(&rs->rigport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
@ -156,7 +156,7 @@ transaction_write:
}
memset(data, 0, *datasize);
retval = read_string(&rs->rigport, data, *datasize, EOM, strlen(EOM), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, *datasize, EOM, strlen(EOM), 0, 1);
if (retval < 0)
{
@ -837,8 +837,8 @@ DECLARE_PROBERIG_BACKEND(uniden)
return RIG_MODEL_NONE;
}
retval = write_block(port, "SI"EOM, 3);
id_len = read_string(port, idbuf, IDBUFSZ, EOM, 1, 0, 1);
retval = write_block(port, (unsigned char *) "SI"EOM, 3);
id_len = read_string(port, (unsigned char *) idbuf, IDBUFSZ, EOM, 1, 0, 1);
close(port->fd);
if (retval != RIG_OK || id_len < 0)

Wyświetl plik

@ -118,7 +118,7 @@ transaction_write:
if (cmdstr)
{
retval = write_block(&rs->rigport, cmdstr, strlen(cmdstr));
retval = write_block(&rs->rigport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
@ -138,7 +138,7 @@ transaction_write:
}
memset(data, 0, *datasize);
retval = read_string(&rs->rigport, data, *datasize, EOM, strlen(EOM), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, *datasize, EOM, strlen(EOM), 0, 1);
if (retval < 0)
{

Wyświetl plik

@ -179,7 +179,7 @@ static int wj_transaction(RIG *rig, int monitor)
rig_flush(&rig->state.rigport);
retval = write_block(&rig->state.rigport, (char *) buf, CMDSZ);
retval = write_block(&rig->state.rigport, buf, CMDSZ);
if (retval != RIG_OK)
{
@ -191,7 +191,7 @@ static int wj_transaction(RIG *rig, int monitor)
/*
* Transceiver sends back ">"
*/
retval = read_block(&rig->state.rigport, (char *) rxbuf, CMDSZ);
retval = read_block(&rig->state.rigport, rxbuf, CMDSZ);
if (retval < 0 || retval > CMDSZ)
{

Wyświetl plik

@ -268,11 +268,11 @@ static int frg100_do_transaction(RIG *rig,
memset(retbuf, 0, retbuf_len);
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, (const char *)cmd, YAESU_CMD_LENGTH);
retval = write_block(&rs->rigport, cmd, YAESU_CMD_LENGTH);
if (retval != RIG_OK) { return retval; }
retval = read_block(&rs->rigport, (char *)retbuf, retbuf_len);
retval = read_block(&rs->rigport, retbuf, retbuf_len);
if (retval != retbuf_len)
{
@ -354,7 +354,7 @@ int frg100_open(RIG *rig)
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
/* send 0 delay pacing */
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -373,7 +373,7 @@ int frg100_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
to_bcd(cmd, freq / 10, 8);
/* Frequency set */
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -385,7 +385,7 @@ int frg100_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
/* fill in p1 */
cmd[3] = mode2rig(rig, mode, width);
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -401,7 +401,7 @@ int frg100_set_powerstat(RIG *rig, powerstat_t status)
cmd[3] = status == RIG_POWER_OFF ? 0x00 : 0x01;
/* Frequency set */
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -429,7 +429,7 @@ int frg100_set_vfo(RIG *rig, vfo_t vfo)
return -RIG_EINVAL; /* sorry, wrong VFO */
}
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -446,7 +446,7 @@ int frg100_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
rig_flush(&rig->state.rigport);
/* send READ STATUS(Meter only) cmd to rig */
retval = write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
if (retval < 0)
{
@ -454,7 +454,7 @@ int frg100_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
}
/* read back the 1 byte */
retval = read_block(&rig->state.rigport, (char *) cmd, 5);
retval = read_block(&rig->state.rigport, cmd, 5);
if (retval < 1)
{

Wyświetl plik

@ -163,7 +163,7 @@ int frg8800_open(RIG *rig)
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
/* send Ext Cntl ON: Activate CAT */
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -174,7 +174,7 @@ int frg8800_close(RIG *rig)
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
/* send Ext Cntl OFF: Deactivate CAT */
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -192,7 +192,7 @@ int frg8800_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
cmd[0] = (cmd[0] & 0xf0) | (1 << ((((long long)freq) % 100) / 25));
/* Frequency set */
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -235,7 +235,7 @@ int frg8800_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
cmd[3] = md;
/* Mode set */
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -249,6 +249,6 @@ int frg8800_set_powerstat(RIG *rig, powerstat_t status)
cmd[3] = status == RIG_POWER_OFF ? 0xff : 0xfe;
/* Frequency set */
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}

Wyświetl plik

@ -151,7 +151,7 @@ int frg9600_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
to_bcd_be(cmd + 1, freq / 10, 8);
/* Frequency set */
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -194,6 +194,6 @@ int frg9600_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
cmd[0] = md;
/* Mode set */
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}

Wyświetl plik

@ -527,7 +527,7 @@ static int ft100_send_priv_cmd(RIG *rig, unsigned char cmd_index)
if (!rig) { return -RIG_EINVAL; }
return write_block(&rig->state.rigport, (char *) &ncmd[cmd_index].nseq,
return write_block(&rig->state.rigport, (unsigned char *) &ncmd[cmd_index].nseq,
YAESU_CMD_LENGTH);
}
@ -549,9 +549,7 @@ static int ft100_read_status(RIG *rig)
return ret;
}
ret = read_block(&rig->state.rigport,
(char *)&priv->status,
sizeof(FT100_STATUS_INFO));
ret = read_block(&rig->state.rigport, (unsigned char *) &priv->status, sizeof(FT100_STATUS_INFO));
rig_debug(RIG_DEBUG_VERBOSE, "%s: read status=%i \n", __func__, ret);
if (ret < 0)
@ -578,9 +576,7 @@ static int ft100_read_flags(RIG *rig)
return ret;
}
ret = read_block(&rig->state.rigport,
(char *)&priv->flags,
sizeof(FT100_FLAG_INFO));
ret = read_block(&rig->state.rigport, (unsigned char *) &priv->flags, sizeof(FT100_FLAG_INFO));
rig_debug(RIG_DEBUG_VERBOSE, "%s: read flags=%i \n", __func__, ret);
if (ret < 0)
@ -605,10 +601,10 @@ int ft100_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
memcpy(p_cmd, &ncmd[cmd_index].nseq, YAESU_CMD_LENGTH);
/* fixed 10Hz bug by OH2MMY */
freq = (int)freq / 10;
freq = (int) freq / 10;
to_bcd(p_cmd, freq, 8); /* store bcd format in in p_cmd */
return write_block(&rig->state.rigport, (char *) p_cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, p_cmd, YAESU_CMD_LENGTH);
}
int ft100_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
@ -734,7 +730,7 @@ int ft100_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
else if (width <= 2400) { p_cmd[3] = 0x00; }
else { p_cmd[3] = 0x01; }
ret = write_block(&rig->state.rigport, (char *) p_cmd, YAESU_CMD_LENGTH);
ret = write_block(&rig->state.rigport, p_cmd, YAESU_CMD_LENGTH);
if (ret != RIG_OK)
{
@ -994,8 +990,7 @@ int ft100_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
return ret;
}
ret = read_block(&rig->state.rigport, (char *)&ft100_meter,
sizeof(FT100_METER_INFO));
ret = read_block(&rig->state.rigport, (unsigned char *) &ft100_meter, sizeof(FT100_METER_INFO));
rig_debug(RIG_DEBUG_VERBOSE, "%s: read meters=%d\n", __func__, ret);
if (ret < 0)
@ -1211,7 +1206,7 @@ int ft100_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code)
p_cmd[3] = (char)pcode;
return write_block(&rig->state.rigport, (char *) p_cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, p_cmd, YAESU_CMD_LENGTH);
}
int ft100_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code)
@ -1265,7 +1260,7 @@ int ft100_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
p_cmd[3] = (char)ptone;
return write_block(&rig->state.rigport, (char *) p_cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, p_cmd, YAESU_CMD_LENGTH);
}
int ft100_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)

Wyświetl plik

@ -2495,8 +2495,7 @@ static int ft1000d_get_level(RIG *rig, vfo_t vfo, setting_t level,
return err;
}
err = read_block(&rig->state.rigport, (char *) mdata,
FT1000D_READ_METER_LENGTH);
err = read_block(&rig->state.rigport, mdata,FT1000D_READ_METER_LENGTH);
if (err < 0)
{
@ -3305,8 +3304,8 @@ static int ft1000d_get_update_data(RIG *rig, unsigned char ci,
int err;
int rl;
int retry;
char temp[5];
char *p;
unsigned char temp[5];
unsigned char *p;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
rig_debug(RIG_DEBUG_TRACE, "%s: passed ci 0x%02x\n", __func__, ci);
@ -3342,7 +3341,7 @@ static int ft1000d_get_update_data(RIG *rig, unsigned char ci,
switch (ci)
{
case FT1000D_NATIVE_UPDATE_ALL_DATA:
p = (char *) &priv->update_data;
p = (unsigned char *) &priv->update_data;
rl = FT1000D_ALL_DATA_LENGTH;
/* FT1000D */
@ -3354,12 +3353,12 @@ static int ft1000d_get_update_data(RIG *rig, unsigned char ci,
break;
case FT1000D_NATIVE_UPDATE_MEM_CHNL:
p = (char *) &priv->update_data.channelnumber;
p = (unsigned char *) &priv->update_data.channelnumber;
rl = FT1000D_MEM_CHNL_LENGTH;
break;
case FT1000D_NATIVE_UPDATE_OP_DATA:
p = (char *) &priv->update_data.current_front;
p = (unsigned char *) &priv->update_data.current_front;
rl = FT1000D_OP_DATA_LENGTH;
/* FT1000D */
@ -3371,12 +3370,12 @@ static int ft1000d_get_update_data(RIG *rig, unsigned char ci,
break;
case FT1000D_NATIVE_UPDATE_VFO_DATA:
p = (char *) &priv->update_data.vfoa;
p = (unsigned char *) &priv->update_data.vfoa;
rl = FT1000D_VFO_DATA_LENGTH;
break;
case FT1000D_NATIVE_UPDATE_MEM_CHNL_DATA:
p = (char *) &priv->update_data.channel[ch];
p = (unsigned char *) &priv->update_data.channel[ch];
rl = FT1000D_MEM_CHNL_DATA_LENGTH;
break;
@ -3439,7 +3438,7 @@ static int ft1000d_send_static_cmd(RIG *rig, unsigned char ci)
return -RIG_EINVAL;
}
err = write_block(&rig->state.rigport, (char *) ncmd[ci].nseq,
err = write_block(&rig->state.rigport, ncmd[ci].nseq,
YAESU_CMD_LENGTH);
if (err != RIG_OK)
@ -3500,8 +3499,7 @@ static int ft1000d_send_dynamic_cmd(RIG *rig, unsigned char ci,
priv->p_cmd[1] = p3;
priv->p_cmd[0] = p4;
err = write_block(&rig->state.rigport, (char *) &priv->p_cmd,
YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -3559,8 +3557,7 @@ static int ft1000d_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
rig_debug(RIG_DEBUG_TRACE, fmt, __func__, (int64_t)from_bcd(priv->p_cmd,
FT1000D_BCD_DIAL) * 10);
err = write_block(&rig->state.rigport, (char *) &priv->p_cmd,
YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -3625,8 +3622,7 @@ static int ft1000d_send_rit_freq(RIG *rig, unsigned char ci, shortfreq_t rit)
// Store bcd format into privat command storage area
to_bcd(priv->p_cmd, labs(rit) / 10, FT1000D_BCD_RIT);
err = write_block(&rig->state.rigport, (char *) &priv->p_cmd,
YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{

Wyświetl plik

@ -799,7 +799,7 @@ static int ft1000mp_open(RIG *rig)
/* send PACING cmd to rig */
cmd = p->p_cmd;
write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
ft1000mp_get_vfo(rig, &rig->state.current_vfo);
/* TODO */
@ -861,7 +861,7 @@ static int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
(freq_t)from_bcd(p->p_cmd, 8) * 10);
cmd = p->p_cmd; /* get native sequence */
write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
RETURNFUNC(RIG_OK);
}
@ -1308,7 +1308,7 @@ static int ft1000mp_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
cmd = priv->p_cmd;
write_block(&rs->rigport, (char *) cmd, YAESU_CMD_LENGTH);
write_block(&rs->rigport, cmd, YAESU_CMD_LENGTH);
RETURNFUNC(RIG_OK);
case RIG_FUNC_XIT:
@ -1323,7 +1323,7 @@ static int ft1000mp_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
cmd = priv->p_cmd;
write_block(&rs->rigport, (char *) cmd, YAESU_CMD_LENGTH);
write_block(&rs->rigport, cmd, YAESU_CMD_LENGTH);
RETURNFUNC(RIG_OK);
default:
@ -1465,7 +1465,7 @@ static int ft1000mp_set_rxit(RIG *rig, vfo_t vfo, shortfreq_t rit)
priv->p_cmd[2] = direction;
cmd = priv->p_cmd; /* get native sequence */
write_block(&rs->rigport, (char *) cmd, YAESU_CMD_LENGTH);
write_block(&rs->rigport, cmd, YAESU_CMD_LENGTH);
RETURNFUNC(RIG_OK);
}
@ -1590,9 +1590,9 @@ static int ft1000mp_get_level(RIG *rig, vfo_t vfo, setting_t level,
do
{
write_block(&rs->rigport, (char *) priv->p_cmd, YAESU_CMD_LENGTH);
write_block(&rs->rigport, priv->p_cmd, YAESU_CMD_LENGTH);
retval = read_block(&rs->rigport, (char *) lvl_data, YAESU_CMD_LENGTH);
retval = read_block(&rs->rigport, lvl_data, YAESU_CMD_LENGTH);
}
while (retry-- && retval == -RIG_ETIMEOUT);
@ -1667,7 +1667,7 @@ static int ft1000mp_get_update_data(RIG *rig, unsigned char ci,
/* send UPDATE command to fetch data*/
ft1000mp_send_priv_cmd(rig, ci);
n = read_block(&rig->state.rigport, (char *) p->update_data, rl);
n = read_block(&rig->state.rigport, p->update_data, rl);
if (n == -RIG_ETIMEOUT)
{
@ -1696,7 +1696,7 @@ static int ft1000mp_send_priv_cmd(RIG *rig, unsigned char ci)
RETURNFUNC(-RIG_EINVAL);
}
write_block(&rig->state.rigport, (char *) ncmd[ci].nseq, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, ncmd[ci].nseq, YAESU_CMD_LENGTH);
RETURNFUNC(RIG_OK);

Wyświetl plik

@ -397,8 +397,7 @@ static int ft600_send_priv_cmd(RIG *rig, unsigned char cmd_index)
if (!rig) { return -RIG_EINVAL; }
return write_block(&rig->state.rigport, (char *) &ncmd[cmd_index].nseq,
YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, (unsigned char *) &ncmd[cmd_index].nseq, YAESU_CMD_LENGTH);
}
static int ft600_read_status(RIG *rig)
@ -420,11 +419,8 @@ static int ft600_read_status(RIG *rig)
}
ret = read_block(
&rig->state.rigport,
(char *)&priv->status
, FT600_STATUS_UPDATE_DATA_LENGTH
);
ret = read_block(&rig->state.rigport,
(unsigned char *) &priv->status, FT600_STATUS_UPDATE_DATA_LENGTH);
rig_debug(RIG_DEBUG_VERBOSE, "%s: read status=%i \n", __func__, ret);
@ -455,9 +451,7 @@ static int ft600_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
rig_debug(RIG_DEBUG_VERBOSE, "%s: read tx status=%i \n", __func__, ret);
ret = read_block(&rig->state.rigport,
(char *)&priv->s_meter,
5);
ret = read_block(&rig->state.rigport, &priv->s_meter, 5);
if (ret < 0)
{
@ -488,7 +482,7 @@ static int ft600_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
freq = (int)freq / 10;
to_bcd(p_cmd, freq, 8); /* store bcd format in in p_cmd */
return write_block(&rig->state.rigport, (char *) p_cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, p_cmd, YAESU_CMD_LENGTH);
}
static int ft600_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
@ -656,7 +650,7 @@ static int ft600_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
else if (width <= 2400) { p_cmd[3] = 0x00; }
else { p_cmd[3] = 0x01; }
ret = write_block(&rig->state.rigport, (char *) p_cmd, YAESU_CMD_LENGTH);
ret = write_block(&rig->state.rigport, p_cmd, YAESU_CMD_LENGTH);
if (ret != RIG_OK)
{

Wyświetl plik

@ -239,7 +239,7 @@ int ft736_open(RIG *rig)
/* send Ext Cntl ON: Activate CAT */
ret = write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
ret = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
if (ret != RIG_OK)
{
@ -258,7 +258,7 @@ int ft736_close(RIG *rig)
free(rig->state.priv);
/* send Ext Cntl OFF: Deactivate CAT */
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -283,7 +283,7 @@ int ft736_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
}
/* Frequency set */
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -337,7 +337,7 @@ int ft736_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
cmd[0] = md;
/* Mode set */
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -354,7 +354,7 @@ int ft736_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
*/
cmd[4] = split == RIG_SPLIT_ON ? 0x0e : 0x8e;
ret = write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
ret = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
if (ret == RIG_OK)
{
@ -382,7 +382,7 @@ int ft736_set_split_freq(RIG *rig, vfo_t vfo, freq_t freq)
}
/* Frequency set */
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -423,7 +423,7 @@ int ft736_set_split_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
cmd[0] = md;
/* Mode set */
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -436,7 +436,7 @@ int ft736_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
cmd[4] = ptt == RIG_PTT_ON ? 0x08 : 0x88;
/* Tx/Rx set */
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
int ft736_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
@ -446,7 +446,7 @@ int ft736_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
rig_flush(&rig->state.rigport);
retval = write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
if (retval < 0)
{
@ -454,7 +454,7 @@ int ft736_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
}
/* read back the 1 byte */
retval = read_block(&rig->state.rigport, (char *) cmd, 5);
retval = read_block(&rig->state.rigport, cmd, 5);
if (retval < 1)
{
@ -482,7 +482,7 @@ int ft736_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
rig_flush(&rig->state.rigport);
/* send Test S-meter cmd to rig */
retval = write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
if (retval < 0)
{
@ -490,7 +490,7 @@ int ft736_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
}
/* read back the 1 byte */
retval = read_block(&rig->state.rigport, (char *) cmd, 5);
retval = read_block(&rig->state.rigport, cmd, 5);
if (retval < 1)
{
@ -532,7 +532,7 @@ int ft736_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t shift)
return -RIG_EINVAL;
}
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
int ft736_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs)
@ -543,7 +543,7 @@ int ft736_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs)
to_bcd_be(cmd, offs / 10, 8);
/* Offset set */
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
int ft736_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
@ -564,7 +564,7 @@ int ft736_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
return -RIG_EINVAL;
}
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
int ft736_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
@ -587,7 +587,7 @@ int ft736_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
cmd[0] = 0x3e - i;
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
int ft736_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone)

Wyświetl plik

@ -511,7 +511,7 @@ int ft747_open(RIG *rig)
/* send PACING cmd to rig, once for all */
ret = write_block(&rig->state.rigport, (char *)p->p_cmd, YAESU_CMD_LENGTH);
ret = write_block(&rig->state.rigport, p->p_cmd, YAESU_CMD_LENGTH);
if (ret < 0)
{
@ -571,7 +571,7 @@ int ft747_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
rig_force_cache_timeout(&p->status_tv);
cmd = p->p_cmd; /* get native sequence */
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -949,7 +949,7 @@ int ft747_set_mem(RIG *rig, vfo_t vfo, int ch)
rig_force_cache_timeout(&p->status_tv);
return write_block(&rig->state.rigport, (char *) p->p_cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, p->p_cmd, YAESU_CMD_LENGTH);
}
int ft747_get_mem(RIG *rig, vfo_t vfo, int *ch)
@ -991,7 +991,7 @@ static int ft747_get_update_data(RIG *rig)
{
hamlib_port_t *rigport;
struct ft747_priv_data *p;
char last_byte;
unsigned char last_byte;
p = (struct ft747_priv_data *)rig->state.priv;
rigport = &rig->state.rigport;
@ -1016,7 +1016,7 @@ static int ft747_get_update_data(RIG *rig)
return ret;
}
ret = read_block(rigport, (char *) p->update_data,
ret = read_block(rigport, p->update_data,
FT747_STATUS_UPDATE_DATA_LENGTH);
if (ret < 0)
@ -1045,15 +1045,14 @@ static int ft747_get_update_data(RIG *rig)
static int ft747_send_priv_cmd(RIG *rig, unsigned char ci)
{
if (! ft747_ncmd[ci].ncomp)
if (!ft747_ncmd[ci].ncomp)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: attempt to send incomplete sequence\n",
__func__);
return -RIG_EINVAL;
}
return write_block(&rig->state.rigport, (char *) ft747_ncmd[ci].nseq,
YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, ft747_ncmd[ci].nseq, YAESU_CMD_LENGTH);
}

Wyświetl plik

@ -451,7 +451,7 @@ static int ft757_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
to_bcd(cmd, freq / 10, BCD_LEN);
priv->curfreq = freq;
return write_block(&rig->state.rigport, (char *)cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -477,7 +477,7 @@ static int ft757_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
/* fill in p1 */
cmd[3] = mode2rig(rig, mode, width);
return write_block(&rig->state.rigport, (char *)cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -605,7 +605,7 @@ static int ft757_set_vfo(RIG *rig, vfo_t vfo)
priv->current_vfo = vfo;
return write_block(&rig->state.rigport, (char *)cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -679,7 +679,7 @@ static int ft757_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
rig_flush(&rig->state.rigport);
/* send READ STATUS(Meter only) cmd to rig */
retval = write_block(&rig->state.rigport, (char *)cmd, YAESU_CMD_LENGTH);
retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
if (retval < 0)
{
@ -687,7 +687,7 @@ static int ft757_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
}
/* read back the 1 byte */
retval = read_block(&rig->state.rigport, (char *)cmd, 1);
retval = read_block(&rig->state.rigport, cmd, 1);
if (retval != 1)
{
@ -729,7 +729,7 @@ static int ft757_get_update_data(RIG *rig)
rig_flush(&rig->state.rigport);
/* send READ STATUS cmd to rig */
retval = write_block(&rig->state.rigport, (char *)cmd, YAESU_CMD_LENGTH);
retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
if (retval < 0)
{
@ -738,7 +738,7 @@ static int ft757_get_update_data(RIG *rig)
/* read back the 75 status bytes */
retval = read_block(&rig->state.rigport,
(char *)priv->update_data,
priv->update_data,
FT757GX_STATUS_UPDATE_DATA_LENGTH);
if (retval == FT757GX_STATUS_UPDATE_DATA_LENGTH)

Wyświetl plik

@ -1477,11 +1477,11 @@ int ft767_send_block_and_ack(RIG *rig, unsigned char *cmd, size_t length)
}
/* send the command block */
write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
/* read back the command block echo */
retval = read_block(&rig->state.rigport,
(char *) cmd_echo_buf,
cmd_echo_buf,
YAESU_CMD_LENGTH);
if (retval < 0)
@ -1500,11 +1500,11 @@ int ft767_send_block_and_ack(RIG *rig, unsigned char *cmd, size_t length)
}
/* send the ACK */
write_block(&rig->state.rigport, (char *) priv->ack_cmd, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, priv->ack_cmd, YAESU_CMD_LENGTH);
/* read back the response (status bytes) */
retval = read_block(&rig->state.rigport,
(char *) priv->rx_data,
priv->rx_data,
replylen);
// update data

Wyświetl plik

@ -683,9 +683,9 @@ static int ft817_read_eeprom(RIG *rig, unsigned short addr, unsigned char *out)
data[0] = addr >> 8;
data[1] = addr & 0xfe;
write_block(&rig->state.rigport, (char *) data, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, data, YAESU_CMD_LENGTH);
if ((n = read_block(&rig->state.rigport, (char *) data, 2)) < 0)
if ((n = read_block(&rig->state.rigport, data, 2)) < 0)
{
return n;
}
@ -748,9 +748,9 @@ static int ft817_get_status(RIG *rig, int status)
do
{
rig_flush(&rig->state.rigport);
write_block(&rig->state.rigport, (char *) ncmd[status].nseq,
write_block(&rig->state.rigport, ncmd[status].nseq,
YAESU_CMD_LENGTH);
n = read_block(&rig->state.rigport, (char *) data, len);
n = read_block(&rig->state.rigport, data, len);
}
while (retries-- && n < 0);
@ -1313,7 +1313,7 @@ static int ft818_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option,
int ft817_read_ack(RIG *rig)
{
char dummy;
unsigned char dummy;
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
if (rig->state.rigport.post_write_delay == 0)
@ -1354,7 +1354,7 @@ static int ft817_send_cmd(RIG *rig, int index)
}
rig_flush(&rig->state.rigport);
write_block(&rig->state.rigport, (char *) ncmd[index].nseq, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, ncmd[index].nseq, YAESU_CMD_LENGTH);
return ft817_read_ack(rig);
}
@ -1376,7 +1376,7 @@ static int ft817_send_icmd(RIG *rig, int index, unsigned char *data)
cmd[YAESU_CMD_LENGTH - 1] = ncmd[index].nseq[YAESU_CMD_LENGTH - 1];
memcpy(cmd, data, YAESU_CMD_LENGTH - 1);
write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
return ft817_read_ack(rig);
}
@ -1800,9 +1800,9 @@ int ft817_set_powerstat(RIG *rig, powerstat_t status)
case RIG_POWER_ON:
// send 5 bytes first, snooze a bit, then PWR_ON
write_block(&rig->state.rigport,
(char *) ncmd[FT817_NATIVE_CAT_PWR_WAKE].nseq, YAESU_CMD_LENGTH);
ncmd[FT817_NATIVE_CAT_PWR_WAKE].nseq, YAESU_CMD_LENGTH);
hl_usleep(200 * 1000);
write_block(&rig->state.rigport, (char *) ncmd[FT817_NATIVE_CAT_PWR_ON].nseq,
write_block(&rig->state.rigport, ncmd[FT817_NATIVE_CAT_PWR_ON].nseq,
YAESU_CMD_LENGTH);
return RIG_OK;

Wyświetl plik

@ -1749,7 +1749,7 @@ static int ft840_get_update_data(RIG *rig, unsigned char ci, unsigned char rl)
return err;
}
n = read_block(&rig->state.rigport, (char *) priv->update_data, rl);
n = read_block(&rig->state.rigport, priv->update_data, rl);
if (n < 0)
{
@ -1792,7 +1792,7 @@ static int ft840_send_static_cmd(RIG *rig, unsigned char ci)
return -RIG_EINVAL;
}
err = write_block(&rig->state.rigport, (char *) ncmd[ci].nseq,
err = write_block(&rig->state.rigport, ncmd[ci].nseq,
YAESU_CMD_LENGTH);
if (err != RIG_OK)
@ -1853,8 +1853,7 @@ static int ft840_send_dynamic_cmd(RIG *rig, unsigned char ci,
priv->p_cmd[P3] = p3;
priv->p_cmd[P4] = p4;
err = write_block(&rig->state.rigport, (char *) &priv->p_cmd,
YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -1914,8 +1913,7 @@ static int ft840_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
rig_debug(RIG_DEBUG_TRACE, fmt, __func__, (int64_t)from_bcd(priv->p_cmd,
FT840_BCD_DIAL) * 10);
err = write_block(&rig->state.rigport, (char *) &priv->p_cmd,
YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{

Wyświetl plik

@ -949,7 +949,7 @@ static int ft847_send_priv_cmd(RIG *rig, int cmd_index)
return -RIG_EINVAL;
}
return write_block(&rig->state.rigport, (char *) ncmd[cmd_index].nseq,
return write_block(&rig->state.rigport, ncmd[cmd_index].nseq,
YAESU_CMD_LENGTH);
}
@ -1043,7 +1043,7 @@ static int ft847_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
}
}
return write_block(&rig->state.rigport, (char *)p_cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, p_cmd, YAESU_CMD_LENGTH);
}
#define MD_LSB 0x00
@ -1100,14 +1100,14 @@ static int get_freq_and_mode(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode,
return n;
}
n = write_block(&rs->rigport, (char *) p_cmd, YAESU_CMD_LENGTH);
n = write_block(&rs->rigport, p_cmd, YAESU_CMD_LENGTH);
if (n < 0)
{
return n;
}
n = read_block(&rs->rigport, (char *) data, YAESU_CMD_LENGTH);
n = read_block(&rs->rigport, data, YAESU_CMD_LENGTH);
if (n != YAESU_CMD_LENGTH)
{
@ -1297,7 +1297,7 @@ static int ft847_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
return ret;
}
return write_block(&rs->rigport, (char *)p_cmd, YAESU_CMD_LENGTH);
return write_block(&rs->rigport, p_cmd, YAESU_CMD_LENGTH);
}
static int ft847_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
@ -1453,7 +1453,7 @@ static int ft847_get_status(RIG *rig, int status_ci)
rig_flush(&rig->state.rigport);
n = write_block(&rig->state.rigport, (char *) ncmd[status_ci].nseq,
n = write_block(&rig->state.rigport, ncmd[status_ci].nseq,
YAESU_CMD_LENGTH);
if (n < 0)
@ -1461,7 +1461,7 @@ static int ft847_get_status(RIG *rig, int status_ci)
return n;
}
n = read_block(&rig->state.rigport, (char *) data, len);
n = read_block(&rig->state.rigport, data, len);
if (n < 0)
{
@ -1703,7 +1703,7 @@ static int ft847_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
return ret;
}
return write_block(&rig->state.rigport, (char *)p_cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, p_cmd, YAESU_CMD_LENGTH);
}
@ -1748,7 +1748,7 @@ static int ft847_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
/* get associated CAT code */
p_cmd[0] = ft847_ctcss_cat[i];
return write_block(&rig->state.rigport, (char *)p_cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, p_cmd, YAESU_CMD_LENGTH);
}
static int ft847_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone)
@ -1774,7 +1774,7 @@ static int ft847_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code)
/* DCS Code # (i.e. 07, 54=DCS Code 754) */
to_bcd_be(p_cmd, code, 4); /* store bcd format in in p_cmd */
return write_block(&rig->state.rigport, (char *)p_cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, p_cmd, YAESU_CMD_LENGTH);
}
@ -1817,6 +1817,6 @@ static int ft847_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs)
to_bcd_be(p_cmd, rptr_offs / 10, 8); /* store bcd format in in p_cmd */
return write_block(&rig->state.rigport, (char *)p_cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, p_cmd, YAESU_CMD_LENGTH);
}

Wyświetl plik

@ -482,9 +482,9 @@ static int ft857_read_eeprom(RIG *rig, unsigned short addr, unsigned char *out)
data[0] = addr >> 8;
data[1] = addr & 0xfe;
write_block(&rig->state.rigport, (char *) data, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, data, YAESU_CMD_LENGTH);
if ((n = read_block(&rig->state.rigport, (char *) data, 2)) < 0)
if ((n = read_block(&rig->state.rigport, data, 2)) < 0)
{
return n;
}
@ -536,10 +536,10 @@ static int ft857_get_status(RIG *rig, int status)
rig_flush(&rig->state.rigport);
write_block(&rig->state.rigport, (char *) ncmd[status].nseq,
write_block(&rig->state.rigport, ncmd[status].nseq,
YAESU_CMD_LENGTH);
if ((n = read_block(&rig->state.rigport, (char *) data, len)) < 0)
if ((n = read_block(&rig->state.rigport, data, len)) < 0)
{
return n;
}
@ -578,7 +578,7 @@ static int ft857_send_cmd(RIG *rig, int index)
return -RIG_EINTERNAL;
}
write_block(&rig->state.rigport, (char *) ncmd[index].nseq, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, ncmd[index].nseq, YAESU_CMD_LENGTH);
return ft817_read_ack(rig);
}
@ -600,7 +600,7 @@ static int ft857_send_icmd(RIG *rig, int index, unsigned char *data)
cmd[YAESU_CMD_LENGTH - 1] = ncmd[index].nseq[YAESU_CMD_LENGTH - 1];
memcpy(cmd, data, YAESU_CMD_LENGTH - 1);
write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
return ft817_read_ack(rig);
}

Wyświetl plik

@ -1902,7 +1902,7 @@ static int ft890_get_update_data(RIG *rig, unsigned char ci, unsigned char rl)
return err;
}
n = read_block(&rig->state.rigport, (char *) priv->update_data, rl);
n = read_block(&rig->state.rigport, priv->update_data, rl);
if (n < 0)
{
@ -1945,8 +1945,7 @@ static int ft890_send_static_cmd(RIG *rig, unsigned char ci)
return -RIG_EINVAL;
}
err = write_block(&rig->state.rigport, (char *) ncmd[ci].nseq,
YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, ncmd[ci].nseq, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -2006,8 +2005,7 @@ static int ft890_send_dynamic_cmd(RIG *rig, unsigned char ci,
priv->p_cmd[P3] = p3;
priv->p_cmd[P4] = p4;
err = write_block(&rig->state.rigport, (char *) &priv->p_cmd,
YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -2067,8 +2065,7 @@ static int ft890_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
rig_debug(RIG_DEBUG_TRACE, fmt, __func__, (int64_t)from_bcd(priv->p_cmd,
FT890_BCD_DIAL) * 10);
err = write_block(&rig->state.rigport, (char *) &priv->p_cmd,
YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -2148,8 +2145,7 @@ static int ft890_send_rit_freq(RIG *rig, unsigned char ci, shortfreq_t rit)
priv->p_cmd[P1] = p1; /* ick */
priv->p_cmd[P2] = p2;
err = write_block(&rig->state.rigport, (char *) &priv->p_cmd,
YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{

Wyświetl plik

@ -388,8 +388,7 @@ static int ft891_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "ST%c;", ci);
if (RIG_OK != (err = write_block(&state->rigport, priv->cmd_str,
strlen(priv->cmd_str))))
if (RIG_OK != (err = write_block(&state->rigport, (unsigned char *) priv->cmd_str, strlen(priv->cmd_str))))
{
rig_debug(RIG_DEBUG_ERR, "%s: write_block err = %d\n", __func__, err);
return err;
@ -560,8 +559,7 @@ static int ft891_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
// Copy A to B
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "AB;");
if (RIG_OK != (err = write_block(&state->rigport, priv->cmd_str,
strlen(priv->cmd_str))))
if (RIG_OK != (err = write_block(&state->rigport, (unsigned char *) priv->cmd_str, strlen(priv->cmd_str))))
{
rig_debug(RIG_DEBUG_VERBOSE, "%s:%d write_block err = %d\n", __func__, __LINE__,
err);

Wyświetl plik

@ -620,9 +620,9 @@ static int ft897_read_eeprom(RIG *rig, unsigned short addr, unsigned char *out)
data[0] = addr >> 8;
data[1] = addr & 0xfe;
write_block(&rig->state.rigport, (char *) data, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, data, YAESU_CMD_LENGTH);
if ((n = read_block(&rig->state.rigport, (char *) data, 2)) < 0)
if ((n = read_block(&rig->state.rigport, data, 2)) < 0)
{
return n;
}
@ -674,10 +674,10 @@ static int ft897_get_status(RIG *rig, int status)
rig_flush(&rig->state.rigport);
write_block(&rig->state.rigport, (char *) ncmd[status].nseq,
write_block(&rig->state.rigport, ncmd[status].nseq,
YAESU_CMD_LENGTH);
if ((n = read_block(&rig->state.rigport, (char *) data, len)) < 0)
if ((n = read_block(&rig->state.rigport, data, len)) < 0)
{
return n;
}
@ -997,7 +997,7 @@ static int ft897_send_cmd(RIG *rig, int index)
return -RIG_EINTERNAL;
}
write_block(&rig->state.rigport, (char *) ncmd[index].nseq, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, ncmd[index].nseq, YAESU_CMD_LENGTH);
return ft817_read_ack(rig);
}
@ -1019,7 +1019,7 @@ static int ft897_send_icmd(RIG *rig, int index, unsigned char *data)
cmd[YAESU_CMD_LENGTH - 1] = ncmd[index].nseq[YAESU_CMD_LENGTH - 1];
memcpy(cmd, data, YAESU_CMD_LENGTH - 1);
write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
return ft817_read_ack(rig);
}

Wyświetl plik

@ -1924,7 +1924,7 @@ static int ft900_get_update_data(RIG *rig, unsigned char ci, unsigned char rl)
return err;
}
n = read_block(&rig->state.rigport, (char *) priv->update_data, rl);
n = read_block(&rig->state.rigport, priv->update_data, rl);
if (n < 0)
{
@ -1967,8 +1967,7 @@ static int ft900_send_static_cmd(RIG *rig, unsigned char ci)
return -RIG_EINVAL;
}
err = write_block(&rig->state.rigport, (char *) ncmd[ci].nseq,
YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, ncmd[ci].nseq, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -2028,8 +2027,7 @@ static int ft900_send_dynamic_cmd(RIG *rig, unsigned char ci,
priv->p_cmd[P3] = p3;
priv->p_cmd[P4] = p4;
err = write_block(&rig->state.rigport, (char *) &priv->p_cmd,
YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -2089,8 +2087,7 @@ static int ft900_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
rig_debug(RIG_DEBUG_TRACE, fmt, __func__, (int64_t)from_bcd(priv->p_cmd,
FT900_BCD_DIAL) * 10);
err = write_block(&rig->state.rigport, (char *) &priv->p_cmd,
YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -2170,8 +2167,7 @@ static int ft900_send_rit_freq(RIG *rig, unsigned char ci, shortfreq_t rit)
priv->p_cmd[P1] = p1; /* ick */
priv->p_cmd[P2] = p2;
err = write_block(&rig->state.rigport, (char *) &priv->p_cmd,
YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{

Wyświetl plik

@ -716,7 +716,7 @@ static int ft920_open(RIG *rig)
rig_debug(RIG_DEBUG_TRACE, "%s: read pacing = %i\n", __func__, priv->pacing);
err = write_block(&rig->state.rigport, (char *) priv->p_cmd, YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, priv->p_cmd, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -2633,7 +2633,7 @@ static int ft920_get_update_data(RIG *rig, unsigned char ci, unsigned char rl)
return err;
}
n = read_block(&rig->state.rigport, (char *)priv->update_data, rl);
n = read_block(&rig->state.rigport, priv->update_data, rl);
if (n < 0)
{
@ -2680,8 +2680,7 @@ static int ft920_send_static_cmd(RIG *rig, unsigned char ci)
return -RIG_EINVAL;
}
err = write_block(&rig->state.rigport, (char *) ncmd[ci].nseq,
YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, ncmd[ci].nseq, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -2746,7 +2745,7 @@ static int ft920_send_dynamic_cmd(RIG *rig, unsigned char ci,
priv->p_cmd[P3] = p3;
priv->p_cmd[P4] = p4;
err = write_block(&rig->state.rigport, (char *) &priv->p_cmd, YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -2810,7 +2809,7 @@ static int ft920_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
rig_debug(RIG_DEBUG_TRACE, fmt, __func__, (int64_t)from_bcd(priv->p_cmd,
FT920_BCD_DIAL) * 10);
err = write_block(&rig->state.rigport, (char *) &priv->p_cmd, YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -2893,7 +2892,7 @@ static int ft920_send_rit_freq(RIG *rig, unsigned char ci, shortfreq_t rit)
priv->p_cmd[P1] = p1; /* ick */
priv->p_cmd[P2] = p2;
err = write_block(&rig->state.rigport, (char *) &priv->p_cmd, YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{

Wyświetl plik

@ -567,13 +567,13 @@ int ft980_transaction(RIG *rig, const unsigned char *cmd, unsigned char *data,
int expected_len)
{
int retval;
char echo_back[YAESU_CMD_LENGTH];
unsigned char echo_back[YAESU_CMD_LENGTH];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
rig_flush(&rig->state.rigport);
retval = write_block(&rig->state.rigport, (const char *)cmd, YAESU_CMD_LENGTH);
retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
if (retval < 0)
{
@ -587,7 +587,7 @@ int ft980_transaction(RIG *rig, const unsigned char *cmd, unsigned char *data,
return retval;
}
if (retval != YAESU_CMD_LENGTH || memcmp(echo_back, cmd, YAESU_CMD_LENGTH))
if (retval != YAESU_CMD_LENGTH || (memcmp(echo_back, cmd, YAESU_CMD_LENGTH) != 0))
{
return -RIG_EPROTO;
}
@ -599,7 +599,7 @@ int ft980_transaction(RIG *rig, const unsigned char *cmd, unsigned char *data,
return retval;
}
retval = read_block(&rig->state.rigport, (char *)data, expected_len);
retval = read_block(&rig->state.rigport, data, expected_len);
if (retval < 0)
{
@ -753,14 +753,14 @@ int ft980_open(RIG *rig)
do
{
write_block(&rig->state.rigport, (char *) cmd_ON_OFF,
write_block(&rig->state.rigport, cmd_ON_OFF,
YAESU_CMD_LENGTH);
retval = read_block(&rig->state.rigport, (char *) echo_back, YAESU_CMD_LENGTH);
retval = read_block(&rig->state.rigport, echo_back, YAESU_CMD_LENGTH);
}
while (retval != 5 && retry_count2++ < rig->state.rigport.retry);
write_block(&rig->state.rigport, (char *) cmd_OK, YAESU_CMD_LENGTH);
retval = read_block(&rig->state.rigport, (char *) &priv->update_data,
write_block(&rig->state.rigport, cmd_OK, YAESU_CMD_LENGTH);
retval = read_block(&rig->state.rigport, (unsigned char *) &priv->update_data,
FT980_ALL_STATUS_LENGTH);
}
while (!priv->update_data.ext_ctl_flag
@ -799,14 +799,14 @@ int ft980_close(RIG *rig)
do
{
write_block(&rig->state.rigport, (char *) cmd_ON_OFF,
write_block(&rig->state.rigport, cmd_ON_OFF,
YAESU_CMD_LENGTH);
retval = read_block(&rig->state.rigport, (char *) echo_back, YAESU_CMD_LENGTH);
retval = read_block(&rig->state.rigport, echo_back, YAESU_CMD_LENGTH);
}
while (retval != 5 && retry_count2++ < rig->state.rigport.retry);
write_block(&rig->state.rigport, (char *) cmd_OK, YAESU_CMD_LENGTH);
retval = read_block(&rig->state.rigport, (char *) &priv->update_data,
write_block(&rig->state.rigport, cmd_OK, YAESU_CMD_LENGTH);
retval = read_block(&rig->state.rigport, (unsigned char *) &priv->update_data,
FT980_ALL_STATUS_LENGTH);
}
while (priv->update_data.ext_ctl_flag

Wyświetl plik

@ -382,8 +382,8 @@ typedef struct _ft980_memory_t
/*
* Start of Command Code Defines
*/
static const char cmd_OK[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x0B};
static const char cmd_ON_OFF[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x00};
static const unsigned char cmd_OK[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x0B};
static const unsigned char cmd_ON_OFF[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x00};
/* Opcodes 00 to 0B */
enum ft980_native_cmd_e {

Wyświetl plik

@ -2419,7 +2419,7 @@ int ft990_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *value)
return err;
}
err = read_block(&rig->state.rigport, (char *) mdata, FT990_READ_METER_LENGTH);
err = read_block(&rig->state.rigport, mdata, FT990_READ_METER_LENGTH);
if (err < 0)
{
@ -3222,8 +3222,8 @@ int ft990_get_update_data(RIG *rig, unsigned char ci, unsigned short ch)
int n;
int err;
int rl;
char temp[5];
char *p;
unsigned char temp[5];
unsigned char *p;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
rig_debug(RIG_DEBUG_TRACE, "%s: passed ci 0x%02x\n", __func__, ci);
@ -3258,22 +3258,22 @@ int ft990_get_update_data(RIG *rig, unsigned char ci, unsigned short ch)
break;
case FT990_NATIVE_UPDATE_MEM_CHNL:
p = (char *) &priv->update_data.channelnumber;
p = (unsigned char *) &priv->update_data.channelnumber;
rl = FT990_MEM_CHNL_LENGTH;
break;
case FT990_NATIVE_UPDATE_OP_DATA:
p = (char *) &priv->update_data.current_front;
p = (unsigned char *) &priv->update_data.current_front;
rl = FT990_OP_DATA_LENGTH;
break;
case FT990_NATIVE_UPDATE_VFO_DATA:
p = (char *) &priv->update_data.vfoa;
p = (unsigned char *) &priv->update_data.vfoa;
rl = FT990_VFO_DATA_LENGTH;
break;
case FT990_NATIVE_UPDATE_MEM_CHNL_DATA:
p = (char *) &priv->update_data.channel[ch];
p = (unsigned char *) &priv->update_data.channel[ch];
rl = FT990_MEM_CHNL_DATA_LENGTH;
break;
@ -3332,8 +3332,7 @@ int ft990_send_static_cmd(RIG *rig, unsigned char ci)
return -RIG_EINVAL;
}
err = write_block(&rig->state.rigport, (char *) ncmd[ci].nseq,
YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, ncmd[ci].nseq, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -3391,8 +3390,7 @@ int ft990_send_dynamic_cmd(RIG *rig, unsigned char ci,
priv->p_cmd[1] = p3;
priv->p_cmd[0] = p4;
err = write_block(&rig->state.rigport, (char *) &priv->p_cmd,
YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -3450,8 +3448,7 @@ int ft990_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
rig_debug(RIG_DEBUG_TRACE, fmt, __func__, (int64_t)from_bcd(priv->p_cmd,
FT990_BCD_DIAL) * 10);
err = write_block(&rig->state.rigport, (char *) &priv->p_cmd,
YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -3515,8 +3512,7 @@ int ft990_send_rit_freq(RIG *rig, unsigned char ci, shortfreq_t rit)
// Store bcd format into privat command storage area
to_bcd(priv->p_cmd, labs(rit) / 10, FT990_BCD_RIT);
err = write_block(&rig->state.rigport, (char *) &priv->p_cmd,
YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{

Wyświetl plik

@ -3210,7 +3210,7 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status)
ps = '1';
// when powering on need a dummy byte to wake it up
// then sleep from 1 to 2 seconds so we'll do 1.5 secs
write_block(&state->rigport, "\n", 1);
write_block(&state->rigport, (unsigned char *) "\n", 1);
hl_usleep(1500000);
break;
@ -3225,7 +3225,7 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status)
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PS%c%c", ps, cat_term);
retval = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str));
retval = write_block(&state->rigport, (unsigned char *) priv->cmd_str, strlen(priv->cmd_str));
retry_save = rig->state.rigport.retry;
rig->state.rigport.retry = 0;
@ -3245,7 +3245,7 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status)
}
rig_debug(RIG_DEBUG_TRACE, "%s: Wait #%d for power up\n", __func__, i + 1);
retval = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str));
retval = write_block(&state->rigport, (unsigned char *) priv->cmd_str, strlen(priv->cmd_str));
if (retval != RIG_OK) { RETURNFUNC(retval); }
}
@ -9894,7 +9894,7 @@ int newcat_get_cmd(RIG *rig)
/* send the command */
rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str);
if (RIG_OK != (rc = write_block(&state->rigport, priv->cmd_str,
if (RIG_OK != (rc = write_block(&state->rigport, (unsigned char *) priv->cmd_str,
strlen(priv->cmd_str))))
{
RETURNFUNC(rc);
@ -9902,7 +9902,7 @@ int newcat_get_cmd(RIG *rig)
}
/* read the reply */
if ((rc = read_string(&state->rigport, priv->ret_data, sizeof(priv->ret_data),
if ((rc = read_string(&state->rigport, (unsigned char *) priv->ret_data, sizeof(priv->ret_data),
&cat_term, sizeof(cat_term), 0, 1)) <= 0)
{
continue; /* usually a timeout - retry */
@ -10096,13 +10096,13 @@ int newcat_set_cmd_validate(RIG *rig)
char cmd[256]; // big enough
rig_flush(&state->rigport); /* discard any unsolicited data */
snprintf(cmd, sizeof(cmd), "%s%s", priv->cmd_str, valcmd);
rc = write_block(&state->rigport, cmd, strlen(cmd));
rc = write_block(&state->rigport, (unsigned char *) cmd, strlen(cmd));
if (rc != RIG_OK) { RETURNFUNC(-RIG_EIO); }
if (strlen(valcmd) == 0) { RETURNFUNC(RIG_OK); }
bytes = read_string(&state->rigport, priv->ret_data, sizeof(priv->ret_data),
bytes = read_string(&state->rigport, (unsigned char *) priv->ret_data, sizeof(priv->ret_data),
&cat_term, sizeof(cat_term), 0, 1);
// FA and FB success is now verified in rig.c with a followup query
@ -10192,7 +10192,7 @@ int newcat_set_cmd(RIG *rig)
rig_debug(RIG_DEBUG_TRACE,
"%s: newcat_set_cmd_validate not implemented...continuing\n", __func__);
if (RIG_OK != (rc = write_block(&state->rigport, priv->cmd_str,
if (RIG_OK != (rc = write_block(&state->rigport, (unsigned char *) priv->cmd_str,
strlen(priv->cmd_str))))
{
RETURNFUNC(rc);
@ -10223,14 +10223,14 @@ int newcat_set_cmd(RIG *rig)
/* send the verification command */
rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", verify_cmd);
if (RIG_OK != (rc = write_block(&state->rigport, verify_cmd,
if (RIG_OK != (rc = write_block(&state->rigport, (unsigned char *) verify_cmd,
strlen(verify_cmd))))
{
RETURNFUNC(rc);
}
/* read the reply */
if ((rc = read_string(&state->rigport, priv->ret_data, sizeof(priv->ret_data),
if ((rc = read_string(&state->rigport, (unsigned char *) priv->ret_data, sizeof(priv->ret_data),
&cat_term, sizeof(cat_term), 0, 1)) <= 0)
{
continue; /* usually a timeout - retry */
@ -10300,7 +10300,7 @@ int newcat_set_cmd(RIG *rig)
priv->cmd_str);
/* read/flush the verify command reply which should still be there */
if ((rc = read_string(&state->rigport, priv->ret_data, sizeof(priv->ret_data),
if ((rc = read_string(&state->rigport, (unsigned char *) priv->ret_data, sizeof(priv->ret_data),
&cat_term, sizeof(cat_term), 0, 1)) > 0)
{
rig_debug(RIG_DEBUG_TRACE, "%s: read count = %d, ret_data = %s\n",

Wyświetl plik

@ -289,7 +289,7 @@ int vr5000_open(RIG *rig)
int retval;
/* CAT write command on */
retval = write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
if (retval != RIG_OK)
{
@ -297,7 +297,7 @@ int vr5000_open(RIG *rig)
}
/* disable RIG_VFO_B (only on display) */
retval = write_block(&rig->state.rigport, (char *) b_off, YAESU_CMD_LENGTH);
retval = write_block(&rig->state.rigport, b_off, YAESU_CMD_LENGTH);
if (retval != RIG_OK)
{
@ -328,7 +328,7 @@ int vr5000_close(RIG *rig)
{
unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x80};
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -415,7 +415,7 @@ int vr5000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
rig_flush(&rig->state.rigport);
/* send READ STATUS(Meter only) cmd to rig */
retval = write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
if (retval < 0)
{
@ -423,7 +423,7 @@ int vr5000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
}
/* read back the 1 byte */
retval = read_block(&rig->state.rigport, (char *) cmd, 1);
retval = read_block(&rig->state.rigport, cmd, 1);
if (retval < 1)
{
@ -449,7 +449,7 @@ int vr5000_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
rig_flush(&rig->state.rigport);
/* send READ STATUS(Meter only) cmd to rig */
retval = write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
if (retval < 0)
{
@ -457,7 +457,7 @@ int vr5000_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
}
/* read back the 1 byte */
retval = read_block(&rig->state.rigport, (char *) cmd, 1);
retval = read_block(&rig->state.rigport, cmd, 1);
if (retval < 1)
{
@ -617,7 +617,7 @@ int set_vr5000(RIG *rig, vfo_t vfo, freq_t freq, rmode_t mode, pbwidth_t width,
/* fill in m2 */
cmd_mode_ts[1] = steps[i];
retval = write_block(&rig->state.rigport, (char *) cmd_mode_ts,
retval = write_block(&rig->state.rigport, cmd_mode_ts,
YAESU_CMD_LENGTH);
if (retval != RIG_OK)
@ -637,7 +637,7 @@ int set_vr5000(RIG *rig, vfo_t vfo, freq_t freq, rmode_t mode, pbwidth_t width,
cmd_freq[3] = frq & 0xff;
/* frequency set */
return write_block(&rig->state.rigport, (char *) cmd_freq, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd_freq, YAESU_CMD_LENGTH);
}

Wyświetl plik

@ -357,11 +357,11 @@ static int vx1700_do_transaction(RIG *rig,
memset(retbuf, 0, retbuf_len);
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, (const char *)cmd, YAESU_CMD_LENGTH);
retval = write_block(&rs->rigport, cmd, YAESU_CMD_LENGTH);
if (retval != RIG_OK) { return retval; }
retval = read_block(&rs->rigport, (char *)retbuf, retbuf_len);
retval = read_block(&rs->rigport, retbuf, retbuf_len);
if (retval != retbuf_len)
{

Wyświetl plik

@ -168,8 +168,8 @@ DECLARE_PROBERIG_BACKEND(yaesu)
}
/* send READ STATUS cmd to rig */
retval = write_block(port, (char *) cmd, YAESU_CMD_LENGTH);
id_len = read_block(port, (char *) idbuf, YAESU_CMD_LENGTH);
retval = write_block(port, cmd, YAESU_CMD_LENGTH);
id_len = read_block(port, idbuf, YAESU_CMD_LENGTH);
close(port->fd);

Wyświetl plik

@ -71,7 +71,7 @@ transaction_write:
if (cmdstr)
{
retval = write_block(&rs->rotport, cmdstr, strlen(cmdstr));
retval = write_block(&rs->rotport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
@ -92,7 +92,8 @@ transaction_write:
/* the answer */
memset(data, 0, data_len);
retval = read_string(&rs->rotport, data, data_len, ACK, strlen(ACK), 0, 1);
retval = read_string(&rs->rotport, (unsigned char *) data, data_len,
ACK, strlen(ACK), 0, 1);
if (retval < 0)
{

Wyświetl plik

@ -67,7 +67,7 @@ easycomm_transaction(ROT *rot, const char *cmdstr, char *data, size_t data_len)
rs = &rot->state;
rig_flush(&rs->rotport);
retval = write_block(&rs->rotport, cmdstr, strlen(cmdstr));
retval = write_block(&rs->rotport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
@ -79,7 +79,8 @@ easycomm_transaction(ROT *rot, const char *cmdstr, char *data, size_t data_len)
return RIG_OK; /* don't want a reply */
}
retval = read_string(&rs->rotport, data, data_len, "\n", 1, 0, 1);
retval = read_string(&rs->rotport, (unsigned char *) data, data_len,
"\n", 1, 0, 1);
if (retval < 0)
{

Wyświetl plik

@ -51,7 +51,7 @@ static int ether_transaction(ROT *rot, char *cmd, int len, char *buf)
{
int ret;
ret = write_block(&rot->state.rotport, cmd, len);
ret = write_block(&rot->state.rotport, (unsigned char *) cmd, len);
rig_debug(RIG_DEBUG_VERBOSE, "function %s(1): ret=%d || send=%s\n", __func__,
ret, cmd);
@ -60,7 +60,8 @@ static int ether_transaction(ROT *rot, char *cmd, int len, char *buf)
return ret;
}
ret = read_string(&rot->state.rotport, buf, BUF_MAX, "\n", sizeof("\n"), 0, 1);
ret = read_string(&rot->state.rotport, (unsigned char *) buf, BUF_MAX,
"\n", sizeof("\n"), 0, 1);
rig_debug(RIG_DEBUG_VERBOSE, "function %s(2): ret=%d || receive=%s\n", __func__,
ret, buf);
@ -125,7 +126,7 @@ static int ether_rot_close(ROT *rot)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
/* clean signoff, no read back */
write_block(&rot->state.rotport, "\n", 1);
write_block(&rot->state.rotport, (unsigned char *) "\n", 1);
return RIG_OK;
}

Wyświetl plik

@ -73,7 +73,7 @@ transaction_write:
if (cmdstr)
{
retval = write_block(&rs->rotport, cmdstr, strlen(cmdstr));
retval = write_block(&rs->rotport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
@ -93,8 +93,8 @@ transaction_write:
}
memset(data, 0, data_len);
retval = read_string(&rs->rotport, data, data_len, REPLY_EOM,
strlen(REPLY_EOM), 0, 1);
retval = read_string(&rs->rotport, (unsigned char *) data, data_len,
REPLY_EOM, strlen(REPLY_EOM), 0, 1);
if (retval < 0)
{
@ -148,7 +148,7 @@ static int
gs232_wo_transaction(ROT *rot, const char *cmdstr,
char *data, size_t data_len)
{
return write_block(&rot->state.rotport, cmdstr, strlen(cmdstr));
return write_block(&rot->state.rotport, (unsigned char *) cmdstr, strlen(cmdstr));
}

Wyświetl plik

@ -81,7 +81,7 @@ transaction_write:
if (cmdstr)
{
retval = write_block(&rs->rotport, cmdstr, strlen(cmdstr));
retval = write_block(&rs->rotport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
@ -103,8 +103,8 @@ transaction_write:
if (!no_reply)
{
memset(data, 0, data_len);
retval = read_string(&rs->rotport, data, data_len, REPLY_EOM,
strlen(REPLY_EOM), 0, 1);
retval = read_string(&rs->rotport, (unsigned char *) data, data_len,
REPLY_EOM, strlen(REPLY_EOM), 0, 1);
if (strncmp(data, "\r\n", 2) == 0
|| strchr(data, '>'))

Wyświetl plik

@ -75,7 +75,7 @@ transaction_write:
if (cmdstr)
{
retval = write_block(&rs->rotport, cmdstr, strlen(cmdstr));
retval = write_block(&rs->rotport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
@ -84,7 +84,7 @@ transaction_write:
if (!data)
{
write_block(&rs->rotport, EOM, strlen(EOM));
write_block(&rs->rotport, (unsigned char *) EOM, strlen(EOM));
}
}
@ -103,8 +103,8 @@ transaction_write:
memset(data, 0, data_len);
retval = read_string(&rs->rotport, data, data_len, REPLY_EOM,
strlen(REPLY_EOM), 0, 1);
retval = read_string(&rs->rotport, (unsigned char *) data, data_len,
REPLY_EOM, strlen(REPLY_EOM), 0, 1);
if (strncmp(data, "\r\n", 2) == 0 || strchr(data, '>'))
{

Wyświetl plik

@ -209,7 +209,7 @@ static int hd1780_rot_set_position(ROT *rot, azimuth_t azimuth,
* sends a <CR> when it is finished rotating.
*/
rs = &rot->state;
err = read_block(&rs->rotport, ok, 2);
err = read_block(&rs->rotport, (unsigned char *) ok, 2);
if (err != 2)
{
@ -258,7 +258,7 @@ static int hd1780_rot_get_position(ROT *rot, azimuth_t *azimuth,
}
rs = &rot->state;
err = read_block(&rs->rotport, az, AZ_READ_LEN);
err = read_block(&rs->rotport, (unsigned char *) az, AZ_READ_LEN);
if (err != AZ_READ_LEN)
{
@ -317,7 +317,7 @@ static int hd1780_send_priv_cmd(ROT *rot, const char *cmdstr)
rs = &rot->state;
err = write_block(&rs->rotport, cmdstr, strlen(cmdstr));
err = write_block(&rs->rotport, (unsigned char *) cmdstr, strlen(cmdstr));
if (err != RIG_OK)
{

Wyświetl plik

@ -87,7 +87,7 @@ transaction_write:
if (cmdstr)
{
retval = write_block(&rs->rotport, cmdstr, strlen(cmdstr));
retval = write_block(&rs->rotport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
@ -108,7 +108,7 @@ transaction_write:
/** the answer */
memset(data, 0, data_len);
retval = read_string(&rs->rotport, data, data_len, ACK, strlen(ACK), 0, 1);
retval = read_string(&rs->rotport, (unsigned char *) data, data_len, ACK, strlen(ACK), 0, 1);
if (retval < 0)
{

Wyświetl plik

@ -183,7 +183,7 @@ transaction_write:
if (cmdstr)
{
retval = write_block(&rs->rotport, cmdstr, strlen(cmdstr));
retval = write_block(&rs->rotport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
@ -204,13 +204,13 @@ transaction_write:
/* then comes the answer */
memset(data, 0, data_len);
retval = read_string(&rs->rotport, data, data_len, CR, strlen(CR), 0, 1);
retval = read_string(&rs->rotport, (unsigned char *) data, data_len, CR, strlen(CR), 0, 1);
// some models seem to echo -- so we'll check and read again if echoed
if (cmdstr && strcmp(data, cmdstr) == 0)
{
memset(data, 0, data_len);
retval = read_string(&rs->rotport, data, data_len, CR, strlen(CR), 0, 1);
retval = read_string(&rs->rotport, (unsigned char *) data, data_len, CR, strlen(CR), 0, 1);
}
if (retval < 0)

Wyświetl plik

@ -115,7 +115,7 @@ transaction:
if (cmdstr)
{
return_value = write_block(&rs->rotport, cmdstr, strlen(cmdstr));
return_value = write_block(&rs->rotport, (unsigned char *) cmdstr, strlen(cmdstr));
if (return_value != RIG_OK)
{
@ -128,7 +128,7 @@ transaction:
return value is expected, Strings end with '#' */
if (data != NULL)
{
return_value = read_string(&rs->rotport, data, expected_return_length + 1,
return_value = read_string(&rs->rotport, (unsigned char *) data, expected_return_length + 1,
"\r\n", strlen("\r\n"), 0, 1);
if (return_value > 0)

Wyświetl plik

@ -78,7 +78,7 @@ transaction_write:
if (cmdstr)
{
retval = write_block(&rs->rotport, cmdstr, strlen(cmdstr));
retval = write_block(&rs->rotport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
@ -98,7 +98,7 @@ transaction_write:
}
// Remember to check for STXA,G,R or STXA,?,XXX,R 10 bytes
retval = read_string(&rs->rotport, data, 20, CR, strlen(CR), 0, 1);
retval = read_string(&rs->rotport, (unsigned char *) data, 20, CR, strlen(CR), 0, 1);
if (retval < 0)
{

Wyświetl plik

@ -67,7 +67,7 @@ radant_transaction(ROT *rot, const char *cmdstr, char *data, size_t data_len)
rs = &rot->state;
rig_flush(&rs->rotport);
retval = write_block(&rs->rotport, cmdstr, strlen(cmdstr));
retval = write_block(&rs->rotport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
@ -79,7 +79,7 @@ radant_transaction(ROT *rot, const char *cmdstr, char *data, size_t data_len)
return RIG_OK; /* don't want a reply */
}
retval = read_string(&rs->rotport, data, data_len, "\n", 1, 0, 1);
retval = read_string(&rs->rotport, (unsigned char *) data, data_len, "\n", 1, 0, 1);
if (retval < 0)
{

Wyświetl plik

@ -541,7 +541,7 @@ static int rotorez_rot_get_position(ROT *rot, azimuth_t *azimuth,
rs = &rot->state;
err = read_block(&rs->rotport, az, AZ_READ_LEN);
err = read_block(&rs->rotport, (unsigned char *) az, AZ_READ_LEN);
if (err != AZ_READ_LEN)
{
@ -647,7 +647,7 @@ static int erc_rot_get_position(ROT *rot, azimuth_t *azimuth,
rs = &rot->state;
err = read_block(&rs->rotport, az, AZ_READ_LEN);
err = read_block(&rs->rotport, (unsigned char *) az, AZ_READ_LEN);
if (err != AZ_READ_LEN)
{
@ -763,7 +763,7 @@ static int rt21_rot_get_position(ROT *rot, azimuth_t *azimuth,
rs = &rot->state;
err = read_string(&rs->rotport, az, RT21_AZ_LEN + 1, ";", strlen(";"), 0, 1);
err = read_string(&rs->rotport, (unsigned char *) az, RT21_AZ_LEN + 1, ";", strlen(";"), 0, 1);
if (err < 0) /* read_string returns negative on error. */
{
@ -1007,7 +1007,7 @@ static int rotorez_send_priv_cmd(ROT *rot, const char *cmdstr)
}
rs = &rot->state;
err = write_block(&rs->rotport, cmdstr, strlen(cmdstr));
err = write_block(&rs->rotport, (unsigned char *) cmdstr, strlen(cmdstr));
if (err != RIG_OK)
{
@ -1031,7 +1031,7 @@ static int rotorez_send_priv_cmd2(ROT *rot, const char *cmdstr)
}
rs = &rot->state;
err = write_block(&rs->rotport2, cmdstr, strlen(cmdstr));
err = write_block(&rs->rotport2, (unsigned char *) cmdstr, strlen(cmdstr));
if (err != RIG_OK)
{
@ -1071,7 +1071,7 @@ static int rotorez_flush_buffer(ROT *rot)
do
{
err = read_block(&rs->rotport, garbage, MAX);
err = read_block(&rs->rotport, (unsigned char *) garbage, MAX);
/* Oops! An IO error was encountered. Bail out! */
if (err == -RIG_EIO)

Wyświetl plik

@ -129,7 +129,7 @@ static int sartek_rot_set_position(ROT *rot, azimuth_t azimuth,
len = sprintf(cmdstr, "P%c", (int)((azimuth * 255) / 360));
err = write_block(&rot->state.rotport, cmdstr, len);
err = write_block(&rot->state.rotport, (unsigned char *) cmdstr, len);
if (err != RIG_OK)
{
@ -151,7 +151,7 @@ static int sartek_rot_stop(ROT *rot)
rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
err = write_block(&rot->state.rotport, "P\0", 2);
err = write_block(&rot->state.rotport, (unsigned char *) "P\0", 2);
if (err != RIG_OK)
{

Wyświetl plik

@ -128,7 +128,7 @@ static int satel_cmd(ROT *rot, char *cmd, int cmdlen, char *res, int reslen)
rig_flush(&rs->rotport);
ret = write_block(&rs->rotport, cmd, cmdlen);
ret = write_block(&rs->rotport, (unsigned char *) cmd, cmdlen);
if (ret != RIG_OK)
{
@ -137,7 +137,7 @@ static int satel_cmd(ROT *rot, char *cmd, int cmdlen, char *res, int reslen)
if (reslen > 0 && res != NULL)
{
ret = read_string(&rs->rotport, res, reslen, "\n", 1, 0, 1);
ret = read_string(&rs->rotport, (unsigned char *) res, reslen, "\n", 1, 0, 1);
if (ret < 0)
{
@ -163,7 +163,7 @@ static int satel_read_status(ROT *rot, satel_stat_t *stat)
// read motion state
ret = read_string(&rs->rotport, resbuf, BUF_SIZE, "\n", 1, 0, 1);
ret = read_string(&rs->rotport, (unsigned char *) resbuf, BUF_SIZE, "\n", 1, 0, 1);
if (ret < 0)
{
@ -173,7 +173,7 @@ static int satel_read_status(ROT *rot, satel_stat_t *stat)
stat->motion_enabled = strcmp(resbuf, "Motion ENABLED") == 0 ? true : false;
// XXX skip mode
ret = read_string(&rs->rotport, resbuf, BUF_SIZE, "\n", 1, 0, 1);
ret = read_string(&rs->rotport, (unsigned char *) resbuf, BUF_SIZE, "\n", 1, 0, 1);
if (ret < 0)
{
@ -181,7 +181,7 @@ static int satel_read_status(ROT *rot, satel_stat_t *stat)
}
// XXX skip time
ret = read_string(&rs->rotport, resbuf, BUF_SIZE, "\n", 1, 0, 1);
ret = read_string(&rs->rotport, (unsigned char *) resbuf, BUF_SIZE, "\n", 1, 0, 1);
if (ret < 0)
{
@ -189,7 +189,7 @@ static int satel_read_status(ROT *rot, satel_stat_t *stat)
}
// read azimuth line
ret = read_string(&rs->rotport, resbuf, BUF_SIZE, "\n", 1, 0, 1);
ret = read_string(&rs->rotport, (unsigned char *) resbuf, BUF_SIZE, "\n", 1, 0, 1);
if (ret < 0)
{
@ -201,7 +201,7 @@ static int satel_read_status(ROT *rot, satel_stat_t *stat)
stat->az = (int)strtof(p, NULL);
// read elevation line
ret = read_string(&rs->rotport, resbuf, BUF_SIZE, "\n", 1, 0, 1);
ret = read_string(&rs->rotport, (unsigned char *) resbuf, BUF_SIZE, "\n", 1, 0, 1);
if (ret < 0)
{
@ -213,7 +213,7 @@ static int satel_read_status(ROT *rot, satel_stat_t *stat)
stat->el = (int)strtof(p, NULL);
// skip blank line
ret = read_string(&rs->rotport, resbuf, BUF_SIZE, "\n", 1, 0, 1);
ret = read_string(&rs->rotport, (unsigned char *) resbuf, BUF_SIZE, "\n", 1, 0, 1);
if (ret < 0)
{
@ -221,7 +221,7 @@ static int satel_read_status(ROT *rot, satel_stat_t *stat)
}
// XXX skip stored position count
ret = read_string(&rs->rotport, resbuf, BUF_SIZE, "\n", 1, 0, 1);
ret = read_string(&rs->rotport, (unsigned char *) resbuf, BUF_SIZE, "\n", 1, 0, 1);
if (ret < 0)
{

Wyświetl plik

@ -182,7 +182,7 @@ static int spid_rot1prog_rot_set_position(ROT *rot, azimuth_t az,
cmdstr[11] = 0x2F; /* K */
cmdstr[12] = 0x20; /* END */
retval = write_block(&rs->rotport, cmdstr, 13);
retval = write_block(&rs->rotport, (unsigned char *) cmdstr, 13);
if (retval != RIG_OK)
{
@ -210,7 +210,7 @@ static int spid_rot2prog_rot_set_position(ROT *rot, azimuth_t az,
do
{
retval = write_block(&rs->rotport,
"\x57\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1F\x20", 13);
(unsigned char *) "\x57\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1F\x20", 13);
if (retval != RIG_OK)
{
@ -218,7 +218,7 @@ static int spid_rot2prog_rot_set_position(ROT *rot, azimuth_t az,
}
memset(cmdstr, 0, 12);
retval = read_block(&rs->rotport, cmdstr, 12);
retval = read_block(&rs->rotport, (unsigned char *) cmdstr, 12);
}
while (retval < 0 && retry_read++ < rot->state.rotport.retry);
@ -250,7 +250,7 @@ static int spid_rot2prog_rot_set_position(ROT *rot, azimuth_t az,
cmdstr[11] = 0x2F; /* K */
cmdstr[12] = 0x20; /* END */
retval = write_block(&rs->rotport, cmdstr, 13);
retval = write_block(&rs->rotport, (unsigned char *) cmdstr, 13);
if (retval != RIG_OK)
{
@ -265,7 +265,7 @@ static int spid_rot2prog_rot_set_position(ROT *rot, azimuth_t az,
do
{
retval = read_block(&rs->rotport, cmdstr, 12);
retval = read_block(&rs->rotport, (unsigned char *) cmdstr, 12);
}
while ((retval < 0) && (retry_read++ < rot->state.rotport.retry));
}
@ -285,7 +285,7 @@ static int spid_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
do
{
retval = write_block(&rs->rotport,
"\x57\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1F\x20", 13);
(unsigned char *) "\x57\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1F\x20", 13);
if (retval != RIG_OK)
{
@ -296,12 +296,12 @@ static int spid_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
if (rot->caps->rot_model == ROT_MODEL_SPID_ROT1PROG)
{
retval = read_block(&rs->rotport, posbuf, 5);
retval = read_block(&rs->rotport, (unsigned char *) posbuf, 5);
}
else if (rot->caps->rot_model == ROT_MODEL_SPID_ROT2PROG ||
rot->caps->rot_model == ROT_MODEL_SPID_MD01_ROT2PROG)
{
retval = read_block(&rs->rotport, posbuf, 12);
retval = read_block(&rs->rotport, (unsigned char *) posbuf, 12);
}
else
{
@ -357,7 +357,7 @@ static int spid_rot_stop(ROT *rot)
do
{
retval = write_block(&rs->rotport,
"\x57\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0F\x20", 13);
(unsigned char *) "\x57\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0F\x20", 13);
if (retval != RIG_OK)
{
@ -368,12 +368,12 @@ static int spid_rot_stop(ROT *rot)
if (rot->caps->rot_model == ROT_MODEL_SPID_ROT1PROG)
{
retval = read_block(&rs->rotport, posbuf, 5);
retval = read_block(&rs->rotport, (unsigned char *) posbuf, 5);
}
else if (rot->caps->rot_model == ROT_MODEL_SPID_ROT2PROG ||
rot->caps->rot_model == ROT_MODEL_SPID_MD01_ROT2PROG)
{
retval = read_block(&rs->rotport, posbuf, 12);
retval = read_block(&rs->rotport, (unsigned char *) posbuf, 12);
}
}
while (retval < 0 && retry_read++ < rot->state.rotport.retry);
@ -431,7 +431,7 @@ static int spid_md01_rot2prog_rot_move(ROT *rot, int direction, int speed)
moving at all), always send the stop command first. */
spid_rot_stop(rot);
retval = write_block(&rs->rotport, cmdstr, 13);
retval = write_block(&rs->rotport, (unsigned char *) cmdstr, 13);
return retval;
}

Wyświetl plik

@ -1,5 +1,6 @@
/*
* Hamlib Interface - event handling
* Copyright (c) 2021 by Mikael Nousiainen
* Copyright (c) 2000-2010 by Stephane Fillod
* Copyright (c) 2000-2003 by Frank Singleton
*
@ -578,7 +579,7 @@ int rig_fire_freq_event(RIG *rig, vfo_t vfo, freq_t freq)
{
ENTERFUNC;
rig_debug(RIG_DEBUG_ERR, "Event: freq changed to %"PRIll"Hz on %s\n",
rig_debug(RIG_DEBUG_TRACE, "Event: freq changed to %"PRIll"Hz on %s\n",
(int64_t)freq, rig_strvfo(vfo));
rig_set_cache_freq(rig, vfo, freq);
@ -598,7 +599,7 @@ int rig_fire_mode_event(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
ENTERFUNC;
rig_debug(RIG_DEBUG_ERR, "Event: mode changed to %s, width %liHz on %s\n",
rig_debug(RIG_DEBUG_TRACE, "Event: mode changed to %s, width %liHz on %s\n",
rig_strrmode(mode), width, rig_strvfo(vfo));
rig_set_cache_mode(rig, vfo, mode, width);
@ -618,7 +619,7 @@ int rig_fire_vfo_event(RIG *rig, vfo_t vfo)
{
ENTERFUNC;
rig_debug(RIG_DEBUG_ERR, "Event: vfo changed to %s\n", rig_strvfo(vfo));
rig_debug(RIG_DEBUG_TRACE, "Event: vfo changed to %s\n", rig_strvfo(vfo));
rig->state.cache.vfo = vfo;
elapsed_ms(&rig->state.cache.time_vfo, HAMLIB_ELAPSED_SET);
@ -638,7 +639,7 @@ int rig_fire_ptt_event(RIG *rig, vfo_t vfo, ptt_t ptt)
{
ENTERFUNC;
rig_debug(RIG_DEBUG_ERR, "Event: PTT changed to %i on %s\n", ptt, rig_strvfo(vfo));
rig_debug(RIG_DEBUG_TRACE, "Event: PTT changed to %i on %s\n", ptt, rig_strvfo(vfo));
rig->state.cache.ptt = ptt;
elapsed_ms(&rig->state.cache.time_ptt, HAMLIB_ELAPSED_SET);
@ -658,7 +659,7 @@ int rig_fire_dcd_event(RIG *rig, vfo_t vfo, dcd_t dcd)
{
ENTERFUNC;
rig_debug(RIG_DEBUG_ERR, "Event: DCD changed to %i on %s\n", dcd, rig_strvfo(vfo));
rig_debug(RIG_DEBUG_TRACE, "Event: DCD changed to %i on %s\n", dcd, rig_strvfo(vfo));
network_publish_rig_transceive_data(rig);
@ -675,7 +676,7 @@ int rig_fire_pltune_event(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode, pbwi
{
ENTERFUNC;
rig_debug(RIG_DEBUG_ERR, "Event: Pipelined tuning event, vfo=%s\n", rig_strvfo(vfo));
rig_debug(RIG_DEBUG_TRACE, "Event: Pipelined tuning event, vfo=%s\n", rig_strvfo(vfo));
network_publish_rig_transceive_data(rig);

Wyświetl plik

@ -1,5 +1,6 @@
/*
* Hamlib Interface - generic file based io functions
* Copyright (c) 2021 by Mikael Nousiainen
* Copyright (c) 2000-2012 by Stephane Fillod
* Copyright (c) 2000-2003 by Frank Singleton
*

Wyświetl plik

@ -1,5 +1,6 @@
/*
* Hamlib Interface - network communication low-level support
* Copyright (c) 2021 by Mikael Nousiainen
* Copyright (c) 2000-2012 by Stephane Fillod
*
* This library is free software; you can redistribute it and/or

Some files were not shown because too many files have changed in this diff Show More