W3C home > Mailing lists > Public > public-web-nfc@w3.org > July 2020

[web-nfc] Provide a way to get the NDEFMessage and NDEFRecord size before writing (#593)

From: Snapstromegon via GitHub <sysbot+gh@w3.org>
Date: Fri, 10 Jul 2020 16:39:34 +0000
To: public-web-nfc@w3.org
Message-ID: <issues.opened-654902511-1594399173-sysbot+gh@w3.org>
Snapstromegon has just created a new issue for https://github.com/w3c/web-nfc:

== Provide a way to get the NDEFMessage and NDEFRecord size before writing ==
_I did not find something like this in the spec or in Chrome's current canary (86.0.4196.0) implementation._

## Problem Abstract

I'm trying to write some data to NFC Tags, but I want to know how large the NDEFMessage/Record is before I'm writing it (to predict fail/success cases).

## Usecase

My usecase during origin trial was, that I write some optional history data into the record and I know exactly how large the size of my card is and I want to include as much of the history as possible.

## Problem / Existing Workarounds

Currently I'd need to start at some point and do a lot of trial and error which results in many read/writes or I implement the calculation myself which might result in errors.

## Proposed solution

Adding a "size" attribute (or something similar) to NDEFMessage and NDEFRecord would make this usecase way easier.

Please view or discuss this issue at https://github.com/w3c/web-nfc/issues/593 using your GitHub account
Received on Friday, 10 July 2020 16:39:36 UTC

This archive was generated by hypermail 2.4.0 : Friday, 10 July 2020 16:39:37 UTC