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
}\r
};\r
\r
+/**\r
+ Set value of a data element in an Array by its Index.\r
+\r
+ @param Array The data array.\r
+ @param Type Type of the data in this array.\r
+ @param Index Zero based index for data in this array.\r
+ @param Value The value to be set.\r
+\r
+**/\r
+VOID\r
+SetArrayData (\r
+ IN VOID *Array,\r
+ IN UINT8 Type,\r
+ IN UINTN Index,\r
+ IN UINT64 Value\r
+ )\r
+{\r
+\r
+ ASSERT (Array != NULL);\r
+\r
+ switch (Type) {\r
+ case EFI_IFR_TYPE_NUM_SIZE_8:\r
+ *(((UINT8 *) Array) + Index) = (UINT8) Value;\r
+ break;\r
+\r
+ case EFI_IFR_TYPE_NUM_SIZE_16:\r
+ *(((UINT16 *) Array) + Index) = (UINT16) Value;\r
+ break;\r
+\r
+ case EFI_IFR_TYPE_NUM_SIZE_32:\r
+ *(((UINT32 *) Array) + Index) = (UINT32) Value;\r
+ break;\r
+\r
+ case EFI_IFR_TYPE_NUM_SIZE_64:\r
+ *(((UINT64 *) Array) + Index) = (UINT64) Value;\r
+ break;\r
+\r
+ default:\r
+ break;\r
+ }\r
+}\r
+\r
/**\r
Add empty function for event process function.\r
\r
FreePool (TempPassword);\r
\r
//\r
- // Retrive uncommitted data from Browser\r
+ // Retrieve uncommitted data from Browser\r
//\r
Configuration = AllocateZeroPool (sizeof (DRIVER_SAMPLE_CONFIGURATION));\r
ASSERT (Configuration != NULL);\r
}\r
StringPtr += Length;\r
\r
+ //\r
+ // Skip the character "&" before "OFFSET".\r
+ //\r
+ StringPtr ++;\r
+\r
//\r
// Calculate Value and convert it to hex string.\r
//\r
EFI_STRING Results;\r
UINT32 ProgressErr;\r
CHAR16 *TmpStr;\r
- \r
+ UINTN Index;\r
+ UINT64 BufferValue;\r
+\r
if (((Value == NULL) && (Action != EFI_BROWSER_ACTION_FORM_OPEN) && (Action != EFI_BROWSER_ACTION_FORM_CLOSE))||\r
(ActionRequest == NULL)) {\r
return EFI_INVALID_PARAMETER;\r
FormId = 0;\r
ProgressErr = 0;\r
Status = EFI_SUCCESS;\r
+ BufferValue = 3;\r
PrivateData = DRIVER_SAMPLE_PRIVATE_FROM_THIS (This);\r
\r
switch (Action) {\r
Value->u8 = DEFAULT_CLASS_STANDARD_VALUE;\r
break;\r
\r
+ case 0x1252:\r
+ for (Index = 0; Index < 3; Index ++) {\r
+ SetArrayData (Value, EFI_IFR_TYPE_NUM_SIZE_8, Index, BufferValue--);\r
+ }\r
+ break;\r
+\r
default:\r
Status = EFI_UNSUPPORTED;\r
break;\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
EFI_STRING NameRequestHdr;\r
MY_EFI_VARSTORE_DATA *VarStoreConfig;\r
EFI_INPUT_KEY HotKey;\r
- EFI_FORM_BROWSER_EXTENSION_PROTOCOL *FormBrowserEx;\r
+ EDKII_FORM_BROWSER_EXTENSION_PROTOCOL *FormBrowserEx;\r
\r
//\r
// Initialize the local variables.\r
//\r
// Example of how to use BrowserEx protocol to register HotKey.\r
// \r
- Status = gBS->LocateProtocol (&gEfiFormBrowserExProtocolGuid, NULL, (VOID **) &FormBrowserEx);\r
+ Status = gBS->LocateProtocol (&gEdkiiFormBrowserExProtocolGuid, NULL, (VOID **) &FormBrowserEx);\r
if (!EFI_ERROR (Status)) {\r
//\r
// First unregister the default hot key F9 and F10.\r
DriverHandle[1],\r
&gEfiDevicePathProtocolGuid,\r
&mHiiVendorDevicePath1,\r
+ &gEfiHiiConfigAccessProtocolGuid,\r
+ &mPrivateData->ConfigAccess,\r
NULL\r
);\r
DriverHandle[1] = NULL;\r