×
Namespaces

Variants
Actions
Revision as of 04:17, 11 October 2012 by hamishwillee (Talk | contribs)

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
Installation file: Media:qtnfconoff.sis
Article
Created: mahbub_s60 (02 Sep 2011)
Last edited: hamishwillee (11 Oct 2012)

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 from projects, https://projects.developer.nokia.com/nfconof

51 page views in the last 30 days.
×