delete string_to_blob block

This commit is contained in:
Bastian Bloessl
2013-06-21 22:01:40 +02:00
parent 39b55a1daa
commit 36c3596197
7 changed files with 2 additions and 133 deletions
-1
View File
@@ -22,7 +22,6 @@ install(FILES
foo_packet_dropper.xml foo_packet_dropper.xml
foo_packet_pad.xml foo_packet_pad.xml
foo_periodic_msg_source.xml foo_periodic_msg_source.xml
foo_string_to_blob.xml
foo_wireshark_connector.xml foo_wireshark_connector.xml
DESTINATION share/gnuradio/grc/blocks DESTINATION share/gnuradio/grc/blocks
) )
-19
View File
@@ -1,19 +0,0 @@
<?xml version="1.0"?>
<block>
<name>String to Blob</name>
<key>foo_string_to_blob</key>
<category>Foo</category>
<import>import foo</import>
<make>foo.string_to_blob()</make>
<sink>
<name>in</name>
<type>message</type>
</sink>
<source>
<name>out</name>
<type>message</type>
</source>
</block>
-1
View File
@@ -26,7 +26,6 @@ install(FILES
packet_dropper.h packet_dropper.h
packet_pad.h packet_pad.h
periodic_msg_source.h periodic_msg_source.h
string_to_blob.h
wireshark_connector.h wireshark_connector.h
DESTINATION include/foo DESTINATION include/foo
) )
-38
View File
@@ -1,38 +0,0 @@
/*
* Copyright (C) 2013 Bastian Bloessl <bloessl@ccs-labs.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INCLUDED_FOO_STRING_TO_BLOB_H
#define INCLUDED_FOO_STRING_TO_BLOB_H
#include <foo/api.h>
#include <gnuradio/block.h>
namespace gr {
namespace foo {
class FOO_API string_to_blob : virtual public gr::block
{
public:
typedef boost::shared_ptr<string_to_blob> sptr;
static sptr make();
};
} // namespace foo
} // namespace gr
#endif /* INCLUDED_FOO_STRING_TO_BLOB_H */
-1
View File
@@ -30,7 +30,6 @@ list(APPEND foo_sources
packet_dropper_impl.cc packet_dropper_impl.cc
packet_pad_impl.cc packet_pad_impl.cc
periodic_msg_source_impl.cc periodic_msg_source_impl.cc
string_to_blob_impl.cc
wireshark_connector_impl.cc wireshark_connector_impl.cc
) )
-69
View File
@@ -1,69 +0,0 @@
/*
* Copyright (C) 2013 Bastian Bloessl <bloessl@ccs-labs.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <foo/string_to_blob.h>
#include <gnuradio/io_signature.h>
#include <gnuradio/block_detail.h>
#include <string.h>
using namespace gr::foo;
class string_to_blob_impl : public string_to_blob {
public:
string_to_blob_impl() :
block("string_to_blob",
gr::io_signature::make(0, 0, 0),
gr::io_signature::make(0, 0, 0)) {
message_port_register_out(pmt::mp("out"));
message_port_register_in(pmt::mp("in"));
set_msg_handler(pmt::mp("in"), boost::bind(&string_to_blob_impl::make_blob, this, _1));
}
~string_to_blob_impl() {
}
void make_blob(pmt::pmt_t msg) {
if(pmt::is_eof_object(msg)) {
message_port_pub(pmt::mp("out"), pmt::PMT_EOF);
detail().get()->set_done(true);
return;
}
assert(pmt::is_symbol(msg));
int len = pmt::symbol_to_string(msg).length();
const char *data = pmt::symbol_to_string(msg).data();
pmt::pmt_t blob = pmt::make_blob(data, len);
message_port_pub(pmt::mp("out"), blob);
}
};
string_to_blob::sptr
string_to_blob::make() {
return gnuradio::get_initial_sptr(new string_to_blob_impl());
}
+2 -4
View File
@@ -10,7 +10,6 @@
#include "foo/packet_dropper.h" #include "foo/packet_dropper.h"
#include "foo/packet_pad.h" #include "foo/packet_pad.h"
#include "foo/periodic_msg_source.h" #include "foo/periodic_msg_source.h"
#include "foo/string_to_blob.h"
#include "foo/wireshark_connector.h" #include "foo/wireshark_connector.h"
%} %}
@@ -19,12 +18,11 @@
%include "foo/packet_dropper.h" %include "foo/packet_dropper.h"
%include "foo/packet_pad.h" %include "foo/packet_pad.h"
%include "foo/periodic_msg_source.h" %include "foo/periodic_msg_source.h"
%include "foo/string_to_blob.h"
%include "foo/wireshark_connector.h" %include "foo/wireshark_connector.h"
GR_SWIG_BLOCK_MAGIC2(foo, burst_tagger); GR_SWIG_BLOCK_MAGIC2(foo, burst_tagger);
GR_SWIG_BLOCK_MAGIC2(foo, packet_dropper); GR_SWIG_BLOCK_MAGIC2(foo, packet_dropper);
GR_SWIG_BLOCK_MAGIC2(foo, wireshark_connector);
GR_SWIG_BLOCK_MAGIC2(foo, packet_pad); GR_SWIG_BLOCK_MAGIC2(foo, packet_pad);
GR_SWIG_BLOCK_MAGIC2(foo, periodic_msg_source); GR_SWIG_BLOCK_MAGIC2(foo, periodic_msg_source);
GR_SWIG_BLOCK_MAGIC2(foo, string_to_blob); GR_SWIG_BLOCK_MAGIC2(foo, wireshark_connector);