Supported Intel AMT Features > Alarm Clock > Using the Alarm Clock API
CollapseAll image

Using the Alarm Clock API

The HLAPI implements the Alarm Clock feature in the Alarm Clock API.

The available methods are described in the IAlarmClock interface.

The deprecated HLAPI supports only one alarm on a platform, including 8.0 and later releases of Intel AMT. The  following methods are deprecated:

   DisableAll

   GetAlarmClockSettings

   SetRecurringAlarm

   SetSingleAlarm

The following describes the API that fully suports all versions of Intel AMT, including Release 8.0:

In the HLAPI, in releases of Intel AMT before Release 8.0 that support an alarm clock, there is only one alarm, called DefaultAlarm. In Release 8.0 or later releases there are an additional four alarms called OptionalAlarm objects.

To create alarms, invoke AlarmClock.CreateOrUpdateAlarms with an AlarmClockList object.

An AlarmClockList Object contains two properties:

   DefaultAlarm – the Alarm that will be defined on all Intel AMT generations that support the alarm clock feature.

   List of OptionalAlarms that contains four additional alarms.

During the execution of AlarmClock.CreateOrUpdateAlarms, the HLAPI checks what the Intel AMT version is and if it smaller than 8.0, then it sets only the Default Alarm, and if it is Release 8.0 or greater it sets the additional Optional Alarms List.

After creating alarms you can retrieve them with AlarmClock.GetAllAlarms.

 Note:

   On the Intel AMT versions before Release 8.0, the DefaultAlarm will be created on AMT_AlarmClockService class. In Release 8.0 and later,  the DefaultAlarm will be created in the same way that the OptionalAlarms are created – but it is named “DefaultAlarm”.

   The AlarmClock feature expects that the Intel AMT network time will be in UTC format, and all alarms that it will configure will be in that format.If the Intel AMT time is not in UTC, the HLAPI will throw an exception. Use TimeSynchronization.SetUtcNetworkTime to set the Intel AMT time to UTC format.

   OptionalAlarm and DefaultAlarm HLAPI objects contain a TimeZoneInfo .NET object as one member. This object allows defining the StartTime property in any TimeZone. The HLAPI functions will be able to translate the TimeZoneInfo information to UTC TimeZone. For more details see OptionalAlarm andDefaultAlarm objects.

For example:

If the Intel AMT device is in Arizona time zone (UTC-7), an exception will be thrown.

If OptinalAlarm object TimeZoneInfo property is in Taipei time zone (UTC+8) and Intel AMT time is in UTC time zone, the HLAPI will get the Intel AMT time, convert the OptimalAlarm time to UTC(i.e. -8), and the set operation will succeed.

 

Examples

These C# examples show how to use the Alarm Clock API (after connecting to the Intel AMT device).

Examples using the Alarm Clock API:

Create a basic alarm

This alarm will be initialized on all Intel AMT generations that support alarm clock.

 

Create an improved alarm

This alarm will be initialized only for Intel AMT Release 8.0 later releases.

DefaultAlarm defaultAlarm = newDefaultAlarm(newDateTime(2013, 1, 1), TimeZoneInfo.Local, newTimeSpan(1,12,0,0));

OptionalAlarm optionalAlarm1 = newOptionalAlarm("OptionalAlarm1", newDateTime(2013, 1, 1), TimeZoneInfo.Local, newTimeSpan(0, 12, 0));

List<OptionalAlarm> optionalAlarmsList = newList<OptionalAlarm>();

optionalAlarmsList.Add(optionalAlarm1);

AlarmClockList alarmClockList = newAlarmClockList(defaultAlarm, optionalAlarmsList);

// create or update alarms.

AlarmClock.CreateOrUpdateAlarms(alarmClockList);

 

Get all alarms

AlarmClock.GetAllAlarmsSettings();

 

Delete an optional alarm

AlarmClock.DeleteOptionalAlarm("OptionalAlarm1");

 

Delete the default alarm

AlarmClock.DeleteDefaultAlarm();

 

Examples using the Deprecated Alarm Clock API:

Display the current alarm clock settings

AlarmClockSettings settings = amt.AlarmClock.GetAlarmClockSettings();

Console.WriteLine("Next Alarm Time: {0}", (settings.NextAlarmTime != DateTime.MinValue) ? settings.NextAlarmTime.ToString() : @"N\A");

Console.WriteLine("Alarm Clock Interval: {0}", (settings.AlarmInterval != null) ? settings.AlarmInterval.ToString() : @"N\A");

 

Set a single occurrence of the alarm clock

amt.AlarmClock.SetSingleAlarm(new DateTime(2010, 12, 12));

 

Set a recurring alarm clock

amt.AlarmClock.SetRecurringAlarm(new DateTime(2010, 12, 12), new AlarmInterval(1, 0, 0));

 

Disable the alarm clock

amt.AlarmClock.DisableAll();

 

See Also:

   Connecting to an Intel AMT Device

 

Copyright © 2006-2022, Intel Corporation. All rights reserved.