#define FIRMWARE_FILE_NAME "delta.tar.gz"
+#ifdef DEBUG_MODE
+#define DEBUG_FLAG "/opt/etc/.debugupdate"
+#endif
+
static struct _cloud_account {
const char *access_token;
const char *user_id;
static alarm_id_t polling_alarm_id = -1;
#endif // SET_POLLING
+#ifdef DEBUG_MODE
+static bool debug_mode = false;
+#endif
+
static void message_port_cb(int local_port_id,
const char *remote_app_id,
const char *remote_port,
API int update_control_initialize(void)
{
+ _D("FN CALLED>>>>>>>>>>>>>>>>>>");
+
+#ifdef DEBUG_MODE
+ if (access(DEBUG_FLAG, F_OK) == 0) {
+ debug_mode = true;
+ _D("DEBUG_MODE: Calling test");
+
+ return UPDATE_CONTROL_ERROR_NONE;
+ }
+#endif
+
update_info = (struct _update_info *)malloc(sizeof(*update_info));
update_info->new_version = NULL;
update_info->package_uri = NULL;
API int update_control_deinitialize(void)
{
+ _D("FN CALLED>>>>>>>>>>>>>>>>>>");
+
+#ifdef DEBUG_MODE
+ if (debug_mode) {
+ _D("DEBUG_MODE: Calling test");
+ return UPDATE_CONTROL_ERROR_NONE;
+ }
+#endif
+
int ret;
if (update_info->new_version)
API int update_control_check_new_version(void)
{
+ _D("FN CALLED>>>>>>>>>>>>>>>>>>");
+
+#ifdef DEBUG_MODE
+ if (debug_mode) {
+ _D("DEBUG_MODE: Calling test");
+ return UPDATE_CONTROL_ERROR_NONE;
+ }
+#endif
+
int ret;
char *device_type = NULL;
char *version = NULL;
char *res_header = NULL;
char *res_body = NULL;
- _D("FN CALLED>>>>>>>>>>>>>>>>>>");
-
retvm_if(!update_info, UPDATE_CONTROL_ERROR_SYSTEM_ERROR,
"update controller not initialized");
update_info->updatable = 0;
API int update_control_download_package(void)
{
_D("FN CALLED>>>>>>>>>>>>>>>>>>");
+#ifdef DEBUG_MODE
+ if (debug_mode) {
+ _D("DEBUG_MODE: Calling test");
+ return UPDATE_CONTROL_ERROR_NONE;
+ }
+#endif
int ret = 0;
char *download_url = NULL;
{
_D("FN CALLED>>>>>>>>>>>>>>>>>>");
+#ifdef DEBUG_MODE
+ if (debug_mode) {
+ _D("DEBUG_MODE: Calling test");
+ return UPDATE_CONTROL_ERROR_NONE;
+ }
+#endif
+
char *path = NULL;
if (!package_downloaded) {
API int update_control_make_reservation(struct tm *reservation_time)
{
- int ret;
- alarm_date_t alarm_time;
- alarm_entry_t *alarm_info = NULL;
+ _D("FN CALLED>>>>>>>>>>>>>>>>>>");
retvm_if(!reservation_time, UPDATE_CONTROL_ERROR_INVALID_PARAMETER,
"reservation_time is NULL");
+#ifdef DEBUG_MODE
+ if (debug_mode) {
+ _D("DEBUG_MODE: Calling test");
+ return UPDATE_CONTROL_ERROR_NONE;
+ }
+#endif
+
+ int ret;
+ alarm_date_t alarm_time;
+ alarm_entry_t *alarm_info = NULL;
+
alarm_info = alarmmgr_create_alarm();
if (alarm_info == NULL) {
_E("alarmmgr_create_alarm failed");
API int update_control_cancel_reservation(void)
{
+ _D("FN CALLED>>>>>>>>>>>>>>>>>>");
+
+#ifdef DEBUG_MODE
+ if (debug_mode) {
+ _D("DEBUG_MODE: Calling test");
+ return UPDATE_CONTROL_ERROR_NONE;
+ }
+#endif
+
int ret = 0;
if (reserved_update_alarm_id == -1) {
API int update_control_get_property(update_control_property_e property, void **value)
{
_D("FN CALLED>>>>>>>>>>>>>>>>>>");
+
+#ifdef DEBUG_MODE
+ if (debug_mode)
+ switch (property) {
+ case UPDATE_CONTROL_PROPERTY_NEW_VERSION:
+ case UPDATE_CONTROL_PROPERTY_PACKAGE_URI:
+ case UPDATE_CONTROL_PROPERTY_RESULT:
+ case UPDATE_CONTROL_PROPERTY_PACKAGE_SIZE:
+ case UPDATE_CONTROL_PROPERTY_DESCRIPTION:
+ case UPDATE_CONTROL_PROPERTY_UPDATE_AVAILABLE:
+ _D("DEBUG_MODE: Calling test");
+ return UPDATE_CONTROL_ERROR_NONE;
+ default:
+ _E("Not supported property key: %d", property);
+ return UPDATE_CONTROL_ERROR_KEY_NOT_FOUND;
+ }
+#endif
+
int *int_val;
int ret = UPDATE_CONTROL_ERROR_NONE;