#include <glib.h>
#include <glib-object.h>
#include <axsdk/axevent.h>
static void
subscription_callback(guint subscription,
static guint
gint port, guint *token);
static void
subscription_callback(guint subscription,
{
gint port;
gboolean state;
(void)subscription;
"port", NULL, &port, NULL);
"state", NULL, &state, NULL);
if (state) {
g_message("Manual trigger port %d is high", port);
} else {
g_message("Manual trigger port %d is low", port);
}
g_message("And here's the token: %d", *token);
}
static guint
gint port, guint *token)
{
guint subscription;
NULL,
NULL);
NULL);
return subscription;
}
int main(void)
{
GMainLoop *main_loop;
guint subscription;
gint port = 1;
guint token = 1234;
main_loop = g_main_loop_new(NULL, FALSE);
subscription = subscribe_to_manual_trigger_port(event_handler,
port, &token);
g_main_loop_run(main_loop);
return 0;
}