diff --git a/Doxyfile.in b/Doxyfile.in index d35ba6bd..4fb03d5e 100644 --- a/Doxyfile.in +++ b/Doxyfile.in @@ -177,7 +177,7 @@ SHORT_NAMES = NO # description.) # The default value is: NO. -JAVADOC_AUTOBRIEF = NO +JAVADOC_AUTOBRIEF = YES # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If diff --git a/include/abuf.h b/include/abuf.h index 465c3c8e..203ace35 100644 --- a/include/abuf.h +++ b/include/abuf.h @@ -1,13 +1,13 @@ -/** - * array buffer (string builder). - * - * Copyright (C) 2018 Christian Zuckschwerdt - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + array buffer (string builder). + + Copyright (C) 2018 Christian Zuckschwerdt + + 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 of the License, or + (at your option) any later version. +*/ #ifndef INCLUDE_ABUF_H_ #define INCLUDE_ABUF_H_ diff --git a/include/am_analyze.h b/include/am_analyze.h index 3469106e..c2611382 100644 --- a/include/am_analyze.h +++ b/include/am_analyze.h @@ -1,13 +1,13 @@ -/** - * AM signal analyzer - * - * Copyright (C) 2018 Christian Zuckschwerdt - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + AM signal analyzer. + + Copyright (C) 2018 Christian Zuckschwerdt + + 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 of the License, or + (at your option) any later version. +*/ #ifndef INCLUDE_AM_ANALYZE_H_ #define INCLUDE_AM_ANALYZE_H_ diff --git a/include/baseband.h b/include/baseband.h index eb461952..b85bd4cb 100644 --- a/include/baseband.h +++ b/include/baseband.h @@ -1,28 +1,27 @@ -/** - * Baseband - * - * Various functions for baseband sample processing - * - * Copyright (C) 2012 by Benjamin Larsson <benjamin@southpole.se> - * Copyright (C) 2015 Tommy Vestermark - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Various functions for baseband sample processing. + + Copyright (C) 2012 by Benjamin Larsson <benjamin@southpole.se> + Copyright (C) 2015 Tommy Vestermark + + 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 of the License, or + (at your option) any later version. +*/ #ifndef INCLUDE_BASEBAND_H_ #define INCLUDE_BASEBAND_H_ #include <stdint.h> -/// This will give a noisy envelope of OOK/ASK signals +/** This will give a noisy envelope of OOK/ASK signals. -/// Subtract the bias (-128) and get an envelope estimation (absolute squared) -/// @param *iq_buf: input samples (I/Q samples in interleaved uint8) -/// @param *y_buf: output -/// @param len: number of samples to process + Subtract the bias (-128) and get an envelope estimation (absolute squared) + @param *iq_buf: input samples (I/Q samples in interleaved uint8) + @param *y_buf: output + @param len: number of samples to process +*/ void envelope_detect(uint8_t const *iq_buf, uint16_t *y_buf, uint32_t len); // for evaluation @@ -34,41 +33,44 @@ void magnitude_true_cs16(int16_t const *iq_buf, uint16_t *y_buf, uint32_t len); #define FILTER_ORDER 1 -/// Filter state buffer +/// Filter state buffer. typedef struct { int16_t y[FILTER_ORDER]; int16_t x[FILTER_ORDER]; } FilterState; -/// FM_Demod state buffer +/// FM_Demod state buffer. typedef struct { int32_t br, bi; // Last I/Q sample int32_t xlp, ylp; // Low-pass filter state } DemodFM_State; -/// Lowpass filter -/// -/// Function is stateful -/// @param *x_buf: input samples to be filtered -/// @param *y_buf: output from filter -/// @param len: number of samples to process -/// @param FilterState: State to store between chunk processing +/** Lowpass filter. + + Function is stateful + @param *x_buf: input samples to be filtered + @param *y_buf: output from filter + @param len: number of samples to process + @param FilterState: State to store between chunk processing +*/ void baseband_low_pass_filter(uint16_t const *x_buf, int16_t *y_buf, uint32_t len, FilterState *state); -/// FM demodulator -/// -/// Function is stateful -/// @param *x_buf: input samples (I/Q samples in interleaved uint8) -/// @param *y_buf: output from FM demodulator -/// @param len: number of samples to process -/// @param DemodFM_State: State to store between chunk processing +/** FM demodulator. + + Function is stateful + @param *x_buf: input samples (I/Q samples in interleaved uint8) + @param *y_buf: output from FM demodulator + @param len: number of samples to process + @param DemodFM_State: State to store between chunk processing +*/ void baseband_demod_FM(uint8_t const *x_buf, int16_t *y_buf, unsigned long num_samples, DemodFM_State *state); -// for evaluation +/// For evaluation. void baseband_demod_FM_cs16(int16_t const *x_buf, int16_t *y_buf, unsigned long num_samples, DemodFM_State *state); -/// Initialize tables and constants -/// Should be called once at startup +/** Initialize tables and constants. + Should be called once at startup. +*/ void baseband_init(void); #endif /* INCLUDE_BASEBAND_H_ */ diff --git a/include/bitbuffer.h b/include/bitbuffer.h index 1c330a6d..0b43732a 100644 --- a/include/bitbuffer.h +++ b/include/bitbuffer.h @@ -1,14 +1,13 @@ -/** - * Bit buffer - * - * A two-dimensional bit buffer consisting of bytes - * - * Copyright (C) 2015 Tommy Vestermark - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + A two-dimensional bit buffer consisting of bytes. + + Copyright (C) 2015 Tommy Vestermark + + 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 of the License, or + (at your option) any later version. +*/ #ifndef INCLUDE_BITBUFFER_H_ #define INCLUDE_BITBUFFER_H_ @@ -22,7 +21,7 @@ typedef uint8_t bitrow_t[BITBUF_COLS]; typedef bitrow_t bitarray_t[BITBUF_ROWS]; -/// Bit buffer +/// Bit buffer. typedef struct bitbuffer { uint16_t num_rows; // Number of active rows uint16_t bits_per_row[BITBUF_ROWS]; // Number of active bits per row @@ -30,73 +29,74 @@ typedef struct bitbuffer { bitarray_t bb; // The actual bits buffer } bitbuffer_t; -/// Clear the content of the bitbuffer +/// Clear the content of the bitbuffer. void bitbuffer_clear(bitbuffer_t *bits); -/// Add a single bit at the end of the bitbuffer (MSB first) +/// Add a single bit at the end of the bitbuffer (MSB first). void bitbuffer_add_bit(bitbuffer_t *bits, int bit); -/// Add a new row to the bitbuffer +/// Add a new row to the bitbuffer. void bitbuffer_add_row(bitbuffer_t *bits); -/// Increment sync counter, add new row if not empty +/// Increment sync counter, add new row if not empty. void bitbuffer_add_sync(bitbuffer_t *bits); /// Extract (potentially unaligned) bytes from the bit buffer. Len is bits. void bitbuffer_extract_bytes(bitbuffer_t *bitbuffer, unsigned row, unsigned pos, uint8_t *out, unsigned len); -/// Invert all bits in the bitbuffer (do not invert the empty bits) +/// Invert all bits in the bitbuffer (do not invert the empty bits). void bitbuffer_invert(bitbuffer_t *bits); -// Non-Return-to-Zero Space (NRZI) decode the bitbuffer. -// "One" is represented by no change in level, "Zero" is represented by change in level. +/// Non-Return-to-Zero Space (NRZI) decode the bitbuffer. +/// "One" is represented by no change in level, "Zero" is represented by change in level. void bitbuffer_nrzs_decode(bitbuffer_t *bits); -// Non-Return-to-Zero Mark (NRZI) decode the bitbuffer. -// "One" is represented by change in level, "Zero" is represented by no change in level. +/// Non-Return-to-Zero Mark (NRZI) decode the bitbuffer. +/// "One" is represented by change in level, "Zero" is represented by no change in level. void bitbuffer_nrzm_decode(bitbuffer_t *bits); -/// Print the content of the bitbuffer +/// Print the content of the bitbuffer. void bitbuffer_print(const bitbuffer_t *bits); -/// Debug the content of the bitbuffer +/// Debug the content of the bitbuffer. void bitbuffer_debug(const bitbuffer_t *bits); -/// Print the content of a bit row (byte buffer) +/// Print the content of a bit row (byte buffer). void bitrow_print(bitrow_t const bitrow, unsigned bit_len); -/// Debug the content of a bit row (byte buffer) +/// Debug the content of a bit row (byte buffer). void bitrow_debug(bitrow_t const bitrow, unsigned bit_len); -/// Parse a string into a bitbuffer +/// Parse a string into a bitbuffer. void bitbuffer_parse(bitbuffer_t *bits, const char *code); -// Search the specified row of the bitbuffer, starting from bit 'start', for -// the pattern provided. Return the location of the first match, or the end -// of the row if no match is found. -// The pattern starts in the high bit. For example if searching for 011011 -// the byte pointed to by 'pattern' would be 0xAC. (011011xx). +/// Search the specified row of the bitbuffer, starting from bit 'start', for +/// the pattern provided. Return the location of the first match, or the end +/// of the row if no match is found. +/// The pattern starts in the high bit. For example if searching for 011011 +/// the byte pointed to by 'pattern' would be 0xAC. (011011xx). unsigned bitbuffer_search(bitbuffer_t *bitbuffer, unsigned row, unsigned start, const uint8_t *pattern, unsigned pattern_bits_len); -// Manchester decoding from one bitbuffer into another, starting at the -// specified row and start bit. Decode at most 'max' data bits (i.e. 2*max) -// bits from the input buffer). Return the bit position in the input row -// (i.e. returns start + 2*outbuf->bits_per_row[0]). -// per IEEE 802.3 conventions, i.e. high-low is a 0 bit, low-high is a 1 bit. +/// Manchester decoding from one bitbuffer into another, starting at the +/// specified row and start bit. Decode at most 'max' data bits (i.e. 2*max) +/// bits from the input buffer). Return the bit position in the input row +/// (i.e. returns start + 2*outbuf->bits_per_row[0]). +/// per IEEE 802.3 conventions, i.e. high-low is a 0 bit, low-high is a 1 bit. unsigned bitbuffer_manchester_decode(bitbuffer_t *inbuf, unsigned row, unsigned start, bitbuffer_t *outbuf, unsigned max); -// Differential Manchester decoding from one bitbuffer into another, starting at the -// specified row and start bit. Decode at most 'max' data bits (i.e. 2*max) -// bits from the input buffer). Return the bit position in the input row -// (i.e. returns start + 2*outbuf->bits_per_row[0]). +/// Differential Manchester decoding from one bitbuffer into another, starting at the +/// specified row and start bit. Decode at most 'max' data bits (i.e. 2*max) +/// bits from the input buffer). Return the bit position in the input row +/// (i.e. returns start + 2*outbuf->bits_per_row[0]). unsigned bitbuffer_differential_manchester_decode(bitbuffer_t *inbuf, unsigned row, unsigned start, bitbuffer_t *outbuf, unsigned max); -// Function to compare bitbuffer rows and count repetitions +/// Function to compare bitbuffer rows and count repetitions. int compare_rows(bitbuffer_t *bits, unsigned row_a, unsigned row_b); + unsigned count_repeats(bitbuffer_t *bits, unsigned row); /// Find a repeated row that has a minimum count of bits. @@ -104,13 +104,13 @@ unsigned count_repeats(bitbuffer_t *bits, unsigned row); int bitbuffer_find_repeated_row(bitbuffer_t *bits, unsigned min_repeats, unsigned min_bits); -/// Return a single bit from a bitrow at bit_idx position +/// Return a single bit from a bitrow at bit_idx position. static inline uint8_t bitrow_get_bit(const bitrow_t bitrow, unsigned bit_idx) { return bitrow[bit_idx >> 3] >> (7 - (bit_idx & 7)) & 1; } -/// Return a single byte from a bitrow at bit_idx position (which may be unaligned) +/// Return a single byte from a bitrow at bit_idx position (which may be unaligned). static inline uint8_t bitrow_get_byte(const bitrow_t bitrow, unsigned bit_idx) { return ((bitrow[(bit_idx >> 3)] << (bit_idx & 7)) | diff --git a/include/compat_paths.h b/include/compat_paths.h index e39e36a8..42ba7a7a 100644 --- a/include/compat_paths.h +++ b/include/compat_paths.h @@ -1,12 +1,15 @@ -// compat_paths addresses following compatibility issue: -// topic: default search paths for config file -// issue: Linux and Windows use different common paths for config files -// solution: provide specific default paths for each system +/** @file + compat_paths addresses compatibility with default OS path names. + + topic: default search paths for config file + issue: Linux and Windows use different common paths for config files + solution: provide specific default paths for each system +*/ #ifndef INCLUDE_COMPAT_PATHS_H_ #define INCLUDE_COMPAT_PATHS_H_ -/// get default search paths for rtl_433 config file +/// Get default search paths for rtl_433 config file. char **compat_get_default_conf_paths(void); #endif /* INCLUDE_COMPAT_PATHS_H_ */ diff --git a/include/compat_time.h b/include/compat_time.h index 8ded9a9c..461e15af 100644 --- a/include/compat_time.h +++ b/include/compat_time.h @@ -1,7 +1,10 @@ -// compat_time addresses following compatibility issue: -// topic: high-resolution timestamps -// issue: <sys/time.h> is not available on Windows systems -// solution: provide a compatible version for Windows systems +/** @file + compat_time addresses compatibility time functions. + + topic: high-resolution timestamps + issue: <sys/time.h> is not available on Windows systems + solution: provide a compatible version for Windows systems +*/ #ifndef INCLUDE_COMPAT_TIME_H_ #define INCLUDE_COMPAT_TIME_H_ diff --git a/include/confparse.h b/include/confparse.h index 53181bfd..33d031da 100644 --- a/include/confparse.h +++ b/include/confparse.h @@ -1,13 +1,13 @@ -/** - * Light-weight (i.e. dumb) config-file parser - * - * Copyright (C) 2018 Christian W. Zuckschwerdt <zany@triq.net> - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Light-weight (i.e. dumb) config-file parser. + + Copyright (C) 2018 Christian W. Zuckschwerdt <zany@triq.net> + + 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 of the License, or + (at your option) any later version. +*/ #ifndef INCLUDE_CONFPARSE_H_ #define INCLUDE_CONFPARSE_H_ @@ -17,22 +17,27 @@ struct conf_keywords { int key; }; -/// Check if a file exists and can be read. -/// @param path input file name -/// @return 1 if the file exists and is readable, 0 otherwise +/** Check if a file exists and can be read. + + @param path input file name + @return 1 if the file exists and is readable, 0 otherwise +*/ int hasconf(char const *path); -/// Open a config file, read contents to memory. -/// @param path input file name -/// @return allocated memory containing the config file +/** Open a config file, read contents to memory. + + @param path input file name + @return allocated memory containing the config file +*/ char *readconf(char const *path); -/// Return the next keyword token and set the optional argument. -/// -/// @param conf current position in conf -/// @param keywords list of possible keywords -/// @param arg optional out pointer to a argument string -/// @return the next keyword token, -1 otherwise. +/** Return the next keyword token and set the optional argument. + + @param conf current position in conf + @param keywords list of possible keywords + @param arg optional out pointer to a argument string + @return the next keyword token, -1 otherwise. +*/ int getconf(char **conf, struct conf_keywords const keywords[], char **arg); #endif /* INCLUDE_CONFPARSE_H_ */ diff --git a/include/data.h b/include/data.h index b06e6fd9..174d829d 100644 --- a/include/data.h +++ b/include/data.h @@ -1,22 +1,22 @@ -/* - * A general structure for extracting hierarchical data from the devices; - * typically key-value pairs, but allows for more rich data as well. - * - * Copyright (C) 2015 by Erkki Seppälä <flux@modeemi.fi> - * - * 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 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ +/** @file + A general structure for extracting hierarchical data from the devices; + typically key-value pairs, but allows for more rich data as well. + + Copyright (C) 2015 by Erkki Seppälä <flux@modeemi.fi> + + 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 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ #ifndef INCLUDE_DATA_H_ #define INCLUDE_DATA_H_ @@ -35,7 +35,7 @@ // MSVC has something like C99 restrict as __restrict #ifndef restrict - #define restrict __restrict + #define restrict __restrict #endif #endif @@ -52,13 +52,13 @@ #endif typedef enum { - DATA_DATA, /* pointer to data is stored */ - DATA_INT, /* pointer to integer is stored */ - DATA_DOUBLE, /* pointer to a double is stored */ - DATA_STRING, /* pointer to a string is stored */ - DATA_ARRAY, /* pointer to an array of values is stored */ - DATA_COUNT, /* invalid */ - DATA_FORMAT /* indicates the following value is formatted */ + DATA_DATA, /**< pointer to data is stored */ + DATA_INT, /**< pointer to integer is stored */ + DATA_DOUBLE, /**< pointer to a double is stored */ + DATA_STRING, /**< pointer to a string is stored */ + DATA_ARRAY, /**< pointer to an array of values is stored */ + DATA_COUNT, /**< invalid */ + DATA_FORMAT /**< indicates the following value is formatted */ } data_type_t; typedef struct data_array { @@ -69,12 +69,12 @@ typedef struct data_array { typedef struct data { char *key; - char *pretty_key; /* the name used for displaying data to user in with a nicer name */ + char *pretty_key; /**< the name used for displaying data to user in with a nicer name */ data_type_t type; - char *format; /* if not null, contains special formatting string */ + char *format; /**< if not null, contains special formatting string */ void *value; - unsigned retain; /* incremented on data_retain, data_free only frees if this is zero */ - struct data *next; /* chaining to the next element in the linked list; NULL indicates end-of-list */ + unsigned retain; /**< incremented on data_retain, data_free only frees if this is zero */ + struct data *next; /**< chaining to the next element in the linked list; NULL indicates end-of-list */ } data_t; /** Constructs a structured data object. @@ -132,7 +132,7 @@ data_t *data_prepend(data_t *first, const char *key, const char *pretty_key, ... */ data_array_t *data_array(int num_values, data_type_t type, void *ptr); -/** Releases a data array */ +/** Releases a data array. */ void data_array_free(data_array_t *array); /** Retain a structure object, returns the structure object passed in. */ @@ -155,7 +155,7 @@ typedef struct data_output { FILE *file; } data_output_t; -/** Construct data output for CSV printer +/** Construct data output for CSV printer. @param file the output stream @return The auxiliary data to pass along with data_csv_printer to data_print. @@ -178,10 +178,10 @@ struct data_output *data_output_syslog_create(const char *host, const char *port */ void data_output_start(struct data_output *output, const char **fields, int num_fields); -/** Prints a structured data object */ +/** Prints a structured data object. */ void data_output_print(struct data_output *output, data_t *data); -/** Allows to polls an event loop, if necessary */ +/** Allows to polls an event loop, if necessary. */ void data_output_poll(struct data_output *output); void data_output_free(struct data_output *output); diff --git a/include/decoder.h b/include/decoder.h index 69444ecd..b7321c42 100644 --- a/include/decoder.h +++ b/include/decoder.h @@ -1,3 +1,7 @@ +/** @file + Meta include for all decoders. +*/ + #ifndef INCLUDE_DECODER_H_ #define INCLUDE_DECODER_H_ diff --git a/include/decoder_util.h b/include/decoder_util.h index 30349026..103d93d7 100644 --- a/include/decoder_util.h +++ b/include/decoder_util.h @@ -1,13 +1,13 @@ -/** - * High-level utility functions for decoders - * - * Copyright (C) 2018 Christian Zuckschwerdt - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + High-level utility functions for decoders. + + Copyright (C) 2018 Christian Zuckschwerdt + + 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 of the License, or + (at your option) any later version. +*/ #ifndef INCLUDE_DECODER_UTIL_H_ #define INCLUDE_DECODER_UTIL_H_ diff --git a/include/fileformat.h b/include/fileformat.h index d3e2d98b..952513a4 100644 --- a/include/fileformat.h +++ b/include/fileformat.h @@ -1,13 +1,13 @@ -/** - * Various utility functions handling file formats - * - * Copyright (C) 2018 Christian Zuckschwerdt - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Various utility functions handling file formats. + + Copyright (C) 2018 Christian Zuckschwerdt + + 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 of the License, or + (at your option) any later version. +*/ #ifndef INCLUDE_FILEFORMAT_H_ #define INCLUDE_FILEFORMAT_H_ @@ -17,8 +17,8 @@ char const *file_basename(char const *path); -// a single handy number to define the file type. -// bitmask: RRRR LLLL WWWWWWWW 00CC 00FS +/// a single handy number to define the file type. +/// bitmask: RRRR LLLL WWWWWWWW 00CC 00FS enum file_type { // format bits F_UNSIGNED = 0 << 0, diff --git a/include/list.h b/include/list.h index 401f3a15..a770ebed 100644 --- a/include/list.h +++ b/include/list.h @@ -1,13 +1,13 @@ -/** - * Generic list - * - * Copyright (C) 2018 Christian Zuckschwerdt - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Generic list. + + Copyright (C) 2018 Christian Zuckschwerdt + + 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 of the License, or + (at your option) any later version. +*/ #include <stddef.h> diff --git a/include/optparse.h b/include/optparse.h index ef1d49fd..49231b8b 100644 --- a/include/optparse.h +++ b/include/optparse.h @@ -1,13 +1,13 @@ -/** - * Option parsing functions to complement getopt. - * - * Copyright (C) 2017 Christian Zuckschwerdt - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Option parsing functions to complement getopt. + + Copyright (C) 2017 Christian Zuckschwerdt + + 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 of the License, or + (at your option) any later version. +*/ #ifndef INCLUDE_OPTPARSE_H_ #define INCLUDE_OPTPARSE_H_ @@ -52,7 +52,7 @@ int atoi_time(const char *str, const char *error_hint); /// @return the original value of *stringp char *asepc(char **stringp, char delim); -/// Parse a comma-separated list of key/value pairs into kwargs +/// Parse a comma-separated list of key/value pairs into kwargs. /// /// The input string will be modified and the pointer advanced. /// The key and val pointers will be into the original string. diff --git a/include/pulse_demod.h b/include/pulse_demod.h index 0a62e8ff..78029af2 100644 --- a/include/pulse_demod.h +++ b/include/pulse_demod.h @@ -1,14 +1,15 @@ -/** - * Pulse demodulation functions - * - * Binary demodulators (PWM/PPM/Manchester/...) using a pulse data structure as input - * - * Copyright (C) 2015 Tommy Vestermark - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Pulse demodulation functions. + + Binary demodulators (PWM/PPM/Manchester/...) using a pulse data structure as input + + Copyright (C) 2015 Tommy Vestermark + + 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 of the License, or + (at your option) any later version. +*/ #ifndef INCLUDE_PULSE_DEMOD_H_ #define INCLUDE_PULSE_DEMOD_H_ @@ -16,8 +17,7 @@ #include "pulse_detect.h" #include "rtl_433_devices.h" - -/// Demodulate a Pulse Code Modulation signal +/// Demodulate a Pulse Code Modulation signal. /// /// Demodulate a Pulse Code Modulation (PCM) signal where bit width /// is fixed and each bit starts with a pulse or not. It may be either @@ -32,8 +32,7 @@ /// @return number of events processed int pulse_demod_pcm(const pulse_data_t *pulses, r_device *device); - -/// Demodulate a Pulse Position Modulation signal +/// Demodulate a Pulse Position Modulation signal. /// /// Demodulate a Pulse Position Modulation (PPM) signal consisting of pulses with variable gap. /// Pulse width may be fixed or variable. @@ -48,8 +47,7 @@ int pulse_demod_pcm(const pulse_data_t *pulses, r_device *device); /// @return number of events processed int pulse_demod_ppm(const pulse_data_t *pulses, r_device *device); - -/// Demodulate a Pulse Width Modulation signal +/// Demodulate a Pulse Width Modulation signal. /// /// Demodulate a Pulse Width Modulation (PWM) signal consisting of short, long, and optional sync pulses. /// Gap between pulses may be of fixed size or variable (e.g. fixed period) @@ -65,8 +63,7 @@ int pulse_demod_ppm(const pulse_data_t *pulses, r_device *device); /// @return number of events processed int pulse_demod_pwm(const pulse_data_t *pulses, r_device *device); - -/// Demodulate a Manchester encoded signal with a hardcoded zerobit in front +/// Demodulate a Manchester encoded signal with a hardcoded zerobit in front. /// /// Demodulate a Manchester encoded signal where first rising edge is counted as a databit /// and therefore always will be zero (Most likely a hardcoded Oregon Scientific peculiarity) @@ -81,8 +78,7 @@ int pulse_demod_pwm(const pulse_data_t *pulses, r_device *device); /// @return number of events processed int pulse_demod_manchester_zerobit(const pulse_data_t *pulses, r_device *device); - -/// Demodulate a Differential Manchester Coded signal +/// Demodulate a Differential Manchester Coded signal. /// /// No level shift within the clock cycle translates to a logic 0 /// One level shift within the clock cycle translates to a logic 1 @@ -103,8 +99,7 @@ int pulse_demod_manchester_zerobit(const pulse_data_t *pulses, r_device *device) /// @return number of events processed int pulse_demod_dmc(const pulse_data_t *pulses, r_device *device); - -/// Demodulate a raw Pulse Interval and Width Modulation signal +/// Demodulate a raw Pulse Interval and Width Modulation signal. /// /// Each level shift is a new bit. /// A short interval is a logic 1, a long interval a logic 0 @@ -116,8 +111,7 @@ int pulse_demod_dmc(const pulse_data_t *pulses, r_device *device); /// @return number of events processed int pulse_demod_piwm_raw(const pulse_data_t *pulses, r_device *device); - -/// Demodulate a differential Pulse Interval and Width Modulation signal +/// Demodulate a differential Pulse Interval and Width Modulation signal. /// /// Each level shift is a new bit. /// A short interval is a logic 1, a long interval a logic 0 @@ -129,11 +123,9 @@ int pulse_demod_piwm_raw(const pulse_data_t *pulses, r_device *device); /// @return number of events processed int pulse_demod_piwm_dc(const pulse_data_t *pulses, r_device *device); - int pulse_demod_osv1(const pulse_data_t *pulses, r_device *device); - -/// Simulate demodulation using a given signal code string +/// Simulate demodulation using a given signal code string. /// /// The (optionally "0x" prefixed) hex code is processed into a bitbuffer_t. /// Each row is optionally prefixed with a length enclosed in braces "{}" or diff --git a/include/pulse_detect.h b/include/pulse_detect.h index 0cc64993..c6cc81a1 100644 --- a/include/pulse_detect.h +++ b/include/pulse_detect.h @@ -1,12 +1,13 @@ -/** - * Pulse detection functions - * - * Copyright (C) 2015 Tommy Vestermark - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Pulse detection functions. + + Copyright (C) 2015 Tommy Vestermark + + 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 of the License, or + (at your option) any later version. +*/ #ifndef INCLUDE_PULSE_DETECT_H_ #define INCLUDE_PULSE_DETECT_H_ @@ -15,27 +16,27 @@ #include <stdio.h> #include "r_util.h" -#define PD_MAX_PULSES 1200 // Maximum number of pulses before forcing End Of Package -#define PD_MIN_PULSES 16 // Minimum number of pulses before declaring a proper package -#define PD_MIN_PULSE_SAMPLES 10 // Minimum number of samples in a pulse for proper detection -#define PD_MIN_GAP_MS 10 // Minimum gap size in milliseconds to exceed to declare End Of Package -#define PD_MAX_GAP_MS 100 // Maximum gap size in milliseconds to exceed to declare End Of Package -#define PD_MAX_GAP_RATIO 10 // Ratio gap/pulse width to exceed to declare End Of Package (heuristic) -#define PD_MAX_PULSE_MS 100 // Pulse width in ms to exceed to declare End Of Package (e.g. for non OOK packages) +#define PD_MAX_PULSES 1200 // Maximum number of pulses before forcing End Of Package +#define PD_MIN_PULSES 16 // Minimum number of pulses before declaring a proper package +#define PD_MIN_PULSE_SAMPLES 10 // Minimum number of samples in a pulse for proper detection +#define PD_MIN_GAP_MS 10 // Minimum gap size in milliseconds to exceed to declare End Of Package +#define PD_MAX_GAP_MS 100 // Maximum gap size in milliseconds to exceed to declare End Of Package +#define PD_MAX_GAP_RATIO 10 // Ratio gap/pulse width to exceed to declare End Of Package (heuristic) +#define PD_MAX_PULSE_MS 100 // Pulse width in ms to exceed to declare End Of Package (e.g. for non OOK packages) -/// Data for a compact representation of generic pulse train +/// Data for a compact representation of generic pulse train. typedef struct { - uint64_t offset; // Offset to first pulse in number of samples from start of stream - uint32_t sample_rate; // Sample rate the pulses are recorded with. - unsigned start_ago; // Start of first pulse in number of samples ago - unsigned end_ago; // End of last pulse in number of samples ago - unsigned int num_pulses; - int pulse[PD_MAX_PULSES]; // Width of pulses (high) in number of samples - int gap[PD_MAX_PULSES]; // Width of gaps between pulses (low) in number of samples - int ook_low_estimate; // Estimate for the OOK low level (base noise level) at beginning of package - int ook_high_estimate; // Estimate for the OOK high level at end of package - int fsk_f1_est; // Estimate for the F1 frequency for FSK - int fsk_f2_est; // Estimate for the F2 frequency for FSK + uint64_t offset; ///< Offset to first pulse in number of samples from start of stream. + uint32_t sample_rate; ///< Sample rate the pulses are recorded with. + unsigned start_ago; ///< Start of first pulse in number of samples ago. + unsigned end_ago; ///< End of last pulse in number of samples ago. + unsigned int num_pulses; + int pulse[PD_MAX_PULSES]; ///< Width of pulses (high) in number of samples. + int gap[PD_MAX_PULSES]; ///< Width of gaps between pulses (low) in number of samples. + int ook_low_estimate; ///< Estimate for the OOK low level (base noise level) at beginning of package. + int ook_high_estimate; ///< Estimate for the OOK high level at end of package. + int fsk_f1_est; ///< Estimate for the F1 frequency for FSK. + int fsk_f2_est; ///< Estimate for the F2 frequency for FSK. float freq1_hz; float freq2_hz; float rssi_db; @@ -45,37 +46,37 @@ typedef struct { typedef struct pulse_detect pulse_detect_t; -/// Clear the content of a pulse_data_t structure -void pulse_data_clear(pulse_data_t *data); // Clear the struct +/// Clear the content of a pulse_data_t structure. +void pulse_data_clear(pulse_data_t *data); -/// Print the content of a pulse_data_t structure (for debug) +/// Print the content of a pulse_data_t structure (for debug). void pulse_data_print(pulse_data_t const *data); -/// Dump the content of a pulse_data_t structure as raw binary +/// Dump the content of a pulse_data_t structure as raw binary. void pulse_data_dump_raw(uint8_t *buf, unsigned len, uint64_t buf_offset, pulse_data_t const *data, uint8_t bits); -/// Print a header for the VCD format +/// Print a header for the VCD format. void pulse_data_print_vcd_header(FILE *file, uint32_t sample_rate); -/// Print the content of a pulse_data_t structure in VCD format +/// Print the content of a pulse_data_t structure in VCD format. void pulse_data_print_vcd(FILE *file, pulse_data_t const *data, int ch_id); -/// Read the next pulse_data_t structure from OOK text +/// Read the next pulse_data_t structure from OOK text. void pulse_data_load(FILE *file, pulse_data_t *data); -/// Print a header for the OOK text format +/// Print a header for the OOK text format. void pulse_data_print_pulse_header(FILE *file); -/// Print the content of a pulse_data_t structure as OOK text +/// Print the content of a pulse_data_t structure as OOK text. void pulse_data_dump(FILE *file, pulse_data_t *data); pulse_detect_t *pulse_detect_create(void); void pulse_detect_free(pulse_detect_t *pulse_detect); -/// Demodulate On/Off Keying (OOK) and Frequency Shift Keying (FSK) from an envelope signal +/// Demodulate On/Off Keying (OOK) and Frequency Shift Keying (FSK) from an envelope signal. /// -/// Function is stateful and can be called with chunks of input data +/// Function is stateful and can be called with chunks of input data. /// @param envelope_data: Samples with amplitude envelope of carrier /// @param fm_data: Samples with frequency offset from center frequency /// @param len: Number of samples in input buffers @@ -87,7 +88,7 @@ void pulse_detect_free(pulse_detect_t *pulse_detect); /// @return 2 if FSK package is detected (but all sample data is still not completely processed) int pulse_detect_package(pulse_detect_t *pulse_detect, int16_t const *envelope_data, int16_t const *fm_data, int len, int16_t level_limit, uint32_t samp_rate, uint64_t sample_offset, pulse_data_t *pulses, pulse_data_t *fsk_pulses); -/// Analyze and print result +/// Analyze and print result. void pulse_analyzer(pulse_data_t *data); diff --git a/include/r_util.h b/include/r_util.h index a5da0b82..bb8bbc8e 100644 --- a/include/r_util.h +++ b/include/r_util.h @@ -1,12 +1,13 @@ -/** - * Various utility functions for use by applications - * - * Copyright (C) 2015 Tommy Vestermark - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Various utility functions for use by applications. + + Copyright (C) 2015 Tommy Vestermark + + 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 of the License, or + (at your option) any later version. +*/ #ifndef INCLUDE_R_UTIL_H_ #define INCLUDE_R_UTIL_H_ @@ -19,124 +20,142 @@ #if defined _MSC_VER // Microsoft Visual Studio // MSC has something like C99 restrict as __restrict #ifndef restrict - #define restrict __restrict + #define restrict __restrict #endif #endif // buffer to hold localized timestamp "YYYY-MM-DD HH:MM:SS.000000" -#define LOCAL_TIME_BUFLEN 32 +#define LOCAL_TIME_BUFLEN 32 -/// Get current time with usec precision. -/// -/// @param tv: output for current time +/** Get current time with usec precision. + + @param tv: output for current time +*/ void get_time_now(struct timeval *tv); -/// Printable timestamp in local time -/// -/// @param time_secs: 0 for now, or seconds since the epoch -/// @param buf: output buffer, long enough for "YYYY-MM-DD HH:MM:SS" -/// @return buf pointer (for short hand use as operator) +/** Printable timestamp in local time. + + @param time_secs: 0 for now, or seconds since the epoch + @param buf: output buffer, long enough for "YYYY-MM-DD HH:MM:SS" + @return buf pointer (for short hand use as operator) +*/ char* local_time_str(time_t time_secs, char *buf); -/// Printable timestamp in local time with microseconds. -/// -/// @param tv: NULL for now, or seconds and microseconds since the epoch -/// @param buf: output buffer, long enough for "YYYY-MM-DD HH:MM:SS" -/// @return buf pointer (for short hand use as operator) +/** Printable timestamp in local time with microseconds. + + @param tv: NULL for now, or seconds and microseconds since the epoch + @param buf: output buffer, long enough for "YYYY-MM-DD HH:MM:SS" + @return buf pointer (for short hand use as operator) +*/ char *usecs_time_str(struct timeval *tv, char *buf); -/// Printable sample position -/// -/// @param sample_pos sample position -/// @param buf: output buffer, long enough for "@0.000000s" -/// @return buf pointer (for short hand use as operator) +/** Printable sample position. + + @param sample_pos sample position + @param buf: output buffer, long enough for "@0.000000s" + @return buf pointer (for short hand use as operator) +*/ char *sample_pos_str(float sample_file_pos, char *buf); -/// Convert Celsius to Fahrenheit -/// -/// @param celsius: temperature in Celsius -/// @return temperature value in Fahrenheit +/** Convert Celsius to Fahrenheit. + + @param celsius: temperature in Celsius + @return temperature value in Fahrenheit +*/ float celsius2fahrenheit(float celsius); -/// Convert Fahrenheit to Celsius -/// -/// @param celsius: temperature in Fahrenheit -/// @return temperature value in Celsius +/** Convert Fahrenheit to Celsius. + + @param celsius: temperature in Fahrenheit + @return temperature value in Celsius +*/ float fahrenheit2celsius(float fahrenheit); -/// Convert Kilometers per hour (kph) to Miles per hour (mph) -/// -/// @param kph: speed in Kilometers per hour -/// @return speed in miles per hour +/** Convert Kilometers per hour (kph) to Miles per hour (mph). + + @param kph: speed in Kilometers per hour + @return speed in miles per hour +*/ float kmph2mph(float kph); -/// Convert Miles per hour (mph) to Kilometers per hour (kmph) -/// -/// @param mph: speed in Kilometers per hour -/// @return speed in kilometers per hour +/** Convert Miles per hour (mph) to Kilometers per hour (kmph). + + @param mph: speed in Kilometers per hour + @return speed in kilometers per hour +*/ float mph2kmph(float kph); -/// Convert millimeters (mm) to inches (inch) -/// -/// @param mm: measurement in millimeters -/// @return measurement in inches +/** Convert millimeters (mm) to inches (inch). + + @param mm: measurement in millimeters + @return measurement in inches +*/ float mm2inch(float mm); -/// Convert inches (inch) to millimeters (mm) -/// -/// @param inch: measurement in inches -/// @return measurement in millimeters +/** Convert inches (inch) to millimeters (mm). + + @param inch: measurement in inches + @return measurement in millimeters +*/ float inch2mm(float inch); -/// Convert kilo Pascal (kPa) to pounds per square inch (PSI) -/// -/// @param kpa: pressure in kPa -/// @return pressure in PSI +/** Convert kilo Pascal (kPa) to pounds per square inch (PSI). + + @param kpa: pressure in kPa + @return pressure in PSI +*/ float kpa2psi(float kpa); -/// Convert pounds per square inch (PSI) to kilo Pascal (kPa) -/// -/// @param psi: pressure in PSI -/// @return pressure in kPa +/** Convert pounds per square inch (PSI) to kilo Pascal (kPa). + + @param psi: pressure in PSI + @return pressure in kPa +*/ float psi2kpa(float psi); -/// Convert hecto Pascal (hPa) to inches of mercury (inHg) -/// -/// @param kpa: pressure in kPa -/// @return pressure in inHg +/** Convert hecto Pascal (hPa) to inches of mercury (inHg). + + @param kpa: pressure in kPa + @return pressure in inHg +*/ float hpa2inhg(float hpa); -/// Convert inches of mercury (inHg) to hecto Pascal (hPa) -/// -/// @param kpa: pressure in inHg -/// @return pressure in hPa +/** Convert inches of mercury (inHg) to hecto Pascal (hPa). + + @param kpa: pressure in inHg + @return pressure in hPa +*/ float inhg2hpa(float inhg); -/// Return true if the string ends with the specified suffix, otherwise return false. -/// -/// @param str: string to search for patterns -/// @param suffix: the pattern to search -/// @return true if the string ends with the specified suffix, false otherwise. +/** Return true if the string ends with the specified suffix, otherwise return false. + + @param str: string to search for patterns + @param suffix: the pattern to search + @return true if the string ends with the specified suffix, false otherwise. +*/ bool str_endswith(const char *restrict str, const char *restrict suffix); -/// Replace a pattern in a string. This utility function is -/// useful when converting native units to si or customary. -/// -/// @param orig: string to search for patterns -/// @param rep: the pattern to replace -/// @param with: the replacement pattern -/// @return a new string that has rep replaced with with +/** Replace a pattern in a string. + + This utility function is useful when converting native units to si or customary. + + @param orig: string to search for patterns + @param rep: the pattern to replace + @param with: the replacement pattern + @return a new string that has rep replaced with with +*/ char *str_replace(char *orig, char *rep, char *with); -/// Make a nice printable string for a frequency. -/// -/// @param freq: the frequency to convert to a string. +/** Make a nice printable string for a frequency. + + @param freq: the frequency to convert to a string. +*/ const char *nice_freq (double freq); #endif /* INCLUDE_R_UTIL_H_ */ diff --git a/include/rtl_433.h b/include/rtl_433.h index b43e1752..d1dd0cef 100644 --- a/include/rtl_433.h +++ b/include/rtl_433.h @@ -1,3 +1,7 @@ +/** @file + Definition of r_cfg application structure. +*/ + #ifndef INCLUDE_RTL_433_H_ #define INCLUDE_RTL_433_H_ @@ -62,7 +66,7 @@ typedef struct r_cfg { uint32_t bytes_to_read; struct sdr_dev *dev; int grab_mode; - int verbosity; // 0=normal, 1=verbose, 2=verbose decoders, 3=debug decoders, 4=trace decoding + int verbosity; ///< 0=normal, 1=verbose, 2=verbose decoders, 3=debug decoders, 4=trace decoding. int verbose_bits; conversion_mode_t conversion_mode; int report_meta; diff --git a/include/rtl_433_devices.h b/include/rtl_433_devices.h index 1e44cf06..15e173d4 100644 --- a/include/rtl_433_devices.h +++ b/include/rtl_433_devices.h @@ -1,3 +1,7 @@ +/** @file + Definition of r_device and all available decoders. +*/ + #ifndef INCLUDE_RTL_433_DEVICES_H_ #define INCLUDE_RTL_433_DEVICES_H_ @@ -127,7 +131,7 @@ struct bitbuffer; struct data; typedef struct r_device { - unsigned protocol_num; // fixed sequence number, assigned in main() + unsigned protocol_num; ///< fixed sequence number, assigned in main(). /* information provided by each decoder */ char *name; @@ -141,7 +145,7 @@ typedef struct r_device { int (*decode_fn)(struct r_device *decoder, struct bitbuffer *bitbuffer); struct r_device *(*create_fn)(char *args); unsigned disabled; - char **fields; // List of fields this decoder produces; required for CSV output. NULL-terminated. + char **fields; ///< List of fields this decoder produces; required for CSV output. NULL-terminated. /* public for each decoder */ int verbose; @@ -153,8 +157,8 @@ typedef struct r_device { void *output_ctx; /* private pulse limits (converted to count of samples) */ - float f_short_width; // precision reciprocal for PCM - float f_long_width; // precision reciprocal for PCM + float f_short_width; ///< precision reciprocal for PCM. + float f_long_width; ///< precision reciprocal for PCM. int s_short_width; int s_long_width; int s_reset_limit; diff --git a/include/samp_grab.h b/include/samp_grab.h index f127a1a2..62755d94 100644 --- a/include/samp_grab.h +++ b/include/samp_grab.h @@ -1,13 +1,13 @@ -/** - * IQ sample grabber (ring buffer and dumper) - * - * Copyright (C) 2018 Christian Zuckschwerdt - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + IQ sample grabber (ring buffer and dumper). + + Copyright (C) 2018 Christian Zuckschwerdt + + 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 of the License, or + (at your option) any later version. +*/ #ifndef INCLUDE_SAMP_GRAB_H_ #define INCLUDE_SAMP_GRAB_H_ @@ -34,7 +34,7 @@ void samp_grab_push(samp_grab_t *g, unsigned char *iq_buf, uint32_t len); void samp_grab_reset(samp_grab_t *g); -// grab_end is counted in samples from end of buf +/// grab_end is counted in samples from end of buf. void samp_grab_write(samp_grab_t *g, unsigned grab_len, unsigned grab_end); #endif /* INCLUDE_SAMP_GRAB_H_ */ diff --git a/include/sdr.h b/include/sdr.h index 1bedcde3..0bd0c3e3 100644 --- a/include/sdr.h +++ b/include/sdr.h @@ -1,13 +1,13 @@ -/** - * SDR input from RTLSDR or SoapySDR - * - * Copyright (C) 2018 Christian Zuckschwerdt - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + SDR input from RTLSDR or SoapySDR. + + Copyright (C) 2018 Christian Zuckschwerdt + + 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 of the License, or + (at your option) any later version. +*/ #ifndef INCLUDE_SDR_H_ #define INCLUDE_SDR_H_ @@ -17,114 +17,102 @@ typedef struct sdr_dev sdr_dev_t; typedef void (*sdr_read_cb_t)(unsigned char *buf, uint32_t len, void *ctx); -/*! - * Find the closest matching device, optionally report status - * - * \param out_dev device output returned - * \param sample_size stream output sample width returned - * \param dev_query a string to be parsed as device spec - * \param verbose the verbosity level for reports to stderr - * \return dev 0 if successful - */ +/** Find the closest matching device, optionally report status. + + @param out_dev device output returned + @param sample_size stream output sample width returned + @param dev_query a string to be parsed as device spec + @param verbose the verbosity level for reports to stderr + @return dev 0 if successful +*/ int sdr_open(sdr_dev_t **out_dev, int *sample_size, char *dev_query, int verbose); -/*! - * Close the device, optionally report status - * - * \param dev the device handle - * \param verbose the verbosity level for reports to stderr - * \return 0 on success - */ +/** Close the device, optionally report status. + + @param dev the device handle + @param verbose the verbosity level for reports to stderr + @return 0 on success +*/ int sdr_close(sdr_dev_t *dev); -/*! - * Set device frequency, optionally report status - * - * \param dev the device handle - * \param frequency in Hz - * \param verbose the verbosity level for reports to stderr - * \return 0 on success - */ +/** Set device frequency, optionally report status. + + @param dev the device handle + @param frequency in Hz + @param verbose the verbosity level for reports to stderr + @return 0 on success +*/ int sdr_set_center_freq(sdr_dev_t *dev, uint32_t freq, int verbose); -/*! - * Get device frequency - * - * \param dev the device handle - * \return frequency in Hz on success, 0 otherwise - */ +/** Get device frequency. + + @param dev the device handle + @return frequency in Hz on success, 0 otherwise +*/ uint32_t sdr_get_center_freq(sdr_dev_t *dev); -/*! - * Set the frequency correction value for the device, optionally report status - * - * \param dev the device handle - * \param ppm_error correction value in parts per million (ppm) - * \param verbose the verbosity level for reports to stderr - * \return 0 on success - */ +/** Set the frequency correction value for the device, optionally report status. + + @param dev the device handle + @param ppm_error correction value in parts per million (ppm) + @param verbose the verbosity level for reports to stderr + @return 0 on success +*/ int sdr_set_freq_correction(sdr_dev_t *dev, int ppm, int verbose); -/*! - * Enable auto gain, optionally report status - * - * \param dev the device handle - * \param verbose the verbosity level for reports to stderr - * \return 0 on success - */ +/** Enable auto gain, optionally report status. + + @param dev the device handle + @param verbose the verbosity level for reports to stderr + @return 0 on success +*/ int sdr_set_auto_gain(sdr_dev_t *dev, int verbose); -/*! - * Set tuner gain or gain elements, optionally report status - * - * \param dev the device handle - * \param gain_str in tenths of a dB for RTL-SDR, string of gain element pairs (example LNA=40,VGA=20,AMP=0), or string of overall gain, in dB - * \param verbose the verbosity level for reports to stderr - * \return 0 on success - */ +/** Set tuner gain or gain elements, optionally report status. + + @param dev the device handle + @param gain_str in tenths of a dB for RTL-SDR, string of gain element pairs (example LNA=40,VGA=20,AMP=0), or string of overall gain, in dB + @param verbose the verbosity level for reports to stderr + @return 0 on success +*/ int sdr_set_tuner_gain(sdr_dev_t *dev, char *gain_str, int verbose); -/*! - * Set device sample rate, optionally report status - * - * \param dev the device handle - * \param samp_rate in samples/second - * \param verbose the verbosity level for reports to stderr - * \return 0 on success - */ +/** Set device sample rate, optionally report status. + + @param dev the device handle + @param samp_rate in samples/second + @param verbose the verbosity level for reports to stderr + @return 0 on success +*/ int sdr_set_sample_rate(sdr_dev_t *dev, uint32_t rate, int verbose); -/*! - * Get device sample rate - * - * \param dev the device handle - * \return sample rate in samples/second on success, 0 otherwise - */ +/** Get device sample rate. + + @param dev the device handle + @return sample rate in samples/second on success, 0 otherwise +*/ uint32_t sdr_get_sample_rate(sdr_dev_t *dev); -/*! - * Activate stream (only needed for SoapySDR) - * - * \param dev the device handle - * \return 0 on success - */ +/** Activate stream (only needed for SoapySDR). + + @param dev the device handle + @return 0 on success +*/ int sdr_activate(sdr_dev_t *dev); -/*! - * Deactivate stream (only needed for SoapySDR) - * - * \param dev the device handle - * \return 0 on success - */ +/** Deactivate stream (only needed for SoapySDR). + + @param dev the device handle + @return 0 on success +*/ int sdr_deactivate(sdr_dev_t *dev); -/*! - * Reset buffer (only needed for RTL-SDR), optionally report status - * - * \param dev the device handle - * \param verbose the verbosity level for reports to stderr - * \return 0 on success - */ +/** Reset buffer (only needed for RTL-SDR), optionally report status. + + @param dev the device handle + @param verbose the verbosity level for reports to stderr + @return 0 on success +*/ int sdr_reset(sdr_dev_t *dev, int verbose); int sdr_start(sdr_dev_t *dev, sdr_read_cb_t cb, void *ctx, uint32_t buf_num, uint32_t buf_len); diff --git a/include/term_ctl.h b/include/term_ctl.h index 6d7a2f2c..16de6075 100644 --- a/include/term_ctl.h +++ b/include/term_ctl.h @@ -1,13 +1,13 @@ -/** - * Terminal control utility functions. - * - * Copyright (C) 2018 Christian Zuckschwerdt - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Terminal control utility functions. + + Copyright (C) 2018 Christian Zuckschwerdt + + 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 of the License, or + (at your option) any later version. +*/ #ifndef INCLUDE_TERM_CTL_H_ #define INCLUDE_TERM_CTL_H_ @@ -55,7 +55,7 @@ void term_set_bg(void *ctx, term_color_t color); #define _Printf_format_string_ #endif -/* +/** * Print to terminal with color-codes inline turned into above colors. * Takes a var-arg format. * @@ -70,18 +70,19 @@ void term_set_bg(void *ctx, term_color_t color); * will print "Hello world" to stder' with no colors. */ int term_printf(void *ctx, _Printf_format_string_ const char *format, ...) - #if defined(__GNUC__) || defined(__clang__) +#if defined(__GNUC__) || defined(__clang__) __attribute__ ((format(printf,2,3))) - #endif - ; +#endif + ; -/* +/** * Like 'term_printf()', but no var-arg format. * Simply takes a 0-terminated buffer. */ int term_puts(void *ctx, const char *buf); -/* +/** + * Change the default color map. * By default, the color-codes maps to these foreground colour: * "~0": always restores terminal-colors; TERM_COLOR_RESET. * "~1": print using TERM_COLOR_GREEN. @@ -92,13 +93,11 @@ int term_puts(void *ctx, const char *buf); * "~6": print using TERM_COLOR_YELLOW. * "~7": print using TERM_COLOR_BLACK. * "~8": print using TERM_COLOR_RED. - * - * This function can change that. */ int term_set_color_map(int idx, term_color_t color); -/* - * Returns the current color-value ('enum term_color') for color-index +/** + * Returns the current color-value ('enum term_color') for color-index. * 'idx'. This index goes from ASCII '0' to 'X'. * 'X' = '0' + the dimension of the internal 'color_map[]'. */ diff --git a/include/util.h b/include/util.h index 04e474b6..784feafd 100644 --- a/include/util.h +++ b/include/util.h @@ -1,12 +1,13 @@ -/** - * Various utility functions for use by device drivers - * - * Copyright (C) 2015 Tommy Vestermark - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Various utility functions for use by device drivers. + + Copyright (C) 2015 Tommy Vestermark + + 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 of the License, or + (at your option) any later version. +*/ #ifndef INCLUDE_UTIL_H_ #define INCLUDE_UTIL_H_ @@ -33,7 +34,7 @@ uint8_t reverse8(uint8_t x); /// @param num_bytes number of bytes to reflect void reflect_bytes(uint8_t message[], unsigned num_bytes); -/// CRC-4 +/// CRC-4. /// /// @param message[]: array of bytes to check /// @param nBytes: number of bytes in message @@ -42,7 +43,7 @@ void reflect_bytes(uint8_t message[], unsigned num_bytes); /// @return CRC value uint8_t crc4(uint8_t const message[], unsigned nBytes, uint8_t polynomial, uint8_t init); -/// CRC-7 +/// CRC-7. /// /// @param message[]: array of bytes to check /// @param nBytes: number of bytes in message @@ -51,10 +52,10 @@ uint8_t crc4(uint8_t const message[], unsigned nBytes, uint8_t polynomial, uint8 /// @return CRC value uint8_t crc7(uint8_t const message[], unsigned nBytes, uint8_t polynomial, uint8_t init); -/// Generic Cyclic Redundancy Check CRC-8 +/// Generic Cyclic Redundancy Check CRC-8. /// -/// Example polynomial: 0x31 = x8 + x5 + x4 + 1 (x8 is implicit) -/// Example polynomial: 0x80 = x8 + x7 (a normal bit-by-bit parity XOR) +/// Example polynomial: 0x31 = x8 + x5 + x4 + 1 (x8 is implicit) +/// Example polynomial: 0x80 = x8 + x7 (a normal bit-by-bit parity XOR) /// /// @param message[]: array of bytes to check /// @param nBytes: number of bytes in message @@ -73,7 +74,7 @@ uint8_t crc8(uint8_t const message[], unsigned nBytes, uint8_t polynomial, uint8 /// @return CRC value uint8_t crc8le(uint8_t const message[], unsigned nBytes, uint8_t polynomial, uint8_t init); -/// CRC-16 LSB +/// CRC-16 LSB. /// Input and output are reflected, i.e. least significant bit is shifted in first. /// Note that poly and init already need to be reflected. /// @@ -84,7 +85,7 @@ uint8_t crc8le(uint8_t const message[], unsigned nBytes, uint8_t polynomial, uin /// @return CRC value uint16_t crc16lsb(uint8_t const message[], unsigned nBytes, uint16_t polynomial, uint16_t init); -/// CRC-16 +/// CRC-16. /// /// @param message[]: array of bytes to check /// @param nBytes: number of bytes in message diff --git a/src/abuf.c b/src/abuf.c index e7b8614c..23caeea2 100644 --- a/src/abuf.c +++ b/src/abuf.c @@ -1,13 +1,13 @@ -/** - * array buffer (string builder). - * - * Copyright (C) 2018 Christian Zuckschwerdt - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + array buffer (string builder). + + Copyright (C) 2018 Christian Zuckschwerdt + + 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 of the License, or + (at your option) any later version. +*/ #include <stdio.h> #include <stdarg.h> diff --git a/src/am_analyze.c b/src/am_analyze.c index a123f422..a972f700 100644 --- a/src/am_analyze.c +++ b/src/am_analyze.c @@ -1,13 +1,13 @@ -/** - * AM signal analyzer - * - * Copyright (C) 2018 Christian Zuckschwerdt - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + AM signal analyzer. + + Copyright (C) 2018 Christian Zuckschwerdt + + 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 of the License, or + (at your option) any later version. +*/ #include <stdlib.h> #include <stdio.h> diff --git a/src/baseband.c b/src/baseband.c index 99670ba3..d1c14b03 100644 --- a/src/baseband.c +++ b/src/baseband.c @@ -1,16 +1,14 @@ -/** - * Baseband - * - * Various functions for baseband sample processing - * - * Copyright (C) 2012 by Benjamin Larsson <benjamin@southpole.se> - * Copyright (C) 2015 Tommy Vestermark - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Various functions for baseband sample processing. + + Copyright (C) 2012 by Benjamin Larsson <benjamin@southpole.se> + Copyright (C) 2015 Tommy Vestermark + + 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 of the License, or + (at your option) any later version. +*/ #include "baseband.h" #include <stdio.h> @@ -18,10 +16,9 @@ #include <string.h> #include <math.h> - static uint16_t scaled_squares[256]; -/* precalculate lookup table for envelope detection */ +/** precalculate lookup table for envelope detection. */ static void calc_squares() { int i; @@ -29,11 +26,11 @@ static void calc_squares() scaled_squares[i] = (127 - i) * (127 - i); } -/** This will give a noisy envelope of OOK/ASK signals - * Subtract the bias (-128) and get an envelope estimation - * The output will be written in the input buffer - * @returns pointer to the input buffer - */ +/** This will give a noisy envelope of OOK/ASK signals. + Subtract the bias (-128) and get an envelope estimation + The output will be written in the input buffer + @returns pointer to the input buffer +*/ void envelope_detect(uint8_t const *iq_buf, uint16_t *y_buf, uint32_t len) { unsigned long i; @@ -43,9 +40,9 @@ void envelope_detect(uint8_t const *iq_buf, uint16_t *y_buf, uint32_t len) } /** This will give a noisy envelope of OOK/ASK signals. - * Subtracts the bias (-128) and calculates the norm (scaled by 16384). - * Using a LUT is slower for O1 and above. - */ + Subtracts the bias (-128) and calculates the norm (scaled by 16384). + Using a LUT is slower for O1 and above. +*/ void envelope_detect_nolut(uint8_t const *iq_buf, uint16_t *y_buf, uint32_t len) { unsigned long i; @@ -56,8 +53,9 @@ void envelope_detect_nolut(uint8_t const *iq_buf, uint16_t *y_buf, uint32_t len) } } -// note that magnitude emphasizes quiet signals / deemphasizes loud signals -// 122/128, 51/128 Magnitude Estimator for CU8 (SIMD has min/max) +/** 122/128, 51/128 Magnitude Estimator for CU8 (SIMD has min/max). + Note that magnitude emphasizes quiet signals / deemphasizes loud signals. +*/ void magnitude_est_cu8(uint8_t const *iq_buf, uint16_t *y_buf, uint32_t len) { unsigned long i; @@ -71,7 +69,7 @@ void magnitude_est_cu8(uint8_t const *iq_buf, uint16_t *y_buf, uint32_t len) } } -// True Magnitude for CU8 (sqrt can SIMD but float is slow) +/// True Magnitude for CU8 (sqrt can SIMD but float is slow). void magnitude_true_cu8(uint8_t const *iq_buf, uint16_t *y_buf, uint32_t len) { unsigned long i; @@ -82,7 +80,7 @@ void magnitude_true_cu8(uint8_t const *iq_buf, uint16_t *y_buf, uint32_t len) } } -// 122/128, 51/128 Magnitude Estimator for CS16 (SIMD has min/max) +/// 122/128, 51/128 Magnitude Estimator for CS16 (SIMD has min/max). void magnitude_est_cs16(int16_t const *iq_buf, uint16_t *y_buf, uint32_t len) { unsigned long i; @@ -96,7 +94,7 @@ void magnitude_est_cs16(int16_t const *iq_buf, uint16_t *y_buf, uint32_t len) } } -// True Magnitude for CS16 (sqrt can SIMD but float is slow) +/// True Magnitude for CS16 (sqrt can SIMD but float is slow). void magnitude_true_cs16(int16_t const *iq_buf, uint16_t *y_buf, uint32_t len) { unsigned long i; @@ -113,15 +111,15 @@ void magnitude_true_cs16(int16_t const *iq_buf, uint16_t *y_buf, uint32_t len) #define S_CONST (1 << F_SCALE) #define FIX(x) ((int)(x * S_CONST)) -/** Something that might look like a IIR lowpass filter - * - * [b,a] = butter(1, Wc) # low pass filter with cutoff pi*Wc radians - * Q1.15*Q15.0 = Q16.15 - * Q16.15>>1 = Q15.14 - * Q15.14 + Q15.14 + Q15.14 could possibly overflow to 17.14 - * but the b coeffs are small so it wont happen - * Q15.14>>14 = Q15.0 \o/ - */ +/** Something that might look like a IIR lowpass filter. + + [b,a] = butter(1, Wc) # low pass filter with cutoff pi*Wc radians + Q1.15*Q15.0 = Q16.15 + Q16.15>>1 = Q15.14 + Q15.14 + Q15.14 + Q15.14 could possibly overflow to 17.14 + but the b coeffs are small so it wont happen + Q15.14>>14 = Q15.0 \o/ +*/ void baseband_low_pass_filter(uint16_t const *x_buf, int16_t *y_buf, uint32_t len, FilterState *state) { /// [b,a] = butter(1, 0.01) -> 3x tau (95%) ~100 samples @@ -147,14 +145,15 @@ void baseband_low_pass_filter(uint16_t const *x_buf, int16_t *y_buf, uint32_t le } -/// Integer implementation of atan2() with int16_t normalized output -/// -/// Returns arc tangent of y/x across all quadrants in radians -/// Error max 0.07 radians -/// Reference: http://dspguru.com/dsp/tricks/fixed-point-atan2-with-self-normalization -/// @param y: Numerator (imaginary value of complex vector) -/// @param x: Denominator (real value of complex vector) -/// @return angle in radians (Pi equals INT16_MAX) +/** Integer implementation of atan2() with int16_t normalized output. + + Returns arc tangent of y/x across all quadrants in radians. + Error max 0.07 radians. + Reference: http://dspguru.com/dsp/tricks/fixed-point-atan2-with-self-normalization + @param y: Numerator (imaginary value of complex vector) + @param x: Denominator (real value of complex vector) + @return angle in radians (Pi equals INT16_MAX) +*/ int16_t atan2_int16(int16_t y, int16_t x) { static int32_t const I_PI_4 = INT16_MAX/4; // M_PI/4 @@ -224,7 +223,7 @@ void baseband_demod_FM(uint8_t const *x_buf, int16_t *y_buf, unsigned long num_s #define S_CONST32 (1 << F_SCALE32) #define FIX32(x) ((int)(x * S_CONST32)) -// for evaluation +/// for evaluation. int32_t atan2_int32(int32_t y, int32_t x) { static int64_t const I_PI_4 = INT32_MAX / 4; // M_PI/4 @@ -246,7 +245,7 @@ int32_t atan2_int32(int32_t y, int32_t x) return angle; } -// for evaluation +/// for evaluation. void baseband_demod_FM_cs16(int16_t const *x_buf, int16_t *y_buf, unsigned long num_samples, DemodFM_State *state) { /// [b,a] = butter(1, 0.1) -> 3x tau (95%) ~10 samples @@ -290,7 +289,6 @@ void baseband_demod_FM_cs16(int16_t const *x_buf, int16_t *y_buf, unsigned long state->xlp = xlp_old; state->ylp = ylp_old; } - void baseband_init(void) { calc_squares(); diff --git a/src/bitbuffer.c b/src/bitbuffer.c index 14810a68..09b90500 100644 --- a/src/bitbuffer.c +++ b/src/bitbuffer.c @@ -1,14 +1,13 @@ -/** - * Bit buffer - * - * A two-dimensional bit buffer consisting of bytes - * - * Copyright (C) 2015 Tommy Vestermark - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + A two-dimensional bit buffer consisting of bytes. + + Copyright (C) 2015 Tommy Vestermark + + 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 of the License, or + (at your option) any later version. +*/ #include "bitbuffer.h" #include <stdio.h> diff --git a/src/confparse.c b/src/confparse.c index 9f929605..535b07ae 100644 --- a/src/confparse.c +++ b/src/confparse.c @@ -1,18 +1,18 @@ -/** - * Light-weight (i.e. dumb) config-file parser - * - * - a valid config line is a keyword followed by an argument to the end of line - * - whitespace around the keyword is ignored - * - comments start with a hash sign, no inline comments, empty lines are ok. - * - whitespace is space and tab - * - * Copyright (C) 2018 Christian W. Zuckschwerdt <zany@triq.net> - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Light-weight (i.e. dumb) config-file parser. + + - a valid config line is a keyword followed by an argument to the end of line + - whitespace around the keyword is ignored + - comments start with a hash sign, no inline comments, empty lines are ok. + - whitespace is space and tab + + Copyright (C) 2018 Christian W. Zuckschwerdt <zany@triq.net> + + 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 of the License, or + (at your option) any later version. +*/ #include <stdlib.h> #include <stdio.h> diff --git a/src/decoder_util.c b/src/decoder_util.c index 8dec0eb2..80da6906 100644 --- a/src/decoder_util.c +++ b/src/decoder_util.c @@ -1,13 +1,13 @@ -/** - * High-level utility functions for decoders - * - * Copyright (C) 2018 Christian Zuckschwerdt - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + High-level utility functions for decoders. + + Copyright (C) 2018 Christian Zuckschwerdt + + 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 of the License, or + (at your option) any later version. +*/ #include <stdlib.h> #include <stdio.h> diff --git a/src/fileformat.c b/src/fileformat.c index 5609306f..85214d93 100644 --- a/src/fileformat.c +++ b/src/fileformat.c @@ -1,13 +1,13 @@ -/** - * Various utility functions handling file formats - * - * Copyright (C) 2018 Christian Zuckschwerdt - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Various utility functions handling file formats. + + Copyright (C) 2018 Christian Zuckschwerdt + + 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 of the License, or + (at your option) any later version. +*/ #include <string.h> #include <stdlib.h> @@ -211,7 +211,7 @@ char const *last_plain_colon(char const *p) return found; } -/* +/** This will detect file info and overrides. Parse "[0-9]+(\.[0-9]+)?[A-Za-z]" diff --git a/src/list.c b/src/list.c index 8003241b..0c0284ea 100644 --- a/src/list.c +++ b/src/list.c @@ -1,13 +1,13 @@ -/** - * Generic list - * - * Copyright (C) 2018 Christian Zuckschwerdt - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Generic list. + + Copyright (C) 2018 Christian Zuckschwerdt + + 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 of the License, or + (at your option) any later version. +*/ #include "list.h" #include <stdlib.h> diff --git a/src/optparse.c b/src/optparse.c index 24e7880d..e9851170 100644 --- a/src/optparse.c +++ b/src/optparse.c @@ -1,13 +1,13 @@ -/** - * Option parsing functions to complement getopt. - * - * Copyright (C) 2017 Christian Zuckschwerdt - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Option parsing functions to complement getopt. + + Copyright (C) 2017 Christian Zuckschwerdt + + 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 of the License, or + (at your option) any later version. +*/ #include "optparse.h" #include <stdio.h> diff --git a/src/pulse_demod.c b/src/pulse_demod.c index 4b726e31..9dd163ee 100644 --- a/src/pulse_demod.c +++ b/src/pulse_demod.c @@ -1,14 +1,15 @@ -/** - * Pulse demodulation functions - * - * Binary demodulators (PWM/PPM/Manchester/...) using a pulse data structure as input - * - * Copyright (C) 2015 Tommy Vestermark - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Pulse demodulation functions. + + Binary demodulators (PWM/PPM/Manchester/...) using a pulse data structure as input. + + Copyright (C) 2015 Tommy Vestermark + + 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 of the License, or + (at your option) any later version. +*/ #include "pulse_demod.h" #include "bitbuffer.h" diff --git a/src/pulse_detect.c b/src/pulse_detect.c index 5eac2b76..1f58679b 100644 --- a/src/pulse_detect.c +++ b/src/pulse_detect.c @@ -1,12 +1,13 @@ -/** - * Pulse detection functions - * - * Copyright (C) 2015 Tommy Vestermark - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Pulse detection functions. + + Copyright (C) 2015 Tommy Vestermark + + 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 of the License, or + (at your option) any later version. +*/ #include "pulse_detect.h" #include "pulse_demod.h" diff --git a/src/r_util.c b/src/r_util.c index 80f65dcd..1ec86a78 100644 --- a/src/r_util.c +++ b/src/r_util.c @@ -1,12 +1,13 @@ -/** - * Various utility functions for use by applications - * - * Copyright (C) 2015 Tommy Vestermark - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Various utility functions for use by applications + + Copyright (C) 2015 Tommy Vestermark + + 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 of the License, or + (at your option) any later version. +*/ #include "r_util.h" #include <stdlib.h> diff --git a/src/rtl_433.c b/src/rtl_433.c index 5f237fc0..67fb49ac 100644 --- a/src/rtl_433.c +++ b/src/rtl_433.c @@ -1,24 +1,24 @@ -/* - * rtl_433, turns your Realtek RTL2832 based DVB dongle into a 433.92MHz generic data receiver - * Copyright (C) 2012 by Benjamin Larsson <benjamin@southpole.se> - * - * Based on rtl_sdr - * - * Copyright (C) 2012 by Steve Markgraf <steve@steve-m.de> - * - * 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 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ +/** @file + rtl_433, turns your Realtek RTL2832 based DVB dongle into a 433.92MHz generic data receiver. + + Copyright (C) 2012 by Benjamin Larsson <benjamin@southpole.se> + + Based on rtl_sdr + Copyright (C) 2012 by Steve Markgraf <steve@steve-m.de> + + 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 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ #include <stdio.h> #include <stdlib.h> diff --git a/src/samp_grab.c b/src/samp_grab.c index 72f507b8..b618f8c0 100644 --- a/src/samp_grab.c +++ b/src/samp_grab.c @@ -1,13 +1,13 @@ -/** - * IQ sample grabber (ring buffer and dumper) - * - * Copyright (C) 2018 Christian Zuckschwerdt - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + IQ sample grabber (ring buffer and dumper). + + Copyright (C) 2018 Christian Zuckschwerdt + + 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 of the License, or + (at your option) any later version. +*/ #include <stdlib.h> #include <stdio.h> diff --git a/src/sdr.c b/src/sdr.c index 5c936f02..6bd04f18 100644 --- a/src/sdr.c +++ b/src/sdr.c @@ -1,17 +1,17 @@ -/** - * SDR input from RTLSDR or SoapySDR - * - * Copyright (C) 2018 Christian Zuckschwerdt - * based on code - * Copyright (C) 2012 by Steve Markgraf <steve@steve-m.de> - * Copyright (C) 2014 by Kyle Keen <keenerd@gmail.com> - * Copyright (C) 2016 by Robert X. Seger - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + SDR input from RTLSDR or SoapySDR. + + Copyright (C) 2018 Christian Zuckschwerdt + based on code + Copyright (C) 2012 by Steve Markgraf <steve@steve-m.de> + Copyright (C) 2014 by Kyle Keen <keenerd@gmail.com> + Copyright (C) 2016 by Robert X. Seger + + 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 of the License, or + (at your option) any later version. +*/ #include <stdio.h> #include <stdlib.h> diff --git a/src/term_ctl.c b/src/term_ctl.c index a5d20b9e..6ff20d38 100644 --- a/src/term_ctl.c +++ b/src/term_ctl.c @@ -1,13 +1,13 @@ -/** - * Terminal control utility functions. - * - * Copyright (C) 2018 Christian Zuckschwerdt - * - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Terminal control utility functions. + + Copyright (C) 2018 Christian Zuckschwerdt + + 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 of the License, or + (at your option) any later version. +*/ #include <stdio.h> #include <stdarg.h> diff --git a/src/util.c b/src/util.c index 5d7ebd19..0ad59aac 100644 --- a/src/util.c +++ b/src/util.c @@ -1,12 +1,13 @@ -/** - * Various utility functions for use by device drivers - * - * Copyright (C) 2015 Tommy Vestermark - * 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 of the License, or - * (at your option) any later version. - */ +/** @file + Various utility functions for use by device drivers. + + Copyright (C) 2015 Tommy Vestermark + + 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 of the License, or + (at your option) any later version. +*/ #include "util.h" #include <stdlib.h>