From: subhash kumar singh Date: Tue, 1 Jun 2021 13:01:07 +0000 (+0530) Subject: Add xApp ready callback X-Git-Tag: 1.0.1~10 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=02ac560d10a1374557a9b644d618c52e23d1a3fc;p=ric-app%2Fhw-go.git Add xApp ready callback Add example to demonstrate ready callback. Signed-off-by: subhash kumar singh Change-Id: I757dc98d281533bbbb4fe2543c0820067c5ec170 --- diff --git a/hwApp.go b/hwApp.go index a02abc9..1704dda 100755 --- a/hwApp.go +++ b/hwApp.go @@ -31,6 +31,11 @@ func (e *HWApp) ConfigChangeHandler(f string) { xapp.Logger.Info("Config file changed") } + +func (e *HWApp) xAppStartCB(d interface{}) { + xapp.Logger.Info("xApp ready call back received") +} + func (e *HWApp) Consume(rp *xapp.RMRParams) (err error) { return } @@ -43,6 +48,9 @@ func (e *HWApp) Run() { // set config change listener xapp.AddConfigChangeListener(e.ConfigChangeHandler) + // register callback after xapp ready + xapp.SetReadyCB(e.xAppStartCB, true) + xapp.RunWithParams(e, false) }