Implement Amp.get_freq

Daniele Forsi IU5HKX 2025-05-24 19:15:53 +02:00
rodzic 6e8b5d602f
commit 90fbddb9d7
2 zmienionych plików z 4 dodań i 8 usunięć

Wyświetl plik

@ -126,6 +126,8 @@ typedef struct Amp {
return s;
}
AMPMETHOD1GET(get_freq, freq_t)
const char * get_info(void) {
const char *s;
s = amp_get_info(self->amp);
@ -136,10 +138,3 @@ typedef struct Amp {
AMPMETHOD1GET(get_powerstat, powerstat_t)
};
%{
void Amp_get_freq(Amp *self, freq_t *freq)
{
self->error_status = amp_get_freq(self->amp, freq);
}
%}

Wyświetl plik

@ -46,7 +46,8 @@ class TestClass:
assert isinstance(info, str)
assert amp.reset(Hamlib.AMP_RESET_FAULT) is None
assert amp.set_freq(0) is None
# assert amp.get_freq() is None # FIXME: AttributeError: 'Amp' object has no attribute 'get_freq'
assert amp.set_freq(123.45) is None
assert amp.get_freq() == 123.45
assert amp.set_powerstat(Hamlib.RIG_POWER_ON) is None
assert amp.get_powerstat() == Hamlib.RIG_POWER_ON
assert amp.close() is None