* [GT-1835] Resolve issues identified by code screening process: added missing header...
[profile/ivi/audiomanager.git] / README
1 GENIVI AUDIOMANAGER
2
3 Copyright (C) 2011, BMW AG
4
5 Datum  15.1.2012
6 author Christian Müller (christian.ei.mueller@bmw.de)
7
8 ***********************************************************************************************************
9 LICENSE
10 ***********************************************************************************************************
11
12 GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
13 Copyright (C) 2011, BMW AG – Christian Müller  Christian.ei.mueller@bmw.de
14
15 This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
16 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
17 You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
18 Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
19 Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
20 As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
21 Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
22
23 Version 0.0.1
24
25 ***********************************************************************************************************
26 CURRENT STATUS
27 ***********************************************************************************************************
28 The most important parts of the audiomanager are already there - nevertheless there are main features missing (pls look at the todos)
29 It should be sufficient to start working on a POC around it.
30
31 ***********************************************************************************************************
32 COMPILE PROGRAMS
33 ***********************************************************************************************************
34 - compile options with default values:
35
36          CMAKE_BUILD_TYPE                                                                               
37          CMAKE_INSTALL_PREFIX             /usr/local                                                    
38          USE_BUILD_LIBS                   OFF                                                           
39          WITH_DBUS_WRAPPER                ON                                                            
40          WITH_DOCUMENTATION               OFF                                                           
41          WITH_MAIN                        ON                                                            
42          WITH_PLUGIN_COMMAND              ON                                                            
43          WITH_PLUGIN_CONTROL              ON                                                            
44          WITH_PLUGIN_ROUTING              ON                                                            
45          WITH_PPOLL                       ON                                                            
46          WITH_SIMPLEDBUS_LOOP             OFF                                                           
47          WITH_SOCKETHANDLER_LOOP          ON                                                            
48          WITH_TELNET                      OFF                                                           
49          WITH_TESTS                       ON  
50  
51
52 In order to change these options, you can modify this values with ccmake, do the appropriate changes in CmakeList.txt or via 
53 the commandline for cmake or (when installed via ccmake)
54
55 You will need some packages in order to comile the GENIVI AudioManager Daemon, these are:
56         -dbus (only when DBUS_WRAPPER==ON) [tested on version 1.2.16]
57         -sqlite3 [tested on version 3.6.22]
58         -automotive-dlt [tested on version 2.2.0]
59         -doxygen (only when WITH_DOCUMENTATION==ON) [tested on version 1.6.3]
60
61         to install them in a build environment like Ubuntu you can use:
62                 sudo apt-get install libdbus-1-dev libsqlite3-dev doxygen git cmake build-essential
63
64 For building the tests, you will need the following packages:
65         -google mock [tested on version 1.6.0-1] 
66         -google test [tested on version 1.6.0]
67         -python [tested on version 2.6]
68
69         to install them in a build environment like Ubuntu you can use:
70                 sudo apt-get install libgtest-dev google-mock python2.6-dev
71
72 More details in the CMake Files CmakeList.txt in the projects.
73
74 The build was tested on a freshly setup LinuxMint 12 (don't like Unity) with the following steps:
75         sudo apt-get update
76         sudo apt-get upgrade
77         sudo apt-get install libdbus-1-dev libsqlite3-dev doxygen libgtest-dev google-mock git cmake build-essential python2.6-dev
78
79         git clone https://<kavi-account>:<kavi-password>@git.genivi.org/srv/git/DLT-daemon
80
81 In order to build the project (out of source build), please follow these instructions on the commandline:
82
83         mkdir /build
84         cd build
85         cmake ..
86         make -j4
87
88 after the script finished, you should have:
89
90         a bin/ folder which contains all executables and the libraries: 
91         a build/ folder which has all build objects (erase that if you need a clean build)
92         a doc/ folder in case you turned the documentation on
93
94 in order to install the AudioManager, you can do
95
96         sudo make install
97
98 package generation is supported via CPack. To build packages, you have to 
99
100         make genivi_package
101
102 this will create one package if your CMake version is < 2.8.5 (all binaries stripped):
103         
104         AudioManager-<git verison>-Linux.deb 
105
106 if your version is above, you will get 4 packages (all binaries stripped) :
107         
108         AudioManager-<git verison>-Linux-bin.deb                [AudioManager binary]
109         AudioManager-<git verison>-Linux-dev.deb                [header files needed to compile plugins]
110         AudioManager-<git verison>-Linux-sampleplugins.deb      [sample plugins]
111         AudioManager-<git verison>-Linux-tests.deb              [tests including tests for sample plugins, installed in the ~/AudioMAnagerTests]
112
113 to create a tar.gz file of all sources (not including .git, build and bin folder,config files), you can do:
114
115         make package_source     
116
117 This will create the following package:
118
119         AudioManager-<git verison>-Source.tar.gz
120
121 All packages will be placed in a folder called packages
122
123 The commandline options of the AudioManager:
124
125         Usage:  AudioManagerDaemon [options]
126         options:        
127                 -h: print this message  
128                 -i: info about current settings         
129                 -v: print version       
130                 -d: daemonize AudioManager      
131                 -p<path> path for sqlite database (default is in memory)        
132                 -t<port> port for telnetconnection      
133                 -m<max> number of max telnetconnections 
134                 -c<Name> use controllerPlugin <Name> (full path with .so ending)        
135                 -l<Name> replace command plugin directory with <Name> (full path)       
136                 -r<Name> replace routing plugin directory with <Name> (full path)       
137                 -L<Name> add command plugin directory with <Name> (full path)   
138                 -R<Name> add routing plugin directory with <Name> (full path)   
139
140 Telnet-Server:
141    If you compile your AudioManager with TelnetServer support (cmake -DWITH_TELNET=ON), you will be able to set with commandline argument -t the port number and
142    with -m the maximum supported connections. The default telnet port is 6060. 
143    
144    For example, launch a telnet session on port 6060:
145       telnet localhost 6060
146    
147       #>Welcome to GENIVI AudioManager ver-0.0.1-37-ga004215
148       #>
149    
150    press 'help' to get a list of all supported commands on this level:
151    
152       #>help
153       ####################################################
154       ####### The following commands are supported: ######
155       ####################################################
156       #
157       #exit  - quit telnet session
158       #get   - Go into 'get'-submenu
159       #help  - show all possible commands
160       #info  - Go into 'info'-submenu
161       #list  - Go into 'list'-submenu
162       #set   - Go into 'set'-submenu
163       #
164       #\>
165    
166    Now type one of these commands, for example 'get', followed with another 'help' to get a list of supported commands:
167    
168       #\>get
169       #
170       #\Get>help
171       ####################################################
172       ####### The following commands are supported: ######
173       ####################################################
174       # 
175       #.. - one step back in menu tree (back to root folder)
176       #exit  - close telnet session
177       #help  - show all possible commands
178       #recv  - show receiverversion 
179       #routing  - show current routing
180       #sendv - show senderversion
181       #
182       #\Get>
183    
184    You can also execute several commands in a line:
185    
186       #\Get>recv sendv .. help exit
187       #   Receiver versions:
188       #   Ctrl: 1 | Cmd: 1 | Routing: 1
189       #   Sender versions:
190       #   Ctrl: 1 | Cmd: 1 | Routing: 1
191       ####################################################
192       ######## The following commands are supported: ######
193       ####################################################
194       #
195       #exit  - quit telnet session
196       #get   - Go into 'get'-submenu
197       #help  - show all possible commands
198       #info  - Go into 'info'-submenu
199       #list  - Go into 'list'-submenu
200       #set   - Go into 'set'-submenu
201       #
202       #Your wish is my command ... bye!
203       #Connection closed by foreign host.
204
205
206
207 The source code if formatted with eclipse, the style sheet used can be found in the cmake folder:
208 cmake/AudioManager_Codestyle.xml
209
210                                  _..-------++._
211                              _.-'/ |      _||  \"--._
212                        __.--'`._/_\j_____/_||___\    `----.
213                   _.--'_____    |          \     _____    /
214                 _j    /,---.\   |        =o |   /,---.\   |_
215                [__]==// .-. \\==`===========/==// .-. \\=[__]
216                  `-._|\ `-' /|___\_________/___|\ `-' /|_.'     
217                        `---'                     `---'