Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
yids
kukuruku-fork
Commits
41d19841
Commit
41d19841
authored
Jul 22, 2016
by
Jenda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
ffe8e964
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
31 additions
and
18 deletions
+31
-18
scanner/KukurukuScanner.py
scanner/KukurukuScanner.py
+1
-1
scanner/confdir/fm.conf
scanner/confdir/fm.conf
+1
-1
scanner/confdir/main.conf
scanner/confdir/main.conf
+3
-3
server/client_parser.h
server/client_parser.h
+1
-0
server/constants.h
server/constants.h
+1
-1
server/metadata.h
server/metadata.h
+5
-0
server/server.c
server/server.c
+8
-12
server/util.h
server/util.h
+6
-0
server/xlate_worker.h
server/xlate_worker.h
+5
-0
No files found.
scanner/KukurukuScanner.py
View file @
41d19841
...
...
@@ -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 '''
...
...
scanner/confdir/fm.conf
View file @
41d19841
...
...
@@ -2,7 +2,7 @@
freq
=
100000
floor
=
0
.
2
sql
=
0
.
3
cron
=*
23
* * *
cron
=*
16
* * *
cronlen
=
60
randscan
=
no
stickactivity
=
false
...
...
scanner/confdir/main.conf
View file @
41d19841
[
General
]
;
size
of
SDR
buffer
,
used
for
flushing
bufsize
=
1000
000
bufsize
=
2048
000
;
SDR
sample
rate
rate
=
10000
000
rate
=
2048
000
;
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
...
...
server/client_parser.h
View file @
41d19841
#pragma once
#ifndef CLIENT_PARSER_H
#define CLIENT_PARSER_H
...
...
server/constants.h
View file @
41d19841
#pragma once
#ifndef CONSTANTS_H
#define CONSTANTS_H
#define SDRPACKETSIZE (512*1024)
...
...
server/metadata.h
View file @
41d19841
#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
server/server.c
View file @
41d19841
...
...
@@ -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
]);
}
...
...
server/util.h
View file @
41d19841
#pragma once
#ifndef UTIL_H
#define UTIL_H
ssize_t
readn
(
int
,
void
*
,
int
);
ssize_t
writen
(
int
,
void
*
,
int
);
#endif
server/xlate_worker.h
View file @
41d19841
#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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment