attenuation-control: Add scripts to control the attenuation

Xmlrpc client/server application to control the digital attenuators
installed in the lava testbed.

Implements AR_VUL-64.

Signed-off-by: Thomas Klaehn <thomas.klaehn@u-blox.com>
This commit is contained in:
Thomas Klaehn
2018-04-17 10:23:19 +02:00
parent 3757cb3efd
commit b1e66c2af1
13 changed files with 638 additions and 0 deletions

22
mock/IOPi/__init__.py Normal file
View File

@@ -0,0 +1,22 @@
class IOPi(object):
address = None
used_pins = [0 for i in range(17)]
pin_directions = [0 for i in range(17)]
pin_values = [0 for i in range(17)]
def __init__(self, address):
self.address = address
def set_pin_direction(self, pin, direction):
self.used_pins[pin] = 1
self.pin_directions[pin] = direction
def write_pin(self, pin, value):
self.used_pins[pin] = 1
self.pin_values[pin] = value
def read_pin(self, pin):
if self.used_pins[pin] == 1:
return self.pin_values[pin]
else:
return None

0
mock/__init__.py Normal file
View File