The RDK firmware upgrader, the RDK agent at the CPE device side with the goal to provide an efficient and safe way to upgrade Firmware on the Field boxes. The module has the capability to
The module supports the upgrade of multiple Firmware types to RDK unit (RDK Video and stream boxes.)
| draw.io Diagram | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Broadcast Event For Maintenance Manager:
| EVENT NAME | VALUE |
|---|---|
| MAINT_FWDOWNLOAD_COMPLETE | 8 |
| MAINT_FWDOWNLOAD_ERROR | 9 |
| MAINT_FWDOWNLOAD_ABORTED | 10 |
| MAINT_CRITICAL_UPDATE | 11 |
| MAINT_REBOOT_REQUIRED | 12 |
| MAINT_FWDOWNLOAD_INPROGRESS | 15 |
| MAINT_FWDOWNLOAD_FG | 17 |
| MAINT_FWDOWNLOAD_BG | 18 |
Broadcast Event For System Service
| EVENT NAME | VALUE |
|---|---|
| FW_STATE_UNINITIALIZED | 0 |
| FW_STATE_REQUESTING | 1 |
| FW_STATE_DOWNLOADING | 2 |
| FW_STATE_FAILED | 3 |
| FW_STATE_DOWNLOAD_COMPLETE | 4 |
| FW_STATE_VALIDATION_COMPLETE | 5 |
| FW_STATE_PREPARING_TO_REBOOT | 6 |
| FW_STATE_ONHOLD_FOR_OPTOUT | 7 |
| FW_STATE_CRITICAL_REBOOT | 8 |
| FW_STATE_NO_UPGRADE_REQUIRED | 9 |
| IMAGE_FWDNLD_UNINITIALIZED | 0 |
| IMAGE_FWDNLD_DOWNLOAD_INPROGRESS | 1 |
| IMAGE_FWDNLD_DOWNLOAD_COMPLETE | 2 |
| IMAGE_FWDNLD_DOWNLOAD_FAILED | 3 |
| IMAGE_FWDNLD_FLASH_INPROGRESS | 4 |
| IMAGE_FWDNLD_FLASH_COMPLETE | 5 |
| IMAGE_FWDNLD_FLASH_FAILED | 6 |
This component is responsible for processing the xconf response and parse the json file. Then create a data structure to use further.
The firmware upgrader queries Xconf to check whether any upgrade is available for this device. The API is used to communicate with the Xconf and below are its typical parameters. The device details are fetched using the APIs as part of the deviceutils component.
Function Name | Parameter | Description |
|---|---|---|
MakeXconfComms | pResponse | Pointer to structure to receive output data Xconf Http status |
createJsonString | Char * pPostFieldOut, Size_t szPostFieldOut | The json string is looks like createJsonString: totlen = 503eStbMac=38:A6:CE:FF:FA:47&firmwareVersion=SKXI11ADS_VBN_23Q4_sprint_20231030231228sdy_NG&additionalFwVerInfo=SKXI11ADS_PDRI_PROD_20220704085103_11.0.0.0.bin&env=vbn&model=SKXI11ADS&partnerId=sky-uk&activationInProgress=false&targetProposition=Not Available&accountId=1010958709201877139&experience=X1&serial=IP01SK12035000A54&localtime=Tue Oct 31 08:36:04 UTC 2023&dlCertBundle=&rdmCatalogueVersion=&timezone=Europe/London&capabilities=rebootDecoupled&capabilities=RCDL&capabilities=supportsFullHttpUrl |
upgradeRequest | int upgrade_type,int server_type,constchar* artifactLocationUrl,constvoid* dwlloc,char*pPostFields,int*pHttp_code | Use For requesting upgrade pci, pdri and xconf. Param-1: Upgrade type pci, pdri, xconf Param-2: Type of server. HTTP_XCONF_DIRECT, HTTP_XCONF_CODEBIG, HTTP_SSR_DIRECT, HTTP_SSR_CODEBIG Param-3: Download server url Param-4: To store download data Param-5: http code |
getXconfRespData | XCONFRES *pResponse,char*pJsonStr | The response looks like below {"firmwareDownloadProtocol":"http","firmwareFilename":"tbd","firmwareLocation":"tbd","firmwareVersion":"tbd","rebootImmediately":false} |
The response from Xconf is processed as part of the jsonparser Component. This is a typical response from the Xconf.
{
"firmwareDownloadProtocol":"http",
"firmwareFilename":"tbd",
"firmwareLocation":"tbd",
"firmwareVersion":"tbd",
"rebootImmediately":false
}
...
This component is responsible for reading the rfc value and writing the rfc value. Below are the rfc used in this module.
| RFC name | Description | Default Value |
|---|---|---|
| Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.SWDLSpLimit.Enable | Use for throttle feature | FALSE |
Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.SWDLSpLimit.TopSpeed | Use for set throttle speed | 1MB => 1 *1024 * 1024 |
Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.IncrementalCDL.Enable | Use For Incremental Download | TRUE |
Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.SWDLDirect.Enable | Use For Direct CDN Download | FALSE |
...
...
| tbd |
|---|
| tbd |
|---|
...
| PlantUML Macro | ||
|---|---|---|
| ||
@startuml
skinparam componentStyle rectangle
skinparam packageStyle rectangle
' Layer 1: Device System Components
package "New Device System" {
[rdkvfwupdater Daemon] <<daemon>> as RDKV
[App Plugin] <<component>> as AppPlugin
[Firmware Update Library] <<library>> as FWUpdate
package "Common Utilities" {
[libdwnl] <<library>>
[libjsonparser] <<library>>
[libutils] <<library>>
}
[Flash Memory] <<storage>> as FlashMem
}
' Layer 2: External Network Servers
package "External Servers" {
[XConf Server] <<cloud>> as XConf
[SSR Server] <<cloud>> as SSR
}
' App Plugin interactions
AppPlugin --> FWUpdate : download + flash API calls
' Firmware update lib communicates with rdkvfwupdater
FWUpdate ..> RDKV : IPC Request\n(download/flash tasks)
RDKV ..> FWUpdate : IPC Response\n(task result)
' rdkvfwupdater uses common utilities and flash memory
RDKV --> libdwnl : fetch/download helpers
RDKV --> libjsonparser : parse JSON config
RDKV --> libutils : device info/utils
RDKV --> FlashMem : flash firmware
' Common utils interaction with servers
libdwnl --> XConf : fetch xconf data
libdwnl --> SSR : download firmware image
@enduml |
NEW DEVICE SYSTEM:
| PlantUML Macro |
|---|
@startuml
skinparam componentStyle rectangle
skinparam packageStyle rectangle
' Layer 1: Device System Components
package "NEW Device System" {
[rdkvfwupdater Daemon] <<daemon>> as RDKV
[App Plugin] <<component>> as AppPlugin
[Firmware Update Library] <<library>> as FWUpdate
package "Common Utilities" {
[libdwnl] <<library>>
[libjsonparser] <<library>>
[libutils] <<library>>
}
' New libs placed outside "Common Utilities" per your instruction
[iarmlib] <<library>>
[rfclib] <<library>>
[jsonlib] <<library>>
[upgradelib] <<library>>
[Flash Memory] <<storage>> as FlashMem
}
' Layer 2: External Network Servers
package "External Servers" {
[XConf Server] <<cloud>> as XConf
[SSR Server] <<cloud>> as SSR
}
' App Plugin interactions (unchanged)
AppPlugin --> FWUpdate : download + flash API calls
' Preserve original communication between daemon and Firmware Update Library (unchanged)
FWUpdate ..> RDKV : IPC Request\n(download/flash tasks)
RDKV ..> FWUpdate : IPC Response\n(task result)
' rdkvfwupdater uses new libs and common utilities and flash memory
RDKV --> rfclib : fetch RFC data
RDKV --> iarmlib : send status/notify MM
RDKV --> jsonlib : prepare JSON request
RDKV --> upgradelib : coordinate upgrade policies
upgradelib --> libdwnl : delegate network download calls
RDKV --> libjsonparser : parse JSON config (responses)
RDKV --> libutils : device info/utils
RDKV --> FlashMem : flash firmware
' Common utils interaction with servers (unchanged)
libdwnl --> XConf : fetch xconf data
libdwnl --> SSR : download firmware image
@enduml |
...