IrLed API (Samsung Extension)

This API provides access to a device's IrLed.

Since: 2.2

Table of Contents


Summary of Interfaces and Methods

Interface Method
IrLedManagerObject
IrLedManager void send (DOMString data, optional SuccessCallback? onsuccess, optional 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);

     };

Since: 2.2

This interface allows you to access IrLed.

Methods

send
Sends data to IrLed.

Deprecated. http://developer.samsung.com/privilege/irled privilege is deprecated since Tizen 2.3. It is recommended to use the http://developer.samsung.com/tizen/privilege/irled privilege (since Tizen 2.3) instead.

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

Since: 2.2

The ErrorCallback is launched with these error types:

  • UnknownError: If an error occurs while sending data.
  • NotSupportedError: If the feature is not supported.

Privilege level: public

Privilege: http://developer.samsung.com/tizen/privilege/irled

Parameters:

  • data: Data to send
  • onsuccess [optional] [nullable]: Callback method to be invoked when data is successfully sent
  • onerror [optional] [nullable]: Callback method to be invoked if an error occurs while sending data

Exceptions:

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

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

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. Related Feature

It is recommended to design feature related code in a modular way.

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

  • http://developer.samsung.com/tizen/feature/irled
  • 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);
    
         };
    };