Update doc: Timestamp added to returned events.
[apps/agl-service-can-low-level.git] / docs / 3-Usage.md
index e122adc..fa2991c 100644 (file)
@@ -121,7 +121,7 @@ hs="can1"
 You can run the binding using **afm-util** tool, here is the classic way to go :
 
 ```bash
-afm-util run low-can-service@2.0
+afm-util run low-can-service@4.0
 1
 ```
 
@@ -129,17 +129,17 @@ You can find instructions to use afm-util tool [here](http://docs.iot.bzh/docs/a
 
 But you can't control nor interact with it because you don't know security token that **Application Framework** gaves it at launch.
 
-So, to test it, it is better to launch the binding manually. In the following example, we will use port **1234** and left empty security token for testing purpose:
+So, to test it, it is better to launch the binding manually. In the following example, it will use port **1234** and left empty security token for testing purpose:
 
 ```bash
-afb-daemon --ldpaths=/usr/lib/afb:/var/lib/afm/applications/low-can-service/2.0/lib/ --rootdir=/var/lib/afm/applications/low-can-service/2.0/ --port=1234 --token=1
+afb-daemon --binding=/var/lib/afm/applications/low-can-service/4.0/lib/afb-low-can.so --rootdir=/var/lib/afm/applications/low-can-service/4.0/ --port=1234 --token=1
 NOTICE: binding [/usr/lib/afb/afb-dbus-binding.so] calling registering function afbBindingV1Register
 NOTICE: binding /usr/lib/afb/afb-dbus-binding.so loaded with API prefix dbus
 NOTICE: binding [/usr/lib/afb/authLogin.so] calling registering function afbBindingV1Register
 NOTICE: binding /usr/lib/afb/authLogin.so loaded with API prefix auth
-NOTICE: binding [/var/lib/afm/applications/low-can-service/2.0/libs//low-can-binding.so] calling registering function afbBindingV1Register
-NOTICE: binding /var/lib/afm/applications/low-can-service/2.0/libs//low-can-binding.so loaded with API prefix low-can
-NOTICE: Waiting port=1234 rootdir=/var/lib/afm/applications/low-can-service/2.0/
+NOTICE: binding [/var/lib/afm/applications/low-can-service/4.0/libs//low-can-binding.so] calling registering function afbBindingV1Register
+NOTICE: binding /var/lib/afm/applications/low-can-service/4.0/libs//low-can-binding.so loaded with API prefix low-can
+NOTICE: Waiting port=1234 rootdir=/var/lib/afm/applications/low-can-service/4.0/
 NOTICE: Browser URL= http:/*localhost:1234
 ```
 
@@ -189,10 +189,10 @@ low-can subscribe { "event" : "doors*" }
 ON-REPLY 1:low-can/subscribe: {"jtype":"afb-reply","request":{"status":"success","uuid":"511c872e-d7f3-4f3b-89c2-aa9a3e9fbbdb"}}
 ```
 
-Then you will receive an event each time a CAN message is decoded for the event named _doors.driver.open_
+Then you will receive an event each time a CAN message is decoded for the event named _doors.driver.open_ with its received timestamp if available:
 
 ```json
-ON-EVENT low-can/messages.doors.driver.open({"event":"low-can\/messages.doors.driver.open","data":{"name":"messages.doors.driver.open","value":true},"jtype":"afb-event"})
+ON-EVENT low-can/messages.doors.driver.open({"event":"low-can\/messages.doors.driver.open","data":{"name":"messages.doors.driver.open","value":true, "timestamp": 1505812906020023},"jtype":"afb-event"})
 ```
 
 Notice that event shows you that the CAN event is named _messages.doors.driver.open_ but you ask for event about _doors.driver.open_.
@@ -223,7 +223,7 @@ ON-REPLY 3:low-can/unsubscribe: {"jtype":"afb-reply","request":{"status":"succes
 
 It is possible to limits received event notifications into minimum and maximum boundaries as well as doing frequency thinning. This is possible using the argument filter with one or more of the filters available :
 
-* frequency: specify in Hertz the frequency which will be used to getting notified of new CAN events for the designated signal. If, during the blocked time, further changed CAN messages are received, the last valid one will be transferred after the lockout with a RX_CHANGED. 
+* frequency: specify in Hertz the frequency which will be used to getting notified of new CAN events for the designated signal. If, during the blocked time, further changed CAN messages are received, the last valid one will be transferred after the lockout with a RX_CHANGED.
 * min: Minimum value that the decoded value needs to be above to get pushed to the subscribed client(s).
 * max: Maximum value that the decoded value needs to be below to get pushed to the subscribed client(s)
 
@@ -264,16 +264,19 @@ You can also replay a previously dumped CAN logfiles. These logfiles can be foun
 Trace has been recorded from a CAN device `can0` so you have to map it to the correct one you use for your tests.
 
 Replay on a virtual CAN device `vcan0`:
+
 ```bash
 canplayer -I trip_test_with_obd2_vehicle_speed_requests vcan0=can0
 ```
 
 Replay on a CAN device `can0`:
+
 ```bash
 canplayer -I trip_test_with_obd2_vehicle_speed_requests can0
 ```
 
 Replay on a CAN device `can1` (porter by example):
+
 ```bash
 canplayer -I trip_test_with_obd2_vehicle_speed_requests can1=can0
 ```