package com.icontrols.service.control;

import com.icontrols.service.control.ILightControlServiceCallback ;

interface ILightControlService {

    /**
     * Often you want to allow a service to call back to its clients.
     * This shows how to do so, by registering a callback interface with
     * the service.
     */
    void registerLightControlServiceCallback(ILightControlServiceCallback cb);

    /**
     * Remove a previously registered activity callback interface.
     */
    void unregisterLightControlServiceCallback(ILightControlServiceCallback cb);

    /**
     * retrieve all Bridged device list in Light Control Service
     * @return devices list data with json array format as String
     * eg.)
     * [{"n":"Light Switch",                            // Device Name
     *  "rt":["oic.d.light"],                           // Device Resource Type
     *  "sn":"2b32e152-3756-4fb6-b3f2-d8db7aafe39f",    // Device Serial Number(Unique Id) will be used for piid in oic/d
     *  "state":"on-line"},                             // Device On/Off-Line State
     * {"n":"Television","rt":["oic.d.tv"], "sn":"2cd8e585-ef21-4fd1-7958-6ca7e54adcce","state":"off-line"}]
     */
    String retrieveAllDevices();

    /**
     * retrieve all resources of the Bridged deivce in Light Control Service
     * @param device_uuid : unique identity of the device (eg. 15ba3c25-8cdd-41f8-6f9e-fe49105dce0a)
     * @return resource list data with json array format as String
     * (eg.
     * [{"n":"Light Switch",                            // Resource Name
     *   "uri”:”/light",                                // Resource URI
     *   "rt":["oic.r.switch.binary"],                  // Resource Type
     *   "if":"RW"},                                    // Resource Interace (eg. RW : Read/Write, R:Read Only, A:Actuator, S:Sensor)
     * {"n":"Dimming Control","uri":"/dimming","rt":["oic.r.light.dimming"], "if":"RW"},
     * {"n":"Energy Consumption", "uri":"/EnergyConsumptionResURI", "rt": ["oic.r.energy.consumption"], "if":"S"}
     * {"n":"Color Temperature", "uri":""/ColourTemperatureResURI", "rt": ["oic.r.colour.colourtemperature"], "if":"A"}]
     *) */
    String retrieveAllResources(in String device_uuid) ;

    /**
     * retrieve Getting all properties of the resource in the Bridged device
     * @param device_uuid unique identity of the device (eg. 15ba3c25-8cdd-41f8-6f9e-fe49105dce0a)
     * @param resource_uri uri of the resource (eg. /a/light)
     * @return properties data with json object format as String
     * (eg.
     * { "n":"Light Switch", "value":true } or                                  // Light Switch Properties
     * { "n":"Dimming Control","dimmingSetting":100,"range":100,"step":10 } or  // Dimming Control Properties
     * { "n":"Energy Consumption","power":200.1,"energy":3500.4 } or            // Energy Consumption Properties
     * { "n":"Color Temperature", "ct":457, "range":1000, "step":1 }            // Color Temperature Properties
     * ) */
    String doGetResourceProperties(in String device_uuid, in String resource_uri) ;

    /**
     * request Posting the value of properties to the Bridged device
     * @param device_uuid unique identity of ocf device (eg. 15ba3c25-8cdd-41f8-6f9e-fe49105dce0a)
     * @param resource_uri uri of ocf resource (eg. /a/light)
     * @param prop_data the property values of the resource to control as a json object format
     * (eg. { "power" : true, "level" : 100 } or { "value" : true } or { "dimmingSetting" : 50} )
     * @return
     *   - true : function call success,
     *   - false : function call fail
     */
    boolean doPostResourceProperties(in String device_uuid, in String resource_uri, in String prop_data) ;


}
