nds2-client - ClientAdministrator  0.16.8
 All Functions Typedefs Enumerations Enumerator Groups Pages
Typedefs | Functions
Internal and obsolete interfaces.

Typedefs

typedef struct signal_conv1 signal_conv_t1
 

Functions

DLL_EXPORT int daq_recv_channel_groups (daq_t *daq, daq_channel_group_t *group, int num_groups, int *num_channel_groups_received)
 Receive a list of channel groups. More...
 
DLL_EXPORT int daq_set_server (daq_t *daq, const char *host, int port)
 Set the server address. More...
 
DLL_EXPORT long read_server_response (nds_socket_type fd)
 Get a response code (internal function). More...
 
DLL_EXPORT long read_server_response_wait (nds_socket_type fd, int wt)
 Get a response integer (internal function). More...
 
DLL_EXPORT size_t swap_data (size_t gran, size_t nBytes, char *data)
 Swap data bytes. More...
 
DLL_EXPORT enum chantype cvt_group_chantype (int group_num)
 Convert group code to channel type. More...
 
DLL_EXPORT long dca_strtol (const char *str)
 
DLL_EXPORT int _daq_wait_data (nds_socket_type fd, int wt)
 Wait for data to arrive. More...
 
DLL_EXPORT int read_bytes (nds_socket_type fd, char *cptr, size_t numb)
 Read a `numb' bytes. More...
 
DLL_EXPORT int read_float (nds_socket_type fd, float *data)
 Read a float data word. More...
 
DLL_EXPORT int read_uint4 (nds_socket_type fd, uint4_type *data)
 Read a 4-byte integer data word. More...
 
DLL_EXPORT int _daq_read_cstring (nds_socket_type fd, size_t maxlen, char *buf)
 read an nds string. More...
 
DLL_EXPORT int _daq_read_string (nds_socket_type fd, size_t maxlen, char *buf)
 read an nds2 string. More...
 
DLL_EXPORT int null_term (char *p, int len)
 Add a NULL after the last non-blank in a string. More...
 
DLL_EXPORT size_t _daq_get_string (const char **p, const char *end, char *out, size_t lmax)
 Copy a blank or null terminated string to an output buffer. More...
 
DLL_EXPORT int _daq_cvt_string (unsigned long in, char *out)
 Convert an integer to a string. More...
 
DLL_EXPORT int _daq_cvt_ll_string (unsigned long long in, char *out)
 Convert an integer to a string. More...
 
DLL_EXPORT int _daq_cycle_conn (daq_t *daq)
 

Detailed Description

The internal and obsolete interface group contains the aspects of the classic NDS interfadce that have been superceded and the items that are not used directly by the client API.

Typedef Documentation

typedef struct signal_conv1 signal_conv_t1

Signal conversion structure. It's not clear how this is used in the NDS1 protocol.

Function Documentation

DLL_EXPORT int _daq_cvt_ll_string ( unsigned long long  in,
char *  out 
)

Convert an integer to a string.

Convert the specified integerlong long to a string

Parameters
inInteger to be converted.
outOutput string.
Returns
number of digits in the string.
DLL_EXPORT int _daq_cvt_string ( unsigned long  in,
char *  out 
)

Convert an integer to a string.

Convert the specified integer to a string

Parameters
inInteger to be converted.
outOutput string.
Returns
number of digits in the string.
DLL_EXPORT int _daq_cycle_conn ( daq_t *  daq)

Internal function to force a reconnection for nds1 connections.

Parameters
daqThe connection to close and reconnect
Returns
DAQD_OK or an error
Note
This does nothing if daq is null, or is not a nds1 connection.
DLL_EXPORT size_t _daq_get_string ( const char **  p,
const char *  end,
char *  out,
size_t  lmax 
)

Copy a blank or null terminated string to an output buffer.

Copy a data string to the specified memory location. Any leading blanks are skipped. The non-blank characters are then copied until a blank is found, the end of the input string is reached or the maximum byte count is reached. A NULL is appended on the output string if space is available. The number of bytes copied is returned and the input pointer is updated.

Parameters
pInput string pointer address.
endEnd of input string.
outOutput string.
lmaxOutput buffer length.
Returns
Number of bytes in output string.

read data from string pointed to by *p. skip past any leading spaces. copy all data to out until a space or a null is found or out is full. return the number of characters copied and increment *p as appropriate.

DLL_EXPORT int _daq_read_cstring ( nds_socket_type  fd,
size_t  maxlen,
char *  buf 
)

read an nds string.

Read an NDS null terminated string from the specified socket. The string is copied to the specified buffer and a null character is added at the end of the string if there is room in the buffer.

Parameters
fdSocket file descriptor
maxlenLength of output buffer.
bufString buffer.
Returns
String length or -1.
DLL_EXPORT int _daq_read_string ( nds_socket_type  fd,
size_t  maxlen,
char *  buf 
)

read an nds2 string.

Read an NDS2 byte-counted string from the specified socket. The string is transferred as an integer byte-count followed by text. The string is copied to the specified buffer and a null character is added at the end of the string if there is room in the buffer.

Parameters
fdSocket file descriptor
maxlenLength of output buffer.
bufString buffer.
Returns
String length or -1.
DLL_EXPORT int _daq_wait_data ( nds_socket_type  fd,
int  wt 
)

Wait for data to arrive.

Wait for data to arrive on the specified socket up to the maximum specified time.

Parameters
fdFile descriptor of the socket to be tested.
wtMaximumwait time in seconds.
Returns
values: 1 Data available 0 Timeout. -1 Error
DLL_EXPORT enum chantype cvt_group_chantype ( int  group_num)

Convert group code to channel type.

Convert an nds group number to an nds2 channel type code.

Parameters
group_numGroup code to be converted.
Returns
Channel type corresponding to the argument group code.
DLL_EXPORT int daq_recv_channel_groups ( daq_t *  daq,
daq_channel_group_t *  group,
int  num_groups,
int *  num_channel_groups_received 
)

Receive a list of channel groups.

Get a list of defined channel groups. daq_recv_channel_groups requests a list of channel groups from the server and the fills in the list with the channel group data.

Deprecated:
Channel groups are replaced by pre-defined channel types.
Parameters
daqPointer to client status structure.
groupPointer to an allocated list of group information.
num_groupsMaximum number of groups to read (size of list).
num_channel_groups_receivedNumber of groups defined.
Returns
DAQD status code.
DLL_EXPORT int daq_set_server ( daq_t *  daq,
const char *  host,
int  port 
)

Set the server address.

Look up the server address specified by the host string and port number. The resulting ip address is stored in daq->srvr_addr.

Parameters
daqPointer to the client status structure
hostServer node name string pointer.
portServer port number
Returns
DAQD status code.
DLL_EXPORT long dca_strtol ( const char *  str)

Convert a null terminated hex string to a long integer.

Parameters
strPointer to hexidecimal string.
Returns
Value of hex string or -1 if syntax error.
DLL_EXPORT int null_term ( char *  p,
int  len 
)

Add a NULL after the last non-blank in a string.

Replace the character after the last non-whitespace character in a string with a NULL. If the entire string is white-space the first character is set to NULL. Whitespace is defined by the isspace() function.

Parameters
pPointer to the initial string.
lenLength of the initial string.
Returns
New string length (position of the NULL).
DLL_EXPORT int read_bytes ( nds_socket_type  fd,
char *  cptr,
size_t  numb 
)

Read a `numb' bytes.

Read a specified number of bytes from a specified socket.

Parameters
fdFile descriptor to be read from.
cptrbuffer for read data.
numbNumber of bytes to be read.
Returns
Number of bytes read or 0 on EOF or -1 on error.
DLL_EXPORT int read_float ( nds_socket_type  fd,
float *  data 
)

Read a float data word.

Read a float from the indicated socket and swap bytes from network byte ordering (big-endian) to host byte ordering.

Parameters
fdSocket file descriptor.
datapointer to the output float word.
Returns
DAQD error code.
DLL_EXPORT long read_server_response ( nds_socket_type  fd)

Get a response code (internal function).

Get a 4 hex digit integer data word response from the server.

Parameters
fdOpened socked file descriptor.
Returns
Server response code or -1 if an error occurred.
DLL_EXPORT long read_server_response_wait ( nds_socket_type  fd,
int  wt 
)

Get a response integer (internal function).

Get a 4 hex digit integer data word response from the server.

Parameters
fdOpened socket file descriptor.
wtMaximum wait time in tenths of a second. Defaults to 10s if 0 is passed.
Returns
Server response code, or -1 if an error occurred.
DLL_EXPORT int read_uint4 ( nds_socket_type  fd,
uint4_type *  data 
)

Read a 4-byte integer data word.

Read an unsigned integer from the indicated socket and swap bytes from network byte ordering (big-endian) to host byte ordering.

Parameters
fdSocket file descriptor.
datapointer to the output float word.
Returns
DAQD error code.
DLL_EXPORT size_t swap_data ( size_t  gran,
size_t  nBytes,
char *  data 
)

Swap data bytes.

Swap bytes of data words according to the specified word size from network (big-endian) byte ordering to the local host byte ordering. If gran<2 no swapping is performed and the number of words returned is nBytes. If the local host uses network byte-ordering no swapping is performed and the number of words returned is nBytes/gran.

Parameters
granGranularity (word size in bytes).
nBytesNumber of data bytes to be swapped.
dataPointer to the first data byte.
Returns
Number of words swapped.