aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
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-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>
2017-03-16Change configuration location into an etc directory.Romain Forlot2-3/+3
Change-Id: I4648f2eb203f37844bfb8deb2527f93b4852e82c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Fix: wrong location to make the increment because we useRomain Forlot1-1/+1
the device after so... This was total crap ! Change-Id: I9bb43c3f75c613a5927f342b3c574871c0eb65bb Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Fix CMakeLists file to get isotp correctly linked and addingRomain Forlot1-3/+3
missing libssytemd Change-Id: Id065ff16a7f582ba1cf88423c75bf4c11fb026d9 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Missing include header and code reordering and cleaning.Romain Forlot2-5/+5
Change-Id: I37b2b2b439bb72d2230d606b9ddd52c3eb08ea8f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Change method returned value. Needed with send_request()Romain Forlot2-10/+7
method to retrieve the active_diagnostic_request. Change-Id: Icfba704e40be211021dc81ec18fa3602d736afdb Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Implemente way to send diagnostic request when subscribed.Romain Forlot10-8/+167
When subscribed, the signal is added to recurring request list of diagnostic manager and an event is added to the systemd event loop with timer set using frequency parameter from the requested signal. Change-Id: I4d604c498047d7744c090b7f03fce0f2b427fd01 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Use of signals prefix to be able to distinguish type ofRomain Forlot2-5/+11
messages to be processed. For now, processing prefix is hardcoded but idea is to process them dynamically if possible. To be studied. Change-Id: Iac0c96228fc5f53e3c637e54350188ff3de6d57f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Make diagnostic manager initialization processus.Romain Forlot7-46/+58
It is initiliazed with by default the first CAN bus device in the CAN bus device list from CAN bus manager. The object is instancied at configuration_t object first invokation and after all CAN buses has been initialized then the diag manager is initialized too. Change-Id: I4894f2c62f575676c34efec3608b97de8c5326e1 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16We doesn't modify member once getted, we can use const returnRomain Forlot5-13/+37
and const method. Change-Id: I0f7465af74b1c9a546af45a0d1eea33c93537e0c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Manage prefix on CAN and OBD2 prefix. Searching signalsRomain Forlot7-50/+55
is made on generic_name (without prefix) and returned vector of string is filled with name with prefix. Then you can process on them based upon their name differently. OBD2 signals will generated recurring request on diagnostic manager and decoding will not be handled the same way too. Change-Id: I2c5239ef49661941a0a748debe0bd536b2954b3a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Remove uneeded define as it was already present in uds.hRomain Forlot2-5/+0
Change-Id: I04091b35ec072e9c19f5af0689ed89db0d5070bd Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Instead of a global pointer, config is now a Singleton.Romain Forlot7-18/+20
Change-Id: I0cfc34f330c531ba5f070542a1cb723be4bcc70a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Also initialize the id_ renamed address_ member. This memberRomain Forlot3-7/+6
is mapped to the address node from json Change-Id: Ied13067723552c2396337a9f85fe5e1418ba8caf Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Keep raw pointer for now as we have to move them around vector.Romain Forlot4-64/+81
Change-Id: I8a518540b54552d60c6fd1054a0fc41dda5400b4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Finalize the class active_diag... to get it compile.Romain Forlot4-36/+43
Fix subsequents bugs into the other depending class diagnostic manager Change-Id: I8920c489fc15a61a36ff29d58aab59c2e6388f85 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Change also where wgt file is since we build into a subdirectoryRomain Forlot1-2/+2
Change-Id: I8cf568292035f1e8fd73d41ed91d5bd7d9d7c512 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Adding requests to diagnostic manager implemented.Romain Forlot4-40/+313
Needed overload of operator and constructor set for active_diagnostic_message_t class. Without we can't make the basic operation needed by the manager. Get rid of original raw pointer on "entry" which avoid some tests. It miss the acceptance filters implementations for now. Change-Id: I1ca61ff843c13255af6d9a60ce72a8b8bc9d1c18 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Adding needed getter for diagnostic manager. UsefulRomain Forlot2-0/+7
to determine if both object use the same CAN bus device Change-Id: I97dbf807198a420c305c8fbbd2cb4bfcdda4c294 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Adding needed function to get some time handle on requestRomain Forlot2-5/+51
for diagnostic at first. Change-Id: I3ab966d6386bad52f68ebdbea723bb7507cfaf2a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Fix: include statement with wrong path.Romain Forlot13-37/+47
And minor fixes. Change-Id: Ica55c0708edd86d0aa37e7117b3c3fad551a0167 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Added constructor to get vector initialized with defaultRomain Forlot4-36/+92
objects initialized that can be grabed after at runtime. Don't know the impact on performance for now about maximum limit. Change-Id: I220614d479b8254ae0efda66380e96434bcbfbb2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16separation to a new file of can_message_set_tLoïc Collignon3-21/+84
Change-Id: If21021d8905d40d443d4432faeb38f8a3275697c Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
2017-03-16Change FrequencyClock struct to class and rename it.Romain Forlot5-15/+25
Change-Id: I1076ad90e14815f3d0ab71ca9fa359d1d3c1748d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16fixed CMakeLists.txtLoïc Collignon1-5/+1
Change-Id: I62069f71b53a7a0e2131ca92834a9a85995308a7 Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
2017-03-16Fix: wrong tested variable for socket.Romain Forlot1-2/+3
Change-Id: Ice2325441474f1a075140e13dfffa0261106dff7 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16C Header firstRomain Forlot1-1/+1
Change-Id: Ief8c66e99c689a362b645ad3b918d8b342ada59a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Add necessary to be able to initialize diagnostic manager shims.Romain Forlot4-9/+23
We have to conform to functions signatures from isotp-c to have it working. Change-Id: I429def66f54e53277e87aa99e66292cdb47c1c5f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Reorder to fix warning at compilationRomain Forlot1-1/+1
Change-Id: I1e558720318d9251ddfbbf6bb66a0461aef98e4c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Changing to a raw pointer can_bus_dev member and addRomain Forlot2-2/+7
a default constructor. It is needed to initialize configuration_t correctly as it allocate a diagnostic manager but do not initialize it unless it is needed later. There is no need to initialize it if we do not send and receive diagnostic requests. Change-Id: I3d52d1ea92454e7b065479a2f0dd54a291ddd991 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Fix: wrong signature due to reference discarding "const".Romain Forlot2-23/+26
Change-Id: I7dada9d01eb8619c3807647b6df378dd147bb7fb Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Fix: bugs in class due to the wrapping of C socketRomain Forlot2-7/+8
into a class. Added missing include and adjust methods signature. Change-Id: Id016b452e0b641a14482c288e4713acae941ee1d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>