X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=README.md;h=1629ffbcd1a34c45ec737aa0cebd9f901706f907;hb=79c8f10a68b8b992034069398da14a754b58f333;hp=554b453671d100a011dd113e0b10695258816a25;hpb=e2c6b2442f3e30ad42a358505ff3f575e80089ab;p=apps%2Fagl-service-can-low-level.git diff --git a/README.md b/README.md index 554b4536..1629ffbc 100644 --- a/README.md +++ b/README.md @@ -1,90 +1,67 @@ -# Low level CAN signaling binder +# CAN signaling binder -Low level CAN bus binder. Based upon OpenXC vi-firmware project. Purpose of this project is to offer a low level binding to an AGL platform, idea remains the same than the vi-firmware project. It's meant to generate from a JSON file describing CAN messages and diagnostic message (OBD2 for now) present in a car, a cpp file to integrate with the project and compile all together. Result will be a widget file to install on an AGL target system. +CAN bus binder, based upon OpenXC vi-firmware project. -# Prerequirements +There are 2 separated projects here, one with the CAN-binder that is installed +on an AGL target and the CAN config generator used to generate a source file for +the low level binding. -- Make sure you already have set up the AGL SDK before using the following [guide][SDK_instructions]. +Full document can be found under `docs` directory. -- This repo make use of git submodule, make sure to execute the following commands from the repository once cloned : +# Fast build procedure + +Just use build.sh script: ```bash -$ git submodule init -$ git submodule update +./build.sh ``` -- Make sure you have installed the AGL generator else you aren't able to generate custom low-level CAN binding. Generator can be found [here][generator] with the attached instruction to install and run it. It will produce a *configuration-generated.cpp* file to paste in the source, *src/*, directory. - -# Getting started +This will build both projects under build directory for each of them with default configuration. -## Compile and install the binding +# Generate documentation -AGL SDK environment correctly set, if you have an AGL target already running in your network, I encourage you to set the TARGET variable in the root CMakeLists.txt file. Then you can directly install the binding and source directory on your target system. +## Prerequisites -Execute commands to get your binding compile : +You can use gitbook to serve documentation. To do so, please install it using *npm* as well as *calibre* package from your package distribution manager: ```bash -$ mkdir build -$ cd build -$ cmake .. -$ make +sudo npm install -g gitbook-cli +sudo apt-get install calibre ``` -And if you have set TARGET variable, you can install it on your AGL system : +To generate Doxygen documentation, you'll need doxygen and graphviz: ```bash -$ make install +sudo apt-get install doxygen graphviz ``` -If not, you will have to install it manually copying the *low-can-binding.wgt* file on your target, then from it execute the following commands : +Prepare your build environment: ```bash -~# afm-util install low-can-binding.wgt -{ "added": "low-can-binding@0.1" } +mkdir build && cd build +cmake .. ``` -## Confiure system and binding - -Configure the binding specifying in the JSON configuration file the CAN device that the binding will to connect to. Edit file */var/lib/afm/applications/low-can-binding/0.1/can_buses.json* and change the CAN device name to the one you have : - -```json -{ - "canbus": "vcan0" -} -``` +## Generation -If you have several CAN bus devices then use an array: +Generate a PDF version : -```json -{ - "canbus": [ "vcan0", "can0" ] -} +```bash +gendocs.sh pdf ``` -Connected to the target load the virtual CAN device driver and set up a new vcan device : +Serve an HTML version, this will run a web server that will serve you locally documentation : ```bash - ~# modprobe vcan - ~# ip link add vcan0 type vcan - ~# ip link set vcan0 up - ``` +gendocs.sh serve +``` -Or a real CAN bus device if on is present on your board (this instruction assuming a speed of 500000kbps for your device): +Generate doxygen documentation: ```bash -~# modprobe can -~# ip link set can0 up type can bitrate 500000 +gendocs.sh doxygen ``` -## Run it, test it, use it ! - -You can run the binding using **afm-util** tool, it is the classic way to go : - +or ```bash -~# afm-util run low-can-binding@0.1 -1 +cd build && make doxygen ``` -You can find instructions to use afm-util tool [here][afm-util], as well as documentation about Application Framework. - -[SDK_instructions]: http://docs.iot.bzh/docs/getting_started/en/dev/reference/setup-sdk-environment.html "Setup SDK environment" -[generator]: http://github.com/user/generator "AGL low level CAN binding Generator" -[afm-util]: http://docs.iot.bzh/docs/apis_services/en/dev/reference/af-main/afm-daemons.html#using-afm-util "afm-util usage" \ No newline at end of file