Closed Bug 1087925 Opened 11 years ago Closed 11 years ago

calling some NFCTag API should throw if the condition is not met.

Categories

(Firefox OS Graveyard :: NFC, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.1 S9 (21Nov)

People

(Reporter: allstars.chh, Assigned: allstars.chh)

References

Details

(Whiteboard: [p=1])

Attachments

(1 file, 1 obsolete file)

In Bug 1074611 we will add maxNDEFSize, isReadOnly, canBeMadeReadOnly attributes into MozNFCTag. So the following situations should throw. 1. Writing a NDEF that exceeds the maxNDEFSize or isReadOnly is true 2. call makeReadOnly when canBeMadeReadOnly is false.
Also calling format when the tag is not formatable should throw.
Depends on: 1086179
No longer depends on: 1086179
Attached patch Patch (obsolete) — Splinter Review
Assignee: nobody → allstars.chh
Attachment #8517321 - Flags: review?(dlee)
Comment on attachment 8517321 [details] [diff] [review] Patch Review of attachment 8517321 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/nfc/nsNfc.js @@ +78,5 @@ > + > + let ndefLen = 0; > + for (let record of records) { > + let idLen = record.id.length ? 1 : 0; > + let payloadLen = record.payload.length > 256 ? 4 : 1; Check the NDEF spec,it doesn't define that a NDEF record with payload length less than 256, it must use a short record. So we should check SR field in flag here.
Attachment #8517321 - Flags: review?(dlee)
(In reply to Dimi Lee[:dimi][:dlee] from comment #3) > Comment on attachment 8517321 [details] [diff] [review] > Patch > > Review of attachment 8517321 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: dom/nfc/nsNfc.js > @@ +78,5 @@ > > + > > + let ndefLen = 0; > > + for (let record of records) { > > + let idLen = record.id.length ? 1 : 0; > > + let payloadLen = record.payload.length > 256 ? 4 : 1; > > Check the NDEF spec,it doesn't define that a NDEF record with payload length > less than 256, it must use a short record. > So we should check SR field in flag here. After checking, the flag in NDEF is set in nfcd not in App, so current way is correct.
Attachment #8517321 - Flags: review+
Attached patch Patch v2.Splinter Review
use record.size base on Bug 1094669.
Attachment #8517321 - Attachment is obsolete: true
Attachment #8518682 - Flags: review?(dlee)
Attachment #8518682 - Flags: review?(dlee) → review+
Comment on attachment 8518682 [details] [diff] [review] Patch v2. Add r? to smaug for reviewing the DOMError part.
Attachment #8518682 - Flags: review?(bugs)
Attachment #8518682 - Flags: review?(bugs) → review+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: