libdata-gcf
1.1.2
|
Data Structures | |
struct | gcf_generic_hdr |
Generic header details shared by all GCF blocks. More... | |
struct | gcf_data_hdr |
Header details for a data block. More... | |
struct | gcf_status_hdr |
Header details for a status block. More... | |
union | gcf_union_hdr |
Header union type for parsing. More... | |
Enumerations | |
enum | gcf_block_type_t { gcf_block_type_data , gcf_block_type_status , gcf_block_type_unified_status , gcf_block_type_strong_motion , gcf_block_type_cd_status } |
Possible block types. More... | |
enum | gcf_digitiser_t { gcf_digitiser_unknown , gcf_digitiser_dm24mk3 , gcf_digitiser_cd24 , gcf_digitiser_das } |
Possible digitiser types. More... | |
enum | gcf_variable_gain_t { gcf_no_variable_gain , gcf_variable_gain_times_one , gcf_variable_gain_times_two , gcf_variable_gain_times_four , gcf_variable_gain_times_eight , gcf_variable_gain_times_sixteen , gcf_variable_gain_times_thirtytwo , gcf_variable_gain_times_sixtyfour } |
Possible variable gain values. More... | |
enum | gcf_sample_format_t { gcf_sample_format_32bit_diff , gcf_sample_format_24bit_diff_mod , gcf_sample_format_16bit_diff , gcf_sample_format_8bit_diff } |
Possible sample formats. More... | |
Functions | |
int | gcf_parse_hdr (const char *data, int len, union gcf_union_hdr *hdr) |
Parse header. More... | |
The gcf_parse_hdr() routine and associated data types are used to parse the header of a GCF block. This must be done before it is possible to extract the contents of the block itself.
enum gcf_block_type_t |
Possible block types.
This enumeration contains all the possible block types. It is set in the type field of the various different header structures.
Enumerator | |
---|---|
gcf_block_type_data | Data block. Uses struct gcf_data_hdr. |
gcf_block_type_status | Status block. Uses struct gcf_status_hdr. |
gcf_block_type_unified_status | Unified status block. Uses struct gcf_status_hdr. |
gcf_block_type_strong_motion | Strong motion block. Uses struct gcf_status_hdr. |
gcf_block_type_cd_status | Continuous data status block. Uses struct gcf_generic_hdr. |
enum gcf_digitiser_t |
Possible digitiser types.
This enumeration lists the digitiser types that can be determined from a GCF block header. This information can be extracted if the extended sysid bit is set.
enum gcf_variable_gain_t |
Possible variable gain values.
This enumeration lists the values for the variable gain setting. There may be no gain front end fitted in which case the value would be gcf_no_variable_gain otherwise it indicates the value.
enum gcf_sample_format_t |
Possible sample formats.
This enumeration lists the possible sample formats for a data block.
int gcf_parse_hdr | ( | const char * | data, |
int | len, | ||
union gcf_union_hdr * | hdr | ||
) |
Parse header.
data | Block data. | |
len | Block length. | |
[out] | hdr | Header union into which parsed header data will be written. |
0 | on success. |
-1 | on error (and see gcf_errstr). |
This function will parse a GCF block header. It will only access the first 16 bytes of data, regardless of the specified len. len is used to determine if the data is in the special 24-bit difference mode used by the DM24mk3 over BRP; it is also used to ensure that the block contains enough data for the given number of samples. If the block was not transmitted using a protocol which truncates partially used blocks, then len should be set to 1024.
If the block header is invalid, then -1 is returned; otherwise, the parsed header data is valid and 0 is returned. On error, an informative message is written to gcf_errstr.