Closed Bug 1034998 Opened 10 years ago Closed 6 years ago

Support HCI event <EVT-TRANSACTION> at NFC Emulator

Categories

(Firefox OS Graveyard :: NFC, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: ming.yin, Unassigned)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0 (Beta/Release)
Build ID: 20140605174243
In case the NFC emulator can generate and send a HCI-event "EVT-TRANSACTION" to the NFC components at the Gecko layer, we would be able to test the bug 979767, without using the SIM card and POS simulator software. This makes sense for QA team.
Flags: needinfo?(tzimmermann)
In case the NFC emulator can generate and send a HCI-event "EVT-TRANSACTION" to the NFC components at the Gecko layer, we would be able to test the bug 979767, without using the SIM card and POS simulator software. This makes sense for QA team.
Hi Ming,

The spec is 

  http://www.gsma.com/digitalcommerce/wp-content/uploads/2013/12/TS26v4-1.pdf

Sec 4.10, right? This looks like Java. Is there a spec for the low-level messages?
Flags: needinfo?(tzimmermann)
Hi Thomas,

sorry for not attaching the related document. Please find the right document from ETSI. http://www.etsi.org/deliver/etsi_ts/102600_102699/102622/12.00.00_60/ts_102622v120000p.pdf
In section 11.2.2.4 (page 55), you can find the data structure of an EVT-TRANSACTION.
Assignee: nobody → tzimmermann
Wait, you can't just assign things to me.
Assignee: tzimmermann → nobody
sorry about it! what would be the correct way?
Having a bug assigned usually means that you're actively working on it. At Mozilla we're asked to un-assign ourselves from bugs if we're not actively working on it, so that others can pick them up if they are interested.

I'm needinfo?'ing myself, so that I won't forget to have a look at the spec.

I already have one question: EVT_TRANSACTION looks like it's uses in conjunction with other events/commands/infrastructure. Do you know what we might need besides EVT_TRANSACTION in the emulator? Maybe AID support? Initialization events?
Flags: needinfo?(tzimmermann)
I remember that you created another bug 1030596 for the SE/applet emulation purpose. 

To my understanding, currently, the developer can send certain commands to NFC emulator , which trigger certain NFC event being sent to Gecko, right? Can I imagine that certain secure element component can send some test apdu commands to the NFC emulator and get response from it?  If emulator can support this feature, the automatic QA test for SE-API would be possible, without involving the real SIM card and the SIM applets.
Flags: needinfo?(tzimmermann)
See Also: → 1035721
A detailed log file about HCI-event handling at the gonk layer can be found here: https://bugzilla.mozilla.org/attachment.cgi?id=8453141
A proposal to enhance nfc emulator to trigger sending the hci-event.
Hi Dimi

(In reply to Ming Yin from comment #4)
> Hi Thomas,
> 
> sorry for not attaching the related document. Please find the right document
> from ETSI.
> http://www.etsi.org/deliver/etsi_ts/102600_102699/102622/12.00.00_60/
> ts_102622v120000p.pdf
> In section 11.2.2.4 (page 55), you can find the data structure of an
> EVT-TRANSACTION.

This spec describes the architecture around EVT_TRANSACTION. It involves several protocols on the emulated host and terminal (Sec 4.1). There are currently two plans for supporting this.

1) In the long run we want to support the specified protocols in the emulator and generate EVT_TRANSACTION just like real hardware would do. The problem is that this is a lot of work and will certainly take a while.

2) The near-term solution is to build a single flag into the emulator that tells nfcd to generate a fake EVT_TRANSACTION, and have nfcd forward a message to Gecko.

What's your opinion on the topic? Would you have time to work on option 1? Would you be OK with option 2? Do we actually need a near-term solution?
Flags: needinfo?(dlee)
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #11)
> Hi Dimi
> 
> (In reply to Ming Yin from comment #4)
> > Hi Thomas,
> > 
> > sorry for not attaching the related document. Please find the right document
> > from ETSI.
> > http://www.etsi.org/deliver/etsi_ts/102600_102699/102622/12.00.00_60/
> > ts_102622v120000p.pdf
> > In section 11.2.2.4 (page 55), you can find the data structure of an
> > EVT-TRANSACTION.
> 
> This spec describes the architecture around EVT_TRANSACTION. It involves
> several protocols on the emulated host and terminal (Sec 4.1). There are
> currently two plans for supporting this.
> 
> 1) In the long run we want to support the specified protocols in the
> emulator and generate EVT_TRANSACTION just like real hardware would do. The
> problem is that this is a lot of work and will certainly take a while.
> 
> 2) The near-term solution is to build a single flag into the emulator that
> tells nfcd to generate a fake EVT_TRANSACTION, and have nfcd forward a
> message to Gecko.
> 
> What's your opinion on the topic? Would you have time to work on option 1?
> Would you be OK with option 2? Do we actually need a near-term solution?

Hi Thomas,
I am ok to work on option1, but I think I will need your help about the overall architecture. If you are ok with this, I can work on option1.

For option 2, if the effort is not huge, I am also ok with it. Do you already have the idea about how a flag in emulator could tell nfcd to generate EVT_TRANSACTION, could you explain this more detailly ? Thanks !
Flags: needinfo?(dlee)
Hi Dimi

> Hi Thomas,
> I am ok to work on option1, but I think I will need your help about the
> overall architecture. If you are ok with this, I can work on option1.

I'm not sure yet how this works in detail. The NCI spec contains a number of commands to interact with SE elements. I think they can be used to transfer HCI events. I only did some experiments, but nothing concrete.


> For option 2, if the effort is not huge, I am also ok with it. Do you
> already have the idea about how a flag in emulator could tell nfcd to
> generate EVT_TRANSACTION, could you explain this more detailly ? Thanks !

The idea for option 2 is:

  - add telnet interface for triggering EVT_TRANSACTION,
  - make emulator create message to kernel driver,
  - kernel driver would expose this to user-space via a device file,
  - nfcd listens on this device file and generates EVT_TRANSACTION.

I think we should first find out if anyone actually needs emulator support for EVT_TRANSACTION soon. Otherwise I'd prefer to go with option 1 from the beginning.
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #13)
> Hi Dimi
> 
> > Hi Thomas,
> > I am ok to work on option1, but I think I will need your help about the
> > overall architecture. If you are ok with this, I can work on option1.
> 
> I'm not sure yet how this works in detail. The NCI spec contains a number of
> commands to interact with SE elements. I think they can be used to transfer
> HCI events. I only did some experiments, but nothing concrete.
> 
> 
> > For option 2, if the effort is not huge, I am also ok with it. Do you
> > already have the idea about how a flag in emulator could tell nfcd to
> > generate EVT_TRANSACTION, could you explain this more detailly ? Thanks !
> 
> The idea for option 2 is:
> 
>   - add telnet interface for triggering EVT_TRANSACTION,
>   - make emulator create message to kernel driver,
>   - kernel driver would expose this to user-space via a device file,
>   - nfcd listens on this device file and generates EVT_TRANSACTION.
> 
> I think we should first find out if anyone actually needs emulator support
> for EVT_TRANSACTION soon. Otherwise I'd prefer to go with option 1 from the
> beginning.

Agree, I think garner is working on EVT_TRANSACTION, maybe garner could provide some information about if we need EVT_TRANSACTION for emulator soon.
Flags: needinfo?(dgarnerlee)
I have a WIP version of the EVT_TRANSACTION using a filtered system message now, and will be needing to write unit tests soon. If Option 2) is a simple flag, maybe it can be implemented short term in time for v2.1 while Option 1 is worked on longer term?
Flags: needinfo?(dgarnerlee)
I implemented a q'n'd hack for generating EVT_TRANSACTION from within the emulator via telnet. It generates a specially crafted NCI data message that can be used to create a notification within nfcd.

How could we handle this in nfcd?

 a) The kernel driver could filter out the data packet and signal the event to nfcd via a separate device file.

 b) Is is possible to extract the packet from the regular NCI stream within nfcd? This needs to work without any setup.
Flags: needinfo?(dlee)
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #16)
> I implemented a q'n'd hack for generating EVT_TRANSACTION from within the
> emulator via telnet. It generates a specially crafted NCI data message that
> can be used to create a notification within nfcd.
> 
> How could we handle this in nfcd?
> 
>  a) The kernel driver could filter out the data packet and signal the event
> to nfcd via a separate device file.
> 
>  b) Is is possible to extract the packet from the regular NCI stream within
> nfcd? This needs to work without any setup.

I will vote for solution a) because the NCI data is actually processed by libnfc-nci, so I think for solution b), nfcd may not have the chance to get the data.
Flags: needinfo?(dlee)
Depends on: 1062786
Firefox OS is not being worked on
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: