kephren_plugin/plugin.h
Go to the documentation of this file.
00001 /***************************************************************************** 
00002  * plugin.h
00003  *
00004  * SeedLink plugin interface module
00005  *
00006  * (c) 2000 Andres Heinloo, GFZ Potsdam
00007  *
00008  * This program is free software; you can redistribute it and/or modify it
00009  * under the terms of the GNU General Public License as published by the
00010  * Free Software Foundation; either version 2, or (at your option) any later
00011  * version. For more information, see http://www.gnu.org/
00012  *****************************************************************************/
00013 
00014 #ifndef PLUGIN_H
00015 #define PLUGIN_H
00016 
00017 #include <sys/types.h>
00018 
00019 #ifdef PLUGIN_COMPATIBILITY
00020 #include "qtime.h"
00021 #endif
00022 
00023 #define PLUGIN_INTERFACE_VERSION  3
00024 #define PLUGIN_FD                 63
00025 #define PLUGIN_MAX_DATA_BYTES     4000
00026 #define PLUGIN_MAX_MSG_SIZE       132     /* Quanterra/Comserv limit */
00027 #define PLUGIN_MSEED_SIZE         512     /* hardcoded Comserv limit */
00028 #define PLUGIN_SIDLEN             10      /* length of station ID */
00029 #define PLUGIN_CIDLEN             10      /* length of channel ID */
00030 
00031 enum PluginPacketType
00032   {
00033     PluginRawDataTimePacket=8,
00034     PluginRawDataPacket,
00035     PluginRawDataGapPacket,
00036     PluginRawDataFlushPacket,
00037     PluginLogPacket,
00038     PluginMSEEDPacket
00039   };
00040 
00041 struct ptime
00042   {
00043     int year;      /* year, eg. 2003                   */
00044     int yday;      /* day of year (1-366)              */
00045     int hour;      /* hour (0-23)                      */
00046     int minute;    /* minute (0-59)                    */
00047     int second;    /* second (0-59), 60 if leap second */
00048     int usec;      /* microsecond (0-999999)           */
00049   };
00050     
00051 struct PluginPacketHeader
00052   {
00053     enum PluginPacketType packtype;
00054     char station[PLUGIN_SIDLEN];
00055     char channel[PLUGIN_CIDLEN];
00056     struct ptime pt;
00057     int usec_correction;
00058     int timing_quality;
00059     int data_size;
00060   };
00061     
00062 #ifdef __cplusplus
00063 extern "C" {
00064 #endif
00065 
00066 int send_raw3(const char *station, const char *channel, const struct ptime *pt,
00067   int usec_correction, int timing_quality, const int32_t *dataptr,
00068   int number_of_samples);
00069 int send_flush3(const char *station, const char *channel);
00070 int send_log3(const char *station, const struct ptime *pt, const char *fmt,
00071   ...);
00072 int send_mseed(const char *station, const void *dataptr, int packet_size);
00073 int send_raw_depoch(const char *station, const char *channel, double depoch,
00074   int usec_correction, int timing_quality, const int32_t *dataptr,
00075   int number_of_samples);
00076 
00077 #ifdef PLUGIN_COMPATIBILITY
00078 int send_raw(const char *station, const char *channel, const INT_TIME *it,
00079   int usec_correction, const int32_t *dataptr, int number_of_samples);
00080 int send_raw2(const char *station, const char *channel, const INT_TIME *it,
00081   int usec_correction, int timing_quality, const int32_t *dataptr,
00082   int number_of_samples);
00083 int send_log(const char *station, const INT_TIME *it, const char *fmt, ...);
00084 #endif
00085 
00086 #ifdef __cplusplus
00087 }
00088 #endif
00089 
00090 #endif /* PLUGIN_H */
00091 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines