2 ==================================================================================
3 Copyright (c) 2018-2019 AT&T Intellectual Property.
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
9 http://www.apache.org/licenses/LICENSE-2.0
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 ==================================================================================
20 * Created on: Dec, 2019
21 * Author: Shraboni Jana
25 #include "subscription_request.hpp"
26 #include "xapp_sdl.hpp"
28 void signalHandler( int signum ) {
29 cout << "Interrupt signal (" << signum << ") received.\n";
33 int main(int argc, char *argv[]){
37 //change the priority depending upon application requirement
38 config.loadDefaultSettings();
39 config.loadEnvVarSettings();
40 config.loadCmdlineSettings(argc, argv);
42 //getting the listening port and xapp name info
43 std::string port = config[XappSettings::SettingName::HW_PORTS];
44 std::string name = config[XappSettings::SettingName::XAPP_NAME];
48 std::unique_ptr<XappRmr> rmr;
49 rmr = std::make_unique<XappRmr>(name,port);
52 //Register signal handler to stop
53 signal(SIGINT, signalHandler);
54 signal(SIGTERM, signalHandler);
57 XappSDL sdl = XappSDL("hw-xapp");
59 //Initiate the Xapp functionality
60 std::unique_ptr<Xapp> hw_xapp = std::make_unique<Xapp>(std::ref(config), std::ref(*rmr),std::ref(sdl));
63 //define the startup mode.
66 //Register Callback Handlers
67 //Register E2 Msg Handlers - Subscription/Indication.
68 //Register A1 Msg Handlers.
69 //Register Callback Handlers
72 //start the receiver thread listening at HW_PORT
73 //currently only one receiver thread. In total how many receiver threads depend on the xapp developer.
74 //Register all the handlers required and start the receiver
76 //register_msgproc(RIC_SUB_RESP, sub_handler);
77 //register_msgproc(RIC_SUB_DEL_RESP, sub_handler);
78 //register_msgproc(RIC_SUB_FAILURE, sub_handler);
81 hw_xapp->start_xapp_receiver();
85 //Delete all subscriptions if any based on Xapp Mode.