Skip to content

Commit

Permalink
feat: display the ECU name and VIN number
Browse files Browse the repository at this point in the history
  • Loading branch information
AdonaiDiazEsparza committed Oct 22, 2024
1 parent 1e814be commit 77bfe70
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
Binary file modified Canbus_app/dist/canbus_app.fap
Binary file not shown.
Binary file modified Canbus_app/dist/debug/canbus_app_d.elf
Binary file not shown.
31 changes: 27 additions & 4 deletions Canbus_app/scenes/Obd2MenuOption.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void obdii_menu_callback(void* context, uint32_t index) {
break;

case 3:
request_data = 1;
request_data = 2;
scene_manager_next_scene(app->scene_manager, app_scene_car_data_option);
break;

Expand Down Expand Up @@ -1191,12 +1191,35 @@ static int32_t obdii_get_car_data(void* context) {

if(run) {
if(request_data == 1) {
get_VIN(&scanner, app->text);
if(get_VIN(&scanner, app->text)) {
widget_add_string_element(
app->widget,
64,
32,
AlignCenter,
AlignCenter,
FontSecondary,
furi_string_get_cstr(app->text));
} else {
draw_send_wrong(app);
}
}
if(request_data == 2) {
get_ECU_name(&scanner, app->text);
if(get_ECU_name(&scanner, app->text)) {
widget_add_string_element(
app->widget,
64,
32,
AlignCenter,
AlignCenter,
FontSecondary,
furi_string_get_cstr(app->text));
} else {
draw_send_wrong(app);
}
}
}
} else
draw_device_no_connected(app);

pid_deinit(&scanner);

Expand Down

0 comments on commit 77bfe70

Please sign in to comment.