X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=Cu%2FCuUpApp%2FSrc%2Fmain.c;fp=Cu%2FCuUpApp%2FSrc%2Fmain.c;h=b9b56e9be04eb73abeae8cfec2f6ef0b20290d1e;hb=e93798699eccb72af04938fc9b0d7a836e284488;hp=eb063a165cf039467744d4912d386e74bc66d34f;hpb=94f13ab3e8da393eb27ccc561d31b447b1367c56;p=scp%2Focu%2F5gnr.git diff --git a/Cu/CuUpApp/Src/main.c b/Cu/CuUpApp/Src/main.c index eb063a1..b9b56e9 100644 --- a/Cu/CuUpApp/Src/main.c +++ b/Cu/CuUpApp/Src/main.c @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# Copyright (c) [2017-2020] [ICT/CAS] # -# Licensed under the ORAN Software License v1.0 (License) # -############################################################################### -******************************************************************************/ +* +* Copyright (c) 2020 ICT/CAS. +* +* Licensed under the O-RAN Software License, Version 1.0 (the "Software License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* https://www.o-ran.org/software +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +*******************************************************************************/ + #include #include #include @@ -22,7 +34,7 @@ extern UCHAR cuupUnSocketPath[]; INT32 cuupGetSetUpPara(INT32 argc, INT8 **argv) { UCHAR *pInt = NULL; - + struct option long_options[] = { {"startup-item", required_argument, 0, 'i' }, @@ -30,7 +42,7 @@ INT32 cuupGetSetUpPara(INT32 argc, INT8 **argv) {"help", no_argument, 0, 'h' }, {0, 0, 0, 0 } }; - + while (1) { int option_index = 0; @@ -39,13 +51,13 @@ INT32 cuupGetSetUpPara(INT32 argc, INT8 **argv) { break; } - + switch (c) { case 'i': pInt = (UCHAR *)cuupUnSocketPath; break; - case 'v': + case 'v': exit(0); break; case 'h': @@ -53,21 +65,21 @@ INT32 cuupGetSetUpPara(INT32 argc, INT8 **argv) default: return VOS_OK; } - + if (pInt && optarg) { sscanf(optarg, "%s", pInt); VOS_Printf("unSocketPath: %s\n", cuupUnSocketPath); } } - + return VOS_OK; } void cuupAppSigHandler(int sig) -{ +{ VOS_Printf("\r\nReceive signal:%d\r\n",sig); - + if(SIGSEGV == sig) { if(shm_unlink(CUUP_SHM_FILE) < 0) @@ -87,7 +99,7 @@ void cuupAppSigHandler(int sig) { VOS_Printf("Du_shm Delete CUUP_SHM_FILE shared memory failed !\n "); return; - } + } } return; } @@ -126,32 +138,26 @@ INT32 cuupAppregisterSignal() INT32 main(int argc,INT8 **argv) { /*check para*/ - + CHECK_FUNCTION_RET(cuupGetSetUpPara(argc,argv)); /*init cucp global var*/ CHECK_FUNCTION_RET(cuupAppGlobalVarInit()); - + /*platform init*/ CHECK_FUNCTION_RET(cuupAppPlatformInit(argv)); - + /*register signal*/ CHECK_FUNCTION_RET(cuupAppregisterSignal()); /*VOS_TaskInfoAttach 必须在main函数里调用*/ - + /*omadp vos task create*/ CHECK_FUNCTION_RET(cuupAppOmadpModuleInit()); - + while(1) { sleep(5000); - } + } return 0; } - - - - - -