cs: coding style
This commit is contained in:
@@ -25,17 +25,15 @@
|
||||
#include <gnuradio/sync_block.h>
|
||||
|
||||
namespace gr {
|
||||
namespace ieee802_11 {
|
||||
namespace ieee802_11 {
|
||||
|
||||
class IEEE802_11_API extract_csi : virtual public gr::sync_block
|
||||
{
|
||||
public:
|
||||
class IEEE802_11_API extract_csi : virtual public gr::sync_block {
|
||||
public:
|
||||
typedef boost::shared_ptr<extract_csi> sptr;
|
||||
static sptr make();
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace ieee802_11
|
||||
} // namespace ieee802_11
|
||||
} // namespace gr
|
||||
|
||||
#endif /* INCLUDED_IEEE802_11_EXTRACT_CSI_H */
|
||||
|
||||
|
||||
+20
-27
@@ -26,47 +26,41 @@
|
||||
#include "extract_csi_impl.h"
|
||||
|
||||
namespace gr {
|
||||
namespace ieee802_11 {
|
||||
namespace ieee802_11 {
|
||||
|
||||
extract_csi::sptr
|
||||
extract_csi::make()
|
||||
{
|
||||
return gnuradio::get_initial_sptr
|
||||
(new extract_csi_impl());
|
||||
}
|
||||
extract_csi::sptr extract_csi::make() {
|
||||
return gnuradio::get_initial_sptr(new extract_csi_impl());
|
||||
}
|
||||
|
||||
|
||||
extract_csi_impl::extract_csi_impl()
|
||||
: gr::sync_block("extract_csi",
|
||||
gr::io_signature::make(0, 0, 0),
|
||||
gr::io_signature::make(1, 1, 52 * sizeof(gr_complex)))
|
||||
{
|
||||
extract_csi_impl::extract_csi_impl()
|
||||
: gr::sync_block("extract_csi", gr::io_signature::make(0, 0, 0),
|
||||
gr::io_signature::make(1, 1, 52 * sizeof(gr_complex))) {
|
||||
message_port_register_in(pmt::mp("pdu in"));
|
||||
}
|
||||
}
|
||||
|
||||
extract_csi_impl::~extract_csi_impl()
|
||||
{
|
||||
}
|
||||
extract_csi_impl::~extract_csi_impl() {}
|
||||
|
||||
int
|
||||
extract_csi_impl::work(int noutput_items,
|
||||
int extract_csi_impl::work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
{
|
||||
gr_vector_void_star &output_items) {
|
||||
pmt::pmt_t pdu(delete_head_nowait(pmt::mp("pdu in")));
|
||||
|
||||
if (pdu.get() == NULL) return 0;
|
||||
if (pdu.get() == NULL)
|
||||
return 0;
|
||||
|
||||
if (!pmt::is_pair(pdu) || !pmt::is_dict(pmt::car(pdu)))
|
||||
throw std::runtime_error("received a malformed pdu message");
|
||||
|
||||
d_meta = pmt::car(pdu);
|
||||
|
||||
if (!pmt::dict_has_key(d_meta, pmt::mp("csi"))) return 0;
|
||||
if (!pmt::dict_has_key(d_meta, pmt::mp("csi")))
|
||||
return 0;
|
||||
|
||||
d_csi = pmt::c32vector_elements(pmt::dict_ref(d_meta, pmt::mp("csi"), pmt::PMT_NIL));
|
||||
d_csi = pmt::c32vector_elements(
|
||||
pmt::dict_ref(d_meta, pmt::mp("csi"), pmt::PMT_NIL));
|
||||
|
||||
gr_complex* out = (gr_complex*) output_items[0];
|
||||
gr_complex *out = (gr_complex *)output_items[0];
|
||||
|
||||
std::copy(d_csi.begin(), d_csi.end(), out);
|
||||
|
||||
@@ -78,8 +72,7 @@ namespace gr {
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
} /* namespace ieee802_11 */
|
||||
} /* namespace ieee802_11 */
|
||||
} /* namespace gr */
|
||||
|
||||
|
||||
+8
-13
@@ -24,27 +24,22 @@
|
||||
#include <ieee802_11/extract_csi.h>
|
||||
|
||||
namespace gr {
|
||||
namespace ieee802_11 {
|
||||
namespace ieee802_11 {
|
||||
|
||||
class extract_csi_impl : public extract_csi
|
||||
{
|
||||
private:
|
||||
class extract_csi_impl : public extract_csi {
|
||||
private:
|
||||
pmt::pmt_t d_meta;
|
||||
std::vector<gr_complex> d_csi;
|
||||
|
||||
public:
|
||||
public:
|
||||
extract_csi_impl();
|
||||
~extract_csi_impl();
|
||||
|
||||
int work(
|
||||
int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items
|
||||
);
|
||||
};
|
||||
int work(int noutput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
};
|
||||
|
||||
} // namespace ieee802_11
|
||||
} // namespace ieee802_11
|
||||
} // namespace gr
|
||||
|
||||
#endif /* INCLUDED_IEEE802_11_EXTRACT_CSI_IMPL_H */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user