Skip to main content

Hello World

Overview

The Hello World xApp is a basic xApp designed to verify the xApp's connectivity with NearRT-RIC. It prints out the status of connected E2-Nodes upon receiving an E42 Setup Response. It includes the following stages:

  • Init: initializes xApp based on configuration to set up the E42 connection with NearRT-RIC
  • xApp Logic: prints out the connected E2-Nodes stats
  • Exit: terminates xApp

xApp Code

Detail

source code: hw.go


Init - Step 2 to 5


xApp Logic - Step 6

Develop your xApp logic to display the status of connected E2-Nodes. For instance, if no E2-Node is connected, terminates the program. Conversely, if one or more E2-Nodes are connected, print out their information.

if conn.Size() <= 0 {
panic(fmt.Sprintf("panic"))
}

for i := int64(0); i < conn.Size(); i++ {
// Get object for the current E2-Node
e2Node := conn.Get(int(i))

// Print the current E2-Node' inforamtion
fmt.Printf("E2 node %d info: nb_id %d, mcc %d, mnc %d, mnc_digit_len %d, ran_type %s\n",
i,
e2Node.GetId().GetNb_id().GetNb_id(),
e2Node.GetId().GetPlmn().GetMcc(),
e2Node.GetId().GetPlmn().GetMnc(),
e2Node.GetId().GetPlmn().GetMnc_digit_len(),
xapp.Get_e2ap_ngran_name(e2Node.GetId().GetXtype()),
)

// Print the supported RAN functions' IDs from the current E2-Node
fmt.Printf("E2 node %d supported RAN functionss IDs: ", i)
for ; j < conn.Get(int(i)).GetRan_func().Size(); j++ {
fmt.Printf("%d ", int(conn.Get(int(i)).GetRan_func().Get(int(j)).GetId()))
}
fmt.Printf("\n")
}
  • Output
    • Case 1: no E2-Node connected
    panic: panic
    • Case 2: one E2-Nodes connected
    E2 node 0 info: nb_id 24621404, mcc 505, mnc 1, mnc_digit_len 2, ran_type ngran_gNB
    E2 node 0 supported RAN functions' IDs: 2, 3, 142, 143, 144, 145, 146, 148

Exit - Step 7