Commit 41d19841 authored by Jenda's avatar Jenda

cleanup

parent ffe8e964
......@@ -88,7 +88,7 @@ class KukurukuScanner():
for channel in cronframe.channels:
peaks.append((channel.freq-cronframe.freq, channel.bw, channel))
self.do_record(peaks, cronframe.cronlen, cronframe.stickactivity, 1, None, cronframe)
self.do_record(peaks, cronframe.cronlen, 1, None, cronframe)
def scan(self, scanframe):
''' Find peaks in spectrum, record if specified in allow/blacklist '''
......
......@@ -2,7 +2,7 @@
freq=100000
floor=0.2
sql=0.3
cron=* 23 * * *
cron=* 16 * * *
cronlen=60
randscan=no
stickactivity=false
......
[General]
; size of SDR buffer, used for flushing
bufsize=1000000
bufsize=2048000
; SDR sample rate
rate=10000000
rate=2048000
; the duration of one tune, in seconds
interval=5
......@@ -13,7 +13,7 @@ interval=5
skip=3
; spectrum transform size
fftw=16384
fftw=2048
; transform decimation
; we do transforms on every fftw*fftskip offset
......
#pragma once
#ifndef CLIENT_PARSER_H
#define CLIENT_PARSER_H
......
#pragma once
#ifndef CONSTANTS_H
#define CONSTANTS_H
#define SDRPACKETSIZE (512*1024)
......
#pragma once
#ifndef METADATA_H
#define METADATA_H
#include "sdr_packet.h"
void fftw_init(int);
void calc_spectrum(sdr_packet*, int, int);
void calc_histogram(sdr_packet *, int);
#endif
......@@ -65,7 +65,7 @@ struct current_gain_t gain;
SLIST_HEAD(worker_head_t, worker) worker_head = SLIST_HEAD_INITIALIZER(worker_head);
// Allocate SDR input buffer
void allocate_sdr_buf() {
static void allocate_sdr_buf() {
size_t align = volk_get_alignment();
for(int i = 0; i<BUFSIZE; i++) {
sdr_inbuf[i].data = volk_malloc(COMPLEX * sizeof(float) * SDRPACKETSIZE, align);
......@@ -76,7 +76,7 @@ void allocate_sdr_buf() {
}
}
void * sdr_read_thr(void * a) {
static void * sdr_read_thr(void * a) {
// open the pipe we are reading from
sdr_pipe = fopen(sdr_pipe_file, "r");
......@@ -183,7 +183,7 @@ void * sdr_read_thr(void * a) {
}
}
void * socket_write_thr(void * a) {
static void * socket_write_thr(void * a) {
while(1) {
// We wish to read packet send_cptr+1
......@@ -356,7 +356,7 @@ void * socket_write_thr(void * a) {
return NULL;
}
void create_read_write_threads() {
static void create_read_write_threads() {
int ret = pthread_create(&sdr_thread, NULL, &sdr_read_thr, NULL);
if(ret != 0) {
......@@ -372,9 +372,8 @@ void create_read_write_threads() {
}
void usage(char * me) {
printf("usage: %s -s rate -p ppm -f frequency -i cmdpipe -o sdrpipe\n", me);
printf("\n");
static void usage(char * me) {
printf("usage: %s -s samplerate -p ppm -f frequency -i cmdpipe -o sdrpipe\n", me);
exit(1);
}
......@@ -385,7 +384,7 @@ int main(int argc, char **argv) {
/* Command line opts */
int opt;
while ((opt = getopt(argc, argv, "s:f:p:g:i:o:r:h:t:w:")) != -1) {
while ((opt = getopt(argc, argv, "s:f:p:g:i:o:h:t:w:")) != -1) {
switch (opt) {
case 's':
samplerate = atoi(optarg);
......@@ -396,9 +395,6 @@ int main(int argc, char **argv) {
case 'p':
ppm = atoi(optarg);
break;
case 'r':
samplerate = atoi(optarg);
break;
case 'g':
gain.autogain = 1;
gain.global_gain = atoi(optarg);
......@@ -425,7 +421,7 @@ int main(int argc, char **argv) {
}
}
if(frequency < 0 || samplerate < 0 || ppm == INT32_MIN ||
if(frequency < 0 || samplerate <= 0 || ppm == INT32_MIN ||
sdr_pipe_file == NULL || sdr_cmd_file == NULL) {
usage(argv[0]);
}
......
#pragma once
#ifndef UTIL_H
#define UTIL_H
ssize_t readn(int, void *, int);
ssize_t writen(int, void *, int);
#endif
#pragma once
#ifndef XLATE_WORKER_H
#define XLATE_WORKER_H
#include "worker.h"
worker * create_xlate_worker(float, int, int, float *, int);
void * xlate_worker_thr(void *);
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment