This is the control object that is provided by the launcher service. This PPS object is supplied with the QNX SDK for Apps and Media. Your window manager interacts with this object to start and stop applications.
Commands sent to the /pps/services/launcher/control object should be in this form:
msg::command_string\ndat::{application_string}\nid::ID_number
Responses always reflect the command_string and ID_number that were sent in the message:
res::command_string\ndat::application_string\nid::ID_number
msg:: | dat:: | id:: |
---|---|---|
start | Application to launch (string from the app's directory name and key found under /apps). | Number (or any other identifier). |
stop | Application to terminate. | Number (or any other identifier). |
/* Declare file descriptor to publish and subscribe * to your PPS control object */ int pps_fd; /* Declare variables to use for your PPS messages */ int msgsize; char msgbuf[4096]; char *data = strdup("sys.browser.gYABgJYFHAzbeFMPCCpYWBtHAm0"); char *id = strdup("101"); /* Open PPS control object file for publishing and subscribing */ pps_fd = open ("/pps/services/launcher/control?wait,delta", O_RDWR);
Start an application:
char *cmd = strdup("start"); msgsize = snprintf(msgbuf, sizeof(msgbuf), "msg::%s\ndat::%s\nid::%s", cmd, data, id); write(pps_fd, msgbuf, (unsigned)msgsize);
Stop an application:
char *cmd = strdup("stop"); msgsize = snprintf(msgbuf, sizeof(msgbuf), "msg::%s\ndat::%s\nid::%s", cmd, data, id); write(pps_fd, msgbuf, (unsigned)msgsize);