Support MinGW and Win

pull/23/head
Xael South 2021-03-15 12:07:04 +00:00
rodzic f897f1d7e5
commit ec6c1f5d86
4 zmienionych plików z 25 dodań i 1 usunięć

Wyświetl plik

@ -41,6 +41,13 @@ To install rtl-wmbus, download, unpack the source code and go to the top level d
Before building Android version the SDK and NDK have to be installed. See androidbuild.bat for how to build and install. Before building Android version the SDK and NDK have to be installed. See androidbuild.bat for how to build and install.
For Windows user:
* Download and install https://downloads.myriadrf.org/builds/PothosSDR/PothosSDR-2021.02.28-vc16-x64.exe
* Compile rtl-wmbus with MSYS2-MinGW just by executing make in MSYS2-MinGW-Console...
* Or use precompiled binary from the build directory
* Start in the console: "c:\Program Files\PothosSDR\bin\rtl_sdr" -f 868.95M -s 1600000 - 2>NUL | build\rtl_wmbus_x64.exe
* Optionally replace the path to rtl_sdr with that where you have PothosSDR installed
Usage Usage
----- -----
To save an I/Q-stream on disk and decode that off-line: To save an I/Q-stream on disk and decode that off-line:

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -31,16 +31,29 @@
#include <complex.h> #include <complex.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h>
#include <fixedptc/fixedptc.h> #include <fixedptc/fixedptc.h>
#include "fir.h" #include "fir.h"
#include "iir.h" #include "iir.h"
#include "ppf.h" #include "ppf.h"
#include "moving_average_filter.h" #include "moving_average_filter.h"
#include "atan2.h" #include "atan2.h"
#include "net_support.h"
#include "t1_c1_packet_decoder.h" #include "t1_c1_packet_decoder.h"
#include "s1_packet_decoder.h" #include "s1_packet_decoder.h"
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
#define WINDOWS_BUILD 1
#else
#define WINDOWS_BUILD 0
#endif
#if WINDOWS_BUILD == 1
#include <io.h>
#warning "Compiling for Win discludes network support."
#else
#include "net_support.h"
#endif
static const uint32_t ACCESS_CODE_T1_C1 = 0b0101010101010000111101u; static const uint32_t ACCESS_CODE_T1_C1 = 0b0101010101010000111101u;
static const uint32_t ACCESS_CODE_T1_C1_BITMASK = 0x3FFFFFu; static const uint32_t ACCESS_CODE_T1_C1_BITMASK = 0x3FFFFFu;
static const unsigned ACCESS_CODE_T1_C1_ERRORS = 1u; // 0 if no errors allowed static const unsigned ACCESS_CODE_T1_C1_ERRORS = 1u; // 0 if no errors allowed
@ -908,6 +921,10 @@ static void shift_freq_plus_minus325(float *iplus, float *qplus, float *iminus,
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#if WINDOWS_BUILD == 1
_setmode(_fileno(stdin), _O_BINARY);
#endif
process_options(argc, argv); process_options(argc, argv);
__attribute__((__aligned__(16))) uint8_t samples[4096]; __attribute__((__aligned__(16))) uint8_t samples[4096];