add 0x19 ReadDTCInformation#86
Conversation
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
|
I just pushed and update of the iso14229.c/h files. I generated them using a different bazel and gcc version. (See attached patch) |
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
b0f2eb0 to
a993a71
Compare
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #86 +/- ##
===========================================
- Coverage 57.29% 33.22% -24.07%
===========================================
Files 6 2 -4
Lines 3004 2251 -753
Branches 609 470 -139
===========================================
- Hits 1721 748 -973
- Misses 903 1333 +430
+ Partials 380 170 -210 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks for this impressive PR @ParaZera . Please allow me some time to familiarize myself with the DTC submodule. |
Sure, I know it's a huge PR! I took the liberty of adding myself to the AUTHORS.txt file, since you offered this to my colleague as well. I hope that’s okay?! |
|
Just a heads up for your review: In my code I opted to do a length check for the responses from the event callback to ensure compliance with the standard. But I am unsure on how to correctly propagate a length error to the client since no valid NRC's seem to fit this usecase. Currently I respond wit the raw data from the callback (even if it is the wrong size), as it is also done in this way in the Other solutions I came up with are not responding at all and let the client run into a timeout or responding with NRC 0x10 (General Reject). If you have a suggestion or an opinion on what would be the correct way to handle this, I'll update the code accordingly. |
- renamed the current UDS library to `uds_legacy` (including Kconfig options) - added support for an external UDS-lib as a zephyr module (https://github.com/driftregion/iso14229) - Currently, there is a PR open to support the *Read DTC Information (`0x19`)* subFunction (driftregion/iso14229#86). - added low-level zephyr support via the `iso14229` library - added new uds library building ontop of the `iso14229` with currently support of the following functions: - Diagnostic Session Control (`0x10`) - ECU Reset (`0x11`) - Read/Write Data by Identifier (`0x22`, `0x2E`) - Read/Write Memeory be Address (`0x23`, `0x3D`) - Read DTC Information (`0x19`) - added tests for the *iso14229* and *uds* lib - added a new uds sample that demonstrates the aforementioned functions - documentation for the uds sample (rst) and lib (doxygen) - CI jobs build samples/tests on all supported os types (linux, mac, windows) Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
- renamed the current UDS library to `uds_legacy` (including Kconfig options) - added support for an external UDS-lib as a zephyr module (https://github.com/driftregion/iso14229) - Currently, there is a PR open to support the *Read DTC Information (`0x19`)* subFunction (driftregion/iso14229#86). - added low-level zephyr support via the `iso14229` library - added new uds library building ontop of the `iso14229` with currently support of the following functions: - Diagnostic Session Control (`0x10`) - ECU Reset (`0x11`) - Read/Write Data by Identifier (`0x22`, `0x2E`) - Read/Write Memeory be Address (`0x23`, `0x3D`) - Read DTC Information (`0x19`) - added tests for the *iso14229* and *uds* lib - added a new uds sample that demonstrates the aforementioned functions - documentation for the uds sample (rst) and lib (doxygen) - CI jobs build samples/tests on all supported os types (linux, mac, windows) Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
- renamed the current UDS library to `uds_legacy` (including Kconfig options) - added support for an external UDS-lib as a zephyr module (https://github.com/driftregion/iso14229) - Currently, there is a PR open to support the *Read DTC Information (`0x19`)* subFunction (driftregion/iso14229#86). - added low-level zephyr support via the `iso14229` library - added new uds library building ontop of the `iso14229` with currently support of the following functions: - Diagnostic Session Control (`0x10`) - ECU Reset (`0x11`) - Read/Write Data by Identifier (`0x22`, `0x2E`) - Read/Write Memeory be Address (`0x23`, `0x3D`) - Read DTC Information (`0x19`) - added tests for the *iso14229* and *uds* lib - added a new uds sample that demonstrates the aforementioned functions - documentation for the uds sample (rst) and lib (doxygen) - CI jobs build samples/tests on all supported os types (linux, mac, windows) Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
I see. This needs updating. My intent here is Line 292 in 4b4100b
I think sending a In summary, for all server user implementation issues, my preferred approach is:
|
|
sorry about that -- sonarqube is not yet configured properly. |
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
I updated the code and added tests for malformed responses and unknown subFunctions. I created one tests that iterates over all subfunctions and tests the correct NRC response. This has the advantage that there is less code duplication but also stops at the first error, so subsequent failures are not explicitly detected. |
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
|
I'm currently a little bit at a loss regarding the windows CI. I fixed the previous error by giving the union holding the subfunction arguments a name: typedef struct {
const uint8_t type; /*! invoked subfunction */
uint8_t (*copy)(UDSServer_t *srv, const void *src,
uint16_t count); /*! function for copying data */
union {
struct {
uint8_t mask; /*! DTC status mask */
} numOfDTCByStatusMaskArgs, dtcStatusByMaskArgs;
// ...
struct {
uint8_t functionalGroup; /*! Functional Group Identifier */
uint8_t
readinessGroup; /*! DTC Readiness Group Identifier (only used when type == 0x56) */
} wwhobdDTCWithPermStatusArgs, dtcInfoByDTCReadinessGroupIdArgs;
} subFuncArgs;
} UDSRDTCIArgs_t;But now the job complains about: Where line 542 in the test_server.c file is: void test_0x19_sub_0x03_no_snapshots(void **state) {Sadly, I can't really solve this problem locally as I seldom work on windows and don't know about its quirks. Do you have an idea why the compiler complains here? |
|
I can confirm that the same compiler error occurs on my Windows machine. I can also see the same warning here: https://godbolt.org/z/79ds1dYWc I can make that warning go away by writing Test0x19FnData_t fn_data = {.data = NULL, .len = 0};instead of uint8_t ResponseData[] = {};
Test0x19FnData_t fn_data = {.data = ResponseData, .len = sizeof(ResponseData)}; |
This is a fix for the windows CI build Signed-off-by: Tim Schrader <tim.schrader@frickly.systems>
|
|
Looks good. Nice work. |




The PR should add support for the 0x19 ReadDTCInformation function
I created one commit for each subfunction with some refactoring commits in between to help with the review.