[ndnSIM] Adding new packet fields

nabil khemache khemache.nabil at gmail.com
Sun May 17 09:00:14 PDT 2020


Hi everyone,

I did fix the problem, in a way that i did not expected

Insteaf of initializing the size_t result at 24 (three doubles of the
Vector)

I initialized it at 0 and then i called
lenght+=encoder.prependVarNumber(24)

I dont really understand the difference because i read that the function
just return the value passed.

Can you please explain it to me, i am a little bit confused.

Thanks in advance and best regards.

Nabil

Le dim. 17 mai 2020 à 06:32, nabil khemache <khemache.nabil at gmail.com> a
écrit :

> Hi everyone,
>
> I just add Tags (common types) in my packets and it worked very well,
> thanks to the advices i did found here in the archives.
>
> But when i tired to set specific type of Tags, which is in my case the
> position of the sending node (Vector3D), i had to create a new class to
> implement the Encode and Decode functions.
>
> I'm not very familiar with the concept, i just understood that the encode
> method had to compute the  size of the field, and the Decode is to convert
> from a const unit8_t value read from the Block to the field type we want.
> Am i right?
>
> You can find here all the files that i modified, and new one called
> Position.hpp and Position.cpp
>
> https://github.com/nevil-khemache/ndnSIM-CustomField
>
> i had this error when trying to setTag in the Interest packet :
>
> terminate called after throwing an instance of
> 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<ndn::Block::Error>
> >'
>   what():  TLV-LENGTH doesn't match buffer size
>
> I don't really know what i am missing or misunderstanding, i think i might
> encode or decode my field in a wrong way.
>
> Your help is, as always, very important to me.
>
> thanks in advance et best regards
>
> Nabil
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20200517/7eba1d59/attachment-0001.html>


More information about the ndnSIM mailing list