summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
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-16added a folder to ignore in .gitignore.Loïc Collignon1-0/+1
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>
2017-03-16Improve shims_logger function to get full details.Romain Forlot1-3/+8
Change-Id: I752db65cb3fbca4d33b932f3a0c597adfaf79903 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Get recurring requests works.Romain Forlot1-38/+33
Implements event_loop logic. Change-Id: Ia5ac32820a0421bbcb69d8b0dd3bea2b7b582444 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Simplification of diagnostic manager. Delete uneeded vectorRomain Forlot2-51/+22
Control size manually, don't rely on STL container. Change-Id: Iede2f9b233c5b8a6dc77c9b146ffc92da8e7a989 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Return period without unit conversion.Romain Forlot1-3/+1
If conversion must be made then make it at the call not upstream. Change-Id: Ief6dee40355c7b39b5e27d0ba3dc02717fadf43b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Search signals against name not generic_name. It's madeRomain Forlot2-3/+3
to get able to get difference between classic CAN messages and diagnostic messages based on name signals prefix. Change-Id: I696facc58f38150e0457d519dcabffba750a8db3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Less control before process the CAN message.Romain Forlot1-6/+5
Change-Id: I341d29d217b2a92652e9985d8c93829e0211bddc Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Implement regular event launching using systemd event loopRomain Forlot3-21/+49
Regular events is made launch a timerfd event from binder event loop and then in the event handler, reschedule next launch in the future based upon the signal frequency. Change-Id: I0b1e84eb2135474f4bcc5ee256ba513eea4035a6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Improve logging messages and change string conversion to charRomain Forlot1-5/+5
for the needed case. They were some inversion between needs of char variable and string. Fix: don't add diagnostic request if it is an unsubscrition operation. Change-Id: I1acedc413e7c5fe57da86812faf8d3c83d13c405 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Move diagnostic requests scheduling to diagnostic managerRomain Forlot2-8/+22
while adding the request. It is more logic to make that here than in the subscription operation. Change-Id: I19b29bc11c5fb6e5828a0bf189fac1333b0199ed Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Fix: Initialization and entries flowRomain Forlot1-8/+11
between diagnostic manager vector. Change-Id: I9ea196b5dc5bbf2dd4509080a9a58d754fa42b6c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Enabling recurrent check of diagnostic requests.Romain Forlot1-0/+1
Change-Id: I16aff65c5ce22faac78e3f1d99ce7b33941c007c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Improve Doxygen comments and formating.Romain Forlot12-268/+281
Change-Id: Ia39e78aca00a49c7cee5e42d26ba1ef2b49d3709 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Improve: DEBUG messages.Romain Forlot2-2/+2
Change-Id: Ib52f22e7bc5bc5d14edbb31ad6006caee23c4098 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Fix: return before initialization of diagnostic manager.Romain Forlot1-4/+2
Change-Id: I8485dec1ec5bb5dbea7edf4d9ac3a7d800b567b2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Make decoder systematic use of openxc-utils to buildRomain Forlot1-12/+5
its objects. We don't want random initialization on boolean value of openxc_DynamicField (has_string, has_numeric...) else we have a risk that the final decoded and convert into json object will not be the good one. Change-Id: If4d69e6ace615fd8e097ba9a04e5482c82b9a7db Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Implement signals states decoder and change mapRomain Forlot4-23/+26
to a vector. Change-Id: I185724f2966fecac6659d401751da56d2886ed9d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Search into generic_name as well as name + prefix, butRomain Forlot3-4/+8
always register generic_name into subscribed_signals. It will be the output on event and make easier to find the subscribed signals into the map without prefix. Change-Id: Iaf0060bedb54003b0c77121afd2bd35d832dba25 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Adding/Fix classes constructors to make them correspondRomain Forlot7-40/+70
to the ones generated. Change-Id: I6b0b778f59ac52fe66e36a327f60ae58550ac271 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Separation of classes in the same file.Romain Forlot5-66/+88
Change-Id: Ifc690cc27028659ffaf5a8a2e9caabc1e0718fd4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Move member from obd2_signals_t class toRomain Forlot6-85/+53
active_diagnostic_request_t (adr)class. It's more logical to have them here as call about incoming diagnostic CAN messages are made against adr class not obd2_signal_t that it's a subset of diagnostic messages. It's made to handle obd2 requests as well as normal UDS diagnostic request for constructor proprietary diagnostic signals. Change-Id: I96c714640d6ecfa25dfc9942974057c1797eb0e1 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Get decoding diagnostic request from decoding thread of can_bus_tRomain Forlot8-51/+224
Decoding divided in 2 subfunctions dedicated to decode either pure CAN messages or diagnostic (obd2) message. About now, a diagnostic request has a name then it will be pushed on the event_queue as a SimpleMessage. Without name full details of diagnostic response will be pushed as diagnostic response. This behavior follows the one from OpenXC. Change-Id: I255f3f6487fa9511ea47c74606014995a7b0f720 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Change the way to check signal type making prefix_Romain Forlot5-12/+14
attribute as static with a static class method which will check that the beginning of string argument matches the prefix. Change-Id: Idb129c7179391da61447996560957b2791aa9383 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Reordering class method.Romain Forlot1-17/+17
Change-Id: I61cca1117a987280383538a0b0e307429bee4fc3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Adding instruction to use the binding.Romain Forlot1-5/+83
Miss an example with an UI or CLI interface. Change-Id: Ib26fe53f16fbdeb79f79fee15fce20ce3342d210 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Fix: set to microsecond frequency check of diag requestRomain Forlot2-6/+3
Change-Id: I871ff68afd7f398d4c7d3a550c8926c1f7e67cb3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16fix: test for opened CAN socket.Romain Forlot1-5/+5
Change-Id: If9e3a0511c7ccc703817069a56bd38d7e64ebb09 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Keep subscription to signal simplier without doublingRomain Forlot1-45/+8
functions dedicated to different signal type as they aren't so much difference between. Change-Id: Ic2090c2d755136183dfc08a9b84efa3388d3747b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Default value about thread state set at false.Romain Forlot3-13/+4
Change-Id: I1934aa4d9a9d945a32d8e369cf0f36b1e06d3f34 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>