×
Namespaces

Variants
Actions
Revision as of 11:33, 12 December 2013 by kiran10182 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

How to put NFC ON and OFF with Qt

From Nokia Developer 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 11:33.
38 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.

×