Timer API

To use Samsung Product API,

<script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script>

Should be loaded in index.html

This module defines the functionalities of device OSD menu clock and timer as the Samsung Product API. The Timer module provides the Timer features
and clock features provided by the device to the API. You can turn on or turn off a device at the time you set up using the onTimer / offTimer WebAPI provided.
You can also set the clock date and time of device OSD menu.

Since : 6.5

Product : B2B

Privilege Level : Partner

Privilege : http://developer.samsung.com/privilege/devicetimer

Summary of Interfaces and Methods

Interface Method
TimerInfo

HolidayInfo

NTPInfo

DSTInfo

TimeSetting

TimerManagerObject

TimerManager

DOMString getVersion();
void setCurrentTime(TimeSetting currentTime);
TimeSetting getCurrentTime();
void setOnTimer(TimerInfo info);
TimerInfo getOnTimer(TimerID timer);
void setOffTimer(TimerInfo info);
TimerInfo getOffTimer(TimerID timer);
void addHoliday(HolidayInfo info);
void deleteHoliday(HolidayInfo info);
void applyTimerHoliday(HolidayInfo info);
DOMString getTimerHoliday(HolidayInfo info);
void setNTP(NTPInfo info);
NTPInfo getNTP();
void setDST(DSTInfo info);
DSTInfo getDST();
void setSystemTimeSyncTimeout(SyncTimeout timeout);
SyncTimeout getSystemTimeSyncTimeout();

1. Type Definitions

1.1 TimerID

Timer names of the device

enum TimerID {
  "TIMER1",
  "TIMER2",
  "TIMER3",
  "TIMER4",
  "TIMER5",
  "TIMER6",
  "TIMER7"
};

The following values are supported

  • TIMER1 : Name of the first timer
  • TIMER2 : Name of the second timer
  • TIMER3 : Name of the third timer
  • TIMER4 : Name of the fourth timer
  • TIMER5 : Name of the fifth timer
  • TIMER6 : Name of the sixth timer
  • TIMER7 : Name of the seventh timer

Since : 6.5

1.2 Activation

On/off value for specific features

enum Activation {
  "ON",
  "OFF"
};

The following values are supported

  • ON : Feature enabled
  • OFF : Feature disabled

Since : 6.5

1.3 TimerType

Timer type, either OnTimer or OffTimer

enum TimerType {
  "OnTimer",
  "OffTimer"
};

The following values are supported

  • OnTimer : OnTimer type
  • OffTimer : OffTimer type

Since : 6.5

1.4 TimerSetup

Days when the Timer triggers

enum TimerSetup {
  "TIMER_UNDEFINED",
  "TIMER_OFF",
  "TIMER_ONCE",
  "TIMER_EVERYDAY",
  "TIMER_MON_FRI",
  "TIMER_MON_SAT",
  "TIMER_SAT_SUN",
  "TIMER_MANUAL"
};

The following values are supported

  • TIMER_UNDEFINED : Invalid value
  • TIMER_OFF : Timer off
  • TIMER_ONCE : Trigger only once
  • TIMER_EVERYDAY : Trigger Monday to Sunday
  • TIMER_MON_FRI : Trigger Monday to Friday
  • TIMER_MON_SAT : Trigger Monday to Saturday
  • TIMER_SAT_SUN : Trigger Saturday to Sunday
  • TIMER_MANUAL : Set the trigger dates manually

Since : 6.5

1.5 TimerDay

Day of the week

enum TimerDay {
  "SUN",
  "MON",
  "TUE",
  "WED",
  "THU",
  "FRI",
  "SAT"
};

The following values are supported

  • SUN : Sunday
  • MON : Monday
  • TUE : Tuesday
  • WED : Wednesday
  • THU : Thursday
  • FRI : Friday
  • SAT : Saturday

Since : 6.5

1.6 SyncTimeout

Timeout values for time sync. If the device is unable to connect to the Samsung Server for sync, the System/Kernel Time is set as Menu time once this timeout elapses.

enum SyncTimeout {
  "30SEC",
  "45SEC",
  "60SEC",
  "75SEC",
  "90SEC",
  "105SEC",
  "120SEC"
};

The following values are supported

  • 30SEC : Timeout set to 30 seconds
  • 45SEC : Timeout set to 45 seconds
  • 60SEC : Timeout set to 60 seconds
  • 75SEC : Timeout set to 75 seconds
  • 90SEC : Timeout set to 90 seconds
  • 105SEC : Timeout set to 105 seconds
  • 120SEC : Timeout set to 120 seconds

Since : 6.5

2. Interfaces

2.1 TimerInfo

Timer settings information object

[NoInterfaceObject] interface TimerInfo {
  attribute TimerID timerID;
  attribute DOMString ? time;
  attribute TimerSetup ? setup;
  attribute long ? volume;
};

Attributes

  • TimerID timerID
    Timer ID, a unique identifier for a timer. One device can set 1 to 7 timers.
  • DOMString time [nullable]
    Time value (hour:minute). The time format is 00:00, with the hour value from 0 to 24, and the minute value from 0 to 59.
  • TimerSetup setup [nullable]
    TimerSetup enum value. Used when you want to set the Timer to be active only on certain days. This value can only be set for Timers with the OnTimer type.
  • long volume [nullable]
    Volume of the Timer alarm (values from 0 to 99).

2.2 HolidayInfo

Holiday settings information object

[NoInterfaceObject] interface HolidayInfo {
  attribute long ? startMonth;
  attribute long ? startDay;
  attribute long ? endMonth;
  attribute long ? endDay;
  attribute TimerType ? type;
  attribute TimerID ? timerID;
  attribute Activation ? timerOnOff;
};

Attributes

  • long startMonth [nullable]
    Holiday start month (1 to 12)
  • long startDay [nullable]
    Holiday start day (1 to 31)
  • long endMonth [nullable]
    Holiday end month (1 to 12)
  • long endDay [nullable]
    Holiday end day (1 to 31)
  • TimerType type [nullable]
    Timer on/off setting value
  • TimerID timerID [nullable]
    Timer ID value, a unique identifier for a timer. One device can set 1 to 7 timers.
  • Activation timerOnOff [nullable]
    Holiday on/off setting

2.3 NTPInfo

NTP (Network Time Protocol) settings information object

[NoInterfaceObject] interface NTPInfo {
  attribute Activation use;
  attribute DOMString address;
  attribute DOMString timeZone;
};

Attributes

  • Activation use
    NTP activation Enum value
  • DOMString address
    NTP setting URL (format "00.00.00.00")
  • DOMString timeZone
    NTP settings timeZone, such as "Asia/Seoul"

2.4 DSTInfo

DST (Daylight Savings Time) settings information object

[NoInterfaceObject] interface DSTInfo {
  attribute Activation mode;
  attribute TimeSetting start;
  attribute TimeSetting end;
  attribute DOMString offset;
};

Attributes

  • Activation mode
    DST Activation Enum value
  • TimeSetting start
    Start time setting
  • TimeSetting end
    End time setting
  • DOMString offset
    DST offset values (format: "+1", "+2"). Offset value +1 is offset by 1 hour; +2 is offset by 2 hours, and so on.

2.5 TimeSetting

Time settings information object

[NoInterfaceObject] interface TimeSetting {
  attribute long ? year;
  attribute long month;
  attribute long ? week;
  attribute TimerDay ? dayofweek;
  attribute long ? day;
  attribute long hour;
  attribute long minute;
  attribute long ? second;
};

Attributes

  • long year [nullable]
    Year (ex 2021)
  • long month
    Month (1 to 12)
  • long week [nullable]
    Week (0 to 4)
  • TimerDay dayofweek [nullable]
    TimerDay enum value
  • long day [nullable]
    Day (1 to 31)
  • long hour
    Hour (0 to 24)
  • long minute
    Minute (0 to 59)
  • long second [nullable]
    Second (0 to 59)

2.6 TimerManagerObject

The interface defines what is instantiated by the Timer object of the Samsung Product API.
A webapis.timer object allows access to the functionality of the Timer API.

[NoInterfaceObject] interface TimerManagerObject {
  readonly attribute TimerManager timer;
};
WebApi implements TimerManagerObject;

Attributes

  • readonly TimerManager timer
    Timer API namespace
    Since : 6.5

2.7 TimerManager

This interface provides methods to use Timer functionalities.

[NoInterfaceObject] interface TimerManager {
  DOMString getVersion();
  void setCurrentTime(TimeSetting currentTime);
  TimeSetting getCurrentTime();
  void setOnTimer(TimerInfo info);
  TimerInfo getOnTimer(TimerID timer);
  void setOffTimer(TimerInfo info);
  TimerInfo getOffTimer(TimerID timer);
  void addHoliday(HolidayInfo info);
  void deleteHoliday(HolidayInfo info);
  void applyTimerHoliday(HolidayInfo info);
  DOMString getTimerHoliday(HolidayInfo info);
  void setNTP(NTPInfo info);
  NTPInfo getNTP();
  void setDST(DSTInfo info);
  DSTInfo getDST();
  void setSystemTimeSyncTimeout(SyncTimeout timeout);
  SyncTimeout getSystemTimeSyncTimeout();
};

Since : 6.5

Methods

getVersion

This interface provides method to get timer module version.

DOMString getVersion();

Product : B2B

Privilege Level : Partner

Privilege : http://developer.samsung.com/privilege/devicetimer

Return Value :

  • DOMString : DOMString Timer plug-in version

Exceptions :

  • WebAPIException
    • with error type SecurityError if the application does not have the privilege to call this method
    • with error type UnknownError in any other error case

Since : 6.5

Code Example :

var Version = null;

try {
  Version = webapis.timer.getVersion();
} catch (e) {
  console.log("[getVersion] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

if (null !== Version) {
  console.log("[getVersion] call syncFunction type: " + Version);
}

setCurrentTime

This interface provides a method to set the clock (date and time) of device OSD menu. By this method, device OSD menu clock can be set differently from system date and time.

void setCurrentTime(TimeSetting currentTime);

Product : B2B

Privilege Level : Partner

Privilege : http://developer.samsung.com/privilege/devicetimer

Parameters :

  • currentTime : Setting information object

Exceptions :

  • WebAPIException
    • with the error type SecurityError if the application does not have the privilege to call this method
    • with the error type UnknownError in any other error case
    • with the error type TypeMismatchError if invalid parameter values passed for input parameter

Since : 6.5

Code Example :

var current_time = {
  "year" 	   : 2022,
  "month"    : 12,
  "day"	   : 15,
  "hour"     : 8,
  "minute"   : 55,
  "second"   : 43
}
try {
  webapis.timer.setCurrentTime(current_time);
} catch (e) {
  console.log("[setCurrentTime] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

getCurrentTime

This interface provides a method to get the current date and time of device OSD menu clock. The device OSD menu clock's date and time may be different from system date and time.

TimeSetting getCurrentTime();

Product : B2B

Privilege Level : Partner

Privilege : http://developer.samsung.com/privilege/devicetimer

Return Value :

  • TimeSetting : TimeSetting, It will be saved in TimeSetting attribute

Exceptions :

  • WebAPIException
    • with the error type SecurityError if the application does not have the privilege to call this method
    • with the error type UnknownError in any other error case

Since : 6.5

Code Example :

var CurrentTime = null;

try {
  CurrentTime = webapis.timer.getCurrentTime();
} catch (e) {
  console.log("[getCurrentTime] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
if(null !== CurrentTime){
  console.log("[getCurrentTime] call syncFunction type: " + CurrentTime);
}

setOnTimer

This interface provides a method to set the OnTimer of the device.

void setOnTimer(TimerInfo info);

Product : B2B (LFD)

Privilege Level : Partner

Privilege : http://developer.samsung.com/privilege/devicetimer

Parameters :

  • info : Timer information. Only the timerID, time, setup, volume, and manual attributes are supported.

Exceptions :

  • WebAPIException
    • with the error type SecurityError if the application does not have the privilege to call this method
    • with the error type TypeMismatchError if different type argument values are passed for an input parameter
    • with the error type NotSupportedError if this feature is not supported

Since : 6.5

Code Example :

var timer_profile1 = {
  "timerID" 	  : "TIMER1",
  "time"        : "19:50",
  "setup"       : "TIMER_ONCE",
  "volume"      :  10
};
var timer_profile2 = {
  "timerID" 	  : "TIMER2",
  "time"        : "19:50",
  "setup"       : "TIMER_MANUAL",
  "volume"      :  10,
  "manual"	  : ["WED","SUN"]
};

try {
  webapis.timer.setOnTimer(timer_profile1);
} catch (e) {
  console.log("[setOnTimer] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

getOnTimer

This interface provides a method to get the value set in the specified OnTimer.

TimerInfo getOnTimer(TimerID timer);

Product : B2B (LFD)

Privilege Level : Partner

Privilege : http://developer.samsung.com/privilege/devicetimer

Parameters :

  • timer : Timer to be retrieved. Only the timerID attribute is supported.

Return Value :

  • TimerInfo : TimerInfo Device OnTimer type and time

Exceptions :

  • WebAPIException
    • with the error type SecurityError if the application does not have the privilege to call this method
    • with the error type TypeMismatchError if different type argument values are passed for an input parameter
    • with the error type NotSupportedError if this feature is not supported

Since : 6.5

Code Example :

var OnTimer = null;
try {
  OnTimer = webapis.timer.getOnTimer("TIMER1");
} catch (e) {
  console.log("[getOnTimer] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
if(null !== OnTimer){
  console.log("[getOnTimer] call syncFunction Timer : " + OnTimer);
}

setOffTimer

This interface provides a method to set the OffTimer of the device.

void setOffTimer(TimerInfo info);

Product : B2B (LFD)

Privilege Level : Partner

Privilege : http://developer.samsung.com/privilege/devicetimer

Parameters :

  • info : Timer information. Only the timerID, time, and setup attributes are supported.

Exceptions :

  • WebAPIException
    • with the error type SecurityError if the application does not have the privilege to call this method
    • with the error type TypeMismatchError if different type argument values are passed for an input parameter
    • with the error type NotSupportedError if this feature is not supported

Since : 6.5

Code Example :

var timer_profile = {
  "timerID" 	  : "TIMER1",
  "time"        : "19:50",
  "setup"       : "TIMER_ONCE"
};

try {
  webapis.timer.setOffTimer(timer_profile);
} catch (e) {
  console.log("[setOffTimer] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

getOffTimer

This interface provides a method to get the value set in the specified OffTimer.

TimerInfo getOffTimer(TimerID timer);

Product : B2B (LFD)

Privilege Level : Partner

Privilege : http://developer.samsung.com/privilege/devicetimer

Parameters :

  • timer : Timer to be retrieved. Only the timerID attribute is supported.

Return Value :

Exceptions :

  • WebAPIException
    • with the error type SecurityError if the application does not have the privilege to call this method
    • with the error type TypeMismatchError if different type argument values are passed for an input parameter
    • with the error type NotSupportedError if this feature is not supported

Since : 6.5

Code Example :

var OnTimer = null;
try {
  OnTimer = webapis.timer.getOffTimer("TIMER1");
} catch (e) {
  console.log("[getOffTimer] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
if(null !== OnTimer){
  console.log("[getOffTimer] call syncFunction Timer : " + OnTimer);
}

addHoliday

This interface provides a method to add a holiday. It can be set for up to 15 days.

void addHoliday(HolidayInfo info);

Product : B2B (LFD)

Privilege Level : Partner

Privilege : http://developer.samsung.com/privilege/devicetimer

Parameters :

  • info : Information of the holiday as a HolidayInfo object. Only the startMonth, startDay, endMonth, and endDay attributes are supported.

Exceptions :

  • WebAPIException
    • with the error type SecurityError if the application does not have the privilege to call this method
    • with the error type TypeMismatchError if different type argument values are passed for an input parameter
    • with the error type NotSupportedError if this feature is not supported

Since : 6.5

Code Example :

var ADD_Holiday_profile = {
  "startMonth" :  8,
  "startDay"   :  15,
  "endMonth"   :  10,
  "endDay"     :  18
};
try {
  webapis.timer.addHoliday(ADD_Holiday_profile);
} catch (e) {
  console.log("[addHoliday] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

deleteHoliday

This interface provides a method to remove a holiday.

void deleteHoliday(HolidayInfo info);

Product : B2B (LFD)

Privilege Level : Partner

Privilege : http://developer.samsung.com/privilege/devicetimer

Parameters :

  • info : Information of the holiday as a HolidayInfo object. Only the startMonth, startDay, endMonth, and endDay attributes are supported.

Exceptions :

  • WebAPIException
    • with the error type SecurityError if the application does not have the privilege to call this method
    • with the error type TypeMismatchError if different type argument values are passed for an input parameter
    • with the error type NotSupportedError if this feature is not supported

Since : 6.5

Code Example :

var DEL_Holiday_profile = {
  "startMonth" :  8,
  "startDay"   :  15,
  "endMonth"   :  10,
  "endDay"     :  18
};
try {
  webapis.timer.deleteHoliday(DEL_Holiday_profile);
} catch (e) {
  console.log("[deleteHoliday] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

applyTimerHoliday

This interface provides a method to apply a holiday to a Timer.

void applyTimerHoliday(HolidayInfo info);

Product : B2B (LFD)

Privilege Level : Partner

Privilege : http://developer.samsung.com/privilege/devicetimer

Parameters :

  • info : Holiday to be applied

Exceptions :

  • WebAPIException
    • with the error type SecurityError if the application does not have the privilege to call this method
    • with the error type TypeMismatchError if different type argument values are passed for an input parameter
    • with the error type NotSupportedError if this feature is not supported

Since : 6.5

Code Example :

var timer_profile = {
  "type" 		   :  "OnTimer",
  "timerID"      :  "TIMER1",
  "timerOnOff"   :  "ON"
};
try {
  webapis.timer.applyTimerHoliday(timer_profile);
} catch (e) {
  console.log("[deleteHoliday] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

getTimerHoliday

This interface provides a method to get the list of holidays for a device.

DOMString getTimerHoliday(HolidayInfo info);

Product : B2B (LFD)

Privilege Level : Partner

Privilege : http://developer.samsung.com/privilege/devicetimer

Parameters :

  • info : Information of the holiday as a HolidayInfo object. Only the type and timerID attributes are supported.

Return Value :

  • DOMString : DOMString On/Off value

Exceptions :

  • WebAPIException
    • with the error type SecurityError if the application does not have the privilege to call this method
    • with the error type TypeMismatchError if different type argument values are passed for an input parameter

Since : 6.5

Code Example :

var Holiday = null;
var timer_profile = {
  "type" 		   :  "OnTimer",
  "timerID"      :  "TIMER1"
};
try {
  Holiday = webapis.timer.getTimerHoliday(timer_profile);
} catch (e) {
  console.log("[getHoliday] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
if(null !== Holiday){
  console.log("[getHoliday] call syncFunction type: " + Holiday);
}

setNTP

This interface provides a method to set the NTP info of the device.

void setNTP(NTPInfo info);

Product : B2B (LFD,HTV)

Privilege Level : Partner

Privilege : http://developer.samsung.com/privilege/devicetimer

Parameters :

  • info : NTP settings information object

Exceptions :

  • WebAPIException
    • with the error type SecurityError if the application does not have the privilege to call this method
    • with the error type TypeMismatchError if different type argument values are passed for an input parameter
    • with the error type NotSupportedError if this feature is not supported

Since : 6.5

Code Example :

var ntpinfo = {
  "use"       : "ON",
  "address"   : "10.89.10.13",
  "timeZone"  : "Asia/Seoul"
}
try {
  webapis.timer.setNTP(ntpinfo);
} catch (e) {
  console.log("[setNTP] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

getNTP

This interface provides a method to get the NTPUse status of the device.

NTPInfo getNTP();

Product : B2B (LFD,HTV)

Privilege Level : Partner

Privilege : http://developer.samsung.com/privilege/devicetimer

Return Value :

Exceptions :

  • WebAPIException
    • with the error type SecurityError if the application does not have the privilege to call this method
    • with the error type UnknownError in any other error case

Since : 6.5

Code Example :

var ntpinfo= null;
try {
  ntpinfo = webapis.timer.getNTP();
} catch (e) {
  console.log("[getNTP] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
console.log("[getNTP] call syncFunction type: " + ntpinfo);

setDST

This interface provides a method to set the DST mode to the clock of device OSD menu. This DST mode is not applied to system time

void setDST(DSTInfo info);

Product : B2B (LFD, IWB)

Privilege Level : Partner

Privilege : http://developer.samsung.com/privilege/devicetimer

Parameters :

  • info : DST settings information object

Exceptions :

  • WebAPIException
    • with the error type SecurityError if the application does not have the privilege to call this method
    • with the error type TypeMismatchError if different type argument values are passed for an input parameter
    • with the error type InvalidValuesError if invalid values are passed for an input parameter even if same argument type
    • with the error type NotSupportedError if this feature is not supported

Since : 6.5

Code Example :

var DSTInfo = {
  "mode"    :  "ON",
  "start"   :  {
    "month" 	 :  10,
    "week"  	 :  3,
    "dayofweek"  : "MON",
    "hour"  	 :  8,
    "minute"	 :  22 },
  "end"     : {
    "month" 	 :  11,
    "week"  	 :  9,
    "dayofweek"  : "MON",
    "hour"  	 :  13,
    "minute"	 :  58 },
  "offset":  "+1"
};

try {
  webapis.timer.setDST(DSTInfo);
} catch (e) {
  console.log("[setDST] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

getDST

This interface provides a method to get the clock's DST mode of device OSD menu.

DSTInfo getDST();

Product : B2B (LFD, IWB)

Privilege Level : Partner

Privilege : http://developer.samsung.com/privilege/devicetimer

Return Value :

  • DSTInfo : DSTInfo, DST DateTime object which contains all the data inside a DST start date menu item

Exceptions :

  • WebAPIException
    • with error type SecurityError if the application does not have the privilege to call this method
    • with error type UnknownError in any other error case

Since : 6.5

Code Example :

var DSTMode = null;
try {
  DSTMode = webapis.timer.getDST();
} catch (e) {
  console.log("[getDST] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
if(null !== DSTMode){
  console.log("[getDST] call syncFunction type: " + DSTMode);
}

setSystemTimeSyncTimeout

This interface provides a method to set the time sync timeout for the device.
If connection to the Samsung server cannot be made within the chose time period, the System/Kernel time is set to same as menu time.

void setSystemTimeSyncTimeout(SyncTimeout timeout);

Product : B2B (LFD)

Privilege Level : Partner

Privilege : http://developer.samsung.com/privilege/devicetimer

Parameters :

  • timeout : Timeout value

Remark :

  • If the System/Kernel time is not set and the Samsung time server is not reachable, then at reboot after the set timeout, the device sets its System/Kernel time same as the menu time.

Exceptions :

  • WebAPIException
    • with the error type SecurityError if the application does not have the privilege to call this method
    • with the error type TypeMismatchError if different type argument values are passed for an input parameter
    • with the error type InvalidValuesError if invalid values are passed for an input parameter even if same argument type
    • with the error type NotSupportedError if this feature is not supported

Since : 6.5

Code Example :

var timeout = "30SEC";
try {
  webapis.timer.setSystemTimeSyncTimeout(timeout);
} catch (e) {
  console.log("[setSystemTimeSyncTimeout] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

getSystemTimeSyncTimeout

This interface provides a method to get the time sync timeout.
If connection to the Samsung server cannot be made within the chose time period, the System/Kernel time is set to same as menu time.

SyncTimeout getSystemTimeSyncTimeout();

Product : B2B (LFD)

Privilege Level : Partner

Privilege : http://developer.samsung.com/privilege/devicetimer

Return Value :

  • SyncTimeout : SyncTimeout Current sync timeout value. The default is 30 seconds.

Remark :

  • If the System/Kernel time is not set and the Samsung time server is not reachable, then at reboot after the set timeout, the device sets its System/Kernel time same as the menu time.

Exceptions :

  • WebAPIException
    • with the error type SecurityError if the application does not have the privilege to call this method
    • with the error type UnknownError in any other error case

Since : 6.5

Code Example :

var TIMEOUT = null;
try {
  TIMEOUT = webapis.timer.getSystemTimeSyncTimeout();
} catch (e) {
  console.log("[getSystemTimeSyncTimeout] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
if(null !== TIMEOUT){
  console.log("[getSystemTimeSyncTimeout] call syncFunction type: " + TIMEOUT);
}

3. Full WebIDL

module Timer {
  enum TimerID {
    "TIMER1",
    "TIMER2",
    "TIMER3",
    "TIMER4",
    "TIMER5",
    "TIMER6",
    "TIMER7"
  };

  enum Activation {
    "ON",
    "OFF"
  };

  enum TimerType {
    "OnTimer",
    "OffTimer"
  };

  enum TimerSetup {
    "TIMER_UNDEFINED",
    "TIMER_OFF",
    "TIMER_ONCE",
    "TIMER_EVERYDAY",
    "TIMER_MON_FRI",
    "TIMER_MON_SAT",
    "TIMER_SAT_SUN",
    "TIMER_MANUAL"
  };

  enum TimerDay {
    "SUN",
    "MON",
    "TUE",
    "WED",
    "THU",
    "FRI",
    "SAT"
  };

  enum SyncTimeout {
    "30SEC",
    "45SEC",
    "60SEC",
    "75SEC",
    "90SEC",
    "105SEC",
    "120SEC"
  };

  [NoInterfaceObject] interface TimerInfo {
    attribute TimerID timerID;
    attribute DOMString ? time;
    attribute TimerSetup ? setup;
    attribute long ? volume;
  };

  [NoInterfaceObject] interface HolidayInfo {
    attribute long ? startMonth;
    attribute long ? startDay;
    attribute long ? endMonth;
    attribute long ? endDay;
    attribute TimerType ? type;
    attribute TimerID ? timerID;
    attribute Activation ? timerOnOff;
  };

  [NoInterfaceObject] interface NTPInfo {
    attribute Activation use;
    attribute DOMString address;
    attribute DOMString timeZone;
  };

  [NoInterfaceObject] interface DSTInfo {
    attribute Activation mode;
    attribute TimeSetting start;
    attribute TimeSetting end;
    attribute DOMString offset;
  };

  [NoInterfaceObject] interface TimeSetting {
    attribute long ? year;
    attribute long month;
    attribute long ? week;
    attribute TimerDay ? dayofweek;
    attribute long ? day;
    attribute long hour;
    attribute long minute;
    attribute long ? second;
  };

  [NoInterfaceObject] interface TimerManagerObject {
    readonly attribute TimerManager timer;
  };

  WebApi implements TimerManagerObject;

  [NoInterfaceObject] interface TimerManager {
    DOMString getVersion();
    void setCurrentTime(TimeSetting currentTime);
    TimeSetting getCurrentTime();
    void setOnTimer(TimerInfo info);
    TimerInfo getOnTimer(TimerID timer);
    void setOffTimer(TimerInfo info);
    TimerInfo getOffTimer(TimerID timer);
    void addHoliday(HolidayInfo info);
    void deleteHoliday(HolidayInfo info);
    void applyTimerHoliday(HolidayInfo info);
    DOMString getTimerHoliday(HolidayInfo info);
    void setNTP(NTPInfo info);
    NTPInfo getNTP();
    void setDST(DSTInfo info);
    DSTInfo getDST();
    void setSystemTimeSyncTimeout(SyncTimeout timeout);
    SyncTimeout getSystemTimeSyncTimeout();
  };

};