From e98b54453930e304b1d12df61e74b87d60cb4f5c Mon Sep 17 00:00:00 2001 From: Karchnu Date: Sat, 4 Jul 2020 11:45:09 +0200 Subject: [PATCH] pongd OK --- examples/pongd.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/examples/pongd.c b/examples/pongd.c index be6d170..fb108fe 100644 --- a/examples/pongd.c +++ b/examples/pongd.c @@ -80,9 +80,6 @@ void main_loop () if (ret.error_code != IPC_ERROR_NONE) { PRINTERR (ret, "server write"); } - if (verbosity > 1) { - printf ("message sent\n"); - } }; break; case IPC_EVENT_TYPE_TIMER:{ @@ -98,6 +95,13 @@ void main_loop () fprintf (stderr, ", %d ctx remaining\n", cpt); }; break; + case IPC_EVENT_TYPE_TX: + { + if (verbosity > 1) { + printf ("a message was sent\n"); + } + } + break; default: { fprintf (stderr, "there must be a problem, event not set\n"); @@ -132,15 +136,15 @@ void exit_program (int signal) int main (int argc, char *argv[]) { - argc = argc; // warnings - argv = argv; // warnings - if (argc > 1) { verbosity = atoi(argv[1]); } printf ("pid = %d\n", getpid ()); + ctx = malloc (sizeof (struct ipc_ctx)); + memset (ctx, 0, sizeof (struct ipc_ctx)); + struct ipc_error ret = ipc_server_init (ctx, PONGD_SERVICE_NAME); if (ret.error_code != IPC_ERROR_NONE) { PRINTERR (ret, "server init");