Commit d5c85485 authored by ankraft's avatar ankraft

- Removed DeviceInfo, added Characteristic to Device, SubDevice, ModuleClass

- Changed tests accordingly
parent 0b2682d8
......@@ -8,7 +8,8 @@ Domain =
# This almost generates the correct schema ... but it
# doesn't have the correct schemaLocation
#
# <attribute ns="http://www.w3.org/XML/1998/namespace" name="base"> <data type="anyURI"/>
# <attribute ns="http://www.w3.org/XML/1998/namespace" name="base">
# <data type="anyURI"/>
# </attribute>
attribute xml:base { xsd:anyURI }?,
attribute id { xsd:ID },
......@@ -21,13 +22,13 @@ Domain =
element Device {
attribute id { xsd:Name },
DocDef,
DeviceInfos?,
Characteristics?,
Modules?,
element SubDevices {
element SubDevice {
attribute id { xsd:Name },
DocDef,
DeviceInfos?,
Characteristics?,
Modules?
}*
}?
......@@ -43,6 +44,16 @@ DeviceInfos =
DataTypeDef
}*
}
Characteristics =
element Characteristics {
element Characteristic {
attribute name { text },
attribute optional { xsd:boolean }?,
attribute value { text }?,
DocDef,
SimpleType
}+
}
DataTypeDef =
# Discuss: Doc on DataType?
attribute unitOfMeasure { text }?,
......@@ -61,7 +72,7 @@ SimpleType =
element SimpleType {
attribute name { text }?,
attribute type { BasicType }
# TODO Constraints
# TODO Constraints Perhaps directly in DataTypeDef
}
BasicType =
......@@ -100,6 +111,7 @@ ModuleDef =
attribute class { text }
}?,
DocDef,
Characteristics?,
Actions?,
Data?,
Events?
......
......@@ -17,7 +17,8 @@
This almost generates the correct schema ... but it
doesn't have the correct schemaLocation
<attribute ns="http://www.w3.org/XML/1998/namespace" name="base"> <data type="anyURI"/>
<attribute ns="http://www.w3.org/XML/1998/namespace" name="base">
<data type="anyURI"/>
</attribute>
-->
......@@ -54,7 +55,7 @@
</attribute>
<ref name="DocDef"/>
<optional>
<ref name="DeviceInfos"/>
<ref name="Characteristics"/>
</optional>
<optional>
<ref name="Modules"/>
......@@ -68,7 +69,7 @@
</attribute>
<ref name="DocDef"/>
<optional>
<ref name="DeviceInfos"/>
<ref name="Characteristics"/>
</optional>
<optional>
<ref name="Modules"/>
......@@ -105,6 +106,32 @@
</define>
<define name="Characteristics">
<element name="Characteristics">
<oneOrMore>
<element name="Characteristic">
<attribute name="name">
<text/>
</attribute>
<optional>
<attribute name="optional">
<data type="boolean"/>
</attribute>
</optional>
<optional>
<attribute name="value">
<text/>
</attribute>
</optional>
<ref name="DocDef"/>
<ref name="SimpleType" />
</element>
</oneOrMore>
</element>
</define>
<define name="DataTypeDef">
<!-- Discuss: Doc on DataType? -->
<optional>
......@@ -156,7 +183,7 @@
<attribute name="type">
<ref name="BasicType" />
</attribute>
<!-- TODO Constraints -->
<!-- TODO Constraints Perhaps directly in DataTypeDef-->
</element>
</define>
......@@ -240,6 +267,9 @@
</element>
</optional>
<ref name="DocDef"/>
<optional>
<ref name="Characteristics"/>
</optional>
<optional>
<ref name="Actions"/>
</optional>
......
......@@ -42,7 +42,7 @@
<xs:complexType>
<xs:sequence>
<xs:group ref="DocDef"/>
<xs:element minOccurs="0" ref="DeviceInfos"/>
<xs:element minOccurs="0" ref="Characteristics"/>
<xs:element minOccurs="0" ref="Modules"/>
<xs:element minOccurs="0" ref="SubDevices"/>
</xs:sequence>
......@@ -60,7 +60,7 @@
<xs:complexType>
<xs:sequence>
<xs:group ref="DocDef"/>
<xs:element minOccurs="0" ref="DeviceInfos"/>
<xs:element minOccurs="0" ref="Characteristics"/>
<xs:element minOccurs="0" ref="Modules"/>
</xs:sequence>
<xs:attribute name="id" use="required" type="xs:Name"/>
......@@ -84,6 +84,24 @@
<xs:attributeGroup ref="DataTypeDef"/>
</xs:complexType>
</xs:element>
<xs:element name="Characteristics">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="Characteristic"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Characteristic">
<xs:complexType>
<xs:sequence>
<xs:group ref="DocDef"/>
<xs:element ref="SimpleType"/>
</xs:sequence>
<xs:attribute name="name" use="required"/>
<xs:attribute name="optional" type="xs:boolean"/>
<xs:attribute name="value"/>
</xs:complexType>
</xs:element>
<xs:element name="DataTypeDef" abstract="true"/>
<xs:attributeGroup name="DataTypeDef">
<xs:attribute name="unitOfMeasure"/>
......@@ -175,6 +193,7 @@
<xs:sequence>
<xs:element minOccurs="0" ref="extends"/>
<xs:group ref="DocDef"/>
<xs:element minOccurs="0" ref="Characteristics"/>
<xs:element minOccurs="0" ref="Actions"/>
<xs:element minOccurs="0" ref="Data"/>
<xs:element minOccurs="0" ref="Events"/>
......
......@@ -22,18 +22,18 @@
<tt>on</tt> and <tt>off</tt>. This is clearly a candidate for the
module class <tt>BooleanState</tt>.
</Doc>
<DeviceInfos>
<DeviceInfo name="Name">
<Characteristics>
<Characteristic name="Name">
<Doc>Original value: PowerSwitch</Doc>
<SimpleType type="string" />
</DeviceInfo>
</Characteristic>
<!-- The Vendor field should probably be part of the domain -->
<DeviceInfo name="Vendor">
<Characteristic name="Vendor">
<Doc>Original value: Telekom Innovation Laboratories</Doc>
<SimpleType type="string" />
</DeviceInfo>
</DeviceInfos>
</Characteristic>
</Characteristics>
<Modules>
<Module name="proprietaryPower">
......
......@@ -100,7 +100,7 @@
<Events>
<Event name="stateChanged" optional="true">
<Data>
<DataPoint name="state" optional="true">
<DataPoint name="state" readable="true">
<SimpleType type="boolean" />
</DataPoint>
</Data>
......@@ -119,28 +119,28 @@
<Doc>
This device is intended as a demonstration of how to define a Root Device with multiple sub-devices.
</Doc>
<DeviceInfos>
<DeviceInfo name="Name">
<Characteristics>
<Characteristic name="Name">
<Doc>Original value: Multi Socket Electrical-Extension-Block</Doc>
<SimpleType type="string" />
</DeviceInfo>
<DeviceInfo name="Vendor">
</Characteristic>
<Characteristic name="Vendor">
<Doc>Original value: HGI</Doc>
<SimpleType type="string" />
</DeviceInfo>
<DeviceInfo name="FirmwareVersion">
</Characteristic>
<Characteristic name="FirmwareVersion">
<Doc>Original value: 1.0</Doc>
<SimpleType type="string" />
</DeviceInfo>
<DeviceInfo name="VendorURL">
</Characteristic>
<Characteristic name="VendorURL">
<Doc>Original value: http://www.homegatewayinitative.org</Doc>
<SimpleType type="uri" />
</DeviceInfo>
<DeviceInfo name="SerialNumber">
</Characteristic>
<Characteristic name="SerialNumber">
<Doc>Original value: 1234.5</Doc>
<SimpleType type="string" />
</DeviceInfo>
</DeviceInfos>
</Characteristic>
</Characteristics>
<!-- These are the modules for the device:
- Switch on/off all contained switches. It inherits from hgi.dal.core.BooleanState.
......@@ -154,6 +154,12 @@
The proprietry interface for turning all switches of the extension block on and off.
The action "BooleanState:get" returns "true" when any of the sub-devices is in the state "on", otherwise it returns "false".
</Doc>
<Characteristics>
<Characteristic name="version" value="1.0.0">
<Doc>Version for this ModuleClass</Doc>
<SimpleType type="string" />
</Characteristic>
</Characteristics>
</Module>
<Module name="power">
<Actions>
......@@ -172,9 +178,17 @@
</Module>
<Module name="extensionBlockDataPoints">
<Actions>
<Action name="getNames">
<Array name="names">
<SimpleType type="string" />
</Array>
</Action>
</Actions>
<Data>
<DataPoint name="firmwareVersion"
writable="false">
writable="false"
readable="true">
<Doc>
This datapoint represents the firmware version of the extension block.
</Doc>
......@@ -182,7 +196,8 @@
</DataPoint>
<DataPoint name="powerSwitchNames"
writable="false">
writable="false"
readable="true">
<Doc>
This datapoint is an array of strings with the names of the contained devices.
</Doc>
......@@ -205,16 +220,16 @@
<Doc>
This sub device is intended as a demonstration of how to use the abstract modules defined in the <em>HGI Core</em> domain.
</Doc>
<DeviceInfos>
<DeviceInfo name="Name">
<Characteristics>
<Characteristic name="Name">
<Doc>Original value: PowerSwitch 1</Doc>
<SimpleType type="string" />
</DeviceInfo>
<DeviceInfo name="Vendor">
</Characteristic>
<Characteristic name="Vendor">
<Doc>Original value: HGI</Doc>
<SimpleType type="string" />
</DeviceInfo>
</DeviceInfos>
</Characteristic>
</Characteristics>
<Modules>
<Module name="power">
<extends domain="hgi.dal.core" class="BooleanState"/>
......@@ -228,16 +243,23 @@
<Doc>
This sub device is intended as a demonstration of how to use the abstract modules defined in the <em>HGI Core</em> domain.
</Doc>
<DeviceInfos>
<DeviceInfo name="Name">
<Characteristics>
<Characteristic name="Name">
<Doc>Original value: PowerSwitch 2</Doc>
<SimpleType type="string" />
</DeviceInfo>
<DeviceInfo name="Vendor">
</Characteristic>
<Characteristic name="Vendor">
<Doc>Original value: HGI</Doc>
<SimpleType type="string" />
</DeviceInfo>
</DeviceInfos>
</Characteristic>
<Characteristic name="VendorURL" value="http://homegatwaysinitiative.org">
<Doc>Original value: http://homegatwaysinitiative.org</Doc>
<SimpleType type="uri" />
</Characteristic>
<Characteristic name="maximumAltitude" value="2800">
<SimpleType type="integer" />
</Characteristic>
</Characteristics>
<Modules>
<Module name="power">
<extends domain="hgi.dal.core" class="BooleanState"/>
......
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