aboutsummaryrefslogtreecommitdiffstats
path: root/low-can-binding/diagnostic/diagnostic-manager.cpp
AgeCommit message (Collapse)AuthorFilesLines
2020-01-09diag-mngr: Fix sending and change initRomain Forlot1-0/+7
This commit fix the wrong bcm ival1 value set because the struct hasn't been initialized so it use a wrong value that can not be handled by the socket. Initialize diagnotstic manager depending on JSON configuration file This avoid to request engine_speed signal when there isn't any diagnostic_bus configured in the JSON file. Change-Id: I98145a6e20c29a644c856d818f104c6bd8069f9f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09binding: add preinit function to load the configRomain Forlot1-8/+11
Make as the others bindings using controller and load its configuration file at preinit step. diagnostic-manager: Change way to initialize the diag bus This was kind of hardcoded and now, it is initialized by a configuration key of the controller configuration JSON file. Bug-AGL: SPEC-2988 Change-Id: I344c1982893e47600a0b8cd03542de8069a42d24 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-08all: Format one line 'if' or 'for' statement.Romain Forlot1-6/+2
Bug-AGL: SPEC-2988 Change-Id: Ic3b9670a2ce9e982220c54f3632f690ee4eea686 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-08can: Remove extended flagsRomain Forlot1-1/+1
It doesn't matters to know whether or not a can signal is using standard or extended CAN ID because this could be retrieved using bit mask on the CAN ID when receiving and sending. Bug-AGL: SPEC-2988 Change-Id: Id96c576045bf087df51beb011742ad631336f814 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-08-30Replace all enum types with masksArthur Guyader1-1/+1
This commit allows to change all enum types by masks. Now to implement new protocol you don't need to add more attribute in class. All can be contained in the flags field. Bug-AGL : SPEC-2779 Change-Id: I814d0052139be5d5efefc9ff1b4b558f46b85e90 Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
2019-08-12Add feature to build messages and fix some functionsArthur Guyader1-3/+3
Allows to build a message (J1939,BCM) with a signal and a value. Bug-AGL: SPEC-2386 Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh> Change-Id: Iadca13a927ff83f713f39da441c88356695a1285
2019-06-27Minor improvementsRomain Forlot1-1/+1
- Remove now unused forward declaration of active_diagnostic_request_t - Factorize calling the signals_manager at binding initialization. - retab... Bug-AGL: SPEC-2386 Change-Id: I418fddd80ef8b856c198dc697760a6edf0918012 Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh> Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-06-26Rename some of the classes removing can- prefixRomain Forlot1-1/+1
This commit renames files and classes : - can_message_definition_t -> message_definition_t - can_message_set_t -> message_set_t - can_signals_t -> signals_t This prepares the implementation of j1939 protocol. Bug-AGL: SPEC-2386 Change-Id: Ie3ee4f25c236c861b92eb12a56fa03a5a9afffbb Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh> Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh> Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-06-26Change can_message_t class usage for new j1939Romain Forlot1-11/+19
This commit transforms the class can_message_t as the base class and creates two derived classes: j1939_message_t and can_message_t. Bug-AGL: SPEC-2386 Change-Id: I6d3afd8e4f5abff2cd0ec4e9910bd52a2893de76 Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh> Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh> Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-06-26Implement a new socket type CAN for j1939 protocolArthur Guyader1-1/+1
This commit implements a new socket class for the j1939 protocol and prepares the bases classes by modifying the write and read methods. Bug-AGL: SPEC-2386 Change-Id: I16ba493418a4bb37a0262b61a2a2629be6ab5051 Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh> Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh> Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-05-17Fix: double free issuehalibut_7.99.1halibut/7.99.17.99.1Romain Forlot1-2/+0
handle is already freed during the active_diagnostic_request destruction. Bug-AGL: SPEC-2415 Change-Id: Ia26d5c9d2974ca34d411c3182b218141a84c8f21 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-12-14Smalls improvementsRomain Forlot1-0/+2
- Improve robustness reading a BCM socket Adding checks on system calls and remove the initialization of the struct that will hold the received message, not so much needed in that case. - More accurate log message at subscription/unsubscription step whether this is a FD CAN messages or not and if this a subscription or an unsubscription that is requested. - Initialize the full struct of vehicle message to avoid memory warning about conditionnal jump based on uninitialized bytes. - Memleak: Free raw pointer on active diagnostic requests Change-Id: I4bbf4d851c0fa1efdb6fa6034fac3d1dcafa1a73 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-12-14Cleaning the code for now unused functionsRomain Forlot1-2/+2
Also formating and retabulating some comments Change-Id: I95eda93e78fabeb336ca02e94307364954ab2318 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-12-14CAN FD implementationRomain Forlot1-10/+9
Add a flag to CAN message definitions which set the message as using FD protocol if true. Use a new generated file with the new FD flag field on the message definitions. Change BCM socket "struct" using an union to store the CAN frames either using the FD struct or the classic non FD struct. A BCM socket can only one frame type once configured. Use as much as possible the "struct canfd_frame" in the binding and only make a difference before writing or reading the socket. From a memory point of view both struct are identical and only the last member differ and could hold more data with messages of 64 bytes long. So the canfd_frame is compatible with the can_frame and can be differentiated by a flag set in the can_id member. Remove now unused code processing can_frame. Keep the diagnostic manager using the classic CAN frame. Set the maximum number of frames that a BCM socket can handle to 257. Bug-AGL: SPEC-1980 Change-Id: Ifcc041281ea6745fc25cbd384743761f4446f489 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-05-24Fixing typos made in commentsydimitrov1-2/+2
This change set fixes the comments made by previous contributors v2: Fix line end v3: Making changes to comments as suggested by reviewers v4: Removing trailing spaces v5: Clearing small typo in low-can-cb.cpp on line 142 Change-Id: Ifbcfc3b2d131d1db0b25e472955b21e98cc09f45 Signed-off-by: ydimitrov <y.dimitrov.14@gmail.com>
2018-04-17Add possibility to subscribe to a recurring request permanentlyJonathan Aillet1-3/+3
Add possibility to subscribe to a recurring request that won't be deleted when no subscriber is detected. For now, this functionnality is implemented for internal use only. Bug-AGL: SPEC-1347 Change-Id: I48f6f647677596ba7920c4348d5406ea7bf1081b Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-04-17Add saving of diagnostic messages informationJonathan Aillet1-4/+20
Add saving of diagnostic messages receive state, last value, and timestamp associated to it. Add methods to get/set these information. Add initialisation for added atributes. Add boolean to set receive state at initialisation. Generate all 'diagnostic-message.cpp' containing diagnostic messages to add receive state initialisation. Bug-AGL: SPEC-1347 Change-Id: Iee82ca3b5f79fd267717ae074d5456b8cbc1c377 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-03-14Delete obsolete references.Jonathan Aillet1-23/+14
Delete obsolote references such as use of acceptance filters, timers, etc. Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2017-12-21Code enhancements mem leaks and uninitialized byteRomain Forlot1-0/+13
Change-Id: I40632b6212118278f5877957a480122e9383e3bc Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-07-21FormatRomain Forlot1-6/+6
Change-Id: I036befbfb38b01d046d35a1364c28e0835dcbd41 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-07-04DAB RC3 Fixes follows appfw API break.Romain Forlot1-12/+12
Following functions now return 0 on success and negative value on failure : o afb_req_subcall o afb_req_subcall_sync o afb_service_call o afb_service_call_sync Verbosity macros used in v2 bindings now needs to be prefixed with AFB_ (ERROR -> AFB_ERROR) Change-Id: Ica4346f215bb142fcda0c6ea15e7074f7091f4cc Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-06-20Separation Generator to a dedicated repoRomain Forlot1-0/+508
Change-Id: Id94831651c3266861435272a6e36c7884bef2c45 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-14Change directory architecture to use 2 separated projects.Romain Forlot1-618/+0
Each projects, binder and generator, has to be compiled separatly. CAN-binder will host high and low level binding CAN-config-generator only the generator used for low level binding. build.sh script just launch both build in their respective dir. Change-Id: Ic77932660fcca507b23a631d4e4e790f608880ae Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-11Handle project new architecture using new CMakeFileRomain Forlot1-0/+618
Change-Id: I672a9b49d9d5a3953ba6dccaafbbd738839f64a6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh> # Conflicts: # low-can-binding/libs/bitfield-c # low-can-binding/libs/isotp-c # low-can-binding/libs/openxc-message-format