Closed
Bug 1023683
Opened 10 years ago
Closed 10 years ago
[NFC] Emulator support for reading NDEF data from type 3 tag
Categories
(Firefox OS Graveyard :: NFC, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
2.0 S4 (20june)
People
(Reporter: dimi, Assigned: dimi)
References
Details
(Whiteboard: [p=5])
Attachments
(2 files, 10 obsolete files)
Emulator should support processing type 3 tag
- reading function should be implemented in this bug
Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8439094 -
Flags: review?(tzimmermann)
Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8439097 -
Flags: review?(tzimmermann)
Assignee | ||
Comment 3•10 years ago
|
||
Attachment #8439098 -
Flags: review?(tzimmermann)
Assignee | ||
Comment 4•10 years ago
|
||
Attachment #8439099 -
Flags: review?(tzimmermann)
Assignee | ||
Comment 6•10 years ago
|
||
Attachment #8439729 -
Flags: review?(tzimmermann)
Assignee | ||
Comment 7•10 years ago
|
||
Attachment #8439099 -
Attachment is obsolete: true
Attachment #8439099 -
Flags: review?(tzimmermann)
Attachment #8439764 -
Flags: review?(tzimmermann)
Comment 8•10 years ago
|
||
Comment on attachment 8439094 [details] [diff] [review]
Part1. Set rf mode according to protocol v1
Review of attachment 8439094 [details] [diff] [review]:
-----------------------------------------------------------------
I'm r-'ing this patch, because I'm not convinced by the dynamic approach.
The current RF mode is quick hack I put in when I needed to get something working. Let's first discuss on IRC how to clean this up.
::: android/console.c
@@ +4001,5 @@
> } else {
> nfc->active_rf = nfc->rf + param->rf;
> }
> +
> + nfc_set_rf_mode_by_protocol(nfc->active_rf, param->re->rfproto);
This value should rather be set as part of the initialization of nfc_rf. Or is there a reason why this _must_ be set dynamically? I'd rather prefer to add new entries to nfc->rf.
::: hw/nfc-rf.c
@@ -22,4 @@
> rf->iface = iface;
> switch (iface) {
> case NCI_RF_INTERFACE_FRAME:
> - // TODO: this is also depend on protocol
You should pass in the protocol as well and do a more complex setup here.
::: hw/nfc.c
@@ +78,5 @@
> return NULL;
> }
>
> +int
> +nfc_set_rf_mode_by_protocol(struct nfc_rf* rf, enum nci_rf_protocol proto)
This function should be located in nfc_rf.c
Attachment #8439094 -
Flags: review?(tzimmermann) → review-
Comment 9•10 years ago
|
||
Comment on attachment 8439097 [details] [diff] [review]
Part2 Support t3t polling command v1
Review of attachment 8439097 [details] [diff] [review]:
-----------------------------------------------------------------
Nits only. Looks good!
::: hw/nfc-nci.c
@@ +781,5 @@
> +{
> + /* We do nothing here except send notification to HOST */
> + struct nfc_t3t_polling_ntf_param* ntf;
> +
> + ntf = qemu_malloc(sizeof(struct nfc_t3t_polling_ntf_param));
Use 'sizeof(*ntf)'. It's less likely to break if the data structures get renamed or refactored.
::: hw/nfc-nci.h
@@ +488,5 @@
> +struct nci_t3t_polling_cmd {
> + uint16_t sc;
> + uint8_t rc;
> + uint8_t tsn;
> +};
Please add ' __attribute__((packed))' right before the semicolon. It's not strictly necessary here, but certainly safer in the long run.
@@ +494,5 @@
> +struct nci_t3t_polling_ntf {
> + uint8_t status;
> + uint8_t nres;
> + uint8_t res[];
> +};
Again, packed.
Attachment #8439097 -
Flags: review?(tzimmermann) → review+
Comment 10•10 years ago
|
||
Comment on attachment 8439098 [details] [diff] [review]
Part3 add type 3 tag as a remote end point v1
Review of attachment 8439098 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good.
::: hw/nfc-re.c
@@ +22,4 @@
> #include "llcp-snep.h"
> #include "nfc-re.h"
>
> +/* NFCID2 is deifned in [Digital] Table44 */
'defined'
@@ +24,5 @@
>
> +/* NFCID2 is deifned in [Digital] Table44 */
> +struct nfc_re nfc_res[5] = {
> + INIT_NFC_RE([0], NCI_RF_PROTOCOL_NFC_DEP, NCI_RF_NFC_F_PASSIVE_LISTEN_MODE,
> + NULL, "deadbeaf0", "\x01\xfe\x0\x0\x0\x0\x1", nfc_res+0),
Start counting at 0, instead of 1, so that indices in the names are equal.
::: hw/nfc-tag.h
@@ +142,5 @@
> struct nfc_t2t_format format;
> };
>
> +/**
> + * There is no specefic size defined in T3T sepc.
'specific'
Attachment #8439098 -
Flags: review?(tzimmermann) → review+
Comment 11•10 years ago
|
||
Comment on attachment 8439764 [details] [diff] [review]
Part4. Process type 3 tag check command v2
Review of attachment 8439764 [details] [diff] [review]:
-----------------------------------------------------------------
This looks good, except for some the missing enum values. If we define constants from a standard, we should define all that belong together. Will make it easier to later see what's missing.
As a side note, nfc-re.c keeps growing and we should think about splitting it up.
::: hw/nfc-tag.h
@@ +90,5 @@
> +
> +enum t3t_command_set {
> + CHECK_COMMAND = 0x06,
> + UPDATE_COMMAND = 0x08
> +};
[T3TOP] also lists the command 'POLLING'.
Attachment #8439764 -
Flags: review?(tzimmermann) → review+
Updated•10 years ago
|
Attachment #8439729 -
Flags: review?(tzimmermann) → review+
Comment 12•10 years ago
|
||
Comment on attachment 8439094 [details] [diff] [review]
Part1. Set rf mode according to protocol v1
Review of attachment 8439094 [details] [diff] [review]:
-----------------------------------------------------------------
We land this now and improve the RF and RE handling in bug 1026422.
Attachment #8439094 -
Flags: review- → review+
Assignee | ||
Comment 13•10 years ago
|
||
Attachment #8439094 -
Attachment is obsolete: true
Attachment #8441283 -
Flags: review+
Assignee | ||
Comment 14•10 years ago
|
||
Attachment #8439097 -
Attachment is obsolete: true
Attachment #8441285 -
Flags: review+
Assignee | ||
Comment 15•10 years ago
|
||
Attachment #8439098 -
Attachment is obsolete: true
Attachment #8441287 -
Flags: review+
Assignee | ||
Comment 16•10 years ago
|
||
Attachment #8439764 -
Attachment is obsolete: true
Attachment #8441288 -
Flags: review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 17•10 years ago
|
||
Please run this through Try (and post a link here) before requesting checkin. Thanks! :)
Keywords: checkin-needed
Assignee | ||
Comment 18•10 years ago
|
||
sorry, i forget this should be a pull request
Attachment #8441283 -
Attachment is obsolete: true
Attachment #8441285 -
Attachment is obsolete: true
Attachment #8441287 -
Attachment is obsolete: true
Attachment #8441288 -
Attachment is obsolete: true
Attachment #8441805 -
Flags: review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 19•10 years ago
|
||
Keywords: checkin-needed
Updated•10 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 20•10 years ago
|
||
Test case try server result : https://tbpl.mozilla.org/?tree=Try&rev=5521312d4b27
Please help merge test case for this bug, thanks
Keywords: checkin-needed
Assignee | ||
Comment 21•10 years ago
|
||
remove checkin-need base testcase need to update according to latest head.js change
Keywords: checkin-needed
Assignee | ||
Comment 22•10 years ago
|
||
Attachment #8439729 -
Attachment is obsolete: true
Attachment #8448546 -
Flags: review+
Keywords: checkin-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•