nds2-client - ClientDeveloper  0.16.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
daqc_internal.h
Go to the documentation of this file.
1 /* -*- tab-width:8 c-basic-offset:4 indent-tabs-mode:nil -*- */
2 /* set vi: ts=8:softtabstop=4,shiftwidth=4,expandtab */
3 
4 #ifndef DAQC_INTERNAL_H
5 #define DAQC_INTERNAL_H
6 
7 #if HAVE_CONFIG_H
8 #include "daq_config.h"
9 #endif /* HAVE_CONFIG_H */
10 
11 #include "daqc.h"
12 #include "daqc_private.h"
13 
14 #ifndef DLL_EXPORT
15 #if WIN32 || WIN64
16 #define DLL_EXPORT __declspec( dllexport )
17 #else
18 #define DLL_EXPORT
19 #endif /* WIN32 || WIN64 */
20 #endif /* DLL_EXPORT */
21 
35 {
39 
44 
48 
52 
55  char data[ 1 ];
56 };
57 
58 /* Signal_conv_t1 (internal??)
59  */
60 
64 typedef struct signal_conv1
65 {
68  float signal_slope;
76 
89  daq_channel_group_t* group,
90  int num_groups,
91  int* num_channel_groups_received );
92 
93 /* Internal NDS1/2 functions
94  */
95 
104 DLL_EXPORT int daq_set_server( daq_t* daq, const char* host, int port );
105 
106 /* Internal NDS1 functions
107  */
108 
115 
124 
137 DLL_EXPORT size_t swap_data( size_t gran, size_t nBytes, char* data );
138 
144 DLL_EXPORT enum chantype cvt_group_chantype( int group_num );
145 
150 DLL_EXPORT long dca_strtol( const char* str );
151 
162 DLL_EXPORT int _daq_wait_data( nds_socket_type fd, int wt );
163 
171 DLL_EXPORT int read_bytes( nds_socket_type fd, char* cptr, size_t numb );
172 
180 DLL_EXPORT int read_float( nds_socket_type fd, float* data );
181 
190 
201 DLL_EXPORT int
202 _daq_read_cstring( nds_socket_type fd, size_t maxlen, char* buf );
203 
214 DLL_EXPORT int _daq_read_string( nds_socket_type fd, size_t maxlen, char* buf );
215 
225 DLL_EXPORT int null_term( char* p, int len );
226 
239 DLL_EXPORT size_t _daq_get_string( const char** p,
240  const char* end,
241  char* out,
242  size_t lmax );
243 
250 DLL_EXPORT int _daq_cvt_string( unsigned long in, char* out );
251 
258 DLL_EXPORT int _daq_cvt_ll_string( unsigned long long in, char* out );
259 
266 DLL_EXPORT int _daq_cycle_conn( daq_t* daq );
267 
271 #if _WIN32
272 DLL_EXPORT void nds_perror( const char* Message );
273 #endif /* _WIN32 */
274 
275 #if SIZEOF_TIME_T == SIZEOF_LONG
276 #define daq_cvt_timet_string( In, Out ) \
277  _daq_cvt_string( (unsigned long)In, Out )
278 #elif SIZEOF_TIME_T == SIZEOF_LONG_LONG
279 #define daq_cvt_timet_string( In, Out ) \
280  _daq_cvt_ll_string( (unsigned long long)In, Out )
281 #endif
282 
283 #endif /* !defined(DAQC_INTERNAL_H) */
unsigned int uint4_type
Definition: daqc.h:17
uint4_type gpsn
Definition: daqc_internal.h:47
int read_float(nds_socket_type fd, float *data)
Read a float data word.
Definition: daqc_internal.c:311
int _daq_read_cstring(nds_socket_type fd, size_t maxlen, char *buf)
read an nds string.
Definition: daqc_internal.c:390
enum chantype cvt_group_chantype(int group_num)
Convert group code to channel type.
Definition: daqc_internal.c:110
uint4_type gps
Definition: daqc_internal.h:43
int _daq_read_string(nds_socket_type fd, size_t maxlen, char *buf)
read an nds2 string.
Definition: daqc_internal.c:342
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.
Definition: daqc_internal.c:440
#define DLL_EXPORT
Definition: channel.h:12
float signal_slope
Definition: daqc_internal.h:68
Received data header.
Definition: daqc_internal.h:34
int _daq_wait_data(nds_socket_type fd, int wt)
Wait for data to arrive.
Definition: daqc_internal.c:145
long read_server_response_wait(nds_socket_type fd, int wt)
Get a response integer (internal function).
Definition: daqc_internal.c:256
int _daq_cycle_conn(daq_t *daq)
Definition: daqc_access.c:304
int null_term(char *p, int len)
Add a NULL after the last non-blank in a string.
Definition: daqc_internal.c:420
size_t swap_data(size_t gran, size_t nBytes, char *data)
Swap data bytes.
Definition: daqc_internal.c:57
chantype
Channel type code enumerator.
Definition: channel.h:28
uint4_type seq_num
Definition: daqc_internal.h:51
Definition: daqc_internal.h:64
NDS1/2 client status structure.
Definition: daqc.h:232
uint4_type secs
Definition: daqc_internal.h:38
long dca_strtol(const char *str)
Definition: daqc_internal.c:129
long read_server_response(nds_socket_type fd)
Get a response code (internal function).
Definition: daqc_internal.c:282
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.
Definition: daqc_internal.c:616
int nds_socket_type
Definition: daqc_private.h:12
float signal_offset
Definition: daqc_internal.h:71
Channel group structure.
Definition: daqc.h:352
struct signal_conv1 signal_conv_t1
char data[1]
Definition: daqc_internal.h:55
int daq_set_server(daq_t *daq, const char *host, int port)
Set the server address.
Definition: daqc_internal.c:545
int _daq_cvt_string(unsigned long in, char *out)
Convert an integer to a string.
Definition: daqc_internal.c:463
int _daq_cvt_ll_string(unsigned long long in, char *out)
Convert an integer to a string.
Definition: daqc_internal.c:479
int read_bytes(nds_socket_type fd, char *cptr, size_t numb)
Read a `numb' bytes.
Definition: daqc_internal.c:213
int read_uint4(nds_socket_type fd, uint4_type *data)
Read a 4-byte integer data word.
Definition: daqc_internal.c:328
uint4_type signal_status
Definition: daqc_internal.h:74