aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/misc_utils/burst_file_source_impl.cc13
-rw-r--r--lib/qa_utils/burst_source_impl.cc4
2 files changed, 4 insertions, 13 deletions
diff --git a/lib/misc_utils/burst_file_source_impl.cc b/lib/misc_utils/burst_file_source_impl.cc
index 4367150..85d5ad9 100644
--- a/lib/misc_utils/burst_file_source_impl.cc
+++ b/lib/misc_utils/burst_file_source_impl.cc
@@ -28,8 +28,6 @@
#include "burst_file_source_impl.h"
#include "stdio.h"
-#define PMT_SIZE 174
-
namespace gr {
namespace gsm {
@@ -86,16 +84,13 @@ namespace gr {
void burst_file_source_impl::run()
{
- char *unserialized = (char*)malloc(sizeof(char) * PMT_SIZE);
- while (d_input_file.read(unserialized, PMT_SIZE) && !d_finished)
+ std::filebuf* pbuf = d_input_file.rdbuf();
+ while (!d_finished)
{
- if (d_input_file.bad())
- {
+ pmt::pmt_t burst = pmt::deserialize(*pbuf);
+ if (pmt::is_eof_object(burst)) {
break;
}
-
- std::string s(unserialized, PMT_SIZE);
- pmt::pmt_t burst = pmt::deserialize_str(s);
message_port_pub(pmt::mp("out"), burst);
}
d_input_file.close();
diff --git a/lib/qa_utils/burst_source_impl.cc b/lib/qa_utils/burst_source_impl.cc
index db3d85a..f415eaf 100644
--- a/lib/qa_utils/burst_source_impl.cc
+++ b/lib/qa_utils/burst_source_impl.cc
@@ -31,8 +31,6 @@
#include <grgsm/gsmtap.h>
#include <grgsm/endian.h>
-#define PMT_SIZE 174
-
namespace gr {
namespace gsm {
@@ -110,8 +108,6 @@ namespace gr {
void burst_source_impl::run()
{
- char *unserialized = (char*)malloc(sizeof(char) * PMT_SIZE);
-
for (int i=0; i<d_burst_data.size(); i++)
{
if (d_burst_data[i].length() == BURST_SIZE &&