How to put NFC ON and OFF with Qt
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: https://projects.developer.nokia.com/nfconof
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( ¶m );
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( ¶m );
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


(no comments yet)