Deprecate amp_get_conf(), too

pull/1821/head
George Baltz N3GB 2025-07-28 11:32:34 -04:00
rodzic faad247f06
commit e172d34381
4 zmienionych plików z 22 dodań i 7 usunięć

Wyświetl plik

@ -74,13 +74,21 @@ void Amplifier::setConf(const char *name, const char *val)
CHECK_AMP( amp_set_conf(theAmp, tokenLookup(name), val) );
}
void Amplifier::getConf(hamlib_token_t token, char *val)
HL_DEPRECATED void Amplifier::getConf(hamlib_token_t token, char *val)
{
CHECK_AMP( amp_get_conf(theAmp, token, val) );
CHECK_AMP( amp_get_conf2(theAmp, token, val, 128) );
}
void Amplifier::getConf(const char *name, char *val)
HL_DEPRECATED void Amplifier::getConf(const char *name, char *val)
{
CHECK_AMP( amp_get_conf(theAmp, tokenLookup(name), val) );
CHECK_AMP( amp_get_conf2(theAmp, tokenLookup(name), val, 128) );
}
void Amplifier::getConf2(hamlib_token_t token, char *val, int val_len)
{
CHECK_AMP( amp_get_conf2(theAmp, token, val, val_len) );
}
void Amplifier::getConf2(const char *name, char *val, int val_len)
{
CHECK_AMP( amp_get_conf2(theAmp, tokenLookup(name), val, val_len) );
}
hamlib_token_t Amplifier::tokenLookup(const char *name)

Wyświetl plik

@ -57,6 +57,8 @@ public:
void setConf(const char *name, const char *val);
void getConf(hamlib_token_t token, char *val);
void getConf(const char *name, char *val);
void getConf2(hamlib_token_t token, char *val, int val_len);
void getConf2(const char *name, char *val, int val_len);
hamlib_token_t tokenLookup(const char *name);
void setFreq(freq_t freq);

Wyświetl plik

@ -232,7 +232,7 @@ struct amp_caps
int (*get_freq)(AMP *amp, freq_t *val); /*!< Pointer to backend implementation of amp_get_freq(). */
int (*set_conf)(AMP *amp, hamlib_token_t token, const char *val); /*!< Pointer to backend implementation of amp_set_conf(). */
int (*get_conf2)(AMP *amp, hamlib_token_t token, char *val, int val_len); /*!< Pointer to backend implementation of amp_get_conf(). */
int (*get_conf2)(AMP *amp, hamlib_token_t token, char *val, int val_len); /*!< Pointer to backend implementation of amp_get_conf2(). */
int (*get_conf)(AMP *amp, hamlib_token_t token, char *val); /*!< Pointer to backend implementation of amp_get_conf(). */
/*
@ -310,11 +310,16 @@ extern HAMLIB_EXPORT(int)
amp_set_conf HAMLIB_PARAMS((AMP *amp,
hamlib_token_t token,
const char *val));
extern HAMLIB_EXPORT(int)
HL_DEPRECATED extern HAMLIB_EXPORT(int)
amp_get_conf HAMLIB_PARAMS((AMP *amp,
hamlib_token_t token,
char *val));
extern HAMLIB_EXPORT(int)
amp_get_conf2 HAMLIB_PARAMS((AMP *amp,
hamlib_token_t token,
char *val,
int val_len));
extern HAMLIB_EXPORT(int)
amp_set_powerstat HAMLIB_PARAMS((AMP *amp,
powerstat_t status));
extern HAMLIB_EXPORT(int)

Wyświetl plik

@ -1501,7 +1501,7 @@ int print_conf_list(const struct confparams *cfp, rig_ptr_t data)
int i;
char buf[128] = "";
amp_get_conf(amp, cfp->token, buf);
amp_get_conf2(amp, cfp->token, buf, sizeof(buf));
printf("%s: \"%s\"\n" "\tDefault: %s, Value: %s\n",
cfp->name,
cfp->tooltip,