Samsung Electronics logo

Samsung Web API: IrLed


Introduction

This API provides access to a device's IrLed.


Table of Contents


Summary of Interfaces and Methods

Interface Method
IrLedManagerObject
IrLedManager void send(DOMString data, SuccessCallback? onsuccess, ErrorCallback? onerror)

1. Interfaces

1.1. IrLedManagerObject

Defines what is instantiated in the webapis object.

    [NoInterfaceObject] interface IrLedManagerObject {
        readonly attribute IrLedManager irled;
    };
    WebAPIs implements IrLedManagerObject;

There is a webapis.irled object that allows accessing the functionality of the IrLed API.

1.2. IrLedManager

The IrLedManager interface.

    [NoInterfaceObject] interface IrLedManager {

        void send(DOMString data, 
                  optional SuccessCallback? onsuccess,
                  optional ErrorCallback? onerror);

     };

This interface allows you to access IrLed.

METHODS

send

Sends data to IrLed.

Signature
void send(DOMString data, optional SuccessCallback? onsuccess, optional ErrorCallback? onerror);

The ErrorCallback is launched with these error types:

  • UnknownError: If an error occurs while sending data.
  • NotSupportedError: If the feature is not supported.
Parameters
  • data
    • Optional: No.
    • Nullable: No.
    • Type: DOMString.
    • Description: Data to send
  • onsuccess
    • Optional: Yes.
    • Nullable: Yes.
    • Type: SuccessCallback.
    • Description: Callback method to be invoked when data is successfully sent
  • onerror
    • Optional: Yes.
    • Nullable: Yes.
    • Type: ErrorCallback.
    • Description: Callback method to be invoked if an error occurs while sending data
Exceptions
  • WebAPIException:

    with error type SecurityError, if the application does not have the privilege to call this method.

    with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.

Code example
 
 // power on control data
 var data = "38400,174,172,24,61,24,62,24,61,24,17,25,17,24,17,24,17,24,18,24,61,24,62,24,61,24,18,24,17,24,17,24,18,24,17,24,17,24,62,24,17,24,17,24,18,24,17,24,17,24,18,24,61,24,17,24,62,24,61,25,61,24,62,24,61,24,62,24,1879";
 webapis.irled.send(
    data,
    function() {
       console.log("data send ok");
    }, 
    function(e) {
       console.log("Error: " + e.message);
    });
 
 

2. Features

This is the list of URIs used to declare this API's features, for use in the widget config.xml. For each URL, the list of functions covered is provided.

http://developer.samsung.com/tizen/feature/irled

To guarantee the running of this application on a device with IrLed feature, define the following requirements in the config file:

3. Full WebIDL

module IrLed {


    [NoInterfaceObject] interface IrLedManagerObject {
        readonly attribute IrLedManager irled;
    };
    
    WebAPIs implements IrLedManagerObject;


    [NoInterfaceObject] interface IrLedManager {

        void send(DOMString data, 
                  optional SuccessCallback? onsuccess,
                  optional ErrorCallback? onerror);

     };
};