введите здесь описание изображения
Затем я хочу подключиться к системе модуляции, но она не может работать из-за несоответствия размеров элементов, bbheader вместо этого принимает только 1 размер элемента 188
введите описание изображения здесь
поэтому я попытался сделать два блока, чтобы две стороны могли соответственно принять Размер 188 и 1 предмета
введите описание изображения
Код: Выделить всё
#include "udppacket_impl.h"
#include
namespace gr {
namespace udp0129 {
udppacket::sptr udppacket::make() { return gnuradio::make_block_sptr(); }
/*
* The private constructor
*/
udppacket_impl::udppacket_impl()
: gr::sync_block("udppacket",
gr::io_signature::make(1 , 1 , sizeof(unsigned char)*188),
gr::io_signature::make(1 , 1 , sizeof(unsigned char)))
{
}
/*
* Our virtual destructor.
*/
udppacket_impl::~udppacket_impl() {}
int udppacket_impl::work(int noutput_items,
gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items)
{
const unsigned char *in = (const unsigned char *) input_items[0];
unsigned char *out = (unsigned char *) output_items[0];
for(int i = 0; i < noutput_items; i++)
{
out[i]=in[i];
}
return noutput_items;
}
}
}
Код: Выделить всё
#include "packetudp_impl.h"
#include
namespace gr {
namespace udp0129 {
packetudp::sptr packetudp::make() { return gnuradio::make_block_sptr
(); }
/*
* The private constructor
*/
packetudp_impl::packetudp_impl()
: gr::sync_block("packetudp",
gr::io_signature::make(
1 , 1 , sizeof(unsigned char)),
gr::io_signature::make(
1 , 1 , sizeof(unsigned char)*188))
{
}
/*
* Our virtual destructor.
*/
packetudp_impl::~packetudp_impl() {}
int packetudp_impl::work(int noutput_items,
gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items)
{
const unsigned char *in = (const unsigned char *) input_items[0];
unsigned char *out = (unsigned char *) output_items[0];
for(int i = 0; i < noutput_items; i++)
{
out[i]=in[i];
}
return noutput_items;
}
} /* namespace udp0129 */
} /* namespace gr */
В gnuradio программа автоматически останавливается с сообщением ниже:
Мне нужна помощь с этим
Подробнее здесь: https://stackoverflow.com/questions/781 ... prev-error