Tizen(Headed) Native API  6.5
Update Control

The Update Control API provides functions which implement update operations This section provides more information about the Update Control API.

Required Header

#include <update_control.h>

Overview

The Update Control API provides functions which implement update operations such as connect to update server, request update information, and set update configurations. It enables the application to get the update information and control the platform version of the device. Therefore this API should be used by authorized developer like platform provider only. Because the update server may have various protocols, the implementation of APIs is able to be substituted by custom functions which connect to the server serviced by each service provider. As a default implementation, the agent for STDM (SmartThings Device Manager) is offered. SmartThings Device Manager Console

Related Features

This API is related with the following features:

It is recommended to design applications with regard to features, for reliability.

You can check if a device supports the related features for this API by using System Information, and control your application's actions accordingly.

To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.

More details on using features in your application can be found in the feature element description.

Functions

int update_control_initialize (void)
 Initializes the update controller.
int update_control_deinitialize (void)
 Deinitializes the update controller.
int update_control_check_new_version (void)
 Requests checking new version of firmware.
int update_control_download_package (void)
 Requests downloading new version of firmware.
int update_control_do_update (void)
 Requests triggering update to new firmware.
int update_control_make_reservation (struct tm *reservation_time)
 Makes reservation for update.
int update_control_cancel_reservation (void)
 Cancels the update reservation.
int update_control_get_property (update_control_property_e property, void **value)
 Gets the update property of the given key.

Enumeration Type Documentation

Enumeration for the update control error.

Since :
5.0
Enumerator:
UPDATE_CONTROL_ERROR_NONE 

Successful

UPDATE_CONTROL_ERROR_INVALID_PARAMETER 

Invalid parameter

UPDATE_CONTROL_ERROR_OUT_OF_MEMORY 

Out of memory

UPDATE_CONTROL_ERROR_FILE_NO_SPACE_ON_DEVICE 

No space left on device

UPDATE_CONTROL_ERROR_KEY_NOT_FOUND 

Specified key is not found

UPDATE_CONTROL_ERROR_KEY_REJECTED 

Key is not available

UPDATE_CONTROL_ERROR_NOT_SUPPORTED 

Not supported

UPDATE_CONTROL_ERROR_PERMISSION_DENIED 

Permission denied

UPDATE_CONTROL_ERROR_CONNECTION_ABORTED 

Software caused connection abort

UPDATE_CONTROL_ERROR_CONNECTION_REFUSED 

Connection refused

UPDATE_CONTROL_ERROR_PROTOCOL_NOT_SUPPORTED 

Protocol not supported

UPDATE_CONTROL_ERROR_TIMED_OUT 

Time out

UPDATE_CONTROL_ERROR_INVALID_OPERATION 

Function not implemented

UPDATE_CONTROL_ERROR_INVALID_PACKAGE 

Invalid package

UPDATE_CONTROL_ERROR_INVALID_URI 

Invalid URI

UPDATE_CONTROL_ERROR_PACKAGE_NOT_SUPPORTED 

Package type not supported

UPDATE_CONTROL_ERROR_SYSTEM_ERROR 

System error

Enumeration for the update control properties.

Since :
5.0
Enumerator:
UPDATE_CONTROL_PROPERTY_NEW_VERSION 

New version

UPDATE_CONTROL_PROPERTY_PACKAGE_URI 

URI for update package

UPDATE_CONTROL_PROPERTY_RESULT 

Update result

UPDATE_CONTROL_PROPERTY_PACKAGE_SIZE 

Size of update package

UPDATE_CONTROL_PROPERTY_DESCRIPTION 

Update description

UPDATE_CONTROL_PROPERTY_UPDATE_AVAILABLE 

Updatability flag


Function Documentation

Cancels the update reservation.

Warning:
This is not for use by third-party applications.
Since :
5.0
Privilege Level:
platform
Privilege:
http://tizen.org/privilege/updatecontrol.admin
Returns:
0 on success, otherwise a negative error value
Return values:
UPDATE_CONTROL_ERROR_NONESuccessful
UPDATE_CONTROL_ERROR_PERMISSION_DENIEDPermission denied
UPDATE_CONTROL_ERROR_SYSTEM_ERRORSystem error
UPDATE_CONTROL_ERROR_INVALID_OPERATIONFunction not implemented
UPDATE_CONTROL_ERROR_NOT_SUPPORTEDNot supported

Requests checking new version of firmware.

Since :
5.0
Returns:
0 on success, otherwise a negative error value
Return values:
UPDATE_CONTROL_ERROR_NONESuccessful
UPDATE_CONTROL_ERROR_CONNECTION_REFUSEDConnection refused
UPDATE_CONTROL_ERROR_SYSTEM_ERRORSystem error
UPDATE_CONTROL_ERROR_INVALID_OPERATIONFunction not implemented
UPDATE_CONTROL_ERROR_NOT_SUPPORTEDNot supported

Deinitializes the update controller.

Since :
5.0
Returns:
0 on success, otherwise a negative error value
Return values:
UPDATE_CONTROL_ERROR_NONESuccessful
UPDATE_CONTROL_ERROR_OUT_OF_MEMORYOut of memory
UPDATE_CONTROL_ERROR_SYSTEM_ERRORSystem error
UPDATE_CONTROL_ERROR_INVALID_OPERATIONFunction not implemented
UPDATE_CONTROL_ERROR_NOT_SUPPORTEDNot supported
See also:
update_control_initialize()
int update_control_do_update ( void  )

Requests triggering update to new firmware.

Warning:
This is not for use by third-party applications.
Since :
5.0
Privilege Level:
platform
Privilege:
http://tizen.org/privilege/updatecontrol.admin
Returns:
0 on success, otherwise a negative error value
Return values:
UPDATE_CONTROL_ERROR_NONESuccessful
UPDATE_CONTROL_ERROR_PERMISSION_DENIEDPermission denied
UPDATE_CONTROL_ERROR_TIMED_OUTTime out
UPDATE_CONTROL_ERROR_INVALID_PACKAGEInvalid package
UPDATE_CONTROL_ERROR_PACKAGE_NOT_SUPPORTEDPackage type not supported
UPDATE_CONTROL_ERROR_SYSTEM_ERRORSystem error
UPDATE_CONTROL_ERROR_INVALID_OPERATIONFunction not implemented
UPDATE_CONTROL_ERROR_NOT_SUPPORTEDNot supported

Requests downloading new version of firmware.

Since :
5.0
Returns:
0 on success, otherwise a negative error value
Return values:
UPDATE_CONTROL_ERROR_NONESuccessful
UPDATE_CONTROL_ERROR_FILE_NO_SPACE_ON_DEVICENo space left on device
UPDATE_CONTROL_ERROR_OUT_OF_MEMORYOut of memory
UPDATE_CONTROL_ERROR_CONNECTION_REFUSEDConnection refused
UPDATE_CONTROL_ERROR_CONNECTION_ABORTEDSoftware caused connection abort
UPDATE_CONTROL_ERROR_PROTOCOL_NOT_SUPPORTEDProtocol not supported
UPDATE_CONTROL_ERROR_INVALID_URIInvalid URI
UPDATE_CONTROL_ERROR_SYSTEM_ERRORSystem error
UPDATE_CONTROL_ERROR_INVALID_OPERATIONFunction not implemented
UPDATE_CONTROL_ERROR_NOT_SUPPORTEDNot supported
int update_control_get_property ( update_control_property_e  property,
void **  value 
)

Gets the update property of the given key.

Since :
5.0
Remarks:
The value must be released using free()
Parameters:
[in]propertyThe key of property to get
[out]valueThe value of given property
Returns:
0 on success, otherwise a negative error value
Return values:
UPDATE_CONTROL_ERROR_NONESuccessful
UPDATE_CONTROL_ERROR_INVALID_PARAMETERInvalid parameter
UPDATE_CONTROL_ERROR_OUT_OF_MEMORYOut of memory
UPDATE_CONTROL_ERROR_KEY_NOT_FOUNDSpecified property not found
UPDATE_CONTROL_ERROR_KEY_REJECTEDSpecified property not available
UPDATE_CONTROL_ERROR_SYSTEM_ERRORSystem error
UPDATE_CONTROL_ERROR_INVALID_OPERATIONFunction not implemented
UPDATE_CONTROL_ERROR_NOT_SUPPORTEDNot supported
int update_control_initialize ( void  )

Initializes the update controller.

Since :
5.0
Returns:
0 on success, otherwise a negative error value
Return values:
UPDATE_CONTROL_ERROR_NONESuccessful
UPDATE_CONTROL_ERROR_OUT_OF_MEMORYOut of memory
UPDATE_CONTROL_ERROR_SYSTEM_ERRORSystem error
UPDATE_CONTROL_ERROR_INVALID_OPERATIONFunction not implemented
UPDATE_CONTROL_ERROR_NOT_SUPPORTEDNot supported
See also:
update_control_deinitialize()
int update_control_make_reservation ( struct tm *  reservation_time)

Makes reservation for update.

Warning:
This is not for use by third-party applications.

Makes update reservation at a specific time. At the given time, it automatically checks, downloads and updates to a new version. To cancel the reservation, call update_control_cancel_reservation().

Since :
5.0
Privilege Level:
platform
Privilege:
http://tizen.org/privilege/updatecontrol.admin
Remarks:
Only one reservation can be used at any given time. If a new reservation is made, the previous one will be removed.
Parameters:
[in]reservation_timeThe time to start update
Returns:
0 on success, otherwise a negative error value
Return values:
UPDATE_CONTROL_ERROR_NONESuccessful
UPDATE_CONTROL_ERROR_INVALID_PARAMETERInvalid parameter
UPDATE_CONTROL_ERROR_PERMISSION_DENIEDPermission denied
UPDATE_CONTROL_ERROR_SYSTEM_ERRORSystem error
UPDATE_CONTROL_ERROR_INVALID_OPERATIONFunction not implemented
UPDATE_CONTROL_ERROR_NOT_SUPPORTEDNot supported