The Time-based Alarm can either be on or off, and this value is stored in the AlarmActive property. Here we use a get operation to obtain the value of the AlarmActive property.
When the library receives get, set, and invoke operations, it first checks these operations against the DOF interface definition. If the interface does not contain a corresponding property or method, the provider application’s method is never called. This is according to the following specifications:
In a get operation, a requestor can get the current value of a readable interface property from a provider. A get operation can be initiated by the requestor as either a synchronous operation using the DOFObject.get method or as an asynchronous operation using DOFObject.beginGet.
We can use a a get operation to find out if the alarm is active. This is done by using the DOFObject.get method to retrieve the current value of the provider's AlarmActive property.
The timeout parameter specifies how long to wait for a response from the provider before the operation fails. If you don't want it to time out, use DOF.TIMEOUT_NEVER.
When the get operation completes, the method returns a DOFResult. This is the value of the specified property. We can use the DOFResult.asBoolean to get a the boolean value of the property.