Implement Amp.get_powerstat

Daniele Forsi IU5HKX 2025-05-24 19:12:31 +02:00
rodzic 81d7745411
commit 6e8b5d602f
2 zmienionych plików z 4 dodań i 6 usunięć

Wyświetl plik

@ -133,6 +133,8 @@ typedef struct Amp {
return s; return s;
} }
AMPMETHOD1GET(get_powerstat, powerstat_t)
}; };
%{ %{
@ -140,8 +142,4 @@ typedef struct Amp {
{ {
self->error_status = amp_get_freq(self->amp, freq); self->error_status = amp_get_freq(self->amp, freq);
} }
void Amp_get_powerstat(Amp *self, powerstat_t *status)
{
self->error_status = amp_get_powerstat(self->amp, status);
}
%} %}

Wyświetl plik

@ -47,8 +47,8 @@ class TestClass:
assert amp.reset(Hamlib.AMP_RESET_FAULT) is None assert amp.reset(Hamlib.AMP_RESET_FAULT) is None
assert amp.set_freq(0) 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.get_freq() is None # FIXME: AttributeError: 'Amp' object has no attribute 'get_freq'
assert amp.set_powerstat(Hamlib.RIG_POWER_OFF) is None assert amp.set_powerstat(Hamlib.RIG_POWER_ON) is None
# assert amp.get_powerstat() is None # FIXME: AttributeError: 'Amp' object has no attribute 'get_powerstat' assert amp.get_powerstat() == Hamlib.RIG_POWER_ON
assert amp.close() is None assert amp.close() is None
assert amp.state.comm_state == 0 assert amp.state.comm_state == 0
info = amp.get_info() info = amp.get_info()