Hi Tim,

The "key" is used to compatible with framework code.  I check the vfrcompile 
code, found the "key" is worked only when "flags" field has "INTERACTIVE" 
attribute. So the "key = 0" is not works for this sample code.  I will follow 
up to clean up this make user confused code.

Attach the ifr data for this sample code, it actually use 0x03 as the question 
id.
        checkbox varid   = MyIfrNVData.ChooseToActivateNuclearWeaponry,
>000001C6: 06 8E 29 00 2A 00 03 00 34 12 D4 00 00 03
                 prompt   = STRING_TOKEN(0x0029),
                 help     = STRING_TOKEN(0x002A),
                 flags    = CHECKBOX_DEFAULT | CHECKBOX_DEFAULT_MFG,
                 key      = 0,
                 default  = 1,
>000001D4: 5B 06 00 00 00 01
        endcheckbox;
>000001DA: 29 02
      endif;
>000001DC: 29 02
                endif;
>000001DE: 29 02

Thanks,
Eric
From: Tim Lewis [mailto:[email protected]]
Sent: Friday, August 15, 2014 8:48 AM
To: [email protected]
Subject: [edk2] "key" usage with VFR

The current grammar for VFR shows the following for "checkbox":


vfrStatementCheckBox ::=

  "checkbox"

  vfrQuestionHeader ","

  { "flags" "=" vfrCheckBoxFlags "," }

  { "key" "=" Number "," }

  vfrStatementQuestionOptionList
"endcheckbox" ";"

And then a little further down it has this note:

BEHAVIORS AND RESTRICTIONS:
The value of key is used as question ID.

Now, observe this example from DriverSampleDxe (Vfr.vfr, line 177):

        checkbox varid   = MyIfrNVData.ChooseToActivateNuclearWeaponry,
                 prompt   = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
                 help     = STRING_TOKEN(STR_CHECK_BOX_HELP),
                 //
                 // CHECKBOX_DEFAULT indicate this checkbox is marked with 
EFI_IFR_CHECKBOX_DEFAULT
                 // CHECKBOX_DEFAULT_MFG indicate EFI_IFR_CHECKBOX_DEFAULT_MFG.
                 //
                 flags    = CHECKBOX_DEFAULT | CHECKBOX_DEFAULT_MFG,
                 key      = 0,
                 default  = 1,
        endcheckbox;

Notice that (a) there is no "questionid" (from the vfrQuestionHeader terminal) 
and (b) key is set to 0. Since 0 is not a valid question identifier value 
(although the UEFI 2.4 spec is not so clear on this, you can see that it is 
true from how it is referenced in the EFI_IFR_REF structure 29.3.8.3.59 and the 
callback). So it is not clear whether the intention was to force the assignment 
of a non-conflicting value or it really intended that the question identifier 
be 0.

There is a similar issue on line 590 (another checkbox). Am I missing something 
here? Is there a specific reason why "key" (an anachronism from the Framework 
days) is used instead of "questionid"?


------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to