diff --git a/README.md b/README.md index 4e57810..1783727 100644 --- a/README.md +++ b/README.md @@ -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. +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 ----- To save an I/Q-stream on disk and decode that off-line: diff --git a/build/rtl_wmbus_x64.exe b/build/rtl_wmbus_x64.exe new file mode 100755 index 0000000..53985f7 Binary files /dev/null and b/build/rtl_wmbus_x64.exe differ diff --git a/build/rtl_wmbus_x86.exe b/build/rtl_wmbus_x86.exe new file mode 100755 index 0000000..78515f8 Binary files /dev/null and b/build/rtl_wmbus_x86.exe differ diff --git a/rtl_wmbus.c b/rtl_wmbus.c index 18724af..6a4e8f1 100644 --- a/rtl_wmbus.c +++ b/rtl_wmbus.c @@ -31,16 +31,29 @@ #include #include #include +#include #include #include "fir.h" #include "iir.h" #include "ppf.h" #include "moving_average_filter.h" #include "atan2.h" -#include "net_support.h" #include "t1_c1_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 +#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_BITMASK = 0x3FFFFFu; 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[]) { + #if WINDOWS_BUILD == 1 + _setmode(_fileno(stdin), _O_BINARY); + #endif + process_options(argc, argv); __attribute__((__aligned__(16))) uint8_t samples[4096];