if (ret != 0) {
_E("failed to idm_command_set_info_cmd");
- idm_command_stop(ad->command);
idm_command_free(command);
ad->command = NULL;
return;
}
ret = idm_command_run(command, result_cb_func, ad);
- if (ret != 0) {
- _E("failed to idm_command_run");
- idm_command_stop(ad->command);
- idm_command_free(command);
- ad->command = NULL;
- return;
- }
-}
-
-static void __get_log_archive_result_cb(idm_command_h command, idm_result_e result, idm_reason_e reason, const char *detail, void *data)
-{
- unsigned long id;
- idm_command_get_id(command, &id);
-
- _D("[%d] result : %d, reason : %d, detail : %s", id, result, reason, detail ? detail : "None");
-
- if (result != IDM_RESULT_RUNNING) {
- app_data *ad = data;
- idm_command_free(command);
- ad->command = NULL;
- }
-}
-
-static void __get_log_archive(const char *log_path_arr[], const char *archive_file, unsigned long id, idm_result_cb result_cb_func, void *data)
-{
- app_data *ad = data;
- idm_command_h command = NULL;
- char *request = NULL;
- int ret = -1;
- idm_command_new(&command);
- ret_if(!command);
-
- idm_command_set_id(command, id);
- ad->command = command;
-
- request = __make_log_archive_request(log_path_arr, archive_file);
- if (!request) {
- _E("failed to make request");
- idm_command_free(command);
- ad->command = NULL;
- return;
- }
-
- ret = idm_command_set_diagnosis_cmd(command, IDM_CMD_DIAGNOSIS_GET_LOG, request);
-
- g_free(request);
- request = NULL;
-
- if (ret != 0) {
- _E("failed to idm_command_set_info_cmd");
- idm_command_stop(ad->command);
- idm_command_free(command);
- ad->command = NULL;
- return;
- }
-
- ret = idm_command_run(command, result_cb_func, ad);
if (ret != 0) {
_E("failed to idm_command_run");
- idm_command_stop(ad->command);
idm_command_free(command);
ad->command = NULL;
return;