00001
00002 #ifndef DAQC_INTERNAL_H
00003 #define DAQC_INTERNAL_H
00004
00005 #include "daqc.h"
00006
00024 struct daq_block_header {
00027 uint4_type secs;
00028
00032 uint4_type gps;
00033
00036 uint4_type gpsn;
00037
00040 uint4_type seq_num;
00041
00044 char data [1];
00045 };
00046
00047
00048
00049
00053 typedef struct signal_conv1 {
00054 float signal_slope;
00055 float signal_offset;
00056 uint4_type signal_status;
00057 } signal_conv_t1;
00058
00059
00060
00061
00062
00067 typedef struct {
00070 int group_num;
00073 char name [MAX_CHANNEL_NAME_LENGTH + 1];
00074 } daq_channel_group_t;
00075
00076
00088 int
00089 daq_recv_channel_groups (daq_t* daq, daq_channel_group_t* group,
00090 int num_groups, int* num_channel_groups_received);
00091
00092
00093
00094
00097 int
00098 daq_set_server(daq_t *daq, const char* host, int port);
00099
00100
00101
00102
00103
00104 #define MAX_RCV_CNT 100000
00105 #define DAQC_ACCESS_VERBOSE_ERRORS 1
00106
00112 long
00113 read_server_response(int fd);
00114
00122 long
00123 read_server_response_wait(int fd, int wt);
00124
00125 int
00126 swap_data(int gran, int nBytes, char* data);
00127
00128 enum chantype
00129 cvt_group_chantype(int group_num);
00130
00131
00136 long
00137 dca_strtol (char *str);
00138
00139
00140
00141
00142
00143
00144
00145 int
00146 wait_data(int fd, int wt);
00147
00148
00149
00150
00151
00152 int
00153 read_bytes (int fd, char *cptr, int numb);
00154
00155
00156
00157
00158
00159
00160 int
00161 read_float(int fd, float* data);
00162
00163
00164
00165
00166 int
00167 read_long (int fd, int* data);
00168
00169
00170
00171
00172 int
00173 read_uint4 (int fd, uint4_type* data);
00174
00175
00176
00177
00178
00179 int
00180 read_string(int fd, int maxlen, char* buf);
00181
00182 int
00183 null_term(char* p, int len);
00184
00185 int
00186 get_string(char** p, char* out, int lmax);
00187
00188
00189
00190
00191
00192 int
00193 cvt_string(long in, char* out);
00194
00200 #endif // !defined(DAQC_INTERNAL_H)