Hi,

I am using USRP N210 for bursty packet transmission, and have difficulty to
understand "tx_md.end_of_burst = true" in C++ code. I am attaching my code
at the end and hope someone can help.

The problem is:
1. when I comment out "tx_md.end_of_burst = true" and use the function for
transmission periodically, my receiver can decode the packet successfully.
But it seems that it can only detect N - 1 packet, where N is the number of
packets that I sent at the transmitter. For example, when I send 3 packets,
the receiver can only decode 2 packets, and so forth. Not sure what is the
reason behind this.

2. When I uncomment "tx_md.end_of_burst = true" (either the one inside the
WHILE loop or outside one), my receiver cannot decode the packets anymore.
When I use spectrum analyzer to see the signal, I can see that the
transmitter does send the signal into the air and the waveform shape looks
right. However, the signal cannot be decoded.


Any suggestions?

Thank you!

Hua





=========================

size_t sdr_dev::usrp_transmit(vector<complex<float>*> tx_buff_ptr, size_t
requested_num_samps) {

    tx_md.start_of_burst = true;
    tx_md.end_of_burst = false;
    tx_md.has_time_spec = false;
    tx_md.time_spec = uhd::time_spec_t(1.0); //0.1

    //the first call to send() will block this many seconds before sending:
    timeout = seconds_in_future + 0.1; //timeout (delay before transmit +
padding)

    vector<complex<float>*> tx_buff_ptr_tmp = tx_buff_ptr;

    size_t acc_num_samps = 0; //number of accumulated samples
    size_t total_num_samps = requested_num_samps;
    while(acc_num_samps < total_num_samps) {
        size_t samps_to_send = total_num_samps - acc_num_samps;
        if (samps_to_send > tx_max_num_samps) {
            samps_to_send = tx_max_num_samps;
        }
        else {
            //tx_md.end_of_burst = true;
        }

        for (int i = 0; i < tx_buff_ptr.size(); i++) tx_buff_ptr_tmp[i] =
&tx_buff_ptr[i][acc_num_samps];

        //send a single packet
        size_t num_tx_samps = tx_stream->send(tx_buff_ptr_tmp,
samps_to_send, tx_md, timeout);

        //do not use time spec for subsequent packets
        tx_md.has_time_spec = false;
        tx_md.start_of_burst = false;

        acc_num_samps += num_tx_samps;
    }

    //tx_md.end_of_burst = true;
    tx_stream->send("", 0, tx_md);

    return acc_num_samps;
}
==============================
_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com

Reply via email to