<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi JianDe,</p>
    Here's how I added a string data to a Data packet for a Content
    producer to send:<br>
    <br>
    #include "../ndn-cxx/src/encoding/block-helpers.hpp"<br>
    #include "../ndn-cxx/src/encoding/tlv.hpp"<br>
    auto data = make_shared<Data>();<br>
    const std::string str = "01010101";<br>
data->setContent(::ndn::encoding::makeStringBlock(::ndn::tlv::Content,
    str));<br>
    <br>
    <br>
    The way for a Consumer to check the data it received is:<br>
    <br>
    data->getContent().value();<br>
    <br>
    <br>
    I hope this helps!!<br>
    <br>
    Best regards,<br>
    Yoshimichi Nakatsuka<br>
    <br>
    <div class="moz-cite-prefix">On 2016/12/14 15:41, 呂建德 wrote:<br>
    </div>
    <blockquote
cite="mid:CAOaFBRUruQ6DkpuYjgaKnaQ2xJs2nfQQ1aHebbo5DiX-dkxaDA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Dear all ndn-sim user
        <div><br>
        </div>
        <div><br>
        </div>
        <div>I want to add some data  like "01010101" on data packet  </div>
        <div><br>
        </div>
        <div>And then , for consumer , have to check the data "01010101"
          right or not.</div>
        <div><br>
        </div>
        <div>there will be a channel coding on it.</div>
        <div><br>
        </div>
        <div>so I dont know how to add to the packet.</div>
        <div><br>
        </div>
        <div>I know the ns2 how to add , but the ns3 ndn-sim i cant.</div>
        <div><br>
        </div>
        <div>can someone help me?</div>
        <div><br>
        </div>
        <div>Best wishes,  JianDe</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
ndnSIM mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a>
<a class="moz-txt-link-freetext" href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a>
</pre>
    </blockquote>
  </body>
</html>