"afm-util run" only works once for a particular app
Description
Environment
Activity
Eric Dubé February 11, 2019 at 6:42 PM(edited)
Thank you so much! I should be able to figure it out from here, -but I have one last question - how do I build the videoplayer app? There's no CMakeLists.txt so I figured I could build with qmake, but the generic-worker Docker container doesn't have qmake installed- (Edit: I figured it out - I was forgetting an important step)

knimitz February 11, 2019 at 4:56 AM
Hi Eric,
the message is sent to window manager service process.
To call window manager service via libwindowmanager, it is necessary to enable permission in config.xml.
The interface to communicate with some service is "websocket" in AGL, so you can access to the service with any websocket library. As you said, libwindowmanager is just a glue library to wrap the websocket process.
The test sample is here.
Most simple sample is the code using QtAGLExtras if your application is Qt app. (I recommend)
https://gerrit.automotivelinux.org/gerrit/gitweb?p=apps%2Fvideoplayer.git;a=summary
Unfortunately, just using afb-client-demo and calling "activateWindow" to afb-daemon behind your application, it is difficult to show up, because HMI-FW designed requires any applications to obey the sequences. So.. please refer to the sample code.
Eric Dubé February 10, 2019 at 9:49 PM
I'm still having difficulty in figuring out how to interact with the window manager. libwindowmanager seems like it's just an adaptor that translates method invocations into JSON queries - is that accurate? Where are these JSON messages being sent?
Is there any documentation or a diagram that describes these components?

jose bollo February 9, 2019 at 9:05 AM
afb-client-demo is a tool of the binder [1]. It uses the C library "libafbwsc" also provide by the buinder.
[1] https://git.automotivelinux.org/src/app-framework-binder/tree/src/main-afb-client-demo.c
Eric Dubé February 8, 2019 at 10:44 PM
Is afb-client-demo an executable or another script? I can't find it in the app-framework-main repo so I'm guessing that's somewhere else
After looking at libwindowmanager I've figured out it's sending a JSON message over websockets whenever it's requested to activate a window (does that sound accurate?) but I don't know where to. If I wanted to switch applications for testing purposes should I be including libwindowmanager and calling those functions from my tool?
Details
Details
Assignee

This might be a lack of understanding of what afm-util is supposed to do, but I'm trying to implement a test case where applications are switched in different orders, and "afm-util run" will only start an application the first time.
For instance, if I run `afm-util run hvac@0.1`, and then `afm-util run radio@0.1`, both of these operations work, but running `afm-util run hvac@0.1` a second time has no effect.
After observing this I thought perhaps `afm-util continue <id returned by run>` might be the correct way to do this, but it reports "Operation not supported"