9 Commits

Author SHA1 Message Date
cf8cd37685 debug: add more print 2024-03-25 16:30:05 +01:00
f2e465c33e add missing";" 2024-03-25 15:44:12 +01:00
178ec65486 debug: add print 2024-03-25 15:39:17 +01:00
a09d784d52 debug 2024-03-22 16:28:29 +01:00
45fa45ee2c debug: still prototyping 2024-03-22 16:17:21 +01:00
887f0d180a add missing ";" 2024-03-22 15:56:23 +01:00
93d45e3c58 Add more verbosity 2024-03-22 15:11:06 +01:00
a34e83b524 debug: trying to figure out why sub req is not beeing spamed 2024-03-22 15:09:33 +01:00
290e030071 forece x-app to send sub. req. indefinitly 2024-03-22 12:53:46 +01:00
2 changed files with 28 additions and 4 deletions

View File

@@ -30,6 +30,7 @@ void signalHandler( int signum ) {
}
int main(int argc, char *argv[]){
std::cout << "hw_xapp_main Running";
// Get the thread id
std::thread::id my_id = std::this_thread::get_id();
@@ -71,7 +72,9 @@ int main(int argc, char *argv[]){
sleep(1);
//Startup E2 subscription and A1 policy
//hw_xapp->startup(std::ref(*sub_handler));
std::cout << "Startup E2 subscription and A1 policy";
hw_xapp->startup(std::ref(*sub_handler));
//start listener threads and register message handlers.
int num_threads = std::stoi(config[XappSettings::SettingName::THREADS]);

View File

@@ -87,6 +87,8 @@ void Xapp::stop(void){
void Xapp::startup(SubscriptionHandler &sub_ref) {
std::cout << "Startup beeing called";
subhandler_ref = &sub_ref;
if (GNB_ID == "") {
@@ -118,7 +120,15 @@ void Xapp::startup(SubscriptionHandler &sub_ref) {
std::cout << "Querying target gNB" << std::endl;
rnib_gnblist.push_back(GNB_ID);
}
while (
true
)
{
std::cout << "Send sub. req.";
std::cout << "yeet";
startup_subscribe_requests();
}
// open external control socket in thread and wait for message
ext_control_thr_rx = std::unique_ptr<std::thread>(new std::thread{&Xapp::handle_external_control_message, this, SOCKET_PORT_EXT});
@@ -135,7 +145,16 @@ void Xapp::startup(SubscriptionHandler &sub_ref) {
// send_socket("Hello, Server!", AGENT_1);
//send subscriptions.
while (
true
)
{
std::cout << "Send sub. req.";
std::cout << "yeet";
startup_subscribe_requests();
}
//read A1 policies
// startup_get_policies();
@@ -417,7 +436,7 @@ void Xapp::send_ric_control_request(char* payload, std::string gnb_id) {
}
void Xapp::startup_subscribe_requests(void ){
std::cout << "Startup subscribe request \n";
bool res;
size_t data_size = ASN_BUFF_MAX_SIZE;
unsigned char data[data_size];
@@ -432,11 +451,12 @@ void Xapp::startup_subscribe_requests(void ){
if(sz <= 0)
mdclog_write(MDCLOG_INFO,"Subscriptions cannot be sent as GNBList in RNIB is NULL");
std::cout << "pre for loop \n";
for(int i = 0; i<sz; i++){
std::cout << "Sending subscriptions to: " << gnblist[i] << std::endl;
// give the message to subscription handler, along with the transmitter.
strcpy((char*)meid,gnblist[i].c_str());
// char *strMsg = "Subscription Request from HelloWorld XApp\0";
@@ -483,6 +503,7 @@ void Xapp::startup_subscribe_requests(void ){
mdclog_write(MDCLOG_INFO,"Subscription SUCCESSFUL in file= %s, line=%d for MEID %s",__FILE__,__LINE__, meid);
}
}
std::cout << "Finisched subscribe request \n";
}
void Xapp::startup_get_policies(void){