2019-07-27 15:48:56 +02:00
|
|
|
#include "../src/ipc.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#define SERVICE_NAME "pong"
|
|
|
|
|
|
|
|
int main(int argc, char * argv[], char **env)
|
|
|
|
{
|
2020-01-01 12:11:34 +01:00
|
|
|
argc = (int) argc;
|
|
|
|
argv = (char **) argv;
|
|
|
|
|
|
|
|
SECURE_DECLARATION(struct ipc_error, ret);
|
2019-07-27 15:48:56 +02:00
|
|
|
SECURE_DECLARATION(struct ipc_connection_info,service);
|
|
|
|
SECURE_DECLARATION(struct ipc_event, event);
|
|
|
|
|
|
|
|
ret = ipc_connection (env, &service, SERVICE_NAME);
|
2020-01-01 12:11:34 +01:00
|
|
|
if (ret.error_code != IPC_ERROR_NONE) {
|
2019-07-27 15:48:56 +02:00
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
|
2020-01-01 12:11:34 +01:00
|
|
|
// long timer = 10;
|
|
|
|
// ret = ipc_wait_event (services, struct ipc_event *event, &timer);
|
|
|
|
// if (ret.error_code != IPC_ERROR_NONE) {
|
2019-07-27 15:48:56 +02:00
|
|
|
// return EXIT_FAILURE;
|
|
|
|
// }
|
|
|
|
|
|
|
|
ret = ipc_close (&service);
|
2020-01-01 12:11:34 +01:00
|
|
|
if (ret.error_code != IPC_ERROR_NONE) {
|
2019-07-27 15:48:56 +02:00
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|