summaryrefslogtreecommitdiff
path: root/libvxi11client/client.c
diff options
context:
space:
mode:
authordaniel <danieruru@gmail.com>2013-01-11 13:38:40 +0900
committerdaniel <danieruru@gmail.com>2013-01-11 13:38:40 +0900
commit939ce4d4b67c068055be6e2ab27cc6144a53d546 (patch)
tree188cc349bb49a4fc6d89a8849969a48c2b5c508a /libvxi11client/client.c
parent557169f71b442ff10406ed764200f95084816fa8 (diff)
add the missing srq enable, disable checks in gpib for now
Diffstat (limited to 'libvxi11client/client.c')
-rw-r--r--libvxi11client/client.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libvxi11client/client.c b/libvxi11client/client.c
index 04753a8..804ef91 100644
--- a/libvxi11client/client.c
+++ b/libvxi11client/client.c
@@ -14,6 +14,8 @@ static char* geterrorstring(int errorcode) {
return "channel not established";
case -8:
return "operation not supported";
+ case -9:
+ return "out of resources";
case -11:
return "device locked by another link";
case -12:
@@ -133,7 +135,21 @@ int main(int argc, char *argv[]) {
// create interrupt channel
if ((err = vxi11_create_intr_chan()) > 0) {
printf("Created interrupt channel\n");
+
+ // enable interrupts
+ if ((err = vxi11_enable_srq(true, "handle")) > 0)
+ printf("Enabled interrupts\n");
+ else
+ printf("Error enabling interrupts; %s\n", geterrorstring(err));
+
sleep(10);
+
+ // disable interrupts
+ if ((err = vxi11_enable_srq(false, NULL)) > 0)
+ printf("Disabled interrupts\n");
+ else
+ printf("Error disabling interrupts; %s\n", geterrorstring(err));
+
// destroy interrupt channel
if ((err = vxi11_destroy_intr_chan()) > 0)
printf("Destroyed interrupt channel\n");