Handover
This xApp example performs a handover. At the moment this xApp only works in Amarisoft. The first part of the xApp is equal to the previous xApps, and thus, it is recommended to the reader to get familiar first with the previous examples.
import sys
import xapp_usr_sdk as xapp
xapp.init(sys.argv)
nodes = xapp.e2_nodes(xapp.HAND_OVER_USE_CASE_e)
assert(len(nodes) > 0 and len(nodes) < 3 and "Needed at least 1 or 2 E2 nodes to handover")
sum_ue = 0
for idx in range(len(nodes)):
sum_ue += len(nodes[idx].ue_ho)
assert(sum_ue > 0 and "At least one UE needed")
idx = 0 if len(nodes[0].ue_ho) > 0 else 1
n = nodes[idx].node
ue = nodes[idx].ue_ho[0].ue
ho_pci = nodes[idx].ue_ho[0].nghbr_cell[0].target_pci
ho_ssb = nodes[idx].ue_ho[0].nghbr_cell[0].target_ssb_nr_arfcn
xapp.hand_over(n, ue, ho_pci, ho_ssb)
During the second part i.e.,
n = nodes[idx].node
ue = nodes[idx].ue_ho[0].ue
ho_pci = nodes[idx].ue_ho[0].nghbr_cell[0].target_pci
ho_ssb = nodes[idx].ue_ho[0].nghbr_cell[0].target_ssb_nr_arfcn
xapp.hand_over(n, ue, ho_pci, ho_ssb)
the E2 Node and the UE to perform the handover is first selected. Then, the neighbour cell Physical Cell ID (PCI) and the Synchronization Signal Block's (SSB) Absolute Radio-Frequency Channel Number (ARFCN) are fetched and used to perform a handover.