Snapdragon® Telematics Application Framework (TelAF) Interface Specification
Update Service

API Reference


The Update Service APIs are designed for over-the-air (OTA) solutions. The OTA package is encapsulated with a QOTA header, which can be uploaded to the cloud server and downloaded to the target device. In a QOTA header, the package can be marked as firmware or application bundle. The Update Service supports installing firmware and applications and it parses the bundle when the OTA package is downloaded on the target device. Users can register a handler to get detailed update progress.

Note
Currently update service does not support firmware and application updates at the same time. Users should install the OTA package after it's downloaded successfully.

IPC interfaces binding

The functions of this API are provided by the tafUpdateSvc service.

The following example illustrates how to bind to the Update Service.

bindings:
{
    clientExe.clientComponent.taf_update -> tafUpdateSvc.taf_update
}

OTA Functions

The following example illustrates registering a handler for updated states.

Use taf_update_AddStateHandler() to register the handler as a callback for update state and handle the different state when an indication arrives.

void UpdateStateHandler(taf_update_StateInd_t* indication, void* contextPtr)
{
switch (indication->state) {
// Check download consent from user.
// Start to download.
break;
// Show download progress.
LE_INFO("Downloading %d%% .", indication->percent);
break;
LE_ERROR("Download fail.");
break;
// Check install consent from user.
// Start to install.
if (indication->ota == TAF_UPDATE_PACKAGE_FOTA) {
LE_INFO("Install firmware.");
} else {
LE_INFO("Install application.");
// Show app name.
if (indication->name != NULL) {
LE_INFO("App name is %s", indication->name);
}
}
break;
// Show install progress.
LE_INFO("Installing %d%% .", indication->percent);
break;
// Reboot to active for firmware upgrade or start app probation.
break;
// Do not perform any OTA operations during probation.
break;
}
}
// Register handler for update state.
handlerRef = taf_update_AddStateHandler((taf_update_StateHandlerFunc_t)UpdateStateHandler, NULL);
LE_ASSERT(handlerRef != NULL);