|
| 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.
|
| |
| DLL_EXPORT int | daq_set_server (daq_t *daq, const char *host, int port) |
| | Set the server address.
|
| |
| DLL_EXPORT long | read_server_response (nds_socket_type fd) |
| | Get a response code (internal function).
|
| |
| DLL_EXPORT long | read_server_response_wait (nds_socket_type fd, int wt) |
| | Get a response integer (internal function).
|
| |
| DLL_EXPORT size_t | swap_data (size_t gran, size_t nBytes, char *data) |
| | Swap data bytes.
|
| |
| DLL_EXPORT enum chantype | cvt_group_chantype (int group_num) |
| | Convert group code to channel type.
|
| |
| 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.
|
| |
| DLL_EXPORT int | read_bytes (nds_socket_type fd, char *cptr, size_t numb) |
| | Read a ‘numb’ bytes.
|
| |
| DLL_EXPORT int | read_float (nds_socket_type fd, float *data) |
| | Read a float data word.
|
| |
| DLL_EXPORT int | read_uint4 (nds_socket_type fd, uint4_type *data) |
| | Read a 4-byte integer data word.
|
| |
| DLL_EXPORT int | _daq_read_cstring (nds_socket_type fd, size_t maxlen, char *buf) |
| | read an nds string.
|
| |
| DLL_EXPORT int | _daq_read_string (nds_socket_type fd, size_t maxlen, char *buf) |
| | read an nds2 string.
|
| |
| DLL_EXPORT int | null_term (char *p, int len) |
| | Add a NULL after the last non-blank in a string.
|
| |
| 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.
|
| |
| DLL_EXPORT int | _daq_cvt_string (unsigned long in, char *out) |
| | Convert an integer to a string.
|
| |
| DLL_EXPORT int | _daq_cvt_ll_string (unsigned long long in, char *out) |
| | Convert an integer to a string.
|
| |
| DLL_EXPORT int | _daq_cycle_conn (daq_t *daq) |
| |
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.
◆ signal_conv_t1
Signal conversion structure. It's not clear how this is used in the NDS1 protocol.
◆ _daq_cvt_ll_string()
| 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
-
| in | Integer to be converted. |
| out | Output string. |
- Returns
- number of digits in the string.
◆ _daq_cvt_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
-
| in | Integer to be converted. |
| out | Output string. |
- Returns
- number of digits in the string.
◆ _daq_cycle_conn()
Internal function to force a reconnection for nds1 connections.
- Parameters
-
| daq | The 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.
◆ _daq_get_string()
| 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
-
| p | Input string pointer address. |
| end | End of input string. |
| out | Output string. |
| lmax | Output 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.
◆ _daq_read_cstring()
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
-
| fd | Socket file descriptor |
| maxlen | Length of output buffer. |
| buf | String buffer. |
- Returns
- String length or -1.
◆ _daq_read_string()
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
-
| fd | Socket file descriptor |
| maxlen | Length of output buffer. |
| buf | String buffer. |
- Returns
- String length or -1.
◆ _daq_wait_data()
Wait for data to arrive.
Wait for data to arrive on the specified socket up to the maximum specified time.
- Parameters
-
| fd | File descriptor of the socket to be tested. |
| wt | Maximumwait time in seconds. |
- Returns
- values: 1 Data available 0 Timeout. -1 Error
◆ cvt_group_chantype()
Convert group code to channel type.
Convert an nds group number to an nds2 channel type code.
- Parameters
-
| group_num | Group code to be converted. |
- Returns
- Channel type corresponding to the argument group code.
◆ daq_recv_channel_groups()
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
-
| daq | Pointer to client status structure. |
| group | Pointer to an allocated list of group information. |
| num_groups | Maximum number of groups to read (size of list). |
| num_channel_groups_received | Number of groups defined. |
- Returns
- DAQD status code.
◆ daq_set_server()
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
-
| daq | Pointer to the client status structure |
| host | Server node name string pointer. |
| port | Server port number |
- Returns
- DAQD status code.
◆ dca_strtol()
Convert a null terminated hex string to a long integer.
- Parameters
-
| str | Pointer to hexidecimal string. |
- Returns
- Value of hex string or -1 if syntax error.
◆ null_term()
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
-
| p | Pointer to the initial string. |
| len | Length of the initial string. |
- Returns
- New string length (position of the NULL).
◆ read_bytes()
Read a ‘numb’ bytes.
Read a specified number of bytes from a specified socket.
- Parameters
-
| fd | File descriptor to be read from. |
| cptr | buffer for read data. |
| numb | Number of bytes to be read. |
- Returns
- Number of bytes read or 0 on EOF or -1 on error.
◆ read_float()
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
-
| fd | Socket file descriptor. |
| data | pointer to the output float word. |
- Returns
- DAQD error code.
◆ read_server_response()
Get a response code (internal function).
Get a 4 hex digit integer data word response from the server.
- Parameters
-
| fd | Opened socked file descriptor. |
- Returns
- Server response code or -1 if an error occurred.
◆ read_server_response_wait()
Get a response integer (internal function).
Get a 4 hex digit integer data word response from the server.
- Parameters
-
| fd | Opened socket file descriptor. |
| wt | Maximum wait time in tenths of a second. Defaults to 10s if 0 is passed. |
- Returns
- Server response code, or -1 if an error occurred.
◆ read_uint4()
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
-
| fd | Socket file descriptor. |
| data | pointer to the output float word. |
- Returns
- DAQD error code.
◆ swap_data()
| 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
-
| gran | Granularity (word size in bytes). |
| nBytes | Number of data bytes to be swapped. |
| data | Pointer to the first data byte. |
- Returns
- Number of words swapped.