Read/Write NDEF message composed of multiple records with linux_nfc-nci

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Read/Write NDEF message composed of multiple records with linux_nfc-nci

Jump to solution
1,791 Views
ryano
Contributor I

I'm trying to build an application using the PN7120 chip and the recommended linux_nfc-nci library. It seems that the exposed API does not deal with NDEF records, only whole messages. I do see that the underlying nfc-nci stack has NDEF utilities for managing records, but I am not sure how to access this functionality in my application. Am I missing anything -- is there a way to read and/or write multiple records to/from an NFC tag with linux_nfc-nci?

Follow-up: Are there any suggested workarounds if this functionality isn't available? Reading/writing "raw" commands to the card would seem to work, but the need to do this (e.g. account for different commands for different cards) would dramatically decrease the usability of this library. I'd be surprised if this were the only solution. I appreciate the help.

Labels (1)
0 Kudos
1 Solution
1,774 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @ryano ,

 

Linux libnfc-nci library APIs nfcTag_readNdef and nfcTag_writeNdef handle NDEF message which can then be comprised of one or several NDEF records.

 

Hope that helps,

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
1,747 Views
ryano
Contributor I

Ah, I see. I was confused because ntag_readNdef returns the type of the first record and the ndef_createXYZ create single records with the ME and MB bits set.

 

It does seem the API could be friendlier for working with multiple records. For example, expose the ndef_getFriendlyType function so that the type subsequent records can be easily determined. And perhaps a function that could assemble multiple records, setting MB/ME bits properly could be exposed.

0 Kudos
1,775 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @ryano ,

 

Linux libnfc-nci library APIs nfcTag_readNdef and nfcTag_writeNdef handle NDEF message which can then be comprised of one or several NDEF records.

 

Hope that helps,

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos