To use Samsung Product API, <script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script> Should be loaded in index.html
To use Samsung Product API,
<script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script>
Should be loaded in index.html
Since : 6.5
Product : B2B (LFD)
Timer::TimerInfo
TimerInfo implements Timer;
[NoInterfaceObject]interface TimerManager {};
getVersion
DOMString getVersion();
Product:B2B (LFD)
Exceptions:
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.
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(TimeSetting currentTime)
void setCurrentTime(TimeSetting currentTime);
Product: B2B (LFD, IWB)
Parameters:
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.
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()
TimeSetting getCurrentTime();
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
void setOnTimer(TimerInfo info);
Product: B2B (LFD)
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.
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" : ["SUN", "WED"] } try { webapis.timer.setOnTimer(timer_profile1); } catch (e) { console.log("[setOnTimer] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); }
getOnTimer
TimerInfo getOnTimer(TimerID timer);
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
void setOffTimer(TimerInfo info);
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); }
Remark :
getOffTimer
TimerInfo getOffTimer(TimerID timer);
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
void addHoliday(HolidayInfo info);
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
void deleteHoliday(HolidayInfo info);
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
void applyTimerHoliday(HolidayInfo info);
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
DOMString getTimerHoliday(HolidayInfo info);
with the error type TypeMismatchError if invalid values are passed for an input parameter.
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
void setNTP(NTPInfo info);
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
NTPInfo getNTP();
Return value:
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
void setDST(DSTInfo info);
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
DSTInfo getDST();
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
void setSystemTimeSyncTimeout(SyncTimeout timeout);
Parameters
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
SyncTimeout getSystemTimeSyncTimeout();
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); }