aboutsummaryrefslogtreecommitdiffstats
path: root/docs/Usage.md
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2019-01-03 17:43:32 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2019-01-03 18:29:48 +0100
commitf564d467a7ea0f79c1fca5c98079a0e2a9397ac1 (patch)
tree2e9d7fae7b0142cd94d689df819d4ec4d3d1d825 /docs/Usage.md
parent565e5a7fac5db9a35fd0b2cb8e12f1bdf4772821 (diff)
New installation instructionssandbox/claneys/docs
New installation instructions for the appcontroller library And remove the the submodule occurences. Bug-AGL: SPEC-1689 Change-Id: Idaa6f9191ce521b551ddd7e7d4aa4430f0aeb399 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'docs/Usage.md')
-rw-r--r--docs/Usage.md52
1 files changed, 40 insertions, 12 deletions
diff --git a/docs/Usage.md b/docs/Usage.md
index 65f1ce9..a85d9f1 100644
--- a/docs/Usage.md
+++ b/docs/Usage.md
@@ -1,22 +1,50 @@
# Usage
-## 1) Add app-controller-submodule as a submodule to include in your project
+## (Optionnal) Remove the git submodule version
+
+If you already use the controller component but using the submodule version then
+you have to get rid of it to be sure to link and use the library version. To do
+so, you have to do the following:
+
+* deinitialize the submodule using `git`
```bash
-git submodule add https://gerrit.automotivelinux.org/gerrit/apps/app-controller-submodule
+# This example assumes that the git submodule is named app-afb-helpers-submodule
+# and is located at your root project repository.
+git submodule deinit app-afb-helpers-submodule
```
-## 2) Add app-controller-submodule as a static library to your binding
+* remove the submodule relatives lines from the `.gitmodules` file
-```cmake
- # Library dependencies (include updates automatically)
- TARGET_LINK_LIBRARIES(${TARGET_NAME}
- ctl-utilities
- ... other dependencies ....
+```bash
+vim .gitmodules
+```
+
+* remove the `ctl-utilities` target link from any CMake target you specified.
+ Those lines looks like:
+
+```bash
+TARGET_LINK_LIBRARIES(${TARGET_NAME}
+ ctl-utilities # REMOVE THIS LINE
+ ${link_libraries}
)
```
-## 3) Declare your controller config section in your binding
+## Add libappcontroller as a static library to your binding
+
+In your `config.cmake` file, add a dependency to the controller library, i.e:
+
+```cmake
+set(PKG_REQUIRED_LIST
+ json-c
+ afb-daemon
+ ctl-utilities --> this is the controller library dependency name
+)
+```
+
+Or you can also use the `FIND_PACKAGE` CMake command to add it.
+
+## Declare your controller config section in your binding
```C
// CtlSectionT syntax:
@@ -32,7 +60,7 @@ static CtlSectionT ctlSections[]= {
```
-## 4) Do the controller config parsing at binding pre-init
+## Do the controller config parsing at binding pre-init
```C
// check if config file exist
@@ -46,8 +74,8 @@ static CtlSectionT ctlSections[]= {
if (!ctlConfig) return -1;
```
-## 5) Execute the controller config during binding init
+## Execute the controller config during binding init
```C
int err = CtlConfigExec (ctlConfig);
-``` \ No newline at end of file
+```