README.md
1 # parameter-framework
2
3 [![Build Status](https://travis-ci.org/01org/parameter-framework.svg?branch=master)](https://travis-ci.org/01org/parameter-framework)
4 [![Windows Build Status](https://ci.appveyor.com/api/projects/status/ga24jp8tet0qimbu/branch/master)](https://ci.appveyor.com/project/parameter-framework/parameter-framework)
5 [![Coverage Status](https://codecov.io/github/01org/parameter-framework/coverage.svg?branch=master)](https://codecov.io/github/01org/parameter-framework?branch=master)
6
7 ## Introduction
8
9 The parameter-framework is a plugin-based and rule-based framework for handling
10 parameters. This means that you can:
11
12 1. Describe your system's structure and its parameters (in XML) - aka. **What**;
13 2. Write (in C++) or reuse a backend (aka. plugin) for accessing the parameters
14 that you just described - aka. **How**;
15 3. Define (in XML or in a domain-specific-language) conditions/rules upon which
16 a given parameter must take a given value - aka. **When**.
17
18 ![What, How, When](https://01org.github.io/parameter-framework/hosting/what-how-when.png)
19
20 ### Usage examples
21
22 #### Alsa controls on embedded platforms
23
24 The parameter-framework can be used to set the value of alsa controls
25 (switches, volumes, etc.) on smartphones/tablets based on parameter-framework
26 rules (in this example, they transcribe use-cases). For accessing parameters
27 (i.e. alsa controls), you may use the
28 [alsa plugin](https://github.com/01org/parameter-framework-plugins-alsa).
29
30 #### Parameters in files
31
32 The [filesystem plugin](https://github.com/01org/parameter-framework-plugins-filesystem)
33 can be used to write parameters in files. This is particularly useful for
34 files in `/sys` managing GPIOs.
35
36 ### More details
37
38 The parameter-framework's core comes in the form of a shared library. Its
39 client has to provide:
40
41 - configuration files describing the structure of the system to be managed by
42 the parameter-framework and what plugins it must use to read/write into each
43 subsystem;
44 - a list of criteria (representing the state of the client) and their possible
45 values;
46 - configuration files describing the value that each part of the system (aka
47 parameter) must take - this is done by writing rules based on the criteria
48 described above.
49
50 At runtime, the most usual communication between the client and the
51 parameter-framework are:
52
53 1. The update of *criteria* (that are used in the rules introduced above) and
54 2. Update all relevant parameters according to the new criteria values. The
55 parameter-framework uses the appropriate backend for writing the values in
56 each underlying subsystem.
57
58 The parameter-framework comes with several tools, including a command-line
59 interface: `remote-process`.
60
61 ## Going further
62
63 See [the wiki on github](https://github.com/01org/parameter-framework/wiki).
64
65 ## Compiling
66
67 **You may take a look at `.travis.yml` and `appveyor.yml` for examples on how we
68 build the Parameter Framework in the CI.** It will probably help if you have
69 troubles building the Parameter Framework even after reading the following
70 sections:
71
72 ### Dependencies
73
74 In order to compile you'll need, at the very least:
75
76 - CMake (v3.2.2 or later) (v3.3.0 or later on Windows);
77 - A C/C++ compiler supporting C++11;
78 - libxml2 headers and libraries (Provided by the `libxml2-dev` on debian-based
79 distributions);
80
81 If you want to use the remote command interface (`NETWORKING=ON` by default),
82 you'll also need:
83
84 - Standalone ASIO (1.10.6 or later) (Provided by `libasio-dev` on debian-based
85 distributions) ASIO is C++ header-only ASynchronous-IO library.
86
87 If you want to compile the *Python bindings* (`PYTHON_BINDINGS=ON` by default),
88 you'll also need:
89
90 - SWIG 2.0 (A binding generator);
91 - Python2.7 development environment (Provided by `python2.7-dev` on debian-based
92 distributions)
93
94 If you want to *compile and run the tests* (`BUILD_TESTING=ON` by default),
95 you'll also need:
96
97 - Catch (Provided by `catch` on debian-based distributions). Catch is a
98 single-header test framework - as such you may also download it directly
99 [here](https://raw.githubusercontent.com/philsquared/Catch/master/single_include/catch.hpp);
100 - Python2.7 (Provided by `python2.7` on debian-based distribution - it is
101 preinstalled on most distributions).
102
103 If you want to *build the code documentation* (`DOXYGEN=OFF` by default), you'll
104 need `doxygen` and `graphviz`. This doc is already available to you - see the
105 wiki.
106
107 **To list all available configuration options, try** `cmake -L` (you may also
108 filter-out lines starting with `CMAKE_`).
109
110 ### How-To
111
112 If you are already familiar with CMake, you know what to do.
113
114 Run `cmake .` then `make`. You may then install libraries, headers and
115 binaries with `make install`. By default, they are installed under
116 `/usr/local` on unix OSes; if you want to install them under a custom
117 directory, you may do so by passing it to the `cmake .` command; e.g.
118
119 # Always use absolute paths in CMake "-D" options: you don't know where
120 # relative paths will be evaluated from.
121 cmake -DCMAKE_INSTALL_PREFIX=/path/to/custom/install .
122
123 If you want to provide your own dependencies (e.g. your own version of
124 libxml2), you should pass the base paths as the `CMAKE_PREFIX_PATH` variable,
125 e.g.:
126
127 cmake -DCMAKE_PREFIX_PATH='/path/to/dependency1/;/path/to/dependency2/'
128
129 For more information on how to use `CMAKE_PREFIX_PATH`, see CMake's
130 documentation.
131
132 Also, CMake can build a project out-of-tree, which is the recommended method:
133
134 mkdir /path/to/build/directory
135 cd /path/to/build/directory
136 cmake /path/to/sources/of/parameter-framework
137 make
138
139 After a build you may want to run the parameter-framework tests with
140 `make test` or `ctest`.
141
142 ### Compiling on Windows
143
144 The only supported compiler on Windows in Visual Studio 14 2015. The 2013
145 version does not support some C++11 features. When running CMake's
146 configuration step (the first call to CMake) you must specify the build system
147 you want to use, i.e. `-G Visual Studio 14 2015 Win64`. Again, you may refer to
148 `appveyor.yml`.
149
150 If you don't already have libxml2 headers/libraries and don't want to build them
151 by yourself, we have a precompiled version for x86-64. *These are provided for
152 reference and as a convenience for development purpose only; when making a
153 final product, you should recompile the latest libxml2 release yourself.*
154
155 Compiled with Visual Studio 12 2013:
156 - [in debug configuration](https://01.org/sites/default/files/libxml2-x86_64-debug-3eaedba1b64180668fdab7ad2eba549586017bf3.zip)
157 - [in release configuration](https://01.org/sites/default/files/libxml2-x86_64-3eaedba1b64180668fdab7ad2eba549586017bf3.zip)
158
159 We have mirrored ASIO 1.10.6 [here](https://01.org/sites/default/files/asio-1.10.6.tar.gz).
160
161 Once you have downloaded and uncompressed these two dependencies, add the
162 following two entries to `CMAKE_PREFIX_PATH`:
163
164 /path/to/libxml2-x86_64/
165 /path/to/asio-1.10.6/
166