X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=docs%2F4-Usage.md;h=6c6d1380f95e666c607ea51ce4f1e8aeb6222f30;hb=f516a1228e83c7921a326f52e0055f69fd429fe8;hp=61ca0689835b3008ea412a91ffb380e1d0094757;hpb=dd3e4788c11e65eb6c021520756a2e7eb4d7ddc7;p=apps%2Fagl-service-can-low-level.git diff --git a/docs/4-Usage.md b/docs/4-Usage.md index 61ca0689..6c6d1380 100644 --- a/docs/4-Usage.md +++ b/docs/4-Usage.md @@ -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 : @@ -216,7 +230,8 @@ low-can subscribe { "event": "doors.driver.open" } ON-REPLY 1:low-can/subscribe: {"jtype":"afb-reply","request":{"status":"success","uuid":"a18fd375-b6fa-4c0e-a1d4-9d3955975ae8"}} ``` -Subscription and unsubscription can take wildcard in their _event_ value. +Subscription and unsubscription can take wildcard in their _event_ value and are +**case-insensitive**. To receive all doors events : @@ -256,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 @@ -317,18 +340,23 @@ ON-REPLY 2:low-can/list: {"response":["messages.hvac.fan.speed","messages.hvac.t ## Write on CAN buses -A new capability as been introcuded to be able to write on handled CAN buses. Two modes could be used for that which is either specifying the CAN bus and a -*RAW* CAN message either by specifying a defined signal and its value. +*RAW* CAN message either by specifying a defined signal, **case-insensitively**, +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