X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2Fconverters%2Fx2_setup_response_converter.go;h=e98523fefc535e78c27fbd4e999cbbb8974114e2;hb=9093b29ad0cbe89e3e0c71b3d72d7961420f907c;hp=2ce50b460b6b79c9d419c530de0b812b041a4ea0;hpb=565a58f44b5a99f4088b5f0c7ef3f7b0498f2ced;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/converters/x2_setup_response_converter.go b/E2Manager/converters/x2_setup_response_converter.go index 2ce50b4..e98523f 100644 --- a/E2Manager/converters/x2_setup_response_converter.go +++ b/E2Manager/converters/x2_setup_response_converter.go @@ -44,6 +44,8 @@ const ( maxnoofNeighbours = 512 ) +const Format = "%02x:%02x" + type X2SetupResponseConverter struct { logger *logger.Logger } @@ -293,7 +295,7 @@ func getServedCellsNeighbour_Info(neighbour_Information *C.Neighbour_Information //pLMN_Identity:eUTRANcellIdentifier plmnId := C.GoBytes(unsafe.Pointer(member.eCGI.pLMN_Identity.buf), C.int(member.eCGI.pLMN_Identity.size)) eUTRANcellIdentifier := C.GoBytes(unsafe.Pointer(member.eCGI.eUTRANcellIdentifier.buf), C.int(member.eCGI.eUTRANcellIdentifier.size)) - neighbourInfo := &entities.NeighbourInformation{Ecgi: fmt.Sprintf("%02x:%02x", plmnId, eUTRANcellIdentifier)} + neighbourInfo := &entities.NeighbourInformation{Ecgi: fmt.Sprintf(Format, plmnId, eUTRANcellIdentifier)} neighbourInfo.Pci = uint32(member.pCI) @@ -334,7 +336,7 @@ func getServedCells(servedCellsIE *C.ServedCells_t) ([]*entities.ServedCellInfo, //pLMN_Identity:eUTRANcellIdentifier plmnId := C.GoBytes(unsafe.Pointer(member.servedCellInfo.cellId.pLMN_Identity.buf), C.int(member.servedCellInfo.cellId.pLMN_Identity.size)) eUTRANcellIdentifier := C.GoBytes(unsafe.Pointer(member.servedCellInfo.cellId.eUTRANcellIdentifier.buf), C.int(member.servedCellInfo.cellId.eUTRANcellIdentifier.size)) - servedCellInfo.CellId = fmt.Sprintf("%02x:%02x", plmnId, eUTRANcellIdentifier) + servedCellInfo.CellId = fmt.Sprintf(Format, plmnId, eUTRANcellIdentifier) servedCellInfo.Tac = fmt.Sprintf("%02x", C.GoBytes(unsafe.Pointer(member.servedCellInfo.tAC.buf), C.int(member.servedCellInfo.tAC.size))) @@ -388,7 +390,7 @@ func getGUGroupIDList(guGroupIDList *C.GUGroupIDList_t) []string { for _, guGroupID := range guGroupIDList_slice { plmnId := C.GoBytes(unsafe.Pointer(guGroupID.pLMN_Identity.buf), C.int(guGroupID.pLMN_Identity.size)) mME_Group_ID := C.GoBytes(unsafe.Pointer(guGroupID.mME_Group_ID.buf), C.int(guGroupID.mME_Group_ID.size)) - ids = append(ids, fmt.Sprintf("%02x:%02x", plmnId, mME_Group_ID)) + ids = append(ids, fmt.Sprintf(Format, plmnId, mME_Group_ID)) } }