Closed Bug 1074611 Opened 10 years ago Closed 10 years ago

B2G NFC: pass NDEF info to MozNFCTag.

Categories

(Firefox OS Graveyard :: NFC, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.1 S8 (7Nov)

People

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

References

Details

(Whiteboard: [p=5])

Attachments

(1 file, 4 obsolete files)

      No description provided.
This bug is filed for the Gecko part of Bug 1061512.
Blocks: b2g-nfc
Depends on: 1061512
Summary: b2 → B2G NFC: pass NDEF into to Content
Summary: B2G NFC: pass NDEF into to Content → B2G NFC: pass NDEF info to Content
Depends on: 991970
Summary: B2G NFC: pass NDEF info to Content → B2G NFC: pass NDEF info to MozNFCTag.
There are 4 attributes that needs to be passed into MozNFCTag
1. ndefType
2. maxNDEFLength
3. isReadOnly
4. isFormatable

However we still need Bug 991970 to dispatch these informatio into DOM part.
If Bug 991970 stil needs a while, I will pass these information in Chrome process only in this bug, and file another bug for ContentProcess and DOM part.
Assignee: nobody → allstars.chh
Attached patch Patch (obsolete) — Splinter Review
Attachment #8510167 - Attachment is obsolete: true
Comment on attachment 8511850 [details] [diff] [review]
Patch

Review of attachment 8511850 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/nfc/nsNfc.js
@@ +27,5 @@
>   * NFCTag
> + *
> + * @param window  global window object.
> + * @param sessionToken  session token received from Chrome process.
> + * @parem event   type of nsINfcTagEvent received from Chrome process.

According to bug 991970 comment 23, maybe parent process would be better

::: dom/webidl/MozNFCTag.webidl
@@ +26,5 @@
> +  "type2",
> +  "type3",
> +  "type4",
> +  "mifare_classic"
> +};

mifare classic is not defined in NFC forum, should we change the naming to NFCTagType ?

@@ +35,5 @@
> +  readonly attribute NFCForumTagType type;
> +  readonly attribute long maxNDEFSize;
> +  readonly attribute boolean isReadOnly;
> +  readonly attribute boolean isFormatable;
> +  readonly attribute boolean canBeMadeReadOnly;

For type, maxNDEFSize, isReadOnly, isFormatable and  canBeMAdeReadOnly, they are all related to NDEF infromation.
If there is no NDEF in this tag, these attributes will be meaningless.

As discussed, we can add nullable for those attributes.
Those attributes should be null when NfcMessageHandler::TechDiscoveredNotification get |ndefInfo| equals to false

@@ +41,3 @@
>    DOMRequest readNDEF();
>    DOMRequest writeNDEF(sequence<MozNDEFRecord> records);
>    DOMRequest makeReadOnlyNDEF();

|NDEF| may be removed because MozNFCTag will only operate on tag support NDEF
Attachment #8511850 - Flags: review?(dlee)
(In reply to Dimi Lee[:dimi][:dlee] from comment #6)
> @@ +41,3 @@
> >    DOMRequest readNDEF();
> >    DOMRequest writeNDEF(sequence<MozNDEFRecord> records);
> >    DOMRequest makeReadOnlyNDEF();
> 
> |NDEF| may be removed because MozNFCTag will only operate on tag support NDEF

File Bug 1090803.
Attached patch Patch. v2. (obsolete) — Splinter Review
Attachment #8511850 - Attachment is obsolete: true
Comment on attachment 8513363 [details] [diff] [review]
Patch. v2.

Review of attachment 8513363 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, thanks!
Attachment #8513363 - Flags: review?(dlee) → review+
Comment on attachment 8513363 [details] [diff] [review]
Patch. v2.

Review of attachment 8513363 [details] [diff] [review]:
-----------------------------------------------------------------

r? to smaug for the WebIDL change.
Attachment #8513363 - Flags: review?(bugs)
Attachment #8513363 - Flags: review?(bugs) → review+
Attached patch Patch. v3. (obsolete) — Splinter Review
rebase
Attachment #8513363 - Attachment is obsolete: true
Attachment #8516451 - Flags: review+
Attached patch Patch. v4.Splinter Review
rebase
Attachment #8516451 - Attachment is obsolete: true
Attachment #8516522 - Flags: review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: