X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=control%2FrcControl.go;h=34fd310bed0058a3e30ed346c55fd8711e7cb411;hb=refs%2Fchanges%2F99%2F9899%2F1;hp=5bf59945d802c32eb5432cd12abe25ffb2b66d26;hpb=960885a60feb1ef3f9f654c7f4caf73f7a25dc4a;p=ric-app%2Frc.git diff --git a/control/rcControl.go b/control/rcControl.go index 5bf5994..34fd310 100644 --- a/control/rcControl.go +++ b/control/rcControl.go @@ -8,7 +8,7 @@ import ( "strconv" "sync" "time" - + //"encoding/hex" "gerrit.o-ran-sc.org/r/ric-app/rc/protocol/grpc/ricmsgcommrpc/rc" "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp" ) @@ -242,13 +242,14 @@ func (aRicHoControlMsg *RicHoControlMsg) SendRicControlRequest(aRequestSN int) ( lNrOrEUtraCellType := aRicHoControlMsg.RicControlGrpcReqPtr.RICControlMessageData.RICControlCellTypeVal lTargetCellVal := aRicHoControlMsg.RicControlGrpcReqPtr.RICControlMessageData.TargetCellID + //lTargetCellValBuf, _:= hex.DecodeString(lTargetCellVal) lTargetCellValBuf := []byte(lTargetCellVal) //lNRPlmnId := []byte(aRicHoControlMsg.RicControlGrpcReqPtr.RICControlMessageData.TargetCellID.PlmnID) //lNRCellId := aRicHoControlMsg.RicControlGrpcReqPtr.RICControlMessageData.TargetCellID.NRCellID var lRicControlMessage []byte = make([]byte, 1024) - lRicControlMessageEncoded, err := e2sm.SetRicControlMessage(lRicControlMessage, lTargetPrimaryCell, lTargetCell, lNrCGIOrECGI, int64(lNrOrEUtraCellType), lTargetCellValBuf) + lRicControlMessageEncoded, err := e2sm.SetRicControlMessage(lRicControlMessage, lTargetPrimaryCell, lTargetCell, lNrCGIOrECGI, int64(lNrOrEUtraCellType), ueId_data.pLMNIdentitybuf, lTargetCellValBuf) if err != nil { xapp.Logger.Error("SetRicControlMessage Failed: %v, UEID:%v", err, aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID) log.Printf("SetRicControlMessage Failed: %v, UEID:%v", err, aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID) @@ -357,8 +358,30 @@ func HandleControlResponse(params *xapp.RMRParams) (err error) { func HandleControlFailure(params *xapp.RMRParams) (err error) { + var e2ap *E2ap + xapp.Logger.Debug("The SubId in RIC_CONTROL_FAILURE is %d", params.SubId) log.Printf("The SubId in RIC_CONTROL_FAILURE is %d", params.SubId) + controlAck, err := e2ap.GetControlFailureMsg(params.Payload) + if err != nil { + xapp.Logger.Debug("Failed to decode RIC Control message: %v", err) + log.Println("Failed to decode RIC Control Ack: %v", err) + return + } + log.Println("E2ap RIC Control Ack message decoded \n") + xapp.Logger.Debug("E2ap RIC Control Ack message decoded \n") + + gControlData.eventRicControlReqExpiredMu.Lock() + _, ok := gControlData.eventRicControlReqExpiredMap[int(controlAck.InstanceId)] + if !ok { + gControlData.eventRicControlReqExpiredMu.Unlock() + xapp.Logger.Debug("RIC_CONTROL_REQ has been deleted!") + log.Printf("RIC_CONTROL_REQ has been deleted!") + return nil + } else { + gControlData.eventRicControlReqExpiredMap[int(controlAck.InstanceId)] = true + gControlData.eventRicControlReqExpiredMu.Unlock() + } return nil }