2016-06-11 21:34:36 +00:00
|
|
|
/*
|
2021-12-12 04:05:22 +00:00
|
|
|
* rtlsrd-wsprd, WSPR daemon for RTL receivers, Guenael Jouchet (VA2GKA)
|
|
|
|
* Copyright (C) 2016-2021, Guenael Jouchet (VA2GKA)
|
2016-06-11 21:34:36 +00:00
|
|
|
*
|
2021-12-12 04:05:22 +00:00
|
|
|
* 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 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2016-06-11 21:34:36 +00:00
|
|
|
*
|
2021-12-12 04:05:22 +00:00
|
|
|
* 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.
|
2016-06-11 21:34:36 +00:00
|
|
|
*
|
2021-12-12 04:05:22 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2016-06-11 21:34:36 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#ifndef bool
|
2021-12-04 01:44:40 +00:00
|
|
|
typedef uint32_t bool;
|
2021-12-04 20:19:06 +00:00
|
|
|
#define true 1
|
2021-12-04 01:44:40 +00:00
|
|
|
#define false 0
|
2016-06-11 21:34:36 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2021-12-16 03:05:32 +00:00
|
|
|
static void rtlsdr_callback(unsigned char *samples, uint32_t samples_count, void *ctx);
|
|
|
|
static void sigint_callback_handler(int signum);
|
2017-06-23 20:37:20 +00:00
|
|
|
static void *rtlsdr_rx(void *arg);
|
2021-12-16 03:05:32 +00:00
|
|
|
static void *decoder(void *arg);
|
|
|
|
void initSampleStorage();
|
|
|
|
void initrx_options();
|
|
|
|
void initDecoder_options();
|
2017-06-23 20:37:20 +00:00
|
|
|
void postSpots(uint32_t n_results);
|
2021-12-11 04:40:43 +00:00
|
|
|
void printSpots(uint32_t n_results);
|
|
|
|
void saveSample(float *iSamples, float *qSamples);
|
2017-06-23 20:37:20 +00:00
|
|
|
double atofs(char *s);
|
2021-12-04 20:19:06 +00:00
|
|
|
int32_t parse_u64(char *s, uint64_t *const value);
|
2021-12-10 05:23:56 +00:00
|
|
|
int32_t readRawIQfile(float *iSamples, float *qSamples, char *filename);
|
|
|
|
int32_t writeRawIQfile(float *iSamples, float *qSamples, char *filename);
|
2021-12-23 22:48:38 +00:00
|
|
|
int32_t readC2file(float *iSamples, float *qSamples, char *filename);
|
2021-12-10 05:23:56 +00:00
|
|
|
void decodeRecordedFile(char *filename);
|
|
|
|
float whiteGaussianNoise(float factor);
|
|
|
|
int32_t decoderSelfTest();
|
2021-12-20 17:57:44 +00:00
|
|
|
void usage(FILE *stream, int32_t status);
|