NDEF | Read and Write NDEF Messages

 by   don C++ Version: 1.1.0 License: Non-SPDX

kandi X-RAY | NDEF Summary

kandi X-RAY | NDEF Summary

NDEF is a C++ library typically used in Internet of Things (IoT), Raspberry Pi, Arduino applications. NDEF has no bugs, it has no vulnerabilities and it has low support. However NDEF has a Non-SPDX License. You can download it from GitHub.

Read and Write NDEF messages on NFC Tags with Arduino. NFC Data Exchange Format (NDEF) is a common data format that operates across all NFC devices, regardless of the underlying tag or device technology. This code works with the Adafruit NFC Shield, Seeed Studio NFC Shield v2.0 and the Seeed Studio NFC Shield. The library supports I2C for the Adafruit shield and SPI with the Seeed shields. The Adafruit Shield can also be modified to use SPI. It should also work with the Adafruit NFC Breakout Board.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              NDEF has a low active ecosystem.
              It has 266 star(s) with 132 fork(s). There are 26 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 30 open issues and 28 have been closed. On average issues are closed in 223 days. There are 9 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of NDEF is 1.1.0

            kandi-Quality Quality

              NDEF has 0 bugs and 0 code smells.

            kandi-Security Security

              NDEF has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              NDEF code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              NDEF has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              NDEF releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of NDEF
            Get all kandi verified functions for this library.

            NDEF Key Features

            No Key Features are available at this moment for NDEF.

            NDEF Examples and Code Snippets

            No Code Snippets are available at this moment for NDEF.

            Community Discussions

            QUESTION

            Android NfcAdapter.enableReaderMode callback not called
            Asked 2022-Mar-29 at 06:45

            I'd like to, at a certain point in an app, request that the user scan an NFC tag. It seems like enableReaderMode would be a reasonable solution. However, it's not working - consider the following code placed in onCreate in an Activity in a new Android project (with the NFC permission added).

            ...

            ANSWER

            Answered 2022-Mar-29 at 06:45

            You have configured enableReaderMode to skip Ndef detection BUT you have not configured it to read any other Tag Tech types

            Instead of NfcAdapter.FLAG_READER_SKIP_NDEF_CHECK you flag options should look like below to be useful to read Tags

            Source https://stackoverflow.com/questions/71657452

            QUESTION

            Extract payload from NDEF message
            Asked 2022-Mar-01 at 18:32

            I am using Arduino UNO and a PN532 NFC module to receive P2P NDEF messages from an Android phone.

            I am sending a plaintext string "Hello". When the transfer is successful, I get this on my Arduino: image

            How can I extract the string "Hello" (I think the pairs of numbers before it is the "Hello" in hexadecimal, same for the "text/plain" type indication, type length and payload length) from the NDEF message payload into a regular variable?

            Here is my Arduino code:

            ...

            ANSWER

            Answered 2022-Mar-01 at 18:32

            A NdefMessage is made up of multiple NdefRecord items and you msg has 1 record

            so this should do it (not tested)

            Source https://stackoverflow.com/questions/71312574

            QUESTION

            NFC Tag prevent copying NTag21x
            Asked 2022-Feb-25 at 18:29

            I would like to store data in an NFC tag in a secure way to avoid copying, but I would like the tag to be affordable and supported by most devices (smartphones).

            The NTag21x seems better than the classic Mifare whose algorithm has been corrupted. But is it possible with this one to lock part of the data by leaving an NDef record accessible for reading?

            Is the NTag21x secure? I saw that his password was 32bits, it seems easy to break with a dictionary, am I wrong?

            On the other hand, after a lot of research I can't really find any detailed documentation on the subject. I don't understand how a reader can tell the difference between the different tags, and what they have in common at the communication protocol level, how to detect a type of tag, know if I can support it in my application. I would like to make a C# / Xamarin application.

            ...

            ANSWER

            Answered 2022-Feb-25 at 18:29

            You need to read the datasheet for the tag.

            Section 8.5.7 and allows you with the AUTH0 field to set the first page at which the password is used from.

            Thus the first part of the Tag can be readable and later pages can be read/write protected. As long as the tag is big enough to store Ndef message at the beginning of the Tag and your private data at the end of the Tag without using overlapping pages you can achieve free to read and password protected data.

            You can also set the AUTHLIM to set the maximum number of negative password verification attempts so that it is not possible to brute force the password.

            To configure these features you need to write to the appropriate memory pages using the low level NfcA transceive commands detailed in the datasheet.

            The biggest problem you have with password protection is if you freely hand out an App that uses the password as it is trivial to reverse engineer the password from the JVM byte code that uses it.

            You don't really need to know the different Tags are identified but having a good understanding of how the different levels of protocols and standards fit together is key, this is where this diagram from wikipedia is good.

            Source https://stackoverflow.com/questions/71267735

            QUESTION

            Using NFC to open my application causes a separate version of it to be opened instead of the one that was open when RFID was found
            Asked 2022-Feb-24 at 13:17

            I am attempting to create an application centered around NFC paired with multiple RFIDs. For this reason I am programming the RFIDs with NDefRecords that open a specific activity in my application. The NdefMessage doing this is as follows

            ...

            ANSWER

            Answered 2022-Feb-24 at 13:17

            You don't seem to be doing any foreground detection, really manifest entries are only used to start your App via NFC if not already running.

            If your App is running you should use one of the 2 foreground detection API's, the old an not so reliable enableForegroundDispatch or the newer and better enableReaderMode

            Here is an example of how use the better enableReaderMode

            You can use both of these in conjunction with Manifest filters to handle NFC when your App is and is not running when the NFC Tag is presented.

            Also note that your Manifest filter won't trigger for the NdefFormatable of your write method, your Manifest filter need to filter for ACTION_TECH_DISCOVERED and android.nfc.tech.NdefFormatable. See Here for details

            Source https://stackoverflow.com/questions/71223794

            QUESTION

            Remove locale from NFC record
            Asked 2022-Feb-16 at 14:52

            I want to pass a text value from my NFC tag to a variable, but want to remove the locale from the text passed to the variable (note, not remove it from the tag).

            I am using the nfc_manager package.

            Here is the code portion I am using that relates to scanning the tag:

            ...

            ANSWER

            Answered 2022-Feb-16 at 14:52

            The first byte is the length of the characters of the language string

            So this should work (my dart is not that good)

            Source https://stackoverflow.com/questions/71137055

            QUESTION

            is there a way to see a functions changes after that it were decorated?
            Asked 2022-Feb-04 at 11:43

            for example for the below code is there any tool to see the definition of the function that is decorated?

            ...

            ANSWER

            Answered 2022-Feb-04 at 11:43

            If you intend to see what's the decorator @app.route() does, the answer lies in Python flask source code. I'm using flask 1.1.2 (the newest stable version currently is 2.0.0), and here is what it's defined in the file app.py, putting aside the many comments:

            Source https://stackoverflow.com/questions/70984606

            QUESTION

            Reading a message stored on NDEF tag. Android
            Asked 2022-Feb-03 at 18:04

            I was trying to find a working example of how it is possible to read a message stored on a NDEF tag within the app's active Activity. By far the best I have is such a code:

            ...

            ANSWER

            Answered 2022-Feb-03 at 18:04

            So the normal pattern for NFC in Android is:-

            1)When you App is not running an you want it started when a certain type of NFC Tag is presented to the device then you put your intent-filters in the manifest. Your App then gets started and passed an Intent that you need to process in your onCreate method using getIntent()

            2a)Your App is already running in the foreground then you use enableForegroundDispatch, giving it a pending Intent on what you want to be notified about, this is then processed in onNewIntent when your App is restarted (paused and resumed) to receive the Intent.

            onNewIntent won't get invoked by any manifest entry.

            or

            2b)Your App is already running in the foreground then you use enableReaderMode which is a better replacement for enableForegroundDispatch, you then process the Tag in onTagDiscovered which is in a separate thread.

            How to process the Intent received via pattern 1 and 2a is the same, just they need to be called from the correct path in the code that matches the method that triggered the Intent i.e in onCreate or in onNewIntent

            Check out Empty NFC Tag read and write Android Application. Mobile own message returning while scanning Empty Tag but Application not working? for an example of how to use Manifest and enableForeGroundDispatch

            The are also plenty examples of using enableReaderMode on Stackoverflow as well.

            Source https://stackoverflow.com/questions/70968791

            QUESTION

            Empty NFC Tag read and write Android Application. Mobile own message returning while scanning Empty Tag but Application not working?
            Asked 2022-Feb-01 at 15:29

            I have make an application for read and write on NFC TAG. But, while I am scanning Empty NFC Tag after opening my application it not responding as I expected as my Application Toast Message "Tag is empty". But, when I close my application then I receiving Mobile belting message.

            Basically, I need the help as following:

            1. Detect Empty NFC Tag from my application.
            2. Write Server information in that Empty Tag.
            3. After then reading that information from that Tag.

            I am including my code here.

            AndroidManifest.xml

            ...

            ANSWER

            Answered 2022-Feb-01 at 15:29

            To handle unformatted Ndef Tags change your "nfc_tech_filter.xml" file to the one below:-

            Source https://stackoverflow.com/questions/70941267

            QUESTION

            Encrypt data in Javascript, Decrypt data in C# using private/public keys
            Asked 2022-Jan-26 at 13:22

            I want to encrypt data in a web browser that is send to my C# backend and decrypted there.

            That fails because I am unable to decrypt the data generated on the frontend in the backend.

            Here's what I did so far.

            First I created a private/public key pair (in XmlString Format). I took the ExportPublicKey function to generate the public key file from here: https://stackoverflow.com/a/28407693/98491

            ...

            ANSWER

            Answered 2022-Jan-24 at 15:42

            You need to encrypt with the private key and then decrypt with the public key

            Source https://stackoverflow.com/questions/70835886

            QUESTION

            Writing NDEF to Mifare S50 with Raspberry Pi
            Asked 2022-Jan-06 at 01:21

            I am trying to write NDEF data to an NFC Tag (Mifare S50 chip) so it can work with my iPhone, I'm using a Raspberry Pi 4 with a RC522 NFC module connected via GPIO and using SPI.

            I tried a few approaches to this, and ended up with the code above which didn't seem to write anything to the tag, and it's indeed not readable by my phone, and I think I might be messing up somewhere.

            Here's the code:

            ...

            ANSWER

            Answered 2022-Jan-06 at 01:21

            There are two problems with this code.

            1)You have created a "stream of bytes" of the ndef message but the SimpleMFRC522 package expects a Unicode String and encodes it to convert it to a "stream of bytes", so basically as it is already a "stream of bytes" it cannot be double encoded.

            2)The Mifare S50 chip is a Mifare Classic family chip and these are a proprietary format and don't conform to the NFC Forum Standards and thus don't have a Standards defined way to store Ndef data on them (You need to do more than write a raw set of bytes to the memory to chip for it to be recognised as the data being the Ndef format of data).

            For NFC standard compliant/compatible chips there are a number of defined types of how the Ndef data is stored on each type.

            While NXP has defined a proprietary way to store Ndef data on a Mifare Classic chip, but the "SimpleMFRC522" is very simple indeed and does not have the code to write the Standard Ndef messages never mind the non standard proprietary methods.

            I also note that while the iPhone hardware can read Mifare Classic cards at the low level, I'm not sure it has implemented the Ndef data format on top as well. I do know that some Android phones don't support the proprietary Mifare Classic Hardware at all.

            I suggest you read https://www.nxp.com/docs/en/application-note/AN1305.pdf as this is the proprietary format definition on how to store NDEF data on these cards

            Unfortunately the RC522 is very old and has limited capabilities and thus is not well supported by more capable Python NFC modules.

            You might be better off with https://github.com/ondryaso/pi-rc522 as that at least allows you to write raw bytes.

            Source https://stackoverflow.com/questions/70600519

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install NDEF

            To use the Ndef library in your code, include the following in your sketch. For the Adafruit Shield using I2C. For the Seeed Shield using SPI.

            Support

            Reading from Mifare Classic Tags with 4 byte UIDs.Writing to Mifare Classic Tags with 4 byte UIDs.Reading from Mifare Ultralight tags.Writing to Mifare Ultralight tags.Peer to Peer with the Seeed Studio shield
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/don/NDEF.git

          • CLI

            gh repo clone don/NDEF

          • sshUrl

            git@github.com:don/NDEF.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link