Architecture of swu-core library

The swu-core library maintains the data structures containing update information and the state of the update process, but you must write your own modules to specify how to carry out individual update tasks. This design lets you customize all the steps involved in applying software updates.

The following diagram shows the swu-core library and the different modules involved in the software update process:

Figure 1. Interaction between swu-core library and modules used for software updates

In Figure 1, the swu-core library is shown in the center and is surrounded by the modules that developers must write to build a complete software update mechanism. The modules are as follows:

HMI/User
Includes code to view the available software updates and to display the progress of any updates currently being installed. This module also handles requests, either automated or issued through a GUI, to accept or decline an update.
Discovery
Locates software update manifest files and generates Update objects based on these files. For example, this module could search attached USB devices to discover manifest files and then invoke the library API to create objects based on the manifest files found.
Configuration
Reads and sets the configuration options of the swu-core library. This module must also implement any saving and restoring of configuration options.
UpdateTarget
Represents a system that has updatable software. The library can support many UpdateTarget objects concurrently.

Library components

The following diagram shows the internal components of the swu-core library:

Figure 2. Components in swu-core library

As Figure 2 shows, the library is made up of these parts:

Update List
A list of Update objects known to the library. Each object represents an available update of a target system to a newer version.
UpdateTarget List
A list of UpdateTarget objects registered with the library. Each object represents an accessible target system.
Event Thread
The main event thread. All callbacks are executed in the context of this thread, so the client code should quickly exit from any callbacks to ensure good performance of the library.
Configuration
Configuration options for the library. Note that the configuration isn't persisted across reboots by the library, so the Configuration module should save and restore the configuration.