Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

How to put NFC ON and OFF with Qt

From Wiki
Jump to: navigation, search

Contents

Introduction

This code example shows how you can implement NFC on-off behaviour in Qt on Symbian. If we select the check box in the UI, NFC will be active and if we un select the check box then NFC will be inactive.

The example calls Symbian C++ code and is hence Symbian-specific.

Article Metadata
Code Example
Source file: Nfconof.zip
Installation file: Media:qtnfconoff.sis
Article
Created: mahbub_s60 (02 Sep 2011)
Last edited: kiran10182 (12 Dec 2013)

Symbian C++ code

We can send ESetNfcMode to set NFC status and EGetNfcMode to get NFC status to NFC server.

TInt RNfcModeClient::SetNfcMode( TInt aMode )
{
TInt error = KErrNone;
if ( !iServerConnected )
{
error = KErrServerTerminated;
}
else
{
TPckg<TInt> param( aMode );
TIpcArgs args( &param );
error = SendReceive( ESetNfcMode, args );
}
return error;
}
 
TInt RNfcModeClient::GetNfcMode( TInt& aMode )
{
TInt error = KErrNone;
 
if ( !iServerConnected )
{
error = KErrServerTerminated;
}
else
{
TPckgBuf<TInt> param( aMode );
TIpcArgs args( &param );
error = SendReceive( EGetNfcMode, args );
aMode = param();
}
return error;
}

Screenshots

Summary

self signed sis file tested with C7 can be found here: File:Qtnfconoff.sis

Related implementation file can be found here.

This page was last modified on 12 December 2013, at 08:33.
193 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×