aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorpiotr <Piotr Krysik pkrysik@elka.pw.edu.pl>2014-08-04 11:21:24 +0200
committerpiotr <Piotr Krysik pkrysik@elka.pw.edu.pl>2014-08-04 11:21:24 +0200
commitc00ce9c7b508301812b28a92bc39f4a34d02c924 (patch)
tree8aae5a1fefd8f48cd9b9820973065e190895a1cb /lib
parent60638c9a3025f89958f4b5a757172c306d76e526 (diff)
Moved burst printer to different directory
Diffstat (limited to 'lib')
-rw-r--r--lib/CMakeLists.txt2
-rw-r--r--lib/misc_utils/bursts_printer_impl.cc (renamed from lib/burst_printer/bursts_printer_impl.cc)22
-rw-r--r--lib/misc_utils/bursts_printer_impl.h (renamed from lib/burst_printer/bursts_printer_impl.h)2
3 files changed, 8 insertions, 18 deletions
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 79fa57a..8e707be 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -29,7 +29,7 @@ list(APPEND gsm_sources
receiver/receiver_config.cc
receiver/viterbi_detector.cc
receiver/sch.c
- burst_printer/bursts_printer_impl.cc
+ misc_utils/bursts_printer_impl.cc
demapping/get_bcch_or_ccch_bursts_impl.cc
decoding/control_channels_decoder_impl.cc
decoding/cch.c
diff --git a/lib/burst_printer/bursts_printer_impl.cc b/lib/misc_utils/bursts_printer_impl.cc
index c37838b..deedf02 100644
--- a/lib/burst_printer/bursts_printer_impl.cc
+++ b/lib/misc_utils/bursts_printer_impl.cc
@@ -27,31 +27,23 @@
#include <iterator>
#include <algorithm>
#include "bursts_printer_impl.h"
+#include <unistd.h>
+
+#include <iostream>
namespace gr {
namespace gsm {
+ boost::mutex printer_mutex;
void bursts_printer_impl::bursts_print(pmt::pmt_t msg)
{
+ boost::mutex::scoped_lock lock(printer_mutex);
+
pmt::pmt_t burst = pmt::cdr(msg);
int8_t * burst_elements = (int8_t *)pmt::blob_data(burst);
size_t burst_len=pmt::blob_length(burst);
pmt::pmt_t header_blob = pmt::car(msg);
gsmtap_hdr * header = (gsmtap_hdr *)pmt::blob_data(header_blob);
- d_c0_channels.insert(header->arfcn);
-
-// d_channels_dbm.insert(header->signal_dbm);
-// std::copy(
-// d_c0_channels.begin(),
-// d_c0_channels.end(),
-// std::ostream_iterator<uint16_t>(std::cout, " ")
-// );
-// std::cout << std::endl;
-// std::copy(
-// d_channels_dbm.begin(),
-// d_channels_dbm.end(),
-// std::ostream_iterator<int>(std::cout, " ")
-// );
for(int ii=0; ii<burst_len; ii++)
{
@@ -59,7 +51,7 @@ namespace gr {
}
std::cout << std::endl;
}
-
+
bursts_printer::sptr
bursts_printer::make()
{
diff --git a/lib/burst_printer/bursts_printer_impl.h b/lib/misc_utils/bursts_printer_impl.h
index 81e8be6..1a6368a 100644
--- a/lib/burst_printer/bursts_printer_impl.h
+++ b/lib/misc_utils/bursts_printer_impl.h
@@ -31,8 +31,6 @@ namespace gr {
{
private:
void bursts_print(pmt::pmt_t burst);
- std::set<uint16_t> d_c0_channels;
-
public:
bursts_printer_impl();
~bursts_printer_impl();