apps/agl-service-can-low-level.git
4 years agoini-config: remove ini-config lib sandbox/claneys/modular-low-can
Romain Forlot [Fri, 29 Nov 2019 15:34:05 +0000 (16:34 +0100)]
ini-config: remove ini-config lib

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>
4 years agoall: format typo
Romain Forlot [Fri, 29 Nov 2019 14:42:55 +0000 (15:42 +0100)]
all: format typo

Change-Id: I81c01a817cd31d577068350d8445a1df2751bff7
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agoconfig: Fix wrong controller configuration file name
Romain Forlot [Fri, 29 Nov 2019 11:25:18 +0000 (12:25 +0100)]
config: Fix wrong controller configuration file name

Change-Id: I6491c1bb4b64d7f005f220e4d2358ce787bf84af
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agoRevert "config: Change default configuration file names"
Romain Forlot [Thu, 28 Nov 2019 16:23:39 +0000 (17:23 +0100)]
Revert "config: Change default configuration file names"

This reverts commit 49ea87d92a3578c4c1547b094deaaca371816585.

Change-Id: I76186166cf2bd6dff0696f26ff30747288fc5478
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agoconfig: Change default configuration file names
Romain Forlot [Thu, 28 Nov 2019 15:42:42 +0000 (16:42 +0100)]
config: Change default configuration file names

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>
4 years agoinit: Improve error message when not finding config file
Romain Forlot [Thu, 28 Nov 2019 13:09:19 +0000 (14:09 +0100)]
init: Improve error message when not finding config file

Change-Id: I9a9dec6e577881bbd784bcae1d17ddb244d94599
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agolow-can: Fix init failing when using without J1939
Romain Forlot [Thu, 28 Nov 2019 12:37:35 +0000 (13:37 +0100)]
low-can: Fix init failing when using without J1939

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>
4 years agocmake config: WIDGET ENTRY POINT FIX
Clément Bénier [Thu, 28 Nov 2019 10:10:10 +0000 (11:10 +0100)]
cmake config: WIDGET ENTRY POINT FIX

renamed afb-low-can-binding.so

Change-Id: If72c1fc75891b01c3baaa9c8d776e3a2e5ea128c
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
4 years agoconverter: Fix to_hex conversion
Corentin Le Gall [Thu, 28 Nov 2019 08:15:19 +0000 (09:15 +0100)]
converter: Fix to_hex conversion

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>
4 years agoplugins: Conditionnal building of the j1939 plugin
Romain Forlot [Tue, 26 Nov 2019 17:23:42 +0000 (18:23 +0100)]
plugins: Conditionnal building of the j1939 plugin

Change-Id: Idf77aa32ca4fd44163d93d0515f21d51f1d7abd7
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agoapidef: fix no preinit defined.
Romain Forlot [Tue, 26 Nov 2019 14:20:40 +0000 (15:20 +0100)]
apidef: fix no preinit defined.

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>
4 years agocmake: fix lib not populated and RPATH usage
Romain Forlot [Tue, 26 Nov 2019 11:23:45 +0000 (12:23 +0100)]
cmake: fix lib not populated and RPATH usage

RPATH as to be used as target property.

Change-Id: Ifaa66ceafbe7ed5f7de553b14da2dd8c5b1e8f9d
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agomessage-def: Fix code to avoid warnings
Corentin Le Gall [Mon, 25 Nov 2019 18:29:52 +0000 (19:29 +0100)]
message-def: Fix code to avoid warnings

Change-Id: I8ded9847a5923b3a78afc953551fc6daaf40b355
Signed-off-by: Corentin Le Gall <corentin.legall@iot.bzh>
4 years agosocketcan-bcm: Fix wrongly opened socket
Romain Forlot [Mon, 25 Nov 2019 14:04:07 +0000 (15:04 +0100)]
socketcan-bcm: Fix wrongly opened socket

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>
4 years agoinit: Fix wrong diagnostic bus name returned.
Romain Forlot [Mon, 25 Nov 2019 11:39:30 +0000 (12:39 +0100)]
init: Fix wrong diagnostic bus name returned.

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>
4 years agoall: format
Romain Forlot [Sat, 23 Nov 2019 18:52:30 +0000 (19:52 +0100)]
all: format

Remove unecessary brackets and replace if possible
if...else by ternary operator.

Change-Id: Ibe46b83dea976e050b9cd9eb7ee7ab2c33b63905
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agodecoder/encoder: typo
Romain Forlot [Sat, 23 Nov 2019 15:07:17 +0000 (16:07 +0100)]
decoder/encoder: typo

Change-Id: I9ebea118770a9ffe0dd4321408643e76250e3635
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agoconverter: Use unsigned int whenever it's possible
Romain Forlot [Sat, 23 Nov 2019 13:08:41 +0000 (14:08 +0100)]
converter: Use unsigned int whenever it's possible

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>
4 years agobitfield-c: use unsigned int instead of uint8_t
Romain Forlot [Sat, 23 Nov 2019 12:39:52 +0000 (13:39 +0100)]
bitfield-c: use unsigned int instead of uint8_t

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>
4 years agodecoder/encoder: simplification of code.
Romain Forlot [Sat, 23 Nov 2019 11:42:01 +0000 (12:42 +0100)]
decoder/encoder: simplification of code.

- 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>
4 years agoencoder: use switch case to handle CAN protocols
Romain Forlot [Sat, 23 Nov 2019 08:00:50 +0000 (09:00 +0100)]
encoder: use switch case to handle CAN protocols

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>
4 years agomessage: Correctly detect extended CAN id.
Romain Forlot [Thu, 21 Nov 2019 16:59:07 +0000 (17:59 +0100)]
message: Correctly detect extended CAN id.

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>
4 years agosocket: Raise an error if open function failed.
Romain Forlot [Thu, 21 Nov 2019 15:13:52 +0000 (16:13 +0100)]
socket: Raise an error if open function failed.

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>
4 years agolow-can-hat: improve format
Romain Forlot [Thu, 21 Nov 2019 12:44:24 +0000 (13:44 +0100)]
low-can-hat: improve format

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>
4 years agolow-can-cb: Fix add a missing include.
Romain Forlot [Thu, 21 Nov 2019 10:21:08 +0000 (11:21 +0100)]
low-can-cb: Fix add a missing include.

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>
4 years agolow-can-cb: improve readability
Romain Forlot [Wed, 20 Nov 2019 18:46:11 +0000 (19:46 +0100)]
low-can-cb: improve readability

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>
4 years agocan-bus: Use configuration from JSON file
Romain Forlot [Wed, 20 Nov 2019 14:31:14 +0000 (15:31 +0100)]
can-bus: Use configuration from JSON file

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>
4 years agomessage: More explicit define about CAN protocols.
Romain Forlot [Wed, 20 Nov 2019 12:02:24 +0000 (13:02 +0100)]
message: More explicit define about CAN protocols.

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>
4 years agodecoder: fix left behind character
Romain Forlot [Wed, 20 Nov 2019 09:49:27 +0000 (10:49 +0100)]
decoder: fix left behind character

Change-Id: I28cf984024356925469b4971b993718276d1240f
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agolow-can-cb: Mark the end of the CtlSections array
Romain Forlot [Tue, 19 Nov 2019 18:25:26 +0000 (19:25 +0100)]
low-can-cb: Mark the end of the CtlSections array

Change-Id: I433f4f699f3234fc07fcd909cd6b77b84e447ad7
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agoconverter: littles improvements.
Romain Forlot [Tue, 19 Nov 2019 15:44:38 +0000 (16:44 +0100)]
converter: littles improvements.

Change-Id: I9198835b96c66c140f8b1d4167828302b9dc4959
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agoexamples: Update using new Generator
Romain Forlot [Tue, 19 Nov 2019 11:44:05 +0000 (12:44 +0100)]
examples: Update using new Generator

New generator including new signals capabilities:

- sign
- big_endian frame
- default length

Change-Id: Icf2e4dd7ef880a73527103c90a8063cf3d042e41
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agoplugins: Use agl-vcar plugin by default
Romain Forlot [Tue, 19 Nov 2019 08:14:35 +0000 (09:14 +0100)]
plugins: Use agl-vcar plugin by default

Change-Id: I8935210e4cc2ec290a809bc1bfece4c36d367cda
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agocmake: separate binding into lib+binding+plugins
Romain Forlot [Fri, 15 Nov 2019 11:46:44 +0000 (12:46 +0100)]
cmake: separate binding into lib+binding+plugins

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>
4 years agoFix bit_position swapping
Corentin Le Gall [Mon, 18 Nov 2019 15:48:20 +0000 (16:48 +0100)]
Fix bit_position swapping

-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>
4 years agosign: handle decode methods sign from can value
Clément Bénier [Fri, 15 Nov 2019 10:20:34 +0000 (11:20 +0100)]
sign: handle decode methods sign from can value

- 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>
4 years agocan: Add big endian CAN frame layout handle
Corentin Le Gall [Thu, 14 Nov 2019 18:13:25 +0000 (19:13 +0100)]
can: Add big endian CAN frame layout handle

- 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>
4 years agoapplication: Add dedicated function to set parents
Romain Forlot [Thu, 14 Nov 2019 14:09:57 +0000 (15:09 +0100)]
application: Add dedicated function to set parents

Change-Id: Iedd493b9e4043290dae0aa9d1d94a3d9179525ae
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agolow-can-cb: Retrieve application from external controller data
Romain Forlot [Thu, 14 Nov 2019 11:51:29 +0000 (12:51 +0100)]
low-can-cb: Retrieve application from external controller data

Change-Id: Iaa55b00539b1435b00fe076918d5eda5eeb5db30
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agomessage_set: Remove build warning using C++ string
Romain Forlot [Tue, 12 Nov 2019 16:06:46 +0000 (17:06 +0100)]
message_set: Remove build warning using C++ string

Change-Id: Ibf8e24a81466eab7aa11ed2100892f5796557b5e
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agoexamples: updates
Romain Forlot [Tue, 12 Nov 2019 15:20:00 +0000 (16:20 +0100)]
examples: updates

Change-Id: I9c71038690d301e513f736a3405c3367f64fdbda
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agotest: Update tests with new transport
Romain Forlot [Tue, 12 Nov 2019 13:44:02 +0000 (14:44 +0100)]
test: Update tests with new transport

Change-Id: I3a0e4ea451f9e01fc13b7498b9eb20e81548ce5d
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agodoc: Update documentation
Romain Forlot [Tue, 12 Nov 2019 11:16:53 +0000 (12:16 +0100)]
doc: Update documentation

Change-Id: Ifbeb00ef74d7a83db66808ae59dc9422b2e8593a
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agocan_message: add missing signature due to conflict
Romain Forlot [Sun, 10 Nov 2019 18:17:18 +0000 (19:17 +0100)]
can_message: add missing signature due to conflict

Change-Id: Ib705ae7c500bb9d3abc863053943298c87896bd2
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agohat: Move some binding functions into the hat
Romain Forlot [Sun, 10 Nov 2019 15:48:14 +0000 (16:48 +0100)]
hat: Move some binding functions into the hat

Change-Id: I3a9f616078bc7fa9317995ec4300ee2b61aa4b08
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agomesssage_definition: add name getter method
Romain Forlot [Sun, 10 Nov 2019 12:47:44 +0000 (13:47 +0100)]
messsage_definition: add name getter method

Change-Id: I8c31ed12cc8e1eeb1a758a908181e96be799ad4e
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agomessage_set: New methods to add messages at init
Romain Forlot [Sun, 10 Nov 2019 09:18:45 +0000 (10:18 +0100)]
message_set: New methods to add messages at init

Change-Id: Ic2e8169c9e3392198f5e0f6f5d28c2eea1ec98d4
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agobinding: add preinit function to load the config
Romain Forlot [Sat, 9 Nov 2019 17:09:30 +0000 (18:09 +0100)]
binding: add preinit function to load the config

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>
4 years agoAll: Make format coherent with the whole project
Romain Forlot [Sat, 9 Nov 2019 15:59:36 +0000 (16:59 +0100)]
All: Make format coherent with the whole project

Add a space after a comma
Change some aligments

Change-Id: I5069120f4bbb33742bb4990e2e1f391ec8d5eeb6
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agodiag-mng: Change way to initialize the diag bus
Romain Forlot [Sat, 9 Nov 2019 12:21:43 +0000 (13:21 +0100)]
diag-mng: 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.

Change-Id: I6e24c28781c08bd8e99de33f16b5ae10d1a6a9a1
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agoall: Copyright update
Romain Forlot [Sat, 9 Nov 2019 08:22:17 +0000 (09:22 +0100)]
all: Copyright update

Change-Id: I9794c48d0f7567cc3fdc7dff21b4fcee47296514
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agomessage_set: typedef long type signature
Romain Forlot [Thu, 7 Nov 2019 16:04:12 +0000 (17:04 +0100)]
message_set: typedef long type signature

Convert two long types using typedef to get shorter one

Change-Id: I9f5612def1bce512516a6e1a45711486368bbc51
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agocontroller:initialize an empty message_set to fill
Romain Forlot [Thu, 7 Nov 2019 15:29:32 +0000 (16:29 +0100)]
controller:initialize an empty message_set to fill

Initialize an empty message_set to fill later when loading the Plugins
Add the required method to be able to add a message_set

Change-Id: I1dc784648f69832de8681184adaccbf5300f831d
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agocontroller: Prepare project ot use the Controller
Arthur Guyader [Thu, 7 Nov 2019 13:16:16 +0000 (14:16 +0100)]
controller: Prepare project ot use the Controller

Change-Id: I39c39da66f9a0716bd75dc82824941508c236bf2
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agowrite: Add feature to build messages and fix some functions
Arthur Guyader [Thu, 7 Nov 2019 09:06:25 +0000 (10:06 +0100)]
write: Add feature to build messages and fix some functions

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

4 years agoexamples: update examples and can_samples
Arthur Guyader [Wed, 6 Nov 2019 17:51:23 +0000 (18:51 +0100)]
examples: update examples and can_samples

Update of examples for new features (is_fd,is_extended,is_j1939).

Bug-AGL: SPEC-2386

Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
Change-Id: I8c3afbafdde4f5818d73c0e71a3b7e47fb7d8fc6

4 years agoj1939: don't process signals using same bus
Romain Forlot [Wed, 6 Nov 2019 14:41:23 +0000 (15:41 +0100)]
j1939: don't process signals using same bus

Change-Id: I8733a35e4f9cb3d0f2fce818b55a010fec19dc66
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agoj1939: update using latest commits in linux-next
Romain Forlot [Wed, 6 Nov 2019 10:31:50 +0000 (11:31 +0100)]
j1939: update using latest commits in linux-next

Change-Id: Id01e92330582da299af675676987cd667272e2c5
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agoconverter: decoder: use appropriate int types
Romain Forlot [Wed, 6 Nov 2019 08:46:31 +0000 (09:46 +0100)]
converter: decoder: use appropriate int types

Change-Id: I7e977647b23ecd5be1f58486af857e3b7132b48f
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agoall: Format one line 'if' or 'for' statement.
Romain Forlot [Tue, 5 Nov 2019 18:33:29 +0000 (19:33 +0100)]
all: Format one line 'if' or 'for' statement.

Change-Id: I58ae7a48de5569c488f9d265946a81f180051ce2
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agosubscription: Optimizing opening sockets
Romain Forlot [Tue, 5 Nov 2019 14:37:47 +0000 (15:37 +0100)]
subscription: Optimizing opening sockets

Also review some aligment and make more space between bool ops

Change-Id: Id1880cbde10cc8deec66a6be163d8a012dbaa0f9
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agocan: clean and format
Romain Forlot [Tue, 5 Nov 2019 12:55:19 +0000 (13:55 +0100)]
can: clean and format

Little optimization in create_rx_filter_can function and
make format coherent on bit operations.

Change-Id: Ic9c53ba4c937604bbf3500ee89c7b5a5dbca7cfd
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agocan: Fix receiving and sending extended CAN frames
Romain Forlot [Tue, 5 Nov 2019 09:14:35 +0000 (10:14 +0100)]
can: Fix receiving and sending extended CAN frames

Change-Id: I672450b51b46082b6a913bef2d6e27d64c49e6fc
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agocan: Remove extended flags
Romain Forlot [Mon, 4 Nov 2019 16:17:27 +0000 (17:17 +0100)]
can: Remove extended flags

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.

Change-Id: Id96c576045bf087df51beb011742ad631336f814
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agocmake: Remove build warnings
Romain Forlot [Mon, 4 Nov 2019 12:21:08 +0000 (13:21 +0100)]
cmake: Remove build warnings

Remove unused flag with C++.

Change-Id: I85376914f64b9dfe9015a6439185ad6a53cdb117
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agoAdd steering wheel LIN message signal definitions 40/22940/2 8.99.1 icefish/8.99.1 icefish_8.99.1
Scott Murray [Wed, 13 Nov 2019 05:37:23 +0000 (00:37 -0500)]
Add steering wheel LIN message signal definitions

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

4 years agorefactor(config.xml.in):Replace required api with required binding 74/22274/3 next
Li Xiaoming [Fri, 30 Aug 2019 01:45:56 +0000 (09:45 +0800)]
refactor(config.xml.in):Replace required api with required binding

Appfw docs:
"required-api local": OBSOLETE SINCE FF (AGL6), PROVIDED FOR
COMPATIBILITY.Use the feature urn:AGL:widget:required-binding instead.

Bug-AGL: SPEC-2781

Change-Id: I9627f1c59d89f9687c09a41a3bedf1c56bb90f59
Signed-off-by: Li Xiaoming <lixm.fnst@cn.fujitsu.com>
4 years agoUpdate documentation 62/22262/4
Arthur Guyader [Wed, 28 Aug 2019 09:34:00 +0000 (11:34 +0200)]
Update documentation

Bug-AGL : SPEC-2779

Change-Id: I461f7e32322faba7e822791ff2e3851039e03548
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
4 years agoRemove file socketcan-j1939 that was not removed before 61/22261/4
Arthur Guyader [Tue, 27 Aug 2019 09:51:26 +0000 (11:51 +0200)]
Remove file socketcan-j1939 that was not removed before

Bug-AGL : SPEC-2780

Change-Id: I4ddf9389faffebe0334b0004b69bb7336277c29d
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
4 years agoRemove in function convert_from_addr, the variable flags was not used 60/22260/4
Arthur Guyader [Thu, 29 Aug 2019 10:46:13 +0000 (12:46 +0200)]
Remove in function convert_from_addr, the variable flags was not used

Bug-AGL : SPEC-2780

Change-Id: Ib31a32565c3bc38ea039003bd924a43318fb7c4e
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
4 years agoRemove in function rx_filter_can, the variable val was not used 59/22259/4
Arthur Guyader [Mon, 26 Aug 2019 13:49:37 +0000 (15:49 +0200)]
Remove in function rx_filter_can, the variable val was not used

Bug-AGL : SPEC-2780

Change-Id: Ifce6e67fd55699d088952b0f722694d211ec7398
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
4 years agoAdd new decoders bytes for signal of long size 58/22258/4
Arthur Guyader [Tue, 27 Aug 2019 13:40:55 +0000 (15:40 +0200)]
Add new decoders bytes for signal of long size

This commit adds the decoder bytes. It allows to
return a sequence of bytes in hexadecimal form.

Bug-AGL : SPEC-2780

Change-Id: I27180774f044c48a9d7baa2739b15a2e85b8b2e2
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
4 years agoChange signature of decoders 57/22257/4
Arthur Guyader [Tue, 27 Aug 2019 09:41:57 +0000 (11:41 +0200)]
Change signature of decoders

This commit changes the signature of decoders. It is
now necessary to specify the version of the signals
so that the low-can-generator generates the associated
wrapper and not need to modify the decoder already
developed.

Bug-AGL : SPEC-2780

Change-Id: I044b1a3a6bacb9fc59bd6d3f77a1dbc437a3aa86
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
4 years agoAdd some typedef to reduce the size of the lines 56/22256/4
Arthur Guyader [Tue, 27 Aug 2019 12:48:29 +0000 (14:48 +0200)]
Add some typedef to reduce the size of the lines

Bug-AGL : SPEC-2779

Change-Id: Iebcf7492133cd7789d301593ff999b24ae10a054
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
4 years agoChange vector to list to allow to remove signal. 55/22255/4
Arthur Guyader [Wed, 28 Aug 2019 08:36:40 +0000 (10:36 +0200)]
Change vector to list to allow to remove signal.

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>
4 years agoUpdate bit position and bit size in signal 54/22254/4
Arthur Guyader [Tue, 27 Aug 2019 12:45:58 +0000 (14:45 +0200)]
Update bit position and bit size in signal

It's necessary to change the size of attributes
to manage multi packet signal.

Bug-AGL : SPEC-2779

Change-Id: If211c218ffa5a2e81ccfb32d3a5eeae0267e8f74
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
4 years agoAdd feature ISO TP (multi frames and peer to peer) 53/22253/4
Arthur Guyader [Tue, 27 Aug 2019 12:44:48 +0000 (14:44 +0200)]
Add feature ISO TP (multi frames and peer to peer)

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>
4 years agoReplace all enum types with masks 52/22252/3
Arthur Guyader [Tue, 27 Aug 2019 12:43:08 +0000 (14:43 +0200)]
Replace all enum types with masks

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>
4 years agoUpdate function tx_send for multi frame prevision 51/22251/3
Arthur Guyader [Mon, 26 Aug 2019 13:46:08 +0000 (15:46 +0200)]
Update function tx_send for multi frame prevision

Bug-AGL : SPEC-2779

Change-Id: Ib0b04fe3648c5b83c23327431e21161b6b2489b6
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
4 years agoOnly defined signals can be written 50/22250/3
Arthur Guyader [Wed, 14 Aug 2019 11:28:11 +0000 (13:28 +0200)]
Only defined signals can be written

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>
4 years agoUpdate function rx_filter_can for multi frame prevision. 49/22249/3
Arthur Guyader [Mon, 26 Aug 2019 13:41:46 +0000 (15:41 +0200)]
Update function rx_filter_can for multi frame prevision.

This commit updates the functions rx_filter_can to anticipate
the development of the multi-frame.

Bug-AGL : SPEC-2779

Change-Id: I5f67cf84e5d3e47c75c588f8776ead92eb6c3c8e
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
4 years agoChange function get_bcm_msg to return a reference. 48/22248/3
Arthur Guyader [Mon, 26 Aug 2019 13:39:33 +0000 (15:39 +0200)]
Change function get_bcm_msg to return a reference.

Bug-AGL : SPEC-2779

Change-Id: I303d2423151dac497917299737070ffb645267d3
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
4 years agoMove attributes flags and maxdlen 47/22247/3
Arthur Guyader [Tue, 27 Aug 2019 12:40:08 +0000 (14:40 +0200)]
Move attributes flags and maxdlen

This commit moves attributes flags and maxdlen from
class can_message_t to class message_t.

Bug-AGL : SPEC-2779

Change-Id: I56f9cd54d8b9822636311c603501326b36692cf4
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
4 years agoAdd function remove last bcm frame 46/22246/3
Arthur Guyader [Wed, 14 Aug 2019 11:22:15 +0000 (13:22 +0200)]
Add function remove last bcm frame

This commit creates the function remove_last_bcm_frame.
This function removes the last bcm frame of the subscription.

Bug-AGL : SPEC-2779

Change-Id: I5bb6f07a8d677c4aa882549fc1950f00a0b1da04
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
4 years agoAdd many frames in a subscription in the function tx_send. 45/22245/3
Arthur Guyader [Mon, 26 Aug 2019 13:33:13 +0000 (15:33 +0200)]
Add many frames in a subscription in the function tx_send.

This commit convert the message to a vector of canfd_frame.
If there are several canfd frames then we add all of them
to the subscription.

Bug-AGL : SPEC-2779

Change-Id: I876aaf5ab7fed2fedb79367f77b987ba4745cdfc
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
4 years agoAdd function to convert vector to canfd or can frame. 44/22244/2
Arthur Guyader [Mon, 26 Aug 2019 13:32:20 +0000 (15:32 +0200)]
Add function to convert vector to canfd or can frame.

This commit allows to convert the data vector to canfd or
can frame. In the two cases the struct is a canfd frame,
but if the type is not fd, the max size of a frame is 8.

Bug-AGL : SPEC-2779

Change-Id: I60edf6a602a47572d5e5bfb508c7ca6d8761832b
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
4 years agoAdd function get_data_vector with index 43/22243/2
Arthur Guyader [Mon, 12 Aug 2019 14:27:51 +0000 (16:27 +0200)]
Add function get_data_vector with index

This commit adds the function get_data_vector to get
another vector between the index indicates.

Bug-AGL : SPEC-2779

Change-Id: I704d78467839ee7f9a2fec397e9b0db8da43d79d
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
4 years agoUpdate function to encode and decode message 42/22242/2
Arthur Guyader [Mon, 26 Aug 2019 14:48:28 +0000 (16:48 +0200)]
Update function to encode and decode message

This commit update encoder and decoder files.
This new implementation allows to manage larger signals.

Bug-AGL : SPEC-2779

Change-Id: Iec6dfbd279863aa8b8e8f9e3ce951f0c8aa80dae
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
4 years agoUpdate j1939 decode with function to_hex 41/22241/2
Arthur Guyader [Tue, 27 Aug 2019 12:37:01 +0000 (14:37 +0200)]
Update j1939 decode with function to_hex

Bug-AGL: SPEC-2386

Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
Change-Id: Ia10abfd73a6ea9d42770566e23bc4b206723f081

4 years agoAdd file converter to manage all conversions 40/22240/2
Arthur Guyader [Mon, 12 Aug 2019 09:51:34 +0000 (11:51 +0200)]
Add file converter to manage all conversions

This commits create a class converter
to access conversions functions.
For example to_hex, or for future usage
in multi packet signal_to_bits_bytes.

Bug-AGL : SPEC-2779

Change-Id: Ife652006a7756547184ed548bda5ffef0d09d941
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
4 years agoUniform indentation with tabulation 39/22239/2
Arthur Guyader [Tue, 27 Aug 2019 12:34:37 +0000 (14:34 +0200)]
Uniform indentation with tabulation

Bug-AGL : SPEC-2779

Change-Id: I834221ae1a04fdb188062ce1b7251e648c4845de
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
4 years agoFix: only one subscription could be made 42/22142/3
Romain Forlot [Mon, 12 Aug 2019 15:58:50 +0000 (17:58 +0200)]
Fix: only one subscription could be made

Only one subscription could be made and then only one subscriber
could receive associated events. As the relationship between events
and subscriber is not 1-1 but 1-N, so this was the mistake. Now 1 event
is created for N subscriber where before there was 1 event for 1
subscriber and subsequent subscribers could not receive same events
than the ones already subscribed.

Bug-AGL: SPEC-2726

Change-Id: I4e4a80ac9f9b6b4c6b006108ee55f355a7c1e377
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agoUpdate documentation. 12/22012/14
Arthur Guyader [Mon, 29 Jul 2019 13:21:08 +0000 (15:21 +0200)]
Update documentation.

Bug-AGL: SPEC-2386

Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
Change-Id: I9e6b07ef48d634fe643e0eb2477fedfd34a7abb9

4 years agoAdd tests for J1939 features. 11/22011/14
Arthur Guyader [Mon, 29 Jul 2019 13:20:32 +0000 (15:20 +0200)]
Add tests for J1939 features.

This commit adds tests for the J1939 features.

Bug-AGL: SPEC-2386

Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
Change-Id: I2545eb2f9a27561714fc5efcbd885afcb237770d

4 years agoIntegrate the J1939 features : address claiming and write. 10/22010/13
Arthur Guyader [Mon, 29 Jul 2019 12:53:14 +0000 (14:53 +0200)]
Integrate the J1939 features : address claiming and write.

This commit allows to write J1939 messages and add the management
of the address claiming.

Bug-AGL: SPEC-2386

Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
Change-Id: I1bb95a7ba6f6ebe463319c3972d9d46897181d51

4 years agoAdd feature to build messages and fix some functions 09/22009/10
Arthur Guyader [Mon, 29 Jul 2019 10:19:13 +0000 (12:19 +0200)]
Add feature to build messages and fix some functions

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

4 years agoUpdate examples and can_samples 08/22008/7
Arthur Guyader [Tue, 2 Jul 2019 15:46:16 +0000 (17:46 +0200)]
Update examples and can_samples

Update of examples for new features (is_fd,is_extended,is_j1939).

Bug-AGL: SPEC-2386

Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
Change-Id: I8c3afbafdde4f5818d73c0e71a3b7e47fb7d8fc6

4 years agosignals.cpp: Make an insensitive string comparison 02/21802/2 7.99.3 8.0.0 8.0.1 8.0.2 halibut/7.99.3 halibut/8.0.0 halibut/8.0.1 halibut/8.0.2 halibut_7.99.3 halibut_8.0.0 halibut_8.0.1 halibut_8.0.2
Romain Forlot [Mon, 1 Jul 2019 16:55:23 +0000 (18:55 +0200)]
signals.cpp: Make an insensitive string comparison

When sending a CAN signal make an case-insensitive comparison as it isn't
necessary to be strict on that, so case insensitive if fine.

Update the documentation accordingly.

Bug-AGL: SPEC-2582

Change-Id: I998b64cdd9a381da3da582aeba42ab726fff1259
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
4 years agoFix spelling 82/21782/1 7.99.2 halibut/7.99.2 halibut_7.99.2
Sebastien Douheret [Thu, 27 Jun 2019 18:41:05 +0000 (20:41 +0200)]
Fix spelling

Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Change-Id: Iea56414f8ccf3d96b2fc67126b066c4032fe86a8

4 years agoFix invalid markdown filename in documentation 81/21781/1
Sebastien Douheret [Thu, 27 Jun 2019 18:32:38 +0000 (20:32 +0200)]
Fix invalid markdown filename in documentation

Bug introduced by previous commit ID b8261a3b218

Bug-AGL: SPEC-2386

Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Change-Id: I3694f955109e5828bdf0209cc705655a0ed002c0