aboutsummaryrefslogtreecommitdiffstats
path: root/low-can-binding
AgeCommit message (Collapse)AuthorFilesLines
2019-02-06Add fake can data for dashboardzheng_wenlong1-0/+156
Add these fake can data. We want to modify dashboard, let is show more information. accelerator.pedal.position steering.wheel.angle transmission.gearinfo transmission.mode turnsignal.status lightstatus.brake parking.brake.status Change-Id: Ief9f29684f3463af0d0f98f1dd213b633d1889bb Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
2018-12-14Smalls improvementsRomain Forlot5-8/+21
- 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-14Simpler handling of binding subscriptionsRomain Forlot8-494/+474
Don't use a child class for subscription, only use one because there isn't other different subscriptions type to be implemented about now and if so then we could split again. Remove functions no longer useful and move afb events and afb subscriptions part to low-can-subscription Change-Id: Ie3e4255961ac557465098cdb48730098a950461a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-12-14Cleaning the code for now unused functionsRomain Forlot12-176/+23
Also formating and retabulating some comments Change-Id: I95eda93e78fabeb336ca02e94307364954ab2318 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-12-14CAN FD implementationRomain Forlot13-233/+187
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-11-22Rework writing CAN message on CAN buses.Romain Forlot1-79/+64
- Adds the possibility to use a custom encoder function - Use of wrap_json functions instead of raw json-c functions - Return the error informations in the request return. - Reduce conditionnal imbrication Bug-AGL: SPEC-1965 Change-Id: I766b3cf3e6998d03a8a2f3e51117e8b26fc9b56f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-11-22Use newly generated cpp file with default encodersRomain Forlot1-0/+1
Change-Id: I7bf15568a16e0c84c4f590ca07eba48ecd34157f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-11-22Handle several can_frame in a BCM messageRomain Forlot2-31/+2
Also clean an unused function Change-Id: I4faabf5a1af53da898ee70f2bc4b528acea3ded3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-11-22Adds a new function to build from a json_object.Romain Forlot2-0/+27
Build an openxc_DynamicField from a json_object. Change-Id: I57033daca5fd4f198b872f015255893d9f8f9303 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-11-22Adjust "encoder" signature to fit cpp usageRomain Forlot1-2/+2
Adjust "encoder" signature to fit cpp usage like for the decoder functions. Change-Id: I5872c5e32fd69356124fefbc82fd1f77ab8acbf4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-11-22Code format and style changesRomain Forlot2-7/+7
Change-Id: Icfb7cdb53deba8d82b91f884c6b815adf0f17adf Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-11-20Added afb-helpers submoduleRomain Forlot1-2/+3
Use the afb helpers lib to be able to use wrap_json functions. Change-Id: I3a66ac4eb7d80ff921de13a7e749311d33f0572e Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-10-15Migration to binding v3Romain Forlot9-54/+50
Change-Id: I0bcccb15200064bd7d83edbf06c1e7202069189a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-23Cleaning, set up binding version in config.cmakeflounder_5.99.6flounder_5.99.5flounder_5.99.4flounder/5.99.6flounder/5.99.5flounder/5.99.45.99.65.99.55.99.4Romain Forlot3-46/+0
Change-Id: I2e8d89b09982c9f3770a5a3e10d281e0ad87651c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-27Updated examples files and default configurationRomain Forlot1-6/+6
Let use the new decoder's function and set some hvac signals as writable to be able to test this feature. Change-Id: I27e1c2be069b8bb55ed931ad1fb629aa2d4e5b86 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-25Remove generated files from git repoRomain Forlot1-130/+0
This files is generated by afb-genskel tools at build time. Having it in the repo could make some unwanted side effects. Change-Id: Ib5c6b010fe56245694fe267aca0548575b6e063b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-09Add testssandbox/excale/wipRomain Forlot2-51/+51
Create first tests to be used with afb-test binding The test binding is now found using pkg-config command. Change-Id: Ib1cd08236b6b8fab93ccb67ac613a9c83908d12e Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-06Fix: correctly stop the binding.Romain Forlot2-2/+13
Automatically destroying C++ objects wasn't sufficient since it uses thread with locks that were waiting forever if there is no CAN bus activity. Now correctly wake-up the threads to ends them even if there without activity on the CAN bus. Change-Id: I69d74a34a8dbea4df7c8090aa47abf1c43133020 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-05-25Merge "Fixing typos made in comments"flounder_5.99.1flounder/5.99.15.99.1Jan-Simon Moeller16-74/+74
2018-05-24Fixing typos made in commentsydimitrov16-74/+74
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-05-16Fix compilation warningRomain Forlot1-1/+1
Change-Id: I3ea7b3aa91d4251f90a4ccf5da83ae8de7a58db4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-04-17Detect engine state and use it during diagnostic messages subscriptionsJonathan Aillet3-3/+86
Get engine state recurringly by requesting a permanent diagnostic messages request. Use these information to warn that diagnostic request won't have any responses at the moment of subscription if engine is off. Bug-AGL: SPEC-1347 Change-Id: If8bd79bba89acd1c8f5452d3efdbf00a89f8cc77 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-04-17Add possibility to subscribe to a recurring request permanentlyJonathan Aillet5-14/+34
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 Aillet5-33/+142
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-04-09Correct errors in commentsJonathan Aillet3-3/+3
Change-Id: I1e02bdfe2473e776e35694b883f084077227853c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-03-23Fix name to fit rename of git repository.Romain Forlot1-1/+1
Bug-AGL: SPEC-1276 Change-Id: I279620c1be00db03f06f6dd882b3b579c80480c4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-03-15Change subscribed signals search to check filters as wellJonathan Aillet4-7/+15
When a new subscription is made, search in existing subscription for a combination of a signal and a filter instead of searching for just a signal. In this way, each subscription will receive signals according to their requesting filter. Bug-AGL: SPEC-1339 Change-Id: I22cb96a2dbaaf48dbd77025ff1610bde151b19b4 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-03-14Delete obsolete references.Jonathan Aillet4-33/+14
Delete obsolote references such as use of acceptance filters, timers, etc. Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-01-02Make low-can use afb-genskel by defaultRomain Forlot11-63/+38
Cleaning header file inclusion Change-Id: Ic0dd9637ecd491692bd4b8b39e9602e85498c0a9 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-21Code enhancements mem leaks and uninitialized byteRomain Forlot2-0/+14
Change-Id: I40632b6212118278f5877957a480122e9383e3bc Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-07Initialize struct to avoid unexpected behaviorRomain Forlot1-2/+4
Change-Id: I8c160b427f0844e9bc6c7e65fb48cd122160bc65 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-11-30Fails write request if CAN signal not writableRomain Forlot1-1/+4
Change-Id: I8d75a232ba7fad9cc95f286e521c2451a3a29061 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-11-30Fix permission labelRomain Forlot1-2/+2
Change-Id: I1c7299bdf9ff024f676b88860c8d31076f6806e0 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-11-30Correctly reconstituting entire CAN frameRomain Forlot1-5/+6
Change-Id: I39d226c6f6268ec880739e6b9230eb42ce475971 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-11-08Send entire CAN message rather than CAN signal.Romain Forlot1-7/+13
Old behavior send only the CAN signal, now we retrieve the CAN message value instead and send the CAN message with all CAN signals composing the message. Change-Id: I2394cc30630601e46aa939ddda88e8616372179e Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-11-08Fix wrong filter condition (Thanks Parai Wang)Romain Forlot1-1/+1
Change-Id: I7d3eccc2d4b99d543b669c7b3c8d7a38670d860f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-10-19Make write permission use the same name everywhereRomain Forlot3-100/+3
Confusion made with permission generated and legacy one which weren't the same. Removing unused source file Change-Id: I74f70b45358c052049ff84b872c0381915e27344 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-09-28Add timestamp to diagnostic message event tooRomain Forlot2-1/+3
Change-Id: Id01a15efe1b6aa063ac9bb2d3989ff195035eeb0 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-09-28Use afb_genskel tools to generate api definitionRomain Forlot4-3/+161
Generated files hand fixed because of usage of C++ which has to use c++ binding function afb::auth to add afb_auth struct Change-Id: I80ee9cb751cc813754c949d8746aec197da6d52f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-09-28Handle batched subscriptions in a JSON arrayRomain Forlot1-22/+30
Change-Id: I33ade46eaf022a5c7e7cf874f8b838a4a6827f87 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-09-19Documents new verb: get, list and write for EELRomain Forlot1-0/+20
Change-Id: Id03f6363c5d452db43c696e045caaefad0916dc6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-09-13Add timestamp val to returned json object on eventRomain Forlot3-4/+29
Change-Id: Ibfb514eb27c0378dba7e302755e5f6f95b0ca242 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-09-01Add get() and list() APIYuichi Kusakabe3-0/+114
This patch is porting AMB get() and list() API. Change-Id: Ic1d391219f1d64ab127bc1977a5b198abe0fc94b Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
2017-09-01Fix can write API resultYuichi Kusakabe1-2/+2
write_raw_frame() and write_signal() return results. Change-Id: I3f6d03eaf02bde9ad02fd8de912c5816d249570f Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
2017-09-01Fix write CAN bus nameYuichi Kusakabe1-1/+1
This patch is low-can write device use /dev/dev-mapping device name. Change-Id: I165bdbd37a4e988b85f6ad7a669e6b1306957d45 Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
2017-09-01Install step created by app-templates submoduleRomain Forlot1-4/+0
Change-Id: Iaaf81d6700b09c5a40446df41435a02e198ee3e0 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-08-23Finalize JSON OPENapi definition fileRomain Forlot1-8/+3
Change-Id: Ic346c408c938aad39fbea387af4224c14d8a727c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-08-09FormatRomain Forlot1-7/+28
Change-Id: I995fa8af8e8fc330f07b9609129723c09e0b13bf Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-08-09Improve debugging diag and empty eventRomain Forlot1-0/+4
Change-Id: I64dd5b3f241a9696dc759dffff884772e3f72fd7 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-07-25First draft API definition for Appfw Genskel.Romain Forlot1-0/+207
Change-Id: I3547560ebfa0fbc484bf411ce7c08011db6f64b1 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>