Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Contributor
Posts: 7
Registered: ‎09-10-2013
My Device: Z10
My Carrier: T-Mobile

nfc transaction events

Hi,

 

We have successfully installed our uicc applet and we can communicate with it through contactless communication.

We would like to be notified when an secure emelent transaction occours, but it won't work.

We also tested it with Nfctool example (modified the aid to ours), but no event received.

 

We have requested transactions through invocation framework:

 

QObject::connect( m_InvokeManager,
SIGNAL(invoked(const bb::system::InvokeRequest&)),
this:
SLOT(ReceivedInvokeRequest(const bb::system::InvokeRequest&)) );

 

void SecureElementManager::ReceivedInvokeRequest( const bb::system::InvokeRequest& request ) {

qDebug() << "SecureElementManager::ReceivedInvokeRequest() started.";
m_App->Log( "SecureElementManager::ReceivedInvokeRequest() started." );

qDebug() << "invoked by iF: " << request.target() << " MIME=" << request.mimeType() << " ACTION=" << request.action() << " URI=" << request.uri();
QByteArray data = request.data();
qDebug() << "Request: ";
if ( request.mimeType().compare("application/vnd.rim.nfc.ndef") == 0 ) {
qDebug( "NFC TRANSACTION! An NFC tag has been presented." );
m_App->Log( QString("NFC TRANSACTION!") );
} else {
if ( request.mimeType().compare("application/vnd.bb.nfc_transaction") == 0 ) {
qDebug( "NFC TRANSACTION: An NFC card emulation transaction event has been notified by an applet in the secure element" );
QString json = QString(data);
qDebug() << "Data&colon; " << json;
QString msg;
msg.append( "NFC TRANSACTION! Data&colon; " );
msg.append( json );
m_App->Log( msg );
}
}

m_App->Log( "SecureElementManager::ReceivedInvokeRequest() ended." );
qDebug() << "SecureElementManager::ReceivedInvokeRequest() ended.";

}

 

bar descriptor xml:

 

<invoke-target id="com.example.NFCProject1.t1">
<entry-point>1</entry-point>
<type>APPLICATION</type>
<filter>
<action>bb.action.OPEN</action>
<mime-type>application/vnd.bb.nfc_transaction</mime-type>
<property var="uris" value="aid://SIM/d0.00.00.00.62.03.01.0c.01.01/"/>
</filter>
</invoke-target>

 

We have selected the applet and sent various apdu-s, but no event received.

 

Laszlo

 

Retired
Posts: 571
Registered: ‎06-25-2010
My Device: Z10
My Carrier: Vodafone

Re: nfc transaction events

Hi

 

are you sure that the applet is raising the HCI event when it has completed the transaction?

 

I know for sure that NfcTool works properly (I wrote that function).

 

Regards

 

Martin

--------------------------------------------------------------------------------------------
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Follow me on Twitter: @mdwrim
New Contributor
Posts: 7
Registered: ‎09-10-2013
My Device: Z10
My Carrier: T-Mobile

Re: nfc transaction events

Hi,

 

The applet only responses with some bytes of outputs and 90 00.

Can you tell me how can I generate HCI event from javacard applet? Tried to find guides and others, but haven't find anything useful. I found only hci-api-for-java-card-REL-910.jar, but it simply won't work.

Maybe can you share the test applet what you used for the nfctool?

 

Laszlo

Retired
Posts: 571
Registered: ‎06-25-2010
My Device: Z10
My Carrier: Vodafone

Re: nfc transaction events

Hi Lazlo

 

I tested with a GemAlto developer SIM which contains various test applets including one that generates a HCI transaction event when you select the applet by AID.

 

I think you need to be using the uicc.hci.services.connectivity package per the "ETSI TS 102 705 V9.0.0 (2010-10)" specification which is titled "

Smart Cards; UICC Application Programming Interface for Java Card™ for Contactless Applications (Release 9)"

 

Regards

 

Martin

--------------------------------------------------------------------------------------------
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Follow me on Twitter: @mdwrim