diff --git a/bindings/amplifier.swg b/bindings/amplifier.swg index 3b8557450..0693fb980 100644 --- a/bindings/amplifier.swg +++ b/bindings/amplifier.swg @@ -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); - } -%} diff --git a/bindings/python/test_amp.py b/bindings/python/test_amp.py index 695aedb14..0e08bc698 100755 --- a/bindings/python/test_amp.py +++ b/bindings/python/test_amp.py @@ -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