# Adding EOB when using Vectors

**URL:** <https://www.ruby-forum.com/t/adding-eob-when-using-vectors/233941>\
**Category:** GNU Radio\
**Created:** [January 23, 2015, 6:49pm UTC](https://www.ruby-forum.com/t/adding-eob-when-using-vectors/233941 "2015-01-23T18:49:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [January 23, 2015, 6:49pm UTC](https://www.ruby-forum.com/t/adding-eob-when-using-vectors/233941/1 "2015-01-23T18:49:26Z")

</div>

?Dear All,

I am trying to use TX\_TIME, SOB, EOB. How do I add the EOB when I am  
using a vector?

The block I have created takes in vector of 47520 samples, i.e. one  
item, I want to add TX\_TIME and SOB to the first sample. This is no  
problem, I add it to the item. After the following ‘vector\_to\_stream’  
conversion, the TX\_TIME and SOB map through to item 0, 47520, 95040 etc.

But how do I get the EOB to be on item 47519?

Regards,

David

* * *

NOTE: The information in this email and any attachments may be  
confidential and/or legally privileged. This message may be read, copied  
and used only by the intended recipient. If you are not the intended  
recipient, please destroy this message, delete any copies held on your  
system and notify the sender immediately.

Toshiba Research Europe Limited, registered in England and Wales  
(2519556). Registered Office 208 Cambridge Science Park, Milton Road,  
Cambridge CB4 0GZ, England. Web: www.toshiba.eu/research/trl

---

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [January 23, 2015, 7:19pm UTC](https://www.ruby-forum.com/t/adding-eob-when-using-vectors/233941/2 "2015-01-23T19:19:33Z")

</div>

Use tagged streams. usrp\_sink will place the EOB on your last sample,  
even if bursts are of different lengths in that case.

M

---

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [January 23, 2015, 7:31pm UTC](https://www.ruby-forum.com/t/adding-eob-when-using-vectors/233941/3 "2015-01-23T19:31:21Z")

</div>

Thanks. Does it matter what the tag is, does it have to be “packet\_len”?

DH

* * *

From: [discuss-gnuradio-bounces+david.halls=removed\_email\_address@domain.invalid](mailto:discuss-gnuradio-bounces+david.halls=removed_email_address@domain.invalid)  
[discuss-gnuradio-bounces+david.halls=removed\_email\_address@domain.invalid](mailto:discuss-gnuradio-bounces+david.halls=removed_email_address@domain.invalid) on  
behalf of Martin B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: 23 January 2015 18:18  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Discuss-gnuradio] Adding EOB when using Vectors

Use tagged streams. usrp\_sink will place the EOB on your last sample,  
even if bursts are of different lengths in that case.

M

On 01/23/2015 06:47 PM, David Halls wrote:

> conversion, the TX\_TIME and SOB map through to item 0, 47520, 95040 etc.
> 
> Cambridge CB4 0GZ, England. Web: www.toshiba.eu/research/trl
> 
> * * *
> 
> Discuss-gnuradio mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

* * *

Discuss-gnuradio mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> **[Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)**

* * *

NOTE: The information in this email and any attachments may be  
confidential and/or legally privileged. This message may be read, copied  
and used only by the intended recipient. If you are not the intended  
recipient, please destroy this message, delete any copies held on your  
system and notify the sender immediately.

Toshiba Research Europe Limited, registered in England and Wales  
(2519556). Registered Office 208 Cambridge Science Park, Milton Road,  
Cambridge CB4 0GZ, England. Web: www.toshiba.eu/research/trl

---

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [February 2, 2015, 12:57pm UTC](https://www.ruby-forum.com/t/adding-eob-when-using-vectors/233941/4 "2015-02-02T12:57:35Z")

</div>

Thanks Martin,

Unfortunately I couldn’t get this to work, even when adding packet\_len.

To solve the problem I added another custom sync block called ‘add\_EOB’  
that takes in packet\_len and adds EOB on the relevant item.

```
            for(int i=0; i<noutput_items; i++)

```

{  
if( nitems\_written(0)+i == (d\_samples-1)+d\_burst\_num\*d\_samples )  
{  
add\_item\_tag(0, //stream ID  
nitems\_written(0)+i,  
pmt::string\_to\_symbol(“tx\_eob”), //tag name  
pmt::from\_bool(1)//, //set this true to indicate end of burst  
//pmt::string\_to\_symbol(id.str())  
);  
d\_burst\_num++;  
}  
out[i] = in[i];  
}

* * *

From: [discuss-gnuradio-bounces+david.halls=removed\_email\_address@domain.invalid](mailto:discuss-gnuradio-bounces+david.halls=removed_email_address@domain.invalid)  
[discuss-gnuradio-bounces+david.halls=removed\_email\_address@domain.invalid](mailto:discuss-gnuradio-bounces+david.halls=removed_email_address@domain.invalid) on  
behalf of Martin B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: 23 January 2015 18:56  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Discuss-gnuradio] Adding EOB when using Vectors

It hast to be whatever you set it to when you make the block. See the  
make() function in the manual for a description.

Cheers,  
M

On 01/23/2015 07:20 PM, David Halls wrote:

> Subject: Re: [Discuss-gnuradio] Adding EOB when using Vectors
> 
> > I am trying to use TX\_TIME, SOB, EOB. How do I add the EOB when I am
> > 
> > confidential and/or legally privileged. This message may be read, copied
> > 
> > [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)  
> > NOTE: The information in this email and any attachments may be
> 
> * * *
> 
> ## This email has been scanned for email related threats and delivered safely by Mimecast. For more information please visit [http://www.mimecast.com](http://www.mimecast.com)

* * *

Discuss-gnuradio mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> **[Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)**

* * *

NOTE: The information in this email and any attachments may be  
confidential and/or legally privileged. This message may be read, copied  
and used only by the intended recipient. If you are not the intended  
recipient, please destroy this message, delete any copies held on your  
system and notify the sender immediately.

Toshiba Research Europe Limited, registered in England and Wales  
(2519556). Registered Office 208 Cambridge Science Park, Milton Road,  
Cambridge CB4 0GZ, England. Web: www.toshiba.eu/research/trl

---

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [January 23, 2015, 7:58pm UTC](https://www.ruby-forum.com/t/adding-eob-when-using-vectors/233941/5 "2015-01-23T19:58:08Z")

</div>

It hast to be whatever you set it to when you make the block. See the  
make() function in the manual for a description.

Cheers,  
M
