Epaper 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 device functions as the Samsung EPaper product API. The module is a web API specifically provided for ePaper products among the LFD product line.

Since : 8.0

Product : B2B (LFD)

Privilege Level : Partner

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

Summary of Interfaces and Methods

Interface

Method

RefreshTime

LedOnInfo

LedBlinkInfo

WakeupTime

EpaperManagerObject

EpaperManager

DOMString getVersion();
void setAutoSleepTime(SleepTime delayTime);
SleepTime getAutoSleepTime();
void resetAutoSleepTime();
void goToSleep();
long setScheduleWakeupTime(WakeupTime wakeupTime);
WakeupTime getScheduleWakeupTime(long timerID);
void cancelScheduleWakeupTime(long timerID);
void setNetworkStandby(Activation mode);
Activation getNetworkStandby();
boolean isScheduledPlayBootReason();
void setBatteryWarningIconDisplay(Activation mode);
Activation getBatteryWarningIconDisplay();
void screenRefreshNow();
void setScreenRefreshTime(RefreshTime refreshTime);
RefreshTime getScreenRefreshTime();
void setLEDStateOff(LedColor color);
void setLEDStateOn(LedOnInfo info);
void setLEDStateBlink(LedBlinkInfo info);

1. Type Definitions

1.1 Activation

Activation ON/OFF values for specific features

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

The following values are supported

  • ON : Feature enabled
  • OFF : Feature disabled

Since : 8.0

1.2 SleepTime

SleepTime values for Sleep delay.

enum SleepTime {
  "OFF",
  "3MIN",
  "5MIN",
  "10MIN",
  "20MIN",
  "30MIN",
  "60MIN"
};

The following values are supported

  • OFF : Sleep Delay time set to off
  • 3MIN : Sleep Delay time set to 3 Minute
  • 5MIN : Sleep Delay time set to 5 Minute
  • 10MIN : Sleep Delay time set to 10 Minute
  • 20MIN : Sleep Delay time set to 20 Minute
  • 30MIN : Sleep Delay time set to 30 Minute
  • 60MIN : Sleep Delay time set to 60 Minute

Since : 8.0

2. Interfaces

2.1 RefreshTime

Object hour and minute for auto refresh screen

[NoInterfaceObject] interface RefreshTime {
  attribute long hour;
  attribute long minute;
};

Attributes

  • long hour
    Hour for refresh screen
  • long minute
    Minute for refresh screen

2.2 LedOnInfo

LED On settings information object

[NoInterfaceObject] interface LedOnInfo {
  attribute LedColor color;
  attribute long duration;
};

Attributes

  • LedColor color
    LED color setting
  • long duration
    Duration of led control running time.The unit is in seconds.If the duration is set to 0, it means that the LED will continue to run.

2.3 LedBlinkInfo

LED blink settings information object

[NoInterfaceObject] interface LedBlinkInfo {
  attribute LedColor color;
  attribute LedIntervalTime onIntervalTime;
  attribute LedIntervalTime offIntervalTime;
  attribute long duration;
};

Attributes

  • LedColor color
    LED color setting
  • LedIntervalTime onIntervalTime
    Interval time for LED On control
  • LedIntervalTime offIntervalTime
    Interval time for LED Off control
  • long duration
    Duration of led control running time.The unit is in seconds.(1 ~ 255)

2.4 WakeupTime

Wakeup Time settings information object

[NoInterfaceObject] interface WakeupTime {
  attribute long year;
  attribute long month;
  attribute long day;
  attribute long hour;
  attribute long minute;
  attribute long second;
};

Attributes

  • long year
    Year (ex 2021)
  • long month
    Month (1 to 12)
  • long day
    Day (1 to 31)
  • long hour
    Hour (0 to 23)
  • long minute
    Minute (0 to 59)
  • long second
    Second (0 to 59)

2.5 EpaperManagerObject

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

[NoInterfaceObject] interface EpaperManagerObject {
  readonly attribute EpaperManager epaper;
};
WebApi implements EpaperManagerObject;

Attributes

2.6 EpaperManager

This interface provides methods to use Epaper functionalities.

[NoInterfaceObject] interface EpaperManager {
  DOMString getVersion();
  void setAutoSleepTime(SleepTime delayTime);
  SleepTime getAutoSleepTime();
  void resetAutoSleepTime();
  void goToSleep();
  long setScheduleWakeupTime(WakeupTime wakeupTime);
  WakeupTime getScheduleWakeupTime(long timerID);
  void cancelScheduleWakeupTime(long timerID);
  void setNetworkStandby(Activation mode);
  Activation getNetworkStandby();
  boolean isScheduledPlayBootReason();
  void setBatteryWarningIconDisplay(Activation mode);
  Activation getBatteryWarningIconDisplay();
  void screenRefreshNow();
  void setScreenRefreshTime(RefreshTime refreshTime);
  RefreshTime getScreenRefreshTime();
  void setLEDStateOff(LedColor color);
  void setLEDStateOn(LedOnInfo info);
  void setLEDStateBlink(LedBlinkInfo info);
};

Since : 8.0

Methods

getVersion

This interface provides method to get epaper module version.

DOMString getVersion();

Product : B2B (LFD)

Privilege Level : Partner

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

Return Value :

  • DOMString : DOMString Epaper plug-in version

Exceptions :

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported
    • with error type SecurityError, if the application does not have the privilege to call this method

Since : 8.0

Code Example :

var Version = null;

try {
  Version = webapis.epaper.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);
}

setAutoSleepTime

It can be set a time delay for entering sleep mode, and upon setting, the delay time begins to count.
If the TIME setting value changes, it will be counted again from the beginning according to the newly set value.

void setAutoSleepTime(SleepTime delayTime);

Product : B2B (LFD)

Privilege Level : Partner

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

Parameters :

  • delayTime : Sleep delay mode

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this feature is not supported
    • with error type UnknownError, for any other error
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type

Since : 8.0

Code Example :

var delayTime = "30MIN";
try {
  webapis.epaper.setAutoSleepTime(delayTime);
} catch (e) {
  console.log("[setAutoSleepTime] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

getAutoSleepTime

Get the value of the time delay for entering sleep mode. OFF Value is when the delay time is not set.

SleepTime getAutoSleepTime();

Product : B2B (LFD)

Privilege Level : Partner

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

Return Value :

  • SleepTime : SleepTime waiting time beginning to count for entering sleep mode.

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this feature is not supported
    • with error type UnknownError, for any other error

Since : 8.0

Code Example :

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

resetAutoSleepTime

It can be reset a time delay count for entering sleep mode, the delay time begins again to count.

void resetAutoSleepTime();

Product : B2B (LFD)

Privilege Level : Partner

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

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this feature is not supported
    • with error type UnknownError, for any other error

Since : 8.0

Code Example :

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

goToSleep

Allows the device to directly enter sleep mode.

void goToSleep();

Product : B2B (LFD)

Privilege Level : Partner

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

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this feature is not supported
    • with error type UnknownError, for any other error

Since : 8.0

Code Example :

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

setScheduleWakeupTime

It can be set a schedule for the device to wake up after a certain period of time the unit is in seconds. The time setting is up to one week.(1 ~ 604800 sec)
It can be set more than one wake up time and manage the returned ID to utilize the get or cancel API. 최대 일주일까지 wake up 시간을 설정할 수 있다.(1 ~ 604800 초)

long setScheduleWakeupTime(WakeupTime wakeupTime);

Product : B2B (LFD)

Privilege Level : Partner

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

Parameters :

  • wakeupTime : wakeup time information

Return Value :

  • long : long wakeup timer id

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this feature is not supported
    • with error type UnknownError, for any other error
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type

Since : 8.0

Code Example :

var wakeup_time = {
  "year" 	   : 2024,
  "month"    : 12,
  "day"	   : 15,
  "hour"     : 8,
  "minute"   : 55,
  "second"   : 43
}
try {
  var timerId = webapis.epaper.setScheduleWakeupTime(wakeup_time);
  console.log("[setScheduleWakeupTime] call syncFunction type: " + timerId);
} catch (e) {
  console.log("[setScheduleWakeupTime] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

getScheduleWakeupTime

Retrieve the previously set value for the wakeup date time.

WakeupTime getScheduleWakeupTime(long timerID);

Product : B2B (LFD)

Privilege Level : Partner

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

Parameters :

  • timerID : timer id of wakeup time

Return Value :

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this feature is not supported
    • with error type UnknownError, for any other error
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type

Since : 8.0

Code Example :

var date;
var id = 10; // return value of setScheduleWakeupTime()
try {
  data = webapis.epaper.getScheduleWakeupTime(id);
  console.log("[getScheduleWakeupTime] call syncFunction type: " + date);
} catch (e) {
  console.log("[getScheduleWakeupTime] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

cancelScheduleWakeupTime

cancel ScheduleWakeupTime the previously set value for the wakeup time.

void cancelScheduleWakeupTime(long timerID);

Product : B2B (LFD)

Privilege Level : Partner

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

Parameters :

  • timerID : timer id of wakeup time

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this feature is not supported
    • with error type UnknownError, for any other error
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type

Since : 8.0

Code Example :

var id = 10; // return value of setScheduleWakeupTime()
try {
  webapis.epaper.cancelScheduleWakeupTime(id);
  console.log("[cancelScheduleWakeupTime] call syncFunction type: " );
} catch (e) {
  console.log("[cancelScheduleWakeupTime] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

setNetworkStandby

It can be set network standby mode.

void setNetworkStandby(Activation mode);

Product : B2B (LFD)

Privilege Level : Partner

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

Parameters :

  • mode : actovate mode of network stanby

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this feature is not supported
    • with error type UnknownError, for any other error
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type

Since : 8.0

Code Example :

var mode = "ON";
try {
  webapis.epaper.setNetworkStandby(mode);
} catch (e) {
  console.log("[setNetworkStandby] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

getNetworkStandby

Get the value of Network standby mode.

Activation getNetworkStandby();

Product : B2B (LFD)

Privilege Level : Partner

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

Return Value :

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this feature is not supported
    • with error type UnknownError, for any other error

Since : 8.0

Code Example :

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

isScheduledPlayBootReason

Get Scheduled Boot reason of device power wake up.

boolean isScheduledPlayBootReason();

Product : B2B (LFD)

Privilege Level : Partner

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

Return Value :

  • boolean : Bool True(1) or False(0) if boot reason scheduled power wake up

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this feature is not supported

Since : 8.0

Code Example :

var reason;
try {
  reason = webapis.epaper.isScheduledPlayBootReason();
} catch (e) {
  console.log("[isScheduledPlayBootReason] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
if (reason) {
  console.log("[isScheduledPlayBootReason] call syncFunction type: " + reason);
}

setBatteryWarningIconDisplay

Sets the battery warning icon display mode to ON or OFF.

void setBatteryWarningIconDisplay(Activation mode);

Product : B2B (LFD)

Privilege Level : Partner

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

Parameters :

  • mode : of Battery Warning Icon

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this feature is not supported
    • with error type UnknownError, for any other error
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type

Since : 8.0

Code Example :

var mode = "ON";
try {
  webapis.epaper.setBatteryWarningIconDisplay(mode);
} catch (e) {
  console.log("[setBatteryWarningIconDisplay] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

getBatteryWarningIconDisplay

Gets the battery warning icon display mode.

Activation getBatteryWarningIconDisplay();

Product : B2B (LFD)

Privilege Level : Partner

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

Return Value :

  • Activation : Activation mode of Battery Warning Icon

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this feature is not supported
    • with error type UnknownError, for any other error

Since : 8.0

Code Example :

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

screenRefreshNow

Allows the device to refresh screen.

void screenRefreshNow();

Product : B2B (LFD)

Privilege Level : Partner

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

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this feature is not supported
    • with error type UnknownError, for any other error

Since : 8.0

Code Example :

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

setScreenRefreshTime

Sets the interval used for periodic refresh of screen.
The setting is turned off after a specific time period following the refresh screen.

void setScreenRefreshTime(RefreshTime refreshTime);

Product : B2B (LFD)

Privilege Level : Partner

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

Parameters :

  • refreshTime : Object refresh screen time

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this feature is not supported
    • with error type UnknownError, for any other error
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type

Since : 8.0

Code Example :

var refreshTime = {
  "hour" : 6,
  "minute" : 15
};
try {
  webapis.epaper.setScreenRefreshTime(refreshTime);
} catch (e) {
  console.log("[setScreenRefreshTime] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

getScreenRefreshTime

Gets the time of refresh screen.

RefreshTime getScreenRefreshTime();

Product : B2B (LFD)

Privilege Level : Partner

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

Return Value :

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this feature is not supported
    • with error type UnknownError, for any other error

Since : 8.0

Code Example :

var mode;
try {
  mode = webapis.epaper.getScreenRefreshTime();
} catch (e) {
  console.log("[getScreenRefreshTime] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
if (mode) {
  console.log("[getScreenRefreshTime] call syncFunction type: " + mode);
}

setLEDStateOff

Selectively Deactivate the LED of an ePaper device in a specific color scheme..

void setLEDStateOff(LedColor color);

Product : B2B (LFD)

Privilege Level : Partner

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

Parameters :

  • color : led color Information

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this feature is not supported
    • with error type UnknownError, for any other error
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type

Since : 8.0

Code Example :

var color = "LED_GREEN";
try {
  webapis.epaper.setLEDStateOff(color);
} catch (e) {
  console.log("[setLEDStateOff] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

setLEDStateOn

Selectively activate the LED of an ePaper device in a specific color scheme..

void setLEDStateOn(LedOnInfo info);

Product : B2B (LFD)

Privilege Level : Partner

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

Parameters :

  • info : led Control Information of epaper

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this feature is not supported
    • with error type UnknownError, for any other error
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type

Since : 8.0

Code Example :

var info = {
  "color" : "LED_GREEN",
  "duration" : 150
};
try {
  webapis.epaper.setLEDStateOn(info);
} catch (e) {
  console.log("[setLEDStateOff] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

setLEDStateBlink

Selectively blink the LED of an ePaper device in a specific color scheme..

void setLEDStateBlink(LedBlinkInfo info);

Product : B2B (LFD)

Privilege Level : Partner

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

Parameters :

  • info : led blink Information of epaper

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this feature is not supported
    • with error type UnknownError, for any other error
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type

Since : 8.0

Code Example :

var info = {
  "color" : "LED_GREEN",
  "onIntervalTime" : "LED_250MS",
  "offIntervalTime" : "LED_250MS",
  "duration" : 180
};
try {
  webapis.epaper.setLEDStateBlink(info);
} catch (e) {
  console.log("[setLEDStateBlink] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}

3. Full WebIDL

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

  enum SleepTime {
    "OFF",
    "3MIN",
    "5MIN",
    "10MIN",
    "20MIN",
    "30MIN",
    "60MIN"
  };

  [NoInterfaceObject] interface RefreshTime {
    attribute long hour;
    attribute long minute;
  };

  [NoInterfaceObject] interface LedOnInfo {
    attribute LedColor color;
    attribute long duration;
  };

  [NoInterfaceObject] interface LedBlinkInfo {
    attribute LedColor color;
    attribute LedIntervalTime onIntervalTime;
    attribute LedIntervalTime offIntervalTime;
    attribute long duration;
  };

  [NoInterfaceObject] interface WakeupTime {
    attribute long year;
    attribute long month;
    attribute long day;
    attribute long hour;
    attribute long minute;
    attribute long second;
  };

  [NoInterfaceObject] interface EpaperManagerObject {
    readonly attribute EpaperManager epaper;
  };

  WebApi implements EpaperManagerObject;

  [NoInterfaceObject] interface EpaperManager {
    DOMString getVersion();
    void setAutoSleepTime(SleepTime delayTime);
    SleepTime getAutoSleepTime();
    void resetAutoSleepTime();
    void goToSleep();
    long setScheduleWakeupTime(WakeupTime wakeupTime);
    WakeupTime getScheduleWakeupTime(long timerID);
    void cancelScheduleWakeupTime(long timerID);
    void setNetworkStandby(Activation mode);
    Activation getNetworkStandby();
    boolean isScheduledPlayBootReason();
    void setBatteryWarningIconDisplay(Activation mode);
    Activation getBatteryWarningIconDisplay();
    void screenRefreshNow();
    void setScreenRefreshTime(RefreshTime refreshTime);
    RefreshTime getScreenRefreshTime();
    void setLEDStateOff(LedColor color);
    void setLEDStateOn(LedOnInfo info);
    void setLEDStateBlink(LedBlinkInfo info);
  };

};