swu_update_register_notifications()

Register a set of notification callbacks for an update

Synopsis:

#include <swu/Update.h>
 
swu_result_t swu_update_register_notifications(
            swu_update_t update, 
            const swu_update_notifications_t *notifications )

Arguments:

update
Handle of the Update.
notifications
A pointer to the swu_update_notifications_t structure containing the notification callbacks to register.

Library:

libswu-core

Use the -l swu-core option with qcc to link against the SWU library. This library is usually included automatically.

Description:

Register a set of notification callbacks for the Update specified in update. After this function returns SWU_RESULT_SUCCESS, the library calls the callback functions referred to in notifications whenever the Update state changes or the associated UpdateTarget reports progress.

The notification data isn't copied, allowing the owner of the notifications to change the data at runtime, which is the intended design. If this function is called multiple times with different pointers to notification structures, then multiple notification sets are registered. If the same pointer is used in different calls to this function, only the last set of notifications registered will remain registered.

Returns:

One of the following swu_result_t values:

SWU_RESULT_SUCCESS
The operation succeeded.
SWU_RESULT_INVALID_ARGUMENT
One of the arguments is invalid.
SWU_RESULT_ERROR
Another error occurred.