title: NFC NDEF message formatting : payload size (ISO 15693 header, NfcV)
body: <p><strong>"Hey bro, what's up ?"</strong></p>
  
  <p>I'm in trouble with NDEF message formatting.</p>
  
  <p>I went through the NFC forum to know how to build a NDEF message with a single NDEF record (text RTD) with a payload, so I can program my tag (M24LR16E) through I2c.</p>
  
  <p>In addition to this, I programmed my tag with an external writer to have an example of a well formatted record.</p>
  
  <p>Then I programmed my tag through I2C with the exact same value, and everything worked well. Changing the payload characters gave me the proof of my success =)</p>
  
  <p><strong>"But you didn't come here to show us that anything worked well, no?"</strong></p>
  
  <p>You're right, know I'm trying to change the payload length and I get troubles. As soon as I change the PAYLOAD_LENGTH of the NDEF record it is no more recognized anymore as one. I changed the PAYLOAD_LENGTH from 10 down to 5, so it's not a problem of overflowing the config field.</p>
  
  <p><strong>"Great story, show me some code/config"</strong></p>
  
  <p>Here is my record configuration :</p>
  
  <ul>
  <li>"Header" (MB ME CF SR IL TNF) : 0xD1</li>
  <li>PAYLOAD_LENGTH : 0x0A</li>
  <li>TYPE LENGTH : 0x01</li>
  <li>TYPE : 0x54</li>
  <li>PAYLOAD :
  <ul>
  <li>0x02 ; UTF-8, 2 byte language code</li>
  <li>0x65 ; e</li>
  <li>0x6E ; n</li>
  <li>7 Other boring bytes</li>
  </ul></li>
  </ul>
  
  <p>Also, I noticed that if I override the 6 bytes before my NDEF message, the NDEF message isn't recognized anymore. I have no idea on what could be this data as the NFC specification doesn't talk about this, neither the tag datasheet.</p>
  
  <p><strong>"You're supposed to ask a question..."</strong></p>
  
  <p>Uh, well...</p>
  
  <ul>
  <li>Is there anything else than the PAYLOAD_LENGTH field of the NDEF record that I should change?</li>
  <li>What are those essential data before my NDEF message?</li>
  </ul>
  
  <p>My reader: Nexus 4 with NXP's "TagInfo" app</p>