Skip to content
Snippets Groups Projects
Commit e14c7b36 authored by Andreas Kraft's avatar Andreas Kraft
Browse files

Added documentation for Action, Data and ModuleClass.

parent 215d20c6
No related branches found
No related tags found
No related merge requests found
......@@ -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
![](images/Domain.png)
#### 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*.
![](images/ModuleClass.png)
#### 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*.
![](images/Action.png)
#### 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'
![](images/Data.png)
#### Attributes
None.
#### Elements
- **DataPoint** : Zero or more occurances of **DataPoints**. Optional.
#### Example
<Data>
<!-- List of DataPoints goes here -->
</Data>
---
#### DataPoint
![](images/xx.png)
#### 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
![](images/xx.png)
#### Attributes
#### Elements
#### Example
......
SDT/schema2.0/docs/images/Action.png

15.6 KiB

SDT/schema2.0/docs/images/Data.png

15.2 KiB

SDT/schema2.0/docs/images/ModuleClass.png

12.1 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment