Version: 1.0.0
A NativeJS plugin for Thunder framework.
The NativeJS plugin provides an interface for NativeJS.
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.NativeJS) |
| classname | string | Class name: NativeJS |
| locator | string | Library name: libWPEFrameworkNativeJS.so |
| autostart | boolean | Determines if the plugin shall be started automatically along with the framework |
The following methods are provided by the NativeJS plugin:
NativeJS interface methods:
| Method | Description |
|---|---|
| createApplication | Create a NativeJS application. |
| getApplications | Get details of existing plugin. |
| runApplication | run a NativeJS application. |
| runJavaScript | run a NativeJS code. |
| terminateApplication | Destroy a running NativeJS application. |
Create a NativeJS application.
Event details will be updated soon.
| Name | Type | Description |
|---|---|---|
| params | object | |
| params.options | string | Additional options for creating the application. |
| Name | Type | Description |
|---|---|---|
| result | object | |
| result.id | integer | This should have the id of the created application |
{
"jsonrpc": 2.0,
"id": 0,
"method": "org.rdk.NativeJS.createApplication",
"params": {
"options": ""
}
}curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 0, "method": "org.rdk.NativeJS.createApplication", "params": {"options": ""}}' http://127.0.0.1:9998/jsonrpc
{
"jsonrpc": 2.0,
"id": 0,
"result": {
"id": 0
}
}Get details of existing plugin.
Event details will be updated soon.
This method takes no parameters.
| Name | Type | Description |
|---|---|---|
| result | null | On success null will be returned. |
{
"jsonrpc": 2.0,
"id": 1,
"method": "org.rdk.NativeJS.getApplications"
}curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 1, "method": "org.rdk.NativeJS.getApplications"}' http://127.0.0.1:9998/jsonrpc
{
"jsonrpc": 2.0,
"id": 1,
"result": null
}run a NativeJS application.
Event details will be updated soon.
| Name | Type | Description |
|---|---|---|
| params | object | |
| params.id | integer | This should have the id of the created application |
| params.url | string | URL for the application to run. |
| Name | Type | Description |
|---|---|---|
| result | null | On success null will be returned. |
{
"jsonrpc": 2.0,
"id": 2,
"method": "org.rdk.NativeJS.runApplication",
"params": {
"id": 0,
"url": ""
}
}curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 2, "method": "org.rdk.NativeJS.runApplication", "params": {"id": 0, "url": ""}}' http://127.0.0.1:9998/jsonrpc
{
"jsonrpc": 2.0,
"id": 2,
"result": null
}run a NativeJS code.
Event details will be updated soon.
| Name | Type | Description |
|---|---|---|
| params | object | |
| params.id | integer | This should have the id of the created application |
| params.code | string |
| Name | Type | Description |
|---|---|---|
| result | null | On success null will be returned. |
{
"jsonrpc": 2.0,
"id": 3,
"method": "org.rdk.NativeJS.runJavaScript",
"params": {
"id": 0,
"code": ""
}
}curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 3, "method": "org.rdk.NativeJS.runJavaScript", "params": {"id": 0, "code": ""}}' http://127.0.0.1:9998/jsonrpc
{
"jsonrpc": 2.0,
"id": 3,
"result": null
}Destroy a running NativeJS application.
Event details will be updated soon.
| Name | Type | Description |
|---|---|---|
| params | object | |
| params.id | integer | This should have the id of the created application |
| Name | Type | Description |
|---|---|---|
| result | null | On success null will be returned. |
{
"jsonrpc": 2.0,
"id": 4,
"method": "org.rdk.NativeJS.terminateApplication",
"params": {
"id": 0
}
}curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 4, "method": "org.rdk.NativeJS.terminateApplication", "params": {"id": 0}}' http://127.0.0.1:9998/jsonrpc
{
"jsonrpc": 2.0,
"id": 4,
"result": null
}