Documents new verb: get, list and write for EEL
authorRomain Forlot <romain.forlot@iot.bzh>
Tue, 19 Sep 2017 14:19:45 +0000 (16:19 +0200)
committerRomain Forlot <romain.forlot@iot.bzh>
Tue, 19 Sep 2017 14:19:45 +0000 (16:19 +0200)
Change-Id: Id03f6363c5d452db43c696e045caaefad0916dc6
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
docs/3-Usage.md
docs/Doc-Revisions.md
low-can-binding/binding/low-can-apidef.json

index fa2991c..ba2c63f 100644 (file)
@@ -237,6 +237,40 @@ low-can subscribe {"event": "messages.engine.load", "filter": { "min": 30, "max"
 low-can subscribe {"event": "messages.vehicle.speed", "filter": { "frequency": 2}}
 ```
 
+## Get last signal value and list of configured signals
+
+You can also ask for a particular signal value on one shot using **get** verb, like
+this:
+
+```json
+low-can get {"event": "messages.engine.speed"}
+ON-REPLY 1:low-can/get: {"response":[{"event":"messages.engine.speed","value":0}],"jtype":"afb-reply","request":{"status":"success"}}
+```
+
+> **CAUTION** Only one event could be requested.
+
+Also, if you want to know the supported CAN signals loaded by **low-can**, use verb
+**list**
+
+```json
+low-can list
+ON-REPLY 2:low-can/list: {"response":["messages.hvac.fan.speed","messages.hvac.temperature.left","messages.hvac.temperature.right","messages.hvac.temperature.average","messages.engine.speed","messages.fuel.level.low","messages.fuel.level","messages.vehicle.average.speed","messages.engine.oil.temp","messages.engine.oil.temp.high","messages.doors.boot.open","messages.doors.front_left.open","messages.doors.front_right.open","messages.doors.rear_left.open","messages.doors.rear_right.open","messages.windows.front_left.open","messages.windows.front_right.open","messages.windows.rear_left.open","messages.windows.rear_right.open","diagnostic_messages.engine.load","diagnostic_messages.engine.coolant.temperature","diagnostic_messages.fuel.pressure","diagnostic_messages.intake.manifold.pressure","diagnostic_messages.engine.speed","diagnostic_messages.vehicle.speed","diagnostic_messages.intake.air.temperature","diagnostic_messages.mass.airflow","diagnostic_messages.throttle.position","diagnostic_messages.running.time","diagnostic_messages.EGR.error","diagnostic_messages.fuel.level","diagnostic_messages.barometric.pressure","diagnostic_messages.ambient.air.temperature","diagnostic_messages.commanded.throttle.position","diagnostic_messages.ethanol.fuel.percentage","diagnostic_messages.accelerator.pedal.position","diagnostic_messages.hybrid.battery-pack.remaining.life","diagnostic_messages.engine.oil.temperature","diagnostic_messages.engine.fuel.rate","diagnostic_messages.engine.torque"],"jtype":"afb-reply","request":{"status":"success","uuid":"32df712a-c7fa-4d58-b70b-06a87f03566b"}}
+```
+
+## 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.
+
+Examples:
+
+```json
+# 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]} }
+# Write a signal's value.
+low-can write { "signal_name": "engine.speed", "value": 1256}
+```
+
 ## Using CAN utils to monitor CAN activity
 
 You can watch CAN traffic and send custom CAN messages using can-utils preinstalled on AGL target.
index fe246de..3a0b592 100644 (file)
@@ -5,3 +5,4 @@ Document revisions
 |-------------|---------|--------------------------------------|-------------------------|
 | 20 Mar 2017 |   1.0   | Initial release                      | R. Forlot [ Iot.bzh ] <br/> S. Douheret [ Iot.bzh ] |
 | 20 Jun 2017 |   4.0   | Update documentation with new v4.0 features | R. Forlot [ Iot.bzh ] <br/> S. Douheret [ Iot.bzh ] |
+| 20 Jun 2017 |   4.99-RC1   | Update documentation with new EEL features (get,list, write)| R. Forlot [ Iot.bzh ] <br/> S. Douheret [ Iot.bzh ] |
index cdea1f4..623b4c7 100644 (file)
           "200": {"$ref": "#/components/responses/200"}
         }
       },
+      "/get": {
+        "description": "get a current value of CAN message",
+          "parameters": [
+            {
+              "in": "query",
+              "name": "event",
+              "required": false,
+              "schema": { "type": "string" }
+            }
+          ],
+          "responses": {
+            "200": {"$ref": "#/components/responses/200"}
+          }
+        },
+      "/list": {
+        "description": "get a supported CAN message list",
+          "responses": {
+            "200": {"$ref": "#/components/responses/200"}
+          }
+        },
     "/auth": {
       "description": "Authenticate session to be raise Level Of Assurance.",
       "get": {