Timer API
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 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 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 ntpinfo ntp information 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 ; }; };