Share via


Setting the Alarm Example for OMA DM

4/8/2010

This example sets the alarm time on the device and turns the alarm on.

When you set the Alarm or Clock using a provisioning XML file, the Clock Configuration Service Provider expects you to provide the full date/time string in ISO 8601 standard date/time format:

[YYYY]-[MM]-[DD]T[hh]:[mm]:[ss]

For example, 2005-10-04T13:45:59Z represents 4 October 2005 at 1:45:59 PM. The 'Z' specifies Coordinated Universal Time (also known as UTC or Zulu time), which uses the 24-hour numbering system.

Code Example

<Replace>
   <CmdID>1</CmdID>
   <Item>
      <Target><LocURI>./Vendor/MSFT/Clock/AlarmOn</LocURI></Target>
      <Data>1</Data>
   </Item>
   <Item>
      <Target><LocURI>./Vendor/MSFT/Clock/AlarmTime</LocURI></Target>
      <Data>2007-09-28T18:30:00Z</Data>
      <!-- Use full ISO 8601 date/time format to set system Alarm or Clock. -->
      <!-- 'Z' specifies 24-hour UTC instead of AM/PM. For example, 18:30Z is 6:30PM -->
   </Item>
</Replace>

Remarks

One provisioning XML file typically contains configuration information for multiple Configuration Service Providers. To use this example, you must replace the values as appropriate, and add the node as a child of the SyncBody node in an OMA DM provisioning file. For more information about the syntax of the provisioning file, see OMA DM Provisioning Files.

Note

The Clock Configuration Service Provider for Windows Mobile Standard does not correctly handle the ISO 8601 standard date/time format. As a result, the end user will not be able to set the date, time or alarm after an OMA DM update. To prevent this, set the date/time as a string, in the format "1/1/1753 1:45:00 PM", not a date/time format as shown above.

See Also

Concepts

OMA DM Provisioning Files

Other Resources

Clock Configuration Service Provider Examples for OMA DM