5 #include <e2ap/wrapper.h>
6 #cgo LDFLAGS: -le2apwrapper
7 #cgo CFLAGS: -I/usr/local/include/e2ap
13 "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
20 func (c *E2ap) SetRicControlRequestPayload(payload []byte, ricRequestorID uint16, ricRequestSequenceNumber uint16, ranFunctionID uint16,
21 ricControlHdr []byte, ricControlMsg []byte) (newPayload []byte, err error) {
23 cptr := unsafe.Pointer(&payload[0])
24 cptr_ricControlHdr := unsafe.Pointer(&ricControlHdr[0])
25 cptr_ricControlMsg := unsafe.Pointer(&ricControlMsg[0])
27 xapp.Logger.Debug("\n")
28 xapp.Logger.Debug("ricControlHdr\n", ricControlHdr)
29 xapp.Logger.Debug("\n")
30 xapp.Logger.Debug("ricControlMsg\n", ricControlMsg)
31 xapp.Logger.Debug("\n")
33 size := C.e2ap_encode_ric_control_request_message(cptr, C.size_t(len(payload)), C.long(ricRequestorID), C.long(ricRequestSequenceNumber),
34 C.long(ranFunctionID), cptr_ricControlHdr, C.size_t(len(ricControlHdr)), cptr_ricControlMsg, C.size_t(len(ricControlMsg)))
36 return make([]byte, 0), errors.New("e2ap wrapper is unable to set Subscription Request Payload due to wrong or invalid payload")
38 newPayload = C.GoBytes(cptr, (C.int(size)+7)/8)
39 xapp.Logger.Info("SetRicControlHeader is success")