-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to create message with multiple records #1
Comments
Hmm I don't have the smart poster spec around, but from the internet I see that:
I think the problem is that my library does not know how to produce a payload for this type of well known format and defaults to a |
Ok, there is more generic example. Here we will get two records that starts with the same byte 0xD1 By specs we should set MB byte for first record and ME byte for last record. When marshal record we should pay attention to their order in message in order to set first byte of record (ndef header flags) properly. |
Hi! I make some fixes and create pull request. Could you check it? |
By the way, why chunks flags should be set in all records but last (according to chunk check function)? |
It seems that ndef record header (first byte) not correctly encoded when there is several records in message. Order of records in message should be considered when Marshal records.
For example, I'm trying to create smart poster message
recordUri := ndef.NewURIRecord("http://example.com")
recordTitle := ndef.NewTextRecord("hello", "en")
payloadMessage:= &ndef.Message{[]*Record{recordUri, recordTitle}}
payloadByte, _ := payloadMessage.Marshal()
message := ndef.NewMessage(ndef.NFCForumWellKnownType, "Sp", "", payloadByte)
In this example payloadMessage not correctly Marshaled
The text was updated successfully, but these errors were encountered: