Alarm Meta Tag

PocketBrowser 3.x API

The Alarm Meta Tag is an action tag used to set an alarm and register an action to perform when that alarm fires.

Alarm (META Tag) Syntax
<META HTTP-Equiv="Alarm" content="[method / parameter]">
<META HTTP-Equiv="Alarm" content="AlarmTriggered:url('[jsFunction | url]')">

Items listed in this section indicate methods or, in some cases, indicate parameters which will be retrieved.

Name Description
Default Value
Clear Clears the currently set alarm N/A
Set Sets the alarm. The alarm will fire after the specified interval or at the specified time (see the parameters section). You can only have one active alarm at a time. N/A
Copy methods template to clipboard: Copy META Tag template to clipboard META Tags Copy Javascript template to clipboard Javascript

Items listed in this section indicate parameters, or attributes which can be set.

Name Possible Values Description
Default Value
Interval:[Value] Alarm Interval in the format HH-MM-SS Sets a time after which the Alarm will fire. The delay cannot be set to less that 30 seconds, if a value of less than 30 seconds is supplied, the delay will be defaulted to 30 seconds. N/A
Repeat:[Value] 'True' or 'False' Provided the alarm has been set using the Interval paramter the alarm will be reset once fired. If the alarm is set using the 'Time' parameter then this value is ignored. False
Time:[Value] Time in the format "YYYY-MM-DDtHH-MM-SStzd" (e.g. "2009-11-19t11-56-00+01-00"), See Remarks Sets the alarm to trigger at the specified time. N/A
Copy parameters template to clipboard: Copy META Tag template to clipboard META Tags Copy Javascript template to clipboard Javascript

Modules return information back to their web pages via retrieval tags, for example the scanner has a retrieval tag called 'DecodeEvent' which is called whenever it decodes a barcode. To register to receive a retrieval tag call the module as follows:

<META HTTP-Equiv="[Module]" content="[RetrievalTag]:url('[URI]')">
So to register to retrieve the Scanner's DecodeEvent the following syntax would be used:
<META HTTP-Equiv="Scanner" content="DecodeEvent:url('Javascript:doScan('%6', '%s', %3, '%2');')">

Retrieval tags return information by replacing the text in place holders, defined as '%s' or '%<number>'. Each place holder represents 1 return value with '%s' being populated sequentially or '%<number>' providing direct acces to the desired value.

If the content for the Scanner's DecodeEvent is:

"url('Javascript:doScan('%6', '%s', %3, '%2');')"

The function would be called as follows:
"Javascript:doScan('Decode', '5449000053879', 0x35, 'SCN:EAN13');"


AlarmTriggered
The alarm triggered event will be fired when either the alarm time reaches that specified in the 'Time' parameter or the period specified in 'Interval' expires. There is no data associated with the AlarmTriggered event.



The following example sets the alarm to display an alert box at a repeated interval of 1 hour:

<META HTTP-Equiv="Alarm-Set" Content="Interval:01-00-00; Repeat:True; AlarmTriggered:url('javascript:alert('Alarm Fired');')">
Copy example to clipboard Copy example to clipboard

The following example sets the alarm to display an alert box at 8am GMT on 27th July 2012:

<META HTTP-Equiv="Alarm-Set" Content="Time:2012-07-27t08-00-00+00-00; Repeat:True; AlarmTriggered:url('javascript:alert('London Olympics Start Today');')">
Copy example to clipboard Copy example to clipboard
Validity of registered action on Alarm Triggered
Uniquely for a PocketBrowser event the registered action for the AlarmTriggered event does not get cleared when you navigate away from the current page. If using a javascript function, you must ensure the script is still valid when the alarm fires or alternatively you can clear the alarm.

Minimum Time Interval
The Alarm is not designed to be triggered for intervals less than 30 seconds, if you require a shorter delay then consider using the JavaScript function 'SetTimeout'.

Explanation of Time Format
You must specify the time in GMT and then the device's timezone offset from that. E.g. a time expressed as 2012-07-27t08-30-00-05-00 breaks down as follows:
//  Assuming a device with timezone offset -5 hours
//  This alarm will fire at 8:30am (local time) on 27th July 2012
Year: 2012
Month: July
Day: 27th
Time: 13:30 exactly (GMT)
Timezone: -5 (Eastern Time, 8:30am local time)

Supported Platforms Windows CE, Windows Mobile
Persistence This tag is persistent until cleared.
Min. Requirements None