4/25/2016

gRT GetTime/SetTime

Sample code name:
https://github.com/EfiPy/EfiPy2/blob/main/Efi/Apps/EfiPy2Sample/EfiPyTime.py

Description:
It is simple example of comparison between C language with EfiPy2 (ctypes)

# EFI_TIME TimeCur;
TimeCur = EfiPy2.EFI_TIME ()
# EFI_TIME_CAPABILITIES TimeCap;
TimeCap = EfiPy2.EFI_TIME_CAPABILITIES ()

# Status = gRT->GetTime (&TimeCur, &TimeCap);
Status  = EfiPy2.gRT.GetTime (EfiPy2.byref(TimeCur), EfiPy2.byref(TimeCap))

# TimeCur.Year = 2014;
TimeCur.Year = 2014
# TimeCur.Hour = 3;
TimeCur.Hour = 3

# Status = gRT->SetTime (&TimeCur);
Status  = 
EfiPy2.gRT.SetTime (EfiPy2.byref(TimeCur))
# Status = gRT->GetTime (&TimeCur, NULL);
Status  = 
EfiPy2.gRT.GetTime (EfiPy2.byref(TimeCur), None)

EfiPy2.byref is the sample as address of (&) in C language.

No comments:

Post a Comment