From 02ac560d10a1374557a9b644d618c52e23d1a3fc Mon Sep 17 00:00:00 2001 From: subhash kumar singh Date: Tue, 1 Jun 2021 18:31:07 +0530 Subject: [PATCH] Add xApp ready callback Add example to demonstrate ready callback. Signed-off-by: subhash kumar singh Change-Id: I757dc98d281533bbbb4fe2543c0820067c5ec170 --- hwApp.go | 8 ++++++++ 1 file changed, 8 insertions(+) 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) } -- 2.16.6