Skip to content

Commit

Permalink
plugins: adrv9002: added option to load profile even with API version…
Browse files Browse the repository at this point in the history
… mismatch

Signed-off-by: Andrei Popa <[email protected]>
  • Loading branch information
andrei47w committed May 13, 2024
1 parent 0f1e1fb commit 62b4118
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions plugins/adrv9002.c
Original file line number Diff line number Diff line change
Expand Up @@ -2301,10 +2301,23 @@ static bool profile_gen_check_api(gpointer data)
}

if(strcmp(strip_nonnumeric_chars(supported_version), strip_nonnumeric_chars(version)) != 0) {
sprintf(message, "\nOnly API version %s is supported, the device uses %s!", supported_version, version);
profile_gen_set_debug_info(data, message);
free(supported_version);
goto err;
sprintf(message,
"\nDriver API - Profile generator API version mismatch\nDriver (%s)"
"\nProfile Generator (%s)",
supported_version, version);
GtkWidget *adrv9002_panel = GTK_WIDGET(gtk_builder_get_object(priv->builder, "adrv9002_panel"));
GtkWidget *dialog =
gtk_message_dialog_new(GTK_WINDOW(gtk_widget_get_toplevel(adrv9002_panel)),
GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_WARNING, GTK_BUTTONS_YES_NO,
"%s\n\nAre you sure you want to load the profile?", message);
gint response = gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);

if(response != GTK_RESPONSE_YES) {
profile_gen_set_debug_info(data, message);
free(supported_version);
goto err;
}
}

free(supported_version);
Expand Down

0 comments on commit 62b4118

Please sign in to comment.