Changes changing hamlib_port_t to pointer are not backwards compatible

pull/948/head
Mike Black W9MDB 2022-01-25 17:41:26 -06:00
rodzic cb36210ddb
commit a277d7ab9b
119 zmienionych plików z 1227 dodań i 1234 usunięć

Wyświetl plik

@ -2225,8 +2225,9 @@ typedef struct hamlib_port {
} parm; /*!< Port parameter union */
int client_port; /*!< client socket port for tcp connection */
RIG *rig; /*!< our parent RIG device */
#ifdef ASYNC_BUG
int async; /*!< enable asynchronous data handling if true */
int asyncio; /*!< enable asynchronous data handling if true -- async collides with python keyword so _async is used */
#if defined(_WIN32)
hamlib_async_pipe_t *sync_data_pipe; /*!< pipe data structure for synchronous data */
hamlib_async_pipe_t *sync_data_error_pipe; /*!< pipe data structure for synchronous data error codes */
@ -2236,84 +2237,11 @@ typedef struct hamlib_port {
int fd_sync_error_write; /*!< file descriptor for writing synchronous data error codes */
int fd_sync_error_read; /*!< file descriptor for reading synchronous data error codes */
#endif
#endif
} hamlib_port_t;
typedef struct hamlib_port_deprecated {
union {
rig_port_t rig; /*!< Communication port type */
ptt_type_t ptt; /*!< PTT port type */
dcd_type_t dcd; /*!< DCD port type */
} type;
int fd; /*!< File descriptor */
void *handle; /*!< handle for USB */
int write_delay; /*!< Delay between each byte sent out, in mS */
int post_write_delay; /*!< Delay between each commands send out, in mS */
struct {
int tv_sec, tv_usec;
} post_write_date; /*!< hamlib internal use */
int timeout; /*!< Timeout, in mS */
short retry; /*!< Maximum number of retries, 0 to disable */
short flushx; /*!< If true flush is done with read instead of TCFLUSH - MicroHam */
char pathname[HAMLIB_FILPATHLEN]; /*!< Port pathname */
union {
struct {
int rate; /*!< Serial baud rate */
int data_bits; /*!< Number of data bits */
int stop_bits; /*!< Number of stop bits */
enum serial_parity_e parity; /*!< Serial parity */
enum serial_handshake_e handshake; /*!< Serial handshake */
enum serial_control_state_e rts_state; /*!< RTS set state */
enum serial_control_state_e dtr_state; /*!< DTR set state */
} serial; /*!< serial attributes */
struct {
int pin; /*!< Parallel port pin number */
} parallel; /*!< parallel attributes */
struct {
int ptt_bitnum; /*!< Bit number for CM108 GPIO PTT */
} cm108; /*!< CM108 attributes */
struct {
int vid; /*!< Vendor ID */
int pid; /*!< Product ID */
int conf; /*!< Configuration */
int iface; /*!< interface */
int alt; /*!< alternate */
char *vendor_name; /*!< Vendor name (opt.) */
char *product; /*!< Product (opt.) */
} usb; /*!< USB attributes */
struct {
int on_value; /*!< GPIO: 1 == normal, GPION: 0 == inverted */
int value; /*!< Toggle PTT ON or OFF */
} gpio; /*!< GPIO attributes */
} parm; /*!< Port parameter union */
int client_port; /*!< client socket port for tcp connection */
RIG *rig; /*!< our parent RIG device */
int async; /*!< enable asynchronous data handling if true */
#if defined(_WIN32)
hamlib_async_pipe_t *sync_data_pipe; /*!< pipe data structure for synchronous data */
hamlib_async_pipe_t *sync_data_error_pipe; /*!< pipe data structure for synchronous data error codes */
#else
int fd_sync_write; /*!< file descriptor for writing synchronous data */
int fd_sync_read; /*!< file descriptor for reading synchronous data */
int fd_sync_error_write; /*!< file descriptor for writing synchronous data error codes */
int fd_sync_error_read; /*!< file descriptor for reading synchronous data error codes */
#endif
} hamlib_port_t_deprecated;
//! @endcond
#if !defined(__APPLE__) || !defined(__cplusplus)
typedef hamlib_port_t_deprecated port_t_deprecated;
typedef hamlib_port_t port_t;
#endif
@ -2426,20 +2354,19 @@ struct rig_cache {
*
* It is NOT fine to move fields around as it can break share library offset
* As of 2021-03-03 vfo_list is the last known item being reference externally
* So any additions or changes to this structure must be at the end of the structure
* So any additions or changes to this structure must be after vfo_list.
*/
struct rig_state {
/********* ENSURE ANY NEW ITEMS ARE ADDED AT BOTTOM OF THIS STRUCTURE *********/
/*
* overridable fields
*/
// moving the hamlib_port_t to the end of rig_state and making it a pointer
// this should allow changes to hamlib_port_t without breaking shared libraries
// these will maintain a copy of the new port_t for backwards compatiblity
// to these offsets -- note these must stay until a major version update is done like 5.0
hamlib_port_t_deprecated rigport_deprecated; /*!< Rig port (internal use). */
hamlib_port_t_deprecated pttport_deprecated; /*!< PTT port (internal use). */
hamlib_port_t_deprecated dcdport_deprecated; /*!< DCD port (internal use). */
// to these offsets -- note these must stay until a major version update is done
hamlib_port_t rigport; /*!< Rig port (internal use). */
hamlib_port_t pttport; /*!< PTT port (internal use). */
hamlib_port_t dcdport; /*!< DCD port (internal use). */
double vfo_comp; /*!< VFO compensation in PPM, 0.0 to disable */
@ -2533,11 +2460,6 @@ struct rig_state {
#ifdef HAVE_PTHREAD
pthread_mutex_t mutex_set_transaction;
#endif
hamlib_port_t *rigport; /*!< Rig port (internal use). */
hamlib_port_t *pttport; /*!< PTT port (internal use). */
hamlib_port_t *dcdport; /*!< DCD port (internal use). */
/********* DO NOT ADD or CHANGE anything (or than to rename) ABOVE THIS LINE *********/
/********* ENSURE ANY NEW ITEMS ARE ADDED AFTER HERE *********/
};
//! @cond Doxygen_Suppress

Wyświetl plik

@ -1264,9 +1264,9 @@ int adat_send(RIG *pRig,
"*** ADAT: %d %s (%s:%d): ENTRY. Params: pRig = %p, pcData = %s\n",
gFnLevel, __func__, __FILE__, __LINE__, pRig, pcData);
rig_flush(pRigState->rigport);
rig_flush(&pRigState->rigport);
nRC = write_block(pRigState->rigport, (unsigned char *) 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,7 @@ 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, (unsigned char *) pcData, ADAT_RESPSZ,
nRC = read_string(&pRigState->rigport, (unsigned char *) pcData, ADAT_RESPSZ,
ADAT_EOL, 1, 0, 1);
if (nRC > 0)
@ -1563,7 +1563,7 @@ int adat_get_single_cmd_result(RIG *pRig)
}
}
rig_flush(pRigState->rigport);
rig_flush(&pRigState->rigport);
pPriv->nRC = nRC;
}

Wyświetl plik

@ -308,9 +308,9 @@ int dx77_transaction(RIG *rig,
rs = &rig->state;
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = write_block(rs->rigport, (unsigned char *) cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -321,7 +321,7 @@ 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, (unsigned char *) echobuf, BUFSZ,
retval = read_string(&rs->rigport, (unsigned char *) echobuf, BUFSZ,
LF, strlen(LF), 0, 1);
if (retval < 0)
@ -338,7 +338,7 @@ int dx77_transaction(RIG *rig,
/* no data expected, check for OK returned */
if (data == NULL)
{
retval = read_string(rs->rigport, (unsigned char *) echobuf, BUFSZ,
retval = read_string(&rs->rigport, (unsigned char *) echobuf, BUFSZ,
LF, strlen(LF), 0, 1);
if (retval < 0)
@ -360,7 +360,7 @@ int dx77_transaction(RIG *rig,
}
}
retval = read_string(rs->rigport, (unsigned char *) data, BUFSZ,
retval = read_string(&rs->rigport, (unsigned char *) data, BUFSZ,
LF, strlen(LF), 0, 1);
if (retval < 0)

Wyświetl plik

@ -251,9 +251,9 @@ int dxsr8_transaction(RIG *rig,
rs = &rig->state;
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = write_block(rs->rigport, (unsigned char *) cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -264,7 +264,7 @@ 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, (unsigned char *) replybuf, BUFSZ,
retval = read_string(&rs->rigport, (unsigned char *) replybuf, BUFSZ,
LF, strlen(LF), 0, 1);
if (retval < 0)
@ -273,7 +273,7 @@ int dxsr8_transaction(RIG *rig,
}
retval = read_string(rs->rigport, (unsigned char *) replybuf, BUFSZ,
retval = read_string(&rs->rigport, (unsigned char *) replybuf, BUFSZ,
LF, strlen(LF), 0, 1);
if (retval < 0)

Wyświetl plik

@ -80,9 +80,9 @@ static int aor_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rs = &rig->state;
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = write_block(rs->rigport, (unsigned char *) cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -102,7 +102,7 @@ static int aor_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
/*
* Do wait for a reply
*/
retval = read_string(rs->rigport, (unsigned char *) data, BUFSZ, EOM,
retval = read_string(&rs->rigport, (unsigned char *) data, BUFSZ, EOM,
strlen(EOM), 0, 1);
if (retval < 0)
@ -131,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, (unsigned char *) EOM, 1);
write_block(&rs->rigport, (unsigned char *) EOM, 1);
return -RIG_EPROTO;
}
@ -151,7 +151,7 @@ int aor_close(RIG *rig)
* since no reply is to be expected.
*/
return write_block(rig->state.rigport, (unsigned char *) "EX" EOM, 3);
return write_block(&rig->state.rigport, (unsigned char *) "EX" EOM, 3);
}
static int format_freq(char *buf, int buf_len, freq_t freq)
@ -1428,7 +1428,7 @@ 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, (unsigned char *) chanbuf, BUFSZ,
retval = read_string(&rig->state.rigport, (unsigned char *) chanbuf, BUFSZ,
EOM, strlen(EOM), 0,1);
if (retval < 0)

Wyświetl plik

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

Wyświetl plik

@ -232,11 +232,11 @@ static int ar3030_transaction(RIG *rig, const char *cmd, int cmd_len,
data = tmpdata;
}
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
do
{
retval = write_block(rs->rigport, (unsigned char *) cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -247,7 +247,7 @@ 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, (unsigned char *) data, BUFSZ,
retval = read_string(&rs->rigport, (unsigned char *) data, BUFSZ,
"\x0a", 1, 0, 1);
if (retval == -RIG_ETIMEOUT)
@ -317,7 +317,7 @@ int ar3030_close(RIG *rig)
rig_debug(RIG_DEBUG_TRACE, "%s:\n", __func__);
rs = &rig->state;
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = ar3030_transaction(rig, "Q" CR, strlen("Q" CR), NULL, NULL);
rig_debug(RIG_DEBUG_TRACE, "%s: retval=%d\n", __func__, retval);

Wyświetl plik

@ -73,7 +73,7 @@
static int rxr_writeByte(RIG *rig, unsigned char c)
{
return write_block(rig->state.rigport, &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, buf, 1);
retval = write_block(&rig->state.rigport, buf, 1);
if (retval != RIG_OK)
{
return retval;
}
retval = read_block(rig->state.rigport, 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, buf, 1);
retval = write_block(&rig->state.rigport, buf, 1);
if (retval != RIG_OK)
{
return retval;
}
retval = read_block(rig->state.rigport, response, 1);
retval = read_block(&rig->state.rigport, response, 1);
if (retval != RIG_OK)
{

Wyświetl plik

@ -272,7 +272,7 @@ static int ar7030p_init(RIG *rig)
rig->state.priv = (void *) priv;
rig->state.rigport->type.rig = RIG_PORT_SERIAL;
rig->state.rigport.type.rig = RIG_PORT_SERIAL;
priv->powerstat = RIG_POWER_ON;
priv->bank = 0;

Wyświetl plik

@ -57,7 +57,7 @@ int NOP(RIG *rig, unsigned char x)
assert(NULL != rig);
rc = write_block(rig->state.rigport, (char *) &op, 1);
rc = write_block(&rig->state.rigport, (char *) &op, 1);
if (0 != rc)
{
@ -79,7 +79,7 @@ int SRH(RIG *rig, unsigned char x)
assert(NULL != rig);
rc = write_block(rig->state.rigport, (char *) &op, 1);
rc = write_block(&rig->state.rigport, (char *) &op, 1);
if (0 != rc)
{
@ -109,7 +109,7 @@ int PGE(RIG *rig, enum PAGE_e page)
case EEPROM2:
case EEPROM3:
case ROM:
rc = write_block(rig->state.rigport, (char *) &op, 1);
rc = write_block(&rig->state.rigport, (char *) &op, 1);
if (0 != rc)
{
@ -142,7 +142,7 @@ int ADR(RIG *rig, unsigned char x)
assert(NULL != rig);
rc = write_block(rig->state.rigport, (char *) &op, 1);
rc = write_block(&rig->state.rigport, (char *) &op, 1);
if (0 != rc)
{
@ -164,7 +164,7 @@ int ADH(RIG *rig, unsigned char x)
assert(NULL != rig);
rc = write_block(rig->state.rigport, (char *) &op, 1);
rc = write_block(&rig->state.rigport, (char *) &op, 1);
if (0 != rc)
{
@ -188,7 +188,7 @@ int WRD(RIG *rig, unsigned char out)
assert(NULL != rig);
rc = write_block(rig->state.rigport, (char *) &op, 1);
rc = write_block(&rig->state.rigport, (char *) &op, 1);
if (0 != rc)
{
@ -211,7 +211,7 @@ int MSK(RIG *rig, unsigned char mask)
assert(NULL != rig);
rc = write_block(rig->state.rigport, (char *) &op, 1);
rc = write_block(&rig->state.rigport, (char *) &op, 1);
if (0 != rc)
{
@ -249,7 +249,7 @@ int EXE(RIG *rig, enum ROUTINE_e routine)
case DISP_BUFF:
case READ_SIGNAL:
case READ_BTNS:
rc = write_block(rig->state.rigport, (char *) &op, 1);
rc = write_block(&rig->state.rigport, (char *) &op, 1);
if (0 != rc)
{
@ -281,7 +281,7 @@ int RDD(RIG *rig, unsigned char len)
assert(NULL != rig);
rc = write_block(rig->state.rigport, (char *) &op, 1);
rc = write_block(&rig->state.rigport, (char *) &op, 1);
if (0 != rc)
{
@ -289,7 +289,7 @@ int RDD(RIG *rig, unsigned char len)
}
else
{
rc = read_block(rig->state.rigport, (char *) &inChr, len);
rc = read_block(&rig->state.rigport, (char *) &inChr, len);
if (1 != rc)
{
@ -322,7 +322,7 @@ int LOC(RIG *rig, enum LOCK_LVL_e level)
case LOCK_1:
case LOCK_2:
case LOCK_3:
rc = write_block(rig->state.rigport, (char *) &op, 1);
rc = write_block(&rig->state.rigport, (char *) &op, 1);
if (0 != rc)
{
@ -367,7 +367,7 @@ int BUT(RIG *rig, enum BUTTON_e button)
case BTN_STAR:
case BTN_MENU:
case BTN_POWER:
rc = write_block(rig->state.rigport, (char *) &op, 1);
rc = write_block(&rig->state.rigport, (char *) &op, 1);
if (0 != rc)
{
@ -404,7 +404,7 @@ int execRoutine(RIG *rig, enum ROUTINE_e rtn)
assert(NULL != rig);
if (0 == write_block(rig->state.rigport, &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, &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, &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, &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, &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, &hi, 1))
if (0 == write_block(&rig->state.rigport, &hi, 1))
{
if (0 == write_block(rig->state.rigport, &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, &v, 1))
if (0 == write_block(&rig->state.rigport, &v, 1))
{
if (1 == read_block(rig->state.rigport, 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, x, 1))
if (1 == read_block(&rig->state.rigport, x, 1))
{
rc = RIG_OK;
@ -868,7 +868,7 @@ int flushBuffer(RIG *rig)
assert(NULL != rig);
if (0 == write_block(rig->state.rigport, &v, 1))
if (0 == write_block(&rig->state.rigport, &v, 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, &v, 1))
if (0 == write_block(&rig->state.rigport, &v, 1))
{
rc = RIG_OK;

Wyświetl plik

@ -285,9 +285,9 @@ static int sr2200_transaction(RIG *rig, const char *cmd, int cmd_len,
rs = &rig->state;
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = write_block(rs->rigport, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) EOM, 1);
write_block(&rs->rigport, (unsigned char *) EOM, 1);
return -RIG_EPROTO;
}

Wyświetl plik

@ -74,8 +74,8 @@ int barrett_transaction(RIG *rig, char *cmd, int expected, char **result)
SNPRINTF(cmd_buf, sizeof(cmd_buf), "%s%s", cmd, EOM);
rig_flush(rs->rigport);
retval = write_block(rs->rigport, (unsigned char *) cmd_buf, strlen(cmd_buf));
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, (unsigned char *) cmd_buf, strlen(cmd_buf));
if (retval < 0)
{
@ -85,7 +85,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, (unsigned char *) 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__,
@ -99,7 +99,7 @@ int barrett_transaction(RIG *rig, char *cmd, int expected, char **result)
}
else
{
retval = read_block(rs->rigport, (unsigned char *) priv->ret_data, expected);
retval = read_block(&rs->rigport, (unsigned char *) priv->ret_data, expected);
if (retval < 0)
{

Wyświetl plik

@ -61,8 +61,8 @@ int codan_transaction(RIG *rig, char *cmd, int expected, char **result)
SNPRINTF(cmd_buf, sizeof(cmd_buf), "%s%s", cmd, EOM);
rig_flush(rs->rigport);
retval = write_block(rs->rigport, (unsigned char *) cmd_buf, strlen(cmd_buf));
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, (unsigned char *) cmd_buf, strlen(cmd_buf));
hl_usleep(rig->caps->post_write_delay);
if (retval < 0)
@ -73,7 +73,7 @@ int codan_transaction(RIG *rig, char *cmd, int expected, char **result)
if (expected == 0)
{
// response format is reponse...0x0d0x0a
retval = read_string(rs->rigport, (unsigned char *) priv->ret_data,
retval = read_string(&rs->rigport, (unsigned char *) priv->ret_data,
sizeof(priv->ret_data),
"\x0a", 1, 0, 1);
rig_debug(RIG_DEBUG_VERBOSE, "%s: result=%s, resultlen=%d\n", __func__,
@ -86,7 +86,7 @@ int codan_transaction(RIG *rig, char *cmd, int expected, char **result)
}
else
{
retval = read_string(rs->rigport, (unsigned char *) priv->ret_data,
retval = read_string(&rs->rigport, (unsigned char *) priv->ret_data,
sizeof(priv->ret_data),
"\x0a", 1, 0, 1);
@ -98,7 +98,7 @@ int codan_transaction(RIG *rig, char *cmd, int expected, char **result)
if (strncmp(priv->ret_data, "LEVELS:", 7) == 0)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: %s\n", __func__, priv->ret_data);
retval = read_string(rs->rigport, (unsigned char *) priv->ret_data,
retval = read_string(&rs->rigport, (unsigned char *) priv->ret_data,
sizeof(priv->ret_data),
"\x0a", 1, 0, 1);
rig_debug(RIG_DEBUG_VERBOSE, "%s: %s\n", __func__, priv->ret_data);
@ -112,7 +112,7 @@ int codan_transaction(RIG *rig, char *cmd, int expected, char **result)
&& sscanf(priv->ret_data, "%d:%d:%d", &hr, &min, &sec) != 3)
{
char tmpbuf[256];
retval = read_string(rs->rigport, (unsigned char *) tmpbuf,
retval = read_string(&rs->rigport, (unsigned char *) tmpbuf,
sizeof(priv->ret_data),
"\x0a", 1, 0, 1);

Wyświetl plik

@ -60,7 +60,7 @@ struct dra818_priv
static int dra818_response(RIG *rig, const char *expected)
{
char response[80];
int r = read_string(rig->state.rigport, (unsigned char *) response, sizeof(response),
int r = read_string(&rig->state.rigport, (unsigned char *) response, sizeof(response),
"\n", 1, 0,1);
if (r != strlen(expected))
@ -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, (unsigned char *) cmd, strlen(cmd));
write_block(&rig->state.rigport, (unsigned char *) cmd, strlen(cmd));
return dra818_response(rig, dra818_setgroup_res);
}
@ -130,7 +130,7 @@ static int dra818_setvolume(RIG *rig)
char cmd[80];
SNPRINTF(cmd, sizeof(cmd), "AT+DMOSETVOLUME=%1d\r\n", priv->vol);
write_block(rig->state.rigport, (unsigned char *) cmd, strlen(cmd));
write_block(&rig->state.rigport, (unsigned char *) cmd, strlen(cmd));
return dra818_response(rig, dra818_setvolume_res);
}
@ -191,7 +191,7 @@ int dra818_open(RIG *rig)
for (i = 0; i < 3; i++)
{
write_block(rig->state.rigport, (unsigned char *) dra818_handshake_cmd,
write_block(&rig->state.rigport, (unsigned char *) dra818_handshake_cmd,
strlen(dra818_handshake_cmd));
r = dra818_response(rig, dra818_handshake_res);
@ -292,9 +292,9 @@ int dra818_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
SNPRINTF(cmd, sizeof(cmd), "S+%03d.%04d\r\n",
(int)(priv->rx_freq / 1000000), (int)((priv->rx_freq % 1000000) / 100));
write_block(rig->state.rigport, (unsigned char *) cmd, strlen(cmd));
write_block(&rig->state.rigport, (unsigned char *) cmd, strlen(cmd));
r = read_string(rig->state.rigport, (unsigned char *) response, sizeof(response),
r = read_string(&rig->state.rigport, (unsigned char *) response, sizeof(response),
"\n", 1, 0, 1);
if (r != 5)

Wyświetl plik

@ -69,9 +69,9 @@ int drake_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rs = &rig->state;
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = write_block(rs->rigport, (unsigned char *) cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -84,7 +84,7 @@ int drake_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
return 0;
}
retval = read_string(rs->rigport, (unsigned char *) data, BUFSZ,
retval = read_string(&rs->rigport, (unsigned char *) data, BUFSZ,
LF, 1, 0, 1);
if (retval == -RIG_ETIMEOUT)

Wyświetl plik

@ -238,7 +238,7 @@ static int dummy_init(RIG *rig)
rig->state.priv = (void *)priv;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
rig->state.rigport->type.rig = RIG_PORT_NONE;
rig->state.rigport.type.rig = RIG_PORT_NONE;
priv->ptt = RIG_PTT_OFF;
priv->powerstat = RIG_POWER_ON;
@ -683,12 +683,12 @@ static int dummy_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
// sneak a look at the hardware PTT and OR that in with our result
// as if it had keyed us
switch (rig->state.pttport->type.ptt)
switch (rig->state.pttport.type.ptt)
{
case RIG_PTT_SERIAL_DTR:
if (rig->state.pttport->fd >= 0)
if (rig->state.pttport.fd >= 0)
{
if (RIG_OK != (rc = ser_get_dtr(rig->state.pttport, &status))) { RETURNFUNC(rc); }
if (RIG_OK != (rc = ser_get_dtr(&rig->state.pttport, &status))) { RETURNFUNC(rc); }
*ptt = status ? RIG_PTT_ON : RIG_PTT_OFF;
}
@ -700,9 +700,9 @@ static int dummy_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
break;
case RIG_PTT_SERIAL_RTS:
if (rig->state.pttport->fd >= 0)
if (rig->state.pttport.fd >= 0)
{
if (RIG_OK != (rc = ser_get_rts(rig->state.pttport, &status))) { RETURNFUNC(rc); }
if (RIG_OK != (rc = ser_get_rts(&rig->state.pttport, &status))) { RETURNFUNC(rc); }
*ptt = status ? RIG_PTT_ON : RIG_PTT_OFF;
}
@ -714,26 +714,26 @@ static int dummy_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
break;
case RIG_PTT_PARALLEL:
if (rig->state.pttport->fd >= 0)
if (rig->state.pttport.fd >= 0)
{
if (RIG_OK != (rc = par_ptt_get(rig->state.pttport, ptt))) { RETURNFUNC(rc); }
if (RIG_OK != (rc = par_ptt_get(&rig->state.pttport, ptt))) { RETURNFUNC(rc); }
}
break;
case RIG_PTT_CM108:
if (rig->state.pttport->fd >= 0)
if (rig->state.pttport.fd >= 0)
{
if (RIG_OK != (rc = cm108_ptt_get(rig->state.pttport, ptt))) { RETURNFUNC(rc); }
if (RIG_OK != (rc = cm108_ptt_get(&rig->state.pttport, ptt))) { RETURNFUNC(rc); }
}
break;
case RIG_PTT_GPIO:
case RIG_PTT_GPION:
if (rig->state.pttport->fd >= 0)
if (rig->state.pttport.fd >= 0)
{
if (RIG_OK != (rc = gpio_ptt_get(rig->state.pttport, ptt))) { RETURNFUNC(rc); }
if (RIG_OK != (rc = gpio_ptt_get(&rig->state.pttport, ptt))) { RETURNFUNC(rc); }
}
break;

Wyświetl plik

@ -294,7 +294,7 @@ static char *xml_build(RIG *rig, char *cmd, char *value, char *xmlbuf,
SNPRINTF(xml, sizeof(xml),
"<?xml version=\"1.0\"?>\r\n<?clientid=\"hamlib(%d)\"?>\r\n",
rig->state.rigport->client_port);
rig->state.rigport.client_port);
strncat(xml, "<methodCall><methodName>", sizeof(xml) - 1);
strncat(xml, cmd, sizeof(xml) - strlen(xml) - 1);
@ -443,7 +443,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, (unsigned char *) 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);
@ -524,11 +524,11 @@ static int write_transaction(RIG *rig, char *xml, int xml_len)
// appears we can lose sync if we don't clear things out
// shouldn't be anything for us now anyways
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
while (try-- >= 0 && retval != RIG_OK)
{
retval = write_block(rs->rigport, (unsigned char *) xml, strlen(xml));
retval = write_block(&rs->rigport, (unsigned char *) xml, strlen(xml));
if (retval < 0)
{
@ -641,8 +641,8 @@ static int flrig_init(RIG *rig)
RETURNFUNC(-RIG_EINVAL);
}
strncpy(rig->state.rigport->pathname, DEFAULTPATH,
sizeof(rig->state.rigport->pathname));
strncpy(rig->state.rigport.pathname, DEFAULTPATH,
sizeof(rig->state.rigport.pathname));
priv->ext_parms = alloc_init_ext(flrig_ext_parms);

Wyświetl plik

@ -70,16 +70,16 @@ static int netrigctl_transaction(RIG *rig, char *cmd, int len, char *buf)
rig_debug(RIG_DEBUG_VERBOSE, "%s: called len=%d\n", __func__, len);
/* flush anything in the read buffer before command is sent */
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
ret = write_block(rig->state.rigport, (unsigned char *) cmd, len);
ret = write_block(&rig->state.rigport, (unsigned char *) cmd, len);
if (ret != RIG_OK)
{
return ret;
}
ret = read_string(rig->state.rigport, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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)
@ -666,21 +666,21 @@ static int netrigctl_open(RIG *rig)
{
ptt_type_t temp = (ptt_type_t)strtol(value, NULL, 0);
if (RIG_PTT_RIG_MICDATA == rig->state.pttport->type.ptt && RIG_PTT_NONE == temp)
if (RIG_PTT_RIG_MICDATA == rig->state.pttport.type.ptt && RIG_PTT_NONE == temp)
{
/*
* remote PTT must always be RIG_PTT_RIG_MICDATA
* if there is any PTT capability and we have not
* locally overridden it
*/
rig->state.pttport->type.ptt = RIG_PTT_RIG_MICDATA;
rig->state.pttport.type.ptt = RIG_PTT_RIG_MICDATA;
rig->caps->ptt_type = RIG_PTT_RIG_MICDATA;
rig_debug(RIG_DEBUG_TRACE, "%s: %s set to %d\n", __func__, setting,
rig->state.pttport->type.ptt);
rig->state.pttport.type.ptt);
}
else
{
rig->state.pttport->type.ptt = temp;
rig->state.pttport.type.ptt = temp;
rig->caps->ptt_type = temp;
}
}
@ -903,7 +903,7 @@ static int netrigctl_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
CHKSCN1ARG(num_sscanf(buf, "%"SCNfreq, freq));
#if 0 // implement set_freq VFO later if it can be detected
ret = read_string(rig->state->rigport, buf, BUF_MAX, "\n", 1, 0, 1);
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1, 0, 1);
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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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

@ -291,7 +291,7 @@ static int read_transaction(RIG *rig, unsigned char *buf, int buf_len)
rig_debug(RIG_DEBUG_WARN, "%s: retry needed? retry=%d\n", __func__, retry);
}
int len = read_string(rs->rigport, buf, buf_len, delims,
int len = read_string(&rs->rigport, buf, buf_len, delims,
strlen(delims), 0, 1);
rig_debug(RIG_DEBUG_TRACE, "%s: string='%s'\n", __func__, buf);
@ -338,11 +338,11 @@ static int write_transaction(RIG *rig, unsigned char *buf, int buf_len)
// appears we can lose sync if we don't clear things out
// shouldn't be anything for us now anyways
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
while (try-- >= 0 && retval != RIG_OK)
{
retval = write_block(rs->rigport, buf, buf_len);
retval = write_block(&rs->rigport, buf, buf_len);
if (retval < 0)
{
@ -457,8 +457,8 @@ static int tci1x_init(RIG *rig)
RETURNFUNC(-RIG_EINVAL);
}
strncpy(rig->state.rigport->pathname, DEFAULTPATH,
sizeof(rig->state.rigport->pathname));
strncpy(rig->state.rigport.pathname, DEFAULTPATH,
sizeof(rig->state.rigport.pathname));
priv->ext_parms = alloc_init_ext(tci1x_ext_parms);

Wyświetl plik

@ -243,7 +243,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, (unsigned char *) response, response_len, delims,
len = read_string(&rs->rigport, (unsigned char *) response, response_len, delims,
strlen(delims), 0, 1);
if (len <= 0)
@ -288,8 +288,8 @@ static int trxmanager_init(RIG *rig)
return -RIG_EINVAL;
}
strncpy(rig->state.rigport->pathname, DEFAULTPATH,
sizeof(rig->state.rigport->pathname));
strncpy(rig->state.rigport.pathname, DEFAULTPATH,
sizeof(rig->state.rigport.pathname));
return RIG_OK;
}
@ -310,7 +310,7 @@ static int trxmanager_open(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%s version %s\n", __func__, BACKEND_VER);
rs->rigport->timeout = 10000; // long timeout for antenna switching/tuning
rs->rigport.timeout = 10000; // long timeout for antenna switching/tuning
retval = read_transaction(rig, response, sizeof(response));
if (retval != RIG_OK)
@ -331,7 +331,7 @@ static int trxmanager_open(RIG *rig)
// Turn off active messages
cmd = "AI0;";
retval = write_block(rs->rigport, (unsigned char *) cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -354,7 +354,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, (unsigned char *) cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval != RIG_OK)
{
@ -442,7 +442,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, (unsigned char *) cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -512,7 +512,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, (unsigned char *) cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -551,7 +551,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, (unsigned char *) cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -590,7 +590,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, (unsigned char *) cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -715,7 +715,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, (unsigned char *) cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -778,7 +778,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, (unsigned char *) cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -851,7 +851,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, (unsigned char *) cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -918,7 +918,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, (unsigned char *) cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -1003,7 +1003,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, (unsigned char *) cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -1071,7 +1071,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, (unsigned char *) cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -1113,7 +1113,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, (unsigned char *) cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{
@ -1166,7 +1166,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, (unsigned char *) cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval < 0)
{

Wyświetl plik

@ -192,7 +192,7 @@ int elad_transaction(RIG *rig, const char *cmdstr, char *data, size_t datasize)
rs->transaction_active = 1;
/* Emulators don't need any post_write_delay */
if (priv->is_emulation) { rs->rigport->post_write_delay = 0; }
if (priv->is_emulation) { rs->rigport.post_write_delay = 0; }
cmdtrm[0] = caps->cmdtrm;
cmdtrm[1] = '\0';
@ -223,9 +223,9 @@ transaction_write:
}
/* flush anything in the read buffer before command is sent */
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = write_block(rs->rigport, (unsigned char *) cmd, len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, len);
free(cmd);
@ -242,7 +242,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,
if (RIG_OK != (retval = write_block(&rs->rigport,
(unsigned char *) priv->verify_cmd, strlen(priv->verify_cmd))))
{
goto transaction_quit;
@ -253,12 +253,12 @@ 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, (unsigned char *) buffer, len,
retval = read_string(&rs->rigport, (unsigned char *) buffer, len,
cmdtrm, strlen(cmdtrm), 0, 1);
if (retval < 0)
{
if (retry_read++ < rs->rigport->retry)
if (retry_read++ < rs->rigport.retry)
{
goto transaction_write;
}
@ -272,7 +272,7 @@ transaction_read:
rig_debug(RIG_DEBUG_ERR, "%s: Command is not correctly terminated '%s'\n",
__func__, buffer);
if (retry_read++ < rs->rigport->retry)
if (retry_read++ < rs->rigport.retry)
{
goto transaction_write;
}
@ -304,7 +304,7 @@ transaction_read:
rig_debug(RIG_DEBUG_VERBOSE, "%s: Overflow for '%s'\n", __func__, cmdstr);
}
if (retry_read++ < rs->rigport->retry)
if (retry_read++ < rs->rigport.retry)
{
goto transaction_write;
}
@ -321,7 +321,7 @@ transaction_read:
cmdstr);
}
if (retry_read++ < rs->rigport->retry)
if (retry_read++ < rs->rigport.retry)
{
goto transaction_write;
}
@ -338,7 +338,7 @@ transaction_read:
cmdstr);
}
if (retry_read++ < rs->rigport->retry)
if (retry_read++ < rs->rigport.retry)
{
rig_debug(RIG_DEBUG_ERR, "%s: Retrying shortly\n", __func__);
hl_usleep(rig->caps->timeout * 1000);
@ -368,7 +368,7 @@ transaction_read:
rig_debug(RIG_DEBUG_ERR, "%s: Wrong reply %c%c for command %c%c\n",
__func__, buffer[0], buffer[1], cmdstr[0], cmdstr[1]);
if (retry_read++ < rs->rigport->retry)
if (retry_read++ < rs->rigport.retry)
{
goto transaction_write;
}
@ -401,7 +401,7 @@ transaction_read:
__func__, buffer[0], buffer[1]
, priv->verify_cmd[0], priv->verify_cmd[1], (int)datasize);
if (retry_read++ < rs->rigport->retry)
if (retry_read++ < rs->rigport.retry)
{
goto transaction_write;
}
@ -473,7 +473,7 @@ int elad_safe_transaction(RIG *rig, const char *cmd, char *buf,
hl_usleep(rig->caps->timeout * 1000);
}
}
while (err != RIG_OK && ++retry < rig->state.rigport->retry);
while (err != RIG_OK && ++retry < rig->state.rigport.retry);
return err;
}

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, (unsigned char *) cmdstr, buflen);
ret = write_block(&rig->state.rigport, (unsigned char *) cmdstr, buflen);
return ret;
}
@ -521,10 +521,10 @@ int dttsp_init(RIG *rig)
cmdpath = getenv("SDR_PARMPATH");
if (!cmdpath)
cmdpath = rig->state.rigport->type.rig == RIG_PORT_UDP_NETWORK ?
cmdpath = rig->state.rigport.type.rig == RIG_PORT_UDP_NETWORK ?
DEFAULT_DTTSP_CMD_NET_ADDR : DEFAULT_DTTSP_CMD_PATH;
strncpy(rig->state.rigport->pathname, cmdpath, HAMLIB_FILPATHLEN - 1);
strncpy(rig->state.rigport.pathname, cmdpath, HAMLIB_FILPATHLEN - 1);
return RIG_OK;
}
@ -567,18 +567,18 @@ int dttsp_open(RIG *rig)
}
/* open DttSP meter pipe */
priv->meter_port.post_write_delay = rig->state.rigport->post_write_delay;
priv->meter_port.timeout = rig->state.rigport->timeout;
priv->meter_port.retry = rig->state.rigport->retry;
priv->meter_port.post_write_delay = rig->state.rigport.post_write_delay;
priv->meter_port.timeout = rig->state.rigport.timeout;
priv->meter_port.retry = rig->state.rigport.retry;
p = getenv("SDR_METERPATH");
if (!p)
{
meterpath = priv->meter_port.pathname;
SNPRINTF(meterpath, HAMLIB_FILPATHLEN, "%s", rig->state.rigport->pathname);
SNPRINTF(meterpath, HAMLIB_FILPATHLEN, "%s", rig->state.rigport.pathname);
if (rig->state.rigport->type.rig == RIG_PORT_UDP_NETWORK)
if (rig->state.rigport.type.rig == RIG_PORT_UDP_NETWORK)
{
p = strrchr(meterpath, ':');
@ -611,7 +611,7 @@ int dttsp_open(RIG *rig)
}
else
{
priv->meter_port.type.rig = rig->state.rigport->type.rig;
priv->meter_port.type.rig = rig->state.rigport.type.rig;
ret = port_open(&priv->meter_port);
if (ret < 0)

Wyświetl plik

@ -220,7 +220,7 @@ int sdr1k_init(RIG *rig)
static void pdelay(RIG *rig)
{
unsigned char r;
par_read_data(rig->state.rigport, &r); /* ~1us */
par_read_data(&rig->state.rigport, &r); /* ~1us */
}
int sdr1k_open(RIG *rig)
@ -457,7 +457,7 @@ int
write_latch(RIG *rig, latch_t which, unsigned value, unsigned mask)
{
struct sdr1k_priv_data *priv = (struct sdr1k_priv_data *)rig->state.priv;
hamlib_port_t *pport = rig->state.rigport;
hamlib_port_t *pport = &rig->state.rigport;
if (!(L_EXT <= which && which <= L_DDS1))
{

Wyświetl plik

@ -261,7 +261,7 @@ int icmarine_transaction(RIG *rig, const char *cmd, const char *param,
rs = &rig->state;
priv = (struct icmarine_priv_data *)rs->priv;
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
/* command formatting */
SNPRINTF(cmdbuf, BUFSZ, "$PICOA,%02d,%02u,%s",
@ -284,7 +284,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, (unsigned char *) cmdbuf, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, cmd_len);
if (retval != RIG_OK)
{
@ -294,7 +294,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, (unsigned char *) respbuf, BUFSZ, LF, strlen(LF), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) respbuf, BUFSZ, LF, strlen(LF), 0, 1);
if (retval < 0)
{

Wyświetl plik

@ -154,11 +154,11 @@ int icom_one_transaction(RIG *rig, unsigned char cmd, int subcmd,
*/
set_transaction_active(rig);
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
if (data_len) { *data_len = 0; }
retval = write_block(rs->rigport, sendbuf, frm_len);
retval = write_block(&rs->rigport, sendbuf, frm_len);
if (retval != RIG_OK)
{
@ -178,7 +178,7 @@ int icom_one_transaction(RIG *rig, unsigned char cmd, int subcmd,
* up to rs->retry times.
*/
retval = read_icom_frame(rs->rigport, buf, sizeof(buf));
retval = read_icom_frame(&rs->rigport, buf, sizeof(buf));
if (retval == -RIG_ETIMEOUT || retval == 0)
{
@ -266,7 +266,7 @@ read_another_frame:
* ACKFRMLEN is the smallest frame we can expect from the rig
*/
buf[0] = 0;
frm_len = read_icom_frame(rs->rigport, buf, sizeof(buf));
frm_len = read_icom_frame(&rs->rigport, buf, sizeof(buf));
#if 0
@ -277,7 +277,7 @@ read_another_frame:
// Hmmm -- got an echo back when not expected so let's change
priv->serial_USB_echo_off = 0;
// And try again
frm_len = read_icom_frame(rs->rigport, buf, sizeof(buf));
frm_len = read_icom_frame(&rs->rigport, buf, sizeof(buf));
}
#endif
@ -377,7 +377,7 @@ read_another_frame:
elapsed_ms = (int)(elapsed_time.tv_sec * 1000 + elapsed_time.tv_usec / 1000);
if (elapsed_ms > rs->rigport->timeout)
if (elapsed_ms > rs->rigport.timeout)
{
set_transaction_inactive(rig);
RETURNFUNC(-RIG_ETIMEOUT);
@ -402,7 +402,7 @@ read_another_frame:
/*
* icom_transaction
*
* This function honors rigport->retry count.
* This function honors rigport.retry count.
*
* We assume that rig!=NULL, rig->state!= NULL, payload!=NULL, data!=NULL, data_len!=NULL
* Otherwise, you'll get a nice seg fault. You've been warned!
@ -423,7 +423,7 @@ int icom_transaction(RIG *rig, int cmd, int subcmd,
"%s: cmd=0x%02x, subcmd=0x%02x, payload_len=%d\n", __func__,
cmd, subcmd, payload_len);
retry = rig->state.rigport->retry;
retry = rig->state.rigport.retry;
do
{

Wyświetl plik

@ -755,7 +755,7 @@ int icom_get_usb_echo_off(RIG *rig)
priv->serial_USB_echo_off = 0;
// we should have a freq response so we'll read it and don't really care
// flushing doesn't always work as it depends on timing
retval = read_icom_frame(rs->rigport, buf, sizeof(buf));
retval = read_icom_frame(&rs->rigport, buf, sizeof(buf));
rig_debug(RIG_DEBUG_VERBOSE, "%s: USB echo on detected, get freq retval=%d\n", __func__, retval);
if (retval <= 0) RETURNFUNC(-RIG_ETIMEOUT);
}
@ -929,11 +929,11 @@ icom_rig_open(RIG *rig)
struct rig_state *rs = &rig->state;
struct icom_priv_data *priv = (struct icom_priv_data *) rs->priv;
int retry_flag = 1;
short retry_save = rs->rigport->retry;
short retry_save = rs->rigport.retry;
ENTERFUNC;
rs->rigport->retry = 0;
rs->rigport.retry = 0;
priv->no_1a_03_cmd = ENUM_1A_03_UNK;
@ -956,7 +956,7 @@ retry_open:
if (retval == RIG_OK) // then we know our echo status
{
rig_debug(RIG_DEBUG_TRACE, "%s: echo status known, getting frequency\n", __func__);
rs->rigport->retry = 0;
rs->rigport.retry = 0;
rig->state.current_vfo = icom_current_vfo(rig);
// some rigs like the IC7100 still echo when in standby
// so asking for freq now should timeout if such a rig
@ -983,7 +983,7 @@ retry_open:
// if not implemented than we're at an error here
if (retval != RIG_OK)
{
rs->rigport->retry = retry_save;
rs->rigport.retry = retry_save;
rig_debug(RIG_DEBUG_ERR, "%s: rig_set_powerstat failed: %s\n", __func__,
rigerror(retval));
@ -1003,7 +1003,7 @@ retry_open:
if (retval_echo != 0 && retval_echo != 1)
{
rig_debug(RIG_DEBUG_ERR, "%s: Unable to determine USB echo status\n", __func__);
rs->rigport->retry = retry_save;
rs->rigport.retry = retry_save;
RETURNFUNC(retval_echo);
}
}
@ -1018,7 +1018,7 @@ retry_open:
goto retry_open;
}
rs->rigport->retry = retry_save;
rs->rigport.retry = retry_save;
}
priv->poweron = (retval == RIG_OK) ? 1 : 0;
@ -1053,7 +1053,7 @@ retry_open:
icom_get_freq_range(rig); // try get to get rig range capability dyamically
#endif
rs->rigport->retry = retry_save;
rs->rigport.retry = retry_save;
RETURNFUNC(RIG_OK);
}
@ -5575,14 +5575,14 @@ int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
{
if (priv->x25cmdfails == 0)
{
int retry_save = rs->rigport->retry;
rs->rigport->retry = 0;
int retry_save = rs->rigport.retry;
rs->rigport.retry = 0;
cmd = C_SEND_SEL_FREQ;
subcmd = 0x01; // get the unselected vfo
retval = icom_transaction(rig, cmd, subcmd, NULL, 0, ackbuf,
&ack_len);
rs->rigport->retry = retry_save;
rs->rigport.retry = retry_save;
if (retval == RIG_OK) // then we're done!!
{
@ -7795,8 +7795,8 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
// elimininate retries to speed this up
// especially important when rig is not turned on
retry_save = rs->rigport->retry;
rs->rigport->retry = 0;
retry_save = rs->rigport.retry;
rs->rigport.retry = 0;
switch (status)
{
@ -7809,7 +7809,7 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
// we'll just send a few more to be sure for all speeds
memset(fe_buf, 0xfe, fe_max);
// sending more than enough 0xfe's to wake up the rs232
write_block(rs->rigport, fe_buf, fe_max);
write_block(&rs->rigport, fe_buf, fe_max);
// we'll try 0x18 0x01 now -- should work on STBY rigs too
pwr_sc = S_PWR_ON;
@ -7865,7 +7865,7 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
}
}
rs->rigport->retry = retry_save;
rs->rigport.retry = retry_save;
if (i == retry)
{
@ -8817,7 +8817,7 @@ int icom_decode_event(RIG *rig)
rs = &rig->state;
priv = (struct icom_priv_data *) rs->priv;
frm_len = read_icom_frame(rs->rigport, buf, sizeof(buf));
frm_len = read_icom_frame(&rs->rigport, buf, sizeof(buf));
if (frm_len == -RIG_ETIMEOUT)
{
@ -8875,7 +8875,7 @@ int icom_decode_event(RIG *rig)
int icom_read_frame_direct(RIG *rig, size_t buffer_length, const unsigned char *buffer)
{
return read_icom_frame_direct(rig->state.rigport, buffer, buffer_length);
return read_icom_frame_direct(&rig->state.rigport, buffer, buffer_length);
}
int icom_set_raw(RIG *rig, int cmd, int subcmd, int subcmdbuflen,

Wyświetl plik

@ -631,7 +631,7 @@ int optoscan_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
{
/* time for CIV command to be sent. this is subtracted from */
/* rcvr settle time */
state->usleep_time = (1000000 / (rig->state.rigport->parm.serial.rate))
state->usleep_time = (1000000 / (rig->state.rigport.parm.serial.rate))
* 13 * 9;
rc = cb(rig, vfo, &(state->next_freq), &(state->next_mode),
@ -667,7 +667,7 @@ int optoscan_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
optoscan_wait_timer(rig, state); /*Step 5*/
ser_get_car(rs->rigport, &pin_state);
ser_get_car(&rs->rigport, &pin_state);
if (pin_state) /*Step 6*/
{
@ -800,8 +800,8 @@ static int optoscan_RTS_toggle(RIG *rig)
int state = 0;
rs = &rig->state;
ser_get_rts(rs->rigport, &state);
ser_set_rts(rs->rigport, !state);
ser_get_rts(&rs->rigport, &state);
ser_set_rts(&rs->rigport, !state);
return RIG_OK;
}

Wyświetl plik

@ -74,11 +74,11 @@ int jrc_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, int *dat
rs = &rig->state;
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
set_transaction_active(rig);
retval = write_block(rs->rigport, (unsigned char *) cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -92,7 +92,7 @@ int jrc_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, int *dat
return 0;
}
retval = read_string(rs->rigport, (unsigned char *) 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);
@ -1626,8 +1626,8 @@ int jrc_decode_event(RIG *rig)
/* "Iabdfg"CR */
//#define SETUP_STATUS_LEN 17
//count = read_string(rs->rigport, buf, SETUP_STATUS_LEN, "", 0);
count = read_string(rs->rigport, (unsigned char *) buf, priv->info_len, "", 0, 0, 1);
//count = read_string(&rs->rigport, buf, SETUP_STATUS_LEN, "", 0);
count = read_string(&rs->rigport, (unsigned char *) buf, priv->info_len, "", 0, 0, 1);
if (count < 0)
{

Wyświetl plik

@ -301,7 +301,7 @@ static int jst145_open(RIG *rig)
pbwidth_t width;
struct jst145_priv_data *priv = rig->state.priv;
retval = write_block(rig->state.rigport, (unsigned char *) "H1\r", 3);
retval = write_block(&rig->state.rigport, (unsigned char *) "H1\r", 3);
if (retval != RIG_OK)
{
@ -320,7 +320,7 @@ static int jst145_open(RIG *rig)
static int jst145_close(RIG *rig)
{
return write_block(rig->state.rigport, (unsigned char *) "H0\r", 3);
return write_block(&rig->state.rigport, (unsigned char *) "H0\r", 3);
}
static int jst145_set_vfo(RIG *rig, vfo_t vfo)
@ -328,7 +328,7 @@ static int jst145_set_vfo(RIG *rig, vfo_t vfo)
char cmd[MAX_LEN];
SNPRINTF(cmd, sizeof(cmd), "F%c\r", vfo == RIG_VFO_A ? 'A' : 'B');
return write_block(rig->state.rigport, (unsigned char *) cmd, strlen(cmd));
return write_block(&rig->state.rigport, (unsigned char *) cmd, strlen(cmd));
}
static int jst145_get_vfo(RIG *rig, vfo_t *vfo)
@ -389,7 +389,7 @@ static int jst145_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
priv->freqA = freq;
}
retval = write_block(rig->state.rigport, (unsigned char *) freqbuf, strlen(freqbuf));
retval = write_block(&rig->state.rigport, (unsigned char *) freqbuf, strlen(freqbuf));
if (retval != RIG_OK)
{
@ -473,7 +473,7 @@ static int jst145_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
return -RIG_EINVAL;
}
retval = write_block(rig->state.rigport, (unsigned char *) modestr, strlen(modestr));
retval = write_block(&rig->state.rigport, (unsigned char *) modestr, strlen(modestr));
if (retval != RIG_OK)
{
@ -537,7 +537,7 @@ static int jst145_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_AGC: {
char *cmd = val.i == RIG_AGC_SLOW ? "G0\r" : (val.i == RIG_AGC_FAST ? "G1\r" : "G2\r");
return write_block(rig->state.rigport, (unsigned char *) cmd, 3);
return write_block(&rig->state.rigport, (unsigned char *) cmd, 3);
}
default:
@ -553,7 +553,7 @@ static int jst145_set_mem(RIG *rig, vfo_t vfo, int ch)
SNPRINTF(membuf, sizeof(membuf), "C%03d\r", ch);
return write_block(rig->state.rigport, (unsigned char *) membuf, strlen(membuf));
return write_block(&rig->state.rigport, (unsigned char *) membuf, strlen(membuf));
}
static int jst145_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
@ -561,7 +561,7 @@ static int jst145_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
switch (op)
{
case RIG_OP_FROM_VFO:
return write_block(rig->state.rigport, (unsigned char *) "E1\r", 3);
return write_block(&rig->state.rigport, (unsigned char *) "E1\r", 3);
default:
return -RIG_EINVAL;
@ -577,7 +577,7 @@ static int jst145_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
rig_debug(RIG_DEBUG_TRACE, "%s: entered\n", __func__);
SNPRINTF(cmd, sizeof(cmd), "X%c\r", ptt ? '1' : '0');
priv->ptt = ptt;
return write_block(rig->state.rigport, (unsigned char *) cmd, strlen(cmd));
return write_block(&rig->state.rigport, (unsigned char *) cmd, strlen(cmd));
}
static int jst145_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)

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, (unsigned char *) "H1", 2);
return write_block(&rig->state.rigport, (unsigned char *) "H1", 2);
}
static int nrd525_close(RIG *rig)
{
return write_block(rig->state.rigport, (unsigned char *) "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)
SNPRINTF(freqbuf, sizeof(freqbuf), "F%08u", (unsigned)(freq / 10));
return write_block(rig->state.rigport, (unsigned char *) 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, (unsigned char *) modestr, strlen(modestr));
retval = write_block(&rig->state.rigport, (unsigned char *) modestr, strlen(modestr));
if (retval != RIG_OK)
{
@ -221,10 +221,10 @@ 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, (unsigned char *) (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,
return write_block(&rig->state.rigport,
(unsigned char *) (val.i == RIG_AGC_SLOW ? "G0" :
(val.i == RIG_AGC_FAST ? "G1" : "G2")), 2);
@ -239,7 +239,7 @@ static int nrd525_set_mem(RIG *rig, vfo_t vfo, int ch)
SNPRINTF(membuf, sizeof(membuf), "C%03d", ch);
return write_block(rig->state.rigport, (unsigned char *) 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)
@ -247,7 +247,7 @@ 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, (unsigned char *) "E1", 2);
return write_block(&rig->state.rigport, (unsigned char *) "E1", 2);
default:
return -RIG_EINVAL;

Wyświetl plik

@ -84,16 +84,16 @@ static int kachina_transaction(RIG *rig, unsigned char cmd1, unsigned char cmd2)
buf4[2] = cmd2;
buf4[3] = ETX;
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = write_block(rs->rigport, buf4, 4);
retval = write_block(&rs->rigport, buf4, 4);
if (retval != RIG_OK)
{
return retval;
}
count = read_string(rs->rigport, buf4, 1, "", 0, 0, 1);
count = read_string(&rs->rigport, buf4, 1, "", 0, 0, 1);
if (count != 1)
{
@ -119,16 +119,16 @@ static int kachina_trans_n(RIG *rig, unsigned char cmd1, const char *data,
cmd_len = data_len + 3;
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = write_block(rs->rigport, buf, cmd_len);
retval = write_block(&rs->rigport, buf, cmd_len);
if (retval != RIG_OK)
{
return retval;
}
count = read_string(rs->rigport, buf, 1, "", 0, 0, 1);
count = read_string(&rs->rigport, buf, 1, "", 0, 0, 1);
if (count != 1)
{
@ -270,9 +270,9 @@ int kachina_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
/* telemetry sent to the PC automatically at a 50msec rate */
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
count = read_string(rig->state.rigport, 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, (unsigned char *) cmd, strlen(cmd));
err = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (err != RIG_OK)
{
@ -135,7 +135,7 @@ int elecraft_open(RIG *rig)
return err;
}
err = read_string(rs->rigport, (unsigned char *) buf, sizeof(buf),
err = read_string(&rs->rigport, (unsigned char *) buf, sizeof(buf),
";", 1, 0, 1);
if (err < 0)

Wyświetl plik

@ -89,9 +89,9 @@ int ic10_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rs = &rig->state;
transaction:
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = write_block(rs->rigport, (unsigned char *) cmd, cmd_len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, cmd_len);
if (retval != RIG_OK)
{
@ -103,16 +103,16 @@ transaction:
char buffer[50];
struct kenwood_priv_data *priv = rig->state.priv;
if (RIG_OK != (retval = write_block(rs->rigport, (unsigned char *) 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, (unsigned char *) 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)
if (buffer[0] == '?' && retry_cmd++ < rs->rigport.retry)
{
rig_debug(RIG_DEBUG_ERR, "%s: retrying cmd #%d\n", __func__, retry_cmd);
goto transaction;
@ -128,7 +128,7 @@ transaction:
return RIG_OK;
}
retval = read_string(rs->rigport, (unsigned char *) data, 50, ";", 1, 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, 50, ";", 1, 0, 1);
if (retval == -RIG_ETIMEOUT)
{

Wyświetl plik

@ -257,7 +257,7 @@ int kenwood_transaction(RIG *rig, const char *cmdstr, char *data,
rs->transaction_active = 1;
/* Emulators don't need any post_write_delay */
if (priv->is_emulation) { rs->rigport->post_write_delay = 0; }
if (priv->is_emulation) { rs->rigport.post_write_delay = 0; }
// if this is an IF cmdstr and not the first time through check cache
if (strcmp(cmdstr, "IF") == 0 && priv->cache_start.tv_sec != 0)
@ -316,9 +316,9 @@ transaction_write:
}
/* flush anything in the read buffer before command is sent */
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = write_block(rs->rigport, (unsigned char *) cmd, len);
retval = write_block(&rs->rigport, (unsigned char *) cmd, len);
free(cmd);
@ -359,7 +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, (unsigned char *) 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;
}
@ -369,7 +369,7 @@ 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, (unsigned char *) buffer, len,
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);
@ -377,12 +377,12 @@ transaction_read:
if (retval < 0)
{
rig_debug(RIG_DEBUG_WARN,
"%s: read_string retval < 0, retval = %d, retry_read=%d, rs->rigport->retry=%d\n",
"%s: read_string retval < 0, retval = %d, retry_read=%d, rs->rigport.retry=%d\n",
__func__,
retval, retry_read, rs->rigport->retry);
retval, retry_read, rs->rigport.retry);
// only retry if we expect a response from the command
if (retry_read++ < rs->rigport->retry)
if (retry_read++ < rs->rigport.retry)
{
if (datasize)
{
@ -403,7 +403,7 @@ transaction_read:
rig_debug(RIG_DEBUG_ERR, "%s: Command is not correctly terminated '%s'\n",
__func__, buffer);
if (retry_read++ < rs->rigport->retry)
if (retry_read++ < rs->rigport.retry)
{
goto transaction_write;
}
@ -435,7 +435,7 @@ transaction_read:
rig_debug(RIG_DEBUG_VERBOSE, "%s: Overflow for '%s'\n", __func__, cmdstr);
}
if (retry_read++ < rs->rigport->retry)
if (retry_read++ < rs->rigport.retry)
{
goto transaction_write;
}
@ -452,7 +452,7 @@ transaction_read:
cmdstr);
}
if (retry_read++ < rs->rigport->retry)
if (retry_read++ < rs->rigport.retry)
{
goto transaction_write;
}
@ -476,7 +476,7 @@ transaction_read:
}
}
if (retry_read++ < rs->rigport->retry)
if (retry_read++ < rs->rigport.retry)
{
rig_debug(RIG_DEBUG_ERR, "%s: Retrying shortly\n", __func__);
hl_usleep(rig->caps->timeout * 1000);
@ -506,10 +506,10 @@ transaction_read:
rig_debug(RIG_DEBUG_ERR, "%s: wrong reply %c%c for command %c%c\n",
__func__, buffer[0], buffer[1], cmdstr[0], cmdstr[1]);
rig_debug(RIG_DEBUG_ERR, "%s: retry_read=%d, rs->rigport->retry=%d\n", __func__,
retry_read, rs->rigport->retry);
rig_debug(RIG_DEBUG_ERR, "%s: retry_read=%d, rs->rigport.retry=%d\n", __func__,
retry_read, rs->rigport.retry);
if (retry_read++ < rs->rigport->retry)
if (retry_read++ < rs->rigport.retry)
{
goto transaction_write;
}
@ -558,7 +558,7 @@ transaction_read:
__func__, buffer[0], buffer[1]
, priv->verify_cmd[0], priv->verify_cmd[1]);
if (retry_read++ < rs->rigport->retry)
if (retry_read++ < rs->rigport.retry)
{
goto transaction_write;
}
@ -650,7 +650,7 @@ int kenwood_safe_transaction(RIG *rig, const char *cmd, char *buf,
hl_usleep(50 * 1000); // let's do a short wait
}
}
while (err != RIG_OK && ++retry < rig->state.rigport->retry);
while (err != RIG_OK && ++retry < rig->state.rigport.retry);
RETURNFUNC(err);
}
@ -763,12 +763,12 @@ int kenwood_open(RIG *rig)
int err, i;
char *idptr;
char id[KENWOOD_MAX_BUF_LEN];
int retry_save = rig->state.rigport->retry;
int retry_save = rig->state.rigport.retry;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
id[0] = 0;
rig->state.rigport->retry = 0;
rig->state.rigport.retry = 0;
err = kenwood_get_id(rig, id);
if (err != RIG_OK)
@ -833,7 +833,7 @@ int kenwood_open(RIG *rig)
if (RIG_OK != err)
{
rig_debug(RIG_DEBUG_ERR, "%s: cannot get f/w version\n", __func__);
rig->state.rigport->retry = retry_save;
rig->state.rigport.retry = retry_save;
RETURNFUNC(err);
}
@ -849,7 +849,7 @@ int kenwood_open(RIG *rig)
else
{
rig_debug(RIG_DEBUG_ERR, "%s: cannot get f/w version\n", __func__);
rig->state.rigport->retry = retry_save;
rig->state.rigport.retry = retry_save;
RETURNFUNC(-RIG_EPROTO);
}
@ -867,7 +867,7 @@ int kenwood_open(RIG *rig)
if (RIG_OK != err)
{
rig_debug(RIG_DEBUG_ERR, "%s: no response from rig\n", __func__);
rig->state.rigport->retry = retry_save;
rig->state.rigport.retry = retry_save;
RETURNFUNC(err);
}
@ -884,7 +884,7 @@ int kenwood_open(RIG *rig)
if (err != RIG_OK)
{
rig_debug(RIG_DEBUG_ERR, "%s: cannot get identification\n", __func__);
rig->state.rigport->retry = retry_save;
rig->state.rigport.retry = retry_save;
RETURNFUNC(err);
}
}
@ -971,7 +971,7 @@ int kenwood_open(RIG *rig)
rig_strvfo(priv->tx_vfo));
}
rig->state.rigport->retry = retry_save;
rig->state.rigport.retry = retry_save;
RETURNFUNC(RIG_OK);
}
@ -992,7 +992,7 @@ int kenwood_open(RIG *rig)
// we're making this non fatal
// mismatched IDs can still be tested
rig->state.rigport->retry = retry_save;
rig->state.rigport.retry = retry_save;
RETURNFUNC(RIG_OK);
}
@ -2695,11 +2695,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, (unsigned char *) cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval != RIG_OK) { RETURNFUNC(retval); }
retval = read_string(rs->rigport, (unsigned char *) 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);
@ -2794,11 +2794,11 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min,
RETURNFUNC(RIG_OK);
}
retval = write_block(rs->rigport, (unsigned char *) cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval != RIG_OK) { RETURNFUNC(retval); }
retval = read_string(rs->rigport, (unsigned char *) 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);
@ -3455,8 +3455,8 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
// This could be done by rig but easy enough to make it automagic
if (priv->ag_format < 0)
{
int retry_save = rig->state.rigport->retry;
rig->state.rigport->retry = 0; // speed up this check so no retries
int retry_save = rig->state.rigport.retry;
rig->state.rigport.retry = 0; // speed up this check so no retries
rig_debug(RIG_DEBUG_TRACE, "%s: AF format check determination...\n", __func__);
// Determine AG format
// =-1 == Undetermine
@ -3494,7 +3494,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
}
}
rig->state.rigport->retry = retry_save;
rig->state.rigport.retry = retry_save;
}
rig_debug(RIG_DEBUG_TRACE, "%s: ag_format=%d\n", __func__, priv->ag_format);
@ -4704,11 +4704,11 @@ int kenwood_set_powerstat(RIG *rig, powerstat_t status)
(status == RIG_POWER_ON) ? ";;;;PS1;" : "PS0",
NULL, 0);
int i = 0;
int retry_save = rig->state.rigport->retry;
int retry_save = rig->state.rigport.retry;
rig_debug(RIG_DEBUG_VERBOSE, "%s called status=%d\n", __func__, status);
rig->state.rigport->retry = 0;
rig->state.rigport.retry = 0;
if (status == RIG_POWER_ON) // wait for wakeup only
{
@ -4720,7 +4720,7 @@ int kenwood_set_powerstat(RIG *rig, powerstat_t status)
if (retval == RIG_OK)
{
rig->state.rigport->retry = retry_save;
rig->state.rigport.retry = retry_save;
RETURNFUNC(retval);
}
@ -4728,7 +4728,7 @@ int kenwood_set_powerstat(RIG *rig, powerstat_t status)
}
}
rig->state.rigport->retry = retry_save;
rig->state.rigport.retry = retry_save;
if (i == 9)
{

Wyświetl plik

@ -89,9 +89,9 @@ int ts450_open(RIG *rig)
return err;
}
maxtries = rig->state.rigport->retry;
maxtries = rig->state.rigport.retry;
/* no retry for this command that may be missing */
rig->state.rigport->retry = 0;
rig->state.rigport.retry = 0;
err = kenwood_simple_transaction(rig, "TO", 3);
@ -102,7 +102,7 @@ int ts450_open(RIG *rig)
rig->state.has_get_func &= ~RIG_FUNC_TONE;
}
rig->state.rigport->retry = maxtries;
rig->state.rigport.retry = maxtries;
return 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, (unsigned char *) 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, (unsigned char *) 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

@ -187,7 +187,7 @@ int xg3_init(RIG *rig)
}
rig->state.priv = (void *)priv;
rig->state.rigport->type.rig = RIG_PORT_SERIAL;
rig->state.rigport.type.rig = RIG_PORT_SERIAL;
// Tried set_trn to turn transceiver on/off but turning it on isn't enabled in hamlib for some reason
// So we use PTT instead
// rig->state.transceive = RIG_TRN_RIG; // this allows xg3_set_trn to be called
@ -276,7 +276,7 @@ int xg3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
case RIG_LEVEL_RFPOWER:
SNPRINTF(cmdbuf, sizeof(cmdbuf), "L;");
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval != RIG_OK)
{
@ -285,7 +285,7 @@ int xg3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
return retval;
}
retval = read_string(rs->rigport, (unsigned char *) replybuf, replysize,
retval = read_string(&rs->rigport, (unsigned char *) replybuf, replysize,
";", 1, 0, 1);
if (retval < 0)
@ -455,7 +455,7 @@ int xg3_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
SNPRINTF(cmdbuf, sizeof(cmdbuf), "F;");
}
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval != RIG_OK)
{
@ -463,7 +463,7 @@ int xg3_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
return retval;
}
retval = read_string(rs->rigport, (unsigned char *) freqbuf, freqsize,
retval = read_string(&rs->rigport, (unsigned char *) freqbuf, freqsize,
";", 1, 0, 1);
if (retval < 0)
@ -516,7 +516,7 @@ int xg3_get_powerstat(RIG *rig, powerstat_t *status)
if (retval == RIG_OK)
{
char reply[32];
retval = read_string(rs->rigport, (unsigned char *) reply, sizeof(reply),
retval = read_string(&rs->rigport, (unsigned char *) reply, sizeof(reply),
";", 1, 0, 1);
*status = RIG_POWER_ON;
priv->powerstat = RIG_POWER_ON;
@ -581,7 +581,7 @@ int xg3_get_mem(RIG *rig, vfo_t vfo, int *ch)
return retval;
}
retval = read_string(rs->rigport, (unsigned char *) reply, sizeof(reply),
retval = read_string(&rs->rigport, (unsigned char *) reply, sizeof(reply),
";", 1, 0, 1);
if (retval < 0)

Wyświetl plik

@ -352,7 +352,7 @@ int dds60_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
unsigned long frg;
unsigned char control;
struct dds60_priv_data *priv;
hamlib_port_t *port = rig->state.rigport;
hamlib_port_t *port = &rig->state.rigport;
freq_t osc_ref;
priv = (struct dds60_priv_data *)rig->state.priv;
@ -383,7 +383,7 @@ int dds60_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
int dds60_open(RIG *rig)
{
hamlib_port_t *port = rig->state.rigport;
hamlib_port_t *port = &rig->state.rigport;
/* lock the parallel port */
par_lock(port);

Wyświetl plik

@ -416,7 +416,7 @@ int drt1_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
unsigned cfr2;
struct drt1_priv_data *priv;
hamlib_port_t *port = rig->state.rigport;
hamlib_port_t *port = &rig->state.rigport;
priv = (struct drt1_priv_data *)rig->state.priv;

Wyświetl plik

@ -625,7 +625,7 @@ const struct rig_caps dwt_caps =
int dwt_init(RIG *rig)
{
hamlib_port_t *rp = rig->state.rigport;
hamlib_port_t *rp = &rig->state.rigport;
rp->parm.usb.vid = USB_VID_CT;
rp->parm.usb.pid = USB_PID_CT_DWT;
@ -639,7 +639,7 @@ int dwt_init(RIG *rig)
#define MSG_LEN 16
int dwt_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
int request, value, index;
unsigned char buf[MSG_LEN] = { 0x4a, 0x00, 0x03, 0x00, 0xff, 0xff, 0x32 };
int requesttype, r;
@ -672,7 +672,7 @@ int dwt_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
const char *dwt_get_info(RIG *rig)
{
static char buf[64];
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
struct libusb_device_descriptor desc;
/* always succeeds since libusb-1.0.16 */

Wyświetl plik

@ -346,7 +346,7 @@ int elektor304_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
unsigned fhl, fhh, fll, flh;
struct elektor304_priv_data *priv;
hamlib_port_t *port = rig->state.rigport;
hamlib_port_t *port = &rig->state.rigport;
priv = (struct elektor304_priv_data *)rig->state.priv;

Wyświetl plik

@ -377,7 +377,7 @@ const char *elektor507_get_info(RIG *rig)
*/
int elektor507_init(RIG *rig)
{
hamlib_port_t *rp = rig->state.rigport;
hamlib_port_t *rp = &rig->state.rigport;
struct elektor507_priv_data *priv;
rig->state.priv = (struct elektor507_priv_data *)calloc(sizeof(struct
@ -430,7 +430,7 @@ int elektor507_cleanup(RIG *rig)
const char *elektor507_get_info(RIG *rig)
{
static char buf[64];
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
struct libusb_device_descriptor desc;
/* always succeeds since libusb-1.0.16 */
@ -443,7 +443,7 @@ const char *elektor507_get_info(RIG *rig)
int elektor507_libusb_setup(RIG *rig)
{
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
int ret;
unsigned short index = 0, usb_val;
@ -504,7 +504,7 @@ int elektor507_libusb_setup(RIG *rig)
int elektor507_ftdi_write_data(RIG *rig, void *FTOutBuf,
unsigned long BufferSize)
{
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
int ret, actual_length;
rig_debug(RIG_DEBUG_TRACE, "%s called, %lu bytes\n", __func__, BufferSize);

Wyświetl plik

@ -279,12 +279,12 @@ static int fifisdr_usb_write(RIG *rig,
unsigned char *bytes, int size)
{
int ret;
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
ret = libusb_control_transfer(udh,
LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT,
request, value, index,
bytes, size, rig->state.rigport->timeout);
bytes, size, rig->state.rigport.timeout);
if (ret != size)
{
@ -306,12 +306,12 @@ static int fifisdr_usb_read(RIG *rig,
unsigned char *bytes, int size)
{
int ret;
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
ret = libusb_control_transfer(udh,
LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_IN,
request, value, index,
bytes, size, rig->state.rigport->timeout);
bytes, size, rig->state.rigport.timeout);
if (ret != size)
{
@ -329,7 +329,7 @@ static int fifisdr_usb_read(RIG *rig,
int fifisdr_init(RIG *rig)
{
hamlib_port_t *rp = rig->state.rigport;
hamlib_port_t *rp = &rig->state.rigport;
struct fifisdr_priv_instance_data *priv;
rig->state.priv = (struct fifisdr_priv_instance_data *)calloc(sizeof(

Wyświetl plik

@ -234,7 +234,7 @@ const struct rig_caps funcubeplus_caps =
int funcube_init(RIG *rig)
{
hamlib_port_t *rp = rig->state.rigport;
hamlib_port_t *rp = &rig->state.rigport;
struct funcube_priv_data *priv;
rig->state.priv = (struct funcube_priv_data *)calloc(sizeof(
@ -264,7 +264,7 @@ int funcube_init(RIG *rig)
int funcubeplus_init(RIG *rig)
{
hamlib_port_t *rp = rig->state.rigport;
hamlib_port_t *rp = &rig->state.rigport;
struct funcube_priv_data *priv;
rig->state.priv = (struct funcube_priv_data *)calloc(sizeof(
@ -313,7 +313,7 @@ int funcube_cleanup(RIG *rig)
const char *funcube_get_info(RIG *rig)
{
static char buf[64];
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
struct libusb_device_descriptor desc;
/* always succeeds since libusb-1.0.16 */
@ -436,12 +436,12 @@ int set_freq_v1(libusb_device_handle *udh, unsigned int f, int timeout)
int funcube_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
struct funcube_priv_data *priv = (struct funcube_priv_data *)rig->state.priv;
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
int ret;
if ((ret = set_freq_v1(udh, freq, rig->state.rigport->timeout)) != RIG_OK)
if ((ret = set_freq_v1(udh, freq, rig->state.rigport.timeout)) != RIG_OK)
{
if ((ret = set_freq_v0(udh, freq, rig->state.rigport->timeout)) == RIG_OK)
if ((ret = set_freq_v0(udh, freq, rig->state.rigport.timeout)) == RIG_OK)
{
priv->freq = freq;
}
@ -468,7 +468,7 @@ int get_freq_v0(RIG *rig, vfo_t vfo, freq_t *freq)
int get_freq_v1(RIG *rig, vfo_t vfo, freq_t *freq)
{
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
int ret;
unsigned int f;
int actual_length;
@ -483,7 +483,7 @@ int get_freq_v1(RIG *rig, vfo_t vfo, freq_t *freq)
au8BufOut[3] & 0xFF);
ret = libusb_interrupt_transfer(udh, OUTPUT_ENDPOINT, au8BufOut,
sizeof(au8BufOut), &actual_length, rig->state.rigport->timeout);
sizeof(au8BufOut), &actual_length, rig->state.rigport.timeout);
if (ret < 0)
{
@ -493,7 +493,7 @@ int get_freq_v1(RIG *rig, vfo_t vfo, freq_t *freq)
}
ret = libusb_interrupt_transfer(udh, INPUT_ENDPOINT, au8BufIn, sizeof(au8BufIn),
&actual_length, rig->state.rigport->timeout);
&actual_length, rig->state.rigport.timeout);
if (ret < 0 || actual_length != sizeof(au8BufIn))
{
@ -536,7 +536,7 @@ int funcube_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
int funcube_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
int ret;
int actual_length;
unsigned char au8BufOut[64] = "\0\0\0\0"; // endpoint size
@ -609,7 +609,7 @@ int funcube_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
au8BufOut[3] & 0xFF);
ret = libusb_interrupt_transfer(udh, OUTPUT_ENDPOINT, au8BufOut,
sizeof(au8BufOut), &actual_length, rig->state.rigport->timeout);
sizeof(au8BufOut), &actual_length, rig->state.rigport.timeout);
if (ret < 0)
{
@ -619,7 +619,7 @@ int funcube_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
}
ret = libusb_interrupt_transfer(udh, INPUT_ENDPOINT, au8BufIn, sizeof(au8BufIn),
&actual_length, rig->state.rigport->timeout);
&actual_length, rig->state.rigport.timeout);
if (ret < 0 || actual_length != sizeof(au8BufIn))
{
@ -643,7 +643,7 @@ int funcube_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
int funcube_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
int ret;
int actual_length;
unsigned char au8BufOut[64] = "\0\0\0\0"; // endpoint size
@ -671,7 +671,7 @@ int funcube_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
au8BufOut[3] & 0xFF);
ret = libusb_interrupt_transfer(udh, OUTPUT_ENDPOINT, au8BufOut,
sizeof(au8BufOut), &actual_length, rig->state.rigport->timeout);
sizeof(au8BufOut), &actual_length, rig->state.rigport.timeout);
if (ret < 0)
{
@ -681,7 +681,7 @@ int funcube_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
}
ret = libusb_interrupt_transfer(udh, INPUT_ENDPOINT, au8BufIn, sizeof(au8BufIn),
&actual_length, rig->state.rigport->timeout);
&actual_length, rig->state.rigport.timeout);
if (ret < 0 || actual_length != sizeof(au8BufIn))
{
@ -768,7 +768,7 @@ int funcube_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
int funcube_hid_cmd(RIG *rig, unsigned char *au8BufOut, unsigned char *au8BufIn,
int inputSize)
{
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
int ret;
int actual_length;
rig_debug(RIG_DEBUG_TRACE, "%s: HID packet set to %02x%02x%02x%02x\n",
@ -776,7 +776,7 @@ int funcube_hid_cmd(RIG *rig, unsigned char *au8BufOut, unsigned char *au8BufIn,
au8BufOut[3] & 0xFF);
ret = libusb_interrupt_transfer(udh, OUTPUT_ENDPOINT, au8BufOut,
sizeof(au8BufOut), &actual_length, rig->state.rigport->timeout);
sizeof(au8BufOut), &actual_length, rig->state.rigport.timeout);
if (ret < 0)
{
@ -786,7 +786,7 @@ int funcube_hid_cmd(RIG *rig, unsigned char *au8BufOut, unsigned char *au8BufIn,
}
ret = libusb_interrupt_transfer(udh, INPUT_ENDPOINT, au8BufIn, inputSize,
&actual_length, rig->state.rigport->timeout);
&actual_length, rig->state.rigport.timeout);
if (ret < 0 || actual_length != inputSize)
{

Wyświetl plik

@ -198,9 +198,9 @@ 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, (unsigned 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, (unsigned 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)
{
@ -309,7 +309,7 @@ int hiqsdr_init(RIG *rig)
priv->split = RIG_SPLIT_OFF;
priv->ref_clock = REFCLOCK;
priv->sample_rate = DEFAULT_SAMPLE_RATE;
strncpy(rig->state.rigport->pathname, "192.168.2.196:48248",
strncpy(rig->state.rigport.pathname, "192.168.2.196:48248",
HAMLIB_FILPATHLEN - 1);
return RIG_OK;
@ -350,7 +350,7 @@ int hiqsdr_open(RIG *rig)
#if 0
/* Send the samples to me. FIXME: send to port 48247 */
ret = write_block(rig->state.rigport, buf_send_to_me, sizeof(buf_send_to_me));
ret = write_block(&rig->state.rigport, buf_send_to_me, sizeof(buf_send_to_me));
if (ret != RIG_OK)
{

Wyświetl plik

@ -46,11 +46,11 @@ static int miniVNA_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
rig_debug(RIG_DEBUG_TRACE, "%s called: %s %s\n", __func__,
rig_strvfo(vfo), fstr);
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
SNPRINTF(cmdstr, sizeof(cmdstr), "0\r%lu\r1\r0\r", (unsigned long int)(freq * DDS_RATIO));
retval = write_block(rig->state.rigport, (unsigned char *) cmdstr, strlen(cmdstr));
retval = write_block(&rig->state.rigport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{

Wyświetl plik

@ -53,17 +53,17 @@ static int rshfiq_open(RIG *rig)
stopset[1] = '\n';
rig_debug(RIG_DEBUG_TRACE, "%s: Port = %s\n", __func__,
rig->state.rigport->pathname);
rig->state.rigport->timeout = 2000;
rig->state.rigport->retry = 1;
retval = serial_open(rig->state.rigport);
rig->state.rigport.pathname);
rig->state.rigport.timeout = 2000;
rig->state.rigport.retry = 1;
retval = serial_open(&rig->state.rigport);
if (retval != RIG_OK)
{
return retval;
}
retval = ser_get_dtr(rig->state.rigport, &flag);
retval = ser_get_dtr(&rig->state.rigport, &flag);
if (retval == RIG_OK)
{
@ -77,7 +77,7 @@ static int rshfiq_open(RIG *rig)
if (flag == 0)
{
flag = 1; // Set DTR
retval = ser_set_dtr(rig->state.rigport, flag);
retval = ser_set_dtr(&rig->state.rigport, flag);
if (retval == RIG_OK)
{
@ -92,17 +92,17 @@ static int rshfiq_open(RIG *rig)
for (int init_retry_count = 0; (init_retry_count < RSHFIQ_INIT_RETRY)
&& (retval == -RIG_ETIMEOUT); init_retry_count++)
{
rig_flush(rig->state.rigport);
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, (unsigned char *) 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, (unsigned char *) versionstr, 20,
retval = read_string(&rig->state.rigport, (unsigned char *) versionstr, 20,
stopset, 2, 0, 1);
}
@ -111,7 +111,7 @@ static int rshfiq_open(RIG *rig)
return retval;
}
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
versionstr[retval] = 0;
rig_debug(RIG_DEBUG_TRACE, "%s: Rigversion = %s\n", __func__, versionstr);
@ -158,11 +158,11 @@ static int rshfiq_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
rig_debug(RIG_DEBUG_TRACE, "%s called: %s %s\n", __func__,
rig_strvfo(vfo), fstr);
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
SNPRINTF(cmdstr, sizeof(cmdstr), "*f%lu\r", (unsigned long int)(freq));
retval = write_block(rig->state.rigport, (unsigned char *) cmdstr, strlen(cmdstr));
retval = write_block(&rig->state.rigport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
@ -176,7 +176,7 @@ static int rshfiq_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
char cmdstr[15];
char stopset[2];
int retval;
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
stopset[0] = '\r';
stopset[1] = '\n';
@ -185,14 +185,14 @@ 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, (unsigned char *) 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, (unsigned char *) cmdstr, 9,
retval = read_string(&rig->state.rigport, (unsigned char *) cmdstr, 9,
stopset, 2, 0, 1);
if (retval <= 0)
@ -234,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, (unsigned char *) cmdstr, strlen(cmdstr));
retval = write_block(&rig->state.rigport, (unsigned char *) cmdstr, strlen(cmdstr));
return retval;
}
@ -262,13 +262,13 @@ static int rshfiq_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
return -RIG_ENAVAIL;
}
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
SNPRINTF(cmdstr, sizeof(cmdstr), "*L\r");
rig_debug(RIG_DEBUG_TRACE, "RIG_LEVEL_RFPOWER_METER command=%s\n", cmdstr);
retval = write_block(rig->state.rigport, (unsigned char *) cmdstr, strlen(cmdstr));
retval = write_block(&rig->state.rigport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
@ -278,7 +278,7 @@ 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, (unsigned char *) cmdstr, 9,
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);
@ -301,13 +301,13 @@ static int rshfiq_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
case RIG_LEVEL_TEMP_METER:
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
SNPRINTF(cmdstr, sizeof(cmdstr), "*T\r");
rig_debug(RIG_DEBUG_TRACE, "RIG_LEVEL_TEMP_METER command=%s\n", cmdstr);
retval = write_block(rig->state.rigport, (unsigned char *) cmdstr, strlen(cmdstr));
retval = write_block(&rig->state.rigport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
@ -317,7 +317,7 @@ 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, (unsigned char *) cmdstr, 9,
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

@ -570,7 +570,7 @@ static uint32_t getLongWord(unsigned char const *bytes)
*/
int si570avrusb_init(RIG *rig)
{
hamlib_port_t *rp = rig->state.rigport;
hamlib_port_t *rp = &rig->state.rigport;
struct si570xxxusb_priv_data *priv;
rig->state.priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
@ -611,7 +611,7 @@ int si570avrusb_init(RIG *rig)
*/
int si570peaberry1_init(RIG *rig)
{
hamlib_port_t *rp = rig->state.rigport;
hamlib_port_t *rp = &rig->state.rigport;
struct si570xxxusb_priv_data *priv;
rig->state.priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
@ -652,7 +652,7 @@ int si570peaberry1_init(RIG *rig)
*/
int si570peaberry2_init(RIG *rig)
{
hamlib_port_t *rp = rig->state.rigport;
hamlib_port_t *rp = &rig->state.rigport;
struct si570xxxusb_priv_data *priv;
rig->state.priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
@ -693,7 +693,7 @@ int si570peaberry2_init(RIG *rig)
*/
int si570picusb_init(RIG *rig)
{
hamlib_port_t *rp = rig->state.rigport;
hamlib_port_t *rp = &rig->state.rigport;
struct si570xxxusb_priv_data *priv;
rig->state.priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
@ -734,7 +734,7 @@ int si570picusb_init(RIG *rig)
int fasdr_init(RIG *rig)
{
hamlib_port_t *rp = rig->state.rigport;
hamlib_port_t *rp = &rig->state.rigport;
struct si570xxxusb_priv_data *priv;
rig->state.priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
@ -775,7 +775,7 @@ int fasdr_open(RIG *rig)
{
struct si570xxxusb_priv_data *priv = (struct si570xxxusb_priv_data *)
rig->state.priv;
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
int ret, i;
double f;
unsigned char buffer[4];
@ -785,7 +785,7 @@ int fasdr_open(RIG *rig)
ret = libusb_control_transfer(udh, REQUEST_TYPE_IN,
REQUEST_READ_VERSION, 0x0E00, 0,
buffer, 2, rig->state.rigport->timeout);
buffer, 2, rig->state.rigport.timeout);
if (ret != 2)
{
@ -801,7 +801,7 @@ int fasdr_open(RIG *rig)
ret = libusb_control_transfer(udh,
REQUEST_TYPE_IN,
REQUEST_READ_EEPROM, F_CAL_STATUS, 0, buffer, 1,
rig->state.rigport->timeout);
rig->state.rigport.timeout);
if (ret != 1)
{
@ -814,7 +814,7 @@ int fasdr_open(RIG *rig)
// ret = libusb_control_transfer(udh,
// REQUEST_TYPE_IN,
// REQUEST_READ_XTALL, 0, 0, (unsigned char *) &iFreq, sizeof(iFreq),
// rig->state.rigport->timeout);
// rig->state.rigport.timeout);
if (buffer[0] == 0xFF)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: Device not calibrated", __func__);
@ -826,7 +826,7 @@ int fasdr_open(RIG *rig)
ret = libusb_control_transfer(udh,
REQUEST_TYPE_IN,
REQUEST_READ_EEPROM, F_CRYST + i, 0, &buffer[i], 1,
rig->state.rigport->timeout);
rig->state.rigport.timeout);
if (ret != 1)
{
@ -967,7 +967,7 @@ int si570xxxusb_get_conf(RIG *rig, token_t token, char *val)
static int setBPF(RIG *rig, int enable)
{
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
/* allocate enough space for up to 16 filters */
unsigned short FilterCrossOver[16];
int nBytes;
@ -978,7 +978,7 @@ static int setBPF(RIG *rig, int enable)
nBytes = libusb_control_transfer(udh, REQUEST_TYPE_IN,
REQUEST_FILTERS, 0, 255,
(unsigned char *) FilterCrossOver, sizeof(FilterCrossOver),
rig->state.rigport->timeout);
rig->state.rigport.timeout);
if (nBytes < 0)
{
@ -991,7 +991,7 @@ static int setBPF(RIG *rig, int enable)
int retval = libusb_control_transfer(udh, REQUEST_TYPE_IN,
REQUEST_FILTERS, enable, (nBytes / 2) - 1,
(unsigned char *) FilterCrossOver, sizeof(FilterCrossOver),
rig->state.rigport->timeout);
rig->state.rigport.timeout);
if (retval < 2)
{
@ -1019,7 +1019,7 @@ int si570xxxusb_open(RIG *rig)
{
struct si570xxxusb_priv_data *priv = (struct si570xxxusb_priv_data *)
rig->state.priv;
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
int ret;
unsigned char buffer[4];
@ -1031,7 +1031,7 @@ int si570xxxusb_open(RIG *rig)
ret = libusb_control_transfer(udh, REQUEST_TYPE_IN,
REQUEST_READ_VERSION, 0x0E00, 0,
buffer, 2, rig->state.rigport->timeout);
buffer, 2, rig->state.rigport.timeout);
if (ret != 2)
{
@ -1052,7 +1052,7 @@ int si570xxxusb_open(RIG *rig)
ret = libusb_control_transfer(udh,
REQUEST_TYPE_IN,
REQUEST_READ_XTALL, 0, 0, buffer, sizeof(buffer),
rig->state.rigport->timeout);
rig->state.rigport.timeout);
if (ret != 4)
{
@ -1084,14 +1084,14 @@ int si570xxxusb_open(RIG *rig)
const char *si570xxxusb_get_info(RIG *rig)
{
static char buf[64];
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
struct libusb_device_descriptor desc;
int ret;
unsigned char buffer[2];
ret = libusb_control_transfer(udh, REQUEST_TYPE_IN,
REQUEST_READ_VERSION, 0x0E00, 0,
buffer, sizeof(buffer), rig->state.rigport->timeout);
buffer, sizeof(buffer), rig->state.rigport.timeout);
if (ret != 2)
{
@ -1198,7 +1198,7 @@ int si570xxxusb_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
struct si570xxxusb_priv_data *priv = (struct si570xxxusb_priv_data *)
rig->state.priv;
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
int ret;
unsigned char buffer[6];
int request = REQUEST_SET_FREQ;
@ -1238,7 +1238,7 @@ int si570xxxusb_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
buffer[0] = buffer[0] + (theSolution.HS_DIV << 5);
ret = libusb_control_transfer(udh, REQUEST_TYPE_OUT,
request, value, index, buffer, sizeof(buffer), rig->state.rigport->timeout);
request, value, index, buffer, sizeof(buffer), rig->state.rigport.timeout);
rig_debug(RIG_DEBUG_TRACE,
"%s: Freq=%.6f MHz, Real=%.6f MHz, buf=%02x%02x%02x%02x%02x%02x\n",
@ -1264,7 +1264,7 @@ int si570xxxusb_set_freq_by_value(RIG *rig, vfo_t vfo, freq_t freq)
{
struct si570xxxusb_priv_data *priv = (struct si570xxxusb_priv_data *)
rig->state.priv;
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
int ret;
unsigned char buffer[4];
@ -1283,7 +1283,7 @@ int si570xxxusb_set_freq_by_value(RIG *rig, vfo_t vfo, freq_t freq)
buffer[0], buffer[1], buffer[2], buffer[3]);
ret = libusb_control_transfer(udh, REQUEST_TYPE_OUT,
request, value, index, buffer, sizeof(buffer), rig->state.rigport->timeout);
request, value, index, buffer, sizeof(buffer), rig->state.rigport.timeout);
if (!ret)
{
@ -1334,7 +1334,7 @@ int si570xxxusb_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
{
struct si570xxxusb_priv_data *priv = (struct si570xxxusb_priv_data *)
rig->state.priv;
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
unsigned char buffer[6];
int ret;
@ -1347,7 +1347,7 @@ int si570xxxusb_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
ret = libusb_control_transfer(udh, REQUEST_TYPE_IN,
REQUEST_READ_REGISTERS, priv->i2c_addr, 0,
buffer, sizeof(buffer), rig->state.rigport->timeout);
buffer, sizeof(buffer), rig->state.rigport.timeout);
if (ret <= 0)
{
@ -1366,14 +1366,14 @@ int si570xxxusb_get_freq_by_value(RIG *rig, vfo_t vfo, freq_t *freq)
{
struct si570xxxusb_priv_data *priv = (struct si570xxxusb_priv_data *)
rig->state.priv;
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
int ret;
unsigned char buffer[4];
uint32_t iFreq;
ret = libusb_control_transfer(udh, REQUEST_TYPE_IN,
REQUEST_READ_FREQUENCY, 0, 0,
buffer, sizeof(buffer), rig->state.rigport->timeout);
buffer, sizeof(buffer), rig->state.rigport.timeout);
if (ret != 4)
{
@ -1395,7 +1395,7 @@ int si570xxxusb_get_freq_by_value(RIG *rig, vfo_t vfo, freq_t *freq)
int si570xxxusb_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
{
libusb_device_handle *udh = rig->state.rigport->handle;
libusb_device_handle *udh = rig->state.rigport.handle;
int ret;
unsigned char buffer[3];
@ -1407,7 +1407,7 @@ int si570xxxusb_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
ret = libusb_control_transfer(udh, REQUEST_TYPE_IN,
REQUEST_SET_PTT, (ptt == RIG_PTT_ON) ? 1 : 0, 0,
buffer, sizeof(buffer), rig->state.rigport->timeout);
buffer, sizeof(buffer), rig->state.rigport.timeout);
if (ret < 0)
{

Wyświetl plik

@ -63,9 +63,9 @@ int lowe_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rs = &rig->state;
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = write_block(rs->rigport, (unsigned char *) 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, (unsigned char *) 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

@ -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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) priv->cmd_buf, len + 1);
err = write_block(&rs->rigport, (unsigned char *) priv->cmd_buf, len + 1);
rs->transaction_active = 0;
@ -384,7 +384,7 @@ pcr_transaction(RIG *rig, const char *cmd)
if (!priv->auto_update)
{
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
}
pcr_send(rig, cmd);
@ -466,8 +466,8 @@ pcr_set_comm_speed(RIG *rig, int rate)
return err;
}
rig->state.rigport->parm.serial.rate = rate;
serial_setup(rig->state.rigport);
rig->state.rigport.parm.serial.rate = rate;
serial_setup(&rig->state.rigport);
/* check if the pcr is still alive */
return pcr_check_ok(rig);
@ -573,14 +573,14 @@ pcr_open(RIG *rig)
startup_serial_rate = 9600;
}
wanted_serial_rate = rs->rigport->parm.serial.rate;
rs->rigport->parm.serial.rate = startup_serial_rate;
wanted_serial_rate = rs->rigport.parm.serial.rate;
rs->rigport.parm.serial.rate = startup_serial_rate;
serial_setup(rs->rigport);
serial_setup(&rs->rigport);
/* let the pcr settle and flush any remaining data*/
hl_usleep(100 * 1000);
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
/* try powering on twice, sometimes the pcr answers H100 (off) */
pcr_send(rig, "H101");
@ -589,7 +589,7 @@ pcr_open(RIG *rig)
pcr_send(rig, "H101");
hl_usleep(100 * 250);
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
/* return RIG_ERJCTED if power is off */
err = pcr_transaction(rig, "H1?");

Wyświetl plik

@ -253,10 +253,10 @@ static int prm80_transaction(RIG *rig, const char *cmd,
struct rig_state *rs = &rig->state;
// Get rid of possible prompt sent by the rig
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
// Start with the command
retval = write_block(rs->rigport, (unsigned char *) cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
if (retval != RIG_OK)
{
@ -265,7 +265,7 @@ static int prm80_transaction(RIG *rig, const char *cmd,
if (arg1 != NULL)
{
retval = read_colon_prompt_and_send(rs->rigport, NULL, NULL, arg1);
retval = read_colon_prompt_and_send(&rs->rigport, NULL, NULL, arg1);
if (retval < 0)
{
@ -275,7 +275,7 @@ static int prm80_transaction(RIG *rig, const char *cmd,
if (wait_prompt)
{
prm80_wait_for_prompt(rs->rigport);
prm80_wait_for_prompt(&rs->rigport);
}
return RIG_OK;
@ -402,7 +402,7 @@ int prm80_set_rx_tx_freq(RIG *rig, freq_t rx_freq, freq_t tx_freq)
}
// There's a second line to process after prm80_transaction()
rc = read_colon_prompt_and_send(rs->rigport, NULL, NULL, tx_freq_buf);
rc = read_colon_prompt_and_send(&rs->rigport, NULL, NULL, tx_freq_buf);
if (rc != RIG_OK)
{
@ -413,7 +413,7 @@ int prm80_set_rx_tx_freq(RIG *rig, freq_t rx_freq, freq_t tx_freq)
// NB: the [R] command does not update the checksum of the RAM!
prm80_wait_for_prompt(rs->rigport);
prm80_wait_for_prompt(&rs->rigport);
return rc;
}
@ -706,7 +706,7 @@ static int prm80_read_system_state(RIG *rig, char *statebuf)
if (rig_check_cache_timeout(&priv->status_tv, PRM80_CACHE_TIMEOUT))
{
ret = prm80_do_read_system_state(rig->state.rigport, statebuf);
ret = prm80_do_read_system_state(&rig->state.rigport, statebuf);
if (ret == RIG_OK)
{
@ -866,7 +866,7 @@ int prm80_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
SNPRINTF(buf, sizeof(buf), "%04X", rx_freq_to_pll_value(chan->freq));
// "PLL value to load : $"
ret = read_dollar_prompt_and_send(rs->rigport, NULL, NULL, buf);
ret = read_dollar_prompt_and_send(&rs->rigport, NULL, NULL, buf);
if (ret != RIG_OK)
{
@ -890,7 +890,7 @@ int prm80_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
SNPRINTF(buf, sizeof(buf), "%02X", chanstate);
// "Channel state : $"
ret = read_dollar_prompt_and_send(rs->rigport, NULL, NULL, buf);
ret = read_dollar_prompt_and_send(&rs->rigport, NULL, NULL, buf);
if (ret != RIG_OK)
{
@ -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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) "Y", 1);
ret = write_block(&rs->rigport, (unsigned char *) "Y", 1);
if (ret < 0)
{
@ -934,7 +934,7 @@ int prm80_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
}
}
prm80_wait_for_prompt(rs->rigport);
prm80_wait_for_prompt(&rs->rigport);
}
else
{
@ -1126,7 +1126,7 @@ static int prm80_get_rawstr_RAM(RIG *rig, value_t *val)
}
// Read CRLF
ret = read_string(rs->rigport, buf, BUFSZ, "\n", 1, 0, 1);
ret = read_string(&rs->rigport, buf, BUFSZ, "\n", 1, 0, 1);
if (ret < 0)
{
@ -1142,7 +1142,7 @@ static int prm80_get_rawstr_RAM(RIG *rig, value_t *val)
for (i = 0; i < (RSSI_HOLD_ADDR / 16) + 1; i++)
{
ret = read_string(rs->rigport, buf, BUFSZ, "\n", 1, 0, 1);
ret = read_string(&rs->rigport, buf, BUFSZ, "\n", 1, 0, 1);
if (ret < 0)
{
@ -1158,10 +1158,10 @@ static int prm80_get_rawstr_RAM(RIG *rig, value_t *val)
// discard the remaining content of RAM print
for (i = 0; i < (16 - RSSI_HOLD_ADDR / 16) - 1; i++)
{
read_string(rs->rigport, buf, BUFSZ, "\n", 1, 0, 1);
read_string(&rs->rigport, buf, BUFSZ, "\n", 1, 0, 1);
}
prm80_wait_for_prompt(rs->rigport);
prm80_wait_for_prompt(&rs->rigport);
return RIG_OK;
}
@ -1271,17 +1271,17 @@ const char *prm80_get_info(RIG *rig)
int ret;
// Get rid of possible prompt sent by the rig
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
/* [V] = Print firmware version. */
ret = write_block(rs->rigport, (unsigned char *) "V", 1);
ret = write_block(&rs->rigport, (unsigned char *) "V", 1);
if (ret < 0)
{
return NULL;
}
ret = read_string(rs->rigport, (unsigned char *) 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

@ -103,9 +103,9 @@ static int ra37xx_one_transaction(RIG *rig, const char *cmd, char *data,
SNPRINTF(cmdbuf, sizeof(cmdbuf), SOM "%s" EOM, cmd);
}
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval != RIG_OK)
{
@ -121,7 +121,7 @@ static int ra37xx_one_transaction(RIG *rig, const char *cmd, char *data,
do
{
retval = read_string(rs->rigport, (unsigned char *) respbuf, BUFSZ, EOM, strlen(EOM), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) respbuf, BUFSZ, EOM, strlen(EOM), 0, 1);
if (retval < 0)
{
@ -131,7 +131,7 @@ static int ra37xx_one_transaction(RIG *rig, const char *cmd, char *data,
/* drop short/invalid packets */
if (retval <= pkt_header_len + 1 || respbuf[0] != '\x0a')
{
if (!rig_check_cache_timeout(&tv, rs->rigport->timeout))
if (!rig_check_cache_timeout(&tv, rs->rigport.timeout))
{
continue;
}
@ -144,7 +144,7 @@ static int ra37xx_one_transaction(RIG *rig, const char *cmd, char *data,
/* drop other receiver id, and "pause" (empty) packets */
if ((priv->receiver_id != -1 && (respbuf[1] - '0') != priv->receiver_id))
{
if (!rig_check_cache_timeout(&tv, rs->rigport->timeout))
if (!rig_check_cache_timeout(&tv, rs->rigport.timeout))
{
continue;
}
@ -172,7 +172,7 @@ static int ra37xx_one_transaction(RIG *rig, const char *cmd, char *data,
rig_debug(RIG_DEBUG_WARN, "%s: unexpected revertive frame\n",
__func__);
if (!rig_check_cache_timeout(&tv, rs->rigport->timeout))
if (!rig_check_cache_timeout(&tv, rs->rigport.timeout))
{
continue;
}
@ -196,7 +196,7 @@ static int ra37xx_transaction(RIG *rig, const char *cmd, char *data,
{
int retval, retry;
retry = rig->state.rigport->retry;
retry = rig->state.rigport.retry;
do
{

Wyświetl plik

@ -83,9 +83,9 @@ static int racal_transaction(RIG *rig, const char *cmd, char *data,
SNPRINTF(cmdbuf, sizeof(cmdbuf), SOM "%u%s" EOM, priv->receiver_id, cmd);
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval != RIG_OK)
{
@ -99,7 +99,7 @@ static int racal_transaction(RIG *rig, const char *cmd, char *data,
return retval;
}
retval = read_string(rs->rigport, (unsigned char *) 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

@ -55,9 +55,9 @@ int rft_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rs = &rig->state;
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = write_block(rs->rigport, (unsigned char *) 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, (unsigned char *) 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

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

Wyświetl plik

@ -64,9 +64,9 @@ int rs_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rs = &rig->state;
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = write_block(rs->rigport, (unsigned char *) 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, (unsigned char *) 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

@ -71,9 +71,9 @@ static int skanti_transaction(RIG *rig, const char *cmd, int cmd_len,
rs = &rig->state;
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = write_block(rs->rigport, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) &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, (unsigned char *) &retchar, 1);
ret = read_block(&rig->state.rigport, (unsigned char *) &retchar, 1);
switch (retchar)
{

Wyświetl plik

@ -58,7 +58,7 @@ static int tapr_cmd(RIG *rig, unsigned char cmd, unsigned char c1,
rs = &rig->state;
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
cmdbuf[0] = ESC;
cmdbuf[1] = cmd;
@ -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, cmdbuf, 6);
retval = write_block(&rs->rigport, cmdbuf, 6);
if (retval != RIG_OK)
{

Wyświetl plik

@ -268,12 +268,12 @@ static int tt588_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
for (i = 0; i < 3; ++i) // We'll try 3 times
{
char xxbuf[32];
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
// 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) "XX" EOM,
write_block(&rs->rigport, (unsigned char *) "XX" EOM,
3); // we wont' worry about the response here
retval = read_string(rs->rigport, (unsigned char *) 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

@ -130,8 +130,8 @@ 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, (unsigned char *) cmd, cmd_len);
rig_flush(&rs->rigport); /* discard pending i/p */
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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) mdbuf, strlen(mdbuf));
retval = write_block(&rs->rigport, (unsigned char *) mdbuf, strlen(mdbuf));
return retval;
}
@ -938,7 +938,7 @@ int tt565_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
{
struct rig_state *rs = &rig->state;
return write_block(rs->rigport,
return write_block(&rs->rigport,
(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, (unsigned char *) "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, (unsigned char *) "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)
@ -375,7 +375,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, (unsigned char *) buf, strlen(buf));
return write_block(&rig->state.rigport, (unsigned char *) buf, strlen(buf));
}
/*
@ -481,7 +481,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, (unsigned char *) mcmd, strlen(mcmd));
ret = write_block(&rig->state.rigport, (unsigned char *) mcmd, strlen(mcmd));
if (ret < 0)
{
@ -516,7 +516,7 @@ int tt585_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
wcmd = "R";
}
return write_block(rig->state.rigport, (unsigned char *) 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)
@ -534,7 +534,7 @@ int tt585_set_mem(RIG *rig, vfo_t vfo, int ch)
/* does it work without a command after the channel number? */
SNPRINTF(buf, sizeof(buf), ":%02d", ch);
return write_block(rig->state.rigport, (unsigned char *) buf, strlen(buf));
return write_block(&rig->state.rigport, (unsigned char *) buf, strlen(buf));
}
int tt585_get_mem(RIG *rig, vfo_t vfo, int *ch)
@ -573,7 +573,7 @@ int tt585_get_status_data(RIG *rig)
hamlib_port_t *rigport;
int ret;
rigport = rig->state.rigport;
rigport = &rig->state.rigport;
if (!rig_check_cache_timeout(&priv->status_tv, TT585_CACHE_TIMEOUT))
{
@ -613,7 +613,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, (unsigned char *) ">", 1);
ret = write_block(&rig->state.rigport, (unsigned char *) ">", 1);
if (ret < 0)
{
@ -683,5 +683,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, (unsigned char *) cmd, strlen(cmd));
return write_block(&rig->state.rigport, (unsigned char *) cmd, strlen(cmd));
}

Wyświetl plik

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

Wyświetl plik

@ -204,9 +204,9 @@ static int rx340_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rs = &rig->state;
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = write_block(rs->rigport, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) 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)
SNPRINTF(freqbuf, sizeof(freqbuf), "F%.6f" EOM, freq / 1e6);
retval = write_block(rs->rigport, (unsigned char *) freqbuf, strlen(freqbuf));
retval = write_block(&rs->rigport, (unsigned char *) freqbuf, strlen(freqbuf));
return retval;
}
@ -394,7 +394,7 @@ int rx340_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
SNPRINTF(mdbuf, sizeof(mdbuf), "D%c" EOM, dmode);
}
retval = write_block(rs->rigport, (unsigned char *) mdbuf, strlen(mdbuf));
retval = write_block(&rs->rigport, (unsigned char *) mdbuf, strlen(mdbuf));
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, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
return retval;
}

Wyświetl plik

@ -70,9 +70,9 @@ int tentec_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
rs = &rig->state;
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = write_block(rs->rigport, (unsigned char *) 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, (unsigned char *) 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, (unsigned char *) freqbuf, strlen(freqbuf));
retval = write_block(&rs->rigport, (unsigned char *) freqbuf, strlen(freqbuf));
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, (unsigned char *) mdbuf, strlen(mdbuf));
retval = write_block(&rs->rigport, (unsigned char *) mdbuf, strlen(mdbuf));
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, (unsigned char *) mdbuf, strlen(mdbuf));
retval = write_block(&rs->rigport, (unsigned char *) mdbuf, strlen(mdbuf));
if (retval != RIG_OK)
{
@ -419,7 +419,7 @@ int tentec_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
SNPRINTF(cmdbuf, sizeof(cmdbuf), "G%c" EOM,
val.i == RIG_AGC_SLOW ? '1' : (
val.i == RIG_AGC_FAST ? '3' : '2'));
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
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 ?
*/
SNPRINTF(cmdbuf, sizeof(cmdbuf), "C\x7f%c" EOM, (int)((1.0 - val.f) * 63.0));
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval == RIG_OK)
{

Wyświetl plik

@ -84,9 +84,9 @@ tt550_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
*/
set_transaction_active(rig);
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
retval = write_block(rs->rigport, (unsigned char *) cmd, strlen(cmd));
retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
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, (unsigned char *) 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];
SNPRINTF(cmdbuf, sizeof(cmdbuf), "#%c" EOM, oper);
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
/*
* 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.
@ -619,7 +619,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, (unsigned char *) freqbuf, strlen(freqbuf));
retval = write_block(&rs->rigport, (unsigned char *) freqbuf, strlen(freqbuf));
if (retval != RIG_OK)
{
@ -653,7 +653,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, (unsigned char *) freqbuf, strlen(freqbuf));
retval = write_block(&rs->rigport, (unsigned char *) freqbuf, strlen(freqbuf));
if (retval != RIG_OK)
{
@ -763,7 +763,7 @@ tt550_set_rx_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
tt550_tuning_factor_calc(rig, RECEIVE);
SNPRINTF(mdbuf, sizeof(mdbuf), "M%c%c" EOM, ttmode, ttmode);
retval = write_block(rs->rigport, (unsigned char *) mdbuf, strlen(mdbuf));
retval = write_block(&rs->rigport, (unsigned char *) mdbuf, strlen(mdbuf));
if (retval != RIG_OK)
{
@ -779,7 +779,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, (unsigned char *) mdbuf, strlen(mdbuf));
retval = write_block(&rs->rigport, (unsigned char *) mdbuf, strlen(mdbuf));
if (retval != RIG_OK)
{
@ -896,7 +896,7 @@ tt550_set_tx_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
tt550_tuning_factor_calc(rig, TRANSMIT);
SNPRINTF(mdbuf, sizeof(mdbuf), "M%c%c" EOM, ttmode, ttmode);
retval = write_block(rs->rigport, (unsigned char *) mdbuf, strlen(mdbuf));
retval = write_block(&rs->rigport, (unsigned char *) mdbuf, strlen(mdbuf));
if (retval != RIG_OK)
{
@ -912,7 +912,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, (unsigned char *) mdbuf, strlen(mdbuf));
retval = write_block(&rs->rigport, (unsigned char *) mdbuf, strlen(mdbuf));
if (retval != RIG_OK)
{
@ -1010,7 +1010,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_AGC:
SNPRINTF(cmdbuf, sizeof(cmdbuf), "G%c" EOM,
val.i >= 3 ? '3' : (val.i < 2 ? '1' : '2'));
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval == RIG_OK)
{
@ -1021,7 +1021,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_AF:
SNPRINTF(cmdbuf, sizeof(cmdbuf), "V%c" EOM, (int)(val.f * 255));
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval == RIG_OK)
{
@ -1033,7 +1033,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_LINEOUT:
SNPRINTF(cmdbuf, sizeof(cmdbuf), "L%c" EOM, (int)(val.f * 63));
retval = write_block(rs->rigport, cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, cmdbuf, strlen(cmdbuf));
if (retval == RIG_OK)
{
@ -1045,7 +1045,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_RF:
SNPRINTF(cmdbuf, sizeof(cmdbuf), "A%c" EOM, (int)(val.f * 255));
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval == RIG_OK)
{
@ -1056,7 +1056,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_SQL:
SNPRINTF(cmdbuf, sizeof(cmdbuf), "S%c" EOM, (int)(val.f * 19));
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval == RIG_OK)
{
@ -1067,7 +1067,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_NR:
SNPRINTF(cmdbuf, sizeof(cmdbuf), "D%c" EOM, (int)(val.f * 7));
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval == RIG_OK)
{
@ -1081,7 +1081,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
* attenuator is either on or off
*/
SNPRINTF(cmdbuf, sizeof(cmdbuf), "B%c" EOM, val.i < 15 ? '0' : '1');
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval == RIG_OK)
{
@ -1100,7 +1100,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, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval == RIG_OK)
{
@ -1111,7 +1111,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_RFPOWER:
SNPRINTF(cmdbuf, sizeof(cmdbuf), "P%c" EOM, (int)(val.f * 255));
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval == RIG_OK)
{
@ -1122,7 +1122,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_VOXGAIN:
SNPRINTF(cmdbuf, sizeof(cmdbuf), "UG%c" EOM, (int)(val.f * 255));
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval == RIG_OK)
{
@ -1133,7 +1133,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_VOXDELAY:
SNPRINTF(cmdbuf, sizeof(cmdbuf), "UH%c" EOM, (int)(val.f * 255));
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval == RIG_OK)
{
@ -1144,7 +1144,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_ANTIVOX:
SNPRINTF(cmdbuf, sizeof(cmdbuf), "UA%c" EOM, (int)(val.f * 255));
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval == RIG_OK)
{
@ -1155,7 +1155,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_COMP:
SNPRINTF(cmdbuf, sizeof(cmdbuf), "Y%c" EOM, (int)(val.f * 127));
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval == RIG_OK)
{
@ -1166,7 +1166,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_MICGAIN:
SNPRINTF(cmdbuf, sizeof(cmdbuf), "O1%c%c" EOM, 0, (int)(val.f * 15));
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval == RIG_OK)
{
@ -1177,7 +1177,7 @@ tt550_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_BKINDL:
SNPRINTF(cmdbuf, sizeof(cmdbuf), "UQ%c" EOM, (int)(val.f * 255));
retval = write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
if (retval == RIG_OK)
{
@ -1379,7 +1379,7 @@ tt550_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
char cmdbuf[16];
SNPRINTF(cmdbuf, sizeof(cmdbuf), "Q%c" EOM, ptt == 0 ? '0' : '1');
return (write_block(rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf)));
return (write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf)));
}
@ -1459,19 +1459,19 @@ tt550_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
case RIG_FUNC_VOX:
SNPRINTF((char *) fctbuf, sizeof(fctbuf), "U%c" EOM, status == 0 ? '0' : '1');
priv->vox = status;
return write_block(rs->rigport, fctbuf, strlen((char*)fctbuf));
return write_block(&rs->rigport, fctbuf, strlen((char*)fctbuf));
case RIG_FUNC_NR:
SNPRINTF((char *) fctbuf, sizeof(fctbuf), "K%c%c" EOM, status == 0 ? '0' : '1',
priv->anf == 0 ? '0' : '1');
priv->en_nr = status;
return write_block(rs->rigport, fctbuf, strlen((char*)fctbuf));
return write_block(&rs->rigport, fctbuf, strlen((char*)fctbuf));
case RIG_FUNC_ANF:
SNPRINTF((char *) fctbuf, sizeof(fctbuf), "K%c%c" EOM, priv->en_nr == 0 ? '0' : '1',
status == 0 ? '0' : '1');
priv->anf = status;
return write_block(rs->rigport, fctbuf, strlen((char*)fctbuf));
return write_block(&rs->rigport, fctbuf, strlen((char*)fctbuf));
case RIG_FUNC_TUNER:
@ -1688,7 +1688,7 @@ tt550_decode_event(RIG *rig)
priv = (struct tt550_priv_data *) rs->priv;
data_len = read_string(rs->rigport, buf, MAXFRAMELEN, "\n\r", 2, 0,
data_len = read_string(&rs->rigport, buf, MAXFRAMELEN, "\n\r", 2, 0,
1);

Wyświetl plik

@ -158,8 +158,8 @@ const struct rig_caps v4l_caps =
int v4l_init(RIG *rig)
{
rig->state.rigport->type.rig = RIG_PORT_DEVICE;
strncpy(rig->state.rigport->pathname, DEFAULT_V4L_PATH, HAMLIB_FILPATHLEN - 1);
rig->state.rigport.type.rig = RIG_PORT_DEVICE;
strncpy(rig->state.rigport.pathname, DEFAULT_V4L_PATH, HAMLIB_FILPATHLEN - 1);
return RIG_OK;
}
@ -175,7 +175,7 @@ int v4l_open(RIG *rig)
int ret;
double fact;
vt.tuner = i;
ret = ioctl(rig->state.rigport->fd, VIDIOCGTUNER, &vt);
ret = ioctl(rig->state.rigport.fd, VIDIOCGTUNER, &vt);
if (ret < 0)
{
@ -216,7 +216,7 @@ int v4l_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
vt.tuner = (rs->rx_range_list - range) / sizeof(freq_range_t);
ret = ioctl(rig->state.rigport->fd, VIDIOCSTUNER, &vt); /* set tuner # */
ret = ioctl(rig->state.rigport.fd, VIDIOCSTUNER, &vt); /* set tuner # */
if (ret < 0)
{
@ -229,7 +229,7 @@ int v4l_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
f = rint(freq * fact); /* rounding to nearest int */
ret = ioctl(rig->state.rigport->fd, VIDIOCSFREQ, &f);
ret = ioctl(rig->state.rigport.fd, VIDIOCSFREQ, &f);
if (ret < 0)
{
@ -249,7 +249,7 @@ int v4l_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
double fact;
int ret;
ret = ioctl(rig->state.rigport->fd, VIDIOCGFREQ, &f);
ret = ioctl(rig->state.rigport.fd, VIDIOCGFREQ, &f);
if (ret < 0)
{
@ -282,7 +282,7 @@ int v4l_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
switch (func)
{
case RIG_FUNC_MUTE:
ret = ioctl(rig->state.rigport->fd, VIDIOCGAUDIO, &va);
ret = ioctl(rig->state.rigport.fd, VIDIOCGAUDIO, &va);
if (ret < 0)
{
@ -292,7 +292,7 @@ int v4l_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
}
va.flags = status ? VIDEO_AUDIO_MUTE : 0;
ret = ioctl(rig->state.rigport->fd, VIDIOCSAUDIO, &va);
ret = ioctl(rig->state.rigport.fd, VIDIOCSAUDIO, &va);
if (ret < 0)
{
@ -318,7 +318,7 @@ int v4l_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
switch (func)
{
case RIG_FUNC_MUTE:
ret = ioctl(rig->state.rigport->fd, VIDIOCGAUDIO, &va);
ret = ioctl(rig->state.rigport.fd, VIDIOCGAUDIO, &va);
if (ret < 0)
{
@ -343,7 +343,7 @@ int v4l_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
struct video_audio va;
int ret;
ret = ioctl(rig->state.rigport->fd, VIDIOCGAUDIO, &va);
ret = ioctl(rig->state.rigport.fd, VIDIOCGAUDIO, &va);
if (ret < 0)
{
@ -362,7 +362,7 @@ int v4l_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
return -RIG_EINVAL;
}
ret = ioctl(rig->state.rigport->fd, VIDIOCSAUDIO, &va);
ret = ioctl(rig->state.rigport.fd, VIDIOCSAUDIO, &va);
if (ret < 0)
{
@ -383,7 +383,7 @@ int v4l_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
switch (level)
{
case RIG_LEVEL_AF:
ret = ioctl(rig->state.rigport->fd, VIDIOCGAUDIO, &va);
ret = ioctl(rig->state.rigport.fd, VIDIOCGAUDIO, &va);
if (ret < 0)
{
@ -396,7 +396,7 @@ int v4l_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
break;
case RIG_LEVEL_RAWSTR:
ret = ioctl(rig->state.rigport->fd, VIDIOCGTUNER, &vt); /* get info */
ret = ioctl(rig->state.rigport.fd, VIDIOCGTUNER, &vt); /* get info */
if (ret < 0)
{
@ -424,7 +424,7 @@ const char *v4l_get_info(RIG *rig)
int ret;
vt.tuner = 0;
ret = ioctl(rig->state.rigport->fd, VIDIOCGTUNER, &vt);
ret = ioctl(rig->state.rigport.fd, VIDIOCGTUNER, &vt);
if (ret < 0)
{

Wyświetl plik

@ -158,8 +158,8 @@ const struct rig_caps v4l2_caps =
int v4l2_init(RIG *rig)
{
rig->state.rigport->type.rig = RIG_PORT_DEVICE;
strncpy(rig->state.rigport->pathname, DEFAULT_V4L2_PATH, HAMLIB_FILPATHLEN - 1);
rig->state.rigport.type.rig = RIG_PORT_DEVICE;
strncpy(rig->state.rigport.pathname, DEFAULT_V4L2_PATH, HAMLIB_FILPATHLEN - 1);
return RIG_OK;
}
@ -175,7 +175,7 @@ int v4l2_open(RIG *rig)
int ret;
double fact;
vt.index = i;
ret = ioctl(rig->state.rigport->fd, VIDIOC_G_TUNER, &vt);
ret = ioctl(rig->state.rigport.fd, VIDIOC_G_TUNER, &vt);
if (ret < 0)
{
@ -216,7 +216,7 @@ int v4l2_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
vt.index = (rs->rx_range_list - range) / sizeof(freq_range_t);
ret = ioctl(rig->state.rigport->fd, VIDIOC_S_TUNER, &vt); /* set tuner # */
ret = ioctl(rig->state.rigport.fd, VIDIOC_S_TUNER, &vt); /* set tuner # */
if (ret < 0)
{
@ -229,7 +229,7 @@ int v4l2_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
f = rint(freq * fact); /* rounding to nearest int */
ret = ioctl(rig->state.rigport->fd, VIDIOC_S_FREQUENCY, &f);
ret = ioctl(rig->state.rigport.fd, VIDIOC_S_FREQUENCY, &f);
if (ret < 0)
{
@ -250,7 +250,7 @@ int v4l2_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
int ret;
/* FIXME */
ret = ioctl(rig->state.rigport->fd, VIDIOC_G_FREQUENCY, &f);
ret = ioctl(rig->state.rigport.fd, VIDIOC_G_FREQUENCY, &f);
if (ret < 0)
{
@ -283,7 +283,7 @@ int v4l2_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
switch (func)
{
case RIG_FUNC_MUTE:
ret = ioctl(rig->state.rigport->fd, VIDIOC_G_AUDIO, &va);
ret = ioctl(rig->state.rigport.fd, VIDIOC_G_AUDIO, &va);
if (ret < 0)
{
@ -293,7 +293,7 @@ int v4l2_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
}
va.capability = status ? V4L2_CID_AUDIO_MUTE : 0;
ret = ioctl(rig->state.rigport->fd, VIDIOC_S_AUDIO, &va);
ret = ioctl(rig->state.rigport.fd, VIDIOC_S_AUDIO, &va);
if (ret < 0)
{
@ -319,7 +319,7 @@ int v4l2_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
switch (func)
{
case RIG_FUNC_MUTE:
ret = ioctl(rig->state.rigport->fd, VIDIOC_G_AUDIO, &va);
ret = ioctl(rig->state.rigport.fd, VIDIOC_G_AUDIO, &va);
if (ret < 0)
{
@ -344,7 +344,7 @@ int v4l2_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
struct v4l2_audio va;
int ret;
ret = ioctl(rig->state.rigport->fd, VIDIOC_G_AUDIO, &va);
ret = ioctl(rig->state.rigport.fd, VIDIOC_G_AUDIO, &va);
if (ret < 0)
{
@ -365,7 +365,7 @@ int v4l2_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
return -RIG_EINVAL;
}
ret = ioctl(rig->state.rigport->fd, VIDIOC_S_AUDIO, &va);
ret = ioctl(rig->state.rigport.fd, VIDIOC_S_AUDIO, &va);
if (ret < 0)
{
@ -386,7 +386,7 @@ int v4l2_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
switch (level)
{
case RIG_LEVEL_AF:
ret = ioctl(rig->state.rigport->fd, VIDIOC_G_AUDIO, &va);
ret = ioctl(rig->state.rigport.fd, VIDIOC_G_AUDIO, &va);
if (ret < 0)
{
@ -400,7 +400,7 @@ int v4l2_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
case RIG_LEVEL_RAWSTR:
/* FE_READ_SIGNAL_STRENGTH ? */
ret = ioctl(rig->state.rigport->fd, VIDIOC_G_TUNER, &vt); /* get info */
ret = ioctl(rig->state.rigport.fd, VIDIOC_G_TUNER, &vt); /* get info */
if (ret < 0)
{
@ -428,7 +428,7 @@ const char *v4l2_get_info(RIG *rig)
int ret;
vt.index = 0;
ret = ioctl(rig->state.rigport->fd, VIDIOC_G_TUNER, &vt);
ret = ioctl(rig->state.rigport.fd, VIDIOC_G_TUNER, &vt);
if (ret < 0)
{

Wyświetl plik

@ -132,11 +132,11 @@ uniden_transaction(RIG *rig, const char *cmdstr, int cmd_len,
transaction_write:
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
if (cmdstr)
{
retval = write_block(rs->rigport, (unsigned char *) cmdstr, strlen(cmdstr));
retval = write_block(&rs->rigport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
@ -156,11 +156,11 @@ transaction_write:
}
memset(data, 0, *datasize);
retval = read_string(rs->rigport, (unsigned char *) data, *datasize, EOM, strlen(EOM), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, *datasize, EOM, strlen(EOM), 0, 1);
if (retval < 0)
{
if (retry_read++ < rig->state.rigport->retry)
if (retry_read++ < rig->state.rigport.retry)
{
goto transaction_write;
}
@ -178,7 +178,7 @@ transaction_write:
rig_debug(RIG_DEBUG_ERR, "%s: Command is not correctly terminated '%s'\n",
__func__, data);
if (retry_read++ < rig->state.rigport->retry)
if (retry_read++ < rig->state.rigport.retry)
{
goto transaction_write;
}
@ -256,7 +256,7 @@ transaction_write:
*/
rig_debug(RIG_DEBUG_ERR, "%s: Unexpected reply '%s'\n", __func__, data);
if (retry_read++ < rig->state.rigport->retry)
if (retry_read++ < rig->state.rigport.retry)
{
goto transaction_write;
}

Wyświetl plik

@ -114,11 +114,11 @@ uniden_digital_transaction(RIG *rig, const char *cmdstr, int cmd_len,
transaction_write:
rig_flush(rs->rigport);
rig_flush(&rs->rigport);
if (cmdstr)
{
retval = write_block(rs->rigport, (unsigned char *) cmdstr, strlen(cmdstr));
retval = write_block(&rs->rigport, (unsigned char *) cmdstr, strlen(cmdstr));
if (retval != RIG_OK)
{
@ -138,11 +138,11 @@ transaction_write:
}
memset(data, 0, *datasize);
retval = read_string(rs->rigport, (unsigned char *) data, *datasize, EOM, strlen(EOM), 0, 1);
retval = read_string(&rs->rigport, (unsigned char *) data, *datasize, EOM, strlen(EOM), 0, 1);
if (retval < 0)
{
if (retry_read++ < rig->state.rigport->retry)
if (retry_read++ < rig->state.rigport.retry)
{
goto transaction_write;
}
@ -160,7 +160,7 @@ transaction_write:
* ie: STS command will not return either "\r" or "\n"! */
/*if (strchr(EOM, data[strlen(data)-1])==NULL) {
rig_debug(RIG_DEBUG_ERR, "%s: Command is not correctly terminated '%s'\n", __func__, data);
if (retry_read++ < rig->state.rigport->retry)
if (retry_read++ < rig->state.rigport.retry)
goto transaction_write;
retval = -RIG_EPROTO;
goto transaction_quit;
@ -251,7 +251,7 @@ transaction_write:
*/
rig_debug(RIG_DEBUG_ERR, "%s: Unexpected reply '%s'\n", __func__, data);
if (retry_read++ < rig->state.rigport->retry)
if (retry_read++ < rig->state.rigport.retry)
{
goto transaction_write;
}

Wyświetl plik

@ -242,7 +242,7 @@ int g3_open(RIG *rig)
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
int device_num;
device_num = atoi(rig->state.rigport->pathname);
device_num = atoi(rig->state.rigport.pathname);
/* Open Winradio receiver handle */
priv->hRadio = priv->OpenRadioDevice(device_num);

Wyświetl plik

@ -243,7 +243,7 @@ int g3_open(RIG *rig)
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
int device_num;
device_num = atoi(rig->state.rigport->pathname);
device_num = atoi(rig->state.rigport.pathname);
/* Open Winradio receiver handle */
priv->hRadio = priv->OpenRadioDevice(device_num);

Wyświetl plik

@ -179,9 +179,9 @@ int g313_open(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%s: found %d rigs 0 is %s\n", __func__, Count,
List[0].Path);
if (rig->state.rigport->pathname[0])
if (rig->state.rigport.pathname[0])
{
priv->hRadio = OpenDevice(rig->state.rigport->pathname);
priv->hRadio = OpenDevice(rig->state.rigport.pathname);
}
else
{

Wyświetl plik

@ -380,7 +380,7 @@ int g313_open(RIG *rig)
int Count;
int id;
device_num = atoi(rig->state.rigport->pathname);
device_num = atoi(rig->state.rigport.pathname);
Count = priv->waveOutGetNumDevs();

Wyświetl plik

@ -45,8 +45,8 @@
int wr_rig_init(RIG *rig)
{
rig->state.rigport->type.rig = RIG_PORT_DEVICE;
strncpy(rig->state.rigport->pathname, DEFAULT_WINRADIO_PATH,
rig->state.rigport.type.rig = RIG_PORT_DEVICE;
strncpy(rig->state.rigport.pathname, DEFAULT_WINRADIO_PATH,
HAMLIB_FILPATHLEN - 1);
return RIG_OK;
@ -63,7 +63,7 @@ int wr_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
f = (unsigned long)freq;
if (ioctl(rig->state.rigport->fd, RADIO_SET_FREQ, &f)) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport.fd, RADIO_SET_FREQ, &f)) { return -RIG_EINVAL; }
return RIG_OK;
}
@ -72,7 +72,7 @@ int wr_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
{
unsigned long f;
if (ioctl(rig->state.rigport->fd, RADIO_GET_FREQ, &f) < 0) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport.fd, RADIO_GET_FREQ, &f) < 0) { return -RIG_EINVAL; }
*freq = (freq_t)f;
return RIG_OK;
@ -113,7 +113,7 @@ int wr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
default: return -RIG_EINVAL;
}
if (ioctl(rig->state.rigport->fd, RADIO_SET_MODE, &m)) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport.fd, RADIO_SET_MODE, &m)) { return -RIG_EINVAL; }
return RIG_OK;
}
@ -122,7 +122,7 @@ int wr_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
{
unsigned long m;
if (ioctl(rig->state.rigport->fd, RADIO_GET_MODE, &m)) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport.fd, RADIO_GET_MODE, &m)) { return -RIG_EINVAL; }
*width = RIG_PASSBAND_NORMAL;
@ -160,7 +160,7 @@ int wr_set_powerstat(RIG *rig, powerstat_t status)
unsigned long p = 1;
p = status == RIG_POWER_ON ? 1 : 0;
if (ioctl(rig->state.rigport->fd, RADIO_SET_POWER, &p)) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport.fd, RADIO_SET_POWER, &p)) { return -RIG_EINVAL; }
return RIG_OK;
}
@ -168,7 +168,7 @@ int wr_get_powerstat(RIG *rig, powerstat_t *status)
{
unsigned long p;
if (ioctl(rig->state.rigport->fd, RADIO_GET_POWER, &p)) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport.fd, RADIO_GET_POWER, &p)) { return -RIG_EINVAL; }
*status = p ? RIG_POWER_ON : RIG_POWER_OFF;
return RIG_OK;
@ -182,7 +182,7 @@ int wr_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
{
unsigned long v = status ? 1 : 0;
if (ioctl(rig->state.rigport->fd, RADIO_SET_AGC, &v)) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport.fd, RADIO_SET_AGC, &v)) { return -RIG_EINVAL; }
return RIG_OK;
}
@ -200,7 +200,7 @@ int wr_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
{
unsigned long v;
if (ioctl(rig->state.rigport->fd, RADIO_GET_AGC, &v)) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport.fd, RADIO_GET_AGC, &v)) { return -RIG_EINVAL; }
*status = v;
return RIG_OK;
@ -220,11 +220,11 @@ int wr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
unsigned long v;
if (ioctl(rig->state.rigport->fd, RADIO_GET_MAXVOL, &v)) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport.fd, RADIO_GET_MAXVOL, &v)) { return -RIG_EINVAL; }
v *= val.f;
if (ioctl(rig->state.rigport->fd, RADIO_SET_VOL, &v)) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport.fd, RADIO_SET_VOL, &v)) { return -RIG_EINVAL; }
return RIG_OK;
}
@ -233,7 +233,7 @@ int wr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
unsigned long v = val.i ? 1 : 0;
if (ioctl(rig->state.rigport->fd, RADIO_SET_ATTN, &v)) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport.fd, RADIO_SET_ATTN, &v)) { return -RIG_EINVAL; }
return RIG_OK;
}
@ -242,7 +242,7 @@ int wr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
long v = val.i;
if (ioctl(rig->state.rigport->fd, RADIO_SET_IFS, &v)) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport.fd, RADIO_SET_IFS, &v)) { return -RIG_EINVAL; }
return RIG_OK;
}
@ -251,7 +251,7 @@ int wr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
long v = val.f * 100; /* iMaxIFGain on wHWVer > RHV_3150 */
if (ioctl(rig->state.rigport->fd, RADIO_SET_IFG, &v)) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport.fd, RADIO_SET_IFG, &v)) { return -RIG_EINVAL; }
return RIG_OK;
}
@ -269,9 +269,9 @@ int wr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
unsigned long v, mv;
if (ioctl(rig->state.rigport->fd, RADIO_GET_MAXVOL, &mv)) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport.fd, RADIO_GET_MAXVOL, &mv)) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport->fd, RADIO_GET_VOL, &v)) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport.fd, RADIO_GET_VOL, &v)) { return -RIG_EINVAL; }
val->f = (float)v / mv;
return RIG_OK;
@ -281,7 +281,7 @@ int wr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
unsigned long v;
if (ioctl(rig->state.rigport->fd, RADIO_GET_VOL, &v)) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport.fd, RADIO_GET_VOL, &v)) { return -RIG_EINVAL; }
val->i = v ? rig->state.attenuator[0] : 0;
return RIG_OK;
@ -291,7 +291,7 @@ int wr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
unsigned long v;
if (ioctl(rig->state.rigport->fd, RADIO_GET_SS, &v)) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport.fd, RADIO_GET_SS, &v)) { return -RIG_EINVAL; }
val->i = v - 60; /* 0..120, Hamlib assumes S9 = 0dB */
return RIG_OK;
@ -301,7 +301,7 @@ int wr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
long v;
if (ioctl(rig->state.rigport->fd, RADIO_GET_IFS, &v)) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport.fd, RADIO_GET_IFS, &v)) { return -RIG_EINVAL; }
val->i = v;
return RIG_OK;
@ -311,7 +311,7 @@ int wr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
long v;
if (ioctl(rig->state.rigport->fd, RADIO_GET_IFG, &v)) { return -RIG_EINVAL; }
if (ioctl(rig->state.rigport.fd, RADIO_GET_IFG, &v)) { return -RIG_EINVAL; }
val->f = (float)v / 100; /* iMaxIFGain on wHWVer > RHV_3150 */
return RIG_OK;
@ -329,7 +329,7 @@ const char *wr_get_info(RIG *rig)
{
static char buf[100];
if (ioctl(rig->state.rigport->fd, RADIO_GET_DESCR, buf) < 0) { return "?"; }
if (ioctl(rig->state.rigport.fd, RADIO_GET_DESCR, buf) < 0) { return "?"; }
return buf;
}

Wyświetl plik

@ -177,9 +177,9 @@ static int wj_transaction(RIG *rig, int monitor)
/* buf[9]: not used if command byte, but must be transmitted */
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
retval = write_block(rig->state.rigport, 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, rxbuf, CMDSZ);
retval = read_block(&rig->state.rigport, rxbuf, CMDSZ);
if (retval < 0 || retval > CMDSZ)
{

Wyświetl plik

@ -268,12 +268,12 @@ static int frg100_do_transaction(RIG *rig,
rs = &rig->state;
memset(retbuf, 0, retbuf_len);
rig_flush(rs->rigport);
retval = write_block(rs->rigport, cmd, YAESU_CMD_LENGTH);
rig_flush(&rs->rigport);
retval = write_block(&rs->rigport, cmd, YAESU_CMD_LENGTH);
if (retval != RIG_OK) { return retval; }
retval = read_block(rs->rigport, retbuf, retbuf_len);
retval = read_block(&rs->rigport, retbuf, retbuf_len);
if (retval != retbuf_len)
{
@ -355,7 +355,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, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -374,7 +374,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, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -386,7 +386,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, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -402,7 +402,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, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -430,7 +430,7 @@ int frg100_set_vfo(RIG *rig, vfo_t vfo)
return -RIG_EINVAL; /* sorry, wrong VFO */
}
return write_block(rig->state.rigport, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -444,10 +444,10 @@ int frg100_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
return -RIG_EINVAL;
}
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
/* send READ STATUS(Meter only) cmd to rig */
retval = write_block(rig->state.rigport, cmd, YAESU_CMD_LENGTH);
retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
if (retval < 0)
{
@ -455,7 +455,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, cmd, 5);
retval = read_block(&rig->state.rigport, cmd, 5);
if (retval < 1)
{

Wyświetl plik

@ -164,7 +164,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, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -175,7 +175,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, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -193,7 +193,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, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -236,7 +236,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, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -250,6 +250,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, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}

Wyświetl plik

@ -152,7 +152,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, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -195,6 +195,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, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}

Wyświetl plik

@ -528,7 +528,7 @@ static int ft100_send_priv_cmd(RIG *rig, unsigned char cmd_index)
if (!rig) { return -RIG_EINVAL; }
return write_block(rig->state.rigport, (unsigned char *) &ncmd[cmd_index].nseq,
return write_block(&rig->state.rigport, (unsigned char *) &ncmd[cmd_index].nseq,
YAESU_CMD_LENGTH);
}
@ -541,7 +541,7 @@ static int ft100_read_status(RIG *rig)
priv = (struct ft100_priv_data *)rig->state.priv;
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
ret = ft100_send_priv_cmd(rig, FT100_NATIVE_CAT_READ_STATUS);
@ -550,7 +550,7 @@ static int ft100_read_status(RIG *rig)
return ret;
}
ret = read_block(rig->state.rigport, (unsigned 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)
@ -568,7 +568,7 @@ static int ft100_read_flags(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
ret = ft100_send_priv_cmd(rig, FT100_NATIVE_CAT_READ_FLAGS);
@ -577,7 +577,7 @@ static int ft100_read_flags(RIG *rig)
return ret;
}
ret = read_block(rig->state.rigport, (unsigned 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,7 +605,7 @@ int ft100_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, 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)
@ -731,7 +731,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, p_cmd, YAESU_CMD_LENGTH);
ret = write_block(&rig->state.rigport, p_cmd, YAESU_CMD_LENGTH);
if (ret != RIG_OK)
{
@ -991,7 +991,7 @@ int ft100_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
return ret;
}
ret = read_block(rig->state.rigport, (unsigned 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)
@ -1207,7 +1207,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, 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)
@ -1261,7 +1261,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, 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

@ -495,9 +495,9 @@ static int ft1000d_open(RIG *rig)
rig_s = &rig->state;
rig_debug(RIG_DEBUG_TRACE, "%s: write_delay = %i msec\n",
__func__, rig_s->rigport->write_delay);
__func__, rig_s->rigport.write_delay);
rig_debug(RIG_DEBUG_TRACE, "%s: post_write_delay = %i msec\n",
__func__, rig_s->rigport->post_write_delay);
__func__, rig_s->rigport.post_write_delay);
rig_debug(RIG_DEBUG_TRACE,
"%s: read pacing = %i\n", __func__, priv->pacing);
@ -2492,7 +2492,7 @@ static int ft1000d_get_level(RIG *rig, vfo_t vfo, setting_t level,
return err;
}
err = read_block(rig->state.rigport, mdata,FT1000D_READ_METER_LENGTH);
err = read_block(&rig->state.rigport, mdata,FT1000D_READ_METER_LENGTH);
if (err < 0)
{
@ -3316,7 +3316,7 @@ static int ft1000d_get_update_data(RIG *rig, unsigned char ci,
priv = (struct ft1000d_priv_data *)rig->state.priv;
rig_s = &rig->state;
retry = rig_s->rigport->retry;
retry = rig_s->rigport.retry;
do
{
@ -3385,7 +3385,7 @@ static int ft1000d_get_update_data(RIG *rig, unsigned char ci,
return -RIG_EINVAL;
}
n = read_block(rig->state.rigport, p, rl);
n = read_block(&rig->state.rigport, p, rl);
}
while (n < 0 && retry-- >= 0);
@ -3435,7 +3435,7 @@ static int ft1000d_send_static_cmd(RIG *rig, unsigned char ci)
return -RIG_EINVAL;
}
err = write_block(rig->state.rigport, ncmd[ci].nseq,
err = write_block(&rig->state.rigport, ncmd[ci].nseq,
YAESU_CMD_LENGTH);
if (err != RIG_OK)
@ -3443,7 +3443,7 @@ static int ft1000d_send_static_cmd(RIG *rig, unsigned char ci)
return err;
}
hl_usleep(rig->state.rigport->write_delay * 1000);
hl_usleep(rig->state.rigport.write_delay * 1000);
return RIG_OK;
}
@ -3496,14 +3496,14 @@ 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, (unsigned 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)
{
return err;
}
hl_usleep(rig->state.rigport->write_delay * 1000);
hl_usleep(rig->state.rigport.write_delay * 1000);
return RIG_OK;
}
@ -3554,14 +3554,14 @@ 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, (unsigned 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)
{
return err;
}
hl_usleep(rig->state.rigport->write_delay * 1000);
hl_usleep(rig->state.rigport.write_delay * 1000);
return RIG_OK;
}
@ -3619,14 +3619,14 @@ 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, (unsigned 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)
{
return err;
}
hl_usleep(rig->state.rigport->write_delay * 1000);
hl_usleep(rig->state.rigport.write_delay * 1000);
return RIG_OK;
}

Wyświetl plik

@ -783,10 +783,10 @@ static int ft1000mp_open(RIG *rig)
p = (struct ft1000mp_priv_data *)rig_s->priv;
rig_debug(RIG_DEBUG_TRACE, "%s: rig_open: write_delay = %i msec \n", __func__,
rig_s->rigport->write_delay);
rig_s->rigport.write_delay);
rig_debug(RIG_DEBUG_TRACE, "%s: rig_open: post_write_delay = %i msec \n",
__func__,
rig_s->rigport->post_write_delay);
rig_s->rigport.post_write_delay);
/*
* Copy native cmd PACING to private cmd storage area
@ -797,7 +797,7 @@ static int ft1000mp_open(RIG *rig)
/* send PACING cmd to rig */
cmd = p->p_cmd;
write_block(rig->state.rigport, cmd, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
ft1000mp_get_vfo(rig, &rig->state.current_vfo);
/* TODO */
@ -859,7 +859,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, cmd, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
RETURNFUNC(RIG_OK);
}
@ -1306,7 +1306,7 @@ static int ft1000mp_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
cmd = priv->p_cmd;
write_block(rs->rigport, cmd, YAESU_CMD_LENGTH);
write_block(&rs->rigport, cmd, YAESU_CMD_LENGTH);
RETURNFUNC(RIG_OK);
case RIG_FUNC_XIT:
@ -1321,7 +1321,7 @@ static int ft1000mp_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
cmd = priv->p_cmd;
write_block(rs->rigport, cmd, YAESU_CMD_LENGTH);
write_block(&rs->rigport, cmd, YAESU_CMD_LENGTH);
RETURNFUNC(RIG_OK);
default:
@ -1463,7 +1463,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, cmd, YAESU_CMD_LENGTH);
write_block(&rs->rigport, cmd, YAESU_CMD_LENGTH);
RETURNFUNC(RIG_OK);
}
@ -1528,7 +1528,7 @@ static int ft1000mp_get_level(RIG *rig, vfo_t vfo, setting_t level,
unsigned char lvl_data[YAESU_CMD_LENGTH];
int m;
int retval;
int retry = rig->state.rigport->retry;
int retry = rig->state.rigport.retry;
ENTERFUNC;
rs = &rig->state;
@ -1588,9 +1588,9 @@ static int ft1000mp_get_level(RIG *rig, vfo_t vfo, setting_t level,
do
{
write_block(rs->rigport, priv->p_cmd, YAESU_CMD_LENGTH);
write_block(&rs->rigport, priv->p_cmd, YAESU_CMD_LENGTH);
retval = read_block(rs->rigport, lvl_data, YAESU_CMD_LENGTH);
retval = read_block(&rs->rigport, lvl_data, YAESU_CMD_LENGTH);
}
while (retry-- && retval == -RIG_ETIMEOUT);
@ -1665,7 +1665,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, p->update_data, rl);
n = read_block(&rig->state.rigport, p->update_data, rl);
if (n == -RIG_ETIMEOUT)
{
@ -1694,7 +1694,7 @@ static int ft1000mp_send_priv_cmd(RIG *rig, unsigned char ci)
RETURNFUNC(-RIG_EINVAL);
}
write_block(rig->state.rigport, ncmd[ci].nseq, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, ncmd[ci].nseq, YAESU_CMD_LENGTH);
RETURNFUNC(RIG_OK);

Wyświetl plik

@ -398,7 +398,7 @@ static int ft600_send_priv_cmd(RIG *rig, unsigned char cmd_index)
if (!rig) { return -RIG_EINVAL; }
return write_block(rig->state.rigport, (unsigned 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)
@ -410,7 +410,7 @@ static int ft600_read_status(RIG *rig)
priv = (struct ft600_priv_data *)rig->state.priv;
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
ret = ft600_send_priv_cmd(rig, FT600_NATIVE_CAT_READ_STATUS);
@ -420,7 +420,7 @@ static int ft600_read_status(RIG *rig)
}
ret = read_block(rig->state.rigport,
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);
@ -452,7 +452,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, &priv->s_meter, 5);
ret = read_block(&rig->state.rigport, &priv->s_meter, 5);
if (ret < 0)
{
@ -483,7 +483,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, 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)
@ -651,7 +651,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, p_cmd, YAESU_CMD_LENGTH);
ret = write_block(&rig->state.rigport, p_cmd, YAESU_CMD_LENGTH);
if (ret != RIG_OK)
{

Wyświetl plik

@ -240,7 +240,7 @@ int ft736_open(RIG *rig)
/* send Ext Cntl ON: Activate CAT */
ret = write_block(rig->state.rigport, cmd, YAESU_CMD_LENGTH);
ret = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
if (ret != RIG_OK)
{
@ -259,7 +259,7 @@ int ft736_close(RIG *rig)
free(rig->state.priv);
/* send Ext Cntl OFF: Deactivate CAT */
return write_block(rig->state.rigport, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -284,7 +284,7 @@ int ft736_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
}
/* Frequency set */
return write_block(rig->state.rigport, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -338,7 +338,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, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -355,7 +355,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, cmd, YAESU_CMD_LENGTH);
ret = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
if (ret == RIG_OK)
{
@ -383,7 +383,7 @@ int ft736_set_split_freq(RIG *rig, vfo_t vfo, freq_t freq)
}
/* Frequency set */
return write_block(rig->state.rigport, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -424,7 +424,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, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -437,7 +437,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, 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)
@ -445,9 +445,9 @@ int ft736_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0xe7};
int retval;
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
retval = write_block(rig->state.rigport, cmd, YAESU_CMD_LENGTH);
retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
if (retval < 0)
{
@ -455,7 +455,7 @@ int ft736_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
}
/* read back the 1 byte */
retval = read_block(rig->state.rigport, cmd, 5);
retval = read_block(&rig->state.rigport, cmd, 5);
if (retval < 1)
{
@ -480,10 +480,10 @@ int ft736_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
return -RIG_EINVAL;
}
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
/* send Test S-meter cmd to rig */
retval = write_block(rig->state.rigport, cmd, YAESU_CMD_LENGTH);
retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
if (retval < 0)
{
@ -491,7 +491,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, cmd, 5);
retval = read_block(&rig->state.rigport, cmd, 5);
if (retval < 1)
{
@ -533,7 +533,7 @@ int ft736_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t shift)
return -RIG_EINVAL;
}
return write_block(rig->state.rigport, 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)
@ -544,7 +544,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, 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)
@ -565,7 +565,7 @@ int ft736_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
return -RIG_EINVAL;
}
return write_block(rig->state.rigport, 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)
@ -588,7 +588,7 @@ int ft736_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
cmd[0] = 0x3e - i;
return write_block(rig->state.rigport, 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

@ -496,9 +496,9 @@ int ft747_open(RIG *rig)
p = (struct ft747_priv_data *)rig_s->priv;
rig_debug(RIG_DEBUG_VERBOSE, "ft747:rig_open: write_delay = %i msec \n",
rig_s->rigport->write_delay);
rig_s->rigport.write_delay);
rig_debug(RIG_DEBUG_VERBOSE, "ft747:rig_open: post_write_delay = %i msec \n",
rig_s->rigport->post_write_delay);
rig_s->rigport.post_write_delay);
/*
* Copy native cmd PACING to private cmd storage area
@ -512,7 +512,7 @@ int ft747_open(RIG *rig)
/* send PACING cmd to rig, once for all */
ret = write_block(rig->state.rigport, p->p_cmd, YAESU_CMD_LENGTH);
ret = write_block(&rig->state.rigport, p->p_cmd, YAESU_CMD_LENGTH);
if (ret < 0)
{
@ -572,7 +572,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, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -950,7 +950,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, 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)
@ -995,7 +995,7 @@ static int ft747_get_update_data(RIG *rig)
unsigned char last_byte;
p = (struct ft747_priv_data *)rig->state.priv;
rigport = rig->state.rigport;
rigport = &rig->state.rigport;
if (!rig_check_cache_timeout(&p->status_tv, FT747_CACHE_TIMEOUT))
{
@ -1053,7 +1053,7 @@ static int ft747_send_priv_cmd(RIG *rig, unsigned char ci)
return -RIG_EINVAL;
}
return write_block(rig->state.rigport, ft747_ncmd[ci].nseq, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, ft747_ncmd[ci].nseq, YAESU_CMD_LENGTH);
}

Wyświetl plik

@ -450,7 +450,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, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -476,7 +476,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, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -604,7 +604,7 @@ static int ft757_set_vfo(RIG *rig, vfo_t vfo)
priv->current_vfo = vfo;
return write_block(rig->state.rigport, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -675,10 +675,10 @@ static int ft757_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
return -RIG_EINVAL;
}
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
/* send READ STATUS(Meter only) cmd to rig */
retval = write_block(rig->state.rigport, cmd, YAESU_CMD_LENGTH);
retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
if (retval < 0)
{
@ -686,7 +686,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, cmd, 1);
retval = read_block(&rig->state.rigport, cmd, 1);
if (retval != 1)
{
@ -716,19 +716,19 @@ static int ft757_get_update_data(RIG *rig)
int retval = 0;
long nbtries;
/* Maximum number of attempts to ask/read the data. */
int maxtries = rig->state.rigport->retry ;
int maxtries = rig->state.rigport.retry ;
rig_debug(RIG_DEBUG_VERBOSE, "%s called Timeout=%d ms, Retry=%d\n",
__func__, rig->state.rigport->timeout, maxtries);
__func__, rig->state.rigport.timeout, maxtries);
/* At least on one model, returns erraticaly a timeout. Increasing the timeout
does not fix things. So we restart the read from scratch, it works most of times. */
for (nbtries = 0 ; nbtries < maxtries ; nbtries++)
{
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
/* send READ STATUS cmd to rig */
retval = write_block(rig->state.rigport, cmd, YAESU_CMD_LENGTH);
retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
if (retval < 0)
{
@ -736,7 +736,7 @@ static int ft757_get_update_data(RIG *rig)
}
/* read back the 75 status bytes */
retval = read_block(rig->state.rigport,
retval = read_block(&rig->state.rigport,
priv->update_data,
FT757GX_STATUS_UPDATE_DATA_LENGTH);

Wyświetl plik

@ -457,7 +457,7 @@ int ft767_open(RIG *rig)
struct ft767_priv_data *priv = (struct ft767_priv_data *)rig->state.priv;
int retval;
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
/* send 0 delay PACING cmd to rig */
retval = ft767_enter_CAT(rig);
@ -489,7 +489,7 @@ int ft767_open(RIG *rig)
int ft767_close(RIG *rig)
{
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
return RIG_OK;
}
@ -1226,7 +1226,7 @@ int ft767_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
return -RIG_EINVAL; /* sorry, wrong VFO */
}
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
retval = ft767_enter_CAT(rig);
@ -1474,10 +1474,10 @@ int ft767_send_block_and_ack(RIG *rig, unsigned char *cmd, size_t length)
}
/* send the command block */
write_block(rig->state.rigport, 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,
retval = read_block(&rig->state.rigport,
cmd_echo_buf,
YAESU_CMD_LENGTH);
@ -1497,10 +1497,10 @@ int ft767_send_block_and_ack(RIG *rig, unsigned char *cmd, size_t length)
}
/* send the ACK */
write_block(rig->state.rigport, 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,
retval = read_block(&rig->state.rigport,
priv->rx_data,
replylen);
@ -1539,7 +1539,7 @@ int ft767_get_update_data(RIG *rig)
struct ft767_priv_data *priv = (struct ft767_priv_data *)rig->state.priv;
int retval;
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
/* Entering CAT updates our data structures */
retval = ft767_enter_CAT(rig);
@ -1570,7 +1570,7 @@ int ft767_set_split(RIG *rig, unsigned int split)
int retval;
unsigned int curr_split;
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
/* Entering CAT updates our data structures */
retval = ft767_enter_CAT(rig);

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, data, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, data, YAESU_CMD_LENGTH);
if ((n = read_block(rig->state.rigport, data, 2)) < 0)
if ((n = read_block(&rig->state.rigport, data, 2)) < 0)
{
return n;
}
@ -707,7 +707,7 @@ static int ft817_get_status(RIG *rig, int status)
unsigned char *data;
int len;
int n;
int retries = rig->state.rigport->retry;
int retries = rig->state.rigport.retry;
unsigned char result[2];
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
@ -747,10 +747,10 @@ static int ft817_get_status(RIG *rig, int status)
do
{
rig_flush(rig->state.rigport);
write_block(rig->state.rigport, ncmd[status].nseq,
rig_flush(&rig->state.rigport);
write_block(&rig->state.rigport, ncmd[status].nseq,
YAESU_CMD_LENGTH);
n = read_block(rig->state.rigport, data, len);
n = read_block(&rig->state.rigport, data, len);
}
while (retries-- && n < 0);
@ -821,7 +821,7 @@ static int ft817_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
{
struct ft817_priv_data *p = (struct ft817_priv_data *) rig->state.priv;
freq_t f1 = 0, f2 = 0;
int retries = rig->state.rigport->retry +
int retries = rig->state.rigport.retry +
1; // +1 because, because 2 steps are needed even in best scenario
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
@ -1316,14 +1316,14 @@ int ft817_read_ack(RIG *rig)
unsigned char dummy;
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
if (rig->state.rigport->post_write_delay == 0)
if (rig->state.rigport.post_write_delay == 0)
{
if (read_block(rig->state.rigport, &dummy, 1) < 0)
if (read_block(&rig->state.rigport, &dummy, 1) < 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: error reading ack\n", __func__);
rig_debug(RIG_DEBUG_ERR, "%s: adjusting post_write_delay to avoid ack\n",
__func__);
rig->state.rigport->post_write_delay =
rig->state.rigport.post_write_delay =
10; // arbitrary choice right now of max 100 cmds/sec
return RIG_OK; // let it continue without checking for ack now
}
@ -1353,8 +1353,8 @@ static int ft817_send_cmd(RIG *rig, int index)
return -RIG_EINTERNAL;
}
rig_flush(rig->state.rigport);
write_block(rig->state.rigport, ncmd[index].nseq, YAESU_CMD_LENGTH);
rig_flush(&rig->state.rigport);
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, cmd, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
return ft817_read_ack(rig);
}
@ -1508,7 +1508,7 @@ static int ft817_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
{
int index;
ptt_t ptt_response = -1;
int retries = rig->state.rigport->retry;
int retries = rig->state.rigport.retry;
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
@ -1799,10 +1799,10 @@ 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,
write_block(&rig->state.rigport,
ncmd[FT817_NATIVE_CAT_PWR_WAKE].nseq, YAESU_CMD_LENGTH);
hl_usleep(200 * 1000);
write_block(rig->state.rigport, 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

@ -455,9 +455,9 @@ static int ft840_open(RIG *rig)
rig_s = &rig->state;
rig_debug(RIG_DEBUG_TRACE, "%s: write_delay = %i msec\n",
__func__, rig_s->rigport->write_delay);
__func__, rig_s->rigport.write_delay);
rig_debug(RIG_DEBUG_TRACE, "%s: post_write_delay = %i msec\n",
__func__, rig_s->rigport->post_write_delay);
__func__, rig_s->rigport.post_write_delay);
rig_debug(RIG_DEBUG_TRACE,
"%s: read pacing = %i\n", __func__, priv->pacing);
@ -1746,7 +1746,7 @@ static int ft840_get_update_data(RIG *rig, unsigned char ci, unsigned char rl)
return err;
}
n = read_block(rig->state.rigport, priv->update_data, rl);
n = read_block(&rig->state.rigport, priv->update_data, rl);
if (n < 0)
{
@ -1789,7 +1789,7 @@ static int ft840_send_static_cmd(RIG *rig, unsigned char ci)
return -RIG_EINVAL;
}
err = write_block(rig->state.rigport, ncmd[ci].nseq,
err = write_block(&rig->state.rigport, ncmd[ci].nseq,
YAESU_CMD_LENGTH);
if (err != RIG_OK)
@ -1850,7 +1850,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, (unsigned 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)
{
@ -1910,7 +1910,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, (unsigned 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)
{
@ -1991,7 +1991,7 @@ static int ft840_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,
err = write_block(&rig->state.rigport, (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, 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, 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, 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, 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, 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)
@ -1451,9 +1451,9 @@ static int ft847_get_status(RIG *rig, int status_ci)
return -RIG_EINTERNAL;
}
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
n = write_block(rig->state.rigport, 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, 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, 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, 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, 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, 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, data, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, data, YAESU_CMD_LENGTH);
if ((n = read_block(rig->state.rigport, data, 2)) < 0)
if ((n = read_block(&rig->state.rigport, data, 2)) < 0)
{
return n;
}
@ -534,12 +534,12 @@ static int ft857_get_status(RIG *rig, int status)
return -RIG_EINTERNAL;
}
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
write_block(rig->state.rigport, ncmd[status].nseq,
write_block(&rig->state.rigport, ncmd[status].nseq,
YAESU_CMD_LENGTH);
if ((n = read_block(rig->state.rigport, 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, 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, cmd, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
return ft817_read_ack(rig);
}

Wyświetl plik

@ -605,9 +605,9 @@ static int ft890_open(RIG *rig)
rig_s = &rig->state;
rig_debug(RIG_DEBUG_TRACE, "%s: write_delay = %i msec\n",
__func__, rig_s->rigport->write_delay);
__func__, rig_s->rigport.write_delay);
rig_debug(RIG_DEBUG_TRACE, "%s: post_write_delay = %i msec\n",
__func__, rig_s->rigport->post_write_delay);
__func__, rig_s->rigport.post_write_delay);
rig_debug(RIG_DEBUG_TRACE,
"%s: read pacing = %i\n", __func__, priv->pacing);
@ -1899,7 +1899,7 @@ static int ft890_get_update_data(RIG *rig, unsigned char ci, unsigned char rl)
return err;
}
n = read_block(rig->state.rigport, priv->update_data, rl);
n = read_block(&rig->state.rigport, priv->update_data, rl);
if (n < 0)
{
@ -1942,7 +1942,7 @@ static int ft890_send_static_cmd(RIG *rig, unsigned char ci)
return -RIG_EINVAL;
}
err = write_block(rig->state.rigport, ncmd[ci].nseq, YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, ncmd[ci].nseq, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -2002,7 +2002,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, (unsigned 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)
{
@ -2062,7 +2062,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, (unsigned 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)
{
@ -2142,7 +2142,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, (unsigned 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,7 +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, (unsigned char *) 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;
@ -559,7 +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, (unsigned char *) 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

@ -626,9 +626,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, data, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, data, YAESU_CMD_LENGTH);
if ((n = read_block(rig->state.rigport, data, 2)) < 0)
if ((n = read_block(&rig->state.rigport, data, 2)) < 0)
{
return n;
}
@ -685,12 +685,12 @@ static int ft897_get_status(RIG *rig, int status)
return -RIG_EINTERNAL;
}
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
write_block(rig->state.rigport, ncmd[status].nseq,
write_block(&rig->state.rigport, ncmd[status].nseq,
YAESU_CMD_LENGTH);
if ((n = read_block(rig->state.rigport, data, len)) < 0)
if ((n = read_block(&rig->state.rigport, data, len)) < 0)
{
return n;
}
@ -1049,7 +1049,7 @@ static int ft897_send_cmd(RIG *rig, int index)
return -RIG_EINTERNAL;
}
write_block(rig->state.rigport, ncmd[index].nseq, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, ncmd[index].nseq, YAESU_CMD_LENGTH);
return ft817_read_ack(rig);
}
@ -1071,7 +1071,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, cmd, YAESU_CMD_LENGTH);
write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
return ft817_read_ack(rig);
}

Wyświetl plik

@ -627,9 +627,9 @@ static int ft900_open(RIG *rig)
rig_s = &rig->state;
rig_debug(RIG_DEBUG_TRACE, "%s: write_delay = %i msec\n",
__func__, rig_s->rigport->write_delay);
__func__, rig_s->rigport.write_delay);
rig_debug(RIG_DEBUG_TRACE, "%s: post_write_delay = %i msec\n",
__func__, rig_s->rigport->post_write_delay);
__func__, rig_s->rigport.post_write_delay);
rig_debug(RIG_DEBUG_TRACE,
"%s: read pacing = %i\n", __func__, priv->pacing);
@ -1921,7 +1921,7 @@ static int ft900_get_update_data(RIG *rig, unsigned char ci, unsigned char rl)
return err;
}
n = read_block(rig->state.rigport, priv->update_data, rl);
n = read_block(&rig->state.rigport, priv->update_data, rl);
if (n < 0)
{
@ -1964,7 +1964,7 @@ static int ft900_send_static_cmd(RIG *rig, unsigned char ci)
return -RIG_EINVAL;
}
err = write_block(rig->state.rigport, ncmd[ci].nseq, YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, ncmd[ci].nseq, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -2024,7 +2024,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, (unsigned char *) &priv->p_cmd,
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd,
YAESU_CMD_LENGTH);
if (err != RIG_OK)
@ -2085,7 +2085,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, (unsigned char *) &priv->p_cmd,
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd,
YAESU_CMD_LENGTH);
if (err != RIG_OK)
@ -2166,7 +2166,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, (unsigned char *) &priv->p_cmd,
err = write_block(&rig->state.rigport, (unsigned char *) &priv->p_cmd,
YAESU_CMD_LENGTH);
if (err != RIG_OK)

Wyświetl plik

@ -701,9 +701,9 @@ static int ft920_open(RIG *rig)
rig_s = &rig->state;
rig_debug(RIG_DEBUG_TRACE, "%s: write_delay = %i msec\n",
__func__, rig_s->rigport->write_delay);
__func__, rig_s->rigport.write_delay);
rig_debug(RIG_DEBUG_TRACE, "%s: post_write_delay = %i msec\n",
__func__, rig_s->rigport->post_write_delay);
__func__, rig_s->rigport.post_write_delay);
/* Copy native cmd PACING to private cmd storage area */
memcpy(&priv->p_cmd, &ncmd[FT920_NATIVE_PACING].nseq, YAESU_CMD_LENGTH);
@ -713,7 +713,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, priv->p_cmd, YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, priv->p_cmd, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -2630,7 +2630,7 @@ static int ft920_get_update_data(RIG *rig, unsigned char ci, unsigned char rl)
return err;
}
n = read_block(rig->state.rigport, priv->update_data, rl);
n = read_block(&rig->state.rigport, priv->update_data, rl);
if (n < 0)
{
@ -2677,7 +2677,7 @@ static int ft920_send_static_cmd(RIG *rig, unsigned char ci)
return -RIG_EINVAL;
}
err = write_block(rig->state.rigport, ncmd[ci].nseq, YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, ncmd[ci].nseq, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -2742,7 +2742,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, (unsigned 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)
{
@ -2806,7 +2806,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, (unsigned 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)
{
@ -2889,7 +2889,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, (unsigned 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

@ -571,16 +571,16 @@ int ft980_transaction(RIG *rig, const unsigned char *cmd, unsigned char *data,
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
retval = write_block(rig->state.rigport, cmd, YAESU_CMD_LENGTH);
retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
if (retval < 0)
{
return retval;
}
retval = read_block(rig->state.rigport, echo_back, YAESU_CMD_LENGTH);
retval = read_block(&rig->state.rigport, echo_back, YAESU_CMD_LENGTH);
if (retval < 0)
{
@ -592,14 +592,14 @@ int ft980_transaction(RIG *rig, const unsigned char *cmd, unsigned char *data,
return -RIG_EPROTO;
}
retval = write_block(rig->state.rigport, cmd_OK, YAESU_CMD_LENGTH);
retval = write_block(&rig->state.rigport, cmd_OK, YAESU_CMD_LENGTH);
if (retval < 0)
{
return retval;
}
retval = read_block(rig->state.rigport, data, expected_len);
retval = read_block(&rig->state.rigport, data, expected_len);
if (retval < 0)
{
@ -753,18 +753,18 @@ int ft980_open(RIG *rig)
do
{
write_block(rig->state.rigport, cmd_ON_OFF,
write_block(&rig->state.rigport, cmd_ON_OFF,
YAESU_CMD_LENGTH);
retval = read_block(rig->state.rigport, 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);
while (retval != 5 && retry_count2++ < rig->state.rigport.retry);
write_block(rig->state.rigport, cmd_OK, YAESU_CMD_LENGTH);
retval = read_block(rig->state.rigport, (unsigned 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
&& retry_count1++ < rig->state.rigport->retry);
&& retry_count1++ < rig->state.rigport.retry);
return RIG_OK;
}
@ -799,18 +799,18 @@ int ft980_close(RIG *rig)
do
{
write_block(rig->state.rigport, cmd_ON_OFF,
write_block(&rig->state.rigport, cmd_ON_OFF,
YAESU_CMD_LENGTH);
retval = read_block(rig->state.rigport, 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);
while (retval != 5 && retry_count2++ < rig->state.rigport.retry);
write_block(rig->state.rigport, cmd_OK, YAESU_CMD_LENGTH);
retval = read_block(rig->state.rigport, (unsigned 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
&& retry_count1++ < rig->state.rigport->retry);
&& retry_count1++ < rig->state.rigport.retry);
return RIG_OK;
}
@ -1223,7 +1223,7 @@ int ft980_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
*/
cmd[4] = split == RIG_SPLIT_ON ? 0x0e : 0x8e;
return write_block(rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
#endif
}

Wyświetl plik

@ -458,9 +458,9 @@ int ft990_open(RIG *rig)
rig_s = &rig->state;
rig_debug(RIG_DEBUG_TRACE, "%s: write_delay = %i msec\n",
__func__, rig_s->rigport->write_delay);
__func__, rig_s->rigport.write_delay);
rig_debug(RIG_DEBUG_TRACE, "%s: post_write_delay = %i msec\n",
__func__, rig_s->rigport->post_write_delay);
__func__, rig_s->rigport.post_write_delay);
rig_debug(RIG_DEBUG_TRACE,
"%s: read pacing = %i\n", __func__, priv->pacing);
@ -2427,7 +2427,7 @@ int ft990_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *value)
return err;
}
err = read_block(rig->state.rigport, mdata, FT990_READ_METER_LENGTH);
err = read_block(&rig->state.rigport, mdata, FT990_READ_METER_LENGTH);
if (err < 0)
{
@ -3294,7 +3294,7 @@ int ft990_get_update_data(RIG *rig, unsigned char ci, unsigned short ch)
return -RIG_EINVAL;
}
n = read_block(rig->state.rigport, p, rl);
n = read_block(&rig->state.rigport, p, rl);
if (n < 0)
{
@ -3340,7 +3340,7 @@ int ft990_send_static_cmd(RIG *rig, unsigned char ci)
return -RIG_EINVAL;
}
err = write_block(rig->state.rigport, ncmd[ci].nseq, YAESU_CMD_LENGTH);
err = write_block(&rig->state.rigport, ncmd[ci].nseq, YAESU_CMD_LENGTH);
if (err != RIG_OK)
{
@ -3398,7 +3398,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, (unsigned 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)
{
@ -3456,7 +3456,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, (unsigned 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)
{
@ -3520,7 +3520,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, (unsigned 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

@ -521,10 +521,10 @@ int newcat_open(RIG *rig)
rig_debug(RIG_DEBUG_TRACE, "%s: Rig=%s, version=%s\n", __func__,
rig->caps->model_name, rig->caps->version);
rig_debug(RIG_DEBUG_TRACE, "%s: write_delay = %i msec\n",
__func__, rig_s->rigport->write_delay);
__func__, rig_s->rigport.write_delay);
rig_debug(RIG_DEBUG_TRACE, "%s: post_write_delay = %i msec\n",
__func__, rig_s->rigport->post_write_delay);
__func__, rig_s->rigport.post_write_delay);
rig_debug(RIG_DEBUG_TRACE, "%s: serial_handshake = %s \n",
__func__, handshake[rig->caps->serial_handshake]);
@ -542,8 +542,8 @@ int newcat_open(RIG *rig)
priv->trn_state = -1;
// for this sequence we will shorten the timeout so we can detect rig is powered off faster
int timeout = rig->state.rigport->timeout;
rig->state.rigport->timeout = 100;
int timeout = rig->state.rigport.timeout;
rig->state.rigport.timeout = 100;
newcat_get_trn(rig, &priv->trn_state); /* ignore errors */
/* Currently we cannot cope with AI mode so turn it off in case
@ -556,7 +556,7 @@ int newcat_open(RIG *rig)
/* Initialize rig_id in case any subsequent commands need it */
(void)newcat_get_rigid(rig);
rig_debug(RIG_DEBUG_VERBOSE, "%s: rig_id=%d\n", __func__, priv->rig_id);
rig->state.rigport->timeout = timeout;
rig->state.rigport.timeout = timeout;
#if 0 // possible future enhancement?
@ -837,7 +837,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
if (ptt == RIG_PTT_ON)
{
rig_debug(RIG_DEBUG_WARN, "%s: ptt still on..->retry#%d\n", __func__, retry);
rig_debug(RIG_DEBUG_WARN, "%s: ptt still on...retry#%d\n", __func__, retry);
hl_usleep(100 * 1000); // 100ms pause if ptt still on
}
}
@ -3247,7 +3247,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, (unsigned char *) "\n", 1);
write_block(&state->rigport, (unsigned char *) "\n", 1);
hl_usleep(1500000);
break;
@ -3262,10 +3262,10 @@ 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, (unsigned char *) 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;
retry_save = rig->state.rigport.retry;
rig->state.rigport.retry = 0;
if (status == RIG_POWER_ON) // wait for wakeup only
{
@ -3277,18 +3277,18 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status)
if (retval == RIG_OK)
{
rig->state.rigport->retry = retry_save;
rig->state.rigport.retry = retry_save;
RETURNFUNC(retval);
}
rig_debug(RIG_DEBUG_TRACE, "%s: Wait #%d for power up\n", __func__, i + 1);
retval = write_block(state->rigport, (unsigned char *) 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); }
}
}
rig->state.rigport->retry = retry_save;
rig->state.rigport.retry = retry_save;
if (i == 9)
{
@ -9956,16 +9956,16 @@ int newcat_get_cmd(RIG *rig)
}
while (rc != RIG_OK && retry_count++ <= state->rigport->retry)
while (rc != RIG_OK && retry_count++ <= state->rigport.retry)
{
rig_flush(state->rigport); /* discard any unsolicited data */
rig_flush(&state->rigport); /* discard any unsolicited data */
if (rc != -RIG_BUSBUSY)
{
/* send the command */
rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str);
if (RIG_OK != (rc = write_block(state->rigport, (unsigned char *) priv->cmd_str,
if (RIG_OK != (rc = write_block(&state->rigport, (unsigned char *) priv->cmd_str,
strlen(priv->cmd_str))))
{
RETURNFUNC(rc);
@ -9973,7 +9973,7 @@ int newcat_get_cmd(RIG *rig)
}
/* read the reply */
if ((rc = read_string(state->rigport, (unsigned char *) 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 */
@ -10055,7 +10055,7 @@ int newcat_get_cmd(RIG *rig)
}
rig_debug(RIG_DEBUG_WARN, "%s: Rig busy - retrying %d of %d: '%s'\n", __func__,
retry_count, state->rigport->retry, priv->cmd_str);
retry_count, state->rigport.retry, priv->cmd_str);
rc = -RIG_ERJCTED; /* retry */
break;
@ -10182,15 +10182,15 @@ int newcat_set_cmd_validate(RIG *rig)
{
int bytes;
char cmd[256]; // big enough
rig_flush(state->rigport); /* discard any unsolicited data */
rig_flush(&state->rigport); /* discard any unsolicited data */
SNPRINTF(cmd, sizeof(cmd), "%s%s", priv->cmd_str, valcmd);
rc = write_block(state->rigport, (unsigned char *) 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, (unsigned char *) 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
@ -10257,9 +10257,9 @@ int newcat_set_cmd(RIG *rig)
char const *const verify_cmd = RIG_MODEL_FT9000 == rig->caps->rig_model ?
"AI;" : "ID;";
while (rc != RIG_OK && retry_count++ <= state->rigport->retry)
while (rc != RIG_OK && retry_count++ <= state->rigport.retry)
{
rig_flush(state->rigport); /* discard any unsolicited data */
rig_flush(&state->rigport); /* discard any unsolicited data */
/* send the command */
rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str);
@ -10280,7 +10280,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, (unsigned char *) priv->cmd_str,
if (RIG_OK != (rc = write_block(&state->rigport, (unsigned char *) priv->cmd_str,
strlen(priv->cmd_str))))
{
RETURNFUNC(rc);
@ -10311,14 +10311,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, (unsigned char *) 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, (unsigned char *) 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 */
@ -10388,7 +10388,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, (unsigned char *) 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, 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, 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, cmd, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
@ -412,10 +412,10 @@ int vr5000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
return -RIG_EINVAL;
}
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
/* send READ STATUS(Meter only) cmd to rig */
retval = write_block(rig->state.rigport, 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, cmd, 1);
retval = read_block(&rig->state.rigport, cmd, 1);
if (retval < 1)
{
@ -446,10 +446,10 @@ int vr5000_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0xe7};
int retval;
rig_flush(rig->state.rigport);
rig_flush(&rig->state.rigport);
/* send READ STATUS(Meter only) cmd to rig */
retval = write_block(rig->state.rigport, 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, 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, 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, cmd_freq, YAESU_CMD_LENGTH);
return write_block(&rig->state.rigport, cmd_freq, YAESU_CMD_LENGTH);
}

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