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

Sequence Diagram

Detail

source code: hw.py


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, display an empty table along with a message stating "No E2-Node connected." Conversely, if one or more E2-Nodes are connected, save their information and present it in a table.

  • Example
    if not (len(conn) > 0):
    print("No E2-Node connected.")

    e2nodes_col_names = ["idx", "nb_id", "mcc", "mnc", "ran_type"]
    e2nodes_data = []
    for i in range(0, len(conn)):
    # NodeB ID
    nb_id = conn[i].id.nb_id.nb_id
    # PLMN
    mcc = conn[i].id.plmn.mcc
    mnc = conn[i].id.plmn.mnc
    # RAN type
    if conn[i].id.type == 0:
    ran_type = "ngran_eNB"
    elif conn[i].id.type == 2:
    ran_type = "ngran_gNB"
    elif conn[i].id.type == 5:
    ran_type = "ngran_gNB_CU"
    elif conn[i].id.type == 7:
    ran_type = "ngran_gNB_DU"
    else:
    ran_type = "Unknown"
    info = [i,
    nb_id,
    mcc,
    mnc,
    ran_type]
    # print(info)
    e2nodes_data.append(info)
    print(tabulate(e2nodes_data, headers=e2nodes_col_names, tablefmt="grid"))

  • Output
    • Case 1: no E2-Node connected
      No E2-Node connected.
      +-------+---------+-------+-------+------------+
      | idx | nb_id | mcc | mnc | ran_type |
      +=======+=========+=======+=======+============+
      +-------+---------+-------+-------+------------+
    • Case 2: one E2-Nodes connected
      +-------+---------+-------+-------+------------+
      | idx | nb_id | mcc | mnc | ran_type |
      +=======+=========+=======+=======+============+
      | 0 | 1 | 505 | 1 | ngran_gNB |
      +-------+---------+-------+-------+------------+

Exit - Step 7