Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SDT
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
16
Issues
16
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MAS
SDT
Commits
d5c85485
Commit
d5c85485
authored
Oct 06, 2015
by
ankraft
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Removed DeviceInfo, added Characteristic to Device, SubDevice, ModuleClass
- Changed tests accordingly
parent
0b2682d8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
126 additions
and
43 deletions
+126
-43
domain.rnc
SDT/schema3.0/etc/domain.rnc
+16
-4
domain.rng
SDT/schema3.0/src/domain.rng
+34
-4
domain.xsd
SDT/schema3.0/src/domain.xsd
+21
-2
dal-eg.xml
SDT/schema3.0/test/dal-eg.xml
+6
-6
mseeb.xml
SDT/schema3.0/test/mseeb.xml
+49
-27
No files found.
SDT/schema3.0/etc/domain.rnc
View file @
d5c85485
...
...
@@ -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,
DeviceInfo
s?,
Characteristic
s?,
Modules?,
element SubDevices {
element SubDevice {
attribute id { xsd:Name },
DocDef,
DeviceInfo
s?,
Characteristic
s?,
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?
...
...
SDT/schema3.0/src/domain.rng
View file @
d5c85485
...
...
@@ -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="
DeviceInfo
s"/>
<ref name="
Characteristic
s"/>
</optional>
<optional>
<ref name="Modules"/>
...
...
@@ -68,7 +69,7 @@
</attribute>
<ref name="DocDef"/>
<optional>
<ref name="
DeviceInfo
s"/>
<ref name="
Characteristic
s"/>
</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>
...
...
SDT/schema3.0/src/domain.xsd
View file @
d5c85485
...
...
@@ -42,7 +42,7 @@
<xs:complexType>
<xs:sequence>
<xs:group
ref=
"DocDef"
/>
<xs:element
minOccurs=
"0"
ref=
"
DeviceInfo
s"
/>
<xs:element
minOccurs=
"0"
ref=
"
Characteristic
s"
/>
<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=
"
DeviceInfo
s"
/>
<xs:element
minOccurs=
"0"
ref=
"
Characteristic
s"
/>
<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"
/>
...
...
SDT/schema3.0/test/dal-eg.xml
View file @
d5c85485
...
...
@@ -22,18 +22,18 @@
<tt>
on
</tt>
and
<tt>
off
</tt>
. This is clearly a candidate for the
module class
<tt>
BooleanState
</tt>
.
</Doc>
<
DeviceInfo
s>
<
DeviceInfo
name=
"Name"
>
<
Characteristic
s>
<
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
>
</
DeviceInfo
s>
</
Characteristic
>
</
Characteristic
s>
<Modules>
<Module
name=
"proprietaryPower"
>
...
...
SDT/schema3.0/test/mseeb.xml
View file @
d5c85485
...
...
@@ -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>
<
DeviceInfo
s>
<
DeviceInfo
name=
"Name"
>
<
Characteristic
s>
<
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
>
</
DeviceInfo
s>
</
Characteristic
>
</
Characteristic
s>
<!-- 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>
<
DeviceInfo
s>
<
DeviceInfo
name=
"Name"
>
<
Characteristic
s>
<
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
>
</
DeviceInfo
s>
</
Characteristic
>
</
Characteristic
s>
<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>
<
DeviceInfo
s>
<
DeviceInfo
name=
"Name"
>
<
Characteristic
s>
<
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"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment