[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Issue transmitting samples using vector i/o
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] Issue transmitting samples using vector i/o |
Date: |
Mon, 8 Feb 2010 14:00:02 -0800 |
User-agent: |
Mutt/1.5.20 (2009-08-17) |
On Mon, Feb 08, 2010 at 12:23:25PM -0500, Charles Irick wrote:
> I'm running into issues with the sendmsg command in the vectorized
> send path. Depending on the buffer size I get an error returned for
> "Bad Address"
>
> >> ethernet:write_packetv: send: Bad address
>
> I'm working at the c++ level right now and my program is pretty simple:
>
> usrp2::usrp2::sptr u2 = usrp2::usrp2::make(interface,mac_addr);
>
> usrp2::tx_metadata md;
> md.timestamp = -1;
> md.start_of_burst = 1;
> md.send_now = 1;
>
> uint32_t buf[1000];
> u2->tx_raw(0,buf,sizeof(buf),&md);
/*!
* \brief transmit raw uint32_t data items to USRP2
*
* The caller is responsible for ensuring that the items are
* formatted appropriately for the USRP2 and its configuration.
* This method is used primarily by the system itself. Users
* should call tx_32fc or tx_16sc instead.
*
* \param channel specifies the channel to send them to
* \param items are the data items to transmit
* \param nitems is the number of items to transmit
* \param metadata provides the timestamp and flags
*/
bool tx_raw(unsigned int channel,
const uint32_t *items,
size_t nitems,
const tx_metadata *metadata);
The 3rd arg is the number of 32-bit items.
Try using sizeof(buf)/sizeof(buf[0])
Also, unless you're running on a big endian machine, you're going to
need to handle the endianness issue or use the slightly higher level
interfaces tx_32fc or tx16_sc.
Eric