summaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2017-04-11Unsubscribe instead of subscribe if can't adding to recurring requestRomain Forlot1-9/+6
Not useful to get a subscription on an adding error. Change-Id: I211016a1cbeb9cd5677cd8f8c7a28ccc93ef9a34 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-11Fix: make no clients event works with CAN subscriptionRomain Forlot2-4/+13
Is there is no diagnostic message corresponding then do nothing Change-Id: Ib6627b3c10b1b7a0a46d41323a6623efe808a015 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-11Fix: wrong period operation without unit multiplicatorRomain Forlot3-8/+10
Possible divsion by 0. Don't know if it is good to keep different time unit instead having one unit for project... Change-Id: I73cfc1ab72d3420d337f10a9b79bdf305a3a2bc7 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-11Use by default can0Romain Forlot1-1/+1
Change-Id: Idc4fd2f2d6d447d6b9e947d5b3129dc564a4bc5c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-11CleaningRomain Forlot1-1/+1
Change-Id: I5ef9bad2ef398d3d293c3fc2edc18271042455f4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-11Handle simultaneous subscription to diagnostic messages.Romain Forlot2-9/+16
Delay new recurring requests if there are already existing in flight and cleanup active request to correctly set in_flight_ flag to false else new request can't be launched as there is always an old one considered running... Modify a little bit DEBUG message and cleanup useless code. Change-Id: I39f865bbc6d00188d3cddd1d81437b9e3ca51269 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-11Handle cancel active diag requet when there are no more subscribersRomain Forlot5-23/+48
When push events if there is no more subscribers to that event then call a function that will cleanup that request from diagnostic manager queue. Change-Id: I8153701074453444a5bba6f1374401bdf230f7e6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-11Fix: unsubscription to diagnostic messages.Romain Forlot2-6/+14
Unsubscriptions weren't managed anymore since we handle supported flag in diagnostic messages. Now it's back, unsubscription against appfw is done as well as canceling recurring active diagnostic request. Change-Id: I22ebba771646624cb323e72dd7bf21027b6c6ba7 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-11Get recurring requests suspend proof.Romain Forlot1-2/+2
Change to CLOCK_BOOTTIME instead of CLOCK_MONOTONIC Change-Id: Iaa1a65a80e3aaa8e622ea1e3eb4b6a36b4dcd225 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-11Fix: Empty every queue before unlock mutex.Romain Forlot1-18/+25
Make sure that we finish to process every message in queue before refill them cause' CAN read run faster than decoding and pushing event. So it's a try to get all message processed. Change-Id: Idce2bc4d79920adc2bf478177c4e3defed39867b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-11Improve detail in DEBUG message at recurring request submissionRomain Forlot1-3/+7
Change-Id: I93d0cbcae8e2cdf1144ffd981c93a109682c1685 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-11Port configuration parsing to a separate object.Romain Forlot2-0/+127
Change-Id: If5da63d2fdd498dcb6dde10469acaa91b00e60df Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-11Erase compilation WARNING.Romain Forlot4-11/+5
Useless tests and type cast about numbers. Change-Id: I6fe13b7dfec8529520730f83e83d2dd3da3a674c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-11Fix: wrong pointer validity check...Romain Forlot1-1/+1
Change-Id: Ia47159fb18797681fb1dd132be5173e167d8850b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-11Fix: don't clean recurring request except if forcedRomain Forlot1-4/+3
Change-Id: I669fc1f0b078e151dfb0cbb17c3d626bb43930d2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-23Comments.Romain Forlot1-1/+2
Point to branch v1.0 instead of master Change-Id: I70b6b0e35dbbdd78840fda893c6028b2e3975afc Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-23Max in flight requests set to 8Romain Forlot1-0/+10
Change-Id: If2acf83a0f01741c90cab15e10188b2aeffd88b3
2017-03-23Send diag request only if not other one with some id runningRomain Forlot4-29/+29
Fix: elapsed function return that do not compute elapsed_time at first time Fix: reworked should_send() to get it work with our scheduling workflow Reschedule trying to send request if recurring even it is in flight. Change-Id: Idce54cb9bf62616c891a8a25a6c478f931350bc7 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-22Fix: make sure install execute sequentiallyForlot Romain [IoT.bzh]1-1/+2
2017-03-20Make error goes back to the subscribed clients when unsupported.Romain Forlot2-1/+1
Change-Id: Ic864803c8dffdab3cc9bf5bf281ce032600a732f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-20Fix: Avoid segfault if diagnostic bus isn't correctly set.Romain Forlot3-10/+24
There is a segfault when binding configuration doesn't matches configuration generated. Improve general CAN bus device initialization. Change-Id: I17ea94ee54841d09ac63a7ffad303a88d99e0173 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-19Fix bad handling unsupported OBD2 messages subscription.Romain Forlot2-3/+4
Testing supported boolean wrong and gave a null pointer to a function that doesn't check the pointer validity. Change-Id: I49e88a68f266546dbd257b0fdade860cead1322d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-18Improve Toyota examples.Romain Forlot1-89/+0
Generate a new version of the configuration generated for Toyota Auris 2010. Remove the one from src directory. It has to be paste prior to build the binding once generated. Change-Id: I0b8e5415df0d0fade70dfa193ad45770c6db38dd Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-17Comments fixes, typo and formating.Romain Forlot21-603/+575
No more warning when generate the docs and all comments follow the same formating. Change-Id: I80d4c5c2d64401c2e53a550c60155680c4f968ce Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Diagnostic requests will occur depending on their frequency.Romain Forlot1-1/+1
Hardcoded offset was for testing purpose, now we can use frequency offset. Change-Id: I920e61cd8f587ead9c77aec158edb4dee28b927d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Wrong error handling when fire diagnostic request.Romain Forlot1-6/+4
As returned code was negative value the sd_event_source stopped considering that was an error. If statement was to check that sd_event_set_enabled was ok, so unref and return wasn't at the right location... Change-Id: I91cc943c20af80a31b4f66f5714ccef93c0fdbd2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Generate a configuration example with diagnostic messages filled too.Romain Forlot1-120/+36
It was filled by hand for the moment. Change-Id: Ie72cd670bbc9c7a568507290f4bb25019ec58098 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Fix: decoded name will be prefixed as at subscription.Romain Forlot1-1/+1
Reason is that the simple message is used to match a subscribed signals in the map. So it has to be the same that at the subscription. Change-Id: Ie9504583948027523a7288b5e4a20707c49b6d59 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Include cleaningRomain Forlot15-23/+19
Change-Id: I5df96540400b833e684001f8fc5fa33ff1892bae Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Adding missing doxygen comments.Romain Forlot12-162/+332
Made some cleaning about unused things or obsolete. Review existing comments, adding missing comments. Reformat some long long constructor. Change-Id: Ibae247d1295a7a85b49d0ecee473022755d42b8b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Generated cpp file example.Romain Forlot1-60/+163
Change-Id: I1608db0120a0501af0e4327fe348ef149d90bad4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Use index number between objects to set their links.Romain Forlot6-22/+75
Needed to use generator. Change-Id: I82b44fa1e53c55e2cd90ae7017906a22b7f0636e Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
2017-03-16Implement check of supported diagnostic PID.Romain Forlot5-3/+31
Supported boolean member about diagnostic messages is now used. When a response is received, completed but not successful, then set the diagnostic message as not supported and clean the request from the queue. Subscription remains for now, not cool but will be fix soon. Change-Id: Ia5dc78d4a770f80f144724f4df6eabd2ffd4b8cc Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Improve commentsRomain Forlot2-2/+3
Change-Id: I1e43b0aeaff738db11695e77fee23e8c9809f0c1 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Make unsubscription works with diagnostic message too.Romain Forlot1-11/+20
Now unsubscription really make unsubscription and stop polling diagnostic request. Change-Id: I31830c7af97506e1231fb5f1244c350520a2df29 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Fix commentsRomain Forlot1-2/+1
Change-Id: Ia838d06885bc95196c5afc3668c0b028cb0f2763 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Fix diagnostic message name mismatch at decoding.Romain Forlot1-1/+1
Retrieve adr name prefixed will add uneeded prefix as it is already present. At build time of a Diagnostic request from a diagnostic message, this prefix is added so adr name is already correct. *adr: active diagnostic request Change-Id: Ie5c364bf47a28c80290021651941cd37fa26321a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Follow rename operation in CMakeLists.txtRomain Forlot9-9/+9
Rename has been made with filter-branch using utility git-mv-with-history, so file history follow the rename operation. This is a commit to fix include and CMake file. Change-Id: I8542c7def3143854a2008fa069dd3232f2497394 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Small fixesRomain Forlot2-4/+3
Align frequency type to float and removed useless code. Change-Id: I13d9407808c42ece0d3fd761351752ad661e01e0 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Finalization of decoding part of diagnostic messages.Romain Forlot4-67/+102
Diagnostic request must have a name to be subscribed. Else, we can't decode or event push for now. Change-Id: I0901a71da31320d8598e512614437aceb552713d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Retrieve easily Diagnostic Request PID from an Active Diagnostic RequestRomain Forlot2-0/+10
Change-Id: I787cd94b338c458fda0259bd2bcf47a1fa85cc3f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Ease use of openXC structures.Romain Forlot2-0/+29
Add some helpers functions used to check VehicleMessage validity or build default VehicleMessage struct. Change-Id: Ia1cca8b4cb3dd70a739d0f2ee9165b72fdac48d4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Rename class and 1:1 map to JSON description fileRomain Forlot7-55/+73
Added decoder and callback member that will be set by generator and taken at submission to be used later, storing them into an active diagnostic request instance, when response CAN message comes in. Change-Id: I9ded05de3bb28ec55e4e007d72d0e1924141a6a6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Make available decoding OBD2 messages method to be use as callback.Romain Forlot4-19/+22
Change the method to static 'cause it will be call from outside of the class. Change-Id: I88dcd845559fac7892cd489cd6e8198c143ee2a8 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Simplification of checking Diagnostic response.Romain Forlot3-26/+17
A CAN message will be considered as a Diagnostic response when its arbitration ID is between standardized 0x7E8 and 0x7EF. Checking which request belong to that response will done in later methods Change-Id: I7a093edf44b62a4552b90fe3d8935f94dc677cf4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Improve memory allocation about Signal states.Romain Forlot4-12/+12
Returning to Signal states map avoiding hole in vector allocation as we did not know how many state a Signal can takes. So a map may be a better choice Will see. Change-Id: Ie3ccdbd31296c5c0ebaefc109e75f2e0cde03756 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Revert accessing CAN device with a map indexing on dev nameRomain Forlot13-42/+73
Main reason for that behavior revert is because of generator that rely on CAN device name and so we have point on these object by specify the device name. Instead of shared pointer between objects, instead binding is based on device name. With a device name you can get the shared pointer on it using new static method from can_bus_t object. Change-Id: I331e0ad8d03c88a15c697d12a9fce3699b0cd962 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Uniformization between get_name() method of signals.Romain Forlot1-2/+2
can_signal_t and active_diagnostic_message return name with prefix using this method. If you need without it then use get_generic_name. Change-Id: I6b153eb20214049c10619d39fcc65c8641a9e32f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Littles comments improvmentsRomain Forlot1-2/+2
Change-Id: Idcc7e5b4dedad8e39eb829b25502d7dea3e5b29a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Change way to check prefix of signals name.Romain Forlot2-2/+5
Change-Id: I9a0726ab41c4801e7a5305731ce78ddd03aff9e1 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>