summaryrefslogtreecommitdiffstats
path: root/low-can-binding/binding
AgeCommit message (Collapse)AuthorFilesLines
2018-12-14Simpler handling of binding subscriptionsRomain Forlot7-493/+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 Forlot1-3/+1
Also formating and retabulating some comments Change-Id: I95eda93e78fabeb336ca02e94307364954ab2318 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-12-14CAN FD implementationRomain Forlot4-71/+125
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-10-15Migration to binding v3Romain Forlot6-51/+47
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 Forlot1-1/+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-05-25Merge "Fixing typos made in comments"flounder_5.99.1flounder/5.99.15.99.1Jan-Simon Moeller5-43/+43
2018-05-24Fixing typos made in commentsydimitrov5-43/+43
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 Aillet1-8/+17
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-21/+42
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-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 Aillet3-5/+13
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 Aillet1-4/+0
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 Forlot6-58/+36
Cleaning header file inclusion Change-Id: Ic0dd9637ecd491692bd4b8b39e9602e85498c0a9 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-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-28Use afb_genskel tools to generate api definitionRomain Forlot3-2/+160
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-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-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>
2017-07-21Examples reorganizationRomain Forlot1-1/+77
Separated by protocols and created signals from reversed engineered signals. Meld all used signals into an "agl-vcar" folder to be used as default. Change-Id: I27f7bc227a6fcea3db6672819e6a4d7bbf09863b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-07-21FormatRomain Forlot3-4/+4
Change-Id: I036befbfb38b01d046d35a1364c28e0835dcbd41 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-07-21Check whether a signal is writable before sendingRomain Forlot1-3/+8
Change-Id: Id04d04a07e43738f7379e33fa7c6022eaa426343 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-07-21Split big function to several smallerRomain Forlot3-47/+75
Change-Id: I070fdafd51e789eb37b963a100b57cae9dff3e25 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-07-21Handle object without signal, only a busRomain Forlot2-3/+28
To be able to send or receive message on bus without depending upon on a signals, this is adds opening socket just with a bus_name if provided. Also handle send a frame on bus depending on a signal or not. Change-Id: I3a60a03a2d36db4db14b9ae90eefc4bbc8f21e32 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-07-21Be able to write raw frame & encode value to sentRomain Forlot1-30/+64
Check whether the argument is a raw frame or a Signal + Value to encode then send. 1 new class to handle encoding part of a value as well as a new method for can_signal_t which return index of a map from its value. Change-Id: I288d2aeec28ce74c9ca35750db18557c9251e1df Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-07-21Create an auth verb to raise privilege of sessionRomain Forlot3-2/+19
Simply raise to a LOA of 1 the current session if asked Need to add some checks to not allow anyone raise its session must hold a specific permission urn:AGL:permission::platform:can:write to be able to authenticate. Change-Id: Id4e01ca20ba8437e97a64db682fdd3ebf45ce7b4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-07-21Signal isn't required so now have a default valueRomain Forlot1-1/+1
We could want to send a message through the bus not attached to a can_signal_t object in case of complete RAW message Change-Id: I133671f8cdcc52a98c8bde9e343c0dc7edcb366e Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-07-21Cleaning and renaming.Romain Forlot1-11/+11
Change-Id: I24b78e3d41124650da286a50297f1c51410c2c6a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-07-21Implements new verbs to write on CAN busRomain Forlot9-325/+490
This will open a new BCM socket not dedicated to a subscription use to that mean. Change-Id: Idf353015f731e32d6eb7c7856bd73167c66e790f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-07-20Fix subscribe responseRomain Forlot1-1/+4
This patch is "No signal(s) found for %s." return value is ret = -1. Change-Id: Ia6f4f2db13beb7f9d3507d890383fc13cbddac0f Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
2017-07-07Update struct to follow af-binder changes.Romain Forlot1-3/+4
Added an info fields in struct. Change-Id: I93165911c1ceb62c9893fa1c4635088f0df36b3f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-07-04DAB RC3 Fixes follows appfw API break.Romain Forlot2-10/+10
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-22Add some reminder...Romain Forlot1-0/+1
Change-Id: Ifb81989c39f31f73ce7dc7dcbebfc6039f6a6a47 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-06-20Separation Generator to a dedicated repoRomain Forlot8-0/+1614
Change-Id: Id94831651c3266861435272a6e36c7884bef2c45 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>