Renamed burst_sink_qa/burst_source_qa to burst_sink/burst_source

This commit is contained in:
Roman Khassraf 2015-08-03 11:16:10 +02:00
parent 1c3419e88f
commit 1ce4469fd2
13 changed files with 83 additions and 83 deletions

View File

@ -18,8 +18,8 @@
# Boston, MA 02110-1301, USA.
install(FILES
gsm_burst_source_qa.xml
gsm_burst_sink_qa.xml
gsm_burst_source.xml
gsm_burst_sink.xml
gsm_message_source.xml
gsm_message_sink.xml DESTINATION share/gnuradio/grc/blocks
)

View File

@ -1,9 +1,9 @@
<?xml version="1.0"?>
<block>
<name>QA Burst sink</name>
<key>gsm_burst_sink_qa</key>
<name>Burst sink</name>
<key>gsm_burst_sink</key>
<import>import grgsm</import>
<make>grgsm.burst_sink_qa()</make>
<make>grgsm.burst_sink()</make>
<sink>
<name>in</name>

View File

@ -1,9 +1,9 @@
<?xml version="1.0"?>
<block>
<name>QA Burst source</name>
<key>gsm_burst_source_qa</key>
<name>Burst source</name>
<key>gsm_burst_source</key>
<import>import grgsm</import>
<make>grgsm.burst_source_qa($framenumbers, $timeslots, $bursts)</make>
<make>grgsm.burst_source($framenumbers, $timeslots, $bursts)</make>
<param>
<name>Frame numbers</name>

View File

@ -21,8 +21,8 @@
# Install public header files
########################################################################
install(FILES
burst_sink_qa.h
burst_source_qa.h
burst_sink.h
burst_source.h
message_source.h
message_sink.h DESTINATION include/grgsm/qa_utils
)

View File

@ -20,8 +20,8 @@
*
*/
#ifndef INCLUDED_GSM_BURST_SINK_QA_H
#define INCLUDED_GSM_BURST_SINK_QA_H
#ifndef INCLUDED_GSM_BURST_SINK_H
#define INCLUDED_GSM_BURST_SINK_H
#include <grgsm/api.h>
#include <gnuradio/block.h>
@ -34,17 +34,17 @@ namespace gr {
* \ingroup gsm
*
*/
class GSM_API burst_sink_qa : virtual public gr::block
class GSM_API burst_sink : virtual public gr::block
{
public:
typedef boost::shared_ptr<burst_sink_qa> sptr;
typedef boost::shared_ptr<burst_sink> sptr;
/*!
* \brief Return a shared_ptr to a new instance of grgsm::burst_sink_qa.
* \brief Return a shared_ptr to a new instance of grgsm::burst_sink.
*
* To avoid accidental use of raw pointers, grgsm::burst_sink_qa's
* To avoid accidental use of raw pointers, grgsm::burst_sink's
* constructor is in a private implementation
* class. grgsm::burst_sink_qa::make is the public interface for
* class. grgsm::burst_sink::make is the public interface for
* creating new instances.
*/
static sptr make();
@ -56,5 +56,5 @@ namespace gr {
} // namespace gsm
} // namespace gr
#endif /* INCLUDED_GSM_BURST_SINK_QA_H */
#endif /* INCLUDED_GSM_BURST_SINK_H */

View File

@ -20,8 +20,8 @@
*
*/
#ifndef INCLUDED_GSM_BURST_SOURCE_QA_H
#define INCLUDED_GSM_BURST_SOURCE_QA_H
#ifndef INCLUDED_GSM_BURST_SOURCE_H
#define INCLUDED_GSM_BURST_SOURCE_H
#include <grgsm/api.h>
#include <gnuradio/block.h>
@ -34,17 +34,17 @@ namespace gr {
* \ingroup gsm
*
*/
class GSM_API burst_source_qa : virtual public gr::block
class GSM_API burst_source : virtual public gr::block
{
public:
typedef boost::shared_ptr<burst_source_qa> sptr;
typedef boost::shared_ptr<burst_source> sptr;
/*!
* \brief Return a shared_ptr to a new instance of grgsm::burst_source_qa.
* \brief Return a shared_ptr to a new instance of grgsm::burst_source.
*
* To avoid accidental use of raw pointers, grgsm::burst_source_qa's
* To avoid accidental use of raw pointers, grgsm::burst_source's
* constructor is in a private implementation
* class. grgsm::burst_source_qa::make is the public interface for
* class. grgsm::burst_source::make is the public interface for
* creating new instances.
*/
static sptr make(const std::vector<int> &framenumbers,
@ -59,6 +59,6 @@ namespace gr {
} // namespace gsm
} // namespace gr
#endif /* INCLUDED_GSM_BURST_SOURCE_QA_H */
#endif /* INCLUDED_GSM_BURST_SOURCE_H */

View File

@ -52,8 +52,8 @@ list(APPEND grgsm_sources
misc_utils/tmsi_dumper_impl.cc
misc_utils/burst_file_sink_impl.cc
misc_utils/burst_file_source_impl.cc
qa_utils/burst_sink_qa_impl.cc
qa_utils/burst_source_qa_impl.cc
qa_utils/burst_sink_impl.cc
qa_utils/burst_source_impl.cc
qa_utils/message_source_impl.cc
qa_utils/message_sink_impl.cc
decryption/decryption_impl.cc

View File

@ -25,7 +25,7 @@
#endif
#include <gnuradio/io_signature.h>
#include "burst_sink_qa_impl.h"
#include "burst_sink_impl.h"
#include <stdio.h>
#include <sstream>
#include <grgsm/gsmtap.h>
@ -33,29 +33,29 @@
namespace gr {
namespace gsm {
burst_sink_qa::sptr
burst_sink_qa::make()
burst_sink::sptr
burst_sink::make()
{
return gnuradio::get_initial_sptr
(new burst_sink_qa_impl());
(new burst_sink_impl());
}
/*
* The private constructor
*/
burst_sink_qa_impl::burst_sink_qa_impl()
: gr::block("burst_sink_qa",
burst_sink_impl::burst_sink_impl()
: gr::block("burst_sink",
gr::io_signature::make(0, 0, 0),
gr::io_signature::make(0, 0, 0))
{
message_port_register_in(pmt::mp("in"));
set_msg_handler(pmt::mp("in"), boost::bind(&burst_sink_qa_impl::process_burst, this, _1));
set_msg_handler(pmt::mp("in"), boost::bind(&burst_sink_impl::process_burst, this, _1));
}
/*
* Our virtual destructor.
*/
burst_sink_qa_impl::~burst_sink_qa_impl()
burst_sink_impl::~burst_sink_impl()
{
// for (int i=0; i<d_burst_data.size(); i++)
// {
@ -63,7 +63,7 @@ namespace gr {
// }
}
void burst_sink_qa_impl::process_burst(pmt::pmt_t msg)
void burst_sink_impl::process_burst(pmt::pmt_t msg)
{
pmt::pmt_t header_plus_burst = pmt::cdr(msg);
@ -90,17 +90,17 @@ namespace gr {
d_burst_data.push_back(burst_str.str());
}
std::vector<int> burst_sink_qa_impl::get_framenumbers()
std::vector<int> burst_sink_impl::get_framenumbers()
{
return d_framenumbers;
}
std::vector<int> burst_sink_qa_impl::get_timeslots()
std::vector<int> burst_sink_impl::get_timeslots()
{
return d_timeslots;
}
std::vector<std::string> burst_sink_qa_impl::get_burst_data()
std::vector<std::string> burst_sink_impl::get_burst_data()
{
return d_burst_data;
}

View File

@ -20,24 +20,24 @@
*
*/
#ifndef INCLUDED_GSM_BURST_SINK_QA_IMPL_H
#define INCLUDED_GSM_BURST_SINK_QA_IMPL_H
#ifndef INCLUDED_GSM_BURST_SINK_IMPL_H
#define INCLUDED_GSM_BURST_SINK_IMPL_H
#include <grgsm/qa_utils/burst_sink_qa.h>
#include <grgsm/qa_utils/burst_sink.h>
#include <fstream>
namespace gr {
namespace gsm {
class burst_sink_qa_impl : public burst_sink_qa
class burst_sink_impl : public burst_sink
{
private:
std::vector<int> d_framenumbers;
std::vector<int> d_timeslots;
std::vector<std::string> d_burst_data;
public:
burst_sink_qa_impl();
~burst_sink_qa_impl();
burst_sink_impl();
~burst_sink_impl();
void process_burst(pmt::pmt_t msg);
virtual std::vector<int> get_framenumbers();
virtual std::vector<int> get_timeslots();
@ -47,5 +47,5 @@ namespace gr {
} // namespace gsm
} // namespace gr
#endif /* INCLUDED_GSM_BURST_SINK_QA_IMPL_H */
#endif /* INCLUDED_GSM_BURST_SINK_IMPL_H */

View File

@ -25,7 +25,7 @@
#endif
#include <gnuradio/io_signature.h>
#include "burst_source_qa_impl.h"
#include "burst_source_impl.h"
#include "stdio.h"
#include <boost/scoped_ptr.hpp>
#include <grgsm/gsmtap.h>
@ -36,22 +36,22 @@
namespace gr {
namespace gsm {
burst_source_qa::sptr
burst_source_qa::make(const std::vector<int> &framenumbers,
burst_source::sptr
burst_source::make(const std::vector<int> &framenumbers,
const std::vector<int> &timeslots,
const std::vector<std::string> &burst_data)
{
return gnuradio::get_initial_sptr
(new burst_source_qa_impl(framenumbers, timeslots, burst_data));
(new burst_source_impl(framenumbers, timeslots, burst_data));
}
/*
* The private constructor
*/
burst_source_qa_impl::burst_source_qa_impl(const std::vector<int> &framenumbers,
burst_source_impl::burst_source_impl(const std::vector<int> &framenumbers,
const std::vector<int> &timeslots,
const std::vector<std::string> &burst_data)
: gr::block("burst_source_qa",
: gr::block("burst_source",
gr::io_signature::make(0, 0, 0),
gr::io_signature::make(0, 0, 0)),
d_finished(false)
@ -65,37 +65,37 @@ namespace gr {
/*
* Our virtual destructor.
*/
burst_source_qa_impl::~burst_source_qa_impl()
burst_source_impl::~burst_source_impl()
{
if (d_finished == false){
d_finished = true;
}
}
void burst_source_qa_impl::set_framenumbers(const std::vector<int> &framenumbers)
void burst_source_impl::set_framenumbers(const std::vector<int> &framenumbers)
{
d_framenumbers = framenumbers;
}
void burst_source_qa_impl::set_timeslots(const std::vector<int> &timeslots)
void burst_source_impl::set_timeslots(const std::vector<int> &timeslots)
{
d_timeslots = timeslots;
}
void burst_source_qa_impl::set_burst_data(const std::vector<std::string> &burst_data)
void burst_source_impl::set_burst_data(const std::vector<std::string> &burst_data)
{
d_burst_data = burst_data;
}
bool burst_source_qa_impl::start()
bool burst_source_impl::start()
{
d_finished = false;
d_thread = boost::shared_ptr<gr::thread::thread>
(new gr::thread::thread(boost::bind(&burst_source_qa_impl::run, this)));
(new gr::thread::thread(boost::bind(&burst_source_impl::run, this)));
return block::start();
}
bool burst_source_qa_impl::stop()
bool burst_source_impl::stop()
{
d_finished = true;
d_thread->interrupt();
@ -103,12 +103,12 @@ namespace gr {
return block::stop();
}
bool burst_source_qa_impl::finished()
bool burst_source_impl::finished()
{
return d_finished;
}
void burst_source_qa_impl::run()
void burst_source_impl::run()
{
char *unserialized = (char*)malloc(sizeof(char) * PMT_SIZE);

View File

@ -20,19 +20,19 @@
*
*/
#ifndef INCLUDED_GSM_BURST_SOURCE_QA_IMPL_H
#define INCLUDED_GSM_BURST_SOURCE_QA_IMPL_H
#ifndef INCLUDED_GSM_BURST_SOURCE_IMPL_H
#define INCLUDED_GSM_BURST_SOURCE_IMPL_H
#define BURST_SIZE 148
#include <grgsm/qa_utils/burst_source_qa.h>
#include <grgsm/qa_utils/burst_source.h>
#include <fstream>
namespace gr {
namespace gsm {
class burst_source_qa_impl : public burst_source_qa
class burst_source_impl : public burst_source
{
private:
boost::shared_ptr<gr::thread::thread> d_thread;
@ -42,10 +42,10 @@ namespace gr {
bool d_finished;
void run();
public:
burst_source_qa_impl(const std::vector<int> &framenumbers,
burst_source_impl(const std::vector<int> &framenumbers,
const std::vector<int> &timeslots,
const std::vector<std::string> &burst_data);
~burst_source_qa_impl();
~burst_source_impl();
virtual void set_framenumbers(const std::vector<int> &framenumbers);
virtual void set_timeslots(const std::vector<int> &timeslots);
virtual void set_burst_data(const std::vector<std::string> &burst_data);
@ -56,6 +56,6 @@ namespace gr {
} // namespace gsm
} // namespace gr
#endif /* INCLUDED_GSM_BURST_SOURCE_QA_IMPL_H */
#endif /* INCLUDED_GSM_BURST_SOURCE_IMPL_H */

View File

@ -56,9 +56,9 @@ class qa_decryption (gr_unittest.TestCase):
key = [0x32,0xE5,0x45,0x53,0x20,0x8C,0xE0,0x00]
a5_version = 1
src = grgsm.burst_source_qa(framenumbers_input, timeslots_input, bursts_input)
src = grgsm.burst_source(framenumbers_input, timeslots_input, bursts_input)
decryption = grgsm.decryption((key), a5_version)
dst = grgsm.burst_sink_qa()
dst = grgsm.burst_sink()
self.tb.msg_connect(src, "out", decryption, "bursts")
self.tb.msg_connect(decryption, "bursts", dst, "in")
@ -97,9 +97,9 @@ class qa_decryption (gr_unittest.TestCase):
key = [0xAD,0x6A,0x3E,0xC2,0xB4,0x42,0xE4,0x00]
a5_version = 1
src = grgsm.burst_source_qa(framenumbers_input, timeslots_input, bursts_input)
src = grgsm.burst_source(framenumbers_input, timeslots_input, bursts_input)
decryption = grgsm.decryption((key), a5_version)
dst = grgsm.burst_sink_qa()
dst = grgsm.burst_sink()
self.tb.msg_connect(src, "out", decryption, "bursts")
self.tb.msg_connect(decryption, "bursts", dst, "in")
@ -138,9 +138,9 @@ class qa_decryption (gr_unittest.TestCase):
key = [0x41,0xBC,0x19,0x30,0xB6,0x31,0x8A,0xC8]
a5_version = 3
src = grgsm.burst_source_qa(framenumbers_input, timeslots_input, bursts_input)
src = grgsm.burst_source(framenumbers_input, timeslots_input, bursts_input)
decryption = grgsm.decryption((key), a5_version)
dst = grgsm.burst_sink_qa()
dst = grgsm.burst_sink()
self.tb.msg_connect(src, "out", decryption, "bursts")
self.tb.msg_connect(decryption, "bursts", dst, "in")
@ -179,9 +179,9 @@ class qa_decryption (gr_unittest.TestCase):
key = [0xAD,0x2C,0xB3,0x83,0x2F,0x4A,0x6C,0xF1]
a5_version = 3
src = grgsm.burst_source_qa(framenumbers_input, timeslots_input, bursts_input)
src = grgsm.burst_source(framenumbers_input, timeslots_input, bursts_input)
decryption = grgsm.decryption((key), a5_version)
dst = grgsm.burst_sink_qa()
dst = grgsm.burst_sink()
self.tb.msg_connect(src, "out", decryption, "bursts")
self.tb.msg_connect(decryption, "bursts", dst, "in")

View File

@ -25,8 +25,8 @@
#include "grgsm/misc_utils/tmsi_dumper.h"
#include "grgsm/misc_utils/burst_file_sink.h"
#include "grgsm/misc_utils/burst_file_source.h"
#include "grgsm/qa_utils/burst_sink_qa.h"
#include "grgsm/qa_utils/burst_source_qa.h"
#include "grgsm/qa_utils/burst_sink.h"
#include "grgsm/qa_utils/burst_source.h"
#include "grgsm/qa_utils/message_source.h"
#include "grgsm/qa_utils/message_sink.h"
%}
@ -71,10 +71,10 @@ GR_SWIG_BLOCK_MAGIC2(gsm, message_printer);
%include "grgsm/misc_utils/tmsi_dumper.h"
GR_SWIG_BLOCK_MAGIC2(gsm, tmsi_dumper);
%include "grgsm/qa_utils/burst_sink_qa.h"
GR_SWIG_BLOCK_MAGIC2(gsm, burst_sink_qa);
%include "grgsm/qa_utils/burst_source_qa.h"
GR_SWIG_BLOCK_MAGIC2(gsm, burst_source_qa);
%include "grgsm/qa_utils/burst_sink.h"
GR_SWIG_BLOCK_MAGIC2(gsm, burst_sink);
%include "grgsm/qa_utils/burst_source.h"
GR_SWIG_BLOCK_MAGIC2(gsm, burst_source);
%include "grgsm/qa_utils/message_source.h"
GR_SWIG_BLOCK_MAGIC2(gsm, message_source);
%include "grgsm/qa_utils/message_sink.h"