Skip to content

Commit

Permalink
lda: add support for ping
Browse files Browse the repository at this point in the history
fallen authored and sbourdeauducq committed Feb 26, 2015
1 parent d51493f commit b672a99
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions artiq/devices/lda/driver.py
Original file line number Diff line number Diff line change
@@ -63,6 +63,9 @@ def set_attenuation(self, attenuation):
print("setting attenuation to {}".format(att))
self._attenuation = att

def ping(self):
return True


class Lda:
"""Lab Brick Digital Attenuator driver.
@@ -230,3 +233,10 @@ def set_attenuation(self, attenuation):
raise ValueError("Cannot set attenuation {} < 0".format(att))
else:
self.set(0x8d, bytes([int(round(att.amount*4))]))

def ping(self):
try:
self.get_attenuation()
except:
return False
return True

0 comments on commit b672a99

Please sign in to comment.