Skip to content

Commit

Permalink
feat: functions created to get storaged DTC
Browse files Browse the repository at this point in the history
  • Loading branch information
AdonaiDiazEsparza committed Nov 29, 2024
1 parent 21ea089 commit 1dc0870
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Canbus_app/app_user.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#define MESSAGE_ERROR 0xF0

#define UDS_REQUEST_ID_DEFAULT 0x7df
#define UDS_REQUEST_ID_DEFAULT 0x7e1
#define UDS_RESPONSE_ID_DEFAULT 0x7e9

typedef enum {
Expand Down
18 changes: 18 additions & 0 deletions Canbus_app/libraries/uds_library.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,3 +329,21 @@ bool uds_reset_ecu(UDS_SERVICE* uds_instance, type_ecu_reset type) {

return true;
}

// Get Storaged DTC
bool uds_get_storaged_dtc(UDS_SERVICE* uds_instance, char* codes[]) {

Check failure on line 334 in Canbus_app/libraries/uds_library.c

View workflow job for this annotation

GitHub Actions / ufbt: Build for Dev branch

conflicting types for 'uds_get_storaged_dtc'; have '_Bool(UDS_SERVICE *, char **)'
uint8_t data[3] = {0x19, 0x1, 0x4};

CANFRAME frame_to_send = {0};
CANFRAME frame_to_received = {0};

if(!uds_multi_frame_request(
uds_instance, data, COUNT_OF(data), &frame_to_send, 1, &frame_to_received))
return false;

if(frame_to_received.buffer[1] != 0x59) return false;

UNUSED(codes);

return true;
}
3 changes: 3 additions & 0 deletions Canbus_app/libraries/uds_library.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ bool uds_set_diagnostic_session(UDS_SERVICE* uds_instance, diagnostic_session se
// Reset the ECU
bool uds_reset_ecu(UDS_SERVICE* uds_instance, type_ecu_reset type);

// Get ECU Storage Data Troubles Codes
bool uds_get_storaged_dtc(UDS_SERVICE* uds_instance, FuriString* text);

// Free uds
void free_uds(UDS_SERVICE* uds_instance);

Expand Down
1 change: 1 addition & 0 deletions Canbus_app/scenes/UDSOptions/DTCstorage.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../../app_user.h"

0 comments on commit 1dc0870

Please sign in to comment.