summaryrefslogtreecommitdiffstats
path: root/low-can-binding/binding
AgeCommit message (Collapse)AuthorFilesLines
2021-01-11Restore /etc/dev-mapping.conf supportneedlefish_13.93.0needlefish/13.93.0marlin_12.93.0marlin_12.92.0marlin_12.91.0marlin_12.90.1marlin_12.90.0marlin/12.93.0marlin/12.92.0marlin/12.91.0marlin/12.90.1marlin/12.90.0lamprey_11.92.0lamprey_11.91.0lamprey/11.92.0lamprey/11.91.0koi_10.93.0koi_10.92.0koi/10.93.0koi/10.92.013.93.012.93.012.92.012.91.012.90.112.90.011.92.011.91.010.93.010.92.0Scott Murray1-14/+67
Add back the ini-config and config-parser code that existed previously, and use it in binding init to over-ride the device mapping from the controller JSON if /etc/dev-mapping.conf exists. This restores the documented behavior, and is needed for the existing AGL demo platform support and soon CI. Additionally: - Add code to validate the active_message_set, diagnostic_bus, and bus device mapping configuration values. - The above required moving plugin loading before the configuration callback in the controller configuration, but this change seems rational in that everything required by the generated plugin code is already initialized before then, and it makes validating the configuration possible without adding an extra callback. - Add logging of the used CAN bus to device mappings at info level to ease debugging any future issues. - Tweak the log level of the missing configuration file message to info from error, since it is a legitimate mode of operation if relying on the default bus values in the controller JSON. Bug-AGL: SPEC-3755 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I440f5e0fc85be41f7c4c1f47d824a403525a18f9
2020-01-23low-can: fix aborting on can_data not being an json_type_arrayicefish_8.99.5icefish/8.99.58.99.5Matt Ranostay1-1/+3
Bug-AGL: SPEC-3129 Change-Id: I41928c5f4c467edb176ad6234c9b775e70035319 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
2020-01-23low-can: fix returned event_t from generate_filter() uninitializedMatt Ranostay1-1/+1
Bug-AGL: SPEC-3129 Change-Id: I003a98863b78b49e85638bbb7e9b0d0fbde5a2b7 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
2020-01-22low-can-apidef: Fix typo in permissionJose Bollo1-1/+1
The space at the end is not expected! Bug-AGL: SPEC-3115 Change-Id: I8c87e4827dc697d0605131a4f9e7f4720bf7cec4 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2020-01-09get verb: add option idClément Bénier1-0/+61
can be called with json value: - a string matching can id - an array matching can ids Change-Id: Ia38728e065348e265613643fc934eb985564b722 Signed-off-by: Clément Bénier <clement.benier@iot.bzh> Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09can-bus: process signal rework to subscribe messageArthur Guyader1-8/+18
This commits allows to subscribe message and have all signals in one frame. Change-Id: I95de0e46b30be09a47a04754266cb55650eeec31 Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh> Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09can_decoder : Move frame swap to only do it one timeArthur Guyader1-0/+4
This commit allows to swap only one time a data message. Change-Id: I566c6ad72e266cd59a4397ab1a5ef423d752cf75 Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh> Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09low_can_subscription: Add msg_def and create_rx for messageArthur Guyader2-1/+43
This commit adds message_definition variable to subscribe to message and not signals. And the function that init rx_filter for message. Also patch the error message Change-Id: I98b0b4dc8fec6ccef6e103fcb8aae136f708aa16 Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh> Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09format: remove uneeded brackets.Romain Forlot3-60/+5
Change-Id: I0689d62e32b9b60059adc2d4be78fa3b2581441c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09j1939: Follow updates of the kernelArthur GUYADER3-8/+26
This commit patch j1939 feature after the update of the kernel from linux-can-next to mainline. Now promisc option removes filter of the bind. The option is now a parameter in the event_filter. The feature recv_own isn't available, you can't receive on the same socket an emit frame from you. Not a big problem because receive and send method use two different sockets in the implementation. Change-Id: I5ac410177c1512090827870300b8aa1679477b84 Signed-off-by: Arthur GUYADER <arthur.guyader@iot.bzh> Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09diag_mngr: No diagnostic msg if no diagnostic_busRomain Forlot2-4/+7
Change-Id: I840fc6cc7e9cfd171b03cac508fedb8ece4b976d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09low-can-cb: Little optiRomain Forlot1-4/+2
Change-Id: I6f3e84700563fc60e643d770365c98342214bedd Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09diag-mngr: Fix sending and change initRomain Forlot1-17/+16
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-09all: format typoRomain Forlot1-1/+3
Bug-AGL: SPEC-2988 Change-Id: I81c01a817cd31d577068350d8445a1df2751bff7 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09init: Improve error message when not finding config fileRomain Forlot1-1/+1
Bug-AGL: SPEC-2988 Change-Id: I9a9dec6e577881bbd784bcae1d17ddb244d94599 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09low-can: Fix init failing when using without J1939Romain Forlot1-1/+1
Return variable was initialized to 1 instead of 0 and without using J1939 this variable isn't reaffected and so the final test fails. Bug-AGL: SPEC-2386 Change-Id: I53b7cd757b3b344d66ab18ba9795284105cbcfcc Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09apidef: fix no preinit defined.Romain Forlot1-1/+1
This commit fixes the binding initialization by specifying a preinit function that parse and load the controller configuration Bug-AGL: SPEC-2988 Change-Id: I040c401fa2818d056a61a2858829bc4db2cffece Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09init: Fix wrong diagnostic bus name returned.Romain Forlot1-1/+1
We use the bus name which isn't correct because it isn't the device name. Bug-AGL: SPEC-2988 Change-Id: I5c9313817a3f3d423f8934cfab03e2cf20d48af2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09all: formatRomain Forlot2-11/+2
Remove unecessary brackets and replace if possible if...else by ternary operator. Bug-AGL: SPEC-2991 Change-Id: Ibe46b83dea976e050b9cd9eb7ee7ab2c33b63905 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09low-can-hat: improve formatRomain Forlot1-2/+2
Weird way test to make test are now fixed to be more readable. Bug-AGL: SPEC-2988 Change-Id: I81d716ac3799c4217e720a13d8ba78a46996a2c3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09low-can-cb: improve readabilityRomain Forlot1-11/+6
Just make thing more readable by define variables at the beginning of functions. And directly assign them if possible. Also improve format using the same format than in the rest of the project. Bug-AGL: SPEC-2932 Change-Id: I5cc7685b80734d0eb43a29fc06b2a8434f3469fa Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09can-bus: Use configuration from JSON fileRomain Forlot2-1/+12
Use configuration from JSON file instead of the old INI file. Now all configuration files lies within the binding tree. Bug-AGL: SPEC-2988 Change-Id: Id986d19751db958ad5cf3b7f2b2c5443d4ceb062 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09fix: missing include to find find_if functionRomain Forlot1-0/+1
Change-Id: I099b951011442ffaebf75a319236a39553999a41 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09message: More explicit define about CAN protocols.Romain Forlot2-9/+9
Change a bit CAN binding define about used protocol. There was a mistake about BCM define which isn't a protocol at all but a maner to filter and retrieve CAN message through SocketCAN. Also FD_FRAME was using the same name than SocketCAN which isn't a good idea, better to distinguis both of them. Bug-AGL: SPEC-2988 Change-Id: I255fa03029c7d5f90a33448e5e7692d8c249279b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09low-can-cb: Mark the end of the CtlSections arrayRomain Forlot1-1/+4
Bug-AGL: SPEC-2988 Change-Id: I433f4f699f3234fc07fcd909cd6b77b84e447ad7 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09converter: littles improvements.Romain Forlot1-1/+1
Bug-AGL: SPEC-2988 Change-Id: I9198835b96c66c140f8b1d4167828302b9dc4959 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09application: Add dedicated function to set parentsRomain Forlot2-15/+18
Bug-AGL: SPEC-2988 Change-Id: Iedd493b9e4043290dae0aa9d1d94a3d9179525ae Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09low-can-cb: Retrieve application from external controller dataRomain Forlot1-5/+4
Bug-AGL: SPEC-2988 Change-Id: Iaa55b00539b1435b00fe076918d5eda5eeb5db30 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09hat: Move some binding functions into the hatRomain Forlot2-1/+89
This is needed to move using a splitted binding/library model to have plugins linked to the lib as well as the binding to get there symbols Bug-AGL: SPEC-2988 Change-Id: I3a9f616078bc7fa9317995ec4300ee2b61aa4b08 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09binding: add preinit function to load the configRomain Forlot4-72/+86
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-09All: Make format coherent with the whole projectRomain Forlot5-23/+23
Add a space after a comma Change some aligments Bug-AGL: SPEC-2988 Change-Id: I5069120f4bbb33742bb4990e2e1f391ec8d5eeb6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09message_set: typedef long type signatureRomain Forlot1-1/+1
Convert two long types using typedef to get shorter one Bug-AGL: SPEC-2988 Change-Id: I9f5612def1bce512516a6e1a45711486368bbc51 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-09controller: Prepare project ot use the ControllerArthur Guyader3-864/+43
Initialize an empty message_set to fill later when loading the Plugins Add the required method to be able to add a message_set Bug-AGL: SPEC-2988 Change-Id: I1dc784648f69832de8681184adaccbf5300f831d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-08j1939: don't process signals using same busRomain Forlot1-6/+8
Bug-AGL: SPEC-2991 Change-Id: I8733a35e4f9cb3d0f2fce818b55a010fec19dc66 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-08all: Format one line 'if' or 'for' statement.Romain Forlot2-93/+26
Bug-AGL: SPEC-2988 Change-Id: Ic3b9670a2ce9e982220c54f3632f690ee4eea686 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-08app-generated: update for generated steering wheelRomain Forlot1-276/+2
Change-Id: I8af34595e4ea4d72af726c6c5db3ac05dda85bf2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-08subscription: Optimizing opening socketsRomain Forlot2-30/+22
Also review some aligment and make more space between bool ops Bug-AGL: SPEC-2988 Change-Id: I613f294a630caf48eea7bb0c7b9c36b07cbacfbf Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2020-01-08can: clean and formatRomain Forlot1-48/+31
Little optimization in create_rx_filter_can function and make format coherent on bit operations. Bug-AGL: SPEC-2988 Change-Id: Ic9c53ba4c937604bbf3500ee89c7b5a5dbca7cfd Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-06Change example message 0x3D9 back to non-FDicefish_8.99.4icefish_8.99.3icefish_8.99.2icefish/8.99.4icefish/8.99.3icefish/8.99.28.99.48.99.38.99.2Scott Murray1-1/+1
Update agl-vcar example definition to change message 0x3D9 back to regular CAN so it will be usable on non-FD capable hardware again. Bug-AGL: SPEC-3012 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I74064c5a8f4111f8f774104d27b86c8f15451539 (cherry picked from commit 12e75ea716e1b5054be0228e2859e14a11be622a)
2019-12-03Update steering wheel LIN message definitionScott Murray1-1/+1
The steering wheel LIN message does not work in low-can after it has been updated to include commit "Update function rx_filter_can for multi frame prevision." (59bffa4 in master, a41ee0d in halibut), due to the length value now being required in the message definition. The length has been added to the definition for agl-vcar and the application-generated.cpp files regenerated. As well, the new J1939 and FD flags have been added to the message definition for consistency. Bug-AGL: SPEC-2951 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: Ice079268827dfbb2bf2c79b6c5e897dcab8fc433
2019-11-20Add steering wheel LIN message signal definitionsicefish_8.99.1icefish/8.99.18.99.1Scott Murray1-995/+248
Add signal definitions for the button status information in the steering wheel demo LIN message. Bug-AGL: SPEC-2951 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: Id4909161f8f159858a3d29e310a3b43a787f2d03
2019-09-09Update documentationArthur Guyader1-1/+1
Bug-AGL : SPEC-2779 Change-Id: I461f7e32322faba7e822791ff2e3851039e03548 Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
2019-08-30Remove file socketcan-j1939 that was not removed beforeArthur Guyader3-2/+128
Bug-AGL : SPEC-2780 Change-Id: I4ddf9389faffebe0334b0004b69bb7336277c29d Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
2019-08-30Remove in function rx_filter_can, the variable val was not usedArthur Guyader1-1/+0
Bug-AGL : SPEC-2780 Change-Id: Ifce6e67fd55699d088952b0f722694d211ec7398 Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
2019-08-30Add some typedef to reduce the size of the linesArthur Guyader6-22/+25
Bug-AGL : SPEC-2779 Change-Id: Iebcf7492133cd7789d301593ff999b24ae10a054 Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
2019-08-30Change vector to list to allow to remove signal.Arthur Guyader1-8/+24
This commit allows to remove signals. We need that because subscription to an iso tp message needs to be individual. Bug-AGL : SPEC-2779 Change-Id: I1d6410ebfc8ea82d33addf1bb828d9cd810b006a Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
2019-08-30Add feature ISO TP (multi frames and peer to peer)Arthur Guyader4-43/+382
This commit adds the ISO TP feature. The ISO TP protocol allows to communicate between two ECU. The protocol allows multi packets management. Bug-AGL : SPEC-2779 Change-Id: Ic222615b547f28e926930e6c1dea2c0265055afd Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
2019-08-30Replace all enum types with masksArthur Guyader4-69/+72
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-30Update function tx_send for multi frame previsionArthur Guyader1-7/+30
Bug-AGL : SPEC-2779 Change-Id: Ib0b04fe3648c5b83c23327431e21161b6b2489b6 Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
2019-08-30Only defined signals can be writtenArthur Guyader1-26/+59
This commits ensure that only known signals could be written using the binding's api. Before that you was able to wrote raw frames on the CAN bus without any checks if this was a known signals to the binding. Bug-AGL : SPEC-2779 Change-Id: Ied6680e926f2a9c221fee31d8fb78d2d39c41132 Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>