Closed
Bug 1023079
Opened 11 years ago
Closed 10 years ago
[NFC] Emulator support for triggering tech-lost
Categories
(Firefox OS Graveyard :: NFC, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
2.0 S5 (4july)
People
(Reporter: tauzen, Assigned: dimi)
References
Details
(Whiteboard: [p=2])
Attachments
(2 files, 3 obsolete files)
We need additional command in the emulator to trigger tech-lost notification [1],[2]. Currently we simulate this in marionette web-api tests by calling toggleNFC(false) which disables nfc. We should be able to trigger tech-lost while having nfc enabled to test real world scenarios.
Once this will be solved a followup bug to fix the current tests will be required.
[1] - https://github.com/mozilla/gecko-dev/blob/master/dom/system/gonk/nfc_consts.js#L45
[2] - https://github.com/mozilla/gecko-dev/blob/master/dom/system/gonk/nfc_worker.js#L390
Reporter | ||
Updated•11 years ago
|
Blocks: 1019668
Updated•10 years ago
|
Blocks: b2g-nfc-emulator
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → dlee
Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8449217 -
Flags: review?(tzimmermann)
Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8449219 -
Flags: review?(tzimmermann)
Comment 3•10 years ago
|
||
Comment on attachment 8449217 [details] [diff] [review]
Emulator support for triggering tech v1
Review of attachment 8449217 [details] [diff] [review]:
-----------------------------------------------------------------
This looks very good, thank you. Just one trivial nit.
::: hw/nfc-nci.h
@@ +465,5 @@
> NCI_RF_DEACT_IDLE_MODE = 0x00,
> NCI_RF_DEACT_SLEEP_MODE = 0x01,
> NCI_RF_DEACT_SLEEP_AF_MODE = 0x02,
> + NCI_RF_DEACT_DISCOVERY = 0x03,
> + NUMBER_OF_NCI_RF_DEACT_TYPE = 0x04
There shouldn't be an assignment here for NUMBER_OF_NCI_RF_DEACT_TYPE. These NUMBER_OF_ constants are not specified in the spec and should not have an assigned value. Let the compiler count.
@@ +473,5 @@
> NCI_RF_DEACT_DH_REQUEST = 0x00,
> NCI_RF_DEACT_ENDPOINT_REQUEST = 0x01,
> NCI_RF_DEACT_RF_LINK_LOSS = 0x02,
> + NCI_RF_DEACT_NFC_B_BAD_AFI = 0x03,
> + NUMBER_OF_NCI_RF_DEACT_REASON = 0x04
Same as above.
Attachment #8449217 -
Flags: review?(tzimmermann) → review+
Comment 4•10 years ago
|
||
Comment on attachment 8449219 [details] [diff] [review]
Testcase v1
Review of attachment 8449219 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/nfc/tests/marionette/test_nfc_manager_tech_lost.js
@@ +15,5 @@
> + log('Received \'nfc-manager-tech-discovered\'');
> + is(msg.type, 'techDiscovered', 'check for correct message type');
> + is(msg.techList[0], 'P2P', 'check for correct tech type');
> +
> + emulator.deactivate();
This sounds like you're deactivating the emulator and we might want to find a general solution for this problem in another bug. The naming of all these helper functions is not pretty. Maybe we should move them into individual objects; one object per protocol (e.g., NCI.deactivate(), LLPC.connect(), SNEP.put(), etc.).
Attachment #8449219 -
Flags: review?(tzimmermann) → review+
Comment 5•10 years ago
|
||
After I deactivated an RE, I could not activate it again in P2P mode, because there was no active RE, according to the error message. After deactivation, will the emulator be in IDLE state, or will nfcd switch it to DISCOVERY?
Updated•10 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 6•10 years ago
|
||
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #5)
> After I deactivated an RE, I could not activate it again in P2P mode,
> because there was no active RE, according to the error message. After
> deactivation, will the emulator be in IDLE state, or will nfcd switch it to
> DISCOVERY?
nfcd should reset it to discovery mode
Assignee | ||
Comment 7•10 years ago
|
||
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #4)
> Comment on attachment 8449219 [details] [diff] [review]
> Testcase v1
>
> Review of attachment 8449219 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: dom/nfc/tests/marionette/test_nfc_manager_tech_lost.js
> @@ +15,5 @@
> > + log('Received \'nfc-manager-tech-discovered\'');
> > + is(msg.type, 'techDiscovered', 'check for correct message type');
> > + is(msg.techList[0], 'P2P', 'check for correct tech type');
> > +
> > + emulator.deactivate();
>
> This sounds like you're deactivating the emulator and we might want to find
> a general solution for this problem in another bug. The naming of all these
> helper functions is not pretty. Maybe we should move them into individual
> objects; one object per protocol (e.g., NCI.deactivate(), LLPC.connect(),
> SNEP.put(), etc.).
Agree, I will create another bug and refine it.
Assignee | ||
Comment 8•10 years ago
|
||
Attachment #8449217 -
Attachment is obsolete: true
Attachment #8450092 -
Flags: review+
Assignee | ||
Comment 9•10 years ago
|
||
Attachment #8449219 -
Attachment is obsolete: true
Attachment #8450718 -
Flags: review+
Assignee | ||
Updated•10 years ago
|
Comment 10•10 years ago
|
||
Comment 11•10 years ago
|
||
also landed the testcase as https://hg.mozilla.org/integration/b2g-inbound/rev/ad6d3a034431
Comment on attachment 8450718 [details] [diff] [review]
Testcase v2
Review of attachment 8450718 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/nfc/tests/marionette/test_nfc_manager_tech_lost.js
@@ +15,5 @@
> + log('Received \'nfc-manager-tech-discovered\'');
> + is(msg.type, 'techDiscovered', 'check for correct message type');
> + is(msg.techList[0], 'P2P', 'check for correct tech type');
> +
> + emulator.deactivate();
Dimi, I think you forgot to upload this function?
Assignee | ||
Comment 13•10 years ago
|
||
Sorry after rebasing I forget add head.js to patch
Attachment #8451412 -
Flags: review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Blocks: 1035041
Comment on attachment 8451412 [details] [diff] [review]
Lost file for Testcase v2
will do this in Bug 1035041
Attachment #8451412 -
Attachment is obsolete: true
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 15•10 years ago
|
||
No longer blocks: b2g-nfc
You need to log in
before you can comment on or make changes to this bug.
Description
•