e2ap: adding logger to e2ap class

master
yagoda 2 years ago committed by Justin Tallon
parent d4fbdfd54b
commit a8631828d4

@ -22,6 +22,7 @@ using namespace asn1::e2ap;
class e2ap
{
public:
e2ap(srslog::basic_logger& logger);
e2_ap_pdu_c generate_setup_request();
int process_setup_response(e2setup_resp_s setup_response);
int process_setup_failure();
@ -32,8 +33,9 @@ public:
bool has_setup_response() { return setup_response_received; }
private:
bool setup_response_received = false;
bool pending_subscription_request = false;
srslog::basic_logger& logger;
bool setup_response_received = false;
bool pending_subscription_request = false;
};
#endif /* RIC_E2AP_H */

@ -2,6 +2,8 @@
#include "srsgnb/hdr/stack/ric/e2ap.h"
#include "stdint.h"
e2ap::e2ap(srslog::basic_logger& logger) : logger(logger) {}
e2_ap_pdu_c e2ap::generate_setup_request()
{
e2_ap_pdu_c pdu;

@ -16,7 +16,7 @@
using namespace srsenb;
ric_client::ric_client(srslog::basic_logger& logger) :
task_sched(), logger(logger), rx_sockets(), thread("RIC_CLIENT_THREAD")
task_sched(), logger(logger), rx_sockets(), thread("RIC_CLIENT_THREAD"), e2ap_(logger)
{
}
bool ric_client::init()
@ -191,7 +191,7 @@ bool ric_client::handle_e2_successful_outcome(asn1::e2ap::successful_outcome_s&
{
using namespace asn1::e2ap;
if (successful_outcome.value.type() == e2_ap_elem_procs_o::successful_outcome_c::types_opts::e2setup_resp) {
logger.info("Received E2AP E2 Setup Successful Outcome");
logger.info("Received E2AP E2 Setup Response");
handle_e2_setup_response(successful_outcome.value.e2setup_resp());
} else if (successful_outcome.value.type() ==
e2_ap_elem_procs_o::successful_outcome_c::types_opts::ricsubscription_resp) {
@ -219,7 +219,6 @@ bool ric_client::handle_e2_successful_outcome(asn1::e2ap::successful_outcome_s&
bool ric_client::handle_e2_setup_response(e2setup_resp_s setup_response)
{
printf("Received E2AP E2 Setup Response \n");
if (e2ap_.process_setup_response(setup_response)) {
logger.error("Failed to process E2 Setup Response");
return false;

@ -82,7 +82,8 @@ void test_native_e2ap_setup_request()
{
srsran::unique_byte_buffer_t buf = srsran::make_byte_buffer();
e2_ap_pdu_c pdu, pdu2;
e2ap e2ap_;
srslog::basic_logger& logger = srslog::fetch_basic_logger("E2AP");
e2ap e2ap_(logger);
pdu = e2ap_.generate_setup_request();
asn1::bit_ref bref(buf->msg, buf->get_tailroom());
@ -116,7 +117,8 @@ void test_native_e2ap_subscription_response()
{
srsran::unique_byte_buffer_t buf = srsran::make_byte_buffer();
e2_ap_pdu_c pdu, pdu2;
e2ap e2ap_;
srslog::basic_logger& logger = srslog::fetch_basic_logger("E2AP");
e2ap e2ap_(logger);
pdu = e2ap_.generate_subscription_response();
asn1::bit_ref bref(buf->msg, buf->get_tailroom());

Loading…
Cancel
Save