summaryrefslogtreecommitdiff
path: root/libvxi11client/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvxi11client/client.c')
-rw-r--r--libvxi11client/client.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libvxi11client/client.c b/libvxi11client/client.c
index b851347..f712f29 100644
--- a/libvxi11client/client.c
+++ b/libvxi11client/client.c
@@ -27,7 +27,7 @@ static char* geterrorstring(int errorcode) {
}
}
-static void interruptcallback(void) {
+static void interruptcallback(char* handle) {
printf("Interrupt fired\n");
}
@@ -40,6 +40,8 @@ int main(int argc, char *argv[]) {
exit(1);
}
+ vxi11_start_interrupt_server(interruptcallback);
+
Context ctx;
int err = 0;
@@ -144,7 +146,7 @@ int main(int argc, char *argv[]) {
printf("Created interrupt channel\n");
// enable interrupts
- if ((err = vxi11_enable_srq(&ctx, true, "handle", interruptcallback)) > 0)
+ if ((err = vxi11_enable_srq(&ctx, true, "handle")) > 0)
printf("Enabled interrupts\n");
else
printf("Error enabling interrupts; %s\n", geterrorstring(err));
@@ -152,7 +154,7 @@ int main(int argc, char *argv[]) {
sleep(10);
// disable interrupts
- if ((err = vxi11_enable_srq(&ctx, false, NULL, NULL)) > 0)
+ if ((err = vxi11_enable_srq(&ctx, false, NULL)) > 0)
printf("Disabled interrupts\n");
else
printf("Error disabling interrupts; %s\n", geterrorstring(err));
@@ -176,6 +178,8 @@ int main(int argc, char *argv[]) {
// close
if ((err = vxi11_close(&ctx) > 0))
printf("Closed\n");
+
+ vxi11_stop_interrupt_server();
}
else {
printf("Error opening device; %s\n", geterrorstring(err));