diff --git a/SDT/schema3.0/etc/domain.rnc b/SDT/schema3.0/etc/domain.rnc index 6078e5fe75708aa628eea649c33c5d4b6b5930a8..0d15caae3f054c90abc3c81fe25a7697386d6769 100644 --- a/SDT/schema3.0/etc/domain.rnc +++ b/SDT/schema3.0/etc/domain.rnc @@ -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? diff --git a/SDT/schema3.0/src/domain.rng b/SDT/schema3.0/src/domain.rng index 739af2ecab35c6b5d24d7c31bc673b26a0b5dd85..72393588822159b95ae31c6cb9fbe747404a3b9c 100644 --- a/SDT/schema3.0/src/domain.rng +++ b/SDT/schema3.0/src/domain.rng @@ -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> diff --git a/SDT/schema3.0/src/domain.xsd b/SDT/schema3.0/src/domain.xsd index cf044638888f11236effc2f5505868cfd28854aa..01e69d3a96d3869b349be8a3f98d18c717a8ceb4 100644 --- a/SDT/schema3.0/src/domain.xsd +++ b/SDT/schema3.0/src/domain.xsd @@ -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"/> diff --git a/SDT/schema3.0/test/dal-eg.xml b/SDT/schema3.0/test/dal-eg.xml index fe3b9a52bb1d3853b4b169b4c3e74da8007573ea..b3404020f27d40131c71981fc12e2e09e1ad4fae 100644 --- a/SDT/schema3.0/test/dal-eg.xml +++ b/SDT/schema3.0/test/dal-eg.xml @@ -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"> diff --git a/SDT/schema3.0/test/mseeb.xml b/SDT/schema3.0/test/mseeb.xml index 8402b934de6a0e79cd62429ca49a5b02d6ddc2c2..180c0fa31b910cb54b04a7743795ce1ca46988f4 100644 --- a/SDT/schema3.0/test/mseeb.xml +++ b/SDT/schema3.0/test/mseeb.xml @@ -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"/>