summaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding
AgeCommit message (Collapse)AuthorFilesLines
2017-06-01Use ptr to can_signal instead of copying some membersRomain Forlot2-91/+28
Change-Id: Ie827559c7da462f59bfe4af8af824f4616c2dd5b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-06-01Missing var declarationRomain Forlot1-1/+1
Change-Id: Icbb18bcdeae1d928d3981d21fc547d2940b198bd Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-06-01Fix: use of isnan() from std libRomain Forlot1-1/+1
Change-Id: I40ecb409ec1361faa6df8585332f319508bcb464 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-06-01manage unset values with NANJosé Bollo2-7/+4
Change-Id: I144bc110864f507e57d5e4b7f03ee1c0aa61ff63 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-06-01optimise flowJosé Bollo1-56/+31
Change-Id: I56d796531120236591f00fdf7a30f0a4495cbef2 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-06-01CleaningRomain Forlot1-19/+0
Change-Id: Iba8c7929ced1e2492de94e3a2b1c98dd4eb70b6b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-06-01Reworked subscription to integrate filtering.Romain Forlot13-154/+398
- Creation of an object which old the subscription context (filter, signal) : low_can_subscription_t - Move socket from can_signal_t to this new object. - Adding a member to can_message_t to transport subscription_id to be able to retrieve it with all the context through running. Change-Id: I87be8cd6c3c93a81040357920d8c081a316800c3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-06-01Return const structures.Romain Forlot2-15/+37
These structures doesn't not have to change after. Change-Id: I0cc83136c7ee4e5f5cd9c04bf717814e141f98c5 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-06-01Remake socketcan only movableRomain Forlot2-9/+2
Change-Id: If81e2a18c0beec392a98f8b835c7a5d154360500 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-06-01Renaming configuration to applicationRomain Forlot15-50/+47
It is more accurate to name it application because all its members aren't modifiable at runtime (without talking of last_value_ member and few others). Change-Id: Ica0d33dfd9c26cfdea019c2f41ed07777fb36d39 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-24Close diagnostic manager socket if there isn't any requestsRomain Forlot2-3/+20
No need to listen diagnostic responses if there isn't any subscriptions. Change-Id: I7fa48dbc3e8fb1847b8186337fe2813625894406 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-24Initialize the new socket member.Romain Forlot1-2/+4
Change-Id: Ia267c7ec605c692222ddcaed112486f81b428200 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-24Fix memory leaksRomain Forlot4-0/+14
Change-Id: I4a33b6d5f1f3b73af113aff62b024329b0ed5288 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-24Be able to copy active diagnostic request objects with their socketRomain Forlot3-0/+8
Implement socket copy assignment operator on socketcan base class. Change-Id: I75a2d3b96275b7ab83372d74ff7fe0a0b0535dc7 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-23Static code review fixes.Romain Forlot18-42/+43
Several style errors and mistakes mostly on constructor and passing arguments as ref. Change-Id: I2ca921d6aa70b9074392bb7779ade35bebf7bd8d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-23Implement filtering on subscription. WIPRomain Forlot2-17/+60
Change-Id: I232bdfe75335d0266d582b4974d8378632aceeae Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-22Logical bus name mapped to device name using conf file.Romain Forlot7-11/+27
Store CAN device map without prefixed section name and add methods to get the mapped device name. Change-Id: I03ebc175c67b2251016863b0d69a45a816a81d25 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Using reference make std::move useless.Romain Forlot2-3/+3
Change-Id: I9b9b6a2fbaecae8acc4f8f1eef0ea8d2f084fb9f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Set parent from configuration_generated objects.Romain Forlot3-18/+23
Change-Id: I8f07084c6364347ebad3e029b89aeef93129cce3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Added timestamp to received CAN messagesRomain Forlot10-18/+56
and store into frequency_clock_t. Change-Id: If209070298bd9df49297fdcbed554770e1bc0e4a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Adjust method signature to be more efficient.Romain Forlot10-45/+34
Return vector reference and doesn't return const ref. Change-Id: Ibcbc1d72e4baf1a7b8bf017d36d6d37d25312d6d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh> # Conflicts: # CAN-binder/low-can-binding/can/can-signals.hpp
2017-05-19Change method name to signify that it is an aggregate.Romain Forlot4-6/+6
As can_message_definitions got the exact same name but the one from can_message_set is an aggregate of all can_message_definition. So it is clearer using a different name. Change-Id: Ieb9e4d3291f3dc460eb352d8b8fe5a7cf479e687 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Use shared_ptr for can_message_set too.Romain Forlot3-9/+8
Change-Id: I3ba4881d5fc01a69d55e101b9a07c2019dda1d4b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Finish config parser retrieving device mapping.Romain Forlot5-5/+19
Change-Id: Ia43f9c0edf09ff9a1c009f198bdad10a6b44b249 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19FormatRomain Forlot3-4/+2
Change-Id: If3a381a4a07c117b9b1cc48ba3a6b4af2d7bdc69 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Explicit move of objects vector at list initilizationRomain Forlot1-2/+2
Change-Id: I5dc5ab4fa249c6677b188b6dea9d282a097a3250 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Improve objects construction.Romain Forlot2-10/+10
Use of a ref to initialize bus_ string member. const value doesn't make sense. Change-Id: I96f504ee11a754b3130289d27afa02a6fa811014 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Don't collide with application framework ERROR in some configuration.Romain Forlot2-7/+7
Change-Id: Idd600a47960850cd4afc553fdb79f5c57f93f64b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19New generated files using updated generatorRomain Forlot1-307/+443
Change-Id: I5778c07d1e92e52413e3020ee281a38c7cc0f1ef Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Include diagnostic_message_t into can_message_set.Romain Forlot11-21/+46
Change-Id: I7372e469752dd8e90dc9431b9e5c67df12f56c29 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Make and use a single function to read incoming CAN messagesRomain Forlot6-43/+37
Change-Id: I5d3f2a8628ace464ad25989346cc76682c591bd8 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Cleaning unused code diagnostic parts.Romain Forlot4-101/+2
Change-Id: I5df50557132ebe593818a7aa4644b8a0161c51a5 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Format renamingRomain Forlot2-7/+6
Change-Id: I40c28f584c444ef806c2adcc55d443a145abb0d2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Be able to return index or can bus name.Romain Forlot4-9/+11
Use a vector of string pair that map index on vector and pair map logical bus name with linux device name. Change-Id: I627e6f715f7466d835d8729e21d9e4198111c1fb Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Remove can-bus-dev following RAW->BCM sockets migrationRomain Forlot10-373/+35
No needs to get RAW socket for now, so can_bus_dev_t class is useless and now removed from project. Change-Id: I37b3e187ef28ba393beae7a99da4f422f74a298e Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19one event source by socket added to systemd event loop.Romain Forlot1-0/+1
Get back to the first solution, moving this variable declaration was a mistake. Change-Id: I1af78d93bfc8f759ecf1a849adddbe1d52c27466 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Use common timer method to get BCM timeval values.Romain Forlot1-5/+3
Change-Id: I3c4364d6038bd60546726fba940f043f5abcb6d2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Fix: compile conversion warningRomain Forlot1-1/+1
Change-Id: I174c546afb6b21df431e0a61677292d43af8f0ca Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Better suited method.Romain Forlot2-2/+2
Change-Id: I287e445c6f1c372a852752911d032a70654aa082 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Fix: wrong calculation doesn't match method name.Romain Forlot1-2/+2
Multiplication was a very specific needs for diagnostic manager when using systemd event loop timer. Now it is the right period that is calculated and multiplication is done into the right place. Cleaner. Change-Id: Ie3dffe8daa0fa9bd9bde408e62a8d7a06a333a25 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Make sure that frequency is at a valid value (>0)Romain Forlot1-1/+4
Else we got infinite value if 0 and negative value doesn't make sense here. Change-Id: Id65f0aa94cae32f1fea2c5c80028e328e6958a13 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Fix: be able to receive new response from OBD2 requests.Romain Forlot1-1/+1
Change-Id: Iab309e313f63beb4b56bc824ece1b3a5e42ae508 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Fix: CAN message transmitted filled of zero.Romain Forlot1-0/+1
can_dlc field was set to 0 and is evaluated so BCM assumes there is no data to transmit. It is mandatory to set it. Change-Id: I1e29ff4248a49212d3fee22c3a0cc77f5b699fd7 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Fix: listening on broadcast CAN ID.Romain Forlot1-1/+1
Wrong test about CAN ID, it isn't the response ID that is passed as argument but the broadcast. Little mistake... Change-Id: I2622c23356802c3108dbf8e6ede07456294834ee Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Implement canceling with BCM socket leads to close it.Romain Forlot1-17/+1
Change-Id: Ibcc1419caba7e1b04dbe652a6c60c393f14a8145 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Adding also diagnostic request to systemd event loopRomain Forlot4-11/+48
As for CAN signal, monitoring diagnostic request messages is now handled by systemD io event loop. Socket reading is common for all OBD2 signals and handled by the diagnostic manager. systemd callback function lies in binding callback which in turns call read_socket method of diagnostic manager. Processing is little bit different from classic CAN messages so it is a separate callback function. Lot of cleaning to do now... Change-Id: I4d2ada0beb5d3348736dfdf3c56a7cb875a1c6c7 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19New function used to set timer in bcm_head msg.Romain Forlot2-0/+14
As there will be more bcm socket and more need to set its timer values. May be there is a better method to separate integer and decimal parts from a float value. Change-Id: I0cd992dfde5fe8257b17b5b610482f5f5e09aa8c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19There is no more need having pointer on socket deviceRomain Forlot2-2/+9
Return bus name string. Change-Id: I0e7f4171c3d1052cb6425cd5b93e5a593d7d277f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Simplify testing name size...Romain Forlot1-1/+1
Change-Id: I3daa11b329f2e38efba5a52c2106bddd3b759f86 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-05-19Reworking diagnostic manager to use BCM sockets.Romain Forlot4-100/+125
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>