Types of Alarm

This section explains the various types of alarms that are handled by the Alarm Server.

Session alarms and Non-Session alarms are handled by the Alarm Server after creating a session using RASCliSession function.

Session Alarms

The alarms that are removed from the alarm queue when the session disconnects are referred as Session Alarms. Session alarms can either be synchronous or asynchronous.

The session-based alarms are defined by setting an alarm’s characteristics flag as TAlarmCharacteristics::EAlarmCharacteristicsSessionSpecific.

Session Alarms are handled on behalf of a session with the Alarm Server. Each session is allowed to set only one Session Alarm. The server informs the session when to set the next alarm. If the session disconnects, the Session Alarm is cancelled.

The Session Alarm is completed when the alarm expires, is cancelled, or a timing error occurs.

NOTE: If the client session is closed before the alarm has expired, the Alarm Server automatically dequeues the alarm.

Synchronous Session Alarms

To add a session alarm to the queue synchronously, use RASCliSession::AlarmAdd().

Asynchronous Session Alarms

To add a session alarm to the queue asynchronously, use RASCliSession::AlarmAddWithNotification(). If a client decides to cancel a Session Alarm, it must use RASCliSession::AlarmNotificationCancelAndDequeue(). This requires that the ID of the alarm object be passed to the Alarm Server, so that it can correctly identify the Session Alarm to be removed.

Non-Session Alarms

The alarms that continue to persist in the alarm queue, even after their session owner which added these alarms disconnect, are referred as Non-Session alarms. They are independent of the client that set them.

Non-Session alarms are also referred as Orphaned Session alarms because these alarms are orphaned with no session owners.

Wake-Up Alarms

An alarm that wakes-up the device, if the device is switched OFF when the alarm expires, is referred to as Wake-Up alarm. If the device is in the normal state, then it works as a clock alarm.

It is set using RASCliSession::SetWakeup, by passing the unique identifier of the alarm.

A wake-up alarm that has been set and not started alerting the device user is referred as an active Wake-Up alarm. Alarm Server sets EActiveWakeupAlarmSet value if there are active wake-up alarm(s) else, it sets EActiveNoWakeupAlarmsSet value.