cli: add an attenuation reset command

parent 077c3895
......@@ -106,6 +106,17 @@ class OauTest(cmd.Cmd):
print('error setting attenuation {} for channel {}'.format(attn, ch))
return
def do_reset(self, args):
"""reset all channel attns to the default (-40dB)."""
if self.fd is None or self.nchannels is None:
print('no active connection')
return
for ch in range(1, self.nchannels+1):
err = self.api.oau_att_set_relay(self.fd, ch, attn_values['-40dB'])
if err < 0:
print('error resetting attenuation in channel {}'.format(ch))
return
def do_EOF(self, arg):
return True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment