<div dir="auto">Hi everyone,<div dir="auto"><br></div><div dir="auto">I did fix the problem, in a way that i did not expected</div><div dir="auto"><br></div><div dir="auto">Insteaf of initializing the size_t result at 24 (three doubles of the Vector)</div><div dir="auto"><br></div><div dir="auto">I initialized it at 0 and then i called</div><div dir="auto">lenght+=encoder.prependVarNumber(24)</div><div dir="auto"><br></div><div dir="auto">I dont really understand the difference because i read that the function just return the value passed.</div><div dir="auto"><br></div><div dir="auto">Can you please explain it to me, i am a little bit confused.</div><div dir="auto"><br></div><div dir="auto">Thanks in advance and best regards.</div><div dir="auto"><br></div><div dir="auto">Nabil</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le dim. 17 mai 2020 à 06:32, nabil khemache <<a href="mailto:khemache.nabil@gmail.com">khemache.nabil@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi everyone,</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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?</div><div><br></div><div>You can find here all the files that i modified, and new one called Position.hpp and Position.cpp<br></div><div><br></div><div><a href="https://github.com/nevil-khemache/ndnSIM-CustomField" target="_blank" rel="noreferrer">https://github.com/nevil-khemache/ndnSIM-CustomField</a></div><div><br></div><div>i had this error when trying to setTag in the Interest packet :</div><div><br></div><div>terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<ndn::Block::Error> >'<br>  what():  TLV-LENGTH doesn't match buffer size</div><div><br></div><div>I don't really know what i am missing or misunderstanding, i think i might encode or decode my field in a wrong way.</div><div><br></div><div>Your help is, as always, very important to me.</div><div><br></div><div>thanks in advance et best regards</div><div><br></div><div>Nabil<br></div></div>
</blockquote></div>