Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Sep 24, 2013
1 parent 4fd8fd4 commit 502ab75
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 24 deletions.
28 changes: 20 additions & 8 deletions scanner/audio_receiver_dsd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,25 @@ log_dsd::log_dsd(float f, float c, long t, long r)
sprintf(filename, "%ld-%ld.wav", talkgroup,timestamp);
audio_sink::sptr sink = audio_make_sink(44100);

//connect(self(), 0, prefilter, 0);


//start off muted

connect(self(), 0, null_sink, 0);
connect(self(), 0, prefilter, 0);
//connect(self(), 0, null_sink, 0);
connect(null_source,0,head_source,0);
connect(head_source,0,prefilter,0);
//connect(head_source,0,prefilter,0);
connect(head_source,0, null_sink,0);


muted = true;

connect(prefilter, 0, downsample_sig, 0);
connect(downsample_sig, 0, demod, 0);
connect(demod, 0, sym_filter, 0);
connect(sym_filter, 0, dsd, 0);
//connect(dsd, 0, wav_sink,0);


//connect(dsd,0, null_sink,0);
//connect(head_source,0, upsample_audio,0);
connect(dsd, 0, upsample_audio,0);
connect(upsample_audio, 0, sink,0);
//connect(sym_filter,0,fs,0);
Expand All @@ -130,16 +132,26 @@ void log_dsd::unmute() {
connect(head_source,0, null_sink,0);
connect(self(),0, copier,0);
connect(copier,0, prefilter,0);
//connect(self(),0, prefilter,0);
/*disconnect(dsd,0, null_sink,0);
disconnect(head_source,0, upsample_audio,0);
connect(head_source,0, null_sink,0);
connect(dsd(),0, copier,0);
connect(copier,0, upsample_audio,0);*/

muted = false;
}
}

void log_dsd::mute() {

if (!muted) {
/*disconnect(dsd,0, copier,0);
disconnect(copier,0, upsample_audio,0);
disconnect(head_source,0, null_sink,0);
//disconnect(self(),0, prefilter,0);
connect(head_source,0,upsample_audio,0);
connect(self(),0, null_sink,0);
*/

disconnect(self(),0, copier,0);
disconnect(copier,0, prefilter,0);
Expand Down
Binary file modified scanner/smartnet
Binary file not shown.
16 changes: 8 additions & 8 deletions scanner/smartnet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ float parse_message(string s) {
tb->lock();
rx->tune_offset(retfreq);
rx->set_talkgroup(address);
rx->unmute();
//rx->unmute();
tb->unlock();
active_tg = target;
is_active = true;
Expand All @@ -313,18 +313,18 @@ float parse_message(string s) {
if (rx->get_talkgroup() == address) {

if (rx->get_freq() != retfreq) {
tb->lock();
//tb->lock();
rx->tune_offset(retfreq);
rx->unmute();
tb->unlock();
//rx->unmute();
//tb->unlock();
}
rx->active();

} else {
if (rx->get_freq() == retfreq) {
tb->lock();
/*tb->lock();
rx->mute();
tb->unlock();
tb->unlock();*/
is_active = false;
active_tg = NULL;
}
Expand All @@ -338,9 +338,9 @@ float parse_message(string s) {
if ((is_active) && (rx->rx_timeout() > 5.0)) {


tb->lock();
/*tb->lock();
rx->mute();
tb->unlock();
tb->unlock();*/
is_active = false;
active_tg = NULL;
update_active_tg_win();
Expand Down
2 changes: 1 addition & 1 deletion scanner/start_hack_rf_decode_856.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
./smartnet --freq 856187500.0 --center 857000000.0 --rate 8000000 --error -5500 --rfgain 14 --ifgain 35 --bbgain 35 --tg 1616
./smartnet --freq 856187500.0 --center 857000000.0 --rate 8000000 --error -5500 --rfgain 0 --ifgain 15 --bbgain 15 --tg 1616
#./smartnet --freq 496444500.0 --center 496000000.0 --rate 1000000 --error 0 --rfgain 14 --ifgain 30 --bbgain 30


Expand Down
1 change: 1 addition & 0 deletions smartnet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ link_directories(
/usr/local/lib/pyton2.7/dist-packages/gnuradio/
)

set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall")

add_executable(smartnet smartnet.cc smartnet_crc.cc smartnet_deinterleave.cc logging_receiver_dsd.cc logging_receiver_p25.cc smartnet_wavfile.cc smartnet_wavsink.cc)
target_link_libraries(smartnet gnuradio-core gnuradio-audio gnuradio-blocks gnuradio-osmosdr gnuradio-filter gnuradio-digital gnuradio-analog ${GRUEL_LIBRARIES} ${Boost_LIBRARIES} gr-dsd op25 itpp)
Expand Down
6 changes: 5 additions & 1 deletion smartnet/logging_receiver_dsd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ log_dsd::log_dsd(float f, float c, long t)
center = c;
talkgroup = t;
float offset = center - (f*1000000);
char filename[160];

int samp_per_sym = 10;
double samp_rate = 4000000;
int decim = 80;
Expand Down Expand Up @@ -156,6 +156,10 @@ float log_dsd::get_freq() {
return freq;
}

char *log_dsd::get_filename() {
return filename;
}

long log_dsd::timeout() {
return time(NULL) - timestamp;
}
Expand Down
2 changes: 2 additions & 0 deletions smartnet/logging_receiver_dsd.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,15 @@ class log_dsd : public gr_hier_block2
void close();
void mute();
void unmute();
char *get_filename();
//void forecast(int noutput_items, gr_vector_int &ninput_items_required);

private:
float center, freq;
bool muted;
long talkgroup;
time_t timestamp;
char filename[160];


/* GR blocks */
Expand Down
Binary file modified smartnet/smartnet
Binary file not shown.
9 changes: 5 additions & 4 deletions smartnet/smartnet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
#include <stdlib.h>

#include "logging_receiver_dsd.h"
#include <smartnet_crc.h>
#include <smartnet_deinterleave.h>
#include "smartnet_crc.h"
#include "smartnet_deinterleave.h"

#include <osmosdr_source_c.h>
#include <osmosdr_sink_c.h>
Expand Down Expand Up @@ -121,7 +121,7 @@ float parse_message(string s) {
int address = atoi( x[0].c_str() ) & 0xFFF0;
int groupflag = atoi( x[1].c_str() );
int command = atoi( x[2].c_str() );

char shell_command[200];


if (command < 0x2d0) {
Expand Down Expand Up @@ -189,7 +189,8 @@ float parse_message(string s) {
rx->close();
tb->disconnect(src, 0, rx, 0);
tb->unlock();

sprintf(shell_command,"lame -h %s", rx->get_filename());
system(shell_command);
it = loggers.erase(it);

} else {
Expand Down
2 changes: 1 addition & 1 deletion smartnet/smartnet_crc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <stdio.h>
#include <gr_tags.h>
#include <sstream>
#include <smartnet_types.h>
#include "smartnet_types.h"

#define VERBOSE 0

Expand Down
2 changes: 1 addition & 1 deletion smartnet/smartnet_deinterleave.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "config.h"
#endif

#include <smartnet_deinterleave.h>
#include "smartnet_deinterleave.h"
#include <gr_io_signature.h>
#include <gr_tags.h>

Expand Down

0 comments on commit 502ab75

Please sign in to comment.