]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Add submitted callback test case in DriverSample
authorDandan Bi <dandan.bi@intel.com>
Tue, 23 Feb 2016 03:04:20 +0000 (11:04 +0800)
committerFeng Tian <feng.tian@intel.com>
Thu, 25 Feb 2016 06:42:25 +0000 (14:42 +0800)
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>
MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni

index 8ec1d4e6e81c57fe422f33c4738094cbf5b9dfe3..efb78bf6be1c5b0eab6f4dba946f992c5e74375d 100644 (file)
@@ -2,7 +2,7 @@
 This is an example of how a driver might export data to the HII protocol to be\r
 later utilized by the Setup Protocol\r
 \r
 This is an example of how a driver might export data to the HII protocol to be\r
 later utilized by the Setup Protocol\r
 \r
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -1834,6 +1834,28 @@ DriverCallback (
     }\r
   break;\r
 \r
     }\r
   break;\r
 \r
+  case EFI_BROWSER_ACTION_SUBMITTED:\r
+    {\r
+      if (QuestionId == 0x1250) {\r
+        //\r
+        // Sample CallBack for EFI_BROWSER_ACTION_SUBMITTED action:\r
+        // Show up a pop-up to show SUBMITTED callback has been triggered.\r
+        //\r
+        do {\r
+          CreatePopUp (\r
+            EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
+            &Key,\r
+            L"",\r
+            L"EfiVarstore value has been submitted!",\r
+            L"Press ESC or ENTER to continue ...",\r
+            L"",\r
+            NULL\r
+            );\r
+        } while ((Key.ScanCode != SCAN_ESC) && (Key.UnicodeChar != CHAR_CARRIAGE_RETURN));\r
+      }\r
+    }\r
+    break;\r
+\r
   default:\r
     Status = EFI_UNSUPPORTED;\r
     break;\r
   default:\r
     Status = EFI_UNSUPPORTED;\r
     break;\r
index c8262a45a07d3eb1ed3650a8a9740e28279fafbe..0b9e15f9bcbec6262f47d72aba83b1f574abb3c6 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
 /** @file\r
 \r
-Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -78,6 +78,7 @@ typedef struct {
   UINT8         Field8;\r
   UINT16        Field16;\r
   UINT8         OrderedList[3];\r
   UINT8         Field8;\r
   UINT16        Field16;\r
   UINT8         OrderedList[3];\r
+  UINT16        SubmittedCallback;\r
 } MY_EFI_VARSTORE_DATA;\r
 \r
 //\r
 } MY_EFI_VARSTORE_DATA;\r
 \r
 //\r
index c48b06a3a586756c5ad06a6b31717250a949f8be..d1ce68dfb2d30f5ce057f25e1be0cab6a5edb8db 100644 (file)
@@ -485,6 +485,16 @@ formset
         help = STRING_TOKEN(STR_TEXT_SECRUITY_TEST_HELP),\r
         text = STRING_TOKEN(STR_TEXT_SECRUITY_TEST_TEXT);\r
     endif;\r
         help = STRING_TOKEN(STR_TEXT_SECRUITY_TEST_HELP),\r
         text = STRING_TOKEN(STR_TEXT_SECRUITY_TEST_TEXT);\r
     endif;\r
+\r
+    numeric varid   = MyEfiVar.SubmittedCallback,\r
+            questionid = 0x1250,\r
+            prompt  = STRING_TOKEN(STR_SUBMITTED_CALLBACK_TEST_PROMPT),\r
+            help    = STRING_TOKEN(STR_SUBMITTED_CALLBACK_TEST_HELP),\r
+            flags   = INTERACTIVE,\r
+            minimum = 0,\r
+            maximum = 255,\r
+            default = 18,\r
+    endnumeric;\r
     \r
     goto 2,\r
       prompt = STRING_TOKEN(STR_GOTO_FORM2), //SecondSetupPage  // this too has no end-op and basically it's a jump to a form ONLY\r
     \r
     goto 2,\r
       prompt = STRING_TOKEN(STR_GOTO_FORM2), //SecondSetupPage  // this too has no end-op and basically it's a jump to a form ONLY\r
index 2baaf52b366557376f071d7e827d942cbf8f1772..8d4448cc7fbbd562cbd7f7c06815c62cad643f56 100644 (file)
@@ -1,6 +1,6 @@
 // *++\r
        //\r
 // *++\r
        //\r
-// Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
+// Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
 // This program and the accompanying materials                          \r
 // are licensed and made available under the terms and conditions of the BSD License         \r
 // which accompanies this distribution.  The full text of the license may be found at        \r
 // This program and the accompanying materials                          \r
 // are licensed and made available under the terms and conditions of the BSD License         \r
 // which accompanies this distribution.  The full text of the license may be found at        \r
                                                      #language fr-FR "When select this option, browser will go to another formset."\r
 #string STR_DEVICE_PATH                              #language en-US ""\r
                                                      #language fr-FR ""                                                                                                           \r
                                                      #language fr-FR "When select this option, browser will go to another formset."\r
 #string STR_DEVICE_PATH                              #language en-US ""\r
                                                      #language fr-FR ""                                                                                                           \r
+#string STR_SUBMITTED_CALLBACK_TEST_PROMPT           #language en-US "Submitted callback test"\r
+                                                     #language fr-FR "Submitted callback test"\r
+#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"\r
+                                                     #language fr-FR "Change the value and press F10 to submmit will pop up a dialogue to show SUBMITTED Callback has been triggered"\r
 // Boot Order\r
 #string STR_BOOT_TITLE                 #language en-US "Boot"\r
 #string STR_BOOT_OPTIONS               #language en-US "Boot Order"\r
 // Boot Order\r
 #string STR_BOOT_TITLE                 #language en-US "Boot"\r
 #string STR_BOOT_OPTIONS               #language en-US "Boot Order"\r