1 /******************************************************************************
2 ###############################################################################
3 # Copyright (c) [2017-2020] [ICT/CAS] #
4 # Licensed under the ORAN Software License v1.0 (License) #
5 ###############################################################################
6 ******************************************************************************/
13 #include "vos_common.h"
16 #include "plat_alarm.h"
18 #include "gnbCommon.h"
20 #include "omCuupApi.h"
21 extern UCHAR cuupUnSocketPath[];
22 INT32 cuupGetSetUpPara(INT32 argc, INT8 **argv)
26 struct option long_options[] =
28 {"startup-item", required_argument, 0, 'i' },
29 {"version", no_argument, 0, 'v' },
30 {"help", no_argument, 0, 'h' },
37 int c = getopt_long(argc, argv, "i:vh", long_options, &option_index);
46 pInt = (UCHAR *)cuupUnSocketPath;
59 sscanf(optarg, "%s", pInt);
60 VOS_Printf("unSocketPath: %s\n", cuupUnSocketPath);
67 void cuupAppSigHandler(int sig)
69 VOS_Printf("\r\nReceive signal:%d\r\n",sig);
73 if(shm_unlink(CUUP_SHM_FILE) < 0)
75 VOS_Printf("Du_shm Delete CUUP_SHM_FILE shared memory failed !\n ");
81 else if(SIGINT == sig)
84 else if(SIGABRT == sig)
86 if(shm_unlink(CUUP_SHM_FILE) < 0)
88 VOS_Printf("Du_shm Delete CUUP_SHM_FILE shared memory failed !\n ");
95 INT32 cuupAppregisterSignal()
99 if ( Product_Signal( SIGSEGV, 0,cuupAppSigHandler ) == VOS_ERROR )
101 /*commomctrl_om_init_fail_rsp(0);*/
105 if ( Product_Signal( SIGINT, 0,cuupAppSigHandler ) == VOS_ERROR )
112 if ( Product_Signal( SIGABRT,0,cuupAppSigHandler ) == VOS_ERROR )
114 /*commomctrl_om_init_fail_rsp(0);*/
124 return value: VOS_OK,VOS_ERROR
126 INT32 main(int argc,INT8 **argv)
130 CHECK_FUNCTION_RET(cuupGetSetUpPara(argc,argv));
132 /*init cucp global var*/
133 CHECK_FUNCTION_RET(cuupAppGlobalVarInit());
136 CHECK_FUNCTION_RET(cuupAppPlatformInit(argv));
139 CHECK_FUNCTION_RET(cuupAppregisterSignal());
140 /*VOS_TaskInfoAttach 必须在main函数里调用*/
142 /*omadp vos task create*/
143 CHECK_FUNCTION_RET(cuupAppOmadpModuleInit());