|
|
@ -62,15 +62,24 @@ void usage(void) |
|
|
|
|
|
|
|
|
|
|
|
#ifdef _WIN32 |
|
|
|
#ifdef _WIN32 |
|
|
|
BOOL WINAPI |
|
|
|
BOOL WINAPI |
|
|
|
|
|
|
|
sighandler(int signum) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (CTRL_C_EVENT == signum) { |
|
|
|
|
|
|
|
fprintf(stderr, "Signal caught, exiting!\n"); |
|
|
|
|
|
|
|
do_exit = 1; |
|
|
|
|
|
|
|
rtlsdr_cancel_async(dev); |
|
|
|
|
|
|
|
return TRUE; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return FALSE; |
|
|
|
|
|
|
|
} |
|
|
|
#else |
|
|
|
#else |
|
|
|
static void |
|
|
|
static void sighandler(int signum) |
|
|
|
#endif |
|
|
|
|
|
|
|
sighandler(int signum) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
fprintf(stderr, "Signal caught, exiting!\n"); |
|
|
|
fprintf(stderr, "Signal caught, exiting!\n"); |
|
|
|
do_exit = 1; |
|
|
|
do_exit = 1; |
|
|
|
rtlsdr_cancel_async(dev); |
|
|
|
rtlsdr_cancel_async(dev); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
static void rtlsdr_callback(unsigned char *buf, uint32_t len, void *ctx) |
|
|
|
static void rtlsdr_callback(unsigned char *buf, uint32_t len, void *ctx) |
|
|
|
{ |
|
|
|
{ |
|
|
|