apps/low-level-can-service.git
7 years agoThere is no more need having pointer on socket device
Romain Forlot [Mon, 15 May 2017 22:24:15 +0000 (00:24 +0200)]
There is no more need having pointer on socket device

Return bus name string.

Change-Id: I0e7f4171c3d1052cb6425cd5b93e5a593d7d277f
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoSimplify testing name size...
Romain Forlot [Mon, 15 May 2017 22:21:57 +0000 (00:21 +0200)]
Simplify testing name size...

Change-Id: I3daa11b329f2e38efba5a52c2106bddd3b759f86
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoReworking diagnostic manager to use BCM sockets.
Romain Forlot [Mon, 15 May 2017 22:21:26 +0000 (00:21 +0200)]
Reworking diagnostic manager to use BCM sockets.

Use 2 sockets:
 - TX sockets on active_diagnostic_request class as we need X sockets
using the same CAN ID "7DF" with different timing settings
 - RX socket on diagnostic_manager object as we need to read the same CAN ID
and process them the same way, there isn't so much need to split them.

Change-Id: I7338fd751a033a1d0e8912ee554e2c72c43961c3
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoUse raw pointer to point on parent object.
Romain Forlot [Fri, 12 May 2017 12:46:19 +0000 (14:46 +0200)]
Use raw pointer to point on parent object.

Shared pointer on value is a wrong way because once they is no more object
refering to a parent then the pointer on it is destoyed. Not a big deal here
but we better have to use raw pointer.

Change-Id: I58deeb9e82c446ea135be87c11f405da54cc5bff
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoRemove unused and useless members.
Romain Forlot [Fri, 12 May 2017 12:42:47 +0000 (14:42 +0200)]
Remove unused and useless members.

These members was imported from OpenXC project which was in C so they need
to know array size. As we use vector we doesn't need them anymore. We can
retrieve count using size() vector method

Change-Id: Iefd0266d400097ab2dae813aca196c8e3b9bc368
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFix wrong signature, better with const ref... Was forgotten
Romain Forlot [Fri, 12 May 2017 12:09:25 +0000 (14:09 +0200)]
Fix wrong signature, better with const ref... Was forgotten

Change-Id: I2d3f7525bb85c051c43aeda6b9cc1be0f3e270c8
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoMessage definition can return ref instead of value.
Romain Forlot [Fri, 12 May 2017 12:08:16 +0000 (14:08 +0200)]
Message definition can return ref instead of value.

Little optimization that will pass a ref instead of a copy value.

Change-Id: I62fbaaa2fb01cf809e60b592a3d91f06d7235205
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFix: vector throw length error exception.
Romain Forlot [Fri, 12 May 2017 12:07:22 +0000 (14:07 +0200)]
Fix: vector throw length error exception.

Message set count members as to be changed because now useless... This is
left part from OpenXC port.

Change-Id: I3a3dc6091b49eabf0d17324634406bd7b0edafb2
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFix: wrong arguments signature. Deleted by mistake...
Romain Forlot [Fri, 12 May 2017 12:05:54 +0000 (14:05 +0200)]
Fix: wrong arguments signature. Deleted by mistake...

Change-Id: Ib31483663a90c8dad129f59372e1ced3a79c7403
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoUpdate closing message after a successful build.
Romain Forlot [Mon, 15 May 2017 08:33:47 +0000 (10:33 +0200)]
Update closing message after a successful build.

Change-Id: Icf8b871819178539af129352b35be1fb61cc6789
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoImplement unsubscribe like subscribe.
Romain Forlot [Thu, 11 May 2017 15:35:58 +0000 (17:35 +0200)]
Implement unsubscribe like subscribe.

New redundant function creation to mutualize code between two operations.

Change-Id: I8516c2c6d2f0c1d5cf89244ea23b831530e84a5f
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFormat
Romain Forlot [Wed, 10 May 2017 23:13:15 +0000 (01:13 +0200)]
Format

Change-Id: Idc49593fdc1a039c6a03626115e4156a629e4e65
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoResolv include circular dependencies.
Romain Forlot [Wed, 10 May 2017 23:13:07 +0000 (01:13 +0200)]
Resolv include circular dependencies.

Change-Id: I038677d688c64e87ae86dd2af245f87f5c40e317
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoMassive use of shared_ptr about signal and diag message. WIP
Romain Forlot [Wed, 10 May 2017 23:12:11 +0000 (01:12 +0200)]
Massive use of shared_ptr about signal and diag message. WIP

Vector of shared_ptr is made to shared ownership about object around project.
This is the default returned value by getter methods when lookup and manipulating
them.

Change-Id: Id37947bb5994b629f4bf3faecc5ffac81c55e1e6
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoUse a tree instead of separated object lists. WIP
Romain Forlot [Wed, 10 May 2017 16:39:25 +0000 (18:39 +0200)]
Use a tree instead of separated object lists. WIP

Now we respect JSON description file, which is can_message_set contains
can_message_definition which contains can_signals.
Diagnostic messages aren't processed for now.

Change-Id: I94aaf5eded14dd84395bd4fd749df58dee5f533e
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFix: circular include for socket classes.
Romain Forlot [Wed, 10 May 2017 16:37:15 +0000 (18:37 +0200)]
Fix: circular include for socket classes.

Change-Id: Ibcd71f585246172c191b67b45e3b2763f7722958
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoCleaning
Romain Forlot [Wed, 10 May 2017 08:07:47 +0000 (10:07 +0200)]
Cleaning

Change-Id: I23b862e748e13e7ba69743c8a9d3abb0be36c4bc
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoCAN message will not be modified once read.
Romain Forlot [Wed, 10 May 2017 07:59:00 +0000 (09:59 +0200)]
CAN message will not be modified once read.

So use const value

Change-Id: I81f9a4766d71116e2f3a2af8785b1bd1c69e2c20
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoDon't trigger timeout monitoring on signal.
Romain Forlot [Wed, 10 May 2017 07:54:18 +0000 (09:54 +0200)]
Don't trigger timeout monitoring on signal.

Change-Id: Ib84c365207e32f71fc4cb7e350f99d147317fa08
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoMake non blocking BCM socket.
Romain Forlot [Wed, 10 May 2017 07:51:09 +0000 (09:51 +0200)]
Make non blocking BCM socket.

Needed because we use systemd event loop that recommend that.

Change-Id: Ia3faf35fe80a973f7a7b1c81f6a8adf96705394b
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoMove reading input stream to specialized socket class.
Romain Forlot [Wed, 10 May 2017 07:49:13 +0000 (09:49 +0200)]
Move reading input stream to specialized socket class.

We always read the same object so how to fill it is the job of specialized class
not a generic method can do that.

Change-Id: Ia262871cec6b7ed3341eb314d5ed6641b8da61e6
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoImplement setting last_value at message definition level.
Romain Forlot [Wed, 10 May 2017 07:47:50 +0000 (09:47 +0200)]
Implement setting last_value at message definition level.

In addition to signal last_values, now message last value is also set.

Change-Id: I87c2be3e4e68073d7708b2ddf681889576337410
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoKeeping RAW sockets for compatibility
Romain Forlot [Wed, 10 May 2017 07:45:29 +0000 (09:45 +0200)]
Keeping RAW sockets for compatibility

And reset can_reader to can_bus_dev_t like the old behavior because BCM sockets
has been implemented at signals level not device.

Change-Id: I715a19ff65bf9d7231c73b66c1ee95b3f41f8ed0
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFix: Avoid returning negative value that's stop watch socket
Romain Forlot [Tue, 9 May 2017 14:48:49 +0000 (16:48 +0200)]
Fix: Avoid returning negative value that's stop watch socket

Even if the frame read is wrong doesn't mean that socket is compromise only
that communication on CAN bus is difficult, maybe temporary. On en EPOLL err
code, or hangup, just close and restart the socket and reset the filter.

Change-Id: I61f146fd269bb2524f09e1f2ed89d93e83166136
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoDon't process rebuild webapp if it is already build
Romain Forlot [Tue, 9 May 2017 14:43:30 +0000 (16:43 +0200)]
Don't process rebuild webapp if it is already build

Change-Id: Ifd3a478035281ae81e2e8f33e904828716fb1213
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoUpdate CMake to the reference app-template. WIP
Romain Forlot [Tue, 9 May 2017 14:43:08 +0000 (16:43 +0200)]
Update CMake to the reference app-template. WIP

Change-Id: Icbab921e8ae3380c09cf5b2f5e7f4ba4a59e4c6e
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFormat
Romain Forlot [Fri, 5 May 2017 16:40:21 +0000 (18:40 +0200)]
Format

Change-Id: I1c080f961f62a6816b0c36e960ae1ecbeb7fa00d
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoAvoid returning infinity value.
Romain Forlot [Fri, 5 May 2017 16:39:32 +0000 (18:39 +0200)]
Avoid returning infinity value.

Change-Id: I89d227e48add0c7fc8a4ca577023995b269e6f13
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoDon't destroy socket by default as they will always be open.
Romain Forlot [Fri, 5 May 2017 16:39:13 +0000 (18:39 +0200)]
Don't destroy socket by default as they will always be open.

Now derivated class use constructor from base class and we don't destroy
socket when a socket object is over since it may be copied before. So closing
them is in charge of dev, well me...

Change-Id: I0440119017a3e56bb83d0194a6908dc3e2b8f745
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoGet back to device dedicated raw_socket
Romain Forlot [Fri, 5 May 2017 16:35:53 +0000 (18:35 +0200)]
Get back to device dedicated raw_socket

Change-Id: Ibec47106f8510e92a017fc08aeb2eeaeef2884e5
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoImprove granularity of BCM socket using one by signal
Romain Forlot [Fri, 5 May 2017 16:34:48 +0000 (18:34 +0200)]
Improve granularity of BCM socket using one by signal

Move create_rx_filter to can_signals and adding all accessories needed to works.

Change-Id: I3636fe82ce5c2e43a4992b66ce89440ff709004a
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoImprove log message.
Romain Forlot [Fri, 5 May 2017 16:32:30 +0000 (18:32 +0200)]
Improve log message.

Change-Id: I91155eda22a172efc88f72243c260480a2d1d4ce
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoSeparation between hat and callback binding parts
Romain Forlot [Fri, 5 May 2017 16:31:41 +0000 (18:31 +0200)]
Separation between hat and callback binding parts

As well as handling reading signals BCM socket using systemd event loop.

Change-Id: I1e121635ec5db489b2bcb88a3101e716bf8883d5
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoUpdate CMake following app-template repo update
Romain Forlot [Fri, 5 May 2017 16:28:49 +0000 (18:28 +0200)]
Update CMake following app-template repo update

Change-Id: Ib24f8c2000f78f5f6fea3126e52f34570e4eee18
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoRemove duplicated file
Romain Forlot [Fri, 5 May 2017 16:27:19 +0000 (18:27 +0200)]
Remove duplicated file

Change-Id: I94e820622d47ef5ae5922948cc28337f28533e97
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFollow the moving binding and configuration files.
Romain Forlot [Thu, 4 May 2017 12:24:33 +0000 (14:24 +0200)]
Follow the moving binding and configuration files.

Change include statement to refer the correct new path to the files.
Also change CMakeLists.txt.

Change-Id: I66a0bccab02e9fce10072a275a6580d61b4ddfbe
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoUpdate with last app-templates modifications
Romain Forlot [Thu, 4 May 2017 12:28:09 +0000 (14:28 +0200)]
Update with last app-templates modifications

https://gerrit.automotivelinux.org/gerrit/#/admin/projects/apps/app-templates

Change-Id: I42eff75b790b70047e1b91b963edf458084881c9
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFix: constructor and include file missing.
Romain Forlot [Wed, 3 May 2017 16:23:20 +0000 (18:23 +0200)]
Fix: constructor and include file missing.

Copy constructors are allowed since socket will never be closed during binding
runs.

Change-Id: Ie33e4b7e885d45e1ffeb980400df00ae2a97e45d
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoAlign on CMake template from app-template repo
Romain Forlot [Wed, 3 May 2017 16:21:37 +0000 (18:21 +0200)]
Align on CMake template from app-template repo

Change-Id: Id44c5e4917f646177f5262bb74c9ccb3a588d25b
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoChange direct initialization object
Romain Forlot [Wed, 3 May 2017 15:57:30 +0000 (17:57 +0200)]
Change direct initialization object

Change-Id: Icedbe5b8c420b0fb77eb331577e11c35c4597d80
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agotypo
Romain Forlot [Wed, 3 May 2017 15:57:07 +0000 (17:57 +0200)]
typo

Change-Id: Iaf68d463e9df4d6dda2a8508adf5395041d2ff7f
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoKeeping raw socket until diagnostic_manager is fully migrated
Romain Forlot [Wed, 3 May 2017 15:54:20 +0000 (17:54 +0200)]
Keeping raw socket until diagnostic_manager is fully migrated

Change-Id: I8cb170613c003bbdb39240eb809b8cefcad6cb35
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoAdded child class to binding target.
Romain Forlot [Wed, 3 May 2017 15:53:03 +0000 (17:53 +0200)]
Added child class to binding target.

Change-Id: I804abe6eb0965b54fb93bc8da2b1e1665b99476d
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoDerivate socketcan to multiple child depending upon socket CAN type.
Romain Forlot [Wed, 3 May 2017 15:52:34 +0000 (17:52 +0200)]
Derivate socketcan to multiple child depending upon socket CAN type.

Use to initialize raw, bcm and later isotp socket. Now we should have,
1 BCM socket by signal to make filter on them. 1 raw socket by devices is kept
to use diagnostic manager as is.

Change-Id: Icb2daddf67039479f72bc487d53971adc9aba638
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoUse the private method instead of direct C syscall.
Romain Forlot [Wed, 3 May 2017 11:29:07 +0000 (13:29 +0200)]
Use the private method instead of direct C syscall.

Change-Id: I1c0e04e38fec92dee167720c3128a7493d4cf9b2
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoAdded external libraries from openXC CMake files.
Romain Forlot [Tue, 2 May 2017 16:29:37 +0000 (18:29 +0200)]
Added external libraries from openXC CMake files.

Now libraries are cleanly included and built.

Change-Id: Iaa85639578b55b2da8357bc438426403e2cca8de
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoAdd 'CAN-binder/libs/uds-c/' from commit 'ca20db3dd978871bbb9f01f3c862b510c03d1dc4'
Romain Forlot [Tue, 2 May 2017 15:52:11 +0000 (17:52 +0200)]
Add 'CAN-binder/libs/uds-c/' from commit 'ca20db3dd978871bbb9f01f3c862b510c03d1dc4'

git-subtree-dir: CAN-binder/libs/uds-c
git-subtree-mainline: 3102ec9ce009d0f28355c5b7df9c5bd5013e6e75
git-subtree-split: ca20db3dd978871bbb9f01f3c862b510c03d1dc4

7 years agoAdd 'CAN-binder/libs/nanopb/' from commit '278ffb890e3d8722e4c7d824baaf221a1e375fc4'
Romain Forlot [Tue, 2 May 2017 15:51:53 +0000 (17:51 +0200)]
Add 'CAN-binder/libs/nanopb/' from commit '278ffb890e3d8722e4c7d824baaf221a1e375fc4'

git-subtree-dir: CAN-binder/libs/nanopb
git-subtree-mainline: 12e680a3c97a2750c657a8c561a79706f3689149
git-subtree-split: 278ffb890e3d8722e4c7d824baaf221a1e375fc4

7 years agoAdd 'CAN-binder/libs/openxc-message-format/' from commit 'd9f54f97578429773421abce98d...
Romain Forlot [Tue, 2 May 2017 15:51:38 +0000 (17:51 +0200)]
Add 'CAN-binder/libs/openxc-message-format/' from commit 'd9f54f97578429773421abce98d5f6579717afcc'

git-subtree-dir: CAN-binder/libs/openxc-message-format
git-subtree-mainline: f44a5b1549bc4c8a84d0dedf4a8b1e4220a34f42
git-subtree-split: d9f54f97578429773421abce98d5f6579717afcc

7 years agoAdd 'CAN-binder/libs/isotp-c/' from commit 'ee24440b7c123ab1b0317e57be33e837a1cb51f1'
Romain Forlot [Tue, 2 May 2017 15:51:18 +0000 (17:51 +0200)]
Add 'CAN-binder/libs/isotp-c/' from commit 'ee24440b7c123ab1b0317e57be33e837a1cb51f1'

git-subtree-dir: CAN-binder/libs/isotp-c
git-subtree-mainline: d170c9faeae2cf29c19f3523714ecdf58be73bed
git-subtree-split: ee24440b7c123ab1b0317e57be33e837a1cb51f1

7 years agoAdd 'CAN-binder/libs/bitfield-c/' from commit 'a34745ec93ae0a1d4f1b640dba8fb6702331a8e9'
Romain Forlot [Tue, 2 May 2017 15:50:50 +0000 (17:50 +0200)]
Add 'CAN-binder/libs/bitfield-c/' from commit 'a34745ec93ae0a1d4f1b640dba8fb6702331a8e9'

git-subtree-dir: CAN-binder/libs/bitfield-c
git-subtree-mainline: b6c09cbda2b6b47981d65265184a21223e526d4a
git-subtree-split: a34745ec93ae0a1d4f1b640dba8fb6702331a8e9

7 years agoRemove submodules and use forked libs tree instead
Romain Forlot [Tue, 2 May 2017 15:36:33 +0000 (17:36 +0200)]
Remove submodules and use forked libs tree instead

Change-Id: Icd1ba605357df63f750966cc941190acaa80e35b
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoImplement AGLBuild script following SPEC-495 from JIRA
Romain Forlot [Tue, 2 May 2017 15:22:58 +0000 (17:22 +0200)]
Implement AGLBuild script following SPEC-495 from JIRA

See: https://jira.automotivelinux.org/browse/SPEC-495
Needed as entry point for Yocto chain build.

Change-Id: Id2d5d68fc0aa32ff9f52d2d176e68ac4de7353e7
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoUsing new CMake architecture (again...)
Romain Forlot [Tue, 2 May 2017 15:21:20 +0000 (17:21 +0200)]
Using new CMake architecture (again...)

Following the new CMake template from https://gerrit.automotivelinux.org/gerrit/apps/app-templates
these CMake files use helpers macros from macros.cmake and project configuration config.cmake.

Change-Id: I2297b6ad6c65cd763d1870d5b62564e8795f4317
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFix: wrong include local header path
Romain Forlot [Tue, 2 May 2017 14:59:41 +0000 (16:59 +0200)]
Fix: wrong include local header path

Change-Id: I1878e26a519a8e2708cfbfd59c6dd95e968d4028
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoAdding HTML5 UI with cpu stat binding
Romain Forlot [Sat, 29 Apr 2017 16:17:08 +0000 (18:17 +0200)]
Adding HTML5 UI with cpu stat binding

Change-Id: Id63b7d338140097a5f2f0943f1b63ee978141829
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFix: wrong include relative path.
Romain Forlot [Sat, 29 Apr 2017 16:13:59 +0000 (18:13 +0200)]
Fix: wrong include relative path.

Change-Id: I4e6d1ce805d7e7fef66eac177f10fe5f163d79b5
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoAdapt CMake files to use new capabilities with widget
Romain Forlot [Sat, 29 Apr 2017 16:13:28 +0000 (18:13 +0200)]
Adapt CMake files to use new capabilities with widget

Change-Id: I88a1ef090b7ce40c833c5780f5a481876ff7ea09
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoMake a macro and helpers library instead of Big CMake.
Romain Forlot [Sat, 29 Apr 2017 16:12:18 +0000 (18:12 +0200)]
Make a macro and helpers library instead of Big CMake.

Add two macros to handle widget one to populate widget with wanted target
and other to add generic widget files

Change-Id: I030f078906f151fee49fa2c2fada3d94745f9dfd
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoRename as AGLBuild makefile.
Romain Forlot [Fri, 28 Apr 2017 16:05:36 +0000 (18:05 +0200)]
Rename as AGLBuild makefile.

Made as generic script.

Change-Id: I7e73de7badfaade6fad29476275dd69aa523e6c9

7 years agoclean left include file after modification that isn't needed anymore
Romain Forlot [Wed, 26 Apr 2017 22:47:39 +0000 (00:47 +0200)]
clean left include file after modification that isn't needed anymore

Change-Id: Ie63c962cfe191cca71c5927eafa72a3ab69befac
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFix: write bcm message to socket.
Romain Forlot [Wed, 26 Apr 2017 22:59:40 +0000 (00:59 +0200)]
Fix: write bcm message to socket.

Just allowing message with 1 frame avoiding to handle dynamic sized array...
This close the door for multiplexed msg for now... Let's see later and move on

Change-Id: I3626d4b6634b3f119826603e64713d63e994918e
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoDon't use heavy weapon to get some basic calculation
Romain Forlot [Wed, 26 Apr 2017 22:44:17 +0000 (00:44 +0200)]
Don't use heavy weapon to get some basic calculation

Change-Id: Ibc820dea7efbc2d7a50671ce66804217c6707d56
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFix: Add notifying decoding thread if there is new messages.
Romain Forlot [Wed, 26 Apr 2017 16:28:12 +0000 (18:28 +0200)]
Fix: Add notifying decoding thread if there is new messages.

Change-Id: If12617ae086d7023ff619799833cd1d4fd0fd413
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoCheck last value before send the event, if no change no event.
Romain Forlot [Wed, 26 Apr 2017 16:27:35 +0000 (18:27 +0200)]
Check last value before send the event, if no change no event.

Adding a boolean parameter similarly of existing function to know if we would send
the event.

Change-Id: I03ee17f656065e556fd2b72b160b140852b68dcc
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoCreate method to handle both CAN frames.
Romain Forlot [Wed, 26 Apr 2017 16:25:33 +0000 (18:25 +0200)]
Create method to handle both CAN frames.

Change-Id: Ie876614266fd2e7089754a8f917d25d316de4c98
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Fix: wrong call since renaming of function to more generic name

Change-Id: I2adebb855bc815ba6ab14a1002b17d9c9fb293fd
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoDoesn't send event if no changes are made for doors signals.
Romain Forlot [Wed, 26 Apr 2017 16:24:43 +0000 (18:24 +0200)]
Doesn't send event if no changes are made for doors signals.

Change-Id: I4e72db1e7b7bc31d7446a4903972687f1ec9d71c
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFinish to read stream and fill the destination object.
Romain Forlot [Wed, 26 Apr 2017 16:24:03 +0000 (18:24 +0200)]
Finish to read stream and fill the destination object.

Use AFB log system

Change-Id: I5aa727ce7f9db5b6f18df5957f31f37d9af88d20
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFix: Reading doesn't update receiving object values
Romain Forlot [Wed, 26 Apr 2017 16:23:10 +0000 (18:23 +0200)]
Fix: Reading doesn't update receiving object values

Wrong signature using const argument with the obj receiving the read

Change-Id: I0c5b8a3c974f0bd140823f8ce88aa2cbd451e543
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoDon't use FD frame with BCM socket. Seems not working...
Romain Forlot [Wed, 26 Apr 2017 13:48:07 +0000 (15:48 +0200)]
Don't use FD frame with BCM socket. Seems not working...

Change-Id: I4f1d5cd489011675cf55914647b57c7332dec1b9
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFix: correctly count (un)subscribed signals.
Romain Forlot [Wed, 26 Apr 2017 13:46:49 +0000 (15:46 +0200)]
Fix: correctly count (un)subscribed signals.

Can't be 0 subscription so success if greater than 0

Change-Id: Ie4395dbabe4ed85fe939ebdfa9de87e210fa55bc
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoMake template from similar writing stream operations.
Romain Forlot [Wed, 26 Apr 2017 13:45:14 +0000 (15:45 +0200)]
Make template from similar writing stream operations.

Change-Id: I33b32418980059b701d2af5b165af536f42d0252
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoSubscribe using BCM RX_SETUP filter capabilities implemented.
Romain Forlot [Tue, 25 Apr 2017 22:21:07 +0000 (00:21 +0200)]
Subscribe using BCM RX_SETUP filter capabilities implemented.

Change-Id: I7462b5d0144987293376dab719d1cf4fa41406f2
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoReworked reading CAN devices from BCM socket.
Romain Forlot [Tue, 25 Apr 2017 22:19:18 +0000 (00:19 +0200)]
Reworked reading CAN devices from BCM socket.

Now reading thread hold in can_bus_t object instead of can_bus_dev_t and reading
happens using select().

Change-Id: Ib8cc68c4484679168519f3c0fa485fedd1616c74
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFix bit alignment errors...
Romain Forlot [Tue, 25 Apr 2017 18:00:05 +0000 (20:00 +0200)]
Fix bit alignment errors...

Change-Id: Iea1bb66bb3aea8a120e7bbb3b55895682044cf23
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoTypo, rename, format
Romain Forlot [Wed, 26 Apr 2017 22:53:30 +0000 (00:53 +0200)]
Typo, rename, format

Change-Id: I8250ef78f0b540617bd249873250f62ad6361fdf
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoRenaming confusing member "address_" to "index_"
Romain Forlot [Tue, 25 Apr 2017 17:58:08 +0000 (19:58 +0200)]
Renaming confusing member "address_" to "index_"

Change-Id: I0ec6d74e9adb791f8bef44f76c74be8365cdf037
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoImplement reading stream for socketcan_t
Romain Forlot [Tue, 25 Apr 2017 17:56:56 +0000 (19:56 +0200)]
Implement reading stream for socketcan_t

Will read a can_message_t object from socket

Change-Id: Ibe3561f9d7bbf4e41b6fd81fa4672bae1c14aca5
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFix CMakeFile final message and compile flag
Romain Forlot [Tue, 25 Apr 2017 17:53:49 +0000 (19:53 +0200)]
Fix CMakeFile final message and compile flag

Change-Id: I518794897a4b333fc825b64846fad081308c93e7
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoAdding Directive to also clean wgt file with make clean
Romain Forlot [Tue, 25 Apr 2017 17:53:20 +0000 (19:53 +0200)]
Adding Directive to also clean wgt file with make clean

Change-Id: I41b32ea60d9a44e27dbe0a51b58173ff359e0186
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFix compilation warning complaining about unset boolean value.
Romain Forlot [Mon, 24 Apr 2017 17:16:50 +0000 (19:16 +0200)]
Fix compilation warning complaining about unset boolean value.

Change-Id: I17e2177f40b8845f78370048ef3c734486b152b3
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoMisc: Cleanup, typo, formating and comments update.
Romain Forlot [Mon, 24 Apr 2017 17:16:16 +0000 (19:16 +0200)]
Misc: Cleanup, typo, formating and comments update.

Change-Id: Icac565b9a3a80dc05a1a3470a35e223c8c564347
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoCreate a received job for BCM Socket to handle filtering.
Romain Forlot [Mon, 24 Apr 2017 17:15:07 +0000 (19:15 +0200)]
Create a received job for BCM Socket to handle filtering.

Filter is created using can_signals description and send with appropriate
BCM header structure. This is the simplest way to do, no temporal filtering
for now is available.

Change-Id: Iee49f011ba9316880735d2765c1c23a8b2d3c4d2
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoRename and handling write on socket using stream instead of specific method
Romain Forlot [Mon, 24 Apr 2017 17:09:28 +0000 (19:09 +0200)]
Rename and handling write on socket using stream instead of specific method

Created special struct to handle bcm messages with can_frame and canfd_frame.
We can now just send both of them seamlessly.

Change-Id: Ia84e9cf2ab1dd0716cb09f6bb342a208e54f8e06
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFix: Avoid returning 2 results for 1 signal.
Romain Forlot [Mon, 24 Apr 2017 07:23:17 +0000 (09:23 +0200)]
Fix: Avoid returning 2 results for 1 signal.

Either returning signal with search against generic_name either against name,
not both.

Change-Id: I597718d04c99d098973442b4174e735e813c9b94
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoRework subscription and unsubscriptions operations. More readable.
Romain Forlot [Sat, 22 Apr 2017 15:39:27 +0000 (17:39 +0200)]
Rework subscription and unsubscriptions operations. More readable.

Change-Id: I53101eed16b1faf1e5014826d91e4d64665f2f9f
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoUse BCM socket as default cleaning up the old RAW socket code.
Romain Forlot [Sat, 22 Apr 2017 15:38:23 +0000 (17:38 +0200)]
Use BCM socket as default cleaning up the old RAW socket code.

Also use CAN FD frames by default.

Change-Id: I5bad10e537653b1a96c2e3012d38dde8627d3caa
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoFix: opening bcm socket still trying to bind as a RAW socket.
Romain Forlot [Sat, 22 Apr 2017 11:58:26 +0000 (13:58 +0200)]
Fix: opening bcm socket still trying to bind as a RAW socket.

Wrong condition testing making connect and bind happens.

Change-Id: Ic75a74d044e9763fdf42e50f7643b26ffaf5d76d
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoImprove logging messages
Romain Forlot [Sat, 22 Apr 2017 11:57:41 +0000 (13:57 +0200)]
Improve logging messages

Added for all log messages function name at beginning using __FUNCTION__ macro.

Change-Id: Ia0f476ca81b9f79c6d49b425c0520894c59797ea
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoAdding some comments
Romain Forlot [Fri, 21 Apr 2017 16:20:55 +0000 (18:20 +0200)]
Adding some comments

Change-Id: Ic47e808a0da94f79ca0341d1b4f46a02eef3fe84
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoMove all signals search functions into new signals_manager_t object
Romain Forlot [Fri, 21 Apr 2017 16:20:42 +0000 (18:20 +0200)]
Move all signals search functions into new signals_manager_t object

Create a class from signals lookup and find standalone function and gather all
find function into it. There is now only 1 function to find either CAN signals
or diagnostic messages, results are returned using an ad-hoc struct containing
vector of one or the other type pointers.

This object also hold subscribed_signals map with events, so this class is a singleton.

Change-Id: I3584c6a91201e6904edc6aeac0abfa1785bdeccc
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoAvoid warning about unmanaged switch case in INI library
Romain Forlot [Fri, 21 Apr 2017 16:13:14 +0000 (18:13 +0200)]
Avoid warning about unmanaged switch case in INI library

Change-Id: Ifdca1581dc5a086a884dbc2dcc17470e5983b4ac
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoDiagnostic messages subscription simplified.
Romain Forlot [Fri, 21 Apr 2017 13:42:48 +0000 (15:42 +0200)]
Diagnostic messages subscription simplified.

Remove useless function.

Change-Id: I6638c3033cfeea643b29c1280d7f5785371cd342
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoMake virtual CAN device name as argument
Romain Forlot [Fri, 21 Apr 2017 07:17:31 +0000 (09:17 +0200)]
Make virtual CAN device name as argument

Change-Id: I6ae48b36171fbc038c9a3a8841d9dbadf7686ee3
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoAdded -std=c++11 to compile option lost in transition.
Romain Forlot [Wed, 12 Apr 2017 07:23:06 +0000 (09:23 +0200)]
Added -std=c++11 to compile option lost in transition.

Change-Id: Ie8728ac2bdb0a4a3712534c4ca7144e9a15ab4d2
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoUpdate comments
Romain Forlot [Thu, 20 Apr 2017 15:41:16 +0000 (17:41 +0200)]
Update comments

Change-Id: Ib21f810170308a16462ffe9c174448a86bf791d4
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoRemove timeout socket option.
Romain Forlot [Thu, 20 Apr 2017 15:40:55 +0000 (17:40 +0200)]
Remove timeout socket option.

This will be handle by BCM socket

Change-Id: Ie0348135fcc596ab21727846f3b47751664c9e11
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoSeparate socket configuration and opening
Romain Forlot [Thu, 20 Apr 2017 15:40:06 +0000 (17:40 +0200)]
Separate socket configuration and opening

Change-Id: I94cad718b516f24c5d1833e09df89f03e529f48a
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoUse same function to open BCM and RAW CAN sockets
Romain Forlot [Thu, 20 Apr 2017 15:38:01 +0000 (17:38 +0200)]
Use same function to open BCM and RAW CAN sockets

Using one a another socket type is made using a boolean.

Change-Id: I0445c8550f289d1e0020f6496c638bc95e8db443
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoSpecializing socket class to CAN socket operations.
Romain Forlot [Wed, 19 Apr 2017 22:07:37 +0000 (00:07 +0200)]
Specializing socket class to CAN socket operations.

Move all legacy opening RAW CAN socket operation to socket class. Each operations
on a CAN socket has to be simple and made by the socket class.
Simple BCM socket open operation is implemented.
Future will be to open specialized BCM CAN sockets on demand.

Change-Id: If285b97afb9871245ab1f13cd9f0401fbd9adf95
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>