Implementing component update
The FOTA library supports update of components different from the main firmware image, such as wireless connectivity modules, embedded sensors or different partitions or packages in Linux-based devices; a BLE stack running on a coprocessor.
To use the component update feature, your application must use the APIs specified in the FOTA component update header file.
To register extra components:
- 
Define the number of components present in the system by adding the FOTA_NUM_COMPONENTS=xmacro to your build configuration file.- 
Where xis the number of components present in the system including theMAINcomponent of the firmware image.
- 
For Mbed OS, add this line to your mbed_app.jsonfile:"fota.num-components": x
 
- 
- 
Enable implementation of firmware update in your application by enabling the FOTA_CUSTOM_PLATFORMmacro, as described in Integrating firmware update platform hooks with your application.
- 
Register your component by calling the fota_component_add()API in the application implementation of thefota_platform_init_hook()API (see fota_platform.h), which the client calls when it initializes the FOTA module.
- 
To register a component, the application must fill in the fota_component_desc_info_tcomponent descriptor structure defined in fota_component.h.For a component registration example, please see https://github.com/PelionIoT/pelion-client-lite-example/blob/master/source/fota_platform.c. Device Management Portal displays the names and version numbers of registered components when the device connects. You can use component names and versions to filter devices when creating an update campaigns.