- From: Yriarte, Luc <luc.yriarte@intel.com>
- Date: Sun, 12 Jan 2014 13:01:12 +0000
- To: Don Coleman <dcoleman@chariotsolutions.com>, "public-nfc@w3.org" <public-nfc@w3.org>
- Message-ID: <8A6036327A83774CAEB939CB8A720E83457F77C6@IRSMSX101.ger.corp.intel.com>
- Removing recordType attribute (and the corresponding enum type): I guess I'm okay with that, provided we still leave to the developer some simple mean to get the record type without explicitly decoding the tnf byte. Usually it is considered good practice to use string enums instead of numeric http://darobin.github.io/api-design-cookbook/#numerical-constants , but in this case if we want to keep closer to the NFC spec we can have a numeric enum like you proposed already http://lists.w3.org/Archives/Public/public-nfc/2013Mar/0002.html For that matter, we can have a helper function on the NDEFRecord interface that returns this enum value from the tnf byte, doing the 3 bit mask. - SmartPoster: Although the payload is a NDEF record in the NFC specs, I'd rather hide this from the NDEFRecordSmartPoster constructor, as it would let developers create nested smart poster records. It makes the API simple to understand, and in any case there is always the top level NDEFRecord constructor with the byte[] payload for whatever is not explicitly supported. From: Don Coleman [mailto:dcoleman@chariotsolutions.com] Sent: Wednesday, January 8, 2014 5:01 PM To: public-nfc@w3.org Subject: NDEF Record Section 12 - NDEF Record Can we remove the recordType attribute from the NDEFRecord interface? The record's TNF and type tell us this information. The TNF tell how to interpret the Type. The Type tells how to interpret the Payload. Section 12.1 - Attributes TNF Edits 3 (URI) should be 3 (Absolute URI) 2 (Media) should be 2 (Media-type) add 6 (Unchanged) TNF is 3 bits when setting the value. When the TNF is read from the Message, it contains additional data. https://github.com/don/ndef-js/blob/master/lib/ndef.js#L274 Should we refer to the NFC Forum Specs? ---- Can we specify the TNF and Type in each of the Record Interface definitions? Section 13 - NDEF Record Text TNF Well-known (0x1) Type T Section 14 - NDEF Record URI TNF Well-known (0x1) Type U It should be clear that this is not a TNF Absolute URI (0x3) record. Section 15 - NDEF Record Media TNF Mime Media-type (0x2) Type - set by user Section 16 - NDEF Record Smart Poster TNF Well-known (0x1) Type Sp Can we note that the payload of a Smart Poster is another NDEF Record? I'd like to see Smart Poster record grouped with the other Well-known record types. Section 17 - Enumerations Suggest removing this section, since the TNF and type tell us the same thing and offer more flexibility. "unknown" is confusing for a general record since there is also a TNF Unknown (0x5).
Received on Sunday, 12 January 2014 13:01:46 UTC