Merge remote-tracking branch 'origin/deregistration' into integration_2023_w13
This commit is contained in:
@@ -614,7 +614,7 @@ int main ( int argc, char **argv )
|
||||
//getchar();
|
||||
if(IS_SOFTMODEM_DOSCOPE)
|
||||
load_softscope("enb",NULL);
|
||||
itti_wait_tasks_end();
|
||||
itti_wait_tasks_end(NULL);
|
||||
|
||||
#if USING_GPROF
|
||||
// Save the gprof data now (rather than via atexit) in case we crash while shutting down
|
||||
|
||||
@@ -699,7 +699,7 @@ int main( int argc, char **argv ) {
|
||||
printf("TYPE <CTRL-C> TO TERMINATE\n");
|
||||
//getchar();
|
||||
printf("Entering ITTI signals handler\n");
|
||||
itti_wait_tasks_end();
|
||||
itti_wait_tasks_end(NULL);
|
||||
printf("Returned from ITTI signal handler\n");
|
||||
oai_exit=1;
|
||||
printf("oai_exit=%d\n",oai_exit);
|
||||
|
||||
@@ -153,7 +153,7 @@ int main(int argc, char **argv)
|
||||
itti_send_msg_to_task(TASK_CUUP_E1, 0, msg);
|
||||
|
||||
printf("TYPE <CTRL-C> TO TERMINATE\n");
|
||||
itti_wait_tasks_end();
|
||||
itti_wait_tasks_end(NULL);
|
||||
|
||||
logClean();
|
||||
printf("Bye.\n");
|
||||
|
||||
@@ -733,7 +733,7 @@ int main( int argc, char **argv ) {
|
||||
// wait for end of program
|
||||
printf("Entering ITTI signals handler\n");
|
||||
printf("TYPE <CTRL-C> TO TERMINATE\n");
|
||||
itti_wait_tasks_end();
|
||||
itti_wait_tasks_end(NULL);
|
||||
printf("Returned from ITTI signal handler\n");
|
||||
oai_exit=1;
|
||||
printf("oai_exit=%d\n",oai_exit);
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
#define _GNU_SOURCE /* See feature_test_macros(7) */
|
||||
#include <sched.h>
|
||||
#include <stdbool.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "T.h"
|
||||
#include "assertions.h"
|
||||
@@ -402,6 +404,27 @@ void *rrc_enb_process_msg(void *notUsed) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool stop_immediately = false;
|
||||
static void trigger_stop(int sig)
|
||||
{
|
||||
if (!oai_exit)
|
||||
itti_wait_tasks_unblock();
|
||||
}
|
||||
static void trigger_deregistration(int sig)
|
||||
{
|
||||
if (!stop_immediately) {
|
||||
MessageDef *msg = itti_alloc_new_message(TASK_RRC_UE_SIM, 0, NAS_DEREGISTRATION_REQ);
|
||||
itti_send_msg_to_task(TASK_NAS_NRUE, 0, msg);
|
||||
stop_immediately = true;
|
||||
static const char m[] = "Press ^C again to trigger immediate shutdown\n";
|
||||
__attribute__((unused)) int unused = write(STDOUT_FILENO, m, sizeof(m) - 1);
|
||||
signal(SIGALRM, trigger_stop);
|
||||
alarm(5);
|
||||
} else {
|
||||
itti_wait_tasks_unblock();
|
||||
}
|
||||
}
|
||||
|
||||
static void get_channel_model_mode() {
|
||||
paramdef_t GNBParams[] = GNBPARAMS_DESC;
|
||||
config_get(GNBParams, sizeof(GNBParams)/sizeof(paramdef_t), NULL);
|
||||
@@ -431,7 +454,7 @@ int main( int argc, char **argv ) {
|
||||
if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == NULL) {
|
||||
exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
|
||||
}
|
||||
set_softmodem_sighandler();
|
||||
//set_softmodem_sighandler();
|
||||
CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
|
||||
memset(openair0_cfg,0,sizeof(openair0_config_t)*MAX_CARDS);
|
||||
memset(tx_max_power,0,sizeof(int)*MAX_NUM_CCs);
|
||||
@@ -555,15 +578,28 @@ int main( int argc, char **argv ) {
|
||||
|
||||
// Sleep a while before checking all parameters have been used
|
||||
// Some are used directly in external threads, asynchronously
|
||||
sleep(20);
|
||||
sleep(2);
|
||||
config_check_unknown_cmdlineopt(CONFIG_CHECKALLSECTIONS);
|
||||
|
||||
while(true)
|
||||
sleep(3600);
|
||||
// wait for end of program
|
||||
printf("Entering ITTI signals handler\n");
|
||||
printf("TYPE <CTRL-C> TO TERMINATE\n");
|
||||
itti_wait_tasks_end(trigger_deregistration);
|
||||
printf("Returned from ITTI signal handler\n");
|
||||
oai_exit=1;
|
||||
printf("oai_exit=%d\n",oai_exit);
|
||||
|
||||
if (ouput_vcd)
|
||||
vcd_signal_dumper_close();
|
||||
|
||||
if (PHY_vars_UE_g && PHY_vars_UE_g[0]) {
|
||||
for (int CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
PHY_VARS_NR_UE *phy_vars = PHY_vars_UE_g[0][CC_id];
|
||||
if (phy_vars && phy_vars->rfdevice.trx_end_func)
|
||||
phy_vars->rfdevice.trx_end_func(&phy_vars->rfdevice);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user