Skip to content

payloadAsString doesn't work as expected? #67

Description

@white-rabbit07

Hi. I used this example
https://github.com/don/NDEF/blob/master/examples/ReadTagExtended/ReadTagExtended.ino
to read a RFID-Tag and compare the written text with a given string. It doesn't work as expected and as far as I can tell it's because of a 0x00 that is saved with the string.

I tried this:
if (payloadAsString == Hammer) {Serial.println(" The object is a Hammer"); }
... but it fails.

This snippet seems to be the problem:
String payloadAsString = ""; for (int c = 0; c < payloadLength; c++) { payloadAsString += (char)payload[c]; }

Any hints what to change?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions