Version: 1.0.0
A LEDControl plugin for Thunder framework.
The LEDControl plugin provides an interface for LEDControl.
The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [Thunder].
The table below lists configuration options of the plugin.
| Name | Type | Description |
|---|---|---|
| callsign | string | Plugin instance name (default: org.rdk.LEDControl) |
| classname | string | Class name: LEDControl |
| locator | string | Library name: libWPEFrameworkLEDControl.so |
| autostart | boolean | Determines if the plugin shall be started automatically along with the framework |
The following methods are provided by the LEDControl plugin:
LEDControl interface methods:
| Method | Description |
|---|---|
| getLEDState | Retrieves current state of the LED. e.g. {"state":"WPS_CONNECTING"} |
| getSupportedLEDStates | Returns the list of LED states that are actually supported by the platform at runtime. Possible values include NONE, ACTIVE, STANDBY, WPS_CONNECTING, WPS_CONNECTED, WPS_ERROR, FACTORY_RESET, USB_UPGRADE and DOWNLOAD_ERROR. |
| setLEDState | Sets the device LED to a requested state from those available in GetSupportedLEDStates. |
Retrieves current state of the LED. e.g. {"state":"WPS_CONNECTING"}
Event details will be updated soon.
This method takes no parameters.
| Name | Type | Description |
|---|---|---|
| result | object | |
| result.state | string | LEDControlState. |
{
"jsonrpc": 2.0,
"id": 0,
"method": "org.rdk.LEDControl.getLEDState"
}curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 0, "method": "org.rdk.LEDControl.getLEDState"}' http://127.0.0.1:9998/jsonrpc
{
"jsonrpc": 2.0,
"id": 0,
"result": {
"state": "LEDSTATE_NONE"
}
}Returns the list of LED states that are actually supported by the platform at runtime. Possible values include NONE, ACTIVE, STANDBY, WPS_CONNECTING, WPS_CONNECTED, WPS_ERROR, FACTORY_RESET, USB_UPGRADE and DOWNLOAD_ERROR.
Event details will be updated soon.
This method takes no parameters.
| Name | Type | Description |
|---|---|---|
| result | object | |
| result.supportedLEDStates | IStringIterator | string [] of supported LED states. |
| result.supportedLEDStates[#] | string | |
| result.success | bool | boolean |
{
"jsonrpc": 2.0,
"id": 1,
"method": "org.rdk.LEDControl.getSupportedLEDStates"
}curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 1, "method": "org.rdk.LEDControl.getSupportedLEDStates"}' http://127.0.0.1:9998/jsonrpc
{
"jsonrpc": 2.0,
"id": 1,
"result": {
"supportedLEDStates": [
"['ACTIVE', 'STANDBY', 'WPS_CONNECTING', 'WPS_CONNECTED', 'WPS_ERROR', 'FACTORY_RESET', 'USB_UPGRADE', 'DOWNLOAD_ERROR']"
],
"success": true
}
}Sets the device LED to a requested state from those available in GetSupportedLEDStates.
Event details will be updated soon.
| Name | Type | Description |
|---|---|---|
| params | object | |
| params.state | string | LEDControlState. |
| Name | Type | Description |
|---|---|---|
| result | object | |
| result.success | bool | boolean |
{
"jsonrpc": 2.0,
"id": 2,
"method": "org.rdk.LEDControl.setLEDState",
"params": {
"state": "FACTORY_RESET"
}
}curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 2, "method": "org.rdk.LEDControl.setLEDState", "params": {"state": "FACTORY_RESET"}}' http://127.0.0.1:9998/jsonrpc
{
"jsonrpc": 2.0,
"id": 2,
"result": {
"success": true
}
}