Dear everyone,
I will post for the first time.
I want to make an UEFI Application to set a wakeup time and boot the Mac.
To set a wakeup time, I wrote the following code.
But the error does not occur when application is running, but did not wakeup.
Will I have the use of the API that wrong?
----------
#include <Uefi.h>
#include <Library/UefiApplicationEntryPoint.h>
#include <Library/UefiLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
EFI_STATUS
EFIAPI
UefiMain (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS status;
EFI_TIME efiTime;
EFI_TIME_CAPABILITIES cap;
status = gRT->GetTime( &efiTime, &cap );
if( status != EFI_SUCCESS )
{
Print(L"GetTime() - failed (0x%08x)\n", status);
}
else
{
Print(L"GetTime() - Success %04d/%02d/%02d %02d:%02d:%02d\n",
efiTime.Year, efiTime.Month, efiTime.Day, efiTime.Hour, efiTime.Minute,
efiTime.Second);
efiTime.Minute += 5; // 5 minutes later
status = gRT->SetWakeupTime( TRUE, &efiTime );
if( status != EFI_SUCCESS )
{
Print(L"SetWakeupTime() - failed (0x%08x)\n", status);
}
else
{
Print(L"SetWakeupTime() - Success\n" );
gRT->ResetSystem(EfiResetShutdown, EFI_SUCCESS, 0, NULL);
}
}
return EFI_SUCCESS;
}
----------
API: UEFI Development Kit 2010 SR1 UP1 P1 Release
Exec Machine: MacBook Pro (1st model 32bit)
EFI Develop Machine: Dell (Windows XP, Visual Studio 2010 command prompt)
Tool: rEFIrd (EFI Shell)
Best regards,
Kyosuke Otsuki
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel