kopia lustrzana https://github.com/Hamlib/Hamlib
rodzic
a42d408094
commit
9eda0628f6
|
@ -161,7 +161,7 @@ int v4l_open(RIG *rig)
|
|||
{
|
||||
int i;
|
||||
struct video_tuner vt;
|
||||
struct rig_state *rs = &rig->state;
|
||||
struct rig_state *rs = STATE(rig);
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
|
@ -190,7 +190,7 @@ int v4l_open(RIG *rig)
|
|||
|
||||
int v4l_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
const struct rig_state *rs = &rig->state;
|
||||
const struct rig_state *rs = STATE(rig);
|
||||
hamlib_port_t *rp = RIGPORT(rig);
|
||||
struct video_tuner vt;
|
||||
const freq_range_t *range;
|
||||
|
@ -237,7 +237,7 @@ int v4l_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
int v4l_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
const struct rig_state *rs = &rig->state;
|
||||
const struct rig_state *rs = STATE(rig);
|
||||
const freq_range_t *range;
|
||||
unsigned long f;
|
||||
double fact;
|
||||
|
|
|
@ -161,7 +161,7 @@ int v4l2_open(RIG *rig)
|
|||
{
|
||||
int i;
|
||||
struct v4l2_tuner vt;
|
||||
struct rig_state *rs = &rig->state;
|
||||
struct rig_state *rs = STATE(rig);
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
|
@ -190,7 +190,7 @@ int v4l2_open(RIG *rig)
|
|||
|
||||
int v4l2_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
const struct rig_state *rs = &rig->state;
|
||||
const struct rig_state *rs = STATE(rig);
|
||||
hamlib_port_t *rp = RIGPORT(rig);
|
||||
struct v4l2_tuner vt;
|
||||
const freq_range_t *range;
|
||||
|
@ -237,7 +237,7 @@ int v4l2_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
int v4l2_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
const struct rig_state *rs = &rig->state;
|
||||
const struct rig_state *rs = STATE(rig);
|
||||
const freq_range_t *range;
|
||||
unsigned long f;
|
||||
double fact;
|
||||
|
|
|
@ -91,7 +91,7 @@ tone_t uniden_dcs_list[] =
|
|||
|
||||
/**
|
||||
* uniden_transaction
|
||||
* Assumes rig!=NULL rig->state!=NULL rig->caps!=NULL
|
||||
* Assumes rig!=NULL STATE(rig)!=NULL rig->caps!=NULL
|
||||
*
|
||||
* cmdstr - Command to be sent to the rig. Cmdstr can also be NULL, indicating
|
||||
* that only a reply is needed (nothing will be send).
|
||||
|
@ -122,7 +122,7 @@ uniden_transaction(RIG *rig, const char *cmdstr, int cmd_len,
|
|||
char replybuf[BUFSZ];
|
||||
size_t reply_len = BUFSZ;
|
||||
|
||||
rs = &rig->state;
|
||||
rs = STATE(rig);
|
||||
rs->transaction_active = 1;
|
||||
|
||||
transaction_write:
|
||||
|
@ -429,7 +429,7 @@ int uniden_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
switch (level)
|
||||
{
|
||||
case RIG_LEVEL_ATT:
|
||||
if (rig->state.attenuator[0] == 0)
|
||||
if (STATE(rig)->attenuator[0] == 0)
|
||||
{
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
@ -500,7 +500,7 @@ int uniden_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
return -RIG_ERJCTED;
|
||||
}
|
||||
|
||||
val->i = lvlbuf[2] == 'N' ? rig->state.attenuator[0] : 0;
|
||||
val->i = lvlbuf[2] == 'N' ? STATE(rig)->attenuator[0] : 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -630,7 +630,7 @@ int uniden_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
|
|||
/* TODO: Trunk, Delay, Recording */
|
||||
|
||||
chan->flags = (membuf[22] == 'N') ? RIG_CHFLAG_SKIP : 0;
|
||||
chan->levels[LVL_ATT].i = (membuf[25] == 'N') ? rig->state.attenuator[0] : 0;
|
||||
chan->levels[LVL_ATT].i = (membuf[25] == 'N') ? STATE(rig)->attenuator[0] : 0;
|
||||
sscanf(membuf + 41, "%d", &tone);
|
||||
|
||||
if (tone >= 1 && tone <= 38)
|
||||
|
|
|
@ -72,7 +72,7 @@ uniden_id_string_list[] =
|
|||
/**
|
||||
* uniden_transaction
|
||||
* uniden_digital_transaction
|
||||
* Assumes rig!=NULL rig->state!=NULL rig->caps!=NULL
|
||||
* Assumes rig!=NULL STATE(rig)!=NULL rig->caps!=NULL
|
||||
*
|
||||
* cmdstr - Command to be sent to the rig. Cmdstr can also be NULL, indicating
|
||||
* that only a reply is needed (nothing will be send).
|
||||
|
@ -103,7 +103,7 @@ uniden_digital_transaction(RIG *rig, const char *cmdstr, int cmd_len,
|
|||
char replybuf[BUFSZ];
|
||||
size_t reply_len = BUFSZ;
|
||||
|
||||
rs = &rig->state;
|
||||
rs = STATE(rig);
|
||||
rs->transaction_active = 1;
|
||||
|
||||
transaction_write:
|
||||
|
|
|
@ -191,15 +191,15 @@ int g3_init(RIG *rig)
|
|||
{
|
||||
struct g3_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct g3_priv_data *)calloc(1, sizeof(struct g3_priv_data));
|
||||
STATE(rig)->priv = (struct g3_priv_data *)calloc(1, sizeof(struct g3_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
if (!STATE(rig)->priv)
|
||||
{
|
||||
/* whoops! memory shortage! */
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
priv = STATE(rig)->priv;
|
||||
|
||||
/* Try to load required dll */
|
||||
priv->dll = LoadLibrary(WRG3DLL);
|
||||
|
@ -240,7 +240,7 @@ int g3_init(RIG *rig)
|
|||
|
||||
int g3_open(RIG *rig)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
int device_num;
|
||||
|
||||
device_num = atoi(RIGPORT(rig)->pathname);
|
||||
|
@ -261,7 +261,7 @@ int g3_open(RIG *rig)
|
|||
|
||||
int g3_close(RIG *rig)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
|
||||
priv->CloseRadioDevice(priv->hRadio);
|
||||
|
||||
|
@ -270,24 +270,24 @@ int g3_close(RIG *rig)
|
|||
|
||||
int g3_cleanup(RIG *rig)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
|
||||
/* Clean up the dll access */
|
||||
if (priv) { FreeLibrary(priv->dll); }
|
||||
|
||||
if (rig->state.priv)
|
||||
if (STATE(rig)->priv)
|
||||
{
|
||||
free(rig->state.priv);
|
||||
free(STATE(rig)->priv);
|
||||
}
|
||||
|
||||
rig->state.priv = NULL;
|
||||
STATE(rig)->priv = NULL;
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
int g3_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
int ret;
|
||||
|
||||
ret = priv->G3SetFrequency(priv->hRadio, (DWORD)(freq));
|
||||
|
@ -298,7 +298,7 @@ int g3_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
int g3_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
|
||||
*freq = (freq_t) priv->G3GetFrequency(priv->hRadio);
|
||||
|
||||
|
@ -307,7 +307,7 @@ int g3_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
|
||||
int g3_set_powerstat(RIG *rig, powerstat_t status)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
int ret;
|
||||
|
||||
ret = priv->SetPower(priv->hRadio, status == RIG_POWER_ON ? TRUE : FALSE);
|
||||
|
@ -318,7 +318,7 @@ int g3_set_powerstat(RIG *rig, powerstat_t status)
|
|||
|
||||
int g3_get_powerstat(RIG *rig, powerstat_t *status)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
int ret;
|
||||
|
||||
ret = priv->GetPower(priv->hRadio);
|
||||
|
@ -329,7 +329,7 @@ int g3_get_powerstat(RIG *rig, powerstat_t *status)
|
|||
|
||||
int g3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
int ret, agc;
|
||||
|
||||
switch (level)
|
||||
|
@ -370,7 +370,7 @@ int g3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
|
||||
int g3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
int ret;
|
||||
|
||||
ret = RIG_OK;
|
||||
|
@ -418,7 +418,7 @@ int g3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
|
||||
static const char *g3_get_info(RIG *rig)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
static RADIO_INFO info;
|
||||
|
||||
info.bLength = sizeof(RADIO_INFO);
|
||||
|
|
|
@ -192,15 +192,15 @@ int g3_init(RIG *rig)
|
|||
{
|
||||
struct g3_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct g3_priv_data *)calloc(1, sizeof(struct g3_priv_data));
|
||||
STATE(rig)->priv = (struct g3_priv_data *)calloc(1, sizeof(struct g3_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
if (!STATE(rig)->priv)
|
||||
{
|
||||
/* whoops! memory shortage! */
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
priv = STATE(rig)->priv;
|
||||
|
||||
/* Try to load required dll */
|
||||
priv->dll = LoadLibrary(WRG3DLL);
|
||||
|
@ -241,7 +241,7 @@ int g3_init(RIG *rig)
|
|||
|
||||
int g3_open(RIG *rig)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
int device_num;
|
||||
|
||||
device_num = atoi(RIGPORT(rig)->pathname);
|
||||
|
@ -262,7 +262,7 @@ int g3_open(RIG *rig)
|
|||
|
||||
int g3_close(RIG *rig)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
|
||||
priv->CloseRadioDevice(priv->hRadio);
|
||||
|
||||
|
@ -271,23 +271,23 @@ int g3_close(RIG *rig)
|
|||
|
||||
int g3_cleanup(RIG *rig)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
|
||||
if (priv)
|
||||
{
|
||||
/* Clean up the dll access */
|
||||
FreeLibrary(priv->dll);
|
||||
free(rig->state.priv);
|
||||
free(STATE(rig)->priv);
|
||||
}
|
||||
|
||||
rig->state.priv = NULL;
|
||||
STATE(rig)->priv = NULL;
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
int g3_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
int ret;
|
||||
|
||||
ret = priv->G3SetFrequency(priv->hRadio, (DWORD)(freq));
|
||||
|
@ -298,7 +298,7 @@ int g3_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
int g3_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
|
||||
*freq = (freq_t) priv->G3GetFrequency(priv->hRadio);
|
||||
|
||||
|
@ -307,7 +307,7 @@ int g3_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
|
||||
int g3_set_powerstat(RIG *rig, powerstat_t status)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
int ret;
|
||||
|
||||
ret = priv->SetPower(priv->hRadio, status == RIG_POWER_ON ? TRUE : FALSE);
|
||||
|
@ -318,7 +318,7 @@ int g3_set_powerstat(RIG *rig, powerstat_t status)
|
|||
|
||||
int g3_get_powerstat(RIG *rig, powerstat_t *status)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
int ret;
|
||||
|
||||
ret = priv->GetPower(priv->hRadio);
|
||||
|
@ -329,7 +329,7 @@ int g3_get_powerstat(RIG *rig, powerstat_t *status)
|
|||
|
||||
int g3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
int ret, agc;
|
||||
|
||||
switch (level)
|
||||
|
@ -370,7 +370,7 @@ int g3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
|
||||
int g3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
int ret;
|
||||
|
||||
ret = RIG_OK;
|
||||
|
@ -418,7 +418,7 @@ int g3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
|
||||
static const char *g3_get_info(RIG *rig)
|
||||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)STATE(rig)->priv;
|
||||
static RADIO_INFO info;
|
||||
|
||||
info.bLength = sizeof(RADIO_INFO);
|
||||
|
|
|
@ -131,7 +131,7 @@ int g313_init(RIG *rig)
|
|||
|
||||
/* otherwise try again when open rig */
|
||||
|
||||
rig->state.priv = (void *)priv;
|
||||
STATE(rig)->priv = (void *)priv;
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ int g313_init(RIG *rig)
|
|||
int g313_open(RIG *rig)
|
||||
{
|
||||
int ret;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
RADIO_DESC *List;
|
||||
int Count;
|
||||
|
||||
|
@ -247,7 +247,7 @@ int g313_open(RIG *rig)
|
|||
|
||||
int g313_close(RIG *rig)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
|
||||
if (!priv->Opened)
|
||||
{
|
||||
|
@ -279,7 +279,7 @@ int g313_cleanup(RIG *rig)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
priv = (struct g313_priv_data *)rig->state.priv;
|
||||
priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: close fifos\n", __func__);
|
||||
|
||||
|
@ -305,15 +305,15 @@ int g313_cleanup(RIG *rig)
|
|||
dlclose(priv->hWRAPI);
|
||||
}
|
||||
|
||||
free(rig->state.priv);
|
||||
free(STATE(rig)->priv);
|
||||
|
||||
rig->state.priv = NULL;
|
||||
STATE(rig)->priv = NULL;
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
int g313_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
int ret;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: %u\n", __func__, (unsigned int)freq);
|
||||
|
@ -325,7 +325,7 @@ int g313_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
int g313_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
|
||||
unsigned int f;
|
||||
int ret = GetFrequency(priv->hRadio, &f);
|
||||
|
@ -342,7 +342,7 @@ int g313_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
|
||||
int g313_set_powerstat(RIG *rig, powerstat_t status)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
|
||||
int p = status == RIG_POWER_ON ? 1 : 0;
|
||||
int ret = SetPower(priv->hRadio, p);
|
||||
|
@ -353,7 +353,7 @@ int g313_set_powerstat(RIG *rig, powerstat_t status)
|
|||
|
||||
int g313_get_powerstat(RIG *rig, powerstat_t *status)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
|
||||
int p;
|
||||
int ret = GetPower(priv->hRadio, &p);
|
||||
|
@ -371,7 +371,7 @@ int g313_get_powerstat(RIG *rig, powerstat_t *status)
|
|||
|
||||
int g313_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
int ret, agc;
|
||||
|
||||
switch (level)
|
||||
|
@ -423,7 +423,7 @@ int g313_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
|
||||
int g313_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
int ret;
|
||||
int value;
|
||||
unsigned int uvalue;
|
||||
|
@ -524,7 +524,7 @@ int g313_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
|
||||
static const char *g313_get_info(RIG *rig)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
static RADIO_INFO info;
|
||||
int ret;
|
||||
|
||||
|
@ -544,7 +544,7 @@ static const char *g313_get_info(RIG *rig)
|
|||
|
||||
int g313_set_conf(RIG *rig, hamlib_token_t token, const char *val)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
|
||||
size_t len = strlen(val);
|
||||
|
||||
|
@ -595,7 +595,7 @@ int g313_set_conf(RIG *rig, hamlib_token_t token, const char *val)
|
|||
|
||||
int g313_get_conf(RIG *rig, hamlib_token_t token, char *val)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
|
||||
switch (token)
|
||||
{
|
||||
|
|
|
@ -232,16 +232,16 @@ int g313_init(RIG *rig)
|
|||
{
|
||||
struct g313_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct g313_priv_data *)calloc(1, sizeof(
|
||||
STATE(rig)->priv = (struct g313_priv_data *)calloc(1, sizeof(
|
||||
struct g313_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
if (!STATE(rig)->priv)
|
||||
{
|
||||
/* whoops! memory shortage! */
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
priv = STATE(rig)->priv;
|
||||
|
||||
priv->WaveOutDeviceID = -1;
|
||||
|
||||
|
@ -374,7 +374,7 @@ int g313_findVSC(struct g313_priv_data *priv)
|
|||
|
||||
int g313_open(RIG *rig)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
int device_num;
|
||||
int Count;
|
||||
int id;
|
||||
|
@ -432,7 +432,7 @@ int g313_open(RIG *rig)
|
|||
|
||||
int g313_close(RIG *rig)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
|
||||
|
||||
if (!priv->Opened)
|
||||
|
@ -461,23 +461,23 @@ int g313_cleanup(RIG *rig)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
priv = (struct g313_priv_data *)rig->state.priv;
|
||||
priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
|
||||
/* Clean up the dll access */
|
||||
FreeLibrary(priv->dll);
|
||||
FreeLibrary(priv->WinMM);
|
||||
FreeLibrary(priv->hWRG313WO);
|
||||
|
||||
free(rig->state.priv);
|
||||
free(STATE(rig)->priv);
|
||||
|
||||
rig->state.priv = NULL;
|
||||
STATE(rig)->priv = NULL;
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
int g313_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
int ret;
|
||||
|
||||
ret = priv->G3SetFrequency(priv->hRadio, (DWORD)(freq));
|
||||
|
@ -488,7 +488,7 @@ int g313_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
int g313_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
|
||||
*freq = (freq_t) priv->G3GetFrequency(priv->hRadio);
|
||||
|
||||
|
@ -497,7 +497,7 @@ int g313_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
|
||||
int g313_set_powerstat(RIG *rig, powerstat_t status)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
int ret;
|
||||
|
||||
ret = priv->SetPower(priv->hRadio, status == RIG_POWER_ON ? TRUE : FALSE);
|
||||
|
@ -508,7 +508,7 @@ int g313_set_powerstat(RIG *rig, powerstat_t status)
|
|||
|
||||
int g313_get_powerstat(RIG *rig, powerstat_t *status)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
int ret;
|
||||
|
||||
ret = priv->GetPower(priv->hRadio);
|
||||
|
@ -519,7 +519,7 @@ int g313_get_powerstat(RIG *rig, powerstat_t *status)
|
|||
|
||||
int g313_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
int ret, agc;
|
||||
|
||||
switch (level)
|
||||
|
@ -568,7 +568,7 @@ int g313_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
|
||||
int g313_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
int ret;
|
||||
|
||||
ret = RIG_OK;
|
||||
|
@ -626,7 +626,7 @@ int g313_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
|
||||
static const char *g313_get_info(RIG *rig)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
static RADIO_INFO info;
|
||||
|
||||
info.bLength = sizeof(RADIO_INFO);
|
||||
|
@ -642,7 +642,7 @@ static const char *g313_get_info(RIG *rig)
|
|||
|
||||
int g313_set_conf(RIG *rig, hamlib_token_t token, const char *val)
|
||||
{
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
int id;
|
||||
|
||||
switch (token)
|
||||
|
@ -697,7 +697,7 @@ int g313_set_conf(RIG *rig, hamlib_token_t token, const char *val)
|
|||
|
||||
int g313_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
|
||||
{
|
||||
const struct g313_priv_data *priv = (struct g313_priv_data *)rig->state.priv;
|
||||
const struct g313_priv_data *priv = (struct g313_priv_data *)STATE(rig)->priv;
|
||||
|
||||
switch (token)
|
||||
{
|
||||
|
|
|
@ -284,7 +284,7 @@ int wr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
|
||||
if (ioctl(rp->fd, RADIO_GET_VOL, &v)) { return -RIG_EINVAL; }
|
||||
|
||||
val->i = v ? rig->state.attenuator[0] : 0;
|
||||
val->i = v ? STATE(rig)->attenuator[0] : 0;
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ If you don't know the number, listrigs can give it to you,
|
|||
|
||||
In any case, you are encouraged to check for correct initialization
|
||||
by reading the source code, at the beginning of the main(). Check also
|
||||
that the program is setup for your rig path strncpy(HAMLIB_STATE(my_rig)->rig_path...
|
||||
that the program is setup for your rig path strncpy(HAMLIB_RIGPORT(my_rig)->pathname...
|
||||
|
||||
dumpcaps - Output the caps contents of a rig
|
||||
dumpmem - Dump the memory contents of the rig
|
||||
|
|
Ładowanie…
Reference in New Issue