From 1c16c31f76ebc58d1385201129fb40bd034e48bc Mon Sep 17 00:00:00 2001 From: sjana Date: Mon, 8 Jun 2020 01:17:43 -0400 Subject: [PATCH] A1 Message Handler update Issue-ID: RICAPP-115 Signed-off-by: sjana Change-Id: I07a72a2598f790d1be20dbfd839fb795762f2feb --- container-tag.yaml | 2 +- docs/release-notes.rst | 2 +- init/config-file.json | 2 +- src/hw_xapp_main.cc | 17 ++++------------- src/xapp-mgmt/msgs_proc.cc | 3 +++ src/xapp-utils/xapp_config.hpp | 2 +- 6 files changed, 11 insertions(+), 17 deletions(-) diff --git a/container-tag.yaml b/container-tag.yaml index 4466856..951186d 100644 --- a/container-tag.yaml +++ b/container-tag.yaml @@ -1,4 +1,4 @@ # this is used by CI jobs to apply a tag when it builds the image --- -tag: '1.0.3' +tag: '1.0.4' diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 1b42721..4288c25 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -21,7 +21,7 @@ Version history | **Date** | **Ver.** | **Author** | **Comment** | | | | | | +--------------------+--------------------+--------------------+--------------------+ -| 2020-21-05 | 1.0.3 | Shraboni Jana | Third draft | +| 2020-06-06 | 1.0.4 | Shraboni Jana | Fourth draft | | | | | | +--------------------+--------------------+--------------------+--------------------+ diff --git a/init/config-file.json b/init/config-file.json index 5300d90..78f9a64 100644 --- a/init/config-file.json +++ b/init/config-file.json @@ -7,7 +7,7 @@ "image": { "registry": "nexus3.o-ran-sc.org:10002", "name": "o-ran-sc/ric-app-hw", - "tag": "1.0.3" + "tag": "1.0.4" } } ], diff --git a/src/hw_xapp_main.cc b/src/hw_xapp_main.cc index 01601fb..1771797 100644 --- a/src/hw_xapp_main.cc +++ b/src/hw_xapp_main.cc @@ -75,22 +75,13 @@ int main(int argc, char *argv[]){ //start listener threads and register message handlers. int num_threads = std::stoi(config[XappSettings::SettingName::THREADS]); - bool sub_required = true; - for(int j=0; j < num_threads; j++) { - std::unique_ptr mp_handler; - if(sub_required) - mp_handler = std::make_unique(config[XappSettings::SettingName::XAPP_ID], std::ref(*sub_handler)); - else - mp_handler = std::make_unique(config[XappSettings::SettingName::XAPP_ID]); - - hw_xapp->register_handler(std::ref(*mp_handler)); - } - mdclog_write(MDCLOG_INFO, "Starting Listener Threads. Number of Workers = %d", num_threads); - hw_xapp->Run(); + std::unique_ptr mp_handler = std::make_unique(config[XappSettings::SettingName::XAPP_ID]); + hw_xapp->start_xapp_receiver(std::ref(*mp_handler)); + + sleep(1); - //Delete all subscriptions if any based on Xapp Mode. //xapp->shutdown(); while(1){ diff --git a/src/xapp-mgmt/msgs_proc.cc b/src/xapp-mgmt/msgs_proc.cc index 19d21a8..99eb453 100644 --- a/src/xapp-mgmt/msgs_proc.cc +++ b/src/xapp-mgmt/msgs_proc.cc @@ -175,7 +175,10 @@ void XappMsgHandler::operator()(rmr_mbuf_t *message, bool *resend){ break; case A1_POLICY_REQ: + + mdclog_write(MDCLOG_INFO, "In Message Handler: Received A1_POLICY_REQ."); helper.handler_id = xapp_id; + res = a1_policy_handler((char*)message->payload, &message->len, helper); if(res){ message->mtype = A1_POLICY_RESP; // if we're here we are running and all is ok diff --git a/src/xapp-utils/xapp_config.hpp b/src/xapp-utils/xapp_config.hpp index 67cf440..f15c879 100644 --- a/src/xapp-utils/xapp_config.hpp +++ b/src/xapp-utils/xapp_config.hpp @@ -31,7 +31,7 @@ #include #include -#define DEFAULT_XAPP_NAME "HW-Xapp" +#define DEFAULT_XAPP_NAME "hwxapp" #define DEFAULT_PORT "4560" #define DEFAULT_MSG_MAX_BUFFER "2072" #define DEFAULT_THREADS "1" -- 2.16.6