diff options
author | daniel <danieruru@gmail.com> | 2013-01-11 13:58:36 +0900 |
---|---|---|
committer | daniel <danieruru@gmail.com> | 2013-01-11 13:58:36 +0900 |
commit | 2287a7ca37de5dadf9eda790e3afa96262cb9e76 (patch) | |
tree | 3b39e28804e9193adad45d30fbe6be7e60fe2124 /libvxi11client/client.c | |
parent | cacd8ba78d2c17286507d0bae498c136dba19c9c (diff) |
add callback for interrupt
Diffstat (limited to 'libvxi11client/client.c')
-rw-r--r-- | libvxi11client/client.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libvxi11client/client.c b/libvxi11client/client.c index 804ef91..77554f2 100644 --- a/libvxi11client/client.c +++ b/libvxi11client/client.c @@ -27,6 +27,10 @@ static char* geterrorstring(int errorcode) { } } +static void interruptcallback(void) { + printf("Interrupt fired\n"); +} + int main(int argc, char *argv[]) { printf("VXI-11 test client\n"); @@ -137,7 +141,7 @@ int main(int argc, char *argv[]) { printf("Created interrupt channel\n"); // enable interrupts - if ((err = vxi11_enable_srq(true, "handle")) > 0) + if ((err = vxi11_enable_srq(true, "handle", interruptcallback)) > 0) printf("Enabled interrupts\n"); else printf("Error enabling interrupts; %s\n", geterrorstring(err)); @@ -145,7 +149,7 @@ int main(int argc, char *argv[]) { sleep(10); // disable interrupts - if ((err = vxi11_enable_srq(false, NULL)) > 0) + if ((err = vxi11_enable_srq(false, NULL, NULL)) > 0) printf("Disabled interrupts\n"); else printf("Error disabling interrupts; %s\n", geterrorstring(err)); |