Skip to content

Commit

Permalink
feat: example obd2 added
Browse files Browse the repository at this point in the history
  • Loading branch information
AdonaiDiazEsparza committed Aug 12, 2024
1 parent 98ef373 commit 038db5e
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 19 deletions.
69 changes: 50 additions & 19 deletions Canbus_app/scenes/Obd2MenuOption.c
Original file line number Diff line number Diff line change
@@ -1,40 +1,71 @@
#include "../app_user.h"

/*
This the menu of OBDII SCANNER
IN A FUTURE WE WILL ADD FEATURES AS:
- SCAN PID CODES
- HACKING PID CODES
- SCAN AND ERASE DTC ERRORS
- ALL THE FUNCTIONALITIES AS OBDII SCANNER HAS
*/

void obdii_menu_callback(void* context, uint32_t index) {
App* app = context;
UNUSED(app);
switch(index) {
App* app = context;
UNUSED(app);
switch (index) {
case 0:
//
break;
//
break;

default:
break;
}
break;
}
}

void app_scene_obdii_menu_on_enter(void* context) {
App* app = context;
App* app = context;

submenu_reset(app->submenu);
submenu_reset(app->submenu);

submenu_set_header(app->submenu, "OBDII SCANNER");
submenu_set_header(app->submenu, "OBDII SCANNER");

// Example
submenu_add_item(app->submenu, "Engine Speed", 0, obdii_menu_callback, app);
// Example
submenu_add_item(app->submenu, "Engine Speed", 0, obdii_menu_callback, app);

submenu_set_selected_item(app->submenu, 0);
submenu_set_selected_item(app->submenu, 0);

view_dispatcher_switch_to_view(app->view_dispatcher, SubmenuView);
view_dispatcher_switch_to_view(app->view_dispatcher, SubmenuView);
}

bool app_scene_obdii_menu_on_event(void* context, SceneManagerEvent event) {
UNUSED(context);
UNUSED(event);
return false;
UNUSED(context);
UNUSED(event);
return false;
}

void app_scene_obdii_menu_on_exit(void* context) {
App* app = context;
submenu_reset(app->submenu);
App* app = context;
submenu_reset(app->submenu);
}

/*
EXAMPLE WITH A ENGINE SPEED
*/

void app_scene_engine_rpm_speed_on_enter(void* context) {
App* app = context;

UNUSED(app);
}

bool app_scene_engine_rpm_speed_on_event(void* context,
SceneManagerEvent event) {
UNUSED(context);
UNUSED(event);
return false;
}

void app_scene_engine_rpm_speed_on_exit(void* context) {
App* app = context;
submenu_reset(app->submenu);
}
1 change: 1 addition & 0 deletions Canbus_app/scenes_config/app_scene_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ ADD_SCENE(app, about_us, about_us)

// On development
ADD_SCENE(app, obdii_menu, obdii_option)
ADD_SCENE(app, engine_rpm_speed, engine_speed_option)

0 comments on commit 038db5e

Please sign in to comment.