diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index a59e5e452..04013282c 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -5,7 +5,7 @@ * will be used for obtaining rig capabilities. * * - * $Id: rig.h,v 1.30 2001-05-04 22:34:33 f4cfe Exp $ + * $Id: rig.h,v 1.31 2001-05-24 22:24:18 f4cfe Exp $ * * * This program is free software; you can redistribute it and/or @@ -31,6 +31,10 @@ #include /* required for FILE definition */ #include /* required for struct timeval */ +#ifdef __cplusplus +extern "C" { +#endif + extern const char hamlib_version[]; extern const int full_ctcss_list[]; @@ -570,10 +574,10 @@ struct channel { shortfreq_t xit; setting_t funcs; value_t levels[RIG_SETTING_MAX]; - int ctcss; - int ctcss_sql; - int dcs; - int dcs_sql; + unsigned int ctcss; + unsigned int ctcss_sql; + unsigned int dcs; + unsigned int dcs_sql; char channel_desc[MAXCHANDESC]; }; @@ -1026,7 +1030,7 @@ extern int rig_set_trn(RIG *rig, vfo_t vfo, int trn); /* activate the transceive extern int rig_get_trn(RIG *rig, vfo_t vfo, int *trn); -extern unsigned char *rig_get_info(RIG *rig); +extern const char *rig_get_info(RIG *rig); extern const struct rig_caps *rig_get_caps(rig_model_t rig_model); const freq_range_t *rig_get_range(const freq_range_t range_list[], freq_t freq, rmode_t mode); @@ -1038,6 +1042,7 @@ extern pbwidth_t rig_passband_wide(RIG *rig, rmode_t mode); extern const char *rigerror(int errnum); extern int rig_setting2idx(setting_t s); +#define rig_idx2setting(i) (1<<(i)) /* * Even if these functions are prefixed with "rig_", they are not rig specific @@ -1052,5 +1057,9 @@ int rig_unregister(rig_model_t rig_model); int rig_list_foreach(int (*cfunc)(const struct rig_caps*,void*),void *data); int rig_load_backend(const char *be_name); +#ifdef __cplusplus +} +#endif + #endif /* _RIG_H */ diff --git a/src/rig.c b/src/rig.c index b026fdbb5..7caa57ae1 100644 --- a/src/rig.c +++ b/src/rig.c @@ -2,7 +2,7 @@ Copyright (C) 2000,2001 Stephane Fillod and Frank Singleton This file is part of the hamlib package. - $Id: rig.c,v 1.27 2001-05-04 22:44:10 f4cfe Exp $ + $Id: rig.c,v 1.28 2001-05-24 22:24:18 f4cfe Exp $ Hamlib is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -3345,7 +3345,7 @@ int rig_save_channel(RIG *rig, channel_t *chan) rig_get_rptr_offs(rig, RIG_VFO_CURR, &chan->rptr_offs); for (i=0; ilevels[i]); + rig_get_level(rig, RIG_VFO_CURR, rig_idx2setting(i), &chan->levels[i]); rig_get_ant(rig, RIG_VFO_CURR, &chan->ant); rig_get_ts(rig, RIG_VFO_CURR, &chan->tuning_step); @@ -3355,8 +3355,8 @@ int rig_save_channel(RIG *rig, channel_t *chan) chan->funcs = 0; for (i=0; ifuncs |= fstatus? 1<funcs |= fstatus? rig_idx2setting(i) : 0; } rig_get_ctcss(rig, RIG_VFO_CURR, &chan->ctcss); @@ -3416,9 +3416,8 @@ int rig_restore_channel(RIG *rig, const channel_t *chan) rig_set_level(rig, RIG_VFO_CURR, RIG_LEVEL_ATT, chan->att); rig_set_level(rig, RIG_VFO_CURR, RIG_LEVEL_PREAMP, chan->preamp); #else -// define rig_idx2setting(s) (1<<(s)) for (i=0; ilevels[i]); + rig_set_level(rig, RIG_VFO_CURR, rig_idx2setting(i), chan->levels[i]); #endif rig_set_ant(rig, RIG_VFO_CURR, chan->ant); @@ -3427,7 +3426,8 @@ int rig_restore_channel(RIG *rig, const channel_t *chan) rig_set_xit(rig, RIG_VFO_CURR, chan->xit); for (i=0; ifuncs & (1<funcs & rig_idx2setting(i)); rig_set_ctcss(rig, RIG_VFO_CURR, chan->ctcss); rig_set_ctcss_sql(rig, RIG_VFO_CURR, chan->ctcss_sql); @@ -3653,7 +3653,7 @@ int rig_get_trn(RIG *rig, vfo_t vfo, int *trn) * if the operation has been sucessful, or NULL * if an error occured. */ -unsigned char* rig_get_info(RIG *rig) +const char* rig_get_info(RIG *rig) { if (!rig || !rig->caps) return NULL; @@ -3680,7 +3680,7 @@ int rig_setting2idx(setting_t s) int i; for (i = 0; i