You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
132 lines
3.3 KiB
C
132 lines
3.3 KiB
C
/*****************************************************************************
|
|
* slink.h
|
|
*
|
|
* SeedLink protocol constants
|
|
*
|
|
* Token from libslink
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the
|
|
* Free Software Foundation; either version 2, or (at your option) any later
|
|
* version. For more information, see http://www.gnu.org/
|
|
*
|
|
* ================
|
|
* Change log
|
|
* ===============
|
|
*
|
|
* 01.01.2013 Adapted code to CAPS client library requirements (gempa GmbH)
|
|
*****************************************************************************/
|
|
|
|
#ifndef CAPS_MSEED_SLINK_H
|
|
#define CAPS_MSEED_SLINK_H
|
|
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
|
|
/* Portability to the XScale (ARM) architecture
|
|
* requires a packed attribute in certain places
|
|
* but this only works with GCC for now.
|
|
*/
|
|
#if defined (__GNUC__)
|
|
#define SLP_PACKED __attribute__ ((packed))
|
|
#else
|
|
#define SLP_PACKED
|
|
#endif
|
|
|
|
#define SIGNATURE "SL" /* SeedLink header signature */
|
|
#define INFOSIGNATURE "SLINFO" /* SeedLink INFO packet signature */
|
|
|
|
|
|
/* SeedLink packet types */
|
|
#define SLDATA 0 /* waveform data record */
|
|
#define SLDET 1 /* detection record */
|
|
#define SLCAL 2 /* calibration record */
|
|
#define SLTIM 3 /* timing record */
|
|
#define SLMSG 4 /* message record */
|
|
#define SLBLK 5 /* general record */
|
|
#define SLNUM 6 /* used as the error indicator (same as SLCHA) */
|
|
#define SLCHA 6 /* for requesting channel info or detectors */
|
|
#define SLINF 7 /* a non-terminating XML formatted message in a miniSEED
|
|
log record, used for INFO responses */
|
|
#define SLINFT 8 /* a terminating XML formatted message in a miniSEED log
|
|
record, used for INFO responses */
|
|
#define SLKEEP 9 /* an XML formatted message in a miniSEED log
|
|
record, used for keepalive/heartbeat responses */
|
|
|
|
|
|
/* SEED binary time (10 bytes) */
|
|
struct sl_btime_s
|
|
{
|
|
uint16_t year;
|
|
uint16_t day;
|
|
uint8_t hour;
|
|
uint8_t min;
|
|
uint8_t sec;
|
|
uint8_t unused;
|
|
uint16_t fract;
|
|
} SLP_PACKED;
|
|
|
|
|
|
/* Fixed section data of header (48 bytes) */
|
|
struct sl_fsdh_s
|
|
{
|
|
char sequence_number[6];
|
|
char dhq_indicator;
|
|
char reserved;
|
|
char station[5];
|
|
char location[2];
|
|
char channel[3];
|
|
char network[2];
|
|
struct sl_btime_s start_time;
|
|
uint16_t num_samples;
|
|
int16_t samprate_fact;
|
|
int16_t samprate_mult;
|
|
uint8_t act_flags;
|
|
uint8_t io_flags;
|
|
uint8_t dq_flags;
|
|
uint8_t num_blockettes;
|
|
int32_t time_correct;
|
|
uint16_t begin_data;
|
|
uint16_t begin_blockette;
|
|
} SLP_PACKED;
|
|
|
|
|
|
/* 1000 Blockette (8 bytes) */
|
|
struct sl_blkt_1000_s
|
|
{
|
|
uint16_t blkt_type;
|
|
uint16_t next_blkt;
|
|
uint8_t encoding;
|
|
uint8_t word_swap;
|
|
uint8_t rec_len;
|
|
uint8_t reserved;
|
|
} SLP_PACKED;
|
|
|
|
/* 1001 Blockette (8 bytes) */
|
|
struct sl_blkt_1001_s
|
|
{
|
|
uint16_t blkt_type;
|
|
uint16_t next_blkt;
|
|
int8_t timing_qual;
|
|
int8_t usec;
|
|
uint8_t reserved;
|
|
int8_t frame_cnt;
|
|
} SLP_PACKED;
|
|
|
|
/* Generic struct for head of blockettes */
|
|
struct sl_blkt_head_s
|
|
{
|
|
uint16_t blkt_type;
|
|
uint16_t next_blkt;
|
|
} SLP_PACKED;
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|