Update documentation. 12/22012/14
authorArthur Guyader <arthur.guyader@iot.bzh>
Mon, 29 Jul 2019 13:21:08 +0000 (15:21 +0200)
committerArthur Guyader <arthur.guyader@iot.bzh>
Mon, 12 Aug 2019 13:06:45 +0000 (15:06 +0200)
Bug-AGL: SPEC-2386

Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
Change-Id: I9e6b07ef48d634fe643e0eb2477fedfd34a7abb9

docs/3-Installation-J1939.md
docs/4-Usage.md

index 8ab15f3..8098d47 100644 (file)
@@ -79,25 +79,3 @@ cp include/uapi/linux/can.h /usr/include/linux/can.h
 cp include/uapi/linux/can/j1939.h /usr/include/linux/can/
 ```
 
-
-
-### Activate J1939 CMAKE
-
-To activate J1939 at the compilation.
-
-Edit the file conf.d/cmake/cmake/config.cmake
-
-And change the line :
-
-```cmake
-option(WITH_FEATURE_J1939 "Activate J1939" OFF)
-```
-
-With :
-
-```cmake
-option(WITH_FEATURE_J1939 "Activate J1939" ON)
-```
-
-
-
index cdd8d58..6c6d138 100644 (file)
@@ -140,6 +140,20 @@ j1939="can2"
 > configuration file match those specified in your generated source file with
 > the `CAN-config-generator`.
 
+
+
+## Change name of ECU for J1939
+
+To change the name of an ECU to J1939, you must go to the file conf.d/cmake/config.cmake and modify the value at :
+
+
+```cmake
+# Define name for ECU
+set(J1939_NAME_ECU 0x1239)
+```
+
+
+
 # Run it, test it, use it.
 
 You can run the binding using **afm-util** tool, here is the classic way to go :
@@ -257,10 +271,18 @@ You can also subscribe to an event with the ID or the PGN of the message definit
 
 
 ```json
-low-can subscribe { "id" : 1568}
-low-can subscribe { "pgn" : 61442}
+low-can subscribe {"id" : 1568}
+low-can subscribe {"pgn" : 61442}
 ```
 
+And subscribe to all ID or PGN :
+
+```json
+low-can subscribe {"id" : "*"}
+low-can subscribe {"pgn" : "*"}
+```
+
+
 You can stop receiving event from it by unsubscribe the signal the same way you did for subscribe
 
 ```json
@@ -325,11 +347,16 @@ and its value.
 Examples:
 
 ```json
+# Authentification
+low-can auth
 # Write a raw can frame to the CAN id 0x620
-low-can write { "bus_name": "hs", "frame": { "can_id": 1568, "can_dlc":
-8, "can_data": [ 255,255,255,255,255,255,255,255]} }
+low-can write { "bus_name": "hs", "frame": { "can_id": 1568, "can_dlc": 8, "can_data": [ 255,255,255,255,255,255,255,255]} }
 # Write a signal's value.
 low-can write { "signal_name": "engine.speed", "signal_value": 1256}
+# Write J1939 'single frame'
+low-can write { "bus_name": "j1939", "frame": { "pgn": 62420, "length":8, "data": [ 255,255,255,255,255,255,255,255]} }
+# Write J1939 'multi frame'
+low-can write { "bus_name": "j1939", "frame": { "pgn": 62420, "length":9, "data": [ 255,255,255,255,255,255,255,255,254]} }
 ```
 
 To be able to use write capability, you need to add the permission