summaryrefslogtreecommitdiffstats
path: root/src/diagnostic
AgeCommit message (Collapse)AuthorFilesLines
2017-03-20Make error goes back to the subscribed clients when unsupported.Romain Forlot1-0/+1
Change-Id: Ic864803c8dffdab3cc9bf5bf281ce032600a732f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-20Fix: Avoid segfault if diagnostic bus isn't correctly set.Romain Forlot1-5/+14
There is a segfault when binding configuration doesn't matches configuration generated. Improve general CAN bus device initialization. Change-Id: I17ea94ee54841d09ac63a7ffad303a88d99e0173 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-19Fix bad handling unsupported OBD2 messages subscription.Romain Forlot1-1/+1
Testing supported boolean wrong and gave a null pointer to a function that doesn't check the pointer validity. Change-Id: I49e88a68f266546dbd257b0fdade860cead1322d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-17Comments fixes, typo and formating.Romain Forlot6-29/+28
No more warning when generate the docs and all comments follow the same formating. Change-Id: I80d4c5c2d64401c2e53a550c60155680c4f968ce Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Diagnostic requests will occur depending on their frequency.Romain Forlot1-1/+1
Hardcoded offset was for testing purpose, now we can use frequency offset. Change-Id: I920e61cd8f587ead9c77aec158edb4dee28b927d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Wrong error handling when fire diagnostic request.Romain Forlot1-6/+4
As returned code was negative value the sd_event_source stopped considering that was an error. If statement was to check that sd_event_set_enabled was ok, so unref and return wasn't at the right location... Change-Id: I91cc943c20af80a31b4f66f5714ccef93c0fdbd2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Include cleaningRomain Forlot6-15/+9
Change-Id: I5df96540400b833e684001f8fc5fa33ff1892bae Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Adding missing doxygen comments.Romain Forlot6-107/+267
Made some cleaning about unused things or obsolete. Review existing comments, adding missing comments. Reformat some long long constructor. Change-Id: Ibae247d1295a7a85b49d0ecee473022755d42b8b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Implement check of supported diagnostic PID.Romain Forlot4-2/+25
Supported boolean member about diagnostic messages is now used. When a response is received, completed but not successful, then set the diagnostic message as not supported and clean the request from the queue. Subscription remains for now, not cool but will be fix soon. Change-Id: Ia5dc78d4a770f80f144724f4df6eabd2ffd4b8cc Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Improve commentsRomain Forlot1-0/+1
Change-Id: I1e43b0aeaff738db11695e77fee23e8c9809f0c1 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Fix diagnostic message name mismatch at decoding.Romain Forlot1-1/+1
Retrieve adr name prefixed will add uneeded prefix as it is already present. At build time of a Diagnostic request from a diagnostic message, this prefix is added so adr name is already correct. *adr: active diagnostic request Change-Id: Ie5c364bf47a28c80290021651941cd37fa26321a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Follow rename operation in CMakeLists.txtRomain Forlot1-1/+1
Rename has been made with filter-branch using utility git-mv-with-history, so file history follow the rename operation. This is a commit to fix include and CMake file. Change-Id: I8542c7def3143854a2008fa069dd3232f2497394 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Small fixesRomain Forlot1-3/+3
Align frequency type to float and removed useless code. Change-Id: I13d9407808c42ece0d3fd761351752ad661e01e0 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Finalization of decoding part of diagnostic messages.Romain Forlot2-36/+92
Diagnostic request must have a name to be subscribed. Else, we can't decode or event push for now. Change-Id: I0901a71da31320d8598e512614437aceb552713d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Retrieve easily Diagnostic Request PID from an Active Diagnostic RequestRomain Forlot2-0/+10
Change-Id: I787cd94b338c458fda0259bd2bcf47a1fa85cc3f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Rename class and 1:1 map to JSON description fileRomain Forlot2-12/+30
Added decoder and callback member that will be set by generator and taken at submission to be used later, storing them into an active diagnostic request instance, when response CAN message comes in. Change-Id: I9ded05de3bb28ec55e4e007d72d0e1924141a6a6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Make available decoding OBD2 messages method to be use as callback.Romain Forlot2-19/+0
Change the method to static 'cause it will be call from outside of the class. Change-Id: I88dcd845559fac7892cd489cd6e8198c143ee2a8 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Simplification of checking Diagnostic response.Romain Forlot2-25/+16
A CAN message will be considered as a Diagnostic response when its arbitration ID is between standardized 0x7E8 and 0x7EF. Checking which request belong to that response will done in later methods Change-Id: I7a093edf44b62a4552b90fe3d8935f94dc677cf4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Revert accessing CAN device with a map indexing on dev nameRomain Forlot4-20/+24
Main reason for that behavior revert is because of generator that rely on CAN device name and so we have point on these object by specify the device name. Instead of shared pointer between objects, instead binding is based on device name. With a device name you can get the shared pointer on it using new static method from can_bus_t object. Change-Id: I331e0ad8d03c88a15c697d12a9fce3699b0cd962 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Uniformization between get_name() method of signals.Romain Forlot1-2/+2
can_signal_t and active_diagnostic_message return name with prefix using this method. If you need without it then use get_generic_name. Change-Id: I6b153eb20214049c10619d39fcc65c8641a9e32f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Change way to check prefix of signals name.Romain Forlot2-2/+5
Change-Id: I9a0726ab41c4801e7a5305731ce78ddd03aff9e1 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Improve shims_logger function to get full details.Romain Forlot1-3/+8
Change-Id: I752db65cb3fbca4d33b932f3a0c597adfaf79903 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Get recurring requests works.Romain Forlot1-38/+33
Implements event_loop logic. Change-Id: Ia5ac32820a0421bbcb69d8b0dd3bea2b7b582444 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Simplification of diagnostic manager. Delete uneeded vectorRomain Forlot2-51/+22
Control size manually, don't rely on STL container. Change-Id: Iede2f9b233c5b8a6dc77c9b146ffc92da8e7a989 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Less control before process the CAN message.Romain Forlot1-6/+5
Change-Id: I341d29d217b2a92652e9985d8c93829e0211bddc Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Implement regular event launching using systemd event loopRomain Forlot1-11/+16
Regular events is made launch a timerfd event from binder event loop and then in the event handler, reschedule next launch in the future based upon the signal frequency. Change-Id: I0b1e84eb2135474f4bcc5ee256ba513eea4035a6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Move diagnostic requests scheduling to diagnostic managerRomain Forlot1-1/+22
while adding the request. It is more logic to make that here than in the subscription operation. Change-Id: I19b29bc11c5fb6e5828a0bf189fac1333b0199ed Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Fix: Initialization and entries flowRomain Forlot1-8/+11
between diagnostic manager vector. Change-Id: I9ea196b5dc5bbf2dd4509080a9a58d754fa42b6c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Move member from obd2_signals_t class toRomain Forlot4-80/+47
active_diagnostic_request_t (adr)class. It's more logical to have them here as call about incoming diagnostic CAN messages are made against adr class not obd2_signal_t that it's a subset of diagnostic messages. It's made to handle obd2 requests as well as normal UDS diagnostic request for constructor proprietary diagnostic signals. Change-Id: I96c714640d6ecfa25dfc9942974057c1797eb0e1 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Get decoding diagnostic request from decoding thread of can_bus_tRomain Forlot2-0/+64
Decoding divided in 2 subfunctions dedicated to decode either pure CAN messages or diagnostic (obd2) message. About now, a diagnostic request has a name then it will be pushed on the event_queue as a SimpleMessage. Without name full details of diagnostic response will be pushed as diagnostic response. This behavior follows the one from OpenXC. Change-Id: I255f3f6487fa9511ea47c74606014995a7b0f720 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Change the way to check signal type making prefix_Romain Forlot2-8/+10
attribute as static with a static class method which will check that the beginning of string argument matches the prefix. Change-Id: Idb129c7179391da61447996560957b2791aa9383 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Reordering class method.Romain Forlot1-17/+17
Change-Id: I61cca1117a987280383538a0b0e307429bee4fc3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Change method returned value. Needed with send_request()Romain Forlot2-10/+7
method to retrieve the active_diagnostic_request. Change-Id: Icfba704e40be211021dc81ec18fa3602d736afdb Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Implemente way to send diagnostic request when subscribed.Romain Forlot6-1/+93
When subscribed, the signal is added to recurring request list of diagnostic manager and an event is added to the systemd event loop with timer set using frequency parameter from the requested signal. Change-Id: I4d604c498047d7744c090b7f03fce0f2b427fd01 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Make diagnostic manager initialization processus.Romain Forlot4-37/+45
It is initiliazed with by default the first CAN bus device in the CAN bus device list from CAN bus manager. The object is instancied at configuration_t object first invokation and after all CAN buses has been initialized then the diag manager is initialized too. Change-Id: I4894f2c62f575676c34efec3608b97de8c5326e1 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16We doesn't modify member once getted, we can use const returnRomain Forlot2-9/+26
and const method. Change-Id: I0f7465af74b1c9a546af45a0d1eea33c93537e0c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Manage prefix on CAN and OBD2 prefix. Searching signalsRomain Forlot2-24/+15
is made on generic_name (without prefix) and returned vector of string is filled with name with prefix. Then you can process on them based upon their name differently. OBD2 signals will generated recurring request on diagnostic manager and decoding will not be handled the same way too. Change-Id: I2c5239ef49661941a0a748debe0bd536b2954b3a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Instead of a global pointer, config is now a Singleton.Romain Forlot1-1/+1
Change-Id: I0cfc34f330c531ba5f070542a1cb723be4bcc70a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Keep raw pointer for now as we have to move them around vector.Romain Forlot4-64/+81
Change-Id: I8a518540b54552d60c6fd1054a0fc41dda5400b4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Finalize the class active_diag... to get it compile.Romain Forlot4-36/+43
Fix subsequents bugs into the other depending class diagnostic manager Change-Id: I8920c489fc15a61a36ff29d58aab59c2e6388f85 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Adding requests to diagnostic manager implemented.Romain Forlot4-40/+313
Needed overload of operator and constructor set for active_diagnostic_message_t class. Without we can't make the basic operation needed by the manager. Get rid of original raw pointer on "entry" which avoid some tests. It miss the acceptance filters implementations for now. Change-Id: I1ca61ff843c13255af6d9a60ce72a8b8bc9d1c18 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Fix: include statement with wrong path.Romain Forlot6-21/+31
And minor fixes. Change-Id: Ica55c0708edd86d0aa37e7117b3c3fad551a0167 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Added constructor to get vector initialized with defaultRomain Forlot4-36/+92
objects initialized that can be grabed after at runtime. Don't know the impact on performance for now about maximum limit. Change-Id: I220614d479b8254ae0efda66380e96434bcbfbb2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Add necessary to be able to initialize diagnostic manager shims.Romain Forlot2-3/+17
We have to conform to functions signatures from isotp-c to have it working. Change-Id: I429def66f54e53277e87aa99e66292cdb47c1c5f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Changing to a raw pointer can_bus_dev member and addRomain Forlot2-2/+7
a default constructor. It is needed to initialize configuration_t correctly as it allocate a diagnostic manager but do not initialize it unless it is needed later. There is no need to initialize it if we do not send and receive diagnostic requests. Change-Id: I3d52d1ea92454e7b065479a2f0dd54a291ddd991 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16FormatRomain Forlot1-27/+27
Change-Id: Ie9159b039e468e511b497884816453093048aa80 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Fix: include path (where I think to fix them...)Romain Forlot1-2/+3
Change-Id: Ib44693efc9347fc4fdf40a1748725d5191303199 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Fix: missed method declarationRomain Forlot1-1/+1
Change-Id: If44be94dfd847089d494088d33f7b6c7f5d9098e Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Better use a referenceRomain Forlot1-2/+2
Change-Id: Ie060009315c99919271ac706fdc1ab384e3d7218 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-03-16Respect the signature requested by uds-c lib.Romain Forlot2-3/+3
Change-Id: I7d7a96b45323f698e884c4db289370eec199d990 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
a id='n1430' href='#n1430'>1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434