diff --git a/SDT/schema2.0/docs/SDT_Components.md b/SDT/schema2.0/docs/SDT_Components.md index 2bb770944d16a8e2d67f239af67c2c8e3726a9af..3ca05b4c63e4cce1d58e0986352815dcd0f95c9f 100644 --- a/SDT/schema2.0/docs/SDT_Components.md +++ b/SDT/schema2.0/docs/SDT_Components.md @@ -2,10 +2,18 @@ In this document an overview about the SDT 2.0 ødefinitions and component hierarchy is given. +## Contents + [Domain](#Domain) -[RootDevice](#RootDevice) -[Device](#Device) -[DeviceInfo](#DeviceInfo) +[RootDevice](#RootDevice) | [Device](#Device) + [DeviceInfo](#DeviceInfo) +[ModuleClass](#ModuleClass) + [Action](#Action) + [Data](#Data) + [DataPoint](#DataPoint) + [DataType](#DataType) + [Event](#Event) + ## SDT Overview The followng UML diagram presents an overview about the SDT components. @@ -45,10 +53,10 @@ A *Domain* can define *ModuleClasses* or *RootDevices* only, or may choose to pr <xi:include href="./dal-core.xml" parse="xml" /> </Imports> <Modules> - <!-- List of Domain global Modules go here --> + <!-- List of Domain global Modules goes here --> </Modules> <RootDevices> - <!-- List of RootDevices go here --> + <!-- List of RootDevices goes here --> </RootDevices> </Domain> @@ -84,13 +92,13 @@ If the *RootDevice* does not include sub-devices then the *RootDevice* is the ac <RootDevice id="aRootDevice"> <Doc>Some documentation</Doc> <Modules> - <!-- List of Modules local to the RootDevice go here--> + <!-- List of Modules local to the RootDevice goes here--> </Modules> <DeviceInfo> <!-- The DeviceInfos for the RootDevice goes here--> </DeviceInfo> <Devices> - <!-- List of Sub-Devices of the RootDevice go here--> + <!-- List of Sub-Devices of the RootDevice goes here--> </Devices> </RootDevice> @@ -116,7 +124,7 @@ If the *RootDevice* does not include sub-devices then the *RootDevice* is the ac <Device id="aDevice"> <Doc>Some documentation</Doc> <Modules> - <!-- Modules local to the Device go here--> + <!-- List of Modules local to the Device goes here--> </Modules> <DeviceInfo> <!-- The DeviceInfo for the Device goes here--> @@ -125,17 +133,6 @@ If the *RootDevice* does not include sub-devices then the *RootDevice* is the ac --- -### Module, ModuleClass, ModuleDef - - - - -#### Attributes -#### Sub-Components -#### Example - ---- - <a name="DeviceInfo"/></a> ### DeviceInfo The *DeviceInfo* is an element of *RootDevice* or *Device* where a device vendor can provide metadata for a device that may be presented to an end-user. @@ -164,15 +161,135 @@ None. --- +<a name="ModuleClass"/></a> +### Module, ModuleClass +The *Module* (or *ModuleClass*) represents the concept of a reusable module that defines the *Actions*, *Data* and *Events* for a single functionality of a device. A connected device may contain or refer to single or multiple *ModuleClasses* to specify its inherent services it exposes for use by applications. + +*ModuleClasses* can be defined by a domain (on the level of the *Domain* component) or in *(Root)Devices*: The former are global to a domain and can be used by all *(Root)Devices* of a *Domain*; the later are local to the *Device*. *ModuleClasses* defined on the *Domain* level can be imported and used by other *Domains*. + +New *ModuleClasses* can be defined by extending existing *ModuleClasses* to add new or overriding defined *Actions*, *Data* and *Events*. + + + +#### Attributes +- **Name** : Name of the *ModuleClass*. Required. + +#### Elements +- **extends** : Reference to a another *ModuleClass* that is extended with this *ModuleClass*. Optional. +The element has the following attributes: + - **domain** : Identifier / Reference of the *Domain* of the extended *ModuleClass*. Required when *extends* is specified. + - **class** : Name of the *ModuleClass* in the *Domain* thet is extended. +- **Doc** : Documentation for the *ModuleClass*. Optional. +- **Actions** : A list of *Action* components, each defining a single action. Optional. +- **Data** : A list of *Data* components. Optional. +- **Events** : A list of *Event* components. Optional. + +#### Example + + <ModuleClass name="BooleanState"> + <Doc>Some documentation</Doc> + <Actions> + <!-- List of Actions goes here--> + </Actions> + <Events> + <!-- List of Events goes here--> + </Events + <Data> + <!-- List of DataPoints goes here--> + </Data> + </ModuleClass> + --- +<a name="Action"/></a> ### Action +An *Action* is defines a single procedure call for a *ModuleClass*. It is basically for calling a function on a physical device in order to set or request data, or to invoke an action at a *Device*. + + + +#### Attributes +- **name** : The name of the *Action*. Required. +- **type** : The return type of the *Action*. It must comply to one of the defined *DataTypes*. Optional. If no *type* is specified the *Action* does not return a value. + +#### Elements +- **Doc** : Documentation for the *Action*. Optional. +- **Arg** : Zero or more occurances of argument definitions for an *Action*. Optional. +The *Arg* has the following attributes and elements: + - **name** : The name of the *Arg*. Attribute. Required. + - **type** : The type of the *Arg*. It must comply to one of the defined *DataTypes*. Attribute. Required. + - **Doc** : Documentation for the *Arg*. Element. Optional. + + + +#### Example +The following are two examples for actions implementing a getter and a setter for boolean values. + + <Action name="get" type="boolean"> + <Doc>Obtain the current associated state. Example of a getter.</Doc> + </Action> + + <Action name="setTarget"> + <Doc>Set the associated state to the specified value. Example of a setter.</Doc> + <Arg name="value" type="boolean"> + <Doc>The desired value of the associated state.</Doc> + </Arg> + </Action> + +--- ### Data +The 'Data' component represents a list of 'DataPoints' + + + +#### Attributes +None. + +#### Elements +- **DataPoint** : Zero or more occurances of **DataPoints**. Optional. + +#### Example + <Data> + <!-- List of DataPoints goes here --> + </Data> + +--- + #### DataPoint + + +#### Attributes +#### Elements +#### Example + +--- + +<a name="DataType"/></a> +### DataType +The currently allowed *DataTypes* for SDT *Actions*, *Args* and *DataTypes* are: + +- **boolean** : +- **byte** : +- **integer** : +- **float** : +- **string** : +- **enum** : +- **date** : +- **time** : +- **datetime** : +- **blob** : + +--- + + ### Event + + +#### Attributes +#### Elements +#### Example diff --git a/SDT/schema2.0/docs/images/Action.png b/SDT/schema2.0/docs/images/Action.png new file mode 100644 index 0000000000000000000000000000000000000000..707e1bee4c329f2b19297feba9601e8749c086ce Binary files /dev/null and b/SDT/schema2.0/docs/images/Action.png differ diff --git a/SDT/schema2.0/docs/images/Data.png b/SDT/schema2.0/docs/images/Data.png new file mode 100644 index 0000000000000000000000000000000000000000..4da58b13c46390c87760b78e3618e720f14b6d09 Binary files /dev/null and b/SDT/schema2.0/docs/images/Data.png differ diff --git a/SDT/schema2.0/docs/images/ModuleClass.png b/SDT/schema2.0/docs/images/ModuleClass.png new file mode 100644 index 0000000000000000000000000000000000000000..d77734138c96439fda595ee080a65248a2cb583b Binary files /dev/null and b/SDT/schema2.0/docs/images/ModuleClass.png differ