Add xApp ready callback 85/6185/1
authorsubhash kumar singh <subh.singh@samsung.com>
Tue, 1 Jun 2021 13:01:07 +0000 (18:31 +0530)
committersubhash kumar singh <subh.singh@samsung.com>
Tue, 1 Jun 2021 13:01:07 +0000 (18:31 +0530)
Add example to demonstrate ready callback.

Signed-off-by: subhash kumar singh <subh.singh@samsung.com>
Change-Id: I757dc98d281533bbbb4fe2543c0820067c5ec170

hwApp.go

index a02abc9..1704dda 100755 (executable)
--- 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)
 
 }