Add xApp ready callback
Add example to demonstrate ready callback.
Signed-off-by: subhash kumar singh <subh.singh@samsung.com>
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 @@
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 @@
// set config change listener
xapp.AddConfigChangeListener(e.ConfigChangeHandler)
+ // register callback after xapp ready
+ xapp.SetReadyCB(e.xAppStartCB, true)
+
xapp.RunWithParams(e, false)
}