X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2FrmrCgo%2FrmrCgoApi.go;h=4a9f8c4fde07b15159384c285898e192259c68b7;hb=1724b6d2bf37ae07552f9aecc3e86a860efd6ac3;hp=1bac250034fd724b5f1e84a04aba976f84c76e71;hpb=01225af2476518e3b88904081e34a7d43f5568a7;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/rmrCgo/rmrCgoApi.go b/E2Manager/rmrCgo/rmrCgoApi.go index 1bac250..4a9f8c4 100644 --- a/E2Manager/rmrCgo/rmrCgoApi.go +++ b/E2Manager/rmrCgo/rmrCgoApi.go @@ -31,7 +31,7 @@ import ( "e2mgr/logger" ) -func (*Context) Init(port string, maxMsgSize int, flags int, logger *logger.Logger) *RmrMessenger {//TODO remove pointer from interface +func (*Context) Init(port string, maxMsgSize int, flags int, logger *logger.Logger) RmrMessenger { pp := C.CString(port) defer C.free(unsafe.Pointer(pp)) logger.Debugf("#rmrCgoApi.Init - Going to initiate RMR router") @@ -51,13 +51,13 @@ func (*Context) Init(port string, maxMsgSize int, flags int, logger *logger.Logg // Each round is about 1000 attempts with a short sleep between each round. C.rmr_set_stimeout(ctx.RmrCtx, C.int(1000)) r := RmrMessenger(ctx) - return &r + return r } -func (ctx *Context) SendMsg(msg *MBuf, maxMsgSize int) (*MBuf, error) { +func (ctx *Context) SendMsg(msg *MBuf) (*MBuf, error) { ctx.checkContextInitialized() ctx.Logger.Debugf("#rmrCgoApi.SendMsg - Going to send message. MBuf: %v", *msg) - allocatedCMBuf := ctx.getAllocatedCRmrMBuf(ctx.Logger, msg, maxMsgSize) + allocatedCMBuf := ctx.getAllocatedCRmrMBuf(ctx.Logger, msg, ctx.MaxMsgSize) defer C.rmr_free_msg(allocatedCMBuf) state := allocatedCMBuf.state if state != RMR_OK { @@ -105,14 +105,6 @@ func (ctx *Context) RecvMsg() (*MBuf, error) { return mbuf, nil } -func (ctx *Context) RtsMsg(msg *MBuf) { - ctx.checkContextInitialized() - ctx.Logger.Debugf("#rmrCgoApi.RtsMsg - Going to return message to the sender") - allocatedCMBuf := C.rmr_alloc_msg(ctx.RmrCtx, C.int(ctx.MaxMsgSize)) - defer C.rmr_free_msg(allocatedCMBuf) - C.rmr_rts_msg(ctx.RmrCtx, allocatedCMBuf) -} - func (ctx *Context) IsReady() bool { ctx.Logger.Debugf("#rmrCgoApi.IsReady - Going to check if routing table is initialized") return int(C.rmr_ready(ctx.RmrCtx)) != 0