UE: move _nas_proc_data to nas_user_t struct
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
#include "nas_user.h"
|
||||
#include "nas_network.h"
|
||||
#include "nas_parser.h"
|
||||
#include "user_defs.h"
|
||||
|
||||
#include <stdlib.h> // exit
|
||||
#include <poll.h> // poll
|
||||
@@ -72,6 +73,8 @@ static void _nas_signal_handler(int signal);
|
||||
static void _nas_clean(int usr_fd, int net_fd);
|
||||
|
||||
uint8_t usim_test = 0;
|
||||
// FIXME user must be set up with right itti message instance
|
||||
nas_user_t *user = NULL;
|
||||
|
||||
/****************************************************************************/
|
||||
/****************** E X P O R T E D F U N C T I O N S ******************/
|
||||
@@ -129,7 +132,7 @@ int main(int argc, const char *argv[])
|
||||
/*
|
||||
* Initialize the NAS contexts
|
||||
*/
|
||||
nas_user_initialize (&user_api_emm_callback, &user_api_esm_callback,
|
||||
nas_user_initialize (user, &user_api_emm_callback, &user_api_esm_callback,
|
||||
FIRMWARE_VERSION);
|
||||
nas_network_initialize ();
|
||||
|
||||
@@ -226,7 +229,7 @@ static void *_nas_user_mngr(void *args)
|
||||
|
||||
/* User receiving loop */
|
||||
while (!exit_loop) {
|
||||
exit_loop = nas_user_receive_and_process(fd, NULL);
|
||||
exit_loop = nas_user_receive_and_process(user, NULL);
|
||||
}
|
||||
|
||||
/* Close the connection to the user application layer */
|
||||
@@ -291,7 +294,7 @@ static void *_nas_network_mngr(void *args)
|
||||
}
|
||||
|
||||
/* Process the network data message */
|
||||
ret_code = nas_network_process_data (network_message_id,
|
||||
ret_code = nas_network_process_data (user, network_message_id,
|
||||
network_api_get_data ());
|
||||
|
||||
if (ret_code != RETURNok) {
|
||||
|
||||
@@ -43,6 +43,7 @@ Description NAS procedure functions triggered by the network
|
||||
|
||||
#include "as_message.h"
|
||||
#include "nas_proc.h"
|
||||
#include "user_defs.h"
|
||||
|
||||
/****************************************************************************/
|
||||
/**************** E X T E R N A L D E F I N I T I O N S ****************/
|
||||
@@ -118,7 +119,7 @@ void nas_network_cleanup(void)
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int nas_network_process_data(int msg_id, const void *data)
|
||||
int nas_network_process_data(nas_user_t *user, int msg_id, const void *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -142,7 +143,7 @@ int nas_network_process_data(int msg_id, const void *data)
|
||||
/* Received cell information confirm */
|
||||
const cell_info_cnf_t *info = &msg->msg.cell_info_cnf;
|
||||
int cell_found = (info->errCode == AS_SUCCESS);
|
||||
rc = nas_proc_cell_info(cell_found, info->tac,
|
||||
rc = nas_proc_cell_info(user, cell_found, info->tac,
|
||||
info->cellID, info->rat,
|
||||
info->rsrp, info->rsrq);
|
||||
break;
|
||||
|
||||
@@ -40,6 +40,8 @@ Description NAS procedure functions triggered by the network
|
||||
#ifndef __NAS_NETWORK_H__
|
||||
#define __NAS_NETWORK_H__
|
||||
|
||||
#include "user_defs.h"
|
||||
|
||||
/****************************************************************************/
|
||||
/********************* G L O B A L C O N S T A N T S *******************/
|
||||
/****************************************************************************/
|
||||
@@ -61,7 +63,7 @@ void nas_network_initialize(void);
|
||||
|
||||
void nas_network_cleanup(void);
|
||||
|
||||
int nas_network_process_data(int command_id, const void *data);
|
||||
int nas_network_process_data(nas_user_t *user, int command_id, const void *data);
|
||||
|
||||
const void *nas_network_get_data(void);
|
||||
|
||||
|
||||
+25
-35
@@ -38,6 +38,7 @@ Description NAS procedure call manager
|
||||
|
||||
#include "nas_proc.h"
|
||||
#include "nas_log.h"
|
||||
#include "nas_user.h"
|
||||
|
||||
#include "emm_main.h"
|
||||
#include "emm_sap.h"
|
||||
@@ -62,17 +63,6 @@ Description NAS procedure call manager
|
||||
#define NAS_PROC_RSRQ_UNKNOWN 255
|
||||
#define NAS_PROC_RSRP_UNKNOWN 255
|
||||
|
||||
/*
|
||||
* Local NAS data
|
||||
*/
|
||||
static struct {
|
||||
/* EPS capibility status */
|
||||
int EPS_capability_status;
|
||||
/* Reference signal received quality */
|
||||
int rsrq;
|
||||
/* Reference signal received power */
|
||||
int rsrp;
|
||||
} _nas_proc_data;
|
||||
|
||||
static int _nas_proc_activate(int cid, int apply_to_all);
|
||||
static int _nas_proc_deactivate(int cid, int apply_to_all);
|
||||
@@ -97,15 +87,15 @@ static int _nas_proc_deactivate(int cid, int apply_to_all);
|
||||
** Others: _nas_proc_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
void nas_proc_initialize(emm_indication_callback_t emm_cb,
|
||||
void nas_proc_initialize(nas_user_t *user, emm_indication_callback_t emm_cb,
|
||||
esm_indication_callback_t esm_cb, const char *imei)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
/* Initialize local NAS data */
|
||||
_nas_proc_data.EPS_capability_status = FALSE;
|
||||
_nas_proc_data.rsrq = NAS_PROC_RSRQ_UNKNOWN;
|
||||
_nas_proc_data.rsrp = NAS_PROC_RSRP_UNKNOWN;
|
||||
user->proc.EPS_capability_status = FALSE;
|
||||
user->proc.rsrq = NAS_PROC_RSRQ_UNKNOWN;
|
||||
user->proc.rsrp = NAS_PROC_RSRP_UNKNOWN;
|
||||
|
||||
/* Initialize the EMM procedure manager */
|
||||
emm_main_initialize(emm_cb, imei);
|
||||
@@ -131,7 +121,7 @@ void nas_proc_initialize(emm_indication_callback_t emm_cb,
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
void nas_proc_cleanup(void)
|
||||
void nas_proc_cleanup()
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -172,7 +162,7 @@ void nas_proc_cleanup(void)
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int nas_proc_enable_s1_mode(void)
|
||||
int nas_proc_enable_s1_mode(nas_user_t *user)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -183,7 +173,7 @@ int nas_proc_enable_s1_mode(void)
|
||||
* Notify the EMM procedure call manager that EPS capability
|
||||
* of the UE is enabled
|
||||
*/
|
||||
_nas_proc_data.EPS_capability_status = TRUE;
|
||||
user->proc.EPS_capability_status = TRUE;
|
||||
emm_sap.primitive = EMMREG_S1_ENABLED;
|
||||
rc = emm_sap_send(&emm_sap);
|
||||
|
||||
@@ -205,7 +195,7 @@ int nas_proc_enable_s1_mode(void)
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int nas_proc_disable_s1_mode(void)
|
||||
int nas_proc_disable_s1_mode(nas_user_t *user)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -216,7 +206,7 @@ int nas_proc_disable_s1_mode(void)
|
||||
* Notify the EMM procedure call manager that EPS capability
|
||||
* of the UE is disabled
|
||||
*/
|
||||
_nas_proc_data.EPS_capability_status = FALSE;
|
||||
user->proc.EPS_capability_status = FALSE;
|
||||
emm_sap.primitive = EMMREG_S1_DISABLED;
|
||||
rc = emm_sap_send(&emm_sap);
|
||||
|
||||
@@ -238,11 +228,11 @@ int nas_proc_disable_s1_mode(void)
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int nas_proc_get_eps(int *stat)
|
||||
int nas_proc_get_eps(nas_user_t *user, int *stat)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
*stat = _nas_proc_data.EPS_capability_status;
|
||||
*stat = user->proc.EPS_capability_status;
|
||||
|
||||
LOG_FUNC_RETURN (RETURNok);
|
||||
}
|
||||
@@ -358,12 +348,12 @@ int nas_proc_get_msisdn(char *msisdn_str, int *ton_npi)
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int nas_proc_get_signal_quality(int *rsrq, int *rsrp)
|
||||
int nas_proc_get_signal_quality(nas_user_t *user, int *rsrq, int *rsrp)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
*rsrq = _nas_proc_data.rsrq;
|
||||
*rsrp = _nas_proc_data.rsrp;
|
||||
*rsrq = user->proc.rsrq;
|
||||
*rsrp = user->proc.rsrp;
|
||||
|
||||
LOG_FUNC_RETURN (RETURNok);
|
||||
}
|
||||
@@ -426,7 +416,7 @@ int nas_proc_register(int mode, int format, const network_plmn_t *oper, int AcT)
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int nas_proc_deregister(void)
|
||||
int nas_proc_deregister()
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -604,7 +594,7 @@ int nas_proc_detach(int switch_off)
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int nas_proc_attach(void)
|
||||
int nas_proc_attach()
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -636,7 +626,7 @@ int nas_proc_attach(void)
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int nas_proc_get_attach_status(void)
|
||||
int nas_proc_get_attach_status()
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -659,7 +649,7 @@ int nas_proc_get_attach_status(void)
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int nas_proc_get_pdn_range(void)
|
||||
int nas_proc_get_pdn_range()
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -1021,7 +1011,7 @@ int nas_proc_activate_pdn(int cid)
|
||||
** Others: _nas_proc_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int nas_proc_cell_info(int found, tac_t tac, ci_t ci, AcT_t AcT,
|
||||
int nas_proc_cell_info(nas_user_t *user, int found, tac_t tac, ci_t ci, AcT_t AcT,
|
||||
uint8_t rsrq, uint8_t rsrp)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
@@ -1030,8 +1020,8 @@ int nas_proc_cell_info(int found, tac_t tac, ci_t ci, AcT_t AcT,
|
||||
int rc;
|
||||
|
||||
/* Store LTE signal strength/quality measurement data */
|
||||
_nas_proc_data.rsrq = rsrq;
|
||||
_nas_proc_data.rsrp = rsrp;
|
||||
user->proc.rsrq = rsrq;
|
||||
user->proc.rsrp = rsrp;
|
||||
|
||||
/*
|
||||
* Notify the EMM procedure call manager that cell information
|
||||
@@ -1103,7 +1093,7 @@ int nas_proc_establish_cnf(const Byte_t *data, uint32_t len)
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int nas_proc_establish_rej(void)
|
||||
int nas_proc_establish_rej()
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -1170,7 +1160,7 @@ int nas_proc_release_ind(int cause)
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int nas_proc_ul_transfer_cnf(void)
|
||||
int nas_proc_ul_transfer_cnf()
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -1207,7 +1197,7 @@ int nas_proc_ul_transfer_cnf(void)
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int nas_proc_ul_transfer_rej(void)
|
||||
int nas_proc_ul_transfer_rej()
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ Description NAS procedure call manager
|
||||
|
||||
#include "commonDef.h"
|
||||
#include "networkDef.h"
|
||||
#include "user_defs.h"
|
||||
#include "emm_main.h"
|
||||
#include "esm_ebr.h"
|
||||
|
||||
@@ -59,7 +60,7 @@ Description NAS procedure call manager
|
||||
/****************** E X P O R T E D F U N C T I O N S ******************/
|
||||
/****************************************************************************/
|
||||
|
||||
void nas_proc_initialize(emm_indication_callback_t emm_cb,
|
||||
void nas_proc_initialize(nas_user_t *user, emm_indication_callback_t emm_cb,
|
||||
esm_indication_callback_t esm_cb, const char *imei);
|
||||
|
||||
void nas_proc_cleanup(void);
|
||||
@@ -70,14 +71,14 @@ void nas_proc_cleanup(void);
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int nas_proc_enable_s1_mode(void);
|
||||
int nas_proc_disable_s1_mode(void);
|
||||
int nas_proc_get_eps(int *stat);
|
||||
int nas_proc_enable_s1_mode(nas_user_t *user);
|
||||
int nas_proc_disable_s1_mode(nas_user_t *user);
|
||||
int nas_proc_get_eps(nas_user_t *user, int *stat);
|
||||
|
||||
int nas_proc_get_imsi(char *imsi_str);
|
||||
int nas_proc_get_msisdn(char *msisdn_str, int *ton_npi);
|
||||
|
||||
int nas_proc_get_signal_quality(int *rsrq, int *rsrp);
|
||||
int nas_proc_get_signal_quality(nas_user_t *user, int *rsrq, int *rsrp);
|
||||
|
||||
int nas_proc_register(int mode, int format, const network_plmn_t *oper, int AcT);
|
||||
int nas_proc_deregister(void);
|
||||
@@ -110,7 +111,7 @@ int nas_proc_activate_pdn(int cid);
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int nas_proc_cell_info(int found, tac_t tac, ci_t ci, AcT_t rat, uint8_t rsrp,
|
||||
int nas_proc_cell_info(nas_user_t *user, int found, tac_t tac, ci_t ci, AcT_t rat, uint8_t rsrp,
|
||||
uint8_t rsrq);
|
||||
|
||||
int nas_proc_establish_cnf(const Byte_t *data, uint32_t len);
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef _NAS_PROC_DEFS_H
|
||||
#define _NAS_PROC_DEFS_H
|
||||
|
||||
/*
|
||||
* Local NAS data
|
||||
*/
|
||||
typedef struct {
|
||||
/* EPS capibility status */
|
||||
int EPS_capability_status;
|
||||
/* Reference signal received quality */
|
||||
int rsrq;
|
||||
/* Reference signal received power */
|
||||
int rsrp;
|
||||
} proc_data_t;
|
||||
|
||||
#endif
|
||||
@@ -49,7 +49,7 @@ static int nas_ue_process_events(nas_user_t *user, struct epoll_event *events, i
|
||||
if (events[event].events != 0) {
|
||||
/* If the event has not been yet been processed (not an itti message) */
|
||||
if (events[event].data.fd == user->fd) {
|
||||
exit_loop = nas_user_receive_and_process(&user->fd, NULL);
|
||||
exit_loop = nas_user_receive_and_process(user, NULL);
|
||||
} else {
|
||||
LOG_E(NAS, "[UE] Received an event from an unknown fd %d!\n", events[event].data.fd);
|
||||
}
|
||||
@@ -89,7 +89,7 @@ void *nas_ue_task(void *args_p)
|
||||
}
|
||||
|
||||
/* Initialize NAS user */
|
||||
nas_user_initialize (&user_api_emm_callback, &user_api_esm_callback, FIRMWARE_VERSION);
|
||||
nas_user_initialize (user, &user_api_emm_callback, &user_api_esm_callback, FIRMWARE_VERSION);
|
||||
}
|
||||
|
||||
/* Set UE activation state */
|
||||
@@ -117,7 +117,7 @@ void *nas_ue_task(void *args_p)
|
||||
/* Send an activate modem command to NAS like UserProcess should do it */
|
||||
char *user_data = "at+cfun=1\r";
|
||||
|
||||
nas_user_receive_and_process (&user->fd, user_data);
|
||||
nas_user_receive_and_process (user, user_data);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
@@ -137,7 +137,7 @@ void *nas_ue_task(void *args_p)
|
||||
{
|
||||
int cell_found = (NAS_CELL_SELECTION_CNF (msg_p).errCode == AS_SUCCESS);
|
||||
|
||||
nas_proc_cell_info (cell_found, NAS_CELL_SELECTION_CNF (msg_p).tac,
|
||||
nas_proc_cell_info (user, cell_found, NAS_CELL_SELECTION_CNF (msg_p).tac,
|
||||
NAS_CELL_SELECTION_CNF (msg_p).cellID, NAS_CELL_SELECTION_CNF (msg_p).rat,
|
||||
NAS_CELL_SELECTION_CNF (msg_p).rsrq, NAS_CELL_SELECTION_CNF (msg_p).rsrp);
|
||||
}
|
||||
|
||||
+55
-55
@@ -37,8 +37,7 @@ Description NAS procedure functions triggered by the user
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
#include "nas_user.h"
|
||||
#include "userDef.h"
|
||||
#include "user_defs.h"
|
||||
#include "nas_log.h"
|
||||
#include "memory.h"
|
||||
|
||||
@@ -47,6 +46,7 @@ Description NAS procedure functions triggered by the user
|
||||
#include "at_error.h"
|
||||
#include "user_indication.h"
|
||||
#include "nas_proc.h"
|
||||
#include "nas_user.h"
|
||||
#include "user_api.h"
|
||||
|
||||
#include <string.h> // memset, strncpy, strncmp
|
||||
@@ -65,30 +65,30 @@ Description NAS procedure functions triggered by the user
|
||||
* Functions executed upon receiving AT command from the user
|
||||
* ---------------------------------------------------------------------
|
||||
*/
|
||||
static int _nas_user_proc_cgsn (const at_command_t *data);
|
||||
static int _nas_user_proc_cgmi (const at_command_t *data);
|
||||
static int _nas_user_proc_cgmm (const at_command_t *data);
|
||||
static int _nas_user_proc_cgmr (const at_command_t *data);
|
||||
static int _nas_user_proc_cimi (const at_command_t *data);
|
||||
static int _nas_user_proc_cfun (const at_command_t *data);
|
||||
static int _nas_user_proc_cpin (const at_command_t *data);
|
||||
static int _nas_user_proc_csq (const at_command_t *data);
|
||||
static int _nas_user_proc_cesq (const at_command_t *data);
|
||||
static int _nas_user_proc_cops (const at_command_t *data);
|
||||
static int _nas_user_proc_cgatt (const at_command_t *data);
|
||||
static int _nas_user_proc_creg (const at_command_t *data);
|
||||
static int _nas_user_proc_cgreg (const at_command_t *data);
|
||||
static int _nas_user_proc_cereg (const at_command_t *data);
|
||||
static int _nas_user_proc_cgdcont (const at_command_t *data);
|
||||
static int _nas_user_proc_cgact (const at_command_t *data);
|
||||
static int _nas_user_proc_cmee (const at_command_t *data);
|
||||
static int _nas_user_proc_clck (const at_command_t *data);
|
||||
static int _nas_user_proc_cgpaddr (const at_command_t *data);
|
||||
static int _nas_user_proc_cnum (const at_command_t *data);
|
||||
static int _nas_user_proc_clac (const at_command_t *data);
|
||||
static int _nas_user_proc_cgsn (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_cgmi (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_cgmm (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_cgmr (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_cimi (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_cfun (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_cpin (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_csq (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_cesq (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_cops (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_cgatt (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_creg (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_cgreg (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_cereg (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_cgdcont (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_cgact (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_cmee (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_clck (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_cgpaddr (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_cnum (nas_user_t *user, const at_command_t *data);
|
||||
static int _nas_user_proc_clac (nas_user_t *user, const at_command_t *data);
|
||||
|
||||
/* NAS procedures applicable to AT commands */
|
||||
typedef int (*_nas_user_procedure_t) (const at_command_t *);
|
||||
typedef int (*_nas_user_procedure_t) (nas_user_t *, const at_command_t *);
|
||||
|
||||
static _nas_user_procedure_t _nas_user_procedure[AT_COMMAND_ID_MAX] = {
|
||||
NULL,
|
||||
@@ -186,7 +186,7 @@ static user_nvdata_t _nas_user_nvdata;
|
||||
** Others: _nas_user_nvdata, _nas_user_context **
|
||||
** **
|
||||
***************************************************************************/
|
||||
void nas_user_initialize(emm_indication_callback_t emm_cb,
|
||||
void nas_user_initialize(nas_user_t *user, emm_indication_callback_t emm_cb,
|
||||
esm_indication_callback_t esm_cb, const char *version)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
@@ -214,7 +214,7 @@ void nas_user_initialize(emm_indication_callback_t emm_cb,
|
||||
_nas_user_context.fun = AT_CFUN_FUN_DEFAULT;
|
||||
|
||||
/* Initialize the internal NAS processing data */
|
||||
nas_proc_initialize(emm_cb, esm_cb, _nas_user_nvdata.IMEI);
|
||||
nas_proc_initialize(user, emm_cb, esm_cb, _nas_user_nvdata.IMEI);
|
||||
|
||||
LOG_FUNC_OUT;
|
||||
}
|
||||
@@ -232,7 +232,7 @@ void nas_user_initialize(emm_indication_callback_t emm_cb,
|
||||
** Outputs: Return: FALSE, TRUE **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int nas_user_receive_and_process(int *fd, char *message)
|
||||
int nas_user_receive_and_process(nas_user_t *user, char *message)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -246,7 +246,7 @@ int nas_user_receive_and_process(int *fd, char *message)
|
||||
bytes = user_api_set_data(message);
|
||||
} else {
|
||||
/* Read the user data message */
|
||||
bytes = user_api_read_data (*fd);
|
||||
bytes = user_api_read_data (user->fd);
|
||||
|
||||
if (bytes == RETURNerror) {
|
||||
/* Failed to read data from the user application layer;
|
||||
@@ -279,7 +279,7 @@ int nas_user_receive_and_process(int *fd, char *message)
|
||||
}
|
||||
|
||||
/* Process the user data message */
|
||||
ret_code = nas_user_process_data (data);
|
||||
ret_code = nas_user_process_data (user, data);
|
||||
|
||||
if (ret_code != RETURNok) {
|
||||
/* The user data message has not been successfully
|
||||
@@ -302,7 +302,7 @@ int nas_user_receive_and_process(int *fd, char *message)
|
||||
}
|
||||
|
||||
/* Send the data message to the user */
|
||||
bytes = user_api_send_data (*fd, bytes);
|
||||
bytes = user_api_send_data (user->fd, bytes);
|
||||
|
||||
if (bytes == RETURNerror) {
|
||||
/* Failed to send data to the user application layer;
|
||||
@@ -334,7 +334,7 @@ int nas_user_receive_and_process(int *fd, char *message)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int nas_user_process_data(const void *data)
|
||||
int nas_user_process_data(nas_user_t *user, const void *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -355,7 +355,7 @@ int nas_user_process_data(const void *data)
|
||||
nas_procedure = _nas_user_procedure[user_data->id];
|
||||
|
||||
if (nas_procedure != NULL) {
|
||||
ret_code = (*nas_procedure)(user_data);
|
||||
ret_code = (*nas_procedure)(user, user_data);
|
||||
} else {
|
||||
/* AT command related to result format only */
|
||||
_nas_user_data.id = user_data->id;
|
||||
@@ -418,7 +418,7 @@ const void *nas_user_get_data(void)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_cgsn(const at_command_t *data)
|
||||
static int _nas_user_proc_cgsn(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -470,7 +470,7 @@ static int _nas_user_proc_cgsn(const at_command_t *data)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_cgmi(const at_command_t *data)
|
||||
static int _nas_user_proc_cgmi(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -522,7 +522,7 @@ static int _nas_user_proc_cgmi(const at_command_t *data)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_cgmm(const at_command_t *data)
|
||||
static int _nas_user_proc_cgmm(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -575,7 +575,7 @@ static int _nas_user_proc_cgmm(const at_command_t *data)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_cgmr(const at_command_t *data)
|
||||
static int _nas_user_proc_cgmr(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -631,7 +631,7 @@ static int _nas_user_proc_cgmr(const at_command_t *data)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_cimi(const at_command_t *data)
|
||||
static int _nas_user_proc_cimi(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -692,7 +692,7 @@ static int _nas_user_proc_cimi(const at_command_t *data)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_cfun(const at_command_t *data)
|
||||
static int _nas_user_proc_cfun(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -751,7 +751,7 @@ static int _nas_user_proc_cfun(const at_command_t *data)
|
||||
case AT_CFUN_FULL:
|
||||
/* Notify the NAS procedure call manager that the UE is
|
||||
* operational */
|
||||
ret_code = nas_proc_enable_s1_mode();
|
||||
ret_code = nas_proc_enable_s1_mode(user);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -805,7 +805,7 @@ static int _nas_user_proc_cfun(const at_command_t *data)
|
||||
** Others: _nas_user_context, _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_cpin(const at_command_t *data)
|
||||
static int _nas_user_proc_cpin(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -891,7 +891,7 @@ static int _nas_user_proc_cpin(const at_command_t *data)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_csq(const at_command_t *data)
|
||||
static int _nas_user_proc_csq(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -952,7 +952,7 @@ static int _nas_user_proc_csq(const at_command_t *data)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_cesq(const at_command_t *data)
|
||||
static int _nas_user_proc_cesq(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -979,7 +979,7 @@ static int _nas_user_proc_cesq(const at_command_t *data)
|
||||
cesq->ber = AT_CESQ_BER_UNKNOWN;
|
||||
cesq->rscp = AT_CESQ_RSCP_UNKNOWN;
|
||||
cesq->ecno = AT_CESQ_ECNO_UNKNOWN;
|
||||
ret_code = nas_proc_get_signal_quality(&cesq->rsrq, &cesq->rsrp);
|
||||
ret_code = nas_proc_get_signal_quality(user, &cesq->rsrq, &cesq->rsrp);
|
||||
break;
|
||||
|
||||
case AT_COMMAND_TST:
|
||||
@@ -1017,7 +1017,7 @@ static int _nas_user_proc_cesq(const at_command_t *data)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_cops(const at_command_t *data)
|
||||
static int _nas_user_proc_cops(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -1266,7 +1266,7 @@ static int _nas_user_proc_cops(const at_command_t *data)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_cgatt(const at_command_t *data)
|
||||
static int _nas_user_proc_cgatt(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -1371,7 +1371,7 @@ static int _nas_user_proc_cgatt(const at_command_t *data)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_creg(const at_command_t *data)
|
||||
static int _nas_user_proc_creg(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -1520,7 +1520,7 @@ static int _nas_user_proc_creg(const at_command_t *data)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_cgreg(const at_command_t *data)
|
||||
static int _nas_user_proc_cgreg(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -1669,7 +1669,7 @@ static int _nas_user_proc_cgreg(const at_command_t *data)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_cereg(const at_command_t *data)
|
||||
static int _nas_user_proc_cereg(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -1850,7 +1850,7 @@ static int _nas_user_proc_cereg(const at_command_t *data)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_cgdcont(const at_command_t *data)
|
||||
static int _nas_user_proc_cgdcont(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -2102,7 +2102,7 @@ static int _nas_user_proc_cgdcont(const at_command_t *data)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_cgact(const at_command_t *data)
|
||||
static int _nas_user_proc_cgact(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -2229,7 +2229,7 @@ static int _nas_user_proc_cgact(const at_command_t *data)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_cmee(const at_command_t *data)
|
||||
static int _nas_user_proc_cmee(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -2342,7 +2342,7 @@ static int _nas_user_proc_cmee(const at_command_t *data)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_clck(const at_command_t *data)
|
||||
static int _nas_user_proc_clck(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -2474,7 +2474,7 @@ static int _nas_user_proc_clck(const at_command_t *data)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_cgpaddr(const at_command_t *data)
|
||||
static int _nas_user_proc_cgpaddr(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -2566,7 +2566,7 @@ static int _nas_user_proc_cgpaddr(const at_command_t *data)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_cnum(const at_command_t *data)
|
||||
static int _nas_user_proc_cnum(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -2627,7 +2627,7 @@ static int _nas_user_proc_cnum(const at_command_t *data)
|
||||
** Others: _nas_user_data **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _nas_user_proc_clac(const at_command_t *data)
|
||||
static int _nas_user_proc_clac(nas_user_t *user, const at_command_t *data)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ Description NAS procedure functions triggered by the user
|
||||
#include "networkDef.h"
|
||||
#include "emm_main.h"
|
||||
#include "esm_ebr.h"
|
||||
#include "user_defs.h"
|
||||
|
||||
/****************************************************************************/
|
||||
/********************* G L O B A L C O N S T A N T S *******************/
|
||||
@@ -59,12 +60,12 @@ Description NAS procedure functions triggered by the user
|
||||
/****************** E X P O R T E D F U N C T I O N S ******************/
|
||||
/****************************************************************************/
|
||||
|
||||
void nas_user_initialize(emm_indication_callback_t emm_cb,
|
||||
void nas_user_initialize(nas_user_t *user, emm_indication_callback_t emm_cb,
|
||||
esm_indication_callback_t esm_cb, const char *version);
|
||||
|
||||
int nas_user_receive_and_process(int * fd, char *message);
|
||||
int nas_user_receive_and_process(nas_user_t *user, char *message);
|
||||
|
||||
int nas_user_process_data(const void *data);
|
||||
int nas_user_process_data(nas_user_t *user, const void *data);
|
||||
|
||||
const void *nas_user_get_data(void);
|
||||
|
||||
|
||||
@@ -45,7 +45,11 @@ Description NAS type definition to manage a user equipment
|
||||
#ifndef __USER_DEFS_H__
|
||||
#define __USER_DEFS_H__
|
||||
|
||||
#include "nas_proc_defs.h"
|
||||
|
||||
typedef struct {
|
||||
int fd;
|
||||
proc_data_t proc;
|
||||
} nas_user_t;
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user