Commit 04b0232e authored by Reto Da Forno's avatar Reto Da Forno
Browse files

adjustments made to support new GPIO actuation service

parent ae31f71e
......@@ -487,9 +487,9 @@ def start_test(testid, cur, cn, obsdict_key, obsdict_id):
logger.debug("No <gpioTracingConf> found, not using GPIO tracing service.")
# gpioActuationConf ---
# Create 2 pin settings for every observer used in the test:
# 1) Pull reset pin of target low when test is to start
# 2) Pull reset pin of target high when test is to stop
# Create 2 pin settings for every observer used in the test:
# 1) Pull reset pin of target low when test is to start
# 2) Pull reset pin of target high when test is to stop
xmlblock = "<obsGpioSettingConf>\n"
startdatetime = starttime.strftime(flocklab.config.get("observer", "timeformat"))
startmicrosecs = starttime.microsecond
......@@ -508,17 +508,8 @@ def start_test(testid, cur, cn, obsdict_key, obsdict_id):
for pinconf in pinconfs:
pin = pinconf.xpath('d:pin', namespaces=ns)[0].text.strip()
level = pinconf.xpath('d:level', namespaces=ns)[0].text.strip()
ofs = pinconf.xpath('d:offset', namespaces=ns)
if ofs:
ofs = ofs[0].text.strip()
periodic = pinconf.xpath('d:periodic', namespaces=ns)
if periodic:
interval = int(periodic[0].xpath('d:intervalMicrosecs', namespaces=ns)[0].text.strip())
count = int(periodic[0].xpath('d:count', namespaces=ns)[0].text.strip())
else:
interval = 0
count = 1
xmlblock += "\t<pinConf>\n\t\t<pin>%s</pin>\n\t\t<level>%s</level>\n\t\t<offset>%d</offset>\n\t\t<intervalMicrosecs>%i</intervalMicrosecs>\n\t\t<count>%i</count>\n\t</pinConf>\n" %(pin, level, ofs, interval, count)
ofs = pinconf.xpath('d:offset', namespaces=ns)[0].text.strip()
xmlblock += "\t<pinConf>\n\t\t<pin>%s</pin>\n\t\t<level>%s</level>\n\t\t<offset>%s</offset>\n\t</pinConf>\n" % (pin, level, ofs)
for obsid in obsids:
obsid = int(obsid)
obskey = obsdict_id[obsid][0]
......
......@@ -230,12 +230,7 @@
<xs:sequence>
<xs:element name="pin" type="pinActType"/>
<xs:element name="level" type="pinActLevelType"/>
<xs:element name="periodic" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:group ref="gpioActuationPeriodicGroup"/>
</xs:complexType>
</xs:element>
<xs:element name="offset" type="offsetSecsType"/>
<xs:element name="offset" type="offsetSecsFloatType"/>
</xs:sequence>
</xs:complexType>
......@@ -315,7 +310,7 @@
<!-- Type definition for actuation enabled GPIOs -->
<xs:simpleType name="pinActType">
<xs:restriction base="xs:string">
<xs:pattern value="SIG1|SIG2|RST"/>
<xs:pattern value="SIG1|SIG2"/>
</xs:restriction>
</xs:simpleType>
......@@ -357,6 +352,14 @@
</xs:restriction>
</xs:simpleType>
<!-- Type definition for time offset in seconds -->
<xs:simpleType name="offsetSecsFloatType">
<xs:restriction base="xs:float">
<xs:minInclusive value="0.0"/>
<xs:maxInclusive value="4294.967295"/>
</xs:restriction>
</xs:simpleType>
<!-- Type definition for time offset in microseconds -->
<xs:simpleType name="microsecsType">
<xs:restriction base="xs:integer">
......@@ -396,14 +399,6 @@
</xs:restriction>
</xs:simpleType>
<!-- Type definitions for periodic GPIO actuations -->
<xs:simpleType name="periodicIntervalMicrosecsType">
<xs:restriction base="xs:integer">
<xs:minInclusive value="100"/>
<xs:maxInclusive value="3600000000"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="periodicCountType">
<xs:restriction base="xs:integer">
<xs:minInclusive value="1"/>
......@@ -411,14 +406,6 @@
</xs:restriction>
</xs:simpleType>
<!-- Group definition for GPIO actuation periodic group -->
<xs:group name="gpioActuationPeriodicGroup">
<xs:all>
<xs:element name="intervalMicrosecs" type="periodicIntervalMicrosecsType"/>
<xs:element name="count" type="periodicCountType"/>
</xs:all>
</xs:group>
<!-- Type definition for IP addresses -->
<xs:simpleType name="ipType">
<xs:restriction base="xs:string">
......
Supports Markdown
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