diff options
author | daniel <danieruru@gmail.com> | 2013-01-17 06:39:36 +0900 |
---|---|---|
committer | daniel <danieruru@gmail.com> | 2013-01-17 06:39:36 +0900 |
commit | a8f9dbca19702adcc1420aad70855d057fd51122 (patch) | |
tree | fc14304f9f6ce93649e425dfc2af5a1d451f251a /libvxi11client/client.c | |
parent | 68247df5e2a1c6ee1b02834eac49e0b75875d03a (diff) |
Everything for multiple instruments on the C side
Diffstat (limited to 'libvxi11client/client.c')
-rw-r--r-- | libvxi11client/client.c | 10 |
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)); |