aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2019-12-03ini-config: remove ini-config libsandbox/claneys/modular-low-canRomain Forlot5-203/+0
No need to use ini-config now that the config is hold by the controller JSON configuration file. Change-Id: If82d22266fb2d592c140b81cda783ee63f1f13be Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03all: format typoRomain Forlot5-9/+7
Change-Id: I81c01a817cd31d577068350d8445a1df2751bff7 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03config: Fix wrong controller configuration file nameRomain Forlot2-0/+53
Change-Id: I6491c1bb4b64d7f005f220e4d2358ce787bf84af Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03Revert "config: Change default configuration file names"Romain Forlot3-52/+4
This reverts commit 49ea87d92a3578c4c1547b094deaaca371816585. Change-Id: I76186166cf2bd6dff0696f26ff30747288fc5478 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03config: Change default configuration file namesRomain Forlot3-5/+29
Default file name doesn't fit when using on a target board because the binder and app-framework choose another processus name than the one chosen manually so binding doesn't find the JSON configuration file. Change-Id: I287b0c2ffe571a49626663aa8abe69d928e2bbf6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03init: Improve error message when not finding config fileRomain Forlot1-1/+1
Change-Id: I9a9dec6e577881bbd784bcae1d17ddb244d94599 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03low-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. Change-Id: I53b7cd757b3b344d66ab18ba9795284105cbcfcc Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03cmake config: WIDGET ENTRY POINT FIXClément Bénier1-1/+1
renamed afb-low-can-binding.so Change-Id: If72c1fc75891b01c3baaa9c8d776e3a2e5ea128c Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
2019-12-03converter: Fix to_hex conversionCorentin Le Gall1-1/+1
Convert byte to hex without forgetting '0's. ex: Before: '10' -> 'a' After: '10' -> '0a' Change-Id: I7346893eaf83aaa9294e48c20cbffd1a61789b51 Signed-off-by: Corentin Le Gall <corentin.legall@iot.bzh>
2019-12-03plugins: Conditionnal building of the j1939 pluginRomain Forlot1-0/+2
Change-Id: Idf77aa32ca4fd44163d93d0515f21d51f1d7abd7 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03apidef: 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 Change-Id: I040c401fa2818d056a61a2858829bc4db2cffece Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03cmake: fix lib not populated and RPATH usageRomain Forlot2-2/+7
RPATH as to be used as target property. Change-Id: Ifaa66ceafbe7ed5f7de553b14da2dd8c5b1e8f9d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03message-def: Fix code to avoid warningsCorentin Le Gall1-2/+2
Change-Id: I8ded9847a5923b3a78afc953551fc6daaf40b355 Signed-off-by: Corentin Le Gall <corentin.legall@iot.bzh>
2019-12-03socketcan-bcm: Fix wrongly opened socketRomain Forlot1-0/+1
This commit fixes a problem once a bcm socket has been opened but the following ioctl failed. Before we still return the socket number instead of returning a negative value as error. This resulted in problem because the subscription was considered as valid and binding was continuing using the closed file descriptor. Change-Id: Iaa64e7bb00980cb8c0e7080aca238cfb57d628b6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03init: 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. Change-Id: I5c9313817a3f3d423f8934cfab03e2cf20d48af2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03all: formatRomain Forlot5-60/+20
Remove unecessary brackets and replace if possible if...else by ternary operator. Change-Id: Ibe46b83dea976e050b9cd9eb7ee7ab2c33b63905 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03decoder/encoder: typoRomain Forlot2-2/+2
Change-Id: I9ebea118770a9ffe0dd4321408643e76250e3635 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03converter: Use unsigned int whenever it's possibleRomain Forlot2-3/+9
Use unsigned int whenever it is possible instead of uint32_t. This let the compiler decide the type. We do not need to use uint32_t explicitly for the converter. Change-Id: Ic2af875e7435668928c454df76e59c5c43b08407 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03bitfield-c: use unsigned int instead of uint8_tRomain Forlot14-131/+131
Use unsigned int instead of uint8_t upon destination and source array length. This is needed to handle gathered multi-frames message data which could be greater than 1 simple messages. Change-Id: I107bff383c2d0771dbc2a30770ec5c195b1c22ac Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03decoder/encoder: simplification of code.Romain Forlot2-155/+53
- Useless tests removed - Bit operation changed to more readable ones - Handle correctly mask to decode signal on 1 byte or in-between bytes more clearly. - using static_cast now instead of C casting method. - Avoid manual vector initialization and using default constructors instead. - Avoid using intermediate variables when this isn't necessary. Change-Id: I049d65f460109772b57df7572bdac8e6500242e0 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03encoder: use switch case to handle CAN protocolsRomain Forlot1-49/+62
Better using switch case than if...else. This would be more extendable and readable. Change-Id: I5fb03531ad77441bcb7d1620bdb07d82aa6a4eb4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03message: Correctly detect extended CAN id.Romain Forlot1-3/+1
Previous test was always true. This fix the wrong test and then add the EFF flag correctly on messages using extended CAN id. Change-Id: I69686fd3d5a39ea3a0d1980b4bfa88fe36fb7fe5 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03socket: Raise an error if open function failed.Romain Forlot2-0/+5
The socket opening wasn't tested and we fails later on another function using the wrongly opened socket. This would not happens anymore. Change-Id: I9b30bd9fc13b99277cbef6f7aeaddadc57ad0b18 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03low-can-hat: improve formatRomain Forlot1-2/+2
Weird way test to make test are now fixed to be more readable. Change-Id: I81d716ac3799c4217e720a13d8ba78a46996a2c3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03low-can-cb: Fix add a missing include.Romain Forlot1-0/+1
Since binding separation in 3 parts binding+lib+plugins we got a include missing about find_if function. Change-Id: Iae9ff1a72a06875aec2d0a08d049f4a00bbfecc3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03low-can-cb: improve readabilityRomain Forlot1-10/+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. Change-Id: I5cc7685b80734d0eb43a29fc06b2a8434f3469fa Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03can-bus: Use configuration from JSON fileRomain Forlot8-139/+41
Use configuration from JSON file instead of the old INI file. Now all configuration files lies within the binding tree. Change-Id: Id986d19751db958ad5cf3b7f2b2c5443d4ceb062 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03message: More explicit define about CAN protocols.Romain Forlot4-13/+13
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. Change-Id: I255fa03029c7d5f90a33448e5e7692d8c249279b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03decoder: fix left behind characterRomain Forlot2-2/+1
Change-Id: I28cf984024356925469b4971b993718276d1240f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03low-can-cb: Mark the end of the CtlSections arrayRomain Forlot1-1/+4
Change-Id: I433f4f699f3234fc07fcd909cd6b77b84e447ad7 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03converter: littles improvements.Romain Forlot2-2/+2
Change-Id: I9198835b96c66c140f8b1d4167828302b9dc4959 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03examples: Update using new GeneratorRomain Forlot10-329/+520
New generator including new signals capabilities: - sign - big_endian frame - default length Change-Id: Icf2e4dd7ef880a73527103c90a8063cf3d042e41 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03plugins: Use agl-vcar plugin by defaultRomain Forlot3-735/+744
Change-Id: I8935210e4cc2ec290a809bc1bfece4c36d367cda Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-11-15cmake: separate binding into lib+binding+pluginsRomain Forlot3-65/+82
This separation is needed to be more flexible and be able to load plugins representing CAN signals dictionnaries instead of using a hardcoded one. Change-Id: I8e07eed0dea36473d43b8d68416e8ca210269980 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-12-03Fix bit_position swappingCorentin Le Gall4-1/+25
-Added an attribute to signals that tells if the bit_position has been swapped. -Test if bit_size and bit_position gives an "out of range" data Change-Id: I589565ca923ec807da2d4f0db7c4c92fb737b579 Signed-off-by: Corentin Le Gall <corentin.legall@iot.bzh>
2019-11-15sign: handle decode methods sign from can valueClément Bénier4-9/+91
- add enumeration that represents the way of encoding: enum sign_t { UNSIGNED = 0, SIGN_BIT = 1, ONES_COMPLEMENT = 2, TWOS_COMPLEMENT = 3, SIGN_BIT_EXTERN = 4 }; - the function handle_sign allows to transform value if negative and return the sign of the value in order to be multiplied at the end ot the parcing Change-Id: I5766a286488170d930422474b4c4f3a8578ca726 Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
2019-11-14can: Add big endian CAN frame layout handleCorentin Le Gall7-3/+56
- can-decoder.cpp: translate_signal() : Tests "frame_layout_is_little". If false the signal's bit position is changed to fit the layout. - message-definition.cpp: Added the new attribute "frame_layout_is_little" and its getter. - signals.cpp: Added a setter to the bit_position attribute. - converter.cpp: Added a methode to convert a big endian bit_position to a right (little endian) bit_position. Change-Id: I004c9069eb00f389564927cd12d1b30470c3a59d Signed-off-by: Corentin Le Gall <corentin.legall@iot.bzh>
2019-11-14application: Add dedicated function to set parentsRomain Forlot2-15/+18
Change-Id: Iedd493b9e4043290dae0aa9d1d94a3d9179525ae Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-11-14low-can-cb: Retrieve application from external controller dataRomain Forlot1-5/+4
Change-Id: Iaa55b00539b1435b00fe076918d5eda5eeb5db30 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-11-12message_set: Remove build warning using C++ stringRomain Forlot1-2/+2
Change-Id: Ibf8e24a81466eab7aa11ed2100892f5796557b5e Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-11-12examples: updatesRomain Forlot9-42/+66780
Change-Id: I9c71038690d301e513f736a3405c3367f64fdbda Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-11-12test: Update tests with new transportRomain Forlot3-25/+25
Change-Id: I3a0e4ea451f9e01fc13b7498b9eb20e81548ce5d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-11-12doc: Update documentationRomain Forlot3-11/+11
Change-Id: Ifbeb00ef74d7a83db66808ae59dc9422b2e8593a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-11-10can_message: add missing signature due to conflictRomain Forlot1-0/+3
Change-Id: Ib705ae7c500bb9d3abc863053943298c87896bd2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-11-10hat: Move some binding functions into the hatRomain Forlot2-1/+89
Change-Id: I3a9f616078bc7fa9317995ec4300ee2b61aa4b08 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-11-10messsage_definition: add name getter methodRomain Forlot2-0/+5
Change-Id: I8c31ed12cc8e1eeb1a758a908181e96be799ad4e Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-11-10message_set: New methods to add messages at initRomain Forlot2-0/+41
Change-Id: Ic2e8169c9e3392198f5e0f6f5d28c2eea1ec98d4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-11-09binding: add preinit function to load the configRomain Forlot2-69/+85
Make as the others bindings using controller and load its configuration file at preinit step. Change-Id: I344c1982893e47600a0b8cd03542de8069a42d24 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-11-09All: Make format coherent with the whole projectRomain Forlot21-103/+118
Add a space after a comma Change some aligments Change-Id: I5069120f4bbb33742bb4990e2e1f391ec8d5eeb6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2019-11-09diag-mng: Change way to initialize the diag busRomain Forlot4-13/+15
This was kind of hardcoded and now, it is initialized by a configuration key of the controller configuration JSON file. Change-Id: I6e24c28781c08bd8e99de33f16b5ae10d1a6a9a1 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>