0

I am trying to write an encoded ndef message using libfreefare example code. Would like to know how to interpret the below hex codes. I have already gathered some knowledge about NDEF format but those are little unhelpful to translate the below mentioned NDEF hex message. I am just following the example program and trying to change default value with my one. What are the below codes represent ?

Refer : https://github.com/nfc-tools/libfreefare/blob/master/examples/mifare-classic-write-ndef.c

I have already tried converting the Hex values to ASCII using online converter. I can able to see the text content but I am curious to know about meaning of the hex values in between the text.

const uint8_t ndef_default_msg[33] = {
    0xd1, 0x02, 0x1c, 0x53, 0x70, 0x91, 0x01, 0x09,
    0x54, 0x02, 0x65, 0x6e, 0x4c, 0x69, 0x62, 0x6e,
    0x66, 0x63, 0x51, 0x01, 0x0b, 0x55, 0x03, 0x6c,
    0x69, 0x62, 0x6e, 0x66, 0x63, 0x2e, 0x6f, 0x72,
    0x67
};

https://www.rapidtables.com/convert/number/ascii-hex-bin-dec-converter.html

I would like to construct a universal URI NDEF hex values for the below url.

scriptable:///run?scriptName=Clocking

Shameer
  • 51
  • 1
  • 1
  • 2
  • Welcome to SO. Do you want to decode the message with a C program or do you just want to understand what it means? – Gerhardh Jul 23 '19 at 08:55
  • I want to understand what does it mean. Basically, how to map these hex values with NDEF format ? For example, 0x03 is URI with http:// – Shameer Jul 23 '19 at 08:59
  • In this case I don't think your question is related to C or that specific NCF library. Instead it is more a problem about NFC spec. You might be better off searching for the spec. – Gerhardh Jul 23 '19 at 09:01

1 Answers1

0
0xD1,   // MB/ME/CF/1/IL/TNF    Type Name Format

0x01,   // TYPE LENGTH

0x0A,   // PAYLOAD LENTGH    status(1)+language(2)+string(4)  

'U',    // TYPE (text)    'U' uri  

0x02,   // Status

// 'e', 'n', // Language

'g', 'o', 'o', 'l', 'e', '.','c','a'
  • 1
    Welcome to Stack Overflow! While your answer may solve the question, [including an explanation](https://meta.stackexchange.com/q/114762) of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. You can edit your answer to add explanations and give an indication of what limitations and assumptions apply. - [From Review](https://stackoverflow.com/review/late-answers/28407988) – Adam Marshall Feb 25 '21 at 15:35