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

Note: By default, xApp will read the configuration file from /usr/local/etc/flexric/ric.conf. Otherwise, you can create your own configuration file by following the general structure

Sequence Diagram

Detail

source code: link


Init - Step 2 to 6


xApp Logic - Step 7

Develop your xApp logic to print the information of connected E2-Nodes. For instance, if no E2-Node is connected, the program will stop and exit. Conversely, if one or more E2-Nodes are connected, it will print out the information based on different types.

  • Example
    assert(nodes.len > 0);

    printf("Connected E2 nodes = %d\n", nodes.len);
    for (size_t i = 0; i < nodes.len; i++) {
    e2ap_ngran_node_t ran_type = nodes.n[i].id.type;
    if (E2AP_NODE_IS_MONOLITHIC(ran_type))
    printf("E2 node %ld info: nb_id %d, mcc %d, mnc %d, mnc_digit_len %d, ran_type %s\n",
    i,
    nodes.n[i].id.nb_id.nb_id,
    nodes.n[i].id.plmn.mcc,
    nodes.n[i].id.plmn.mnc,
    nodes.n[i].id.plmn.mnc_digit_len,
    get_e2ap_ngran_name(ran_type));
    else
    printf("E2 node %ld info: nb_id %d, mcc %d, mnc %d, mnc_digit_len %d, ran_type %s, cu_du_id %lu\n",
    i,
    nodes.n[i].id.nb_id.nb_id,
    nodes.n[i].id.plmn.mcc,
    nodes.n[i].id.plmn.mnc,
    nodes.n[i].id.plmn.mnc_digit_len,
    get_e2ap_ngran_name(ran_type),
    *nodes.n[i].id.cu_du_id);

    printf("E2 node %ld supported RAN function's IDs:", i);
    for (size_t j = 0; j < nodes.n[i].len_rf; j++)
    printf(", %d", nodes.n[i].ack_rf[j].id);
    printf("\n");
    }
  • Output
    ...
    [xApp]: Registered E2 Nodes = 1
    Connected E2 nodes = 1
    E2 node 0 info: nb_id 1, mcc 505, mnc 1, mnc_digit_len 2, ran_type ngran_gNB
    E2 node 0 supported RAN function's IDs:, 2, 3, 142, 143, 144, 145, 146, 148
    Hello World
    [xApp]: Sucessfully stopped
    Test xApp run SUCCESSFULLY

Exit - Step 8