4 #include <e2sm/wrapper.h>
5 #cgo LDFLAGS: -le2smwrapper -lm
6 #cgo CFLAGS: -I/usr/local/include/e2sm
12 "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
19 func (c *E2sm) SetRicControlHeader(buffer []byte, ueIDbuf []byte, ricControlStyleType int64, ricControlActionID int64) (newBuffer []byte, err error) {
20 cptr := unsafe.Pointer(&buffer[0])
21 cptr_ueIDbuf := unsafe.Pointer(&ueIDbuf[0])
22 size := C.e2sm_encode_ric_control_header(cptr, C.size_t(len(buffer)), cptr_ueIDbuf, C.size_t(len(ueIDbuf)),
23 C.long(ricControlStyleType), C.long(ricControlActionID))
26 return make([]byte, 0), errors.New("e2sm wrapper is unable to set EventTriggerDefinition due to wrong or invalid input")
28 newBuffer = C.GoBytes(cptr, (C.int(size)+7)/8)
29 xapp.Logger.Info("E2sm SetRicControlHeader is success")
33 func (c *E2sm) SetRicControlMessage(buffer []byte, targetPrimaryCell int64, targetCell int64, nrCGIOrECGI int64, nrOrEUtraCell int64, ranParameterValue []byte) (newBuffer []byte, err error) {
34 cptr := unsafe.Pointer(&buffer[0])
35 cptrRanParameterValue := unsafe.Pointer(&ranParameterValue[0])
37 size := C.e2sm_encode_ric_control_message(cptr, C.size_t(len(buffer)), C.long(targetPrimaryCell),
38 C.long(targetCell), C.long(nrOrEUtraCell), C.long(nrCGIOrECGI), cptrRanParameterValue, C.size_t(len(ranParameterValue)))
40 return make([]byte, 0), errors.New("e2sm wrapper is unable to set RicControlMessage due to wrong or invalid input")
42 newBuffer = C.GoBytes(cptr, (C.int(size)+7)/8) //TOCHECK: if C.int(size) is returning bits not bytes to get correct size of the buffer.
43 xapp.Logger.Info("E2sm SetRicControlMessage is success")