The Device Access provides default implementation of the mappings. The mappings are created in a declarative manner by structured XML files that are validated by the following XSD Schema. The XML mappings are provided by separate bundle. This bundle has specific manifest header, described bellow.
The XML mapping file semantically can be separated into five logical parts:
Information about the mapping that should be described.
Information about the Source Device Item and Target Device Item.
Information about the mapping between property to property or property to operation.
Information about the mapping between operation to property or operation to operation.
Information about the Target Device Item properties with no mapping, which are given default values.
Detailed information for each logical part and set of examples are found on the following sections:
Mapping Info – basic information about the mapping.
Source and Target Infos – detailed information on how to describe which Device Items should be mapped.
Property Mapping – detailed information about the mapping between properties.
Operation Mapping – detailed information about the mapping between operations.
Default Mapping – detailed information about these properties that there are no mappings and should have default values.
Manifest Header
The bundles that provide XML mappings have special manifest header – "DAMapping" that has two attributes:
xml – a mandatory attribute, which declares the path to the XML mapping files.
version – an optional attribute, which declares the version of the XML file. If there is no specified version, the default 0.0.0 version is used. This attribute is transformed into correct OSGi version (org.osgi.framework.Version) format.
The following examples show valid manifest headers:
DAMapping
xml=/resources/xml/mapping.xml;version="1.0.0"
xml=/resources/xml/mapping1.xml;version=1.0.1
xml=/resources/xml/mapping2.xml
The other example shows the manifest header of Device Access Mapping Demo bundle: