Commit 260e696c authored by Frédéric Leroy's avatar Frédéric Leroy

UE: move nvram data filename to nas_user_t

parent 5fc04564
......@@ -102,6 +102,13 @@ void *nas_ue_task(void *args_p)
exit(EXIT_FAILURE);
}
/* Get UE's data pathname */
user->user_nvdata_store = memory_get_path(USER_NVRAM_DIRNAME, USER_NVRAM_FILENAME);
if ( user->user_nvdata_store == NULL ) {
LOG_E(NAS, "[UE %d] - Failed to get USIM data application filename", user->ueid);
exit(EXIT_FAILURE);
}
/* Initialize user interface (to exchange AT commands with user process) */
nas_user_api_id_initialize(user);
user->user_at_commands = calloc_or_fail(sizeof(user_at_commands_t));
......
......@@ -161,20 +161,11 @@ void nas_user_initialize(nas_user_t *user, emm_indication_callback_t emm_cb,
user->nas_user_nvdata = calloc_or_fail(sizeof(user_nvdata_t));
/* Get UE's data pathname */
char *path = memory_get_path(USER_NVRAM_DIRNAME, USER_NVRAM_FILENAME);
if (path == NULL) {
LOG_TRACE(ERROR, "USR-MAIN - Failed to get UE's data pathname");
exit(EXIT_FAILURE);
}
/* Get UE data stored in the non-volatile memory device */
int rc = memory_read(path, user->nas_user_nvdata, sizeof(user_nvdata_t));
int rc = memory_read(user->usim_data_store, user->nas_user_nvdata, sizeof(user_nvdata_t));
if (rc != RETURNok) {
LOG_TRACE(ERROR, "USR-MAIN - Failed to read %s", path);
LOG_TRACE(ERROR, "USR-MAIN - Failed to read %s", user->nas_user_nvdata);
}
free(path);
user->nas_user_context = calloc_or_fail(sizeof(nas_user_context_t));
_nas_user_context_initialize(user->nas_user_context, version);
......
......@@ -77,6 +77,7 @@ typedef struct {
usim_data_t usim_data; // USIM application data
const char *usim_data_store; // USIM application data filename
user_nvdata_t *nas_user_nvdata; //UE parameters stored in the UE's non-volatile memory device
const char *user_nvdata_store; //UE parameters stored in the UE's non-volatile memory device
//
nas_user_context_t *nas_user_context;
at_response_t *at_response; // data structure returned to the user as the result of NAS procedure function call
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment