本文整理汇总了C++中rig_debug函数的典型用法代码示例。如果您正苦于以下问题:C++ rig_debug函数的具体用法?C++ rig_debug怎么用?C++ rig_debug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rig_debug函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: netrigctl_scan
static int netrigctl_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
{
int ret, len;
char cmd[CMD_MAX];
char buf[BUF_MAX];
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
len = sprintf(cmd, "g %s %d\n", rig_strscan(scan), ch);
ret = netrigctl_transaction(rig, cmd, len, buf);
if (ret > 0)
return -RIG_EPROTO;
else
return ret;
}
示例2: netrigctl_set_powerstat
static int netrigctl_set_powerstat(RIG *rig, powerstat_t status)
{
int ret, len;
char cmd[CMD_MAX];
char buf[BUF_MAX];
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
len = sprintf(cmd, "\\set_powerstat %d\n", status);
ret = netrigctl_transaction(rig, cmd, len, buf);
if (ret > 0)
return -RIG_EPROTO;
else
return ret;
}
示例3: netrigctl_set_bank
static int netrigctl_set_bank(RIG *rig, vfo_t vfo, int bank)
{
int ret, len;
char cmd[CMD_MAX];
char buf[BUF_MAX];
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
len = sprintf(cmd, "B %d\n", bank);
ret = netrigctl_transaction(rig, cmd, len, buf);
if (ret > 0)
return -RIG_EPROTO;
else
return ret;
}
示例4: ft817_send_icmd
/*
* The same for incomplete commands.
*/
static int ft817_send_icmd(RIG *rig, int index, unsigned char *data)
{
struct ft817_priv_data *p = (struct ft817_priv_data *) rig->state.priv;
unsigned char cmd[YAESU_CMD_LENGTH];
if (p->pcs[index].ncomp == 1) {
rig_debug(RIG_DEBUG_VERBOSE, "ft817: Complete sequence\n");
return -RIG_EINTERNAL;
}
cmd[YAESU_CMD_LENGTH - 1] = p->pcs[index].nseq[YAESU_CMD_LENGTH - 1];
memcpy(cmd, data, YAESU_CMD_LENGTH - 1);
write_block(&rig->state.rigport, (char *) cmd, YAESU_CMD_LENGTH);
return ft817_read_ack(rig);
}
示例5: par_unlock
/**
* \brief Release lock on Parallel Port
* \param port
* \return RIG_OK or < 0
*/
int HAMLIB_API par_unlock(hamlib_port_t *port)
{
#ifdef HAVE_LINUX_PPDEV_H
if (ioctl(port->fd, PPRELEASE) < 0) {
rig_debug(RIG_DEBUG_ERR, "Releasing device \"%s\": %s\n", port->pathname, strerror(errno));
return -RIG_EIO;
}
return RIG_OK;
#elif defined(HAVE_DEV_PPBUS_PPI_H)
return RIG_OK;
#elif defined(WIN32)
return RIG_OK;
#else
return -RIG_ENIMPL;
#endif
}
示例6: mode_to_char
static char mode_to_char(rmode_t mode)
{
switch (mode) {
case RIG_MODE_CW: return(MD_CW);
case RIG_MODE_CWR: return(MD_CWR);
case RIG_MODE_USB: return(MD_USB);
case RIG_MODE_LSB: return(MD_LSB);
case RIG_MODE_FM: return(MD_FM);
case RIG_MODE_AM: return(MD_AM);
case RIG_MODE_RTTY: return(MD_FSK);
case RIG_MODE_RTTYR: return(MD_FSKR);
default:
rig_debug(RIG_DEBUG_WARN,"ts570_mode_to_char %s: unsupported mode %d\n", __func__,mode);
}
return(RIG_MODE_NONE);
}
示例7: ft817_init
int ft817_init (RIG *rig)
{
struct ft817_priv_data *p;
rig_debug (RIG_DEBUG_VERBOSE,"ft817: ft817_init called \n");
if ((p = calloc(1, sizeof(struct ft817_priv_data))) == NULL)
return -RIG_ENOMEM;
/* Copy complete native cmd set to private cmd storage area */
memcpy(p->pcs, ncmd, sizeof(ncmd));
rig->state.priv = (void*) p;
return RIG_OK;
}
示例8: netrigctl_send_morse
static int netrigctl_send_morse(RIG *rig, vfo_t vfo, const char *msg)
{
int ret, len;
char cmd[CMD_MAX];
char buf[BUF_MAX];
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
len = sprintf(cmd, "\\send_morse %s\n", msg);
ret = netrigctl_transaction(rig, cmd, len, buf);
if (ret > 0)
return -RIG_EPROTO;
else
return ret;
}
示例9: netrigctl_vfo_op
static int netrigctl_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
{
int ret, len;
char cmd[CMD_MAX];
char buf[BUF_MAX];
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
len = sprintf(cmd, "J %s\n", rig_strvfop(op));
ret = netrigctl_transaction(rig, cmd, len, buf);
if (ret > 0)
return -RIG_EPROTO;
else
return ret;
}
示例10: rig_set_mem_all
/**
* \brief set all channel and non-channel data
* \param rig The rig handle
* \param chans Channel data
* \param cfgps ??
* \param vals ??
*
* Writes the data associated with all the memory channels,
* and rigs memory parameters.
*
* \return RIG_OK if the operation has been sucessful, otherwise
* a negative value if an error occured (in which case, cause is
* set appropriately).
*
* \sa rig_get_mem_all(), rig_set_mem_all_cb()
*
* \todo set all parm's
* \todo finish coding and testing of mem_all functions
*/
int HAMLIB_API rig_set_mem_all(RIG *rig,
const channel_t chans[],
const struct confparams cfgps[],
const value_t vals[])
{
struct rig_caps *rc;
int retval;
struct map_all_s mem_all_arg;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
if (CHECK_RIG_ARG(rig) || !chans || !cfgps || !vals)
{
return -RIG_EINVAL;
}
rc = rig->caps;
mem_all_arg.chans = (channel_t *) chans;
mem_all_arg.cfgps = cfgps;
mem_all_arg.vals = (value_t *) vals;
if (rc->set_mem_all_cb)
return rc->set_mem_all_cb(rig, map_chan, map_parm,
(rig_ptr_t)&mem_all_arg);
/* if not available, emulate it */
retval = rig_set_chan_all(rig, chans);
if (retval != RIG_OK)
{
return retval;
}
#if 0
retval = rig_set_parm_all(rig, parms);
if (retval != RIG_OK)
{
return retval;
}
#else
return -RIG_ENIMPL;
#endif
return retval;
}
示例11: aor_set_level
/*
* aor_set_level
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int aor_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
struct rig_state *rs;
char lvlbuf[BUFSZ];
int lvl_len;
unsigned i;
int agc;
rs = &rig->state;
switch (level) {
case RIG_LEVEL_ATT:
{
unsigned att = 0;
for (i=0; i<MAXDBLSTSIZ && !RIG_IS_DBLST_END(rs->attenuator[i]); i++) {
if (rs->attenuator[i] == val.i) {
att = i+1;
break;
}
}
/* should be caught by the front end */
if ((val.i != 0) & (i>=MAXDBLSTSIZ || RIG_IS_DBLST_END(rs->attenuator[i])) )
return -RIG_EINVAL;
lvl_len = sprintf(lvlbuf, "AT%u" EOM, att);
break;
}
case RIG_LEVEL_AGC: /* AR5000 & AR5000A */
switch(val.i) {
case RIG_AGC_FAST: agc = '0'; break;
case RIG_AGC_MEDIUM: agc = '1'; break;
case RIG_AGC_SLOW: agc = '2'; break;
case RIG_AGC_OFF:
default: agc = 'F';
}
lvl_len = sprintf(lvlbuf,"AC%c" EOM, agc);
break;
default:
rig_debug(RIG_DEBUG_ERR,"Unsupported aor_set_level %d\n", level);
return -RIG_EINVAL;
}
return aor_transaction (rig, lvlbuf, lvl_len, NULL, NULL);
}
示例12: thd72_set_mem
static int thd72_set_mem(RIG *rig, vfo_t vfo, int ch)
{
int retval;
char c, cmd[10];
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
retval = thd72_vfoc(rig, vfo, &c);
if (retval != RIG_OK)
{
return retval;
}
sprintf(cmd, "MR %c,%03d", c, ch);
return kenwood_simple_transaction(rig, cmd, 10);
}
示例13: thd72_get_mem
static int thd72_get_mem(RIG *rig, vfo_t vfo, int *ch)
{
int retval;
char c, cmd[10], buf[10];
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
retval = thd72_vfoc(rig, vfo, &c);
if (retval != RIG_OK)
return retval;
sprintf(cmd, "MR %c", c);
retval = kenwood_transaction(rig, cmd, buf, sizeof (buf));
if (retval != RIG_OK)
return retval;
sscanf(buf+5, "%d", ch);
return RIG_OK;
}
示例14: ft100_get_split_vfo
int ft100_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) {
struct ft100_priv_data *priv = (struct ft100_priv_data*)rig->state.priv;
int ret;
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __func__);
if( !split ) return -RIG_EINVAL;
ret = ft100_read_flags(rig);
if (ret < 0)
return ret;
*split = (priv->flags.byte[0] & 0x01) == 0x01 ? RIG_SPLIT_ON : RIG_SPLIT_OFF;
return RIG_OK;
}
示例15: ft897_set_mode
int ft897_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
int index; /* index of sequence to send */
if (vfo != RIG_VFO_CURR)
return -RIG_ENTARGET;
rig_debug(RIG_DEBUG_VERBOSE,"ft897: generic mode = %x \n", mode);
switch(mode) {
case RIG_MODE_AM:
index = FT897_NATIVE_CAT_SET_MODE_AM;
break;
case RIG_MODE_CW:
index = FT897_NATIVE_CAT_SET_MODE_CW;
break;
case RIG_MODE_USB:
index = FT897_NATIVE_CAT_SET_MODE_USB;
break;
case RIG_MODE_LSB:
index = FT897_NATIVE_CAT_SET_MODE_LSB;
break;
case RIG_MODE_RTTY:
index = FT897_NATIVE_CAT_SET_MODE_DIG;
break;
case RIG_MODE_FM:
index = FT897_NATIVE_CAT_SET_MODE_FM;
break;
case RIG_MODE_WFM:
index = FT897_NATIVE_CAT_SET_MODE_FM;
break;
case RIG_MODE_CWR:
index = FT897_NATIVE_CAT_SET_MODE_CWR;
break;
case RIG_MODE_PKTFM:
index = FT897_NATIVE_CAT_SET_MODE_PKT;
break;
default:
return -RIG_EINVAL;
}
if (width != RIG_PASSBAND_NORMAL)
return -RIG_EINVAL;
return ft897_send_cmd(rig, index);
}