From e5656b476c9168cfe7852bce4e2ce59876a45d12 Mon Sep 17 00:00:00 2001 From: daniel Date: Sat, 5 Jan 2013 16:49:20 +0900 Subject: complete the stubs in the client.. --- build/.gitignore | 4 ---- libvxi11client/client.c | 4 ++++ libvxi11client/libvxi11client.c | 48 ++++++++++++++++++++++++++--------------- libvxi11client/libvxi11client.h | 4 ++++ 4 files changed, 39 insertions(+), 21 deletions(-) delete mode 100644 build/.gitignore diff --git a/build/.gitignore b/build/.gitignore deleted file mode 100644 index 5e7d273..0000000 --- a/build/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/libvxi11client/client.c b/libvxi11client/client.c index e25c037..fe023c7 100644 --- a/libvxi11client/client.c +++ b/libvxi11client/client.c @@ -14,5 +14,9 @@ int main() { vxi11_unlock(); vxi11_remote(); vxi11_local(); + vxi11_readstatusbyte(); + vxi11_create_intr_chan(); + vxi11_destroy_intr_chan(); + vxi11_docmd(); vxi11_close(); } diff --git a/libvxi11client/libvxi11client.c b/libvxi11client/libvxi11client.c index bfe56fa..41ad046 100644 --- a/libvxi11client/libvxi11client.c +++ b/libvxi11client/libvxi11client.c @@ -23,7 +23,11 @@ void vxi11_open(char* address, char* device) { } void vxi11_readstatusbyte() { - + if (clnt == NULL) + return; + Device_GenericParms params = { .lid = link, .flags = 0x0, .lock_timeout = VXI11_DEFAULT_TIMEOUT, .io_timeout = + VXI11_DEFAULT_TIMEOUT }; + Device_ReadStbResp* resp = device_readstb_1(¶ms, clnt); } void vxi11_write() { @@ -33,8 +37,8 @@ void vxi11_write() { char* IDENTIFY = "*IDN?"; - Device_WriteParms - params = {.lid = link, .io_timeout = VXI11_DEFAULT_TIMEOUT, .lock_timeout = VXI11_DEFAULT_TIMEOUT, .flags = 0x0}; + Device_WriteParms params = { .lid = link, .io_timeout = VXI11_DEFAULT_TIMEOUT, + .lock_timeout = VXI11_DEFAULT_TIMEOUT, .flags = 0x0 }; params.data.data_len = sizeof(IDENTIFY); params.data.data_val = IDENTIFY; @@ -46,54 +50,62 @@ void vxi11_read() { return; } - Device_ReadParms - params = {.lid = link, .requestSize = 256, .io_timeout = VXI11_DEFAULT_TIMEOUT, .lock_timeout = VXI11_DEFAULT_TIMEOUT, .flags = 0x0, .termChar = 0x0}; + Device_ReadParms params = { .lid = link, .requestSize = 256, .io_timeout = VXI11_DEFAULT_TIMEOUT, .lock_timeout = + VXI11_DEFAULT_TIMEOUT, .flags = 0x0, .termChar = 0x0 }; Device_ReadResp* resp = device_read_1(¶ms, clnt); } void vxi11_docmd() { + if (clnt == NULL) + return; + Device_DocmdParms params = { .lid = link, .flags = 0x0, .io_timeout = VXI11_DEFAULT_TIMEOUT, .lock_timeout = + VXI11_DEFAULT_TIMEOUT, .cmd = 0, .network_order = 0, .datasize = 0 }; + + params.data_in.data_in_len = 0; + params.data_in.data_in_val = NULL; + + Device_DocmdResp* resp = device_docmd_1(¶ms, clnt); } void vxi11_trigger() { if (clnt == NULL) return; - Device_GenericParms - params = {.lid = link, .flags = 0x0, .lock_timeout = VXI11_DEFAULT_TIMEOUT, .io_timeout=VXI11_DEFAULT_TIMEOUT}; + Device_GenericParms params = { .lid = link, .flags = 0x0, .lock_timeout = VXI11_DEFAULT_TIMEOUT, .io_timeout = + VXI11_DEFAULT_TIMEOUT }; device_trigger_1(¶ms, clnt); } void vxi11_clear() { if (clnt == NULL) return; - Device_GenericParms - params = {.lid = link, .flags = 0x0, .lock_timeout = VXI11_DEFAULT_TIMEOUT, .io_timeout=VXI11_DEFAULT_TIMEOUT}; + Device_GenericParms params = { .lid = link, .flags = 0x0, .lock_timeout = VXI11_DEFAULT_TIMEOUT, .io_timeout = + VXI11_DEFAULT_TIMEOUT }; device_clear_1(¶ms, clnt); } void vxi11_remote() { if (clnt == NULL) return; - Device_GenericParms - params = {.lid = link, .flags = 0x0, .lock_timeout = VXI11_DEFAULT_TIMEOUT, .io_timeout=VXI11_DEFAULT_TIMEOUT}; + Device_GenericParms params = { .lid = link, .flags = 0x0, .lock_timeout = VXI11_DEFAULT_TIMEOUT, .io_timeout = + VXI11_DEFAULT_TIMEOUT }; device_remote_1(¶ms, clnt); } void vxi11_local() { if (clnt == NULL) return; - Device_GenericParms - params = {.lid = link, .flags = 0x0, .lock_timeout = VXI11_DEFAULT_TIMEOUT, .io_timeout=VXI11_DEFAULT_TIMEOUT}; + Device_GenericParms params = { .lid = link, .flags = 0x0, .lock_timeout = VXI11_DEFAULT_TIMEOUT, .io_timeout = + VXI11_DEFAULT_TIMEOUT }; device_local_1(¶ms, clnt); } void vxi11_lock() { if (clnt == NULL) return; - Device_LockParms - params = {.lid = link, .flags = 0x0, .lock_timeout = VXI11_DEFAULT_TIMEOUT}; + Device_LockParms params = { .lid = link, .flags = 0x0, .lock_timeout = VXI11_DEFAULT_TIMEOUT }; device_lock_1(¶ms, clnt); } @@ -106,13 +118,15 @@ void vxi11_unlock() { void vxi11_create_intr_chan() { if (clnt == NULL) return; - + Device_RemoteFunc remotefunc = { .hostAddr = 0x0, .hostPort = 0x0, .progNum = 0x0, .progVers = 0x0, .progFamily = + DEVICE_TCP }; + create_intr_chan_1(&remotefunc, clnt); } void vxi11_destroy_intr_chan() { if (clnt == NULL) return; - + destroy_intr_chan_1(NULL, clnt); } void vxi11_abort() { diff --git a/libvxi11client/libvxi11client.h b/libvxi11client/libvxi11client.h index bf951dd..4b2f781 100644 --- a/libvxi11client/libvxi11client.h +++ b/libvxi11client/libvxi11client.h @@ -8,6 +8,10 @@ void vxi11_read(); void vxi11_lock(); void vxi11_unlock(); void vxi11_local(); +void vxi11_readstatusbyte(); void vxi11_remote(); +void vxi11_create_intr_chan(); +void vxi11_destroy_intr_chan(); +void vxi11_docmd(); void vxi11_close(); -- cgit