configurationengine/doc/plugins/hcrml-plugin/hcrml-plugin.rst
author terytkon
Thu, 11 Mar 2010 17:04:37 +0200
changeset 0 2e8eeb919028
permissions -rw-r--r--
Adding EPL version of configurationengine.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     1
User guide for HCR Plugin usage in ConE
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     2
=======================================
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     3
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     4
Introduction
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     5
------------
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     6
This page describes how to use ConE HCR plug-in (for Hardware configuration repository).
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     7
The plug-in defines the HCRML Implementation Markup Language, whose purpose is to provide
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     8
the means for creating bindings between ConfML settings and Hardware Configuration Repository
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     9
keys, and generating hcr.dat and C++ header files based on these bindings.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    10
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    11
XML namespace and file extension
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    12
--------------------------------
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    13
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    14
- Namespace: ``http://www.symbianfoundation.org/xml/hcrml/1``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    15
- File extension: ``hcrml``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    16
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    17
HCRML elements
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    18
--------------
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    19
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    20
The HCRML model is drawn out as a UML model in below picture.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    21
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    22
  .. image:: hcrml_elements.jpg
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    23
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    24
category
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    25
^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    26
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    27
The category represents the same concept as a category in the HCR specification, which must have a name and UID. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    28
The category element can exist directly under the HCRML root element or an output element.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    29
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    30
**Attributes**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    31
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    32
  * *name* - C++ variable name for the category UID in the generated header file
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    33
  * *uid* - UID of the category, must be unique in the repository
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    34
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    35
**Example**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    36
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    37
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    38
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    39
  <category name="KCatGPIO" uid="0x10001234">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    40
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    41
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    42
setting
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    43
^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    44
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    45
The setting is a sub element of category, it can only exist inside a category. The setting can have the following 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    46
attributes:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    47
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    48
**Attributes**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    49
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    50
  * *name* - C++ variable name for the setting UID in the generated header file
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    51
  * *id* - UID of the setting, must be unique under a certain category
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    52
  * *type* - Type of the setting (can be one of setting value types, see next section)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    53
  * *comment* - Single-line comment for the setting (visible in the generated header file)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    54
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    55
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    56
**Setting value type definitions**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    57
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    58
The HCRML value type definitions are derived from repository definitions. So the value type is the 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    59
same in HCRML, where the prefix EType has been removed and the entry is in lower case.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    60
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    61
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    62
        ==============  ==============
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    63
        HCRML type      HCR type 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    64
        ==============  ==============
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    65
        int32           ETypeInt32
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    66
        int16           ETypeInt16
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    67
        int8            ETypeInt8
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    68
        bool            ETypeBool
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    69
        uint32          ETypeUInt32
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    70
        uint16          ETypeUInt16
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    71
        uint8           ETypeUInt8
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    72
        linaddr         ETypeLinAddr
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    73
        bindata         ETypeBinData
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    74
        text8           ETypeText8
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    75
        arrayint32      ETypeArrayInt32   
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    76
        arrayuint32     ETypeArrayUInt32
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    77
        int64           ETypeInt64
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    78
        uint64          ETypeUInt64  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    79
        ==============  ==============
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    80
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    81
Note:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    82
Data for the type ``text8`` is encoded in UTF-8. This means that pure ASCII text will work
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    83
correctly without any further processing, and if any characters outside the ASCII range
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    84
are expected to be in the text, the C++ implementation will need to take the encoding into
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    85
account.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    86
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    87
**Supported ConfML setting types for HCRML types**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    88
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    89
+------------------+------------------------------------------------------------------+
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    90
| HCRML type       | ConfML setting type                                              |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    91
+==================+==================================================================+
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    92
| int8, int16,     | int                                                              |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    93
| int32, int64,    |                                                                  |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    94
| uint8, uint16,   |                                                                  |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    95
| uint32, uint64,  |                                                                  |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    96
| linaddr          |                                                                  |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    97
+------------------+------------------------------------------------------------------+
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    98
| bool             | boolean, int                                                     |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    99
+------------------+------------------------------------------------------------------+
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   100
| arrayint32,      | Sequence with an int sub-setting                                 |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   101
| arrayuint32      |                                                                  |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   102
+------------------+------------------------------------------------------------------+
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   103
| text8            | string                                                           |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   104
+------------------+------------------------------------------------------------------+
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   105
| bindata          | string with a hexadecimal value, whitespace ignored              |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   106
|                  | (e.g. ``ABCDEF 1234 5678``)                                      |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   107
+------------------+------------------------------------------------------------------+
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   108
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   109
**Examples**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   110
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   111
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   112
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   113
  <setting ref="hcrexample.DebounceInterval" name="KElmGPIO_DebounceInterval" type="int32" id="0"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   114
  <setting ref="hcrexample.GPIO_1" name="KElmGPIO_1" type="int32" id="1" comment="Pin1"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   115
  <setting ref="hcrexample.GPIO_2" name="KElmGPIO_2" type="int32" id="2" comment="Pin2"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   116
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   117
flags
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   118
^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   119
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   120
Flags element is a subelement of setting that can be used to define bit flags to a setting. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   121
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   122
**Attributes**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   123
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   124
Each flag attribute can have values 0,1, default value is 0.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   125
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   126
  * *uninitialised*
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   127
  * *modifiable*
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   128
  * *persistent*
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   129
  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   130
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   131
**Examples**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   132
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   133
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   134
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   135
  <flags uninitialized="0"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   136
  <flags modifiable="1" persistent="1"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   137
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   138
output
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   139
^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   140
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   141
Output element is a subelement of the root HCRML element used define output file generation. The output element 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   142
should include a set of category and setting definitions that are included in the output file. The output section can 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   143
also include other HCRML files to include category/setting definitions to it. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   144
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   145
If the included HCRML files contain output sections of their own, the generation is supposed the generate 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   146
only the topmost output element. So any included output element is simply ignored.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   147
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   148
**Attributes**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   149
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   150
  * *file* - The output filename to be generated)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   151
  * *type* - The output file type, which can be one of [header|hcr]
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   152
  * *version* - For hcr.dat, the HCR version number
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   153
  * *readonly* - For hcr.dat, the read-only bit
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   154
  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   155
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   156
**Examples**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   157
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   158
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   159
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   160
  <output file="test.h" type="header">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   161
  </output>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   162
  <output file="HCR.DAT" type="hcr" version="1">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   163
  </output>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   164
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   165
include
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   166
^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   167
Include element can be used to include content of other HCRML files. The purpose is mainly to allow
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   168
inclusion of categories and settings inside the output section. It allows wildcards to enable inclusion of
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   169
multiple HCRML files with single line, or the inclusion of all existing HCRML files.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   170
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   171
**Attributes**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   172
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   173
  * *ref* - The pattern for including files
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   174
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   175
**Examples**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   176
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   177
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   178
  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   179
  <include ref="foo.hcrml">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   180
  <include ref="bar.hcrml">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   181
  <include ref="my*.hcrml">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   182
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   183
Creating an HCRML configuration file
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   184
------------------------------------
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   185
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   186
The HCRML format is designed for two purposes. To allow definition of components specific binding 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   187
between confml settings and Hardware configuration repository keys  and to create/generate a C++ type 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   188
header file from HCR key definition file. Secondly to allow creation/generation of Hardware 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   189
configuration repository output file from multiple developer/component specific HCRML files.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   190
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   191
The normal lifecycle of these implementation files is described in below.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   192
 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   193
  1. Create/define the components configuration interface with confml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   194
  2. Create/define the needed hcr keys and the binding between confml features.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   195
  3. Generate the C++ header for the component from the configuration project
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   196
    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   197
    * e.g. ``cone generate`` (in the conf folder)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   198
    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   199
  4. Export/merge the component configuration as part of global configuration 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   200
    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   201
    * e.g.  ``cone merge -r . -p /epoc32/rom/config_project/hcr`` (in the conf folder)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   202
 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   203
  .. image:: hcrml_developer_project.png
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   204
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   205
  5. Define hcrml for hcr.dat generation. (Should be eventually in the same hcr layer inside the configuration project)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   206
  6. Generate the HCR.DAT
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   207
    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   208
    * e.g.  ``cone generate -p /epoc32/rom/config_project/hcr``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   209
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   210
  .. image:: hcrml_global_project.png
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   211
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   212
Examples
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   213
--------
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   214
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   215
**HCRML file example**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   216
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   217
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   218
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   219
    <?xml version="1.0" encoding="UTF-8"?>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   220
    <hcr xmlns="http://www.symbianfoundation.org/xml/hcrml/1">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   221
    <output file="example.h" type="header">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   222
      <category name="KCatGPIO" uid="0x10001234">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   223
        <setting ref="hcrexample.DebounceInterval" name="KElmGPIO_DebounceInterval" type="int32" id="0"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   224
        <setting ref="hcrexample.GPIO_1" name="KElmGPIO_1" type="int32" id="1" comment="Pin1"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   225
        <setting ref="hcrexample.GPIO_2" name="KElmGPIO_2" type="int32" id="2" comment="Pin2"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   226
      </category>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   227
    </output>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   228
    </hcr>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   229
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   230
**Explanation**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   231
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   232
The above HCRML file defines three settings's under category KCatGPIO, which has the UID 0x10001234. Each 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   233
setting must have a unique ID inside the category. And each setting must define ref that points to a confml 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   234
setting. The data value of that particular key is fetched from that confml reference. The name element
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   235
in the category and settings can be used to generate the C header file from the HCRML.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   236
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   237
A output element encapsulates the setting definitions in this file. It is not necessary, but it enables
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   238
that example.h header file can be generated from this component specific HCRML file. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   239
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   240
**HCR repository file example**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   241
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   242
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   243
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   244
    <?xml version="1.0" encoding="UTF-8"?>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   245
    <hcr xmlns="http://www.symbianfoundation.org/xml/hcrml/1">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   246
      <output file="HCR.DAT" type="hcr" version="1" readOnly="1">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   247
        <include ref="*.hcrml">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   248
      </output>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   249
    </hcr>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   250
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   251
**Explanation**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   252
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   253
The above HCRML entry would define a HCR binary output file HCR.DAT with version 1 and readonly bit true. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   254
The file generation will try to include all .hcrml ending files from the configuration project. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   255
The include statement will just look for any matching file and include its content inside this file. If the 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   256
included hcrml files include an output section, they are simple ingored and only the topmost output 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   257
file will be generated.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   258
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   259
The output file section will in the end contain all categories and keys of all HCRML files. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   260
These files would normally be the files which are exported to the configuration project from several 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   261
component configurations.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   262
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   263
Downloadable example
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   264
--------------------
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   265
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   266
Download: :download:`hcrml_example.zip`
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   267
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   268
This example contains a mock developer project like shown earlier. It has
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   269
a ``conf/`` directory containing the ConfML and HCRML files, and (empty) ``inc/``,
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   270
``src/`` and ``group/`` directories. The important part is the ``conf/`` directory, which
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   271
contains the following files:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   272
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   273
- ``confml/hcr_component1.confml`` - ConfML interface for the HCR settings
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   274
- ``implml/component1.hcrml`` - HCRML file defining the binding between the ConfML settings and the HCR settings
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   275
- ``implml/hcr_dat.hcrml`` - HCRML file for generating ``hcr.dat``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   276
- ``implml/hcr_keys.hcrml`` - HCRML file for generating ``hcr_keys.h``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   277
- ``root.confml`` - Needed for generation to work; contains a link to ``confml/hcr_component1.confml``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   278
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   279
To generate, cd to ``component1/conf/`` and run::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   280
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   281
  cone generate
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   282
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   283
This will generate an ``output/`` directory with the files ``hcr.dat`` and ``hcr_keys.h``.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   284
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   285
Linking between ConfML/HCRML/output
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   286
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   287
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   288
Here the linking between ConfML/HCRML/output is shown using the binary data
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   289
setting. Irrelevant parts of the files are omitted for clarity.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   290
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   291
**ConfML:**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   292
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   293
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   294
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   295
    <feature ref="HcrComponent1" name="HCR test component 1">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   296
        ...
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   297
        <setting ref="BinDataSetting" name="Binary data setting" type="string"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   298
        ...
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   299
    </feature>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   300
    ...
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   301
    <data>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   302
        <HcrComponent1>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   303
            ...
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   304
            <BinDataSetting>00112233 DEADBEEF CAFE 50</BinDataSetting>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   305
            ...
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   306
        </HcrComponent1>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   307
    </data>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   308
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   309
**HCRML:**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   310
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   311
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   312
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   313
    <category name="KHcrComponent1" uid="0x00000001">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   314
        ...
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   315
        <setting ref="HcrComponent1.BinDataSetting" name="KBinDataSetting" type="bindata" id="5" comment="Binary data setting"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   316
        ...
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   317
    </category>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   318
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   319
**Output - hcr.dat:**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   320
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   321
.. image:: hcr_dat.png
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   322
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   323
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   324
**Output - hcr_keys.h:**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   325
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   326
.. code-block:: c++
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   327
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   328
    #ifndef HCR_KEYS_H
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   329
    #define HCR_KEYS_H
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   330
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   331
    #include <hcr.h>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   332
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   333
    const HCR::TCategoryUid KHcrComponent1 = 0x00000001;
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   334
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   335
    ...
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   336
    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   337
    // Binary data setting
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   338
    const HCR::TElementId KBinDataSetting    = 0x00000005;
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   339
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   340
    #endif
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   341
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   342
XSD
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   343
---
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   344
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   345
Download: :download:`hcrml.xsd </xsd/hcrml.xsd>`
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   346
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   347
FAQ
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   348
---
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   349
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   350
This will be updated based on the questions.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   351