nds2-client - ClientDeveloper  0.16.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions
daqc_access.c File Reference
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "stdint.h"
#include <io.h>
#include "daqc.h"
#include "daqc_private.h"
#include "daqc_response.h"
#include "daqc_internal.h"
#include "daqc_net.h"
#include "nds_logging.h"
#include "nds_os.h"
#include "nds1.h"
#include "nds2.h"
#include "trench.h"
Include dependency graph for daqc_access.c:

Macros

#define TRACE_ENTRY_EXIT   0
 
#define TEST_NAME(x)
 
#define FAST_BLOCKS_PER_SEC   16
 
#define SERVER_ID_LENGTH   8
 
#define DAQ_REQUEST_BLOCK_SIZE   16
 
#define TEST_NAME(x)
 

Functions

size_t data_type_size (daq_data_t dtype)
 
size_t data_type_word (daq_data_t dtype)
 
double data_type_max (daq_data_t dtype)
 
const char * data_type_name (daq_data_t dtype)
 
daq_data_t data_type_code (const char *name)
 
int daq_disconnect (daq_t *daq)
 Disconnect from the server. More...
 
int daq_connect (daq_t *daq, const char *host, int port, enum nds_version vrsn)
 Make a connection to an NDS server. More...
 
void daq_destroy (daq_t *daq)
 Close and delete all client status structure elements. More...
 
int _daq_cycle_conn (daq_t *daq)
 
static int daq_cycle_conn_if_needed (daq_t *daq)
 
int daq_send (daq_t *daq, const char *command)
 send a command string. More...
 
int daq_recv_block (daq_t *daq)
 Receive a data block. More...
 
int daq_recv_block_num (daq_t *daq)
 Receive block number. More...
 
int daq_recv_next (daq_t *daq)
 Receive a data block. More...
 
int daq_recv_shutdown (daq_t *daq)
 Close the client connection. More...
 
int daq_recv_channels (daq_t *daq, daq_channel_t *channel, int num_channels, int *num_received)
 Get a list of online channels. More...
 
int daq_recv_channel_hash (daq_t *daq, void *hash, int *length, time_t gps, enum chantype type)
 Get a channel list hash. More...
 
int daq_recv_hash_by_pattern (daq_t *daq, void *hash, int *length, time_t gps, enum chantype type, const char *pat)
 Get a channel list hash. More...
 
int daq_recv_channel_list (daq_t *daq, daq_channel_t *channel, int num_channels, int *num_received, time_t gps, enum chantype type)
 Get a list of channels. More...
 
int daq_recv_channels_by_pattern (daq_t *daq, daq_channel_t *channel, int num_channels, int *num_received, time_t gps, enum chantype type, const char *pat)
 Get a list of channels. More...
 
int daq_recv_epoch_list (daq_t *daq, char *list, size_t max_len, int *str_len)
 Get a list of epochs. More...
 
long daq_recv_id (daq_t *daq)
 Receive an ID. More...
 
int daq_recv_source_data (daq_t *daq, char *list, size_t max_len, time_t gps, long *str_len)
 Get a list of source frames. More...
 
int daq_recv_source_list (daq_t *daq, char *list, size_t max_len, time_t gps, long *str_len)
 Get a list of source frames. More...
 
static chan_req_tget_request_entry (daq_t *daq)
 
int daq_request_channel (daq_t *daq, const char *name, enum chantype type, double rate)
 Add a channel to the request list. More...
 
int daq_request_channel_from_chanlist (daq_t *daq, daq_channel_t *pchan)
 Add a channel to the request list. More...
 
int daq_clear_channel_list (daq_t *daq)
 Clear the channel list. More...
 
chan_req_tdaq_get_channel_status (daq_t *daq, const char *channel)
 Get a pointer to channel data. More...
 
int daq_get_data_length (daq_t *daq, const char *channel)
 Get the channel data length. More...
 
const char * daq_get_channel_addr (daq_t *daq, const char *channel)
 Get a pointer to the data for the specified channel. More...
 
char * daq_get_channel_data (daq_t *daq, const char *channel, char *data)
 Copy channel data. More...
 
int daq_get_last_message (daq_t *daq, char *buf, size_t max_len, int *len)
 Get the last message. More...
 
int daq_get_scaled_data (daq_t *daq, const char *channel, float *data)
 Calibrate and copy channel data. More...
 
int daq_request_check (daq_t *daq, time_t start, time_t end)
 Check requested data. More...
 
int daq_request_data (daq_t *daq, time_t start, time_t end, time_t dt)
 Get requested data. More...
 
int daq_set_epoch (daq_t *daq, const char *epoch)
 Set the default epoch. More...
 
const char * daq_strerror (int errornum)
 determine English equivalent of return code. More...
 
int daq_startup (void)
 Initialize nds1/nds2 client subsystems. More...
 
void daq_init (daq_t *daq)
 Initialize a daq_t structure. More...
 
void daq_init_channel (daq_channel_t *chan, const char *name, enum chantype ctype, double rate, daq_data_t dtype)
 Initialize a daq_channel_t structure. More...
 
int daq_is_connected (daq_t *daq)
 Test for connected server. More...
 
const char * cvt_chantype_str (enum chantype t)
 
enum chantype cvt_str_chantype (const char *name)
 

Macro Definition Documentation

#define DAQ_REQUEST_BLOCK_SIZE   16
#define FAST_BLOCKS_PER_SEC   16
#define SERVER_ID_LENGTH   8
#define TEST_NAME (   x)
Value:
if ( !strcmp( name, data_type_name( x ) ) ) \
return x
DLL_EXPORT const char * data_type_name(daq_data_t dtype)
Definition: daqc_access.c:130
#define TEST_NAME (   x)
Value:
if ( !strcmp( name, cvt_chantype_str( x ) ) ) \
return x
DLL_EXPORT const char * cvt_chantype_str(chantype_t code)
#define TRACE_ENTRY_EXIT   0

Function Documentation

const char* cvt_chantype_str ( enum chantype  t)

Convert a channel type code to a string.

enum chantype cvt_str_chantype ( const char *  str)

Convert a channel type string to a channel type code

static int daq_cycle_conn_if_needed ( daq_t daq)
static
daq_data_t data_type_code ( const char *  name)

Function to return data type name.

double data_type_max ( daq_data_t  dtype)

Function to relate data types to maximum value.

const char* data_type_name ( daq_data_t  dtype)

Function to return data type name.

size_t data_type_size ( daq_data_t  dtype)

Function to relate data types to size.

size_t data_type_word ( daq_data_t  dtype)

Inline function to return word length in bytes. This number gives the granularity in byte for use when swapping data bytes. It differs from the size attribute for complex numbers.

static chan_req_t* get_request_entry ( daq_t daq)
static