Version: 1.0.0
A FirmwareUpdate plugin for Thunder framework.
The FirmwareUpdate plugin provides an interface for FirmwareUpdate.
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.FirmwareUpdate) |
| classname | string | Class name: FirmwareUpdate |
| locator | string | Library name: libWPEFrameworkFirmwareUpdate.so |
| autostart | boolean | Determines if the plugin shall be started automatically along with the framework |
The following methods are provided by the FirmwareUpdate plugin:
FirmwareUpdate interface methods:
| Method | Description |
|---|---|
| getUpdateState | Firmware update consists of 2 major steps: 1. Firmware Validation, and 2. Firmware Flashing. This method returns the "status" of these steps in the firmware update process that was triggered by updateFirmware |
| setAutoReboot | Enable or disable the AutoReboot feature. |
| updateFirmware | Initiates a firmware update. |
Firmware update consists of 2 major steps: 1. Firmware Validation, and 2. Firmware Flashing. This method returns the "status" of these steps in the firmware update process that was triggered by updateFirmware
Event details will be updated soon.
This method takes no parameters.
| Name | Type | Description |
|---|---|---|
| result | object | |
| result.getUpdateStateResult | GetUpdateStateResult | |
| result.getUpdateStateResult.state | string | state |
| result.getUpdateStateResult.substate | string | substate |
{
"jsonrpc": 2.0,
"id": 0,
"method": "org.rdk.FirmwareUpdate.getUpdateState"
}curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 0, "method": "org.rdk.FirmwareUpdate.getUpdateState"}' http://127.0.0.1:9998/jsonrpc
{
"jsonrpc": 2.0,
"id": 0,
"result": {
"state": "VALIDATION_FAILED",
"substate": "NOT_APPLICABLE"
}
}Enable or disable the AutoReboot feature.
Event details will be updated soon.
| Name | Type | Description |
|---|---|---|
| params | object | |
| params.enable | bool | Boolean to enable or disable AutoReboot |
| Name | Type | Description |
|---|---|---|
| result | object | |
| result.success | bool | success |
{
"jsonrpc": 2.0,
"id": 1,
"method": "org.rdk.FirmwareUpdate.setAutoReboot",
"params": {
"enable": true
}
}curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 1, "method": "org.rdk.FirmwareUpdate.setAutoReboot", "params": {"enable": true}}' http://127.0.0.1:9998/jsonrpc
{
"jsonrpc": 2.0,
"id": 1,
"result": {
"success": true
}
}Initiates a firmware update.
Event details will be updated soon.
| Name | Type | Description |
|---|---|---|
| params | object | |
| params.firmwareFilepath | string | The complete path of the firmware file to which the device needs to be updated to. |
| params.firmwareType | string | Type of firmware. One of the following (PCI,DRI) |
| Name | Type | Description |
|---|---|---|
| result | object | |
| result.success | bool | success |
{
"jsonrpc": 2.0,
"id": 2,
"method": "org.rdk.FirmwareUpdate.updateFirmware",
"params": {
"firmwareFilepath": "",
"firmwareType": ""
}
}curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 2, "method": "org.rdk.FirmwareUpdate.updateFirmware", "params": {"firmwareFilepath": "", "firmwareType": ""}}' http://127.0.0.1:9998/jsonrpc
{
"jsonrpc": 2.0,
"id": 2,
"result": {
"success": true
}
}Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [Thunder] for information on how to register for a notification.
The following events are provided by the FirmwareUpdate plugin:
FirmwareUpdate interface events:
| Event | Description |
|---|---|
| onFlashingStateChange | This notification is raised between flashing started state and flashing succeeded/failed. |
| onUpdateStateChange | notify Firmware update state change. |
This notification is raised between flashing started state and flashing succeeded/failed.
| Name | Type | Description |
|---|---|---|
| params | object | |
| params.percentageComplete | integer | Number between 0 and 100 indicating the "percentage complete" of the flashing process. |
{
"jsonrpc": 2.0,
"id": 3,
"method": "org.rdk.FirmwareUpdate.onFlashingStateChange",
"params": {
"percentageComplete": 0
}
}notify Firmware update state change.
| Name | Type | Description |
|---|---|---|
| params | object | |
| params.state | string | state |
| params.substate | string | substate |
{
"jsonrpc": 2.0,
"id": 4,
"method": "org.rdk.FirmwareUpdate.onUpdateStateChange",
"params": {
"state": "VALIDATION_FAILED",
"substate": "NOT_APPLICABLE"
}
}