MdeModulePkg: Add submitted callback test case in DriverSample
Now we add new HII action type EFI_BROWSER_ACTION_SUBMITTED in EFI HII Configuration Access Protocol, so add the test case in DriverSample to show how to use it and whether it works. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
parent
3cb44c207c
commit
003f3c00d8
@ -2,7 +2,7 @@
|
|||||||
This is an example of how a driver might export data to the HII protocol to be
|
This is an example of how a driver might export data to the HII protocol to be
|
||||||
later utilized by the Setup Protocol
|
later utilized by the Setup Protocol
|
||||||
|
|
||||||
Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -1834,6 +1834,28 @@ DriverCallback (
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case EFI_BROWSER_ACTION_SUBMITTED:
|
||||||
|
{
|
||||||
|
if (QuestionId == 0x1250) {
|
||||||
|
//
|
||||||
|
// Sample CallBack for EFI_BROWSER_ACTION_SUBMITTED action:
|
||||||
|
// Show up a pop-up to show SUBMITTED callback has been triggered.
|
||||||
|
//
|
||||||
|
do {
|
||||||
|
CreatePopUp (
|
||||||
|
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
|
||||||
|
&Key,
|
||||||
|
L"",
|
||||||
|
L"EfiVarstore value has been submitted!",
|
||||||
|
L"Press ESC or ENTER to continue ...",
|
||||||
|
L"",
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
} while ((Key.ScanCode != SCAN_ESC) && (Key.UnicodeChar != CHAR_CARRIAGE_RETURN));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Status = EFI_UNSUPPORTED;
|
Status = EFI_UNSUPPORTED;
|
||||||
break;
|
break;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -78,6 +78,7 @@ typedef struct {
|
|||||||
UINT8 Field8;
|
UINT8 Field8;
|
||||||
UINT16 Field16;
|
UINT16 Field16;
|
||||||
UINT8 OrderedList[3];
|
UINT8 OrderedList[3];
|
||||||
|
UINT16 SubmittedCallback;
|
||||||
} MY_EFI_VARSTORE_DATA;
|
} MY_EFI_VARSTORE_DATA;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -486,6 +486,16 @@ formset
|
|||||||
text = STRING_TOKEN(STR_TEXT_SECRUITY_TEST_TEXT);
|
text = STRING_TOKEN(STR_TEXT_SECRUITY_TEST_TEXT);
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
numeric varid = MyEfiVar.SubmittedCallback,
|
||||||
|
questionid = 0x1250,
|
||||||
|
prompt = STRING_TOKEN(STR_SUBMITTED_CALLBACK_TEST_PROMPT),
|
||||||
|
help = STRING_TOKEN(STR_SUBMITTED_CALLBACK_TEST_HELP),
|
||||||
|
flags = INTERACTIVE,
|
||||||
|
minimum = 0,
|
||||||
|
maximum = 255,
|
||||||
|
default = 18,
|
||||||
|
endnumeric;
|
||||||
|
|
||||||
goto 2,
|
goto 2,
|
||||||
prompt = STRING_TOKEN(STR_GOTO_FORM2), //SecondSetupPage // this too has no end-op and basically it's a jump to a form ONLY
|
prompt = STRING_TOKEN(STR_GOTO_FORM2), //SecondSetupPage // this too has no end-op and basically it's a jump to a form ONLY
|
||||||
help = STRING_TOKEN(STR_GOTO_HELP);
|
help = STRING_TOKEN(STR_GOTO_HELP);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// *++
|
// *++
|
||||||
//
|
//
|
||||||
// Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// are licensed and made available under the terms and conditions of the BSD License
|
||||||
// which accompanies this distribution. The full text of the license may be found at
|
// which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -271,6 +271,10 @@
|
|||||||
#language fr-FR "When select this option, browser will go to another formset."
|
#language fr-FR "When select this option, browser will go to another formset."
|
||||||
#string STR_DEVICE_PATH #language en-US ""
|
#string STR_DEVICE_PATH #language en-US ""
|
||||||
#language fr-FR ""
|
#language fr-FR ""
|
||||||
|
#string STR_SUBMITTED_CALLBACK_TEST_PROMPT #language en-US "Submitted callback test"
|
||||||
|
#language fr-FR "Submitted callback test"
|
||||||
|
#string STR_SUBMITTED_CALLBACK_TEST_HELP #language en-US "Change the value and press F10 to submmit will pop up a dialogue to show SUBMITTED Callback has been triggered"
|
||||||
|
#language fr-FR "Change the value and press F10 to submmit will pop up a dialogue to show SUBMITTED Callback has been triggered"
|
||||||
// Boot Order
|
// Boot Order
|
||||||
#string STR_BOOT_TITLE #language en-US "Boot"
|
#string STR_BOOT_TITLE #language en-US "Boot"
|
||||||
#string STR_BOOT_OPTIONS #language en-US "Boot Order"
|
#string STR_BOOT_OPTIONS #language en-US "Boot Order"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user