aboutsummaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding
AgeCommit message (Collapse)AuthorFilesLines
2017-05-19Remove unused and useless members.Romain Forlot3-21/+1
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>
2017-05-19Fix wrong signature, better with const ref... Was forgottenRomain Forlot1-5/+4
Change-Id: I2d3f7525bb85c051c43aeda6b9cc1be0f3e270c8 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Message definition can return ref instead of value.Romain Forlot2-2/+2
Little optimization that will pass a ref instead of a copy value. Change-Id: I62fbaaa2fb01cf809e60b592a3d91f06d7235205 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Fix: vector throw length error exception.Romain Forlot1-3/+4
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>
2017-05-19Fix: wrong arguments signature. Deleted by mistake...Romain Forlot1-2/+2
Change-Id: Ib31483663a90c8dad129f59372e1ced3a79c7403 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Implement unsubscribe like subscribe.Romain Forlot1-18/+31
New redundant function creation to mutualize code between two operations. Change-Id: I8516c2c6d2f0c1d5cf89244ea23b831530e84a5f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19FormatRomain Forlot4-11/+27
Change-Id: Idc49593fdc1a039c6a03626115e4156a629e4e65 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-11Resolv include circular dependencies.Romain Forlot3-3/+2
Change-Id: I038677d688c64e87ae86dd2af245f87f5c40e317 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-11Massive use of shared_ptr about signal and diag message. WIPRomain Forlot11-82/+82
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>
2017-05-10Use a tree instead of separated object lists. WIPRomain Forlot11-155/+245
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>
2017-05-10Fix: circular include for socket classes.Romain Forlot3-1/+2
Change-Id: Ibcd71f585246172c191b67b45e3b2763f7722958 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-10CleaningRomain Forlot1-6/+1
Change-Id: I23b862e748e13e7ba69743c8a9d3abb0be36c4bc Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-10CAN message will not be modified once read.Romain Forlot3-3/+3
So use const value Change-Id: I81f9a4766d71116e2f3a2af8785b1bd1c69e2c20 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-10Don't trigger timeout monitoring on signal.Romain Forlot1-1/+1
Change-Id: Ib84c365207e32f71fc4cb7e350f99d147317fa08 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-10Make non blocking BCM socket.Romain Forlot1-0/+3
Needed because we use systemd event loop that recommend that. Change-Id: Ia3faf35fe80a973f7a7b1c81f6a8adf96705394b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-10Move reading input stream to specialized socket class.Romain Forlot6-26/+49
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>
2017-05-10Implement setting last_value at message definition level.Romain Forlot9-4/+22
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>
2017-05-10Keeping RAW sockets for compatibilityRomain Forlot2-56/+1
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>
2017-05-10Fix: Avoid returning negative value that's stop watch socketRomain Forlot3-7/+12
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>
2017-05-05FormatRomain Forlot1-1/+1
Change-Id: I1c080f961f62a6816b0c36e960ae1ecbeb7fa00d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-05Avoid returning infinity value.Romain Forlot1-1/+1
Change-Id: I89d227e48add0c7fc8a4ca577023995b269e6f13 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-05Don't destroy socket by default as they will always be open.Romain Forlot6-33/+9
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>
2017-05-05Get back to device dedicated raw_socketRomain Forlot3-2/+15
Change-Id: Ibec47106f8510e92a017fc08aeb2eeaeef2884e5 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-05Improve granularity of BCM socket using one by signalRomain Forlot6-49/+58
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>
2017-05-05Improve log message.Romain Forlot2-4/+4
Change-Id: I91155eda22a172efc88f72243c260480a2d1d4ce Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-05Separation between hat and callback binding partsRomain Forlot11-93/+136
As well as handling reading signals BCM socket using systemd event loop. Change-Id: I1e121635ec5db489b2bcb88a3101e716bf8883d5 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-05Update CMake following app-template repo updateRomain Forlot1-4/+4
Change-Id: Ib24f8c2000f78f5f6fea3126e52f34570e4eee18 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-04Follow the moving binding and configuration files.Romain Forlot18-31/+31
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>
2017-05-04Update with last app-templates modificationsRomain Forlot8-14/+0
https://gerrit.automotivelinux.org/gerrit/#/admin/projects/apps/app-templates Change-Id: I42eff75b790b70047e1b91b963edf458084881c9 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-03Fix: constructor and include file missing.Romain Forlot6-38/+24
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>
2017-05-03Change direct initialization objectRomain Forlot1-1/+1
Change-Id: Icedbe5b8c420b0fb77eb331577e11c35c4597d80 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-03typoRomain Forlot1-4/+4
Change-Id: Iaf68d463e9df4d6dda2a8508adf5395041d2ff7f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-03Keeping raw socket until diagnostic_manager is fully migratedRomain Forlot2-2/+10
Change-Id: I8cb170613c003bbdb39240eb809b8cefcad6cb35 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-03Added child class to binding target.Romain Forlot1-0/+2
Change-Id: I804abe6eb0965b54fb93bc8da2b1e1665b99476d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-03Derivate socketcan to multiple child depending upon socket CAN type.Romain Forlot6-54/+237
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>
2017-05-03Use the private method instead of direct C syscall.Romain Forlot1-1/+1
Change-Id: I1c0e04e38fec92dee167720c3128a7493d4cf9b2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-02Added external libraries from openXC CMake files.Romain Forlot1-1/+0
Now libraries are cleanly included and built. Change-Id: Iaa85639578b55b2da8357bc438426403e2cca8de Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-02Using new CMake architecture (again...)Romain Forlot1-10/+25
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>
2017-05-02Fix: wrong include local header pathRomain Forlot1-1/+1
Change-Id: I1878e26a519a8e2708cfbfd59c6dd95e968d4028 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-29Fix: wrong include relative path.Romain Forlot1-1/+1
Change-Id: I4e6d1ce805d7e7fef66eac177f10fe5f163d79b5 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-29Adapt CMake files to use new capabilities with widgetRomain Forlot1-5/+5
Change-Id: I88a1ef090b7ce40c833c5780f5a481876ff7ea09 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-27clean left include file after modification that isn't needed anymoreRomain Forlot1-1/+0
Change-Id: Ie63c962cfe191cca71c5927eafa72a3ab69befac Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-27Fix: write bcm message to socket.Romain Forlot3-24/+19
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>
2017-04-27Don't use heavy weapon to get some basic calculationRomain Forlot1-2/+1
Change-Id: Ibc820dea7efbc2d7a50671ce66804217c6707d56 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-27Fix: Add notifying decoding thread if there is new messages.Romain Forlot1-1/+3
Change-Id: If12617ae086d7023ff619799833cd1d4fd0fd413 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-27Check last value before send the event, if no change no event.Romain Forlot3-9/+20
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>
2017-04-27Create method to handle both CAN frames.Romain Forlot3-21/+103
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>
2017-04-27Doesn't send event if no changes are made for doors signals.Romain Forlot1-5/+5
Change-Id: I4e72db1e7b7bc31d7446a4903972687f1ec9d71c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-27Finish to read stream and fill the destination object.Romain Forlot1-4/+5
Use AFB log system Change-Id: I5aa727ce7f9db5b6f18df5957f31f37d9af88d20 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-04-27Fix: Reading doesn't update receiving object valuesRomain Forlot2-2/+2
Wrong signature using const argument with the obj receiving the read Change-Id: I0c5b8a3c974f0bd140823f8ce88aa2cbd451e543 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>